aptechka 0.53.2 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/element-linked-store/index.cjs +1 -0
- package/lib/{class-linked-status → element-linked-store}/index.d.ts +4 -3
- package/lib/element-linked-store/index.js +57 -0
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +91 -85
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +13 -13
- package/lib/source/SourceElement.d.ts +2 -2
- package/lib/source/index.cjs +2 -2
- package/lib/source/index.js +20 -20
- package/package.json +7 -7
- package/lib/class-linked-status/index.cjs +0 -1
- package/lib/class-linked-status/index.js +0 -58
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var S=Object.defineProperty,b=Object.defineProperties;var p=Object.getOwnPropertyDescriptors;var a=Object.getOwnPropertySymbols;var g=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var u=e=>{throw TypeError(e)};var l=(e,s,t)=>s in e?S(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,f=(e,s)=>{for(var t in s||(s={}))g.call(s,t)&&l(e,t,s[t]);if(a)for(var t of a(s))k.call(s,t)&&l(e,t,s[t]);return e},d=(e,s)=>b(e,p(s));var m=(e,s,t)=>s.has(e)||u("Cannot "+t);var h=(e,s,t)=>(m(e,s,"read from private field"),t?t.call(e):s.get(e)),y=(e,s,t)=>s.has(e)?u("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(e):s.set(e,t),c=(e,s,t,r)=>(m(e,s,"write to private field"),r?r.call(e,t):s.set(e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("../Store-GokLe_g-.cjs"),E=require("../string-DUXXtU8v.cjs");require("../index-Cqw2NKev.cjs");var i;class T extends L.Store{constructor(t,r){super(r);y(this,i);c(this,i,Array.isArray(t)?t:[t]);for(const o in this.initial)this.set(o,this.initial[o])}addElement(t){h(this,i).push(t)}removeElement(t){c(this,i,h(this,i).filter(r=>r!==t))}isTrue(t){return this.current[t]===!0}isFalse(t){return this.current[t]===!1}reset(){super.reset();for(const t in this.initial)this.set(t,this.initial[t])}set(t,r){const o=t;this.current=d(f({},this.current),{[t]:r}),o.startsWith("--")?r?h(this,i).forEach(n=>n.style.setProperty(o,r.toString())):h(this,i).forEach(n=>n.style.removeProperty(o)):r?h(this,i).forEach(n=>n.classList.add(E.camelToKebab(o))):h(this,i).forEach(n=>n.classList.remove(E.camelToKebab(o)))}}i=new WeakMap;exports.ElementLinkedStore=T;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Store } from '../store';
|
|
2
|
-
export
|
|
3
|
-
|
|
2
|
+
export type ElementLinkedStoreValueType = boolean | string | number;
|
|
3
|
+
export declare class ElementLinkedStore<T extends {
|
|
4
|
+
[key in string]: ElementLinkedStoreValueType;
|
|
4
5
|
}> extends Store<T> {
|
|
5
6
|
#private;
|
|
6
7
|
constructor(element: HTMLElement | Array<HTMLElement>, value: T);
|
|
@@ -9,5 +10,5 @@ export declare class ClassLinkedStatus<T extends {
|
|
|
9
10
|
isTrue(key: keyof T): boolean;
|
|
10
11
|
isFalse(key: keyof T): boolean;
|
|
11
12
|
reset(): void;
|
|
12
|
-
set(key: keyof T, value
|
|
13
|
+
set(key: keyof T, value: ElementLinkedStoreValueType): void;
|
|
13
14
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var d = Object.defineProperty, S = Object.defineProperties;
|
|
2
|
+
var k = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var c = Object.getOwnPropertySymbols;
|
|
4
|
+
var L = Object.prototype.hasOwnProperty, b = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var f = (s) => {
|
|
6
|
+
throw TypeError(s);
|
|
7
|
+
};
|
|
8
|
+
var l = (s, r, t) => r in s ? d(s, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[r] = t, m = (s, r) => {
|
|
9
|
+
for (var t in r || (r = {}))
|
|
10
|
+
L.call(r, t) && l(s, t, r[t]);
|
|
11
|
+
if (c)
|
|
12
|
+
for (var t of c(r))
|
|
13
|
+
b.call(r, t) && l(s, t, r[t]);
|
|
14
|
+
return s;
|
|
15
|
+
}, p = (s, r) => S(s, k(r));
|
|
16
|
+
var u = (s, r, t) => r.has(s) || f("Cannot " + t);
|
|
17
|
+
var n = (s, r, t) => (u(s, r, "read from private field"), t ? t.call(s) : r.get(s)), y = (s, r, t) => r.has(s) ? f("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(s) : r.set(s, t), a = (s, r, t, i) => (u(s, r, "write to private field"), i ? i.call(s, t) : r.set(s, t), t);
|
|
18
|
+
import { S as x } from "../Store-swP_0ymB.js";
|
|
19
|
+
import { c as E } from "../string-BlMQbe8b.js";
|
|
20
|
+
import "../index-euf5anj6.js";
|
|
21
|
+
var e;
|
|
22
|
+
class F extends x {
|
|
23
|
+
constructor(t, i) {
|
|
24
|
+
super(i);
|
|
25
|
+
y(this, e);
|
|
26
|
+
a(this, e, Array.isArray(t) ? t : [t]);
|
|
27
|
+
for (const o in this.initial)
|
|
28
|
+
this.set(o, this.initial[o]);
|
|
29
|
+
}
|
|
30
|
+
addElement(t) {
|
|
31
|
+
n(this, e).push(t);
|
|
32
|
+
}
|
|
33
|
+
removeElement(t) {
|
|
34
|
+
a(this, e, n(this, e).filter((i) => i !== t));
|
|
35
|
+
}
|
|
36
|
+
isTrue(t) {
|
|
37
|
+
return this.current[t] === !0;
|
|
38
|
+
}
|
|
39
|
+
isFalse(t) {
|
|
40
|
+
return this.current[t] === !1;
|
|
41
|
+
}
|
|
42
|
+
reset() {
|
|
43
|
+
super.reset();
|
|
44
|
+
for (const t in this.initial)
|
|
45
|
+
this.set(t, this.initial[t]);
|
|
46
|
+
}
|
|
47
|
+
set(t, i) {
|
|
48
|
+
const o = t;
|
|
49
|
+
this.current = p(m({}, this.current), { [t]: i }), o.startsWith("--") ? i ? n(this, e).forEach(
|
|
50
|
+
(h) => h.style.setProperty(o, i.toString())
|
|
51
|
+
) : n(this, e).forEach((h) => h.style.removeProperty(o)) : i ? n(this, e).forEach((h) => h.classList.add(E(o))) : n(this, e).forEach((h) => h.classList.remove(E(o)));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
e = new WeakMap();
|
|
55
|
+
export {
|
|
56
|
+
F as ElementLinkedStore
|
|
57
|
+
};
|
package/lib/pointer/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var J=Object.defineProperty;var B=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var j=i=>{throw TypeError(i)};var H=(i,s,t)=>s in i?J(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,O=(i,s)=>{for(var t in s||(s={}))K.call(s,t)&&H(i,t,s[t]);if(B)for(var t of B(s))N.call(s,t)&&H(i,t,s[t]);return i};var R=(i,s,t)=>s.has(i)||j("Cannot "+t);var e=(i,s,t)=>(R(i,s,"read from private field"),t?t.call(i):s.get(i)),r=(i,s,t)=>s.has(i)?j("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),c=(i,s,t,u)=>(R(i,s,"write to private field"),u?u.call(i,t):s.set(i,t),t),D=(i,s,t)=>(R(i,s,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-GokLe_g-.cjs");const _=require("../coordinates-D8Np3cPD.cjs"),Q=require("../dom-JBOkFLTh.cjs"),W=require("../math-GDWEqu7y.cjs"),U=require("../index-Cqw2NKev.cjs");require("../ticker/index.cjs");const M=require("../Damped-DgAIjXp3.cjs"),A=require("../element-resizer/index.cjs"),F=require("../window-resizer/index.cjs"),S=require("../css-property/index.cjs");var o,a,l,d,m,p,b,x,k,f,w,C,y,q,T;class G{constructor(s){r(this,q);r(this,o);r(this,a);r(this,l);r(this,d);r(this,m);r(this,p);r(this,b,0);r(this,x,0);r(this,k,!1);r(this,f,s=>{const t=D(this,q,T).call(this,s);e(this,a).set(t.x,{equalize:!0}),e(this,l).set(t.y,{equalize:!0}),e(this,d).set(1)});r(this,w,s=>{e(this,d).set(0)});r(this,C,s=>{const t=D(this,q,T).call(this,s);e(this,a).set(t.x),e(this,l).set(t.y)});r(this,y,()=>{c(this,b,this.element.clientWidth),c(this,x,this.element.clientHeight);let s=0,t=0,u=0,h=0;e(this,m)?e(this,p)?(s=-1,t=1,u=-1,h=1):(s=e(this,b)/2*-1,t=e(this,b)/2*1,u=e(this,x)/2*-1,h=e(this,x)/2*1):e(this,p)?(s=0,t=1,u=0,h=1):(s=0,t=e(this,b),u=0,h=e(this,x)),e(this,a).min=s,e(this,a).max=t,e(this,l).min=u,e(this,l).max=h});c(this,o,Q.getElement(s.element)),c(this,a,new M.Damped(0,s.damped)),c(this,l,new M.Damped(0,s.damped)),c(this,d,new M.Damped(0,O({min:0,max:1},s.damped))),c(this,m,s.cartesian||!1),c(this,p,s.normalize||!1)}get element(){return e(this,o)}get x(){return e(this,a)}get y(){return e(this,l)}get z(){return e(this,d)}get cartesian(){return e(this,m)}set cartesian(s){c(this,m,s),e(this,y).call(this)}get normalize(){return e(this,p)}set normalize(s){c(this,p,s),e(this,y).call(this)}connect(){e(this,o).addEventListener("pointerenter",e(this,f)),e(this,o).addEventListener("pointerleave",e(this,w)),e(this,o).addEventListener("pointermove",e(this,C)),A.elementResizer.subscribe(e(this,o),e(this,y)),F.windowResizer.subscribe(e(this,y))}disconnect(){e(this,o).removeEventListener("pointerenter",e(this,f)),e(this,o).removeEventListener("pointerleave",e(this,w)),e(this,o).removeEventListener("pointermove",e(this,C)),A.elementResizer.unsubscribe(e(this,y)),F.windowResizer.unsubscribe(e(this,y)),e(this,a).reset(),e(this,l).reset(),e(this,d).reset()}}o=new WeakMap,a=new WeakMap,l=new WeakMap,d=new WeakMap,m=new WeakMap,p=new WeakMap,b=new WeakMap,x=new WeakMap,k=new WeakMap,f=new WeakMap,w=new WeakMap,C=new WeakMap,y=new WeakMap,q=new WeakSet,T=function(s){const t=_.getPointerPosition(s,e(this,o).getBoundingClientRect()),u={width:e(this,b),height:e(this,x)},h={x:t.x,y:t.y};if(e(this,m)){const z=_.screenToCartesian(h,u);h.x=z.x,h.y=z.y}if(e(this,p)){const z=_.normalize(h,u);e(this,m)?(h.x=W.clamp(z.x*2,-1,1),h.y=W.clamp(z.y*2,-1,1)):(h.x=z.x,h.y=z.y)}return h};var n,g,v,P,E,L;class I extends HTMLElement{constructor(){super();r(this,n);r(this,g,new S.CSSProperty(this,"--damping",20));r(this,v,new S.CSSProperty(this,"--mass",0));r(this,P,new S.CSSProperty(this,"--stiffness",0));r(this,E,new S.CSSProperty(this,"--cartesian",!1));r(this,L,new S.CSSProperty(this,"--normalize",!1));c(this,n,new G({element:this})),e(this,g).subscribe(t=>{e(this,n).x.damping=t.current,e(this,n).y.damping=t.current,e(this,n).z.damping=t.current}),e(this,E).subscribe(t=>{e(this,n).cartesian=t.current}),e(this,L).subscribe(t=>{e(this,n).normalize=t.current}),e(this,v).subscribe(t=>{e(this,n).x.mass=t.current,e(this,n).y.mass=t.current,e(this,n).z.mass=t.current}),e(this,P).subscribe(t=>{e(this,n).x.stiffness=t.current,e(this,n).y.stiffness=t.current,e(this,n).z.stiffness=t.current}),e(this,n).x.subscribe(t=>{this.style.setProperty("--x",t.current.toString())}),e(this,n).y.subscribe(t=>{this.style.setProperty("--y",t.current.toString())}),e(this,n).z.subscribe(t=>{this.style.setProperty("--z",t.current.toString())})}get pointer(){return e(this,n)}connectedCallback(){e(this,n).connect(),e(this,g).observe(),e(this,v).observe(),e(this,P).observe()}disconnectedCallback(){e(this,n).disconnect(),e(this,g).unobserve(),e(this,v).unobserve(),e(this,P).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}}n=new WeakMap,g=new WeakMap,v=new WeakMap,P=new WeakMap,E=new WeakMap,L=new WeakMap;U.isBrowser&&!customElements.get("e-pointer")&&customElements.define("e-pointer",I);exports.Pointer=G;exports.PointerElement=I;
|
package/lib/pointer/index.js
CHANGED
|
@@ -1,70 +1,59 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
var I = Object.defineProperty;
|
|
2
|
+
var M = Object.getOwnPropertySymbols;
|
|
3
|
+
var J = Object.prototype.hasOwnProperty, K = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var W = (i) => {
|
|
5
5
|
throw TypeError(i);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
7
|
+
var T = (i, s, e) => s in i ? I(i, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[s] = e, j = (i, s) => {
|
|
8
8
|
for (var e in s || (s = {}))
|
|
9
|
-
|
|
10
|
-
if (
|
|
11
|
-
for (var e of
|
|
12
|
-
|
|
9
|
+
J.call(s, e) && T(i, e, s[e]);
|
|
10
|
+
if (M)
|
|
11
|
+
for (var e of M(s))
|
|
12
|
+
K.call(s, e) && T(i, e, s[e]);
|
|
13
13
|
return i;
|
|
14
14
|
};
|
|
15
|
-
var
|
|
16
|
-
var t = (i, s, e) => (
|
|
15
|
+
var R = (i, s, e) => s.has(i) || W("Cannot " + e);
|
|
16
|
+
var t = (i, s, e) => (R(i, s, "read from private field"), e ? e.call(i) : s.get(i)), r = (i, s, e) => s.has(i) ? W("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(i) : s.set(i, e), c = (i, s, e, m) => (R(i, s, "write to private field"), m ? m.call(i, e) : s.set(i, e), e), k = (i, s, e) => (R(i, s, "access private method"), e);
|
|
17
17
|
import "../Store-swP_0ymB.js";
|
|
18
|
-
import { g as
|
|
19
|
-
import { g as
|
|
20
|
-
import { c as
|
|
21
|
-
import { i as
|
|
18
|
+
import { g as N, s as O, n as Q } from "../coordinates-CgdGoSYs.js";
|
|
19
|
+
import { g as U } from "../dom-CVWzyXPH.js";
|
|
20
|
+
import { c as A } from "../math-BOBiC4TN.js";
|
|
21
|
+
import { i as V } from "../index-euf5anj6.js";
|
|
22
22
|
import "../ticker/index.js";
|
|
23
|
-
import { D as
|
|
24
|
-
import { elementResizer as
|
|
25
|
-
import { windowResizer as
|
|
23
|
+
import { D as B } from "../Damped-GyAS-U-z.js";
|
|
24
|
+
import { elementResizer as F } from "../element-resizer/index.js";
|
|
25
|
+
import { windowResizer as G } from "../window-resizer/index.js";
|
|
26
26
|
import { CSSProperty as P } from "../css-property/index.js";
|
|
27
|
-
var o, a, l, b,
|
|
28
|
-
class
|
|
27
|
+
var o, a, l, b, u, p, d, f, H, S, w, E, y, L, D;
|
|
28
|
+
class X {
|
|
29
29
|
constructor(s) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
r(this, L);
|
|
31
|
+
r(this, o);
|
|
32
|
+
r(this, a);
|
|
33
|
+
r(this, l);
|
|
34
|
+
r(this, b);
|
|
35
|
+
r(this, u);
|
|
36
|
+
r(this, p);
|
|
37
|
+
r(this, d, 0);
|
|
38
|
+
r(this, f, 0);
|
|
39
|
+
r(this, H, !1);
|
|
40
|
+
r(this, S, (s) => {
|
|
41
|
+
const e = k(this, L, D).call(this, s);
|
|
42
|
+
t(this, a).set(e.x, { equalize: !0 }), t(this, l).set(e.y, { equalize: !0 }), t(this, b).set(1);
|
|
40
43
|
});
|
|
41
|
-
|
|
44
|
+
r(this, w, (s) => {
|
|
42
45
|
t(this, b).set(0);
|
|
43
46
|
});
|
|
44
|
-
|
|
45
|
-
const e =
|
|
46
|
-
|
|
47
|
-
height: t(this, f)
|
|
48
|
-
}, h = {
|
|
49
|
-
x: e.x,
|
|
50
|
-
y: e.y
|
|
51
|
-
};
|
|
52
|
-
if (t(this, p)) {
|
|
53
|
-
const x = I(h, c);
|
|
54
|
-
h.x = x.x, h.y = x.y;
|
|
55
|
-
}
|
|
56
|
-
if (t(this, u)) {
|
|
57
|
-
const x = J(h, c);
|
|
58
|
-
t(this, p) ? (h.x = T(x.x * 2, -1, 1), h.y = T(x.y * 2, -1, 1)) : (h.x = x.x, h.y = x.y);
|
|
59
|
-
}
|
|
60
|
-
t(this, a).set(h.x), t(this, l).set(h.y);
|
|
47
|
+
r(this, E, (s) => {
|
|
48
|
+
const e = k(this, L, D).call(this, s);
|
|
49
|
+
t(this, a).set(e.x), t(this, l).set(e.y);
|
|
61
50
|
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
let s = 0, e = 0,
|
|
65
|
-
t(this,
|
|
51
|
+
r(this, y, () => {
|
|
52
|
+
c(this, d, this.element.clientWidth), c(this, f, this.element.clientHeight);
|
|
53
|
+
let s = 0, e = 0, m = 0, h = 0;
|
|
54
|
+
t(this, u) ? t(this, p) ? (s = -1, e = 1, m = -1, h = 1) : (s = t(this, d) / 2 * -1, e = t(this, d) / 2 * 1, m = t(this, f) / 2 * -1, h = t(this, f) / 2 * 1) : t(this, p) ? (s = 0, e = 1, m = 0, h = 1) : (s = 0, e = t(this, d), m = 0, h = t(this, f)), t(this, a).min = s, t(this, a).max = e, t(this, l).min = m, t(this, l).max = h;
|
|
66
55
|
});
|
|
67
|
-
|
|
56
|
+
c(this, o, U(s.element)), c(this, a, new B(0, s.damped)), c(this, l, new B(0, s.damped)), c(this, b, new B(0, j({ min: 0, max: 1 }, s.damped))), c(this, u, s.cartesian || !1), c(this, p, s.normalize || !1);
|
|
68
57
|
}
|
|
69
58
|
get element() {
|
|
70
59
|
return t(this, o);
|
|
@@ -79,19 +68,19 @@ class O {
|
|
|
79
68
|
return t(this, b);
|
|
80
69
|
}
|
|
81
70
|
get cartesian() {
|
|
82
|
-
return t(this,
|
|
71
|
+
return t(this, u);
|
|
83
72
|
}
|
|
84
73
|
set cartesian(s) {
|
|
85
|
-
|
|
74
|
+
c(this, u, s), t(this, y).call(this);
|
|
86
75
|
}
|
|
87
76
|
get normalize() {
|
|
88
|
-
return t(this,
|
|
77
|
+
return t(this, p);
|
|
89
78
|
}
|
|
90
79
|
set normalize(s) {
|
|
91
|
-
|
|
80
|
+
c(this, p, s), t(this, y).call(this);
|
|
92
81
|
}
|
|
93
82
|
connect() {
|
|
94
|
-
t(this, o).addEventListener("pointerenter", t(this, S)), t(this, o).addEventListener("pointerleave", t(this, w)), t(this, o).addEventListener("pointermove", t(this, E)),
|
|
83
|
+
t(this, o).addEventListener("pointerenter", t(this, S)), t(this, o).addEventListener("pointerleave", t(this, w)), t(this, o).addEventListener("pointermove", t(this, E)), F.subscribe(t(this, o), t(this, y)), G.subscribe(t(this, y));
|
|
95
84
|
}
|
|
96
85
|
disconnect() {
|
|
97
86
|
t(this, o).removeEventListener(
|
|
@@ -100,53 +89,70 @@ class O {
|
|
|
100
89
|
), t(this, o).removeEventListener(
|
|
101
90
|
"pointerleave",
|
|
102
91
|
t(this, w)
|
|
103
|
-
), t(this, o).removeEventListener("pointermove", t(this, E)),
|
|
92
|
+
), t(this, o).removeEventListener("pointermove", t(this, E)), F.unsubscribe(t(this, y)), G.unsubscribe(t(this, y)), t(this, a).reset(), t(this, l).reset(), t(this, b).reset();
|
|
104
93
|
}
|
|
105
94
|
}
|
|
106
|
-
o = new WeakMap(), a = new WeakMap(), l = new WeakMap(), b = new WeakMap(),
|
|
107
|
-
|
|
108
|
-
|
|
95
|
+
o = new WeakMap(), a = new WeakMap(), l = new WeakMap(), b = new WeakMap(), u = new WeakMap(), p = new WeakMap(), d = new WeakMap(), f = new WeakMap(), H = new WeakMap(), S = new WeakMap(), w = new WeakMap(), E = new WeakMap(), y = new WeakMap(), L = new WeakSet(), D = function(s) {
|
|
96
|
+
const e = N(s, t(this, o).getBoundingClientRect()), m = {
|
|
97
|
+
width: t(this, d),
|
|
98
|
+
height: t(this, f)
|
|
99
|
+
}, h = {
|
|
100
|
+
x: e.x,
|
|
101
|
+
y: e.y
|
|
102
|
+
};
|
|
103
|
+
if (t(this, u)) {
|
|
104
|
+
const x = O(h, m);
|
|
105
|
+
h.x = x.x, h.y = x.y;
|
|
106
|
+
}
|
|
107
|
+
if (t(this, p)) {
|
|
108
|
+
const x = Q(h, m);
|
|
109
|
+
t(this, u) ? (h.x = A(x.x * 2, -1, 1), h.y = A(x.y * 2, -1, 1)) : (h.x = x.x, h.y = x.y);
|
|
110
|
+
}
|
|
111
|
+
return h;
|
|
112
|
+
};
|
|
113
|
+
var n, g, v, z, C, q;
|
|
114
|
+
class Y extends HTMLElement {
|
|
109
115
|
constructor() {
|
|
110
116
|
super();
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
r(this, n);
|
|
118
|
+
r(this, g, new P(this, "--damping", 20));
|
|
119
|
+
r(this, v, new P(this, "--mass", 0));
|
|
120
|
+
r(this, z, new P(this, "--stiffness", 0));
|
|
121
|
+
r(this, C, new P(this, "--cartesian", !1));
|
|
122
|
+
r(this, q, new P(this, "--normalize", !1));
|
|
123
|
+
c(this, n, new X({
|
|
118
124
|
element: this
|
|
119
125
|
})), t(this, g).subscribe((e) => {
|
|
120
|
-
t(this,
|
|
121
|
-
}), t(this, L).subscribe((e) => {
|
|
122
|
-
t(this, r).cartesian = e.current;
|
|
126
|
+
t(this, n).x.damping = e.current, t(this, n).y.damping = e.current, t(this, n).z.damping = e.current;
|
|
123
127
|
}), t(this, C).subscribe((e) => {
|
|
124
|
-
t(this,
|
|
128
|
+
t(this, n).cartesian = e.current;
|
|
129
|
+
}), t(this, q).subscribe((e) => {
|
|
130
|
+
t(this, n).normalize = e.current;
|
|
125
131
|
}), t(this, v).subscribe((e) => {
|
|
126
|
-
t(this,
|
|
132
|
+
t(this, n).x.mass = e.current, t(this, n).y.mass = e.current, t(this, n).z.mass = e.current;
|
|
127
133
|
}), t(this, z).subscribe((e) => {
|
|
128
|
-
t(this,
|
|
129
|
-
}), t(this,
|
|
134
|
+
t(this, n).x.stiffness = e.current, t(this, n).y.stiffness = e.current, t(this, n).z.stiffness = e.current;
|
|
135
|
+
}), t(this, n).x.subscribe((e) => {
|
|
130
136
|
this.style.setProperty("--x", e.current.toString());
|
|
131
|
-
}), t(this,
|
|
137
|
+
}), t(this, n).y.subscribe((e) => {
|
|
132
138
|
this.style.setProperty("--y", e.current.toString());
|
|
133
|
-
}), t(this,
|
|
139
|
+
}), t(this, n).z.subscribe((e) => {
|
|
134
140
|
this.style.setProperty("--z", e.current.toString());
|
|
135
141
|
});
|
|
136
142
|
}
|
|
137
143
|
get pointer() {
|
|
138
|
-
return t(this,
|
|
144
|
+
return t(this, n);
|
|
139
145
|
}
|
|
140
146
|
connectedCallback() {
|
|
141
|
-
t(this,
|
|
147
|
+
t(this, n).connect(), t(this, g).observe(), t(this, v).observe(), t(this, z).observe();
|
|
142
148
|
}
|
|
143
149
|
disconnectedCallback() {
|
|
144
|
-
t(this,
|
|
150
|
+
t(this, n).disconnect(), t(this, g).unobserve(), t(this, v).unobserve(), t(this, z).unobserve(), this.style.removeProperty("--x"), this.style.removeProperty("--y"), this.style.removeProperty("--z");
|
|
145
151
|
}
|
|
146
152
|
}
|
|
147
|
-
|
|
148
|
-
|
|
153
|
+
n = new WeakMap(), g = new WeakMap(), v = new WeakMap(), z = new WeakMap(), C = new WeakMap(), q = new WeakMap();
|
|
154
|
+
V && !customElements.get("e-pointer") && customElements.define("e-pointer", Y);
|
|
149
155
|
export {
|
|
150
|
-
|
|
151
|
-
|
|
156
|
+
X as Pointer,
|
|
157
|
+
Y as PointerElement
|
|
152
158
|
};
|
package/lib/popover/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Z=c=>{throw TypeError(c)};var J=(c,r,t)=>r.has(c)||Z("Cannot "+t);var e=(c,r,t)=>(J(c,r,"read from private field"),t?t.call(c):r.get(c)),i=(c,r,t)=>r.has(c)?Z("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(c):r.set(c,t),n=(c,r,t,s)=>(J(c,r,"write to private field"),s?s.call(c,t):r.set(c,t),t),m=(c,r,t)=>(J(c,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("../
|
|
1
|
+
"use strict";var Z=c=>{throw TypeError(c)};var J=(c,r,t)=>r.has(c)||Z("Cannot "+t);var e=(c,r,t)=>(J(c,r,"read from private field"),t?t.call(c):r.get(c)),i=(c,r,t)=>r.has(c)?Z("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(c):r.set(c,t),n=(c,r,t,s)=>(J(c,r,"write to private field"),s?s.call(c,t):r.set(c,t),t),m=(c,r,t)=>(J(c,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const se=require("../element-linked-store/index.cjs"),b=require("../css-property/index.cjs"),X=require("../index-Cqw2NKev.cjs"),U=require("../events-KVanG9sR.cjs"),ie=require("../function-MthRj-GJ.cjs"),re=require("../style-At6aDoqG.cjs"),I=require("../url-D1CgmwZ_.cjs"),N=require("../window-resizer/index.cjs");var a,f,D,F;class oe{constructor(){i(this,a,new Map);i(this,f,[]);i(this,D,r=>{var s;const t=[...e(this,f)].reverse().find(o=>o.clickOutside.current);if(t){const o=r.composedPath();if(o.find(Y=>Y instanceof HTMLElement&&Y.hasAttribute("data-popover-content")))return;const l=o[0],q=l instanceof Node&&(t.contains(l)||((s=t.shadowRoot)==null?void 0:s.contains(l))),te=l instanceof HTMLElement&&l.hasAttribute("data-outside");(!q||te)&&t.close()}});i(this,F,r=>{if(r.code==="Escape"){const t=[...e(this,f)].reverse().find(s=>s.escape.current);t&&t.close()}});addEventListener("click",e(this,D)),addEventListener("keydown",e(this,F))}get groups(){return e(this,a)}get stack(){return e(this,f)}add(r,t){if(t.closeRest.current)e(this,a).forEach(o=>{o.forEach(l=>{l.close()})});else if(t.closeRestInGroup.current){let o=e(this,a).get(r);o==null||o.forEach(l=>{l.close()})}let s=e(this,a).get(r);s!=null&&s.length||(s=[],e(this,a).set(r,s)),e(this,f).push(t),s.push(t)}remove(r,t){if(n(this,f,e(this,f).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,a).forEach(o=>{o.forEach(l=>s.push(l))}),e(this,a).clear(),s.forEach(o=>o.close())}else if(t.closeRestInGroup.current){const s=e(this,a).get(r);e(this,a).delete(r),s==null||s.forEach(o=>{o.close()})}else{let s=e(this,a).get(r);s&&(s=s.filter(o=>o!==t),e(this,a).set(r,s))}}}a=new WeakMap,f=new WeakMap,D=new WeakMap,F=new WeakMap;var p,$,T,d,y,P,k,g,C,A,L,R,u,S,_,j,x,M,H,O;const E=class E extends HTMLElement{constructor(){super();i(this,S);i(this,p);i(this,$);i(this,T);i(this,d);i(this,y);i(this,P);i(this,k);i(this,g);i(this,C);i(this,A);i(this,L);i(this,R);i(this,u);i(this,x);i(this,M);i(this,H);i(this,O);this.urlValue="",n(this,p,!1),n(this,d,new b.CSSProperty(this,"--history",!1)),n(this,y,new b.CSSProperty(this,"--restore",!1)),n(this,P,new b.CSSProperty(this,"--close-rest",!1)),n(this,k,new b.CSSProperty(this,"--close-rest-in-group",!1)),n(this,g,new b.CSSProperty(this,"--group","")),n(this,C,new b.CSSProperty(this,"--click-outside",!1)),n(this,A,new b.CSSProperty(this,"--escape",!1)),n(this,L,!1),n(this,u,new se.ElementLinkedStore(this,{opened:!1,closing:!1,triggered:!1})),n(this,x,()=>{n(this,L,!1),e(this,p)&&e(this,d).current&&!location.search.includes(this.id)?this.close():!e(this,p)&&e(this,d).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),n(this,L,!0)}),n(this,M,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),e(this,H).call(this)}),n(this,H,ie.debounce(()=>{e(this,O).call(this)},10)),n(this,O,()=>{this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px")}),e(this,g).subscribe(t=>{t.previous&&(E.stack.remove(t.previous,this),t.current||(document.documentElement.classList.remove(`${this.group.previous}-closing`),document.documentElement.classList.remove(`${this.group.previous}-opened`)))}),e(this,u).subscribe(t=>{if(this.group.current){document.documentElement.classList.toggle(`${this.group.current}-closing`,t.current.closing);const s=E.stack.groups.get(this.group.current),o=s==null?void 0:s.find(l=>l.opened);document.documentElement.classList.toggle(`${this.group.current}-opened`,!!o)}})}get history(){return e(this,d)}get restore(){return e(this,y)}get closeRest(){return e(this,P)}get closeRestInGroup(){return e(this,k)}get group(){return e(this,g)}get clickOutside(){return e(this,C)}get escape(){return e(this,A)}get opened(){return e(this,p)}get lastTrigger(){return e(this,R)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,p)&&I.updateSearchParameter(this.id,t)}open(t){if(e(this,p))return;n(this,R,t==null?void 0:t.trigger),clearTimeout(e(this,$)),e(this,u).set("closing",!1),e(this,u).set("triggered",!0),U.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,R)}}),e(this,d).current&&e(this,L)&&history.pushState(history.state,"",e(this,S,_)),n(this,p,!0);const s=()=>{E.stack.add(e(this,g).current,this),e(this,O).call(this),e(this,u).set("opened",!0),U.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,R)}}),n(this,T,void 0)};t!=null&&t.skipTransition?s():n(this,T,setTimeout(s,10))}close(){e(this,p)&&(clearTimeout(e(this,T)),E.stack.remove(e(this,g).current,this),n(this,p,!1),m(this,S,j).call(this),e(this,u).set("opened",!1),e(this,u).set("closing",!0),U.dispatchEvent(this,"popoverClosing",{custom:!0}),n(this,$,setTimeout(()=>{e(this,u).set("triggered",!1),e(this,u).set("closing",!1),U.dispatchEvent(this,"popoverClosed",{custom:!0})},re.getElementTransitionDurationMS(this)+10)))}connectedCallback(){e(this,d).observe(),e(this,y).observe(),e(this,P).observe(),e(this,k).observe(),e(this,g).observe(),e(this,C).observe(),e(this,A).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,x)),setTimeout(()=>{e(this,y).current?(this.urlValue=I.parseSearchParameters(location.search)[this.id],e(this,x).call(this)):(m(this,S,j).call(this),n(this,L,!0))},0),N.windowResizer.subscribe(e(this,M))}disconnectedCallback(){E.stack.remove(e(this,g).current,this),N.windowResizer.unsubscribe(e(this,M)),e(this,u).close(),e(this,d).close(),e(this,y).close(),e(this,P).close(),e(this,k).close(),e(this,g).close(),e(this,C).close(),e(this,A).close(),this.removeAttribute("role"),clearTimeout(e(this,$)),clearTimeout(e(this,T)),removeEventListener("popstate",e(this,x)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),m(this,S,j).call(this)}};p=new WeakMap,$=new WeakMap,T=new WeakMap,d=new WeakMap,y=new WeakMap,P=new WeakMap,k=new WeakMap,g=new WeakMap,C=new WeakMap,A=new WeakMap,L=new WeakMap,R=new WeakMap,u=new WeakMap,S=new WeakSet,_=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},j=function(){if(e(this,d).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},x=new WeakMap,M=new WeakMap,H=new WeakMap,O=new WeakMap,E.stack=new oe;let V=E;X.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",V);var h,v,w,K,z,W,B,G,Q;class ee extends HTMLElement{constructor(){super();i(this,w);i(this,h);i(this,v,new b.CSSProperty(this,"--type","open"));i(this,z,()=>{this.classList.add("triggered")});i(this,W,()=>{this.classList.add("opened"),this.setAttribute("aria-expanded","true")});i(this,B,()=>{this.classList.remove("opened")});i(this,G,()=>{this.classList.remove("triggered"),this.setAttribute("aria-expanded","false")});X.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,v).current;t==="open"||t==="toggle"&&!e(this,h).opened?e(this,h).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,h).opened)&&e(this,h).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&t.currentTarget.click()}))}get type(){return e(this,v)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(m(this,w,K).call(this),t){let o=null;if(t==="parent"){const l=this.closest("[popover-target]");if(l)o=l;else{const q=this.getRootNode();q instanceof ShadowRoot?o=q.host.closest("[popover-target]"):q instanceof HTMLElement&&(o=q.closest("[popover-target]"))}}else t==="sibling"?o=(s=this.parentElement)==null?void 0:s.querySelector("[popover-target]"):(!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),o=document.querySelector(t)||this.getRootNode().querySelector(t));o instanceof HTMLElement?(n(this,h,o),e(this,h).addEventListener("popoverTriggered",e(this,z)),e(this,h).addEventListener("popoverOpened",e(this,W)),e(this,h).addEventListener("popoverClosing",e(this,B)),e(this,h).addEventListener("popoverClosed",e(this,G))):console.warn(this,`target ${t} not found`)}m(this,w,Q).call(this,e(this,v).current)}connectedCallback(){e(this,v).subscribe(s=>{m(this,w,Q).call(this,s.current)}),this.hasAttribute("tabindex")||(this.tabIndex=0);const t=this.getAttribute("target");t&&this.changePopover(t),this.isConnected&&e(this,v).observe()}disconnectedCallback(){e(this,v).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),m(this,w,K).call(this)}}h=new WeakMap,v=new WeakMap,w=new WeakSet,K=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,z)),e(this,h).removeEventListener("popoverOpened",e(this,W)),e(this,h).removeEventListener("popoverClosing",e(this,B)),e(this,h).removeEventListener("popoverClosed",e(this,G)))},z=new WeakMap,W=new WeakMap,B=new WeakMap,G=new WeakMap,Q=function(t){e(this,h)instanceof V&&(t!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,h).opened?"true":"false"),this.setAttribute("aria-controls",e(this,h).id||"")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))};X.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ee);exports.PopoverButtonElement=ee;exports.PopoverElement=V;
|
package/lib/popover/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var Z = (c) => {
|
|
|
3
3
|
};
|
|
4
4
|
var J = (c, r, t) => r.has(c) || Z("Cannot " + t);
|
|
5
5
|
var e = (c, r, t) => (J(c, r, "read from private field"), t ? t.call(c) : r.get(c)), i = (c, r, t) => r.has(c) ? Z("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(c) : r.set(c, t), h = (c, r, t, s) => (J(c, r, "write to private field"), s ? s.call(c, t) : r.set(c, t), t), m = (c, r, t) => (J(c, r, "access private method"), t);
|
|
6
|
-
import {
|
|
6
|
+
import { ElementLinkedStore as ee } from "../element-linked-store/index.js";
|
|
7
7
|
import { CSSProperty as b } from "../css-property/index.js";
|
|
8
8
|
import { i as X } from "../index-euf5anj6.js";
|
|
9
9
|
import { d as B } from "../events-CsVF98U6.js";
|
|
@@ -77,7 +77,7 @@ class oe {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
l = new WeakMap(), g = new WeakMap(), j = new WeakMap(), F = new WeakMap();
|
|
80
|
-
var p, V, w, d, L, A, P, f, S,
|
|
80
|
+
var p, V, w, d, L, A, P, f, S, R, y, C, u, T, N, U, x, M, H, O;
|
|
81
81
|
const E = class E extends HTMLElement {
|
|
82
82
|
constructor() {
|
|
83
83
|
super();
|
|
@@ -91,9 +91,9 @@ const E = class E extends HTMLElement {
|
|
|
91
91
|
i(this, P);
|
|
92
92
|
i(this, f);
|
|
93
93
|
i(this, S);
|
|
94
|
-
i(this, C);
|
|
95
|
-
i(this, y);
|
|
96
94
|
i(this, R);
|
|
95
|
+
i(this, y);
|
|
96
|
+
i(this, C);
|
|
97
97
|
i(this, u);
|
|
98
98
|
i(this, x);
|
|
99
99
|
i(this, M);
|
|
@@ -103,7 +103,7 @@ const E = class E extends HTMLElement {
|
|
|
103
103
|
this,
|
|
104
104
|
"--close-rest-in-group",
|
|
105
105
|
!1
|
|
106
|
-
)), h(this, f, new b(this, "--group", "")), h(this, S, new b(this, "--click-outside", !1)), h(this,
|
|
106
|
+
)), h(this, f, new b(this, "--group", "")), h(this, S, new b(this, "--click-outside", !1)), h(this, R, new b(this, "--escape", !1)), h(this, y, !1), h(this, u, new ee(this, {
|
|
107
107
|
opened: !1,
|
|
108
108
|
closing: !1,
|
|
109
109
|
triggered: !1
|
|
@@ -154,13 +154,13 @@ const E = class E extends HTMLElement {
|
|
|
154
154
|
return e(this, S);
|
|
155
155
|
}
|
|
156
156
|
get escape() {
|
|
157
|
-
return e(this,
|
|
157
|
+
return e(this, R);
|
|
158
158
|
}
|
|
159
159
|
get opened() {
|
|
160
160
|
return e(this, p);
|
|
161
161
|
}
|
|
162
162
|
get lastTrigger() {
|
|
163
|
-
return e(this,
|
|
163
|
+
return e(this, C);
|
|
164
164
|
}
|
|
165
165
|
get idWithValue() {
|
|
166
166
|
return `${this.id}${this.urlValue ? "=" + this.urlValue : ""}`;
|
|
@@ -171,17 +171,17 @@ const E = class E extends HTMLElement {
|
|
|
171
171
|
open(t) {
|
|
172
172
|
if (e(this, p))
|
|
173
173
|
return;
|
|
174
|
-
h(this,
|
|
174
|
+
h(this, C, t == null ? void 0 : t.trigger), clearTimeout(e(this, V)), e(this, u).set("closing", !1), e(this, u).set("triggered", !0), B(this, "popoverTriggered", {
|
|
175
175
|
custom: !0,
|
|
176
176
|
detail: {
|
|
177
|
-
trigger: e(this,
|
|
177
|
+
trigger: e(this, C)
|
|
178
178
|
}
|
|
179
179
|
}), e(this, d).current && e(this, y) && history.pushState(history.state, "", e(this, T, N)), h(this, p, !0);
|
|
180
180
|
const s = () => {
|
|
181
181
|
E.stack.add(e(this, f).current, this), e(this, O).call(this), e(this, u).set("opened", !0), B(this, "popoverOpened", {
|
|
182
182
|
custom: !0,
|
|
183
183
|
detail: {
|
|
184
|
-
trigger: e(this,
|
|
184
|
+
trigger: e(this, C)
|
|
185
185
|
}
|
|
186
186
|
}), h(this, w, void 0);
|
|
187
187
|
};
|
|
@@ -197,15 +197,15 @@ const E = class E extends HTMLElement {
|
|
|
197
197
|
}, se(this) + 10)));
|
|
198
198
|
}
|
|
199
199
|
connectedCallback() {
|
|
200
|
-
e(this, d).observe(), e(this, L).observe(), e(this, A).observe(), e(this, P).observe(), e(this, f).observe(), e(this, S).observe(), e(this,
|
|
200
|
+
e(this, d).observe(), e(this, L).observe(), e(this, A).observe(), e(this, P).observe(), e(this, f).observe(), e(this, S).observe(), e(this, R).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", e(this, x)), setTimeout(() => {
|
|
201
201
|
e(this, L).current ? (this.urlValue = re(location.search)[this.id], e(this, x).call(this)) : (m(this, T, U).call(this), h(this, y, !0));
|
|
202
202
|
}, 0), I.subscribe(e(this, M));
|
|
203
203
|
}
|
|
204
204
|
disconnectedCallback() {
|
|
205
|
-
E.stack.remove(e(this, f).current, this), I.unsubscribe(e(this, M)), e(this, u).close(), e(this, d).close(), e(this, L).close(), e(this, A).close(), e(this, P).close(), e(this, f).close(), e(this, S).close(), e(this,
|
|
205
|
+
E.stack.remove(e(this, f).current, this), I.unsubscribe(e(this, M)), e(this, u).close(), e(this, d).close(), e(this, L).close(), e(this, A).close(), e(this, P).close(), e(this, f).close(), e(this, S).close(), e(this, R).close(), this.removeAttribute("role"), clearTimeout(e(this, V)), clearTimeout(e(this, w)), removeEventListener("popstate", e(this, x)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), m(this, T, U).call(this);
|
|
206
206
|
}
|
|
207
207
|
};
|
|
208
|
-
p = new WeakMap(), V = new WeakMap(), w = new WeakMap(), d = new WeakMap(), L = new WeakMap(), A = new WeakMap(), P = new WeakMap(), f = new WeakMap(), S = new WeakMap(),
|
|
208
|
+
p = new WeakMap(), V = new WeakMap(), w = new WeakMap(), d = new WeakMap(), L = new WeakMap(), A = new WeakMap(), P = new WeakMap(), f = new WeakMap(), S = new WeakMap(), R = new WeakMap(), y = new WeakMap(), C = new WeakMap(), u = new WeakMap(), T = new WeakSet(), N = function() {
|
|
209
209
|
return `${location.pathname}${location.search ? location.search + "&" : "?"}${this.idWithValue}`;
|
|
210
210
|
}, U = function() {
|
|
211
211
|
if (e(this, d).current) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SourceManager } from '.';
|
|
2
|
-
import {
|
|
2
|
+
import { ElementLinkedStore } from '../element-linked-store';
|
|
3
3
|
import { SourceSetOptions } from './SourceSet';
|
|
4
4
|
export interface SourceEvents {
|
|
5
5
|
sourceCapture: CustomEvent;
|
|
@@ -15,7 +15,7 @@ export declare abstract class SourceElement<T extends HTMLElement> extends HTMLE
|
|
|
15
15
|
constructor(options?: SourceElementOptions);
|
|
16
16
|
get consumerElement(): T;
|
|
17
17
|
get sourceManager(): SourceManager;
|
|
18
|
-
get status():
|
|
18
|
+
get status(): ElementLinkedStore<{
|
|
19
19
|
loading: false;
|
|
20
20
|
loaded: false;
|
|
21
21
|
error: false;
|
package/lib/source/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var Z=h=>{throw TypeError(h)};var G=(h,r,e)=>r.has(h)||Z("Cannot "+e);var t=(h,r,e)=>(G(h,r,"read from private field"),e?e.call(h):r.get(h)),i=(h,r,e)=>r.has(h)?Z("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(h):r.set(h,e),s=(h,r,e,o)=>(G(h,r,"write to private field"),o?o.call(h,e):r.set(h,e),e),P=(h,r,e)=>(G(h,r,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("../
|
|
1
|
+
"use strict";var Z=h=>{throw TypeError(h)};var G=(h,r,e)=>r.has(h)||Z("Cannot "+e);var t=(h,r,e)=>(G(h,r,"read from private field"),e?e.call(h):r.get(h)),i=(h,r,e)=>r.has(h)?Z("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(h):r.set(h,e),s=(h,r,e,o)=>(G(h,r,"write to private field"),o?o.call(h,e):r.set(h,e),e),P=(h,r,e)=>(G(h,r,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("../element-linked-store/index.cjs"),tt=require("../index-Cqw2NKev.cjs"),U=require("../events-KVanG9sR.cjs"),et=require("../string-DUXXtU8v.cjs"),K=require("../loading/index.cjs"),st=require("../order/index.cjs"),J=require("../window-resizer/index.cjs"),it=require("../Store-GokLe_g-.cjs");var $,q,O,S,u,f,M;class Q{constructor(r){i(this,$);i(this,q);i(this,O);i(this,S);i(this,u);i(this,f);i(this,M);s(this,$,r);let e=r.split(".");const o=/\b\d{1,2}x\b/g,d=e.find(p=>p.match(o)&&parseInt(p));s(this,O,d?parseInt(d):1),d&&(e=e.slice(0,-1)),s(this,q,e.length>1?e.slice(0,-1).join("."):e.join("."));const l=/\d+max/g,x=/\d+min/g,B=/\d+mar/g,_=/\d+mir/g,H=e.find(p=>p.match(l)),n=e.find(p=>p.match(x)),b=e.find(p=>p.match(B)),W=e.find(p=>p.match(_));b?(s(this,u,parseInt(b)),s(this,f,"max"),s(this,S,`(max-aspect-ratio: ${t(this,u)})`)):W?(s(this,u,parseInt(W)),s(this,f,"max"),s(this,S,`(min-aspect-ratio: ${t(this,u)})`)):H?(s(this,u,parseInt(H)),s(this,f,"max"),s(this,S,`(max-width: ${t(this,u)}px)`)):n?(s(this,u,parseInt(n)),s(this,S,`(min-width: ${t(this,u)}px)`),s(this,f,"min")):(s(this,u,0),s(this,S,`(min-width: ${t(this,u)}px)`),s(this,f,"min")),s(this,q,t(this,q).replace(`.${t(this,u)}${t(this,f)}`,"")),s(this,M,e[e.length-1]===t(this,q)?"":"."+e[e.length-1]),s(this,M,t(this,M).replace(`.${t(this,u)}${t(this,f)}`,""))}get url(){return t(this,$)}get name(){return t(this,q)}get density(){return t(this,O)}get query(){return t(this,S)}get extension(){return t(this,M)}get queryType(){return t(this,f)}get queryValue(){return t(this,u)}}$=new WeakMap,q=new WeakMap,O=new WeakMap,S=new WeakMap,u=new WeakMap,f=new WeakMap,M=new WeakMap;let rt=0;var m,a,y,E,g,z,R,c,v,A,w,C,I,j,D,V,F;class nt extends HTMLElement{constructor(e){super();i(this,I);i(this,m,null);i(this,a,null);i(this,y,!1);i(this,E,!1);i(this,g,!1);i(this,z,"");i(this,R,"");i(this,c,new Y.ElementLinkedStore(this,{loading:!1,loaded:!1,error:!1,clear:!1}));i(this,v,null);i(this,A);i(this,w,null);i(this,C);i(this,D,e=>{const o=e[0];t(this,g)&&(!t(this,E)||this.hasAttribute("reload-source"))&&o.isIntersecting&&this.triggerLazyLoad(),o.isIntersecting?U.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&(P(this,I,j).call(this,void 0),s(this,E,!1)),U.dispatchEvent(this,"sourceRelease",{custom:!0}))});i(this,V,()=>{t(this,c).set("loaded",!0),t(this,c).set("error",!1),t(this,c).set("loading",!1),!t(this,g)&&!t(this,y)&&K.loading.complete(t(this,R)),U.dispatchEvent(this,"sourceLoaded",{custom:!0});const e=getComputedStyle(this).getPropertyValue("--clear-duration");e?s(this,A,setTimeout(()=>{t(this,c).set("clear",!0)},parseFloat(e)*1e3)):t(this,c).set("clear",!0),s(this,y,!0)});i(this,F,e=>{t(this,c).set("loaded",!1),t(this,c).set("error",!0),t(this,c).set("loading",!1),!t(this,g)&&!t(this,y)&&K.loading.error(t(this,R)),U.dispatchEvent(this,"sourceError",{custom:!0}),s(this,y,!0)});s(this,C,e==null?void 0:e.sourceSetOptions),tt.isBrowser&&window.IntersectionObserver&&s(this,v,new IntersectionObserver(t(this,D)))}get consumerElement(){return t(this,a)}get sourceManager(){return t(this,m)}get status(){return t(this,c)}get isLazy(){return t(this,g)}get currentURL(){return t(this,w)}get isFirstLoadHappened(){return t(this,y)}triggerLazyLoad(){!t(this,E)&&t(this,m).current&&t(this,m).current!==t(this,m).previous&&(s(this,E,!0),P(this,I,j).call(this,t(this,m).current))}connectedCallback(){s(this,z,`source-consumer-${++rt}`);const e=this.getAttribute("srcset")||"",o=this.hasAttribute("notify")?this.closest(this.getAttribute("notify")):null;o&&t(this,c).addElement(o),s(this,a,this.createConsumer()),t(this,a).style.cssText=`
|
|
2
2
|
display: block;
|
|
3
3
|
width: 100%;
|
|
4
4
|
height: 100%;
|
|
5
|
-
`,t(this,a).classList.add("source-consumer"),Array.from(this.attributes).forEach(d=>{if(d.name!=="srcset"){const l=d.nodeValue||"",x=et.kebabToCamel(d.name);x in t(this,a)&&(t(this,a)[x]=l||!0)}}),this.appendChild(t(this,a)),s(this,m,new X({srcset:e,sourceSetOptions:t(this,C)})),s(this,g,this.hasAttribute("lazy")),t(this,m).subscribe(d=>{(!t(this,g)||t(this,g)&&t(this,
|
|
5
|
+
`,t(this,a).classList.add("source-consumer"),Array.from(this.attributes).forEach(d=>{if(d.name!=="srcset"){const l=d.nodeValue||"",x=et.kebabToCamel(d.name);x in t(this,a)&&(t(this,a)[x]=l||!0)}}),this.appendChild(t(this,a)),s(this,m,new X({srcset:e,sourceSetOptions:t(this,C)})),s(this,g,this.hasAttribute("lazy")),t(this,m).subscribe(d=>{(!t(this,g)||t(this,g)&&t(this,E))&&P(this,I,j).call(this,d.current)}),t(this,m).connect(),t(this,v).observe(this)}disconnectedCallback(){var e;clearTimeout(t(this,A)),t(this,v).disconnect(),(e=t(this,m))==null||e.close(),t(this,a)&&(t(this,a).onloadeddata=null,t(this,a).onload=null,t(this,a).onerror=null,t(this,a).remove()),s(this,y,!1),s(this,E,!1),t(this,c).reset()}}m=new WeakMap,a=new WeakMap,y=new WeakMap,E=new WeakMap,g=new WeakMap,z=new WeakMap,R=new WeakMap,c=new WeakMap,v=new WeakMap,A=new WeakMap,w=new WeakMap,C=new WeakMap,I=new WeakSet,j=function(e){if(clearTimeout(t(this,A)),t(this,a).onloadeddata=null,t(this,a).onload=null,t(this,a).onerror=null,t(this,c).set("loaded",!1),t(this,c).set("error",!1),t(this,c).set("loading",!1),t(this,c).set("clear",!1),e){s(this,R,`${t(this,z)}-${e.url}`);const o=this.hasAttribute("keep-source-parameters");t(this,c).set("loading",!0),s(this,w,o?e.url:e.name+e.extension),this.consumeSource(t(this,w)),!t(this,g)&&!t(this,y)&&K.loading.add(t(this,R)),t(this,a).onloadeddata=()=>{t(this,V).call(this)},t(this,a).onload=()=>{t(this,V).call(this)},t(this,a).onerror=()=>{t(this,F).call(this,t(this,w))}}else s(this,w,null),this.consumeSource(null)},D=new WeakMap,V=new WeakMap,F=new WeakMap;var L;class N{constructor(r,e){i(this,L);s(this,L,new Map);const o=(e==null?void 0:e.mediaBuckets)!==!1,d=typeof r=="string"?o?r.trim().split(",").map(n=>n.trim()).filter(n=>!!n):[r]:r,l=[];d.forEach(n=>{const b=new Q(n);l.push([b.query,b])});const x=l.filter(n=>n[1].queryType.includes("max")).sort((n,b)=>b[1].queryValue-n[1].queryValue),B=l.filter(n=>n[1].queryType.includes("min")&&n[1].queryValue!==0).sort((n,b)=>n[1].queryValue-b[1].queryValue),_=l.filter(n=>n[0]==="(min-width: 0px)");(_?[..._,...x,...B]:[...x,...B]).forEach(n=>{t(this,L).has(n[0])||t(this,L).set(n[0],[]),t(this,L).get(n[0]).push(n[1])})}get mediaBuckets(){return t(this,L)}}L=new WeakMap;var T,k;class X extends it.Store{constructor(e){super(void 0);i(this,T);i(this,k,()=>{let e;t(this,T).mediaBuckets.forEach((l,x)=>{matchMedia(x).matches&&(e=l)});let o,d=0;e==null||e.forEach(l=>{l.density>d&&l.density<=Math.max(devicePixelRatio,1)&&(d=l.density,o=l)}),e!=null&&e.length&&!o&&(o=e[0]),this.current=o});s(this,T,new N(e.srcset,e.sourceSetOptions))}updateSource(e){s(this,T,new N(e.srcset,e.sourceSetOptions)),t(this,k).call(this)}close(){super.close(),this.disconnect()}connect(){J.windowResizer.subscribe(t(this,k),st.RESIZE_ORDER.SOURCE_MANAGER),t(this,k).call(this)}disconnect(){J.windowResizer.unsubscribe(t(this,k))}}T=new WeakMap,k=new WeakMap;exports.Source=Q;exports.SourceElement=nt;exports.SourceManager=X;exports.SourceSet=N;
|
package/lib/source/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var W = (n) => {
|
|
|
3
3
|
};
|
|
4
4
|
var G = (n, r, e) => r.has(n) || W("Cannot " + e);
|
|
5
5
|
var t = (n, r, e) => (G(n, r, "read from private field"), e ? e.call(n) : r.get(n)), i = (n, r, e) => r.has(n) ? W("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(n) : r.set(n, e), s = (n, r, e, o) => (G(n, r, "write to private field"), o ? o.call(n, e) : r.set(n, e), e), U = (n, r, e) => (G(n, r, "access private method"), e);
|
|
6
|
-
import {
|
|
6
|
+
import { ElementLinkedStore as Q } from "../element-linked-store/index.js";
|
|
7
7
|
import { i as X } from "../index-euf5anj6.js";
|
|
8
8
|
import { d as D } from "../events-CsVF98U6.js";
|
|
9
9
|
import { k as Y } from "../string-BlMQbe8b.js";
|
|
@@ -11,40 +11,40 @@ import { loading as K } from "../loading/index.js";
|
|
|
11
11
|
import { RESIZE_ORDER as tt } from "../order/index.js";
|
|
12
12
|
import { windowResizer as Z } from "../window-resizer/index.js";
|
|
13
13
|
import { S as et } from "../Store-swP_0ymB.js";
|
|
14
|
-
var
|
|
14
|
+
var O, w, C, E, u, f, k;
|
|
15
15
|
class st {
|
|
16
16
|
constructor(r) {
|
|
17
|
+
i(this, O);
|
|
18
|
+
i(this, w);
|
|
17
19
|
i(this, C);
|
|
18
20
|
i(this, E);
|
|
19
|
-
i(this, O);
|
|
20
|
-
i(this, L);
|
|
21
21
|
i(this, u);
|
|
22
22
|
i(this, f);
|
|
23
23
|
i(this, k);
|
|
24
|
-
s(this,
|
|
24
|
+
s(this, O, r);
|
|
25
25
|
let e = r.split(".");
|
|
26
26
|
const o = /\b\d{1,2}x\b/g, d = e.find((g) => g.match(o) && parseInt(g));
|
|
27
|
-
s(this,
|
|
27
|
+
s(this, C, d ? parseInt(d) : 1), d && (e = e.slice(0, -1)), s(this, w, e.length > 1 ? e.slice(0, -1).join(".") : e.join("."));
|
|
28
28
|
const l = /\d+max/g, x = /\d+min/g, B = /\d+mar/g, P = /\d+mir/g, _ = e.find((g) => g.match(l)), h = e.find((g) => g.match(x)), b = e.find((g) => g.match(B)), N = e.find((g) => g.match(P));
|
|
29
|
-
b ? (s(this, u, parseInt(b)), s(this, f, "max"), s(this,
|
|
29
|
+
b ? (s(this, u, parseInt(b)), s(this, f, "max"), s(this, E, `(max-aspect-ratio: ${t(this, u)})`)) : N ? (s(this, u, parseInt(N)), s(this, f, "max"), s(this, E, `(min-aspect-ratio: ${t(this, u)})`)) : _ ? (s(this, u, parseInt(_)), s(this, f, "max"), s(this, E, `(max-width: ${t(this, u)}px)`)) : h ? (s(this, u, parseInt(h)), s(this, E, `(min-width: ${t(this, u)}px)`), s(this, f, "min")) : (s(this, u, 0), s(this, E, `(min-width: ${t(this, u)}px)`), s(this, f, "min")), s(this, w, t(this, w).replace(
|
|
30
30
|
`.${t(this, u)}${t(this, f)}`,
|
|
31
31
|
""
|
|
32
|
-
)), s(this, k, e[e.length - 1] === t(this,
|
|
32
|
+
)), s(this, k, e[e.length - 1] === t(this, w) ? "" : "." + e[e.length - 1]), s(this, k, t(this, k).replace(
|
|
33
33
|
`.${t(this, u)}${t(this, f)}`,
|
|
34
34
|
""
|
|
35
35
|
));
|
|
36
36
|
}
|
|
37
37
|
get url() {
|
|
38
|
-
return t(this,
|
|
38
|
+
return t(this, O);
|
|
39
39
|
}
|
|
40
40
|
get name() {
|
|
41
|
-
return t(this,
|
|
41
|
+
return t(this, w);
|
|
42
42
|
}
|
|
43
43
|
get density() {
|
|
44
|
-
return t(this,
|
|
44
|
+
return t(this, C);
|
|
45
45
|
}
|
|
46
46
|
get query() {
|
|
47
|
-
return t(this,
|
|
47
|
+
return t(this, E);
|
|
48
48
|
}
|
|
49
49
|
get extension() {
|
|
50
50
|
return t(this, k);
|
|
@@ -56,9 +56,9 @@ class st {
|
|
|
56
56
|
return t(this, u);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
O = new WeakMap(), w = new WeakMap(), C = new WeakMap(), E = new WeakMap(), u = new WeakMap(), f = new WeakMap(), k = new WeakMap();
|
|
60
60
|
let it = 0;
|
|
61
|
-
var m, a, y,
|
|
61
|
+
var m, a, y, L, p, V, A, c, M, R, S, z, $, F, H, v, j;
|
|
62
62
|
class ft extends HTMLElement {
|
|
63
63
|
constructor(e) {
|
|
64
64
|
super();
|
|
@@ -66,7 +66,7 @@ class ft extends HTMLElement {
|
|
|
66
66
|
i(this, m, null);
|
|
67
67
|
i(this, a, null);
|
|
68
68
|
i(this, y, !1);
|
|
69
|
-
i(this,
|
|
69
|
+
i(this, L, !1);
|
|
70
70
|
i(this, p, !1);
|
|
71
71
|
i(this, V, "");
|
|
72
72
|
i(this, A, "");
|
|
@@ -82,7 +82,7 @@ class ft extends HTMLElement {
|
|
|
82
82
|
i(this, z);
|
|
83
83
|
i(this, H, (e) => {
|
|
84
84
|
const o = e[0];
|
|
85
|
-
t(this, p) && (!t(this,
|
|
85
|
+
t(this, p) && (!t(this, L) || this.hasAttribute("reload-source")) && o.isIntersecting && this.triggerLazyLoad(), o.isIntersecting ? D(this, "sourceCapture", { custom: !0 }) : (this.hasAttribute("reload-source") && (U(this, $, F).call(this, void 0), s(this, L, !1)), D(this, "sourceRelease", { custom: !0 }));
|
|
86
86
|
});
|
|
87
87
|
i(this, v, () => {
|
|
88
88
|
t(this, c).set("loaded", !0), t(this, c).set("error", !1), t(this, c).set("loading", !1), !t(this, p) && !t(this, y) && K.complete(t(this, A)), D(this, "sourceLoaded", { custom: !0 });
|
|
@@ -117,7 +117,7 @@ class ft extends HTMLElement {
|
|
|
117
117
|
return t(this, y);
|
|
118
118
|
}
|
|
119
119
|
triggerLazyLoad() {
|
|
120
|
-
!t(this,
|
|
120
|
+
!t(this, L) && t(this, m).current && t(this, m).current !== t(this, m).previous && (s(this, L, !0), U(this, $, F).call(this, t(this, m).current));
|
|
121
121
|
}
|
|
122
122
|
connectedCallback() {
|
|
123
123
|
s(this, V, `source-consumer-${++it}`);
|
|
@@ -135,15 +135,15 @@ class ft extends HTMLElement {
|
|
|
135
135
|
srcset: e,
|
|
136
136
|
sourceSetOptions: t(this, z)
|
|
137
137
|
})), s(this, p, this.hasAttribute("lazy")), t(this, m).subscribe((d) => {
|
|
138
|
-
(!t(this, p) || t(this, p) && t(this,
|
|
138
|
+
(!t(this, p) || t(this, p) && t(this, L)) && U(this, $, F).call(this, d.current);
|
|
139
139
|
}), t(this, m).connect(), t(this, M).observe(this);
|
|
140
140
|
}
|
|
141
141
|
disconnectedCallback() {
|
|
142
142
|
var e;
|
|
143
|
-
clearTimeout(t(this, R)), t(this, M).disconnect(), (e = t(this, m)) == null || e.close(), t(this, a) && (t(this, a).onloadeddata = null, t(this, a).onload = null, t(this, a).onerror = null, t(this, a).remove()), s(this, y, !1), s(this,
|
|
143
|
+
clearTimeout(t(this, R)), t(this, M).disconnect(), (e = t(this, m)) == null || e.close(), t(this, a) && (t(this, a).onloadeddata = null, t(this, a).onload = null, t(this, a).onerror = null, t(this, a).remove()), s(this, y, !1), s(this, L, !1), t(this, c).reset();
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
m = new WeakMap(), a = new WeakMap(), y = new WeakMap(),
|
|
146
|
+
m = new WeakMap(), a = new WeakMap(), y = new WeakMap(), L = new WeakMap(), p = new WeakMap(), V = new WeakMap(), A = new WeakMap(), c = new WeakMap(), M = new WeakMap(), R = new WeakMap(), S = new WeakMap(), z = new WeakMap(), $ = new WeakSet(), F = function(e) {
|
|
147
147
|
if (clearTimeout(t(this, R)), t(this, a).onloadeddata = null, t(this, a).onload = null, t(this, a).onerror = null, t(this, c).set("loaded", !1), t(this, c).set("error", !1), t(this, c).set("loading", !1), t(this, c).set("clear", !1), e) {
|
|
148
148
|
s(this, A, `${t(this, V)}-${e.url}`);
|
|
149
149
|
const o = this.hasAttribute("keep-source-parameters");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aptechka",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/denisavitski/aptechka.git"
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"require": "./lib/canvas/index.cjs",
|
|
44
44
|
"default": "./lib/canvas/index.js"
|
|
45
45
|
},
|
|
46
|
-
"./
|
|
47
|
-
"types": "./lib/
|
|
48
|
-
"require": "./lib/
|
|
49
|
-
"default": "./lib/
|
|
46
|
+
"./element-linked-store": {
|
|
47
|
+
"types": "./lib/element-linked-store/index.d.ts",
|
|
48
|
+
"require": "./lib/element-linked-store/index.cjs",
|
|
49
|
+
"default": "./lib/element-linked-store/index.js"
|
|
50
50
|
},
|
|
51
51
|
"./connector": {
|
|
52
52
|
"types": "./lib/connector/index.d.ts",
|
|
@@ -266,8 +266,8 @@
|
|
|
266
266
|
"canvas": [
|
|
267
267
|
"lib/canvas/index.d.ts"
|
|
268
268
|
],
|
|
269
|
-
"
|
|
270
|
-
"lib/
|
|
269
|
+
"element-linked-store": [
|
|
270
|
+
"lib/element-linked-store/index.d.ts"
|
|
271
271
|
],
|
|
272
272
|
"component": [
|
|
273
273
|
"lib/component/index.d.ts"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var S=Object.defineProperty,p=Object.defineProperties;var y=Object.getOwnPropertyDescriptors;var u=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable;var h=s=>{throw TypeError(s)};var c=(s,e,t)=>e in s?S(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,l=(s,e)=>{for(var t in e||(e={}))E.call(e,t)&&c(s,t,e[t]);if(u)for(var t of u(e))L.call(e,t)&&c(s,t,e[t]);return s},d=(s,e)=>p(s,y(e));var f=(s,e,t)=>e.has(s)||h("Cannot "+t);var n=(s,e,t)=>(f(s,e,"read from private field"),t?t.call(s):e.get(s)),b=(s,e,t)=>e.has(s)?h("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),o=(s,e,t,i)=>(f(s,e,"write to private field"),i?i.call(s,t):e.set(s,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../Store-GokLe_g-.cjs"),m=require("../string-DUXXtU8v.cjs");require("../index-Cqw2NKev.cjs");var r;class g extends T.Store{constructor(t,i){super(i);b(this,r);o(this,r,Array.isArray(t)?t:[t]);for(const a in this.initial)this.set(a,this.initial[a])}addElement(t){n(this,r).push(t)}removeElement(t){o(this,r,n(this,r).filter(i=>i!==t))}isTrue(t){return this.current[t]===!0}isFalse(t){return this.current[t]===!1}reset(){super.reset();for(const t in this.initial)this.set(t,this.initial[t])}set(t,i=!0){this.current=d(l({},this.current),{[t]:i}),i?n(this,r).forEach(a=>a.classList.add(m.camelToKebab(t))):n(this,r).forEach(a=>a.classList.remove(m.camelToKebab(t)))}}r=new WeakMap;exports.ClassLinkedStatus=g;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
var E = Object.defineProperty, L = Object.defineProperties;
|
|
2
|
-
var S = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var o = Object.getOwnPropertySymbols;
|
|
4
|
-
var b = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var l = (s) => {
|
|
6
|
-
throw TypeError(s);
|
|
7
|
-
};
|
|
8
|
-
var c = (s, i, t) => i in s ? E(s, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[i] = t, u = (s, i) => {
|
|
9
|
-
for (var t in i || (i = {}))
|
|
10
|
-
b.call(i, t) && c(s, t, i[t]);
|
|
11
|
-
if (o)
|
|
12
|
-
for (var t of o(i))
|
|
13
|
-
x.call(i, t) && c(s, t, i[t]);
|
|
14
|
-
return s;
|
|
15
|
-
}, f = (s, i) => L(s, S(i));
|
|
16
|
-
var m = (s, i, t) => i.has(s) || l("Cannot " + t);
|
|
17
|
-
var h = (s, i, t) => (m(s, i, "read from private field"), t ? t.call(s) : i.get(s)), p = (s, i, t) => i.has(s) ? l("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, t), n = (s, i, t, r) => (m(s, i, "write to private field"), r ? r.call(s, t) : i.set(s, t), t);
|
|
18
|
-
import { S as y } from "../Store-swP_0ymB.js";
|
|
19
|
-
import { c as d } from "../string-BlMQbe8b.js";
|
|
20
|
-
import "../index-euf5anj6.js";
|
|
21
|
-
var e;
|
|
22
|
-
class C extends y {
|
|
23
|
-
constructor(t, r) {
|
|
24
|
-
super(r);
|
|
25
|
-
p(this, e);
|
|
26
|
-
n(this, e, Array.isArray(t) ? t : [t]);
|
|
27
|
-
for (const a in this.initial)
|
|
28
|
-
this.set(a, this.initial[a]);
|
|
29
|
-
}
|
|
30
|
-
addElement(t) {
|
|
31
|
-
h(this, e).push(t);
|
|
32
|
-
}
|
|
33
|
-
removeElement(t) {
|
|
34
|
-
n(this, e, h(this, e).filter((r) => r !== t));
|
|
35
|
-
}
|
|
36
|
-
isTrue(t) {
|
|
37
|
-
return this.current[t] === !0;
|
|
38
|
-
}
|
|
39
|
-
isFalse(t) {
|
|
40
|
-
return this.current[t] === !1;
|
|
41
|
-
}
|
|
42
|
-
reset() {
|
|
43
|
-
super.reset();
|
|
44
|
-
for (const t in this.initial)
|
|
45
|
-
this.set(t, this.initial[t]);
|
|
46
|
-
}
|
|
47
|
-
set(t, r = !0) {
|
|
48
|
-
this.current = f(u({}, this.current), { [t]: r }), r ? h(this, e).forEach(
|
|
49
|
-
(a) => a.classList.add(d(t))
|
|
50
|
-
) : h(this, e).forEach(
|
|
51
|
-
(a) => a.classList.remove(d(t))
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
e = new WeakMap();
|
|
56
|
-
export {
|
|
57
|
-
C as ClassLinkedStatus
|
|
58
|
-
};
|