@progress/kendo-vue-popup 9.0.0-develop.3 → 9.0.0

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.
@@ -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(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(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"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).KendoVuePopup={},t.Vue,t.KendoPopupCommon,t.KendoVueCommon)}(this,function(t,e,n,i){"use strict";const o=(t,e)=>t||{height:0,left:e.left,top:e.top,width:0},s=()=>"undefined"!=typeof document&&!!document.body,r=()=>"undefined"!=typeof window,l=/auto|scroll/,a=t=>{const e=window.getComputedStyle(t);return`${e.overflow}${e.overflowX}${e.overflowY}`},d=1e3/60,c=(()=>{if(!s())return!1;const t=document.createElement("div");if(t.style.transform="matrix(10, 0, 0, 10, 0, 0)",t.innerHTML="<div>child</div>",document.body.appendChild(t),t&&t.firstChild){const e=t.firstChild;e.style.position="fixed",e.style.top="10px"}const e=10!==t.children[0].getBoundingClientRect().top;return document.body.removeChild(t),e})(),h="fit",p="flip",u="left",f="bottom",m="top";class w{constructor(t){this._dom=t}alignElement(t){const{anchor:e,element:n,anchorAlign:i,elementAlign:o,offset:s}=t,r=this._dom.hasOffsetParent(n)?this.relativeRect(e,n,s):this.absoluteRect(e,n,s);return this._dom.align({anchorAlign:i,anchorRect:r,elementAlign:o,elementRect:this._dom.offset(n)})}absoluteRect(t,e,n){const i=this._dom,s=((t,e)=>e?{height:t.height,left:t.left-e.left,top:t.top-e.top,width:t.width}:t)(o(i.offset(t),n),i.stackingElementOffset(e)),r=i.stackingElementScroll(e),l=i.addScroll(s,r),a=this.elementScrollPosition(t,e),d=i.removeScroll(l,a);return d.left+=window.scrollX||window.pageXOffset,d.top+=window.scrollY||window.pageYOffset,d}elementScrollPosition(t,e){return t?{x:0,y:0}:this._dom.scrollPosition(e)}relativeRect(t,e,n){return o(this._dom.position(t,e),n)}}class g{addOffset(t,e){return{left:t.left+e.left,top:t.top+e.top}}align(t){return n.align(t)}boundingOffset(t){return n.boundingOffset(t)}getWindow(){return r()?window:null}isBodyOffset(t){return n.isBodyOffset(t)}hasOffsetParent(t){if(!t)return!1;const e=t.offsetParent;return e&&!("BODY"===e.nodeName&&"static"===window.getComputedStyle(e).position)}offset(t){return t?n.offset(t):null}staticOffset(t){if(!t)return null;const{left:e,top:i}=t.style;t.style.left="0px",t.style.top="0px";const o=n.offset(t);return t.style.left=e,t.style.top=i,o}position(t,e){if(!t||!e)return null;const i=n.siblingContainer(t,e);return n.positionWithScroll(t,i)}relativeOffset(t,e){return n.applyLocationOffset(this.offset(t),e,this.isBodyOffset(t))}addScroll(t,e){return n.addScroll(t,e)}removeScroll(t,e){return n.removeScroll(t,e)}restrictToView(t){return n.restrictToView(t)}scrollPosition(t){return n.scrollPosition(t)}scrollableParents(t){return(t=>{const e=[];if(!s()||!r())return e;let n=t.parentElement;for(;n;)l.test(a(n))&&e.push(n),n=n.parentElement;return e.push(window),e})(t)}stackingElementOffset(t){const e=this.getRelativeContextElement(t);return e?n.offset(e):null}stackingElementScroll(t){const e=this.getRelativeContextElement(t);return e?{x:e.scrollLeft,y:e.scrollTop}:{x:0,y:0}}stackingElementViewPort(t){const e=this.getRelativeContextElement(t);return e?{height:e.scrollHeight,width:e.scrollWidth}:null}getRelativeContextElement(t){if(!t||!c)return null;let e=t.parentElement;for(;e;){if("none"!==window.getComputedStyle(e).transform)return e;e=e.parentElement}return null}useRelativePosition(t){return!!this.getRelativeContextElement(t)}windowViewPort(t){return n.getWindowViewPort(t)}zIndex(t,e){return((t,e)=>{if(!t||!s()||!r())return null;const i=n.siblingContainer(t,e);if(!i)return null;const o=[t].concat(n.parents(t,i)).reduce((t,e)=>{const n=e.style.zIndex||window.getComputedStyle(e).zIndex,i=parseInt(n,10);return i>t?i:t},0);return o?o+1:null})(t,e)}zoomLevel(){return s()&&r()?parseFloat((document.documentElement.clientWidth/window.innerWidth).toFixed(2)):1}isZoomed(){return this.zoomLevel()>1}}let v=class{constructor(t){this._dom=t}positionElement(t){const{anchor:e,currentLocation:n,element:i,anchorAlign:s,elementAlign:r,collisions:l}=t,a=this._dom,d=t.viewPort||a.stackingElementViewPort(i)||a.windowViewPort(i),c=o(a.offset(e),n),h=((t,e)=>e?{height:t.height,left:e.left,top:e.top,width:t.width}:t)(a.staticOffset(i),n),p=this.elementRect(i,h),u=a.restrictToView({anchorAlign:s,anchorRect:c,collisions:l,elementAlign:r,elementRect:p,viewPort:d});return{flipped:u.flipped,offset:a.addOffset(h,u.offset)}}elementRect(t,e){return this._dom.removeScroll(e,this._dom.scrollPosition(t))}};const _={name:"@progress/kendo-vue-popup",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:1657007252,version:"9.0.0-develop.3",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"},y={left:-1e3,top:0},C="k-popup",$={margin:"0"},E=e.defineComponent({name:"Popup",props:{appendTo:{type:String,default:""},anchor:{type:[String,Object],default:""},className:String,id:String,popupClass:String,collision:{type:Object,default:function(){return{horizontal:h,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 y}},show:{type:Boolean,default:!1},animate:{type:[Boolean,Object],default:!0},direction:{type:String,default:"down"},onOpen:Function,onClose:Function,onMousedownoutside:Function},inject:{kCurrentZIndex:{default:null}},data:()=>({hasMounted:!1,animationOpen:!1}),watch:{show(t,e){if(e&&!t)if(this._cancelPendingAnimations(),this._opened&&(this._opened=!1,this.onClosing()),0===this.transitionDuration().exit)this.onClosed();else{this._exitingAnimation=!0;const t=this._animationGeneration;this.$nextTick(()=>{if(t!==this._animationGeneration)return;const e=this.$el;if(!e||!this._exitingAnimation)return this._exitingAnimation=!1,this.$forceUpdate(),void this.onClosed();const n=e.firstChild;n?this.animateElement(n,"exit",()=>{t===this._animationGeneration&&(this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed())}):(this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed())})}else!e&&t&&(this._cancelPendingAnimations(),this._exitingAnimation=!1)}},created(){i.validatePackage(_),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._domService=new g,this._alignService=new w(this._domService),this._positionService=new v(this._domService),this.reposition=function(t,e,n={}){let i,o,s,r,l=0;n=n||{};const a=function(){l=!1===n.leading?0:(new Date).getTime(),i=null,r=t.apply(o,s),i||(o=s=null)};return function(){const d=(new Date).getTime();!l&&!1===n.leading&&(l=d);const c=e-(d-l);return o=this,s=arguments,c<=0||c>e?(i&&(clearTimeout(i),i=null),l=d,r=t.apply(o,s),i||(o=s=null)):!i&&!1!==n.trailing&&(i=setTimeout(a,c)),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)},updated(){if(this.hasMounted&&this.mountedAppendTo){const t=this.$el;1===(null==t?void 0:t.nodeType)&&t.parentElement!==this.mountedAppendTo&&this.mountedAppendTo.appendChild(t)}},unmounted(){this.detachRepositionHandlers(),"undefined"!=typeof window&&window.removeEventListener("mousedown",this.handleMouseDown)},beforeUnmount(){this._parentElement&&this._parentElement.appendChild(this.$el)},methods:{handleMouseDown(t){var e,n;const i=null===(null==(e=null==t?void 0:t.target)?void 0:e.closest(".k-animation-container")),o=(null==(n=this.mountedAnchor)?void 0:n.contains(null==t?void 0:t.target))||!1;if(i){const e={target:this,event:t,isAnchorClicked:o};this.$emit("mousedownoutside",e),"undefined"!=typeof window&&window.removeEventListener("mousedown",this.handleMouseDown)}},onOpened(){const t=this.$el;"undefined"!=typeof window&&window.addEventListener("mousedown",this.handleMouseDown),this.$props.show&&(this.animationOpen=!0),this.attachRepositionHandlers(t),this.$emit("open",{target:this})},onClosing(){this.$props.show||(this.animationOpen=!1),this.detachRepositionHandlers(),"undefined"!=typeof window&&window.removeEventListener("mousedown",this.handleMouseDown)},onClosed(){this.$emit("close",{target:this})},transitionDuration(){const t=this.$props.animate;let e=0,n=0;return t&&(!0===t?e=n=300:(e=t.openDuration||0,n=t.closeDuration||0)),{enter:e,exit:n}},_cancelPendingAnimations(){this._animationGeneration++,null!==this._enterTimerId&&(clearTimeout(this._enterTimerId),this._enterTimerId=null),this._cancelAnimation&&(this._cancelAnimation(),this._cancelAnimation=null)},animateElement(t,e,n){const i=this.transitionDuration()[e];if(0===i)return n();const o=t.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,c=`k-slide-${d}-${e}`,h=`k-slide-${d}-${e}-active`;let p=!1,u=null;const f=()=>{t.removeEventListener("transitionend",w),u&&(clearTimeout(u),u=null),t.style.transitionDuration="",t.classList.remove(c,h)},m=()=>{p||(p=!0,f(),t.style.display="exit"===e?"none":"",this._cancelAnimation=null,n())},w=e=>{e.target===t&&m()};t.addEventListener("transitionend",w),u=setTimeout(m,i+50),t.style.transitionDuration="",t.classList.remove(c,h),"enter"===e&&(t.style.display=""),t.classList.add(c),s.requestAnimationFrame(()=>{p||(t.style.transitionDuration=i+"ms",t.classList.add(h))}),this._cancelAnimation=()=>{p||(p=!0,f(),t.style.display="")}},isAnimationInstant(t){if(0===this.transitionDuration()[t])return!0;if("undefined"!=typeof window&&this.$el){const t=this.$el.firstChild;if(t){const e=window.getComputedStyle(t),n=parseFloat(e.transitionDuration||"0"),i=parseFloat(e.animationDuration||"0");if(0===n&&0===i)return!0}}return!1},getParentRef(t,e){let n=this.$parent;for(;!n.$refs[t];){if(n&&n.kendoAnchorRef&&e)return n.kendoAnchorRef;if(n=n.$parent,!n&&i.canUseDOM)return document.getElementById(t)||document.body}return n.$refs[t].$el||n.$refs[t]},position(t,e,n){const{anchorAlign:i,popupAlign:o,collision:s,offset:r}=t,l=n?this.mountedAnchor:document.body,a=this._alignService.alignElement({anchor:n?l:void 0,element:e,elementAlign:o,anchorAlign:i,offset:r});return this._positionService.positionElement({anchor:l,anchorAlign:i,collisions:s,element:e,currentLocation:a,elementAlign:o})},calculatePosition(t,e){if(!e||!r()||!i.canUseDOM)return{flipped:!1,offset:t.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 t=n&&n[0].props?n[0].props.class:"",e=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="${t} ${e}" >\n </div>\n </div>\n </div>`}if(e.appendChild(o),o&&o.firstChild){const t=o.firstChild;t.style.position="absolute",t.style.visibility="hidden",t.style.display="block",t.style.left="-1000",t.style.top="0";const e=n&&n[0].props?n[0].props.style:{};if(e)for(const[n,i]of Object.entries(e))t.style[n]=i}const a=this.position(t,o.firstChild,this.$props.anchor);return o.parentNode.removeChild(o),a},attachRepositionHandlers(t){this.detachRepositionHandlers(),this._scrollableParents=this._domService.scrollableParents(this.$props.anchor?this.mountedAnchor:t),this._scrollableParents.map(t=>t.addEventListener("scroll",this.reposition)),r()&&window.addEventListener("resize",this.reposition)},detachRepositionHandlers(){this._scrollableParents&&(this._scrollableParents.map(t=>t.removeEventListener("scroll",this.reposition)),this._scrollableParents=void 0),r()&&window.removeEventListener("resize",this.reposition)},reposition(){this._clonedElement=this.$el.cloneNode(!0),this.$forceUpdate()},getCurrentZIndex(){return this.kCurrentZIndex?this.kCurrentZIndex+1:100},hasCustomOffset:t=>!!t&&(t.left!==y.left||t.top!==y.top)},render(){const{className:t,popupClass:n,show:o,id:s}=this.$props,l=i.getDefaultSlots(this),a=l,d=this.hasCustomOffset(this.$props.offset)?$:void 0,c=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,c);this._offsetLeft=t.offset.left,this._offsetTop=t.offset.top,this._flipped=!!t.flipped}const h=this.getCurrentZIndex();if(!this.hasMounted)return e.createVNode("div",{id:s,style:{display:"none"},class:t},[e.createVNode("div",{class:[n,C],style:d},[l])]);if((o||this._exitingAnimation)&&c){const i={zIndex:h,position:"absolute",top:this._offsetTop+"px",left:this._offsetLeft+"px",pointerEvents:o?"auto":"none"};if(o&&!this._opened){this._opened=!0;const t=this._animationGeneration;0===this.transitionDuration().enter?this._enterTimerId=setTimeout(()=>{this._enterTimerId=null,t===this._animationGeneration&&(!this.$props.show||!this._opened||this.onOpened())},0):this.$nextTick(()=>{if(t!==this._animationGeneration||!this.$props.show||!this._opened)return;const e=this.$el;if(!e)return;const n=e.firstChild;n?this.animateElement(n,"enter",()=>{t===this._animationGeneration&&this.$props.show&&this.onOpened()}):this.onOpened()})}const r=this.animationOpen?"k-animation-container-shown":"";return e.createVNode("div",{id:s,class:["k-animation-container","k-animation-container-relative",r,t],style:i},[e.createVNode("div",{class:["k-child-animation-container"],style:{transitionDelay:"0ms",display:"block"}},[e.createVNode("div",{class:[n,C]},[a])])])}return e.createVNode("div",{id:s,style:{display:"none"},class:t},null)}});t.Popup=E});
15
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(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"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).KendoVuePopup={},t.Vue,t.KendoPopupCommon,t.KendoVueCommon)}(this,function(t,e,n,i){"use strict";const o=(t,e)=>t||{height:0,left:e.left,top:e.top,width:0},s=()=>"undefined"!=typeof document&&!!document.body,r=()=>"undefined"!=typeof window,l=/auto|scroll/,a=t=>{const e=window.getComputedStyle(t);return`${e.overflow}${e.overflowX}${e.overflowY}`},d=1e3/60,c=(()=>{if(!s())return!1;const t=document.createElement("div");if(t.style.transform="matrix(10, 0, 0, 10, 0, 0)",t.innerHTML="<div>child</div>",document.body.appendChild(t),t&&t.firstChild){const e=t.firstChild;e.style.position="fixed",e.style.top="10px"}const e=10!==t.children[0].getBoundingClientRect().top;return document.body.removeChild(t),e})(),h="fit",p="flip",u="left",f="bottom",m="top";class w{constructor(t){this._dom=t}alignElement(t){const{anchor:e,element:n,anchorAlign:i,elementAlign:o,offset:s}=t,r=this._dom.hasOffsetParent(n)?this.relativeRect(e,n,s):this.absoluteRect(e,n,s);return this._dom.align({anchorAlign:i,anchorRect:r,elementAlign:o,elementRect:this._dom.offset(n)})}absoluteRect(t,e,n){const i=this._dom,s=((t,e)=>e?{height:t.height,left:t.left-e.left,top:t.top-e.top,width:t.width}:t)(o(i.offset(t),n),i.stackingElementOffset(e)),r=i.stackingElementScroll(e),l=i.addScroll(s,r),a=this.elementScrollPosition(t,e),d=i.removeScroll(l,a);return d.left+=window.scrollX||window.pageXOffset,d.top+=window.scrollY||window.pageYOffset,d}elementScrollPosition(t,e){return t?{x:0,y:0}:this._dom.scrollPosition(e)}relativeRect(t,e,n){return o(this._dom.position(t,e),n)}}class g{addOffset(t,e){return{left:t.left+e.left,top:t.top+e.top}}align(t){return n.align(t)}boundingOffset(t){return n.boundingOffset(t)}getWindow(){return r()?window:null}isBodyOffset(t){return n.isBodyOffset(t)}hasOffsetParent(t){if(!t)return!1;const e=t.offsetParent;return e&&!("BODY"===e.nodeName&&"static"===window.getComputedStyle(e).position)}offset(t){return t?n.offset(t):null}staticOffset(t){if(!t)return null;const{left:e,top:i}=t.style;t.style.left="0px",t.style.top="0px";const o=n.offset(t);return t.style.left=e,t.style.top=i,o}position(t,e){if(!t||!e)return null;const i=n.siblingContainer(t,e);return n.positionWithScroll(t,i)}relativeOffset(t,e){return n.applyLocationOffset(this.offset(t),e,this.isBodyOffset(t))}addScroll(t,e){return n.addScroll(t,e)}removeScroll(t,e){return n.removeScroll(t,e)}restrictToView(t){return n.restrictToView(t)}scrollPosition(t){return n.scrollPosition(t)}scrollableParents(t){return(t=>{const e=[];if(!s()||!r())return e;let n=t.parentElement;for(;n;)l.test(a(n))&&e.push(n),n=n.parentElement;return e.push(window),e})(t)}stackingElementOffset(t){const e=this.getRelativeContextElement(t);return e?n.offset(e):null}stackingElementScroll(t){const e=this.getRelativeContextElement(t);return e?{x:e.scrollLeft,y:e.scrollTop}:{x:0,y:0}}stackingElementViewPort(t){const e=this.getRelativeContextElement(t);return e?{height:e.scrollHeight,width:e.scrollWidth}:null}getRelativeContextElement(t){if(!t||!c)return null;let e=t.parentElement;for(;e;){if("none"!==window.getComputedStyle(e).transform)return e;e=e.parentElement}return null}useRelativePosition(t){return!!this.getRelativeContextElement(t)}windowViewPort(t){return n.getWindowViewPort(t)}zIndex(t,e){return((t,e)=>{if(!t||!s()||!r())return null;const i=n.siblingContainer(t,e);if(!i)return null;const o=[t].concat(n.parents(t,i)).reduce((t,e)=>{const n=e.style.zIndex||window.getComputedStyle(e).zIndex,i=parseInt(n,10);return i>t?i:t},0);return o?o+1:null})(t,e)}zoomLevel(){return s()&&r()?parseFloat((document.documentElement.clientWidth/window.innerWidth).toFixed(2)):1}isZoomed(){return this.zoomLevel()>1}}let v=class{constructor(t){this._dom=t}positionElement(t){const{anchor:e,currentLocation:n,element:i,anchorAlign:s,elementAlign:r,collisions:l}=t,a=this._dom,d=t.viewPort||a.stackingElementViewPort(i)||a.windowViewPort(i),c=o(a.offset(e),n),h=((t,e)=>e?{height:t.height,left:e.left,top:e.top,width:t.width}:t)(a.staticOffset(i),n),p=this.elementRect(i,h),u=a.restrictToView({anchorAlign:s,anchorRect:c,collisions:l,elementAlign:r,elementRect:p,viewPort:d});return{flipped:u.flipped,offset:a.addOffset(h,u.offset)}}elementRect(t,e){return this._dom.removeScroll(e,this._dom.scrollPosition(t))}};const _={name:"@progress/kendo-vue-popup",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:1657007252,version:"9.0.0",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"},y={left:-1e3,top:0},C="k-popup",$={margin:"0"},E=e.defineComponent({name:"Popup",props:{appendTo:{type:String,default:""},anchor:{type:[String,Object],default:""},className:String,id:String,popupClass:String,collision:{type:Object,default:function(){return{horizontal:h,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 y}},show:{type:Boolean,default:!1},animate:{type:[Boolean,Object],default:!0},direction:{type:String,default:"down"},onOpen:Function,onClose:Function,onMousedownoutside:Function},inject:{kCurrentZIndex:{default:null}},data:()=>({hasMounted:!1,animationOpen:!1}),watch:{show(t,e){if(e&&!t)if(this._cancelPendingAnimations(),this._opened&&(this._opened=!1,this.onClosing()),0===this.transitionDuration().exit)this.onClosed();else{this._exitingAnimation=!0;const t=this._animationGeneration;this.$nextTick(()=>{if(t!==this._animationGeneration)return;const e=this.$el;if(!e||!this._exitingAnimation)return this._exitingAnimation=!1,this.$forceUpdate(),void this.onClosed();const n=e.firstChild;n?this.animateElement(n,"exit",()=>{t===this._animationGeneration&&(this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed())}):(this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed())})}else!e&&t&&(this._cancelPendingAnimations(),this._exitingAnimation=!1)}},created(){i.validatePackage(_),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._domService=new g,this._alignService=new w(this._domService),this._positionService=new v(this._domService),this.reposition=function(t,e,n={}){let i,o,s,r,l=0;n=n||{};const a=function(){l=!1===n.leading?0:(new Date).getTime(),i=null,r=t.apply(o,s),i||(o=s=null)};return function(){const d=(new Date).getTime();!l&&!1===n.leading&&(l=d);const c=e-(d-l);return o=this,s=arguments,c<=0||c>e?(i&&(clearTimeout(i),i=null),l=d,r=t.apply(o,s),i||(o=s=null)):!i&&!1!==n.trailing&&(i=setTimeout(a,c)),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)},updated(){if(this.hasMounted&&this.mountedAppendTo){const t=this.$el;1===(null==t?void 0:t.nodeType)&&t.parentElement!==this.mountedAppendTo&&this.mountedAppendTo.appendChild(t)}},unmounted(){this.detachRepositionHandlers(),"undefined"!=typeof window&&window.removeEventListener("mousedown",this.handleMouseDown)},beforeUnmount(){this._parentElement&&this._parentElement.appendChild(this.$el)},methods:{handleMouseDown(t){var e,n;const i=null===(null==(e=null==t?void 0:t.target)?void 0:e.closest(".k-animation-container")),o=(null==(n=this.mountedAnchor)?void 0:n.contains(null==t?void 0:t.target))||!1;if(i){const e={target:this,event:t,isAnchorClicked:o};this.$emit("mousedownoutside",e),"undefined"!=typeof window&&window.removeEventListener("mousedown",this.handleMouseDown)}},onOpened(){const t=this.$el;"undefined"!=typeof window&&window.addEventListener("mousedown",this.handleMouseDown),this.$props.show&&(this.animationOpen=!0),this.attachRepositionHandlers(t),this.$emit("open",{target:this})},onClosing(){this.$props.show||(this.animationOpen=!1),this.detachRepositionHandlers(),"undefined"!=typeof window&&window.removeEventListener("mousedown",this.handleMouseDown)},onClosed(){this.$emit("close",{target:this})},transitionDuration(){const t=this.$props.animate;let e=0,n=0;return t&&(!0===t?e=n=300:(e=t.openDuration||0,n=t.closeDuration||0)),{enter:e,exit:n}},_cancelPendingAnimations(){this._animationGeneration++,null!==this._enterTimerId&&(clearTimeout(this._enterTimerId),this._enterTimerId=null),this._cancelAnimation&&(this._cancelAnimation(),this._cancelAnimation=null)},animateElement(t,e,n){const i=this.transitionDuration()[e];if(0===i)return n();const o=t.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,c=`k-slide-${d}-${e}`,h=`k-slide-${d}-${e}-active`;let p=!1,u=null;const f=()=>{t.removeEventListener("transitionend",w),u&&(clearTimeout(u),u=null),t.style.transitionDuration="",t.classList.remove(c,h)},m=()=>{p||(p=!0,f(),t.style.display="exit"===e?"none":"",this._cancelAnimation=null,n())},w=e=>{e.target===t&&m()};t.addEventListener("transitionend",w),u=setTimeout(m,i+50),t.style.transitionDuration="",t.classList.remove(c,h),"enter"===e&&(t.style.display=""),t.classList.add(c),s.requestAnimationFrame(()=>{p||(t.style.transitionDuration=i+"ms",t.classList.add(h))}),this._cancelAnimation=()=>{p||(p=!0,f(),t.style.display="")}},isAnimationInstant(t){if(0===this.transitionDuration()[t])return!0;if("undefined"!=typeof window&&this.$el){const t=this.$el.firstChild;if(t){const e=window.getComputedStyle(t),n=parseFloat(e.transitionDuration||"0"),i=parseFloat(e.animationDuration||"0");if(0===n&&0===i)return!0}}return!1},getParentRef(t,e){let n=this.$parent;for(;!n.$refs[t];){if(n&&n.kendoAnchorRef&&e)return n.kendoAnchorRef;if(n=n.$parent,!n&&i.canUseDOM)return document.getElementById(t)||document.body}return n.$refs[t].$el||n.$refs[t]},position(t,e,n){const{anchorAlign:i,popupAlign:o,collision:s,offset:r}=t,l=n?this.mountedAnchor:document.body,a=this._alignService.alignElement({anchor:n?l:void 0,element:e,elementAlign:o,anchorAlign:i,offset:r});return this._positionService.positionElement({anchor:l,anchorAlign:i,collisions:s,element:e,currentLocation:a,elementAlign:o})},calculatePosition(t,e){if(!e||!r()||!i.canUseDOM)return{flipped:!1,offset:t.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 t=n&&n[0].props?n[0].props.class:"",e=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="${t} ${e}" >\n </div>\n </div>\n </div>`}if(e.appendChild(o),o&&o.firstChild){const t=o.firstChild;t.style.position="absolute",t.style.visibility="hidden",t.style.display="block",t.style.left="-1000",t.style.top="0";const e=n&&n[0].props?n[0].props.style:{};if(e)for(const[n,i]of Object.entries(e))t.style[n]=i}const a=this.position(t,o.firstChild,this.$props.anchor);return o.parentNode.removeChild(o),a},attachRepositionHandlers(t){this.detachRepositionHandlers(),this._scrollableParents=this._domService.scrollableParents(this.$props.anchor?this.mountedAnchor:t),this._scrollableParents.map(t=>t.addEventListener("scroll",this.reposition)),r()&&window.addEventListener("resize",this.reposition)},detachRepositionHandlers(){this._scrollableParents&&(this._scrollableParents.map(t=>t.removeEventListener("scroll",this.reposition)),this._scrollableParents=void 0),r()&&window.removeEventListener("resize",this.reposition)},reposition(){this._clonedElement=this.$el.cloneNode(!0),this.$forceUpdate()},getCurrentZIndex(){return this.kCurrentZIndex?this.kCurrentZIndex+1:100},hasCustomOffset:t=>!!t&&(t.left!==y.left||t.top!==y.top)},render(){const{className:t,popupClass:n,show:o,id:s}=this.$props,l=i.getDefaultSlots(this),a=l,d=this.hasCustomOffset(this.$props.offset)?$:void 0,c=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,c);this._offsetLeft=t.offset.left,this._offsetTop=t.offset.top,this._flipped=!!t.flipped}const h=this.getCurrentZIndex();if(!this.hasMounted)return e.createVNode("div",{id:s,style:{display:"none"},class:t},[e.createVNode("div",{class:[n,C],style:d},[l])]);if((o||this._exitingAnimation)&&c){const i={zIndex:h,position:"absolute",top:this._offsetTop+"px",left:this._offsetLeft+"px",pointerEvents:o?"auto":"none"};if(o&&!this._opened){this._opened=!0;const t=this._animationGeneration;0===this.transitionDuration().enter?this._enterTimerId=setTimeout(()=>{this._enterTimerId=null,t===this._animationGeneration&&(!this.$props.show||!this._opened||this.onOpened())},0):this.$nextTick(()=>{if(t!==this._animationGeneration||!this.$props.show||!this._opened)return;const e=this.$el;if(!e)return;const n=e.firstChild;n?this.animateElement(n,"enter",()=>{t===this._animationGeneration&&this.$props.show&&this.onOpened()}):this.onOpened()})}const r=this.animationOpen?"k-animation-container-shown":"";return e.createVNode("div",{id:s,class:["k-animation-container","k-animation-container-relative",r,t],style:i},[e.createVNode("div",{class:["k-child-animation-container"],style:{transitionDelay:"0ms",display:"block"}},[e.createVNode("div",{class:[n,C]},[a])])])}return e.createVNode("div",{id:s,style:{display:"none"},class:t},null)}});t.Popup=E});
@@ -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: 1779271383,version:"9.0.0-develop.3",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: 1779272708,version:"9.0.0",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: 1779271383,
14
- version: "9.0.0-develop.3",
13
+ publishDate: 1779272708,
14
+ version: "9.0.0",
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": "9.0.0-develop.3",
3
+ "version": "9.0.0",
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": "9.0.0-develop.3",
30
- "@progress/kendo-vue-common": "9.0.0-develop.3",
29
+ "@progress/kendo-vue-animation": "9.0.0",
30
+ "@progress/kendo-vue-common": "9.0.0",
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": 1779271383,
48
+ "publishDate": 1779272708,
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
  },