@zeit-ui/vue
Version:
A popular UI framework for Vue
2 lines • 22.5 kB
JavaScript
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["tooltip"]=t():e["tooltip"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({"7f35":function(e,t,n){},9652:function(e,t,n){"use strict";var r=n("7f35"),o=n.n(r);o.a},f6fd:function(e,t){(function(e){var t="currentScript",n=e.getElementsByTagName("script");t in e||Object.defineProperty(e,t,{get:function(){try{throw new Error}catch(r){var e,t=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(r.stack)||[!1])[1];for(e in n)if(n[e].src==t||"interactive"==n[e].readyState)return n[e];return null}}})})(document)},fb15:function(e,t,n){"use strict";var r;(n.r(t),"undefined"!==typeof window)&&(n("f6fd"),(r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=r[1]));var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"host",staticClass:"zi-tooltip",on:{mousemove:function(t){return e.toggle(!0)},mouseleave:function(t){return e.toggle(!1)},click:function(t){return t.stopPropagation(),e.clickHandler(t)}}},[e._t("default"),n("div",{ref:"inner",staticClass:"zi-tooltip-box",class:{visible:e.visible}},[n("div",{ref:"arrow",staticClass:"zi-tooltip-arrow"}),n("div",{staticClass:"zi-tooltip-inner"},[e.hasSlot?[e._t("content")]:[e._v(e._s(e.content))]],2)])],2)},i=[];function a(e){var t=e.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left,x:t.left,y:t.top}}function s(e){if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t?t.defaultView:window}return e}function c(e){var t=s(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function f(e){var t=s(e).Element;return e instanceof t||e instanceof Element}function u(e){var t=s(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function p(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function l(e){return e!==s(e)&&u(e)?p(e):c(e)}function d(e){return e?(e.nodeName||"").toLowerCase():null}function m(e){return(f(e)?e.ownerDocument:e.document).documentElement}function h(e){return a(m(e)).left+c(e).scrollLeft}function v(e){return s(e).getComputedStyle(e)}function b(e){var t=v(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function g(e,t,n){void 0===n&&(n=!1);var r=m(t),o=a(e),i=u(t),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(i||!i&&!n)&&(("body"!==d(t)||b(r))&&(s=l(t)),u(t)?(c=a(t),c.x+=t.clientLeft,c.y+=t.clientTop):r&&(c.x=h(r))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function y(e){return{x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}}function O(e){return"html"===d(e)?e:e.assignedSlot||e.parentNode||e.host||m(e)}function x(e){return["html","body","#document"].indexOf(d(e))>=0?e.ownerDocument.body:u(e)&&b(e)?e:x(O(e))}function w(e,t){void 0===t&&(t=[]);var n=x(e),r="body"===d(n),o=s(n),i=r?[o].concat(o.visualViewport||[],b(n)?n:[]):n,a=t.concat(i);return r?a:a.concat(w(O(i)))}function j(e){return["table","td","th"].indexOf(d(e))>=0}function E(e){return u(e)&&"fixed"!==v(e).position?e.offsetParent:null}function M(e){var t=O(e);while(u(t)&&["html","body"].indexOf(d(t))<0){var n=v(t);if("none"!==n.transform||"none"!==n.perspective||"auto"!==n.willChange)return t;t=t.parentNode}return null}function _(e){var t=s(e),n=E(e);while(n&&j(n)&&"static"===v(n).position)n=E(n);return n&&"body"===d(n)&&"static"===v(n).position?t:n||M(e)||t}var k="top",D="bottom",P="right",S="left",T="auto",L=[k,D,P,S],C="start",B="end",A="clippingParents",R="viewport",W="popper",H="reference",N=L.reduce((function(e,t){return e.concat([t+"-"+C,t+"-"+B])}),[]),$=[].concat(L,[T]).reduce((function(e,t){return e.concat([t,t+"-"+C,t+"-"+B])}),[]),q="beforeRead",z="read",V="afterRead",I="beforeMain",U="main",X="afterMain",F="beforeWrite",Y="write",G="afterWrite",J=[q,z,V,I,U,X,F,Y,G];function K(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name);var i=[].concat(e.requires||[],e.requiresIfExists||[]);i.forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function Q(e){var t=K(e);return J.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}function Z(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}function ee(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign(Object.assign(Object.assign({},n),t),{},{options:Object.assign(Object.assign({},n.options),t.options),data:Object.assign(Object.assign({},n.data),t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}var te={placement:"bottom",modifiers:[],strategy:"absolute"};function ne(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"===typeof e.getBoundingClientRect)}))}function re(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,i=void 0===o?te:o;return function(e,t,n){void 0===n&&(n=i);var o={placement:"bottom",orderedModifiers:[],options:Object.assign(Object.assign({},te),i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},a=[],s=!1,c={state:o,setOptions:function(n){p(),o.options=Object.assign(Object.assign(Object.assign({},i),o.options),n),o.scrollParents={reference:f(e)?w(e):e.contextElement?w(e.contextElement):[],popper:w(t)};var a=Q(ee([].concat(r,o.options.modifiers)));return o.orderedModifiers=a.filter((function(e){return e.enabled})),u(),c.update()},forceUpdate:function(){if(!s){var e=o.elements,t=e.reference,n=e.popper;if(ne(t,n)){o.rects={reference:g(t,_(n),"fixed"===o.options.strategy),popper:y(n)},o.reset=!1,o.placement=o.options.placement,o.orderedModifiers.forEach((function(e){return o.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<o.orderedModifiers.length;r++)if(!0!==o.reset){var i=o.orderedModifiers[r],a=i.fn,f=i.options,u=void 0===f?{}:f,p=i.name;"function"===typeof a&&(o=a({state:o,options:u,name:p,instance:c})||o)}else o.reset=!1,r=-1}}},update:Z((function(){return new Promise((function(e){c.forceUpdate(),e(o)}))})),destroy:function(){p(),s=!0}};if(!ne(e,t))return c;function u(){o.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"===typeof i){var s=i({state:o,name:t,instance:c,options:r}),f=function(){};a.push(s||f)}}))}function p(){a.forEach((function(e){return e()})),a=[]}return c.setOptions(n).then((function(e){!s&&n.onFirstUpdate&&n.onFirstUpdate(e)})),c}}var oe={passive:!0};function ie(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,a=r.resize,c=void 0===a||a,f=s(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach((function(e){e.addEventListener("scroll",n.update,oe)})),c&&f.addEventListener("resize",n.update,oe),function(){i&&u.forEach((function(e){e.removeEventListener("scroll",n.update,oe)})),c&&f.removeEventListener("resize",n.update,oe)}}var ae={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:ie,data:{}};function se(e){return e.split("-")[0]}function ce(e){return e.split("-")[1]}function fe(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ue(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?se(o):null,a=o?ce(o):null,s=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(i){case k:t={x:s,y:n.y-r.height};break;case D:t={x:s,y:n.y+n.height};break;case P:t={x:n.x+n.width,y:c};break;case S:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var f=i?fe(i):null;if(null!=f){var u="y"===f?"height":"width";switch(a){case C:t[f]=Math.floor(t[f])-Math.floor(n[u]/2-r[u]/2);break;case B:t[f]=Math.floor(t[f])+Math.ceil(n[u]/2-r[u]/2);break;default:}}return t}function pe(e){var t=e.state,n=e.name;t.modifiersData[n]=ue({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var le={name:"popperOffsets",enabled:!0,phase:"read",fn:pe,data:{}},de={top:"auto",right:"auto",bottom:"auto",left:"auto"};function me(e){var t=e.x,n=e.y,r=window,o=r.devicePixelRatio||1;return{x:Math.round(t*o)/o||0,y:Math.round(n*o)/o||0}}function he(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.offsets,a=e.position,c=e.gpuAcceleration,f=e.adaptive,u=me(i),p=u.x,l=u.y,d=i.hasOwnProperty("x"),h=i.hasOwnProperty("y"),v=S,b=k,g=window;if(f){var y=_(n);y===s(n)&&(y=m(n)),o===k&&(b=D,l-=y.clientHeight-r.height,l*=c?1:-1),o===S&&(v=P,p-=y.clientWidth-r.width,p*=c?1:-1)}var O,x=Object.assign({position:a},f&&de);return c?Object.assign(Object.assign({},x),{},(O={},O[b]=h?"0":"",O[v]=d?"0":"",O.transform=(g.devicePixelRatio||1)<2?"translate("+p+"px, "+l+"px)":"translate3d("+p+"px, "+l+"px, 0)",O)):Object.assign(Object.assign({},x),{},(t={},t[b]=h?l+"px":"",t[v]=d?p+"px":"",t.transform="",t))}function ve(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,a=void 0===i||i,s={placement:se(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign(Object.assign({},t.styles.popper),he(Object.assign(Object.assign({},s),{},{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign(Object.assign({},t.styles.arrow),he(Object.assign(Object.assign({},s),{},{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1})))),t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-placement":t.placement})}var be={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ve,data:{}};function ge(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];u(o)&&d(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))}function ye(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]),a=i.reduce((function(e,t){return e[t]="",e}),{});u(r)&&d(r)&&(Object.assign(r.style,a),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}}var Oe={name:"applyStyles",enabled:!0,phase:"write",fn:ge,effect:ye,requires:["computeStyles"]};function xe(e,t,n){var r=se(e),o=[S,k].indexOf(r)>=0?-1:1,i="function"===typeof n?n(Object.assign(Object.assign({},t),{},{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[S,P].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function we(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,a=$.reduce((function(e,n){return e[n]=xe(n,t.rects,i),e}),{}),s=a[t.placement],c=s.x,f=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=f),t.modifiersData[r]=a}var je={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:we},Ee={left:"right",right:"left",bottom:"top",top:"bottom"};function Me(e){return e.replace(/left|right|bottom|top/g,(function(e){return Ee[e]}))}var _e={start:"end",end:"start"};function ke(e){return e.replace(/start|end/g,(function(e){return _e[e]}))}function De(e){var t=s(e),n=m(e),r=t.visualViewport,o=n.clientWidth,i=n.clientHeight,a=0,c=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,c=r.offsetTop)),{width:o,height:i,x:a+h(e),y:c}}function Pe(e){var t=m(e),n=c(e),r=e.ownerDocument.body,o=Math.max(t.scrollWidth,t.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),i=Math.max(t.scrollHeight,t.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-n.scrollLeft+h(e),s=-n.scrollTop;return"rtl"===v(r||t).direction&&(a+=Math.max(t.clientWidth,r?r.clientWidth:0)-o),{width:o,height:i,x:a,y:s}}function Se(e,t){var n=Boolean(t.getRootNode&&t.getRootNode().host);if(e.contains(t))return!0;if(n){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Te(e){return Object.assign(Object.assign({},e),{},{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Le(e){var t=a(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function Ce(e,t){return t===R?Te(De(e)):u(t)?Le(t):Te(Pe(m(e)))}function Be(e){var t=w(e),n=["absolute","fixed"].indexOf(v(e).position)>=0,r=n&&u(e)?_(e):e;return f(r)?t.filter((function(e){return f(e)&&Se(e,r)})):[]}function Ae(e,t,n){var r="clippingParents"===t?Be(e):[].concat(t),o=[].concat(r,[n]),i=o[0],a=o.reduce((function(t,n){var r=Ce(e,n);return t.top=Math.max(r.top,t.top),t.right=Math.min(r.right,t.right),t.bottom=Math.min(r.bottom,t.bottom),t.left=Math.max(r.left,t.left),t}),Ce(e,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Re(){return{top:0,right:0,bottom:0,left:0}}function We(e){return Object.assign(Object.assign({},Re()),e)}function He(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function Ne(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.boundary,s=void 0===i?A:i,c=n.rootBoundary,u=void 0===c?R:c,p=n.elementContext,l=void 0===p?W:p,d=n.altBoundary,h=void 0!==d&&d,v=n.padding,b=void 0===v?0:v,g=We("number"!==typeof b?b:He(b,L)),y=l===W?H:W,O=e.elements.reference,x=e.rects.popper,w=e.elements[h?y:l],j=Ae(f(w)?w:w.contextElement||m(e.elements.popper),s,u),E=a(O),M=ue({reference:E,element:x,strategy:"absolute",placement:o}),_=Te(Object.assign(Object.assign({},x),M)),S=l===W?_:E,T={top:j.top-S.top+g.top,bottom:S.bottom-j.bottom+g.bottom,left:j.left-S.left+g.left,right:S.right-j.right+g.right},C=e.modifiersData.offset;if(l===W&&C){var B=C[o];Object.keys(T).forEach((function(e){var t=[P,D].indexOf(e)>=0?1:-1,n=[k,D].indexOf(e)>=0?"y":"x";T[e]+=B[n]*t}))}return T}function $e(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,f=void 0===c?$:c,u=ce(r),p=(u?s?N:N.filter((function(e){return ce(e)===u})):L).filter((function(e){return f.indexOf(e)>=0})),l=p.reduce((function(t,n){return t[n]=Ne(e,{placement:n,boundary:o,rootBoundary:i,padding:a})[se(n)],t}),{});return Object.keys(l).sort((function(e,t){return l[e]-l[t]}))}function qe(e){if(se(e)===T)return[];var t=Me(e);return[ke(e),t,ke(t)]}function ze(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,f=n.padding,u=n.boundary,p=n.rootBoundary,l=n.altBoundary,d=n.flipVariations,m=void 0===d||d,h=n.allowedAutoPlacements,v=t.options.placement,b=se(v),g=b===v,y=c||(g||!m?[Me(v)]:qe(v)),O=[v].concat(y).reduce((function(e,n){return e.concat(se(n)===T?$e(t,{placement:n,boundary:u,rootBoundary:p,padding:f,flipVariations:m,allowedAutoPlacements:h}):n)}),[]),x=t.rects.reference,w=t.rects.popper,j=new Map,E=!0,M=O[0],_=0;_<O.length;_++){var L=O[_],B=se(L),A=ce(L)===C,R=[k,D].indexOf(B)>=0,W=R?"width":"height",H=Ne(t,{placement:L,boundary:u,rootBoundary:p,altBoundary:l,padding:f}),N=R?A?P:S:A?D:k;x[W]>w[W]&&(N=Me(N));var $=Me(N),q=[];if(i&&q.push(H[B]<=0),s&&q.push(H[N]<=0,H[$]<=0),q.every((function(e){return e}))){M=L,E=!1;break}j.set(L,q)}if(E)for(var z=m?3:1,V=function(e){var t=O.find((function(t){var n=j.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return M=t,"break"},I=z;I>0;I--){var U=V(I);if("break"===U)break}t.placement!==M&&(t.modifiersData[r]._skip=!0,t.placement=M,t.reset=!0)}}var Ve={name:"flip",enabled:!0,phase:"main",fn:ze,requiresIfExists:["offset"],data:{_skip:!1}};function Ie(e){return"x"===e?"y":"x"}function Ue(e,t,n){return Math.max(e,Math.min(t,n))}function Xe(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,a=n.altAxis,s=void 0!==a&&a,c=n.boundary,f=n.rootBoundary,u=n.altBoundary,p=n.padding,l=n.tether,d=void 0===l||l,m=n.tetherOffset,h=void 0===m?0:m,v=Ne(t,{boundary:c,rootBoundary:f,padding:p,altBoundary:u}),b=se(t.placement),g=ce(t.placement),O=!g,x=fe(b),w=Ie(x),j=t.modifiersData.popperOffsets,E=t.rects.reference,M=t.rects.popper,T="function"===typeof h?h(Object.assign(Object.assign({},t.rects),{},{placement:t.placement})):h,L={x:0,y:0};if(j){if(i){var B="y"===x?k:S,A="y"===x?D:P,R="y"===x?"height":"width",W=j[x],H=j[x]+v[B],N=j[x]-v[A],$=d?-M[R]/2:0,q=g===C?E[R]:M[R],z=g===C?-M[R]:-E[R],V=t.elements.arrow,I=d&&V?y(V):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Re(),X=U[B],F=U[A],Y=Ue(0,E[R],I[R]),G=O?E[R]/2-$-Y-X-T:q-Y-X-T,J=O?-E[R]/2+$+Y+F+T:z+Y+F+T,K=t.elements.arrow&&_(t.elements.arrow),Q=K?"y"===x?K.clientTop||0:K.clientLeft||0:0,Z=t.modifiersData.offset?t.modifiersData.offset[t.placement][x]:0,ee=j[x]+G-Z-Q,te=j[x]+J-Z,ne=Ue(d?Math.min(H,ee):H,W,d?Math.max(N,te):N);j[x]=ne,L[x]=ne-W}if(s){var re="x"===x?k:S,oe="x"===x?D:P,ie=j[w],ae=ie+v[re],ue=ie-v[oe],pe=Ue(ae,ie,ue);j[w]=pe,L[w]=pe-ie}t.modifiersData[r]=L}}var Fe={name:"preventOverflow",enabled:!0,phase:"main",fn:Xe,requiresIfExists:["offset"]};function Ye(e){var t,n=e.state,r=e.name,o=n.elements.arrow,i=n.modifiersData.popperOffsets,a=se(n.placement),s=fe(a),c=[S,P].indexOf(a)>=0,f=c?"height":"width";if(o&&i){var u=n.modifiersData[r+"#persistent"].padding,p=y(o),l="y"===s?k:S,d="y"===s?D:P,m=n.rects.reference[f]+n.rects.reference[s]-i[s]-n.rects.popper[f],h=i[s]-n.rects.reference[s],v=_(o),b=v?"y"===s?v.clientHeight||0:v.clientWidth||0:0,g=m/2-h/2,O=u[l],x=b-p[f]-u[d],w=b/2-p[f]/2+g,j=Ue(O,w,x),E=s;n.modifiersData[r]=(t={},t[E]=j,t.centerOffset=j-w,t)}}function Ge(e){var t=e.state,n=e.options,r=e.name,o=n.element,i=void 0===o?"[data-popper-arrow]":o,a=n.padding,s=void 0===a?0:a;null!=i&&("string"!==typeof i||(i=t.elements.popper.querySelector(i),i))&&Se(t.elements.popper,i)&&(t.elements.arrow=i,t.modifiersData[r+"#persistent"]={padding:We("number"!==typeof s?s:He(s,L))})}var Je={name:"arrow",enabled:!0,phase:"main",fn:Ye,effect:Ge,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ke(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Qe(e){return[k,P,D,S].some((function(t){return e[t]>=0}))}function Ze(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=Ne(t,{elementContext:"reference"}),s=Ne(t,{altBoundary:!0}),c=Ke(a,r),f=Ke(s,o,i),u=Qe(c),p=Qe(f);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:f,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign(Object.assign({},t.attributes.popper),{},{"data-popper-reference-hidden":u,"data-popper-escaped":p})}var et={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ze},tt=[ae,le,be,Oe,je,Ve,Fe,Je,et],nt=re({defaultModifiers:tt}),rt=function(e){return function(t){return!!Array.isArray(e)&&!!e.find((function(e){return e===t}))}},ot={name:"zi-tooltip",data:function(){return{visible:!1}},props:{content:String,placement:{type:String,default:"bottom",validator:rt(["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"])},clickable:Boolean,delay:Number},computed:{hasSlot:function(){return!!this.$slots.content}},mounted:function(){nt(this.$refs.host,this.$refs.inner,{placement:this.placement,modifiers:[{name:"arrow",options:{element:this.$refs.arrow}},{name:"offset",options:{offset:[0,8]}}]})},beforeDestroy:function(){document.removeEventListener("click",this.hide),clearTimeout(this.timer)},methods:{toggle:function(e){var t=this;if(!this.clickable){if(this.delay){var n=Number.isNaN(+this.delay)?0:+this.delay;return e&&(clearTimeout(this.timer),this.visible=!0),void(this.timer=setTimeout((function(){t.visible=!1,clearTimeout(t.timer)}),n))}this.visible=e}},clickHandler:function(){this.clickable&&(this.visible=!this.visible,document.removeEventListener("click",this.hide),this.visible&&document.addEventListener("click",this.hide))},hide:function(){this.visible=!1}}},it=ot;n("9652");function at(e,t,n,r,o,i,a,s){var c,f="function"===typeof e?e.options:e;if(t&&(f.render=t,f.staticRenderFns=n,f._compiled=!0),r&&(f.functional=!0),i&&(f._scopeId="data-v-"+i),a?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},f._ssrRegister=c):o&&(c=s?function(){o.call(this,this.$root.$options.shadowRoot)}:o),c)if(f.functional){f._injectStyles=c;var u=f.render;f.render=function(e,t){return c.call(t),u(e,t)}}else{var p=f.beforeCreate;f.beforeCreate=p?[].concat(p,c):[c]}return{exports:e,options:f}}var st=at(it,o,i,!1,null,null,null),ct=st.exports;ct.install=function(e){e.component(ct.name,ct)};var ft=ct;t["default"]=ft}})["default"]}));
//# sourceMappingURL=tooltip.umd.min.js.map