@vanelsas/baredom 2.2.0 → 2.3.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/CHANGELOG.md +12 -0
- package/README.md +3 -3
- package/dist/base.js +402 -393
- package/dist/x-alert.js +17 -17
- package/dist/x-avatar-group.js +11 -11
- package/dist/x-avatar.js +14 -14
- package/dist/x-badge.js +11 -11
- package/dist/x-bento-grid.js +5 -5
- package/dist/x-bento-item.js +4 -4
- package/dist/x-breadcrumbs.js +14 -14
- package/dist/x-button.js +15 -15
- package/dist/x-cancel-dialogue.js +16 -16
- package/dist/x-card.js +7 -7
- package/dist/x-carousel.js +29 -29
- package/dist/x-chart.js +46 -46
- package/dist/x-checkbox.js +11 -11
- package/dist/x-chip.js +8 -8
- package/dist/x-collapse.js +10 -10
- package/dist/x-color-picker.js +41 -41
- package/dist/x-combobox.js +28 -0
- package/dist/x-command-palette.js +25 -25
- package/dist/x-container.js +6 -6
- package/dist/x-context-menu.js +18 -18
- package/dist/x-copy.js +22 -22
- package/dist/x-currency-field.js +21 -21
- package/dist/x-date-picker.js +37 -37
- package/dist/x-divider.js +8 -8
- package/dist/x-drawer.js +11 -11
- package/dist/x-dropdown.js +9 -9
- package/dist/x-fieldset.js +5 -5
- package/dist/x-file-download.js +7 -7
- package/dist/x-form-field.js +15 -15
- package/dist/x-form.js +9 -9
- package/dist/x-gaussian-blur.js +18 -18
- package/dist/x-grid.js +6 -6
- package/dist/x-icon.js +7 -7
- package/dist/x-image.js +18 -18
- package/dist/x-kinetic-font.js +28 -28
- package/dist/x-kinetic-typography.js +37 -37
- package/dist/x-liquid-dock.js +35 -35
- package/dist/x-liquid-fill.js +40 -40
- package/dist/x-liquid-glass.js +36 -36
- package/dist/x-menu-item.js +10 -10
- package/dist/x-menu.js +10 -10
- package/dist/x-metaball-cursor.js +25 -25
- package/dist/x-modal.js +12 -12
- package/dist/x-morph-stack.js +39 -39
- package/dist/x-navbar.js +12 -12
- package/dist/x-neural-glow.js +31 -31
- package/dist/x-notification-center.js +10 -10
- package/dist/x-organic-divider.js +15 -15
- package/dist/x-organic-progress.js +35 -35
- package/dist/x-organic-shape.js +12 -12
- package/dist/x-pagination.js +16 -16
- package/dist/x-particle-button.js +47 -47
- package/dist/x-popover.js +14 -14
- package/dist/x-progress-circle.js +7 -7
- package/dist/x-progress.js +7 -7
- package/dist/x-radio.js +11 -11
- package/dist/x-ripple-effect.js +11 -11
- package/dist/x-scroll-parallax.js +17 -17
- package/dist/x-scroll-stack.js +18 -18
- package/dist/x-scroll-story.js +34 -34
- package/dist/x-scroll-timeline.js +45 -45
- package/dist/x-scroll.js +40 -40
- package/dist/x-search-field.js +14 -14
- package/dist/x-select.js +9 -9
- package/dist/x-sidebar.js +16 -16
- package/dist/x-skeleton-group.js +15 -0
- package/dist/x-skeleton.js +1 -6
- package/dist/x-slider.js +16 -16
- package/dist/x-soft-body.js +20 -20
- package/dist/x-spacer.js +5 -5
- package/dist/x-spinner.js +5 -5
- package/dist/x-splash.js +13 -13
- package/dist/x-stat.js +9 -9
- package/dist/x-stepper.js +15 -16
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +7 -7
- package/dist/x-table-cell.js +19 -19
- package/dist/x-table-row.js +10 -10
- package/dist/x-table.js +13 -13
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +17 -17
- package/dist/x-theme.js +25 -25
- package/dist/x-timeline-item.js +20 -20
- package/dist/x-timeline.js +9 -9
- package/dist/x-toast.js +21 -21
- package/dist/x-toaster.js +8 -8
- package/dist/x-tooltip.js +14 -0
- package/dist/x-typography.js +8 -8
- package/package.json +13 -1
package/dist/x-liquid-glass.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
typeof a==="string"?a.trim().toLowerCase():null);return $APP.n(a)?a:
|
|
4
|
-
.4,.1,1),b!=null,function(){var A=
|
|
5
|
-
|
|
2
|
+
var PU=function(a,b,c,d){if(typeof a==="string"){a=a.trim();if($APP.C.i(a,""))return b;a=parseFloat(a);return $APP.n(isNaN(a))?b:Math.min(d,Math.max(c,a))}return b},QU=function(a){if(typeof a==="string"){a=a.trim();if($APP.C.i(a,""))return 5;a=parseInt(a,10);return $APP.n(isNaN(a))?5:Math.min(8,Math.max(3,a))}return 5},RU=function(a){return typeof a==="string"?(a=a.trim(),$APP.N(a,"")?a:null):null},SU=function(a){return typeof a==="string"?(a=a.trim(),$APP.N(a,"")?a:null):null},VU=function(a){a=$APP.D(TU,
|
|
3
|
+
typeof a==="string"?a.trim().toLowerCase():null);return $APP.n(a)?a:UU},nV=function(a){var b=$APP.M(a);a=$APP.D(b,$APP.Wi);var c=$APP.D(b,WU),d=$APP.D(b,XU),e=$APP.D(b,$APP.Wl),g=$APP.D(b,YU),h=$APP.D(b,ZU),l=$APP.D(b,$APP.dl),m=$APP.D(b,$U),p=$APP.D(b,aV),q=$APP.D(b,bV),v=$APP.D(b,cV),x=$APP.D(b,dV),y=$APP.D(b,eV);b=$APP.D(b,fV);return $APP.zf([gV,hV,iV,$APP.wj,$APP.mj,jV,kV,lV,$APP.Qk,$APP.fi,$APP.Pk,$APP.um,mV,$APP.X],[PU(q,.5,0,1),PU(y,10,4,20),PU(h,.15,.05,.4),PU(p,.3,.05,2),VU(l),RU(d),PU(c,
|
|
4
|
+
.4,.1,1),b!=null,function(){var A=SU(v);return $APP.n(A)?A:"rgba(244,114,182,0.35)"}(),PU(e,12,0,40),function(){var A=SU(x);return $APP.n(A)?A:"rgba(99,102,241,0.4)"}(),QU(g),PU(m,.3,0,1),a!=null])},oV=function(a,b,c){return Math.sin(a*1.7+c*.3)*Math.cos(b*2.3+c*.5)*.5+Math.sin(a*3.1-c*.7)*Math.cos(b*1.3+c*.2)*.25+Math.sin(a*5.3+c*.4)*Math.cos(b*4.7-c*.6)*.125},qV=function(){var a=$APP.k(pV,"v");pV.v=a+1;return a},rV=function(){return $APP.F(window.matchMedia("(prefers-reduced-motion:reduce)").matches)},
|
|
5
|
+
yV=function(a){var b=qV(),c=a.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElementNS("http://www.w3.org/2000/svg","svg"),g=document.createElementNS("http://www.w3.org/2000/svg","defs"),h=document.createElementNS("http://www.w3.org/2000/svg","filter"),l=document.createElementNS("http://www.w3.org/2000/svg","feGaussianBlur"),m=document.createElementNS("http://www.w3.org/2000/svg","feColorMatrix"),p=document.createElementNS("http://www.w3.org/2000/svg","g"),q=document.createElementNS("http://www.w3.org/2000/svg",
|
|
6
6
|
"ellipse"),v=document.createElement("div"),x=document.createElement("div"),y=document.createElement("div"),A=document.createElement("div"),B=document.createElement("div"),E=document.createElement("slot"),H="lg-goo-"+$APP.T.g(b);a.__xLiquidGlassUID=b;d.textContent=":host{display:block;position:relative;isolation:isolate;min-width:120px;min-height:80px;"+$APP.T.g("--x-liquid-glass-padding")+":1.5rem;"+$APP.T.g("--x-liquid-glass-specular-color")+":rgba(255,255,255,0.6);"+$APP.T.g("--x-liquid-glass-spring")+
|
|
7
7
|
":"+$APP.T.g("linear(0, 0.006, 0.025, 0.058, 0.104, 0.163, 0.234, 0.315, 0.403, 0.496, 0.591, 0.685, 0.774, 0.856, 0.926, 0.983, 1.025, 1.052, 1.065, 1.063, 1.049, 1.025, 0.995, 0.961, 0.927, 0.896, 0.870, 0.850, 0.837, 0.831, 0.832, 0.839, 0.851, 0.867, 0.885, 0.903, 0.921, 0.937, 0.951, 0.962, 0.970, 0.976, 0.979, 0.981, 0.981, 0.980, 0.979, 0.977, 0.976, 0.975, 0.975, 0.976, 0.977, 0.979, 0.981, 0.983, 0.986, 0.989, 0.992, 0.995, 0.998, 1)")+";"+$APP.T.g("--x-liquid-glass-spring-duration")+":"+
|
|
8
8
|
$APP.T.g("600ms")+";}[part\x3dsvg]{display:block;width:100%;height:100%;position:absolute;inset:0;overflow:visible;pointer-events:none;z-index:1;}[part\x3dglass]{position:absolute;inset:0;backdrop-filter:blur(var("+$APP.T.g("--x-liquid-glass-blur")+",12px)) saturate(180%);-webkit-backdrop-filter:blur(var("+$APP.T.g("--x-liquid-glass-blur")+",12px)) saturate(180%);z-index:0;}[part\x3dgrain]{position:absolute;inset:0;z-index:2;opacity:0.4;pointer-events:none;}[part\x3dgradient]{position:absolute;inset:0;z-index:1;pointer-events:none;}[part\x3dspecular]{position:absolute;inset:0;z-index:1;opacity:0;pointer-events:none;transition:background var("+
|
|
@@ -11,38 +11,38 @@ $APP.T.g("--x-liquid-glass-spring-duration")+","+$APP.T.g("600ms")+") var("+$APP
|
|
|
11
11
|
");}[part\x3dcontent]{position:relative;padding:var("+$APP.T.g("--x-liquid-glass-padding")+",1.5rem);z-index:3;}@keyframes lg-enter{from{opacity:0;transform:scale(0.92);}to{opacity:1;transform:scale(1);}}:host([data-entering]) [part\x3dglass],:host([data-entering]) [part\x3dsvg]{animation:lg-enter var("+$APP.T.g("--x-liquid-glass-spring-duration")+","+$APP.T.g("600ms")+") var("+$APP.T.g("--x-liquid-glass-spring")+","+$APP.T.g("linear(0, 0.006, 0.025, 0.058, 0.104, 0.163, 0.234, 0.315, 0.403, 0.496, 0.591, 0.685, 0.774, 0.856, 0.926, 0.983, 1.025, 1.052, 1.065, 1.063, 1.049, 1.025, 0.995, 0.961, 0.927, 0.896, 0.870, 0.850, 0.837, 0.831, 0.832, 0.839, 0.851, 0.867, 0.885, 0.903, 0.921, 0.937, 0.951, 0.962, 0.970, 0.976, 0.979, 0.981, 0.981, 0.980, 0.979, 0.977, 0.976, 0.975, 0.975, 0.976, 0.977, 0.979, 0.981, 0.983, 0.986, 0.989, 0.992, 0.995, 0.998, 1)")+
|
|
12
12
|
") both;}@media(prefers-color-scheme:dark){:host{"+$APP.T.g("--x-liquid-glass-specular-color")+":rgba(255,255,255,0.3);}}@media(prefers-reduced-motion:reduce){:host([data-entering]) [part\x3dglass],:host([data-entering]) [part\x3dsvg]{animation:none;}[part\x3dspecular]{transition:none!important;}}";e.setAttribute("part","svg");e.setAttribute("viewBox","0 0 300 200");e.setAttribute("preserveAspectRatio","none");e.setAttribute("aria-hidden","true");h.setAttribute("id",H);l.setAttribute("in","SourceGraphic");
|
|
13
13
|
l.setAttribute("stdDeviation","10");l.setAttribute("result","blur");m.setAttribute("in","blur");m.setAttribute("mode","matrix");m.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9");h.appendChild(l);h.appendChild(m);g.appendChild(h);e.appendChild(g);p.setAttribute("filter","url(#"+$APP.T.g(H)+")");p.setAttribute("opacity","0.35");q.setAttribute("class","blob-core");p.appendChild(q);e.appendChild(p);m=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");var G="lg-edge-"+
|
|
14
|
-
$APP.T.g(b),
|
|
15
|
-
"0.15");
|
|
16
|
-
"none");G.setAttribute("stroke","url(#"+$APP.T.g(
|
|
17
|
-
"0.6");
|
|
18
|
-
m.setAttribute("maskUnits","userSpaceOnUse");m.setAttribute("maskContentUnits","userSpaceOnUse");G.setAttribute("filter","url(#"+$APP.T.g(H)+")");
|
|
14
|
+
$APP.T.g(b),J=document.createElementNS("http://www.w3.org/2000/svg","stop"),R=document.createElementNS("http://www.w3.org/2000/svg","stop"),aa=document.createElementNS("http://www.w3.org/2000/svg","stop");m.setAttribute("id",G);m.setAttribute("x1","0");m.setAttribute("y1","0");m.setAttribute("x2","1");m.setAttribute("y2","1");J.setAttribute("offset","0%");J.setAttribute("stop-color","white");J.setAttribute("stop-opacity","0.9");R.setAttribute("offset","50%");R.setAttribute("stop-color","white");R.setAttribute("stop-opacity",
|
|
15
|
+
"0.15");aa.setAttribute("offset","100%");aa.setAttribute("stop-color","white");aa.setAttribute("stop-opacity","0.5");m.appendChild(J);m.appendChild(R);m.appendChild(aa);g.appendChild(m);a.__xLiquidGlassEdgeId=G;m=document.createElementNS("http://www.w3.org/2000/svg","g");G=document.createElementNS("http://www.w3.org/2000/svg","ellipse");J=$APP.k(a,"__xLiquidGlassEdgeId");m.setAttribute("filter","url(#"+$APP.T.g(H)+")");m.setAttribute("opacity","0.7");G.setAttribute("class","blob-border");G.setAttribute("fill",
|
|
16
|
+
"none");G.setAttribute("stroke","url(#"+$APP.T.g(J)+")");G.setAttribute("stroke-width","2.5");m.appendChild(G);e.appendChild(m);a.__xLiquidGlassBorderG=m;a.__xLiquidGlassBorderCore=G;m=document.createElementNS("http://www.w3.org/2000/svg","filter");G="lg-grain-"+$APP.T.g(b);J=document.createElementNS("http://www.w3.org/2000/svg","feTurbulence");R=document.createElementNS("http://www.w3.org/2000/svg","feColorMatrix");m.setAttribute("id",G);J.setAttribute("type","fractalNoise");J.setAttribute("baseFrequency",
|
|
17
|
+
"0.6");J.setAttribute("numOctaves","3");J.setAttribute("stitchTiles","stitch");R.setAttribute("type","matrix");R.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0");m.appendChild(J);m.appendChild(R);g.appendChild(m);a.__xLiquidGlassGrainId=G;m=document.createElementNS("http://www.w3.org/2000/svg","mask");b="lg-mask-"+$APP.T.g(b);G=document.createElementNS("http://www.w3.org/2000/svg","g");J=document.createElementNS("http://www.w3.org/2000/svg","ellipse");m.setAttribute("id",b);
|
|
18
|
+
m.setAttribute("maskUnits","userSpaceOnUse");m.setAttribute("maskContentUnits","userSpaceOnUse");G.setAttribute("filter","url(#"+$APP.T.g(H)+")");J.setAttribute("fill","white");G.appendChild(J);m.appendChild(G);g.appendChild(m);a.__xLiquidGlassMaskG=G;a.__xLiquidGlassMaskCore=J;$APP.ja(a,"__xLiquidGlassMaskSats",[]);a.__xLiquidGlassMaskId=b;v.setAttribute("part","glass");g="url(#"+$APP.T.g($APP.k(a,"__xLiquidGlassMaskId"))+")";v.style.mask=g;v.style.webkitMask=g;x.setAttribute("part","grain");x.style.filter=
|
|
19
19
|
"url(#"+$APP.T.g($APP.k(a,"__xLiquidGlassGrainId"))+")";g="url(#"+$APP.T.g($APP.k(a,"__xLiquidGlassMaskId"))+")";x.style.mask=g;x.style.webkitMask=g;y.setAttribute("part","gradient");g="url(#"+$APP.T.g($APP.k(a,"__xLiquidGlassMaskId"))+")";y.style.mask=g;y.style.webkitMask=g;A.setAttribute("part","specular");g="url(#"+$APP.T.g($APP.k(a,"__xLiquidGlassMaskId"))+")";A.style.mask=g;A.style.webkitMask=g;B.setAttribute("part","content");B.appendChild(E);c.appendChild(d);c.appendChild(v);c.appendChild(e);
|
|
20
|
-
c.appendChild(x);c.appendChild(y);c.appendChild(A);c.appendChild(B);a.setAttribute("data-entering","");setTimeout(function(){return a.removeAttribute("data-entering")},700);$APP.
|
|
21
|
-
d){var B=2*Math.PI*(A/d);x[A]=e+q*Math.cos(B);y[A]=g+v*Math.sin(B);A+=1}else break;q=[x,y];v=$APP.M($APP.k(a,"__xLiquidGlassRefs"));v=$APP.D(v,
|
|
22
|
-
$APP.k(a,"__xLiquidGlassBorderCore");$APP.n(h)&&(h.setAttribute("cx",""+$APP.T.g(e)),h.setAttribute("cy",""+$APP.T.g(g)),h.setAttribute("rx",""+$APP.T.g(b)),h.setAttribute("ry",""+$APP.T.g(c)));g=$APP.k(a,"__xLiquidGlassRefs");e=$APP.
|
|
23
|
-
"ellipse"),l.setAttribute("class","blob-sat-"+$APP.T.g(h)),l.setAttribute("fill","#ffffff"),e.appendChild(l),g.push(l),$APP.n(c)&&(l=document.createElementNS("http://www.w3.org/2000/svg","ellipse"),l.setAttribute("fill","white"),c.appendChild(l),b.push(l)),h+=1;else break;e=$APP.M($APP.k(a,"__xLiquidGlassRefs"));e=$APP.D(e,
|
|
24
|
-
b.setAttribute("rx",""+$APP.T.g(m)),b.setAttribute("ry",""+$APP.T.g(p))),c+=1;else break;a.__xLiquidGlassRX=q[0];a.__xLiquidGlassRY=q[1]},
|
|
25
|
-
"#ffffff"),h+=1;else break;h=$APP.C.i(
|
|
26
|
-
d.style.zIndex="3",d.style.filter="",d.style.opacity="",d.style.mask="",d.style.webkitMask="",l.setAttribute("opacity","0.35"),$APP.n(c)&&(c.style.opacity="0.4"),a.style.contain="";$APP.n(
|
|
27
|
-
|
|
28
|
-
g=$APP.k(a,"__xLiquidGlassPY"),h=$APP.k(a,"__xLiquidGlassW");a=$APP.k(a,"__xLiquidGlassH");h=
|
|
29
|
-
|
|
30
|
-
performance.now()),$APP.
|
|
31
|
-
e[g];m.setAttribute("cx",h);m.setAttribute("cy",l)}$APP.n($APP.n(a)?g<a.length:a)&&(m=a[g],m.setAttribute("cx",h),m.setAttribute("cy",l));g+=1}else break},
|
|
32
|
-
"0"),d.setAttribute("y","0"),d.setAttribute("width",""+$APP.T.g(b)),d.setAttribute("height",""+$APP.T.g(c)));
|
|
33
|
-
e.clientX-g.left;a.__xLiquidGlassPY=e.clientY-g.top;return null}$APP.
|
|
34
|
-
function(a){return
|
|
35
|
-
b;var c=$APP.k(a,"__xLiquidGlassW"),d=$APP.k(a,"__xLiquidGlassH");$APP.n($APP.n(c)?$APP.n(d)?c>0&&d>0:d:c)&&(
|
|
36
|
-
enumerable:!0,configurable:!0});Object.defineProperty(a,"speed",{get:function(){var b=this.getAttribute("speed");return
|
|
37
|
-
configurable:!0});Object.defineProperty(a,"blur",{get:function(){var b=this.getAttribute("blur");return
|
|
20
|
+
c.appendChild(x);c.appendChild(y);c.appendChild(A);c.appendChild(B);a.setAttribute("data-entering","");setTimeout(function(){return a.removeAttribute("data-entering")},700);$APP.ja(a,"__xLiquidGlassRefs",$APP.zf([$APP.ri,$APP.Yk,sV,$APP.xl,tV,uV,$APP.fi,$APP.yi,vV,$APP.bk,wV,xV],[B,A,v,p,h,[],l,c,y,e,q,x]))},zV=function(a,b,c){var d=$APP.um.g($APP.k(a,"__xLiquidGlassModel")),e=b/2,g=c/2,h=b*.32,l=c*.32,m=h*.55,p=l*.55;var q=h*.9;for(var v=l*.9,x=new Float64Array(d),y=new Float64Array(d),A=0;;)if(A<
|
|
21
|
+
d){var B=2*Math.PI*(A/d);x[A]=e+q*Math.cos(B);y[A]=g+v*Math.sin(B);A+=1}else break;q=[x,y];v=$APP.M($APP.k(a,"__xLiquidGlassRefs"));v=$APP.D(v,wV);v.setAttribute("cx",""+$APP.T.g(e));v.setAttribute("cy",""+$APP.T.g(g));v.setAttribute("rx",""+$APP.T.g(h));v.setAttribute("ry",""+$APP.T.g(l));v=$APP.k(a,"__xLiquidGlassMaskCore");$APP.n(v)&&(v.setAttribute("cx",""+$APP.T.g(e)),v.setAttribute("cy",""+$APP.T.g(g)),v.setAttribute("rx",""+$APP.T.g(h)),v.setAttribute("ry",""+$APP.T.g(l)));b*=.44;c*=.44;h=
|
|
22
|
+
$APP.k(a,"__xLiquidGlassBorderCore");$APP.n(h)&&(h.setAttribute("cx",""+$APP.T.g(e)),h.setAttribute("cy",""+$APP.T.g(g)),h.setAttribute("rx",""+$APP.T.g(b)),h.setAttribute("ry",""+$APP.T.g(c)));g=$APP.k(a,"__xLiquidGlassRefs");e=$APP.xl.g(g);g=uV.g(g);c=$APP.k(a,"__xLiquidGlassMaskG");b=$APP.k(a,"__xLiquidGlassMaskSats");for(h=g.length-1;;)if(h>=d)e.removeChild(g[h]),$APP.n(c)&&c.removeChild(b[h]),--h;else break;g.length>d&&(g.length=d,$APP.n(b)&&(b.length=d));for(h=g.length;;)if(h<d)l=document.createElementNS("http://www.w3.org/2000/svg",
|
|
23
|
+
"ellipse"),l.setAttribute("class","blob-sat-"+$APP.T.g(h)),l.setAttribute("fill","#ffffff"),e.appendChild(l),g.push(l),$APP.n(c)&&(l=document.createElementNS("http://www.w3.org/2000/svg","ellipse"),l.setAttribute("fill","white"),c.appendChild(l),b.push(l)),h+=1;else break;e=$APP.M($APP.k(a,"__xLiquidGlassRefs"));e=$APP.D(e,uV);g=$APP.k(a,"__xLiquidGlassMaskSats");for(c=0;;)if(c<d)b=e[c],b.setAttribute("rx",""+$APP.T.g(m)),b.setAttribute("ry",""+$APP.T.g(p)),$APP.n($APP.n(g)?c<g.length:g)&&(b=g[c],
|
|
24
|
+
b.setAttribute("rx",""+$APP.T.g(m)),b.setAttribute("ry",""+$APP.T.g(p))),c+=1;else break;a.__xLiquidGlassRX=q[0];a.__xLiquidGlassRY=q[1]},BV=function(a){var b=$APP.k(a,"__xLiquidGlassModel"),c=$APP.k(a,"__xLiquidGlassRefs"),d=$APP.fi.g(c),e=sV.g(c),g=$APP.Yk.g(c),h=wV.g(c),l=$APP.xl.g(c);d.setAttribute("stdDeviation",""+$APP.T.g(hV.g(b)));e.style.setProperty("--x-liquid-glass-blur",""+$APP.T.g($APP.fi.g(b))+"px");h.setAttribute("fill","#ffffff");d=uV.g(c);e=d.length;for(h=0;;)if(h<e)d[h].setAttribute("fill",
|
|
25
|
+
"#ffffff"),h+=1;else break;h=$APP.C.i(AV,$APP.mj.g(b));d=$APP.ri.g(c);c=xV.g(c);e="url(#"+$APP.T.g($APP.k(a,"__xLiquidGlassMaskId"))+")";if(h){d.style.position="relative";d.style.zIndex="0";h=gV.g(b);var m=1-h*.5,p=h*.35,q=h*.2;d.style.filter="blur("+$APP.T.g((h*2).toFixed(1))+"px)";d.style.opacity=""+$APP.T.g(m.toFixed(2));d.style.mask=e;d.style.webkitMask=e;l.setAttribute("opacity",p.toFixed(2));$APP.n(c)&&(c.style.opacity=q.toFixed(2));a.style.contain="layout style"}else d.style.position="relative",
|
|
26
|
+
d.style.zIndex="3",d.style.filter="",d.style.opacity="",d.style.mask="",d.style.webkitMask="",l.setAttribute("opacity","0.35"),$APP.n(c)&&(c.style.opacity="0.4"),a.style.contain="";$APP.n(lV.g(b))||(g.style.opacity="0")},CV=function(a,b){var c=$APP.k(a,"__xLiquidGlassModel"),d=$APP.um.g(c),e=$APP.wj.g(c);c=iV.g(c)*(Math.min($APP.k(a,"__xLiquidGlassW"),$APP.k(a,"__xLiquidGlassH"))*.32)*.6;var g=$APP.k(a,"__xLiquidGlassRX"),h=$APP.k(a,"__xLiquidGlassRY"),l=$APP.M($APP.k(a,"__xLiquidGlassRefs"));l=$APP.D(l,
|
|
27
|
+
uV);a=$APP.k(a,"__xLiquidGlassMaskSats");for(var m=0;;)if(m<d){var p=m*2.39996;var q=[g[m]+c*oV(p,0,b*e),h[m]+c*oV(0,p,b*e)];p=q[0].toFixed(2);q=q[1].toFixed(2);var v=l[m];v.setAttribute("cx",p);v.setAttribute("cy",q);$APP.n($APP.n(a)?m<a.length:a)&&(v=a[m],v.setAttribute("cx",p),v.setAttribute("cy",q));m+=1}else break},DV=function(a){var b=$APP.k(a,"__xLiquidGlassModel"),c=$APP.Yk.g($APP.k(a,"__xLiquidGlassRefs"));if($APP.n(lV.g(b))){var d=$APP.k(a,"__xLiquidGlassPA"),e=$APP.k(a,"__xLiquidGlassPX"),
|
|
28
|
+
g=$APP.k(a,"__xLiquidGlassPY"),h=$APP.k(a,"__xLiquidGlassW");a=$APP.k(a,"__xLiquidGlassH");h=kV.g(b)*Math.min(h,a);a="var("+$APP.T.g("--x-liquid-glass-specular-color")+",rgba(255,255,255,0.6))";$APP.n(d)?(c.style.opacity=""+$APP.T.g(mV.g(b)),c.style.background="radial-gradient(ellipse "+$APP.T.g(h)+"px "+$APP.T.g(h)+"px at "+$APP.T.g(e.toFixed(1))+"px "+$APP.T.g(g.toFixed(1))+"px,"+$APP.T.g(a)+" 0%,transparent 100%)"):c.style.opacity="0"}},EV=function(a,b){var c=$APP.k(a,"__xLiquidGlassModel");a=
|
|
29
|
+
vV.g($APP.k(a,"__xLiquidGlassRefs"));var d=$APP.Pk.g(c);c=$APP.Qk.g(c);var e=20+8*Math.cos(b*.09),g=70+12*Math.cos(b*.05),h=80+10*Math.sin(b*.06);a.style.background="radial-gradient(ellipse at "+$APP.T.g((30+10*Math.sin(b*.07)).toFixed(1))+"% "+$APP.T.g(e.toFixed(1))+"%,"+$APP.T.g(d)+" 0%,transparent 70%),radial-gradient(ellipse at "+$APP.T.g(g.toFixed(1))+"% "+$APP.T.g(h.toFixed(1))+"%,"+$APP.T.g(c)+" 0%,transparent 70%)"},GV=function(a){$APP.n($APP.k(a,"__xLiquidGlassRaf"))||($APP.ja(a,"__xLiquidGlassLF",
|
|
30
|
+
performance.now()),$APP.ja(a,"__xLiquidGlassRaf",requestAnimationFrame(function(){return FV(a)})))},HV=function(a){var b=$APP.k(a,"__xLiquidGlassRaf");$APP.n(b)&&(cancelAnimationFrame(b),a.__xLiquidGlassRaf=null)},IV=function(a){var b=$APP.um.g($APP.k(a,"__xLiquidGlassModel")),c=$APP.k(a,"__xLiquidGlassRX"),d=$APP.k(a,"__xLiquidGlassRY"),e=$APP.M($APP.k(a,"__xLiquidGlassRefs"));e=$APP.D(e,uV);a=$APP.k(a,"__xLiquidGlassMaskSats");for(var g=0;;)if(g<b){var h=c[g].toFixed(2),l=d[g].toFixed(2);if(g<e.length){var m=
|
|
31
|
+
e[g];m.setAttribute("cx",h);m.setAttribute("cy",l)}$APP.n($APP.n(a)?g<a.length:a)&&(m=a[g],m.setAttribute("cx",h),m.setAttribute("cy",l));g+=1}else break},JV=function(a,b){if(b.length>0){var c=b[0].contentRect;b=c.width;c=c.height;if(b>0&&c>0){a.__xLiquidGlassW=b;a.__xLiquidGlassH=c;var d=$APP.M($APP.k(a,"__xLiquidGlassRefs"));d=$APP.D(d,$APP.bk);d.setAttribute("viewBox","0 0 "+$APP.T.g(b)+" "+$APP.T.g(c));d=d.querySelector("#"+$APP.T.g($APP.k(a,"__xLiquidGlassMaskId")));$APP.n(d)&&(d.setAttribute("x",
|
|
32
|
+
"0"),d.setAttribute("y","0"),d.setAttribute("width",""+$APP.T.g(b)),d.setAttribute("height",""+$APP.T.g(c)));zV(a,b,c);BV(a);var e=$APP.k(a,"__xLiquidGlassModel");$APP.n(function(){var g=$APP.X.g(e);return $APP.n(g)?g:rV()}())?IV(a):(CV(a,function(){var g=$APP.k(a,"__xLiquidGlassTime");return $APP.n(g)?g:0}()),GV(a))}}return null},KV=function(a){function b(){a.__xLiquidGlassPA=!1;return null}function c(){a.__xLiquidGlassPA=!0;return null}function d(e){var g=a.getBoundingClientRect();a.__xLiquidGlassPX=
|
|
33
|
+
e.clientX-g.left;a.__xLiquidGlassPY=e.clientY-g.top;return null}$APP.ja(a,"__xLiquidGlassHdl",{move:d,enter:c,leave:b});a.addEventListener("pointermove",d,{passive:!0});a.addEventListener("pointerenter",c);a.addEventListener("pointerleave",b)},LV=function(a){var b=$APP.k(a,"__xLiquidGlassHdl");$APP.n(b)&&(a.removeEventListener("pointermove",$APP.k(b,"move")),a.removeEventListener("pointerenter",$APP.k(b,"enter")),a.removeEventListener("pointerleave",$APP.k(b,"leave")),a.__xLiquidGlassHdl=null)},MV=
|
|
34
|
+
function(a){return nV($APP.zf([$APP.Wl,YU,ZU,$APP.dl,$U,aV,bV,cV,dV,eV,fV,$APP.Wi,WU,XU],[a.getAttribute("blur"),a.getAttribute("blobs"),a.getAttribute("amplitude"),a.getAttribute("mode"),a.getAttribute("specular-intensity"),a.getAttribute("speed"),a.getAttribute("frost"),a.getAttribute("color-2"),a.getAttribute("color-1"),a.getAttribute("goo"),a.getAttribute("specular"),a.getAttribute("disabled"),a.getAttribute("specular-size"),a.getAttribute("tint")]))},NV=function(a){var b=MV(a);a.__xLiquidGlassModel=
|
|
35
|
+
b;var c=$APP.k(a,"__xLiquidGlassW"),d=$APP.k(a,"__xLiquidGlassH");$APP.n($APP.n(c)?$APP.n(d)?c>0&&d>0:d:c)&&(zV(a,c,d),BV(a),$APP.n(function(){var e=$APP.X.g(b);return $APP.n(e)?e:rV()}())?(HV(a),IV(a)):(CV(a,function(){var e=$APP.k(a,"__xLiquidGlassTime");return $APP.n(e)?e:0}()),GV(a)))},OV=function(a){Object.defineProperty(a,"blobs",{get:function(){var b=this.getAttribute("blobs");return QU(b)},set:function(b){return b==null?this.removeAttribute("blobs"):this.setAttribute("blobs",""+$APP.T.g(b))},
|
|
36
|
+
enumerable:!0,configurable:!0});Object.defineProperty(a,"speed",{get:function(){var b=this.getAttribute("speed");return PU(b,.3,.05,2)},set:function(b){return b==null?this.removeAttribute("speed"):this.setAttribute("speed",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"amplitude",{get:function(){var b=this.getAttribute("amplitude");return PU(b,.15,.05,.4)},set:function(b){return b==null?this.removeAttribute("amplitude"):this.setAttribute("amplitude",""+$APP.T.g(b))},enumerable:!0,
|
|
37
|
+
configurable:!0});Object.defineProperty(a,"blur",{get:function(){var b=this.getAttribute("blur");return PU(b,12,0,40)},set:function(b){return b==null?this.removeAttribute("blur"):this.setAttribute("blur",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"goo",{get:function(){var b=this.getAttribute("goo");return PU(b,10,4,20)},set:function(b){return b==null?this.removeAttribute("goo"):this.setAttribute("goo",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,
|
|
38
38
|
"tint",{get:function(){return this.getAttribute("tint")},set:function(b){return b==null?this.removeAttribute("tint"):this.setAttribute("tint",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"specular",{get:function(){return this.hasAttribute("specular")},set:function(b){return $APP.n(b)?this.setAttribute("specular",""):this.removeAttribute("specular")},enumerable:!0,configurable:!0});Object.defineProperty(a,"specularSize",{get:function(){var b=this.getAttribute("specular-size");
|
|
39
|
-
return
|
|
40
|
-
set:function(b){return $APP.n(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0});Object.defineProperty(a,"mode",{get:function(){var b=this.getAttribute("mode");return $APP.C.i(b,"submerged")?"submerged":"surface"},set:function(b){return b==null?this.removeAttribute("mode"):this.setAttribute("mode",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"frost",{get:function(){var b=this.getAttribute("frost");return
|
|
39
|
+
return PU(b,.4,.1,1)},set:function(b){return b==null?this.removeAttribute("specular-size"):this.setAttribute("specular-size",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"specularIntensity",{get:function(){var b=this.getAttribute("specular-intensity");return PU(b,.3,0,1)},set:function(b){return b==null?this.removeAttribute("specular-intensity"):this.setAttribute("specular-intensity",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},
|
|
40
|
+
set:function(b){return $APP.n(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0});Object.defineProperty(a,"mode",{get:function(){var b=this.getAttribute("mode");return $APP.C.i(b,"submerged")?"submerged":"surface"},set:function(b){return b==null?this.removeAttribute("mode"):this.setAttribute("mode",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"frost",{get:function(){var b=this.getAttribute("frost");return PU(b,.5,0,1)},
|
|
41
41
|
set:function(b){return b==null?this.removeAttribute("frost"):this.setAttribute("frost",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"color1",{get:function(){return this.getAttribute("color-1")},set:function(b){return b==null?this.removeAttribute("color-1"):this.setAttribute("color-1",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"color2",{get:function(){return this.getAttribute("color-2")},set:function(b){return b==null?this.removeAttribute("color-2"):
|
|
42
|
-
this.setAttribute("color-2",""+$APP.T.g(b))},enumerable:!0,configurable:!0})},
|
|
43
|
-
a.prototype.disconnectedCallback=function(){
|
|
44
|
-
"core","core",-86019209),
|
|
45
|
-
|
|
46
|
-
"color-1-raw",-1322552111),
|
|
47
|
-
$APP.
|
|
48
|
-
1,[$APP.
|
|
42
|
+
this.setAttribute("color-2",""+$APP.T.g(b))},enumerable:!0,configurable:!0})},QV=function(){var a=class extends HTMLElement{};a.observedAttributes=PV;a.prototype.connectedCallback=function(){var b=this,c=MV(b);b.__xLiquidGlassModel=c;b.__xLiquidGlassTime=0;b.__xLiquidGlassPA=!1;b.__xLiquidGlassPX=0;b.__xLiquidGlassPY=0;b.__xLiquidGlassGT=0;$APP.n($APP.k(b,"__xLiquidGlassRefs"))||yV(b);BV(b);c=new ResizeObserver(function(d){return JV(b,d)});b.__xLiquidGlassRO=c;c.observe(b);LV(b);KV(b);return null};
|
|
43
|
+
a.prototype.disconnectedCallback=function(){HV(this);LV(this);var b=$APP.k(this,"__xLiquidGlassRO");$APP.n(b)&&(b.disconnect(),this.__xLiquidGlassRO=null);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&$APP.n($APP.k(this,"__xLiquidGlassRefs"))&&NV(this);return null};OV(a.prototype);return a},RV=function(){$APP.n(customElements.get("x-liquid-glass"))||customElements.define("x-liquid-glass",QV());return null},UU=new $APP.K(null,"surface","surface",699915646),wV=new $APP.K(null,
|
|
44
|
+
"core","core",-86019209),mV=new $APP.K(null,"specular-intensity","specular-intensity",437849876),ZU=new $APP.K(null,"amplitude-raw","amplitude-raw",-673525115),hV=new $APP.K(null,"goo","goo",-1253057564),sV=new $APP.K(null,"glass","glass",1652756718),tV=new $APP.K(null,"filter","filter",-948537934),gV=new $APP.K(null,"frost","frost",-3478780),kV=new $APP.K(null,"specular-size","specular-size",757318993),AV=new $APP.K(null,"submerged","submerged",1636004473),jV=new $APP.K(null,"tint","tint",-1286736913),
|
|
45
|
+
xV=new $APP.K(null,"grain","grain",2007662171),XU=new $APP.K(null,"tint-raw","tint-raw",-653441954),cV=new $APP.K(null,"color-2-raw","color-2-raw",-1440423537),fV=new $APP.K(null,"specular-attr","specular-attr",-716021610),$U=new $APP.K(null,"specular-intensity-raw","specular-intensity-raw",109079177),aV=new $APP.K(null,"speed-raw","speed-raw",1756460778),eV=new $APP.K(null,"goo-raw","goo-raw",59658675),WU=new $APP.K(null,"specular-size-raw","specular-size-raw",592980345),dV=new $APP.K(null,"color-1-raw",
|
|
46
|
+
"color-1-raw",-1322552111),iV=new $APP.K(null,"amplitude","amplitude",-1387734203),vV=new $APP.K(null,"gradient","gradient",-1983908971),bV=new $APP.K(null,"frost-raw","frost-raw",1383732749),lV=new $APP.K(null,"specular?","specular?",964138290),YU=new $APP.K(null,"blobs-raw","blobs-raw",1729393761),uV=new $APP.K(null,"satellites","satellites",644765266);var PV="blobs speed amplitude blur goo tint specular specular-size specular-intensity disabled mode frost color-1 color-2".split(" ");
|
|
47
|
+
$APP.zf([gV,hV,iV,new $APP.K(null,"specularSize","specularSize",-1757715579),$APP.Fj,$APP.wj,$APP.mj,$APP.Yk,jV,new $APP.K(null,"color2","color2",1248091856),$APP.fi,$APP.um,new $APP.K(null,"color1","color1",306558619),new $APP.K(null,"specularIntensity","specularIntensity",138075)],[new $APP.Q(null,1,[$APP.Z,$APP.W],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null),new $APP.Q(null,1,[$APP.Z,$APP.Sj],null),new $APP.Q(null,
|
|
48
|
+
1,[$APP.Z,$APP.W],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.Sj],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null)]);var TU=new $APP.Q(null,2,["surface",UU,"submerged",AV],null);var pV={v:0},FV=function FV(a){if($APP.n(a.isConnected)){var c=performance.now(),d=$APP.k(a,"__xLiquidGlassTime")+Math.min(c-$APP.k(a,"__xLiquidGlassLF"),100)/1E3;a.__xLiquidGlassLF=c;a.__xLiquidGlassTime=d;CV(a,d);DV(a);EV(a,d);$APP.ja(a,"__xLiquidGlassRaf",requestAnimationFrame(function(){return FV.g?FV.g(a):FV.call(null,a)}))}return null};$APP.ha("baredom.exports.x_liquid_glass.init",RV);export const init=RV;
|
package/dist/x-menu-item.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
return a.dispatchEvent(new CustomEvent("x-menu-item-select",{detail:{value:$APP.n(b)?b:""},bubbles:!0,composed:!0}))},
|
|
4
|
-
"menuitem");a.setAttribute("tabindex","-1");b.setAttribute("data-type","");b.setAttribute("data-variant",$APP.
|
|
5
|
-
$APP.r($APP.
|
|
6
|
-
g},
|
|
7
|
-
"variant",{get:function(){return this.getAttribute("variant")},set:function(b){return $APP.n(b)?this.setAttribute("variant",b):this.removeAttribute("variant")},configurable:!0,enumerable:!0});Object.defineProperty(a.prototype,"type",{get:function(){return this.getAttribute("type")},set:function(b){return $APP.n(b)?this.setAttribute("type",b):this.removeAttribute("type")},configurable:!0,enumerable:!0})},
|
|
8
|
-
function(){if($APP.
|
|
9
|
-
b.setAttribute("part","base");b.className="base";e.setAttribute("part","icon");e.className="icon-span";g.setAttribute("name","icon");e.appendChild(g);h.className="label-span";h.appendChild(l);m.className="divider-hr";b.appendChild(e);b.appendChild(h);b.appendChild(m);c.appendChild(d);c.appendChild(b);c={};c.base=b;c["icon-span"]=e;c["icon-slot"]=g;this.__xMenuItemRefs=c;
|
|
10
|
-
var c=$APP.k(this,"__xMenuItemRefs");if($APP.n(b)){var d=$APP.k(b,"keydown"),e=$APP.k(b,"icon-slotchange");c=$APP.n(c)?$APP.k(c,"icon-slot"):null;this.removeEventListener("click",$APP.k(b,"click"));this.removeEventListener("keydown",d);b=$APP.n(c)?c.removeEventListener("slotchange",e):null}else b=null;return b};a.prototype.attributeChangedCallback=function(){return $APP.
|
|
11
|
-
|
|
2
|
+
var dU=function(a){var b=$APP.M(a);a=$APP.D(b,$APP.Pi);var c=$APP.D(b,$APP.Fj),d=$APP.D(b,$APP.Qg);b=$APP.D(b,$APP.Z);a=$APP.n(a)?a:"";c=$APP.F(c);d=$APP.n(d)?d:"";d=$APP.I(bU,d)?d:"";b=$APP.n(b)?b:"";b=$APP.I(cU,b)?b:"";return new $APP.Q(null,4,[$APP.Pi,a,$APP.Fj,c,$APP.Qg,d,$APP.Z,b],null)},eU=function(a){return new $APP.Q(null,4,[$APP.Pi,a.getAttribute("value"),$APP.Fj,a.hasAttribute("disabled"),$APP.Qg,a.getAttribute("variant"),$APP.Z,a.getAttribute("type")],null)},fU=function(a){var b=a.getAttribute("value");
|
|
3
|
+
return a.dispatchEvent(new CustomEvent("x-menu-item-select",{detail:{value:$APP.n(b)?b:""},bubbles:!0,composed:!0}))},gU=function(a){var b=$APP.k(a,"__xMenuItemRefs");b=$APP.n(b)?$APP.k(b,"base"):null;var c=dU(eU(a));if($APP.n(b)){if($APP.C.i($APP.Z.g(c),"divider"))return a.setAttribute("role","separator"),a.removeAttribute("tabindex"),a.removeAttribute("aria-disabled"),b.setAttribute("data-type","divider"),b.setAttribute("data-variant",""),b.setAttribute("data-disabled","false");a.setAttribute("role",
|
|
4
|
+
"menuitem");a.setAttribute("tabindex","-1");b.setAttribute("data-type","");b.setAttribute("data-variant",$APP.Qg.g(c));b.setAttribute("data-disabled",$APP.n($APP.Fj.g(c))?"true":"false");return $APP.n($APP.Fj.g(c))?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled")}return null},hU=function(a){function b(){return e.assignedNodes().length>0?a.setAttribute("has-icon",""):a.removeAttribute("has-icon")}function c(h){var l=h.key,m=dU(eU(a));($APP.C.i(l,"Enter")||$APP.C.i(l," "))&&
|
|
5
|
+
$APP.r($APP.Fj.g(m))&&$APP.N($APP.Z.g(m),"divider")?(h.preventDefault(),h=fU(a)):h=null;return h}function d(h){var l=dU(eU(a));var m=$APP.Fj.g(l);m=$APP.n(m)?m:$APP.C.i($APP.Z.g(l),"divider");$APP.n(m)&&h.preventDefault();return $APP.r($APP.Fj.g(l))&&$APP.N($APP.Z.g(l),"divider")?fU(a):null}var e=$APP.k($APP.k(a,"__xMenuItemRefs"),"icon-slot"),g={};a.addEventListener("click",d);a.addEventListener("keydown",c);e.addEventListener("slotchange",b);g.click=d;g.keydown=c;g["icon-slotchange"]=b;a.__xMenuItemHandlers=
|
|
6
|
+
g},iU=function(a){Object.defineProperty(a.prototype,"value",{get:function(){return this.getAttribute("value")},set:function(b){return $APP.n(b)?this.setAttribute("value",b):this.removeAttribute("value")},configurable:!0,enumerable:!0});Object.defineProperty(a.prototype,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.n(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},configurable:!0,enumerable:!0});Object.defineProperty(a.prototype,
|
|
7
|
+
"variant",{get:function(){return this.getAttribute("variant")},set:function(b){return $APP.n(b)?this.setAttribute("variant",b):this.removeAttribute("variant")},configurable:!0,enumerable:!0});Object.defineProperty(a.prototype,"type",{get:function(){return this.getAttribute("type")},set:function(b){return $APP.n(b)?this.setAttribute("type",b):this.removeAttribute("type")},configurable:!0,enumerable:!0})},kU=function(){var a=class extends HTMLElement{};a.observedAttributes=jU;a.prototype.connectedCallback=
|
|
8
|
+
function(){if($APP.Dg(this,"__xMenuItemInit")){hU(this);var b=gU(this)}else{if(!$APP.Dg(this,"__xMenuItemInit")){var c=this.attachShadow({mode:"open"}),d=document.createElement("style");b=document.createElement("div");var e=document.createElement("span"),g=document.createElement("slot"),h=document.createElement("span"),l=document.createElement("slot"),m=document.createElement("hr");d.textContent=":host{display:block;outline:none;color-scheme:light dark;--x-menu-item-color:var(--x-color-text,#111827);--x-menu-item-hover-bg:var(--x-color-surface-hover,#f3f4f6);--x-menu-item-focus-bg:var(--x-color-surface-hover,#eff6ff);--x-menu-item-focus-color:var(--x-color-primary-hover,#1d4ed8);--x-menu-item-disabled-opacity:0.45;--x-menu-item-danger-color:var(--x-color-danger,#dc2626);--x-menu-item-danger-hover-bg:#fef2f2;--x-menu-item-padding:8px 12px;--x-menu-item-border-radius:var(--x-radius-sm,4px);--x-menu-item-font-size:0.9375rem;--x-menu-item-icon-gap:8px;--x-menu-item-divider-color:var(--x-color-border,#e5e7eb);}:host([disabled]){pointer-events:none;}@media (prefers-color-scheme:dark){:host{--x-menu-item-color:var(--x-color-text,#f9fafb);--x-menu-item-hover-bg:var(--x-color-surface-hover,#1f2937);--x-menu-item-focus-bg:var(--x-color-surface-hover,#1e3a5f);--x-menu-item-focus-color:var(--x-color-focus-ring,#60a5fa);--x-menu-item-danger-color:var(--x-color-danger,#f87171);--x-menu-item-danger-hover-bg:#2d1515;--x-menu-item-divider-color:var(--x-color-border,#374151);}}.base{display:flex;align-items:center;gap:var(--x-menu-item-icon-gap);padding:var(--x-menu-item-padding);border-radius:var(--x-menu-item-border-radius);font-size:var(--x-menu-item-font-size);color:var(--x-menu-item-color);cursor:pointer;user-select:none;transition:background 100ms ease,color 100ms ease;}.base:hover{background:var(--x-menu-item-hover-bg);}:host(:focus) .base{background:var(--x-menu-item-focus-bg);color:var(--x-menu-item-focus-color);}.base[data-variant\x3d'danger']{color:var(--x-menu-item-danger-color);}.base[data-variant\x3d'danger']:hover{background:var(--x-menu-item-danger-hover-bg);}:host(:focus) .base[data-variant\x3d'danger']{background:var(--x-menu-item-danger-hover-bg);}.base[data-disabled\x3d'true']{opacity:var(--x-menu-item-disabled-opacity);cursor:default;pointer-events:none;}.base[data-type\x3d'divider']{padding:0;cursor:default;pointer-events:none;}.icon-span{display:none;flex-shrink:0;align-items:center;}:host([has-icon]) .icon-span{display:flex;}.divider-hr{display:none;}.base[data-type\x3d'divider'] .icon-span,.base[data-type\x3d'divider'] .label-span{display:none;}.base[data-type\x3d'divider'] .divider-hr{display:block;width:100%;border:none;border-top:1px solid var(--x-menu-item-divider-color);margin:4px 0;}@media (prefers-reduced-motion:reduce){.base{transition:none;}}";
|
|
9
|
+
b.setAttribute("part","base");b.className="base";e.setAttribute("part","icon");e.className="icon-span";g.setAttribute("name","icon");e.appendChild(g);h.className="label-span";h.appendChild(l);m.className="divider-hr";b.appendChild(e);b.appendChild(h);b.appendChild(m);c.appendChild(d);c.appendChild(b);c={};c.base=b;c["icon-span"]=e;c["icon-slot"]=g;this.__xMenuItemRefs=c;hU(this);this.__xMenuItemInit=!0}gU(this);b=this}return b};a.prototype.disconnectedCallback=function(){var b=$APP.k(this,"__xMenuItemHandlers");
|
|
10
|
+
var c=$APP.k(this,"__xMenuItemRefs");if($APP.n(b)){var d=$APP.k(b,"keydown"),e=$APP.k(b,"icon-slotchange");c=$APP.n(c)?$APP.k(c,"icon-slot"):null;this.removeEventListener("click",$APP.k(b,"click"));this.removeEventListener("keydown",d);b=$APP.n(c)?c.removeEventListener("slotchange",e):null}else b=null;return b};a.prototype.attributeChangedCallback=function(){return $APP.Dg(this,"__xMenuItemInit")?gU(this):null};iU(a);return a},lU=function(){return $APP.n(customElements.get("x-menu-item"))?null:customElements.define("x-menu-item",
|
|
11
|
+
kU())};var jU=["value","disabled","variant","type"],bU=new $APP.S(null,new $APP.Q(null,2,["",null,"danger",null],null),null),cU=new $APP.S(null,new $APP.Q(null,2,["",null,"divider",null],null),null);$APP.Qd(["x-menu-item-select",new $APP.Q(null,1,[$APP.V,new $APP.Q(null,1,[$APP.Pi,$APP.Y],null)],null)]);$APP.ha("baredom.exports.x_menu_item.init",lU);export const init=lU;
|
package/dist/x-menu.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
d=a.hasAttribute("open");if($APP.C.i(c,"Escape"))return $APP.n(d)?(b.preventDefault(),
|
|
5
|
-
e[0].focus()}else if($APP.C.i(c,"End")&&$APP.n(d)&&(e=
|
|
6
|
-
c,$APP.
|
|
7
|
-
function e(h){var l=$APP.k(a,"__xMenuRefs");l=$APP.n(l)?$APP.k(l,"trigger-slot"):null;return $APP.n($APP.n(l)?
|
|
2
|
+
var gL=function(a){a=a.querySelectorAll("x-menu-item");for(var b=[],c=a.length,d=0;;)if(d<c){var e=a[d];$APP.r(e.hasAttribute("disabled"))&&$APP.N(e.getAttribute("type"),"divider")&&b.push(e);d+=1}else break;return b},hL=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0}))},kL=function(a){$APP.n(a.hasAttribute("open"))||(a.setAttribute("open",""),hL(a,"x-menu-open",{}));if($APP.n(null)){a=gL(a);var b=a.length;return b>0?$APP.C.i(null,iL)?a[0].focus():$APP.C.i(null,
|
|
3
|
+
jL)?a[b-1].focus():null:null}return null},lL=function(a,b){$APP.n(a.hasAttribute("open"))&&(a.removeAttribute("open"),hL(a,"x-menu-close",{}));return $APP.n(b)?(a=$APP.k(a,"__xMenuRefs"),a=$APP.n(a)?$APP.k(a,"trigger-slot"):null,a=$APP.n(a)?a.assignedElements():null,a=$APP.n($APP.n(a)?a.length>0:a)?a[0]:null,$APP.n(a)?a.focus():null):null},mL=function(a,b){var c=b.composedPath();a=$APP.vc(a.assignedElements());return $APP.F($APP.Ud(function(d){return c.indexOf(d)>-1},a))},nL=function(a,b){var c=b.key,
|
|
4
|
+
d=a.hasAttribute("open");if($APP.C.i(c,"Escape"))return $APP.n(d)?(b.preventDefault(),lL(a,!0)):null;if($APP.C.i(c,"Tab"))return $APP.n(d)?lL(a,!1):null;if($APP.C.i(c,"ArrowDown")||$APP.C.i(c,"ArrowUp")){var e=gL(a),g=e.length;if(g>0){b.preventDefault();if($APP.n(d))return a=e.indexOf(document.activeElement),c=$APP.C.i(c,"ArrowDown")?a>=g-1?0:a<0?0:a+1:a<=0?g-1:a-1,e[c].focus();kL(a);return e[$APP.C.i(c,"ArrowDown")?0:g-1].focus()}}else if($APP.C.i(c,"Home")){if($APP.n(d)&&(e=gL(a),e.length>0))return b.preventDefault(),
|
|
5
|
+
e[0].focus()}else if($APP.C.i(c,"End")&&$APP.n(d)&&(e=gL(a),e.length>0))return b.preventDefault(),e[e.length-1].focus();return null},pL=function(a){var b=$APP.k(a,"__xMenuRefs");b=$APP.n(b)?$APP.k(b,"popup"):null;a=new $APP.Q(null,3,[$APP.Ol,a.hasAttribute("open"),$APP.Gj,a.getAttribute("placement"),$APP.U,a.getAttribute("label")],null);a=$APP.M(a);var c=$APP.D(a,$APP.Ol),d=$APP.D(a,$APP.Gj);a=$APP.D(a,$APP.U);c=$APP.F(c);d=$APP.n(d)?d:"";d=$APP.I(oL,d)?d:"bottom-start";a=new $APP.Q(null,3,[$APP.Ol,
|
|
6
|
+
c,$APP.Gj,d,$APP.U,$APP.n(a)?a:""],null);return $APP.n(b)?(b.setAttribute("data-placement",$APP.Gj.g(a)),a=$APP.U.g(a),$APP.n($APP.n(a)?$APP.N(a,""):a)?b.setAttribute("aria-label",a):b.removeAttribute("aria-label")):null},qL=function(a){function b(h){h.stopPropagation();h=h.detail.value;lL(a,!1);return hL(a,"x-menu-select",{value:$APP.n(h)?h:""})}function c(h){return nL(a,h)}function d(h){$APP.n(a.hasAttribute("open"))?(h=h.composedPath(),h=$APP.C.i(-1,h.indexOf(a))?lL(a,!1):null):h=null;return h}
|
|
7
|
+
function e(h){var l=$APP.k(a,"__xMenuRefs");l=$APP.n(l)?$APP.k(l,"trigger-slot"):null;return $APP.n($APP.n(l)?mL(l,h):l)?$APP.n(a.hasAttribute("open"))?lL(a,!0):kL(a):null}var g={};a.addEventListener("click",e);document.addEventListener("click",d,!0);a.addEventListener("keydown",c);a.addEventListener("x-menu-item-select",b);g.click=e;g["doc-click"]=d;g.keydown=c;g["item-select"]=b;a.__xMenuHandlers=g},rL=function(a){Object.defineProperty(a.prototype,"open",{get:function(){return this.hasAttribute("open")},
|
|
8
8
|
set:function(b){return $APP.n(b)?this.setAttribute("open",""):this.removeAttribute("open")},configurable:!0,enumerable:!0});Object.defineProperty(a.prototype,"placement",{get:function(){return this.getAttribute("placement")},set:function(b){return $APP.n(b)?this.setAttribute("placement",b):this.removeAttribute("placement")},configurable:!0,enumerable:!0});Object.defineProperty(a.prototype,"label",{get:function(){return this.getAttribute("label")},set:function(b){return $APP.n(b)?this.setAttribute("label",
|
|
9
|
-
b):this.removeAttribute("label")},configurable:!0,enumerable:!0})},
|
|
10
|
-
b.setAttribute("part","base");b.className="base";e.setAttribute("name","trigger");g.setAttribute("part","popup");g.className="popup";g.setAttribute("role","menu");g.appendChild(h);b.appendChild(e);b.appendChild(g);c.appendChild(d);c.appendChild(b);c={};c.base=b;c.popup=g;c["trigger-slot"]=e;c["item-slot"]=h;this.__xMenuRefs=c;
|
|
11
|
-
d=$APP.k(b,"keydown"),e=$APP.k(b,"item-select");this.removeEventListener("click",$APP.k(b,"click"));document.removeEventListener("click",c,!0);this.removeEventListener("keydown",d);b=this.removeEventListener("x-menu-item-select",e)}else b=null;return b};a.prototype.attributeChangedCallback=function(){return $APP.
|
|
12
|
-
1105735132),
|
|
9
|
+
b):this.removeAttribute("label")},configurable:!0,enumerable:!0})},tL=function(){var a=class extends HTMLElement{};a.observedAttributes=sL;a.prototype.connectedCallback=function(){if($APP.Dg(this,"__xMenuInit")){qL(this);var b=pL(this)}else{if(!$APP.Dg(this,"__xMenuInit")){var c=this.attachShadow({mode:"open"}),d=document.createElement("style");b=document.createElement("div");var e=document.createElement("slot"),g=document.createElement("div"),h=document.createElement("slot");d.textContent=":host{display:inline-block;position:relative;color-scheme:light dark;--x-menu-bg:var(--x-color-bg,#ffffff);--x-menu-border:1px solid var(--x-color-border,#e5e7eb);--x-menu-border-radius:var(--x-radius-md,8px);--x-menu-shadow:var(--x-shadow-md,0 4px 16px rgba(0,0,0,0.12));--x-menu-min-width:160px;--x-menu-padding:4px;--x-menu-z-index:1000;}@media (prefers-color-scheme:dark){:host{--x-menu-bg:var(--x-color-bg,#1f2937);--x-menu-border:1px solid var(--x-color-border,#374151);--x-menu-shadow:var(--x-shadow-md,0 4px 16px rgba(0,0,0,0.4));}}.base{position:relative;display:inline-block;}.popup{display:none;position:absolute;background:var(--x-menu-bg);border:var(--x-menu-border);border-radius:var(--x-menu-border-radius);box-shadow:var(--x-menu-shadow);min-width:var(--x-menu-min-width);max-width:calc(100vw - 1rem);padding:var(--x-menu-padding);z-index:var(--x-menu-z-index);box-sizing:border-box;}:host([open]) .popup{display:block;}.popup[data-placement\x3d'bottom-start']{top:100%;left:0;margin-top:4px;}.popup[data-placement\x3d'bottom-end']{top:100%;right:0;margin-top:4px;}.popup[data-placement\x3d'top-start']{bottom:100%;left:0;margin-bottom:4px;}.popup[data-placement\x3d'top-end']{bottom:100%;right:0;margin-bottom:4px;}";
|
|
10
|
+
b.setAttribute("part","base");b.className="base";e.setAttribute("name","trigger");g.setAttribute("part","popup");g.className="popup";g.setAttribute("role","menu");g.appendChild(h);b.appendChild(e);b.appendChild(g);c.appendChild(d);c.appendChild(b);c={};c.base=b;c.popup=g;c["trigger-slot"]=e;c["item-slot"]=h;this.__xMenuRefs=c;qL(this);this.__xMenuInit=!0}pL(this);b=this}return b};a.prototype.disconnectedCallback=function(){var b=$APP.k(this,"__xMenuHandlers");if($APP.n(b)){var c=$APP.k(b,"doc-click"),
|
|
11
|
+
d=$APP.k(b,"keydown"),e=$APP.k(b,"item-select");this.removeEventListener("click",$APP.k(b,"click"));document.removeEventListener("click",c,!0);this.removeEventListener("keydown",d);b=this.removeEventListener("x-menu-item-select",e)}else b=null;return b};a.prototype.attributeChangedCallback=function(){return $APP.Dg(this,"__xMenuInit")?pL(this):null};rL(a);return a},uL=function(){return $APP.n(customElements.get("x-menu"))?null:customElements.define("x-menu",tL())},jL=new $APP.K(null,"last","last",
|
|
12
|
+
1105735132),iL=new $APP.K(null,"first","first",-644103046);var sL=["open","placement","label"],oL=new $APP.S(null,new $APP.Q(null,4,["bottom-start",null,"bottom-end",null,"top-end",null,"top-start",null],null),null);$APP.Qd(["x-menu-open",new $APP.Q(null,1,[$APP.V,$APP.Rd],null),"x-menu-close",new $APP.Q(null,1,[$APP.V,$APP.Rd],null),"x-menu-select",new $APP.Q(null,1,[$APP.V,new $APP.Q(null,1,[$APP.Pi,$APP.Y],null)],null)]);$APP.ha("baredom.exports.x_menu.init",uL);export const init=uL;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
3:Math.min(20,Math.max(.5,a))}return 3},
|
|
4
|
-
function(a){return typeof a==="string"&&a.trim().length>0?a.trim():"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10"},
|
|
5
|
-
return b},
|
|
6
|
-
var b=$APP.M(a),c=$APP.D(b,
|
|
7
|
-
|
|
8
|
-
window.addEventListener("pointermove",b);a.__xMetaballHandler=b},
|
|
9
|
-
set:function(b){return b==null?this.removeAttribute("blob-size"):this.setAttribute("blob-size",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"color",{get:function(){return
|
|
10
|
-
""):this.removeAttribute("noise")},enumerable:!0,configurable:!0});Object.defineProperty(a,"noiseScale",{get:function(){return
|
|
11
|
-
""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"noiseIntensity",{get:function(){return
|
|
12
|
-
configurable:!0});Object.defineProperty(a,"threshold",{get:function(){return
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
var bH=function(a){if(typeof a==="string"){a=parseInt(a.trim(),10);var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?5:Math.min(10,Math.max(2,a))}return 5},cH=function(a){if(typeof a==="string"){a=parseFloat(a.trim());var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?40:Math.min(200,Math.max(10,a))}return 40},dH=function(a){return typeof a==="string"&&a.trim().length>0?a.trim():"#6366f1"},eH=function(a){if(typeof a==="string"){a=parseFloat(a.trim());var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?
|
|
3
|
+
3:Math.min(20,Math.max(.5,a))}return 3},fH=function(a){if(typeof a==="string"){a=parseFloat(a.trim());var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?.02:Math.min(.1,Math.max(.001,a))}return.02},gH=function(a){if(typeof a==="string"){a=parseFloat(a.trim());var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?6:Math.min(30,Math.max(1,a))}return 6},hH=function(a){if(typeof a==="string"){a=parseFloat(a.trim());var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?12:Math.min(40,Math.max(4,a))}return 12},iH=
|
|
4
|
+
function(a){return typeof a==="string"&&a.trim().length>0?a.trim():"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10"},kH=function(a){if(typeof a==="string"&&a.trim().length>0){var b=$APP.D(jH,a.trim().toLowerCase());if($APP.n(b))return b;if(a.indexOf(",")>=0)return a=a.split(","),$APP.We.m($APP.fe,$APP.ph.i($APP.ae.g(function(c){return c.trim()}),$APP.ce(function(c){return c.length>0})),a)}return null},lH=function(a){for(var b=[],c=0;;)if(c<a)b.push(Math.max(.01,.35*Math.pow(.45,c))),c+=1;else break;
|
|
5
|
+
return b},mH=function(a,b){for(var c=[],d=0;;)if(d<b)c.push(Math.max(a*.5,a*(1-d*.08))),d+=1;else break;return c},nH=function(a,b,c){return a+(b-a)*c},CH=function(a){a=$APP.zf([$APP.Wl,oH,pH,qH,rH,sH,$APP.Vh,$APP.Lm,tH,uH],[a.getAttribute("blur"),a.getAttribute("noise-intensity"),a.getAttribute("blob-size"),a.getAttribute("palette"),a.getAttribute("noise-scale"),a.getAttribute("noise"),a.getAttribute("threshold"),a.getAttribute("color"),a.getAttribute("blob-count"),a.getAttribute("noise-speed")]);
|
|
6
|
+
var b=$APP.M(a),c=$APP.D(b,uH);a=$APP.D(b,$APP.Wl);var d=$APP.D(b,oH),e=$APP.D(b,pH),g=$APP.D(b,qH),h=$APP.D(b,rH),l=$APP.D(b,sH),m=$APP.D(b,$APP.Vh),p=$APP.D(b,$APP.Lm);b=$APP.D(b,tH);b=bH(b);p=dH(p);g=kH(g);c=fH(c);var q=[];if($APP.n($APP.n(g)?$APP.z(g)>0:g))for(var v=$APP.z(g),x=0;;)if(x<b)q.push($APP.pc(g,$APP.fd(x,v))),x+=1;else break;else for(v=0;;)if(v<b)q.push(p),v+=1;else break;return $APP.zf([$APP.Ej,vH,wH,$APP.Xl,$APP.Al,xH,yH,$APP.fi,zH,AH,BH],[p,g,c,q,iH(m),eH(h),b,hH(a),cH(e),l!=null,
|
|
7
|
+
gH(d)])},DH=function(a,b){b=$APP.M(b);b=$APP.D(b,$APP.Ej);return a.style.setProperty("--x-metaball-cursor-color",b)},FH=function(a){$APP.F(window.matchMedia("(prefers-reduced-motion:reduce)").matches)||(a.__xMetaballSeed=0,$APP.ja(a,"__xMetaballRaf",requestAnimationFrame(function(){return EH(a)})))},GH=function(a){function b(c){var d=$APP.dj.g($APP.k(a,"__xMetaballRefs"));if($APP.n(d)){d=d.getBoundingClientRect();var e=$APP.k(a,"__xMetaballMouse");e.x=c.clientX-d.left;e.y=c.clientY-d.top}return null}
|
|
8
|
+
window.addEventListener("pointermove",b);a.__xMetaballHandler=b},HH=function(a){var b=$APP.k(a,"__xMetaballHandler");$APP.n(b)&&(window.removeEventListener("pointermove",b),a.__xMetaballHandler=null)},IH=function(a){Object.defineProperty(a,"blobCount",{get:function(){return bH(this.getAttribute("blob-count"))},set:function(b){return b==null?this.removeAttribute("blob-count"):this.setAttribute("blob-count",""+$APP.T.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"blobSize",{get:function(){return cH(this.getAttribute("blob-size"))},
|
|
9
|
+
set:function(b){return b==null?this.removeAttribute("blob-size"):this.setAttribute("blob-size",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"color",{get:function(){return dH(this.getAttribute("color"))},set:function(b){return b==null?this.removeAttribute("color"):this.setAttribute("color",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"noise",{get:function(){return this.hasAttribute("noise")},set:function(b){return $APP.n(b)?this.setAttribute("noise",
|
|
10
|
+
""):this.removeAttribute("noise")},enumerable:!0,configurable:!0});Object.defineProperty(a,"noiseScale",{get:function(){return eH(this.getAttribute("noise-scale"))},set:function(b){return b==null?this.removeAttribute("noise-scale"):this.setAttribute("noise-scale",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"noiseSpeed",{get:function(){return fH(this.getAttribute("noise-speed"))},set:function(b){return b==null?this.removeAttribute("noise-speed"):this.setAttribute("noise-speed",
|
|
11
|
+
""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"noiseIntensity",{get:function(){return gH(this.getAttribute("noise-intensity"))},set:function(b){return b==null?this.removeAttribute("noise-intensity"):this.setAttribute("noise-intensity",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"blur",{get:function(){return hH(this.getAttribute("blur"))},set:function(b){return b==null?this.removeAttribute("blur"):this.setAttribute("blur",""+$APP.T.g(b))},enumerable:!0,
|
|
12
|
+
configurable:!0});Object.defineProperty(a,"threshold",{get:function(){return iH(this.getAttribute("threshold"))},set:function(b){return b==null?this.removeAttribute("threshold"):this.setAttribute("threshold",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"palette",{get:function(){return kH(this.getAttribute("palette"))},set:function(b){return b==null||$APP.C.i("",b)?this.removeAttribute("palette"):this.setAttribute("palette",""+$APP.T.g(b))},enumerable:!0,configurable:!0})},
|
|
13
|
+
MH=function(){var a=class extends HTMLElement{};a.observedAttributes=JH;a.prototype.connectedCallback=function(){var b=CH(this);this.__xMetaballModel=b;this.__xMetaballMouse={x:0,y:0};if(!$APP.n($APP.k(this,"__xMetaballRefs"))){var c=$APP.k(this,"__xMetaballModel"),d=KH[0];KH[0]=d+1;var e="mb-"+$APP.T.g(d),g=this.attachShadow({mode:"open"}),h=document.createElement("style"),l=document.createElement("div"),m=document.createElementNS("http://www.w3.org/2000/svg","svg");this.__xMetaballUid=d;h.textContent=
|
|
14
|
+
LH;l.setAttribute("part","viewport");l.style.filter="url(#"+$APP.T.g(e)+")";m.style.position="absolute";m.style.width="0";m.style.height="0";m.style.overflow="hidden";var p=$APP.M(c);c=$APP.D(p,$APP.fi);d=$APP.D(p,$APP.Al);var q=$APP.D(p,AH),v=$APP.D(p,xH);p=$APP.D(p,BH);var x=document.createElementNS("http://www.w3.org/2000/svg","defs"),y=document.createElementNS("http://www.w3.org/2000/svg","filter"),A=document.createElementNS("http://www.w3.org/2000/svg","feGaussianBlur"),B=document.createElementNS("http://www.w3.org/2000/svg",
|
|
15
15
|
"feColorMatrix"),E=document.createElementNS("http://www.w3.org/2000/svg","feTurbulence"),H=document.createElementNS("http://www.w3.org/2000/svg","feDisplacementMap");y.setAttribute("id",e);y.setAttribute("x","-20%");y.setAttribute("y","-20%");y.setAttribute("width","140%");y.setAttribute("height","140%");A.setAttribute("in","SourceGraphic");A.setAttribute("stdDeviation",""+$APP.T.g(c));A.setAttribute("result","blur");B.setAttribute("in","blur");B.setAttribute("type","matrix");B.setAttribute("values",
|
|
16
16
|
d);B.setAttribute("result","threshold");E.setAttribute("type","fractalNoise");E.setAttribute("baseFrequency",""+$APP.T.g(.01*v));E.setAttribute("numOctaves","3");E.setAttribute("seed","0");E.setAttribute("result","noise");H.setAttribute("in","threshold");H.setAttribute("in2","noise");H.setAttribute("scale",$APP.n(q)?""+$APP.T.g(p):"0");H.setAttribute("xChannelSelector","R");H.setAttribute("yChannelSelector","G");y.appendChild(A);y.appendChild(B);y.appendChild(E);y.appendChild(H);x.appendChild(y);
|
|
17
|
-
m.appendChild(x);e=new $APP.
|
|
18
|
-
l=$APP.M($APP.k(this,"__xMetaballRefs"));l=$APP.D(l,$APP.
|
|
19
|
-
return null};a.prototype.disconnectedCallback=function(){var b=$APP.k(this,"__xMetaballRaf");$APP.n(b)&&(cancelAnimationFrame(b),this.__xMetaballRaf=null);
|
|
20
|
-
"__xMetaballPos"),m=g.length;e=
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"blob-count-raw","blob-count-raw",-1850938603),
|
|
24
|
-
$APP.
|
|
25
|
-
null),new $APP.
|
|
26
|
-
var
|
|
27
|
-
$APP.T.g("--x-metaball-cursor-color")+",#6366f1);}@media(prefers-reduced-motion:reduce){.blob{transition:none!important;}}",
|
|
28
|
-
$APP.T.g(x)+"px,"+$APP.T.g(v)+"px) translate(-50%,-50%)";p+=1}else break;$APP.n(
|
|
17
|
+
m.appendChild(x);e=new $APP.Q(null,5,[$APP.Sk,y,$APP.ej,A,$APP.zm,B,$APP.vl,E,$APP.Cj,H],null);l.appendChild(m);g.appendChild(h);g.appendChild(l);this.__xMetaballRefs=$APP.Rf($APP.uc([e,new $APP.Q(null,3,[$APP.yi,g,$APP.dj,l,$APP.bk,m],null)]))}g=$APP.k(this,"__xMetaballBlobs");if($APP.n(g)){h=g.length;for(l=0;;)if(l<h)m=g[l],$APP.n(m.parentNode)&&m.parentNode.removeChild(m),l+=1;else break;this.__xMetaballBlobs=[];this.__xMetaballPos=[]}h=$APP.M(b);g=$APP.D(h,yH);m=$APP.D(h,zH);h=$APP.D(h,$APP.Xl);
|
|
18
|
+
l=$APP.M($APP.k(this,"__xMetaballRefs"));l=$APP.D(l,$APP.dj);m=mH(m,g);e=[];c=[];for(d=0;;)if(d<g)q=document.createElement("div"),v=m[d],q.className="blob",q.style.width=""+$APP.T.g(v)+"px",q.style.height=""+$APP.T.g(v)+"px",q.style.background=h[d],l.appendChild(q),e.push(q),c.push({x:0,y:0}),d+=1;else break;this.__xMetaballBlobs=e;this.__xMetaballPos=c;this.__xMetaballSpeeds=lH(g);DH(this,b);this.setAttribute("aria-hidden","true");this.setAttribute("role","presentation");HH(this);GH(this);FH(this);
|
|
19
|
+
return null};a.prototype.disconnectedCallback=function(){var b=$APP.k(this,"__xMetaballRaf");$APP.n(b)&&(cancelAnimationFrame(b),this.__xMetaballRaf=null);HH(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){if($APP.N(c,d)&&(this.__xMetaballModel=b=CH(this),$APP.n($APP.k(this,"__xMetaballRefs")))){d=$APP.M(b);c=$APP.D(d,yH);var e=$APP.D(d,zH);d=$APP.D(d,$APP.Xl);var g=$APP.M($APP.k(this,"__xMetaballRefs")),h=$APP.D(g,$APP.dj);g=$APP.k(this,"__xMetaballBlobs");var l=$APP.k(this,
|
|
20
|
+
"__xMetaballPos"),m=g.length;e=mH(e,c);for(var p=m;;)if(p<c){var q=document.createElement("div");q.className="blob";h.appendChild(q);g.push(q);l.push({x:0,y:0});p+=1}else break;for(h=m;;)if(h>c)m=g.pop(),l.pop(),$APP.n(m.parentNode)&&m.parentNode.removeChild(m),--h;else break;for(l=0;;)if(l<c)h=g[l],m=e[l],h.style.width=""+$APP.T.g(m)+"px",h.style.height=""+$APP.T.g(m)+"px",h.style.background=d[l],l+=1;else break;this.__xMetaballSpeeds=lH(c);g=$APP.M(b);h=$APP.D(g,$APP.fi);e=$APP.D(g,$APP.Al);c=$APP.D(g,
|
|
21
|
+
AH);d=$APP.D(g,xH);g=$APP.D(g,BH);l=$APP.k(this,"__xMetaballRefs");m=$APP.ej.g(l);$APP.n(m)&&m.setAttribute("stdDeviation",""+$APP.T.g(h));h=$APP.zm.g(l);$APP.n(h)&&h.setAttribute("values",e);e=$APP.vl.g(l);$APP.n(e)&&e.setAttribute("baseFrequency",""+$APP.T.g(.01*d));d=$APP.Cj.g(l);$APP.n(d)&&d.setAttribute("scale",$APP.n(c)?""+$APP.T.g(g):"0");return DH(this,b)}return null};IH(a.prototype);return a},NH=function(){$APP.n(customElements.get("x-metaball-cursor"))||customElements.define("x-metaball-cursor",
|
|
22
|
+
MH());return null},rH=new $APP.K(null,"noise-scale-raw","noise-scale-raw",123215597),oH=new $APP.K(null,"noise-intensity-raw","noise-intensity-raw",-116633534),AH=new $APP.K(null,"noise?","noise?",-38350370),zH=new $APP.K(null,"blob-size","blob-size",-1862159046),xH=new $APP.K(null,"noise-scale","noise-scale",-2033475279),sH=new $APP.K(null,"noise-attr","noise-attr",-1534959409),qH=new $APP.K(null,"palette-raw","palette-raw",-1398782582),vH=new $APP.K(null,"palette","palette",-456203511),tH=new $APP.K(null,
|
|
23
|
+
"blob-count-raw","blob-count-raw",-1850938603),uH=new $APP.K(null,"noise-speed-raw","noise-speed-raw",1761342974),wH=new $APP.K(null,"noise-speed","noise-speed",866692139),yH=new $APP.K(null,"blob-count","blob-count",-248711053),BH=new $APP.K(null,"noise-intensity","noise-intensity",747731519),pH=new $APP.K(null,"blob-size-raw","blob-size-raw",530207878);var JH="blob-count blob-size color noise noise-scale noise-speed noise-intensity blur threshold palette".split(" ");
|
|
24
|
+
$APP.zf([$APP.Ej,new $APP.K(null,"blobSize","blobSize",-64083896),new $APP.K(null,"noiseIntensity","noiseIntensity",-792053623),vH,new $APP.K(null,"noiseScale","noiseScale",2003002730),new $APP.K(null,"noise","noise",-994696820),$APP.Al,$APP.fi,new $APP.K(null,"noiseSpeed","noiseSpeed",-959403627),new $APP.K(null,"blobCount","blobCount",-1279691625)],[new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],
|
|
25
|
+
null),new $APP.Q(null,1,[$APP.Z,$APP.W],null),new $APP.Q(null,1,[$APP.Z,$APP.Sj],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null)]);
|
|
26
|
+
var jH=new $APP.Q(null,5,["rainbow",new $APP.O(null,5,5,$APP.P,["#ef4444","#f59e0b","#22c55e","#3b82f6","#a855f7"],null),"ocean",new $APP.O(null,5,5,$APP.P,["#06b6d4","#0ea5e9","#6366f1","#8b5cf6","#0d9488"],null),"sunset",new $APP.O(null,5,5,$APP.P,["#ef4444","#f97316","#eab308","#ec4899","#f43f5e"],null),"neon",new $APP.O(null,5,5,$APP.P,["#22d3ee","#a78bfa","#f472b6","#34d399","#facc15"],null),"ember",new $APP.O(null,5,5,$APP.P,["#dc2626","#ea580c","#d97706","#b91c1c","#f59e0b"],null)],null);var KH=[0],LH=":host{display:block;position:relative;width:100%;height:100%;overflow:hidden;pointer-events:none;z-index:var("+$APP.T.g("--x-metaball-cursor-z-index")+",9999);}[part\x3dviewport]{position:absolute;inset:var("+$APP.T.g("--x-metaball-cursor-inset")+",0);pointer-events:none;opacity:var("+$APP.T.g("--x-metaball-cursor-opacity")+",1);mix-blend-mode:var("+$APP.T.g("--x-metaball-cursor-blend-mode")+",normal);}.blob{position:absolute;border-radius:50%;will-change:transform;pointer-events:none;top:0;left:0;background:var("+
|
|
27
|
+
$APP.T.g("--x-metaball-cursor-color")+",#6366f1);}@media(prefers-reduced-motion:reduce){.blob{transition:none!important;}}",EH=function EH(a){if($APP.n(a.isConnected)){var c=$APP.k(a,"__xMetaballMouse"),d=$APP.k(a,"__xMetaballBlobs"),e=$APP.k(a,"__xMetaballPos"),g=$APP.k(a,"__xMetaballSpeeds"),h=$APP.k(c,"x");c=$APP.k(c,"y");for(var l=$APP.k(a,"__xMetaballModel"),m=d.length,p=0;;)if(p<m){var q=e[p],v=g[p],x=nH($APP.k(q,"x"),h,v);v=nH($APP.k(q,"y"),c,v);var y=d[p];q.x=x;q.y=v;y.style.transform="translate("+
|
|
28
|
+
$APP.T.g(x)+"px,"+$APP.T.g(v)+"px) translate(-50%,-50%)";p+=1}else break;$APP.n(AH.g(l))&&(d=$APP.k(a,"__xMetaballSeed")+wH.g(l),e=$APP.k(a,"__xMetaballRefs"),a.__xMetaballSeed=d,e=$APP.vl.g(e),$APP.n(e)&&e.setAttribute("seed",""+$APP.T.g(Math.floor(d))));$APP.ja(a,"__xMetaballRaf",requestAnimationFrame(function(){return EH.g?EH.g(a):EH.call(null,a)}))}return null};$APP.ha("baredom.exports.x_metaball_cursor.init",NH);export const init=NH;
|
package/dist/x-modal.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
2
|
+
var kW=function(a){var b=$APP.k(a,"__xModalRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),g=document.createElement("div"),h=document.createElement("slot"),l=document.createElement("div"),m=document.createElement("slot"),p=document.createElement("div"),q=document.createElement("slot");c.textContent=":host{display:contents;color-scheme:light dark;--x-modal-bg:var(--x-color-bg,Canvas);--x-modal-fg:var(--x-color-text,CanvasText);--x-modal-backdrop:rgb(0 0 0/0.45);--x-modal-shadow:var(--x-shadow-lg,0 20px 60px rgb(0 0 0/0.25));--x-modal-radius:var(--x-radius-md,0.75rem);--x-modal-width-sm:22rem;--x-modal-width-md:32rem;--x-modal-width-lg:44rem;--x-modal-width-xl:60rem;--x-modal-max-height:90dvh;--x-modal-header-padding:1rem 1.25rem;--x-modal-body-padding:1rem 1.25rem;--x-modal-footer-padding:0.75rem 1.25rem;--x-modal-border:var(--x-color-border,color-mix(in srgb,currentColor 12%,transparent));--x-modal-duration:var(--x-transition-duration,180ms);--x-modal-easing:ease;--x-modal-z:1000;}[part\x3dbackdrop]{position:fixed;inset:0;background:var(--x-modal-backdrop);z-index:var(--x-modal-z);opacity:0;visibility:hidden;pointer-events:none;transition:opacity var(--x-modal-duration) var(--x-modal-easing),visibility 0s var(--x-modal-easing) var(--x-modal-duration);}:host([data-open\x3dtrue]) [part\x3dbackdrop]{opacity:1;visibility:visible;pointer-events:auto;transition:opacity var(--x-modal-duration) var(--x-modal-easing),visibility 0s;}[part\x3ddialog]{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%) scale(0.96);opacity:0;visibility:hidden;pointer-events:none;background:var(--x-modal-bg);color:var(--x-modal-fg);box-shadow:var(--x-modal-shadow);border-radius:var(--x-modal-radius);display:flex;flex-direction:column;overflow:hidden;z-index:calc(var(--x-modal-z) + 1);max-height:var(--x-modal-max-height);transition:opacity var(--x-modal-duration) var(--x-modal-easing),transform var(--x-modal-duration) var(--x-modal-easing),visibility 0s var(--x-modal-easing) var(--x-modal-duration);}:host([data-size\x3dsm]) [part\x3ddialog]{width:var(--x-modal-width-sm);}:host([data-size\x3dmd]) [part\x3ddialog]{width:var(--x-modal-width-md);}:host([data-size\x3dlg]) [part\x3ddialog]{width:var(--x-modal-width-lg);}:host([data-size\x3dxl]) [part\x3ddialog]{width:var(--x-modal-width-xl);}:host([data-size\x3dfull]) [part\x3ddialog]{inset:0;top:0;left:0;width:100%;height:100dvh;border-radius:0;max-width:100%;max-height:100dvh;transform:scale(0.98);}:host([data-open\x3dtrue]) [part\x3ddialog]{opacity:1;transform:translate(-50%,-50%) scale(1);visibility:visible;pointer-events:auto;transition:opacity var(--x-modal-duration) var(--x-modal-easing),transform var(--x-modal-duration) var(--x-modal-easing),visibility 0s;}:host([data-open\x3dtrue][data-size\x3dfull]) [part\x3ddialog]{transform:scale(1);}[part\x3ddialog]:focus{outline:none;}[part\x3dheader]{padding:var(--x-modal-header-padding);border-bottom:1px solid var(--x-modal-border);flex-shrink:0;}[part\x3dbody]{padding:var(--x-modal-body-padding);overflow-y:auto;flex:1;}[part\x3dfooter]{padding:var(--x-modal-footer-padding);border-top:1px solid var(--x-modal-border);flex-shrink:0;}[part\x3ddialog]{max-width:calc(100vw - 2rem);}:host([data-size\x3dfull]) [part\x3ddialog]{max-width:100%;}@media (prefers-reduced-motion:reduce){[part\x3ddialog],[part\x3dbackdrop]{transition:none;}}";
|
|
3
3
|
d.setAttribute("part","backdrop");e.setAttribute("part","dialog");e.setAttribute("role","dialog");e.setAttribute("aria-modal","true");g.setAttribute("part","header");h.setAttribute("name","header");l.setAttribute("part","body");p.setAttribute("part","footer");q.setAttribute("name","footer");g.appendChild(h);l.appendChild(m);p.appendChild(q);e.appendChild(g);e.appendChild(l);e.appendChild(p);b.appendChild(c);b.appendChild(d);b.appendChild(e);a.__xModalRefs={root:b,backdrop:d,dialog:e,header:g,body:l,
|
|
4
|
-
footer:p};return $APP.k(a,"__xModalRefs")},
|
|
5
|
-
a=$APP.
|
|
6
|
-
return $APP.
|
|
7
|
-
"");return null}
|
|
8
|
-
"-1"),a.__xModalDialogTab=!0),d.focus());return null},0):
|
|
9
|
-
$APP.n(d)?"true":"false");a.setAttribute("data-size",$APP.
|
|
10
|
-
g.shiftKey;$APP.n($APP.n(p)?$APP.C.i(l,m):p)?(g.preventDefault(),h.focus()):$APP.r(p)&&$APP.C.i(l,h)&&(g.preventDefault(),m.focus())}}return null}function c(){return
|
|
11
|
-
var e=$APP.k(b,"backdrop");b=$APP.k(b,"keydown");$APP.n(e)&&d.removeEventListener("click",e);$APP.n(b)&&c.removeEventListener("keydown",b)}a.__xModalHandlers=null},
|
|
12
|
-
this.setAttribute("size",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:"Modal"},set:function(b){return b==null?this.removeAttribute("label"):this.setAttribute("label",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"show",{value:function(){return
|
|
13
|
-
configurable:!0,writable:!0});Object.defineProperty(a,"toggle",{value:function(){$APP.n(this.hasAttribute("open"))
|
|
14
|
-
function(b,c,d){$APP.N(c,d)&&
|
|
4
|
+
footer:p};return $APP.k(a,"__xModalRefs")},lW=function(a,b,c){a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},mW=function(a){function b(d){var e=window.getComputedStyle(d);return $APP.N("none",e.display)&&$APP.N("hidden",e.visibility)&&d.offsetWidth>0&&d.offsetHeight>0}var c=$APP.de(b,$APP.uc($APP.k(a,"dialog").querySelectorAll("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex\x3d'-1'])")));
|
|
5
|
+
a=$APP.be(function(d){return $APP.de(b,$APP.be(function(e){var g=$APP.uc(e.querySelectorAll("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex\x3d'-1'])"));return $APP.n(e.matches("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex\x3d'-1'])"))?$APP.od(e,g):g},$APP.uc([$APP.vc(d.assignedElements({flatten:!0}))])))},$APP.uc([$APP.uc($APP.k(a,"root").querySelectorAll("slot"))]));
|
|
6
|
+
return $APP.xe($APP.$d.i(c,a))},nW=function(a){var b=$APP.k(a,"__xModalRefs");b=$APP.n(b)?$APP.k(b,"dialog"):null;var c=$APP.k(a,"__xModalRestore"),d=$APP.k(a,"__xModalDialogTab")===!0;a.__xModalTabbables=null;a.__xModalRestore=null;$APP.n($APP.n(b)?d:b)&&(b.removeAttribute("tabindex"),a.__xModalDialogTab=!1);$APP.n($APP.n(c)?c.isConnected:c)&&c.focus()},oW=function(a,b){lW(a,"x-modal-dismiss",{reason:b});a.removeAttribute("open");return null},pW=function(a){$APP.n(a.hasAttribute("open"))||a.setAttribute("open",
|
|
7
|
+
"");return null},qW=function(a){a.removeAttribute("open");return null},rW=function(a,b){$APP.N($APP.k(a,"__xModalPrevOpen"),b)&&(a.__xModalPrevOpen=b,lW(a,"x-modal-toggle",{open:b}),$APP.n(b)?setTimeout(function(){var c=$APP.k(a,"__xModalRefs"),d=$APP.n(c)?$APP.k(c,"dialog"):null;c=$APP.n(c)?mW(c):null;a.__xModalRestore=document.activeElement;var e=$APP.n(c)?$APP.Dh(c):null;a.__xModalTabbables=e;$APP.t(c)?$APP.u(c).focus():$APP.n(d)&&($APP.n(d.hasAttribute("tabindex"))||(d.setAttribute("tabindex",
|
|
8
|
+
"-1"),a.__xModalDialogTab=!0),d.focus());return null},0):nW(a))},tW=function(a){var b=kW(a);b=$APP.k(b,"dialog");var c=new $APP.Q(null,3,[$APP.xi,a.hasAttribute("open"),$APP.Cl,a.getAttribute("size"),$APP.ki,a.getAttribute("label")],null);var d=$APP.M(c),e=$APP.D(d,$APP.xi);c=$APP.D(d,$APP.Cl);d=$APP.D(d,$APP.ki);e=$APP.F(e);c=typeof c==="string"&&$APP.I(sW,c)?c:"md";d=typeof d==="string"&&$APP.N(d,"")?d:"Modal";c=new $APP.Q(null,3,[$APP.sm,e,$APP.Hh,c,$APP.U,d],null);d=$APP.sm.g(c);a.setAttribute("data-open",
|
|
9
|
+
$APP.n(d)?"true":"false");a.setAttribute("data-size",$APP.Hh.g(c));b.setAttribute("aria-label",$APP.U.g(c));rW(a,d)},uW=function(a){function b(g){var h=g.key;if($APP.C.i(h,"Escape"))g.preventDefault(),oW(a,"escape");else if($APP.C.i(h,"Tab")){h=$APP.k(a,"__xModalTabbables");h=$APP.n(h)?$APP.xe($APP.uc(h)):$APP.fe;var l=$APP.k(a,"__xModalRefs");l=$APP.n(l)?$APP.k(l,"dialog"):null;if($APP.Hc(h))g.preventDefault(),$APP.n(l)&&l.focus();else{l=document.activeElement;var m=$APP.u(h);h=$APP.xc(h);var p=
|
|
10
|
+
g.shiftKey;$APP.n($APP.n(p)?$APP.C.i(l,m):p)?(g.preventDefault(),h.focus()):$APP.r(p)&&$APP.C.i(l,h)&&(g.preventDefault(),m.focus())}}return null}function c(){return oW(a,"backdrop")}var d=kW(a),e=$APP.k(d,"dialog");$APP.k(d,"backdrop").addEventListener("click",c);e.addEventListener("keydown",b);$APP.ja(a,"__xModalHandlers",{backdrop:c,keydown:b})},vW=function(a){var b=$APP.k(a,"__xModalHandlers"),c=$APP.k(a,"__xModalRefs");if($APP.n($APP.n(b)?c:b)){var d=$APP.k(c,"backdrop");c=$APP.k(c,"dialog");
|
|
11
|
+
var e=$APP.k(b,"backdrop");b=$APP.k(b,"keydown");$APP.n(e)&&d.removeEventListener("click",e);$APP.n(b)&&c.removeEventListener("keydown",b)}a.__xModalHandlers=null},wW=function(a){Object.defineProperty(a,"open",{get:function(){return this.hasAttribute("open")},set:function(b){return $APP.n(b)?pW(this):qW(this)},enumerable:!0,configurable:!0});Object.defineProperty(a,"size",{get:function(){var b=this.getAttribute("size");return $APP.n(b)?b:"md"},set:function(b){return b==null?this.removeAttribute("size"):
|
|
12
|
+
this.setAttribute("size",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:"Modal"},set:function(b){return b==null?this.removeAttribute("label"):this.setAttribute("label",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"show",{value:function(){return pW(this)},enumerable:!0,configurable:!0,writable:!0});Object.defineProperty(a,"hide",{value:function(){return qW(this)},enumerable:!0,
|
|
13
|
+
configurable:!0,writable:!0});Object.defineProperty(a,"toggle",{value:function(){$APP.n(this.hasAttribute("open"))?qW(this):pW(this);return null},enumerable:!0,configurable:!0,writable:!0})},yW=function(){if(!$APP.n(customElements.get("x-modal"))){var a=class extends HTMLElement{};a.observedAttributes=xW;a.prototype.connectedCallback=function(){kW(this);vW(this);uW(this);tW(this);return null};a.prototype.disconnectedCallback=function(){vW(this);nW(this);return null};a.prototype.attributeChangedCallback=
|
|
14
|
+
function(b,c,d){$APP.N(c,d)&&tW(this);return null};wW(a.prototype);customElements.define("x-modal",a)}return null},zW=function(){return yW()};var sW=new $APP.S(null,new $APP.Q(null,5,["md",null,"lg",null,"full",null,"xl",null,"sm",null],null),null),xW=["open","size","label"];$APP.Qd(["x-modal-toggle",new $APP.Q(null,2,[$APP.Rl,!1,$APP.V,new $APP.Q(null,1,[$APP.Ol,$APP.Sj],null)],null),"x-modal-dismiss",new $APP.Q(null,2,[$APP.Rl,!1,$APP.V,new $APP.Q(null,1,[$APP.Hi,$APP.Y],null)],null)]);$APP.ha("baredom.exports.x_modal.init",zW);export const init=zW;
|