aptechka 0.29.3 → 0.29.4

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 +1 @@
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
+ "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("data-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;
@@ -8,25 +8,25 @@ import { S as N } from "../Store-OTdcl6SX.js";
8
8
  import { d as A } from "../events-CsVF98U6.js";
9
9
  import { g as B } from "../style-j2TwriJ_.js";
10
10
  import { i as P } from "../browser-0zX67oeU.js";
11
- var L, p, T, l, u, v, g, a, q, E, O, y, $, m;
11
+ var L, p, T, a, u, v, g, l, q, E, O, y, $, m;
12
12
  const c = class c extends HTMLElement {
13
13
  constructor() {
14
14
  super(...arguments);
15
- o(this, a);
15
+ o(this, l);
16
16
  o(this, L);
17
17
  o(this, p);
18
18
  o(this, T);
19
- o(this, l);
19
+ o(this, a);
20
20
  o(this, u);
21
21
  o(this, v);
22
22
  o(this, g);
23
23
  o(this, E);
24
24
  o(this, y);
25
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) => {
26
+ h(this, L, -1), h(this, p, new N(!1)), h(this, a, 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
27
  if (e(this, p).current)
28
28
  return;
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
+ 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, a).current && e(this, g) && history.pushState("", "", e(this, l, q)), clearTimeout(e(this, T)), this.classList.add("triggered"), this.style.display = "block", A(this, "popoverTriggered", {
30
30
  custom: !0
31
31
  });
32
32
  const d = () => {
@@ -36,7 +36,7 @@ const c = class c extends HTMLElement {
36
36
  };
37
37
  t ? setTimeout(d) : d();
38
38
  }, this.close = () => {
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", {
39
+ e(this, p).current && (e(this, p).current = !1, c.__opened = c.__opened.filter((t) => t !== this), b(this, l, O).call(this), this.classList.remove("opened"), this.style.opacity = "0", A(this, "popoverClosing", {
40
40
  custom: !0
41
41
  }), removeEventListener("click", e(this, E)), removeEventListener("keydown", e(this, y)), setTimeout(() => {
42
42
  this.classList.remove("triggered"), this.style.display = "none", A(this, "popoverClosed", {
@@ -44,21 +44,21 @@ const c = class c extends HTMLElement {
44
44
  });
45
45
  }, B(this) + 10));
46
46
  }, h(this, E, (t) => {
47
- b(this, a, $).call(this, () => {
47
+ b(this, l, $).call(this, () => {
48
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");
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("data-outside");
50
50
  (!_ || f) && this.close();
51
51
  });
52
52
  }), h(this, y, (t) => {
53
- b(this, a, $).call(this, () => {
53
+ b(this, l, $).call(this, () => {
54
54
  t.code === "Escape" && this.close();
55
55
  });
56
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);
57
+ h(this, g, !1), e(this, p).current && e(this, a).current && !location.search.includes(this.id) ? this.close() : !e(this, p).current && e(this, a).current && location.search.includes(this.id) && this.open(), h(this, g, !0);
58
58
  });
59
59
  }
60
60
  get history() {
61
- return e(this, l);
61
+ return e(this, a);
62
62
  }
63
63
  get restore() {
64
64
  return e(this, u);
@@ -70,18 +70,18 @@ const c = class c extends HTMLElement {
70
70
  return e(this, p);
71
71
  }
72
72
  connectedCallback() {
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));
73
+ e(this, a).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, l, O).call(this), h(this, g, !0));
75
75
  }, 0);
76
76
  }
77
77
  disconnectedCallback() {
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));
78
+ e(this, a).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));
79
79
  }
80
80
  };
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() {
81
+ L = new WeakMap(), p = new WeakMap(), T = new WeakMap(), a = new WeakMap(), u = new WeakMap(), v = new WeakMap(), g = new WeakMap(), l = new WeakSet(), q = function() {
82
82
  return `${location.pathname}${location.search ? location.search + "&" : "?"}${this.id}`;
83
83
  }, E = new WeakMap(), O = function() {
84
- if (e(this, l).current) {
84
+ if (e(this, a).current) {
85
85
  const t = new URL(location.href);
86
86
  t.searchParams.delete(this.id), history.replaceState(null, "", t.href);
87
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.29.3",
3
+ "version": "0.29.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"