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.
@@ -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),p=(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(`
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,a,h;class f extends HTMLElement{constructor(){super();r(this,o,null);r(this,n,null);r(this,c);r(this,a,()=>{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,h,()=>{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=`
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
- `,p(this,c,e.querySelector("input")),i(this,c).addEventListener("input",i(this,h))}connectedCallback(){var l,d;p(this,o,g.findScrollParentElement(this)),(l=i(this,o))==null||l.addEventListener("scroll",i(this,a));const e=(d=this.shadowRoot.querySelector("slot"))==null?void 0:d.assignedElements()[0];if(e instanceof HTMLElement){p(this,n,e);const m=i(this,n).querySelector("img");m&&(m.style.cssText=`
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,h).call(this)}disconnectedCallback(){var e;(e=i(this,o))==null||e.removeEventListener("scroll",i(this,a))}}o=new WeakMap,n=new WeakMap,c=new WeakMap,a=new WeakMap,h=new WeakMap;customElements.get("e-pixel-perfect")||customElements.define("e-pixel-perfect",f);exports.PixelPerfectElement=f;
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), p = (e, s, t, l) => (f(e, s, "write to private field"), l ? l.call(e, t) : s.set(e, t), 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, a, h;
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, a, () => {
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, h, () => {
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
- `, p(this, r, t.querySelector("input")), i(this, r).addEventListener("input", i(this, h));
80
+ `, a(this, r, t.querySelector("input")), i(this, r).addEventListener("input", i(this, p));
81
81
  }
82
82
  connectedCallback() {
83
- var l, d;
84
- p(this, o, y(this)), (l = i(this, o)) == null || l.addEventListener("scroll", i(this, a));
85
- const t = (d = this.shadowRoot.querySelector("slot")) == null ? void 0 : d.assignedElements()[0];
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
- p(this, n, t);
88
- const m = i(this, n).querySelector("img");
89
- m && (m.style.cssText = `
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, h).call(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, a)
102
+ i(this, h)
103
103
  );
104
104
  }
105
105
  }
106
- o = new WeakMap(), n = new WeakMap(), r = new WeakMap(), a = new WeakMap(), h = 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 __openedElements;
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 dominance(): CSSProperty<number>;
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: (options?: {
29
+ open(options?: {
29
30
  skipTransition?: boolean;
30
31
  trigger?: any;
31
- }) => void;
32
- close: () => void;
32
+ }): void;
33
+ close(): void;
33
34
  protected connectedCallback(): void;
34
35
  protected disconnectedCallback(): void;
35
36
  }
@@ -1 +1 @@
1
- "use strict";var J=h=>{throw TypeError(h)};var N=(h,l,t)=>l.has(h)||J("Cannot "+t);var e=(h,l,t)=>(N(h,l,"read from private field"),t?t.call(h):l.get(h)),s=(h,l,t)=>l.has(h)?J("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(h):l.set(h,t),i=(h,l,t,o)=>(N(h,l,"write to private field"),o?o.call(h,t):l.set(h,t),t),v=(h,l,t)=>(N(h,l,"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 p,d,O,w,u,f,g,m,y,E,L,T,a,X,W,C,I,A,D,P,_,R,x,U;const c=class c extends HTMLElement{constructor(){super(...arguments);s(this,a);s(this,p);s(this,d);s(this,O);s(this,w);s(this,u);s(this,f);s(this,g);s(this,m);s(this,y);s(this,E);s(this,L);s(this,T);s(this,C);s(this,A);s(this,P);s(this,_);s(this,R);s(this,x);this.urlValue="",i(this,p,-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,g,new S.CSSProperty(this,"--dominance",0)),i(this,m,new S.CSSProperty(this,"--group","")),i(this,y,new S.CSSProperty(this,"--click-outside",!1)),i(this,E,new S.CSSProperty(this,"--escape",!1)),i(this,L,!1),this.open=t=>{if(e(this,d).current)return;i(this,T,t==null?void 0:t.trigger),e(this,g).current&&(c.__openedElements=c.__openedElements.filter(n=>n!==this&&v(this,a,U).call(this,this,n)?(n.close(),!1):!0)),c.__openedElements.push(this),i(this,p,++c.__openedCounter),this.style.setProperty("--open-index",e(this,p).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,L)&&history.pushState(history.state,"",e(this,a,X)),e(this,d).current=!0;const o=()=>{addEventListener("click",e(this,C)),addEventListener("keydown",e(this,A)),e(this,x).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?o():i(this,w,setTimeout(o,10))},this.close=()=>{e(this,d).current&&(removeEventListener("click",e(this,C)),removeEventListener("keydown",e(this,A)),e(this,d).current=!1,c.__openedElements=c.__openedElements.filter(t=>t===this?!1:!e(t,w)&&v(this,a,U).call(this,this,t)?(t.close(),!1):!0),v(this,a,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"),c.__openedCounter--,i(this,p,-1),B.dispatchEvent(this,"popoverClosed",{custom:!0})},te.getElementTransitionDurationMS(this)+10))},i(this,C,t=>{!e(this,y).current||!e(this,a,W)||v(this,a,D).call(this,()=>{var F;const o=t.composedPath();if(o.find(G=>G instanceof HTMLElement&&G.hasAttribute("data-popover-content")))return;const n=o[0],z=n instanceof Node&&(this.contains(n)||((F=this.shadowRoot)==null?void 0:F.contains(n))),k=n instanceof HTMLElement&&n.hasAttribute("data-outside");(!z||k)&&this.close()})}),i(this,A,t=>{!e(this,E).current||!e(this,a,W)||v(this,a,D).call(this,()=>{t.code==="Escape"&&this.close()})}),i(this,P,()=>{i(this,L,!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,L,!0)}),i(this,_,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),e(this,R).call(this)}),i(this,R,ee.debounce(()=>{e(this,x).call(this)},10)),i(this,x,()=>{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,g)}get group(){return e(this,m)}get clickOutside(){return e(this,y)}get escape(){return e(this,E)}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,g).observe(),e(this,m).observe(),e(this,y).observe(),e(this,E).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,P)),setTimeout(()=>{e(this,f).current?(this.urlValue=K.parseSearchParameters(location.search)[this.id],e(this,P).call(this)):(v(this,a,I).call(this),i(this,L,!0))},0),Q.windowResizer.subscribe(e(this,_))}disconnectedCallback(){Q.windowResizer.unsubscribe(e(this,_)),e(this,u).close(),e(this,f).close(),e(this,g).close(),e(this,m).close(),e(this,y).close(),e(this,E).close(),this.style.opacity="",this.style.display="",this.removeAttribute("role"),this.removeAttribute("aria-hidden"),c.__openedElements=c.__openedElements.filter(t=>t!==this),c.__openedCounter--,clearTimeout(e(this,O)),clearTimeout(e(this,w)),removeEventListener("popstate",e(this,P)),removeEventListener("click",e(this,C)),removeEventListener("keydown",e(this,A)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),v(this,a,I).call(this)}};p=new WeakMap,d=new WeakMap,O=new WeakMap,w=new WeakMap,u=new WeakMap,f=new WeakMap,g=new WeakMap,m=new WeakMap,y=new WeakMap,E=new WeakMap,L=new WeakMap,T=new WeakMap,a=new WeakSet,X=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},W=function(){return e(this,p)===c.__openedCounter},C=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){(c.__openedElements[e(this,p)-1]||c.__openedElements.length===1||c.__openedElements.filter(o=>o!==this).every(o=>e(this,g).current>o.dominance.current))&&t()},P=new WeakMap,_=new WeakMap,R=new WeakMap,x=new WeakMap,U=function(t,o){if(e(t,m).current===e(o,m).current&&t.dominance.current!==-1&&o.dominance.current!==-1&&t.dominance.current>=o.dominance.current)return!0},c.__openedElements=[],c.__openedCounter=0;let q=c;j.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",q);var r,b,V,M,$,H;class Y extends HTMLElement{constructor(){super();s(this,r);s(this,b,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,b).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,b)}get popoverElement(){return e(this,r)}connectedCallback(){var o;e(this,b).subscribe(n=>{e(this,r)instanceof q&&(n.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 n=null;if(t==="parent"){const z=this.closest("[popover-target]");if(z)n=z;else{const k=this.getRootNode();k instanceof ShadowRoot?n=k.host.closest("[popover-target]"):k instanceof HTMLElement&&(n=k.closest("[popover-target]"))}}else t==="sibling"?n=(o=this.parentElement)==null?void 0:o.querySelector("[popover-target]"):n=document.querySelector(`#${t}`)||this.getRootNode().querySelector(`#${t}`);n instanceof HTMLElement?(i(this,r,n),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,b).observe()}disconnectedCallback(){e(this,b).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,b=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;
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;
@@ -1,174 +1,222 @@
1
- var J = (h) => {
2
- throw TypeError(h);
1
+ var K = (c) => {
2
+ throw TypeError(c);
3
3
  };
4
- var q = (h, l, t) => l.has(h) || J("Cannot " + t);
5
- var e = (h, l, t) => (q(h, l, "read from private field"), t ? t.call(h) : l.get(h)), s = (h, l, t) => l.has(h) ? J("Cannot add the same private member more than once") : l instanceof WeakSet ? l.add(h) : l.set(h, t), i = (h, l, t, o) => (q(h, l, "write to private field"), o ? o.call(h, t) : l.set(h, t), t), v = (h, l, t) => (q(h, l, "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
- import { d as z } from "../events-CsVF98U6.js";
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 u, d, V, w, p, f, m, g, y, L, b, A, c, Q, B, k, N, C, D, S, x, O, P, U;
15
- const a = class a extends HTMLElement {
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
- super(...arguments);
18
- s(this, c);
19
- s(this, u);
20
- s(this, d);
21
- s(this, V);
22
- s(this, w);
23
- s(this, p);
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
- (G) => G instanceof HTMLElement && G.hasAttribute("data-popover-content")
26
+ (J) => J instanceof HTMLElement && J.hasAttribute("data-popover-content")
73
27
  ))
74
28
  return;
75
- const n = o[0], I = n instanceof Node && (this.contains(n) || ((F = this.shadowRoot) == null ? void 0 : F.contains(n))), _ = n instanceof HTMLElement && n.hasAttribute("data-outside");
76
- (!I || _) && this.close();
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
- }), i(this, C, (t) => {
79
- !e(this, L).current || !e(this, c, B) || v(this, c, D).call(this, () => {
80
- t.code === "Escape" && this.close();
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
- }), i(this, S, () => {
83
- 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);
84
- }), i(this, x, () => {
85
- this.style.setProperty("--content-width", "initial"), this.style.setProperty("--content-height", "initial"), e(this, O).call(this);
86
- }), i(this, O, Y(() => {
87
- e(this, P).call(this);
88
- }, 10)), i(this, P, () => {
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, p);
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, g);
131
+ return e(this, f);
103
132
  }
104
133
  get clickOutside() {
105
- return e(this, y);
134
+ return e(this, A);
106
135
  }
107
136
  get escape() {
108
- return e(this, L);
137
+ return e(this, S);
109
138
  }
110
139
  get opened() {
111
- return e(this, d);
140
+ return e(this, u);
112
141
  }
113
142
  get lastTrigger() {
114
- return e(this, A);
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, d).current && ee(this.id, t);
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, p).observe(), e(this, f).observe(), e(this, m).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, S)), setTimeout(() => {
124
- e(this, f).current ? (this.urlValue = te(location.search)[this.id], e(this, S).call(this)) : (v(this, c, N).call(this), i(this, b, !0));
125
- }, 0), K.subscribe(e(this, x));
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
- K.unsubscribe(e(this, x)), e(this, p).close(), e(this, f).close(), e(this, m).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"), a.__openedElements = a.__openedElements.filter(
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(), d = new WeakMap(), V = new WeakMap(), w = new WeakMap(), p = new WeakMap(), f = new WeakMap(), m = new WeakMap(), g = new WeakMap(), y = new WeakMap(), L = new WeakMap(), b = new WeakMap(), A = new WeakMap(), c = new WeakSet(), Q = function() {
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
- }, B = function() {
136
- return e(this, u) === a.__openedCounter;
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
- }, C = new WeakMap(), D = function(t) {
143
- (a.__openedElements[e(this, u) - 1] || a.__openedElements.length === 1 || a.__openedElements.filter((o) => o !== this).every((o) => e(this, m).current > o.dominance.current)) && t();
144
- }, S = new WeakMap(), x = new WeakMap(), O = new WeakMap(), P = new WeakMap(), U = function(t, o) {
145
- if (e(t, g).current === e(o, g).current && t.dominance.current !== -1 && o.dominance.current !== -1 && t.dominance.current >= o.dominance.current)
146
- return !0;
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
- s(this, r);
155
- s(this, E, new T(this, "--type", "open"));
156
- s(this, $, () => {
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
- s(this, H, () => {
207
+ r(this, $, () => {
160
208
  this.classList.add("opened"), this.setAttribute("aria-expanded", "true");
161
209
  });
162
- s(this, M, () => {
210
+ r(this, H, () => {
163
211
  this.classList.remove("opened");
164
212
  });
165
- s(this, R, () => {
213
+ r(this, G, () => {
166
214
  this.classList.remove("triggered"), this.setAttribute("aria-expanded", "false");
167
215
  });
168
- j && (this.addEventListener("click", () => {
169
- if (e(this, r)) {
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, r).opened.current ? e(this, r).open({ trigger: this }) : (t === "close" || t === "toggle" && e(this, r).opened.current) && e(this, r).close();
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, r);
229
+ return e(this, n);
182
230
  }
183
231
  connectedCallback() {
184
- var o;
185
- e(this, E).subscribe((n) => {
186
- e(this, r) instanceof W && (n.current !== "close" ? (this.setAttribute("aria-haspopup", "true"), this.setAttribute(
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, r).opened.current ? "true" : "false"
189
- ), this.setAttribute("aria-controls", e(this, r).id || "")) : (this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls")));
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 n = null;
241
+ let o = null;
194
242
  if (t === "parent") {
195
- const I = this.closest("[popover-target]");
196
- if (I)
197
- n = I;
243
+ const a = this.closest("[popover-target]");
244
+ if (a)
245
+ o = a;
198
246
  else {
199
- const _ = this.getRootNode();
200
- _ instanceof ShadowRoot ? n = _.host.closest("[popover-target]") : _ instanceof HTMLElement && (n = _.closest("[popover-target]"));
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" ? n = (o = this.parentElement) == null ? void 0 : o.querySelector("[popover-target]") : n = document.querySelector(`#${t}`) || this.getRootNode().querySelector(`#${t}`);
203
- n instanceof HTMLElement ? (i(this, r, n), e(this, r).addEventListener(
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, r).addEventListener(
253
+ e(this, O)
254
+ ), e(this, n).addEventListener(
207
255
  "popoverOpened",
208
- e(this, H)
209
- ), e(this, r).addEventListener(
256
+ e(this, $)
257
+ ), e(this, n).addEventListener(
210
258
  "popoverClosing",
211
- e(this, M)
212
- ), e(this, r).addEventListener(
259
+ e(this, H)
260
+ ), e(this, n).addEventListener(
213
261
  "popoverClosed",
214
- e(this, R)
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, r) && (e(this, r).removeEventListener(
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, r).removeEventListener(
270
+ e(this, O)
271
+ ), e(this, n).removeEventListener(
224
272
  "popoverOpened",
225
- e(this, H)
226
- ), e(this, r).removeEventListener(
273
+ e(this, $)
274
+ ), e(this, n).removeEventListener(
227
275
  "popoverClosing",
228
- e(this, M)
229
- ), e(this, r).removeEventListener(
276
+ e(this, H)
277
+ ), e(this, n).removeEventListener(
230
278
  "popoverClosed",
231
- e(this, R)
279
+ e(this, G)
232
280
  ));
233
281
  }
234
282
  }
235
- r = new WeakMap(), E = new WeakMap(), $ = new WeakMap(), H = new WeakMap(), M = new WeakMap(), R = new WeakMap();
236
- j && !customElements.get("e-popover-button") && customElements.define("e-popover-button", se);
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
- se as PopoverButtonElement,
239
- W as PopoverElement
286
+ re as PopoverButtonElement,
287
+ B as PopoverElement
240
288
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.49.1",
3
+ "version": "0.50.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"