aptechka 0.49.2 → 0.50.1

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