Socket
Socket
Sign inDemoInstall

@takuma-ru/vue-swipe-modal

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@takuma-ru/vue-swipe-modal - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

2

dist/swipe-modal.cjs.js

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

(function(){ try {var elementStyle = document.createElement('style'); elementStyle.appendChild(document.createTextNode(".swipe-modal-takumaru-vue-swipe-modal{position:fixed;scrollbar-width:none;z-index:15}.swipe-modal-takumaru-vue-swipe-modal .modal-background{position:fixed;z-index:11;width:100vw;height:100vh;top:50%;left:50%;transform:translate(-50%,-50%)}.swipe-modal-takumaru-vue-swipe-modal .modal-contents{position:fixed;z-index:12;max-height:100vh;left:50%;transform:translate(-50%) translateY(0);overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none;backface-visibility:hidden;-webkit-backface-visibility:hidden;filter:drop-shadow(0px 16px 40px rgba(0,37,80,.2))}.swipe-modal-takumaru-vue-swipe-modal .modal-contents::-webkit-scrollbar{width:0px}.swipe-modal-takumaru-vue-swipe-modal .modal-contents-chip-wrapper{z-index:12;display:flex;justify-items:center;align-items:center;justify-content:center;align-content:center;position:relative;top:0px;height:4px;width:100%;padding-top:8px;padding-bottom:8px;cursor:s-resize}.swipe-modal-takumaru-vue-swipe-modal .modal-contents-chip{--tip-color: #c8c8c8;width:40px;height:100%;border-radius:4px;background-color:var(--tip-color)}")); document.head.appendChild(elementStyle);} catch(e) {console.error('vite-plugin-css-injected-by-js', e);} })();"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var o=require("vue-demi"),B;const I=typeof window!="undefined",L=e=>typeof e=="function",V=e=>typeof e=="number",G=(e,a,n)=>Math.min(n,Math.max(a,e)),H=()=>{};I&&((B=window==null?void 0:window.navigator)==null?void 0:B.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function q(e){return e}function A(e){return o.getCurrentScope()?(o.onScopeDispose(e),!0):!1}function j(e,a,n={}){const{immediate:c=!0}=n,i=o.ref(!1);let u=null;function d(){u&&(clearTimeout(u),u=null)}function r(){i.value=!1,d()}function f(...m){d(),i.value=!0,u=setTimeout(()=>{i.value=!1,u=null,e(...m)},o.unref(a))}return c&&(i.value=!0,I&&f()),A(r),{isPending:i,start:f,stop:r}}function z(e){var a;const n=o.unref(e);return(a=n==null?void 0:n.$el)!=null?a:n}const X=I?window:void 0,_=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},x="__vueuse_ssr_handlers__";_[x]=_[x]||{};_[x];function K(e,a,{window:n=X,initialValue:c=""}={}){const i=o.ref(c),u=o.computed(()=>{var d;return z(a)||((d=n==null?void 0:n.document)==null?void 0:d.documentElement)});return o.watch([u,()=>o.unref(e)],([d,r])=>{var f;if(d&&n){const m=(f=n.getComputedStyle(d).getPropertyValue(r))==null?void 0:f.trim();i.value=m||c}},{immediate:!0}),o.watch(i,d=>{var r;(r=u.value)!=null&&r.style&&u.value.style.setProperty(o.unref(e),d)}),i}function J(e,a={}){const{immediate:n=!0,window:c=X}=a,i=o.ref(!1);let u=null;function d(){!i.value||!c||(e(),u=c.requestAnimationFrame(d))}function r(){!i.value&&c&&(i.value=!0,d())}function f(){i.value=!1,u!=null&&c&&(c.cancelAnimationFrame(u),u=null)}return n&&r(),A(f),{isActive:i,pause:f,resume:r}}var N;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(N||(N={}));function Q([e,a,n,c]){const i=(s,l)=>1-3*l+3*s,u=(s,l)=>3*l-6*s,d=s=>3*s,r=(s,l,t)=>((i(l,t)*s+u(l,t))*s+d(l))*s,f=(s,l,t)=>3*i(l,t)*s*s+2*u(l,t)*s+d(l),m=s=>{let l=s;for(let t=0;t<4;++t){const p=f(l,e,n);if(p===0)return l;l-=(r(l,e,n)-s)/p}return l};return s=>e===a&&n===c?s:r(m(s),a,c)}function F(e,a={}){const{delay:n=0,disabled:c=!1,duration:i=1e3,onFinished:u=H,onStarted:d=H,transition:r=q}=a,f=o.computed(()=>{const v=o.unref(r);return L(v)?v:Q(v)}),m=o.computed(()=>{const v=o.unref(e);return V(v)?v:v.map(o.unref)}),s=o.computed(()=>V(m.value)?[m.value]:m.value),l=o.ref(s.value.slice(0));let t,p,w,S,k;const{resume:M,pause:P}=J(()=>{const v=Date.now(),b=G(1-(w-v)/t,0,1);l.value=k.map((T,D)=>{var h;return T+((h=p[D])!=null?h:0)*f.value(b)}),b>=1&&(P(),u())},{immediate:!1}),R=()=>{P(),t=o.unref(i),p=l.value.map((v,b)=>{var T,D;return((T=s.value[b])!=null?T:0)-((D=l.value[b])!=null?D:0)}),k=l.value.slice(0),S=Date.now(),w=S+t,M(),d()},C=j(R,n,{immediate:!1});return o.watch(s,()=>{o.unref(c)?l.value=s.value.slice(0):o.unref(n)<=0?R():C.start()},{deep:!0}),o.computed(()=>{const v=o.unref(c)?s:l;return V(m.value)?v.value[0]:v.value})}const Z=()=>{const e=o.ref({isTouch:!1,touchStart:0,touchDistance:0,touchX:0,touchY:0});return{touchPosition:e,initTouchPosition:()=>{e.value={isTouch:!1,touchStart:0,touchDistance:0,touchX:0,touchY:0}},touchStart:u=>{e.value.isTouch=!0,e.value.touchStart=u.touches[0].pageY},touchMove:u=>{e.value.isTouch&&(e.value.touchY=u.touches[0].pageY,e.value.touchDistance=e.value.touchStart-e.value.touchY,e.value.touchDistance>0&&(e.value.touchDistance=0))},touchEnd:()=>{e.value.isTouch=!1}}};function ee(){const e=o.ref({isMouseDown:!1,downStart:0,mouseDistance:0,mouseX:0,mouseY:0});return{mousePosition:e,initMousePosition:()=>{e.value={isMouseDown:!1,downStart:0,mouseDistance:0,mouseX:0,mouseY:0}},mouseDown:u=>{e.value.isMouseDown=!0,e.value.downStart=u.pageY},mouseMove:u=>{e.value.isMouseDown&&(e.value.mouseY=u.pageY,e.value.mouseDistance=e.value.downStart-e.value.mouseY,e.value.mouseDistance>0&&(e.value.mouseDistance=0))},mouseUp:()=>{e.value.isMouseDown=!1}}}const E=e=>{if(e.indexOf("px")>0)return Number(e.slice(0,e.indexOf("px")));if(e.indexOf("vh")>0){const a=Number(e.slice(0,e.indexOf("vh")));return window.innerHeight*(a/100)}else if(e.indexOf("vw")>0){const a=Number(e.slice(0,e.indexOf("vw")));return window.innerWidth*(a/100)}else return 0};o.install();var $=o.defineComponent({name:"swipeModal",model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:Boolean,default:!1},dark:{type:Boolean,default:!1},persistent:{type:Boolean,default:!1},backgroundColor:{type:String,default:"#80808080"},fullscreen:{type:Boolean,default:!1},noTip:{type:Boolean,default:!1},contentsWidth:{type:String,default:"100%"},contentsHeight:{type:String,default:"30vh"},borderTopRadius:{type:String,default:null},borderTopLeftRadius:{type:String,default:"0px"},borderTopRightRadius:{type:String,default:"0px"},contentsColor:{type:String,default:"white"},tipColor:{type:String,default:"#c8c8c8"},darkContentsColor:{type:String,default:"#1E1E1E"}},emits:["update:modelValue","open","close"],setup(e,a){const{mousePosition:n,initMousePosition:c,mouseDown:i,mouseMove:u,mouseUp:d}=ee(),{touchPosition:r,initTouchPosition:f,touchStart:m,touchMove:s,touchEnd:l}=Z(),t=o.toRefs(e),p=o.computed({get:()=>t.modelValue.value,set:g=>a.emit("update:modelValue",g)}),w=o.ref(250),S=o.ref(null),k=K("--tip-color",S);k.value=t.tipColor.value;const M=o.ref([parseInt(t.backgroundColor.value.slice(1,3),16),parseInt(t.backgroundColor.value.slice(3,5),16),parseInt(t.backgroundColor.value.slice(5,7),16),0]),P=F(M,{duration:250,transition:[.25,.8,.25,1]}),R=o.computed(()=>{const[g,y,U,W]=P.value;return`rgba(${g}, ${y}, ${U}, ${W})`}),C=o.ref(-1*E(t.contentsHeight.value)),v=F(C,{duration:w.value,transition:[.25,.8,.25,1]}),b=o.computed(()=>v.value+(Math.abs(r.value.touchDistance)>Math.abs(n.value.mouseDistance)?r.value.touchDistance:n.value.mouseDistance)),T=()=>{document.documentElement.style.overflowY="auto",p.value=!1},D=()=>{a.emit("open"),C.value=0,M.value=[parseInt(t.backgroundColor.value.slice(1,3),16),parseInt(t.backgroundColor.value.slice(3,5),16),parseInt(t.backgroundColor.value.slice(5,7),16),parseInt(t.backgroundColor.value.slice(7,9),16)/255]},h=()=>{C.value=-1*E(t.contentsHeight.value)-(Math.abs(r.value.touchDistance)>Math.abs(n.value.mouseDistance)?r.value.touchDistance:n.value.mouseDistance),M.value=[parseInt(t.backgroundColor.value.slice(1,3),16),parseInt(t.backgroundColor.value.slice(3,5),16),parseInt(t.backgroundColor.value.slice(5,7),16),0],setTimeout(()=>{c(),f(),T(),a.emit("close")},w.value)},Y=()=>{l(),-1*r.value.touchDistance>E(t.contentsHeight.value)/8?h():r.value.touchDistance=0},O=()=>{d(),-1*n.value.mouseDistance>E(t.contentsHeight.value)/8?h():n.value.mouseDistance=0};return o.watch(p,(g,y)=>{p.value&&D()}),()=>{var g,y;return o.h("div",{class:"swipe-modal-takumaru-vue-swipe-modal",on:{mousemove:u,mouseup:O},onMousemove:u,onMouseup:O},[t.modelValue.value?o.h("div",{class:"modal-background",style:{backgroundColor:R.value},on:{onMouseup:()=>t.persistent.value?()=>null:h(),click:()=>t.persistent.value?()=>null:h()},onMouseup:()=>{t.persistent.value||h()},onClick:()=>{t.persistent.value||h()}}):null,t.modelValue.value?o.h("div",{class:"modal-contents",style:{width:t.contentsWidth.value,minHeight:t.contentsHeight.value,borderTopLeftRadius:t.borderTopRadius.value?t.borderTopRadius.value:t.borderTopLeftRadius.value,borderTopRightRadius:t.borderTopRadius?t.borderTopRadius.value:t.borderTopRightRadius.value,backgroundColor:t.dark.value?t.darkContentsColor.value:t.contentsColor.value,color:t.dark.value?"white":"black",bottom:`${b.value}px`},on:{touchstart:m,touchmove:s,touchend:Y},onTouchstart:m,onTouchmove:s,onTouchend:Y},[t.noTip.value?null:o.h("div",{class:"modal-contents-chip-wrapper",on:{mousedown:i},onMousedown:i},[o.h("div",{class:"modal-contents-chip"})]),(y=(g=a.slots).default)==null?void 0:y.call(g)]):null])}}});exports.default=$;exports.swipeModal=$;
(function(){ try {var elementStyle = document.createElement('style'); elementStyle.appendChild(document.createTextNode(".swipe-modal-takumaru-vue-swipe-modal{position:fixed;scrollbar-width:none;z-index:15}.swipe-modal-takumaru-vue-swipe-modal .modal-background{position:fixed;z-index:11;width:100vw;height:100vh;top:50%;left:50%;transform:translate(-50%,-50%)}.swipe-modal-takumaru-vue-swipe-modal .modal-contents{position:fixed;z-index:12;max-height:100vh;left:50%;transform:translate(-50%) translateY(0);overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none;backface-visibility:hidden;-webkit-backface-visibility:hidden;filter:drop-shadow(0px 16px 40px rgba(0,37,80,.2))}.swipe-modal-takumaru-vue-swipe-modal .modal-contents::-webkit-scrollbar{width:0px}.swipe-modal-takumaru-vue-swipe-modal .modal-contents-chip-wrapper{z-index:12;display:flex;justify-items:center;align-items:center;justify-content:center;align-content:center;position:relative;top:0px;height:4px;width:100%;padding-top:8px;padding-bottom:8px;cursor:s-resize}.swipe-modal-takumaru-vue-swipe-modal .modal-contents-chip{--tip-color: #c8c8c8;width:40px;height:100%;border-radius:4px;background-color:var(--tip-color)}")); document.head.appendChild(elementStyle);} catch(e) {console.error('vite-plugin-css-injected-by-js', e);} })();"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var o=require("vue-demi"),B;const Y=typeof window!="undefined",L=e=>typeof e=="function",V=e=>typeof e=="number",G=(e,a,n)=>Math.min(n,Math.max(a,e)),H=()=>{};Y&&((B=window==null?void 0:window.navigator)==null?void 0:B.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function q(e){return e}function A(e){return o.getCurrentScope()?(o.onScopeDispose(e),!0):!1}function j(e,a,n={}){const{immediate:c=!0}=n,i=o.ref(!1);let u=null;function d(){u&&(clearTimeout(u),u=null)}function r(){i.value=!1,d()}function f(...m){d(),i.value=!0,u=setTimeout(()=>{i.value=!1,u=null,e(...m)},o.unref(a))}return c&&(i.value=!0,Y&&f()),A(r),{isPending:i,start:f,stop:r}}function z(e){var a;const n=o.unref(e);return(a=n==null?void 0:n.$el)!=null?a:n}const X=Y?window:void 0,_=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},x="__vueuse_ssr_handlers__";_[x]=_[x]||{};_[x];function K(e,a,{window:n=X,initialValue:c=""}={}){const i=o.ref(c),u=o.computed(()=>{var d;return z(a)||((d=n==null?void 0:n.document)==null?void 0:d.documentElement)});return o.watch([u,()=>o.unref(e)],([d,r])=>{var f;if(d&&n){const m=(f=n.getComputedStyle(d).getPropertyValue(r))==null?void 0:f.trim();i.value=m||c}},{immediate:!0}),o.watch(i,d=>{var r;(r=u.value)!=null&&r.style&&u.value.style.setProperty(o.unref(e),d)}),i}function J(e,a={}){const{immediate:n=!0,window:c=X}=a,i=o.ref(!1);let u=null;function d(){!i.value||!c||(e(),u=c.requestAnimationFrame(d))}function r(){!i.value&&c&&(i.value=!0,d())}function f(){i.value=!1,u!=null&&c&&(c.cancelAnimationFrame(u),u=null)}return n&&r(),A(f),{isActive:i,pause:f,resume:r}}var N;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(N||(N={}));function Q([e,a,n,c]){const i=(s,l)=>1-3*l+3*s,u=(s,l)=>3*l-6*s,d=s=>3*s,r=(s,l,t)=>((i(l,t)*s+u(l,t))*s+d(l))*s,f=(s,l,t)=>3*i(l,t)*s*s+2*u(l,t)*s+d(l),m=s=>{let l=s;for(let t=0;t<4;++t){const p=f(l,e,n);if(p===0)return l;l-=(r(l,e,n)-s)/p}return l};return s=>e===a&&n===c?s:r(m(s),a,c)}function F(e,a={}){const{delay:n=0,disabled:c=!1,duration:i=1e3,onFinished:u=H,onStarted:d=H,transition:r=q}=a,f=o.computed(()=>{const v=o.unref(r);return L(v)?v:Q(v)}),m=o.computed(()=>{const v=o.unref(e);return V(v)?v:v.map(o.unref)}),s=o.computed(()=>V(m.value)?[m.value]:m.value),l=o.ref(s.value.slice(0));let t,p,w,S,k;const{resume:M,pause:P}=J(()=>{const v=Date.now(),b=G(1-(w-v)/t,0,1);l.value=k.map((T,D)=>{var h;return T+((h=p[D])!=null?h:0)*f.value(b)}),b>=1&&(P(),u())},{immediate:!1}),R=()=>{P(),t=o.unref(i),p=l.value.map((v,b)=>{var T,D;return((T=s.value[b])!=null?T:0)-((D=l.value[b])!=null?D:0)}),k=l.value.slice(0),S=Date.now(),w=S+t,M(),d()},C=j(R,n,{immediate:!1});return o.watch(s,()=>{o.unref(c)?l.value=s.value.slice(0):o.unref(n)<=0?R():C.start()},{deep:!0}),o.computed(()=>{const v=o.unref(c)?s:l;return V(m.value)?v.value[0]:v.value})}const Z=()=>{const e=o.ref({isTouch:!1,touchStart:0,touchDistance:0,touchX:0,touchY:0});return{touchPosition:e,initTouchPosition:()=>{e.value={isTouch:!1,touchStart:0,touchDistance:0,touchX:0,touchY:0}},touchStart:u=>{e.value.isTouch=!0,e.value.touchStart=u.touches[0].pageY},touchMove:u=>{e.value.isTouch&&(e.value.touchY=u.touches[0].pageY,e.value.touchDistance=e.value.touchStart-e.value.touchY,e.value.touchDistance>0&&(e.value.touchDistance=0))},touchEnd:()=>{e.value.isTouch=!1}}};function ee(){const e=o.ref({isMouseDown:!1,downStart:0,mouseDistance:0,mouseX:0,mouseY:0});return{mousePosition:e,initMousePosition:()=>{e.value={isMouseDown:!1,downStart:0,mouseDistance:0,mouseX:0,mouseY:0}},mouseDown:u=>{e.value.isMouseDown=!0,e.value.downStart=u.pageY},mouseMove:u=>{e.value.isMouseDown&&(e.value.mouseY=u.pageY,e.value.mouseDistance=e.value.downStart-e.value.mouseY,e.value.mouseDistance>0&&(e.value.mouseDistance=0))},mouseUp:()=>{e.value.isMouseDown=!1}}}const E=e=>{if(e.indexOf("px")>0)return Number(e.slice(0,e.indexOf("px")));if(e.indexOf("vh")>0){const a=Number(e.slice(0,e.indexOf("vh")));return window.innerHeight*(a/100)}else if(e.indexOf("vw")>0){const a=Number(e.slice(0,e.indexOf("vw")));return window.innerWidth*(a/100)}else return 0};o.install();var $=o.defineComponent({name:"swipeModal",model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:Boolean,default:!1},dark:{type:Boolean,default:!1},persistent:{type:Boolean,default:!1},backgroundColor:{type:String,default:"#80808080"},fullscreen:{type:Boolean,default:!1},noTip:{type:Boolean,default:!1},contentsWidth:{type:String,default:"100%"},contentsHeight:{type:String,default:"30vh"},borderTopRadius:{type:String,default:null},borderTopLeftRadius:{type:String,default:"0px"},borderTopRightRadius:{type:String,default:"0px"},contentsColor:{type:String,default:"white"},tipColor:{type:String,default:"#c8c8c8"},darkContentsColor:{type:String,default:"#1E1E1E"}},emits:["update:modelValue","open","close"],setup(e,a){const{mousePosition:n,initMousePosition:c,mouseDown:i,mouseMove:u,mouseUp:d}=ee(),{touchPosition:r,initTouchPosition:f,touchStart:m,touchMove:s,touchEnd:l}=Z(),t=o.toRefs(e),p=o.computed({get:()=>t.modelValue.value,set:g=>a.emit("update:modelValue",g)}),w=o.ref(250),S=o.ref(null),k=K("--tip-color",S);k.value=t.tipColor.value;const M=o.ref([parseInt(t.backgroundColor.value.slice(1,3),16),parseInt(t.backgroundColor.value.slice(3,5),16),parseInt(t.backgroundColor.value.slice(5,7),16),0]),P=F(M,{duration:250,transition:[.25,.8,.25,1]}),R=o.computed(()=>{const[g,y,U,W]=P.value;return`rgba(${g}, ${y}, ${U}, ${W})`}),C=o.ref(-1*E(t.contentsHeight.value)),v=F(C,{duration:w.value,transition:[.25,.8,.25,1]}),b=o.computed(()=>v.value+(Math.abs(r.value.touchDistance)>Math.abs(n.value.mouseDistance)?r.value.touchDistance:n.value.mouseDistance)),T=()=>{document.documentElement.style.overflowY="auto",p.value=!1},D=()=>{a.emit("open"),document.documentElement.style.overflowY="hidden",C.value=0,M.value=[parseInt(t.backgroundColor.value.slice(1,3),16),parseInt(t.backgroundColor.value.slice(3,5),16),parseInt(t.backgroundColor.value.slice(5,7),16),parseInt(t.backgroundColor.value.slice(7,9),16)/255]},h=()=>{C.value=-1*E(t.contentsHeight.value)-(Math.abs(r.value.touchDistance)>Math.abs(n.value.mouseDistance)?r.value.touchDistance:n.value.mouseDistance),M.value=[parseInt(t.backgroundColor.value.slice(1,3),16),parseInt(t.backgroundColor.value.slice(3,5),16),parseInt(t.backgroundColor.value.slice(5,7),16),0],setTimeout(()=>{c(),f(),T(),a.emit("close")},w.value)},I=()=>{l(),-1*r.value.touchDistance>E(t.contentsHeight.value)/8?h():r.value.touchDistance=0},O=()=>{d(),-1*n.value.mouseDistance>E(t.contentsHeight.value)/8?h():n.value.mouseDistance=0};return o.watch(p,(g,y)=>{p.value&&D()}),()=>{var g,y;return o.h("div",{class:"swipe-modal-takumaru-vue-swipe-modal",on:{mousemove:u,mouseup:O},onMousemove:u,onMouseup:O},[t.modelValue.value?o.h("div",{class:"modal-background",style:{backgroundColor:R.value},on:{onMouseup:()=>t.persistent.value?()=>null:h(),click:()=>t.persistent.value?()=>null:h()},onMouseup:()=>{t.persistent.value||h()},onClick:()=>{t.persistent.value||h()}}):null,t.modelValue.value?o.h("div",{class:"modal-contents",style:{width:t.contentsWidth.value,minHeight:t.contentsHeight.value,borderTopLeftRadius:t.borderTopRadius.value?t.borderTopRadius.value:t.borderTopLeftRadius.value,borderTopRightRadius:t.borderTopRadius?t.borderTopRadius.value:t.borderTopRightRadius.value,backgroundColor:t.dark.value?t.darkContentsColor.value:t.contentsColor.value,color:t.dark.value?"white":"black",bottom:`${b.value}px`},on:{touchstart:m,touchmove:s,touchend:I},onTouchstart:m,onTouchmove:s,onTouchend:I},[t.noTip.value?null:o.h("div",{class:"modal-contents-chip-wrapper",on:{mousedown:i},onMousedown:i},[o.h("div",{class:"modal-contents-chip"})]),(y=(g=a.slots).default)==null?void 0:y.call(g)]):null])}}});exports.default=$;exports.swipeModal=$;

@@ -432,2 +432,3 @@ (function(){ try {var elementStyle = document.createElement('style'); elementStyle.appendChild(document.createTextNode(".swipe-modal-takumaru-vue-swipe-modal{position:fixed;scrollbar-width:none;z-index:15}.swipe-modal-takumaru-vue-swipe-modal .modal-background{position:fixed;z-index:11;width:100vw;height:100vh;top:50%;left:50%;transform:translate(-50%,-50%)}.swipe-modal-takumaru-vue-swipe-modal .modal-contents{position:fixed;z-index:12;max-height:100vh;left:50%;transform:translate(-50%) translateY(0);overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none;backface-visibility:hidden;-webkit-backface-visibility:hidden;filter:drop-shadow(0px 16px 40px rgba(0,37,80,.2))}.swipe-modal-takumaru-vue-swipe-modal .modal-contents::-webkit-scrollbar{width:0px}.swipe-modal-takumaru-vue-swipe-modal .modal-contents-chip-wrapper{z-index:12;display:flex;justify-items:center;align-items:center;justify-content:center;align-content:center;position:relative;top:0px;height:4px;width:100%;padding-top:8px;padding-bottom:8px;cursor:s-resize}.swipe-modal-takumaru-vue-swipe-modal .modal-contents-chip{--tip-color: #c8c8c8;width:40px;height:100%;border-radius:4px;background-color:var(--tip-color)}")); document.head.appendChild(elementStyle);} catch(e) {console.error('vite-plugin-css-injected-by-js', e);} })();import { ref, unref, getCurrentScope, onScopeDispose, computed, watch, install, defineComponent, toRefs, h } from "vue-demi";

context.emit("open");
document.documentElement.style.overflowY = "hidden";
contentsBottomPosition.value = 0;

@@ -434,0 +435,0 @@ backgroundColor.value = [

(function(){ try {var elementStyle = document.createElement('style'); elementStyle.appendChild(document.createTextNode(".swipe-modal-takumaru-vue-swipe-modal{position:fixed;scrollbar-width:none;z-index:15}.swipe-modal-takumaru-vue-swipe-modal .modal-background{position:fixed;z-index:11;width:100vw;height:100vh;top:50%;left:50%;transform:translate(-50%,-50%)}.swipe-modal-takumaru-vue-swipe-modal .modal-contents{position:fixed;z-index:12;max-height:100vh;left:50%;transform:translate(-50%) translateY(0);overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none;backface-visibility:hidden;-webkit-backface-visibility:hidden;filter:drop-shadow(0px 16px 40px rgba(0,37,80,.2))}.swipe-modal-takumaru-vue-swipe-modal .modal-contents::-webkit-scrollbar{width:0px}.swipe-modal-takumaru-vue-swipe-modal .modal-contents-chip-wrapper{z-index:12;display:flex;justify-items:center;align-items:center;justify-content:center;align-content:center;position:relative;top:0px;height:4px;width:100%;padding-top:8px;padding-bottom:8px;cursor:s-resize}.swipe-modal-takumaru-vue-swipe-modal .modal-contents-chip{--tip-color: #c8c8c8;width:40px;height:100%;border-radius:4px;background-color:var(--tip-color)}")); document.head.appendChild(elementStyle);} catch(e) {console.error('vite-plugin-css-injected-by-js', e);} })();var __vite_style__=document.createElement("style");__vite_style__.innerHTML=`.swipe-modal-takumaru-vue-swipe-modal{position:fixed;scrollbar-width:none;z-index:15}.swipe-modal-takumaru-vue-swipe-modal .modal-background{position:fixed;z-index:11;width:100vw;height:100vh;top:50%;left:50%;transform:translate(-50%,-50%)}.swipe-modal-takumaru-vue-swipe-modal .modal-contents{position:fixed;z-index:12;max-height:100vh;left:50%;transform:translate(-50%) translateY(0);overflow-y:scroll;-ms-overflow-style:none;scrollbar-width:none;backface-visibility:hidden;-webkit-backface-visibility:hidden;filter:drop-shadow(0px 16px 40px rgba(0,37,80,.2))}.swipe-modal-takumaru-vue-swipe-modal .modal-contents::-webkit-scrollbar{width:0px}.swipe-modal-takumaru-vue-swipe-modal .modal-contents-chip-wrapper{z-index:12;display:flex;justify-items:center;align-items:center;justify-content:center;align-content:center;position:relative;top:0px;height:4px;width:100%;padding-top:8px;padding-bottom:8px;cursor:s-resize}.swipe-modal-takumaru-vue-swipe-modal .modal-contents-chip{--tip-color: #c8c8c8;width:40px;height:100%;border-radius:4px;background-color:var(--tip-color)}
(function(g,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("vue-demi")):typeof define=="function"&&define.amd?define(["exports","vue-demi"],o):(g=typeof globalThis!="undefined"?globalThis:g||self,o(g.swipeModal={},g.vueDemi))})(this,function(g,o){"use strict";`;document.head.appendChild(__vite_style__);var H;const V=typeof window!="undefined",U=e=>typeof e=="function",Y=e=>typeof e=="number",W=(e,a,n)=>Math.min(n,Math.max(a,e)),B=()=>{};V&&((H=window==null?void 0:window.navigator)==null?void 0:H.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function j(e){return e}function N(e){return o.getCurrentScope()?(o.onScopeDispose(e),!0):!1}function G(e,a,n={}){const{immediate:c=!0}=n,i=o.ref(!1);let u=null;function d(){u&&(clearTimeout(u),u=null)}function r(){i.value=!1,d()}function p(...v){d(),i.value=!0,u=setTimeout(()=>{i.value=!1,u=null,e(...v)},o.unref(a))}return c&&(i.value=!0,V&&p()),N(r),{isPending:i,start:p,stop:r}}function q(e){var a;const n=o.unref(e);return(a=n==null?void 0:n.$el)!=null?a:n}const F=V?window:void 0,I=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},O="__vueuse_ssr_handlers__";I[O]=I[O]||{},I[O];function K(e,a,{window:n=F,initialValue:c=""}={}){const i=o.ref(c),u=o.computed(()=>{var d;return q(a)||((d=n==null?void 0:n.document)==null?void 0:d.documentElement)});return o.watch([u,()=>o.unref(e)],([d,r])=>{var p;if(d&&n){const v=(p=n.getComputedStyle(d).getPropertyValue(r))==null?void 0:p.trim();i.value=v||c}},{immediate:!0}),o.watch(i,d=>{var r;(r=u.value)!=null&&r.style&&u.value.style.setProperty(o.unref(e),d)}),i}function J(e,a={}){const{immediate:n=!0,window:c=F}=a,i=o.ref(!1);let u=null;function d(){!i.value||!c||(e(),u=c.requestAnimationFrame(d))}function r(){!i.value&&c&&(i.value=!0,d())}function p(){i.value=!1,u!=null&&c&&(c.cancelAnimationFrame(u),u=null)}return n&&r(),N(p),{isActive:i,pause:p,resume:r}}var A;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(A||(A={}));function Q([e,a,n,c]){const i=(s,l)=>1-3*l+3*s,u=(s,l)=>3*l-6*s,d=s=>3*s,r=(s,l,t)=>((i(l,t)*s+u(l,t))*s+d(l))*s,p=(s,l,t)=>3*i(l,t)*s*s+2*u(l,t)*s+d(l),v=s=>{let l=s;for(let t=0;t<4;++t){const h=p(l,e,n);if(h===0)return l;l-=(r(l,e,n)-s)/h}return l};return s=>e===a&&n===c?s:r(v(s),a,c)}function X(e,a={}){const{delay:n=0,disabled:c=!1,duration:i=1e3,onFinished:u=B,onStarted:d=B,transition:r=j}=a,p=o.computed(()=>{const f=o.unref(r);return U(f)?f:Q(f)}),v=o.computed(()=>{const f=o.unref(e);return Y(f)?f:f.map(o.unref)}),s=o.computed(()=>Y(v.value)?[v.value]:v.value),l=o.ref(s.value.slice(0));let t,h,T,_,P;const{resume:M,pause:R}=J(()=>{const f=Date.now(),b=W(1-(T-f)/t,0,1);l.value=P.map((k,y)=>{var m;return k+((m=h[y])!=null?m:0)*p.value(b)}),b>=1&&(R(),u())},{immediate:!1}),E=()=>{R(),t=o.unref(i),h=l.value.map((f,b)=>{var k,y;return((k=s.value[b])!=null?k:0)-((y=l.value[b])!=null?y:0)}),P=l.value.slice(0),_=Date.now(),T=_+t,M(),d()},x=G(E,n,{immediate:!1});return o.watch(s,()=>{o.unref(c)?l.value=s.value.slice(0):o.unref(n)<=0?E():x.start()},{deep:!0}),o.computed(()=>{const f=o.unref(c)?s:l;return Y(v.value)?f.value[0]:f.value})}const Z=()=>{const e=o.ref({isTouch:!1,touchStart:0,touchDistance:0,touchX:0,touchY:0});return{touchPosition:e,initTouchPosition:()=>{e.value={isTouch:!1,touchStart:0,touchDistance:0,touchX:0,touchY:0}},touchStart:u=>{e.value.isTouch=!0,e.value.touchStart=u.touches[0].pageY},touchMove:u=>{e.value.isTouch&&(e.value.touchY=u.touches[0].pageY,e.value.touchDistance=e.value.touchStart-e.value.touchY,e.value.touchDistance>0&&(e.value.touchDistance=0))},touchEnd:()=>{e.value.isTouch=!1}}};function D(){const e=o.ref({isMouseDown:!1,downStart:0,mouseDistance:0,mouseX:0,mouseY:0});return{mousePosition:e,initMousePosition:()=>{e.value={isMouseDown:!1,downStart:0,mouseDistance:0,mouseX:0,mouseY:0}},mouseDown:u=>{e.value.isMouseDown=!0,e.value.downStart=u.pageY},mouseMove:u=>{e.value.isMouseDown&&(e.value.mouseY=u.pageY,e.value.mouseDistance=e.value.downStart-e.value.mouseY,e.value.mouseDistance>0&&(e.value.mouseDistance=0))},mouseUp:()=>{e.value.isMouseDown=!1}}}const S=e=>{if(e.indexOf("px")>0)return Number(e.slice(0,e.indexOf("px")));if(e.indexOf("vh")>0){const a=Number(e.slice(0,e.indexOf("vh")));return window.innerHeight*(a/100)}else if(e.indexOf("vw")>0){const a=Number(e.slice(0,e.indexOf("vw")));return window.innerWidth*(a/100)}else return 0};var oe="";o.install();var $=o.defineComponent({name:"swipeModal",model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:Boolean,default:!1},dark:{type:Boolean,default:!1},persistent:{type:Boolean,default:!1},backgroundColor:{type:String,default:"#80808080"},fullscreen:{type:Boolean,default:!1},noTip:{type:Boolean,default:!1},contentsWidth:{type:String,default:"100%"},contentsHeight:{type:String,default:"30vh"},borderTopRadius:{type:String,default:null},borderTopLeftRadius:{type:String,default:"0px"},borderTopRightRadius:{type:String,default:"0px"},contentsColor:{type:String,default:"white"},tipColor:{type:String,default:"#c8c8c8"},darkContentsColor:{type:String,default:"#1E1E1E"}},emits:["update:modelValue","open","close"],setup(e,a){const{mousePosition:n,initMousePosition:c,mouseDown:i,mouseMove:u,mouseUp:d}=D(),{touchPosition:r,initTouchPosition:p,touchStart:v,touchMove:s,touchEnd:l}=Z(),t=o.toRefs(e),h=o.computed({get:()=>t.modelValue.value,set:w=>a.emit("update:modelValue",w)}),T=o.ref(250),_=o.ref(null),P=K("--tip-color",_);P.value=t.tipColor.value;const M=o.ref([parseInt(t.backgroundColor.value.slice(1,3),16),parseInt(t.backgroundColor.value.slice(3,5),16),parseInt(t.backgroundColor.value.slice(5,7),16),0]),R=X(M,{duration:250,transition:[.25,.8,.25,1]}),E=o.computed(()=>{const[w,C,ee,te]=R.value;return`rgba(${w}, ${C}, ${ee}, ${te})`}),x=o.ref(-1*S(t.contentsHeight.value)),f=X(x,{duration:T.value,transition:[.25,.8,.25,1]}),b=o.computed(()=>f.value+(Math.abs(r.value.touchDistance)>Math.abs(n.value.mouseDistance)?r.value.touchDistance:n.value.mouseDistance)),k=()=>{document.documentElement.style.overflowY="auto",h.value=!1},y=()=>{a.emit("open"),x.value=0,M.value=[parseInt(t.backgroundColor.value.slice(1,3),16),parseInt(t.backgroundColor.value.slice(3,5),16),parseInt(t.backgroundColor.value.slice(5,7),16),parseInt(t.backgroundColor.value.slice(7,9),16)/255]},m=()=>{x.value=-1*S(t.contentsHeight.value)-(Math.abs(r.value.touchDistance)>Math.abs(n.value.mouseDistance)?r.value.touchDistance:n.value.mouseDistance),M.value=[parseInt(t.backgroundColor.value.slice(1,3),16),parseInt(t.backgroundColor.value.slice(3,5),16),parseInt(t.backgroundColor.value.slice(5,7),16),0],setTimeout(()=>{c(),p(),k(),a.emit("close")},T.value)},z=()=>{l(),-1*r.value.touchDistance>S(t.contentsHeight.value)/8?m():r.value.touchDistance=0},L=()=>{d(),-1*n.value.mouseDistance>S(t.contentsHeight.value)/8?m():n.value.mouseDistance=0};return o.watch(h,(w,C)=>{h.value&&y()}),()=>{var w,C;return o.h("div",{class:"swipe-modal-takumaru-vue-swipe-modal",on:{mousemove:u,mouseup:L},onMousemove:u,onMouseup:L},[t.modelValue.value?o.h("div",{class:"modal-background",style:{backgroundColor:E.value},on:{onMouseup:()=>t.persistent.value?()=>null:m(),click:()=>t.persistent.value?()=>null:m()},onMouseup:()=>{t.persistent.value||m()},onClick:()=>{t.persistent.value||m()}}):null,t.modelValue.value?o.h("div",{class:"modal-contents",style:{width:t.contentsWidth.value,minHeight:t.contentsHeight.value,borderTopLeftRadius:t.borderTopRadius.value?t.borderTopRadius.value:t.borderTopLeftRadius.value,borderTopRightRadius:t.borderTopRadius?t.borderTopRadius.value:t.borderTopRightRadius.value,backgroundColor:t.dark.value?t.darkContentsColor.value:t.contentsColor.value,color:t.dark.value?"white":"black",bottom:`${b.value}px`},on:{touchstart:v,touchmove:s,touchend:z},onTouchstart:v,onTouchmove:s,onTouchend:z},[t.noTip.value?null:o.h("div",{class:"modal-contents-chip-wrapper",on:{mousedown:i},onMousedown:i},[o.h("div",{class:"modal-contents-chip"})]),(C=(w=a.slots).default)==null?void 0:C.call(w)]):null])}}});g.default=$,g.swipeModal=$,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
(function(w,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("vue-demi")):typeof define=="function"&&define.amd?define(["exports","vue-demi"],o):(w=typeof globalThis!="undefined"?globalThis:w||self,o(w.swipeModal={},w.vueDemi))})(this,function(w,o){"use strict";`;document.head.appendChild(__vite_style__);var H;const V=typeof window!="undefined",U=e=>typeof e=="function",Y=e=>typeof e=="number",W=(e,a,n)=>Math.min(n,Math.max(a,e)),B=()=>{};V&&((H=window==null?void 0:window.navigator)==null?void 0:H.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function j(e){return e}function N(e){return o.getCurrentScope()?(o.onScopeDispose(e),!0):!1}function G(e,a,n={}){const{immediate:c=!0}=n,i=o.ref(!1);let u=null;function d(){u&&(clearTimeout(u),u=null)}function r(){i.value=!1,d()}function p(...v){d(),i.value=!0,u=setTimeout(()=>{i.value=!1,u=null,e(...v)},o.unref(a))}return c&&(i.value=!0,V&&p()),N(r),{isPending:i,start:p,stop:r}}function q(e){var a;const n=o.unref(e);return(a=n==null?void 0:n.$el)!=null?a:n}const F=V?window:void 0,I=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},O="__vueuse_ssr_handlers__";I[O]=I[O]||{},I[O];function K(e,a,{window:n=F,initialValue:c=""}={}){const i=o.ref(c),u=o.computed(()=>{var d;return q(a)||((d=n==null?void 0:n.document)==null?void 0:d.documentElement)});return o.watch([u,()=>o.unref(e)],([d,r])=>{var p;if(d&&n){const v=(p=n.getComputedStyle(d).getPropertyValue(r))==null?void 0:p.trim();i.value=v||c}},{immediate:!0}),o.watch(i,d=>{var r;(r=u.value)!=null&&r.style&&u.value.style.setProperty(o.unref(e),d)}),i}function J(e,a={}){const{immediate:n=!0,window:c=F}=a,i=o.ref(!1);let u=null;function d(){!i.value||!c||(e(),u=c.requestAnimationFrame(d))}function r(){!i.value&&c&&(i.value=!0,d())}function p(){i.value=!1,u!=null&&c&&(c.cancelAnimationFrame(u),u=null)}return n&&r(),N(p),{isActive:i,pause:p,resume:r}}var A;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(A||(A={}));function Q([e,a,n,c]){const i=(s,l)=>1-3*l+3*s,u=(s,l)=>3*l-6*s,d=s=>3*s,r=(s,l,t)=>((i(l,t)*s+u(l,t))*s+d(l))*s,p=(s,l,t)=>3*i(l,t)*s*s+2*u(l,t)*s+d(l),v=s=>{let l=s;for(let t=0;t<4;++t){const h=p(l,e,n);if(h===0)return l;l-=(r(l,e,n)-s)/h}return l};return s=>e===a&&n===c?s:r(v(s),a,c)}function X(e,a={}){const{delay:n=0,disabled:c=!1,duration:i=1e3,onFinished:u=B,onStarted:d=B,transition:r=j}=a,p=o.computed(()=>{const f=o.unref(r);return U(f)?f:Q(f)}),v=o.computed(()=>{const f=o.unref(e);return Y(f)?f:f.map(o.unref)}),s=o.computed(()=>Y(v.value)?[v.value]:v.value),l=o.ref(s.value.slice(0));let t,h,T,_,P;const{resume:M,pause:E}=J(()=>{const f=Date.now(),b=W(1-(T-f)/t,0,1);l.value=P.map((y,k)=>{var m;return y+((m=h[k])!=null?m:0)*p.value(b)}),b>=1&&(E(),u())},{immediate:!1}),R=()=>{E(),t=o.unref(i),h=l.value.map((f,b)=>{var y,k;return((y=s.value[b])!=null?y:0)-((k=l.value[b])!=null?k:0)}),P=l.value.slice(0),_=Date.now(),T=_+t,M(),d()},x=G(R,n,{immediate:!1});return o.watch(s,()=>{o.unref(c)?l.value=s.value.slice(0):o.unref(n)<=0?R():x.start()},{deep:!0}),o.computed(()=>{const f=o.unref(c)?s:l;return Y(v.value)?f.value[0]:f.value})}const Z=()=>{const e=o.ref({isTouch:!1,touchStart:0,touchDistance:0,touchX:0,touchY:0});return{touchPosition:e,initTouchPosition:()=>{e.value={isTouch:!1,touchStart:0,touchDistance:0,touchX:0,touchY:0}},touchStart:u=>{e.value.isTouch=!0,e.value.touchStart=u.touches[0].pageY},touchMove:u=>{e.value.isTouch&&(e.value.touchY=u.touches[0].pageY,e.value.touchDistance=e.value.touchStart-e.value.touchY,e.value.touchDistance>0&&(e.value.touchDistance=0))},touchEnd:()=>{e.value.isTouch=!1}}};function D(){const e=o.ref({isMouseDown:!1,downStart:0,mouseDistance:0,mouseX:0,mouseY:0});return{mousePosition:e,initMousePosition:()=>{e.value={isMouseDown:!1,downStart:0,mouseDistance:0,mouseX:0,mouseY:0}},mouseDown:u=>{e.value.isMouseDown=!0,e.value.downStart=u.pageY},mouseMove:u=>{e.value.isMouseDown&&(e.value.mouseY=u.pageY,e.value.mouseDistance=e.value.downStart-e.value.mouseY,e.value.mouseDistance>0&&(e.value.mouseDistance=0))},mouseUp:()=>{e.value.isMouseDown=!1}}}const S=e=>{if(e.indexOf("px")>0)return Number(e.slice(0,e.indexOf("px")));if(e.indexOf("vh")>0){const a=Number(e.slice(0,e.indexOf("vh")));return window.innerHeight*(a/100)}else if(e.indexOf("vw")>0){const a=Number(e.slice(0,e.indexOf("vw")));return window.innerWidth*(a/100)}else return 0};var oe="";o.install();var $=o.defineComponent({name:"swipeModal",model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:Boolean,default:!1},dark:{type:Boolean,default:!1},persistent:{type:Boolean,default:!1},backgroundColor:{type:String,default:"#80808080"},fullscreen:{type:Boolean,default:!1},noTip:{type:Boolean,default:!1},contentsWidth:{type:String,default:"100%"},contentsHeight:{type:String,default:"30vh"},borderTopRadius:{type:String,default:null},borderTopLeftRadius:{type:String,default:"0px"},borderTopRightRadius:{type:String,default:"0px"},contentsColor:{type:String,default:"white"},tipColor:{type:String,default:"#c8c8c8"},darkContentsColor:{type:String,default:"#1E1E1E"}},emits:["update:modelValue","open","close"],setup(e,a){const{mousePosition:n,initMousePosition:c,mouseDown:i,mouseMove:u,mouseUp:d}=D(),{touchPosition:r,initTouchPosition:p,touchStart:v,touchMove:s,touchEnd:l}=Z(),t=o.toRefs(e),h=o.computed({get:()=>t.modelValue.value,set:g=>a.emit("update:modelValue",g)}),T=o.ref(250),_=o.ref(null),P=K("--tip-color",_);P.value=t.tipColor.value;const M=o.ref([parseInt(t.backgroundColor.value.slice(1,3),16),parseInt(t.backgroundColor.value.slice(3,5),16),parseInt(t.backgroundColor.value.slice(5,7),16),0]),E=X(M,{duration:250,transition:[.25,.8,.25,1]}),R=o.computed(()=>{const[g,C,ee,te]=E.value;return`rgba(${g}, ${C}, ${ee}, ${te})`}),x=o.ref(-1*S(t.contentsHeight.value)),f=X(x,{duration:T.value,transition:[.25,.8,.25,1]}),b=o.computed(()=>f.value+(Math.abs(r.value.touchDistance)>Math.abs(n.value.mouseDistance)?r.value.touchDistance:n.value.mouseDistance)),y=()=>{document.documentElement.style.overflowY="auto",h.value=!1},k=()=>{a.emit("open"),document.documentElement.style.overflowY="hidden",x.value=0,M.value=[parseInt(t.backgroundColor.value.slice(1,3),16),parseInt(t.backgroundColor.value.slice(3,5),16),parseInt(t.backgroundColor.value.slice(5,7),16),parseInt(t.backgroundColor.value.slice(7,9),16)/255]},m=()=>{x.value=-1*S(t.contentsHeight.value)-(Math.abs(r.value.touchDistance)>Math.abs(n.value.mouseDistance)?r.value.touchDistance:n.value.mouseDistance),M.value=[parseInt(t.backgroundColor.value.slice(1,3),16),parseInt(t.backgroundColor.value.slice(3,5),16),parseInt(t.backgroundColor.value.slice(5,7),16),0],setTimeout(()=>{c(),p(),y(),a.emit("close")},T.value)},z=()=>{l(),-1*r.value.touchDistance>S(t.contentsHeight.value)/8?m():r.value.touchDistance=0},L=()=>{d(),-1*n.value.mouseDistance>S(t.contentsHeight.value)/8?m():n.value.mouseDistance=0};return o.watch(h,(g,C)=>{h.value&&k()}),()=>{var g,C;return o.h("div",{class:"swipe-modal-takumaru-vue-swipe-modal",on:{mousemove:u,mouseup:L},onMousemove:u,onMouseup:L},[t.modelValue.value?o.h("div",{class:"modal-background",style:{backgroundColor:R.value},on:{onMouseup:()=>t.persistent.value?()=>null:m(),click:()=>t.persistent.value?()=>null:m()},onMouseup:()=>{t.persistent.value||m()},onClick:()=>{t.persistent.value||m()}}):null,t.modelValue.value?o.h("div",{class:"modal-contents",style:{width:t.contentsWidth.value,minHeight:t.contentsHeight.value,borderTopLeftRadius:t.borderTopRadius.value?t.borderTopRadius.value:t.borderTopLeftRadius.value,borderTopRightRadius:t.borderTopRadius?t.borderTopRadius.value:t.borderTopRightRadius.value,backgroundColor:t.dark.value?t.darkContentsColor.value:t.contentsColor.value,color:t.dark.value?"white":"black",bottom:`${b.value}px`},on:{touchstart:v,touchmove:s,touchend:z},onTouchstart:v,onTouchmove:s,onTouchend:z},[t.noTip.value?null:o.h("div",{class:"modal-contents-chip-wrapper",on:{mousedown:i},onMousedown:i},[o.h("div",{class:"modal-contents-chip"})]),(C=(g=a.slots).default)==null?void 0:C.call(g)]):null])}}});w.default=$,w.swipeModal=$,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
{
"name": "@takuma-ru/vue-swipe-modal",
"version": "4.0.0",
"version": "4.0.1",
"private": false,

@@ -5,0 +5,0 @@ "description": "Swipeable Bottom Sheet library for vue2 and vue3",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc