@douxcode/vue-spring-bottom-sheet 2.4.1 → 2.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +18 -15
- package/dist/style.css +1 -1
- package/package.json +4 -2
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ref as P, computed as _, defineComponent as Be, watch as q, onMounted as Ie, toRefs as Ee, nextTick as N, onUnmounted as _e, createBlock as te, openBlock as ae, Teleport as De, createElementVNode as ne, createVNode as
|
|
2
|
-
import { useMotionValue as me, animate as B, AnimatePresence as be, Motion as
|
|
1
|
+
import { ref as P, computed as _, defineComponent as Be, watch as q, onMounted as Ie, toRefs as Ee, nextTick as N, onUnmounted as _e, createBlock as te, openBlock as ae, Teleport as De, createElementVNode as ne, createVNode as $, unref as m, withCtx as E, createCommentVNode as ge, normalizeStyle as He, normalizeClass as oe, renderSlot as le } from "vue";
|
|
2
|
+
import { useMotionValue as me, animate as B, AnimatePresence as be, Motion as A } from "motion-v";
|
|
3
3
|
import { useVModel as Ve, useWindowSize as Fe, useElementBounding as Q, useScrollLock as ye } from "@vueuse/core";
|
|
4
4
|
import { useFocusTrap as Re } from "@vueuse/integrations/useFocusTrap";
|
|
5
5
|
function G(n, a) {
|
|
6
6
|
const o = parseFloat(n);
|
|
7
7
|
return a * o / 100;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function $e(n, a, o) {
|
|
10
10
|
const t = P(0), s = _(() => n.value.map((p) => typeof p == "string" ? G(p, o.value) : p)), y = _(() => Math.min(...s.value)), r = _(() => Math.max(...s.value)), h = _(() => {
|
|
11
11
|
const p = s.value.reduce(
|
|
12
12
|
(g, M) => Math.abs(M - a.value) < Math.abs(g - a.value) ? M : g
|
|
@@ -21,14 +21,14 @@ function Ae(n, a, o) {
|
|
|
21
21
|
closestSnapPointIndex: h
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Ae(n, a, o) {
|
|
25
25
|
let t = (s) => n(s, ...a);
|
|
26
26
|
return o === void 0 ? t : Object.assign(t, { lazy: o, lazyArgs: a });
|
|
27
27
|
}
|
|
28
28
|
function We(n, a, o) {
|
|
29
29
|
let t = n.length - a.length;
|
|
30
30
|
if (t === 0) return n(...a);
|
|
31
|
-
if (t === 1) return
|
|
31
|
+
if (t === 1) return Ae(n, a, o);
|
|
32
32
|
throw new Error("Wrong number of arguments");
|
|
33
33
|
}
|
|
34
34
|
function je(n, { triggerAt: a = "end", minQuietPeriodMs: o, maxBurstDurationMs: t, minGapMs: s, reducer: y = ze }) {
|
|
@@ -122,11 +122,14 @@ const Qe = { "data-vsbs-container": "" }, Ge = /* @__PURE__ */ Be({
|
|
|
122
122
|
closestSnapPointIndex: V,
|
|
123
123
|
minSnapPoint: O,
|
|
124
124
|
maxSnapPoint: F
|
|
125
|
-
} =
|
|
125
|
+
} = $e(d, l, c);
|
|
126
126
|
let w;
|
|
127
127
|
const j = ye(document.body), z = ye(document.documentElement), Y = Re([r, H], {
|
|
128
128
|
immediate: !1,
|
|
129
|
-
fallbackFocus: () =>
|
|
129
|
+
fallbackFocus: () => {
|
|
130
|
+
var e;
|
|
131
|
+
return ((e = r.value) == null ? void 0 : e.$el) || document.body;
|
|
132
|
+
}
|
|
130
133
|
});
|
|
131
134
|
function ie(e) {
|
|
132
135
|
i.value = !0, ve(e);
|
|
@@ -299,9 +302,9 @@ const Qe = { "data-vsbs-container": "" }, Ge = /* @__PURE__ */ Be({
|
|
|
299
302
|
defer: e.teleportDefer
|
|
300
303
|
}, [
|
|
301
304
|
ne("div", Qe, [
|
|
302
|
-
|
|
305
|
+
$(m(be), null, {
|
|
303
306
|
default: E(() => [
|
|
304
|
-
m(y) && e.blocking ? (ae(), te(m(
|
|
307
|
+
m(y) && e.blocking ? (ae(), te(m(A), {
|
|
305
308
|
key: 0,
|
|
306
309
|
ref_key: "backdrop",
|
|
307
310
|
ref: H,
|
|
@@ -318,9 +321,9 @@ const Qe = { "data-vsbs-container": "" }, Ge = /* @__PURE__ */ Be({
|
|
|
318
321
|
]),
|
|
319
322
|
_: 1
|
|
320
323
|
}),
|
|
321
|
-
|
|
324
|
+
$(m(be), null, {
|
|
322
325
|
default: E(() => [
|
|
323
|
-
m(y) ? (ae(), te(m(
|
|
326
|
+
m(y) ? (ae(), te(m(A), {
|
|
324
327
|
key: 0,
|
|
325
328
|
ref_key: "sheet",
|
|
326
329
|
ref: r,
|
|
@@ -336,7 +339,7 @@ const Qe = { "data-vsbs-container": "" }, Ge = /* @__PURE__ */ Be({
|
|
|
336
339
|
onTouchend: xe
|
|
337
340
|
}, {
|
|
338
341
|
default: E(() => [
|
|
339
|
-
|
|
342
|
+
$(m(A), {
|
|
340
343
|
ref_key: "sheetHeader",
|
|
341
344
|
ref: h,
|
|
342
345
|
"data-vsbs-header": "",
|
|
@@ -357,7 +360,7 @@ const Qe = { "data-vsbs-container": "" }, Ge = /* @__PURE__ */ Be({
|
|
|
357
360
|
"data-vsbs-scroll": "",
|
|
358
361
|
onScrollend: Me
|
|
359
362
|
}, [
|
|
360
|
-
|
|
363
|
+
$(m(A), {
|
|
361
364
|
ref_key: "sheetContentWrapper",
|
|
362
365
|
ref: M,
|
|
363
366
|
"data-vsbs-content-wrapper": "",
|
|
@@ -379,7 +382,7 @@ const Qe = { "data-vsbs-container": "" }, Ge = /* @__PURE__ */ Be({
|
|
|
379
382
|
_: 3
|
|
380
383
|
}, 512)
|
|
381
384
|
], 544),
|
|
382
|
-
|
|
385
|
+
$(m(A), {
|
|
383
386
|
ref_key: "sheetFooter",
|
|
384
387
|
ref: p,
|
|
385
388
|
"data-vsbs-footer": "",
|
|
@@ -408,7 +411,7 @@ const Qe = { "data-vsbs-container": "" }, Ge = /* @__PURE__ */ Be({
|
|
|
408
411
|
for (const [t, s] of a)
|
|
409
412
|
o[t] = s;
|
|
410
413
|
return o;
|
|
411
|
-
}, Ze = /* @__PURE__ */ Ke(Ge, [["__scopeId", "data-v-
|
|
414
|
+
}, Ze = /* @__PURE__ */ Ke(Ge, [["__scopeId", "data-v-3c41a73f"]]);
|
|
412
415
|
export {
|
|
413
416
|
Ze as default
|
|
414
417
|
};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[data-vsbs-container][data-v-
|
|
1
|
+
[data-vsbs-container][data-v-3c41a73f]{position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden;pointer-events:none;z-index:9999;visibility:visible}[data-vsbs-backdrop][data-v-3c41a73f]{background-color:var(--vsbs-backdrop-bg, rgba(0, 0, 0, .5));top:0;right:0;bottom:0;left:0;pointer-events:auto;position:fixed;-webkit-user-select:none;user-select:none;will-change:opacity;z-index:1}[data-vsbs-shadow=true][data-v-3c41a73f]:before{content:"";z-index:-1;position:absolute;top:0;height:100lvh;width:100%;border-radius:var(--vsbs-border-radius, 16px);box-shadow:0 -5px 60px 0 var(--vsbs-shadow-color, rgba(89, 89, 89, .2))}[data-vsbs-sheet][data-v-3c41a73f]{background-color:var(--vsbs-background, #fff);border-top-left-radius:var(--vsbs-border-radius, 16px);border-top-right-radius:var(--vsbs-border-radius, 16px);border-right:1px solid var(--vsbs-outer-border-color, transparent);border-left:1px solid var(--vsbs-outer-border-color, transparent);bottom:0;display:flex;flex-direction:column;left:0;margin-left:auto;margin-right:auto;max-height:inherit;max-width:var(--vsbs-max-width, 640px);pointer-events:all;position:fixed;right:0;width:100%;will-change:height;z-index:2}[data-vsbs-sheet-show=true][data-v-3c41a73f]{visibility:visible}[data-vsbs-header][data-v-3c41a73f]{box-shadow:0 1px 0 var(--vsbs-border-color, rgba(46, 59, 66, .125));flex-shrink:0;padding:20px var(--vsbs-padding-x, 16px) 8px;-webkit-user-select:none;user-select:none;z-index:3;border-top-left-radius:var(--vsbs-border-radius, 16px);border-top-right-radius:var(--vsbs-border-radius, 16px);border-top:1px solid var(--vsbs-outer-border-color, transparent)}[data-vsbs-header][data-v-3c41a73f]:before{background-color:var(--vsbs-handle-background, rgba(0, 0, 0, .28));border-radius:2px;content:"";display:block;height:4px;left:50%;position:absolute;top:8px;transform:translate(-50%);width:36px}[data-vsbs-header][data-v-3c41a73f]:empty{box-shadow:none;padding:14px var(--vsbs-padding-x, 16px) 10px}[data-vsbs-footer][data-v-3c41a73f]{box-shadow:0 -1px 0 var(--vsbs-border-color, rgba(46, 59, 66, .125));flex-grow:0;flex-shrink:0;padding:16px var(--vsbs-padding-x, 16px);-webkit-user-select:none;user-select:none}[data-vsbs-footer][data-v-3c41a73f]:empty{display:none}[data-vsbs-scroll][data-v-3c41a73f]{flex-grow:1;overflow-y:auto;overscroll-behavior:none}[data-vsbs-content-wrapper][data-v-3c41a73f]{height:100%}[data-vsbs-content][data-v-3c41a73f]{display:grid;padding:8px var(--vsbs-padding-x, 16px);-webkit-user-select:none;user-select:none}
|
package/package.json
CHANGED
|
@@ -32,12 +32,14 @@
|
|
|
32
32
|
"url": "https://github.com/megaarmos/vue-spring-bottom-sheet/issues"
|
|
33
33
|
},
|
|
34
34
|
"private": false,
|
|
35
|
-
"version": "2.4.
|
|
35
|
+
"version": "2.4.3",
|
|
36
36
|
"type": "module",
|
|
37
37
|
"exports": {
|
|
38
38
|
".": {
|
|
39
39
|
"types": "./dist/index.d.ts",
|
|
40
|
-
"import": "./dist/index.mjs"
|
|
40
|
+
"import": "./dist/index.mjs",
|
|
41
|
+
"require": "./dist/index.mjs",
|
|
42
|
+
"default": "./dist/index.mjs"
|
|
41
43
|
},
|
|
42
44
|
"./dist/style.css": {
|
|
43
45
|
"import": "./dist/style.css",
|