aptechka 0.4.12 → 0.4.14
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/{Damped-Ceg1a3X8.js → Damped-BZujMwuv.js} +11 -10
- package/lib/Damped-DK3CSBXb.cjs +1 -0
- package/lib/{Derived-B-g8dYgh.cjs → Derived-BZtlW0bB.cjs} +1 -1
- package/lib/{Derived-kPJs5JC5.js → Derived-DH-ouLBq.js} +1 -1
- package/lib/DragControls-CV1YozSr.cjs +1 -0
- package/lib/{DragControls-BbznoEAb.js → DragControls-Ch_JO2ML.js} +5 -4
- package/lib/SourceManager-Bl_uduSS.cjs +1 -0
- package/lib/{SourceManager-4OHacQoQ.js → SourceManager-D_8MZ3bR.js} +21 -20
- package/lib/Store-BQGNOHlY.cjs +1 -0
- package/lib/{Store-BQXXikps.js → Store-Cd-E5W1z.js} +8 -7
- package/lib/{Viewport-wlgZaIn7.js → Viewport-Bx-VImCe.js} +6 -5
- package/lib/Viewport-_WllZTJ0.cjs +1 -0
- package/lib/accordion/index.cjs +1 -1
- package/lib/accordion/index.js +1 -0
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +6 -5
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.js +16 -15
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +4 -3
- package/lib/checkbox/index.cjs +1 -1
- package/lib/checkbox/index.js +4 -3
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +2 -2
- package/lib/{createStylesheet-CqHU9_qv.cjs → createStylesheet-C8aQQ4hd.cjs} +1 -1
- package/lib/{createStylesheet-DBCEbDjI.js → createStylesheet-KMRQhSa-.js} +1 -1
- package/lib/createTheme-BSreUYge.cjs +1 -0
- package/lib/createTheme-u3NsrEV6.js +16 -0
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.js +4 -3
- package/lib/custom-element/index.cjs +1 -1
- package/lib/custom-element/index.d.ts +1 -0
- package/lib/custom-element/index.js +17 -12
- package/lib/dev/index.cjs +1 -1
- package/lib/dev/index.js +7 -6
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +1 -1
- package/lib/element-constructor/index.cjs +1 -1
- package/lib/element-constructor/index.js +3 -3
- package/lib/element-resizer/index.cjs +1 -1
- package/lib/element-resizer/index.js +23 -22
- package/lib/en3/index.cjs +1 -1
- package/lib/en3/index.js +23 -22
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +8 -7
- package/lib/{index-BUOBDenR.js → index-Fasue6kv.js} +20 -19
- package/lib/index-nxoux28n.cjs +9 -0
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.js +3 -2
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +11 -10
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.js +3 -2
- package/lib/libs/path-data-polyfill.d.ts +1 -0
- package/lib/loading/index.cjs +1 -1
- package/lib/loading/index.js +16 -15
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +6 -5
- package/lib/modal/index.cjs +1 -1
- package/lib/modal/index.js +4 -3
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +21 -20
- package/lib/path-data-polyfill-CXsOR7Oc.cjs +3 -0
- package/lib/path-data-polyfill-DgeDWYeI.js +454 -0
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +14 -13
- package/lib/resized/index.cjs +1 -1
- package/lib/resized/index.js +8 -7
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +8 -7
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +8 -7
- package/lib/select/index.cjs +1 -1
- package/lib/select/index.js +1 -1
- package/lib/slicer/index.cjs +2 -2
- package/lib/slicer/index.js +4 -3
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +2 -2
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.js +13 -12
- package/lib/{tags-CMPg9ETZ.js → tags-BoPv9fDr.js} +234 -233
- package/lib/tags-CueX-JLX.cjs +1 -0
- package/lib/theme/index.cjs +1 -1
- package/lib/theme/index.js +7 -6
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.js +3 -2
- package/lib/tweaker/index.cjs +1 -1
- package/lib/tweaker/index.js +6 -5
- package/lib/utils/array.d.ts +1 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +2 -1
- package/lib/utils/index.js +178 -129
- package/lib/utils/svg.d.ts +15 -0
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +6 -5
- package/lib/window-resizer/index.cjs +1 -1
- package/lib/window-resizer/index.js +7 -6
- package/package.json +1 -1
- package/lib/Damped-BdnkNOcb.cjs +0 -1
- package/lib/DragControls-CdRWoO3y.cjs +0 -1
- package/lib/SourceManager-Bc68GDrb.cjs +0 -1
- package/lib/Store-C-1ruEIm.cjs +0 -1
- package/lib/Viewport-DAjFJF5V.cjs +0 -1
- package/lib/createTheme-CHnsCgAr.js +0 -15
- package/lib/createTheme-Cfaw9UmV.cjs +0 -1
- package/lib/index-Bv5vIuF-.cjs +0 -9
- package/lib/tags-Djb6mb1o.cjs +0 -1
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
// @license
|
|
2
|
+
(!SVGPathElement.prototype.getPathData || !SVGPathElement.prototype.setPathData) && function() {
|
|
3
|
+
var w = {
|
|
4
|
+
Z: "Z",
|
|
5
|
+
M: "M",
|
|
6
|
+
L: "L",
|
|
7
|
+
C: "C",
|
|
8
|
+
Q: "Q",
|
|
9
|
+
A: "A",
|
|
10
|
+
H: "H",
|
|
11
|
+
V: "V",
|
|
12
|
+
S: "S",
|
|
13
|
+
T: "T",
|
|
14
|
+
z: "Z",
|
|
15
|
+
m: "m",
|
|
16
|
+
l: "l",
|
|
17
|
+
c: "c",
|
|
18
|
+
q: "q",
|
|
19
|
+
a: "a",
|
|
20
|
+
h: "h",
|
|
21
|
+
v: "v",
|
|
22
|
+
s: "s",
|
|
23
|
+
t: "t"
|
|
24
|
+
}, k = function(u) {
|
|
25
|
+
this._string = u, this._currentIndex = 0, this._endIndex = this._string.length, this._prevCommand = null, this._skipOptionalSpaces();
|
|
26
|
+
}, K = window.navigator.userAgent.indexOf("MSIE ") !== -1;
|
|
27
|
+
k.prototype = {
|
|
28
|
+
parseSegment: function() {
|
|
29
|
+
var u = this._string[this._currentIndex], t = w[u] ? w[u] : null;
|
|
30
|
+
if (t === null) {
|
|
31
|
+
if (this._prevCommand === null || ((u === "+" || u === "-" || u === "." || u >= "0" && u <= "9") && this._prevCommand !== "Z" ? this._prevCommand === "M" ? t = "L" : this._prevCommand === "m" ? t = "l" : t = this._prevCommand : t = null, t === null))
|
|
32
|
+
return null;
|
|
33
|
+
} else
|
|
34
|
+
this._currentIndex += 1;
|
|
35
|
+
this._prevCommand = t;
|
|
36
|
+
var e = null, s = t.toUpperCase();
|
|
37
|
+
return s === "H" || s === "V" ? e = [this._parseNumber()] : s === "M" || s === "L" || s === "T" ? e = [this._parseNumber(), this._parseNumber()] : s === "S" || s === "Q" ? e = [
|
|
38
|
+
this._parseNumber(),
|
|
39
|
+
this._parseNumber(),
|
|
40
|
+
this._parseNumber(),
|
|
41
|
+
this._parseNumber()
|
|
42
|
+
] : s === "C" ? e = [
|
|
43
|
+
this._parseNumber(),
|
|
44
|
+
this._parseNumber(),
|
|
45
|
+
this._parseNumber(),
|
|
46
|
+
this._parseNumber(),
|
|
47
|
+
this._parseNumber(),
|
|
48
|
+
this._parseNumber()
|
|
49
|
+
] : s === "A" ? e = [
|
|
50
|
+
this._parseNumber(),
|
|
51
|
+
this._parseNumber(),
|
|
52
|
+
this._parseNumber(),
|
|
53
|
+
this._parseArcFlag(),
|
|
54
|
+
this._parseArcFlag(),
|
|
55
|
+
this._parseNumber(),
|
|
56
|
+
this._parseNumber()
|
|
57
|
+
] : s === "Z" && (this._skipOptionalSpaces(), e = []), e === null || e.indexOf(null) >= 0 ? null : { type: t, values: e };
|
|
58
|
+
},
|
|
59
|
+
hasMoreData: function() {
|
|
60
|
+
return this._currentIndex < this._endIndex;
|
|
61
|
+
},
|
|
62
|
+
peekSegmentType: function() {
|
|
63
|
+
var u = this._string[this._currentIndex];
|
|
64
|
+
return w[u] ? w[u] : null;
|
|
65
|
+
},
|
|
66
|
+
initialCommandIsMoveTo: function() {
|
|
67
|
+
if (!this.hasMoreData())
|
|
68
|
+
return !0;
|
|
69
|
+
var u = this.peekSegmentType();
|
|
70
|
+
return u === "M" || u === "m";
|
|
71
|
+
},
|
|
72
|
+
_isCurrentSpace: function() {
|
|
73
|
+
var u = this._string[this._currentIndex];
|
|
74
|
+
return u <= " " && (u === " " || u === `
|
|
75
|
+
` || u === " " || u === "\r" || u === "\f");
|
|
76
|
+
},
|
|
77
|
+
_skipOptionalSpaces: function() {
|
|
78
|
+
for (; this._currentIndex < this._endIndex && this._isCurrentSpace(); )
|
|
79
|
+
this._currentIndex += 1;
|
|
80
|
+
return this._currentIndex < this._endIndex;
|
|
81
|
+
},
|
|
82
|
+
_skipOptionalSpacesOrDelimiter: function() {
|
|
83
|
+
return this._currentIndex < this._endIndex && !this._isCurrentSpace() && this._string[this._currentIndex] !== "," ? !1 : (this._skipOptionalSpaces() && this._currentIndex < this._endIndex && this._string[this._currentIndex] === "," && (this._currentIndex += 1, this._skipOptionalSpaces()), this._currentIndex < this._endIndex);
|
|
84
|
+
},
|
|
85
|
+
// Parse a number from an SVG path. This very closely follows genericParseNumber(...) from
|
|
86
|
+
// Source/core/svg/SVGParserUtilities.cpp.
|
|
87
|
+
// Spec: http://www.w3.org/TR/SVG11/single-page.html#paths-PathDataBNF
|
|
88
|
+
_parseNumber: function() {
|
|
89
|
+
var u = 0, t = 0, e = 1, s = 0, l = 1, n = 1, a = this._currentIndex;
|
|
90
|
+
if (this._skipOptionalSpaces(), this._currentIndex < this._endIndex && this._string[this._currentIndex] === "+" ? this._currentIndex += 1 : this._currentIndex < this._endIndex && this._string[this._currentIndex] === "-" && (this._currentIndex += 1, l = -1), this._currentIndex === this._endIndex || (this._string[this._currentIndex] < "0" || this._string[this._currentIndex] > "9") && this._string[this._currentIndex] !== ".")
|
|
91
|
+
return null;
|
|
92
|
+
for (var p = this._currentIndex; this._currentIndex < this._endIndex && this._string[this._currentIndex] >= "0" && this._string[this._currentIndex] <= "9"; )
|
|
93
|
+
this._currentIndex += 1;
|
|
94
|
+
if (this._currentIndex !== p)
|
|
95
|
+
for (var i = this._currentIndex - 1, r = 1; i >= p; )
|
|
96
|
+
t += r * (this._string[i] - "0"), i -= 1, r *= 10;
|
|
97
|
+
if (this._currentIndex < this._endIndex && this._string[this._currentIndex] === ".") {
|
|
98
|
+
if (this._currentIndex += 1, this._currentIndex >= this._endIndex || this._string[this._currentIndex] < "0" || this._string[this._currentIndex] > "9")
|
|
99
|
+
return null;
|
|
100
|
+
for (; this._currentIndex < this._endIndex && this._string[this._currentIndex] >= "0" && this._string[this._currentIndex] <= "9"; )
|
|
101
|
+
e *= 10, s += (this._string.charAt(this._currentIndex) - "0") / e, this._currentIndex += 1;
|
|
102
|
+
}
|
|
103
|
+
if (this._currentIndex !== a && this._currentIndex + 1 < this._endIndex && (this._string[this._currentIndex] === "e" || this._string[this._currentIndex] === "E") && this._string[this._currentIndex + 1] !== "x" && this._string[this._currentIndex + 1] !== "m") {
|
|
104
|
+
if (this._currentIndex += 1, this._string[this._currentIndex] === "+" ? this._currentIndex += 1 : this._string[this._currentIndex] === "-" && (this._currentIndex += 1, n = -1), this._currentIndex >= this._endIndex || this._string[this._currentIndex] < "0" || this._string[this._currentIndex] > "9")
|
|
105
|
+
return null;
|
|
106
|
+
for (; this._currentIndex < this._endIndex && this._string[this._currentIndex] >= "0" && this._string[this._currentIndex] <= "9"; )
|
|
107
|
+
u *= 10, u += this._string[this._currentIndex] - "0", this._currentIndex += 1;
|
|
108
|
+
}
|
|
109
|
+
var v = t + s;
|
|
110
|
+
return v *= l, u && (v *= Math.pow(10, n * u)), a === this._currentIndex ? null : (this._skipOptionalSpacesOrDelimiter(), v);
|
|
111
|
+
},
|
|
112
|
+
_parseArcFlag: function() {
|
|
113
|
+
if (this._currentIndex >= this._endIndex)
|
|
114
|
+
return null;
|
|
115
|
+
var u = null, t = this._string[this._currentIndex];
|
|
116
|
+
if (this._currentIndex += 1, t === "0")
|
|
117
|
+
u = 0;
|
|
118
|
+
else if (t === "1")
|
|
119
|
+
u = 1;
|
|
120
|
+
else
|
|
121
|
+
return null;
|
|
122
|
+
return this._skipOptionalSpacesOrDelimiter(), u;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
var z = function(u) {
|
|
126
|
+
if (!u || u.length === 0)
|
|
127
|
+
return [];
|
|
128
|
+
var t = new k(u), e = [];
|
|
129
|
+
if (t.initialCommandIsMoveTo())
|
|
130
|
+
for (; t.hasMoreData(); ) {
|
|
131
|
+
var s = t.parseSegment();
|
|
132
|
+
if (s === null)
|
|
133
|
+
break;
|
|
134
|
+
e.push(s);
|
|
135
|
+
}
|
|
136
|
+
return e;
|
|
137
|
+
}, W = SVGPathElement.prototype.setAttribute, U = SVGPathElement.prototype.setAttributeNS, R = SVGPathElement.prototype.removeAttribute, g = SVGPathElement.prototype.removeAttributeNS, x = window.Symbol ? Symbol() : "__cachedPathData", S = window.Symbol ? Symbol() : "__cachedNormalizedPathData", H = function(u, t, e, s, l, n, a, p, i, r) {
|
|
138
|
+
var v = function(L) {
|
|
139
|
+
return Math.PI * L / 180;
|
|
140
|
+
}, h = function(L, J, T) {
|
|
141
|
+
var ht = L * Math.cos(T) - J * Math.sin(T), pt = L * Math.sin(T) + J * Math.cos(T);
|
|
142
|
+
return { x: ht, y: pt };
|
|
143
|
+
}, o = v(a), c = [], _, f, d, y;
|
|
144
|
+
if (r)
|
|
145
|
+
_ = r[0], f = r[1], d = r[2], y = r[3];
|
|
146
|
+
else {
|
|
147
|
+
var A = h(u, t, -o);
|
|
148
|
+
u = A.x, t = A.y;
|
|
149
|
+
var P = h(e, s, -o);
|
|
150
|
+
e = P.x, s = P.y;
|
|
151
|
+
var m = (u - e) / 2, I = (t - s) / 2, M = m * m / (l * l) + I * I / (n * n);
|
|
152
|
+
M > 1 && (M = Math.sqrt(M), l = M * l, n = M * n);
|
|
153
|
+
var D;
|
|
154
|
+
p === i ? D = -1 : D = 1;
|
|
155
|
+
var E = l * l, N = n * n, et = E * N - E * I * I - N * m * m, at = E * I * I + N * m * m, O = D * Math.sqrt(Math.abs(et / at));
|
|
156
|
+
d = O * l * I / n + (u + e) / 2, y = O * -n * m / l + (t + s) / 2, _ = Math.asin(parseFloat(((t - y) / n).toFixed(9))), f = Math.asin(parseFloat(((s - y) / n).toFixed(9))), u < d && (_ = Math.PI - _), e < d && (f = Math.PI - f), _ < 0 && (_ = Math.PI * 2 + _), f < 0 && (f = Math.PI * 2 + f), i && _ > f && (_ = _ - Math.PI * 2), !i && f > _ && (f = f - Math.PI * 2);
|
|
157
|
+
}
|
|
158
|
+
var Z = f - _;
|
|
159
|
+
if (Math.abs(Z) > Math.PI * 120 / 180) {
|
|
160
|
+
var rt = f, st = e, ut = s;
|
|
161
|
+
i && f > _ ? f = _ + Math.PI * 120 / 180 * 1 : f = _ + Math.PI * 120 / 180 * -1, e = d + l * Math.cos(f), s = y + n * Math.sin(f), c = H(
|
|
162
|
+
e,
|
|
163
|
+
s,
|
|
164
|
+
st,
|
|
165
|
+
ut,
|
|
166
|
+
l,
|
|
167
|
+
n,
|
|
168
|
+
a,
|
|
169
|
+
0,
|
|
170
|
+
i,
|
|
171
|
+
[f, rt, d, y]
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
Z = f - _;
|
|
175
|
+
var it = Math.cos(_), nt = Math.sin(_), lt = Math.cos(f), vt = Math.sin(f), Q = Math.tan(Z / 4), X = 4 / 3 * l * Q, Y = 4 / 3 * n * Q, q = [u, t], C = [u + X * nt, t - Y * it], $ = [e + X * vt, s - Y * lt], F = [e, s];
|
|
176
|
+
if (C[0] = 2 * q[0] - C[0], C[1] = 2 * q[1] - C[1], r)
|
|
177
|
+
return [C, $, F].concat(c);
|
|
178
|
+
c = [C, $, F].concat(c);
|
|
179
|
+
for (var j = [], b = 0; b < c.length; b += 3) {
|
|
180
|
+
var l = h(c[b][0], c[b][1], o), n = h(c[b + 1][0], c[b + 1][1], o), B = h(c[b + 2][0], c[b + 2][1], o);
|
|
181
|
+
j.push([l.x, l.y, n.x, n.y, B.x, B.y]);
|
|
182
|
+
}
|
|
183
|
+
return j;
|
|
184
|
+
}, V = function(u) {
|
|
185
|
+
return u.map(function(t) {
|
|
186
|
+
return {
|
|
187
|
+
type: t.type,
|
|
188
|
+
values: Array.prototype.slice.call(t.values)
|
|
189
|
+
};
|
|
190
|
+
});
|
|
191
|
+
}, tt = function(u) {
|
|
192
|
+
var t = [], e = null, s = null, l = null, n = null;
|
|
193
|
+
return u.forEach(function(a) {
|
|
194
|
+
var p = a.type;
|
|
195
|
+
if (p === "M") {
|
|
196
|
+
var i = a.values[0], r = a.values[1];
|
|
197
|
+
t.push({ type: "M", values: [i, r] }), l = i, n = r, e = i, s = r;
|
|
198
|
+
} else if (p === "m") {
|
|
199
|
+
var i = e + a.values[0], r = s + a.values[1];
|
|
200
|
+
t.push({ type: "M", values: [i, r] }), l = i, n = r, e = i, s = r;
|
|
201
|
+
} else if (p === "L") {
|
|
202
|
+
var i = a.values[0], r = a.values[1];
|
|
203
|
+
t.push({ type: "L", values: [i, r] }), e = i, s = r;
|
|
204
|
+
} else if (p === "l") {
|
|
205
|
+
var i = e + a.values[0], r = s + a.values[1];
|
|
206
|
+
t.push({ type: "L", values: [i, r] }), e = i, s = r;
|
|
207
|
+
} else if (p === "C") {
|
|
208
|
+
var v = a.values[0], h = a.values[1], o = a.values[2], c = a.values[3], i = a.values[4], r = a.values[5];
|
|
209
|
+
t.push({
|
|
210
|
+
type: "C",
|
|
211
|
+
values: [v, h, o, c, i, r]
|
|
212
|
+
}), e = i, s = r;
|
|
213
|
+
} else if (p === "c") {
|
|
214
|
+
var v = e + a.values[0], h = s + a.values[1], o = e + a.values[2], c = s + a.values[3], i = e + a.values[4], r = s + a.values[5];
|
|
215
|
+
t.push({
|
|
216
|
+
type: "C",
|
|
217
|
+
values: [v, h, o, c, i, r]
|
|
218
|
+
}), e = i, s = r;
|
|
219
|
+
} else if (p === "Q") {
|
|
220
|
+
var v = a.values[0], h = a.values[1], i = a.values[2], r = a.values[3];
|
|
221
|
+
t.push({ type: "Q", values: [v, h, i, r] }), e = i, s = r;
|
|
222
|
+
} else if (p === "q") {
|
|
223
|
+
var v = e + a.values[0], h = s + a.values[1], i = e + a.values[2], r = s + a.values[3];
|
|
224
|
+
t.push({ type: "Q", values: [v, h, i, r] }), e = i, s = r;
|
|
225
|
+
} else if (p === "A") {
|
|
226
|
+
var i = a.values[5], r = a.values[6];
|
|
227
|
+
t.push({
|
|
228
|
+
type: "A",
|
|
229
|
+
values: [
|
|
230
|
+
a.values[0],
|
|
231
|
+
a.values[1],
|
|
232
|
+
a.values[2],
|
|
233
|
+
a.values[3],
|
|
234
|
+
a.values[4],
|
|
235
|
+
i,
|
|
236
|
+
r
|
|
237
|
+
]
|
|
238
|
+
}), e = i, s = r;
|
|
239
|
+
} else if (p === "a") {
|
|
240
|
+
var i = e + a.values[5], r = s + a.values[6];
|
|
241
|
+
t.push({
|
|
242
|
+
type: "A",
|
|
243
|
+
values: [
|
|
244
|
+
a.values[0],
|
|
245
|
+
a.values[1],
|
|
246
|
+
a.values[2],
|
|
247
|
+
a.values[3],
|
|
248
|
+
a.values[4],
|
|
249
|
+
i,
|
|
250
|
+
r
|
|
251
|
+
]
|
|
252
|
+
}), e = i, s = r;
|
|
253
|
+
} else if (p === "H") {
|
|
254
|
+
var i = a.values[0];
|
|
255
|
+
t.push({ type: "H", values: [i] }), e = i;
|
|
256
|
+
} else if (p === "h") {
|
|
257
|
+
var i = e + a.values[0];
|
|
258
|
+
t.push({ type: "H", values: [i] }), e = i;
|
|
259
|
+
} else if (p === "V") {
|
|
260
|
+
var r = a.values[0];
|
|
261
|
+
t.push({ type: "V", values: [r] }), s = r;
|
|
262
|
+
} else if (p === "v") {
|
|
263
|
+
var r = s + a.values[0];
|
|
264
|
+
t.push({ type: "V", values: [r] }), s = r;
|
|
265
|
+
} else if (p === "S") {
|
|
266
|
+
var o = a.values[0], c = a.values[1], i = a.values[2], r = a.values[3];
|
|
267
|
+
t.push({ type: "S", values: [o, c, i, r] }), e = i, s = r;
|
|
268
|
+
} else if (p === "s") {
|
|
269
|
+
var o = e + a.values[0], c = s + a.values[1], i = e + a.values[2], r = s + a.values[3];
|
|
270
|
+
t.push({ type: "S", values: [o, c, i, r] }), e = i, s = r;
|
|
271
|
+
} else if (p === "T") {
|
|
272
|
+
var i = a.values[0], r = a.values[1];
|
|
273
|
+
t.push({ type: "T", values: [i, r] }), e = i, s = r;
|
|
274
|
+
} else if (p === "t") {
|
|
275
|
+
var i = e + a.values[0], r = s + a.values[1];
|
|
276
|
+
t.push({ type: "T", values: [i, r] }), e = i, s = r;
|
|
277
|
+
} else
|
|
278
|
+
(p === "Z" || p === "z") && (t.push({ type: "Z", values: [] }), e = l, s = n);
|
|
279
|
+
}), t;
|
|
280
|
+
}, G = function(u) {
|
|
281
|
+
var t = [], e = null, s = null, l = null, n = null, a = null, p = null, i = null;
|
|
282
|
+
return u.forEach(function(r) {
|
|
283
|
+
if (r.type === "M") {
|
|
284
|
+
var v = r.values[0], h = r.values[1];
|
|
285
|
+
t.push({ type: "M", values: [v, h] }), p = v, i = h, n = v, a = h;
|
|
286
|
+
} else if (r.type === "C") {
|
|
287
|
+
var o = r.values[0], c = r.values[1], _ = r.values[2], f = r.values[3], v = r.values[4], h = r.values[5];
|
|
288
|
+
t.push({ type: "C", values: [o, c, _, f, v, h] }), s = _, l = f, n = v, a = h;
|
|
289
|
+
} else if (r.type === "L") {
|
|
290
|
+
var v = r.values[0], h = r.values[1];
|
|
291
|
+
t.push({ type: "L", values: [v, h] }), n = v, a = h;
|
|
292
|
+
} else if (r.type === "H") {
|
|
293
|
+
var v = r.values[0];
|
|
294
|
+
t.push({ type: "L", values: [v, a] }), n = v;
|
|
295
|
+
} else if (r.type === "V") {
|
|
296
|
+
var h = r.values[0];
|
|
297
|
+
t.push({ type: "L", values: [n, h] }), a = h;
|
|
298
|
+
} else if (r.type === "S") {
|
|
299
|
+
var _ = r.values[0], f = r.values[1], v = r.values[2], h = r.values[3], d, y;
|
|
300
|
+
e === "C" || e === "S" ? (d = n + (n - s), y = a + (a - l)) : (d = n, y = a), t.push({ type: "C", values: [d, y, _, f, v, h] }), s = _, l = f, n = v, a = h;
|
|
301
|
+
} else if (r.type === "T") {
|
|
302
|
+
var v = r.values[0], h = r.values[1], o, c;
|
|
303
|
+
e === "Q" || e === "T" ? (o = n + (n - s), c = a + (a - l)) : (o = n, c = a);
|
|
304
|
+
var d = n + 2 * (o - n) / 3, y = a + 2 * (c - a) / 3, A = v + 2 * (o - v) / 3, P = h + 2 * (c - h) / 3;
|
|
305
|
+
t.push({
|
|
306
|
+
type: "C",
|
|
307
|
+
values: [d, y, A, P, v, h]
|
|
308
|
+
}), s = o, l = c, n = v, a = h;
|
|
309
|
+
} else if (r.type === "Q") {
|
|
310
|
+
var o = r.values[0], c = r.values[1], v = r.values[2], h = r.values[3], d = n + 2 * (o - n) / 3, y = a + 2 * (c - a) / 3, A = v + 2 * (o - v) / 3, P = h + 2 * (c - h) / 3;
|
|
311
|
+
t.push({
|
|
312
|
+
type: "C",
|
|
313
|
+
values: [d, y, A, P, v, h]
|
|
314
|
+
}), s = o, l = c, n = v, a = h;
|
|
315
|
+
} else if (r.type === "A") {
|
|
316
|
+
var m = Math.abs(r.values[0]), I = Math.abs(r.values[1]), M = r.values[2], D = r.values[3], E = r.values[4], v = r.values[5], h = r.values[6];
|
|
317
|
+
if (m === 0 || I === 0)
|
|
318
|
+
t.push({
|
|
319
|
+
type: "C",
|
|
320
|
+
values: [n, a, v, h, v, h]
|
|
321
|
+
}), n = v, a = h;
|
|
322
|
+
else if (n !== v || a !== h) {
|
|
323
|
+
var N = H(
|
|
324
|
+
n,
|
|
325
|
+
a,
|
|
326
|
+
v,
|
|
327
|
+
h,
|
|
328
|
+
m,
|
|
329
|
+
I,
|
|
330
|
+
M,
|
|
331
|
+
D,
|
|
332
|
+
E
|
|
333
|
+
);
|
|
334
|
+
N.forEach(function(O) {
|
|
335
|
+
t.push({ type: "C", values: O });
|
|
336
|
+
}), n = v, a = h;
|
|
337
|
+
}
|
|
338
|
+
} else
|
|
339
|
+
r.type === "Z" && (t.push(r), n = p, a = i);
|
|
340
|
+
e = r.type;
|
|
341
|
+
}), t;
|
|
342
|
+
};
|
|
343
|
+
SVGPathElement.prototype.setAttribute = function(u, t) {
|
|
344
|
+
u === "d" && (this[x] = null, this[S] = null), W.call(this, u, t);
|
|
345
|
+
}, SVGPathElement.prototype.setAttributeNS = function(u, t, e) {
|
|
346
|
+
if (t === "d") {
|
|
347
|
+
var s = "http://www.w3.org/2000/svg";
|
|
348
|
+
if (u)
|
|
349
|
+
for (var l of this.ownerSVGElement.attributes)
|
|
350
|
+
l.name === `xmlns:${u}` && (s = l.value);
|
|
351
|
+
s === "http://www.w3.org/2000/svg" && (this[x] = null, this[S] = null);
|
|
352
|
+
}
|
|
353
|
+
U.call(this, u, t, e);
|
|
354
|
+
}, SVGPathElement.prototype.removeAttribute = function(u, t) {
|
|
355
|
+
u === "d" && (this[x] = null, this[S] = null), R.call(this, u);
|
|
356
|
+
}, SVGPathElement.prototype.removeAttributeNS = function(u, t) {
|
|
357
|
+
if (t === "d") {
|
|
358
|
+
var e = "http://www.w3.org/2000/svg";
|
|
359
|
+
if (u)
|
|
360
|
+
for (var s of this.ownerSVGElement.attributes)
|
|
361
|
+
s.name === `xmlns:${u}` && (e = s.value);
|
|
362
|
+
e === "http://www.w3.org/2000/svg" && (this[x] = null, this[S] = null);
|
|
363
|
+
}
|
|
364
|
+
g.call(this, u, t);
|
|
365
|
+
}, SVGPathElement.prototype.getPathData = function(u) {
|
|
366
|
+
if (u && u.normalize) {
|
|
367
|
+
if (this[S])
|
|
368
|
+
return V(this[S]);
|
|
369
|
+
var t;
|
|
370
|
+
this[x] ? t = V(this[x]) : (t = z(this.getAttribute("d") || ""), this[x] = V(t));
|
|
371
|
+
var e = G(tt(t));
|
|
372
|
+
return this[S] = V(e), e;
|
|
373
|
+
} else {
|
|
374
|
+
if (this[x])
|
|
375
|
+
return V(this[x]);
|
|
376
|
+
var t = z(this.getAttribute("d") || "");
|
|
377
|
+
return this[x] = V(t), t;
|
|
378
|
+
}
|
|
379
|
+
}, SVGPathElement.prototype.setPathData = function(u) {
|
|
380
|
+
if (u.length === 0)
|
|
381
|
+
K ? this.setAttribute("d", "") : this.removeAttribute("d");
|
|
382
|
+
else {
|
|
383
|
+
for (var t = "", e = 0, s = u.length; e < s; e += 1) {
|
|
384
|
+
var l = u[e];
|
|
385
|
+
e > 0 && (t += " "), t += l.type, l.values && l.values.length > 0 && (t += " " + l.values.join(" "));
|
|
386
|
+
}
|
|
387
|
+
this.setAttribute("d", t);
|
|
388
|
+
}
|
|
389
|
+
}, SVGRectElement.prototype.getPathData = function(u) {
|
|
390
|
+
var t = this.x.baseVal.value, e = this.y.baseVal.value, s = this.width.baseVal.value, l = this.height.baseVal.value, n = this.hasAttribute("rx") ? this.rx.baseVal.value : this.ry.baseVal.value, a = this.hasAttribute("ry") ? this.ry.baseVal.value : this.rx.baseVal.value;
|
|
391
|
+
n > s / 2 && (n = s / 2), a > l / 2 && (a = l / 2);
|
|
392
|
+
var p = [
|
|
393
|
+
{ type: "M", values: [t + n, e] },
|
|
394
|
+
{ type: "H", values: [t + s - n] },
|
|
395
|
+
{ type: "A", values: [n, a, 0, 0, 1, t + s, e + a] },
|
|
396
|
+
{ type: "V", values: [e + l - a] },
|
|
397
|
+
{ type: "A", values: [n, a, 0, 0, 1, t + s - n, e + l] },
|
|
398
|
+
{ type: "H", values: [t + n] },
|
|
399
|
+
{ type: "A", values: [n, a, 0, 0, 1, t, e + l - a] },
|
|
400
|
+
{ type: "V", values: [e + a] },
|
|
401
|
+
{ type: "A", values: [n, a, 0, 0, 1, t + n, e] },
|
|
402
|
+
{ type: "Z", values: [] }
|
|
403
|
+
];
|
|
404
|
+
return p = p.filter(function(i) {
|
|
405
|
+
return !(i.type === "A" && (i.values[0] === 0 || i.values[1] === 0));
|
|
406
|
+
}), u && u.normalize === !0 && (p = G(p)), p;
|
|
407
|
+
}, SVGCircleElement.prototype.getPathData = function(u) {
|
|
408
|
+
var t = this.cx.baseVal.value, e = this.cy.baseVal.value, s = this.r.baseVal.value, l = [
|
|
409
|
+
{ type: "M", values: [t + s, e] },
|
|
410
|
+
{ type: "A", values: [s, s, 0, 0, 1, t, e + s] },
|
|
411
|
+
{ type: "A", values: [s, s, 0, 0, 1, t - s, e] },
|
|
412
|
+
{ type: "A", values: [s, s, 0, 0, 1, t, e - s] },
|
|
413
|
+
{ type: "A", values: [s, s, 0, 0, 1, t + s, e] },
|
|
414
|
+
{ type: "Z", values: [] }
|
|
415
|
+
];
|
|
416
|
+
return u && u.normalize === !0 && (l = G(l)), l;
|
|
417
|
+
}, SVGEllipseElement.prototype.getPathData = function(u) {
|
|
418
|
+
var t = this.cx.baseVal.value, e = this.cy.baseVal.value, s = this.rx.baseVal.value, l = this.ry.baseVal.value, n = [
|
|
419
|
+
{ type: "M", values: [t + s, e] },
|
|
420
|
+
{ type: "A", values: [s, l, 0, 0, 1, t, e + l] },
|
|
421
|
+
{ type: "A", values: [s, l, 0, 0, 1, t - s, e] },
|
|
422
|
+
{ type: "A", values: [s, l, 0, 0, 1, t, e - l] },
|
|
423
|
+
{ type: "A", values: [s, l, 0, 0, 1, t + s, e] },
|
|
424
|
+
{ type: "Z", values: [] }
|
|
425
|
+
];
|
|
426
|
+
return u && u.normalize === !0 && (n = G(n)), n;
|
|
427
|
+
}, SVGLineElement.prototype.getPathData = function() {
|
|
428
|
+
return [
|
|
429
|
+
{ type: "M", values: [this.x1.baseVal.value, this.y1.baseVal.value] },
|
|
430
|
+
{ type: "L", values: [this.x2.baseVal.value, this.y2.baseVal.value] }
|
|
431
|
+
];
|
|
432
|
+
}, SVGPolylineElement.prototype.getPathData = function() {
|
|
433
|
+
for (var u = [], t = 0; t < this.points.numberOfItems; t += 1) {
|
|
434
|
+
var e = this.points.getItem(t);
|
|
435
|
+
u.push({
|
|
436
|
+
type: t === 0 ? "M" : "L",
|
|
437
|
+
values: [e.x, e.y]
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
return u;
|
|
441
|
+
}, SVGPolygonElement.prototype.getPathData = function() {
|
|
442
|
+
for (var u = [], t = 0; t < this.points.numberOfItems; t += 1) {
|
|
443
|
+
var e = this.points.getItem(t);
|
|
444
|
+
u.push({
|
|
445
|
+
type: t === 0 ? "M" : "L",
|
|
446
|
+
values: [e.x, e.y]
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
return u.push({
|
|
450
|
+
type: "Z",
|
|
451
|
+
values: []
|
|
452
|
+
}), u;
|
|
453
|
+
};
|
|
454
|
+
}();
|
package/lib/popover/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../attribute/index.cjs"),S=require("../custom-element/index.cjs"),A=require("../Store-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../attribute/index.cjs"),S=require("../custom-element/index.cjs"),A=require("../Store-BQGNOHlY.cjs"),b=require("../style-At6aDoqG.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");const x=require("../browser-CpzFX2xg.cjs"),k=require("../tags-CueX-JLX.cjs"),B=require("../createStylesheet-C8aQQ4hd.cjs");var D=Object.defineProperty,I=Object.getOwnPropertyDescriptor,N=(t,e,s,i)=>{for(var n=i>1?void 0:i?I(e,s):e,c=t.length-1,p;c>=0;c--)(p=t[c])&&(n=(i?p(e,s,n):p(n))||n);return i&&n&&D(e,s,n),n},C=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},r=(t,e,s)=>(C(t,e,"read from private field"),s?s.call(t):e.get(t)),o=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},L=(t,e,s,i)=>(C(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),$=(t,e,s)=>(C(t,e,"access private method"),s),P,a,E,h,u,_,M,O,v,m,w,y,g,W,f;exports.PopoverElement=class extends S.CustomElement{constructor(){super(...arguments),o(this,M),o(this,v),o(this,g),o(this,P,-1),o(this,a,new A.Store(!1)),o(this,E,void 0),o(this,h,new T.Attribute(this,"history",!1)),o(this,u,new T.Attribute(this,"single",!1)),o(this,_,!1),this.open=()=>{r(this,a).current||(r(this,a).current=!0,r(this,u).current&&(exports.PopoverElement.__opened.forEach(e=>e.close()),exports.PopoverElement.__opened=[]),exports.PopoverElement.__opened.push(this),L(this,P,exports.PopoverElement.__opened.length-1),r(this,h).current&&r(this,_)&&history.pushState("","",r(this,M,O)),clearTimeout(r(this,E)),this.classList.add("triggered"),this.style.display="block",setTimeout(()=>{addEventListener("click",r(this,w)),addEventListener("keydown",r(this,y)),this.style.opacity="1",this.classList.add("opened")}))},this.close=()=>{if(r(this,a).current){if(r(this,a).current=!1,exports.PopoverElement.__opened=exports.PopoverElement.__opened.filter(e=>e!==this),r(this,h).current){const e=new URL(location.href);e.searchParams.delete(r(this,v,m)),history.replaceState(null,"",e.href)}this.classList.remove("opened"),this.style.opacity="0",removeEventListener("click",r(this,w)),removeEventListener("keydown",r(this,y)),setTimeout(()=>{this.classList.remove("triggered"),this.style.display="none"},b.getElementTransitionDurationMS(this))}},o(this,w,e=>{$(this,g,W).call(this,()=>{const s=e.composedPath();(!s.find(i=>i===this)&&!s.find(i=>i instanceof HTMLElement&&i.closest("e-popover-button"))||s[0]instanceof HTMLElement&&s[0].hasAttribute("outside"))&&this.close()})}),o(this,y,e=>{$(this,g,W).call(this,()=>{e.code==="Escape"&&this.close()})}),o(this,f,()=>{L(this,_,!1),r(this,a).current&&r(this,h).current&&!location.search.includes(r(this,v,m))?this.close():!r(this,a).current&&r(this,h).current&&location.search.includes(r(this,v,m))&&this.open(),L(this,_,!0)})}get history(){return r(this,h)}get single(){return r(this,u)}get opened(){return r(this,a)}connectedCallback(){r(this,h).observe(),r(this,u).observe(),this.style.opacity="0",this.style.display="none",addEventListener("popstate",r(this,f)),setTimeout(()=>{r(this,f).call(this)},0)}disconnectedCallback(){r(this,h).unobserve(),r(this,u).unobserve(),clearTimeout(r(this,E)),removeEventListener("popstate",r(this,f))}};P=new WeakMap;a=new WeakMap;E=new WeakMap;h=new WeakMap;u=new WeakMap;_=new WeakMap;M=new WeakSet;O=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${r(this,v,m)}`};v=new WeakSet;m=function(){return`modal-${this.id}`};w=new WeakMap;y=new WeakMap;g=new WeakSet;W=function(t){(exports.PopoverElement.__opened[r(this,P)-1]||exports.PopoverElement.__opened.length===1)&&t()};f=new WeakMap;exports.PopoverElement.__opened=[];exports.PopoverElement=N([S.define("e-popover")],exports.PopoverElement);var G=Object.defineProperty,H=Object.getOwnPropertyDescriptor,R=(t,e,s,i)=>{for(var n=i>1?void 0:i?H(e,s):e,c=t.length-1,p;c>=0;c--)(p=t[c])&&(n=(i?p(e,s,n):p(n))||n);return i&&n&&G(e,s,n),n},q=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},d=(t,e,s)=>(q(t,e,"read from private field"),s?s.call(t):e.get(t)),U=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},z=(t,e,s,i)=>(q(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),l;const F=B.createStylesheet({button:{all:"inherit"}});exports.PopoverButtonElement=class extends S.CustomElement{constructor(){super(),U(this,l,void 0),this.openShadow(F),x.isBrowser&&k.element(this,{children:[k.button({onClick:()=>{if(d(this,l)){const e=this.getAttribute("type")||"open";e==="open"||e==="toggle"&&!d(this,l).opened.current?d(this,l).open():(e==="close"||e==="toggle"&&d(this,l).opened.current)&&d(this,l).close()}},children:[k.slot()]})]})}get popoverElement(){return d(this,l)}connectedCallback(){const e=this.getAttribute("target");if(e){const s=document.querySelector(`#${e}`)||this.getRootNode().querySelector(`#${e}`);s?z(this,l,s):console.warn(this,`target ${e} not found`)}}};l=new WeakMap;exports.PopoverButtonElement=R([S.define("e-popover-button")],exports.PopoverButtonElement);
|
package/lib/popover/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Attribute as C } from "../attribute/index.js";
|
|
2
2
|
import { CustomElement as O, define as A } from "../custom-element/index.js";
|
|
3
|
-
import { S as I } from "../Store-
|
|
3
|
+
import { S as I } from "../Store-Cd-E5W1z.js";
|
|
4
4
|
import { g as N } from "../style-j2TwriJ_.js";
|
|
5
|
+
import "../path-data-polyfill-DgeDWYeI.js";
|
|
5
6
|
import { i as q } from "../browser-0zX67oeU.js";
|
|
6
|
-
import { e as B, p as G, ay as H } from "../tags-
|
|
7
|
-
import { c as R } from "../createStylesheet-
|
|
7
|
+
import { e as B, p as G, ay as H } from "../tags-BoPv9fDr.js";
|
|
8
|
+
import { c as R } from "../createStylesheet-KMRQhSa-.js";
|
|
8
9
|
var U = Object.defineProperty, b = Object.getOwnPropertyDescriptor, z = (e, t, s, r) => {
|
|
9
10
|
for (var n = r > 1 ? void 0 : r ? b(t, s) : t, p = e.length - 1, d; p >= 0; p--)
|
|
10
11
|
(d = e[p]) && (n = (r ? d(t, s, n) : d(n)) || n);
|
|
@@ -16,7 +17,7 @@ var U = Object.defineProperty, b = Object.getOwnPropertyDescriptor, z = (e, t, s
|
|
|
16
17
|
if (t.has(e))
|
|
17
18
|
throw TypeError("Cannot add the same private member more than once");
|
|
18
19
|
t instanceof WeakSet ? t.add(e) : t.set(e, s);
|
|
19
|
-
}, L = (e, t, s, r) => ($(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), T = (e, t, s) => ($(e, t, "access private method"), s), S, h, y, c, f, v, W, D, _,
|
|
20
|
+
}, L = (e, t, s, r) => ($(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), T = (e, t, s) => ($(e, t, "access private method"), s), S, h, y, c, f, v, W, D, _, w, g, E, k, M, m;
|
|
20
21
|
let a = class extends O {
|
|
21
22
|
constructor() {
|
|
22
23
|
super(...arguments), o(this, W), o(this, _), o(this, k), o(this, S, -1), o(this, h, new I(!1)), o(this, y, void 0), o(this, c, new C(this, "history", !1)), o(this, f, new C(this, "single", !1)), o(this, v, !1), this.open = () => {
|
|
@@ -27,7 +28,7 @@ let a = class extends O {
|
|
|
27
28
|
if (i(this, h).current) {
|
|
28
29
|
if (i(this, h).current = !1, a.__opened = a.__opened.filter((e) => e !== this), i(this, c).current) {
|
|
29
30
|
const e = new URL(location.href);
|
|
30
|
-
e.searchParams.delete(i(this, _,
|
|
31
|
+
e.searchParams.delete(i(this, _, w)), history.replaceState(null, "", e.href);
|
|
31
32
|
}
|
|
32
33
|
this.classList.remove("opened"), this.style.opacity = "0", removeEventListener("click", i(this, g)), removeEventListener("keydown", i(this, E)), setTimeout(() => {
|
|
33
34
|
this.classList.remove("triggered"), this.style.display = "none";
|
|
@@ -44,8 +45,8 @@ let a = class extends O {
|
|
|
44
45
|
T(this, k, M).call(this, () => {
|
|
45
46
|
e.code === "Escape" && this.close();
|
|
46
47
|
});
|
|
47
|
-
}), o(this,
|
|
48
|
-
L(this, v, !1), i(this, h).current && i(this, c).current && !location.search.includes(i(this, _,
|
|
48
|
+
}), o(this, m, () => {
|
|
49
|
+
L(this, v, !1), i(this, h).current && i(this, c).current && !location.search.includes(i(this, _, w)) ? this.close() : !i(this, h).current && i(this, c).current && location.search.includes(i(this, _, w)) && this.open(), L(this, v, !0);
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
52
|
get history() {
|
|
@@ -58,12 +59,12 @@ let a = class extends O {
|
|
|
58
59
|
return i(this, h);
|
|
59
60
|
}
|
|
60
61
|
connectedCallback() {
|
|
61
|
-
i(this, c).observe(), i(this, f).observe(), this.style.opacity = "0", this.style.display = "none", addEventListener("popstate", i(this,
|
|
62
|
-
i(this,
|
|
62
|
+
i(this, c).observe(), i(this, f).observe(), this.style.opacity = "0", this.style.display = "none", addEventListener("popstate", i(this, m)), setTimeout(() => {
|
|
63
|
+
i(this, m).call(this);
|
|
63
64
|
}, 0);
|
|
64
65
|
}
|
|
65
66
|
disconnectedCallback() {
|
|
66
|
-
i(this, c).unobserve(), i(this, f).unobserve(), clearTimeout(i(this, y)), removeEventListener("popstate", i(this,
|
|
67
|
+
i(this, c).unobserve(), i(this, f).unobserve(), clearTimeout(i(this, y)), removeEventListener("popstate", i(this, m));
|
|
67
68
|
}
|
|
68
69
|
};
|
|
69
70
|
S = /* @__PURE__ */ new WeakMap();
|
|
@@ -74,10 +75,10 @@ f = /* @__PURE__ */ new WeakMap();
|
|
|
74
75
|
v = /* @__PURE__ */ new WeakMap();
|
|
75
76
|
W = /* @__PURE__ */ new WeakSet();
|
|
76
77
|
D = function() {
|
|
77
|
-
return `${location.pathname}${location.search ? location.search + "&" : "?"}${i(this, _,
|
|
78
|
+
return `${location.pathname}${location.search ? location.search + "&" : "?"}${i(this, _, w)}`;
|
|
78
79
|
};
|
|
79
80
|
_ = /* @__PURE__ */ new WeakSet();
|
|
80
|
-
|
|
81
|
+
w = function() {
|
|
81
82
|
return `modal-${this.id}`;
|
|
82
83
|
};
|
|
83
84
|
g = /* @__PURE__ */ new WeakMap();
|
|
@@ -86,7 +87,7 @@ k = /* @__PURE__ */ new WeakSet();
|
|
|
86
87
|
M = function(e) {
|
|
87
88
|
(a.__opened[i(this, S) - 1] || a.__opened.length === 1) && e();
|
|
88
89
|
};
|
|
89
|
-
|
|
90
|
+
m = /* @__PURE__ */ new WeakMap();
|
|
90
91
|
a.__opened = [];
|
|
91
92
|
a = z([
|
|
92
93
|
A("e-popover")
|
package/lib/resized/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var l=(e,s,r)=>{if(!s.has(e))throw TypeError("Cannot "+r)};var c=(e,s,r)=>(l(e,s,"read from private field"),r?r.call(e):s.get(e)),n=(e,s,r)=>{if(s.has(e))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(e):s.set(e,r)},d=(e,s,r,i)=>(l(e,s,"write to private field"),i?i.call(e,r):s.set(e,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../element-resizer/index.cjs"),z=require("../Store-
|
|
1
|
+
"use strict";var l=(e,s,r)=>{if(!s.has(e))throw TypeError("Cannot "+r)};var c=(e,s,r)=>(l(e,s,"read from private field"),r?r.call(e):s.get(e)),n=(e,s,r)=>{if(s.has(e))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(e):s.set(e,r)},d=(e,s,r,i)=>(l(e,s,"write to private field"),i?i.call(e,r):s.set(e,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../element-resizer/index.cjs"),z=require("../Store-BQGNOHlY.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");const h=require("../window-resizer/index.cjs");var t,u;class a extends z.Store{constructor(r,i){super(r(),i);n(this,t,void 0);n(this,u,()=>{this.current=c(this,t).call(this)});d(this,t,r),(i==null?void 0:i.dispatcher)instanceof Element?b.elementResizer.subscribe(i.dispatcher,c(this,u)):h.windowResizer.subscribe(c(this,u))}close(){super.close(),h.windowResizer.unsubscribe(c(this,t)),b.elementResizer.unsubscribe(c(this,t))}}t=new WeakMap,u=new WeakMap;exports.Resized=a;
|
package/lib/resized/index.js
CHANGED
|
@@ -6,25 +6,26 @@ var c = (e, s, r) => (h(e, s, "read from private field"), r ? r.call(e) : s.get(
|
|
|
6
6
|
if (s.has(e))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
s instanceof WeakSet ? s.add(e) : s.set(e, r);
|
|
9
|
-
},
|
|
10
|
-
import { elementResizer as
|
|
11
|
-
import { S as d } from "../Store-
|
|
9
|
+
}, m = (e, s, r, i) => (h(e, s, "write to private field"), i ? i.call(e, r) : s.set(e, r), r);
|
|
10
|
+
import { elementResizer as l } from "../element-resizer/index.js";
|
|
11
|
+
import { S as d } from "../Store-Cd-E5W1z.js";
|
|
12
|
+
import "../path-data-polyfill-DgeDWYeI.js";
|
|
12
13
|
import { windowResizer as a } from "../window-resizer/index.js";
|
|
13
14
|
var t, u;
|
|
14
|
-
class
|
|
15
|
+
class R extends d {
|
|
15
16
|
constructor(r, i) {
|
|
16
17
|
super(r(), i);
|
|
17
18
|
b(this, t, void 0);
|
|
18
19
|
b(this, u, () => {
|
|
19
20
|
this.current = c(this, t).call(this);
|
|
20
21
|
});
|
|
21
|
-
|
|
22
|
+
m(this, t, r), (i == null ? void 0 : i.dispatcher) instanceof Element ? l.subscribe(i.dispatcher, c(this, u)) : a.subscribe(c(this, u));
|
|
22
23
|
}
|
|
23
24
|
close() {
|
|
24
|
-
super.close(), a.unsubscribe(c(this, t)),
|
|
25
|
+
super.close(), a.unsubscribe(c(this, t)), l.unsubscribe(c(this, t));
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
t = new WeakMap(), u = new WeakMap();
|
|
28
29
|
export {
|
|
29
|
-
|
|
30
|
+
R as Resized
|
|
30
31
|
};
|
package/lib/router/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var X=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n);var z=(n,t,s)=>{if(!t.has(n))throw TypeError("Cannot "+s)};var e=(n,t,s)=>(z(n,t,"read from private field"),s?s.call(n):t.get(n)),r=(n,t,s)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,s)},o=(n,t,s,i)=>(z(n,t,"write to private field"),i?i.call(n,s):t.set(n,s),s);var F=(n,t,s)=>(z(n,t,"access private method"),s);var B=(n,t,s)=>new Promise((i,u)=>{var h=f=>{try{d(s.next(f))}catch(T){u(T)}},a=f=>{try{d(s.throw(f))}catch(T){u(T)}},d=f=>f.done?i(f.value):Promise.resolve(f.value).then(h,a);d((s=s.apply(n,t)).next())});var G=(n,t,s)=>(t=n[X("asyncIterator")])?t.call(n):(n=n[X("iterator")](),t={},s=(i,u)=>(u=n[i])&&(t[i]=h=>new Promise((a,d,f)=>(h=u.call(n,h),f=h.done,Promise.resolve(h.value).then(T=>a({value:T,done:f}),d)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const tt=require("urlpattern-polyfill"),et=require("../notifier/index.cjs"),Z=require("../browser-CpzFX2xg.cjs"),st=require("../function-MthRj-GJ.cjs")
|
|
1
|
+
"use strict";var X=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n);var z=(n,t,s)=>{if(!t.has(n))throw TypeError("Cannot "+s)};var e=(n,t,s)=>(z(n,t,"read from private field"),s?s.call(n):t.get(n)),r=(n,t,s)=>{if(t.has(n))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(n):t.set(n,s)},o=(n,t,s,i)=>(z(n,t,"write to private field"),i?i.call(n,s):t.set(n,s),s);var F=(n,t,s)=>(z(n,t,"access private method"),s);var B=(n,t,s)=>new Promise((i,u)=>{var h=f=>{try{d(s.next(f))}catch(T){u(T)}},a=f=>{try{d(s.throw(f))}catch(T){u(T)}},d=f=>f.done?i(f.value):Promise.resolve(f.value).then(h,a);d((s=s.apply(n,t)).next())});var G=(n,t,s)=>(t=n[X("asyncIterator")])?t.call(n):(n=n[X("iterator")](),t={},s=(i,u)=>(u=n[i])&&(t[i]=h=>new Promise((a,d,f)=>(h=u.call(n,h),f=h.done,Promise.resolve(h.value).then(T=>a({value:T,done:f}),d)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const tt=require("urlpattern-polyfill"),et=require("../notifier/index.cjs"),Z=require("../browser-CpzFX2xg.cjs"),st=require("../function-MthRj-GJ.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");const it=require("../object-CCiXnER2.cjs");var b,O,R,m,l,v,S,p,P,y,I,_;class nt{constructor(t,s){r(this,I);r(this,b,void 0);r(this,O,void 0);r(this,R,void 0);r(this,m,void 0);r(this,l,void 0);r(this,v,void 0);r(this,S,void 0);r(this,p,null);r(this,P,[]);r(this,y,[]);o(this,b,t),o(this,O,s),o(this,R,new URLPattern({pathname:e(this,b)})),o(this,m,null),o(this,l,null),o(this,v,!1),o(this,S,null),Z.isBrowser&&o(this,p,new MutationObserver(i=>{i[0].addedNodes.forEach(h=>{e(this,m)?e(this,y).push(h):e(this,P).push(h)})}))}get pattern(){return e(this,b)}get urlPattern(){return e(this,R)}get isActive(){return e(this,v)}get element(){return e(this,l)}get nest(){return e(this,S)}testPathname(t){return this.urlPattern.test({pathname:t})}render(t,s){return B(this,null,function*(){var i,u;if(e(this,p).observe(document.head,{childList:!0,subtree:!0}),e(this,m))e(this,P).forEach(h=>{document.head.appendChild(h)});else{const h=yield e(this,O).call(this);if(o(this,y,[...e(this,P)]),typeof h.default=="function"&&(o(this,m,h.default),it.isESClass(h.default))){const a="e-"+((i=e(this,m))==null?void 0:i.name.toLowerCase());customElements.get(a)||customElements.define(a,h.default)}}if(yield F(this,I,_).call(this),e(this,m)){const h=e(this,R).exec({pathname:s}),a=(h==null?void 0:h.pathname.groups)||{},d=Object.fromEntries(new URLSearchParams(location.search)),f={pathnameParams:a,searchParams:d};o(this,l,new(e(this,m))(f)),t.appendChild(e(this,l)),o(this,S,e(this,l).querySelector("[data-nest]")||((u=e(this,l).shadowRoot)==null?void 0:u.querySelector("[data-nest]"))||e(this,l).shadowRoot||e(this,l)),o(this,v,!0)}e(this,p).disconnect()})}close(){var t;e(this,p).disconnect(),(t=e(this,l))==null||t.remove(),o(this,v,!1),e(this,y).forEach(s=>document.head.removeChild(s)),o(this,y,[])}getAnchorElements(){var s;let t=[];return e(this,l)&&(t=[...e(this,l).querySelectorAll("a")]),(s=e(this,l))!=null&&s.shadowRoot&&(t=[...t,...e(this,l).shadowRoot.querySelectorAll("a")]),t}}b=new WeakMap,O=new WeakMap,R=new WeakMap,m=new WeakMap,l=new WeakMap,v=new WeakMap,S=new WeakMap,p=new WeakMap,P=new WeakMap,y=new WeakMap,I=new WeakSet,_=function(){return B(this,null,function*(){const t=e(this,P).filter(a=>a instanceof HTMLElement?a.tagName==="STYLE"||a.tagName==="SCRIPT"||a.tagName==="LINK":!1);try{for(var s=G(t),i,u,h;i=!(u=yield s.next()).done;i=!1){const a=u.value;yield new Promise(d=>{a.onload=()=>{d()}})}}catch(u){h=[u]}finally{try{i&&(u=s.return)&&(yield u.call(s))}finally{if(h)throw h[0]}}})};var H,g,A,U,j;class rt{constructor(t,s){r(this,H,void 0);r(this,g,void 0);r(this,A,void 0);r(this,U,void 0);r(this,j,t=>{t.preventDefault(),e(this,H).navigate(e(this,A),e(this,U))});o(this,H,t),o(this,g,s),o(this,A,e(this,g).getAttribute("href")||"/"),o(this,U,e(this,g).getAttribute("data-history-action")||"push"),e(this,g).addEventListener("click",e(this,j)),location.pathname===e(this,A)&&e(this,g).classList.add("current")}destroy(){e(this,g).removeEventListener("click",e(this,j)),e(this,g).classList.remove("current")}}H=new WeakMap,g=new WeakMap,A=new WeakMap,U=new WeakMap,j=new WeakMap;globalThis.URLPattern=tt.URLPattern;var k,q,w,N,M,E,C,x,D,K,$,W;const Y=class Y{constructor(t){r(this,K);r(this,k,null);r(this,q,void 0);r(this,w,[]);r(this,N,null);r(this,M,[]);r(this,E,void 0);r(this,C,null);r(this,x,new et.Notifier);r(this,D,st.debounce(()=>{const t=s=>s.split("/").length;o(this,w,e(this,w).sort((s,i)=>t(s.pattern)-t(i.pattern))),this.navigate(location.pathname.replace(e(this,q),""))},0));r(this,W,t=>{t.state&&this.navigate(t.state,"none")});o(this,q,(t==null?void 0:t.base)||""),Y.active=this,Z.isBrowser&&(o(this,k,(t==null?void 0:t.rootElement)||document.body),addEventListener("popstate",e(this,W)))}get currentPathname(){return e(this,C)}get candidatePathname(){return e(this,E)}get routes(){return e(this,w)}navigationEvent(t){return e(this,x).subscribe(t)}defineRoute(t,s){const i=new nt(t,s);e(this,w).push(i),e(this,D).call(this)}navigate(t,s="push"){return B(this,null,function*(){var f,Q;if(e(this,E)===t||e(this,C)===t)return;Y.active=this,o(this,E,t);const i=e(this,w).filter(c=>c.isActive),u=e(this,w).filter(c=>!i.includes(c)&&c.testPathname(t)),h=i.filter(c=>!c.testPathname(t)),a=i.filter(c=>c.testPathname(t));let d=!0;if(this.preprocessor)try{yield new Promise((c,L)=>{var V;(V=this.preprocessor)==null||V.call(this,{pathname:t,resolve:c,reject:L})})}catch(c){c?console.error(c):console.log("Route change canceled"),d=!1}if(d&&e(this,E)===t){o(this,N,a[a.length-1]),h.forEach(L=>{L.close()}),o(this,C,t);try{for(var T=G(u),at,ct,lt;at=!(ct=yield T.next()).done;at=!1){const L=ct.value;yield L.render(((f=e(this,N))==null?void 0:f.nest)||e(this,k),t),o(this,N,L)}}catch(ct){lt=[ct]}finally{try{at&&(ct=T.return)&&(yield ct.call(T))}finally{if(lt)throw lt[0]}}const c=e(this,q)+t+location.search;s==="push"?history.pushState(c,"",c):s==="replace"&&history.replaceState(c,"",c),F(this,K,$).call(this),(Q=this.postprocessor)==null||Q.call(this,{pathname:t}),e(this,x).notify({pathname:t})}})}};k=new WeakMap,q=new WeakMap,w=new WeakMap,N=new WeakMap,M=new WeakMap,E=new WeakMap,C=new WeakMap,x=new WeakMap,D=new WeakMap,K=new WeakSet,$=function(){const t=e(this,w).filter(i=>i.isActive),s=Array.from(new Set([...e(this,k).querySelectorAll("a"),...t.map(i=>i.getAnchorElements()).flat()].filter(i=>{var u;return(u=i.getAttribute("href"))==null?void 0:u.startsWith("/")})));e(this,M).forEach(i=>{i.destroy()}),o(this,M,s.map(i=>new rt(this,i)))},W=new WeakMap;let J=Y;exports.Router=J;
|