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