@fullkekw/popup 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -23
- package/dist/Interfaces.d.ts +1 -1
- package/dist/Package.d.ts +1 -1
- package/dist/index.es.js +137 -137
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +8 -8
- package/dist/index.umd.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +66 -66
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Le, { createContext as Er, useState as k, useEffect as L, useContext as Ye } from "react";
|
|
2
2
|
import { createPortal as _r } from "react-dom";
|
|
3
|
-
function Rr(
|
|
4
|
-
return
|
|
3
|
+
function Rr(m) {
|
|
4
|
+
return m && m.__esModule && Object.prototype.hasOwnProperty.call(m, "default") ? m.default : m;
|
|
5
5
|
}
|
|
6
6
|
var K = { exports: {} }, V = {};
|
|
7
7
|
/**
|
|
@@ -17,15 +17,15 @@ var Fe;
|
|
|
17
17
|
function xr() {
|
|
18
18
|
if (Fe) return V;
|
|
19
19
|
Fe = 1;
|
|
20
|
-
var
|
|
21
|
-
function c(d,
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
for (
|
|
25
|
-
if (d && d.defaultProps) for (
|
|
26
|
-
return { $$typeof: O, type: d, key:
|
|
20
|
+
var m = Le, O = Symbol.for("react.element"), _ = Symbol.for("react.fragment"), v = Object.prototype.hasOwnProperty, p = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
21
|
+
function c(d, y, P) {
|
|
22
|
+
var u, g = {}, a = null, x = null;
|
|
23
|
+
P !== void 0 && (a = "" + P), y.key !== void 0 && (a = "" + y.key), y.ref !== void 0 && (x = y.ref);
|
|
24
|
+
for (u in y) v.call(y, u) && !i.hasOwnProperty(u) && (g[u] = y[u]);
|
|
25
|
+
if (d && d.defaultProps) for (u in y = d.defaultProps, y) g[u] === void 0 && (g[u] = y[u]);
|
|
26
|
+
return { $$typeof: O, type: d, key: a, ref: x, props: g, _owner: p.current };
|
|
27
27
|
}
|
|
28
|
-
return V.Fragment =
|
|
28
|
+
return V.Fragment = _, V.jsx = c, V.jsxs = c, V;
|
|
29
29
|
}
|
|
30
30
|
var U = {};
|
|
31
31
|
/**
|
|
@@ -40,15 +40,15 @@ var U = {};
|
|
|
40
40
|
var Ne;
|
|
41
41
|
function Or() {
|
|
42
42
|
return Ne || (Ne = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
-
var
|
|
43
|
+
var m = Le, O = Symbol.for("react.element"), _ = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), p = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), d = Symbol.for("react.context"), y = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), a = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), h = Symbol.iterator, C = "@@iterator";
|
|
44
44
|
function X(e) {
|
|
45
45
|
if (e === null || typeof e != "object")
|
|
46
46
|
return null;
|
|
47
|
-
var r =
|
|
47
|
+
var r = h && e[h] || e[C];
|
|
48
48
|
return typeof r == "function" ? r : null;
|
|
49
49
|
}
|
|
50
|
-
var S =
|
|
51
|
-
function
|
|
50
|
+
var S = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
+
function R(e) {
|
|
52
52
|
{
|
|
53
53
|
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
54
54
|
t[n - 1] = arguments[n];
|
|
@@ -68,7 +68,7 @@ function Or() {
|
|
|
68
68
|
var Z = !1, I = !1, Q = !1, Ue = !1, ze = !1, ce;
|
|
69
69
|
ce = Symbol.for("react.module.reference");
|
|
70
70
|
function qe(e) {
|
|
71
|
-
return !!(typeof e == "string" || typeof e == "function" || e === v || e ===
|
|
71
|
+
return !!(typeof e == "string" || typeof e == "function" || e === v || e === i || ze || e === p || e === P || e === u || Ue || e === x || Z || I || Q || typeof e == "object" && e !== null && (e.$$typeof === a || e.$$typeof === g || e.$$typeof === c || e.$$typeof === d || e.$$typeof === y || // This needs to include all possible module reference object
|
|
72
72
|
// types supported by any Flight configuration anywhere since
|
|
73
73
|
// we don't know which Flight build this will end up being used
|
|
74
74
|
// with.
|
|
@@ -87,22 +87,22 @@ function Or() {
|
|
|
87
87
|
function D(e) {
|
|
88
88
|
if (e == null)
|
|
89
89
|
return null;
|
|
90
|
-
if (typeof e.tag == "number" &&
|
|
90
|
+
if (typeof e.tag == "number" && R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
91
91
|
return e.displayName || e.name || null;
|
|
92
92
|
if (typeof e == "string")
|
|
93
93
|
return e;
|
|
94
94
|
switch (e) {
|
|
95
95
|
case v:
|
|
96
96
|
return "Fragment";
|
|
97
|
-
case
|
|
97
|
+
case _:
|
|
98
98
|
return "Portal";
|
|
99
|
-
case
|
|
99
|
+
case i:
|
|
100
100
|
return "Profiler";
|
|
101
101
|
case p:
|
|
102
102
|
return "StrictMode";
|
|
103
|
-
case
|
|
103
|
+
case P:
|
|
104
104
|
return "Suspense";
|
|
105
|
-
case
|
|
105
|
+
case u:
|
|
106
106
|
return "SuspenseList";
|
|
107
107
|
}
|
|
108
108
|
if (typeof e == "object")
|
|
@@ -113,12 +113,12 @@ function Or() {
|
|
|
113
113
|
case c:
|
|
114
114
|
var t = e;
|
|
115
115
|
return le(t._context) + ".Provider";
|
|
116
|
-
case
|
|
116
|
+
case y:
|
|
117
117
|
return Je(e, e.render, "ForwardRef");
|
|
118
118
|
case g:
|
|
119
119
|
var n = e.displayName || null;
|
|
120
120
|
return n !== null ? n : D(e.type) || "Memo";
|
|
121
|
-
case
|
|
121
|
+
case a: {
|
|
122
122
|
var f = e, l = f._payload, s = f._init;
|
|
123
123
|
try {
|
|
124
124
|
return D(s(l));
|
|
@@ -188,7 +188,7 @@ function Or() {
|
|
|
188
188
|
})
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
-
Y < 0 &&
|
|
191
|
+
Y < 0 && R("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
var ee = S.ReactCurrentDispatcher, re;
|
|
@@ -258,20 +258,20 @@ function Or() {
|
|
|
258
258
|
}
|
|
259
259
|
} catch (T) {
|
|
260
260
|
if (T && n && typeof T.stack == "string") {
|
|
261
|
-
for (var
|
|
261
|
+
for (var o = T.stack.split(`
|
|
262
262
|
`), w = n.stack.split(`
|
|
263
|
-
`),
|
|
263
|
+
`), b = o.length - 1, E = w.length - 1; b >= 1 && E >= 0 && o[b] !== w[E]; )
|
|
264
264
|
E--;
|
|
265
|
-
for (;
|
|
266
|
-
if (
|
|
267
|
-
if (
|
|
265
|
+
for (; b >= 1 && E >= 0; b--, E--)
|
|
266
|
+
if (o[b] !== w[E]) {
|
|
267
|
+
if (b !== 1 || E !== 1)
|
|
268
268
|
do
|
|
269
|
-
if (
|
|
269
|
+
if (b--, E--, E < 0 || o[b] !== w[E]) {
|
|
270
270
|
var j = `
|
|
271
|
-
` +
|
|
271
|
+
` + o[b].replace(" at new ", " at ");
|
|
272
272
|
return e.displayName && j.includes("<anonymous>") && (j = j.replace("<anonymous>", e.displayName)), typeof e == "function" && q.set(e, j), j;
|
|
273
273
|
}
|
|
274
|
-
while (
|
|
274
|
+
while (b >= 1 && E >= 0);
|
|
275
275
|
break;
|
|
276
276
|
}
|
|
277
277
|
}
|
|
@@ -296,18 +296,18 @@ function Or() {
|
|
|
296
296
|
if (typeof e == "string")
|
|
297
297
|
return z(e);
|
|
298
298
|
switch (e) {
|
|
299
|
-
case
|
|
299
|
+
case P:
|
|
300
300
|
return z("Suspense");
|
|
301
|
-
case
|
|
301
|
+
case u:
|
|
302
302
|
return z("SuspenseList");
|
|
303
303
|
}
|
|
304
304
|
if (typeof e == "object")
|
|
305
305
|
switch (e.$$typeof) {
|
|
306
|
-
case
|
|
306
|
+
case y:
|
|
307
307
|
return Xe(e.render);
|
|
308
308
|
case g:
|
|
309
309
|
return J(e.type, r, t);
|
|
310
|
-
case
|
|
310
|
+
case a: {
|
|
311
311
|
var n = e, f = n._payload, l = n._init;
|
|
312
312
|
try {
|
|
313
313
|
return J(l(f), r, t);
|
|
@@ -330,17 +330,17 @@ function Or() {
|
|
|
330
330
|
var l = Function.call.bind(M);
|
|
331
331
|
for (var s in e)
|
|
332
332
|
if (l(e, s)) {
|
|
333
|
-
var
|
|
333
|
+
var o = void 0;
|
|
334
334
|
try {
|
|
335
335
|
if (typeof e[s] != "function") {
|
|
336
336
|
var w = Error((n || "React class") + ": " + t + " type `" + s + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[s] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
337
337
|
throw w.name = "Invariant Violation", w;
|
|
338
338
|
}
|
|
339
|
-
|
|
340
|
-
} catch (
|
|
341
|
-
|
|
339
|
+
o = e[s](r, s, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
+
} catch (b) {
|
|
341
|
+
o = b;
|
|
342
342
|
}
|
|
343
|
-
|
|
343
|
+
o && !(o instanceof Error) && (B(f), R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, s, typeof o), B(null)), o instanceof Error && !(o.message in _e) && (_e[o.message] = !0, B(f), R("Failed %s type: %s", t, o.message), B(null));
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
}
|
|
@@ -366,7 +366,7 @@ function Or() {
|
|
|
366
366
|
}
|
|
367
367
|
function Oe(e) {
|
|
368
368
|
if (rr(e))
|
|
369
|
-
return
|
|
369
|
+
return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", er(e)), xe(e);
|
|
370
370
|
}
|
|
371
371
|
var we = S.ReactCurrentOwner, tr = {
|
|
372
372
|
key: !0,
|
|
@@ -396,7 +396,7 @@ function Or() {
|
|
|
396
396
|
function ir(e, r) {
|
|
397
397
|
{
|
|
398
398
|
var t = function() {
|
|
399
|
-
Se || (Se = !0,
|
|
399
|
+
Se || (Se = !0, R("%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://reactjs.org/link/special-props)", r));
|
|
400
400
|
};
|
|
401
401
|
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
402
402
|
get: t,
|
|
@@ -407,7 +407,7 @@ function Or() {
|
|
|
407
407
|
function ur(e, r) {
|
|
408
408
|
{
|
|
409
409
|
var t = function() {
|
|
410
|
-
Te || (Te = !0,
|
|
410
|
+
Te || (Te = !0, R("%s: `ref` 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://reactjs.org/link/special-props)", r));
|
|
411
411
|
};
|
|
412
412
|
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
413
413
|
get: t,
|
|
@@ -416,7 +416,7 @@ function Or() {
|
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
var sr = function(e, r, t, n, f, l, s) {
|
|
419
|
-
var
|
|
419
|
+
var o = {
|
|
420
420
|
// This tag allows us to uniquely identify this as a React Element
|
|
421
421
|
$$typeof: O,
|
|
422
422
|
// Built-in properties that belong on the element
|
|
@@ -427,39 +427,39 @@ function Or() {
|
|
|
427
427
|
// Record the component responsible for creating this element.
|
|
428
428
|
_owner: l
|
|
429
429
|
};
|
|
430
|
-
return
|
|
430
|
+
return o._store = {}, Object.defineProperty(o._store, "validated", {
|
|
431
431
|
configurable: !1,
|
|
432
432
|
enumerable: !1,
|
|
433
433
|
writable: !0,
|
|
434
434
|
value: !1
|
|
435
|
-
}), Object.defineProperty(
|
|
435
|
+
}), Object.defineProperty(o, "_self", {
|
|
436
436
|
configurable: !1,
|
|
437
437
|
enumerable: !1,
|
|
438
438
|
writable: !1,
|
|
439
439
|
value: n
|
|
440
|
-
}), Object.defineProperty(
|
|
440
|
+
}), Object.defineProperty(o, "_source", {
|
|
441
441
|
configurable: !1,
|
|
442
442
|
enumerable: !1,
|
|
443
443
|
writable: !1,
|
|
444
444
|
value: f
|
|
445
|
-
}), Object.freeze && (Object.freeze(
|
|
445
|
+
}), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
|
|
446
446
|
};
|
|
447
447
|
function fr(e, r, t, n, f) {
|
|
448
448
|
{
|
|
449
|
-
var l, s = {},
|
|
450
|
-
t !== void 0 && (Oe(t),
|
|
449
|
+
var l, s = {}, o = null, w = null;
|
|
450
|
+
t !== void 0 && (Oe(t), o = "" + t), ar(r) && (Oe(r.key), o = "" + r.key), nr(r) && (w = r.ref, or(r, f));
|
|
451
451
|
for (l in r)
|
|
452
452
|
M.call(r, l) && !tr.hasOwnProperty(l) && (s[l] = r[l]);
|
|
453
453
|
if (e && e.defaultProps) {
|
|
454
|
-
var
|
|
455
|
-
for (l in
|
|
456
|
-
s[l] === void 0 && (s[l] =
|
|
454
|
+
var b = e.defaultProps;
|
|
455
|
+
for (l in b)
|
|
456
|
+
s[l] === void 0 && (s[l] = b[l]);
|
|
457
457
|
}
|
|
458
|
-
if (
|
|
458
|
+
if (o || w) {
|
|
459
459
|
var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
460
|
-
|
|
460
|
+
o && ir(s, E), w && ur(s, E);
|
|
461
461
|
}
|
|
462
|
-
return sr(e,
|
|
462
|
+
return sr(e, o, w, f, n, we.current, s);
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
465
|
var ae = S.ReactCurrentOwner, Pe = S.ReactDebugCurrentFrame;
|
|
@@ -513,7 +513,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
513
513
|
return;
|
|
514
514
|
je[t] = !0;
|
|
515
515
|
var n = "";
|
|
516
|
-
e && e._owner && e._owner !== ae.current && (n = " It was passed a child from " + D(e._owner.type) + "."), $(e),
|
|
516
|
+
e && e._owner && e._owner !== ae.current && (n = " It was passed a child from " + D(e._owner.type) + "."), $(e), R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), $(null);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
function De(e, r) {
|
|
@@ -543,7 +543,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
543
543
|
var t;
|
|
544
544
|
if (typeof r == "function")
|
|
545
545
|
t = r.propTypes;
|
|
546
|
-
else if (typeof r == "object" && (r.$$typeof ===
|
|
546
|
+
else if (typeof r == "object" && (r.$$typeof === y || // Note: Memo only checks outer props here.
|
|
547
547
|
// Inner props are checked in the reconciler.
|
|
548
548
|
r.$$typeof === g))
|
|
549
549
|
t = r.propTypes;
|
|
@@ -555,9 +555,9 @@ Check the top-level render call using <` + t + ">.");
|
|
|
555
555
|
} else if (r.PropTypes !== void 0 && !oe) {
|
|
556
556
|
oe = !0;
|
|
557
557
|
var f = D(r);
|
|
558
|
-
|
|
558
|
+
R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", f || "Unknown");
|
|
559
559
|
}
|
|
560
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
560
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
563
|
function pr(e) {
|
|
@@ -565,11 +565,11 @@ Check the top-level render call using <` + t + ">.");
|
|
|
565
565
|
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
566
566
|
var n = r[t];
|
|
567
567
|
if (n !== "children" && n !== "key") {
|
|
568
|
-
$(e),
|
|
568
|
+
$(e), R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), $(null);
|
|
569
569
|
break;
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
e.ref !== null && ($(e),
|
|
572
|
+
e.ref !== null && ($(e), R("Invalid attribute `ref` supplied to `React.Fragment`."), $(null));
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
var Ie = {};
|
|
@@ -577,12 +577,12 @@ Check the top-level render call using <` + t + ">.");
|
|
|
577
577
|
{
|
|
578
578
|
var s = qe(e);
|
|
579
579
|
if (!s) {
|
|
580
|
-
var
|
|
581
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
580
|
+
var o = "";
|
|
581
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (o += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
582
582
|
var w = cr();
|
|
583
|
-
w ?
|
|
584
|
-
var
|
|
585
|
-
e === null ?
|
|
583
|
+
w ? o += w : o += Ce();
|
|
584
|
+
var b;
|
|
585
|
+
e === null ? b = "null" : ne(e) ? b = "array" : e !== void 0 && e.$$typeof === O ? (b = "<" + (D(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : b = typeof e, R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", b, o);
|
|
586
586
|
}
|
|
587
587
|
var E = fr(e, r, t, f, l);
|
|
588
588
|
if (E == null)
|
|
@@ -596,7 +596,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
596
596
|
De(j[W], e);
|
|
597
597
|
Object.freeze && Object.freeze(j);
|
|
598
598
|
} else
|
|
599
|
-
|
|
599
|
+
R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
600
600
|
else
|
|
601
601
|
De(j, e);
|
|
602
602
|
}
|
|
@@ -606,7 +606,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
606
606
|
}), ue = T.length > 0 ? "{key: someKey, " + T.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
607
607
|
if (!Ie[F + ue]) {
|
|
608
608
|
var br = T.length > 0 ? "{" + T.join(": ..., ") + ": ...}" : "{}";
|
|
609
|
-
|
|
609
|
+
R(`A props object containing a "key" prop is being spread into JSX:
|
|
610
610
|
let props = %s;
|
|
611
611
|
<%s {...props} />
|
|
612
612
|
React keys must be passed directly to JSX without using spread:
|
|
@@ -639,34 +639,34 @@ var N = wr(), se = { exports: {} };
|
|
|
639
639
|
*/
|
|
640
640
|
var We;
|
|
641
641
|
function Sr() {
|
|
642
|
-
return We || (We = 1, function(
|
|
642
|
+
return We || (We = 1, function(m) {
|
|
643
643
|
(function() {
|
|
644
644
|
var O = {}.hasOwnProperty;
|
|
645
|
-
function
|
|
646
|
-
for (var
|
|
645
|
+
function _() {
|
|
646
|
+
for (var i = "", c = 0; c < arguments.length; c++) {
|
|
647
647
|
var d = arguments[c];
|
|
648
|
-
d && (
|
|
648
|
+
d && (i = p(i, v(d)));
|
|
649
649
|
}
|
|
650
|
-
return
|
|
650
|
+
return i;
|
|
651
651
|
}
|
|
652
|
-
function v(
|
|
653
|
-
if (typeof
|
|
654
|
-
return
|
|
655
|
-
if (typeof
|
|
652
|
+
function v(i) {
|
|
653
|
+
if (typeof i == "string" || typeof i == "number")
|
|
654
|
+
return i;
|
|
655
|
+
if (typeof i != "object")
|
|
656
656
|
return "";
|
|
657
|
-
if (Array.isArray(
|
|
658
|
-
return
|
|
659
|
-
if (
|
|
660
|
-
return
|
|
657
|
+
if (Array.isArray(i))
|
|
658
|
+
return _.apply(null, i);
|
|
659
|
+
if (i.toString !== Object.prototype.toString && !i.toString.toString().includes("[native code]"))
|
|
660
|
+
return i.toString();
|
|
661
661
|
var c = "";
|
|
662
|
-
for (var d in
|
|
663
|
-
O.call(
|
|
662
|
+
for (var d in i)
|
|
663
|
+
O.call(i, d) && i[d] && (c = p(c, d));
|
|
664
664
|
return c;
|
|
665
665
|
}
|
|
666
|
-
function p(
|
|
667
|
-
return c ?
|
|
666
|
+
function p(i, c) {
|
|
667
|
+
return c ? i ? i + " " + c : i + c : i;
|
|
668
668
|
}
|
|
669
|
-
|
|
669
|
+
m.exports ? (_.default = _, m.exports = _) : window.classNames = _;
|
|
670
670
|
})();
|
|
671
671
|
}(se)), se.exports;
|
|
672
672
|
}
|
|
@@ -676,68 +676,68 @@ const G = /* @__PURE__ */ Rr(Tr), Me = {
|
|
|
676
676
|
exitOnDocument: !0,
|
|
677
677
|
exitOnEscape: !0,
|
|
678
678
|
preventStateChange: !1
|
|
679
|
-
}, fe = Er({}), Pr = ({ className:
|
|
680
|
-
const [v] = k(Ve(O ?? {}, Me)), [p,
|
|
679
|
+
}, fe = Er({}), Pr = ({ className: m, settings: O, children: _ }) => {
|
|
680
|
+
const [v] = k(Ve(O ?? {}, Me)), [p, i] = k([]), c = {
|
|
681
681
|
nodes: p,
|
|
682
682
|
toggleNode: d,
|
|
683
|
-
registerNode:
|
|
684
|
-
toggleDocument:
|
|
683
|
+
registerNode: y,
|
|
684
|
+
toggleDocument: P
|
|
685
685
|
};
|
|
686
686
|
L(() => {
|
|
687
687
|
if (typeof window > "u") return;
|
|
688
|
-
window.addEventListener("keydown",
|
|
689
|
-
function
|
|
688
|
+
window.addEventListener("keydown", u);
|
|
689
|
+
function u(g) {
|
|
690
690
|
if (g.key === "Escape") {
|
|
691
|
-
const
|
|
692
|
-
if (!
|
|
693
|
-
d(
|
|
691
|
+
const x = Math.max(...p.filter((C) => C.open).map((C) => C.zIndex)), h = p.find((C) => C.open && C.zIndex === x);
|
|
692
|
+
if (!h || !h.settings.exitOnEscape || !(v != null && v.exitOnEscape)) return;
|
|
693
|
+
d(h.id);
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
696
|
return () => {
|
|
697
|
-
window.removeEventListener("keydown",
|
|
697
|
+
window.removeEventListener("keydown", u);
|
|
698
698
|
};
|
|
699
699
|
}, [p]);
|
|
700
|
-
function d(
|
|
701
|
-
let
|
|
702
|
-
if (typeof
|
|
703
|
-
if ((v.preventStateChange ||
|
|
704
|
-
const
|
|
705
|
-
|
|
700
|
+
function d(u, g) {
|
|
701
|
+
let a;
|
|
702
|
+
if (typeof u == "string" ? a = { ...p.find((h) => h.id === u) } : a = { ...u }, !a.id) return;
|
|
703
|
+
if ((v.preventStateChange || a.settings.preventStateChange) && g === void 0) return console.warn("Popup action prevented");
|
|
704
|
+
const x = g ?? !(a != null && a.open);
|
|
705
|
+
a.open = x, a.zIndex = x ? Math.max(...p.map((h) => h.zIndex), 0) + 1 : 0, i((h) => [...h.filter((C) => C.id !== a.id), a]), v.disableScroll && a.settings.disableScroll && x && document.body.classList.add("fkw-popup--noScroll"), !x && !p.filter((h) => h.id !== a.id).some((h) => h.open) && document.body.classList.remove("fkw-popup--noScroll");
|
|
706
706
|
}
|
|
707
|
-
function
|
|
708
|
-
|
|
707
|
+
function y(u) {
|
|
708
|
+
i((g) => [...g, u]), u.open && d(u, !0);
|
|
709
709
|
}
|
|
710
|
-
function
|
|
711
|
-
const
|
|
712
|
-
!
|
|
710
|
+
function P(u, g) {
|
|
711
|
+
const a = { ...p.find((h) => h.id === u) };
|
|
712
|
+
!a.id || !a.settings.exitOnDocument || g.target.closest(".fkw-popup") || !a.settings.exitOnDocument || !v.exitOnDocument || d(a.id);
|
|
713
713
|
}
|
|
714
714
|
return /* @__PURE__ */ N.jsxs(fe.Provider, { value: c, children: [
|
|
715
|
-
|
|
716
|
-
/* @__PURE__ */ N.jsx("section", { className: G("fkw-popup-container",
|
|
715
|
+
_,
|
|
716
|
+
/* @__PURE__ */ N.jsx("section", { className: G("fkw-popup-container", m), id: "fkw-popup-container" })
|
|
717
717
|
] });
|
|
718
|
-
}, Cr = ({ children:
|
|
719
|
-
const
|
|
718
|
+
}, Cr = ({ children: m, className: O, layerClassName: _, style: v, id: p, settings: i, isOpen: c, setIsOpen: d, animation: y, ...P }) => {
|
|
719
|
+
const u = Ye(fe), [g] = k(y ?? "scale"), [a] = k(Ve(i ?? {}, Me)), [x, h] = k(!1), [C, X] = k(null), [S, R] = k(!1), [H, Z] = k(0);
|
|
720
720
|
return L(() => {
|
|
721
|
-
X(document.querySelector("#fkw-popup-container")),
|
|
721
|
+
X(document.querySelector("#fkw-popup-container")), h(!0), u.registerNode({
|
|
722
722
|
id: p,
|
|
723
723
|
open: !1,
|
|
724
724
|
zIndex: 0,
|
|
725
|
-
settings:
|
|
725
|
+
settings: a
|
|
726
726
|
});
|
|
727
727
|
}, []), L(() => {
|
|
728
|
-
const I =
|
|
729
|
-
I && (
|
|
730
|
-
}, [
|
|
728
|
+
const I = u.nodes.find((Q) => Q.id === p);
|
|
729
|
+
I && (R(I.open), Z(I.zIndex));
|
|
730
|
+
}, [u]), L(() => {
|
|
731
731
|
d === void 0 || c === S || d(S);
|
|
732
732
|
}, [S]), L(() => {
|
|
733
|
-
c === void 0 || c === S ||
|
|
734
|
-
}, [c]), !
|
|
733
|
+
c === void 0 || c === S || u.toggleNode(p, c);
|
|
734
|
+
}, [c]), !x || !C ? null : _r(/* @__PURE__ */ N.jsx(N.Fragment, { children: /* @__PURE__ */ N.jsx(
|
|
735
735
|
"section",
|
|
736
736
|
{
|
|
737
737
|
id: p,
|
|
738
|
-
className: G("fkw-popup-layer", S && "fkw-popup-layer--open",
|
|
739
|
-
style: { zIndex: 1e4 + H, cursor:
|
|
740
|
-
onClick:
|
|
738
|
+
className: G("fkw-popup-layer", S && "fkw-popup-layer--open", _),
|
|
739
|
+
style: { zIndex: 1e4 + H, cursor: a.exitOnDocument && !a.preventStateChange ? "pointer" : "auto", ...v },
|
|
740
|
+
onClick: a.exitOnDocument && !a.preventStateChange ? (I) => u.toggleDocument(p, I) : void 0,
|
|
741
741
|
children: /* @__PURE__ */ N.jsx(
|
|
742
742
|
"article",
|
|
743
743
|
{
|
|
@@ -745,28 +745,28 @@ const G = /* @__PURE__ */ Rr(Tr), Me = {
|
|
|
745
745
|
role: "dialog",
|
|
746
746
|
"aria-modal": !0,
|
|
747
747
|
"aria-hidden": !S,
|
|
748
|
-
...
|
|
749
|
-
children:
|
|
748
|
+
...P,
|
|
749
|
+
children: m
|
|
750
750
|
}
|
|
751
751
|
)
|
|
752
752
|
}
|
|
753
|
-
) }),
|
|
754
|
-
}, jr = ({ children:
|
|
755
|
-
const d = Ye(fe),
|
|
753
|
+
) }), C);
|
|
754
|
+
}, jr = ({ children: m, as: O, className: _, onClick: v, disabled: p, popupId: i, ...c }) => {
|
|
755
|
+
const d = Ye(fe), y = O ?? "button", [P, u] = k(!1);
|
|
756
756
|
L(() => {
|
|
757
|
-
const
|
|
758
|
-
|
|
757
|
+
const a = d.nodes.find((x) => x.id === i);
|
|
758
|
+
a && u(a.open);
|
|
759
759
|
}, [d]);
|
|
760
|
-
function
|
|
761
|
-
|
|
760
|
+
function g(a) {
|
|
761
|
+
d.toggleNode(i), v && v(a);
|
|
762
762
|
}
|
|
763
|
-
return /* @__PURE__ */ N.jsx(
|
|
763
|
+
return /* @__PURE__ */ N.jsx(y, { className: G("fkw-popup-button", P && "fkw-popup-button--active", _), role: "button", onClick: g, "aria-haspopup": "dialog", tabIndex: 0, disabled: p, "aria-disabled": p, "data-fkw-popup-operator": i, "aria-label": P ? "Close Popup" : "Open Popup", ...c, children: m });
|
|
764
764
|
};
|
|
765
|
-
function Ve(
|
|
766
|
-
const
|
|
767
|
-
for (const v in
|
|
768
|
-
|
|
769
|
-
return
|
|
765
|
+
function Ve(m, O) {
|
|
766
|
+
const _ = { ...O };
|
|
767
|
+
for (const v in m)
|
|
768
|
+
_[v] = m[v];
|
|
769
|
+
return _;
|
|
770
770
|
}
|
|
771
771
|
const Ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
772
772
|
__proto__: null,
|