@takuma-ru/vue-swipe-modal
Advanced tools
Comparing version 5.0.0-beta.0 to 5.0.0-beta.1
@@ -1,37 +0,37 @@ | ||
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('._swipe-modal_newr5_1{position:fixed;bottom:var(--65f00ac0);left:0;z-index:1;display:flex;flex-direction:column;padding:0;border:none}._swipe-modal_newr5_1>._panel_newr5_11{position:relative;overflow:auto}._swipe-modal-drag-handle-wrapper_newr5_16{position:relative;flex-shrink:0;height:36px;cursor:grab}._swipe-modal-drag-handle-wrapper_newr5_16:active{cursor:grabbing}._swipe-modal-drag-handle_newr5_16{position:absolute;left:50%;width:32px;height:4px;margin:16px 0;content:"";background-color:#ccc;border-radius:2px;transform:translate(-50%)}._swipe-modal-backdrop_newr5_38{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#00000080;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}')),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})(); | ||
import { getCurrentInstance as R, onMounted as T, nextTick as x, getCurrentScope as H, onScopeDispose as G, unref as N, ref as p, watch as B, computed as O, defineComponent as I, useCssVars as U, openBlock as X, createElementBlock as q, Fragment as J, createElementVNode as k, normalizeClass as _, renderSlot as E, createCommentVNode as z, withDirectives as K, vShow as Q } from "vue"; | ||
function P(e) { | ||
return H() ? (G(e), !0) : !1; | ||
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('._swipe-modal_13dg7_1{position:fixed;bottom:var(--e08034d2);left:0;z-index:1;display:flex;flex-direction:column;padding:0;border:none}._swipe-modal_13dg7_1>._panel_13dg7_11{position:relative;overflow:auto}._default-modal-style_13dg7_16{box-sizing:border-box;width:100%;height:50dvh;color:#fff;background-color:#1d1b20;border-radius:1rem 1rem 0 0}@media (prefers-color-scheme: light){._default-modal-style_13dg7_16{color:#000;background-color:#f7f2fa;box-shadow:0 1px 4px #0000005e}}._swipe-modal-drag-handle-wrapper_13dg7_32{position:relative;flex-shrink:0;height:36px;cursor:grab}._swipe-modal-drag-handle-wrapper_13dg7_32:active{cursor:grabbing}._swipe-modal-drag-handle_13dg7_32{position:absolute;left:50%;width:32px;height:4px;margin:16px 0;content:"";background-color:#ccc;border-radius:2px;transform:translate(-50%)}._wipe-modal-backdrop-wrapper_13dg7_54{position:fixed;top:0;left:0;width:100%;height:100%}._swipe-modal-backdrop_13dg7_62{width:100%;height:100%;background-color:#00000080;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px)}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})(); | ||
import { getCurrentInstance as P, onMounted as D, nextTick as G, getCurrentScope as N, onScopeDispose as I, unref as U, ref as p, watch as O, computed as $, defineComponent as X, useCssVars as q, openBlock as z, createElementBlock as A, Fragment as J, createElementVNode as _, normalizeClass as k, renderSlot as E, createCommentVNode as R } from "vue"; | ||
function L(e) { | ||
return N() ? (I(e), !0) : !1; | ||
} | ||
function D(e) { | ||
return typeof e == "function" ? e() : N(e); | ||
function Y(e) { | ||
return typeof e == "function" ? e() : U(e); | ||
} | ||
const Z = typeof window < "u" && typeof document < "u"; | ||
const K = typeof window < "u" && typeof document < "u"; | ||
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope; | ||
const ee = Object.prototype.toString, te = (e) => ee.call(e) === "[object Object]", oe = () => { | ||
const Q = Object.prototype.toString, Z = (e) => Q.call(e) === "[object Object]", ee = () => { | ||
}; | ||
function ne(e, l = !0) { | ||
R() ? T(e) : l ? e() : x(e); | ||
function te(e, l = !0) { | ||
P() ? D(e) : l ? e() : G(e); | ||
} | ||
function M(e) { | ||
var l; | ||
const o = D(e); | ||
const o = Y(e); | ||
return (l = o == null ? void 0 : o.$el) != null ? l : o; | ||
} | ||
const L = Z ? window : void 0; | ||
function A(...e) { | ||
const F = K ? window : void 0; | ||
function T(...e) { | ||
let l, o, i, s; | ||
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([o, i, s] = e, l = L) : [l, o, i, s] = e, !l) | ||
return oe; | ||
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([o, i, s] = e, l = F) : [l, o, i, s] = e, !l) | ||
return ee; | ||
Array.isArray(o) || (o = [o]), Array.isArray(i) || (i = [i]); | ||
const n = [], c = () => { | ||
n.forEach((r) => r()), n.length = 0; | ||
}, d = (r, u, v, m) => (r.addEventListener(u, v, m), () => r.removeEventListener(u, v, m)), a = B( | ||
() => [M(l), D(s)], | ||
}, d = (r, u, v, m) => (r.addEventListener(u, v, m), () => r.removeEventListener(u, v, m)), a = O( | ||
() => [M(l), Y(s)], | ||
([r, u]) => { | ||
if (c(), !r) | ||
return; | ||
const v = te(u) ? { ...u } : u; | ||
const v = Z(u) ? { ...u } : u; | ||
n.push( | ||
...o.flatMap((m) => i.map((h) => d(r, m, h, v))) | ||
...o.flatMap((m) => i.map((y) => d(r, m, y, v))) | ||
); | ||
@@ -43,20 +43,20 @@ }, | ||
}; | ||
return P(f), f; | ||
return L(f), f; | ||
} | ||
function le() { | ||
function oe() { | ||
const e = p(!1); | ||
return R() && T(() => { | ||
return P() && D(() => { | ||
e.value = !0; | ||
}), e; | ||
} | ||
function ae(e) { | ||
const l = le(); | ||
return O(() => (l.value, !!e())); | ||
function ne(e) { | ||
const l = oe(); | ||
return $(() => (l.value, !!e())); | ||
} | ||
function se(e, l, o = {}) { | ||
const { window: i = L, ...s } = o; | ||
function le(e, l, o = {}) { | ||
const { window: i = F, ...s } = o; | ||
let n; | ||
const c = ae(() => i && "ResizeObserver" in i), d = () => { | ||
const c = ne(() => i && "ResizeObserver" in i), d = () => { | ||
n && (n.disconnect(), n = void 0); | ||
}, a = O(() => Array.isArray(e) ? e.map((u) => M(u)) : [M(e)]), f = B( | ||
}, a = $(() => Array.isArray(e) ? e.map((u) => M(u)) : [M(e)]), f = O( | ||
a, | ||
@@ -74,3 +74,3 @@ (u) => { | ||
}; | ||
return P(r), { | ||
return L(r), { | ||
isSupported: c, | ||
@@ -80,3 +80,3 @@ stop: r | ||
} | ||
function re(e, l = {}) { | ||
function ae(e, l = {}) { | ||
const { | ||
@@ -88,3 +88,3 @@ reset: o = !0, | ||
} = l, c = p(0), d = p(0), a = p(0), f = p(0), r = p(0), u = p(0), v = p(0), m = p(0); | ||
function h() { | ||
function y() { | ||
const g = M(e); | ||
@@ -95,7 +95,7 @@ if (!g) { | ||
} | ||
const y = g.getBoundingClientRect(); | ||
c.value = y.height, d.value = y.bottom, a.value = y.left, f.value = y.right, r.value = y.top, u.value = y.width, v.value = y.x, m.value = y.y; | ||
const b = g.getBoundingClientRect(); | ||
c.value = b.height, d.value = b.bottom, a.value = b.left, f.value = b.right, r.value = b.top, u.value = b.width, v.value = b.x, m.value = b.y; | ||
} | ||
return se(e, h), B(() => M(e), (g) => !g && h()), s && A("scroll", h, { capture: !0, passive: !0 }), i && A("resize", h, { passive: !0 }), ne(() => { | ||
n && h(); | ||
return le(e, y), O(() => M(e), (g) => !g && y()), s && T("scroll", y, { capture: !0, passive: !0 }), i && T("resize", y, { passive: !0 }), te(() => { | ||
n && y(); | ||
}), { | ||
@@ -110,6 +110,6 @@ height: c, | ||
y: m, | ||
update: h | ||
update: y | ||
}; | ||
} | ||
const ue = ["open"], ie = /* @__PURE__ */ I({ | ||
const se = ["open"], re = /* @__PURE__ */ X({ | ||
__name: "SwipeModal", | ||
@@ -126,6 +126,6 @@ props: { | ||
setup(e, { emit: l }) { | ||
U((t) => ({ | ||
"65f00ac0": u.value | ||
q((t) => ({ | ||
e08034d2: u.value | ||
})); | ||
const o = e, i = l, s = O({ | ||
const o = e, i = l, s = $({ | ||
get: () => o.modelValue, | ||
@@ -135,7 +135,7 @@ set: (t) => { | ||
} | ||
}), n = p(null), c = p(null), d = p(!1), a = p(0), f = p(0), { height: r } = re(n), u = O(() => o.modelValue ? a.value < 0 ? `${a.value}px` : "0%" : "-100%"), v = () => { | ||
}), n = p(null), c = p(null), d = p(!1), a = p(0), f = p(0), { height: r } = ae(n), u = $(() => o.modelValue ? a.value < 0 ? `${a.value}px` : "0%" : "-100%"), v = () => { | ||
o.isPersistent || (s.value = !1); | ||
}, m = (t) => { | ||
f.value = t.y, d.value = !0; | ||
}, h = () => { | ||
}, y = () => { | ||
if (d.value = !1, o.isPersistent) | ||
@@ -149,7 +149,7 @@ return S(); | ||
d.value && (a.value = f.value - t.y); | ||
}, y = (t) => { | ||
}, b = (t) => { | ||
f.value = t.touches[0].clientY, d.value = !0; | ||
}, Y = (t) => { | ||
}, W = (t) => { | ||
d.value && (a.value = f.value - t.touches[0].clientY); | ||
}, F = () => { | ||
}, j = () => { | ||
if (d.value = !1, o.isPersistent) | ||
@@ -176,3 +176,3 @@ return S(); | ||
}); | ||
}, W = () => { | ||
}, H = () => { | ||
n.value && (n.value.style.removeProperty("display"), V("hidden"), n.value.animate( | ||
@@ -199,3 +199,3 @@ [ | ||
)); | ||
}, j = () => { | ||
}, x = () => { | ||
if (!n.value) | ||
@@ -214,3 +214,3 @@ return; | ||
); | ||
const w = n.value.animate( | ||
const h = n.value.animate( | ||
[ | ||
@@ -228,5 +228,5 @@ { bottom: `${a.value}px` }, | ||
); | ||
w.onfinish = () => { | ||
var b; | ||
a.value = 0, s.value = !1, w.cancel(), V("auto"), (b = n.value) == null || b.style.setProperty("display", "none"); | ||
h.onfinish = () => { | ||
var w; | ||
a.value = 0, s.value = !1, h.cancel(), V("auto"), (w = n.value) == null || w.style.setProperty("display", "none"); | ||
}; | ||
@@ -236,58 +236,67 @@ }, V = (t) => { | ||
return; | ||
let w = window, b, $, C; | ||
document.defaultView ? (w = document.defaultView, b = w.pageXOffset, $ = w.pageYOffset) : (C = document.documentElement, b = C.scrollLeft, $ = C.scrollTop), document.documentElement.style.overflow = t, document.documentElement.style.overscrollBehaviorY = t === "auto" ? "auto" : "none", w.scrollTo(b, $); | ||
let h = window, w, B, C; | ||
document.defaultView ? (h = document.defaultView, w = h.pageXOffset, B = h.pageYOffset) : (C = document.documentElement, w = C.scrollLeft, B = C.scrollTop), document.documentElement.style.overflow = t, document.documentElement.style.overscrollBehaviorY = t === "auto" ? "auto" : "none", h.scrollTo(w, B); | ||
}; | ||
return B( | ||
return O( | ||
() => s.value, | ||
(t) => { | ||
t && W(), t || j(); | ||
t && H(), t || x(); | ||
} | ||
), (t, w) => (X(), q(J, null, [ | ||
k("dialog", { | ||
), (t, h) => (z(), A(J, null, [ | ||
_("dialog", { | ||
ref_key: "modalRef", | ||
ref: n, | ||
class: _([o.class, t.$style["swipe-modal"]]), | ||
class: k([ | ||
o.class, | ||
!o.class && t.$style["default-modal-style"], | ||
t.$style["swipe-modal"] | ||
]), | ||
open: s.value, | ||
onClose: w[0] || (w[0] = (b) => s.value = !1) | ||
onClose: h[0] || (h[0] = (w) => s.value = !1) | ||
}, [ | ||
k("div", { | ||
class: _(t.$style["swipe-modal-drag-handle-wrapper"]), | ||
_("div", { | ||
class: k(t.$style["swipe-modal-drag-handle-wrapper"]), | ||
onMousedown: m, | ||
onMousemove: g, | ||
onMouseup: h, | ||
onTouchstart: y, | ||
onTouchmove: Y, | ||
onTouchend: F | ||
onMouseup: y, | ||
onTouchstart: b, | ||
onTouchmove: W, | ||
onTouchend: j | ||
}, [ | ||
t.isDragHandle ? E(t.$slots, "drag-handle", { key: 0 }, () => [ | ||
k("div", { | ||
class: _(t.$style["swipe-modal-drag-handle"]) | ||
_("div", { | ||
class: k(t.$style["swipe-modal-drag-handle"]) | ||
}, null, 2) | ||
]) : z("", !0) | ||
]) : R("", !0) | ||
], 34), | ||
k("div", { | ||
class: _(t.$style.panel) | ||
_("div", { | ||
class: k(t.$style.panel) | ||
}, [ | ||
E(t.$slots, "default") | ||
], 2) | ||
], 42, ue), | ||
t.isBackdrop ? E(t.$slots, "backdrop", { key: 0 }, () => [ | ||
K(k("div", { | ||
ref_key: "backdropRef", | ||
ref: c, | ||
class: _(t.$style["swipe-modal-backdrop"]), | ||
onClick: v | ||
}, null, 2), [ | ||
[Q, s.value] | ||
], 42, se), | ||
t.isBackdrop && s.value ? (z(), A("div", { | ||
key: 0, | ||
ref_key: "backdropRef", | ||
ref: c, | ||
class: k(t.$style["wipe-modal-backdrop-wrapper"]), | ||
onClick: v | ||
}, [ | ||
E(t.$slots, "backdrop", {}, () => [ | ||
_("div", { | ||
class: k(t.$style["swipe-modal-backdrop"]) | ||
}, null, 2) | ||
]) | ||
]) : z("", !0) | ||
], 2)) : R("", !0) | ||
], 64)); | ||
} | ||
}), ce = "_panel_newr5_11", de = { | ||
"swipe-modal": "_swipe-modal_newr5_1", | ||
panel: ce, | ||
"swipe-modal-drag-handle-wrapper": "_swipe-modal-drag-handle-wrapper_newr5_16", | ||
"swipe-modal-drag-handle": "_swipe-modal-drag-handle_newr5_16", | ||
"swipe-modal-backdrop": "_swipe-modal-backdrop_newr5_38" | ||
}, pe = (e, l) => { | ||
}), ue = "_panel_13dg7_11", ie = { | ||
"swipe-modal": "_swipe-modal_13dg7_1", | ||
panel: ue, | ||
"default-modal-style": "_default-modal-style_13dg7_16", | ||
"swipe-modal-drag-handle-wrapper": "_swipe-modal-drag-handle-wrapper_13dg7_32", | ||
"swipe-modal-drag-handle": "_swipe-modal-drag-handle_13dg7_32", | ||
"wipe-modal-backdrop-wrapper": "_wipe-modal-backdrop-wrapper_13dg7_54", | ||
"swipe-modal-backdrop": "_swipe-modal-backdrop_13dg7_62" | ||
}, ce = (e, l) => { | ||
const o = e.__vccOpts || e; | ||
@@ -297,8 +306,8 @@ for (const [i, s] of l) | ||
return o; | ||
}, fe = { | ||
$style: de | ||
}, me = /* @__PURE__ */ pe(ie, [["__cssModules", fe]]); | ||
}, de = { | ||
$style: ie | ||
}, fe = /* @__PURE__ */ ce(re, [["__cssModules", de]]); | ||
export { | ||
me as SwipeModal, | ||
me as default | ||
fe as SwipeModal, | ||
fe as default | ||
}; |
{ | ||
"name": "@takuma-ru/vue-swipe-modal", | ||
"private": false, | ||
"version": "5.0.0-beta.0", | ||
"version": "5.0.0-beta.1", | ||
"description": "Swipeable Bottom Sheet library for vue2 and vue3", | ||
@@ -52,3 +52,10 @@ "license": "MIT", | ||
"build": "vue-tsc && vite build", | ||
"build:watch": "vue-tsc --watch & vite build --watch", | ||
"preview": "vite preview", | ||
"lint": "eslint --fix src/*.{ts,vue} && eslint --fix src/**/*.{ts,vue}", | ||
"lint:type-check": "tsc -p . && vue-tsc", | ||
"lint:css": "stylelint \"**/*.vue\"", | ||
"format": "prettier -w src/*.{ts,vue} && prettier -w src/**/*.{ts,vue}", | ||
"format:css": "stylelint \"**/*.vue\" --fix", | ||
"fix": "pnpm format && pnpm format:css && pnpm lint", | ||
"publish:major": "pnpm build && pnpm dlx release-it major --ci", | ||
@@ -61,3 +68,4 @@ "publish:minor": "pnpm build && pnpm dlx release-it minor --ci", | ||
"publish:prerelease": "pnpm build && pnpm dlx release-it prerelease --ci", | ||
"publish:major-beta:no-ci": "pnpm build && pnpm dlx release-it major --preRelease=beta" | ||
"publish:major-beta:no-ci": "pnpm build && pnpm dlx release-it major --preRelease=beta", | ||
"publish:prerelease:no-ci": "pnpm build && pnpm dlx release-it prerelease" | ||
}, | ||
@@ -69,4 +77,19 @@ "dependencies": { | ||
"devDependencies": { | ||
"@vitejs/plugin-vue": "^4.2.3", | ||
"@typescript-eslint/eslint-plugin": "^6.10.0", | ||
"@typescript-eslint/parser": "^6.10.0", | ||
"@vitejs/plugin-vue": "^4.4.1", | ||
"@vue/eslint-config-prettier": "^8.0.0", | ||
"@vue/eslint-config-typescript": "^12.0.0", | ||
"eslint": "^8.53.0", | ||
"eslint-plugin-vue": "^9.18.1", | ||
"prettier": "^3.0.3", | ||
"sass": "^1.69.5", | ||
"stylelint": "^15.11.0", | ||
"stylelint-config-prettier": "^9.0.5", | ||
"stylelint-config-recess-order": "^4.3.0", | ||
"stylelint-config-recommended-scss": "^13.1.0", | ||
"stylelint-config-recommended-vue": "^1.5.0", | ||
"stylelint-config-standard-scss": "^11.1.0", | ||
"stylelint-prettier": "^4.0.2", | ||
"stylelint-rscss": "^0.4.0", | ||
"typescript": "^5.0.2", | ||
@@ -73,0 +96,0 @@ "vite": "^4.4.5", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
34679
431
0
21
3
10