@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-color-picker.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.T.g($APP.
|
|
4
|
-
8),16)/255],null);default:return null}else return null;else return null},
|
|
5
|
-
b,c){a=
|
|
6
|
-
255).toString(16);return $APP.z(g)<2?"0"+$APP.T.g(g):g}return"#"+$APP.T.g(e(a))+$APP.T.g(e(b))+$APP.T.g(e(c))+$APP.T.g(e(
|
|
7
|
-
|
|
8
|
-
$APP.M(a),c=$APP.D(b,$APP.
|
|
9
|
-
v=$APP.n(A)?v:1;A=
|
|
10
|
-
", Opacity "+$APP.T.g(Math.round(d*100))+"%":a},
|
|
11
|
-
a.getAttribute("label"),a.getAttribute("alpha")]))}
|
|
12
|
-
|
|
13
|
-
h);l.setAttribute("data-color",h);l.style.backgroundColor=h;b.appendChild(l);g+=1}else if(a=$APP.t(a))$APP.Nc(a)?(e=$APP.
|
|
14
|
-
$APP.C.i(m.getAttribute("data-color"),d)?"true":"false")})},
|
|
15
|
-
$APP.k(b,"preview-color"),
|
|
16
|
-
"%");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var d=$APP.n(b.shiftKey)?10:1,e=
|
|
20
|
-
$APP.
|
|
21
|
-
d);case "ArrowLeft":return
|
|
22
|
-
if($APP.n(a)){var b=$APP.k(a,"area");return setTimeout(function(){return b.focus()},0)}return null},
|
|
23
|
-
"trigger");b=$APP.k(b,"panel");var q=function(
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
null;var
|
|
27
|
-
"alpha-strip"),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
d.addEventListener("pointermove",B);d.addEventListener("pointerup",E);d.addEventListener("keydown",H);e.addEventListener("pointerdown",G);e.addEventListener("pointermove",
|
|
31
|
-
|
|
2
|
+
var uz=function(a){return(0,$APP.fh)(a)},vz=function(a,b){return $APP.oh.i($APP.nh.i(a,0),b)},wz=function(a){return $APP.fd(a,360)},xz=function(a){return vz(a,100)},yz=function(a){return vz(a,1)},Az=function(a){var b=typeof a==="string";a=b?$APP.eg(zz,a.trim()):b;return $APP.F(a)},Ez=function(a){if(typeof a==="string")if(a=$APP.eg(zz,a.trim()),$APP.n(a))switch($APP.Ac(a,0,null),a=$APP.Ac(a,1,null),$APP.z(a)){case 3:var b=parseInt(""+$APP.T.g($APP.pc(a,0))+$APP.T.g($APP.pc(a,0)),16),c=parseInt(""+
|
|
3
|
+
$APP.T.g($APP.pc(a,1))+$APP.T.g($APP.pc(a,1)),16),d=parseInt(""+$APP.T.g($APP.pc(a,2))+$APP.T.g($APP.pc(a,2)),16);return new $APP.Q(null,4,[Bz,b,$APP.xl,c,Cz,d,Dz,1],null);case 6:return b=parseInt(a.substring(0,2),16),c=parseInt(a.substring(2,4),16),d=parseInt(a.substring(4,6),16),new $APP.Q(null,4,[Bz,b,$APP.xl,c,Cz,d,Dz,1],null);case 8:return b=parseInt(a.substring(0,2),16),c=parseInt(a.substring(2,4),16),d=parseInt(a.substring(4,6),16),new $APP.Q(null,4,[Bz,b,$APP.xl,c,Cz,d,Dz,parseInt(a.substring(6,
|
|
4
|
+
8),16)/255],null);default:return null}else return null;else return null},Iz=function(a,b,c){a/=255;b/=255;c/=255;var d=$APP.nh.C(a,b,$APP.uc([c])),e=$APP.oh.C(a,b,$APP.uc([c])),g=(d+e)/2,h=d-e;return h===0?new $APP.Q(null,3,[Fz,0,Gz,0,Hz,g*100],null):new $APP.Q(null,3,[Fz,(d===a?((b-c)/h+(b<c?6:0))/6:d===b?((c-a)/h+2)/6:((a-b)/h+4)/6)*360,Gz,(g>.5?h/(2-d-e):h/(d+e))*100,Hz,g*100],null)},Jz=function(a,b,c){c=c<0?c+1:c>1?c-1:c;return c<1/6?a+(b-a)*6*c:c<.5?b:c<2/3?a+(b-a)*(2/3-c)*6:a},Kz=function(a,
|
|
5
|
+
b,c){a=wz(a)/360;b=xz(b)/100;c=xz(c)/100;if(b===0)return a=Math.round(c*255),new $APP.Q(null,3,[Bz,a,$APP.xl,a,Cz,a],null);b=c<.5?c*(1+b):c+b-c*b;c=2*c-b;return new $APP.Q(null,3,[Bz,Math.round(Jz(c,b,a+1/3)*255),$APP.xl,Math.round(Jz(c,b,a)*255),Cz,Math.round(Jz(c,b,a-1/3)*255)],null)},Lz=function(a,b,c){function d(e){e=vz(Math.round(e),255).toString(16);return $APP.z(e)<2?"0"+$APP.T.g(e):e}return"#"+$APP.T.g(d(a))+$APP.T.g(d(b))+$APP.T.g(d(c))},Mz=function(a,b,c,d){function e(g){g=vz(Math.round(g),
|
|
6
|
+
255).toString(16);return $APP.z(g)<2?"0"+$APP.T.g(g):g}return"#"+$APP.T.g(e(a))+$APP.T.g(e(b))+$APP.T.g(e(c))+$APP.T.g(e(yz(d)*255))},Oz=function(a,b,c){b=xz(b)/100;c=xz(c)/100;b=c+b*$APP.oh.i(c,1-c);return new $APP.Q(null,3,[Fz,wz(a),Gz,(b===0?0:2*(1-c/b))*100,Nz,b*100],null)},Pz=function(a,b,c){b=xz(b)/100;c=xz(c)/100;b=c*(1-b/2);c=b===0||b===1?0:(c-b)/$APP.oh.i(b,1-b);return new $APP.Q(null,3,[Fz,wz(a),Gz,c*100,Hz,b*100],null)},Qz=function(a,b){return new $APP.Q(null,2,[$APP.rl,xz(a),$APP.ql,100-
|
|
7
|
+
xz(b)],null)},Rz=function(a){return typeof a==="string"&&Az(a)?(a=Ez(a),$APP.n(a)?Lz(Bz.g(a),$APP.xl.g(a),Cz.g(a)):null):"#000000"},Tz=function(a){return typeof a==="string"&&$APP.I(Sz,a.trim().toLowerCase())?a.trim().toLowerCase():"inline"},Uz=function(a){return typeof a==="string"&&$APP.Jg(a)?$APP.We.m($APP.fe,$APP.ph.m($APP.ae.g(uz),$APP.ce(Az),$APP.ae.g(function(b){b=Ez(b);var c=$APP.M(b);b=$APP.D(c,Bz);var d=$APP.D(c,$APP.xl);c=$APP.D(c,Cz);return Lz(b,d,c)})),$APP.Hg(a,/,/)):$APP.fe},$z=function(a){var b=
|
|
8
|
+
$APP.M(a),c=$APP.D(b,$APP.Ol),d=$APP.D(b,$APP.Fj),e=$APP.D(b,$APP.Pi);a=$APP.D(b,$APP.qj);var g=$APP.D(b,$APP.rj),h=$APP.D(b,$APP.mj),l=$APP.D(b,Vz),m=$APP.D(b,$APP.U),p=$APP.D(b,Wz);b=Rz(e);var q=function(){var H=Ez(e);return $APP.n(H)?H:Ez("#000000")}(),v=$APP.M(q);q=$APP.D(v,Bz);var x=$APP.D(v,$APP.xl),y=$APP.D(v,Cz);v=$APP.D(v,Dz);var A=function(){var H=typeof e==="string";if(H){H=e.trim();var G=$APP.eg(zz,H);$APP.n(G)?(H=$APP.eg(zz,H),H=$APP.u($APP.w(H)),H=8===$APP.z(H)):H=G;return H}return H}();
|
|
9
|
+
v=$APP.n(A)?v:1;A=Iz(q,x,y);var B=$APP.M(A);A=$APP.D(B,Fz);var E=$APP.D(B,Gz);B=$APP.D(B,Hz);d=$APP.Ig(d);g=$APP.Ig(g);p=p!=null;c=c!=null;h=Tz(h);return $APP.zf([$APP.Im,Xz,$APP.qj,$APP.mj,Vz,Gz,Hz,Yz,Fz,$APP.U,$APP.sm,Zz,$APP.X,Dz],[g,p,$APP.Jg(a)?a:null,h,Uz(l),E,B,b,A,$APP.Jg(m)?m:null,$APP.C.i(h,"popover")&&c,p&&v<1?Mz(q,x,y,v):b,d,v])},aA=function(a,b,c,d){a="Hue "+$APP.T.g(Math.round(a))+", Saturation "+$APP.T.g(Math.round(b))+"%, Lightness "+$APP.T.g(Math.round(c))+"%";return d<1?""+$APP.T.g(a)+
|
|
10
|
+
", Opacity "+$APP.T.g(Math.round(d*100))+"%":a},bA=function(a){var b=$APP.M(a);a=$APP.D(b,$APP.X);b=$APP.D(b,$APP.Im);return $APP.r(a)&&$APP.r(b)},cA=function(a){return document.createElement(a)},dA=function(a,b,c){return a.setAttribute(b,c)},eA=function(a){return $z($APP.zf([$APP.Ol,$APP.Fj,$APP.qj,$APP.Pi,$APP.rj,$APP.mj,Vz,$APP.U,Wz],[a.getAttribute("open"),a.getAttribute("disabled"),a.getAttribute("name"),a.getAttribute("value"),a.getAttribute("readonly"),a.getAttribute("mode"),a.getAttribute("swatches"),
|
|
11
|
+
a.getAttribute("label"),a.getAttribute("alpha")]))},fA=function(a,b,c,d){b=new CustomEvent(b,{detail:$APP.Dh(d),bubbles:!0,composed:!0,cancelable:$APP.F(c)});return a.dispatchEvent(b)},gA=function(a,b){var c=Zz.g(b),d=Fz.g(b),e=Gz.g(b),g=Hz.g(b);b=Dz.g(b);return fA(a,"x-color-picker-input",!1,new $APP.Q(null,5,[$APP.Pi,c,Fz,d,Gz,e,Hz,g,Dz,b],null))},hA=function(a,b){var c=Zz.g(b),d=Fz.g(b),e=Gz.g(b),g=Hz.g(b);b=Dz.g(b);return fA(a,"x-color-picker-change",!0,new $APP.Q(null,5,[$APP.Pi,c,Fz,d,Gz,e,
|
|
12
|
+
Hz,g,Dz,b],null))},iA=function(a,b,c,d,e,g){b=Kz(b,c,d);d=$APP.M(b);b=$APP.D(d,Bz);c=$APP.D(d,$APP.xl);d=$APP.D(d,Cz);e=$APP.n($APP.n(g)?e<1:g)?Mz(b,c,d,e):Lz(b,c,d);a.setAttribute("value",e)},jA=function(a,b,c,d){if($APP.N($APP.k(a,"__xColorPickerSwatchesCache"),c)){a.__xColorPickerSwatchesCache=c;b.innerHTML="";a=$APP.t(c);c=null;for(var e=0,g=0;;)if(g<e){var h=c.F(null,g),l=cA("button");l.setAttribute("part","swatch");l.setAttribute("type","button");l.setAttribute("role","option");l.setAttribute("aria-label",
|
|
13
|
+
h);l.setAttribute("data-color",h);l.style.backgroundColor=h;b.appendChild(l);g+=1}else if(a=$APP.t(a))$APP.Nc(a)?(e=$APP.yb(a),a=$APP.zb(a),c=e,e=$APP.z(e)):(c=$APP.u(a),e=cA("button"),e.setAttribute("part","swatch"),e.setAttribute("type","button"),e.setAttribute("role","option"),e.setAttribute("aria-label",c),e.setAttribute("data-color",c),e.style.backgroundColor=c,b.appendChild(e),a=$APP.w(a),c=null,e=0),g=0;else break}b.querySelectorAll("[part\x3dswatch]").forEach(function(m){return dA(m,"aria-selected",
|
|
14
|
+
$APP.C.i(m.getAttribute("data-color"),d)?"true":"false")})},kA=function(a){var b=$APP.k(a,"__xColorPickerRefs");if($APP.n(b)){var c=eA(a),d=$APP.M(c);c=$APP.D(d,Zz);var e=$APP.D(d,$APP.X),g=$APP.D(d,Dz),h=$APP.D(d,$APP.Im),l=$APP.D(d,Xz),m=$APP.D(d,$APP.mj),p=$APP.D(d,Vz),q=$APP.D(d,Gz),v=$APP.D(d,Hz),x=$APP.D(d,Yz),y=$APP.D(d,$APP.U),A=$APP.D(d,Fz);d=Oz(A,q,v);d=$APP.M(d);var B=$APP.D(d,Gz);q=$APP.D(d,Nz);d=Qz(Gz.g(d),q);q=$APP.k(b,"area");var E=$APP.k(b,"hue-strip"),H=$APP.k(b,"alpha-strip"),G=
|
|
15
|
+
$APP.k(b,"preview-color"),J=$APP.k(b,"hex-input"),R=$APP.k(b,"trigger-swatch");b=$APP.k(b,"swatches");a.setAttribute("data-mode",m);a.style.setProperty("--_x-cp-hue",""+$APP.T.g(Math.round(A)));q.style.setProperty("--_x-cp-area-x",""+$APP.T.g($APP.rl.g(d).toFixed(2))+"%");q.style.setProperty("--_x-cp-area-y",""+$APP.T.g($APP.ql.g(d).toFixed(2))+"%");dA(q,"aria-valuetext",aA(A,B,v,g));$APP.n(y)&&q.setAttribute("aria-label",y);E.style.setProperty("--_x-cp-hue-pos",""+$APP.T.g((wz(A)/360*100).toFixed(2))+
|
|
16
|
+
"%");dA(E,"aria-valuenow",""+$APP.T.g(Math.round(A)));$APP.n(l)?(H.style.display="",a.style.setProperty("--_x-cp-alpha-color","hsl("+$APP.T.g(Math.round(A))+","+$APP.T.g(Math.round(B))+"%,"+$APP.T.g(Math.round(v))+"%)"),H.style.setProperty("--_x-cp-alpha-pos",""+$APP.T.g((yz(g)*100).toFixed(2))+"%"),dA(H,"aria-valuenow",""+$APP.T.g(Math.round(g*100)))):H.style.display="none";G.style.backgroundColor=$APP.n(l)?function(){var aa=Kz(A,B,v),oa=$APP.M(aa);aa=$APP.D(oa,Bz);var Aa=$APP.D(oa,$APP.xl);oa=$APP.D(oa,
|
|
17
|
+
Cz);return"rgba("+$APP.T.g(aa)+","+$APP.T.g(Aa)+","+$APP.T.g(oa)+","+$APP.T.g(g.toFixed(2))+")"}():x;a.shadowRoot.activeElement!==J&&(J.value=c);R.style.backgroundColor=$APP.n(l)?function(){var aa=Kz(A,B,v),oa=$APP.M(aa);aa=$APP.D(oa,Bz);var Aa=$APP.D(oa,$APP.xl);oa=$APP.D(oa,Cz);return"rgba("+$APP.T.g(aa)+","+$APP.T.g(Aa)+","+$APP.T.g(oa)+","+$APP.T.g(g.toFixed(2))+")"}():x;J.disabled=$APP.n(e)?e:h;jA(a,b,p,x);a=$APP.k(a,"__xColorPickerInternals");return $APP.n(a)?a.setFormValue(c):null}return null},
|
|
18
|
+
mA=function(a,b){var c=a.getBoundingClientRect();a=b.clientY-c.top;var d=c.width,e=c.height;b=100*(vz(b.clientX-c.left,d)/d);a=100*(vz(a,e)/e);return new $APP.Q(null,2,[lA,xz(b),$APP.Hj,100-xz(a)],null)},nA=function(a,b){a=a.getBoundingClientRect();var c=a.width;b=100*(vz(b.clientX-a.left,c)/c);return xz(b)/100*360},oA=function(a,b){a=a.getBoundingClientRect();var c=a.width;b=100*(vz(b.clientX-a.left,c)/c);return xz(b)/100},qA=function(a,b){var c=eA(a);if(bA(c)&&$APP.I(pA,b.key)){b.preventDefault();
|
|
19
|
+
var d=$APP.n(b.shiftKey)?10:1,e=Oz(Fz.g(c),Gz.g(c),Hz.g(c)),g=function(){switch(b.key){case "ArrowRight":return xz(Gz.g(e)+d);case "ArrowLeft":return xz(Gz.g(e)-d);default:return Gz.g(e)}}(),h=function(){switch(b.key){case "ArrowUp":return xz(Nz.g(e)+d);case "ArrowDown":return xz(Nz.g(e)-d);default:return Nz.g(e)}}();g=Pz(Fz.g(c),g,h);var l=$APP.M(g);g=$APP.D(l,Fz);h=$APP.D(l,Gz);l=$APP.D(l,Hz);iA(a,g,h,l,Dz.g(c),Xz.g(c));gA(a,eA(a));return hA(a,eA(a))}return null},sA=function(a,b){var c=eA(a);if(bA(c)&&
|
|
20
|
+
$APP.I(rA,b.key)){b.preventDefault();var d=$APP.n(b.shiftKey)?10:1,e=function(){switch(b.key){case "ArrowRight":return wz(Fz.g(c)+d);case "ArrowLeft":return wz(Fz.g(c)-d);case "Home":return 0;case "End":return 360;default:return Fz.g(c)}}();iA(a,e,Gz.g(c),Hz.g(c),Dz.g(c),Xz.g(c));gA(a,eA(a));return hA(a,eA(a))}return null},tA=function(a,b){var c=eA(a);if($APP.n(function(){var g=bA(c);return g?(g=Xz.g(c),$APP.n(g)?$APP.I(rA,b.key):g):g}())){b.preventDefault();var d=$APP.n(b.shiftKey)?.1:.01,e=function(){switch(b.key){case "ArrowRight":return yz(Dz.g(c)+
|
|
21
|
+
d);case "ArrowLeft":return yz(Dz.g(c)-d);case "Home":return 0;case "End":return 1;default:return Dz.g(c)}}();iA(a,Fz.g(c),Gz.g(c),Hz.g(c),e,!0);gA(a,eA(a));return hA(a,eA(a))}return null},uA=function(a){var b=eA(a);return bA(b)&&typeof EyeDropper!=="undefined"?(new EyeDropper).open().then(function(c){a.setAttribute("value",c.sRGBHex);return hA(a,eA(a))}).catch(function(){return null}):null},vA=function(a){if($APP.n(a.hasAttribute("open")))return null;a.setAttribute("open","");a=$APP.k(a,"__xColorPickerRefs");
|
|
22
|
+
if($APP.n(a)){var b=$APP.k(a,"area");return setTimeout(function(){return b.focus()},0)}return null},wA=function(a){return $APP.n(a.hasAttribute("open"))?(a.removeAttribute("open"),a=$APP.k(a,"__xColorPickerRefs"),$APP.n(a)?$APP.k(a,"trigger").focus():null):null},xA=function(a){var b=$APP.k(a,"__xColorPickerRefs");if($APP.n(b)){var c=$APP.k(b,"area"),d=$APP.k(b,"hue-strip"),e=$APP.k(b,"alpha-strip"),g=$APP.k(b,"hex-input"),h=$APP.k(b,"swatches"),l=$APP.k(b,"eyedropper"),m=$APP.k(b,"copy"),p=$APP.k(b,
|
|
23
|
+
"trigger");b=$APP.k(b,"panel");var q=function(da){var qa=eA(a);if(bA(qa)){da.preventDefault();var Ma=$APP.k($APP.k(a,"__xColorPickerRefs"),"area");Ma.setPointerCapture(da.pointerId);a.__xColorPickerDragging="area";da=mA(Ma,da);Ma=$APP.M(da);da=$APP.D(Ma,lA);Ma=$APP.D(Ma,$APP.Hj);da=Pz(Fz.g(qa),da,Ma);var Wb=$APP.M(da);da=$APP.D(Wb,Fz);Ma=$APP.D(Wb,Gz);Wb=$APP.D(Wb,Hz);iA(a,da,Ma,Wb,Dz.g(qa),Xz.g(qa));qa=gA(a,eA(a))}else qa=null;return qa},v=function(da){if($APP.C.i("area",$APP.k(a,"__xColorPickerDragging"))){var qa=
|
|
24
|
+
eA(a);da=mA($APP.k($APP.k(a,"__xColorPickerRefs"),"area"),da);var Ma=$APP.M(da);da=$APP.D(Ma,lA);Ma=$APP.D(Ma,$APP.Hj);da=Pz(Fz.g(qa),da,Ma);var Wb=$APP.M(da);da=$APP.D(Wb,Fz);Ma=$APP.D(Wb,Gz);Wb=$APP.D(Wb,Hz);iA(a,da,Ma,Wb,Dz.g(qa),Xz.g(qa));qa=gA(a,eA(a))}else qa=null;return qa},x=function(){if($APP.C.i("area",$APP.k(a,"__xColorPickerDragging"))){a.__xColorPickerDragging=null;var da=hA(a,eA(a))}else da=null;return da},y=function(da){return qA(a,da)},A=function(da){var qa=eA(a);if(bA(qa)){da.preventDefault();
|
|
25
|
+
var Ma=$APP.k($APP.k(a,"__xColorPickerRefs"),"hue-strip");Ma.setPointerCapture(da.pointerId);a.__xColorPickerDragging="hue";da=nA(Ma,da);iA(a,da,Gz.g(qa),Hz.g(qa),Dz.g(qa),Xz.g(qa));qa=gA(a,eA(a))}else qa=null;return qa},B=function(da){if($APP.C.i("hue",$APP.k(a,"__xColorPickerDragging"))){var qa=eA(a);da=nA($APP.k($APP.k(a,"__xColorPickerRefs"),"hue-strip"),da);iA(a,da,Gz.g(qa),Hz.g(qa),Dz.g(qa),Xz.g(qa));qa=gA(a,eA(a))}else qa=null;return qa},E=function(){if($APP.C.i("hue",$APP.k(a,"__xColorPickerDragging"))){a.__xColorPickerDragging=
|
|
26
|
+
null;var da=hA(a,eA(a))}else da=null;return da},H=function(da){return sA(a,da)},G=function(da){var qa=eA(a);var Ma=(Ma=bA(qa))?Xz.g(qa):Ma;$APP.n(Ma)?(da.preventDefault(),Ma=$APP.k($APP.k(a,"__xColorPickerRefs"),"alpha-strip"),Ma.setPointerCapture(da.pointerId),a.__xColorPickerDragging="alpha",da=oA(Ma,da),iA(a,Fz.g(qa),Gz.g(qa),Hz.g(qa),da,!0),qa=gA(a,eA(a))):qa=null;return qa},J=function(da){if($APP.C.i("alpha",$APP.k(a,"__xColorPickerDragging"))){var qa=eA(a);da=oA($APP.k($APP.k(a,"__xColorPickerRefs"),
|
|
27
|
+
"alpha-strip"),da);iA(a,Fz.g(qa),Gz.g(qa),Hz.g(qa),da,!0);qa=gA(a,eA(a))}else qa=null;return qa},R=function(){if($APP.C.i("alpha",$APP.k(a,"__xColorPickerDragging"))){a.__xColorPickerDragging=null;var da=hA(a,eA(a))}else da=null;return da},aa=function(da){return tA(a,da)},oa=function(da){a:{if($APP.C.i("Enter",da.key)){da.preventDefault();da=$APP.k($APP.k(a,"__xColorPickerRefs"),"hex-input");var qa=da.value,Ma=eA(a);if(bA(Ma)){if(Az(qa)){a.setAttribute("value",qa);da=hA(a,eA(a));break a}da=da.value=
|
|
28
|
+
Zz.g(Ma);break a}}da=null}return da},Aa=function(da){a:{var qa=eA(a);if(bA(qa)&&(da=da.target,$APP.n(da.hasAttribute("data-color")))){da=da.getAttribute("data-color");a.setAttribute("value",da);da=hA(a,eA(a));break a}da=null}return da},La=function(){return uA(a)},bb=function(){var da=eA(a);return $APP.n(navigator.clipboard)?navigator.clipboard.writeText(Zz.g(da)):null},cb=function(){var da=eA(a);return $APP.C.i("popover",$APP.mj.g(da))&&$APP.r($APP.X.g(da))?$APP.n($APP.sm.g(da))?wA(a):vA(a):null},
|
|
29
|
+
mb=function(da){$APP.C.i("Escape",da.key)&&$APP.C.i("popover",$APP.mj.g(eA(a)))?(da.preventDefault(),da.stopPropagation(),da=wA(a)):da=null;return da},Lb=function(da){return da.stopPropagation()},db=function(da){return $APP.n(a.hasAttribute("open"))?$APP.n(da.composedPath().some(function(qa){return qa===a}))?null:wA(a):null};c.addEventListener("pointerdown",q);c.addEventListener("pointermove",v);c.addEventListener("pointerup",x);c.addEventListener("keydown",y);d.addEventListener("pointerdown",A);
|
|
30
|
+
d.addEventListener("pointermove",B);d.addEventListener("pointerup",E);d.addEventListener("keydown",H);e.addEventListener("pointerdown",G);e.addEventListener("pointermove",J);e.addEventListener("pointerup",R);e.addEventListener("keydown",aa);g.addEventListener("keydown",oa);h.addEventListener("click",Aa);l.addEventListener("click",La);m.addEventListener("click",bb);p.addEventListener("click",cb);b.addEventListener("keydown",mb);b.addEventListener("pointerdown",Lb);document.addEventListener("pointerdown",
|
|
31
|
+
db,!0);$APP.Cg(a,"__xColorPickerHandlers",{"area-move":v,copy:bb,"panel-key":mb,"alpha-up":R,"hue-up":E,"alpha-key":aa,"alpha-move":J,"hex-key":oa,swatch:Aa,"area-up":x,"alpha-down":G,"area-key":y,"hue-down":A,"hue-key":H,"hue-move":B,eyedrop:La,"panel-pd":Lb,trigger:cb,"doc-click":db,"area-down":q})}},yA=function(a){var b=$APP.k(a,"__xColorPickerRefs"),c=$APP.k(a,"__xColorPickerHandlers");if($APP.n($APP.n(b)?c:b)){var d=$APP.k(b,"area"),e=$APP.k(b,"hue-strip"),g=$APP.k(b,"alpha-strip"),h=$APP.k(b,
|
|
32
32
|
"hex-input"),l=$APP.k(b,"swatches"),m=$APP.k(b,"eyedropper"),p=$APP.k(b,"copy"),q=$APP.k(b,"trigger");b=$APP.k(b,"panel");d.removeEventListener("pointerdown",$APP.k(c,"area-down"));d.removeEventListener("pointermove",$APP.k(c,"area-move"));d.removeEventListener("pointerup",$APP.k(c,"area-up"));d.removeEventListener("keydown",$APP.k(c,"area-key"));e.removeEventListener("pointerdown",$APP.k(c,"hue-down"));e.removeEventListener("pointermove",$APP.k(c,"hue-move"));e.removeEventListener("pointerup",$APP.k(c,
|
|
33
33
|
"hue-up"));e.removeEventListener("keydown",$APP.k(c,"hue-key"));g.removeEventListener("pointerdown",$APP.k(c,"alpha-down"));g.removeEventListener("pointermove",$APP.k(c,"alpha-move"));g.removeEventListener("pointerup",$APP.k(c,"alpha-up"));g.removeEventListener("keydown",$APP.k(c,"alpha-key"));h.removeEventListener("keydown",$APP.k(c,"hex-key"));l.removeEventListener("click",$APP.k(c,"swatch"));m.removeEventListener("click",$APP.k(c,"eyedrop"));p.removeEventListener("click",$APP.k(c,"copy"));q.removeEventListener("click",
|
|
34
|
-
$APP.k(c,"trigger"));b.removeEventListener("keydown",$APP.k(c,"panel-key"));b.removeEventListener("pointerdown",$APP.k(c,"panel-pd"));document.removeEventListener("pointerdown",$APP.k(c,"doc-click"),!0);a.__xColorPickerHandlers=null}else return null},
|
|
35
|
-
this.getAttribute(c);return $APP.n(d)?d:null},set:function(d){return d!=null&&$APP.N(d)?
|
|
36
|
-
b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xColorPickerRefs"))){var c=this.attachShadow({mode:"open"}),d=
|
|
34
|
+
$APP.k(c,"trigger"));b.removeEventListener("keydown",$APP.k(c,"panel-key"));b.removeEventListener("pointerdown",$APP.k(c,"panel-pd"));document.removeEventListener("pointerdown",$APP.k(c,"doc-click"),!0);a.__xColorPickerHandlers=null}else return null},zA=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.Eg(this,c,$APP.F(d))}})},AA=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=
|
|
35
|
+
this.getAttribute(c);return $APP.n(d)?d:null},set:function(d){return d!=null&&$APP.N(d)?dA(this,c,""+$APP.T.g(d)):this.removeAttribute(c)}})},CA=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return BA}});zA(b,"disabled","disabled");zA(b,"readOnly","readonly");zA(b,"alpha","alpha");zA(b,"open","open");AA(b,"value","value");AA(b,"swatches","swatches");AA(b,"name","name");AA(b,"mode","mode");AA(b,"label","label");
|
|
36
|
+
b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xColorPickerRefs"))){var c=this.attachShadow({mode:"open"}),d=cA("style"),e=cA("div"),g=cA("button"),h=cA("span"),l=cA("div"),m=cA("div"),p=cA("div"),q=cA("div"),v=cA("div"),x=cA("div"),y=cA("div"),A=cA("div"),B=cA("div"),E=cA("div"),H=cA("div"),G=cA("span"),J=cA("input"),R=cA("button"),aa=cA("button"),oa=cA("div");d.textContent=":host{display:inline-block;color-scheme:light dark;position:relative;--x-color-picker-width:240px;--x-color-picker-area-height:160px;--x-color-picker-strip-height:14px;--x-color-picker-swatch-size:28px;--x-color-picker-radius:var(--x-radius-md,8px);--x-color-picker-gap:10px;--x-color-picker-bg:var(--x-color-bg,#ffffff);--x-color-picker-border:var(--x-color-border,#cbd5e1);--x-color-picker-text:var(--x-color-text,#1e293b);--x-color-picker-focus-ring:var(--x-color-focus-ring,#60a5fa);--x-color-picker-disabled-opacity:0.45;}@media (prefers-color-scheme:dark){:host{--x-color-picker-bg:var(--x-color-bg,#1e293b);--x-color-picker-border:var(--x-color-border,#475569);--x-color-picker-text:var(--x-color-text,#f1f5f9);--x-color-picker-focus-ring:var(--x-color-focus-ring,#93c5fd);}}[part\x3dcontainer]{position:relative;width:var(--x-color-picker-width);max-width:calc(100vw - 2rem);}[part\x3dtrigger]{all:unset;display:none;box-sizing:border-box;width:36px;height:36px;border-radius:var(--x-color-picker-radius);border:2px solid var(--x-color-picker-border);cursor:pointer;overflow:hidden;}[part\x3dtrigger]:focus-visible{outline:2px solid var(--x-color-picker-focus-ring);outline-offset:2px;}:host([data-mode\x3dpopover]) [part\x3dtrigger]{display:block;}[part\x3dtrigger-swatch]{display:block;width:100%;height:100%;}[part\x3dpanel]{box-sizing:border-box;background:var(--x-color-picker-bg);border:1px solid var(--x-color-picker-border);border-radius:var(--x-color-picker-radius);padding:var(--x-color-picker-gap);display:flex;flex-direction:column;gap:var(--x-color-picker-gap);box-shadow:var(--x-shadow-md,0 4px 12px rgba(0,0,0,0.1));}:host([data-mode\x3dpopover]) [part\x3dpanel]{display:none;position:absolute;z-index:1000;top:calc(100% + 8px);left:0;max-width:calc(100vw - 1rem);}:host([data-mode\x3dpopover][open]) [part\x3dpanel]{display:flex;}[part\x3darea]{position:relative;width:100%;height:var(--x-color-picker-area-height);border-radius:calc(var(--x-color-picker-radius) - 2px);cursor:crosshair;touch-action:none;overflow:hidden;background:linear-gradient(to bottom,transparent,#000),linear-gradient(to right,#fff,hsl(var(--_x-cp-hue,0),100%,50%));}[part\x3darea]:focus-visible{outline:2px solid var(--x-color-picker-focus-ring);outline-offset:2px;}[part\x3darea-thumb]{position:absolute;width:16px;height:16px;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,0.3),inset 0 0 0 1px rgba(0,0,0,0.3);pointer-events:none;left:var(--_x-cp-area-x,0%);top:var(--_x-cp-area-y,0%);transform:translate(-50%,-50%);}[part\x3dstrips]{display:flex;flex-direction:column;gap:8px;}[part\x3dhue-strip]{position:relative;width:100%;height:var(--x-color-picker-strip-height);border-radius:var(--x-color-picker-strip-height);cursor:pointer;touch-action:none;background:linear-gradient(to right,#f00 0%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,#f00 100%);}[part\x3dhue-strip]:focus-visible{outline:2px solid var(--x-color-picker-focus-ring);outline-offset:2px;}[part\x3dhue-thumb]{position:absolute;width:16px;height:16px;border-radius:50%;border:2px solid #fff;box-shadow:0 1px 4px rgba(0,0,0,0.3);pointer-events:none;top:50%;left:var(--_x-cp-hue-pos,0%);transform:translate(-50%,-50%);}[part\x3dalpha-strip]{position:relative;width:100%;height:var(--x-color-picker-strip-height);border-radius:var(--x-color-picker-strip-height);cursor:pointer;touch-action:none;background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0;}[part\x3dalpha-strip]:focus-visible{outline:2px solid var(--x-color-picker-focus-ring);outline-offset:2px;}[part\x3dalpha-gradient]{position:absolute;inset:0;border-radius:inherit;background:linear-gradient(to right,transparent,var(--_x-cp-alpha-color,#000));}[part\x3dalpha-thumb]{position:absolute;width:16px;height:16px;border-radius:50%;border:2px solid #fff;box-shadow:0 1px 4px rgba(0,0,0,0.3);pointer-events:none;top:50%;left:var(--_x-cp-alpha-pos,100%);transform:translate(-50%,-50%);z-index:1;}[part\x3dcontrols]{display:flex;align-items:center;gap:6px;}[part\x3dpreview]{width:32px;height:32px;border-radius:var(--x-color-picker-radius);border:1px solid var(--x-color-picker-border);flex-shrink:0;background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(-45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(-45deg,transparent 75%,#ccc 75%);background-size:8px 8px;background-position:0 0,0 4px,4px -4px,-4px 0;overflow:hidden;}[part\x3dpreview-color]{display:block;width:100%;height:100%;}[part\x3dhex-input]{flex:1;min-width:0;box-sizing:border-box;padding:4px 8px;border:1px solid var(--x-color-picker-border);border-radius:calc(var(--x-color-picker-radius) - 2px);background:transparent;color:var(--x-color-picker-text);font-family:var(--x-font-family,inherit);font-size:var(--x-font-size-sm,0.8125rem);outline:none;}[part\x3dhex-input]:focus-visible{border-color:var(--x-color-picker-focus-ring);box-shadow:0 0 0 2px var(--x-color-picker-focus-ring);}[part\x3deyedropper],[part\x3dcopy]{all:unset;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:calc(var(--x-color-picker-radius) - 2px);cursor:pointer;color:var(--x-color-picker-text);flex-shrink:0;}[part\x3deyedropper]:hover,[part\x3dcopy]:hover{background:rgba(0,0,0,0.06);}@media (prefers-color-scheme:dark){[part\x3deyedropper]:hover,[part\x3dcopy]:hover{background:rgba(255,255,255,0.1);}}[part\x3deyedropper]:focus-visible,[part\x3dcopy]:focus-visible{outline:2px solid var(--x-color-picker-focus-ring);outline-offset:1px;}[part\x3dswatches]{display:grid;grid-template-columns:repeat(auto-fill,var(--x-color-picker-swatch-size));gap:4px;}[part\x3dswatches]:empty{display:none;}[part\x3dswatch]{all:unset;width:var(--x-color-picker-swatch-size);height:var(--x-color-picker-swatch-size);border-radius:4px;cursor:pointer;border:1px solid rgba(0,0,0,0.1);box-sizing:border-box;}[part\x3dswatch]:focus-visible{outline:2px solid var(--x-color-picker-focus-ring);outline-offset:1px;}[part\x3dswatch][aria-selected\x3dtrue]{outline:2px solid var(--x-color-picker-focus-ring);outline-offset:1px;}:host([disabled]){opacity:var(--x-color-picker-disabled-opacity);pointer-events:none;}@media (prefers-reduced-motion:reduce){[part\x3darea-thumb],[part\x3dhue-thumb],[part\x3dalpha-thumb]{transition:none;}}@media (pointer:coarse){[part\x3darea-thumb],[part\x3dhue-thumb],[part\x3dalpha-thumb]{width:24px;height:24px;}[part\x3dtrigger]{width:44px;height:44px;}[part\x3deyedropper],[part\x3dcopy]{width:44px;height:44px;}[part\x3dswatch]{min-width:44px;min-height:44px;}}";
|
|
37
37
|
e.setAttribute("part","container");g.setAttribute("part","trigger");g.setAttribute("type","button");g.setAttribute("aria-label","Pick color");h.setAttribute("part","trigger-swatch");l.setAttribute("part","panel");m.setAttribute("part","area");m.setAttribute("role","slider");m.setAttribute("tabindex","0");m.setAttribute("aria-label","Color");p.setAttribute("part","area-thumb");q.setAttribute("part","strips");v.setAttribute("part","hue-strip");v.setAttribute("role","slider");v.setAttribute("tabindex",
|
|
38
38
|
"0");v.setAttribute("aria-label","Hue");v.setAttribute("aria-valuemin","0");v.setAttribute("aria-valuemax","360");x.setAttribute("part","hue-thumb");y.setAttribute("part","alpha-strip");y.setAttribute("role","slider");y.setAttribute("tabindex","0");y.setAttribute("aria-label","Opacity");y.setAttribute("aria-valuemin","0");y.setAttribute("aria-valuemax","100");A.setAttribute("part","alpha-gradient");B.setAttribute("part","alpha-thumb");E.setAttribute("part","controls");H.setAttribute("part","preview");
|
|
39
|
-
G.setAttribute("part","preview-color");
|
|
40
|
-
|
|
41
|
-
"swatches");
|
|
42
|
-
{"alpha-thumb":B,copy:
|
|
43
|
-
"disabled",$APP.F(c));return
|
|
44
|
-
"r","r",-471384190),
|
|
45
|
-
$APP.
|
|
46
|
-
$APP.
|
|
39
|
+
G.setAttribute("part","preview-color");J.setAttribute("part","hex-input");J.setAttribute("type","text");J.setAttribute("spellcheck","false");J.setAttribute("autocomplete","off");J.setAttribute("aria-label","Hex color value");R.setAttribute("part","eyedropper");R.setAttribute("type","button");R.setAttribute("aria-label","Pick color from screen");R.innerHTML='\x3csvg width\x3d"16" height\x3d"16" viewBox\x3d"0 0 16 16" fill\x3d"none" stroke\x3d"currentColor" stroke-width\x3d"1.5" stroke-linecap\x3d"round" stroke-linejoin\x3d"round"\x3e\x3cpath d\x3d"M13.5 2.5a2.12 2.12 0 0 0-3 0L9 4l-.5-.5L6 6l4 4 2.5-2.5L12 7l1.5-1.5a2.12 2.12 0 0 0 0-3zM6 6L2.5 9.5a1.5 1.5 0 0 0-.4.8L1.5 14l3.7-.6a1.5 1.5 0 0 0 .8-.4L10 10"/\x3e\x3c/svg\x3e';
|
|
40
|
+
aa.setAttribute("part","copy");aa.setAttribute("type","button");aa.setAttribute("aria-label","Copy color value");aa.innerHTML='\x3csvg width\x3d"16" height\x3d"16" viewBox\x3d"0 0 16 16" fill\x3d"none" stroke\x3d"currentColor" stroke-width\x3d"1.5" stroke-linecap\x3d"round" stroke-linejoin\x3d"round"\x3e\x3crect x\x3d"5" y\x3d"5" width\x3d"9" height\x3d"9" rx\x3d"1.5"/\x3e\x3cpath d\x3d"M5 11H3.5A1.5 1.5 0 0 1 2 9.5v-6A1.5 1.5 0 0 1 3.5 2h6A1.5 1.5 0 0 1 11 3.5V5"/\x3e\x3c/svg\x3e';oa.setAttribute("part",
|
|
41
|
+
"swatches");oa.setAttribute("role","listbox");oa.setAttribute("aria-label","Preset colors");g.appendChild(h);m.appendChild(p);v.appendChild(x);y.appendChild(A);y.appendChild(B);q.appendChild(v);q.appendChild(y);H.appendChild(G);E.appendChild(H);E.appendChild(J);E.appendChild(R);E.appendChild(aa);l.appendChild(m);l.appendChild(q);l.appendChild(E);l.appendChild(oa);e.appendChild(g);e.appendChild(l);c.appendChild(d);c.appendChild(e);typeof EyeDropper==="undefined"&&(R.style.display="none");this.__xColorPickerRefs=
|
|
42
|
+
{"alpha-thumb":B,copy:aa,swatches:oa,"hue-strip":v,controls:E,"alpha-gradient":A,panel:l,preview:H,"area-thumb":p,"preview-color":G,container:e,area:m,"hue-thumb":x,"trigger-swatch":h,trigger:g,"alpha-strip":y,eyedropper:R,"hex-input":J};$APP.n(this.attachInternals)&&(this.__xColorPickerInternals=this.attachInternals())}yA(this);xA(this);return kA(this)};b.disconnectedCallback=function(){return yA(this)};b.attributeChangedCallback=function(){return kA(this)};b.formDisabledCallback=function(c){$APP.Eg(this,
|
|
43
|
+
"disabled",$APP.F(c));return kA(this)};b.formResetCallback=function(){this.setAttribute("value","#000000");return kA(this)};return a},DA=function(){return $APP.n(customElements.get("x-color-picker"))?null:customElements.define("x-color-picker",CA())},Wz=new $APP.K(null,"alpha","alpha",-1574982441),Zz=new $APP.K(null,"hex-full","hex-full",-1466644518),Vz=new $APP.K(null,"swatches","swatches",2033601707),Nz=new $APP.K(null,"v","v",21465059),Gz=new $APP.K(null,"s","s",1705939918),Bz=new $APP.K(null,
|
|
44
|
+
"r","r",-471384190),Xz=new $APP.K(null,"alpha?","alpha?",1329751525),Hz=new $APP.K(null,"l","l",1395893423),Fz=new $APP.K(null,"h","h",1109658740),Cz=new $APP.K(null,"b","b",1482224470),lA=new $APP.K(null,"sat","sat",1064662667),Dz=new $APP.K(null,"a","a",-2123407586),Yz=new $APP.K(null,"hex","hex",41691346);var Sz=new $APP.S(null,new $APP.Q(null,2,["inline",null,"popover",null],null),null),BA="value alpha swatches disabled readonly name mode open label".split(" ");
|
|
45
|
+
$APP.zf([$APP.Ol,$APP.Fj,$APP.qj,$APP.Pi,$APP.mj,Vz,$APP.Tl,$APP.U,Wz],[new $APP.Q(null,2,[$APP.Z,$APP.Sj,$APP.vk,"open"],null),new $APP.Q(null,2,[$APP.Z,$APP.Sj,$APP.vk,"disabled"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.vk,"name"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.vk,"value"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.vk,"mode"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,$APP.vk,"swatches"],null),new $APP.Q(null,2,[$APP.Z,$APP.Sj,$APP.vk,"readonly"],null),new $APP.Q(null,2,[$APP.Z,$APP.Y,
|
|
46
|
+
$APP.vk,"label"],null),new $APP.Q(null,2,[$APP.Z,$APP.Sj,$APP.vk,"alpha"],null)]);$APP.Qd(["x-color-picker-input",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,5,[$APP.Pi,$APP.Y,Fz,$APP.W,Gz,$APP.W,Hz,$APP.W,Dz,$APP.W],null),$APP.Rl,!1],null),"x-color-picker-change",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,5,[$APP.Pi,$APP.Y,Fz,$APP.W,Gz,$APP.W,Hz,$APP.W,Dz,$APP.W],null),$APP.Rl,!0],null)]);var zz=/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;var pA=new $APP.S(null,new $APP.Q(null,4,["ArrowUp",null,"ArrowDown",null,"ArrowRight",null,"ArrowLeft",null],null),null),rA=new $APP.S(null,new $APP.Q(null,4,["End",null,"ArrowRight",null,"ArrowLeft",null,"Home",null],null),null);$APP.ha("baredom.exports.x_color_picker.init",DA);export const init=DA;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var so=function(a,b){if(b==null||$APP.C.i(b,""))return a;var c=b.toLowerCase();return $APP.he(function(d){d=$APP.M(d);d=$APP.D(d,$APP.U);return $APP.N(-1,d.toLowerCase().indexOf(c))},a)},to=function(a,b){return b!=null?$APP.Ud(function(c){return $APP.C.i($APP.Pi.g(c),b)?c:null},a):null},xo=function(a,b){if(b!=null&&$APP.N(b,"")){var c=a.toLowerCase().indexOf(b.toLowerCase());if($APP.N(c,-1))return b=c+$APP.z(b),new $APP.Q(null,3,[uo,a.substring(0,c),vo,a.substring(c,b),wo,a.substring(b)],null)}return null},
|
|
3
|
+
yo=function(a){return document.createElement(a)},zo=function(a,b,c){return a.setAttribute(b,c)},Ao=function(a){var b=$APP.k(a,"__xComboboxRefs");$APP.n(b)&&(b=$APP.k(b,"slot").assignedElements({flatten:!0}),b=$APP.We.m($APP.fe,$APP.ph.i($APP.ce(function(c){return $APP.C.i("OPTION",c.tagName)}),$APP.ae.g(function(c){var d=c.getAttribute("value");return new $APP.Q(null,2,[$APP.Pi,$APP.n(d)?d:c.textContent,$APP.U,c.textContent],null)})),$APP.uc(b)),a.__xComboboxOptions=b)},Bo=function(a){var b=$APP.k(a,
|
|
4
|
+
"__xComboboxRefs");if($APP.n(b)){var c=$APP.k(b,"panel");b=$APP.k(b,"input");var d=function(){var B=$APP.k(a,"__xComboboxQuery");return $APP.n(B)?B:""}(),e=so($APP.k(a,"__xComboboxOptions"),d),g=function(){var B=$APP.k(a,"__xComboboxActiveIdx");return $APP.n(B)?B:0}();g=$APP.Hc(e)?-1:$APP.oh.i(g,$APP.z(e)-1);var h=function(){var B=a.getAttribute("value");return $APP.n(B)?B:""}();c.textContent="";if($APP.Hc(e))return d=yo("div"),d.setAttribute("part","empty-msg"),d.textContent="No matches",c.appendChild(d),
|
|
5
|
+
b.removeAttribute("aria-activedescendant");e=$APP.t($APP.Xd($APP.th,e));for(var l=null,m=0,p=0;;)if(p<m){var q=l.F(null,p),v=$APP.Ac(q,0,null),x=$APP.Ac(q,1,null);q=yo("div");var y=""+$APP.T.g("x-cb-opt-")+$APP.T.g(v),A=xo($APP.U.g(x),d);q.setAttribute("part","option");q.setAttribute("role","option");q.setAttribute("id",y);zo(q,"data-value",$APP.Pi.g(x));$APP.C.i($APP.Pi.g(x),h)&&q.setAttribute("aria-selected","true");$APP.C.i(v,g)&&q.setAttribute("data-active","");$APP.n(A)?(q.appendChild(document.createTextNode(uo.g(A))),
|
|
6
|
+
v=yo("b"),v.textContent=vo.g(A),q.appendChild(v),q.appendChild(document.createTextNode(wo.g(A)))):q.textContent=$APP.U.g(x);c.appendChild(q);p+=1}else if(e=$APP.t(e))$APP.Nc(e)?(m=$APP.yb(e),e=$APP.zb(e),l=m,m=$APP.z(m)):(m=$APP.u(e),l=$APP.Ac(m,0,null),v=$APP.Ac(m,1,null),m=yo("div"),q=""+$APP.T.g("x-cb-opt-")+$APP.T.g(l),p=xo($APP.U.g(v),d),m.setAttribute("part","option"),m.setAttribute("role","option"),m.setAttribute("id",q),zo(m,"data-value",$APP.Pi.g(v)),$APP.C.i($APP.Pi.g(v),h)&&m.setAttribute("aria-selected",
|
|
7
|
+
"true"),$APP.C.i(l,g)&&m.setAttribute("data-active",""),$APP.n(p)?(m.appendChild(document.createTextNode(uo.g(p))),l=yo("b"),l.textContent=vo.g(p),m.appendChild(l),m.appendChild(document.createTextNode(wo.g(p)))):m.textContent=$APP.U.g(v),c.appendChild(m),e=$APP.w(e),l=null,m=0),p=0;else break;return g>=0?zo(b,"aria-activedescendant",""+$APP.T.g("x-cb-opt-")+$APP.T.g(g)):b.removeAttribute("aria-activedescendant")}return null},Do=function(a){var b=$APP.k(a,"__xComboboxRefs");if($APP.n(b)){var c=new $APP.Q(null,
|
|
8
|
+
7,[$APP.jm,a.getAttribute("value"),$APP.Gi,a.getAttribute("placeholder"),$APP.gl,a.getAttribute("name"),$APP.ul,a.hasAttribute("disabled"),$APP.Ih,a.hasAttribute("required"),$APP.xi,a.hasAttribute("open"),$APP.Mm,a.getAttribute("placement")],null),d=$APP.M(c),e=$APP.D(d,$APP.jm),g=$APP.D(d,$APP.Gi),h=$APP.D(d,$APP.gl),l=$APP.D(d,$APP.ul),m=$APP.D(d,$APP.Ih);c=$APP.D(d,$APP.xi);d=$APP.D(d,$APP.Mm);e=$APP.n(e)?e:"";g=$APP.n(g)?g:"";h=$APP.n(h)?h:"";l=$APP.F(l);m=$APP.F(m);c=$APP.F(c);d=$APP.I(Co,d)?
|
|
9
|
+
d:"bottom-start";g=$APP.M(new $APP.Q(null,7,[$APP.Pi,e,$APP.Yl,g,$APP.qj,h,$APP.X,l,$APP.hi,m,$APP.sm,c,$APP.Gj,d],null));c=$APP.D(g,$APP.Pi);d=$APP.D(g,$APP.Yl);e=$APP.D(g,$APP.X);m=$APP.D(g,$APP.sm);g=$APP.D(g,$APP.Gj);l=$APP.k(b,"input");b=$APP.k(b,"panel");h=to($APP.k(a,"__xComboboxOptions"),c);l.placeholder=d;l.disabled=e;zo(l,"aria-expanded",""+$APP.T.g(m));b.setAttribute("data-placement",g);$APP.n(m)||(l.value=$APP.n(h)?$APP.U.g(h):"");return $APP.N(c,"")?a.setAttribute("data-has-value",""):
|
|
10
|
+
a.removeAttribute("data-has-value")}return null},Eo=function(a,b){b=new CustomEvent("x-combobox-toggle",{detail:b,bubbles:!0,composed:!0,cancelable:!0});a.dispatchEvent(b);return $APP.r(b.defaultPrevented)},Fo=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},Ho=function(a,b){return $APP.r(a.hasAttribute("disabled"))&&$APP.r(a.hasAttribute("open"))&&Eo(a,{open:!0,source:b})?(a.setAttribute("open",""),a.__xComboboxQuery="",a.__xComboboxActiveIdx=
|
|
11
|
+
0,b=$APP.k(a,"__xComboboxRefs"),$APP.n(b)&&$APP.k(b,"input").select(),Bo(a),Go.g?Go.g(a):Go.call(null,a)):null},Jo=function(a,b){return $APP.n(a.hasAttribute("open"))&&Eo(a,{open:!1,source:b})?(a.removeAttribute("open"),a.__xComboboxQuery="",a.__xComboboxActiveIdx=0,Io.g?Io.g(a):Io.call(null,a),Do(a)):null},Ko=function(a,b,c){a.setAttribute("value",b);var d=$APP.k(a,"__xComboboxRefs");$APP.n(d)&&($APP.k(d,"input").value=c);Jo(a,"select");return Fo(a,"x-combobox-change",{value:b,label:c})},Lo=function(a,
|
|
12
|
+
b){var c=so($APP.k(a,"__xComboboxOptions"),function(){var e=$APP.k(a,"__xComboboxQuery");return $APP.n(e)?e:""}());c=$APP.z(c);var d=function(){var e=$APP.k(a,"__xComboboxActiveIdx");return $APP.n(e)?e:0}();b=$APP.C.i(b,$APP.Mj)?c===0?-1:$APP.fd(($APP.n(d)?d:-1)+1,c):c===0?-1:$APP.fd(($APP.n(d)?d:c)-1,c);a.__xComboboxActiveIdx=b;Bo(a);b=$APP.k(a,"__xComboboxRefs");return $APP.n(b)?(b=$APP.k(b,"panel").querySelector("[data-active]"),$APP.n(b)?b.scrollIntoView({block:"nearest"}):null):null},Mo=function(a){var b=
|
|
13
|
+
so($APP.k(a,"__xComboboxOptions"),function(){var c=$APP.k(a,"__xComboboxQuery");return $APP.n(c)?c:""}());b=$APP.Ac(b,function(){var c=$APP.k(a,"__xComboboxActiveIdx");return $APP.n(c)?c:0}(),null);return $APP.n(b)?Ko(a,$APP.Pi.g(b),$APP.U.g(b)):null},No=function(a){return{slotchange:function(){Ao(a);return $APP.n(a.hasAttribute("open"))?Bo(a):null},inputFocus:function(){return Ho(a,"focus")},inputInput:function(b){b=b.target.value;a.__xComboboxQuery=b;a.__xComboboxActiveIdx=0;$APP.n(a.hasAttribute("open"))||
|
|
14
|
+
Ho(a,"input");Bo(a);return Fo(a,"x-combobox-input",{query:b})},panelClick:function(b){b=b.target;b=$APP.n(b.hasAttribute("data-value"))?b:b.closest("[data-value]");if($APP.n(b)){var c=b.getAttribute("data-value");return Ko(a,c,b.textContent)}return null},inputKeydown:function(b){var c=b.key;if($APP.C.i(c,"ArrowDown"))return b.preventDefault(),$APP.n(a.hasAttribute("open"))?Lo(a,$APP.Mj):Ho(a,"keyboard");if($APP.C.i(c,"ArrowUp"))return b.preventDefault(),$APP.n(a.hasAttribute("open"))?Lo(a,$APP.Dj):
|
|
15
|
+
Ho(a,"keyboard");if($APP.C.i(c,"Enter"))return b.preventDefault(),$APP.n(a.hasAttribute("open"))?Mo(a):null;if($APP.C.i(c,"Escape")){if($APP.n(a.hasAttribute("open")))return b.preventDefault(),Jo(a,"escape"),b=$APP.k(a,"__xComboboxRefs"),$APP.n(b)?$APP.k(b,"input").focus():null}else if($APP.C.i(c,"Home")){if($APP.n(a.hasAttribute("open")))return b.preventDefault(),a.__xComboboxActiveIdx=0,Bo(a)}else if($APP.C.i(c,"End")&&$APP.n(a.hasAttribute("open")))return b.preventDefault(),b=$APP.k(a,"__xComboboxQuery"),
|
|
16
|
+
b=$APP.z(so($APP.k(a,"__xComboboxOptions"),$APP.n(b)?b:"")),b=$APP.nh.i(0,b-1),a.__xComboboxActiveIdx=b,Bo(a);return null},docClick:function(b){return $APP.n(a.hasAttribute("open"))?(b=$APP.vc(b.composedPath()),b=$APP.Ud(function(c){return c===a},b),$APP.n(b)?null:Jo(a,"outside-click")):null},panelPointerdown:function(b){return b.preventDefault()},clearClick:function(){a.removeAttribute("value");a.removeAttribute("data-has-value");var b=$APP.k(a,"__xComboboxRefs");$APP.n(b)&&(b=$APP.k(b,"input"),
|
|
17
|
+
b.value="",b.focus());return Fo(a,"x-combobox-change",{value:"",label:""})},chevronPointerdown:function(b){b.preventDefault();if($APP.n(a.hasAttribute("open")))return Jo(a,"pointer");Ho(a,"pointer");b=$APP.k(a,"__xComboboxRefs");return $APP.n(b)?$APP.k(b,"input").focus():null},focusout:function(b){return $APP.n(a.hasAttribute("open"))?(b=b.relatedTarget,b==null||$APP.r(a.contains(b))?Jo(a,"focusout"):null):null}}},Oo=function(a){var b=$APP.k(a,"__xComboboxRefs");if($APP.n(b)){var c=$APP.k(a,"__xComboboxHandlers");
|
|
18
|
+
if($APP.n(c)){var d=$APP.k(b,"input"),e=$APP.k(b,"clear"),g=$APP.k(b,"chevron"),h=$APP.k(b,"panel");b=$APP.k(b,"slot");d.removeEventListener("focus",$APP.k(c,"inputFocus"));d.removeEventListener("input",$APP.k(c,"inputInput"));d.removeEventListener("keydown",$APP.k(c,"inputKeydown"));e.removeEventListener("click",$APP.k(c,"clearClick"));g.removeEventListener("pointerdown",$APP.k(c,"chevronPointerdown"));h.removeEventListener("pointerdown",$APP.k(c,"panelPointerdown"));h.removeEventListener("click",
|
|
19
|
+
$APP.k(c,"panelClick"));a.removeEventListener("focusout",$APP.k(c,"focusout"));b.removeEventListener("slotchange",$APP.k(c,"slotchange"))}}},Go=function(a){var b=$APP.k(a,"__xComboboxHandlers");return $APP.n(b)?setTimeout(function(){var c=a.isConnected;return $APP.n($APP.n(c)?a.hasAttribute("open"):c)?document.addEventListener("click",$APP.k(b,"docClick")):null},0):null},Io=function(a){a=$APP.k(a,"__xComboboxHandlers");return $APP.n(a)?document.removeEventListener("click",$APP.k(a,"docClick")):null},
|
|
20
|
+
Po=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.Eg(this,c,$APP.F(d))}})},Qo=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){return d!=null&&$APP.N(d)?this.setAttribute(c,""+$APP.T.g(d)):this.removeAttribute(c)}})},To=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,
|
|
21
|
+
"observedAttributes",{get:function(){return Ro}});Qo(b,"value","value");Qo(b,"placeholder","placeholder");Qo(b,"name","name");Qo(b,"placement","placement");Po(b,"disabled","disabled");Po(b,"required","required");Po(b,"open","open");b.show=function(){return Ho(this,"programmatic")};b.hide=function(){return Jo(this,"programmatic")};b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xComboboxRefs"))){var c=this.attachShadow({mode:"open"}),d=yo("style"),e=yo("div"),g=yo("input"),h=yo("button"),
|
|
22
|
+
l=yo("span"),m=yo("div"),p=yo("slot");var q=$APP.k(So,"n")+1;So.n=q;q="x-cb-lb-"+$APP.T.g(q);d.textContent=":host{display:inline-block;position:relative;color-scheme:light dark;--x-combobox-bg:var(--x-color-surface,#ffffff);--x-combobox-fg:var(--x-color-text,#0f172a);--x-combobox-placeholder:var(--x-color-text-muted,#94a3b8);--x-combobox-border:1px solid var(--x-color-border,#e2e8f0);--x-combobox-border-hover:1px solid var(--x-color-border,#cbd5e1);--x-combobox-border-focus:1px solid var(--x-color-focus-ring,#60a5fa);--x-combobox-radius:var(--x-radius-md,6px);--x-combobox-height:2.25rem;--x-combobox-font-size:var(--x-font-size-sm,0.9375rem);--x-combobox-padding:0 0.625rem;--x-combobox-focus-ring:var(--x-color-focus-ring,#60a5fa);--x-combobox-shadow:var(--x-shadow-sm,0 1px 2px rgba(0,0,0,0.05));--x-combobox-disabled-opacity:var(--x-opacity-disabled,0.55);--x-combobox-chevron-color:var(--x-color-text-muted,#64748b);--x-combobox-panel-bg:var(--x-color-bg,#ffffff);--x-combobox-panel-border:1px solid var(--x-color-border,#e2e8f0);--x-combobox-panel-radius:var(--x-radius-md,8px);--x-combobox-panel-shadow:var(--x-shadow-md,0 4px 16px rgba(0,0,0,0.12));--x-combobox-panel-max-height:16rem;--x-combobox-panel-offset:4px;--x-combobox-option-padding:0.5rem 0.625rem;--x-combobox-option-hover-bg:var(--x-color-surface-hover,#f1f5f9);--x-combobox-option-active-bg:var(--x-color-primary,#3b82f6);--x-combobox-option-active-fg:#ffffff;--x-combobox-transition-duration:var(--x-transition-duration,150ms);--x-combobox-transition-easing:var(--x-transition-easing,ease);}@media (prefers-color-scheme:dark){:host{--x-combobox-bg:var(--x-color-surface,#1e293b);--x-combobox-fg:var(--x-color-text,#e2e8f0);--x-combobox-placeholder:var(--x-color-text-muted,#64748b);--x-combobox-border:1px solid var(--x-color-border,#334155);--x-combobox-border-hover:1px solid var(--x-color-border,#475569);--x-combobox-border-focus:1px solid var(--x-color-focus-ring,#93c5fd);--x-combobox-focus-ring:var(--x-color-focus-ring,#93c5fd);--x-combobox-shadow:var(--x-shadow-sm,0 1px 2px rgba(0,0,0,0.2));--x-combobox-chevron-color:var(--x-color-text-muted,#94a3b8);--x-combobox-panel-bg:var(--x-color-bg,#1e293b);--x-combobox-panel-border:1px solid var(--x-color-border,#334155);--x-combobox-panel-shadow:var(--x-shadow-md,0 4px 24px rgba(0,0,0,0.4));--x-combobox-option-hover-bg:var(--x-color-surface-hover,#334155);--x-combobox-option-active-bg:var(--x-color-primary,#3b82f6);}}[part\x3dwrapper]{display:flex;align-items:center;height:var(--x-combobox-height);background:var(--x-combobox-bg);border:var(--x-combobox-border);border-radius:var(--x-combobox-radius);box-shadow:var(--x-combobox-shadow);padding:var(--x-combobox-padding);cursor:text;transition:border var(--x-combobox-transition-duration) var(--x-combobox-transition-easing),box-shadow var(--x-combobox-transition-duration) var(--x-combobox-transition-easing);}[part\x3dwrapper]:hover{border:var(--x-combobox-border-hover);}:host(:focus-within) [part\x3dwrapper]{border:var(--x-combobox-border-focus);box-shadow:0 0 0 2px var(--x-combobox-focus-ring);}:host([disabled]) [part\x3dwrapper]{opacity:var(--x-combobox-disabled-opacity);cursor:default;pointer-events:none;}[part\x3dinput]{all:unset;flex:1;min-width:0;height:100%;font-size:var(--x-combobox-font-size);font-family:inherit;color:var(--x-combobox-fg);}[part\x3dinput]::placeholder{color:var(--x-combobox-placeholder);}[part\x3dclear]{all:unset;display:none;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;font-size:0.875rem;color:var(--x-combobox-chevron-color);cursor:pointer;flex-shrink:0;border-radius:2px;}[part\x3dclear]:hover{color:var(--x-combobox-fg);}[part\x3dclear]:focus-visible{outline:none;box-shadow:0 0 0 2px var(--x-combobox-focus-ring);}:host([data-has-value]) [part\x3dclear]{display:inline-flex;}:host([disabled]) [part\x3dclear]{display:none;}[part\x3dchevron]{display:inline-flex;align-items:center;color:var(--x-combobox-chevron-color);flex-shrink:0;margin-left:0.25rem;transition:transform 200ms ease;pointer-events:none;}:host([open]) [part\x3dchevron]{transform:rotate(180deg);}[part\x3dpanel]{position:absolute;z-index:var(--x-z-dropdown,1000);box-sizing:border-box;width:100%;background:var(--x-combobox-panel-bg);border:var(--x-combobox-panel-border);border-radius:var(--x-combobox-panel-radius);box-shadow:var(--x-combobox-panel-shadow);padding:0.25rem 0;max-height:var(--x-combobox-panel-max-height);max-width:calc(100% - 0rem);overflow-y:auto;visibility:hidden;pointer-events:none;opacity:0;transform:scaleY(0.95);transition:opacity var(--x-combobox-transition-duration) var(--x-combobox-transition-easing),transform var(--x-combobox-transition-duration) var(--x-combobox-transition-easing),visibility 0s var(--x-combobox-transition-duration);}:host([open]) [part\x3dpanel]{visibility:visible;pointer-events:auto;opacity:1;transform:scaleY(1);transition:opacity var(--x-combobox-transition-duration) var(--x-combobox-transition-easing),transform var(--x-combobox-transition-duration) var(--x-combobox-transition-easing),visibility 0s 0s;}[part\x3dpanel][data-placement\x3dbottom-start]{top:calc(100% + var(--x-combobox-panel-offset));left:0;transform-origin:top left;}[part\x3dpanel][data-placement\x3dbottom-end]{top:calc(100% + var(--x-combobox-panel-offset));right:0;transform-origin:top right;}[part\x3dpanel][data-placement\x3dtop-start]{bottom:calc(100% + var(--x-combobox-panel-offset));left:0;transform-origin:bottom left;}[part\x3dpanel][data-placement\x3dtop-end]{bottom:calc(100% + var(--x-combobox-panel-offset));right:0;transform-origin:bottom right;}[part\x3doption]{padding:var(--x-combobox-option-padding);font-size:var(--x-combobox-font-size);font-family:inherit;color:var(--x-combobox-fg);cursor:default;border-radius:4px;margin:0 0.25rem;}[part\x3doption]:hover{background:var(--x-combobox-option-hover-bg);}[part\x3doption][data-active]{background:var(--x-combobox-option-active-bg);color:var(--x-combobox-option-active-fg);}[part\x3doption][data-active] b{color:inherit;}[part\x3doption] b{font-weight:700;}[part\x3dempty-msg]{padding:var(--x-combobox-option-padding);font-size:var(--x-combobox-font-size);color:var(--x-combobox-placeholder);font-style:italic;margin:0 0.25rem;}slot{display:none;}@media (prefers-reduced-motion:reduce){[part\x3dpanel]{transition:none !important;}[part\x3dwrapper]{transition:none !important;}[part\x3dchevron]{transition:none !important;}}@media (pointer:coarse){:host{--x-combobox-height:2.75rem;}[part\x3dclear]{width:2.75rem;height:2.75rem;}[part\x3doption]{min-height:2.75rem;display:flex;align-items:center;}}";
|
|
23
|
+
e.setAttribute("part","wrapper");g.setAttribute("part","input");g.setAttribute("type","text");g.setAttribute("role","combobox");g.setAttribute("aria-expanded","false");g.setAttribute("aria-autocomplete","list");g.setAttribute("aria-controls",q);g.setAttribute("autocomplete","off");h.setAttribute("part","clear");h.setAttribute("type","button");h.setAttribute("aria-label","Clear");h.setAttribute("tabindex","-1");h.textContent="×";l.setAttribute("part","chevron");l.setAttribute("aria-hidden","true");
|
|
24
|
+
l.innerHTML='\x3csvg width\x3d"12" height\x3d"12" viewBox\x3d"0 0 12 12" fill\x3d"none" xmlns\x3d"http://www.w3.org/2000/svg" aria-hidden\x3d"true"\x3e\x3cpath d\x3d"M2.5 4.5L6 8L9.5 4.5" stroke\x3d"currentColor" stroke-width\x3d"1.5" stroke-linecap\x3d"round" stroke-linejoin\x3d"round"/\x3e\x3c/svg\x3e';m.setAttribute("part","panel");m.setAttribute("role","listbox");m.setAttribute("id",q);m.setAttribute("data-placement","bottom-start");e.appendChild(g);e.appendChild(h);e.appendChild(l);c.appendChild(d);
|
|
25
|
+
c.appendChild(e);c.appendChild(m);c.appendChild(p);this.__xComboboxListboxId=q;this.__xComboboxOptions=$APP.fe;this.__xComboboxQuery="";this.__xComboboxActiveIdx=0;this.__xComboboxRefs={wrapper:e,input:g,clear:h,chevron:l,panel:m,slot:p}}Oo(this);Io(this);this.__xComboboxHandlers=No(this);l=$APP.k(this,"__xComboboxRefs");$APP.n(l)&&(c=$APP.k(this,"__xComboboxHandlers"),$APP.n(c)&&(d=$APP.k(l,"input"),e=$APP.k(l,"clear"),g=$APP.k(l,"chevron"),h=$APP.k(l,"panel"),l=$APP.k(l,"slot"),d.addEventListener("focus",
|
|
26
|
+
$APP.k(c,"inputFocus")),d.addEventListener("input",$APP.k(c,"inputInput")),d.addEventListener("keydown",$APP.k(c,"inputKeydown")),e.addEventListener("click",$APP.k(c,"clearClick")),g.addEventListener("pointerdown",$APP.k(c,"chevronPointerdown")),h.addEventListener("pointerdown",$APP.k(c,"panelPointerdown")),h.addEventListener("click",$APP.k(c,"panelClick")),this.addEventListener("focusout",$APP.k(c,"focusout")),l.addEventListener("slotchange",$APP.k(c,"slotchange"))));Ao(this);return Do(this)};b.disconnectedCallback=
|
|
27
|
+
function(){Oo(this);return Io(this)};b.attributeChangedCallback=function(c){$APP.n($APP.k(this,"__xComboboxRefs"))?(Do(this),c=$APP.C.i(c,"open")?$APP.n(this.hasAttribute("open"))?Go(this):Io(this):null):c=null;return c};return a},Uo=function(){return $APP.n(customElements.get("x-combobox"))?null:customElements.define("x-combobox",To())},vo=new $APP.K(null,"match","match",1220059550),wo=new $APP.K(null,"after","after",594996914),uo=new $APP.K(null,"before","before",-1633692388);var Co=new $APP.S(null,new $APP.Q(null,4,["bottom-start",null,"bottom-end",null,"top-end",null,"top-start",null],null),null),Ro="value placeholder name disabled required open placement".split(" ");
|
|
28
|
+
$APP.Qd(["x-combobox-change",new $APP.Q(null,2,[$APP.Rl,!1,$APP.V,new $APP.Q(null,2,[$APP.Pi,$APP.Y,$APP.U,$APP.Y],null)],null),"x-combobox-input",new $APP.Q(null,2,[$APP.Rl,!1,$APP.V,new $APP.Q(null,1,[$APP.zi,$APP.Y],null)],null),"x-combobox-toggle",new $APP.Q(null,2,[$APP.Rl,!0,$APP.V,new $APP.Q(null,2,[$APP.Ol,$APP.Sj,$APP.$k,$APP.Y],null)],null)]);var So={n:0};$APP.ha("baredom.exports.x_combobox.init",Uo);export const init=Uo;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
b=$APP.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
""
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
var nu=function(a){return a==null?!0:$APP.N(a,"false")},ou=function(a){return typeof a==="string"?(a=a.trim(),$APP.N(a,"")?a:null):null},ru=function(a){if(a==null||$APP.r($APP.ma(a)))return $APP.fe;for(var b=a.length,c=0,d=$APP.rb($APP.fe);;){if($APP.C.i(c,b))return $APP.tb(d);var e=a[c],g=""+$APP.T.g(function(){var A=e.id;return $APP.n(A)?A:c}()),h=""+$APP.T.g(function(){var A=e.label;return $APP.n(A)?A:""}()),l=ou(e.group),m=e.value,p=e.icon,q=$APP.C.i(!0,e.disabled),v=e.keywords;v=$APP.n($APP.ma(v))?
|
|
3
|
+
v.join(" "):typeof v==="string"?v:"";var x=function(){var A=l;return $APP.n(A)?A:""}(),y=typeof m==="string"?m:"";x=(""+$APP.T.g(h)+" "+$APP.T.g(v)+" "+$APP.T.g(x)+" "+$APP.T.g(y)).toLowerCase();v=c+1;d=$APP.Cd(d,new $APP.Q(null,7,[$APP.fl,g,$APP.U,h,pu,l,$APP.Pi,m,$APP.Dk,p,$APP.X,q,qu,x],null));c=v}},tu=function(a,b){b=typeof b==="string"?b.trim():"";var c=$APP.N(b,"")?$APP.Yd(ou,$APP.Hg(b,/\s+/)):null;if($APP.Hc(c))return new $APP.Q(null,2,[$APP.sl,a,su,$APP.We.i($APP.Tf,$APP.Yd(pu,a))],null);
|
|
4
|
+
a=$APP.he(function(d){return $APP.Td(function(e){return $APP.N(-1,qu.g(d).indexOf(e.toLowerCase()))},c)},a);return new $APP.Q(null,2,[$APP.sl,a,su,$APP.We.i($APP.Tf,$APP.Yd(pu,a))],null)},uu=function(a,b,c){var d=$APP.z(a);if(d>0)for(var e=1;;)if(e<=d){var g=$APP.fd(b+e*c,d),h=$APP.Ac(a,g,null),l=h;h=$APP.n(l)?$APP.r($APP.X.g(h)):l;if($APP.n(h))return g;e+=1}else return null;else return null},Vu=function(a){var b=$APP.M(a);a=$APP.D(b,$APP.xi);var c=$APP.D(b,$APP.Gi),d=$APP.D(b,$APP.ki),e=$APP.D(b,
|
|
5
|
+
vu),g=$APP.D(b,wu),h=$APP.D(b,Lu),l=$APP.D(b,Mu),m=$APP.D(b,Nu),p=$APP.D(b,Ou);b=$APP.D(b,Pu);b=nu(b);p=nu(p);m=$APP.Ig(m);m=b&&!m;g=g!=null?$APP.Ig(g):m;l=nu(l);return $APP.zf([$APP.Yl,$APP.Fi,Qu,Ru,Su,Tu,$APP.U,$APP.sm,Uu,$APP.X],[function(){var q=ou(c);return $APP.n(q)?q:"Search…"}(),p,function(){var q=ou(e);return $APP.n(q)?q:"No results"}(),g,l,m,ou(d),$APP.F(a),b,$APP.Ig(h)])},Wu=function(a){return document.createElement(a)},Xu=function(a){return Vu($APP.zf([$APP.ki,vu,wu,Lu,Mu,Nu,Ou,Pu,$APP.xi,
|
|
6
|
+
$APP.Gi],[a.getAttribute("label"),a.getAttribute("empty-text"),a.getAttribute("close-on-scrim"),a.getAttribute("disabled"),a.getAttribute("close-on-escape"),a.getAttribute("no-scrim"),a.getAttribute("dismissible"),a.getAttribute("modal"),a.hasAttribute("open"),a.getAttribute("placeholder")]))},Yu=function(a,b,c,d){b=new CustomEvent(b,{detail:d,bubbles:!0,composed:!0,cancelable:$APP.F(c)});a.dispatchEvent(b);return b},Zu=function(a){var b=$APP.k(a,"__xCommandPaletteRefs");if($APP.n(b)){var c=$APP.k(b,
|
|
7
|
+
"list"),d=$APP.k(b,"empty");b=$APP.k(b,"input");var e=function(){var q=$APP.k(a,"__xCommandPaletteQuery");return $APP.n(q)?q:""}(),g=ru($APP.k(a,"__xCommandPaletteItems"));e=tu(g,e);e=$APP.M(e);g=$APP.D(e,$APP.sl);e=function(){var q=$APP.k(a,"__xCommandPaletteActiveIdx");return $APP.n(q)?q:0}();c.textContent="";if($APP.Hc(g))return d.removeAttribute("hidden"),$APP.n(b)?b.removeAttribute("aria-activedescendant"):null;d.setAttribute("hidden","");d=$APP.Xd($APP.th,g);for(var h=null;;)if(g=$APP.u(d),
|
|
8
|
+
$APP.n(g)){var l=g;g=$APP.Ac(l,0,null);l=$APP.Ac(l,1,null);var m=pu.g(l);if($APP.n(function(){var q=m;return $APP.n(q)?$APP.N(m,h):q}())){var p=Wu("div");p.setAttribute("part","group-header");p.setAttribute("aria-hidden","true");p.textContent=m;c.appendChild(p)}p=Wu("div");p.setAttribute("part","item");p.setAttribute("role","option");p.setAttribute("id","x-cp-item-"+$APP.T.g(g));p.setAttribute("data-id",""+$APP.T.g($APP.fl.g(l)));p.setAttribute("data-idx",""+$APP.T.g(g));p.setAttribute("tabindex",
|
|
9
|
+
"-1");$APP.n($APP.X.g(l))&&p.setAttribute("aria-disabled","true");p.textContent=$APP.U.g(l);$APP.C.i(g,e)&&p.setAttribute("aria-selected","true");c.appendChild(p);d=$APP.Zb(d);h=g=function(){var q=m;return $APP.n(q)?q:h}()}else break;return $APP.n(b)?b.setAttribute("aria-activedescendant","x-cp-item-"+$APP.T.g(e)):null}return null},$u=function(a){var b=$APP.k(a,"__xCommandPaletteRefs");if($APP.n(b)){var c=Xu(a),d=$APP.k(b,"panel"),e=$APP.k(b,"input"),g=$APP.k(b,"overlay");b=$APP.k(b,"empty");var h=
|
|
10
|
+
$APP.U.g(c),l=$APP.Yl.g(c),m=Qu.g(c);$APP.n(h)?d.setAttribute("aria-label",h):d.setAttribute("aria-label","Command palette");$APP.n(Tu.g(c))?g.removeAttribute("hidden"):g.setAttribute("hidden","");e.setAttribute("placeholder",l);e.setAttribute("aria-expanded",$APP.n($APP.sm.g(c))?"true":"false");$APP.n($APP.X.g(c))&&(e.setAttribute("disabled",""),e.setAttribute("aria-disabled","true"));$APP.n($APP.X.g(c))||(e.removeAttribute("disabled"),e.removeAttribute("aria-disabled"));b.textContent=m;return Zu(a)}return null},
|
|
11
|
+
av=function(a){if($APP.n(a.hasAttribute("open")))return null;var b=Yu(a,"x-command-palette-open-request",!0,{});$APP.n(b.defaultPrevented)?a=null:(a.setAttribute("open",""),b=$APP.k(a,"__xCommandPaletteRefs"),b=$APP.n(b)?$APP.k(b,"input"):null,$APP.n(b)&&b.focus(),$u(a),a=Yu(a,"x-command-palette-open",!1,{}));return a},bv=function(a){if($APP.n(a.hasAttribute("open"))){var b=Yu(a,"x-command-palette-close-request",!0,{});$APP.n(b.defaultPrevented)?a=null:(a.removeAttribute("open"),b=$APP.k(a,"__xCommandPaletteRefs"),
|
|
12
|
+
b=$APP.n(b)?$APP.k(b,"input"):null,$APP.n(b)&&b.removeAttribute("aria-activedescendant"),$u(a),a=Yu(a,"x-command-palette-close",!1,{}));return a}return null},cv=function(a){var b=$APP.k(a,"__xCommandPaletteQuery");b=$APP.n(b)?b:"";a=ru($APP.k(a,"__xCommandPaletteItems"));a=tu(a,b);a=$APP.M(a);return $APP.D(a,$APP.sl)},ev=function(a,b){var c=cv(a);var d=$APP.k(a,"__xCommandPaletteActiveIdx");d=$APP.n(d)?d:0;$APP.C.i(b,dv)?(c=uu(c,$APP.n(d)?d:-1,1),c=$APP.n(c)?c:0):(b=$APP.z(c),c=uu(c,$APP.n(d)?d:b,
|
|
13
|
+
-1),c=$APP.n(c)?c:0);a.__xCommandPaletteActiveIdx=c;Zu(a);a=$APP.k(a,"__xCommandPaletteRefs");a=$APP.n(a)?$APP.k(a,"list"):null;a=$APP.n(a)?a.querySelector("[data-idx\x3d'"+$APP.T.g(c)+"']"):null;return $APP.n(a)?a.scrollIntoView({block:"nearest"}):null},gv=function(a,b){var c=b.key;return $APP.C.i(c,"ArrowDown")?(b.preventDefault(),ev(a,dv)):$APP.C.i(c,"ArrowUp")?(b.preventDefault(),ev(a,fv)):$APP.C.i(c,"Enter")?(b.preventDefault(),b=cv(a),c=$APP.k(a,"__xCommandPaletteActiveIdx"),b=$APP.Ac(b,$APP.n(c)?
|
|
14
|
+
c:0,null),$APP.n($APP.n(b)?$APP.r($APP.X.g(b)):b)?(c=Yu(a,"x-command-palette-select-request",!0,{item:$APP.Dh(b)}),$APP.n(c.defaultPrevented)?a=null:(Yu(a,"x-command-palette-select",!1,{item:$APP.Dh(b)}),a=bv(a))):a=null,a):$APP.C.i(c,"Escape")?(b=Xu(a),$APP.n(Su.g(b))?bv(a):null):null},hv=function(a){function b(){var q=$APP.k(a,"__xCommandPaletteRefs"),v=$APP.n(q)?$APP.k(q,"input"):null;q=$APP.n(q)?$APP.k(q,"clear-btn"):null;$APP.n(v)&&(v.value="");$APP.n(q)&&q.setAttribute("hidden","");a.__xCommandPaletteQuery=
|
|
15
|
+
"";a.__xCommandPaletteActiveIdx=0;Yu(a,"x-command-palette-query-change",!1,{query:""});Zu(a);return $APP.n(v)?v.focus():null}function c(q){a:{q=q.target.closest("[part\x3ditem]");if($APP.n(q)){q=parseInt(q.getAttribute("data-idx"),10);var v=cv(a);q=$APP.Ac(v,q,null);if($APP.n($APP.n(q)?$APP.r($APP.X.g(q)):q)){v=Yu(a,"x-command-palette-select-request",!0,{item:$APP.Dh(q)});if($APP.n(v.defaultPrevented)){q=null;break a}Yu(a,"x-command-palette-select",!1,{item:$APP.Dh(q)});q=bv(a);break a}}q=null}return q}
|
|
16
|
+
function d(){var q=Xu(a);return $APP.n(Ru.g(q))?bv(a):null}function e(q){return gv(a,q)}function g(){var q=$APP.k(a,"__xCommandPaletteRefs"),v=$APP.n(q)?$APP.k(q,"input"):null;q=$APP.n(q)?$APP.k(q,"clear-btn"):null;v=$APP.n(v)?v.value:null;a.__xCommandPaletteQuery=$APP.n(v)?v:"";a.__xCommandPaletteActiveIdx=0;$APP.n(q)&&($APP.n($APP.n(v)?$APP.N(v,""):v)?q.removeAttribute("hidden"):q.setAttribute("hidden",""));Yu(a,"x-command-palette-query-change",!1,{query:$APP.n(v)?v:""});return Zu(a)}var h=$APP.k(a,
|
|
17
|
+
"__xCommandPaletteRefs"),l=$APP.k(h,"input"),m=$APP.k(h,"overlay"),p=$APP.k(h,"list");h=$APP.k(h,"clear-btn");l.addEventListener("input",g);l.addEventListener("keydown",e);m.addEventListener("click",d);p.addEventListener("click",c);h.addEventListener("click",b);$APP.ja(a,"__xCommandPaletteHandlers",{input:g,keydown:e,scrim:d,list:c,clear:b})},iv=function(a){var b=$APP.k(a,"__xCommandPaletteRefs");a=$APP.k(a,"__xCommandPaletteHandlers");if($APP.n($APP.n(b)?a:b)){var c=$APP.k(b,"input"),d=$APP.k(b,
|
|
18
|
+
"overlay"),e=$APP.k(b,"list");b=$APP.k(b,"clear-btn");c.removeEventListener("input",$APP.k(a,"input"));c.removeEventListener("keydown",$APP.k(a,"keydown"));d.removeEventListener("click",$APP.k(a,"scrim"));e.removeEventListener("click",$APP.k(a,"list"));return b.removeEventListener("click",$APP.k(a,"clear"))}return null},jv=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.n(d)?this.setAttribute(c,""):this.removeAttribute(c)}})},
|
|
19
|
+
kv=function(a){Object.defineProperty(a,"items",{configurable:!0,enumerable:!0,get:function(){var b=$APP.k(this,"__xCommandPaletteItems");return $APP.n(b)?b:[]},set:function(b){this.__xCommandPaletteItems=b;this.__xCommandPaletteActiveIdx=0;return Zu(this)}})},lv=function(a){Object.defineProperty(a,"open",{configurable:!0,writable:!0,value:function(){return av(this)}});Object.defineProperty(a,"close",{configurable:!0,writable:!0,value:function(){return bv(this)}});Object.defineProperty(a,"toggle",
|
|
20
|
+
{configurable:!0,writable:!0,value:function(){return $APP.n(this.hasAttribute("open"))?bv(this):av(this)}})},nv=function(){var a=class extends HTMLElement{};a.observedAttributes=mv;var b=a.prototype;jv(b,"open","open");jv(b,"disabled","disabled");kv(b);lv(b);b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xCommandPaletteRefs"))){var c=this.attachShadow({mode:"open"}),d=Wu("style"),e=Wu("div"),g=Wu("div"),h=Wu("div"),l=Wu("span"),m=Wu("input"),p=Wu("button"),q=Wu("div"),v=Wu("div"),x=Wu("div");
|
|
21
|
+
d.textContent=":host{display:contents;}[part\x3doverlay]{display:none;position:fixed;inset:0;background:var(--x-command-palette-backdrop,rgba(0,0,0,0.45));z-index:var(--x-command-palette-z,800);}[part\x3dpanel]{display:none;position:fixed;top:20vh;left:50%;transform:translateX(-50%);width:var(--x-command-palette-width,560px);max-width:calc(100vw - 2rem);max-height:60dvh;z-index:calc(var(--x-command-palette-z,800) + 1);flex-direction:column;border-radius:var(--x-command-palette-radius,var(--x-radius-lg,12px));background:var(--x-command-palette-bg,var(--x-color-bg,#fff));box-shadow:var(--x-command-palette-shadow,var(--x-shadow-lg,0 20px 60px rgba(0,0,0,0.25),0 4px 16px rgba(0,0,0,0.12)));overflow:hidden;}:host([open]) [part\x3doverlay]{display:block;}:host([open]) [part\x3dpanel]{display:flex;}[part\x3dsearch-wrap]{display:flex;align-items:center;gap:8px;padding:12px 16px;border-bottom:1px solid var(--x-command-palette-divider,rgba(0,0,0,0.08));}[part\x3dsearch-icon]{flex:none;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;color:var(--x-command-palette-icon-color,var(--x-color-text-muted,#64748b));}[part\x3dinput]{flex:1;border:none;outline:none;background:transparent;font-size:1rem;line-height:1.5;color:var(--x-command-palette-text,inherit);}[part\x3dinput]::placeholder{color:var(--x-command-palette-placeholder,var(--x-color-text-muted,#94a3b8));}[part\x3dclear-btn]{all:unset;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;color:var(--x-command-palette-icon-color,var(--x-color-text-muted,#64748b));}[part\x3dclear-btn]:focus-visible{outline:2px solid var(--x-command-palette-focus-ring,var(--x-color-focus-ring,#60a5fa));}[part\x3dclear-btn][hidden]{display:none;}[part\x3dlist-wrap]{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:8px 0;}[part\x3dlist]{display:flex;flex-direction:column;}[part\x3ditem]{padding:10px 16px;cursor:default;font-size:var(--x-font-size-sm,0.9375rem);line-height:1.4;color:var(--x-command-palette-item-text,inherit);border-radius:0;outline:none;}[part\x3ditem]:hover,[part\x3ditem]:focus{background:var(--x-command-palette-item-hover,var(--x-color-surface-active,#f1f5f9));}[part\x3ditem][aria-selected\x3dtrue]{background:var(--x-command-palette-item-active,#e0e7ff);color:var(--x-command-palette-item-active-text,#3730a3);}[part\x3ditem][aria-disabled\x3dtrue]{opacity:0.45;cursor:default;pointer-events:none;}[part\x3dgroup-header]{padding:8px 16px 4px;font-size:0.75rem;font-weight:600;letter-spacing:0.05em;text-transform:uppercase;color:var(--x-command-palette-group-text,var(--x-color-text-muted,#94a3b8));}[part\x3dempty]{padding:32px 16px;text-align:center;color:var(--x-command-palette-empty-text,var(--x-color-text-muted,#94a3b8));font-size:0.9375rem;}[part\x3dempty][hidden]{display:none;}@media (prefers-color-scheme:dark){[part\x3dpanel]{background:var(--x-command-palette-bg,var(--x-color-bg,#1e293b));box-shadow:var(--x-command-palette-shadow,var(--x-shadow-lg,0 20px 60px rgba(0,0,0,0.6),0 4px 16px rgba(0,0,0,0.4)));}[part\x3dsearch-wrap]{border-bottom-color:var(--x-command-palette-divider,rgba(255,255,255,0.08));}[part\x3ditem]:hover,[part\x3ditem]:focus{background:var(--x-command-palette-item-hover,var(--x-color-text-muted,#334155));}[part\x3ditem][aria-selected\x3dtrue]{background:var(--x-command-palette-item-active,#312e81);color:var(--x-command-palette-item-active-text,#c7d2fe);}}@media (prefers-reduced-motion:reduce){[part\x3dpanel],[part\x3doverlay]{transition:none;}}";
|
|
22
22
|
e.setAttribute("part","overlay");g.setAttribute("part","panel");g.setAttribute("role","dialog");g.setAttribute("aria-modal","true");h.setAttribute("part","search-wrap");l.setAttribute("part","search-icon");l.setAttribute("aria-hidden","true");l.textContent="\ud83d\udd0d";m.setAttribute("part","input");m.setAttribute("type","search");m.setAttribute("role","combobox");m.setAttribute("autocomplete","off");m.setAttribute("autocorrect","off");m.setAttribute("spellcheck","false");m.setAttribute("aria-autocomplete",
|
|
23
23
|
"list");m.setAttribute("aria-expanded","false");m.setAttribute("aria-controls","x-cp-list");p.setAttribute("part","clear-btn");p.setAttribute("type","button");p.setAttribute("aria-label","Clear");p.setAttribute("hidden","");q.setAttribute("part","list-wrap");v.setAttribute("part","list");v.setAttribute("id","x-cp-list");v.setAttribute("role","listbox");v.setAttribute("aria-label","Results");x.setAttribute("part","empty");x.setAttribute("hidden","");h.appendChild(l);h.appendChild(m);h.appendChild(p);
|
|
24
|
-
q.appendChild(v);q.appendChild(x);g.appendChild(h);g.appendChild(q);c.appendChild(d);c.appendChild(e);c.appendChild(g);this.__xCommandPaletteRefs={overlay:e,panel:g,input:m,"clear-btn":p,list:v,empty:x}}
|
|
25
|
-
"empty-text",1554384594),
|
|
26
|
-
"scrim?",744210580),
|
|
27
|
-
$APP.
|
|
28
|
-
|
|
24
|
+
q.appendChild(v);q.appendChild(x);g.appendChild(h);g.appendChild(q);c.appendChild(d);c.appendChild(e);c.appendChild(g);this.__xCommandPaletteRefs={overlay:e,panel:g,input:m,"clear-btn":p,list:v,empty:x}}iv(this);hv(this);return $u(this)};b.disconnectedCallback=function(){return iv(this)};b.attributeChangedCallback=function(){return $u(this)};return a},ov=function(){return $APP.n(customElements.get("x-command-palette"))?null:customElements.define("x-command-palette",nv())},Qu=new $APP.K(null,"empty-text",
|
|
25
|
+
"empty-text",1554384594),wu=new $APP.K(null,"close-on-scrim-raw","close-on-scrim-raw",159828234),vu=new $APP.K(null,"empty-text-raw","empty-text-raw",1477406757),Ou=new $APP.K(null,"dismissible-raw","dismissible-raw",947680658),Pu=new $APP.K(null,"modal-raw","modal-raw",-263722282),Su=new $APP.K(null,"close-on-escape?","close-on-escape?",-1559868909),su=new $APP.K(null,"groups","groups",-136896102),Mu=new $APP.K(null,"close-on-escape-raw","close-on-escape-raw",-1942646255),Tu=new $APP.K(null,"scrim?",
|
|
26
|
+
"scrim?",744210580),Nu=new $APP.K(null,"no-scrim-raw","no-scrim-raw",-1344365743),Ru=new $APP.K(null,"close-on-scrim?","close-on-scrim?",-367113965),pv=new $APP.Sb(null,"object","object",-1179821820,null),pu=new $APP.K(null,"group","group",582596132),dv=new $APP.K(null,"down","down",1565245570),qu=new $APP.K(null,"search-str","search-str",-821246171),fv=new $APP.K(null,"up","up",-269712113),Uu=new $APP.K(null,"modal?","modal?",2146094679),Lu=new $APP.K(null,"disabled-raw","disabled-raw",498098381);var mv="open modal dismissible disabled no-scrim close-on-scrim close-on-escape label placeholder empty-text".split(" ");
|
|
27
|
+
$APP.Qd(["x-command-palette-open-request",new $APP.Q(null,2,[$APP.Rl,!0,$APP.V,$APP.Rd],null),"x-command-palette-open",new $APP.Q(null,2,[$APP.Rl,!1,$APP.V,$APP.Rd],null),"x-command-palette-close-request",new $APP.Q(null,2,[$APP.Rl,!0,$APP.V,$APP.Rd],null),"x-command-palette-close",new $APP.Q(null,2,[$APP.Rl,!1,$APP.V,$APP.Rd],null),"x-command-palette-select-request",new $APP.Q(null,2,[$APP.Rl,!0,$APP.V,new $APP.Q(null,1,[$APP.ik,pv],null)],null),"x-command-palette-select",new $APP.Q(null,2,[$APP.Rl,
|
|
28
|
+
!1,$APP.V,new $APP.Q(null,1,[$APP.ik,pv],null)],null),"x-command-palette-query-change",new $APP.Q(null,2,[$APP.Rl,!1,$APP.V,new $APP.Q(null,1,[$APP.zi,$APP.Y],null)],null)]);$APP.ha("baredom.exports.x_command_palette.init",ov);export const init=ov;
|
package/dist/x-container.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
this.setAttribute("center","false")}})},
|
|
4
|
-
$APP.U,$APP.
|
|
5
|
-
|
|
6
|
-
d.setAttribute("part","base");d.appendChild(e);b.appendChild(c);b.appendChild(d);this.__xContainerState={root:b,base:d,slot:e}}return
|
|
7
|
-
|
|
2
|
+
var IL=function(a,b,c){return typeof a==="string"&&$APP.I(b,a)?a:c},JL=function(a){return a.__xContainerState},KL=function(a){Object.defineProperty(a,"fluid",{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute("fluid")},set:function(b){return $APP.Eg(this,"fluid",$APP.F(b))}})},LL=function(a){Object.defineProperty(a,"center",{configurable:!0,enumerable:!0,get:function(){return $APP.N("false",this.getAttribute("center"))},set:function(b){return $APP.F(b)?this.removeAttribute("center"):
|
|
3
|
+
this.setAttribute("center","false")}})},SL=function(a,b){a=new $APP.Q(null,6,[ML,a.getAttribute("as"),$APP.Hh,a.getAttribute("size"),$APP.rm,a.getAttribute("padding"),NL,$APP.N("false",a.getAttribute("center")),OL,a.hasAttribute("fluid"),$APP.U,a.getAttribute("label")],null);var c=$APP.M(a);a=$APP.D(c,ML);var d=$APP.D(c,$APP.Hh),e=$APP.D(c,$APP.rm),g=$APP.D(c,NL),h=$APP.D(c,OL);c=$APP.D(c,$APP.U);a=new $APP.Q(null,6,[ML,IL(a,PL,"div"),$APP.Hh,IL(d,QL,"lg"),$APP.rm,IL(e,RL,"md"),NL,$APP.F(g),OL,$APP.F(h),
|
|
4
|
+
$APP.U,$APP.Jg(c)?c:null],null);h=ML.g(a);d=b.base;$APP.N(d.tagName.toLowerCase(),h)&&(e=b.root,g=b.slot,h=document.createElement(h),h.setAttribute("part","base"),h.appendChild(g),e.replaceChild(h,d),b.base=h);b=b.base;b.setAttribute("data-size",$APP.Hh.g(a));b.setAttribute("data-padding",$APP.rm.g(a));b.setAttribute("data-center",$APP.n(NL.g(a))?"true":"false");b.setAttribute("data-fluid",$APP.n(OL.g(a))?"true":"false");a=$APP.U.g(a);return $APP.n(a)?b.setAttribute("aria-label",a):b.removeAttribute("aria-label")},
|
|
5
|
+
UL=function(){var a=class extends HTMLElement{};a.observedAttributes=TL;a.prototype.connectedCallback=function(){if(!$APP.n(JL(this))){var b=this.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("slot");c.textContent="\n :host{\n display:block;\n color-scheme:light dark;\n\n --x-container-max-width-xs:480px;\n --x-container-max-width-sm:640px;\n --x-container-max-width-md:768px;\n --x-container-max-width-lg:1024px;\n --x-container-max-width-xl:1280px;\n\n --x-container-padding-sm:0.5rem;\n --x-container-padding-md:1rem;\n --x-container-padding-lg:1.5rem;\n\n --x-container-padding-block:0;\n --x-container-margin-inline:auto;\n\n --x-container-bg:transparent;\n --x-container-color:var(--x-color-text, #0f172a);\n --x-container-border:transparent;\n --x-container-radius:0;\n --x-container-shadow:none;\n }\n\n @media (prefers-color-scheme: dark){\n :host{\n --x-container-bg:transparent;\n --x-container-color:var(--x-color-text, #e5e7eb);\n --x-container-border:transparent;\n --x-container-radius:0;\n --x-container-shadow:none;\n }\n }\n\n [part\x3d'base']{\n display:block;\n box-sizing:border-box;\n width:100%;\n max-width:var(--x-container-max-width-lg);\n padding-inline:var(--x-container-padding-md);\n padding-block:var(--x-container-padding-block);\n margin-inline:0;\n background:var(--x-container-bg);\n color:var(--x-container-color);\n border:1px solid var(--x-container-border);\n border-radius:var(--x-container-radius);\n box-shadow:var(--x-container-shadow);\n }\n\n [part\x3d'base'][data-size\x3d'xs']{max-width:var(--x-container-max-width-xs);}\n [part\x3d'base'][data-size\x3d'sm']{max-width:var(--x-container-max-width-sm);}\n [part\x3d'base'][data-size\x3d'md']{max-width:var(--x-container-max-width-md);}\n [part\x3d'base'][data-size\x3d'lg']{max-width:var(--x-container-max-width-lg);}\n [part\x3d'base'][data-size\x3d'xl']{max-width:var(--x-container-max-width-xl);}\n [part\x3d'base'][data-size\x3d'full']{max-width:none;width:100%;}\n\n [part\x3d'base'][data-padding\x3d'none']{padding-inline:0;}\n [part\x3d'base'][data-padding\x3d'sm']{padding-inline:var(--x-container-padding-sm);}\n [part\x3d'base'][data-padding\x3d'md']{padding-inline:var(--x-container-padding-md);}\n [part\x3d'base'][data-padding\x3d'lg']{padding-inline:var(--x-container-padding-lg);}\n\n [part\x3d'base'][data-center\x3d'true']{\n margin-inline:var(--x-container-margin-inline);\n }\n\n [part\x3d'base'][data-center\x3d'false']{\n margin-inline:0;\n }\n\n [part\x3d'base'][data-fluid\x3d'true']{\n max-width:none;\n width:100%;\n }\n\n ";
|
|
6
|
+
d.setAttribute("part","base");d.appendChild(e);b.appendChild(c);b.appendChild(d);this.__xContainerState={root:b,base:d,slot:e}}return SL(this,JL(this))};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(){var b=JL(this);return $APP.n(b)?SL(this,b):null};LL(a.prototype);KL(a.prototype);return a},VL=function(){$APP.n(customElements.get("x-container"))||customElements.define("x-container",UL());return null},OL=new $APP.K(null,"fluid","fluid",-1823657759),
|
|
7
|
+
ML=new $APP.K(null,"as","as",1148689641),NL=new $APP.K(null,"center","center",-748944368);var PL=new $APP.S(null,new $APP.Q(null,8,["article",null,"footer",null,"section",null,"main",null,"nav",null,"div",null,"aside",null,"header",null],null),null),QL=new $APP.S(null,new $APP.Q(null,6,["xs",null,"md",null,"lg",null,"full",null,"xl",null,"sm",null],null),null),RL=new $APP.S(null,new $APP.Q(null,4,["none",null,"md",null,"lg",null,"sm",null],null),null),TL="as size padding center fluid label".split(" ");$APP.ha("baredom.exports.x_container.init",VL);export const init=VL;
|