aptechka 0.32.3 → 0.32.5

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.
@@ -16,7 +16,7 @@ export declare class PopoverElement extends HTMLElement {
16
16
  private static __opened;
17
17
  get history(): Attribute<false>;
18
18
  get restore(): Attribute<false>;
19
- get dominance(): Attribute<false | "all" | "previous">;
19
+ get dominance(): Attribute<number>;
20
20
  get opened(): Store<boolean>;
21
21
  get lastTrigger(): any;
22
22
  open: (options?: {
@@ -1 +1 @@
1
- "use strict";var N=o=>{throw TypeError(o)};var H=(o,h,t)=>h.has(o)||N("Cannot "+t);var e=(o,h,t)=>(H(o,h,"read from private field"),t?t.call(o):h.get(o)),s=(o,h,t)=>h.has(o)?N("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(o):h.set(o,t),i=(o,h,t,l)=>(H(o,h,"write to private field"),l?l.call(o,t):h.set(o,t),t),k=(o,h,t)=>(H(o,h,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("../attribute/index.cjs"),W=require("../Store-CDb6RMce.cjs"),P=require("../events-KVanG9sR.cjs"),F=require("../function-MthRj-GJ.cjs"),G=require("../style-At6aDoqG.cjs"),j=require("../window-resizer/vanilla/index.cjs"),J=require("../browser-CpzFX2xg.cjs");var E,a,S,d,v,u,m,f,p,D,b,z,w,$,L,T,C,_;const c=class c extends HTMLElement{constructor(){super(...arguments);s(this,p);s(this,E);s(this,a);s(this,S);s(this,d);s(this,v);s(this,u);s(this,m);s(this,f);s(this,b);s(this,w);s(this,L);s(this,T);s(this,C);s(this,_);i(this,E,-1),i(this,a,new W.Store(!1)),i(this,d,new O.Attribute(this,"history",!1)),i(this,v,new O.Attribute(this,"restore",!1)),i(this,u,new O.Attribute(this,"dominance",!1)),i(this,m,!1),this.open=t=>{if(e(this,a).current)return;i(this,f,t==null?void 0:t.trigger),e(this,a).current=!0,e(this,u).current==="all"?(c.__opened.forEach(n=>n.close()),c.__opened=[]):e(this,u).current==="previous"&&(c.__opened=c.__opened.filter((n,y,g)=>y<g.length-1?!0:(n.close(),!1))),c.__opened.push(this),i(this,E,c.__opened.length-1),e(this,d).current&&e(this,m)&&history.pushState("","",e(this,p,D)),clearTimeout(e(this,S)),this.classList.remove("closing"),this.classList.add("triggered"),this.style.display="block",P.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,f)}});const l=()=>{addEventListener("click",e(this,b)),addEventListener("keydown",e(this,w)),e(this,_).call(this),this.style.opacity="1",this.classList.add("opened"),P.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,f)}})};t!=null&&t.skipTransition?l():setTimeout(l,10)},this.close=()=>{e(this,a).current&&(e(this,a).current=!1,c.__opened=c.__opened.filter(t=>t!==this),k(this,p,z).call(this),this.classList.remove("opened"),this.classList.add("closing"),this.style.opacity="0",P.dispatchEvent(this,"popoverClosing",{custom:!0}),removeEventListener("click",e(this,b)),removeEventListener("keydown",e(this,w)),setTimeout(()=>{this.classList.remove("triggered"),this.classList.remove("closing"),this.style.display="none",P.dispatchEvent(this,"popoverClosed",{custom:!0})},G.getElementTransitionDurationMS(this)+10))},i(this,b,t=>{k(this,p,$).call(this,()=>{var I;const l=t.composedPath();if(l.find(B=>B instanceof HTMLElement&&B.hasAttribute("data-popover-content")))return;const n=l[0],y=n instanceof HTMLElement&&(this.contains(n)||((I=this.shadowRoot)==null?void 0:I.contains(n))),g=n instanceof HTMLElement&&n.hasAttribute("data-outside");(!y||g)&&this.close()})}),i(this,w,t=>{k(this,p,$).call(this,()=>{t.code==="Escape"&&this.close()})}),i(this,L,()=>{i(this,m,!1),e(this,a).current&&e(this,d).current&&!location.search.includes(this.id)?this.close():!e(this,a).current&&e(this,d).current&&location.search.includes(this.id)&&this.open(),i(this,m,!0)}),i(this,T,()=>{this.style.width="0px",this.style.height="0px",e(this,C).call(this)}),i(this,C,F.debounce(()=>{e(this,_).call(this),this.style.width="",this.style.height=""},20)),i(this,_,()=>{this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px")})}get history(){return e(this,d)}get restore(){return e(this,v)}get dominance(){return e(this,u)}get opened(){return e(this,a)}get lastTrigger(){return e(this,f)}connectedCallback(){e(this,d).observe(),e(this,v).observe(),e(this,u).observe(),this.style.opacity="0",this.style.display="none",this.setAttribute("popover-target",""),this.classList.remove("closing"),this.classList.remove("closed"),this.classList.remove("triggered"),this.classList.remove("opened"),addEventListener("popstate",e(this,L)),setTimeout(()=>{e(this,v).current?e(this,L).call(this):(k(this,p,z).call(this),i(this,m,!0))},0),j.windowResizer.subscribe(e(this,T))}disconnectedCallback(){j.windowResizer.unsubscribe(e(this,T)),e(this,d).unobserve(),e(this,v).unobserve(),e(this,u).unobserve(),this.style.opacity="",this.style.display="",this.removeAttribute("popover-target"),c.__opened=c.__opened.filter(t=>t!==this),clearTimeout(e(this,S)),removeEventListener("popstate",e(this,L)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height")}};E=new WeakMap,a=new WeakMap,S=new WeakMap,d=new WeakMap,v=new WeakMap,u=new WeakMap,m=new WeakMap,f=new WeakMap,p=new WeakSet,D=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.id}`},b=new WeakMap,z=function(){if(e(this,d).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(null,"",t.href)}},w=new WeakMap,$=function(t){(c.__opened[e(this,E)-1]||c.__opened.length===1)&&t()},L=new WeakMap,T=new WeakMap,C=new WeakMap,_=new WeakMap,c.__opened=[];let R=c;customElements.get("e-popover")||customElements.define("e-popover",R);var r,x,A,q,M;class U extends HTMLElement{constructor(){super();s(this,r);s(this,x,()=>{this.classList.add("triggered")});s(this,A,()=>{this.classList.add("opened")});s(this,q,()=>{this.classList.remove("opened")});s(this,M,()=>{this.classList.remove("triggered")});J.isBrowser&&(this.addEventListener("click",()=>{if(e(this,r)){const t=this.getAttribute("type")||"open";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 popoverElement(){return e(this,r)}connectedCallback(){var l;this.hasAttribute("tabindex")||(this.tabIndex=0);const t=this.getAttribute("target");if(t){let n=null;if(t==="parent"){const y=this.closest("[popover-target]");if(y)n=y;else{const g=this.getRootNode();g instanceof ShadowRoot?n=g.host.closest("[popover-target]"):g instanceof HTMLElement&&(n=g.closest("[popover-target]"))}}else t==="sibling"?n=(l=this.parentElement)==null?void 0:l.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,x)),e(this,r).addEventListener("popoverOpened",e(this,A)),e(this,r).addEventListener("popoverClosing",e(this,q)),e(this,r).addEventListener("popoverClosed",e(this,M))):console.warn(this,`target ${t} not found`)}}disconnectedCallback(){e(this,r)&&(e(this,r).removeEventListener("popoverTriggered",e(this,x)),e(this,r).removeEventListener("popoverOpened",e(this,A)),e(this,r).removeEventListener("popoverClosing",e(this,q)),e(this,r).removeEventListener("popoverClosed",e(this,M)))}}r=new WeakMap,x=new WeakMap,A=new WeakMap,q=new WeakMap,M=new WeakMap;customElements.get("e-popover-button")||customElements.define("e-popover-button",U);exports.PopoverButtonElement=U;exports.PopoverElement=R;
1
+ "use strict";var N=o=>{throw TypeError(o)};var H=(o,n,t)=>n.has(o)||N("Cannot "+t);var e=(o,n,t)=>(H(o,n,"read from private field"),t?t.call(o):n.get(o)),s=(o,n,t)=>n.has(o)?N("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(o):n.set(o,t),i=(o,n,t,l)=>(H(o,n,"write to private field"),l?l.call(o,t):n.set(o,t),t),k=(o,n,t)=>(H(o,n,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("../attribute/index.cjs"),W=require("../Store-CDb6RMce.cjs"),M=require("../events-KVanG9sR.cjs"),F=require("../function-MthRj-GJ.cjs"),G=require("../style-At6aDoqG.cjs"),j=require("../window-resizer/vanilla/index.cjs"),J=require("../browser-CpzFX2xg.cjs");var y,a,_,d,u,v,g,m,p,D,E,z,b,$,f,T,S,w;const c=class c extends HTMLElement{constructor(){super(...arguments);s(this,p);s(this,y);s(this,a);s(this,_);s(this,d);s(this,u);s(this,v);s(this,g);s(this,m);s(this,E);s(this,b);s(this,f);s(this,T);s(this,S);s(this,w);i(this,y,-1),i(this,a,new W.Store(!1)),i(this,d,new O.Attribute(this,"history",!1)),i(this,u,new O.Attribute(this,"restore",!1)),i(this,v,new O.Attribute(this,"dominance",0)),i(this,g,!1),this.open=t=>{if(e(this,a).current)return;i(this,m,t==null?void 0:t.trigger),e(this,a).current=!0,e(this,v).current&&(c.__opened=c.__opened.filter(h=>this.dominance.current>=h.dominance.current?(h.close(),!1):!0)),c.__opened.push(this),i(this,y,c.__opened.length-1),e(this,d).current&&e(this,g)&&history.pushState("","",e(this,p,D)),clearTimeout(e(this,_)),this.classList.remove("closing"),this.classList.add("triggered"),this.style.display="block",M.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,m)}});const l=()=>{addEventListener("click",e(this,E)),addEventListener("keydown",e(this,b)),e(this,w).call(this),this.style.opacity="1",this.classList.add("opened"),M.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,m)}})};t!=null&&t.skipTransition?l():setTimeout(l,10)},this.close=()=>{e(this,a).current&&(e(this,a).current=!1,c.__opened=c.__opened.filter(t=>t!==this),k(this,p,z).call(this),this.classList.remove("opened"),this.classList.add("closing"),this.style.opacity="0",M.dispatchEvent(this,"popoverClosing",{custom:!0}),removeEventListener("click",e(this,E)),removeEventListener("keydown",e(this,b)),setTimeout(()=>{this.classList.remove("triggered"),this.classList.remove("closing"),this.style.display="none",M.dispatchEvent(this,"popoverClosed",{custom:!0})},G.getElementTransitionDurationMS(this)+10))},i(this,E,t=>{k(this,p,$).call(this,()=>{var I;const l=t.composedPath();if(l.find(B=>B instanceof HTMLElement&&B.hasAttribute("data-popover-content")))return;const h=l[0],x=h instanceof HTMLElement&&(this.contains(h)||((I=this.shadowRoot)==null?void 0:I.contains(h))),L=h instanceof HTMLElement&&h.hasAttribute("data-outside");(!x||L)&&this.close()})}),i(this,b,t=>{k(this,p,$).call(this,()=>{t.code==="Escape"&&this.close()})}),i(this,f,()=>{i(this,g,!1),e(this,a).current&&e(this,d).current&&!location.search.includes(this.id)?this.close():!e(this,a).current&&e(this,d).current&&location.search.includes(this.id)&&this.open(),i(this,g,!0)}),i(this,T,()=>{this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),e(this,S).call(this)}),i(this,S,F.debounce(()=>{e(this,w).call(this)},20)),i(this,w,()=>{this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px")})}get history(){return e(this,d)}get restore(){return e(this,u)}get dominance(){return e(this,v)}get opened(){return e(this,a)}get lastTrigger(){return e(this,m)}connectedCallback(){e(this,d).observe(),e(this,u).observe(),e(this,v).observe(),this.style.opacity="0",this.style.display="none",this.setAttribute("popover-target",""),this.classList.remove("closing"),this.classList.remove("closed"),this.classList.remove("triggered"),this.classList.remove("opened"),addEventListener("popstate",e(this,f)),setTimeout(()=>{e(this,u).current?e(this,f).call(this):(k(this,p,z).call(this),i(this,g,!0))},0),j.windowResizer.subscribe(e(this,T))}disconnectedCallback(){j.windowResizer.unsubscribe(e(this,T)),e(this,d).unobserve(),e(this,u).unobserve(),e(this,v).unobserve(),this.style.opacity="",this.style.display="",this.removeAttribute("popover-target"),c.__opened=c.__opened.filter(t=>t!==this),clearTimeout(e(this,_)),removeEventListener("popstate",e(this,f)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height")}};y=new WeakMap,a=new WeakMap,_=new WeakMap,d=new WeakMap,u=new WeakMap,v=new WeakMap,g=new WeakMap,m=new WeakMap,p=new WeakSet,D=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.id}`},E=new WeakMap,z=function(){if(e(this,d).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(null,"",t.href)}},b=new WeakMap,$=function(t){(c.__opened[e(this,y)-1]||c.__opened.length===1)&&t()},f=new WeakMap,T=new WeakMap,S=new WeakMap,w=new WeakMap,c.__opened=[];let R=c;customElements.get("e-popover")||customElements.define("e-popover",R);var r,C,A,P,q;class U extends HTMLElement{constructor(){super();s(this,r);s(this,C,()=>{this.classList.add("triggered")});s(this,A,()=>{this.classList.add("opened")});s(this,P,()=>{this.classList.remove("opened")});s(this,q,()=>{this.classList.remove("triggered")});J.isBrowser&&(this.addEventListener("click",()=>{if(e(this,r)){const t=this.getAttribute("type")||"open";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 popoverElement(){return e(this,r)}connectedCallback(){var l;this.hasAttribute("tabindex")||(this.tabIndex=0);const t=this.getAttribute("target");if(t){let h=null;if(t==="parent"){const x=this.closest("[popover-target]");if(x)h=x;else{const L=this.getRootNode();L instanceof ShadowRoot?h=L.host.closest("[popover-target]"):L instanceof HTMLElement&&(h=L.closest("[popover-target]"))}}else t==="sibling"?h=(l=this.parentElement)==null?void 0:l.querySelector("[popover-target]"):h=document.querySelector(`#${t}`)||this.getRootNode().querySelector(`#${t}`);h instanceof HTMLElement?(i(this,r,h),e(this,r).addEventListener("popoverTriggered",e(this,C)),e(this,r).addEventListener("popoverOpened",e(this,A)),e(this,r).addEventListener("popoverClosing",e(this,P)),e(this,r).addEventListener("popoverClosed",e(this,q))):console.warn(this,`target ${t} not found`)}}disconnectedCallback(){e(this,r)&&(e(this,r).removeEventListener("popoverTriggered",e(this,C)),e(this,r).removeEventListener("popoverOpened",e(this,A)),e(this,r).removeEventListener("popoverClosing",e(this,P)),e(this,r).removeEventListener("popoverClosed",e(this,q)))}}r=new WeakMap,C=new WeakMap,A=new WeakMap,P=new WeakMap,q=new WeakMap;customElements.get("e-popover-button")||customElements.define("e-popover-button",U);exports.PopoverButtonElement=U;exports.PopoverElement=R;
@@ -1,86 +1,82 @@
1
1
  var B = (o) => {
2
2
  throw TypeError(o);
3
3
  };
4
- var O = (o, h, t) => h.has(o) || B("Cannot " + t);
5
- var e = (o, h, t) => (O(o, h, "read from private field"), t ? t.call(o) : h.get(o)), s = (o, h, t) => h.has(o) ? B("Cannot add the same private member more than once") : h instanceof WeakSet ? h.add(o) : h.set(o, t), i = (o, h, t, c) => (O(o, h, "write to private field"), c ? c.call(o, t) : h.set(o, t), t), _ = (o, h, t) => (O(o, h, "access private method"), t);
6
- import { Attribute as P } from "../attribute/index.js";
4
+ var R = (o, n, t) => n.has(o) || B("Cannot " + t);
5
+ var e = (o, n, t) => (R(o, n, "read from private field"), t ? t.call(o) : n.get(o)), s = (o, n, t) => n.has(o) ? B("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(o) : n.set(o, t), i = (o, n, t, l) => (R(o, n, "write to private field"), l ? l.call(o, t) : n.set(o, t), t), k = (o, n, t) => (R(o, n, "access private method"), t);
6
+ import { Attribute as O } from "../attribute/index.js";
7
7
  import { S as W } from "../Store-OTdcl6SX.js";
8
- import { d as R } from "../events-CsVF98U6.js";
8
+ import { d as P } from "../events-CsVF98U6.js";
9
9
  import { d as j } from "../function-C10DGppn.js";
10
10
  import { g as F } from "../style-j2TwriJ_.js";
11
11
  import { windowResizer as D } from "../window-resizer/vanilla/index.js";
12
12
  import { i as G } from "../browser-0zX67oeU.js";
13
- var E, a, C, d, v, u, m, f, p, U, b, z, T, I, L, w, S, k;
14
- const l = class l extends HTMLElement {
13
+ var y, a, C, d, u, g, m, v, p, U, E, z, b, I, f, T, S, w;
14
+ const c = class c extends HTMLElement {
15
15
  constructor() {
16
16
  super(...arguments);
17
17
  s(this, p);
18
- s(this, E);
18
+ s(this, y);
19
19
  s(this, a);
20
20
  s(this, C);
21
21
  s(this, d);
22
- s(this, v);
23
22
  s(this, u);
23
+ s(this, g);
24
24
  s(this, m);
25
- s(this, f);
25
+ s(this, v);
26
+ s(this, E);
26
27
  s(this, b);
28
+ s(this, f);
27
29
  s(this, T);
28
- s(this, L);
29
- s(this, w);
30
30
  s(this, S);
31
- s(this, k);
32
- i(this, E, -1), i(this, a, new W(!1)), i(this, d, new P(this, "history", !1)), i(this, v, new P(this, "restore", !1)), i(this, u, new P(
33
- this,
34
- "dominance",
35
- !1
36
- )), i(this, m, !1), this.open = (t) => {
31
+ s(this, w);
32
+ i(this, y, -1), i(this, a, new W(!1)), i(this, d, new O(this, "history", !1)), i(this, u, new O(this, "restore", !1)), i(this, g, new O(this, "dominance", 0)), i(this, m, !1), this.open = (t) => {
37
33
  if (e(this, a).current)
38
34
  return;
39
- i(this, f, t == null ? void 0 : t.trigger), e(this, a).current = !0, e(this, u).current === "all" ? (l.__opened.forEach((n) => n.close()), l.__opened = []) : e(this, u).current === "previous" && (l.__opened = l.__opened.filter((n, y, g) => y < g.length - 1 ? !0 : (n.close(), !1))), l.__opened.push(this), i(this, E, l.__opened.length - 1), e(this, d).current && e(this, m) && history.pushState("", "", e(this, p, U)), clearTimeout(e(this, C)), this.classList.remove("closing"), this.classList.add("triggered"), this.style.display = "block", R(this, "popoverTriggered", {
35
+ i(this, v, t == null ? void 0 : t.trigger), e(this, a).current = !0, e(this, g).current && (c.__opened = c.__opened.filter((h) => this.dominance.current >= h.dominance.current ? (h.close(), !1) : !0)), c.__opened.push(this), i(this, y, c.__opened.length - 1), e(this, d).current && e(this, m) && history.pushState("", "", e(this, p, U)), clearTimeout(e(this, C)), this.classList.remove("closing"), this.classList.add("triggered"), this.style.display = "block", P(this, "popoverTriggered", {
40
36
  custom: !0,
41
37
  detail: {
42
- trigger: e(this, f)
38
+ trigger: e(this, v)
43
39
  }
44
40
  });
45
- const c = () => {
46
- addEventListener("click", e(this, b)), addEventListener("keydown", e(this, T)), e(this, k).call(this), this.style.opacity = "1", this.classList.add("opened"), R(this, "popoverOpened", {
41
+ const l = () => {
42
+ addEventListener("click", e(this, E)), addEventListener("keydown", e(this, b)), e(this, w).call(this), this.style.opacity = "1", this.classList.add("opened"), P(this, "popoverOpened", {
47
43
  custom: !0,
48
44
  detail: {
49
- trigger: e(this, f)
45
+ trigger: e(this, v)
50
46
  }
51
47
  });
52
48
  };
53
- t != null && t.skipTransition ? c() : setTimeout(c, 10);
49
+ t != null && t.skipTransition ? l() : setTimeout(l, 10);
54
50
  }, this.close = () => {
55
- e(this, a).current && (e(this, a).current = !1, l.__opened = l.__opened.filter((t) => t !== this), _(this, p, z).call(this), this.classList.remove("opened"), this.classList.add("closing"), this.style.opacity = "0", R(this, "popoverClosing", {
51
+ e(this, a).current && (e(this, a).current = !1, c.__opened = c.__opened.filter((t) => t !== this), k(this, p, z).call(this), this.classList.remove("opened"), this.classList.add("closing"), this.style.opacity = "0", P(this, "popoverClosing", {
56
52
  custom: !0
57
- }), removeEventListener("click", e(this, b)), removeEventListener("keydown", e(this, T)), setTimeout(() => {
58
- this.classList.remove("triggered"), this.classList.remove("closing"), this.style.display = "none", R(this, "popoverClosed", {
53
+ }), removeEventListener("click", e(this, E)), removeEventListener("keydown", e(this, b)), setTimeout(() => {
54
+ this.classList.remove("triggered"), this.classList.remove("closing"), this.style.display = "none", P(this, "popoverClosed", {
59
55
  custom: !0
60
56
  });
61
57
  }, F(this) + 10));
62
- }, i(this, b, (t) => {
63
- _(this, p, I).call(this, () => {
58
+ }, i(this, E, (t) => {
59
+ k(this, p, I).call(this, () => {
64
60
  var q;
65
- const c = t.composedPath();
66
- if (c.find(
61
+ const l = t.composedPath();
62
+ if (l.find(
67
63
  (N) => N instanceof HTMLElement && N.hasAttribute("data-popover-content")
68
64
  ))
69
65
  return;
70
- const n = c[0], y = n instanceof HTMLElement && (this.contains(n) || ((q = this.shadowRoot) == null ? void 0 : q.contains(n))), g = n instanceof HTMLElement && n.hasAttribute("data-outside");
71
- (!y || g) && this.close();
66
+ const h = l[0], M = h instanceof HTMLElement && (this.contains(h) || ((q = this.shadowRoot) == null ? void 0 : q.contains(h))), L = h instanceof HTMLElement && h.hasAttribute("data-outside");
67
+ (!M || L) && this.close();
72
68
  });
73
- }), i(this, T, (t) => {
74
- _(this, p, I).call(this, () => {
69
+ }), i(this, b, (t) => {
70
+ k(this, p, I).call(this, () => {
75
71
  t.code === "Escape" && this.close();
76
72
  });
77
- }), i(this, L, () => {
73
+ }), i(this, f, () => {
78
74
  i(this, m, !1), e(this, a).current && e(this, d).current && !location.search.includes(this.id) ? this.close() : !e(this, a).current && e(this, d).current && location.search.includes(this.id) && this.open(), i(this, m, !0);
79
- }), i(this, w, () => {
80
- this.style.width = "0px", this.style.height = "0px", e(this, S).call(this);
75
+ }), i(this, T, () => {
76
+ this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), e(this, S).call(this);
81
77
  }), i(this, S, j(() => {
82
- e(this, k).call(this), this.style.width = "", this.style.height = "";
83
- }, 20)), i(this, k, () => {
78
+ e(this, w).call(this);
79
+ }, 20)), i(this, w, () => {
84
80
  this.style.setProperty("--content-width", this.scrollWidth + "px"), this.style.setProperty("--content-height", this.scrollHeight + "px");
85
81
  });
86
82
  }
@@ -88,53 +84,53 @@ const l = class l extends HTMLElement {
88
84
  return e(this, d);
89
85
  }
90
86
  get restore() {
91
- return e(this, v);
87
+ return e(this, u);
92
88
  }
93
89
  get dominance() {
94
- return e(this, u);
90
+ return e(this, g);
95
91
  }
96
92
  get opened() {
97
93
  return e(this, a);
98
94
  }
99
95
  get lastTrigger() {
100
- return e(this, f);
96
+ return e(this, v);
101
97
  }
102
98
  connectedCallback() {
103
- e(this, d).observe(), e(this, v).observe(), e(this, u).observe(), this.style.opacity = "0", this.style.display = "none", this.setAttribute("popover-target", ""), this.classList.remove("closing"), this.classList.remove("closed"), this.classList.remove("triggered"), this.classList.remove("opened"), addEventListener("popstate", e(this, L)), setTimeout(() => {
104
- e(this, v).current ? e(this, L).call(this) : (_(this, p, z).call(this), i(this, m, !0));
105
- }, 0), D.subscribe(e(this, w));
99
+ e(this, d).observe(), e(this, u).observe(), e(this, g).observe(), this.style.opacity = "0", this.style.display = "none", this.setAttribute("popover-target", ""), this.classList.remove("closing"), this.classList.remove("closed"), this.classList.remove("triggered"), this.classList.remove("opened"), addEventListener("popstate", e(this, f)), setTimeout(() => {
100
+ e(this, u).current ? e(this, f).call(this) : (k(this, p, z).call(this), i(this, m, !0));
101
+ }, 0), D.subscribe(e(this, T));
106
102
  }
107
103
  disconnectedCallback() {
108
- D.unsubscribe(e(this, w)), e(this, d).unobserve(), e(this, v).unobserve(), e(this, u).unobserve(), this.style.opacity = "", this.style.display = "", this.removeAttribute("popover-target"), l.__opened = l.__opened.filter((t) => t !== this), clearTimeout(e(this, C)), removeEventListener("popstate", e(this, L)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height");
104
+ D.unsubscribe(e(this, T)), e(this, d).unobserve(), e(this, u).unobserve(), e(this, g).unobserve(), this.style.opacity = "", this.style.display = "", this.removeAttribute("popover-target"), c.__opened = c.__opened.filter((t) => t !== this), clearTimeout(e(this, C)), removeEventListener("popstate", e(this, f)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height");
109
105
  }
110
106
  };
111
- E = new WeakMap(), a = new WeakMap(), C = new WeakMap(), d = new WeakMap(), v = new WeakMap(), u = new WeakMap(), m = new WeakMap(), f = new WeakMap(), p = new WeakSet(), U = function() {
107
+ y = new WeakMap(), a = new WeakMap(), C = new WeakMap(), d = new WeakMap(), u = new WeakMap(), g = new WeakMap(), m = new WeakMap(), v = new WeakMap(), p = new WeakSet(), U = function() {
112
108
  return `${location.pathname}${location.search ? location.search + "&" : "?"}${this.id}`;
113
- }, b = new WeakMap(), z = function() {
109
+ }, E = new WeakMap(), z = function() {
114
110
  if (e(this, d).current) {
115
111
  const t = new URL(location.href);
116
112
  t.searchParams.delete(this.id), history.replaceState(null, "", t.href);
117
113
  }
118
- }, T = new WeakMap(), I = function(t) {
119
- (l.__opened[e(this, E) - 1] || l.__opened.length === 1) && t();
120
- }, L = new WeakMap(), w = new WeakMap(), S = new WeakMap(), k = new WeakMap(), l.__opened = [];
121
- let $ = l;
114
+ }, b = new WeakMap(), I = function(t) {
115
+ (c.__opened[e(this, y) - 1] || c.__opened.length === 1) && t();
116
+ }, f = new WeakMap(), T = new WeakMap(), S = new WeakMap(), w = new WeakMap(), c.__opened = [];
117
+ let $ = c;
122
118
  customElements.get("e-popover") || customElements.define("e-popover", $);
123
- var r, x, A, H, M;
119
+ var r, _, A, x, H;
124
120
  class J extends HTMLElement {
125
121
  constructor() {
126
122
  super();
127
123
  s(this, r);
128
- s(this, x, () => {
124
+ s(this, _, () => {
129
125
  this.classList.add("triggered");
130
126
  });
131
127
  s(this, A, () => {
132
128
  this.classList.add("opened");
133
129
  });
134
- s(this, H, () => {
130
+ s(this, x, () => {
135
131
  this.classList.remove("opened");
136
132
  });
137
- s(this, M, () => {
133
+ s(this, H, () => {
138
134
  this.classList.remove("triggered");
139
135
  });
140
136
  G && (this.addEventListener("click", () => {
@@ -150,52 +146,52 @@ class J extends HTMLElement {
150
146
  return e(this, r);
151
147
  }
152
148
  connectedCallback() {
153
- var c;
149
+ var l;
154
150
  this.hasAttribute("tabindex") || (this.tabIndex = 0);
155
151
  const t = this.getAttribute("target");
156
152
  if (t) {
157
- let n = null;
153
+ let h = null;
158
154
  if (t === "parent") {
159
- const y = this.closest("[popover-target]");
160
- if (y)
161
- n = y;
155
+ const M = this.closest("[popover-target]");
156
+ if (M)
157
+ h = M;
162
158
  else {
163
- const g = this.getRootNode();
164
- g instanceof ShadowRoot ? n = g.host.closest("[popover-target]") : g instanceof HTMLElement && (n = g.closest("[popover-target]"));
159
+ const L = this.getRootNode();
160
+ L instanceof ShadowRoot ? h = L.host.closest("[popover-target]") : L instanceof HTMLElement && (h = L.closest("[popover-target]"));
165
161
  }
166
- } else t === "sibling" ? n = (c = this.parentElement) == null ? void 0 : c.querySelector("[popover-target]") : n = document.querySelector(`#${t}`) || this.getRootNode().querySelector(`#${t}`);
167
- n instanceof HTMLElement ? (i(this, r, n), e(this, r).addEventListener(
162
+ } else t === "sibling" ? h = (l = this.parentElement) == null ? void 0 : l.querySelector("[popover-target]") : h = document.querySelector(`#${t}`) || this.getRootNode().querySelector(`#${t}`);
163
+ h instanceof HTMLElement ? (i(this, r, h), e(this, r).addEventListener(
168
164
  "popoverTriggered",
169
- e(this, x)
165
+ e(this, _)
170
166
  ), e(this, r).addEventListener(
171
167
  "popoverOpened",
172
168
  e(this, A)
173
169
  ), e(this, r).addEventListener(
174
170
  "popoverClosing",
175
- e(this, H)
171
+ e(this, x)
176
172
  ), e(this, r).addEventListener(
177
173
  "popoverClosed",
178
- e(this, M)
174
+ e(this, H)
179
175
  )) : console.warn(this, `target ${t} not found`);
180
176
  }
181
177
  }
182
178
  disconnectedCallback() {
183
179
  e(this, r) && (e(this, r).removeEventListener(
184
180
  "popoverTriggered",
185
- e(this, x)
181
+ e(this, _)
186
182
  ), e(this, r).removeEventListener(
187
183
  "popoverOpened",
188
184
  e(this, A)
189
185
  ), e(this, r).removeEventListener(
190
186
  "popoverClosing",
191
- e(this, H)
187
+ e(this, x)
192
188
  ), e(this, r).removeEventListener(
193
189
  "popoverClosed",
194
- e(this, M)
190
+ e(this, H)
195
191
  ));
196
192
  }
197
193
  }
198
- r = new WeakMap(), x = new WeakMap(), A = new WeakMap(), H = new WeakMap(), M = new WeakMap();
194
+ r = new WeakMap(), _ = new WeakMap(), A = new WeakMap(), x = new WeakMap(), H = new WeakMap();
199
195
  customElements.get("e-popover-button") || customElements.define("e-popover-button", J);
200
196
  export {
201
197
  J as PopoverButtonElement,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.32.3",
3
+ "version": "0.32.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"