aptechka 0.1.5 → 0.1.7
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/Animated-Bf-gPIQM.cjs +1 -0
- package/lib/{Animated-CzBHCHNm.js → Animated-Br_4OSth.js} +36 -35
- package/lib/Composed-C2Vv1xxR.cjs +1 -0
- package/lib/Composed-DhtYBEmo.js +79 -0
- package/lib/{Damped--qBZAdEi.cjs → Damped-BwpMU9Gi.cjs} +1 -1
- package/lib/{Damped-Bm1kSn1f.js → Damped-urvryQLo.js} +1 -1
- package/lib/{Derived-BS2ja9qa.js → Derived-Bc88XJ8J.js} +1 -1
- package/lib/{Derived-CqmIkTGN.cjs → Derived-SjPdLJiZ.cjs} +1 -1
- package/lib/{SourceManager-B44FUTig.js → SourceManager-BoP9RAJr.js} +1 -1
- package/lib/{SourceManager-D447KWpH.cjs → SourceManager-CI6NfLzW.cjs} +1 -1
- package/lib/Store-D0_rDIsE.cjs +1 -0
- package/lib/{Store-uTyReFzx.js → Store-JOKrNVEr.js} +18 -18
- package/lib/{Viewport-CDqiD8Ao.cjs → Viewport-COsaberc.cjs} +1 -1
- package/lib/{Viewport-Cj0i-H5d.js → Viewport-CXY5xcGJ.js} +1 -1
- package/lib/abstract-elements/index.cjs +1 -1
- package/lib/abstract-elements/index.js +2 -1
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +2 -2
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.js +1 -1
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +8 -8
- package/lib/connector/index.cjs +1 -1
- package/lib/connector/index.d.ts +1 -0
- package/lib/connector/index.js +32 -31
- package/lib/createStylesheet-BSXZrWW6.js +8 -0
- package/lib/createStylesheet-C1rimcGc.cjs +1 -0
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +1 -1
- package/lib/element-constructor/ElementConstructor.d.ts +18 -27
- package/lib/element-constructor/index.cjs +1 -1
- package/lib/element-constructor/index.d.ts +1 -2
- package/lib/element-constructor/index.js +120 -639
- package/lib/element-constructor/knownSvgTags.d.ts +1 -0
- package/lib/element-constructor/tags.d.ts +117 -0
- package/lib/en3/index.cjs +1 -1
- package/lib/en3/index.js +2 -2
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +1 -1
- package/lib/{index-DyJhLxk8.js → index-dBwVZz_v.js} +25 -25
- package/lib/index-vI4hmrI8.cjs +9 -0
- package/lib/jsx/ComponentElement.d.ts +17 -0
- package/lib/jsx/h.d.ts +5 -4
- package/lib/jsx/hooks/animation-frame.d.ts +5 -0
- package/lib/jsx/hooks/animation.d.ts +3 -0
- package/lib/jsx/hooks/basic.d.ts +4 -0
- package/lib/jsx/hooks/element-resize.d.ts +3 -0
- package/lib/jsx/hooks/intersection.d.ts +3 -0
- package/lib/jsx/hooks/store.d.ts +6 -0
- package/lib/jsx/hooks/style.d.ts +2 -0
- package/lib/jsx/hooks/utils.d.ts +4 -0
- package/lib/jsx/hooks/window-resize.d.ts +2 -0
- package/lib/jsx/index.cjs +1 -1
- package/lib/jsx/index.d.ts +8 -1
- package/lib/jsx/index.js +170 -102
- package/lib/jsx/type.d.ts +7 -5
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +1 -1
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +1 -1
- package/lib/modal/index.cjs +1 -1
- package/lib/modal/index.js +7 -7
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +1 -1
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +23 -24
- package/lib/select/index.cjs +1 -1
- package/lib/select/index.js +1 -1
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +2 -2
- package/lib/store/Derived.d.ts +1 -1
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.js +48 -111
- package/lib/studio/index.cjs +2 -2
- package/lib/studio/index.js +307 -288
- package/lib/studio/tweaker/TweakerBooleanManagerElement.d.ts +1 -1
- package/lib/studio/tweaker/TweakerColorManagerElement.d.ts +1 -1
- package/lib/studio/tweaker/TweakerFieldElement.d.ts +2 -1
- package/lib/studio/tweaker/TweakerLinkManagerElement.d.ts +1 -1
- package/lib/studio/tweaker/TweakerNumberManagerElement.d.ts +1 -1
- package/lib/studio/tweaker/TweakerRangeManagerElement.d.ts +1 -1
- package/lib/studio/tweaker/TweakerSelectManagerElement.d.ts +1 -1
- package/lib/studio/tweaker/TweakerStoreManagerElement.d.ts +5 -2
- package/lib/studio/tweaker/TweakerStringManagerElement.d.ts +1 -1
- package/lib/tags-D-lzPz_v.js +748 -0
- package/lib/tags-DkAbVUQP.cjs +1 -0
- package/lib/theme/index.cjs +1 -1
- package/lib/theme/index.js +7 -7
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +1 -1
- package/package.json +1 -1
- package/lib/Animated-DZ_fbJmi.cjs +0 -1
- package/lib/ElementConstructor-DB0xOoat.js +0 -199
- package/lib/ElementConstructor-v1FPLXAW.cjs +0 -1
- package/lib/Store-BOOfmlyv.cjs +0 -1
- package/lib/createStylesheet-74ZP3AZm.js +0 -8
- package/lib/createStylesheet-ChhZFwSX.cjs +0 -1
- package/lib/element-constructor/htmlTags.d.ts +0 -115
- package/lib/element-constructor/svgTags.d.ts +0 -64
- package/lib/htmlTags-CNEFIHPp.js +0 -683
- package/lib/htmlTags-CwYHVo9n.cjs +0 -1
- package/lib/index-tPw9mmLF.cjs +0 -9
- package/lib/jsx/ComponentWrapper.d.ts +0 -12
- package/lib/jsx/hooks.d.ts +0 -19
package/lib/jsx/index.js
CHANGED
|
@@ -1,125 +1,193 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var w = (t, e, n) => e in t ?
|
|
1
|
+
var R = Object.defineProperty, T = Object.defineProperties;
|
|
2
|
+
var L = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var y = Object.getOwnPropertySymbols;
|
|
4
|
+
var F = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var w = (t, e, n) => e in t ? R(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, d = (t, e) => {
|
|
6
6
|
for (var n in e || (e = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var n of
|
|
10
|
-
|
|
7
|
+
F.call(e, n) && w(t, n, e[n]);
|
|
8
|
+
if (y)
|
|
9
|
+
for (var n of y(e))
|
|
10
|
+
x.call(e, n) && w(t, n, e[n]);
|
|
11
11
|
return t;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
12
|
+
}, m = (t, e) => T(t, L(e));
|
|
13
|
+
var u = (t, e, n) => (w(t, typeof e != "symbol" ? e + "" : e, n), n), E = (t, e, n) => {
|
|
14
14
|
if (!e.has(t))
|
|
15
15
|
throw TypeError("Cannot " + n);
|
|
16
16
|
};
|
|
17
|
-
var
|
|
17
|
+
var k = (t, e, n) => (E(t, e, "read from private field"), n ? n.call(t) : e.get(t)), S = (t, e, n) => {
|
|
18
18
|
if (e.has(t))
|
|
19
19
|
throw TypeError("Cannot add the same private member more than once");
|
|
20
20
|
e instanceof WeakSet ? e.add(t) : e.set(t, n);
|
|
21
|
-
},
|
|
22
|
-
import { E as
|
|
23
|
-
import {
|
|
24
|
-
import "../
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import "../
|
|
30
|
-
import "../
|
|
31
|
-
import "../
|
|
32
|
-
import "../
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
display: "contents"
|
|
49
|
-
},
|
|
50
|
-
children: o
|
|
51
|
-
}).rootElements[0]) : l(this, i, document.createTextNode(o.toString())) : l(this, i, o), s(this, f).forEach((c) => {
|
|
52
|
-
c(s(this, i));
|
|
53
|
-
}), C) {
|
|
54
|
-
const c = j.subscribe(s(this, i), {
|
|
55
|
-
connectCallback: () => {
|
|
56
|
-
s(this, m).forEach((r) => {
|
|
57
|
-
const k = r(s(this, i));
|
|
58
|
-
k && this.addDisconnectCallback(k);
|
|
59
|
-
});
|
|
60
|
-
},
|
|
61
|
-
disconnectCallback: () => {
|
|
62
|
-
s(this, d).forEach((r) => {
|
|
63
|
-
r(s(this, i));
|
|
64
|
-
}), s(this, m).clear(), s(this, d).clear(), s(this, f).clear(), c();
|
|
65
|
-
},
|
|
66
|
-
maxWaitSec: 20
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
get rootNode() {
|
|
71
|
-
return s(this, i);
|
|
72
|
-
}
|
|
73
|
-
addCreateCallback(e) {
|
|
74
|
-
s(this, f).add(e);
|
|
21
|
+
}, v = (t, e, n, s) => (E(t, e, "write to private field"), s ? s.call(t, n) : e.set(t, n), n);
|
|
22
|
+
import { E as h, aD as z } from "../tags-D-lzPz_v.js";
|
|
23
|
+
import { g as A } from "../dom-BY7JhTx5.js";
|
|
24
|
+
import { ticker as H } from "../ticker/index.js";
|
|
25
|
+
import { S as M } from "../Store-JOKrNVEr.js";
|
|
26
|
+
import { elementResizer as j } from "../element-resizer/index.js";
|
|
27
|
+
import { intersector as O } from "../intersector/index.js";
|
|
28
|
+
import { windowResizer as N } from "../window-resizer/index.js";
|
|
29
|
+
import { i as g } from "../browser-0zX67oeU.js";
|
|
30
|
+
import { Tweened as W } from "../animation/index.js";
|
|
31
|
+
import { D as q } from "../Damped-urvryQLo.js";
|
|
32
|
+
import { D as B } from "../Derived-Bc88XJ8J.js";
|
|
33
|
+
import { D as I, R as $, C as G } from "../Composed-DhtYBEmo.js";
|
|
34
|
+
import { c as J } from "../createStylesheet-BSXZrWW6.js";
|
|
35
|
+
let c = null;
|
|
36
|
+
var l;
|
|
37
|
+
class K extends HTMLElement {
|
|
38
|
+
constructor(n) {
|
|
39
|
+
super();
|
|
40
|
+
u(this, "createCallbacks", /* @__PURE__ */ new Set());
|
|
41
|
+
u(this, "connectCallbacks", /* @__PURE__ */ new Set());
|
|
42
|
+
u(this, "disconnectCallbacks", /* @__PURE__ */ new Set());
|
|
43
|
+
u(this, "stores", /* @__PURE__ */ new Set());
|
|
44
|
+
S(this, l, void 0);
|
|
45
|
+
c = this, v(this, l, n(this)), this.createCallbacks.forEach((s) => {
|
|
46
|
+
s(this);
|
|
47
|
+
});
|
|
75
48
|
}
|
|
76
|
-
|
|
77
|
-
|
|
49
|
+
connectedCallback() {
|
|
50
|
+
this.connectCallbacks.forEach((n) => {
|
|
51
|
+
n(this) && this.disconnectCallbacks.add(n);
|
|
52
|
+
});
|
|
78
53
|
}
|
|
79
|
-
|
|
80
|
-
|
|
54
|
+
disconnectedCallback() {
|
|
55
|
+
this.disconnectCallbacks.forEach((n) => {
|
|
56
|
+
n(this);
|
|
57
|
+
}), k(this, l).destroy(), this.disconnectCallbacks.clear(), this.connectCallbacks.clear(), this.stores.forEach((n) => n.close()), this.stores.clear();
|
|
81
58
|
}
|
|
82
59
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
)
|
|
90
|
-
|
|
60
|
+
l = new WeakMap();
|
|
61
|
+
let i;
|
|
62
|
+
function P(t, e, ...n) {
|
|
63
|
+
if (typeof t == "function") {
|
|
64
|
+
if (t.isFragment)
|
|
65
|
+
return t(m(d({}, e), { children: n }));
|
|
66
|
+
const r = `component-${t.name.toLowerCase()}`;
|
|
67
|
+
let o = customElements.get(
|
|
68
|
+
r
|
|
69
|
+
);
|
|
70
|
+
return o || (o = class extends K {
|
|
71
|
+
constructor(a) {
|
|
72
|
+
super(a);
|
|
73
|
+
}
|
|
74
|
+
}, customElements.define(r, o)), new o((a) => {
|
|
75
|
+
const p = t(m(d({}, e), { children: n }));
|
|
76
|
+
let C = null;
|
|
77
|
+
return !i && p ? C = new h(a, {
|
|
78
|
+
children: p
|
|
79
|
+
}) : i && (i.shadow && a.attachShadow({ mode: "open" }), C = new h(
|
|
80
|
+
a,
|
|
81
|
+
i
|
|
82
|
+
)), i = void 0, C;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
const s = {
|
|
91
86
|
shadowChildren: n
|
|
92
87
|
};
|
|
93
88
|
if (e)
|
|
94
|
-
for (const
|
|
95
|
-
const
|
|
96
|
-
|
|
89
|
+
for (const r of Object.keys(e)) {
|
|
90
|
+
const o = e[r];
|
|
91
|
+
r.startsWith("on") ? (s.events || (s.events = {}), s.events[r.split("on")[1].toLowerCase()] = o) : r === "class" ? s.class = o : r === "style" ? s.style = o : r === "ref" ? s.ref = o : r === "shadow" ? s.shadow = o !== "false" : r === "forceSvg" ? s.forceSvg = o !== "false" : (s.attributes || (s.attributes = {}), s.attributes[r] = o);
|
|
97
92
|
}
|
|
98
|
-
return new
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
return t === "component" ? (i = s, D({ children: n })) : new h(t, s);
|
|
94
|
+
}
|
|
95
|
+
function D({
|
|
96
|
+
children: t
|
|
97
|
+
}) {
|
|
98
|
+
return new h(document.createDocumentFragment(), {
|
|
99
|
+
children: t
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
D.isFragment = !0;
|
|
103
|
+
function ae(t, e) {
|
|
104
|
+
const n = A(t), s = /* @__PURE__ */ P(e, null);
|
|
105
|
+
n && s instanceof Node && n.appendChild(s);
|
|
106
|
+
}
|
|
107
|
+
function Q(t) {
|
|
108
|
+
c.createCallbacks.add(t);
|
|
109
|
+
}
|
|
110
|
+
function f(t) {
|
|
111
|
+
g && c.connectCallbacks.add(t);
|
|
112
|
+
}
|
|
113
|
+
function ue(t) {
|
|
114
|
+
g && c.disconnectCallbacks.add(t);
|
|
115
|
+
}
|
|
116
|
+
function b(t, e) {
|
|
117
|
+
return e ? typeof e == "string" || e instanceof HTMLElement ? e : e.current : t;
|
|
101
118
|
}
|
|
102
|
-
function
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
})), e;
|
|
119
|
+
function le(t, e) {
|
|
120
|
+
f((n) => H.subscribe(t, m(d({}, e), {
|
|
121
|
+
culling: typeof (e == null ? void 0 : e.culling) == "boolean" ? e != null && e.culling ? n : void 0 : b(void 0, e == null ? void 0 : e.culling)
|
|
122
|
+
})));
|
|
107
123
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
n && o instanceof Node && n.appendChild(o);
|
|
124
|
+
function fe(...t) {
|
|
125
|
+
const e = new q(...t);
|
|
126
|
+
return c.stores.add(e), e;
|
|
112
127
|
}
|
|
113
|
-
function
|
|
114
|
-
|
|
128
|
+
function de(...t) {
|
|
129
|
+
const e = new W(...t);
|
|
130
|
+
return c.stores.add(e), e;
|
|
131
|
+
}
|
|
132
|
+
function me(t, e) {
|
|
133
|
+
f((n) => j.subscribe(b(n, e), t));
|
|
134
|
+
}
|
|
135
|
+
function he(t, e) {
|
|
136
|
+
f((n) => O.subscribe(b(n, e), t));
|
|
137
|
+
}
|
|
138
|
+
function Ce(...t) {
|
|
139
|
+
const e = new M(...t);
|
|
140
|
+
return c.stores.add(e), e;
|
|
141
|
+
}
|
|
142
|
+
function we(...t) {
|
|
143
|
+
const e = new B(...t);
|
|
144
|
+
return c.stores.add(e), e;
|
|
145
|
+
}
|
|
146
|
+
function be(...t) {
|
|
147
|
+
const e = new I(...t);
|
|
148
|
+
return c.stores.add(e), e;
|
|
149
|
+
}
|
|
150
|
+
function pe(...t) {
|
|
151
|
+
const e = new $(...t);
|
|
152
|
+
return c.stores.add(e), e;
|
|
153
|
+
}
|
|
154
|
+
function ye(...t) {
|
|
155
|
+
const e = new G(...t);
|
|
156
|
+
return c.stores.add(e), e;
|
|
157
|
+
}
|
|
158
|
+
function Ee(t) {
|
|
159
|
+
Q((e) => {
|
|
160
|
+
e.shadowRoot && e.shadowRoot.adoptedStyleSheets.push(J(t));
|
|
161
|
+
}), f((e) => {
|
|
162
|
+
if (!e.shadowRoot) {
|
|
163
|
+
const n = z(t).node;
|
|
164
|
+
if (![...document.head.querySelectorAll("style")].find((r) => r.outerHTML === n.outerHTML))
|
|
165
|
+
return document.head.appendChild(n), () => {
|
|
166
|
+
n.remove();
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
});
|
|
115
170
|
}
|
|
116
|
-
function
|
|
117
|
-
|
|
171
|
+
function ke(t, e) {
|
|
172
|
+
f(() => N.subscribe(t, e));
|
|
118
173
|
}
|
|
119
174
|
export {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
175
|
+
D as Fragment,
|
|
176
|
+
P as h,
|
|
177
|
+
ae as render,
|
|
178
|
+
le as useAnimationFrame,
|
|
179
|
+
ye as useComposed,
|
|
180
|
+
f as useConnect,
|
|
181
|
+
Q as useCreate,
|
|
182
|
+
fe as useDamped,
|
|
183
|
+
we as useDerived,
|
|
184
|
+
be as useDerivedArray,
|
|
185
|
+
ue as useDisconnect,
|
|
186
|
+
me as useElementResize,
|
|
187
|
+
he as useIntersection,
|
|
188
|
+
pe as useResource,
|
|
189
|
+
Ce as useStore,
|
|
190
|
+
Ee as useStyle,
|
|
191
|
+
de as useTweened,
|
|
192
|
+
ke as useWindowResize
|
|
125
193
|
};
|
package/lib/jsx/type.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { ElementConstructorClass, ElementConstructorEventMap, ElementConstructorStyle, ElementConstructorTagNames } from '../element-constructor';
|
|
1
|
+
import type { ElementConstructor, ElementConstructorClass, ElementConstructorEventMap, ElementConstructorStyle, ElementConstructorTagNames } from '../element-constructor';
|
|
2
2
|
import type { Store } from '../store';
|
|
3
3
|
import type { Split } from '../utils';
|
|
4
4
|
type StoreOr<T> = T | Store<T | null | undefined>;
|
|
5
5
|
declare global {
|
|
6
6
|
namespace JSX {
|
|
7
|
-
type ComponentChild = Node |
|
|
8
|
-
type ComponentChildren = ComponentChild | ComponentChild[]
|
|
7
|
+
type ComponentChild = Node | string | number | boolean | undefined | null | void | Store<any> | ElementConstructor;
|
|
8
|
+
type ComponentChildren = ComponentChild | ComponentChild[];
|
|
9
9
|
interface BaseProps {
|
|
10
10
|
children?: ComponentChildren;
|
|
11
11
|
}
|
|
12
|
-
type Component<TProps extends object = object> = (props?: BaseProps & TProps) =>
|
|
13
|
-
type Element =
|
|
12
|
+
type Component<TProps extends object = object> = (props?: BaseProps & TProps) => Element;
|
|
13
|
+
type Element = ComponentChild;
|
|
14
14
|
interface ElementAttributesProperty {
|
|
15
15
|
props: any;
|
|
16
16
|
}
|
|
@@ -172,6 +172,8 @@ declare global {
|
|
|
172
172
|
itemType?: StoreOr<string>;
|
|
173
173
|
itemID?: StoreOr<string>;
|
|
174
174
|
itemRef?: StoreOr<string>;
|
|
175
|
+
shadow?: boolean;
|
|
176
|
+
forceSvg?: boolean;
|
|
175
177
|
}
|
|
176
178
|
type UnknownAttributes = {
|
|
177
179
|
[key: string]: any;
|
package/lib/ladder/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var k=Object.defineProperty;var f=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable;var p=(s,t,e)=>t in s?k(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,b=(s,t)=>{for(var e in t||(t={}))S.call(t,e)&&p(s,e,t[e]);if(f)for(var e of f(t))g.call(t,e)&&p(s,e,t[e]);return s};var y=(s,t,e)=>{if(!t.has(s))throw TypeError("Cannot "+e)};var c=(s,t,e)=>(y(s,t,"read from private field"),e?e.call(s):t.get(s)),u=(s,t,e)=>{if(t.has(s))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(s):t.set(s,e)},d=(s,t,e,o)=>(y(s,t,"write to private field"),o?o.call(s,e):t.set(s,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../Store-
|
|
1
|
+
"use strict";var k=Object.defineProperty;var f=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable;var p=(s,t,e)=>t in s?k(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,b=(s,t)=>{for(var e in t||(t={}))S.call(t,e)&&p(s,e,t[e]);if(f)for(var e of f(t))g.call(t,e)&&p(s,e,t[e]);return s};var y=(s,t,e)=>{if(!t.has(s))throw TypeError("Cannot "+e)};var c=(s,t,e)=>(y(s,t,"read from private field"),e?e.call(s):t.get(s)),u=(s,t,e)=>{if(t.has(s))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(s):t.set(s,e)},d=(s,t,e,o)=>(y(s,t,"write to private field"),o?o.call(s,e):t.set(s,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../Store-D0_rDIsE.cjs");var h,l,a;class m extends v.Store{constructor(e){super(e,{equalityCheck:()=>!1});u(this,h,void 0);u(this,l,void 0);u(this,a,void 0);d(this,h,b({},e)),d(this,l,new Map),d(this,a,new Set)}get base(){return c(this,h)}get steps(){return c(this,l)}close(){super.close(),c(this,a).clear(),c(this,l).clear()}bind(e){c(this,a).add(e)}unbind(e){c(this,a).delete(e)}deleteStep(e){this.steps.delete(e)}getStepValue(e){return this.steps.get(e)[1]}setStep(e,o,n){const i={};for(const r in this.current)i[r]=n[r]||0;this.steps.set(e,[o,i])}calculate(){const e={};for(const o in this.base)e[o]=this.base[o];for(const o of this.steps){const n=o[1];if(n[0]==="+")for(const i in this.base){const r=n[1][i];e[i]+=r}else if(n[0]==="*")for(const i in this.base){const r=n[1][i];e[i]*=r}else if(n[0]==="/")for(const i in this.base){const r=n[1][i];e[i]/=r}else if(n[0]==="-")for(const i in this.base){const r=n[1][i];e[i]-=r}}for(const o of c(this,a))for(const n in e)o[n]=e[n];this.current=e}}h=new WeakMap,l=new WeakMap,a=new WeakMap;exports.Ladder=m;
|
package/lib/ladder/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var c = (t, s, e) => (y(t, s, "read from private field"), e ? e.call(t) : s.get(
|
|
|
18
18
|
throw TypeError("Cannot add the same private member more than once");
|
|
19
19
|
s instanceof WeakSet ? s.add(t) : s.set(t, e);
|
|
20
20
|
}, f = (t, s, e, o) => (y(t, s, "write to private field"), o ? o.call(t, e) : s.set(t, e), e);
|
|
21
|
-
import { S as v } from "../Store-
|
|
21
|
+
import { S as v } from "../Store-JOKrNVEr.js";
|
|
22
22
|
var l, h, a;
|
|
23
23
|
class x extends v {
|
|
24
24
|
constructor(e) {
|
package/lib/media/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var d=(e,r,s)=>{if(!r.has(e))throw TypeError("Cannot "+s)};var o=(e,r,s)=>(d(e,r,"read from private field"),s?s.call(e):r.get(e)),c=(e,r,s)=>{if(r.has(e))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(e):r.set(e,s)},u=(e,r,s,n)=>(d(e,r,"write to private field"),n?n.call(e,s):r.set(e,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../order/index.cjs"),l=require("../window-resizer/index.cjs"),h=require("../Store-
|
|
1
|
+
"use strict";var d=(e,r,s)=>{if(!r.has(e))throw TypeError("Cannot "+s)};var o=(e,r,s)=>(d(e,r,"read from private field"),s?s.call(e):r.get(e)),c=(e,r,s)=>{if(r.has(e))throw TypeError("Cannot add the same private member more than once");r instanceof WeakSet?r.add(e):r.set(e,s)},u=(e,r,s,n)=>(d(e,r,"write to private field"),n?n.call(e,s):r.set(e,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../order/index.cjs"),l=require("../window-resizer/index.cjs"),h=require("../Store-D0_rDIsE.cjs");var i,t;class b extends h.Store{constructor(s){super(!1);c(this,i,void 0);c(this,t,void 0);u(this,i,s),u(this,t,l.windowResizer.subscribe(()=>{matchMedia(o(this,i)).matches?this.current=!0:this.current=!1},a.RESIZE_ORDER.MEDIA))}close(){super.close(),o(this,t).call(this)}}i=new WeakMap,t=new WeakMap;exports.Media=b;
|
package/lib/media/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var o = (e, s, r) => (a(e, s, "read from private field"), r ? r.call(e) : s.get(
|
|
|
9
9
|
}, u = (e, s, r, m) => (a(e, s, "write to private field"), m ? m.call(e, r) : s.set(e, r), r);
|
|
10
10
|
import { RESIZE_ORDER as h } from "../order/index.js";
|
|
11
11
|
import { windowResizer as n } from "../window-resizer/index.js";
|
|
12
|
-
import { S as f } from "../Store-
|
|
12
|
+
import { S as f } from "../Store-JOKrNVEr.js";
|
|
13
13
|
var t, i;
|
|
14
14
|
class b extends f {
|
|
15
15
|
constructor(r) {
|
package/lib/modal/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../custom-element/index.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../custom-element/index.cjs");require("../Store-D0_rDIsE.cjs");const b=require("../browser-CpzFX2xg.cjs"),s=require("../tags-DkAbVUQP.cjs"),m=require("../createStylesheet-C1rimcGc.cjs"),g=require("../popover/index.cjs"),d=require("../theme/index.cjs");var w=Object.defineProperty,_=Object.getOwnPropertyDescriptor,y=(t,e,o,r)=>{for(var n=r>1?void 0:r?_(e,o):e,c=t.length-1,h;c>=0;c--)(h=t[c])&&(n=(r?h(e,o,n):h(n))||n);return r&&n&&w(e,o,n),n},p=(t,e,o)=>{if(!e.has(t))throw TypeError("Cannot "+o)},l=(t,e,o)=>(p(t,e,"read from private field"),o?o.call(t):e.get(t)),u=(t,e,o)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,o)},f=(t,e,o,r)=>(p(t,e,"write to private field"),r?r.call(t,o):e.set(t,o),o),i,a;const C=m.createStylesheet({":host":{position:"fixed",top:"0",left:"0",zIndex:"1",width:"100%",height:"100%",transitionProperty:"opacity",transitionDuration:d.aptechkaTheme.durationShort.var},":host::before":{content:'""',position:"fixed",top:"0",left:"0",zIndex:"-1",width:"100%",height:"100%",backgroundColor:"var(--backdrop, rgba(0, 0, 0, 0.8))"},".inner":{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden auto"},".overflow .inner":{alignItems:"flex-start"},".content":{position:"relative"},".close-button":{position:"absolute",top:"var(---close-button-top, 0.5em)",right:"var(---close-button-right, 0.5em)",background:"none",border:"none",fontFamily:"inherit",fontSize:"inherit",fontWeight:"inherit"},".close-button-default":{width:"var(---close-button-size, 1.5em)",height:"var(---close-button-size, 1.5em)",display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"transform",transitionDuration:d.aptechkaTheme.durationShort.var,willChange:"transform"},".close-button:hover .close-button-default":{transform:"scale(0.9)"},".close-button:active .close-button-default":{transform:"scale(0.7)"},".close-button-default::before, .close-button-default::after":{content:'""',position:"absolute",width:"var(---close-button-thickness, 0.1em)",height:"100%",backgroundColor:`var(--close-button-color, ${d.aptechkaTheme.colorDark.var})`},".close-button-default::before":{transform:"rotate(-45deg)"},".close-button-default::after":{transform:"rotate(45deg)"}});exports.ModalElement=class extends g.PopoverElement{constructor(){super(),u(this,i,null),u(this,a,null),b.isBrowser&&(this.openShadow(C),s.element(this,{shadowChildren:s.div({class:"inner",attributes:{outside:!0},children:s.div({class:"content",children:[s.custom("e-popover-button",{attributes:{type:"close",target:this.id},class:"close-button",children:[s.slot({attributes:{name:"close-button"},children:s.span({class:"close-button-default"})})]}),s.slot()]}),ref:e=>f(this,a,e)})}),f(this,i,new ResizeObserver(()=>{l(this,a).scrollHeight>l(this,a).clientHeight?this.classList.add("overflow"):this.classList.remove("overflow")})))}connectedCallback(){super.connectedCallback(),l(this,i).observe(this)}disconnectedCallback(){super.disconnectedCallback(),l(this,i).disconnect()}};i=new WeakMap;a=new WeakMap;exports.ModalElement=y([v.define("e-modal")],exports.ModalElement);
|
package/lib/modal/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { define as m } from "../custom-element/index.js";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import "../Store-JOKrNVEr.js";
|
|
3
|
+
import { i as g } from "../browser-0zX67oeU.js";
|
|
4
|
+
import { e as w, D as d, aY as _, ay as f, aB as y } from "../tags-D-lzPz_v.js";
|
|
5
|
+
import { c as C } from "../createStylesheet-BSXZrWW6.js";
|
|
6
6
|
import { PopoverElement as k } from "../popover/index.js";
|
|
7
7
|
import { aptechkaTheme as h } from "../theme/index.js";
|
|
8
8
|
var x = Object.defineProperty, z = Object.getOwnPropertyDescriptor, P = (t, e, o, r) => {
|
|
@@ -94,7 +94,7 @@ const S = C({
|
|
|
94
94
|
});
|
|
95
95
|
let v = class extends k {
|
|
96
96
|
constructor() {
|
|
97
|
-
super(), u(this, s, null), u(this, a, null),
|
|
97
|
+
super(), u(this, s, null), u(this, a, null), g && (this.openShadow(S), w(this, {
|
|
98
98
|
shadowChildren: d({
|
|
99
99
|
class: "inner",
|
|
100
100
|
attributes: {
|
|
@@ -103,7 +103,7 @@ let v = class extends k {
|
|
|
103
103
|
children: d({
|
|
104
104
|
class: "content",
|
|
105
105
|
children: [
|
|
106
|
-
|
|
106
|
+
_("e-popover-button", {
|
|
107
107
|
attributes: {
|
|
108
108
|
type: "close",
|
|
109
109
|
target: this.id
|
|
@@ -114,7 +114,7 @@ let v = class extends k {
|
|
|
114
114
|
attributes: {
|
|
115
115
|
name: "close-button"
|
|
116
116
|
},
|
|
117
|
-
children:
|
|
117
|
+
children: y({ class: "close-button-default" })
|
|
118
118
|
})
|
|
119
119
|
]
|
|
120
120
|
}),
|
package/lib/popover/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("../attribute/index.cjs"),M=require("../custom-element/index.cjs"),A=require("../Store-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=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 $=Object.defineProperty,B=Object.getOwnPropertyDescriptor,D=(t,e,r)=>e in t?$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,b=(t,e,r,s)=>{for(var n=s>1?void 0:s?B(e,r):e,l=t.length-1,p;l>=0;l--)(p=t[l])&&(n=(s?p(e,r,n):p(n))||n);return s&&n&&$(e,r,n),n},P=(t,e,r)=>(D(t,typeof e!="symbol"?e+"":e,r),r),W=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},i=(t,e,r)=>(W(t,e,"read from private field"),r?r.call(t):e.get(t)),o=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},y=(t,e,r,s)=>(W(t,e,"write to private field"),s?s.call(t,r):e.set(t,r),r),k=(t,e,r)=>(W(t,e,"access private method"),r),g,a,_,c,f,u,S,C,m,E,w,L,v;exports.PopoverElement=class extends M.CustomElement{constructor(){super(...arguments),o(this,S),o(this,w),o(this,g,-1),o(this,a,new A.Store(!1)),o(this,_,void 0),o(this,c,new T.Attribute(this,"history",!1)),o(this,f,new T.Attribute(this,"single",!1)),o(this,u,!1),P(this,"open",()=>{i(this,a).current||(i(this,a).current=!0,i(this,f).current&&(exports.PopoverElement.__opened.forEach(e=>e.close()),exports.PopoverElement.__opened=[]),exports.PopoverElement.__opened.push(this),y(this,g,exports.PopoverElement.__opened.length-1),i(this,c).current&&i(this,u)&&history.pushState("","",i(this,S,C)),clearTimeout(i(this,_)),this.classList.add("triggered"),this.style.display="block",setTimeout(()=>{addEventListener("click",i(this,m)),addEventListener("keydown",i(this,E)),this.style.opacity="1",this.classList.add("opened")}))}),P(this,"close",()=>{i(this,a).current&&(i(this,a).current=!1,exports.PopoverElement.__opened=exports.PopoverElement.__opened.filter(e=>e!==this),i(this,c).current&&history.replaceState("","",location.pathname.replace(this.id,"")),this.classList.remove("opened"),this.style.opacity="0",removeEventListener("click",i(this,m)),removeEventListener("keydown",i(this,E)),setTimeout(()=>{this.classList.remove("triggered"),this.style.display="none"},q.getElementTransitionDurationMS(this)))}),o(this,m,e=>{k(this,w,L).call(this,()=>{const r=e.composedPath();(!r.find(s=>s===this)&&!r.find(s=>s instanceof HTMLElement&&s.closest("e-popover-button"))||r[0]instanceof HTMLElement&&r[0].hasAttribute("outside"))&&this.close()})}),o(this,E,e=>{k(this,w,L).call(this,()=>{e.code==="Escape"&&this.close()})}),o(this,v,()=>{y(this,u,!1),i(this,a).current&&i(this,c).current&&!location.pathname.includes(this.id)?this.close():!i(this,a).current&&i(this,c).current&&location.pathname.includes(this.id)&&this.open(),y(this,u,!0)})}get history(){return i(this,c)}get single(){return i(this,f)}get opened(){return i(this,a)}connectedCallback(){this.style.opacity="0",this.style.display="none",addEventListener("popstate",i(this,v)),setTimeout(()=>{i(this,v).call(this)},0)}disconnectedCallback(){clearTimeout(i(this,_)),removeEventListener("popstate",i(this,v))}};g=new WeakMap;a=new WeakMap;_=new WeakMap;c=new WeakMap;f=new WeakMap;u=new WeakMap;S=new WeakSet;C=function(){return`${location.pathname}${location.pathname.endsWith("/")?"":"/"}${this.id}`};m=new WeakMap;E=new WeakMap;w=new WeakSet;L=function(t){(exports.PopoverElement.__opened[i(this,g)-1]||exports.PopoverElement.__opened.length===1)&&t()};v=new WeakMap;P(exports.PopoverElement,"__opened",[]);exports.PopoverElement=b([M.define("e-popover")],exports.PopoverElement);var I=Object.defineProperty,G=Object.getOwnPropertyDescriptor,H=(t,e,r,s)=>{for(var n=s>1?void 0:s?G(e,r):e,l=t.length-1,p;l>=0;l--)(p=t[l])&&(n=(s?p(e,r,n):p(n))||n);return s&&n&&I(e,r,n),n},O=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},d=(t,e,r)=>(O(t,e,"read from private field"),r?r.call(t):e.get(t)),N=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},F=(t,e,r,s)=>(O(t,e,"write to private field"),s?s.call(t,r):e.set(t,r),r),h;exports.PopoverButtonElement=class extends x.AbstractButtonElement{constructor(){super(...arguments),N(this,h,void 0)}get popoverElement(){return d(this,h)}click(){if(d(this,h)){const e=this.getAttribute("type")||"open";e==="open"||e==="toggle"&&!d(this,h).opened.current?d(this,h).open():(e==="close"||e==="toggle"&&d(this,h).opened.current)&&d(this,h).close()}}connectedCallback(){const e=this.getAttribute("target");if(e){const r=document.querySelector(`#${e}`)||this.getRootNode().querySelector(`#${e}`);r?F(this,h,r):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,6 +1,6 @@
|
|
|
1
1
|
import { Attribute as T } from "../attribute/index.js";
|
|
2
2
|
import { CustomElement as x, define as P } from "../custom-element/index.js";
|
|
3
|
-
import { S as I } from "../Store-
|
|
3
|
+
import { S as I } from "../Store-JOKrNVEr.js";
|
|
4
4
|
import { g as q } from "../style-j2TwriJ_.js";
|
|
5
5
|
import { AbstractButtonElement as B } from "../abstract-elements/index.js";
|
|
6
6
|
var O = Object.defineProperty, G = Object.getOwnPropertyDescriptor, H = (e, t, i) => t in e ? O(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, N = (e, t, i, r) => {
|
package/lib/scroll/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Ct=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)};var h=(i,e,s)=>(Ct(i,e,"read from private field"),s?s.call(i):e.get(i)),$=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},O=(i,e,s,n)=>(Ct(i,e,"write to private field"),n?n.call(i,s):e.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Tt=require("../Store-BOOfmlyv.cjs"),Dt=require("../Derived-CqmIkTGN.cjs"),At=require("../browser-CpzFX2xg.cjs"),V=require("../layout-8ryRAMGJ.cjs"),zt=require("../math-GDWEqu7y.cjs");require("../ticker/index.cjs");const Vt=require("../Damped--qBZAdEi.cjs"),x=require("../attribute/index.cjs"),Mt=require("../WheelControls-CfDeGCOU.cjs"),wt=require("../custom-element/index.cjs"),xt=require("../order/index.cjs"),pt=require("../window-resizer/index.cjs"),I=require("../scroll-entries/index.cjs"),Lt=require("../ElementConstructor-v1FPLXAW.cjs"),B=require("../htmlTags-CwYHVo9n.cjs"),Ot=require("../createStylesheet-ChhZFwSX.cjs"),It=require("../dom-qY2LdCVL.cjs");var Ht=Object.defineProperty,Ft=Object.getOwnPropertyDescriptor,Bt=(i,e,s,n)=>{for(var r=n>1?void 0:n?Ft(e,s):e,d=i.length-1,w;d>=0;d--)(w=i[d])&&(r=(n?w(e,s,r):w(r))||r);return n&&r&&Ht(e,s,r),r},yt=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},t=(i,e,s)=>(yt(i,e,"read from private field"),s?s.call(i):e.get(i)),l=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},m=(i,e,s,n)=>(yt(i,e,"write to private field"),n?n.call(i,s):e.set(i,s),s),f=(i,e,s)=>(yt(i,e,"access private method"),s),a,M,T,q,D,X,y,Y,j,tt,u,dt,c,et,st,_,p,k,H,b,G,R,N,ft,F,U,mt,kt,bt,Wt,it,vt,rt,_t,P,gt,St,Rt,nt,ht,Et,S,g,L,W;class Gt{constructor(e,s){$(this,S,void 0);$(this,g,void 0);$(this,L,0);$(this,W,0);O(this,S,e),O(this,g,s),I.scrollEntries.register(h(this,S))}get size(){return h(this,L)}get position(){return h(this,W)}destroy(){I.scrollEntries.unregister(h(this,S)),h(this,S).style.transform=""}resize(){O(this,L,h(this,g).vertical?h(this,S).offsetHeight:h(this,S).offsetWidth),O(this,W,h(this,g).vertical?V.getCumulativeOffsetTop(h(this,S)):V.getCumulativeOffsetLeft(h(this,S))),O(this,W,h(this,W)-h(this,g).contentPosition)}transform(){let e=0;h(this,g).infiniteAttribute.current&&h(this,g).overscroll&&h(this,W)+h(this,L)<h(this,g).currentScrollValue&&(e=h(this,g).distance*-1),I.scrollEntries.update(h(this,S),h(this,g).axisAttibute.current,e);const s=h(this,g).viewportSize-h(this,L),n=zt.clamp(h(this,g).currentScrollValue+e,h(this,W)-h(this,g).viewportSize-s,h(this,W)+h(this,L)+s);h(this,g).vertical?h(this,S).style.transform=`translate3d(0px, ${n*-1}px, 0px)`:h(this,S).style.transform=`translate3d(${n*-1}px, 0px, 0px)`}}S=new WeakMap,g=new WeakMap,L=new WeakMap,W=new WeakMap;const Kt=Ot.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},':host([hibernated="true"])':{display:"contents"},".static":{position:"absolute",top:"0",left:"0",zIndex:"1",width:"100%",height:"100%"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)"},':host([hibernated="true"]) .content':{display:"contents"},"::slotted(*)":{flexShrink:"0"}});exports.ScrollElement=class extends wt.CustomElement{constructor(e){if(super(),l(this,N),l(this,F),l(this,mt),l(this,bt),l(this,it),l(this,rt),l(this,St),l(this,ht),l(this,a,null),l(this,M,new x.Attribute(this,"axis","y")),l(this,T,new x.Attribute(this,"pages",0,{validate:s=>Math.max(0,s-1)})),l(this,q,new x.Attribute(this,"split",!1)),l(this,D,new x.Attribute(this,"sectional",!1)),l(this,X,new x.Attribute(this,"wheel-max-delta",!1)),l(this,y,new x.Attribute(this,"infinite",!1)),l(this,Y,new x.Attribute(this,"damping",.03)),l(this,j,new x.Attribute(this,"disabled",!1)),l(this,tt,new x.Attribute(this,"hibernated",!1)),l(this,u,null),l(this,dt,null),l(this,c,[]),l(this,et,0),l(this,st,0),l(this,_,0),l(this,p,0),l(this,k,null),l(this,H,null),l(this,b,new Tt.Store(0)),l(this,G,0),l(this,R,0),l(this,P,()=>{const s=this.currentScrollValue/t(this,p);if(m(this,et,this.vertical?V.getCumulativeOffsetTop(this):V.getCumulativeOffsetLeft(this)),m(this,st,this.vertical?V.getCumulativeOffsetTop(t(this,u)):V.getCumulativeOffsetLeft(t(this,u))),m(this,_,this.vertical?this.offsetHeight:this.offsetWidth),t(this,T).current){m(this,p,t(this,_)*t(this,T).current);const n=t(this,p)+t(this,_);this.vertical?(t(this,u).style.width=n+"px",t(this,u).style.height="100%"):(t(this,u).style.height=n+"px",t(this,u).style.width="100%")}else this.vertical?(t(this,u).style.width="100%",t(this,u).style.height="max-content",m(this,p,t(this,u).offsetHeight-t(this,_))):(t(this,u).style.width="max-content",t(this,u).style.height="100%",m(this,p,t(this,u).offsetWidth-t(this,_)));if(!t(this,y).current){const n=getComputedStyle(this);m(this,p,t(this,p)+(this.vertical?parseFloat(n.paddingBlockStart)+parseFloat(n.paddingBlockEnd):parseFloat(n.paddingInlineStart)+parseFloat(n.paddingInlineEnd))),t(this,a).max.current=t(this,p)}if(t(this,c).forEach(n=>{n.resize(),n.transform()}),t(this,y).current&&t(this,c).length){const n=t(this,c)[t(this,c).length-1],r=n.position+n.size-t(this,_),d=t(this,p)-r;m(this,R,n.position+n.size+d)}else m(this,R,t(this,p));if(t(this,D).current&&t(this,c).length){const n=t(this,c)[t(this,b).current];t(this,a).set(n.position,!0)}else t(this,a).set(s*t(this,p),!0)}),l(this,gt,()=>{const s=this.currentScrollValue;if(m(this,G,Math.max(0,s-t(this,p))),t(this,c).length){let n=0;for(let r=0;r<t(this,c).length;r++){const d=t(this,c)[r];d.transform(),this.targetScrollValue+this.viewportSize/2>=d.position&&(n=r)}t(this,b).current=n}else this.vertical?t(this,u).style.transform=`translate3d(0px, ${s*-1}px, 0px)`:t(this,u).style.transform=`translate3d(${s*-1}px, 0px, 0px)`;I.scrollEntries.update(this,t(this,M).current,s)}),l(this,nt,s=>{if(typeof s=="number")if(t(this,D).current){const n=Math.sign(s);t(this,c).length?this.shiftSections(n):t(this,a).shift(n*t(this,_))}else t(this,a).shift(s);else s==="min"?t(this,a).set(t(this,a).min.current):s==="max"&&t(this,a).set(t(this,a).delta)}),At.isBrowser){let s,n=e||this.getAttribute("name");n&&(s={name:n}),m(this,a,new Vt.Damped({damping:.01,min:0,order:xt.TICK_ORDER.SCROLL,passport:s})),this.openShadow(Kt),Lt.element(this,{attributes:{tabIndex:0},shadowChildren:[B.div({class:"static",children:[B.slot({attributes:{name:"static"}})]}),B.div({class:"content",children:[B.slot({ref:r=>m(this,dt,r)})],style:{flexDirection:new Dt.Derived(t(this,M),r=>r==="x"?"row":"column")},ref:r=>m(this,u,r)})]}),m(this,k,new Mt.WheelControls({element:this})),t(this,k).changeEvent.subscribe(t(this,nt)),m(this,H,new Mt.KeyboardControls({element:this})),t(this,H).changeEvent.subscribe(t(this,nt)),t(this,M).subscribe(({current:r})=>{t(this,u).style.flexDirection=r==="x"?"row":"column",t(this,k).axis=t(this,X).current?"max":r,this.isConnected&&t(this,P).call(this)}),t(this,X).subscribe(r=>{t(this,k).axis=r.current?"max":t(this,M).current}),t(this,T).subscribe(()=>{this.isConnected&&t(this,P).call(this)}),t(this,q).subscribe(({current:r})=>{this.isConnected&&(r?f(this,N,ft).call(this):f(this,F,U).call(this))}),t(this,D).subscribe(r=>{t(this,b).current=0,t(this,k).debounce=r.current,t(this,a).reset(),this.isConnected&&(r.current&&!r.previous?f(this,N,ft).call(this):!r.current&&r.previous&&f(this,F,U).call(this))}),t(this,y).subscribe(r=>{r.current?(this.isConnected&&(t(this,c).length||(t(this,q).current=!0)),t(this,c).length&&(t(this,a).max.current=1/0,t(this,a).min.current=-1/0)):(m(this,G,0),t(this,a).max.current=t(this,p),t(this,a).min.current=0)}),t(this,Y).subscribe(r=>{t(this,a).damping=r.current}),t(this,j).subscribe(r=>{r.current&&!r.previous?f(this,mt,kt).call(this):!r.current&&r.previous&&f(this,bt,Wt).call(this)}),t(this,tt).subscribe(r=>{r.current&&!r.previous?f(this,it,vt).call(this):!r.current&&r.previous&&f(this,rt,_t).call(this)})}}get currentScrollValue(){return f(this,ht,Et).call(this,"current")}get targetScrollValue(){return f(this,ht,Et).call(this,"target")}get damped(){return t(this,a)}get dampedAttibute(){return t(this,a)}get axisAttibute(){return t(this,M)}get pagesAttibute(){return t(this,T)}get splitAttibute(){return t(this,q)}get sectionalAttibute(){return t(this,D)}get infiniteAttribute(){return t(this,y)}get dampingAttibute(){return t(this,Y)}get disabledAttibute(){return t(this,j)}get hibernatedAttibute(){return t(this,tt)}get contentElement(){return t(this,u)}get position(){return t(this,et)}get contentPosition(){return t(this,st)}get viewportSize(){return t(this,_)}get scrollSize(){return t(this,p)}get counter(){return t(this,b)}get distance(){return t(this,R)}get overscroll(){return t(this,G)}get vertical(){return t(this,M).current==="y"}get currentProgress(){return this.currentScrollValue/t(this,R)}get targetProgress(){return this.targetScrollValue/t(this,R)}scrollToSection(e,s="smooth"){if(!t(this,c).length)return;const n=t(this,b).current;f(this,St,Rt).call(this,e);const r=t(this,c)[n],d=t(this,c)[t(this,b).current];if(r&&d){let w=0;const Q=t(this,c).length-1;t(this,y).current?t(this,b).current===0&&n===Q?w=t(this,p)+t(this,_)-r.position:t(this,b).current===Q&&n===0?w=d.position-(t(this,p)+t(this,_)):w=d.position-r.position:w=d.position-r.position,t(this,a).shift(w,s==="instant")}}shiftSections(e,s="smooth"){t(this,c).length&&this.scrollToSection(t(this,b).current+e,s)}connectedCallback(){f(this,rt,_t).call(this)}disconnectedCallback(){f(this,it,vt).call(this)}};a=new WeakMap;M=new WeakMap;T=new WeakMap;q=new WeakMap;D=new WeakMap;X=new WeakMap;y=new WeakMap;Y=new WeakMap;j=new WeakMap;tt=new WeakMap;u=new WeakMap;dt=new WeakMap;c=new WeakMap;et=new WeakMap;st=new WeakMap;_=new WeakMap;p=new WeakMap;k=new WeakMap;H=new WeakMap;b=new WeakMap;G=new WeakMap;R=new WeakMap;N=new WeakSet;ft=function(){f(this,F,U).call(this),t(this,dt).assignedElements().forEach(i=>{i instanceof HTMLElement&&t(this,c).push(new Gt(i,this))}),t(this,u).style.transform="",t(this,P).call(this)};F=new WeakSet;U=function(){t(this,c).forEach(i=>{i.destroy()}),m(this,c,[])};mt=new WeakSet;kt=function(){t(this,a).unsubscribe(t(this,gt)),t(this,a).unlistenAnimationFrame(),t(this,k).disconnect(),t(this,H).disconnect()};bt=new WeakSet;Wt=function(){t(this,a).subscribe(t(this,gt)),t(this,k).connect(),t(this,H).connect()};it=new WeakSet;vt=function(){pt.windowResizer.unsubscribe(t(this,P)),t(this,a).reset(),f(this,mt,kt).call(this),t(this,u).style.transform="",t(this,q).current&&f(this,F,U).call(this),I.scrollEntries.unregister(this)};rt=new WeakSet;_t=function(){t(this,q).current&&f(this,N,ft).call(this),I.scrollEntries.register(this),pt.windowResizer.subscribe(t(this,P),xt.RESIZE_ORDER.SCROLL),f(this,bt,Wt).call(this)};P=new WeakMap;gt=new WeakMap;St=new WeakSet;Rt=function(i){t(this,y).current?(t(this,b).current=i%t(this,c).length,t(this,b).current=t(this,b).current<0?t(this,c).length+t(this,b).current:t(this,b).current):t(this,b).current=zt.clamp(i,0,t(this,c).length-1)};nt=new WeakMap;ht=new WeakSet;Et=function(i="current"){if(t(this,y).current&&t(this,c).length){const e=t(this,a)[i]%(t(this,p)+t(this,_));return e<0?t(this,p)+e+t(this,_):e}else return t(this,a)[i]};exports.ScrollElement=Bt([wt.define("e-scroll")],exports.ScrollElement);var J;class Zt extends wt.CustomElement{constructor(){super(...arguments);$(this,J,null)}get scrollElement(){return h(this,J)}connectedCallback(){const s=It.findParentElement(this,exports.ScrollElement);s instanceof exports.ScrollElement?O(this,J,s):console.error(this,"e-scroll not found")}}J=new WeakMap;var Nt=Object.defineProperty,Ut=Object.getOwnPropertyDescriptor,Jt=(i,e,s,n)=>{for(var r=n>1?void 0:n?Ut(e,s):e,d=i.length-1,w;d>=0;d--)(w=i[d])&&(r=(n?w(e,s,r):w(r))||r);return n&&r&&Nt(e,s,r),r},qt=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},o=(i,e,s)=>(qt(i,e,"read from private field"),s?s.call(i):e.get(i)),E=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},C=(i,e,s,n)=>(qt(i,e,"write to private field"),n?n.call(i,s):e.set(i,s),s),lt,v,A,z,K,Z,ot,at,ct,ut;const Qt=Ot.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#efefef"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"#181818",borderRadius:"1vmin",touchAction:"none"},"::slotted(*)":{touchAction:"none"}});exports.ScrollbarElement=class extends Zt{constructor(){super(),E(this,lt,null),E(this,v,null),E(this,A,!1),E(this,z,0),E(this,K,0),E(this,Z,0),E(this,ot,()=>{C(this,A,this.offsetWidth>this.offsetHeight);const e=o(this,A)?this.offsetWidth:this.offsetHeight;C(this,z,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),C(this,z,Math.max(o(this,z),30)),o(this,A)?(o(this,v).style.width=o(this,z)+"px",o(this,v).style.height="100%"):(o(this,v).style.width="100%",o(this,v).style.height=o(this,z)+"px"),C(this,K,e-o(this,z)),this.scrollElement.scrollSize||(this.style.display="none")}),E(this,at,()=>{C(this,Z,this.scrollElement.currentProgress*o(this,K)),o(this,A)?o(this,v).style.transform=`translate3d(${o(this,Z)}px, 0px, 0px)`:o(this,v).style.transform=`translate3d(0px, ${o(this,Z)}px, 0px)`}),E(this,ct,()=>{this.setAttribute("axis",this.scrollElement.axisAttibute.current)}),E(this,ut,e=>{const s=w=>{const Q=o(this,A)?w.x:w.y,Pt=this.scrollElement.distance/o(this,K),$t=(Q-d)*Pt;this.scrollElement.damped.set(r+$t)},n=()=>{removeEventListener("pointermove",s),removeEventListener("pointerup",n),removeEventListener("touchend",n)};addEventListener("pointermove",s),addEventListener("pointerup",n),addEventListener("touchend",n);const r=this.scrollElement.damped.target,d=o(this,A)?e.x:e.y}),At.isBrowser&&(this.openShadow(Qt),Lt.element(this,{shadowChildren:[B.slot({ref:e=>C(this,lt,e)})]}))}get thumbElement(){return o(this,v)}connectedCallback(){super.connectedCallback();const e=o(this,lt).assignedElements()[0];e instanceof HTMLElement?C(this,v,e):(C(this,v,document.createElement("div")),o(this,v).classList.add("default-thumb"),this.shadowRoot.appendChild(o(this,v))),o(this,v).addEventListener("pointerdown",o(this,ut)),pt.windowResizer.subscribe(o(this,ot),xt.RESIZE_ORDER.SCROLL+1),this.scrollElement.damped.subscribe(o(this,at)),this.scrollElement.axisAttibute.subscribe(o(this,ct))}disconnectedCallback(){o(this,v).removeEventListener("pointerdown",o(this,ut)),pt.windowResizer.unsubscribe(o(this,ot)),this.scrollElement.damped.unsubscribe(o(this,at)),this.scrollElement.axisAttibute.unsubscribe(o(this,ct))}};lt=new WeakMap;v=new WeakMap;A=new WeakMap;z=new WeakMap;K=new WeakMap;Z=new WeakMap;ot=new WeakMap;at=new WeakMap;ct=new WeakMap;ut=new WeakMap;exports.ScrollbarElement=Jt([wt.define("e-scrollbar")],exports.ScrollbarElement);
|
|
1
|
+
"use strict";var Ct=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)};var h=(i,e,s)=>(Ct(i,e,"read from private field"),s?s.call(i):e.get(i)),D=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},O=(i,e,s,n)=>(Ct(i,e,"write to private field"),n?n.call(i,s):e.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const qt=require("../Store-D0_rDIsE.cjs"),Dt=require("../Derived-SjPdLJiZ.cjs"),At=require("../browser-CpzFX2xg.cjs"),I=require("../layout-8ryRAMGJ.cjs"),zt=require("../math-GDWEqu7y.cjs");require("../ticker/index.cjs");const Tt=require("../Damped-BwpMU9Gi.cjs"),x=require("../attribute/index.cjs"),Mt=require("../WheelControls-CfDeGCOU.cjs"),wt=require("../custom-element/index.cjs"),xt=require("../order/index.cjs"),pt=require("../window-resizer/index.cjs"),H=require("../scroll-entries/index.cjs"),P=require("../tags-DkAbVUQP.cjs"),Lt=require("../createStylesheet-C1rimcGc.cjs"),Vt=require("../dom-qY2LdCVL.cjs");var It=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,Ft=(i,e,s,n)=>{for(var r=n>1?void 0:n?Ht(e,s):e,d=i.length-1,w;d>=0;d--)(w=i[d])&&(r=(n?w(e,s,r):w(r))||r);return n&&r&&It(e,s,r),r},yt=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},t=(i,e,s)=>(yt(i,e,"read from private field"),s?s.call(i):e.get(i)),l=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},m=(i,e,s,n)=>(yt(i,e,"write to private field"),n?n.call(i,s):e.set(i,s),s),f=(i,e,s)=>(yt(i,e,"access private method"),s),a,M,T,$,V,X,y,Y,j,tt,u,dt,c,et,st,_,p,k,F,b,G,R,N,ft,B,U,mt,kt,bt,Wt,it,vt,rt,_t,q,gt,St,Ot,nt,ht,Et,S,g,L,W;class Bt{constructor(e,s){D(this,S,void 0);D(this,g,void 0);D(this,L,0);D(this,W,0);O(this,S,e),O(this,g,s),H.scrollEntries.register(h(this,S))}get size(){return h(this,L)}get position(){return h(this,W)}destroy(){H.scrollEntries.unregister(h(this,S)),h(this,S).style.transform=""}resize(){O(this,L,h(this,g).vertical?h(this,S).offsetHeight:h(this,S).offsetWidth),O(this,W,h(this,g).vertical?I.getCumulativeOffsetTop(h(this,S)):I.getCumulativeOffsetLeft(h(this,S))),O(this,W,h(this,W)-h(this,g).contentPosition)}transform(){let e=0;h(this,g).infiniteAttribute.current&&h(this,g).overscroll&&h(this,W)+h(this,L)<h(this,g).currentScrollValue&&(e=h(this,g).distance*-1),H.scrollEntries.update(h(this,S),h(this,g).axisAttibute.current,e);const s=h(this,g).viewportSize-h(this,L),n=zt.clamp(h(this,g).currentScrollValue+e,h(this,W)-h(this,g).viewportSize-s,h(this,W)+h(this,L)+s);h(this,g).vertical?h(this,S).style.transform=`translate3d(0px, ${n*-1}px, 0px)`:h(this,S).style.transform=`translate3d(${n*-1}px, 0px, 0px)`}}S=new WeakMap,g=new WeakMap,L=new WeakMap,W=new WeakMap;const Gt=Lt.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},':host([hibernated="true"])':{display:"contents"},".static":{position:"absolute",top:"0",left:"0",zIndex:"1",width:"100%",height:"100%"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)"},':host([hibernated="true"]) .content':{display:"contents"},"::slotted(*)":{flexShrink:"0"}});exports.ScrollElement=class extends wt.CustomElement{constructor(e){if(super(),l(this,N),l(this,B),l(this,mt),l(this,bt),l(this,it),l(this,rt),l(this,St),l(this,ht),l(this,a,null),l(this,M,new x.Attribute(this,"axis","y")),l(this,T,new x.Attribute(this,"pages",0,{validate:s=>Math.max(0,s-1)})),l(this,$,new x.Attribute(this,"split",!1)),l(this,V,new x.Attribute(this,"sectional",!1)),l(this,X,new x.Attribute(this,"wheel-max-delta",!1)),l(this,y,new x.Attribute(this,"infinite",!1)),l(this,Y,new x.Attribute(this,"damping",.03)),l(this,j,new x.Attribute(this,"disabled",!1)),l(this,tt,new x.Attribute(this,"hibernated",!1)),l(this,u,null),l(this,dt,null),l(this,c,[]),l(this,et,0),l(this,st,0),l(this,_,0),l(this,p,0),l(this,k,null),l(this,F,null),l(this,b,new qt.Store(0)),l(this,G,0),l(this,R,0),l(this,q,()=>{const s=this.currentScrollValue/t(this,p);if(m(this,et,this.vertical?I.getCumulativeOffsetTop(this):I.getCumulativeOffsetLeft(this)),m(this,st,this.vertical?I.getCumulativeOffsetTop(t(this,u)):I.getCumulativeOffsetLeft(t(this,u))),m(this,_,this.vertical?this.offsetHeight:this.offsetWidth),t(this,T).current){m(this,p,t(this,_)*t(this,T).current);const n=t(this,p)+t(this,_);this.vertical?(t(this,u).style.width=n+"px",t(this,u).style.height="100%"):(t(this,u).style.height=n+"px",t(this,u).style.width="100%")}else this.vertical?(t(this,u).style.width="100%",t(this,u).style.height="max-content",m(this,p,t(this,u).offsetHeight-t(this,_))):(t(this,u).style.width="max-content",t(this,u).style.height="100%",m(this,p,t(this,u).offsetWidth-t(this,_)));if(!t(this,y).current){const n=getComputedStyle(this);m(this,p,t(this,p)+(this.vertical?parseFloat(n.paddingBlockStart)+parseFloat(n.paddingBlockEnd):parseFloat(n.paddingInlineStart)+parseFloat(n.paddingInlineEnd))),t(this,a).max.current=t(this,p)}if(t(this,c).forEach(n=>{n.resize(),n.transform()}),t(this,y).current&&t(this,c).length){const n=t(this,c)[t(this,c).length-1],r=n.position+n.size-t(this,_),d=t(this,p)-r;m(this,R,n.position+n.size+d)}else m(this,R,t(this,p));if(t(this,V).current&&t(this,c).length){const n=t(this,c)[t(this,b).current];t(this,a).set(n.position,!0)}else t(this,a).set(s*t(this,p),!0)}),l(this,gt,()=>{const s=this.currentScrollValue;if(m(this,G,Math.max(0,s-t(this,p))),t(this,c).length){let n=0;for(let r=0;r<t(this,c).length;r++){const d=t(this,c)[r];d.transform(),this.targetScrollValue+this.viewportSize/2>=d.position&&(n=r)}t(this,b).current=n}else this.vertical?t(this,u).style.transform=`translate3d(0px, ${s*-1}px, 0px)`:t(this,u).style.transform=`translate3d(${s*-1}px, 0px, 0px)`;H.scrollEntries.update(this,t(this,M).current,s)}),l(this,nt,s=>{if(typeof s=="number")if(t(this,V).current){const n=Math.sign(s);t(this,c).length?this.shiftSections(n):t(this,a).shift(n*t(this,_))}else t(this,a).shift(s);else s==="min"?t(this,a).set(t(this,a).min.current):s==="max"&&t(this,a).set(t(this,a).delta)}),At.isBrowser){let s,n=e||this.getAttribute("name");n&&(s={name:n}),m(this,a,new Tt.Damped({damping:.01,min:0,order:xt.TICK_ORDER.SCROLL,passport:s})),this.openShadow(Gt),P.element(this,{attributes:{tabIndex:0},shadowChildren:[P.div({class:"static",children:[P.slot({attributes:{name:"static"}})]}),P.div({class:"content",children:[P.slot({ref:r=>m(this,dt,r)})],style:{flexDirection:new Dt.Derived(t(this,M),r=>r==="x"?"row":"column")},ref:r=>m(this,u,r)})]}),m(this,k,new Mt.WheelControls({element:this})),t(this,k).changeEvent.subscribe(t(this,nt)),m(this,F,new Mt.KeyboardControls({element:this})),t(this,F).changeEvent.subscribe(t(this,nt)),t(this,M).subscribe(({current:r})=>{t(this,u).style.flexDirection=r==="x"?"row":"column",t(this,k).axis=t(this,X).current?"max":r,this.isConnected&&t(this,q).call(this)}),t(this,X).subscribe(r=>{t(this,k).axis=r.current?"max":t(this,M).current}),t(this,T).subscribe(()=>{this.isConnected&&t(this,q).call(this)}),t(this,$).subscribe(({current:r})=>{this.isConnected&&(r?f(this,N,ft).call(this):f(this,B,U).call(this))}),t(this,V).subscribe(r=>{t(this,b).current=0,t(this,k).debounce=r.current,t(this,a).reset(),this.isConnected&&(r.current&&!r.previous?f(this,N,ft).call(this):!r.current&&r.previous&&f(this,B,U).call(this))}),t(this,y).subscribe(r=>{r.current?(this.isConnected&&(t(this,c).length||(t(this,$).current=!0)),t(this,c).length&&(t(this,a).max.current=1/0,t(this,a).min.current=-1/0)):(m(this,G,0),t(this,a).max.current=t(this,p),t(this,a).min.current=0)}),t(this,Y).subscribe(r=>{t(this,a).damping=r.current}),t(this,j).subscribe(r=>{r.current&&!r.previous?f(this,mt,kt).call(this):!r.current&&r.previous&&f(this,bt,Wt).call(this)}),t(this,tt).subscribe(r=>{r.current&&!r.previous?f(this,it,vt).call(this):!r.current&&r.previous&&f(this,rt,_t).call(this)})}}get currentScrollValue(){return f(this,ht,Et).call(this,"current")}get targetScrollValue(){return f(this,ht,Et).call(this,"target")}get damped(){return t(this,a)}get dampedAttibute(){return t(this,a)}get axisAttibute(){return t(this,M)}get pagesAttibute(){return t(this,T)}get splitAttibute(){return t(this,$)}get sectionalAttibute(){return t(this,V)}get infiniteAttribute(){return t(this,y)}get dampingAttibute(){return t(this,Y)}get disabledAttibute(){return t(this,j)}get hibernatedAttibute(){return t(this,tt)}get contentElement(){return t(this,u)}get position(){return t(this,et)}get contentPosition(){return t(this,st)}get viewportSize(){return t(this,_)}get scrollSize(){return t(this,p)}get counter(){return t(this,b)}get distance(){return t(this,R)}get overscroll(){return t(this,G)}get vertical(){return t(this,M).current==="y"}get currentProgress(){return this.currentScrollValue/t(this,R)}get targetProgress(){return this.targetScrollValue/t(this,R)}scrollToSection(e,s="smooth"){if(!t(this,c).length)return;const n=t(this,b).current;f(this,St,Ot).call(this,e);const r=t(this,c)[n],d=t(this,c)[t(this,b).current];if(r&&d){let w=0;const Q=t(this,c).length-1;t(this,y).current?t(this,b).current===0&&n===Q?w=t(this,p)+t(this,_)-r.position:t(this,b).current===Q&&n===0?w=d.position-(t(this,p)+t(this,_)):w=d.position-r.position:w=d.position-r.position,t(this,a).shift(w,s==="instant")}}shiftSections(e,s="smooth"){t(this,c).length&&this.scrollToSection(t(this,b).current+e,s)}connectedCallback(){f(this,rt,_t).call(this)}disconnectedCallback(){f(this,it,vt).call(this)}};a=new WeakMap;M=new WeakMap;T=new WeakMap;$=new WeakMap;V=new WeakMap;X=new WeakMap;y=new WeakMap;Y=new WeakMap;j=new WeakMap;tt=new WeakMap;u=new WeakMap;dt=new WeakMap;c=new WeakMap;et=new WeakMap;st=new WeakMap;_=new WeakMap;p=new WeakMap;k=new WeakMap;F=new WeakMap;b=new WeakMap;G=new WeakMap;R=new WeakMap;N=new WeakSet;ft=function(){f(this,B,U).call(this),t(this,dt).assignedElements().forEach(i=>{i instanceof HTMLElement&&t(this,c).push(new Bt(i,this))}),t(this,u).style.transform="",t(this,q).call(this)};B=new WeakSet;U=function(){t(this,c).forEach(i=>{i.destroy()}),m(this,c,[])};mt=new WeakSet;kt=function(){t(this,a).unsubscribe(t(this,gt)),t(this,a).unlistenAnimationFrame(),t(this,k).disconnect(),t(this,F).disconnect()};bt=new WeakSet;Wt=function(){t(this,a).subscribe(t(this,gt)),t(this,k).connect(),t(this,F).connect()};it=new WeakSet;vt=function(){pt.windowResizer.unsubscribe(t(this,q)),t(this,a).reset(),f(this,mt,kt).call(this),t(this,u).style.transform="",t(this,$).current&&f(this,B,U).call(this),H.scrollEntries.unregister(this)};rt=new WeakSet;_t=function(){t(this,$).current&&f(this,N,ft).call(this),H.scrollEntries.register(this),pt.windowResizer.subscribe(t(this,q),xt.RESIZE_ORDER.SCROLL),f(this,bt,Wt).call(this)};q=new WeakMap;gt=new WeakMap;St=new WeakSet;Ot=function(i){t(this,y).current?(t(this,b).current=i%t(this,c).length,t(this,b).current=t(this,b).current<0?t(this,c).length+t(this,b).current:t(this,b).current):t(this,b).current=zt.clamp(i,0,t(this,c).length-1)};nt=new WeakMap;ht=new WeakSet;Et=function(i="current"){if(t(this,y).current&&t(this,c).length){const e=t(this,a)[i]%(t(this,p)+t(this,_));return e<0?t(this,p)+e+t(this,_):e}else return t(this,a)[i]};exports.ScrollElement=Ft([wt.define("e-scroll")],exports.ScrollElement);var J;class Kt extends wt.CustomElement{constructor(){super(...arguments);D(this,J,null)}get scrollElement(){return h(this,J)}connectedCallback(){const s=Vt.findParentElement(this,exports.ScrollElement);s instanceof exports.ScrollElement?O(this,J,s):console.error(this,"e-scroll not found")}}J=new WeakMap;var Zt=Object.defineProperty,Nt=Object.getOwnPropertyDescriptor,Ut=(i,e,s,n)=>{for(var r=n>1?void 0:n?Nt(e,s):e,d=i.length-1,w;d>=0;d--)(w=i[d])&&(r=(n?w(e,s,r):w(r))||r);return n&&r&&Zt(e,s,r),r},Rt=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},o=(i,e,s)=>(Rt(i,e,"read from private field"),s?s.call(i):e.get(i)),E=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},C=(i,e,s,n)=>(Rt(i,e,"write to private field"),n?n.call(i,s):e.set(i,s),s),lt,v,A,z,K,Z,ot,at,ct,ut;const Jt=Lt.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#efefef"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"#181818",borderRadius:"1vmin",touchAction:"none"},"::slotted(*)":{touchAction:"none"}});exports.ScrollbarElement=class extends Kt{constructor(){super(),E(this,lt,null),E(this,v,null),E(this,A,!1),E(this,z,0),E(this,K,0),E(this,Z,0),E(this,ot,()=>{C(this,A,this.offsetWidth>this.offsetHeight);const e=o(this,A)?this.offsetWidth:this.offsetHeight;C(this,z,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),C(this,z,Math.max(o(this,z),30)),o(this,A)?(o(this,v).style.width=o(this,z)+"px",o(this,v).style.height="100%"):(o(this,v).style.width="100%",o(this,v).style.height=o(this,z)+"px"),C(this,K,e-o(this,z)),this.scrollElement.scrollSize||(this.style.display="none")}),E(this,at,()=>{C(this,Z,this.scrollElement.currentProgress*o(this,K)),o(this,A)?o(this,v).style.transform=`translate3d(${o(this,Z)}px, 0px, 0px)`:o(this,v).style.transform=`translate3d(0px, ${o(this,Z)}px, 0px)`}),E(this,ct,()=>{this.setAttribute("axis",this.scrollElement.axisAttibute.current)}),E(this,ut,e=>{const s=w=>{const Q=o(this,A)?w.x:w.y,Pt=this.scrollElement.distance/o(this,K),$t=(Q-d)*Pt;this.scrollElement.damped.set(r+$t)},n=()=>{removeEventListener("pointermove",s),removeEventListener("pointerup",n),removeEventListener("touchend",n)};addEventListener("pointermove",s),addEventListener("pointerup",n),addEventListener("touchend",n);const r=this.scrollElement.damped.target,d=o(this,A)?e.x:e.y}),At.isBrowser&&(this.openShadow(Jt),P.element(this,{shadowChildren:[P.slot({ref:e=>C(this,lt,e)})]}))}get thumbElement(){return o(this,v)}connectedCallback(){super.connectedCallback();const e=o(this,lt).assignedElements()[0];e instanceof HTMLElement?C(this,v,e):(C(this,v,document.createElement("div")),o(this,v).classList.add("default-thumb"),this.shadowRoot.appendChild(o(this,v))),o(this,v).addEventListener("pointerdown",o(this,ut)),pt.windowResizer.subscribe(o(this,ot),xt.RESIZE_ORDER.SCROLL+1),this.scrollElement.damped.subscribe(o(this,at)),this.scrollElement.axisAttibute.subscribe(o(this,ct))}disconnectedCallback(){o(this,v).removeEventListener("pointerdown",o(this,ut)),pt.windowResizer.unsubscribe(o(this,ot)),this.scrollElement.damped.unsubscribe(o(this,at)),this.scrollElement.axisAttibute.unsubscribe(o(this,ct))}};lt=new WeakMap;v=new WeakMap;A=new WeakMap;z=new WeakMap;K=new WeakMap;Z=new WeakMap;ot=new WeakMap;at=new WeakMap;ct=new WeakMap;ut=new WeakMap;exports.ScrollbarElement=Ut([wt.define("e-scrollbar")],exports.ScrollbarElement);
|