aptechka 0.46.0 → 0.46.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 +1 @@
1
- "use strict";var M=s=>{throw TypeError(s)};var p=(s,i,t)=>i.has(s)||M("Cannot "+t);var e=(s,i,t)=>(p(s,i,"read from private field"),t?t.call(s):i.get(s)),l=(s,i,t)=>i.has(s)?M("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(s):i.set(s,t),c=(s,i,t,r)=>(p(s,i,"write to private field"),r?r.call(s,t):i.set(s,t),t),m=(s,i,t)=>(p(s,i,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("../attribute/index.cjs"),z=require("../index-Cqw2NKev.cjs"),H=require("../events-KVanG9sR.cjs"),O=require("../style-At6aDoqG.cjs");var d,n,f,h,v,u,o,w,y,L,b,k;class S{constructor(i,t){l(this,o);l(this,d,null);l(this,n,null);l(this,f,null);l(this,h,null);l(this,v);l(this,u,!1);l(this,y,()=>{e(this,u)?this.close():this.open()});l(this,L,()=>{e(this,u)&&(m(this,o,b).call(this,0,!0),m(this,o,b).call(this,e(this,o,w)))});t.firstElementChild instanceof HTMLElement&&t.lastElementChild instanceof HTMLElement?(c(this,d,i),c(this,n,t),c(this,f,t.firstElementChild),c(this,h,t.lastElementChild),e(this,h).style.overflow="hidden",e(this,d).axisAttribute.current==="y"?e(this,h).style.height="0px":e(this,h).style.width="0px",addEventListener("resize",e(this,L)),e(this,f).addEventListener("click",e(this,y)),e(this,n).hasAttribute("data-opened")&&this.open({skipTransition:!0})):i.removeItem(e(this,n))}get element(){return e(this,n)}destroy(){e(this,f)&&(e(this,n).classList.remove("opened","triggered"),e(this,n).removeAttribute("data-opened"),e(this,f).style.cursor="",m(this,o,b).call(this,void 0),removeEventListener("resize",e(this,L)),e(this,f).removeEventListener("click",e(this,y)),clearTimeout(e(this,v)))}open(i){i!=null&&i.skipTransition&&m(this,o,k).call(this),e(this,d).multipleAttribute.current||e(this,d).closeAll({exclude:e(this,n)}),c(this,u,!0),clearTimeout(e(this,v)),e(this,n).classList.add("triggered"),m(this,o,b).call(this,e(this,o,w)),setTimeout(()=>{e(this,n).classList.add("opened"),e(this,n).setAttribute("data-opened","")},0),H.dispatchEvent(this.element,"accordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:e(this,u)}})}close(i){i!=null&&i.skipTransition&&m(this,o,k).call(this),c(this,u,!1),e(this,n).classList.remove("opened"),m(this,o,b).call(this,0),c(this,v,setTimeout(()=>{e(this,n).classList.remove("triggered")},O.getElementTransitionDurationMS(e(this,h)))),H.dispatchEvent(this.element,"accordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:e(this,u)}})}}d=new WeakMap,n=new WeakMap,f=new WeakMap,h=new WeakMap,v=new WeakMap,u=new WeakMap,o=new WeakSet,w=function(){return e(this,d).axisAttribute.current==="x"?e(this,h).scrollWidth:e(this,h).scrollHeight},y=new WeakMap,L=new WeakMap,b=function(i,t=!1){t&&(e(this,h).style.transition="all 0s",setTimeout(()=>{e(this,h).style.transition=""}));const r=e(this,d).axisAttribute.current==="x"?"width":"height";i!=null?e(this,h).style[r]=`${i}px`:e(this,h).style[r]=""},k=function(){e(this,h).style.transition="all 0s",setTimeout(()=>{e(this,h).style.transition=""},50)};var E,g,a,T,x,I;class q extends HTMLElement{constructor(){super();l(this,x);l(this,E,new C.Attribute(this,"axis","y"));l(this,g,new C.Attribute(this,"multiple",!1));l(this,a,[]);l(this,T,null);z.isBrowser&&c(this,T,new MutationObserver(t=>{t.forEach(r=>{r.removedNodes.forEach(A=>{A instanceof HTMLElement&&this.removeItem(A)}),r.addedNodes.forEach(A=>{A instanceof HTMLElement&&this.createItem(A)})})}))}get axisAttribute(){return e(this,E)}get multipleAttribute(){return e(this,g)}createItem(t){e(this,a).find(r=>r.element===t)||e(this,a).push(new S(this,t))}removeItem(t){c(this,a,e(this,a).filter(r=>{if(r.element!==t)return!0;r.destroy()}))}closeAll(t){e(this,a).forEach(r=>{(t==null?void 0:t.exclude)!==r.element&&r.close(t)})}openAll(t){e(this,a).forEach(r=>{(t==null?void 0:t.exclude)!==r.element&&r.open(t)})}connectedCallback(){e(this,E).observe(),e(this,g).observe(),e(this,T).observe(e(this,x,I),{childList:!0}),c(this,a,[...e(this,x,I).children].map(t=>{if(t instanceof HTMLElement)return new S(this,t)}).filter(t=>!!t))}disconnectedCallback(){e(this,E).unobserve(),e(this,g).unobserve(),e(this,T).disconnect()}}E=new WeakMap,g=new WeakMap,a=new WeakMap,T=new WeakMap,x=new WeakSet,I=function(){return this.shadowRoot?this.shadowRoot:this};z.isBrowser&&!customElements.get("e-accordion")&&customElements.define("e-accordion",q);exports.AccordionElement=q;
1
+ "use strict";var I=s=>{throw TypeError(s)};var p=(s,i,t)=>i.has(s)||I("Cannot "+t);var e=(s,i,t)=>(p(s,i,"read from private field"),t?t.call(s):i.get(s)),n=(s,i,t)=>i.has(s)?I("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(s):i.set(s,t),c=(s,i,t,r)=>(p(s,i,"write to private field"),r?r.call(s,t):i.set(s,t),t),m=(s,i,t)=>(p(s,i,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("../attribute/index.cjs"),q=require("../index-Cqw2NKev.cjs"),C=require("../events-KVanG9sR.cjs"),H=require("../style-At6aDoqG.cjs");var d,l,f,h,E,u,o,x,A,y,b,M;class S{constructor(i,t){n(this,o);n(this,d,null);n(this,l,null);n(this,f,null);n(this,h,null);n(this,E);n(this,u,!1);n(this,A,()=>{e(this,u)?this.close():this.open()});n(this,y,()=>{e(this,u)&&(m(this,o,b).call(this,0,!0),m(this,o,b).call(this,e(this,o,x)))});t.firstElementChild instanceof HTMLElement&&t.lastElementChild instanceof HTMLElement?(c(this,d,i),c(this,l,t),c(this,f,t.firstElementChild),c(this,h,t.lastElementChild),e(this,h).style.overflow="hidden",e(this,d).axisAttribute.current==="y"?e(this,h).style.height="0px":e(this,h).style.width="0px",addEventListener("resize",e(this,y)),e(this,f).addEventListener("click",e(this,A)),e(this,l).hasAttribute("data-opened")&&this.open({skipTransition:!0})):i.removeItem(e(this,l))}get element(){return e(this,l)}destroy(){e(this,f)&&(e(this,l).classList.remove("opened","triggered"),e(this,l).removeAttribute("data-opened"),e(this,f).style.cursor="",m(this,o,b).call(this,void 0),removeEventListener("resize",e(this,y)),e(this,f).removeEventListener("click",e(this,A)),clearTimeout(e(this,E)))}open(i){i!=null&&i.skipTransition&&m(this,o,M).call(this),e(this,d).multipleAttribute.current||e(this,d).closeAll({exclude:e(this,l)}),c(this,u,!0),clearTimeout(e(this,E)),e(this,l).classList.add("triggered"),m(this,o,b).call(this,e(this,o,x)),setTimeout(()=>{e(this,l).classList.add("opened"),e(this,l).setAttribute("data-opened",""),c(this,E,setTimeout(()=>{window.dispatchEvent(new Event("resize"))},H.getElementTransitionDurationMS(e(this,h))))},0),C.dispatchEvent(this.element,"accordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:e(this,u)}})}close(i){i!=null&&i.skipTransition&&m(this,o,M).call(this),clearTimeout(e(this,E)),c(this,u,!1),e(this,l).classList.remove("opened"),m(this,o,b).call(this,0),c(this,E,setTimeout(()=>{e(this,l).classList.remove("triggered"),window.dispatchEvent(new Event("resize"))},H.getElementTransitionDurationMS(e(this,h)))),C.dispatchEvent(this.element,"accordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:e(this,u)}})}}d=new WeakMap,l=new WeakMap,f=new WeakMap,h=new WeakMap,E=new WeakMap,u=new WeakMap,o=new WeakSet,x=function(){return e(this,d).axisAttribute.current==="x"?e(this,h).scrollWidth:e(this,h).scrollHeight},A=new WeakMap,y=new WeakMap,b=function(i,t=!1){t&&(e(this,h).style.transition="all 0s",setTimeout(()=>{e(this,h).style.transition=""}));const r=e(this,d).axisAttribute.current==="x"?"width":"height";i!=null?e(this,h).style[r]=`${i}px`:e(this,h).style[r]=""},M=function(){e(this,h).style.transition="all 0s",setTimeout(()=>{e(this,h).style.transition=""},50)};var v,T,a,g,L,k;class O extends HTMLElement{constructor(){super();n(this,L);n(this,v,new z.Attribute(this,"axis","y"));n(this,T,new z.Attribute(this,"multiple",!1));n(this,a,[]);n(this,g,null);q.isBrowser&&c(this,g,new MutationObserver(t=>{t.forEach(r=>{r.removedNodes.forEach(w=>{w instanceof HTMLElement&&this.removeItem(w)}),r.addedNodes.forEach(w=>{w instanceof HTMLElement&&this.createItem(w)})})}))}get axisAttribute(){return e(this,v)}get multipleAttribute(){return e(this,T)}createItem(t){e(this,a).find(r=>r.element===t)||e(this,a).push(new S(this,t))}removeItem(t){c(this,a,e(this,a).filter(r=>{if(r.element!==t)return!0;r.destroy()}))}closeAll(t){e(this,a).forEach(r=>{(t==null?void 0:t.exclude)!==r.element&&r.close(t)})}openAll(t){e(this,a).forEach(r=>{(t==null?void 0:t.exclude)!==r.element&&r.open(t)})}connectedCallback(){e(this,v).observe(),e(this,T).observe(),e(this,g).observe(e(this,L,k),{childList:!0}),c(this,a,[...e(this,L,k).children].map(t=>{if(t instanceof HTMLElement)return new S(this,t)}).filter(t=>!!t))}disconnectedCallback(){e(this,v).unobserve(),e(this,T).unobserve(),e(this,g).disconnect()}}v=new WeakMap,T=new WeakMap,a=new WeakMap,g=new WeakMap,L=new WeakSet,k=function(){return this.shadowRoot?this.shadowRoot:this};q.isBrowser&&!customElements.get("e-accordion")&&customElements.define("e-accordion",O);exports.AccordionElement=O;
@@ -1,14 +1,14 @@
1
1
  var M = (s) => {
2
2
  throw TypeError(s);
3
3
  };
4
- var y = (s, i, t) => i.has(s) || M("Cannot " + t);
5
- var e = (s, i, t) => (y(s, i, "read from private field"), t ? t.call(s) : i.get(s)), l = (s, i, t) => i.has(s) ? M("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, t), a = (s, i, t, r) => (y(s, i, "write to private field"), r ? r.call(s, t) : i.set(s, t), t), m = (s, i, t) => (y(s, i, "access private method"), t);
6
- import { Attribute as C } from "../attribute/index.js";
7
- import { i as S } from "../index-euf5anj6.js";
8
- import { d as H } from "../events-CsVF98U6.js";
9
- import { g as R } from "../style-j2TwriJ_.js";
10
- var d, n, f, h, E, u, o, w, L, A, b, k;
11
- class z {
4
+ var x = (s, i, t) => i.has(s) || M("Cannot " + t);
5
+ var e = (s, i, t) => (x(s, i, "read from private field"), t ? t.call(s) : i.get(s)), l = (s, i, t) => i.has(s) ? M("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, t), a = (s, i, t, r) => (x(s, i, "write to private field"), r ? r.call(s, t) : i.set(s, t), t), m = (s, i, t) => (x(s, i, "access private method"), t);
6
+ import { Attribute as z } from "../attribute/index.js";
7
+ import { i as R } from "../index-euf5anj6.js";
8
+ import { d as C } from "../events-CsVF98U6.js";
9
+ import { g as H } from "../style-j2TwriJ_.js";
10
+ var d, n, f, h, E, u, o, y, w, L, v, k;
11
+ class S {
12
12
  constructor(i, t) {
13
13
  l(this, o);
14
14
  l(this, d, null);
@@ -17,24 +17,26 @@ class z {
17
17
  l(this, h, null);
18
18
  l(this, E);
19
19
  l(this, u, !1);
20
- l(this, L, () => {
20
+ l(this, w, () => {
21
21
  e(this, u) ? this.close() : this.open();
22
22
  });
23
- l(this, A, () => {
24
- e(this, u) && (m(this, o, b).call(this, 0, !0), m(this, o, b).call(this, e(this, o, w)));
23
+ l(this, L, () => {
24
+ e(this, u) && (m(this, o, v).call(this, 0, !0), m(this, o, v).call(this, e(this, o, y)));
25
25
  });
26
- t.firstElementChild instanceof HTMLElement && t.lastElementChild instanceof HTMLElement ? (a(this, d, i), a(this, n, t), a(this, f, t.firstElementChild), a(this, h, t.lastElementChild), e(this, h).style.overflow = "hidden", e(this, d).axisAttribute.current === "y" ? e(this, h).style.height = "0px" : e(this, h).style.width = "0px", addEventListener("resize", e(this, A)), e(this, f).addEventListener("click", e(this, L)), e(this, n).hasAttribute("data-opened") && this.open({ skipTransition: !0 })) : i.removeItem(e(this, n));
26
+ t.firstElementChild instanceof HTMLElement && t.lastElementChild instanceof HTMLElement ? (a(this, d, i), a(this, n, t), a(this, f, t.firstElementChild), a(this, h, t.lastElementChild), e(this, h).style.overflow = "hidden", e(this, d).axisAttribute.current === "y" ? e(this, h).style.height = "0px" : e(this, h).style.width = "0px", addEventListener("resize", e(this, L)), e(this, f).addEventListener("click", e(this, w)), e(this, n).hasAttribute("data-opened") && this.open({ skipTransition: !0 })) : i.removeItem(e(this, n));
27
27
  }
28
28
  get element() {
29
29
  return e(this, n);
30
30
  }
31
31
  destroy() {
32
- e(this, f) && (e(this, n).classList.remove("opened", "triggered"), e(this, n).removeAttribute("data-opened"), e(this, f).style.cursor = "", m(this, o, b).call(this, void 0), removeEventListener("resize", e(this, A)), e(this, f).removeEventListener("click", e(this, L)), clearTimeout(e(this, E)));
32
+ e(this, f) && (e(this, n).classList.remove("opened", "triggered"), e(this, n).removeAttribute("data-opened"), e(this, f).style.cursor = "", m(this, o, v).call(this, void 0), removeEventListener("resize", e(this, L)), e(this, f).removeEventListener("click", e(this, w)), clearTimeout(e(this, E)));
33
33
  }
34
34
  open(i) {
35
- i != null && i.skipTransition && m(this, o, k).call(this), e(this, d).multipleAttribute.current || e(this, d).closeAll({ exclude: e(this, n) }), a(this, u, !0), clearTimeout(e(this, E)), e(this, n).classList.add("triggered"), m(this, o, b).call(this, e(this, o, w)), setTimeout(() => {
36
- e(this, n).classList.add("opened"), e(this, n).setAttribute("data-opened", "");
37
- }, 0), H(this.element, "accordionItemToggle", {
35
+ i != null && i.skipTransition && m(this, o, k).call(this), e(this, d).multipleAttribute.current || e(this, d).closeAll({ exclude: e(this, n) }), a(this, u, !0), clearTimeout(e(this, E)), e(this, n).classList.add("triggered"), m(this, o, v).call(this, e(this, o, y)), setTimeout(() => {
36
+ e(this, n).classList.add("opened"), e(this, n).setAttribute("data-opened", ""), a(this, E, setTimeout(() => {
37
+ window.dispatchEvent(new Event("resize"));
38
+ }, H(e(this, h))));
39
+ }, 0), C(this.element, "accordionItemToggle", {
38
40
  bubbles: !0,
39
41
  composed: !0,
40
42
  detail: {
@@ -43,9 +45,9 @@ class z {
43
45
  });
44
46
  }
45
47
  close(i) {
46
- i != null && i.skipTransition && m(this, o, k).call(this), a(this, u, !1), e(this, n).classList.remove("opened"), m(this, o, b).call(this, 0), a(this, E, setTimeout(() => {
47
- e(this, n).classList.remove("triggered");
48
- }, R(e(this, h)))), H(this.element, "accordionItemToggle", {
48
+ i != null && i.skipTransition && m(this, o, k).call(this), clearTimeout(e(this, E)), a(this, u, !1), e(this, n).classList.remove("opened"), m(this, o, v).call(this, 0), a(this, E, setTimeout(() => {
49
+ e(this, n).classList.remove("triggered"), window.dispatchEvent(new Event("resize"));
50
+ }, H(e(this, h)))), C(this.element, "accordionItemToggle", {
49
51
  bubbles: !0,
50
52
  composed: !0,
51
53
  detail: {
@@ -54,9 +56,9 @@ class z {
54
56
  });
55
57
  }
56
58
  }
57
- d = new WeakMap(), n = new WeakMap(), f = new WeakMap(), h = new WeakMap(), E = new WeakMap(), u = new WeakMap(), o = new WeakSet(), w = function() {
59
+ d = new WeakMap(), n = new WeakMap(), f = new WeakMap(), h = new WeakMap(), E = new WeakMap(), u = new WeakMap(), o = new WeakSet(), y = function() {
58
60
  return e(this, d).axisAttribute.current === "x" ? e(this, h).scrollWidth : e(this, h).scrollHeight;
59
- }, L = new WeakMap(), A = new WeakMap(), b = function(i, t = !1) {
61
+ }, w = new WeakMap(), L = new WeakMap(), v = function(i, t = !1) {
60
62
  t && (e(this, h).style.transition = "all 0s", setTimeout(() => {
61
63
  e(this, h).style.transition = "";
62
64
  }));
@@ -67,16 +69,16 @@ d = new WeakMap(), n = new WeakMap(), f = new WeakMap(), h = new WeakMap(), E =
67
69
  e(this, h).style.transition = "";
68
70
  }, 50);
69
71
  };
70
- var v, g, c, T, x, I;
72
+ var b, T, c, g, A, I;
71
73
  class N extends HTMLElement {
72
74
  constructor() {
73
75
  super();
74
- l(this, x);
75
- l(this, v, new C(this, "axis", "y"));
76
- l(this, g, new C(this, "multiple", !1));
76
+ l(this, A);
77
+ l(this, b, new z(this, "axis", "y"));
78
+ l(this, T, new z(this, "multiple", !1));
77
79
  l(this, c, []);
78
- l(this, T, null);
79
- S && a(this, T, new MutationObserver((t) => {
80
+ l(this, g, null);
81
+ R && a(this, g, new MutationObserver((t) => {
80
82
  t.forEach((r) => {
81
83
  r.removedNodes.forEach((p) => {
82
84
  p instanceof HTMLElement && this.removeItem(p);
@@ -87,13 +89,13 @@ class N extends HTMLElement {
87
89
  }));
88
90
  }
89
91
  get axisAttribute() {
90
- return e(this, v);
92
+ return e(this, b);
91
93
  }
92
94
  get multipleAttribute() {
93
- return e(this, g);
95
+ return e(this, T);
94
96
  }
95
97
  createItem(t) {
96
- e(this, c).find((r) => r.element === t) || e(this, c).push(new z(this, t));
98
+ e(this, c).find((r) => r.element === t) || e(this, c).push(new S(this, t));
97
99
  }
98
100
  removeItem(t) {
99
101
  a(this, c, e(this, c).filter((r) => {
@@ -113,21 +115,21 @@ class N extends HTMLElement {
113
115
  });
114
116
  }
115
117
  connectedCallback() {
116
- e(this, v).observe(), e(this, g).observe(), e(this, T).observe(e(this, x, I), {
118
+ e(this, b).observe(), e(this, T).observe(), e(this, g).observe(e(this, A, I), {
117
119
  childList: !0
118
- }), a(this, c, [...e(this, x, I).children].map((t) => {
120
+ }), a(this, c, [...e(this, A, I).children].map((t) => {
119
121
  if (t instanceof HTMLElement)
120
- return new z(this, t);
122
+ return new S(this, t);
121
123
  }).filter((t) => !!t));
122
124
  }
123
125
  disconnectedCallback() {
124
- e(this, v).unobserve(), e(this, g).unobserve(), e(this, T).disconnect();
126
+ e(this, b).unobserve(), e(this, T).unobserve(), e(this, g).disconnect();
125
127
  }
126
128
  }
127
- v = new WeakMap(), g = new WeakMap(), c = new WeakMap(), T = new WeakMap(), x = new WeakSet(), I = function() {
129
+ b = new WeakMap(), T = new WeakMap(), c = new WeakMap(), g = new WeakMap(), A = new WeakSet(), I = function() {
128
130
  return this.shadowRoot ? this.shadowRoot : this;
129
131
  };
130
- S && !customElements.get("e-accordion") && customElements.define("e-accordion", N);
132
+ R && !customElements.get("e-accordion") && customElements.define("e-accordion", N);
131
133
  export {
132
134
  N as AccordionElement
133
135
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.46.0",
3
+ "version": "0.46.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"