aptechka 0.53.3 → 0.54.1
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/popover/index.cjs +1 -1
- package/lib/popover/index.js +13 -13
- package/lib/scroll/ScrollElement.d.ts +1 -0
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +291 -285
- 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
|
@@ -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.1",
|
|
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
|
-
};
|