aptechka 0.8.4 → 0.10.0
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/ElementConstructor-OK-6OPjh.cjs +1 -0
- package/lib/ElementConstructor-rValMo8f.js +372 -0
- package/lib/_createStore-C75y9luu.cjs +1 -0
- package/lib/_createStore-D3qHYaSz.js +12 -0
- package/lib/accordion/AccordionElement.d.ts +1 -2
- package/lib/accordion/index.cjs +1 -1
- package/lib/accordion/index.js +110 -122
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.d.ts +4 -5
- package/lib/canvas/index.js +69 -75
- package/lib/checkbox/index.cjs +1 -1
- package/lib/checkbox/index.d.ts +1 -3
- package/lib/checkbox/index.js +42 -45
- package/lib/connector/index.cjs +1 -1
- package/lib/connector/index.d.ts +2 -2
- package/lib/connector/index.js +39 -34
- package/lib/counter/index.d.ts +1 -3
- package/lib/{createStylesheet-BsMSWX0q.cjs → createStylesheet-9nksoWW0.cjs} +1 -1
- package/lib/{createStylesheet-BxKITIVV.js → createStylesheet-BrFGJ8Q7.js} +1 -1
- package/lib/element-constructor/ElementConstructor.d.ts +6 -5
- package/lib/element-constructor/index.cjs +1 -1
- package/lib/element-constructor/index.js +114 -113
- package/lib/en3/objects/fluid/En3FluidElement.d.ts +1 -2
- package/lib/globals-DMjysUXI.js +8 -0
- package/lib/globals-bYKki-b9.cjs +1 -0
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +7 -15
- package/lib/index-3R8YL-P3.js +266 -0
- package/lib/index-CyQAdqFu.cjs +9 -0
- package/lib/instantiate-BuVJ8pIJ.cjs +1 -0
- package/lib/instantiate-TYteKsII.js +134 -0
- package/lib/jsx/ComponentElement.d.ts +18 -0
- package/lib/jsx/globals.d.ts +13 -0
- package/lib/jsx/h.d.ts +6 -0
- package/lib/jsx/hooks/animation/createDamped.d.ts +3 -0
- package/lib/jsx/hooks/animation/createTweened.d.ts +3 -0
- package/lib/jsx/hooks/animation/index.cjs +1 -0
- package/lib/jsx/hooks/animation/index.d.ts +2 -0
- package/lib/jsx/hooks/animation/index.js +15 -0
- package/lib/jsx/hooks/basic/_createStore.d.ts +4 -0
- package/lib/jsx/hooks/basic/attachInternals.d.ts +1 -0
- package/lib/jsx/hooks/basic/attachShadow.d.ts +1 -0
- package/lib/jsx/hooks/basic/attachStylesheet.d.ts +3 -0
- package/lib/jsx/hooks/basic/createContext.d.ts +2 -0
- package/lib/jsx/hooks/basic/createRef.d.ts +3 -0
- package/lib/jsx/hooks/basic/onConnect.d.ts +3 -0
- package/lib/jsx/hooks/basic/onDisconnect.d.ts +3 -0
- package/lib/jsx/hooks/basic/onStoreChange.d.ts +3 -0
- package/lib/jsx/hooks/onAnimationFrame.cjs +1 -0
- package/lib/jsx/hooks/onAnimationFrame.d.ts +6 -0
- package/lib/jsx/hooks/onAnimationFrame.js +22 -0
- package/lib/jsx/hooks/onElementResize.cjs +1 -0
- package/lib/jsx/hooks/onElementResize.d.ts +5 -0
- package/lib/jsx/hooks/onElementResize.js +11 -0
- package/lib/jsx/hooks/onIntersection.cjs +1 -0
- package/lib/jsx/hooks/onIntersection.d.ts +5 -0
- package/lib/jsx/hooks/onIntersection.js +11 -0
- package/lib/jsx/hooks/onWindowResize.cjs +1 -0
- package/lib/jsx/hooks/onWindowResize.d.ts +3 -0
- package/lib/jsx/hooks/onWindowResize.js +8 -0
- package/lib/jsx/hooks/store/createCached.d.ts +3 -0
- package/lib/jsx/hooks/store/createComposed.d.ts +3 -0
- package/lib/jsx/hooks/store/createDerived.d.ts +3 -0
- package/lib/jsx/hooks/store/createDerivedArray.d.ts +3 -0
- package/lib/jsx/hooks/store/createResource.d.ts +3 -0
- package/lib/jsx/hooks/store/createStore.d.ts +3 -0
- package/lib/jsx/hooks/store/index.cjs +1 -0
- package/lib/jsx/hooks/store/index.d.ts +6 -0
- package/lib/jsx/hooks/store/index.js +31 -0
- package/lib/jsx/hooks/watchAttribute.cjs +1 -0
- package/lib/jsx/hooks/watchAttribute.d.ts +6 -0
- package/lib/jsx/hooks/watchAttribute.js +17 -0
- package/lib/jsx/hooks/watchCSSProperty.cjs +1 -0
- package/lib/jsx/hooks/watchCSSProperty.d.ts +7 -0
- package/lib/jsx/hooks/watchCSSProperty.js +17 -0
- package/lib/jsx/index.cjs +1 -0
- package/lib/jsx/index.d.ts +15 -0
- package/lib/jsx/index.js +106 -0
- package/lib/jsx/instantiate.d.ts +5 -0
- package/lib/jsx/register.d.ts +1 -0
- package/lib/jsx/render.d.ts +6 -0
- package/lib/jsx/type.d.ts +198 -0
- package/lib/modal/index.cjs +1 -1
- package/lib/modal/index.js +34 -36
- package/lib/onConnect-DGP866cj.cjs +1 -0
- package/lib/onConnect-y5DrxJ9P.js +7 -0
- package/lib/order/index.cjs +1 -1
- package/lib/order/index.d.ts +5 -4
- package/lib/order/index.js +1 -1
- package/lib/pointer/PointerElement.d.ts +1 -2
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +105 -117
- package/lib/popover/PopoverButtonElement.d.ts +1 -2
- package/lib/popover/PopoverElement.d.ts +1 -2
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +109 -124
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +76 -73
- package/lib/scroll/ScrollElement.d.ts +1 -2
- package/lib/scroll/ScrollUserElement.d.ts +1 -2
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +674 -753
- package/lib/select/SelectElement.d.ts +1 -3
- package/lib/select/SelectUserElement.d.ts +1 -2
- package/lib/select/index.cjs +1 -1
- package/lib/select/index.js +1 -1
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +104 -107
- package/lib/slicer/SlicerElement.d.ts +1 -2
- package/lib/slicer/index.cjs +5 -5
- package/lib/slicer/index.js +88 -106
- package/lib/source/SourceElement.d.ts +1 -2
- package/lib/source/index.cjs +2 -2
- package/lib/source/index.js +19 -20
- package/lib/store/Cached.d.ts +13 -0
- package/lib/store/Derived.d.ts +3 -3
- package/lib/store/DerivedArray.d.ts +8 -0
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.d.ts +2 -0
- package/lib/store/index.js +65 -31
- package/lib/tags-BosXYPYv.cjs +1 -0
- package/lib/tags-D0kLlFdQ.js +485 -0
- package/lib/theme/index.cjs +1 -1
- package/lib/theme/index.js +2 -1
- package/lib/tweaker/TweakerFieldElement.d.ts +1 -2
- package/lib/tweaker/TweakerFolderElement.d.ts +1 -2
- package/lib/tweaker/TweakerStoreManagerElement.d.ts +1 -2
- package/lib/tweaker/index.cjs +3 -3
- package/lib/tweaker/index.js +393 -472
- package/lib/utils/bytes.d.ts +1 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +122 -105
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +25 -29
- package/package.json +73 -9
- package/lib/custom-element/index.cjs +0 -1
- package/lib/custom-element/index.d.ts +0 -8
- package/lib/custom-element/index.js +0 -30
- package/lib/index-CzpP1Tg6.cjs +0 -9
- package/lib/index-Dwd_62sm.js +0 -301
- package/lib/tags-CAfasCGV.cjs +0 -1
- package/lib/tags-D9lNDPX8.js +0 -848
package/lib/popover/index.js
CHANGED
|
@@ -1,181 +1,166 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var S = (o, n, t) => {
|
|
2
|
+
if (!n.has(o))
|
|
3
|
+
throw TypeError("Cannot " + t);
|
|
4
|
+
};
|
|
5
|
+
var e = (o, n, t) => (S(o, n, "read from private field"), t ? t.call(o) : n.get(o)), i = (o, n, t) => {
|
|
6
|
+
if (n.has(o))
|
|
7
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
8
|
+
n instanceof WeakSet ? n.add(o) : n.set(o, t);
|
|
9
|
+
}, h = (o, n, t, a) => (S(o, n, "write to private field"), a ? a.call(o, t) : n.set(o, t), t);
|
|
10
|
+
var A = (o, n, t) => (S(o, n, "access private method"), t);
|
|
11
|
+
import { Attribute as O } from "../attribute/index.js";
|
|
3
12
|
import { S as R } from "../Store-Qr3SNOSf.js";
|
|
4
13
|
import { g as B } from "../style-j2TwriJ_.js";
|
|
5
|
-
import { i as
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return a && o && U(t, s, o), o;
|
|
11
|
-
}, A = (e, t, s) => {
|
|
12
|
-
if (!t.has(e))
|
|
13
|
-
throw TypeError("Cannot " + s);
|
|
14
|
-
}, i = (e, t, s) => (A(e, t, "read from private field"), s ? s.call(e) : t.get(e)), p = (e, t, s) => {
|
|
15
|
-
if (t.has(e))
|
|
16
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
17
|
-
t instanceof WeakSet ? t.add(e) : t.set(e, s);
|
|
18
|
-
}, O = (e, t, s, a) => (A(e, t, "write to private field"), t.set(e, s), s), b = (e, t, s) => (A(e, t, "access private method"), s), S, l, E, d, u, g, $, I, _, m, L, y, C, P, w;
|
|
19
|
-
let h = class extends q {
|
|
14
|
+
import { i as N } from "../browser-0zX67oeU.js";
|
|
15
|
+
import "../ticker/index.js";
|
|
16
|
+
import { e as D } from "../tags-D0kLlFdQ.js";
|
|
17
|
+
var g, c, y, l, d, u, _, H, v, L, f, E, b, x, m;
|
|
18
|
+
const p = class p extends HTMLElement {
|
|
20
19
|
constructor() {
|
|
21
|
-
super()
|
|
22
|
-
|
|
20
|
+
super();
|
|
21
|
+
i(this, _);
|
|
22
|
+
i(this, v);
|
|
23
|
+
i(this, b);
|
|
24
|
+
i(this, g, void 0);
|
|
25
|
+
i(this, c, void 0);
|
|
26
|
+
i(this, y, void 0);
|
|
27
|
+
i(this, l, void 0);
|
|
28
|
+
i(this, d, void 0);
|
|
29
|
+
i(this, u, void 0);
|
|
30
|
+
i(this, f, void 0);
|
|
31
|
+
i(this, E, void 0);
|
|
32
|
+
i(this, m, void 0);
|
|
33
|
+
h(this, g, -1), h(this, c, new R(!1)), h(this, l, new O(this, "history", !1)), h(this, d, new O(this, "single", !1)), h(this, u, !1), this.open = (t = !0) => {
|
|
34
|
+
if (e(this, c).current)
|
|
23
35
|
return;
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
addEventListener("click",
|
|
36
|
+
e(this, c).current = !0, e(this, d).current && (p.__opened.forEach((r) => r.close()), p.__opened = []), p.__opened.push(this), h(this, g, p.__opened.length - 1), e(this, l).current && e(this, u) && history.pushState("", "", e(this, _, H)), clearTimeout(e(this, y)), this.classList.add("triggered"), this.style.display = "block", this.dispatchEvent(new CustomEvent("popoverTriggered"));
|
|
37
|
+
const a = () => {
|
|
38
|
+
addEventListener("click", e(this, f)), addEventListener("keydown", e(this, E)), this.style.opacity = "1", this.classList.add("opened"), this.dispatchEvent(new CustomEvent("popoverOpened"));
|
|
27
39
|
};
|
|
28
|
-
|
|
40
|
+
t ? setTimeout(a) : a();
|
|
29
41
|
}, this.close = () => {
|
|
30
|
-
if (
|
|
31
|
-
if (
|
|
32
|
-
const
|
|
33
|
-
|
|
42
|
+
if (e(this, c).current) {
|
|
43
|
+
if (e(this, c).current = !1, p.__opened = p.__opened.filter((t) => t !== this), e(this, l).current) {
|
|
44
|
+
const t = new URL(location.href);
|
|
45
|
+
t.searchParams.delete(e(this, v, L)), history.replaceState(null, "", t.href);
|
|
34
46
|
}
|
|
35
|
-
this.classList.remove("opened"), this.style.opacity = "0", this.dispatchEvent(new CustomEvent("popoverClosing")), removeEventListener("click",
|
|
47
|
+
this.classList.remove("opened"), this.style.opacity = "0", this.dispatchEvent(new CustomEvent("popoverClosing")), removeEventListener("click", e(this, f)), removeEventListener("keydown", e(this, E)), setTimeout(() => {
|
|
36
48
|
this.classList.remove("triggered"), this.style.display = "none", this.dispatchEvent(new CustomEvent("popoverClosed"));
|
|
37
49
|
}, B(this) + 10);
|
|
38
50
|
}
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
var
|
|
42
|
-
const
|
|
43
|
-
(!
|
|
51
|
+
}, h(this, f, (t) => {
|
|
52
|
+
A(this, b, x).call(this, () => {
|
|
53
|
+
var M;
|
|
54
|
+
const r = t.composedPath()[0], q = r instanceof HTMLElement && (this.contains(r) || ((M = this.shadowRoot) == null ? void 0 : M.contains(r))), I = r instanceof HTMLElement && r.hasAttribute("outside");
|
|
55
|
+
(!q || I) && this.close();
|
|
44
56
|
});
|
|
45
|
-
}),
|
|
46
|
-
|
|
47
|
-
|
|
57
|
+
}), h(this, E, (t) => {
|
|
58
|
+
A(this, b, x).call(this, () => {
|
|
59
|
+
t.code === "Escape" && this.close();
|
|
48
60
|
});
|
|
49
|
-
}),
|
|
50
|
-
|
|
61
|
+
}), h(this, m, () => {
|
|
62
|
+
h(this, u, !1), e(this, c).current && e(this, l).current && !location.search.includes(e(this, v, L)) ? this.close() : !e(this, c).current && e(this, l).current && location.search.includes(e(this, v, L)) && this.open(), h(this, u, !0);
|
|
51
63
|
}), this.setAttribute("popover-target", "");
|
|
52
64
|
}
|
|
53
65
|
get history() {
|
|
54
|
-
return
|
|
66
|
+
return e(this, l);
|
|
55
67
|
}
|
|
56
68
|
get single() {
|
|
57
|
-
return
|
|
69
|
+
return e(this, d);
|
|
58
70
|
}
|
|
59
71
|
get opened() {
|
|
60
|
-
return
|
|
72
|
+
return e(this, c);
|
|
61
73
|
}
|
|
62
74
|
connectedCallback() {
|
|
63
|
-
|
|
64
|
-
|
|
75
|
+
e(this, l).observe(), e(this, d).observe(), this.style.opacity = "0", this.style.display = "none", addEventListener("popstate", e(this, m)), setTimeout(() => {
|
|
76
|
+
e(this, m).call(this);
|
|
65
77
|
}, 0);
|
|
66
78
|
}
|
|
67
79
|
disconnectedCallback() {
|
|
68
|
-
|
|
80
|
+
e(this, l).unobserve(), e(this, d).unobserve(), p.__opened = p.__opened.filter((t) => t !== this), clearTimeout(e(this, y)), removeEventListener("popstate", e(this, m));
|
|
69
81
|
}
|
|
70
82
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
d = /* @__PURE__ */ new WeakMap();
|
|
75
|
-
u = /* @__PURE__ */ new WeakMap();
|
|
76
|
-
g = /* @__PURE__ */ new WeakMap();
|
|
77
|
-
$ = /* @__PURE__ */ new WeakSet();
|
|
78
|
-
I = function() {
|
|
79
|
-
return `${location.pathname}${location.search ? location.search + "&" : "?"}${i(this, _, m)}`;
|
|
80
|
-
};
|
|
81
|
-
_ = /* @__PURE__ */ new WeakSet();
|
|
82
|
-
m = function() {
|
|
83
|
+
g = new WeakMap(), c = new WeakMap(), y = new WeakMap(), l = new WeakMap(), d = new WeakMap(), u = new WeakMap(), _ = new WeakSet(), H = function() {
|
|
84
|
+
return `${location.pathname}${location.search ? location.search + "&" : "?"}${e(this, v, L)}`;
|
|
85
|
+
}, v = new WeakSet(), L = function() {
|
|
83
86
|
return `modal-${this.id}`;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
w = /* @__PURE__ */ new WeakMap();
|
|
92
|
-
h.__opened = [];
|
|
93
|
-
h = F([
|
|
94
|
-
H("e-popover")
|
|
95
|
-
], h);
|
|
96
|
-
var J = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, V = (e, t, s, a) => {
|
|
97
|
-
for (var o = a > 1 ? void 0 : a ? Q(t, s) : t, c = e.length - 1, v; c >= 0; c--)
|
|
98
|
-
(v = e[c]) && (o = (a ? v(t, s, o) : v(o)) || o);
|
|
99
|
-
return a && o && J(t, s, o), o;
|
|
100
|
-
}, N = (e, t, s) => {
|
|
101
|
-
if (!t.has(e))
|
|
102
|
-
throw TypeError("Cannot " + s);
|
|
103
|
-
}, r = (e, t, s) => (N(e, t, "read from private field"), s ? s.call(e) : t.get(e)), f = (e, t, s) => {
|
|
104
|
-
if (t.has(e))
|
|
105
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
106
|
-
t instanceof WeakSet ? t.add(e) : t.set(e, s);
|
|
107
|
-
}, X = (e, t, s, a) => (N(e, t, "write to private field"), t.set(e, s), s), n, k, T, M, W;
|
|
108
|
-
let D = class extends q {
|
|
87
|
+
}, f = new WeakMap(), E = new WeakMap(), b = new WeakSet(), x = function(t) {
|
|
88
|
+
(p.__opened[e(this, g) - 1] || p.__opened.length === 1) && t();
|
|
89
|
+
}, m = new WeakMap(), p.__opened = [];
|
|
90
|
+
let $ = p;
|
|
91
|
+
customElements.get("e-popover") || customElements.define("e-popover", $);
|
|
92
|
+
var s, T, w, C, k;
|
|
93
|
+
class K extends HTMLElement {
|
|
109
94
|
constructor() {
|
|
110
|
-
super()
|
|
95
|
+
super();
|
|
96
|
+
i(this, s, void 0);
|
|
97
|
+
i(this, T, () => {
|
|
111
98
|
this.classList.add("triggered");
|
|
112
|
-
})
|
|
99
|
+
});
|
|
100
|
+
i(this, w, () => {
|
|
113
101
|
this.classList.add("opened");
|
|
114
|
-
})
|
|
102
|
+
});
|
|
103
|
+
i(this, C, () => {
|
|
115
104
|
this.classList.remove("opened");
|
|
116
|
-
})
|
|
105
|
+
});
|
|
106
|
+
i(this, k, () => {
|
|
117
107
|
this.classList.remove("triggered");
|
|
118
|
-
})
|
|
108
|
+
});
|
|
109
|
+
N && D(this, {
|
|
119
110
|
tabindex: this.getAttribute("tabindex") || "0",
|
|
120
111
|
onClick: () => {
|
|
121
|
-
if (
|
|
122
|
-
const
|
|
123
|
-
|
|
112
|
+
if (e(this, s)) {
|
|
113
|
+
const t = this.getAttribute("type") || "open";
|
|
114
|
+
t === "open" || t === "toggle" && !e(this, s).opened.current ? e(this, s).open() : (t === "close" || t === "toggle" && e(this, s).opened.current) && e(this, s).close();
|
|
124
115
|
}
|
|
125
116
|
},
|
|
126
|
-
onKeydown: (
|
|
127
|
-
|
|
117
|
+
onKeydown: (t) => {
|
|
118
|
+
t.code === "Space" && t.currentTarget.click();
|
|
128
119
|
}
|
|
129
120
|
});
|
|
130
121
|
}
|
|
131
122
|
get popoverElement() {
|
|
132
|
-
return
|
|
123
|
+
return e(this, s);
|
|
133
124
|
}
|
|
134
125
|
connectedCallback() {
|
|
135
|
-
var
|
|
136
|
-
const
|
|
137
|
-
if (
|
|
138
|
-
let
|
|
139
|
-
|
|
126
|
+
var a;
|
|
127
|
+
const t = this.getAttribute("target");
|
|
128
|
+
if (t) {
|
|
129
|
+
let r = null;
|
|
130
|
+
t === "parent" ? r = this.closest("[popover-target]") : t === "sibling" ? r = (a = this.parentElement) == null ? void 0 : a.querySelector("[popover-target]") : r = document.querySelector(`#${t}`) || this.getRootNode().querySelector(`#${t}`), r instanceof HTMLElement ? (h(this, s, r), e(this, s).addEventListener(
|
|
140
131
|
"popoverTriggered",
|
|
141
|
-
|
|
142
|
-
),
|
|
132
|
+
e(this, T)
|
|
133
|
+
), e(this, s).addEventListener(
|
|
143
134
|
"popoverOpened",
|
|
144
|
-
|
|
145
|
-
),
|
|
135
|
+
e(this, w)
|
|
136
|
+
), e(this, s).addEventListener(
|
|
146
137
|
"popoverClosing",
|
|
147
|
-
|
|
148
|
-
),
|
|
138
|
+
e(this, C)
|
|
139
|
+
), e(this, s).addEventListener(
|
|
149
140
|
"popoverClosed",
|
|
150
|
-
|
|
151
|
-
)) : console.warn(this, `target ${
|
|
141
|
+
e(this, k)
|
|
142
|
+
)) : console.warn(this, `target ${t} not found`);
|
|
152
143
|
}
|
|
153
144
|
}
|
|
154
145
|
disconnectedCallback() {
|
|
155
|
-
|
|
146
|
+
e(this, s) && (e(this, s).removeEventListener(
|
|
156
147
|
"popoverTriggered",
|
|
157
|
-
|
|
158
|
-
),
|
|
148
|
+
e(this, T)
|
|
149
|
+
), e(this, s).removeEventListener(
|
|
159
150
|
"popoverOpened",
|
|
160
|
-
|
|
161
|
-
),
|
|
151
|
+
e(this, w)
|
|
152
|
+
), e(this, s).removeEventListener(
|
|
162
153
|
"popoverClosing",
|
|
163
|
-
|
|
164
|
-
),
|
|
154
|
+
e(this, C)
|
|
155
|
+
), e(this, s).removeEventListener(
|
|
165
156
|
"popoverClosed",
|
|
166
|
-
|
|
157
|
+
e(this, k)
|
|
167
158
|
));
|
|
168
159
|
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
T = /* @__PURE__ */ new WeakMap();
|
|
173
|
-
M = /* @__PURE__ */ new WeakMap();
|
|
174
|
-
W = /* @__PURE__ */ new WeakMap();
|
|
175
|
-
D = V([
|
|
176
|
-
H("e-popover-button")
|
|
177
|
-
], D);
|
|
160
|
+
}
|
|
161
|
+
s = new WeakMap(), T = new WeakMap(), w = new WeakMap(), C = new WeakMap(), k = new WeakMap();
|
|
162
|
+
customElements.get("e-popover-button") || customElements.define("e-popover-button", K);
|
|
178
163
|
export {
|
|
179
|
-
|
|
180
|
-
|
|
164
|
+
K as PopoverButtonElement,
|
|
165
|
+
$ as PopoverElement
|
|
181
166
|
};
|
package/lib/router/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Z=(
|
|
1
|
+
"use strict";var Z=(a,e)=>(e=Symbol[a])?e:Symbol.for("Symbol."+a);var K=(a,e,s)=>{if(!e.has(a))throw TypeError("Cannot "+s)};var t=(a,e,s)=>(K(a,e,"read from private field"),s?s.call(a):e.get(a)),r=(a,e,s)=>{if(e.has(a))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(a):e.set(a,s)},n=(a,e,s,i)=>(K(a,e,"write to private field"),i?i.call(a,s):e.set(a,s),s);var W=(a,e,s)=>(K(a,e,"access private method"),s);var M=(a,e,s)=>new Promise((i,h)=>{var o=u=>{try{f(s.next(u))}catch(w){h(w)}},c=u=>{try{f(s.throw(u))}catch(w){h(w)}},f=u=>u.done?i(u.value):Promise.resolve(u.value).then(o,c);f((s=s.apply(a,e)).next())});var Y=(a,e,s)=>(e=a[Z("asyncIterator")])?e.call(a):(a=a[Z("iterator")](),e={},s=(i,h)=>(h=a[i])&&(e[i]=o=>new Promise((c,f,u)=>(o=h.call(a,o),u=o.done,Promise.resolve(o.value).then(w=>c({value:w,done:u}),f)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const at=require("urlpattern-polyfill"),rt=require("../notifier/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),ht=require("../function-MthRj-GJ.cjs"),F=require("../url-C3dWnJQg.cjs"),ot=require("../instantiate-BuVJ8pIJ.cjs"),$=require("../object-CCiXnER2.cjs");var R,O,A,p,d,v,S,L,b,E,x,et;class ct{constructor(e,s){r(this,x);r(this,R,void 0);r(this,O,void 0);r(this,A,void 0);r(this,p,void 0);r(this,d,void 0);r(this,v,void 0);r(this,S,void 0);r(this,L,null);r(this,b,[]);r(this,E,[]);n(this,R,e),n(this,O,s),n(this,A,new URLPattern({pathname:t(this,R)})),n(this,p,null),n(this,d,null),n(this,v,!1),n(this,S,null),tt.isBrowser&&n(this,L,new MutationObserver(i=>{i[0].addedNodes.forEach(o=>{t(this,p)?t(this,E).push(o):t(this,b).push(o)})}))}get pattern(){return t(this,R)}get urlPattern(){return t(this,A)}get isActive(){return t(this,v)}get element(){return t(this,d)}get nest(){return t(this,S)}testPathname(e){return this.urlPattern.test({pathname:e})}render(e,s){return M(this,null,function*(){var i,h;if(t(this,L).observe(document.head,{childList:!0,subtree:!0}),t(this,p))t(this,b).forEach(o=>{document.head.appendChild(o)});else{const o=yield t(this,O).call(this);if(n(this,E,[...t(this,b)]),typeof o.default=="function"&&(n(this,p,o.default),$.isESClass(o.default))){const c="e-"+((i=t(this,p))==null?void 0:i.name.toLowerCase());customElements.get(c)||customElements.define(c,o.default)}}if(yield W(this,x,et).call(this),t(this,p)){const o=t(this,A).exec({pathname:s}),c=(o==null?void 0:o.pathname.groups)||{},f=Object.fromEntries(new URLSearchParams(location.search)),u={pathnameParams:c,searchParams:f};$.isESClass(t(this,p))?n(this,d,new(t(this,p))(u)):n(this,d,ot.instantiate(t(this,p),{attributes:u})),e.appendChild(t(this,d)),n(this,S,t(this,d).querySelector("[data-nest]")||((h=t(this,d).shadowRoot)==null?void 0:h.querySelector("[data-nest]"))||t(this,d).shadowRoot||t(this,d)),n(this,v,!0)}t(this,L).disconnect()})}close(){var e;t(this,L).disconnect(),(e=t(this,d))==null||e.remove(),n(this,v,!1),t(this,E).forEach(s=>document.head.removeChild(s)),n(this,E,[])}getAnchorElements(){var s;let e=[];return t(this,d)&&(e=[...t(this,d).querySelectorAll("a")]),(s=t(this,d))!=null&&s.shadowRoot&&(e=[...e,...t(this,d).shadowRoot.querySelectorAll("a")]),e}}R=new WeakMap,O=new WeakMap,A=new WeakMap,p=new WeakMap,d=new WeakMap,v=new WeakMap,S=new WeakMap,L=new WeakMap,b=new WeakMap,E=new WeakMap,x=new WeakSet,et=function(){return M(this,null,function*(){const e=t(this,b).filter(c=>c instanceof HTMLElement?c.tagName==="STYLE"||c.tagName==="SCRIPT"||c.tagName==="LINK":!1);try{for(var s=Y(e),i,h,o;i=!(h=yield s.next()).done;i=!1){const c=h.value;yield new Promise(f=>{c.onload=()=>{f()}})}}catch(h){o=[h]}finally{try{i&&(h=s.return)&&(yield h.call(s))}finally{if(o)throw o[0]}}})};var k,m,P,U,q,j;class lt{constructor(e,s){r(this,k,void 0);r(this,m,void 0);r(this,P,void 0);r(this,U,void 0);r(this,q,void 0);r(this,j,e=>{e.preventDefault(),t(this,k).links.forEach(s=>{var i;t(this,P)===t(s,P)||(i=t(s,q))!=null&&i.includes(t(this,P))?t(s,m).classList.add("clicked"):t(s,m).classList.remove("clicked")}),t(this,k).navigate(t(this,P),t(this,U))});var o,c;n(this,k,e),n(this,m,s),n(this,P,t(this,m).getAttribute("href")||"/"),n(this,U,t(this,m).getAttribute("data-history-action")||"push"),t(this,m).addEventListener("click",t(this,j));const i=e.normalizePath(t(this,P)),h=e.normalizePath(location.pathname);n(this,q,(o=t(this,m).getAttribute("data-match-paths"))==null?void 0:o.split(",").map(f=>e.normalizePath(f.trim()).pathname)),t(this,m).hasAttribute("data-include")?h.pathname.includes(i.pathname)&&t(this,m).classList.add("current"):i.pathname===h.pathname||(c=t(this,q))!=null&&c.includes(h.pathname)?(t(this,m).classList.add("current"),t(this,m).classList.add("clicked")):t(this,m).classList.remove("clicked")}destroy(){t(this,m).removeEventListener("click",t(this,j)),t(this,m).classList.remove("current")}}k=new WeakMap,m=new WeakMap,P=new WeakMap,U=new WeakMap,q=new WeakMap,j=new WeakMap;globalThis.URLPattern=at.URLPattern;var C,N,g,z,T,y,H,B,I,_,st,D;class ut{constructor(e){r(this,_);r(this,C,null);r(this,N,null);r(this,g,[]);r(this,z,null);r(this,T,[]);r(this,y,void 0);r(this,H,null);r(this,B,new rt.Notifier);r(this,I,ht.debounce(()=>{const e=s=>s.split("/").length;n(this,g,t(this,g).sort((s,i)=>e(s.pattern)-e(i.pattern))),this.navigate(location.pathname)},0));r(this,D,e=>{e.state&&this.navigate(e.state,"none")});tt.isBrowser&&(e!=null&&e.base?n(this,N,F.normalizeBase(e.base)):n(this,N,"/"),n(this,C,(e==null?void 0:e.rootElement)||document.body),addEventListener("popstate",t(this,D)))}get currentPathname(){return t(this,H)}get candidatePathname(){return t(this,y)}get routes(){return t(this,g)}get links(){return t(this,T)}navigationEvent(e){return t(this,B).subscribe(e)}defineRoute(e,s){const i=new ct(e,s);t(this,g).push(i),t(this,I).call(this)}navigate(e,s="push"){return M(this,null,function*(){var Q,V;const i=this.normalizePath(e);let{pathname:h,hash:o,parameters:c,leaf:f}=i;if(t(this,y)===h||t(this,H)===h)return;n(this,y,h);const u=t(this,g).filter(l=>l.isActive),w=t(this,g).filter(l=>!u.includes(l)&&l.testPathname(f)),it=u.filter(l=>!l.testPathname(f)),G=u.filter(l=>l.testPathname(f));let J=!0;if(this.preprocessor)try{yield new Promise((l,nt)=>{var X;(X=this.preprocessor)==null||X.call(this,{path:i,resolve:l,reject:nt})})}catch(l){l?console.error(l):console.log("Route change canceled"),J=!1}if(J&&t(this,y)===h){n(this,z,G[G.length-1]),it.forEach(l=>{l.close()}),n(this,H,h),F.changeHistory(s,h,c,o);try{for(var ft=Y(w),pt,gt,Pt;pt=!(gt=yield ft.next()).done;pt=!1){const l=gt.value;yield l.render(((Q=t(this,z))==null?void 0:Q.nest)||t(this,C),h),n(this,z,l)}}catch(gt){Pt=[gt]}finally{try{pt&&(gt=ft.return)&&(yield gt.call(ft))}finally{if(Pt)throw Pt[0]}}W(this,_,st).call(this),(V=this.postprocessor)==null||V.call(this,{pathname:h}),t(this,B).notify({pathname:h})}})}normalizePath(e){return F.splitPath(e,t(this,N))}}C=new WeakMap,N=new WeakMap,g=new WeakMap,z=new WeakMap,T=new WeakMap,y=new WeakMap,H=new WeakMap,B=new WeakMap,I=new WeakMap,_=new WeakSet,st=function(){const e=t(this,g).filter(i=>i.isActive),s=Array.from(new Set([...t(this,C).querySelectorAll("a"),...e.map(i=>i.getAnchorElements()).flat()].filter(i=>{var h;return(h=i.getAttribute("href"))==null?void 0:h.startsWith("/")})));t(this,T).forEach(i=>{i.destroy()}),n(this,T,s.map(i=>new lt(this,i)))},D=new WeakMap;exports.Router=ut;
|