aptechka 0.46.0 → 0.47.0

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
  };
@@ -0,0 +1 @@
1
+ "use strict";var y=s=>{throw TypeError(s)};var f=(s,i,e)=>i.has(s)||y("Cannot "+e);var t=(s,i,e)=>(f(s,i,"read from private field"),e?e.call(s):i.get(s)),r=(s,i,e)=>i.has(s)?y("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(s):i.set(s,e),u=(s,i,e,d)=>(f(s,i,"write to private field"),d?d.call(s,e):i.set(s,e),e),I=(s,i,e)=>(f(s,i,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("../css-property/index.cjs"),g=require("../index-Cqw2NKev.cjs"),q=require("../number-0243DApo.cjs");var l,n,h,c,a,b,o,m,p,v;class E extends HTMLElement{constructor(){super(...arguments);r(this,m);r(this,l,new L.CSSProperty(this,"--delay","2s"));r(this,n);r(this,h,!1);r(this,c,[]);r(this,a,0);r(this,b,e=>{u(this,h,e.isIntersecting),t(this,h)?t(this,o).call(this):clearInterval(t(this,n))});r(this,o,()=>{clearInterval(t(this,n)),t(this,h)&&u(this,n,setInterval(t(this,v),parseFloat(t(this,l).current||"0")*1e3))});r(this,v,()=>{I(this,m,p).call(this,t(this,a)+1)})}set(e){I(this,m,p).call(this,e),t(this,o).call(this)}shift(e){this.set(t(this,a)+e)}connectedCallback(){var e;u(this,c,[...this.querySelectorAll("[data-billboard-item]")]),(e=t(this,c)[0])==null||e.classList.add("current"),t(this,l).subscribe(()=>{t(this,o).call(this)}),t(this,l).observe(),g.intersector.subscribe(this,t(this,b))}disconnectedCallback(){t(this,l).unobserve(),g.intersector.unsubscribe(t(this,b)),clearInterval(t(this,n))}}l=new WeakMap,n=new WeakMap,h=new WeakMap,c=new WeakMap,a=new WeakMap,b=new WeakMap,o=new WeakMap,m=new WeakSet,p=function(e){u(this,a,q.loopNumber(e,t(this,c).length)),t(this,c).forEach((d,S)=>{S===t(this,a)?d.classList.add("current"):d.classList.remove("current")})},v=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",E);exports.BillboardElement=E;
@@ -0,0 +1,12 @@
1
+ export declare class BillboardElement extends HTMLElement {
2
+ #private;
3
+ set(value: number): void;
4
+ shift(value: number): void;
5
+ protected connectedCallback(): void;
6
+ protected disconnectedCallback(): void;
7
+ }
8
+ declare global {
9
+ interface HTMLElementTagNameMap {
10
+ 'e-billboard': BillboardElement;
11
+ }
12
+ }
@@ -0,0 +1,58 @@
1
+ var E = (s) => {
2
+ throw TypeError(s);
3
+ };
4
+ var p = (s, i, t) => i.has(s) || E("Cannot " + t);
5
+ var e = (s, i, t) => (p(s, i, "read from private field"), t ? t.call(s) : i.get(s)), r = (s, i, t) => i.has(s) ? E("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, t), b = (s, i, t, d) => (p(s, i, "write to private field"), d ? d.call(s, t) : i.set(s, t), t), v = (s, i, t) => (p(s, i, "access private method"), t);
6
+ import { CSSProperty as y } from "../css-property/index.js";
7
+ import { a as L } from "../index-euf5anj6.js";
8
+ import { l as C } from "../number-DwCxt_Ck.js";
9
+ var l, a, c, n, h, u, o, m, I, f;
10
+ class S extends HTMLElement {
11
+ constructor() {
12
+ super(...arguments);
13
+ r(this, m);
14
+ r(this, l, new y(this, "--delay", "2s"));
15
+ r(this, a);
16
+ r(this, c, !1);
17
+ r(this, n, []);
18
+ r(this, h, 0);
19
+ r(this, u, (t) => {
20
+ b(this, c, t.isIntersecting), e(this, c) ? e(this, o).call(this) : clearInterval(e(this, a));
21
+ });
22
+ r(this, o, () => {
23
+ clearInterval(e(this, a)), e(this, c) && b(this, a, setInterval(
24
+ e(this, f),
25
+ parseFloat(e(this, l).current || "0") * 1e3
26
+ ));
27
+ });
28
+ r(this, f, () => {
29
+ v(this, m, I).call(this, e(this, h) + 1);
30
+ });
31
+ }
32
+ set(t) {
33
+ v(this, m, I).call(this, t), e(this, o).call(this);
34
+ }
35
+ shift(t) {
36
+ this.set(e(this, h) + t);
37
+ }
38
+ connectedCallback() {
39
+ var t;
40
+ b(this, n, [
41
+ ...this.querySelectorAll("[data-billboard-item]")
42
+ ]), (t = e(this, n)[0]) == null || t.classList.add("current"), e(this, l).subscribe(() => {
43
+ e(this, o).call(this);
44
+ }), e(this, l).observe(), L.subscribe(this, e(this, u));
45
+ }
46
+ disconnectedCallback() {
47
+ e(this, l).unobserve(), L.unsubscribe(e(this, u)), clearInterval(e(this, a));
48
+ }
49
+ }
50
+ l = new WeakMap(), a = new WeakMap(), c = new WeakMap(), n = new WeakMap(), h = new WeakMap(), u = new WeakMap(), o = new WeakMap(), m = new WeakSet(), I = function(t) {
51
+ b(this, h, C(t, e(this, n).length)), e(this, n).forEach((d, g) => {
52
+ g === e(this, h) ? d.classList.add("current") : d.classList.remove("current");
53
+ });
54
+ }, f = new WeakMap();
55
+ customElements.get("e-billboard") || customElements.define("e-billboard", S);
56
+ export {
57
+ S as BillboardElement
58
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.46.0",
3
+ "version": "0.47.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"
@@ -33,6 +33,11 @@
33
33
  "default": "./lib/attribute/index.js",
34
34
  "types": "./lib/attribute/index.d.ts"
35
35
  },
36
+ "./billboard": {
37
+ "require": "./lib/billboard/index.cjs",
38
+ "default": "./lib/billboard/index.js",
39
+ "types": "./lib/billboard/index.d.ts"
40
+ },
36
41
  "./canvas": {
37
42
  "require": "./lib/canvas/index.cjs",
38
43
  "default": "./lib/canvas/index.js",
@@ -245,6 +250,9 @@
245
250
  "attribute": [
246
251
  "lib/attribute/index.d.ts"
247
252
  ],
253
+ "billboard": [
254
+ "lib/billboard/index.d.ts"
255
+ ],
248
256
  "canvas": [
249
257
  "lib/canvas/index.d.ts"
250
258
  ],