aptechka 0.47.5 → 0.47.7
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/popover/index.cjs +1 -1
- package/lib/popover/index.js +75 -73
- package/package.json +1 -1
package/lib/popover/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var J=n=>{throw TypeError(n)};var N=(n,a,t)=>a.has(n)||J("Cannot "+t);var e=(n,a,t)=>(N(n,a,"read from private field"),t?t.call(n):a.get(n)),s=(n,a,t)=>a.has(n)?J("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(n):a.set(n,t),i=(n,a,t,h)=>(N(n,a,"write to private field"),h?h.call(n,t):a.set(n,t),t),v=(n,a,t)=>(N(n,a,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../css-property/index.cjs"),Z=require("../Store-DRp_K37w.cjs"),j=require("../index-Cqw2NKev.cjs"),B=require("../events-KVanG9sR.cjs"),ee=require("../function-MthRj-GJ.cjs"),te=require("../style-At6aDoqG.cjs"),K=require("../url-CLvdjbII.cjs"),Q=require("../window-resizer/index.cjs");var m,d,O,w,u,f,p,g,y,L,b,T,c,X,W,P,I,A,D,k,x,R,_,U;const l=class l extends HTMLElement{constructor(){super(...arguments);s(this,c);s(this,m);s(this,d);s(this,O);s(this,w);s(this,u);s(this,f);s(this,p);s(this,g);s(this,y);s(this,L);s(this,b);s(this,T);s(this,P);s(this,A);s(this,k);s(this,x);s(this,R);s(this,_);this.urlValue="",i(this,m,-1),i(this,d,new Z.Store(!1)),i(this,u,new S.CSSProperty(this,"--history",!1)),i(this,f,new S.CSSProperty(this,"--restore",!1)),i(this,p,new S.CSSProperty(this,"--dominance",0)),i(this,g,new S.CSSProperty(this,"--group","")),i(this,y,new S.CSSProperty(this,"--click-outside",!1)),i(this,L,new S.CSSProperty(this,"--escape",!1)),i(this,b,!1),this.open=t=>{if(e(this,d).current)return;i(this,T,t==null?void 0:t.trigger),e(this,p).current&&(l.__opened=l.__opened.filter(o=>o!==this&&v(this,c,U).call(this,this,o)?(o.close(),!1):!0)),l.__opened.push(this),i(this,m,l.__opened.length-1),this.style.setProperty("--open-index",e(this,m).toString()),clearTimeout(e(this,O)),this.classList.remove("closing"),this.classList.add("triggered"),this.style.display="block",B.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,T)}}),e(this,u).current&&e(this,b)&&history.pushState(history.state,"",e(this,c,X)),e(this,d).current=!0;const h=()=>{addEventListener("click",e(this,P)),addEventListener("keydown",e(this,A)),e(this,_).call(this),this.style.opacity="1",this.classList.add("opened"),B.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,T)}}),i(this,w,void 0),this.setAttribute("aria-hidden","false")};t!=null&&t.skipTransition?h():i(this,w,setTimeout(h,10))},this.close=()=>{e(this,d).current&&(removeEventListener("click",e(this,P)),removeEventListener("keydown",e(this,A)),e(this,d).current=!1,l.__opened=l.__opened.filter(t=>t===this?!1:!e(t,w)&&v(this,c,U).call(this,this,t)?(t.close(),!1):!0),v(this,c,I).call(this),this.classList.remove("opened"),this.classList.add("closing"),this.setAttribute("aria-hidden","true"),this.style.opacity="0",B.dispatchEvent(this,"popoverClosing",{custom:!0}),setTimeout(()=>{this.classList.remove("triggered"),this.classList.remove("closing"),this.style.display="none",this.style.removeProperty("--open-index"),B.dispatchEvent(this,"popoverClosed",{custom:!0})},te.getElementTransitionDurationMS(this)+10))},i(this,P,t=>{!e(this,y).current||!e(this,c,W)||v(this,c,D).call(this,()=>{var F;const h=t.composedPath();if(h.find(G=>G instanceof HTMLElement&&G.hasAttribute("data-popover-content")))return;const o=h[0],z=o instanceof Node&&(this.contains(o)||((F=this.shadowRoot)==null?void 0:F.contains(o))),C=o instanceof HTMLElement&&o.hasAttribute("data-outside");(!z||C)&&this.close()})}),i(this,A,t=>{!e(this,L).current||!e(this,c,W)||v(this,c,D).call(this,()=>{t.code==="Escape"&&this.close()})}),i(this,k,()=>{i(this,b,!1),e(this,d).current&&e(this,u).current&&!location.search.includes(this.id)?this.close():!e(this,d).current&&e(this,u).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),i(this,b,!0)}),i(this,x,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),e(this,R).call(this)}),i(this,R,ee.debounce(()=>{e(this,_).call(this)},10)),i(this,_,()=>{this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px")})}get history(){return e(this,u)}get restore(){return e(this,f)}get dominance(){return e(this,p)}get group(){return e(this,g)}get clickOutside(){return e(this,y)}get escape(){return e(this,L)}get opened(){return e(this,d)}get lastTrigger(){return e(this,T)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,d).current&&K.updateSearchParameter(this.id,t)}connectedCallback(){e(this,u).observe(),e(this,f).observe(),e(this,p).observe(),e(this,g).observe(),e(this,y).observe(),e(this,L).observe(),this.style.opacity="0",this.style.display="none",this.setAttribute("role","dialog"),this.setAttribute("aria-hidden","true"),this.classList.remove("closing"),this.classList.remove("closed"),this.classList.remove("triggered"),this.classList.remove("opened"),addEventListener("popstate",e(this,k)),setTimeout(()=>{e(this,f).current?(this.urlValue=K.parseSearchParameters(location.search)[this.id],e(this,k).call(this)):(v(this,c,I).call(this),i(this,b,!0))},0),Q.windowResizer.subscribe(e(this,x))}disconnectedCallback(){Q.windowResizer.unsubscribe(e(this,x)),e(this,u).close(),e(this,f).close(),e(this,p).close(),e(this,g).close(),e(this,y).close(),e(this,L).close(),this.style.opacity="",this.style.display="",this.removeAttribute("role"),this.removeAttribute("aria-hidden"),l.__opened=l.__opened.filter(t=>t!==this),clearTimeout(e(this,O)),clearTimeout(e(this,w)),removeEventListener("popstate",e(this,k)),removeEventListener("click",e(this,P)),removeEventListener("keydown",e(this,A)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),v(this,c,I).call(this)}};m=new WeakMap,d=new WeakMap,O=new WeakMap,w=new WeakMap,u=new WeakMap,f=new WeakMap,p=new WeakMap,g=new WeakMap,y=new WeakMap,L=new WeakMap,b=new WeakMap,T=new WeakMap,c=new WeakSet,X=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},W=function(){return e(this,m)===l.__opened.length-1},P=new WeakMap,I=function(){if(e(this,u).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},A=new WeakMap,D=function(t){(l.__opened[e(this,m)-1]||l.__opened.length===1||l.__opened.filter(h=>h!==this).every(h=>e(this,p).current>h.dominance.current))&&t()},k=new WeakMap,x=new WeakMap,R=new WeakMap,_=new WeakMap,U=function(t,h){if(e(t,g).current===e(h,g).current&&t.dominance.current>=h.dominance.current)return!0},l.__opened=[];let q=l;j.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",q);var r,E,V,M,$,H;class Y extends HTMLElement{constructor(){super();s(this,r);s(this,E,new S.CSSProperty(this,"--type","open"));s(this,V,()=>{this.classList.add("triggered")});s(this,M,()=>{this.classList.add("opened"),this.setAttribute("aria-expanded","true")});s(this,$,()=>{this.classList.remove("opened")});s(this,H,()=>{this.classList.remove("triggered"),this.setAttribute("aria-expanded","false")});j.isBrowser&&(this.addEventListener("click",()=>{if(e(this,r)){const t=e(this,E).current;t==="open"||t==="toggle"&&!e(this,r).opened.current?e(this,r).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,r).opened.current)&&e(this,r).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&t.currentTarget.click()}))}get type(){return e(this,E)}get popoverElement(){return e(this,r)}connectedCallback(){var h;e(this,E).subscribe(o=>{e(this,r)instanceof q&&(o.current!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,r).opened.current?"true":"false"),this.setAttribute("aria-controls",e(this,r).id||"")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))}),this.hasAttribute("tabindex")||(this.tabIndex=0);const t=this.getAttribute("target");if(t){let o=null;if(t==="parent"){const z=this.closest("[popover-target]");if(z)o=z;else{const C=this.getRootNode();C instanceof ShadowRoot?o=C.host.closest("[popover-target]"):C instanceof HTMLElement&&(o=C.closest("[popover-target]"))}}else t==="sibling"?o=(h=this.parentElement)==null?void 0:h.querySelector("[popover-target]"):o=document.querySelector(`#${t}`)||this.getRootNode().querySelector(`#${t}`);o instanceof HTMLElement?(i(this,r,o),e(this,r).addEventListener("popoverTriggered",e(this,V)),e(this,r).addEventListener("popoverOpened",e(this,M)),e(this,r).addEventListener("popoverClosing",e(this,$)),e(this,r).addEventListener("popoverClosed",e(this,H))):console.warn(this,`target ${t} not found`)}this.isConnected&&e(this,E).observe()}disconnectedCallback(){e(this,E).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),e(this,r)&&(e(this,r).removeEventListener("popoverTriggered",e(this,V)),e(this,r).removeEventListener("popoverOpened",e(this,M)),e(this,r).removeEventListener("popoverClosing",e(this,$)),e(this,r).removeEventListener("popoverClosed",e(this,H)))}}r=new WeakMap,E=new WeakMap,V=new WeakMap,M=new WeakMap,$=new WeakMap,H=new WeakMap;j.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",Y);exports.PopoverButtonElement=Y;exports.PopoverElement=q;
|
package/lib/popover/index.js
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
var
|
|
1
|
+
var J = (n) => {
|
|
2
2
|
throw TypeError(n);
|
|
3
3
|
};
|
|
4
|
-
var q = (n,
|
|
5
|
-
var e = (n,
|
|
6
|
-
import { CSSProperty as
|
|
7
|
-
import { S as
|
|
8
|
-
import { i as
|
|
4
|
+
var q = (n, c, t) => c.has(n) || J("Cannot " + t);
|
|
5
|
+
var e = (n, c, t) => (q(n, c, "read from private field"), t ? t.call(n) : c.get(n)), s = (n, c, t) => c.has(n) ? J("Cannot add the same private member more than once") : c instanceof WeakSet ? c.add(n) : c.set(n, t), i = (n, c, t, h) => (q(n, c, "write to private field"), h ? h.call(n, t) : c.set(n, t), t), m = (n, c, t) => (q(n, c, "access private method"), t);
|
|
6
|
+
import { CSSProperty as T } from "../css-property/index.js";
|
|
7
|
+
import { S as X } from "../Store-D2xCXENW.js";
|
|
8
|
+
import { i as j } from "../index-euf5anj6.js";
|
|
9
9
|
import { d as z } from "../events-CsVF98U6.js";
|
|
10
|
-
import { d as
|
|
11
|
-
import { g as
|
|
12
|
-
import { u as
|
|
13
|
-
import { windowResizer as
|
|
14
|
-
var
|
|
15
|
-
const
|
|
10
|
+
import { d as Y } from "../function-C10DGppn.js";
|
|
11
|
+
import { g as Z } from "../style-j2TwriJ_.js";
|
|
12
|
+
import { u as ee, p as te } from "../url-CfcHdBT6.js";
|
|
13
|
+
import { windowResizer as K } from "../window-resizer/index.js";
|
|
14
|
+
var v, d, V, w, p, f, u, g, y, L, b, A, a, Q, B, k, N, S, D, x, P, O, _, U;
|
|
15
|
+
const l = class l extends HTMLElement {
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
|
-
s(this,
|
|
19
|
-
s(this,
|
|
18
|
+
s(this, a);
|
|
19
|
+
s(this, v);
|
|
20
20
|
s(this, d);
|
|
21
21
|
s(this, V);
|
|
22
|
-
s(this,
|
|
22
|
+
s(this, w);
|
|
23
23
|
s(this, p);
|
|
24
|
-
s(this,
|
|
24
|
+
s(this, f);
|
|
25
25
|
s(this, u);
|
|
26
26
|
s(this, g);
|
|
27
|
-
s(this, f);
|
|
28
27
|
s(this, y);
|
|
29
28
|
s(this, L);
|
|
30
|
-
s(this,
|
|
29
|
+
s(this, b);
|
|
31
30
|
s(this, A);
|
|
32
31
|
s(this, k);
|
|
33
32
|
s(this, S);
|
|
34
|
-
s(this,
|
|
35
|
-
s(this, O);
|
|
33
|
+
s(this, x);
|
|
36
34
|
s(this, P);
|
|
37
|
-
|
|
35
|
+
s(this, O);
|
|
36
|
+
s(this, _);
|
|
37
|
+
this.urlValue = "", i(this, v, -1), i(this, d, new X(!1)), i(this, p, new T(this, "--history", !1)), i(this, f, new T(this, "--restore", !1)), i(this, u, new T(this, "--dominance", 0)), i(this, g, new T(this, "--group", "")), i(this, y, new T(this, "--click-outside", !1)), i(this, L, new T(this, "--escape", !1)), i(this, b, !1), this.open = (t) => {
|
|
38
38
|
if (e(this, d).current)
|
|
39
39
|
return;
|
|
40
|
-
i(this,
|
|
40
|
+
i(this, A, t == null ? void 0 : t.trigger), e(this, u).current && (l.__opened = l.__opened.filter((o) => o !== this && m(this, a, U).call(this, this, o) ? (o.close(), !1) : !0)), l.__opened.push(this), i(this, v, l.__opened.length - 1), this.style.setProperty("--open-index", e(this, v).toString()), clearTimeout(e(this, V)), this.classList.remove("closing"), this.classList.add("triggered"), this.style.display = "block", z(this, "popoverTriggered", {
|
|
41
41
|
custom: !0,
|
|
42
42
|
detail: {
|
|
43
|
-
trigger: e(this,
|
|
43
|
+
trigger: e(this, A)
|
|
44
44
|
}
|
|
45
|
-
}), e(this, p).current && e(this,
|
|
45
|
+
}), e(this, p).current && e(this, b) && history.pushState(history.state, "", e(this, a, Q)), e(this, d).current = !0;
|
|
46
46
|
const h = () => {
|
|
47
|
-
addEventListener("click", e(this,
|
|
47
|
+
addEventListener("click", e(this, k)), addEventListener("keydown", e(this, S)), e(this, _).call(this), this.style.opacity = "1", this.classList.add("opened"), z(this, "popoverOpened", {
|
|
48
48
|
custom: !0,
|
|
49
49
|
detail: {
|
|
50
|
-
trigger: e(this,
|
|
50
|
+
trigger: e(this, A)
|
|
51
51
|
}
|
|
52
|
-
}), i(this,
|
|
52
|
+
}), i(this, w, void 0), this.setAttribute("aria-hidden", "false");
|
|
53
53
|
};
|
|
54
|
-
t != null && t.skipTransition ? h() : i(this,
|
|
54
|
+
t != null && t.skipTransition ? h() : i(this, w, setTimeout(h, 10));
|
|
55
55
|
}, this.close = () => {
|
|
56
|
-
e(this, d).current && (removeEventListener("click", e(this,
|
|
56
|
+
e(this, d).current && (removeEventListener("click", e(this, k)), removeEventListener("keydown", e(this, S)), e(this, d).current = !1, l.__opened = l.__opened.filter((t) => t === this ? !1 : !e(t, w) && m(this, a, U).call(this, this, t) ? (t.close(), !1) : !0), m(this, a, N).call(this), this.classList.remove("opened"), this.classList.add("closing"), this.setAttribute("aria-hidden", "true"), this.style.opacity = "0", z(this, "popoverClosing", {
|
|
57
57
|
custom: !0
|
|
58
58
|
}), setTimeout(() => {
|
|
59
|
-
this.classList.remove("triggered"), this.classList.remove("closing"), this.style.display = "none", z(this, "popoverClosed", {
|
|
59
|
+
this.classList.remove("triggered"), this.classList.remove("closing"), this.style.display = "none", this.style.removeProperty("--open-index"), z(this, "popoverClosed", {
|
|
60
60
|
custom: !0
|
|
61
61
|
});
|
|
62
|
-
},
|
|
63
|
-
}, i(this,
|
|
64
|
-
e(this,
|
|
65
|
-
var
|
|
62
|
+
}, Z(this) + 10));
|
|
63
|
+
}, i(this, k, (t) => {
|
|
64
|
+
!e(this, y).current || !e(this, a, B) || m(this, a, D).call(this, () => {
|
|
65
|
+
var F;
|
|
66
66
|
const h = t.composedPath();
|
|
67
67
|
if (h.find(
|
|
68
|
-
(
|
|
68
|
+
(G) => G instanceof HTMLElement && G.hasAttribute("data-popover-content")
|
|
69
69
|
))
|
|
70
70
|
return;
|
|
71
|
-
const o = h[0], I = o instanceof Node && (this.contains(o) || ((
|
|
71
|
+
const o = h[0], I = o instanceof Node && (this.contains(o) || ((F = this.shadowRoot) == null ? void 0 : F.contains(o))), C = o instanceof HTMLElement && o.hasAttribute("data-outside");
|
|
72
72
|
(!I || C) && this.close();
|
|
73
73
|
});
|
|
74
|
-
}), i(this,
|
|
75
|
-
e(this,
|
|
74
|
+
}), i(this, S, (t) => {
|
|
75
|
+
!e(this, L).current || !e(this, a, B) || m(this, a, D).call(this, () => {
|
|
76
76
|
t.code === "Escape" && this.close();
|
|
77
77
|
});
|
|
78
|
-
}), i(this,
|
|
79
|
-
i(this,
|
|
80
|
-
}), i(this,
|
|
78
|
+
}), i(this, x, () => {
|
|
79
|
+
i(this, b, !1), e(this, d).current && e(this, p).current && !location.search.includes(this.id) ? this.close() : !e(this, d).current && e(this, p).current && location.search.includes(this.id) && this.open({ trigger: this.idWithValue }), i(this, b, !0);
|
|
80
|
+
}), i(this, P, () => {
|
|
81
81
|
this.style.setProperty("--content-width", "initial"), this.style.setProperty("--content-height", "initial"), e(this, O).call(this);
|
|
82
|
-
}), i(this, O,
|
|
83
|
-
e(this,
|
|
84
|
-
}, 10)), i(this,
|
|
82
|
+
}), i(this, O, Y(() => {
|
|
83
|
+
e(this, _).call(this);
|
|
84
|
+
}, 10)), i(this, _, () => {
|
|
85
85
|
this.style.setProperty("--content-width", this.scrollWidth + "px"), this.style.setProperty("--content-height", this.scrollHeight + "px");
|
|
86
86
|
});
|
|
87
87
|
}
|
|
@@ -89,7 +89,7 @@ const c = class c extends HTMLElement {
|
|
|
89
89
|
return e(this, p);
|
|
90
90
|
}
|
|
91
91
|
get restore() {
|
|
92
|
-
return e(this,
|
|
92
|
+
return e(this, f);
|
|
93
93
|
}
|
|
94
94
|
get dominance() {
|
|
95
95
|
return e(this, u);
|
|
@@ -98,53 +98,55 @@ const c = class c extends HTMLElement {
|
|
|
98
98
|
return e(this, g);
|
|
99
99
|
}
|
|
100
100
|
get clickOutside() {
|
|
101
|
-
return e(this,
|
|
101
|
+
return e(this, y);
|
|
102
102
|
}
|
|
103
103
|
get escape() {
|
|
104
|
-
return e(this,
|
|
104
|
+
return e(this, L);
|
|
105
105
|
}
|
|
106
106
|
get opened() {
|
|
107
107
|
return e(this, d);
|
|
108
108
|
}
|
|
109
109
|
get lastTrigger() {
|
|
110
|
-
return e(this,
|
|
110
|
+
return e(this, A);
|
|
111
111
|
}
|
|
112
112
|
get idWithValue() {
|
|
113
113
|
return `${this.id}${this.urlValue ? "=" + this.urlValue : ""}`;
|
|
114
114
|
}
|
|
115
115
|
updateUrlValue(t) {
|
|
116
|
-
this.urlValue = (t == null ? void 0 : t.toString()) || "", e(this, d).current &&
|
|
116
|
+
this.urlValue = (t == null ? void 0 : t.toString()) || "", e(this, d).current && ee(this.id, t);
|
|
117
117
|
}
|
|
118
118
|
connectedCallback() {
|
|
119
|
-
e(this, p).observe(), e(this,
|
|
120
|
-
e(this,
|
|
121
|
-
}, 0),
|
|
119
|
+
e(this, p).observe(), e(this, f).observe(), e(this, u).observe(), e(this, g).observe(), e(this, y).observe(), e(this, L).observe(), this.style.opacity = "0", this.style.display = "none", this.setAttribute("role", "dialog"), this.setAttribute("aria-hidden", "true"), this.classList.remove("closing"), this.classList.remove("closed"), this.classList.remove("triggered"), this.classList.remove("opened"), addEventListener("popstate", e(this, x)), setTimeout(() => {
|
|
120
|
+
e(this, f).current ? (this.urlValue = te(location.search)[this.id], e(this, x).call(this)) : (m(this, a, N).call(this), i(this, b, !0));
|
|
121
|
+
}, 0), K.subscribe(e(this, P));
|
|
122
122
|
}
|
|
123
123
|
disconnectedCallback() {
|
|
124
|
-
|
|
124
|
+
K.unsubscribe(e(this, P)), e(this, p).close(), e(this, f).close(), e(this, u).close(), e(this, g).close(), e(this, y).close(), e(this, L).close(), this.style.opacity = "", this.style.display = "", this.removeAttribute("role"), this.removeAttribute("aria-hidden"), l.__opened = l.__opened.filter((t) => t !== this), clearTimeout(e(this, V)), clearTimeout(e(this, w)), removeEventListener("popstate", e(this, x)), removeEventListener("click", e(this, k)), removeEventListener("keydown", e(this, S)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), m(this, a, N).call(this);
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
|
-
|
|
127
|
+
v = new WeakMap(), d = new WeakMap(), V = new WeakMap(), w = new WeakMap(), p = new WeakMap(), f = new WeakMap(), u = new WeakMap(), g = new WeakMap(), y = new WeakMap(), L = new WeakMap(), b = new WeakMap(), A = new WeakMap(), a = new WeakSet(), Q = function() {
|
|
128
128
|
return `${location.pathname}${location.search ? location.search + "&" : "?"}${this.idWithValue}`;
|
|
129
|
-
},
|
|
129
|
+
}, B = function() {
|
|
130
|
+
return e(this, v) === l.__opened.length - 1;
|
|
131
|
+
}, k = new WeakMap(), N = function() {
|
|
130
132
|
if (e(this, p).current) {
|
|
131
133
|
const t = new URL(location.href);
|
|
132
134
|
t.searchParams.delete(this.id), history.replaceState(history.state, "", t.href);
|
|
133
135
|
}
|
|
134
|
-
},
|
|
135
|
-
(
|
|
136
|
-
},
|
|
136
|
+
}, S = new WeakMap(), D = function(t) {
|
|
137
|
+
(l.__opened[e(this, v) - 1] || l.__opened.length === 1 || l.__opened.filter((h) => h !== this).every((h) => e(this, u).current > h.dominance.current)) && t();
|
|
138
|
+
}, x = new WeakMap(), P = new WeakMap(), O = new WeakMap(), _ = new WeakMap(), U = function(t, h) {
|
|
137
139
|
if (e(t, g).current === e(h, g).current && t.dominance.current >= h.dominance.current)
|
|
138
140
|
return !0;
|
|
139
|
-
},
|
|
140
|
-
let W =
|
|
141
|
-
|
|
142
|
-
var r,
|
|
143
|
-
class
|
|
141
|
+
}, l.__opened = [];
|
|
142
|
+
let W = l;
|
|
143
|
+
j && !customElements.get("e-popover") && customElements.define("e-popover", W);
|
|
144
|
+
var r, E, $, H, M, R;
|
|
145
|
+
class se extends HTMLElement {
|
|
144
146
|
constructor() {
|
|
145
147
|
super();
|
|
146
148
|
s(this, r);
|
|
147
|
-
s(this,
|
|
149
|
+
s(this, E, new T(this, "--type", "open"));
|
|
148
150
|
s(this, $, () => {
|
|
149
151
|
this.classList.add("triggered");
|
|
150
152
|
});
|
|
@@ -157,9 +159,9 @@ class te extends HTMLElement {
|
|
|
157
159
|
s(this, R, () => {
|
|
158
160
|
this.classList.remove("triggered"), this.setAttribute("aria-expanded", "false");
|
|
159
161
|
});
|
|
160
|
-
|
|
162
|
+
j && (this.addEventListener("click", () => {
|
|
161
163
|
if (e(this, r)) {
|
|
162
|
-
const t = e(this,
|
|
164
|
+
const t = e(this, E).current;
|
|
163
165
|
t === "open" || t === "toggle" && !e(this, r).opened.current ? e(this, r).open({ trigger: this }) : (t === "close" || t === "toggle" && e(this, r).opened.current) && e(this, r).close();
|
|
164
166
|
}
|
|
165
167
|
}), this.addEventListener("keydown", (t) => {
|
|
@@ -167,14 +169,14 @@ class te extends HTMLElement {
|
|
|
167
169
|
}));
|
|
168
170
|
}
|
|
169
171
|
get type() {
|
|
170
|
-
return e(this,
|
|
172
|
+
return e(this, E);
|
|
171
173
|
}
|
|
172
174
|
get popoverElement() {
|
|
173
175
|
return e(this, r);
|
|
174
176
|
}
|
|
175
177
|
connectedCallback() {
|
|
176
178
|
var h;
|
|
177
|
-
e(this,
|
|
179
|
+
e(this, E).subscribe((o) => {
|
|
178
180
|
e(this, r) instanceof W && (o.current !== "close" ? (this.setAttribute("aria-haspopup", "true"), this.setAttribute(
|
|
179
181
|
"aria-expanded",
|
|
180
182
|
e(this, r).opened.current ? "true" : "false"
|
|
@@ -206,10 +208,10 @@ class te extends HTMLElement {
|
|
|
206
208
|
e(this, R)
|
|
207
209
|
)) : console.warn(this, `target ${t} not found`);
|
|
208
210
|
}
|
|
209
|
-
this.isConnected && e(this,
|
|
211
|
+
this.isConnected && e(this, E).observe();
|
|
210
212
|
}
|
|
211
213
|
disconnectedCallback() {
|
|
212
|
-
e(this,
|
|
214
|
+
e(this, E).unobserve(), this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), e(this, r) && (e(this, r).removeEventListener(
|
|
213
215
|
"popoverTriggered",
|
|
214
216
|
e(this, $)
|
|
215
217
|
), e(this, r).removeEventListener(
|
|
@@ -224,9 +226,9 @@ class te extends HTMLElement {
|
|
|
224
226
|
));
|
|
225
227
|
}
|
|
226
228
|
}
|
|
227
|
-
r = new WeakMap(),
|
|
228
|
-
|
|
229
|
+
r = new WeakMap(), E = new WeakMap(), $ = new WeakMap(), H = new WeakMap(), M = new WeakMap(), R = new WeakMap();
|
|
230
|
+
j && !customElements.get("e-popover-button") && customElements.define("e-popover-button", se);
|
|
229
231
|
export {
|
|
230
|
-
|
|
232
|
+
se as PopoverButtonElement,
|
|
231
233
|
W as PopoverElement
|
|
232
234
|
};
|