@vanelsas/baredom 0.2.2-alpha → 0.2.3-alpha
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 +7 -0
- package/README.md +1 -1
- package/dist/base.js +164 -164
- package/dist/x-alert.js +17 -17
- package/dist/x-avatar-group.js +11 -11
- package/dist/x-avatar.js +16 -16
- package/dist/x-badge.js +11 -11
- package/dist/x-breadcrumbs.js +14 -14
- package/dist/x-button.js +15 -15
- package/dist/x-cancel-dialogue.js +16 -18
- package/dist/x-card.js +7 -7
- package/dist/x-chart.js +47 -43
- package/dist/x-checkbox.js +11 -11
- package/dist/x-chip.js +9 -9
- package/dist/x-collapse.js +10 -10
- package/dist/x-command-palette.js +29 -29
- package/dist/x-container.js +5 -5
- package/dist/x-context-menu.js +19 -18
- package/dist/x-copy.js +21 -21
- package/dist/x-currency-field.js +19 -19
- package/dist/x-date-picker.js +33 -33
- package/dist/x-divider.js +9 -9
- package/dist/x-drawer.js +11 -11
- package/dist/x-dropdown.js +9 -9
- package/dist/x-fieldset.js +6 -6
- package/dist/x-file-download.js +7 -7
- package/dist/x-form-field.js +15 -15
- package/dist/x-form.js +9 -9
- package/dist/x-grid.js +7 -7
- package/dist/x-menu-item.js +10 -10
- package/dist/x-menu.js +10 -10
- package/dist/x-modal.js +12 -12
- package/dist/x-navbar.js +11 -11
- package/dist/x-notification-center.js +9 -9
- package/dist/x-pagination.js +16 -16
- package/dist/x-popover.js +11 -11
- package/dist/x-progress-circle.js +7 -7
- package/dist/x-progress.js +7 -7
- package/dist/x-radio.js +11 -11
- package/dist/x-search-field.js +14 -14
- package/dist/x-select.js +9 -9
- package/dist/x-sidebar.js +25 -25
- package/dist/x-skeleton.js +5 -5
- package/dist/x-slider.js +16 -16
- package/dist/x-spacer.js +5 -5
- package/dist/x-spinner.js +5 -5
- package/dist/x-stat.js +7 -7
- package/dist/x-stepper.js +15 -15
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +7 -7
- package/dist/x-table-cell.js +20 -20
- package/dist/x-table-row.js +10 -10
- package/dist/x-table.js +11 -11
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +17 -17
- package/dist/x-timeline-item.js +20 -20
- package/dist/x-timeline.js +9 -9
- package/dist/x-toast.js +21 -21
- package/dist/x-toaster.js +8 -8
- package/package.json +1 -1
package/dist/x-date-picker.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a):null},
|
|
4
|
-
c:"default",{year:"numeric",month:"long",day:"numeric",timeZone:"UTC"})).format(a):
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"range");b=
|
|
8
|
-
2,[
|
|
9
|
-
|
|
10
|
-
$APP.E.h(0,
|
|
11
|
-
c.textContent=h);if(!$APP.n($APP.l(a,"__xDatePickerWeekdaysDone")))for(a.__xDatePickerWeekdaysDone=!0,c="Su Mo Tu We Th Fr Sa".split(" "),h=0;;)if(h<7)g=
|
|
12
|
-
var m=
|
|
13
|
-
"false");$APP.n(v)&&m.setAttribute("disabled","");m.textContent=""+$APP.S.g(r);d.appendChild(m);g+=1}else if(a=$APP.u(e))e=a,$APP.yc(e)?(c=$APP.ob(e),e=$APP.pb(e),a=c,h=$APP.B(c),c=a):(a=$APP.x(e),a=$APP.M(a),k=$APP.I(a,
|
|
14
|
-
c.setAttribute("data-disabled",$APP.n(m)?"true":"false"),c.setAttribute("data-selected",$APP.n(k)?"true":"false"),c.setAttribute("data-in-range",$APP.n(q)?"true":"false"),c.setAttribute("data-range-edge",$APP.n(r)?"true":"false"),$APP.n(m)&&c.setAttribute("disabled",""),c.textContent=""+$APP.S.g(g),d.appendChild(c),e=$APP.y(e),c=null,h=0),g=0;else{d=null;break a}d=void 0}else d=null;return d}return null},
|
|
15
|
-
"__xDatePickerState");c=$APP.n(c)?$APP.l(c,"disp"):null;a=$APP.l(a,"__xDatePickerFocused");return $APP.n($APP.n(b)?$APP.p(a):b)?b.value=$APP.n(c)?c:"":null},
|
|
16
|
-
b.removeAttribute("disabled"));$APP.n($APP.n(d)?m:d)&&a.removeAttribute("open");$APP.n(c)&&($APP.n(d)?(c.setAttribute("disabled",""),c.setAttribute("aria-disabled","true")):(c.removeAttribute("disabled"),c.removeAttribute("aria-disabled")),$APP.n(e)&&c.setAttribute("readonly",""),$APP.n(e)||c.removeAttribute("readonly"),$APP.n(g)&&c.setAttribute("placeholder",g),$APP.n(h)&&c.setAttribute("aria-label",h),$APP.n(k)&&c.setAttribute("aria-describedby",k));
|
|
17
|
-
b){$APP.n(b)?a.setAttribute("value",
|
|
18
|
-
return $APP.n(r)?r:0}();g=
|
|
19
|
-
r}())&&a.removeAttribute("open")}else a.setAttribute("start",
|
|
20
|
-
if($APP.E.h(e,
|
|
21
|
-
d=$APP.M(c),c=$APP.I(d,
|
|
22
|
-
a.__xDatePickerRangeStep=0;
|
|
23
|
-
b=b.currentTarget.getAttribute("data-nav");return $APP.E.h(b,"prev")?
|
|
24
|
-
D)}function g(D){return
|
|
25
|
-
"Escape")?
|
|
26
|
-
k);z.addEventListener("click",h);A.addEventListener("click",g);C.addEventListener("click",e);F.addEventListener("click",d);v.addEventListener("mousedown",c);document.addEventListener("pointerdown",b,!0);$APP.ma(a,"__xDatePickerHandlers",{"pop-md":c,keydown:q,grid:d,next:e,blur:k,prev:g,focus:m,input:r,btn:h,"doc-click":b})},
|
|
2
|
+
var SB=function(a){return typeof a==="string"?(a=a.trim(),$APP.N(a,"")?a:null):null},TB=function(a){return a!=null&&$APP.N(a,"false")},UB=function(a){return a<10?"0"+$APP.S.g(a):""+$APP.S.g(a)},VB=function(a){return $APP.n(a)?""+$APP.S.g(a.getUTCFullYear())+"-"+$APP.S.g(UB(a.getUTCMonth()+1))+"-"+$APP.S.g(UB(a.getUTCDate())):null},WB=function(a){var b=(b=typeof a==="string")?$APP.Ef(/\d{4}-\d{2}-\d{2}/,a):b;return $APP.n(b)?(a=new Date(""+$APP.S.g(a)+"T00:00:00.000Z"),$APP.n(isNaN(a.getTime()))?null:
|
|
3
|
+
a):null},XB=function(a,b){if(a==null&&b==null)return 0;if(a==null)return-1;if(b==null)return 1;a=a.getTime();b=b.getTime();return a<b?-1:a>b?1:0},YB=function(a){return $APP.n(a)?new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)):null},ZB=function(a,b,c){if($APP.n($APP.n(a)?$APP.n(b)?c:b:a)){var d=XB(b,c)<0?c:b;return!(XB(a,XB(b,c)<0?b:c)<0)&&!(XB(a,d)>0)}return null},bC=function(a,b){var c=$APP.M(b);b=$APP.I(c,$B);c=$APP.I(c,$APP.bj);return $APP.n(a)?$APP.E.h(b,aC)?(new Intl.DateTimeFormat($APP.n(c)?
|
|
4
|
+
c:"default",{year:"numeric",month:"long",day:"numeric",timeZone:"UTC"})).format(a):VB(a):null},eC=function(a){a=SB(a);a=$APP.n(a)?WB(a):null;return new $APP.P(null,2,[cC,a!=null,dC,a],null)},uC=function(a){var b=$APP.M(a),c=$APP.I(b,$APP.th),d=$APP.I(b,$APP.oh),e=$APP.I(b,$APP.Ti);a=$APP.I(b,$B);var g=$APP.I(b,$APP.bj),h=$APP.I(b,fC),k=$APP.I(b,$APP.T),m=$APP.I(b,$APP.di),q=$APP.I(b,$APP.xi),r=$APP.I(b,$APP.eh),v=$APP.I(b,gC);b=$APP.E.h(m,"range")?hC:iC;a=$APP.E.h(a,"localized")?aC:jC;g=SB(g);m=function(){var A=
|
|
5
|
+
SB(d);return $APP.n(A)?A:" - "}();e=WB(e);r=WB(r);v=$APP.J(v);h=$APP.J(h);if($APP.E.h(b,iC))return b=WB(k),$APP.cf([$B,kC,$APP.bj,lC,$APP.di,mC,gC,nC,$APP.oh,oC,pC],[a,b,g,h,iC,r,v,b!=null,m,e,function(){var A=SB(k);return $APP.n(A)?A:""}()]);var w=WB(q),z=WB(c);b=w!=null&&z!=null;return $APP.cf([qC,$B,rC,$APP.bj,lC,$APP.di,mC,sC,tC,gC,nC,$APP.oh,oC],[function(){var A=SB(c);return $APP.n(A)?A:""}(),a,w,g,h,hC,r,function(){var A=SB(q);return $APP.n(A)?A:""}(),z,v,b,m,e])},wC=function(a){if($APP.n(a)){var b=
|
|
6
|
+
YB(a),c=$APP.n(b)?new Date(b.getTime()+-($APP.n(b)?b.getUTCDay():0)*864E5):null;return $APP.Md(function(d){d=$APP.n(c)?new Date(c.getTime()+d*864E5):null;var e=$APP.E.h(d.getUTCMonth(),a.getUTCMonth());return new $APP.P(null,2,[dC,d,vC,e],null)},$APP.Cf(0,42))}return null},xC=function(a){return document.createElement(a)},yC=function(a,b,c,d){b=new CustomEvent(b,{detail:d,bubbles:!0,composed:!0,cancelable:$APP.J(c)});a.dispatchEvent(b);return b},zC=function(a){var b=a.getAttribute("mode");$APP.E.h(b,
|
|
7
|
+
"range");b=uC($APP.cf([$APP.Ti,$B,$APP.bj,fC,$APP.T,$APP.di,$APP.xi,$APP.eh,gC,$APP.th,$APP.oh],[a.getAttribute("min"),a.getAttribute("format"),a.getAttribute("locale"),TB(a.getAttribute("range-allow-same-day")),a.getAttribute("value"),b,a.getAttribute("start"),a.getAttribute("max"),TB(a.getAttribute("auto-swap")),a.getAttribute("end"),a.getAttribute("separator")]));var c=new $APP.P(null,2,[$B,$B.g(b),$APP.bj,$APP.bj.g(b)],null);var d=$APP.M(c);var e=$APP.I(d,$B);d=$APP.I(d,$APP.bj);e=new $APP.P(null,
|
|
8
|
+
2,[$B,e,$APP.bj,d],null);if($APP.E.h($APP.di.g(b),iC))e=$APP.n(kC.g(b))?bC(kC.g(b),e):"";else{d=$APP.oh.g(b);var g=rC.g(b);g=$APP.n(g)?tC.g(b):g;e=$APP.n(g)?""+$APP.S.g(bC(rC.g(b),e))+$APP.S.g(d)+$APP.S.g(bC(tC.g(b),e)):$APP.n(rC.g(b))?bC(rC.g(b),e):""}d=$APP.l(a,"__xDatePickerState");d=$APP.n(d)?$APP.l(d,"month"):null;g=kC.g(b);$APP.n(g)||(g=rC.g(b),g=$APP.n(g)?g:new Date(Date.now()));d=$APP.n(d)?d:YB(g);a.__xDatePickerState={canon:b,cfg:c,disp:e,month:d}},AC=function(a,b){var c=oC.g(b);c=$APP.n(c)?
|
|
9
|
+
XB(a,oC.g(b))<0:c;if($APP.n(c))return c;c=mC.g(b);return $APP.n(c)?XB(a,mC.g(b))>0:c},DC=function(a,b){if($APP.E.h($APP.di.g(b),iC))return new $APP.P(null,3,[$APP.Ih,function(){var k=kC.g(b);return $APP.n(k)?$APP.E.h(0,XB(a,kC.g(b))):k}(),BC,!1,CC,!1],null);var c=rC.g(b),d=tC.g(b),e=function(){var k=$APP.n(c)?$APP.E.h(0,XB(a,c)):c;return $APP.n(k)?k:$APP.n(d)?$APP.E.h(0,XB(a,d)):d}(),g=$APP.n(c)?$APP.n(d)?ZB(a,c,d):d:c,h=function(){var k=$APP.n(c)?$APP.E.h(0,XB(a,c)):c;return $APP.n(k)?k:$APP.n(d)?
|
|
10
|
+
$APP.E.h(0,XB(a,d)):d}();return new $APP.P(null,3,[$APP.Ih,e,BC,g,CC,h],null)},EC=function(a){var b=$APP.l(a,"__xDatePickerRefs");if($APP.n(b)){var c=$APP.l(b,"month-label"),d=$APP.l(b,"grid"),e=$APP.l(b,"weekdays"),g=$APP.l(a,"__xDatePickerState");b=$APP.n(g)?$APP.l(g,"canon"):null;var h=$APP.n(g)?$APP.l(g,"month"):null;g=$APP.n(g)?$APP.l(g,"cfg"):null;g=$APP.n(g)?$APP.bj.g(g):null;$APP.n(c)&&(h=(new Intl.DateTimeFormat($APP.n(g)?g:"default",{year:"numeric",month:"long",timeZone:"UTC"})).format(h),
|
|
11
|
+
c.textContent=h);if(!$APP.n($APP.l(a,"__xDatePickerWeekdaysDone")))for(a.__xDatePickerWeekdaysDone=!0,c="Su Mo Tu We Th Fr Sa".split(" "),h=0;;)if(h<7)g=xC("div"),g.setAttribute("part","weekday"),g.setAttribute("aria-hidden","true"),g.textContent=c[h],e.appendChild(g),h+=1;else break;if($APP.n($APP.n(d)?b:d))a:{d.textContent="";a=$APP.l(a,"__xDatePickerState");a=wC($APP.n(a)?$APP.l(a,"month"):null);e=$APP.u(a);c=null;for(g=h=0;;)if(g<h){a=c.F(null,g);a=$APP.M(a);var k=$APP.I(a,dC);a=$APP.I(a,vC);
|
|
12
|
+
var m=xC("button"),q=VB(k),r=k.getUTCDate(),v=AC(k,b);k=DC(k,b);var w=$APP.M(k);k=$APP.I(w,$APP.Ih);var z=$APP.I(w,BC);w=$APP.I(w,CC);m.setAttribute("part","day");m.setAttribute("type","button");m.setAttribute("data-iso",q);m.setAttribute("data-outside",$APP.n(a)?"false":"true");m.setAttribute("data-disabled",$APP.n(v)?"true":"false");m.setAttribute("data-selected",$APP.n(k)?"true":"false");m.setAttribute("data-in-range",$APP.n(z)?"true":"false");m.setAttribute("data-range-edge",$APP.n(w)?"true":
|
|
13
|
+
"false");$APP.n(v)&&m.setAttribute("disabled","");m.textContent=""+$APP.S.g(r);d.appendChild(m);g+=1}else if(a=$APP.u(e))e=a,$APP.yc(e)?(c=$APP.ob(e),e=$APP.pb(e),a=c,h=$APP.B(c),c=a):(a=$APP.x(e),a=$APP.M(a),k=$APP.I(a,dC),a=$APP.I(a,vC),c=xC("button"),h=VB(k),g=k.getUTCDate(),m=AC(k,b),k=DC(k,b),r=$APP.M(k),k=$APP.I(r,$APP.Ih),q=$APP.I(r,BC),r=$APP.I(r,CC),c.setAttribute("part","day"),c.setAttribute("type","button"),c.setAttribute("data-iso",h),c.setAttribute("data-outside",$APP.n(a)?"false":"true"),
|
|
14
|
+
c.setAttribute("data-disabled",$APP.n(m)?"true":"false"),c.setAttribute("data-selected",$APP.n(k)?"true":"false"),c.setAttribute("data-in-range",$APP.n(q)?"true":"false"),c.setAttribute("data-range-edge",$APP.n(r)?"true":"false"),$APP.n(m)&&c.setAttribute("disabled",""),c.textContent=""+$APP.S.g(g),d.appendChild(c),e=$APP.y(e),c=null,h=0),g=0;else{d=null;break a}d=void 0}else d=null;return d}return null},FC=function(a){var b=$APP.l(a,"__xDatePickerRefs");b=$APP.n(b)?$APP.l(b,"input"):null;var c=$APP.l(a,
|
|
15
|
+
"__xDatePickerState");c=$APP.n(c)?$APP.l(c,"disp"):null;a=$APP.l(a,"__xDatePickerFocused");return $APP.n($APP.n(b)?$APP.p(a):b)?b.value=$APP.n(c)?c:"":null},GC=function(a){var b=$APP.l(a,"__xDatePickerRefs");if($APP.n(b)){var c=$APP.l(b,"input");b=$APP.l(b,"btn");var d=a.hasAttribute("disabled"),e=a.hasAttribute("readonly"),g=a.getAttribute("placeholder"),h=a.getAttribute("aria-label"),k=a.getAttribute("aria-describedby"),m=a.hasAttribute("open");$APP.n(b)&&($APP.n(d)?b.setAttribute("disabled",""):
|
|
16
|
+
b.removeAttribute("disabled"));$APP.n($APP.n(d)?m:d)&&a.removeAttribute("open");$APP.n(c)&&($APP.n(d)?(c.setAttribute("disabled",""),c.setAttribute("aria-disabled","true")):(c.removeAttribute("disabled"),c.removeAttribute("aria-disabled")),$APP.n(e)&&c.setAttribute("readonly",""),$APP.n(e)||c.removeAttribute("readonly"),$APP.n(g)&&c.setAttribute("placeholder",g),$APP.n(h)&&c.setAttribute("aria-label",h),$APP.n(k)&&c.setAttribute("aria-describedby",k));FC(a);return EC(a)}return null},HC=function(a,
|
|
17
|
+
b){$APP.n(b)?a.setAttribute("value",VB(b)):a.removeAttribute("value")},IC=function(a,b){var c=$APP.l(a,"__xDatePickerState");c=$APP.n(c)?$APP.l(c,"canon"):null;var d=$APP.n(c)?$APP.di.g(c):null,e={iso:VB(b),reason:"click"},g=yC(a,"x-date-picker-change-request",!0,e);if($APP.n(g.defaultPrevented))return null;if($APP.E.h(d,iC))return HC(a,b),zC(a),GC(a),yC(a,"x-date-picker-change",!1,e),$APP.n(a.hasAttribute("close-on-select"))?(a.removeAttribute("open"),GC(a)):null;d=function(){var r=$APP.l(a,"__xDatePickerRangeStep");
|
|
18
|
+
return $APP.n(r)?r:0}();g=rC.g(c);tC.g(c);if($APP.E.h(d,0))a.setAttribute("start",VB(b)),a.removeAttribute("end"),a.__xDatePickerRangeStep=1;else if($APP.E.h(d,1)){var h=lC.g(c),k=XB(b,g);if($APP.n(function(){var r=k>0;return r?r:$APP.n(h)?k===0:h}())){var m=$APP.n(gC.g(c))?XB(g,b)<0?g:b:g,q=$APP.n(gC.g(c))?XB(g,b)>0?g:b:b;a.setAttribute("start",VB(m));a.setAttribute("end",VB(q));a.__xDatePickerRangeStep=0;$APP.n(function(){var r=a.hasAttribute("close-on-select");return $APP.n(r)?m!=null&&q!=null:
|
|
19
|
+
r}())&&a.removeAttribute("open")}else a.setAttribute("start",VB(b)),a.removeAttribute("end"),a.__xDatePickerRangeStep=1}else a.setAttribute("start",VB(b)),a.removeAttribute("end"),a.__xDatePickerRangeStep=1;zC(a);GC(a);return yC(a,"x-date-picker-change",!1,e)},JC=function(a,b){var c=$APP.l(a,"__xDatePickerRefs");c=$APP.n(c)?$APP.l(c,"input"):null;c=$APP.n(c)?c.value:null;var d=$APP.l(a,"__xDatePickerState");d=$APP.n(d)?$APP.l(d,"canon"):null;var e=$APP.di.g(d);yC(a,"x-date-picker-input",!1,{value:c});
|
|
20
|
+
if($APP.E.h(e,iC)){if(c=eC(c),d=$APP.M(c),c=$APP.I(d,cC),d=$APP.I(d,dC),$APP.n(c)){c=yC(a,"x-date-picker-change-request",!0,{iso:VB(d),reason:b});if($APP.n(c.defaultPrevented))return null;HC(a,d);zC(a);GC(a);return yC(a,"x-date-picker-change",!1,{iso:VB(d),reason:b})}}else if(d=new $APP.P(null,1,[$APP.oh,$APP.oh.g(d)],null),d=$APP.M(d),d=$APP.I(d,$APP.oh),d=typeof d==="string"&&d.length>0?d:" - ",c=SB(c),c==null?c=new $APP.P(null,3,[cC,!1,$APP.xi,null,$APP.th,null],null):(e=c.indexOf(d),e<0?(c=eC(c),
|
|
21
|
+
d=$APP.M(c),c=$APP.I(d,cC),d=$APP.I(d,dC),c=new $APP.P(null,3,[cC,c,$APP.xi,d,$APP.th,null],null)):(d=c.substring(e+d.length).trim(),c=WB(c.substring(0,e).trim()),d=WB(d),c=new $APP.P(null,3,[cC,c!=null&&d!=null,$APP.xi,c,$APP.th,d],null))),e=$APP.M(c),c=$APP.I(e,cC),d=$APP.I(e,$APP.xi),e=$APP.I(e,$APP.th),$APP.n(c)){c=yC(a,"x-date-picker-change-request",!0,{"start-iso":VB(d),"end-iso":VB(e),reason:b});if($APP.n(c.defaultPrevented))return null;a.setAttribute("start",VB(d));a.setAttribute("end",VB(e));
|
|
22
|
+
a.__xDatePickerRangeStep=0;zC(a);GC(a);return yC(a,"x-date-picker-change",!1,{"start-iso":VB(d),"end-iso":VB(e),reason:b})}return null},LC=function(a,b){var c=$APP.l(a,"__xDatePickerState"),d=$APP.n(c)?$APP.l(c,"month"):null;if($APP.n(d)){var e=d.getUTCFullYear();d=d.getUTCMonth();b=$APP.E.h(b,KC)?new Date(Date.UTC(e,d+1,1)):new Date(Date.UTC(e,d-1,1));c.month=b;return EC(a)}return null},MC=function(a){return $APP.n(a.hasAttribute("open"))?a.removeAttribute("open"):null},OC=function(a,b){if($APP.n(a.hasAttribute("disabled")))return null;
|
|
23
|
+
b=b.currentTarget.getAttribute("data-nav");return $APP.E.h(b,"prev")?LC(a,NC):LC(a,KC)},PC=function(a){function b(D){return $APP.n(a.hasAttribute("open"))?$APP.n(D.composedPath().some(function(Q){return Q===a}))?null:MC(a):null}function c(D){return D.preventDefault()}function d(D){$APP.n(a.hasAttribute("disabled"))?D=null:(D=D.target.closest("button[data-iso]"),$APP.n($APP.n(D)?$APP.p(D.hasAttribute("disabled")):D)?(D=D.getAttribute("data-iso"),D=WB(D),D=$APP.n(D)?IC(a,D):null):D=null);return D}function e(D){return OC(a,
|
|
24
|
+
D)}function g(D){return OC(a,D)}function h(){if($APP.n(a.hasAttribute("disabled")))var D=null;else $APP.n(a.hasAttribute("open"))?D=MC(a):$APP.n(a.hasAttribute("open"))?D=null:(a.setAttribute("open",""),D=EC(a));return D}function k(){a.__xDatePickerFocused=!1;$APP.n(a.hasAttribute("disabled"))||JC(a,"blur");return FC(a)}function m(){a.__xDatePickerFocused=!0}function q(D){if($APP.n(a.hasAttribute("disabled")))D=null;else{var Q=D.key;$APP.E.h(Q,"Enter")?(D.preventDefault(),D=JC(a,"keyboard")):D=$APP.E.h(Q,
|
|
25
|
+
"Escape")?MC(a):null}return D}function r(){var D=$APP.l(a,"__xDatePickerRefs");D=$APP.n(D)?$APP.l(D,"input"):null;a.__xDatePickerDisplay=$APP.n(D)?D.value:null;return yC(a,"x-date-picker-input",!1,{value:$APP.n(D)?D.value:null})}var v=$APP.l(a,"__xDatePickerRefs"),w=$APP.l(v,"input"),z=$APP.l(v,"btn"),A=$APP.l(v,"nav-prev"),C=$APP.l(v,"nav-next"),F=$APP.l(v,"grid");v=$APP.l(v,"popover");w.addEventListener("input",r);w.addEventListener("keydown",q);w.addEventListener("focus",m);w.addEventListener("blur",
|
|
26
|
+
k);z.addEventListener("click",h);A.addEventListener("click",g);C.addEventListener("click",e);F.addEventListener("click",d);v.addEventListener("mousedown",c);document.addEventListener("pointerdown",b,!0);$APP.ma(a,"__xDatePickerHandlers",{"pop-md":c,keydown:q,grid:d,next:e,blur:k,prev:g,focus:m,input:r,btn:h,"doc-click":b})},QC=function(a){var b=$APP.l(a,"__xDatePickerRefs");a=$APP.l(a,"__xDatePickerHandlers");if($APP.n($APP.n(b)?a:b)){var c=$APP.l(b,"input"),d=$APP.l(b,"btn"),e=$APP.l(b,"nav-prev"),
|
|
27
27
|
g=$APP.l(b,"nav-next"),h=$APP.l(b,"grid");b=$APP.l(b,"popover");c.removeEventListener("input",$APP.l(a,"input"));c.removeEventListener("keydown",$APP.l(a,"keydown"));c.removeEventListener("focus",$APP.l(a,"focus"));c.removeEventListener("blur",$APP.l(a,"blur"));d.removeEventListener("click",$APP.l(a,"btn"));e.removeEventListener("click",$APP.l(a,"prev"));g.removeEventListener("click",$APP.l(a,"next"));h.removeEventListener("click",$APP.l(a,"grid"));b.removeEventListener("mousedown",$APP.l(a,"pop-md"));
|
|
28
|
-
return document.removeEventListener("pointerdown",$APP.l(a,"doc-click"),!0)}return null},
|
|
29
|
-
""):this.removeAttribute(c)}})},
|
|
30
|
-
[],$APP.Ra(b))}var b=new $APP.Dd;$APP.Ed(b,a);var c=Object.create(HTMLElement.prototype);Object.setPrototypeOf(a,HTMLElement);c.constructor=a;a.observedAttributes=
|
|
28
|
+
return document.removeEventListener("pointerdown",$APP.l(a,"doc-click"),!0)}return null},RC=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:null},set:function(d){return typeof d==="string"&&$APP.N(d,"")?this.setAttribute(c,d):this.removeAttribute(c)}})},SC=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.n(d)?this.setAttribute(c,
|
|
29
|
+
""):this.removeAttribute(c)}})},TC=function(a){a.focus=function(){var b=$APP.l(this,"__xDatePickerRefs");b=$APP.n(b)?$APP.l(b,"input"):null;return $APP.n(b)?b.focus():null};a.commit=function(){return JC(this,"programmatic")};a.clear=function(){var b=$APP.l(this,"__xDatePickerState");$APP.E.h($APP.di.g($APP.n(b)?$APP.l(b,"canon"):null),iC)?this.removeAttribute("value"):(this.removeAttribute("start"),this.removeAttribute("end"));zC(this);return GC(this)}},VC=function(){function a(){return Reflect.construct(HTMLElement,
|
|
30
|
+
[],$APP.Ra(b))}var b=new $APP.Dd;$APP.Ed(b,a);var c=Object.create(HTMLElement.prototype);Object.setPrototypeOf(a,HTMLElement);c.constructor=a;a.observedAttributes=UC;c.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xDatePickerRefs"))){var d=this.attachShadow({mode:"open"}),e=xC("style"),g=xC("div"),h=xC("input"),k=xC("button"),m=xC("div"),q=xC("div"),r=xC("button"),v=xC("div"),w=xC("button"),z=xC("div"),A=xC("div"),C=xC("div");e.textContent=":host{display:block;color-scheme:light dark;}[part\x3dcontainer]{position:relative;display:flex;align-items:stretch;gap:8px;width:100%;}[part\x3dinput]{flex:1;min-width:0;appearance:none;box-sizing:border-box;border:1px solid var(--x-date-picker-border,#cbd5e1);border-radius:var(--x-date-picker-radius,8px);padding:8px 12px;font-size:0.9375rem;background:var(--x-date-picker-input-bg,#fff);color:var(--x-date-picker-text,inherit);outline:none;}[part\x3dinput]:focus{border-color:var(--x-date-picker-focus,#60a5fa);box-shadow:0 0 0 3px rgba(96,165,250,0.25);}[part\x3dinput][disabled]{opacity:0.5;cursor:default;}[part\x3dbtn][disabled]{opacity:0.5;cursor:default;pointer-events:none;}[part\x3dinput]::placeholder{color:var(--x-date-picker-placeholder,#94a3b8);}[part\x3dbtn]{all:unset;cursor:pointer;flex:0 0 auto;width:42px;height:42px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--x-date-picker-border,#cbd5e1);border-radius:var(--x-date-picker-radius,8px);background:var(--x-date-picker-btn-bg,#f8fafc);color:var(--x-date-picker-text,inherit);box-sizing:border-box;}[part\x3dbtn]:hover{background:var(--x-date-picker-btn-hover,#f1f5f9);}[part\x3dbtn]:focus-visible{outline:2px solid var(--x-date-picker-focus,#60a5fa);}[part\x3dpopover]{display:none;position:absolute;z-index:1000;top:calc(100% + 8px);left:0;background:var(--x-date-picker-popover-bg,#fff);border:1px solid var(--x-date-picker-border,#e2e8f0);border-radius:var(--x-date-picker-popover-radius,12px);box-shadow:0 8px 32px rgba(0,0,0,0.12),0 2px 8px rgba(0,0,0,0.06);padding:16px;width:var(--x-date-picker-popover-width,304px);box-sizing:border-box;}:host([open]) [part\x3dpopover]{display:block;}[part\x3dnav]{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;}[part\x3dnavbtn]{all:unset;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:6px;color:var(--x-date-picker-text,inherit);}[part\x3dnavbtn]:hover{background:var(--x-date-picker-nav-hover,#f1f5f9);}[part\x3dnavbtn]:focus-visible{outline:2px solid var(--x-date-picker-focus,#60a5fa);}[part\x3dmonthlabel]{font-weight:600;font-size:0.9375rem;}[part\x3dweekdays]{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;margin-bottom:4px;}[part\x3dweekday]{text-align:center;font-size:0.75rem;font-weight:600;color:var(--x-date-picker-weekday,#94a3b8);padding:4px 0;}[part\x3dgrid]{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;}[part\x3dday]{all:unset;cursor:pointer;box-sizing:border-box;display:flex;align-items:center;justify-content:center;height:36px;border-radius:6px;font-size:0.875rem;color:var(--x-date-picker-day-text,inherit);}[part\x3dday]:hover:not([disabled]){background:var(--x-date-picker-day-hover,#f1f5f9);}[part\x3dday]:focus-visible{outline:2px solid var(--x-date-picker-focus,#60a5fa);}[part\x3dday][data-outside\x3dtrue]{opacity:0.4;}[part\x3dday][data-disabled\x3dtrue]{opacity:0.3;cursor:default;pointer-events:none;}[part\x3dday][data-selected\x3dtrue]{background:var(--x-date-picker-selected-bg,#2563eb);color:var(--x-date-picker-selected-text,#fff);font-weight:600;}[part\x3dday][data-in-range\x3dtrue]:not([data-range-edge\x3dtrue]){background:var(--x-date-picker-range-bg,#dbeafe);color:var(--x-date-picker-range-text,#1e40af);border-radius:0;}[part\x3dday][data-range-edge\x3dtrue]{background:var(--x-date-picker-selected-bg,#2563eb);color:var(--x-date-picker-selected-text,#fff);font-weight:600;}[part\x3dsr-status]{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;}@media (prefers-color-scheme:dark){:host{--x-date-picker-border:#334155;--x-date-picker-input-bg:#0f172a;--x-date-picker-btn-bg:#1e293b;--x-date-picker-btn-hover:#334155;--x-date-picker-popover-bg:#1e293b;--x-date-picker-day-hover:#334155;--x-date-picker-selected-bg:#3b82f6;--x-date-picker-range-bg:#1e3a8a;--x-date-picker-range-text:#93c5fd;--x-date-picker-nav-hover:#334155;}}@media (prefers-reduced-motion:reduce){[part\x3dpopover]{transition:none;}}";
|
|
31
31
|
g.setAttribute("part","container");h.setAttribute("part","input");h.setAttribute("type","text");h.setAttribute("inputmode","none");h.setAttribute("autocomplete","off");k.setAttribute("part","btn");k.setAttribute("type","button");k.setAttribute("aria-label","Open calendar");k.textContent="\ud83d\udcc5";m.setAttribute("part","popover");m.setAttribute("role","dialog");m.setAttribute("aria-modal","true");m.setAttribute("aria-label","Calendar");q.setAttribute("part","nav");r.setAttribute("part","navbtn");
|
|
32
32
|
r.setAttribute("data-nav","prev");r.setAttribute("type","button");r.setAttribute("aria-label","Previous month");r.textContent="‹";v.setAttribute("part","monthlabel");v.setAttribute("aria-live","polite");w.setAttribute("part","navbtn");w.setAttribute("data-nav","next");w.setAttribute("type","button");w.setAttribute("aria-label","Next month");w.textContent="›";z.setAttribute("part","weekdays");z.setAttribute("aria-hidden","true");A.setAttribute("part","grid");A.setAttribute("role","grid");A.setAttribute("aria-label",
|
|
33
|
-
"Calendar grid");C.setAttribute("part","sr-status");C.setAttribute("aria-live","polite");C.setAttribute("aria-atomic","true");q.appendChild(r);q.appendChild(v);q.appendChild(w);m.appendChild(q);m.appendChild(z);m.appendChild(A);m.appendChild(C);g.appendChild(h);g.appendChild(k);g.appendChild(m);d.appendChild(e);d.appendChild(g);this.__xDatePickerRefs={weekdays:z,grid:A,popover:m,"nav-next":w,"month-label":v,input:h,btn:k,sr:C,"nav-prev":r}}
|
|
34
|
-
function(){return
|
|
35
|
-
447310304),
|
|
36
|
-
"start-str",1077409677),
|
|
37
|
-
-1316370898),
|
|
33
|
+
"Calendar grid");C.setAttribute("part","sr-status");C.setAttribute("aria-live","polite");C.setAttribute("aria-atomic","true");q.appendChild(r);q.appendChild(v);q.appendChild(w);m.appendChild(q);m.appendChild(z);m.appendChild(A);m.appendChild(C);g.appendChild(h);g.appendChild(k);g.appendChild(m);d.appendChild(e);d.appendChild(g);this.__xDatePickerRefs={weekdays:z,grid:A,popover:m,"nav-next":w,"month-label":v,input:h,btn:k,sr:C,"nav-prev":r}}QC(this);PC(this);zC(this);return GC(this)};c.disconnectedCallback=
|
|
34
|
+
function(){return QC(this)};c.attributeChangedCallback=function(){zC(this);return GC(this)};RC(c,"mode","mode");RC(c,"value","value");RC(c,"start","start");RC(c,"end","end");SC(c,"open","open");SC(c,"disabled","disabled");SC(c,"readOnly","readonly");SC(c,"required","required");TC(c);a.prototype=c;return a},WC=function(){return $APP.n(customElements.get("x-date-picker"))?null:customElements.define("x-date-picker",VC())},rC=new $APP.K(null,"start-d","start-d",-1546785820),cC=new $APP.K(null,"ok?","ok?",
|
|
35
|
+
447310304),dC=new $APP.K(null,"date","date",-1463434462),gC=new $APP.K(null,"auto-swap?","auto-swap?",-1675454411),qC=new $APP.K(null,"end-str","end-str",-558112319),aC=new $APP.K(null,"localized","localized",1722109655),CC=new $APP.K(null,"edge?","edge?",203916303),pC=new $APP.K(null,"value-str","value-str",989198845),nC=new $APP.K(null,"complete?","complete?",-892991879),mC=new $APP.K(null,"max-d","max-d",-814680979),iC=new $APP.K(null,"single","single",1551466437),sC=new $APP.K(null,"start-str",
|
|
36
|
+
"start-str",1077409677),hC=new $APP.K(null,"range","range",1639692286),jC=new $APP.K(null,"iso","iso",-1366207543),vC=new $APP.K(null,"in-month?","in-month?",-1630426251),oC=new $APP.K(null,"min-d","min-d",-1118792932),$B=new $APP.K(null,"format","format",-1306924766),kC=new $APP.K(null,"value-d","value-d",-1768534876),BC=new $APP.K(null,"in-range?","in-range?",-291779262),NC=new $APP.K(null,"prev","prev",-1597069226),KC=new $APP.K(null,"next","next",-117701485),tC=new $APP.K(null,"end-d","end-d",
|
|
37
|
+
-1316370898),lC=new $APP.K(null,"allow-same-day?","allow-same-day?",-1971558934),fC=new $APP.K(null,"range-allow-same-day?","range-allow-same-day?",-714516856);var UC="mode value start end min max format locale separator auto-swap range-allow-same-day close-on-select placeholder disabled readonly required name autocomplete aria-label aria-describedby".split(" ");$APP.ka("baredom.exports.x_date_picker.init",WC);export const init=WC;
|
package/dist/x-divider.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a.getAttribute("role")]),c=$APP.M(b);b=$APP.I(c,$APP.
|
|
4
|
-
$APP.
|
|
5
|
-
2,["none",null,"presentation",null],null),null),g)?a.setAttribute("role","presentation"):a.setAttribute("role","separator");$APP.E.h(e,"vertical")?a.setAttribute("aria-orientation","vertical"):a.removeAttribute("aria-orientation");$APP.n($APP.n(d)?d.length>0:d)?a.setAttribute("aria-label",d):a.removeAttribute("aria-label");c?(d=$APP.l(a,"__xDividerRefs"),$APP.E.h($APP.l(d,"mode"),"no-label")&&(e=$APP.l(d,"container"),
|
|
2
|
+
var jB=function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.Cc(a,c)?c:b},kB=function(a){for(;;){var b=a.firstChild;if($APP.n(b))a.removeChild(b);else break}},wB=function(a){var b=$APP.cf([$APP.Dh,$APP.ch,$APP.Ch,lB,mB,nB,oB,$APP.ji,$APP.Ci,pB],[a.getAttribute("variant"),a.getAttribute("label"),a.getAttribute("align"),a.getAttribute("length"),a.getAttribute("thickness"),a.getAttribute("color"),a.getAttribute("inset"),a.getAttribute("orientation"),a.getAttribute("aria-label"),
|
|
3
|
+
a.getAttribute("role")]),c=$APP.M(b);b=$APP.I(c,$APP.Ci);var d=$APP.I(c,pB),e=$APP.I(c,$APP.ch);var g=$APP.I(c,$APP.Dh);var h=$APP.I(c,$APP.Ch),k=$APP.I(c,lB),m=$APP.I(c,mB),q=$APP.I(c,nB),r=$APP.I(c,oB);c=$APP.I(c,$APP.ji);g=$APP.cf([$APP.Xg,$APP.ci,qB,rB,$APP.vi,$APP.Vg,$APP.zh,$APP.W,sB,$APP.$h],[d,jB(tB,"center",h),m,r,q,jB(uB,"solid",g),jB(vB,"horizontal",c),e,k,b]);c=$APP.M(g);d=$APP.I(c,$APP.$h);h=$APP.I(c,$APP.ci);k=$APP.I(c,qB);m=$APP.I(c,rB);q=$APP.I(c,$APP.vi);r=$APP.I(c,$APP.Vg);e=$APP.I(c,
|
|
4
|
+
$APP.zh);b=$APP.I(c,$APP.W);var v=$APP.I(c,sB);c=typeof b==="string"&&b.trim().length>0;var w=a.style;a.setAttribute("data-orientation",e);a.setAttribute("data-variant",r);a.setAttribute("data-align",h);w.setProperty("--x-divider-thickness",$APP.n(k)?k:"1px");w.setProperty("--x-divider-inset",$APP.n(m)?m:"0px");w.setProperty("--x-divider-length",$APP.n(v)?v:"auto");$APP.n(q)?w.setProperty("--x-divider-color",q):w.removeProperty("--x-divider-color");g=$APP.Xg.g(g);$APP.Cc(new $APP.R(null,new $APP.P(null,
|
|
5
|
+
2,["none",null,"presentation",null],null),null),g)?a.setAttribute("role","presentation"):a.setAttribute("role","separator");$APP.E.h(e,"vertical")?a.setAttribute("aria-orientation","vertical"):a.removeAttribute("aria-orientation");$APP.n($APP.n(d)?d.length>0:d)?a.setAttribute("aria-label",d):a.removeAttribute("aria-label");c?(d=$APP.l(a,"__xDividerRefs"),$APP.E.h($APP.l(d,"mode"),"no-label")&&(e=$APP.l(d,"container"),kB(e),g=document.createElement("div"),h=document.createElement("span"),k=document.createElement("slot"),
|
|
6
6
|
m=document.createElement("span"),q=document.createElement("div"),g.setAttribute("part","line-left"),h.setAttribute("part","label"),k.setAttribute("name","label"),m.setAttribute("part","label-text"),q.setAttribute("part","line-right"),h.appendChild(k),h.appendChild(m),e.appendChild(g),e.appendChild(h),e.appendChild(q),d["line-left"]=g,d["label-wrap"]=h,d["label-text"]=m,d["line-right"]=q,d.mode="label"),a=$APP.l($APP.l(a,"__xDividerRefs"),"label-text"),$APP.n(a)&&(a.textContent=b)):(a=$APP.l(a,"__xDividerRefs"),
|
|
7
|
-
$APP.E.h($APP.l(a,"mode"),"label")&&(b=$APP.l(a,"container"),
|
|
8
|
-
b,{get:function(){var d=this.getAttribute(b);return $APP.n(d)?d:c},set:function(d){return d!=null?this.setAttribute(b,""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},
|
|
9
|
-
var a=Object.create(HTMLElement.prototype),b=
|
|
10
|
-
e.setAttribute("part","container");var g=document.createElement("div");g.setAttribute("part","line");e.appendChild(g);c.appendChild(d);c.appendChild(e);this.__xDividerRefs={root:c,container:e,mode:"no-label"}}return
|
|
11
|
-
|
|
7
|
+
$APP.E.h($APP.l(a,"mode"),"label")&&(b=$APP.l(a,"container"),kB(b),d=document.createElement("div"),d.setAttribute("part","line"),b.appendChild(d),a["line-left"]=null,a["label-wrap"]=null,a["label-text"]=null,a["line-right"]=null,a.mode="no-label"));return null},xB=function(a,b){Object.defineProperty(a,b,{get:function(){return this.getAttribute(b)},set:function(c){return c!=null?this.setAttribute(b,""+$APP.S.g(c)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},yB=function(a,b,c){Object.defineProperty(a,
|
|
8
|
+
b,{get:function(){var d=this.getAttribute(b);return $APP.n(d)?d:c},set:function(d){return d!=null?this.setAttribute(b,""+$APP.S.g(d)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},zB=function(a){yB(a,"orientation","horizontal");yB(a,"variant","solid");yB(a,"align","center");xB(a,"label");xB(a,"thickness");xB(a,"color");xB(a,"inset");xB(a,"length")},AB=function(){function a(){return Reflect.construct(HTMLElement,[],$APP.Ra(b))}var b=new $APP.Dd;$APP.Ed(b,a);return a},CB=function(){if($APP.n(customElements.get("x-divider")))return null;
|
|
9
|
+
var a=Object.create(HTMLElement.prototype),b=AB();Object.setPrototypeOf(b,HTMLElement);a.constructor=b;zB(a);a.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xDividerRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div");d.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;}}";
|
|
10
|
+
e.setAttribute("part","container");var g=document.createElement("div");g.setAttribute("part","line");e.appendChild(g);c.appendChild(d);c.appendChild(e);this.__xDividerRefs={root:c,container:e,mode:"no-label"}}return wB(this)};a.disconnectedCallback=function(){return null};a.attributeChangedCallback=function(c,d,e){return $APP.N(d,e)?$APP.n($APP.l(this,"__xDividerRefs"))?wB(this):null:null};b.observedAttributes=BB;b.prototype=a;return customElements.define("x-divider",b)},DB=function(){return CB()},
|
|
11
|
+
lB=new $APP.K(null,"length-raw","length-raw",-1832244116),oB=new $APP.K(null,"inset-raw","inset-raw",89351124),rB=new $APP.K(null,"inset","inset",-396367740),qB=new $APP.K(null,"thickness","thickness",-940175454),mB=new $APP.K(null,"thickness-raw","thickness-raw",1843812655),pB=new $APP.K(null,"role-raw","role-raw",777951354),sB=new $APP.K(null,"length","length",588987862),nB=new $APP.K(null,"color-raw","color-raw",1277647215);var BB="orientation variant thickness color inset length label align role aria-label".split(" "),vB=new $APP.R(null,new $APP.P(null,2,["vertical",null,"horizontal",null],null),null),uB=new $APP.R(null,new $APP.P(null,3,["dashed",null,"dotted",null,"solid",null],null),null),tB=new $APP.R(null,new $APP.P(null,3,["center",null,"start",null,"end",null],null),null);$APP.ka("baredom.exports.x_divider.init",DB);export const init=DB;
|
package/dist/x-drawer.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
2
|
+
var Yt=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"),g=document.createElement("div"),h=document.createElement("slot"),k=document.createElement("div"),m=document.createElement("slot"),q=document.createElement("div"),r=document.createElement("slot");c.textContent=":host{display:contents;color-scheme:light dark;--x-drawer-size:20rem;--x-drawer-bg:Canvas;--x-drawer-fg:CanvasText;--x-drawer-backdrop:rgb(0 0 0/0.4);--x-drawer-shadow:0 8px 24px rgb(0 0 0/0.18);--x-drawer-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: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:100vw;}: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:100vh;}: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:#1c1d24;--x-drawer-fg:#e2e4ef;--x-drawer-border:rgb(255 255 255/0.08);--x-drawer-shadow:0 8px 40px rgb(0 0 0/0.55);--x-drawer-backdrop:rgb(0 0 0/0.55);}}";
|
|
3
3
|
d.setAttribute("part","backdrop");e.setAttribute("part","panel");e.setAttribute("role","dialog");e.setAttribute("aria-modal","true");g.setAttribute("part","header");h.setAttribute("name","header");k.setAttribute("part","body");q.setAttribute("part","footer");r.setAttribute("name","footer");g.appendChild(h);k.appendChild(m);q.appendChild(r);e.appendChild(g);e.appendChild(k);e.appendChild(q);b.appendChild(c);b.appendChild(d);b.appendChild(e);a.__xDrawerRefs={root:b,backdrop:d,panel:e,header:g,body:k,
|
|
4
|
-
footer:q};return $APP.l(a,"__xDrawerRefs")}
|
|
5
|
-
composed:!0,cancelable:!1}))},
|
|
6
|
-
$APP.l(a,"__xDrawerPanelTab")===!0;a.__xDrawerTabbables=null;a.__xDrawerRestore=null;$APP.n($APP.n(b)?d:b)&&(b.removeAttribute("tabindex"),a.__xDrawerPanelTab=!1);$APP.n($APP.n(c)?c.isConnected:c)&&c.focus()},
|
|
7
|
-
$APP.
|
|
8
|
-
$APP.xg(h):null;a.__xDrawerTabbables=k;$APP.u(h)?$APP.x(h).focus():$APP.n(g)&&($APP.n(g.hasAttribute("tabindex"))||(g.setAttribute("tabindex","-1"),a.__xDrawerPanelTab=!0),g.focus());return null},0):
|
|
9
|
-
$APP.n(k)&&k.focus();else{k=document.activeElement;var m=$APP.x(h);h=$APP.ic(h);var q=g.shiftKey;$APP.n($APP.n(q)?$APP.E.h(k,m):q)?(g.preventDefault(),h.focus()):$APP.p(q)&&$APP.E.h(k,h)&&(g.preventDefault(),m.focus())}}return null}function c(){return
|
|
10
|
-
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)}a.__xDrawerHandlers=null},
|
|
11
|
-
return $APP.n(b)?b:"right"},set:function(b){return b==null?this.removeAttribute("placement"):this.setAttribute("placement",""+$APP.S.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:"Drawer"},set:function(b){return b==null?this.removeAttribute("label"):this.setAttribute("label",""+$APP.S.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"show",{value:function(){return
|
|
12
|
-
writable:!0});Object.defineProperty(a,"hide",{value:function(){return
|
|
13
|
-
function(){
|
|
4
|
+
footer:q};return $APP.l(a,"__xDrawerRefs")},$t=function(a){a=new $APP.P(null,3,[$APP.qh,a.hasAttribute("open"),$APP.dj,a.getAttribute("placement"),$APP.ch,a.getAttribute("label")],null);var b=$APP.M(a),c=$APP.I(b,$APP.qh);a=$APP.I(b,$APP.dj);b=$APP.I(b,$APP.ch);c=$APP.J(c);a=typeof a==="string"&&$APP.Cc(Zt,a)?a:"right";b=typeof b==="string"&&$APP.N(b,"")?b:"Drawer";return new $APP.P(null,3,[$APP.Ni,c,$APP.yi,a,$APP.W,b],null)},au=function(a,b,c){a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,
|
|
5
|
+
composed:!0,cancelable:!1}))},bu=function(a){return $APP.be($APP.Kd(function(b){var c=window.getComputedStyle(b);return $APP.N("none",c.display)&&$APP.N("hidden",c.visibility)&&b.offsetWidth>0&&b.offsetHeight>0},$APP.gc(a.querySelectorAll("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex\x3d'-1'])"))))},cu=function(a){var b=$APP.l(a,"__xDrawerRefs");b=$APP.n(b)?$APP.l(b,"panel"):null;var c=$APP.l(a,"__xDrawerRestore"),d=
|
|
6
|
+
$APP.l(a,"__xDrawerPanelTab")===!0;a.__xDrawerTabbables=null;a.__xDrawerRestore=null;$APP.n($APP.n(b)?d:b)&&(b.removeAttribute("tabindex"),a.__xDrawerPanelTab=!1);$APP.n($APP.n(c)?c.isConnected:c)&&c.focus()},du=function(a,b){au(a,"x-drawer-dismiss",{reason:b});a.removeAttribute("open");return null},eu=function(a){$APP.n(a.hasAttribute("open"))||a.setAttribute("open","");return null},fu=function(a){a.removeAttribute("open");return null},gu=function(a){var b=Yt(a);b=$APP.l(b,"panel");var c=$t(a),d=
|
|
7
|
+
$APP.Ni.g(c),e=$APP.l(a,"__xDrawerPrevOpen");a.setAttribute("data-open",$APP.n(d)?"true":"false");a.setAttribute("data-placement",$APP.yi.g(c));b.setAttribute("aria-label",$APP.W.g(c));$APP.n(d)?b.removeAttribute("aria-hidden"):b.setAttribute("aria-hidden","true");$APP.N(e,d)&&(a.__xDrawerPrevOpen=d,au(a,"x-drawer-toggle",{open:d}),$APP.n(d)?setTimeout(function(){var g=$APP.l(a,"__xDrawerRefs");g=$APP.n(g)?$APP.l(g,"panel"):null;var h=bu(a);a.__xDrawerRestore=document.activeElement;var k=$APP.n(h)?
|
|
8
|
+
$APP.xg(h):null;a.__xDrawerTabbables=k;$APP.u(h)?$APP.x(h).focus():$APP.n(g)&&($APP.n(g.hasAttribute("tabindex"))||(g.setAttribute("tabindex","-1"),a.__xDrawerPanelTab=!0),g.focus());return null},0):cu(a))},hu=function(a){function b(g){var h=g.key;if($APP.E.h(h,"Escape"))g.preventDefault(),du(a,"escape");else if($APP.E.h(h,"Tab")){h=$APP.l(a,"__xDrawerTabbables");h=$APP.n(h)?$APP.be($APP.gc(h)):$APP.Ld;var k=$APP.l(a,"__xDrawerRefs");k=$APP.n(k)?$APP.l(k,"panel"):null;if($APP.rc(h))g.preventDefault(),
|
|
9
|
+
$APP.n(k)&&k.focus();else{k=document.activeElement;var m=$APP.x(h);h=$APP.ic(h);var q=g.shiftKey;$APP.n($APP.n(q)?$APP.E.h(k,m):q)?(g.preventDefault(),h.focus()):$APP.p(q)&&$APP.E.h(k,h)&&(g.preventDefault(),m.focus())}}return null}function c(){return du(a,"backdrop")}var d=Yt(a),e=$APP.l(d,"panel");$APP.l(d,"backdrop").addEventListener("click",c);e.addEventListener("keydown",b);$APP.ma(a,"__xDrawerHandlers",{backdrop:c,keydown:b})},iu=function(a){var b=$APP.l(a,"__xDrawerHandlers"),c=$APP.l(a,"__xDrawerRefs");
|
|
10
|
+
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)}a.__xDrawerHandlers=null},ju=function(a){Object.defineProperty(a,"open",{get:function(){return this.hasAttribute("open")},set:function(b){return $APP.n(b)?eu(this):fu(this)},enumerable:!0,configurable:!0});Object.defineProperty(a,"placement",{get:function(){var b=this.getAttribute("placement");
|
|
11
|
+
return $APP.n(b)?b:"right"},set:function(b){return b==null?this.removeAttribute("placement"):this.setAttribute("placement",""+$APP.S.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:"Drawer"},set:function(b){return b==null?this.removeAttribute("label"):this.setAttribute("label",""+$APP.S.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"show",{value:function(){return eu(this)},enumerable:!0,configurable:!0,
|
|
12
|
+
writable:!0});Object.defineProperty(a,"hide",{value:function(){return fu(this)},enumerable:!0,configurable:!0,writable:!0});Object.defineProperty(a,"toggle",{value:function(){$APP.n(this.hasAttribute("open"))?fu(this):eu(this);return null},enumerable:!0,configurable:!0,writable:!0})},lu=function(){if(!$APP.n(customElements.get("x-drawer"))){var a=class extends HTMLElement{};a.observedAttributes=ku;a.prototype.connectedCallback=function(){Yt(this);iu(this);hu(this);gu(this);return null};a.prototype.disconnectedCallback=
|
|
13
|
+
function(){iu(this);cu(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&gu(this);return null};ju(a.prototype);customElements.define("x-drawer",a)}return null},mu=function(){return lu()};var Zt=new $APP.R(null,new $APP.P(null,4,["right",null,"top",null,"bottom",null,"left",null],null),null),ku=["open","placement","label"];$APP.wd(["x-drawer-toggle",new $APP.P(null,2,[$APP.ui,!1,$APP.Y,new $APP.P(null,1,[$APP.qi,$APP.Ji],null)],null),"x-drawer-dismiss",new $APP.P(null,2,[$APP.ui,!1,$APP.Y,new $APP.P(null,1,[$APP.wh,$APP.X],null)],null)]);$APP.ka("baredom.exports.x_drawer.init",mu);export const init=mu;
|
package/dist/x-dropdown.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a)}return null},
|
|
4
|
-
$APP.l(b,"docClick"),d=$APP.l(b,"docKeydown");return setTimeout(function(){return $APP.n(a.hasAttribute("open"))?(document.addEventListener("click",c),document.addEventListener("keydown",d)):null},0)}return null},
|
|
5
|
-
b.key;return $APP.E.h(c," ")||$APP.E.h(c,"Enter")?(b.preventDefault(),
|
|
6
|
-
"escape"):null}}},
|
|
7
|
-
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){d!=null&&$APP.N(d)?(d=""+$APP.S.g(d),d=this.setAttribute(c,d)):d=this.removeAttribute(c);return d}})},
|
|
8
|
-
null:
|
|
2
|
+
var Kl=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},Ml=function(a){var b=$APP.l(a,"__xDropdownRefs");if($APP.n(b)){var c=$APP.l(b,"trigger"),d=$APP.l(b,"label");b=$APP.l(b,"panel");var e=a.hasAttribute("open"),g=a.hasAttribute("disabled");var h=a.getAttribute("label");h=$APP.n(h)?h:"";a=a.getAttribute("placement");a=$APP.Cc(Ll,a)?a:"bottom-start";d.textContent=h;c.setAttribute("aria-expanded",$APP.n(e)?"true":"false");Kl(c,"disabled",g);return b.setAttribute("data-placement",
|
|
3
|
+
a)}return null},Nl=function(a,b){if($APP.n(a.hasAttribute("disabled")))return null;var c=$APP.p(a.hasAttribute("open"));b=new CustomEvent("x-dropdown-toggle",{detail:{open:c,source:b},bubbles:!0,composed:!0,cancelable:!0});a.dispatchEvent(b);return $APP.p(b.defaultPrevented)?(c?a.setAttribute("open",""):a.removeAttribute("open"),a.dispatchEvent(new CustomEvent("x-dropdown-change",{detail:{open:c},bubbles:!0,composed:!0,cancelable:!1}))):null},Ol=function(a){var b=$APP.l(a,"__xDropdownHandlers");if($APP.n(b)){var c=
|
|
4
|
+
$APP.l(b,"docClick"),d=$APP.l(b,"docKeydown");return setTimeout(function(){return $APP.n(a.hasAttribute("open"))?(document.addEventListener("click",c),document.addEventListener("keydown",d)):null},0)}return null},Pl=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},Ql=function(a){return{triggerClick:function(){return Nl(a,"pointer")},triggerKeydown:function(b){var c=
|
|
5
|
+
b.key;return $APP.E.h(c," ")||$APP.E.h(c,"Enter")?(b.preventDefault(),Nl(a,"keyboard")):null},hostFocusout:function(b){return $APP.n(a.hasAttribute("open"))?(b=b.relatedTarget,b==null||$APP.p(a.contains(b))?Nl(a,"focusout"):null):null},docClick:function(b){return $APP.n(a.hasAttribute("open"))?(b=$APP.hc(b.composedPath()),b=$APP.Ad(function(c){return c===a},b),$APP.n(b)?null:Nl(a,"outside-click")):null},docKeydown:function(b){b=$APP.E.h(b.key,"Escape");return $APP.n(b?a.hasAttribute("open"):b)?Nl(a,
|
|
6
|
+
"escape"):null}}},Rl=function(a){var b=$APP.l(a,"__xDropdownRefs");if($APP.n(b)){var c=$APP.l(a,"__xDropdownHandlers");$APP.n(c)&&(b=$APP.l(b,"trigger"),b.removeEventListener("click",$APP.l(c,"triggerClick")),b.removeEventListener("keydown",$APP.l(c,"triggerKeydown")),a.removeEventListener("focusout",$APP.l(c,"hostFocusout")))}},Sl=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return Kl(this,c,$APP.J(d))}})},Tl=
|
|
7
|
+
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){d!=null&&$APP.N(d)?(d=""+$APP.S.g(d),d=this.setAttribute(c,d)):d=this.removeAttribute(c);return d}})},Vl=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",{get:function(){return Ul}});Sl(b,"open","open");Sl(b,"disabled","disabled");Tl(b,"label","label");Tl(b,"placement","placement");b.show=function(){return $APP.n(this.hasAttribute("open"))?
|
|
8
|
+
null:Nl(this,"programmatic")};b.hide=function(){return $APP.n(this.hasAttribute("open"))?Nl(this,"programmatic"):null};b.toggle=function(){return Nl(this,"programmatic")};b.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xDropdownRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("button"),g=document.createElement("span"),h=document.createElement("span"),k=document.createElement("div"),m=document.createElement("div"),q=document.createElement("slot");
|
|
9
9
|
d.textContent=":host{display:inline-block;position:relative;color-scheme:light dark;--x-dropdown-trigger-bg:#f8fafc;--x-dropdown-trigger-bg-hover:#f1f5f9;--x-dropdown-trigger-bg-active:#e2e8f0;--x-dropdown-trigger-color:#0f172a;--x-dropdown-trigger-border:1px solid #e2e8f0;--x-dropdown-trigger-radius:6px;--x-dropdown-trigger-padding:0 0.75rem;--x-dropdown-trigger-height:2.25rem;--x-dropdown-trigger-font-size:0.9375rem;--x-dropdown-trigger-font-weight:500;--x-dropdown-chevron-color:#64748b;--x-dropdown-focus-ring:#60a5fa;--x-dropdown-panel-bg:#ffffff;--x-dropdown-panel-border:1px solid #e2e8f0;--x-dropdown-panel-radius:8px;--x-dropdown-panel-shadow: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:150ms;--x-dropdown-transition-easing:ease;}@media (prefers-color-scheme:dark){:host{--x-dropdown-trigger-bg:#1e293b;--x-dropdown-trigger-bg-hover:#334155;--x-dropdown-trigger-bg-active:#475569;--x-dropdown-trigger-color:#e2e8f0;--x-dropdown-trigger-border:1px solid #334155;--x-dropdown-chevron-color:#94a3b8;--x-dropdown-focus-ring:#93c5fd;--x-dropdown-panel-bg:#1e293b;--x-dropdown-panel-border:1px solid #334155;--x-dropdown-panel-shadow: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-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;}}";
|
|
10
10
|
e.setAttribute("part","trigger");e.setAttribute("type","button");e.setAttribute("aria-haspopup","true");e.setAttribute("aria-expanded","false");e.setAttribute("aria-controls","panel");g.setAttribute("part","trigger-label");h.setAttribute("part","chevron");h.setAttribute("aria-hidden","true");h.textContent="▾";k.setAttribute("part","panel");k.setAttribute("id","panel");k.setAttribute("data-placement","bottom-start");m.setAttribute("part","panel-inner");e.appendChild(g);e.appendChild(h);m.appendChild(q);
|
|
11
|
-
k.appendChild(m);c.appendChild(d);c.appendChild(e);c.appendChild(k);this.__xDropdownRefs={trigger:e,label:g,chevron:h,panel:k}}
|
|
12
|
-
|
|
11
|
+
k.appendChild(m);c.appendChild(d);c.appendChild(e);c.appendChild(k);this.__xDropdownRefs={trigger:e,label:g,chevron:h,panel:k}}Rl(this);Pl(this);this.__xDropdownHandlers=Ql(this);d=$APP.l(this,"__xDropdownRefs");$APP.n(d)&&(c=$APP.l(this,"__xDropdownHandlers"),$APP.n(c)&&(d=$APP.l(d,"trigger"),d.addEventListener("click",$APP.l(c,"triggerClick")),d.addEventListener("keydown",$APP.l(c,"triggerKeydown")),this.addEventListener("focusout",$APP.l(c,"hostFocusout"))));$APP.n(this.hasAttribute("open"))&&
|
|
12
|
+
Ol(this);return Ml(this)};b.disconnectedCallback=function(){Rl(this);return Pl(this)};b.attributeChangedCallback=function(c){$APP.n($APP.l(this,"__xDropdownRefs"))?(Ml(this),c=$APP.E.h(c,"open")?$APP.n(this.hasAttribute("open"))?Ol(this):Pl(this):null):c=null;return c};return a},Wl=function(){return $APP.n(customElements.get("x-dropdown"))?null:customElements.define("x-dropdown",Vl())};var Ll=new $APP.R(null,new $APP.P(null,4,["bottom-start",null,"bottom-end",null,"top-end",null,"top-start",null],null),null),Ul=["open","disabled","label","placement"];$APP.wd(["x-dropdown-toggle",new $APP.P(null,2,[$APP.ui,!0,$APP.Y,new $APP.P(null,2,[$APP.qi,$APP.Ji,$APP.Bh,$APP.X],null)],null),"x-dropdown-change",new $APP.P(null,2,[$APP.ui,!1,$APP.Y,new $APP.P(null,1,[$APP.qi,$APP.Ji],null)],null)]);$APP.ka("baredom.exports.x_dropdown.init",Wl);export const init=Wl;
|
package/dist/x-fieldset.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
h:"";k=$APP.J(k);k=new $APP.P(null,5,[
|
|
4
|
-
c.removeAttribute("aria-describedby");
|
|
5
|
-
b)):b=this.removeAttribute("legend");return b}})},
|
|
6
|
-
e.setAttribute("part","root");e.setAttribute("role","group");g.setAttribute("part","legend");g.setAttribute("id","x-fieldset-legend");h.setAttribute("part","content");h.appendChild(k);e.appendChild(g);e.appendChild(h);c.appendChild(d);c.appendChild(e);this.__xFieldsetRefs={root:c,"root-el":e,"legend-el":g,"content-el":h}}return
|
|
7
|
-
null:customElements.define("x-fieldset",
|
|
2
|
+
var Ws=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},$s=function(a){var b=$APP.l(a,"__xFieldsetRefs");if($APP.n(b)){var c=$APP.l(b,"root-el"),d=$APP.l(b,"legend-el");b=$APP.l(b,"content-el");var e=a.getAttribute("legend");e=new $APP.P(null,4,[Xs,e,$APP.Yh,a.hasAttribute("disabled"),$APP.Ci,a.getAttribute("aria-label"),$APP.ii,a.getAttribute("aria-describedby")],null);var g=$APP.M(e),h=$APP.I(g,Xs);var k=$APP.I(g,$APP.Yh);e=$APP.I(g,$APP.Ci);g=$APP.I(g,$APP.ii);h=$APP.n(h)?
|
|
3
|
+
h:"";k=$APP.J(k);k=new $APP.P(null,5,[Ys,h,Zs,$APP.N(h,""),$APP.U,k,$APP.$h,e,$APP.Vi,g],null);h=Ys.g(k);g=Zs.g(k);e=$APP.U.g(k);d.textContent=h;$APP.n(g)?d.removeAttribute("hidden"):d.setAttribute("hidden","");d=$APP.$h.g(k);$APP.n(d)?(c.setAttribute("aria-label",d),c.removeAttribute("aria-labelledby")):(c.removeAttribute("aria-label"),$APP.n(g)?c.setAttribute("aria-labelledby","x-fieldset-legend"):c.removeAttribute("aria-labelledby"));d=$APP.Vi.g(k);$APP.n(d)?c.setAttribute("aria-describedby",d):
|
|
4
|
+
c.removeAttribute("aria-describedby");Ws(a,"data-disabled",e);return Ws(b,"inert",e)}return null},at=function(a){Object.defineProperty(a,"disabled",{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute("disabled")},set:function(b){return Ws(this,"disabled",$APP.J(b))}})},bt=function(a){Object.defineProperty(a,"legend",{configurable:!0,enumerable:!0,get:function(){var b=this.getAttribute("legend");return $APP.n(b)?b:null},set:function(b){b!=null&&$APP.N(b)?(b=""+$APP.S.g(b),b=this.setAttribute("legend",
|
|
5
|
+
b)):b=this.removeAttribute("legend");return b}})},dt=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",{get:function(){return ct}});bt(b);at(b);b.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xFieldsetRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("div"),h=document.createElement("div"),k=document.createElement("slot");d.textContent=":host{display:block;color-scheme:light dark;--x-fieldset-border-color:#d1d5db;--x-fieldset-border-width:1px;--x-fieldset-border-radius:8px;--x-fieldset-padding:1rem;--x-fieldset-gap:0.75rem;--x-fieldset-bg:transparent;--x-fieldset-legend-color:#374151;--x-fieldset-legend-font-size:0.875rem;--x-fieldset-legend-font-weight:600;--x-fieldset-legend-padding:0 0.375rem;--x-fieldset-disabled-opacity:0.45;}@media (prefers-color-scheme:dark){:host{--x-fieldset-border-color:#374151;--x-fieldset-legend-color:#d1d5db;}}[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);}@media (prefers-reduced-motion:reduce){}";
|
|
6
|
+
e.setAttribute("part","root");e.setAttribute("role","group");g.setAttribute("part","legend");g.setAttribute("id","x-fieldset-legend");h.setAttribute("part","content");h.appendChild(k);e.appendChild(g);e.appendChild(h);c.appendChild(d);c.appendChild(e);this.__xFieldsetRefs={root:c,"root-el":e,"legend-el":g,"content-el":h}}return $s(this)};b.disconnectedCallback=function(){return null};b.attributeChangedCallback=function(){return $s(this)};return a},et=function(){return $APP.n(customElements.get("x-fieldset"))?
|
|
7
|
+
null:customElements.define("x-fieldset",dt())},Ys=new $APP.K(null,"legend","legend",-1027192245),Zs=new $APP.K(null,"legend-visible?","legend-visible?",-281107501),Xs=new $APP.K(null,"legend-raw","legend-raw",907427195);var ct=["legend","disabled","aria-label","aria-describedby"];$APP.ka("baredom.exports.x_fieldset.init",et);export const init=et;
|
package/dist/x-file-download.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.l(b,"anchor-el");var c=
|
|
4
|
-
var c=
|
|
5
|
-
b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){d!=null&&$APP.N(d)?(d=""+$APP.S.g(d),d=this.setAttribute(c,d)):d=this.removeAttribute(c);return d}})}
|
|
6
|
-
{get:function(){return
|
|
2
|
+
var Rp=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},Vp=function(a){a=new $APP.P(null,4,[Sp,a.getAttribute("href"),Tp,a.getAttribute("filename"),$APP.Yh,a.hasAttribute("disabled"),$APP.Ci,a.getAttribute("aria-label")],null);var b=$APP.M(a);a=$APP.I(b,Sp);var c=$APP.I(b,Tp),d=$APP.I(b,$APP.Yh);b=$APP.I(b,$APP.Ci);return new $APP.P(null,4,[$APP.Wi,$APP.n(a)?a:"",Up,$APP.n(c)?c:"",$APP.U,$APP.J(d),$APP.$h,b],null)},Wp=function(a){var b=$APP.l(a,"__xFileDownloadRefs");if($APP.n(b)){b=
|
|
3
|
+
$APP.l(b,"anchor-el");var c=Vp(a),d=$APP.Wi.g(c),e=Up.g(c),g=$APP.U.g(c);c=$APP.$h.g(c);b.href=d;typeof e==="string"&&$APP.N(e,"")?b.setAttribute("download",e):(e=typeof d==="string",$APP.n(e?d.startsWith("data:"):e)?b.setAttribute("download",""):b.removeAttribute("download"));$APP.n(g)?b.setAttribute("aria-disabled","true"):b.removeAttribute("aria-disabled");$APP.n(c)?b.setAttribute("aria-label",c):b.removeAttribute("aria-label");return Rp(a,"data-disabled",g)}return null},Xp=function(a){return function(b){if($APP.n(a.hasAttribute("disabled")))return b.preventDefault();
|
|
4
|
+
var c=Vp(a);c={href:$APP.Wi.g(c),filename:Up.g(c)};c=new CustomEvent("x-file-download-click",{detail:c,bubbles:!0,composed:!0,cancelable:!0});a.dispatchEvent(c);return $APP.n(c.defaultPrevented)?b.preventDefault():null}},Yp=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));return a.__xFileDownloadHandlers=null},Zp=function(a,b,c){Object.defineProperty(a,
|
|
5
|
+
b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){d!=null&&$APP.N(d)?(d=""+$APP.S.g(d),d=this.setAttribute(c,d)):d=this.removeAttribute(c);return d}})},$p=function(a){Object.defineProperty(a,"disabled",{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute("disabled")},set:function(b){return Rp(this,"disabled",$APP.J(b))}})},bq=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",
|
|
6
|
+
{get:function(){return aq}});Zp(b,"href","href");Zp(b,"filename","filename");$p(b);b.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xFileDownloadRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("a"),g=document.createElement("span"),h=document.createElement("span"),k=document.createElement("slot");d.textContent=":host{display:inline-block;color-scheme:light dark;--x-file-download-bg:#2563eb;--x-file-download-color:#ffffff;--x-file-download-hover-bg:#1d4ed8;--x-file-download-active-bg:#1e40af;--x-file-download-border-radius:6px;--x-file-download-padding:0.5rem 1rem;--x-file-download-font-size: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:#60a5fa;--x-file-download-disabled-opacity:0.45;--x-file-download-transition:background 120ms ease;}@media (prefers-color-scheme:dark){:host{--x-file-download-bg:#3b82f6;--x-file-download-hover-bg:#2563eb;--x-file-download-active-bg:#1d4ed8;--x-file-download-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;}@media (prefers-reduced-motion:reduce){[part\x3danchor]{transition:none;}}";
|
|
7
7
|
e.setAttribute("part","anchor");g.setAttribute("part","icon");h.setAttribute("part","content");g.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
|
-
h.appendChild(k);e.appendChild(g);e.appendChild(h);c.appendChild(d);c.appendChild(e);this.__xFileDownloadRefs={"anchor-el":e,"icon-el":g,"content-el":h}}
|
|
9
|
-
|
|
8
|
+
h.appendChild(k);e.appendChild(g);e.appendChild(h);c.appendChild(d);c.appendChild(e);this.__xFileDownloadRefs={"anchor-el":e,"icon-el":g,"content-el":h}}Yp(this);c=Xp(this);$APP.l($APP.l(this,"__xFileDownloadRefs"),"anchor-el").addEventListener("click",c);this.__xFileDownloadHandlers={click:c};return Wp(this)};b.disconnectedCallback=function(){return Yp(this)};b.attributeChangedCallback=function(){return Wp(this)};return a},cq=function(){return $APP.n(customElements.get("x-file-download"))?null:customElements.define("x-file-download",
|
|
9
|
+
bq())},Tp=new $APP.K(null,"filename-raw","filename-raw",-706184256),Up=new $APP.K(null,"filename","filename",-1428840783),Sp=new $APP.K(null,"href-raw","href-raw",-1680949453);var aq=["href","filename","disabled","aria-label"];$APP.ka("baredom.exports.x_file_download.init",cq);export const init=cq;
|
package/dist/x-form-field.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
e=$APP.l(b,"hint");b=$APP.l(b,"error");var g=$APP.
|
|
4
|
-
g=$APP.I(h,$APP.
|
|
5
|
-
"string"&&$APP.Cc(
|
|
6
|
-
$APP.n(C)?"hint":$APP.n(v)?"error":null;$APP.n(D)?d.setAttribute("aria-describedby",D):d.removeAttribute("aria-describedby");c.textContent=$APP.W.g(g);$APP.n(h)?c.classList.remove("label-hidden"):c.classList.add("label-hidden");e.textContent=$APP.
|
|
7
|
-
|
|
8
|
-
if($APP.n(b)){b=$APP.l(b,"input");var c=b.value;var d=a.getAttribute("name");d=$APP.n(d)?d:"";var e=$APP.l(a,"__xFormFieldInternals");$APP.n(e)&&(e.setFormValue(c),
|
|
9
|
-
null;return}}return null},
|
|
10
|
-
enumerable:!0,get:function(){var b=$APP.l(this,"__xFormFieldRefs");if($APP.n(b))return $APP.l(b,"input").value;b=this.getAttribute("value");return $APP.n(b)?b:""},set:function(b){b=b!=null&&$APP.N(b)?""+$APP.S.g(b):"";this.setAttribute("value",b);var c=$APP.l(this,"__xFormFieldRefs");return $APP.n(c)?$APP.l(c,"input").value=b:null}})},
|
|
11
|
-
"label","label");
|
|
2
|
+
var EB=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},FB=function(a,b,c){var d=a.hasAttribute("error");var e=a.getAttribute("error");e=$APP.n(e)?e:"";a=a.hasAttribute("required");var g=c.value;return $APP.n(d)?b.setValidity({customError:!0},e,c):$APP.n($APP.n(a)?$APP.E.h(g,""):a)?b.setValidity({valueMissing:!0},"Please fill in this field.",c):b.setValidity({},"",c)},HB=function(a){var b=$APP.l(a,"__xFormFieldRefs");if($APP.n(b)){var c=$APP.l(b,"label"),d=$APP.l(b,"input"),
|
|
3
|
+
e=$APP.l(b,"hint");b=$APP.l(b,"error");var g=$APP.cf([$APP.ch,$APP.Jh,$APP.sh,$APP.Eh,$APP.Yh,$APP.Cg,$APP.ti,$APP.Ei,$APP.bh,$APP.ih,$APP.vh],[a.getAttribute("label"),a.getAttribute("name"),a.getAttribute("error"),a.getAttribute("hint"),a.hasAttribute("disabled"),a.hasAttribute("required"),a.hasAttribute("readonly"),a.getAttribute("value"),a.getAttribute("autocomplete"),a.getAttribute("type"),a.getAttribute("placeholder")]);var h=$APP.M(g),k=$APP.I(h,$APP.vh),m=$APP.I(h,$APP.ch),q=$APP.I(h,$APP.Jh);
|
|
4
|
+
g=$APP.I(h,$APP.sh);var r=$APP.I(h,$APP.Eh),v=$APP.I(h,$APP.Yh),w=$APP.I(h,$APP.Cg),z=$APP.I(h,$APP.ti),A=$APP.I(h,$APP.Ei),C=$APP.I(h,$APP.bh),F=$APP.I(h,$APP.ih);h=$APP.n(g)?g:"";var D=$APP.n(r)?r:"",Q=$APP.n(m)?m:"",V=[$APP.ah,$APP.aj,$APP.Bi,$APP.fh,$APP.gi,$APP.T,$APP.Mh,$APP.Z,$APP.jh,$APP.ki,$APP.W,$APP.ph,$APP.mi,$APP.U];w=$APP.J(w);z=$APP.J(z);k=$APP.n(k)?k:"";r=typeof r==="string"&&$APP.N(r,"")&&r!=null;q=$APP.n(q)?q:"";A=$APP.n(A)?A:"";m=typeof m==="string"&&$APP.N(m,"")&&m!=null;F=typeof F===
|
|
5
|
+
"string"&&$APP.Cc(GB,F)?F:"text";g=$APP.cf(V,[w,z,k,r,q,A,m,F,typeof g==="string"&&$APP.N(g,"")&&g!=null,D,Q,h,$APP.n(C)?C:"",$APP.J(v)]);v=$APP.jh.g(g);C=$APP.fh.g(g);h=$APP.Mh.g(g);d.type=$APP.Z.g(g);d.name=$APP.gi.g(g);d.placeholder=$APP.Bi.g(g);d.disabled=$APP.U.g(g);d.readOnly=$APP.aj.g(g);d.required=$APP.ah.g(g);d.autocomplete=$APP.mi.g(g);D=$APP.n($APP.ah.g(g))?"true":"false";d.setAttribute("aria-required",D);d.setAttribute("aria-invalid",$APP.n(v)?"true":"false");D=$APP.n($APP.n(C)?v:C)?"hint error":
|
|
6
|
+
$APP.n(C)?"hint":$APP.n(v)?"error":null;$APP.n(D)?d.setAttribute("aria-describedby",D):d.removeAttribute("aria-describedby");c.textContent=$APP.W.g(g);$APP.n(h)?c.classList.remove("label-hidden"):c.classList.add("label-hidden");e.textContent=$APP.ki.g(g);$APP.n(C)?e.classList.remove("hint-hidden"):e.classList.add("hint-hidden");b.textContent=$APP.ph.g(g);$APP.n(v)?b.classList.remove("error-hidden"):b.classList.add("error-hidden");EB(a,"data-invalid",v);c=$APP.l(a,"__xFormFieldInternals");return $APP.n(c)?
|
|
7
|
+
FB(a,c,d):null}return null},IB=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},JB=function(a){return function(){var b=$APP.l(a,"__xFormFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=b.value;var d=a.getAttribute("name");d=$APP.n(d)?d:"";var e=$APP.l(a,"__xFormFieldInternals");$APP.n(e)&&(e.setFormValue(c),FB(a,e,b));return IB(a,"x-form-field-input",{name:d,value:c})}return null}},KB=function(a){return function(){var b=$APP.l(a,"__xFormFieldRefs");
|
|
8
|
+
if($APP.n(b)){b=$APP.l(b,"input");var c=b.value;var d=a.getAttribute("name");d=$APP.n(d)?d:"";var e=$APP.l(a,"__xFormFieldInternals");$APP.n(e)&&(e.setFormValue(c),FB(a,e,b));return IB(a,"x-form-field-change",{name:d,value:c})}return null}},LB=function(a){var b=$APP.l(a,"__xFormFieldRefs");if($APP.n(b)){var c=$APP.l(a,"__xFormFieldHandlers");if($APP.n(c)){b=$APP.l(b,"input");b.removeEventListener("input",$APP.l(c,"input"));b.removeEventListener("change",$APP.l(c,"change"));a.__xFormFieldHandlers=
|
|
9
|
+
null;return}}return null},MB=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){d!=null&&$APP.N(d)?(d=""+$APP.S.g(d),d=this.setAttribute(c,d)):d=this.removeAttribute(c);return d}})},NB=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return EB(this,c,$APP.J(d))}})},OB=function(a){Object.defineProperty(a,"value",{configurable:!0,
|
|
10
|
+
enumerable:!0,get:function(){var b=$APP.l(this,"__xFormFieldRefs");if($APP.n(b))return $APP.l(b,"input").value;b=this.getAttribute("value");return $APP.n(b)?b:""},set:function(b){b=b!=null&&$APP.N(b)?""+$APP.S.g(b):"";this.setAttribute("value",b);var c=$APP.l(this,"__xFormFieldRefs");return $APP.n(c)?$APP.l(c,"input").value=b:null}})},QB=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return PB}});OB(b);MB(b,
|
|
11
|
+
"label","label");MB(b,"type","type");MB(b,"name","name");MB(b,"placeholder","placeholder");MB(b,"autocomplete","autocomplete");NB(b,"disabled","disabled");NB(b,"readOnly","readonly");NB(b,"required","required");b.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xFormFieldRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("label"),h=document.createElement("div"),k=document.createElement("input"),m=document.createElement("span"),
|
|
12
12
|
q=document.createElement("span");d.textContent=":host{display:block;color-scheme:light dark;--x-form-field-label-color:#374151;--x-form-field-label-font-size:0.875rem;--x-form-field-input-bg:#ffffff;--x-form-field-input-color:#111827;--x-form-field-input-border:1px solid #d1d5db;--x-form-field-input-border-radius:6px;--x-form-field-input-padding:0.5rem 0.75rem;--x-form-field-focus-ring-color:#2563eb;--x-form-field-error-color:#dc2626;--x-form-field-hint-color:#6b7280;--x-form-field-disabled-opacity:0.45;}@media (prefers-color-scheme:dark){:host{--x-form-field-label-color:#d1d5db;--x-form-field-input-bg:#1f2937;--x-form-field-input-color:#f9fafb;--x-form-field-input-border:1px solid #4b5563;--x-form-field-focus-ring-color:#3b82f6;--x-form-field-error-color:#f87171;--x-form-field-hint-color:#9ca3af;}}[part\x3dfield]{display:flex;flex-direction:column;gap:0.25rem;}[part\x3dlabel]{display:block;font-size:var(--x-form-field-label-font-size);font-weight:500;color:var(--x-form-field-label-color);}.label-hidden{display:none;}[part\x3dinput-wrapper]{display:block;}[part\x3dinput]{display:block;width:100%;box-sizing:border-box;padding:var(--x-form-field-input-padding);background:var(--x-form-field-input-bg);color:var(--x-form-field-input-color);border:var(--x-form-field-input-border);border-radius:var(--x-form-field-input-border-radius);font-size:1rem;line-height:1.5;font-family:inherit;outline:none;transition:border-color 120ms ease,box-shadow 120ms ease;}[part\x3dinput]:focus{border-color:var(--x-form-field-focus-ring-color);box-shadow:0 0 0 3px color-mix(in srgb,var(--x-form-field-focus-ring-color) 20%,transparent);}:host([data-invalid]) [part\x3dinput]{border-color:var(--x-form-field-error-color);}:host([data-invalid]) [part\x3dinput]:focus{box-shadow:0 0 0 3px color-mix(in srgb,var(--x-form-field-error-color) 20%,transparent);}[part\x3dinput]:disabled{opacity:var(--x-form-field-disabled-opacity);cursor:not-allowed;}[part\x3dhint]{display:block;font-size:0.8125rem;color:var(--x-form-field-hint-color);}.hint-hidden{display:none;}[part\x3derror]{display:block;font-size:0.8125rem;color:var(--x-form-field-error-color);}.error-hidden{display:none;}@media (prefers-reduced-motion:reduce){[part\x3dinput]{transition:none;}}";
|
|
13
13
|
e.setAttribute("part","field");g.setAttribute("part","label");g.setAttribute("id","label");g.setAttribute("for","input");h.setAttribute("part","input-wrapper");k.setAttribute("part","input");k.setAttribute("id","input");k.setAttribute("aria-labelledby","label");m.setAttribute("part","hint");m.setAttribute("id","hint");m.setAttribute("aria-live","polite");q.setAttribute("part","error");q.setAttribute("id","error");q.setAttribute("role","alert");q.setAttribute("aria-live","assertive");h.appendChild(k);
|
|
14
|
-
e.appendChild(g);e.appendChild(h);e.appendChild(m);e.appendChild(q);c.appendChild(d);c.appendChild(e);this.__xFormFieldRefs={field:e,label:g,input:k,hint:m,error:q};$APP.n(this.attachInternals)&&(this.__xFormFieldInternals=this.attachInternals())}
|
|
15
|
-
"__xFormFieldRefs");$APP.n(c)&&(c=$APP.l(c,"input"),d=
|
|
16
|
-
return
|
|
17
|
-
$APP.
|
|
18
|
-
[$APP.Z,$APP.X,$APP.
|
|
14
|
+
e.appendChild(g);e.appendChild(h);e.appendChild(m);e.appendChild(q);c.appendChild(d);c.appendChild(e);this.__xFormFieldRefs={field:e,label:g,input:k,hint:m,error:q};$APP.n(this.attachInternals)&&(this.__xFormFieldInternals=this.attachInternals())}LB(this);c=$APP.l(this,"__xFormFieldRefs");$APP.n(c)&&(c=$APP.l(c,"input"),d=this.getAttribute("value"),$APP.n(d)&&(c.value=d));c=$APP.l(this,"__xFormFieldInternals");$APP.n(c)&&(d=c.setFormValue,e=this.getAttribute("value"),d.call(c,$APP.n(e)?e:""));c=$APP.l(this,
|
|
15
|
+
"__xFormFieldRefs");$APP.n(c)&&(c=$APP.l(c,"input"),d=JB(this),e=KB(this),c.addEventListener("input",d),c.addEventListener("change",e),this.__xFormFieldHandlers={input:d,change:e});return HB(this)};b.disconnectedCallback=function(){return LB(this)};b.attributeChangedCallback=function(c,d,e){$APP.E.h(c,"value")&&(c=$APP.l(this,"__xFormFieldRefs"),$APP.n(c)&&(c=$APP.l(c,"input"),$APP.N(c.value,e)&&(c.value=$APP.n(e)?e:"")));return HB(this)};b.formDisabledCallback=function(c){EB(this,"disabled",$APP.J(c));
|
|
16
|
+
return HB(this)};b.formResetCallback=function(){this.removeAttribute("value");var c=$APP.l(this,"__xFormFieldRefs");$APP.n(c)&&($APP.l(c,"input").value="");c=$APP.l(this,"__xFormFieldInternals");$APP.n(c)&&c.setFormValue("");return HB(this)};return a},RB=function(){return $APP.n(customElements.get("x-form-field"))?null:customElements.define("x-form-field",QB())};var PB="label type name value placeholder hint error disabled readonly required autocomplete".split(" "),GB=new $APP.R(null,new $APP.P(null,6,["url",null,"tel",null,"email",null,"text",null,"number",null,"password",null],null),null);
|
|
17
|
+
$APP.cf([$APP.Bi,$APP.wi,$APP.gi,$APP.T,$APP.hi,$APP.Z,$APP.W,$APP.mi,$APP.Mg],[new $APP.P(null,2,[$APP.Z,$APP.X,$APP.Pg,"placeholder"],null),new $APP.P(null,2,[$APP.Z,$APP.Ji,$APP.Pg,"disabled"],null),new $APP.P(null,2,[$APP.Z,$APP.X,$APP.Pg,"name"],null),new $APP.P(null,2,[$APP.Z,$APP.X,$APP.Pg,"value"],null),new $APP.P(null,2,[$APP.Z,$APP.Ji,$APP.Pg,"readonly"],null),new $APP.P(null,2,[$APP.Z,$APP.X,$APP.Pg,"type"],null),new $APP.P(null,2,[$APP.Z,$APP.X,$APP.Pg,"label"],null),new $APP.P(null,2,
|
|
18
|
+
[$APP.Z,$APP.X,$APP.Pg,"autocomplete"],null),new $APP.P(null,2,[$APP.Z,$APP.Ji,$APP.Pg,"required"],null)]);$APP.ka("baredom.exports.x_form_field.init",RB);export const init=RB;
|