Socket
Socket
Sign inDemoInstall

vue-tinybox

Package Overview
Dependencies
0
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.2.0

2

dist/tinybox.esm.js

@@ -1,1 +0,1 @@

var e={name:"Tinybox",model:{prop:"index",event:"change"},props:{images:{type:Array,default:function(){return[]}},index:{type:Number,default:null},loop:{type:Boolean,default:!1},noThumbs:{type:Boolean,default:!1}},data:function(){return{slide:"next",swipeDone:!1,swipeX:null}},computed:{open:function(){return null!=this.index},prevImage:function(){return this.index>0?this.index-1:this.loop?this.images.length-1:this.index},nextImage:function(){return this.index<this.images.length-1?this.index+1:this.loop?0:this.index}},watch:{open:function(e){e?window.addEventListener("keyup",this.keyup):window.removeEventListener("keyup",this.keyup)}},methods:{close:function(){this.goto(null)},prev:function(){this.goto(this.prevImage,"prev")},next:function(){this.goto(this.nextImage,"next")},goto:function(e,t){this.slide=t||(this.index<e?"next":"prev"),this.$emit("change",e)},keyup:function(e){"ArrowRight"===e.code||"ArrowRight"===e.key||"Right"===e.key||39===e.keyCode?this.next():"ArrowLeft"===e.code||"ArrowLeft"===e.key||"Left"===e.key||37===e.keyCode?this.prev():"Escape"!==e.code&&"Escape"!==e.key&&"Esc"!==e.key&&27!==e.keyCode||this.close()},swipeStart:function(e){this.swipeDone=!1,1===e.changedTouches.length&&(this.swipeX=e.changedTouches[0].screenX)},swipe:function(e){if(!this.swipeDone&&1===e.changedTouches.length){var t=e.changedTouches[0].screenX-this.swipeX;t>=50?(this.prev(),this.swipeDone=!0):t<=-50&&(this.next(),this.swipeDone=!0)}}}};var t,n="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());var o={};const i=function(e,t,n,o,i,a,s,c,d,r){"boolean"!=typeof s&&(d=c,c=s,s=!1);var l,p="function"==typeof n?n.options:n;if(e&&e.render&&(p.render=e.render,p.staticRenderFns=e.staticRenderFns,p._compiled=!0,i&&(p.functional=!0)),o&&(p._scopeId=o),a?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(a)},p._ssrRegister=l):t&&(l=s?function(e){t.call(this,r(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,c(e))}),l)if(p.functional){var h=p.render;p.render=function(e,t){return l.call(t),h(e,t)}}else{var u=p.beforeCreate;p.beforeCreate=u?[].concat(u,l):[l]}return n}({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"fade"}},[e.open?n("div",{staticClass:"tinybox",on:{click:e.close,wheel:function(e){e.preventDefault()},touchmove:function(e){e.preventDefault()}}},[n("div",{staticClass:"tinybox__content",class:{"tinybox__content--no-thumbs":e.noThumbs},on:{touchstart:e.swipeStart,touchmove:e.swipe}},[n("transition",{attrs:{name:e.slide}},[n("img",{key:e.images[e.index].src||e.images[e.index]||"",staticClass:"tinybox__content__image",attrs:{src:e.images[e.index].src||e.images[e.index]||"",alt:e.images[e.index].alt||e.images[e.index].caption||""},on:{click:function(t){return t.stopPropagation(),e.next(t)}}})]),e.images[e.index].caption?n("span",{staticClass:"tinybox__content__image__caption"},[e._v(" "+e._s(e.images[e.index].caption)+" ")]):e._e(),e.prevImage!==e.index?n("div",{staticClass:"tinybox__content__control tinybox__content__control--prev",on:{click:function(t){return t.stopPropagation(),e.prev(t)}}}):e._e(),e.nextImage!==e.index?n("div",{staticClass:"tinybox__content__control tinybox__content__control--next",on:{click:function(t){return t.stopPropagation(),e.next(t)}}}):e._e(),n("div",{staticClass:"tinybox__content__control tinybox__content__control--close",on:{click:function(t){return t.stopPropagation(),e.close(t)}}})],1),e.noThumbs?e._e():n("div",{staticClass:"tinybox__thumbs",on:{touchmove:function(e){e.stopPropagation()},wheel:function(e){e.stopPropagation()}}},e._l(e.images,(function(t,o){return n("img",{key:o,staticClass:"tinybox__thumbs__item",class:{"tinybox__thumbs__item--active":e.index===o},attrs:{src:t.thumbnail||t.src||t||"",alt:e.images[e.index].alt||e.images[e.index].caption||""},on:{click:function(t){return t.stopPropagation(),e.goto(o)}}})})),0)]):e._e()])},staticRenderFns:[]},(function(e){e&&e("data-v-74dcbdac_0",{source:".tinybox[data-v-74dcbdac]{background-color:rgba(0,0,0,.9);bottom:0;left:0;position:fixed;right:0;text-align:center;top:0;z-index:1000}.tinybox__content[data-v-74dcbdac]{height:85%;position:relative;width:100%;display:flex;align-items:center;justify-content:center}.tinybox__content--no-thumbs[data-v-74dcbdac]{height:100%}.tinybox__content__image[data-v-74dcbdac]{background-color:#222;cursor:pointer;display:inline-block;max-height:90%;max-width:80%;position:absolute}.tinybox__content__image__caption[data-v-74dcbdac]{position:absolute;bottom:0;padding:.5rem .75rem;border-radius:5px;color:#fff;background-color:rgba(0,0,0,.9);opacity:.75;font-family:sans-serif;font-weight:lighter;font-size:1.2rem}.tinybox__content__control[data-v-74dcbdac]{background:no-repeat center/24px;cursor:pointer;opacity:.5;position:absolute;top:0;transition:opacity .3s ease;width:4em}.tinybox__content__control[data-v-74dcbdac]:hover{opacity:1}.tinybox__content__control--prev[data-v-74dcbdac]{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 -2 28 36' width='40' height='60' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3'%3E%3Cpath d='M20 30 L8 16 20 2' /%3E%3C/svg%3E\");bottom:0;left:0}.tinybox__content__control--next[data-v-74dcbdac]{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 -2 28 36' width='40' height='60' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3'%3E%3Cpath d='M12 30 L24 16 12 2' /%3E%3C/svg%3E\");bottom:0;right:0}.tinybox__content__control--close[data-v-74dcbdac]{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-5 -5 46 46' width='40' height='40' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='4'%3E%3Cpath d='M2 30 L30 2 M30 30 L2 2' /%3E%3C/svg%3E\");height:2.6em;right:0}.tinybox__thumbs[data-v-74dcbdac]{bottom:0;height:15%;left:0;line-height:0;padding:0 10px;position:absolute;right:0;overflow-x:scroll;overflow-y:hidden;white-space:nowrap}.tinybox__thumbs__item[data-v-74dcbdac]{cursor:pointer;display:inline-block;height:10vh;margin:2.5vh 5px;object-fit:cover;overflow:hidden;width:10vh}.tinybox__thumbs__item--active[data-v-74dcbdac]{opacity:.3}.fade-enter[data-v-74dcbdac],.fade-leave-active[data-v-74dcbdac],.next-enter[data-v-74dcbdac],.next-leave-active[data-v-74dcbdac],.prev-enter[data-v-74dcbdac],.prev-leave-active[data-v-74dcbdac]{opacity:0}.fade-enter-active[data-v-74dcbdac],.fade-leave-active[data-v-74dcbdac],.next-leave-active[data-v-74dcbdac],.prev-leave-active[data-v-74dcbdac]{transition:opacity .3s ease}.prev-enter[data-v-74dcbdac]{transform:translateX(-40px)}.next-enter[data-v-74dcbdac]{transform:translateX(40px)}.next-enter-active[data-v-74dcbdac],.prev-enter-active[data-v-74dcbdac]{transition:opacity .3s ease,transform .3s ease}",map:void 0,media:void 0})}),e,"data-v-74dcbdac",!1,void 0,!1,(function(e){return function(e,i){return function(e,i){var a=n?i.media||"default":e,s=o[a]||(o[a]={ids:new Set,styles:[]});if(!s.ids.has(e)){s.ids.add(e);var c=i.source;if(i.map&&(c+="\n/*# sourceURL="+i.map.sources[0]+" */",c+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i.map))))+" */"),s.element||(s.element=document.createElement("style"),s.element.type="text/css",i.media&&s.element.setAttribute("media",i.media),void 0===t&&(t=document.head||document.getElementsByTagName("head")[0]),t.appendChild(s.element)),"styleSheet"in s.element)s.styles.push(c),s.element.styleSheet.cssText=s.styles.filter(Boolean).join("\n");else{var d=s.ids.size-1,r=document.createTextNode(c),l=s.element.childNodes;l[d]&&s.element.removeChild(l[d]),l.length?s.element.insertBefore(r,l[d]):s.element.appendChild(r)}}}(e,i)}}),void 0,void 0);var a=null;"undefined"!=typeof window?a=window.Vue:"undefined"!=typeof global&&(a=global.Vue),a&&a.use({install:function e(t){e.installed||(e.installed=!0,t.component(i.name,i))}});export default i;
var e={name:"Tinybox",model:{prop:"index",event:"change"},props:{images:{type:Array,default:function(){return[]}},index:{type:Number,default:null},loop:{type:Boolean,default:!1},noThumbs:{type:Boolean,default:!1}},data:function(){return{slide:"next",swipeDone:!1,swipeX:null}},computed:{open:function(){return null!=this.index},prevImage:function(){return this.index>0?this.index-1:this.loop?this.images.length-1:this.index},nextImage:function(){return this.index<this.images.length-1?this.index+1:this.loop?0:this.index}},watch:{open:function(e){e?window.addEventListener("keyup",this.keyup):window.removeEventListener("keyup",this.keyup)},index:function(e){var t=this;this.noThumbs||null==e||this.$nextTick((function(){var n=t.$refs,o=n.thumbs,i=n.thumbItems[e];if(i.offsetLeft+i.clientWidth/2>window.innerWidth/2){var a=i.offsetLeft-window.innerWidth/2;a<o.scrollWidth?o.scrollLeft=a+i.clientWidth/2:o.scrollLeft=o.scrollWidth}else o.scrollLeft=0}))}},methods:{close:function(){this.goto(null)},prev:function(){this.goto(this.prevImage,"prev")},next:function(){this.goto(this.nextImage,"next")},goto:function(e,t){this.slide=t||(this.index<e?"next":"prev"),this.$emit("change",e)},keyup:function(e){"ArrowRight"===e.code||"ArrowRight"===e.key||"Right"===e.key||39===e.keyCode?this.next():"ArrowLeft"===e.code||"ArrowLeft"===e.key||"Left"===e.key||37===e.keyCode?this.prev():"Escape"!==e.code&&"Escape"!==e.key&&"Esc"!==e.key&&27!==e.keyCode||this.close()},swipeStart:function(e){this.swipeDone=!1,1===e.changedTouches.length&&(this.swipeX=e.changedTouches[0].screenX)},swipe:function(e){if(!this.swipeDone&&1===e.changedTouches.length){var t=e.changedTouches[0].screenX-this.swipeX;t>=50?(this.prev(),this.swipeDone=!0):t<=-50&&(this.next(),this.swipeDone=!0)}}}};function t(e,t,n,o,i,a,s,r,d,c){"boolean"!=typeof s&&(d=r,r=s,s=!1);var l,f="function"==typeof n?n.options:n;if(e&&e.render&&(f.render=e.render,f.staticRenderFns=e.staticRenderFns,f._compiled=!0,i&&(f.functional=!0)),o&&(f._scopeId=o),a?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(a)},f._ssrRegister=l):t&&(l=s?function(e){t.call(this,c(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,r(e))}),l)if(f.functional){var h=f.render;f.render=function(e,t){return l.call(t),h(e,t)}}else{var p=f.beforeCreate;f.beforeCreate=p?[].concat(p,l):[l]}return n}var n,o="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function i(e){return function(e,t){return function(e,t){var i=o?t.media||"default":e,s=a[i]||(a[i]={ids:new Set,styles:[]});if(!s.ids.has(e)){s.ids.add(e);var r=t.source;if(t.map&&(r+="\n/*# sourceURL="+t.map.sources[0]+" */",r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),s.element||(s.element=document.createElement("style"),s.element.type="text/css",t.media&&s.element.setAttribute("media",t.media),void 0===n&&(n=document.head||document.getElementsByTagName("head")[0]),n.appendChild(s.element)),"styleSheet"in s.element)s.styles.push(r),s.element.styleSheet.cssText=s.styles.filter(Boolean).join("\n");else{var d=s.ids.size-1,c=document.createTextNode(r),l=s.element.childNodes;l[d]&&s.element.removeChild(l[d]),l.length?s.element.insertBefore(c,l[d]):s.element.appendChild(c)}}}(e,t)}}var a={};const s=t({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"fade"}},[e.open?n("div",{staticClass:"tinybox",on:{click:e.close,wheel:function(e){e.preventDefault()},touchmove:function(e){e.preventDefault()}}},[n("div",{staticClass:"tinybox__content",class:{"tinybox__content--no-thumbs":e.noThumbs},on:{touchstart:e.swipeStart,touchmove:e.swipe}},[n("transition",{attrs:{name:e.slide}},[n("img",{key:e.images[e.index].src||e.images[e.index]||"",staticClass:"tinybox__content__image",attrs:{src:e.images[e.index].src||e.images[e.index]||"",alt:e.images[e.index].alt||e.images[e.index].caption||""},on:{click:function(t){return t.stopPropagation(),e.next(t)}}})]),e.images[e.index].caption?n("span",{staticClass:"tinybox__content__image__caption"},[e._v(" "+e._s(e.images[e.index].caption)+" ")]):e._e(),e.prevImage!==e.index?n("div",{staticClass:"tinybox__content__control tinybox__content__control--prev",on:{click:function(t){return t.stopPropagation(),e.prev(t)}}}):e._e(),e.nextImage!==e.index?n("div",{staticClass:"tinybox__content__control tinybox__content__control--next",on:{click:function(t){return t.stopPropagation(),e.next(t)}}}):e._e(),n("div",{staticClass:"tinybox__content__control tinybox__content__control--close",on:{click:function(t){return t.stopPropagation(),e.close(t)}}})],1),e.noThumbs?e._e():n("div",{ref:"thumbs",staticClass:"tinybox__thumbs",on:{touchmove:function(e){e.stopPropagation()},wheel:function(e){e.stopPropagation()}}},e._l(e.images,(function(t,o){return n("img",{key:o,ref:"thumbItems",refInFor:!0,staticClass:"tinybox__thumbs__item",class:{"tinybox__thumbs__item--active":e.index===o},attrs:{src:t.thumbnail||t.src||t||"",alt:e.images[e.index].alt||e.images[e.index].caption||""},on:{click:function(t){return t.stopPropagation(),e.goto(o)}}})})),0)]):e._e()])},staticRenderFns:[]},(function(e){e&&e("data-v-b0df26f4_0",{source:".tinybox[data-v-b0df26f4]{background-color:rgba(0,0,0,.9);bottom:0;left:0;position:fixed;right:0;text-align:center;top:0;z-index:1000}.tinybox__content[data-v-b0df26f4]{height:85%;position:relative;width:100%;display:flex;align-items:center;justify-content:center}.tinybox__content--no-thumbs[data-v-b0df26f4]{height:100%}.tinybox__content__image[data-v-b0df26f4]{background-color:#222;cursor:pointer;display:inline-block;max-height:90%;max-width:80%;position:absolute}.tinybox__content__image__caption[data-v-b0df26f4]{position:absolute;bottom:0;padding:.5rem .75rem;border-radius:5px;color:#fff;background-color:rgba(0,0,0,.9);opacity:.75;font-family:sans-serif;font-weight:lighter;font-size:1.2rem}.tinybox__content__control[data-v-b0df26f4]{background:no-repeat center/24px;cursor:pointer;opacity:.5;position:absolute;top:0;transition:opacity .3s ease;width:4em}.tinybox__content__control[data-v-b0df26f4]:hover{opacity:1}.tinybox__content__control--prev[data-v-b0df26f4]{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 -2 28 36' width='40' height='60' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3'%3E%3Cpath d='M20 30 L8 16 20 2' /%3E%3C/svg%3E\");bottom:0;left:0}.tinybox__content__control--next[data-v-b0df26f4]{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 -2 28 36' width='40' height='60' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3'%3E%3Cpath d='M12 30 L24 16 12 2' /%3E%3C/svg%3E\");bottom:0;right:0}.tinybox__content__control--close[data-v-b0df26f4]{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-5 -5 46 46' width='40' height='40' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='4'%3E%3Cpath d='M2 30 L30 2 M30 30 L2 2' /%3E%3C/svg%3E\");height:2.6em;right:0}.tinybox__thumbs[data-v-b0df26f4]{bottom:0;height:15%;left:0;line-height:0;padding:0 10px;position:absolute;right:0;overflow-x:scroll;overflow-y:hidden;scroll-behavior:smooth;white-space:nowrap}.tinybox__thumbs__item[data-v-b0df26f4]{cursor:pointer;display:inline-block;height:10vh;margin:2.5vh 5px;object-fit:cover;overflow:hidden;width:10vh}.tinybox__thumbs__item--active[data-v-b0df26f4]{opacity:.3}.fade-enter[data-v-b0df26f4],.fade-leave-active[data-v-b0df26f4],.next-enter[data-v-b0df26f4],.next-leave-active[data-v-b0df26f4],.prev-enter[data-v-b0df26f4],.prev-leave-active[data-v-b0df26f4]{opacity:0}.fade-enter-active[data-v-b0df26f4],.fade-leave-active[data-v-b0df26f4],.next-leave-active[data-v-b0df26f4],.prev-leave-active[data-v-b0df26f4]{transition:opacity .3s ease}.prev-enter[data-v-b0df26f4]{transform:translateX(-40px)}.next-enter[data-v-b0df26f4]{transform:translateX(40px)}.next-enter-active[data-v-b0df26f4],.prev-enter-active[data-v-b0df26f4]{transition:opacity .3s ease,transform .3s ease}",map:void 0,media:void 0})}),e,"data-v-b0df26f4",!1,void 0,!1,i,void 0,void 0);var r=null;"undefined"!=typeof window?r=window.Vue:"undefined"!=typeof global&&(r=global.Vue),r&&r.use({install:function e(t){e.installed||(e.installed=!0,t.component(s.name,s))}});export default s;

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Tinybox=t()}(this,(function(){"use strict";var e={name:"Tinybox",model:{prop:"index",event:"change"},props:{images:{type:Array,default:function(){return[]}},index:{type:Number,default:null},loop:{type:Boolean,default:!1},noThumbs:{type:Boolean,default:!1}},data:function(){return{slide:"next",swipeDone:!1,swipeX:null}},computed:{open:function(){return null!=this.index},prevImage:function(){return this.index>0?this.index-1:this.loop?this.images.length-1:this.index},nextImage:function(){return this.index<this.images.length-1?this.index+1:this.loop?0:this.index}},watch:{open:function(e){e?window.addEventListener("keyup",this.keyup):window.removeEventListener("keyup",this.keyup)}},methods:{close:function(){this.goto(null)},prev:function(){this.goto(this.prevImage,"prev")},next:function(){this.goto(this.nextImage,"next")},goto:function(e,t){this.slide=t||(this.index<e?"next":"prev"),this.$emit("change",e)},keyup:function(e){"ArrowRight"===e.code||"ArrowRight"===e.key||"Right"===e.key||39===e.keyCode?this.next():"ArrowLeft"===e.code||"ArrowLeft"===e.key||"Left"===e.key||37===e.keyCode?this.prev():"Escape"!==e.code&&"Escape"!==e.key&&"Esc"!==e.key&&27!==e.keyCode||this.close()},swipeStart:function(e){this.swipeDone=!1,1===e.changedTouches.length&&(this.swipeX=e.changedTouches[0].screenX)},swipe:function(e){if(!this.swipeDone&&1===e.changedTouches.length){var t=e.changedTouches[0].screenX-this.swipeX;t>=50?(this.prev(),this.swipeDone=!0):t<=-50&&(this.next(),this.swipeDone=!0)}}}};var t,n="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());var o={};const i=function(e,t,n,o,i,a,s,c,d,r){"boolean"!=typeof s&&(d=c,c=s,s=!1);var l,p="function"==typeof n?n.options:n;if(e&&e.render&&(p.render=e.render,p.staticRenderFns=e.staticRenderFns,p._compiled=!0,i&&(p.functional=!0)),o&&(p._scopeId=o),a?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(a)},p._ssrRegister=l):t&&(l=s?function(e){t.call(this,r(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,c(e))}),l)if(p.functional){var u=p.render;p.render=function(e,t){return l.call(t),u(e,t)}}else{var h=p.beforeCreate;p.beforeCreate=h?[].concat(h,l):[l]}return n}({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"fade"}},[e.open?n("div",{staticClass:"tinybox",on:{click:e.close,wheel:function(e){e.preventDefault()},touchmove:function(e){e.preventDefault()}}},[n("div",{staticClass:"tinybox__content",class:{"tinybox__content--no-thumbs":e.noThumbs},on:{touchstart:e.swipeStart,touchmove:e.swipe}},[n("transition",{attrs:{name:e.slide}},[n("img",{key:e.images[e.index].src||e.images[e.index]||"",staticClass:"tinybox__content__image",attrs:{src:e.images[e.index].src||e.images[e.index]||"",alt:e.images[e.index].alt||e.images[e.index].caption||""},on:{click:function(t){return t.stopPropagation(),e.next(t)}}})]),e.images[e.index].caption?n("span",{staticClass:"tinybox__content__image__caption"},[e._v(" "+e._s(e.images[e.index].caption)+" ")]):e._e(),e.prevImage!==e.index?n("div",{staticClass:"tinybox__content__control tinybox__content__control--prev",on:{click:function(t){return t.stopPropagation(),e.prev(t)}}}):e._e(),e.nextImage!==e.index?n("div",{staticClass:"tinybox__content__control tinybox__content__control--next",on:{click:function(t){return t.stopPropagation(),e.next(t)}}}):e._e(),n("div",{staticClass:"tinybox__content__control tinybox__content__control--close",on:{click:function(t){return t.stopPropagation(),e.close(t)}}})],1),e.noThumbs?e._e():n("div",{staticClass:"tinybox__thumbs",on:{touchmove:function(e){e.stopPropagation()},wheel:function(e){e.stopPropagation()}}},e._l(e.images,(function(t,o){return n("img",{key:o,staticClass:"tinybox__thumbs__item",class:{"tinybox__thumbs__item--active":e.index===o},attrs:{src:t.thumbnail||t.src||t||"",alt:e.images[e.index].alt||e.images[e.index].caption||""},on:{click:function(t){return t.stopPropagation(),e.goto(o)}}})})),0)]):e._e()])},staticRenderFns:[]},(function(e){e&&e("data-v-74dcbdac_0",{source:".tinybox[data-v-74dcbdac]{background-color:rgba(0,0,0,.9);bottom:0;left:0;position:fixed;right:0;text-align:center;top:0;z-index:1000}.tinybox__content[data-v-74dcbdac]{height:85%;position:relative;width:100%;display:flex;align-items:center;justify-content:center}.tinybox__content--no-thumbs[data-v-74dcbdac]{height:100%}.tinybox__content__image[data-v-74dcbdac]{background-color:#222;cursor:pointer;display:inline-block;max-height:90%;max-width:80%;position:absolute}.tinybox__content__image__caption[data-v-74dcbdac]{position:absolute;bottom:0;padding:.5rem .75rem;border-radius:5px;color:#fff;background-color:rgba(0,0,0,.9);opacity:.75;font-family:sans-serif;font-weight:lighter;font-size:1.2rem}.tinybox__content__control[data-v-74dcbdac]{background:no-repeat center/24px;cursor:pointer;opacity:.5;position:absolute;top:0;transition:opacity .3s ease;width:4em}.tinybox__content__control[data-v-74dcbdac]:hover{opacity:1}.tinybox__content__control--prev[data-v-74dcbdac]{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 -2 28 36' width='40' height='60' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3'%3E%3Cpath d='M20 30 L8 16 20 2' /%3E%3C/svg%3E\");bottom:0;left:0}.tinybox__content__control--next[data-v-74dcbdac]{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 -2 28 36' width='40' height='60' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3'%3E%3Cpath d='M12 30 L24 16 12 2' /%3E%3C/svg%3E\");bottom:0;right:0}.tinybox__content__control--close[data-v-74dcbdac]{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-5 -5 46 46' width='40' height='40' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='4'%3E%3Cpath d='M2 30 L30 2 M30 30 L2 2' /%3E%3C/svg%3E\");height:2.6em;right:0}.tinybox__thumbs[data-v-74dcbdac]{bottom:0;height:15%;left:0;line-height:0;padding:0 10px;position:absolute;right:0;overflow-x:scroll;overflow-y:hidden;white-space:nowrap}.tinybox__thumbs__item[data-v-74dcbdac]{cursor:pointer;display:inline-block;height:10vh;margin:2.5vh 5px;object-fit:cover;overflow:hidden;width:10vh}.tinybox__thumbs__item--active[data-v-74dcbdac]{opacity:.3}.fade-enter[data-v-74dcbdac],.fade-leave-active[data-v-74dcbdac],.next-enter[data-v-74dcbdac],.next-leave-active[data-v-74dcbdac],.prev-enter[data-v-74dcbdac],.prev-leave-active[data-v-74dcbdac]{opacity:0}.fade-enter-active[data-v-74dcbdac],.fade-leave-active[data-v-74dcbdac],.next-leave-active[data-v-74dcbdac],.prev-leave-active[data-v-74dcbdac]{transition:opacity .3s ease}.prev-enter[data-v-74dcbdac]{transform:translateX(-40px)}.next-enter[data-v-74dcbdac]{transform:translateX(40px)}.next-enter-active[data-v-74dcbdac],.prev-enter-active[data-v-74dcbdac]{transition:opacity .3s ease,transform .3s ease}",map:void 0,media:void 0})}),e,"data-v-74dcbdac",!1,void 0,!1,(function(e){return function(e,i){return function(e,i){var a=n?i.media||"default":e,s=o[a]||(o[a]={ids:new Set,styles:[]});if(!s.ids.has(e)){s.ids.add(e);var c=i.source;if(i.map&&(c+="\n/*# sourceURL="+i.map.sources[0]+" */",c+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i.map))))+" */"),s.element||(s.element=document.createElement("style"),s.element.type="text/css",i.media&&s.element.setAttribute("media",i.media),void 0===t&&(t=document.head||document.getElementsByTagName("head")[0]),t.appendChild(s.element)),"styleSheet"in s.element)s.styles.push(c),s.element.styleSheet.cssText=s.styles.filter(Boolean).join("\n");else{var d=s.ids.size-1,r=document.createTextNode(c),l=s.element.childNodes;l[d]&&s.element.removeChild(l[d]),l.length?s.element.insertBefore(r,l[d]):s.element.appendChild(r)}}}(e,i)}}),void 0,void 0);var a=null;return"undefined"!=typeof window?a=window.Vue:"undefined"!=typeof global&&(a=global.Vue),a&&a.use({install:function e(t){e.installed||(e.installed=!0,t.component(i.name,i))}}),i}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Tinybox=t()}(this,(function(){"use strict";var e={name:"Tinybox",model:{prop:"index",event:"change"},props:{images:{type:Array,default:function(){return[]}},index:{type:Number,default:null},loop:{type:Boolean,default:!1},noThumbs:{type:Boolean,default:!1}},data:function(){return{slide:"next",swipeDone:!1,swipeX:null}},computed:{open:function(){return null!=this.index},prevImage:function(){return this.index>0?this.index-1:this.loop?this.images.length-1:this.index},nextImage:function(){return this.index<this.images.length-1?this.index+1:this.loop?0:this.index}},watch:{open:function(e){e?window.addEventListener("keyup",this.keyup):window.removeEventListener("keyup",this.keyup)},index:function(e){var t=this;this.noThumbs||null==e||this.$nextTick((function(){var n=t.$refs,o=n.thumbs,i=n.thumbItems[e];if(i.offsetLeft+i.clientWidth/2>window.innerWidth/2){var a=i.offsetLeft-window.innerWidth/2;a<o.scrollWidth?o.scrollLeft=a+i.clientWidth/2:o.scrollLeft=o.scrollWidth}else o.scrollLeft=0}))}},methods:{close:function(){this.goto(null)},prev:function(){this.goto(this.prevImage,"prev")},next:function(){this.goto(this.nextImage,"next")},goto:function(e,t){this.slide=t||(this.index<e?"next":"prev"),this.$emit("change",e)},keyup:function(e){"ArrowRight"===e.code||"ArrowRight"===e.key||"Right"===e.key||39===e.keyCode?this.next():"ArrowLeft"===e.code||"ArrowLeft"===e.key||"Left"===e.key||37===e.keyCode?this.prev():"Escape"!==e.code&&"Escape"!==e.key&&"Esc"!==e.key&&27!==e.keyCode||this.close()},swipeStart:function(e){this.swipeDone=!1,1===e.changedTouches.length&&(this.swipeX=e.changedTouches[0].screenX)},swipe:function(e){if(!this.swipeDone&&1===e.changedTouches.length){var t=e.changedTouches[0].screenX-this.swipeX;t>=50?(this.prev(),this.swipeDone=!0):t<=-50&&(this.next(),this.swipeDone=!0)}}}};function t(e,t,n,o,i,a,s,r,d,c){"boolean"!=typeof s&&(d=r,r=s,s=!1);var l,f="function"==typeof n?n.options:n;if(e&&e.render&&(f.render=e.render,f.staticRenderFns=e.staticRenderFns,f._compiled=!0,i&&(f.functional=!0)),o&&(f._scopeId=o),a?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(a)},f._ssrRegister=l):t&&(l=s?function(e){t.call(this,c(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,r(e))}),l)if(f.functional){var h=f.render;f.render=function(e,t){return l.call(t),h(e,t)}}else{var u=f.beforeCreate;f.beforeCreate=u?[].concat(u,l):[l]}return n}var n,o="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function i(e){return function(e,t){return function(e,t){var i=o?t.media||"default":e,s=a[i]||(a[i]={ids:new Set,styles:[]});if(!s.ids.has(e)){s.ids.add(e);var r=t.source;if(t.map&&(r+="\n/*# sourceURL="+t.map.sources[0]+" */",r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),s.element||(s.element=document.createElement("style"),s.element.type="text/css",t.media&&s.element.setAttribute("media",t.media),void 0===n&&(n=document.head||document.getElementsByTagName("head")[0]),n.appendChild(s.element)),"styleSheet"in s.element)s.styles.push(r),s.element.styleSheet.cssText=s.styles.filter(Boolean).join("\n");else{var d=s.ids.size-1,c=document.createTextNode(r),l=s.element.childNodes;l[d]&&s.element.removeChild(l[d]),l.length?s.element.insertBefore(c,l[d]):s.element.appendChild(c)}}}(e,t)}}var a={};const s=t({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"fade"}},[e.open?n("div",{staticClass:"tinybox",on:{click:e.close,wheel:function(e){e.preventDefault()},touchmove:function(e){e.preventDefault()}}},[n("div",{staticClass:"tinybox__content",class:{"tinybox__content--no-thumbs":e.noThumbs},on:{touchstart:e.swipeStart,touchmove:e.swipe}},[n("transition",{attrs:{name:e.slide}},[n("img",{key:e.images[e.index].src||e.images[e.index]||"",staticClass:"tinybox__content__image",attrs:{src:e.images[e.index].src||e.images[e.index]||"",alt:e.images[e.index].alt||e.images[e.index].caption||""},on:{click:function(t){return t.stopPropagation(),e.next(t)}}})]),e.images[e.index].caption?n("span",{staticClass:"tinybox__content__image__caption"},[e._v(" "+e._s(e.images[e.index].caption)+" ")]):e._e(),e.prevImage!==e.index?n("div",{staticClass:"tinybox__content__control tinybox__content__control--prev",on:{click:function(t){return t.stopPropagation(),e.prev(t)}}}):e._e(),e.nextImage!==e.index?n("div",{staticClass:"tinybox__content__control tinybox__content__control--next",on:{click:function(t){return t.stopPropagation(),e.next(t)}}}):e._e(),n("div",{staticClass:"tinybox__content__control tinybox__content__control--close",on:{click:function(t){return t.stopPropagation(),e.close(t)}}})],1),e.noThumbs?e._e():n("div",{ref:"thumbs",staticClass:"tinybox__thumbs",on:{touchmove:function(e){e.stopPropagation()},wheel:function(e){e.stopPropagation()}}},e._l(e.images,(function(t,o){return n("img",{key:o,ref:"thumbItems",refInFor:!0,staticClass:"tinybox__thumbs__item",class:{"tinybox__thumbs__item--active":e.index===o},attrs:{src:t.thumbnail||t.src||t||"",alt:e.images[e.index].alt||e.images[e.index].caption||""},on:{click:function(t){return t.stopPropagation(),e.goto(o)}}})})),0)]):e._e()])},staticRenderFns:[]},(function(e){e&&e("data-v-b0df26f4_0",{source:".tinybox[data-v-b0df26f4]{background-color:rgba(0,0,0,.9);bottom:0;left:0;position:fixed;right:0;text-align:center;top:0;z-index:1000}.tinybox__content[data-v-b0df26f4]{height:85%;position:relative;width:100%;display:flex;align-items:center;justify-content:center}.tinybox__content--no-thumbs[data-v-b0df26f4]{height:100%}.tinybox__content__image[data-v-b0df26f4]{background-color:#222;cursor:pointer;display:inline-block;max-height:90%;max-width:80%;position:absolute}.tinybox__content__image__caption[data-v-b0df26f4]{position:absolute;bottom:0;padding:.5rem .75rem;border-radius:5px;color:#fff;background-color:rgba(0,0,0,.9);opacity:.75;font-family:sans-serif;font-weight:lighter;font-size:1.2rem}.tinybox__content__control[data-v-b0df26f4]{background:no-repeat center/24px;cursor:pointer;opacity:.5;position:absolute;top:0;transition:opacity .3s ease;width:4em}.tinybox__content__control[data-v-b0df26f4]:hover{opacity:1}.tinybox__content__control--prev[data-v-b0df26f4]{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 -2 28 36' width='40' height='60' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3'%3E%3Cpath d='M20 30 L8 16 20 2' /%3E%3C/svg%3E\");bottom:0;left:0}.tinybox__content__control--next[data-v-b0df26f4]{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='2 -2 28 36' width='40' height='60' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3'%3E%3Cpath d='M12 30 L24 16 12 2' /%3E%3C/svg%3E\");bottom:0;right:0}.tinybox__content__control--close[data-v-b0df26f4]{background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-5 -5 46 46' width='40' height='40' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='4'%3E%3Cpath d='M2 30 L30 2 M30 30 L2 2' /%3E%3C/svg%3E\");height:2.6em;right:0}.tinybox__thumbs[data-v-b0df26f4]{bottom:0;height:15%;left:0;line-height:0;padding:0 10px;position:absolute;right:0;overflow-x:scroll;overflow-y:hidden;scroll-behavior:smooth;white-space:nowrap}.tinybox__thumbs__item[data-v-b0df26f4]{cursor:pointer;display:inline-block;height:10vh;margin:2.5vh 5px;object-fit:cover;overflow:hidden;width:10vh}.tinybox__thumbs__item--active[data-v-b0df26f4]{opacity:.3}.fade-enter[data-v-b0df26f4],.fade-leave-active[data-v-b0df26f4],.next-enter[data-v-b0df26f4],.next-leave-active[data-v-b0df26f4],.prev-enter[data-v-b0df26f4],.prev-leave-active[data-v-b0df26f4]{opacity:0}.fade-enter-active[data-v-b0df26f4],.fade-leave-active[data-v-b0df26f4],.next-leave-active[data-v-b0df26f4],.prev-leave-active[data-v-b0df26f4]{transition:opacity .3s ease}.prev-enter[data-v-b0df26f4]{transform:translateX(-40px)}.next-enter[data-v-b0df26f4]{transform:translateX(40px)}.next-enter-active[data-v-b0df26f4],.prev-enter-active[data-v-b0df26f4]{transition:opacity .3s ease,transform .3s ease}",map:void 0,media:void 0})}),e,"data-v-b0df26f4",!1,void 0,!1,i,void 0,void 0);var r=null;return"undefined"!=typeof window?r=window.Vue:"undefined"!=typeof global&&(r=global.Vue),r&&r.use({install:function e(t){e.installed||(e.installed=!0,t.component(s.name,s))}}),s}));
{
"name": "vue-tinybox",
"version": "1.1.0",
"version": "1.2.0",
"description": "A slick, yet tiny lightbox gallery for Vue.js",

@@ -52,21 +52,21 @@ "license": "MIT",

"devDependencies": {
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.5",
"@rollup/plugin-node-resolve": "^7.1.3",
"@size-limit/preset-small-lib": "^4.4.5",
"autoprefixer": "^9.7.6",
"@babel/core": "^7.10.3",
"@babel/preset-env": "^7.10.3",
"@rollup/plugin-node-resolve": "^8.1.0",
"@size-limit/preset-small-lib": "^4.5.2",
"autoprefixer": "^9.8.4",
"cross-env": "^7.0.2",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.1.0",
"eslint-plugin-import": "^2.20.2",
"eslint": "^7.3.1",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-plugin-import": "^2.21.2",
"eslint-plugin-vue": "^6.2.2",
"npm-run-all": "^4.1.5",
"postcss": "^7.0.27",
"rollup": "^2.7.2",
"postcss": "^7.0.32",
"rollup": "^2.18.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-terser": "^5.3.0",
"rollup-plugin-vue": "^5.1.6",
"sirv-cli": "^0.4.5",
"size-limit": "^4.4.5",
"vue-eslint-parser": "^7.0.0",
"rollup-plugin-terser": "^6.1.0",
"rollup-plugin-vue": "^5.1.9",
"sirv-cli": "^1.0.1",
"size-limit": "^4.5.2",
"vue-eslint-parser": "^7.1.0",
"vue-template-compiler": "^2.6.11"

@@ -73,0 +73,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc