@progress/kendo-vue-popup 10.0.1-develop.7 → 10.1.0-develop.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Popup.js CHANGED
@@ -5,9 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("vue"),b=require("@progress/kendo-popup-common"),f=require("./util.js"),C=require("./services/alignService.js"),E=require("./services/domService.js"),P=require("./services/positionService.js"),v=require("@progress/kendo-vue-common"),T=require("./package-metadata.js"),D=100,S=1,w={left:-1e3,top:0},$="k-animation-container-shown",O="k-popup",M={margin:"0"},k=A.defineComponent({name:"Popup",emits:["open","close","position","keydown","mousedownoutside"],props:{appendTo:{type:[String,Object],default:""},anchor:{type:[String,Object],default:""},className:[String,Array,Object],id:String,popupClass:[String,Array,Object],collision:{type:Object,default:function(){return{horizontal:f.CollisionType.fit,vertical:f.CollisionType.flip}}},anchorAlign:{type:Object,default:function(){return{horizontal:f.AlignPoint.left,vertical:f.AlignPoint.bottom}}},popupAlign:{type:Object,default:function(){return{horizontal:f.AlignPoint.left,vertical:f.AlignPoint.top}}},offset:{type:Object,default:function(){return w}},show:{type:Boolean,default:!1},animate:{type:[Boolean,Object],default:!0},direction:{type:String,default:"down"},margin:Object,positionMode:String,scale:Number,role:String,ariaLabelledBy:String,ariaDescribedBy:String,onOpen:Function,onClose:Function,onPosition:Function,onMousedownoutside:Function},inject:{kCurrentZIndex:{default:null}},data(){return{hasMounted:!1,animationOpen:!1}},watch:{anchor(e){!this.hasMounted||!v.canUseDOM||(this.mountedAnchor=e?this.getParentRef(e,!0):document.body,this.reposition())},appendTo(e){!this.hasMounted||!v.canUseDOM||(this.mountedAppendTo=e?this.getParentRef(e):document.body,this.$el.parentElement!==this.mountedAppendTo&&this.mountedAppendTo.appendChild(this.$el),this.reposition())},show(e,i){if(i&&!e)if(this._cancelPendingAnimations(),this._opened&&(this._opened=!1,this.onClosing()),this.transitionDuration().exit===0)this.onClosed();else{this._exitingAnimation=!0;const n=this._animationGeneration;this.$nextTick(()=>{if(n!==this._animationGeneration)return;const o=this.$el;if(!o||!this._exitingAnimation){this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed();return}const r=o.firstChild;r?this.animateElement(r,"exit",()=>{n===this._animationGeneration&&(this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed())}):(this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed())})}else!i&&e&&(this._cancelPendingAnimations(),this._exitingAnimation=!1)}},created(){v.validatePackage(T.packageMetadata),this.mountedAppendTo=void 0,this.mountedAnchor=void 0,this._clonedElement=void 0,this._flipped=!1,this._offsetTop=0,this._offsetLeft=-1e3,this._opened=!1,this._exitingAnimation=!1,this._animationGeneration=0,this._enterTimerId=null,this._cancelAnimation=null,this._resizeObserver=void 0,this._domService=new E.DOMService,this._alignService=new C.AlignService(this._domService),this._positionService=new P.PositionService(this._domService),this.reposition=f.throttle(this.reposition.bind(this),f.FRAME_DURATION)},mounted(){v.canUseDOM&&(this.mountedAppendTo=this.appendTo?this.getParentRef(this.appendTo):document.body,this.mountedAnchor=this.anchor?this.getParentRef(this.anchor,!0):document.body),this._parentElement=this.$el.parentElement,this._clonedElement=this.$el.cloneNode(!0),this.hasMounted=!0,this.mountedAppendTo.appendChild(this.$el),this.$forceUpdate()},updated(){if(this.hasMounted&&this.mountedAppendTo){const e=this.$el;(e==null?void 0:e.nodeType)===1&&e.parentElement!==this.mountedAppendTo&&this.mountedAppendTo.appendChild(e)}},unmounted(){this.detachRepositionHandlers(),this.detachResizeObserver(),typeof window!="undefined"&&window.removeEventListener("mousedown",this.handleMouseDown)},beforeUnmount(){this._parentElement&&this._parentElement.appendChild(this.$el)},methods:{handleMouseDown(e){var n,o;const i=((n=e==null?void 0:e.target)==null?void 0:n.closest(".k-animation-container"))===null,t=((o=this.mountedAnchor)==null?void 0:o.contains(e==null?void 0:e.target))||!1;if(i){const r={target:this,event:e,isAnchorClicked:t};this.$emit("mousedownoutside",r),typeof window!="undefined"&&window.removeEventListener("mousedown",this.handleMouseDown)}},onOpened(){var t,n;const e=this.$el;typeof window!="undefined"&&window.addEventListener("mousedown",this.handleMouseDown),this.$props.show&&(e.classList.add($),this.animationOpen=!0),this.attachRepositionHandlers(e),this.attachResizeObserver(e);const i={target:this};(n=(t=this.$props).onOpen)==null||n.call(t,i),this.$emit("open",i)},onClosing(){this.$props.show||(this.$el.classList.remove($),this.animationOpen=!1),this.detachRepositionHandlers(),this.detachResizeObserver(),typeof window!="undefined"&&window.removeEventListener("mousedown",this.handleMouseDown)},onClosed(){var i,t;const e={target:this};(t=(i=this.$props).onClose)==null||t.call(i,e),this.$emit("close",e)},transitionDuration(){const e=this.$props.animate;let i=0,t=0;return e&&(e===!0?i=t=300:(i=e.openDuration||0,t=e.closeDuration||0)),{enter:i,exit:t}},_cancelPendingAnimations(){this._animationGeneration++,this._enterTimerId!==null&&(clearTimeout(this._enterTimerId),this._enterTimerId=null),this._cancelAnimation&&(this._cancelAnimation(),this._cancelAnimation=null)},animateElement(e,i,t){const n=this.transitionDuration()[i];if(n===0)return t();const o=e.ownerDocument,r=o==null?void 0:o.defaultView;if(!r)return t();const d=this.$props.direction==="down",h=this._flipped?"up":"down",u=this._flipped?"down":"up",c=d?h:u,p=`k-slide-${c}-${i}`,s=`k-slide-${c}-${i}-active`;let a=!1,l=null;const m=()=>{e.removeEventListener("transitionend",_),l&&(clearTimeout(l),l=null),e.style.transitionDuration="",e.classList.remove(p,s)},g=()=>{a||(a=!0,m(),i==="exit"?e.style.display="none":e.style.display="",this._cancelAnimation=null,t())},_=y=>{y.target===e&&g()};e.addEventListener("transitionend",_),l=setTimeout(g,n+50),e.style.transitionDuration="",e.classList.remove(p,s),i==="enter"&&(e.style.display=""),e.classList.add(p),r.requestAnimationFrame(()=>{a||(e.style.transitionDuration=n+"ms",e.classList.add(s))}),this._cancelAnimation=()=>{a||(a=!0,m(),e.style.display="")}},isAnimationInstant(e){if(this.transitionDuration()[e]===0)return!0;if(typeof window!="undefined"&&this.$el){const t=this.$el.firstChild;if(t){const n=window.getComputedStyle(t),o=parseFloat(n.transitionDuration||"0"),r=parseFloat(n.animationDuration||"0");if(o===0&&r===0)return!0}}return!1},getParentRef(e,i){if(e instanceof HTMLElement)return e;if(!e)return document.body;let t=this.$parent;for(;t&&!t.$refs[e];){if(t&&t.kendoAnchorRef&&i)return t.kendoAnchorRef;if(t=t.$parent,!t&&v.canUseDOM)return document.getElementById(e)||document.body}return t.$refs[e].$el||t.$refs[e]},position(e,i,t,n){var a,l,m,g;const{anchorAlign:o,popupAlign:r,collision:d,offset:h}=e,u=n||1,c=t?this.mountedAnchor:document.body;if(u===1){const _=this._alignService.alignElement({anchor:t?c:void 0,element:i,elementAlign:r,anchorAlign:o,offset:h}),y=this._positionService.positionElement({anchor:c,anchorAlign:o,collisions:d,element:i,currentLocation:_,elementAlign:r});return this.applyMargin(y,e)}const p=b.alignElement({anchor:t?c:void 0,element:i,elementAlign:r,anchorAlign:o,offset:h,margin:{horizontal:((a=e.margin)==null?void 0:a.horizontal)||0,vertical:((l=e.margin)==null?void 0:l.vertical)||0},positionMode:e.positionMode,scale:u});return b.positionElement({anchor:c,anchorAlign:o,collisions:d,element:i,currentLocation:p,elementAlign:r,margin:{horizontal:((m=e.margin)==null?void 0:m.horizontal)||0,vertical:((g=e.margin)==null?void 0:g.vertical)||0},scale:u})},applyMargin(e,i){var h,u,c,p,s,a,l,m;const t=i.margin;if(!t||!e.offset)return e;const n={...e.offset},o=t.horizontal||0,r=t.vertical||0,d=e.flipped?-1:1;return((h=i.anchorAlign)==null?void 0:h.horizontal)==="left"&&((u=i.popupAlign)==null?void 0:u.horizontal)==="right"?n.left-=o*d:((c=i.anchorAlign)==null?void 0:c.horizontal)==="right"&&((p=i.popupAlign)==null?void 0:p.horizontal)==="left"&&(n.left+=o*d),((s=i.anchorAlign)==null?void 0:s.vertical)==="top"&&((a=i.popupAlign)==null?void 0:a.vertical)==="bottom"?n.top-=r*d:((l=i.anchorAlign)==null?void 0:l.vertical)==="bottom"&&((m=i.popupAlign)==null?void 0:m.vertical)==="top"&&(n.top+=r*d),{...e,offset:n}},calculatePosition(e,i){if(!i||!f.isWindowAvailable()||!v.canUseDOM)return{flipped:!1,offset:e.offset};const t=v.getDefaultSlots(this),n=document.createElement("div"),o=this.$el&&this.$el.firstChild&&this.$el.firstChild.firstChild?this.$el.firstChild.firstChild.cloneNode(!0):null,r=o&&o.getBoundingClientRect?o:this._clonedElement;if(r)n.appendChild(r);else{const s=t&&t[0].props?t[0].props.class:"",a=this.$props.popupClass;n.innerHTML=`<div class="k-animation-container k-animation-container-relative">
9
- <div class="k-popup k-animation-container k-animation-container-relative">
10
- <div class="${s} ${a}" >
11
- </div>
12
- </div>
13
- </div>`}if(i.appendChild(n),n&&n.firstChild){const s=n.firstChild;s.style.position="absolute",s.style.visibility="hidden",s.style.display="block",s.style.left="-1000",s.style.top="0";const a=t&&t[0].props?t[0].props.style:{};if(a)for(const[l,m]of Object.entries(a))s.style[l]=m}const d=n.firstChild,h=parseFloat(window.getComputedStyle(d).width),u=h>0?d.getBoundingClientRect().width/h:1,c=(this.$props.scale||1)*u,p=this.position(e,d,this.$props.anchor,c);return n.parentNode.removeChild(n),p},attachRepositionHandlers(e){this.detachRepositionHandlers(),this._scrollableParents=this._domService.scrollableParents(this.$props.anchor?this.mountedAnchor:e),this._scrollableParents.map(i=>i.addEventListener("scroll",this.reposition)),f.isWindowAvailable()&&window.addEventListener("resize",this.reposition)},detachRepositionHandlers(){this._scrollableParents&&(this._scrollableParents.map(e=>e.removeEventListener("scroll",this.reposition)),this._scrollableParents=void 0),f.isWindowAvailable()&&window.removeEventListener("resize",this.reposition)},attachResizeObserver(e){this.detachResizeObserver(),typeof ResizeObserver!="undefined"&&(this._resizeObserver=new ResizeObserver(()=>this.reposition()),this._resizeObserver.observe(e))},detachResizeObserver(){var e;(e=this._resizeObserver)==null||e.disconnect(),this._resizeObserver=void 0},reposition(){this._clonedElement=this.$el.cloneNode(!0),this.$forceUpdate()},getCurrentZIndex(){return this.kCurrentZIndex?this.kCurrentZIndex+S:D},hasCustomOffset(e){return e?e.left!==w.left||e.top!==w.top:!1}},render(){var c,p;const{className:e,popupClass:i,show:t,id:n}=this.$props,o=v.getDefaultSlots(this),r=o,d=this.hasCustomOffset(this.$props.offset)?M:void 0,h=f.isWindowAvailable()?this.$props.appendTo?this.mountedAppendTo||this.getParentRef(this.$props.appendTo):document.body:void 0;if(this.$props.show){const s=this.calculatePosition(this.$props,h);this._offsetLeft=s.offset.left,this._offsetTop=s.offset.top,this._flipped=!!s.flipped;const a={target:this,fitted:!!s.fitted,flipped:!!s.flipped};(p=(c=this.$props).onPosition)==null||p.call(c,a),this.$emit("position",a)}const u=this.getCurrentZIndex();if(!this.hasMounted)return A.createVNode("div",{id:n,style:{display:"none",...this.$props.style},class:e},[A.createVNode("div",{class:[i,O],style:d},[o])]);if((t||this._exitingAnimation)&&h){const s={zIndex:u,position:this.$props.positionMode||"absolute",top:this._offsetTop+"px",left:this._offsetLeft+"px",pointerEvents:t?"auto":"none",...this.$props.style};if(t&&!this._opened){this._opened=!0;const l=this._animationGeneration;this.transitionDuration().enter===0?this._enterTimerId=setTimeout(()=>{this._enterTimerId=null,l===this._animationGeneration&&(!this.$props.show||!this._opened||this.onOpened())},0):this.$nextTick(()=>{if(l!==this._animationGeneration||!this.$props.show||!this._opened)return;const g=this.$el;if(!g)return;const _=g.firstChild;_?this.animateElement(_,"enter",()=>{l===this._animationGeneration&&this.$props.show&&this.onOpened()}):this.onOpened()})}const a=this.animationOpen?$:"";return A.createVNode("div",{id:n,class:["k-animation-container",a,e],style:s,onKeydown:l=>{this.$emit("keydown",l)}},[A.createVNode("div",{class:["k-child-animation-container"],style:{transitionDelay:"0ms",display:"block"}},[A.createVNode("div",{role:this.$props.role,"aria-labelledby":this.$props.ariaLabelledBy,"aria-describedby":this.$props.ariaDescribedBy,class:[i,O]},[r])])])}return A.createVNode("div",{id:n,style:{display:"none"},class:e},null)}});exports.Popup=k;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("vue"),b=require("@progress/kendo-popup-common"),m=require("./util.js"),C=require("./services/alignService.js"),E=require("./services/domService.js"),P=require("./services/positionService.js"),v=require("@progress/kendo-vue-common"),T=require("./package-metadata.js"),D=100,S=1,w={left:-1e3,top:0},$="k-animation-container-shown",O="k-popup",k={margin:"0"},M=f.defineComponent({name:"Popup",emits:["open","close","position","keydown","mousedownoutside"],props:{appendTo:{type:[String,Object],default:""},anchor:{type:[String,Object],default:""},className:[String,Array,Object],id:String,popupClass:[String,Array,Object],collision:{type:Object,default:function(){return{horizontal:m.CollisionType.fit,vertical:m.CollisionType.flip}}},anchorAlign:{type:Object,default:function(){return{horizontal:m.AlignPoint.left,vertical:m.AlignPoint.bottom}}},popupAlign:{type:Object,default:function(){return{horizontal:m.AlignPoint.left,vertical:m.AlignPoint.top}}},offset:{type:Object,default:function(){return w}},show:{type:Boolean,default:!1},animate:{type:[Boolean,Object],default:!0},direction:{type:String,default:"down"},margin:Object,positionMode:String,scale:Number,role:String,ariaLabelledBy:String,ariaDescribedBy:String,onOpen:Function,onClose:Function,onPosition:Function,onMousedownoutside:Function},inject:{kCurrentZIndex:{default:null}},data(){return{hasMounted:!1,animationOpen:!1}},watch:{anchor(e){!this.hasMounted||!v.canUseDOM||(this.mountedAnchor=e?this.getParentRef(e,!0):document.body,this.reposition())},appendTo(e){!this.hasMounted||!v.canUseDOM||(this.mountedAppendTo=e?this.getParentRef(e):document.body,this.$el.parentElement!==this.mountedAppendTo&&this.mountedAppendTo.appendChild(this.$el),this.reposition())},show(e,i){if(i&&!e)if(this._cancelPendingAnimations(),this._opened&&(this._opened=!1,this.onClosing()),this.transitionDuration().exit===0)this.onClosed();else{this._exitingAnimation=!0;const n=this._animationGeneration;this.$nextTick(()=>{if(n!==this._animationGeneration)return;const o=this.$el;if(!o||!this._exitingAnimation){this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed();return}const r=o.firstChild;r?this.animateElement(r,"exit",()=>{n===this._animationGeneration&&(this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed())}):(this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed())})}else!i&&e&&(this._cancelPendingAnimations(),this._exitingAnimation=!1)}},created(){v.validatePackage(T.packageMetadata),this.mountedAppendTo=void 0,this.mountedAnchor=void 0,this._clonedElement=void 0,this._flipped=!1,this._offsetTop=0,this._offsetLeft=-1e3,this._opened=!1,this._exitingAnimation=!1,this._animationGeneration=0,this._enterTimerId=null,this._cancelAnimation=null,this._resizeObserver=void 0,this._domService=new E.DOMService,this._alignService=new C.AlignService(this._domService),this._positionService=new P.PositionService(this._domService),this.reposition=m.throttle(this.reposition.bind(this),m.FRAME_DURATION)},mounted(){v.canUseDOM&&(this.mountedAppendTo=this.appendTo?this.getParentRef(this.appendTo):document.body,this.mountedAnchor=this.anchor?this.getParentRef(this.anchor,!0):document.body),this._parentElement=this.$el.parentElement,this._clonedElement=this.$el.cloneNode(!0),this.hasMounted=!0,this.mountedAppendTo.appendChild(this.$el),this.$forceUpdate()},updated(){if(this.hasMounted&&this.mountedAppendTo){const e=this.$el;(e==null?void 0:e.nodeType)===1&&e.parentElement!==this.mountedAppendTo&&this.mountedAppendTo.appendChild(e)}},unmounted(){this.detachRepositionHandlers(),this.detachResizeObserver(),typeof window!="undefined"&&window.removeEventListener("mousedown",this.handleMouseDown)},beforeUnmount(){this._parentElement&&this._parentElement.appendChild(this.$el)},methods:{handleMouseDown(e){var n,o;const i=((n=e==null?void 0:e.target)==null?void 0:n.closest(".k-animation-container"))===null,t=((o=this.mountedAnchor)==null?void 0:o.contains(e==null?void 0:e.target))||!1;if(i){const r={target:this,event:e,isAnchorClicked:t};this.$emit("mousedownoutside",r),typeof window!="undefined"&&window.removeEventListener("mousedown",this.handleMouseDown)}},onOpened(){var t,n;const e=this.$el;typeof window!="undefined"&&window.addEventListener("mousedown",this.handleMouseDown),this.$props.show&&(e.classList.add($),this.animationOpen=!0),this.attachRepositionHandlers(e),this.attachResizeObserver(e);const i={target:this};(n=(t=this.$props).onOpen)==null||n.call(t,i),this.$emit("open",i)},onClosing(){this.$props.show||(this.$el.classList.remove($),this.animationOpen=!1),this.detachRepositionHandlers(),this.detachResizeObserver(),typeof window!="undefined"&&window.removeEventListener("mousedown",this.handleMouseDown)},onClosed(){var i,t;const e={target:this};(t=(i=this.$props).onClose)==null||t.call(i,e),this.$emit("close",e)},transitionDuration(){const e=this.$props.animate;let i=0,t=0;return e&&(e===!0?i=t=300:(i=e.openDuration||0,t=e.closeDuration||0)),{enter:i,exit:t}},_cancelPendingAnimations(){this._animationGeneration++,this._enterTimerId!==null&&(clearTimeout(this._enterTimerId),this._enterTimerId=null),this._cancelAnimation&&(this._cancelAnimation(),this._cancelAnimation=null)},animateElement(e,i,t){const n=this.transitionDuration()[i];if(n===0)return t();const o=e.ownerDocument,r=o==null?void 0:o.defaultView;if(!r)return t();const d=this.$props.direction==="down",h=this._flipped?"up":"down",u=this._flipped?"down":"up",c=d?h:u,p=`k-slide-${c}-${i}`,s=`k-slide-${c}-${i}-active`;let a=!1,l=null;const g=()=>{e.removeEventListener("transitionend",A),l&&(clearTimeout(l),l=null),e.style.transitionDuration="",e.classList.remove(p,s)},_=()=>{a||(a=!0,g(),i==="exit"?e.style.display="none":e.style.display="",this._cancelAnimation=null,t())},A=y=>{y.target===e&&_()};e.addEventListener("transitionend",A),l=setTimeout(_,n+50),e.style.transitionDuration="",e.classList.remove(p,s),i==="enter"&&(e.style.display=""),e.classList.add(p),r.requestAnimationFrame(()=>{a||(e.style.transitionDuration=n+"ms",e.classList.add(s))}),this._cancelAnimation=()=>{a||(a=!0,g(),e.style.display="")}},isAnimationInstant(e){if(this.transitionDuration()[e]===0)return!0;if(typeof window!="undefined"&&this.$el){const t=this.$el.firstChild;if(t){const n=window.getComputedStyle(t),o=parseFloat(n.transitionDuration||"0"),r=parseFloat(n.animationDuration||"0");if(o===0&&r===0)return!0}}return!1},getParentRef(e,i){if(e instanceof HTMLElement)return e;if(!e)return document.body;let t=this.$parent;for(;t&&!t.$refs[e];){if(t&&t.kendoAnchorRef&&i)return t.kendoAnchorRef;if(t=t.$parent,!t&&v.canUseDOM)return document.getElementById(e)||document.body}return t.$refs[e].$el||t.$refs[e]},position(e,i,t,n){var a,l,g,_;const{anchorAlign:o,popupAlign:r,collision:d,offset:h}=e,u=n||1,c=t?this.mountedAnchor:document.body;if(u===1){const A=this._alignService.alignElement({anchor:t?c:void 0,element:i,elementAlign:r,anchorAlign:o,offset:h}),y=this._positionService.positionElement({anchor:c,anchorAlign:o,collisions:d,element:i,currentLocation:A,elementAlign:r});return this.applyMargin(y,e)}const p=b.alignElement({anchor:t?c:void 0,element:i,elementAlign:r,anchorAlign:o,offset:h,margin:{horizontal:((a=e.margin)==null?void 0:a.horizontal)||0,vertical:((l=e.margin)==null?void 0:l.vertical)||0},positionMode:e.positionMode,scale:u});return b.positionElement({anchor:c,anchorAlign:o,collisions:d,element:i,currentLocation:p,elementAlign:r,margin:{horizontal:((g=e.margin)==null?void 0:g.horizontal)||0,vertical:((_=e.margin)==null?void 0:_.vertical)||0},scale:u})},applyMargin(e,i){var h,u,c,p,s,a,l,g;const t=i.margin;if(!t||!e.offset)return e;const n={...e.offset},o=t.horizontal||0,r=t.vertical||0,d=e.flipped?-1:1;return((h=i.anchorAlign)==null?void 0:h.horizontal)==="left"&&((u=i.popupAlign)==null?void 0:u.horizontal)==="right"?n.left-=o*d:((c=i.anchorAlign)==null?void 0:c.horizontal)==="right"&&((p=i.popupAlign)==null?void 0:p.horizontal)==="left"&&(n.left+=o*d),((s=i.anchorAlign)==null?void 0:s.vertical)==="top"&&((a=i.popupAlign)==null?void 0:a.vertical)==="bottom"?n.top-=r*d:((l=i.anchorAlign)==null?void 0:l.vertical)==="bottom"&&((g=i.popupAlign)==null?void 0:g.vertical)==="top"&&(n.top+=r*d),{...e,offset:n}},calculatePosition(e,i){if(!i||!m.isWindowAvailable()||!v.canUseDOM)return{flipped:!1,offset:e.offset};const t=v.getDefaultSlots(this),n=document.createElement("div"),o=this.$el&&this.$el.firstChild&&this.$el.firstChild.firstChild?this.$el.firstChild.firstChild.cloneNode(!0):null,r=o&&o.getBoundingClientRect?o:this._clonedElement;if(r)n.appendChild(r);else{const s=t&&t[0].props?t[0].props.class:"";f.render(f.h("div",{class:"k-animation-container k-animation-container-relative"},f.h("div",{class:"k-popup k-animation-container k-animation-container-relative"},f.h("div",{class:[s,this.$props.popupClass]}))),n)}if(i.appendChild(n),n&&n.firstChild){const s=n.firstChild;s.style.position="absolute",s.style.visibility="hidden",s.style.display="block",s.style.left="-1000",s.style.top="0";const a=t&&t[0].props?t[0].props.style:{};if(a)for(const[l,g]of Object.entries(a))s.style[l]=g}const d=n.firstChild,h=parseFloat(window.getComputedStyle(d).width),u=h>0?d.getBoundingClientRect().width/h:1,c=(this.$props.scale||1)*u,p=this.position(e,d,this.$props.anchor,c);return f.render(null,n),n.parentNode.removeChild(n),p},attachRepositionHandlers(e){this.detachRepositionHandlers(),this._scrollableParents=this._domService.scrollableParents(this.$props.anchor?this.mountedAnchor:e),this._scrollableParents.map(i=>i.addEventListener("scroll",this.reposition)),m.isWindowAvailable()&&window.addEventListener("resize",this.reposition)},detachRepositionHandlers(){this._scrollableParents&&(this._scrollableParents.map(e=>e.removeEventListener("scroll",this.reposition)),this._scrollableParents=void 0),m.isWindowAvailable()&&window.removeEventListener("resize",this.reposition)},attachResizeObserver(e){this.detachResizeObserver(),typeof ResizeObserver!="undefined"&&(this._resizeObserver=new ResizeObserver(()=>this.reposition()),this._resizeObserver.observe(e))},detachResizeObserver(){var e;(e=this._resizeObserver)==null||e.disconnect(),this._resizeObserver=void 0},reposition(){this._clonedElement=this.$el.cloneNode(!0),this.$forceUpdate()},getCurrentZIndex(){return this.kCurrentZIndex?this.kCurrentZIndex+S:D},hasCustomOffset(e){return e?e.left!==w.left||e.top!==w.top:!1}},render(){var c,p;const{className:e,popupClass:i,show:t,id:n}=this.$props,o=v.getDefaultSlots(this),r=o,d=this.hasCustomOffset(this.$props.offset)?k:void 0,h=m.isWindowAvailable()?this.$props.appendTo?this.mountedAppendTo||this.getParentRef(this.$props.appendTo):document.body:void 0;if(this.$props.show){const s=this.calculatePosition(this.$props,h);this._offsetLeft=s.offset.left,this._offsetTop=s.offset.top,this._flipped=!!s.flipped;const a={target:this,fitted:!!s.fitted,flipped:!!s.flipped};(p=(c=this.$props).onPosition)==null||p.call(c,a),this.$emit("position",a)}const u=this.getCurrentZIndex();if(!this.hasMounted)return f.createVNode("div",{id:n,style:{display:"none",...this.$props.style},class:e},[f.createVNode("div",{class:[i,O],style:d},[o])]);if((t||this._exitingAnimation)&&h){const s={zIndex:u,position:this.$props.positionMode||"absolute",top:this._offsetTop+"px",left:this._offsetLeft+"px",pointerEvents:t?"auto":"none",...this.$props.style};if(t&&!this._opened){this._opened=!0;const l=this._animationGeneration;this.transitionDuration().enter===0?this._enterTimerId=setTimeout(()=>{this._enterTimerId=null,l===this._animationGeneration&&(!this.$props.show||!this._opened||this.onOpened())},0):this.$nextTick(()=>{if(l!==this._animationGeneration||!this.$props.show||!this._opened)return;const _=this.$el;if(!_)return;const A=_.firstChild;A?this.animateElement(A,"enter",()=>{l===this._animationGeneration&&this.$props.show&&this.onOpened()}):this.onOpened()})}const a=this.animationOpen?$:"";return f.createVNode("div",{id:n,class:["k-animation-container",a,e],style:s,onKeydown:l=>{this.$emit("keydown",l)}},[f.createVNode("div",{class:["k-child-animation-container"],style:{transitionDelay:"0ms",display:"block"}},[f.createVNode("div",{role:this.$props.role,"aria-labelledby":this.$props.ariaLabelledBy,"aria-describedby":this.$props.ariaDescribedBy,class:[i,O]},[r])])])}return f.createVNode("div",{id:n,style:{display:"none"},class:e},null)}});exports.Popup=M;
package/Popup.mjs CHANGED
@@ -5,20 +5,20 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as T, createVNode as g } from "vue";
9
- import { alignElement as P, positionElement as D } from "@progress/kendo-popup-common";
10
- import { isWindowAvailable as A, throttle as S, AlignPoint as y, CollisionType as C, FRAME_DURATION as z } from "./util.mjs";
11
- import { AlignService as R } from "./services/alignService.mjs";
12
- import { DOMService as k } from "./services/domService.mjs";
13
- import { PositionService as L } from "./services/positionService.mjs";
14
- import { getDefaultSlots as O, canUseDOM as v, validatePackage as x } from "@progress/kendo-vue-common";
15
- import { packageMetadata as M } from "./package-metadata.mjs";
16
- const I = 100, N = 1, $ = {
8
+ import { defineComponent as D, createVNode as g, render as O, h as $ } from "vue";
9
+ import { alignElement as S, positionElement as z } from "@progress/kendo-popup-common";
10
+ import { isWindowAvailable as A, throttle as R, AlignPoint as y, CollisionType as E, FRAME_DURATION as k } from "./util.mjs";
11
+ import { AlignService as x } from "./services/alignService.mjs";
12
+ import { DOMService as L } from "./services/domService.mjs";
13
+ import { PositionService as M } from "./services/positionService.mjs";
14
+ import { getDefaultSlots as T, canUseDOM as v, validatePackage as I } from "@progress/kendo-vue-common";
15
+ import { packageMetadata as N } from "./package-metadata.mjs";
16
+ const F = 100, U = 1, b = {
17
17
  left: -1e3,
18
18
  top: 0
19
- }, b = "k-animation-container-shown", E = "k-popup", F = {
19
+ }, C = "k-animation-container-shown", P = "k-popup", j = {
20
20
  margin: "0"
21
- }, X = /* @__PURE__ */ T({
21
+ }, V = /* @__PURE__ */ D({
22
22
  name: "Popup",
23
23
  emits: ["open", "close", "position", "keydown", "mousedownoutside"],
24
24
  props: {
@@ -37,8 +37,8 @@ const I = 100, N = 1, $ = {
37
37
  type: Object,
38
38
  default: function() {
39
39
  return {
40
- horizontal: C.fit,
41
- vertical: C.flip
40
+ horizontal: E.fit,
41
+ vertical: E.flip
42
42
  };
43
43
  }
44
44
  },
@@ -63,7 +63,7 @@ const I = 100, N = 1, $ = {
63
63
  offset: {
64
64
  type: Object,
65
65
  default: function() {
66
- return $;
66
+ return b;
67
67
  }
68
68
  },
69
69
  show: {
@@ -132,7 +132,7 @@ const I = 100, N = 1, $ = {
132
132
  }
133
133
  },
134
134
  created() {
135
- x(M), this.mountedAppendTo = void 0, this.mountedAnchor = void 0, this._clonedElement = void 0, this._flipped = !1, this._offsetTop = 0, this._offsetLeft = -1e3, this._opened = !1, this._exitingAnimation = !1, this._animationGeneration = 0, this._enterTimerId = null, this._cancelAnimation = null, this._resizeObserver = void 0, this._domService = new k(), this._alignService = new R(this._domService), this._positionService = new L(this._domService), this.reposition = S(this.reposition.bind(this), z);
135
+ I(N), this.mountedAppendTo = void 0, this.mountedAnchor = void 0, this._clonedElement = void 0, this._flipped = !1, this._offsetTop = 0, this._offsetLeft = -1e3, this._opened = !1, this._exitingAnimation = !1, this._animationGeneration = 0, this._enterTimerId = null, this._cancelAnimation = null, this._resizeObserver = void 0, this._domService = new L(), this._alignService = new x(this._domService), this._positionService = new M(this._domService), this.reposition = R(this.reposition.bind(this), k);
136
136
  },
137
137
  mounted() {
138
138
  v && (this.mountedAppendTo = this.appendTo ? this.getParentRef(this.appendTo) : document.body, this.mountedAnchor = this.anchor ? this.getParentRef(this.anchor, !0) : document.body), this._parentElement = this.$el.parentElement, this._clonedElement = this.$el.cloneNode(!0), this.hasMounted = !0, this.mountedAppendTo.appendChild(this.$el), this.$forceUpdate();
@@ -165,14 +165,14 @@ const I = 100, N = 1, $ = {
165
165
  onOpened() {
166
166
  var e, n;
167
167
  const t = this.$el;
168
- typeof window != "undefined" && window.addEventListener("mousedown", this.handleMouseDown), this.$props.show && (t.classList.add(b), this.animationOpen = !0), this.attachRepositionHandlers(t), this.attachResizeObserver(t);
168
+ typeof window != "undefined" && window.addEventListener("mousedown", this.handleMouseDown), this.$props.show && (t.classList.add(C), this.animationOpen = !0), this.attachRepositionHandlers(t), this.attachResizeObserver(t);
169
169
  const i = {
170
170
  target: this
171
171
  };
172
172
  (n = (e = this.$props).onOpen) == null || n.call(e, i), this.$emit("open", i);
173
173
  },
174
174
  onClosing() {
175
- this.$props.show || (this.$el.classList.remove(b), this.animationOpen = !1), this.detachRepositionHandlers(), this.detachResizeObserver(), typeof window != "undefined" && window.removeEventListener("mousedown", this.handleMouseDown);
175
+ this.$props.show || (this.$el.classList.remove(C), this.animationOpen = !1), this.detachRepositionHandlers(), this.detachResizeObserver(), typeof window != "undefined" && window.removeEventListener("mousedown", this.handleMouseDown);
176
176
  },
177
177
  onClosed() {
178
178
  var i, e;
@@ -266,7 +266,7 @@ const I = 100, N = 1, $ = {
266
266
  });
267
267
  return this.applyMargin(w, t);
268
268
  }
269
- const p = P({
269
+ const p = S({
270
270
  anchor: e ? h : void 0,
271
271
  element: i,
272
272
  elementAlign: r,
@@ -279,7 +279,7 @@ const I = 100, N = 1, $ = {
279
279
  positionMode: t.positionMode,
280
280
  scale: f
281
281
  });
282
- return D({
282
+ return z({
283
283
  anchor: h,
284
284
  anchorAlign: o,
285
285
  collisions: d,
@@ -312,17 +312,18 @@ const I = 100, N = 1, $ = {
312
312
  flipped: !1,
313
313
  offset: t.offset
314
314
  };
315
- const e = O(this), n = document.createElement("div"), o = this.$el && this.$el.firstChild && this.$el.firstChild.firstChild ? this.$el.firstChild.firstChild.cloneNode(!0) : null, r = o && o.getBoundingClientRect ? o : this._clonedElement;
315
+ const e = T(this), n = document.createElement("div"), o = this.$el && this.$el.firstChild && this.$el.firstChild.firstChild ? this.$el.firstChild.firstChild.cloneNode(!0) : null, r = o && o.getBoundingClientRect ? o : this._clonedElement;
316
316
  if (r)
317
317
  n.appendChild(r);
318
318
  else {
319
- const s = e && e[0].props ? e[0].props.class : "", a = this.$props.popupClass;
320
- n.innerHTML = `<div class="k-animation-container k-animation-container-relative">
321
- <div class="k-popup k-animation-container k-animation-container-relative">
322
- <div class="${s} ${a}" >
323
- </div>
324
- </div>
325
- </div>`;
319
+ const s = e && e[0].props ? e[0].props.class : "";
320
+ O($("div", {
321
+ class: "k-animation-container k-animation-container-relative"
322
+ }, $("div", {
323
+ class: "k-popup k-animation-container k-animation-container-relative"
324
+ }, $("div", {
325
+ class: [s, this.$props.popupClass]
326
+ }))), n);
326
327
  }
327
328
  if (i.appendChild(n), n && n.firstChild) {
328
329
  const s = n.firstChild;
@@ -333,7 +334,7 @@ const I = 100, N = 1, $ = {
333
334
  s.style[l] = u;
334
335
  }
335
336
  const d = n.firstChild, c = parseFloat(window.getComputedStyle(d).width), f = c > 0 ? d.getBoundingClientRect().width / c : 1, h = (this.$props.scale || 1) * f, p = this.position(t, d, this.$props.anchor, h);
336
- return n.parentNode.removeChild(n), p;
337
+ return O(null, n), n.parentNode.removeChild(n), p;
337
338
  },
338
339
  attachRepositionHandlers(t) {
339
340
  this.detachRepositionHandlers(), this._scrollableParents = this._domService.scrollableParents(this.$props.anchor ? this.mountedAnchor : t), this._scrollableParents.map((i) => i.addEventListener("scroll", this.reposition)), A() && window.addEventListener("resize", this.reposition);
@@ -352,10 +353,10 @@ const I = 100, N = 1, $ = {
352
353
  this._clonedElement = this.$el.cloneNode(!0), this.$forceUpdate();
353
354
  },
354
355
  getCurrentZIndex() {
355
- return this.kCurrentZIndex ? this.kCurrentZIndex + N : I;
356
+ return this.kCurrentZIndex ? this.kCurrentZIndex + U : F;
356
357
  },
357
358
  hasCustomOffset(t) {
358
- return t ? t.left !== $.left || t.top !== $.top : !1;
359
+ return t ? t.left !== b.left || t.top !== b.top : !1;
359
360
  }
360
361
  },
361
362
  render() {
@@ -365,7 +366,7 @@ const I = 100, N = 1, $ = {
365
366
  popupClass: i,
366
367
  show: e,
367
368
  id: n
368
- } = this.$props, o = O(this), r = o, d = this.hasCustomOffset(this.$props.offset) ? F : void 0, c = A() ? this.$props.appendTo ? this.mountedAppendTo || this.getParentRef(this.$props.appendTo) : document.body : void 0;
369
+ } = this.$props, o = T(this), r = o, d = this.hasCustomOffset(this.$props.offset) ? j : void 0, c = A() ? this.$props.appendTo ? this.mountedAppendTo || this.getParentRef(this.$props.appendTo) : document.body : void 0;
369
370
  if (this.$props.show) {
370
371
  const s = this.calculatePosition(this.$props, c);
371
372
  this._offsetLeft = s.offset.left, this._offsetTop = s.offset.top, this._flipped = !!s.flipped;
@@ -386,7 +387,7 @@ const I = 100, N = 1, $ = {
386
387
  },
387
388
  class: t
388
389
  }, [g("div", {
389
- class: [i, E],
390
+ class: [i, P],
390
391
  style: d
391
392
  }, [o])]);
392
393
  if ((e || this._exitingAnimation) && c) {
@@ -415,7 +416,7 @@ const I = 100, N = 1, $ = {
415
416
  }) : this.onOpened();
416
417
  });
417
418
  }
418
- const a = this.animationOpen ? b : "";
419
+ const a = this.animationOpen ? C : "";
419
420
  return g("div", {
420
421
  id: n,
421
422
  class: ["k-animation-container", a, t],
@@ -433,7 +434,7 @@ const I = 100, N = 1, $ = {
433
434
  role: this.$props.role,
434
435
  "aria-labelledby": this.$props.ariaLabelledBy,
435
436
  "aria-describedby": this.$props.ariaDescribedBy,
436
- class: [i, E]
437
+ class: [i, P]
437
438
  }, [r])])]);
438
439
  }
439
440
  return g("div", {
@@ -446,5 +447,5 @@ const I = 100, N = 1, $ = {
446
447
  }
447
448
  });
448
449
  export {
449
- X as Popup
450
+ V as Popup
450
451
  };
@@ -12,4 +12,4 @@
12
12
  * Licensed under commercial license. See LICENSE.md in the package root for more information
13
13
  *-------------------------------------------------------------------------------------------
14
14
  */
15
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("@progress/kendo-popup-common"),require("@progress/kendo-vue-common")):"function"==typeof define&&define.amd?define(["exports","vue","@progress/kendo-popup-common","@progress/kendo-vue-common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoVuePopup={},e.Vue,e.KendoPopupCommon,e.KendoVueCommon)}(this,function(e,t,n,i){"use strict";const o=(e,t)=>e||{height:0,left:t.left,top:t.top,width:0},s=()=>"undefined"!=typeof document&&!!document.body,r=()=>"undefined"!=typeof window,l=/auto|scroll/,a=e=>{const t=window.getComputedStyle(e);return`${t.overflow}${t.overflowX}${t.overflowY}`},d=1e3/60,h=(()=>{if(!s())return!1;const e=document.createElement("div");if(e.style.transform="matrix(10, 0, 0, 10, 0, 0)",e.innerHTML="<div>child</div>",document.body.appendChild(e),e&&e.firstChild){const t=e.firstChild;t.style.position="fixed",t.style.top="10px"}const t=10!==e.children[0].getBoundingClientRect().top;return document.body.removeChild(e),t})(),c="fit",p="flip",u="left",f="bottom",m="top";class g{constructor(e){this._dom=e}alignElement(e){const{anchor:t,element:n,anchorAlign:i,elementAlign:o,offset:s}=e,r=this._dom.hasOffsetParent(n)?this.relativeRect(t,n,s):this.absoluteRect(t,n,s);return this._dom.align({anchorAlign:i,anchorRect:r,elementAlign:o,elementRect:this._dom.offset(n)})}absoluteRect(e,t,n){const i=this._dom,s=((e,t)=>t?{height:e.height,left:e.left-t.left,top:e.top-t.top,width:e.width}:e)(o(i.offset(e),n),i.stackingElementOffset(t)),r=i.stackingElementScroll(t),l=i.addScroll(s,r),a=this.elementScrollPosition(e,t),d=i.removeScroll(l,a);return d.left+=window.scrollX||window.pageXOffset,d.top+=window.scrollY||window.pageYOffset,d}elementScrollPosition(e,t){return e?{x:0,y:0}:this._dom.scrollPosition(t)}relativeRect(e,t,n){return o(this._dom.position(e,t),n)}}class v{addOffset(e,t){return{left:e.left+t.left,top:e.top+t.top}}align(e){return n.align(e)}boundingOffset(e){return n.boundingOffset(e)}getWindow(){return r()?window:null}isBodyOffset(e){return n.isBodyOffset(e)}hasOffsetParent(e){if(!e)return!1;const t=e.offsetParent;return t&&!("BODY"===t.nodeName&&"static"===window.getComputedStyle(t).position)}offset(e){return e?n.offset(e):null}staticOffset(e){if(!e)return null;const{left:t,top:i}=e.style;e.style.left="0px",e.style.top="0px";const o=n.offset(e);return e.style.left=t,e.style.top=i,o}position(e,t){if(!e||!t)return null;const i=n.siblingContainer(e,t);return n.positionWithScroll(e,i)}relativeOffset(e,t){return n.applyLocationOffset(this.offset(e),t,this.isBodyOffset(e))}addScroll(e,t){return n.addScroll(e,t)}removeScroll(e,t){return n.removeScroll(e,t)}restrictToView(e){return n.restrictToView(e)}scrollPosition(e){return n.scrollPosition(e)}scrollableParents(e){return(e=>{const t=[];if(!s()||!r())return t;let n=e.parentElement;for(;n;)l.test(a(n))&&t.push(n),n=n.parentElement;return t.push(window),t})(e)}stackingElementOffset(e){const t=this.getRelativeContextElement(e);return t?n.offset(t):null}stackingElementScroll(e){const t=this.getRelativeContextElement(e);return t?{x:t.scrollLeft,y:t.scrollTop}:{x:0,y:0}}stackingElementViewPort(e){const t=this.getRelativeContextElement(e);return t?{height:t.scrollHeight,width:t.scrollWidth}:null}getRelativeContextElement(e){if(!e||!h)return null;let t=e.parentElement;for(;t;){if("none"!==window.getComputedStyle(t).transform)return t;t=t.parentElement}return null}useRelativePosition(e){return!!this.getRelativeContextElement(e)}windowViewPort(e){return n.getWindowViewPort(e)}zIndex(e,t){return((e,t)=>{if(!e||!s()||!r())return null;const i=n.siblingContainer(e,t);if(!i)return null;const o=[e].concat(n.parents(e,i)).reduce((e,t)=>{const n=t.style.zIndex||window.getComputedStyle(t).zIndex,i=parseInt(n,10);return i>e?i:e},0);return o?o+1:null})(e,t)}zoomLevel(){return s()&&r()?parseFloat((document.documentElement.clientWidth/window.innerWidth).toFixed(2)):1}isZoomed(){return this.zoomLevel()>1}}class w{constructor(e){this._dom=e}positionElement(e){const{anchor:t,currentLocation:n,element:i,anchorAlign:s,elementAlign:r,collisions:l}=e,a=this._dom,d=e.viewPort||a.stackingElementViewPort(i)||a.windowViewPort(i),h=o(a.offset(t),n),c=((e,t)=>t?{height:e.height,left:t.left,top:t.top,width:e.width}:e)(a.staticOffset(i),n),p=this.elementRect(i,c),u=a.restrictToView({anchorAlign:s,anchorRect:h,collisions:l,elementAlign:r,elementRect:p,viewPort:d});return{fitted:u.fitted,flipped:u.flipped,offset:a.addOffset(c,u.offset)}}elementRect(e,t){return this._dom.removeScroll(t,this._dom.scrollPosition(e))}}const y={name:"@progress/kendo-vue-popup",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:1657007252,version:"10.0.1-develop.7",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"},_={left:-1e3,top:0},b="k-animation-container-shown",$="k-popup",A={margin:"0"},C=t.defineComponent({name:"Popup",emits:["open","close","position","keydown","mousedownoutside"],props:{appendTo:{type:[String,Object],default:""},anchor:{type:[String,Object],default:""},className:[String,Array,Object],id:String,popupClass:[String,Array,Object],collision:{type:Object,default:function(){return{horizontal:c,vertical:p}}},anchorAlign:{type:Object,default:function(){return{horizontal:u,vertical:f}}},popupAlign:{type:Object,default:function(){return{horizontal:u,vertical:m}}},offset:{type:Object,default:function(){return _}},show:{type:Boolean,default:!1},animate:{type:[Boolean,Object],default:!0},direction:{type:String,default:"down"},margin:Object,positionMode:String,scale:Number,role:String,ariaLabelledBy:String,ariaDescribedBy:String,onOpen:Function,onClose:Function,onPosition:Function,onMousedownoutside:Function},inject:{kCurrentZIndex:{default:null}},data:()=>({hasMounted:!1,animationOpen:!1}),watch:{anchor(e){!this.hasMounted||!i.canUseDOM||(this.mountedAnchor=e?this.getParentRef(e,!0):document.body,this.reposition())},appendTo(e){!this.hasMounted||!i.canUseDOM||(this.mountedAppendTo=e?this.getParentRef(e):document.body,this.$el.parentElement!==this.mountedAppendTo&&this.mountedAppendTo.appendChild(this.$el),this.reposition())},show(e,t){if(t&&!e)if(this._cancelPendingAnimations(),this._opened&&(this._opened=!1,this.onClosing()),0===this.transitionDuration().exit)this.onClosed();else{this._exitingAnimation=!0;const e=this._animationGeneration;this.$nextTick(()=>{if(e!==this._animationGeneration)return;const t=this.$el;if(!t||!this._exitingAnimation)return this._exitingAnimation=!1,this.$forceUpdate(),void this.onClosed();const n=t.firstChild;n?this.animateElement(n,"exit",()=>{e===this._animationGeneration&&(this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed())}):(this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed())})}else!t&&e&&(this._cancelPendingAnimations(),this._exitingAnimation=!1)}},created(){i.validatePackage(y),this.mountedAppendTo=void 0,this.mountedAnchor=void 0,this._clonedElement=void 0,this._flipped=!1,this._offsetTop=0,this._offsetLeft=-1e3,this._opened=!1,this._exitingAnimation=!1,this._animationGeneration=0,this._enterTimerId=null,this._cancelAnimation=null,this._resizeObserver=void 0,this._domService=new v,this._alignService=new g(this._domService),this._positionService=new w(this._domService),this.reposition=function(e,t,n={}){let i,o,s,r,l=0;n=n||{};const a=function(){l=!1===n.leading?0:(new Date).getTime(),i=null,r=e.apply(o,s),i||(o=s=null)};return function(){const d=(new Date).getTime();!l&&!1===n.leading&&(l=d);const h=t-(d-l);return o=this,s=arguments,h<=0||h>t?(i&&(clearTimeout(i),i=null),l=d,r=e.apply(o,s),i||(o=s=null)):!i&&!1!==n.trailing&&(i=setTimeout(a,h)),r}}(this.reposition.bind(this),d)},mounted(){i.canUseDOM&&(this.mountedAppendTo=this.appendTo?this.getParentRef(this.appendTo):document.body,this.mountedAnchor=this.anchor?this.getParentRef(this.anchor,!0):document.body),this._parentElement=this.$el.parentElement,this._clonedElement=this.$el.cloneNode(!0),this.hasMounted=!0,this.mountedAppendTo.appendChild(this.$el),this.$forceUpdate()},updated(){if(this.hasMounted&&this.mountedAppendTo){const e=this.$el;1===(null==e?void 0:e.nodeType)&&e.parentElement!==this.mountedAppendTo&&this.mountedAppendTo.appendChild(e)}},unmounted(){this.detachRepositionHandlers(),this.detachResizeObserver(),"undefined"!=typeof window&&window.removeEventListener("mousedown",this.handleMouseDown)},beforeUnmount(){this._parentElement&&this._parentElement.appendChild(this.$el)},methods:{handleMouseDown(e){var t,n;const i=null===(null==(t=null==e?void 0:e.target)?void 0:t.closest(".k-animation-container")),o=(null==(n=this.mountedAnchor)?void 0:n.contains(null==e?void 0:e.target))||!1;if(i){const t={target:this,event:e,isAnchorClicked:o};this.$emit("mousedownoutside",t),"undefined"!=typeof window&&window.removeEventListener("mousedown",this.handleMouseDown)}},onOpened(){var e,t;const n=this.$el;"undefined"!=typeof window&&window.addEventListener("mousedown",this.handleMouseDown),this.$props.show&&(n.classList.add(b),this.animationOpen=!0),this.attachRepositionHandlers(n),this.attachResizeObserver(n);const i={target:this};null==(t=(e=this.$props).onOpen)||t.call(e,i),this.$emit("open",i)},onClosing(){this.$props.show||(this.$el.classList.remove(b),this.animationOpen=!1),this.detachRepositionHandlers(),this.detachResizeObserver(),"undefined"!=typeof window&&window.removeEventListener("mousedown",this.handleMouseDown)},onClosed(){var e,t;const n={target:this};null==(t=(e=this.$props).onClose)||t.call(e,n),this.$emit("close",n)},transitionDuration(){const e=this.$props.animate;let t=0,n=0;return e&&(!0===e?t=n=300:(t=e.openDuration||0,n=e.closeDuration||0)),{enter:t,exit:n}},_cancelPendingAnimations(){this._animationGeneration++,null!==this._enterTimerId&&(clearTimeout(this._enterTimerId),this._enterTimerId=null),this._cancelAnimation&&(this._cancelAnimation(),this._cancelAnimation=null)},animateElement(e,t,n){const i=this.transitionDuration()[t];if(0===i)return n();const o=e.ownerDocument,s=null==o?void 0:o.defaultView;if(!s)return n();const r="down"===this.$props.direction,l=this._flipped?"up":"down",a=this._flipped?"down":"up",d=r?l:a,h=`k-slide-${d}-${t}`,c=`k-slide-${d}-${t}-active`;let p=!1,u=null;const f=()=>{e.removeEventListener("transitionend",g),u&&(clearTimeout(u),u=null),e.style.transitionDuration="",e.classList.remove(h,c)},m=()=>{p||(p=!0,f(),e.style.display="exit"===t?"none":"",this._cancelAnimation=null,n())},g=t=>{t.target===e&&m()};e.addEventListener("transitionend",g),u=setTimeout(m,i+50),e.style.transitionDuration="",e.classList.remove(h,c),"enter"===t&&(e.style.display=""),e.classList.add(h),s.requestAnimationFrame(()=>{p||(e.style.transitionDuration=i+"ms",e.classList.add(c))}),this._cancelAnimation=()=>{p||(p=!0,f(),e.style.display="")}},isAnimationInstant(e){if(0===this.transitionDuration()[e])return!0;if("undefined"!=typeof window&&this.$el){const e=this.$el.firstChild;if(e){const t=window.getComputedStyle(e),n=parseFloat(t.transitionDuration||"0"),i=parseFloat(t.animationDuration||"0");if(0===n&&0===i)return!0}}return!1},getParentRef(e,t){if(e instanceof HTMLElement)return e;if(!e)return document.body;let n=this.$parent;for(;n&&!n.$refs[e];){if(n&&n.kendoAnchorRef&&t)return n.kendoAnchorRef;if(n=n.$parent,!n&&i.canUseDOM)return document.getElementById(e)||document.body}return n.$refs[e].$el||n.$refs[e]},position(e,t,i,o){var s,r,l,a;const{anchorAlign:d,popupAlign:h,collision:c,offset:p}=e,u=o||1,f=i?this.mountedAnchor:document.body;if(1===u){const n=this._alignService.alignElement({anchor:i?f:void 0,element:t,elementAlign:h,anchorAlign:d,offset:p}),o=this._positionService.positionElement({anchor:f,anchorAlign:d,collisions:c,element:t,currentLocation:n,elementAlign:h});return this.applyMargin(o,e)}const m=n.alignElement({anchor:i?f:void 0,element:t,elementAlign:h,anchorAlign:d,offset:p,margin:{horizontal:(null==(s=e.margin)?void 0:s.horizontal)||0,vertical:(null==(r=e.margin)?void 0:r.vertical)||0},positionMode:e.positionMode,scale:u});return n.positionElement({anchor:f,anchorAlign:d,collisions:c,element:t,currentLocation:m,elementAlign:h,margin:{horizontal:(null==(l=e.margin)?void 0:l.horizontal)||0,vertical:(null==(a=e.margin)?void 0:a.vertical)||0},scale:u})},applyMargin(e,t){var n,i,o,s,r,l,a,d;const h=t.margin;if(!h||!e.offset)return e;const c={...e.offset},p=h.horizontal||0,u=h.vertical||0,f=e.flipped?-1:1;return"left"===(null==(n=t.anchorAlign)?void 0:n.horizontal)&&"right"===(null==(i=t.popupAlign)?void 0:i.horizontal)?c.left-=p*f:"right"===(null==(o=t.anchorAlign)?void 0:o.horizontal)&&"left"===(null==(s=t.popupAlign)?void 0:s.horizontal)&&(c.left+=p*f),"top"===(null==(r=t.anchorAlign)?void 0:r.vertical)&&"bottom"===(null==(l=t.popupAlign)?void 0:l.vertical)?c.top-=u*f:"bottom"===(null==(a=t.anchorAlign)?void 0:a.vertical)&&"top"===(null==(d=t.popupAlign)?void 0:d.vertical)&&(c.top+=u*f),{...e,offset:c}},calculatePosition(e,t){if(!t||!r()||!i.canUseDOM)return{flipped:!1,offset:e.offset};const n=i.getDefaultSlots(this),o=document.createElement("div"),s=this.$el&&this.$el.firstChild&&this.$el.firstChild.firstChild?this.$el.firstChild.firstChild.cloneNode(!0):null,l=s&&s.getBoundingClientRect?s:this._clonedElement;if(l)o.appendChild(l);else{const e=n&&n[0].props?n[0].props.class:"",t=this.$props.popupClass;o.innerHTML=`<div class="k-animation-container k-animation-container-relative">\n <div class="k-popup k-animation-container k-animation-container-relative">\n <div class="${e} ${t}" >\n </div>\n </div>\n </div>`}if(t.appendChild(o),o&&o.firstChild){const e=o.firstChild;e.style.position="absolute",e.style.visibility="hidden",e.style.display="block",e.style.left="-1000",e.style.top="0";const t=n&&n[0].props?n[0].props.style:{};if(t)for(const[n,i]of Object.entries(t))e.style[n]=i}const a=o.firstChild,d=parseFloat(window.getComputedStyle(a).width),h=d>0?a.getBoundingClientRect().width/d:1,c=(this.$props.scale||1)*h,p=this.position(e,a,this.$props.anchor,c);return o.parentNode.removeChild(o),p},attachRepositionHandlers(e){this.detachRepositionHandlers(),this._scrollableParents=this._domService.scrollableParents(this.$props.anchor?this.mountedAnchor:e),this._scrollableParents.map(e=>e.addEventListener("scroll",this.reposition)),r()&&window.addEventListener("resize",this.reposition)},detachRepositionHandlers(){this._scrollableParents&&(this._scrollableParents.map(e=>e.removeEventListener("scroll",this.reposition)),this._scrollableParents=void 0),r()&&window.removeEventListener("resize",this.reposition)},attachResizeObserver(e){this.detachResizeObserver(),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(()=>this.reposition()),this._resizeObserver.observe(e))},detachResizeObserver(){var e;null==(e=this._resizeObserver)||e.disconnect(),this._resizeObserver=void 0},reposition(){this._clonedElement=this.$el.cloneNode(!0),this.$forceUpdate()},getCurrentZIndex(){return this.kCurrentZIndex?this.kCurrentZIndex+1:100},hasCustomOffset:e=>!!e&&(e.left!==_.left||e.top!==_.top)},render(){var e,n;const{className:o,popupClass:s,show:l,id:a}=this.$props,d=i.getDefaultSlots(this),h=d,c=this.hasCustomOffset(this.$props.offset)?A:void 0,p=r()?this.$props.appendTo?this.mountedAppendTo||this.getParentRef(this.$props.appendTo):document.body:void 0;if(this.$props.show){const t=this.calculatePosition(this.$props,p);this._offsetLeft=t.offset.left,this._offsetTop=t.offset.top,this._flipped=!!t.flipped;const i={target:this,fitted:!!t.fitted,flipped:!!t.flipped};null==(n=(e=this.$props).onPosition)||n.call(e,i),this.$emit("position",i)}const u=this.getCurrentZIndex();if(!this.hasMounted)return t.createVNode("div",{id:a,style:{display:"none",...this.$props.style},class:o},[t.createVNode("div",{class:[s,$],style:c},[d])]);if((l||this._exitingAnimation)&&p){const e={zIndex:u,position:this.$props.positionMode||"absolute",top:this._offsetTop+"px",left:this._offsetLeft+"px",pointerEvents:l?"auto":"none",...this.$props.style};if(l&&!this._opened){this._opened=!0;const e=this._animationGeneration;0===this.transitionDuration().enter?this._enterTimerId=setTimeout(()=>{this._enterTimerId=null,e===this._animationGeneration&&(!this.$props.show||!this._opened||this.onOpened())},0):this.$nextTick(()=>{if(e!==this._animationGeneration||!this.$props.show||!this._opened)return;const t=this.$el;if(!t)return;const n=t.firstChild;n?this.animateElement(n,"enter",()=>{e===this._animationGeneration&&this.$props.show&&this.onOpened()}):this.onOpened()})}const n=this.animationOpen?b:"";return t.createVNode("div",{id:a,class:["k-animation-container",n,o],style:e,onKeydown:e=>{this.$emit("keydown",e)}},[t.createVNode("div",{class:["k-child-animation-container"],style:{transitionDelay:"0ms",display:"block"}},[t.createVNode("div",{role:this.$props.role,"aria-labelledby":this.$props.ariaLabelledBy,"aria-describedby":this.$props.ariaDescribedBy,class:[s,$]},[h])])])}return t.createVNode("div",{id:a,style:{display:"none"},class:o},null)}});e.Popup=C});
15
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("@progress/kendo-popup-common"),require("@progress/kendo-vue-common")):"function"==typeof define&&define.amd?define(["exports","vue","@progress/kendo-popup-common","@progress/kendo-vue-common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoVuePopup={},e.Vue,e.KendoPopupCommon,e.KendoVueCommon)}(this,function(e,t,n,i){"use strict";const o=(e,t)=>e||{height:0,left:t.left,top:t.top,width:0},s=()=>"undefined"!=typeof document&&!!document.body,r=()=>"undefined"!=typeof window,l=/auto|scroll/,a=e=>{const t=window.getComputedStyle(e);return`${t.overflow}${t.overflowX}${t.overflowY}`},d=1e3/60,h=(()=>{if(!s())return!1;const e=document.createElement("div");if(e.style.transform="matrix(10, 0, 0, 10, 0, 0)",e.innerHTML="<div>child</div>",document.body.appendChild(e),e&&e.firstChild){const t=e.firstChild;t.style.position="fixed",t.style.top="10px"}const t=10!==e.children[0].getBoundingClientRect().top;return document.body.removeChild(e),t})(),c="fit",p="flip",u="left",f="bottom",m="top";class g{constructor(e){this._dom=e}alignElement(e){const{anchor:t,element:n,anchorAlign:i,elementAlign:o,offset:s}=e,r=this._dom.hasOffsetParent(n)?this.relativeRect(t,n,s):this.absoluteRect(t,n,s);return this._dom.align({anchorAlign:i,anchorRect:r,elementAlign:o,elementRect:this._dom.offset(n)})}absoluteRect(e,t,n){const i=this._dom,s=((e,t)=>t?{height:e.height,left:e.left-t.left,top:e.top-t.top,width:e.width}:e)(o(i.offset(e),n),i.stackingElementOffset(t)),r=i.stackingElementScroll(t),l=i.addScroll(s,r),a=this.elementScrollPosition(e,t),d=i.removeScroll(l,a);return d.left+=window.scrollX||window.pageXOffset,d.top+=window.scrollY||window.pageYOffset,d}elementScrollPosition(e,t){return e?{x:0,y:0}:this._dom.scrollPosition(t)}relativeRect(e,t,n){return o(this._dom.position(e,t),n)}}class v{addOffset(e,t){return{left:e.left+t.left,top:e.top+t.top}}align(e){return n.align(e)}boundingOffset(e){return n.boundingOffset(e)}getWindow(){return r()?window:null}isBodyOffset(e){return n.isBodyOffset(e)}hasOffsetParent(e){if(!e)return!1;const t=e.offsetParent;return t&&!("BODY"===t.nodeName&&"static"===window.getComputedStyle(t).position)}offset(e){return e?n.offset(e):null}staticOffset(e){if(!e)return null;const{left:t,top:i}=e.style;e.style.left="0px",e.style.top="0px";const o=n.offset(e);return e.style.left=t,e.style.top=i,o}position(e,t){if(!e||!t)return null;const i=n.siblingContainer(e,t);return n.positionWithScroll(e,i)}relativeOffset(e,t){return n.applyLocationOffset(this.offset(e),t,this.isBodyOffset(e))}addScroll(e,t){return n.addScroll(e,t)}removeScroll(e,t){return n.removeScroll(e,t)}restrictToView(e){return n.restrictToView(e)}scrollPosition(e){return n.scrollPosition(e)}scrollableParents(e){return(e=>{const t=[];if(!s()||!r())return t;let n=e.parentElement;for(;n;)l.test(a(n))&&t.push(n),n=n.parentElement;return t.push(window),t})(e)}stackingElementOffset(e){const t=this.getRelativeContextElement(e);return t?n.offset(t):null}stackingElementScroll(e){const t=this.getRelativeContextElement(e);return t?{x:t.scrollLeft,y:t.scrollTop}:{x:0,y:0}}stackingElementViewPort(e){const t=this.getRelativeContextElement(e);return t?{height:t.scrollHeight,width:t.scrollWidth}:null}getRelativeContextElement(e){if(!e||!h)return null;let t=e.parentElement;for(;t;){if("none"!==window.getComputedStyle(t).transform)return t;t=t.parentElement}return null}useRelativePosition(e){return!!this.getRelativeContextElement(e)}windowViewPort(e){return n.getWindowViewPort(e)}zIndex(e,t){return((e,t)=>{if(!e||!s()||!r())return null;const i=n.siblingContainer(e,t);if(!i)return null;const o=[e].concat(n.parents(e,i)).reduce((e,t)=>{const n=t.style.zIndex||window.getComputedStyle(t).zIndex,i=parseInt(n,10);return i>e?i:e},0);return o?o+1:null})(e,t)}zoomLevel(){return s()&&r()?parseFloat((document.documentElement.clientWidth/window.innerWidth).toFixed(2)):1}isZoomed(){return this.zoomLevel()>1}}class w{constructor(e){this._dom=e}positionElement(e){const{anchor:t,currentLocation:n,element:i,anchorAlign:s,elementAlign:r,collisions:l}=e,a=this._dom,d=e.viewPort||a.stackingElementViewPort(i)||a.windowViewPort(i),h=o(a.offset(t),n),c=((e,t)=>t?{height:e.height,left:t.left,top:t.top,width:e.width}:e)(a.staticOffset(i),n),p=this.elementRect(i,c),u=a.restrictToView({anchorAlign:s,anchorRect:h,collisions:l,elementAlign:r,elementRect:p,viewPort:d});return{fitted:u.fitted,flipped:u.flipped,offset:a.addOffset(c,u.offset)}}elementRect(e,t){return this._dom.removeScroll(t,this._dom.scrollPosition(e))}}const y={name:"@progress/kendo-vue-popup",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:1657007252,version:"10.1.0-develop.2",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"},_={left:-1e3,top:0},b="k-animation-container-shown",$="k-popup",A={margin:"0"},C=t.defineComponent({name:"Popup",emits:["open","close","position","keydown","mousedownoutside"],props:{appendTo:{type:[String,Object],default:""},anchor:{type:[String,Object],default:""},className:[String,Array,Object],id:String,popupClass:[String,Array,Object],collision:{type:Object,default:function(){return{horizontal:c,vertical:p}}},anchorAlign:{type:Object,default:function(){return{horizontal:u,vertical:f}}},popupAlign:{type:Object,default:function(){return{horizontal:u,vertical:m}}},offset:{type:Object,default:function(){return _}},show:{type:Boolean,default:!1},animate:{type:[Boolean,Object],default:!0},direction:{type:String,default:"down"},margin:Object,positionMode:String,scale:Number,role:String,ariaLabelledBy:String,ariaDescribedBy:String,onOpen:Function,onClose:Function,onPosition:Function,onMousedownoutside:Function},inject:{kCurrentZIndex:{default:null}},data:()=>({hasMounted:!1,animationOpen:!1}),watch:{anchor(e){!this.hasMounted||!i.canUseDOM||(this.mountedAnchor=e?this.getParentRef(e,!0):document.body,this.reposition())},appendTo(e){!this.hasMounted||!i.canUseDOM||(this.mountedAppendTo=e?this.getParentRef(e):document.body,this.$el.parentElement!==this.mountedAppendTo&&this.mountedAppendTo.appendChild(this.$el),this.reposition())},show(e,t){if(t&&!e)if(this._cancelPendingAnimations(),this._opened&&(this._opened=!1,this.onClosing()),0===this.transitionDuration().exit)this.onClosed();else{this._exitingAnimation=!0;const e=this._animationGeneration;this.$nextTick(()=>{if(e!==this._animationGeneration)return;const t=this.$el;if(!t||!this._exitingAnimation)return this._exitingAnimation=!1,this.$forceUpdate(),void this.onClosed();const n=t.firstChild;n?this.animateElement(n,"exit",()=>{e===this._animationGeneration&&(this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed())}):(this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed())})}else!t&&e&&(this._cancelPendingAnimations(),this._exitingAnimation=!1)}},created(){i.validatePackage(y),this.mountedAppendTo=void 0,this.mountedAnchor=void 0,this._clonedElement=void 0,this._flipped=!1,this._offsetTop=0,this._offsetLeft=-1e3,this._opened=!1,this._exitingAnimation=!1,this._animationGeneration=0,this._enterTimerId=null,this._cancelAnimation=null,this._resizeObserver=void 0,this._domService=new v,this._alignService=new g(this._domService),this._positionService=new w(this._domService),this.reposition=function(e,t,n={}){let i,o,s,r,l=0;n=n||{};const a=function(){l=!1===n.leading?0:(new Date).getTime(),i=null,r=e.apply(o,s),i||(o=s=null)};return function(){const d=(new Date).getTime();!l&&!1===n.leading&&(l=d);const h=t-(d-l);return o=this,s=arguments,h<=0||h>t?(i&&(clearTimeout(i),i=null),l=d,r=e.apply(o,s),i||(o=s=null)):!i&&!1!==n.trailing&&(i=setTimeout(a,h)),r}}(this.reposition.bind(this),d)},mounted(){i.canUseDOM&&(this.mountedAppendTo=this.appendTo?this.getParentRef(this.appendTo):document.body,this.mountedAnchor=this.anchor?this.getParentRef(this.anchor,!0):document.body),this._parentElement=this.$el.parentElement,this._clonedElement=this.$el.cloneNode(!0),this.hasMounted=!0,this.mountedAppendTo.appendChild(this.$el),this.$forceUpdate()},updated(){if(this.hasMounted&&this.mountedAppendTo){const e=this.$el;1===(null==e?void 0:e.nodeType)&&e.parentElement!==this.mountedAppendTo&&this.mountedAppendTo.appendChild(e)}},unmounted(){this.detachRepositionHandlers(),this.detachResizeObserver(),"undefined"!=typeof window&&window.removeEventListener("mousedown",this.handleMouseDown)},beforeUnmount(){this._parentElement&&this._parentElement.appendChild(this.$el)},methods:{handleMouseDown(e){var t,n;const i=null===(null==(t=null==e?void 0:e.target)?void 0:t.closest(".k-animation-container")),o=(null==(n=this.mountedAnchor)?void 0:n.contains(null==e?void 0:e.target))||!1;if(i){const t={target:this,event:e,isAnchorClicked:o};this.$emit("mousedownoutside",t),"undefined"!=typeof window&&window.removeEventListener("mousedown",this.handleMouseDown)}},onOpened(){var e,t;const n=this.$el;"undefined"!=typeof window&&window.addEventListener("mousedown",this.handleMouseDown),this.$props.show&&(n.classList.add(b),this.animationOpen=!0),this.attachRepositionHandlers(n),this.attachResizeObserver(n);const i={target:this};null==(t=(e=this.$props).onOpen)||t.call(e,i),this.$emit("open",i)},onClosing(){this.$props.show||(this.$el.classList.remove(b),this.animationOpen=!1),this.detachRepositionHandlers(),this.detachResizeObserver(),"undefined"!=typeof window&&window.removeEventListener("mousedown",this.handleMouseDown)},onClosed(){var e,t;const n={target:this};null==(t=(e=this.$props).onClose)||t.call(e,n),this.$emit("close",n)},transitionDuration(){const e=this.$props.animate;let t=0,n=0;return e&&(!0===e?t=n=300:(t=e.openDuration||0,n=e.closeDuration||0)),{enter:t,exit:n}},_cancelPendingAnimations(){this._animationGeneration++,null!==this._enterTimerId&&(clearTimeout(this._enterTimerId),this._enterTimerId=null),this._cancelAnimation&&(this._cancelAnimation(),this._cancelAnimation=null)},animateElement(e,t,n){const i=this.transitionDuration()[t];if(0===i)return n();const o=e.ownerDocument,s=null==o?void 0:o.defaultView;if(!s)return n();const r="down"===this.$props.direction,l=this._flipped?"up":"down",a=this._flipped?"down":"up",d=r?l:a,h=`k-slide-${d}-${t}`,c=`k-slide-${d}-${t}-active`;let p=!1,u=null;const f=()=>{e.removeEventListener("transitionend",g),u&&(clearTimeout(u),u=null),e.style.transitionDuration="",e.classList.remove(h,c)},m=()=>{p||(p=!0,f(),e.style.display="exit"===t?"none":"",this._cancelAnimation=null,n())},g=t=>{t.target===e&&m()};e.addEventListener("transitionend",g),u=setTimeout(m,i+50),e.style.transitionDuration="",e.classList.remove(h,c),"enter"===t&&(e.style.display=""),e.classList.add(h),s.requestAnimationFrame(()=>{p||(e.style.transitionDuration=i+"ms",e.classList.add(c))}),this._cancelAnimation=()=>{p||(p=!0,f(),e.style.display="")}},isAnimationInstant(e){if(0===this.transitionDuration()[e])return!0;if("undefined"!=typeof window&&this.$el){const e=this.$el.firstChild;if(e){const t=window.getComputedStyle(e),n=parseFloat(t.transitionDuration||"0"),i=parseFloat(t.animationDuration||"0");if(0===n&&0===i)return!0}}return!1},getParentRef(e,t){if(e instanceof HTMLElement)return e;if(!e)return document.body;let n=this.$parent;for(;n&&!n.$refs[e];){if(n&&n.kendoAnchorRef&&t)return n.kendoAnchorRef;if(n=n.$parent,!n&&i.canUseDOM)return document.getElementById(e)||document.body}return n.$refs[e].$el||n.$refs[e]},position(e,t,i,o){var s,r,l,a;const{anchorAlign:d,popupAlign:h,collision:c,offset:p}=e,u=o||1,f=i?this.mountedAnchor:document.body;if(1===u){const n=this._alignService.alignElement({anchor:i?f:void 0,element:t,elementAlign:h,anchorAlign:d,offset:p}),o=this._positionService.positionElement({anchor:f,anchorAlign:d,collisions:c,element:t,currentLocation:n,elementAlign:h});return this.applyMargin(o,e)}const m=n.alignElement({anchor:i?f:void 0,element:t,elementAlign:h,anchorAlign:d,offset:p,margin:{horizontal:(null==(s=e.margin)?void 0:s.horizontal)||0,vertical:(null==(r=e.margin)?void 0:r.vertical)||0},positionMode:e.positionMode,scale:u});return n.positionElement({anchor:f,anchorAlign:d,collisions:c,element:t,currentLocation:m,elementAlign:h,margin:{horizontal:(null==(l=e.margin)?void 0:l.horizontal)||0,vertical:(null==(a=e.margin)?void 0:a.vertical)||0},scale:u})},applyMargin(e,t){var n,i,o,s,r,l,a,d;const h=t.margin;if(!h||!e.offset)return e;const c={...e.offset},p=h.horizontal||0,u=h.vertical||0,f=e.flipped?-1:1;return"left"===(null==(n=t.anchorAlign)?void 0:n.horizontal)&&"right"===(null==(i=t.popupAlign)?void 0:i.horizontal)?c.left-=p*f:"right"===(null==(o=t.anchorAlign)?void 0:o.horizontal)&&"left"===(null==(s=t.popupAlign)?void 0:s.horizontal)&&(c.left+=p*f),"top"===(null==(r=t.anchorAlign)?void 0:r.vertical)&&"bottom"===(null==(l=t.popupAlign)?void 0:l.vertical)?c.top-=u*f:"bottom"===(null==(a=t.anchorAlign)?void 0:a.vertical)&&"top"===(null==(d=t.popupAlign)?void 0:d.vertical)&&(c.top+=u*f),{...e,offset:c}},calculatePosition(e,n){if(!n||!r()||!i.canUseDOM)return{flipped:!1,offset:e.offset};const o=i.getDefaultSlots(this),s=document.createElement("div"),l=this.$el&&this.$el.firstChild&&this.$el.firstChild.firstChild?this.$el.firstChild.firstChild.cloneNode(!0):null,a=l&&l.getBoundingClientRect?l:this._clonedElement;if(a)s.appendChild(a);else{const e=o&&o[0].props?o[0].props.class:"";t.render(t.h("div",{class:"k-animation-container k-animation-container-relative"},t.h("div",{class:"k-popup k-animation-container k-animation-container-relative"},t.h("div",{class:[e,this.$props.popupClass]}))),s)}if(n.appendChild(s),s&&s.firstChild){const e=s.firstChild;e.style.position="absolute",e.style.visibility="hidden",e.style.display="block",e.style.left="-1000",e.style.top="0";const t=o&&o[0].props?o[0].props.style:{};if(t)for(const[n,i]of Object.entries(t))e.style[n]=i}const d=s.firstChild,h=parseFloat(window.getComputedStyle(d).width),c=h>0?d.getBoundingClientRect().width/h:1,p=(this.$props.scale||1)*c,u=this.position(e,d,this.$props.anchor,p);return t.render(null,s),s.parentNode.removeChild(s),u},attachRepositionHandlers(e){this.detachRepositionHandlers(),this._scrollableParents=this._domService.scrollableParents(this.$props.anchor?this.mountedAnchor:e),this._scrollableParents.map(e=>e.addEventListener("scroll",this.reposition)),r()&&window.addEventListener("resize",this.reposition)},detachRepositionHandlers(){this._scrollableParents&&(this._scrollableParents.map(e=>e.removeEventListener("scroll",this.reposition)),this._scrollableParents=void 0),r()&&window.removeEventListener("resize",this.reposition)},attachResizeObserver(e){this.detachResizeObserver(),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(()=>this.reposition()),this._resizeObserver.observe(e))},detachResizeObserver(){var e;null==(e=this._resizeObserver)||e.disconnect(),this._resizeObserver=void 0},reposition(){this._clonedElement=this.$el.cloneNode(!0),this.$forceUpdate()},getCurrentZIndex(){return this.kCurrentZIndex?this.kCurrentZIndex+1:100},hasCustomOffset:e=>!!e&&(e.left!==_.left||e.top!==_.top)},render(){var e,n;const{className:o,popupClass:s,show:l,id:a}=this.$props,d=i.getDefaultSlots(this),h=d,c=this.hasCustomOffset(this.$props.offset)?A:void 0,p=r()?this.$props.appendTo?this.mountedAppendTo||this.getParentRef(this.$props.appendTo):document.body:void 0;if(this.$props.show){const t=this.calculatePosition(this.$props,p);this._offsetLeft=t.offset.left,this._offsetTop=t.offset.top,this._flipped=!!t.flipped;const i={target:this,fitted:!!t.fitted,flipped:!!t.flipped};null==(n=(e=this.$props).onPosition)||n.call(e,i),this.$emit("position",i)}const u=this.getCurrentZIndex();if(!this.hasMounted)return t.createVNode("div",{id:a,style:{display:"none",...this.$props.style},class:o},[t.createVNode("div",{class:[s,$],style:c},[d])]);if((l||this._exitingAnimation)&&p){const e={zIndex:u,position:this.$props.positionMode||"absolute",top:this._offsetTop+"px",left:this._offsetLeft+"px",pointerEvents:l?"auto":"none",...this.$props.style};if(l&&!this._opened){this._opened=!0;const e=this._animationGeneration;0===this.transitionDuration().enter?this._enterTimerId=setTimeout(()=>{this._enterTimerId=null,e===this._animationGeneration&&(!this.$props.show||!this._opened||this.onOpened())},0):this.$nextTick(()=>{if(e!==this._animationGeneration||!this.$props.show||!this._opened)return;const t=this.$el;if(!t)return;const n=t.firstChild;n?this.animateElement(n,"enter",()=>{e===this._animationGeneration&&this.$props.show&&this.onOpened()}):this.onOpened()})}const n=this.animationOpen?b:"";return t.createVNode("div",{id:a,class:["k-animation-container",n,o],style:e,onKeydown:e=>{this.$emit("keydown",e)}},[t.createVNode("div",{class:["k-child-animation-container"],style:{transitionDelay:"0ms",display:"block"}},[t.createVNode("div",{role:this.$props.role,"aria-labelledby":this.$props.ariaLabelledBy,"aria-describedby":this.$props.ariaDescribedBy,class:[s,$]},[h])])])}return t.createVNode("div",{id:a,style:{display:"none"},class:o},null)}});e.Popup=C});
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-vue-popup",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate: 1790257465,version:"10.0.1-develop.7",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"};exports.packageMetadata=e;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-vue-popup",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate: 1791291062,version:"10.1.0-develop.2",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"};exports.packageMetadata=e;
@@ -10,8 +10,8 @@ const e = {
10
10
  productName: "Kendo UI for Vue",
11
11
  productCode: "KENDOUIVUE",
12
12
  productCodes: ["KENDOUIVUE"],
13
- publishDate: 1790257465,
14
- version: "10.0.1-develop.7",
13
+ publishDate: 1791291062,
14
+ version: "10.1.0-develop.2",
15
15
  licensingDocsUrl: "https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"
16
16
  };
17
17
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-vue-popup",
3
- "version": "10.0.1-develop.7",
3
+ "version": "10.1.0-develop.2",
4
4
  "description": "Kendo UI for Vue Popup package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -26,8 +26,8 @@
26
26
  "sideEffects": false,
27
27
  "peerDependencies": {
28
28
  "@progress/kendo-licensing": "^1.7.2",
29
- "@progress/kendo-vue-animation": "10.0.1-develop.7",
30
- "@progress/kendo-vue-common": "10.0.1-develop.7",
29
+ "@progress/kendo-vue-animation": "10.1.0-develop.2",
30
+ "@progress/kendo-vue-common": "10.1.0-develop.2",
31
31
  "vue": "^3.0.2"
32
32
  },
33
33
  "dependencies": {
@@ -45,7 +45,7 @@
45
45
  "package": {
46
46
  "productName": "Kendo UI for Vue",
47
47
  "productCode": "KENDOUIVUE",
48
- "publishDate": 1790257465,
48
+ "publishDate": 1791291062,
49
49
  "licensingDocsUrl": "https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"
50
50
  }
51
51
  },