aptechka 0.28.0 → 0.28.2

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