aptechka 0.83.1 → 0.84.0
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/lib/Animation-BAiM6_n1.js +111 -0
- package/lib/Animation-DMWabSR0.cjs +1 -0
- package/lib/Composed-B0fvCtZz.cjs +1 -0
- package/lib/Composed-CgA9lLWA.js +75 -0
- package/lib/Damped-BLo-OAVb.cjs +1 -0
- package/lib/Damped-Dcz5UdMH.js +57 -0
- package/lib/DerivedArray-DFhxap_z.js +63 -0
- package/lib/DerivedArray-DYtWMW0n.cjs +1 -0
- package/lib/DragControls-BPHsDeH6.cjs +1 -0
- package/lib/DragControls-D2a1Cifp.js +234 -0
- package/lib/LocalLinks-BWFJYhGX.cjs +1 -0
- package/lib/LocalLinks-Dwgf3No6.js +65 -0
- package/lib/PageAnnouncerElement-DPMlVJZG.cjs +1 -0
- package/lib/PageAnnouncerElement-DV9pm_od.js +28 -0
- package/lib/PageScroll-BAatKJx6.cjs +1 -0
- package/lib/PageScroll-m3TsHnzR.js +65 -0
- package/lib/SourceElement-941MrYpq.js +265 -0
- package/lib/SourceElement-DBLZ7b5k.cjs +5 -0
- package/lib/Store-BCW70G3Z.cjs +1 -0
- package/lib/Store-uLDYY9ed.js +158 -0
- package/lib/Tweened-BvtjLCa3.js +48 -0
- package/lib/Tweened-DdXm1dbF.cjs +1 -0
- package/lib/Viewport-BiDoiU8M.js +113 -0
- package/lib/Viewport-CXGKUyDy.cjs +1 -0
- package/lib/accordion/index.cjs +1 -1
- package/lib/accordion/index.js +97 -93
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +6 -6
- package/lib/api-fetcher/index.cjs +1 -1
- package/lib/api-fetcher/index.js +67 -66
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.js +37 -34
- package/lib/attributes-BADnRZpK.cjs +1 -0
- package/lib/attributes-FObgMNCf.js +36 -0
- package/lib/billboard/index.cjs +1 -1
- package/lib/billboard/index.js +240 -232
- package/lib/cache/index.cjs +1 -1
- package/lib/cache/index.js +26 -23
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +62 -59
- package/lib/canvas-BP1ceie3.cjs +1 -0
- package/lib/canvas-DsglKco1.js +40 -0
- package/lib/connector/index.cjs +1 -1
- package/lib/connector/index.js +44 -41
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +6 -6
- package/lib/coordinates--JG1U6kQ.js +29 -0
- package/lib/coordinates-DQ9XV9M1.cjs +1 -0
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.d.ts +1 -1
- package/lib/css-property/index.js +40 -37
- package/lib/css-unit-parser/index.cjs +2 -2
- package/lib/css-unit-parser/index.js +22 -19
- package/lib/css-value-parser/index.cjs +1 -1
- package/lib/css-value-parser/index.js +13 -11
- package/lib/custom-elements-BfZCJde6.cjs +1 -0
- package/lib/custom-elements-HEMuF7yH.js +27 -0
- package/lib/dev/index.cjs +2 -1
- package/lib/dev/index.d.ts +1 -0
- package/lib/dev/index.js +25 -10
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +5 -5
- package/lib/dom-B40i6NXw.cjs +1 -0
- package/lib/dom-D8D-_9ty.js +108 -0
- package/lib/easings-BSGJFMAo.js +40 -0
- package/lib/easings-BWq0pPLq.cjs +1 -0
- package/lib/element-CqD0jqBJ.cjs +1 -0
- package/lib/element-DKw5H-Tu.js +10 -0
- package/lib/element-linked-store/index.cjs +1 -1
- package/lib/element-linked-store/index.js +53 -52
- package/lib/element-resizer/index.cjs +1 -1
- package/lib/element-resizer/index.js +47 -44
- package/lib/en3/index.cjs +4 -4
- package/lib/en3/index.js +192 -185
- package/lib/events-Ds-TuvYW.js +9 -0
- package/lib/events-UlGk63iC.cjs +1 -0
- package/lib/file-DwQs6bB6.js +28 -0
- package/lib/file-RHfA3OS-.cjs +1 -0
- package/lib/function-H4b_gTg6.cjs +1 -0
- package/lib/function-UmbPrOHm.js +19 -0
- package/lib/gestures-DmKKNnh4.js +14 -0
- package/lib/gestures-DtYbQr49.cjs +1 -0
- package/lib/history/index.cjs +1 -1
- package/lib/history/index.js +24 -21
- package/lib/iframe/index.cjs +1 -1
- package/lib/iframe/index.js +27 -24
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +17 -13
- package/lib/index-BpO2RJ__.cjs +1 -0
- package/lib/index-DpKsHe97.js +68 -0
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.js +3 -3
- package/lib/jsx/ComponentElement.d.ts +4 -0
- package/lib/jsx/h.d.ts +7 -16
- package/lib/jsx/hooks/component/useStylesheet.d.ts +1 -1
- package/lib/jsx/hooks/cssProperty.d.ts +6 -0
- package/lib/jsx/hooks/resize.d.ts +4 -0
- package/lib/jsx/hooks/store.d.ts +1 -2
- package/lib/jsx/hooks/ticker.d.ts +5 -0
- package/lib/jsx/index.cjs +1 -1
- package/lib/jsx/index.d.ts +4 -4
- package/lib/jsx/index.js +171 -349
- package/lib/jsx/plugins/vite/index.cjs +49 -0
- package/lib/jsx/plugins/vite/index.d.ts +38 -0
- package/lib/jsx/plugins/vite/index.js +104 -0
- package/lib/jsx/render.d.ts +2 -0
- package/lib/jsx/type.d.ts +228 -190
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +86 -84
- package/lib/layout-C26zkY7D.js +35 -0
- package/lib/layout-CnGLl7oe.cjs +1 -0
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.js +221 -217
- package/lib/loading/index.cjs +1 -1
- package/lib/loading/index.js +48 -45
- package/lib/local-links/index.cjs +1 -1
- package/lib/local-links/index.js +2 -2
- package/lib/masonry-layout/index.cjs +1 -1
- package/lib/masonry-layout/index.js +48 -45
- package/lib/math-C-knY2TL.cjs +1 -0
- package/lib/math-r8V23YFe.js +57 -0
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +28 -25
- package/lib/metadata-BNdkmeeD.js +15 -0
- package/lib/metadata-BrHUfpV9.cjs +1 -0
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +561 -556
- package/lib/morph-BtgB1YQP.js +256 -0
- package/lib/morph-Buhxq-X0.cjs +1 -0
- package/lib/need_redo_tweaker/index.cjs +4 -4
- package/lib/need_redo_tweaker/index.js +862 -834
- package/lib/notifier/index.cjs +1 -1
- package/lib/notifier/index.js +29 -26
- package/lib/number-Bu4sGvW7.cjs +1 -0
- package/lib/number-DiVt2xnh.js +47 -0
- package/lib/object-CiIdEmJx.js +98 -0
- package/lib/object-DTY_W6xG.cjs +1 -0
- package/lib/order/index.cjs +1 -1
- package/lib/order/index.js +3 -3
- package/lib/page-announcer/index.cjs +1 -1
- package/lib/page-announcer/index.js +2 -2
- package/lib/page-scroll/index.cjs +1 -1
- package/lib/page-scroll/index.js +2 -2
- package/lib/pixel-perfect/index.cjs +4 -4
- package/lib/pixel-perfect/index.js +43 -40
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +125 -122
- package/lib/polyfills-CG1XJNia.js +28 -0
- package/lib/polyfills-DZCuDBkA.cjs +1 -0
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +249 -245
- package/lib/radio/index.cjs +1 -1
- package/lib/radio/index.js +58 -55
- package/lib/render-DLcWVnuH.js +355 -0
- package/lib/render-DdomypCo.cjs +1 -0
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +196 -194
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +890 -877
- package/lib/scroll-BvIWh1xB.js +41 -0
- package/lib/scroll-CT0lpyRZ.cjs +1 -0
- package/lib/scroll-entries/index.cjs +1 -1
- package/lib/scroll-entries/index.js +37 -34
- package/lib/scroll-kit/index.cjs +1 -1
- package/lib/scroll-kit/index.js +214 -209
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +102 -98
- package/lib/size-element/index.cjs +1 -1
- package/lib/size-element/index.js +29 -26
- package/lib/slicer/index.cjs +1 -1
- package/lib/slicer/index.js +118 -113
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +5 -5
- package/lib/spa/index.cjs +1 -1
- package/lib/spa/index.js +94 -94
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.d.ts +2 -2
- package/lib/store/index.js +10 -8
- package/lib/string-B3lm2b7v.js +84 -0
- package/lib/string-CbRNzmd9.cjs +1 -0
- package/lib/style-DBoQWK0d.js +14 -0
- package/lib/style-IDJ6db6n.cjs +1 -0
- package/lib/stylesheet-CHvuef16.js +28 -0
- package/lib/stylesheet-CQdBaIAA.cjs +1 -0
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.js +96 -92
- package/lib/url-CPCO10Sy.cjs +1 -0
- package/lib/url-CWCY_qe_.js +124 -0
- package/lib/utils/attributes.d.ts +2 -0
- package/lib/utils/dom.d.ts +1 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +245 -226
- package/lib/utils/polyfills.d.ts +1 -1
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +36 -33
- package/lib/window-resizer/index.cjs +1 -1
- package/lib/window-resizer/index.js +27 -24
- package/lib/youtube/index.cjs +1 -1
- package/lib/youtube/index.js +56 -54
- package/package.json +11 -24
- package/lib/Animation-BzTjZIE-.js +0 -108
- package/lib/Animation-C39Ah-LM.cjs +0 -1
- package/lib/Composed-C-TV9te3.cjs +0 -1
- package/lib/Composed-DyAWjEXE.js +0 -121
- package/lib/Damped-CRusiRIV.js +0 -56
- package/lib/Damped-Prr0iKu1.cjs +0 -1
- package/lib/DragControls-8rNZwQrs.cjs +0 -1
- package/lib/DragControls-DBNdMBA4.js +0 -228
- package/lib/LocalLinks-BxhSFv_Q.cjs +0 -1
- package/lib/LocalLinks-DFZFpbjs.js +0 -62
- package/lib/PageAnnouncerElement-0LxZjtVH.js +0 -24
- package/lib/PageAnnouncerElement-AQ0Ja6HM.cjs +0 -1
- package/lib/PageScroll-0LxFblry.js +0 -62
- package/lib/PageScroll-BXJUQwG7.cjs +0 -1
- package/lib/SourceElement-BHqPFbna.cjs +0 -5
- package/lib/SourceElement-DjbHjynf.js +0 -260
- package/lib/Store-Blf4msDz.cjs +0 -1
- package/lib/Store-ZThXYBQd.js +0 -152
- package/lib/Tweened-Bw1Cn1PJ.js +0 -47
- package/lib/Tweened-DWtk9E-O.cjs +0 -1
- package/lib/Viewport-BxCr0GlB.cjs +0 -1
- package/lib/Viewport-Dt-d9DPi.js +0 -109
- package/lib/attributes-69we3byR.js +0 -10
- package/lib/attributes-Bf2svn4j.cjs +0 -1
- package/lib/canvas-CU5Xjahf.cjs +0 -1
- package/lib/canvas-DeZ0SLUJ.js +0 -34
- package/lib/coordinates-CgdGoSYs.js +0 -24
- package/lib/coordinates-D8Np3cPD.cjs +0 -1
- package/lib/custom-elements-DBnCK7Zx.js +0 -24
- package/lib/custom-elements-Dh4TWRDJ.cjs +0 -1
- package/lib/dom-BETkVSSZ.js +0 -82
- package/lib/dom-CBLlqORw.cjs +0 -1
- package/lib/easings-BEmRlrDd.js +0 -38
- package/lib/easings-GegIwET5.cjs +0 -1
- package/lib/element-CGVl1jA-.js +0 -7
- package/lib/element-yhcBhsho.cjs +0 -1
- package/lib/events-CsVF98U6.js +0 -6
- package/lib/events-KVanG9sR.cjs +0 -1
- package/lib/file-DSpfWdd9.cjs +0 -1
- package/lib/file-GHShUlue.js +0 -24
- package/lib/function-C10DGppn.js +0 -17
- package/lib/function-MthRj-GJ.cjs +0 -1
- package/lib/gestures-C7gbKx11.cjs +0 -1
- package/lib/gestures-CcXV6fCp.js +0 -11
- package/lib/index-OE2INULi.cjs +0 -1
- package/lib/index-e9eDuagL.js +0 -65
- package/lib/jsx/hydrate.d.ts +0 -1
- package/lib/jsx/integrations/astro/client.cjs +0 -1
- package/lib/jsx/integrations/astro/client.d.ts +0 -2
- package/lib/jsx/integrations/astro/client.js +0 -50
- package/lib/jsx/integrations/astro/index.cjs +0 -1
- package/lib/jsx/integrations/astro/index.d.ts +0 -2
- package/lib/jsx/integrations/astro/index.js +0 -54
- package/lib/jsx/integrations/astro/server.cjs +0 -1
- package/lib/jsx/integrations/astro/server.d.ts +0 -3
- package/lib/jsx/integrations/astro/server.js +0 -35
- package/lib/jsx/plugins/vite.d.ts +0 -21
- package/lib/layout-BSMtwCga.js +0 -29
- package/lib/layout-Ctc2p3uz.cjs +0 -1
- package/lib/math-BOBiC4TN.js +0 -45
- package/lib/math-GDWEqu7y.cjs +0 -1
- package/lib/metadata-BcYZ5w3T.cjs +0 -1
- package/lib/metadata-jfowcCyz.js +0 -12
- package/lib/morph-B6sGhLCi.cjs +0 -1
- package/lib/morph-BQErz7qP.js +0 -242
- package/lib/number-ChAm68cm.cjs +0 -1
- package/lib/number-CumqY64S.js +0 -40
- package/lib/object-CcMK4y_r.js +0 -87
- package/lib/object-baN9pgbU.cjs +0 -1
- package/lib/polyfills-DJrTJQky.js +0 -24
- package/lib/polyfills-Df4r-ETT.cjs +0 -1
- package/lib/render-DQs7rIoN.cjs +0 -1
- package/lib/render-D_0FCWEu.js +0 -18
- package/lib/scroll-BA2WnUrb.cjs +0 -1
- package/lib/scroll-DY5senkF.js +0 -37
- package/lib/string-BlMQbe8b.js +0 -70
- package/lib/string-DUXXtU8v.cjs +0 -1
- package/lib/style-At6aDoqG.cjs +0 -1
- package/lib/style-j2TwriJ_.js +0 -10
- package/lib/stylesheet-5_o7PFzM.cjs +0 -1
- package/lib/stylesheet-DdBzowZY.js +0 -24
- package/lib/url-CHgcNwJ1.cjs +0 -1
- package/lib/url-CYgo5vrG.js +0 -113
- package/lib/vite-C-i3hVDL.js +0 -75
- package/lib/vite-DzanPumM.cjs +0 -44
package/lib/popover/index.js
CHANGED
|
@@ -1,158 +1,161 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __typeError = (msg) => {
|
|
3
|
+
throw TypeError(msg);
|
|
3
4
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { d as
|
|
12
|
-
import {
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
6
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
7
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value), __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
8
|
+
import { CSSProperty } from "../css-property/index.js";
|
|
9
|
+
import { v as viewport } from "../Viewport-BiDoiU8M.js";
|
|
10
|
+
import { ElementLinkedStore } from "../element-linked-store/index.js";
|
|
11
|
+
import { i as isBrowser } from "../index-DpKsHe97.js";
|
|
12
|
+
import { d as dispatchEvent } from "../events-Ds-TuvYW.js";
|
|
13
|
+
import { d as debounce } from "../function-UmbPrOHm.js";
|
|
14
|
+
import { g as getElementTransitionDurationMS } from "../style-DBoQWK0d.js";
|
|
13
15
|
import "construct-style-sheets-polyfill";
|
|
14
|
-
import { u as
|
|
15
|
-
import { windowResizer
|
|
16
|
-
var
|
|
17
|
-
class
|
|
16
|
+
import { u as updateSearchParameter, p as parseSearchParameters } from "../url-CWCY_qe_.js";
|
|
17
|
+
import { windowResizer } from "../window-resizer/index.js";
|
|
18
|
+
var _groups, _stack, _clickOutsideListener, _keydownListener;
|
|
19
|
+
const _PopoverGroups = class _PopoverGroups {
|
|
18
20
|
constructor() {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
(
|
|
21
|
+
__privateAdd(this, _groups, /* @__PURE__ */ new Map());
|
|
22
|
+
__privateAdd(this, _stack, []);
|
|
23
|
+
__privateAdd(this, _clickOutsideListener, /* @__PURE__ */ __name((e) => {
|
|
24
|
+
var _a;
|
|
25
|
+
const lastPopover = [...__privateGet(this, _stack)].reverse().find((el) => el.clickOutside.current);
|
|
26
|
+
if (lastPopover) {
|
|
27
|
+
const path = e.composedPath();
|
|
28
|
+
if (path.find(
|
|
29
|
+
(el) => el instanceof HTMLElement && el.hasAttribute("data-popover-content")
|
|
28
30
|
))
|
|
29
31
|
return;
|
|
30
|
-
const
|
|
31
|
-
(!
|
|
32
|
+
const target = path[0], containsTarget = target instanceof Node && (lastPopover.contains(target) || ((_a = lastPopover.shadowRoot) == null ? void 0 : _a.contains(target))), outsideTarget = target instanceof HTMLElement && target.hasAttribute("data-outside");
|
|
33
|
+
(!containsTarget || outsideTarget) && lastPopover.close();
|
|
32
34
|
}
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
if (
|
|
36
|
-
const
|
|
37
|
-
|
|
35
|
+
}, "#clickOutsideListener"));
|
|
36
|
+
__privateAdd(this, _keydownListener, /* @__PURE__ */ __name((e) => {
|
|
37
|
+
if (e.code === "Escape") {
|
|
38
|
+
const lastPopover = [...__privateGet(this, _stack)].reverse().find((el) => el.escape.current);
|
|
39
|
+
lastPopover && lastPopover.close();
|
|
38
40
|
}
|
|
39
|
-
});
|
|
41
|
+
}, "#keydownListener"));
|
|
40
42
|
document.documentElement.addEventListener(
|
|
41
43
|
"click",
|
|
42
|
-
|
|
43
|
-
), addEventListener("keydown",
|
|
44
|
+
__privateGet(this, _clickOutsideListener)
|
|
45
|
+
), addEventListener("keydown", __privateGet(this, _keydownListener));
|
|
44
46
|
}
|
|
45
47
|
get groups() {
|
|
46
|
-
return
|
|
48
|
+
return __privateGet(this, _groups);
|
|
47
49
|
}
|
|
48
50
|
get stack() {
|
|
49
|
-
return
|
|
51
|
+
return __privateGet(this, _stack);
|
|
50
52
|
}
|
|
51
|
-
add(
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
add(groupName, element) {
|
|
54
|
+
if (element.closeRest.current)
|
|
55
|
+
__privateGet(this, _groups).forEach((g) => {
|
|
56
|
+
g.forEach((e) => {
|
|
57
|
+
e.close();
|
|
56
58
|
});
|
|
57
59
|
});
|
|
58
|
-
else if (
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
else if (element.closeRestInGroup.current) {
|
|
61
|
+
let group2 = __privateGet(this, _groups).get(groupName);
|
|
62
|
+
group2 == null || group2.forEach((e) => {
|
|
63
|
+
e.close();
|
|
62
64
|
});
|
|
63
65
|
}
|
|
64
|
-
let
|
|
65
|
-
|
|
66
|
+
let group = __privateGet(this, _groups).get(groupName);
|
|
67
|
+
group != null && group.length || (group = [], __privateGet(this, _groups).set(groupName, group)), __privateGet(this, _stack).push(element), group.push(element);
|
|
66
68
|
}
|
|
67
|
-
remove(
|
|
69
|
+
remove(groupName, element) {
|
|
68
70
|
if (setTimeout(() => {
|
|
69
|
-
|
|
70
|
-
}),
|
|
71
|
-
let
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}),
|
|
75
|
-
} else if (
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
__privateSet(this, _stack, __privateGet(this, _stack).filter((e) => e !== element));
|
|
72
|
+
}), element.closeRest.current) {
|
|
73
|
+
let elements = [];
|
|
74
|
+
__privateGet(this, _groups).forEach((group) => {
|
|
75
|
+
group.forEach((element2) => elements.push(element2));
|
|
76
|
+
}), __privateGet(this, _groups).clear(), elements.forEach((element2) => element2.close());
|
|
77
|
+
} else if (element.closeRestInGroup.current) {
|
|
78
|
+
const group = __privateGet(this, _groups).get(groupName);
|
|
79
|
+
__privateGet(this, _groups).delete(groupName), group == null || group.forEach((element2) => {
|
|
80
|
+
element2.close();
|
|
79
81
|
});
|
|
80
82
|
} else {
|
|
81
|
-
let
|
|
82
|
-
|
|
83
|
+
let group = __privateGet(this, _groups).get(groupName);
|
|
84
|
+
group && (group = group.filter((el) => el !== element), __privateGet(this, _groups).set(groupName, group));
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
};
|
|
88
|
+
_groups = new WeakMap(), _stack = new WeakMap(), _clickOutsideListener = new WeakMap(), _keydownListener = new WeakMap(), __name(_PopoverGroups, "PopoverGroups");
|
|
89
|
+
let PopoverGroups = _PopoverGroups;
|
|
90
|
+
var _opened, _startClosingTimeoutId, _closeTimeoutId, _openFrameId, _openTransitionTimeoutId, _history, _restore, _dispatchResize, _closeRest, _closeRestInGroup, _group, _clickOutside, _escape, _checkViewportBounds, _historyAllowed, _lastTrigger, _status, _innerCloseElements, _resetScrollElements, _PopoverElement_instances, path_get, toggleGlobalClass_fn, deleteSearchParam_fn, _popStateListener, _resizeListener, _debouncedResize, _resize, _closeElementClickListener;
|
|
91
|
+
const _PopoverElement = class _PopoverElement extends HTMLElement {
|
|
89
92
|
constructor() {
|
|
90
93
|
super();
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
this.urlValue = "",
|
|
94
|
+
__privateAdd(this, _PopoverElement_instances);
|
|
95
|
+
__privateAdd(this, _opened);
|
|
96
|
+
__privateAdd(this, _startClosingTimeoutId);
|
|
97
|
+
__privateAdd(this, _closeTimeoutId);
|
|
98
|
+
__privateAdd(this, _openFrameId);
|
|
99
|
+
__privateAdd(this, _openTransitionTimeoutId);
|
|
100
|
+
__privateAdd(this, _history);
|
|
101
|
+
__privateAdd(this, _restore);
|
|
102
|
+
__privateAdd(this, _dispatchResize);
|
|
103
|
+
__privateAdd(this, _closeRest);
|
|
104
|
+
__privateAdd(this, _closeRestInGroup);
|
|
105
|
+
__privateAdd(this, _group);
|
|
106
|
+
__privateAdd(this, _clickOutside);
|
|
107
|
+
__privateAdd(this, _escape);
|
|
108
|
+
__privateAdd(this, _checkViewportBounds);
|
|
109
|
+
__privateAdd(this, _historyAllowed);
|
|
110
|
+
__privateAdd(this, _lastTrigger);
|
|
111
|
+
__privateAdd(this, _status);
|
|
112
|
+
__privateAdd(this, _innerCloseElements);
|
|
113
|
+
__privateAdd(this, _resetScrollElements);
|
|
114
|
+
__privateAdd(this, _popStateListener);
|
|
115
|
+
__privateAdd(this, _resizeListener);
|
|
116
|
+
__privateAdd(this, _debouncedResize);
|
|
117
|
+
__privateAdd(this, _resize);
|
|
118
|
+
__privateAdd(this, _closeElementClickListener);
|
|
119
|
+
this.urlValue = "", __privateSet(this, _opened, !1), __privateSet(this, _history, new CSSProperty(this, "--history", !1)), __privateSet(this, _restore, new CSSProperty(this, "--restore", !1)), __privateSet(this, _dispatchResize, new CSSProperty(this, "--dispatch-resize", !1)), __privateSet(this, _closeRest, new CSSProperty(this, "--close-rest", !1)), __privateSet(this, _closeRestInGroup, new CSSProperty(
|
|
117
120
|
this,
|
|
118
121
|
"--close-rest-in-group",
|
|
119
122
|
!1
|
|
120
|
-
)),
|
|
123
|
+
)), __privateSet(this, _group, new CSSProperty(this, "--group", "")), __privateSet(this, _clickOutside, new CSSProperty(this, "--click-outside", !1)), __privateSet(this, _escape, new CSSProperty(this, "--escape", !1)), __privateSet(this, _checkViewportBounds, new CSSProperty(this, "--check-viewport-bounds", !1)), __privateSet(this, _historyAllowed, !0), __privateSet(this, _status, new ElementLinkedStore(this, {
|
|
121
124
|
triggered: !1,
|
|
122
125
|
beforeopen: !1,
|
|
123
126
|
opened: !1,
|
|
124
127
|
closing: !1,
|
|
125
128
|
transitionend: !1
|
|
126
|
-
})),
|
|
127
|
-
|
|
128
|
-
}),
|
|
129
|
-
this.style.setProperty("--content-width", "initial"), this.style.setProperty("--content-height", "initial"), this.style.setProperty("--viewport-offset-x", "0px"), this.style.setProperty("--viewport-offset-y", "0px"),
|
|
130
|
-
}),
|
|
131
|
-
|
|
132
|
-
}, 10)),
|
|
133
|
-
if (this.style.setProperty("--content-width", this.scrollWidth + "px"), this.style.setProperty("--content-height", this.scrollHeight + "px"),
|
|
134
|
-
const
|
|
135
|
-
let
|
|
136
|
-
|
|
129
|
+
})), __privateSet(this, _innerCloseElements, []), __privateSet(this, _resetScrollElements, []), __privateSet(this, _popStateListener, () => {
|
|
130
|
+
__privateSet(this, _historyAllowed, !1), __privateGet(this, _opened) && __privateGet(this, _history).current && !location.search.includes(this.id) ? this.close() : !__privateGet(this, _opened) && __privateGet(this, _history).current && location.search.includes(this.id) && this.open({ trigger: this.idWithValue }), __privateSet(this, _historyAllowed, !0);
|
|
131
|
+
}), __privateSet(this, _resizeListener, () => {
|
|
132
|
+
this.style.setProperty("--content-width", "initial"), this.style.setProperty("--content-height", "initial"), this.style.setProperty("--viewport-offset-x", "0px"), this.style.setProperty("--viewport-offset-y", "0px"), __privateGet(this, _debouncedResize).call(this);
|
|
133
|
+
}), __privateSet(this, _debouncedResize, debounce(() => {
|
|
134
|
+
__privateGet(this, _resize).call(this);
|
|
135
|
+
}, 10)), __privateSet(this, _resize, () => {
|
|
136
|
+
if (this.style.setProperty("--content-width", this.scrollWidth + "px"), this.style.setProperty("--content-height", this.scrollHeight + "px"), __privateGet(this, _checkViewportBounds).current) {
|
|
137
|
+
const rect = this.getBoundingClientRect();
|
|
138
|
+
let viewportOffsetX = 0, viewportOffsetY = 0;
|
|
139
|
+
rect.right > viewport.width ? viewportOffsetX = viewport.width - rect.right : rect.left < 0 && (viewportOffsetX = rect.left * -1), rect.bottom > viewport.height ? viewportOffsetY = viewport.height - rect.bottom : rect.top < 0 && (viewportOffsetY = rect.top * -1), this.style.setProperty("--viewport-offset-x", viewportOffsetX + "px"), this.style.setProperty("--viewport-offset-y", viewportOffsetY + "px");
|
|
137
140
|
}
|
|
138
|
-
}),
|
|
141
|
+
}), __privateSet(this, _closeElementClickListener, () => {
|
|
139
142
|
this.close();
|
|
140
|
-
}),
|
|
141
|
-
e.previous && (
|
|
143
|
+
}), __privateGet(this, _group).subscribe((e) => {
|
|
144
|
+
e.previous && (_PopoverElement.stack.remove(e.previous, this), e.current || (document.documentElement.classList.remove(
|
|
142
145
|
`${this.group.previous}-closing`
|
|
143
146
|
), document.documentElement.classList.remove(
|
|
144
147
|
`${this.group.previous}-opened`
|
|
145
148
|
)));
|
|
146
|
-
}),
|
|
149
|
+
}), __privateGet(this, _status).subscribe((e) => {
|
|
147
150
|
if (this.group.current) {
|
|
148
151
|
document.documentElement.classList.toggle(
|
|
149
152
|
`${this.group.current}-closing`,
|
|
150
153
|
e.current.closing
|
|
151
154
|
);
|
|
152
|
-
const
|
|
155
|
+
const group = _PopoverElement.stack.groups.get(this.group.current), element = group == null ? void 0 : group.find((e2) => e2.opened);
|
|
153
156
|
document.documentElement.classList.toggle(
|
|
154
157
|
`${this.group.current}-opened`,
|
|
155
|
-
!!
|
|
158
|
+
!!element
|
|
156
159
|
);
|
|
157
160
|
}
|
|
158
161
|
});
|
|
@@ -164,242 +167,243 @@ const k = class k extends HTMLElement {
|
|
|
164
167
|
return this.getAttribute("data-closing-global-class");
|
|
165
168
|
}
|
|
166
169
|
get history() {
|
|
167
|
-
return
|
|
170
|
+
return __privateGet(this, _history);
|
|
168
171
|
}
|
|
169
172
|
get restore() {
|
|
170
|
-
return
|
|
173
|
+
return __privateGet(this, _restore);
|
|
171
174
|
}
|
|
172
175
|
get dispatchResize() {
|
|
173
|
-
return
|
|
176
|
+
return __privateGet(this, _dispatchResize);
|
|
174
177
|
}
|
|
175
178
|
get closeRest() {
|
|
176
|
-
return
|
|
179
|
+
return __privateGet(this, _closeRest);
|
|
177
180
|
}
|
|
178
181
|
get closeRestInGroup() {
|
|
179
|
-
return
|
|
182
|
+
return __privateGet(this, _closeRestInGroup);
|
|
180
183
|
}
|
|
181
184
|
get group() {
|
|
182
|
-
return
|
|
185
|
+
return __privateGet(this, _group);
|
|
183
186
|
}
|
|
184
187
|
get clickOutside() {
|
|
185
|
-
return
|
|
188
|
+
return __privateGet(this, _clickOutside);
|
|
186
189
|
}
|
|
187
190
|
get escape() {
|
|
188
|
-
return
|
|
191
|
+
return __privateGet(this, _escape);
|
|
189
192
|
}
|
|
190
193
|
get opened() {
|
|
191
|
-
return
|
|
194
|
+
return __privateGet(this, _opened);
|
|
192
195
|
}
|
|
193
196
|
get lastTrigger() {
|
|
194
|
-
return
|
|
197
|
+
return __privateGet(this, _lastTrigger);
|
|
195
198
|
}
|
|
196
199
|
get idWithValue() {
|
|
197
200
|
return `${this.id}${this.urlValue ? "=" + this.urlValue : ""}`;
|
|
198
201
|
}
|
|
199
|
-
updateUrlValue(
|
|
200
|
-
this.urlValue = (
|
|
202
|
+
updateUrlValue(value) {
|
|
203
|
+
this.urlValue = (value == null ? void 0 : value.toString()) || "", __privateGet(this, _opened) && updateSearchParameter(this.id, value);
|
|
201
204
|
}
|
|
202
|
-
open(
|
|
203
|
-
if (
|
|
205
|
+
open(options) {
|
|
206
|
+
if (__privateGet(this, _opened))
|
|
204
207
|
return;
|
|
205
|
-
|
|
208
|
+
__privateSet(this, _lastTrigger, options == null ? void 0 : options.trigger), clearTimeout(__privateGet(this, _startClosingTimeoutId)), clearTimeout(__privateGet(this, _closeTimeoutId)), __privateMethod(this, _PopoverElement_instances, toggleGlobalClass_fn).call(this, !1, this.closingClass), __privateGet(this, _status).set("closing", !1), __privateGet(this, _status).set("triggered", !0), dispatchEvent(this, "popoverTriggered", {
|
|
206
209
|
custom: !0,
|
|
207
210
|
detail: {
|
|
208
|
-
trigger:
|
|
211
|
+
trigger: __privateGet(this, _lastTrigger)
|
|
209
212
|
}
|
|
210
|
-
}),
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
|
|
213
|
+
}), __privateGet(this, _history).current && __privateGet(this, _historyAllowed) && history.pushState(history.state, "", __privateGet(this, _PopoverElement_instances, path_get)), __privateGet(this, _status).set("beforeopen", !0), __privateSet(this, _opened, !0);
|
|
214
|
+
const opened = /* @__PURE__ */ __name(() => {
|
|
215
|
+
_PopoverElement.stack.add(__privateGet(this, _group).current, this), __privateGet(this, _resetScrollElements).forEach((el) => {
|
|
216
|
+
el.scroll({
|
|
214
217
|
top: 0,
|
|
215
218
|
left: 0,
|
|
216
219
|
behavior: "instant"
|
|
217
220
|
});
|
|
218
|
-
}),
|
|
221
|
+
}), __privateMethod(this, _PopoverElement_instances, toggleGlobalClass_fn).call(this, !0, this.openClass), __privateGet(this, _status).set("opened", !0), __privateGet(this, _dispatchResize).current ? dispatchEvent(window, "resize", { custom: !0 }) : __privateGet(this, _resizeListener).call(this), dispatchEvent(this, "popoverOpened", {
|
|
219
222
|
custom: !0,
|
|
220
223
|
detail: {
|
|
221
|
-
trigger:
|
|
224
|
+
trigger: __privateGet(this, _lastTrigger)
|
|
222
225
|
},
|
|
223
226
|
bubbles: !0
|
|
224
|
-
}),
|
|
227
|
+
}), __privateSet(this, _openFrameId, void 0), __privateSet(this, _openTransitionTimeoutId, setTimeout(
|
|
225
228
|
() => {
|
|
226
|
-
|
|
229
|
+
__privateGet(this, _status).set("transitionend", !0), dispatchEvent(this, "popoverTransitionend");
|
|
227
230
|
},
|
|
228
|
-
|
|
231
|
+
getElementTransitionDurationMS(this) + 10
|
|
229
232
|
));
|
|
230
|
-
};
|
|
231
|
-
|
|
233
|
+
}, "opened");
|
|
234
|
+
options != null && options.skipTransition ? opened() : __privateSet(this, _openFrameId, requestAnimationFrame(opened));
|
|
232
235
|
}
|
|
233
236
|
close() {
|
|
234
|
-
|
|
235
|
-
|
|
237
|
+
__privateGet(this, _opened) && (__privateSet(this, _opened, !1), cancelAnimationFrame(__privateGet(this, _openFrameId)), clearTimeout(__privateGet(this, _openTransitionTimeoutId)), _PopoverElement.stack.remove(__privateGet(this, _group).current, this), __privateMethod(this, _PopoverElement_instances, deleteSearchParam_fn).call(this), __privateSet(this, _startClosingTimeoutId, setTimeout(() => {
|
|
238
|
+
__privateGet(this, _status).set("transitionend", !1), __privateGet(this, _status).set("opened", !1), __privateGet(this, _status).set("closing", !0), __privateMethod(this, _PopoverElement_instances, toggleGlobalClass_fn).call(this, !1, this.openClass), __privateMethod(this, _PopoverElement_instances, toggleGlobalClass_fn).call(this, !0, this.closingClass), dispatchEvent(this, "popoverClosing", {
|
|
236
239
|
custom: !0,
|
|
237
240
|
bubbles: !0
|
|
238
|
-
}),
|
|
241
|
+
}), __privateSet(this, _closeTimeoutId, setTimeout(
|
|
239
242
|
() => {
|
|
240
|
-
|
|
243
|
+
__privateGet(this, _status).set("triggered", !1), __privateGet(this, _status).set("beforeopen", !1), __privateGet(this, _status).set("closing", !1), __privateMethod(this, _PopoverElement_instances, toggleGlobalClass_fn).call(this, !1, this.closingClass), dispatchEvent(this, "popoverClosed", {
|
|
241
244
|
custom: !0,
|
|
242
245
|
bubbles: !0
|
|
243
246
|
});
|
|
244
247
|
},
|
|
245
|
-
|
|
248
|
+
getElementTransitionDurationMS(this) + 10
|
|
246
249
|
));
|
|
247
250
|
}, 10)));
|
|
248
251
|
}
|
|
249
252
|
connectedCallback() {
|
|
250
|
-
|
|
253
|
+
__privateSet(this, _innerCloseElements, [
|
|
251
254
|
...this.querySelectorAll(
|
|
252
255
|
`[data-popover-close${this.id ? `="${this.id}"` : ""}]`
|
|
253
256
|
)
|
|
254
|
-
]),
|
|
255
|
-
|
|
256
|
-
}),
|
|
257
|
+
]), __privateGet(this, _innerCloseElements).forEach((el) => {
|
|
258
|
+
el.addEventListener("click", __privateGet(this, _closeElementClickListener));
|
|
259
|
+
}), __privateSet(this, _resetScrollElements, [
|
|
257
260
|
...this.querySelectorAll(
|
|
258
261
|
`[data-popover-reset-scroll${this.id ? `="${this.id}"` : ""}]`
|
|
259
262
|
)
|
|
260
|
-
]),
|
|
261
|
-
|
|
262
|
-
}, 0),
|
|
263
|
-
|
|
264
|
-
}),
|
|
263
|
+
]), __privateGet(this, _history).observe(), __privateGet(this, _restore).observe(), __privateGet(this, _dispatchResize).observe(), __privateGet(this, _closeRest).observe(), __privateGet(this, _closeRestInGroup).observe(), __privateGet(this, _group).observe(), __privateGet(this, _clickOutside).observe(), __privateGet(this, _escape).observe(), __privateGet(this, _checkViewportBounds).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", __privateGet(this, _popStateListener)), setTimeout(() => {
|
|
264
|
+
__privateGet(this, _restore).current ? (__privateSet(this, _historyAllowed, !1), this.urlValue = parseSearchParameters(location.search)[this.id], location.search.includes(this.id) && this.open({ trigger: this.idWithValue }), __privateSet(this, _historyAllowed, !0)) : (__privateMethod(this, _PopoverElement_instances, deleteSearchParam_fn).call(this), __privateSet(this, _historyAllowed, !0));
|
|
265
|
+
}, 0), __privateGet(this, _checkViewportBounds).subscribe(() => {
|
|
266
|
+
__privateGet(this, _resizeListener).call(this);
|
|
267
|
+
}), windowResizer.subscribe(__privateGet(this, _resizeListener));
|
|
265
268
|
}
|
|
266
269
|
disconnectedCallback() {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}),
|
|
270
|
+
__privateGet(this, _innerCloseElements).forEach((el) => {
|
|
271
|
+
el.removeEventListener("click", __privateGet(this, _closeElementClickListener));
|
|
272
|
+
}), _PopoverElement.stack.remove(__privateGet(this, _group).current, this), windowResizer.unsubscribe(__privateGet(this, _resizeListener)), __privateGet(this, _history).close(), __privateGet(this, _restore).close(), __privateGet(this, _dispatchResize).close(), __privateGet(this, _closeRest).close(), __privateGet(this, _closeRestInGroup).close(), __privateGet(this, _group).close(), __privateGet(this, _clickOutside).close(), __privateGet(this, _escape).close(), __privateGet(this, _checkViewportBounds).close(), this.removeAttribute("role"), __privateMethod(this, _PopoverElement_instances, toggleGlobalClass_fn).call(this, !1, this.openClass), __privateMethod(this, _PopoverElement_instances, toggleGlobalClass_fn).call(this, !1, this.closingClass), clearTimeout(__privateGet(this, _startClosingTimeoutId)), clearTimeout(__privateGet(this, _closeTimeoutId)), clearTimeout(__privateGet(this, _openFrameId)), clearTimeout(__privateGet(this, _openTransitionTimeoutId)), removeEventListener("popstate", __privateGet(this, _popStateListener)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), this.style.removeProperty("--viewport-offset-x"), this.style.removeProperty("--viewport-offset-y"), __privateMethod(this, _PopoverElement_instances, deleteSearchParam_fn).call(this);
|
|
270
273
|
}
|
|
271
274
|
};
|
|
272
|
-
|
|
275
|
+
_opened = new WeakMap(), _startClosingTimeoutId = new WeakMap(), _closeTimeoutId = new WeakMap(), _openFrameId = new WeakMap(), _openTransitionTimeoutId = new WeakMap(), _history = new WeakMap(), _restore = new WeakMap(), _dispatchResize = new WeakMap(), _closeRest = new WeakMap(), _closeRestInGroup = new WeakMap(), _group = new WeakMap(), _clickOutside = new WeakMap(), _escape = new WeakMap(), _checkViewportBounds = new WeakMap(), _historyAllowed = new WeakMap(), _lastTrigger = new WeakMap(), _status = new WeakMap(), _innerCloseElements = new WeakMap(), _resetScrollElements = new WeakMap(), _PopoverElement_instances = new WeakSet(), path_get = /* @__PURE__ */ __name(function() {
|
|
273
276
|
return `${location.pathname}${location.search ? location.search + "&" : "?"}${this.idWithValue}`;
|
|
274
|
-
},
|
|
275
|
-
|
|
276
|
-
document.documentElement.classList.toggle(
|
|
277
|
+
}, "#path"), toggleGlobalClass_fn = /* @__PURE__ */ __name(function(on, className) {
|
|
278
|
+
className && className.split(" ").map((v) => {
|
|
279
|
+
document.documentElement.classList.toggle(v.trim(), on);
|
|
277
280
|
});
|
|
278
|
-
},
|
|
279
|
-
if (
|
|
280
|
-
const
|
|
281
|
-
|
|
281
|
+
}, "#toggleGlobalClass"), deleteSearchParam_fn = /* @__PURE__ */ __name(function() {
|
|
282
|
+
if (__privateGet(this, _history).current) {
|
|
283
|
+
const url = new URL(location.href);
|
|
284
|
+
url.searchParams.delete(this.id), history.replaceState(history.state, "", url.href);
|
|
282
285
|
}
|
|
283
|
-
},
|
|
284
|
-
let
|
|
285
|
-
|
|
286
|
-
var
|
|
287
|
-
class
|
|
286
|
+
}, "#deleteSearchParam"), _popStateListener = new WeakMap(), _resizeListener = new WeakMap(), _debouncedResize = new WeakMap(), _resize = new WeakMap(), _closeElementClickListener = new WeakMap(), __name(_PopoverElement, "PopoverElement"), _PopoverElement.stack = new PopoverGroups();
|
|
287
|
+
let PopoverElement = _PopoverElement;
|
|
288
|
+
isBrowser && !customElements.get("e-popover") && customElements.define("e-popover", PopoverElement);
|
|
289
|
+
var _popoverElement, _type, _PopoverButtonElement_instances, unlistenPopover_fn, _popoverTriggeredListener, _popoverOpenedListener, _popoverClosingListener, _popoverClosedListener, updateType_fn;
|
|
290
|
+
const _PopoverButtonElement = class _PopoverButtonElement extends HTMLElement {
|
|
288
291
|
constructor() {
|
|
289
292
|
super();
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
e.target ===
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
e.target ===
|
|
298
|
-
});
|
|
299
|
-
|
|
300
|
-
e.target ===
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
e.target ===
|
|
304
|
-
});
|
|
305
|
-
|
|
306
|
-
if (
|
|
307
|
-
const
|
|
308
|
-
|
|
293
|
+
__privateAdd(this, _PopoverButtonElement_instances);
|
|
294
|
+
__privateAdd(this, _popoverElement);
|
|
295
|
+
__privateAdd(this, _type, new CSSProperty(this, "--type", "open"));
|
|
296
|
+
__privateAdd(this, _popoverTriggeredListener, /* @__PURE__ */ __name((e) => {
|
|
297
|
+
e.target === __privateGet(this, _popoverElement) && __privateGet(this, _type).current !== "close" && this.classList.add("triggered");
|
|
298
|
+
}, "#popoverTriggeredListener"));
|
|
299
|
+
__privateAdd(this, _popoverOpenedListener, /* @__PURE__ */ __name((e) => {
|
|
300
|
+
e.target === __privateGet(this, _popoverElement) && __privateGet(this, _type).current !== "close" && (this.classList.add("opened"), this.setAttribute("aria-expanded", "true"));
|
|
301
|
+
}, "#popoverOpenedListener"));
|
|
302
|
+
__privateAdd(this, _popoverClosingListener, /* @__PURE__ */ __name((e) => {
|
|
303
|
+
e.target === __privateGet(this, _popoverElement) && __privateGet(this, _type).current !== "close" && this.classList.remove("opened");
|
|
304
|
+
}, "#popoverClosingListener"));
|
|
305
|
+
__privateAdd(this, _popoverClosedListener, /* @__PURE__ */ __name((e) => {
|
|
306
|
+
e.target === __privateGet(this, _popoverElement) && __privateGet(this, _type).current !== "close" && (this.classList.remove("triggered"), this.setAttribute("aria-expanded", "false"));
|
|
307
|
+
}, "#popoverClosedListener"));
|
|
308
|
+
isBrowser && (this.addEventListener("click", () => {
|
|
309
|
+
if (__privateGet(this, _popoverElement)) {
|
|
310
|
+
const type = __privateGet(this, _type).current;
|
|
311
|
+
type === "open" || type === "toggle" && !__privateGet(this, _popoverElement).opened ? __privateGet(this, _popoverElement).open({ trigger: this }) : (type === "close" || type === "toggle" && __privateGet(this, _popoverElement).opened) && __privateGet(this, _popoverElement).close();
|
|
309
312
|
}
|
|
310
313
|
}), this.addEventListener("keydown", (e) => {
|
|
311
314
|
e.code === "Space" && !this.hasAttribute("keydown-disabled") && (e.preventDefault(), this.click());
|
|
312
315
|
}));
|
|
313
316
|
}
|
|
314
317
|
get type() {
|
|
315
|
-
return
|
|
318
|
+
return __privateGet(this, _type);
|
|
316
319
|
}
|
|
317
320
|
get popoverElement() {
|
|
318
|
-
return
|
|
321
|
+
return __privateGet(this, _popoverElement);
|
|
319
322
|
}
|
|
320
|
-
changePopover(
|
|
321
|
-
var
|
|
322
|
-
if (
|
|
323
|
-
let
|
|
324
|
-
if (
|
|
325
|
-
const
|
|
326
|
-
if (
|
|
327
|
-
|
|
323
|
+
changePopover(targetId) {
|
|
324
|
+
var _a;
|
|
325
|
+
if (__privateMethod(this, _PopoverButtonElement_instances, unlistenPopover_fn).call(this), targetId) {
|
|
326
|
+
let popoverElement = null;
|
|
327
|
+
if (targetId === "parent") {
|
|
328
|
+
const closestTarget = this.closest("[data-popover]");
|
|
329
|
+
if (closestTarget)
|
|
330
|
+
popoverElement = closestTarget;
|
|
328
331
|
else {
|
|
329
|
-
const
|
|
330
|
-
|
|
332
|
+
const rootNode = this.getRootNode();
|
|
333
|
+
rootNode instanceof ShadowRoot ? popoverElement = rootNode.host.closest("[data-popover]") : rootNode instanceof HTMLElement && (popoverElement = rootNode.closest("[data-popover]"));
|
|
331
334
|
}
|
|
332
|
-
} else if (
|
|
333
|
-
|
|
334
|
-
else if (
|
|
335
|
-
const
|
|
336
|
-
if (!
|
|
335
|
+
} else if (targetId === "sibling")
|
|
336
|
+
popoverElement = (_a = this.parentElement) == null ? void 0 : _a.querySelector("[data-popover]");
|
|
337
|
+
else if (targetId === "ancestor-child") {
|
|
338
|
+
const find = /* @__PURE__ */ __name((el) => {
|
|
339
|
+
if (!el)
|
|
337
340
|
return null;
|
|
338
|
-
let
|
|
339
|
-
return !
|
|
340
|
-
};
|
|
341
|
-
|
|
341
|
+
let founded = el.querySelector("[data-popover]");
|
|
342
|
+
return !founded && (el != null && el.parentElement) && (founded = find(el.parentElement)), founded;
|
|
343
|
+
}, "find");
|
|
344
|
+
popoverElement = find(this.parentElement) || null;
|
|
342
345
|
} else {
|
|
343
|
-
let
|
|
344
|
-
if (isNaN(parseInt(
|
|
345
|
-
const
|
|
346
|
-
(
|
|
347
|
-
var
|
|
348
|
-
return (
|
|
346
|
+
let selector = targetId;
|
|
347
|
+
if (isNaN(parseInt(selector)) && (!targetId.startsWith(".") && !targetId.startsWith("[") && !targetId.startsWith("#") && (selector = `#${targetId}`), popoverElement = document.querySelector(selector) || this.getRootNode().querySelector(selector)), !popoverElement) {
|
|
348
|
+
const founded = [...document.querySelectorAll("[data-popover-ids]")].find(
|
|
349
|
+
(el) => {
|
|
350
|
+
var _a2;
|
|
351
|
+
return (_a2 = el.getAttribute("data-popover-ids")) == null ? void 0 : _a2.split(",").find((v) => v.trim() === targetId);
|
|
349
352
|
}
|
|
350
353
|
);
|
|
351
|
-
|
|
354
|
+
founded && (popoverElement = founded);
|
|
352
355
|
}
|
|
353
356
|
}
|
|
354
|
-
|
|
357
|
+
popoverElement instanceof HTMLElement ? (__privateSet(this, _popoverElement, popoverElement), __privateGet(this, _popoverElement).addEventListener(
|
|
355
358
|
"popoverTriggered",
|
|
356
|
-
|
|
357
|
-
),
|
|
359
|
+
__privateGet(this, _popoverTriggeredListener)
|
|
360
|
+
), __privateGet(this, _popoverElement).addEventListener(
|
|
358
361
|
"popoverOpened",
|
|
359
|
-
|
|
360
|
-
),
|
|
362
|
+
__privateGet(this, _popoverOpenedListener)
|
|
363
|
+
), __privateGet(this, _popoverElement).addEventListener(
|
|
361
364
|
"popoverClosing",
|
|
362
|
-
|
|
363
|
-
),
|
|
365
|
+
__privateGet(this, _popoverClosingListener)
|
|
366
|
+
), __privateGet(this, _popoverElement).addEventListener(
|
|
364
367
|
"popoverClosed",
|
|
365
|
-
|
|
366
|
-
)) : console.warn(this, `target ${
|
|
368
|
+
__privateGet(this, _popoverClosedListener)
|
|
369
|
+
)) : console.warn(this, `target ${targetId} not found`);
|
|
367
370
|
}
|
|
368
|
-
|
|
371
|
+
__privateMethod(this, _PopoverButtonElement_instances, updateType_fn).call(this, __privateGet(this, _type).current);
|
|
369
372
|
}
|
|
370
373
|
connectedCallback() {
|
|
371
|
-
|
|
372
|
-
|
|
374
|
+
__privateGet(this, _type).subscribe((e) => {
|
|
375
|
+
__privateMethod(this, _PopoverButtonElement_instances, updateType_fn).call(this, e.current);
|
|
373
376
|
}), this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("role") || this.setAttribute("role", "button");
|
|
374
|
-
const
|
|
375
|
-
|
|
377
|
+
const targetId = this.getAttribute("target");
|
|
378
|
+
targetId && this.changePopover(targetId), this.isConnected && __privateGet(this, _type).observe();
|
|
376
379
|
}
|
|
377
380
|
disconnectedCallback() {
|
|
378
|
-
|
|
381
|
+
__privateGet(this, _type).unobserve(), this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), this.removeAttribute("role"), this.removeAttribute("tabindex"), __privateMethod(this, _PopoverButtonElement_instances, unlistenPopover_fn).call(this);
|
|
379
382
|
}
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
+
};
|
|
384
|
+
_popoverElement = new WeakMap(), _type = new WeakMap(), _PopoverButtonElement_instances = new WeakSet(), unlistenPopover_fn = /* @__PURE__ */ __name(function() {
|
|
385
|
+
__privateGet(this, _popoverElement) && (__privateGet(this, _popoverElement).removeEventListener(
|
|
383
386
|
"popoverTriggered",
|
|
384
|
-
|
|
385
|
-
),
|
|
387
|
+
__privateGet(this, _popoverTriggeredListener)
|
|
388
|
+
), __privateGet(this, _popoverElement).removeEventListener(
|
|
386
389
|
"popoverOpened",
|
|
387
|
-
|
|
388
|
-
),
|
|
390
|
+
__privateGet(this, _popoverOpenedListener)
|
|
391
|
+
), __privateGet(this, _popoverElement).removeEventListener(
|
|
389
392
|
"popoverClosing",
|
|
390
|
-
|
|
391
|
-
),
|
|
393
|
+
__privateGet(this, _popoverClosingListener)
|
|
394
|
+
), __privateGet(this, _popoverElement).removeEventListener(
|
|
392
395
|
"popoverClosed",
|
|
393
|
-
|
|
396
|
+
__privateGet(this, _popoverClosedListener)
|
|
394
397
|
));
|
|
395
|
-
},
|
|
396
|
-
|
|
398
|
+
}, "#unlistenPopover"), _popoverTriggeredListener = new WeakMap(), _popoverOpenedListener = new WeakMap(), _popoverClosingListener = new WeakMap(), _popoverClosedListener = new WeakMap(), updateType_fn = /* @__PURE__ */ __name(function(value) {
|
|
399
|
+
__privateGet(this, _popoverElement) instanceof PopoverElement && (value !== "close" ? (this.setAttribute("aria-haspopup", "true"), this.setAttribute(
|
|
397
400
|
"aria-expanded",
|
|
398
|
-
|
|
399
|
-
), this.setAttribute("aria-controls",
|
|
400
|
-
};
|
|
401
|
-
|
|
401
|
+
__privateGet(this, _popoverElement).opened ? "true" : "false"
|
|
402
|
+
), this.setAttribute("aria-controls", __privateGet(this, _popoverElement).id || "")) : (this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls")));
|
|
403
|
+
}, "#updateType"), __name(_PopoverButtonElement, "PopoverButtonElement");
|
|
404
|
+
let PopoverButtonElement = _PopoverButtonElement;
|
|
405
|
+
isBrowser && !customElements.get("e-popover-button") && customElements.define("e-popover-button", PopoverButtonElement);
|
|
402
406
|
export {
|
|
403
|
-
|
|
404
|
-
|
|
407
|
+
PopoverButtonElement,
|
|
408
|
+
PopoverElement
|
|
405
409
|
};
|