@vanelsas/baredom 3.11.0 → 3.12.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 +15 -0
- package/custom-elements.json +10694 -10660
- package/dist/baredom.d.ts +93 -93
- package/dist/base.js +598 -598
- package/dist/integrity.json +111 -111
- package/dist/x-alert.js +16 -16
- package/dist/x-avatar-group.js +9 -9
- package/dist/x-avatar.js +14 -14
- package/dist/x-badge.js +8 -8
- package/dist/x-bento-grid.js +5 -5
- package/dist/x-bento-item.js +4 -4
- package/dist/x-breadcrumbs.js +13 -13
- package/dist/x-button.js +1 -1
- package/dist/x-calendar.js +34 -34
- package/dist/x-cancel-dialogue.js +12 -12
- package/dist/x-card.js +7 -7
- package/dist/x-carousel.js +31 -31
- package/dist/x-chart.js +44 -44
- package/dist/x-checkbox.js +1 -1
- package/dist/x-chip.js +1 -1
- package/dist/x-code.js +27 -27
- package/dist/x-collapse.js +8 -8
- package/dist/x-color-picker.js +34 -34
- package/dist/x-combobox.js +31 -31
- package/dist/x-command-palette.js +27 -27
- package/dist/x-confetti.js +23 -23
- package/dist/x-container.js +4 -4
- package/dist/x-context-menu.js +19 -19
- package/dist/x-copy.js +1 -1
- package/dist/x-currency-field.js +21 -21
- package/dist/x-date-picker.js +34 -34
- package/dist/x-divider.js +9 -9
- package/dist/x-drag-panel.js +31 -31
- package/dist/x-drawer.js +9 -9
- package/dist/x-drop-zone.js +11 -11
- package/dist/x-dropdown.js +12 -12
- package/dist/x-fieldset.js +5 -5
- package/dist/x-file-download.d.ts +4 -0
- package/dist/x-file-download.js +14 -6
- package/dist/x-file-upload.js +23 -23
- package/dist/x-floating-panel.js +21 -21
- package/dist/x-form-field.js +14 -14
- package/dist/x-form.js +10 -10
- package/dist/x-gaussian-blur.js +11 -11
- package/dist/x-grid.js +6 -6
- package/dist/x-i18n-provider.js +7 -7
- package/dist/x-i18n.js +4 -4
- package/dist/x-icon.js +7 -7
- package/dist/x-image.js +16 -16
- package/dist/x-kbd.js +11 -11
- package/dist/x-kinetic-canvas.js +24 -24
- package/dist/x-kinetic-font.js +22 -22
- package/dist/x-kinetic-typography.js +29 -29
- package/dist/x-liquid-dock.js +29 -29
- package/dist/x-liquid-fill.js +38 -38
- package/dist/x-liquid-glass.js +25 -25
- package/dist/x-menu-item.js +8 -8
- package/dist/x-menu.js +8 -8
- package/dist/x-metaball-cursor.js +18 -18
- package/dist/x-modal.js +10 -10
- package/dist/x-morph-stack.js +37 -37
- package/dist/x-multi-combobox.js +37 -37
- package/dist/x-navbar.js +13 -13
- package/dist/x-neural-glow.js +21 -21
- package/dist/x-notification-center.js +9 -9
- package/dist/x-organic-divider.js +15 -15
- package/dist/x-organic-progress.js +32 -32
- package/dist/x-organic-shape.js +7 -7
- package/dist/x-otp-input.js +20 -20
- package/dist/x-pagination.js +11 -11
- package/dist/x-particle-button.js +39 -39
- package/dist/x-popover.js +24 -24
- package/dist/x-progress-circle.js +6 -6
- package/dist/x-progress.js +6 -6
- package/dist/x-proximity-list.js +20 -20
- package/dist/x-radio.js +12 -12
- package/dist/x-range-slider.js +27 -27
- package/dist/x-rating.js +22 -22
- package/dist/x-ripple-effect.js +8 -8
- package/dist/x-scroll-parallax.js +17 -17
- package/dist/x-scroll-stack.js +15 -15
- package/dist/x-scroll-story.js +30 -30
- package/dist/x-scroll-timeline.js +45 -45
- package/dist/x-scroll.js +34 -34
- package/dist/x-search-field.js +1 -1
- package/dist/x-select.js +1 -1
- package/dist/x-sidebar.js +15 -15
- package/dist/x-skeleton-group.js +12 -12
- package/dist/x-skeleton.js +1 -1
- package/dist/x-slider.js +16 -16
- package/dist/x-soft-body.js +16 -16
- package/dist/x-spacer.js +4 -4
- package/dist/x-spinner.js +4 -4
- package/dist/x-splash.js +11 -11
- package/dist/x-split-pane.js +14 -14
- package/dist/x-spotlight-card.js +11 -11
- package/dist/x-stat.js +8 -8
- package/dist/x-stepper.js +13 -13
- package/dist/x-switch.js +11 -11
- package/dist/x-tab.js +6 -6
- package/dist/x-table-cell.js +17 -17
- package/dist/x-table-row.js +8 -8
- package/dist/x-table.js +12 -12
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +18 -18
- package/dist/x-theme.js +24 -24
- package/dist/x-timeline-item.js +18 -18
- package/dist/x-timeline.js +8 -8
- package/dist/x-toast.js +20 -20
- package/dist/x-toaster.js +6 -6
- package/dist/x-tooltip.js +11 -11
- package/dist/x-trace-history.js +112 -112
- package/dist/x-typography.js +5 -5
- package/dist/x-welcome-tour.js +57 -57
- package/package.json +1 -1
package/dist/x-divider.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var R0=function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.
|
|
3
|
-
$APP.S(d,"part","container");var f=document.createElement("div");$APP.S(f,"part","line");d.appendChild(f);b.appendChild(c);b.appendChild(d);e.root=b;e.container=d;e.mode="no-label";$APP.Q(a,"__xDividerRefs",e);a=e}return a},Y0=function(a){if($APP.n($APP.l(a,"__xDividerRefs"))){var b=$APP.
|
|
4
|
-
a.getAttribute("inset"),a.getAttribute("orientation"),a.getAttribute("aria-label"),a.getAttribute("role")]);var c=$APP.G(b);b=$APP.C(c,$APP.
|
|
5
|
-
b,$APP.
|
|
6
|
-
k:"auto");$APP.n(f)?m.setProperty("--x-divider-color",f):m.removeProperty("--x-divider-color");h=$APP.G(b);e=$APP.C(h,$APP.
|
|
7
|
-
e=$APP.C(f,$APP.
|
|
8
|
-
m.appendChild(r),m.appendChild(u),h.appendChild(k),h.appendChild(m),h.appendChild(c),d["line-left"]=k,d["label-wrap"]=m,d["label-text"]=u,d["line-right"]=c,d.mode="label"):(k=document.createElement("div"),$APP.S(k,"part","line"),h.appendChild(k),d["line-left"]=null,d["label-wrap"]=null,d["label-text"]=null,d["line-right"]=null,d.mode="no-label")}$APP.n(e)&&(d=$APP.l(d,"label-text"),$APP.n(d)&&(d.textContent=f));a=$APP.Q(a,"__xDividerModel",b)}else a=null;return a}return null},
|
|
9
|
-
return Y0(a)},
|
|
10
|
-
3,[$APP.N,$APP.X,$APP.W,"variant",$APP.
|
|
2
|
+
var R0=function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.dd(a,c)?c:b},S0=function(a){var b=$APP.l(a,"__xDividerRefs");if($APP.n(b))a=b;else{b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e={};c.textContent=":host{display:block;color-scheme:light dark;--x-divider-color:rgba(0,0,0,0.12);--x-divider-thickness:1px;--x-divider-inset:0px;--x-divider-length:auto;}@media (prefers-color-scheme:dark){:host{--x-divider-color:rgba(255,255,255,0.15);}}[part\x3dcontainer]{display:flex;align-items:center;width:var(--x-divider-length,auto);box-sizing:border-box;}:host([data-orientation\x3d'vertical']) [part\x3dcontainer]{flex-direction:column;height:var(--x-divider-length,auto);width:auto;}[part\x3dline],[part\x3dline-left],[part\x3dline-right]{flex:1;border:none;background:var(--x-divider-color,rgba(0,0,0,0.12));height:var(--x-divider-thickness,1px);margin:var(--x-divider-inset,0px) 0;}:host([data-orientation\x3d'vertical']) [part\x3dline],:host([data-orientation\x3d'vertical']) [part\x3dline-left],:host([data-orientation\x3d'vertical']) [part\x3dline-right]{width:var(--x-divider-thickness,1px);height:auto;margin:0 var(--x-divider-inset,0px);}:host([data-variant\x3d'dashed']) [part\x3dline],:host([data-variant\x3d'dashed']) [part\x3dline-left],:host([data-variant\x3d'dashed']) [part\x3dline-right]{background:none;height:0;border-top:var(--x-divider-thickness,1px) dashed var(--x-divider-color,rgba(0,0,0,0.12));}:host([data-orientation\x3d'vertical'][data-variant\x3d'dashed']) [part\x3dline],:host([data-orientation\x3d'vertical'][data-variant\x3d'dashed']) [part\x3dline-left],:host([data-orientation\x3d'vertical'][data-variant\x3d'dashed']) [part\x3dline-right]{border-top:none;border-left:var(--x-divider-thickness,1px) dashed var(--x-divider-color,rgba(0,0,0,0.12));width:0;height:auto;}:host([data-variant\x3d'dotted']) [part\x3dline],:host([data-variant\x3d'dotted']) [part\x3dline-left],:host([data-variant\x3d'dotted']) [part\x3dline-right]{background:none;height:0;border-top:var(--x-divider-thickness,1px) dotted var(--x-divider-color,rgba(0,0,0,0.12));}:host([data-orientation\x3d'vertical'][data-variant\x3d'dotted']) [part\x3dline],:host([data-orientation\x3d'vertical'][data-variant\x3d'dotted']) [part\x3dline-left],:host([data-orientation\x3d'vertical'][data-variant\x3d'dotted']) [part\x3dline-right]{border-top:none;border-left:var(--x-divider-thickness,1px) dotted var(--x-divider-color,rgba(0,0,0,0.12));width:0;height:auto;}[part\x3dlabel]{display:flex;align-items:center;flex-shrink:0;padding:0 0.75em;font-size:0.75rem;font-weight:500;color:var(--x-divider-color);white-space:nowrap;}:host([data-orientation\x3d'vertical']) [part\x3dlabel]{padding:0.75em 0;writing-mode:horizontal-tb;}[part\x3dlabel-text]{display:inline;}:host([data-align\x3d'start']) [part\x3dline-left]{flex:0 0 1rem;}:host([data-align\x3d'end']) [part\x3dline-right]{flex:0 0 1rem;}@media (prefers-reduced-motion:reduce){*{transition:none !important;animation:none !important;}}";
|
|
3
|
+
$APP.S(d,"part","container");var f=document.createElement("div");$APP.S(f,"part","line");d.appendChild(f);b.appendChild(c);b.appendChild(d);e.root=b;e.container=d;e.mode="no-label";$APP.Q(a,"__xDividerRefs",e);a=e}return a},Y0=function(a){if($APP.n($APP.l(a,"__xDividerRefs"))){var b=$APP.wg([$APP.eu,$APP.Pj,$APP.ir,$APP.Ns,T0,$APP.dw,U0,$APP.Ku,$APP.bm,V0],[a.getAttribute("variant"),a.getAttribute("label"),a.getAttribute("align"),a.getAttribute("length"),a.getAttribute("thickness"),a.getAttribute("color"),
|
|
4
|
+
a.getAttribute("inset"),a.getAttribute("orientation"),a.getAttribute("aria-label"),a.getAttribute("role")]);var c=$APP.G(b);b=$APP.C(c,$APP.bm);var d=$APP.C(c,V0),e=$APP.C(c,$APP.Pj),f=$APP.C(c,$APP.eu),h=$APP.C(c,$APP.ir),k=$APP.C(c,$APP.Ns),m=$APP.C(c,T0),r=$APP.C(c,$APP.dw),u=$APP.C(c,U0);c=$APP.C(c,$APP.Ku);b=$APP.wg([$APP.pq,$APP.Pr,W0,X0,$APP.fs,$APP.An,$APP.au,$APP.Z,$APP.Bs,$APP.km],[d,R0(Oqa,"center",h),m,u,r,R0(Pqa,"solid",f),R0(Qqa,"horizontal",c),e,k,b]);d=$APP.$g.m;e=$APP.Z.i(b);b=d.call($APP.$g,
|
|
5
|
+
b,$APP.mu,typeof e==="string"&&e.trim().length>0);if($APP.I($APP.l(a,"__xDividerModel"),b)){d=S0(a);h=$APP.G(b);e=$APP.C(h,$APP.au);f=$APP.C(h,$APP.An);h=$APP.C(h,$APP.Pr);$APP.S(a,"data-orientation",e);$APP.S(a,"data-variant",f);$APP.S(a,"data-align",h);k=$APP.G(b);e=$APP.C(k,W0);f=$APP.C(k,$APP.fs);h=$APP.C(k,X0);k=$APP.C(k,$APP.Bs);m=a.style;m.setProperty("--x-divider-thickness",$APP.n(e)?e:"1px");m.setProperty("--x-divider-inset",$APP.n(h)?h:"0px");m.setProperty("--x-divider-length",$APP.n(k)?
|
|
6
|
+
k:"auto");$APP.n(f)?m.setProperty("--x-divider-color",f):m.removeProperty("--x-divider-color");h=$APP.G(b);e=$APP.C(h,$APP.au);f=$APP.C(h,$APP.km);h=$APP.C(h,$APP.pq);$APP.dd(new $APP.ch(null,new $APP.M(null,2,["none",null,"presentation",null],null),null),h)?$APP.S(a,"role","presentation"):$APP.S(a,"role","separator");$APP.z.j(e,"vertical")?$APP.S(a,"aria-orientation","vertical"):$APP.U(a,"aria-orientation");$APP.n($APP.n(f)?f.length>0:f)?$APP.S(a,"aria-label",f):$APP.U(a,"aria-label");f=$APP.G(b);
|
|
7
|
+
e=$APP.C(f,$APP.mu);f=$APP.C(f,$APP.Z);k=$APP.n(e)?"label":"no-label";if($APP.I($APP.l(d,"mode"),k)){for(h=$APP.l(d,"container");;)if(m=h.firstChild,$APP.n(m))h.removeChild(m);else break;$APP.z.j(k,"label")?(k=document.createElement("div"),m=document.createElement("span"),r=document.createElement("slot"),u=document.createElement("span"),c=document.createElement("div"),$APP.S(k,"part","line-left"),$APP.S(m,"part","label"),$APP.S(r,"name","label"),$APP.S(u,"part","label-text"),$APP.S(c,"part","line-right"),
|
|
8
|
+
m.appendChild(r),m.appendChild(u),h.appendChild(k),h.appendChild(m),h.appendChild(c),d["line-left"]=k,d["label-wrap"]=m,d["label-text"]=u,d["line-right"]=c,d.mode="label"):(k=document.createElement("div"),$APP.S(k,"part","line"),h.appendChild(k),d["line-left"]=null,d["label-wrap"]=null,d["label-text"]=null,d["line-right"]=null,d.mode="no-label")}$APP.n(e)&&(d=$APP.l(d,"label-text"),$APP.n(d)&&(d.textContent=f));a=$APP.Q(a,"__xDividerModel",b)}else a=null;return a}return null},Rqa=function(a){S0(a);
|
|
9
|
+
return Y0(a)},Sqa=function(a,b,c,d){return $APP.I(c,d)?Y0(a):null},Uqa=function(a){return $APP.uj(a,Tqa)},Z0=function(){return $APP.si("x-divider",new $APP.M(null,4,[$APP.ji,Vqa,$APP.hi,Rqa,$APP.di,Sqa,$APP.ii,Uqa],null))},U0=new $APP.F(null,"inset-raw","inset-raw",89351124),X0=new $APP.F(null,"inset","inset",-396367740),V0=new $APP.F(null,"role-raw","role-raw",777951354),W0=new $APP.F(null,"thickness","thickness",-940175454),T0=new $APP.F(null,"thickness-raw","thickness-raw",1843812655);var Vqa="orientation variant thickness color inset length label align role aria-label".split(" "),Qqa=new $APP.ch(null,new $APP.M(null,2,["vertical",null,"horizontal",null],null),null),Pqa=new $APP.ch(null,new $APP.M(null,3,["dashed",null,"dotted",null,"solid",null],null),null),Oqa=new $APP.ch(null,new $APP.M(null,3,["center",null,"start",null,"end",null],null),null),Tqa=new $APP.M(null,8,[$APP.au,new $APP.M(null,3,[$APP.N,$APP.X,$APP.W,"orientation",$APP.tj,"horizontal"],null),$APP.An,new $APP.M(null,
|
|
10
|
+
3,[$APP.N,$APP.X,$APP.W,"variant",$APP.tj,"solid"],null),$APP.Pr,new $APP.M(null,3,[$APP.N,$APP.X,$APP.W,"align",$APP.tj,"center"],null),$APP.Z,new $APP.M(null,2,[$APP.N,$APP.X,$APP.W,"label"],null),W0,new $APP.M(null,2,[$APP.N,$APP.X,$APP.W,"thickness"],null),$APP.fs,new $APP.M(null,2,[$APP.N,$APP.X,$APP.W,"color"],null),X0,new $APP.M(null,2,[$APP.N,$APP.X,$APP.W,"inset"],null),$APP.Bs,new $APP.M(null,2,[$APP.N,$APP.X,$APP.W,"length"],null)],null);$APP.ha("baredom.exports.x_divider.init",Z0);export const init=Z0;
|
package/dist/x-drag-panel.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var WH=function(a){return typeof a==="string"&&$APP.I(a,"")?a:"Draggable panel"},
|
|
3
|
-
($APP.n(b)?b:0)},a))},ZH=function(a,b){return{kind:a,value:b}},$H=function(a){$APP.U(a,"data-drag-state")},aI=function(a){a=a.getAttribute("kind");return $APP.n(a)?a:""},bI=function(a){a=a.getAttribute("value");return $APP.n(a)?a:""},cI=function(a,b){$APP.
|
|
4
|
-
(b==null||$APP.
|
|
5
|
-
b);a=$APP.
|
|
6
|
-
e=document.createElement("div"),f=document.createElement("span"),h=document.createElement("slot");$APP.S(e,"part","handle");$APP.S(e,"role","button");$APP.S(e,"tabindex","0");$APP.S(f,"part","grip");$APP.S(f,"aria-hidden","true");f.textContent="⠿";$APP.S(h,"name","header");e.appendChild(f);e.appendChild(h);e=$APP.l({handle:e},"handle");f=document.createElement("div");h=document.createElement("slot");$APP.S(f,"part","body");f.appendChild(h);c.textContent=
|
|
7
|
-
d.appendChild(f);b.appendChild(c);b.appendChild(d);$APP.Q(a,"__xDragPanelRefs",{host:a,panel:d,handle:e,window});$APP.
|
|
8
|
-
new $APP.M(null,7,[$APP.
|
|
9
|
-
$APP.
|
|
10
|
-
"-1":"0"),$APP.n(c)?$APP.S(f,"aria-busy","true"):$APP.U(f,"aria-busy"));a=$APP.Q(a,"__xDragPanelModel",b)}else a=null;return a},
|
|
11
|
-
[$APP.
|
|
12
|
-
c=$APP.n(b)?c.overflowY:c.overflowX;var d=$APP.n(b)?a.scrollHeight:a.scrollWidth,e=$APP.n(b)?a.clientHeight:a.clientWidth;if(($APP.z.j(c,"auto")||$APP.z.j(c,"scroll")||$APP.z.j(c,"overlay"))&&d>e+1)return a;a=a.parentElement}},pI=function(a,b,c,d){if($APP.n(a)){if(a===document.scrollingElement)var e=$APP.n(c)?new $APP.M(null,2,[$APP.
|
|
13
|
-
e.top,$APP.
|
|
14
|
-
$APP.
|
|
15
|
-
"horizontal"),b,!1,c)}}},
|
|
16
|
-
requestAnimationFrame(function(b){return rI(a,b)}))},sI=function(a){var b=$APP.l(a,"__xDragPanelRaf");$APP.n(b)&&cancelAnimationFrame(b);$APP
|
|
17
|
-
$APP.
|
|
18
|
-
b.style.setProperty("height",e);b.style.setProperty("margin","0");$APP.S(a,"data-dragging","");$APP.
|
|
19
|
-
c,$APP
|
|
20
|
-
$APP.
|
|
21
|
-
(b=$APP.A(AI.i(b),$APP.
|
|
22
|
-
(h=$APP.l(a,"__xDragPanelDrag")==null)&&(h=$APP.
|
|
23
|
-
e,$APP.
|
|
24
|
-
a=zI(a,c,0)):a=null,a;if($APP.n($APP.n(d)?$APP.z.j(c,"ArrowDown")||$APP.z.j(c,"ArrowRight"):d))return b.preventDefault(),CI(a,1);if($APP.n($APP.n(d)?$APP.z.j(c,"ArrowUp")||$APP.z.j(c,"ArrowLeft"):d))return b.preventDefault(),CI(a,-1);if($APP.n($APP.n(d)?$APP.z.j(c,"Enter"):d)){b.preventDefault();a:{c=$APP.l(a,"__xDragPanelKeyboard");if($APP.n(c)&&(b=lI(a),c=$APP.A(AI.i(c),$APP.
|
|
25
|
-
$H(c);gI(c,a,d,e);$APP.
|
|
26
|
-
f=$APP.l(a,"__xDragPanelPress");if($APP.n(f)){f=$APP.
|
|
27
|
-
function(c){uI(a);var d=$APP.l(a,"__xDragPanelDrag");if($APP.n(d))if($APP.z.j($APP.
|
|
28
|
-
YH($APP.
|
|
29
|
-
$APP.A(k,0,null),r=$APP.A(k,1,null),u=$APP.A(k,2,null);k=$APP.A(k,3,null);var x=$APP.l(c,m),y=$APP.l(a,u);$APP.n(function(){var H=x;return $APP.n(H)?y:H}())&&($APP.n(b)?x.addEventListener(r,y,k):x.removeEventListener(r,y,k));h+=1}else if(d=$APP.q(d)){if($APP
|
|
30
|
-
B.addEventListener(r,E,k):B.removeEventListener(r,E,k));d=$APP.v(d);e=null;f=0}h=0}else return null;else return null},
|
|
31
|
-
|
|
2
|
+
var WH=function(a){return typeof a==="string"&&$APP.I(a,"")?a:"Draggable panel"},Lea=function(a){var b=$APP.G(a);a=$APP.C(b,$APP.zr);b=$APP.C(b,$APP.Yr);return $APP.D($APP.z.j(a,"touch")&&$APP.z.j(b,"surface"))},XH=function(a,b){return{kind:a,value:b}},YH=function(a,b,c){return{kind:a,value:b,reason:c}},Mea=function(a){return $APP.He(function(b){var c=$APP.G(b);b=$APP.C(c,$APP.fl);c=$APP.C(c,$APP.gl);return(($APP.n(b)?b:0)+($APP.n(c)?c:0))/2},a)},Nea=function(a,b){return $APP.w($APP.Ee(function(c){return c<
|
|
3
|
+
($APP.n(b)?b:0)},a))},ZH=function(a,b){return{kind:a,value:b}},$H=function(a){$APP.U(a,"data-drag-state")},aI=function(a){a=a.getAttribute("kind");return $APP.n(a)?a:""},bI=function(a){a=a.getAttribute("value");return $APP.n(a)?a:""},cI=function(a,b){$APP.jl(a);var c=$APP.Ql(a);a=$APP.$g.B(c,$APP.ct,aI(b),$APP.Ec([$APP.kt,$APP.w($APP.nl($APP.ml(a),b))]));var d=$APP.G(a);a=$APP.C(d,$APP.Xj);b=$APP.C(d,$APP.Kl);c=$APP.C(d,$APP.Ll);var e=$APP.C(d,$APP.kt);d=$APP.C(d,$APP.ct);return $APP.D($APP.p(a)&&
|
|
4
|
+
(b==null||$APP.dd(b,d))&&(c==null||($APP.n(e)?e:0)<c))},dI=function(a,b){$APP.jl(a);var c=cI(a,b);$APP.Q(a,"__xDropZoneHover",new $APP.M(null,3,[$APP.Wl,b,$APP.Ul,c,$APP.Vl,0],null));$APP.S(a,"data-drag-state",$APP.n(c)?"over":"reject");$APP.fj(a,"x-drop-zone-enter",ZH(aI(b),bI(b)));$APP.Xl(a)},eI=function(a,b){$APP.n($APP.l(a,"__xDropZoneHover"))&&($APP.Q(a,"__xDropZoneHover",null),$H(a),$APP.fj(a,"x-drop-zone-leave",ZH(aI(b),bI(b))),$APP.Xl(a))},fI=function(a,b,c,d){var e=$APP.ol(a);a=$APP.nl($APP.ml(a),
|
|
5
|
+
b);a=$APP.pl(a,e);return Nea(Mea(a),e?d:c)},gI=function(a,b,c,d){$APP.Q(a,"__xDropZoneLastDrop",new $APP.M(null,2,[$APP.Wl,b,$APP.Z,WH(b.getAttribute("label"))],null));var e=aI(b),f=bI(b);c=$APP.n(c)?$APP.el(c.getAttribute("value")):null;var h=$APP.Ui.i($APP.Ql(a));$APP.fj(a,"x-drop-zone-drop",{kind:e,value:f,from:c,to:h,index:d,panel:b})},hI=function(a){if(!$APP.Vi(a,"__xDragPanelInitialized")){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),
|
|
6
|
+
e=document.createElement("div"),f=document.createElement("span"),h=document.createElement("slot");$APP.S(e,"part","handle");$APP.S(e,"role","button");$APP.S(e,"tabindex","0");$APP.S(f,"part","grip");$APP.S(f,"aria-hidden","true");f.textContent="⠿";$APP.S(h,"name","header");e.appendChild(f);e.appendChild(h);e=$APP.l({handle:e},"handle");f=document.createElement("div");h=document.createElement("slot");$APP.S(f,"part","body");f.appendChild(h);c.textContent=Oea;$APP.S(d,"part","panel");d.appendChild(e);
|
|
7
|
+
d.appendChild(f);b.appendChild(c);b.appendChild(d);$APP.Q(a,"__xDragPanelRefs",{host:a,panel:d,handle:e,window});$APP.Wi(a,"__xDragPanelInitialized")}},iI=function(a,b){a=$APP.l(a,"__xDragPanelRefs");return $APP.n(a)?$APP.l(a,b):null},jI=function(a,b){var c=$APP.l(a,"__xDragPanelLive");if($APP.n(c))a=c;else{c=a.shadowRoot;var d=document.createElement("span");$APP.S(d,"aria-live","polite");$APP.S(d,"class","sr-only");c.appendChild(d);$APP.Q(a,"__xDragPanelLive",d);a=d}return a.textContent=b},kI=function(a){a=
|
|
8
|
+
new $APP.M(null,7,[$APP.jq,a.getAttribute("kind"),$APP.Nj,a.getAttribute("value"),$APP.Pj,a.getAttribute("label"),$APP.vv,a.getAttribute("grab"),$APP.iq,a.getAttribute("auto-scroll"),$APP.Qj,a.hasAttribute("disabled"),$APP.Hl,a.hasAttribute("pending")],null);var b=$APP.G(a);a=$APP.C(b,$APP.jq);var c=$APP.C(b,$APP.Nj),d=$APP.C(b,$APP.Pj),e=$APP.C(b,$APP.vv),f=$APP.C(b,$APP.iq),h=$APP.C(b,$APP.Qj);b=$APP.C(b,$APP.Hl);h=$APP.D(h);b=$APP.D(b);return new $APP.M(null,8,[$APP.ct,typeof a==="string"?a:"",
|
|
9
|
+
$APP.Ui,typeof c==="string"?c:"",$APP.Z,WH(d),$APP.Yr,$APP.z.j(e,"surface")?"surface":"handle",$APP.Mu,$APP.z.j(f,"none")?"none":"auto",$APP.Xj,h,$APP.Ml,b,$APP.qt,$APP.D(!h&&!b)],null)},lI=function(a){var b=$APP.l(a,"__xDragPanelModel");return $APP.n(b)?b:kI(a)},mI=function(a){var b=kI(a);if($APP.I($APP.l(a,"__xDragPanelModel"),b)){hI(a);var c=$APP.G(b),d=$APP.C(c,$APP.Z),e=$APP.C(c,$APP.Xj);c=$APP.C(c,$APP.Ml);var f=iI(a,"handle");$APP.n(f)&&($APP.S(f,"aria-label",d),$APP.S(f,"tabindex",$APP.n(e)?
|
|
10
|
+
"-1":"0"),$APP.n(c)?$APP.S(f,"aria-busy","true"):$APP.U(f,"aria-busy"));a=$APP.Q(a,"__xDragPanelModel",b)}else a=null;return a},Pea=function(a,b){a=iI(a,"panel");var c=$APP.G(b);b=$APP.C(c,$APP.Tp);var d=$APP.C(c,$APP.Xp),e=$APP.G(c);c=$APP.C(e,$APP.It);var f=$APP.C(e,$APP.Ht),h=$APP.C(e,$APP.Cq);e=$APP.C(e,$APP.Dq);f=$APP.G(new $APP.M(null,2,[$APP.vu,($APP.n(c)?c:0)-($APP.n(h)?h:0),$APP.uu,($APP.n(f)?f:0)-($APP.n(e)?e:0)],null));c=$APP.C(f,$APP.vu);f=$APP.C(f,$APP.uu);d=$APP.G(new $APP.M(null,2,
|
|
11
|
+
[$APP.Ws,c-($APP.n(b)?b:0),$APP.Vs,f-($APP.n(d)?d:0)],null));b=$APP.C(d,$APP.Ws);d=$APP.C(d,$APP.Vs);b="translate("+$APP.P.i(b)+$APP.P.i("px")+","+$APP.P.i(d)+$APP.P.i("px")+") scale(var("+$APP.P.i("--x-drag-panel-lift-scale")+",1.02))";a.style.setProperty("transform",b)},nI=function(a,b){a=document.elementsFromPoint(a,b);return $APP.pe(function(c){return $APP.n(c.closest)?c.closest("x-drop-zone"):null},$APP.Ec(a))},oI=function(a,b){for(;;){if(a==null)return document.scrollingElement;var c=getComputedStyle(a);
|
|
12
|
+
c=$APP.n(b)?c.overflowY:c.overflowX;var d=$APP.n(b)?a.scrollHeight:a.scrollWidth,e=$APP.n(b)?a.clientHeight:a.clientWidth;if(($APP.z.j(c,"auto")||$APP.z.j(c,"scroll")||$APP.z.j(c,"overlay"))&&d>e+1)return a;a=a.parentElement}},pI=function(a,b,c,d){if($APP.n(a)){if(a===document.scrollingElement)var e=$APP.n(c)?new $APP.M(null,2,[$APP.hu,0,$APP.Rs,window.innerHeight],null):new $APP.M(null,2,[$APP.hu,0,$APP.Rs,window.innerWidth],null);else e=a.getBoundingClientRect(),e=$APP.n(c)?new $APP.M(null,2,[$APP.hu,
|
|
13
|
+
e.top,$APP.Rs,e.bottom],null):new $APP.M(null,2,[$APP.hu,e.left,$APP.Rs,e.right],null);var f=$APP.G(e);e=$APP.C(f,$APP.hu);f=$APP.C(f,$APP.Rs);var h=$APP.G(new $APP.M(null,3,[$APP.Pv,b,$APP.hu,e,$APP.Rs,f],null));b=$APP.C(h,$APP.Pv);e=$APP.C(h,$APP.hu);f=$APP.C(h,$APP.Rs);h=$APP.C(h,$APP.Zt);e=$APP.n(e)?e:0;f=$APP.n(f)?f:0;var k=f-e;h=$APP.n(h)?h:900;b==null||k<=0?b=0:(k=$APP.Sl.j(48,.15*$APP.Rl.j(0,$APP.n(k)?k:0)),e=b-e,b=f-b,b=e<b?-(h*(k<=0?0:$APP.Rl.j(0,$APP.Sl.j(1,(k-e)/k)))):h*(k<=0?0:$APP.Rl.j(0,
|
|
14
|
+
$APP.Sl.j(1,(k-b)/k))));d=($APP.n(b)?b:0)*($APP.n(d)?d:0)/1E3;$APP.I(0,d)&&($APP.n(c)?a.scrollTop+=d:a.scrollLeft+=d)}},Qea=function(a,b,c){if($APP.z.j("auto",$APP.Mu.i(lI(a)))){var d=$APP.G(b);b=$APP.C(d,$APP.It);d=$APP.C(d,$APP.Ht);var e=document.elementsFromPoint(b,d)[0];if($APP.n(e)){var f=$APP.l(a,"__xDragPanelScrollers");$APP.n($APP.n(f)?e===$APP.l(f,"hit"):f)?a=f:(e={hit:e,vertical:oI(e,!0),horizontal:oI(e,!1)},$APP.$i(a,"__xDragPanelScrollers",e),a=e);pI($APP.l(a,"vertical"),d,!0,c);pI($APP.l(a,
|
|
15
|
+
"horizontal"),b,!1,c)}}},Rea=function(a,b){var c=$APP.G(b),d=$APP.C(c,$APP.It),e=$APP.C(c,$APP.Ht);c=nI(d,e);b=qI.i(b);b!==c&&($APP.n(b)&&eI(b,a),$APP.n(c)&&dI(c,a));$APP.n(c)&&(b=$APP.l(c,"__xDropZoneHover"),$APP.n(b)&&$APP.n($APP.Ul.i(b))&&(d=fI(c,a,d,e),$APP.I(d,$APP.Vl.i(b))&&$APP.$i(c,"__xDropZoneHover",$APP.$g.m(b,$APP.Vl,d)),$APP.Xl(c)));$APP.$i(a,"__xDragPanelDrag",$APP.$g.m($APP.l(a,"__xDragPanelDrag"),qI,c))},Sea=function(a){$APP.$i(a,"__xDragPanelLastFrame",null);return $APP.$i(a,"__xDragPanelRaf",
|
|
16
|
+
requestAnimationFrame(function(b){return rI(a,b)}))},sI=function(a){var b=$APP.l(a,"__xDragPanelRaf");$APP.n(b)&&cancelAnimationFrame(b);$APP.$i(a,"__xDragPanelRaf",null);$APP.$i(a,"__xDragPanelLastFrame",null);$APP.$i(a,"__xDragPanelScrollers",null)},uI=function(a){var b=$APP.l(a,"__xDragPanelPress");$APP.n(b)&&clearTimeout(tI.i(b));$APP.Q(a,"__xDragPanelPress",null)},wI=function(a,b,c,d){var e=a.getBoundingClientRect(),f=lI(a);uI(a);try{a.setPointerCapture(b)}catch(h){}$APP.Q(a,"__xDragPanelDrag",
|
|
17
|
+
$APP.wg([$APP.Ht,qI,$APP.Dq,$APP.Tp,$APP.ku,vI,$APP.It,$APP.Cq,$APP.Xp],[d,null,d-e.top,e.left,b,a.closest("x-drop-zone"),c,c-e.left,e.top]));b=iI(a,"panel");c=""+$APP.P.i(e.height)+$APP.P.i("px");a.style.setProperty("height",c);b.style.setProperty("position","fixed");c=""+$APP.P.i(e.left)+$APP.P.i("px");b.style.setProperty("left",c);c=""+$APP.P.i(e.top)+$APP.P.i("px");b.style.setProperty("top",c);c=""+$APP.P.i(e.width)+$APP.P.i("px");b.style.setProperty("width",c);e=""+$APP.P.i(e.height)+$APP.P.i("px");
|
|
18
|
+
b.style.setProperty("height",e);b.style.setProperty("margin","0");$APP.S(a,"data-dragging","");$APP.fj(a,"x-drag-panel-drag-start",XH($APP.ct.i(f),$APP.Ui.i(f)));jI(a,"Picked up "+$APP.P.i($APP.Z.i(f)));return Sea(a)},xI=function(a){sI(a);a:{var b=iI(a,"panel");a.style.removeProperty("height");for(var c=$APP.q(new $APP.J(null,7,5,$APP.K,"position left top width height margin transform".split(" "),null)),d=null,e=0,f=0;;)if(f<e){var h=d.C(null,f);b.style.removeProperty(h);f+=1}else if(c=$APP.q(c))d=
|
|
19
|
+
c,$APP.$c(d)?(c=$APP.Fb(d),e=$APP.Gb(d),d=c,h=$APP.w(c),c=e,e=h):(h=$APP.t(d),b.style.removeProperty(h),c=$APP.v(d),d=null,e=0),f=0;else break a}$APP.U(a,"data-dragging");$APP.Q(a,"__xDragPanelDrag",null)},yI=function(a){var b=$APP.l(a,"__xDragPanelDrag");if($APP.n(b)){var c=lI(a);b=qI.i(b);$APP.n(b)&&eI(b,a);xI(a);$APP.fj(a,"x-drag-panel-drag-cancel",YH($APP.ct.i(c),$APP.Ui.i(c),"escape"));return jI(a,"Cancelled moving "+$APP.P.i($APP.Z.i(c)))}return null},Tea=function(a){return $APP.Gf.m($APP.Ge,
|
|
20
|
+
$APP.De(function(b){return cI(b,a)}),$APP.Ec(document.querySelectorAll("x-drop-zone")))},zI=function(a,b,c){b=$APP.A(b,c,null);if($APP.n(b)){dI(b,a);c=$APP.Ql(b);var d=document.querySelectorAll("x-drop-zone"),e=d.length;d=Array.from(d).indexOf(b)+1;$APP.El(b,""+$APP.P.i(WH(a.getAttribute("label")))+" over "+$APP.P.i($APP.Z.i(c))+", zone "+$APP.P.i(d)+" of "+$APP.P.i(e));return b.scrollIntoView({block:"nearest",inline:"nearest"})}return null},BI=function(a){var b=$APP.l(a,"__xDragPanelKeyboard");$APP.n(b)&&
|
|
21
|
+
(b=$APP.A(AI.i(b),$APP.Vl.i(b),null),$APP.n(b)&&eI(b,a));$APP.U(a,"data-dragging");$APP.Q(a,"__xDragPanelKeyboard",null)},CI=function(a,b){var c=$APP.l(a,"__xDragPanelKeyboard");if($APP.n(c)){var d=$APP.G(c),e=$APP.C(d,AI);d=$APP.C(d,$APP.Vl);b=$APP.ud(d+b,$APP.w(e));d=$APP.A(e,d,null);$APP.n(d)&&eI(d,a);$APP.Q(a,"__xDragPanelKeyboard",$APP.$g.m(c,$APP.Vl,b));return zI(a,e,b)}return null},Uea=function(a,b){var c=lI(a);if($APP.n(function(){var h=$APP.qt.i(c);if($APP.n(h)&&(h=$APP.z.j(0,b.button))&&
|
|
22
|
+
(h=$APP.l(a,"__xDragPanelDrag")==null)&&(h=$APP.Yr.i(c),h=$APP.z.j(h,"surface"),h||(h=iI(a,"handle"),h=$APP.D($APP.n(h)?b.composedPath().includes(h):h)),h)){h=b.target;if($APP.n(h)){var k=h.closest;h=$APP.n(k)?h.closest("[data-no-drag],button,a,input,select,textarea"):k}h=!$APP.D(h)}return h}())){var d=b.pointerId,e=b.clientX,f=b.clientY;b.preventDefault();return Lea(new $APP.M(null,2,[$APP.zr,b.pointerType,$APP.Yr,$APP.Yr.i(c)],null))?$APP.Q(a,"__xDragPanelPress",new $APP.M(null,4,[$APP.ku,d,$APP.Tp,
|
|
23
|
+
e,$APP.Xp,f,tI,setTimeout(function(){return wI(a,d,e,f)},250)],null)):wI(a,d,e,f)}return null},Vea=function(a,b){var c=b.key,d=$APP.l(a,"__xDragPanelKeyboard"),e=lI(a);var f=$APP.z.j(c," ");e=f?(f=$APP.p(d))?$APP.qt.i(e):f:f;if($APP.n(e))return b.preventDefault(),b=lI(a),c=Tea(a),$APP.q(c)?($APP.Q(a,"__xDragPanelKeyboard",new $APP.M(null,2,[AI,c,$APP.Vl,0],null)),$APP.S(a,"data-dragging",""),$APP.fj(a,"x-drag-panel-drag-start",XH($APP.ct.i(b),$APP.Ui.i(b))),jI(a,"Picked up "+$APP.P.i($APP.Z.i(b))),
|
|
24
|
+
a=zI(a,c,0)):a=null,a;if($APP.n($APP.n(d)?$APP.z.j(c,"ArrowDown")||$APP.z.j(c,"ArrowRight"):d))return b.preventDefault(),CI(a,1);if($APP.n($APP.n(d)?$APP.z.j(c,"ArrowUp")||$APP.z.j(c,"ArrowLeft"):d))return b.preventDefault(),CI(a,-1);if($APP.n($APP.n(d)?$APP.z.j(c,"Enter"):d)){b.preventDefault();a:{c=$APP.l(a,"__xDragPanelKeyboard");if($APP.n(c)&&(b=lI(a),c=$APP.A(AI.i(c),$APP.Vl.i(c),null),d=a.closest("x-drop-zone"),BI(a),$APP.n(c))){e=$APP.w($APP.nl($APP.ml(c),a));$APP.Q(c,"__xDropZoneHover",null);
|
|
25
|
+
$H(c);gI(c,a,d,e);$APP.Xl(c);a=jI(a,"Dropped "+$APP.P.i($APP.Z.i(b)));break a}a=null}return a}return $APP.n($APP.n(d)?$APP.z.j(c,"Escape"):d)?(b.preventDefault(),$APP.n($APP.l(a,"__xDragPanelKeyboard"))?(b=lI(a),BI(a),$APP.fj(a,"x-drag-panel-drag-cancel",YH($APP.ct.i(b),$APP.Ui.i(b),"escape")),a=jI(a,"Cancelled moving "+$APP.P.i($APP.Z.i(b)))):a=null,a):null},Wea=function(a){var b={};$APP.ka(b,"pointerDown",function(c){return Uea(a,c)});$APP.ka(b,"pointerMove",function(c){var d=c.clientX,e=c.clientY,
|
|
26
|
+
f=$APP.l(a,"__xDragPanelPress");if($APP.n(f)){f=$APP.$g.B(f,$APP.It,d,$APP.Ec([$APP.Ht,e]));var h=$APP.G(f);f=$APP.C(h,$APP.Tp);var k=$APP.C(h,$APP.Xp),m=$APP.C(h,$APP.It),r=$APP.C(h,$APP.Ht);h=$APP.C(h,$APP.Br);Math.hypot(($APP.n(m)?m:0)-($APP.n(f)?f:0),($APP.n(r)?r:0)-($APP.n(k)?k:0))>($APP.n(h)?h:8)&&uI(a)}f=$APP.l(a,"__xDragPanelDrag");return $APP.n(f)?$APP.z.j($APP.ku.i(f),c.pointerId)?$APP.$i(a,"__xDragPanelDrag",$APP.$g.B(f,$APP.It,d,$APP.Ec([$APP.Ht,e]))):null:null});$APP.ka(b,"pointerEnd",
|
|
27
|
+
function(c){uI(a);var d=$APP.l(a,"__xDragPanelDrag");if($APP.n(d))if($APP.z.j($APP.ku.i(d),c.pointerId))if($APP.z.j("pointercancel",c.type))c=yI(a);else{var e=$APP.l(a,"__xDragPanelDrag");if($APP.n(e)){c=lI(a);var f=$APP.G(e);d=$APP.C(f,$APP.It);var h=$APP.C(f,$APP.Ht);f=$APP.C(f,vI);var k=nI(d,h),m=$APP.n(k)?cI(k,a):k;e=qI.i(e);$APP.n(e)&&eI(e,a);xI(a);$APP.n(m)?(d=fI(k,a,d,h),$APP.Q(k,"__xDropZoneHover",null),$H(k),gI(k,a,f,d),$APP.Xl(k),c=jI(a,"Dropped "+$APP.P.i($APP.Z.i(c)))):($APP.fj(a,"x-drag-panel-drag-cancel",
|
|
28
|
+
YH($APP.ct.i(c),$APP.Ui.i(c),"no-zone")),c=jI(a,"Returned "+$APP.P.i($APP.Z.i(c))))}else c=null}else c=null;else c=null;return c});$APP.ka(b,"handleKeydown",function(c){return Vea(a,c)});$APP.ka(b,"windowKeydown",function(c){c=$APP.z.j("Escape",c.key);return $APP.n(c?$APP.l(a,"__xDragPanelDrag"):c)?yI(a):null});return b},DI=function(a,b){var c=$APP.l(a,"__xDragPanelRefs");a=$APP.l(a,"__xDragPanelHandlers");if($APP.n($APP.n(c)?a:c))for(var d=$APP.q(Xea),e=null,f=0,h=0;;)if(h<f){var k=e.C(null,h),m=
|
|
29
|
+
$APP.A(k,0,null),r=$APP.A(k,1,null),u=$APP.A(k,2,null);k=$APP.A(k,3,null);var x=$APP.l(c,m),y=$APP.l(a,u);$APP.n(function(){var H=x;return $APP.n(H)?y:H}())&&($APP.n(b)?x.addEventListener(r,y,k):x.removeEventListener(r,y,k));h+=1}else if(d=$APP.q(d)){if($APP.$c(d))r=$APP.Fb(d),d=$APP.Gb(d),m=r,r=$APP.w(r),e=m,f=r;else{e=$APP.t(d);m=$APP.A(e,0,null);r=$APP.A(e,1,null);u=$APP.A(e,2,null);k=$APP.A(e,3,null);var B=$APP.l(c,m),E=$APP.l(a,u);$APP.n(function(){var H=B;return $APP.n(H)?E:H}())&&($APP.n(b)?
|
|
30
|
+
B.addEventListener(r,E,k):B.removeEventListener(r,E,k));d=$APP.v(d);e=null;f=0}h=0}else return null;else return null},Yea=function(a){return $APP.uj(a,$APP.kw)},Zea=function(a){hI(a);mI(a);$APP.Q(a,"__xDragPanelHandlers",Wea(a));return DI(a,!0)},$ea=function(a){uI(a);sI(a);BI(a);$APP.Q(a,"__xDragPanelDrag",null);DI(a,!1);return $APP.Q(a,"__xDragPanelHandlers",null)},afa=function(a,b,c,d){return $APP.I(c,d)?mI(a):null},EI=function(){return $APP.si("x-drag-panel",new $APP.M(null,5,[$APP.ji,bfa,$APP.hi,
|
|
31
|
+
Zea,$APP.ei,$ea,$APP.di,afa,$APP.ii,Yea],null))},bfa="kind value label grab auto-scroll disabled pending".split(" "),AI=new $APP.F(null,"zones","zones",2018149077),vI=new $APP.F(null,"from-zone","from-zone",-2048143887),tI=new $APP.F(null,"timer","timer",-1266967739),qI=new $APP.F(null,"zone","zone",2068674983);var Oea=":host{display:block;position:relative;box-sizing:border-box;border-radius:var("+$APP.P.i("--x-drag-panel-radius")+",var(--x-radius-md,8px));}:host([hidden]){display:none;}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;}[part\x3dpanel]{box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden;background:var("+$APP.P.i("--x-drag-panel-bg")+",var(--x-color-surface,#fff));color:var("+$APP.P.i("--x-drag-panel-color")+
|
|
32
32
|
",var(--x-color-text,#111));border:var("+$APP.P.i("--x-drag-panel-border")+",1px solid var(--x-color-border,#d8d8d8));border-radius:var("+$APP.P.i("--x-drag-panel-radius")+",var(--x-radius-md,8px));box-shadow:var("+$APP.P.i("--x-drag-panel-shadow")+",0 1px 2px rgba(0,0,0,.06));transition:var("+$APP.P.i("--x-drag-panel-transition")+",box-shadow .16s ease,transform .16s ease);}[part\x3dhandle]{display:flex;align-items:center;gap:.5rem;min-height:var("+$APP.P.i("--x-drag-panel-handle-height")+",2rem);padding:0 var("+
|
|
33
33
|
$APP.P.i("--x-drag-panel-padding")+",.75rem);background:var("+$APP.P.i("--x-drag-panel-handle-bg")+",transparent);cursor:grab;touch-action:none;user-select:none;}[part\x3dhandle]:focus-visible{outline:2px solid var(--x-color-focus,#3b82f6);outline-offset:-2px;}[part\x3dgrip]{flex:none;width:.75rem;color:var("+$APP.P.i("--x-drag-panel-grip-color")+",var(--x-color-text-muted,#8a8a8a));line-height:1;}[part\x3dbody]{padding:var("+$APP.P.i("--x-drag-panel-padding")+",.75rem);}:host([grab\x3dsurface]) [part\x3dpanel]{cursor:grab;touch-action:none;}:host([data-dragging]) [part\x3dpanel]{z-index:1000;pointer-events:none;cursor:grabbing;box-shadow:var("+
|
|
34
34
|
$APP.P.i("--x-drag-panel-lift-shadow")+",0 12px 32px rgba(0,0,0,.22));background:var("+$APP.P.i("--x-drag-panel-bg")+",var(--x-color-bg,#fff));transition:none;}:host([data-dragging]),:host([pending]){border:var("+$APP.P.i("--x-drag-panel-footprint-border")+",1px dashed var(--x-color-border,#c9c9c9));background:var("+$APP.P.i("--x-drag-panel-footprint-bg")+",transparent);}:host([pending]) [part\x3dpanel]{visibility:hidden;}:host([disabled]) [part\x3dpanel]{opacity:.55;}:host([disabled]) [part\x3dhandle]{cursor:default;}@media (prefers-reduced-motion: reduce){[part\x3dpanel]{transition:none !important;}}",
|
|
35
|
-
rI=function rI(a,b){var d=$APP.l(a,"__xDragPanelDrag");if($APP.n(d)){var e=$APP.l(a,"__xDragPanelLastFrame");e=$APP.n(e)?b-e:0;$APP
|
|
35
|
+
rI=function rI(a,b){var d=$APP.l(a,"__xDragPanelDrag");if($APP.n(d)){var e=$APP.l(a,"__xDragPanelLastFrame");e=$APP.n(e)?b-e:0;$APP.$i(a,"__xDragPanelLastFrame",b);Pea(a,d);Rea(a,d);Qea(a,d,e);return $APP.$i(a,"__xDragPanelRaf",requestAnimationFrame(function(f){return rI.j?rI.j(a,f):rI.call(null,a,f)}))}return null},Xea=new $APP.J(null,6,5,$APP.K,[new $APP.J(null,4,5,$APP.K,["host","pointerdown","pointerDown",!1],null),new $APP.J(null,4,5,$APP.K,["host","pointermove","pointerMove",!1],null),new $APP.J(null,
|
|
36
36
|
4,5,$APP.K,["host","pointerup","pointerEnd",!1],null),new $APP.J(null,4,5,$APP.K,["host","pointercancel","pointerEnd",!1],null),new $APP.J(null,4,5,$APP.K,["handle","keydown","handleKeydown",!1],null),new $APP.J(null,4,5,$APP.K,["window","keydown","windowKeydown",!1],null)],null);$APP.ha("baredom.exports.x_drag_panel.init",EI);export const init=EI;
|
package/dist/x-drawer.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
2
|
var JT=function(a){var b=$APP.l(a,"__xDrawerRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("div"),h=document.createElement("slot"),k=document.createElement("div"),m=document.createElement("slot"),r=document.createElement("div"),u=document.createElement("slot");c.textContent=":host{display:contents;color-scheme:light dark;--x-drawer-size:20rem;--x-drawer-bg:var(--x-color-bg,Canvas);--x-drawer-fg:var(--x-color-text,CanvasText);--x-drawer-backdrop:rgb(0 0 0/0.4);--x-drawer-shadow:var(--x-shadow-lg,0 8px 24px rgb(0 0 0/0.18));--x-drawer-duration:var(--x-transition-duration,200ms);--x-drawer-easing:ease;--x-drawer-z:1000;--x-drawer-header-padding:1rem 1.25rem;--x-drawer-body-padding:1rem 1.25rem;--x-drawer-footer-padding:0.75rem 1.25rem;--x-drawer-border:var(--x-color-border,color-mix(in srgb,currentColor 12%,transparent));}[part\x3dbackdrop]{display:none;position:fixed;inset:0;background:var(--x-drawer-backdrop);z-index:var(--x-drawer-z);}:host([data-open\x3dtrue]) [part\x3dbackdrop]{display:block;}[part\x3dpanel]{position:fixed;background:var(--x-drawer-bg);color:var(--x-drawer-fg);box-shadow:var(--x-drawer-shadow);display:flex;flex-direction:column;overflow:hidden;z-index:calc(var(--x-drawer-z) + 1);transition:transform var(--x-drawer-duration) var(--x-drawer-easing);}:host([data-placement\x3dleft]) [part\x3dpanel],:host([data-placement\x3dright]) [part\x3dpanel]{top:0;bottom:0;width:var(--x-drawer-size);max-width:100%;}:host([data-placement\x3dleft]) [part\x3dpanel]{left:0;transform:translateX(-100%);}:host([data-placement\x3dright]) [part\x3dpanel]{right:0;transform:translateX(100%);}:host([data-placement\x3dtop]) [part\x3dpanel],:host([data-placement\x3dbottom]) [part\x3dpanel]{left:0;right:0;height:var(--x-drawer-size);max-height:100dvh;}:host([data-placement\x3dtop]) [part\x3dpanel]{top:0;transform:translateY(-100%);}:host([data-placement\x3dbottom]) [part\x3dpanel]{bottom:0;transform:translateY(100%);}:host([data-open\x3dtrue]) [part\x3dpanel]{transform:none;}[part\x3dpanel]:focus{outline:none;}[part\x3dheader]{padding:var(--x-drawer-header-padding);border-bottom:1px solid var(--x-drawer-border);flex-shrink:0;}[part\x3dbody]{padding:var(--x-drawer-body-padding);overflow-y:auto;flex:1;}[part\x3dfooter]{padding:var(--x-drawer-footer-padding);border-top:1px solid var(--x-drawer-border);flex-shrink:0;}@media (prefers-reduced-motion:reduce){[part\x3dpanel]{transition:none;}}@media (prefers-color-scheme:dark){:host{--x-drawer-bg:var(--x-color-bg,#1c1d24);--x-drawer-fg:var(--x-color-text,#e2e4ef);--x-drawer-border:var(--x-color-border,rgb(255 255 255/0.08));--x-drawer-shadow:var(--x-shadow-lg,0 8px 40px rgb(0 0 0/0.55));--x-drawer-backdrop:rgb(0 0 0/0.55);}}";
|
|
3
3
|
$APP.S(d,"part","backdrop");$APP.S(e,"part","panel");$APP.S(e,"role","dialog");$APP.S(e,"aria-modal","true");$APP.S(f,"part","header");$APP.S(h,"name","header");$APP.S(k,"part","body");$APP.S(r,"part","footer");$APP.S(u,"name","footer");f.appendChild(h);k.appendChild(m);r.appendChild(u);e.appendChild(f);e.appendChild(k);e.appendChild(r);b.appendChild(c);b.appendChild(d);b.appendChild(e);$APP.Q(a,"__xDrawerRefs",{root:b,backdrop:d,panel:e,header:f,body:k,footer:r});return $APP.l(a,"__xDrawerRefs")},
|
|
4
|
-
|
|
5
|
-
!0;$APP.Q(a,"__xDrawerTabbables",null);$APP.Q(a,"__xDrawerRestore",null);$APP.n($APP.n(b)?d:b)&&($APP.U(b,"tabindex"),$APP.Q(a,"__xDrawerPanelTab",!1));return $APP.n($APP.n(c)?c.isConnected:c)?c.focus():null},
|
|
6
|
-
return $APP.n($APP.n(e)?$APP.z.j(a,d):e)?(b.preventDefault(),c.focus()):$APP.p(e)&&$APP.z.j(a,c)?(b.preventDefault(),d.focus()):null},LT=function(a,b){$APP.
|
|
7
|
-
var e=
|
|
8
|
-
d=$APP.C(c,$APP.
|
|
9
|
-
e);$APP.n(f)?$APP.U(d,"aria-hidden"):$APP.S(d,"aria-hidden","true");
|
|
10
|
-
$APP.l(a,"__xDrawerHandlers"),c=$APP.l(a,"__xDrawerRefs");if($APP.n($APP.n(b)?c:b)){var d=$APP.l(c,"backdrop");c=$APP.l(c,"panel");var e=$APP.l(b,"backdrop");b=$APP.l(b,"keydown");$APP.n(e)&&d.removeEventListener("click",e);$APP.n(b)&&c.removeEventListener("keydown",b)}$APP.Q(a,"__xDrawerHandlers",null)},
|
|
11
|
-
set:function(b){return $APP.n(b)?MT(this):$APP.U(this,"open")},enumerable:!0,configurable:!0});$APP.
|
|
12
|
-
$APP.U(this,"open"):MT(this)},enumerable:!0,configurable:!0,writable:!0})},PT=function(){return $APP.
|
|
4
|
+
Qka=function(a){return $APP.$e($APP.Ee(function(b){var c=window.getComputedStyle(b);return $APP.I("none",c.display)&&$APP.I("hidden",c.visibility)&&b.offsetWidth>0&&b.offsetHeight>0},$APP.Ec(a.querySelectorAll("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex\x3d'-1'])"))))},KT=function(a){var b=$APP.l(a,"__xDrawerRefs");b=$APP.n(b)?$APP.l(b,"panel"):null;var c=$APP.l(a,"__xDrawerRestore"),d=$APP.l(a,"__xDrawerPanelTab")===
|
|
5
|
+
!0;$APP.Q(a,"__xDrawerTabbables",null);$APP.Q(a,"__xDrawerRestore",null);$APP.n($APP.n(b)?d:b)&&($APP.U(b,"tabindex"),$APP.Q(a,"__xDrawerPanelTab",!1));return $APP.n($APP.n(c)?c.isConnected:c)?c.focus():null},Rka=function(a,b){var c=$APP.l(a,"__xDrawerTabbables");c=$APP.n(c)?$APP.$e($APP.Ec(c)):$APP.Ge;a=$APP.l(a,"__xDrawerRefs");a=$APP.n(a)?$APP.l(a,"panel"):null;if($APP.Tc(c))return b.preventDefault(),$APP.n(a)?a.focus():null;a=document.activeElement;var d=$APP.t(c);c=$APP.Ic(c);var e=b.shiftKey;
|
|
6
|
+
return $APP.n($APP.n(e)?$APP.z.j(a,d):e)?(b.preventDefault(),c.focus()):$APP.p(e)&&$APP.z.j(a,c)?(b.preventDefault(),d.focus()):null},LT=function(a,b){$APP.fj(a,"x-drawer-dismiss",{reason:b});return $APP.U(a,"open")},MT=function(a){return $APP.n(a.hasAttribute("open"))?null:$APP.S(a,"open","")},Ska=function(a,b,c){b=$APP.D($APP.Bv.i(b));c=$APP.D($APP.Bv.i(c));$APP.I(b,c)&&($APP.fj(a,"x-drawer-toggle",{open:c}),c?setTimeout(function(){var d=$APP.l(a,"__xDrawerRefs");d=$APP.n(d)?$APP.l(d,"panel"):null;
|
|
7
|
+
var e=Qka(a);$APP.Q(a,"__xDrawerRestore",document.activeElement);$APP.Q(a,"__xDrawerTabbables",$APP.n(e)?$APP.an(e):null);$APP.q(e)?d=$APP.t(e).focus():$APP.n(d)?($APP.n(d.hasAttribute("tabindex"))||($APP.S(d,"tabindex","-1"),$APP.Q(a,"__xDrawerPanelTab",!0)),d=d.focus()):d=null;return d},0):KT(a))},NT=function(a){if($APP.n($APP.l(a,"__xDrawerRefs"))){var b=new $APP.M(null,3,[$APP.Oq,a.hasAttribute("open"),$APP.fw,a.getAttribute("placement"),$APP.Pj,a.getAttribute("label")],null);var c=$APP.G(b),
|
|
8
|
+
d=$APP.C(c,$APP.Oq);b=$APP.C(c,$APP.fw);c=$APP.C(c,$APP.Pj);d=$APP.D(d);b=typeof b==="string"&&$APP.dd(Tka,b)?b:"right";c=typeof c==="string"&&$APP.I(c,"")?c:"Drawer";b=new $APP.M(null,3,[$APP.Bv,d,$APP.gs,b,$APP.Z,c],null);c=$APP.l(a,"__xDrawerModel");if($APP.I(c,b)){d=JT(a);d=$APP.l(d,"panel");var e=$APP.G(b),f=$APP.C(e,$APP.Bv);e=$APP.C(e,$APP.gs);$APP.S(a,"data-open",$APP.n(f)?"true":"false");$APP.S(a,"data-placement",e);e=$APP.G(b);f=$APP.C(e,$APP.Bv);e=$APP.C(e,$APP.Z);$APP.S(d,"aria-label",
|
|
9
|
+
e);$APP.n(f)?$APP.U(d,"aria-hidden"):$APP.S(d,"aria-hidden","true");Ska(a,c,b);a=$APP.Q(a,"__xDrawerModel",b)}else a=null;return a}return null},Uka=function(a){function b(f){var h=f.key;$APP.z.j(h,"Escape")?(f.preventDefault(),f=LT(a,"escape")):f=$APP.z.j(h,"Tab")?Rka(a,f):null;return f}function c(){return LT(a,"backdrop")}var d=JT(a),e=$APP.l(d,"panel");$APP.l(d,"backdrop").addEventListener("click",c);e.addEventListener("keydown",b);$APP.Q(a,"__xDrawerHandlers",{backdrop:c,keydown:b})},OT=function(a){var b=
|
|
10
|
+
$APP.l(a,"__xDrawerHandlers"),c=$APP.l(a,"__xDrawerRefs");if($APP.n($APP.n(b)?c:b)){var d=$APP.l(c,"backdrop");c=$APP.l(c,"panel");var e=$APP.l(b,"backdrop");b=$APP.l(b,"keydown");$APP.n(e)&&d.removeEventListener("click",e);$APP.n(b)&&c.removeEventListener("keydown",b)}$APP.Q(a,"__xDrawerHandlers",null)},Vka=function(a){JT(a);OT(a);Uka(a);return NT(a)},Wka=function(a){OT(a);return KT(a)},Xka=function(a,b,c,d){return $APP.I(c,d)?NT(a):null},Yka=function(a){Object.defineProperty(a,"open",{get:function(){return this.hasAttribute("open")},
|
|
11
|
+
set:function(b){return $APP.n(b)?MT(this):$APP.U(this,"open")},enumerable:!0,configurable:!0});$APP.nj(a,"placement","placement","right");$APP.nj(a,"label","label","Drawer");Object.defineProperty(a,"show",{value:function(){return MT(this)},enumerable:!0,configurable:!0,writable:!0});Object.defineProperty(a,"hide",{value:function(){return $APP.U(this,"open")},enumerable:!0,configurable:!0,writable:!0});return Object.defineProperty(a,"toggle",{value:function(){return $APP.n(this.hasAttribute("open"))?
|
|
12
|
+
$APP.U(this,"open"):MT(this)},enumerable:!0,configurable:!0,writable:!0})},PT=function(){return $APP.si("x-drawer",new $APP.M(null,5,[$APP.ji,Zka,$APP.hi,Vka,$APP.ei,Wka,$APP.di,Xka,$APP.ii,Yka],null))};var Tka=new $APP.ch(null,new $APP.M(null,4,["right",null,"top",null,"bottom",null,"left",null],null),null),Zka=["open","placement","label"];$APP.je(["x-drawer-toggle",new $APP.M(null,2,[$APP.$u,!1,$APP.V,new $APP.M(null,1,[$APP.Wu,$APP.sj],null)],null),"x-drawer-dismiss",new $APP.M(null,2,[$APP.$u,!1,$APP.V,new $APP.M(null,1,[$APP.Zq,$APP.X],null)],null)]);$APP.ha("baredom.exports.x_drawer.init",PT);export const init=PT;
|
package/dist/x-drop-zone.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var IV=function(a,b){function c(e){var f=$APP.G(e);e=$APP.C(f,$APP.
|
|
3
|
-
e){var h=d.C(null,f);b.set(h,h.getBoundingClientRect());f+=1}else if(c=$APP.q(c))d=c,$APP
|
|
4
|
-
$APP.
|
|
5
|
-
$APP.n(m))){var r=$APP.G(m);m=$APP.C(r,$APP.
|
|
6
|
-
d=$APP.
|
|
7
|
-
$APP.S(a,"aria-busy","true"):$APP.U(a,"aria-busy");e=$APP.G(b);e=$APP.C(e,$APP.
|
|
8
|
-
|
|
9
|
-
h+=1}else if(d=$APP.q(d)){if($APP
|
|
10
|
-
"Drop zone");$APP.
|
|
11
|
-
writable:!0});return Object.defineProperty(a,"release",{value:function(){PV(this);$APP.Q(this,"__xDropZoneReservation",null);$APP.U(this,"pending");return $APP.U(this,"pending-index")},enumerable:!0,configurable:!0,writable:!0})},
|
|
12
|
-
new $APP.M(null,5,[$APP.
|
|
2
|
+
var IV=function(a,b){function c(e){var f=$APP.G(e);e=$APP.C(f,$APP.To);f=$APP.C(f,$APP.Uo);return($APP.n(e)?e:0)>0&&($APP.n(f)?f:0)>0}if(c(a)&&c(b)){var d=$APP.Sp.i(a)-$APP.Sp.i(b);a=$APP.vq.i(a)-$APP.vq.i(b);return $APP.I(0,d)||$APP.I(0,a)?new $APP.M(null,2,[$APP.Ws,d,$APP.Vs,a],null):null}return null},JV=function(a){var b=$APP.kl(a,"empty");return $APP.n(b)?$APP.q($APP.ml(a))?$APP.S(b,"hidden",""):$APP.U(b,"hidden"):null},KV=function(a){for(var b=new Map,c=$APP.q($APP.ml(a)),d=null,e=0,f=0;;)if(f<
|
|
3
|
+
e){var h=d.C(null,f);b.set(h,h.getBoundingClientRect());f+=1}else if(c=$APP.q(c))d=c,$APP.$c(d)?(c=$APP.Fb(d),f=$APP.Gb(d),d=c,e=$APP.w(c),c=f):(c=$APP.t(d),b.set(c,c.getBoundingClientRect()),c=$APP.v(d),d=null,e=0),f=0;else break;$APP.$i(a,"__xDropZoneRects",b)},LV=function(a,b,c){a.animate([{transform:"translate("+$APP.P.i(b)+$APP.P.i("px")+","+$APP.P.i(c)+$APP.P.i("px")+")"},{transform:"none"}],{duration:180,easing:"ease"})},MV=function(a){return new $APP.M(null,4,[$APP.Sp,a.left,$APP.vq,a.top,
|
|
4
|
+
$APP.To,a.width,$APP.Uo,a.height],null)},NV=function(a){var b=$APP.l(a,"__xDropZoneObserver");$APP.n(b)&&b.disconnect();$APP.Q(a,"__xDropZoneObserver",null)},dma=function(a){if(!$APP.n($APP.l(a,"__xDropZoneObserver"))){var b=new MutationObserver(function(){if(!$APP.n(matchMedia("(prefers-reduced-motion: reduce)").matches)){var c=$APP.l(a,"__xDropZoneRects");if($APP.n(c))for(var d=$APP.q($APP.ml(a)),e=null,f=0,h=0;;)if(h<f){var k=e.C(null,h),m=c.get(k);if($APP.n(m)&&(m=IV(MV(m),MV(k.getBoundingClientRect())),
|
|
5
|
+
$APP.n(m))){var r=$APP.G(m);m=$APP.C(r,$APP.Ws);r=$APP.C(r,$APP.Vs);LV(k,m,r)}h+=1}else if(d=$APP.q(d))$APP.$c(d)?(f=$APP.Fb(d),d=$APP.Gb(d),e=f,f=$APP.w(f)):(e=$APP.t(d),f=c.get(e),$APP.n(f)&&(f=IV(MV(f),MV(e.getBoundingClientRect())),$APP.n(f)&&(h=$APP.G(f),f=$APP.C(h,$APP.Ws),h=$APP.C(h,$APP.Vs),LV(e,f,h))),d=$APP.v(d),e=null,f=0),h=0;else break;KV(a)}return JV(a)});b.observe(a,{childList:!0});$APP.Q(a,"__xDropZoneObserver",b);KV(a)}},ema=function(a){var b=$APP.Ql(a),c=$APP.l(a,"__xDropZoneLastDrop"),
|
|
6
|
+
d=$APP.Wl.i(c),e=function(){return $APP.n(d)?$APP.pe(function(h){return h===d},$APP.ml(a)):d}(),f=function(){var h=$APP.Z.i(c);return $APP.n(h)?h:"Item"}();$APP.El(a,$APP.n(e)?""+$APP.P.i(f)+" moved to "+$APP.P.i($APP.Z.i(b)):"Move of "+$APP.P.i(f)+" failed");return $APP.Q(a,"__xDropZoneLastDrop",null)},OV=function(a){var b=$APP.Pl(a),c=$APP.l(a,"__xDropZoneModel");if($APP.I(c,b)){$APP.jl(a);var d=$APP.G(b),e=$APP.C(d,$APP.Z);d=$APP.C(d,$APP.Ml);$APP.S(a,"role","group");$APP.S(a,"aria-label",e);$APP.n(d)?
|
|
7
|
+
$APP.S(a,"aria-busy","true"):$APP.U(a,"aria-busy");e=$APP.G(b);e=$APP.C(e,$APP.Ol);$APP.n(e)?dma(a):NV(a);$APP.Q(a,"__xDropZoneModel",b);$APP.Xl(a);JV(a);$APP.n(c)?(c=$APP.D($APP.Ml.i(c)),e=$APP.D($APP.Ml.i(b)),!c&&e?(c=$APP.Z.i($APP.l(a,"__xDropZoneLastDrop")),a=$APP.El(a,"Moving "+$APP.P.i($APP.n(c)?c:"Item")+" to "+$APP.P.i($APP.Z.i(b)))):a=c&&!e?ema(a):null):a=null}else a=null;return a},PV=function(a){a=$APP.l(a,"__xDropZoneReservation");$APP.n(a)&&(a=$APP.Wl.i(a),$APP.n(a)&&$APP.U(a,"pending"))},
|
|
8
|
+
fma=function(a){var b={};$APP.ka(b,"slotChange",function(){JV(a);return $APP.Xl(a)});return b},QV=function(a,b){var c=$APP.l(a,"__xDropZoneRefs");a=$APP.l(a,"__xDropZoneHandlers");if($APP.n($APP.n(c)?a:c))for(var d=$APP.q($APP.lw),e=null,f=0,h=0;;)if(h<f){var k=e.C(null,h),m=$APP.A(k,0,null),r=$APP.A(k,1,null),u=$APP.A(k,2,null);k=$APP.A(k,3,null);var x=$APP.l(c,m),y=$APP.l(a,u);$APP.n(function(){var H=x;return $APP.n(H)?y:H}())&&($APP.n(b)?x.addEventListener(r,y,k):x.removeEventListener(r,y,k));
|
|
9
|
+
h+=1}else if(d=$APP.q(d)){if($APP.$c(d))r=$APP.Fb(d),d=$APP.Gb(d),m=r,r=$APP.w(r),e=m,f=r;else{e=$APP.t(d);m=$APP.A(e,0,null);r=$APP.A(e,1,null);u=$APP.A(e,2,null);k=$APP.A(e,3,null);var B=$APP.l(c,m),E=$APP.l(a,u);$APP.n(function(){var H=B;return $APP.n(H)?E:H}())&&($APP.n(b)?B.addEventListener(r,E,k):B.removeEventListener(r,E,k));d=$APP.v(d);e=null;f=0}h=0}else break},gma=function(a){$APP.nj(a,"value","value","");$APP.nj(a,"accepts","accepts","");$APP.pj(a,"max","max",null);$APP.nj(a,"label","label",
|
|
10
|
+
"Drop zone");$APP.kj(a,"disabled","disabled");$APP.kj(a,"pending","pending");$APP.pj(a,"pendingIndex","pending-index",null);$APP.kj(a,"animateMoves","animate-moves");Object.defineProperty(a,"reserve",{value:function(b,c){$APP.jl(this);PV(this);$APP.Q(this,"__xDropZoneReservation",new $APP.M(null,1,[$APP.Wl,b],null));$APP.n(b)&&$APP.S(b,"pending","");typeof c==="number"?$APP.S(this,"pending-index",""+$APP.P.i(c)):$APP.U(this,"pending-index");return $APP.S(this,"pending","")},enumerable:!0,configurable:!0,
|
|
11
|
+
writable:!0});return Object.defineProperty(a,"release",{value:function(){PV(this);$APP.Q(this,"__xDropZoneReservation",null);$APP.U(this,"pending");return $APP.U(this,"pending-index")},enumerable:!0,configurable:!0,writable:!0})},hma=function(a){$APP.jl(a);OV(a);$APP.Q(a,"__xDropZoneHandlers",fma(a));QV(a,!0);return JV(a)},ima=function(a){NV(a);QV(a,!1);$APP.Q(a,"__xDropZoneHandlers",null);return $APP.Q(a,"__xDropZoneHover",null)},jma=function(a,b,c,d){return $APP.I(c,d)?OV(a):null},RV=function(){return $APP.si("x-drop-zone",
|
|
12
|
+
new $APP.M(null,5,[$APP.ji,kma,$APP.hi,hma,$APP.ei,ima,$APP.di,jma,$APP.ii,gma],null))},kma="value accepts max label disabled pending pending-index animate-moves".split(" ");$APP.ha("baredom.exports.x_drop_zone.init",RV);export const init=RV;
|
package/dist/x-dropdown.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
e=$APP.C(f,$APP.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
null},docKeydown:function(b){b=$APP.z.j(b.key,"Escape");return $APP.n(b?a.hasAttribute("open"):b)?
|
|
7
|
-
$APP.l(c,"triggerKeydown"));a.removeEventListener("focusout",$APP.l(c,"hostFocusout"));$APP.n(b)&&b.removeEventListener("click",$APP.l(c,"panelClick"))}}},
|
|
8
|
-
var d=document.createElement("button"),e=document.createElement("span"),f=document.createElement("span");$APP.S(d,"part","trigger");$APP.S(d,"type","button");$APP.S(d,"aria-haspopup","true");$APP.S(d,"aria-expanded","false");$APP.S(d,"aria-controls","panel");$APP.S(e,"part","trigger-label");$APP.S(f,"part","chevron");$APP.S(f,"aria-hidden","true");f.textContent="▾";d.appendChild(e);d.appendChild(f);f=$APP.G(new $APP.M(null,3,[$APP.
|
|
9
|
-
f=$APP.C(f,
|
|
10
|
-
|
|
11
|
-
$APP.z.j(b,"open")?$APP.n(a.hasAttribute("open"))?
|
|
12
|
-
configurable:!0})},
|
|
13
|
-
$APP.
|
|
2
|
+
var aB=function(a){if($APP.n($APP.l(a,"__xDropdownRefs"))){var b=a.hasAttribute("open");var c=a.hasAttribute("disabled"),d=a.getAttribute("label");d=$APP.n(d)?d:"";var e=a.getAttribute("placement");e=$APP.dd(vaa,e)?e:"bottom-start";b=new $APP.M(null,4,[$APP.Bv,b,$APP.Xj,c,$APP.Z,d,$APP.gs,e],null);if($APP.I($APP.l(a,"__xDropdownModel"),b))if(e=$APP.l(a,"__xDropdownRefs"),$APP.n(e)){d=$APP.l(e,"trigger");c=$APP.l(e,"panel");e=$APP.l(e,"label");var f=$APP.G(b);f=$APP.C(f,$APP.Z);e.textContent=f;f=$APP.G(b);
|
|
3
|
+
e=$APP.C(f,$APP.Bv);f=$APP.C(f,$APP.Xj);$APP.S(d,"aria-expanded",$APP.n(e)?"true":"false");$APP.aj(d,"disabled",f);d=$APP.G(b);d=$APP.C(d,$APP.gs);$APP.S(c,"data-placement",d);a=$APP.Q(a,"__xDropdownModel",b)}else a=null;else a=null;return a}return null},bB=function(a,b){if($APP.n(a.hasAttribute("disabled")))return null;var c=$APP.p(a.hasAttribute("open"));return $APP.hj(a,"x-dropdown-toggle",{open:c,source:b})?(c?$APP.S(a,"open",""):$APP.U(a,"open"),$APP.fj(a,"x-dropdown-change",{open:c})):null},
|
|
4
|
+
cB=function(a){var b=$APP.l(a,"__xDropdownHandlers");if($APP.n(b)){var c=$APP.l(b,"docClick"),d=$APP.l(b,"docKeydown");return queueMicrotask(function(){return $APP.n(a.hasAttribute("open"))?(document.addEventListener("click",c),document.addEventListener("keydown",d)):null})}return null},dB=function(a){a=$APP.l(a,"__xDropdownHandlers");if($APP.n(a)){var b=$APP.l(a,"docKeydown");document.removeEventListener("click",$APP.l(a,"docClick"));return document.removeEventListener("keydown",b)}return null},
|
|
5
|
+
waa=function(a){return{triggerClick:function(){return bB(a,"pointer")},triggerKeydown:function(b){var c=b.key;return $APP.z.j(c," ")||$APP.z.j(c,"Enter")?(b.preventDefault(),bB(a,"keyboard")):null},hostFocusout:function(b){return $APP.n(a.hasAttribute("open"))?(b=b.relatedTarget,b==null||$APP.p(a.contains(b))?bB(a,"focusout"):null):null},docClick:function(b){return $APP.n(a.hasAttribute("open"))?(b=$APP.Fc(b.composedPath()),b=$APP.pe(function(c){return c===a},b),$APP.n(b)?null:bB(a,"outside-click")):
|
|
6
|
+
null},docKeydown:function(b){b=$APP.z.j(b.key,"Escape");return $APP.n(b?a.hasAttribute("open"):b)?bB(a,"escape"):null},panelClick:function(b){return $APP.n(a.hasAttribute("open"))?$APP.n(b.target.closest("button, a, [role\x3dmenuitem]"))?bB(a,"item-select"):null:null}}},eB=function(a){var b=$APP.l(a,"__xDropdownRefs");if($APP.n(b)){var c=$APP.l(a,"__xDropdownHandlers");if($APP.n(c)){var d=$APP.l(b,"trigger");b=$APP.l(b,"panel");d.removeEventListener("click",$APP.l(c,"triggerClick"));d.removeEventListener("keydown",
|
|
7
|
+
$APP.l(c,"triggerKeydown"));a.removeEventListener("focusout",$APP.l(c,"hostFocusout"));$APP.n(b)&&b.removeEventListener("click",$APP.l(c,"panelClick"))}}},xaa=function(a){if(!$APP.n($APP.l(a,"__xDropdownRefs"))){var b=a.attachShadow({mode:"open"}),c=document.createElement("style");c.textContent=":host{display:inline-block;position:relative;color-scheme:light dark;--x-dropdown-trigger-bg:var(--x-color-surface-hover,#f8fafc);--x-dropdown-trigger-bg-hover:var(--x-color-surface-active,#f1f5f9);--x-dropdown-trigger-bg-active:var(--x-color-surface-active,#e2e8f0);--x-dropdown-trigger-color:var(--x-color-text,#0f172a);--x-dropdown-trigger-border:1px solid var(--x-color-border,#e2e8f0);--x-dropdown-trigger-radius:var(--x-radius-md,6px);--x-dropdown-trigger-padding:0 0.75rem;--x-dropdown-trigger-height:2.25rem;--x-dropdown-trigger-font-size:var(--x-font-size-sm,0.9375rem);--x-dropdown-trigger-font-weight:500;--x-dropdown-chevron-color:var(--x-color-text-muted,#64748b);--x-dropdown-focus-ring:var(--x-color-focus-ring,#60a5fa);--x-dropdown-panel-bg:var(--x-color-bg,#ffffff);--x-dropdown-panel-border:1px solid var(--x-color-border,#e2e8f0);--x-dropdown-panel-radius:var(--x-radius-md,8px);--x-dropdown-panel-shadow:var(--x-shadow-md,0 4px 16px rgba(0,0,0,0.12));--x-dropdown-panel-padding:0.25rem;--x-dropdown-panel-min-width:10rem;--x-dropdown-panel-max-height:20rem;--x-dropdown-panel-offset:4px;--x-dropdown-transition-duration:var(--x-transition-duration,150ms);--x-dropdown-transition-easing:var(--x-transition-easing,ease);}@media (prefers-color-scheme:dark){:host{--x-dropdown-trigger-bg:var(--x-color-surface-hover,#1e293b);--x-dropdown-trigger-bg-hover:var(--x-color-surface-active,#334155);--x-dropdown-trigger-bg-active:var(--x-color-surface-active,#475569);--x-dropdown-trigger-color:var(--x-color-text,#e2e8f0);--x-dropdown-trigger-border:1px solid var(--x-color-border,#334155);--x-dropdown-chevron-color:var(--x-color-text-muted,#94a3b8);--x-dropdown-focus-ring:var(--x-color-focus-ring,#93c5fd);--x-dropdown-panel-bg:var(--x-color-bg,#1e293b);--x-dropdown-panel-border:1px solid var(--x-color-border,#334155);--x-dropdown-panel-shadow:var(--x-shadow-md,0 4px 24px rgba(0,0,0,0.4));}}[part\x3dtrigger]{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;gap:0.375rem;height:var(--x-dropdown-trigger-height);padding:var(--x-dropdown-trigger-padding);background:var(--x-dropdown-trigger-bg);color:var(--x-dropdown-trigger-color);border:var(--x-dropdown-trigger-border);border-radius:var(--x-dropdown-trigger-radius);font-size:var(--x-dropdown-trigger-font-size);font-weight:var(--x-dropdown-trigger-font-weight);font-family:inherit;cursor:pointer;user-select:none;white-space:nowrap;}[part\x3dtrigger]:hover:not(:disabled){background:var(--x-dropdown-trigger-bg-hover);}[part\x3dtrigger]:active:not(:disabled){background:var(--x-dropdown-trigger-bg-active);}[part\x3dtrigger]:disabled{cursor:default;opacity:0.55;}[part\x3dtrigger]:focus-visible{outline:none;box-shadow:0 0 0 2px var(--x-dropdown-focus-ring);}[part\x3dtrigger-label]{flex:1;}[part\x3dchevron]{display:inline-block;color:var(--x-dropdown-chevron-color);font-style:normal;flex-shrink:0;transition:transform 200ms ease;}:host([open]) [part\x3dchevron]{transform:rotate(180deg);}[part\x3dpanel]{position:absolute;z-index:1000;box-sizing:border-box;background:var(--x-dropdown-panel-bg);border:var(--x-dropdown-panel-border);border-radius:var(--x-dropdown-panel-radius);box-shadow:var(--x-dropdown-panel-shadow);padding:var(--x-dropdown-panel-padding);min-width:var(--x-dropdown-panel-min-width);max-width:calc(100vw - 1rem);max-height:var(--x-dropdown-panel-max-height);overflow-y:auto;visibility:hidden;pointer-events:none;opacity:0;transform:scaleY(0.95);transition:opacity var(--x-dropdown-transition-duration) var(--x-dropdown-transition-easing),transform var(--x-dropdown-transition-duration) var(--x-dropdown-transition-easing),visibility 0s var(--x-dropdown-transition-duration);}:host([open]) [part\x3dpanel]{visibility:visible;pointer-events:auto;opacity:1;transform:scaleY(1);transition:opacity var(--x-dropdown-transition-duration) var(--x-dropdown-transition-easing),transform var(--x-dropdown-transition-duration) var(--x-dropdown-transition-easing),visibility 0s 0s;}[part\x3dpanel][data-placement\x3dbottom-start]{top:calc(100% + var(--x-dropdown-panel-offset));left:0;transform-origin:top left;}[part\x3dpanel][data-placement\x3dbottom-end]{top:calc(100% + var(--x-dropdown-panel-offset));right:0;transform-origin:top right;}[part\x3dpanel][data-placement\x3dtop-start]{bottom:calc(100% + var(--x-dropdown-panel-offset));left:0;transform-origin:bottom left;}[part\x3dpanel][data-placement\x3dtop-end]{bottom:calc(100% + var(--x-dropdown-panel-offset));right:0;transform-origin:bottom right;}[part\x3dpanel-inner]{display:contents;}@media (prefers-reduced-motion:reduce){[part\x3dpanel]{transition:none !important;}[part\x3dchevron]{transition:none !important;}}";
|
|
8
|
+
var d=document.createElement("button"),e=document.createElement("span"),f=document.createElement("span");$APP.S(d,"part","trigger");$APP.S(d,"type","button");$APP.S(d,"aria-haspopup","true");$APP.S(d,"aria-expanded","false");$APP.S(d,"aria-controls","panel");$APP.S(e,"part","trigger-label");$APP.S(f,"part","chevron");$APP.S(f,"aria-hidden","true");f.textContent="▾";d.appendChild(e);d.appendChild(f);f=$APP.G(new $APP.M(null,3,[$APP.hs,d,$APP.Z,e,fB,f],null));d=$APP.C(f,$APP.hs);e=$APP.C(f,$APP.Z);
|
|
9
|
+
f=$APP.C(f,fB);var h=document.createElement("div"),k=document.createElement("div"),m=document.createElement("slot");$APP.S(h,"part","panel");$APP.S(h,"id","panel");$APP.S(h,"data-placement","bottom-start");$APP.S(k,"part","panel-inner");k.appendChild(m);h.appendChild(k);h=$APP.G(new $APP.M(null,1,[$APP.Wl,h],null));h=$APP.C(h,$APP.Wl);e={trigger:d,label:e,chevron:f,panel:h};b.appendChild(c);b.appendChild(d);b.appendChild(h);$APP.Q(a,"__xDropdownRefs",e)}eB(a);dB(a);$APP.Q(a,"__xDropdownHandlers",
|
|
10
|
+
waa(a));d=$APP.l(a,"__xDropdownRefs");$APP.n(d)&&(b=$APP.l(a,"__xDropdownHandlers"),$APP.n(b)&&(c=$APP.l(d,"trigger"),d=$APP.l(d,"panel"),c.addEventListener("click",$APP.l(b,"triggerClick")),c.addEventListener("keydown",$APP.l(b,"triggerKeydown")),a.addEventListener("focusout",$APP.l(b,"hostFocusout")),$APP.n(d)&&d.addEventListener("click",$APP.l(b,"panelClick"))));$APP.n(a.hasAttribute("open"))&&cB(a);return aB(a)},yaa=function(a){eB(a);return dB(a)},zaa=function(a,b,c,d){return $APP.I(c,d)?(aB(a),
|
|
11
|
+
$APP.z.j(b,"open")?$APP.n(a.hasAttribute("open"))?cB(a):dB(a):null):null},Baa=function(a){$APP.uj(a,Aaa);Object.defineProperty(a,"show",{value:function(){return $APP.n(this.hasAttribute("open"))?null:bB(this,"programmatic")},writable:!0,configurable:!0});Object.defineProperty(a,"hide",{value:function(){return $APP.n(this.hasAttribute("open"))?bB(this,"programmatic"):null},writable:!0,configurable:!0});return Object.defineProperty(a,"toggle",{value:function(){return bB(this,"programmatic")},writable:!0,
|
|
12
|
+
configurable:!0})},gB=function(){return $APP.si("x-dropdown",new $APP.M(null,5,[$APP.ji,Caa,$APP.hi,xaa,$APP.ei,yaa,$APP.di,zaa,$APP.ii,Baa],null))},fB=new $APP.F(null,"chevron","chevron",1127691895);var vaa=new $APP.ch(null,new $APP.M(null,4,["bottom-start",null,"bottom-end",null,"top-end",null,"top-start",null],null),null),Caa=["open","disabled","label","placement"],Aaa=new $APP.M(null,4,[$APP.Wu,new $APP.M(null,2,[$APP.N,$APP.sj,$APP.W,"open"],null),$APP.un,new $APP.M(null,2,[$APP.N,$APP.sj,$APP.W,"disabled"],null),$APP.Z,new $APP.M(null,2,[$APP.N,$APP.X,$APP.W,"label"],null),$APP.gs,new $APP.M(null,2,[$APP.N,$APP.X,$APP.W,"placement"],null)],null);
|
|
13
|
+
$APP.je(["x-dropdown-toggle",new $APP.M(null,2,[$APP.$u,!0,$APP.V,new $APP.M(null,2,[$APP.Wu,$APP.sj,$APP.cu,$APP.X],null)],null),"x-dropdown-change",new $APP.M(null,2,[$APP.$u,!1,$APP.V,new $APP.M(null,1,[$APP.Wu,$APP.sj],null)],null)]);$APP.ha("baredom.exports.x_dropdown.init",gB);export const init=gB;
|
package/dist/x-fieldset.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var gR=function(a){if($APP.n($APP.l(a,"__xFieldsetRefs"))){var b=new $APP.M(null,4,[dR,a.getAttribute("legend"),$APP.
|
|
3
|
-
$APP.n(d)){c=$APP.l(d,"root-el");e=$APP.l(d,"content-el");d=$APP.l(d,"legend-el");var f=$APP.G(b),h=$APP.C(f,eR);f=$APP.C(f,fR);d.textContent=h;$APP.n(f)?$APP.U(d,"hidden"):$APP.S(d,"hidden","");f=$APP.G(b);d=$APP.C(f,$APP.
|
|
4
|
-
c=$APP.G(b);c=$APP.C(c,$APP.
|
|
2
|
+
var gR=function(a){if($APP.n($APP.l(a,"__xFieldsetRefs"))){var b=new $APP.M(null,4,[dR,a.getAttribute("legend"),$APP.Qj,a.hasAttribute("disabled"),$APP.bm,a.getAttribute("aria-label"),$APP.cm,a.getAttribute("aria-describedby")],null);var c=$APP.G(b),d=$APP.C(c,dR),e=$APP.C(c,$APP.Qj);b=$APP.C(c,$APP.bm);c=$APP.C(c,$APP.cm);d=$APP.n(d)?d:"";e=$APP.D(e);b=new $APP.M(null,5,[eR,d,fR,$APP.I(d,""),$APP.Xj,e,$APP.km,b,$APP.jm,c],null);if($APP.I($APP.l(a,"__xFieldsetModel"),b))if(d=$APP.l(a,"__xFieldsetRefs"),
|
|
3
|
+
$APP.n(d)){c=$APP.l(d,"root-el");e=$APP.l(d,"content-el");d=$APP.l(d,"legend-el");var f=$APP.G(b),h=$APP.C(f,eR);f=$APP.C(f,fR);d.textContent=h;$APP.n(f)?$APP.U(d,"hidden"):$APP.S(d,"hidden","");f=$APP.G(b);d=$APP.C(f,$APP.km);h=$APP.C(f,$APP.jm);f=$APP.C(f,fR);$APP.n(d)?($APP.S(c,"aria-label",d),$APP.U(c,"aria-labelledby")):($APP.U(c,"aria-label"),$APP.n(f)?$APP.S(c,"aria-labelledby","x-fieldset-legend"):$APP.U(c,"aria-labelledby"));$APP.n(h)?$APP.S(c,"aria-describedby",h):$APP.U(c,"aria-describedby");
|
|
4
|
+
c=$APP.G(b);c=$APP.C(c,$APP.Xj);$APP.aj(a,"data-disabled",c);$APP.aj(e,"inert",c);a=$APP.Q(a,"__xFieldsetModel",b)}else a=null;else a=null;return a}return null},mja=function(a){if(!$APP.n(document.getElementById("x-fieldset-input-styles"))){var b=document.createElement("style");$APP.S(b,"id","x-fieldset-input-styles");b.textContent="x-fieldset input,x-fieldset select,x-fieldset textarea{background:var(--x-fieldset-input-bg);color:var(--x-fieldset-input-color);border:1px solid var(--x-fieldset-input-border);border-radius:var(--x-fieldset-input-radius);padding:0.5rem 0.75rem;font:inherit;outline:none;box-sizing:border-box;}x-fieldset input:focus,x-fieldset select:focus,x-fieldset textarea:focus{border-color:var(--x-fieldset-input-focus);box-shadow:0 0 0 2px var(--x-fieldset-input-focus);}";
|
|
5
5
|
document.head.appendChild(b)}if(!$APP.n($APP.l(a,"__xFieldsetRefs"))){b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("div"),h=document.createElement("slot"),k={};c.textContent=":host{display:block;color-scheme:light dark;--x-fieldset-border-color:var(--x-color-border, #d1d5db);--x-fieldset-border-width:1px;--x-fieldset-border-radius:var(--x-radius-md, 8px);--x-fieldset-padding:1rem;--x-fieldset-gap:0.75rem;--x-fieldset-bg:var(--x-color-surface,transparent);--x-fieldset-legend-color:var(--x-color-text-muted,#374151);--x-fieldset-legend-font-size:var(--x-font-size-sm, 0.875rem);--x-fieldset-legend-font-weight:600;--x-fieldset-legend-padding:0 0.375rem;--x-fieldset-disabled-opacity:0.45;--x-fieldset-input-bg:var(--x-color-surface,#ffffff);--x-fieldset-input-color:var(--x-color-text,#0f172a);--x-fieldset-input-border:var(--x-color-border,#d1d5db);--x-fieldset-input-radius:var(--x-radius-sm,0.375rem);--x-fieldset-input-focus:var(--x-color-focus-ring,#60a5fa);}@media (prefers-color-scheme:dark){:host{--x-fieldset-border-color:var(--x-color-border, #374151);--x-fieldset-legend-color:var(--x-color-text-muted,#d1d5db);--x-fieldset-input-bg:var(--x-color-surface,#1f2937);--x-fieldset-input-color:var(--x-color-text,#e5e7eb);--x-fieldset-input-border:var(--x-color-border,#374151);--x-fieldset-input-focus:var(--x-color-focus-ring,#93c5fd);}}[part\x3droot]{display:block;border:var(--x-fieldset-border-width) solid var(--x-fieldset-border-color);border-radius:var(--x-fieldset-border-radius);padding:var(--x-fieldset-padding);background:var(--x-fieldset-bg);position:relative;}:host([data-disabled]) [part\x3droot]{opacity:var(--x-fieldset-disabled-opacity);}[part\x3dlegend]{display:block;position:absolute;top:calc(-0.5em);left:calc(var(--x-fieldset-border-radius) - 0.375rem);padding:var(--x-fieldset-legend-padding);color:var(--x-fieldset-legend-color);font-size:var(--x-fieldset-legend-font-size);font-weight:var(--x-fieldset-legend-font-weight);background:inherit;line-height:1;white-space:nowrap;}[part\x3dlegend][hidden]{display:none;}[part\x3dcontent]{display:flex;flex-direction:column;gap:var(--x-fieldset-gap);}";
|
|
6
|
-
$APP.S(d,"part","root");$APP.S(d,"role","group");$APP.S(e,"part","legend");$APP.S(e,"id","x-fieldset-legend");$APP.S(f,"part","content");f.appendChild(h);d.appendChild(e);d.appendChild(f);b.appendChild(c);b.appendChild(d);k.root=b;k["root-el"]=d;k["legend-el"]=e;k["content-el"]=f;$APP.Q(a,"__xFieldsetRefs",k)}return gR(a)},
|
|
7
|
-
$APP.
|
|
6
|
+
$APP.S(d,"part","root");$APP.S(d,"role","group");$APP.S(e,"part","legend");$APP.S(e,"id","x-fieldset-legend");$APP.S(f,"part","content");f.appendChild(h);d.appendChild(e);d.appendChild(f);b.appendChild(c);b.appendChild(d);k.root=b;k["root-el"]=d;k["legend-el"]=e;k["content-el"]=f;$APP.Q(a,"__xFieldsetRefs",k)}return gR(a)},nja=function(a,b,c,d){return $APP.I(c,d)?gR(a):null},pja=function(a){return $APP.uj(a,oja)},hR=function(){return $APP.si("x-fieldset",new $APP.M(null,4,[$APP.ji,qja,$APP.hi,mja,
|
|
7
|
+
$APP.di,nja,$APP.ii,pja],null))},fR=new $APP.F(null,"legend-visible?","legend-visible?",-281107501),dR=new $APP.F(null,"legend-raw","legend-raw",907427195),eR=new $APP.F(null,"legend","legend",-1027192245);var qja=["legend","disabled","aria-label","aria-describedby"],oja=new $APP.M(null,2,[eR,new $APP.M(null,2,[$APP.N,$APP.X,$APP.W,"legend"],null),$APP.un,new $APP.M(null,2,[$APP.N,$APP.sj,$APP.W,"disabled"],null)],null);$APP.ha("baredom.exports.x_fieldset.init",hR);export const init=hR;
|
|
@@ -4,12 +4,16 @@ export function init(): void;
|
|
|
4
4
|
|
|
5
5
|
export interface XFileDownloadEventMap {
|
|
6
6
|
"x-file-download-click": CustomEvent<{ href: string; filename: string }>;
|
|
7
|
+
"x-file-download-success": CustomEvent<{ filename: string }>;
|
|
8
|
+
"x-file-download-cancel": CustomEvent<{}>;
|
|
9
|
+
"x-file-download-error": CustomEvent<{ error: string; phase: string }>;
|
|
7
10
|
}
|
|
8
11
|
|
|
9
12
|
export interface XFileDownload extends HTMLElement {
|
|
10
13
|
href: string;
|
|
11
14
|
filename: string;
|
|
12
15
|
disabled: boolean;
|
|
16
|
+
picker: boolean;
|
|
13
17
|
|
|
14
18
|
addEventListener<K extends keyof XFileDownloadEventMap>(
|
|
15
19
|
type: K,
|
package/dist/x-file-download.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var pH=function(a){var b=typeof a==="string";return b?a.startsWith("data:"):b},qH=function(a,b){b=$APP.G(b);b=$APP.C(b,$APP.Vv);a.href=b},rH=function(a,b){var c=$APP.G(b);b=$APP.C(c,$APP.Vv);c=$APP.C(c,$APP.Du);b=$APP.Ei(c)?c:$APP.n(pH(b))?"":null;b==null?$APP.U(a,"download"):$APP.S(a,"download",b)},vH=function(a){if($APP.n($APP.l(a,"__xFileDownloadRefs"))){var b=new $APP.M(null,5,[sH,a.getAttribute("href"),$APP.Mq,a.getAttribute("filename"),$APP.Qj,a.hasAttribute("disabled"),$APP.bm,a.getAttribute("aria-label"),
|
|
3
|
+
tH,a.hasAttribute("picker")],null);var c=$APP.G(b);b=$APP.C(c,sH);var d=$APP.C(c,$APP.Mq),e=$APP.C(c,$APP.Qj),f=$APP.C(c,$APP.bm);c=$APP.C(c,tH);b=new $APP.M(null,5,[$APP.Vv,$APP.Qi(b),$APP.Du,$APP.n(d)?d:"",$APP.Xj,$APP.D(e),$APP.km,f,uH,$APP.D(c)],null);$APP.I($APP.l(a,"__xFileDownloadModel"),b)?(d=$APP.l(a,"__xFileDownloadRefs"),$APP.n(d)?(d=$APP.l(d,"anchor-el"),qH(d,b),rH(d,b),f=$APP.G(b),e=$APP.C(f,$APP.Xj),f=$APP.C(f,$APP.km),$APP.n(e)?$APP.S(d,"aria-disabled","true"):$APP.U(d,"aria-disabled"),
|
|
4
|
+
$APP.n(f)?$APP.S(d,"aria-label",f):$APP.U(d,"aria-label"),d=$APP.G(b),d=$APP.C(d,$APP.Xj),$APP.aj(a,"data-disabled",d),a=$APP.Q(a,"__xFileDownloadModel",b)):a=null):a=null;return a}return null},wH=function(a,b){$APP.$i(a,"__xFileDownloadAbort",b);b=b!=null;var c=$APP.l($APP.l(a,"__xFileDownloadRefs"),"anchor-el");$APP.aj(a,"data-busy",b);$APP.n(b)?$APP.S(c,"aria-busy","true"):$APP.U(c,"aria-busy")},xH=function(a){return function(b){var c=Promise,d=c.reject;$APP.Xc(b)||(b=b!=null?b.name:null,b=$APP.Ei(b)?
|
|
5
|
+
b:"Error",b=new $APP.M(null,2,[$APP.tr,a,$APP.wj,b],null));return d.call(c,b)}},kea=function(a){return new Promise(function(b){var c=window,d=c.showSaveFilePicker,e=$APP.G(a),f=$APP.C(e,$APP.Vv);e=$APP.C(e,$APP.Du);if($APP.Ei(e))var h=e;else{if(e=typeof f==="string")if(e=$APP.p(pH(f)))e=typeof f==="string",e=$APP.p(e?f.startsWith("blob:"):e);if(e){f=$APP.Ic($APP.t(f.split(/[?#]/)).replace(iea,"").split("/"));try{h=decodeURIComponent(f)}catch(k){h=f}h=$APP.q(h)?h:null}else h=null}c=d.call(c,$APP.an(h==
|
|
6
|
+
null?$APP.ke:new $APP.M(null,1,[jea,h],null)));return b.i?b.i(c):b.call(null,c)})},lea=function(a,b){return fetch(b,{signal:a}).then(function(c){return $APP.n(c.ok)?c:Promise.reject(new $APP.M(null,2,[$APP.tr,"fetch",$APP.wj,"HTTP "+$APP.P.i(c.status)],null))})},mea=function(a,b,c){return b.createWritable().then(function(d){var e=c.body;return($APP.n(e)?e:(new Response("")).body).pipeTo(d,{signal:a})})},nea=function(a,b,c){return lea(a,b).catch(xH("fetch")).then(function(d){return mea(a,c,d).catch(xH("write"))}).then(function(){return c.name})},
|
|
7
|
+
pea=function(a,b){var c=new AbortController,d=c.signal;wH(a,c);return kea(b).catch(xH("pick")).then(function(e){return nea(d,$APP.Vv.i(b),e)}).then(function(e){wH(a,null);return $APP.fj(a,"x-file-download-success",{filename:e})},function(e){a:{var f=$APP.G(e);e=$APP.C(f,$APP.tr);var h=$APP.C(f,$APP.wj);wH(a,null);var k=$APP.G(f);f=$APP.C(k,$APP.tr);k=$APP.C(k,$APP.wj);f=$APP.Lc(oea,new $APP.J(null,2,5,$APP.K,[f,k],null),$APP.wj);f=f instanceof $APP.F?f.da:null;switch(f){case "cancel":e=$APP.fj(a,
|
|
8
|
+
"x-file-download-cancel",{});break a;case "fallback":e=document.createElement("a");qH(e,b);rH(e,b);e=e.click();break a;case "error":e=$APP.fj(a,"x-file-download-error",{error:h,phase:e});break a;default:throw Error("No matching clause: "+$APP.P.i(f));}}return e})},qea=function(a,b){var c=$APP.l(a,"__xFileDownloadModel"),d=$APP.Xj.i(c);if($APP.n($APP.n(d)?d:$APP.l(a,"__xFileDownloadAbort")!=null))return b.preventDefault();var e=$APP.G(c);d=$APP.C(e,$APP.Vv);e=$APP.C(e,$APP.Du);if($APP.hj(a,"x-file-download-click",
|
|
9
|
+
{href:d,filename:e})){e=$APP.G(c);d=$APP.C(e,uH);e=$APP.C(e,$APP.Vv);if($APP.n(d)&&(d=$APP.I(e,""))&&(d=window.showSaveFilePicker,d=(e=typeof d==="function")?e:d!=null?$APP.Xb===d.pc?!0:d.bc?!1:$APP.ta($APP.Da,d):$APP.ta($APP.Da,d)))try{d=window.top.location.href!=null}catch(f){d=!1}return $APP.n(d)?(b.preventDefault(),pea(a,c)):null}return b.preventDefault()},rea=function(a){function b(d){return qea(a,d)}var c={};$APP.l($APP.l(a,"__xFileDownloadRefs"),"anchor-el").addEventListener("click",b);c.click=
|
|
10
|
+
b;$APP.Q(a,"__xFileDownloadHandlers",c)},yH=function(a){var b=$APP.l(a,"__xFileDownloadHandlers"),c=$APP.l(a,"__xFileDownloadRefs");$APP.n($APP.n(b)?c:b)&&(c=$APP.l(c,"anchor-el"),b=$APP.l(b,"click"),$APP.n(b)&&c.removeEventListener("click",b));$APP.Q(a,"__xFileDownloadHandlers",null)},sea=function(a){if(!$APP.n($APP.l(a,"__xFileDownloadRefs"))){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("a"),e=document.createElement("span"),f=document.createElement("span"),
|
|
11
|
+
h=document.createElement("slot");c.textContent=":host{display:inline-block;color-scheme:light dark;--x-file-download-bg:var(--x-color-primary,#2563eb);--x-file-download-color:var(--x-color-surface,#ffffff);--x-file-download-hover-bg:var(--x-color-primary-hover,#1d4ed8);--x-file-download-active-bg:var(--x-color-primary-active,#1e40af);--x-file-download-border-radius:var(--x-radius-md,6px);--x-file-download-padding:0.5rem 1rem;--x-file-download-font-size:var(--x-font-size-sm,0.875rem);--x-file-download-font-weight:500;--x-file-download-gap:0.375rem;--x-file-download-icon-size:1em;--x-file-download-focus-ring:var(--x-color-focus-ring,#60a5fa);--x-file-download-disabled-opacity:0.45;--x-file-download-transition:background var(--x-transition-duration,120ms) ease;}@media (prefers-color-scheme:dark){:host{--x-file-download-bg:var(--x-color-primary,#3b82f6);--x-file-download-hover-bg:var(--x-color-primary-hover,#2563eb);--x-file-download-active-bg:var(--x-color-primary-active,#1d4ed8);--x-file-download-focus-ring:var(--x-color-focus-ring,#93c5fd);}}[part\x3danchor]{display:inline-flex;align-items:center;gap:var(--x-file-download-gap);padding:var(--x-file-download-padding);background:var(--x-file-download-bg);color:var(--x-file-download-color);border-radius:var(--x-file-download-border-radius);font-size:var(--x-file-download-font-size);font-weight:var(--x-file-download-font-weight);text-decoration:none;cursor:pointer;box-sizing:border-box;transition:var(--x-file-download-transition);outline:none;user-select:none;-webkit-user-select:none;}[part\x3danchor]:hover{background:var(--x-file-download-hover-bg);}[part\x3danchor]:active{background:var(--x-file-download-active-bg);}[part\x3danchor]:focus-visible{outline:2px solid var(--x-file-download-focus-ring);outline-offset:2px;}[part\x3dicon]{display:inline-flex;align-items:center;justify-content:center;width:var(--x-file-download-icon-size);height:var(--x-file-download-icon-size);flex-shrink:0;}[part\x3dcontent]{display:inline;}:host([data-disabled]) [part\x3danchor]{opacity:var(--x-file-download-disabled-opacity);pointer-events:none;cursor:default;}:host([data-busy]) [part\x3danchor]{cursor:progress;}@media (prefers-reduced-motion:reduce){[part\x3danchor]{transition:none;}}";
|
|
7
12
|
$APP.S(d,"part","anchor");$APP.S(e,"part","icon");$APP.S(f,"part","content");e.innerHTML='\x3csvg xmlns\x3d"http://www.w3.org/2000/svg" viewBox\x3d"0 0 16 16" fill\x3d"currentColor" width\x3d"1em" height\x3d"1em" aria-hidden\x3d"true"\x3e\x3cpath d\x3d"M8 1a.75.75 0 0 1 .75.75v6.19l1.97-1.97a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.03a.75.75 0 0 1 1.06-1.06L7.25 7.94V1.75A.75.75 0 0 1 8 1ZM2.5 13.25a.75.75 0 0 1 .75-.75h9.5a.75.75 0 0 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75Z"/\x3e\x3c/svg\x3e';
|
|
8
|
-
f.appendChild(h);d.appendChild(e);d.appendChild(f);b.appendChild(c);b.appendChild(d);b={};b["anchor-el"]=d;b["icon-el"]=e;b["content-el"]=f;$APP.Q(a,"__xFileDownloadRefs",b)}yH(a)
|
|
13
|
+
f.appendChild(h);d.appendChild(e);d.appendChild(f);b.appendChild(c);b.appendChild(d);b={};b["anchor-el"]=d;b["icon-el"]=e;b["content-el"]=f;$APP.Q(a,"__xFileDownloadRefs",b)}yH(a);rea(a);return vH(a)},tea=function(a){yH(a);a=$APP.l(a,"__xFileDownloadAbort");return a==null?null:a.abort()},uea=function(a,b,c,d){return $APP.I(c,d)?vH(a):null},wea=function(a){return $APP.uj(a,vea)},zH=function(){return $APP.si("x-file-download",new $APP.M(null,5,[$APP.ji,xea,$APP.hi,sea,$APP.ei,tea,$APP.di,uea,$APP.ii,
|
|
14
|
+
wea],null))},tH=new $APP.F(null,"picker-present?","picker-present?",1691235229),sH=new $APP.F(null,"href-raw","href-raw",-1680949453),uH=new $APP.F(null,"picker?","picker?",44872543),jea=new $APP.F(null,"suggestedName","suggestedName",1964460200);var xea=["href","filename","disabled","aria-label","picker"],vea=new $APP.M(null,4,[$APP.Vv,new $APP.M(null,3,[$APP.N,$APP.X,$APP.W,"href",$APP.tj,""],null),$APP.Du,new $APP.M(null,3,[$APP.N,$APP.X,$APP.W,"filename",$APP.tj,""],null),$APP.un,new $APP.M(null,2,[$APP.N,$APP.sj,$APP.W,"disabled"],null),new $APP.F(null,"picker","picker",-659389603),new $APP.M(null,2,[$APP.N,$APP.sj,$APP.W,"picker"],null)],null);
|
|
15
|
+
$APP.je(["x-file-download-click",new $APP.M(null,2,[$APP.$u,!0,$APP.V,new $APP.M(null,2,[$APP.Vv,$APP.X,$APP.Du,$APP.X],null)],null),"x-file-download-success",new $APP.M(null,2,[$APP.$u,!1,$APP.V,new $APP.M(null,1,[$APP.Du,$APP.X],null)],null),"x-file-download-cancel",new $APP.M(null,2,[$APP.$u,!1,$APP.V,$APP.ke],null),"x-file-download-error",new $APP.M(null,2,[$APP.$u,!1,$APP.V,new $APP.M(null,2,[$APP.wj,$APP.X,$APP.tr,$APP.X],null)],null)]);
|
|
16
|
+
var iea=/^(?:[A-Za-z][A-Za-z0-9+.-]*:)?\/\/[^\/?#]*/,oea=$APP.je([new $APP.J(null,2,5,$APP.K,["pick","AbortError"],null),$APP.Zv,new $APP.J(null,2,5,$APP.K,["pick","SecurityError"],null),$APP.Eu]);$APP.ha("baredom.exports.x_file_download.init",zH);export const init=zH;
|