aptechka 0.50.2 → 0.50.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ export declare class BillboardSetButtonElement extends HTMLElement {
2
+ #private;
3
+ constructor();
4
+ protected connectedCallback(): void;
5
+ protected disconnectedCallback(): void;
6
+ }
7
+ declare global {
8
+ interface HTMLElementTagNameMap {
9
+ 'e-billboard-set-button': BillboardSetButtonElement;
10
+ }
11
+ }
@@ -1 +1 @@
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
+ "use strict";var _=s=>{throw TypeError(s)};var q=(s,i,t)=>i.has(s)||_("Cannot "+t);var e=(s,i,t)=>(q(s,i,"read from private field"),t?t.call(s):i.get(s)),n=(s,i,t)=>i.has(s)?_("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(s):i.set(s,t),h=(s,i,t,l)=>(q(s,i,"write to private field"),l?l.call(s,t):i.set(s,t),t),d=(s,i,t)=>(q(s,i,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../index-Cqw2NKev.cjs"),A=require("../dom-JBOkFLTh.cjs"),H=require("../css-property/index.cjs"),N=require("../events-KVanG9sR.cjs"),O=require("../number-0243DApo.cjs");var m,E,f,o,b,r,M,y,p,P,w,T;class x extends HTMLElement{constructor(){super(...arguments);n(this,r);n(this,m,new H.CSSProperty(this,"--autoplay",!1));n(this,E);n(this,f,!1);n(this,o,[]);n(this,b,0);n(this,p,t=>{h(this,f,t.isIntersecting),e(this,f)?d(this,r,y).call(this):clearInterval(e(this,E))});n(this,P,()=>{clearInterval(e(this,E)),e(this,f)&&h(this,E,setInterval(e(this,T),parseFloat(e(this,m).current||"0")*1e3))});n(this,T,()=>{d(this,r,w).call(this,e(this,b)+1)})}get counter(){return e(this,b)}get itemElements(){return e(this,o)}addItem(t){e(this,o).push(t),d(this,r,M).call(this)}set(t){d(this,r,w).call(this,t),d(this,r,y).call(this)}shift(t){this.set(e(this,b)+t)}connectedCallback(){var t;h(this,o,[...this.querySelectorAll("[data-billboard-item]")]),(t=e(this,o)[0])==null||t.classList.add("current"),d(this,r,M).call(this),e(this,m).subscribe(l=>{l.current?(v.intersector.subscribe(this,e(this,p)),d(this,r,y).call(this)):(h(this,f,!0),v.intersector.unsubscribe(e(this,p)),clearInterval(e(this,E)),d(this,r,w).call(this,0))}),e(this,m).observe()}disconnectedCallback(){e(this,m).unobserve(),v.intersector.unsubscribe(e(this,p)),clearInterval(e(this,E))}}m=new WeakMap,E=new WeakMap,f=new WeakMap,o=new WeakMap,b=new WeakMap,r=new WeakSet,M=function(){e(this,o).length>1?this.classList.add("has-length"):this.classList.remove("has-length")},y=function(){e(this,m).current!==!1&&e(this,P).call(this)},p=new WeakMap,P=new WeakMap,w=function(t){h(this,b,O.loopNumber(t,e(this,o).length)),e(this,o).forEach((l,a)=>{a===e(this,b)?l.classList.add("current"):l.classList.remove("current")}),N.dispatchEvent(this,"billboardChange",{detail:{counter:e(this,b)}})},T=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",x);var c,u,S,g;class j extends HTMLElement{constructor(){super(...arguments);n(this,c,null);n(this,u,[]);n(this,S,t=>{const l=t.currentTarget,a=e(this,u).findIndex(I=>I===l);a>=0&&e(this,c).set(a)});n(this,g,()=>{e(this,u).forEach((t,l)=>{l===e(this,c).counter?t.classList.add("current"):t.classList.remove("current")})})}connectedCallback(){h(this,c,A.findParentElement(this,x)),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 I=document.createElement("button");e(this,u).push(I),this.appendChild(I)}e(this,u).forEach(a=>{a.addEventListener("click",e(this,S))}),(t=e(this,c))==null||t.addEventListener("billboardChange",e(this,g)),e(this,g).call(this)}})}disconnectedCallback(){var t;e(this,u).forEach(l=>{l.removeEventListener("click",e(this,S))}),(t=e(this,c))==null||t.removeEventListener("billboardChange",e(this,g)),this.innerHTML="",h(this,u,[])}}c=new WeakMap,u=new WeakMap,S=new WeakMap,g=new WeakMap;v.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",j);var L,C;class D extends HTMLElement{constructor(){super();n(this,L,new H.CSSProperty(this,"--set",0));n(this,C,null);this.addEventListener("click",()=>{e(this,C)&&e(this,C).set(e(this,L).current)})}connectedCallback(){this.tabIndex=0,h(this,C,A.findParentElement(this,x)),e(this,L).observe()}disconnectedCallback(){this.removeAttribute("tabindex"),e(this,L).unobserve()}}L=new WeakMap,C=new WeakMap;v.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",D);var B,k;class F extends HTMLElement{constructor(){super();n(this,B,new H.CSSProperty(this,"--step",1));n(this,k,null);this.addEventListener("click",()=>{e(this,k)&&e(this,k).shift(e(this,B).current)})}connectedCallback(){this.tabIndex=0,h(this,k,A.findParentElement(this,x)),e(this,B).observe()}disconnectedCallback(){this.removeAttribute("tabindex"),e(this,B).unobserve()}}B=new WeakMap,k=new WeakMap;v.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",F);exports.BillboardBulletsElement=j;exports.BillboardElement=x;exports.BillboardSetButtonElement=D;exports.BillboardStepButtonElement=F;
@@ -1,3 +1,4 @@
1
1
  export { BillboardBulletsElement } from './BillboardBulletsElement';
2
+ export { BillboardSetButtonElement } from './BillboardSetButtonElement';
2
3
  export { BillboardStepButtonElement } from './BillboardStepButtonElement';
3
4
  export { BillboardElement, type BillboardEvents } from './BillboardElement';
@@ -1,105 +1,105 @@
1
- var H = (s) => {
1
+ var F = (s) => {
2
2
  throw TypeError(s);
3
3
  };
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 {
4
+ var A = (s, i, e) => i.has(s) || F("Cannot " + e);
5
+ var t = (s, i, e) => (A(s, i, "read from private field"), e ? e.call(s) : i.get(s)), n = (s, i, e) => i.has(s) ? F("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, e), h = (s, i, e, l) => (A(s, i, "write to private field"), l ? l.call(s, e) : i.set(s, e), e), d = (s, i, e) => (A(s, i, "access private method"), e);
6
+ import { a as H, i as P } from "../index-euf5anj6.js";
7
+ import { b as q } from "../dom-CVWzyXPH.js";
8
+ import { CSSProperty as D } from "../css-property/index.js";
9
+ import { d as N } from "../events-CsVF98U6.js";
10
+ import { l as j } from "../number-DwCxt_Ck.js";
11
+ var m, f, E, a, b, r, M, B, p, y, w, S;
12
+ class T extends HTMLElement {
13
13
  constructor() {
14
14
  super(...arguments);
15
15
  n(this, r);
16
- n(this, m, new q(this, "--autoplay", !1));
16
+ n(this, m, new D(this, "--autoplay", !1));
17
17
  n(this, f);
18
18
  n(this, E, !1);
19
- n(this, h, []);
19
+ n(this, a, []);
20
20
  n(this, b, 0);
21
21
  n(this, p, (e) => {
22
- o(this, E, e.isIntersecting), t(this, E) ? d(this, r, I).call(this) : clearInterval(t(this, f));
22
+ h(this, E, e.isIntersecting), t(this, E) ? d(this, r, B).call(this) : clearInterval(t(this, f));
23
23
  });
24
24
  n(this, y, () => {
25
- clearInterval(t(this, f)), t(this, E) && o(this, f, setInterval(
26
- t(this, B),
25
+ clearInterval(t(this, f)), t(this, E) && h(this, f, setInterval(
26
+ t(this, S),
27
27
  parseFloat(t(this, m).current || "0") * 1e3
28
28
  ));
29
29
  });
30
- n(this, B, () => {
31
- d(this, r, x).call(this, t(this, b) + 1);
30
+ n(this, S, () => {
31
+ d(this, r, w).call(this, t(this, b) + 1);
32
32
  });
33
33
  }
34
34
  get counter() {
35
35
  return t(this, b);
36
36
  }
37
37
  get itemElements() {
38
- return t(this, h);
38
+ return t(this, a);
39
39
  }
40
40
  addItem(e) {
41
- t(this, h).push(e), d(this, r, T).call(this);
41
+ t(this, a).push(e), d(this, r, M).call(this);
42
42
  }
43
43
  set(e) {
44
- d(this, r, x).call(this, e), d(this, r, I).call(this);
44
+ d(this, r, w).call(this, e), d(this, r, B).call(this);
45
45
  }
46
46
  shift(e) {
47
47
  this.set(t(this, b) + e);
48
48
  }
49
49
  connectedCallback() {
50
50
  var e;
51
- o(this, h, [
51
+ h(this, a, [
52
52
  ...this.querySelectorAll("[data-billboard-item]")
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));
53
+ ]), (e = t(this, a)[0]) == null || e.classList.add("current"), d(this, r, M).call(this), t(this, m).subscribe((l) => {
54
+ l.current ? (H.subscribe(this, t(this, p)), d(this, r, B).call(this)) : (h(this, E, !0), H.unsubscribe(t(this, p)), clearInterval(t(this, f)), d(this, r, w).call(this, 0));
55
55
  }), t(this, m).observe();
56
56
  }
57
57
  disconnectedCallback() {
58
- t(this, m).unobserve(), S.unsubscribe(t(this, p)), clearInterval(t(this, f));
58
+ t(this, m).unobserve(), H.unsubscribe(t(this, p)), clearInterval(t(this, f));
59
59
  }
60
60
  }
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() {
61
+ m = new WeakMap(), f = new WeakMap(), E = new WeakMap(), a = new WeakMap(), b = new WeakMap(), r = new WeakSet(), M = function() {
62
+ t(this, a).length > 1 ? this.classList.add("has-length") : this.classList.remove("has-length");
63
+ }, B = function() {
64
64
  t(this, m).current !== !1 && t(this, y).call(this);
65
- }, p = new WeakMap(), y = new WeakMap(), x = function(e) {
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", {
65
+ }, p = new WeakMap(), y = new WeakMap(), w = function(e) {
66
+ h(this, b, j(e, t(this, a).length)), t(this, a).forEach((l, o) => {
67
+ o === t(this, b) ? l.classList.add("current") : l.classList.remove("current");
68
+ }), N(this, "billboardChange", {
69
69
  detail: {
70
70
  counter: t(this, b)
71
71
  }
72
72
  });
73
- }, B = new WeakMap();
74
- customElements.get("e-billboard") || customElements.define("e-billboard", A);
75
- var a, u, C, v;
76
- class N extends HTMLElement {
73
+ }, S = new WeakMap();
74
+ customElements.get("e-billboard") || customElements.define("e-billboard", T);
75
+ var c, u, I, v;
76
+ class z extends HTMLElement {
77
77
  constructor() {
78
78
  super(...arguments);
79
- n(this, a, null);
79
+ n(this, c, null);
80
80
  n(this, u, []);
81
- n(this, C, (e) => {
82
- const l = e.currentTarget, c = t(this, u).findIndex((k) => k === l);
83
- c >= 0 && t(this, a).set(c);
81
+ n(this, I, (e) => {
82
+ const l = e.currentTarget, o = t(this, u).findIndex((x) => x === l);
83
+ o >= 0 && t(this, c).set(o);
84
84
  });
85
85
  n(this, v, () => {
86
86
  t(this, u).forEach((e, l) => {
87
- l === t(this, a).counter ? e.classList.add("current") : e.classList.remove("current");
87
+ l === t(this, c).counter ? e.classList.add("current") : e.classList.remove("current");
88
88
  });
89
89
  });
90
90
  }
91
91
  connectedCallback() {
92
- o(this, a, P(this, A)), t(this, a) && customElements.whenDefined("e-billboard").then(() => {
92
+ h(this, c, q(this, T)), t(this, c) && customElements.whenDefined("e-billboard").then(() => {
93
93
  var e;
94
94
  if (this.isConnected) {
95
- const l = t(this, a).itemElements.length;
96
- for (let c = 0; c < l; c++) {
97
- const k = document.createElement("button");
98
- t(this, u).push(k), this.appendChild(k);
95
+ const l = t(this, c).itemElements.length;
96
+ for (let o = 0; o < l; o++) {
97
+ const x = document.createElement("button");
98
+ t(this, u).push(x), this.appendChild(x);
99
99
  }
100
- t(this, u).forEach((c) => {
101
- c.addEventListener("click", t(this, C));
102
- }), (e = t(this, a)) == null || e.addEventListener(
100
+ t(this, u).forEach((o) => {
101
+ o.addEventListener("click", t(this, I));
102
+ }), (e = t(this, c)) == null || e.addEventListener(
103
103
  "billboardChange",
104
104
  t(this, v)
105
105
  ), t(this, v).call(this);
@@ -109,36 +109,56 @@ class N extends HTMLElement {
109
109
  disconnectedCallback() {
110
110
  var e;
111
111
  t(this, u).forEach((l) => {
112
- l.removeEventListener("click", t(this, C));
113
- }), (e = t(this, a)) == null || e.removeEventListener(
112
+ l.removeEventListener("click", t(this, I));
113
+ }), (e = t(this, c)) == null || e.removeEventListener(
114
114
  "billboardChange",
115
115
  t(this, v)
116
- ), this.innerHTML = "", o(this, u, []);
116
+ ), this.innerHTML = "", h(this, u, []);
117
117
  }
118
118
  }
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);
119
+ c = new WeakMap(), u = new WeakMap(), I = new WeakMap(), v = new WeakMap();
120
+ P && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", z);
121
121
  var L, g;
122
- class j extends HTMLElement {
122
+ class G extends HTMLElement {
123
123
  constructor() {
124
124
  super();
125
- n(this, L, new q(this, "--step", 1));
125
+ n(this, L, new D(this, "--set", 0));
126
126
  n(this, g, null);
127
127
  this.addEventListener("click", () => {
128
- t(this, g) && t(this, g).shift(t(this, L).current);
128
+ t(this, g) && t(this, g).set(t(this, L).current);
129
129
  });
130
130
  }
131
131
  connectedCallback() {
132
- this.tabIndex = 0, o(this, g, P(this, A)), t(this, L).observe();
132
+ this.tabIndex = 0, h(this, g, q(this, T)), t(this, L).observe();
133
133
  }
134
134
  disconnectedCallback() {
135
135
  this.removeAttribute("tabindex"), t(this, L).unobserve();
136
136
  }
137
137
  }
138
138
  L = new WeakMap(), g = new WeakMap();
139
- M && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", j);
139
+ P && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button", G);
140
+ var C, k;
141
+ class J extends HTMLElement {
142
+ constructor() {
143
+ super();
144
+ n(this, C, new D(this, "--step", 1));
145
+ n(this, k, null);
146
+ this.addEventListener("click", () => {
147
+ t(this, k) && t(this, k).shift(t(this, C).current);
148
+ });
149
+ }
150
+ connectedCallback() {
151
+ this.tabIndex = 0, h(this, k, q(this, T)), t(this, C).observe();
152
+ }
153
+ disconnectedCallback() {
154
+ this.removeAttribute("tabindex"), t(this, C).unobserve();
155
+ }
156
+ }
157
+ C = new WeakMap(), k = new WeakMap();
158
+ P && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", J);
140
159
  export {
141
- N as BillboardBulletsElement,
142
- A as BillboardElement,
143
- j as BillboardStepButtonElement
160
+ z as BillboardBulletsElement,
161
+ T as BillboardElement,
162
+ G as BillboardSetButtonElement,
163
+ J as BillboardStepButtonElement
144
164
  };
@@ -1 +1 @@
1
- "use strict";var E=e=>{throw TypeError(e)};var b=(e,a,t)=>a.has(e)||E("Cannot "+t);var i=(e,a,t)=>(b(e,a,"read from private field"),t?t.call(e):a.get(e)),r=(e,a,t)=>a.has(e)?E("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(e):a.set(e,t),l=(e,a,t,s)=>(b(e,a,"write to private field"),s?s.call(e,t):a.set(e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../events-KVanG9sR.cjs");require("../index-Cqw2NKev.cjs");var d,n,o,c,u,h;class g extends HTMLElement{constructor(){super(...arguments);r(this,d,[]);r(this,n);r(this,o,null);r(this,c,()=>{this.isConnected&&(document.documentElement.addEventListener("radioChange",i(this,h)),i(this,d).forEach(t=>{t.addEventListener("click",i(this,u)),t.hasAttribute("data-checked")&&this.setValue(t.getAttribute("data-value"))}))});r(this,u,t=>{const m=t.currentTarget.getAttribute("data-value");m&&this.setValue(m)});r(this,h,t=>{const s=t.target;s!==this&&s.name===this.name&&this.setValue(t.detail)})}get value(){return i(this,n)}get name(){return this.getAttribute("name")}get currentButtonElement(){return i(this,o)}setValue(t){t&&t!==i(this,n)&&(l(this,n,t),i(this,d).forEach(s=>{s.getAttribute("data-value")===i(this,n)?(s.setAttribute("data-checked",""),l(this,o,s)):s.removeAttribute("data-checked")}),v.dispatchEvent(this,"radioChange",{detail:i(this,n),bubbles:!0}))}connectedCallback(){l(this,d,[...this.querySelectorAll("[data-radio-button]")]),document.readyState==="complete"?i(this,c).call(this):addEventListener("load",i(this,c))}disconnectedCallback(){i(this,d).forEach(t=>{t.removeEventListener("click",i(this,u))}),removeEventListener("load",i(this,c)),document.documentElement.removeEventListener("radioChange",i(this,h))}}d=new WeakMap,n=new WeakMap,o=new WeakMap,c=new WeakMap,u=new WeakMap,h=new WeakMap;customElements.get("e-radio")||customElements.define("e-radio",g);exports.RadioElement=g;
1
+ "use strict";var E=i=>{throw TypeError(i)};var v=(i,n,t)=>n.has(i)||E("Cannot "+t);var e=(i,n,t)=>(v(i,n,"read from private field"),t?t.call(i):n.get(i)),d=(i,n,t)=>n.has(i)?E("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(i):n.set(i,t),h=(i,n,t,s)=>(v(i,n,"write to private field"),s?s.call(i,t):n.set(i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../events-KVanG9sR.cjs");require("../index-Cqw2NKev.cjs");var a,r,l,u,o,m;class b extends HTMLElement{constructor(){super(...arguments);d(this,a,[]);d(this,r);d(this,l,null);d(this,u,()=>{this.isConnected&&(document.documentElement.addEventListener("radioChange",e(this,m)),e(this,a).forEach(t=>{t.addEventListener("click",e(this,o)),t.hasAttribute("data-checked")&&this.setValue(t.getAttribute("data-value"))}))});d(this,o,t=>{const c=t.currentTarget.getAttribute("data-value");c&&this.setValue(c)});d(this,m,t=>{const s=t.target;s!==this&&s.name===this.name&&this.setValue(t.detail)})}get value(){return e(this,r)}get name(){return this.getAttribute("name")}get currentButtonElement(){return e(this,l)}addButton(t){e(this,a).push(t),t.addEventListener("click",e(this,o))}removeButton(t){const s=e(this,a).find(c=>c===t);s&&(s.removeEventListener("click",e(this,o)),h(this,a,e(this,a).filter(c=>c!==t)))}setValue(t){t&&t!==e(this,r)&&(h(this,r,t),e(this,a).forEach(s=>{s.getAttribute("data-value")===e(this,r)?(s.setAttribute("data-checked",""),h(this,l,s)):s.removeAttribute("data-checked")}),f.dispatchEvent(this,"radioChange",{detail:e(this,r),bubbles:!0}))}connectedCallback(){h(this,a,[...this.querySelectorAll("[data-radio-button]")]),document.readyState==="complete"?e(this,u).call(this):addEventListener("load",e(this,u))}disconnectedCallback(){e(this,a).forEach(t=>{t.removeEventListener("click",e(this,o))}),removeEventListener("load",e(this,u)),document.documentElement.removeEventListener("radioChange",e(this,m))}}a=new WeakMap,r=new WeakMap,l=new WeakMap,u=new WeakMap,o=new WeakMap,m=new WeakMap;customElements.get("e-radio")||customElements.define("e-radio",b);exports.RadioElement=b;
@@ -6,6 +6,8 @@ export declare class RadioElement<T extends string = string> extends HTMLElement
6
6
  get value(): T | undefined;
7
7
  get name(): string | null;
8
8
  get currentButtonElement(): HTMLElement | null;
9
+ addButton(element: HTMLElement): void;
10
+ removeButton(element: HTMLElement): void;
9
11
  setValue(value: T | undefined): void;
10
12
  protected connectedCallback(): void;
11
13
  protected disconnectedCallback(): void;
@@ -1,67 +1,74 @@
1
- var E = (e) => {
2
- throw TypeError(e);
1
+ var E = (i) => {
2
+ throw TypeError(i);
3
3
  };
4
- var b = (e, a, t) => a.has(e) || E("Cannot " + t);
5
- var i = (e, a, t) => (b(e, a, "read from private field"), t ? t.call(e) : a.get(e)), r = (e, a, t) => a.has(e) ? E("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(e) : a.set(e, t), l = (e, a, t, s) => (b(e, a, "write to private field"), s ? s.call(e, t) : a.set(e, t), t);
6
- import { d as g } from "../events-CsVF98U6.js";
4
+ var v = (i, a, t) => a.has(i) || E("Cannot " + t);
5
+ var e = (i, a, t) => (v(i, a, "read from private field"), t ? t.call(i) : a.get(i)), d = (i, a, t) => a.has(i) ? E("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(i) : a.set(i, t), u = (i, a, t, s) => (v(i, a, "write to private field"), s ? s.call(i, t) : a.set(i, t), t);
6
+ import { d as f } from "../events-CsVF98U6.js";
7
7
  import "../index-euf5anj6.js";
8
- var d, n, c, o, h, u;
9
- class v extends HTMLElement {
8
+ var n, r, l, h, o, m;
9
+ class b extends HTMLElement {
10
10
  constructor() {
11
11
  super(...arguments);
12
- r(this, d, []);
13
- r(this, n);
14
- r(this, c, null);
15
- r(this, o, () => {
12
+ d(this, n, []);
13
+ d(this, r);
14
+ d(this, l, null);
15
+ d(this, h, () => {
16
16
  this.isConnected && (document.documentElement.addEventListener(
17
17
  "radioChange",
18
- i(this, u)
19
- ), i(this, d).forEach((t) => {
20
- t.addEventListener("click", i(this, h)), t.hasAttribute("data-checked") && this.setValue(t.getAttribute("data-value"));
18
+ e(this, m)
19
+ ), e(this, n).forEach((t) => {
20
+ t.addEventListener("click", e(this, o)), t.hasAttribute("data-checked") && this.setValue(t.getAttribute("data-value"));
21
21
  }));
22
22
  });
23
- r(this, h, (t) => {
24
- const m = t.currentTarget.getAttribute("data-value");
25
- m && this.setValue(m);
23
+ d(this, o, (t) => {
24
+ const c = t.currentTarget.getAttribute("data-value");
25
+ c && this.setValue(c);
26
26
  });
27
- r(this, u, (t) => {
27
+ d(this, m, (t) => {
28
28
  const s = t.target;
29
29
  s !== this && s.name === this.name && this.setValue(t.detail);
30
30
  });
31
31
  }
32
32
  get value() {
33
- return i(this, n);
33
+ return e(this, r);
34
34
  }
35
35
  get name() {
36
36
  return this.getAttribute("name");
37
37
  }
38
38
  get currentButtonElement() {
39
- return i(this, c);
39
+ return e(this, l);
40
+ }
41
+ addButton(t) {
42
+ e(this, n).push(t), t.addEventListener("click", e(this, o));
43
+ }
44
+ removeButton(t) {
45
+ const s = e(this, n).find((c) => c === t);
46
+ s && (s.removeEventListener("click", e(this, o)), u(this, n, e(this, n).filter((c) => c !== t)));
40
47
  }
41
48
  setValue(t) {
42
- t && t !== i(this, n) && (l(this, n, t), i(this, d).forEach((s) => {
43
- s.getAttribute("data-value") === i(this, n) ? (s.setAttribute("data-checked", ""), l(this, c, s)) : s.removeAttribute("data-checked");
44
- }), g(this, "radioChange", {
45
- detail: i(this, n),
49
+ t && t !== e(this, r) && (u(this, r, t), e(this, n).forEach((s) => {
50
+ s.getAttribute("data-value") === e(this, r) ? (s.setAttribute("data-checked", ""), u(this, l, s)) : s.removeAttribute("data-checked");
51
+ }), f(this, "radioChange", {
52
+ detail: e(this, r),
46
53
  bubbles: !0
47
54
  }));
48
55
  }
49
56
  connectedCallback() {
50
- l(this, d, [
57
+ u(this, n, [
51
58
  ...this.querySelectorAll("[data-radio-button]")
52
- ]), document.readyState === "complete" ? i(this, o).call(this) : addEventListener("load", i(this, o));
59
+ ]), document.readyState === "complete" ? e(this, h).call(this) : addEventListener("load", e(this, h));
53
60
  }
54
61
  disconnectedCallback() {
55
- i(this, d).forEach((t) => {
56
- t.removeEventListener("click", i(this, h));
57
- }), removeEventListener("load", i(this, o)), document.documentElement.removeEventListener(
62
+ e(this, n).forEach((t) => {
63
+ t.removeEventListener("click", e(this, o));
64
+ }), removeEventListener("load", e(this, h)), document.documentElement.removeEventListener(
58
65
  "radioChange",
59
- i(this, u)
66
+ e(this, m)
60
67
  );
61
68
  }
62
69
  }
63
- d = new WeakMap(), n = new WeakMap(), c = new WeakMap(), o = new WeakMap(), h = new WeakMap(), u = new WeakMap();
64
- customElements.get("e-radio") || customElements.define("e-radio", v);
70
+ n = new WeakMap(), r = new WeakMap(), l = new WeakMap(), h = new WeakMap(), o = new WeakMap(), m = new WeakMap();
71
+ customElements.get("e-radio") || customElements.define("e-radio", b);
65
72
  export {
66
- v as RadioElement
73
+ b as RadioElement
67
74
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.50.2",
3
+ "version": "0.50.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"