@progress/kendo-vue-popup 6.4.1-develop.2 → 6.4.2-develop.3
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.mjs +6 -6
- package/dist/cdn/js/kendo-vue-popup.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +4 -4
- package/util.js +1 -1
- package/util.mjs +12 -14
package/Popup.mjs
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { defineComponent as A, createVNode as f, isVNode as C } from "vue";
|
|
9
9
|
import { Slide as E } from "@progress/kendo-vue-animation";
|
|
10
|
-
import {
|
|
10
|
+
import { isWindowAvailable as m, throttle as y, AlignPoint as h, CollisionType as _, FRAME_DURATION as S } from "./util.mjs";
|
|
11
11
|
import { AlignService as b } from "./services/alignService.mjs";
|
|
12
12
|
import { DOMService as P } from "./services/domService.mjs";
|
|
13
13
|
import { PositionService as w } from "./services/positionService.mjs";
|
|
14
|
-
import {
|
|
14
|
+
import { getDefaultSlots as g, canUseDOM as u, validatePackage as O } from "@progress/kendo-vue-common";
|
|
15
15
|
import { packageMetadata as T } from "./package-metadata.mjs";
|
|
16
16
|
function x(t) {
|
|
17
17
|
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !C(t);
|
|
@@ -37,8 +37,8 @@ const D = 100, N = 1, k = {
|
|
|
37
37
|
type: Object,
|
|
38
38
|
default: function() {
|
|
39
39
|
return {
|
|
40
|
-
horizontal:
|
|
41
|
-
vertical:
|
|
40
|
+
horizontal: _.fit,
|
|
41
|
+
vertical: _.flip
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
},
|
|
@@ -162,7 +162,7 @@ const D = 100, N = 1, k = {
|
|
|
162
162
|
});
|
|
163
163
|
},
|
|
164
164
|
calculatePosition(t, i) {
|
|
165
|
-
if (!i || !
|
|
165
|
+
if (!i || !m() || !u)
|
|
166
166
|
return {
|
|
167
167
|
flipped: !1,
|
|
168
168
|
offset: t.offset
|
|
@@ -209,7 +209,7 @@ const D = 100, N = 1, k = {
|
|
|
209
209
|
popupClass: i,
|
|
210
210
|
show: e,
|
|
211
211
|
id: n
|
|
212
|
-
} = this.$props, s = g(this), r = s, a =
|
|
212
|
+
} = this.$props, s = g(this), r = s, a = m() ? this.$props.appendTo ? this.mountedAppendTo || this.getParentRef(this.$props.appendTo) : document.body : void 0;
|
|
213
213
|
if (this.$props.show) {
|
|
214
214
|
const d = this.calculatePosition(this.$props, a);
|
|
215
215
|
this._offsetLeft = d.offset.left, this._offsetTop = d.offset.top, this._flipped = !!d.flipped;
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
13
13
|
*-------------------------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vue"),require("@progress/kendo-vue-animation"),require("@progress/kendo-popup-common"),require("@progress/kendo-vue-common")):"function"==typeof define&&define.amd?define(["exports","vue","@progress/kendo-vue-animation","@progress/kendo-popup-common","@progress/kendo-vue-common"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).KendoVuePopup={},t.Vue,t.KendoVueAnimation,t.KendoPopupCommon,t.KendoVueCommon)}(this,(function(t,e,n,o,i){"use strict";const s=(t,e)=>t||{height:0,left:e.left,top:e.top,width:0},r=()=>"undefined"!=typeof document&&!!document.body,l=()=>"undefined"!=typeof window,d=/auto|scroll/,a=t=>{const e=window.getComputedStyle(t);return`${e.overflow}${e.overflowX}${e.overflowY}`},p=1e3/60,c=(()=>{if(!r())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",u="flip",f="left",m="bottom",g="top";class v{constructor(t){this._dom=t}alignElement(t){const{anchor:e,element:n,anchorAlign:o,elementAlign:i,offset:s}=t,r=this._dom.hasOffsetParent(n)?this.relativeRect(e,n,s):this.absoluteRect(e,n,s);return this._dom.align({anchorAlign:o,anchorRect:r,elementAlign:i,elementRect:this._dom.offset(n)})}absoluteRect(t,e,n){const o=this._dom,i=((t,e)=>e?{height:t.height,left:t.left-e.left,top:t.top-e.top,width:t.width}:t)(s(o.offset(t),n),o.stackingElementOffset(e)),r=o.stackingElementScroll(e),l=o.addScroll(i,r),d=this.elementScrollPosition(t,e),a=o.removeScroll(l,d);return a.left+=window.scrollX||window.pageXOffset,a.top+=window.scrollY||window.pageYOffset,a}elementScrollPosition(t,e){return t?{x:0,y:0}:this._dom.scrollPosition(e)}relativeRect(t,e,n){return s(this._dom.position(t,e),n)}}class w{addOffset(t,e){return{left:t.left+e.left,top:t.top+e.top}}align(t){return o.align(t)}boundingOffset(t){return o.boundingOffset(t)}getWindow(){return l()?window:null}isBodyOffset(t){return o.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?o.offset(t):null}staticOffset(t){if(!t)return null;const{left:e,top:n}=t.style;t.style.left="0px",t.style.top="0px";const i=o.offset(t);return t.style.left=e,t.style.top=n,i}position(t,e){if(!t||!e)return null;const n=o.siblingContainer(t,e);return o.positionWithScroll(t,n)}relativeOffset(t,e){return o.applyLocationOffset(this.offset(t),e,this.isBodyOffset(t))}addScroll(t,e){return o.addScroll(t,e)}removeScroll(t,e){return o.removeScroll(t,e)}restrictToView(t){return o.restrictToView(t)}scrollPosition(t){return o.scrollPosition(t)}scrollableParents(t){return(t=>{const e=[];if(!r()||!l())return e;let n=t.parentElement;for(;n;)d.test(a(n))&&e.push(n),n=n.parentElement;return e.push(window),e})(t)}stackingElementOffset(t){const e=this.getRelativeContextElement(t);return e?o.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 o.getWindowViewPort(t)}zIndex(t,e){return((t,e)=>{if(!t||!r()||!l())return null;const n=o.siblingContainer(t,e);if(!n)return null;const i=[t].concat(o.parents(t,n)).reduce(((t,e)=>{const n=e.style.zIndex||window.getComputedStyle(e).zIndex,o=parseInt(n,10);return o>t?o:t}),0);return i?i+1:null})(t,e)}zoomLevel(){return r()&&l()?parseFloat((document.documentElement.clientWidth/window.innerWidth).toFixed(2)):1}isZoomed(){return this.zoomLevel()>1}}class y{constructor(t){this._dom=t}positionElement(t){const{anchor:e,currentLocation:n,element:o,anchorAlign:i,elementAlign:r,collisions:l}=t,d=this._dom,a=t.viewPort||d.stackingElementViewPort(o)||d.windowViewPort(o),p=s(d.offset(e),n),c=((t,e)=>e?{height:t.height,left:e.left,top:e.top,width:t.width}:t)(d.staticOffset(o),n),h=this.elementRect(o,c),u=d.restrictToView({anchorAlign:i,anchorRect:p,collisions:l,elementAlign:r,elementRect:h,viewPort:a});return{flipped:u.flipped,offset:d.addOffset(c,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:"6.4.1-develop.2",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"};const C={left:-1e3,top:0},E="k-animation-container-shown",b="k-popup",$=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:u}}},anchorAlign:{type:Object,default:function(){return{horizontal:f,vertical:m}}},popupAlign:{type:Object,default:function(){return{horizontal:f,vertical:g}}},offset:{type:Object,default:function(){return C}},show:{type:Boolean,default:!1},animate:{type:[Boolean,Object],default:!0},direction:{type:String,default:"down"},onOpen:Function,onClose:Function},inject:{kCurrentZIndex:{default:null}},data:()=>({hasMounted:!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._exitingAnimation=!1,this._prevShow=!1,this._prevShow=this.$props.show,this._domService=new w,this._alignService=new v(this._domService),this._positionService=new y(this._domService),this.reposition=function(t,e,n={}){let o,i,s,r,l=0;n=n||{};const d=function(){l=!1===n.leading?0:(new Date).getTime(),o=null,r=t.apply(i,s),o||(i=s=null)};return function(){const a=(new Date).getTime();!l&&!1===n.leading&&(l=a);const p=e-(a-l);return i=this,s=arguments,p<=0||p>e?(o&&(clearTimeout(o),o=null),l=a,r=t.apply(i,s),o||(i=s=null)):!o&&!1!==n.trailing&&(o=setTimeout(d,p)),r}}(this.reposition.bind(this),p)},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(){this._prevShow=this.$props.show},unmounted(){this.detachRepositionHandlers()},beforeUnmount(){this._parentElement&&this._parentElement.appendChild(this.$el)},methods:{onOpened(){const t=this.$el;this.$props.show&&t.classList.add(E),this.attachRepositionHandlers(t),this.$emit("open",{target:this})},onClosing(){this.$props.show||this.$el.classList.remove(E),this.detachRepositionHandlers()},onClosed(){this._exitingAnimation&&(this._exitingAnimation=!1,this.$forceUpdate()),this.$emit("close",{target:this})},transitionDuration(){const t=this.$props.animate;let e=0,n=0;return t&&(!0===t?e=n=void 0:(e=t.openDuration,n=t.closeDuration)),{transitionEnterDuration:e,transitionExitDuration:n}},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:o,popupAlign:i,collision:s,offset:r}=t,l=n?this.mountedAnchor:document.body,d=this._alignService.alignElement({anchor:n?l:void 0,element:e,elementAlign:i,anchorAlign:o,offset:r});return this._positionService.positionElement({anchor:l,anchorAlign:o,collisions:s,element:e,currentLocation:d,elementAlign:i})},calculatePosition(t,e){if(!e||!l()||!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,r=s&&s.getBoundingClientRect?s:this._clonedElement;if(r)o.appendChild(r);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,o]of Object.entries(e))t.style[n]=o}const d=this.position(t,o.firstChild,this.$props.anchor);return o.parentNode.removeChild(o),d},attachRepositionHandlers(t){this.detachRepositionHandlers(),this._scrollableParents=this._domService.scrollableParents(this.$props.anchor?this.mountedAnchor:t),this._scrollableParents.map((t=>t.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+1:100}},render(){const{className:t,popupClass:o,show:s,id:r}=this.$props,d=i.getDefaultSlots(this),a=d,p=l()?this.$props.appendTo?this.mountedAppendTo||this.getParentRef(this.$props.appendTo):document.body:void 0;if(this.$props.show){const t=this.calculatePosition(this.$props,p);this._offsetLeft=t.offset.left,this._offsetTop=t.offset.top,this._flipped=!!t.flipped}const c="down"===this.$props.direction?this._flipped?"up":"down":this._flipped?"down":"up",{transitionEnterDuration:h,transitionExitDuration:u}=this.transitionDuration(),f=this.getCurrentZIndex();return this._exitingAnimation=this._exitingAnimation||this._prevShow&&!s,this.hasMounted?s||this._exitingAnimation&&p?e.createVNode(n.Slide,{id:r,role:this.appendTo?"":"region",componentChildClassName:[o,b],className:t,onEntered:this.onOpened,onExiting:this.onClosing,onExited:this.onClosed,direction:c,style:{zIndex:f,position:"absolute",top:this._offsetTop+"px",left:this._offsetLeft+"px"},transitionEnterDuration:h,transitionExitDuration:u,appear:s},function(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!e.isVNode(t)}(a)?a:{default:()=>[a]}):null:e.createVNode("div",{style:{display:"none"},class:t},[e.createVNode("div",{class:[o,b]},[d])])}});t.Popup=$}));
|
|
15
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("vue"),require("@progress/kendo-vue-animation"),require("@progress/kendo-popup-common"),require("@progress/kendo-vue-common")):"function"==typeof define&&define.amd?define(["exports","vue","@progress/kendo-vue-animation","@progress/kendo-popup-common","@progress/kendo-vue-common"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).KendoVuePopup={},t.Vue,t.KendoVueAnimation,t.KendoPopupCommon,t.KendoVueCommon)}(this,(function(t,e,n,o,i){"use strict";const s=(t,e)=>t||{height:0,left:e.left,top:e.top,width:0},r=()=>"undefined"!=typeof document&&!!document.body,l=()=>"undefined"!=typeof window,d=/auto|scroll/,a=t=>{const e=window.getComputedStyle(t);return`${e.overflow}${e.overflowX}${e.overflowY}`},p=1e3/60,c=(()=>{if(!r())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",u="flip",f="left",m="bottom",g="top";class v{constructor(t){this._dom=t}alignElement(t){const{anchor:e,element:n,anchorAlign:o,elementAlign:i,offset:s}=t,r=this._dom.hasOffsetParent(n)?this.relativeRect(e,n,s):this.absoluteRect(e,n,s);return this._dom.align({anchorAlign:o,anchorRect:r,elementAlign:i,elementRect:this._dom.offset(n)})}absoluteRect(t,e,n){const o=this._dom,i=((t,e)=>e?{height:t.height,left:t.left-e.left,top:t.top-e.top,width:t.width}:t)(s(o.offset(t),n),o.stackingElementOffset(e)),r=o.stackingElementScroll(e),l=o.addScroll(i,r),d=this.elementScrollPosition(t,e),a=o.removeScroll(l,d);return a.left+=window.scrollX||window.pageXOffset,a.top+=window.scrollY||window.pageYOffset,a}elementScrollPosition(t,e){return t?{x:0,y:0}:this._dom.scrollPosition(e)}relativeRect(t,e,n){return s(this._dom.position(t,e),n)}}class w{addOffset(t,e){return{left:t.left+e.left,top:t.top+e.top}}align(t){return o.align(t)}boundingOffset(t){return o.boundingOffset(t)}getWindow(){return l()?window:null}isBodyOffset(t){return o.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?o.offset(t):null}staticOffset(t){if(!t)return null;const{left:e,top:n}=t.style;t.style.left="0px",t.style.top="0px";const i=o.offset(t);return t.style.left=e,t.style.top=n,i}position(t,e){if(!t||!e)return null;const n=o.siblingContainer(t,e);return o.positionWithScroll(t,n)}relativeOffset(t,e){return o.applyLocationOffset(this.offset(t),e,this.isBodyOffset(t))}addScroll(t,e){return o.addScroll(t,e)}removeScroll(t,e){return o.removeScroll(t,e)}restrictToView(t){return o.restrictToView(t)}scrollPosition(t){return o.scrollPosition(t)}scrollableParents(t){return(t=>{const e=[];if(!r()||!l())return e;let n=t.parentElement;for(;n;)d.test(a(n))&&e.push(n),n=n.parentElement;return e.push(window),e})(t)}stackingElementOffset(t){const e=this.getRelativeContextElement(t);return e?o.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 o.getWindowViewPort(t)}zIndex(t,e){return((t,e)=>{if(!t||!r()||!l())return null;const n=o.siblingContainer(t,e);if(!n)return null;const i=[t].concat(o.parents(t,n)).reduce(((t,e)=>{const n=e.style.zIndex||window.getComputedStyle(e).zIndex,o=parseInt(n,10);return o>t?o:t}),0);return i?i+1:null})(t,e)}zoomLevel(){return r()&&l()?parseFloat((document.documentElement.clientWidth/window.innerWidth).toFixed(2)):1}isZoomed(){return this.zoomLevel()>1}}class y{constructor(t){this._dom=t}positionElement(t){const{anchor:e,currentLocation:n,element:o,anchorAlign:i,elementAlign:r,collisions:l}=t,d=this._dom,a=t.viewPort||d.stackingElementViewPort(o)||d.windowViewPort(o),p=s(d.offset(e),n),c=((t,e)=>e?{height:t.height,left:e.left,top:e.top,width:t.width}:t)(d.staticOffset(o),n),h=this.elementRect(o,c),u=d.restrictToView({anchorAlign:i,anchorRect:p,collisions:l,elementAlign:r,elementRect:h,viewPort:a});return{flipped:u.flipped,offset:d.addOffset(c,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:"6.4.2-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"};const C={left:-1e3,top:0},E="k-animation-container-shown",b="k-popup",$=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:u}}},anchorAlign:{type:Object,default:function(){return{horizontal:f,vertical:m}}},popupAlign:{type:Object,default:function(){return{horizontal:f,vertical:g}}},offset:{type:Object,default:function(){return C}},show:{type:Boolean,default:!1},animate:{type:[Boolean,Object],default:!0},direction:{type:String,default:"down"},onOpen:Function,onClose:Function},inject:{kCurrentZIndex:{default:null}},data:()=>({hasMounted:!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._exitingAnimation=!1,this._prevShow=!1,this._prevShow=this.$props.show,this._domService=new w,this._alignService=new v(this._domService),this._positionService=new y(this._domService),this.reposition=function(t,e,n={}){let o,i,s,r,l=0;n=n||{};const d=function(){l=!1===n.leading?0:(new Date).getTime(),o=null,r=t.apply(i,s),o||(i=s=null)};return function(){const a=(new Date).getTime();!l&&!1===n.leading&&(l=a);const p=e-(a-l);return i=this,s=arguments,p<=0||p>e?(o&&(clearTimeout(o),o=null),l=a,r=t.apply(i,s),o||(i=s=null)):!o&&!1!==n.trailing&&(o=setTimeout(d,p)),r}}(this.reposition.bind(this),p)},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(){this._prevShow=this.$props.show},unmounted(){this.detachRepositionHandlers()},beforeUnmount(){this._parentElement&&this._parentElement.appendChild(this.$el)},methods:{onOpened(){const t=this.$el;this.$props.show&&t.classList.add(E),this.attachRepositionHandlers(t),this.$emit("open",{target:this})},onClosing(){this.$props.show||this.$el.classList.remove(E),this.detachRepositionHandlers()},onClosed(){this._exitingAnimation&&(this._exitingAnimation=!1,this.$forceUpdate()),this.$emit("close",{target:this})},transitionDuration(){const t=this.$props.animate;let e=0,n=0;return t&&(!0===t?e=n=void 0:(e=t.openDuration,n=t.closeDuration)),{transitionEnterDuration:e,transitionExitDuration:n}},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:o,popupAlign:i,collision:s,offset:r}=t,l=n?this.mountedAnchor:document.body,d=this._alignService.alignElement({anchor:n?l:void 0,element:e,elementAlign:i,anchorAlign:o,offset:r});return this._positionService.positionElement({anchor:l,anchorAlign:o,collisions:s,element:e,currentLocation:d,elementAlign:i})},calculatePosition(t,e){if(!e||!l()||!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,r=s&&s.getBoundingClientRect?s:this._clonedElement;if(r)o.appendChild(r);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,o]of Object.entries(e))t.style[n]=o}const d=this.position(t,o.firstChild,this.$props.anchor);return o.parentNode.removeChild(o),d},attachRepositionHandlers(t){this.detachRepositionHandlers(),this._scrollableParents=this._domService.scrollableParents(this.$props.anchor?this.mountedAnchor:t),this._scrollableParents.map((t=>t.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+1:100}},render(){const{className:t,popupClass:o,show:s,id:r}=this.$props,d=i.getDefaultSlots(this),a=d,p=l()?this.$props.appendTo?this.mountedAppendTo||this.getParentRef(this.$props.appendTo):document.body:void 0;if(this.$props.show){const t=this.calculatePosition(this.$props,p);this._offsetLeft=t.offset.left,this._offsetTop=t.offset.top,this._flipped=!!t.flipped}const c="down"===this.$props.direction?this._flipped?"up":"down":this._flipped?"down":"up",{transitionEnterDuration:h,transitionExitDuration:u}=this.transitionDuration(),f=this.getCurrentZIndex();return this._exitingAnimation=this._exitingAnimation||this._prevShow&&!s,this.hasMounted?s||this._exitingAnimation&&p?e.createVNode(n.Slide,{id:r,role:this.appendTo?"":"region",componentChildClassName:[o,b],className:t,onEntered:this.onOpened,onExiting:this.onClosing,onExited:this.onClosed,direction:c,style:{zIndex:f,position:"absolute",top:this._offsetTop+"px",left:this._offsetLeft+"px"},transitionEnterDuration:h,transitionExitDuration:u,appear:s},function(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!e.isVNode(t)}(a)?a:{default:()=>[a]}):null:e.createVNode("div",{style:{display:"none"},class:t},[e.createVNode("div",{class:[o,b]},[d])])}});t.Popup=$}));
|
package/package-metadata.js
CHANGED
|
@@ -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:
|
|
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: 1750421559,version:"6.4.2-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;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = {
|
|
|
10
10
|
productName: "Kendo UI for Vue",
|
|
11
11
|
productCode: "KENDOUIVUE",
|
|
12
12
|
productCodes: ["KENDOUIVUE"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "6.4.
|
|
13
|
+
publishDate: 1750421559,
|
|
14
|
+
version: "6.4.2-develop.3",
|
|
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": "6.4.
|
|
3
|
+
"version": "6.4.2-develop.3",
|
|
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.4.0",
|
|
29
|
-
"@progress/kendo-vue-animation": "6.4.
|
|
30
|
-
"@progress/kendo-vue-common": "6.4.
|
|
29
|
+
"@progress/kendo-vue-animation": "6.4.2-develop.3",
|
|
30
|
+
"@progress/kendo-vue-common": "6.4.2-develop.3",
|
|
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":
|
|
48
|
+
"publishDate": 1750421559,
|
|
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
|
},
|
package/util.js
CHANGED
|
@@ -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 f=require("@progress/kendo-popup-common"),g=(e,t)=>e||{height:0,left:t.left,top:t.top,width:0},w=(e,t)=>t?{height:e.height,left:t.left,top:t.top,width:e.width}:e,y=(e,t)=>t?{height:e.height,left:e.left-t.left,top:e.top-t.top,width:e.width}:e,u=()=>typeof document!="undefined"&&!!document.body,a=()=>typeof window!="undefined",p=/auto|scroll/,v=e=>{const t=window.getComputedStyle(e);return`${t.overflow}${t.overflowX}${t.overflowY}`},C=e=>{const t=[];if(!u()||!a())return t;let n=e.parentElement;for(;n;)p.test(v(n))&&t.push(n),n=n.parentElement;return t.push(window),t},E=1e3/60,h=()=>{if(!u())return!1;const e=10,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 l=t.firstChild;l.style.position="fixed",l.style.top=`${e}px`}const n=t.children[0].getBoundingClientRect().top!==e;return document.body.removeChild(t),n},T=h(),A=(e,t)=>{if(!e||!u()||!a())return null;const n=f.siblingContainer(e,t);if(!n)return null;const l=[e].concat(f.parents(e,n)).reduce((o,i)=>{const s=i.style.zIndex||window.getComputedStyle(i).zIndex,r=parseInt(s,10);return r>o?r:o},0);return l?l+1:null},b={fit:"fit",flip:"flip"},R={left:"left",
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@progress/kendo-popup-common"),g=(e,t)=>e||{height:0,left:t.left,top:t.top,width:0},w=(e,t)=>t?{height:e.height,left:t.left,top:t.top,width:e.width}:e,y=(e,t)=>t?{height:e.height,left:e.left-t.left,top:e.top-t.top,width:e.width}:e,u=()=>typeof document!="undefined"&&!!document.body,a=()=>typeof window!="undefined",p=/auto|scroll/,v=e=>{const t=window.getComputedStyle(e);return`${t.overflow}${t.overflowX}${t.overflowY}`},C=e=>{const t=[];if(!u()||!a())return t;let n=e.parentElement;for(;n;)p.test(v(n))&&t.push(n),n=n.parentElement;return t.push(window),t},E=1e3/60,h=()=>{if(!u())return!1;const e=10,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 l=t.firstChild;l.style.position="fixed",l.style.top=`${e}px`}const n=t.children[0].getBoundingClientRect().top!==e;return document.body.removeChild(t),n},T=h(),A=(e,t)=>{if(!e||!u()||!a())return null;const n=f.siblingContainer(e,t);if(!n)return null;const l=[e].concat(f.parents(e,n)).reduce((o,i)=>{const s=i.style.zIndex||window.getComputedStyle(i).zIndex,r=parseInt(s,10);return r>o?r:o},0);return l?l+1:null},b={fit:"fit",flip:"flip"},R={left:"left",bottom:"bottom",top:"top"},S=function(e,t,n={}){let l,o,i,s,r=0;n=n||{};const m=function(){r=n.leading===!1?0:new Date().getTime(),l=null,s=e.apply(o,i),l||(o=i=null)};return function(){const c=new Date().getTime();!r&&n.leading===!1&&(r=c);const d=t-(c-r);return o=this,i=arguments,d<=0||d>t?(l&&(clearTimeout(l),l=null),r=c,s=e.apply(o,i),l||(o=i=null)):!l&&n.trailing!==!1&&(l=setTimeout(m,d)),s}};exports.AlignPoint=R;exports.CollisionType=b;exports.FRAME_DURATION=E;exports.HAS_RELATIVE_STACKING_CONTEXT=T;exports.OVERFLOW_REGEXP=p;exports.eitherRect=g;exports.hasRelativeStackingContext=h;exports.isDocumentAvailable=u;exports.isWindowAvailable=a;exports.removeStackingOffset=y;exports.replaceOffset=w;exports.scrollableParents=C;exports.throttle=S;exports.zIndex=A;
|
package/util.mjs
CHANGED
|
@@ -21,19 +21,19 @@ const C = (e, t) => e || {
|
|
|
21
21
|
left: e.left - t.left,
|
|
22
22
|
top: e.top - t.top,
|
|
23
23
|
width: e.width
|
|
24
|
-
} : e,
|
|
24
|
+
} : e, f = () => typeof document != "undefined" && !!document.body, c = () => typeof window != "undefined", m = /auto|scroll/, w = (e) => {
|
|
25
25
|
const t = window.getComputedStyle(e);
|
|
26
26
|
return `${t.overflow}${t.overflowX}${t.overflowY}`;
|
|
27
27
|
}, b = (e) => {
|
|
28
28
|
const t = [];
|
|
29
|
-
if (!
|
|
29
|
+
if (!f() || !c())
|
|
30
30
|
return t;
|
|
31
31
|
let n = e.parentElement;
|
|
32
32
|
for (; n; )
|
|
33
|
-
m.test(
|
|
33
|
+
m.test(w(n)) && t.push(n), n = n.parentElement;
|
|
34
34
|
return t.push(window), t;
|
|
35
|
-
}, x = 1e3 / 60,
|
|
36
|
-
if (!
|
|
35
|
+
}, x = 1e3 / 60, g = () => {
|
|
36
|
+
if (!f())
|
|
37
37
|
return !1;
|
|
38
38
|
const e = 10, t = document.createElement("div");
|
|
39
39
|
if (t.style.transform = "matrix(10, 0, 0, 10, 0, 0)", t.innerHTML = "<div>child</div>", document.body.appendChild(t), t && t.firstChild) {
|
|
@@ -42,8 +42,8 @@ const C = (e, t) => e || {
|
|
|
42
42
|
}
|
|
43
43
|
const n = t.children[0].getBoundingClientRect().top !== e;
|
|
44
44
|
return document.body.removeChild(t), n;
|
|
45
|
-
}, A =
|
|
46
|
-
if (!e || !
|
|
45
|
+
}, A = g(), I = (e, t) => {
|
|
46
|
+
if (!e || !f() || !c())
|
|
47
47
|
return null;
|
|
48
48
|
const n = p(e, t);
|
|
49
49
|
if (!n)
|
|
@@ -58,8 +58,6 @@ const C = (e, t) => e || {
|
|
|
58
58
|
flip: "flip"
|
|
59
59
|
}, S = {
|
|
60
60
|
left: "left",
|
|
61
|
-
center: "center",
|
|
62
|
-
right: "right",
|
|
63
61
|
bottom: "bottom",
|
|
64
62
|
top: "top"
|
|
65
63
|
}, D = function(e, t, n = {}) {
|
|
@@ -71,8 +69,8 @@ const C = (e, t) => e || {
|
|
|
71
69
|
return function() {
|
|
72
70
|
const u = (/* @__PURE__ */ new Date()).getTime();
|
|
73
71
|
!r && n.leading === !1 && (r = u);
|
|
74
|
-
const
|
|
75
|
-
return o = this, i = arguments,
|
|
72
|
+
const d = t - (u - r);
|
|
73
|
+
return o = this, i = arguments, d <= 0 || d > t ? (l && (clearTimeout(l), l = null), r = u, s = e.apply(o, i), l || (o = i = null)) : !l && n.trailing !== !1 && (l = setTimeout(a, d)), s;
|
|
76
74
|
};
|
|
77
75
|
};
|
|
78
76
|
export {
|
|
@@ -82,9 +80,9 @@ export {
|
|
|
82
80
|
A as HAS_RELATIVE_STACKING_CONTEXT,
|
|
83
81
|
m as OVERFLOW_REGEXP,
|
|
84
82
|
C as eitherRect,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
g as hasRelativeStackingContext,
|
|
84
|
+
f as isDocumentAvailable,
|
|
85
|
+
c as isWindowAvailable,
|
|
88
86
|
T as removeStackingOffset,
|
|
89
87
|
E as replaceOffset,
|
|
90
88
|
b as scrollableParents,
|