From 815bb0ccee3cffb6bbd3218c1d04e61b69143095 Mon Sep 17 00:00:00 2001 From: Bartosz Dominiak Date: Thu, 24 Sep 2020 13:11:12 +0200 Subject: [PATCH] bump --- dist/vue-snap.esm.js | 2 +- dist/vue-snap.js | 2 +- dist/vue-snap.umd.js | 2 +- package.json | 2 +- yarn.lock | 81 +++++++++++++++++++------------------------- 5 files changed, 38 insertions(+), 51 deletions(-) diff --git a/dist/vue-snap.esm.js b/dist/vue-snap.esm.js index 050c649..c5d86fc 100644 --- a/dist/vue-snap.esm.js +++ b/dist/vue-snap.esm.js @@ -1 +1 @@ -import{elementScrollBy as e}from"seamless-scroll-polyfill/dist/esm/Element.scrollBy";import"core-js/modules/es.array.find-index";import"core-js/modules/es.array.map";import{ref as r,watch as n,onMounted as t,onBeforeUnmount as o,openBlock as l,createBlock as a,createVNode as u,createCommentVNode as i,renderSlot as s,withDirectives as d,vShow as f}from"vue";import v from"lodash/debounce";var c=function(e,r,n){return Math.abs(e-r)<=n},m="undefined"==typeof window,p=!m;function b(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,r){if(!e)return;if("string"==typeof e)return h(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(e,r)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);ne}))-1)},C=function(){u.value&&(L(),A(),g())};return t((function(){B(),p&&(_.value=v(C,100),S.value=v(B,410),u.value.addEventListener("scroll",_.value),window.addEventListener("resize",S.value))})),o((function(){p&&(u.value.removeEventListener("scroll",_.value),window.removeEventListener("resize",S.value))})),{boundLeft:i,boundRight:s,changeSlide:function(e){var r=function(e){var r=e>0?h.value:h.value+e,n=d.value[r].width||0;if(n)return n*e}(e);r&&u.value.scrollBy({left:r,behavior:"smooth"})},vsWrapper:u}}};const w={class:"vs-carousel"},S={ref:"vsWrapper",class:"vs-carousel__wrapper"};y.render=function(e,r,n,t,o,v){return l(),a("div",w,[u("div",S,[i(" @slot Slot for Slides "),s(e.$slots,"default")],512),i(" @slot Slot for Arrows "),e.hideArrows?i("v-if",!0):s(e.$slots,"arrows",{key:0},()=>[e.hideArrowsOnBound&&t.boundLeft?i("v-if",!0):(l(),a("button",{key:0,type:"button","aria-label":"Slide left",disabled:t.boundLeft,class:"\n vs-carousel__arrows\n vs-carousel__arrows--left\n ",onClick:r[1]||(r[1]=e=>t.changeSlide(-1))}," ← ",8,["disabled"])),d(u("button",{type:"button","aria-label":"Slide right",disabled:t.boundRight,class:"\n vs-carousel__arrows\n vs-carousel__arrows--right\n ",onClick:r[2]||(r[2]=e=>t.changeSlide(1))}," → ",8,["disabled"]),[[f,!e.hideArrowsOnBound||!t.boundRight]])])])},y.__file="src/components/Carousel/Carousel.vue";var _={name:"Slide"};const g={ref:"vsSlide",class:"vs-carousel__slide",tabindex:"0"};_.render=function(e,r,n,t,o,u){return l(),a("div",g,[s(e.$slots,"default")],512)},_.__file="src/components/Slide/Slide.vue";var A={install:function(e){e.component("carousel",y),e.component("slide",_)}};export default A;export{y as Carousel,_ as Slide}; +import{elementScrollBy as e}from"seamless-scroll-polyfill/dist/esm/Element.scrollBy";import"core-js/modules/es.array.every";import"core-js/modules/es.array.find-index";import"core-js/modules/es.array.map";import{ref as r,watch as t,onMounted as n,onBeforeUnmount as l,openBlock as o,createBlock as a,resolveDynamicComponent as u,withCtx as i,createCommentVNode as s,renderSlot as d,withDirectives as f,createVNode as c,vShow as v}from"vue";import p from"lodash/debounce";var m=function(e,r,t){return Math.abs(e-r)<=t},b="undefined"==typeof window,h=!b;function y(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,r){if(!e)return;if("string"==typeof e)return g(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return g(e,r)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);te}))-1)},B=function(){u.value&&(A(),L(),_())};return n((function(){j(),h&&(S.value=p(B,100),w.value=p(j,410),u.value.addEventListener("scroll",S.value),window.addEventListener("resize",w.value))})),l((function(){h&&(u.value.removeEventListener("scroll",S.value),window.removeEventListener("resize",w.value))})),{boundLeft:i,boundRight:s,changeSlide:function(e){var r=function(e){var r=e>0?v.value:v.value+e,t=d.value[r].width||0;if(t)return t*e}(e);r&&u.value.scrollBy({left:r,behavior:"smooth"})},vsWrapper:u}}};const S={class:"vs-carousel"};w.render=function(e,r,t,n,l,p){return o(),a("div",S,[(o(),a(u(e.tag),{ref:"vsWrapper",class:"vs-carousel__wrapper"},{default:i(()=>[s(" @slot Slot for Slides "),d(e.$slots,"default")]),_:3},512)),s(" @slot Slot for Arrows "),e.hideArrows?s("v-if",!0):d(e.$slots,"arrows",{key:0},()=>[e.hideArrowsOnBound&&n.boundLeft?s("v-if",!0):(o(),a("button",{key:0,type:"button","aria-label":e.i18n.slideLeft,disabled:n.boundLeft,class:"\n vs-carousel__arrows\n vs-carousel__arrows--left\n ",onClick:r[1]||(r[1]=e=>n.changeSlide(-1))}," ← ",8,["aria-label","disabled"])),f(c("button",{type:"button","aria-label":e.i18n.slideRight,disabled:n.boundRight,class:"\n vs-carousel__arrows\n vs-carousel__arrows--right\n ",onClick:r[2]||(r[2]=e=>n.changeSlide(1))}," → ",8,["aria-label","disabled"]),[[v,!e.hideArrowsOnBound||!n.boundRight]])])])},w.__file="src/components/Carousel/Carousel.vue";var _={name:"Slide",props:{tag:{type:String,default:"li"}}};_.render=function(e,r,t,n,l,s){return o(),a(u(t.tag),{ref:"vsSlide",class:"vs-carousel__slide",tabindex:"0"},{default:i(()=>[d(e.$slots,"default")]),_:3},512)},_.__file="src/components/Slide/Slide.vue";var L={install:function(e){e.component("carousel",w),e.component("slide",_)}};export default L;export{w as Carousel,_ as Slide}; diff --git a/dist/vue-snap.js b/dist/vue-snap.js index 815395b..f96cda6 100644 --- a/dist/vue-snap.js +++ b/dist/vue-snap.js @@ -1 +1 @@ -var VueSnap=function(e,t){"use strict";const n=e=>.5*(1-Math.cos(Math.PI*e)),r={_elementScroll:void 0,get elementScroll(){return this._elementScroll||(this._elementScroll=HTMLElement.prototype.scroll||HTMLElement.prototype.scrollTo||function(e,t){this.scrollLeft=e,this.scrollTop=t})},_elementScrollIntoView:void 0,get elementScrollIntoView(){return this._elementScrollIntoView||(this._elementScrollIntoView=HTMLElement.prototype.scrollIntoView)},_windowScroll:void 0,get windowScroll(){return this._windowScroll||(this._windowScroll=window.scroll||window.scrollTo)}},o=()=>{var e,t,n;return null!==(n=null===(t=null===(e=window.performance)||void 0===e?void 0:e.now)||void 0===t?void 0:t.call(e))&&void 0!==n?n:Date.now()},i=e=>{const t=(o()-e.timeStamp)/(e.duration||500);if(t>1)return e.method(e.targetX,e.targetY),void e.callback();const r=(e.timingFunc||n)(t),u=e.startX+(e.targetX-e.startX)*r,c=e.startY+(e.targetY-e.startY)*r;e.method(u,c),e.rafId=requestAnimationFrame(()=>{i(e)})},u=e=>Number.isNaN(e)||e===1/0||e===-1/0?0:e,c=(e,t)=>{const n=u(t.left||0)+e.scrollLeft,c=u(t.top||0)+e.scrollTop;return((e,t)=>{const n=r.elementScroll.bind(e);if(void 0===t.left&&void 0===t.top)return;const c=e.scrollLeft,a=e.scrollTop,l=u(t.left||c),f=u(t.top||a);if("smooth"!==t.behavior)return n(l,f);const s=()=>{window.removeEventListener("wheel",v),window.removeEventListener("touchmove",v)},d={timeStamp:o(),duration:t.duration,startX:c,startY:a,targetX:l,targetY:f,rafId:0,method:n,timingFunc:t.timingFunc,callback:s},v=()=>{cancelAnimationFrame(d.rafId),s()};window.addEventListener("wheel",v,{passive:!0,once:!0}),window.addEventListener("touchmove",v,{passive:!0,once:!0}),i(d)})(e,{...t,left:n,top:c})};var a=function(e,t,n){return Math.abs(e-t)<=n},l="undefined"==typeof window,f=!l;l||"scrollBehavior"in document.documentElement.style||c();var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function d(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var v=function(e){return e&&e.Math==Math&&e},p=v("object"==typeof globalThis&&globalThis)||v("object"==typeof window&&window)||v("object"==typeof self&&self)||v("object"==typeof s&&s)||Function("return this")(),m=function(e){try{return!!e()}catch(e){return!0}},y=!m((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),h={}.propertyIsEnumerable,b=Object.getOwnPropertyDescriptor,g={f:b&&!h.call({1:2},1)?function(e){var t=b(this,e);return!!t&&t.enumerable}:h},w=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},S={}.toString,O=function(e){return S.call(e).slice(8,-1)},j="".split,E=m((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==O(e)?j.call(e,""):Object(e)}:Object,T=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},_=function(e){return E(T(e))},A=function(e){return"object"==typeof e?null!==e:"function"==typeof e},I=function(e,t){if(!A(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!A(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!A(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!A(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},L={}.hasOwnProperty,x=function(e,t){return L.call(e,t)},C=p.document,M=A(C)&&A(C.createElement),k=function(e){return M?C.createElement(e):{}},N=!y&&!m((function(){return 7!=Object.defineProperty(k("div"),"a",{get:function(){return 7}}).a})),P=Object.getOwnPropertyDescriptor,B={f:y?P:function(e,t){if(e=_(e),t=I(t,!0),N)try{return P(e,t)}catch(e){}if(x(e,t))return w(!g.f.call(e,t),e[t])}},F=function(e){if(!A(e))throw TypeError(String(e)+" is not an object");return e},V=Object.defineProperty,W={f:y?V:function(e,t,n){if(F(e),t=I(t,!0),F(n),N)try{return V(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},$=y?function(e,t,n){return W.f(e,t,w(1,n))}:function(e,t,n){return e[t]=n,e},D=function(e,t){try{$(p,e,t)}catch(n){p[e]=t}return t},R="__core-js_shared__",X=p[R]||D(R,{}),Y=Function.toString;"function"!=typeof X.inspectSource&&(X.inspectSource=function(e){return Y.call(e)});var z,q,H,U=X.inspectSource,G=p.WeakMap,K="function"==typeof G&&/native code/.test(U(G)),J=d((function(e){(e.exports=function(e,t){return X[e]||(X[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),Q=0,Z=Math.random(),ee=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++Q+Z).toString(36)},te=J("keys"),ne=function(e){return te[e]||(te[e]=ee(e))},re={},oe=p.WeakMap;if(K){var ie=new oe,ue=ie.get,ce=ie.has,ae=ie.set;z=function(e,t){return ae.call(ie,e,t),t},q=function(e){return ue.call(ie,e)||{}},H=function(e){return ce.call(ie,e)}}else{var le=ne("state");re[le]=!0,z=function(e,t){return $(e,le,t),t},q=function(e){return x(e,le)?e[le]:{}},H=function(e){return x(e,le)}}var fe,se={set:z,get:q,has:H,enforce:function(e){return H(e)?q(e):z(e,{})},getterFor:function(e){return function(t){var n;if(!A(t)||(n=q(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},de=d((function(e){var t=se.get,n=se.enforce,r=String(String).split("String");(e.exports=function(e,t,o,i){var u=!!i&&!!i.unsafe,c=!!i&&!!i.enumerable,a=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof t||x(o,"name")||$(o,"name",t),n(o).source=r.join("string"==typeof t?t:"")),e!==p?(u?!a&&e[t]&&(c=!0):delete e[t],c?e[t]=o:$(e,t,o)):c?e[t]=o:D(t,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||U(this)}))})),ve=p,pe=function(e){return"function"==typeof e?e:void 0},me=function(e,t){return arguments.length<2?pe(ve[e])||pe(p[e]):ve[e]&&ve[e][t]||p[e]&&p[e][t]},ye=Math.ceil,he=Math.floor,be=function(e){return isNaN(e=+e)?0:(e>0?he:ye)(e)},ge=Math.min,we=function(e){return e>0?ge(be(e),9007199254740991):0},Se=Math.max,Oe=Math.min,je=function(e){return function(t,n,r){var o,i=_(t),u=we(i.length),c=function(e,t){var n=be(e);return n<0?Se(n+t,0):Oe(n,t)}(r,u);if(e&&n!=n){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((e||c in i)&&i[c]===n)return e||c||0;return!e&&-1}},Ee={includes:je(!0),indexOf:je(!1)}.indexOf,Te=function(e,t){var n,r=_(e),o=0,i=[];for(n in r)!x(re,n)&&x(r,n)&&i.push(n);for(;t.length>o;)x(r,n=t[o++])&&(~Ee(i,n)||i.push(n));return i},_e=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ae=_e.concat("length","prototype"),Ie={f:Object.getOwnPropertyNames||function(e){return Te(e,Ae)}},Le={f:Object.getOwnPropertySymbols},xe=me("Reflect","ownKeys")||function(e){var t=Ie.f(F(e)),n=Le.f;return n?t.concat(n(e)):t},Ce=function(e,t){for(var n=xe(t),r=W.f,o=B.f,i=0;ih;h++)if((u||h in p)&&(d=m(s=p[h],h,v),e))if(t)g[h]=d;else if(d)switch(e){case 3:return!0;case 5:return s;case 6:return h;case 2:Je.call(g,s)}else if(o)return!1;return i?-1:r||o?o:g}},Ze={forEach:Qe(0),map:Qe(1),filter:Qe(2),some:Qe(3),every:Qe(4),find:Qe(5),findIndex:Qe(6)},et=Object.keys||function(e){return Te(e,_e)},tt=y?Object.defineProperties:function(e,t){F(e);for(var n,r=et(t),o=r.length,i=0;o>i;)W.f(e,n=r[i++],t[n]);return e},nt=me("document","documentElement"),rt=ne("IE_PROTO"),ot=function(){},it=function(e){return"