@progress/kendo-angular-popup
Advanced tools
Comparing version 2.4.0-dev.201805251319 to 2.4.0-dev.201805280957
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("tslib"),require("@angular/core"),require("rxjs/observable/fromPromise"),require("rxjs/observable/fromEvent"),require("rxjs/operators/auditTime"),require("rxjs/observable/merge"),require("@angular/animations"),require("@angular/common")):"function"==typeof define&&define.amd?define(["tslib","@angular/core","rxjs/observable/fromPromise","rxjs/observable/fromEvent","rxjs/operators/auditTime","rxjs/observable/merge","@angular/animations","@angular/common"],e):"object"==typeof exports?exports.KendoAngularPopup=e(require("tslib"),require("@angular/core"),require("rxjs/observable/fromPromise"),require("rxjs/observable/fromEvent"),require("rxjs/operators/auditTime"),require("rxjs/observable/merge"),require("@angular/animations"),require("@angular/common")):t.KendoAngularPopup=e(t.tslib,t["@angular/core"],t["rxjs/observable/fromPromise"],t["rxjs/observable/fromEvent"],t["rxjs/operators/auditTime"],t["rxjs/observable/merge"],t["@angular/animations"],t["@angular/common"])}(this,function(t,e,n,o,i,r,s,a){return function(t){function e(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return t[o].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);e.PopupService=o.PopupService,e.POPUP_CONTAINER=o.POPUP_CONTAINER;var i=n(4);e.PopupComponent=i.PopupComponent;var r=n(18);e.PopupModule=r.PopupModule},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(4),s=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)};e.POPUP_CONTAINER=new i.InjectionToken("Popup Container");var a=function(){function t(t,e,n,o){this.applicationRef=t,this.componentFactoryResolver=e,this.injector=n,this.container=o}return Object.defineProperty(t.prototype,"rootViewContainer",{get:function(){var t=this.applicationRef.components||[];if(t[0])return t[0];throw new Error("\n View Container not found! Inject the POPUP_CONTAINER or define a specific ViewContainerRef via the appendTo option.\n See http://www.telerik.com/kendo-angular-ui/components/popup/api/POPUP_CONTAINER/ for more details.\n ")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rootViewContainerNode",{get:function(){return this.container?this.container.nativeElement:this.getComponentRootNode(this.rootViewContainer)},enumerable:!0,configurable:!0}),t.prototype.open=function(t){void 0===t&&(t={});var e=this.contentFrom(t.content),n=e.component,o=e.nodes,i=this.appendPopup(o,t.appendTo),r=i.instance;this.projectComponentInputs(i,t),i.changeDetectorRef.detectChanges(),n&&n.changeDetectorRef.detectChanges();var a=this.getComponentRootNode(i);return{close:function(){n?n.destroy():(i.instance.content=null,i.changeDetectorRef.detectChanges()),i.destroy(),s(a)},content:n,popup:i,popupAnchorViewportLeave:r.anchorViewportLeave,popupClose:r.close,popupElement:a,popupOpen:r.open,popupPositionChange:r.positionChange}},t.prototype.appendPopup=function(t,e){var n=this.createComponent(r.PopupComponent,t,e);return e||this.rootViewContainerNode.appendChild(this.getComponentRootNode(n)),n},t.prototype.getComponentRootNode=function(t){return t.hostView.rootNodes[0]},t.prototype.getComponentFactory=function(t){return this.componentFactoryResolver.resolveComponentFactory(t)},t.prototype.createComponent=function(t,e,n){var o=this.getComponentFactory(t);if(n)return n.createComponent(o,void 0,this.injector,e);var i=o.create(this.injector,e);return this.applicationRef.attachView(i.hostView),i},t.prototype.projectComponentInputs=function(t,e){return Object.getOwnPropertyNames(e).filter(function(t){return"content"!==t||e.content instanceof i.TemplateRef}).map(function(n){t.instance[n]=e[n]}),t},t.prototype.contentFrom=function(t){if(!t||t instanceof i.TemplateRef)return{component:null,nodes:[[]]};var e=this.createComponent(t),n=e?[e.location.nativeElement]:[];return{component:e,nodes:[n]}},t=o.__decorate([i.Injectable(),o.__param(3,i.Inject(e.POPUP_CONTAINER)),o.__param(3,i.Optional()),o.__metadata("design:paramtypes",[i.ApplicationRef,i.ComponentFactoryResolver,i.Injector,i.ElementRef])],t)}();e.PopupService=a},function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(5),s=n(6),a=n(7),l=n(10),c=n(11),p=n(14),u=n(16),f=n(9),d={left:-1e4,top:0},h="k-animation-container",m="k-animation-container-fixed",v=function(t){return t.observers.length>0},g=function(){function t(t,e,n,o,r,s,a,l,c){this.container=t,this._alignService=e,this.domService=n,this._positionService=o,this._resizeService=r,this._scrollableService=s,this.animationService=a,this._renderer=l,this._zone=c,this.animate=!0,this.anchorAlign={horizontal:"left",vertical:"bottom"},this.collision={horizontal:"fit",vertical:"flip"},this.popupAlign={horizontal:"left",vertical:"top"},this.copyAnchorStyles=!1,this.positionMode="fixed",this.offset=d,this.anchorViewportLeave=new i.EventEmitter,this.close=new i.EventEmitter,this.open=new i.EventEmitter,this.positionChange=new i.EventEmitter,this.resolvedPromise=Promise.resolve(null),this._renderer.addClass(t.nativeElement,h),this.updateFixedClass()}return t.prototype.ngOnInit=function(){this.repositionCallback=this.reposition.bind(this),this._resizeService.subscribe(this.repositionCallback),this.animationSubscriptions=this.animationService.start.subscribe(this.onAnimationStart.bind(this)).add(this.animationService.end.subscribe(this.onAnimationEnd.bind(this))),this._scrollableService.forElement(this.anchor||this.container).subscribe(this.onScroll.bind(this)),this.currentOffset=d,this.setZIndex(),this.copyFontStyles(),this.updateFixedClass()},t.prototype.ngOnChanges=function(t){t.copyAnchorStyles&&this.copyFontStyles(),t.positionMode&&this.updateFixedClass()},t.prototype.ngAfterViewInit=function(){var t=this;this.reposition(),this.animate||this.resolvedPromise.then(function(){t.onAnimationEnd()})},t.prototype.ngAfterViewChecked=function(){var t=this;this._zone.runOutsideAngular(function(){t.repositionSubscription&&t.repositionSubscription.unsubscribe(),t.repositionSubscription=r.fromPromise(t.resolvedPromise).subscribe(t.repositionCallback)})},t.prototype.ngOnDestroy=function(){this.anchorViewportLeave.complete(),this.positionChange.complete(),this.close.emit(),this.close.complete(),this._resizeService.unsubscribe(),this._scrollableService.unsubscribe(),this.repositionSubscription&&this.repositionSubscription.unsubscribe(),this.animationSubscriptions.unsubscribe()},t.prototype.onAnimationStart=function(){this._renderer.removeClass(this.container.nativeElement,"k-animation-container-shown")},t.prototype.onAnimationEnd=function(){this._renderer.addClass(this.container.nativeElement,"k-animation-container-shown"),this.open.emit(),this.open.complete()},Object.defineProperty(t.prototype,"currentOffset",{get:function(){return this._currentOffset},set:function(t){this.setContainerStyle("left",t.left+"px"),this.setContainerStyle("top",t.top+"px"),this._currentOffset=t},enumerable:!0,configurable:!0}),t.prototype.setZIndex=function(){this.anchor&&this.setContainerStyle("z-index",String(this.domService.zIndex(this.anchor,this.container)))},t.prototype.reposition=function(){var t=this;if(f.isDocumentAvailable()){var e=this.position(),n=e.flip,o=e.offset;this._currentOffset&&!f.isDifferentOffset(this._currentOffset,o)||(this.currentOffset=o,v(this.positionChange)&&this._zone.run(function(){return t.positionChange.emit({offset:o,flip:n})})),this.animate&&this.animationService.play(this.contentContainer.nativeElement,this.animate,n)}},t.prototype.position=function(){var t=this._alignService.alignElement({anchor:this.anchor,anchorAlign:this.anchorAlign,element:this.container,elementAlign:this.popupAlign,margin:this.margin,offset:this.offset,positionMode:this.positionMode});return this._positionService.positionElement({anchor:this.anchor,anchorAlign:this.anchorAlign,collisions:this.collision,currentLocation:t,element:this.container,elementAlign:this.popupAlign,margin:this.margin})},t.prototype.onScroll=function(t){var e=this,n=v(this.anchorViewportLeave);t||!n?this.reposition():n&&this._zone.run(function(){e.anchorViewportLeave.emit()})},t.prototype.copyFontStyles=function(){var t=this;this.anchor&&this.copyAnchorStyles&&this.domService.getFontStyles(this.anchor).forEach(function(e){return t.setContainerStyle(e.key,e.value)})},t.prototype.updateFixedClass=function(){var t="fixed"===this.positionMode?"addClass":"removeClass";this._renderer[t](this.container.nativeElement,m)},t.prototype.setContainerStyle=function(t,e){this._renderer.setStyle(this.container.nativeElement,t,e)},o.__decorate([i.Input(),o.__metadata("design:type",Object)],t.prototype,"animate",void 0),o.__decorate([i.Input(),o.__metadata("design:type",i.ElementRef)],t.prototype,"anchor",void 0),o.__decorate([i.Input(),o.__metadata("design:type",Object)],t.prototype,"anchorAlign",void 0),o.__decorate([i.Input(),o.__metadata("design:type",Object)],t.prototype,"collision",void 0),o.__decorate([i.Input(),o.__metadata("design:type",Object)],t.prototype,"popupAlign",void 0),o.__decorate([i.Input(),o.__metadata("design:type",Boolean)],t.prototype,"copyAnchorStyles",void 0),o.__decorate([i.Input(),o.__metadata("design:type",Object)],t.prototype,"popupClass",void 0),o.__decorate([i.Input(),o.__metadata("design:type",String)],t.prototype,"positionMode",void 0),o.__decorate([i.Input(),o.__metadata("design:type",Object)],t.prototype,"offset",void 0),o.__decorate([i.Input(),o.__metadata("design:type",Object)],t.prototype,"margin",void 0),o.__decorate([i.Output(),o.__metadata("design:type",i.EventEmitter)],t.prototype,"anchorViewportLeave",void 0),o.__decorate([i.Output(),o.__metadata("design:type",i.EventEmitter)],t.prototype,"close",void 0),o.__decorate([i.Output(),o.__metadata("design:type",i.EventEmitter)],t.prototype,"open",void 0),o.__decorate([i.Output(),o.__metadata("design:type",i.EventEmitter)],t.prototype,"positionChange",void 0),o.__decorate([i.ViewChild("container"),o.__metadata("design:type",i.ElementRef)],t.prototype,"contentContainer",void 0),t=o.__decorate([i.Component({exportAs:"kendo-popup",providers:[s.AlignService,u.AnimationService,a.DOMService,l.PositionService,c.ResizeService,p.ScrollableService],selector:"kendo-popup",template:'\n <div class="k-popup" [ngClass]="popupClass" #container>\n <ng-content></ng-content>\n <ng-template [ngTemplateOutlet]="content" [ngIf]="content"></ng-template>\n </div>\n '}),o.__metadata("design:paramtypes",[i.ElementRef,s.AlignService,a.DOMService,l.PositionService,c.ResizeService,p.ScrollableService,u.AnimationService,i.Renderer2,i.NgZone])],t)}();e.PopupComponent=g},function(t,e){t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(7),s=n(9),a=function(){function t(t){this._dom=t}return t.prototype.alignElement=function(t){var e=t.anchor,n=t.element,o=t.anchorAlign,i=t.elementAlign,r=t.margin,s=t.offset,a=t.positionMode,l="fixed"===a||!this._dom.hasOffsetParent(n),c=l?this.absoluteRect(e,n,s):this.relativeRect(e,n,s);return this._dom.align({anchorAlign:o,anchorRect:c,elementAlign:i,elementRect:this._dom.offset(n),margin:r})},t.prototype.absoluteRect=function(t,e,n){return this._dom.removeScroll(this._dom.addScroll(s.removeStackingOffset(s.eitherRect(this._dom.offset(t),n),this._dom.stackingElementOffset(e)),this._dom.stackingElementScroll(e)),this.elementScrollPosition(t,e))},t.prototype.elementScrollPosition=function(t,e){return t?{x:0,y:0}:this._dom.scrollPosition(e)},t.prototype.relativeRect=function(t,e,n){return s.eitherRect(this._dom.position(t,e),n)},t=o.__decorate([i.Injectable(),o.__metadata("design:paramtypes",[r.DOMService])],t)}();e.AlignService=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(8),s=n(9),a=["font-size","font-family","font-stretch","font-style","font-weight","line-height"],l=function(){function t(){}return t.prototype.addOffset=function(t,e){return{left:t.left+e.left,top:t.top+e.top}},t.prototype.addScroll=function(t,e){return r.addScroll(t,e)},t.prototype.align=function(t){return r.align(t)},t.prototype.boundingOffset=function(t){return r.boundingOffset(this.nativeElement(t))},t.prototype.getFontStyles=function(t){var e=this.getWindow();if(!e||!t)return[];var n=e.getComputedStyle(this.nativeElement(t));return a.map(function(t){return{key:t,value:n[t]}})},t.prototype.getWindow=function(){return s.isWindowAvailable()?window:null},t.prototype.hasOffsetParent=function(t){return!!t&&!!this.nativeElement(t).offsetParent},t.prototype.offset=function(t){return t?r.offset(this.nativeElement(t)):null},t.prototype.offsetAtPoint=function(t,e){if(!t)return null;var n=this.nativeElement(t),o=n.style,i=o.left,s=o.top,a=o.transition;n.style.transition="none",n.style.left=e.left+"px",n.style.top=e.top+"px";var l=r.offset(n);return n.style.left=i,n.style.top=s,n.offsetHeight,n.style.transition=a,l},t.prototype.nativeElement=function(t){return t?t.nativeElement||t:null},t.prototype.position=function(t,e){return t&&e?r.positionWithScroll(this.nativeElement(t),this.nativeElement(e)):null},t.prototype.removeScroll=function(t,e){return r.removeScroll(t,e)},t.prototype.restrictToView=function(t){return r.restrictToView(t)},t.prototype.scrollPosition=function(t){return r.scrollPosition(this.nativeElement(t))},t.prototype.scrollableParents=function(t){return s.scrollableParents(this.nativeElement(t))},t.prototype.stackingElementOffset=function(t){var e=this.getRelativeContextElement(t);return e?r.offset(e):null},t.prototype.stackingElementScroll=function(t){var e=this.getRelativeContextElement(t);return e?{x:e.scrollLeft,y:e.scrollTop}:{x:0,y:0}},t.prototype.getRelativeContextElement=function(t){if(!t||!s.HAS_RELATIVE_STACKING_CONTEXT)return null;for(var e=this.nativeElement(t).parentElement;e;){if("none"!==window.getComputedStyle(e).transform)return e;e=e.parentElement}return null},t.prototype.useRelativePosition=function(t){return!!this.getRelativeContextElement(t)},t.prototype.windowViewPort=function(t){return r.getWindowViewPort(this.nativeElement(t))},t.prototype.zIndex=function(t,e){return s.zIndex(this.nativeElement(t),this.nativeElement(e))},t.prototype.zoomLevel=function(){return s.isDocumentAvailable()&&s.isWindowAvailable()?parseFloat((document.documentElement.clientWidth/window.innerWidth).toFixed(2))||1:1},t.prototype.isZoomed=function(){return this.zoomLevel()>1},t=o.__decorate([i.Injectable()],t)}();e.DOMService=l},function(t,e){"use strict";function n(t,e){return{top:t.top+e.y,left:t.left+e.x,height:t.height,width:t.width}}function o(t,e,n){var o=t.top,i=t.left;return n&&(i=0,o=0),{top:o+e.top,left:i+e.left,height:t.height,width:t.width}}function i(t){return t.ownerDocument||t.document||t}function r(){if(!h&&"undefined"!=typeof document){var t=document.createElement("div");t.style.cssText="overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block",t.innerHTML=" ",document.body.appendChild(t),h=t.offsetWidth-t.scrollWidth,document.body.removeChild(t)}return h}function s(t){var e=f(t),n=d(t),o={height:e.innerHeight,width:e.innerWidth};return n.scrollHeight-n.clientHeight>0&&(o.width-=r()),o}function a(t){var e=d(t),n=f(t);return{x:n.pageXOffset||e.scrollLeft||0,y:n.pageYOffset||e.scrollTop||0}}function l(t){var e=v(t);return e?w(e):{x:0,y:0}}function c(t,e){return{top:t.top-e.y,left:t.left-e.x,height:t.height,width:t.width}}Object.defineProperty(e,"__esModule",{value:!0});var p={bottom:"bottom",center:"center",middle:"middle",left:"left",right:"right",top:"top"},u=function(t){var e=t.anchorRect,n=t.anchorAlign,o=t.elementRect,i=t.elementAlign,r=t.margin;void 0===r&&(r={});var s=n.horizontal,a=n.vertical,l=i.horizontal,c=i.vertical,u=r.horizontal||0,f=r.vertical||0,d=e.top,h=e.left;return a===p.bottom&&(d+=e.height),a!==p.center&&a!==p.middle||(d+=Math.round(e.height/2)),c===p.bottom&&(d-=o.height,f*=-1),c!==p.center&&c!==p.middle||(d-=Math.round(o.height/2),f*=-1),s===p.right&&(h+=e.width),s!==p.center&&s!==p.middle||(h+=Math.round(e.width/2)),l===p.right&&(h-=o.width,u*=-1),l!==p.center&&l!==p.middle||(h-=Math.round(o.width/2),u*=-1),{top:d+f,left:h+u}},f=function(t){return i(t).defaultView},d=function(t){return i(t).documentElement},h=0,m=function(t){if(!t.getBoundingClientRect){var e=s(t);return{bottom:e.height,left:0,right:e.width,top:0}}var n=t.getBoundingClientRect(),o=n.bottom,i=n.left,r=n.right,a=n.top;return{bottom:o,left:i,right:r,top:a}},v=function(t){for(var e=t.offsetParent;e&&"static"===e.style.position;)e=e.offsetParent;return e||d(t)},g=function(t){return v(t)===t.ownerDocument.body},y=function(t){var e=t.style,n=e.display,o=e.left,i=e.position;t.style.display="",t.style.left="-10000px",t.style.position="absolute";var r=t.getBoundingClientRect();return t.style.display=n,t.style.left=o,t.style.position=i,r},b=function(t){var e=t.getBoundingClientRect(),n=e.left,o=e.top;return e.height||e.width||(e=y(t)),{top:o,left:n,height:e.height,width:e.width}},_=function(t,e){for(var n=[],o=t.parentNode;o&&(n.push(o),o!==e);)o=o.parentNode;return n},w=function(t){return t===(t.ownerDocument||{}).body?a(t):{x:t.scrollLeft,y:t.scrollTop}},S=function(t,e){var n=f(t),o=n.getComputedStyle(t),i=b(t),r=e||v(t),s=t.ownerDocument,a=r!==s.body&&r!==s.documentElement,l={top:0,left:0};if("fixed"!==o.position&&a){var c=n.getComputedStyle(r);l=b(r),l.top+=parseInt(c.borderTopWidth,10),l.left+=parseInt(c.borderLeftWidth,10)}return{top:i.top-l.top,left:i.left-l.left,height:i.height,width:i.width}},E=function(t,e){return t?w(t):l(e)},P=function(t,e){var n=e?v(e):null,o=S(t,n),i=o.top,r=o.left,s=o.height,a=o.width,l=E(n,t),c=l.x,p=l.y;return{top:i+p,left:r+c,height:s,width:a}},C={fit:"fit",flip:"flip"},O=function(t,e,n){var o=0;return t+e>n&&(o=n-(t+e)),t<0&&(o=-t),o},A=function(t){var e=t.offset,n=t.size,o=t.anchorSize,i=t.viewPortSize,r=t.anchorAlignPoint,s=t.elementAlignPoint,a=t.margin,l=0,c=s===p.center||s===p.middle,u=r===p.center||r===p.middle,f=2*a;if(s!==r&&!c&&!u){var d=r===p.top||r===p.left;e<0&&d?(l=n+o+f,e+l+n>i&&(l=0)):e>=0&&!d&&(e+n>i&&(l+=-(o+n+f)),e+l<0&&(l=0))}return l},x=function(t){var e=t.anchorRect,n=t.anchorAlign,o=t.elementRect,i=t.elementAlign,r=t.collisions,s=t.viewPort,a=t.margin;void 0===a&&(a={});var l=o.top,c=o.left,p=o.height,u=o.width,f=s.height,d=s.width,h=a.horizontal||0,m=a.vertical||0,v=0,g=0,y=r.horizontal===C.flip,b=r.vertical===C.flip;r.vertical===C.fit&&(g+=O(l,p,f)),r.horizontal===C.fit&&(v+=O(c,u,d)),b&&(g+=A({margin:m,offset:l,size:p,anchorSize:e.height,viewPortSize:f,anchorAlignPoint:n.vertical,elementAlignPoint:i.vertical})),y&&(v+=A({margin:h,offset:c,size:u,anchorSize:e.width,viewPortSize:d,anchorAlignPoint:n.horizontal,elementAlignPoint:i.horizontal}));var _=y&&0!==v,w=b&&0!==g;return{flipped:_||w,flip:{horizontal:_,vertical:w},offset:{left:v,top:g}}},R=function(t){for(var e=[],n=t.parentNode.firstElementChild;n;)n!==t&&e.push(n),n=n.nextElementSibling;return e},j=function(t,e){for(var n,o,i=_(t),r=e;r&&(n=R(r),!(o=i.reduce(function(t,e){return t.concat(n.filter(function(t){return t===e}))},[])[0]));)r=r.parentElement;return o};e.align=u,e.addScroll=n,e.applyLocationOffset=o,e.boundingOffset=m,e.isBodyOffset=g,e.offsetParent=v,e.offset=b,e.parents=_,e.parentScrollPosition=l,e.position=S,e.positionWithScroll=P,e.removeScroll=c,e.restrictToView=x,e.scrollPosition=a,e.siblingContainer=j,e.siblings=R,e.getDocumentElement=d,e.getWindow=f,e.getWindowViewPort=s,e.AlignPoint=p,e.Collision=C},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(8);e.eitherRect=function(t,e){return t?t:{height:0,left:e.left,top:e.top,width:0}},e.replaceOffset=function(t,e){if(!e)return t;var n={height:t.height,left:e.left,top:e.top,width:t.width};return n},e.removeStackingOffset=function(t,e){if(!e)return t;var n={height:t.height,left:t.left-e.left,top:t.top-e.top,width:t.width};return n},e.isDifferentOffset=function(t,e){var n=t.left,o=t.top,i=e.left,r=e.top;return Math.abs(n-i)>=1||Math.abs(o-r)>=1},e.isDocumentAvailable=function(){return"undefined"!=typeof document&&!!document.body},e.isWindowAvailable=function(){return"undefined"!=typeof window},e.hasBoundingRect=function(t){return!!t.getBoundingClientRect},e.OVERFLOW_REGEXP=/auto|scroll/;var i=function(t){return""+t.style.overflow+t.style.overflowX+t.style.overflowY},r=function(t){var e=window.getComputedStyle(t);return""+e.overflow+e.overflowX+e.overflowY},s=function(t){return i(t)||r(t)};e.scrollableParents=function(t){var n=[];if(!e.isDocumentAvailable()||!e.isWindowAvailable())return n;for(var o=t.parentElement;o;)(e.OVERFLOW_REGEXP.test(s(o))||o.hasAttribute("data-scrollable"))&&n.push(o),o=o.parentElement;return n.push(window),n},e.FRAME_DURATION=1e3/60,e.hasRelativeStackingContext=function(){if(!e.isDocumentAvailable())return!1;var t=10,n=document.createElement("div");n.style.transform="matrix(10, 0, 0, 10, 0, 0)",n.innerHTML='<div style="position: fixed; top: '+t+'px;">child</div>',document.body.appendChild(n);var o=n.children[0].getBoundingClientRect().top!==t;return document.body.removeChild(n),o},e.HAS_RELATIVE_STACKING_CONTEXT=e.hasRelativeStackingContext(),e.zIndex=function(t,n){if(!t||!e.isDocumentAvailable()||!e.isWindowAvailable())return null;var i=o.siblingContainer(t,n);if(!i)return null;var r=[t].concat(o.parents(t,i)).reduce(function(t,e){var n=e.style.zIndex||window.getComputedStyle(e).zIndex,o=parseInt(n,10);return o>t?o:t},0);return r?r+1:null}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(7),s=n(9),a=function(){function t(t){this._dom=t}return t.prototype.positionElement=function(t){var e=t.anchor,n=t.currentLocation,o=t.element,i=t.anchorAlign,r=t.elementAlign,a=t.collisions,l=t.margin,c=this._dom,p=c.restrictToView({anchorAlign:i,anchorRect:s.eitherRect(c.offset(e),n),collisions:a,elementAlign:r,elementRect:c.offsetAtPoint(o,n),margin:l,viewPort:t.viewPort||c.windowViewPort(o)});return{flip:p.flip,flipped:p.flipped,offset:c.addOffset(n,p.offset)}},t=o.__decorate([i.Injectable(),o.__metadata("design:paramtypes",[r.DOMService])],t)}();e.PositionService=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(12),s=n(13),a=n(9),l=n(7),c=function(){function t(t,e){this._dom=t,this._zone=e}return t.prototype.subscribe=function(t){var e=this;a.isDocumentAvailable()&&this._zone.runOutsideAngular(function(){e.subscription=r.fromEvent(e._dom.getWindow(),"resize").pipe(s.auditTime(a.FRAME_DURATION)).subscribe(function(){return t()})})},t.prototype.unsubscribe=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.isUnsubscribed=function(){return this.subscription&&this.subscription.closed},t=o.__decorate([i.Injectable(),o.__metadata("design:paramtypes",[l.DOMService,i.NgZone])],t)}();e.ResizeService=c},function(t,e){t.exports=o},function(t,e){t.exports=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(12),s=n(15),a=n(13),l=n(7),c=n(9);e.THRESHOLD_DIFF=1;var p=function(){function t(t,e){this._dom=t,this._zone=e}return t.prototype.forElement=function(t){return this.unsubscribe(),this.element=t,this},t.prototype.subscribe=function(t){var e=this;if(t&&c.isDocumentAvailable()&&this.element){var n=this._dom.nativeElement(this.element),o=this._dom.scrollableParents(this.element);this._zone.runOutsideAngular(function(){var i=o.map(function(t){return r.fromEvent(t,"scroll").pipe(a.auditTime(c.FRAME_DURATION))}),l=function(o){t(e.isVisible(n,o.target))};e.subscription=s.merge.apply(void 0,i).subscribe(l)})}},t.prototype.unsubscribe=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.isVisible=function(t,n){var o=this._dom.boundingOffset(t),i=this._dom.boundingOffset(n);return!(e.THRESHOLD_DIFF<i.top-o.bottom)&&(!(e.THRESHOLD_DIFF<o.top-i.bottom)&&(!(e.THRESHOLD_DIFF<o.left-i.right)&&!(e.THRESHOLD_DIFF<i.left-o.right)))},t=o.__decorate([i.Injectable(),o.__metadata("design:paramtypes",[l.DOMService,i.NgZone])],t)}();e.ScrollableService=p},function(t,e){t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(17),s="left",a="right",l="down",c="up",p="slide",u=100,f={};f.expand=function(t){var e,n=t===c||t===l?"scaleY":"scaleX",o=0,i=1;return e=t===l?"top":t===s?a:t===a?s:"bottom",{start:{transform:n+"("+o+")",transformOrigin:e},end:{transform:n+"("+i+")"}}},f.slide=function(t){var e=t===s||t===a?"translateX":"translateY",n=t===a||t===l?-100:100,o=0;return{start:{transform:e+"("+n+"%)"},end:{transform:e+"("+o+"%)"}}},f.fade=function(){return{start:{opacity:0},end:{opacity:1}}},f.zoom=function(){var t=0,e=1;return{start:{transform:"scale("+t+")"},end:{transform:"scale("+e+")"}}};var d=function(){function t(t){this.animationBuilder=t,this.start=new i.EventEmitter,this.end=new i.EventEmitter}return t.prototype.play=function(t,e,n){if(!this.flip||this.flip.horizontal!==n.horizontal||this.flip.vertical!==n.vertical){this.flip=n;var o=e.type||p,r=f[o];if(r){var s=this.getDirection(n,e),a=r(s);this.playStates(t,a,e)}else if(i.isDevMode())throw new Error('Unsupported animation type: "'+o+'". The supported types are slide, expand, fade and zoom.')}},t.prototype.ngOnDestroy=function(){this.stopPlayer()},t.prototype.playStates=function(t,e,n){var o=this;this.stopPlayer();var i=n.duration||u,s=this.animationBuilder.build([r.style(e.start),r.animate(i+"ms ease-in",r.style(e.end))]),a=this.player=s.create(t);a.onDone(function(){o.end.emit(),o.stopPlayer()}),this.start.emit(),a.play()},t.prototype.getDirection=function(t,e){var n=e.direction||l;return t.horizontal&&(n===s?n=a:n===a&&(n=s)),t.vertical&&(n===l?n=c:n===c&&(n=l)),n},t.prototype.stopPlayer=function(){this.player&&(this.player.destroy(),this.player=null)},t=o.__decorate([i.Injectable(),o.__metadata("design:paramtypes",[r.AnimationBuilder])],t)}();e.AnimationService=d},function(t,e){t.exports=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(19),s=n(4),a=n(1),l=[s.PopupComponent],c=function(){function t(){}return t=o.__decorate([i.NgModule({declarations:[l],entryComponents:[l],exports:[l],imports:[r.CommonModule],providers:[a.PopupService]})],t)}();e.PopupModule=c},function(t,e){t.exports=a}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("tslib"),require("@angular/core"),require("rxjs/observable/fromPromise"),require("rxjs/observable/fromEvent"),require("rxjs/operators/auditTime"),require("rxjs/observable/merge"),require("@angular/animations"),require("@angular/common")):"function"==typeof define&&define.amd?define(["tslib","@angular/core","rxjs/observable/fromPromise","rxjs/observable/fromEvent","rxjs/operators/auditTime","rxjs/observable/merge","@angular/animations","@angular/common"],e):"object"==typeof exports?exports.KendoAngularPopup=e(require("tslib"),require("@angular/core"),require("rxjs/observable/fromPromise"),require("rxjs/observable/fromEvent"),require("rxjs/operators/auditTime"),require("rxjs/observable/merge"),require("@angular/animations"),require("@angular/common")):t.KendoAngularPopup=e(t.tslib,t["@angular/core"],t["rxjs/observable/fromPromise"],t["rxjs/observable/fromEvent"],t["rxjs/operators/auditTime"],t["rxjs/observable/merge"],t["@angular/animations"],t["@angular/common"])}(this,function(t,e,n,o,i,r,s,a){return function(t){function e(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return t[o].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);e.PopupService=o.PopupService,e.POPUP_CONTAINER=o.POPUP_CONTAINER;var i=n(4);e.PopupComponent=i.PopupComponent;var r=n(18);e.PopupModule=r.PopupModule},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(4),s=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)};e.POPUP_CONTAINER=new i.InjectionToken("Popup Container");var a=function(){function t(t,e,n,o){this.applicationRef=t,this.componentFactoryResolver=e,this.injector=n,this.container=o}return Object.defineProperty(t.prototype,"rootViewContainer",{get:function(){var t=this.applicationRef.components||[];if(t[0])return t[0];throw new Error("\n View Container not found! Inject the POPUP_CONTAINER or define a specific ViewContainerRef via the appendTo option.\n See http://www.telerik.com/kendo-angular-ui/components/popup/api/POPUP_CONTAINER/ for more details.\n ")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rootViewContainerNode",{get:function(){return this.container?this.container.nativeElement:this.getComponentRootNode(this.rootViewContainer)},enumerable:!0,configurable:!0}),t.prototype.open=function(t){void 0===t&&(t={});var e=this.contentFrom(t.content),n=e.component,o=e.nodes,i=this.appendPopup(o,t.appendTo),r=i.instance;this.projectComponentInputs(i,t),i.changeDetectorRef.detectChanges(),n&&n.changeDetectorRef.detectChanges();var a=this.getComponentRootNode(i);return{close:function(){n?n.destroy():(i.instance.content=null,i.changeDetectorRef.detectChanges()),i.destroy(),s(a)},content:n,popup:i,popupAnchorViewportLeave:r.anchorViewportLeave,popupClose:r.close,popupElement:a,popupOpen:r.open,popupPositionChange:r.positionChange}},t.prototype.appendPopup=function(t,e){var n=this.createComponent(r.PopupComponent,t,e);return e||this.rootViewContainerNode.appendChild(this.getComponentRootNode(n)),n},t.prototype.getComponentRootNode=function(t){return t.hostView.rootNodes[0]},t.prototype.getComponentFactory=function(t){return this.componentFactoryResolver.resolveComponentFactory(t)},t.prototype.createComponent=function(t,e,n){var o=this.getComponentFactory(t);if(n)return n.createComponent(o,void 0,this.injector,e);var i=o.create(this.injector,e);return this.applicationRef.attachView(i.hostView),i},t.prototype.projectComponentInputs=function(t,e){return Object.getOwnPropertyNames(e).filter(function(t){return"content"!==t||e.content instanceof i.TemplateRef}).map(function(n){t.instance[n]=e[n]}),t},t.prototype.contentFrom=function(t){if(!t||t instanceof i.TemplateRef)return{component:null,nodes:[[]]};var e=this.createComponent(t),n=e?[e.location.nativeElement]:[];return{component:e,nodes:[n]}},t=o.__decorate([i.Injectable(),o.__param(3,i.Inject(e.POPUP_CONTAINER)),o.__param(3,i.Optional()),o.__metadata("design:paramtypes",[i.ApplicationRef,i.ComponentFactoryResolver,i.Injector,i.ElementRef])],t)}();e.PopupService=a},function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(5),s=n(6),a=n(7),l=n(10),c=n(11),p=n(14),u=n(16),f=n(9),d={left:-1e4,top:0},h="k-animation-container",m="k-animation-container-fixed",v=function(t){return t.observers.length>0},g=function(){function t(t,e,n,o,r,s,a,l,c){this.container=t,this._alignService=e,this.domService=n,this._positionService=o,this._resizeService=r,this._scrollableService=s,this.animationService=a,this._renderer=l,this._zone=c,this.animate=!0,this.anchorAlign={horizontal:"left",vertical:"bottom"},this.collision={horizontal:"fit",vertical:"flip"},this.popupAlign={horizontal:"left",vertical:"top"},this.copyAnchorStyles=!1,this.positionMode="fixed",this.offset=d,this.anchorViewportLeave=new i.EventEmitter,this.close=new i.EventEmitter,this.open=new i.EventEmitter,this.positionChange=new i.EventEmitter,this.resolvedPromise=Promise.resolve(null),this._renderer.addClass(t.nativeElement,h),this.updateFixedClass()}return t.prototype.ngOnInit=function(){this.repositionCallback=this.reposition.bind(this),this._resizeService.subscribe(this.repositionCallback),this.animationSubscriptions=this.animationService.start.subscribe(this.onAnimationStart.bind(this)).add(this.animationService.end.subscribe(this.onAnimationEnd.bind(this))),this._scrollableService.forElement(this.anchor||this.container).subscribe(this.onScroll.bind(this)),this.currentOffset=d,this.setZIndex(),this.copyFontStyles(),this.updateFixedClass()},t.prototype.ngOnChanges=function(t){t.copyAnchorStyles&&this.copyFontStyles(),t.positionMode&&this.updateFixedClass()},t.prototype.ngAfterViewInit=function(){var t=this;this.reposition(),this.animate||this.resolvedPromise.then(function(){t.onAnimationEnd()})},t.prototype.ngAfterViewChecked=function(){var t=this;this._zone.runOutsideAngular(function(){t.repositionSubscription&&t.repositionSubscription.unsubscribe(),t.repositionSubscription=r.fromPromise(t.resolvedPromise).subscribe(t.repositionCallback)})},t.prototype.ngOnDestroy=function(){this.anchorViewportLeave.complete(),this.positionChange.complete(),this.close.emit(),this.close.complete(),this._resizeService.unsubscribe(),this._scrollableService.unsubscribe(),this.repositionSubscription&&this.repositionSubscription.unsubscribe(),this.animationSubscriptions.unsubscribe()},t.prototype.onAnimationStart=function(){this._renderer.removeClass(this.container.nativeElement,"k-animation-container-shown")},t.prototype.onAnimationEnd=function(){this._renderer.addClass(this.container.nativeElement,"k-animation-container-shown"),this.open.emit(),this.open.complete()},Object.defineProperty(t.prototype,"currentOffset",{get:function(){return this._currentOffset},set:function(t){this.setContainerStyle("left",t.left+"px"),this.setContainerStyle("top",t.top+"px"),this._currentOffset=t},enumerable:!0,configurable:!0}),t.prototype.setZIndex=function(){this.anchor&&this.setContainerStyle("z-index",String(this.domService.zIndex(this.anchor,this.container)))},t.prototype.reposition=function(){var t=this;if(f.isDocumentAvailable()){var e=this.position(),n=e.flip,o=e.offset;this._currentOffset&&!f.isDifferentOffset(this._currentOffset,o)||(this.currentOffset=o,v(this.positionChange)&&this._zone.run(function(){return t.positionChange.emit({offset:o,flip:n})})),this.animate&&this.animationService.play(this.contentContainer.nativeElement,this.animate,n)}},t.prototype.position=function(){var t=this._alignService.alignElement({anchor:this.anchor,anchorAlign:this.anchorAlign,element:this.container,elementAlign:this.popupAlign,margin:this.margin,offset:this.offset,positionMode:this.positionMode});return this._positionService.positionElement({anchor:this.anchor,anchorAlign:this.anchorAlign,collisions:this.collision,currentLocation:t,element:this.container,elementAlign:this.popupAlign,margin:this.margin})},t.prototype.onScroll=function(t){var e=this,n=v(this.anchorViewportLeave);t||!n?this.reposition():n&&this._zone.run(function(){e.anchorViewportLeave.emit()})},t.prototype.copyFontStyles=function(){var t=this;this.anchor&&this.copyAnchorStyles&&this.domService.getFontStyles(this.anchor).forEach(function(e){return t.setContainerStyle(e.key,e.value)})},t.prototype.updateFixedClass=function(){var t="fixed"===this.positionMode?"addClass":"removeClass";this._renderer[t](this.container.nativeElement,m)},t.prototype.setContainerStyle=function(t,e){this._renderer.setStyle(this.container.nativeElement,t,e)},o.__decorate([i.Input(),o.__metadata("design:type",Object)],t.prototype,"animate",void 0),o.__decorate([i.Input(),o.__metadata("design:type",i.ElementRef)],t.prototype,"anchor",void 0),o.__decorate([i.Input(),o.__metadata("design:type",Object)],t.prototype,"anchorAlign",void 0),o.__decorate([i.Input(),o.__metadata("design:type",Object)],t.prototype,"collision",void 0),o.__decorate([i.Input(),o.__metadata("design:type",Object)],t.prototype,"popupAlign",void 0),o.__decorate([i.Input(),o.__metadata("design:type",Boolean)],t.prototype,"copyAnchorStyles",void 0),o.__decorate([i.Input(),o.__metadata("design:type",Object)],t.prototype,"popupClass",void 0),o.__decorate([i.Input(),o.__metadata("design:type",String)],t.prototype,"positionMode",void 0),o.__decorate([i.Input(),o.__metadata("design:type",Object)],t.prototype,"offset",void 0),o.__decorate([i.Input(),o.__metadata("design:type",Object)],t.prototype,"margin",void 0),o.__decorate([i.Output(),o.__metadata("design:type",i.EventEmitter)],t.prototype,"anchorViewportLeave",void 0),o.__decorate([i.Output(),o.__metadata("design:type",i.EventEmitter)],t.prototype,"close",void 0),o.__decorate([i.Output(),o.__metadata("design:type",i.EventEmitter)],t.prototype,"open",void 0),o.__decorate([i.Output(),o.__metadata("design:type",i.EventEmitter)],t.prototype,"positionChange",void 0),o.__decorate([i.ViewChild("container"),o.__metadata("design:type",i.ElementRef)],t.prototype,"contentContainer",void 0),t=o.__decorate([i.Component({exportAs:"kendo-popup",providers:[s.AlignService,u.AnimationService,a.DOMService,l.PositionService,c.ResizeService,p.ScrollableService],selector:"kendo-popup",template:'\n <div class="k-popup" [ngClass]="popupClass" #container>\n <ng-content></ng-content>\n <ng-template [ngTemplateOutlet]="content" [ngIf]="content"></ng-template>\n </div>\n '}),o.__metadata("design:paramtypes",[i.ElementRef,s.AlignService,a.DOMService,l.PositionService,c.ResizeService,p.ScrollableService,u.AnimationService,i.Renderer2,i.NgZone])],t)}();e.PopupComponent=g},function(t,e){t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(7),s=n(9),a=function(){function t(t){this._dom=t}return t.prototype.alignElement=function(t){var e=t.anchor,n=t.element,o=t.anchorAlign,i=t.elementAlign,r=t.margin,s=t.offset,a=t.positionMode,l="fixed"===a||!this._dom.hasOffsetParent(n),c=l?this.absoluteRect(e,n,s):this.relativeRect(e,n,s);return this._dom.align({anchorAlign:o,anchorRect:c,elementAlign:i,elementRect:this._dom.offset(n),margin:r})},t.prototype.absoluteRect=function(t,e,n){return this._dom.removeScroll(this._dom.addScroll(s.removeStackingOffset(s.eitherRect(this._dom.offset(t),n),this._dom.stackingElementOffset(e)),this._dom.stackingElementScroll(e)),this.elementScrollPosition(t,e))},t.prototype.elementScrollPosition=function(t,e){return t?{x:0,y:0}:this._dom.scrollPosition(e)},t.prototype.relativeRect=function(t,e,n){return s.eitherRect(this._dom.position(t,e),n)},t=o.__decorate([i.Injectable(),o.__metadata("design:paramtypes",[r.DOMService])],t)}();e.AlignService=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(8),s=n(9),a=["font-size","font-family","font-stretch","font-style","font-weight","line-height"],l=function(){function t(){}return t.prototype.addOffset=function(t,e){return{left:t.left+e.left,top:t.top+e.top}},t.prototype.addScroll=function(t,e){return r.addScroll(t,e)},t.prototype.align=function(t){return r.align(t)},t.prototype.boundingOffset=function(t){return r.boundingOffset(this.nativeElement(t))},t.prototype.getFontStyles=function(t){var e=this.getWindow();if(!e||!t)return[];var n=e.getComputedStyle(this.nativeElement(t));return a.map(function(t){return{key:t,value:n[t]}})},t.prototype.getWindow=function(){return s.isWindowAvailable()?window:null},t.prototype.hasOffsetParent=function(t){return!!t&&!!this.nativeElement(t).offsetParent},t.prototype.offset=function(t){return t?r.offset(this.nativeElement(t)):null},t.prototype.offsetAtPoint=function(t,e){if(!t)return null;var n=this.nativeElement(t),o=n.style,i=o.left,s=o.top,a=o.transition;n.style.transition="none",n.style.left=e.left+"px",n.style.top=e.top+"px";var l=r.offset(n);return n.style.left=i,n.style.top=s,n.offsetHeight,n.style.transition=a,l},t.prototype.nativeElement=function(t){return t?t.nativeElement||t:null},t.prototype.position=function(t,e){return t&&e?r.positionWithScroll(this.nativeElement(t),this.nativeElement(e)):null},t.prototype.removeScroll=function(t,e){return r.removeScroll(t,e)},t.prototype.restrictToView=function(t){return r.restrictToView(t)},t.prototype.scrollPosition=function(t){return r.scrollPosition(this.nativeElement(t))},t.prototype.scrollableParents=function(t){return s.scrollableParents(this.nativeElement(t))},t.prototype.stackingElementOffset=function(t){var e=this.getRelativeContextElement(t);return e?r.offset(e):null},t.prototype.stackingElementScroll=function(t){var e=this.getRelativeContextElement(t);return e?{x:e.scrollLeft,y:e.scrollTop}:{x:0,y:0}},t.prototype.getRelativeContextElement=function(t){if(!t||!s.HAS_RELATIVE_STACKING_CONTEXT)return null;for(var e=this.nativeElement(t).parentElement;e;){if("none"!==window.getComputedStyle(e).transform)return e;e=e.parentElement}return null},t.prototype.useRelativePosition=function(t){return!!this.getRelativeContextElement(t)},t.prototype.windowViewPort=function(t){return r.getWindowViewPort(this.nativeElement(t))},t.prototype.zIndex=function(t,e){return s.zIndex(this.nativeElement(t),this.nativeElement(e))},t.prototype.zoomLevel=function(){return s.isDocumentAvailable()&&s.isWindowAvailable()?parseFloat((document.documentElement.clientWidth/window.innerWidth).toFixed(2))||1:1},t.prototype.isZoomed=function(){return this.zoomLevel()>1},t=o.__decorate([i.Injectable()],t)}();e.DOMService=l},function(t,e){"use strict";function n(t,e){return{top:t.top+e.y,left:t.left+e.x,height:t.height,width:t.width}}function o(t,e,n){var o=t.top,i=t.left;return n&&(i=0,o=0),{top:o+e.top,left:i+e.left,height:t.height,width:t.width}}function i(t){return t.ownerDocument||t.document||t}function r(){if(!h&&"undefined"!=typeof document){var t=document.createElement("div");t.style.cssText="overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block",t.innerHTML=" ",document.body.appendChild(t),h=t.offsetWidth-t.scrollWidth,document.body.removeChild(t)}return h}function s(t){var e=f(t),n=d(t),o={height:e.innerHeight,width:e.innerWidth};return n.scrollHeight-n.clientHeight>0&&(o.width-=r()),o}function a(t){var e=d(t),n=f(t);return{x:n.pageXOffset||e.scrollLeft||0,y:n.pageYOffset||e.scrollTop||0}}function l(t){var e=v(t);return e?w(e):{x:0,y:0}}function c(t,e){return{top:t.top-e.y,left:t.left-e.x,height:t.height,width:t.width}}Object.defineProperty(e,"__esModule",{value:!0});var p={bottom:"bottom",center:"center",middle:"middle",left:"left",right:"right",top:"top"},u=function(t){var e=t.anchorRect,n=t.anchorAlign,o=t.elementRect,i=t.elementAlign,r=t.margin;void 0===r&&(r={});var s=n.horizontal,a=n.vertical,l=i.horizontal,c=i.vertical,u=r.horizontal||0,f=r.vertical||0,d=e.top,h=e.left;return a===p.bottom&&(d+=e.height),a!==p.center&&a!==p.middle||(d+=Math.round(e.height/2)),c===p.bottom&&(d-=o.height,f*=-1),c!==p.center&&c!==p.middle||(d-=Math.round(o.height/2),f*=-1),s===p.right&&(h+=e.width),s!==p.center&&s!==p.middle||(h+=Math.round(e.width/2)),l===p.right&&(h-=o.width,u*=-1),l!==p.center&&l!==p.middle||(h-=Math.round(o.width/2),u*=-1),{top:d+f,left:h+u}},f=function(t){return i(t).defaultView},d=function(t){return i(t).documentElement},h=0,m=function(t){if(!t.getBoundingClientRect){var e=s(t);return{bottom:e.height,left:0,right:e.width,top:0}}var n=t.getBoundingClientRect(),o=n.bottom,i=n.left,r=n.right,a=n.top;return{bottom:o,left:i,right:r,top:a}},v=function(t){for(var e=t.offsetParent;e&&"static"===e.style.position;)e=e.offsetParent;return e||d(t)},g=function(t){return v(t)===t.ownerDocument.body},y=function(t){var e=t.style,n=e.display,o=e.left,i=e.position;t.style.display="",t.style.left="-10000px",t.style.position="absolute";var r=t.getBoundingClientRect();return t.style.display=n,t.style.left=o,t.style.position=i,r},b=function(t){var e=t.getBoundingClientRect(),n=e.left,o=e.top;return e.height||e.width||(e=y(t)),{top:o,left:n,height:e.height,width:e.width}},_=function(t,e){for(var n=[],o=t.parentNode;o&&(n.push(o),o!==e);)o=o.parentNode;return n},w=function(t){return t===(t.ownerDocument||{}).body?a(t):{x:t.scrollLeft,y:t.scrollTop}},S=function(t,e){var n=f(t),o=n.getComputedStyle(t),i=b(t),r=e||v(t),s=t.ownerDocument,a=r!==s.body&&r!==s.documentElement,l={top:0,left:0};if("fixed"!==o.position&&a){var c=n.getComputedStyle(r);l=b(r),l.top+=parseInt(c.borderTopWidth,10),l.left+=parseInt(c.borderLeftWidth,10)}return{top:i.top-l.top,left:i.left-l.left,height:i.height,width:i.width}},E=function(t,e){return t?w(t):l(e)},P=function(t,e){var n=e?v(e):null,o=S(t,n),i=o.top,r=o.left,s=o.height,a=o.width,l=E(n,t),c=l.x,p=l.y;return{top:i+p,left:r+c,height:s,width:a}},C={fit:"fit",flip:"flip"},O=function(t,e,n){var o=0;return t+e>n&&(o=n-(t+e)),t<0&&(o=-t),o},A=function(t){var e=t.offset,n=t.size,o=t.anchorSize,i=t.viewPortSize,r=t.anchorAlignPoint,s=t.elementAlignPoint,a=t.margin,l=0,c=s===p.center||s===p.middle,u=r===p.center||r===p.middle,f=2*a;if(s!==r&&!c&&!u){var d=r===p.top||r===p.left;e<0&&d?(l=n+o+f,e+l+n>i&&(l=0)):e>=0&&!d&&(e+n>i&&(l+=-(o+n+f)),e+l<0&&(l=0))}return l},x=function(t){var e=t.anchorRect,n=t.anchorAlign,o=t.elementRect,i=t.elementAlign,r=t.collisions,s=t.viewPort,a=t.margin;void 0===a&&(a={});var l=o.top,c=o.left,p=o.height,u=o.width,f=s.height,d=s.width,h=a.horizontal||0,m=a.vertical||0,v=0,g=0,y=r.horizontal===C.flip,b=r.vertical===C.flip;r.vertical===C.fit&&(g+=O(l,p,f)),r.horizontal===C.fit&&(v+=O(c,u,d)),b&&(g+=A({margin:m,offset:l,size:p,anchorSize:e.height,viewPortSize:f,anchorAlignPoint:n.vertical,elementAlignPoint:i.vertical})),y&&(v+=A({margin:h,offset:c,size:u,anchorSize:e.width,viewPortSize:d,anchorAlignPoint:n.horizontal,elementAlignPoint:i.horizontal}));var _=y&&0!==v,w=b&&0!==g;return{flipped:_||w,flip:{horizontal:_,vertical:w},offset:{left:v,top:g}}},R=function(t){for(var e=[],n=t.parentNode.firstElementChild;n;)n!==t&&e.push(n),n=n.nextElementSibling;return e},j=function(t,e){for(var n,o,i=_(t),r=e;r&&(n=R(r),!(o=i.reduce(function(t,e){return t.concat(n.filter(function(t){return t===e}))},[])[0]));)r=r.parentElement;return o};e.align=u,e.addScroll=n,e.applyLocationOffset=o,e.boundingOffset=m,e.isBodyOffset=g,e.offsetParent=v,e.offset=b,e.parents=_,e.parentScrollPosition=l,e.position=S,e.positionWithScroll=P,e.removeScroll=c,e.restrictToView=x,e.scrollPosition=a,e.siblingContainer=j,e.siblings=R,e.getDocumentElement=d,e.getWindow=f,e.getWindowViewPort=s,e.AlignPoint=p,e.Collision=C},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(8);e.eitherRect=function(t,e){return t?t:{height:0,left:e.left,top:e.top,width:0}},e.replaceOffset=function(t,e){if(!e)return t;var n={height:t.height,left:e.left,top:e.top,width:t.width};return n},e.removeStackingOffset=function(t,e){if(!e)return t;var n={height:t.height,left:t.left-e.left,top:t.top-e.top,width:t.width};return n},e.isDifferentOffset=function(t,e){var n=t.left,o=t.top,i=e.left,r=e.top;return Math.abs(n-i)>=1||Math.abs(o-r)>=1},e.isDocumentAvailable=function(){return"undefined"!=typeof document&&!!document.body},e.isWindowAvailable=function(){return"undefined"!=typeof window},e.hasBoundingRect=function(t){return!!t.getBoundingClientRect},e.OVERFLOW_REGEXP=/auto|scroll/;var i=function(t){return""+t.style.overflow+t.style.overflowX+t.style.overflowY},r=function(t){var e=window.getComputedStyle(t);return""+e.overflow+e.overflowX+e.overflowY},s=function(t){return i(t)||r(t)};e.scrollableParents=function(t){var n=[];if(!e.isDocumentAvailable()||!e.isWindowAvailable())return n;for(var o=t.parentElement;o;)(e.OVERFLOW_REGEXP.test(s(o))||o.hasAttribute("data-scrollable"))&&n.push(o),o=o.parentElement;return n.push(window),n},e.FRAME_DURATION=1e3/60,e.hasRelativeStackingContext=function(){if(!e.isDocumentAvailable())return!1;var t=10,n=document.createElement("div");n.style.transform="matrix(10, 0, 0, 10, 0, 0)",n.innerHTML='<div style="position: fixed; top: '+t+'px;">child</div>',document.body.appendChild(n);var o=n.children[0].getBoundingClientRect().top!==t;return document.body.removeChild(n),o},e.HAS_RELATIVE_STACKING_CONTEXT=e.hasRelativeStackingContext(),e.zIndex=function(t,n){if(!t||!e.isDocumentAvailable()||!e.isWindowAvailable())return null;var i=o.siblingContainer(t,n);if(!i)return null;var r=[t].concat(o.parents(t,i)).reduce(function(t,e){var n=e.style.zIndex||window.getComputedStyle(e).zIndex,o=parseInt(n,10);return o>t?o:t},0);return r?r+1:null}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(7),s=n(9),a=function(){function t(t){this._dom=t}return t.prototype.positionElement=function(t){var e=t.anchor,n=t.currentLocation,o=t.element,i=t.anchorAlign,r=t.elementAlign,a=t.collisions,l=t.margin,c=this._dom,p=c.restrictToView({anchorAlign:i,anchorRect:s.eitherRect(c.offset(e),n),collisions:a,elementAlign:r,elementRect:c.offsetAtPoint(o,n),margin:l,viewPort:t.viewPort||c.windowViewPort(o)});return{flip:p.flip,flipped:p.flipped,offset:c.addOffset(n,p.offset)}},t=o.__decorate([i.Injectable(),o.__metadata("design:paramtypes",[r.DOMService])],t)}();e.PositionService=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(12),s=n(13),a=n(9),l=n(7),c=function(){function t(t,e){this._dom=t,this._zone=e}return t.prototype.subscribe=function(t){var e=this;a.isDocumentAvailable()&&this._zone.runOutsideAngular(function(){e.subscription=r.fromEvent(e._dom.getWindow(),"resize").pipe(s.auditTime(a.FRAME_DURATION)).subscribe(function(){return t()})})},t.prototype.unsubscribe=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.isUnsubscribed=function(){return this.subscription&&this.subscription.closed},t=o.__decorate([i.Injectable(),o.__metadata("design:paramtypes",[l.DOMService,i.NgZone])],t)}();e.ResizeService=c},function(t,e){t.exports=o},function(t,e){t.exports=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(12),s=n(15),a=n(13),l=n(7),c=n(9);e.THRESHOLD_DIFF=1;var p=function(){function t(t,e){this._dom=t,this._zone=e}return t.prototype.forElement=function(t){return this.unsubscribe(),this.element=t,this},t.prototype.subscribe=function(t){var e=this;if(t&&c.isDocumentAvailable()&&this.element){var n=this._dom.nativeElement(this.element),o=this._dom.scrollableParents(this.element);this._zone.runOutsideAngular(function(){var i=o.map(function(t){return r.fromEvent(t,"scroll").pipe(a.auditTime(c.FRAME_DURATION))}),l=function(i){var r=i.target,s=o.filter(function(t){return t===r}).length>0,a=r===document,l=r===window;(s||a||l)&&t(e.isVisible(n,r))};e.subscription=s.merge.apply(void 0,i).subscribe(l)})}},t.prototype.unsubscribe=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.isVisible=function(t,n){var o=this._dom.boundingOffset(t),i=this._dom.boundingOffset(n);return!(e.THRESHOLD_DIFF<i.top-o.bottom)&&(!(e.THRESHOLD_DIFF<o.top-i.bottom)&&(!(e.THRESHOLD_DIFF<o.left-i.right)&&!(e.THRESHOLD_DIFF<i.left-o.right)))},t=o.__decorate([i.Injectable(),o.__metadata("design:paramtypes",[l.DOMService,i.NgZone])],t)}();e.ScrollableService=p},function(t,e){t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(17),s="left",a="right",l="down",c="up",p="slide",u=100,f={};f.expand=function(t){var e,n=t===c||t===l?"scaleY":"scaleX",o=0,i=1;return e=t===l?"top":t===s?a:t===a?s:"bottom",{start:{transform:n+"("+o+")",transformOrigin:e},end:{transform:n+"("+i+")"}}},f.slide=function(t){var e=t===s||t===a?"translateX":"translateY",n=t===a||t===l?-100:100,o=0;return{start:{transform:e+"("+n+"%)"},end:{transform:e+"("+o+"%)"}}},f.fade=function(){return{start:{opacity:0},end:{opacity:1}}},f.zoom=function(){var t=0,e=1;return{start:{transform:"scale("+t+")"},end:{transform:"scale("+e+")"}}};var d=function(){function t(t){this.animationBuilder=t,this.start=new i.EventEmitter,this.end=new i.EventEmitter}return t.prototype.play=function(t,e,n){if(!this.flip||this.flip.horizontal!==n.horizontal||this.flip.vertical!==n.vertical){this.flip=n;var o=e.type||p,r=f[o];if(r){var s=this.getDirection(n,e),a=r(s);this.playStates(t,a,e)}else if(i.isDevMode())throw new Error('Unsupported animation type: "'+o+'". The supported types are slide, expand, fade and zoom.')}},t.prototype.ngOnDestroy=function(){this.stopPlayer()},t.prototype.playStates=function(t,e,n){var o=this;this.stopPlayer();var i=n.duration||u,s=this.animationBuilder.build([r.style(e.start),r.animate(i+"ms ease-in",r.style(e.end))]),a=this.player=s.create(t);a.onDone(function(){o.end.emit(),o.stopPlayer()}),this.start.emit(),a.play()},t.prototype.getDirection=function(t,e){var n=e.direction||l;return t.horizontal&&(n===s?n=a:n===a&&(n=s)),t.vertical&&(n===l?n=c:n===c&&(n=l)),n},t.prototype.stopPlayer=function(){this.player&&(this.player.destroy(),this.player=null)},t=o.__decorate([i.Injectable(),o.__metadata("design:paramtypes",[r.AnimationBuilder])],t)}();e.AnimationService=d},function(t,e){t.exports=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(19),s=n(4),a=n(1),l=[s.PopupComponent],c=function(){function t(){}return t=o.__decorate([i.NgModule({declarations:[l],entryComponents:[l],exports:[l],imports:[r.CommonModule],providers:[a.PopupService]})],t)}();e.PopupModule=c},function(t,e){t.exports=a}])}); |
@@ -34,3 +34,9 @@ import { Injectable, NgZone } from '@angular/core'; | ||
var subscriber = function (e) { | ||
callback(_this.isVisible(nativeElement, e.target)); | ||
var target = e.target; | ||
var isParent = parents.filter(function (p) { return p === target; }).length > 0; | ||
var isDocument = target === document; | ||
var isWindow = target === window; | ||
if (isParent || isDocument || isWindow) { | ||
callback(_this.isVisible(nativeElement, target)); | ||
} | ||
}; | ||
@@ -37,0 +43,0 @@ _this.subscription = merge.apply(void 0, observables).subscribe(subscriber); |
@@ -33,3 +33,9 @@ import { Injectable, NgZone } from '@angular/core'; | ||
const subscriber = (e) => { | ||
callback(this.isVisible(nativeElement, e.target)); | ||
const target = e.target; | ||
const isParent = parents.filter(p => p === target).length > 0; | ||
const isDocument = target === document; | ||
const isWindow = target === window; | ||
if (isParent || isDocument || isWindow) { | ||
callback(this.isVisible(nativeElement, target)); | ||
} | ||
}; | ||
@@ -36,0 +42,0 @@ this.subscription = merge(...observables).subscribe(subscriber); |
@@ -36,3 +36,9 @@ "use strict"; | ||
var subscriber = function (e) { | ||
callback(_this.isVisible(nativeElement, e.target)); | ||
var target = e.target; | ||
var isParent = parents.filter(function (p) { return p === target; }).length > 0; | ||
var isDocument = target === document; | ||
var isWindow = target === window; | ||
if (isParent || isDocument || isWindow) { | ||
callback(_this.isVisible(nativeElement, target)); | ||
} | ||
}; | ||
@@ -39,0 +45,0 @@ _this.subscription = merge_1.merge.apply(void 0, observables).subscribe(subscriber); |
@@ -1,1 +0,1 @@ | ||
System.register("@progress/kendo-angular-popup",["tslib","@angular/core","rxjs/observable/fromPromise","@angular/common","rxjs/observable/fromEvent","rxjs/operators/auditTime","@progress/kendo-popup-common","@angular/animations","rxjs/observable/merge"],function(s){var n,o,i,r,a,p,c,l,u;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){n=e(t)},function(t){o=e(t)},function(t){i=e(t)},function(t){r=e(t)},function(t){a=e(t)},function(t){p=e(t)},function(t){c=e(t)},function(t){l=e(t)},function(t){u=e(t)}],execute:function(){!function(n){var o={};function i(t){if(o[t])return o[t].exports;var e=o[t]={exports:{},id:t,loaded:!1};return n[t].call(e.exports,e,e.exports,i),e.loaded=!0,e.exports}i.m=n,i.c=o,i.p="",i(0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);e.PopupService=o.PopupService,e.POPUP_CONTAINER=o.POPUP_CONTAINER;var i=n(4);e.PopupComponent=i.PopupComponent;var r=n(18);e.PopupModule=r.PopupModule,function(t){for(var e in t)s(e,t[e])}(e)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(4);e.POPUP_CONTAINER=new i.InjectionToken("Popup Container");var s=function(){function t(t,e,n,o){this.applicationRef=t,this.componentFactoryResolver=e,this.injector=n,this.container=o}return Object.defineProperty(t.prototype,"rootViewContainer",{get:function(){var t=this.applicationRef.components||[];if(t[0])return t[0];throw new Error("\n View Container not found! Inject the POPUP_CONTAINER or define a specific ViewContainerRef via the appendTo option.\n See http://www.telerik.com/kendo-angular-ui/components/popup/api/POPUP_CONTAINER/ for more details.\n ")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rootViewContainerNode",{get:function(){return this.container?this.container.nativeElement:this.getComponentRootNode(this.rootViewContainer)},enumerable:!0,configurable:!0}),t.prototype.open=function(t){void 0===t&&(t={});var e=this.contentFrom(t.content),n=e.component,o=e.nodes,i=this.appendPopup(o,t.appendTo),r=i.instance;this.projectComponentInputs(i,t),i.changeDetectorRef.detectChanges(),n&&n.changeDetectorRef.detectChanges();var s=this.getComponentRootNode(i);return{close:function(){var t;n?n.destroy():(i.instance.content=null,i.changeDetectorRef.detectChanges()),i.destroy(),(t=s)&&t.parentNode&&t.parentNode.removeChild(t)},content:n,popup:i,popupAnchorViewportLeave:r.anchorViewportLeave,popupClose:r.close,popupElement:s,popupOpen:r.open,popupPositionChange:r.positionChange}},t.prototype.appendPopup=function(t,e){var n=this.createComponent(r.PopupComponent,t,e);return e||this.rootViewContainerNode.appendChild(this.getComponentRootNode(n)),n},t.prototype.getComponentRootNode=function(t){return t.hostView.rootNodes[0]},t.prototype.getComponentFactory=function(t){return this.componentFactoryResolver.resolveComponentFactory(t)},t.prototype.createComponent=function(t,e,n){var o=this.getComponentFactory(t);if(n)return n.createComponent(o,void 0,this.injector,e);var i=o.create(this.injector,e);return this.applicationRef.attachView(i.hostView),i},t.prototype.projectComponentInputs=function(e,n){return Object.getOwnPropertyNames(n).filter(function(t){return"content"!==t||n.content instanceof i.TemplateRef}).map(function(t){e.instance[t]=n[t]}),e},t.prototype.contentFrom=function(t){if(!t||t instanceof i.TemplateRef)return{component:null,nodes:[[]]};var e=this.createComponent(t);return{component:e,nodes:[e?[e.location.nativeElement]:[]]}},t=o.__decorate([i.Injectable(),o.__param(3,i.Inject(e.POPUP_CONTAINER)),o.__param(3,i.Optional()),o.__metadata("design:paramtypes",[i.ApplicationRef,i.ComponentFactoryResolver,i.Injector,i.ElementRef])],t)}();e.PopupService=s},function(t,e){t.exports=n},function(t,e){t.exports=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),c=n(3),i=n(5),r=n(6),s=n(7),a=n(10),p=n(11),l=n(14),u=n(16),f=n(9),d={left:-1e4,top:0},h=function(t){return 0<t.observers.length},m=function(){function t(t,e,n,o,i,r,s,a,p){this.container=t,this._alignService=e,this.domService=n,this._positionService=o,this._resizeService=i,this._scrollableService=r,this.animationService=s,this._renderer=a,this._zone=p,this.animate=!0,this.anchorAlign={horizontal:"left",vertical:"bottom"},this.collision={horizontal:"fit",vertical:"flip"},this.popupAlign={horizontal:"left",vertical:"top"},this.copyAnchorStyles=!1,this.positionMode="fixed",this.offset=d,this.anchorViewportLeave=new c.EventEmitter,this.close=new c.EventEmitter,this.open=new c.EventEmitter,this.positionChange=new c.EventEmitter,this.resolvedPromise=Promise.resolve(null),this._renderer.addClass(t.nativeElement,"k-animation-container"),this.updateFixedClass()}return t.prototype.ngOnInit=function(){this.repositionCallback=this.reposition.bind(this),this._resizeService.subscribe(this.repositionCallback),this.animationSubscriptions=this.animationService.start.subscribe(this.onAnimationStart.bind(this)).add(this.animationService.end.subscribe(this.onAnimationEnd.bind(this))),this._scrollableService.forElement(this.anchor||this.container).subscribe(this.onScroll.bind(this)),this.currentOffset=d,this.setZIndex(),this.copyFontStyles(),this.updateFixedClass()},t.prototype.ngOnChanges=function(t){t.copyAnchorStyles&&this.copyFontStyles(),t.positionMode&&this.updateFixedClass()},t.prototype.ngAfterViewInit=function(){var t=this;this.reposition(),this.animate||this.resolvedPromise.then(function(){t.onAnimationEnd()})},t.prototype.ngAfterViewChecked=function(){var t=this;this._zone.runOutsideAngular(function(){t.repositionSubscription&&t.repositionSubscription.unsubscribe(),t.repositionSubscription=i.fromPromise(t.resolvedPromise).subscribe(t.repositionCallback)})},t.prototype.ngOnDestroy=function(){this.anchorViewportLeave.complete(),this.positionChange.complete(),this.close.emit(),this.close.complete(),this._resizeService.unsubscribe(),this._scrollableService.unsubscribe(),this.repositionSubscription&&this.repositionSubscription.unsubscribe(),this.animationSubscriptions.unsubscribe()},t.prototype.onAnimationStart=function(){this._renderer.removeClass(this.container.nativeElement,"k-animation-container-shown")},t.prototype.onAnimationEnd=function(){this._renderer.addClass(this.container.nativeElement,"k-animation-container-shown"),this.open.emit(),this.open.complete()},Object.defineProperty(t.prototype,"currentOffset",{get:function(){return this._currentOffset},set:function(t){this.setContainerStyle("left",t.left+"px"),this.setContainerStyle("top",t.top+"px"),this._currentOffset=t},enumerable:!0,configurable:!0}),t.prototype.setZIndex=function(){this.anchor&&this.setContainerStyle("z-index",String(this.domService.zIndex(this.anchor,this.container)))},t.prototype.reposition=function(){var t=this;if(f.isDocumentAvailable()){var e=this.position(),n=e.flip,o=e.offset;this._currentOffset&&!f.isDifferentOffset(this._currentOffset,o)||(this.currentOffset=o,h(this.positionChange)&&this._zone.run(function(){return t.positionChange.emit({offset:o,flip:n})})),this.animate&&this.animationService.play(this.contentContainer.nativeElement,this.animate,n)}},t.prototype.position=function(){var t=this._alignService.alignElement({anchor:this.anchor,anchorAlign:this.anchorAlign,element:this.container,elementAlign:this.popupAlign,margin:this.margin,offset:this.offset,positionMode:this.positionMode});return this._positionService.positionElement({anchor:this.anchor,anchorAlign:this.anchorAlign,collisions:this.collision,currentLocation:t,element:this.container,elementAlign:this.popupAlign,margin:this.margin})},t.prototype.onScroll=function(t){var e=this,n=h(this.anchorViewportLeave);t||!n?this.reposition():n&&this._zone.run(function(){e.anchorViewportLeave.emit()})},t.prototype.copyFontStyles=function(){var e=this;this.anchor&&this.copyAnchorStyles&&this.domService.getFontStyles(this.anchor).forEach(function(t){return e.setContainerStyle(t.key,t.value)})},t.prototype.updateFixedClass=function(){var t="fixed"===this.positionMode?"addClass":"removeClass";this._renderer[t](this.container.nativeElement,"k-animation-container-fixed")},t.prototype.setContainerStyle=function(t,e){this._renderer.setStyle(this.container.nativeElement,t,e)},o.__decorate([c.Input(),o.__metadata("design:type",Object)],t.prototype,"animate",void 0),o.__decorate([c.Input(),o.__metadata("design:type",c.ElementRef)],t.prototype,"anchor",void 0),o.__decorate([c.Input(),o.__metadata("design:type",Object)],t.prototype,"anchorAlign",void 0),o.__decorate([c.Input(),o.__metadata("design:type",Object)],t.prototype,"collision",void 0),o.__decorate([c.Input(),o.__metadata("design:type",Object)],t.prototype,"popupAlign",void 0),o.__decorate([c.Input(),o.__metadata("design:type",Boolean)],t.prototype,"copyAnchorStyles",void 0),o.__decorate([c.Input(),o.__metadata("design:type",Object)],t.prototype,"popupClass",void 0),o.__decorate([c.Input(),o.__metadata("design:type",String)],t.prototype,"positionMode",void 0),o.__decorate([c.Input(),o.__metadata("design:type",Object)],t.prototype,"offset",void 0),o.__decorate([c.Input(),o.__metadata("design:type",Object)],t.prototype,"margin",void 0),o.__decorate([c.Output(),o.__metadata("design:type",c.EventEmitter)],t.prototype,"anchorViewportLeave",void 0),o.__decorate([c.Output(),o.__metadata("design:type",c.EventEmitter)],t.prototype,"close",void 0),o.__decorate([c.Output(),o.__metadata("design:type",c.EventEmitter)],t.prototype,"open",void 0),o.__decorate([c.Output(),o.__metadata("design:type",c.EventEmitter)],t.prototype,"positionChange",void 0),o.__decorate([c.ViewChild("container"),o.__metadata("design:type",c.ElementRef)],t.prototype,"contentContainer",void 0),t=o.__decorate([c.Component({exportAs:"kendo-popup",providers:[r.AlignService,u.AnimationService,s.DOMService,a.PositionService,p.ResizeService,l.ScrollableService],selector:"kendo-popup",template:'\n <div class="k-popup" [ngClass]="popupClass" #container>\n <ng-content></ng-content>\n <ng-template [ngTemplateOutlet]="content" [ngIf]="content"></ng-template>\n </div>\n '}),o.__metadata("design:paramtypes",[c.ElementRef,r.AlignService,s.DOMService,a.PositionService,p.ResizeService,l.ScrollableService,u.AnimationService,c.Renderer2,c.NgZone])],t)}();e.PopupComponent=m},function(t,e){t.exports=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(7),s=n(9),a=function(){function t(t){this._dom=t}return t.prototype.alignElement=function(t){var e=t.anchor,n=t.element,o=t.anchorAlign,i=t.elementAlign,r=t.margin,s=t.offset,a="fixed"===t.positionMode||!this._dom.hasOffsetParent(n)?this.absoluteRect(e,n,s):this.relativeRect(e,n,s);return this._dom.align({anchorAlign:o,anchorRect:a,elementAlign:i,elementRect:this._dom.offset(n),margin:r})},t.prototype.absoluteRect=function(t,e,n){return this._dom.removeScroll(this._dom.addScroll(s.removeStackingOffset(s.eitherRect(this._dom.offset(t),n),this._dom.stackingElementOffset(e)),this._dom.stackingElementScroll(e)),this.elementScrollPosition(t,e))},t.prototype.elementScrollPosition=function(t,e){return t?{x:0,y:0}:this._dom.scrollPosition(e)},t.prototype.relativeRect=function(t,e,n){return s.eitherRect(this._dom.position(t,e),n)},t=o.__decorate([i.Injectable(),o.__metadata("design:paramtypes",[r.DOMService])],t)}();e.AlignService=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),p=n(8),r=n(9),s=["font-size","font-family","font-stretch","font-style","font-weight","line-height"],a=function(){function t(){}return t.prototype.addOffset=function(t,e){return{left:t.left+e.left,top:t.top+e.top}},t.prototype.addScroll=function(t,e){return p.addScroll(t,e)},t.prototype.align=function(t){return p.align(t)},t.prototype.boundingOffset=function(t){return p.boundingOffset(this.nativeElement(t))},t.prototype.getFontStyles=function(t){var e=this.getWindow();if(!e||!t)return[];var n=e.getComputedStyle(this.nativeElement(t));return s.map(function(t){return{key:t,value:n[t]}})},t.prototype.getWindow=function(){return r.isWindowAvailable()?window:null},t.prototype.hasOffsetParent=function(t){return!!t&&!!this.nativeElement(t).offsetParent},t.prototype.offset=function(t){return t?p.offset(this.nativeElement(t)):null},t.prototype.offsetAtPoint=function(t,e){if(!t)return null;var n=this.nativeElement(t),o=n.style,i=o.left,r=o.top,s=o.transition;n.style.transition="none",n.style.left=e.left+"px",n.style.top=e.top+"px";var a=p.offset(n);return n.style.left=i,n.style.top=r,n.offsetHeight,n.style.transition=s,a},t.prototype.nativeElement=function(t){return t?t.nativeElement||t:null},t.prototype.position=function(t,e){return t&&e?p.positionWithScroll(this.nativeElement(t),this.nativeElement(e)):null},t.prototype.removeScroll=function(t,e){return p.removeScroll(t,e)},t.prototype.restrictToView=function(t){return p.restrictToView(t)},t.prototype.scrollPosition=function(t){return p.scrollPosition(this.nativeElement(t))},t.prototype.scrollableParents=function(t){return r.scrollableParents(this.nativeElement(t))},t.prototype.stackingElementOffset=function(t){var e=this.getRelativeContextElement(t);return e?p.offset(e):null},t.prototype.stackingElementScroll=function(t){var e=this.getRelativeContextElement(t);return e?{x:e.scrollLeft,y:e.scrollTop}:{x:0,y:0}},t.prototype.getRelativeContextElement=function(t){if(!t||!r.HAS_RELATIVE_STACKING_CONTEXT)return null;for(var e=this.nativeElement(t).parentElement;e;){if("none"!==window.getComputedStyle(e).transform)return e;e=e.parentElement}return null},t.prototype.useRelativePosition=function(t){return!!this.getRelativeContextElement(t)},t.prototype.windowViewPort=function(t){return p.getWindowViewPort(this.nativeElement(t))},t.prototype.zIndex=function(t,e){return r.zIndex(this.nativeElement(t),this.nativeElement(e))},t.prototype.zoomLevel=function(){return r.isDocumentAvailable()&&r.isWindowAvailable()&&parseFloat((document.documentElement.clientWidth/window.innerWidth).toFixed(2))||1},t.prototype.isZoomed=function(){return 1<this.zoomLevel()},t=o.__decorate([i.Injectable()],t)}();e.DOMService=a},function(t,e){t.exports=c},function(t,i,e){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=e(8);i.eitherRect=function(t,e){return t||{height:0,left:e.left,top:e.top,width:0}},i.replaceOffset=function(t,e){return e?{height:t.height,left:e.left,top:e.top,width:t.width}:t},i.removeStackingOffset=function(t,e){return e?{height:t.height,left:t.left-e.left,top:t.top-e.top,width:t.width}:t},i.isDifferentOffset=function(t,e){var n=t.left,o=t.top,i=e.left,r=e.top;return 1<=Math.abs(n-i)||1<=Math.abs(o-r)},i.isDocumentAvailable=function(){return"undefined"!=typeof document&&!!document.body},i.isWindowAvailable=function(){return"undefined"!=typeof window},i.hasBoundingRect=function(t){return!!t.getBoundingClientRect},i.OVERFLOW_REGEXP=/auto|scroll/;var o=function(t){return""+(o=t).style.overflow+o.style.overflowX+o.style.overflowY||(e=t,""+(n=window.getComputedStyle(e)).overflow+n.overflowX+n.overflowY);var e,n,o};i.scrollableParents=function(t){var e=[];if(!i.isDocumentAvailable()||!i.isWindowAvailable())return e;for(var n=t.parentElement;n;)(i.OVERFLOW_REGEXP.test(o(n))||n.hasAttribute("data-scrollable"))&&e.push(n),n=n.parentElement;return e.push(window),e},i.FRAME_DURATION=1e3/60,i.hasRelativeStackingContext=function(){if(!i.isDocumentAvailable())return!1;var t=document.createElement("div");t.style.transform="matrix(10, 0, 0, 10, 0, 0)",t.innerHTML='<div style="position: fixed; top: 10px;">child</div>',document.body.appendChild(t);var e=10!==t.children[0].getBoundingClientRect().top;return document.body.removeChild(t),e},i.HAS_RELATIVE_STACKING_CONTEXT=i.hasRelativeStackingContext(),i.zIndex=function(t,e){if(!t||!i.isDocumentAvailable()||!i.isWindowAvailable())return null;var n=r.siblingContainer(t,e);if(!n)return null;var o=[t].concat(r.parents(t,n)).reduce(function(t,e){var n=e.style.zIndex||window.getComputedStyle(e).zIndex,o=parseInt(n,10);return t<o?o:t},0);return o?o+1:null}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(7),l=n(9),s=function(){function t(t){this._dom=t}return t.prototype.positionElement=function(t){var e=t.anchor,n=t.currentLocation,o=t.element,i=t.anchorAlign,r=t.elementAlign,s=t.collisions,a=t.margin,p=this._dom,c=p.restrictToView({anchorAlign:i,anchorRect:l.eitherRect(p.offset(e),n),collisions:s,elementAlign:r,elementRect:p.offsetAtPoint(o,n),margin:a,viewPort:t.viewPort||p.windowViewPort(o)});return{flip:c.flip,flipped:c.flipped,offset:p.addOffset(n,c.offset)}},t=o.__decorate([i.Injectable(),o.__metadata("design:paramtypes",[r.DOMService])],t)}();e.PositionService=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(12),s=n(13),a=n(9),p=n(7),c=function(){function t(t,e){this._dom=t,this._zone=e}return t.prototype.subscribe=function(t){var e=this;a.isDocumentAvailable()&&this._zone.runOutsideAngular(function(){e.subscription=r.fromEvent(e._dom.getWindow(),"resize").pipe(s.auditTime(a.FRAME_DURATION)).subscribe(function(){return t()})})},t.prototype.unsubscribe=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.isUnsubscribed=function(){return this.subscription&&this.subscription.closed},t=o.__decorate([i.Injectable(),o.__metadata("design:paramtypes",[p.DOMService,i.NgZone])],t)}();e.ResizeService=c},function(t,e){t.exports=a},function(t,e){t.exports=p},function(t,i,e){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n=e(2),o=e(3),r=e(12),s=e(15),a=e(13),p=e(7),c=e(9);i.THRESHOLD_DIFF=1;var l=function(){function t(t,e){this._dom=t,this._zone=e}return t.prototype.forElement=function(t){return this.unsubscribe(),this.element=t,this},t.prototype.subscribe=function(e){var n=this;if(e&&c.isDocumentAvailable()&&this.element){var o=this._dom.nativeElement(this.element),i=this._dom.scrollableParents(this.element);this._zone.runOutsideAngular(function(){var t=i.map(function(t){return r.fromEvent(t,"scroll").pipe(a.auditTime(c.FRAME_DURATION))});n.subscription=s.merge.apply(void 0,t).subscribe(function(t){e(n.isVisible(o,t.target))})})}},t.prototype.unsubscribe=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.isVisible=function(t,e){var n=this._dom.boundingOffset(t),o=this._dom.boundingOffset(e);return!(i.THRESHOLD_DIFF<o.top-n.bottom)&&(!(i.THRESHOLD_DIFF<n.top-o.bottom)&&(!(i.THRESHOLD_DIFF<n.left-o.right)&&!(i.THRESHOLD_DIFF<o.left-n.right)))},t=n.__decorate([o.Injectable(),n.__metadata("design:paramtypes",[p.DOMService,o.NgZone])],t)}();i.ScrollableService=l},function(t,e){t.exports=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),s=n(3),a=n(17),i="left",r="right",p="down",c={expand:function(t){var e="up"===t||t===p?"scaleY":"scaleX";return{start:{transform:e+"(0)",transformOrigin:t===p?"top":t===i?r:t===r?i:"bottom"},end:{transform:e+"(1)"}}},slide:function(t){var e=t===i||t===r?"translateX":"translateY";return{start:{transform:e+"("+(t===r||t===p?-100:100)+"%)"},end:{transform:e+"(0%)"}}},fade:function(){return{start:{opacity:0},end:{opacity:1}}},zoom:function(){return{start:{transform:"scale(0)"},end:{transform:"scale(1)"}}}},l=function(){function t(t){this.animationBuilder=t,this.start=new s.EventEmitter,this.end=new s.EventEmitter}return t.prototype.play=function(t,e,n){if(!this.flip||this.flip.horizontal!==n.horizontal||this.flip.vertical!==n.vertical){this.flip=n;var o=e.type||"slide",i=c[o];if(i){var r=i(this.getDirection(n,e));this.playStates(t,r,e)}else if(s.isDevMode())throw new Error('Unsupported animation type: "'+o+'". The supported types are slide, expand, fade and zoom.')}},t.prototype.ngOnDestroy=function(){this.stopPlayer()},t.prototype.playStates=function(t,e,n){var o=this;this.stopPlayer();var i=n.duration||100,r=this.animationBuilder.build([a.style(e.start),a.animate(i+"ms ease-in",a.style(e.end))]),s=this.player=r.create(t);s.onDone(function(){o.end.emit(),o.stopPlayer()}),this.start.emit(),s.play()},t.prototype.getDirection=function(t,e){var n=e.direction||p;return t.horizontal&&(n===i?n=r:n===r&&(n=i)),t.vertical&&(n===p?n="up":"up"===n&&(n=p)),n},t.prototype.stopPlayer=function(){this.player&&(this.player.destroy(),this.player=null)},t=o.__decorate([s.Injectable(),o.__metadata("design:paramtypes",[a.AnimationBuilder])],t)}();e.AnimationService=l},function(t,e){t.exports=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(19),s=n(4),a=n(1),p=[s.PopupComponent],c=function(){function t(){}return t=o.__decorate([i.NgModule({declarations:[p],entryComponents:[p],exports:[p],imports:[r.CommonModule],providers:[a.PopupService]})],t)}();e.PopupModule=c},function(t,e){t.exports=r}])}}}); | ||
System.register("@progress/kendo-angular-popup",["tslib","@angular/core","@angular/common","rxjs/observable/fromPromise","@progress/kendo-popup-common","rxjs/observable/fromEvent","rxjs/operators/auditTime","@angular/animations","rxjs/observable/merge"],function(s){var n,o,i,r,a,p,c,l,u;function e(t){return t.__useDefault?t.default:t}return{setters:[function(t){n=e(t)},function(t){o=e(t)},function(t){i=e(t)},function(t){r=e(t)},function(t){a=e(t)},function(t){p=e(t)},function(t){c=e(t)},function(t){l=e(t)},function(t){u=e(t)}],execute:function(){!function(n){var o={};function i(t){if(o[t])return o[t].exports;var e=o[t]={exports:{},id:t,loaded:!1};return n[t].call(e.exports,e,e.exports,i),e.loaded=!0,e.exports}i.m=n,i.c=o,i.p="",i(0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1);e.PopupService=o.PopupService,e.POPUP_CONTAINER=o.POPUP_CONTAINER;var i=n(4);e.PopupComponent=i.PopupComponent;var r=n(18);e.PopupModule=r.PopupModule,function(t){for(var e in t)s(e,t[e])}(e)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(4);e.POPUP_CONTAINER=new i.InjectionToken("Popup Container");var s=function(){function t(t,e,n,o){this.applicationRef=t,this.componentFactoryResolver=e,this.injector=n,this.container=o}return Object.defineProperty(t.prototype,"rootViewContainer",{get:function(){var t=this.applicationRef.components||[];if(t[0])return t[0];throw new Error("\n View Container not found! Inject the POPUP_CONTAINER or define a specific ViewContainerRef via the appendTo option.\n See http://www.telerik.com/kendo-angular-ui/components/popup/api/POPUP_CONTAINER/ for more details.\n ")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rootViewContainerNode",{get:function(){return this.container?this.container.nativeElement:this.getComponentRootNode(this.rootViewContainer)},enumerable:!0,configurable:!0}),t.prototype.open=function(t){void 0===t&&(t={});var e=this.contentFrom(t.content),n=e.component,o=e.nodes,i=this.appendPopup(o,t.appendTo),r=i.instance;this.projectComponentInputs(i,t),i.changeDetectorRef.detectChanges(),n&&n.changeDetectorRef.detectChanges();var s=this.getComponentRootNode(i);return{close:function(){var t;n?n.destroy():(i.instance.content=null,i.changeDetectorRef.detectChanges()),i.destroy(),(t=s)&&t.parentNode&&t.parentNode.removeChild(t)},content:n,popup:i,popupAnchorViewportLeave:r.anchorViewportLeave,popupClose:r.close,popupElement:s,popupOpen:r.open,popupPositionChange:r.positionChange}},t.prototype.appendPopup=function(t,e){var n=this.createComponent(r.PopupComponent,t,e);return e||this.rootViewContainerNode.appendChild(this.getComponentRootNode(n)),n},t.prototype.getComponentRootNode=function(t){return t.hostView.rootNodes[0]},t.prototype.getComponentFactory=function(t){return this.componentFactoryResolver.resolveComponentFactory(t)},t.prototype.createComponent=function(t,e,n){var o=this.getComponentFactory(t);if(n)return n.createComponent(o,void 0,this.injector,e);var i=o.create(this.injector,e);return this.applicationRef.attachView(i.hostView),i},t.prototype.projectComponentInputs=function(e,n){return Object.getOwnPropertyNames(n).filter(function(t){return"content"!==t||n.content instanceof i.TemplateRef}).map(function(t){e.instance[t]=n[t]}),e},t.prototype.contentFrom=function(t){if(!t||t instanceof i.TemplateRef)return{component:null,nodes:[[]]};var e=this.createComponent(t);return{component:e,nodes:[e?[e.location.nativeElement]:[]]}},t=o.__decorate([i.Injectable(),o.__param(3,i.Inject(e.POPUP_CONTAINER)),o.__param(3,i.Optional()),o.__metadata("design:paramtypes",[i.ApplicationRef,i.ComponentFactoryResolver,i.Injector,i.ElementRef])],t)}();e.PopupService=s},function(t,e){t.exports=n},function(t,e){t.exports=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),c=n(3),i=n(5),r=n(6),s=n(7),a=n(10),p=n(11),l=n(14),u=n(16),f=n(9),d={left:-1e4,top:0},h=function(t){return 0<t.observers.length},m=function(){function t(t,e,n,o,i,r,s,a,p){this.container=t,this._alignService=e,this.domService=n,this._positionService=o,this._resizeService=i,this._scrollableService=r,this.animationService=s,this._renderer=a,this._zone=p,this.animate=!0,this.anchorAlign={horizontal:"left",vertical:"bottom"},this.collision={horizontal:"fit",vertical:"flip"},this.popupAlign={horizontal:"left",vertical:"top"},this.copyAnchorStyles=!1,this.positionMode="fixed",this.offset=d,this.anchorViewportLeave=new c.EventEmitter,this.close=new c.EventEmitter,this.open=new c.EventEmitter,this.positionChange=new c.EventEmitter,this.resolvedPromise=Promise.resolve(null),this._renderer.addClass(t.nativeElement,"k-animation-container"),this.updateFixedClass()}return t.prototype.ngOnInit=function(){this.repositionCallback=this.reposition.bind(this),this._resizeService.subscribe(this.repositionCallback),this.animationSubscriptions=this.animationService.start.subscribe(this.onAnimationStart.bind(this)).add(this.animationService.end.subscribe(this.onAnimationEnd.bind(this))),this._scrollableService.forElement(this.anchor||this.container).subscribe(this.onScroll.bind(this)),this.currentOffset=d,this.setZIndex(),this.copyFontStyles(),this.updateFixedClass()},t.prototype.ngOnChanges=function(t){t.copyAnchorStyles&&this.copyFontStyles(),t.positionMode&&this.updateFixedClass()},t.prototype.ngAfterViewInit=function(){var t=this;this.reposition(),this.animate||this.resolvedPromise.then(function(){t.onAnimationEnd()})},t.prototype.ngAfterViewChecked=function(){var t=this;this._zone.runOutsideAngular(function(){t.repositionSubscription&&t.repositionSubscription.unsubscribe(),t.repositionSubscription=i.fromPromise(t.resolvedPromise).subscribe(t.repositionCallback)})},t.prototype.ngOnDestroy=function(){this.anchorViewportLeave.complete(),this.positionChange.complete(),this.close.emit(),this.close.complete(),this._resizeService.unsubscribe(),this._scrollableService.unsubscribe(),this.repositionSubscription&&this.repositionSubscription.unsubscribe(),this.animationSubscriptions.unsubscribe()},t.prototype.onAnimationStart=function(){this._renderer.removeClass(this.container.nativeElement,"k-animation-container-shown")},t.prototype.onAnimationEnd=function(){this._renderer.addClass(this.container.nativeElement,"k-animation-container-shown"),this.open.emit(),this.open.complete()},Object.defineProperty(t.prototype,"currentOffset",{get:function(){return this._currentOffset},set:function(t){this.setContainerStyle("left",t.left+"px"),this.setContainerStyle("top",t.top+"px"),this._currentOffset=t},enumerable:!0,configurable:!0}),t.prototype.setZIndex=function(){this.anchor&&this.setContainerStyle("z-index",String(this.domService.zIndex(this.anchor,this.container)))},t.prototype.reposition=function(){var t=this;if(f.isDocumentAvailable()){var e=this.position(),n=e.flip,o=e.offset;this._currentOffset&&!f.isDifferentOffset(this._currentOffset,o)||(this.currentOffset=o,h(this.positionChange)&&this._zone.run(function(){return t.positionChange.emit({offset:o,flip:n})})),this.animate&&this.animationService.play(this.contentContainer.nativeElement,this.animate,n)}},t.prototype.position=function(){var t=this._alignService.alignElement({anchor:this.anchor,anchorAlign:this.anchorAlign,element:this.container,elementAlign:this.popupAlign,margin:this.margin,offset:this.offset,positionMode:this.positionMode});return this._positionService.positionElement({anchor:this.anchor,anchorAlign:this.anchorAlign,collisions:this.collision,currentLocation:t,element:this.container,elementAlign:this.popupAlign,margin:this.margin})},t.prototype.onScroll=function(t){var e=this,n=h(this.anchorViewportLeave);t||!n?this.reposition():n&&this._zone.run(function(){e.anchorViewportLeave.emit()})},t.prototype.copyFontStyles=function(){var e=this;this.anchor&&this.copyAnchorStyles&&this.domService.getFontStyles(this.anchor).forEach(function(t){return e.setContainerStyle(t.key,t.value)})},t.prototype.updateFixedClass=function(){var t="fixed"===this.positionMode?"addClass":"removeClass";this._renderer[t](this.container.nativeElement,"k-animation-container-fixed")},t.prototype.setContainerStyle=function(t,e){this._renderer.setStyle(this.container.nativeElement,t,e)},o.__decorate([c.Input(),o.__metadata("design:type",Object)],t.prototype,"animate",void 0),o.__decorate([c.Input(),o.__metadata("design:type",c.ElementRef)],t.prototype,"anchor",void 0),o.__decorate([c.Input(),o.__metadata("design:type",Object)],t.prototype,"anchorAlign",void 0),o.__decorate([c.Input(),o.__metadata("design:type",Object)],t.prototype,"collision",void 0),o.__decorate([c.Input(),o.__metadata("design:type",Object)],t.prototype,"popupAlign",void 0),o.__decorate([c.Input(),o.__metadata("design:type",Boolean)],t.prototype,"copyAnchorStyles",void 0),o.__decorate([c.Input(),o.__metadata("design:type",Object)],t.prototype,"popupClass",void 0),o.__decorate([c.Input(),o.__metadata("design:type",String)],t.prototype,"positionMode",void 0),o.__decorate([c.Input(),o.__metadata("design:type",Object)],t.prototype,"offset",void 0),o.__decorate([c.Input(),o.__metadata("design:type",Object)],t.prototype,"margin",void 0),o.__decorate([c.Output(),o.__metadata("design:type",c.EventEmitter)],t.prototype,"anchorViewportLeave",void 0),o.__decorate([c.Output(),o.__metadata("design:type",c.EventEmitter)],t.prototype,"close",void 0),o.__decorate([c.Output(),o.__metadata("design:type",c.EventEmitter)],t.prototype,"open",void 0),o.__decorate([c.Output(),o.__metadata("design:type",c.EventEmitter)],t.prototype,"positionChange",void 0),o.__decorate([c.ViewChild("container"),o.__metadata("design:type",c.ElementRef)],t.prototype,"contentContainer",void 0),t=o.__decorate([c.Component({exportAs:"kendo-popup",providers:[r.AlignService,u.AnimationService,s.DOMService,a.PositionService,p.ResizeService,l.ScrollableService],selector:"kendo-popup",template:'\n <div class="k-popup" [ngClass]="popupClass" #container>\n <ng-content></ng-content>\n <ng-template [ngTemplateOutlet]="content" [ngIf]="content"></ng-template>\n </div>\n '}),o.__metadata("design:paramtypes",[c.ElementRef,r.AlignService,s.DOMService,a.PositionService,p.ResizeService,l.ScrollableService,u.AnimationService,c.Renderer2,c.NgZone])],t)}();e.PopupComponent=m},function(t,e){t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(7),s=n(9),a=function(){function t(t){this._dom=t}return t.prototype.alignElement=function(t){var e=t.anchor,n=t.element,o=t.anchorAlign,i=t.elementAlign,r=t.margin,s=t.offset,a="fixed"===t.positionMode||!this._dom.hasOffsetParent(n)?this.absoluteRect(e,n,s):this.relativeRect(e,n,s);return this._dom.align({anchorAlign:o,anchorRect:a,elementAlign:i,elementRect:this._dom.offset(n),margin:r})},t.prototype.absoluteRect=function(t,e,n){return this._dom.removeScroll(this._dom.addScroll(s.removeStackingOffset(s.eitherRect(this._dom.offset(t),n),this._dom.stackingElementOffset(e)),this._dom.stackingElementScroll(e)),this.elementScrollPosition(t,e))},t.prototype.elementScrollPosition=function(t,e){return t?{x:0,y:0}:this._dom.scrollPosition(e)},t.prototype.relativeRect=function(t,e,n){return s.eitherRect(this._dom.position(t,e),n)},t=o.__decorate([i.Injectable(),o.__metadata("design:paramtypes",[r.DOMService])],t)}();e.AlignService=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),p=n(8),r=n(9),s=["font-size","font-family","font-stretch","font-style","font-weight","line-height"],a=function(){function t(){}return t.prototype.addOffset=function(t,e){return{left:t.left+e.left,top:t.top+e.top}},t.prototype.addScroll=function(t,e){return p.addScroll(t,e)},t.prototype.align=function(t){return p.align(t)},t.prototype.boundingOffset=function(t){return p.boundingOffset(this.nativeElement(t))},t.prototype.getFontStyles=function(t){var e=this.getWindow();if(!e||!t)return[];var n=e.getComputedStyle(this.nativeElement(t));return s.map(function(t){return{key:t,value:n[t]}})},t.prototype.getWindow=function(){return r.isWindowAvailable()?window:null},t.prototype.hasOffsetParent=function(t){return!!t&&!!this.nativeElement(t).offsetParent},t.prototype.offset=function(t){return t?p.offset(this.nativeElement(t)):null},t.prototype.offsetAtPoint=function(t,e){if(!t)return null;var n=this.nativeElement(t),o=n.style,i=o.left,r=o.top,s=o.transition;n.style.transition="none",n.style.left=e.left+"px",n.style.top=e.top+"px";var a=p.offset(n);return n.style.left=i,n.style.top=r,n.offsetHeight,n.style.transition=s,a},t.prototype.nativeElement=function(t){return t?t.nativeElement||t:null},t.prototype.position=function(t,e){return t&&e?p.positionWithScroll(this.nativeElement(t),this.nativeElement(e)):null},t.prototype.removeScroll=function(t,e){return p.removeScroll(t,e)},t.prototype.restrictToView=function(t){return p.restrictToView(t)},t.prototype.scrollPosition=function(t){return p.scrollPosition(this.nativeElement(t))},t.prototype.scrollableParents=function(t){return r.scrollableParents(this.nativeElement(t))},t.prototype.stackingElementOffset=function(t){var e=this.getRelativeContextElement(t);return e?p.offset(e):null},t.prototype.stackingElementScroll=function(t){var e=this.getRelativeContextElement(t);return e?{x:e.scrollLeft,y:e.scrollTop}:{x:0,y:0}},t.prototype.getRelativeContextElement=function(t){if(!t||!r.HAS_RELATIVE_STACKING_CONTEXT)return null;for(var e=this.nativeElement(t).parentElement;e;){if("none"!==window.getComputedStyle(e).transform)return e;e=e.parentElement}return null},t.prototype.useRelativePosition=function(t){return!!this.getRelativeContextElement(t)},t.prototype.windowViewPort=function(t){return p.getWindowViewPort(this.nativeElement(t))},t.prototype.zIndex=function(t,e){return r.zIndex(this.nativeElement(t),this.nativeElement(e))},t.prototype.zoomLevel=function(){return r.isDocumentAvailable()&&r.isWindowAvailable()&&parseFloat((document.documentElement.clientWidth/window.innerWidth).toFixed(2))||1},t.prototype.isZoomed=function(){return 1<this.zoomLevel()},t=o.__decorate([i.Injectable()],t)}();e.DOMService=a},function(t,e){t.exports=a},function(t,i,e){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=e(8);i.eitherRect=function(t,e){return t||{height:0,left:e.left,top:e.top,width:0}},i.replaceOffset=function(t,e){return e?{height:t.height,left:e.left,top:e.top,width:t.width}:t},i.removeStackingOffset=function(t,e){return e?{height:t.height,left:t.left-e.left,top:t.top-e.top,width:t.width}:t},i.isDifferentOffset=function(t,e){var n=t.left,o=t.top,i=e.left,r=e.top;return 1<=Math.abs(n-i)||1<=Math.abs(o-r)},i.isDocumentAvailable=function(){return"undefined"!=typeof document&&!!document.body},i.isWindowAvailable=function(){return"undefined"!=typeof window},i.hasBoundingRect=function(t){return!!t.getBoundingClientRect},i.OVERFLOW_REGEXP=/auto|scroll/;var o=function(t){return""+(o=t).style.overflow+o.style.overflowX+o.style.overflowY||(e=t,""+(n=window.getComputedStyle(e)).overflow+n.overflowX+n.overflowY);var e,n,o};i.scrollableParents=function(t){var e=[];if(!i.isDocumentAvailable()||!i.isWindowAvailable())return e;for(var n=t.parentElement;n;)(i.OVERFLOW_REGEXP.test(o(n))||n.hasAttribute("data-scrollable"))&&e.push(n),n=n.parentElement;return e.push(window),e},i.FRAME_DURATION=1e3/60,i.hasRelativeStackingContext=function(){if(!i.isDocumentAvailable())return!1;var t=document.createElement("div");t.style.transform="matrix(10, 0, 0, 10, 0, 0)",t.innerHTML='<div style="position: fixed; top: 10px;">child</div>',document.body.appendChild(t);var e=10!==t.children[0].getBoundingClientRect().top;return document.body.removeChild(t),e},i.HAS_RELATIVE_STACKING_CONTEXT=i.hasRelativeStackingContext(),i.zIndex=function(t,e){if(!t||!i.isDocumentAvailable()||!i.isWindowAvailable())return null;var n=r.siblingContainer(t,e);if(!n)return null;var o=[t].concat(r.parents(t,n)).reduce(function(t,e){var n=e.style.zIndex||window.getComputedStyle(e).zIndex,o=parseInt(n,10);return t<o?o:t},0);return o?o+1:null}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(7),l=n(9),s=function(){function t(t){this._dom=t}return t.prototype.positionElement=function(t){var e=t.anchor,n=t.currentLocation,o=t.element,i=t.anchorAlign,r=t.elementAlign,s=t.collisions,a=t.margin,p=this._dom,c=p.restrictToView({anchorAlign:i,anchorRect:l.eitherRect(p.offset(e),n),collisions:s,elementAlign:r,elementRect:p.offsetAtPoint(o,n),margin:a,viewPort:t.viewPort||p.windowViewPort(o)});return{flip:c.flip,flipped:c.flipped,offset:p.addOffset(n,c.offset)}},t=o.__decorate([i.Injectable(),o.__metadata("design:paramtypes",[r.DOMService])],t)}();e.PositionService=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(12),s=n(13),a=n(9),p=n(7),c=function(){function t(t,e){this._dom=t,this._zone=e}return t.prototype.subscribe=function(t){var e=this;a.isDocumentAvailable()&&this._zone.runOutsideAngular(function(){e.subscription=r.fromEvent(e._dom.getWindow(),"resize").pipe(s.auditTime(a.FRAME_DURATION)).subscribe(function(){return t()})})},t.prototype.unsubscribe=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.isUnsubscribed=function(){return this.subscription&&this.subscription.closed},t=o.__decorate([i.Injectable(),o.__metadata("design:paramtypes",[p.DOMService,i.NgZone])],t)}();e.ResizeService=c},function(t,e){t.exports=p},function(t,e){t.exports=c},function(t,i,e){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n=e(2),o=e(3),c=e(12),l=e(15),u=e(13),r=e(7),f=e(9);i.THRESHOLD_DIFF=1;var s=function(){function t(t,e){this._dom=t,this._zone=e}return t.prototype.forElement=function(t){return this.unsubscribe(),this.element=t,this},t.prototype.subscribe=function(r){var s=this;if(r&&f.isDocumentAvailable()&&this.element){var a=this._dom.nativeElement(this.element),p=this._dom.scrollableParents(this.element);this._zone.runOutsideAngular(function(){var t=p.map(function(t){return c.fromEvent(t,"scroll").pipe(u.auditTime(f.FRAME_DURATION))});s.subscription=l.merge.apply(void 0,t).subscribe(function(t){var e=t.target,n=0<p.filter(function(t){return t===e}).length,o=e===document,i=e===window;(n||o||i)&&r(s.isVisible(a,e))})})}},t.prototype.unsubscribe=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.isVisible=function(t,e){var n=this._dom.boundingOffset(t),o=this._dom.boundingOffset(e);return!(i.THRESHOLD_DIFF<o.top-n.bottom)&&(!(i.THRESHOLD_DIFF<n.top-o.bottom)&&(!(i.THRESHOLD_DIFF<n.left-o.right)&&!(i.THRESHOLD_DIFF<o.left-n.right)))},t=n.__decorate([o.Injectable(),n.__metadata("design:paramtypes",[r.DOMService,o.NgZone])],t)}();i.ScrollableService=s},function(t,e){t.exports=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),s=n(3),a=n(17),i="left",r="right",p="down",c={expand:function(t){var e="up"===t||t===p?"scaleY":"scaleX";return{start:{transform:e+"(0)",transformOrigin:t===p?"top":t===i?r:t===r?i:"bottom"},end:{transform:e+"(1)"}}},slide:function(t){var e=t===i||t===r?"translateX":"translateY";return{start:{transform:e+"("+(t===r||t===p?-100:100)+"%)"},end:{transform:e+"(0%)"}}},fade:function(){return{start:{opacity:0},end:{opacity:1}}},zoom:function(){return{start:{transform:"scale(0)"},end:{transform:"scale(1)"}}}},l=function(){function t(t){this.animationBuilder=t,this.start=new s.EventEmitter,this.end=new s.EventEmitter}return t.prototype.play=function(t,e,n){if(!this.flip||this.flip.horizontal!==n.horizontal||this.flip.vertical!==n.vertical){this.flip=n;var o=e.type||"slide",i=c[o];if(i){var r=i(this.getDirection(n,e));this.playStates(t,r,e)}else if(s.isDevMode())throw new Error('Unsupported animation type: "'+o+'". The supported types are slide, expand, fade and zoom.')}},t.prototype.ngOnDestroy=function(){this.stopPlayer()},t.prototype.playStates=function(t,e,n){var o=this;this.stopPlayer();var i=n.duration||100,r=this.animationBuilder.build([a.style(e.start),a.animate(i+"ms ease-in",a.style(e.end))]),s=this.player=r.create(t);s.onDone(function(){o.end.emit(),o.stopPlayer()}),this.start.emit(),s.play()},t.prototype.getDirection=function(t,e){var n=e.direction||p;return t.horizontal&&(n===i?n=r:n===r&&(n=i)),t.vertical&&(n===p?n="up":"up"===n&&(n=p)),n},t.prototype.stopPlayer=function(){this.player&&(this.player.destroy(),this.player=null)},t=o.__decorate([s.Injectable(),o.__metadata("design:paramtypes",[a.AnimationBuilder])],t)}();e.AnimationService=l},function(t,e){t.exports=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(3),r=n(19),s=n(4),a=n(1),p=[s.PopupComponent],c=function(){function t(){}return t=o.__decorate([i.NgModule({declarations:[p],entryComponents:[p],exports:[p],imports:[r.CommonModule],providers:[a.PopupService]})],t)}();e.PopupModule=c},function(t,e){t.exports=i}])}}}); |
@@ -6,3 +6,3 @@ { | ||
"license": "SEE LICENSE in LICENSE.md", | ||
"version": "2.4.0-dev.201805251319", | ||
"version": "2.4.0-dev.201805280957", | ||
"main": "dist/npm/index.js", | ||
@@ -9,0 +9,0 @@ "module": "dist/es/index.js", |
243437
5001