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