aptechka 0.64.7 → 0.64.8
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 +1 -1
- package/lib/accordion/index.js +60 -58
- package/package.json +1 -1
package/lib/accordion/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var z=s=>{throw TypeError(s)};var p=(s,i,t)=>i.has(s)||z("Cannot "+t);var e=(s,i,t)=>(p(s,i,"read from private field"),t?t.call(s):i.get(s)),o=(s,i,t)=>i.has(s)?z("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),d=(s,i,t)=>(p(s,i,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("../attribute/index.cjs"),q=require("../index-DekP7OZe.cjs"),S=require("../events-KVanG9sR.cjs"),O=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");var u,h,f,l,v,m,n,x,w,y,E,C,I;class k{constructor(i,t){o(this,n);o(this,u,null);o(this,h,null);o(this,f,null);o(this,l,null);o(this,v);o(this,m,!1);o(this,w,()=>{e(this,m)?this.close():this.open()});o(this,y,i=>{e(this,m)&&!(i instanceof CustomEvent)&&(d(this,n,E).call(this,0,!0),d(this,n,E).call(this,e(this,n,x)))});t.firstElementChild instanceof HTMLElement&&t.lastElementChild instanceof HTMLElement?(c(this,u,i),c(this,h,t),c(this,f,t.firstElementChild),c(this,l,t.lastElementChild),e(this,l).style.overflow="hidden",e(this,u).axisAttribute.current==="y"?e(this,l).style.height="0px":e(this,l).style.width="0px",addEventListener("resize",e(this,y)),e(this,f).addEventListener("click",e(this,w)),e(this,h).hasAttribute("data-opened")&&this.open({skipTransition:!0})):i.removeItem(e(this,h))}get element(){return e(this,h)}destroy(){e(this,f)&&(e(this,h).classList.remove("opened","triggered"),e(this,h).removeAttribute("data-opened"),e(this,f).style.cursor="",d(this,n,E).call(this,void 0),removeEventListener("resize",e(this,y)),e(this,f).removeEventListener("click",e(this,w)),clearTimeout(e(this,v)))}open(i){i!=null&&i.skipTransition&&d(this,n,C).call(this),e(this,u).multipleAttribute.current||e(this,u).closeAll({exclude:e(this,h)}),c(this,m,!0),clearTimeout(e(this,v)),e(this,h).classList.add("triggered"),d(this,n,E).call(this,e(this,n,x)),setTimeout(()=>{e(this,h).classList.add("opened"),e(this,h).setAttribute("data-opened",""),d(this,n,I).call(this)},0),S.dispatchEvent(this.element,"accordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:e(this,m),element:e(this,h)}})}close(i){i!=null&&i.skipTransition&&d(this,n,C).call(this),clearTimeout(e(this,v)),c(this,m,!1),e(this,h).classList.remove("opened"),d(this,n,E).call(this,0),d(this,n,I).call(this,()=>{e(this,h).classList.remove("triggered")}),S.dispatchEvent(this.element,"accordionItemToggle",{bubbles:!0,composed:!0,detail:{opened:e(this,m),element:e(this,h)}})}}u=new WeakMap,h=new WeakMap,f=new WeakMap,l=new WeakMap,v=new WeakMap,m=new WeakMap,n=new WeakSet,x=function(){return e(this,u).axisAttribute.current==="x"?e(this,l).scrollWidth:e(this,l).scrollHeight},w=new WeakMap,y=new WeakMap,E=function(i,t=!1){t&&(e(this,l).style.transition="all 0s",setTimeout(()=>{e(this,l).style.transition=""}));const r=e(this,u).axisAttribute.current==="x"?"width":"height";i!=null?e(this,l).style[r]=`${i}px`:e(this,l).style[r]=""},C=function(){e(this,l).style.transition="all 0s",setTimeout(()=>{e(this,l).style.transition=""},50)},I=function(i){e(this,u).hasAttribute("no-window-resize")||c(this,v,setTimeout(()=>{i==null||i(),window.dispatchEvent(new CustomEvent("resize"))},O.getElementTransitionDurationMS(e(this,l))))};var b,g,a,T,L,M;class R extends HTMLElement{constructor(){super();o(this,L);o(this,b,new H.Attribute(this,"axis","y"));o(this,g,new H.Attribute(this,"multiple",!1));o(this,a,[]);o(this,T,null);q.isBrowser&&c(this,T,new MutationObserver(t=>{t.forEach(r=>{r.removedNodes.forEach(A=>{A instanceof HTMLElement&&this.removeItem(A)}),r.addedNodes.forEach(A=>{A instanceof HTMLElement&&this.createItem(A)})})}))}get axisAttribute(){return e(this,b)}get multipleAttribute(){return e(this,g)}createItem(t){e(this,a).find(r=>r.element===t)||e(this,a).push(new k(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,g).observe(),e(this,T).observe(e(this,L,M),{childList:!0}),c(this,a,[...e(this,L,M).children].map(t=>{if(t instanceof HTMLElement)return new k(this,t)}).filter(t=>!!t))}disconnectedCallback(){e(this,b).unobserve(),e(this,g).unobserve(),e(this,T).disconnect()}}b=new WeakMap,g=new WeakMap,a=new WeakMap,T=new WeakMap,L=new WeakSet,M=function(){return this.shadowRoot?this.shadowRoot:this};q.isBrowser&&!customElements.get("e-accordion")&&customElements.define("e-accordion",R);exports.AccordionElement=R;
|
package/lib/accordion/index.js
CHANGED
|
@@ -1,92 +1,94 @@
|
|
|
1
|
-
var
|
|
1
|
+
var M = (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)),
|
|
6
|
-
import { Attribute as
|
|
7
|
-
import { i as
|
|
8
|
-
import { d as
|
|
9
|
-
import { g as
|
|
4
|
+
var x = (s, i, t) => i.has(s) || M("Cannot " + t);
|
|
5
|
+
var e = (s, i, t) => (x(s, i, "read from private field"), t ? t.call(s) : i.get(s)), o = (s, i, t) => i.has(s) ? M("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), d = (s, i, t) => (x(s, i, "access private method"), t);
|
|
6
|
+
import { Attribute as H } from "../attribute/index.js";
|
|
7
|
+
import { i as S } from "../index-Bv9zgfdb.js";
|
|
8
|
+
import { d as k } from "../events-CsVF98U6.js";
|
|
9
|
+
import { g as D } from "../style-j2TwriJ_.js";
|
|
10
10
|
import "construct-style-sheets-polyfill";
|
|
11
|
-
var
|
|
12
|
-
class
|
|
11
|
+
var c, h, f, l, E, m, n, y, w, A, v, C, I;
|
|
12
|
+
class R {
|
|
13
13
|
constructor(i, t) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
e(this,
|
|
14
|
+
o(this, n);
|
|
15
|
+
o(this, c, null);
|
|
16
|
+
o(this, h, null);
|
|
17
|
+
o(this, f, null);
|
|
18
|
+
o(this, l, null);
|
|
19
|
+
o(this, E);
|
|
20
|
+
o(this, m, !1);
|
|
21
|
+
o(this, w, () => {
|
|
22
|
+
e(this, m) ? this.close() : this.open();
|
|
23
23
|
});
|
|
24
|
-
|
|
25
|
-
e(this,
|
|
24
|
+
o(this, A, (i) => {
|
|
25
|
+
e(this, m) && !(i instanceof CustomEvent) && (d(this, n, v).call(this, 0, !0), d(this, n, v).call(this, e(this, n, y)));
|
|
26
26
|
});
|
|
27
|
-
t.firstElementChild instanceof HTMLElement && t.lastElementChild instanceof HTMLElement ? (a(this,
|
|
27
|
+
t.firstElementChild instanceof HTMLElement && t.lastElementChild instanceof HTMLElement ? (a(this, c, i), a(this, h, t), a(this, f, t.firstElementChild), a(this, l, t.lastElementChild), e(this, l).style.overflow = "hidden", e(this, c).axisAttribute.current === "y" ? e(this, l).style.height = "0px" : e(this, l).style.width = "0px", addEventListener("resize", e(this, A)), e(this, f).addEventListener("click", e(this, w)), e(this, h).hasAttribute("data-opened") && this.open({ skipTransition: !0 })) : i.removeItem(e(this, h));
|
|
28
28
|
}
|
|
29
29
|
get element() {
|
|
30
30
|
return e(this, h);
|
|
31
31
|
}
|
|
32
32
|
destroy() {
|
|
33
|
-
e(this, f) && (e(this, h).classList.remove("opened", "triggered"), e(this, h).removeAttribute("data-opened"), e(this, f).style.cursor = "",
|
|
33
|
+
e(this, f) && (e(this, h).classList.remove("opened", "triggered"), e(this, h).removeAttribute("data-opened"), e(this, f).style.cursor = "", d(this, n, v).call(this, void 0), removeEventListener("resize", e(this, A)), e(this, f).removeEventListener("click", e(this, w)), clearTimeout(e(this, E)));
|
|
34
34
|
}
|
|
35
35
|
open(i) {
|
|
36
|
-
i != null && i.skipTransition &&
|
|
37
|
-
e(this, h).classList.add("opened"), e(this, h).setAttribute("data-opened", ""),
|
|
38
|
-
|
|
39
|
-
}, H(e(this, l))));
|
|
40
|
-
}, 0), z(this.element, "accordionItemToggle", {
|
|
36
|
+
i != null && i.skipTransition && d(this, n, C).call(this), e(this, c).multipleAttribute.current || e(this, c).closeAll({ exclude: e(this, h) }), a(this, m, !0), clearTimeout(e(this, E)), e(this, h).classList.add("triggered"), d(this, n, v).call(this, e(this, n, y)), setTimeout(() => {
|
|
37
|
+
e(this, h).classList.add("opened"), e(this, h).setAttribute("data-opened", ""), d(this, n, I).call(this);
|
|
38
|
+
}, 0), k(this.element, "accordionItemToggle", {
|
|
41
39
|
bubbles: !0,
|
|
42
40
|
composed: !0,
|
|
43
41
|
detail: {
|
|
44
|
-
opened: e(this,
|
|
42
|
+
opened: e(this, m),
|
|
45
43
|
element: e(this, h)
|
|
46
44
|
}
|
|
47
45
|
});
|
|
48
46
|
}
|
|
49
47
|
close(i) {
|
|
50
|
-
i != null && i.skipTransition &&
|
|
51
|
-
e(this, h).classList.remove("triggered")
|
|
52
|
-
}
|
|
48
|
+
i != null && i.skipTransition && d(this, n, C).call(this), clearTimeout(e(this, E)), a(this, m, !1), e(this, h).classList.remove("opened"), d(this, n, v).call(this, 0), d(this, n, I).call(this, () => {
|
|
49
|
+
e(this, h).classList.remove("triggered");
|
|
50
|
+
}), k(this.element, "accordionItemToggle", {
|
|
53
51
|
bubbles: !0,
|
|
54
52
|
composed: !0,
|
|
55
53
|
detail: {
|
|
56
|
-
opened: e(this,
|
|
54
|
+
opened: e(this, m),
|
|
57
55
|
element: e(this, h)
|
|
58
56
|
}
|
|
59
57
|
});
|
|
60
58
|
}
|
|
61
59
|
}
|
|
62
|
-
|
|
63
|
-
return e(this,
|
|
64
|
-
}, w = new WeakMap(),
|
|
60
|
+
c = new WeakMap(), h = new WeakMap(), f = new WeakMap(), l = new WeakMap(), E = new WeakMap(), m = new WeakMap(), n = new WeakSet(), y = function() {
|
|
61
|
+
return e(this, c).axisAttribute.current === "x" ? e(this, l).scrollWidth : e(this, l).scrollHeight;
|
|
62
|
+
}, w = new WeakMap(), A = new WeakMap(), v = function(i, t = !1) {
|
|
65
63
|
t && (e(this, l).style.transition = "all 0s", setTimeout(() => {
|
|
66
64
|
e(this, l).style.transition = "";
|
|
67
65
|
}));
|
|
68
|
-
const r = e(this,
|
|
66
|
+
const r = e(this, c).axisAttribute.current === "x" ? "width" : "height";
|
|
69
67
|
i != null ? e(this, l).style[r] = `${i}px` : e(this, l).style[r] = "";
|
|
70
68
|
}, C = function() {
|
|
71
69
|
e(this, l).style.transition = "all 0s", setTimeout(() => {
|
|
72
70
|
e(this, l).style.transition = "";
|
|
73
71
|
}, 50);
|
|
72
|
+
}, I = function(i) {
|
|
73
|
+
e(this, c).hasAttribute("no-window-resize") || a(this, E, setTimeout(() => {
|
|
74
|
+
i == null || i(), window.dispatchEvent(new CustomEvent("resize"));
|
|
75
|
+
}, D(e(this, l))));
|
|
74
76
|
};
|
|
75
|
-
var b,
|
|
77
|
+
var b, g, u, p, L, z;
|
|
76
78
|
class N extends HTMLElement {
|
|
77
79
|
constructor() {
|
|
78
80
|
super();
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
o(this, L);
|
|
82
|
+
o(this, b, new H(this, "axis", "y"));
|
|
83
|
+
o(this, g, new H(this, "multiple", !1));
|
|
84
|
+
o(this, u, []);
|
|
85
|
+
o(this, p, null);
|
|
86
|
+
S && a(this, p, new MutationObserver((t) => {
|
|
85
87
|
t.forEach((r) => {
|
|
86
|
-
r.removedNodes.forEach((
|
|
87
|
-
|
|
88
|
-
}), r.addedNodes.forEach((
|
|
89
|
-
|
|
88
|
+
r.removedNodes.forEach((T) => {
|
|
89
|
+
T instanceof HTMLElement && this.removeItem(T);
|
|
90
|
+
}), r.addedNodes.forEach((T) => {
|
|
91
|
+
T instanceof HTMLElement && this.createItem(T);
|
|
90
92
|
});
|
|
91
93
|
});
|
|
92
94
|
}));
|
|
@@ -95,44 +97,44 @@ class N extends HTMLElement {
|
|
|
95
97
|
return e(this, b);
|
|
96
98
|
}
|
|
97
99
|
get multipleAttribute() {
|
|
98
|
-
return e(this,
|
|
100
|
+
return e(this, g);
|
|
99
101
|
}
|
|
100
102
|
createItem(t) {
|
|
101
|
-
e(this,
|
|
103
|
+
e(this, u).find((r) => r.element === t) || e(this, u).push(new R(this, t));
|
|
102
104
|
}
|
|
103
105
|
removeItem(t) {
|
|
104
|
-
a(this,
|
|
106
|
+
a(this, u, e(this, u).filter((r) => {
|
|
105
107
|
if (r.element !== t)
|
|
106
108
|
return !0;
|
|
107
109
|
r.destroy();
|
|
108
110
|
}));
|
|
109
111
|
}
|
|
110
112
|
closeAll(t) {
|
|
111
|
-
e(this,
|
|
113
|
+
e(this, u).forEach((r) => {
|
|
112
114
|
(t == null ? void 0 : t.exclude) !== r.element && r.close(t);
|
|
113
115
|
});
|
|
114
116
|
}
|
|
115
117
|
openAll(t) {
|
|
116
|
-
e(this,
|
|
118
|
+
e(this, u).forEach((r) => {
|
|
117
119
|
(t == null ? void 0 : t.exclude) !== r.element && r.open(t);
|
|
118
120
|
});
|
|
119
121
|
}
|
|
120
122
|
connectedCallback() {
|
|
121
|
-
e(this, b).observe(), e(this,
|
|
123
|
+
e(this, b).observe(), e(this, g).observe(), e(this, p).observe(e(this, L, z), {
|
|
122
124
|
childList: !0
|
|
123
|
-
}), a(this,
|
|
125
|
+
}), a(this, u, [...e(this, L, z).children].map((t) => {
|
|
124
126
|
if (t instanceof HTMLElement)
|
|
125
|
-
return new
|
|
127
|
+
return new R(this, t);
|
|
126
128
|
}).filter((t) => !!t));
|
|
127
129
|
}
|
|
128
130
|
disconnectedCallback() {
|
|
129
|
-
e(this, b).unobserve(), e(this,
|
|
131
|
+
e(this, b).unobserve(), e(this, g).unobserve(), e(this, p).disconnect();
|
|
130
132
|
}
|
|
131
133
|
}
|
|
132
|
-
b = new WeakMap(),
|
|
134
|
+
b = new WeakMap(), g = new WeakMap(), u = new WeakMap(), p = new WeakMap(), L = new WeakSet(), z = function() {
|
|
133
135
|
return this.shadowRoot ? this.shadowRoot : this;
|
|
134
136
|
};
|
|
135
|
-
|
|
137
|
+
S && !customElements.get("e-accordion") && customElements.define("e-accordion", N);
|
|
136
138
|
export {
|
|
137
139
|
N as AccordionElement
|
|
138
140
|
};
|