aptechka 0.1.9 → 0.1.10
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/Composed-C2Vv1xxR.cjs +1 -0
- package/lib/Composed-DhtYBEmo.js +79 -0
- package/lib/component/Component.d.ts +29 -0
- package/lib/component/hooks/animation.d.ts +9 -0
- package/lib/component/hooks/context.d.ts +2 -0
- package/lib/component/hooks/intersection.d.ts +4 -0
- package/lib/component/hooks/resize.d.ts +6 -0
- package/lib/component/hooks/shadow.d.ts +1 -0
- package/lib/component/hooks/stores.d.ts +6 -0
- package/lib/component/hooks/style.d.ts +2 -0
- package/lib/component/index.cjs +1 -0
- package/lib/component/index.d.ts +7 -0
- package/lib/component/index.js +187 -0
- package/lib/connector/index.cjs +1 -1
- package/lib/connector/index.js +1 -1
- package/lib/element-constructor/ElementConstructor.d.ts +1 -1
- package/lib/element-constructor/tags.d.ts +2 -3
- package/lib/element-resizer/index.cjs +1 -1
- package/lib/element-resizer/index.d.ts +1 -1
- package/lib/element-resizer/index.js +2 -1
- package/lib/en3/core/en3.d.ts +2 -2
- package/lib/en3/objects/En3Clip.d.ts +1 -1
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.d.ts +1 -1
- package/lib/intersector/index.js +2 -1
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.d.ts +2 -2
- package/lib/layout-box/index.js +70 -72
- package/lib/object-C1ph624j.cjs +1 -0
- package/lib/object-DIPjdukP.js +73 -0
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +79 -71
- package/lib/router/Route.d.ts +8 -2
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.d.ts +1 -2
- package/lib/router/index.js +139 -140
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.js +48 -111
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.d.ts +1 -1
- package/lib/ticker/index.js +33 -37
- package/lib/utils/dom.d.ts +2 -2
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +113 -168
- package/lib/utils/object.d.ts +1 -0
- package/package.json +10 -2
- package/lib/router/RouteElement.d.ts +0 -14
package/lib/layout-box/index.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
var
|
|
1
|
+
var K = (i, s, e) => {
|
|
2
2
|
if (!s.has(i))
|
|
3
3
|
throw TypeError("Cannot " + e);
|
|
4
4
|
};
|
|
5
|
-
var t = (i, s, e) => (
|
|
5
|
+
var t = (i, s, e) => (K(i, s, "read from private field"), e ? e.call(i) : s.get(i)), h = (i, s, e) => {
|
|
6
6
|
if (s.has(i))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
s instanceof WeakSet ? s.add(i) : s.set(i, e);
|
|
9
|
-
}, n = (i, s, e, l) => (
|
|
10
|
-
var
|
|
11
|
-
import { cssUnitParser as
|
|
12
|
-
import { Ladder as
|
|
13
|
-
import { TICK_ORDER as
|
|
14
|
-
import { windowResizer as
|
|
15
|
-
import { scrollEntries as
|
|
16
|
-
import { ticker as
|
|
17
|
-
import { i as
|
|
18
|
-
import { g as
|
|
19
|
-
|
|
9
|
+
}, n = (i, s, e, l) => (K(i, s, "write to private field"), l ? l.call(i, e) : s.set(i, e), e);
|
|
10
|
+
var L = (i, s, e) => (K(i, s, "access private method"), e);
|
|
11
|
+
import { cssUnitParser as lt } from "../css-unit-parser/index.js";
|
|
12
|
+
import { Ladder as I } from "../ladder/index.js";
|
|
13
|
+
import { TICK_ORDER as G } from "../order/index.js";
|
|
14
|
+
import { windowResizer as J } from "../window-resizer/index.js";
|
|
15
|
+
import { scrollEntries as ot } from "../scroll-entries/index.js";
|
|
16
|
+
import { ticker as N } from "../ticker/index.js";
|
|
17
|
+
import { i as Q } from "../browser-0zX67oeU.js";
|
|
18
|
+
import { g as j } from "../dom-BY7JhTx5.js";
|
|
19
|
+
import { g as V, a as $ } from "../layout-HoBT_Da2.js";
|
|
20
|
+
function at(i) {
|
|
20
21
|
const s = Math.sqrt(
|
|
21
22
|
i.m11 * i.m11 + i.m12 * i.m12 + i.m13 * i.m13
|
|
22
23
|
), e = Math.sqrt(
|
|
@@ -26,58 +27,57 @@ function ct(i) {
|
|
|
26
27
|
), E = Math.atan2(i.m32, i.m33), H = Math.atan2(
|
|
27
28
|
-i.m31,
|
|
28
29
|
Math.sqrt(i.m32 * i.m32 + i.m33 * i.m33)
|
|
29
|
-
),
|
|
30
|
+
), k = Math.atan2(i.m21, i.m11), u = i.m41, C = i.m42, b = i.m43;
|
|
30
31
|
return {
|
|
31
32
|
scaleX: s,
|
|
32
33
|
scaleY: e,
|
|
33
34
|
scaleZ: l,
|
|
34
35
|
rotationX: E,
|
|
35
36
|
rotationY: H,
|
|
36
|
-
rotationZ:
|
|
37
|
+
rotationZ: k,
|
|
37
38
|
translationX: u,
|
|
38
|
-
translationY:
|
|
39
|
-
translationZ:
|
|
39
|
+
translationY: C,
|
|
40
|
+
translationZ: b
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
|
-
var a, f, m,
|
|
43
|
+
var a, f, m, _, R, O, v, x, T, g, M, P, S, d, w, X, Y, Z, p, z, y, c, r, o, A, F, B, tt, D, st, U, et, W, q;
|
|
43
44
|
class Mt {
|
|
44
45
|
constructor(s, e) {
|
|
45
|
-
h(this,
|
|
46
|
+
h(this, A);
|
|
47
|
+
h(this, B);
|
|
46
48
|
h(this, D);
|
|
47
49
|
h(this, U);
|
|
48
|
-
h(this, k);
|
|
49
|
-
h(this, A);
|
|
50
50
|
h(this, a, null);
|
|
51
51
|
h(this, f, null);
|
|
52
52
|
h(this, m, []);
|
|
53
|
-
h(this,
|
|
53
|
+
h(this, _, "auto");
|
|
54
54
|
h(this, R, "top");
|
|
55
55
|
h(this, O, !1);
|
|
56
|
+
h(this, v, !0);
|
|
56
57
|
h(this, x, !0);
|
|
57
|
-
h(this, w, !0);
|
|
58
58
|
h(this, T, !0);
|
|
59
|
+
h(this, g, 0);
|
|
59
60
|
h(this, M, 0);
|
|
60
|
-
h(this, _, 0);
|
|
61
61
|
h(this, P, 0);
|
|
62
62
|
h(this, S, 0);
|
|
63
63
|
h(this, d, 0);
|
|
64
|
-
h(this,
|
|
64
|
+
h(this, w, 0);
|
|
65
65
|
h(this, X, 0);
|
|
66
66
|
h(this, Y, 0);
|
|
67
67
|
h(this, Z, 0);
|
|
68
68
|
h(this, p, { x: 0, y: 0, z: 0 });
|
|
69
|
-
h(this,
|
|
70
|
-
h(this,
|
|
71
|
-
h(this, c, new
|
|
72
|
-
h(this, r, new
|
|
73
|
-
h(this, o, new
|
|
69
|
+
h(this, z, { x: 0, y: 0, z: 0 });
|
|
70
|
+
h(this, y, { x: 1, y: 1, z: 1 });
|
|
71
|
+
h(this, c, new I({ x: 0, y: 0, z: 0 }));
|
|
72
|
+
h(this, r, new I({ x: 0, y: 0, z: 0 }));
|
|
73
|
+
h(this, o, new I({ x: 0, y: 0, z: 0 }));
|
|
74
74
|
h(this, W, () => {
|
|
75
|
-
|
|
75
|
+
Q && L(this, D, st).call(this);
|
|
76
76
|
});
|
|
77
|
-
h(this,
|
|
78
|
-
|
|
77
|
+
h(this, q, () => {
|
|
78
|
+
L(this, U, et).call(this), L(this, A, F).call(this);
|
|
79
79
|
});
|
|
80
|
-
|
|
80
|
+
Q && (n(this, a, j(s) || document.body), n(this, f, j(e == null ? void 0 : e.containerElement) || document.body), n(this, _, (e == null ? void 0 : e.scrollAxis) || "auto"), n(this, R, (e == null ? void 0 : e.frontSide) || "top"), n(this, O, (e == null ? void 0 : e.cartesian) || !1), n(this, v, (e == null ? void 0 : e.sizeStep) !== void 0 ? e.sizeStep : !0), n(this, x, (e == null ? void 0 : e.positionStep) !== void 0 ? e.positionStep : !0), n(this, T, (e == null ? void 0 : e.transformStep) !== void 0 ? e.transformStep : !0), t(this, o).setStep("_size", "+", {
|
|
81
81
|
x: 1,
|
|
82
82
|
y: 1,
|
|
83
83
|
z: 1
|
|
@@ -98,13 +98,13 @@ class Mt {
|
|
|
98
98
|
y: 0,
|
|
99
99
|
z: 0
|
|
100
100
|
}), addEventListener("DOMContentLoaded", () => {
|
|
101
|
-
|
|
101
|
+
ot.getAll(this.element).forEach((l) => {
|
|
102
102
|
this.setScrollStep(() => l);
|
|
103
103
|
});
|
|
104
|
-
}),
|
|
105
|
-
order:
|
|
104
|
+
}), N.subscribe(t(this, q), {
|
|
105
|
+
order: G.LAYOUT_BOX,
|
|
106
106
|
culling: e != null && e.culling ? this.element : void 0
|
|
107
|
-
}),
|
|
107
|
+
}), J.subscribe(t(this, W), G.LAYOUT_BOX));
|
|
108
108
|
}
|
|
109
109
|
get element() {
|
|
110
110
|
return t(this, a);
|
|
@@ -128,13 +128,13 @@ class Mt {
|
|
|
128
128
|
return t(this, S);
|
|
129
129
|
}
|
|
130
130
|
get front() {
|
|
131
|
-
return t(this,
|
|
131
|
+
return t(this, w);
|
|
132
132
|
}
|
|
133
133
|
get width() {
|
|
134
|
-
return t(this,
|
|
134
|
+
return t(this, g);
|
|
135
135
|
}
|
|
136
136
|
get height() {
|
|
137
|
-
return t(this,
|
|
137
|
+
return t(this, M);
|
|
138
138
|
}
|
|
139
139
|
get depth() {
|
|
140
140
|
return t(this, P);
|
|
@@ -154,7 +154,7 @@ class Mt {
|
|
|
154
154
|
));
|
|
155
155
|
}
|
|
156
156
|
destroy() {
|
|
157
|
-
|
|
157
|
+
N.unsubscribe(t(this, q)), J.unsubscribe(t(this, W)), t(this, r).close(), t(this, c).close(), t(this, o).close();
|
|
158
158
|
}
|
|
159
159
|
setPositionStep(...s) {
|
|
160
160
|
t(this, r).setStep(...s);
|
|
@@ -175,31 +175,31 @@ class Mt {
|
|
|
175
175
|
t(this, o).deleteStep(...s);
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
a = new WeakMap(), f = new WeakMap(), m = new WeakMap(),
|
|
178
|
+
a = new WeakMap(), f = new WeakMap(), m = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), O = new WeakMap(), v = new WeakMap(), x = new WeakMap(), T = new WeakMap(), g = new WeakMap(), M = new WeakMap(), P = new WeakMap(), S = new WeakMap(), d = new WeakMap(), w = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), Z = new WeakMap(), p = new WeakMap(), z = new WeakMap(), y = new WeakMap(), c = new WeakMap(), r = new WeakMap(), o = new WeakMap(), A = new WeakSet(), F = function() {
|
|
179
179
|
t(this, o).calculate(), t(this, r).calculate(), t(this, c).calculate();
|
|
180
|
-
},
|
|
180
|
+
}, B = new WeakSet(), tt = function() {
|
|
181
181
|
t(this, o).setStep("_size", "+", {
|
|
182
|
-
x: t(this,
|
|
183
|
-
y: t(this,
|
|
184
|
-
z: t(this,
|
|
182
|
+
x: t(this, v) ? t(this, g) : 1,
|
|
183
|
+
y: t(this, v) ? t(this, M) : 1,
|
|
184
|
+
z: t(this, v) ? t(this, P) : 1
|
|
185
185
|
});
|
|
186
|
-
const s = t(this,
|
|
186
|
+
const s = t(this, x) ? t(this, X) : 0, e = t(this, x) ? t(this, Y) : 0, l = t(this, x) ? t(this, Z) : 0;
|
|
187
187
|
t(this, r).setStep("_position", "+", {
|
|
188
188
|
x: s,
|
|
189
189
|
y: e,
|
|
190
190
|
z: l
|
|
191
191
|
}), t(this, T) ? (t(this, o).setStep("_scale", "*", {
|
|
192
|
-
x: t(this,
|
|
193
|
-
y: t(this,
|
|
194
|
-
z: t(this,
|
|
192
|
+
x: t(this, y).x,
|
|
193
|
+
y: t(this, y).y,
|
|
194
|
+
z: t(this, y).z
|
|
195
195
|
}), t(this, r).setStep("_translation", "+", {
|
|
196
196
|
x: t(this, p).x,
|
|
197
197
|
y: t(this, p).y,
|
|
198
198
|
z: t(this, p).z
|
|
199
199
|
}), t(this, c).setStep("_rotation", "+", {
|
|
200
|
-
x: t(this,
|
|
201
|
-
y: t(this,
|
|
202
|
-
z: t(this,
|
|
200
|
+
x: t(this, z).x,
|
|
201
|
+
y: t(this, z).y,
|
|
202
|
+
z: t(this, z).z
|
|
203
203
|
})) : (t(this, o).setStep("_scale", "*", {
|
|
204
204
|
x: 1,
|
|
205
205
|
y: 1,
|
|
@@ -213,37 +213,35 @@ a = new WeakMap(), f = new WeakMap(), m = new WeakMap(), v = new WeakMap(), R =
|
|
|
213
213
|
y: 0,
|
|
214
214
|
z: 0
|
|
215
215
|
}));
|
|
216
|
-
},
|
|
216
|
+
}, D = new WeakSet(), st = function() {
|
|
217
217
|
const s = getComputedStyle(t(this, a));
|
|
218
|
-
n(this,
|
|
219
|
-
|
|
218
|
+
n(this, g, Math.max(t(this, a).clientWidth, 1)), n(this, M, Math.max(t(this, a).clientHeight, 1)), n(this, P, Math.max(
|
|
219
|
+
lt.parse(s.getPropertyValue("--depth") || "0px"),
|
|
220
220
|
1
|
|
221
221
|
));
|
|
222
|
-
const e =
|
|
223
|
-
if (n(this, d,
|
|
224
|
-
const
|
|
225
|
-
n(this, d, (
|
|
222
|
+
const e = V(t(this, f)), l = $(t(this, f)), E = t(this, f).clientWidth, H = t(this, f).clientHeight;
|
|
223
|
+
if (n(this, d, V(t(this, a)) - e), n(this, S, $(t(this, a)) - l), t(this, _) === "z") {
|
|
224
|
+
const C = t(this, d) / E, b = t(this, S) / H;
|
|
225
|
+
n(this, d, (C - Math.floor(C)) * E), n(this, S, (b - Math.floor(b)) * H), t(this, R) === "left" ? n(this, w, V(t(this, a)) - e - t(this, d)) : n(this, w, $(t(this, a)) - l - t(this, S));
|
|
226
226
|
}
|
|
227
227
|
if (n(this, d, t(this, d) + t(this, a).clientLeft), n(this, S, t(this, S) + t(this, a).clientTop), t(this, O)) {
|
|
228
|
-
const
|
|
229
|
-
n(this, X,
|
|
228
|
+
const C = Math.round(E / 2), b = Math.round(H / 2), it = t(this, g) ? Math.round(t(this, g) / 2) : 0, ht = t(this, M) ? Math.round(t(this, M) / 2) : 0, nt = t(this, d) - C + it, rt = (t(this, S) - b + ht) * -1;
|
|
229
|
+
n(this, X, nt), n(this, Y, rt);
|
|
230
230
|
} else
|
|
231
231
|
n(this, X, t(this, d)), n(this, Y, t(this, S));
|
|
232
|
-
n(this, Z, t(this,
|
|
233
|
-
const
|
|
234
|
-
t(this, p).x = u.translationX, t(this, p).y = u.translationY, t(this, p).z = u.translationZ, t(this,
|
|
235
|
-
},
|
|
232
|
+
n(this, Z, t(this, w) * -1);
|
|
233
|
+
const k = new WebKitCSSMatrix(s.transform), u = at(k);
|
|
234
|
+
t(this, p).x = u.translationX, t(this, p).y = u.translationY, t(this, p).z = u.translationZ, t(this, y).x = u.scaleX, t(this, y).y = u.scaleY, t(this, y).z = u.scaleZ, t(this, z).x = u.rotationX, t(this, z).y = u.rotationY, t(this, z).z = u.rotationZ, L(this, B, tt).call(this), L(this, A, F).call(this);
|
|
235
|
+
}, U = new WeakSet(), et = function() {
|
|
236
236
|
for (let s = 0; s < t(this, m).length; s++) {
|
|
237
237
|
const e = t(this, m)[s]();
|
|
238
238
|
let l = e.axis;
|
|
239
|
-
t(this,
|
|
239
|
+
t(this, _) !== "auto" && (l = t(this, _)), t(this, r).setStep(`_scroll_${s}`, "+", {
|
|
240
240
|
[l]: e.value * (l === "x" ? -1 : t(this, O) ? 1 : -1)
|
|
241
241
|
});
|
|
242
242
|
}
|
|
243
|
-
},
|
|
244
|
-
return typeof s == "string" ? document.querySelector(s) : s;
|
|
245
|
-
}, W = new WeakMap(), B = new WeakMap();
|
|
243
|
+
}, W = new WeakMap(), q = new WeakMap();
|
|
246
244
|
export {
|
|
247
245
|
Mt as LayoutBox,
|
|
248
|
-
|
|
246
|
+
at as decomposeCSSMatrix
|
|
249
247
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function s(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function f(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Node)return e;const t=Array.isArray(e)?[]:{};for(const n in e)e.hasOwnProperty(n)&&(t[n]=f(e[n]));return t}function c(e,t,n=s){for(const r in t)n(t[r])?(e[r]||Object.assign(e,{[r]:{}}),c(e[r],t[r],n)):Object.assign(e,{[r]:t[r]});return e}function u(e){return e===null||typeof e=="undefined"}function i(e,t){if(typeof e!=typeof t)return!1;if([e,t].some(n=>u(n)))return e===t;if(Array.isArray(e)){const n=e.length>t.length?e:t,r=e.length>t.length?t:e;return n.every((l,y)=>i(l,r[y]))}if(typeof e!="object"||e instanceof Node||typeof e=="object"&&e.constructor.toString().startsWith("class"))return e===t;for(const n in e){if(!t.hasOwnProperty(n))return!1;if(typeof e[n]=="object"&&typeof t[n]=="object"){if(!i(e[n],t[n]))return!1}else if(e[n]!==t[n])return!1}return!0}function p(e,t){const n={};for(const r in e)t.includes(r)&&(n[r]=e[r]);return n}function a(e,t){const n={};for(const r in e)t.includes(r)||(n[r]=e[r]);return n}function o(e){var t;return typeof e=="function"&&((t=Object.getOwnPropertyDescriptor(e,"prototype"))==null?void 0:t.writable)===!1}exports.cloneDeep=f;exports.compareObjects=i;exports.isESClass=o;exports.isNullish=u;exports.isObject=s;exports.mergeDeep=c;exports.omit=a;exports.pick=p;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
function c(e) {
|
|
2
|
+
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
3
|
+
}
|
|
4
|
+
function u(e) {
|
|
5
|
+
if (e === null || typeof e != "object")
|
|
6
|
+
return e;
|
|
7
|
+
if (e instanceof Date)
|
|
8
|
+
return new Date(e.getTime());
|
|
9
|
+
if (e instanceof Node)
|
|
10
|
+
return e;
|
|
11
|
+
const n = Array.isArray(e) ? [] : {};
|
|
12
|
+
for (const t in e)
|
|
13
|
+
e.hasOwnProperty(t) && (n[t] = u(e[t]));
|
|
14
|
+
return n;
|
|
15
|
+
}
|
|
16
|
+
function a(e, n, t = c) {
|
|
17
|
+
for (const r in n)
|
|
18
|
+
t(n[r]) ? (e[r] || Object.assign(e, { [r]: {} }), a(e[r], n[r], t)) : Object.assign(e, { [r]: n[r] });
|
|
19
|
+
return e;
|
|
20
|
+
}
|
|
21
|
+
function y(e) {
|
|
22
|
+
return e === null || typeof e == "undefined";
|
|
23
|
+
}
|
|
24
|
+
function i(e, n) {
|
|
25
|
+
if (typeof e != typeof n)
|
|
26
|
+
return !1;
|
|
27
|
+
if ([e, n].some((t) => y(t)))
|
|
28
|
+
return e === n;
|
|
29
|
+
if (Array.isArray(e)) {
|
|
30
|
+
const t = e.length > n.length ? e : n, r = e.length > n.length ? n : e;
|
|
31
|
+
return t.every(
|
|
32
|
+
(s, f) => i(s, r[f])
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
if (typeof e != "object" || e instanceof Node || typeof e == "object" && e.constructor.toString().startsWith("class"))
|
|
36
|
+
return e === n;
|
|
37
|
+
for (const t in e) {
|
|
38
|
+
if (!n.hasOwnProperty(t))
|
|
39
|
+
return !1;
|
|
40
|
+
if (typeof e[t] == "object" && typeof n[t] == "object") {
|
|
41
|
+
if (!i(e[t], n[t]))
|
|
42
|
+
return !1;
|
|
43
|
+
} else if (e[t] !== n[t])
|
|
44
|
+
return !1;
|
|
45
|
+
}
|
|
46
|
+
return !0;
|
|
47
|
+
}
|
|
48
|
+
function l(e, n) {
|
|
49
|
+
const t = {};
|
|
50
|
+
for (const r in e)
|
|
51
|
+
n.includes(r) && (t[r] = e[r]);
|
|
52
|
+
return t;
|
|
53
|
+
}
|
|
54
|
+
function p(e, n) {
|
|
55
|
+
const t = {};
|
|
56
|
+
for (const r in e)
|
|
57
|
+
n.includes(r) || (t[r] = e[r]);
|
|
58
|
+
return t;
|
|
59
|
+
}
|
|
60
|
+
function o(e) {
|
|
61
|
+
var n;
|
|
62
|
+
return typeof e == "function" && ((n = Object.getOwnPropertyDescriptor(e, "prototype")) == null ? void 0 : n.writable) === !1;
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
c as a,
|
|
66
|
+
y as b,
|
|
67
|
+
u as c,
|
|
68
|
+
i as d,
|
|
69
|
+
o as i,
|
|
70
|
+
a as m,
|
|
71
|
+
p as o,
|
|
72
|
+
l as p
|
|
73
|
+
};
|
package/lib/popover/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../attribute/index.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../attribute/index.cjs"),$=require("../custom-element/index.cjs"),x=require("../Store-D0_rDIsE.cjs"),B=require("../style-At6aDoqG.cjs"),D=require("../abstract-elements/index.cjs");var O=Object.defineProperty,N=Object.getOwnPropertyDescriptor,b=(t,e,r)=>e in t?O(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,I=(t,e,r,i)=>{for(var n=i>1?void 0:i?N(e,r):e,l=t.length-1,c;l>=0;l--)(c=t[l])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&O(e,r,n),n},L=(t,e,r)=>(b(t,typeof e!="symbol"?e+"":e,r),r),k=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},s=(t,e,r)=>(k(t,e,"read from private field"),r?r.call(t):e.get(t)),o=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},S=(t,e,r,i)=>(k(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r),C=(t,e,r)=>(k(t,e,"access private method"),r),P,a,m,p,E,_,M,A,u,f,w,g,y,W,v;exports.PopoverElement=class extends $.CustomElement{constructor(){super(...arguments),o(this,M),o(this,u),o(this,y),o(this,P,-1),o(this,a,new x.Store(!1)),o(this,m,void 0),o(this,p,new T.Attribute(this,"history",!1)),o(this,E,new T.Attribute(this,"single",!1)),o(this,_,!1),L(this,"open",()=>{s(this,a).current||(s(this,a).current=!0,s(this,E).current&&(exports.PopoverElement.__opened.forEach(e=>e.close()),exports.PopoverElement.__opened=[]),exports.PopoverElement.__opened.push(this),S(this,P,exports.PopoverElement.__opened.length-1),s(this,p).current&&s(this,_)&&history.pushState("","",s(this,M,A)),clearTimeout(s(this,m)),this.classList.add("triggered"),this.style.display="block",setTimeout(()=>{addEventListener("click",s(this,w)),addEventListener("keydown",s(this,g)),this.style.opacity="1",this.classList.add("opened")}))}),L(this,"close",()=>{s(this,a).current&&(s(this,a).current=!1,exports.PopoverElement.__opened=exports.PopoverElement.__opened.filter(e=>e!==this),s(this,p).current&&history.replaceState("","",location.href.replace(new RegExp(`[&?]${s(this,u,f)}`,"g"),"")),this.classList.remove("opened"),this.style.opacity="0",removeEventListener("click",s(this,w)),removeEventListener("keydown",s(this,g)),setTimeout(()=>{this.classList.remove("triggered"),this.style.display="none"},B.getElementTransitionDurationMS(this)))}),o(this,w,e=>{C(this,y,W).call(this,()=>{const r=e.composedPath();(!r.find(i=>i===this)&&!r.find(i=>i instanceof HTMLElement&&i.closest("e-popover-button"))||r[0]instanceof HTMLElement&&r[0].hasAttribute("outside"))&&this.close()})}),o(this,g,e=>{C(this,y,W).call(this,()=>{e.code==="Escape"&&this.close()})}),o(this,v,()=>{S(this,_,!1),s(this,a).current&&s(this,p).current&&!location.search.includes(s(this,u,f))?this.close():!s(this,a).current&&s(this,p).current&&location.search.includes(s(this,u,f))&&this.open(),S(this,_,!0)})}get history(){return s(this,p)}get single(){return s(this,E)}get opened(){return s(this,a)}connectedCallback(){this.style.opacity="0",this.style.display="none",addEventListener("popstate",s(this,v)),setTimeout(()=>{s(this,v).call(this)},0)}disconnectedCallback(){clearTimeout(s(this,m)),removeEventListener("popstate",s(this,v))}};P=new WeakMap;a=new WeakMap;m=new WeakMap;p=new WeakMap;E=new WeakMap;_=new WeakMap;M=new WeakSet;A=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${s(this,u,f)}`};u=new WeakSet;f=function(){return`modal-${this.id}`};w=new WeakMap;g=new WeakMap;y=new WeakSet;W=function(t){(exports.PopoverElement.__opened[s(this,P)-1]||exports.PopoverElement.__opened.length===1)&&t()};v=new WeakMap;L(exports.PopoverElement,"__opened",[]);exports.PopoverElement=I([$.define("e-popover")],exports.PopoverElement);var G=Object.defineProperty,H=Object.getOwnPropertyDescriptor,R=(t,e,r,i)=>{for(var n=i>1?void 0:i?H(e,r):e,l=t.length-1,c;l>=0;l--)(c=t[l])&&(n=(i?c(e,r,n):c(n))||n);return i&&n&&G(e,r,n),n},q=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},d=(t,e,r)=>(q(t,e,"read from private field"),r?r.call(t):e.get(t)),F=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},z=(t,e,r,i)=>(q(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r),h;exports.PopoverButtonElement=class extends D.AbstractButtonElement{constructor(){super(...arguments),F(this,h,void 0)}get popoverElement(){return d(this,h)}click(){if(d(this,h)){const e=this.getAttribute("type")||"open";e==="open"||e==="toggle"&&!d(this,h).opened.current?d(this,h).open():(e==="close"||e==="toggle"&&d(this,h).opened.current)&&d(this,h).close()}}connectedCallback(){const e=this.getAttribute("target");if(e){const r=document.querySelector(`#${e}`)||this.getRootNode().querySelector(`#${e}`);r?z(this,h,r):console.warn(this,`target ${e} not found`)}}};h=new WeakMap;exports.PopoverButtonElement=R([$.define("e-popover-button")],exports.PopoverButtonElement);
|
package/lib/popover/index.js
CHANGED
|
@@ -1,122 +1,130 @@
|
|
|
1
|
-
import { Attribute as
|
|
2
|
-
import { CustomElement as
|
|
3
|
-
import { S as
|
|
4
|
-
import { g as
|
|
5
|
-
import { AbstractButtonElement as
|
|
6
|
-
var
|
|
7
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
8
|
-
(l = e[
|
|
9
|
-
return r && n &&
|
|
10
|
-
},
|
|
1
|
+
import { Attribute as C } from "../attribute/index.js";
|
|
2
|
+
import { CustomElement as I, define as A } from "../custom-element/index.js";
|
|
3
|
+
import { S as q } from "../Store-JOKrNVEr.js";
|
|
4
|
+
import { g as B } from "../style-j2TwriJ_.js";
|
|
5
|
+
import { AbstractButtonElement as G } from "../abstract-elements/index.js";
|
|
6
|
+
var x = Object.defineProperty, H = Object.getOwnPropertyDescriptor, R = (e, t, s) => t in e ? x(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, F = (e, t, s, r) => {
|
|
7
|
+
for (var n = r > 1 ? void 0 : r ? H(t, s) : t, p = e.length - 1, l; p >= 0; p--)
|
|
8
|
+
(l = e[p]) && (n = (r ? l(t, s, n) : l(n)) || n);
|
|
9
|
+
return r && n && x(t, s, n), n;
|
|
10
|
+
}, $ = (e, t, s) => (R(e, typeof t != "symbol" ? t + "" : t, s), s), T = (e, t, s) => {
|
|
11
11
|
if (!t.has(e))
|
|
12
|
-
throw TypeError("Cannot " +
|
|
13
|
-
},
|
|
12
|
+
throw TypeError("Cannot " + s);
|
|
13
|
+
}, i = (e, t, s) => (T(e, t, "read from private field"), s ? s.call(e) : t.get(e)), o = (e, t, s) => {
|
|
14
14
|
if (t.has(e))
|
|
15
15
|
throw TypeError("Cannot add the same private member more than once");
|
|
16
|
-
t instanceof WeakSet ? t.add(e) : t.set(e,
|
|
17
|
-
},
|
|
18
|
-
let a = class extends
|
|
16
|
+
t instanceof WeakSet ? t.add(e) : t.set(e, s);
|
|
17
|
+
}, W = (e, t, s, r) => (T(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), P = (e, t, s) => (T(e, t, "access private method"), s), S, h, m, d, g, f, k, D, _, w, y, E, L, M, v;
|
|
18
|
+
let a = class extends I {
|
|
19
19
|
constructor() {
|
|
20
|
-
super(...arguments), o(this,
|
|
21
|
-
|
|
22
|
-
addEventListener("click",
|
|
20
|
+
super(...arguments), o(this, k), o(this, _), o(this, L), o(this, S, -1), o(this, h, new q(!1)), o(this, m, void 0), o(this, d, new C(this, "history", !1)), o(this, g, new C(this, "single", !1)), o(this, f, !1), $(this, "open", () => {
|
|
21
|
+
i(this, h).current || (i(this, h).current = !0, i(this, g).current && (a.__opened.forEach((e) => e.close()), a.__opened = []), a.__opened.push(this), W(this, S, a.__opened.length - 1), i(this, d).current && i(this, f) && history.pushState("", "", i(this, k, D)), clearTimeout(i(this, m)), this.classList.add("triggered"), this.style.display = "block", setTimeout(() => {
|
|
22
|
+
addEventListener("click", i(this, y)), addEventListener("keydown", i(this, E)), this.style.opacity = "1", this.classList.add("opened");
|
|
23
23
|
}));
|
|
24
|
-
}),
|
|
25
|
-
|
|
24
|
+
}), $(this, "close", () => {
|
|
25
|
+
i(this, h).current && (i(this, h).current = !1, a.__opened = a.__opened.filter((e) => e !== this), i(this, d).current && history.replaceState(
|
|
26
|
+
"",
|
|
27
|
+
"",
|
|
28
|
+
location.href.replace(new RegExp(`[&?]${i(this, _, w)}`, "g"), "")
|
|
29
|
+
), this.classList.remove("opened"), this.style.opacity = "0", removeEventListener("click", i(this, y)), removeEventListener("keydown", i(this, E)), setTimeout(() => {
|
|
26
30
|
this.classList.remove("triggered"), this.style.display = "none";
|
|
27
|
-
},
|
|
28
|
-
}), o(this,
|
|
29
|
-
|
|
31
|
+
}, B(this)));
|
|
32
|
+
}), o(this, y, (e) => {
|
|
33
|
+
P(this, L, M).call(this, () => {
|
|
30
34
|
const t = e.composedPath();
|
|
31
|
-
(!t.find((
|
|
32
|
-
(
|
|
35
|
+
(!t.find((s) => s === this) && !t.find(
|
|
36
|
+
(s) => s instanceof HTMLElement && s.closest("e-popover-button")
|
|
33
37
|
) || t[0] instanceof HTMLElement && t[0].hasAttribute("outside")) && this.close();
|
|
34
38
|
});
|
|
35
|
-
}), o(this,
|
|
36
|
-
|
|
39
|
+
}), o(this, E, (e) => {
|
|
40
|
+
P(this, L, M).call(this, () => {
|
|
37
41
|
e.code === "Escape" && this.close();
|
|
38
42
|
});
|
|
39
|
-
}), o(this,
|
|
40
|
-
|
|
43
|
+
}), o(this, v, () => {
|
|
44
|
+
W(this, f, !1), i(this, h).current && i(this, d).current && !location.search.includes(i(this, _, w)) ? this.close() : !i(this, h).current && i(this, d).current && location.search.includes(i(this, _, w)) && this.open(), W(this, f, !0);
|
|
41
45
|
});
|
|
42
46
|
}
|
|
43
47
|
get history() {
|
|
44
|
-
return
|
|
48
|
+
return i(this, d);
|
|
45
49
|
}
|
|
46
50
|
get single() {
|
|
47
|
-
return
|
|
51
|
+
return i(this, g);
|
|
48
52
|
}
|
|
49
53
|
get opened() {
|
|
50
|
-
return
|
|
54
|
+
return i(this, h);
|
|
51
55
|
}
|
|
52
56
|
connectedCallback() {
|
|
53
|
-
this.style.opacity = "0", this.style.display = "none", addEventListener("popstate",
|
|
54
|
-
|
|
57
|
+
this.style.opacity = "0", this.style.display = "none", addEventListener("popstate", i(this, v)), setTimeout(() => {
|
|
58
|
+
i(this, v).call(this);
|
|
55
59
|
}, 0);
|
|
56
60
|
}
|
|
57
61
|
disconnectedCallback() {
|
|
58
|
-
clearTimeout(
|
|
62
|
+
clearTimeout(i(this, m)), removeEventListener("popstate", i(this, v));
|
|
59
63
|
}
|
|
60
64
|
};
|
|
61
|
-
|
|
65
|
+
S = /* @__PURE__ */ new WeakMap();
|
|
62
66
|
h = /* @__PURE__ */ new WeakMap();
|
|
63
|
-
v = /* @__PURE__ */ new WeakMap();
|
|
64
|
-
d = /* @__PURE__ */ new WeakMap();
|
|
65
67
|
m = /* @__PURE__ */ new WeakMap();
|
|
66
|
-
|
|
67
|
-
M = /* @__PURE__ */ new WeakSet();
|
|
68
|
-
A = function() {
|
|
69
|
-
return `${location.pathname}${location.pathname.endsWith("/") ? "" : "/"}${this.id}`;
|
|
70
|
-
};
|
|
71
|
-
w = /* @__PURE__ */ new WeakMap();
|
|
68
|
+
d = /* @__PURE__ */ new WeakMap();
|
|
72
69
|
g = /* @__PURE__ */ new WeakMap();
|
|
73
|
-
y = /* @__PURE__ */ new WeakSet();
|
|
74
|
-
S = function(e) {
|
|
75
|
-
(a.__opened[s(this, E) - 1] || a.__opened.length === 1) && e();
|
|
76
|
-
};
|
|
77
70
|
f = /* @__PURE__ */ new WeakMap();
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
71
|
+
k = /* @__PURE__ */ new WeakSet();
|
|
72
|
+
D = function() {
|
|
73
|
+
return `${location.pathname}${location.search ? location.search + "&" : "?"}${i(this, _, w)}`;
|
|
74
|
+
};
|
|
75
|
+
_ = /* @__PURE__ */ new WeakSet();
|
|
76
|
+
w = function() {
|
|
77
|
+
return `modal-${this.id}`;
|
|
78
|
+
};
|
|
79
|
+
y = /* @__PURE__ */ new WeakMap();
|
|
80
|
+
E = /* @__PURE__ */ new WeakMap();
|
|
81
|
+
L = /* @__PURE__ */ new WeakSet();
|
|
82
|
+
M = function(e) {
|
|
83
|
+
(a.__opened[i(this, S) - 1] || a.__opened.length === 1) && e();
|
|
84
|
+
};
|
|
85
|
+
v = /* @__PURE__ */ new WeakMap();
|
|
86
|
+
$(a, "__opened", []);
|
|
87
|
+
a = F([
|
|
88
|
+
A("e-popover")
|
|
81
89
|
], a);
|
|
82
|
-
var
|
|
83
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
84
|
-
(l = e[
|
|
85
|
-
return r && n &&
|
|
86
|
-
},
|
|
90
|
+
var z = Object.defineProperty, J = Object.getOwnPropertyDescriptor, K = (e, t, s, r) => {
|
|
91
|
+
for (var n = r > 1 ? void 0 : r ? J(t, s) : t, p = e.length - 1, l; p >= 0; p--)
|
|
92
|
+
(l = e[p]) && (n = (r ? l(t, s, n) : l(n)) || n);
|
|
93
|
+
return r && n && z(t, s, n), n;
|
|
94
|
+
}, N = (e, t, s) => {
|
|
87
95
|
if (!t.has(e))
|
|
88
|
-
throw TypeError("Cannot " +
|
|
89
|
-
}, u = (e, t,
|
|
96
|
+
throw TypeError("Cannot " + s);
|
|
97
|
+
}, u = (e, t, s) => (N(e, t, "read from private field"), s ? s.call(e) : t.get(e)), Q = (e, t, s) => {
|
|
90
98
|
if (t.has(e))
|
|
91
99
|
throw TypeError("Cannot add the same private member more than once");
|
|
92
|
-
t instanceof WeakSet ? t.add(e) : t.set(e,
|
|
93
|
-
},
|
|
94
|
-
let
|
|
100
|
+
t instanceof WeakSet ? t.add(e) : t.set(e, s);
|
|
101
|
+
}, U = (e, t, s, r) => (N(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), c;
|
|
102
|
+
let O = class extends G {
|
|
95
103
|
constructor() {
|
|
96
|
-
super(...arguments),
|
|
104
|
+
super(...arguments), Q(this, c, void 0);
|
|
97
105
|
}
|
|
98
106
|
get popoverElement() {
|
|
99
|
-
return u(this,
|
|
107
|
+
return u(this, c);
|
|
100
108
|
}
|
|
101
109
|
click() {
|
|
102
|
-
if (u(this,
|
|
110
|
+
if (u(this, c)) {
|
|
103
111
|
const e = this.getAttribute("type") || "open";
|
|
104
|
-
e === "open" || e === "toggle" && !u(this,
|
|
112
|
+
e === "open" || e === "toggle" && !u(this, c).opened.current ? u(this, c).open() : (e === "close" || e === "toggle" && u(this, c).opened.current) && u(this, c).close();
|
|
105
113
|
}
|
|
106
114
|
}
|
|
107
115
|
connectedCallback() {
|
|
108
116
|
const e = this.getAttribute("target");
|
|
109
117
|
if (e) {
|
|
110
118
|
const t = document.querySelector(`#${e}`) || this.getRootNode().querySelector(`#${e}`);
|
|
111
|
-
t ?
|
|
119
|
+
t ? U(this, c, t) : console.warn(this, `target ${e} not found`);
|
|
112
120
|
}
|
|
113
121
|
}
|
|
114
122
|
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
],
|
|
123
|
+
c = /* @__PURE__ */ new WeakMap();
|
|
124
|
+
O = K([
|
|
125
|
+
A("e-popover-button")
|
|
126
|
+
], O);
|
|
119
127
|
export {
|
|
120
|
-
|
|
128
|
+
O as PopoverButtonElement,
|
|
121
129
|
a as PopoverElement
|
|
122
130
|
};
|
package/lib/router/Route.d.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import { RouteElement } from './RouteElement';
|
|
2
1
|
export type RouteModule = () => Promise<any>;
|
|
2
|
+
export type RouteURLParams<T extends string = string> = Partial<{
|
|
3
|
+
[key in T]: string;
|
|
4
|
+
}>;
|
|
5
|
+
export type RouteParameters<PathnameParams extends string = string, SearchParams extends string = string> = {
|
|
6
|
+
pathnameParams: RouteURLParams<PathnameParams>;
|
|
7
|
+
searchParams: RouteURLParams<SearchParams>;
|
|
8
|
+
};
|
|
3
9
|
export declare class Route {
|
|
4
10
|
#private;
|
|
5
11
|
constructor(pattern: string, module: RouteModule);
|
|
6
12
|
get pattern(): string;
|
|
7
13
|
get urlPattern(): URLPattern;
|
|
8
14
|
get isActive(): boolean;
|
|
9
|
-
get element():
|
|
15
|
+
get element(): HTMLElement | null;
|
|
10
16
|
get outlet(): HTMLElement | ShadowRoot | null;
|
|
11
17
|
testPathname(pathname: string): boolean;
|
|
12
18
|
render(containerElement: HTMLElement | ShadowRoot, pathname: string): Promise<void>;
|