aptechka 0.49.1 → 0.50.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/pixel-perfect/index.cjs +4 -4
- package/lib/pixel-perfect/index.js +14 -14
- package/lib/popover/PopoverElement.d.ts +7 -6
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +202 -154
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var u=t=>{throw TypeError(t)};var y=(t,s,e)=>s.has(t)||u("Cannot "+e);var i=(t,s,e)=>(y(t,s,"read from private field"),e?e.call(t):s.get(t)),r=(t,s,e)=>s.has(t)?u("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,e),
|
|
1
|
+
"use strict";var u=t=>{throw TypeError(t)};var y=(t,s,e)=>s.has(t)||u("Cannot "+e);var i=(t,s,e)=>(y(t,s,"read from private field"),e?e.call(t):s.get(t)),r=(t,s,e)=>s.has(t)?u("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,e),a=(t,s,e,l)=>(y(t,s,"write to private field"),l?l.call(t,e):s.set(t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../dom-JBOkFLTh.cjs"),x=require("../jss-BXAMRO12.cjs");require("../index-Cqw2NKev.cjs");const v=x.createStylesheet(`
|
|
2
2
|
:host {
|
|
3
3
|
position: fixed;
|
|
4
4
|
top: 0;
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
input:hover {
|
|
46
46
|
opacity: 1
|
|
47
47
|
}
|
|
48
|
-
`);var o,n,c,
|
|
48
|
+
`);var o,n,c,h,p;class f extends HTMLElement{constructor(){super();r(this,o,null);r(this,n,null);r(this,c);r(this,h,()=>{if(!i(this,n))return;const e=i(this,o).scrollLeft*-1,l=i(this,o).scrollTop*-1;i(this,n).style.transform=`translate3d(${e}px, ${l}px, 0px)`});r(this,p,()=>{i(this,n)&&(i(this,n).style.opacity=i(this,c).value)});const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[...e.adoptedStyleSheets,v],e.innerHTML=`
|
|
49
49
|
<slot></slot>
|
|
50
50
|
<input type="range" min="0" max="1" step="0.01" value="${this.getAttribute("opacity")||0}"/>
|
|
51
|
-
`,
|
|
51
|
+
`,a(this,c,e.querySelector("input")),i(this,c).addEventListener("input",i(this,p))}connectedCallback(){var l,m;a(this,o,g.findScrollParentElement(this)),(l=i(this,o))==null||l.addEventListener("scroll",i(this,h));const e=(m=this.shadowRoot.querySelector("slot"))==null?void 0:m.assignedElements()[0];if(e instanceof HTMLElement){a(this,n,e);const d=i(this,n).querySelector("img");d&&(a(this,n,d),d.style.cssText=`
|
|
52
52
|
display: block;
|
|
53
53
|
width: 100%;
|
|
54
54
|
height: max-content;
|
|
55
55
|
object-fit: cover;
|
|
56
|
-
`)}i(this,
|
|
56
|
+
`)}i(this,p).call(this)}disconnectedCallback(){var e;(e=i(this,o))==null||e.removeEventListener("scroll",i(this,h))}}o=new WeakMap,n=new WeakMap,c=new WeakMap,h=new WeakMap,p=new WeakMap;customElements.get("e-pixel-perfect")||customElements.define("e-pixel-perfect",f);exports.PixelPerfectElement=f;
|
|
@@ -2,7 +2,7 @@ var u = (e) => {
|
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
4
|
var f = (e, s, t) => s.has(e) || u("Cannot " + t);
|
|
5
|
-
var i = (e, s, t) => (f(e, s, "read from private field"), t ? t.call(e) : s.get(e)), c = (e, s, t) => s.has(e) ? u("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t),
|
|
5
|
+
var i = (e, s, t) => (f(e, s, "read from private field"), t ? t.call(e) : s.get(e)), c = (e, s, t) => s.has(e) ? u("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t), a = (e, s, t, l) => (f(e, s, "write to private field"), l ? l.call(e, t) : s.set(e, t), t);
|
|
6
6
|
import { f as y } from "../dom-CVWzyXPH.js";
|
|
7
7
|
import { c as x } from "../jss-Chm3yE5y.js";
|
|
8
8
|
import "../index-euf5anj6.js";
|
|
@@ -57,53 +57,53 @@ const g = x(
|
|
|
57
57
|
}
|
|
58
58
|
`
|
|
59
59
|
);
|
|
60
|
-
var o, n, r,
|
|
60
|
+
var o, n, r, h, p;
|
|
61
61
|
class v extends HTMLElement {
|
|
62
62
|
constructor() {
|
|
63
63
|
super();
|
|
64
64
|
c(this, o, null);
|
|
65
65
|
c(this, n, null);
|
|
66
66
|
c(this, r);
|
|
67
|
-
c(this,
|
|
67
|
+
c(this, h, () => {
|
|
68
68
|
if (!i(this, n))
|
|
69
69
|
return;
|
|
70
70
|
const t = i(this, o).scrollLeft * -1, l = i(this, o).scrollTop * -1;
|
|
71
71
|
i(this, n).style.transform = `translate3d(${t}px, ${l}px, 0px)`;
|
|
72
72
|
});
|
|
73
|
-
c(this,
|
|
73
|
+
c(this, p, () => {
|
|
74
74
|
i(this, n) && (i(this, n).style.opacity = i(this, r).value);
|
|
75
75
|
});
|
|
76
76
|
const t = this.attachShadow({ mode: "open" });
|
|
77
77
|
t.adoptedStyleSheets = [...t.adoptedStyleSheets, g], t.innerHTML = `
|
|
78
78
|
<slot></slot>
|
|
79
79
|
<input type="range" min="0" max="1" step="0.01" value="${this.getAttribute("opacity") || 0}"/>
|
|
80
|
-
`,
|
|
80
|
+
`, a(this, r, t.querySelector("input")), i(this, r).addEventListener("input", i(this, p));
|
|
81
81
|
}
|
|
82
82
|
connectedCallback() {
|
|
83
|
-
var l,
|
|
84
|
-
|
|
85
|
-
const t = (
|
|
83
|
+
var l, m;
|
|
84
|
+
a(this, o, y(this)), (l = i(this, o)) == null || l.addEventListener("scroll", i(this, h));
|
|
85
|
+
const t = (m = this.shadowRoot.querySelector("slot")) == null ? void 0 : m.assignedElements()[0];
|
|
86
86
|
if (t instanceof HTMLElement) {
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
|
|
87
|
+
a(this, n, t);
|
|
88
|
+
const d = i(this, n).querySelector("img");
|
|
89
|
+
d && (a(this, n, d), d.style.cssText = `
|
|
90
90
|
display: block;
|
|
91
91
|
width: 100%;
|
|
92
92
|
height: max-content;
|
|
93
93
|
object-fit: cover;
|
|
94
94
|
`);
|
|
95
95
|
}
|
|
96
|
-
i(this,
|
|
96
|
+
i(this, p).call(this);
|
|
97
97
|
}
|
|
98
98
|
disconnectedCallback() {
|
|
99
99
|
var t;
|
|
100
100
|
(t = i(this, o)) == null || t.removeEventListener(
|
|
101
101
|
"scroll",
|
|
102
|
-
i(this,
|
|
102
|
+
i(this, h)
|
|
103
103
|
);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
o = new WeakMap(), n = new WeakMap(), r = new WeakMap(),
|
|
106
|
+
o = new WeakMap(), n = new WeakMap(), r = new WeakMap(), h = new WeakMap(), p = new WeakMap();
|
|
107
107
|
customElements.get("e-pixel-perfect") || customElements.define("e-pixel-perfect", v);
|
|
108
108
|
export {
|
|
109
109
|
v as PixelPerfectElement
|
|
@@ -12,12 +12,13 @@ export interface PopoverEvents {
|
|
|
12
12
|
}
|
|
13
13
|
export declare class PopoverElement extends HTMLElement {
|
|
14
14
|
#private;
|
|
15
|
-
private static
|
|
16
|
-
private static __openedCounter;
|
|
15
|
+
private static stack;
|
|
17
16
|
urlValue: string;
|
|
17
|
+
constructor();
|
|
18
18
|
get history(): CSSProperty<false>;
|
|
19
19
|
get restore(): CSSProperty<false>;
|
|
20
|
-
get
|
|
20
|
+
get closeRest(): CSSProperty<boolean>;
|
|
21
|
+
get closeRestInGroup(): CSSProperty<boolean>;
|
|
21
22
|
get group(): CSSProperty<"">;
|
|
22
23
|
get clickOutside(): CSSProperty<false>;
|
|
23
24
|
get escape(): CSSProperty<false>;
|
|
@@ -25,11 +26,11 @@ export declare class PopoverElement extends HTMLElement {
|
|
|
25
26
|
get lastTrigger(): any;
|
|
26
27
|
get idWithValue(): string;
|
|
27
28
|
updateUrlValue(value?: string | number): void;
|
|
28
|
-
open
|
|
29
|
+
open(options?: {
|
|
29
30
|
skipTransition?: boolean;
|
|
30
31
|
trigger?: any;
|
|
31
|
-
})
|
|
32
|
-
close
|
|
32
|
+
}): void;
|
|
33
|
+
close(): void;
|
|
33
34
|
protected connectedCallback(): void;
|
|
34
35
|
protected disconnectedCallback(): void;
|
|
35
36
|
}
|
package/lib/popover/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var K=c=>{throw TypeError(c)};var D=(c,i,t)=>i.has(c)||K("Cannot "+t);var e=(c,i,t)=>(D(c,i,"read from private field"),t?t.call(c):i.get(c)),r=(c,i,t)=>i.has(c)?K("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(c):i.set(c,t),n=(c,i,t,s)=>(D(c,i,"write to private field"),s?s.call(c,t):i.set(c,t),t),B=(c,i,t)=>(D(c,i,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("../class-linked-status/index.cjs"),f=require("../css-property/index.cjs"),ee=require("../Store-DRp_K37w.cjs"),F=require("../index-Cqw2NKev.cjs"),G=require("../events-KVanG9sR.cjs"),te=require("../function-MthRj-GJ.cjs"),se=require("../style-At6aDoqG.cjs"),Q=require("../url-CLvdjbII.cjs"),X=require("../window-resizer/index.cjs");var l,v,U,j;class ie{constructor(){r(this,l,new Map);r(this,v,[]);r(this,U,i=>{var s;const t=[...e(this,v)].reverse().find(o=>o.clickOutside.current);if(t){const o=i.composedPath();if(o.find(J=>J instanceof HTMLElement&&J.hasAttribute("data-popover-content")))return;const a=o[0],R=a instanceof Node&&(t.contains(a)||((s=t.shadowRoot)==null?void 0:s.contains(a))),_=a instanceof HTMLElement&&a.hasAttribute("data-outside");(!R||_)&&t.close()}});r(this,j,i=>{if(i.code==="Escape"){const t=[...e(this,v)].reverse().find(s=>s.escape.current);t&&t.close()}});addEventListener("click",e(this,U)),addEventListener("keydown",e(this,j))}add(i,t){if(t.closeRest.current)e(this,l).forEach(o=>{o.forEach(a=>{a.close()})});else if(t.closeRestInGroup.current){let o=e(this,l).get(i);o==null||o.forEach(a=>{a.close()})}let s=e(this,l).get(i);s!=null&&s.length||(s=[],e(this,l).set(i,s)),e(this,v).push(t),s.push(t)}remove(i,t){if(n(this,v,e(this,v).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,l).forEach(o=>{o.forEach(a=>s.push(a))}),e(this,l).clear(),s.forEach(o=>o.close())}else if(t.closeRestInGroup.current){const s=e(this,l).get(i);e(this,l).delete(i),s==null||s.forEach(o=>{o.close()})}else{let s=e(this,l).get(i);s&&(s=s.filter(o=>o!==t),e(this,l).set(i,s))}}}l=new WeakMap,v=new WeakMap,U=new WeakMap,j=new WeakMap;var u,x,S,p,m,w,T,g,P,k,b,C,d,E,Y,W,A,q,V,M;const L=class L extends HTMLElement{constructor(){super();r(this,E);r(this,u);r(this,x);r(this,S);r(this,p);r(this,m);r(this,w);r(this,T);r(this,g);r(this,P);r(this,k);r(this,b);r(this,C);r(this,d);r(this,A);r(this,q);r(this,V);r(this,M);this.urlValue="",n(this,u,new ee.Store(!1)),n(this,p,new f.CSSProperty(this,"--history",!1)),n(this,m,new f.CSSProperty(this,"--restore",!1)),n(this,w,new f.CSSProperty(this,"--close-rest",!1)),n(this,T,new f.CSSProperty(this,"--close-rest-in-group",!1)),n(this,g,new f.CSSProperty(this,"--group","")),n(this,P,new f.CSSProperty(this,"--click-outside",!1)),n(this,k,new f.CSSProperty(this,"--escape",!1)),n(this,b,!1),n(this,d,new N.ClassLinkedStatus(this,{opened:!1,closing:!1,closed:!1,triggered:!1})),n(this,A,()=>{n(this,b,!1),e(this,u).current&&e(this,p).current&&!location.search.includes(this.id)?this.close():!e(this,u).current&&e(this,p).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),n(this,b,!0)}),n(this,q,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),e(this,V).call(this)}),n(this,V,te.debounce(()=>{e(this,M).call(this)},10)),n(this,M,()=>{this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px")}),e(this,g).subscribe(t=>{t.previous&&L.stack.remove(t.previous,this)})}get history(){return e(this,p)}get restore(){return e(this,m)}get closeRest(){return e(this,w)}get closeRestInGroup(){return e(this,T)}get group(){return e(this,g)}get clickOutside(){return e(this,P)}get escape(){return e(this,k)}get opened(){return e(this,u)}get lastTrigger(){return e(this,C)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,u).current&&Q.updateSearchParameter(this.id,t)}open(t){if(e(this,u).current)return;n(this,C,t==null?void 0:t.trigger),clearTimeout(e(this,x)),e(this,d).set("closing",!1),e(this,d).set("triggered",!0),G.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,C)}}),e(this,p).current&&e(this,b)&&history.pushState(history.state,"",e(this,E,Y)),e(this,u).current=!0;const s=()=>{L.stack.add(e(this,g).current,this),e(this,M).call(this),e(this,d).set("opened",!0),G.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,C)}}),n(this,S,void 0)};t!=null&&t.skipTransition?s():n(this,S,setTimeout(s,10))}close(){e(this,u).current&&(clearTimeout(e(this,S)),L.stack.remove(e(this,g).current,this),e(this,u).current=!1,B(this,E,W).call(this),e(this,d).set("opened",!1),e(this,d).set("closing",!0),G.dispatchEvent(this,"popoverClosing",{custom:!0}),n(this,x,setTimeout(()=>{e(this,d).set("triggered",!1),e(this,d).set("closing",!1),G.dispatchEvent(this,"popoverClosed",{custom:!0})},se.getElementTransitionDurationMS(this)+10)))}connectedCallback(){e(this,p).observe(),e(this,m).observe(),e(this,w).observe(),e(this,T).observe(),e(this,g).observe(),e(this,P).observe(),e(this,k).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,A)),setTimeout(()=>{e(this,m).current?(this.urlValue=Q.parseSearchParameters(location.search)[this.id],e(this,A).call(this)):(B(this,E,W).call(this),n(this,b,!0))},0),X.windowResizer.subscribe(e(this,q))}disconnectedCallback(){L.stack.remove(e(this,g).current,this),X.windowResizer.unsubscribe(e(this,q)),e(this,d).close(),e(this,p).close(),e(this,m).close(),e(this,w).close(),e(this,T).close(),e(this,g).close(),e(this,P).close(),e(this,k).close(),this.removeAttribute("role"),clearTimeout(e(this,x)),clearTimeout(e(this,S)),removeEventListener("popstate",e(this,A)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),B(this,E,W).call(this)}};u=new WeakMap,x=new WeakMap,S=new WeakMap,p=new WeakMap,m=new WeakMap,w=new WeakMap,T=new WeakMap,g=new WeakMap,P=new WeakMap,k=new WeakMap,b=new WeakMap,C=new WeakMap,d=new WeakMap,E=new WeakSet,Y=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},W=function(){if(e(this,p).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},A=new WeakMap,q=new WeakMap,V=new WeakMap,M=new WeakMap,L.stack=new ie;let O=L;F.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",O);var h,y,I,$,H,z;class Z extends HTMLElement{constructor(){super();r(this,h);r(this,y,new f.CSSProperty(this,"--type","open"));r(this,I,()=>{this.classList.add("triggered")});r(this,$,()=>{this.classList.add("opened"),this.setAttribute("aria-expanded","true")});r(this,H,()=>{this.classList.remove("opened")});r(this,z,()=>{this.classList.remove("triggered"),this.setAttribute("aria-expanded","false")});F.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,y).current;t==="open"||t==="toggle"&&!e(this,h).opened.current?e(this,h).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,h).opened.current)&&e(this,h).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&t.currentTarget.click()}))}get type(){return e(this,y)}get popoverElement(){return e(this,h)}connectedCallback(){var s;e(this,y).subscribe(o=>{e(this,h)instanceof O&&(o.current!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,h).opened.current?"true":"false"),this.setAttribute("aria-controls",e(this,h).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 a=this.closest("[popover-target]");if(a)o=a;else{const R=this.getRootNode();R instanceof ShadowRoot?o=R.host.closest("[popover-target]"):R instanceof HTMLElement&&(o=R.closest("[popover-target]"))}}else t==="sibling"?o=(s=this.parentElement)==null?void 0:s.querySelector("[popover-target]"):o=document.querySelector(`#${t}`)||this.getRootNode().querySelector(`#${t}`);o instanceof HTMLElement?(n(this,h,o),e(this,h).addEventListener("popoverTriggered",e(this,I)),e(this,h).addEventListener("popoverOpened",e(this,$)),e(this,h).addEventListener("popoverClosing",e(this,H)),e(this,h).addEventListener("popoverClosed",e(this,z))):console.warn(this,`target ${t} not found`)}this.isConnected&&e(this,y).observe()}disconnectedCallback(){e(this,y).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,I)),e(this,h).removeEventListener("popoverOpened",e(this,$)),e(this,h).removeEventListener("popoverClosing",e(this,H)),e(this,h).removeEventListener("popoverClosed",e(this,z)))}}h=new WeakMap,y=new WeakMap,I=new WeakMap,$=new WeakMap,H=new WeakMap,z=new WeakMap;F.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",Z);exports.PopoverButtonElement=Z;exports.PopoverElement=O;
|
package/lib/popover/index.js
CHANGED
|
@@ -1,174 +1,222 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var K = (c) => {
|
|
2
|
+
throw TypeError(c);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var e = (
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { d as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
var j = (c, i, t) => i.has(c) || K("Cannot " + t);
|
|
5
|
+
var e = (c, i, t) => (j(c, i, "read from private field"), t ? t.call(c) : i.get(c)), r = (c, i, t) => i.has(c) ? K("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(c) : i.set(c, t), h = (c, i, t, s) => (j(c, i, "write to private field"), s ? s.call(c, t) : i.set(c, t), t), z = (c, i, t) => (j(c, i, "access private method"), t);
|
|
6
|
+
import { ClassLinkedStatus as Z } from "../class-linked-status/index.js";
|
|
7
|
+
import { CSSProperty as g } from "../css-property/index.js";
|
|
8
|
+
import { S as N } from "../Store-D2xCXENW.js";
|
|
9
|
+
import { i as F } from "../index-euf5anj6.js";
|
|
10
|
+
import { d as W } from "../events-CsVF98U6.js";
|
|
11
|
+
import { d as _ } from "../function-C10DGppn.js";
|
|
12
|
+
import { g as ee } from "../style-j2TwriJ_.js";
|
|
13
|
+
import { u as te, p as se } from "../url-CfcHdBT6.js";
|
|
14
|
+
import { windowResizer as Q } from "../window-resizer/index.js";
|
|
15
|
+
var l, v, U, D;
|
|
16
|
+
class ie {
|
|
16
17
|
constructor() {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
s(this, f);
|
|
25
|
-
s(this, m);
|
|
26
|
-
s(this, g);
|
|
27
|
-
s(this, y);
|
|
28
|
-
s(this, L);
|
|
29
|
-
s(this, b);
|
|
30
|
-
s(this, A);
|
|
31
|
-
s(this, k);
|
|
32
|
-
s(this, C);
|
|
33
|
-
s(this, S);
|
|
34
|
-
s(this, x);
|
|
35
|
-
s(this, O);
|
|
36
|
-
s(this, P);
|
|
37
|
-
this.urlValue = "", i(this, u, -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, m, 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
|
-
if (e(this, d).current)
|
|
39
|
-
return;
|
|
40
|
-
i(this, A, t == null ? void 0 : t.trigger), e(this, m).current && (a.__openedElements = a.__openedElements.filter(
|
|
41
|
-
(n) => n !== this && v(this, c, U).call(this, this, n) ? (n.close(), !1) : !0
|
|
42
|
-
)), a.__openedElements.push(this), i(this, u, ++a.__openedCounter), this.style.setProperty("--open-index", e(this, u).toString()), clearTimeout(e(this, V)), this.classList.remove("closing"), this.classList.add("triggered"), this.style.display = "block", z(this, "popoverTriggered", {
|
|
43
|
-
custom: !0,
|
|
44
|
-
detail: {
|
|
45
|
-
trigger: e(this, A)
|
|
46
|
-
}
|
|
47
|
-
}), e(this, p).current && e(this, b) && history.pushState(history.state, "", e(this, c, Q)), e(this, d).current = !0;
|
|
48
|
-
const o = () => {
|
|
49
|
-
addEventListener("click", e(this, k)), addEventListener("keydown", e(this, C)), e(this, P).call(this), this.style.opacity = "1", this.classList.add("opened"), z(this, "popoverOpened", {
|
|
50
|
-
custom: !0,
|
|
51
|
-
detail: {
|
|
52
|
-
trigger: e(this, A)
|
|
53
|
-
}
|
|
54
|
-
}), i(this, w, void 0), this.setAttribute("aria-hidden", "false");
|
|
55
|
-
};
|
|
56
|
-
t != null && t.skipTransition ? o() : i(this, w, setTimeout(o, 10));
|
|
57
|
-
}, this.close = () => {
|
|
58
|
-
e(this, d).current && (removeEventListener("click", e(this, k)), removeEventListener("keydown", e(this, C)), e(this, d).current = !1, a.__openedElements = a.__openedElements.filter(
|
|
59
|
-
(t) => t === this ? !1 : !e(t, w) && v(this, c, U).call(this, this, t) ? (t.close(), !1) : !0
|
|
60
|
-
), v(this, c, N).call(this), this.classList.remove("opened"), this.classList.add("closing"), this.setAttribute("aria-hidden", "true"), this.style.opacity = "0", z(this, "popoverClosing", {
|
|
61
|
-
custom: !0
|
|
62
|
-
}), setTimeout(() => {
|
|
63
|
-
this.classList.remove("triggered"), this.classList.remove("closing"), this.style.display = "none", this.style.removeProperty("--open-index"), a.__openedCounter--, i(this, u, -1), z(this, "popoverClosed", {
|
|
64
|
-
custom: !0
|
|
65
|
-
});
|
|
66
|
-
}, Z(this) + 10));
|
|
67
|
-
}, i(this, k, (t) => {
|
|
68
|
-
!e(this, y).current || !e(this, c, B) || v(this, c, D).call(this, () => {
|
|
69
|
-
var F;
|
|
70
|
-
const o = t.composedPath();
|
|
18
|
+
r(this, l, /* @__PURE__ */ new Map());
|
|
19
|
+
r(this, v, []);
|
|
20
|
+
r(this, U, (i) => {
|
|
21
|
+
var s;
|
|
22
|
+
const t = [...e(this, v)].reverse().find((o) => o.clickOutside.current);
|
|
23
|
+
if (t) {
|
|
24
|
+
const o = i.composedPath();
|
|
71
25
|
if (o.find(
|
|
72
|
-
(
|
|
26
|
+
(J) => J instanceof HTMLElement && J.hasAttribute("data-popover-content")
|
|
73
27
|
))
|
|
74
28
|
return;
|
|
75
|
-
const
|
|
76
|
-
(!
|
|
29
|
+
const a = o[0], P = a instanceof Node && (t.contains(a) || ((s = t.shadowRoot) == null ? void 0 : s.contains(a))), Y = a instanceof HTMLElement && a.hasAttribute("data-outside");
|
|
30
|
+
(!P || Y) && t.close();
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
r(this, D, (i) => {
|
|
34
|
+
if (i.code === "Escape") {
|
|
35
|
+
const t = [...e(this, v)].reverse().find((s) => s.escape.current);
|
|
36
|
+
t && t.close();
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
addEventListener("click", e(this, U)), addEventListener("keydown", e(this, D));
|
|
40
|
+
}
|
|
41
|
+
add(i, t) {
|
|
42
|
+
if (t.closeRest.current)
|
|
43
|
+
e(this, l).forEach((o) => {
|
|
44
|
+
o.forEach((a) => {
|
|
45
|
+
a.close();
|
|
46
|
+
});
|
|
77
47
|
});
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
48
|
+
else if (t.closeRestInGroup.current) {
|
|
49
|
+
let o = e(this, l).get(i);
|
|
50
|
+
o == null || o.forEach((a) => {
|
|
51
|
+
a.close();
|
|
81
52
|
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
53
|
+
}
|
|
54
|
+
let s = e(this, l).get(i);
|
|
55
|
+
s != null && s.length || (s = [], e(this, l).set(i, s)), e(this, v).push(t), s.push(t);
|
|
56
|
+
}
|
|
57
|
+
remove(i, t) {
|
|
58
|
+
if (h(this, v, e(this, v).filter((s) => s !== t)), t.closeRest.current) {
|
|
59
|
+
let s = [];
|
|
60
|
+
e(this, l).forEach((o) => {
|
|
61
|
+
o.forEach((a) => s.push(a));
|
|
62
|
+
}), e(this, l).clear(), s.forEach((o) => o.close());
|
|
63
|
+
} else if (t.closeRestInGroup.current) {
|
|
64
|
+
const s = e(this, l).get(i);
|
|
65
|
+
e(this, l).delete(i), s == null || s.forEach((o) => {
|
|
66
|
+
o.close();
|
|
67
|
+
});
|
|
68
|
+
} else {
|
|
69
|
+
let s = e(this, l).get(i);
|
|
70
|
+
s && (s = s.filter((o) => o !== t), e(this, l).set(i, s));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
l = new WeakMap(), v = new WeakMap(), U = new WeakMap(), D = new WeakMap();
|
|
75
|
+
var u, x, T, d, m, w, k, f, A, S, b, C, p, L, X, q, R, V, M, I;
|
|
76
|
+
const y = class y extends HTMLElement {
|
|
77
|
+
constructor() {
|
|
78
|
+
super();
|
|
79
|
+
r(this, L);
|
|
80
|
+
r(this, u);
|
|
81
|
+
r(this, x);
|
|
82
|
+
r(this, T);
|
|
83
|
+
r(this, d);
|
|
84
|
+
r(this, m);
|
|
85
|
+
r(this, w);
|
|
86
|
+
r(this, k);
|
|
87
|
+
r(this, f);
|
|
88
|
+
r(this, A);
|
|
89
|
+
r(this, S);
|
|
90
|
+
r(this, b);
|
|
91
|
+
r(this, C);
|
|
92
|
+
r(this, p);
|
|
93
|
+
r(this, R);
|
|
94
|
+
r(this, V);
|
|
95
|
+
r(this, M);
|
|
96
|
+
r(this, I);
|
|
97
|
+
this.urlValue = "", h(this, u, new N(!1)), h(this, d, new g(this, "--history", !1)), h(this, m, new g(this, "--restore", !1)), h(this, w, new g(this, "--close-rest", !1)), h(this, k, new g(
|
|
98
|
+
this,
|
|
99
|
+
"--close-rest-in-group",
|
|
100
|
+
!1
|
|
101
|
+
)), h(this, f, new g(this, "--group", "")), h(this, A, new g(this, "--click-outside", !1)), h(this, S, new g(this, "--escape", !1)), h(this, b, !1), h(this, p, new Z(this, {
|
|
102
|
+
opened: !1,
|
|
103
|
+
closing: !1,
|
|
104
|
+
closed: !1,
|
|
105
|
+
triggered: !1
|
|
106
|
+
})), h(this, R, () => {
|
|
107
|
+
h(this, b, !1), e(this, u).current && e(this, d).current && !location.search.includes(this.id) ? this.close() : !e(this, u).current && e(this, d).current && location.search.includes(this.id) && this.open({ trigger: this.idWithValue }), h(this, b, !0);
|
|
108
|
+
}), h(this, V, () => {
|
|
109
|
+
this.style.setProperty("--content-width", "initial"), this.style.setProperty("--content-height", "initial"), e(this, M).call(this);
|
|
110
|
+
}), h(this, M, _(() => {
|
|
111
|
+
e(this, I).call(this);
|
|
112
|
+
}, 10)), h(this, I, () => {
|
|
89
113
|
this.style.setProperty("--content-width", this.scrollWidth + "px"), this.style.setProperty("--content-height", this.scrollHeight + "px");
|
|
114
|
+
}), e(this, f).subscribe((t) => {
|
|
115
|
+
t.previous && y.stack.remove(t.previous, this);
|
|
90
116
|
});
|
|
91
117
|
}
|
|
92
118
|
get history() {
|
|
93
|
-
return e(this,
|
|
119
|
+
return e(this, d);
|
|
94
120
|
}
|
|
95
121
|
get restore() {
|
|
96
|
-
return e(this, f);
|
|
97
|
-
}
|
|
98
|
-
get dominance() {
|
|
99
122
|
return e(this, m);
|
|
100
123
|
}
|
|
124
|
+
get closeRest() {
|
|
125
|
+
return e(this, w);
|
|
126
|
+
}
|
|
127
|
+
get closeRestInGroup() {
|
|
128
|
+
return e(this, k);
|
|
129
|
+
}
|
|
101
130
|
get group() {
|
|
102
|
-
return e(this,
|
|
131
|
+
return e(this, f);
|
|
103
132
|
}
|
|
104
133
|
get clickOutside() {
|
|
105
|
-
return e(this,
|
|
134
|
+
return e(this, A);
|
|
106
135
|
}
|
|
107
136
|
get escape() {
|
|
108
|
-
return e(this,
|
|
137
|
+
return e(this, S);
|
|
109
138
|
}
|
|
110
139
|
get opened() {
|
|
111
|
-
return e(this,
|
|
140
|
+
return e(this, u);
|
|
112
141
|
}
|
|
113
142
|
get lastTrigger() {
|
|
114
|
-
return e(this,
|
|
143
|
+
return e(this, C);
|
|
115
144
|
}
|
|
116
145
|
get idWithValue() {
|
|
117
146
|
return `${this.id}${this.urlValue ? "=" + this.urlValue : ""}`;
|
|
118
147
|
}
|
|
119
148
|
updateUrlValue(t) {
|
|
120
|
-
this.urlValue = (t == null ? void 0 : t.toString()) || "", e(this,
|
|
149
|
+
this.urlValue = (t == null ? void 0 : t.toString()) || "", e(this, u).current && te(this.id, t);
|
|
150
|
+
}
|
|
151
|
+
open(t) {
|
|
152
|
+
if (e(this, u).current)
|
|
153
|
+
return;
|
|
154
|
+
h(this, C, t == null ? void 0 : t.trigger), clearTimeout(e(this, x)), e(this, p).set("closing", !1), e(this, p).set("triggered", !0), W(this, "popoverTriggered", {
|
|
155
|
+
custom: !0,
|
|
156
|
+
detail: {
|
|
157
|
+
trigger: e(this, C)
|
|
158
|
+
}
|
|
159
|
+
}), e(this, d).current && e(this, b) && history.pushState(history.state, "", e(this, L, X)), e(this, u).current = !0;
|
|
160
|
+
const s = () => {
|
|
161
|
+
y.stack.add(e(this, f).current, this), e(this, I).call(this), e(this, p).set("opened", !0), W(this, "popoverOpened", {
|
|
162
|
+
custom: !0,
|
|
163
|
+
detail: {
|
|
164
|
+
trigger: e(this, C)
|
|
165
|
+
}
|
|
166
|
+
}), h(this, T, void 0);
|
|
167
|
+
};
|
|
168
|
+
t != null && t.skipTransition ? s() : h(this, T, setTimeout(s, 10));
|
|
169
|
+
}
|
|
170
|
+
close() {
|
|
171
|
+
e(this, u).current && (clearTimeout(e(this, T)), y.stack.remove(e(this, f).current, this), e(this, u).current = !1, z(this, L, q).call(this), e(this, p).set("opened", !1), e(this, p).set("closing", !0), W(this, "popoverClosing", {
|
|
172
|
+
custom: !0
|
|
173
|
+
}), h(this, x, setTimeout(() => {
|
|
174
|
+
e(this, p).set("triggered", !1), e(this, p).set("closing", !1), W(this, "popoverClosed", {
|
|
175
|
+
custom: !0
|
|
176
|
+
});
|
|
177
|
+
}, ee(this) + 10)));
|
|
121
178
|
}
|
|
122
179
|
connectedCallback() {
|
|
123
|
-
e(this,
|
|
124
|
-
e(this,
|
|
125
|
-
}, 0),
|
|
180
|
+
e(this, d).observe(), e(this, m).observe(), e(this, w).observe(), e(this, k).observe(), e(this, f).observe(), e(this, A).observe(), e(this, S).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", e(this, R)), setTimeout(() => {
|
|
181
|
+
e(this, m).current ? (this.urlValue = se(location.search)[this.id], e(this, R).call(this)) : (z(this, L, q).call(this), h(this, b, !0));
|
|
182
|
+
}, 0), Q.subscribe(e(this, V));
|
|
126
183
|
}
|
|
127
184
|
disconnectedCallback() {
|
|
128
|
-
|
|
129
|
-
(t) => t !== this
|
|
130
|
-
), a.__openedCounter--, clearTimeout(e(this, V)), clearTimeout(e(this, w)), removeEventListener("popstate", e(this, S)), removeEventListener("click", e(this, k)), removeEventListener("keydown", e(this, C)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), v(this, c, N).call(this);
|
|
185
|
+
y.stack.remove(e(this, f).current, this), Q.unsubscribe(e(this, V)), e(this, p).close(), e(this, d).close(), e(this, m).close(), e(this, w).close(), e(this, k).close(), e(this, f).close(), e(this, A).close(), e(this, S).close(), this.removeAttribute("role"), clearTimeout(e(this, x)), clearTimeout(e(this, T)), removeEventListener("popstate", e(this, R)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), z(this, L, q).call(this);
|
|
131
186
|
}
|
|
132
187
|
};
|
|
133
|
-
u = new WeakMap(),
|
|
188
|
+
u = new WeakMap(), x = new WeakMap(), T = new WeakMap(), d = new WeakMap(), m = new WeakMap(), w = new WeakMap(), k = new WeakMap(), f = new WeakMap(), A = new WeakMap(), S = new WeakMap(), b = new WeakMap(), C = new WeakMap(), p = new WeakMap(), L = new WeakSet(), X = function() {
|
|
134
189
|
return `${location.pathname}${location.search ? location.search + "&" : "?"}${this.idWithValue}`;
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
}, k = new WeakMap(), N = function() {
|
|
138
|
-
if (e(this, p).current) {
|
|
190
|
+
}, q = function() {
|
|
191
|
+
if (e(this, d).current) {
|
|
139
192
|
const t = new URL(location.href);
|
|
140
193
|
t.searchParams.delete(this.id), history.replaceState(history.state, "", t.href);
|
|
141
194
|
}
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}, a.__openedElements = [], a.__openedCounter = 0;
|
|
148
|
-
let W = a;
|
|
149
|
-
j && !customElements.get("e-popover") && customElements.define("e-popover", W);
|
|
150
|
-
var r, E, $, H, M, R;
|
|
151
|
-
class se extends HTMLElement {
|
|
195
|
+
}, R = new WeakMap(), V = new WeakMap(), M = new WeakMap(), I = new WeakMap(), y.stack = new ie();
|
|
196
|
+
let B = y;
|
|
197
|
+
F && !customElements.get("e-popover") && customElements.define("e-popover", B);
|
|
198
|
+
var n, E, O, $, H, G;
|
|
199
|
+
class re extends HTMLElement {
|
|
152
200
|
constructor() {
|
|
153
201
|
super();
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
202
|
+
r(this, n);
|
|
203
|
+
r(this, E, new g(this, "--type", "open"));
|
|
204
|
+
r(this, O, () => {
|
|
157
205
|
this.classList.add("triggered");
|
|
158
206
|
});
|
|
159
|
-
|
|
207
|
+
r(this, $, () => {
|
|
160
208
|
this.classList.add("opened"), this.setAttribute("aria-expanded", "true");
|
|
161
209
|
});
|
|
162
|
-
|
|
210
|
+
r(this, H, () => {
|
|
163
211
|
this.classList.remove("opened");
|
|
164
212
|
});
|
|
165
|
-
|
|
213
|
+
r(this, G, () => {
|
|
166
214
|
this.classList.remove("triggered"), this.setAttribute("aria-expanded", "false");
|
|
167
215
|
});
|
|
168
|
-
|
|
169
|
-
if (e(this,
|
|
216
|
+
F && (this.addEventListener("click", () => {
|
|
217
|
+
if (e(this, n)) {
|
|
170
218
|
const t = e(this, E).current;
|
|
171
|
-
t === "open" || t === "toggle" && !e(this,
|
|
219
|
+
t === "open" || t === "toggle" && !e(this, n).opened.current ? e(this, n).open({ trigger: this }) : (t === "close" || t === "toggle" && e(this, n).opened.current) && e(this, n).close();
|
|
172
220
|
}
|
|
173
221
|
}), this.addEventListener("keydown", (t) => {
|
|
174
222
|
t.code === "Space" && t.currentTarget.click();
|
|
@@ -178,63 +226,63 @@ class se extends HTMLElement {
|
|
|
178
226
|
return e(this, E);
|
|
179
227
|
}
|
|
180
228
|
get popoverElement() {
|
|
181
|
-
return e(this,
|
|
229
|
+
return e(this, n);
|
|
182
230
|
}
|
|
183
231
|
connectedCallback() {
|
|
184
|
-
var
|
|
185
|
-
e(this, E).subscribe((
|
|
186
|
-
e(this,
|
|
232
|
+
var s;
|
|
233
|
+
e(this, E).subscribe((o) => {
|
|
234
|
+
e(this, n) instanceof B && (o.current !== "close" ? (this.setAttribute("aria-haspopup", "true"), this.setAttribute(
|
|
187
235
|
"aria-expanded",
|
|
188
|
-
e(this,
|
|
189
|
-
), this.setAttribute("aria-controls", e(this,
|
|
236
|
+
e(this, n).opened.current ? "true" : "false"
|
|
237
|
+
), this.setAttribute("aria-controls", e(this, n).id || "")) : (this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls")));
|
|
190
238
|
}), this.hasAttribute("tabindex") || (this.tabIndex = 0);
|
|
191
239
|
const t = this.getAttribute("target");
|
|
192
240
|
if (t) {
|
|
193
|
-
let
|
|
241
|
+
let o = null;
|
|
194
242
|
if (t === "parent") {
|
|
195
|
-
const
|
|
196
|
-
if (
|
|
197
|
-
|
|
243
|
+
const a = this.closest("[popover-target]");
|
|
244
|
+
if (a)
|
|
245
|
+
o = a;
|
|
198
246
|
else {
|
|
199
|
-
const
|
|
200
|
-
|
|
247
|
+
const P = this.getRootNode();
|
|
248
|
+
P instanceof ShadowRoot ? o = P.host.closest("[popover-target]") : P instanceof HTMLElement && (o = P.closest("[popover-target]"));
|
|
201
249
|
}
|
|
202
|
-
} else t === "sibling" ?
|
|
203
|
-
|
|
250
|
+
} else t === "sibling" ? o = (s = this.parentElement) == null ? void 0 : s.querySelector("[popover-target]") : o = document.querySelector(`#${t}`) || this.getRootNode().querySelector(`#${t}`);
|
|
251
|
+
o instanceof HTMLElement ? (h(this, n, o), e(this, n).addEventListener(
|
|
204
252
|
"popoverTriggered",
|
|
205
|
-
e(this,
|
|
206
|
-
), e(this,
|
|
253
|
+
e(this, O)
|
|
254
|
+
), e(this, n).addEventListener(
|
|
207
255
|
"popoverOpened",
|
|
208
|
-
e(this,
|
|
209
|
-
), e(this,
|
|
256
|
+
e(this, $)
|
|
257
|
+
), e(this, n).addEventListener(
|
|
210
258
|
"popoverClosing",
|
|
211
|
-
e(this,
|
|
212
|
-
), e(this,
|
|
259
|
+
e(this, H)
|
|
260
|
+
), e(this, n).addEventListener(
|
|
213
261
|
"popoverClosed",
|
|
214
|
-
e(this,
|
|
262
|
+
e(this, G)
|
|
215
263
|
)) : console.warn(this, `target ${t} not found`);
|
|
216
264
|
}
|
|
217
265
|
this.isConnected && e(this, E).observe();
|
|
218
266
|
}
|
|
219
267
|
disconnectedCallback() {
|
|
220
|
-
e(this, E).unobserve(), this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), e(this,
|
|
268
|
+
e(this, E).unobserve(), this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), e(this, n) && (e(this, n).removeEventListener(
|
|
221
269
|
"popoverTriggered",
|
|
222
|
-
e(this,
|
|
223
|
-
), e(this,
|
|
270
|
+
e(this, O)
|
|
271
|
+
), e(this, n).removeEventListener(
|
|
224
272
|
"popoverOpened",
|
|
225
|
-
e(this,
|
|
226
|
-
), e(this,
|
|
273
|
+
e(this, $)
|
|
274
|
+
), e(this, n).removeEventListener(
|
|
227
275
|
"popoverClosing",
|
|
228
|
-
e(this,
|
|
229
|
-
), e(this,
|
|
276
|
+
e(this, H)
|
|
277
|
+
), e(this, n).removeEventListener(
|
|
230
278
|
"popoverClosed",
|
|
231
|
-
e(this,
|
|
279
|
+
e(this, G)
|
|
232
280
|
));
|
|
233
281
|
}
|
|
234
282
|
}
|
|
235
|
-
|
|
236
|
-
|
|
283
|
+
n = new WeakMap(), E = new WeakMap(), O = new WeakMap(), $ = new WeakMap(), H = new WeakMap(), G = new WeakMap();
|
|
284
|
+
F && !customElements.get("e-popover-button") && customElements.define("e-popover-button", re);
|
|
237
285
|
export {
|
|
238
|
-
|
|
239
|
-
|
|
286
|
+
re as PopoverButtonElement,
|
|
287
|
+
B as PopoverElement
|
|
240
288
|
};
|