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