@progress/kendo-vue-tooltip 3.5.0 → 3.5.1-dev.202208100944
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/README.md +2 -2
- package/dist/cdn/js/kendo-vue-tooltip.js +1 -1
- package/dist/es/TooltipProps.js +1 -0
- package/dist/es/events.js +1 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/esm/Tooltip.d.ts +52 -0
- package/dist/esm/Tooltip.js +438 -0
- package/dist/esm/TooltipProps.d.ts +100 -0
- package/dist/esm/TooltipProps.js +2 -0
- package/dist/esm/additionalTypes.ts +21 -0
- package/dist/esm/events.d.ts +30 -0
- package/dist/esm/events.js +1 -0
- package/dist/esm/main.d.ts +5 -0
- package/dist/esm/main.js +2 -0
- package/dist/esm/package-metadata.d.ts +5 -0
- package/dist/esm/package-metadata.js +11 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/utils.d.ts +24 -0
- package/dist/esm/utils.js +95 -0
- package/dist/npm/Tooltip.js +12 -12
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/utils.js +13 -8
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
> **Important**
|
|
8
8
|
> * This package is а part of [Kendo UI for Vue](https://www.telerik.com/kendo-vue-ui/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-tooltip)—a commercial UI library.
|
|
9
9
|
> * You will need to install a license key when adding the package to your project. For more information, please refer to the [Kendo UI for Vue My License page](https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-tooltip).
|
|
10
|
-
> * To receive a license key, you need to either [purchase a license](https://www.telerik.com/kendo-
|
|
10
|
+
> * To receive a license key, you need to either [purchase a license](https://www.telerik.com/purchase/kendo-ui/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-tooltip) or register for a [free trial](https://www.telerik.com/download-login-v2-kendo-vue-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-tooltip). Doing so indicates that you [accept the Kendo UI for Vue License Agreement](https://www.telerik.com/purchase/license-agreement/progress-kendovue?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-tooltip).
|
|
11
11
|
> * The 30-day free trial gives you access to all the Kendo UI for Vue components and their full functionality. Additionally, for the period of your license, you get access to our legendary technical support provided directly by the Kendo UI for Vue dev team!
|
|
12
12
|
>
|
|
13
13
|
> [Start using Kendo UI for Vue](https://www.telerik.com/download-login-v2-kendo-vue-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-tooltip) and speed up your development process!
|
|
@@ -42,7 +42,7 @@ For any issues you might encounter while working with the Kendo UI for Vue Toolt
|
|
|
42
42
|
* [Kendo UI for Vue Roadmap](https://www.telerik.com/support/whats-new/kendo-vue-ui/roadmap/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-tooltip)
|
|
43
43
|
* [Blogs](https://www.telerik.com/blogs/tag/kendo?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-tooltip)
|
|
44
44
|
* [Demos, documentation, and component reference](https://www.telerik.com/kendo-vue-ui/components/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-tooltip)
|
|
45
|
-
* [Kendo UI for Vue pricing and licensing](https://www.telerik.com/kendo-
|
|
45
|
+
* [Kendo UI for Vue pricing and licensing](https://www.telerik.com/purchase/kendo-ui/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-tooltip)
|
|
46
46
|
|
|
47
47
|
*Copyright © 2022 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.*
|
|
48
48
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue"),require("@progress/kendo-licensing")):"function"==typeof define&&define.amd?define(["vue","@progress/kendo-licensing"],e):"object"==typeof exports?exports.KendoVueTooltip=e(require("vue"),require("@progress/kendo-licensing")):t.KendoVueTooltip=e(t.Vue,t.KendoLicensing)}(window,(function(t,e){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TooltipVue2=e.Tooltip=void 0;var o=n(3);Object.defineProperty(e,"Tooltip",{enumerable:!0,get:function(){return o.Tooltip}}),Object.defineProperty(e,"TooltipVue2",{enumerable:!0,get:function(){return o.TooltipVue2}})},function(t,e,n){"use strict";var o=function(){return(o=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=Object.create?function(t,e,n,o){void 0===o&&(o=n),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]},r=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.hasOwnProperty.call(t,n)&&i(e,t,n);return r(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.TooltipVue2=e.Tooltip=void 0;var u=s(n(0)),l=u.h,a=u.version&&"3"===u.version[0],c=n(6),p=n(4),d=n(5),f={name:"KendoTooltip",inheritAttrs:!1,props:{showCallout:{type:Boolean,default:!0},setCalloutOnPositionAuto:{type:String,default:void 0},anchorElement:{type:String,default:"pointer",validator:function(t){return["pointer","target"].includes(t)}},content:[String,Object,Function],filter:Function,openDelay:{type:Number,default:400},open:{type:Boolean,default:void 0},position:{type:String,default:"auto",validator:function(t){return["right","left","top","bottom","auto"].includes(t)}},updatePosition:{type:Function,default:void 0},updateInterval:Number,className:String,wrapperStyle:Object,tooltipClassName:String,tooltipStyle:Object,targetElement:[Object,HTMLAnchorElement],parentTitle:{type:Boolean,default:!1}},data:function(){return{top:0,left:0,currentTargetElement:null,currentOpen:!1,title:""}},computed:{wrapperClass:function(){var t;return(t={"k-animation-container":!0,"k-animation-container-fixed":!0,"k-animation-container-shown":!0})[this.$props.className]=!0,t},computedTarget:function(){return void 0!==this.targetElement?this.targetElement:this.currentTargetElement},computedOpen:function(){return void 0!==this.open?this.open:this.currentOpen}},inject:{kCurrentZIndex:{default:null}},created:function(){c.validatePackage(d.packageMetadata),this.top=0,this.left=0,this.willOpen=!1},mounted:function(){this.element=c.getRef(this,"element"),document&&document.body.addEventListener("mousemove",this.handleBodyMousemove)},destroyed:a?void 0:function(){this.destroyElement()},unmounted:function(){this.destroyElement()},updated:function(){if(this.$props.open&&this.$props.targetElement&&this.showToolTip({target:this.$props.targetElement}),this.element=c.getRef(this,"element"),this.element){if(this.resetPosition(),this.computedTarget){var t=this.$props.appendTo?this.$props.appendTo:this.computedTarget.ownerDocument.body;this.element.parentElement!==t&&this.computedTarget.ownerDocument.body.append(this.element)}this.callout=this.v3?this.calloutRef:this.$refs.callout,this.callout&&(this.callout.className=this.calloutClassName(),"auto"===this.$props.position&&(this.left<window.screen.availWidth/2?this.callout.style.left=this.$props.setCalloutOnPositionAuto||"25%":this.callout.style.left=this.$props.setCalloutOnPositionAuto||"75%"))}},setup:a?function(){return{v3:!!a}}:void 0,render:function(t){var e=l||t,n=c.getDefaultSlots(this),i=this.getCurrentZIndex(),r=this.$props.content?c.templateRendering.call(this,this.$props.content,c.getListeners.call(this)):void 0,s=this.title,u=c.getTemplate.call(this,{h:e,template:r,defaultRendering:s,additionalProps:{title:this.title,target:this.computedTarget}}),a=this.computedOpen&&e("div",{class:c.classNames("k-tooltip",this.$props.tooltipClassName),style:o({position:"relative"},this.$props.tooltipStyle)},[e("div",{class:"k-tooltip-content"},[u]),this.$props.showCallout&&e("div",{ref:c.setRef(this,"callout")})]),p=this.computedTarget&&this.title&&this.computedTarget.ownerDocument&&e("div",{ref:c.setRef(this,"element"),class:this.wrapperClass,style:o({zIndex:i},this.$props.wrapperStyle),tabindex:0,attrs:this.v3?void 0:{tabindex:0}},[a]);return n?e("div",{onMouseover:this.handleMouseOver,on:this.v3?void 0:{mouseover:this.handleMouseOver,mouseout:this.handleMouseOut},onMouseout:this.handleMouseOut},[p,n]):p},methods:{destroyElement:function(){clearTimeout(this.openTimeoutId),clearInterval(this.updateIntervalId),document&&document.body.removeEventListener("mousemove",this.handleBodyMousemove),this.element&&this.element.remove()},handleMouseOut:function(t){var e=this.computedTarget?this.computedTarget.ownerDocument:document,n=e&&e.elementFromPoint(t.clientX,t.clientY);this.willOpen=!1,p.isTooltipElement(n)||this.computedTarget!==t.target||this.$props.open||(clearInterval(this.updateIntervalId),this.onClose(t))},handleMouseOver:function(t){var e=t.target;this.isVisible(e)&&!p.isTooltipElement(e)&&e!==this.computedTarget&&this.showToolTip(t)},handleBodyMousemove:function(t){this.top=t.clientY,this.left=t.clientX},onClose:function(t){this.$emit("close",{event:t,component:this}),this.currentTargetElement=null,this.currentOpen=!1,this.title=""},showToolTip:function(t){var e=this;clearTimeout(this.openTimeoutId),clearInterval(this.updateIntervalId),t.target.hasChildNodes()&&t.target.childNodes.forEach((function(e){"title"===e.nodeName&&(t.target.titleExpando=e.innerHTML,e.remove())}));var n=this.computedTarget||t.target,o=this.getTitle(n);o.title?(o.element&&(o.element.titleExpando=o.title,o.element.title=""),this.willOpen=!0,this.$props.openDelay?this.openTimeoutId=window.setTimeout((function(){e.willOpen&&(e.currentTargetElement=n,e.currentOpen=!0,e.title=o.title,e.setUpdateInterval())}),this.$props.openDelay):(this.currentTargetElement=n,this.currentOpen=!0,this.title=o.title,this.setUpdateInterval()),this.title!==o.title&&this.$emit("open",{event:t,compoponent:this})):this.computedOpen&&this.onClose(t)},setUpdateInterval:function(){this.$props.updateInterval&&(this.updateIntervalId=setInterval(this.onIntervalUpdate,this.$props.updateInterval))},onIntervalUpdate:function(){var t=this.computedTarget;t&&(null===t.parentElement?this.onClose({target:t}):this.showToolTip({target:t}))},resetPosition:function(){if(this.element){var t=void 0;t=this.$props.updatePosition?this.$props.updatePosition({element:this.element,targetElement:this.computedTarget,mouseTop:this.top,mouseLeft:this.left,anchorElement:this.$props.anchorElement,position:this.$props.position,target:this}):this.setPosition(this.element),this.element.style.left=t.left+"px",this.element.style.top=t.top+"px"}},isVisible:function(t){return!this.$props.filter||this.$props.filter(t)},setPosition:function(t){var e=this.parentTitle?this.getTitle(this.computedTarget).element:this.computedTarget,n=p.getDomRect(e);return{left:p.getLeftPosition(this.left,t.offsetWidth,n,this.$props.anchorElement,this.$props.position),top:p.getTopPosition(this.top,n,t.offsetHeight,this.$props.anchorElement,this.$props.position)}},getTitle:function(t){for(;t;){if(null!==t.getAttribute("title")||t.titleExpando)return{title:t.getAttribute("title")||t.titleExpando,element:t};t=this.$props.parentTitle&&t.parentElement||null}return{title:"",element:t}},calloutClassName:function(){switch(this.$props.position){case"bottom":return"k-callout k-callout-n";case"left":return"k-callout k-callout-e";case"right":return"k-callout k-callout-w";case"top":return"k-callout k-callout-s";default:return this.top<window.innerHeight/2?"k-callout k-callout-n":"k-callout k-callout-s"}},getCurrentZIndex:function(){return this.kCurrentZIndex?this.kCurrentZIndex:100}}};e.TooltipVue2=f;var h=f;e.Tooltip=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isTooltipElement=e.toolTipSelectors=e.getDomRect=e.getTopPosition=e.getLeftPosition=void 0;e.getLeftPosition=function(t,e,n,o,i){switch(i){case"bottom":return"pointer"===o?t-e/2:n.left-e/2+n.width/2;case"left":return"pointer"===o?t-e-10:n.left-e-10;case"right":return"pointer"===o?t+10:n.right+10;case"top":return"pointer"===o?t-e/2:n.left-e/2+n.width/2;default:return"pointer"===o?t<window.screen.availWidth/2?t-10:t-e+10:t<window.screen.availWidth/2?n.left:n.right-e}},e.getTopPosition=function(t,e,n,o,i){switch(i){case"bottom":return"pointer"===o?t+10:e.bottom+10;case"left":case"right":return"pointer"===o?t-n/2:e.top-n/2+e.height/2;case"top":return"pointer"===o?t-n-10:e.top-n-10;default:return"pointer"===o?t<window.innerHeight/2?t+10:t-n-10:t<window.innerHeight/2?e.bottom+10:e.top-n-10}},e.getDomRect=function(t){return null!==t?t.getBoundingClientRect():document.body.getBoundingClientRect()},e.toolTipSelectors=["k-tooltip-content","k-animation-container","k-tooltip","k-tooltip-title","k-tooltip k-tooltip-closable","k-icon k-i-close"],e.isTooltipElement=function(t){if(null===t)return!1;for(var n=t;n;){if(null!==n&&n.classList&&n.classList.contains("k-tooltip"))return!0;n=null!==n.parentNode&&n.parentNode}return e.toolTipSelectors.filter((function(e){return e===t.className})).length>0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.packageMetadata=void 0,e.packageMetadata={name:"@progress/kendo-vue-tooltip",productName:"Kendo UI for Vue",productCodes:["KENDOUIVUE","KENDOUICOMPLETE"],publishDate:1659429296,version:"",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"}},function(t,e,n){"use strict";n.r(e),n.d(e,"getRef",(function(){return l})),n.d(e,"setRef",(function(){return a})),n.d(e,"classNames",(function(){return i})),n.d(e,"guid",(function(){return r})),n.d(e,"Keys",(function(){return s})),n.d(e,"noop",(function(){return R})),n.d(e,"isObject",(function(){return o})),n.d(e,"getListeners",(function(){return Y})),n.d(e,"hasListener",(function(){return X})),n.d(e,"canUseDOM",(function(){return u})),n.d(e,"firstFocusableChild",(function(){return p})),n.d(e,"focusFirstFocusableChild",(function(){return f})),n.d(e,"lastFocusableChild",(function(){return d})),n.d(e,"focusLastFocusableChild",(function(){return h})),n.d(e,"focusContainer",(function(){return m})),n.d(e,"clone",(function(){return D})),n.d(e,"Draggable",(function(){return I})),n.d(e,"cloneArray",(function(){return H})),n.d(e,"cloneValue",(function(){return N})),n.d(e,"cloneObject",(function(){return L})),n.d(e,"cloneDate",(function(){return x})),n.d(e,"getTemplate",(function(){return G})),n.d(e,"templateRendering",(function(){return z})),n.d(e,"templateDefinition",(function(){return Z})),n.d(e,"getTabIndex",(function(){return Q})),n.d(e,"getDefaultSlots",(function(){return C})),n.d(e,"isRtl",(function(){return tt})),n.d(e,"getDir",(function(){return et})),n.d(e,"getter",(function(){return F})),n.d(e,"setter",(function(){return V})),n.d(e,"validatePackage",(function(){return ot})),n.d(e,"kendoThemeMaps",(function(){return it}));var o=function(t){return"object"==typeof t},i=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.filter((function(t){return!0!==t&&!!t})).map((function(t){return Array.isArray(t)?i.apply(void 0,t):o(t)?Object.keys(t).map((function(e,n){return t[n]||t[e]&&e||null})).filter((function(t){return null!==t})).join(" "):t})).filter((function(t){return!!t})).join(" ")},r=function(){var t,e,n="";for(t=0;t<32;t++)e=16*Math.random()|0,8!==t&&12!==t&&16!==t&&20!==t||(n+="-"),n+=(12===t?4:16===t?3&e|8:e).toString(16);return n},s={backspace:8,tab:9,enter:13,shift:16,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,delete:46},u=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement);function l(t,e,n){return t.v3?t[e+"Ref"]:t.$refs[""+(n||e)]}function a(t,e,n){return t.v3?function(n){t[e+"Ref"]=n}:n||e}var c='input, [tabindex]:not([tabindex="-1"])',p=function(t){if(t){var e=t.querySelectorAll(c);if(e.length&&e[0].focus)return e[0]}},d=function(t){if(t){var e=t.querySelectorAll(c);if(e.length&&e[e.length-1].focus)return e[e.length-1]}},f=function(t){if(t){var e=t.querySelectorAll(c);e.length&&e[0].focus&&e[0].focus()}},h=function(t){if(t){var e=t.querySelectorAll(c);e.length&&e[e.length-1].focus&&e[e.length-1].focus()}},m=function(t,e){var n=!0;if(t.keyCode!==s.enter&&t.target===e)return!1;if(t.keyCode===s.enter&&t.target===e)n=!0,setTimeout((function(){f(e)}),1);else if(t.keyCode===s.esc)n=!1,e.focus();else if(t.keyCode===s.tab){var o=p(e),i=d(e);i&&!t.shiftKey&&t.target===i&&(t.preventDefault(),o.focus()),o&&t.shiftKey&&t.target===o&&(t.preventDefault(),i.focus())}return n},v=n(0),g=function(t,e){return function(n){return e(t(n))}},y=function(t,e,n){return t.addEventListener&&t.addEventListener(e,n)},b=function(t,e,n){return t&&t.removeEventListener&&t.removeEventListener(e,n)},_=function(){},T=function(t){return t.preventDefault()},w=/touch/;function O(t){return t.type.match(w)?{pageX:t.changedTouches[0].pageX,pageY:t.changedTouches[0].pageY,clientX:t.changedTouches[0].clientX,clientY:t.changedTouches[0].clientY,type:t.type,originalEvent:t,isTouch:!0}:{pageX:t.pageX,pageY:t.pageY,clientX:t.clientX,clientY:t.clientY,offsetX:t.offsetX,offsetY:t.offsetY,type:t.type,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,originalEvent:t}}var k=function(t){var e=this,n=t.press;void 0===n&&(n=_);var o=t.drag;void 0===o&&(o=_);var i=t.release;void 0===i&&(i=_);var r=t.mouseOnly;void 0===r&&(r=!1),this._pressHandler=g(O,n),this._dragHandler=g(O,o),this._releaseHandler=g(O,i),this._ignoreMouse=!1,this._mouseOnly=r,this._touchstart=function(t){1===t.touches.length&&e._pressHandler(t)},this._touchmove=function(t){1===t.touches.length&&e._dragHandler(t)},this._touchend=function(t){0===t.touches.length&&1===t.changedTouches.length&&(e._releaseHandler(t),e._ignoreMouse=!0,setTimeout(e._restoreMouse,2e3))},this._restoreMouse=function(){e._ignoreMouse=!1},this._mousedown=function(t){var n=t.which;n&&n>1||e._ignoreMouse||(y(e.document,"mousemove",e._mousemove),y(e.document,"mouseup",e._mouseup),e._pressHandler(t))},this._mousemove=function(t){e._dragHandler(t)},this._mouseup=function(t){b(e.document,"mousemove",e._mousemove),b(e.document,"mouseup",e._mouseup),e._releaseHandler(t)},this._pointerdown=function(t){t.isPrimary&&0===t.button&&(y(e.document,"pointermove",e._pointermove),y(e.document,"pointerup",e._pointerup),y(e.document,"pointercancel",e._pointerup),y(e.document,"contextmenu",T),e._pressHandler(t))},this._pointermove=function(t){t.isPrimary&&e._dragHandler(t)},this._pointerup=function(t){t.isPrimary&&(b(e.document,"pointermove",e._pointermove),b(e.document,"pointerup",e._pointerup),b(e.document,"pointercancel",e._pointerup),b(e.document,"contextmenu",T),e._releaseHandler(t))}},$={document:{configurable:!0}};k.supportPointerEvent=function(){return"undefined"!=typeof window&&window.PointerEvent},$.document.get=function(){return this._element?this._element.ownerDocument:document},k.prototype.bindTo=function(t){t!==this._element&&(this._element&&this._unbindFromCurrent(),this._element=t,this._bindToCurrent())},k.prototype._bindToCurrent=function(){var t=this._element;this._usePointers()?y(t,"pointerdown",this._pointerdown):(y(t,"mousedown",this._mousedown),this._mouseOnly||(y(t,"touchstart",this._touchstart),y(t,"touchmove",this._touchmove),y(t,"touchend",this._touchend)))},k.prototype._unbindFromCurrent=function(){var t=this._element;if(this._usePointers())return b(t,"pointerdown",this._pointerdown),b(this.document,"pointermove",this._pointermove),b(this.document,"pointerup",this._pointerup),b(this.document,"contextmenu",T),void b(this.document,"pointercancel",this._pointerup);b(t,"mousedown",this._mousedown),this._mouseOnly||(b(t,"touchstart",this._touchstart),b(t,"touchmove",this._touchmove),b(t,"touchend",this._touchend))},k.prototype._usePointers=function(){return!this._mouseOnly&&k.supportPointerEvent()},k.prototype.update=function(t){var e=t.press;void 0===e&&(e=_);var n=t.drag;void 0===n&&(n=_);var o=t.release;void 0===o&&(o=_);var i=t.mouseOnly;void 0===i&&(i=!1),this._pressHandler=g(O,e),this._dragHandler=g(O,n),this._releaseHandler=g(O,o),this._mouseOnly=i},k.prototype.destroy=function(){this._unbindFromCurrent(),this._element=null},Object.defineProperties(k.prototype,$),k.default=k;var P,E=k;function C(t){var e=t.$slots.default;return t.v3&&e&&"function"==typeof e?e():e}function j(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var M=v,S=(M.h,M.version&&"3"===M.version[0]),I=(j(P={emits:{press:null,drag:null,release:null},inheritAttrs:!1,created:function(){this.element=null,this.draggable=new E({press:this.press,drag:this.drag,release:this.release})},setup:S?function(){return{v3:!!S}}:void 0,mounted:function(){this.$el&&(this.element=3===this.$el.nodeType?this.$el.nextElementSibling:this.$el,this.draggable.bindTo(this.element))},destroyed:S?void 0:function(){this.draggable.destroy()},unmounted:function(){this.draggable.destroy()},methods:{press:function(t){this.element&&this.$emit("press",t,this.element)},drag:function(t){this.element&&this.$emit("drag",t,this.element)},release:function(t){this.element&&this.$emit("release",t,this.element)}}},"setup",S?function(){return{v3:!!S}}:void 0),j(P,"render",(function(t){return C(this)})),P),x=function(t){return t?new Date(t.getTime()):null};function D(t){var e={};return L(t,e),e}function L(t,e){for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];e[n]=N(o,e[n])}}function N(t,e){if(Array.isArray(t))return H(t);if(t instanceof Date)return x(t);if(t&&o(t)){var n=e||{};return L(t,n),n}return t}function H(t){return t.map((function(t){return N(t,void 0)}))}var R=function(){},A=/\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g,K={};function F(t){if(K[t])return K[t];var e=[];return t.replace(A,(function(t,n,o,i){e.push(void 0!==n?n:o||i)})),K[t]=function(t){for(var n=t,o=0;o<e.length&&n;o++)n=n[e[o]];return n},K[t]}K.undefined=function(){};var U={};function V(t){if(U[t])return U[t];var e=[];return t.replace(A,(function(t,n,o,i){e.push(void 0!==n?n:o||i)})),U[t]=function(t,n){for(var o=t,i=e.length-1,r=0;r<i&&o;r++)o=o[e[r]]=o[e[r]]||{};o[e[i]]=n},U[t]}function X(t){return this.v3?Object.keys(this.$attrs).map((function(t){return t.toLowerCase()})).some((function(e){return e.endsWith(t.toLowerCase())})):this.$listeners[t]}function Y(){if(this.v3){var t={};for(var e in this.$attrs)e.startsWith("on")&&(t[e]=this.$attrs[e]);return t}return this.$listeners}U.undefined=function(t){return t};var B=function(){return(B=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},q=v,W=q.version&&"3"===q.version[0],Z={type:[String,Function,Object,Boolean],default:function(){}};function z(t,e){if(t||!1===t){var n=W?this.$slots[t]||(t.toLowerCase?this.$slots[t.toLowerCase()]:null):this.$scopedSlots[t]||(t.toLowerCase?this.$scopedSlots[t.toLowerCase()]:null);return"string"==typeof t&&n?{kt:!0,type:"slot",render:n,listeners:e}:"string"==typeof t||o(t)||"function"==typeof t&&t.component?{kt:!0,type:"component",render:t,listeners:e}:{kt:!0,type:"renderFunction",render:t,listeners:e}}}function G(t){var e,n,o,i=t.h,r=t.template,s=t.defaultRendering,u=t.defaultSlots,l=t.additionalProps,a=t.additionalListeners,c=t.swapDefaultSlots;if(!r||r&&!0===r.render)return s;if(W){var p=s?s.props:{};e=B(B({},J(a)),r.listeners),n=B(B(B({},p),l),e),o=B(B({},n),e)}else{var d=s&&s.componentOptions,f=d?s.componentOptions.listeners:{},h=d?s.componentOptions.propsData:{};e=B(B(B(B({},f),a),J(a)),r.listeners),o={props:n=B(B(B({},h),l),e),on:e}}if("slot"===r.type){var m=r.render({props:n,listeners:e,methods:e,defaultSlots:u});return m?m[0]:void 0}return"renderFunction"===r.type?c?r.render?r.render(i,s,u,n,e):void 0:r.render?r.render(i,s,n,e,u):void 0:i(r.render,o,W?function(){return[u]}:[u])}function J(t){if(!t)return t;for(var e={},n=Object.keys(t),o=0;o<n.length;o++){var i=n[o];e["on"+i.charAt(0).toUpperCase()+i.slice(1)]=t[i]}return e}var Q=function(t,e,n){var o="string"==typeof t?parseInt(t,void 0):t;if(NaN!==o)return void 0!==o?o:e?n?void 0:-1:0};function tt(t){return Boolean(u&&t&&"rtl"===getComputedStyle(t).direction)}function et(t,e){if(!e&&u&&t){var n=window.getComputedStyle(t).direction;if(n)return n}return e}var nt=n(1);function ot(t){if(void 0!==nt)nt.validatePackage(t);else{var e="License activation failed for "+t.name+"\n";e+="The @progress/kendo-licensing script is not loaded.\n",e+="See "+t.licensingDocsUrl+" for more information.\n",console.warn(e)}}var it={sizeMap:{small:"sm",medium:"md",large:"lg"},roundedMap:{small:"sm",medium:"md",large:"lg"}}}])}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("vue"),require("@progress/kendo-licensing")):"function"==typeof define&&define.amd?define(["vue","@progress/kendo-licensing"],t):"object"==typeof exports?exports.KendoVueTooltip=t(require("vue"),require("@progress/kendo-licensing")):e.KendoVueTooltip=t(e.Vue,e.KendoLicensing)}(self,(function(e,t){return(()=>{"use strict";var n={555:(e,t,n)=>{var o=function(){return o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)},i=Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]},r=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};Object.defineProperty(t,"__esModule",{value:!0}),t.TooltipVue2=t.Tooltip=void 0;var s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t}(n(895)),u=s.h,l=s.version&&"3"===s.version[0],a=n(984),c=n(738),p=n(169),d={name:"KendoTooltip",inheritAttrs:!1,props:{showCallout:{type:Boolean,default:!0},setCalloutOnPositionAuto:{type:String,default:void 0},anchorElement:{type:String,default:"pointer",validator:function(e){return["pointer","target"].includes(e)}},content:[String,Object,Function],filter:Function,openDelay:{type:Number,default:400},open:{type:Boolean,default:void 0},position:{type:String,default:"auto",validator:function(e){return["right","left","top","bottom","auto"].includes(e)}},updatePosition:{type:Function,default:void 0},updateInterval:Number,className:String,wrapperStyle:Object,tooltipClassName:String,tooltipStyle:Object,targetElement:[Object,HTMLAnchorElement],parentTitle:{type:Boolean,default:!1}},data:function(){return{top:0,left:0,currentTargetElement:null,currentOpen:!1,title:""}},computed:{wrapperClass:function(){var e;return(e={"k-animation-container":!0,"k-animation-container-fixed":!0,"k-animation-container-shown":!0})[this.$props.className]=!0,e},computedTarget:function(){return void 0!==this.targetElement?this.targetElement:this.currentTargetElement},computedOpen:function(){return void 0!==this.open?this.open:this.currentOpen}},inject:{kCurrentZIndex:{default:null}},created:function(){(0,a.validatePackage)(p.packageMetadata),this.top=0,this.left=0,this.willOpen=!1},mounted:function(){this.element=(0,a.getRef)(this,"element"),document&&document.body.addEventListener("mousemove",this.handleBodyMousemove)},destroyed:l?void 0:function(){this.destroyElement()},unmounted:function(){this.destroyElement()},updated:function(){if(this.$props.open&&this.$props.targetElement&&this.showToolTip({target:this.$props.targetElement}),this.element=(0,a.getRef)(this,"element"),this.element){if(this.resetPosition(),this.computedTarget){var e=this.$props.appendTo?this.$props.appendTo:this.computedTarget.ownerDocument.body;this.element.parentElement!==e&&this.computedTarget.ownerDocument.body.append(this.element)}this.callout=this.v3?this.calloutRef:this.$refs.callout,this.callout&&(this.callout.className=this.calloutClassName(),"auto"===this.$props.position&&(this.left<window.screen.availWidth/2?this.callout.style.left=this.$props.setCalloutOnPositionAuto||"25%":this.callout.style.left=this.$props.setCalloutOnPositionAuto||"75%"))}},setup:l?function(){return{v3:!!l}}:void 0,render:function(e){var t=u||e,n=(0,a.getDefaultSlots)(this),i=this.getCurrentZIndex(),r=this.$props.content?a.templateRendering.call(this,this.$props.content,a.getListeners.call(this)):void 0,s=this.title,l=a.getTemplate.call(this,{h:t,template:r,defaultRendering:s,additionalProps:{title:this.title,target:this.computedTarget}}),c=this.computedOpen&&t("div",{class:(0,a.classNames)("k-tooltip",this.$props.tooltipClassName),style:o({position:"relative"},this.$props.tooltipStyle)},[t("div",{class:"k-tooltip-content"},[l]),this.$props.showCallout&&t("div",{ref:(0,a.setRef)(this,"callout")})]),p=this.computedTarget&&this.title&&this.computedTarget.ownerDocument&&t("div",{ref:(0,a.setRef)(this,"element"),class:this.wrapperClass,style:o({zIndex:i},this.$props.wrapperStyle),tabindex:0,attrs:this.v3?void 0:{tabindex:0}},[c]);return n?t("div",{onMouseover:this.handleMouseOver,on:this.v3?void 0:{mouseover:this.handleMouseOver,mouseout:this.handleMouseOut},onMouseout:this.handleMouseOut},[p,n]):p},methods:{destroyElement:function(){clearTimeout(this.openTimeoutId),clearInterval(this.updateIntervalId),document&&document.body.removeEventListener("mousemove",this.handleBodyMousemove),this.element&&this.element.remove()},handleMouseOut:function(e){var t=this.computedTarget?this.computedTarget.ownerDocument:document,n=t&&t.elementFromPoint(e.clientX,e.clientY);this.willOpen=!1,(0,c.isTooltipElement)(n)||this.computedTarget!==e.target||this.$props.open||(clearInterval(this.updateIntervalId),this.onClose(e))},handleMouseOver:function(e){var t=e.target;this.isVisible(t)&&!(0,c.isTooltipElement)(t)&&t!==this.computedTarget&&this.showToolTip(e)},handleBodyMousemove:function(e){this.top=e.clientY,this.left=e.clientX},onClose:function(e){this.$emit("close",{event:e,component:this}),this.currentTargetElement=null,this.currentOpen=!1,this.title=""},showToolTip:function(e){var t=this;clearTimeout(this.openTimeoutId),clearInterval(this.updateIntervalId),e.target.hasChildNodes()&&e.target.childNodes.forEach((function(t){"title"===t.nodeName&&(e.target.titleExpando=t.innerHTML,t.remove())}));var n=this.computedTarget||e.target,o=this.getTitle(n);o.title?(o.element&&(o.element.titleExpando=o.title,o.element.title=""),this.willOpen=!0,this.$props.openDelay?this.openTimeoutId=window.setTimeout((function(){t.willOpen&&(t.currentTargetElement=n,t.currentOpen=!0,t.title=o.title,t.setUpdateInterval())}),this.$props.openDelay):(this.currentTargetElement=n,this.currentOpen=!0,this.title=o.title,this.setUpdateInterval()),this.title!==o.title&&this.$emit("open",{event:e,compoponent:this})):this.computedOpen&&this.onClose(e)},setUpdateInterval:function(){this.$props.updateInterval&&(this.updateIntervalId=setInterval(this.onIntervalUpdate,this.$props.updateInterval))},onIntervalUpdate:function(){var e=this.computedTarget;e&&(null===e.parentElement?this.onClose({target:e}):this.showToolTip({target:e}))},resetPosition:function(){if(this.element){var e;e=this.$props.updatePosition?this.$props.updatePosition({element:this.element,targetElement:this.computedTarget,mouseTop:this.top,mouseLeft:this.left,anchorElement:this.$props.anchorElement,position:this.$props.position,target:this}):this.setPosition(this.element),this.element.style.left=e.left+"px",this.element.style.top=e.top+"px"}},isVisible:function(e){return!this.$props.filter||this.$props.filter(e)},setPosition:function(e){var t=this.parentTitle?this.getTitle(this.computedTarget).element:this.computedTarget,n=(0,c.getDomRect)(t);return{left:(0,c.getLeftPosition)(this.left,e.offsetWidth,n,this.$props.anchorElement,this.$props.position),top:(0,c.getTopPosition)(this.top,n,e.offsetHeight,this.$props.anchorElement,this.$props.position)}},getTitle:function(e){for(;e;){if(null!==e.getAttribute("title")||e.titleExpando)return{title:e.getAttribute("title")||e.titleExpando,element:e};e=this.$props.parentTitle&&e.parentElement||null}return{title:"",element:e}},calloutClassName:function(){switch(this.$props.position){case"bottom":return"k-callout k-callout-n";case"left":return"k-callout k-callout-e";case"right":return"k-callout k-callout-w";case"top":return"k-callout k-callout-s";default:return this.top<window.innerHeight/2?"k-callout k-callout-n":"k-callout k-callout-s"}},getCurrentZIndex:function(){return this.kCurrentZIndex?this.kCurrentZIndex:100}}};t.TooltipVue2=d;var h=d;t.Tooltip=h},169:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.packageMetadata=void 0,t.packageMetadata={name:"@progress/kendo-vue-tooltip",productName:"Kendo UI for Vue",productCodes:["KENDOUIVUE","KENDOUICOMPLETE"],publishDate:1660124458,version:"",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"}},738:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isTooltipElement=t.toolTipSelectors=t.getDomRect=t.getTopPosition=t.getLeftPosition=void 0;var n=10,o=10;t.getLeftPosition=function(e,t,o,i,r){switch(r){case"bottom":case"top":return"pointer"===i?e-t/2:o.left-t/2+o.width/2;case"left":return"pointer"===i?e-t-n:o.left-t-n;case"right":return"pointer"===i?e+n:o.right+n;default:return"pointer"===i?e<window.screen.availWidth/2?e-n:e-t+n:e<window.screen.availWidth/2?o.left:o.right-t}},t.getTopPosition=function(e,t,i,r,s){switch(s){case"bottom":return"pointer"===r?e+o:t.bottom+o;case"left":case"right":return"pointer"===r?e-i/2:t.top-i/2+t.height/2;case"top":return"pointer"===r?e-i-o:t.top-i-o;default:return"pointer"===r?e<window.innerHeight/2?e+n:e-i-n:e<window.innerHeight/2?t.bottom+o:t.top-i-o}},t.getDomRect=function(e){return null!==e?e.getBoundingClientRect():document.body.getBoundingClientRect()},t.toolTipSelectors=["k-tooltip-content","k-animation-container","k-tooltip","k-tooltip-title","k-tooltip k-tooltip-closable","k-icon k-i-close"],t.isTooltipElement=function(e){if(null===e)return!1;for(var n=e;n;){if(null!==n&&n.classList&&n.classList.contains("k-tooltip"))return!0;n=null!==n.parentNode&&n.parentNode}return t.toolTipSelectors.filter((function(t){return t===e.className})).length>0}},984:(e,t,n)=>{n.r(t),n.d(t,{Draggable:()=>I,Keys:()=>s,canUseDOM:()=>u,classNames:()=>i,clone:()=>D,cloneArray:()=>H,cloneDate:()=>x,cloneObject:()=>L,cloneValue:()=>N,firstFocusableChild:()=>p,focusContainer:()=>m,focusFirstFocusableChild:()=>h,focusLastFocusableChild:()=>f,getDefaultSlots:()=>E,getDir:()=>te,getListeners:()=>Y,getRef:()=>l,getTabIndex:()=>Q,getTemplate:()=>G,getter:()=>F,guid:()=>r,hasListener:()=>X,isObject:()=>o,isRtl:()=>ee,kendoThemeMaps:()=>ie,lastFocusableChild:()=>d,noop:()=>R,setRef:()=>a,setter:()=>V,templateDefinition:()=>Z,templateRendering:()=>z,validatePackage:()=>oe});var o=function(e){return"object"==typeof e},i=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return!0!==e&&!!e})).map((function(e){return Array.isArray(e)?i.apply(void 0,e):o(e)?Object.keys(e).map((function(t,n){return e[n]||e[t]&&t||null})).filter((function(e){return null!==e})).join(" "):e})).filter((function(e){return!!e})).join(" ")},r=function(){var e,t,n="";for(e=0;e<32;e++)t=16*Math.random()|0,8!==e&&12!==e&&16!==e&&20!==e||(n+="-"),n+=(12===e?4:16===e?3&t|8:t).toString(16);return n},s={backspace:8,tab:9,enter:13,shift:16,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,delete:46},u=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement);function l(e,t,n){return e.v3?e["".concat(t,"Ref")]:e.$refs["".concat(n||t)]}function a(e,t,n){return e.v3?function(n){e["".concat(t,"Ref")]=n}:n||t}var c='input, [tabindex]:not([tabindex="-1"])',p=function(e){if(e){var t=e.querySelectorAll(c);if(t.length&&t[0].focus)return t[0]}},d=function(e){if(e){var t=e.querySelectorAll(c);if(t.length&&t[t.length-1].focus)return t[t.length-1]}},h=function(e){if(e){var t=e.querySelectorAll(c);t.length&&t[0].focus&&t[0].focus()}},f=function(e){if(e){var t=e.querySelectorAll(c);t.length&&t[t.length-1].focus&&t[t.length-1].focus()}},m=function(e,t){var n=!0;if(e.keyCode!==s.enter&&e.target===t)return!1;if(e.keyCode===s.enter&&e.target===t)n=!0,setTimeout((function(){h(t)}),1);else if(e.keyCode===s.esc)n=!1,t.focus();else if(e.keyCode===s.tab){var o=p(t),i=d(t);i&&!e.shiftKey&&e.target===i&&(e.preventDefault(),o.focus()),o&&e.shiftKey&&e.target===o&&(e.preventDefault(),i.focus())}return n},v=n(895),g=function(e,t){return function(n){return t(e(n))}},y=function(e,t,n){return e.addEventListener&&e.addEventListener(t,n)},b=function(e,t,n){return e&&e.removeEventListener&&e.removeEventListener(t,n)},T=function(){},_=function(e){return e.preventDefault()},w=/touch/;function O(e){return e.type.match(w)?{pageX:e.changedTouches[0].pageX,pageY:e.changedTouches[0].pageY,clientX:e.changedTouches[0].clientX,clientY:e.changedTouches[0].clientY,type:e.type,originalEvent:e,isTouch:!0}:{pageX:e.pageX,pageY:e.pageY,clientX:e.clientX,clientY:e.clientY,offsetX:e.offsetX,offsetY:e.offsetY,type:e.type,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,originalEvent:e}}var k=function(e){var t=this,n=e.press;void 0===n&&(n=T);var o=e.drag;void 0===o&&(o=T);var i=e.release;void 0===i&&(i=T);var r=e.mouseOnly;void 0===r&&(r=!1),this._pressHandler=g(O,n),this._dragHandler=g(O,o),this._releaseHandler=g(O,i),this._ignoreMouse=!1,this._mouseOnly=r,this._touchstart=function(e){1===e.touches.length&&t._pressHandler(e)},this._touchmove=function(e){1===e.touches.length&&t._dragHandler(e)},this._touchend=function(e){0===e.touches.length&&1===e.changedTouches.length&&(t._releaseHandler(e),t._ignoreMouse=!0,setTimeout(t._restoreMouse,2e3))},this._restoreMouse=function(){t._ignoreMouse=!1},this._mousedown=function(e){var n=e.which;n&&n>1||t._ignoreMouse||(y(t.document,"mousemove",t._mousemove),y(t.document,"mouseup",t._mouseup),t._pressHandler(e))},this._mousemove=function(e){t._dragHandler(e)},this._mouseup=function(e){b(t.document,"mousemove",t._mousemove),b(t.document,"mouseup",t._mouseup),t._releaseHandler(e)},this._pointerdown=function(e){e.isPrimary&&0===e.button&&(y(t.document,"pointermove",t._pointermove),y(t.document,"pointerup",t._pointerup),y(t.document,"pointercancel",t._pointerup),y(t.document,"contextmenu",_),t._pressHandler(e))},this._pointermove=function(e){e.isPrimary&&t._dragHandler(e)},this._pointerup=function(e){e.isPrimary&&(b(t.document,"pointermove",t._pointermove),b(t.document,"pointerup",t._pointerup),b(t.document,"pointercancel",t._pointerup),b(t.document,"contextmenu",_),t._releaseHandler(e))}},$={document:{configurable:!0}};k.supportPointerEvent=function(){return"undefined"!=typeof window&&window.PointerEvent},$.document.get=function(){return this._element?this._element.ownerDocument:document},k.prototype.bindTo=function(e){e!==this._element&&(this._element&&this._unbindFromCurrent(),this._element=e,this._bindToCurrent())},k.prototype._bindToCurrent=function(){var e=this._element;this._usePointers()?y(e,"pointerdown",this._pointerdown):(y(e,"mousedown",this._mousedown),this._mouseOnly||(y(e,"touchstart",this._touchstart),y(e,"touchmove",this._touchmove),y(e,"touchend",this._touchend)))},k.prototype._unbindFromCurrent=function(){var e=this._element;if(this._usePointers())return b(e,"pointerdown",this._pointerdown),b(this.document,"pointermove",this._pointermove),b(this.document,"pointerup",this._pointerup),b(this.document,"contextmenu",_),void b(this.document,"pointercancel",this._pointerup);b(e,"mousedown",this._mousedown),this._mouseOnly||(b(e,"touchstart",this._touchstart),b(e,"touchmove",this._touchmove),b(e,"touchend",this._touchend))},k.prototype._usePointers=function(){return!this._mouseOnly&&k.supportPointerEvent()},k.prototype.update=function(e){var t=e.press;void 0===t&&(t=T);var n=e.drag;void 0===n&&(n=T);var o=e.release;void 0===o&&(o=T);var i=e.mouseOnly;void 0===i&&(i=!1),this._pressHandler=g(O,t),this._dragHandler=g(O,n),this._releaseHandler=g(O,o),this._mouseOnly=i},k.prototype.destroy=function(){this._unbindFromCurrent(),this._element=null},Object.defineProperties(k.prototype,$),k.default=k;const P=k;function E(e){var t=e.$slots.default;return e.v3&&t&&"function"==typeof t?t():t}var C;function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var M=v,S=(M.h,M.version&&"3"===M.version[0]),I=(j(C={emits:{press:null,drag:null,release:null},inheritAttrs:!1,created:function(){this.element=null,this.draggable=new P({press:this.press,drag:this.drag,release:this.release})},setup:S?function(){return{v3:!!S}}:void 0,mounted:function(){this.$el&&(this.element=3===this.$el.nodeType?this.$el.nextElementSibling:this.$el,this.draggable.bindTo(this.element))},destroyed:S?void 0:function(){this.draggable.destroy()},unmounted:function(){this.draggable.destroy()},methods:{press:function(e){this.element&&this.$emit("press",e,this.element)},drag:function(e){this.element&&this.$emit("drag",e,this.element)},release:function(e){this.element&&this.$emit("release",e,this.element)}}},"setup",S?function(){return{v3:!!S}}:void 0),j(C,"render",(function(e){return E(this)})),C),x=function(e){return e?new Date(e.getTime()):null};function D(e){var t={};return L(e,t),t}function L(e,t){for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];t[n]=N(o,t[n])}}function N(e,t){if(Array.isArray(e))return H(e);if(e instanceof Date)return x(e);if(e&&o(e)){var n=t||{};return L(e,n),n}return e}function H(e){return e.map((function(e){return N(e,void 0)}))}var R=function(){},A=/\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g,K={};function F(e){if(K[e])return K[e];var t=[];return e.replace(A,(function(e,n,o,i){t.push(void 0!==n?n:o||i)})),K[e]=function(e){for(var n=e,o=0;o<t.length&&n;o++)n=n[t[o]];return n},K[e]}K.undefined=function(){};var U={};function V(e){if(U[e])return U[e];var t=[];return e.replace(A,(function(e,n,o,i){t.push(void 0!==n?n:o||i)})),U[e]=function(e,n){for(var o=e,i=t.length-1,r=0;r<i&&o;r++)o=o[t[r]]=o[t[r]]||{};o[t[i]]=n},U[e]}function X(e){return this.v3?Object.keys(this.$attrs).map((function(e){return e.toLowerCase()})).some((function(t){return t.endsWith(e.toLowerCase())})):this.$listeners[e]}function Y(){if(this.v3){var e={};for(var t in this.$attrs)t.startsWith("on")&&(e[t]=this.$attrs[t]);return e}return this.$listeners}U.undefined=function(e){return e};var B=function(){return B=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},B.apply(this,arguments)},q=v,W=q.version&&"3"===q.version[0],Z={type:[String,Function,Object,Boolean],default:function(){}};function z(e,t){if(e||!1===e){var n=W?this.$slots[e]||(e.toLowerCase?this.$slots[e.toLowerCase()]:null):this.$scopedSlots[e]||(e.toLowerCase?this.$scopedSlots[e.toLowerCase()]:null);return"string"==typeof e&&n?{kt:!0,type:"slot",render:n,listeners:t}:"string"==typeof e||o(e)||"function"==typeof e&&e.component?{kt:!0,type:"component",render:e,listeners:t}:{kt:!0,type:"renderFunction",render:e,listeners:t}}}function G(e){var t,n,o,i=e.h,r=e.template,s=e.defaultRendering,u=e.defaultSlots,l=e.additionalProps,a=e.additionalListeners,c=e.swapDefaultSlots;if(!r||r&&!0===r.render)return s;if(W){var p=s?s.props:{};t=B(B({},J(a)),r.listeners),n=B(B(B({},p),l),t),o=B(B({},n),t)}else{var d=s&&s.componentOptions,h=d?s.componentOptions.listeners:{},f=d?s.componentOptions.propsData:{};t=B(B(B(B({},h),a),J(a)),r.listeners),o={props:n=B(B(B({},f),l),t),on:t}}if("slot"===r.type){var m=r.render({props:n,listeners:t,methods:t,defaultSlots:u});return m?m[0]:void 0}return"renderFunction"===r.type?c?r.render?r.render(i,s,u,n,t):void 0:r.render?r.render(i,s,n,t,u):void 0:i(r.render,o,W?function(){return[u]}:[u])}function J(e){if(!e)return e;for(var t={},n=Object.keys(e),o=0;o<n.length;o++){var i=n[o];t["on"+i.charAt(0).toUpperCase()+i.slice(1)]=e[i]}return t}var Q=function(e,t,n){var o="string"==typeof e?parseInt(e,void 0):e;if(NaN!==o)return void 0!==o?o:t?n?void 0:-1:0};function ee(e){return Boolean(u&&e&&"rtl"===getComputedStyle(e).direction)}function te(e,t){if(!t&&u&&e){var n=window.getComputedStyle(e).direction;if(n)return n}return t}var ne=n(302);function oe(e){if(void 0!==ne)ne.validatePackage(e);else{var t="License activation failed for ".concat(e.name,"\n");t+="The @progress/kendo-licensing script is not loaded.\n",t+="See ".concat(e.licensingDocsUrl," for more information.\n"),console.warn(t)}}var ie={sizeMap:{small:"sm",medium:"md",large:"lg"},roundedMap:{small:"sm",medium:"md",large:"lg"}}},302:e=>{e.exports=t},895:t=>{t.exports=e}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}};return n[e](r,r.exports,i),r.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.TooltipVue2=e.Tooltip=void 0;var t=i(555);Object.defineProperty(e,"Tooltip",{enumerable:!0,get:function(){return t.Tooltip}}),Object.defineProperty(e,"TooltipVue2",{enumerable:!0,get:function(){return t.TooltipVue2}})})(),r})()}));
|
package/dist/es/TooltipProps.js
CHANGED
package/dist/es/events.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-vue-tooltip',
|
|
6
6
|
productName: 'Kendo UI for Vue',
|
|
7
7
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1660124458,
|
|
9
9
|
version: '',
|
|
10
10
|
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'
|
|
11
11
|
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type } from './additionalTypes';
|
|
2
|
+
declare type DefaultData<V> = object | ((this: V) => {});
|
|
3
|
+
declare type DefaultMethods<V> = {
|
|
4
|
+
[key: string]: (this: V, ...args: any[]) => any;
|
|
5
|
+
};
|
|
6
|
+
import { TooltipProps } from './TooltipProps';
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
interface TooltipData {
|
|
11
|
+
targetElement: HTMLElement | null;
|
|
12
|
+
open: boolean;
|
|
13
|
+
title: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @hidden
|
|
17
|
+
*/
|
|
18
|
+
export interface TooltipComputed {
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
computedTarget: any;
|
|
21
|
+
computedOpen: any;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @hidden
|
|
25
|
+
*/
|
|
26
|
+
export interface TooltipMethods {
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
export interface TooltipState {
|
|
33
|
+
top: number;
|
|
34
|
+
left: number;
|
|
35
|
+
openTimeoutId?: any;
|
|
36
|
+
updateIntervalId?: any;
|
|
37
|
+
willOpen: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @hidden
|
|
41
|
+
*/
|
|
42
|
+
export interface TooltipAll extends Vue2type, TooltipMethods, TooltipData, TooltipComputed, TooltipState {
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @hidden
|
|
46
|
+
*/
|
|
47
|
+
declare let TooltipVue2: ComponentOptions<TooltipAll, DefaultData<TooltipData>, DefaultMethods<TooltipAll>, TooltipComputed, RecordPropsDefinition<TooltipProps>>;
|
|
48
|
+
/**
|
|
49
|
+
* @hidden
|
|
50
|
+
*/
|
|
51
|
+
declare const Tooltip: DefineComponent<TooltipProps, any, TooltipData, TooltipComputed, TooltipMethods, {}, {}, {}, string, TooltipProps, TooltipProps, {}>;
|
|
52
|
+
export { Tooltip, TooltipVue2 };
|
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
|
|
6
|
+
for (var p in s) {
|
|
7
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
}; // @ts-ignore
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
import * as Vue from 'vue';
|
|
19
|
+
var allVue = Vue;
|
|
20
|
+
var gh = allVue.h;
|
|
21
|
+
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
22
|
+
import { classNames, validatePackage, getDefaultSlots, getListeners, templateRendering, getTemplate, setRef, getRef } from '@progress/kendo-vue-common';
|
|
23
|
+
import { getLeftPosition, getTopPosition, getDomRect, isTooltipElement } from './utils.js';
|
|
24
|
+
import { packageMetadata } from './package-metadata.js';
|
|
25
|
+
var DEFAULT_TOOLTIP_ZINDEX = 100;
|
|
26
|
+
/**
|
|
27
|
+
* @hidden
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
var TooltipVue2 = {
|
|
31
|
+
name: 'KendoTooltip',
|
|
32
|
+
inheritAttrs: false,
|
|
33
|
+
props: {
|
|
34
|
+
showCallout: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: true
|
|
37
|
+
},
|
|
38
|
+
setCalloutOnPositionAuto: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: undefined
|
|
41
|
+
},
|
|
42
|
+
anchorElement: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: 'pointer',
|
|
45
|
+
validator: function validator(value) {
|
|
46
|
+
return ['pointer', 'target'].includes(value);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
content: [String, Object, Function],
|
|
50
|
+
filter: Function,
|
|
51
|
+
openDelay: {
|
|
52
|
+
type: Number,
|
|
53
|
+
default: 400
|
|
54
|
+
},
|
|
55
|
+
open: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: undefined
|
|
58
|
+
},
|
|
59
|
+
position: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: 'auto',
|
|
62
|
+
validator: function validator(value) {
|
|
63
|
+
return ['right', 'left', 'top', 'bottom', 'auto'].includes(value);
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
updatePosition: {
|
|
67
|
+
type: Function,
|
|
68
|
+
default: undefined
|
|
69
|
+
},
|
|
70
|
+
updateInterval: Number,
|
|
71
|
+
className: String,
|
|
72
|
+
wrapperStyle: Object,
|
|
73
|
+
tooltipClassName: String,
|
|
74
|
+
tooltipStyle: Object,
|
|
75
|
+
targetElement: [Object, HTMLAnchorElement],
|
|
76
|
+
parentTitle: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: false
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
data: function data() {
|
|
82
|
+
return {
|
|
83
|
+
top: 0,
|
|
84
|
+
left: 0,
|
|
85
|
+
currentTargetElement: null,
|
|
86
|
+
currentOpen: false,
|
|
87
|
+
title: ''
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
computed: {
|
|
91
|
+
wrapperClass: function wrapperClass() {
|
|
92
|
+
var _a;
|
|
93
|
+
|
|
94
|
+
return _a = {
|
|
95
|
+
'k-animation-container': true,
|
|
96
|
+
'k-animation-container-fixed': true,
|
|
97
|
+
'k-animation-container-shown': true
|
|
98
|
+
}, _a[this.$props.className] = true, _a;
|
|
99
|
+
},
|
|
100
|
+
computedTarget: function computedTarget() {
|
|
101
|
+
return this.targetElement !== undefined ? this.targetElement : this.currentTargetElement;
|
|
102
|
+
},
|
|
103
|
+
computedOpen: function computedOpen() {
|
|
104
|
+
return this.open !== undefined ? this.open : this.currentOpen;
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
inject: {
|
|
108
|
+
kCurrentZIndex: {
|
|
109
|
+
default: null
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
created: function created() {
|
|
113
|
+
validatePackage(packageMetadata);
|
|
114
|
+
this.top = 0;
|
|
115
|
+
this.left = 0;
|
|
116
|
+
this.willOpen = false;
|
|
117
|
+
},
|
|
118
|
+
mounted: function mounted() {
|
|
119
|
+
this.element = getRef(this, 'element');
|
|
120
|
+
|
|
121
|
+
if (document) {
|
|
122
|
+
document.body.addEventListener('mousemove', this.handleBodyMousemove);
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
destroyed: !!isV3 ? undefined : function () {
|
|
126
|
+
this.destroyElement();
|
|
127
|
+
},
|
|
128
|
+
// @ts-ignore
|
|
129
|
+
unmounted: function unmounted() {
|
|
130
|
+
this.destroyElement();
|
|
131
|
+
},
|
|
132
|
+
updated: function updated() {
|
|
133
|
+
if (this.$props.open && this.$props.targetElement) {
|
|
134
|
+
this.showToolTip({
|
|
135
|
+
target: this.$props.targetElement
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
this.element = getRef(this, 'element');
|
|
140
|
+
|
|
141
|
+
if (!this.element) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
this.resetPosition();
|
|
146
|
+
|
|
147
|
+
if (this.computedTarget) {
|
|
148
|
+
var appendToElement = this.$props.appendTo ? this.$props.appendTo : this.computedTarget.ownerDocument.body;
|
|
149
|
+
|
|
150
|
+
if (this.element.parentElement !== appendToElement) {
|
|
151
|
+
this.computedTarget.ownerDocument.body.append(this.element);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
this.callout = this.v3 ? this.calloutRef : this.$refs.callout;
|
|
156
|
+
|
|
157
|
+
if (!this.callout) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
this.callout.className = this.calloutClassName();
|
|
162
|
+
|
|
163
|
+
if (this.$props.position === 'auto') {
|
|
164
|
+
this.left < window.screen.availWidth / 2 ? this.callout.style.left = this.$props.setCalloutOnPositionAuto || '25%' : this.callout.style.left = this.$props.setCalloutOnPositionAuto || '75%';
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
// @ts-ignore
|
|
168
|
+
setup: !isV3 ? undefined : function () {
|
|
169
|
+
var v3 = !!isV3;
|
|
170
|
+
return {
|
|
171
|
+
v3: v3
|
|
172
|
+
};
|
|
173
|
+
},
|
|
174
|
+
// @ts-ignore
|
|
175
|
+
render: function render(createElement) {
|
|
176
|
+
var h = gh || createElement;
|
|
177
|
+
var defaultSlot = getDefaultSlots(this);
|
|
178
|
+
var currentZIndex = this.getCurrentZIndex();
|
|
179
|
+
var content = this.$props.content ? templateRendering.call(this, this.$props.content, getListeners.call(this)) : undefined;
|
|
180
|
+
var contentDefaultRendering = this.title;
|
|
181
|
+
var contentRendering = getTemplate.call(this, {
|
|
182
|
+
h: h,
|
|
183
|
+
template: content,
|
|
184
|
+
defaultRendering: contentDefaultRendering,
|
|
185
|
+
additionalProps: {
|
|
186
|
+
title: this.title,
|
|
187
|
+
target: this.computedTarget
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
var innerToolTip = this.computedOpen && h("div", {
|
|
191
|
+
"class": classNames('k-tooltip', this.$props.tooltipClassName),
|
|
192
|
+
style: __assign({
|
|
193
|
+
position: 'relative'
|
|
194
|
+
}, this.$props.tooltipStyle)
|
|
195
|
+
}, [h("div", {
|
|
196
|
+
"class": "k-tooltip-content"
|
|
197
|
+
}, [contentRendering]), this.$props.showCallout && h("div", {
|
|
198
|
+
ref: setRef(this, 'callout')
|
|
199
|
+
})]);
|
|
200
|
+
var tooltip = this.computedTarget && this.title && this.computedTarget.ownerDocument && h("div", {
|
|
201
|
+
ref: setRef(this, 'element'),
|
|
202
|
+
"class": this.wrapperClass,
|
|
203
|
+
style: __assign({
|
|
204
|
+
zIndex: currentZIndex
|
|
205
|
+
}, this.$props.wrapperStyle),
|
|
206
|
+
tabindex: 0,
|
|
207
|
+
attrs: this.v3 ? undefined : {
|
|
208
|
+
tabindex: 0
|
|
209
|
+
}
|
|
210
|
+
}, [innerToolTip]);
|
|
211
|
+
|
|
212
|
+
if (defaultSlot) {
|
|
213
|
+
return h("div", {
|
|
214
|
+
onMouseover: this.handleMouseOver,
|
|
215
|
+
on: this.v3 ? undefined : {
|
|
216
|
+
"mouseover": this.handleMouseOver,
|
|
217
|
+
"mouseout": this.handleMouseOut
|
|
218
|
+
},
|
|
219
|
+
onMouseout: this.handleMouseOut
|
|
220
|
+
}, [tooltip, defaultSlot]);
|
|
221
|
+
} else {
|
|
222
|
+
return tooltip;
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
methods: {
|
|
226
|
+
destroyElement: function destroyElement() {
|
|
227
|
+
clearTimeout(this.openTimeoutId);
|
|
228
|
+
clearInterval(this.updateIntervalId);
|
|
229
|
+
|
|
230
|
+
if (document) {
|
|
231
|
+
document.body.removeEventListener('mousemove', this.handleBodyMousemove);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (this.element) {
|
|
235
|
+
this.element.remove();
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
handleMouseOut: function handleMouseOut(event) {
|
|
239
|
+
var currentDocument = this.computedTarget ? this.computedTarget.ownerDocument : document;
|
|
240
|
+
var element = currentDocument && currentDocument.elementFromPoint(event.clientX, event.clientY);
|
|
241
|
+
this.willOpen = false;
|
|
242
|
+
|
|
243
|
+
if (isTooltipElement(element) || this.computedTarget !== event.target) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if (this.$props.open) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
clearInterval(this.updateIntervalId);
|
|
252
|
+
this.onClose(event);
|
|
253
|
+
},
|
|
254
|
+
handleMouseOver: function handleMouseOver(event) {
|
|
255
|
+
var target = event.target;
|
|
256
|
+
|
|
257
|
+
if (!this.isVisible(target) || isTooltipElement(target) || target === this.computedTarget) {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
this.showToolTip(event);
|
|
262
|
+
},
|
|
263
|
+
handleBodyMousemove: function handleBodyMousemove(event) {
|
|
264
|
+
this.top = event.clientY;
|
|
265
|
+
this.left = event.clientX;
|
|
266
|
+
},
|
|
267
|
+
onClose: function onClose(event) {
|
|
268
|
+
this.$emit('close', {
|
|
269
|
+
event: event,
|
|
270
|
+
component: this
|
|
271
|
+
});
|
|
272
|
+
this.currentTargetElement = null;
|
|
273
|
+
this.currentOpen = false;
|
|
274
|
+
this.title = '';
|
|
275
|
+
},
|
|
276
|
+
showToolTip: function showToolTip(event) {
|
|
277
|
+
var _this = this;
|
|
278
|
+
|
|
279
|
+
clearTimeout(this.openTimeoutId);
|
|
280
|
+
clearInterval(this.updateIntervalId);
|
|
281
|
+
|
|
282
|
+
if (event.target.hasChildNodes()) {
|
|
283
|
+
event.target.childNodes.forEach(function (childElement) {
|
|
284
|
+
if (childElement.nodeName === 'title') {
|
|
285
|
+
event.target.titleExpando = childElement.innerHTML;
|
|
286
|
+
childElement.remove();
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
var target = this.computedTarget || event.target;
|
|
292
|
+
var titleResult = this.getTitle(target);
|
|
293
|
+
|
|
294
|
+
if (!titleResult.title) {
|
|
295
|
+
if (this.computedOpen) {
|
|
296
|
+
this.onClose(event);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
if (titleResult.element) {
|
|
303
|
+
titleResult.element.titleExpando = titleResult.title;
|
|
304
|
+
titleResult.element.title = '';
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
this.willOpen = true;
|
|
308
|
+
|
|
309
|
+
if (!this.$props.openDelay) {
|
|
310
|
+
this.currentTargetElement = target;
|
|
311
|
+
this.currentOpen = true;
|
|
312
|
+
this.title = titleResult.title;
|
|
313
|
+
this.setUpdateInterval();
|
|
314
|
+
} else {
|
|
315
|
+
this.openTimeoutId = window.setTimeout(function () {
|
|
316
|
+
if (_this.willOpen) {
|
|
317
|
+
_this.currentTargetElement = target;
|
|
318
|
+
_this.currentOpen = true;
|
|
319
|
+
_this.title = titleResult.title;
|
|
320
|
+
|
|
321
|
+
_this.setUpdateInterval();
|
|
322
|
+
}
|
|
323
|
+
}, this.$props.openDelay);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
if (this.title !== titleResult.title) {
|
|
327
|
+
this.$emit('open', {
|
|
328
|
+
event: event,
|
|
329
|
+
compoponent: this
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
setUpdateInterval: function setUpdateInterval() {
|
|
334
|
+
if (this.$props.updateInterval) {
|
|
335
|
+
this.updateIntervalId = setInterval(this.onIntervalUpdate, this.$props.updateInterval);
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
onIntervalUpdate: function onIntervalUpdate() {
|
|
339
|
+
var target = this.computedTarget;
|
|
340
|
+
|
|
341
|
+
if (!target) {
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
if (target.parentElement === null) {
|
|
346
|
+
// Getting element from previous target coordinates will cause reflow which is performance hit.
|
|
347
|
+
// Also remount case can be avoided easily
|
|
348
|
+
this.onClose({
|
|
349
|
+
target: target
|
|
350
|
+
});
|
|
351
|
+
} else {
|
|
352
|
+
this.showToolTip({
|
|
353
|
+
target: target
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
resetPosition: function resetPosition() {
|
|
358
|
+
if (this.element) {
|
|
359
|
+
var position = void 0;
|
|
360
|
+
|
|
361
|
+
if (this.$props.updatePosition) {
|
|
362
|
+
position = this.$props.updatePosition({
|
|
363
|
+
element: this.element,
|
|
364
|
+
targetElement: this.computedTarget,
|
|
365
|
+
mouseTop: this.top,
|
|
366
|
+
mouseLeft: this.left,
|
|
367
|
+
anchorElement: this.$props.anchorElement,
|
|
368
|
+
position: this.$props.position,
|
|
369
|
+
target: this
|
|
370
|
+
});
|
|
371
|
+
} else {
|
|
372
|
+
position = this.setPosition(this.element);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
this.element.style.left = position.left + 'px';
|
|
376
|
+
this.element.style.top = position.top + 'px';
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
isVisible: function isVisible(element) {
|
|
380
|
+
return !this.$props.filter || this.$props.filter(element);
|
|
381
|
+
},
|
|
382
|
+
setPosition: function setPosition(element) {
|
|
383
|
+
var target = this.parentTitle ? this.getTitle(this.computedTarget).element : this.computedTarget;
|
|
384
|
+
var domRect = getDomRect(target);
|
|
385
|
+
var left = getLeftPosition(this.left, element.offsetWidth, domRect, this.$props.anchorElement, this.$props.position);
|
|
386
|
+
var top = getTopPosition(this.top, domRect, element.offsetHeight, this.$props.anchorElement, this.$props.position);
|
|
387
|
+
return {
|
|
388
|
+
left: left,
|
|
389
|
+
top: top
|
|
390
|
+
};
|
|
391
|
+
},
|
|
392
|
+
getTitle: function getTitle(element) {
|
|
393
|
+
while (element) {
|
|
394
|
+
if (element.getAttribute('title') !== null || element.titleExpando) {
|
|
395
|
+
var title = element.getAttribute('title') || element.titleExpando;
|
|
396
|
+
return {
|
|
397
|
+
title: title,
|
|
398
|
+
element: element
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
element = this.$props.parentTitle && element.parentElement || null;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
return {
|
|
406
|
+
title: '',
|
|
407
|
+
element: element
|
|
408
|
+
};
|
|
409
|
+
},
|
|
410
|
+
calloutClassName: function calloutClassName() {
|
|
411
|
+
switch (this.$props.position) {
|
|
412
|
+
case 'bottom':
|
|
413
|
+
return 'k-callout k-callout-n';
|
|
414
|
+
|
|
415
|
+
case 'left':
|
|
416
|
+
return 'k-callout k-callout-e';
|
|
417
|
+
|
|
418
|
+
case 'right':
|
|
419
|
+
return 'k-callout k-callout-w';
|
|
420
|
+
|
|
421
|
+
case 'top':
|
|
422
|
+
return 'k-callout k-callout-s';
|
|
423
|
+
|
|
424
|
+
default:
|
|
425
|
+
return this.top < window.innerHeight / 2 ? 'k-callout k-callout-n' : 'k-callout k-callout-s';
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
getCurrentZIndex: function getCurrentZIndex() {
|
|
429
|
+
return this.kCurrentZIndex ? this.kCurrentZIndex : DEFAULT_TOOLTIP_ZINDEX;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
/**
|
|
434
|
+
* @hidden
|
|
435
|
+
*/
|
|
436
|
+
|
|
437
|
+
var Tooltip = TooltipVue2;
|
|
438
|
+
export { Tooltip, TooltipVue2 };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { TooltipEvent, TooltipPositionEvent } from './events';
|
|
2
|
+
import { TooltipPosition } from './utils';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the props of the [Kendo UI for Vue Tooltip component]({% slug overview_tooltip %}).
|
|
5
|
+
*/
|
|
6
|
+
export interface TooltipProps {
|
|
7
|
+
/**
|
|
8
|
+
* Sets the anchor element of the Tooltip.
|
|
9
|
+
*
|
|
10
|
+
* The available options are:
|
|
11
|
+
* - (Default) `pointer`—Shows a Tooltip where the cursor is located.
|
|
12
|
+
* - `target`—Positions the Tooltip based on the anchor element.
|
|
13
|
+
*/
|
|
14
|
+
anchorElement?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Defines the container to which the Tooltip will be appended. Defaults to [`body`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body).
|
|
17
|
+
*/
|
|
18
|
+
appendTo?: HTMLElement | null;
|
|
19
|
+
/**
|
|
20
|
+
* Sets the position of the Tooltip ([see example]({% slug positioning_tooltip %})).
|
|
21
|
+
*
|
|
22
|
+
* The available options are:
|
|
23
|
+
* - (Default) `auto`—Positions the Tooltip depending on the available space.
|
|
24
|
+
* - `right`—Positions the Tooltip to the right side of the element.
|
|
25
|
+
* - `left`—Positions the Tooltip to the left side of the element.
|
|
26
|
+
* - `bottom`—Positions the Tooltip at the bottom of the element.
|
|
27
|
+
* - `top`—Positions the Tooltip at the top of the element.
|
|
28
|
+
*/
|
|
29
|
+
position?: TooltipPosition | String;
|
|
30
|
+
/**
|
|
31
|
+
* Sets a class of the Tooltip animation container.
|
|
32
|
+
*/
|
|
33
|
+
className?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Sets a class of the Tooltip animation container.
|
|
36
|
+
*/
|
|
37
|
+
wrapperStyle?: object;
|
|
38
|
+
/**
|
|
39
|
+
* Sets the content of the Tooltip ([see example]({% slug templates_tooltip %})).
|
|
40
|
+
*/
|
|
41
|
+
content?: any;
|
|
42
|
+
/**
|
|
43
|
+
* Specifies if the Tooltip will be open.
|
|
44
|
+
* Sets the Tooltip in its controlled mode ([see example]({% slug controlledmode_tooltip %})).
|
|
45
|
+
* Requires you to set the `targetElement` property.
|
|
46
|
+
*/
|
|
47
|
+
open?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Sets a delay in milliseconds.
|
|
50
|
+
*/
|
|
51
|
+
openDelay?: number;
|
|
52
|
+
/**
|
|
53
|
+
* If any of the parent elements has a title, displays a Tooltip.
|
|
54
|
+
*/
|
|
55
|
+
parentTitle?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Specifies if the Tooltip callout will be displayed.
|
|
58
|
+
*/
|
|
59
|
+
showCallout?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* When the position is set to `auto`, sets the start point of the Tooltip callout (in pixels).
|
|
62
|
+
*/
|
|
63
|
+
setCalloutOnPositionAuto?: any;
|
|
64
|
+
/**
|
|
65
|
+
* Sets the Tooltip target element. You have to use it with the `open` property.
|
|
66
|
+
*/
|
|
67
|
+
targetElement?: any;
|
|
68
|
+
/**
|
|
69
|
+
* Specifies the CSS class names which are set to the Tooltip DOM element.
|
|
70
|
+
*/
|
|
71
|
+
tooltipClassName?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Specifies the styles which are set to the Tooltip DOM element.
|
|
74
|
+
*/
|
|
75
|
+
tooltipStyle?: any;
|
|
76
|
+
/**
|
|
77
|
+
* Callback called when the Tooltip calculates it's position. Useful to modify the default position behavior.
|
|
78
|
+
* Require to return the `top` and `left` position of the Tooltip.
|
|
79
|
+
*/
|
|
80
|
+
updatePosition?: (event: TooltipPositionEvent) => {
|
|
81
|
+
top: number;
|
|
82
|
+
left: number;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Fires when the Tooltip is shown.
|
|
86
|
+
*/
|
|
87
|
+
onOpen?: (event: TooltipEvent) => void;
|
|
88
|
+
/**
|
|
89
|
+
* Fires when the Tooltip is hidden.
|
|
90
|
+
*/
|
|
91
|
+
onClose?: (event: TooltipEvent) => void;
|
|
92
|
+
/**
|
|
93
|
+
* Represents a callback function which determines if a Tooltip will be displayed ([see example]({% slug filter_elements_tooltip %})).
|
|
94
|
+
*/
|
|
95
|
+
filter?: (target: HTMLElement) => void;
|
|
96
|
+
/**
|
|
97
|
+
* The milliseconds interval on which the Tooltip will check for title change. By default the Tooltip does not track for title updates.
|
|
98
|
+
*/
|
|
99
|
+
updateInterval?: number;
|
|
100
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import { DefineComponent } from 'vue';
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
import * as Vue from 'vue';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
type Vue2type = Vue.default;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
*/
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
import { RecordPropsDefinition, ComponentOptions } from 'vue/types/options';
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
export { DefineComponent, RecordPropsDefinition, ComponentOptions, Vue2type };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TooltipPosition } from './utils';
|
|
2
|
+
export interface TooltipEvent {
|
|
3
|
+
event: any;
|
|
4
|
+
}
|
|
5
|
+
export interface TooltipPositionEvent {
|
|
6
|
+
/**
|
|
7
|
+
* The Tooltip element. Useful to get the actual `width` and `height` of rendered Tooltip.
|
|
8
|
+
*/
|
|
9
|
+
element: HTMLDivElement;
|
|
10
|
+
/**
|
|
11
|
+
* The current target element. Useful to calculate `top` and `left` position of the Tooltip element.
|
|
12
|
+
*/
|
|
13
|
+
targetElement: HTMLElement | null;
|
|
14
|
+
/**
|
|
15
|
+
* The current mouse `top` position;
|
|
16
|
+
*/
|
|
17
|
+
mouseTop: number;
|
|
18
|
+
/**
|
|
19
|
+
* The current mouse `left` position.
|
|
20
|
+
*/
|
|
21
|
+
mouseLeft: number;
|
|
22
|
+
/**
|
|
23
|
+
* The Tooltip anchor element prop.
|
|
24
|
+
*/
|
|
25
|
+
anchorElement?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The Tooltip position prop.
|
|
28
|
+
*/
|
|
29
|
+
position?: TooltipPosition;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Tooltip, TooltipVue2 } from './Tooltip';
|
|
2
|
+
import { TooltipProps } from './TooltipProps';
|
|
3
|
+
import { TooltipEvent, TooltipPositionEvent } from './events';
|
|
4
|
+
import { TooltipPosition } from './utils';
|
|
5
|
+
export { Tooltip, TooltipVue2, TooltipEvent, TooltipPositionEvent, TooltipProps, TooltipPosition };
|
package/dist/esm/main.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
*/
|
|
4
|
+
export var packageMetadata = {
|
|
5
|
+
name: '@progress/kendo-vue-tooltip',
|
|
6
|
+
productName: 'Kendo UI for Vue',
|
|
7
|
+
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
+
publishDate: 1660124458,
|
|
9
|
+
version: '',
|
|
10
|
+
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'
|
|
11
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
*/
|
|
4
|
+
export declare type TooltipPosition = 'right' | 'left' | 'bottom' | 'top' | 'auto';
|
|
5
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
*/
|
|
8
|
+
export declare const getLeftPosition: (left: any, elementWidth: any, targetElement: any, anchorElement: any, position: any) => any;
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export declare const getTopPosition: (top: any, targetElement: any, elementHeight: any, anchorElement: any, position: any) => any;
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
export declare const getDomRect: (currentTarget: any) => any;
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
export declare const toolTipSelectors: string[];
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
export declare const isTooltipElement: (element: any) => boolean;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var arrowWidth = 10;
|
|
2
|
+
var arrowHeight = 10;
|
|
3
|
+
/**
|
|
4
|
+
* @hidden
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export var getLeftPosition = function getLeftPosition(left, elementWidth, targetElement, anchorElement, position) {
|
|
8
|
+
switch (position) {
|
|
9
|
+
case 'bottom':
|
|
10
|
+
return anchorElement === 'pointer' ? left - elementWidth / 2 : targetElement.left - elementWidth / 2 + targetElement.width / 2;
|
|
11
|
+
|
|
12
|
+
case 'left':
|
|
13
|
+
return anchorElement === 'pointer' ? left - elementWidth - arrowWidth : targetElement.left - elementWidth - arrowWidth;
|
|
14
|
+
|
|
15
|
+
case 'right':
|
|
16
|
+
return anchorElement === 'pointer' ? left + arrowWidth : targetElement.right + arrowWidth;
|
|
17
|
+
|
|
18
|
+
case 'top':
|
|
19
|
+
return anchorElement === 'pointer' ? left - elementWidth / 2 : targetElement.left - elementWidth / 2 + targetElement.width / 2;
|
|
20
|
+
|
|
21
|
+
default:
|
|
22
|
+
if (anchorElement === 'pointer') {
|
|
23
|
+
return left < window.screen.availWidth / 2 ? left - arrowWidth : left - elementWidth + arrowWidth;
|
|
24
|
+
} else {
|
|
25
|
+
return left < window.screen.availWidth / 2 ? targetElement.left : targetElement.right - elementWidth;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* @hidden
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
export var getTopPosition = function getTopPosition(top, targetElement, elementHeight, anchorElement, position) {
|
|
35
|
+
switch (position) {
|
|
36
|
+
case 'bottom':
|
|
37
|
+
return anchorElement === 'pointer' ? top + arrowHeight : targetElement.bottom + arrowHeight;
|
|
38
|
+
|
|
39
|
+
case 'left':
|
|
40
|
+
return anchorElement === 'pointer' ? top - elementHeight / 2 : targetElement.top - elementHeight / 2 + targetElement.height / 2;
|
|
41
|
+
|
|
42
|
+
case 'right':
|
|
43
|
+
return anchorElement === 'pointer' ? top - elementHeight / 2 : targetElement.top - elementHeight / 2 + targetElement.height / 2;
|
|
44
|
+
|
|
45
|
+
case 'top':
|
|
46
|
+
return anchorElement === 'pointer' ? top - elementHeight - arrowHeight : targetElement.top - elementHeight - arrowHeight;
|
|
47
|
+
|
|
48
|
+
default:
|
|
49
|
+
if (anchorElement === 'pointer') {
|
|
50
|
+
return top < window.innerHeight / 2 ? top + arrowWidth : top - elementHeight - arrowWidth;
|
|
51
|
+
} else {
|
|
52
|
+
return top < window.innerHeight / 2 ? targetElement.bottom + arrowHeight : targetElement.top - elementHeight - arrowHeight;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* @hidden
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
export var getDomRect = function getDomRect(currentTarget) {
|
|
62
|
+
if (currentTarget !== null) {
|
|
63
|
+
return currentTarget.getBoundingClientRect();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return document.body.getBoundingClientRect();
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* @hidden
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
export var toolTipSelectors = ['k-tooltip-content', 'k-animation-container', 'k-tooltip', 'k-tooltip-title', 'k-tooltip k-tooltip-closable', 'k-icon k-i-close'];
|
|
73
|
+
/**
|
|
74
|
+
* @hidden
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
export var isTooltipElement = function isTooltipElement(element) {
|
|
78
|
+
if (element === null) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
var node = element;
|
|
83
|
+
|
|
84
|
+
while (node) {
|
|
85
|
+
if (node !== null && node.classList && node.classList.contains('k-tooltip')) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
node.parentNode !== null ? node = node.parentNode : node = false;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return toolTipSelectors.filter(function (t) {
|
|
93
|
+
return t === element.className;
|
|
94
|
+
}).length > 0;
|
|
95
|
+
};
|
package/dist/npm/Tooltip.js
CHANGED
|
@@ -121,13 +121,13 @@ var TooltipVue2 = {
|
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
created: function created() {
|
|
124
|
-
kendo_vue_common_1.validatePackage(package_metadata_1.packageMetadata);
|
|
124
|
+
(0, kendo_vue_common_1.validatePackage)(package_metadata_1.packageMetadata);
|
|
125
125
|
this.top = 0;
|
|
126
126
|
this.left = 0;
|
|
127
127
|
this.willOpen = false;
|
|
128
128
|
},
|
|
129
129
|
mounted: function mounted() {
|
|
130
|
-
this.element = kendo_vue_common_1.getRef(this, 'element');
|
|
130
|
+
this.element = (0, kendo_vue_common_1.getRef)(this, 'element');
|
|
131
131
|
|
|
132
132
|
if (document) {
|
|
133
133
|
document.body.addEventListener('mousemove', this.handleBodyMousemove);
|
|
@@ -147,7 +147,7 @@ var TooltipVue2 = {
|
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
this.element = kendo_vue_common_1.getRef(this, 'element');
|
|
150
|
+
this.element = (0, kendo_vue_common_1.getRef)(this, 'element');
|
|
151
151
|
|
|
152
152
|
if (!this.element) {
|
|
153
153
|
return;
|
|
@@ -185,7 +185,7 @@ var TooltipVue2 = {
|
|
|
185
185
|
// @ts-ignore
|
|
186
186
|
render: function render(createElement) {
|
|
187
187
|
var h = gh || createElement;
|
|
188
|
-
var defaultSlot = kendo_vue_common_1.getDefaultSlots(this);
|
|
188
|
+
var defaultSlot = (0, kendo_vue_common_1.getDefaultSlots)(this);
|
|
189
189
|
var currentZIndex = this.getCurrentZIndex();
|
|
190
190
|
var content = this.$props.content ? kendo_vue_common_1.templateRendering.call(this, this.$props.content, kendo_vue_common_1.getListeners.call(this)) : undefined;
|
|
191
191
|
var contentDefaultRendering = this.title;
|
|
@@ -199,17 +199,17 @@ var TooltipVue2 = {
|
|
|
199
199
|
}
|
|
200
200
|
});
|
|
201
201
|
var innerToolTip = this.computedOpen && h("div", {
|
|
202
|
-
"class": kendo_vue_common_1.classNames('k-tooltip', this.$props.tooltipClassName),
|
|
202
|
+
"class": (0, kendo_vue_common_1.classNames)('k-tooltip', this.$props.tooltipClassName),
|
|
203
203
|
style: __assign({
|
|
204
204
|
position: 'relative'
|
|
205
205
|
}, this.$props.tooltipStyle)
|
|
206
206
|
}, [h("div", {
|
|
207
207
|
"class": "k-tooltip-content"
|
|
208
208
|
}, [contentRendering]), this.$props.showCallout && h("div", {
|
|
209
|
-
ref: kendo_vue_common_1.setRef(this, 'callout')
|
|
209
|
+
ref: (0, kendo_vue_common_1.setRef)(this, 'callout')
|
|
210
210
|
})]);
|
|
211
211
|
var tooltip = this.computedTarget && this.title && this.computedTarget.ownerDocument && h("div", {
|
|
212
|
-
ref: kendo_vue_common_1.setRef(this, 'element'),
|
|
212
|
+
ref: (0, kendo_vue_common_1.setRef)(this, 'element'),
|
|
213
213
|
"class": this.wrapperClass,
|
|
214
214
|
style: __assign({
|
|
215
215
|
zIndex: currentZIndex
|
|
@@ -251,7 +251,7 @@ var TooltipVue2 = {
|
|
|
251
251
|
var element = currentDocument && currentDocument.elementFromPoint(event.clientX, event.clientY);
|
|
252
252
|
this.willOpen = false;
|
|
253
253
|
|
|
254
|
-
if (utils_1.isTooltipElement(element) || this.computedTarget !== event.target) {
|
|
254
|
+
if ((0, utils_1.isTooltipElement)(element) || this.computedTarget !== event.target) {
|
|
255
255
|
return;
|
|
256
256
|
}
|
|
257
257
|
|
|
@@ -265,7 +265,7 @@ var TooltipVue2 = {
|
|
|
265
265
|
handleMouseOver: function handleMouseOver(event) {
|
|
266
266
|
var target = event.target;
|
|
267
267
|
|
|
268
|
-
if (!this.isVisible(target) || utils_1.isTooltipElement(target) || target === this.computedTarget) {
|
|
268
|
+
if (!this.isVisible(target) || (0, utils_1.isTooltipElement)(target) || target === this.computedTarget) {
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
271
|
|
|
@@ -392,9 +392,9 @@ var TooltipVue2 = {
|
|
|
392
392
|
},
|
|
393
393
|
setPosition: function setPosition(element) {
|
|
394
394
|
var target = this.parentTitle ? this.getTitle(this.computedTarget).element : this.computedTarget;
|
|
395
|
-
var domRect = utils_1.getDomRect(target);
|
|
396
|
-
var left = utils_1.getLeftPosition(this.left, element.offsetWidth, domRect, this.$props.anchorElement, this.$props.position);
|
|
397
|
-
var top = utils_1.getTopPosition(this.top, domRect, element.offsetHeight, this.$props.anchorElement, this.$props.position);
|
|
395
|
+
var domRect = (0, utils_1.getDomRect)(target);
|
|
396
|
+
var left = (0, utils_1.getLeftPosition)(this.left, element.offsetWidth, domRect, this.$props.anchorElement, this.$props.position);
|
|
397
|
+
var top = (0, utils_1.getTopPosition)(this.top, domRect, element.offsetHeight, this.$props.anchorElement, this.$props.position);
|
|
398
398
|
return {
|
|
399
399
|
left: left,
|
|
400
400
|
top: top
|
|
@@ -8,7 +8,7 @@ exports.packageMetadata = {
|
|
|
8
8
|
name: '@progress/kendo-vue-tooltip',
|
|
9
9
|
productName: 'Kendo UI for Vue',
|
|
10
10
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
11
|
-
publishDate:
|
|
11
|
+
publishDate: 1660124458,
|
|
12
12
|
version: '',
|
|
13
13
|
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'
|
|
14
14
|
};
|
package/dist/npm/utils.js
CHANGED
|
@@ -10,7 +10,7 @@ var arrowHeight = 10;
|
|
|
10
10
|
* @hidden
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
var getLeftPosition = function getLeftPosition(left, elementWidth, targetElement, anchorElement, position) {
|
|
14
14
|
switch (position) {
|
|
15
15
|
case 'bottom':
|
|
16
16
|
return anchorElement === 'pointer' ? left - elementWidth / 2 : targetElement.left - elementWidth / 2 + targetElement.width / 2;
|
|
@@ -33,12 +33,13 @@ exports.getLeftPosition = function (left, elementWidth, targetElement, anchorEle
|
|
|
33
33
|
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
+
|
|
37
|
+
exports.getLeftPosition = getLeftPosition;
|
|
36
38
|
/**
|
|
37
39
|
* @hidden
|
|
38
40
|
*/
|
|
39
41
|
|
|
40
|
-
|
|
41
|
-
exports.getTopPosition = function (top, targetElement, elementHeight, anchorElement, position) {
|
|
42
|
+
var getTopPosition = function getTopPosition(top, targetElement, elementHeight, anchorElement, position) {
|
|
42
43
|
switch (position) {
|
|
43
44
|
case 'bottom':
|
|
44
45
|
return anchorElement === 'pointer' ? top + arrowHeight : targetElement.bottom + arrowHeight;
|
|
@@ -61,29 +62,31 @@ exports.getTopPosition = function (top, targetElement, elementHeight, anchorElem
|
|
|
61
62
|
|
|
62
63
|
}
|
|
63
64
|
};
|
|
65
|
+
|
|
66
|
+
exports.getTopPosition = getTopPosition;
|
|
64
67
|
/**
|
|
65
68
|
* @hidden
|
|
66
69
|
*/
|
|
67
70
|
|
|
68
|
-
|
|
69
|
-
exports.getDomRect = function (currentTarget) {
|
|
71
|
+
var getDomRect = function getDomRect(currentTarget) {
|
|
70
72
|
if (currentTarget !== null) {
|
|
71
73
|
return currentTarget.getBoundingClientRect();
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
return document.body.getBoundingClientRect();
|
|
75
77
|
};
|
|
78
|
+
|
|
79
|
+
exports.getDomRect = getDomRect;
|
|
76
80
|
/**
|
|
77
81
|
* @hidden
|
|
78
82
|
*/
|
|
79
83
|
|
|
80
|
-
|
|
81
84
|
exports.toolTipSelectors = ['k-tooltip-content', 'k-animation-container', 'k-tooltip', 'k-tooltip-title', 'k-tooltip k-tooltip-closable', 'k-icon k-i-close'];
|
|
82
85
|
/**
|
|
83
86
|
* @hidden
|
|
84
87
|
*/
|
|
85
88
|
|
|
86
|
-
|
|
89
|
+
var isTooltipElement = function isTooltipElement(element) {
|
|
87
90
|
if (element === null) {
|
|
88
91
|
return false;
|
|
89
92
|
}
|
|
@@ -101,4 +104,6 @@ exports.isTooltipElement = function (element) {
|
|
|
101
104
|
return exports.toolTipSelectors.filter(function (t) {
|
|
102
105
|
return t === element.className;
|
|
103
106
|
}).length > 0;
|
|
104
|
-
};
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
exports.isTooltipElement = isTooltipElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-vue-tooltip",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1-dev.202208100944",
|
|
4
4
|
"description": "Kendo UI for Vue Tooltip package",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"vue": "^2.6.12 || ^3.0.2"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@progress/kendo-vue-common": "3.5.
|
|
36
|
+
"@progress/kendo-vue-common": "3.5.1-dev.202208100944"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@progress/kendo-licensing": "^1.0.1",
|
|
40
|
-
"@progress/kendo-vue-buttons": "3.5.
|
|
41
|
-
"@progress/kendo-vue-dialogs": "3.5.
|
|
42
|
-
"@progress/kendo-vue-grid": "3.5.
|
|
43
|
-
"@progress/kendo-vue-intl": "3.5.
|
|
40
|
+
"@progress/kendo-vue-buttons": "3.5.1-dev.202208100944",
|
|
41
|
+
"@progress/kendo-vue-dialogs": "3.5.1-dev.202208100944",
|
|
42
|
+
"@progress/kendo-vue-grid": "3.5.1-dev.202208100944",
|
|
43
|
+
"@progress/kendo-vue-intl": "3.5.1-dev.202208100944"
|
|
44
44
|
},
|
|
45
45
|
"@progress": {
|
|
46
46
|
"friendlyName": "Tooltip",
|