aptechka 0.1.14 → 0.1.15
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-Fy7tHx4d.js +33 -0
- package/lib/Damped-mdFs8WSd.cjs +1 -0
- package/lib/{WheelControls-CX9WUbBC.js → WheelControls-BN4XGOpG.js} +29 -34
- package/lib/WheelControls-Dc1xcVG6.cjs +1 -0
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +21 -24
- package/lib/component/Component.d.ts +7 -3
- package/lib/component/hooks/custom-element.d.ts +2 -0
- package/lib/component/index.cjs +1 -1
- package/lib/component/index.d.ts +2 -1
- package/lib/component/index.js +174 -139
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +20 -23
- package/lib/en3/{test → core}/En3Raycaster.d.ts +1 -1
- package/lib/en3/core/en3.d.ts +2 -0
- package/lib/en3/index.cjs +7 -7
- package/lib/en3/index.d.ts +1 -1
- package/lib/en3/index.js +540 -523
- package/lib/index-B-ZmkQyB.cjs +9 -0
- package/lib/{index-BWTXnG5n.js → index-Dizn7btU.js} +96 -96
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.d.ts +15 -0
- package/lib/layout-box/index.js +102 -93
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +71 -75
- package/lib/object-BZELAoVj.cjs +1 -0
- package/lib/object-R34VLqhp.js +85 -0
- package/lib/order/index.cjs +1 -1
- package/lib/order/index.d.ts +1 -0
- package/lib/order/index.js +1 -1
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +50 -50
- package/lib/resized/index.d.ts +11 -0
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +101 -105
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +2 -2
- package/lib/select/index.cjs +1 -1
- package/lib/select/index.js +1 -1
- package/lib/studio/index.cjs +1 -1
- package/lib/studio/index.js +1 -1
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +15 -14
- package/lib/utils/object.d.ts +1 -0
- package/package.json +1 -1
- package/lib/Damped-BwpMU9Gi.cjs +0 -1
- package/lib/Damped-urvryQLo.js +0 -36
- package/lib/WheelControls-CfDeGCOU.cjs +0 -1
- package/lib/component/hooks/shadow.d.ts +0 -1
- package/lib/index-3G1lTMEf.cjs +0 -9
- package/lib/object-C1ph624j.cjs +0 -1
- package/lib/object-DIPjdukP.js +0 -73
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
function c(e) {
|
|
2
|
+
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
3
|
+
}
|
|
4
|
+
function y(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 t = Array.isArray(e) ? [] : {};
|
|
12
|
+
for (const r in e)
|
|
13
|
+
e.hasOwnProperty(r) && (t[r] = y(e[r]));
|
|
14
|
+
return t;
|
|
15
|
+
}
|
|
16
|
+
function o(e, t, r = c) {
|
|
17
|
+
for (const n in t)
|
|
18
|
+
r(t[n]) ? (e[n] || Object.assign(e, { [n]: {} }), o(e[n], t[n], r)) : Object.assign(e, { [n]: t[n] });
|
|
19
|
+
return e;
|
|
20
|
+
}
|
|
21
|
+
function u(e) {
|
|
22
|
+
return e === null || typeof e == "undefined";
|
|
23
|
+
}
|
|
24
|
+
function i(e, t) {
|
|
25
|
+
if (typeof e != typeof t)
|
|
26
|
+
return !1;
|
|
27
|
+
if ([e, t].some((r) => u(r)))
|
|
28
|
+
return e === t;
|
|
29
|
+
if (Array.isArray(e)) {
|
|
30
|
+
const r = e.length > t.length ? e : t, n = e.length > t.length ? t : e;
|
|
31
|
+
return r.every(
|
|
32
|
+
(s, f) => i(s, n[f])
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
if (typeof e != "object" || e instanceof Node || typeof e == "object" && e.constructor.toString().startsWith("class"))
|
|
36
|
+
return e === t;
|
|
37
|
+
for (const r in e) {
|
|
38
|
+
if (!t.hasOwnProperty(r))
|
|
39
|
+
return !1;
|
|
40
|
+
if (typeof e[r] == "object" && typeof t[r] == "object") {
|
|
41
|
+
if (!i(e[r], t[r]))
|
|
42
|
+
return !1;
|
|
43
|
+
} else if (e[r] !== t[r])
|
|
44
|
+
return !1;
|
|
45
|
+
}
|
|
46
|
+
return !0;
|
|
47
|
+
}
|
|
48
|
+
function a(e, t) {
|
|
49
|
+
const r = {};
|
|
50
|
+
for (const n in e)
|
|
51
|
+
t.includes(n) && (r[n] = e[n]);
|
|
52
|
+
return r;
|
|
53
|
+
}
|
|
54
|
+
function p(e, t) {
|
|
55
|
+
const r = {};
|
|
56
|
+
for (const n in e)
|
|
57
|
+
t.includes(n) || (r[n] = e[n]);
|
|
58
|
+
return r;
|
|
59
|
+
}
|
|
60
|
+
function l(e) {
|
|
61
|
+
var t;
|
|
62
|
+
return typeof e == "function" && ((t = Object.getOwnPropertyDescriptor(e, "prototype")) == null ? void 0 : t.writable) === !1;
|
|
63
|
+
}
|
|
64
|
+
function O(e, ...t) {
|
|
65
|
+
t.forEach((r) => {
|
|
66
|
+
Object.getOwnPropertyNames(r.prototype).forEach((n) => {
|
|
67
|
+
console.log(n), Object.defineProperty(
|
|
68
|
+
e.prototype,
|
|
69
|
+
n,
|
|
70
|
+
Object.getOwnPropertyDescriptor(r.prototype, n) || /* @__PURE__ */ Object.create(null)
|
|
71
|
+
);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
c as a,
|
|
77
|
+
u as b,
|
|
78
|
+
y as c,
|
|
79
|
+
i as d,
|
|
80
|
+
O as e,
|
|
81
|
+
l as i,
|
|
82
|
+
o as m,
|
|
83
|
+
p as o,
|
|
84
|
+
a as p
|
|
85
|
+
};
|
package/lib/order/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=(L=>(L[L.DEVICE=-1e5]="DEVICE",L[L.MEDIA=-99999]="MEDIA",L[L.SOURCE_MANAGER=-99998]="SOURCE_MANAGER",L[L.SCROLL=-99997]="SCROLL",L[L.LAYOUT_BOX=-99996]="LAYOUT_BOX",L[L.EN3=1e5]="EN3",L))(e||{}),A=(L=>(L[L.SCROLL=-1e5]="SCROLL",L[L.LAYOUT_BOX=-99999]="LAYOUT_BOX",L[L.LADDER=-99998]="LADDER",L[L.EN3=1e5]="EN3",L))(A||{});exports.RESIZE_ORDER=e;exports.TICK_ORDER=A;
|
package/lib/order/index.d.ts
CHANGED
package/lib/order/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var A = /* @__PURE__ */ ((L) => (L[L.DEVICE = -1e5] = "DEVICE", L[L.MEDIA = -99999] = "MEDIA", L[L.SOURCE_MANAGER = -99998] = "SOURCE_MANAGER", L[L.SCROLL = -99997] = "SCROLL", L[L.LAYOUT_BOX = -99996] = "LAYOUT_BOX", L[L.EN3 = 1e5] = "EN3", L))(A || {}), e = /* @__PURE__ */ ((L) => (L[L.SCROLL = -1e5] = "SCROLL", L[L.LAYOUT_BOX = -99999] = "LAYOUT_BOX", L[L.EN3 = 1e5] = "EN3", L))(e || {});
|
|
1
|
+
var A = /* @__PURE__ */ ((L) => (L[L.DEVICE = -1e5] = "DEVICE", L[L.MEDIA = -99999] = "MEDIA", L[L.SOURCE_MANAGER = -99998] = "SOURCE_MANAGER", L[L.SCROLL = -99997] = "SCROLL", L[L.LAYOUT_BOX = -99996] = "LAYOUT_BOX", L[L.EN3 = 1e5] = "EN3", L))(A || {}), e = /* @__PURE__ */ ((L) => (L[L.SCROLL = -1e5] = "SCROLL", L[L.LAYOUT_BOX = -99999] = "LAYOUT_BOX", L[L.LADDER = -99998] = "LADDER", L[L.EN3 = 1e5] = "EN3", L))(e || {});
|
|
2
2
|
export {
|
|
3
3
|
A as RESIZE_ORDER,
|
|
4
4
|
e as TICK_ORDER
|
package/lib/popover/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("../attribute/index.cjs"),M=require("../custom-element/index.cjs"),A=require("../Store-D0_rDIsE.cjs"),q=require("../style-At6aDoqG.cjs"),x=require("../abstract-elements/index.cjs");var B=Object.defineProperty,D=Object.getOwnPropertyDescriptor,I=(t,e,s,i)=>{for(var n=i>1?void 0:i?D(e,s):e,c=t.length-1,l;c>=0;c--)(l=t[c])&&(n=(i?l(e,s,n):l(n))||n);return i&&n&&B(e,s,n),n},W=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},r=(t,e,s)=>(W(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)},k=(t,e,s,i)=>(W(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),T=(t,e,s)=>(W(t,e,"access private method"),s),P,a,m,p,E,v,S,C,u,f,w,g,y,L,_;exports.PopoverElement=class extends M.CustomElement{constructor(){super(...arguments),o(this,S),o(this,u),o(this,y),o(this,P,-1),o(this,a,new A.Store(!1)),o(this,m,void 0),o(this,p,new $.Attribute(this,"history",!1)),o(this,E,new $.Attribute(this,"single",!1)),o(this,v,!1),this.open=()=>{r(this,a).current||(r(this,a).current=!0,r(this,E).current&&(exports.PopoverElement.__opened.forEach(e=>e.close()),exports.PopoverElement.__opened=[]),exports.PopoverElement.__opened.push(this),k(this,P,exports.PopoverElement.__opened.length-1),r(this,p).current&&r(this,v)&&history.pushState("","",r(this,S,C)),clearTimeout(r(this,m)),this.classList.add("triggered"),this.style.display="block",setTimeout(()=>{addEventListener("click",r(this,w)),addEventListener("keydown",r(this,g)),this.style.opacity="1",this.classList.add("opened")}))},this.close=()=>{r(this,a).current&&(r(this,a).current=!1,exports.PopoverElement.__opened=exports.PopoverElement.__opened.filter(e=>e!==this),r(this,p).current&&history.replaceState("","",location.href.replace(new RegExp(`[&?]${r(this,u,f)}`,"g"),"")),this.classList.remove("opened"),this.style.opacity="0",removeEventListener("click",r(this,w)),removeEventListener("keydown",r(this,g)),setTimeout(()=>{this.classList.remove("triggered"),this.style.display="none"},q.getElementTransitionDurationMS(this)))},o(this,w,e=>{T(this,y,L).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,g,e=>{T(this,y,L).call(this,()=>{e.code==="Escape"&&this.close()})}),o(this,_,()=>{k(this,v,!1),r(this,a).current&&r(this,p).current&&!location.search.includes(r(this,u,f))?this.close():!r(this,a).current&&r(this,p).current&&location.search.includes(r(this,u,f))&&this.open(),k(this,v,!0)})}get history(){return r(this,p)}get single(){return r(this,E)}get opened(){return r(this,a)}connectedCallback(){this.style.opacity="0",this.style.display="none",addEventListener("popstate",r(this,_)),setTimeout(()=>{r(this,_).call(this)},0)}disconnectedCallback(){clearTimeout(r(this,m)),removeEventListener("popstate",r(this,_))}};P=new WeakMap;a=new WeakMap;m=new WeakMap;p=new WeakMap;E=new WeakMap;v=new WeakMap;S=new WeakSet;C=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${r(this,u,f)}`};u=new WeakSet;f=function(){return`modal-${this.id}`};w=new WeakMap;g=new WeakMap;y=new WeakSet;L=function(t){(exports.PopoverElement.__opened[r(this,P)-1]||exports.PopoverElement.__opened.length===1)&&t()};_=new WeakMap;exports.PopoverElement.__opened=[];exports.PopoverElement=I([M.define("e-popover")],exports.PopoverElement);var N=Object.defineProperty,G=Object.getOwnPropertyDescriptor,H=(t,e,s,i)=>{for(var n=i>1?void 0:i?G(e,s):e,c=t.length-1,l;c>=0;c--)(l=t[c])&&(n=(i?l(e,s,n):l(n))||n);return i&&n&&N(e,s,n),n},O=(t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)},d=(t,e,s)=>(O(t,e,"read from private field"),s?s.call(t):e.get(t)),R=(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)},b=(t,e,s,i)=>(O(t,e,"write to private field"),i?i.call(t,s):e.set(t,s),s),h;exports.PopoverButtonElement=class extends x.AbstractButtonElement{constructor(){super(...arguments),R(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 s=document.querySelector(`#${e}`)||this.getRootNode().querySelector(`#${e}`);s?b(this,h,s):console.warn(this,`target ${e} not found`)}}};h=new WeakMap;exports.PopoverButtonElement=H([M.define("e-popover-button")],exports.PopoverButtonElement);
|
package/lib/popover/index.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
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 ?
|
|
1
|
+
import { Attribute as T } from "../attribute/index.js";
|
|
2
|
+
import { CustomElement as D, define as P } from "../custom-element/index.js";
|
|
3
|
+
import { S as I } from "../Store-JOKrNVEr.js";
|
|
4
|
+
import { g as N } from "../style-j2TwriJ_.js";
|
|
5
|
+
import { AbstractButtonElement as q } from "../abstract-elements/index.js";
|
|
6
|
+
var B = Object.defineProperty, G = Object.getOwnPropertyDescriptor, H = (e, t, s, r) => {
|
|
7
|
+
for (var n = r > 1 ? void 0 : r ? G(t, s) : t, p = e.length - 1, l; p >= 0; p--)
|
|
8
8
|
(l = e[p]) && (n = (r ? l(t, s, n) : l(n)) || n);
|
|
9
|
-
return r && n &&
|
|
10
|
-
},
|
|
9
|
+
return r && n && B(t, s, n), n;
|
|
10
|
+
}, M = (e, t, s) => {
|
|
11
11
|
if (!t.has(e))
|
|
12
12
|
throw TypeError("Cannot " + s);
|
|
13
|
-
}, i = (e, t, s) => (
|
|
13
|
+
}, i = (e, t, s) => (M(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
16
|
t instanceof WeakSet ? t.add(e) : t.set(e, s);
|
|
17
|
-
},
|
|
18
|
-
let a = class extends
|
|
17
|
+
}, S = (e, t, s, r) => (M(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), C = (e, t, s) => (M(e, t, "access private method"), s), L, h, g, d, m, f, W, A, u, w, y, E, k, $, v;
|
|
18
|
+
let a = class extends D {
|
|
19
19
|
constructor() {
|
|
20
|
-
super(...arguments), o(this,
|
|
21
|
-
i(this, h).current || (i(this, h).current = !0, i(this,
|
|
20
|
+
super(...arguments), o(this, W), o(this, u), o(this, k), o(this, L, -1), o(this, h, new I(!1)), o(this, g, void 0), o(this, d, new T(this, "history", !1)), o(this, m, new T(this, "single", !1)), o(this, f, !1), this.open = () => {
|
|
21
|
+
i(this, h).current || (i(this, h).current = !0, i(this, m).current && (a.__opened.forEach((e) => e.close()), a.__opened = []), a.__opened.push(this), S(this, L, a.__opened.length - 1), i(this, d).current && i(this, f) && history.pushState("", "", i(this, W, A)), clearTimeout(i(this, g)), this.classList.add("triggered"), this.style.display = "block", setTimeout(() => {
|
|
22
22
|
addEventListener("click", i(this, y)), addEventListener("keydown", i(this, E)), this.style.opacity = "1", this.classList.add("opened");
|
|
23
23
|
}));
|
|
24
|
-
}
|
|
24
|
+
}, this.close = () => {
|
|
25
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
26
|
"",
|
|
27
27
|
"",
|
|
28
|
-
location.href.replace(new RegExp(`[&?]${i(this,
|
|
28
|
+
location.href.replace(new RegExp(`[&?]${i(this, u, w)}`, "g"), "")
|
|
29
29
|
), this.classList.remove("opened"), this.style.opacity = "0", removeEventListener("click", i(this, y)), removeEventListener("keydown", i(this, E)), setTimeout(() => {
|
|
30
30
|
this.classList.remove("triggered"), this.style.display = "none";
|
|
31
|
-
},
|
|
32
|
-
}
|
|
33
|
-
|
|
31
|
+
}, N(this)));
|
|
32
|
+
}, o(this, y, (e) => {
|
|
33
|
+
C(this, k, $).call(this, () => {
|
|
34
34
|
const t = e.composedPath();
|
|
35
35
|
(!t.find((s) => s === this) && !t.find(
|
|
36
36
|
(s) => s instanceof HTMLElement && s.closest("e-popover-button")
|
|
37
37
|
) || t[0] instanceof HTMLElement && t[0].hasAttribute("outside")) && this.close();
|
|
38
38
|
});
|
|
39
39
|
}), o(this, E, (e) => {
|
|
40
|
-
|
|
40
|
+
C(this, k, $).call(this, () => {
|
|
41
41
|
e.code === "Escape" && this.close();
|
|
42
42
|
});
|
|
43
43
|
}), o(this, v, () => {
|
|
44
|
-
|
|
44
|
+
S(this, f, !1), i(this, h).current && i(this, d).current && !location.search.includes(i(this, u, w)) ? this.close() : !i(this, h).current && i(this, d).current && location.search.includes(i(this, u, w)) && this.open(), S(this, f, !0);
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
get history() {
|
|
48
48
|
return i(this, d);
|
|
49
49
|
}
|
|
50
50
|
get single() {
|
|
51
|
-
return i(this,
|
|
51
|
+
return i(this, m);
|
|
52
52
|
}
|
|
53
53
|
get opened() {
|
|
54
54
|
return i(this, h);
|
|
@@ -59,70 +59,70 @@ let a = class extends I {
|
|
|
59
59
|
}, 0);
|
|
60
60
|
}
|
|
61
61
|
disconnectedCallback() {
|
|
62
|
-
clearTimeout(i(this,
|
|
62
|
+
clearTimeout(i(this, g)), removeEventListener("popstate", i(this, v));
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
|
-
|
|
65
|
+
L = /* @__PURE__ */ new WeakMap();
|
|
66
66
|
h = /* @__PURE__ */ new WeakMap();
|
|
67
|
-
m = /* @__PURE__ */ new WeakMap();
|
|
68
|
-
d = /* @__PURE__ */ new WeakMap();
|
|
69
67
|
g = /* @__PURE__ */ new WeakMap();
|
|
68
|
+
d = /* @__PURE__ */ new WeakMap();
|
|
69
|
+
m = /* @__PURE__ */ new WeakMap();
|
|
70
70
|
f = /* @__PURE__ */ new WeakMap();
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return `${location.pathname}${location.search ? location.search + "&" : "?"}${i(this,
|
|
71
|
+
W = /* @__PURE__ */ new WeakSet();
|
|
72
|
+
A = function() {
|
|
73
|
+
return `${location.pathname}${location.search ? location.search + "&" : "?"}${i(this, u, w)}`;
|
|
74
74
|
};
|
|
75
|
-
|
|
75
|
+
u = /* @__PURE__ */ new WeakSet();
|
|
76
76
|
w = function() {
|
|
77
77
|
return `modal-${this.id}`;
|
|
78
78
|
};
|
|
79
79
|
y = /* @__PURE__ */ new WeakMap();
|
|
80
80
|
E = /* @__PURE__ */ new WeakMap();
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
(a.__opened[i(this,
|
|
81
|
+
k = /* @__PURE__ */ new WeakSet();
|
|
82
|
+
$ = function(e) {
|
|
83
|
+
(a.__opened[i(this, L) - 1] || a.__opened.length === 1) && e();
|
|
84
84
|
};
|
|
85
85
|
v = /* @__PURE__ */ new WeakMap();
|
|
86
|
-
|
|
87
|
-
a =
|
|
88
|
-
|
|
86
|
+
a.__opened = [];
|
|
87
|
+
a = H([
|
|
88
|
+
P("e-popover")
|
|
89
89
|
], a);
|
|
90
|
-
var
|
|
91
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
90
|
+
var R = Object.defineProperty, z = Object.getOwnPropertyDescriptor, F = (e, t, s, r) => {
|
|
91
|
+
for (var n = r > 1 ? void 0 : r ? z(t, s) : t, p = e.length - 1, l; p >= 0; p--)
|
|
92
92
|
(l = e[p]) && (n = (r ? l(t, s, n) : l(n)) || n);
|
|
93
|
-
return r && n &&
|
|
94
|
-
},
|
|
93
|
+
return r && n && R(t, s, n), n;
|
|
94
|
+
}, x = (e, t, s) => {
|
|
95
95
|
if (!t.has(e))
|
|
96
96
|
throw TypeError("Cannot " + s);
|
|
97
|
-
},
|
|
97
|
+
}, _ = (e, t, s) => (x(e, t, "read from private field"), s ? s.call(e) : t.get(e)), J = (e, t, s) => {
|
|
98
98
|
if (t.has(e))
|
|
99
99
|
throw TypeError("Cannot add the same private member more than once");
|
|
100
100
|
t instanceof WeakSet ? t.add(e) : t.set(e, s);
|
|
101
|
-
},
|
|
102
|
-
let O = class extends
|
|
101
|
+
}, K = (e, t, s, r) => (x(e, t, "write to private field"), r ? r.call(e, s) : t.set(e, s), s), c;
|
|
102
|
+
let O = class extends q {
|
|
103
103
|
constructor() {
|
|
104
|
-
super(...arguments),
|
|
104
|
+
super(...arguments), J(this, c, void 0);
|
|
105
105
|
}
|
|
106
106
|
get popoverElement() {
|
|
107
|
-
return
|
|
107
|
+
return _(this, c);
|
|
108
108
|
}
|
|
109
109
|
click() {
|
|
110
|
-
if (
|
|
110
|
+
if (_(this, c)) {
|
|
111
111
|
const e = this.getAttribute("type") || "open";
|
|
112
|
-
e === "open" || e === "toggle" && !
|
|
112
|
+
e === "open" || e === "toggle" && !_(this, c).opened.current ? _(this, c).open() : (e === "close" || e === "toggle" && _(this, c).opened.current) && _(this, c).close();
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
connectedCallback() {
|
|
116
116
|
const e = this.getAttribute("target");
|
|
117
117
|
if (e) {
|
|
118
118
|
const t = document.querySelector(`#${e}`) || this.getRootNode().querySelector(`#${e}`);
|
|
119
|
-
t ?
|
|
119
|
+
t ? K(this, c, t) : console.warn(this, `target ${e} not found`);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
123
|
c = /* @__PURE__ */ new WeakMap();
|
|
124
|
-
O =
|
|
125
|
-
|
|
124
|
+
O = F([
|
|
125
|
+
P("e-popover-button")
|
|
126
126
|
], O);
|
|
127
127
|
export {
|
|
128
128
|
O as PopoverButtonElement,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Store, StoreOptions } from '../store';
|
|
2
|
+
import { ElementOrSelector } from '../utils';
|
|
3
|
+
export interface ResizedOptions extends StoreOptions<number, 'number'> {
|
|
4
|
+
dispatcher?: ElementOrSelector;
|
|
5
|
+
}
|
|
6
|
+
export type ResizedCallback = () => number;
|
|
7
|
+
export declare class Resized extends Store<number, 'number'> {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(callback: ResizedCallback, options?: ResizedOptions);
|
|
10
|
+
close(): void;
|
|
11
|
+
}
|
package/lib/router/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
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)),o=(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)},r=(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,f)=>{var h=u=>{try{d(s.next(u))}catch(T){f(T)}},a=u=>{try{d(s.throw(u))}catch(T){f(T)}},d=u=>u.done?i(u.value):Promise.resolve(u.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,f)=>(f=n[i])&&(t[i]=h=>new Promise((a,d,u)=>(h=f.call(n,h),u=h.done,Promise.resolve(h.value).then(T=>a({value:T,done:u}),d)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const et=require("urlpattern-polyfill"),st=require("../notifier/index.cjs"),_=require("../browser-CpzFX2xg.cjs"),it=require("../function-MthRj-GJ.cjs"),Z=require("../object-BZELAoVj.cjs");var b,O,R,m,l,v,S,p,P,y,I,$;class nt{constructor(t,s){o(this,I);o(this,b,void 0);o(this,O,void 0);o(this,R,void 0);o(this,m,void 0);o(this,l,void 0);o(this,v,void 0);o(this,S,void 0);o(this,p,null);o(this,P,[]);o(this,y,[]);r(this,b,t),r(this,O,s),r(this,R,new URLPattern({pathname:e(this,b)})),r(this,m,null),r(this,l,null),r(this,v,!1),r(this,S,null),_.isBrowser&&r(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 outlet(){return e(this,S)}testPathname(t){return this.urlPattern.test({pathname:t})}render(t,s){return B(this,null,function*(){var i,f;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(r(this,y,[...e(this,P)]),typeof h.default=="function"&&(r(this,m,h.default),Z.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)),u={pathnameParams:a,searchParams:d};Z.isESClass(e(this,m))?r(this,l,new(e(this,m))(u)):r(this,l,e(this,m).call(this,u)),t.appendChild(e(this,l)),r(this,S,e(this,l).querySelector("[data-outlet]")||((f=e(this,l).shadowRoot)==null?void 0:f.querySelector("[data-outlet]"))||e(this,l).shadowRoot||e(this,l)),r(this,v,!0)}e(this,p).disconnect()})}close(){var t;e(this,p).disconnect(),(t=e(this,l))==null||t.remove(),r(this,v,!1),e(this,y).forEach(s=>document.head.removeChild(s)),r(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,f,h;i=!(f=yield s.next()).done;i=!1){const a=f.value;yield new Promise(d=>{a.onload=()=>{d()}})}}catch(f){h=[f]}finally{try{i&&(f=s.return)&&(yield f.call(s))}finally{if(h)throw h[0]}}})};var H,g,A,U,j;class rt{constructor(t,s){o(this,H,void 0);o(this,g,void 0);o(this,A,void 0);o(this,U,void 0);o(this,j,t=>{t.preventDefault(),e(this,H).navigate(e(this,A),e(this,U))});r(this,H,t),r(this,g,s),r(this,A,e(this,g).getAttribute("href")||"/"),r(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=et.URLPattern;var k,q,w,C,M,E,N,x,D,K,tt,W;const Y=class Y{constructor(t){o(this,K);o(this,k,null);o(this,q,void 0);o(this,w,[]);o(this,C,null);o(this,M,[]);o(this,E,void 0);o(this,N,null);o(this,x,new st.Notifier);o(this,D,it.debounce(()=>{const t=s=>s.split("/").length;r(this,w,e(this,w).sort((s,i)=>t(s.pattern)-t(i.pattern))),this.navigate(location.pathname.replace(e(this,q),""))},0));o(this,W,t=>{t.state&&this.navigate(t.state,"none")});r(this,q,(t==null?void 0:t.base)||""),Y.active=this,_.isBrowser&&(r(this,k,(t==null?void 0:t.rootElement)||document.body),addEventListener("popstate",e(this,W)))}get currentPathname(){return e(this,N)}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 u,Q;if(e(this,E)===t||e(this,N)===t)return;Y.active=this,r(this,E,t);const i=e(this,w).filter(c=>c.isActive),f=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){r(this,C,a[a.length-1]),h.forEach(L=>{L.close()}),r(this,N,t);try{for(var T=G(f),at,ct,lt;at=!(ct=yield T.next()).done;at=!1){const L=ct.value;yield L.render(((u=e(this,C))==null?void 0:u.outlet)||e(this,k),t),r(this,C,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,tt).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,C=new WeakMap,M=new WeakMap,E=new WeakMap,N=new WeakMap,x=new WeakMap,D=new WeakMap,K=new WeakSet,tt=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 f;return(f=i.getAttribute("href"))==null?void 0:f.startsWith("/")})));e(this,M).forEach(i=>{i.destroy()}),r(this,M,s.map(i=>new rt(this,i)))},W=new WeakMap;let J=Y;exports.Router=J;
|