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