aptechka 0.47.4 → 0.47.5

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.
@@ -7,6 +7,7 @@ export declare class BillboardElement extends HTMLElement {
7
7
  #private;
8
8
  get counter(): number;
9
9
  get itemElements(): HTMLElement[];
10
+ addItem(element: HTMLElement): void;
10
11
  set(value: number): void;
11
12
  shift(value: number): void;
12
13
  protected connectedCallback(): void;
@@ -1 +1 @@
1
- "use strict";var P=s=>{throw TypeError(s)};var w=(s,i,t)=>i.has(s)||P("Cannot "+t);var e=(s,i,t)=>(w(s,i,"read from private field"),t?t.call(s):i.get(s)),n=(s,i,t)=>i.has(s)?P("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(s):i.set(s,t),h=(s,i,t,r)=>(w(s,i,"write to private field"),r?r.call(s,t):i.set(s,t),t),E=(s,i,t)=>(w(s,i,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("../index-Cqw2NKev.cjs"),T=require("../dom-JBOkFLTh.cjs"),M=require("../css-property/index.cjs"),_=require("../events-KVanG9sR.cjs"),j=require("../number-0243DApo.cjs");var b,u,f,m,a,c,I,v,y,x,S;class q extends HTMLElement{constructor(){super(...arguments);n(this,c);n(this,b,new M.CSSProperty(this,"--autoplay",!1));n(this,u);n(this,f,!1);n(this,m,[]);n(this,a,0);n(this,v,t=>{h(this,f,t.isIntersecting),e(this,f)?E(this,c,I).call(this):clearInterval(e(this,u))});n(this,y,()=>{clearInterval(e(this,u)),e(this,f)&&h(this,u,setInterval(e(this,S),parseFloat(e(this,b).current||"0")*1e3))});n(this,S,()=>{E(this,c,x).call(this,e(this,a)+1)})}get counter(){return e(this,a)}get itemElements(){return e(this,m)}set(t){E(this,c,x).call(this,t),E(this,c,I).call(this)}shift(t){this.set(e(this,a)+t)}connectedCallback(){var t;h(this,m,[...this.querySelectorAll("[data-billboard-item]")]),(t=e(this,m)[0])==null||t.classList.add("current"),e(this,b).subscribe(r=>{r.current?(C.intersector.subscribe(this,e(this,v)),E(this,c,I).call(this)):(h(this,f,!0),C.intersector.unsubscribe(e(this,v)),clearInterval(e(this,u)),E(this,c,x).call(this,0))}),e(this,b).observe()}disconnectedCallback(){e(this,b).unobserve(),C.intersector.unsubscribe(e(this,v)),clearInterval(e(this,u))}}b=new WeakMap,u=new WeakMap,f=new WeakMap,m=new WeakMap,a=new WeakMap,c=new WeakSet,I=function(){e(this,b).current!==!1&&e(this,y).call(this)},v=new WeakMap,y=new WeakMap,x=function(t){h(this,a,j.loopNumber(t,e(this,m).length)),e(this,m).forEach((r,o)=>{o===e(this,a)?r.classList.add("current"):r.classList.remove("current")}),_.dispatchEvent(this,"billboardChange",{detail:{counter:e(this,a)}})},S=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",q);var l,d,B,p;class A extends HTMLElement{constructor(){super(...arguments);n(this,l,null);n(this,d,[]);n(this,B,t=>{const r=t.currentTarget,o=e(this,d).findIndex(k=>k===r);o>=0&&e(this,l).set(o)});n(this,p,()=>{e(this,d).forEach((t,r)=>{r===e(this,l).counter?t.classList.add("current"):t.classList.remove("current")})})}connectedCallback(){h(this,l,T.findParentElement(this,q)),e(this,l)&&customElements.whenDefined("e-billboard").then(()=>{var t;if(this.isConnected){const r=e(this,l).itemElements.length;for(let o=0;o<r;o++){const k=document.createElement("button");e(this,d).push(k),this.appendChild(k)}e(this,d).forEach(o=>{o.addEventListener("click",e(this,B))}),(t=e(this,l))==null||t.addEventListener("billboardChange",e(this,p)),e(this,p).call(this)}})}disconnectedCallback(){var t;e(this,d).forEach(r=>{r.removeEventListener("click",e(this,B))}),(t=e(this,l))==null||t.removeEventListener("billboardChange",e(this,p)),this.innerHTML="",h(this,d,[])}}l=new WeakMap,d=new WeakMap,B=new WeakMap,p=new WeakMap;C.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",A);var g,L;class H extends HTMLElement{constructor(){super();n(this,g,new M.CSSProperty(this,"--step",1));n(this,L,null);this.addEventListener("click",()=>{e(this,L)&&e(this,L).shift(e(this,g).current)})}connectedCallback(){this.tabIndex=0,h(this,L,T.findParentElement(this,q)),e(this,g).observe()}disconnectedCallback(){this.removeAttribute("tabindex"),e(this,g).unobserve()}}g=new WeakMap,L=new WeakMap;C.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",H);exports.BillboardBulletsElement=A;exports.BillboardElement=q;exports.BillboardStepButtonElement=H;
1
+ "use strict";var T=s=>{throw TypeError(s)};var w=(s,i,t)=>i.has(s)||T("Cannot "+t);var e=(s,i,t)=>(w(s,i,"read from private field"),t?t.call(s):i.get(s)),n=(s,i,t)=>i.has(s)?T("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(s):i.set(s,t),o=(s,i,t,l)=>(w(s,i,"write to private field"),l?l.call(s,t):i.set(s,t),t),d=(s,i,t)=>(w(s,i,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("../index-Cqw2NKev.cjs"),M=require("../dom-JBOkFLTh.cjs"),A=require("../css-property/index.cjs"),j=require("../events-KVanG9sR.cjs"),D=require("../number-0243DApo.cjs");var m,E,f,h,u,r,P,I,v,y,x,S;class q extends HTMLElement{constructor(){super(...arguments);n(this,r);n(this,m,new A.CSSProperty(this,"--autoplay",!1));n(this,E);n(this,f,!1);n(this,h,[]);n(this,u,0);n(this,v,t=>{o(this,f,t.isIntersecting),e(this,f)?d(this,r,I).call(this):clearInterval(e(this,E))});n(this,y,()=>{clearInterval(e(this,E)),e(this,f)&&o(this,E,setInterval(e(this,S),parseFloat(e(this,m).current||"0")*1e3))});n(this,S,()=>{d(this,r,x).call(this,e(this,u)+1)})}get counter(){return e(this,u)}get itemElements(){return e(this,h)}addItem(t){e(this,h).push(t),d(this,r,P).call(this)}set(t){d(this,r,x).call(this,t),d(this,r,I).call(this)}shift(t){this.set(e(this,u)+t)}connectedCallback(){var t;o(this,h,[...this.querySelectorAll("[data-billboard-item]")]),(t=e(this,h)[0])==null||t.classList.add("current"),d(this,r,P).call(this),e(this,m).subscribe(l=>{l.current?(C.intersector.subscribe(this,e(this,v)),d(this,r,I).call(this)):(o(this,f,!0),C.intersector.unsubscribe(e(this,v)),clearInterval(e(this,E)),d(this,r,x).call(this,0))}),e(this,m).observe()}disconnectedCallback(){e(this,m).unobserve(),C.intersector.unsubscribe(e(this,v)),clearInterval(e(this,E))}}m=new WeakMap,E=new WeakMap,f=new WeakMap,h=new WeakMap,u=new WeakMap,r=new WeakSet,P=function(){e(this,h).length>1?this.classList.add("has-length"):this.classList.remove("has-length")},I=function(){e(this,m).current!==!1&&e(this,y).call(this)},v=new WeakMap,y=new WeakMap,x=function(t){o(this,u,D.loopNumber(t,e(this,h).length)),e(this,h).forEach((l,a)=>{a===e(this,u)?l.classList.add("current"):l.classList.remove("current")}),j.dispatchEvent(this,"billboardChange",{detail:{counter:e(this,u)}})},S=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",q);var c,b,k,p;class H extends HTMLElement{constructor(){super(...arguments);n(this,c,null);n(this,b,[]);n(this,k,t=>{const l=t.currentTarget,a=e(this,b).findIndex(B=>B===l);a>=0&&e(this,c).set(a)});n(this,p,()=>{e(this,b).forEach((t,l)=>{l===e(this,c).counter?t.classList.add("current"):t.classList.remove("current")})})}connectedCallback(){o(this,c,M.findParentElement(this,q)),e(this,c)&&customElements.whenDefined("e-billboard").then(()=>{var t;if(this.isConnected){const l=e(this,c).itemElements.length;for(let a=0;a<l;a++){const B=document.createElement("button");e(this,b).push(B),this.appendChild(B)}e(this,b).forEach(a=>{a.addEventListener("click",e(this,k))}),(t=e(this,c))==null||t.addEventListener("billboardChange",e(this,p)),e(this,p).call(this)}})}disconnectedCallback(){var t;e(this,b).forEach(l=>{l.removeEventListener("click",e(this,k))}),(t=e(this,c))==null||t.removeEventListener("billboardChange",e(this,p)),this.innerHTML="",o(this,b,[])}}c=new WeakMap,b=new WeakMap,k=new WeakMap,p=new WeakMap;C.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",H);var g,L;class _ extends HTMLElement{constructor(){super();n(this,g,new A.CSSProperty(this,"--step",1));n(this,L,null);this.addEventListener("click",()=>{e(this,L)&&e(this,L).shift(e(this,g).current)})}connectedCallback(){this.tabIndex=0,o(this,L,M.findParentElement(this,q)),e(this,g).observe()}disconnectedCallback(){this.removeAttribute("tabindex"),e(this,g).unobserve()}}g=new WeakMap,L=new WeakMap;C.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",_);exports.BillboardBulletsElement=H;exports.BillboardElement=q;exports.BillboardStepButtonElement=_;
@@ -1,100 +1,105 @@
1
- var A = (s) => {
1
+ var H = (s) => {
2
2
  throw TypeError(s);
3
3
  };
4
- var w = (s, i, e) => i.has(s) || A("Cannot " + e);
5
- var t = (s, i, e) => (w(s, i, "read from private field"), e ? e.call(s) : i.get(s)), n = (s, i, e) => i.has(s) ? A("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, e), c = (s, i, e, l) => (w(s, i, "write to private field"), l ? l.call(s, e) : i.set(s, e), e), f = (s, i, e) => (w(s, i, "access private method"), e);
6
- import { a as S, i as H } from "../index-euf5anj6.js";
7
- import { b as M } from "../dom-CVWzyXPH.js";
8
- import { CSSProperty as P } from "../css-property/index.js";
9
- import { d as q } from "../events-CsVF98U6.js";
10
- import { l as D } from "../number-DwCxt_Ck.js";
11
- var b, u, E, m, o, h, I, p, y, x, B;
12
- class T extends HTMLElement {
4
+ var w = (s, i, e) => i.has(s) || H("Cannot " + e);
5
+ var t = (s, i, e) => (w(s, i, "read from private field"), e ? e.call(s) : i.get(s)), n = (s, i, e) => i.has(s) ? H("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, e), o = (s, i, e, l) => (w(s, i, "write to private field"), l ? l.call(s, e) : i.set(s, e), e), d = (s, i, e) => (w(s, i, "access private method"), e);
6
+ import { a as S, i as M } from "../index-euf5anj6.js";
7
+ import { b as P } from "../dom-CVWzyXPH.js";
8
+ import { CSSProperty as q } from "../css-property/index.js";
9
+ import { d as D } from "../events-CsVF98U6.js";
10
+ import { l as F } from "../number-DwCxt_Ck.js";
11
+ var m, f, E, h, b, r, T, I, p, y, x, B;
12
+ class A extends HTMLElement {
13
13
  constructor() {
14
14
  super(...arguments);
15
- n(this, h);
16
- n(this, b, new P(this, "--autoplay", !1));
17
- n(this, u);
15
+ n(this, r);
16
+ n(this, m, new q(this, "--autoplay", !1));
17
+ n(this, f);
18
18
  n(this, E, !1);
19
- n(this, m, []);
20
- n(this, o, 0);
19
+ n(this, h, []);
20
+ n(this, b, 0);
21
21
  n(this, p, (e) => {
22
- c(this, E, e.isIntersecting), t(this, E) ? f(this, h, I).call(this) : clearInterval(t(this, u));
22
+ o(this, E, e.isIntersecting), t(this, E) ? d(this, r, I).call(this) : clearInterval(t(this, f));
23
23
  });
24
24
  n(this, y, () => {
25
- clearInterval(t(this, u)), t(this, E) && c(this, u, setInterval(
25
+ clearInterval(t(this, f)), t(this, E) && o(this, f, setInterval(
26
26
  t(this, B),
27
- parseFloat(t(this, b).current || "0") * 1e3
27
+ parseFloat(t(this, m).current || "0") * 1e3
28
28
  ));
29
29
  });
30
30
  n(this, B, () => {
31
- f(this, h, x).call(this, t(this, o) + 1);
31
+ d(this, r, x).call(this, t(this, b) + 1);
32
32
  });
33
33
  }
34
34
  get counter() {
35
- return t(this, o);
35
+ return t(this, b);
36
36
  }
37
37
  get itemElements() {
38
- return t(this, m);
38
+ return t(this, h);
39
+ }
40
+ addItem(e) {
41
+ t(this, h).push(e), d(this, r, T).call(this);
39
42
  }
40
43
  set(e) {
41
- f(this, h, x).call(this, e), f(this, h, I).call(this);
44
+ d(this, r, x).call(this, e), d(this, r, I).call(this);
42
45
  }
43
46
  shift(e) {
44
- this.set(t(this, o) + e);
47
+ this.set(t(this, b) + e);
45
48
  }
46
49
  connectedCallback() {
47
50
  var e;
48
- c(this, m, [
51
+ o(this, h, [
49
52
  ...this.querySelectorAll("[data-billboard-item]")
50
- ]), (e = t(this, m)[0]) == null || e.classList.add("current"), t(this, b).subscribe((l) => {
51
- l.current ? (S.subscribe(this, t(this, p)), f(this, h, I).call(this)) : (c(this, E, !0), S.unsubscribe(t(this, p)), clearInterval(t(this, u)), f(this, h, x).call(this, 0));
52
- }), t(this, b).observe();
53
+ ]), (e = t(this, h)[0]) == null || e.classList.add("current"), d(this, r, T).call(this), t(this, m).subscribe((l) => {
54
+ l.current ? (S.subscribe(this, t(this, p)), d(this, r, I).call(this)) : (o(this, E, !0), S.unsubscribe(t(this, p)), clearInterval(t(this, f)), d(this, r, x).call(this, 0));
55
+ }), t(this, m).observe();
53
56
  }
54
57
  disconnectedCallback() {
55
- t(this, b).unobserve(), S.unsubscribe(t(this, p)), clearInterval(t(this, u));
58
+ t(this, m).unobserve(), S.unsubscribe(t(this, p)), clearInterval(t(this, f));
56
59
  }
57
60
  }
58
- b = new WeakMap(), u = new WeakMap(), E = new WeakMap(), m = new WeakMap(), o = new WeakMap(), h = new WeakSet(), I = function() {
59
- t(this, b).current !== !1 && t(this, y).call(this);
61
+ m = new WeakMap(), f = new WeakMap(), E = new WeakMap(), h = new WeakMap(), b = new WeakMap(), r = new WeakSet(), T = function() {
62
+ t(this, h).length > 1 ? this.classList.add("has-length") : this.classList.remove("has-length");
63
+ }, I = function() {
64
+ t(this, m).current !== !1 && t(this, y).call(this);
60
65
  }, p = new WeakMap(), y = new WeakMap(), x = function(e) {
61
- c(this, o, D(e, t(this, m).length)), t(this, m).forEach((l, a) => {
62
- a === t(this, o) ? l.classList.add("current") : l.classList.remove("current");
63
- }), q(this, "billboardChange", {
66
+ o(this, b, F(e, t(this, h).length)), t(this, h).forEach((l, c) => {
67
+ c === t(this, b) ? l.classList.add("current") : l.classList.remove("current");
68
+ }), D(this, "billboardChange", {
64
69
  detail: {
65
- counter: t(this, o)
70
+ counter: t(this, b)
66
71
  }
67
72
  });
68
73
  }, B = new WeakMap();
69
- customElements.get("e-billboard") || customElements.define("e-billboard", T);
70
- var r, d, C, v;
71
- class F extends HTMLElement {
74
+ customElements.get("e-billboard") || customElements.define("e-billboard", A);
75
+ var a, u, C, v;
76
+ class N extends HTMLElement {
72
77
  constructor() {
73
78
  super(...arguments);
74
- n(this, r, null);
75
- n(this, d, []);
79
+ n(this, a, null);
80
+ n(this, u, []);
76
81
  n(this, C, (e) => {
77
- const l = e.currentTarget, a = t(this, d).findIndex((k) => k === l);
78
- a >= 0 && t(this, r).set(a);
82
+ const l = e.currentTarget, c = t(this, u).findIndex((k) => k === l);
83
+ c >= 0 && t(this, a).set(c);
79
84
  });
80
85
  n(this, v, () => {
81
- t(this, d).forEach((e, l) => {
82
- l === t(this, r).counter ? e.classList.add("current") : e.classList.remove("current");
86
+ t(this, u).forEach((e, l) => {
87
+ l === t(this, a).counter ? e.classList.add("current") : e.classList.remove("current");
83
88
  });
84
89
  });
85
90
  }
86
91
  connectedCallback() {
87
- c(this, r, M(this, T)), t(this, r) && customElements.whenDefined("e-billboard").then(() => {
92
+ o(this, a, P(this, A)), t(this, a) && customElements.whenDefined("e-billboard").then(() => {
88
93
  var e;
89
94
  if (this.isConnected) {
90
- const l = t(this, r).itemElements.length;
91
- for (let a = 0; a < l; a++) {
95
+ const l = t(this, a).itemElements.length;
96
+ for (let c = 0; c < l; c++) {
92
97
  const k = document.createElement("button");
93
- t(this, d).push(k), this.appendChild(k);
98
+ t(this, u).push(k), this.appendChild(k);
94
99
  }
95
- t(this, d).forEach((a) => {
96
- a.addEventListener("click", t(this, C));
97
- }), (e = t(this, r)) == null || e.addEventListener(
100
+ t(this, u).forEach((c) => {
101
+ c.addEventListener("click", t(this, C));
102
+ }), (e = t(this, a)) == null || e.addEventListener(
98
103
  "billboardChange",
99
104
  t(this, v)
100
105
  ), t(this, v).call(this);
@@ -103,37 +108,37 @@ class F extends HTMLElement {
103
108
  }
104
109
  disconnectedCallback() {
105
110
  var e;
106
- t(this, d).forEach((l) => {
111
+ t(this, u).forEach((l) => {
107
112
  l.removeEventListener("click", t(this, C));
108
- }), (e = t(this, r)) == null || e.removeEventListener(
113
+ }), (e = t(this, a)) == null || e.removeEventListener(
109
114
  "billboardChange",
110
115
  t(this, v)
111
- ), this.innerHTML = "", c(this, d, []);
116
+ ), this.innerHTML = "", o(this, u, []);
112
117
  }
113
118
  }
114
- r = new WeakMap(), d = new WeakMap(), C = new WeakMap(), v = new WeakMap();
115
- H && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", F);
119
+ a = new WeakMap(), u = new WeakMap(), C = new WeakMap(), v = new WeakMap();
120
+ M && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", N);
116
121
  var L, g;
117
- class N extends HTMLElement {
122
+ class j extends HTMLElement {
118
123
  constructor() {
119
124
  super();
120
- n(this, L, new P(this, "--step", 1));
125
+ n(this, L, new q(this, "--step", 1));
121
126
  n(this, g, null);
122
127
  this.addEventListener("click", () => {
123
128
  t(this, g) && t(this, g).shift(t(this, L).current);
124
129
  });
125
130
  }
126
131
  connectedCallback() {
127
- this.tabIndex = 0, c(this, g, M(this, T)), t(this, L).observe();
132
+ this.tabIndex = 0, o(this, g, P(this, A)), t(this, L).observe();
128
133
  }
129
134
  disconnectedCallback() {
130
135
  this.removeAttribute("tabindex"), t(this, L).unobserve();
131
136
  }
132
137
  }
133
138
  L = new WeakMap(), g = new WeakMap();
134
- H && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", N);
139
+ M && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", j);
135
140
  export {
136
- F as BillboardBulletsElement,
137
- T as BillboardElement,
138
- N as BillboardStepButtonElement
141
+ N as BillboardBulletsElement,
142
+ A as BillboardElement,
143
+ j as BillboardStepButtonElement
139
144
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.47.4",
3
+ "version": "0.47.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"