@douxcode/vue-spring-bottom-sheet 1.1.3 → 1.2.0
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/README.md +9 -5
- package/dist/BottomSheet.d.ts +2 -0
- package/dist/index.mjs +143 -129
- package/dist/style.css +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -9,7 +9,11 @@
|
|
|
9
9
|
# Installation
|
|
10
10
|
|
|
11
11
|
```
|
|
12
|
-
npm install @douxcode/vue-bottom-sheet
|
|
12
|
+
npm install @douxcode/vue-spring-bottom-sheet
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
bun install @douxcode/vue-spring-bottom-sheet
|
|
13
17
|
```
|
|
14
18
|
|
|
15
19
|
# Getting started
|
|
@@ -18,8 +22,8 @@ npm install @douxcode/vue-bottom-sheet
|
|
|
18
22
|
|
|
19
23
|
```vue
|
|
20
24
|
<script setup>
|
|
21
|
-
import BottomSheet from '@douxcode/vue-bottom-sheet'
|
|
22
|
-
import '@douxcode/vue-bottom-sheet/dist/style.css'
|
|
25
|
+
import BottomSheet from '@douxcode/vue-spring-bottom-sheet'
|
|
26
|
+
import '@douxcode/vue-spring-bottom-sheet/dist/style.css'
|
|
23
27
|
import { ref } from 'vue'
|
|
24
28
|
|
|
25
29
|
const bottomSheet = ref(null)
|
|
@@ -42,8 +46,8 @@ const close = () => {
|
|
|
42
46
|
|
|
43
47
|
```vue
|
|
44
48
|
<script setup lang="ts">
|
|
45
|
-
import BottomSheet from '@douxcode/vue-bottom-sheet'
|
|
46
|
-
import '@douxcode/vue-bottom-sheet/dist/style.css'
|
|
49
|
+
import BottomSheet from '@douxcode/vue-spring-bottom-sheet'
|
|
50
|
+
import '@douxcode/vue-spring-bottom-sheet/dist/style.css'
|
|
47
51
|
import { ref } from 'vue'
|
|
48
52
|
|
|
49
53
|
const bottomSheet = ref<InstanceType<typeof BottomSheet>>()
|
package/dist/BottomSheet.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
interface IProps {
|
|
2
|
+
duration?: number;
|
|
2
3
|
snapPoints?: number[];
|
|
3
4
|
defaultBreakpoint?: number;
|
|
4
5
|
blocking?: boolean;
|
|
@@ -45,6 +46,7 @@ declare const __VLS_component: import('vue').DefineComponent<IProps, {
|
|
|
45
46
|
onMinHeight?: ((minSheetHeight: number) => any) | undefined;
|
|
46
47
|
onMaxHeight?: ((maxSheetHeight: number) => any) | undefined;
|
|
47
48
|
}>, {
|
|
49
|
+
duration: number;
|
|
48
50
|
blocking: boolean;
|
|
49
51
|
canSwipeClose: boolean;
|
|
50
52
|
canBackdropClose: boolean;
|
package/dist/index.mjs
CHANGED
|
@@ -1,69 +1,70 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { useWindowSize as
|
|
3
|
-
import { useGesture as
|
|
4
|
-
import { useMotionProperties as
|
|
5
|
-
import { useFocusTrap as
|
|
6
|
-
function
|
|
7
|
-
let
|
|
8
|
-
return a === void 0 ?
|
|
1
|
+
import { computed as y, defineComponent as de, useCssVars as ce, ref as p, toRefs as fe, watch as q, nextTick as F, onMounted as ge, openBlock as pe, createBlock as he, Teleport as me, createElementVNode as b, createVNode as be, Transition as ye, withCtx as we, withDirectives as Se, vShow as ke, renderSlot as R } from "vue";
|
|
2
|
+
import { useWindowSize as Te, useElementBounding as I, useScrollLock as J } from "@vueuse/core";
|
|
3
|
+
import { useGesture as z, rubberbandIfOutOfBounds as N } from "@vueuse/gesture";
|
|
4
|
+
import { useMotionProperties as Ce, useMotionTransitions as De, useMotionControls as xe } from "@vueuse/motion";
|
|
5
|
+
import { useFocusTrap as Me } from "@vueuse/integrations/useFocusTrap";
|
|
6
|
+
function _e(n, u, a) {
|
|
7
|
+
let e = (o) => n(o, ...u);
|
|
8
|
+
return a === void 0 ? e : Object.assign(e, { lazy: a, lazyArgs: u });
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
let
|
|
12
|
-
if (
|
|
13
|
-
if (
|
|
10
|
+
function Be(n, u, a) {
|
|
11
|
+
let e = n.length - u.length;
|
|
12
|
+
if (e === 0) return n(...u);
|
|
13
|
+
if (e === 1) return _e(n, u, a);
|
|
14
14
|
throw new Error("Wrong number of arguments");
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
let s, r, f,
|
|
16
|
+
function He(n, { triggerAt: u = "end", minQuietPeriodMs: a, maxBurstDurationMs: e, minGapMs: o, reducer: c = Oe }) {
|
|
17
|
+
let s, r, f, w, C = () => {
|
|
18
18
|
let v = f;
|
|
19
|
-
v !== void 0 && (f = void 0, n(v), o !== void 0 && (r = setTimeout(
|
|
20
|
-
},
|
|
21
|
-
clearTimeout(r), r = void 0, s === void 0 &&
|
|
22
|
-
},
|
|
23
|
-
clearTimeout(s), s = void 0,
|
|
19
|
+
v !== void 0 && (f = void 0, n(v), o !== void 0 && (r = setTimeout(O, o)));
|
|
20
|
+
}, O = () => {
|
|
21
|
+
clearTimeout(r), r = void 0, s === void 0 && C();
|
|
22
|
+
}, S = () => {
|
|
23
|
+
clearTimeout(s), s = void 0, w = void 0, r === void 0 && C();
|
|
24
24
|
};
|
|
25
25
|
return { call: (...v) => {
|
|
26
26
|
let g = s === void 0 && r === void 0;
|
|
27
27
|
if ((u !== "start" || g) && (f = c(f, ...v)), !(s === void 0 && !g)) {
|
|
28
|
-
if (a !== void 0 ||
|
|
28
|
+
if (a !== void 0 || e !== void 0 || o === void 0) {
|
|
29
29
|
clearTimeout(s);
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
let W =
|
|
33
|
-
s = setTimeout(
|
|
30
|
+
let h = Date.now();
|
|
31
|
+
w ?? (w = h);
|
|
32
|
+
let W = e === void 0 ? a ?? 0 : Math.min(a ?? e, e - (h - w));
|
|
33
|
+
s = setTimeout(S, W);
|
|
34
34
|
}
|
|
35
|
-
u !== "end" && g &&
|
|
35
|
+
u !== "end" && g && C();
|
|
36
36
|
}
|
|
37
37
|
}, cancel: () => {
|
|
38
|
-
clearTimeout(s), s = void 0,
|
|
38
|
+
clearTimeout(s), s = void 0, w = void 0, clearTimeout(r), r = void 0, f = void 0;
|
|
39
39
|
}, flush: () => {
|
|
40
|
-
|
|
40
|
+
S(), O();
|
|
41
41
|
}, get isIdle() {
|
|
42
42
|
return s === void 0 && r === void 0;
|
|
43
43
|
} };
|
|
44
44
|
}
|
|
45
|
-
var
|
|
45
|
+
var Oe = () => "";
|
|
46
46
|
function $(...n) {
|
|
47
|
-
return
|
|
47
|
+
return Be(Pe, n);
|
|
48
48
|
}
|
|
49
|
-
var
|
|
50
|
-
function
|
|
51
|
-
const a =
|
|
49
|
+
var Pe = (n, { min: u, max: a }) => u !== void 0 && n < u ? u : a !== void 0 && n > a ? a : n;
|
|
50
|
+
function Ee(n, u) {
|
|
51
|
+
const a = y(() => n.value.sort()), e = y(() => a.value[0]), o = y(() => a.value[a.value.length - 1]), c = y(() => {
|
|
52
52
|
const s = a.value.reduce(
|
|
53
53
|
(r, f) => Math.abs(f - u.value) < Math.abs(r - u.value) ? f : r
|
|
54
54
|
);
|
|
55
55
|
return a.value.indexOf(s);
|
|
56
56
|
});
|
|
57
57
|
return {
|
|
58
|
-
minSnap:
|
|
58
|
+
minSnap: e,
|
|
59
59
|
maxSnap: o,
|
|
60
60
|
snapPoints: n,
|
|
61
61
|
closestSnapPointIndex: c
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
const
|
|
64
|
+
const Ie = { "data-vsbs-container": "" }, $e = ["data-vsbs-shadow", "data-vsbs-sheet-show"], We = /* @__PURE__ */ de({
|
|
65
65
|
__name: "BottomSheet",
|
|
66
66
|
props: {
|
|
67
|
+
duration: { default: 250 },
|
|
67
68
|
snapPoints: {},
|
|
68
69
|
defaultBreakpoint: {},
|
|
69
70
|
blocking: { type: Boolean, default: !0 },
|
|
@@ -73,154 +74,167 @@ const He = { "data-vsbs-container": "" }, Pe = ["data-vsbs-shadow", "data-vsbs-s
|
|
|
73
74
|
},
|
|
74
75
|
emits: ["opened", "closed", "ready", "dragging-up", "dragging-down", "minHeight", "maxHeight"],
|
|
75
76
|
setup(n, { expose: u, emit: a }) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
ce((i) => ({
|
|
78
|
+
"702e831e": ae.value,
|
|
79
|
+
"2476b37f": ne.value
|
|
80
|
+
}));
|
|
81
|
+
const e = n, o = a, c = p(null), s = p(null), r = p(null), f = p(null), w = p(null), C = p(null), O = p(null), S = p(!1), v = p(e.expandOnContentDrag), { height: g } = Te(), { height: h } = I(c), { height: W } = I(s), { height: Z } = I(r), { height: Y } = I(C), { activate: ee, deactivate: te } = Me([c, O], { immediate: !1 }), k = y(
|
|
82
|
+
() => Math.ceil(Y.value + W.value + Z.value)
|
|
83
|
+
), ae = y(() => `visibility ${e.duration}ms ease-in-out`), ne = y(() => `opacity ${e.duration}ms ease-in-out`), { motionProperties: D } = Ce(c), { push: x, stop: oe, motionValues: M } = De(), { set: _, stop: L } = xe(
|
|
84
|
+
D,
|
|
80
85
|
{},
|
|
81
|
-
{ push:
|
|
82
|
-
),
|
|
83
|
-
minSnap:
|
|
84
|
-
maxSnap:
|
|
85
|
-
snapPoints:
|
|
86
|
-
closestSnapPointIndex:
|
|
87
|
-
} =
|
|
86
|
+
{ push: x, motionValues: M, stop: oe }
|
|
87
|
+
), t = p(0), l = p(0), { snapPoints: le } = fe(e), ue = y(() => le.value ?? [k.value]), {
|
|
88
|
+
minSnap: B,
|
|
89
|
+
maxSnap: H,
|
|
90
|
+
snapPoints: T,
|
|
91
|
+
closestSnapPointIndex: V
|
|
92
|
+
} = Ee(ue, t), G = J(document.body), Q = J(document.documentElement), j = (i) => {
|
|
88
93
|
i.key === "Escape" && E();
|
|
89
|
-
},
|
|
90
|
-
c.value && (
|
|
91
|
-
height:
|
|
92
|
-
y:
|
|
93
|
-
}),
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
}, ie = () => {
|
|
95
|
+
c.value && (t.value = Math.min(e.defaultBreakpoint ?? B.value, g.value), _({
|
|
96
|
+
height: t.value,
|
|
97
|
+
y: t.value
|
|
98
|
+
}), x("y", 0, D, {
|
|
99
|
+
type: "tween",
|
|
100
|
+
easings: "easeInOut",
|
|
101
|
+
bounce: 0,
|
|
102
|
+
duration: e.duration
|
|
103
|
+
}), S.value = !0, G.value = !0, Q.value = !0, window.addEventListener("keydown", j), e.blocking && setTimeout(() => {
|
|
104
|
+
M.value.y.get() - 0 < 0.1 && (o("opened"), ee());
|
|
105
|
+
}, e.duration));
|
|
96
106
|
}, E = () => {
|
|
97
|
-
c.value && (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
107
|
+
c.value && (x("y", h.value, D, {
|
|
108
|
+
type: "tween",
|
|
109
|
+
bounce: 0,
|
|
110
|
+
duration: e.duration
|
|
111
|
+
}), S.value = !1, G.value = !1, Q.value = !1, e.blocking && te(), window.removeEventListener("keydown", j), setTimeout(() => {
|
|
112
|
+
M.value.y.get() - h.value < 0.1 && o("closed");
|
|
113
|
+
}, e.duration));
|
|
114
|
+
}, se = () => {
|
|
115
|
+
e.canBackdropClose && E();
|
|
102
116
|
};
|
|
103
|
-
function
|
|
117
|
+
function re(i) {
|
|
104
118
|
v.value && i.preventDefault();
|
|
105
119
|
}
|
|
106
|
-
const
|
|
107
|
-
|
|
120
|
+
const X = (i) => {
|
|
121
|
+
t.value = i, x("height", t.value, D, {
|
|
108
122
|
type: "tween",
|
|
109
123
|
easings: "easeInOut",
|
|
110
124
|
bounce: 0,
|
|
111
|
-
duration:
|
|
125
|
+
duration: e.duration
|
|
112
126
|
});
|
|
113
|
-
},
|
|
127
|
+
}, K = ({
|
|
114
128
|
delta: [i, d],
|
|
115
|
-
direction: [
|
|
129
|
+
direction: [P, m]
|
|
116
130
|
}) => {
|
|
117
|
-
c.value && (l.value <= 0 && (
|
|
118
|
-
y:
|
|
119
|
-
})),
|
|
120
|
-
height: $(
|
|
131
|
+
c.value && (l.value <= 0 && (t.value -= d), t.value <= B.value && (t.value = B.value, l.value += d, _({
|
|
132
|
+
y: e.canSwipeClose ? $(l.value, { min: 0 }) : $(N(l.value, -h.value, 0, 0.5), { min: 0 })
|
|
133
|
+
})), _({
|
|
134
|
+
height: $(N(t.value, 0, H.value, 0.25), {
|
|
121
135
|
min: 0,
|
|
122
136
|
max: g.value
|
|
123
137
|
})
|
|
124
138
|
}), m > 0 ? o("dragging-down") : m < 0 && o("dragging-up"));
|
|
125
|
-
},
|
|
126
|
-
c.value && (l.value =
|
|
139
|
+
}, A = () => {
|
|
140
|
+
c.value && (l.value = e.canSwipeClose ? [0, t.value].reduce(
|
|
127
141
|
(i, d) => Math.abs(d - l.value) < Math.abs(i - l.value) ? d : i
|
|
128
|
-
) : 0,
|
|
142
|
+
) : 0, x("y", l.value, D, {
|
|
129
143
|
type: "tween",
|
|
130
144
|
easings: "easeInOut",
|
|
131
145
|
bounce: 0,
|
|
132
|
-
duration:
|
|
133
|
-
}), l.value ===
|
|
146
|
+
duration: e.duration
|
|
147
|
+
}), l.value === t.value && (l.value = 0, E()), t.value = Math.min(T.value[V.value], g.value), x("height", t.value, D, {
|
|
134
148
|
type: "tween",
|
|
135
149
|
easings: "easeInOut",
|
|
136
150
|
bounce: 0,
|
|
137
|
-
duration:
|
|
151
|
+
duration: e.duration
|
|
138
152
|
}));
|
|
139
153
|
};
|
|
140
|
-
|
|
154
|
+
z(
|
|
141
155
|
{
|
|
142
156
|
onDragStart: () => {
|
|
143
|
-
|
|
157
|
+
t.value = h.value, l.value = M.value.y.get(), L();
|
|
144
158
|
},
|
|
145
|
-
onDrag:
|
|
146
|
-
onDragEnd:
|
|
159
|
+
onDrag: K,
|
|
160
|
+
onDragEnd: A
|
|
147
161
|
},
|
|
148
162
|
{
|
|
149
163
|
domTarget: s,
|
|
150
164
|
drag: { filterTaps: !0 }
|
|
151
165
|
}
|
|
152
|
-
),
|
|
166
|
+
), z(
|
|
153
167
|
{
|
|
154
168
|
onDragStart: () => {
|
|
155
|
-
|
|
169
|
+
t.value = h.value, l.value = M.value.y.get(), L();
|
|
156
170
|
},
|
|
157
|
-
onDrag:
|
|
158
|
-
onDragEnd:
|
|
171
|
+
onDrag: K,
|
|
172
|
+
onDragEnd: A
|
|
159
173
|
},
|
|
160
174
|
{
|
|
161
175
|
domTarget: r,
|
|
162
176
|
drag: { filterTaps: !0 }
|
|
163
177
|
}
|
|
164
|
-
),
|
|
178
|
+
), z(
|
|
165
179
|
{
|
|
166
180
|
onDragStart: ({ direction: [i, d] }) => {
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
|
|
181
|
+
t.value = h.value, l.value = M.value.y.get(), L();
|
|
182
|
+
const P = f.value.scrollTop === 0, m = d > 0;
|
|
183
|
+
T.value.length === 1 ? l.value === 0 && P && (v.value = m) : (e.expandOnContentDrag && t.value !== H.value && (v.value = !0), t.value === H.value && P && (v.value = m));
|
|
170
184
|
},
|
|
171
|
-
onDrag: ({ delta: [i, d], direction: [
|
|
172
|
-
if (!
|
|
185
|
+
onDrag: ({ delta: [i, d], direction: [P, m] }) => {
|
|
186
|
+
if (!e.expandOnContentDrag) {
|
|
173
187
|
v.value = !1;
|
|
174
188
|
return;
|
|
175
189
|
}
|
|
176
190
|
if (!c.value) return;
|
|
177
|
-
l.value === 0 && v.value &&
|
|
178
|
-
y:
|
|
179
|
-
})),
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
height:
|
|
191
|
+
l.value === 0 && v.value && e.expandOnContentDrag && (t.value -= d), t.value <= B.value && (t.value = B.value, v.value && e.expandOnContentDrag && (l.value += d), l.value = $(l.value, { min: 0, max: B.value }), _({
|
|
192
|
+
y: e.canSwipeClose ? l.value : N(l.value, -h.value, 0, 0.5)
|
|
193
|
+
})), t.value > H.value && (t.value = H.value), t.value = Math.min(t.value, g.value);
|
|
194
|
+
const U = f.value.scrollTop === 0;
|
|
195
|
+
T.value.length === 1 ? d < 0 && l.value === 0 && U && (v.value = !1) : t.value === H.value && (v.value = !1), _({
|
|
196
|
+
height: t.value
|
|
183
197
|
}), m > 0 ? o("dragging-down") : m < 0 && o("dragging-up");
|
|
184
198
|
},
|
|
185
|
-
onDragEnd:
|
|
199
|
+
onDragEnd: A
|
|
186
200
|
},
|
|
187
201
|
{
|
|
188
|
-
domTarget:
|
|
202
|
+
domTarget: w,
|
|
189
203
|
drag: { filterTaps: !0 }
|
|
190
204
|
}
|
|
191
205
|
);
|
|
192
|
-
const
|
|
206
|
+
const ve = He(
|
|
193
207
|
() => {
|
|
194
|
-
o("maxHeight", g.value),
|
|
195
|
-
|
|
208
|
+
o("maxHeight", g.value), F(() => {
|
|
209
|
+
t.value = T.value[V.value], X(T.value[V.value]);
|
|
196
210
|
});
|
|
197
211
|
},
|
|
198
212
|
{ minQuietPeriodMs: 50 }
|
|
199
213
|
);
|
|
200
|
-
return
|
|
201
|
-
|
|
202
|
-
}),
|
|
203
|
-
o("minHeight",
|
|
204
|
-
|
|
214
|
+
return q(g, () => {
|
|
215
|
+
ve.call();
|
|
216
|
+
}), q(k, () => {
|
|
217
|
+
o("minHeight", k.value), T.value.length === 1 && F(() => {
|
|
218
|
+
T.value[0] === k.value && X(Math.min(k.value, g.value));
|
|
205
219
|
});
|
|
206
|
-
}),
|
|
207
|
-
o("minHeight",
|
|
208
|
-
height:
|
|
209
|
-
y:
|
|
210
|
-
}),
|
|
220
|
+
}), ge(() => {
|
|
221
|
+
o("minHeight", k.value), o("maxHeight", g.value), t.value = e.defaultBreakpoint ?? Number(k.value), _({
|
|
222
|
+
height: t.value,
|
|
223
|
+
y: t.value
|
|
224
|
+
}), F(() => {
|
|
211
225
|
o("ready");
|
|
212
226
|
});
|
|
213
|
-
}), u({ open:
|
|
214
|
-
b("div",
|
|
215
|
-
|
|
216
|
-
default:
|
|
217
|
-
|
|
227
|
+
}), u({ open: ie, close: E, snapToPoint: X }), (i, d) => (pe(), he(me, { to: "body" }, [
|
|
228
|
+
b("div", Ie, [
|
|
229
|
+
be(ye, { name: "fade" }, {
|
|
230
|
+
default: we(() => [
|
|
231
|
+
Se(b("div", {
|
|
218
232
|
ref_key: "backdrop",
|
|
219
|
-
ref:
|
|
233
|
+
ref: O,
|
|
220
234
|
"data-vsbs-backdrop": "",
|
|
221
|
-
onClick: d[0] || (d[0] = (
|
|
235
|
+
onClick: d[0] || (d[0] = (P) => se())
|
|
222
236
|
}, null, 512), [
|
|
223
|
-
[
|
|
237
|
+
[ke, S.value && i.blocking]
|
|
224
238
|
])
|
|
225
239
|
]),
|
|
226
240
|
_: 1
|
|
@@ -229,7 +243,7 @@ const He = { "data-vsbs-container": "" }, Pe = ["data-vsbs-shadow", "data-vsbs-s
|
|
|
229
243
|
ref_key: "sheet",
|
|
230
244
|
ref: c,
|
|
231
245
|
"data-vsbs-shadow": !i.blocking,
|
|
232
|
-
"data-vsbs-sheet-show":
|
|
246
|
+
"data-vsbs-sheet-show": S.value,
|
|
233
247
|
"aria-modal": "true",
|
|
234
248
|
"data-vsbs-sheet": "",
|
|
235
249
|
tabindex: "-1"
|
|
@@ -239,25 +253,25 @@ const He = { "data-vsbs-container": "" }, Pe = ["data-vsbs-shadow", "data-vsbs-s
|
|
|
239
253
|
ref: s,
|
|
240
254
|
"data-vsbs-header": ""
|
|
241
255
|
}, [
|
|
242
|
-
|
|
256
|
+
R(i.$slots, "header", {}, void 0, !0)
|
|
243
257
|
], 512),
|
|
244
258
|
b("div", {
|
|
245
259
|
ref_key: "sheetScroll",
|
|
246
260
|
ref: f,
|
|
247
261
|
"data-vsbs-scroll": "",
|
|
248
|
-
onTouchmove:
|
|
262
|
+
onTouchmove: re
|
|
249
263
|
}, [
|
|
250
264
|
b("div", {
|
|
251
265
|
ref_key: "sheetContentWrapper",
|
|
252
|
-
ref:
|
|
266
|
+
ref: w,
|
|
253
267
|
"data-vsbs-content-wrapper": ""
|
|
254
268
|
}, [
|
|
255
269
|
b("div", {
|
|
256
270
|
ref_key: "sheetContent",
|
|
257
|
-
ref:
|
|
271
|
+
ref: C,
|
|
258
272
|
"data-vsbs-content": ""
|
|
259
273
|
}, [
|
|
260
|
-
|
|
274
|
+
R(i.$slots, "default", {}, void 0, !0)
|
|
261
275
|
], 512)
|
|
262
276
|
], 512)
|
|
263
277
|
], 544),
|
|
@@ -266,18 +280,18 @@ const He = { "data-vsbs-container": "" }, Pe = ["data-vsbs-shadow", "data-vsbs-s
|
|
|
266
280
|
ref: r,
|
|
267
281
|
"data-vsbs-footer": ""
|
|
268
282
|
}, [
|
|
269
|
-
|
|
283
|
+
R(i.$slots, "footer", {}, void 0, !0)
|
|
270
284
|
], 512)
|
|
271
|
-
], 8,
|
|
285
|
+
], 8, $e)
|
|
272
286
|
])
|
|
273
287
|
]));
|
|
274
288
|
}
|
|
275
|
-
}),
|
|
289
|
+
}), Le = (n, u) => {
|
|
276
290
|
const a = n.__vccOpts || n;
|
|
277
|
-
for (const [
|
|
278
|
-
a[
|
|
291
|
+
for (const [e, o] of u)
|
|
292
|
+
a[e] = o;
|
|
279
293
|
return a;
|
|
280
|
-
},
|
|
294
|
+
}, ze = /* @__PURE__ */ Le(We, [["__scopeId", "data-v-37eb32bc"]]);
|
|
281
295
|
export {
|
|
282
|
-
|
|
296
|
+
ze as default
|
|
283
297
|
};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[data-vsbs-backdrop][data-v-
|
|
1
|
+
[data-vsbs-backdrop][data-v-37eb32bc]{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:100}[data-vsbs-shadow=true][data-v-37eb32bc]{box-shadow:0 -5px 60px 0 var(--vsbs-shadow-color, rgba(89, 89, 89, .2))}[data-vsbs-sheet][data-v-37eb32bc]{background-color:var(--vsbs-background, #fff);border-top-left-radius:var(--vsbs-border-radius, 16px);border-top-right-radius:var(--vsbs-border-radius, 16px);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;transition:var(--702e831e);visibility:hidden;width:100%;will-change:height;z-index:100}[data-vsbs-sheet-show=true][data-v-37eb32bc]{visibility:visible}[data-vsbs-header][data-v-37eb32bc]{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:1}[data-vsbs-header][data-v-37eb32bc]: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-37eb32bc]:empty{box-shadow:none;padding:12px var(--vsbs-padding-x, 16px) 8px}[data-vsbs-footer][data-v-37eb32bc]{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-37eb32bc]:empty{display:none}[data-vsbs-scroll][data-v-37eb32bc]{flex-grow:1;overflow-y:auto;overscroll-behavior:contain}[data-vsbs-content-wrapper][data-v-37eb32bc]{height:100%}[data-vsbs-content][data-v-37eb32bc]{display:grid;padding:1vh var(--vsbs-padding-x, 16px);-webkit-user-select:none;user-select:none}.fade-enter-active[data-v-37eb32bc],.fade-leave-active[data-v-37eb32bc]{transition:var(--2476b37f)}.fade-enter-from[data-v-37eb32bc],.fade-leave-to[data-v-37eb32bc]{opacity:0}
|
package/package.json
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"url": "https://github.com/megaarmos/vue-spring-bottom-sheet/issues"
|
|
33
33
|
},
|
|
34
34
|
"private": false,
|
|
35
|
-
"version": "1.
|
|
35
|
+
"version": "1.2.0",
|
|
36
36
|
"type": "module",
|
|
37
37
|
"exports": {
|
|
38
38
|
".": {
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"release": "npm run build && npm publish --access public"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"vue": ">=3.3",
|
|
59
58
|
"@vueuse/gesture": "^2.0.0",
|
|
60
|
-
"@vueuse/motion": "^2.2.6"
|
|
59
|
+
"@vueuse/motion": "^2.2.6",
|
|
60
|
+
"vue": ">=3.3"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@vueuse/core": "^12.0.0",
|
|
@@ -66,17 +66,17 @@
|
|
|
66
66
|
"@vueuse/motion": "^2.2.6",
|
|
67
67
|
"focus-trap": "^7",
|
|
68
68
|
"remeda": "^2.19.0",
|
|
69
|
-
"vue": "
|
|
69
|
+
"vue": ">=3.3"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"
|
|
72
|
+
"@types/node": "^22.10.2",
|
|
73
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
73
74
|
"@vue/eslint-config-prettier": "^10.1.0",
|
|
74
75
|
"@vue/eslint-config-typescript": "^14.2.0",
|
|
76
|
+
"@vue/tsconfig": "^0.7.0",
|
|
77
|
+
"ajv": "^8.17.1",
|
|
75
78
|
"eslint": "^9.17.0",
|
|
76
79
|
"eslint-plugin-vue": "^9.32.0",
|
|
77
|
-
"@types/node": "^22.10.2",
|
|
78
|
-
"@vitejs/plugin-vue": "^5.2.1",
|
|
79
|
-
"@vue/tsconfig": "^0.7.0",
|
|
80
80
|
"prettier": "^3.4.2",
|
|
81
81
|
"typescript": "~5.6.2",
|
|
82
82
|
"vite": "^6.0.1",
|