@luciodale/swipe-bar 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SwipeBarProvider.d.ts +1 -1
- package/dist/SwipeBarProvider.d.ts.map +1 -1
- package/dist/components/SwipeBarBottom.d.ts.map +1 -1
- package/dist/components/SwipeBarLeft.d.ts.map +1 -1
- package/dist/components/SwipeBarRight.d.ts.map +1 -1
- package/dist/swipe-bar.es.js +798 -796
- package/dist/swipe-bar.umd.js +4 -4
- package/dist/swipeSidebarShared.d.ts +2 -0
- package/dist/swipeSidebarShared.d.ts.map +1 -1
- package/dist/test-utils.d.ts +36 -0
- package/dist/test-utils.d.ts.map +1 -0
- package/dist/useSwipeBarContext.d.ts.map +1 -1
- package/dist/useSwipeBottomSidebar.d.ts +25 -1
- package/dist/useSwipeBottomSidebar.d.ts.map +1 -1
- package/dist/useSwipeLeftSidebar.d.ts +17 -1
- package/dist/useSwipeLeftSidebar.d.ts.map +1 -1
- package/dist/useSwipeRightSidebar.d.ts +17 -1
- package/dist/useSwipeRightSidebar.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/swipe-bar.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import gt, { createContext as ht, useState as re, useRef as L, useMemo as Ze, useCallback as H, useEffect as Z, useContext as mt } from "react";
|
|
2
2
|
var we = { exports: {} }, de = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
@@ -9,23 +9,23 @@ var we = { exports: {} }, de = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
|
|
12
|
+
var Me;
|
|
13
|
+
function bt() {
|
|
14
|
+
if (Me) return de;
|
|
15
|
+
Me = 1;
|
|
16
16
|
var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
17
|
-
function r(i,
|
|
17
|
+
function r(i, a, o) {
|
|
18
18
|
var u = null;
|
|
19
|
-
if (o !== void 0 && (u = "" + o),
|
|
19
|
+
if (o !== void 0 && (u = "" + o), a.key !== void 0 && (u = "" + a.key), "key" in a) {
|
|
20
20
|
o = {};
|
|
21
|
-
for (var
|
|
22
|
-
|
|
23
|
-
} else o =
|
|
24
|
-
return
|
|
21
|
+
for (var s in a)
|
|
22
|
+
s !== "key" && (o[s] = a[s]);
|
|
23
|
+
} else o = a;
|
|
24
|
+
return a = o.ref, {
|
|
25
25
|
$$typeof: e,
|
|
26
26
|
type: i,
|
|
27
27
|
key: u,
|
|
28
|
-
ref:
|
|
28
|
+
ref: a !== void 0 ? a : null,
|
|
29
29
|
props: o
|
|
30
30
|
};
|
|
31
31
|
}
|
|
@@ -41,26 +41,26 @@ var fe = {};
|
|
|
41
41
|
* This source code is licensed under the MIT license found in the
|
|
42
42
|
* LICENSE file in the root directory of this source tree.
|
|
43
43
|
*/
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
return
|
|
44
|
+
var Le;
|
|
45
|
+
function vt() {
|
|
46
|
+
return Le || (Le = 1, process.env.NODE_ENV !== "production" && function() {
|
|
47
47
|
function e(n) {
|
|
48
48
|
if (n == null) return null;
|
|
49
49
|
if (typeof n == "function")
|
|
50
|
-
return n.$$typeof ===
|
|
50
|
+
return n.$$typeof === X ? null : n.displayName || n.name || null;
|
|
51
51
|
if (typeof n == "string") return n;
|
|
52
52
|
switch (n) {
|
|
53
|
-
case
|
|
53
|
+
case A:
|
|
54
54
|
return "Fragment";
|
|
55
55
|
case _:
|
|
56
56
|
return "Profiler";
|
|
57
|
-
case
|
|
57
|
+
case M:
|
|
58
58
|
return "StrictMode";
|
|
59
|
-
case
|
|
59
|
+
case N:
|
|
60
60
|
return "Suspense";
|
|
61
|
-
case
|
|
61
|
+
case f:
|
|
62
62
|
return "SuspenseList";
|
|
63
|
-
case
|
|
63
|
+
case Y:
|
|
64
64
|
return "Activity";
|
|
65
65
|
}
|
|
66
66
|
if (typeof n == "object")
|
|
@@ -69,19 +69,19 @@ function pt() {
|
|
|
69
69
|
), n.$$typeof) {
|
|
70
70
|
case y:
|
|
71
71
|
return "Portal";
|
|
72
|
-
case
|
|
72
|
+
case D:
|
|
73
73
|
return n.displayName || "Context";
|
|
74
|
-
case
|
|
74
|
+
case W:
|
|
75
75
|
return (n._context.displayName || "Context") + ".Consumer";
|
|
76
76
|
case j:
|
|
77
|
-
var
|
|
78
|
-
return n = n.displayName, n || (n =
|
|
77
|
+
var g = n.render;
|
|
78
|
+
return n = n.displayName, n || (n = g.displayName || g.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n;
|
|
79
|
+
case x:
|
|
80
|
+
return g = n.displayName || null, g !== null ? g : e(n.type) || "Memo";
|
|
79
81
|
case p:
|
|
80
|
-
|
|
81
|
-
case T:
|
|
82
|
-
f = n._payload, n = n._init;
|
|
82
|
+
g = n._payload, n = n._init;
|
|
83
83
|
try {
|
|
84
|
-
return e(n(
|
|
84
|
+
return e(n(g));
|
|
85
85
|
} catch {
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -93,72 +93,72 @@ function pt() {
|
|
|
93
93
|
function r(n) {
|
|
94
94
|
try {
|
|
95
95
|
t(n);
|
|
96
|
-
var
|
|
96
|
+
var g = !1;
|
|
97
97
|
} catch {
|
|
98
|
-
|
|
98
|
+
g = !0;
|
|
99
99
|
}
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
var
|
|
103
|
-
return
|
|
104
|
-
|
|
100
|
+
if (g) {
|
|
101
|
+
g = console;
|
|
102
|
+
var T = g.error, P = typeof Symbol == "function" && Symbol.toStringTag && n[Symbol.toStringTag] || n.constructor.name || "Object";
|
|
103
|
+
return T.call(
|
|
104
|
+
g,
|
|
105
105
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
-
|
|
106
|
+
P
|
|
107
107
|
), t(n);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
function i(n) {
|
|
111
|
-
if (n ===
|
|
112
|
-
if (typeof n == "object" && n !== null && n.$$typeof ===
|
|
111
|
+
if (n === A) return "<>";
|
|
112
|
+
if (typeof n == "object" && n !== null && n.$$typeof === p)
|
|
113
113
|
return "<...>";
|
|
114
114
|
try {
|
|
115
|
-
var
|
|
116
|
-
return
|
|
115
|
+
var g = e(n);
|
|
116
|
+
return g ? "<" + g + ">" : "<...>";
|
|
117
117
|
} catch {
|
|
118
118
|
return "<...>";
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
var n =
|
|
121
|
+
function a() {
|
|
122
|
+
var n = z.A;
|
|
123
123
|
return n === null ? null : n.getOwner();
|
|
124
124
|
}
|
|
125
125
|
function o() {
|
|
126
126
|
return Error("react-stack-top-frame");
|
|
127
127
|
}
|
|
128
128
|
function u(n) {
|
|
129
|
-
if (
|
|
130
|
-
var
|
|
131
|
-
if (
|
|
129
|
+
if (F.call(n, "key")) {
|
|
130
|
+
var g = Object.getOwnPropertyDescriptor(n, "key").get;
|
|
131
|
+
if (g && g.isReactWarning) return !1;
|
|
132
132
|
}
|
|
133
133
|
return n.key !== void 0;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
function
|
|
137
|
-
|
|
135
|
+
function s(n, g) {
|
|
136
|
+
function T() {
|
|
137
|
+
U || (U = !0, console.error(
|
|
138
138
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
139
|
-
|
|
139
|
+
g
|
|
140
140
|
));
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
get:
|
|
142
|
+
T.isReactWarning = !0, Object.defineProperty(n, "key", {
|
|
143
|
+
get: T,
|
|
144
144
|
configurable: !0
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
147
|
function l() {
|
|
148
148
|
var n = e(this.type);
|
|
149
|
-
return
|
|
149
|
+
return V[n] || (V[n] = !0, console.error(
|
|
150
150
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
151
151
|
)), n = this.props.ref, n !== void 0 ? n : null;
|
|
152
152
|
}
|
|
153
|
-
function c(n,
|
|
154
|
-
var
|
|
153
|
+
function c(n, g, T, P, Q, K) {
|
|
154
|
+
var C = T.ref;
|
|
155
155
|
return n = {
|
|
156
|
-
$$typeof:
|
|
156
|
+
$$typeof: I,
|
|
157
157
|
type: n,
|
|
158
|
-
key:
|
|
159
|
-
props:
|
|
160
|
-
_owner:
|
|
161
|
-
}, (
|
|
158
|
+
key: g,
|
|
159
|
+
props: T,
|
|
160
|
+
_owner: P
|
|
161
|
+
}, (C !== void 0 ? C : null) !== null ? Object.defineProperty(n, "ref", {
|
|
162
162
|
enumerable: !1,
|
|
163
163
|
get: l
|
|
164
164
|
}) : Object.defineProperty(n, "ref", { enumerable: !1, value: null }), n._store = {}, Object.defineProperty(n._store, "validated", {
|
|
@@ -175,441 +175,443 @@ function pt() {
|
|
|
175
175
|
configurable: !1,
|
|
176
176
|
enumerable: !1,
|
|
177
177
|
writable: !0,
|
|
178
|
-
value:
|
|
178
|
+
value: Q
|
|
179
179
|
}), Object.defineProperty(n, "_debugTask", {
|
|
180
180
|
configurable: !1,
|
|
181
181
|
enumerable: !1,
|
|
182
182
|
writable: !0,
|
|
183
|
-
value:
|
|
183
|
+
value: K
|
|
184
184
|
}), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
var
|
|
188
|
-
if (
|
|
189
|
-
if (
|
|
190
|
-
if (
|
|
191
|
-
for (
|
|
192
|
-
|
|
193
|
-
Object.freeze && Object.freeze(
|
|
186
|
+
function R(n, g, T, P, Q, K) {
|
|
187
|
+
var C = g.children;
|
|
188
|
+
if (C !== void 0)
|
|
189
|
+
if (P)
|
|
190
|
+
if (G(C)) {
|
|
191
|
+
for (P = 0; P < C.length; P++)
|
|
192
|
+
v(C[P]);
|
|
193
|
+
Object.freeze && Object.freeze(C);
|
|
194
194
|
} else
|
|
195
195
|
console.error(
|
|
196
196
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
197
197
|
);
|
|
198
|
-
else
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
var ie = Object.keys(
|
|
198
|
+
else v(C);
|
|
199
|
+
if (F.call(g, "key")) {
|
|
200
|
+
C = e(n);
|
|
201
|
+
var ie = Object.keys(g).filter(function(me) {
|
|
202
202
|
return me !== "key";
|
|
203
203
|
});
|
|
204
|
-
|
|
204
|
+
P = 0 < ie.length ? "{key: someKey, " + ie.join(": ..., ") + ": ...}" : "{key: someKey}", ne[C + P] || (ie = 0 < ie.length ? "{" + ie.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
205
|
`A props object containing a "key" prop is being spread into JSX:
|
|
206
206
|
let props = %s;
|
|
207
207
|
<%s {...props} />
|
|
208
208
|
React keys must be passed directly to JSX without using spread:
|
|
209
209
|
let props = %s;
|
|
210
210
|
<%s key={someKey} {...props} />`,
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
P,
|
|
212
|
+
C,
|
|
213
213
|
ie,
|
|
214
|
-
|
|
215
|
-
),
|
|
214
|
+
C
|
|
215
|
+
), ne[C + P] = !0);
|
|
216
216
|
}
|
|
217
|
-
if (
|
|
218
|
-
|
|
219
|
-
for (var ue in
|
|
220
|
-
ue !== "key" && (
|
|
221
|
-
} else
|
|
222
|
-
return
|
|
223
|
-
|
|
217
|
+
if (C = null, T !== void 0 && (r(T), C = "" + T), u(g) && (r(g.key), C = "" + g.key), "key" in g) {
|
|
218
|
+
T = {};
|
|
219
|
+
for (var ue in g)
|
|
220
|
+
ue !== "key" && (T[ue] = g[ue]);
|
|
221
|
+
} else T = g;
|
|
222
|
+
return C && s(
|
|
223
|
+
T,
|
|
224
224
|
typeof n == "function" ? n.displayName || n.name || "Unknown" : n
|
|
225
225
|
), c(
|
|
226
226
|
n,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
227
|
+
C,
|
|
228
|
+
T,
|
|
229
|
+
a(),
|
|
230
|
+
Q,
|
|
231
|
+
K
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
|
-
function w(n) {
|
|
235
|
-
v(n) ? n._store && (n._store.validated = 1) : typeof n == "object" && n !== null && n.$$typeof === T && (n._payload.status === "fulfilled" ? v(n._payload.value) && n._payload.value._store && (n._payload.value._store.validated = 1) : n._store && (n._store.validated = 1));
|
|
236
|
-
}
|
|
237
234
|
function v(n) {
|
|
238
|
-
|
|
235
|
+
b(n) ? n._store && (n._store.validated = 1) : typeof n == "object" && n !== null && n.$$typeof === p && (n._payload.status === "fulfilled" ? b(n._payload.value) && n._payload.value._store && (n._payload.value._store.validated = 1) : n._store && (n._store.validated = 1));
|
|
236
|
+
}
|
|
237
|
+
function b(n) {
|
|
238
|
+
return typeof n == "object" && n !== null && n.$$typeof === I;
|
|
239
239
|
}
|
|
240
|
-
var
|
|
240
|
+
var w = gt, I = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), A = Symbol.for("react.fragment"), M = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), W = Symbol.for("react.consumer"), D = Symbol.for("react.context"), j = Symbol.for("react.forward_ref"), N = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), x = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), Y = Symbol.for("react.activity"), X = Symbol.for("react.client.reference"), z = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, G = Array.isArray, k = console.createTask ? console.createTask : function() {
|
|
241
241
|
return null;
|
|
242
242
|
};
|
|
243
|
-
|
|
243
|
+
w = {
|
|
244
244
|
react_stack_bottom_frame: function(n) {
|
|
245
245
|
return n();
|
|
246
246
|
}
|
|
247
247
|
};
|
|
248
|
-
var
|
|
249
|
-
|
|
248
|
+
var U, V = {}, q = w.react_stack_bottom_frame.bind(
|
|
249
|
+
w,
|
|
250
250
|
o
|
|
251
|
-
)(),
|
|
252
|
-
fe.Fragment =
|
|
253
|
-
var
|
|
254
|
-
return
|
|
251
|
+
)(), $ = k(i(o)), ne = {};
|
|
252
|
+
fe.Fragment = A, fe.jsx = function(n, g, T) {
|
|
253
|
+
var P = 1e4 > z.recentlyCreatedOwnerStacks++;
|
|
254
|
+
return R(
|
|
255
255
|
n,
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
g,
|
|
257
|
+
T,
|
|
258
258
|
!1,
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
P ? Error("react-stack-top-frame") : q,
|
|
260
|
+
P ? k(i(n)) : $
|
|
261
261
|
);
|
|
262
|
-
}, fe.jsxs = function(n,
|
|
263
|
-
var
|
|
264
|
-
return
|
|
262
|
+
}, fe.jsxs = function(n, g, T) {
|
|
263
|
+
var P = 1e4 > z.recentlyCreatedOwnerStacks++;
|
|
264
|
+
return R(
|
|
265
265
|
n,
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
g,
|
|
267
|
+
T,
|
|
268
268
|
!0,
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
P ? Error("react-stack-top-frame") : q,
|
|
270
|
+
P ? k(i(n)) : $
|
|
271
271
|
);
|
|
272
272
|
};
|
|
273
273
|
}()), fe;
|
|
274
274
|
}
|
|
275
|
-
process.env.NODE_ENV === "production" ? we.exports =
|
|
276
|
-
var
|
|
277
|
-
const ze =
|
|
275
|
+
process.env.NODE_ENV === "production" ? we.exports = bt() : we.exports = vt();
|
|
276
|
+
var O = we.exports;
|
|
277
|
+
const ze = ht(null), be = (e) => {
|
|
278
278
|
throw new Error(`Unhandled sidebar side: ${e}`);
|
|
279
|
-
}, ve = { isOpen: !1, anchorState: "closed" },
|
|
279
|
+
}, ve = { isOpen: !1, anchorState: "closed" }, or = ({
|
|
280
280
|
children: e,
|
|
281
281
|
sidebarWidthPx: t,
|
|
282
282
|
transitionMs: r,
|
|
283
283
|
edgeActivationWidthPx: i,
|
|
284
|
-
dragActivationDeltaPx:
|
|
284
|
+
dragActivationDeltaPx: a,
|
|
285
285
|
showOverlay: o,
|
|
286
286
|
isAbsolute: u,
|
|
287
|
-
overlayBackgroundColor:
|
|
287
|
+
overlayBackgroundColor: s,
|
|
288
288
|
toggleIconColor: l,
|
|
289
289
|
toggleIconSizePx: c,
|
|
290
|
-
toggleIconEdgeDistancePx:
|
|
291
|
-
showToggle:
|
|
292
|
-
mediaQueryWidth:
|
|
293
|
-
swipeBarZIndex:
|
|
294
|
-
toggleZIndex:
|
|
290
|
+
toggleIconEdgeDistancePx: R,
|
|
291
|
+
showToggle: v,
|
|
292
|
+
mediaQueryWidth: b,
|
|
293
|
+
swipeBarZIndex: w,
|
|
294
|
+
toggleZIndex: I,
|
|
295
295
|
overlayZIndex: y,
|
|
296
|
-
fadeContent:
|
|
297
|
-
fadeContentTransitionMs:
|
|
296
|
+
fadeContent: A,
|
|
297
|
+
fadeContentTransitionMs: M,
|
|
298
|
+
closeSidebarOnOverlayClick: _
|
|
298
299
|
}) => {
|
|
299
|
-
var Ie,
|
|
300
|
-
const [
|
|
301
|
-
() => Object.values(
|
|
302
|
-
[
|
|
303
|
-
),
|
|
304
|
-
sidebarWidthPx: t ??
|
|
305
|
-
sidebarHeightPx:
|
|
306
|
-
transitionMs: r ??
|
|
307
|
-
edgeActivationWidthPx: i ??
|
|
308
|
-
dragActivationDeltaPx:
|
|
309
|
-
showOverlay: o ??
|
|
310
|
-
isAbsolute: u ??
|
|
311
|
-
overlayBackgroundColor:
|
|
312
|
-
toggleIconColor: l ??
|
|
313
|
-
toggleIconSizePx: c ??
|
|
314
|
-
toggleIconEdgeDistancePx:
|
|
315
|
-
showToggle:
|
|
316
|
-
mediaQueryWidth:
|
|
317
|
-
swipeBarZIndex:
|
|
318
|
-
toggleZIndex:
|
|
319
|
-
overlayZIndex: y ??
|
|
320
|
-
fadeContent:
|
|
321
|
-
fadeContentTransitionMs:
|
|
322
|
-
swipeToOpen:
|
|
323
|
-
swipeToClose:
|
|
324
|
-
midAnchorPoint:
|
|
325
|
-
midAnchorPointPx:
|
|
326
|
-
disabled: !1
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
300
|
+
var Ie, Ce;
|
|
301
|
+
const [W, D] = re(null), [j, N] = re(!1), [f, x] = re(!1), [p, Y] = re({}), [X, z] = re({}), F = L(null), G = L(null), k = L(null), U = L(null), [V, q] = re({}), [$, ne] = re({}), n = L(/* @__PURE__ */ new Map()), g = L(null), T = L([]), P = ((Ie = V.primary) == null ? void 0 : Ie.isOpen) ?? !1, Q = ((Ce = V.primary) == null ? void 0 : Ce.anchorState) ?? "closed", K = Ze(
|
|
302
|
+
() => Object.values(V).some((d) => d.isOpen),
|
|
303
|
+
[V]
|
|
304
|
+
), C = n.current.get("primary"), ie = (C == null ? void 0 : C.sidebarRef) ?? { current: null }, ue = (C == null ? void 0 : C.toggleRef) ?? { current: null }, me = $.primary ?? {}, [Ke, et] = re({
|
|
305
|
+
sidebarWidthPx: t ?? yt,
|
|
306
|
+
sidebarHeightPx: De,
|
|
307
|
+
transitionMs: r ?? pt,
|
|
308
|
+
edgeActivationWidthPx: i ?? wt,
|
|
309
|
+
dragActivationDeltaPx: a ?? St,
|
|
310
|
+
showOverlay: o ?? xt,
|
|
311
|
+
isAbsolute: u ?? Tt,
|
|
312
|
+
overlayBackgroundColor: s ?? Ve,
|
|
313
|
+
toggleIconColor: l ?? Ot,
|
|
314
|
+
toggleIconSizePx: c ?? Et,
|
|
315
|
+
toggleIconEdgeDistancePx: R ?? At,
|
|
316
|
+
showToggle: v ?? Pt,
|
|
317
|
+
mediaQueryWidth: b ?? Se,
|
|
318
|
+
swipeBarZIndex: w ?? It,
|
|
319
|
+
toggleZIndex: I ?? Ct,
|
|
320
|
+
overlayZIndex: y ?? _t,
|
|
321
|
+
fadeContent: A ?? Dt,
|
|
322
|
+
fadeContentTransitionMs: M ?? Lt,
|
|
323
|
+
swipeToOpen: Xt,
|
|
324
|
+
swipeToClose: Yt,
|
|
325
|
+
midAnchorPoint: $t,
|
|
326
|
+
midAnchorPointPx: De / 3,
|
|
327
|
+
disabled: !1,
|
|
328
|
+
closeSidebarOnOverlayClick: _ ?? Rt
|
|
329
|
+
}), tt = H((d, h) => {
|
|
330
|
+
n.current.set(d, h), q((m) => m[d] ? m : { ...m, [d]: { ...ve } });
|
|
331
|
+
}, []), rt = H((d) => {
|
|
332
|
+
n.current.delete(d), q((h) => {
|
|
333
|
+
const m = { ...h };
|
|
334
|
+
return delete m[d], m;
|
|
335
|
+
}), ne((h) => {
|
|
336
|
+
const m = { ...h };
|
|
337
|
+
return delete m[d], m;
|
|
336
338
|
});
|
|
337
|
-
}, []),
|
|
338
|
-
ne((
|
|
339
|
-
}, []), ee =
|
|
340
|
-
|
|
341
|
-
const S =
|
|
342
|
-
return S.isOpen ===
|
|
339
|
+
}, []), nt = H((d) => n.current.get(d), []), it = H((d, h) => {
|
|
340
|
+
ne((m) => m[d] === h ? m : { ...m, [d]: h });
|
|
341
|
+
}, []), ee = H((d, h) => {
|
|
342
|
+
q((m) => {
|
|
343
|
+
const S = m[d] ?? ve;
|
|
344
|
+
return S.isOpen === h ? m : { ...m, [d]: { ...S, isOpen: h } };
|
|
343
345
|
});
|
|
344
|
-
}, []), te =
|
|
345
|
-
|
|
346
|
-
const S =
|
|
347
|
-
return S.anchorState ===
|
|
346
|
+
}, []), te = H((d, h) => {
|
|
347
|
+
q((m) => {
|
|
348
|
+
const S = m[d] ?? ve;
|
|
349
|
+
return S.anchorState === h ? m : { ...m, [d]: { ...S, anchorState: h } };
|
|
348
350
|
});
|
|
349
351
|
}, []);
|
|
350
|
-
|
|
352
|
+
Z(() => (j || f || K ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
351
353
|
document.body.style.overflow = "";
|
|
352
|
-
}), [
|
|
354
|
+
}), [j, f, K]), Z(() => {
|
|
353
355
|
var d;
|
|
354
356
|
if (p.fadeContent === !1) {
|
|
355
|
-
const
|
|
356
|
-
|
|
357
|
+
const h = (d = F.current) == null ? void 0 : d.firstElementChild;
|
|
358
|
+
h && (h.style.opacity = "1");
|
|
357
359
|
}
|
|
358
|
-
}, [p.fadeContent]),
|
|
360
|
+
}, [p.fadeContent]), Z(() => {
|
|
359
361
|
var d;
|
|
360
|
-
if (
|
|
361
|
-
const
|
|
362
|
-
|
|
362
|
+
if (X.fadeContent === !1) {
|
|
363
|
+
const h = (d = G.current) == null ? void 0 : d.firstElementChild;
|
|
364
|
+
h && (h.style.opacity = "1");
|
|
363
365
|
}
|
|
364
|
-
}, [
|
|
366
|
+
}, [X.fadeContent]), Z(() => {
|
|
365
367
|
var d;
|
|
366
|
-
for (const [
|
|
367
|
-
if (
|
|
368
|
-
const S =
|
|
369
|
-
|
|
368
|
+
for (const [h, m] of Object.entries($))
|
|
369
|
+
if (m.fadeContent === !1) {
|
|
370
|
+
const S = n.current.get(h), E = (d = S == null ? void 0 : S.sidebarRef.current) == null ? void 0 : d.firstElementChild;
|
|
371
|
+
E && (E.style.opacity = "1");
|
|
370
372
|
}
|
|
371
|
-
}, [
|
|
372
|
-
const
|
|
373
|
-
|
|
374
|
-
}, []),
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
}, []), Pe =
|
|
378
|
-
const
|
|
379
|
-
|
|
380
|
-
([
|
|
381
|
-
) ||
|
|
382
|
-
}, []),
|
|
383
|
-
(d,
|
|
384
|
-
const
|
|
385
|
-
|
|
373
|
+
}, [$]);
|
|
374
|
+
const ot = H((d) => {
|
|
375
|
+
et((h) => ({ ...h, ...d }));
|
|
376
|
+
}, []), ae = H((d) => {
|
|
377
|
+
const h = T.current, m = h.indexOf(d);
|
|
378
|
+
m !== -1 && h.splice(m, 1), h.push(d), D("bottom");
|
|
379
|
+
}, []), Pe = H((d) => {
|
|
380
|
+
const h = T.current, m = h.indexOf(d);
|
|
381
|
+
m !== -1 && h.splice(m, 1), q((S) => (Object.entries(S).some(
|
|
382
|
+
([B, oe]) => B !== d && oe.isOpen
|
|
383
|
+
) || D(null), S));
|
|
384
|
+
}, []), at = H(
|
|
385
|
+
(d, h) => {
|
|
386
|
+
const m = (S, E, B, oe) => {
|
|
387
|
+
pe({
|
|
386
388
|
side: d,
|
|
387
389
|
ref: S,
|
|
388
|
-
options:
|
|
389
|
-
toggleRef:
|
|
390
|
+
options: E,
|
|
391
|
+
toggleRef: B,
|
|
390
392
|
afterApply: () => {
|
|
391
|
-
oe(!0),
|
|
393
|
+
oe(!0), D(d);
|
|
392
394
|
}
|
|
393
395
|
});
|
|
394
396
|
};
|
|
395
397
|
if (d === "left") {
|
|
396
398
|
if (p.disabled) return;
|
|
397
|
-
|
|
399
|
+
m(F, p, k, N);
|
|
398
400
|
} else if (d === "right") {
|
|
399
|
-
if (
|
|
400
|
-
|
|
401
|
+
if (X.disabled) return;
|
|
402
|
+
m(G, X, U, x);
|
|
401
403
|
} else if (d === "bottom") {
|
|
402
|
-
const S = (
|
|
403
|
-
if (!
|
|
404
|
-
const oe =
|
|
405
|
-
_e &&
|
|
406
|
-
ref:
|
|
407
|
-
options:
|
|
408
|
-
toggleRef:
|
|
404
|
+
const S = (h == null ? void 0 : h.id) ?? "primary", E = $[S], B = n.current.get(S);
|
|
405
|
+
if (!E || !B || E.disabled) return;
|
|
406
|
+
const oe = E.sidebarHeightPx ?? 0, dt = E.mediaQueryWidth ?? 640, _e = window.innerWidth < dt, ft = _e ? E.midAnchorPointPx ?? 0 : oe;
|
|
407
|
+
_e && E.midAnchorPoint && !E.swipeToOpen && ft < oe ? $e({
|
|
408
|
+
ref: B.sidebarRef,
|
|
409
|
+
options: E,
|
|
410
|
+
toggleRef: B.toggleRef,
|
|
409
411
|
afterApply: () => {
|
|
410
|
-
ee(S, !0), te(S, "midAnchor"),
|
|
412
|
+
ee(S, !0), te(S, "midAnchor"), ae(S);
|
|
411
413
|
}
|
|
412
|
-
}) :
|
|
414
|
+
}) : pe({
|
|
413
415
|
side: d,
|
|
414
|
-
ref:
|
|
415
|
-
options:
|
|
416
|
-
toggleRef:
|
|
416
|
+
ref: B.sidebarRef,
|
|
417
|
+
options: E,
|
|
418
|
+
toggleRef: B.toggleRef,
|
|
417
419
|
afterApply: () => {
|
|
418
|
-
ee(S, !0), te(S, "open"),
|
|
420
|
+
ee(S, !0), te(S, "open"), ae(S);
|
|
419
421
|
}
|
|
420
422
|
});
|
|
421
423
|
} else
|
|
422
|
-
|
|
424
|
+
be(d);
|
|
423
425
|
},
|
|
424
|
-
[p,
|
|
425
|
-
), st =
|
|
426
|
-
(d,
|
|
426
|
+
[p, X, $, ee, te, ae]
|
|
427
|
+
), st = H(
|
|
428
|
+
(d, h) => {
|
|
427
429
|
if (d !== "bottom") return;
|
|
428
|
-
const
|
|
429
|
-
!S || !
|
|
430
|
-
ref:
|
|
430
|
+
const m = (h == null ? void 0 : h.id) ?? "primary", S = $[m], E = n.current.get(m);
|
|
431
|
+
!S || !E || S.disabled || $e({
|
|
432
|
+
ref: E.sidebarRef,
|
|
431
433
|
options: S,
|
|
432
|
-
toggleRef:
|
|
434
|
+
toggleRef: E.toggleRef,
|
|
433
435
|
afterApply: () => {
|
|
434
|
-
ee(
|
|
436
|
+
ee(m, !0), te(m, "midAnchor"), ae(m);
|
|
435
437
|
}
|
|
436
438
|
});
|
|
437
439
|
},
|
|
438
|
-
[
|
|
439
|
-
),
|
|
440
|
-
(d,
|
|
440
|
+
[$, ee, te, ae]
|
|
441
|
+
), ct = H(
|
|
442
|
+
(d, h) => {
|
|
441
443
|
if (d !== "bottom") return;
|
|
442
|
-
const
|
|
443
|
-
!S || !
|
|
444
|
+
const m = (h == null ? void 0 : h.id) ?? "primary", S = $[m], E = n.current.get(m);
|
|
445
|
+
!S || !E || S.disabled || pe({
|
|
444
446
|
side: d,
|
|
445
|
-
ref:
|
|
447
|
+
ref: E.sidebarRef,
|
|
446
448
|
options: S,
|
|
447
|
-
toggleRef:
|
|
449
|
+
toggleRef: E.toggleRef,
|
|
448
450
|
afterApply: () => {
|
|
449
|
-
ee(
|
|
451
|
+
ee(m, !0), te(m, "open"), ae(m);
|
|
450
452
|
}
|
|
451
453
|
});
|
|
452
454
|
},
|
|
453
|
-
[
|
|
454
|
-
),
|
|
455
|
-
(d,
|
|
456
|
-
const
|
|
455
|
+
[$, ee, te, ae]
|
|
456
|
+
), lt = H(
|
|
457
|
+
(d, h) => {
|
|
458
|
+
const m = (S, E, B, oe) => {
|
|
457
459
|
Ye({
|
|
458
460
|
ref: S,
|
|
459
|
-
options:
|
|
460
|
-
toggleRef:
|
|
461
|
+
options: E,
|
|
462
|
+
toggleRef: B,
|
|
461
463
|
side: d,
|
|
462
464
|
afterApply: () => {
|
|
463
|
-
oe(!1),
|
|
465
|
+
oe(!1), D(null);
|
|
464
466
|
}
|
|
465
467
|
});
|
|
466
468
|
};
|
|
467
469
|
if (d === "left") {
|
|
468
470
|
if (p.disabled) return;
|
|
469
|
-
|
|
471
|
+
m(F, p, k, N);
|
|
470
472
|
} else if (d === "right") {
|
|
471
|
-
if (
|
|
472
|
-
|
|
473
|
+
if (X.disabled) return;
|
|
474
|
+
m(G, X, U, x);
|
|
473
475
|
} else if (d === "bottom") {
|
|
474
|
-
const S = (
|
|
475
|
-
if (!
|
|
476
|
+
const S = (h == null ? void 0 : h.id) ?? "primary", E = $[S], B = n.current.get(S);
|
|
477
|
+
if (!E || !B || E.disabled) return;
|
|
476
478
|
Ye({
|
|
477
|
-
ref:
|
|
478
|
-
options:
|
|
479
|
-
toggleRef:
|
|
479
|
+
ref: B.sidebarRef,
|
|
480
|
+
options: E,
|
|
481
|
+
toggleRef: B.toggleRef,
|
|
480
482
|
side: d,
|
|
481
483
|
afterApply: () => {
|
|
482
484
|
ee(S, !1), te(S, "closed"), Pe(S);
|
|
483
485
|
}
|
|
484
486
|
});
|
|
485
487
|
} else
|
|
486
|
-
|
|
488
|
+
be(d);
|
|
487
489
|
},
|
|
488
|
-
[p,
|
|
489
|
-
),
|
|
490
|
-
(d,
|
|
490
|
+
[p, X, $, ee, te, Pe]
|
|
491
|
+
), ut = H(
|
|
492
|
+
(d, h, m) => {
|
|
491
493
|
if (d === "left")
|
|
492
494
|
We({
|
|
493
495
|
ref: F,
|
|
494
|
-
toggleRef:
|
|
496
|
+
toggleRef: k,
|
|
495
497
|
options: p,
|
|
496
|
-
translateX:
|
|
498
|
+
translateX: h
|
|
497
499
|
});
|
|
498
500
|
else if (d === "right")
|
|
499
501
|
We({
|
|
500
|
-
ref:
|
|
501
|
-
toggleRef:
|
|
502
|
-
options:
|
|
503
|
-
translateX:
|
|
502
|
+
ref: G,
|
|
503
|
+
toggleRef: U,
|
|
504
|
+
options: X,
|
|
505
|
+
translateX: h
|
|
504
506
|
});
|
|
505
507
|
else if (d === "bottom") {
|
|
506
|
-
const S = (
|
|
507
|
-
if (!
|
|
508
|
-
|
|
509
|
-
ref:
|
|
510
|
-
toggleRef:
|
|
511
|
-
options:
|
|
512
|
-
translateY:
|
|
508
|
+
const S = (m == null ? void 0 : m.id) ?? "primary", E = $[S], B = n.current.get(S);
|
|
509
|
+
if (!E || !B) return;
|
|
510
|
+
Vt({
|
|
511
|
+
ref: B.sidebarRef,
|
|
512
|
+
toggleRef: B.toggleRef,
|
|
513
|
+
options: E,
|
|
514
|
+
translateY: h
|
|
513
515
|
});
|
|
514
516
|
} else
|
|
515
|
-
|
|
517
|
+
be(d);
|
|
516
518
|
},
|
|
517
|
-
[p,
|
|
519
|
+
[p, X, $]
|
|
518
520
|
);
|
|
519
|
-
return /* @__PURE__ */
|
|
521
|
+
return /* @__PURE__ */ O.jsx(
|
|
520
522
|
ze.Provider,
|
|
521
523
|
{
|
|
522
524
|
value: {
|
|
523
|
-
lockedSidebar:
|
|
524
|
-
setLockedSidebar:
|
|
525
|
+
lockedSidebar: W,
|
|
526
|
+
setLockedSidebar: D,
|
|
525
527
|
leftSidebarRef: F,
|
|
526
|
-
rightSidebarRef:
|
|
527
|
-
isLeftOpen:
|
|
528
|
-
isRightOpen:
|
|
528
|
+
rightSidebarRef: G,
|
|
529
|
+
isLeftOpen: j,
|
|
530
|
+
isRightOpen: f,
|
|
529
531
|
// Backwards-compat aliases for primary bottom sidebar
|
|
530
|
-
isBottomOpen:
|
|
531
|
-
bottomAnchorState:
|
|
532
|
-
bottomSidebarRef:
|
|
533
|
-
bottomToggleRef:
|
|
534
|
-
bottomSidebarOptions:
|
|
532
|
+
isBottomOpen: P,
|
|
533
|
+
bottomAnchorState: Q,
|
|
534
|
+
bottomSidebarRef: ie,
|
|
535
|
+
bottomToggleRef: ue,
|
|
536
|
+
bottomSidebarOptions: me,
|
|
535
537
|
// Multi-instance bottom sidebar
|
|
536
|
-
bottomSidebars:
|
|
537
|
-
bottomSidebarOptionsMap:
|
|
538
|
-
registerBottomSidebar:
|
|
539
|
-
unregisterBottomSidebar:
|
|
540
|
-
getBottomSidebarRefs:
|
|
541
|
-
activeBottomDragIdRef:
|
|
542
|
-
bottomFocusStackRef:
|
|
538
|
+
bottomSidebars: V,
|
|
539
|
+
bottomSidebarOptionsMap: $,
|
|
540
|
+
registerBottomSidebar: tt,
|
|
541
|
+
unregisterBottomSidebar: rt,
|
|
542
|
+
getBottomSidebarRefs: nt,
|
|
543
|
+
activeBottomDragIdRef: g,
|
|
544
|
+
bottomFocusStackRef: T,
|
|
543
545
|
// Functions
|
|
544
|
-
openSidebar:
|
|
545
|
-
openSidebarFully:
|
|
546
|
+
openSidebar: at,
|
|
547
|
+
openSidebarFully: ct,
|
|
546
548
|
openSidebarToMidAnchor: st,
|
|
547
|
-
closeSidebar:
|
|
548
|
-
dragSidebar:
|
|
549
|
-
globalOptions:
|
|
550
|
-
setGlobalOptions:
|
|
549
|
+
closeSidebar: lt,
|
|
550
|
+
dragSidebar: ut,
|
|
551
|
+
globalOptions: Ke,
|
|
552
|
+
setGlobalOptions: ot,
|
|
551
553
|
leftSidebarOptions: p,
|
|
552
|
-
rightSidebarOptions:
|
|
553
|
-
setLeftSidebarOptions:
|
|
554
|
-
setRightSidebarOptions:
|
|
555
|
-
setBottomSidebarOptionsById:
|
|
556
|
-
leftToggleRef:
|
|
557
|
-
rightToggleRef:
|
|
554
|
+
rightSidebarOptions: X,
|
|
555
|
+
setLeftSidebarOptions: Y,
|
|
556
|
+
setRightSidebarOptions: z,
|
|
557
|
+
setBottomSidebarOptionsById: it,
|
|
558
|
+
leftToggleRef: k,
|
|
559
|
+
rightToggleRef: U
|
|
558
560
|
},
|
|
559
561
|
children: e
|
|
560
562
|
}
|
|
561
563
|
);
|
|
562
|
-
},
|
|
563
|
-
const e =
|
|
564
|
+
}, J = () => {
|
|
565
|
+
const e = mt(ze);
|
|
564
566
|
if (!e)
|
|
565
567
|
throw new Error("useSwipeBarContext must be used within SwipeBarProvider");
|
|
566
568
|
return e;
|
|
567
|
-
},
|
|
569
|
+
}, pt = 300, wt = 40, St = 20, yt = 320, De = window.innerHeight, xt = !0, Rt = !0, Tt = !1, Ve = "rgba(0, 0, 0, 0.5)", ye = "rgb(36,36,36)", Ot = "white", Et = 40, At = 40, Pt = !0, Se = 640, It = 30, Ct = 15, _t = 20, Xe = 0.6, Mt = 200, Lt = 100, Dt = !1, Xt = !0, Yt = !0, $t = !1, se = "cubic-bezier(0.22, 1, 0.36, 1)", qe = {
|
|
568
570
|
width: 0,
|
|
569
571
|
top: 0,
|
|
570
572
|
bottom: 0,
|
|
571
573
|
flexShrink: 0,
|
|
572
574
|
overflowX: "hidden",
|
|
573
575
|
willChange: "transform"
|
|
574
|
-
},
|
|
576
|
+
}, Wt = {
|
|
575
577
|
transform: "translateX(-100%)"
|
|
576
|
-
},
|
|
578
|
+
}, Bt = {
|
|
577
579
|
transform: "translateX(100%)"
|
|
578
|
-
},
|
|
580
|
+
}, jt = {
|
|
579
581
|
position: "fixed",
|
|
580
582
|
left: 0,
|
|
581
583
|
top: 0,
|
|
582
584
|
bottom: 0
|
|
583
|
-
},
|
|
585
|
+
}, kt = {
|
|
584
586
|
position: "fixed",
|
|
585
587
|
right: 0,
|
|
586
588
|
top: 0,
|
|
587
589
|
bottom: 0
|
|
588
|
-
},
|
|
590
|
+
}, Nt = {
|
|
589
591
|
height: 0,
|
|
590
592
|
left: 0,
|
|
591
593
|
right: 0,
|
|
592
594
|
flexShrink: 0,
|
|
593
595
|
overflowY: "hidden",
|
|
594
596
|
willChange: "transform"
|
|
595
|
-
}, Nt = {
|
|
596
|
-
transform: "translateY(100%)"
|
|
597
597
|
}, Ft = {
|
|
598
|
+
transform: "translateY(100%)"
|
|
599
|
+
}, Ht = {
|
|
598
600
|
position: "fixed",
|
|
599
601
|
bottom: 0,
|
|
600
602
|
left: 0,
|
|
601
603
|
right: 0
|
|
602
|
-
},
|
|
604
|
+
}, Gt = {
|
|
603
605
|
position: "fixed",
|
|
604
606
|
top: 0,
|
|
605
607
|
left: 0,
|
|
606
608
|
width: "100%",
|
|
607
609
|
height: "100%",
|
|
608
|
-
backgroundColor:
|
|
610
|
+
backgroundColor: Ve,
|
|
609
611
|
transitionProperty: "opacity",
|
|
610
612
|
pointerEvents: "none",
|
|
611
613
|
opacity: 0
|
|
612
|
-
},
|
|
614
|
+
}, Ut = {
|
|
613
615
|
opacity: 1,
|
|
614
616
|
pointerEvents: "auto"
|
|
615
617
|
}, Qe = {
|
|
@@ -619,7 +621,7 @@ const ze = gt(null), pe = (e) => {
|
|
|
619
621
|
width: "1px",
|
|
620
622
|
display: "flex",
|
|
621
623
|
justifyContent: "center"
|
|
622
|
-
},
|
|
624
|
+
}, Zt = {
|
|
623
625
|
position: "fixed",
|
|
624
626
|
bottom: 0,
|
|
625
627
|
left: "50%",
|
|
@@ -627,7 +629,7 @@ const ze = gt(null), pe = (e) => {
|
|
|
627
629
|
height: "1px",
|
|
628
630
|
display: "flex",
|
|
629
631
|
alignItems: "center"
|
|
630
|
-
},
|
|
632
|
+
}, zt = {
|
|
631
633
|
position: "relative",
|
|
632
634
|
cursor: "pointer",
|
|
633
635
|
display: "flex",
|
|
@@ -639,30 +641,30 @@ const ze = gt(null), pe = (e) => {
|
|
|
639
641
|
}, ge = (e) => {
|
|
640
642
|
var t;
|
|
641
643
|
return (t = e.current) == null ? void 0 : t.firstElementChild;
|
|
642
|
-
},
|
|
644
|
+
}, pe = ({
|
|
643
645
|
ref: e,
|
|
644
646
|
side: t,
|
|
645
647
|
options: r,
|
|
646
648
|
toggleRef: i,
|
|
647
|
-
afterApply:
|
|
649
|
+
afterApply: a
|
|
648
650
|
}) => {
|
|
649
651
|
const o = ge(e), u = r.transitionMs ? r.transitionMs / 2 : 0;
|
|
650
652
|
o && r.fadeContent && (o.style.opacity = "0");
|
|
651
|
-
let
|
|
652
|
-
t === "left" || t === "right" ? (
|
|
653
|
+
let s, l;
|
|
654
|
+
t === "left" || t === "right" ? (s = "width", l = r.sidebarWidthPx, o && l && (o.style.minWidth = `${l}px`)) : t === "bottom" ? (s = "height", l = r.sidebarHeightPx, o && l && (o.style.minHeight = `${l}px`)) : xe(t), requestAnimationFrame(() => {
|
|
653
655
|
if (!e.current) return;
|
|
654
|
-
const c = `transform ${r.transitionMs}ms ${
|
|
655
|
-
e.current.style.transition = `${c}${
|
|
656
|
+
const c = `transform ${r.transitionMs}ms ${se}`, R = r.isAbsolute ? "" : `, ${s} ${r.transitionMs}ms ${se}`;
|
|
657
|
+
e.current.style.transition = `${c}${R}`, o && r.fadeContent && (o.style.transition = `opacity ${r.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
|
|
656
658
|
if (e.current) {
|
|
657
659
|
if (e.current.style.transform = t === "bottom" ? "translateY(0px)" : "translateX(0px)", !r.isAbsolute)
|
|
658
|
-
e.current.style[
|
|
659
|
-
else if (e.current.style[
|
|
660
|
-
const
|
|
661
|
-
e.current.style.transition = c, e.current.style[
|
|
660
|
+
e.current.style[s] = `${l}px`;
|
|
661
|
+
else if (e.current.style[s] !== `${l}px`) {
|
|
662
|
+
const v = e.current.style.transition;
|
|
663
|
+
e.current.style.transition = c, e.current.style[s] = `${l}px`, e.current.style.transition = v;
|
|
662
664
|
}
|
|
663
665
|
i.current && l && (i.current.style.opacity = "1", t === "left" ? i.current.style.transform = `translateY(-50%) translateX(${l}px)` : t === "right" ? i.current.style.transform = `translateY(-50%) translateX(-${l}px)` : t === "bottom" && (i.current.style.transform = `translateX(-50%) translateY(-${l}px)`)), o && r.fadeContent && setTimeout(() => {
|
|
664
666
|
o.style.opacity = "1";
|
|
665
|
-
}, u),
|
|
667
|
+
}, u), a();
|
|
666
668
|
}
|
|
667
669
|
});
|
|
668
670
|
}), setTimeout(() => {
|
|
@@ -672,15 +674,15 @@ const ze = gt(null), pe = (e) => {
|
|
|
672
674
|
options: t,
|
|
673
675
|
side: r,
|
|
674
676
|
toggleRef: i,
|
|
675
|
-
afterApply:
|
|
677
|
+
afterApply: a
|
|
676
678
|
}) => {
|
|
677
679
|
const o = ge(e);
|
|
678
680
|
let u;
|
|
679
681
|
r === "left" || r === "right" ? (u = "width", o && t.sidebarWidthPx && (o.style.minWidth = `${t.sidebarWidthPx}px`)) : r === "bottom" ? (u = "height", o && t.sidebarHeightPx && (o.style.minHeight = `${t.sidebarHeightPx}px`)) : xe(r), requestAnimationFrame(() => {
|
|
680
682
|
if (!e.current) return;
|
|
681
|
-
const
|
|
682
|
-
e.current.style.transition = `${
|
|
683
|
-
e.current && (r === "left" ? (e.current.style.transform = "translateX(-100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "right" ? (e.current.style.transform = "translateX(100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "bottom" && (e.current.style.transform = "translateY(100%)", t.isAbsolute || (e.current.style.height = "0px")), i.current && (i.current.style.opacity = "1", r === "left" || r === "right" ? i.current.style.transform = "translateY(-50%)" : r === "bottom" && (i.current.style.transform = "translateX(-50%)")), o && t.fadeContent && (o.style.opacity = "0"),
|
|
683
|
+
const s = `transform ${t.transitionMs}ms ${se}`, l = t.isAbsolute ? "" : `, ${u} ${t.transitionMs}ms ${se}`;
|
|
684
|
+
e.current.style.transition = `${s}${l}`, o && t.fadeContent && (o.style.transition = `opacity ${t.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
|
|
685
|
+
e.current && (r === "left" ? (e.current.style.transform = "translateX(-100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "right" ? (e.current.style.transform = "translateX(100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "bottom" && (e.current.style.transform = "translateY(100%)", t.isAbsolute || (e.current.style.height = "0px")), i.current && (i.current.style.opacity = "1", r === "left" || r === "right" ? i.current.style.transform = "translateY(-50%)" : r === "bottom" && (i.current.style.transform = "translateX(-50%)")), o && t.fadeContent && (o.style.opacity = "0"), a());
|
|
684
686
|
});
|
|
685
687
|
});
|
|
686
688
|
}, $e = ({
|
|
@@ -689,21 +691,21 @@ const ze = gt(null), pe = (e) => {
|
|
|
689
691
|
toggleRef: r,
|
|
690
692
|
afterApply: i
|
|
691
693
|
}) => {
|
|
692
|
-
const
|
|
693
|
-
|
|
694
|
+
const a = ge(e), o = t.transitionMs ? t.transitionMs / 2 : 0;
|
|
695
|
+
a && t.fadeContent && (a.style.opacity = "0"), a && t.midAnchorPointPx && (a.style.minHeight = `${t.sidebarHeightPx}px`), requestAnimationFrame(() => {
|
|
694
696
|
if (!e.current) return;
|
|
695
|
-
const u = `transform ${t.transitionMs}ms ${
|
|
696
|
-
e.current.style.transition = `${u}${
|
|
697
|
+
const u = `transform ${t.transitionMs}ms ${se}`, s = t.isAbsolute ? "" : `, height ${t.transitionMs}ms ${se}`;
|
|
698
|
+
e.current.style.transition = `${u}${s}`, a && t.fadeContent && (a.style.transition = `opacity ${t.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
|
|
697
699
|
if (!e.current) return;
|
|
698
|
-
const l = t.midAnchorPointPx ?? 0, c = t.sidebarHeightPx ?? 0,
|
|
699
|
-
if (e.current.style.transform = `translateY(${
|
|
700
|
+
const l = t.midAnchorPointPx ?? 0, c = t.sidebarHeightPx ?? 0, R = c - l;
|
|
701
|
+
if (e.current.style.transform = `translateY(${R}px)`, !t.isAbsolute)
|
|
700
702
|
e.current.style.height = `${c}px`;
|
|
701
703
|
else if (e.current.style.height !== `${c}px`) {
|
|
702
|
-
const
|
|
703
|
-
e.current.style.transition = u, e.current.style.height = `${c}px`, e.current.style.transition =
|
|
704
|
+
const v = e.current.style.transition;
|
|
705
|
+
e.current.style.transition = u, e.current.style.height = `${c}px`, e.current.style.transition = v;
|
|
704
706
|
}
|
|
705
|
-
r.current && (r.current.style.opacity = "1", r.current.style.transform = `translateX(-50%) translateY(-${l}px)`),
|
|
706
|
-
|
|
707
|
+
r.current && (r.current.style.opacity = "1", r.current.style.transform = `translateX(-50%) translateY(-${l}px)`), a && t.fadeContent && setTimeout(() => {
|
|
708
|
+
a.style.opacity = "1";
|
|
707
709
|
}, o), i();
|
|
708
710
|
});
|
|
709
711
|
}), setTimeout(() => {
|
|
@@ -715,37 +717,37 @@ const ze = gt(null), pe = (e) => {
|
|
|
715
717
|
translateX: i
|
|
716
718
|
}) => {
|
|
717
719
|
!e.current || i === null || (e.current.style.transition = "none", requestAnimationFrame(() => {
|
|
718
|
-
const
|
|
720
|
+
const a = ge(e);
|
|
719
721
|
if (e.current) {
|
|
720
|
-
if (
|
|
722
|
+
if (a && r.fadeContent && (a.style.opacity = "0"), a && r.sidebarWidthPx && (a.style.minWidth = `${r.sidebarWidthPx}px`), !r.isAbsolute) {
|
|
721
723
|
const o = `${r.sidebarWidthPx}px`;
|
|
722
724
|
e.current.style.width !== o && (e.current.style.width = o);
|
|
723
725
|
}
|
|
724
726
|
e.current.style.transform = `translateX(${i}px)`, t.current && (t.current.style.opacity = "0", t.current.style.transform = `translateY(-50%) translateX(${i}px)`);
|
|
725
727
|
}
|
|
726
728
|
}));
|
|
727
|
-
},
|
|
729
|
+
}, Vt = ({
|
|
728
730
|
ref: e,
|
|
729
731
|
toggleRef: t,
|
|
730
732
|
options: r,
|
|
731
733
|
translateY: i
|
|
732
734
|
}) => {
|
|
733
735
|
!e.current || i === null || (e.current.style.transition = "none", requestAnimationFrame(() => {
|
|
734
|
-
const
|
|
736
|
+
const a = ge(e);
|
|
735
737
|
if (e.current) {
|
|
736
|
-
if (
|
|
738
|
+
if (a && r.fadeContent && (a.style.opacity = "0"), a && r.sidebarHeightPx && (a.style.minHeight = `${r.sidebarHeightPx}px`), !r.isAbsolute) {
|
|
737
739
|
const o = `${r.sidebarHeightPx}px`;
|
|
738
740
|
e.current.style.height !== o && (e.current.style.height = o);
|
|
739
741
|
}
|
|
740
742
|
e.current.style.transform = `translateY(${i}px)`, t.current && (t.current.style.opacity = "0", t.current.style.transform = `translateX(-50%) translateY(${i}px)`);
|
|
741
743
|
}
|
|
742
744
|
}));
|
|
743
|
-
}, he = ({ refs: e, clientX: t, clientY: r, touchId: i, isMouse:
|
|
745
|
+
}, he = ({ refs: e, clientX: t, clientY: r, touchId: i, isMouse: a }) => {
|
|
744
746
|
e.draggingRef.current = {
|
|
745
747
|
startX: t,
|
|
746
748
|
startY: r,
|
|
747
749
|
activeTouchId: i,
|
|
748
|
-
isMouse:
|
|
750
|
+
isMouse: a,
|
|
749
751
|
isActivated: !1
|
|
750
752
|
}, e.currentXRef.current = t, e.prevXRef.current = t;
|
|
751
753
|
}, Be = ({
|
|
@@ -753,18 +755,18 @@ const ze = gt(null), pe = (e) => {
|
|
|
753
755
|
clientX: t,
|
|
754
756
|
clientY: r,
|
|
755
757
|
touchId: i,
|
|
756
|
-
isMouse:
|
|
758
|
+
isMouse: a
|
|
757
759
|
}) => {
|
|
758
760
|
e.draggingRef.current = {
|
|
759
761
|
startX: t,
|
|
760
762
|
startY: r,
|
|
761
763
|
activeTouchId: i,
|
|
762
|
-
isMouse:
|
|
764
|
+
isMouse: a,
|
|
763
765
|
isActivated: !1
|
|
764
766
|
}, e.currentYRef.current = r, e.prevYRef.current = r;
|
|
765
767
|
}, Je = ({ refs: e, dragSidebar: t, onDeactivate: r }) => {
|
|
766
768
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null, t(null), r();
|
|
767
|
-
},
|
|
769
|
+
}, qt = ({ refs: e, dragSidebar: t, onDeactivate: r }) => {
|
|
768
770
|
e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null, t(null);
|
|
769
771
|
}, ce = (e) => e instanceof Element ? !!e.closest("input, textarea, [contenteditable='true']") : !1;
|
|
770
772
|
function je(e) {
|
|
@@ -789,109 +791,112 @@ const Re = (e, t) => {
|
|
|
789
791
|
if (e[r].identifier === t)
|
|
790
792
|
return !0;
|
|
791
793
|
return !1;
|
|
792
|
-
},
|
|
794
|
+
}, Oe = (e, t, r) => {
|
|
793
795
|
const {
|
|
794
796
|
globalOptions: i,
|
|
795
|
-
setLeftSidebarOptions:
|
|
797
|
+
setLeftSidebarOptions: a,
|
|
796
798
|
setRightSidebarOptions: o,
|
|
797
799
|
setBottomSidebarOptionsById: u
|
|
798
|
-
} =
|
|
799
|
-
sidebarWidthPx:
|
|
800
|
+
} = J(), {
|
|
801
|
+
sidebarWidthPx: s,
|
|
800
802
|
sidebarHeightPx: l,
|
|
801
803
|
transitionMs: c,
|
|
802
|
-
edgeActivationWidthPx:
|
|
803
|
-
dragActivationDeltaPx:
|
|
804
|
-
showOverlay:
|
|
805
|
-
isAbsolute:
|
|
806
|
-
overlayBackgroundColor:
|
|
804
|
+
edgeActivationWidthPx: R,
|
|
805
|
+
dragActivationDeltaPx: v,
|
|
806
|
+
showOverlay: b,
|
|
807
|
+
isAbsolute: w,
|
|
808
|
+
overlayBackgroundColor: I,
|
|
807
809
|
toggleIconColor: y,
|
|
808
|
-
toggleIconSizePx:
|
|
809
|
-
toggleIconEdgeDistancePx:
|
|
810
|
+
toggleIconSizePx: A,
|
|
811
|
+
toggleIconEdgeDistancePx: M,
|
|
810
812
|
showToggle: _,
|
|
811
|
-
mediaQueryWidth:
|
|
812
|
-
swipeBarZIndex:
|
|
813
|
+
mediaQueryWidth: W,
|
|
814
|
+
swipeBarZIndex: D,
|
|
813
815
|
toggleZIndex: j,
|
|
814
|
-
overlayZIndex:
|
|
815
|
-
fadeContent:
|
|
816
|
-
fadeContentTransitionMs:
|
|
817
|
-
swipeToOpen:
|
|
818
|
-
swipeToClose:
|
|
819
|
-
midAnchorPoint:
|
|
820
|
-
midAnchorPointPx:
|
|
821
|
-
disabled:
|
|
822
|
-
|
|
823
|
-
|
|
816
|
+
overlayZIndex: N,
|
|
817
|
+
fadeContent: f,
|
|
818
|
+
fadeContentTransitionMs: x,
|
|
819
|
+
swipeToOpen: p,
|
|
820
|
+
swipeToClose: Y,
|
|
821
|
+
midAnchorPoint: X,
|
|
822
|
+
midAnchorPointPx: z,
|
|
823
|
+
disabled: F,
|
|
824
|
+
closeSidebarOnOverlayClick: G
|
|
825
|
+
} = t, k = Ze(() => {
|
|
826
|
+
const U = l ?? i.sidebarHeightPx;
|
|
824
827
|
return {
|
|
825
|
-
sidebarWidthPx:
|
|
826
|
-
sidebarHeightPx:
|
|
828
|
+
sidebarWidthPx: s ?? i.sidebarWidthPx,
|
|
829
|
+
sidebarHeightPx: U,
|
|
827
830
|
transitionMs: c ?? i.transitionMs,
|
|
828
|
-
edgeActivationWidthPx:
|
|
829
|
-
dragActivationDeltaPx:
|
|
830
|
-
showOverlay:
|
|
831
|
-
isAbsolute:
|
|
832
|
-
overlayBackgroundColor:
|
|
831
|
+
edgeActivationWidthPx: R ?? i.edgeActivationWidthPx,
|
|
832
|
+
dragActivationDeltaPx: v ?? i.dragActivationDeltaPx,
|
|
833
|
+
showOverlay: b ?? i.showOverlay,
|
|
834
|
+
isAbsolute: w ?? i.isAbsolute,
|
|
835
|
+
overlayBackgroundColor: I ?? i.overlayBackgroundColor,
|
|
833
836
|
toggleIconColor: y ?? i.toggleIconColor,
|
|
834
|
-
toggleIconSizePx:
|
|
835
|
-
toggleIconEdgeDistancePx:
|
|
837
|
+
toggleIconSizePx: A ?? i.toggleIconSizePx,
|
|
838
|
+
toggleIconEdgeDistancePx: M ?? i.toggleIconEdgeDistancePx,
|
|
836
839
|
showToggle: _ ?? i.showToggle,
|
|
837
|
-
mediaQueryWidth:
|
|
838
|
-
swipeBarZIndex:
|
|
840
|
+
mediaQueryWidth: W ?? i.mediaQueryWidth,
|
|
841
|
+
swipeBarZIndex: D ?? i.swipeBarZIndex,
|
|
839
842
|
toggleZIndex: j ?? i.toggleZIndex,
|
|
840
|
-
overlayZIndex:
|
|
841
|
-
fadeContent:
|
|
842
|
-
fadeContentTransitionMs:
|
|
843
|
-
swipeToOpen:
|
|
844
|
-
swipeToClose:
|
|
845
|
-
midAnchorPoint:
|
|
846
|
-
midAnchorPointPx:
|
|
847
|
-
disabled:
|
|
843
|
+
overlayZIndex: N ?? i.overlayZIndex,
|
|
844
|
+
fadeContent: f ?? i.fadeContent,
|
|
845
|
+
fadeContentTransitionMs: x ?? i.fadeContentTransitionMs,
|
|
846
|
+
swipeToOpen: p ?? i.swipeToOpen,
|
|
847
|
+
swipeToClose: Y ?? i.swipeToClose,
|
|
848
|
+
midAnchorPoint: X ?? i.midAnchorPoint,
|
|
849
|
+
midAnchorPointPx: z ?? i.midAnchorPointPx ?? Math.floor(U / 3),
|
|
850
|
+
disabled: F ?? i.disabled,
|
|
851
|
+
closeSidebarOnOverlayClick: G ?? i.closeSidebarOnOverlayClick
|
|
848
852
|
};
|
|
849
853
|
}, [
|
|
850
|
-
|
|
854
|
+
s,
|
|
851
855
|
l,
|
|
852
856
|
c,
|
|
853
|
-
|
|
854
|
-
w,
|
|
857
|
+
R,
|
|
855
858
|
v,
|
|
856
859
|
b,
|
|
857
|
-
|
|
860
|
+
w,
|
|
861
|
+
I,
|
|
858
862
|
y,
|
|
859
|
-
|
|
860
|
-
|
|
863
|
+
A,
|
|
864
|
+
M,
|
|
861
865
|
_,
|
|
862
866
|
i,
|
|
863
|
-
|
|
864
|
-
|
|
867
|
+
W,
|
|
868
|
+
D,
|
|
865
869
|
j,
|
|
866
|
-
|
|
867
|
-
|
|
870
|
+
N,
|
|
871
|
+
f,
|
|
872
|
+
x,
|
|
868
873
|
p,
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
874
|
+
Y,
|
|
875
|
+
X,
|
|
876
|
+
z,
|
|
872
877
|
F,
|
|
873
|
-
|
|
878
|
+
G
|
|
874
879
|
]);
|
|
875
|
-
return
|
|
876
|
-
e === "left" ?
|
|
877
|
-
}, [e, r,
|
|
880
|
+
return Z(() => {
|
|
881
|
+
e === "left" ? a(k) : e === "right" ? o(k) : e === "bottom" ? u(r ?? "primary", k) : xe(e);
|
|
882
|
+
}, [e, r, k, a, o, u]), k;
|
|
878
883
|
};
|
|
879
|
-
function
|
|
884
|
+
function Ee({
|
|
880
885
|
isCollapsed: e,
|
|
881
886
|
setCollapsed: t,
|
|
882
887
|
closeSidebarOnClick: r = !0,
|
|
883
888
|
transitionMs: i,
|
|
884
|
-
overlayBackgroundColor:
|
|
889
|
+
overlayBackgroundColor: a,
|
|
885
890
|
overlayZIndex: o
|
|
886
891
|
}) {
|
|
887
|
-
return /* @__PURE__ */
|
|
892
|
+
return /* @__PURE__ */ O.jsx(
|
|
888
893
|
"div",
|
|
889
894
|
{
|
|
890
895
|
style: {
|
|
891
896
|
transitionDuration: `${i}ms`,
|
|
892
|
-
...
|
|
893
|
-
...e ? {} :
|
|
894
|
-
...
|
|
897
|
+
...Gt,
|
|
898
|
+
...e ? {} : Ut,
|
|
899
|
+
...a ? { backgroundColor: a } : {},
|
|
895
900
|
zIndex: o
|
|
896
901
|
},
|
|
897
902
|
onMouseDown: (u) => {
|
|
@@ -900,22 +905,22 @@ function Ae({
|
|
|
900
905
|
}
|
|
901
906
|
);
|
|
902
907
|
}
|
|
903
|
-
function
|
|
908
|
+
function Ae({ size: e, color: t }) {
|
|
904
909
|
const r = L(null);
|
|
905
|
-
return
|
|
910
|
+
return Z(() => {
|
|
906
911
|
const i = () => {
|
|
907
912
|
r.current && (r.current.style.opacity = "1");
|
|
908
|
-
},
|
|
913
|
+
}, a = () => {
|
|
909
914
|
r.current && (r.current.style.opacity = `${Xe}`);
|
|
910
915
|
};
|
|
911
|
-
r.current && (r.current.addEventListener("mouseenter", i), r.current.addEventListener("mouseleave",
|
|
912
|
-
}, []), /* @__PURE__ */
|
|
916
|
+
r.current && (r.current.addEventListener("mouseenter", i), r.current.addEventListener("mouseleave", a));
|
|
917
|
+
}, []), /* @__PURE__ */ O.jsx(
|
|
913
918
|
"div",
|
|
914
919
|
{
|
|
915
920
|
style: {
|
|
916
|
-
...
|
|
921
|
+
...zt
|
|
917
922
|
},
|
|
918
|
-
children: /* @__PURE__ */
|
|
923
|
+
children: /* @__PURE__ */ O.jsxs(
|
|
919
924
|
"svg",
|
|
920
925
|
{
|
|
921
926
|
style: {
|
|
@@ -929,8 +934,8 @@ function Oe({ size: e, color: t }) {
|
|
|
929
934
|
xmlns: "http://www.w3.org/2000/svg",
|
|
930
935
|
width: e,
|
|
931
936
|
children: [
|
|
932
|
-
/* @__PURE__ */
|
|
933
|
-
/* @__PURE__ */
|
|
937
|
+
/* @__PURE__ */ O.jsx("g", { strokeWidth: "0" }),
|
|
938
|
+
/* @__PURE__ */ O.jsx("g", { strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ O.jsx("g", { children: /* @__PURE__ */ O.jsx(
|
|
934
939
|
"path",
|
|
935
940
|
{
|
|
936
941
|
clipRule: "evenodd",
|
|
@@ -945,19 +950,19 @@ function Oe({ size: e, color: t }) {
|
|
|
945
950
|
}
|
|
946
951
|
);
|
|
947
952
|
}
|
|
948
|
-
function
|
|
953
|
+
function Qt({ id: e, toggleRef: t, options: r, showToggle: i = !0, ToggleComponent: a }) {
|
|
949
954
|
var c;
|
|
950
|
-
const { openSidebar: o, closeSidebar: u, bottomSidebars:
|
|
951
|
-
return i ? /* @__PURE__ */
|
|
955
|
+
const { openSidebar: o, closeSidebar: u, bottomSidebars: s } = J(), l = ((c = s[e]) == null ? void 0 : c.isOpen) ?? !1;
|
|
956
|
+
return i ? /* @__PURE__ */ O.jsx(
|
|
952
957
|
"div",
|
|
953
958
|
{
|
|
954
959
|
ref: t,
|
|
955
960
|
style: {
|
|
956
|
-
...
|
|
961
|
+
...Zt,
|
|
957
962
|
transition: `transform ${r.transitionMs}ms ease, opacity ${r.transitionMs}ms ease`,
|
|
958
963
|
zIndex: r.toggleZIndex
|
|
959
964
|
},
|
|
960
|
-
children: (!l || l && !r.showOverlay) && /* @__PURE__ */
|
|
965
|
+
children: (!l || l && !r.showOverlay) && /* @__PURE__ */ O.jsx(
|
|
961
966
|
"button",
|
|
962
967
|
{
|
|
963
968
|
type: "button",
|
|
@@ -970,338 +975,333 @@ function qt({ id: e, toggleRef: t, options: r, showToggle: i = !0, ToggleCompone
|
|
|
970
975
|
// Rotate icon: -90deg points up when closed, 90deg points down when open
|
|
971
976
|
transform: l ? "rotate(90deg)" : "rotate(-90deg)"
|
|
972
977
|
},
|
|
973
|
-
children:
|
|
978
|
+
children: a ?? /* @__PURE__ */ O.jsx(Ae, { size: r.toggleIconSizePx, color: r.toggleIconColor })
|
|
974
979
|
}
|
|
975
980
|
)
|
|
976
981
|
}
|
|
977
982
|
) : null;
|
|
978
983
|
}
|
|
979
984
|
function le(e = Se) {
|
|
980
|
-
const t = `(max-width: ${Math.min(e, Se)}px)`, r = () => typeof window > "u" || typeof window.matchMedia > "u" ? !1 : window.matchMedia(t).matches, [i,
|
|
981
|
-
return
|
|
985
|
+
const t = `(max-width: ${Math.min(e, Se)}px)`, r = () => typeof window > "u" || typeof window.matchMedia > "u" ? !1 : window.matchMedia(t).matches, [i, a] = re(r);
|
|
986
|
+
return Z(() => {
|
|
982
987
|
if (typeof window > "u" || typeof window.matchMedia > "u")
|
|
983
988
|
return;
|
|
984
|
-
const o = window.matchMedia(t), u = () =>
|
|
989
|
+
const o = window.matchMedia(t), u = () => a(o.matches);
|
|
985
990
|
return u(), o.addEventListener("change", u), () => o.removeEventListener("change", u);
|
|
986
991
|
}, [t]), i;
|
|
987
992
|
}
|
|
988
|
-
const
|
|
993
|
+
const ke = ({
|
|
989
994
|
refs: e,
|
|
990
995
|
callbacks: t,
|
|
991
996
|
currentY: r,
|
|
992
997
|
preventDefault: i,
|
|
993
|
-
lockPane:
|
|
998
|
+
lockPane: a,
|
|
994
999
|
options: o,
|
|
995
1000
|
scrollableAncestor: u,
|
|
996
|
-
initialScrollTop:
|
|
1001
|
+
initialScrollTop: s
|
|
997
1002
|
}) => {
|
|
998
1003
|
if (!e.draggingRef.current) return;
|
|
999
1004
|
const l = r - e.draggingRef.current.startY;
|
|
1000
1005
|
if (!e.draggingRef.current.isActivated && Math.abs(l) >= o.dragActivationDeltaPx) {
|
|
1001
1006
|
if (u && t.getIsOpen()) {
|
|
1002
|
-
if (u.scrollTop !==
|
|
1007
|
+
if (u.scrollTop !== s) {
|
|
1003
1008
|
e.draggingRef.current = null, t.dragSidebar(null);
|
|
1004
1009
|
return;
|
|
1005
1010
|
}
|
|
1006
|
-
const { scrollTop: y, scrollHeight:
|
|
1007
|
-
if (l > 0 && _ || l < 0 &&
|
|
1011
|
+
const { scrollTop: y, scrollHeight: A, clientHeight: M } = u, _ = y > 1, W = y + M < A - 1;
|
|
1012
|
+
if (l > 0 && _ || l < 0 && W) {
|
|
1008
1013
|
e.draggingRef.current = null, t.dragSidebar(null);
|
|
1009
1014
|
return;
|
|
1010
1015
|
}
|
|
1011
1016
|
}
|
|
1012
|
-
e.draggingRef.current.isActivated = !0,
|
|
1017
|
+
e.draggingRef.current.isActivated = !0, a();
|
|
1013
1018
|
}
|
|
1014
1019
|
if (!e.draggingRef.current.isActivated) return;
|
|
1015
1020
|
e.prevYRef.current = e.currentYRef.current, e.currentYRef.current = r;
|
|
1016
|
-
const c = t.getIsOpen(),
|
|
1017
|
-
let
|
|
1018
|
-
if ((c || e.draggingRef.current.startY >=
|
|
1021
|
+
const c = t.getIsOpen(), R = window.innerHeight;
|
|
1022
|
+
let v = !1;
|
|
1023
|
+
if ((c || e.draggingRef.current.startY >= R - o.edgeActivationWidthPx) && (v = !0), !v) {
|
|
1019
1024
|
e.draggingRef.current = null, t.dragSidebar(null);
|
|
1020
1025
|
return;
|
|
1021
1026
|
}
|
|
1022
1027
|
i();
|
|
1023
|
-
const
|
|
1028
|
+
const b = o.sidebarHeightPx, w = o.midAnchorPointPx, I = o.midAnchorPoint && !o.swipeToOpen && w < b;
|
|
1024
1029
|
if (c)
|
|
1025
|
-
if (
|
|
1030
|
+
if (I) {
|
|
1026
1031
|
const y = t.getBottomAnchorState();
|
|
1027
1032
|
if (y === "open") {
|
|
1028
|
-
const
|
|
1033
|
+
const A = Math.max(
|
|
1029
1034
|
0,
|
|
1030
|
-
Math.min(
|
|
1035
|
+
Math.min(b, l - o.dragActivationDeltaPx)
|
|
1031
1036
|
);
|
|
1032
|
-
t.dragSidebar(
|
|
1037
|
+
t.dragSidebar(A);
|
|
1033
1038
|
} else if (y === "midAnchor") {
|
|
1034
|
-
const
|
|
1039
|
+
const A = b - w, M = Math.max(
|
|
1035
1040
|
0,
|
|
1036
1041
|
Math.min(
|
|
1037
|
-
|
|
1038
|
-
|
|
1042
|
+
b,
|
|
1043
|
+
A + l - o.dragActivationDeltaPx
|
|
1039
1044
|
)
|
|
1040
1045
|
);
|
|
1041
|
-
t.dragSidebar(
|
|
1046
|
+
t.dragSidebar(M);
|
|
1042
1047
|
}
|
|
1043
1048
|
} else {
|
|
1044
1049
|
const y = Math.max(
|
|
1045
1050
|
0,
|
|
1046
|
-
Math.min(
|
|
1051
|
+
Math.min(b, l - o.dragActivationDeltaPx)
|
|
1047
1052
|
);
|
|
1048
1053
|
t.dragSidebar(y);
|
|
1049
1054
|
}
|
|
1050
|
-
else if (e.draggingRef.current.startY >=
|
|
1051
|
-
if (
|
|
1052
|
-
const y =
|
|
1055
|
+
else if (e.draggingRef.current.startY >= R - o.edgeActivationWidthPx)
|
|
1056
|
+
if (I) {
|
|
1057
|
+
const y = b - w, A = Math.max(
|
|
1053
1058
|
y,
|
|
1054
1059
|
Math.min(
|
|
1055
|
-
|
|
1056
|
-
|
|
1060
|
+
b,
|
|
1061
|
+
b + l + o.dragActivationDeltaPx
|
|
1057
1062
|
)
|
|
1058
1063
|
);
|
|
1059
|
-
t.dragSidebar(
|
|
1064
|
+
t.dragSidebar(A);
|
|
1060
1065
|
} else {
|
|
1061
1066
|
const y = Math.max(
|
|
1062
1067
|
0,
|
|
1063
1068
|
Math.min(
|
|
1064
|
-
|
|
1065
|
-
|
|
1069
|
+
b,
|
|
1070
|
+
b + l + o.dragActivationDeltaPx
|
|
1066
1071
|
)
|
|
1067
1072
|
);
|
|
1068
1073
|
t.dragSidebar(y);
|
|
1069
1074
|
}
|
|
1070
|
-
},
|
|
1075
|
+
}, Ne = ({
|
|
1076
|
+
refs: e,
|
|
1077
|
+
callbacks: t,
|
|
1078
|
+
options: r,
|
|
1079
|
+
onDragEnd: i
|
|
1080
|
+
}) => {
|
|
1071
1081
|
if (!e.draggingRef.current) return;
|
|
1072
1082
|
if (!e.draggingRef.current.isActivated) {
|
|
1073
1083
|
e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null;
|
|
1074
1084
|
return;
|
|
1075
1085
|
}
|
|
1076
|
-
const
|
|
1086
|
+
const a = e.currentYRef.current ?? e.draggingRef.current.startY, o = e.prevYRef.current ?? e.draggingRef.current.startY, u = e.draggingRef.current.startY, s = t.getIsOpen(), l = window.innerHeight;
|
|
1077
1087
|
e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null, i();
|
|
1078
|
-
const c =
|
|
1079
|
-
if (
|
|
1080
|
-
if (
|
|
1081
|
-
const y = t.getBottomAnchorState(),
|
|
1088
|
+
const c = a < o, R = a >= o, v = u >= l - r.edgeActivationWidthPx, b = r.midAnchorPointPx, w = r.sidebarHeightPx, I = r.midAnchorPoint && !r.swipeToOpen && b < w;
|
|
1089
|
+
if (s)
|
|
1090
|
+
if (I) {
|
|
1091
|
+
const y = t.getBottomAnchorState(), A = w - b;
|
|
1082
1092
|
if (y === "open") {
|
|
1083
|
-
const
|
|
1084
|
-
|
|
1093
|
+
const M = Math.max(0, a - u);
|
|
1094
|
+
R ? M > A ? t.closeSidebar() : t.openToMidAnchor() : M < A ? t.openSidebarFully() : t.closeSidebar(), t.dragSidebar(null);
|
|
1085
1095
|
} else if (y === "midAnchor") {
|
|
1086
|
-
const
|
|
1096
|
+
const M = w - b, _ = Math.max(
|
|
1087
1097
|
0,
|
|
1088
|
-
Math.min(
|
|
1098
|
+
Math.min(w, M + (a - u))
|
|
1089
1099
|
);
|
|
1090
|
-
|
|
1091
|
-
_ < P ? t.openSidebarFully() : t.openToMidAnchor();
|
|
1092
|
-
else {
|
|
1093
|
-
const C = (b + D) / 2;
|
|
1094
|
-
_ > C ? t.closeSidebar() : t.openToMidAnchor();
|
|
1095
|
-
}
|
|
1096
|
-
t.dragSidebar(null);
|
|
1100
|
+
c && _ < A ? t.openSidebarFully() : t.closeSidebar(), t.dragSidebar(null);
|
|
1097
1101
|
}
|
|
1098
1102
|
} else
|
|
1099
|
-
|
|
1100
|
-
else
|
|
1103
|
+
R ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null);
|
|
1104
|
+
else v && c ? (I ? t.openToMidAnchor() : t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
|
|
1101
1105
|
};
|
|
1102
|
-
function
|
|
1103
|
-
var
|
|
1106
|
+
function Jt(e, t) {
|
|
1107
|
+
var N, f;
|
|
1104
1108
|
const r = le(e.mediaQueryWidth), {
|
|
1105
1109
|
lockedSidebar: i,
|
|
1106
|
-
setLockedSidebar:
|
|
1110
|
+
setLockedSidebar: a,
|
|
1107
1111
|
bottomSidebars: o,
|
|
1108
1112
|
openSidebar: u,
|
|
1109
|
-
openSidebarFully:
|
|
1113
|
+
openSidebarFully: s,
|
|
1110
1114
|
closeSidebar: l,
|
|
1111
1115
|
dragSidebar: c,
|
|
1112
|
-
openSidebarToMidAnchor:
|
|
1113
|
-
activeBottomDragIdRef:
|
|
1114
|
-
bottomFocusStackRef:
|
|
1115
|
-
} =
|
|
1116
|
-
|
|
1117
|
-
j.current =
|
|
1118
|
-
}, [
|
|
1116
|
+
openSidebarToMidAnchor: R,
|
|
1117
|
+
activeBottomDragIdRef: v,
|
|
1118
|
+
bottomFocusStackRef: b
|
|
1119
|
+
} = J(), w = ((N = o[t]) == null ? void 0 : N.isOpen) ?? !1, I = ((f = o[t]) == null ? void 0 : f.anchorState) ?? "closed", y = L(null), A = L(null), M = L(null), _ = L(null), W = L(0), D = L(null), j = L(I);
|
|
1120
|
+
Z(() => {
|
|
1121
|
+
j.current = I;
|
|
1122
|
+
}, [I]), Z(() => {
|
|
1119
1123
|
if (!r || i && i !== "bottom" || e.disabled) return;
|
|
1120
|
-
const
|
|
1121
|
-
getIsOpen: () =>
|
|
1124
|
+
const x = {
|
|
1125
|
+
getIsOpen: () => w,
|
|
1122
1126
|
openSidebar: () => u("bottom", { id: t }),
|
|
1123
|
-
openSidebarFully: () =>
|
|
1127
|
+
openSidebarFully: () => s("bottom", { id: t }),
|
|
1124
1128
|
closeSidebar: () => l("bottom", { id: t }),
|
|
1125
1129
|
dragSidebar: (n) => c("bottom", n, { id: t }),
|
|
1126
1130
|
getBottomAnchorState: () => j.current,
|
|
1127
|
-
openToMidAnchor: () =>
|
|
1128
|
-
},
|
|
1131
|
+
openToMidAnchor: () => R("bottom", { id: t })
|
|
1132
|
+
}, p = {
|
|
1129
1133
|
draggingRef: y,
|
|
1130
|
-
currentYRef:
|
|
1131
|
-
prevYRef:
|
|
1132
|
-
},
|
|
1133
|
-
const n =
|
|
1134
|
+
currentYRef: A,
|
|
1135
|
+
prevYRef: M
|
|
1136
|
+
}, Y = () => v.current !== null && v.current !== t, X = () => {
|
|
1137
|
+
const n = b.current;
|
|
1134
1138
|
return n.length === 0 ? !0 : n[n.length - 1] === t;
|
|
1135
|
-
},
|
|
1136
|
-
if (
|
|
1139
|
+
}, z = () => {
|
|
1140
|
+
if (Y()) {
|
|
1137
1141
|
y.current = null;
|
|
1138
1142
|
return;
|
|
1139
1143
|
}
|
|
1140
|
-
|
|
1144
|
+
v.current = t, a("bottom");
|
|
1141
1145
|
const n = _.current;
|
|
1142
|
-
n && (
|
|
1143
|
-
},
|
|
1144
|
-
|
|
1146
|
+
n && (D.current = n.style.overflowY, n.style.overflowY = "hidden");
|
|
1147
|
+
}, F = () => {
|
|
1148
|
+
v.current === t && (v.current = null);
|
|
1145
1149
|
const n = _.current;
|
|
1146
|
-
n &&
|
|
1150
|
+
n && D.current !== null && (n.style.overflowY = D.current, D.current = null);
|
|
1147
1151
|
};
|
|
1148
|
-
function
|
|
1149
|
-
var
|
|
1150
|
-
if (i && i !== "bottom" ||
|
|
1151
|
-
const
|
|
1152
|
-
|
|
1153
|
-
refs:
|
|
1154
|
-
clientX:
|
|
1155
|
-
clientY:
|
|
1156
|
-
touchId:
|
|
1152
|
+
function G(n) {
|
|
1153
|
+
var K;
|
|
1154
|
+
if (i && i !== "bottom" || Y() || !X() || ce(n.target) || n.changedTouches.length === 0) return;
|
|
1155
|
+
const g = n.changedTouches[0], T = window.innerHeight, P = x.getIsOpen(), Q = g.clientY >= T - e.edgeActivationWidthPx;
|
|
1156
|
+
P && !e.swipeToClose || !P && !e.swipeToOpen || (P || Q) && (_.current = je(n.target), W.current = ((K = _.current) == null ? void 0 : K.scrollTop) ?? 0, Be({
|
|
1157
|
+
refs: p,
|
|
1158
|
+
clientX: g.clientX,
|
|
1159
|
+
clientY: g.clientY,
|
|
1160
|
+
touchId: g.identifier,
|
|
1157
1161
|
isMouse: !1
|
|
1158
1162
|
}));
|
|
1159
1163
|
}
|
|
1160
|
-
function
|
|
1164
|
+
function k(n) {
|
|
1161
1165
|
if (i && i !== "bottom") return;
|
|
1162
|
-
if (
|
|
1166
|
+
if (Y()) {
|
|
1163
1167
|
y.current = null;
|
|
1164
1168
|
return;
|
|
1165
1169
|
}
|
|
1166
1170
|
if (!y.current || y.current.isMouse) return;
|
|
1167
|
-
const
|
|
1168
|
-
|
|
1169
|
-
refs:
|
|
1170
|
-
callbacks:
|
|
1171
|
-
currentY:
|
|
1171
|
+
const g = y.current.activeTouchId, T = Re(n.changedTouches, g);
|
|
1172
|
+
T && ke({
|
|
1173
|
+
refs: p,
|
|
1174
|
+
callbacks: x,
|
|
1175
|
+
currentY: T.clientY,
|
|
1172
1176
|
preventDefault: () => n.preventDefault(),
|
|
1173
|
-
lockPane:
|
|
1177
|
+
lockPane: z,
|
|
1174
1178
|
options: e,
|
|
1175
1179
|
scrollableAncestor: _.current,
|
|
1176
|
-
initialScrollTop:
|
|
1180
|
+
initialScrollTop: W.current
|
|
1177
1181
|
});
|
|
1178
1182
|
}
|
|
1179
|
-
function
|
|
1183
|
+
function U(n) {
|
|
1180
1184
|
if (i && i !== "bottom" || !y.current || y.current.isMouse) return;
|
|
1181
|
-
const
|
|
1182
|
-
Te(n.changedTouches,
|
|
1183
|
-
refs:
|
|
1184
|
-
callbacks:
|
|
1185
|
+
const g = y.current.activeTouchId;
|
|
1186
|
+
Te(n.changedTouches, g) && Ne({
|
|
1187
|
+
refs: p,
|
|
1188
|
+
callbacks: x,
|
|
1185
1189
|
options: e,
|
|
1186
|
-
onDragEnd:
|
|
1190
|
+
onDragEnd: F
|
|
1187
1191
|
});
|
|
1188
1192
|
}
|
|
1189
|
-
function
|
|
1190
|
-
i && i !== "bottom" || !y.current || y.current.isMouse || (
|
|
1191
|
-
refs:
|
|
1192
|
-
dragSidebar:
|
|
1193
|
+
function V() {
|
|
1194
|
+
i && i !== "bottom" || !y.current || y.current.isMouse || (F(), qt({
|
|
1195
|
+
refs: p,
|
|
1196
|
+
dragSidebar: x.dragSidebar,
|
|
1193
1197
|
onDeactivate: () => {
|
|
1194
1198
|
}
|
|
1195
1199
|
}));
|
|
1196
1200
|
}
|
|
1197
|
-
function
|
|
1198
|
-
var
|
|
1199
|
-
if (i && i !== "bottom" ||
|
|
1200
|
-
const
|
|
1201
|
-
|
|
1202
|
-
refs:
|
|
1201
|
+
function q(n) {
|
|
1202
|
+
var Q;
|
|
1203
|
+
if (i && i !== "bottom" || Y() || !X() || ce(n.target) || n.button !== 0) return;
|
|
1204
|
+
const g = window.innerHeight, T = x.getIsOpen(), P = n.clientY >= g - e.edgeActivationWidthPx;
|
|
1205
|
+
T && !e.swipeToClose || !T && !e.swipeToOpen || (T || P) && (_.current = je(n.target), W.current = ((Q = _.current) == null ? void 0 : Q.scrollTop) ?? 0, Be({
|
|
1206
|
+
refs: p,
|
|
1203
1207
|
clientX: n.clientX,
|
|
1204
1208
|
clientY: n.clientY,
|
|
1205
1209
|
touchId: null,
|
|
1206
1210
|
isMouse: !0
|
|
1207
1211
|
}));
|
|
1208
1212
|
}
|
|
1209
|
-
function
|
|
1213
|
+
function $(n) {
|
|
1210
1214
|
if (!(i && i !== "bottom")) {
|
|
1211
|
-
if (
|
|
1215
|
+
if (Y()) {
|
|
1212
1216
|
y.current = null;
|
|
1213
1217
|
return;
|
|
1214
1218
|
}
|
|
1215
|
-
!y.current || !y.current.isMouse ||
|
|
1216
|
-
refs:
|
|
1217
|
-
callbacks:
|
|
1219
|
+
!y.current || !y.current.isMouse || ke({
|
|
1220
|
+
refs: p,
|
|
1221
|
+
callbacks: x,
|
|
1218
1222
|
currentY: n.clientY,
|
|
1219
1223
|
preventDefault: () => n.preventDefault(),
|
|
1220
|
-
lockPane:
|
|
1224
|
+
lockPane: z,
|
|
1221
1225
|
options: e,
|
|
1222
1226
|
scrollableAncestor: _.current,
|
|
1223
|
-
initialScrollTop:
|
|
1227
|
+
initialScrollTop: W.current
|
|
1224
1228
|
});
|
|
1225
1229
|
}
|
|
1226
1230
|
}
|
|
1227
|
-
function
|
|
1228
|
-
i && i !== "bottom" || !y.current || !y.current.isMouse ||
|
|
1229
|
-
refs:
|
|
1230
|
-
callbacks:
|
|
1231
|
+
function ne() {
|
|
1232
|
+
i && i !== "bottom" || !y.current || !y.current.isMouse || Ne({
|
|
1233
|
+
refs: p,
|
|
1234
|
+
callbacks: x,
|
|
1231
1235
|
options: e,
|
|
1232
|
-
onDragEnd:
|
|
1236
|
+
onDragEnd: F
|
|
1233
1237
|
});
|
|
1234
1238
|
}
|
|
1235
|
-
return window.addEventListener("touchstart",
|
|
1236
|
-
window.removeEventListener("touchstart",
|
|
1239
|
+
return window.addEventListener("touchstart", G, { passive: !0 }), window.addEventListener("touchmove", k, { passive: !1 }), window.addEventListener("touchend", U, { passive: !0 }), window.addEventListener("touchcancel", V, { passive: !0 }), window.addEventListener("mousedown", q, { passive: !0 }), window.addEventListener("mousemove", $, { passive: !1 }), window.addEventListener("mouseup", ne, { passive: !0 }), () => {
|
|
1240
|
+
window.removeEventListener("touchstart", G), window.removeEventListener("touchmove", k), window.removeEventListener("touchend", U), window.removeEventListener("touchcancel", V), window.removeEventListener("mousedown", q), window.removeEventListener("mousemove", $), window.removeEventListener("mouseup", ne);
|
|
1237
1241
|
};
|
|
1238
1242
|
}, [
|
|
1239
1243
|
t,
|
|
1240
1244
|
r,
|
|
1241
|
-
|
|
1245
|
+
w,
|
|
1242
1246
|
u,
|
|
1243
|
-
|
|
1247
|
+
s,
|
|
1244
1248
|
l,
|
|
1245
1249
|
c,
|
|
1246
1250
|
i,
|
|
1247
|
-
|
|
1251
|
+
a,
|
|
1248
1252
|
e,
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1253
|
+
R,
|
|
1254
|
+
v,
|
|
1255
|
+
b
|
|
1252
1256
|
]);
|
|
1253
1257
|
}
|
|
1254
|
-
function
|
|
1258
|
+
function ar({
|
|
1255
1259
|
id: e = "primary",
|
|
1256
1260
|
className: t,
|
|
1257
1261
|
children: r,
|
|
1258
1262
|
ToggleComponent: i,
|
|
1259
|
-
...
|
|
1263
|
+
...a
|
|
1260
1264
|
}) {
|
|
1261
|
-
var
|
|
1262
|
-
if ((r == null ? void 0 : r.type) ===
|
|
1265
|
+
var I;
|
|
1266
|
+
if ((r == null ? void 0 : r.type) === O.Fragment)
|
|
1263
1267
|
throw new Error("Fragments is not allowed in SwipeBarBottom");
|
|
1264
|
-
const {
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
Vt(w, e);
|
|
1273
|
-
const b = ((M = o[e]) == null ? void 0 : M.isOpen) ?? !1;
|
|
1274
|
-
return /* @__PURE__ */ R.jsxs(R.Fragment, { children: [
|
|
1275
|
-
w.showOverlay && /* @__PURE__ */ R.jsx(
|
|
1276
|
-
Ae,
|
|
1268
|
+
const { bottomSidebars: o, closeSidebar: u, registerBottomSidebar: s, unregisterBottomSidebar: l } = J(), c = L(null), R = L(null);
|
|
1269
|
+
Z(() => (s(e, { sidebarRef: c, toggleRef: R }), () => l(e)), [e, s, l]);
|
|
1270
|
+
const v = Oe("bottom", a, e), b = le(v.mediaQueryWidth);
|
|
1271
|
+
Jt(v, e);
|
|
1272
|
+
const w = ((I = o[e]) == null ? void 0 : I.isOpen) ?? !1;
|
|
1273
|
+
return /* @__PURE__ */ O.jsxs(O.Fragment, { children: [
|
|
1274
|
+
v.showOverlay && /* @__PURE__ */ O.jsx(
|
|
1275
|
+
Ee,
|
|
1277
1276
|
{
|
|
1278
|
-
isCollapsed: !
|
|
1277
|
+
isCollapsed: !w,
|
|
1279
1278
|
setCollapsed: () => u("bottom", { id: e }),
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1279
|
+
closeSidebarOnClick: v.closeSidebarOnOverlayClick,
|
|
1280
|
+
transitionMs: v.transitionMs,
|
|
1281
|
+
overlayBackgroundColor: v.overlayBackgroundColor,
|
|
1282
|
+
overlayZIndex: v.overlayZIndex
|
|
1283
1283
|
}
|
|
1284
1284
|
),
|
|
1285
|
-
/* @__PURE__ */
|
|
1286
|
-
|
|
1285
|
+
/* @__PURE__ */ O.jsx(
|
|
1286
|
+
Qt,
|
|
1287
1287
|
{
|
|
1288
1288
|
id: e,
|
|
1289
|
-
toggleRef:
|
|
1290
|
-
options:
|
|
1291
|
-
showToggle:
|
|
1289
|
+
toggleRef: R,
|
|
1290
|
+
options: v,
|
|
1291
|
+
showToggle: v.showToggle,
|
|
1292
1292
|
ToggleComponent: i
|
|
1293
1293
|
}
|
|
1294
1294
|
),
|
|
1295
|
-
/* @__PURE__ */
|
|
1295
|
+
/* @__PURE__ */ O.jsx(
|
|
1296
1296
|
"div",
|
|
1297
1297
|
{
|
|
1298
1298
|
ref: c,
|
|
1299
1299
|
style: {
|
|
1300
|
-
...jt,
|
|
1301
1300
|
...Nt,
|
|
1302
|
-
...
|
|
1301
|
+
...Ft,
|
|
1302
|
+
...v.isAbsolute || b ? Ht : {},
|
|
1303
1303
|
...t ? {} : { backgroundColor: ye },
|
|
1304
|
-
zIndex:
|
|
1304
|
+
zIndex: v.swipeBarZIndex
|
|
1305
1305
|
},
|
|
1306
1306
|
className: t,
|
|
1307
1307
|
children: r
|
|
@@ -1309,19 +1309,19 @@ function ir({
|
|
|
1309
1309
|
)
|
|
1310
1310
|
] });
|
|
1311
1311
|
}
|
|
1312
|
-
function
|
|
1313
|
-
const { openSidebar: i, leftToggleRef:
|
|
1314
|
-
return t ? /* @__PURE__ */
|
|
1312
|
+
function Kt({ options: e, showToggle: t = !0, ToggleComponent: r }) {
|
|
1313
|
+
const { openSidebar: i, leftToggleRef: a, isLeftOpen: o, closeSidebar: u } = J();
|
|
1314
|
+
return t ? /* @__PURE__ */ O.jsx(
|
|
1315
1315
|
"div",
|
|
1316
1316
|
{
|
|
1317
|
-
ref:
|
|
1317
|
+
ref: a,
|
|
1318
1318
|
style: {
|
|
1319
1319
|
...Qe,
|
|
1320
1320
|
transition: `transform ${e.transitionMs}ms ease, opacity ${e.transitionMs}ms ease`,
|
|
1321
1321
|
left: 0,
|
|
1322
1322
|
zIndex: e.toggleZIndex
|
|
1323
1323
|
},
|
|
1324
|
-
children: (!o || o && !e.showOverlay) && /* @__PURE__ */
|
|
1324
|
+
children: (!o || o && !e.showOverlay) && /* @__PURE__ */ O.jsx(
|
|
1325
1325
|
"button",
|
|
1326
1326
|
{
|
|
1327
1327
|
type: "button",
|
|
@@ -1333,50 +1333,50 @@ function Qt({ options: e, showToggle: t = !0, ToggleComponent: r }) {
|
|
|
1333
1333
|
marginLeft: `${e.toggleIconEdgeDistancePx}px`,
|
|
1334
1334
|
...o ? { transform: "rotate(180deg)" } : {}
|
|
1335
1335
|
},
|
|
1336
|
-
children: r ?? /* @__PURE__ */
|
|
1336
|
+
children: r ?? /* @__PURE__ */ O.jsx(Ae, { size: e.toggleIconSizePx, color: e.toggleIconColor })
|
|
1337
1337
|
}
|
|
1338
1338
|
)
|
|
1339
1339
|
}
|
|
1340
1340
|
) : null;
|
|
1341
1341
|
}
|
|
1342
|
-
const
|
|
1342
|
+
const Fe = ({
|
|
1343
1343
|
refs: e,
|
|
1344
1344
|
callbacks: t,
|
|
1345
1345
|
currentX: r,
|
|
1346
1346
|
preventDefault: i,
|
|
1347
|
-
lockPane:
|
|
1347
|
+
lockPane: a,
|
|
1348
1348
|
options: o
|
|
1349
1349
|
}) => {
|
|
1350
1350
|
if (!e.draggingRef.current) return;
|
|
1351
1351
|
const u = r - e.draggingRef.current.startX;
|
|
1352
|
-
if (!e.draggingRef.current.isActivated && Math.abs(u) >= o.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0,
|
|
1352
|
+
if (!e.draggingRef.current.isActivated && Math.abs(u) >= o.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0, a()), !e.draggingRef.current.isActivated) return;
|
|
1353
1353
|
e.prevXRef.current = e.currentXRef.current, e.currentXRef.current = r;
|
|
1354
|
-
const
|
|
1354
|
+
const s = t.getIsOpen();
|
|
1355
1355
|
let l = !1;
|
|
1356
|
-
if ((
|
|
1356
|
+
if ((s || e.draggingRef.current.startX <= o.edgeActivationWidthPx) && (l = !0), !l) {
|
|
1357
1357
|
e.draggingRef.current = null, t.dragSidebar(null);
|
|
1358
1358
|
return;
|
|
1359
1359
|
}
|
|
1360
1360
|
i();
|
|
1361
1361
|
const c = o.sidebarWidthPx;
|
|
1362
|
-
if (
|
|
1363
|
-
const
|
|
1362
|
+
if (s) {
|
|
1363
|
+
const R = Math.min(
|
|
1364
1364
|
0,
|
|
1365
1365
|
Math.max(
|
|
1366
1366
|
-c,
|
|
1367
1367
|
u + o.dragActivationDeltaPx
|
|
1368
1368
|
)
|
|
1369
1369
|
);
|
|
1370
|
-
t.dragSidebar(
|
|
1370
|
+
t.dragSidebar(R);
|
|
1371
1371
|
} else if (e.draggingRef.current.startX <= o.edgeActivationWidthPx) {
|
|
1372
|
-
const
|
|
1372
|
+
const R = Math.min(
|
|
1373
1373
|
0,
|
|
1374
1374
|
Math.max(
|
|
1375
1375
|
-c,
|
|
1376
1376
|
-c + u - o.dragActivationDeltaPx
|
|
1377
1377
|
)
|
|
1378
1378
|
);
|
|
1379
|
-
t.dragSidebar(
|
|
1379
|
+
t.dragSidebar(R);
|
|
1380
1380
|
}
|
|
1381
1381
|
}, He = ({
|
|
1382
1382
|
refs: e,
|
|
@@ -1388,153 +1388,154 @@ const ke = ({
|
|
|
1388
1388
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
|
|
1389
1389
|
return;
|
|
1390
1390
|
}
|
|
1391
|
-
const i = e.currentXRef.current ?? e.draggingRef.current.startX,
|
|
1391
|
+
const i = e.currentXRef.current ?? e.draggingRef.current.startX, a = e.prevXRef.current ?? e.draggingRef.current.startX, o = e.draggingRef.current.startX, u = t.getIsOpen();
|
|
1392
1392
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
|
|
1393
|
-
const
|
|
1394
|
-
u ? (l ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null)) : c &&
|
|
1393
|
+
const s = i >= a, l = i < a, c = o <= r.edgeActivationWidthPx;
|
|
1394
|
+
u ? (l ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null)) : c && s ? (t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
|
|
1395
1395
|
};
|
|
1396
|
-
function
|
|
1396
|
+
function er(e) {
|
|
1397
1397
|
const t = le(e.mediaQueryWidth), {
|
|
1398
1398
|
lockedSidebar: r,
|
|
1399
1399
|
setLockedSidebar: i,
|
|
1400
|
-
isLeftOpen:
|
|
1400
|
+
isLeftOpen: a,
|
|
1401
1401
|
openSidebar: o,
|
|
1402
1402
|
closeSidebar: u,
|
|
1403
|
-
dragSidebar:
|
|
1403
|
+
dragSidebar: s,
|
|
1404
1404
|
leftSidebarRef: l
|
|
1405
|
-
} =
|
|
1406
|
-
|
|
1405
|
+
} = J(), c = L(null), R = L(null), v = L(null);
|
|
1406
|
+
Z(() => {
|
|
1407
1407
|
if (!t || r && r !== "left" || e.disabled) return;
|
|
1408
|
-
const
|
|
1409
|
-
getIsOpen: () =>
|
|
1408
|
+
const b = {
|
|
1409
|
+
getIsOpen: () => a,
|
|
1410
1410
|
openSidebar: () => o("left"),
|
|
1411
1411
|
closeSidebar: () => u("left"),
|
|
1412
|
-
dragSidebar: (
|
|
1413
|
-
},
|
|
1412
|
+
dragSidebar: (f) => s("left", f)
|
|
1413
|
+
}, w = {
|
|
1414
1414
|
draggingRef: c,
|
|
1415
|
-
currentXRef:
|
|
1416
|
-
prevXRef:
|
|
1417
|
-
},
|
|
1418
|
-
function
|
|
1419
|
-
if (r && r !== "left" || ce(
|
|
1420
|
-
const
|
|
1421
|
-
|
|
1422
|
-
refs:
|
|
1423
|
-
clientX:
|
|
1424
|
-
clientY:
|
|
1425
|
-
touchId:
|
|
1415
|
+
currentXRef: R,
|
|
1416
|
+
prevXRef: v
|
|
1417
|
+
}, I = () => i("left"), y = () => i(null);
|
|
1418
|
+
function A(f) {
|
|
1419
|
+
if (r && r !== "left" || ce(f.target) || f.changedTouches.length === 0) return;
|
|
1420
|
+
const x = f.changedTouches[0], p = b.getIsOpen(), Y = x.clientX <= e.edgeActivationWidthPx;
|
|
1421
|
+
p && !e.swipeToClose || !p && !e.swipeToOpen || (p || Y) && he({
|
|
1422
|
+
refs: w,
|
|
1423
|
+
clientX: x.clientX,
|
|
1424
|
+
clientY: x.clientY,
|
|
1425
|
+
touchId: x.identifier,
|
|
1426
1426
|
isMouse: !1
|
|
1427
1427
|
});
|
|
1428
1428
|
}
|
|
1429
|
-
function
|
|
1429
|
+
function M(f) {
|
|
1430
1430
|
if (r && r !== "left" || !c.current || c.current.isMouse) return;
|
|
1431
|
-
const
|
|
1432
|
-
|
|
1433
|
-
refs:
|
|
1434
|
-
callbacks:
|
|
1435
|
-
currentX:
|
|
1436
|
-
preventDefault: () =>
|
|
1437
|
-
lockPane:
|
|
1431
|
+
const x = c.current.activeTouchId, p = Re(f.changedTouches, x);
|
|
1432
|
+
p && Fe({
|
|
1433
|
+
refs: w,
|
|
1434
|
+
callbacks: b,
|
|
1435
|
+
currentX: p.clientX,
|
|
1436
|
+
preventDefault: () => f.preventDefault(),
|
|
1437
|
+
lockPane: I,
|
|
1438
1438
|
options: e
|
|
1439
1439
|
});
|
|
1440
1440
|
}
|
|
1441
|
-
function _(
|
|
1441
|
+
function _(f) {
|
|
1442
1442
|
if (r && r !== "left" || !c.current || c.current.isMouse) return;
|
|
1443
|
-
const
|
|
1444
|
-
Te(
|
|
1445
|
-
refs:
|
|
1446
|
-
callbacks:
|
|
1443
|
+
const x = c.current.activeTouchId;
|
|
1444
|
+
Te(f.changedTouches, x) && He({
|
|
1445
|
+
refs: w,
|
|
1446
|
+
callbacks: b,
|
|
1447
1447
|
options: e
|
|
1448
1448
|
});
|
|
1449
1449
|
}
|
|
1450
|
-
function
|
|
1450
|
+
function W() {
|
|
1451
1451
|
r && r !== "left" || !c.current || c.current.isMouse || Je({
|
|
1452
|
-
refs:
|
|
1453
|
-
dragSidebar:
|
|
1452
|
+
refs: w,
|
|
1453
|
+
dragSidebar: b.dragSidebar,
|
|
1454
1454
|
onDeactivate: y
|
|
1455
1455
|
});
|
|
1456
1456
|
}
|
|
1457
|
-
function
|
|
1458
|
-
if (r && r !== "left" || ce(
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1461
|
-
refs:
|
|
1462
|
-
clientX:
|
|
1463
|
-
clientY:
|
|
1457
|
+
function D(f) {
|
|
1458
|
+
if (r && r !== "left" || ce(f.target) || f.button !== 0) return;
|
|
1459
|
+
const x = b.getIsOpen(), p = f.clientX <= e.edgeActivationWidthPx;
|
|
1460
|
+
x && !e.swipeToClose || !x && !e.swipeToOpen || (x || p) && he({
|
|
1461
|
+
refs: w,
|
|
1462
|
+
clientX: f.clientX,
|
|
1463
|
+
clientY: f.clientY,
|
|
1464
1464
|
touchId: null,
|
|
1465
1465
|
isMouse: !0
|
|
1466
1466
|
});
|
|
1467
1467
|
}
|
|
1468
|
-
function j(
|
|
1469
|
-
r && r !== "left" || !c.current || !c.current.isMouse ||
|
|
1470
|
-
refs:
|
|
1471
|
-
callbacks:
|
|
1472
|
-
currentX:
|
|
1473
|
-
preventDefault: () =>
|
|
1474
|
-
lockPane:
|
|
1468
|
+
function j(f) {
|
|
1469
|
+
r && r !== "left" || !c.current || !c.current.isMouse || Fe({
|
|
1470
|
+
refs: w,
|
|
1471
|
+
callbacks: b,
|
|
1472
|
+
currentX: f.clientX,
|
|
1473
|
+
preventDefault: () => f.preventDefault(),
|
|
1474
|
+
lockPane: I,
|
|
1475
1475
|
options: e
|
|
1476
1476
|
});
|
|
1477
1477
|
}
|
|
1478
|
-
function
|
|
1478
|
+
function N() {
|
|
1479
1479
|
r && r !== "left" || !c.current || !c.current.isMouse || He({
|
|
1480
|
-
refs:
|
|
1481
|
-
callbacks:
|
|
1480
|
+
refs: w,
|
|
1481
|
+
callbacks: b,
|
|
1482
1482
|
options: e
|
|
1483
1483
|
});
|
|
1484
1484
|
}
|
|
1485
|
-
return window.addEventListener("touchstart",
|
|
1486
|
-
window.removeEventListener("touchstart",
|
|
1485
|
+
return window.addEventListener("touchstart", A, { passive: !0 }), window.addEventListener("touchmove", M, { passive: !1 }), window.addEventListener("touchend", _, { passive: !0 }), window.addEventListener("touchcancel", W, { passive: !0 }), window.addEventListener("mousedown", D, { passive: !0 }), window.addEventListener("mousemove", j, { passive: !1 }), window.addEventListener("mouseup", N, { passive: !0 }), () => {
|
|
1486
|
+
window.removeEventListener("touchstart", A), window.removeEventListener("touchmove", M), window.removeEventListener("touchend", _), window.removeEventListener("touchcancel", W), window.removeEventListener("mousedown", D), window.removeEventListener("mousemove", j), window.removeEventListener("mouseup", N);
|
|
1487
1487
|
};
|
|
1488
1488
|
}, [
|
|
1489
1489
|
t,
|
|
1490
|
-
|
|
1490
|
+
a,
|
|
1491
1491
|
o,
|
|
1492
1492
|
u,
|
|
1493
|
-
|
|
1493
|
+
s,
|
|
1494
1494
|
r,
|
|
1495
1495
|
i,
|
|
1496
1496
|
l,
|
|
1497
1497
|
e
|
|
1498
1498
|
]);
|
|
1499
1499
|
}
|
|
1500
|
-
function
|
|
1500
|
+
function sr({
|
|
1501
1501
|
className: e,
|
|
1502
1502
|
children: t,
|
|
1503
1503
|
ToggleComponent: r,
|
|
1504
1504
|
...i
|
|
1505
1505
|
}) {
|
|
1506
|
-
if ((t == null ? void 0 : t.type) ===
|
|
1506
|
+
if ((t == null ? void 0 : t.type) === O.Fragment)
|
|
1507
1507
|
throw new Error("Fragments is not allowed in SwipeBarLeft");
|
|
1508
|
-
const { isLeftOpen:
|
|
1509
|
-
return
|
|
1510
|
-
|
|
1511
|
-
|
|
1508
|
+
const { isLeftOpen: a, closeSidebar: o, leftSidebarRef: u } = J(), s = Oe("left", i), l = le(s.mediaQueryWidth);
|
|
1509
|
+
return er(s), /* @__PURE__ */ O.jsxs(O.Fragment, { children: [
|
|
1510
|
+
s.showOverlay && /* @__PURE__ */ O.jsx(
|
|
1511
|
+
Ee,
|
|
1512
1512
|
{
|
|
1513
|
-
isCollapsed: !
|
|
1513
|
+
isCollapsed: !a,
|
|
1514
1514
|
setCollapsed: () => o("left"),
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1515
|
+
closeSidebarOnClick: s.closeSidebarOnOverlayClick,
|
|
1516
|
+
transitionMs: s.transitionMs,
|
|
1517
|
+
overlayBackgroundColor: s.overlayBackgroundColor,
|
|
1518
|
+
overlayZIndex: s.overlayZIndex
|
|
1518
1519
|
}
|
|
1519
1520
|
),
|
|
1520
|
-
/* @__PURE__ */
|
|
1521
|
-
|
|
1521
|
+
/* @__PURE__ */ O.jsx(
|
|
1522
|
+
Kt,
|
|
1522
1523
|
{
|
|
1523
|
-
options:
|
|
1524
|
-
showToggle:
|
|
1524
|
+
options: s,
|
|
1525
|
+
showToggle: s.showToggle,
|
|
1525
1526
|
ToggleComponent: r
|
|
1526
1527
|
}
|
|
1527
1528
|
),
|
|
1528
|
-
/* @__PURE__ */
|
|
1529
|
+
/* @__PURE__ */ O.jsx(
|
|
1529
1530
|
"div",
|
|
1530
1531
|
{
|
|
1531
1532
|
ref: u,
|
|
1532
1533
|
style: {
|
|
1533
|
-
...
|
|
1534
|
-
...
|
|
1535
|
-
...
|
|
1534
|
+
...qe,
|
|
1535
|
+
...Wt,
|
|
1536
|
+
...s.isAbsolute || l ? jt : {},
|
|
1536
1537
|
...e ? {} : { backgroundColor: ye },
|
|
1537
|
-
zIndex:
|
|
1538
|
+
zIndex: s.swipeBarZIndex
|
|
1538
1539
|
},
|
|
1539
1540
|
className: e,
|
|
1540
1541
|
children: t
|
|
@@ -1542,21 +1543,21 @@ function or({
|
|
|
1542
1543
|
)
|
|
1543
1544
|
] });
|
|
1544
1545
|
}
|
|
1545
|
-
function
|
|
1546
|
-
const { openSidebar: i, rightToggleRef:
|
|
1546
|
+
function tr({ options: e, showToggle: t = !0, ToggleComponent: r }) {
|
|
1547
|
+
const { openSidebar: i, rightToggleRef: a, isRightOpen: o, closeSidebar: u } = J();
|
|
1547
1548
|
return t ? (
|
|
1548
1549
|
// 1px wide container
|
|
1549
|
-
/* @__PURE__ */
|
|
1550
|
+
/* @__PURE__ */ O.jsx(
|
|
1550
1551
|
"div",
|
|
1551
1552
|
{
|
|
1552
|
-
ref:
|
|
1553
|
+
ref: a,
|
|
1553
1554
|
style: {
|
|
1554
1555
|
...Qe,
|
|
1555
1556
|
transition: `transform ${e.transitionMs}ms ease, opacity ${e.transitionMs}ms ease`,
|
|
1556
1557
|
right: 0,
|
|
1557
1558
|
zIndex: e.toggleZIndex
|
|
1558
1559
|
},
|
|
1559
|
-
children: (!o || o && !e.showOverlay) && /* @__PURE__ */
|
|
1560
|
+
children: (!o || o && !e.showOverlay) && /* @__PURE__ */ O.jsx(
|
|
1560
1561
|
"button",
|
|
1561
1562
|
{
|
|
1562
1563
|
type: "button",
|
|
@@ -1569,7 +1570,7 @@ function Kt({ options: e, showToggle: t = !0, ToggleComponent: r }) {
|
|
|
1569
1570
|
// reverse because we are using the same icon for both left and right
|
|
1570
1571
|
...o ? {} : { transform: "rotate(180deg)" }
|
|
1571
1572
|
},
|
|
1572
|
-
children: r ?? /* @__PURE__ */
|
|
1573
|
+
children: r ?? /* @__PURE__ */ O.jsx(Ae, { size: e.toggleIconSizePx, color: e.toggleIconColor })
|
|
1573
1574
|
}
|
|
1574
1575
|
)
|
|
1575
1576
|
}
|
|
@@ -1581,36 +1582,36 @@ const Ge = ({
|
|
|
1581
1582
|
callbacks: t,
|
|
1582
1583
|
currentX: r,
|
|
1583
1584
|
preventDefault: i,
|
|
1584
|
-
lockPane:
|
|
1585
|
+
lockPane: a,
|
|
1585
1586
|
options: o
|
|
1586
1587
|
}) => {
|
|
1587
1588
|
if (!e.draggingRef.current) return;
|
|
1588
|
-
const u = window.innerWidth,
|
|
1589
|
-
if (!c && Math.abs(
|
|
1589
|
+
const u = window.innerWidth, s = r - e.draggingRef.current.startX, l = e.draggingRef.current.startX >= u - o.edgeActivationWidthPx, c = e.draggingRef.current.isActivated;
|
|
1590
|
+
if (!c && Math.abs(s) >= o.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0, a()), !c) return;
|
|
1590
1591
|
e.prevXRef.current = e.currentXRef.current, e.currentXRef.current = r;
|
|
1591
|
-
const
|
|
1592
|
-
let
|
|
1593
|
-
if ((
|
|
1592
|
+
const R = t.getIsOpen();
|
|
1593
|
+
let v = !1;
|
|
1594
|
+
if ((R || l) && (v = !0), !v) {
|
|
1594
1595
|
e.draggingRef.current = null, t.dragSidebar(null);
|
|
1595
1596
|
return;
|
|
1596
1597
|
}
|
|
1597
1598
|
i();
|
|
1598
|
-
const
|
|
1599
|
-
if (
|
|
1600
|
-
const
|
|
1599
|
+
const b = o.sidebarWidthPx;
|
|
1600
|
+
if (R) {
|
|
1601
|
+
const w = Math.max(
|
|
1601
1602
|
0,
|
|
1602
|
-
Math.min(
|
|
1603
|
+
Math.min(b, s - o.dragActivationDeltaPx)
|
|
1603
1604
|
);
|
|
1604
|
-
t.dragSidebar(
|
|
1605
|
+
t.dragSidebar(w);
|
|
1605
1606
|
} else {
|
|
1606
|
-
const
|
|
1607
|
+
const w = Math.max(
|
|
1607
1608
|
0,
|
|
1608
1609
|
Math.min(
|
|
1609
|
-
|
|
1610
|
-
|
|
1610
|
+
b,
|
|
1611
|
+
b + s + o.dragActivationDeltaPx
|
|
1611
1612
|
)
|
|
1612
1613
|
);
|
|
1613
|
-
t.dragSidebar(
|
|
1614
|
+
t.dragSidebar(w);
|
|
1614
1615
|
}
|
|
1615
1616
|
}, Ue = ({ refs: e, callbacks: t, options: r }) => {
|
|
1616
1617
|
if (!e.draggingRef.current) return;
|
|
@@ -1618,153 +1619,154 @@ const Ge = ({
|
|
|
1618
1619
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
|
|
1619
1620
|
return;
|
|
1620
1621
|
}
|
|
1621
|
-
const i = e.currentXRef.current ?? e.draggingRef.current.startX,
|
|
1622
|
+
const i = e.currentXRef.current ?? e.draggingRef.current.startX, a = e.prevXRef.current ?? e.draggingRef.current.startX, o = e.draggingRef.current.startX, u = t.getIsOpen(), s = window.innerWidth;
|
|
1622
1623
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
|
|
1623
|
-
const l = i >
|
|
1624
|
-
u ? (l ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null)) :
|
|
1624
|
+
const l = i > a, c = i < a, R = o >= s - r.edgeActivationWidthPx;
|
|
1625
|
+
u ? (l ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null)) : R && c ? (t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
|
|
1625
1626
|
};
|
|
1626
|
-
function
|
|
1627
|
+
function rr(e) {
|
|
1627
1628
|
const t = le(e.mediaQueryWidth), {
|
|
1628
1629
|
lockedSidebar: r,
|
|
1629
1630
|
setLockedSidebar: i,
|
|
1630
|
-
isRightOpen:
|
|
1631
|
+
isRightOpen: a,
|
|
1631
1632
|
openSidebar: o,
|
|
1632
1633
|
closeSidebar: u,
|
|
1633
|
-
dragSidebar:
|
|
1634
|
+
dragSidebar: s,
|
|
1634
1635
|
rightSidebarRef: l
|
|
1635
|
-
} =
|
|
1636
|
-
|
|
1636
|
+
} = J(), c = L(null), R = L(null), v = L(null);
|
|
1637
|
+
Z(() => {
|
|
1637
1638
|
if (!t || r && r !== "right" || e.disabled) return;
|
|
1638
|
-
const
|
|
1639
|
-
getIsOpen: () =>
|
|
1639
|
+
const b = {
|
|
1640
|
+
getIsOpen: () => a,
|
|
1640
1641
|
openSidebar: () => o("right"),
|
|
1641
1642
|
closeSidebar: () => u("right"),
|
|
1642
|
-
dragSidebar: (
|
|
1643
|
-
},
|
|
1643
|
+
dragSidebar: (f) => s("right", f)
|
|
1644
|
+
}, w = {
|
|
1644
1645
|
draggingRef: c,
|
|
1645
|
-
currentXRef:
|
|
1646
|
-
prevXRef:
|
|
1647
|
-
},
|
|
1648
|
-
function
|
|
1649
|
-
if (r && r !== "right" || ce(
|
|
1650
|
-
const
|
|
1651
|
-
|
|
1652
|
-
refs:
|
|
1653
|
-
clientX:
|
|
1654
|
-
clientY:
|
|
1655
|
-
touchId:
|
|
1646
|
+
currentXRef: R,
|
|
1647
|
+
prevXRef: v
|
|
1648
|
+
}, I = () => i("right"), y = () => i(null);
|
|
1649
|
+
function A(f) {
|
|
1650
|
+
if (r && r !== "right" || ce(f.target) || f.changedTouches.length === 0) return;
|
|
1651
|
+
const x = f.changedTouches[0], p = window.innerWidth, Y = b.getIsOpen(), X = x.clientX >= p - e.edgeActivationWidthPx;
|
|
1652
|
+
Y && !e.swipeToClose || !Y && !e.swipeToOpen || (Y || X) && he({
|
|
1653
|
+
refs: w,
|
|
1654
|
+
clientX: x.clientX,
|
|
1655
|
+
clientY: x.clientY,
|
|
1656
|
+
touchId: x.identifier,
|
|
1656
1657
|
isMouse: !1
|
|
1657
1658
|
});
|
|
1658
1659
|
}
|
|
1659
|
-
function
|
|
1660
|
+
function M(f) {
|
|
1660
1661
|
if (r && r !== "right" || !c.current || c.current.isMouse) return;
|
|
1661
|
-
const
|
|
1662
|
-
|
|
1663
|
-
refs:
|
|
1664
|
-
callbacks:
|
|
1665
|
-
currentX:
|
|
1666
|
-
preventDefault: () =>
|
|
1667
|
-
lockPane:
|
|
1662
|
+
const x = c.current.activeTouchId, p = Re(f.changedTouches, x);
|
|
1663
|
+
p && Ge({
|
|
1664
|
+
refs: w,
|
|
1665
|
+
callbacks: b,
|
|
1666
|
+
currentX: p.clientX,
|
|
1667
|
+
preventDefault: () => f.preventDefault(),
|
|
1668
|
+
lockPane: I,
|
|
1668
1669
|
options: e
|
|
1669
1670
|
});
|
|
1670
1671
|
}
|
|
1671
|
-
function _(
|
|
1672
|
+
function _(f) {
|
|
1672
1673
|
if (r && r !== "right" || !c.current || c.current.isMouse) return;
|
|
1673
|
-
const
|
|
1674
|
-
Te(
|
|
1675
|
-
refs:
|
|
1676
|
-
callbacks:
|
|
1674
|
+
const x = c.current.activeTouchId;
|
|
1675
|
+
Te(f.changedTouches, x) && Ue({
|
|
1676
|
+
refs: w,
|
|
1677
|
+
callbacks: b,
|
|
1677
1678
|
options: e
|
|
1678
1679
|
});
|
|
1679
1680
|
}
|
|
1680
|
-
function
|
|
1681
|
+
function W() {
|
|
1681
1682
|
r && r !== "right" || !c.current || c.current.isMouse || Je({
|
|
1682
|
-
refs:
|
|
1683
|
-
dragSidebar:
|
|
1683
|
+
refs: w,
|
|
1684
|
+
dragSidebar: b.dragSidebar,
|
|
1684
1685
|
onDeactivate: y
|
|
1685
1686
|
});
|
|
1686
1687
|
}
|
|
1687
|
-
function
|
|
1688
|
-
if (r && r !== "right" || ce(
|
|
1689
|
-
const
|
|
1690
|
-
|
|
1691
|
-
refs:
|
|
1692
|
-
clientX:
|
|
1693
|
-
clientY:
|
|
1688
|
+
function D(f) {
|
|
1689
|
+
if (r && r !== "right" || ce(f.target) || f.button !== 0) return;
|
|
1690
|
+
const x = window.innerWidth, p = b.getIsOpen(), Y = f.clientX >= x - e.edgeActivationWidthPx;
|
|
1691
|
+
p && !e.swipeToClose || !p && !e.swipeToOpen || (p || Y) && he({
|
|
1692
|
+
refs: w,
|
|
1693
|
+
clientX: f.clientX,
|
|
1694
|
+
clientY: f.clientY,
|
|
1694
1695
|
touchId: null,
|
|
1695
1696
|
isMouse: !0
|
|
1696
1697
|
});
|
|
1697
1698
|
}
|
|
1698
|
-
function j(
|
|
1699
|
+
function j(f) {
|
|
1699
1700
|
r && r !== "right" || !c.current || !c.current.isMouse || Ge({
|
|
1700
|
-
refs:
|
|
1701
|
-
callbacks:
|
|
1702
|
-
currentX:
|
|
1703
|
-
preventDefault: () =>
|
|
1704
|
-
lockPane:
|
|
1701
|
+
refs: w,
|
|
1702
|
+
callbacks: b,
|
|
1703
|
+
currentX: f.clientX,
|
|
1704
|
+
preventDefault: () => f.preventDefault(),
|
|
1705
|
+
lockPane: I,
|
|
1705
1706
|
options: e
|
|
1706
1707
|
});
|
|
1707
1708
|
}
|
|
1708
|
-
function
|
|
1709
|
+
function N() {
|
|
1709
1710
|
r && r !== "right" || !c.current || !c.current.isMouse || Ue({
|
|
1710
|
-
refs:
|
|
1711
|
-
callbacks:
|
|
1711
|
+
refs: w,
|
|
1712
|
+
callbacks: b,
|
|
1712
1713
|
options: e
|
|
1713
1714
|
});
|
|
1714
1715
|
}
|
|
1715
|
-
return window.addEventListener("touchstart",
|
|
1716
|
-
window.removeEventListener("touchstart",
|
|
1716
|
+
return window.addEventListener("touchstart", A, { passive: !0 }), window.addEventListener("touchmove", M, { passive: !1 }), window.addEventListener("touchend", _, { passive: !0 }), window.addEventListener("touchcancel", W, { passive: !0 }), window.addEventListener("mousedown", D, { passive: !0 }), window.addEventListener("mousemove", j, { passive: !1 }), window.addEventListener("mouseup", N, { passive: !0 }), () => {
|
|
1717
|
+
window.removeEventListener("touchstart", A), window.removeEventListener("touchmove", M), window.removeEventListener("touchend", _), window.removeEventListener("touchcancel", W), window.removeEventListener("mousedown", D), window.removeEventListener("mousemove", j), window.removeEventListener("mouseup", N);
|
|
1717
1718
|
};
|
|
1718
1719
|
}, [
|
|
1719
1720
|
t,
|
|
1720
|
-
|
|
1721
|
+
a,
|
|
1721
1722
|
o,
|
|
1722
1723
|
u,
|
|
1723
|
-
|
|
1724
|
+
s,
|
|
1724
1725
|
r,
|
|
1725
1726
|
i,
|
|
1726
1727
|
l,
|
|
1727
1728
|
e
|
|
1728
1729
|
]);
|
|
1729
1730
|
}
|
|
1730
|
-
function
|
|
1731
|
+
function cr({
|
|
1731
1732
|
className: e,
|
|
1732
1733
|
children: t,
|
|
1733
1734
|
ToggleComponent: r,
|
|
1734
1735
|
...i
|
|
1735
1736
|
}) {
|
|
1736
|
-
if ((t == null ? void 0 : t.type) ===
|
|
1737
|
+
if ((t == null ? void 0 : t.type) === O.Fragment)
|
|
1737
1738
|
throw new Error("Fragments is not allowed in SwipeBarRight");
|
|
1738
|
-
const { isRightOpen:
|
|
1739
|
-
return
|
|
1740
|
-
|
|
1741
|
-
|
|
1739
|
+
const { isRightOpen: a, closeSidebar: o, rightSidebarRef: u } = J(), s = Oe("right", i), l = le(s.mediaQueryWidth);
|
|
1740
|
+
return rr(s), /* @__PURE__ */ O.jsxs(O.Fragment, { children: [
|
|
1741
|
+
s.showOverlay && /* @__PURE__ */ O.jsx(
|
|
1742
|
+
Ee,
|
|
1742
1743
|
{
|
|
1743
|
-
isCollapsed: !
|
|
1744
|
+
isCollapsed: !a,
|
|
1744
1745
|
setCollapsed: () => o("right"),
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1746
|
+
closeSidebarOnClick: s.closeSidebarOnOverlayClick,
|
|
1747
|
+
transitionMs: s.transitionMs,
|
|
1748
|
+
overlayBackgroundColor: s.overlayBackgroundColor,
|
|
1749
|
+
overlayZIndex: s.overlayZIndex
|
|
1748
1750
|
}
|
|
1749
1751
|
),
|
|
1750
|
-
/* @__PURE__ */
|
|
1751
|
-
|
|
1752
|
+
/* @__PURE__ */ O.jsx(
|
|
1753
|
+
tr,
|
|
1752
1754
|
{
|
|
1753
|
-
options:
|
|
1754
|
-
showToggle:
|
|
1755
|
+
options: s,
|
|
1756
|
+
showToggle: s.showToggle,
|
|
1755
1757
|
ToggleComponent: r
|
|
1756
1758
|
}
|
|
1757
1759
|
),
|
|
1758
|
-
/* @__PURE__ */
|
|
1760
|
+
/* @__PURE__ */ O.jsx(
|
|
1759
1761
|
"div",
|
|
1760
1762
|
{
|
|
1761
1763
|
ref: u,
|
|
1762
1764
|
style: {
|
|
1763
|
-
...
|
|
1764
|
-
|
|
1765
|
-
...
|
|
1765
|
+
...qe,
|
|
1766
|
+
...Bt,
|
|
1767
|
+
...s.isAbsolute || l ? kt : {},
|
|
1766
1768
|
...e ? {} : { backgroundColor: ye },
|
|
1767
|
-
zIndex:
|
|
1769
|
+
zIndex: s.swipeBarZIndex
|
|
1768
1770
|
},
|
|
1769
1771
|
className: e,
|
|
1770
1772
|
children: t
|
|
@@ -1773,14 +1775,14 @@ function sr({
|
|
|
1773
1775
|
] });
|
|
1774
1776
|
}
|
|
1775
1777
|
export {
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1778
|
+
Ee as Overlay,
|
|
1779
|
+
ar as SwipeBarBottom,
|
|
1780
|
+
sr as SwipeBarLeft,
|
|
1781
|
+
or as SwipeBarProvider,
|
|
1782
|
+
cr as SwipeBarRight,
|
|
1783
|
+
Qt as ToggleBottom,
|
|
1784
|
+
Kt as ToggleLeft,
|
|
1785
|
+
tr as ToggleRight,
|
|
1784
1786
|
le as useMediaQuery,
|
|
1785
|
-
|
|
1787
|
+
J as useSwipeBarContext
|
|
1786
1788
|
};
|