@progress/kendo-vue-popup 8.4.0-develop.3 → 8.4.0-develop.5

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.d.ts CHANGED
@@ -69,6 +69,7 @@ declare const Popup: import('vue').DefineComponent<import('vue').ExtractPropType
69
69
  onMousedownoutside: PropType<(event: MouseDownOutsideEvent) => void>;
70
70
  }>, {}, {
71
71
  hasMounted: boolean;
72
+ animationOpen: boolean;
72
73
  }, {}, {
73
74
  handleMouseDown(event: MouseEvent): void;
74
75
  onOpened(): void;
@@ -88,6 +89,7 @@ declare const Popup: import('vue').DefineComponent<import('vue').ExtractPropType
88
89
  detachRepositionHandlers(): void;
89
90
  reposition(): void;
90
91
  getCurrentZIndex(): number;
92
+ hasCustomOffset(offset: any): boolean;
91
93
  }, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
92
94
  appendTo: {
93
95
  type: PropType<string>;
package/Popup.js CHANGED
@@ -5,9 +5,9 @@
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 f=require("vue"),l=require("./util.js"),C=require("./services/alignService.js"),T=require("./services/domService.js"),E=require("./services/positionService.js"),m=require("@progress/kendo-vue-common"),D=require("./package-metadata.js"),P=100,S=1,b={left:-1e3,top:0},g="k-animation-container-shown",y="k-popup",O=f.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:l.CollisionType.fit,vertical:l.CollisionType.flip}}},anchorAlign:{type:Object,default:function(){return{horizontal:l.AlignPoint.left,vertical:l.AlignPoint.bottom}}},popupAlign:{type:Object,default:function(){return{horizontal:l.AlignPoint.left,vertical:l.AlignPoint.top}}},offset:{type:Object,default:function(){return b}},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(){return{hasMounted:!1}},watch:{show(t,i){if(i&&!t)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 s=this.$el;if(!s||!this._exitingAnimation){this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed();return}const o=s.firstChild;o?this.animateElement(o,"exit",()=>{n===this._animationGeneration&&(this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed())}):(this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed())})}else!i&&t&&(this._cancelPendingAnimations(),this._exitingAnimation=!1)}},created(){m.validatePackage(D.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._domService=new T.DOMService,this._alignService=new C.AlignService(this._domService),this._positionService=new E.PositionService(this._domService),this.reposition=l.throttle(this.reposition.bind(this),l.FRAME_DURATION)},mounted(){m.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;(t==null?void 0:t.nodeType)===1&&t.parentElement!==this.mountedAppendTo&&this.mountedAppendTo.appendChild(t)}},unmounted(){this.detachRepositionHandlers(),typeof window!="undefined"&&window.removeEventListener("mousedown",this.handleMouseDown)},beforeUnmount(){this._parentElement&&this._parentElement.appendChild(this.$el)},methods:{handleMouseDown(t){var n,s;const i=((n=t==null?void 0:t.target)==null?void 0:n.closest(".k-animation-container"))===null,e=((s=this.mountedAnchor)==null?void 0:s.contains(t==null?void 0:t.target))||!1;if(i){const o={target:this,event:t,isAnchorClicked:e};this.$emit("mousedownoutside",o),typeof window!="undefined"&&window.removeEventListener("mousedown",this.handleMouseDown)}},onOpened(){const t=this.$el;typeof window!="undefined"&&window.addEventListener("mousedown",this.handleMouseDown),this.$props.show&&t.classList.add(g),this.attachRepositionHandlers(t),this.$emit("open",{target:this})},onClosing(){this.$props.show||this.$el.classList.remove(g),this.detachRepositionHandlers(),typeof window!="undefined"&&window.removeEventListener("mousedown",this.handleMouseDown)},onClosed(){this.$emit("close",{target:this})},transitionDuration(){const t=this.$props.animate;let i=0,e=0;return t&&(t===!0?i=e=300:(i=t.openDuration||0,e=t.closeDuration||0)),{enter:i,exit:e}},_cancelPendingAnimations(){this._animationGeneration++,this._enterTimerId!==null&&(clearTimeout(this._enterTimerId),this._enterTimerId=null),this._cancelAnimation&&(this._cancelAnimation(),this._cancelAnimation=null)},animateElement(t,i,e){const n=this.transitionDuration()[i];if(n===0)return e();const s=t.ownerDocument,o=s==null?void 0:s.defaultView;if(!o)return e();const c=this.$props.direction==="down",r=this._flipped?"up":"down",a=this._flipped?"down":"up",p=c?r:a,d=`k-slide-${p}-${i}`,_=`k-slide-${p}-${i}-active`;let h=!1,u=null;const w=()=>{t.removeEventListener("transitionend",v),u&&(clearTimeout(u),u=null),t.style.transitionDuration="",t.classList.remove(d,_)},A=()=>{h||(h=!0,w(),i==="exit"?t.style.display="none":t.style.display="",this._cancelAnimation=null,e())},v=$=>{$.target===t&&A()};t.addEventListener("transitionend",v),u=setTimeout(A,n+50),t.style.transitionDuration="",t.classList.remove(d,_),i==="enter"&&(t.style.display=""),t.classList.add(d),o.requestAnimationFrame(()=>{h||(t.style.transitionDuration=n+"ms",t.classList.add(_))}),this._cancelAnimation=()=>{h||(h=!0,w(),t.style.display="")}},isAnimationInstant(t){if(this.transitionDuration()[t]===0)return!0;if(typeof window!="undefined"&&this.$el){const e=this.$el.firstChild;if(e){const n=window.getComputedStyle(e),s=parseFloat(n.transitionDuration||"0"),o=parseFloat(n.animationDuration||"0");if(s===0&&o===0)return!0}}return!1},getParentRef(t,i){let e=this.$parent;for(;!e.$refs[t];){if(e&&e.kendoAnchorRef&&i)return e.kendoAnchorRef;if(e=e.$parent,!e&&m.canUseDOM)return document.getElementById(t)||document.body}return e.$refs[t].$el||e.$refs[t]},position(t,i,e){const{anchorAlign:n,popupAlign:s,collision:o,offset:c}=t,r=e?this.mountedAnchor:document.body,a=this._alignService.alignElement({anchor:e?r:void 0,element:i,elementAlign:s,anchorAlign:n,offset:c});return this._positionService.positionElement({anchor:r,anchorAlign:n,collisions:o,element:i,currentLocation:a,elementAlign:s})},calculatePosition(t,i){if(!i||!l.isWindowAvailable()||!m.canUseDOM)return{flipped:!1,offset:t.offset};const e=m.getDefaultSlots(this),n=document.createElement("div"),s=this.$el&&this.$el.firstChild&&this.$el.firstChild.firstChild?this.$el.firstChild.firstChild.cloneNode(!0):null,o=s&&s.getBoundingClientRect?s:this._clonedElement;if(o)n.appendChild(o);else{const r=e&&e[0].props?e[0].props.class:"",a=this.$props.popupClass;n.innerHTML=`<div class="k-animation-container k-animation-container-relative">
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("vue"),a=require("./util.js"),$=require("./services/alignService.js"),E=require("./services/domService.js"),P=require("./services/positionService.js"),_=require("@progress/kendo-vue-common"),T=require("./package-metadata.js"),D=100,O=1,A={left:-1e3,top:0},S="k-animation-container-shown",y="k-popup",b={margin:"0"},k=f.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:a.CollisionType.fit,vertical:a.CollisionType.flip}}},anchorAlign:{type:Object,default:function(){return{horizontal:a.AlignPoint.left,vertical:a.AlignPoint.bottom}}},popupAlign:{type:Object,default:function(){return{horizontal:a.AlignPoint.left,vertical:a.AlignPoint.top}}},offset:{type:Object,default:function(){return A}},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(){return{hasMounted:!1,animationOpen:!1}},watch:{show(t,n){if(n&&!t)if(this._cancelPendingAnimations(),this._opened&&(this._opened=!1,this.onClosing()),this.transitionDuration().exit===0)this.onClosed();else{this._exitingAnimation=!0;const i=this._animationGeneration;this.$nextTick(()=>{if(i!==this._animationGeneration)return;const s=this.$el;if(!s||!this._exitingAnimation){this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed();return}const o=s.firstChild;o?this.animateElement(o,"exit",()=>{i===this._animationGeneration&&(this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed())}):(this._exitingAnimation=!1,this.$forceUpdate(),this.onClosed())})}else!n&&t&&(this._cancelPendingAnimations(),this._exitingAnimation=!1)}},created(){_.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._domService=new E.DOMService,this._alignService=new $.AlignService(this._domService),this._positionService=new P.PositionService(this._domService),this.reposition=a.throttle(this.reposition.bind(this),a.FRAME_DURATION)},mounted(){_.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;(t==null?void 0:t.nodeType)===1&&t.parentElement!==this.mountedAppendTo&&this.mountedAppendTo.appendChild(t)}},unmounted(){this.detachRepositionHandlers(),typeof window!="undefined"&&window.removeEventListener("mousedown",this.handleMouseDown)},beforeUnmount(){this._parentElement&&this._parentElement.appendChild(this.$el)},methods:{handleMouseDown(t){var i,s;const n=((i=t==null?void 0:t.target)==null?void 0:i.closest(".k-animation-container"))===null,e=((s=this.mountedAnchor)==null?void 0:s.contains(t==null?void 0:t.target))||!1;if(n){const o={target:this,event:t,isAnchorClicked:e};this.$emit("mousedownoutside",o),typeof window!="undefined"&&window.removeEventListener("mousedown",this.handleMouseDown)}},onOpened(){const t=this.$el;typeof window!="undefined"&&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(),typeof window!="undefined"&&window.removeEventListener("mousedown",this.handleMouseDown)},onClosed(){this.$emit("close",{target:this})},transitionDuration(){const t=this.$props.animate;let n=0,e=0;return t&&(t===!0?n=e=300:(n=t.openDuration||0,e=t.closeDuration||0)),{enter:n,exit:e}},_cancelPendingAnimations(){this._animationGeneration++,this._enterTimerId!==null&&(clearTimeout(this._enterTimerId),this._enterTimerId=null),this._cancelAnimation&&(this._cancelAnimation(),this._cancelAnimation=null)},animateElement(t,n,e){const i=this.transitionDuration()[n];if(i===0)return e();const s=t.ownerDocument,o=s==null?void 0:s.defaultView;if(!o)return e();const c=this.$props.direction==="down",r=this._flipped?"up":"down",d=this._flipped?"down":"up",l=c?r:d,h=`k-slide-${l}-${n}`,p=`k-slide-${l}-${n}-active`;let m=!1,u=null;const w=()=>{t.removeEventListener("transitionend",v),u&&(clearTimeout(u),u=null),t.style.transitionDuration="",t.classList.remove(h,p)},g=()=>{m||(m=!0,w(),n==="exit"?t.style.display="none":t.style.display="",this._cancelAnimation=null,e())},v=C=>{C.target===t&&g()};t.addEventListener("transitionend",v),u=setTimeout(g,i+50),t.style.transitionDuration="",t.classList.remove(h,p),n==="enter"&&(t.style.display=""),t.classList.add(h),o.requestAnimationFrame(()=>{m||(t.style.transitionDuration=i+"ms",t.classList.add(p))}),this._cancelAnimation=()=>{m||(m=!0,w(),t.style.display="")}},isAnimationInstant(t){if(this.transitionDuration()[t]===0)return!0;if(typeof window!="undefined"&&this.$el){const e=this.$el.firstChild;if(e){const i=window.getComputedStyle(e),s=parseFloat(i.transitionDuration||"0"),o=parseFloat(i.animationDuration||"0");if(s===0&&o===0)return!0}}return!1},getParentRef(t,n){let e=this.$parent;for(;!e.$refs[t];){if(e&&e.kendoAnchorRef&&n)return e.kendoAnchorRef;if(e=e.$parent,!e&&_.canUseDOM)return document.getElementById(t)||document.body}return e.$refs[t].$el||e.$refs[t]},position(t,n,e){const{anchorAlign:i,popupAlign:s,collision:o,offset:c}=t,r=e?this.mountedAnchor:document.body,d=this._alignService.alignElement({anchor:e?r:void 0,element:n,elementAlign:s,anchorAlign:i,offset:c});return this._positionService.positionElement({anchor:r,anchorAlign:i,collisions:o,element:n,currentLocation:d,elementAlign:s})},calculatePosition(t,n){if(!n||!a.isWindowAvailable()||!_.canUseDOM)return{flipped:!1,offset:t.offset};const e=_.getDefaultSlots(this),i=document.createElement("div"),s=this.$el&&this.$el.firstChild&&this.$el.firstChild.firstChild?this.$el.firstChild.firstChild.cloneNode(!0):null,o=s&&s.getBoundingClientRect?s:this._clonedElement;if(o)i.appendChild(o);else{const r=e&&e[0].props?e[0].props.class:"",d=this.$props.popupClass;i.innerHTML=`<div class="k-animation-container k-animation-container-relative">
9
9
  <div class="k-popup k-animation-container k-animation-container-relative">
10
- <div class="${r} ${a}" >
10
+ <div class="${r} ${d}" >
11
11
  </div>
12
12
  </div>
13
- </div>`}if(i.appendChild(n),n&&n.firstChild){const r=n.firstChild;r.style.position="absolute",r.style.visibility="hidden",r.style.display="block",r.style.left="-1000",r.style.top="0";const a=e&&e[0].props?e[0].props.style:{};if(a)for(const[p,d]of Object.entries(a))r.style[p]=d}const c=this.position(t,n.firstChild,this.$props.anchor);return n.parentNode.removeChild(n),c},attachRepositionHandlers(t){this.detachRepositionHandlers(),this._scrollableParents=this._domService.scrollableParents(this.$props.anchor?this.mountedAnchor:t),this._scrollableParents.map(i=>i.addEventListener("scroll",this.reposition)),window.addEventListener("resize",this.reposition)},detachRepositionHandlers(){this._scrollableParents&&(this._scrollableParents.map(t=>t.removeEventListener("scroll",this.reposition)),this._scrollableParents=void 0),window.removeEventListener("resize",this.reposition)},reposition(){this._clonedElement=this.$el.cloneNode(!0),this.$forceUpdate()},getCurrentZIndex(){return this.kCurrentZIndex?this.kCurrentZIndex+S:P}},render(){const{className:t,popupClass:i,show:e,id:n}=this.$props,s=m.getDefaultSlots(this),o=s,c=l.isWindowAvailable()?this.$props.appendTo?this.mountedAppendTo||this.getParentRef(this.$props.appendTo):document.body:void 0;if(this.$props.show){const a=this.calculatePosition(this.$props,c);this._offsetLeft=a.offset.left,this._offsetTop=a.offset.top,this._flipped=!!a.flipped}const r=this.getCurrentZIndex();if(!this.hasMounted)return f.createVNode("div",{style:{display:"none"},class:t},[f.createVNode("div",{class:[i,y]},[s])]);if((e||this._exitingAnimation)&&c){const a={zIndex:r,position:"absolute",top:this._offsetTop+"px",left:this._offsetLeft+"px",pointerEvents:e?"auto":"none"};if(e&&!this._opened){this._opened=!0;const d=this._animationGeneration;this.transitionDuration().enter===0?this._enterTimerId=setTimeout(()=>{this._enterTimerId=null,d===this._animationGeneration&&(!this.$props.show||!this._opened||this.onOpened())},0):this.$nextTick(()=>{if(d!==this._animationGeneration||!this.$props.show||!this._opened)return;const h=this.$el;if(!h)return;const u=h.firstChild;u?this.animateElement(u,"enter",()=>{d===this._animationGeneration&&this.$props.show&&this.onOpened()}):this.onOpened()})}const p=e?g:"";return f.createVNode("div",{id:n,class:["k-animation-container",p,t],style:a},[f.createVNode("div",{class:["k-child-animation-container"],style:{transitionDelay:"0ms",display:"block"}},[f.createVNode("div",{class:[i,y]},[o])])])}return f.createVNode("div",{style:{display:"none"},class:t},null)}});exports.Popup=O;
13
+ </div>`}if(n.appendChild(i),i&&i.firstChild){const r=i.firstChild;r.style.position="absolute",r.style.visibility="hidden",r.style.display="block",r.style.left="-1000",r.style.top="0";const d=e&&e[0].props?e[0].props.style:{};if(d)for(const[l,h]of Object.entries(d))r.style[l]=h}const c=this.position(t,i.firstChild,this.$props.anchor);return i.parentNode.removeChild(i),c},attachRepositionHandlers(t){this.detachRepositionHandlers(),this._scrollableParents=this._domService.scrollableParents(this.$props.anchor?this.mountedAnchor:t),this._scrollableParents.map(n=>n.addEventListener("scroll",this.reposition)),a.isWindowAvailable()&&window.addEventListener("resize",this.reposition)},detachRepositionHandlers(){this._scrollableParents&&(this._scrollableParents.map(t=>t.removeEventListener("scroll",this.reposition)),this._scrollableParents=void 0),a.isWindowAvailable()&&window.removeEventListener("resize",this.reposition)},reposition(){this._clonedElement=this.$el.cloneNode(!0),this.$forceUpdate()},getCurrentZIndex(){return this.kCurrentZIndex?this.kCurrentZIndex+O:D},hasCustomOffset(t){return t?t.left!==A.left||t.top!==A.top:!1}},render(){const{className:t,popupClass:n,show:e,id:i}=this.$props,s=_.getDefaultSlots(this),o=s,c=this.hasCustomOffset(this.$props.offset)?b:void 0,r=a.isWindowAvailable()?this.$props.appendTo?this.mountedAppendTo||this.getParentRef(this.$props.appendTo):document.body:void 0;if(this.$props.show){const l=this.calculatePosition(this.$props,r);this._offsetLeft=l.offset.left,this._offsetTop=l.offset.top,this._flipped=!!l.flipped}const d=this.getCurrentZIndex();if(!this.hasMounted)return f.createVNode("div",{id:i,style:{display:"none"},class:t},[f.createVNode("div",{class:[n,y],style:c},[s])]);if((e||this._exitingAnimation)&&r){const l={zIndex:d,position:"absolute",top:this._offsetTop+"px",left:this._offsetLeft+"px",pointerEvents:e?"auto":"none"};if(e&&!this._opened){this._opened=!0;const p=this._animationGeneration;this.transitionDuration().enter===0?this._enterTimerId=setTimeout(()=>{this._enterTimerId=null,p===this._animationGeneration&&(!this.$props.show||!this._opened||this.onOpened())},0):this.$nextTick(()=>{if(p!==this._animationGeneration||!this.$props.show||!this._opened)return;const u=this.$el;if(!u)return;const w=u.firstChild;w?this.animateElement(w,"enter",()=>{p===this._animationGeneration&&this.$props.show&&this.onOpened()}):this.onOpened()})}const h=this.animationOpen?S:"";return f.createVNode("div",{id:i,class:["k-animation-container","k-animation-container-relative",h,t],style:l},[f.createVNode("div",{class:["k-child-animation-container"],style:{transitionDelay:"0ms",display:"block"}},[f.createVNode("div",{class:[n,y]},[o])])])}return f.createVNode("div",{id:i,style:{display:"none"},class:t},null)}});exports.Popup=k;
package/Popup.mjs CHANGED
@@ -5,17 +5,19 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as D, createVNode as u } from "vue";
9
- import { isWindowAvailable as y, throttle as P, AlignPoint as m, CollisionType as v, FRAME_DURATION as S } from "./util.mjs";
10
- import { AlignService as b } from "./services/alignService.mjs";
8
+ import { defineComponent as P, createVNode as u } from "vue";
9
+ import { isWindowAvailable as _, throttle as D, AlignPoint as w, CollisionType as C, FRAME_DURATION as O } from "./util.mjs";
10
+ import { AlignService as S } from "./services/alignService.mjs";
11
11
  import { DOMService as k } from "./services/domService.mjs";
12
- import { PositionService as x } from "./services/positionService.mjs";
13
- import { getDefaultSlots as C, canUseDOM as _, validatePackage as O } from "@progress/kendo-vue-common";
14
- import { packageMetadata as L } from "./package-metadata.mjs";
15
- const I = 100, M = 1, R = {
12
+ import { PositionService as b } from "./services/positionService.mjs";
13
+ import { getDefaultSlots as v, canUseDOM as A, validatePackage as x } from "@progress/kendo-vue-common";
14
+ import { packageMetadata as I } from "./package-metadata.mjs";
15
+ const L = 100, R = 1, g = {
16
16
  left: -1e3,
17
17
  top: 0
18
- }, w = "k-animation-container-shown", E = "k-popup", z = /* @__PURE__ */ D({
18
+ }, M = "k-animation-container-shown", E = "k-popup", N = {
19
+ margin: "0"
20
+ }, B = /* @__PURE__ */ P({
19
21
  name: "Popup",
20
22
  props: {
21
23
  appendTo: {
@@ -33,8 +35,8 @@ const I = 100, M = 1, R = {
33
35
  type: Object,
34
36
  default: function() {
35
37
  return {
36
- horizontal: v.fit,
37
- vertical: v.flip
38
+ horizontal: C.fit,
39
+ vertical: C.flip
38
40
  };
39
41
  }
40
42
  },
@@ -42,8 +44,8 @@ const I = 100, M = 1, R = {
42
44
  type: Object,
43
45
  default: function() {
44
46
  return {
45
- horizontal: m.left,
46
- vertical: m.bottom
47
+ horizontal: w.left,
48
+ vertical: w.bottom
47
49
  };
48
50
  }
49
51
  },
@@ -51,15 +53,15 @@ const I = 100, M = 1, R = {
51
53
  type: Object,
52
54
  default: function() {
53
55
  return {
54
- horizontal: m.left,
55
- vertical: m.top
56
+ horizontal: w.left,
57
+ vertical: w.top
56
58
  };
57
59
  }
58
60
  },
59
61
  offset: {
60
62
  type: Object,
61
63
  default: function() {
62
- return R;
64
+ return g;
63
65
  }
64
66
  },
65
67
  show: {
@@ -85,19 +87,20 @@ const I = 100, M = 1, R = {
85
87
  },
86
88
  data() {
87
89
  return {
88
- hasMounted: !1
90
+ hasMounted: !1,
91
+ animationOpen: !1
89
92
  };
90
93
  },
91
94
  watch: {
92
- show(t, e) {
93
- if (e && !t)
95
+ show(t, n) {
96
+ if (n && !t)
94
97
  if (this._cancelPendingAnimations(), this._opened && (this._opened = !1, this.onClosing()), this.transitionDuration().exit === 0)
95
98
  this.onClosed();
96
99
  else {
97
100
  this._exitingAnimation = !0;
98
- const n = this._animationGeneration;
101
+ const e = this._animationGeneration;
99
102
  this.$nextTick(() => {
100
- if (n !== this._animationGeneration)
103
+ if (e !== this._animationGeneration)
101
104
  return;
102
105
  const s = this.$el;
103
106
  if (!s || !this._exitingAnimation) {
@@ -106,18 +109,18 @@ const I = 100, M = 1, R = {
106
109
  }
107
110
  const o = s.firstChild;
108
111
  o ? this.animateElement(o, "exit", () => {
109
- n === this._animationGeneration && (this._exitingAnimation = !1, this.$forceUpdate(), this.onClosed());
112
+ e === this._animationGeneration && (this._exitingAnimation = !1, this.$forceUpdate(), this.onClosed());
110
113
  }) : (this._exitingAnimation = !1, this.$forceUpdate(), this.onClosed());
111
114
  });
112
115
  }
113
- else !e && t && (this._cancelPendingAnimations(), this._exitingAnimation = !1);
116
+ else !n && t && (this._cancelPendingAnimations(), this._exitingAnimation = !1);
114
117
  }
115
118
  },
116
119
  created() {
117
- O(L), 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 k(), this._alignService = new b(this._domService), this._positionService = new x(this._domService), this.reposition = P(this.reposition.bind(this), S);
120
+ x(I), 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 k(), this._alignService = new S(this._domService), this._positionService = new b(this._domService), this.reposition = D(this.reposition.bind(this), O);
118
121
  },
119
122
  mounted() {
120
- _ && (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);
123
+ A && (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);
121
124
  },
122
125
  updated() {
123
126
  if (this.hasMounted && this.mountedAppendTo) {
@@ -133,9 +136,9 @@ const I = 100, M = 1, R = {
133
136
  },
134
137
  methods: {
135
138
  handleMouseDown(t) {
136
- var n, s;
137
- const e = ((n = t == null ? void 0 : t.target) == null ? void 0 : n.closest(".k-animation-container")) === null, i = ((s = this.mountedAnchor) == null ? void 0 : s.contains(t == null ? void 0 : t.target)) || !1;
138
- if (e) {
139
+ var e, s;
140
+ const n = ((e = t == null ? void 0 : t.target) == null ? void 0 : e.closest(".k-animation-container")) === null, i = ((s = this.mountedAnchor) == null ? void 0 : s.contains(t == null ? void 0 : t.target)) || !1;
141
+ if (n) {
139
142
  const o = {
140
143
  target: this,
141
144
  event: t,
@@ -146,12 +149,12 @@ const I = 100, M = 1, R = {
146
149
  },
147
150
  onOpened() {
148
151
  const t = this.$el;
149
- typeof window != "undefined" && window.addEventListener("mousedown", this.handleMouseDown), this.$props.show && t.classList.add(w), this.attachRepositionHandlers(t), this.$emit("open", {
152
+ typeof window != "undefined" && window.addEventListener("mousedown", this.handleMouseDown), this.$props.show && (this.animationOpen = !0), this.attachRepositionHandlers(t), this.$emit("open", {
150
153
  target: this
151
154
  });
152
155
  },
153
156
  onClosing() {
154
- this.$props.show || this.$el.classList.remove(w), this.detachRepositionHandlers(), typeof window != "undefined" && window.removeEventListener("mousedown", this.handleMouseDown);
157
+ this.$props.show || (this.animationOpen = !1), this.detachRepositionHandlers(), typeof window != "undefined" && window.removeEventListener("mousedown", this.handleMouseDown);
155
158
  },
156
159
  onClosed() {
157
160
  this.$emit("close", {
@@ -160,35 +163,35 @@ const I = 100, M = 1, R = {
160
163
  },
161
164
  transitionDuration() {
162
165
  const t = this.$props.animate;
163
- let e = 0, i = 0;
164
- return t && (t === !0 ? e = i = 300 : (e = t.openDuration || 0, i = t.closeDuration || 0)), {
165
- enter: e,
166
+ let n = 0, i = 0;
167
+ return t && (t === !0 ? n = i = 300 : (n = t.openDuration || 0, i = t.closeDuration || 0)), {
168
+ enter: n,
166
169
  exit: i
167
170
  };
168
171
  },
169
172
  _cancelPendingAnimations() {
170
173
  this._animationGeneration++, this._enterTimerId !== null && (clearTimeout(this._enterTimerId), this._enterTimerId = null), this._cancelAnimation && (this._cancelAnimation(), this._cancelAnimation = null);
171
174
  },
172
- animateElement(t, e, i) {
173
- const n = this.transitionDuration()[e];
174
- if (n === 0)
175
+ animateElement(t, n, i) {
176
+ const e = this.transitionDuration()[n];
177
+ if (e === 0)
175
178
  return i();
176
179
  const s = t.ownerDocument, o = s == null ? void 0 : s.defaultView;
177
180
  if (!o)
178
181
  return i();
179
- const d = this.$props.direction === "down", r = this._flipped ? "up" : "down", a = this._flipped ? "down" : "up", p = d ? r : a, l = `k-slide-${p}-${e}`, f = `k-slide-${p}-${e}-active`;
180
- let h = !1, c = null;
181
- const A = () => {
182
- t.removeEventListener("transitionend", $), c && (clearTimeout(c), c = null), t.style.transitionDuration = "", t.classList.remove(l, f);
183
- }, g = () => {
184
- h || (h = !0, A(), e === "exit" ? t.style.display = "none" : t.style.display = "", this._cancelAnimation = null, i());
182
+ const d = this.$props.direction === "down", r = this._flipped ? "up" : "down", l = this._flipped ? "down" : "up", a = d ? r : l, h = `k-slide-${a}-${n}`, c = `k-slide-${a}-${n}-active`;
183
+ let f = !1, p = null;
184
+ const m = () => {
185
+ t.removeEventListener("transitionend", $), p && (clearTimeout(p), p = null), t.style.transitionDuration = "", t.classList.remove(h, c);
186
+ }, y = () => {
187
+ f || (f = !0, m(), n === "exit" ? t.style.display = "none" : t.style.display = "", this._cancelAnimation = null, i());
185
188
  }, $ = (T) => {
186
- T.target === t && g();
189
+ T.target === t && y();
187
190
  };
188
- t.addEventListener("transitionend", $), c = setTimeout(g, n + 50), t.style.transitionDuration = "", t.classList.remove(l, f), e === "enter" && (t.style.display = ""), t.classList.add(l), o.requestAnimationFrame(() => {
189
- h || (t.style.transitionDuration = n + "ms", t.classList.add(f));
191
+ t.addEventListener("transitionend", $), p = setTimeout(y, e + 50), t.style.transitionDuration = "", t.classList.remove(h, c), n === "enter" && (t.style.display = ""), t.classList.add(h), o.requestAnimationFrame(() => {
192
+ f || (t.style.transitionDuration = e + "ms", t.classList.add(c));
190
193
  }), this._cancelAnimation = () => {
191
- h || (h = !0, A(), t.style.display = "");
194
+ f || (f = !0, m(), t.style.display = "");
192
195
  };
193
196
  },
194
197
  isAnimationInstant(t) {
@@ -197,111 +200,116 @@ const I = 100, M = 1, R = {
197
200
  if (typeof window != "undefined" && this.$el) {
198
201
  const i = this.$el.firstChild;
199
202
  if (i) {
200
- const n = window.getComputedStyle(i), s = parseFloat(n.transitionDuration || "0"), o = parseFloat(n.animationDuration || "0");
203
+ const e = window.getComputedStyle(i), s = parseFloat(e.transitionDuration || "0"), o = parseFloat(e.animationDuration || "0");
201
204
  if (s === 0 && o === 0)
202
205
  return !0;
203
206
  }
204
207
  }
205
208
  return !1;
206
209
  },
207
- getParentRef(t, e) {
210
+ getParentRef(t, n) {
208
211
  let i = this.$parent;
209
212
  for (; !i.$refs[t]; ) {
210
- if (i && i.kendoAnchorRef && e)
213
+ if (i && i.kendoAnchorRef && n)
211
214
  return i.kendoAnchorRef;
212
- if (i = i.$parent, !i && _)
215
+ if (i = i.$parent, !i && A)
213
216
  return document.getElementById(t) || document.body;
214
217
  }
215
218
  return i.$refs[t].$el || i.$refs[t];
216
219
  },
217
- position(t, e, i) {
220
+ position(t, n, i) {
218
221
  const {
219
- anchorAlign: n,
222
+ anchorAlign: e,
220
223
  popupAlign: s,
221
224
  collision: o,
222
225
  offset: d
223
- } = t, r = i ? this.mountedAnchor : document.body, a = this._alignService.alignElement({
226
+ } = t, r = i ? this.mountedAnchor : document.body, l = this._alignService.alignElement({
224
227
  anchor: i ? r : void 0,
225
- element: e,
228
+ element: n,
226
229
  elementAlign: s,
227
- anchorAlign: n,
230
+ anchorAlign: e,
228
231
  offset: d
229
232
  });
230
233
  return this._positionService.positionElement({
231
234
  anchor: r,
232
- anchorAlign: n,
235
+ anchorAlign: e,
233
236
  collisions: o,
234
- element: e,
235
- currentLocation: a,
237
+ element: n,
238
+ currentLocation: l,
236
239
  elementAlign: s
237
240
  });
238
241
  },
239
- calculatePosition(t, e) {
240
- if (!e || !y() || !_)
242
+ calculatePosition(t, n) {
243
+ if (!n || !_() || !A)
241
244
  return {
242
245
  flipped: !1,
243
246
  offset: t.offset
244
247
  };
245
- const i = C(this), n = document.createElement("div"), s = this.$el && this.$el.firstChild && this.$el.firstChild.firstChild ? this.$el.firstChild.firstChild.cloneNode(!0) : null, o = s && s.getBoundingClientRect ? s : this._clonedElement;
248
+ const i = v(this), e = document.createElement("div"), s = this.$el && this.$el.firstChild && this.$el.firstChild.firstChild ? this.$el.firstChild.firstChild.cloneNode(!0) : null, o = s && s.getBoundingClientRect ? s : this._clonedElement;
246
249
  if (o)
247
- n.appendChild(o);
250
+ e.appendChild(o);
248
251
  else {
249
- const r = i && i[0].props ? i[0].props.class : "", a = this.$props.popupClass;
250
- n.innerHTML = `<div class="k-animation-container k-animation-container-relative">
252
+ const r = i && i[0].props ? i[0].props.class : "", l = this.$props.popupClass;
253
+ e.innerHTML = `<div class="k-animation-container k-animation-container-relative">
251
254
  <div class="k-popup k-animation-container k-animation-container-relative">
252
- <div class="${r} ${a}" >
255
+ <div class="${r} ${l}" >
253
256
  </div>
254
257
  </div>
255
258
  </div>`;
256
259
  }
257
- if (e.appendChild(n), n && n.firstChild) {
258
- const r = n.firstChild;
260
+ if (n.appendChild(e), e && e.firstChild) {
261
+ const r = e.firstChild;
259
262
  r.style.position = "absolute", r.style.visibility = "hidden", r.style.display = "block", r.style.left = "-1000", r.style.top = "0";
260
- const a = i && i[0].props ? i[0].props.style : {};
261
- if (a)
262
- for (const [p, l] of Object.entries(a))
263
- r.style[p] = l;
263
+ const l = i && i[0].props ? i[0].props.style : {};
264
+ if (l)
265
+ for (const [a, h] of Object.entries(l))
266
+ r.style[a] = h;
264
267
  }
265
- const d = this.position(t, n.firstChild, this.$props.anchor);
266
- return n.parentNode.removeChild(n), d;
268
+ const d = this.position(t, e.firstChild, this.$props.anchor);
269
+ return e.parentNode.removeChild(e), d;
267
270
  },
268
271
  attachRepositionHandlers(t) {
269
- this.detachRepositionHandlers(), this._scrollableParents = this._domService.scrollableParents(this.$props.anchor ? this.mountedAnchor : t), this._scrollableParents.map((e) => e.addEventListener("scroll", this.reposition)), window.addEventListener("resize", this.reposition);
272
+ this.detachRepositionHandlers(), this._scrollableParents = this._domService.scrollableParents(this.$props.anchor ? this.mountedAnchor : t), this._scrollableParents.map((n) => n.addEventListener("scroll", this.reposition)), _() && window.addEventListener("resize", this.reposition);
270
273
  },
271
274
  detachRepositionHandlers() {
272
- this._scrollableParents && (this._scrollableParents.map((t) => t.removeEventListener("scroll", this.reposition)), this._scrollableParents = void 0), window.removeEventListener("resize", this.reposition);
275
+ this._scrollableParents && (this._scrollableParents.map((t) => t.removeEventListener("scroll", this.reposition)), this._scrollableParents = void 0), _() && window.removeEventListener("resize", this.reposition);
273
276
  },
274
277
  reposition() {
275
278
  this._clonedElement = this.$el.cloneNode(!0), this.$forceUpdate();
276
279
  },
277
280
  getCurrentZIndex() {
278
- return this.kCurrentZIndex ? this.kCurrentZIndex + M : I;
281
+ return this.kCurrentZIndex ? this.kCurrentZIndex + R : L;
282
+ },
283
+ hasCustomOffset(t) {
284
+ return t ? t.left !== g.left || t.top !== g.top : !1;
279
285
  }
280
286
  },
281
287
  render() {
282
288
  const {
283
289
  className: t,
284
- popupClass: e,
290
+ popupClass: n,
285
291
  show: i,
286
- id: n
287
- } = this.$props, s = C(this), o = s, d = y() ? this.$props.appendTo ? this.mountedAppendTo || this.getParentRef(this.$props.appendTo) : document.body : void 0;
292
+ id: e
293
+ } = this.$props, s = v(this), o = s, d = this.hasCustomOffset(this.$props.offset) ? N : void 0, r = _() ? this.$props.appendTo ? this.mountedAppendTo || this.getParentRef(this.$props.appendTo) : document.body : void 0;
288
294
  if (this.$props.show) {
289
- const a = this.calculatePosition(this.$props, d);
295
+ const a = this.calculatePosition(this.$props, r);
290
296
  this._offsetLeft = a.offset.left, this._offsetTop = a.offset.top, this._flipped = !!a.flipped;
291
297
  }
292
- const r = this.getCurrentZIndex();
298
+ const l = this.getCurrentZIndex();
293
299
  if (!this.hasMounted)
294
300
  return u("div", {
301
+ id: e,
295
302
  style: {
296
303
  display: "none"
297
304
  },
298
305
  class: t
299
306
  }, [u("div", {
300
- class: [e, E]
307
+ class: [n, E],
308
+ style: d
301
309
  }, [s])]);
302
- if ((i || this._exitingAnimation) && d) {
310
+ if ((i || this._exitingAnimation) && r) {
303
311
  const a = {
304
- zIndex: r,
312
+ zIndex: l,
305
313
  position: "absolute",
306
314
  top: this._offsetTop + "px",
307
315
  left: this._offsetLeft + "px",
@@ -309,24 +317,25 @@ const I = 100, M = 1, R = {
309
317
  };
310
318
  if (i && !this._opened) {
311
319
  this._opened = !0;
312
- const l = this._animationGeneration;
320
+ const c = this._animationGeneration;
313
321
  this.transitionDuration().enter === 0 ? this._enterTimerId = setTimeout(() => {
314
- this._enterTimerId = null, l === this._animationGeneration && (!this.$props.show || !this._opened || this.onOpened());
322
+ this._enterTimerId = null, c === this._animationGeneration && (!this.$props.show || !this._opened || this.onOpened());
315
323
  }, 0) : this.$nextTick(() => {
316
- if (l !== this._animationGeneration || !this.$props.show || !this._opened)
324
+ if (c !== this._animationGeneration || !this.$props.show || !this._opened)
317
325
  return;
318
- const h = this.$el;
319
- if (!h)
326
+ const p = this.$el;
327
+ if (!p)
320
328
  return;
321
- const c = h.firstChild;
322
- c ? this.animateElement(c, "enter", () => {
323
- l === this._animationGeneration && this.$props.show && this.onOpened();
329
+ const m = p.firstChild;
330
+ m ? this.animateElement(m, "enter", () => {
331
+ c === this._animationGeneration && this.$props.show && this.onOpened();
324
332
  }) : this.onOpened();
325
333
  });
326
334
  }
335
+ const h = this.animationOpen ? M : "";
327
336
  return u("div", {
328
- id: n,
329
- class: ["k-animation-container", i ? w : "", t],
337
+ id: e,
338
+ class: ["k-animation-container", "k-animation-container-relative", h, t],
330
339
  style: a
331
340
  }, [u("div", {
332
341
  class: ["k-child-animation-container"],
@@ -335,10 +344,11 @@ const I = 100, M = 1, R = {
335
344
  display: "block"
336
345
  }
337
346
  }, [u("div", {
338
- class: [e, E]
347
+ class: [n, E]
339
348
  }, [o])])]);
340
349
  }
341
350
  return u("div", {
351
+ id: e,
342
352
  style: {
343
353
  display: "none"
344
354
  },
@@ -347,5 +357,5 @@ const I = 100, M = 1, R = {
347
357
  }
348
358
  });
349
359
  export {
350
- z as Popup
360
+ B as Popup
351
361
  };
@@ -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,c=(()=>{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})(),h="fit",p="flip",u="left",f="bottom",m="top";let w=class{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 g{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||!c)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}}let v=class{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),c=o(a.offset(t),n),h=((e,t)=>t?{height:e.height,left:t.left,top:t.top,width:e.width}:e)(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(e,t){return this._dom.removeScroll(t,this._dom.scrollPosition(e))}};const _={name:"@progress/kendo-vue-popup",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:1657007252,version:"8.4.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-animation-container-shown",$="k-popup",E=t.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}),watch:{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(_),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(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 c=t-(d-l);return o=this,s=arguments,c<=0||c>t?(i&&(clearTimeout(i),i=null),l=d,r=e.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 e=this.$el;1===(null==e?void 0:e.nodeType)&&e.parentElement!==this.mountedAppendTo&&this.mountedAppendTo.appendChild(e)}},unmounted(){this.detachRepositionHandlers(),"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(){const e=this.$el;"undefined"!=typeof window&&window.addEventListener("mousedown",this.handleMouseDown),this.$props.show&&e.classList.add(C),this.attachRepositionHandlers(e),this.$emit("open",{target:this})},onClosing(){this.$props.show||this.$el.classList.remove(C),this.detachRepositionHandlers(),"undefined"!=typeof window&&window.removeEventListener("mousedown",this.handleMouseDown)},onClosed(){this.$emit("close",{target:this})},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,c=`k-slide-${d}-${t}`,h=`k-slide-${d}-${t}-active`;let p=!1,u=null;const f=()=>{e.removeEventListener("transitionend",w),u&&(clearTimeout(u),u=null),e.style.transitionDuration="",e.classList.remove(c,h)},m=()=>{p||(p=!0,f(),e.style.display="exit"===t?"none":"",this._cancelAnimation=null,n())},w=t=>{t.target===e&&m()};e.addEventListener("transitionend",w),u=setTimeout(m,i+50),e.style.transitionDuration="",e.classList.remove(c,h),"enter"===t&&(e.style.display=""),e.classList.add(c),s.requestAnimationFrame(()=>{p||(e.style.transitionDuration=i+"ms",e.classList.add(h))}),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){let n=this.$parent;for(;!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,n){const{anchorAlign:i,popupAlign:o,collision:s,offset:r}=e,l=n?this.mountedAnchor:document.body,a=this._alignService.alignElement({anchor:n?l:void 0,element:t,elementAlign:o,anchorAlign:i,offset:r});return this._positionService.positionElement({anchor:l,anchorAlign:i,collisions:s,element:t,currentLocation:a,elementAlign:o})},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=this.position(e,o.firstChild,this.$props.anchor);return o.parentNode.removeChild(o),a},attachRepositionHandlers(e){this.detachRepositionHandlers(),this._scrollableParents=this._domService.scrollableParents(this.$props.anchor?this.mountedAnchor:e),this._scrollableParents.map(e=>e.addEventListener("scroll",this.reposition)),window.addEventListener("resize",this.reposition)},detachRepositionHandlers(){this._scrollableParents&&(this._scrollableParents.map(e=>e.removeEventListener("scroll",this.reposition)),this._scrollableParents=void 0),window.removeEventListener("resize",this.reposition)},reposition(){this._clonedElement=this.$el.cloneNode(!0),this.$forceUpdate()},getCurrentZIndex(){return this.kCurrentZIndex?this.kCurrentZIndex+1:100}},render(){const{className:e,popupClass:n,show:o,id:s}=this.$props,l=i.getDefaultSlots(this),a=l,d=r()?this.$props.appendTo?this.mountedAppendTo||this.getParentRef(this.$props.appendTo):document.body:void 0;if(this.$props.show){const e=this.calculatePosition(this.$props,d);this._offsetLeft=e.offset.left,this._offsetTop=e.offset.top,this._flipped=!!e.flipped}const c=this.getCurrentZIndex();if(!this.hasMounted)return t.createVNode("div",{style:{display:"none"},class:e},[t.createVNode("div",{class:[n,$]},[l])]);if((o||this._exitingAnimation)&&d){const i={zIndex:c,position:"absolute",top:this._offsetTop+"px",left:this._offsetLeft+"px",pointerEvents:o?"auto":"none"};if(o&&!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()})}return t.createVNode("div",{id:s,class:["k-animation-container",o?C:"",e],style:i},[t.createVNode("div",{class:["k-child-animation-container"],style:{transitionDelay:"0ms",display:"block"}},[t.createVNode("div",{class:[n,$]},[a])])])}return t.createVNode("div",{style:{display:"none"},class:e},null)}});e.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:"8.4.0-develop.5",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: 1779097314,version:"8.4.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: 1779201912,version:"8.4.0-develop.5",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: 1779097314,
14
- version: "8.4.0-develop.3",
13
+ publishDate: 1779201912,
14
+ version: "8.4.0-develop.5",
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": "8.4.0-develop.3",
3
+ "version": "8.4.0-develop.5",
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": "8.4.0-develop.3",
30
- "@progress/kendo-vue-common": "8.4.0-develop.3",
29
+ "@progress/kendo-vue-animation": "8.4.0-develop.5",
30
+ "@progress/kendo-vue-common": "8.4.0-develop.5",
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": 1779097314,
48
+ "publishDate": 1779201912,
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
  },