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/radio/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);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const events=require("../events-UlGk63iC.cjs");require("construct-style-sheets-polyfill");require("../index-BpO2RJ__.cjs");var _listenerElements,_buttonElements,_value,_currentButtonElement,_disabled,_loadListener,_buttonClickListener,_documentRadioChangeListener;const _RadioElement=class _RadioElement extends HTMLElement{constructor(){super(...arguments);__privateAdd(this,_listenerElements,[]);__privateAdd(this,_buttonElements,[]);__privateAdd(this,_value);__privateAdd(this,_currentButtonElement,null);__privateAdd(this,_disabled,!1);__privateAdd(this,_loadListener,__name(()=>{this.isConnected&&(document.documentElement.addEventListener("radioChange",__privateGet(this,_documentRadioChangeListener)),__privateGet(this,_buttonElements).forEach(element=>{element.addEventListener("click",__privateGet(this,_buttonClickListener)),element.hasAttribute("data-checked")&&this.setValue(element.getAttribute("data-value"))}))},"#loadListener"));__privateAdd(this,_buttonClickListener,__name(e=>{if(!__privateGet(this,_disabled)){const value=e.currentTarget.getAttribute("data-value");value&&this.setValue(value)}},"#buttonClickListener"));__privateAdd(this,_documentRadioChangeListener,__name(event=>{const ct=event.target;ct!==this&&ct.name===this.name&&this.setValue(event.detail)},"#documentRadioChangeListener"))}get value(){return __privateGet(this,_value)}get name(){return this.getAttribute("name")}get currentButtonElement(){return __privateGet(this,_currentButtonElement)}get disabled(){return __privateGet(this,_disabled)}disable(){__privateSet(this,_disabled,!0)}enable(){__privateSet(this,_disabled,!1)}addButton(element){__privateGet(this,_buttonElements).push(element),element.addEventListener("click",__privateGet(this,_buttonClickListener))}removeButton(element){const founded=__privateGet(this,_buttonElements).find(el=>el===element);founded&&(founded.removeEventListener("click",__privateGet(this,_buttonClickListener)),__privateSet(this,_buttonElements,__privateGet(this,_buttonElements).filter(el=>el!==element)))}setValue(value){value&&value!==__privateGet(this,_value)&&(__privateSet(this,_value,value),__privateGet(this,_buttonElements).forEach(element=>{element.getAttribute("data-value")===__privateGet(this,_value)?(element.setAttribute("data-checked",""),__privateSet(this,_currentButtonElement,element)):element.removeAttribute("data-checked")}),__privateGet(this,_currentButtonElement)&&__privateGet(this,_listenerElements).forEach(element=>{element.innerHTML=__privateGet(this,_currentButtonElement).getAttribute("data-name")||value}),events.dispatchEvent(this,"radioChange",{detail:__privateGet(this,_value),bubbles:!0}))}connectedCallback(){__privateSet(this,_listenerElements,[...this.querySelectorAll("[data-radio-listener]")]),__privateSet(this,_buttonElements,[...this.querySelectorAll("[data-radio-button]")]),document.readyState==="complete"?__privateGet(this,_loadListener).call(this):addEventListener("load",__privateGet(this,_loadListener))}disconnectedCallback(){__privateGet(this,_buttonElements).forEach(element=>{element.removeEventListener("click",__privateGet(this,_buttonClickListener))}),removeEventListener("load",__privateGet(this,_loadListener)),document.documentElement.removeEventListener("radioChange",__privateGet(this,_documentRadioChangeListener))}};_listenerElements=new WeakMap,_buttonElements=new WeakMap,_value=new WeakMap,_currentButtonElement=new WeakMap,_disabled=new WeakMap,_loadListener=new WeakMap,_buttonClickListener=new WeakMap,_documentRadioChangeListener=new WeakMap,__name(_RadioElement,"RadioElement");let RadioElement=_RadioElement;customElements.get("e-radio")||customElements.define("e-radio",RadioElement);exports.RadioElement=RadioElement;
|
package/lib/radio/index.js
CHANGED
|
@@ -1,92 +1,95 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __typeError = (msg) => {
|
|
3
|
+
throw TypeError(msg);
|
|
3
4
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
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);
|
|
8
|
+
import { d as dispatchEvent } from "../events-Ds-TuvYW.js";
|
|
7
9
|
import "construct-style-sheets-polyfill";
|
|
8
|
-
import "../index-
|
|
9
|
-
var
|
|
10
|
-
class
|
|
10
|
+
import "../index-DpKsHe97.js";
|
|
11
|
+
var _listenerElements, _buttonElements, _value, _currentButtonElement, _disabled, _loadListener, _buttonClickListener, _documentRadioChangeListener;
|
|
12
|
+
const _RadioElement = class _RadioElement extends HTMLElement {
|
|
11
13
|
constructor() {
|
|
12
14
|
super(...arguments);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
__privateAdd(this, _listenerElements, []);
|
|
16
|
+
__privateAdd(this, _buttonElements, []);
|
|
17
|
+
__privateAdd(this, _value);
|
|
18
|
+
__privateAdd(this, _currentButtonElement, null);
|
|
19
|
+
__privateAdd(this, _disabled, !1);
|
|
20
|
+
__privateAdd(this, _loadListener, /* @__PURE__ */ __name(() => {
|
|
19
21
|
this.isConnected && (document.documentElement.addEventListener(
|
|
20
22
|
"radioChange",
|
|
21
|
-
|
|
22
|
-
),
|
|
23
|
-
|
|
23
|
+
__privateGet(this, _documentRadioChangeListener)
|
|
24
|
+
), __privateGet(this, _buttonElements).forEach((element) => {
|
|
25
|
+
element.addEventListener("click", __privateGet(this, _buttonClickListener)), element.hasAttribute("data-checked") && this.setValue(element.getAttribute("data-value"));
|
|
24
26
|
}));
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
if (!
|
|
28
|
-
const
|
|
29
|
-
|
|
27
|
+
}, "#loadListener"));
|
|
28
|
+
__privateAdd(this, _buttonClickListener, /* @__PURE__ */ __name((e) => {
|
|
29
|
+
if (!__privateGet(this, _disabled)) {
|
|
30
|
+
const value = e.currentTarget.getAttribute("data-value");
|
|
31
|
+
value && this.setValue(value);
|
|
30
32
|
}
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
});
|
|
33
|
+
}, "#buttonClickListener"));
|
|
34
|
+
__privateAdd(this, _documentRadioChangeListener, /* @__PURE__ */ __name((event) => {
|
|
35
|
+
const ct = event.target;
|
|
36
|
+
ct !== this && ct.name === this.name && this.setValue(event.detail);
|
|
37
|
+
}, "#documentRadioChangeListener"));
|
|
36
38
|
}
|
|
37
39
|
get value() {
|
|
38
|
-
return
|
|
40
|
+
return __privateGet(this, _value);
|
|
39
41
|
}
|
|
40
42
|
get name() {
|
|
41
43
|
return this.getAttribute("name");
|
|
42
44
|
}
|
|
43
45
|
get currentButtonElement() {
|
|
44
|
-
return
|
|
46
|
+
return __privateGet(this, _currentButtonElement);
|
|
45
47
|
}
|
|
46
48
|
get disabled() {
|
|
47
|
-
return
|
|
49
|
+
return __privateGet(this, _disabled);
|
|
48
50
|
}
|
|
49
51
|
disable() {
|
|
50
|
-
|
|
52
|
+
__privateSet(this, _disabled, !0);
|
|
51
53
|
}
|
|
52
54
|
enable() {
|
|
53
|
-
|
|
55
|
+
__privateSet(this, _disabled, !1);
|
|
54
56
|
}
|
|
55
|
-
addButton(
|
|
56
|
-
|
|
57
|
+
addButton(element) {
|
|
58
|
+
__privateGet(this, _buttonElements).push(element), element.addEventListener("click", __privateGet(this, _buttonClickListener));
|
|
57
59
|
}
|
|
58
|
-
removeButton(
|
|
59
|
-
const
|
|
60
|
-
|
|
60
|
+
removeButton(element) {
|
|
61
|
+
const founded = __privateGet(this, _buttonElements).find((el) => el === element);
|
|
62
|
+
founded && (founded.removeEventListener("click", __privateGet(this, _buttonClickListener)), __privateSet(this, _buttonElements, __privateGet(this, _buttonElements).filter((el) => el !== element)));
|
|
61
63
|
}
|
|
62
|
-
setValue(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}),
|
|
66
|
-
|
|
67
|
-
}),
|
|
68
|
-
detail:
|
|
64
|
+
setValue(value) {
|
|
65
|
+
value && value !== __privateGet(this, _value) && (__privateSet(this, _value, value), __privateGet(this, _buttonElements).forEach((element) => {
|
|
66
|
+
element.getAttribute("data-value") === __privateGet(this, _value) ? (element.setAttribute("data-checked", ""), __privateSet(this, _currentButtonElement, element)) : element.removeAttribute("data-checked");
|
|
67
|
+
}), __privateGet(this, _currentButtonElement) && __privateGet(this, _listenerElements).forEach((element) => {
|
|
68
|
+
element.innerHTML = __privateGet(this, _currentButtonElement).getAttribute("data-name") || value;
|
|
69
|
+
}), dispatchEvent(this, "radioChange", {
|
|
70
|
+
detail: __privateGet(this, _value),
|
|
69
71
|
bubbles: !0
|
|
70
72
|
}));
|
|
71
73
|
}
|
|
72
74
|
connectedCallback() {
|
|
73
|
-
|
|
75
|
+
__privateSet(this, _listenerElements, [
|
|
74
76
|
...this.querySelectorAll("[data-radio-listener]")
|
|
75
|
-
]),
|
|
77
|
+
]), __privateSet(this, _buttonElements, [
|
|
76
78
|
...this.querySelectorAll("[data-radio-button]")
|
|
77
|
-
]), document.readyState === "complete" ?
|
|
79
|
+
]), document.readyState === "complete" ? __privateGet(this, _loadListener).call(this) : addEventListener("load", __privateGet(this, _loadListener));
|
|
78
80
|
}
|
|
79
81
|
disconnectedCallback() {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}), removeEventListener("load",
|
|
82
|
+
__privateGet(this, _buttonElements).forEach((element) => {
|
|
83
|
+
element.removeEventListener("click", __privateGet(this, _buttonClickListener));
|
|
84
|
+
}), removeEventListener("load", __privateGet(this, _loadListener)), document.documentElement.removeEventListener(
|
|
83
85
|
"radioChange",
|
|
84
|
-
|
|
86
|
+
__privateGet(this, _documentRadioChangeListener)
|
|
85
87
|
);
|
|
86
88
|
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
};
|
|
90
|
+
_listenerElements = new WeakMap(), _buttonElements = new WeakMap(), _value = new WeakMap(), _currentButtonElement = new WeakMap(), _disabled = new WeakMap(), _loadListener = new WeakMap(), _buttonClickListener = new WeakMap(), _documentRadioChangeListener = new WeakMap(), __name(_RadioElement, "RadioElement");
|
|
91
|
+
let RadioElement = _RadioElement;
|
|
92
|
+
customElements.get("e-radio") || customElements.define("e-radio", RadioElement);
|
|
90
93
|
export {
|
|
91
|
-
|
|
94
|
+
RadioElement
|
|
92
95
|
};
|
|
@@ -0,0 +1,355 @@
|
|
|
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 __typeError = (msg) => {
|
|
6
|
+
throw TypeError(msg);
|
|
7
|
+
};
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
__hasOwnProp.call(b, prop) && __defNormalProp(a, prop, b[prop]);
|
|
11
|
+
if (__getOwnPropSymbols)
|
|
12
|
+
for (var prop of __getOwnPropSymbols(b))
|
|
13
|
+
__propIsEnum.call(b, prop) && __defNormalProp(a, prop, b[prop]);
|
|
14
|
+
return a;
|
|
15
|
+
}, __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)), __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
16
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
17
|
+
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);
|
|
18
|
+
import { S as Store } from "./Store-uLDYY9ed.js";
|
|
19
|
+
import { u as uncapitalize, c as camelToKebab } from "./string-B3lm2b7v.js";
|
|
20
|
+
import { k as diff, p as patch } from "./morph-BtgB1YQP.js";
|
|
21
|
+
import { i as isESClass } from "./object-CiIdEmJx.js";
|
|
22
|
+
import "construct-style-sheets-polyfill";
|
|
23
|
+
import { a as intersector } from "./index-DpKsHe97.js";
|
|
24
|
+
import { connector } from "./connector/index.js";
|
|
25
|
+
import { a as DerivedKeyedArray } from "./DerivedArray-DFhxap_z.js";
|
|
26
|
+
import "./css-value-parser/index.js";
|
|
27
|
+
import "./window-resizer/index.js";
|
|
28
|
+
import "./element-resizer/index.js";
|
|
29
|
+
import "./ticker/index.js";
|
|
30
|
+
const activeComponent = { current: null }, componentElementLoadingTypes = [
|
|
31
|
+
"idle",
|
|
32
|
+
"load",
|
|
33
|
+
"visible",
|
|
34
|
+
"constructor",
|
|
35
|
+
"connect"
|
|
36
|
+
];
|
|
37
|
+
var _loadCallback, _connectCallbacks, _disconnectCallbacks, _loadingType, _idleId, _windowLoadListener, _idleListener, _intersectionListener, _ComponentElement_instances, connect_fn;
|
|
38
|
+
const _ComponentElement = class _ComponentElement extends HTMLElement {
|
|
39
|
+
constructor() {
|
|
40
|
+
super();
|
|
41
|
+
__privateAdd(this, _ComponentElement_instances);
|
|
42
|
+
__privateAdd(this, _loadCallback);
|
|
43
|
+
__privateAdd(this, _connectCallbacks, []);
|
|
44
|
+
__privateAdd(this, _disconnectCallbacks, []);
|
|
45
|
+
__privateAdd(this, _loadingType, "constructor");
|
|
46
|
+
__privateAdd(this, _idleId);
|
|
47
|
+
__privateAdd(this, _windowLoadListener, /* @__PURE__ */ __name(() => {
|
|
48
|
+
window.removeEventListener("load", __privateGet(this, _windowLoadListener)), __privateGet(this, _loadingType) === "load" && __privateMethod(this, _ComponentElement_instances, connect_fn).call(this);
|
|
49
|
+
}, "#windowLoadListener"));
|
|
50
|
+
__privateAdd(this, _idleListener, /* @__PURE__ */ __name(() => {
|
|
51
|
+
__privateSet(this, _idleId, void 0), __privateGet(this, _loadingType) === "idle" && __privateMethod(this, _ComponentElement_instances, connect_fn).call(this);
|
|
52
|
+
}, "#idleListener"));
|
|
53
|
+
__privateAdd(this, _intersectionListener, /* @__PURE__ */ __name((entry) => {
|
|
54
|
+
entry.isIntersecting && (intersector.unsubscribe(__privateGet(this, _intersectionListener)), __privateGet(this, _loadingType) === "visible" && __privateMethod(this, _ComponentElement_instances, connect_fn).call(this));
|
|
55
|
+
}, "#intersectionListener"));
|
|
56
|
+
activeComponent.current = this;
|
|
57
|
+
}
|
|
58
|
+
addLoadCallback(callback) {
|
|
59
|
+
this.hasAttribute("loading") && componentElementLoadingTypes.includes(
|
|
60
|
+
this.getAttribute("loading")
|
|
61
|
+
) ? __privateSet(this, _loadingType, this.getAttribute(
|
|
62
|
+
"loading"
|
|
63
|
+
)) : __privateSet(this, _loadingType, "constructor"), __privateSet(this, _loadCallback, callback), __privateGet(this, _loadingType) === "constructor" && __privateGet(this, _loadCallback).call(this);
|
|
64
|
+
}
|
|
65
|
+
addConnectCallback(callback) {
|
|
66
|
+
__privateGet(this, _connectCallbacks).push(callback);
|
|
67
|
+
}
|
|
68
|
+
addDisconnectCallback(callback) {
|
|
69
|
+
__privateGet(this, _disconnectCallbacks).push(callback);
|
|
70
|
+
}
|
|
71
|
+
connectedCallback() {
|
|
72
|
+
const windowLoadSetup = /* @__PURE__ */ __name(() => {
|
|
73
|
+
document.readyState === "complete" ? __privateGet(this, _windowLoadListener).call(this) : window.addEventListener("load", __privateGet(this, _windowLoadListener));
|
|
74
|
+
}, "windowLoadSetup");
|
|
75
|
+
__privateGet(this, _loadingType) === "connect" || __privateGet(this, _loadingType) === "constructor" ? __privateMethod(this, _ComponentElement_instances, connect_fn).call(this) : __privateGet(this, _loadingType) === "load" ? windowLoadSetup() : __privateGet(this, _loadingType) === "idle" ? window.requestIdleCallback ? __privateSet(this, _idleId, window.requestIdleCallback(__privateGet(this, _idleListener))) : windowLoadSetup() : __privateGet(this, _loadingType) === "visible" && intersector.subscribe(this, __privateGet(this, _intersectionListener)), activeComponent.current === this && (activeComponent.current = null);
|
|
76
|
+
}
|
|
77
|
+
disconnectedCallback() {
|
|
78
|
+
__privateGet(this, _disconnectCallbacks).forEach((callback) => {
|
|
79
|
+
callback(this);
|
|
80
|
+
}), __privateSet(this, _connectCallbacks, []), __privateSet(this, _disconnectCallbacks, []), activeComponent.current === this && (activeComponent.current = null), window.removeEventListener("load", __privateGet(this, _windowLoadListener)), window.cancelIdleCallback && __privateGet(this, _idleId) && window.cancelIdleCallback(__privateGet(this, _idleId)), intersector.unsubscribe(__privateGet(this, _intersectionListener));
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
_loadCallback = new WeakMap(), _connectCallbacks = new WeakMap(), _disconnectCallbacks = new WeakMap(), _loadingType = new WeakMap(), _idleId = new WeakMap(), _windowLoadListener = new WeakMap(), _idleListener = new WeakMap(), _intersectionListener = new WeakMap(), _ComponentElement_instances = new WeakSet(), connect_fn = /* @__PURE__ */ __name(function() {
|
|
84
|
+
var _a;
|
|
85
|
+
activeComponent.current = this, this.querySelectorAll("[data-fallback]").forEach((el) => {
|
|
86
|
+
el.remove();
|
|
87
|
+
}), __privateGet(this, _loadingType) !== "constructor" && ((_a = __privateGet(this, _loadCallback)) == null || _a.call(this)), __privateGet(this, _connectCallbacks).forEach((callback) => {
|
|
88
|
+
const unsub = callback(this);
|
|
89
|
+
unsub && __privateGet(this, _disconnectCallbacks).push(unsub);
|
|
90
|
+
}), activeComponent.current === this && (activeComponent.current = null);
|
|
91
|
+
}, "#connect"), __name(_ComponentElement, "ComponentElement");
|
|
92
|
+
let ComponentElement = _ComponentElement;
|
|
93
|
+
function subscribeToStore(element, store, callback) {
|
|
94
|
+
const unsubscribe = store.subscribe((e) => {
|
|
95
|
+
callback(e);
|
|
96
|
+
});
|
|
97
|
+
connector.subscribe(element, {
|
|
98
|
+
disconnectCallback: /* @__PURE__ */ __name(() => {
|
|
99
|
+
unsubscribe();
|
|
100
|
+
}, "disconnectCallback"),
|
|
101
|
+
maxWaitSec: 20,
|
|
102
|
+
unsubscribeAfterDisconnect: !0
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
__name(subscribeToStore, "subscribeToStore");
|
|
106
|
+
function setClassAttribute(element, classes) {
|
|
107
|
+
classes && (classes instanceof Store ? subscribeToStore(element, classes, (e) => {
|
|
108
|
+
e.previous && element.classList.remove(e.previous.toString()), e.current && element.classList.add(e.current.toString());
|
|
109
|
+
}) : typeof classes == "object" && !Array.isArray(classes) ? Object.entries(classes).forEach(([key, value]) => {
|
|
110
|
+
value instanceof Store ? subscribeToStore(element, value, (e) => {
|
|
111
|
+
element.classList.toggle(key, !!e.current);
|
|
112
|
+
}) : value && element.classList.add(key);
|
|
113
|
+
}) : Array.isArray(classes) ? classes.forEach((item) => {
|
|
114
|
+
typeof item == "string" ? element.classList.add(item) : setClassAttribute(element, item);
|
|
115
|
+
}) : classes.toString().split(" ").map((v) => element.classList.add(v.trim())));
|
|
116
|
+
}
|
|
117
|
+
__name(setClassAttribute, "setClassAttribute");
|
|
118
|
+
function setStyleAttribute(element, value) {
|
|
119
|
+
value && (typeof value == "object" ? Object.entries(value).forEach(([key, value2]) => {
|
|
120
|
+
value2 instanceof Store ? subscribeToStore(element, value2, (e) => {
|
|
121
|
+
var _a;
|
|
122
|
+
element.style[key] = (_a = e.current) == null ? void 0 : _a.toString();
|
|
123
|
+
}) : (typeof value2 == "number" || typeof value2 == "string" || typeof value2 == "boolean") && (element.style[key] = value2.toString());
|
|
124
|
+
}) : typeof value == "string" && (element.style = value));
|
|
125
|
+
}
|
|
126
|
+
__name(setStyleAttribute, "setStyleAttribute");
|
|
127
|
+
function setAttribute(element, key, value) {
|
|
128
|
+
key === "ref" && value ? Array.isArray(value) ? value.forEach((v) => {
|
|
129
|
+
typeof v == "object" && "value" in v && (v.value = element);
|
|
130
|
+
}) : typeof value == "object" && "value" in value && (value.value = element) : key === "className" || key === "class" ? setClassAttribute(element, value) : key === "style" ? setStyleAttribute(element, value) : key === "setHtml" && value != null ? element.innerHTML = value : typeof value == "number" ? key === "tabIndex" ? element.setAttribute("tabindex", value.toString()) : setAttribute(element, key, value.toString()) : typeof value == "string" ? key === "htmlFor" ? element.setAttribute("for", value) : element.setAttribute(key, value) : typeof value == "boolean" ? value ? element.setAttribute(key, "") : element.removeAttribute(key) : value instanceof Store && subscribeToStore(element, value, (e) => {
|
|
131
|
+
key in element ? element[key] = e.current : setAttribute(element, key, e.current);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
__name(setAttribute, "setAttribute");
|
|
135
|
+
function setAttributes(ele, attributes) {
|
|
136
|
+
for (const [key, value] of Object.entries(attributes != null ? attributes : {}))
|
|
137
|
+
typeof value == "function" && key.startsWith("on") ? ele.addEventListener(
|
|
138
|
+
uncapitalize(key.replace("on", "")),
|
|
139
|
+
value
|
|
140
|
+
) : setAttribute(ele, key, value);
|
|
141
|
+
}
|
|
142
|
+
__name(setAttributes, "setAttributes");
|
|
143
|
+
function createElement(tag, isSVG) {
|
|
144
|
+
return tag === "svg" ? document.createElementNS("http://www.w3.org/2000/svg", "svg") : isSVG ? document.createElementNS("http://www.w3.org/2000/svg", tag) : document.createElement(tag);
|
|
145
|
+
}
|
|
146
|
+
__name(createElement, "createElement");
|
|
147
|
+
function filterChildren(children) {
|
|
148
|
+
const filtered = [];
|
|
149
|
+
return (Array.isArray(children) ? children : [children]).forEach((child) => {
|
|
150
|
+
child != null && (typeof child == "number" ? filtered.push(child.toString()) : Array.isArray(child) ? child.forEach((c) => {
|
|
151
|
+
filtered.push(...filterChildren(c));
|
|
152
|
+
}) : filtered.push(child));
|
|
153
|
+
}), filtered;
|
|
154
|
+
}
|
|
155
|
+
__name(filterChildren, "filterChildren");
|
|
156
|
+
function hydrateTextNode(element, newChild, index) {
|
|
157
|
+
const existingChild = element.childNodes[index];
|
|
158
|
+
existingChild && existingChild.nodeType === Node.TEXT_NODE ? existingChild.textContent !== String(newChild) && (console.warn(
|
|
159
|
+
`Hydration text mismatch: expected "${newChild}", got "${existingChild.textContent}"`
|
|
160
|
+
), existingChild.textContent = String(newChild)) : newChild != null && newChild !== "" && element.insertBefore(
|
|
161
|
+
document.createTextNode(String(newChild)),
|
|
162
|
+
element.childNodes[index] || null
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
__name(hydrateTextNode, "hydrateTextNode");
|
|
166
|
+
function storeChildren(element, store) {
|
|
167
|
+
const currentChildNodes = [...element.childNodes].filter((node) => node.__storeId === store.id), newChildren = store.current, newChildrenArray = Array.isArray(newChildren) ? newChildren : [newChildren], newNodes = [];
|
|
168
|
+
if (newChildrenArray.forEach((newChild) => {
|
|
169
|
+
let newNode = null;
|
|
170
|
+
typeof newChild == "boolean" || typeof newChild == "number" || typeof newChild == "string" ? newNode = document.createTextNode(newChild.toString()) : newChild instanceof Node && (newNode = newChild), newNode && (newNode.__storeId = store.id, newNodes.push(newNode));
|
|
171
|
+
}), store instanceof DerivedKeyedArray) {
|
|
172
|
+
const nodesToStay = [];
|
|
173
|
+
newNodes.forEach((newNode, i) => {
|
|
174
|
+
const oldNode = currentChildNodes.find(
|
|
175
|
+
(oldNode2) => oldNode2.__key === newNode.__key
|
|
176
|
+
);
|
|
177
|
+
oldNode ? oldNode.isEqualNode(newNode) ? nodesToStay.push(oldNode) : (oldNode.replaceWith(newNode), nodesToStay.push(newNode)) : (nodesToStay.push(newNode), element.appendChild(newNode));
|
|
178
|
+
}), currentChildNodes.forEach((currentNode) => {
|
|
179
|
+
nodesToStay.includes(currentNode) || currentNode.remove();
|
|
180
|
+
});
|
|
181
|
+
} else
|
|
182
|
+
newNodes.forEach((node, i) => {
|
|
183
|
+
var _a;
|
|
184
|
+
const founded = currentChildNodes[i];
|
|
185
|
+
if (founded)
|
|
186
|
+
founded.isEqualNode(node) || (founded.replaceWith(node), currentChildNodes[i] = node);
|
|
187
|
+
else {
|
|
188
|
+
const lastChildNode = currentChildNodes[currentChildNodes.length - 1];
|
|
189
|
+
lastChildNode ? (_a = lastChildNode.parentNode) == null || _a.insertBefore(
|
|
190
|
+
node,
|
|
191
|
+
lastChildNode.nextSibling
|
|
192
|
+
) : element.appendChild(node);
|
|
193
|
+
}
|
|
194
|
+
}), currentChildNodes.slice(newNodes.length).forEach((node) => {
|
|
195
|
+
node.remove();
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
__name(storeChildren, "storeChildren");
|
|
199
|
+
const _Props = class _Props {
|
|
200
|
+
constructor(tag, attributes, children) {
|
|
201
|
+
this.tag = tag, this.attributes = attributes, this.children = children;
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
__name(_Props, "Props");
|
|
205
|
+
let Props = _Props;
|
|
206
|
+
const _ComponentProps = class _ComponentProps extends Props {
|
|
207
|
+
};
|
|
208
|
+
__name(_ComponentProps, "ComponentProps");
|
|
209
|
+
let ComponentProps = _ComponentProps;
|
|
210
|
+
const _ElementProps = class _ElementProps extends Props {
|
|
211
|
+
};
|
|
212
|
+
__name(_ElementProps, "ElementProps");
|
|
213
|
+
let ElementProps = _ElementProps;
|
|
214
|
+
const _HeadProps = class _HeadProps extends Props {
|
|
215
|
+
};
|
|
216
|
+
__name(_HeadProps, "HeadProps");
|
|
217
|
+
let HeadProps = _HeadProps;
|
|
218
|
+
function appendChildren(element, attributes, children, isSVG = !1) {
|
|
219
|
+
const filteredChildren = filterChildren(children);
|
|
220
|
+
setAttributes(element, attributes), filteredChildren.forEach((child, index) => {
|
|
221
|
+
handleChild(element, child, index, isSVG);
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
__name(appendChildren, "appendChildren");
|
|
225
|
+
function handleChild(element, child, index, isSVG) {
|
|
226
|
+
child instanceof Store ? handleStoreChild(element, child) : child instanceof ComponentProps ? handleComponentProps(element, child) : child instanceof ElementProps ? handleElementProps(element, child, index, isSVG) : child instanceof HeadProps ? handleHeadProps(child) : handleTextNode(element, child, index);
|
|
227
|
+
}
|
|
228
|
+
__name(handleChild, "handleChild");
|
|
229
|
+
function handleStoreChild(element, child) {
|
|
230
|
+
subscribeToStore(element, child, () => {
|
|
231
|
+
storeChildren(element, child);
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
__name(handleStoreChild, "handleStoreChild");
|
|
235
|
+
function handleComponentProps(element, child) {
|
|
236
|
+
child.tag === "shadow" && element.shadowRoot ? appendChildren(element.shadowRoot, child.attributes, child.children) : appendChildren(element, child.attributes, child.children);
|
|
237
|
+
}
|
|
238
|
+
__name(handleComponentProps, "handleComponentProps");
|
|
239
|
+
function handleElementProps(element, child, index, isSVG) {
|
|
240
|
+
let childElement = null;
|
|
241
|
+
if (isHydrating.value) {
|
|
242
|
+
const existingChild = element.children[index];
|
|
243
|
+
(existingChild == null ? void 0 : existingChild.nodeName.toLowerCase()) === child.tag ? (childElement = existingChild, appendChildren(childElement, child.attributes, child.children, isSVG)) : (childElement = createElement(child.tag, isSVG), appendChildren(childElement, child.attributes, child.children, isSVG), element.append(childElement));
|
|
244
|
+
} else
|
|
245
|
+
childElement = createElement(child.tag, isSVG), appendChildren(childElement, child.attributes, child.children, isSVG), element.append(childElement);
|
|
246
|
+
}
|
|
247
|
+
__name(handleElementProps, "handleElementProps");
|
|
248
|
+
function handleHeadProps(child) {
|
|
249
|
+
const headElement = document.createElement(child.tag);
|
|
250
|
+
appendChildren(headElement, child.attributes, child.children);
|
|
251
|
+
const patches = diff(document.head, headElement);
|
|
252
|
+
patch(document.head, patches);
|
|
253
|
+
}
|
|
254
|
+
__name(handleHeadProps, "handleHeadProps");
|
|
255
|
+
function handleTextNode(element, child, index) {
|
|
256
|
+
isHydrating.value ? hydrateTextNode(element, child, index) : element.append(child);
|
|
257
|
+
}
|
|
258
|
+
__name(handleTextNode, "handleTextNode");
|
|
259
|
+
function processChildren(attributes, children) {
|
|
260
|
+
let result = children.filter(Boolean).length ? children : attributes == null ? void 0 : attributes.children;
|
|
261
|
+
return result ? result.flat(2) : [];
|
|
262
|
+
}
|
|
263
|
+
__name(processChildren, "processChildren");
|
|
264
|
+
function handleStringTag(tag, attributes, children) {
|
|
265
|
+
switch (tag) {
|
|
266
|
+
case "component":
|
|
267
|
+
case "shadow":
|
|
268
|
+
return new ComponentProps(tag, attributes, children);
|
|
269
|
+
case "head":
|
|
270
|
+
return new HeadProps(tag, attributes, children);
|
|
271
|
+
default:
|
|
272
|
+
return new ElementProps(tag, attributes, children);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
__name(handleStringTag, "handleStringTag");
|
|
276
|
+
function handleFunctionTag(jsxTag, attributes, children) {
|
|
277
|
+
return isESClass(jsxTag) ? createClassElement(jsxTag, attributes, children) : jsxTag === Fragment ? Fragment(children) : jsxTag.template ? jsxTag(__spreadValues({}, attributes)) : createCustomElement(jsxTag, attributes, children);
|
|
278
|
+
}
|
|
279
|
+
__name(handleFunctionTag, "handleFunctionTag");
|
|
280
|
+
function createClassElement(jsxTag, attributes, children) {
|
|
281
|
+
const element = new jsxTag();
|
|
282
|
+
return appendChildren(element, attributes, children), element;
|
|
283
|
+
}
|
|
284
|
+
__name(createClassElement, "createClassElement");
|
|
285
|
+
function createCustomElement(jsxTag, attributes, children) {
|
|
286
|
+
const name = jsxTag.define || `e-${camelToKebab(jsxTag.name)}`, Constructor = getOrDefineCustomElement(name, jsxTag), id = generateElementId(jsxTag.name, attributes), element = getOrCreateElement(name, id, Constructor);
|
|
287
|
+
return fillComponentElement(element, jsxTag, attributes, children), element;
|
|
288
|
+
}
|
|
289
|
+
__name(createCustomElement, "createCustomElement");
|
|
290
|
+
function getOrDefineCustomElement(name, jsxTag) {
|
|
291
|
+
var _a;
|
|
292
|
+
let Constructor = customElements.get(name);
|
|
293
|
+
return Constructor || (Constructor = (_a = class extends ComponentElement {
|
|
294
|
+
constructor() {
|
|
295
|
+
super();
|
|
296
|
+
}
|
|
297
|
+
}, __name(_a, "Constructor"), _a.formAssociated = jsxTag.formAssociated, _a), customElements.define(name, Constructor)), Constructor;
|
|
298
|
+
}
|
|
299
|
+
__name(getOrDefineCustomElement, "getOrDefineCustomElement");
|
|
300
|
+
function generateElementId(tagName, attributes) {
|
|
301
|
+
if (attributes != null && attributes.__hydrationId)
|
|
302
|
+
return attributes.__hydrationId;
|
|
303
|
+
const index = (indexMap.get(tagName) || 0) + 1;
|
|
304
|
+
return indexMap.set(tagName, index), `${tagName}-${index}`;
|
|
305
|
+
}
|
|
306
|
+
__name(generateElementId, "generateElementId");
|
|
307
|
+
function getOrCreateElement(name, id, Constructor) {
|
|
308
|
+
if (isHydrating.value) {
|
|
309
|
+
const selector = `${name}[data-id="${id}"]`, existingElement = document.querySelector(selector);
|
|
310
|
+
if (existingElement && existingElement instanceof Constructor)
|
|
311
|
+
return existingElement;
|
|
312
|
+
}
|
|
313
|
+
const element = new Constructor();
|
|
314
|
+
return element.setAttribute("data-id", id), element;
|
|
315
|
+
}
|
|
316
|
+
__name(getOrCreateElement, "getOrCreateElement");
|
|
317
|
+
function fillComponentElement(element, jsxTag, attributes, children) {
|
|
318
|
+
const props = __spreadProps(__spreadValues({}, attributes), {
|
|
319
|
+
children
|
|
320
|
+
}), setHtml = props.setHtml;
|
|
321
|
+
delete props.setHtml;
|
|
322
|
+
const result = jsxTag(props);
|
|
323
|
+
result instanceof ElementProps ? appendChildren(element, { setHtml }, result) : result instanceof ComponentProps && appendChildren(element, __spreadProps(__spreadValues({}, result.attributes), { setHtml }), result.children);
|
|
324
|
+
}
|
|
325
|
+
__name(fillComponentElement, "fillComponentElement");
|
|
326
|
+
const isHydrating = { value: !1 }, indexMap = /* @__PURE__ */ new Map();
|
|
327
|
+
function h(jsxTag, attributes, ...children) {
|
|
328
|
+
const processedChildren = processChildren(attributes, children), processedAttributes = __spreadValues({}, attributes);
|
|
329
|
+
return delete processedAttributes.children, typeof jsxTag == "string" ? handleStringTag(jsxTag, processedAttributes, processedChildren) : handleFunctionTag(jsxTag, processedAttributes, processedChildren);
|
|
330
|
+
}
|
|
331
|
+
__name(h, "h");
|
|
332
|
+
function Fragment(children) {
|
|
333
|
+
const fragment = document.createDocumentFragment();
|
|
334
|
+
return appendChildren(fragment, void 0, children), fragment;
|
|
335
|
+
}
|
|
336
|
+
__name(Fragment, "Fragment");
|
|
337
|
+
function render(container, Component, params, children) {
|
|
338
|
+
const element = /* @__PURE__ */ h(Component, __spreadValues({}, params), children);
|
|
339
|
+
return container.append(element), element;
|
|
340
|
+
}
|
|
341
|
+
__name(render, "render");
|
|
342
|
+
function hydrate(Component, params, children) {
|
|
343
|
+
isHydrating.value = !0;
|
|
344
|
+
const element = /* @__PURE__ */ h(Component, __spreadValues({}, params), children);
|
|
345
|
+
return isHydrating.value = !1, element;
|
|
346
|
+
}
|
|
347
|
+
__name(hydrate, "hydrate");
|
|
348
|
+
export {
|
|
349
|
+
Fragment as F,
|
|
350
|
+
activeComponent as a,
|
|
351
|
+
hydrate as b,
|
|
352
|
+
h,
|
|
353
|
+
indexMap as i,
|
|
354
|
+
render as r
|
|
355
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
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 __typeError=msg=>{throw TypeError(msg)};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 __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);const Store=require("./Store-BCW70G3Z.cjs"),string=require("./string-CbRNzmd9.cjs"),morph=require("./morph-Buhxq-X0.cjs"),object=require("./object-DTY_W6xG.cjs");require("construct-style-sheets-polyfill");const intersector_index=require("./index-BpO2RJ__.cjs"),connector_index=require("./connector/index.cjs"),DerivedArray=require("./DerivedArray-DYtWMW0n.cjs");require("./css-value-parser/index.cjs");require("./window-resizer/index.cjs");require("./element-resizer/index.cjs");require("./ticker/index.cjs");const activeComponent={current:null},componentElementLoadingTypes=["idle","load","visible","constructor","connect"];var _loadCallback,_connectCallbacks,_disconnectCallbacks,_loadingType,_idleId,_windowLoadListener,_idleListener,_intersectionListener,_ComponentElement_instances,connect_fn;const _ComponentElement=class _ComponentElement extends HTMLElement{constructor(){super();__privateAdd(this,_ComponentElement_instances);__privateAdd(this,_loadCallback);__privateAdd(this,_connectCallbacks,[]);__privateAdd(this,_disconnectCallbacks,[]);__privateAdd(this,_loadingType,"constructor");__privateAdd(this,_idleId);__privateAdd(this,_windowLoadListener,__name(()=>{window.removeEventListener("load",__privateGet(this,_windowLoadListener)),__privateGet(this,_loadingType)==="load"&&__privateMethod(this,_ComponentElement_instances,connect_fn).call(this)},"#windowLoadListener"));__privateAdd(this,_idleListener,__name(()=>{__privateSet(this,_idleId,void 0),__privateGet(this,_loadingType)==="idle"&&__privateMethod(this,_ComponentElement_instances,connect_fn).call(this)},"#idleListener"));__privateAdd(this,_intersectionListener,__name(entry=>{entry.isIntersecting&&(intersector_index.intersector.unsubscribe(__privateGet(this,_intersectionListener)),__privateGet(this,_loadingType)==="visible"&&__privateMethod(this,_ComponentElement_instances,connect_fn).call(this))},"#intersectionListener"));activeComponent.current=this}addLoadCallback(callback){this.hasAttribute("loading")&&componentElementLoadingTypes.includes(this.getAttribute("loading"))?__privateSet(this,_loadingType,this.getAttribute("loading")):__privateSet(this,_loadingType,"constructor"),__privateSet(this,_loadCallback,callback),__privateGet(this,_loadingType)==="constructor"&&__privateGet(this,_loadCallback).call(this)}addConnectCallback(callback){__privateGet(this,_connectCallbacks).push(callback)}addDisconnectCallback(callback){__privateGet(this,_disconnectCallbacks).push(callback)}connectedCallback(){const windowLoadSetup=__name(()=>{document.readyState==="complete"?__privateGet(this,_windowLoadListener).call(this):window.addEventListener("load",__privateGet(this,_windowLoadListener))},"windowLoadSetup");__privateGet(this,_loadingType)==="connect"||__privateGet(this,_loadingType)==="constructor"?__privateMethod(this,_ComponentElement_instances,connect_fn).call(this):__privateGet(this,_loadingType)==="load"?windowLoadSetup():__privateGet(this,_loadingType)==="idle"?window.requestIdleCallback?__privateSet(this,_idleId,window.requestIdleCallback(__privateGet(this,_idleListener))):windowLoadSetup():__privateGet(this,_loadingType)==="visible"&&intersector_index.intersector.subscribe(this,__privateGet(this,_intersectionListener)),activeComponent.current===this&&(activeComponent.current=null)}disconnectedCallback(){__privateGet(this,_disconnectCallbacks).forEach(callback=>{callback(this)}),__privateSet(this,_connectCallbacks,[]),__privateSet(this,_disconnectCallbacks,[]),activeComponent.current===this&&(activeComponent.current=null),window.removeEventListener("load",__privateGet(this,_windowLoadListener)),window.cancelIdleCallback&&__privateGet(this,_idleId)&&window.cancelIdleCallback(__privateGet(this,_idleId)),intersector_index.intersector.unsubscribe(__privateGet(this,_intersectionListener))}};_loadCallback=new WeakMap,_connectCallbacks=new WeakMap,_disconnectCallbacks=new WeakMap,_loadingType=new WeakMap,_idleId=new WeakMap,_windowLoadListener=new WeakMap,_idleListener=new WeakMap,_intersectionListener=new WeakMap,_ComponentElement_instances=new WeakSet,connect_fn=__name(function(){var _a;activeComponent.current=this,this.querySelectorAll("[data-fallback]").forEach(el=>{el.remove()}),__privateGet(this,_loadingType)!=="constructor"&&((_a=__privateGet(this,_loadCallback))==null||_a.call(this)),__privateGet(this,_connectCallbacks).forEach(callback=>{const unsub=callback(this);unsub&&__privateGet(this,_disconnectCallbacks).push(unsub)}),activeComponent.current===this&&(activeComponent.current=null)},"#connect"),__name(_ComponentElement,"ComponentElement");let ComponentElement=_ComponentElement;function subscribeToStore(element,store,callback){const unsubscribe=store.subscribe(e=>{callback(e)});connector_index.connector.subscribe(element,{disconnectCallback:__name(()=>{unsubscribe()},"disconnectCallback"),maxWaitSec:20,unsubscribeAfterDisconnect:!0})}__name(subscribeToStore,"subscribeToStore");function setClassAttribute(element,classes){classes&&(classes instanceof Store.Store?subscribeToStore(element,classes,e=>{e.previous&&element.classList.remove(e.previous.toString()),e.current&&element.classList.add(e.current.toString())}):typeof classes=="object"&&!Array.isArray(classes)?Object.entries(classes).forEach(([key,value])=>{value instanceof Store.Store?subscribeToStore(element,value,e=>{element.classList.toggle(key,!!e.current)}):value&&element.classList.add(key)}):Array.isArray(classes)?classes.forEach(item=>{typeof item=="string"?element.classList.add(item):setClassAttribute(element,item)}):classes.toString().split(" ").map(v=>element.classList.add(v.trim())))}__name(setClassAttribute,"setClassAttribute");function setStyleAttribute(element,value){value&&(typeof value=="object"?Object.entries(value).forEach(([key,value2])=>{value2 instanceof Store.Store?subscribeToStore(element,value2,e=>{var _a;element.style[key]=(_a=e.current)==null?void 0:_a.toString()}):(typeof value2=="number"||typeof value2=="string"||typeof value2=="boolean")&&(element.style[key]=value2.toString())}):typeof value=="string"&&(element.style=value))}__name(setStyleAttribute,"setStyleAttribute");function setAttribute(element,key,value){key==="ref"&&value?Array.isArray(value)?value.forEach(v=>{typeof v=="object"&&"value"in v&&(v.value=element)}):typeof value=="object"&&"value"in value&&(value.value=element):key==="className"||key==="class"?setClassAttribute(element,value):key==="style"?setStyleAttribute(element,value):key==="setHtml"&&value!=null?element.innerHTML=value:typeof value=="number"?key==="tabIndex"?element.setAttribute("tabindex",value.toString()):setAttribute(element,key,value.toString()):typeof value=="string"?key==="htmlFor"?element.setAttribute("for",value):element.setAttribute(key,value):typeof value=="boolean"?value?element.setAttribute(key,""):element.removeAttribute(key):value instanceof Store.Store&&subscribeToStore(element,value,e=>{key in element?element[key]=e.current:setAttribute(element,key,e.current)})}__name(setAttribute,"setAttribute");function setAttributes(ele,attributes){for(const[key,value]of Object.entries(attributes!=null?attributes:{}))typeof value=="function"&&key.startsWith("on")?ele.addEventListener(string.uncapitalize(key.replace("on","")),value):setAttribute(ele,key,value)}__name(setAttributes,"setAttributes");function createElement(tag,isSVG){return tag==="svg"?document.createElementNS("http://www.w3.org/2000/svg","svg"):isSVG?document.createElementNS("http://www.w3.org/2000/svg",tag):document.createElement(tag)}__name(createElement,"createElement");function filterChildren(children){const filtered=[];return(Array.isArray(children)?children:[children]).forEach(child=>{child!=null&&(typeof child=="number"?filtered.push(child.toString()):Array.isArray(child)?child.forEach(c=>{filtered.push(...filterChildren(c))}):filtered.push(child))}),filtered}__name(filterChildren,"filterChildren");function hydrateTextNode(element,newChild,index){const existingChild=element.childNodes[index];existingChild&&existingChild.nodeType===Node.TEXT_NODE?existingChild.textContent!==String(newChild)&&(console.warn(`Hydration text mismatch: expected "${newChild}", got "${existingChild.textContent}"`),existingChild.textContent=String(newChild)):newChild!=null&&newChild!==""&&element.insertBefore(document.createTextNode(String(newChild)),element.childNodes[index]||null)}__name(hydrateTextNode,"hydrateTextNode");function storeChildren(element,store){const currentChildNodes=[...element.childNodes].filter(node=>node.__storeId===store.id),newChildren=store.current,newChildrenArray=Array.isArray(newChildren)?newChildren:[newChildren],newNodes=[];if(newChildrenArray.forEach(newChild=>{let newNode=null;typeof newChild=="boolean"||typeof newChild=="number"||typeof newChild=="string"?newNode=document.createTextNode(newChild.toString()):newChild instanceof Node&&(newNode=newChild),newNode&&(newNode.__storeId=store.id,newNodes.push(newNode))}),store instanceof DerivedArray.DerivedKeyedArray){const nodesToStay=[];newNodes.forEach((newNode,i)=>{const oldNode=currentChildNodes.find(oldNode2=>oldNode2.__key===newNode.__key);oldNode?oldNode.isEqualNode(newNode)?nodesToStay.push(oldNode):(oldNode.replaceWith(newNode),nodesToStay.push(newNode)):(nodesToStay.push(newNode),element.appendChild(newNode))}),currentChildNodes.forEach(currentNode=>{nodesToStay.includes(currentNode)||currentNode.remove()})}else newNodes.forEach((node,i)=>{var _a;const founded=currentChildNodes[i];if(founded)founded.isEqualNode(node)||(founded.replaceWith(node),currentChildNodes[i]=node);else{const lastChildNode=currentChildNodes[currentChildNodes.length-1];lastChildNode?(_a=lastChildNode.parentNode)==null||_a.insertBefore(node,lastChildNode.nextSibling):element.appendChild(node)}}),currentChildNodes.slice(newNodes.length).forEach(node=>{node.remove()})}__name(storeChildren,"storeChildren");const _Props=class _Props{constructor(tag,attributes,children){this.tag=tag,this.attributes=attributes,this.children=children}};__name(_Props,"Props");let Props=_Props;const _ComponentProps=class _ComponentProps extends Props{};__name(_ComponentProps,"ComponentProps");let ComponentProps=_ComponentProps;const _ElementProps=class _ElementProps extends Props{};__name(_ElementProps,"ElementProps");let ElementProps=_ElementProps;const _HeadProps=class _HeadProps extends Props{};__name(_HeadProps,"HeadProps");let HeadProps=_HeadProps;function appendChildren(element,attributes,children,isSVG=!1){const filteredChildren=filterChildren(children);setAttributes(element,attributes),filteredChildren.forEach((child,index)=>{handleChild(element,child,index,isSVG)})}__name(appendChildren,"appendChildren");function handleChild(element,child,index,isSVG){child instanceof Store.Store?handleStoreChild(element,child):child instanceof ComponentProps?handleComponentProps(element,child):child instanceof ElementProps?handleElementProps(element,child,index,isSVG):child instanceof HeadProps?handleHeadProps(child):handleTextNode(element,child,index)}__name(handleChild,"handleChild");function handleStoreChild(element,child){subscribeToStore(element,child,()=>{storeChildren(element,child)})}__name(handleStoreChild,"handleStoreChild");function handleComponentProps(element,child){child.tag==="shadow"&&element.shadowRoot?appendChildren(element.shadowRoot,child.attributes,child.children):appendChildren(element,child.attributes,child.children)}__name(handleComponentProps,"handleComponentProps");function handleElementProps(element,child,index,isSVG){let childElement=null;if(isHydrating.value){const existingChild=element.children[index];(existingChild==null?void 0:existingChild.nodeName.toLowerCase())===child.tag?(childElement=existingChild,appendChildren(childElement,child.attributes,child.children,isSVG)):(childElement=createElement(child.tag,isSVG),appendChildren(childElement,child.attributes,child.children,isSVG),element.append(childElement))}else childElement=createElement(child.tag,isSVG),appendChildren(childElement,child.attributes,child.children,isSVG),element.append(childElement)}__name(handleElementProps,"handleElementProps");function handleHeadProps(child){const headElement=document.createElement(child.tag);appendChildren(headElement,child.attributes,child.children);const patches=morph.diff(document.head,headElement);morph.patch(document.head,patches)}__name(handleHeadProps,"handleHeadProps");function handleTextNode(element,child,index){isHydrating.value?hydrateTextNode(element,child,index):element.append(child)}__name(handleTextNode,"handleTextNode");function processChildren(attributes,children){let result=children.filter(Boolean).length?children:attributes==null?void 0:attributes.children;return result?result.flat(2):[]}__name(processChildren,"processChildren");function handleStringTag(tag,attributes,children){switch(tag){case"component":case"shadow":return new ComponentProps(tag,attributes,children);case"head":return new HeadProps(tag,attributes,children);default:return new ElementProps(tag,attributes,children)}}__name(handleStringTag,"handleStringTag");function handleFunctionTag(jsxTag,attributes,children){return object.isESClass(jsxTag)?createClassElement(jsxTag,attributes,children):jsxTag===Fragment?Fragment(children):jsxTag.template?jsxTag(__spreadValues({},attributes)):createCustomElement(jsxTag,attributes,children)}__name(handleFunctionTag,"handleFunctionTag");function createClassElement(jsxTag,attributes,children){const element=new jsxTag;return appendChildren(element,attributes,children),element}__name(createClassElement,"createClassElement");function createCustomElement(jsxTag,attributes,children){const name=jsxTag.define||`e-${string.camelToKebab(jsxTag.name)}`,Constructor=getOrDefineCustomElement(name,jsxTag),id=generateElementId(jsxTag.name,attributes),element=getOrCreateElement(name,id,Constructor);return fillComponentElement(element,jsxTag,attributes,children),element}__name(createCustomElement,"createCustomElement");function getOrDefineCustomElement(name,jsxTag){var _a;let Constructor=customElements.get(name);return Constructor||(Constructor=(_a=class extends ComponentElement{constructor(){super()}},__name(_a,"Constructor"),_a.formAssociated=jsxTag.formAssociated,_a),customElements.define(name,Constructor)),Constructor}__name(getOrDefineCustomElement,"getOrDefineCustomElement");function generateElementId(tagName,attributes){if(attributes!=null&&attributes.__hydrationId)return attributes.__hydrationId;const index=(indexMap.get(tagName)||0)+1;return indexMap.set(tagName,index),`${tagName}-${index}`}__name(generateElementId,"generateElementId");function getOrCreateElement(name,id,Constructor){if(isHydrating.value){const selector=`${name}[data-id="${id}"]`,existingElement=document.querySelector(selector);if(existingElement&&existingElement instanceof Constructor)return existingElement}const element=new Constructor;return element.setAttribute("data-id",id),element}__name(getOrCreateElement,"getOrCreateElement");function fillComponentElement(element,jsxTag,attributes,children){const props=__spreadProps(__spreadValues({},attributes),{children}),setHtml=props.setHtml;delete props.setHtml;const result=jsxTag(props);result instanceof ElementProps?appendChildren(element,{setHtml},result):result instanceof ComponentProps&&appendChildren(element,__spreadProps(__spreadValues({},result.attributes),{setHtml}),result.children)}__name(fillComponentElement,"fillComponentElement");const isHydrating={value:!1},indexMap=new Map;function h(jsxTag,attributes,...children){const processedChildren=processChildren(attributes,children),processedAttributes=__spreadValues({},attributes);return delete processedAttributes.children,typeof jsxTag=="string"?handleStringTag(jsxTag,processedAttributes,processedChildren):handleFunctionTag(jsxTag,processedAttributes,processedChildren)}__name(h,"h");function Fragment(children){const fragment=document.createDocumentFragment();return appendChildren(fragment,void 0,children),fragment}__name(Fragment,"Fragment");function render(container,Component,params,children){const element=h(Component,__spreadValues({},params),children);return container.append(element),element}__name(render,"render");function hydrate(Component,params,children){isHydrating.value=!0;const element=h(Component,__spreadValues({},params),children);return isHydrating.value=!1,element}__name(hydrate,"hydrate");exports.Fragment=Fragment;exports.activeComponent=activeComponent;exports.h=h;exports.hydrate=hydrate;exports.indexMap=indexMap;exports.render=render;
|