UNPKG

@yst/vue-hoverable

Version:

Lightweight Vue utility for listening to mouse hover

1 lines 12 kB
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=3)}([function(t,e,r){(function(t,r){var n=/^\[object .+?Constructor\]$/,o=/^(?:0|[1-9]\d*)$/,i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1;var u="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,a=u||c||Function("return this")(),f=e&&!e.nodeType&&e,l=f&&"object"==typeof r&&r&&!r.nodeType&&r,s=l&&l.exports===f,p=s&&u.process,v=function(){try{var t=l&&l.require&&l.require("util").types;return t||p&&p.binding&&p.binding("util")}catch(t){}}(),h=v&&v.isTypedArray;function y(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var d,_,b,j=Array.prototype,g=Function.prototype,m=Object.prototype,O=a["__core-js_shared__"],w=g.toString,A=m.hasOwnProperty,z=(d=/[^.]+$/.exec(O&&O.keys&&O.keys.IE_PROTO||""))?"Symbol(src)_1."+d:"",x=m.toString,S=w.call(Object),P=RegExp("^"+w.call(A).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=s?a.Buffer:void 0,M=a.Symbol,T=a.Uint8Array,$=F?F.allocUnsafe:void 0,U=(_=Object.getPrototypeOf,b=Object,function(t){return _(b(t))}),k=Object.create,E=m.propertyIsEnumerable,I=j.splice,B=M?M.toStringTag:void 0,D=function(){try{var t=ft(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),R=F?F.isBuffer:void 0,q=Math.max,C=Date.now,H=ft(a,"Map"),L=ft(Object,"create"),N=function(){function t(){}return function(e){if(!mt(e))return{};if(k)return k(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function G(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function V(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function W(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function J(t){var e=this.__data__=new V(t);this.size=e.size}function K(t,e){var r=dt(t),n=!r&&yt(t),o=!r&&!n&&bt(t),i=!r&&!n&&!o&&wt(t),u=r||n||o||i,c=u?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],a=c.length;for(var f in t)!e&&!A.call(t,f)||u&&("length"==f||o&&("offset"==f||"parent"==f)||i&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||lt(f,a))||c.push(f);return c}function Q(t,e,r){(void 0===r||ht(t[e],r))&&(void 0!==r||e in t)||Z(t,e,r)}function X(t,e,r){var n=t[e];A.call(t,e)&&ht(n,r)&&(void 0!==r||e in t)||Z(t,e,r)}function Y(t,e){for(var r=t.length;r--;)if(ht(t[r][0],e))return r;return-1}function Z(t,e,r){"__proto__"==e&&D?D(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}G.prototype.clear=function(){this.__data__=L?L(null):{},this.size=0},G.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},G.prototype.get=function(t){var e=this.__data__;if(L){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return A.call(e,t)?e[t]:void 0},G.prototype.has=function(t){var e=this.__data__;return L?void 0!==e[t]:A.call(e,t)},G.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=L&&void 0===e?"__lodash_hash_undefined__":e,this},V.prototype.clear=function(){this.__data__=[],this.size=0},V.prototype.delete=function(t){var e=this.__data__,r=Y(e,t);return!(r<0)&&(r==e.length-1?e.pop():I.call(e,r,1),--this.size,!0)},V.prototype.get=function(t){var e=this.__data__,r=Y(e,t);return r<0?void 0:e[r][1]},V.prototype.has=function(t){return Y(this.__data__,t)>-1},V.prototype.set=function(t,e){var r=this.__data__,n=Y(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},W.prototype.clear=function(){this.size=0,this.__data__={hash:new G,map:new(H||V),string:new G}},W.prototype.delete=function(t){var e=at(this,t).delete(t);return this.size-=e?1:0,e},W.prototype.get=function(t){return at(this,t).get(t)},W.prototype.has=function(t){return at(this,t).has(t)},W.prototype.set=function(t,e){var r=at(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},J.prototype.clear=function(){this.__data__=new V,this.size=0},J.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},J.prototype.get=function(t){return this.__data__.get(t)},J.prototype.has=function(t){return this.__data__.has(t)},J.prototype.set=function(t,e){var r=this.__data__;if(r instanceof V){var n=r.__data__;if(!H||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new W(n)}return r.set(t,e),this.size=r.size,this};var tt,et=function(t,e,r){for(var n=-1,o=Object(t),i=r(t),u=i.length;u--;){var c=i[tt?u:++n];if(!1===e(o[c],c,o))break}return t};function rt(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":B&&B in Object(t)?function(t){var e=A.call(t,B),r=t[B];try{t[B]=void 0;var n=!0}catch(t){}var o=x.call(t);n&&(e?t[B]=r:delete t[B]);return o}(t):function(t){return x.call(t)}(t)}function nt(t){return Ot(t)&&"[object Arguments]"==rt(t)}function ot(t){return!(!mt(t)||function(t){return!!z&&z in t}(t))&&(jt(t)?P:n).test(function(t){if(null!=t){try{return w.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function it(t){if(!mt(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=st(t),r=[];for(var n in t)("constructor"!=n||!e&&A.call(t,n))&&r.push(n);return r}function ut(t,e,r,n,o){t!==e&&et(e,(function(i,u){if(o||(o=new J),mt(i))!function(t,e,r,n,o,i,u){var c=pt(t,r),a=pt(e,r),f=u.get(a);if(f)return void Q(t,r,f);var l=i?i(c,a,r+"",t,e,u):void 0,s=void 0===l;if(s){var p=dt(a),v=!p&&bt(a),h=!p&&!v&&wt(a);l=a,p||v||h?dt(c)?l=c:Ot(j=c)&&_t(j)?l=function(t,e){var r=-1,n=t.length;e||(e=Array(n));for(;++r<n;)e[r]=t[r];return e}(c):v?(s=!1,l=function(t,e){if(e)return t.slice();var r=t.length,n=$?$(r):new t.constructor(r);return t.copy(n),n}(a,!0)):h?(s=!1,y=a,d=!0?(_=y.buffer,b=new _.constructor(_.byteLength),new T(b).set(new T(_)),b):y.buffer,l=new y.constructor(d,y.byteOffset,y.length)):l=[]:function(t){if(!Ot(t)||"[object Object]"!=rt(t))return!1;var e=U(t);if(null===e)return!0;var r=A.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&w.call(r)==S}(a)||yt(a)?(l=c,yt(c)?l=function(t){return function(t,e,r,n){var o=!r;r||(r={});var i=-1,u=e.length;for(;++i<u;){var c=e[i],a=n?n(r[c],t[c],c,r,t):void 0;void 0===a&&(a=t[c]),o?Z(r,c,a):X(r,c,a)}return r}(t,At(t))}(c):mt(c)&&!jt(c)||(l=function(t){return"function"!=typeof t.constructor||st(t)?{}:N(U(t))}(a))):s=!1}var y,d,_,b;var j;s&&(u.set(a,l),o(l,a,n,i,u),u.delete(a));Q(t,r,l)}(t,e,u,r,ut,n,o);else{var c=n?n(pt(t,u),i,u+"",t,e,o):void 0;void 0===c&&(c=i),Q(t,u,c)}}),At)}function ct(t,e){return vt(function(t,e,r){return e=q(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,i=q(n.length-e,0),u=Array(i);++o<i;)u[o]=n[e+o];o=-1;for(var c=Array(e+1);++o<e;)c[o]=n[o];return c[e]=r(u),y(t,this,c)}}(t,e,St),t+"")}function at(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function ft(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return ot(r)?r:void 0}function lt(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&o.test(t))&&t>-1&&t%1==0&&t<e}function st(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||m)}function pt(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var vt=function(t){var e=0,r=0;return function(){var n=C(),o=16-(n-r);if(r=n,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(D?function(t,e){return D(t,"toString",{configurable:!0,enumerable:!1,value:(r=e,function(){return r}),writable:!0});var r}:St);function ht(t,e){return t===e||t!=t&&e!=e}var yt=nt(function(){return arguments}())?nt:function(t){return Ot(t)&&A.call(t,"callee")&&!E.call(t,"callee")},dt=Array.isArray;function _t(t){return null!=t&&gt(t.length)&&!jt(t)}var bt=R||function(){return!1};function jt(t){if(!mt(t))return!1;var e=rt(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function gt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function mt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ot(t){return null!=t&&"object"==typeof t}var wt=h?function(t){return function(e){return t(e)}}(h):function(t){return Ot(t)&&gt(t.length)&&!!i[rt(t)]};function At(t){return _t(t)?K(t,!0):it(t)}var zt,xt=(zt=function(t,e,r){ut(t,e,r)},ct((function(t,e){var r=-1,n=e.length,o=n>1?e[n-1]:void 0,i=n>2?e[2]:void 0;for(o=zt.length>3&&"function"==typeof o?(n--,o):void 0,i&&function(t,e,r){if(!mt(r))return!1;var n=typeof e;return!!("number"==n?_t(r)&&lt(e,r.length):"string"==n&&e in r)&&ht(r[e],t)}(e[0],e[1],i)&&(o=n<3?void 0:o,n=1),t=Object(t);++r<n;){var u=e[r];u&&zt(t,u,r,o)}return t})));function St(t){return t}r.exports=xt}).call(this,r(1),r(2)(t))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";r.r(e);var n=r(0),o=r.n(n);function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var u,c=t[Symbol.iterator]();!(n=(u=c.next()).done)&&(r.push(u.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var u={name:"Hoverable",data:function(){return{hover:!1}},render:function(){var t=this,e=i(this.$scopedSlots.on({hover:this.hover}),1)[0];return o()(e.data.on,{mouseenter:function(){return t.hover=!0},mouseleave:function(){return t.hover=!1}}),e}};r.d(e,"Hoverable",(function(){return u}));e.default={install:function(t){t.component(u.name,u)}}}])}));