@progress/kendo-vue-popup 8.4.0-develop.4 → 9.0.0-develop.1

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;
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"),a=require("./util.js"),E=require("./services/alignService.js"),P=require("./services/domService.js"),T=require("./services/positionService.js"),_=require("@progress/kendo-vue-common"),D=require("./package-metadata.js"),S=100,O=1,A={left:-1e3,top:0},g="k-animation-container-shown",$="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}},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(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 P.DOMService,this._alignService=new E.AlignService(this._domService),this._positionService=new T.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&&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 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",y),u&&(clearTimeout(u),u=null),t.style.transitionDuration="",t.classList.remove(h,p)},v=()=>{m||(m=!0,w(),n==="exit"?t.style.display="none":t.style.display="",this._cancelAnimation=null,e())},y=C=>{C.target===t&&v()};t.addEventListener("transitionend",y),u=setTimeout(v,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">
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
10
  <div class="${r} ${d}" >
11
11
  </div>
12
12
  </div>
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:S},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,$],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=e?g:"";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,$]},[o])])])}return f.createVNode("div",{id:i,style:{display:"none"},class:t},null)}});exports.Popup=k;
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,19 +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 f } from "vue";
9
- import { isWindowAvailable as _, throttle as O, AlignPoint as w, CollisionType as v, FRAME_DURATION as S } from "./util.mjs";
10
- import { AlignService as k } from "./services/alignService.mjs";
11
- import { DOMService as b } from "./services/domService.mjs";
12
- import { PositionService as x } from "./services/positionService.mjs";
13
- import { getDefaultSlots as E, canUseDOM as A, validatePackage as L } from "@progress/kendo-vue-common";
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
+ import { DOMService as k } from "./services/domService.mjs";
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
14
  import { packageMetadata as I } from "./package-metadata.mjs";
15
- const R = 100, M = 1, g = {
15
+ const L = 100, R = 1, g = {
16
16
  left: -1e3,
17
17
  top: 0
18
- }, y = "k-animation-container-shown", T = "k-popup", N = {
18
+ }, M = "k-animation-container-shown", E = "k-popup", N = {
19
19
  margin: "0"
20
- }, B = /* @__PURE__ */ D({
20
+ }, B = /* @__PURE__ */ P({
21
21
  name: "Popup",
22
22
  props: {
23
23
  appendTo: {
@@ -35,8 +35,8 @@ const R = 100, M = 1, g = {
35
35
  type: Object,
36
36
  default: function() {
37
37
  return {
38
- horizontal: v.fit,
39
- vertical: v.flip
38
+ horizontal: C.fit,
39
+ vertical: C.flip
40
40
  };
41
41
  }
42
42
  },
@@ -87,7 +87,8 @@ const R = 100, M = 1, g = {
87
87
  },
88
88
  data() {
89
89
  return {
90
- hasMounted: !1
90
+ hasMounted: !1,
91
+ animationOpen: !1
91
92
  };
92
93
  },
93
94
  watch: {
@@ -116,7 +117,7 @@ const R = 100, M = 1, g = {
116
117
  }
117
118
  },
118
119
  created() {
119
- L(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 b(), this._alignService = new k(this._domService), this._positionService = new x(this._domService), this.reposition = O(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);
120
121
  },
121
122
  mounted() {
122
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);
@@ -148,12 +149,12 @@ const R = 100, M = 1, g = {
148
149
  },
149
150
  onOpened() {
150
151
  const t = this.$el;
151
- typeof window != "undefined" && window.addEventListener("mousedown", this.handleMouseDown), this.$props.show && t.classList.add(y), 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", {
152
153
  target: this
153
154
  });
154
155
  },
155
156
  onClosing() {
156
- this.$props.show || this.$el.classList.remove(y), 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);
157
158
  },
158
159
  onClosed() {
159
160
  this.$emit("close", {
@@ -178,19 +179,19 @@ const R = 100, M = 1, g = {
178
179
  const s = t.ownerDocument, o = s == null ? void 0 : s.defaultView;
179
180
  if (!o)
180
181
  return i();
181
- const d = this.$props.direction === "down", r = this._flipped ? "up" : "down", l = this._flipped ? "down" : "up", a = d ? r : l, p = `k-slide-${a}-${n}`, h = `k-slide-${a}-${n}-active`;
182
- let u = !1, c = null;
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;
183
184
  const m = () => {
184
- t.removeEventListener("transitionend", C), c && (clearTimeout(c), c = null), t.style.transitionDuration = "", t.classList.remove(p, h);
185
- }, $ = () => {
186
- u || (u = !0, m(), n === "exit" ? t.style.display = "none" : t.style.display = "", this._cancelAnimation = null, i());
187
- }, C = (P) => {
188
- P.target === t && $();
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());
188
+ }, $ = (T) => {
189
+ T.target === t && y();
189
190
  };
190
- t.addEventListener("transitionend", C), c = setTimeout($, e + 50), t.style.transitionDuration = "", t.classList.remove(p, h), n === "enter" && (t.style.display = ""), t.classList.add(p), o.requestAnimationFrame(() => {
191
- u || (t.style.transitionDuration = e + "ms", t.classList.add(h));
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));
192
193
  }), this._cancelAnimation = () => {
193
- u || (u = !0, m(), t.style.display = "");
194
+ f || (f = !0, m(), t.style.display = "");
194
195
  };
195
196
  },
196
197
  isAnimationInstant(t) {
@@ -244,7 +245,7 @@ const R = 100, M = 1, g = {
244
245
  flipped: !1,
245
246
  offset: t.offset
246
247
  };
247
- const i = E(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;
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;
248
249
  if (o)
249
250
  e.appendChild(o);
250
251
  else {
@@ -261,8 +262,8 @@ const R = 100, M = 1, g = {
261
262
  r.style.position = "absolute", r.style.visibility = "hidden", r.style.display = "block", r.style.left = "-1000", r.style.top = "0";
262
263
  const l = i && i[0].props ? i[0].props.style : {};
263
264
  if (l)
264
- for (const [a, p] of Object.entries(l))
265
- r.style[a] = p;
265
+ for (const [a, h] of Object.entries(l))
266
+ r.style[a] = h;
266
267
  }
267
268
  const d = this.position(t, e.firstChild, this.$props.anchor);
268
269
  return e.parentNode.removeChild(e), d;
@@ -277,7 +278,7 @@ const R = 100, M = 1, g = {
277
278
  this._clonedElement = this.$el.cloneNode(!0), this.$forceUpdate();
278
279
  },
279
280
  getCurrentZIndex() {
280
- return this.kCurrentZIndex ? this.kCurrentZIndex + M : R;
281
+ return this.kCurrentZIndex ? this.kCurrentZIndex + R : L;
281
282
  },
282
283
  hasCustomOffset(t) {
283
284
  return t ? t.left !== g.left || t.top !== g.top : !1;
@@ -289,21 +290,21 @@ const R = 100, M = 1, g = {
289
290
  popupClass: n,
290
291
  show: i,
291
292
  id: e
292
- } = this.$props, s = E(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;
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;
293
294
  if (this.$props.show) {
294
295
  const a = this.calculatePosition(this.$props, r);
295
296
  this._offsetLeft = a.offset.left, this._offsetTop = a.offset.top, this._flipped = !!a.flipped;
296
297
  }
297
298
  const l = this.getCurrentZIndex();
298
299
  if (!this.hasMounted)
299
- return f("div", {
300
+ return u("div", {
300
301
  id: e,
301
302
  style: {
302
303
  display: "none"
303
304
  },
304
305
  class: t
305
- }, [f("div", {
306
- class: [n, T],
306
+ }, [u("div", {
307
+ class: [n, E],
307
308
  style: d
308
309
  }, [s])]);
309
310
  if ((i || this._exitingAnimation) && r) {
@@ -316,36 +317,37 @@ const R = 100, M = 1, g = {
316
317
  };
317
318
  if (i && !this._opened) {
318
319
  this._opened = !0;
319
- const h = this._animationGeneration;
320
+ const c = this._animationGeneration;
320
321
  this.transitionDuration().enter === 0 ? this._enterTimerId = setTimeout(() => {
321
- this._enterTimerId = null, h === this._animationGeneration && (!this.$props.show || !this._opened || this.onOpened());
322
+ this._enterTimerId = null, c === this._animationGeneration && (!this.$props.show || !this._opened || this.onOpened());
322
323
  }, 0) : this.$nextTick(() => {
323
- if (h !== this._animationGeneration || !this.$props.show || !this._opened)
324
+ if (c !== this._animationGeneration || !this.$props.show || !this._opened)
324
325
  return;
325
- const c = this.$el;
326
- if (!c)
326
+ const p = this.$el;
327
+ if (!p)
327
328
  return;
328
- const m = c.firstChild;
329
+ const m = p.firstChild;
329
330
  m ? this.animateElement(m, "enter", () => {
330
- h === this._animationGeneration && this.$props.show && this.onOpened();
331
+ c === this._animationGeneration && this.$props.show && this.onOpened();
331
332
  }) : this.onOpened();
332
333
  });
333
334
  }
334
- return f("div", {
335
+ const h = this.animationOpen ? M : "";
336
+ return u("div", {
335
337
  id: e,
336
- class: ["k-animation-container", "k-animation-container-relative", i ? y : "", t],
338
+ class: ["k-animation-container", "k-animation-container-relative", h, t],
337
339
  style: a
338
- }, [f("div", {
340
+ }, [u("div", {
339
341
  class: ["k-child-animation-container"],
340
342
  style: {
341
343
  transitionDelay: "0ms",
342
344
  display: "block"
343
345
  }
344
- }, [f("div", {
345
- class: [n, T]
346
+ }, [u("div", {
347
+ class: [n, E]
346
348
  }, [o])])]);
347
349
  }
348
- return f("div", {
350
+ return u("div", {
349
351
  id: e,
350
352
  style: {
351
353
  display: "none"
@@ -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";class w{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.4",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={margin:"0"},A=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)),r()&&window.addEventListener("resize",this.reposition)},detachRepositionHandlers(){this._scrollableParents&&(this._scrollableParents.map(e=>e.removeEventListener("scroll",this.reposition)),this._scrollableParents=void 0),r()&&window.removeEventListener("resize",this.reposition)},reposition(){this._clonedElement=this.$el.cloneNode(!0),this.$forceUpdate()},getCurrentZIndex(){return this.kCurrentZIndex?this.kCurrentZIndex+1:100},hasCustomOffset:e=>!!e&&(e.left!==y.left||e.top!==y.top)},render(){const{className:e,popupClass:n,show:o,id:s}=this.$props,l=i.getDefaultSlots(this),a=l,d=this.hasCustomOffset(this.$props.offset)?E:void 0,c=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,c);this._offsetLeft=e.offset.left,this._offsetTop=e.offset.top,this._flipped=!!e.flipped}const h=this.getCurrentZIndex();if(!this.hasMounted)return t.createVNode("div",{id:s,style:{display:"none"},class:e},[t.createVNode("div",{class:[n,$],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 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","k-animation-container-relative",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",{id:s,style:{display:"none"},class:e},null)}});e.Popup=A});
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.1",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: 1779122930,version:"8.4.0-develop.4",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: 1779204776,version:"9.0.0-develop.1",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: 1779122930,
14
- version: "8.4.0-develop.4",
13
+ publishDate: 1779204776,
14
+ version: "9.0.0-develop.1",
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.4",
3
+ "version": "9.0.0-develop.1",
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.4",
30
- "@progress/kendo-vue-common": "8.4.0-develop.4",
29
+ "@progress/kendo-vue-animation": "9.0.0-develop.1",
30
+ "@progress/kendo-vue-common": "9.0.0-develop.1",
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": 1779122930,
48
+ "publishDate": 1779204776,
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
  },