aptechka 0.65.1 → 0.65.3

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