@progress/kendo-vue-popup 8.4.0-develop.2 → 8.4.0-develop.4
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 +8 -4
- package/Popup.js +3 -3
- package/Popup.mjs +202 -109
- 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/Popup.d.ts
CHANGED
|
@@ -75,9 +75,12 @@ declare const Popup: import('vue').DefineComponent<import('vue').ExtractPropType
|
|
|
75
75
|
onClosing(): void;
|
|
76
76
|
onClosed(): void;
|
|
77
77
|
transitionDuration(): {
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
enter: number;
|
|
79
|
+
exit: number;
|
|
80
80
|
};
|
|
81
|
+
_cancelPendingAnimations(): void;
|
|
82
|
+
animateElement(element: HTMLElement, type: 'enter' | 'exit', callback: Function): any;
|
|
83
|
+
isAnimationInstant(type: 'enter' | 'exit'): boolean;
|
|
81
84
|
getParentRef(anchor: string, isAnchor?: boolean): any;
|
|
82
85
|
position(settings: PopupProps, element: HTMLElement, anchor: string): Position;
|
|
83
86
|
calculatePosition($props: any, appendToElement?: HTMLElement): Position;
|
|
@@ -85,6 +88,7 @@ declare const Popup: import('vue').DefineComponent<import('vue').ExtractPropType
|
|
|
85
88
|
detachRepositionHandlers(): void;
|
|
86
89
|
reposition(): void;
|
|
87
90
|
getCurrentZIndex(): number;
|
|
91
|
+
hasCustomOffset(offset: any): boolean;
|
|
88
92
|
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
89
93
|
appendTo: {
|
|
90
94
|
type: PropType<string>;
|
|
@@ -141,11 +145,11 @@ declare const Popup: import('vue').DefineComponent<import('vue').ExtractPropType
|
|
|
141
145
|
onClose: PropType<(event: import('./models/Events').CloseEvent) => void>;
|
|
142
146
|
onMousedownoutside: PropType<(event: MouseDownOutsideEvent) => void>;
|
|
143
147
|
}>> & Readonly<{}>, {
|
|
144
|
-
animate: boolean;
|
|
145
148
|
anchor: string;
|
|
146
|
-
direction: string;
|
|
147
149
|
anchorAlign: object;
|
|
148
150
|
offset: import('.').Offset;
|
|
151
|
+
animate: boolean;
|
|
152
|
+
direction: string;
|
|
149
153
|
appendTo: string;
|
|
150
154
|
collision: object;
|
|
151
155
|
popupAlign: object;
|
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
|
|
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">
|
|
9
9
|
<div class="k-popup k-animation-container k-animation-container-relative">
|
|
10
|
-
<div class="${
|
|
10
|
+
<div class="${r} ${d}" >
|
|
11
11
|
</div>
|
|
12
12
|
</div>
|
|
13
|
-
</div>`}if(
|
|
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;
|
package/Popup.mjs
CHANGED
|
@@ -5,21 +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
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
function T(t) {
|
|
17
|
-
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !C(t);
|
|
18
|
-
}
|
|
19
|
-
const x = 100, k = 1, N = {
|
|
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";
|
|
14
|
+
import { packageMetadata as I } from "./package-metadata.mjs";
|
|
15
|
+
const R = 100, M = 1, g = {
|
|
20
16
|
left: -1e3,
|
|
21
17
|
top: 0
|
|
22
|
-
},
|
|
18
|
+
}, y = "k-animation-container-shown", T = "k-popup", N = {
|
|
19
|
+
margin: "0"
|
|
20
|
+
}, B = /* @__PURE__ */ D({
|
|
23
21
|
name: "Popup",
|
|
24
22
|
props: {
|
|
25
23
|
appendTo: {
|
|
@@ -37,8 +35,8 @@ const x = 100, k = 1, N = {
|
|
|
37
35
|
type: Object,
|
|
38
36
|
default: function() {
|
|
39
37
|
return {
|
|
40
|
-
horizontal:
|
|
41
|
-
vertical:
|
|
38
|
+
horizontal: v.fit,
|
|
39
|
+
vertical: v.flip
|
|
42
40
|
};
|
|
43
41
|
}
|
|
44
42
|
},
|
|
@@ -46,8 +44,8 @@ const x = 100, k = 1, N = {
|
|
|
46
44
|
type: Object,
|
|
47
45
|
default: function() {
|
|
48
46
|
return {
|
|
49
|
-
horizontal:
|
|
50
|
-
vertical:
|
|
47
|
+
horizontal: w.left,
|
|
48
|
+
vertical: w.bottom
|
|
51
49
|
};
|
|
52
50
|
}
|
|
53
51
|
},
|
|
@@ -55,15 +53,15 @@ const x = 100, k = 1, N = {
|
|
|
55
53
|
type: Object,
|
|
56
54
|
default: function() {
|
|
57
55
|
return {
|
|
58
|
-
horizontal:
|
|
59
|
-
vertical:
|
|
56
|
+
horizontal: w.left,
|
|
57
|
+
vertical: w.top
|
|
60
58
|
};
|
|
61
59
|
}
|
|
62
60
|
},
|
|
63
61
|
offset: {
|
|
64
62
|
type: Object,
|
|
65
63
|
default: function() {
|
|
66
|
-
return
|
|
64
|
+
return g;
|
|
67
65
|
}
|
|
68
66
|
},
|
|
69
67
|
show: {
|
|
@@ -92,175 +90,270 @@ const x = 100, k = 1, N = {
|
|
|
92
90
|
hasMounted: !1
|
|
93
91
|
};
|
|
94
92
|
},
|
|
93
|
+
watch: {
|
|
94
|
+
show(t, n) {
|
|
95
|
+
if (n && !t)
|
|
96
|
+
if (this._cancelPendingAnimations(), this._opened && (this._opened = !1, this.onClosing()), this.transitionDuration().exit === 0)
|
|
97
|
+
this.onClosed();
|
|
98
|
+
else {
|
|
99
|
+
this._exitingAnimation = !0;
|
|
100
|
+
const e = this._animationGeneration;
|
|
101
|
+
this.$nextTick(() => {
|
|
102
|
+
if (e !== this._animationGeneration)
|
|
103
|
+
return;
|
|
104
|
+
const s = this.$el;
|
|
105
|
+
if (!s || !this._exitingAnimation) {
|
|
106
|
+
this._exitingAnimation = !1, this.$forceUpdate(), this.onClosed();
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const o = s.firstChild;
|
|
110
|
+
o ? this.animateElement(o, "exit", () => {
|
|
111
|
+
e === this._animationGeneration && (this._exitingAnimation = !1, this.$forceUpdate(), this.onClosed());
|
|
112
|
+
}) : (this._exitingAnimation = !1, this.$forceUpdate(), this.onClosed());
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
else !n && t && (this._cancelPendingAnimations(), this._exitingAnimation = !1);
|
|
116
|
+
}
|
|
117
|
+
},
|
|
95
118
|
created() {
|
|
96
|
-
|
|
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);
|
|
97
120
|
},
|
|
98
121
|
mounted() {
|
|
99
|
-
|
|
122
|
+
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);
|
|
100
123
|
},
|
|
101
124
|
updated() {
|
|
102
|
-
this.
|
|
125
|
+
if (this.hasMounted && this.mountedAppendTo) {
|
|
126
|
+
const t = this.$el;
|
|
127
|
+
(t == null ? void 0 : t.nodeType) === 1 && t.parentElement !== this.mountedAppendTo && this.mountedAppendTo.appendChild(t);
|
|
128
|
+
}
|
|
103
129
|
},
|
|
104
130
|
unmounted() {
|
|
105
|
-
this.detachRepositionHandlers(), window
|
|
131
|
+
this.detachRepositionHandlers(), typeof window != "undefined" && window.removeEventListener("mousedown", this.handleMouseDown);
|
|
106
132
|
},
|
|
107
133
|
beforeUnmount() {
|
|
108
134
|
this._parentElement && this._parentElement.appendChild(this.$el);
|
|
109
135
|
},
|
|
110
136
|
methods: {
|
|
111
137
|
handleMouseDown(t) {
|
|
112
|
-
var
|
|
113
|
-
const
|
|
114
|
-
if (
|
|
115
|
-
const
|
|
138
|
+
var e, s;
|
|
139
|
+
const n = ((e = t == null ? void 0 : t.target) == null ? void 0 : e.closest(".k-animation-container")) === null, i = ((s = this.mountedAnchor) == null ? void 0 : s.contains(t == null ? void 0 : t.target)) || !1;
|
|
140
|
+
if (n) {
|
|
141
|
+
const o = {
|
|
116
142
|
target: this,
|
|
117
143
|
event: t,
|
|
118
|
-
isAnchorClicked:
|
|
144
|
+
isAnchorClicked: i
|
|
119
145
|
};
|
|
120
|
-
this.$emit("mousedownoutside",
|
|
146
|
+
this.$emit("mousedownoutside", o), typeof window != "undefined" && window.removeEventListener("mousedown", this.handleMouseDown);
|
|
121
147
|
}
|
|
122
148
|
},
|
|
123
149
|
onOpened() {
|
|
124
150
|
const t = this.$el;
|
|
125
|
-
window
|
|
151
|
+
typeof window != "undefined" && window.addEventListener("mousedown", this.handleMouseDown), this.$props.show && t.classList.add(y), this.attachRepositionHandlers(t), this.$emit("open", {
|
|
126
152
|
target: this
|
|
127
153
|
});
|
|
128
154
|
},
|
|
129
155
|
onClosing() {
|
|
130
|
-
this.$props.show || this.$el.classList.remove(
|
|
156
|
+
this.$props.show || this.$el.classList.remove(y), this.detachRepositionHandlers(), typeof window != "undefined" && window.removeEventListener("mousedown", this.handleMouseDown);
|
|
131
157
|
},
|
|
132
158
|
onClosed() {
|
|
133
|
-
this
|
|
159
|
+
this.$emit("close", {
|
|
134
160
|
target: this
|
|
135
161
|
});
|
|
136
162
|
},
|
|
137
163
|
transitionDuration() {
|
|
138
164
|
const t = this.$props.animate;
|
|
139
|
-
let
|
|
140
|
-
return t && (t === !0 ?
|
|
141
|
-
|
|
142
|
-
|
|
165
|
+
let n = 0, i = 0;
|
|
166
|
+
return t && (t === !0 ? n = i = 300 : (n = t.openDuration || 0, i = t.closeDuration || 0)), {
|
|
167
|
+
enter: n,
|
|
168
|
+
exit: i
|
|
143
169
|
};
|
|
144
170
|
},
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
171
|
+
_cancelPendingAnimations() {
|
|
172
|
+
this._animationGeneration++, this._enterTimerId !== null && (clearTimeout(this._enterTimerId), this._enterTimerId = null), this._cancelAnimation && (this._cancelAnimation(), this._cancelAnimation = null);
|
|
173
|
+
},
|
|
174
|
+
animateElement(t, n, i) {
|
|
175
|
+
const e = this.transitionDuration()[n];
|
|
176
|
+
if (e === 0)
|
|
177
|
+
return i();
|
|
178
|
+
const s = t.ownerDocument, o = s == null ? void 0 : s.defaultView;
|
|
179
|
+
if (!o)
|
|
180
|
+
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;
|
|
183
|
+
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 && $();
|
|
189
|
+
};
|
|
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));
|
|
192
|
+
}), this._cancelAnimation = () => {
|
|
193
|
+
u || (u = !0, m(), t.style.display = "");
|
|
194
|
+
};
|
|
195
|
+
},
|
|
196
|
+
isAnimationInstant(t) {
|
|
197
|
+
if (this.transitionDuration()[t] === 0)
|
|
198
|
+
return !0;
|
|
199
|
+
if (typeof window != "undefined" && this.$el) {
|
|
200
|
+
const i = this.$el.firstChild;
|
|
201
|
+
if (i) {
|
|
202
|
+
const e = window.getComputedStyle(i), s = parseFloat(e.transitionDuration || "0"), o = parseFloat(e.animationDuration || "0");
|
|
203
|
+
if (s === 0 && o === 0)
|
|
204
|
+
return !0;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return !1;
|
|
208
|
+
},
|
|
209
|
+
getParentRef(t, n) {
|
|
210
|
+
let i = this.$parent;
|
|
211
|
+
for (; !i.$refs[t]; ) {
|
|
212
|
+
if (i && i.kendoAnchorRef && n)
|
|
213
|
+
return i.kendoAnchorRef;
|
|
214
|
+
if (i = i.$parent, !i && A)
|
|
151
215
|
return document.getElementById(t) || document.body;
|
|
152
216
|
}
|
|
153
|
-
return
|
|
217
|
+
return i.$refs[t].$el || i.$refs[t];
|
|
154
218
|
},
|
|
155
|
-
position(t,
|
|
219
|
+
position(t, n, i) {
|
|
156
220
|
const {
|
|
157
|
-
anchorAlign:
|
|
221
|
+
anchorAlign: e,
|
|
158
222
|
popupAlign: s,
|
|
159
|
-
collision:
|
|
160
|
-
offset:
|
|
161
|
-
} = t,
|
|
162
|
-
anchor:
|
|
163
|
-
element:
|
|
223
|
+
collision: o,
|
|
224
|
+
offset: d
|
|
225
|
+
} = t, r = i ? this.mountedAnchor : document.body, l = this._alignService.alignElement({
|
|
226
|
+
anchor: i ? r : void 0,
|
|
227
|
+
element: n,
|
|
164
228
|
elementAlign: s,
|
|
165
|
-
anchorAlign:
|
|
166
|
-
offset:
|
|
229
|
+
anchorAlign: e,
|
|
230
|
+
offset: d
|
|
167
231
|
});
|
|
168
232
|
return this._positionService.positionElement({
|
|
169
|
-
anchor:
|
|
170
|
-
anchorAlign:
|
|
171
|
-
collisions:
|
|
172
|
-
element:
|
|
233
|
+
anchor: r,
|
|
234
|
+
anchorAlign: e,
|
|
235
|
+
collisions: o,
|
|
236
|
+
element: n,
|
|
173
237
|
currentLocation: l,
|
|
174
238
|
elementAlign: s
|
|
175
239
|
});
|
|
176
240
|
},
|
|
177
|
-
calculatePosition(t,
|
|
178
|
-
if (!
|
|
241
|
+
calculatePosition(t, n) {
|
|
242
|
+
if (!n || !_() || !A)
|
|
179
243
|
return {
|
|
180
244
|
flipped: !1,
|
|
181
245
|
offset: t.offset
|
|
182
246
|
};
|
|
183
|
-
const
|
|
184
|
-
if (
|
|
185
|
-
|
|
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
|
+
if (o)
|
|
249
|
+
e.appendChild(o);
|
|
186
250
|
else {
|
|
187
|
-
const
|
|
188
|
-
|
|
251
|
+
const r = i && i[0].props ? i[0].props.class : "", l = this.$props.popupClass;
|
|
252
|
+
e.innerHTML = `<div class="k-animation-container k-animation-container-relative">
|
|
189
253
|
<div class="k-popup k-animation-container k-animation-container-relative">
|
|
190
|
-
<div class="${
|
|
254
|
+
<div class="${r} ${l}" >
|
|
191
255
|
</div>
|
|
192
256
|
</div>
|
|
193
257
|
</div>`;
|
|
194
258
|
}
|
|
195
|
-
if (
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
const l =
|
|
259
|
+
if (n.appendChild(e), e && e.firstChild) {
|
|
260
|
+
const r = e.firstChild;
|
|
261
|
+
r.style.position = "absolute", r.style.visibility = "hidden", r.style.display = "block", r.style.left = "-1000", r.style.top = "0";
|
|
262
|
+
const l = i && i[0].props ? i[0].props.style : {};
|
|
199
263
|
if (l)
|
|
200
|
-
for (const [
|
|
201
|
-
|
|
264
|
+
for (const [a, p] of Object.entries(l))
|
|
265
|
+
r.style[a] = p;
|
|
202
266
|
}
|
|
203
|
-
const
|
|
204
|
-
return
|
|
267
|
+
const d = this.position(t, e.firstChild, this.$props.anchor);
|
|
268
|
+
return e.parentNode.removeChild(e), d;
|
|
205
269
|
},
|
|
206
270
|
attachRepositionHandlers(t) {
|
|
207
|
-
this.detachRepositionHandlers(), this._scrollableParents = this._domService.scrollableParents(this.$props.anchor ? this.mountedAnchor : t), this._scrollableParents.map((
|
|
271
|
+
this.detachRepositionHandlers(), this._scrollableParents = this._domService.scrollableParents(this.$props.anchor ? this.mountedAnchor : t), this._scrollableParents.map((n) => n.addEventListener("scroll", this.reposition)), _() && window.addEventListener("resize", this.reposition);
|
|
208
272
|
},
|
|
209
273
|
detachRepositionHandlers() {
|
|
210
|
-
this._scrollableParents && (this._scrollableParents.map((t) => t.removeEventListener("scroll", this.reposition)), this._scrollableParents = void 0), window.removeEventListener("resize", this.reposition);
|
|
274
|
+
this._scrollableParents && (this._scrollableParents.map((t) => t.removeEventListener("scroll", this.reposition)), this._scrollableParents = void 0), _() && window.removeEventListener("resize", this.reposition);
|
|
211
275
|
},
|
|
212
276
|
reposition() {
|
|
213
277
|
this._clonedElement = this.$el.cloneNode(!0), this.$forceUpdate();
|
|
214
278
|
},
|
|
215
279
|
getCurrentZIndex() {
|
|
216
|
-
return this.kCurrentZIndex ? this.kCurrentZIndex +
|
|
280
|
+
return this.kCurrentZIndex ? this.kCurrentZIndex + M : R;
|
|
281
|
+
},
|
|
282
|
+
hasCustomOffset(t) {
|
|
283
|
+
return t ? t.left !== g.left || t.top !== g.top : !1;
|
|
217
284
|
}
|
|
218
285
|
},
|
|
219
286
|
render() {
|
|
220
287
|
const {
|
|
221
288
|
className: t,
|
|
222
|
-
popupClass:
|
|
223
|
-
show:
|
|
224
|
-
id:
|
|
225
|
-
} = this.$props, s =
|
|
289
|
+
popupClass: n,
|
|
290
|
+
show: i,
|
|
291
|
+
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;
|
|
226
293
|
if (this.$props.show) {
|
|
227
|
-
const
|
|
228
|
-
this._offsetLeft =
|
|
294
|
+
const a = this.calculatePosition(this.$props, r);
|
|
295
|
+
this._offsetLeft = a.offset.left, this._offsetTop = a.offset.top, this._flipped = !!a.flipped;
|
|
229
296
|
}
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
zIndex:
|
|
297
|
+
const l = this.getCurrentZIndex();
|
|
298
|
+
if (!this.hasMounted)
|
|
299
|
+
return f("div", {
|
|
300
|
+
id: e,
|
|
301
|
+
style: {
|
|
302
|
+
display: "none"
|
|
303
|
+
},
|
|
304
|
+
class: t
|
|
305
|
+
}, [f("div", {
|
|
306
|
+
class: [n, T],
|
|
307
|
+
style: d
|
|
308
|
+
}, [s])]);
|
|
309
|
+
if ((i || this._exitingAnimation) && r) {
|
|
310
|
+
const a = {
|
|
311
|
+
zIndex: l,
|
|
245
312
|
position: "absolute",
|
|
246
313
|
top: this._offsetTop + "px",
|
|
247
|
-
left: this._offsetLeft + "px"
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
314
|
+
left: this._offsetLeft + "px",
|
|
315
|
+
pointerEvents: i ? "auto" : "none"
|
|
316
|
+
};
|
|
317
|
+
if (i && !this._opened) {
|
|
318
|
+
this._opened = !0;
|
|
319
|
+
const h = this._animationGeneration;
|
|
320
|
+
this.transitionDuration().enter === 0 ? this._enterTimerId = setTimeout(() => {
|
|
321
|
+
this._enterTimerId = null, h === this._animationGeneration && (!this.$props.show || !this._opened || this.onOpened());
|
|
322
|
+
}, 0) : this.$nextTick(() => {
|
|
323
|
+
if (h !== this._animationGeneration || !this.$props.show || !this._opened)
|
|
324
|
+
return;
|
|
325
|
+
const c = this.$el;
|
|
326
|
+
if (!c)
|
|
327
|
+
return;
|
|
328
|
+
const m = c.firstChild;
|
|
329
|
+
m ? this.animateElement(m, "enter", () => {
|
|
330
|
+
h === this._animationGeneration && this.$props.show && this.onOpened();
|
|
331
|
+
}) : this.onOpened();
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
return f("div", {
|
|
335
|
+
id: e,
|
|
336
|
+
class: ["k-animation-container", "k-animation-container-relative", i ? y : "", t],
|
|
337
|
+
style: a
|
|
338
|
+
}, [f("div", {
|
|
339
|
+
class: ["k-child-animation-container"],
|
|
340
|
+
style: {
|
|
341
|
+
transitionDelay: "0ms",
|
|
342
|
+
display: "block"
|
|
343
|
+
}
|
|
344
|
+
}, [f("div", {
|
|
345
|
+
class: [n, T]
|
|
346
|
+
}, [o])])]);
|
|
347
|
+
}
|
|
348
|
+
return f("div", {
|
|
349
|
+
id: e,
|
|
255
350
|
style: {
|
|
256
351
|
display: "none"
|
|
257
352
|
},
|
|
258
353
|
class: t
|
|
259
|
-
},
|
|
260
|
-
class: [i, A]
|
|
261
|
-
}, [s])]);
|
|
354
|
+
}, null);
|
|
262
355
|
}
|
|
263
356
|
});
|
|
264
357
|
export {
|
|
265
|
-
|
|
358
|
+
B as Popup
|
|
266
359
|
};
|
|
@@ -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-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"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoVuePopup={},e.Vue,e.KendoVueAnimation,e.KendoPopupCommon,e.KendoVueCommon)}(this,function(e,t,n,o,i){"use strict";const s=(e,t)=>e||{height:0,left:t.left,top:t.top,width:0},r=()=>"undefined"!=typeof document&&!!document.body,l=()=>"undefined"!=typeof window,d=/auto|scroll/,a=e=>{const t=window.getComputedStyle(e);return`${t.overflow}${t.overflowX}${t.overflowY}`},c=1e3/60,p=(()=>{if(!r())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",u="flip",f="left",m="bottom",g="top";let w=class{constructor(e){this._dom=e}alignElement(e){const{anchor:t,element:n,anchorAlign:o,elementAlign:i,offset:s}=e,r=this._dom.hasOffsetParent(n)?this.relativeRect(t,n,s):this.absoluteRect(t,n,s);return this._dom.align({anchorAlign:o,anchorRect:r,elementAlign:i,elementRect:this._dom.offset(n)})}absoluteRect(e,t,n){const o=this._dom,i=((e,t)=>t?{height:e.height,left:e.left-t.left,top:e.top-t.top,width:e.width}:e)(s(o.offset(e),n),o.stackingElementOffset(t)),r=o.stackingElementScroll(t),l=o.addScroll(i,r),d=this.elementScrollPosition(e,t),a=o.removeScroll(l,d);return a.left+=window.scrollX||window.pageXOffset,a.top+=window.scrollY||window.pageYOffset,a}elementScrollPosition(e,t){return e?{x:0,y:0}:this._dom.scrollPosition(t)}relativeRect(e,t,n){return s(this._dom.position(e,t),n)}};class v{addOffset(e,t){return{left:e.left+t.left,top:e.top+t.top}}align(e){return o.align(e)}boundingOffset(e){return o.boundingOffset(e)}getWindow(){return l()?window:null}isBodyOffset(e){return o.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?o.offset(e):null}staticOffset(e){if(!e)return null;const{left:t,top:n}=e.style;e.style.left="0px",e.style.top="0px";const i=o.offset(e);return e.style.left=t,e.style.top=n,i}position(e,t){if(!e||!t)return null;const n=o.siblingContainer(e,t);return o.positionWithScroll(e,n)}relativeOffset(e,t){return o.applyLocationOffset(this.offset(e),t,this.isBodyOffset(e))}addScroll(e,t){return o.addScroll(e,t)}removeScroll(e,t){return o.removeScroll(e,t)}restrictToView(e){return o.restrictToView(e)}scrollPosition(e){return o.scrollPosition(e)}scrollableParents(e){return(e=>{const t=[];if(!r()||!l())return t;let n=e.parentElement;for(;n;)d.test(a(n))&&t.push(n),n=n.parentElement;return t.push(window),t})(e)}stackingElementOffset(e){const t=this.getRelativeContextElement(e);return t?o.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||!p)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 o.getWindowViewPort(e)}zIndex(e,t){return((e,t)=>{if(!e||!r()||!l())return null;const n=o.siblingContainer(e,t);if(!n)return null;const i=[e].concat(o.parents(e,n)).reduce((e,t)=>{const n=t.style.zIndex||window.getComputedStyle(t).zIndex,o=parseInt(n,10);return o>e?o:e},0);return i?i+1:null})(e,t)}zoomLevel(){return r()&&l()?parseFloat((document.documentElement.clientWidth/window.innerWidth).toFixed(2)):1}isZoomed(){return this.zoomLevel()>1}}class y{constructor(e){this._dom=e}positionElement(e){const{anchor:t,currentLocation:n,element:o,anchorAlign:i,elementAlign:r,collisions:l}=e,d=this._dom,a=e.viewPort||d.stackingElementViewPort(o)||d.windowViewPort(o),c=s(d.offset(t),n),p=((e,t)=>t?{height:e.height,left:t.left,top:t.top,width:e.width}:e)(d.staticOffset(o),n),h=this.elementRect(o,p),u=d.restrictToView({anchorAlign:i,anchorRect:c,collisions:l,elementAlign:r,elementRect:h,viewPort:a});return{flipped:u.flipped,offset:d.addOffset(p,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.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 E={left:-1e3,top:0},C="k-animation-container-shown",b="k-popup",$=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: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 E}},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}),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 v,this._alignService=new w(this._domService),this._positionService=new y(this._domService),this.reposition=function(e,t,n={}){let o,i,s,r,l=0;n=n||{};const d=function(){l=!1===n.leading?0:(new Date).getTime(),o=null,r=e.apply(i,s),o||(i=s=null)};return function(){const a=(new Date).getTime();!l&&!1===n.leading&&(l=a);const c=t-(a-l);return i=this,s=arguments,c<=0||c>t?(o&&(clearTimeout(o),o=null),l=a,r=e.apply(i,s),o||(i=s=null)):!o&&!1!==n.trailing&&(o=setTimeout(d,c)),r}}(this.reposition.bind(this),c)},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(),null==window||window.removeEventListener("mousedown",this.handleMouseDown)},beforeUnmount(){this._parentElement&&this._parentElement.appendChild(this.$el)},methods:{handleMouseDown(e){var t,n;const o=null===(null==(t=null==e?void 0:e.target)?void 0:t.closest(".k-animation-container")),i=(null==(n=this.mountedAnchor)?void 0:n.contains(null==e?void 0:e.target))||!1;if(o){const t={target:this,event:e,isAnchorClicked:i};this.$emit("mousedownoutside",t),null==window||window.removeEventListener("mousedown",this.handleMouseDown)}},onOpened(){const e=this.$el;null==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()},onClosed(){this._exitingAnimation&&(this._exitingAnimation=!1,this.$forceUpdate()),this.$emit("close",{target:this})},transitionDuration(){const e=this.$props.animate;let t=0,n=0;return e&&(!0===e?t=n=void 0:(t=e.openDuration,n=e.closeDuration)),{transitionEnterDuration:t,transitionExitDuration:n}},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:o,popupAlign:i,collision:s,offset:r}=e,l=n?this.mountedAnchor:document.body,d=this._alignService.alignElement({anchor:n?l:void 0,element:t,elementAlign:i,anchorAlign:o,offset:r});return this._positionService.positionElement({anchor:l,anchorAlign:o,collisions:s,element:t,currentLocation:d,elementAlign:i})},calculatePosition(e,t){if(!t||!l()||!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,r=s&&s.getBoundingClientRect?s:this._clonedElement;if(r)o.appendChild(r);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,o]of Object.entries(t))e.style[n]=o}const d=this.position(e,o.firstChild,this.$props.anchor);return o.parentNode.removeChild(o),d},attachRepositionHandlers(e){this.detachRepositionHandlers(),this._scrollableParents=this._domService.scrollableParents(this.$props.anchor?this.mountedAnchor:e),this._scrollableParents.map(e=>e.addEventListener("scroll",this.reposition)),window.addEventListener("resize",this.reposition)},detachRepositionHandlers(){this._scrollableParents&&(this._scrollableParents.map(e=>e.removeEventListener("scroll",this.reposition)),this._scrollableParents=void 0),window.removeEventListener("resize",this.reposition)},reposition(){this._clonedElement=this.$el.cloneNode(!0),this.$forceUpdate()},getCurrentZIndex(){return this.kCurrentZIndex?this.kCurrentZIndex+1:100}},render(){const{className:e,popupClass:o,show:s,id:r}=this.$props,d=i.getDefaultSlots(this),a=d,c=l()?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 p="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&&c?t.createVNode(n.Slide,{id:r,role:this.appendTo?"":"region",componentChildClassName:[o,b],className:e,onEntered:this.onOpened,onExiting:this.onClosing,onExited:this.onClosed,direction:p,style:{zIndex:f,position:"absolute",top:this._offsetTop+"px",left:this._offsetLeft+"px"},transitionEnterDuration:h,transitionExitDuration:u,appear:s},function(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}(a)?a:{default:()=>[a]}):null:t.createVNode("div",{style:{display:"none"},class:e},[t.createVNode("div",{class:[o,b]},[d])])}});e.Popup=$});
|
|
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});
|
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: 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;
|
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: "8.4.0-develop.
|
|
13
|
+
publishDate: 1779122930,
|
|
14
|
+
version: "8.4.0-develop.4",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"
|
|
16
16
|
};
|
|
17
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-vue-popup",
|
|
3
|
-
"version": "8.4.0-develop.
|
|
3
|
+
"version": "8.4.0-develop.4",
|
|
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.
|
|
30
|
-
"@progress/kendo-vue-common": "8.4.0-develop.
|
|
29
|
+
"@progress/kendo-vue-animation": "8.4.0-develop.4",
|
|
30
|
+
"@progress/kendo-vue-common": "8.4.0-develop.4",
|
|
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": 1779122930,
|
|
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
|
},
|