@vanelsas/baredom 2.4.1 → 2.5.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 +11 -0
- package/README.md +83 -5
- package/custom-elements.json +7338 -0
- package/dist/baredom.d.ts +97 -0
- package/dist/base.js +53 -53
- package/dist/integrity.json +87 -87
- package/dist/x-alert.d.ts +43 -0
- package/dist/x-alert.js +16 -16
- package/dist/x-avatar-group.d.ts +18 -0
- package/dist/x-avatar-group.js +10 -10
- package/dist/x-avatar.d.ts +21 -0
- package/dist/x-avatar.js +2 -2
- package/dist/x-badge.d.ts +19 -0
- package/dist/x-badge.js +7 -7
- package/dist/x-bento-grid.d.ts +12 -0
- package/dist/x-bento-grid.js +2 -2
- package/dist/x-bento-item.d.ts +12 -0
- package/dist/x-bento-item.js +4 -4
- package/dist/x-breadcrumbs.d.ts +20 -0
- package/dist/x-breadcrumbs.js +14 -14
- package/dist/x-button.d.ts +45 -0
- package/dist/x-button.js +4 -4
- package/dist/x-cancel-dialogue.d.ts +50 -0
- package/dist/x-cancel-dialogue.js +12 -12
- package/dist/x-card.d.ts +39 -0
- package/dist/x-card.js +3 -3
- package/dist/x-carousel.d.ts +48 -0
- package/dist/x-carousel.js +28 -28
- package/dist/x-chart.d.ts +23 -0
- package/dist/x-chart.js +28 -28
- package/dist/x-checkbox.d.ts +45 -0
- package/dist/x-checkbox.js +6 -6
- package/dist/x-chip.d.ts +41 -0
- package/dist/x-chip.js +8 -8
- package/dist/x-collapse.d.ts +42 -0
- package/dist/x-collapse.js +1 -1
- package/dist/x-color-picker.d.ts +47 -0
- package/dist/x-color-picker.js +40 -40
- package/dist/x-combobox.d.ts +46 -0
- package/dist/x-combobox.js +24 -24
- package/dist/x-command-palette.d.ts +46 -0
- package/dist/x-command-palette.js +24 -24
- package/dist/x-container.d.ts +14 -0
- package/dist/x-container.js +2 -2
- package/dist/x-context-menu.d.ts +17 -0
- package/dist/x-context-menu.js +9 -9
- package/dist/x-copy.d.ts +51 -0
- package/dist/x-copy.js +6 -6
- package/dist/x-currency-field.d.ts +51 -0
- package/dist/x-currency-field.js +9 -8
- package/dist/x-date-picker.d.ts +20 -0
- package/dist/x-date-picker.js +8 -8
- package/dist/x-divider.d.ts +20 -0
- package/dist/x-divider.js +3 -3
- package/dist/x-drawer.d.ts +44 -0
- package/dist/x-drawer.js +3 -3
- package/dist/x-dropdown.d.ts +42 -0
- package/dist/x-dropdown.js +9 -9
- package/dist/x-fieldset.d.ts +14 -0
- package/dist/x-fieldset.js +2 -2
- package/dist/x-file-download.d.ts +40 -0
- package/dist/x-file-download.js +7 -7
- package/dist/x-file-upload.d.ts +46 -0
- package/dist/x-file-upload.js +22 -22
- package/dist/x-form-field.d.ts +47 -0
- package/dist/x-form-field.js +6 -6
- package/dist/x-form.d.ts +41 -0
- package/dist/x-form.js +3 -3
- package/dist/x-gaussian-blur.d.ts +20 -0
- package/dist/x-gaussian-blur.js +6 -6
- package/dist/x-grid.d.ts +12 -0
- package/dist/x-grid.js +3 -3
- package/dist/x-icon.d.ts +15 -0
- package/dist/x-icon.js +2 -2
- package/dist/x-image.d.ts +48 -0
- package/dist/x-image.js +6 -6
- package/dist/x-kinetic-font.d.ts +48 -0
- package/dist/x-kinetic-font.js +11 -11
- package/dist/x-kinetic-typography.d.ts +27 -0
- package/dist/x-kinetic-typography.js +20 -20
- package/dist/x-liquid-dock.d.ts +47 -0
- package/dist/x-liquid-dock.js +35 -35
- package/dist/x-liquid-fill.d.ts +46 -0
- package/dist/x-liquid-fill.js +18 -18
- package/dist/x-liquid-glass.d.ts +25 -0
- package/dist/x-liquid-glass.js +10 -10
- package/dist/x-menu-item.d.ts +41 -0
- package/dist/x-menu.d.ts +42 -0
- package/dist/x-menu.js +1 -1
- package/dist/x-metaball-cursor.d.ts +21 -0
- package/dist/x-metaball-cursor.js +9 -9
- package/dist/x-modal.d.ts +44 -0
- package/dist/x-modal.js +2 -2
- package/dist/x-morph-stack.d.ts +46 -0
- package/dist/x-morph-stack.js +39 -39
- package/dist/x-navbar.d.ts +46 -0
- package/dist/x-navbar.js +3 -3
- package/dist/x-neural-glow.d.ts +22 -0
- package/dist/x-neural-glow.js +2 -2
- package/dist/x-notification-center.d.ts +42 -0
- package/dist/x-notification-center.js +10 -10
- package/dist/x-organic-divider.d.ts +19 -0
- package/dist/x-organic-progress.d.ts +45 -0
- package/dist/x-organic-progress.js +9 -9
- package/dist/x-organic-shape.d.ts +18 -0
- package/dist/x-pagination.d.ts +44 -0
- package/dist/x-pagination.js +1 -1
- package/dist/x-particle-button.d.ts +47 -0
- package/dist/x-particle-button.js +7 -7
- package/dist/x-popover.d.ts +45 -0
- package/dist/x-popover.js +23 -23
- package/dist/x-progress-circle.d.ts +41 -0
- package/dist/x-progress-circle.js +3 -3
- package/dist/x-progress.d.ts +44 -0
- package/dist/x-progress.js +3 -3
- package/dist/x-radio.d.ts +44 -0
- package/dist/x-radio.js +11 -11
- package/dist/x-ripple-effect.d.ts +42 -0
- package/dist/x-ripple-effect.js +5 -5
- package/dist/x-scroll-parallax.d.ts +45 -0
- package/dist/x-scroll-parallax.js +3 -3
- package/dist/x-scroll-stack.d.ts +46 -0
- package/dist/x-scroll-stack.js +6 -6
- package/dist/x-scroll-story.d.ts +56 -0
- package/dist/x-scroll-story.js +14 -14
- package/dist/x-scroll-timeline.d.ts +58 -0
- package/dist/x-scroll-timeline.js +43 -43
- package/dist/x-scroll.d.ts +51 -0
- package/dist/x-scroll.js +14 -14
- package/dist/x-search-field.d.ts +47 -0
- package/dist/x-search-field.js +15 -14
- package/dist/x-select.d.ts +40 -0
- package/dist/x-select.js +3 -3
- package/dist/x-sidebar.d.ts +40 -0
- package/dist/x-sidebar.js +8 -8
- package/dist/x-skeleton-group.d.ts +15 -0
- package/dist/x-skeleton-group.js +5 -5
- package/dist/x-skeleton.d.ts +16 -0
- package/dist/x-slider.d.ts +48 -0
- package/dist/x-slider.js +5 -5
- package/dist/x-soft-body.d.ts +44 -0
- package/dist/x-soft-body.js +5 -5
- package/dist/x-spacer.d.ts +15 -0
- package/dist/x-spacer.js +1 -1
- package/dist/x-spinner.d.ts +15 -0
- package/dist/x-splash.d.ts +42 -0
- package/dist/x-splash.js +3 -3
- package/dist/x-stat.d.ts +21 -0
- package/dist/x-stat.js +6 -6
- package/dist/x-stepper.d.ts +42 -0
- package/dist/x-stepper.js +14 -14
- package/dist/x-switch.d.ts +44 -0
- package/dist/x-switch.js +5 -5
- package/dist/x-tab.d.ts +40 -0
- package/dist/x-tab.js +7 -7
- package/dist/x-table-cell.d.ts +50 -0
- package/dist/x-table-cell.js +5 -5
- package/dist/x-table-row.d.ts +43 -0
- package/dist/x-table-row.js +10 -10
- package/dist/x-table.d.ts +124 -0
- package/dist/x-table.js +3 -3
- package/dist/x-tabs.d.ts +70 -0
- package/dist/x-tabs.js +2 -2
- package/dist/x-text-area.d.ts +47 -0
- package/dist/x-text-area.js +7 -7
- package/dist/x-theme.d.ts +15 -0
- package/dist/x-timeline-item.d.ts +46 -0
- package/dist/x-timeline-item.js +19 -19
- package/dist/x-timeline.d.ts +78 -0
- package/dist/x-timeline.js +3 -3
- package/dist/x-toast.d.ts +45 -0
- package/dist/x-toast.js +21 -21
- package/dist/x-toaster.d.ts +41 -0
- package/dist/x-toaster.js +8 -8
- package/dist/x-tooltip.d.ts +43 -0
- package/dist/x-tooltip.js +12 -12
- package/dist/x-typography.d.ts +16 -0
- package/dist/x-typography.js +1 -1
- package/dist/x-welcome-tour.d.ts +92 -0
- package/dist/x-welcome-tour.js +56 -56
- package/package.json +502 -392
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// x-color-picker.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XColorPickerEventMap {
|
|
6
|
+
"x-color-picker-input": CustomEvent<{ value: string; h: number; s: number; l: number; a: number }>;
|
|
7
|
+
"x-color-picker-change": CustomEvent<{ value: string; h: number; s: number; l: number; a: number }>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface XColorPicker extends HTMLElement {
|
|
11
|
+
open: boolean;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
name: string;
|
|
14
|
+
value: string;
|
|
15
|
+
mode: string;
|
|
16
|
+
swatches: string;
|
|
17
|
+
readOnly: boolean;
|
|
18
|
+
label: string;
|
|
19
|
+
alpha: boolean;
|
|
20
|
+
|
|
21
|
+
addEventListener<K extends keyof XColorPickerEventMap>(
|
|
22
|
+
type: K,
|
|
23
|
+
listener: (this: XColorPicker, ev: XColorPickerEventMap[K]) => any,
|
|
24
|
+
options?: boolean | AddEventListenerOptions
|
|
25
|
+
): void;
|
|
26
|
+
addEventListener(
|
|
27
|
+
type: string,
|
|
28
|
+
listener: EventListenerOrEventListenerObject,
|
|
29
|
+
options?: boolean | AddEventListenerOptions
|
|
30
|
+
): void;
|
|
31
|
+
removeEventListener<K extends keyof XColorPickerEventMap>(
|
|
32
|
+
type: K,
|
|
33
|
+
listener: (this: XColorPicker, ev: XColorPickerEventMap[K]) => any,
|
|
34
|
+
options?: boolean | EventListenerOptions
|
|
35
|
+
): void;
|
|
36
|
+
removeEventListener(
|
|
37
|
+
type: string,
|
|
38
|
+
listener: EventListenerOrEventListenerObject,
|
|
39
|
+
options?: boolean | EventListenerOptions
|
|
40
|
+
): void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare global {
|
|
44
|
+
interface HTMLElementTagNameMap {
|
|
45
|
+
"x-color-picker": XColorPicker;
|
|
46
|
+
}
|
|
47
|
+
}
|
package/dist/x-color-picker.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
1)),16),d=parseInt(""+$APP.T.g($APP.pc(a,2))+$APP.T.g($APP.pc(a,2)),16);return new $APP.R(null,4,[
|
|
4
|
-
else return null},
|
|
5
|
-
Math.round(c*255),new $APP.R(null,3,[
|
|
6
|
-
return"#"+$APP.T.g(e(a))+$APP.T.g(e(b))+$APP.T.g(e(c))+$APP.T.g(e(
|
|
7
|
-
|
|
8
|
-
$APP.Pj),e=$APP.D(b,$APP.Yi);a=$APP.D(b,$APP.Aj);var g=$APP.D(b,$APP.Bj),h=$APP.D(b,$APP.wj),l=$APP.D(b,
|
|
9
|
-
A=$APP.D(C,
|
|
10
|
-
"%":a},
|
|
11
|
-
|
|
12
|
-
d);d=$APP.M(b);b=$APP.D(d,
|
|
13
|
-
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=
|
|
14
|
-
"false")})},
|
|
15
|
-
Q=$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.
|
|
16
|
-
$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(C))+"%,"+$APP.T.g(Math.round(v))+"%)"),H.style.setProperty("--_x-cp-alpha-pos",""+$APP.T.g((
|
|
17
|
-
","+$APP.T.g(
|
|
18
|
-
a=b.clientY-c.top;var d=c.width,e=c.height;b=100*(
|
|
19
|
-
|
|
20
|
-
$APP.n(b.shiftKey)?10:1,e=function(){switch(b.key){case "ArrowRight":return
|
|
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 Qa=$APP.k($APP.k(a,"__xColorPickerRefs"),"hue-strip");Qa.setPointerCapture(
|
|
26
|
-
null;var
|
|
27
|
-
"alpha-strip"),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
d.addEventListener("pointermove",C);d.addEventListener("pointerup",E);d.addEventListener("keydown",H);e.addEventListener("pointerdown",G);e.addEventListener("pointermove",J);e.addEventListener("pointerup",Q);e.addEventListener("keydown",aa);g.addEventListener("keydown",
|
|
31
|
-
|
|
2
|
+
var DA=function(a,b){return $APP.sh.i($APP.oh.i(a,0),b)},EA=function(a){return $APP.fd(a,360)},FA=function(a){return DA(a,100)},GA=function(a){return DA(a,1)},IA=function(a){var b=typeof a==="string";a=b?$APP.eg(HA,a.trim()):b;return $APP.F(a)},MA=function(a){if(typeof a==="string")if(a=$APP.eg(HA,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(""+$APP.T.g($APP.pc(a,1))+$APP.T.g($APP.pc(a,
|
|
3
|
+
1)),16),d=parseInt(""+$APP.T.g($APP.pc(a,2))+$APP.T.g($APP.pc(a,2)),16);return new $APP.R(null,4,[JA,b,$APP.Ql,c,KA,d,LA,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.R(null,4,[JA,b,$APP.Ql,c,KA,d,LA,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.R(null,4,[JA,b,$APP.Ql,c,KA,d,LA,parseInt(a.substring(6,8),16)/255],null);default:return null}else return null;
|
|
4
|
+
else return null},QA=function(a,b,c){a/=255;b/=255;c/=255;var d=$APP.oh.C(a,b,$APP.uc([c])),e=$APP.sh.C(a,b,$APP.uc([c])),g=(d+e)/2,h=d-e;return h===0?new $APP.R(null,3,[NA,0,OA,0,PA,g*100],null):new $APP.R(null,3,[NA,(d===a?((b-c)/h+(b<c?6:0))/6:d===b?((c-a)/h+2)/6:((a-b)/h+4)/6)*360,OA,(g>.5?h/(2-d-e):h/(d+e))*100,PA,g*100],null)},RA=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},SA=function(a,b,c){a=EA(a)/360;b=FA(b)/100;c=FA(c)/100;if(b===0)return a=
|
|
5
|
+
Math.round(c*255),new $APP.R(null,3,[JA,a,$APP.Ql,a,KA,a],null);b=c<.5?c*(1+b):c+b-c*b;c=2*c-b;return new $APP.R(null,3,[JA,Math.round(RA(c,b,a+1/3)*255),$APP.Ql,Math.round(RA(c,b,a)*255),KA,Math.round(RA(c,b,a-1/3)*255)],null)},TA=function(a,b,c){function d(e){e=DA(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))},UA=function(a,b,c,d){function e(g){g=DA(Math.round(g),255).toString(16);return $APP.z(g)<2?"0"+$APP.T.g(g):g}
|
|
6
|
+
return"#"+$APP.T.g(e(a))+$APP.T.g(e(b))+$APP.T.g(e(c))+$APP.T.g(e(GA(d)*255))},WA=function(a,b,c){b=FA(b)/100;c=FA(c)/100;b=c+b*$APP.sh.i(c,1-c);return new $APP.R(null,3,[NA,EA(a),OA,(b===0?0:2*(1-c/b))*100,VA,b*100],null)},XA=function(a,b,c){b=FA(b)/100;c=FA(c)/100;b=c*(1-b/2);c=b===0||b===1?0:(c-b)/$APP.sh.i(b,1-b);return new $APP.R(null,3,[NA,EA(a),OA,c*100,PA,b*100],null)},YA=function(a,b){return new $APP.R(null,2,[$APP.Kl,FA(a),$APP.Jl,100-FA(b)],null)},ZA=function(a){return typeof a==="string"&&
|
|
7
|
+
IA(a)?(a=MA(a),$APP.n(a)?TA(JA.g(a),$APP.Ql.g(a),KA.g(a)):null):"#000000"},aB=function(a){return typeof a==="string"&&$APP.I($A,a.trim().toLowerCase())?a.trim().toLowerCase():"inline"},bB=function(a){return typeof a==="string"&&$APP.Lg(a)?$APP.We.m($APP.fe,$APP.th.m($APP.ae.g($APP.Jg),$APP.ce(IA),$APP.ae.g(function(b){b=MA(b);var c=$APP.M(b);b=$APP.D(c,JA);var d=$APP.D(c,$APP.Ql);c=$APP.D(c,KA);return TA(b,d,c)})),$APP.Hg(a,/,/)):$APP.fe},hB=function(a){var b=$APP.M(a),c=$APP.D(b,$APP.hm),d=$APP.D(b,
|
|
8
|
+
$APP.Pj),e=$APP.D(b,$APP.Yi);a=$APP.D(b,$APP.Aj);var g=$APP.D(b,$APP.Bj),h=$APP.D(b,$APP.wj),l=$APP.D(b,cB),m=$APP.D(b,$APP.U),p=$APP.D(b,dB);b=ZA(e);var q=function(){var H=MA(e);return $APP.n(H)?H:MA("#000000")}(),v=$APP.M(q);q=$APP.D(v,JA);var x=$APP.D(v,$APP.Ql),y=$APP.D(v,KA);v=$APP.D(v,LA);var A=function(){var H=typeof e==="string";if(H){H=e.trim();var G=$APP.eg(HA,H);$APP.n(G)?(H=$APP.eg(HA,H),H=$APP.u($APP.w(H)),H=8===$APP.z(H)):H=G;return H}return H}();v=$APP.n(A)?v:1;A=QA(q,x,y);var C=$APP.M(A);
|
|
9
|
+
A=$APP.D(C,NA);var E=$APP.D(C,OA);C=$APP.D(C,PA);d=$APP.Kg(d);g=$APP.Kg(g);p=p!=null;c=c!=null;h=aB(h);return $APP.zf([$APP.cn,eB,$APP.Aj,$APP.wj,cB,OA,PA,fB,NA,$APP.U,$APP.Nm,gB,$APP.X,LA],[g,p,$APP.Lg(a)?a:null,h,bB(l),E,C,b,A,$APP.Lg(m)?m:null,$APP.B.i(h,"popover")&&c,p&&v<1?UA(q,x,y,v):b,d,v])},iB=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)+", Opacity "+$APP.T.g(Math.round(d*100))+
|
|
10
|
+
"%":a},jB=function(a){var b=$APP.M(a);a=$APP.D(b,$APP.X);b=$APP.D(b,$APP.cn);return $APP.r(a)&&$APP.r(b)},kB=function(a){return document.createElement(a)},lB=function(a,b,c){return a.setAttribute(b,c)},mB=function(a){return hB($APP.zf([$APP.hm,$APP.Pj,$APP.Aj,$APP.Yi,$APP.Bj,$APP.wj,cB,$APP.U,dB],[a.getAttribute("open"),a.getAttribute("disabled"),a.getAttribute("name"),a.getAttribute("value"),a.getAttribute("readonly"),a.getAttribute("mode"),a.getAttribute("swatches"),a.getAttribute("label"),a.getAttribute("alpha")]))},
|
|
11
|
+
nB=function(a,b,c,d){b=new CustomEvent(b,{detail:$APP.Hh(d),bubbles:!0,composed:!0,cancelable:$APP.F(c)});return a.dispatchEvent(b)},oB=function(a,b){var c=gB.g(b),d=NA.g(b),e=OA.g(b),g=PA.g(b);b=LA.g(b);return nB(a,"x-color-picker-input",!1,new $APP.R(null,5,[$APP.Yi,c,NA,d,OA,e,PA,g,LA,b],null))},pB=function(a,b){var c=gB.g(b),d=NA.g(b),e=OA.g(b),g=PA.g(b);b=LA.g(b);return nB(a,"x-color-picker-change",!0,new $APP.R(null,5,[$APP.Yi,c,NA,d,OA,e,PA,g,LA,b],null))},qB=function(a,b,c,d,e,g){b=SA(b,c,
|
|
12
|
+
d);d=$APP.M(b);b=$APP.D(d,JA);c=$APP.D(d,$APP.Ql);d=$APP.D(d,KA);e=$APP.n($APP.n(g)?e<1:g)?UA(b,c,d,e):TA(b,c,d);a.setAttribute("value",e)},rB=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=kB("button");l.setAttribute("part","swatch");l.setAttribute("type","button");l.setAttribute("role","option");l.setAttribute("aria-label",h);l.setAttribute("data-color",h);l.style.backgroundColor=
|
|
13
|
+
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=kB("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 lB(m,"aria-selected",$APP.B.i(m.getAttribute("data-color"),d)?"true":
|
|
14
|
+
"false")})},sB=function(a){var b=$APP.k(a,"__xColorPickerRefs");if($APP.n(b)){var c=mB(a),d=$APP.M(c);c=$APP.D(d,gB);var e=$APP.D(d,$APP.X),g=$APP.D(d,LA),h=$APP.D(d,$APP.cn),l=$APP.D(d,eB),m=$APP.D(d,$APP.wj),p=$APP.D(d,cB),q=$APP.D(d,OA),v=$APP.D(d,PA),x=$APP.D(d,fB),y=$APP.D(d,$APP.U),A=$APP.D(d,NA);d=WA(A,q,v);d=$APP.M(d);var C=$APP.D(d,OA);q=$APP.D(d,VA);d=YA(OA.g(d),q);q=$APP.k(b,"area");var E=$APP.k(b,"hue-strip"),H=$APP.k(b,"alpha-strip"),G=$APP.k(b,"preview-color"),J=$APP.k(b,"hex-input"),
|
|
15
|
+
Q=$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.Kl.g(d).toFixed(2))+"%");q.style.setProperty("--_x-cp-area-y",""+$APP.T.g($APP.Jl.g(d).toFixed(2))+"%");lB(q,"aria-valuetext",iB(A,C,v,g));$APP.n(y)&&q.setAttribute("aria-label",y);E.style.setProperty("--_x-cp-hue-pos",""+$APP.T.g((EA(A)/360*100).toFixed(2))+"%");lB(E,"aria-valuenow",""+$APP.T.g(Math.round(A)));
|
|
16
|
+
$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(C))+"%,"+$APP.T.g(Math.round(v))+"%)"),H.style.setProperty("--_x-cp-alpha-pos",""+$APP.T.g((GA(g)*100).toFixed(2))+"%"),lB(H,"aria-valuenow",""+$APP.T.g(Math.round(g*100)))):H.style.display="none";G.style.backgroundColor=$APP.n(l)?function(){var aa=SA(A,C,v),la=$APP.M(aa);aa=$APP.D(la,JA);var Ca=$APP.D(la,$APP.Ql);la=$APP.D(la,KA);return"rgba("+$APP.T.g(aa)+","+$APP.T.g(Ca)+
|
|
17
|
+
","+$APP.T.g(la)+","+$APP.T.g(g.toFixed(2))+")"}():x;a.shadowRoot.activeElement!==J&&(J.value=c);Q.style.backgroundColor=$APP.n(l)?function(){var aa=SA(A,C,v),la=$APP.M(aa);aa=$APP.D(la,JA);var Ca=$APP.D(la,$APP.Ql);la=$APP.D(la,KA);return"rgba("+$APP.T.g(aa)+","+$APP.T.g(Ca)+","+$APP.T.g(la)+","+$APP.T.g(g.toFixed(2))+")"}():x;J.disabled=$APP.n(e)?e:h;rB(a,b,p,x);a=$APP.k(a,"__xColorPickerInternals");return $APP.n(a)?a.setFormValue(c):null}return null},uB=function(a,b){var c=a.getBoundingClientRect();
|
|
18
|
+
a=b.clientY-c.top;var d=c.width,e=c.height;b=100*(DA(b.clientX-c.left,d)/d);a=100*(DA(a,e)/e);return new $APP.R(null,2,[tB,FA(b),$APP.Rj,100-FA(a)],null)},vB=function(a,b){a=a.getBoundingClientRect();var c=a.width;b=100*(DA(b.clientX-a.left,c)/c);return FA(b)/100*360},wB=function(a,b){a=a.getBoundingClientRect();var c=a.width;b=100*(DA(b.clientX-a.left,c)/c);return FA(b)/100},yB=function(a,b){var c=mB(a);if(jB(c)&&$APP.I(xB,b.key)){b.preventDefault();var d=$APP.n(b.shiftKey)?10:1,e=WA(NA.g(c),OA.g(c),
|
|
19
|
+
PA.g(c)),g=function(){switch(b.key){case "ArrowRight":return FA(OA.g(e)+d);case "ArrowLeft":return FA(OA.g(e)-d);default:return OA.g(e)}}(),h=function(){switch(b.key){case "ArrowUp":return FA(VA.g(e)+d);case "ArrowDown":return FA(VA.g(e)-d);default:return VA.g(e)}}();g=XA(NA.g(c),g,h);var l=$APP.M(g);g=$APP.D(l,NA);h=$APP.D(l,OA);l=$APP.D(l,PA);qB(a,g,h,l,LA.g(c),eB.g(c));oB(a,mB(a));return pB(a,mB(a))}return null},AB=function(a,b){var c=mB(a);if(jB(c)&&$APP.I(zB,b.key)){b.preventDefault();var d=
|
|
20
|
+
$APP.n(b.shiftKey)?10:1,e=function(){switch(b.key){case "ArrowRight":return EA(NA.g(c)+d);case "ArrowLeft":return EA(NA.g(c)-d);case "Home":return 0;case "End":return 360;default:return NA.g(c)}}();qB(a,e,OA.g(c),PA.g(c),LA.g(c),eB.g(c));oB(a,mB(a));return pB(a,mB(a))}return null},BB=function(a,b){var c=mB(a);if($APP.n(function(){var g=jB(c);return g?(g=eB.g(c),$APP.n(g)?$APP.I(zB,b.key):g):g}())){b.preventDefault();var d=$APP.n(b.shiftKey)?.1:.01,e=function(){switch(b.key){case "ArrowRight":return GA(LA.g(c)+
|
|
21
|
+
d);case "ArrowLeft":return GA(LA.g(c)-d);case "Home":return 0;case "End":return 1;default:return LA.g(c)}}();qB(a,NA.g(c),OA.g(c),PA.g(c),e,!0);oB(a,mB(a));return pB(a,mB(a))}return null},CB=function(a){var b=mB(a);return jB(b)&&typeof EyeDropper!=="undefined"?(new EyeDropper).open().then(function(c){a.setAttribute("value",c.sRGBHex);return pB(a,mB(a))}).catch(function(){return null}):null},DB=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},EB=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},FB=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(ea){var ta=mB(a);if(jB(ta)){ea.preventDefault();var Qa=$APP.k($APP.k(a,"__xColorPickerRefs"),"area");Qa.setPointerCapture(ea.pointerId);a.__xColorPickerDragging="area";ea=uB(Qa,ea);Qa=$APP.M(ea);ea=$APP.D(Qa,tB);Qa=$APP.D(Qa,$APP.Rj);ea=XA(NA.g(ta),ea,Qa);var ac=$APP.M(ea);ea=$APP.D(ac,NA);Qa=$APP.D(ac,OA);ac=$APP.D(ac,PA);qB(a,ea,Qa,ac,LA.g(ta),eB.g(ta));ta=oB(a,mB(a))}else ta=null;return ta},v=function(ea){if($APP.B.i("area",$APP.k(a,"__xColorPickerDragging"))){var ta=
|
|
24
|
+
mB(a);ea=uB($APP.k($APP.k(a,"__xColorPickerRefs"),"area"),ea);var Qa=$APP.M(ea);ea=$APP.D(Qa,tB);Qa=$APP.D(Qa,$APP.Rj);ea=XA(NA.g(ta),ea,Qa);var ac=$APP.M(ea);ea=$APP.D(ac,NA);Qa=$APP.D(ac,OA);ac=$APP.D(ac,PA);qB(a,ea,Qa,ac,LA.g(ta),eB.g(ta));ta=oB(a,mB(a))}else ta=null;return ta},x=function(){if($APP.B.i("area",$APP.k(a,"__xColorPickerDragging"))){a.__xColorPickerDragging=null;var ea=pB(a,mB(a))}else ea=null;return ea},y=function(ea){return yB(a,ea)},A=function(ea){var ta=mB(a);if(jB(ta)){ea.preventDefault();
|
|
25
|
+
var Qa=$APP.k($APP.k(a,"__xColorPickerRefs"),"hue-strip");Qa.setPointerCapture(ea.pointerId);a.__xColorPickerDragging="hue";ea=vB(Qa,ea);qB(a,ea,OA.g(ta),PA.g(ta),LA.g(ta),eB.g(ta));ta=oB(a,mB(a))}else ta=null;return ta},C=function(ea){if($APP.B.i("hue",$APP.k(a,"__xColorPickerDragging"))){var ta=mB(a);ea=vB($APP.k($APP.k(a,"__xColorPickerRefs"),"hue-strip"),ea);qB(a,ea,OA.g(ta),PA.g(ta),LA.g(ta),eB.g(ta));ta=oB(a,mB(a))}else ta=null;return ta},E=function(){if($APP.B.i("hue",$APP.k(a,"__xColorPickerDragging"))){a.__xColorPickerDragging=
|
|
26
|
+
null;var ea=pB(a,mB(a))}else ea=null;return ea},H=function(ea){return AB(a,ea)},G=function(ea){var ta=mB(a);var Qa=(Qa=jB(ta))?eB.g(ta):Qa;$APP.n(Qa)?(ea.preventDefault(),Qa=$APP.k($APP.k(a,"__xColorPickerRefs"),"alpha-strip"),Qa.setPointerCapture(ea.pointerId),a.__xColorPickerDragging="alpha",ea=wB(Qa,ea),qB(a,NA.g(ta),OA.g(ta),PA.g(ta),ea,!0),ta=oB(a,mB(a))):ta=null;return ta},J=function(ea){if($APP.B.i("alpha",$APP.k(a,"__xColorPickerDragging"))){var ta=mB(a);ea=wB($APP.k($APP.k(a,"__xColorPickerRefs"),
|
|
27
|
+
"alpha-strip"),ea);qB(a,NA.g(ta),OA.g(ta),PA.g(ta),ea,!0);ta=oB(a,mB(a))}else ta=null;return ta},Q=function(){if($APP.B.i("alpha",$APP.k(a,"__xColorPickerDragging"))){a.__xColorPickerDragging=null;var ea=pB(a,mB(a))}else ea=null;return ea},aa=function(ea){return BB(a,ea)},la=function(ea){a:{if($APP.B.i("Enter",ea.key)){ea.preventDefault();ea=$APP.k($APP.k(a,"__xColorPickerRefs"),"hex-input");var ta=ea.value,Qa=mB(a);if(jB(Qa)){if(IA(ta)){a.setAttribute("value",ta);ea=pB(a,mB(a));break a}ea=ea.value=
|
|
28
|
+
gB.g(Qa);break a}}ea=null}return ea},Ca=function(ea){a:{var ta=mB(a);if(jB(ta)&&(ea=ea.target,$APP.n(ea.hasAttribute("data-color")))){ea=ea.getAttribute("data-color");a.setAttribute("value",ea);ea=pB(a,mB(a));break a}ea=null}return ea},Pa=function(){return CB(a)},db=function(){var ea=mB(a);return $APP.n(navigator.clipboard)?navigator.clipboard.writeText(gB.g(ea)):null},eb=function(){var ea=mB(a);return $APP.B.i("popover",$APP.wj.g(ea))&&$APP.r($APP.X.g(ea))?$APP.n($APP.Nm.g(ea))?EB(a):DB(a):null},
|
|
29
|
+
pb=function(ea){$APP.B.i("Escape",ea.key)&&$APP.B.i("popover",$APP.wj.g(mB(a)))?(ea.preventDefault(),ea.stopPropagation(),ea=EB(a)):ea=null;return ea},Nb=function(ea){return ea.stopPropagation()},gb=function(ea){return $APP.n(a.hasAttribute("open"))?$APP.n(ea.composedPath().some(function(ta){return ta===a}))?null:EB(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",C);d.addEventListener("pointerup",E);d.addEventListener("keydown",H);e.addEventListener("pointerdown",G);e.addEventListener("pointermove",J);e.addEventListener("pointerup",Q);e.addEventListener("keydown",aa);g.addEventListener("keydown",la);h.addEventListener("click",Ca);l.addEventListener("click",Pa);m.addEventListener("click",db);p.addEventListener("click",eb);b.addEventListener("keydown",pb);b.addEventListener("pointerdown",Nb);document.addEventListener("pointerdown",
|
|
31
|
+
gb,!0);$APP.Cg(a,"__xColorPickerHandlers",{"area-move":v,copy:db,"panel-key":pb,"alpha-up":Q,"hue-up":E,"alpha-key":aa,"alpha-move":J,"hex-key":la,swatch:Ca,"area-up":x,"alpha-down":G,"area-key":y,"hue-down":A,"hue-key":H,"hue-move":C,eyedrop:Pa,"panel-pd":Nb,trigger:eb,"doc-click":gb,"area-down":q})}},GB=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},HB=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))}})},IB=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)?lB(this,c,""+$APP.T.g(d)):this.removeAttribute(c)}})},KB=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return JB}});HB(b,"disabled","disabled");HB(b,"readOnly","readonly");HB(b,"alpha","alpha");HB(b,"open","open");IB(b,"value","value");IB(b,"swatches","swatches");IB(b,"name","name");IB(b,"mode","mode");IB(b,"label","label");
|
|
36
|
+
b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xColorPickerRefs"))){var c=this.attachShadow({mode:"open"}),d=kB("style"),e=kB("div"),g=kB("button"),h=kB("span"),l=kB("div"),m=kB("div"),p=kB("div"),q=kB("div"),v=kB("div"),x=kB("div"),y=kB("div"),A=kB("div"),C=kB("div"),E=kB("div"),H=kB("div"),G=kB("span"),J=kB("input"),Q=kB("button"),aa=kB("button"),la=kB("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");C.setAttribute("part","alpha-thumb");E.setAttribute("part","controls");H.setAttribute("part","preview");
|
|
39
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");Q.setAttribute("part","eyedropper");Q.setAttribute("type","button");Q.setAttribute("aria-label","Pick color from screen");Q.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';
|
|
41
|
-
"swatches");
|
|
42
|
-
{"alpha-thumb":C,copy:aa,swatches:
|
|
43
|
-
"disabled",$APP.F(c));return
|
|
44
|
-
"r","r",-471384190),
|
|
45
|
-
$APP.zf([$APP.
|
|
46
|
-
$APP.Ik,"label"],null),new $APP.R(null,2,[$APP.Z,$APP.Zj,$APP.Ik,"alpha"],null)]);$APP.Pd(["x-color-picker-input",new $APP.R(null,2,[$APP.V,new $APP.R(null,5,[$APP.Yi,$APP.Y,
|
|
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';la.setAttribute("part",
|
|
41
|
+
"swatches");la.setAttribute("role","listbox");la.setAttribute("aria-label","Preset colors");g.appendChild(h);m.appendChild(p);v.appendChild(x);y.appendChild(A);y.appendChild(C);q.appendChild(v);q.appendChild(y);H.appendChild(G);E.appendChild(H);E.appendChild(J);E.appendChild(Q);E.appendChild(aa);l.appendChild(m);l.appendChild(q);l.appendChild(E);l.appendChild(la);e.appendChild(g);e.appendChild(l);c.appendChild(d);c.appendChild(e);typeof EyeDropper==="undefined"&&(Q.style.display="none");this.__xColorPickerRefs=
|
|
42
|
+
{"alpha-thumb":C,copy:aa,swatches:la,"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:Q,"hex-input":J};$APP.n(this.attachInternals)&&(this.__xColorPickerInternals=this.attachInternals())}GB(this);FB(this);return sB(this)};b.disconnectedCallback=function(){return GB(this)};b.attributeChangedCallback=function(){return sB(this)};b.formDisabledCallback=function(c){$APP.Eg(this,
|
|
43
|
+
"disabled",$APP.F(c));return sB(this)};b.formResetCallback=function(){this.setAttribute("value","#000000");return sB(this)};return a},LB=function(){return $APP.n(customElements.get("x-color-picker"))?null:customElements.define("x-color-picker",KB())},dB=new $APP.K(null,"alpha","alpha",-1574982441),gB=new $APP.K(null,"hex-full","hex-full",-1466644518),cB=new $APP.K(null,"swatches","swatches",2033601707),VA=new $APP.K(null,"v","v",21465059),OA=new $APP.K(null,"s","s",1705939918),JA=new $APP.K(null,
|
|
44
|
+
"r","r",-471384190),eB=new $APP.K(null,"alpha?","alpha?",1329751525),PA=new $APP.K(null,"l","l",1395893423),NA=new $APP.K(null,"h","h",1109658740),KA=new $APP.K(null,"b","b",1482224470),tB=new $APP.K(null,"sat","sat",1064662667),LA=new $APP.K(null,"a","a",-2123407586),fB=new $APP.K(null,"hex","hex",41691346);var $A=new $APP.S(null,new $APP.R(null,2,["inline",null,"popover",null],null),null),JB="value alpha swatches disabled readonly name mode open label".split(" ");
|
|
45
|
+
$APP.zf([$APP.hm,$APP.Pj,$APP.Aj,$APP.Yi,$APP.wj,cB,$APP.mm,$APP.U,dB],[new $APP.R(null,2,[$APP.Z,$APP.Zj,$APP.Ik,"open"],null),new $APP.R(null,2,[$APP.Z,$APP.Zj,$APP.Ik,"disabled"],null),new $APP.R(null,2,[$APP.Z,$APP.Y,$APP.Ik,"name"],null),new $APP.R(null,2,[$APP.Z,$APP.Y,$APP.Ik,"value"],null),new $APP.R(null,2,[$APP.Z,$APP.Y,$APP.Ik,"mode"],null),new $APP.R(null,2,[$APP.Z,$APP.Y,$APP.Ik,"swatches"],null),new $APP.R(null,2,[$APP.Z,$APP.Zj,$APP.Ik,"readonly"],null),new $APP.R(null,2,[$APP.Z,$APP.Y,
|
|
46
|
+
$APP.Ik,"label"],null),new $APP.R(null,2,[$APP.Z,$APP.Zj,$APP.Ik,"alpha"],null)]);$APP.Pd(["x-color-picker-input",new $APP.R(null,2,[$APP.V,new $APP.R(null,5,[$APP.Yi,$APP.Y,NA,$APP.W,OA,$APP.W,PA,$APP.W,LA,$APP.W],null),$APP.km,!1],null),"x-color-picker-change",new $APP.R(null,2,[$APP.V,new $APP.R(null,5,[$APP.Yi,$APP.Y,NA,$APP.W,OA,$APP.W,PA,$APP.W,LA,$APP.W],null),$APP.km,!0],null)]);var HA=/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;var xB=new $APP.S(null,new $APP.R(null,4,["ArrowUp",null,"ArrowDown",null,"ArrowRight",null,"ArrowLeft",null],null),null),zB=new $APP.S(null,new $APP.R(null,4,["End",null,"ArrowRight",null,"ArrowLeft",null,"Home",null],null),null);$APP.ha("baredom.exports.x_color_picker.init",LB);export const init=LB;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// x-combobox.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XComboboxEventMap {
|
|
6
|
+
"x-combobox-change": CustomEvent<{ value: string; label: string }>;
|
|
7
|
+
"x-combobox-input": CustomEvent<{ query: string }>;
|
|
8
|
+
"x-combobox-toggle": CustomEvent<{ open: boolean; source: string }>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface XCombobox extends HTMLElement {
|
|
12
|
+
value: string;
|
|
13
|
+
placeholder: string;
|
|
14
|
+
name: string;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
required: boolean;
|
|
17
|
+
open: boolean;
|
|
18
|
+
placement: string;
|
|
19
|
+
|
|
20
|
+
addEventListener<K extends keyof XComboboxEventMap>(
|
|
21
|
+
type: K,
|
|
22
|
+
listener: (this: XCombobox, ev: XComboboxEventMap[K]) => any,
|
|
23
|
+
options?: boolean | AddEventListenerOptions
|
|
24
|
+
): void;
|
|
25
|
+
addEventListener(
|
|
26
|
+
type: string,
|
|
27
|
+
listener: EventListenerOrEventListenerObject,
|
|
28
|
+
options?: boolean | AddEventListenerOptions
|
|
29
|
+
): void;
|
|
30
|
+
removeEventListener<K extends keyof XComboboxEventMap>(
|
|
31
|
+
type: K,
|
|
32
|
+
listener: (this: XCombobox, ev: XComboboxEventMap[K]) => any,
|
|
33
|
+
options?: boolean | EventListenerOptions
|
|
34
|
+
): void;
|
|
35
|
+
removeEventListener(
|
|
36
|
+
type: string,
|
|
37
|
+
listener: EventListenerOrEventListenerObject,
|
|
38
|
+
options?: boolean | EventListenerOptions
|
|
39
|
+
): void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare global {
|
|
43
|
+
interface HTMLElementTagNameMap {
|
|
44
|
+
"x-combobox": XCombobox;
|
|
45
|
+
}
|
|
46
|
+
}
|
package/dist/x-combobox.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
"__xComboboxRefs");if($APP.n(b)){var c=$APP.k(b,"panel");b=$APP.k(b,"input");var d=function(){var C=$APP.k(a,"__xComboboxQuery");return $APP.n(C)?C:""}(),e=
|
|
5
|
-
b.removeAttribute("aria-activedescendant");e=$APP.t($APP.Xd($APP.xh,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=
|
|
6
|
-
v=
|
|
7
|
-
"true"),$APP.B.i(l,g)&&m.setAttribute("data-active",""),$APP.n(p)?(m.appendChild(document.createTextNode(
|
|
8
|
-
7,[$APP.
|
|
9
|
-
d:"bottom-start";g=$APP.M(new $APP.R(null,7,[$APP.Yi,e,$APP.
|
|
10
|
-
a.removeAttribute("data-has-value")}return null},
|
|
11
|
-
0,b=$APP.k(a,"__xComboboxRefs"),$APP.n(b)&&$APP.k(b,"input").select(),
|
|
12
|
-
b){var c=
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
b=$APP.z(
|
|
17
|
-
b.value="",b.focus());return
|
|
2
|
+
var Jo=function(a,b){if(b==null||$APP.B.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)},Ko=function(a,b){return b!=null?$APP.Td(function(c){return $APP.B.i($APP.Yi.g(c),b)?c:null},a):null},Oo=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.R(null,3,[Lo,a.substring(0,c),Mo,a.substring(c,b),No,a.substring(b)],null)}return null},
|
|
3
|
+
Po=function(a){return document.createElement(a)},Qo=function(a,b,c){return a.setAttribute(b,c)},Ro=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.th.i($APP.ce(function(c){return $APP.B.i("OPTION",c.tagName)}),$APP.ae.g(function(c){var d=c.getAttribute("value");return new $APP.R(null,2,[$APP.Yi,$APP.n(d)?d:c.textContent,$APP.U,c.textContent],null)})),$APP.uc(b)),a.__xComboboxOptions=b)},So=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 C=$APP.k(a,"__xComboboxQuery");return $APP.n(C)?C:""}(),e=Jo($APP.k(a,"__xComboboxOptions"),d),g=function(){var C=$APP.k(a,"__xComboboxActiveIdx");return $APP.n(C)?C:0}();g=$APP.Hc(e)?-1:$APP.sh.i(g,$APP.z(e)-1);var h=function(){var C=a.getAttribute("value");return $APP.n(C)?C:""}();c.textContent="";if($APP.Hc(e))return d=Po("div"),d.setAttribute("part","empty-msg"),d.textContent="No matches",c.appendChild(d),
|
|
5
|
+
b.removeAttribute("aria-activedescendant");e=$APP.t($APP.Xd($APP.xh,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=Po("div");var y=""+$APP.T.g("x-cb-opt-")+$APP.T.g(v),A=Oo($APP.U.g(x),d);q.setAttribute("part","option");q.setAttribute("role","option");q.setAttribute("id",y);Qo(q,"data-value",$APP.Yi.g(x));$APP.B.i($APP.Yi.g(x),h)&&q.setAttribute("aria-selected","true");$APP.B.i(v,g)&&q.setAttribute("data-active","");$APP.n(A)?(q.appendChild(document.createTextNode(Lo.g(A))),
|
|
6
|
+
v=Po("b"),v.textContent=Mo.g(A),q.appendChild(v),q.appendChild(document.createTextNode(No.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=Po("div"),q=""+$APP.T.g("x-cb-opt-")+$APP.T.g(l),p=Oo($APP.U.g(v),d),m.setAttribute("part","option"),m.setAttribute("role","option"),m.setAttribute("id",q),Qo(m,"data-value",$APP.Yi.g(v)),$APP.B.i($APP.Yi.g(v),h)&&m.setAttribute("aria-selected",
|
|
7
|
+
"true"),$APP.B.i(l,g)&&m.setAttribute("data-active",""),$APP.n(p)?(m.appendChild(document.createTextNode(Lo.g(p))),l=Po("b"),l.textContent=Mo.g(p),m.appendChild(l),m.appendChild(document.createTextNode(No.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?Qo(b,"aria-activedescendant",""+$APP.T.g("x-cb-opt-")+$APP.T.g(g)):b.removeAttribute("aria-activedescendant")}return null},Uo=function(a){var b=$APP.k(a,"__xComboboxRefs");if($APP.n(b)){var c=new $APP.R(null,
|
|
8
|
+
7,[$APP.Dm,a.getAttribute("value"),$APP.Pi,a.getAttribute("placeholder"),$APP.zl,a.getAttribute("name"),$APP.Nl,a.hasAttribute("disabled"),$APP.Nh,a.hasAttribute("required"),$APP.Gi,a.hasAttribute("open"),$APP.hn,a.getAttribute("placement")],null),d=$APP.M(c),e=$APP.D(d,$APP.Dm),g=$APP.D(d,$APP.Pi),h=$APP.D(d,$APP.zl),l=$APP.D(d,$APP.Nl),m=$APP.D(d,$APP.Nh);c=$APP.D(d,$APP.Gi);d=$APP.D(d,$APP.hn);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(To,d)?
|
|
9
|
+
d:"bottom-start";g=$APP.M(new $APP.R(null,7,[$APP.Yi,e,$APP.rm,g,$APP.Aj,h,$APP.X,l,$APP.mi,m,$APP.Nm,c,$APP.Qj,d],null));c=$APP.D(g,$APP.Yi);d=$APP.D(g,$APP.rm);e=$APP.D(g,$APP.X);m=$APP.D(g,$APP.Nm);g=$APP.D(g,$APP.Qj);l=$APP.k(b,"input");b=$APP.k(b,"panel");h=Ko($APP.k(a,"__xComboboxOptions"),c);l.placeholder=d;l.disabled=e;Qo(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},Vo=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)},Wo=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},Yo=function(a,b){return $APP.r(a.hasAttribute("disabled"))&&$APP.r(a.hasAttribute("open"))&&Vo(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(),So(a),Xo.g?Xo.g(a):Xo.call(null,a)):null},$o=function(a,b){return $APP.n(a.hasAttribute("open"))&&Vo(a,{open:!1,source:b})?(a.removeAttribute("open"),a.__xComboboxQuery="",a.__xComboboxActiveIdx=0,Zo.g?Zo.g(a):Zo.call(null,a),Uo(a)):null},ap=function(a,b,c){a.setAttribute("value",b);var d=$APP.k(a,"__xComboboxRefs");$APP.n(d)&&($APP.k(d,"input").value=c);$o(a,"select");return Wo(a,"x-combobox-change",{value:b,label:c})},bp=function(a,
|
|
12
|
+
b){var c=Jo($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.B.i(b,$APP.Tj)?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;So(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},cp=function(a){var b=
|
|
13
|
+
Jo($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)?ap(a,$APP.Yi.g(b),$APP.U.g(b)):null},dp=function(a){return{slotchange:function(){Ro(a);return $APP.n(a.hasAttribute("open"))?So(a):null},inputFocus:function(){return Yo(a,"focus")},inputInput:function(b){b=b.target.value;a.__xComboboxQuery=b;a.__xComboboxActiveIdx=0;$APP.n(a.hasAttribute("open"))||
|
|
14
|
+
Yo(a,"input");So(a);return Wo(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 ap(a,c,b.textContent)}return null},inputKeydown:function(b){var c=b.key;if($APP.B.i(c,"ArrowDown"))return b.preventDefault(),$APP.n(a.hasAttribute("open"))?bp(a,$APP.Tj):Yo(a,"keyboard");if($APP.B.i(c,"ArrowUp"))return b.preventDefault(),$APP.n(a.hasAttribute("open"))?bp(a,$APP.Nj):
|
|
15
|
+
Yo(a,"keyboard");if($APP.B.i(c,"Enter"))return b.preventDefault(),$APP.n(a.hasAttribute("open"))?cp(a):null;if($APP.B.i(c,"Escape")){if($APP.n(a.hasAttribute("open")))return b.preventDefault(),$o(a,"escape"),b=$APP.k(a,"__xComboboxRefs"),$APP.n(b)?$APP.k(b,"input").focus():null}else if($APP.B.i(c,"Home")){if($APP.n(a.hasAttribute("open")))return b.preventDefault(),a.__xComboboxActiveIdx=0,So(a)}else if($APP.B.i(c,"End")&&$APP.n(a.hasAttribute("open")))return b.preventDefault(),b=$APP.k(a,"__xComboboxQuery"),
|
|
16
|
+
b=$APP.z(Jo($APP.k(a,"__xComboboxOptions"),$APP.n(b)?b:"")),b=$APP.oh.i(0,b-1),a.__xComboboxActiveIdx=b,So(a);return null},docClick:function(b){return $APP.n(a.hasAttribute("open"))?(b=$APP.vc(b.composedPath()),b=$APP.Td(function(c){return c===a},b),$APP.n(b)?null:$o(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 Wo(a,"x-combobox-change",{value:"",label:""})},chevronPointerdown:function(b){b.preventDefault();if($APP.n(a.hasAttribute("open")))return $o(a,"pointer");Yo(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))?$o(a,"focusout"):null):null}}},ep=function(a){var b=$APP.k(a,"__xComboboxRefs");if($APP.n(b)){var c=$APP.k(a,"__xComboboxHandlers");
|
|
18
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"))}}},
|
|
20
|
-
|
|
21
|
-
"observedAttributes",{get:function(){return
|
|
22
|
-
l=
|
|
19
|
+
$APP.k(c,"panelClick"));a.removeEventListener("focusout",$APP.k(c,"focusout"));b.removeEventListener("slotchange",$APP.k(c,"slotchange"))}}},Xo=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},Zo=function(a){a=$APP.k(a,"__xComboboxHandlers");return $APP.n(a)?document.removeEventListener("click",$APP.k(a,"docClick")):null},
|
|
20
|
+
fp=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))}})},gp=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)}})},jp=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,
|
|
21
|
+
"observedAttributes",{get:function(){return hp}});gp(b,"value","value");gp(b,"placeholder","placeholder");gp(b,"name","name");gp(b,"placement","placement");fp(b,"disabled","disabled");fp(b,"required","required");fp(b,"open","open");b.show=function(){return Yo(this,"programmatic")};b.hide=function(){return $o(this,"programmatic")};b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xComboboxRefs"))){var c=this.attachShadow({mode:"open"}),d=Po("style"),e=Po("div"),g=Po("input"),h=Po("button"),
|
|
22
|
+
l=Po("span"),m=Po("div"),p=Po("slot");var q=$APP.k(ip,"n")+1;ip.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
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
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}}
|
|
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"))));
|
|
27
|
-
function(){
|
|
28
|
-
$APP.Pd(["x-combobox-change",new $APP.R(null,2,[$APP.
|
|
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}}ep(this);Zo(this);this.__xComboboxHandlers=dp(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"))));Ro(this);return Uo(this)};b.disconnectedCallback=
|
|
27
|
+
function(){ep(this);return Zo(this)};b.attributeChangedCallback=function(c){$APP.n($APP.k(this,"__xComboboxRefs"))?(Uo(this),c=$APP.B.i(c,"open")?$APP.n(this.hasAttribute("open"))?Xo(this):Zo(this):null):c=null;return c};return a},kp=function(){return $APP.n(customElements.get("x-combobox"))?null:customElements.define("x-combobox",jp())},Mo=new $APP.K(null,"match","match",1220059550),No=new $APP.K(null,"after","after",594996914),Lo=new $APP.K(null,"before","before",-1633692388);var To=new $APP.S(null,new $APP.R(null,4,["bottom-start",null,"bottom-end",null,"top-end",null,"top-start",null],null),null),hp="value placeholder name disabled required open placement".split(" ");
|
|
28
|
+
$APP.Pd(["x-combobox-change",new $APP.R(null,2,[$APP.km,!1,$APP.V,new $APP.R(null,2,[$APP.Yi,$APP.Y,$APP.U,$APP.Y],null)],null),"x-combobox-input",new $APP.R(null,2,[$APP.km,!1,$APP.V,new $APP.R(null,1,[$APP.Ii,$APP.Y],null)],null),"x-combobox-toggle",new $APP.R(null,2,[$APP.km,!0,$APP.V,new $APP.R(null,2,[$APP.hm,$APP.Zj,$APP.rl,$APP.Y],null)],null)]);var ip={n:0};$APP.ha("baredom.exports.x_combobox.init",kp);export const init=kp;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// x-command-palette.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
+
|
|
3
|
+
export function init(): void;
|
|
4
|
+
|
|
5
|
+
export interface XCommandPaletteEventMap {
|
|
6
|
+
"x-command-palette-open-request": CustomEvent<{}>;
|
|
7
|
+
"x-command-palette-open": CustomEvent<{}>;
|
|
8
|
+
"x-command-palette-close-request": CustomEvent<{}>;
|
|
9
|
+
"x-command-palette-close": CustomEvent<{}>;
|
|
10
|
+
"x-command-palette-select-request": CustomEvent<{ item: Record<string, any> }>;
|
|
11
|
+
"x-command-palette-select": CustomEvent<{ item: Record<string, any> }>;
|
|
12
|
+
"x-command-palette-query-change": CustomEvent<{ query: string }>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface XCommandPalette extends HTMLElement {
|
|
16
|
+
items: any;
|
|
17
|
+
open: boolean;
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
|
|
20
|
+
addEventListener<K extends keyof XCommandPaletteEventMap>(
|
|
21
|
+
type: K,
|
|
22
|
+
listener: (this: XCommandPalette, ev: XCommandPaletteEventMap[K]) => any,
|
|
23
|
+
options?: boolean | AddEventListenerOptions
|
|
24
|
+
): void;
|
|
25
|
+
addEventListener(
|
|
26
|
+
type: string,
|
|
27
|
+
listener: EventListenerOrEventListenerObject,
|
|
28
|
+
options?: boolean | AddEventListenerOptions
|
|
29
|
+
): void;
|
|
30
|
+
removeEventListener<K extends keyof XCommandPaletteEventMap>(
|
|
31
|
+
type: K,
|
|
32
|
+
listener: (this: XCommandPalette, ev: XCommandPaletteEventMap[K]) => any,
|
|
33
|
+
options?: boolean | EventListenerOptions
|
|
34
|
+
): void;
|
|
35
|
+
removeEventListener(
|
|
36
|
+
type: string,
|
|
37
|
+
listener: EventListenerOrEventListenerObject,
|
|
38
|
+
options?: boolean | EventListenerOptions
|
|
39
|
+
): void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare global {
|
|
43
|
+
interface HTMLElementTagNameMap {
|
|
44
|
+
"x-command-palette": XCommandPalette;
|
|
45
|
+
}
|
|
46
|
+
}
|