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.0.0-2 to 1.0.0

2

dist/tinybox.esm.js

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

var t={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(t){t?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(t,e){this.slide=e||(this.index<t?"next":"prev"),this.$emit("change",t)},keyup:function(t){"ArrowRight"===t.code?this.next():"ArrowLeft"===t.code?this.prev():"Escape"===t.code&&this.close()},swipeStart:function(t){this.swipeDone=!1,1===t.changedTouches.length&&(this.swipeX=t.changedTouches[0].screenX)},swipe:function(t){if(!this.swipeDone&&1===t.changedTouches.length){var e=t.changedTouches[0].screenX-this.swipeX;e>=50?(this.prev(),this.swipeDone=!0):e<=-50&&(this.next(),this.swipeDone=!0)}}}};const e="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());let n;const o={};const i=function(t,e,n,o,i,a,s,r,d,c){"boolean"!=typeof s&&(d=r,r=s,s=!1);const l="function"==typeof n?n.options:n;let p;if(t&&t.render&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),o&&(l._scopeId=o),a?(p=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,d(t)),t&&t._registeredComponents&&t._registeredComponents.add(a)},l._ssrRegister=p):e&&(p=s?function(t){e.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,r(t))}),p)if(l.functional){const t=l.render;l.render=function(e,n){return p.call(n),t(e,n)}}else{const t=l.beforeCreate;l.beforeCreate=t?[].concat(t,p):[p]}return n}({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"fade"}},[t.open?n("div",{staticClass:"tinybox",on:{click:t.close,wheel:function(t){t.preventDefault()},touchmove:function(t){t.preventDefault()}}},[n("div",{staticClass:"tinybox__content",class:{"tinybox__content--no-thumbs":t.noThumbs},on:{touchstart:t.swipeStart,touchmove:t.swipe}},[n("transition",{attrs:{name:t.slide}},[n("img",{key:t.images[t.index].src||t.images[t.index]||"",staticClass:"tinybox__content__image",attrs:{src:t.images[t.index].src||t.images[t.index]||"",alt:t.images[t.index].alt||""},on:{click:function(e){return e.stopPropagation(),t.next(e)}}})]),t.prevImage!==t.index?n("div",{staticClass:"tinybox__content__control tinybox__content__control--prev",on:{click:function(e){return e.stopPropagation(),t.prev(e)}}}):t._e(),t.nextImage!==t.index?n("div",{staticClass:"tinybox__content__control tinybox__content__control--next",on:{click:function(e){return e.stopPropagation(),t.next(e)}}}):t._e(),n("div",{staticClass:"tinybox__content__control tinybox__content__control--close",on:{click:function(e){return e.stopPropagation(),t.close(e)}}})],1),t.noThumbs?t._e():n("div",{staticClass:"tinybox__thumbs",on:{touchmove:function(t){t.stopPropagation()},wheel:function(t){t.stopPropagation()}}},t._l(t.images,(function(e,o){return n("img",{key:o,staticClass:"tinybox__thumbs__item",class:{"tinybox__thumbs__item--active":t.index===o},attrs:{src:e.thumbnail||e.src||e||"",alt:e.alt||""},on:{click:function(e){return e.stopPropagation(),t.goto(o)}}})})),0)]):t._e()])},staticRenderFns:[]},(function(t){t&&t("data-v-389da66a_0",{source:".tinybox[data-v-389da66a]{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-389da66a]{height:85%;position:relative;width:100%;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center}.tinybox__content--no-thumbs[data-v-389da66a]{height:100%}.tinybox__content__image[data-v-389da66a]{background-color:#222;cursor:pointer;display:inline-block;max-height:90%;max-width:80%;position:absolute}.tinybox__content__control[data-v-389da66a]{background:no-repeat center/24px;cursor:pointer;opacity:.5;position:absolute;top:0;-webkit-transition:opacity .3s ease;transition:opacity .3s ease;width:4em}.tinybox__content__control[data-v-389da66a]:hover{opacity:1}.tinybox__content__control--prev[data-v-389da66a]{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-389da66a]{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-389da66a]{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-389da66a]{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-389da66a]{cursor:pointer;display:inline-block;height:10vh;margin:2.5vh 5px;-o-object-fit:cover;object-fit:cover;overflow:hidden;width:10vh}.tinybox__thumbs__item--active[data-v-389da66a]{opacity:.3}.fade-enter[data-v-389da66a],.fade-leave-active[data-v-389da66a],.next-enter[data-v-389da66a],.next-leave-active[data-v-389da66a],.prev-enter[data-v-389da66a],.prev-leave-active[data-v-389da66a]{opacity:0}.fade-enter-active[data-v-389da66a],.fade-leave-active[data-v-389da66a],.next-leave-active[data-v-389da66a],.prev-leave-active[data-v-389da66a]{-webkit-transition:opacity .3s ease;transition:opacity .3s ease}.prev-enter[data-v-389da66a]{-webkit-transform:translateX(-40px);transform:translateX(-40px)}.next-enter[data-v-389da66a]{-webkit-transform:translateX(40px);transform:translateX(40px)}.next-enter-active[data-v-389da66a],.prev-enter-active[data-v-389da66a]{-webkit-transition:opacity .3s ease,-webkit-transform .3s ease;transition:opacity .3s ease,-webkit-transform .3s ease;transition:opacity .3s ease,transform .3s ease;transition:opacity .3s ease,transform .3s ease,-webkit-transform .3s ease}",map:void 0,media:void 0})}),t,"data-v-389da66a",!1,void 0,!1,(function(t){return(t,i)=>(function(t,i){const a=e?i.media||"default":t,s=o[a]||(o[a]={ids:new Set,styles:[]});if(!s.ids.has(t)){s.ids.add(t);let e=i.source;if(i.map&&(e+="\n/*# sourceURL="+i.map.sources[0]+" */",e+="\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===n&&(n=document.head||document.getElementsByTagName("head")[0]),n.appendChild(s.element)),"styleSheet"in s.element)s.styles.push(e),s.element.styleSheet.cssText=s.styles.filter(Boolean).join("\n");else{const t=s.ids.size-1,n=document.createTextNode(e),o=s.element.childNodes;o[t]&&s.element.removeChild(o[t]),o.length?s.element.insertBefore(n,o[t]):s.element.appendChild(n)}}})(t,i)}),void 0,void 0);var a=null;"undefined"!=typeof window?a=window.Vue:"undefined"!=typeof global&&(a=global.Vue),a&&function t(e){t.installed||(t.installed=!0,e.component(i.name,i))}(a);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)}},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,r,c,d){"boolean"!=typeof s&&(c=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,c(e)),e&&e._registeredComponents&&e._registeredComponents.add(a)},f._ssrRegister=l):t&&(l=s?function(e){t.call(this,d(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}({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||""},on:{click:function(t){return t.stopPropagation(),e.next(t)}}})]),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:t.alt||""},on:{click:function(t){return t.stopPropagation(),e.goto(o)}}})})),0)]):e._e()])},staticRenderFns:[]},(function(e){e&&e("data-v-43bd6fcf_0",{source:".tinybox[data-v-43bd6fcf]{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-43bd6fcf]{height:85%;position:relative;width:100%;display:flex;align-items:center;justify-content:center}.tinybox__content--no-thumbs[data-v-43bd6fcf]{height:100%}.tinybox__content__image[data-v-43bd6fcf]{background-color:#222;cursor:pointer;display:inline-block;max-height:90%;max-width:80%;position:absolute}.tinybox__content__control[data-v-43bd6fcf]{background:no-repeat center/24px;cursor:pointer;opacity:.5;position:absolute;top:0;transition:opacity .3s ease;width:4em}.tinybox__content__control[data-v-43bd6fcf]:hover{opacity:1}.tinybox__content__control--prev[data-v-43bd6fcf]{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-43bd6fcf]{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-43bd6fcf]{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-43bd6fcf]{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-43bd6fcf]{cursor:pointer;display:inline-block;height:10vh;margin:2.5vh 5px;object-fit:cover;overflow:hidden;width:10vh}.tinybox__thumbs__item--active[data-v-43bd6fcf]{opacity:.3}.fade-enter[data-v-43bd6fcf],.fade-leave-active[data-v-43bd6fcf],.next-enter[data-v-43bd6fcf],.next-leave-active[data-v-43bd6fcf],.prev-enter[data-v-43bd6fcf],.prev-leave-active[data-v-43bd6fcf]{opacity:0}.fade-enter-active[data-v-43bd6fcf],.fade-leave-active[data-v-43bd6fcf],.next-leave-active[data-v-43bd6fcf],.prev-leave-active[data-v-43bd6fcf]{transition:opacity .3s ease}.prev-enter[data-v-43bd6fcf]{transform:translateX(-40px)}.next-enter[data-v-43bd6fcf]{transform:translateX(40px)}.next-enter-active[data-v-43bd6fcf],.prev-enter-active[data-v-43bd6fcf]{transition:opacity .3s ease,transform .3s ease}",map:void 0,media:void 0})}),e,"data-v-43bd6fcf",!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 r=i.source;if(i.map&&(r+="\n/*# sourceURL="+i.map.sources[0]+" */",r+="\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(r),s.element.styleSheet.cssText=s.styles.filter(Boolean).join("\n");else{var c=s.ids.size-1,d=document.createTextNode(r),l=s.element.childNodes;l[c]&&s.element.removeChild(l[c]),l.length?s.element.insertBefore(d,l[c]):s.element.appendChild(d)}}}(e,i)}}),void 0,void 0);var a=null;"undefined"!=typeof window?a=window.Vue:"undefined"!=typeof global&&(a=global.Vue),a&&function e(t){e.installed||(e.installed=!0,t.component(i.name,i))}(a);export default i;

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Tinybox=e()}(this,(function(){"use strict";var t={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(t){t?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(t,e){this.slide=e||(this.index<t?"next":"prev"),this.$emit("change",t)},keyup:function(t){"ArrowRight"===t.code?this.next():"ArrowLeft"===t.code?this.prev():"Escape"===t.code&&this.close()},swipeStart:function(t){this.swipeDone=!1,1===t.changedTouches.length&&(this.swipeX=t.changedTouches[0].screenX)},swipe:function(t){if(!this.swipeDone&&1===t.changedTouches.length){var e=t.changedTouches[0].screenX-this.swipeX;e>=50?(this.prev(),this.swipeDone=!0):e<=-50&&(this.next(),this.swipeDone=!0)}}}};const e="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());let n;const o={};const i=function(t,e,n,o,i,a,s,r,d,c){"boolean"!=typeof s&&(d=r,r=s,s=!1);const l="function"==typeof n?n.options:n;let p;if(t&&t.render&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),o&&(l._scopeId=o),a?(p=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,d(t)),t&&t._registeredComponents&&t._registeredComponents.add(a)},l._ssrRegister=p):e&&(p=s?function(t){e.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,r(t))}),p)if(l.functional){const t=l.render;l.render=function(e,n){return p.call(n),t(e,n)}}else{const t=l.beforeCreate;l.beforeCreate=t?[].concat(t,p):[p]}return n}({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"fade"}},[t.open?n("div",{staticClass:"tinybox",on:{click:t.close,wheel:function(t){t.preventDefault()},touchmove:function(t){t.preventDefault()}}},[n("div",{staticClass:"tinybox__content",class:{"tinybox__content--no-thumbs":t.noThumbs},on:{touchstart:t.swipeStart,touchmove:t.swipe}},[n("transition",{attrs:{name:t.slide}},[n("img",{key:t.images[t.index].src||t.images[t.index]||"",staticClass:"tinybox__content__image",attrs:{src:t.images[t.index].src||t.images[t.index]||"",alt:t.images[t.index].alt||""},on:{click:function(e){return e.stopPropagation(),t.next(e)}}})]),t.prevImage!==t.index?n("div",{staticClass:"tinybox__content__control tinybox__content__control--prev",on:{click:function(e){return e.stopPropagation(),t.prev(e)}}}):t._e(),t.nextImage!==t.index?n("div",{staticClass:"tinybox__content__control tinybox__content__control--next",on:{click:function(e){return e.stopPropagation(),t.next(e)}}}):t._e(),n("div",{staticClass:"tinybox__content__control tinybox__content__control--close",on:{click:function(e){return e.stopPropagation(),t.close(e)}}})],1),t.noThumbs?t._e():n("div",{staticClass:"tinybox__thumbs",on:{touchmove:function(t){t.stopPropagation()},wheel:function(t){t.stopPropagation()}}},t._l(t.images,(function(e,o){return n("img",{key:o,staticClass:"tinybox__thumbs__item",class:{"tinybox__thumbs__item--active":t.index===o},attrs:{src:e.thumbnail||e.src||e||"",alt:e.alt||""},on:{click:function(e){return e.stopPropagation(),t.goto(o)}}})})),0)]):t._e()])},staticRenderFns:[]},(function(t){t&&t("data-v-389da66a_0",{source:".tinybox[data-v-389da66a]{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-389da66a]{height:85%;position:relative;width:100%;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center}.tinybox__content--no-thumbs[data-v-389da66a]{height:100%}.tinybox__content__image[data-v-389da66a]{background-color:#222;cursor:pointer;display:inline-block;max-height:90%;max-width:80%;position:absolute}.tinybox__content__control[data-v-389da66a]{background:no-repeat center/24px;cursor:pointer;opacity:.5;position:absolute;top:0;-webkit-transition:opacity .3s ease;transition:opacity .3s ease;width:4em}.tinybox__content__control[data-v-389da66a]:hover{opacity:1}.tinybox__content__control--prev[data-v-389da66a]{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-389da66a]{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-389da66a]{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-389da66a]{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-389da66a]{cursor:pointer;display:inline-block;height:10vh;margin:2.5vh 5px;-o-object-fit:cover;object-fit:cover;overflow:hidden;width:10vh}.tinybox__thumbs__item--active[data-v-389da66a]{opacity:.3}.fade-enter[data-v-389da66a],.fade-leave-active[data-v-389da66a],.next-enter[data-v-389da66a],.next-leave-active[data-v-389da66a],.prev-enter[data-v-389da66a],.prev-leave-active[data-v-389da66a]{opacity:0}.fade-enter-active[data-v-389da66a],.fade-leave-active[data-v-389da66a],.next-leave-active[data-v-389da66a],.prev-leave-active[data-v-389da66a]{-webkit-transition:opacity .3s ease;transition:opacity .3s ease}.prev-enter[data-v-389da66a]{-webkit-transform:translateX(-40px);transform:translateX(-40px)}.next-enter[data-v-389da66a]{-webkit-transform:translateX(40px);transform:translateX(40px)}.next-enter-active[data-v-389da66a],.prev-enter-active[data-v-389da66a]{-webkit-transition:opacity .3s ease,-webkit-transform .3s ease;transition:opacity .3s ease,-webkit-transform .3s ease;transition:opacity .3s ease,transform .3s ease;transition:opacity .3s ease,transform .3s ease,-webkit-transform .3s ease}",map:void 0,media:void 0})}),t,"data-v-389da66a",!1,void 0,!1,(function(t){return(t,i)=>(function(t,i){const a=e?i.media||"default":t,s=o[a]||(o[a]={ids:new Set,styles:[]});if(!s.ids.has(t)){s.ids.add(t);let e=i.source;if(i.map&&(e+="\n/*# sourceURL="+i.map.sources[0]+" */",e+="\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===n&&(n=document.head||document.getElementsByTagName("head")[0]),n.appendChild(s.element)),"styleSheet"in s.element)s.styles.push(e),s.element.styleSheet.cssText=s.styles.filter(Boolean).join("\n");else{const t=s.ids.size-1,n=document.createTextNode(e),o=s.element.childNodes;o[t]&&s.element.removeChild(o[t]),o.length?s.element.insertBefore(n,o[t]):s.element.appendChild(n)}}})(t,i)}),void 0,void 0);var a=null;return"undefined"!=typeof window?a=window.Vue:"undefined"!=typeof global&&(a=global.Vue),a&&function t(e){t.installed||(t.installed=!0,e.component(i.name,i))}(a),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)}},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,r,c,d){"boolean"!=typeof s&&(c=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,c(e)),e&&e._registeredComponents&&e._registeredComponents.add(a)},f._ssrRegister=l):t&&(l=s?function(e){t.call(this,d(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,r(e))}),l)if(f.functional){var p=f.render;f.render=function(e,t){return l.call(t),p(e,t)}}else{var u=f.beforeCreate;f.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||""},on:{click:function(t){return t.stopPropagation(),e.next(t)}}})]),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:t.alt||""},on:{click:function(t){return t.stopPropagation(),e.goto(o)}}})})),0)]):e._e()])},staticRenderFns:[]},(function(e){e&&e("data-v-43bd6fcf_0",{source:".tinybox[data-v-43bd6fcf]{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-43bd6fcf]{height:85%;position:relative;width:100%;display:flex;align-items:center;justify-content:center}.tinybox__content--no-thumbs[data-v-43bd6fcf]{height:100%}.tinybox__content__image[data-v-43bd6fcf]{background-color:#222;cursor:pointer;display:inline-block;max-height:90%;max-width:80%;position:absolute}.tinybox__content__control[data-v-43bd6fcf]{background:no-repeat center/24px;cursor:pointer;opacity:.5;position:absolute;top:0;transition:opacity .3s ease;width:4em}.tinybox__content__control[data-v-43bd6fcf]:hover{opacity:1}.tinybox__content__control--prev[data-v-43bd6fcf]{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-43bd6fcf]{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-43bd6fcf]{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-43bd6fcf]{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-43bd6fcf]{cursor:pointer;display:inline-block;height:10vh;margin:2.5vh 5px;object-fit:cover;overflow:hidden;width:10vh}.tinybox__thumbs__item--active[data-v-43bd6fcf]{opacity:.3}.fade-enter[data-v-43bd6fcf],.fade-leave-active[data-v-43bd6fcf],.next-enter[data-v-43bd6fcf],.next-leave-active[data-v-43bd6fcf],.prev-enter[data-v-43bd6fcf],.prev-leave-active[data-v-43bd6fcf]{opacity:0}.fade-enter-active[data-v-43bd6fcf],.fade-leave-active[data-v-43bd6fcf],.next-leave-active[data-v-43bd6fcf],.prev-leave-active[data-v-43bd6fcf]{transition:opacity .3s ease}.prev-enter[data-v-43bd6fcf]{transform:translateX(-40px)}.next-enter[data-v-43bd6fcf]{transform:translateX(40px)}.next-enter-active[data-v-43bd6fcf],.prev-enter-active[data-v-43bd6fcf]{transition:opacity .3s ease,transform .3s ease}",map:void 0,media:void 0})}),e,"data-v-43bd6fcf",!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 r=i.source;if(i.map&&(r+="\n/*# sourceURL="+i.map.sources[0]+" */",r+="\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(r),s.element.styleSheet.cssText=s.styles.filter(Boolean).join("\n");else{var c=s.ids.size-1,d=document.createTextNode(r),l=s.element.childNodes;l[c]&&s.element.removeChild(l[c]),l.length?s.element.insertBefore(d,l[c]):s.element.appendChild(d)}}}(e,i)}}),void 0,void 0);var a=null;return"undefined"!=typeof window?a=window.Vue:"undefined"!=typeof global&&(a=global.Vue),a&&function e(t){e.installed||(e.installed=!0,t.component(i.name,i))}(a),i}));
{
"name": "vue-tinybox",
"version": "1.0.0-2",
"version": "1.0.0",
"description": "A slick, yet tiny lightbox gallery for Vue.js",

@@ -42,3 +42,3 @@ "license": "MIT",

"pretest": "npm run build",
"test": "run-p test:*"
"test": "run-p --aggregate-output test:*"
},

@@ -48,3 +48,3 @@ "devDependencies": {

"@babel/preset-env": "^7.7.4",
"@size-limit/preset-small-lib": "^2.2.4",
"@size-limit/preset-small-lib": "^3.0.0",
"autoprefixer": "^9.7.3",

@@ -54,10 +54,9 @@ "eslint": "^6.8.0",

"eslint-plugin-import": "^2.19.1",
"eslint-plugin-vue": "^6.1.1",
"eslint-plugin-vue": "^6.1.2",
"npm-run-all": "^4.1.5",
"nuxt": "^2.11.0",
"rollup": "^1.27.14",
"rollup": "^1.29.0",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-terser": "^5.1.3",
"rollup-plugin-vue": "^5.1.4",
"rollup-plugin-vue": "^5.1.5",
"sirv-cli": "^0.4.5",

@@ -73,6 +72,2 @@ "vue-eslint-parser": "^7.0.0",

],
"browserslist": [
">=.5%, last 2 versions",
"not dead"
],
"engines": {

@@ -79,0 +74,0 @@ "node": ">=10"

@@ -38,4 +38,4 @@ <h1>

```html
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/vue-tinybox"></script>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-tinybox"></script>
```

@@ -118,1 +118,13 @@

```
## Browser support
| ![Chrome][chrome] | ![Firefox][firefox] | ![Safari][safari] | ![MS Edge][edge] | ![Internet Explorer][ie] |
|:-----------------:|:-------------------:|:-----------------:|:----------------:|:------------------------:|
| **21+** | **28+** | **7+** | **16+** | **11** |
[chrome]: https://github.com/alrra/browser-logos/raw/master/src/chrome/chrome_48x48.png
[firefox]: https://github.com/alrra/browser-logos/raw/master/src/firefox/firefox_48x48.png
[safari]: https://github.com/alrra/browser-logos/raw/master/src/safari/safari_48x48.png
[edge]: https://github.com/alrra/browser-logos/raw/master/src/edge/edge_48x48.png
[ie]: https://github.com/alrra/browser-logos/raw/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png

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