aptechka 0.56.11 → 0.57.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,6 +1,6 @@
1
1
  export declare class BillboardBulletsElement extends HTMLElement {
2
2
  #private;
3
- protected connectedCallback(): void;
3
+ protected connectedCallback(): Promise<void>;
4
4
  protected disconnectedCallback(): void;
5
5
  }
6
6
  declare global {
@@ -1 +1 @@
1
- "use strict";var F=s=>{throw TypeError(s)};var _=(s,r,e)=>r.has(s)||F("Cannot "+e);var t=(s,r,e)=>(_(s,r,"read from private field"),e?e.call(s):r.get(s)),i=(s,r,e)=>r.has(s)?F("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,e),a=(s,r,e,n)=>(_(s,r,"write to private field"),n?n.call(s,e):r.set(s,e),e),d=(s,r,e)=>(_(s,r,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../index-Cqw2NKev.cjs"),z=require("../dom-JBOkFLTh.cjs"),T=require("../css-property/index.cjs"),G=require("../events-KVanG9sR.cjs"),J=require("../gestures-C7gbKx11.cjs"),K=require("../number-DyefJ5a1.cjs");var v,p,g,C,c,b,l,j,M,k,q,P,A,H;class I extends HTMLElement{constructor(){super(...arguments);i(this,l);i(this,v,new T.CSSProperty(this,"--autoplay",!1));i(this,p,new T.CSSProperty(this,"--swipe","x"));i(this,g);i(this,C,!1);i(this,c,[]);i(this,b,0);i(this,k,e=>{a(this,C,e.isIntersecting),t(this,C)?d(this,l,M).call(this):clearInterval(t(this,g))});i(this,q,()=>{clearInterval(t(this,g)),t(this,C)&&a(this,g,setInterval(t(this,A),parseFloat(t(this,v).current||"0")*1e3))});i(this,A,()=>{d(this,l,P).call(this,t(this,b)+1)});i(this,H,e=>{if(!t(this,p).current)return;let n=0;J.setupDrag(h=>{const E=e.x-h.x,D=e.y-h.y;t(this,p).current==="x"?Math.abs(E)>Math.abs(D)&&(n=Math.sign(E)):t(this,p).current==="y"&&Math.abs(D)>Math.abs(E)&&(n=Math.sign(D))},()=>{this.shift(n)})})}get counter(){return t(this,b)}get itemElements(){return t(this,c)}addItem(e){t(this,c).push(e),d(this,l,j).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(d(this,l,P).call(this,e),d(this,l,M).call(this))}shift(e){this.set(t(this,b)+e)}connectedCallback(){var e;a(this,c,[...this.querySelectorAll(`[data-billboard-item="${this.id||""}"]`)]),(e=t(this,c)[0])==null||e.classList.add("current"),d(this,l,j).call(this),t(this,v).subscribe(n=>{n.current?(x.intersector.subscribe(this,t(this,k)),d(this,l,M).call(this)):(a(this,C,!0),x.intersector.unsubscribe(t(this,k)),clearInterval(t(this,g)),d(this,l,P).call(this,0))}),t(this,v).observe(),t(this,p).observe(),this.addEventListener("pointerdown",t(this,H))}disconnectedCallback(){t(this,v).unobserve(),t(this,p).unobserve(),x.intersector.unsubscribe(t(this,k)),clearInterval(t(this,g))}}v=new WeakMap,p=new WeakMap,g=new WeakMap,C=new WeakMap,c=new WeakMap,b=new WeakMap,l=new WeakSet,j=function(){t(this,c).length>1?this.classList.add("has-length"):this.classList.remove("has-length")},M=function(){t(this,v).current!==!1&&t(this,q).call(this)},k=new WeakMap,q=new WeakMap,P=function(e){a(this,b,K.loopNumber(e,t(this,c).length)),t(this,c).forEach((n,h)=>{h===t(this,b)?n.classList.add("current"):n.classList.remove("current")}),G.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,b)}}),setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0)},A=new WeakMap,H=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",I);var o,u,y,S;class N extends HTMLElement{constructor(){super(...arguments);i(this,o,null);i(this,u,[]);i(this,y,e=>{const n=e.currentTarget,h=t(this,u).findIndex(E=>E===n);h>=0&&t(this,o).set(h)});i(this,S,()=>{t(this,u).forEach((e,n)=>{n===t(this,o).counter?e.classList.add("current"):e.classList.remove("current")})})}connectedCallback(){a(this,o,z.findParentElement(this,I)),t(this,o)&&customElements.whenDefined("e-billboard").then(()=>{var e;if(this.isConnected){const n=t(this,o).itemElements.length;for(let h=0;h<n;h++){const E=document.createElement("button");t(this,u).push(E),this.appendChild(E)}t(this,u).forEach(h=>{h.addEventListener("click",t(this,y))}),(e=t(this,o))==null||e.addEventListener("billboardChange",t(this,S)),t(this,S).call(this)}})}disconnectedCallback(){var e;t(this,u).forEach(n=>{n.removeEventListener("click",t(this,y))}),(e=t(this,o))==null||e.removeEventListener("billboardChange",t(this,S)),this.innerHTML="",a(this,u,[])}}o=new WeakMap,u=new WeakMap,y=new WeakMap,S=new WeakMap;x.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",N);var m,f,L;class O extends HTMLElement{constructor(){super();i(this,m,new T.CSSProperty(this,"--index",0));i(this,f,null);i(this,L,()=>{var e;t(this,m).current===((e=t(this,f))==null?void 0:e.counter)?this.classList.add("current"):this.classList.remove("current")});this.addEventListener("click",e=>{t(this,f)&&(!this.handleClick||this.handleClick(e))&&t(this,f).set(t(this,m).current)})}connectedCallback(){var e;this.tabIndex=0,a(this,f,z.findParentElement(this,I)),(e=t(this,f))==null||e.addEventListener("billboardChange",t(this,L)),customElements.whenDefined("e-billboard").then(()=>{this.isConnected&&t(this,L).call(this)}),t(this,m).subscribe(t(this,L)),t(this,m).observe()}disconnectedCallback(){var e;this.removeAttribute("tabindex"),t(this,m).unsubscribe(t(this,L)),t(this,m).unobserve(),(e=t(this,f))==null||e.removeEventListener("billboardChange",t(this,L))}}m=new WeakMap,f=new WeakMap,L=new WeakMap;x.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",O);var w,B;class $ extends HTMLElement{constructor(){super();i(this,w,new T.CSSProperty(this,"--step",1));i(this,B,null);this.addEventListener("click",e=>{t(this,B)&&(!this.handleClick||this.handleClick(e))&&t(this,B).shift(t(this,w).current)})}connectedCallback(){this.tabIndex=0,a(this,B,z.findParentElement(this,I)),t(this,w).observe()}disconnectedCallback(){this.removeAttribute("tabindex"),t(this,w).unobserve()}}w=new WeakMap,B=new WeakMap;x.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",$);exports.BillboardBulletsElement=N;exports.BillboardElement=I;exports.BillboardSetButtonElement=O;exports.BillboardStepButtonElement=$;
1
+ "use strict";var J=s=>{throw TypeError(s)};var O=(s,r,e)=>r.has(s)||J("Cannot "+e);var t=(s,r,e)=>(O(s,r,"read from private field"),e?e.call(s):r.get(s)),n=(s,r,e)=>r.has(s)?J("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,e),a=(s,r,e,i)=>(O(s,r,"write to private field"),i?i.call(s,e):r.set(s,e),e),b=(s,r,e)=>(O(s,r,"access private method"),e);var K=(s,r,e)=>new Promise((i,l)=>{var d=C=>{try{F(e.next(C))}catch(N){l(N)}},M=C=>{try{F(e.throw(C))}catch(N){l(N)}},F=C=>C.done?i(C.value):Promise.resolve(C.value).then(d,M);F((e=e.apply(s,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../index-Cqw2NKev.cjs"),G=require("../dom-JBOkFLTh.cjs"),P=require("../css-property/index.cjs"),V=require("../events-KVanG9sR.cjs"),W=require("../gestures-C7gbKx11.cjs"),X=require("../math-GDWEqu7y.cjs"),Y=require("../number-DyefJ5a1.cjs");var D,p,v,L,x,o,c,h,$,A,k,_,H,j,z;class T extends HTMLElement{constructor(){super(...arguments);n(this,h);n(this,D,new P.CSSProperty(this,"--loop",!0));n(this,p,new P.CSSProperty(this,"--autoplay",!1));n(this,v,new P.CSSProperty(this,"--swipe","x"));n(this,L);n(this,x,!1);n(this,o,[]);n(this,c,0);n(this,k,e=>{a(this,x,e.isIntersecting),t(this,x)?b(this,h,A).call(this):clearInterval(t(this,L))});n(this,_,()=>{clearInterval(t(this,L)),t(this,x)&&a(this,L,setInterval(t(this,j),parseFloat(t(this,p).current||"0")*1e3))});n(this,j,()=>{b(this,h,H).call(this,t(this,c)+1)});n(this,z,e=>{if(!t(this,v).current)return;let i=0;W.setupDrag(l=>{const d=e.x-l.x,M=e.y-l.y;t(this,v).current==="x"?Math.abs(d)>Math.abs(M)&&(i=Math.sign(d)):t(this,v).current==="y"&&Math.abs(M)>Math.abs(d)&&(i=Math.sign(M))},()=>{this.shift(i)})})}get counter(){return t(this,c)}get itemElements(){return t(this,o)}addItem(e){t(this,o).push(e),b(this,h,$).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(b(this,h,H).call(this,e),b(this,h,A).call(this))}shift(e){this.set(t(this,c)+e)}connectedCallback(){var e;a(this,o,[...this.querySelectorAll(`[data-billboard-item="${this.id||""}"]`)]),(e=t(this,o)[0])==null||e.classList.add("current"),b(this,h,$).call(this),t(this,p).subscribe(i=>{i.current?(S.intersector.subscribe(this,t(this,k)),b(this,h,A).call(this)):(a(this,x,!0),S.intersector.unsubscribe(t(this,k)),clearInterval(t(this,L)),b(this,h,H).call(this,0))}),t(this,p).observe(),t(this,v).observe(),this.addEventListener("pointerdown",t(this,z))}disconnectedCallback(){t(this,p).unobserve(),t(this,v).unobserve(),S.intersector.unsubscribe(t(this,k)),clearInterval(t(this,L))}}D=new WeakMap,p=new WeakMap,v=new WeakMap,L=new WeakMap,x=new WeakMap,o=new WeakMap,c=new WeakMap,h=new WeakSet,$=function(){t(this,o).length>1?this.classList.add("has-length"):this.classList.remove("has-length")},A=function(){t(this,p).current!==!1&&t(this,_).call(this)},k=new WeakMap,_=new WeakMap,H=function(e){t(this,D).current?a(this,c,Y.loopNumber(e,t(this,o).length)):a(this,c,X.clamp(e,0,t(this,o).length-1)),t(this,o).forEach((i,l)=>{i.classList.remove("current","previous","next"),l===t(this,c)?i.classList.add("current"):l<t(this,c)?i.classList.add("previous"):l>t(this,c)&&i.classList.add("next")}),V.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,c)}}),setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0)},j=new WeakMap,z=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",T);var u,w,m,q,y;class Q extends HTMLElement{constructor(){super(...arguments);n(this,u,null);n(this,w,null);n(this,m,[]);n(this,q,e=>{const i=e.currentTarget,l=t(this,m).findIndex(d=>d===i);l>=0&&t(this,u).set(l)});n(this,y,()=>{t(this,m).forEach((e,i)=>{i===t(this,u).counter?e.classList.add("current"):e.classList.remove("current")})})}connectedCallback(){return K(this,null,function*(){var e;if(a(this,u,G.findParentElement(this,T)),t(this,u)&&(yield customElements.whenDefined("e-billboard"),this.isConnected)){const i=t(this,u).itemElements.length;a(this,w,document.createElement("div"));for(let l=0;l<i;l++){const d=document.createElement("button");t(this,m).push(d),t(this,w).appendChild(d)}this.appendChild(t(this,w)),t(this,m).forEach(l=>{l.addEventListener("click",t(this,q))}),(e=t(this,u))==null||e.addEventListener("billboardChange",t(this,y)),t(this,y).call(this)}})}disconnectedCallback(){var e;t(this,m).forEach(i=>{i.removeEventListener("click",t(this,q))}),(e=t(this,u))==null||e.removeEventListener("billboardChange",t(this,y)),this.innerHTML="",a(this,m,[])}}u=new WeakMap,w=new WeakMap,m=new WeakMap,q=new WeakMap,y=new WeakMap;S.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",Q);var f,E,g;class R extends HTMLElement{constructor(){super();n(this,f,new P.CSSProperty(this,"--index",0));n(this,E,null);n(this,g,()=>{var e;t(this,f).current===((e=t(this,E))==null?void 0:e.counter)?this.classList.add("current"):this.classList.remove("current")});this.addEventListener("click",e=>{t(this,E)&&(!this.handleClick||this.handleClick(e))&&t(this,E).set(t(this,f).current)})}connectedCallback(){var e;this.tabIndex=0,a(this,E,G.findParentElement(this,T)),(e=t(this,E))==null||e.addEventListener("billboardChange",t(this,g)),customElements.whenDefined("e-billboard").then(()=>{this.isConnected&&t(this,g).call(this)}),t(this,f).subscribe(t(this,g)),t(this,f).observe()}disconnectedCallback(){var e;this.removeAttribute("tabindex"),t(this,f).unsubscribe(t(this,g)),t(this,f).unobserve(),(e=t(this,E))==null||e.removeEventListener("billboardChange",t(this,g))}}f=new WeakMap,E=new WeakMap,g=new WeakMap;S.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",R);var B,I;class U extends HTMLElement{constructor(){super();n(this,B,new P.CSSProperty(this,"--step",1));n(this,I,null);this.addEventListener("click",e=>{t(this,I)&&(!this.handleClick||this.handleClick(e))&&t(this,I).shift(t(this,B).current)})}connectedCallback(){this.tabIndex=0,a(this,I,G.findParentElement(this,T)),t(this,B).observe()}disconnectedCallback(){this.removeAttribute("tabindex"),t(this,B).unobserve()}}B=new WeakMap,I=new WeakMap;S.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",U);exports.BillboardBulletsElement=Q;exports.BillboardElement=T;exports.BillboardSetButtonElement=R;exports.BillboardStepButtonElement=U;
@@ -1,198 +1,218 @@
1
- var j = (s) => {
1
+ var Q = (s) => {
2
2
  throw TypeError(s);
3
3
  };
4
- var q = (s, l, e) => l.has(s) || j("Cannot " + e);
5
- var t = (s, l, e) => (q(s, l, "read from private field"), e ? e.call(s) : l.get(s)), i = (s, l, e) => l.has(s) ? j("Cannot add the same private member more than once") : l instanceof WeakSet ? l.add(s) : l.set(s, e), a = (s, l, e, n) => (q(s, l, "write to private field"), n ? n.call(s, e) : l.set(s, e), e), d = (s, l, e) => (q(s, l, "access private method"), e);
6
- import { a as z, i as N } from "../index-euf5anj6.js";
7
- import { b as $ } from "../dom-CVWzyXPH.js";
4
+ var j = (s, l, e) => l.has(s) || Q("Cannot " + e);
5
+ var t = (s, l, e) => (j(s, l, "read from private field"), e ? e.call(s) : l.get(s)), n = (s, l, e) => l.has(s) ? Q("Cannot add the same private member more than once") : l instanceof WeakSet ? l.add(s) : l.set(s, e), a = (s, l, e, i) => (j(s, l, "write to private field"), i ? i.call(s, e) : l.set(s, e), e), u = (s, l, e) => (j(s, l, "access private method"), e);
6
+ var R = (s, l, e) => new Promise((i, r) => {
7
+ var d = (C) => {
8
+ try {
9
+ N(e.next(C));
10
+ } catch ($) {
11
+ r($);
12
+ }
13
+ }, B = (C) => {
14
+ try {
15
+ N(e.throw(C));
16
+ } catch ($) {
17
+ r($);
18
+ }
19
+ }, N = (C) => C.done ? i(C.value) : Promise.resolve(C.value).then(d, B);
20
+ N((e = e.apply(s, l)).next());
21
+ });
22
+ import { a as G, i as K } from "../index-euf5anj6.js";
23
+ import { b as O } from "../dom-CVWzyXPH.js";
8
24
  import { CSSProperty as S } from "../css-property/index.js";
9
- import { d as G } from "../events-CsVF98U6.js";
10
- import { s as J } from "../gestures-CcXV6fCp.js";
11
- import { l as K } from "../number-CbdpfO3u.js";
12
- var p, v, L, C, c, b, r, F, y, k, T, B, A, H;
13
- class D extends HTMLElement {
25
+ import { d as U } from "../events-CsVF98U6.js";
26
+ import { s as V } from "../gestures-CcXV6fCp.js";
27
+ import { c as W } from "../math-BOBiC4TN.js";
28
+ import { l as X } from "../number-CbdpfO3u.js";
29
+ var D, E, v, L, x, o, c, h, J, A, k, P, H, q, z;
30
+ class F extends HTMLElement {
14
31
  constructor() {
15
32
  super(...arguments);
16
- i(this, r);
17
- i(this, p, new S(this, "--autoplay", !1));
18
- i(this, v, new S(this, "--swipe", "x"));
19
- i(this, L);
20
- i(this, C, !1);
21
- i(this, c, []);
22
- i(this, b, 0);
23
- i(this, k, (e) => {
24
- a(this, C, e.isIntersecting), t(this, C) ? d(this, r, y).call(this) : clearInterval(t(this, L));
33
+ n(this, h);
34
+ n(this, D, new S(this, "--loop", !0));
35
+ n(this, E, new S(this, "--autoplay", !1));
36
+ n(this, v, new S(this, "--swipe", "x"));
37
+ n(this, L);
38
+ n(this, x, !1);
39
+ n(this, o, []);
40
+ n(this, c, 0);
41
+ n(this, k, (e) => {
42
+ a(this, x, e.isIntersecting), t(this, x) ? u(this, h, A).call(this) : clearInterval(t(this, L));
25
43
  });
26
- i(this, T, () => {
27
- clearInterval(t(this, L)), t(this, C) && a(this, L, setInterval(
28
- t(this, A),
29
- parseFloat(t(this, p).current || "0") * 1e3
44
+ n(this, P, () => {
45
+ clearInterval(t(this, L)), t(this, x) && a(this, L, setInterval(
46
+ t(this, q),
47
+ parseFloat(t(this, E).current || "0") * 1e3
30
48
  ));
31
49
  });
32
- i(this, A, () => {
33
- d(this, r, B).call(this, t(this, b) + 1);
50
+ n(this, q, () => {
51
+ u(this, h, H).call(this, t(this, c) + 1);
34
52
  });
35
- i(this, H, (e) => {
53
+ n(this, z, (e) => {
36
54
  if (!t(this, v).current)
37
55
  return;
38
- let n = 0;
39
- J(
40
- (h) => {
41
- const E = e.x - h.x, P = e.y - h.y;
42
- t(this, v).current === "x" ? Math.abs(E) > Math.abs(P) && (n = Math.sign(E)) : t(this, v).current === "y" && Math.abs(P) > Math.abs(E) && (n = Math.sign(P));
56
+ let i = 0;
57
+ V(
58
+ (r) => {
59
+ const d = e.x - r.x, B = e.y - r.y;
60
+ t(this, v).current === "x" ? Math.abs(d) > Math.abs(B) && (i = Math.sign(d)) : t(this, v).current === "y" && Math.abs(B) > Math.abs(d) && (i = Math.sign(B));
43
61
  },
44
62
  () => {
45
- this.shift(n);
63
+ this.shift(i);
46
64
  }
47
65
  );
48
66
  });
49
67
  }
50
68
  get counter() {
51
- return t(this, b);
69
+ return t(this, c);
52
70
  }
53
71
  get itemElements() {
54
- return t(this, c);
72
+ return t(this, o);
55
73
  }
56
74
  addItem(e) {
57
- t(this, c).push(e), d(this, r, F).call(this);
75
+ t(this, o).push(e), u(this, h, J).call(this);
58
76
  }
59
77
  set(e) {
60
- (!this.handleSet || this.handleSet(e)) && (d(this, r, B).call(this, e), d(this, r, y).call(this));
78
+ (!this.handleSet || this.handleSet(e)) && (u(this, h, H).call(this, e), u(this, h, A).call(this));
61
79
  }
62
80
  shift(e) {
63
- this.set(t(this, b) + e);
81
+ this.set(t(this, c) + e);
64
82
  }
65
83
  connectedCallback() {
66
84
  var e;
67
- a(this, c, [
85
+ a(this, o, [
68
86
  ...this.querySelectorAll(
69
87
  `[data-billboard-item="${this.id || ""}"]`
70
88
  )
71
- ]), (e = t(this, c)[0]) == null || e.classList.add("current"), d(this, r, F).call(this), t(this, p).subscribe((n) => {
72
- n.current ? (z.subscribe(this, t(this, k)), d(this, r, y).call(this)) : (a(this, C, !0), z.unsubscribe(t(this, k)), clearInterval(t(this, L)), d(this, r, B).call(this, 0));
73
- }), t(this, p).observe(), t(this, v).observe(), this.addEventListener("pointerdown", t(this, H));
89
+ ]), (e = t(this, o)[0]) == null || e.classList.add("current"), u(this, h, J).call(this), t(this, E).subscribe((i) => {
90
+ i.current ? (G.subscribe(this, t(this, k)), u(this, h, A).call(this)) : (a(this, x, !0), G.unsubscribe(t(this, k)), clearInterval(t(this, L)), u(this, h, H).call(this, 0));
91
+ }), t(this, E).observe(), t(this, v).observe(), this.addEventListener("pointerdown", t(this, z));
74
92
  }
75
93
  disconnectedCallback() {
76
- t(this, p).unobserve(), t(this, v).unobserve(), z.unsubscribe(t(this, k)), clearInterval(t(this, L));
94
+ t(this, E).unobserve(), t(this, v).unobserve(), G.unsubscribe(t(this, k)), clearInterval(t(this, L));
77
95
  }
78
96
  }
79
- p = new WeakMap(), v = new WeakMap(), L = new WeakMap(), C = new WeakMap(), c = new WeakMap(), b = new WeakMap(), r = new WeakSet(), F = function() {
80
- t(this, c).length > 1 ? this.classList.add("has-length") : this.classList.remove("has-length");
81
- }, y = function() {
82
- t(this, p).current !== !1 && t(this, T).call(this);
83
- }, k = new WeakMap(), T = new WeakMap(), B = function(e) {
84
- a(this, b, K(e, t(this, c).length)), t(this, c).forEach((n, h) => {
85
- h === t(this, b) ? n.classList.add("current") : n.classList.remove("current");
86
- }), G(this, "billboardChange", {
97
+ D = new WeakMap(), E = new WeakMap(), v = new WeakMap(), L = new WeakMap(), x = new WeakMap(), o = new WeakMap(), c = new WeakMap(), h = new WeakSet(), J = function() {
98
+ t(this, o).length > 1 ? this.classList.add("has-length") : this.classList.remove("has-length");
99
+ }, A = function() {
100
+ t(this, E).current !== !1 && t(this, P).call(this);
101
+ }, k = new WeakMap(), P = new WeakMap(), H = function(e) {
102
+ t(this, D).current ? a(this, c, X(e, t(this, o).length)) : a(this, c, W(e, 0, t(this, o).length - 1)), t(this, o).forEach((i, r) => {
103
+ i.classList.remove("current", "previous", "next"), r === t(this, c) ? i.classList.add("current") : r < t(this, c) ? i.classList.add("previous") : r > t(this, c) && i.classList.add("next");
104
+ }), U(this, "billboardChange", {
87
105
  detail: {
88
- counter: t(this, b)
106
+ counter: t(this, c)
89
107
  }
90
108
  }), setTimeout(() => {
91
109
  window.dispatchEvent(new Event("resize"));
92
110
  }, 0);
93
- }, A = new WeakMap(), H = new WeakMap();
94
- customElements.get("e-billboard") || customElements.define("e-billboard", D);
95
- var o, u, M, x;
96
- class O extends HTMLElement {
111
+ }, q = new WeakMap(), z = new WeakMap();
112
+ customElements.get("e-billboard") || customElements.define("e-billboard", F);
113
+ var b, w, m, T, I;
114
+ class Y extends HTMLElement {
97
115
  constructor() {
98
116
  super(...arguments);
99
- i(this, o, null);
100
- i(this, u, []);
101
- i(this, M, (e) => {
102
- const n = e.currentTarget, h = t(this, u).findIndex((E) => E === n);
103
- h >= 0 && t(this, o).set(h);
117
+ n(this, b, null);
118
+ n(this, w, null);
119
+ n(this, m, []);
120
+ n(this, T, (e) => {
121
+ const i = e.currentTarget, r = t(this, m).findIndex((d) => d === i);
122
+ r >= 0 && t(this, b).set(r);
104
123
  });
105
- i(this, x, () => {
106
- t(this, u).forEach((e, n) => {
107
- n === t(this, o).counter ? e.classList.add("current") : e.classList.remove("current");
124
+ n(this, I, () => {
125
+ t(this, m).forEach((e, i) => {
126
+ i === t(this, b).counter ? e.classList.add("current") : e.classList.remove("current");
108
127
  });
109
128
  });
110
129
  }
111
130
  connectedCallback() {
112
- a(this, o, $(this, D)), t(this, o) && customElements.whenDefined("e-billboard").then(() => {
131
+ return R(this, null, function* () {
113
132
  var e;
114
- if (this.isConnected) {
115
- const n = t(this, o).itemElements.length;
116
- for (let h = 0; h < n; h++) {
117
- const E = document.createElement("button");
118
- t(this, u).push(E), this.appendChild(E);
133
+ if (a(this, b, O(this, F)), t(this, b) && (yield customElements.whenDefined("e-billboard"), this.isConnected)) {
134
+ const i = t(this, b).itemElements.length;
135
+ a(this, w, document.createElement("div"));
136
+ for (let r = 0; r < i; r++) {
137
+ const d = document.createElement("button");
138
+ t(this, m).push(d), t(this, w).appendChild(d);
119
139
  }
120
- t(this, u).forEach((h) => {
121
- h.addEventListener("click", t(this, M));
122
- }), (e = t(this, o)) == null || e.addEventListener(
140
+ this.appendChild(t(this, w)), t(this, m).forEach((r) => {
141
+ r.addEventListener("click", t(this, T));
142
+ }), (e = t(this, b)) == null || e.addEventListener(
123
143
  "billboardChange",
124
- t(this, x)
125
- ), t(this, x).call(this);
144
+ t(this, I)
145
+ ), t(this, I).call(this);
126
146
  }
127
147
  });
128
148
  }
129
149
  disconnectedCallback() {
130
150
  var e;
131
- t(this, u).forEach((n) => {
132
- n.removeEventListener("click", t(this, M));
133
- }), (e = t(this, o)) == null || e.removeEventListener(
151
+ t(this, m).forEach((i) => {
152
+ i.removeEventListener("click", t(this, T));
153
+ }), (e = t(this, b)) == null || e.removeEventListener(
134
154
  "billboardChange",
135
- t(this, x)
136
- ), this.innerHTML = "", a(this, u, []);
155
+ t(this, I)
156
+ ), this.innerHTML = "", a(this, m, []);
137
157
  }
138
158
  }
139
- o = new WeakMap(), u = new WeakMap(), M = new WeakMap(), x = new WeakMap();
140
- N && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", O);
141
- var m, f, g;
142
- class Q extends HTMLElement {
159
+ b = new WeakMap(), w = new WeakMap(), m = new WeakMap(), T = new WeakMap(), I = new WeakMap();
160
+ K && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", Y);
161
+ var f, p, g;
162
+ class Z extends HTMLElement {
143
163
  constructor() {
144
164
  super();
145
- i(this, m, new S(this, "--index", 0));
146
- i(this, f, null);
147
- i(this, g, () => {
165
+ n(this, f, new S(this, "--index", 0));
166
+ n(this, p, null);
167
+ n(this, g, () => {
148
168
  var e;
149
- t(this, m).current === ((e = t(this, f)) == null ? void 0 : e.counter) ? this.classList.add("current") : this.classList.remove("current");
169
+ t(this, f).current === ((e = t(this, p)) == null ? void 0 : e.counter) ? this.classList.add("current") : this.classList.remove("current");
150
170
  });
151
171
  this.addEventListener("click", (e) => {
152
- t(this, f) && (!this.handleClick || this.handleClick(e)) && t(this, f).set(t(this, m).current);
172
+ t(this, p) && (!this.handleClick || this.handleClick(e)) && t(this, p).set(t(this, f).current);
153
173
  });
154
174
  }
155
175
  connectedCallback() {
156
176
  var e;
157
- this.tabIndex = 0, a(this, f, $(this, D)), (e = t(this, f)) == null || e.addEventListener(
177
+ this.tabIndex = 0, a(this, p, O(this, F)), (e = t(this, p)) == null || e.addEventListener(
158
178
  "billboardChange",
159
179
  t(this, g)
160
180
  ), customElements.whenDefined("e-billboard").then(() => {
161
181
  this.isConnected && t(this, g).call(this);
162
- }), t(this, m).subscribe(t(this, g)), t(this, m).observe();
182
+ }), t(this, f).subscribe(t(this, g)), t(this, f).observe();
163
183
  }
164
184
  disconnectedCallback() {
165
185
  var e;
166
- this.removeAttribute("tabindex"), t(this, m).unsubscribe(t(this, g)), t(this, m).unobserve(), (e = t(this, f)) == null || e.removeEventListener(
186
+ this.removeAttribute("tabindex"), t(this, f).unsubscribe(t(this, g)), t(this, f).unobserve(), (e = t(this, p)) == null || e.removeEventListener(
167
187
  "billboardChange",
168
188
  t(this, g)
169
189
  );
170
190
  }
171
191
  }
172
- m = new WeakMap(), f = new WeakMap(), g = new WeakMap();
173
- N && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button", Q);
174
- var w, I;
175
- class R extends HTMLElement {
192
+ f = new WeakMap(), p = new WeakMap(), g = new WeakMap();
193
+ K && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button", Z);
194
+ var y, M;
195
+ class _ extends HTMLElement {
176
196
  constructor() {
177
197
  super();
178
- i(this, w, new S(this, "--step", 1));
179
- i(this, I, null);
198
+ n(this, y, new S(this, "--step", 1));
199
+ n(this, M, null);
180
200
  this.addEventListener("click", (e) => {
181
- t(this, I) && (!this.handleClick || this.handleClick(e)) && t(this, I).shift(t(this, w).current);
201
+ t(this, M) && (!this.handleClick || this.handleClick(e)) && t(this, M).shift(t(this, y).current);
182
202
  });
183
203
  }
184
204
  connectedCallback() {
185
- this.tabIndex = 0, a(this, I, $(this, D)), t(this, w).observe();
205
+ this.tabIndex = 0, a(this, M, O(this, F)), t(this, y).observe();
186
206
  }
187
207
  disconnectedCallback() {
188
- this.removeAttribute("tabindex"), t(this, w).unobserve();
208
+ this.removeAttribute("tabindex"), t(this, y).unobserve();
189
209
  }
190
210
  }
191
- w = new WeakMap(), I = new WeakMap();
192
- N && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", R);
211
+ y = new WeakMap(), M = new WeakMap();
212
+ K && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", _);
193
213
  export {
194
- O as BillboardBulletsElement,
195
- D as BillboardElement,
196
- Q as BillboardSetButtonElement,
197
- R as BillboardStepButtonElement
214
+ Y as BillboardBulletsElement,
215
+ F as BillboardElement,
216
+ Z as BillboardSetButtonElement,
217
+ _ as BillboardStepButtonElement
198
218
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.56.11",
3
+ "version": "0.57.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"