@animxyz/vue
Advanced tools
Comparing version 0.0.8 to 0.0.9
/** | ||
* VueAnimXyz v0.0.7 | ||
* VueAnimXyz v0.0.8 | ||
* Copyright (c) 2020-present Ingram Projects | ||
@@ -100,12 +100,23 @@ * Released under the MIT License. | ||
function updateDirective(el, binding) { | ||
var ref = binding.value; | ||
var container = ref.container; if ( container === void 0 ) container = null; | ||
var threshold = ref.threshold; if ( threshold === void 0 ) threshold = 0.5; | ||
var margin = ref.margin; if ( margin === void 0 ) margin = '0'; | ||
var once = ref.once; if ( once === void 0 ) once = true; | ||
var thresholds = [0, threshold]; | ||
var options = binding.value || {}; | ||
var appear = options.appear; if ( appear === void 0 ) appear = true; | ||
var once = options.once; if ( once === void 0 ) once = true; | ||
var threshold = options.threshold; if ( threshold === void 0 ) threshold = 1; | ||
var margin = options.margin; | ||
var container = options.container; | ||
function resetClasses() { | ||
el.classList.remove('xyz-in', 'xyz-appear'); | ||
el.classList.add('xyz-paused', 'xyz-in'); | ||
if (appear) { | ||
el.classList.add('xyz-appear'); | ||
} | ||
} | ||
resetClasses(); | ||
var intersectionObserverOptions = { | ||
root: container, | ||
rootMargin: margin, | ||
thresholds: thresholds | ||
threshold: [0, threshold] | ||
}; | ||
@@ -117,3 +128,3 @@ clearIntersectionObserver(el); | ||
if (entry.intersectionRatio >= threshold) { | ||
el.classList.add('xyz-in', 'xyz-appear'); | ||
el.classList.remove('xyz-paused'); | ||
@@ -125,3 +136,3 @@ if (once) { | ||
} else { | ||
el.classList.remove('xyz-in', 'xyz-appear'); | ||
resetClasses(); | ||
} | ||
@@ -128,0 +139,0 @@ }); |
/** | ||
* VueAnimXyz v0.0.7 | ||
* VueAnimXyz v0.0.8 | ||
* Copyright (c) 2020-present Ingram Projects | ||
@@ -96,12 +96,23 @@ * Released under the MIT License. | ||
function updateDirective(el, binding) { | ||
var ref = binding.value; | ||
var container = ref.container; if ( container === void 0 ) container = null; | ||
var threshold = ref.threshold; if ( threshold === void 0 ) threshold = 0.5; | ||
var margin = ref.margin; if ( margin === void 0 ) margin = '0'; | ||
var once = ref.once; if ( once === void 0 ) once = true; | ||
var thresholds = [0, threshold]; | ||
var options = binding.value || {}; | ||
var appear = options.appear; if ( appear === void 0 ) appear = true; | ||
var once = options.once; if ( once === void 0 ) once = true; | ||
var threshold = options.threshold; if ( threshold === void 0 ) threshold = 1; | ||
var margin = options.margin; | ||
var container = options.container; | ||
function resetClasses() { | ||
el.classList.remove('xyz-in', 'xyz-appear'); | ||
el.classList.add('xyz-paused', 'xyz-in'); | ||
if (appear) { | ||
el.classList.add('xyz-appear'); | ||
} | ||
} | ||
resetClasses(); | ||
var intersectionObserverOptions = { | ||
root: container, | ||
rootMargin: margin, | ||
thresholds: thresholds | ||
threshold: [0, threshold] | ||
}; | ||
@@ -113,3 +124,3 @@ clearIntersectionObserver(el); | ||
if (entry.intersectionRatio >= threshold) { | ||
el.classList.add('xyz-in', 'xyz-appear'); | ||
el.classList.remove('xyz-paused'); | ||
@@ -121,3 +132,3 @@ if (once) { | ||
} else { | ||
el.classList.remove('xyz-in', 'xyz-appear'); | ||
resetClasses(); | ||
} | ||
@@ -124,0 +135,0 @@ }); |
/** | ||
* VueAnimXyz v0.0.7 | ||
* VueAnimXyz v0.0.8 | ||
* Copyright (c) 2020-present Ingram Projects | ||
@@ -8,3 +8,3 @@ * Released under the MIT License. | ||
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t=t||self).VueAnimXyz=r()}(this,(function(){"use strict";var t={name:"xyz",appearClass:"xyz-in-from xyz-appear-from",appearActiveClass:"xyz-in xyz-appear",appearToClass:"xyz-in-to xyz-appear-to",enterClass:"xyz-in-from",enterActiveClass:"xyz-in",enterToClass:"xyz-in-to",leaveClass:"xyz-out-from",leaveActiveClass:"xyz-out",leaveToClass:"xyz-out-to"};var r=function(t,r,e){switch(e.length){case 0:return t.call(r);case 1:return t.call(r,e[0]);case 2:return t.call(r,e[0],e[1]);case 3:return t.call(r,e[0],e[1],e[2])}return t.apply(r,e)};var e=function(t){return t},n=Math.max;var o=function(t,e,o){return e=n(void 0===e?t.length-1:e,0),function(){for(var a=arguments,i=-1,u=n(a.length-e,0),c=Array(u);++i<u;)c[i]=a[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=a[i];return s[e]=o(c),r(t,this,s)}};var a=function(t){return function(){return t}},i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function u(t,r){return t(r={exports:{}},r.exports),r.exports}var c="object"==typeof i&&i&&i.Object===Object&&i,s="object"==typeof self&&self&&self.Object===Object&&self,f=c||s||Function("return this")(),v=f.Symbol,l=Object.prototype,p=l.hasOwnProperty,y=l.toString,d=v?v.toStringTag:void 0;var h=function(t){var r=p.call(t,d),e=t[d];try{t[d]=void 0;var n=!0}catch(t){}var o=y.call(t);return n&&(r?t[d]=e:delete t[d]),o},b=Object.prototype.toString;var _=function(t){return b.call(t)},g=v?v.toStringTag:void 0;var j=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":g&&g in Object(t)?h(t):_(t)};var O=function(t){var r=typeof t;return null!=t&&("object"==r||"function"==r)};var z,x=function(t){if(!O(t))return!1;var r=j(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r},w=f["__core-js_shared__"],m=(z=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||""))?"Symbol(src)_1."+z:"";var A=function(t){return!!m&&m in t},T=Function.prototype.toString;var P=function(t){if(null!=t){try{return T.call(t)}catch(t){}try{return t+""}catch(t){}}return""},S=/^\[object .+?Constructor\]$/,C=Function.prototype,F=Object.prototype,E=C.toString,I=F.hasOwnProperty,U=RegExp("^"+E.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var $=function(t){return!(!O(t)||A(t))&&(x(t)?U:S).test(P(t))};var k=function(t,r){return null==t?void 0:t[r]};var B=function(t,r){var e=k(t,r);return $(e)?e:void 0},M=function(){try{var t=B(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),L=M?function(t,r){return M(t,"toString",{configurable:!0,enumerable:!1,value:a(r),writable:!0})}:e,R=Date.now;var V=function(t){var r=0,e=0;return function(){var n=R(),o=16-(n-e);if(e=n,o>0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}(L);var D=function(t,r){return V(o(t,r,e),t+"")};var X=function(){this.__data__=[],this.size=0};var q=function(t,r){return t===r||t!=t&&r!=r};var G=function(t,r){for(var e=t.length;e--;)if(q(t[e][0],r))return e;return-1},N=Array.prototype.splice;var W=function(t){var r=this.__data__,e=G(r,t);return!(e<0)&&(e==r.length-1?r.pop():N.call(r,e,1),--this.size,!0)};var H=function(t){var r=this.__data__,e=G(r,t);return e<0?void 0:r[e][1]};var J=function(t){return G(this.__data__,t)>-1};var K=function(t,r){var e=this.__data__,n=G(e,t);return n<0?(++this.size,e.push([t,r])):e[n][1]=r,this};function Q(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}Q.prototype.clear=X,Q.prototype.delete=W,Q.prototype.get=H,Q.prototype.has=J,Q.prototype.set=K;var Y=Q;var Z=function(){this.__data__=new Y,this.size=0};var tt=function(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e};var rt=function(t){return this.__data__.get(t)};var et=function(t){return this.__data__.has(t)},nt=B(f,"Map"),ot=B(Object,"create");var at=function(){this.__data__=ot?ot(null):{},this.size=0};var it=function(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r},ut=Object.prototype.hasOwnProperty;var ct=function(t){var r=this.__data__;if(ot){var e=r[t];return"__lodash_hash_undefined__"===e?void 0:e}return ut.call(r,t)?r[t]:void 0},st=Object.prototype.hasOwnProperty;var ft=function(t){var r=this.__data__;return ot?void 0!==r[t]:st.call(r,t)};var vt=function(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=ot&&void 0===r?"__lodash_hash_undefined__":r,this};function lt(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}lt.prototype.clear=at,lt.prototype.delete=it,lt.prototype.get=ct,lt.prototype.has=ft,lt.prototype.set=vt;var pt=lt;var yt=function(){this.size=0,this.__data__={hash:new pt,map:new(nt||Y),string:new pt}};var dt=function(t){var r=typeof t;return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t};var ht=function(t,r){var e=t.__data__;return dt(r)?e["string"==typeof r?"string":"hash"]:e.map};var bt=function(t){var r=ht(this,t).delete(t);return this.size-=r?1:0,r};var _t=function(t){return ht(this,t).get(t)};var gt=function(t){return ht(this,t).has(t)};var jt=function(t,r){var e=ht(this,t),n=e.size;return e.set(t,r),this.size+=e.size==n?0:1,this};function Ot(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}Ot.prototype.clear=yt,Ot.prototype.delete=bt,Ot.prototype.get=_t,Ot.prototype.has=gt,Ot.prototype.set=jt;var zt=Ot;var xt=function(t,r){var e=this.__data__;if(e instanceof Y){var n=e.__data__;if(!nt||n.length<199)return n.push([t,r]),this.size=++e.size,this;e=this.__data__=new zt(n)}return e.set(t,r),this.size=e.size,this};function wt(t){var r=this.__data__=new Y(t);this.size=r.size}wt.prototype.clear=Z,wt.prototype.delete=tt,wt.prototype.get=rt,wt.prototype.has=et,wt.prototype.set=xt;var mt=wt;var At=function(t,r,e){"__proto__"==r&&M?M(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e};var Tt=function(t,r,e){(void 0!==e&&!q(t[r],e)||void 0===e&&!(r in t))&&At(t,r,e)};var Pt=function(t){return function(r,e,n){for(var o=-1,a=Object(r),i=n(r),u=i.length;u--;){var c=i[t?u:++o];if(!1===e(a[c],c,a))break}return r}}(),St=u((function(t,r){var e=r&&!r.nodeType&&r,n=e&&t&&!t.nodeType&&t,o=n&&n.exports===e?f.Buffer:void 0,a=o?o.allocUnsafe:void 0;t.exports=function(t,r){if(r)return t.slice();var e=t.length,n=a?a(e):new t.constructor(e);return t.copy(n),n}})),Ct=f.Uint8Array;var Ft=function(t){var r=new t.constructor(t.byteLength);return new Ct(r).set(new Ct(t)),r};var Et=function(t,r){var e=r?Ft(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)};var It=function(t,r){var e=-1,n=t.length;for(r||(r=Array(n));++e<n;)r[e]=t[e];return r},Ut=Object.create,$t=function(){function t(){}return function(r){if(!O(r))return{};if(Ut)return Ut(r);t.prototype=r;var e=new t;return t.prototype=void 0,e}}();var kt=function(t,r){return function(e){return t(r(e))}}(Object.getPrototypeOf,Object),Bt=Object.prototype;var Mt=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||Bt)};var Lt=function(t){return"function"!=typeof t.constructor||Mt(t)?{}:$t(kt(t))};var Rt=function(t){return null!=t&&"object"==typeof t};var Vt=function(t){return Rt(t)&&"[object Arguments]"==j(t)},Dt=Object.prototype,Xt=Dt.hasOwnProperty,qt=Dt.propertyIsEnumerable,Gt=Vt(function(){return arguments}())?Vt:function(t){return Rt(t)&&Xt.call(t,"callee")&&!qt.call(t,"callee")},Nt=Array.isArray;var Wt=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var Ht=function(t){return null!=t&&Wt(t.length)&&!x(t)};var Jt=function(t){return Rt(t)&&Ht(t)};var Kt=function(){return!1},Qt=u((function(t,r){var e=r&&!r.nodeType&&r,n=e&&t&&!t.nodeType&&t,o=n&&n.exports===e?f.Buffer:void 0,a=(o?o.isBuffer:void 0)||Kt;t.exports=a})),Yt=Function.prototype,Zt=Object.prototype,tr=Yt.toString,rr=Zt.hasOwnProperty,er=tr.call(Object);var nr=function(t){if(!Rt(t)||"[object Object]"!=j(t))return!1;var r=kt(t);if(null===r)return!0;var e=rr.call(r,"constructor")&&r.constructor;return"function"==typeof e&&e instanceof e&&tr.call(e)==er},or={};or["[object Float32Array]"]=or["[object Float64Array]"]=or["[object Int8Array]"]=or["[object Int16Array]"]=or["[object Int32Array]"]=or["[object Uint8Array]"]=or["[object Uint8ClampedArray]"]=or["[object Uint16Array]"]=or["[object Uint32Array]"]=!0,or["[object Arguments]"]=or["[object Array]"]=or["[object ArrayBuffer]"]=or["[object Boolean]"]=or["[object DataView]"]=or["[object Date]"]=or["[object Error]"]=or["[object Function]"]=or["[object Map]"]=or["[object Number]"]=or["[object Object]"]=or["[object RegExp]"]=or["[object Set]"]=or["[object String]"]=or["[object WeakMap]"]=!1;var ar=function(t){return Rt(t)&&Wt(t.length)&&!!or[j(t)]};var ir=function(t){return function(r){return t(r)}},ur=u((function(t,r){var e=r&&!r.nodeType&&r,n=e&&t&&!t.nodeType&&t,o=n&&n.exports===e&&c.process,a=function(){try{var t=n&&n.require&&n.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=a})),cr=ur&&ur.isTypedArray,sr=cr?ir(cr):ar;var fr=function(t,r){if(("constructor"!==r||"function"!=typeof t[r])&&"__proto__"!=r)return t[r]},vr=Object.prototype.hasOwnProperty;var lr=function(t,r,e){var n=t[r];vr.call(t,r)&&q(n,e)&&(void 0!==e||r in t)||At(t,r,e)};var pr=function(t,r,e,n){var o=!e;e||(e={});for(var a=-1,i=r.length;++a<i;){var u=r[a],c=n?n(e[u],t[u],u,e,t):void 0;void 0===c&&(c=t[u]),o?At(e,u,c):lr(e,u,c)}return e};var yr=function(t,r){for(var e=-1,n=Array(t);++e<t;)n[e]=r(e);return n},dr=/^(?:0|[1-9]\d*)$/;var hr=function(t,r){var e=typeof t;return!!(r=null==r?9007199254740991:r)&&("number"==e||"symbol"!=e&&dr.test(t))&&t>-1&&t%1==0&&t<r},br=Object.prototype.hasOwnProperty;var _r=function(t,r){var e=Nt(t),n=!e&&Gt(t),o=!e&&!n&&Qt(t),a=!e&&!n&&!o&&sr(t),i=e||n||o||a,u=i?yr(t.length,String):[],c=u.length;for(var s in t)!r&&!br.call(t,s)||i&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||hr(s,c))||u.push(s);return u};var gr=function(t){var r=[];if(null!=t)for(var e in Object(t))r.push(e);return r},jr=Object.prototype.hasOwnProperty;var Or=function(t){if(!O(t))return gr(t);var r=Mt(t),e=[];for(var n in t)("constructor"!=n||!r&&jr.call(t,n))&&e.push(n);return e};var zr=function(t){return Ht(t)?_r(t,!0):Or(t)};var xr=function(t){return pr(t,zr(t))};var wr=function(t,r,e,n,o,a,i){var u=fr(t,e),c=fr(r,e),s=i.get(c);if(s)Tt(t,e,s);else{var f=a?a(u,c,e+"",t,r,i):void 0,v=void 0===f;if(v){var l=Nt(c),p=!l&&Qt(c),y=!l&&!p&&sr(c);f=c,l||p||y?Nt(u)?f=u:Jt(u)?f=It(u):p?(v=!1,f=St(c,!0)):y?(v=!1,f=Et(c,!0)):f=[]:nr(c)||Gt(c)?(f=u,Gt(u)?f=xr(u):O(u)&&!x(u)||(f=Lt(c))):v=!1}v&&(i.set(c,f),o(f,c,n,a,i),i.delete(c)),Tt(t,e,f)}};var mr=function t(r,e,n,o,a){r!==e&&Pt(e,(function(i,u){if(a||(a=new mt),O(i))wr(r,e,u,n,t,o,a);else{var c=o?o(fr(r,u),i,u+"",r,e,a):void 0;void 0===c&&(c=i),Tt(r,u,c)}}),zr)};var Ar=function t(r,e,n,o,a,i){return O(r)&&O(e)&&(i.set(e,r),mr(r,e,void 0,t,i),i.delete(e)),r};var Tr=function(t,r,e){if(!O(e))return!1;var n=typeof r;return!!("number"==n?Ht(e)&&hr(r,e.length):"string"==n&&r in e)&&q(e[r],t)};var Pr=function(t){return D((function(r,e){var n=-1,o=e.length,a=o>1?e[o-1]:void 0,i=o>2?e[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,i&&Tr(e[0],e[1],i)&&(a=o<3?void 0:a,o=1),r=Object(r);++n<o;){var u=e[n];u&&t(r,u,n,a)}return r}))}((function(t,r,e,n){mr(t,r,e,n)})),Sr=D((function(t){return t.push(void 0,Ar),r(Pr,void 0,t)})),Cr={name:"XyzTransition",functional:!0,render:function(r,e){var n,o=Object.assign(Object.assign({},e.data),{},{attrs:Object.assign(Object.assign({},t),null===(n=e.data)||void 0===n?void 0:n.attrs)}),a=function(t){var r={};if(t)for(var e=0,n=Object.entries(t);e<n.length;e+=1){var o=n[e],a=o[0],i=o[1];("xyz"===a||a.startsWith("xyz-"))&&(r[a]=i)}return r}(o.attrs);return Object.keys(a).length&&e.children.forEach((function(t){Sr(t,{data:{attrs:a}})})),r("transition",o,e.children)}},Fr={name:"XyzTransitionGroup",functional:!0,render:function(r,e){return r("transition-group",Object.assign(Object.assign({},e.data),{},{attrs:Object.assign(Object.assign({},t),{},{moveClass:"xyz-move"},e.data.attrs)}),e.children)}};function Er(t){var r,e,n="";if(t)if("object"==typeof t)if(Array.isArray(t))for(r=0;r<t.length;r++)t[r]&&(e=Er(t[r]))&&(n&&(n+=" "),n+=e);else for(r in t)t[r]&&(e=Er(r))&&(n&&(n+=" "),n+=e);else"boolean"==typeof t||t.call||(n&&(n+=" "),n+=t);return n}function Ir(t,r){var e=function(){for(var t,r=0,e="";r<arguments.length;)(t=Er(arguments[r++]))&&(e&&(e+=" "),e+=t);return e}(r.value);t.setAttribute("xyz",e)}function Ur(t){t.intersectionObserver&&(t.intersectionObserver.disconnect(),delete t.intersectionObserver)}function $r(t,r){var e=r.value,n=e.container;void 0===n&&(n=null);var o=e.threshold;void 0===o&&(o=.5);var a=e.margin;void 0===a&&(a="0");var i=e.once;void 0===i&&(i=!0);var u={root:n,rootMargin:a,thresholds:[0,o]};Ur(t),t.intersectionObserver=new IntersectionObserver((function(r){r.forEach((function(r){r.isIntersecting?r.intersectionRatio>=o&&(t.classList.add("xyz-in","xyz-appear"),i&&Ur(t)):t.classList.remove("xyz-in","xyz-appear")}))}),u),t.intersectionObserver.observe(t)}var kr={bind:$r,update:$r,unbind:function(t){Ur(t)}},Br={install:function(t){t.component("xyz-transition",Cr),t.component("xyz-transition-group",Fr),t.directive("xyz",Ir),t.directive("xyz-visible",kr)}},Mr=null;return"undefined"!=typeof window?Mr=window.Vue:"undefined"!=typeof global&&(Mr=global.Vue),Mr&&Mr.use(Br),Br})); | ||
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t=t||self).VueAnimXyz=r()}(this,(function(){"use strict";var t={name:"xyz",appearClass:"xyz-in-from xyz-appear-from",appearActiveClass:"xyz-in xyz-appear",appearToClass:"xyz-in-to xyz-appear-to",enterClass:"xyz-in-from",enterActiveClass:"xyz-in",enterToClass:"xyz-in-to",leaveClass:"xyz-out-from",leaveActiveClass:"xyz-out",leaveToClass:"xyz-out-to"};var r=function(t,r,e){switch(e.length){case 0:return t.call(r);case 1:return t.call(r,e[0]);case 2:return t.call(r,e[0],e[1]);case 3:return t.call(r,e[0],e[1],e[2])}return t.apply(r,e)};var e=function(t){return t},n=Math.max;var o=function(t,e,o){return e=n(void 0===e?t.length-1:e,0),function(){for(var a=arguments,i=-1,u=n(a.length-e,0),c=Array(u);++i<u;)c[i]=a[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=a[i];return s[e]=o(c),r(t,this,s)}};var a=function(t){return function(){return t}},i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function u(t,r){return t(r={exports:{}},r.exports),r.exports}var c="object"==typeof i&&i&&i.Object===Object&&i,s="object"==typeof self&&self&&self.Object===Object&&self,f=c||s||Function("return this")(),v=f.Symbol,l=Object.prototype,p=l.hasOwnProperty,y=l.toString,d=v?v.toStringTag:void 0;var h=function(t){var r=p.call(t,d),e=t[d];try{t[d]=void 0;var n=!0}catch(t){}var o=y.call(t);return n&&(r?t[d]=e:delete t[d]),o},b=Object.prototype.toString;var _=function(t){return b.call(t)},g=v?v.toStringTag:void 0;var j=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":g&&g in Object(t)?h(t):_(t)};var O=function(t){var r=typeof t;return null!=t&&("object"==r||"function"==r)};var z,x=function(t){if(!O(t))return!1;var r=j(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r},w=f["__core-js_shared__"],m=(z=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||""))?"Symbol(src)_1."+z:"";var A=function(t){return!!m&&m in t},T=Function.prototype.toString;var P=function(t){if(null!=t){try{return T.call(t)}catch(t){}try{return t+""}catch(t){}}return""},S=/^\[object .+?Constructor\]$/,C=Function.prototype,F=Object.prototype,E=C.toString,I=F.hasOwnProperty,U=RegExp("^"+E.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var $=function(t){return!(!O(t)||A(t))&&(x(t)?U:S).test(P(t))};var L=function(t,r){return null==t?void 0:t[r]};var k=function(t,r){var e=L(t,r);return $(e)?e:void 0},B=function(){try{var t=k(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),M=B?function(t,r){return B(t,"toString",{configurable:!0,enumerable:!1,value:a(r),writable:!0})}:e,R=Date.now;var V=function(t){var r=0,e=0;return function(){var n=R(),o=16-(n-e);if(e=n,o>0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}(M);var D=function(t,r){return V(o(t,r,e),t+"")};var X=function(){this.__data__=[],this.size=0};var q=function(t,r){return t===r||t!=t&&r!=r};var G=function(t,r){for(var e=t.length;e--;)if(q(t[e][0],r))return e;return-1},N=Array.prototype.splice;var W=function(t){var r=this.__data__,e=G(r,t);return!(e<0)&&(e==r.length-1?r.pop():N.call(r,e,1),--this.size,!0)};var H=function(t){var r=this.__data__,e=G(r,t);return e<0?void 0:r[e][1]};var J=function(t){return G(this.__data__,t)>-1};var K=function(t,r){var e=this.__data__,n=G(e,t);return n<0?(++this.size,e.push([t,r])):e[n][1]=r,this};function Q(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}Q.prototype.clear=X,Q.prototype.delete=W,Q.prototype.get=H,Q.prototype.has=J,Q.prototype.set=K;var Y=Q;var Z=function(){this.__data__=new Y,this.size=0};var tt=function(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e};var rt=function(t){return this.__data__.get(t)};var et=function(t){return this.__data__.has(t)},nt=k(f,"Map"),ot=k(Object,"create");var at=function(){this.__data__=ot?ot(null):{},this.size=0};var it=function(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r},ut=Object.prototype.hasOwnProperty;var ct=function(t){var r=this.__data__;if(ot){var e=r[t];return"__lodash_hash_undefined__"===e?void 0:e}return ut.call(r,t)?r[t]:void 0},st=Object.prototype.hasOwnProperty;var ft=function(t){var r=this.__data__;return ot?void 0!==r[t]:st.call(r,t)};var vt=function(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=ot&&void 0===r?"__lodash_hash_undefined__":r,this};function lt(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}lt.prototype.clear=at,lt.prototype.delete=it,lt.prototype.get=ct,lt.prototype.has=ft,lt.prototype.set=vt;var pt=lt;var yt=function(){this.size=0,this.__data__={hash:new pt,map:new(nt||Y),string:new pt}};var dt=function(t){var r=typeof t;return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t};var ht=function(t,r){var e=t.__data__;return dt(r)?e["string"==typeof r?"string":"hash"]:e.map};var bt=function(t){var r=ht(this,t).delete(t);return this.size-=r?1:0,r};var _t=function(t){return ht(this,t).get(t)};var gt=function(t){return ht(this,t).has(t)};var jt=function(t,r){var e=ht(this,t),n=e.size;return e.set(t,r),this.size+=e.size==n?0:1,this};function Ot(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}Ot.prototype.clear=yt,Ot.prototype.delete=bt,Ot.prototype.get=_t,Ot.prototype.has=gt,Ot.prototype.set=jt;var zt=Ot;var xt=function(t,r){var e=this.__data__;if(e instanceof Y){var n=e.__data__;if(!nt||n.length<199)return n.push([t,r]),this.size=++e.size,this;e=this.__data__=new zt(n)}return e.set(t,r),this.size=e.size,this};function wt(t){var r=this.__data__=new Y(t);this.size=r.size}wt.prototype.clear=Z,wt.prototype.delete=tt,wt.prototype.get=rt,wt.prototype.has=et,wt.prototype.set=xt;var mt=wt;var At=function(t,r,e){"__proto__"==r&&B?B(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e};var Tt=function(t,r,e){(void 0!==e&&!q(t[r],e)||void 0===e&&!(r in t))&&At(t,r,e)};var Pt=function(t){return function(r,e,n){for(var o=-1,a=Object(r),i=n(r),u=i.length;u--;){var c=i[t?u:++o];if(!1===e(a[c],c,a))break}return r}}(),St=u((function(t,r){var e=r&&!r.nodeType&&r,n=e&&t&&!t.nodeType&&t,o=n&&n.exports===e?f.Buffer:void 0,a=o?o.allocUnsafe:void 0;t.exports=function(t,r){if(r)return t.slice();var e=t.length,n=a?a(e):new t.constructor(e);return t.copy(n),n}})),Ct=f.Uint8Array;var Ft=function(t){var r=new t.constructor(t.byteLength);return new Ct(r).set(new Ct(t)),r};var Et=function(t,r){var e=r?Ft(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)};var It=function(t,r){var e=-1,n=t.length;for(r||(r=Array(n));++e<n;)r[e]=t[e];return r},Ut=Object.create,$t=function(){function t(){}return function(r){if(!O(r))return{};if(Ut)return Ut(r);t.prototype=r;var e=new t;return t.prototype=void 0,e}}();var Lt=function(t,r){return function(e){return t(r(e))}}(Object.getPrototypeOf,Object),kt=Object.prototype;var Bt=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||kt)};var Mt=function(t){return"function"!=typeof t.constructor||Bt(t)?{}:$t(Lt(t))};var Rt=function(t){return null!=t&&"object"==typeof t};var Vt=function(t){return Rt(t)&&"[object Arguments]"==j(t)},Dt=Object.prototype,Xt=Dt.hasOwnProperty,qt=Dt.propertyIsEnumerable,Gt=Vt(function(){return arguments}())?Vt:function(t){return Rt(t)&&Xt.call(t,"callee")&&!qt.call(t,"callee")},Nt=Array.isArray;var Wt=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var Ht=function(t){return null!=t&&Wt(t.length)&&!x(t)};var Jt=function(t){return Rt(t)&&Ht(t)};var Kt=function(){return!1},Qt=u((function(t,r){var e=r&&!r.nodeType&&r,n=e&&t&&!t.nodeType&&t,o=n&&n.exports===e?f.Buffer:void 0,a=(o?o.isBuffer:void 0)||Kt;t.exports=a})),Yt=Function.prototype,Zt=Object.prototype,tr=Yt.toString,rr=Zt.hasOwnProperty,er=tr.call(Object);var nr=function(t){if(!Rt(t)||"[object Object]"!=j(t))return!1;var r=Lt(t);if(null===r)return!0;var e=rr.call(r,"constructor")&&r.constructor;return"function"==typeof e&&e instanceof e&&tr.call(e)==er},or={};or["[object Float32Array]"]=or["[object Float64Array]"]=or["[object Int8Array]"]=or["[object Int16Array]"]=or["[object Int32Array]"]=or["[object Uint8Array]"]=or["[object Uint8ClampedArray]"]=or["[object Uint16Array]"]=or["[object Uint32Array]"]=!0,or["[object Arguments]"]=or["[object Array]"]=or["[object ArrayBuffer]"]=or["[object Boolean]"]=or["[object DataView]"]=or["[object Date]"]=or["[object Error]"]=or["[object Function]"]=or["[object Map]"]=or["[object Number]"]=or["[object Object]"]=or["[object RegExp]"]=or["[object Set]"]=or["[object String]"]=or["[object WeakMap]"]=!1;var ar=function(t){return Rt(t)&&Wt(t.length)&&!!or[j(t)]};var ir=function(t){return function(r){return t(r)}},ur=u((function(t,r){var e=r&&!r.nodeType&&r,n=e&&t&&!t.nodeType&&t,o=n&&n.exports===e&&c.process,a=function(){try{var t=n&&n.require&&n.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=a})),cr=ur&&ur.isTypedArray,sr=cr?ir(cr):ar;var fr=function(t,r){if(("constructor"!==r||"function"!=typeof t[r])&&"__proto__"!=r)return t[r]},vr=Object.prototype.hasOwnProperty;var lr=function(t,r,e){var n=t[r];vr.call(t,r)&&q(n,e)&&(void 0!==e||r in t)||At(t,r,e)};var pr=function(t,r,e,n){var o=!e;e||(e={});for(var a=-1,i=r.length;++a<i;){var u=r[a],c=n?n(e[u],t[u],u,e,t):void 0;void 0===c&&(c=t[u]),o?At(e,u,c):lr(e,u,c)}return e};var yr=function(t,r){for(var e=-1,n=Array(t);++e<t;)n[e]=r(e);return n},dr=/^(?:0|[1-9]\d*)$/;var hr=function(t,r){var e=typeof t;return!!(r=null==r?9007199254740991:r)&&("number"==e||"symbol"!=e&&dr.test(t))&&t>-1&&t%1==0&&t<r},br=Object.prototype.hasOwnProperty;var _r=function(t,r){var e=Nt(t),n=!e&&Gt(t),o=!e&&!n&&Qt(t),a=!e&&!n&&!o&&sr(t),i=e||n||o||a,u=i?yr(t.length,String):[],c=u.length;for(var s in t)!r&&!br.call(t,s)||i&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||hr(s,c))||u.push(s);return u};var gr=function(t){var r=[];if(null!=t)for(var e in Object(t))r.push(e);return r},jr=Object.prototype.hasOwnProperty;var Or=function(t){if(!O(t))return gr(t);var r=Bt(t),e=[];for(var n in t)("constructor"!=n||!r&&jr.call(t,n))&&e.push(n);return e};var zr=function(t){return Ht(t)?_r(t,!0):Or(t)};var xr=function(t){return pr(t,zr(t))};var wr=function(t,r,e,n,o,a,i){var u=fr(t,e),c=fr(r,e),s=i.get(c);if(s)Tt(t,e,s);else{var f=a?a(u,c,e+"",t,r,i):void 0,v=void 0===f;if(v){var l=Nt(c),p=!l&&Qt(c),y=!l&&!p&&sr(c);f=c,l||p||y?Nt(u)?f=u:Jt(u)?f=It(u):p?(v=!1,f=St(c,!0)):y?(v=!1,f=Et(c,!0)):f=[]:nr(c)||Gt(c)?(f=u,Gt(u)?f=xr(u):O(u)&&!x(u)||(f=Mt(c))):v=!1}v&&(i.set(c,f),o(f,c,n,a,i),i.delete(c)),Tt(t,e,f)}};var mr=function t(r,e,n,o,a){r!==e&&Pt(e,(function(i,u){if(a||(a=new mt),O(i))wr(r,e,u,n,t,o,a);else{var c=o?o(fr(r,u),i,u+"",r,e,a):void 0;void 0===c&&(c=i),Tt(r,u,c)}}),zr)};var Ar=function t(r,e,n,o,a,i){return O(r)&&O(e)&&(i.set(e,r),mr(r,e,void 0,t,i),i.delete(e)),r};var Tr=function(t,r,e){if(!O(e))return!1;var n=typeof r;return!!("number"==n?Ht(e)&&hr(r,e.length):"string"==n&&r in e)&&q(e[r],t)};var Pr=function(t){return D((function(r,e){var n=-1,o=e.length,a=o>1?e[o-1]:void 0,i=o>2?e[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,i&&Tr(e[0],e[1],i)&&(a=o<3?void 0:a,o=1),r=Object(r);++n<o;){var u=e[n];u&&t(r,u,n,a)}return r}))}((function(t,r,e,n){mr(t,r,e,n)})),Sr=D((function(t){return t.push(void 0,Ar),r(Pr,void 0,t)})),Cr={name:"XyzTransition",functional:!0,render:function(r,e){var n,o=Object.assign(Object.assign({},e.data),{},{attrs:Object.assign(Object.assign({},t),null===(n=e.data)||void 0===n?void 0:n.attrs)}),a=function(t){var r={};if(t)for(var e=0,n=Object.entries(t);e<n.length;e+=1){var o=n[e],a=o[0],i=o[1];("xyz"===a||a.startsWith("xyz-"))&&(r[a]=i)}return r}(o.attrs);return Object.keys(a).length&&e.children.forEach((function(t){Sr(t,{data:{attrs:a}})})),r("transition",o,e.children)}},Fr={name:"XyzTransitionGroup",functional:!0,render:function(r,e){return r("transition-group",Object.assign(Object.assign({},e.data),{},{attrs:Object.assign(Object.assign({},t),{},{moveClass:"xyz-move"},e.data.attrs)}),e.children)}};function Er(t){var r,e,n="";if(t)if("object"==typeof t)if(Array.isArray(t))for(r=0;r<t.length;r++)t[r]&&(e=Er(t[r]))&&(n&&(n+=" "),n+=e);else for(r in t)t[r]&&(e=Er(r))&&(n&&(n+=" "),n+=e);else"boolean"==typeof t||t.call||(n&&(n+=" "),n+=t);return n}function Ir(t,r){var e=function(){for(var t,r=0,e="";r<arguments.length;)(t=Er(arguments[r++]))&&(e&&(e+=" "),e+=t);return e}(r.value);t.setAttribute("xyz",e)}function Ur(t){t.intersectionObserver&&(t.intersectionObserver.disconnect(),delete t.intersectionObserver)}function $r(t,r){var e=r.value||{},n=e.appear;void 0===n&&(n=!0);var o=e.once;void 0===o&&(o=!0);var a=e.threshold;void 0===a&&(a=1);var i=e.margin,u=e.container;function c(){t.classList.remove("xyz-in","xyz-appear"),t.classList.add("xyz-paused","xyz-in"),n&&t.classList.add("xyz-appear")}c();var s={root:u,rootMargin:i,threshold:[0,a]};Ur(t),t.intersectionObserver=new IntersectionObserver((function(r){r.forEach((function(r){r.isIntersecting?r.intersectionRatio>=a&&(t.classList.remove("xyz-paused"),o&&Ur(t)):c()}))}),s),t.intersectionObserver.observe(t)}var Lr={bind:$r,update:$r,unbind:function(t){Ur(t)}},kr={install:function(t){t.component("xyz-transition",Cr),t.component("xyz-transition-group",Fr),t.directive("xyz",Ir),t.directive("xyz-visible",Lr)}},Br=null;return"undefined"!=typeof window?Br=window.Vue:"undefined"!=typeof global&&(Br=global.Vue),Br&&Br.use(kr),kr})); | ||
//# sourceMappingURL=VueAnimXyz.js.map |
{ | ||
"name": "@animxyz/vue", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"publishConfig": { | ||
@@ -48,3 +48,3 @@ "access": "public" | ||
"dependencies": { | ||
"@animxyz/core": "^0.0.8", | ||
"@animxyz/core": "^0.0.9", | ||
"clsx": "^1.1.0", | ||
@@ -80,3 +80,3 @@ "lodash": "^4.17.15" | ||
}, | ||
"gitHead": "786b47f7a9e1a70b2897940856971dd03a700179" | ||
"gitHead": "16c8d818d855e67a3fb68e9161b576302a532f39" | ||
} |
@@ -9,10 +9,19 @@ function clearIntersectionObserver(el) { | ||
function updateDirective(el, binding) { | ||
const { container = null, threshold = 0.5, margin = '0', once = true } = binding.value | ||
const options = binding.value || {} | ||
const { appear = true, once = true, threshold = 1, margin, container } = options | ||
const thresholds = [0, threshold] | ||
function resetClasses() { | ||
el.classList.remove('xyz-in', 'xyz-appear') | ||
el.classList.add('xyz-paused', 'xyz-in') | ||
if (appear) { | ||
el.classList.add('xyz-appear') | ||
} | ||
} | ||
resetClasses() | ||
const intersectionObserverOptions = { | ||
root: container, | ||
rootMargin: margin, | ||
thresholds, | ||
threshold: [0, threshold], | ||
} | ||
@@ -25,3 +34,3 @@ | ||
if (entry.intersectionRatio >= threshold) { | ||
el.classList.add('xyz-in', 'xyz-appear') | ||
el.classList.remove('xyz-paused') | ||
if (once) { | ||
@@ -32,3 +41,3 @@ clearIntersectionObserver(el) | ||
} else { | ||
el.classList.remove('xyz-in', 'xyz-appear') | ||
resetClasses() | ||
} | ||
@@ -35,0 +44,0 @@ }) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53359
480
+ Added@animxyz/core@0.0.9(transitive)
- Removed@animxyz/core@0.0.8(transitive)
Updated@animxyz/core@^0.0.9