aptechka 0.56.7 → 0.56.9
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.
package/lib/accordion/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var k=s=>{throw TypeError(s)};var p=(s,i,t)=>i.has(s)||k("Cannot "+t);var e=(s,i,t)=>(p(s,i,"read from private field"),t?t.call(s):i.get(s)),l=(s,i,t)=>i.has(s)?k("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(s):i.set(s,t),c=(s,i,t,r)=>(p(s,i,"write to private field"),r?r.call(s,t):i.set(s,t),t),m=(s,i,t)=>(p(s,i,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("../attribute/index.cjs"),q=require("../index-Cqw2NKev.cjs"),z=require("../events-KVanG9sR.cjs"),H=require("../style-At6aDoqG.cjs");var d,n,f,h,E,u,o,x,A,y,v,C;class S{constructor(i,t){l(this,o);l(this,d,null);l(this,n,null);l(this,f,null);l(this,h,null);l(this,E);l(this,u,!1);l(this,A,()=>{e(this,u)?this.close():this.open()});l(this,y,i=>{e(this,u)&&!(i instanceof CustomEvent)&&(m(this,o,v).call(this,0,!0),m(this,o,v).call(this,e(this,o,x)))});t.firstElementChild instanceof HTMLElement&&t.lastElementChild instanceof HTMLElement?(c(this,d,i),c(this,n,t),c(this,f,t.firstElementChild),c(this,h,t.lastElementChild),e(this,h).style.overflow="hidden",e(this,d).axisAttribute.current==="y"?e(this,h).style.height="0px":e(this,h).style.width="0px",addEventListener("resize",e(this,y)),e(this,f).addEventListener("click",e(this,A)),e(this,n).hasAttribute("data-opened")&&this.open({skipTransition:!0})):i.removeItem(e(this,n))}get element(){return e(this,n)}destroy(){e(this,f)&&(e(this,n).classList.remove("opened","triggered"),e(this,n).removeAttribute("data-opened"),e(this,f).style.cursor="",m(this,o,v).call(this,void 0),removeEventListener("resize",e(this,y)),e(this,f).removeEventListener("click",e(this,A)),clearTimeout(e(this,E)))}open(i){i!=null&&i.skipTransition&&m(this,o,C).call(this),e(this,d).multipleAttribute.current||e(this,d).closeAll({exclude:e(this,n)}),c(this,u,!0),clearTimeout(e(this,E)),e(this,n).classList.add("triggered"),m(this,o,v).call(this,e(this,o,x)),setTimeout(()=>{e(this,n).classList.add("opened"),e(this,n).setAttribute("data-opened",""),c(this,E,setTimeout(()=>{window.dispatchEvent(new CustomEvent("resize"))},H.getElementTransitionDurationMS(e(this,h))))},0),z.dispatchEvent(this.element,"accordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:e(this,u),element:e(this,n)}})}close(i){i!=null&&i.skipTransition&&m(this,o,C).call(this),clearTimeout(e(this,E)),c(this,u,!1),e(this,n).classList.remove("opened"),m(this,o,v).call(this,0),c(this,E,setTimeout(()=>{e(this,n).classList.remove("triggered"),window.dispatchEvent(new CustomEvent("resize"))},H.getElementTransitionDurationMS(e(this,h)))),z.dispatchEvent(this.element,"accordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:e(this,u),element:e(this,n)}})}}d=new WeakMap,n=new WeakMap,f=new WeakMap,h=new WeakMap,E=new WeakMap,u=new WeakMap,o=new WeakSet,x=function(){return e(this,d).axisAttribute.current==="x"?e(this,h).scrollWidth:e(this,h).scrollHeight},A=new WeakMap,y=new WeakMap,v=function(i,t=!1){t&&(e(this,h).style.transition="all 0s",setTimeout(()=>{e(this,h).style.transition=""}));const r=e(this,d).axisAttribute.current==="x"?"width":"height";i!=null?e(this,h).style[r]=`${i}px`:e(this,h).style[r]=""},C=function(){e(this,h).style.transition="all 0s",setTimeout(()=>{e(this,h).style.transition=""},50)};var b,T,a,g,L,M;class O extends HTMLElement{constructor(){super();l(this,L);l(this,b,new I.Attribute(this,"axis","y"));l(this,T,new I.Attribute(this,"multiple",!1));l(this,a,[]);l(this,g,null);q.isBrowser&&c(this,g,new MutationObserver(t=>{t.forEach(r=>{r.removedNodes.forEach(w=>{w instanceof HTMLElement&&this.removeItem(w)}),r.addedNodes.forEach(w=>{w instanceof HTMLElement&&this.createItem(w)})})}))}get axisAttribute(){return e(this,b)}get multipleAttribute(){return e(this,T)}createItem(t){e(this,a).find(r=>r.element===t)||e(this,a).push(new S(this,t))}removeItem(t){c(this,a,e(this,a).filter(r=>{if(r.element!==t)return!0;r.destroy()}))}closeAll(t){e(this,a).forEach(r=>{(t==null?void 0:t.exclude)!==r.element&&r.close(t)})}openAll(t){e(this,a).forEach(r=>{(t==null?void 0:t.exclude)!==r.element&&r.open(t)})}connectedCallback(){e(this,b).observe(),e(this,T).observe(),e(this,g).observe(e(this,L,M),{childList:!0}),c(this,a,[...e(this,L,M).children].map(t=>{if(t instanceof HTMLElement)return new S(this,t)}).filter(t=>!!t))}disconnectedCallback(){e(this,b).unobserve(),e(this,T).unobserve(),e(this,g).disconnect()}}b=new WeakMap,T=new WeakMap,a=new WeakMap,g=new WeakMap,L=new WeakSet,M=function(){return this.shadowRoot?this.shadowRoot:this};q.isBrowser&&!customElements.get("e-accordion")&&customElements.define("e-accordion",O);exports.AccordionElement=O;
|
package/lib/accordion/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
1
|
+
var I = (s) => {
|
|
2
2
|
throw TypeError(s);
|
|
3
3
|
};
|
|
4
|
-
var x = (s, i, t) => i.has(s) ||
|
|
5
|
-
var e = (s, i, t) => (x(s, i, "read from private field"), t ? t.call(s) : i.get(s)), n = (s, i, t) => i.has(s) ?
|
|
4
|
+
var x = (s, i, t) => i.has(s) || I("Cannot " + t);
|
|
5
|
+
var e = (s, i, t) => (x(s, i, "read from private field"), t ? t.call(s) : i.get(s)), n = (s, i, t) => i.has(s) ? I("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, t), a = (s, i, t, r) => (x(s, i, "write to private field"), r ? r.call(s, t) : i.set(s, t), t), m = (s, i, t) => (x(s, i, "access private method"), t);
|
|
6
6
|
import { Attribute as M } from "../attribute/index.js";
|
|
7
7
|
import { i as R } from "../index-euf5anj6.js";
|
|
8
8
|
import { d as z } from "../events-CsVF98U6.js";
|
|
9
9
|
import { g as H } from "../style-j2TwriJ_.js";
|
|
10
|
-
var d, h, f, l, E, u, o, y, w, L, v,
|
|
10
|
+
var d, h, f, l, E, u, o, y, w, L, v, C;
|
|
11
11
|
class S {
|
|
12
12
|
constructor(i, t) {
|
|
13
13
|
n(this, o);
|
|
@@ -32,9 +32,9 @@ class S {
|
|
|
32
32
|
e(this, f) && (e(this, h).classList.remove("opened", "triggered"), e(this, h).removeAttribute("data-opened"), e(this, f).style.cursor = "", m(this, o, v).call(this, void 0), removeEventListener("resize", e(this, L)), e(this, f).removeEventListener("click", e(this, w)), clearTimeout(e(this, E)));
|
|
33
33
|
}
|
|
34
34
|
open(i) {
|
|
35
|
-
i != null && i.skipTransition && m(this, o,
|
|
35
|
+
i != null && i.skipTransition && m(this, o, C).call(this), e(this, d).multipleAttribute.current || e(this, d).closeAll({ exclude: e(this, h) }), a(this, u, !0), clearTimeout(e(this, E)), e(this, h).classList.add("triggered"), m(this, o, v).call(this, e(this, o, y)), setTimeout(() => {
|
|
36
36
|
e(this, h).classList.add("opened"), e(this, h).setAttribute("data-opened", ""), a(this, E, setTimeout(() => {
|
|
37
|
-
window.dispatchEvent(new
|
|
37
|
+
window.dispatchEvent(new CustomEvent("resize"));
|
|
38
38
|
}, H(e(this, l))));
|
|
39
39
|
}, 0), z(this.element, "accordionItemToggle", {
|
|
40
40
|
bubbles: !0,
|
|
@@ -46,8 +46,8 @@ class S {
|
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
close(i) {
|
|
49
|
-
i != null && i.skipTransition && m(this, o,
|
|
50
|
-
e(this, h).classList.remove("triggered"), window.dispatchEvent(new
|
|
49
|
+
i != null && i.skipTransition && m(this, o, C).call(this), clearTimeout(e(this, E)), a(this, u, !1), e(this, h).classList.remove("opened"), m(this, o, v).call(this, 0), a(this, E, setTimeout(() => {
|
|
50
|
+
e(this, h).classList.remove("triggered"), window.dispatchEvent(new CustomEvent("resize"));
|
|
51
51
|
}, H(e(this, l)))), z(this.element, "accordionItemToggle", {
|
|
52
52
|
bubbles: !0,
|
|
53
53
|
composed: !0,
|
|
@@ -66,12 +66,12 @@ d = new WeakMap(), h = new WeakMap(), f = new WeakMap(), l = new WeakMap(), E =
|
|
|
66
66
|
}));
|
|
67
67
|
const r = e(this, d).axisAttribute.current === "x" ? "width" : "height";
|
|
68
68
|
i != null ? e(this, l).style[r] = `${i}px` : e(this, l).style[r] = "";
|
|
69
|
-
},
|
|
69
|
+
}, C = function() {
|
|
70
70
|
e(this, l).style.transition = "all 0s", setTimeout(() => {
|
|
71
71
|
e(this, l).style.transition = "";
|
|
72
72
|
}, 50);
|
|
73
73
|
};
|
|
74
|
-
var b, T, c, g, A,
|
|
74
|
+
var b, T, c, g, A, k;
|
|
75
75
|
class N extends HTMLElement {
|
|
76
76
|
constructor() {
|
|
77
77
|
super();
|
|
@@ -117,9 +117,9 @@ class N extends HTMLElement {
|
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
connectedCallback() {
|
|
120
|
-
e(this, b).observe(), e(this, T).observe(), e(this, g).observe(e(this, A,
|
|
120
|
+
e(this, b).observe(), e(this, T).observe(), e(this, g).observe(e(this, A, k), {
|
|
121
121
|
childList: !0
|
|
122
|
-
}), a(this, c, [...e(this, A,
|
|
122
|
+
}), a(this, c, [...e(this, A, k).children].map((t) => {
|
|
123
123
|
if (t instanceof HTMLElement)
|
|
124
124
|
return new S(this, t);
|
|
125
125
|
}).filter((t) => !!t));
|
|
@@ -128,7 +128,7 @@ class N extends HTMLElement {
|
|
|
128
128
|
e(this, b).unobserve(), e(this, T).unobserve(), e(this, g).disconnect();
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
b = new WeakMap(), T = new WeakMap(), c = new WeakMap(), g = new WeakMap(), A = new WeakSet(),
|
|
131
|
+
b = new WeakMap(), T = new WeakMap(), c = new WeakMap(), g = new WeakMap(), A = new WeakSet(), k = function() {
|
|
132
132
|
return this.shadowRoot ? this.shadowRoot : this;
|
|
133
133
|
};
|
|
134
134
|
R && !customElements.get("e-accordion") && customElements.define("e-accordion", N);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var f=s=>{throw TypeError(s)};var p=(s,l,t)=>l.has(s)||f("Cannot "+t);var e=(s,l,t)=>(p(s,l,"read from private field"),t?t.call(s):l.get(s)),n=(s,l,t)=>l.has(s)?f("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(s):l.set(s,t),u=(s,l,t,i)=>(p(s,l,"write to private field"),i?i.call(s,t):l.set(s,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../element-resizer/index.cjs"),L=require("../window-resizer/index.cjs"),q=require("../index-Cqw2NKev.cjs"),T=require("../dom-JBOkFLTh.cjs"),k=require("../gestures-C7gbKx11.cjs"),S=require("../ticker/index.cjs");var r,o,a,h,m,d,c,b,g;class x extends HTMLElement{constructor(){super(...arguments);n(this,r,null);n(this,o,null);n(this,a,0);n(this,h,0);n(this,m);n(this,d,()=>{this.classList.add("active"),clearTimeout(e(this,m));const t=e(this,r).scrollTop/e(this,h)*e(this,a);e(this,o).style.transform=`translate3d(0px, ${t}px, 0px)`,u(this,m,setTimeout(()=>{this.classList.remove("active")},1e3))});n(this,c,()=>{const t=this.offsetHeight;u(this,h,e(this,r).scrollHeight-e(this,r).offsetHeight);let i=t/(e(this,h)/t);i=Math.max(i,30),e(this,o).style.width="100%",e(this,o).style.height=i+"px",u(this,a,t-i),e(this,r).scrollHeight>e(this,r).offsetHeight||(this.style.display="none")});n(this,b,t=>{document.documentElement.classList.add("grabbing"),k.setupDrag(y=>{const w=e(this,h)/e(this,a),z=(y.y-E)*w;e(this,r).scroll({top:i+z,behavior:"instant"})},()=>{document.documentElement.classList.remove("grabbing")});const i=e(this,r).scrollTop,E=t.y});n(this,g,()=>{e(this,c).call(this)})}connectedCallback(){const t=this.getAttribute("data-scroll");let i=null;t&&(i=document.querySelector(t)),i||(i=T.findScrollParentElement(this));const E=this.querySelector("[data-thumb]");i&&E&&(u(this,r,i),u(this,o,E),v.elementResizer.subscribe(e(this,r),e(this,c)),L.windowResizer.subscribe(e(this,c)),e(this,r).addEventListener("scroll",e(this,d)),e(this,o).addEventListener("pointerdown",e(this,b)),S.ticker.subscribe(e(this,g),{maxFPS:5}))}disconnectedCallback(){v.elementResizer.unsubscribe(e(this,c)),L.windowResizer.unsubscribe(e(this,c)),e(this,r).removeEventListener("scroll",e(this,d)),e(this,o).removeEventListener("pointerdown",e(this,b)),clearTimeout(e(this,m)),S.ticker.unsubscribe(e(this,g))}}r=new WeakMap,o=new WeakMap,a=new WeakMap,h=new WeakMap,m=new WeakMap,d=new WeakMap,c=new WeakMap,b=new WeakMap,g=new WeakMap;q.isBrowser&&!customElements.get("e-custom-scrollbar")&&customElements.define("e-custom-scrollbar",x);exports.CustomScrollbarElement=x;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
var
|
|
1
|
+
var g = (e) => {
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
|
-
var E = (e,
|
|
5
|
-
var t = (e,
|
|
6
|
-
import { elementResizer as
|
|
7
|
-
import { windowResizer as
|
|
4
|
+
var E = (e, o, s) => o.has(e) || g("Cannot " + s);
|
|
5
|
+
var t = (e, o, s) => (E(e, o, "read from private field"), s ? s.call(e) : o.get(e)), l = (e, o, s) => o.has(e) ? g("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(e) : o.set(e, s), m = (e, o, s, i) => (E(e, o, "write to private field"), i ? i.call(e, s) : o.set(e, s), s);
|
|
6
|
+
import { elementResizer as L } from "../element-resizer/index.js";
|
|
7
|
+
import { windowResizer as v } from "../window-resizer/index.js";
|
|
8
8
|
import { i as w } from "../index-euf5anj6.js";
|
|
9
9
|
import { f as z } from "../dom-CVWzyXPH.js";
|
|
10
10
|
import { s as H } from "../gestures-CcXV6fCp.js";
|
|
11
|
-
import { ticker as
|
|
12
|
-
var
|
|
11
|
+
import { ticker as S } from "../ticker/index.js";
|
|
12
|
+
var r, n, a, h, u, b, c, d, f;
|
|
13
13
|
class k extends HTMLElement {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
|
-
l(this,
|
|
16
|
+
l(this, r, null);
|
|
17
17
|
l(this, n, null);
|
|
18
18
|
l(this, a, 0);
|
|
19
|
-
l(this,
|
|
19
|
+
l(this, h, 0);
|
|
20
20
|
l(this, u);
|
|
21
21
|
l(this, b, () => {
|
|
22
22
|
this.classList.add("active"), clearTimeout(t(this, u));
|
|
23
|
-
const s = t(this,
|
|
23
|
+
const s = t(this, r).scrollTop / t(this, h) * t(this, a);
|
|
24
24
|
t(this, n).style.transform = `translate3d(0px, ${s}px, 0px)`, m(this, u, setTimeout(() => {
|
|
25
25
|
this.classList.remove("active");
|
|
26
26
|
}, 1e3));
|
|
27
27
|
});
|
|
28
|
-
l(this,
|
|
28
|
+
l(this, c, () => {
|
|
29
29
|
const s = this.offsetHeight;
|
|
30
|
-
m(this,
|
|
31
|
-
let
|
|
32
|
-
|
|
30
|
+
m(this, h, t(this, r).scrollHeight - t(this, r).offsetHeight);
|
|
31
|
+
let i = s / (t(this, h) / s);
|
|
32
|
+
i = Math.max(i, 30), t(this, n).style.width = "100%", t(this, n).style.height = i + "px", m(this, a, s - i), t(this, r).scrollHeight > t(this, r).offsetHeight || (this.style.display = "none");
|
|
33
33
|
});
|
|
34
34
|
l(this, d, (s) => {
|
|
35
35
|
document.documentElement.classList.add("grabbing"), H(
|
|
36
36
|
(y) => {
|
|
37
|
-
const
|
|
38
|
-
t(this,
|
|
39
|
-
top:
|
|
37
|
+
const x = t(this, h) / t(this, a), T = (y.y - p) * x;
|
|
38
|
+
t(this, r).scroll({
|
|
39
|
+
top: i + T,
|
|
40
40
|
behavior: "instant"
|
|
41
41
|
});
|
|
42
42
|
},
|
|
@@ -44,21 +44,24 @@ class k extends HTMLElement {
|
|
|
44
44
|
document.documentElement.classList.remove("grabbing");
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
|
-
const
|
|
47
|
+
const i = t(this, r).scrollTop, p = s.y;
|
|
48
48
|
});
|
|
49
49
|
l(this, f, () => {
|
|
50
|
-
t(this,
|
|
50
|
+
t(this, c).call(this);
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
connectedCallback() {
|
|
54
|
-
const s =
|
|
55
|
-
|
|
54
|
+
const s = this.getAttribute("data-scroll");
|
|
55
|
+
let i = null;
|
|
56
|
+
s && (i = document.querySelector(s)), i || (i = z(this));
|
|
57
|
+
const p = this.querySelector("[data-thumb]");
|
|
58
|
+
i && p && (m(this, r, i), m(this, n, p), L.subscribe(t(this, r), t(this, c)), v.subscribe(t(this, c)), t(this, r).addEventListener("scroll", t(this, b)), t(this, n).addEventListener("pointerdown", t(this, d)), S.subscribe(t(this, f), { maxFPS: 5 }));
|
|
56
59
|
}
|
|
57
60
|
disconnectedCallback() {
|
|
58
|
-
|
|
61
|
+
L.unsubscribe(t(this, c)), v.unsubscribe(t(this, c)), t(this, r).removeEventListener("scroll", t(this, b)), t(this, n).removeEventListener("pointerdown", t(this, d)), clearTimeout(t(this, u)), S.unsubscribe(t(this, f));
|
|
59
62
|
}
|
|
60
63
|
}
|
|
61
|
-
|
|
64
|
+
r = new WeakMap(), n = new WeakMap(), a = new WeakMap(), h = new WeakMap(), u = new WeakMap(), b = new WeakMap(), c = new WeakMap(), d = new WeakMap(), f = new WeakMap();
|
|
62
65
|
w && !customElements.get("e-custom-scrollbar") && customElements.define("e-custom-scrollbar", k);
|
|
63
66
|
export {
|
|
64
67
|
k as CustomScrollbarElement
|