aptechka 0.83.1 → 0.84.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/Animation-BAiM6_n1.js +111 -0
- package/lib/Animation-DMWabSR0.cjs +1 -0
- package/lib/Composed-B0fvCtZz.cjs +1 -0
- package/lib/Composed-CgA9lLWA.js +75 -0
- package/lib/Damped-BLo-OAVb.cjs +1 -0
- package/lib/Damped-Dcz5UdMH.js +57 -0
- package/lib/DerivedArray-DFhxap_z.js +63 -0
- package/lib/DerivedArray-DYtWMW0n.cjs +1 -0
- package/lib/DragControls-BPHsDeH6.cjs +1 -0
- package/lib/DragControls-D2a1Cifp.js +234 -0
- package/lib/LocalLinks-BWFJYhGX.cjs +1 -0
- package/lib/LocalLinks-Dwgf3No6.js +65 -0
- package/lib/PageAnnouncerElement-DPMlVJZG.cjs +1 -0
- package/lib/PageAnnouncerElement-DV9pm_od.js +28 -0
- package/lib/PageScroll-BAatKJx6.cjs +1 -0
- package/lib/PageScroll-m3TsHnzR.js +65 -0
- package/lib/SourceElement-941MrYpq.js +265 -0
- package/lib/SourceElement-DBLZ7b5k.cjs +5 -0
- package/lib/Store-BCW70G3Z.cjs +1 -0
- package/lib/Store-uLDYY9ed.js +158 -0
- package/lib/Tweened-BvtjLCa3.js +48 -0
- package/lib/Tweened-DdXm1dbF.cjs +1 -0
- package/lib/Viewport-BiDoiU8M.js +113 -0
- package/lib/Viewport-CXGKUyDy.cjs +1 -0
- package/lib/accordion/index.cjs +1 -1
- package/lib/accordion/index.js +97 -93
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +6 -6
- package/lib/api-fetcher/index.cjs +1 -1
- package/lib/api-fetcher/index.js +67 -66
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.js +37 -34
- package/lib/attributes-BADnRZpK.cjs +1 -0
- package/lib/attributes-FObgMNCf.js +36 -0
- package/lib/billboard/index.cjs +1 -1
- package/lib/billboard/index.js +240 -232
- package/lib/cache/index.cjs +1 -1
- package/lib/cache/index.js +26 -23
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +62 -59
- package/lib/canvas-BP1ceie3.cjs +1 -0
- package/lib/canvas-DsglKco1.js +40 -0
- package/lib/connector/index.cjs +1 -1
- package/lib/connector/index.js +44 -41
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +6 -6
- package/lib/coordinates--JG1U6kQ.js +29 -0
- package/lib/coordinates-DQ9XV9M1.cjs +1 -0
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.d.ts +1 -1
- package/lib/css-property/index.js +40 -37
- package/lib/css-unit-parser/index.cjs +2 -2
- package/lib/css-unit-parser/index.js +22 -19
- package/lib/css-value-parser/index.cjs +1 -1
- package/lib/css-value-parser/index.js +13 -11
- package/lib/custom-elements-BfZCJde6.cjs +1 -0
- package/lib/custom-elements-HEMuF7yH.js +27 -0
- package/lib/dev/index.cjs +2 -1
- package/lib/dev/index.d.ts +1 -0
- package/lib/dev/index.js +25 -10
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +5 -5
- package/lib/dom-B40i6NXw.cjs +1 -0
- package/lib/dom-D8D-_9ty.js +108 -0
- package/lib/easings-BSGJFMAo.js +40 -0
- package/lib/easings-BWq0pPLq.cjs +1 -0
- package/lib/element-CqD0jqBJ.cjs +1 -0
- package/lib/element-DKw5H-Tu.js +10 -0
- package/lib/element-linked-store/index.cjs +1 -1
- package/lib/element-linked-store/index.js +53 -52
- package/lib/element-resizer/index.cjs +1 -1
- package/lib/element-resizer/index.js +47 -44
- package/lib/en3/index.cjs +4 -4
- package/lib/en3/index.js +192 -185
- package/lib/events-Ds-TuvYW.js +9 -0
- package/lib/events-UlGk63iC.cjs +1 -0
- package/lib/file-DwQs6bB6.js +28 -0
- package/lib/file-RHfA3OS-.cjs +1 -0
- package/lib/function-H4b_gTg6.cjs +1 -0
- package/lib/function-UmbPrOHm.js +19 -0
- package/lib/gestures-DmKKNnh4.js +14 -0
- package/lib/gestures-DtYbQr49.cjs +1 -0
- package/lib/history/index.cjs +1 -1
- package/lib/history/index.js +24 -21
- package/lib/iframe/index.cjs +1 -1
- package/lib/iframe/index.js +27 -24
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +17 -13
- package/lib/index-BpO2RJ__.cjs +1 -0
- package/lib/index-DpKsHe97.js +68 -0
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.js +3 -3
- package/lib/jsx/ComponentElement.d.ts +4 -0
- package/lib/jsx/h.d.ts +7 -16
- package/lib/jsx/hooks/component/useStylesheet.d.ts +1 -1
- package/lib/jsx/hooks/cssProperty.d.ts +6 -0
- package/lib/jsx/hooks/resize.d.ts +4 -0
- package/lib/jsx/hooks/store.d.ts +1 -2
- package/lib/jsx/hooks/ticker.d.ts +5 -0
- package/lib/jsx/index.cjs +1 -1
- package/lib/jsx/index.d.ts +4 -4
- package/lib/jsx/index.js +171 -349
- package/lib/jsx/plugins/vite/index.cjs +49 -0
- package/lib/jsx/plugins/vite/index.d.ts +38 -0
- package/lib/jsx/plugins/vite/index.js +104 -0
- package/lib/jsx/render.d.ts +2 -0
- package/lib/jsx/type.d.ts +228 -190
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +86 -84
- package/lib/layout-C26zkY7D.js +35 -0
- package/lib/layout-CnGLl7oe.cjs +1 -0
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.js +221 -217
- package/lib/loading/index.cjs +1 -1
- package/lib/loading/index.js +48 -45
- package/lib/local-links/index.cjs +1 -1
- package/lib/local-links/index.js +2 -2
- package/lib/masonry-layout/index.cjs +1 -1
- package/lib/masonry-layout/index.js +48 -45
- package/lib/math-C-knY2TL.cjs +1 -0
- package/lib/math-r8V23YFe.js +57 -0
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +28 -25
- package/lib/metadata-BNdkmeeD.js +15 -0
- package/lib/metadata-BrHUfpV9.cjs +1 -0
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +561 -556
- package/lib/morph-BtgB1YQP.js +256 -0
- package/lib/morph-Buhxq-X0.cjs +1 -0
- package/lib/need_redo_tweaker/index.cjs +4 -4
- package/lib/need_redo_tweaker/index.js +862 -834
- package/lib/notifier/index.cjs +1 -1
- package/lib/notifier/index.js +29 -26
- package/lib/number-Bu4sGvW7.cjs +1 -0
- package/lib/number-DiVt2xnh.js +47 -0
- package/lib/object-CiIdEmJx.js +98 -0
- package/lib/object-DTY_W6xG.cjs +1 -0
- package/lib/order/index.cjs +1 -1
- package/lib/order/index.js +3 -3
- package/lib/page-announcer/index.cjs +1 -1
- package/lib/page-announcer/index.js +2 -2
- package/lib/page-scroll/index.cjs +1 -1
- package/lib/page-scroll/index.js +2 -2
- package/lib/pixel-perfect/index.cjs +4 -4
- package/lib/pixel-perfect/index.js +43 -40
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +125 -122
- package/lib/polyfills-CG1XJNia.js +28 -0
- package/lib/polyfills-DZCuDBkA.cjs +1 -0
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +249 -245
- package/lib/radio/index.cjs +1 -1
- package/lib/radio/index.js +58 -55
- package/lib/render-DLcWVnuH.js +355 -0
- package/lib/render-DdomypCo.cjs +1 -0
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +196 -194
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +890 -877
- package/lib/scroll-BvIWh1xB.js +41 -0
- package/lib/scroll-CT0lpyRZ.cjs +1 -0
- package/lib/scroll-entries/index.cjs +1 -1
- package/lib/scroll-entries/index.js +37 -34
- package/lib/scroll-kit/index.cjs +1 -1
- package/lib/scroll-kit/index.js +214 -209
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +102 -98
- package/lib/size-element/index.cjs +1 -1
- package/lib/size-element/index.js +29 -26
- package/lib/slicer/index.cjs +1 -1
- package/lib/slicer/index.js +118 -113
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +5 -5
- package/lib/spa/index.cjs +1 -1
- package/lib/spa/index.js +94 -94
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.d.ts +2 -2
- package/lib/store/index.js +10 -8
- package/lib/string-B3lm2b7v.js +84 -0
- package/lib/string-CbRNzmd9.cjs +1 -0
- package/lib/style-DBoQWK0d.js +14 -0
- package/lib/style-IDJ6db6n.cjs +1 -0
- package/lib/stylesheet-CHvuef16.js +28 -0
- package/lib/stylesheet-CQdBaIAA.cjs +1 -0
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.js +96 -92
- package/lib/url-CPCO10Sy.cjs +1 -0
- package/lib/url-CWCY_qe_.js +124 -0
- package/lib/utils/attributes.d.ts +2 -0
- package/lib/utils/dom.d.ts +1 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +245 -226
- package/lib/utils/polyfills.d.ts +1 -1
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +36 -33
- package/lib/window-resizer/index.cjs +1 -1
- package/lib/window-resizer/index.js +27 -24
- package/lib/youtube/index.cjs +1 -1
- package/lib/youtube/index.js +56 -54
- package/package.json +11 -24
- package/lib/Animation-BzTjZIE-.js +0 -108
- package/lib/Animation-C39Ah-LM.cjs +0 -1
- package/lib/Composed-C-TV9te3.cjs +0 -1
- package/lib/Composed-DyAWjEXE.js +0 -121
- package/lib/Damped-CRusiRIV.js +0 -56
- package/lib/Damped-Prr0iKu1.cjs +0 -1
- package/lib/DragControls-8rNZwQrs.cjs +0 -1
- package/lib/DragControls-DBNdMBA4.js +0 -228
- package/lib/LocalLinks-BxhSFv_Q.cjs +0 -1
- package/lib/LocalLinks-DFZFpbjs.js +0 -62
- package/lib/PageAnnouncerElement-0LxZjtVH.js +0 -24
- package/lib/PageAnnouncerElement-AQ0Ja6HM.cjs +0 -1
- package/lib/PageScroll-0LxFblry.js +0 -62
- package/lib/PageScroll-BXJUQwG7.cjs +0 -1
- package/lib/SourceElement-BHqPFbna.cjs +0 -5
- package/lib/SourceElement-DjbHjynf.js +0 -260
- package/lib/Store-Blf4msDz.cjs +0 -1
- package/lib/Store-ZThXYBQd.js +0 -152
- package/lib/Tweened-Bw1Cn1PJ.js +0 -47
- package/lib/Tweened-DWtk9E-O.cjs +0 -1
- package/lib/Viewport-BxCr0GlB.cjs +0 -1
- package/lib/Viewport-Dt-d9DPi.js +0 -109
- package/lib/attributes-69we3byR.js +0 -10
- package/lib/attributes-Bf2svn4j.cjs +0 -1
- package/lib/canvas-CU5Xjahf.cjs +0 -1
- package/lib/canvas-DeZ0SLUJ.js +0 -34
- package/lib/coordinates-CgdGoSYs.js +0 -24
- package/lib/coordinates-D8Np3cPD.cjs +0 -1
- package/lib/custom-elements-DBnCK7Zx.js +0 -24
- package/lib/custom-elements-Dh4TWRDJ.cjs +0 -1
- package/lib/dom-BETkVSSZ.js +0 -82
- package/lib/dom-CBLlqORw.cjs +0 -1
- package/lib/easings-BEmRlrDd.js +0 -38
- package/lib/easings-GegIwET5.cjs +0 -1
- package/lib/element-CGVl1jA-.js +0 -7
- package/lib/element-yhcBhsho.cjs +0 -1
- package/lib/events-CsVF98U6.js +0 -6
- package/lib/events-KVanG9sR.cjs +0 -1
- package/lib/file-DSpfWdd9.cjs +0 -1
- package/lib/file-GHShUlue.js +0 -24
- package/lib/function-C10DGppn.js +0 -17
- package/lib/function-MthRj-GJ.cjs +0 -1
- package/lib/gestures-C7gbKx11.cjs +0 -1
- package/lib/gestures-CcXV6fCp.js +0 -11
- package/lib/index-OE2INULi.cjs +0 -1
- package/lib/index-e9eDuagL.js +0 -65
- package/lib/jsx/hydrate.d.ts +0 -1
- package/lib/jsx/integrations/astro/client.cjs +0 -1
- package/lib/jsx/integrations/astro/client.d.ts +0 -2
- package/lib/jsx/integrations/astro/client.js +0 -50
- package/lib/jsx/integrations/astro/index.cjs +0 -1
- package/lib/jsx/integrations/astro/index.d.ts +0 -2
- package/lib/jsx/integrations/astro/index.js +0 -54
- package/lib/jsx/integrations/astro/server.cjs +0 -1
- package/lib/jsx/integrations/astro/server.d.ts +0 -3
- package/lib/jsx/integrations/astro/server.js +0 -35
- package/lib/jsx/plugins/vite.d.ts +0 -21
- package/lib/layout-BSMtwCga.js +0 -29
- package/lib/layout-Ctc2p3uz.cjs +0 -1
- package/lib/math-BOBiC4TN.js +0 -45
- package/lib/math-GDWEqu7y.cjs +0 -1
- package/lib/metadata-BcYZ5w3T.cjs +0 -1
- package/lib/metadata-jfowcCyz.js +0 -12
- package/lib/morph-B6sGhLCi.cjs +0 -1
- package/lib/morph-BQErz7qP.js +0 -242
- package/lib/number-ChAm68cm.cjs +0 -1
- package/lib/number-CumqY64S.js +0 -40
- package/lib/object-CcMK4y_r.js +0 -87
- package/lib/object-baN9pgbU.cjs +0 -1
- package/lib/polyfills-DJrTJQky.js +0 -24
- package/lib/polyfills-Df4r-ETT.cjs +0 -1
- package/lib/render-DQs7rIoN.cjs +0 -1
- package/lib/render-D_0FCWEu.js +0 -18
- package/lib/scroll-BA2WnUrb.cjs +0 -1
- package/lib/scroll-DY5senkF.js +0 -37
- package/lib/string-BlMQbe8b.js +0 -70
- package/lib/string-DUXXtU8v.cjs +0 -1
- package/lib/style-At6aDoqG.cjs +0 -1
- package/lib/style-j2TwriJ_.js +0 -10
- package/lib/stylesheet-5_o7PFzM.cjs +0 -1
- package/lib/stylesheet-DdBzowZY.js +0 -24
- package/lib/url-CHgcNwJ1.cjs +0 -1
- package/lib/url-CYgo5vrG.js +0 -113
- package/lib/vite-C-i3hVDL.js +0 -75
- package/lib/vite-DzanPumM.cjs +0 -44
package/lib/accordion/index.js
CHANGED
|
@@ -1,140 +1,144 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __typeError = (msg) => {
|
|
3
|
+
throw TypeError(msg);
|
|
3
4
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
6
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
7
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value), __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
8
|
+
import { Attribute } from "../attribute/index.js";
|
|
9
|
+
import { i as isBrowser } from "../index-DpKsHe97.js";
|
|
10
|
+
import { d as dispatchEvent } from "../events-Ds-TuvYW.js";
|
|
11
|
+
import { g as getElementTransitionDurationMS } from "../style-DBoQWK0d.js";
|
|
10
12
|
import "construct-style-sheets-polyfill";
|
|
11
|
-
var
|
|
12
|
-
class
|
|
13
|
-
constructor(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
});
|
|
27
|
-
|
|
13
|
+
var _accordionElement, _element, _headElement, _bodyElement, _activeTimeoutId, _opened, _AccordionItem_instances, scrollSize_get, _headClickListener, _windowResizeListener, setScrollSize_fn, skipTransition_fn, tryDispatchResizeEvent_fn;
|
|
14
|
+
const _AccordionItem = class _AccordionItem {
|
|
15
|
+
constructor(accordionElement, element) {
|
|
16
|
+
__privateAdd(this, _AccordionItem_instances);
|
|
17
|
+
__privateAdd(this, _accordionElement, null);
|
|
18
|
+
__privateAdd(this, _element, null);
|
|
19
|
+
__privateAdd(this, _headElement, null);
|
|
20
|
+
__privateAdd(this, _bodyElement, null);
|
|
21
|
+
__privateAdd(this, _activeTimeoutId);
|
|
22
|
+
__privateAdd(this, _opened, !1);
|
|
23
|
+
__privateAdd(this, _headClickListener, /* @__PURE__ */ __name(() => {
|
|
24
|
+
__privateGet(this, _opened) ? this.close() : this.open();
|
|
25
|
+
}, "#headClickListener"));
|
|
26
|
+
__privateAdd(this, _windowResizeListener, /* @__PURE__ */ __name((event) => {
|
|
27
|
+
__privateGet(this, _opened) && !(event instanceof CustomEvent) && (__privateMethod(this, _AccordionItem_instances, setScrollSize_fn).call(this, 0, !0), __privateMethod(this, _AccordionItem_instances, setScrollSize_fn).call(this, __privateGet(this, _AccordionItem_instances, scrollSize_get)));
|
|
28
|
+
}, "#windowResizeListener"));
|
|
29
|
+
element.firstElementChild instanceof HTMLElement && element.lastElementChild instanceof HTMLElement ? (__privateSet(this, _accordionElement, accordionElement), __privateSet(this, _element, element), __privateSet(this, _headElement, element.firstElementChild), __privateSet(this, _bodyElement, element.lastElementChild), __privateGet(this, _bodyElement).style.overflow = "hidden", __privateGet(this, _accordionElement).axisAttribute.current === "y" ? __privateGet(this, _bodyElement).style.height = "0px" : __privateGet(this, _bodyElement).style.width = "0px", addEventListener("resize", __privateGet(this, _windowResizeListener)), __privateGet(this, _headElement).addEventListener("click", __privateGet(this, _headClickListener)), __privateGet(this, _element).hasAttribute("data-opened") && this.open({ skipTransition: !0 })) : accordionElement.removeItem(__privateGet(this, _element));
|
|
28
30
|
}
|
|
29
31
|
get element() {
|
|
30
|
-
return
|
|
32
|
+
return __privateGet(this, _element);
|
|
31
33
|
}
|
|
32
34
|
destroy() {
|
|
33
|
-
|
|
35
|
+
__privateGet(this, _headElement) && (__privateGet(this, _element).classList.remove("opened", "triggered"), __privateGet(this, _element).removeAttribute("data-opened"), __privateGet(this, _headElement).style.cursor = "", __privateMethod(this, _AccordionItem_instances, setScrollSize_fn).call(this, void 0), removeEventListener("resize", __privateGet(this, _windowResizeListener)), __privateGet(this, _headElement).removeEventListener("click", __privateGet(this, _headClickListener)), clearTimeout(__privateGet(this, _activeTimeoutId)));
|
|
34
36
|
}
|
|
35
|
-
open(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}, 0),
|
|
37
|
+
open(options) {
|
|
38
|
+
options != null && options.skipTransition && __privateMethod(this, _AccordionItem_instances, skipTransition_fn).call(this), __privateGet(this, _accordionElement).multipleAttribute.current || __privateGet(this, _accordionElement).closeAll({ exclude: __privateGet(this, _element) }), __privateSet(this, _opened, !0), clearTimeout(__privateGet(this, _activeTimeoutId)), __privateGet(this, _element).classList.add("triggered"), __privateMethod(this, _AccordionItem_instances, setScrollSize_fn).call(this, __privateGet(this, _AccordionItem_instances, scrollSize_get)), setTimeout(() => {
|
|
39
|
+
__privateGet(this, _element).classList.add("opened"), __privateGet(this, _element).setAttribute("data-opened", ""), __privateMethod(this, _AccordionItem_instances, tryDispatchResizeEvent_fn).call(this);
|
|
40
|
+
}, 0), dispatchEvent(this.element, "accordionItemToggle", {
|
|
39
41
|
bubbles: !0,
|
|
40
42
|
composed: !0,
|
|
41
43
|
detail: {
|
|
42
|
-
opened:
|
|
43
|
-
element:
|
|
44
|
+
opened: __privateGet(this, _opened),
|
|
45
|
+
element: __privateGet(this, _element)
|
|
44
46
|
}
|
|
45
47
|
});
|
|
46
48
|
}
|
|
47
|
-
close(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}),
|
|
49
|
+
close(options) {
|
|
50
|
+
options != null && options.skipTransition && __privateMethod(this, _AccordionItem_instances, skipTransition_fn).call(this), clearTimeout(__privateGet(this, _activeTimeoutId)), __privateSet(this, _opened, !1), __privateGet(this, _element).classList.remove("opened"), __privateMethod(this, _AccordionItem_instances, setScrollSize_fn).call(this, 0), __privateMethod(this, _AccordionItem_instances, tryDispatchResizeEvent_fn).call(this, () => {
|
|
51
|
+
__privateGet(this, _element).classList.remove("triggered");
|
|
52
|
+
}), dispatchEvent(this.element, "accordionItemToggle", {
|
|
51
53
|
bubbles: !0,
|
|
52
54
|
composed: !0,
|
|
53
55
|
detail: {
|
|
54
|
-
opened:
|
|
55
|
-
element:
|
|
56
|
+
opened: __privateGet(this, _opened),
|
|
57
|
+
element: __privateGet(this, _element)
|
|
56
58
|
}
|
|
57
59
|
});
|
|
58
60
|
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
};
|
|
62
|
+
_accordionElement = new WeakMap(), _element = new WeakMap(), _headElement = new WeakMap(), _bodyElement = new WeakMap(), _activeTimeoutId = new WeakMap(), _opened = new WeakMap(), _AccordionItem_instances = new WeakSet(), scrollSize_get = /* @__PURE__ */ __name(function() {
|
|
63
|
+
return __privateGet(this, _accordionElement).axisAttribute.current === "x" ? __privateGet(this, _bodyElement).scrollWidth : __privateGet(this, _bodyElement).scrollHeight;
|
|
64
|
+
}, "#scrollSize"), _headClickListener = new WeakMap(), _windowResizeListener = new WeakMap(), setScrollSize_fn = /* @__PURE__ */ __name(function(value, skipDuration = !1) {
|
|
65
|
+
skipDuration && (__privateGet(this, _bodyElement).style.transition = "all 0s", setTimeout(() => {
|
|
66
|
+
__privateGet(this, _bodyElement).style.transition = "";
|
|
65
67
|
}));
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
const dim = __privateGet(this, _accordionElement).axisAttribute.current === "x" ? "width" : "height";
|
|
69
|
+
value != null ? __privateGet(this, _bodyElement).style[dim] = `${value}px` : __privateGet(this, _bodyElement).style[dim] = "";
|
|
70
|
+
}, "#setScrollSize"), skipTransition_fn = /* @__PURE__ */ __name(function() {
|
|
71
|
+
__privateGet(this, _bodyElement).style.transition = "all 0s", setTimeout(() => {
|
|
72
|
+
__privateGet(this, _bodyElement).style.transition = "";
|
|
71
73
|
}, 50);
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
}, "#skipTransition"), tryDispatchResizeEvent_fn = /* @__PURE__ */ __name(function(callback) {
|
|
75
|
+
__privateGet(this, _accordionElement).hasAttribute("no-window-resize") || __privateSet(this, _activeTimeoutId, setTimeout(() => {
|
|
76
|
+
callback == null || callback(), window.dispatchEvent(new CustomEvent("resize"));
|
|
77
|
+
}, getElementTransitionDurationMS(__privateGet(this, _bodyElement))));
|
|
78
|
+
}, "#tryDispatchResizeEvent"), __name(_AccordionItem, "AccordionItem");
|
|
79
|
+
let AccordionItem = _AccordionItem;
|
|
80
|
+
var _axisAttribute, _multipleAttribute, _items, _mutationObserver, _AccordionElement_instances, root_get;
|
|
81
|
+
const _AccordionElement = class _AccordionElement extends HTMLElement {
|
|
79
82
|
constructor() {
|
|
80
83
|
super();
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}),
|
|
91
|
-
|
|
84
|
+
__privateAdd(this, _AccordionElement_instances);
|
|
85
|
+
__privateAdd(this, _axisAttribute, new Attribute(this, "axis", "y"));
|
|
86
|
+
__privateAdd(this, _multipleAttribute, new Attribute(this, "multiple", !1));
|
|
87
|
+
__privateAdd(this, _items, []);
|
|
88
|
+
__privateAdd(this, _mutationObserver, null);
|
|
89
|
+
isBrowser && __privateSet(this, _mutationObserver, new MutationObserver((records) => {
|
|
90
|
+
records.forEach((record) => {
|
|
91
|
+
record.removedNodes.forEach((node) => {
|
|
92
|
+
node instanceof HTMLElement && this.removeItem(node);
|
|
93
|
+
}), record.addedNodes.forEach((node) => {
|
|
94
|
+
node instanceof HTMLElement && this.createItem(node);
|
|
92
95
|
});
|
|
93
96
|
});
|
|
94
97
|
}));
|
|
95
98
|
}
|
|
96
99
|
get axisAttribute() {
|
|
97
|
-
return
|
|
100
|
+
return __privateGet(this, _axisAttribute);
|
|
98
101
|
}
|
|
99
102
|
get multipleAttribute() {
|
|
100
|
-
return
|
|
103
|
+
return __privateGet(this, _multipleAttribute);
|
|
101
104
|
}
|
|
102
|
-
createItem(
|
|
103
|
-
|
|
105
|
+
createItem(element) {
|
|
106
|
+
__privateGet(this, _items).find((item) => item.element === element) || __privateGet(this, _items).push(new AccordionItem(this, element));
|
|
104
107
|
}
|
|
105
|
-
removeItem(
|
|
106
|
-
|
|
107
|
-
if (
|
|
108
|
+
removeItem(element) {
|
|
109
|
+
__privateSet(this, _items, __privateGet(this, _items).filter((item) => {
|
|
110
|
+
if (item.element !== element)
|
|
108
111
|
return !0;
|
|
109
|
-
|
|
112
|
+
item.destroy();
|
|
110
113
|
}));
|
|
111
114
|
}
|
|
112
|
-
closeAll(
|
|
113
|
-
|
|
114
|
-
(
|
|
115
|
+
closeAll(options) {
|
|
116
|
+
__privateGet(this, _items).forEach((item) => {
|
|
117
|
+
(options == null ? void 0 : options.exclude) !== item.element && item.close(options);
|
|
115
118
|
});
|
|
116
119
|
}
|
|
117
|
-
openAll(
|
|
118
|
-
|
|
119
|
-
(
|
|
120
|
+
openAll(options) {
|
|
121
|
+
__privateGet(this, _items).forEach((item) => {
|
|
122
|
+
(options == null ? void 0 : options.exclude) !== item.element && item.open(options);
|
|
120
123
|
});
|
|
121
124
|
}
|
|
122
125
|
connectedCallback() {
|
|
123
|
-
|
|
126
|
+
__privateGet(this, _axisAttribute).observe(), __privateGet(this, _multipleAttribute).observe(), __privateGet(this, _mutationObserver).observe(__privateGet(this, _AccordionElement_instances, root_get), {
|
|
124
127
|
childList: !0
|
|
125
|
-
}),
|
|
126
|
-
if (
|
|
127
|
-
return new
|
|
128
|
-
}).filter((
|
|
128
|
+
}), __privateSet(this, _items, [...__privateGet(this, _AccordionElement_instances, root_get).children].map((element) => {
|
|
129
|
+
if (element instanceof HTMLElement)
|
|
130
|
+
return new AccordionItem(this, element);
|
|
131
|
+
}).filter((e) => !!e));
|
|
129
132
|
}
|
|
130
133
|
disconnectedCallback() {
|
|
131
|
-
|
|
134
|
+
__privateGet(this, _axisAttribute).unobserve(), __privateGet(this, _multipleAttribute).unobserve(), __privateGet(this, _mutationObserver).disconnect();
|
|
132
135
|
}
|
|
133
|
-
}
|
|
134
|
-
b = new WeakMap(), g = new WeakMap(), u = new WeakMap(), p = new WeakMap(), L = new WeakSet(), z = function() {
|
|
135
|
-
return this.shadowRoot ? this.shadowRoot : this;
|
|
136
136
|
};
|
|
137
|
-
|
|
137
|
+
_axisAttribute = new WeakMap(), _multipleAttribute = new WeakMap(), _items = new WeakMap(), _mutationObserver = new WeakMap(), _AccordionElement_instances = new WeakSet(), root_get = /* @__PURE__ */ __name(function() {
|
|
138
|
+
return this.shadowRoot ? this.shadowRoot : this;
|
|
139
|
+
}, "#root"), __name(_AccordionElement, "AccordionElement");
|
|
140
|
+
let AccordionElement = _AccordionElement;
|
|
141
|
+
isBrowser && !customElements.get("e-accordion") && customElements.define("e-accordion", AccordionElement);
|
|
138
142
|
export {
|
|
139
|
-
|
|
143
|
+
AccordionElement
|
|
140
144
|
};
|
package/lib/animation/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Animation=require("../Animation-DMWabSR0.cjs"),Damped=require("../Damped-BLo-OAVb.cjs"),Tweened=require("../Tweened-DdXm1dbF.cjs");exports.Animation=Animation.Animation;exports.Damped=Damped.Damped;exports.Tweened=Tweened.Tweened;
|
package/lib/animation/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A
|
|
2
|
-
import { D
|
|
3
|
-
import { T
|
|
1
|
+
import { A } from "../Animation-BAiM6_n1.js";
|
|
2
|
+
import { D } from "../Damped-Dcz5UdMH.js";
|
|
3
|
+
import { T } from "../Tweened-BvtjLCa3.js";
|
|
4
4
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
A as Animation,
|
|
6
|
+
D as Damped,
|
|
7
|
+
T as Tweened
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const cache_index=require("../cache/index.cjs");require("construct-style-sheets-polyfill");require("../index-BpO2RJ__.cjs");const url=require("../url-CPCO10Sy.cjs"),cache=new cache_index.Cache;function apiFetcher(input,options){return __async(this,null,function*(){var _a,_b;const startTime=Date.now(),baseResult={data:null,error:null,status:"unknown",headers:new Headers};try{let url$1=input;if(options!=null&&options.params){const params=url.searchParamsObjectToString(options.params);if(params){const separator=url$1.includes("?")?"&":"?";url$1+=`${separator}${params}`}}const cacheKey=(_a=options==null?void 0:options.cacheKey)!=null?_a:url$1,cacheTTL=(_b=options==null?void 0:options.cacheTTLMinutes)!=null?_b:0,cacheAllowed=cacheTTL>0;if((options!=null&&options.forceClearCache||globalThis.forceClearCache)&&cache.delete(cacheKey),cacheAllowed){const cached=cache.get(cacheKey);if(cached)return __spreadProps(__spreadValues({},baseResult),{data:cached,cached:!0,status:"success",time:Date.now()-startTime})}const response=yield fetch(url$1,options==null?void 0:options.init);if(!response.ok){const errorText=yield response.text();return __spreadProps(__spreadValues({},baseResult),{error:errorText,status:"error",time:Date.now()-startTime,headers:response.headers})}const contentType=response.headers.get("content-type");if(!(contentType!=null&&contentType.includes("application/json")))return __spreadProps(__spreadValues({},baseResult),{error:"Endpoint did not return JSON",status:"error",time:Date.now()-startTime,headers:response.headers});const jsonData=yield response.json();return cacheAllowed&&cache.set(cacheKey,jsonData,cacheTTL),__spreadProps(__spreadValues({},baseResult),{data:jsonData,status:"success",time:Date.now()-startTime,headers:response.headers})}catch(error){const errorMessage=error instanceof Error?error.message:String(error);return __spreadProps(__spreadValues({},baseResult),{error:errorMessage,status:"error",time:Date.now()-startTime})}})}__name(apiFetcher,"apiFetcher");exports.apiFetcher=apiFetcher;
|
package/lib/api-fetcher/index.js
CHANGED
|
@@ -1,100 +1,101 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
1
|
+
var __defProp = Object.defineProperty, __defProps = Object.defineProperties;
|
|
2
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __spreadValues = (a, b) => {
|
|
6
|
+
for (var prop in b || (b = {}))
|
|
7
|
+
__hasOwnProp.call(b, prop) && __defNormalProp(a, prop, b[prop]);
|
|
8
|
+
if (__getOwnPropSymbols)
|
|
9
|
+
for (var prop of __getOwnPropSymbols(b))
|
|
10
|
+
__propIsEnum.call(b, prop) && __defNormalProp(a, prop, b[prop]);
|
|
11
11
|
return a;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
12
|
+
}, __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)), __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
13
|
+
var __async = (__this, __arguments, generator) => new Promise((resolve, reject) => {
|
|
14
|
+
var fulfilled = (value) => {
|
|
15
15
|
try {
|
|
16
|
-
|
|
17
|
-
} catch (
|
|
18
|
-
|
|
16
|
+
step(generator.next(value));
|
|
17
|
+
} catch (e) {
|
|
18
|
+
reject(e);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, rejected = (value) => {
|
|
21
21
|
try {
|
|
22
|
-
|
|
23
|
-
} catch (
|
|
24
|
-
|
|
22
|
+
step(generator.throw(value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
27
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
28
28
|
});
|
|
29
|
-
import { Cache
|
|
29
|
+
import { Cache } from "../cache/index.js";
|
|
30
30
|
import "construct-style-sheets-polyfill";
|
|
31
|
-
import "../index-
|
|
32
|
-
import { s as
|
|
33
|
-
const
|
|
34
|
-
function
|
|
35
|
-
return
|
|
36
|
-
var
|
|
37
|
-
const
|
|
31
|
+
import "../index-DpKsHe97.js";
|
|
32
|
+
import { s as searchParamsObjectToString } from "../url-CWCY_qe_.js";
|
|
33
|
+
const cache = new Cache();
|
|
34
|
+
function apiFetcher(input, options) {
|
|
35
|
+
return __async(this, null, function* () {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
const startTime = Date.now(), baseResult = {
|
|
38
38
|
data: null,
|
|
39
39
|
error: null,
|
|
40
40
|
status: "unknown",
|
|
41
41
|
headers: new Headers()
|
|
42
42
|
};
|
|
43
43
|
try {
|
|
44
|
-
let
|
|
45
|
-
if (
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
48
|
-
const
|
|
49
|
-
|
|
44
|
+
let url = input;
|
|
45
|
+
if (options != null && options.params) {
|
|
46
|
+
const params = searchParamsObjectToString(options.params);
|
|
47
|
+
if (params) {
|
|
48
|
+
const separator = url.includes("?") ? "&" : "?";
|
|
49
|
+
url += `${separator}${params}`;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
const
|
|
53
|
-
if ((
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
return
|
|
57
|
-
data:
|
|
52
|
+
const cacheKey = (_a = options == null ? void 0 : options.cacheKey) != null ? _a : url, cacheTTL = (_b = options == null ? void 0 : options.cacheTTLMinutes) != null ? _b : 0, cacheAllowed = cacheTTL > 0;
|
|
53
|
+
if ((options != null && options.forceClearCache || globalThis.forceClearCache) && cache.delete(cacheKey), cacheAllowed) {
|
|
54
|
+
const cached = cache.get(cacheKey);
|
|
55
|
+
if (cached)
|
|
56
|
+
return __spreadProps(__spreadValues({}, baseResult), {
|
|
57
|
+
data: cached,
|
|
58
58
|
cached: !0,
|
|
59
59
|
status: "success",
|
|
60
|
-
time: Date.now() -
|
|
60
|
+
time: Date.now() - startTime
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
const
|
|
64
|
-
if (!
|
|
65
|
-
const
|
|
66
|
-
return
|
|
67
|
-
error:
|
|
63
|
+
const response = yield fetch(url, options == null ? void 0 : options.init);
|
|
64
|
+
if (!response.ok) {
|
|
65
|
+
const errorText = yield response.text();
|
|
66
|
+
return __spreadProps(__spreadValues({}, baseResult), {
|
|
67
|
+
error: errorText,
|
|
68
68
|
status: "error",
|
|
69
|
-
time: Date.now() -
|
|
70
|
-
headers:
|
|
69
|
+
time: Date.now() - startTime,
|
|
70
|
+
headers: response.headers
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
const
|
|
74
|
-
if (!(
|
|
75
|
-
return
|
|
73
|
+
const contentType = response.headers.get("content-type");
|
|
74
|
+
if (!(contentType != null && contentType.includes("application/json")))
|
|
75
|
+
return __spreadProps(__spreadValues({}, baseResult), {
|
|
76
76
|
error: "Endpoint did not return JSON",
|
|
77
77
|
status: "error",
|
|
78
|
-
time: Date.now() -
|
|
79
|
-
headers:
|
|
78
|
+
time: Date.now() - startTime,
|
|
79
|
+
headers: response.headers
|
|
80
80
|
});
|
|
81
|
-
const
|
|
82
|
-
return
|
|
83
|
-
data:
|
|
81
|
+
const jsonData = yield response.json();
|
|
82
|
+
return cacheAllowed && cache.set(cacheKey, jsonData, cacheTTL), __spreadProps(__spreadValues({}, baseResult), {
|
|
83
|
+
data: jsonData,
|
|
84
84
|
status: "success",
|
|
85
|
-
time: Date.now() -
|
|
86
|
-
headers:
|
|
85
|
+
time: Date.now() - startTime,
|
|
86
|
+
headers: response.headers
|
|
87
87
|
});
|
|
88
|
-
} catch (
|
|
89
|
-
const
|
|
90
|
-
return
|
|
91
|
-
error:
|
|
88
|
+
} catch (error) {
|
|
89
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
90
|
+
return __spreadProps(__spreadValues({}, baseResult), {
|
|
91
|
+
error: errorMessage,
|
|
92
92
|
status: "error",
|
|
93
|
-
time: Date.now() -
|
|
93
|
+
time: Date.now() - startTime
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
+
__name(apiFetcher, "apiFetcher");
|
|
98
99
|
export {
|
|
99
|
-
|
|
100
|
+
apiFetcher
|
|
100
101
|
};
|
package/lib/attribute/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __typeError=msg=>{throw TypeError(msg)};var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Store=require("../Store-BCW70G3Z.cjs"),attributes=require("../attributes-BADnRZpK.cjs"),intersector_index=require("../index-BpO2RJ__.cjs"),dom=require("../dom-B40i6NXw.cjs");require("construct-style-sheets-polyfill");var _element,_name,_mutationObserver,_active,_Attribute_instances,tryUpdate_fn;const _Attribute=class _Attribute extends Store.Store{constructor(elementOrSelector,name,defaultValue,options){super(defaultValue,options);__privateAdd(this,_Attribute_instances);__privateAdd(this,_element,null);__privateAdd(this,_name);__privateAdd(this,_mutationObserver,null);__privateAdd(this,_active,!1);__privateSet(this,_name,name),intersector_index.isBrowser&&(__privateSet(this,_element,dom.getElement(elementOrSelector)),__privateSet(this,_mutationObserver,new MutationObserver(mutations=>{mutations.forEach(mutation=>{mutation.type==="attributes"&&mutation.attributeName===__privateGet(this,_name)&&__privateMethod(this,_Attribute_instances,tryUpdate_fn).call(this)})})),options!=null&&options.sync&&this.subscribe(e=>{__privateGet(this,_element).setAttribute(__privateGet(this,_name),e.current.toString())}))}subscribe(callback,order){return this.subscribers.length||this.observe(),super.subscribe(callback,order)}unsubscribe(callback){super.unsubscribe(callback),this.subscribers.length||this.unobserve()}observe(){__privateGet(this,_active)||(__privateSet(this,_active,!0),__privateGet(this,_mutationObserver).observe(__privateGet(this,_element),{attributes:!0}),__privateMethod(this,_Attribute_instances,tryUpdate_fn).call(this))}unobserve(){__privateGet(this,_active)&&(__privateSet(this,_active,!1),__privateGet(this,_mutationObserver).disconnect())}close(){super.close(),this.unobserve()}};_element=new WeakMap,_name=new WeakMap,_mutationObserver=new WeakMap,_active=new WeakMap,_Attribute_instances=new WeakSet,tryUpdate_fn=__name(function(){const value=__privateGet(this,_element).getAttribute(__privateGet(this,_name));value!=null&&(this.current=attributes.parseAttributeValue(value))},"#tryUpdate"),__name(_Attribute,"Attribute");let Attribute=_Attribute;exports.Attribute=Attribute;
|
package/lib/attribute/index.js
CHANGED
|
@@ -1,52 +1,55 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __typeError = (msg) => {
|
|
3
|
+
throw TypeError(msg);
|
|
3
4
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
6
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
7
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value), __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
8
|
+
import { S as Store } from "../Store-uLDYY9ed.js";
|
|
9
|
+
import { p as parseAttributeValue } from "../attributes-FObgMNCf.js";
|
|
10
|
+
import { i as isBrowser } from "../index-DpKsHe97.js";
|
|
11
|
+
import { g as getElement } from "../dom-D8D-_9ty.js";
|
|
10
12
|
import "construct-style-sheets-polyfill";
|
|
11
|
-
var
|
|
12
|
-
class
|
|
13
|
-
constructor(
|
|
14
|
-
super(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
var _element, _name, _mutationObserver, _active, _Attribute_instances, tryUpdate_fn;
|
|
14
|
+
const _Attribute = class _Attribute extends Store {
|
|
15
|
+
constructor(elementOrSelector, name, defaultValue, options) {
|
|
16
|
+
super(defaultValue, options);
|
|
17
|
+
__privateAdd(this, _Attribute_instances);
|
|
18
|
+
__privateAdd(this, _element, null);
|
|
19
|
+
__privateAdd(this, _name);
|
|
20
|
+
__privateAdd(this, _mutationObserver, null);
|
|
21
|
+
__privateAdd(this, _active, !1);
|
|
22
|
+
__privateSet(this, _name, name), isBrowser && (__privateSet(this, _element, getElement(elementOrSelector)), __privateSet(this, _mutationObserver, new MutationObserver((mutations) => {
|
|
23
|
+
mutations.forEach((mutation) => {
|
|
24
|
+
mutation.type === "attributes" && mutation.attributeName === __privateGet(this, _name) && __privateMethod(this, _Attribute_instances, tryUpdate_fn).call(this);
|
|
23
25
|
});
|
|
24
|
-
})),
|
|
25
|
-
|
|
26
|
+
})), options != null && options.sync && this.subscribe((e) => {
|
|
27
|
+
__privateGet(this, _element).setAttribute(__privateGet(this, _name), e.current.toString());
|
|
26
28
|
}));
|
|
27
29
|
}
|
|
28
|
-
subscribe(
|
|
29
|
-
return this.subscribers.length || this.observe(), super.subscribe(
|
|
30
|
+
subscribe(callback, order) {
|
|
31
|
+
return this.subscribers.length || this.observe(), super.subscribe(callback, order);
|
|
30
32
|
}
|
|
31
|
-
unsubscribe(
|
|
32
|
-
super.unsubscribe(
|
|
33
|
+
unsubscribe(callback) {
|
|
34
|
+
super.unsubscribe(callback), this.subscribers.length || this.unobserve();
|
|
33
35
|
}
|
|
34
36
|
observe() {
|
|
35
|
-
|
|
37
|
+
__privateGet(this, _active) || (__privateSet(this, _active, !0), __privateGet(this, _mutationObserver).observe(__privateGet(this, _element), {
|
|
36
38
|
attributes: !0
|
|
37
|
-
}),
|
|
39
|
+
}), __privateMethod(this, _Attribute_instances, tryUpdate_fn).call(this));
|
|
38
40
|
}
|
|
39
41
|
unobserve() {
|
|
40
|
-
|
|
42
|
+
__privateGet(this, _active) && (__privateSet(this, _active, !1), __privateGet(this, _mutationObserver).disconnect());
|
|
41
43
|
}
|
|
42
44
|
close() {
|
|
43
45
|
super.close(), this.unobserve();
|
|
44
46
|
}
|
|
45
|
-
}
|
|
46
|
-
i = new WeakMap(), u = new WeakMap(), n = new WeakMap(), b = new WeakMap(), o = new WeakSet(), p = function() {
|
|
47
|
-
const t = r(this, i).getAttribute(r(this, u));
|
|
48
|
-
t != null && (this.current = S(t));
|
|
49
47
|
};
|
|
48
|
+
_element = new WeakMap(), _name = new WeakMap(), _mutationObserver = new WeakMap(), _active = new WeakMap(), _Attribute_instances = new WeakSet(), tryUpdate_fn = /* @__PURE__ */ __name(function() {
|
|
49
|
+
const value = __privateGet(this, _element).getAttribute(__privateGet(this, _name));
|
|
50
|
+
value != null && (this.current = parseAttributeValue(value));
|
|
51
|
+
}, "#tryUpdate"), __name(_Attribute, "Attribute");
|
|
52
|
+
let Attribute = _Attribute;
|
|
50
53
|
export {
|
|
51
|
-
|
|
54
|
+
Attribute
|
|
52
55
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});function parseAttribute(element,attributeName){return parseAttributeValue(element.getAttribute(attributeName))}__name(parseAttribute,"parseAttribute");function parseAttributeValue(value){return value==null?null:value?isNaN(Number(value))?value==="true"?!0:value==="false"?!1:value:Number(value):!0}__name(parseAttributeValue,"parseAttributeValue");function parseAttributeValueAdvanced(value){if(value==="true")return!0;if(value==="false")return!1;const num=Number(value);if(!isNaN(num)&&value.trim()!=="")return num;try{if(value.startsWith("{")&&value.endsWith("}")||value.startsWith("[")&&value.endsWith("]"))return JSON.parse(value)}catch(e){}return value}__name(parseAttributeValueAdvanced,"parseAttributeValueAdvanced");function getElementAttributesAdvanced(element){const attributes={};return Array.from(element.attributes).forEach(attr=>{attributes[attr.name]=parseAttributeValue(attr.value)}),attributes}__name(getElementAttributesAdvanced,"getElementAttributesAdvanced");exports.getElementAttributesAdvanced=getElementAttributesAdvanced;exports.parseAttribute=parseAttribute;exports.parseAttributeValue=parseAttributeValue;exports.parseAttributeValueAdvanced=parseAttributeValueAdvanced;
|