@plainsheet/react 0.4.0 → 0.4.4
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 +1 -1
- package/dist/BottomSheet.d.ts +6 -5
- package/dist/hooks/useBottomSheet.d.ts +10 -3
- package/dist/plainsheet-react.cjs.js +1 -1
- package/dist/plainsheet-react.es.js +537 -480
- package/dist/plainsheet-react.umd.js +1 -1
- package/package.json +5 -5
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { forwardRef as
|
|
2
|
-
import { createPortal as
|
|
3
|
-
function
|
|
1
|
+
import { forwardRef as Dt, useRef as ot, useState as rt, useImperativeHandle as Bt, useCallback as Mt, useEffect as _, useMemo as Pt } from "react";
|
|
2
|
+
import { createPortal as Yt } from "react-dom";
|
|
3
|
+
function It(t) {
|
|
4
4
|
return t != null;
|
|
5
5
|
}
|
|
6
6
|
(function() {
|
|
7
7
|
try {
|
|
8
8
|
if (typeof document < "u") {
|
|
9
9
|
var t = document.createElement("style");
|
|
10
|
-
t.appendChild(document.createTextNode('.pbs-root{position:fixed;left:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;width:100%;height:fit-content;max-height:100vh;z-index:2}.pbs-dialog-reset{background-color:transparent;color:inherit;border:none;outline:none;padding:0;margin:0}.pbs-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;
|
|
10
|
+
t.appendChild(document.createTextNode('.pbs-root{position:fixed;left:0;bottom:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;width:100%;height:fit-content;max-height:100vh;z-index:2}.pbs-dialog-reset{background-color:transparent;color:inherit;border:none;outline:none;padding:0;margin:0}.pbs-backdrop{position:fixed;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1;transition:background-color .2s ease-out}.pbs-backdrop.hidden{visibility:hidden}.pbs-backdrop.open{background-color:#454545b3}.pbs-backdrop.transparent{background-color:transparent}.pbs-container{--pbs-container-background-color: rgb(240, 240, 240);background-color:var(--pbs-container-background-color);position:relative;display:none;flex-direction:column;align-items:center;justify-content:flex-start;width:92%;height:fit-content;max-height:100vh;border-radius:10px 10px 0 0}.pbs-container.open{display:flex}.pbs-container .pbs-gap-filler{position:absolute;bottom:calc(-100vh + .5px);left:0;background-color:var(--pbs-container-background-color);content:"";width:100%;height:100vh}.pbs-handle{position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:30px;cursor:pointer}.pbs-handle.hidden{display:none}.pbs-button-reset{background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;border:none}button:focus.pbs-button-reset{outline:none}.pbs-handle-bar{background-color:#a8a8a8;position:relative;width:12%;height:7px;border-radius:12px}.pbs-handle-bar.hidden{display:none}.pbs-content-wrapper{position:relative;width:100%;height:fit-content;max-height:100%;overflow-y:scroll}.pbs-content-wrapper::-webkit-scrollbar{display:none}.example{-ms-overflow-style:none;scrollbar-width:none}')), document.head.appendChild(t);
|
|
11
11
|
}
|
|
12
12
|
} catch (e) {
|
|
13
13
|
console.error("vite-plugin-css-injected-by-js", e);
|
|
14
14
|
}
|
|
15
15
|
})();
|
|
16
|
-
var
|
|
17
|
-
function
|
|
16
|
+
var Rt = Object.defineProperty, Nt = (t, e, n) => e in t ? Rt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, V = (t, e, n) => Nt(t, typeof e != "symbol" ? e + "" : e, n);
|
|
17
|
+
function L(t) {
|
|
18
18
|
return typeof t == "string";
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
return t.classList.contains(
|
|
20
|
+
function Ft(t, e) {
|
|
21
|
+
return t.classList.contains(et(e));
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
t.classList.add(
|
|
23
|
+
function X(t, e) {
|
|
24
|
+
t.classList.add(et(e));
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
t.classList.remove(
|
|
26
|
+
function it(t, e) {
|
|
27
|
+
t.classList.remove(et(e));
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
|
|
29
|
+
function $(t, e, n) {
|
|
30
|
+
L(n) && (L(e) && it(t, e), X(t, n));
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
32
|
+
function et(t) {
|
|
33
|
+
return L(t) ? t.trim().replace(/\./g, "") : "";
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
return t.map((e) =>
|
|
35
|
+
function R(t) {
|
|
36
|
+
return t.map((e) => et(e)).filter(Boolean).join(" ");
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function Wt(t) {
|
|
39
39
|
return t.map((e) => e == null ? void 0 : e.trim()).filter(Boolean).map((e) => `.${e}`).join(" ");
|
|
40
40
|
}
|
|
41
|
-
const dt = "open",
|
|
42
|
-
function
|
|
41
|
+
const dt = "open", ht = "hidden";
|
|
42
|
+
function nt(t, e) {
|
|
43
43
|
const n = e;
|
|
44
44
|
if (Array.isArray(t)) {
|
|
45
45
|
t.forEach((o) => {
|
|
46
|
-
|
|
46
|
+
J(o, n), o.setAttribute("aria-modal", n ? "true" : "false");
|
|
47
47
|
});
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
J(t, n), t.setAttribute("aria-modal", n ? "true" : "false");
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
e ? (
|
|
52
|
+
function J(t, e) {
|
|
53
|
+
e ? (X(t, dt), it(t, ht)) : (X(t, ht), it(t, dt));
|
|
54
54
|
}
|
|
55
55
|
function Ct(t) {
|
|
56
56
|
return t instanceof HTMLElement;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function O(t) {
|
|
59
59
|
return typeof t == "number" && !Number.isNaN(t);
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Ut(t) {
|
|
62
62
|
Ct(t) && t.focus();
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function jt(t) {
|
|
65
65
|
if (!Ct(t) || t.offsetParent === null || "disabled" in t && t.disabled)
|
|
66
66
|
return !1;
|
|
67
|
-
const e = t.getAttribute("tabindex"), n =
|
|
67
|
+
const e = t.getAttribute("tabindex"), n = O(e) ? parseInt(e, 10) : -1, o = [
|
|
68
68
|
"INPUT",
|
|
69
69
|
"BUTTON",
|
|
70
70
|
"SELECT",
|
|
@@ -75,21 +75,21 @@ function Ut(t) {
|
|
|
75
75
|
].includes(t.tagName), i = t instanceof HTMLAnchorElement && t.href !== "" || t instanceof HTMLAreaElement && t.href !== "";
|
|
76
76
|
return o || i || n > -1;
|
|
77
77
|
}
|
|
78
|
-
var w = /* @__PURE__ */ ((t) => (t.Backdrop = "pbs-backdrop", t.Root = "pbs-root", t.Container = "pbs-container", t.GapFiller = "pbs-gap-filler", t.Handle = "pbs-handle", t.HandleBar = "pbs-handle-bar", t.ContentWrapper = "pbs-content-wrapper", t))(w || {}),
|
|
79
|
-
function
|
|
78
|
+
var w = /* @__PURE__ */ ((t) => (t.Backdrop = "pbs-backdrop", t.Root = "pbs-root", t.Container = "pbs-container", t.GapFiller = "pbs-gap-filler", t.Handle = "pbs-handle", t.HandleBar = "pbs-handle-bar", t.ContentWrapper = "pbs-content-wrapper", t))(w || {}), at = /* @__PURE__ */ ((t) => (t.Button = "pbs-button-reset", t.Dialog = "pbs-dialog-reset", t))(at || {}), K = /* @__PURE__ */ ((t) => (t.Hidden = "hidden", t))(K || {});
|
|
79
|
+
function M(t, e, n) {
|
|
80
80
|
const o = document.createElement(t);
|
|
81
81
|
return e.split(" ").forEach((i) => {
|
|
82
|
-
|
|
83
|
-
}),
|
|
82
|
+
X(o, i);
|
|
83
|
+
}), L(n) && o.setAttribute("data-testid", n), o;
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
Wt([
|
|
86
86
|
w.Root,
|
|
87
87
|
w.ContentWrapper
|
|
88
88
|
]);
|
|
89
|
-
function
|
|
89
|
+
function pt(t, e, n, o) {
|
|
90
90
|
switch (o) {
|
|
91
91
|
case "content-height":
|
|
92
|
-
return e >= t ?
|
|
92
|
+
return e >= t ? wt(t, e, n) : 0;
|
|
93
93
|
case "middle":
|
|
94
94
|
return -(t / 2 - e);
|
|
95
95
|
case "top":
|
|
@@ -98,7 +98,7 @@ function ht(t, e, n, o) {
|
|
|
98
98
|
return 0;
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function yt(t, e) {
|
|
102
102
|
const n = e < t, o = e > t;
|
|
103
103
|
return {
|
|
104
104
|
isUp: n,
|
|
@@ -106,13 +106,13 @@ function wt(t, e) {
|
|
|
106
106
|
stayedSame: e === t
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function Et(t, e) {
|
|
110
110
|
return e < t ? -(t - e) : e - t;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function Q(t, e) {
|
|
113
113
|
return t > e ? t - e : e - t;
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function $t(t, e) {
|
|
116
116
|
const n = t < e, o = t > e;
|
|
117
117
|
return {
|
|
118
118
|
isUp: n,
|
|
@@ -127,20 +127,20 @@ function mt(t, e, n) {
|
|
|
127
127
|
return o ? e.visibleHeight < r : e.visibleHeight > r;
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function wt(t, e, n) {
|
|
131
131
|
return -(t - e) + n;
|
|
132
132
|
}
|
|
133
133
|
function ft(t) {
|
|
134
134
|
return Number(t.replace("px", ""));
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function Z(t, ...e) {
|
|
137
137
|
return Number(t.toFixed(...e));
|
|
138
138
|
}
|
|
139
139
|
function Tt(t) {
|
|
140
140
|
const e = /(?<type>\w+)\((?<values>[^)]+)\)/g, n = [];
|
|
141
141
|
let o;
|
|
142
142
|
for (; (o = e.exec(t)) !== null; ) {
|
|
143
|
-
const i = o[1], r = o[2].split(",").map((
|
|
143
|
+
const i = o[1], r = o[2].split(",").map((s) => s.trim());
|
|
144
144
|
n.push({ type: i, values: r });
|
|
145
145
|
}
|
|
146
146
|
return n;
|
|
@@ -154,28 +154,28 @@ function Ht(t, e) {
|
|
|
154
154
|
(o) => o.type.startsWith(e)
|
|
155
155
|
) || null;
|
|
156
156
|
}
|
|
157
|
-
const
|
|
158
|
-
function
|
|
157
|
+
const st = "translate";
|
|
158
|
+
function B(t) {
|
|
159
159
|
const e = t.style.transform, n = Tt(e), o = Ht(
|
|
160
160
|
n,
|
|
161
|
-
|
|
161
|
+
st
|
|
162
162
|
);
|
|
163
163
|
return kt(o ?? {
|
|
164
|
-
type:
|
|
164
|
+
type: st,
|
|
165
165
|
values: []
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function tt(t, { x: e, y: n }) {
|
|
169
169
|
const {
|
|
170
170
|
transform: o,
|
|
171
171
|
transformValues: i
|
|
172
172
|
} = Gt(t), r = Ht(
|
|
173
173
|
i,
|
|
174
|
-
|
|
174
|
+
st
|
|
175
175
|
);
|
|
176
176
|
if (r) {
|
|
177
|
-
const
|
|
178
|
-
t.style.transform = `translate(${e ??
|
|
177
|
+
const s = kt(r);
|
|
178
|
+
t.style.transform = `translate(${e ?? s.x ?? 0}px,${n ?? s.y ?? 0}px)`;
|
|
179
179
|
return;
|
|
180
180
|
}
|
|
181
181
|
if (o) {
|
|
@@ -195,20 +195,20 @@ function kt(t) {
|
|
|
195
195
|
y: ft(n) ?? 0
|
|
196
196
|
};
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function ct(t) {
|
|
199
199
|
return t != null;
|
|
200
200
|
}
|
|
201
201
|
function gt(t, {
|
|
202
202
|
min: e,
|
|
203
203
|
max: n
|
|
204
204
|
}) {
|
|
205
|
-
return
|
|
205
|
+
return ct(n) && t >= n ? n : ct(e) && t <= e ? e : t;
|
|
206
206
|
}
|
|
207
207
|
const _t = (t, e, n) => {
|
|
208
|
-
e instanceof HTMLElement && !
|
|
209
|
-
},
|
|
210
|
-
o.startY = t.getCoordinates(i).y, o.containerStartTranslate =
|
|
211
|
-
},
|
|
208
|
+
e instanceof HTMLElement && !Ft(e, w.Handle) && n.scrollTop >= 1 || (t.isDragging = !0);
|
|
209
|
+
}, Xt = (t, e, n, o) => (i) => {
|
|
210
|
+
o.startY = t.getCoordinates(i).y, o.containerStartTranslate = B(e), n.onDragStart();
|
|
211
|
+
}, zt = (t, e, n, o, i) => (r) => {
|
|
212
212
|
qt(
|
|
213
213
|
r,
|
|
214
214
|
t,
|
|
@@ -219,34 +219,34 @@ const _t = (t, e, n) => {
|
|
|
219
219
|
n.marginTop
|
|
220
220
|
);
|
|
221
221
|
};
|
|
222
|
-
function qt(t, e, n, o, i, r,
|
|
223
|
-
if (!o.isDragging || !
|
|
222
|
+
function qt(t, e, n, o, i, r, s) {
|
|
223
|
+
if (!o.isDragging || !O(o.startY))
|
|
224
224
|
return;
|
|
225
|
-
const
|
|
226
|
-
if (
|
|
225
|
+
const a = e.getCoordinates(t).y, d = Et(o.startY, a), p = window.innerHeight, c = r.clientHeight, m = c - (o.containerStartTranslate.y + d);
|
|
226
|
+
if (m >= p)
|
|
227
227
|
return;
|
|
228
|
-
const
|
|
229
|
-
if (
|
|
228
|
+
const C = yt(o.startY, a);
|
|
229
|
+
if (C.isUp && !n.expandable && m >= c)
|
|
230
230
|
return;
|
|
231
231
|
i.start(() => {
|
|
232
|
-
|
|
233
|
-
y: o.containerStartTranslate.y +
|
|
232
|
+
tt(r, {
|
|
233
|
+
y: o.containerStartTranslate.y + d
|
|
234
234
|
});
|
|
235
235
|
}, 0);
|
|
236
|
-
const
|
|
237
|
-
if (
|
|
238
|
-
const v =
|
|
239
|
-
1 -
|
|
236
|
+
const l = p - s, y = c - o.containerStartTranslate.y;
|
|
237
|
+
if (C.isUp) {
|
|
238
|
+
const v = l - y, S = l - m, E = gt(
|
|
239
|
+
1 - Z(S / v, 2),
|
|
240
240
|
{
|
|
241
241
|
min: 0,
|
|
242
242
|
max: 1
|
|
243
243
|
}
|
|
244
244
|
);
|
|
245
|
-
n.onDragMove(
|
|
246
|
-
} else if (
|
|
245
|
+
n.onDragMove(C, E);
|
|
246
|
+
} else if (C.isDown) {
|
|
247
247
|
const v = gt(
|
|
248
|
-
|
|
249
|
-
1 -
|
|
248
|
+
Z(
|
|
249
|
+
1 - m / y,
|
|
250
250
|
2
|
|
251
251
|
),
|
|
252
252
|
{
|
|
@@ -254,61 +254,61 @@ function qt(t, e, n, o, i, r, c) {
|
|
|
254
254
|
max: 1
|
|
255
255
|
}
|
|
256
256
|
);
|
|
257
|
-
n.onDragMove(
|
|
257
|
+
n.onDragMove(C, v);
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
const
|
|
261
|
-
if (!o.isDragging || (o.isDragging = !1, !
|
|
260
|
+
const Vt = (t, e, n, o, i, r, s) => (a) => {
|
|
261
|
+
if (!o.isDragging || (o.isDragging = !1, !O(o.startY)))
|
|
262
262
|
return;
|
|
263
263
|
n.onDragEnd();
|
|
264
|
-
const
|
|
265
|
-
if (
|
|
266
|
-
const
|
|
267
|
-
(
|
|
268
|
-
), v =
|
|
269
|
-
if (!n.expandable && v >=
|
|
264
|
+
const d = o.startY, p = t.getCoordinates(a).y, c = B(e).y, m = yt(d, p), C = window.innerHeight, l = e.clientHeight;
|
|
265
|
+
if (m.isUp) {
|
|
266
|
+
const y = [...n.snapPoints].sort(
|
|
267
|
+
(E, k) => E - k
|
|
268
|
+
), v = l + -c;
|
|
269
|
+
if (!n.expandable && v >= l)
|
|
270
270
|
return;
|
|
271
|
-
for (const
|
|
272
|
-
const
|
|
273
|
-
if (v <=
|
|
274
|
-
const
|
|
271
|
+
for (const E of y) {
|
|
272
|
+
const k = E * window.innerHeight;
|
|
273
|
+
if (v <= k) {
|
|
274
|
+
const T = Q(
|
|
275
275
|
v,
|
|
276
|
-
|
|
276
|
+
k
|
|
277
277
|
);
|
|
278
|
-
|
|
279
|
-
startY:
|
|
280
|
-
endY:
|
|
278
|
+
s.translateContainer({
|
|
279
|
+
startY: c,
|
|
280
|
+
endY: c - T,
|
|
281
281
|
animationFrame: i,
|
|
282
282
|
bottomSheetContainer: e
|
|
283
283
|
});
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
const S =
|
|
288
|
-
|
|
289
|
-
|
|
287
|
+
const S = wt(
|
|
288
|
+
C,
|
|
289
|
+
l,
|
|
290
290
|
n.marginTop
|
|
291
291
|
);
|
|
292
|
-
|
|
293
|
-
startY:
|
|
292
|
+
s.translateContainer({
|
|
293
|
+
startY: c,
|
|
294
294
|
endY: S,
|
|
295
295
|
animationFrame: i,
|
|
296
296
|
bottomSheetContainer: e
|
|
297
297
|
});
|
|
298
|
-
} else if (
|
|
299
|
-
const
|
|
298
|
+
} else if (m.isDown) {
|
|
299
|
+
const y = [...n.snapPoints].sort(
|
|
300
300
|
(v, S) => S - v
|
|
301
301
|
);
|
|
302
|
-
for (const v of
|
|
303
|
-
const S = v * window.innerHeight,
|
|
304
|
-
if (
|
|
305
|
-
const
|
|
306
|
-
|
|
302
|
+
for (const v of y) {
|
|
303
|
+
const S = v * window.innerHeight, E = l + -c;
|
|
304
|
+
if (E >= S) {
|
|
305
|
+
const k = Q(
|
|
306
|
+
E,
|
|
307
307
|
S
|
|
308
308
|
);
|
|
309
|
-
|
|
310
|
-
startY:
|
|
311
|
-
endY:
|
|
309
|
+
s.translateContainer({
|
|
310
|
+
startY: c,
|
|
311
|
+
endY: c + k,
|
|
312
312
|
animationFrame: i,
|
|
313
313
|
bottomSheetContainer: e
|
|
314
314
|
});
|
|
@@ -318,7 +318,7 @@ const zt = (t, e, n, o, i, r, c) => (s) => {
|
|
|
318
318
|
r();
|
|
319
319
|
}
|
|
320
320
|
};
|
|
321
|
-
var
|
|
321
|
+
var W = /* @__PURE__ */ ((t) => (t[t.All = -1] = "All", t[t.None = 0] = "None", t[t.Capture = 1] = "Capture", t[t.Target = 2] = "Target", t[t.Bubble = 3] = "Bubble", t))(W || {});
|
|
322
322
|
function bt(t) {
|
|
323
323
|
switch (t) {
|
|
324
324
|
case 0:
|
|
@@ -333,16 +333,16 @@ function bt(t) {
|
|
|
333
333
|
return -1;
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
|
-
const
|
|
337
|
-
eventPhase:
|
|
336
|
+
const Kt = {
|
|
337
|
+
eventPhase: W.All
|
|
338
338
|
};
|
|
339
|
-
class
|
|
339
|
+
class G {
|
|
340
340
|
constructor(e) {
|
|
341
|
-
|
|
341
|
+
V(this, "currentTarget"), this.currentTarget = e;
|
|
342
342
|
}
|
|
343
343
|
addEventListeners({
|
|
344
344
|
onStart: e,
|
|
345
|
-
onStartOptions: n =
|
|
345
|
+
onStartOptions: n = Kt,
|
|
346
346
|
onMove: o,
|
|
347
347
|
onEnd: i
|
|
348
348
|
}) {
|
|
@@ -357,7 +357,7 @@ class j {
|
|
|
357
357
|
e && this.currentTarget.addEventListener(
|
|
358
358
|
"touchstart",
|
|
359
359
|
(r) => {
|
|
360
|
-
if (n.eventPhase ===
|
|
360
|
+
if (n.eventPhase === W.All) {
|
|
361
361
|
e(r);
|
|
362
362
|
return;
|
|
363
363
|
}
|
|
@@ -377,7 +377,7 @@ class j {
|
|
|
377
377
|
e && this.currentTarget.addEventListener(
|
|
378
378
|
"mousedown",
|
|
379
379
|
(r) => {
|
|
380
|
-
if (n.eventPhase ===
|
|
380
|
+
if (n.eventPhase === W.All) {
|
|
381
381
|
e(r);
|
|
382
382
|
return;
|
|
383
383
|
}
|
|
@@ -428,86 +428,92 @@ class j {
|
|
|
428
428
|
};
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
|
-
function
|
|
432
|
-
const
|
|
433
|
-
|
|
431
|
+
function Lt(t) {
|
|
432
|
+
const e = t;
|
|
433
|
+
return `${e} ${e} 0px 0px`;
|
|
434
|
+
}
|
|
435
|
+
function Jt(t, e) {
|
|
436
|
+
const n = Qt(t);
|
|
437
|
+
Zt(n), n.bottomSheetContainer.style.width = t.width;
|
|
434
438
|
const o = document.createElement("div");
|
|
435
439
|
o.innerHTML = t.content ?? "";
|
|
436
440
|
const i = window.innerHeight;
|
|
437
441
|
n.bottomSheetContainer.style.maxHeight = `${i}px`, n.bottomSheetContentWrapper.appendChild(o);
|
|
438
|
-
const r =
|
|
442
|
+
const r = te({
|
|
439
443
|
bottomSheetElements: n,
|
|
440
444
|
bottomSheetProps: t,
|
|
441
445
|
options: e
|
|
442
446
|
});
|
|
443
447
|
return { elements: n, eventHandlers: r };
|
|
444
448
|
}
|
|
445
|
-
function
|
|
446
|
-
const e =
|
|
449
|
+
function Qt(t) {
|
|
450
|
+
const e = M(
|
|
447
451
|
"dialog",
|
|
448
|
-
|
|
452
|
+
R([
|
|
449
453
|
w.Root,
|
|
450
|
-
|
|
454
|
+
at.Dialog,
|
|
451
455
|
t.rootClass
|
|
452
456
|
]),
|
|
453
457
|
w.Root
|
|
454
458
|
);
|
|
455
459
|
e.ariaLabel = t.ariaLabel;
|
|
456
|
-
const n =
|
|
460
|
+
const n = M(
|
|
457
461
|
"section",
|
|
458
|
-
|
|
462
|
+
R([w.Container, t.containerClass]),
|
|
459
463
|
w.Container
|
|
460
464
|
);
|
|
461
|
-
t.containerBorderRadius && (n.style.borderRadius =
|
|
462
|
-
|
|
465
|
+
t.containerBorderRadius && (n.style.borderRadius = Lt(
|
|
466
|
+
t.containerBorderRadius
|
|
467
|
+
));
|
|
468
|
+
const o = M(
|
|
463
469
|
"div",
|
|
464
470
|
w.GapFiller,
|
|
465
471
|
w.GapFiller
|
|
466
|
-
), i =
|
|
472
|
+
), i = M(
|
|
467
473
|
"button",
|
|
468
|
-
|
|
474
|
+
R([
|
|
469
475
|
w.Handle,
|
|
470
|
-
|
|
471
|
-
t.shouldShowHandle ? null :
|
|
476
|
+
at.Button,
|
|
477
|
+
t.shouldShowHandle ? null : K.Hidden,
|
|
472
478
|
t.handleClass
|
|
473
479
|
]),
|
|
474
480
|
w.Handle
|
|
475
481
|
);
|
|
476
482
|
i.setAttribute("type", "button"), i.ariaLabel = "bottom sheet close button";
|
|
477
|
-
const r =
|
|
483
|
+
const r = M(
|
|
478
484
|
"span",
|
|
479
|
-
|
|
485
|
+
R([
|
|
480
486
|
w.HandleBar,
|
|
481
|
-
t.shouldShowHandle ? null :
|
|
487
|
+
t.shouldShowHandle ? null : K.Hidden
|
|
482
488
|
]),
|
|
483
489
|
w.HandleBar
|
|
484
|
-
),
|
|
490
|
+
), s = M(
|
|
485
491
|
"article",
|
|
486
|
-
|
|
492
|
+
R([
|
|
487
493
|
w.ContentWrapper,
|
|
488
494
|
t.contentWrapperClass
|
|
489
495
|
]),
|
|
490
496
|
w.ContentWrapper
|
|
491
|
-
),
|
|
497
|
+
), a = M(
|
|
492
498
|
"div",
|
|
493
|
-
|
|
499
|
+
R([
|
|
494
500
|
w.Backdrop,
|
|
495
501
|
t.backdropClass,
|
|
496
|
-
|
|
502
|
+
K.Hidden
|
|
497
503
|
]),
|
|
498
504
|
w.Backdrop
|
|
499
505
|
);
|
|
500
|
-
return t.backdropColor && (
|
|
506
|
+
return t.backdropColor && (a.style.backgroundColor = t.backdropColor), t.backDropTransition && (a.style.transition = t.backDropTransition), {
|
|
501
507
|
bottomSheetRoot: e,
|
|
502
|
-
bottomSheetBackdrop:
|
|
508
|
+
bottomSheetBackdrop: a,
|
|
503
509
|
bottomSheetContainer: n,
|
|
504
510
|
bottomSheetHandle: i,
|
|
505
511
|
bottomSheetHandleBar: r,
|
|
506
|
-
bottomSheetContentWrapper:
|
|
512
|
+
bottomSheetContentWrapper: s,
|
|
507
513
|
bottomSheetContainerGapFiller: o
|
|
508
514
|
};
|
|
509
515
|
}
|
|
510
|
-
function
|
|
516
|
+
function Zt({
|
|
511
517
|
bottomSheetRoot: t,
|
|
512
518
|
bottomSheetContainer: e,
|
|
513
519
|
bottomSheetHandle: n,
|
|
@@ -517,7 +523,7 @@ function Qt({
|
|
|
517
523
|
}) {
|
|
518
524
|
t.appendChild(e), n.appendChild(o), e.appendChild(n), e.appendChild(i), e.appendChild(r);
|
|
519
525
|
}
|
|
520
|
-
function
|
|
526
|
+
function te({
|
|
521
527
|
bottomSheetElements: t,
|
|
522
528
|
bottomSheetProps: e,
|
|
523
529
|
options: n
|
|
@@ -526,36 +532,37 @@ function Zt({
|
|
|
526
532
|
bottomSheetRoot: o,
|
|
527
533
|
bottomSheetContainer: i,
|
|
528
534
|
bottomSheetHandle: r,
|
|
529
|
-
bottomSheetContainerGapFiller:
|
|
530
|
-
bottomSheetContentWrapper:
|
|
531
|
-
|
|
535
|
+
bottomSheetContainerGapFiller: s,
|
|
536
|
+
bottomSheetContentWrapper: a,
|
|
537
|
+
bottomSheetBackdrop: d
|
|
538
|
+
} = t, { animationFrame: p } = n, c = new G(r), m = new G(
|
|
539
|
+
a
|
|
540
|
+
), C = new G(
|
|
532
541
|
s
|
|
533
|
-
),
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
const tt = Array.from(O).map((M) => M instanceof HTMLElement ? new j(M) : null).filter((M) => !!M);
|
|
541
|
-
return [...g, ...tt];
|
|
542
|
+
), l = e.dragTriggers.reduce(
|
|
543
|
+
(b, A) => {
|
|
544
|
+
const D = o.querySelectorAll(A);
|
|
545
|
+
if (!D.length)
|
|
546
|
+
return b;
|
|
547
|
+
const h = Array.from(D).map((u) => u instanceof HTMLElement ? new G(u) : null).filter((u) => !!u);
|
|
548
|
+
return [...b, ...h];
|
|
542
549
|
},
|
|
543
550
|
[]
|
|
544
|
-
),
|
|
551
|
+
), y = new G(
|
|
545
552
|
window
|
|
546
|
-
),
|
|
547
|
-
|
|
553
|
+
), v = Xt(
|
|
554
|
+
y,
|
|
548
555
|
i,
|
|
549
556
|
e,
|
|
550
557
|
n.draggingState
|
|
551
|
-
),
|
|
552
|
-
|
|
558
|
+
), S = zt(
|
|
559
|
+
y,
|
|
553
560
|
i,
|
|
554
561
|
e,
|
|
555
562
|
n.draggingState,
|
|
556
563
|
p
|
|
557
|
-
),
|
|
558
|
-
|
|
564
|
+
), E = Vt(
|
|
565
|
+
y,
|
|
559
566
|
i,
|
|
560
567
|
e,
|
|
561
568
|
n.draggingState,
|
|
@@ -563,94 +570,102 @@ function Zt({
|
|
|
563
570
|
n.onClose,
|
|
564
571
|
n.bottomSheetState
|
|
565
572
|
);
|
|
566
|
-
function
|
|
567
|
-
|
|
573
|
+
function k(b) {
|
|
574
|
+
b.target instanceof Element && !o.contains(b.target) && n.onClose();
|
|
568
575
|
}
|
|
569
|
-
function
|
|
576
|
+
function T(b) {
|
|
570
577
|
_t(
|
|
571
578
|
n.draggingState,
|
|
572
|
-
|
|
579
|
+
b.target,
|
|
573
580
|
t.bottomSheetContentWrapper
|
|
574
581
|
);
|
|
575
582
|
}
|
|
576
|
-
function
|
|
577
|
-
e.draggable && (
|
|
578
|
-
onStart:
|
|
579
|
-
}),
|
|
580
|
-
|
|
581
|
-
onStart:
|
|
583
|
+
function P() {
|
|
584
|
+
e.draggable && (c.addEventListeners({
|
|
585
|
+
onStart: T
|
|
586
|
+
}), l.forEach((b) => {
|
|
587
|
+
b.addEventListeners({
|
|
588
|
+
onStart: T,
|
|
582
589
|
onStartOptions: {
|
|
583
|
-
eventPhase:
|
|
590
|
+
eventPhase: W.Target
|
|
584
591
|
}
|
|
585
592
|
});
|
|
586
|
-
})), e.draggable && e.backgroundDraggable && (
|
|
587
|
-
onStart:
|
|
593
|
+
})), e.draggable && e.backgroundDraggable && (m.addEventListeners({
|
|
594
|
+
onStart: T,
|
|
588
595
|
onStartOptions: {
|
|
589
|
-
eventPhase:
|
|
596
|
+
eventPhase: W.Target
|
|
590
597
|
}
|
|
591
|
-
}),
|
|
592
|
-
onStart:
|
|
593
|
-
})), e.draggable &&
|
|
594
|
-
onStart:
|
|
595
|
-
onMove:
|
|
596
|
-
onEnd:
|
|
597
|
-
}), e.draggable && window.document.addEventListener("keyup", (
|
|
598
|
-
|
|
599
|
-
}),
|
|
600
|
-
if (
|
|
598
|
+
}), C.addEventListeners({
|
|
599
|
+
onStart: T
|
|
600
|
+
})), e.draggable && y.addEventListeners({
|
|
601
|
+
onStart: v,
|
|
602
|
+
onMove: S,
|
|
603
|
+
onEnd: E
|
|
604
|
+
}), e.draggable && window.document.addEventListener("keyup", (b) => {
|
|
605
|
+
b.key === "Escape" && n.onClose();
|
|
606
|
+
}), r.addEventListener("keyup", (b) => {
|
|
607
|
+
if (b.key === "ArrowUp") {
|
|
601
608
|
n.moveUp();
|
|
602
609
|
return;
|
|
603
610
|
}
|
|
604
|
-
if (
|
|
611
|
+
if (b.key === "ArrowDown") {
|
|
605
612
|
n.moveDown();
|
|
606
613
|
return;
|
|
607
614
|
}
|
|
608
|
-
if (
|
|
609
|
-
const
|
|
615
|
+
if (b.shiftKey && b.key === "Tab") {
|
|
616
|
+
const A = Y(
|
|
610
617
|
t.bottomSheetContentWrapper
|
|
611
618
|
);
|
|
612
|
-
|
|
619
|
+
Ut(A);
|
|
613
620
|
}
|
|
614
621
|
});
|
|
615
622
|
}
|
|
616
|
-
function
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
623
|
+
function z() {
|
|
624
|
+
e.shouldCloseOnOutsideClick ? d.addEventListener("click", k) : d.style.pointerEvents = "none";
|
|
625
|
+
}
|
|
626
|
+
function j() {
|
|
627
|
+
d.removeEventListener("click", k);
|
|
628
|
+
}
|
|
629
|
+
function Y(b) {
|
|
630
|
+
let A = [...Array.from(b.childNodes).reverse()];
|
|
631
|
+
for (; A.length; ) {
|
|
632
|
+
const D = A.shift();
|
|
633
|
+
if (jt(D))
|
|
634
|
+
return D;
|
|
635
|
+
D && (A = [
|
|
636
|
+
...A,
|
|
637
|
+
...Array.from(D.childNodes).reverse()
|
|
625
638
|
]);
|
|
626
639
|
}
|
|
627
640
|
return null;
|
|
628
641
|
}
|
|
629
|
-
function
|
|
630
|
-
|
|
631
|
-
onStart:
|
|
632
|
-
}),
|
|
633
|
-
onStart:
|
|
634
|
-
}),
|
|
635
|
-
onStart:
|
|
636
|
-
}),
|
|
637
|
-
|
|
638
|
-
onStart:
|
|
642
|
+
function q() {
|
|
643
|
+
c.removeEventListeners({
|
|
644
|
+
onStart: T
|
|
645
|
+
}), m.removeEventListeners({
|
|
646
|
+
onStart: T
|
|
647
|
+
}), C.removeEventListeners({
|
|
648
|
+
onStart: T
|
|
649
|
+
}), l.forEach((b) => {
|
|
650
|
+
b.removeEventListeners({
|
|
651
|
+
onStart: T
|
|
639
652
|
});
|
|
640
|
-
}),
|
|
641
|
-
onStart:
|
|
642
|
-
onMove:
|
|
643
|
-
onEnd:
|
|
644
|
-
})
|
|
653
|
+
}), y.removeEventListeners({
|
|
654
|
+
onStart: v,
|
|
655
|
+
onMove: S,
|
|
656
|
+
onEnd: E
|
|
657
|
+
});
|
|
645
658
|
}
|
|
646
659
|
return {
|
|
647
|
-
attachEventListeners:
|
|
648
|
-
clearEventListeners:
|
|
660
|
+
attachEventListeners: P,
|
|
661
|
+
clearEventListeners: q,
|
|
662
|
+
attacheOnOpenEventListeners: z,
|
|
663
|
+
clearOnOpenEventListeners: j
|
|
649
664
|
};
|
|
650
665
|
}
|
|
651
|
-
class
|
|
666
|
+
class ee {
|
|
652
667
|
constructor() {
|
|
653
|
-
|
|
668
|
+
V(this, "animationId"), V(this, "isInProgress"), V(this, "startedAt"), this.animationId = null, this.isInProgress = !1, this.startedAt = null;
|
|
654
669
|
}
|
|
655
670
|
/**
|
|
656
671
|
*
|
|
@@ -661,57 +676,57 @@ class te {
|
|
|
661
676
|
this.isInProgress = !0;
|
|
662
677
|
const i = (r) => {
|
|
663
678
|
this.startedAt || (this.startedAt = r);
|
|
664
|
-
const
|
|
665
|
-
e(
|
|
679
|
+
const s = r - this.startedAt, a = n === 0 ? 1 : Z(s / n, 2), d = a >= 1 && !o;
|
|
680
|
+
e(a), d ? this.stop() : this.animationId = requestAnimationFrame(i);
|
|
666
681
|
};
|
|
667
682
|
this.animationId = requestAnimationFrame(i);
|
|
668
683
|
}
|
|
669
684
|
stop() {
|
|
670
|
-
this.isInProgress = !1, this.startedAt = null,
|
|
685
|
+
this.isInProgress = !1, this.startedAt = null, O(this.animationId) && cancelAnimationFrame(this.animationId);
|
|
671
686
|
}
|
|
672
687
|
}
|
|
673
|
-
function
|
|
688
|
+
function ne(t) {
|
|
674
689
|
const {
|
|
675
690
|
startY: e,
|
|
676
691
|
endY: n,
|
|
677
692
|
bottomSheetContainer: o,
|
|
678
693
|
animationFrame: i,
|
|
679
694
|
onEnd: r,
|
|
680
|
-
animationTimingFunction:
|
|
681
|
-
animationDuration:
|
|
682
|
-
} = t,
|
|
695
|
+
animationTimingFunction: s,
|
|
696
|
+
animationDuration: a
|
|
697
|
+
} = t, d = Et(e, n);
|
|
683
698
|
i.stop();
|
|
684
|
-
let
|
|
685
|
-
i.start((
|
|
686
|
-
|
|
687
|
-
y: e +
|
|
688
|
-
}), !
|
|
689
|
-
},
|
|
699
|
+
let p = !1;
|
|
700
|
+
i.start((c) => {
|
|
701
|
+
tt(o, {
|
|
702
|
+
y: e + d * s(c)
|
|
703
|
+
}), !p && c >= 1 && (r == null || r(), p = !0);
|
|
704
|
+
}, a);
|
|
690
705
|
}
|
|
691
|
-
const
|
|
692
|
-
|
|
706
|
+
const lt = (t, e) => (n) => {
|
|
707
|
+
ne({
|
|
693
708
|
...n,
|
|
694
709
|
animationTimingFunction: t,
|
|
695
710
|
animationDuration: e
|
|
696
711
|
});
|
|
697
|
-
},
|
|
712
|
+
}, F = {
|
|
698
713
|
TOP: "top",
|
|
699
714
|
MIDDLE: "middle",
|
|
700
715
|
CONTENT_HEIGHT: "content-height",
|
|
701
716
|
CLOSED: "closed"
|
|
702
717
|
};
|
|
703
|
-
function
|
|
704
|
-
return !(!
|
|
718
|
+
function oe(t) {
|
|
719
|
+
return !(!O(t) || t > 1 || t < 0);
|
|
705
720
|
}
|
|
706
|
-
function
|
|
721
|
+
function re(t, e) {
|
|
707
722
|
const n = {
|
|
708
|
-
set(o, i, r,
|
|
709
|
-
return e(i, r), Reflect.set(o, i, r,
|
|
723
|
+
set(o, i, r, s) {
|
|
724
|
+
return e(i, r), Reflect.set(o, i, r, s);
|
|
710
725
|
}
|
|
711
726
|
};
|
|
712
727
|
return new Proxy(t, n);
|
|
713
728
|
}
|
|
714
|
-
function
|
|
729
|
+
function ie(...t) {
|
|
715
730
|
console.error(t);
|
|
716
731
|
}
|
|
717
732
|
const N = {
|
|
@@ -721,50 +736,50 @@ const N = {
|
|
|
721
736
|
EASE_IN_OUT: "ease-in-out",
|
|
722
737
|
SPRING: "spring"
|
|
723
738
|
};
|
|
724
|
-
function
|
|
739
|
+
function ae(t) {
|
|
725
740
|
for (const e of Object.values(N))
|
|
726
741
|
if (e === t)
|
|
727
742
|
return !0;
|
|
728
743
|
return !1;
|
|
729
744
|
}
|
|
730
|
-
function
|
|
731
|
-
return !!(t instanceof Object && "p1x" in t && "p1y" in t && "p2x" in t && "p2y" in t &&
|
|
745
|
+
function Ot(t) {
|
|
746
|
+
return !!(t instanceof Object && "p1x" in t && "p1y" in t && "p2x" in t && "p2y" in t && O(t.p1x) && O(t.p1y) && O(t.p2x) && O(t.p2y));
|
|
732
747
|
}
|
|
733
|
-
function
|
|
734
|
-
return function(
|
|
735
|
-
return
|
|
748
|
+
function U(t, e, n, o) {
|
|
749
|
+
return function(a) {
|
|
750
|
+
return s(i(a));
|
|
736
751
|
};
|
|
737
|
-
function i(
|
|
738
|
-
let
|
|
739
|
-
if (
|
|
740
|
-
return
|
|
741
|
-
for (;
|
|
742
|
-
if (
|
|
743
|
-
return
|
|
744
|
-
|
|
752
|
+
function i(a) {
|
|
753
|
+
let d = 0, p = 1, c = a, m;
|
|
754
|
+
if (a === 0 || a === 1)
|
|
755
|
+
return a;
|
|
756
|
+
for (; d < p; ) {
|
|
757
|
+
if (m = r(c), Math.abs(m - a) < 1e-3)
|
|
758
|
+
return c;
|
|
759
|
+
a > m ? d = c : p = c, c = (p + d) / 2;
|
|
745
760
|
}
|
|
746
|
-
return
|
|
761
|
+
return c;
|
|
747
762
|
}
|
|
748
|
-
function r(
|
|
749
|
-
return 3 * t *
|
|
763
|
+
function r(a) {
|
|
764
|
+
return 3 * t * a * Math.pow(1 - a, 2) + 3 * n * Math.pow(a, 2) * (1 - a) + Math.pow(a, 3);
|
|
750
765
|
}
|
|
751
|
-
function
|
|
752
|
-
return 3 * e *
|
|
766
|
+
function s(a) {
|
|
767
|
+
return 3 * e * a * Math.pow(1 - a, 2) + 3 * o * Math.pow(a, 2) * (1 - a) + Math.pow(a, 3);
|
|
753
768
|
}
|
|
754
769
|
}
|
|
755
|
-
const
|
|
756
|
-
function
|
|
770
|
+
const vt = U(0.25, 0.1, 0.25, 1), se = U(0.42, 0, 1, 1), xt = U(0.42, 0, 0.58, 1), ce = U(0.4, 0.1, 0.6, 1), le = U(0.45, 1.5, 0.55, 1);
|
|
771
|
+
function ue(t) {
|
|
757
772
|
switch (t) {
|
|
758
773
|
case N.EASE:
|
|
759
|
-
return
|
|
774
|
+
return vt;
|
|
760
775
|
case N.EASE_IN:
|
|
761
776
|
return se;
|
|
762
777
|
case N.EASE_OUT:
|
|
763
778
|
return xt;
|
|
764
779
|
case N.EASE_IN_OUT:
|
|
765
|
-
return vt;
|
|
766
|
-
case N.SPRING:
|
|
767
780
|
return ce;
|
|
781
|
+
case N.SPRING:
|
|
782
|
+
return le;
|
|
768
783
|
default:
|
|
769
784
|
return vt;
|
|
770
785
|
}
|
|
@@ -772,10 +787,10 @@ function le(t) {
|
|
|
772
787
|
function St(t) {
|
|
773
788
|
return typeof t == "boolean";
|
|
774
789
|
}
|
|
775
|
-
const
|
|
790
|
+
const de = {
|
|
776
791
|
ariaLabel: "Bottom sheet",
|
|
777
792
|
content: "",
|
|
778
|
-
defaultPosition:
|
|
793
|
+
defaultPosition: F.CONTENT_HEIGHT,
|
|
779
794
|
marginTop: 20,
|
|
780
795
|
snapPoints: [],
|
|
781
796
|
width: "92%",
|
|
@@ -811,13 +826,13 @@ const ue = {
|
|
|
811
826
|
draggingAnimationTimings: "ease-in-out",
|
|
812
827
|
draggingAnimationDuration: 180
|
|
813
828
|
};
|
|
814
|
-
function
|
|
829
|
+
function he(t) {
|
|
815
830
|
const e = {
|
|
816
|
-
...
|
|
831
|
+
...de
|
|
817
832
|
}, n = Object.entries(t).reduce(
|
|
818
833
|
(o, i) => {
|
|
819
|
-
const [r,
|
|
820
|
-
return
|
|
834
|
+
const [r, s] = i;
|
|
835
|
+
return ct(s) && (o[r] = s), o;
|
|
821
836
|
},
|
|
822
837
|
{}
|
|
823
838
|
);
|
|
@@ -826,112 +841,112 @@ function de(t) {
|
|
|
826
841
|
...n
|
|
827
842
|
};
|
|
828
843
|
}
|
|
829
|
-
function
|
|
830
|
-
if (
|
|
844
|
+
function ut(t) {
|
|
845
|
+
if (Ot(t)) {
|
|
831
846
|
const { p1x: e, p1y: n, p2x: o, p2y: i } = t;
|
|
832
|
-
return
|
|
847
|
+
return U(e, n, o, i);
|
|
833
848
|
}
|
|
834
|
-
return
|
|
849
|
+
return ae(t) ? ue(t) : xt;
|
|
835
850
|
}
|
|
836
851
|
function pe(t, e, n) {
|
|
837
852
|
function o(i, r) {
|
|
838
853
|
switch (i) {
|
|
839
854
|
case "content":
|
|
840
|
-
|
|
855
|
+
L(r) && (t.bottomSheetContentWrapper.innerHTML = r);
|
|
841
856
|
break;
|
|
842
857
|
case "width":
|
|
843
|
-
|
|
858
|
+
L(r) && (t.bottomSheetContainer.style.width = r);
|
|
844
859
|
break;
|
|
845
860
|
case "shouldShowHandle":
|
|
846
|
-
St(r) ||
|
|
861
|
+
St(r) || J(t.bottomSheetHandle, !1);
|
|
847
862
|
break;
|
|
848
863
|
case "shouldShowBackdrop":
|
|
849
|
-
St(r) ||
|
|
864
|
+
St(r) || J(t.bottomSheetBackdrop, !1);
|
|
850
865
|
break;
|
|
851
866
|
case "containerBorderRadius":
|
|
852
|
-
|
|
867
|
+
L(r) && (t.bottomSheetContainer.style.borderRadius = Lt(r));
|
|
853
868
|
break;
|
|
854
869
|
case "backdropColor":
|
|
855
|
-
|
|
870
|
+
L(r) && (t.bottomSheetBackdrop.style.backgroundColor = r);
|
|
856
871
|
break;
|
|
857
872
|
case "backDropTransition":
|
|
858
|
-
|
|
873
|
+
L(r) && (t.bottomSheetBackdrop.style.transition = r);
|
|
859
874
|
break;
|
|
860
875
|
case "rootClass":
|
|
861
|
-
if (!
|
|
876
|
+
if (!L(r))
|
|
862
877
|
return;
|
|
863
|
-
|
|
878
|
+
$(
|
|
864
879
|
t.bottomSheetRoot,
|
|
865
880
|
n.rootClass,
|
|
866
881
|
r
|
|
867
882
|
);
|
|
868
883
|
break;
|
|
869
884
|
case "containerClass":
|
|
870
|
-
if (!
|
|
885
|
+
if (!L(r))
|
|
871
886
|
return;
|
|
872
|
-
|
|
887
|
+
$(
|
|
873
888
|
t.bottomSheetContainer,
|
|
874
889
|
n.containerClass,
|
|
875
890
|
r
|
|
876
891
|
);
|
|
877
892
|
break;
|
|
878
893
|
case "handleClass":
|
|
879
|
-
if (!
|
|
894
|
+
if (!L(r))
|
|
880
895
|
return;
|
|
881
|
-
|
|
896
|
+
$(
|
|
882
897
|
t.bottomSheetHandle,
|
|
883
898
|
n.handleClass,
|
|
884
899
|
r
|
|
885
900
|
);
|
|
886
901
|
break;
|
|
887
902
|
case "contentWrapperClass":
|
|
888
|
-
if (!
|
|
903
|
+
if (!L(r))
|
|
889
904
|
return;
|
|
890
|
-
|
|
905
|
+
$(
|
|
891
906
|
t.bottomSheetContentWrapper,
|
|
892
907
|
n.contentWrapperClass,
|
|
893
908
|
r
|
|
894
909
|
);
|
|
895
910
|
break;
|
|
896
911
|
case "backdropClass":
|
|
897
|
-
if (!
|
|
912
|
+
if (!L(r))
|
|
898
913
|
return;
|
|
899
|
-
|
|
914
|
+
$(
|
|
900
915
|
t.bottomSheetBackdrop,
|
|
901
916
|
n.backdropClass,
|
|
902
917
|
r
|
|
903
918
|
);
|
|
904
919
|
break;
|
|
905
920
|
case "draggingAnimationTimings":
|
|
906
|
-
if (
|
|
907
|
-
const
|
|
908
|
-
|
|
921
|
+
if (Ot(r)) {
|
|
922
|
+
const s = ut(r), a = lt(
|
|
923
|
+
s,
|
|
909
924
|
n.draggingAnimationDuration
|
|
910
925
|
);
|
|
911
|
-
e.translateContainer =
|
|
926
|
+
e.translateContainer = a;
|
|
912
927
|
}
|
|
913
928
|
break;
|
|
914
929
|
case "draggingAnimationDuration":
|
|
915
|
-
if (
|
|
916
|
-
const
|
|
930
|
+
if (O(r)) {
|
|
931
|
+
const s = ut(
|
|
917
932
|
n.draggingAnimationTimings
|
|
918
|
-
),
|
|
919
|
-
|
|
933
|
+
), a = lt(
|
|
934
|
+
s,
|
|
920
935
|
r
|
|
921
936
|
);
|
|
922
|
-
e.translateContainer =
|
|
937
|
+
e.translateContainer = a;
|
|
923
938
|
}
|
|
924
939
|
break;
|
|
925
940
|
}
|
|
926
941
|
}
|
|
927
942
|
return o;
|
|
928
943
|
}
|
|
929
|
-
function
|
|
930
|
-
const e =
|
|
944
|
+
function me(t) {
|
|
945
|
+
const e = he(t), n = ut(
|
|
931
946
|
t.draggingAnimationTimings
|
|
932
947
|
), o = {
|
|
933
948
|
isMounted: !1,
|
|
934
|
-
translateContainer:
|
|
949
|
+
translateContainer: lt(
|
|
935
950
|
n,
|
|
936
951
|
e.draggingAnimationDuration
|
|
937
952
|
)
|
|
@@ -948,198 +963,198 @@ function he(t) {
|
|
|
948
963
|
function r() {
|
|
949
964
|
i.originalDocumentOverflowY && i.originalDocumentOverflowY !== "hidden" && (document.body.style.overflowY = i.originalDocumentOverflowY), i.originalDocumentOverscrollBehavior && (document.body.style.position = i.originalDocumentOverscrollBehavior);
|
|
950
965
|
}
|
|
951
|
-
const
|
|
952
|
-
animationFrame:
|
|
953
|
-
onClose:
|
|
966
|
+
const s = new ee(), a = {
|
|
967
|
+
animationFrame: s,
|
|
968
|
+
onClose: E,
|
|
954
969
|
bottomSheetState: o,
|
|
955
970
|
draggingState: i,
|
|
956
|
-
snapTo:
|
|
957
|
-
moveUp:
|
|
958
|
-
moveDown:
|
|
959
|
-
}, { elements:
|
|
971
|
+
snapTo: D,
|
|
972
|
+
moveUp: b,
|
|
973
|
+
moveDown: A
|
|
974
|
+
}, { elements: d, eventHandlers: p } = Jt(
|
|
960
975
|
e,
|
|
961
|
-
|
|
962
|
-
),
|
|
976
|
+
a
|
|
977
|
+
), c = re(
|
|
963
978
|
e,
|
|
964
|
-
pe(
|
|
965
|
-
), { bottomSheetBackdrop:
|
|
966
|
-
const
|
|
967
|
-
|
|
968
|
-
const
|
|
969
|
-
|
|
970
|
-
y:
|
|
971
|
-
}),
|
|
979
|
+
pe(d, o, e)
|
|
980
|
+
), { bottomSheetBackdrop: m, bottomSheetRoot: C, bottomSheetContainer: l } = d, y = (h) => {
|
|
981
|
+
const u = h ?? window.document.body;
|
|
982
|
+
u.appendChild(C), u.appendChild(m);
|
|
983
|
+
const f = window.innerHeight;
|
|
984
|
+
tt(l, {
|
|
985
|
+
y: f
|
|
986
|
+
}), p.attachEventListeners(), o.isMounted = !0;
|
|
972
987
|
}, v = () => {
|
|
973
|
-
|
|
974
|
-
|
|
988
|
+
p.clearEventListeners(), Object.values(d).forEach((h) => {
|
|
989
|
+
h.remove();
|
|
975
990
|
}), r(), o.isMounted = !1;
|
|
976
991
|
}, S = () => {
|
|
977
|
-
var
|
|
978
|
-
if (
|
|
992
|
+
var h;
|
|
993
|
+
if (k() || ie(
|
|
979
994
|
'Bottom Sheet is not mounted yet. call the "mount" method first.'
|
|
980
|
-
), (
|
|
995
|
+
), (h = t.beforeOpen) == null || h.call(t), T())
|
|
981
996
|
return;
|
|
982
|
-
|
|
983
|
-
y:
|
|
997
|
+
nt(m, !0), c.shouldShowBackdrop || X(m, "transparent"), nt([l], !0), tt(l, {
|
|
998
|
+
y: l.clientHeight
|
|
984
999
|
});
|
|
985
|
-
const
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
),
|
|
1000
|
+
const u = window.innerHeight, f = pt(
|
|
1001
|
+
u,
|
|
1002
|
+
l.clientHeight,
|
|
1003
|
+
c.marginTop,
|
|
1004
|
+
c.defaultPosition
|
|
1005
|
+
), g = B(l).y;
|
|
991
1006
|
o.translateContainer({
|
|
992
|
-
startY:
|
|
993
|
-
endY:
|
|
994
|
-
animationFrame:
|
|
995
|
-
bottomSheetContainer:
|
|
1007
|
+
startY: g,
|
|
1008
|
+
endY: f,
|
|
1009
|
+
animationFrame: s,
|
|
1010
|
+
bottomSheetContainer: l,
|
|
996
1011
|
onEnd: t.afterOpen
|
|
997
|
-
})
|
|
998
|
-
const
|
|
999
|
-
i.originalDocumentOverflowY =
|
|
1000
|
-
const
|
|
1001
|
-
i.originalDocumentOverscrollBehavior =
|
|
1012
|
+
});
|
|
1013
|
+
const H = document.body.style.overflowY;
|
|
1014
|
+
i.originalDocumentOverflowY = H || "initial";
|
|
1015
|
+
const x = document.body.style.overscrollBehavior;
|
|
1016
|
+
i.originalDocumentOverscrollBehavior = x || "initial", document.body.style.overflow = "hidden", document.body.style.overscrollBehavior = "contain", d.bottomSheetHandle.focus(), p.attacheOnOpenEventListeners();
|
|
1002
1017
|
};
|
|
1003
|
-
function
|
|
1004
|
-
var
|
|
1005
|
-
if (
|
|
1018
|
+
function E() {
|
|
1019
|
+
var h;
|
|
1020
|
+
if (P())
|
|
1006
1021
|
return;
|
|
1007
|
-
(
|
|
1008
|
-
const
|
|
1022
|
+
(h = t.beforeClose) == null || h.call(t);
|
|
1023
|
+
const u = B(l).y, f = l.clientHeight;
|
|
1009
1024
|
o.translateContainer({
|
|
1010
|
-
startY:
|
|
1011
|
-
endY:
|
|
1012
|
-
animationFrame:
|
|
1013
|
-
bottomSheetContainer:
|
|
1025
|
+
startY: u,
|
|
1026
|
+
endY: f,
|
|
1027
|
+
animationFrame: s,
|
|
1028
|
+
bottomSheetContainer: l,
|
|
1014
1029
|
onEnd: () => {
|
|
1015
|
-
var
|
|
1016
|
-
(
|
|
1030
|
+
var g;
|
|
1031
|
+
(g = t.afterClose) == null || g.call(t), nt([m, l], !1), p.clearOnOpenEventListeners();
|
|
1017
1032
|
}
|
|
1018
1033
|
}), r();
|
|
1019
1034
|
}
|
|
1020
|
-
function
|
|
1035
|
+
function k() {
|
|
1021
1036
|
return o.isMounted;
|
|
1022
1037
|
}
|
|
1023
|
-
function
|
|
1024
|
-
const
|
|
1025
|
-
return
|
|
1038
|
+
function T() {
|
|
1039
|
+
const h = B(l).y, u = window.innerHeight, f = l.clientHeight >= u ? u : l.clientHeight;
|
|
1040
|
+
return h <= f;
|
|
1026
1041
|
}
|
|
1027
|
-
function
|
|
1028
|
-
return !
|
|
1042
|
+
function P() {
|
|
1043
|
+
return !T();
|
|
1029
1044
|
}
|
|
1030
|
-
function
|
|
1031
|
-
const
|
|
1032
|
-
if (
|
|
1033
|
-
return
|
|
1034
|
-
const
|
|
1035
|
-
if (
|
|
1036
|
-
return
|
|
1037
|
-
const
|
|
1038
|
-
return
|
|
1045
|
+
function z() {
|
|
1046
|
+
const h = B(l).y, u = l.clientHeight, f = window.innerHeight;
|
|
1047
|
+
if (h <= 5 && h >= -5)
|
|
1048
|
+
return F.CONTENT_HEIGHT;
|
|
1049
|
+
const g = u - h;
|
|
1050
|
+
if (g === f / 2)
|
|
1051
|
+
return F.MIDDLE;
|
|
1052
|
+
const H = f - c.marginTop, x = 10;
|
|
1053
|
+
return g <= H + x && g >= H - x ? F.TOP : F.CLOSED;
|
|
1039
1054
|
}
|
|
1040
|
-
function
|
|
1041
|
-
return
|
|
1055
|
+
function j() {
|
|
1056
|
+
return l.clientHeight;
|
|
1042
1057
|
}
|
|
1043
|
-
function
|
|
1044
|
-
if (!
|
|
1058
|
+
function Y(h) {
|
|
1059
|
+
if (!T())
|
|
1045
1060
|
return;
|
|
1046
|
-
const
|
|
1061
|
+
const u = B(l).y, f = l.clientHeight - u, g = window.innerHeight - h, H = $t(f, g), x = Q(f, g);
|
|
1047
1062
|
o.translateContainer({
|
|
1048
|
-
startY:
|
|
1049
|
-
endY:
|
|
1050
|
-
animationFrame:
|
|
1051
|
-
bottomSheetContainer:
|
|
1063
|
+
startY: u,
|
|
1064
|
+
endY: u + (H.isUp ? -x : x),
|
|
1065
|
+
animationFrame: s,
|
|
1066
|
+
bottomSheetContainer: l
|
|
1052
1067
|
});
|
|
1053
1068
|
}
|
|
1054
|
-
function
|
|
1055
|
-
viewportHeight:
|
|
1056
|
-
visibleHeight:
|
|
1069
|
+
function q(h, {
|
|
1070
|
+
viewportHeight: u,
|
|
1071
|
+
visibleHeight: f
|
|
1057
1072
|
}) {
|
|
1058
|
-
let
|
|
1059
|
-
for (const
|
|
1060
|
-
const
|
|
1061
|
-
|
|
1062
|
-
|
|
1073
|
+
let g = null;
|
|
1074
|
+
for (const H of h) {
|
|
1075
|
+
const x = H * u, I = Q(
|
|
1076
|
+
f,
|
|
1077
|
+
x
|
|
1063
1078
|
);
|
|
1064
|
-
(
|
|
1079
|
+
(g === null || I < g) && (g = I);
|
|
1065
1080
|
}
|
|
1066
1081
|
return {
|
|
1067
|
-
minOffset:
|
|
1082
|
+
minOffset: g
|
|
1068
1083
|
};
|
|
1069
1084
|
}
|
|
1070
|
-
function
|
|
1071
|
-
const
|
|
1072
|
-
if (!
|
|
1085
|
+
function b() {
|
|
1086
|
+
const h = [...c.snapPoints].reverse(), u = B(l).y, f = l.clientHeight, g = f - u;
|
|
1087
|
+
if (!c.expandable && g >= f)
|
|
1073
1088
|
return;
|
|
1074
|
-
const
|
|
1089
|
+
const H = window.innerHeight, x = mt(
|
|
1075
1090
|
"above",
|
|
1076
|
-
{ visibleHeight:
|
|
1077
|
-
|
|
1078
|
-
), { minOffset:
|
|
1079
|
-
visibleHeight:
|
|
1080
|
-
viewportHeight:
|
|
1091
|
+
{ visibleHeight: g, viewportHeight: H },
|
|
1092
|
+
h
|
|
1093
|
+
), { minOffset: I } = q(x, {
|
|
1094
|
+
visibleHeight: g,
|
|
1095
|
+
viewportHeight: H
|
|
1081
1096
|
});
|
|
1082
|
-
if (
|
|
1097
|
+
if (I === null && g < H - c.marginTop) {
|
|
1083
1098
|
o.translateContainer({
|
|
1084
|
-
startY:
|
|
1085
|
-
endY:
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1099
|
+
startY: u,
|
|
1100
|
+
endY: pt(
|
|
1101
|
+
H,
|
|
1102
|
+
f,
|
|
1103
|
+
c.marginTop,
|
|
1089
1104
|
"top"
|
|
1090
1105
|
),
|
|
1091
|
-
animationFrame:
|
|
1092
|
-
bottomSheetContainer:
|
|
1106
|
+
animationFrame: s,
|
|
1107
|
+
bottomSheetContainer: l
|
|
1093
1108
|
});
|
|
1094
1109
|
return;
|
|
1095
1110
|
}
|
|
1096
|
-
|
|
1097
|
-
startY:
|
|
1098
|
-
endY:
|
|
1099
|
-
animationFrame:
|
|
1100
|
-
bottomSheetContainer:
|
|
1111
|
+
O(I) && o.translateContainer({
|
|
1112
|
+
startY: u,
|
|
1113
|
+
endY: u - I,
|
|
1114
|
+
animationFrame: s,
|
|
1115
|
+
bottomSheetContainer: l
|
|
1101
1116
|
});
|
|
1102
1117
|
}
|
|
1103
|
-
function
|
|
1104
|
-
const
|
|
1105
|
-
if (
|
|
1118
|
+
function A() {
|
|
1119
|
+
const h = B(l).y, u = l.clientHeight - h;
|
|
1120
|
+
if (u < 1)
|
|
1106
1121
|
return;
|
|
1107
|
-
const
|
|
1122
|
+
const f = window.innerHeight, g = mt(
|
|
1108
1123
|
"below",
|
|
1109
|
-
{ visibleHeight:
|
|
1110
|
-
|
|
1111
|
-
), { minOffset:
|
|
1112
|
-
visibleHeight:
|
|
1113
|
-
viewportHeight:
|
|
1124
|
+
{ visibleHeight: u, viewportHeight: f },
|
|
1125
|
+
c.snapPoints
|
|
1126
|
+
), { minOffset: H } = q(g, {
|
|
1127
|
+
visibleHeight: u,
|
|
1128
|
+
viewportHeight: f
|
|
1114
1129
|
});
|
|
1115
|
-
|
|
1116
|
-
startY:
|
|
1117
|
-
endY:
|
|
1118
|
-
animationFrame:
|
|
1119
|
-
bottomSheetContainer:
|
|
1130
|
+
O(H) && o.translateContainer({
|
|
1131
|
+
startY: h,
|
|
1132
|
+
endY: h + H,
|
|
1133
|
+
animationFrame: s,
|
|
1134
|
+
bottomSheetContainer: l
|
|
1120
1135
|
});
|
|
1121
1136
|
}
|
|
1122
|
-
function
|
|
1123
|
-
const
|
|
1124
|
-
if (!
|
|
1137
|
+
function D(h) {
|
|
1138
|
+
const u = window.innerHeight;
|
|
1139
|
+
if (!oe(h))
|
|
1125
1140
|
return;
|
|
1126
|
-
const
|
|
1127
|
-
|
|
1141
|
+
const f = Z(u * h, 2);
|
|
1142
|
+
Y(f);
|
|
1128
1143
|
}
|
|
1129
1144
|
return {
|
|
1130
|
-
props:
|
|
1131
|
-
elements:
|
|
1132
|
-
mount:
|
|
1145
|
+
props: c,
|
|
1146
|
+
elements: d,
|
|
1147
|
+
mount: y,
|
|
1133
1148
|
unmount: v,
|
|
1134
1149
|
open: S,
|
|
1135
|
-
close:
|
|
1136
|
-
getIsMounted:
|
|
1137
|
-
getIsOpen:
|
|
1138
|
-
getIsClosed:
|
|
1139
|
-
getPosition:
|
|
1140
|
-
getHeight:
|
|
1141
|
-
moveTo:
|
|
1142
|
-
snapTo:
|
|
1150
|
+
close: E,
|
|
1151
|
+
getIsMounted: k,
|
|
1152
|
+
getIsOpen: T,
|
|
1153
|
+
getIsClosed: P,
|
|
1154
|
+
getPosition: z,
|
|
1155
|
+
getHeight: j,
|
|
1156
|
+
moveTo: Y,
|
|
1157
|
+
snapTo: D
|
|
1143
1158
|
};
|
|
1144
1159
|
}
|
|
1145
1160
|
function At() {
|
|
@@ -1165,7 +1180,7 @@ function At() {
|
|
|
1165
1180
|
getHeight: () => 0,
|
|
1166
1181
|
getIsOpen: () => !1,
|
|
1167
1182
|
getIsClosed: () => !0,
|
|
1168
|
-
getPosition: () =>
|
|
1183
|
+
getPosition: () => F.CLOSED,
|
|
1169
1184
|
moveTo: () => {
|
|
1170
1185
|
},
|
|
1171
1186
|
snapTo: () => {
|
|
@@ -1175,73 +1190,115 @@ function At() {
|
|
|
1175
1190
|
}
|
|
1176
1191
|
};
|
|
1177
1192
|
}
|
|
1178
|
-
const
|
|
1193
|
+
const fe = At(), Se = Dt(
|
|
1179
1194
|
function(e, n) {
|
|
1180
1195
|
const {
|
|
1181
1196
|
children: o,
|
|
1182
1197
|
isOpen: i,
|
|
1183
1198
|
setIsOpen: r,
|
|
1184
|
-
afterClose:
|
|
1185
|
-
|
|
1186
|
-
...
|
|
1187
|
-
} = e,
|
|
1188
|
-
|
|
1199
|
+
afterClose: s,
|
|
1200
|
+
mountingPointRef: a,
|
|
1201
|
+
...d
|
|
1202
|
+
} = e, p = ot(fe), [c, m] = rt(
|
|
1203
|
+
p.current
|
|
1189
1204
|
);
|
|
1190
|
-
|
|
1205
|
+
Bt(
|
|
1191
1206
|
n,
|
|
1192
|
-
() =>
|
|
1193
|
-
[
|
|
1207
|
+
() => c,
|
|
1208
|
+
[c]
|
|
1194
1209
|
);
|
|
1195
|
-
const
|
|
1196
|
-
r(!1),
|
|
1197
|
-
}, [
|
|
1210
|
+
const C = Mt(() => {
|
|
1211
|
+
r(!1), s == null || s();
|
|
1212
|
+
}, [s]);
|
|
1198
1213
|
_(() => {
|
|
1199
|
-
i ?
|
|
1214
|
+
i ? c.open() : c.close();
|
|
1200
1215
|
}, [i]);
|
|
1201
|
-
const
|
|
1216
|
+
const l = ot(null);
|
|
1202
1217
|
return _(
|
|
1203
1218
|
function() {
|
|
1204
|
-
|
|
1205
|
-
if (
|
|
1219
|
+
var E;
|
|
1220
|
+
if (a && !a.current)
|
|
1221
|
+
return;
|
|
1222
|
+
const v = It((E = e.mountingPointRef) == null ? void 0 : E.current) ? e.mountingPointRef.current : window.document.body;
|
|
1223
|
+
if (!v || c.getIsMounted())
|
|
1206
1224
|
return;
|
|
1207
|
-
const S =
|
|
1225
|
+
const S = me({
|
|
1208
1226
|
content: "",
|
|
1209
|
-
...
|
|
1210
|
-
afterClose:
|
|
1227
|
+
...d,
|
|
1228
|
+
afterClose: C
|
|
1211
1229
|
});
|
|
1212
|
-
return S.mount(v),
|
|
1213
|
-
|
|
1230
|
+
return S.mount(v), l.current = S.elements.bottomSheetContentWrapper ?? null, p.current = S, m(S), () => {
|
|
1231
|
+
c.unmount();
|
|
1214
1232
|
};
|
|
1215
1233
|
},
|
|
1216
|
-
[e.
|
|
1234
|
+
[e.mountingPointRef, d, C]
|
|
1217
1235
|
), _(
|
|
1218
1236
|
function() {
|
|
1219
|
-
Object.assign(
|
|
1220
|
-
...
|
|
1221
|
-
}),
|
|
1237
|
+
Object.assign(p.current.props, {
|
|
1238
|
+
...d
|
|
1239
|
+
}), m(p.current);
|
|
1222
1240
|
},
|
|
1223
|
-
[
|
|
1224
|
-
),
|
|
1241
|
+
[d]
|
|
1242
|
+
), _(function() {
|
|
1243
|
+
return () => {
|
|
1244
|
+
p.current.unmount();
|
|
1245
|
+
};
|
|
1246
|
+
}, []), l.current ? Yt(
|
|
1225
1247
|
e.children,
|
|
1226
|
-
|
|
1248
|
+
l.current
|
|
1227
1249
|
) : null;
|
|
1228
1250
|
}
|
|
1229
|
-
),
|
|
1230
|
-
function
|
|
1231
|
-
const
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
}, [
|
|
1251
|
+
), ge = At();
|
|
1252
|
+
function Ce(t = {}) {
|
|
1253
|
+
const e = ot(ge), [n, o] = rt(!1), [i, r] = rt(e.current);
|
|
1254
|
+
_(() => {
|
|
1255
|
+
r(e.current);
|
|
1256
|
+
}, [e.current]);
|
|
1257
|
+
const {
|
|
1258
|
+
beforeOpen: s,
|
|
1259
|
+
afterOpen: a,
|
|
1260
|
+
beforeClose: d,
|
|
1261
|
+
afterClose: p,
|
|
1262
|
+
onDragStart: c,
|
|
1263
|
+
onDragMove: m,
|
|
1264
|
+
onDragEnd: C,
|
|
1265
|
+
...l
|
|
1266
|
+
} = t, y = () => {
|
|
1267
|
+
s == null || s();
|
|
1268
|
+
}, v = () => {
|
|
1269
|
+
a == null || a(), o(!0);
|
|
1270
|
+
}, S = () => {
|
|
1271
|
+
d == null || d();
|
|
1272
|
+
}, E = () => {
|
|
1273
|
+
p == null || p(), o(!1);
|
|
1274
|
+
}, k = () => {
|
|
1275
|
+
c == null || c();
|
|
1276
|
+
}, T = (j, Y) => {
|
|
1277
|
+
m == null || m(j, Y);
|
|
1278
|
+
}, P = () => {
|
|
1279
|
+
C == null || C();
|
|
1280
|
+
};
|
|
1281
|
+
return {
|
|
1235
1282
|
props: Pt(() => ({
|
|
1236
|
-
ref:
|
|
1237
|
-
isOpen:
|
|
1238
|
-
setIsOpen:
|
|
1239
|
-
|
|
1240
|
-
|
|
1283
|
+
ref: e,
|
|
1284
|
+
isOpen: n,
|
|
1285
|
+
setIsOpen: o,
|
|
1286
|
+
beforeOpen: y,
|
|
1287
|
+
afterOpen: v,
|
|
1288
|
+
beforeClose: S,
|
|
1289
|
+
afterClose: E,
|
|
1290
|
+
onDragStart: k,
|
|
1291
|
+
onDragMove: T,
|
|
1292
|
+
onDragEnd: P,
|
|
1293
|
+
...l
|
|
1294
|
+
}), [e.current, n, o, t]),
|
|
1295
|
+
instance: i,
|
|
1296
|
+
isOpen: n,
|
|
1297
|
+
setIsOpen: o
|
|
1241
1298
|
};
|
|
1242
1299
|
}
|
|
1243
1300
|
export {
|
|
1244
|
-
|
|
1301
|
+
Se as BottomSheet,
|
|
1245
1302
|
At as createPlaceholderBottomSheet,
|
|
1246
|
-
|
|
1303
|
+
Ce as useBottomSheet
|
|
1247
1304
|
};
|