aptechka 0.65.1 → 0.65.2

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