@vanelsas/baredom 0.1.11-alpha → 0.2.2-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 +20 -0
- package/README.md +2 -2
- package/dist/base.js +245 -245
- package/dist/x-alert.js +9 -9
- package/dist/x-avatar-group.js +4 -4
- package/dist/x-avatar.js +17 -17
- package/dist/x-badge.js +11 -11
- package/dist/x-breadcrumbs.js +7 -7
- package/dist/x-button.js +15 -15
- package/dist/x-cancel-dialogue.js +14 -14
- package/dist/x-card.js +2 -2
- package/dist/x-chart.js +44 -44
- package/dist/x-checkbox.js +7 -7
- package/dist/x-chip.js +5 -5
- package/dist/x-collapse.js +11 -11
- package/dist/x-command-palette.js +17 -17
- package/dist/x-container.js +6 -6
- package/dist/x-context-menu.js +19 -19
- package/dist/x-copy.js +14 -14
- package/dist/x-currency-field.js +21 -21
- package/dist/x-date-picker.js +36 -36
- package/dist/x-divider.js +10 -10
- package/dist/x-drawer.js +9 -9
- package/dist/x-dropdown.js +6 -6
- package/dist/x-fieldset.js +5 -5
- package/dist/x-file-download.js +6 -6
- package/dist/x-form-field.js +17 -15
- package/dist/x-form.js +10 -10
- 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 +13 -13
- package/dist/x-navbar.js +12 -12
- package/dist/x-notification-center.js +6 -6
- package/dist/x-pagination.js +16 -16
- package/dist/x-popover.js +7 -7
- package/dist/x-progress-circle.js +9 -9
- package/dist/x-progress.js +8 -8
- package/dist/x-radio.js +9 -9
- package/dist/x-search-field.js +11 -11
- package/dist/x-select.js +10 -10
- package/dist/x-sidebar.js +24 -24
- package/dist/x-skeleton.js +5 -5
- package/dist/x-slider.js +9 -9
- package/dist/x-spacer.js +5 -5
- package/dist/x-spinner.js +5 -5
- package/dist/x-stat.js +9 -9
- package/dist/x-stepper.js +6 -6
- package/dist/x-switch.js +11 -11
- package/dist/x-tab.js +3 -3
- package/dist/x-table-cell.js +23 -23
- package/dist/x-table-row.js +5 -5
- package/dist/x-table.js +6 -6
- package/dist/x-tabs.js +7 -7
- package/dist/x-text-area.js +18 -18
- package/dist/x-timeline-item.js +13 -13
- package/dist/x-timeline.js +9 -9
- package/dist/x-toast.js +11 -11
- package/dist/x-toaster.js +1 -1
- package/package.json +1 -1
package/dist/x-context-menu.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
k=$APP.I(k,$APP.Ki);switch(a){case "bottom-start":return new $APP.P(null,2,[$APP.Vh,c,$APP.Uh,
|
|
4
|
-
2,[$APP.Vh,c,$APP.Uh,
|
|
5
|
-
|
|
6
|
-
"string"&&$APP.Cc(
|
|
7
|
-
(b=document.createElement("div"),b.setAttribute("id","__xOverlayRoot"),b.style.position="fixed",b.style.inset="0",b.style.pointerEvents="none",b.style.zIndex="0",document.body.appendChild(b));var c=document.createElement("div"),d=c.attachShadow({mode:"open"}),e=document.createElement("style"),
|
|
8
|
-
|
|
9
|
-
for(var c=null,d=0,e=0;;)if(e<d){var
|
|
10
|
-
$APP.p(k.contains(h.target)):k)?
|
|
11
|
-
m=$APP.H(h,$APP.Qc(m+(k-1),k),null),m=
|
|
12
|
-
c);$APP.n(a.parentNode)&&a.parentNode.removeChild(a)}},
|
|
13
|
-
|
|
14
|
-
2,[$APP.Og,m,$APP.Ki,q],null));
|
|
15
|
-
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
b=
|
|
19
|
-
null};a.disconnectedCallback=function(){var c=$APP.l(this,"__xContextMenuLayer");$APP.n(c)?(
|
|
20
|
-
|
|
2
|
+
var cH=function(a,b){return typeof a==="string"?(a=parseInt(a,10),$APP.p(isNaN(a))&&a>0?a:b):b},dH=function(a){return $APP.E.h(a,"bottom-start")?"top-start":$APP.E.h(a,"bottom-end")?"top-end":$APP.E.h(a,"top-start")?"bottom-start":$APP.E.h(a,"top-end")?"bottom-end":$APP.E.h(a,"right-start")?"left-start":$APP.E.h(a,"left-start")?"right-start":a},eH=function(a,b,c,d){var e=$APP.M(c);c=$APP.I(e,$APP.Vh);var g=$APP.I(e,$APP.Uh),h=$APP.I(e,$APP.Og);e=$APP.I(e,$APP.Ki);var k=$APP.M(d);d=$APP.I(k,$APP.Og);
|
|
3
|
+
k=$APP.I(k,$APP.Ki);switch(a){case "bottom-start":return new $APP.P(null,2,[$APP.Vh,c,$APP.Uh,g+e+b],null);case "bottom-end":return new $APP.P(null,2,[$APP.Vh,c+h-d,$APP.Uh,g+e+b],null);case "top-start":return new $APP.P(null,2,[$APP.Vh,c,$APP.Uh,g-k-b],null);case "top-end":return new $APP.P(null,2,[$APP.Vh,c+h-d,$APP.Uh,g-k-b],null);case "right-start":return new $APP.P(null,2,[$APP.Vh,c+h+b,$APP.Uh,g],null);case "left-start":return new $APP.P(null,2,[$APP.Vh,c-d-b,$APP.Uh,g],null);default:return new $APP.P(null,
|
|
4
|
+
2,[$APP.Vh,c,$APP.Uh,g+e+b],null)}},iH=function(a,b,c,d,e){function g(w){var z=eH(w,b,c,d);z=$APP.M(z);var A=$APP.I(z,$APP.Vh),C=$APP.I(z,$APP.Uh);z=A>=8&&A+m<=h-8;var F=C>=8&&C+q<=k-8;A=$APP.lg.h($APP.kg.h(A,8),h-m-8);C=$APP.lg.h($APP.kg.h(C,8),k-q-8);return new $APP.P(null,5,[$APP.Vh,A,$APP.Uh,C,fH,w,gH,z&&F,hH,$APP.kg.h(40,k-C-8)],null)}e=$APP.M(e);var h=$APP.I(e,$APP.Og),k=$APP.I(e,$APP.Ki);e=$APP.M(d);var m=$APP.I(e,$APP.Og),q=$APP.I(e,$APP.Ki),r=g(a),v=g(dH(a));return $APP.n(function(){var w=
|
|
5
|
+
gH.g(r);return $APP.n(w)?w:$APP.p(gH.g(v))}())?r:v},oH=function(a){a=new $APP.P(null,5,[$APP.rh,$APP.n(a.hasAttribute("open"))?a.getAttribute("open"):null,$APP.$h,$APP.n(a.hasAttribute("disabled"))?a.getAttribute("disabled"):null,$APP.fj,a.getAttribute("placement"),jH,a.getAttribute("offset"),kH,a.getAttribute("z-index")],null);var b=$APP.M(a),c=$APP.I(b,$APP.rh),d=$APP.I(b,$APP.$h),e=$APP.I(b,$APP.fj);a=$APP.I(b,jH);b=$APP.I(b,kH);c=c!=null&&$APP.N(c,"false");d=d!=null&&$APP.N(d,"false");e=typeof e===
|
|
6
|
+
"string"&&$APP.Cc(lH,e)?e:"bottom-start";return new $APP.P(null,5,[$APP.Pi,c,$APP.U,d,$APP.Ai,e,mH,cH(a,8),nH,cH(b,1E3)],null)},pH=function(a,b,c,d){b=new CustomEvent(b,{detail:d,bubbles:!0,composed:!0,cancelable:c});a.dispatchEvent(b);return $APP.p(b.defaultPrevented)},qH=function(a){return $APP.gc(a.querySelectorAll("[role\x3dmenuitem]:not([disabled]):not([aria-disabled\x3dtrue])"))},rH=function(a){return $APP.n(a)?a.focus():null},sH=function(a){var b=document.getElementById("__xOverlayRoot");$APP.n(b)||
|
|
7
|
+
(b=document.createElement("div"),b.setAttribute("id","__xOverlayRoot"),b.style.position="fixed",b.style.inset="0",b.style.pointerEvents="none",b.style.zIndex="0",document.body.appendChild(b));var c=document.createElement("div"),d=c.attachShadow({mode:"open"}),e=document.createElement("style"),g=document.createElement("div");c.style.position="fixed";c.style.inset="0";c.style.pointerEvents="none";c.style.zIndex=""+$APP.S.g(a);e.textContent=":host{color-scheme:light dark;--x-context-menu-bg:rgba(255,255,255,0.97);--x-context-menu-border:rgba(0,0,0,0.1);--x-context-menu-shadow:0 8px 32px rgba(0,0,0,0.14),0 2px 8px rgba(0,0,0,0.08);--x-context-menu-radius:10px;--x-context-menu-item-hover:rgba(0,0,0,0.05);--x-context-menu-item-active:rgba(0,0,0,0.09);--x-context-menu-item-fg:rgba(0,0,0,0.87);--x-context-menu-separator:rgba(0,0,0,0.1);}@media(prefers-color-scheme:dark){:host{--x-context-menu-bg:#1e293b;--x-context-menu-border:rgba(255,255,255,0.12);--x-context-menu-shadow:0 8px 32px rgba(0,0,0,0.7),0 2px 8px rgba(0,0,0,0.4);--x-context-menu-item-hover:rgba(255,255,255,0.08);--x-context-menu-item-active:rgba(255,255,255,0.14);--x-context-menu-item-fg:rgba(255,255,255,0.9);--x-context-menu-separator:rgba(255,255,255,0.12);}}[part\x3dpanel]{position:absolute;min-width:160px;border-radius:var(--x-context-menu-radius);background:var(--x-context-menu-bg);border:1px solid var(--x-context-menu-border);box-shadow:var(--x-context-menu-shadow);padding:4px 0;overflow:auto;pointer-events:auto;outline:none;@media(prefers-reduced-motion:no-preference){transition:opacity 120ms ease,transform 120ms ease;}}[role\x3dmenuitem]{color:var(--x-context-menu-item-fg);}[role\x3dmenuitem]:hover{background:var(--x-context-menu-item-hover);}";
|
|
8
|
+
g.setAttribute("part","panel");g.setAttribute("role","menu");g.setAttribute("tabindex","-1");d.appendChild(e);d.appendChild(g);b.appendChild(c);return c},tH=function(a){return $APP.n(a)?a.shadowRoot.querySelector("[part\x3dpanel]"):null},uH=function(a,b,c,d){var e=$APP.M(d);d=$APP.I(e,nH);e=$APP.I(e,hH);a.style.zIndex=""+$APP.S.g(d);a=tH(a);$APP.n(a)&&(a.style.left=""+$APP.S.g(b)+"px",a.style.top=""+$APP.S.g(c)+"px",a.style.maxHeight=""+$APP.S.g(e)+"px")},vH=function(a,b){a=$APP.u($APP.gc(a.children));
|
|
9
|
+
for(var c=null,d=0,e=0;;)if(e<d){var g=c.F(null,e);b.appendChild(g.cloneNode(!0));e+=1}else if(a=$APP.u(a))c=a,$APP.yc(c)?(a=$APP.ob(c),d=$APP.pb(c),c=a,g=$APP.B(a),a=d,d=g):(g=$APP.x(c),b.appendChild(g.cloneNode(!0)),a=$APP.y(c),c=null,d=0),e=0;else break},xH=function(a,b){function c(h){h.stopPropagation();h=h.target.closest("[role\x3dmenuitem]");return $APP.n(h)?(pH(a,"x-context-menu-select",!1,{item:h}),wH.h?wH.h(a,"select"):wH.call(null,a,"select")):null}function d(h){var k=tH(b);return $APP.n($APP.n(k)?
|
|
10
|
+
$APP.p(k.contains(h.target)):k)?wH.h?wH.h(a,"backdrop"):wH.call(null,a,"backdrop"):null}function e(h){var k=h.key,m=b.shadowRoot.activeElement;return $APP.E.h(k,"Escape")?(h.preventDefault(),h.stopPropagation(),wH.h?wH.h(a,"keyboard"):wH.call(null,a,"keyboard")):$APP.E.h(k,"ArrowDown")?(h.preventDefault(),$APP.n(m)?(h=qH(g),m=$APP.hd(h).indexOf(m),m=$APP.H(h,$APP.Qc(m+1,$APP.B(h)),null),m=rH(m)):m=rH($APP.x(qH(g))),m):$APP.E.h(k,"ArrowUp")?(h.preventDefault(),$APP.n(m)?(h=qH(g),k=$APP.B(h),m=$APP.hd(h).indexOf(m),
|
|
11
|
+
m=$APP.H(h,$APP.Qc(m+(k-1),k),null),m=rH(m)):m=rH($APP.x(qH(g))),m):($APP.E.h(k,"Enter")||$APP.E.h(k," "))&&$APP.n(m)?(h.preventDefault(),m.click()):null}var g=tH(b);b.addEventListener("keydown",e,!0);b.addEventListener("click",d);$APP.n(g)&&g.addEventListener("click",c);b.__onKey=e;b.__onClickBackdrop=d;b.__onItemClick=c},yH=function(a){if($APP.n(a)){var b=$APP.l(a,"__onKey"),c=$APP.l(a,"__onClickBackdrop");$APP.n(b)&&a.removeEventListener("keydown",b,!0);$APP.n(c)&&a.removeEventListener("click",
|
|
12
|
+
c);$APP.n(a.parentNode)&&a.parentNode.removeChild(a)}},wH=function(a,b){return $APP.n(a.hasAttribute("open"))&&pH(a,"x-context-menu-close-request",!0,{reason:b})?(a.removeAttribute("open"),yH($APP.l(a,"__xContextMenuLayer")),a.__xContextMenuLayer=null,pH(a,"x-context-menu-close",!1,{reason:b})):null},zH=function(a,b,c,d){if($APP.n(a.hasAttribute("disabled")))return null;if(pH(a,"x-context-menu-open-request",!0,{reason:d})){var e=oH(a);e=$APP.M(e);var g=$APP.I(e,$APP.Ai),h=$APP.I(e,mH),k=$APP.I(e,
|
|
13
|
+
nH),m=window.innerWidth,q=window.innerHeight,r=new $APP.P(null,4,[$APP.Vh,b,$APP.Uh,c,$APP.Og,1,$APP.Ki,1],null);b=iH(g,h,r,new $APP.P(null,2,[$APP.Og,200,$APP.Ki,300],null),new $APP.P(null,2,[$APP.Og,m,$APP.Ki,q],null));var v=sH(k);vH(a,tH(v));xH(a,v);uH(v,$APP.Vh.g(b),$APP.Uh.g(b),$APP.jg.m(b,nH,k));a.setAttribute("open","");a.__xContextMenuLayer=v;requestAnimationFrame(function(){var w=tH(v);if($APP.n(w)){var z=iH(g,h,r,new $APP.P(null,2,[$APP.Og,w.offsetWidth,$APP.Ki,w.offsetHeight],null),new $APP.P(null,
|
|
14
|
+
2,[$APP.Og,m,$APP.Ki,q],null));uH(v,$APP.Vh.g(z),$APP.Uh.g(z),$APP.jg.m(z,nH,k));return rH($APP.x(qH(w)))}return null});return pH(a,"x-context-menu-open",!1,{reason:d})}return null},AH=function(a,b){b=b.getBoundingClientRect();var c=oH(a);c=$APP.M(c);var d=$APP.I(c,$APP.Ai),e=$APP.I(c,mH),g=$APP.I(c,nH),h=window.innerWidth,k=window.innerHeight,m=new $APP.P(null,4,[$APP.Vh,b.left,$APP.Uh,b.top,$APP.Og,b.width,$APP.Ki,b.height],null);if(pH(a,"x-context-menu-open-request",!0,{reason:"programmatic"})){b=
|
|
15
|
+
iH(d,e,m,new $APP.P(null,2,[$APP.Og,200,$APP.Ki,300],null),new $APP.P(null,2,[$APP.Og,h,$APP.Ki,k],null));var q=sH(g);vH(a,tH(q));xH(a,q);uH(q,$APP.Vh.g(b),$APP.Uh.g(b),$APP.jg.m(b,nH,g));a.setAttribute("open","");a.__xContextMenuLayer=q;requestAnimationFrame(function(){var r=tH(q);if($APP.n(r)){var v=iH(d,e,m,new $APP.P(null,2,[$APP.Og,r.offsetWidth,$APP.Ki,r.offsetHeight],null),new $APP.P(null,2,[$APP.Og,h,$APP.Ki,k],null));uH(q,$APP.Vh.g(v),$APP.Uh.g(v),$APP.jg.m(v,nH,g));return rH($APP.x(qH(r)))}return null});
|
|
16
|
+
return pH(a,"x-context-menu-open",!1,{reason:"programmatic"})}return null},BH=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.n(d)?this.setAttribute(c,""):this.removeAttribute(c)}})},CH=function(a){Object.defineProperty(a,"placement",{configurable:!0,enumerable:!0,get:function(){return this.getAttribute("placement")},set:function(b){return b!=null?this.setAttribute("placement",""+$APP.S.g(b)):this.removeAttribute("placement")}})},
|
|
17
|
+
DH=function(a){a.openAt=function(b,c){return zH(this,b,c,"programmatic")};a.toggleAt=function(b,c){return $APP.n(this.hasAttribute("open"))?wH(this,"toggle"):zH(this,b,c,"toggle")};a.openForElement=function(b){return AH(this,b)};a.close=function(){return wH(this,"programmatic")}},EH=function(){function a(){return Reflect.construct(HTMLElement,[],$APP.Ra(b))}var b=new $APP.Dd;$APP.Ed(b,a);return a},GH=function(){if($APP.n(customElements.get("x-context-menu")))return null;var a=Object.create(HTMLElement.prototype),
|
|
18
|
+
b=EH();Object.setPrototypeOf(b,HTMLElement);a.constructor=b;BH(a,"open","open");BH(a,"disabled","disabled");CH(a);DH(a);a.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xContextMenuRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("slot");d.textContent=":host{display:contents;}slot{display:none;}";c.appendChild(d);c.appendChild(e);d={};d.root=c;d.slot=e;this.__xContextMenuRefs=d}return $APP.n(this.hasAttribute("open"))?this.removeAttribute("open"):
|
|
19
|
+
null};a.disconnectedCallback=function(){var c=$APP.l(this,"__xContextMenuLayer");$APP.n(c)?(yH(c),this.__xContextMenuLayer=null,c=void 0):c=null;return c};a.attributeChangedCallback=function(c){a:{if($APP.E.h(c,"open")){if($APP.n(this.hasAttribute("open"))){c=null;break a}c=$APP.l(this,"__xContextMenuLayer");if($APP.n(c)){yH(c);this.__xContextMenuLayer=null;c=void 0;break a}}c=null}return c};b.observedAttributes=FH;b.prototype=a;return customElements.define("x-context-menu",b)},HH=function(){return GH()},
|
|
20
|
+
hH=new $APP.K(null,"max-height","max-height",-612563804),mH=new $APP.K(null,"offset","offset",296498311),fH=new $APP.K(null,"final-placement","final-placement",-1586044424),gH=new $APP.K(null,"fits","fits",2008565808),nH=new $APP.K(null,"z-index","z-index",1892827090),kH=new $APP.K(null,"z-index-raw","z-index-raw",-1179679257),jH=new $APP.K(null,"offset-raw","offset-raw",-1418404095);var FH=["open","disabled","placement","offset","z-index"],lH=new $APP.R(null,new $APP.P(null,6,["right-start",null,"bottom-start",null,"bottom-end",null,"top-end",null,"top-start",null,"left-start",null],null),null);$APP.ka("baredom.exports.x_context_menu.init",HH);export const init=HH;
|
package/dist/x-copy.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var Nr=function(a){return a==null?!0:$APP.
|
|
3
|
-
[Nr(b),$APP.
|
|
4
|
-
$APP.M(a);a=$APP.I(b,$APP.Mh);var c=$APP.I(b,$APP.Mg),d=$APP.I(b,Zr);b=$APP.I(b,$APP.fi);return{text:$APP.n(a)?a:"",mode:$APP.n(b)?b:"text",from:$APP.n(c)?c:null,fromAttr:$APP.n(d)?d:null}},fs=function(a){var b=$APP.l(a,"__xCopyRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("span"),e=document.createElement("button"),
|
|
2
|
+
var Nr=function(a){return a==null?!0:$APP.E.h(a,"false")?!1:$APP.E.h(a,"0")?!1:!0},Or=function(a){return typeof a==="string"&&$APP.N(a,"")?(a=parseInt(a,10),$APP.p(isNaN(a))&&a>0?a:1200):1200},Pr=function(a){return Math.min(1E4,Math.max(100,a))},ds=function(a){var b=$APP.M(a);a=$APP.I(b,Qr);var c=$APP.I(b,Rr),d=$APP.I(b,Sr),e=$APP.I(b,$APP.zg),g=$APP.I(b,Tr),h=$APP.I(b,Ur),k=$APP.I(b,Vr),m=$APP.I(b,$APP.$h),q=$APP.I(b,Wr);b=$APP.I(b,Xr);return $APP.bf([Yr,$APP.fi,Zr,$r,as,$APP.Mg,bs,$APP.U,cs,$APP.Mh],
|
|
3
|
+
[Nr(b),$APP.E.h(g,"html")?"html":"text",typeof k==="string"&&$APP.N(k.trim(),"")?k.trim():null,typeof a==="string"&&$APP.N(a.trim(),"")?a.trim():null,Pr(Or(c)),typeof d==="string"&&$APP.N(d.trim(),"")?d.trim():null,function(){var r;if(r=typeof h==="string")r=(r=$APP.N(h,""))?h:r;return $APP.n(r)?r:"Copy failed"}(),$APP.J(m),function(){var r;if(r=typeof q==="string")r=(r=$APP.N(q,""))?q:r;return $APP.n(r)?r:"Copied"}(),typeof e==="string"&&$APP.N(e.trim(),"")?e.trim():null])},es=function(a){var b=
|
|
4
|
+
$APP.M(a);a=$APP.I(b,$APP.Mh);var c=$APP.I(b,$APP.Mg),d=$APP.I(b,Zr);b=$APP.I(b,$APP.fi);return{text:$APP.n(a)?a:"",mode:$APP.n(b)?b:"text",from:$APP.n(c)?c:null,fromAttr:$APP.n(d)?d:null}},fs=function(a){var b=$APP.l(a,"__xCopyRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("span"),e=document.createElement("button"),g=document.createElement("slot"),h=document.createElement("span"),k=document.createElement("slot"),m=document.createElement("span");
|
|
5
5
|
c.textContent=":host{display:inline-block;position:relative;color-scheme:light dark;--x-copy-tooltip-bg:#1e293b;--x-copy-tooltip-fg:#f8fafc;--x-copy-tooltip-success-bg:#15803d;--x-copy-tooltip-success-fg:#f0fdf4;--x-copy-tooltip-error-bg:#b91c1c;--x-copy-tooltip-error-fg:#fef2f2;--x-copy-tooltip-radius:6px;--x-copy-tooltip-padding:4px 8px;--x-copy-tooltip-font-size:0.8125rem;--x-copy-tooltip-z:100;}@media (prefers-color-scheme:dark){:host{--x-copy-tooltip-bg:#0f172a;--x-copy-tooltip-fg:#e2e8f0;--x-copy-tooltip-success-bg:#166534;--x-copy-tooltip-success-fg:#dcfce7;--x-copy-tooltip-error-bg:#991b1b;--x-copy-tooltip-error-fg:#fee2e2;}}[part\x3dwrap]{display:inline-flex;align-items:center;justify-content:center;}[part\x3dtrigger]{all:unset;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-sizing:border-box;}[part\x3dtrigger]:focus-visible{outline:2px solid currentColor;outline-offset:2px;}:host([disabled]) [part\x3dtrigger]{opacity:0.55;pointer-events:none;cursor:default;}[part\x3dtooltip]{display:none;position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);white-space:nowrap;background:var(--x-copy-tooltip-bg);color:var(--x-copy-tooltip-fg);border-radius:var(--x-copy-tooltip-radius);padding:var(--x-copy-tooltip-padding);font-size:var(--x-copy-tooltip-font-size);z-index:var(--x-copy-tooltip-z);pointer-events:none;}:host([data-tooltip-open]) [part\x3dtooltip]{display:block;}:host([data-tooltip-kind\x3dsuccess]) [part\x3dtooltip]{background:var(--x-copy-tooltip-success-bg);color:var(--x-copy-tooltip-success-fg);}:host([data-tooltip-kind\x3derror]) [part\x3dtooltip]{background:var(--x-copy-tooltip-error-bg);color:var(--x-copy-tooltip-error-fg);}@media (prefers-reduced-motion:reduce){[part\x3dtrigger]{transition:none;}}";
|
|
6
|
-
d.setAttribute("part","wrap");e.setAttribute("part","trigger");e.setAttribute("type","button");e.appendChild(
|
|
6
|
+
d.setAttribute("part","wrap");e.setAttribute("part","trigger");e.setAttribute("type","button");e.appendChild(g);h.setAttribute("part","tooltip");h.setAttribute("role","status");h.setAttribute("aria-live","polite");k.setAttribute("name","tooltip");m.setAttribute("part","tooltip-text");h.appendChild(k);h.appendChild(m);d.appendChild(e);d.appendChild(h);b.appendChild(c);b.appendChild(d);a.__xCopyRefs={root:b,wrap:d,trigger:e,tooltip:h,tooltipSlot:k,tooltipText:m};return $APP.l(a,"__xCopyRefs")},gs=function(a){return ds($APP.bf([Sr,
|
|
7
7
|
$APP.zg,Tr,Ur,Vr,$APP.$h,Wr,Xr,Qr,Rr],[a.getAttribute("from"),a.getAttribute("text"),a.getAttribute("mode"),a.getAttribute("error-message"),a.getAttribute("from-attr"),a.hasAttribute("disabled"),a.getAttribute("success-message"),a.getAttribute("show-tooltip"),a.getAttribute("hotkey"),a.getAttribute("tooltip-ms")]))},hs=function(a){var b=$APP.l(a,"__xCopyTextValue");if(typeof b==="string")return b;b=a.getAttribute("text");if(typeof b==="string"&&$APP.N(b,""))return b;b=a.getAttribute("from");return typeof b===
|
|
8
|
-
"string"&&$APP.N(b,"")&&(b=document.querySelector(b),$APP.n(b))?(a=a.getAttribute("from-attr"),a=typeof a==="string"&&$APP.N(a,"")?b.getAttribute(a):b.textContent,$APP.n(a)?a:""):""},is=function(a){var b=hs(a),c=function(){var d=a.getAttribute("mode");return $APP.n(d)?d:"text"}();return new Promise(function(d,e){if($APP.
|
|
9
|
-
{type:"text/html"}),"text/plain":new Blob([b],{type:"text/plain"})})],null))).then(function(){return d.g?d.g(b):d.call(null,b)}).catch(function(h){return e.g?e.g(h):e.call(null,h)});try{var
|
|
10
|
-
d.g(b):d.call(null,b)}).catch(function(h){try{return document.execCommand("copy"),d.g?d.g(b):d.call(null,b)}catch(k){if(k instanceof Error)return e.g?e.g(h):e.call(null,h);throw k;}});try{return
|
|
11
|
-
$APP.l(a,"__xCopyRefs");if($APP.n(e)){var
|
|
8
|
+
"string"&&$APP.N(b,"")&&(b=document.querySelector(b),$APP.n(b))?(a=a.getAttribute("from-attr"),a=typeof a==="string"&&$APP.N(a,"")?b.getAttribute(a):b.textContent,$APP.n(a)?a:""):""},is=function(a){var b=hs(a),c=function(){var d=a.getAttribute("mode");return $APP.n(d)?d:"text"}();return new Promise(function(d,e){if($APP.E.h(c,"html")){if($APP.n(function(){var h=navigator.clipboard;return $APP.n(h)?window.ClipboardItem:h}()))return navigator.clipboard.write($APP.xg(new $APP.O(null,1,5,$APP.Xd,[new ClipboardItem({"text/html":new Blob([b],
|
|
9
|
+
{type:"text/html"}),"text/plain":new Blob([b],{type:"text/plain"})})],null))).then(function(){return d.g?d.g(b):d.call(null,b)}).catch(function(h){return e.g?e.g(h):e.call(null,h)});try{var g=document.createElement("textarea");g.value=b;document.body.appendChild(g);g.select();document.execCommand("copy");g.remove();return d.g?d.g(b):d.call(null,b)}catch(h){if(h instanceof Error)return g=h,e.g?e.g(g):e.call(null,g);throw h;}}else{if($APP.n(navigator.clipboard))return navigator.clipboard.writeText(b).then(function(){return d.g?
|
|
10
|
+
d.g(b):d.call(null,b)}).catch(function(h){try{return document.execCommand("copy"),d.g?d.g(b):d.call(null,b)}catch(k){if(k instanceof Error)return e.g?e.g(h):e.call(null,h);throw k;}});try{return g=document.createElement("textarea"),g.value=b,g.style.position="fixed",g.style.opacity="0",document.body.appendChild(g),g.select(),document.execCommand("copy"),g.remove(),d.g?d.g(b):d.call(null,b)}catch(h){if(h instanceof Error)return g=h,e.g?e.g(g):e.call(null,g);throw h;}}})},js=function(a,b,c,d){var e=
|
|
11
|
+
$APP.l(a,"__xCopyRefs");if($APP.n(e)){var g=$APP.l(a,"__xCopyTid");$APP.n(g)&&(clearTimeout(g),a.__xCopyTid=null);a.setAttribute("data-tooltip-open","");a.setAttribute("data-tooltip-kind",b);$APP.l(e,"tooltipText").textContent=c;$APP.ma(a,"__xCopyTid",setTimeout(function(){a.__xCopyTid=null;a.removeAttribute("data-tooltip-open");a.removeAttribute("data-tooltip-kind");var h=$APP.l(a,"__xCopyRefs");$APP.n(h)&&($APP.l(h,"tooltipText").textContent="");return null},d))}return null},ks=function(a,b,c,d){b=
|
|
12
12
|
new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:d});a.dispatchEvent(b);return b},ls=function(a){if(!$APP.n(a.hasAttribute("disabled"))){var b=gs(a),c=es(b);c=ks(a,"x-copy-request",c,!0);$APP.n(c.defaultPrevented)||is(a).then(function(d){ks(a,"x-copy-success",{text:$APP.n(d)?d:""},!1);return $APP.n(Yr.g(b))?js(a,"success",cs.g(b),as.g(b)):null}).catch(function(d){ks(a,"x-copy-error",{error:""+$APP.S.g(d)},!1);return $APP.n(Yr.g(b))?js(a,"error",bs.g(b),as.g(b)):null})}return null},ms=
|
|
13
|
-
function(a,b){if(typeof b==="string"&&$APP.N(b,"")){var c=b.toLowerCase().split("+");b=$APP.ic(c);var d=$APP.J($APP.Ad(function(h){return $APP.
|
|
14
|
-
a.getAttribute("hotkey");return $APP.n(ms(e,
|
|
15
|
-
c.removeEventListener("click",d);$APP.n(b)&&document.removeEventListener("keydown",b)}a.__xCopyHandlers=null},ps=function(a){var b=fs(a),c=a.hasAttribute("disabled");$APP.l(b,"trigger").disabled=$APP.J(c);$APP.n(c)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled")},qs=function(a){for(var b=$APP.
|
|
16
|
-
null),new $APP.O(null,2,5,$APP.Xd,["mode","mode"],null),new $APP.O(null,2,5,$APP.Xd,["successMessage","success-message"],null),new $APP.O(null,2,5,$APP.Xd,["errorMessage","error-message"],null),new $APP.O(null,2,5,$APP.Xd,["hotkey","hotkey"],null)],null)),c=null,d=0,e=0;;)if(e<d){var
|
|
17
|
-
null?this.removeAttribute(F):this.setAttribute(F,""+$APP.S.g(
|
|
18
|
-
c,d,e,k,m,q,
|
|
13
|
+
function(a,b){if(typeof b==="string"&&$APP.N(b,"")){var c=b.toLowerCase().split("+");b=$APP.ic(c);var d=$APP.J($APP.Ad(function(h){return $APP.E.h(h,"ctrl")},c)),e=$APP.J($APP.Ad(function(h){return $APP.E.h(h,"shift")},c)),g=$APP.J($APP.Ad(function(h){return $APP.E.h(h,"alt")},c));c=$APP.J($APP.Ad(function(h){return $APP.E.h(h,"meta")},c));return $APP.E.h(a.key.toLowerCase(),b)&&$APP.E.h(d,a.ctrlKey)&&$APP.E.h(e,a.shiftKey)&&$APP.E.h(g,a.altKey)&&$APP.E.h(c,a.metaKey)}return null},ns=function(a){function b(e){var g=
|
|
14
|
+
a.getAttribute("hotkey");return $APP.n(ms(e,g))?(e.preventDefault(),ls(a)):null}function c(){return ls(a)}var d=fs(a);$APP.l(d,"trigger").addEventListener("click",c);document.addEventListener("keydown",b);$APP.ma(a,"__xCopyHandlers",{click:c,keydown:b})},os=function(a){var b=$APP.l(a,"__xCopyTid");$APP.n(b)&&(clearTimeout(b),a.__xCopyTid=null);b=$APP.l(a,"__xCopyHandlers");var c=$APP.l(a,"__xCopyRefs");if($APP.n($APP.n(b)?c:b)){c=$APP.l(c,"trigger");var d=$APP.l(b,"click");b=$APP.l(b,"keydown");$APP.n(d)&&
|
|
15
|
+
c.removeEventListener("click",d);$APP.n(b)&&document.removeEventListener("keydown",b)}a.__xCopyHandlers=null},ps=function(a){var b=fs(a),c=a.hasAttribute("disabled");$APP.l(b,"trigger").disabled=$APP.J(c);$APP.n(c)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled")},qs=function(a){for(var b=$APP.u(new $APP.O(null,7,5,$APP.Xd,[new $APP.O(null,2,5,$APP.Xd,["text","text"],null),new $APP.O(null,2,5,$APP.Xd,["from","from"],null),new $APP.O(null,2,5,$APP.Xd,["fromAttr","from-attr"],
|
|
16
|
+
null),new $APP.O(null,2,5,$APP.Xd,["mode","mode"],null),new $APP.O(null,2,5,$APP.Xd,["successMessage","success-message"],null),new $APP.O(null,2,5,$APP.Xd,["errorMessage","error-message"],null),new $APP.O(null,2,5,$APP.Xd,["hotkey","hotkey"],null)],null)),c=null,d=0,e=0;;)if(e<d){var g=c.F(null,e),h=$APP.H(g,0,null),k=$APP.H(g,1,null);Object.defineProperty(a,h,{get:function(r,v,w,z,A,C,F){return function(){return this.getAttribute(F)}}(b,c,d,e,g,h,k),set:function(r,v,w,z,A,C,F){return function(D){return D==
|
|
17
|
+
null?this.removeAttribute(F):this.setAttribute(F,""+$APP.S.g(D))}}(b,c,d,e,g,h,k),enumerable:!0,configurable:!0});e+=1}else if(h=$APP.u(b)){g=h;if($APP.yc(g))b=$APP.ob(g),e=$APP.pb(g),c=b,d=$APP.B(b),b=e;else{k=$APP.x(g);var m=$APP.H(k,0,null),q=$APP.H(k,1,null);Object.defineProperty(a,m,{get:function(r,v,w,z,A,C,F){return function(){return this.getAttribute(F)}}(b,c,d,e,k,m,q,g,h),set:function(r,v,w,z,A,C,F){return function(D){return D==null?this.removeAttribute(F):this.setAttribute(F,""+$APP.S.g(D))}}(b,
|
|
18
|
+
c,d,e,k,m,q,g,h),enumerable:!0,configurable:!0});b=$APP.y(g);c=null;d=0}e=0}else break;Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(r){return $APP.n(r)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0});Object.defineProperty(a,"showTooltip",{get:function(){return Nr(this.getAttribute("show-tooltip"))},set:function(r){return $APP.n(r)?this.setAttribute("show-tooltip","true"):this.setAttribute("show-tooltip",
|
|
19
19
|
"false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"tooltipMs",{get:function(){return Or(this.getAttribute("tooltip-ms"))},set:function(r){return r==null?this.removeAttribute("tooltip-ms"):this.setAttribute("tooltip-ms",""+$APP.S.g(r|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"textValue",{get:function(){return $APP.l(this,"__xCopyTextValue")},set:function(r){this.__xCopyTextValue=typeof r==="string"?r:void 0},enumerable:!0,configurable:!0});Object.defineProperty(a,
|
|
20
20
|
"copy",{value:function(){return is(this)},enumerable:!0,configurable:!0,writable:!0})},rs=function(){function a(){return Reflect.construct(HTMLElement,[],$APP.Ra(b))}var b=new $APP.Dd;$APP.Ed(b,a);return a},ts=function(){if(!$APP.n(customElements.get("x-copy"))){var a=Object.create(HTMLElement.prototype),b=rs();Object.setPrototypeOf(b,HTMLElement);a.constructor=b;qs(a);a.connectedCallback=function(){fs(this);os(this);ns(this);ps(this);return null};a.disconnectedCallback=function(){os(this);return null};
|
|
21
21
|
a.attributeChangedCallback=function(c,d,e){$APP.N(d,e)&&ps(this);return null};b.observedAttributes=ss;b.prototype=a;customElements.define("x-copy",b)}return null},us=function(){return ts()},Yr=new $APP.K(null,"show-tooltip?","show-tooltip?",-1214081087),Rr=new $APP.K(null,"tooltip-ms-raw","tooltip-ms-raw",-1973326401),vs=new $APP.K(null,"fromAttr","fromAttr",-1768252533),cs=new $APP.K(null,"success-message","success-message",-96541601),Vr=new $APP.K(null,"from-attr-raw","from-attr-raw",761657416),
|
package/dist/x-currency-field.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
"")?void 0:b,{minimumFractionDigits:2,maximumFractionDigits:2})).format(c)}catch(d){return a}},
|
|
4
|
-
d.setAttribute("part","field");e.setAttribute("part","label");e.setAttribute("id","label");e.setAttribute("for","input");
|
|
5
|
-
"error");q.setAttribute("role","alert");q.setAttribute("aria-live","assertive");
|
|
6
|
-
$APP.p(isNaN(a));k=$APP.n(k)?parseFloat(k):null;m=$APP.n(m)?parseFloat(m):null;return $APP.n(e)?b.setValidity({customError:!0},
|
|
7
|
-
"Value must be at most "+$APP.S.g(m)+".",c):b.setValidity({},"",c)},
|
|
8
|
-
a.hasAttribute("required"),a.getAttribute("max"),a.hasAttribute("readonly"),a.getAttribute("value"),a.getAttribute("locale"),a.getAttribute("placeholder")]);var k=$APP.M(h);h=$APP.I(k,$APP.wh);var m=$APP.I(k,$APP.dh),q=$APP.I(k,
|
|
9
|
-
$APP.cj,$APP.Di,$APP.gh,$APP.dj,$APP.ii,$APP.T,$APP.Nh,$APP.kh,$APP.mi,
|
|
10
|
-
"")&&$APP.p(isNaN(w)),A=$APP.N(r,"")?parseFloat(r):null,C=$APP.N(
|
|
11
|
-
$APP.Di.g(h);e.disabled=$APP.U.g(h);e.readOnly=$APP.cj.g(h);e.required=$APP.bh.g(h);d=$APP.n($APP.bh.g(h))?"true":"false";e.setAttribute("aria-required",d);e.setAttribute("aria-invalid",$APP.n(q)?"true":"false");d=$APP.n($APP.n(r)?q:r)?"hint error":$APP.n(r)?"hint":$APP.n(q)?"error":null;$APP.n(d)?e.setAttribute("aria-describedby",d):e.removeAttribute("aria-describedby");$APP.
|
|
12
|
-
c.classList.add("label-hidden");
|
|
13
|
-
$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=a.getAttribute("value");return b.value=$APP.n(c)?c:""}return null}},
|
|
14
|
-
$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=b.value,d=parseFloat(c);c=$APP.n(isNaN(d))?c:""+$APP.S.g(d);d=a.getAttribute("name");d=$APP.n(d)?d:"";a.setAttribute("value",c);var e=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(e)&&(e.setFormValue(c),
|
|
15
|
-
c);b.addEventListener("input",d);b.addEventListener("change",e);a.__xCurrencyFieldHandlers={focus:c,input:d,change:e}}},
|
|
16
|
-
(
|
|
17
|
-
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}})},
|
|
18
|
-
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,"__xCurrencyFieldRefs");if($APP.n(c)){c=$APP.l(c,"input");
|
|
19
|
-
"observedAttributes",{get:function(){return
|
|
20
|
-
(c=$APP.l(this,"__xCurrencyFieldRefs"),$APP.n(c)&&(c=$APP.l(c,"input"),$APP.
|
|
21
|
-
$APP.n(c)&&c.setFormValue("");return
|
|
22
|
-
1169887491),
|
|
2
|
+
var ex=function(a){a=(""+$APP.S.g($APP.n(a)?a:"")).trim().toUpperCase();return $APP.E.h(a,"")?"USD":a},fx=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},gx=function(a,b){try{var c=(new Intl.NumberFormat($APP.E.h(b,"")?"en-US":b,{style:"currency",currency:a})).formatToParts(0),d=$APP.Ad(function(e){return $APP.E.h("currency",e.type)?e.value:null},$APP.gc(c));return $APP.n(d)?d:a}catch(e){return a}},hx=function(a,b){var c=parseFloat(a);if($APP.n(isNaN(c)))return a;try{return(new Intl.NumberFormat($APP.E.h(b,
|
|
3
|
+
"")?void 0:b,{minimumFractionDigits:2,maximumFractionDigits:2})).format(c)}catch(d){return a}},ix=function(a){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("label"),g=document.createElement("div"),h=document.createElement("span"),k=document.createElement("input"),m=document.createElement("span"),q=document.createElement("span");c.textContent=":host{display:block;color-scheme:light dark;--x-currency-field-bg:#ffffff;--x-currency-field-color:#111827;--x-currency-field-border:1px solid #d1d5db;--x-currency-field-border-radius:6px;--x-currency-field-focus-ring-color:#2563eb;--x-currency-field-symbol-color:#6b7280;--x-currency-field-label-color:#374151;--x-currency-field-hint-color:#6b7280;--x-currency-field-error-color:#dc2626;--x-currency-field-disabled-opacity:0.45;}@media (prefers-color-scheme:dark){:host{--x-currency-field-bg:#1f2937;--x-currency-field-color:#f9fafb;--x-currency-field-border:1px solid #4b5563;--x-currency-field-focus-ring-color:#3b82f6;--x-currency-field-symbol-color:#9ca3af;--x-currency-field-label-color:#d1d5db;--x-currency-field-hint-color:#9ca3af;--x-currency-field-error-color:#f87171;}}[part\x3dfield]{display:flex;flex-direction:column;gap:0.25rem;}[part\x3dlabel]{display:block;font-size:0.875rem;font-weight:500;color:var(--x-currency-field-label-color);}.label-hidden{display:none;}[part\x3dinput-wrapper]{display:flex;align-items:center;background:var(--x-currency-field-bg);border:var(--x-currency-field-border);border-radius:var(--x-currency-field-border-radius);transition:border-color 120ms ease,box-shadow 120ms ease;}[part\x3dinput-wrapper]:focus-within{border-color:var(--x-currency-field-focus-ring-color);box-shadow:0 0 0 3px color-mix(in srgb,var(--x-currency-field-focus-ring-color) 20%,transparent);}:host([data-invalid]) [part\x3dinput-wrapper]{border-color:var(--x-currency-field-error-color);}:host([data-invalid]) [part\x3dinput-wrapper]:focus-within{box-shadow:0 0 0 3px color-mix(in srgb,var(--x-currency-field-error-color) 20%,transparent);}[part\x3dsymbol]{flex-shrink:0;padding:0.5rem 0 0.5rem 0.75rem;font-size:1rem;color:var(--x-currency-field-symbol-color);user-select:none;pointer-events:none;}[part\x3dinput]{flex:1;min-width:0;padding:0.5rem 0.75rem;background:transparent;color:var(--x-currency-field-color);border:none;outline:none;font-size:1rem;line-height:1.5;font-family:inherit;}[part\x3dinput]:disabled{opacity:1;cursor:not-allowed;}:host([disabled]) [part\x3dinput-wrapper]{opacity:var(--x-currency-field-disabled-opacity);cursor:not-allowed;}[part\x3dhint]{display:block;font-size:0.8125rem;color:var(--x-currency-field-hint-color);}.hint-hidden{display:none;}[part\x3derror]{display:block;font-size:0.8125rem;color:var(--x-currency-field-error-color);}.error-hidden{display:none;}@media (prefers-reduced-motion:reduce){[part\x3dinput-wrapper]{transition:none;}}";
|
|
4
|
+
d.setAttribute("part","field");e.setAttribute("part","label");e.setAttribute("id","label");e.setAttribute("for","input");g.setAttribute("part","input-wrapper");h.setAttribute("part","symbol");h.setAttribute("aria-hidden","true");k.setAttribute("part","input");k.setAttribute("id","input");k.setAttribute("inputmode","decimal");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",
|
|
5
|
+
"error");q.setAttribute("role","alert");q.setAttribute("aria-live","assertive");g.appendChild(h);g.appendChild(k);d.appendChild(e);d.appendChild(g);d.appendChild(m);d.appendChild(q);b.appendChild(c);b.appendChild(d);a.__xCurrencyFieldRefs={field:d,label:e,wrapper:g,symbol:h,input:k,hint:m,error:q}},jx=function(a,b,c,d){var e=a.hasAttribute("error");var g=a.getAttribute("error");g=$APP.n(g)?g:"";var h=a.hasAttribute("required"),k=a.getAttribute("min"),m=a.getAttribute("max");a=parseFloat(d);var q=
|
|
6
|
+
$APP.p(isNaN(a));k=$APP.n(k)?parseFloat(k):null;m=$APP.n(m)?parseFloat(m):null;return $APP.n(e)?b.setValidity({customError:!0},g,c):$APP.n($APP.n(h)?$APP.E.h(d,""):h)?b.setValidity({valueMissing:!0},"Please fill in this field.",c):$APP.N(d,"")&&!q?b.setValidity({badInput:!0},"Please enter a valid number.",c):$APP.n(q?$APP.n(k)?$APP.p(isNaN(k))&&a<k:k:q)?b.setValidity({rangeUnderflow:!0},"Value must be at least "+$APP.S.g(k)+".",c):$APP.n(q?$APP.n(m)?$APP.p(isNaN(m))&&a>m:m:q)?b.setValidity({rangeOverflow:!0},
|
|
7
|
+
"Value must be at most "+$APP.S.g(m)+".",c):b.setValidity({},"",c)},ox=function(a){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){var c=$APP.l(b,"label"),d=$APP.l(b,"symbol"),e=$APP.l(b,"input"),g=$APP.l(b,"hint");b=$APP.l(b,"error");var h=$APP.bf([$APP.dh,kx,$APP.Kh,$APP.th,$APP.Fh,$APP.$h,lx,$APP.Cg,$APP.ih,$APP.vi,$APP.Gi,mx,$APP.wh],[a.getAttribute("label"),a.getAttribute("currency"),a.getAttribute("name"),a.getAttribute("error"),a.getAttribute("hint"),a.hasAttribute("disabled"),a.getAttribute("min"),
|
|
8
|
+
a.hasAttribute("required"),a.getAttribute("max"),a.hasAttribute("readonly"),a.getAttribute("value"),a.getAttribute("locale"),a.getAttribute("placeholder")]);var k=$APP.M(h);h=$APP.I(k,$APP.wh);var m=$APP.I(k,$APP.dh),q=$APP.I(k,kx),r=$APP.I(k,$APP.Kh),v=$APP.I(k,$APP.th),w=$APP.I(k,$APP.Fh),z=$APP.I(k,$APP.$h),A=$APP.I(k,lx),C=$APP.I(k,$APP.Cg),F=$APP.I(k,$APP.ih),D=$APP.I(k,$APP.vi),Q=$APP.I(k,$APP.Gi);k=$APP.I(k,mx);var V=$APP.n(v)?v:"",fa=$APP.n(w)?w:"",wa=$APP.n(m)?m:"";h=$APP.bf([$APP.Vi,$APP.bh,
|
|
9
|
+
$APP.cj,$APP.Di,$APP.gh,$APP.dj,$APP.ii,$APP.T,$APP.Nh,$APP.kh,$APP.mi,nx,$APP.fh,$APP.W,$APP.qh,$APP.U],[$APP.n(A)?A:"",$APP.J(C),$APP.J(D),$APP.n(h)?h:"",typeof w==="string"&&$APP.N(w,"")&&w!=null,$APP.n(k)?k:"",$APP.n(r)?r:"",$APP.n(Q)?Q:"",typeof m==="string"&&$APP.N(m,"")&&m!=null,typeof v==="string"&&$APP.N(v,"")&&v!=null,fa,ex(q),$APP.n(F)?F:"",wa,V,$APP.J(z)]);m=$APP.kh.g(h);$APP.n(m)?q=null:(v=$APP.M(h),q=$APP.I(v,$APP.T),r=$APP.I(v,$APP.Vi),v=$APP.I(v,$APP.fh),w=parseFloat(q),z=$APP.N(q,
|
|
10
|
+
"")&&$APP.p(isNaN(w)),A=$APP.N(r,"")?parseFloat(r):null,C=$APP.N(v,"")?parseFloat(v):null,q=$APP.N(q,"")&&!z?"Please enter a valid number.":$APP.n(z?$APP.n(A)?$APP.p(isNaN(A))&&w<A:A:z)?"Value must be at least "+$APP.S.g(r)+".":$APP.n(z?$APP.n(C)?$APP.p(isNaN(C))&&w>C:C:z)?"Value must be at most "+$APP.S.g(v)+".":"");r=q;q=$APP.n(m)?m:$APP.N($APP.n(r)?r:"","");m=$APP.n(m)?$APP.qh.g(h):$APP.n(r)?r:"";r=$APP.gh.g(h);v=$APP.Nh.g(h);z=nx.g(h);w=$APP.dj.g(h);d.textContent=gx(z,w);e.name=$APP.ii.g(h);e.placeholder=
|
|
11
|
+
$APP.Di.g(h);e.disabled=$APP.U.g(h);e.readOnly=$APP.cj.g(h);e.required=$APP.bh.g(h);d=$APP.n($APP.bh.g(h))?"true":"false";e.setAttribute("aria-required",d);e.setAttribute("aria-invalid",$APP.n(q)?"true":"false");d=$APP.n($APP.n(r)?q:r)?"hint error":$APP.n(r)?"hint":$APP.n(q)?"error":null;$APP.n(d)?e.setAttribute("aria-describedby",d):e.removeAttribute("aria-describedby");$APP.E.h(e,a.shadowRoot.activeElement)||(d=$APP.T.g(h),e.value=$APP.E.h(d,"")?"":hx(d,w));c.textContent=$APP.W.g(h);$APP.n(v)?c.classList.remove("label-hidden"):
|
|
12
|
+
c.classList.add("label-hidden");g.textContent=$APP.mi.g(h);$APP.n(r)?g.classList.remove("hint-hidden"):g.classList.add("hint-hidden");b.textContent=m;$APP.n(q)?b.classList.remove("error-hidden"):b.classList.add("error-hidden");fx(a,"data-invalid",q);c=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(c)?(g=a.getAttribute("value"),a=jx(a,c,e,$APP.n(g)?g:"")):a=null;return a}return null},px=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},qx=function(a){return function(){var b=
|
|
13
|
+
$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=a.getAttribute("value");return b.value=$APP.n(c)?c:""}return null}},rx=function(a){return function(){var b=$APP.l(a,"__xCurrencyFieldRefs");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,"__xCurrencyFieldInternals");$APP.n(e)&&(e.setFormValue(c),jx(a,e,b,c));return px(a,"x-currency-field-input",{name:d,value:c})}return null}},sx=function(a){return function(){var b=
|
|
14
|
+
$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=b.value,d=parseFloat(c);c=$APP.n(isNaN(d))?c:""+$APP.S.g(d);d=a.getAttribute("name");d=$APP.n(d)?d:"";a.setAttribute("value",c);var e=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(e)&&(e.setFormValue(c),jx(a,e,b,c));return px(a,"x-currency-field-change",{name:d,value:c})}return null}},tx=function(a){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=qx(a),d=rx(a),e=sx(a);b.addEventListener("focus",
|
|
15
|
+
c);b.addEventListener("input",d);b.addEventListener("change",e);a.__xCurrencyFieldHandlers={focus:c,input:d,change:e}}},ux=function(a){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){var c=$APP.l(a,"__xCurrencyFieldHandlers");if($APP.n(c)){b=$APP.l(b,"input");b.removeEventListener("focus",$APP.l(c,"focus"));b.removeEventListener("input",$APP.l(c,"input"));b.removeEventListener("change",$APP.l(c,"change"));a.__xCurrencyFieldHandlers=null;return}}return null},vx=function(a){$APP.n($APP.l(a,"__xCurrencyFieldRefs"))||
|
|
16
|
+
(ix(a),$APP.n(a.attachInternals)&&$APP.ma(a,"__xCurrencyFieldInternals",a.attachInternals()));ux(a);var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=a.getAttribute("value");ex(a.getAttribute("currency"));var d=function(){var e=a.getAttribute("locale");return $APP.n(e)?e:""}();$APP.n(c)&&(b.value=hx(c,d))}b=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(b)&&b.setFormValue(function(){var e=a.getAttribute("value");return $APP.n(e)?e:""}());tx(a);return ox(a)},wx=function(a,
|
|
17
|
+
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}})},xx=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return fx(this,c,$APP.J(d))}})},yx=function(a){Object.defineProperty(a,"value",{configurable:!0,enumerable:!0,get:function(){var b=
|
|
18
|
+
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,"__xCurrencyFieldRefs");if($APP.n(c)){c=$APP.l(c,"input");ex(this.getAttribute("currency"));var d=this.getAttribute("locale");d=$APP.n(d)?d:"";return $APP.E.h(c,this.shadowRoot.activeElement)?null:c.value=$APP.E.h(b,"")?"":hx(b,d)}return null}})},Ax=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,
|
|
19
|
+
"observedAttributes",{get:function(){return zx}});yx(b);wx(b,"name","name");wx(b,"currency","currency");wx(b,"locale","locale");wx(b,"min","min");wx(b,"max","max");wx(b,"placeholder","placeholder");wx(b,"label","label");wx(b,"hint","hint");wx(b,"error","error");xx(b,"disabled","disabled");xx(b,"readOnly","readonly");xx(b,"required","required");b.connectedCallback=function(){return vx(this)};b.disconnectedCallback=function(){return ux(this)};b.attributeChangedCallback=function(c,d,e){$APP.E.h(c,"value")&&
|
|
20
|
+
(c=$APP.l(this,"__xCurrencyFieldRefs"),$APP.n(c)&&(c=$APP.l(c,"input"),$APP.E.h(c,this.shadowRoot.activeElement)||(ex(this.getAttribute("currency")),d=this.getAttribute("locale"),d=$APP.n(d)?d:"",c.value=e==null||$APP.E.h(e,"")?"":hx(e,d))));return ox(this)};b.formDisabledCallback=function(c){fx(this,"disabled",$APP.J(c));return ox(this)};b.formResetCallback=function(){this.removeAttribute("value");var c=$APP.l(this,"__xCurrencyFieldRefs");$APP.n(c)&&($APP.l(c,"input").value="");c=$APP.l(this,"__xCurrencyFieldInternals");
|
|
21
|
+
$APP.n(c)&&c.setFormValue("");return ox(this)};b.checkValidity=function(){var c=$APP.l(this,"__xCurrencyFieldInternals");return $APP.n(c)?c.checkValidity():!0};b.reportValidity=function(){var c=$APP.l(this,"__xCurrencyFieldInternals");return $APP.n(c)?c.reportValidity():!0};return a},Bx=function(){return $APP.n(customElements.get("x-currency-field"))?null:customElements.define("x-currency-field",Ax())},lx=new $APP.K(null,"min-raw","min-raw",183137548),kx=new $APP.K(null,"currency-raw","currency-raw",
|
|
22
|
+
1169887491),nx=new $APP.K(null,"currency","currency",-898327568),mx=new $APP.K(null,"locale-raw","locale-raw",385401846);var zx="name value currency locale min max placeholder label hint error disabled required readonly".split(" ");$APP.ka("baredom.exports.x_currency_field.init",Bx);export const init=Bx;
|
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.
|
|
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)
|
|
12
|
-
var m=
|
|
13
|
-
"false");$APP.n(
|
|
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(
|
|
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
|
-
$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(
|
|
17
|
-
b){var c=$APP.l(a,"__xDatePickerState");c=$APP.n(c)?$APP.l(c,"canon"):null;var d=$APP.n(c)?$APP.fi.g(c):null,e={iso:
|
|
18
|
-
|
|
19
|
-
a.__xDatePickerRangeStep=1}else a.setAttribute("start",
|
|
20
|
-
"x-date-picker-change-request",!0,{iso:
|
|
21
|
-
null],null)):(d=c.substring(e+d.length).trim(),c=
|
|
22
|
-
"end-iso":
|
|
23
|
-
$APP.n(
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
btn:h,"doc-click":b})},
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
r.setAttribute("data-nav","prev");r.setAttribute("type","button");r.setAttribute("aria-label","Previous month");r.textContent="‹";
|
|
33
|
-
"Calendar grid");C.setAttribute("part","sr-status");C.setAttribute("aria-live","polite");C.setAttribute("aria-atomic","true");q.appendChild(r);q.appendChild(
|
|
34
|
-
function(){return
|
|
35
|
-
447310304),
|
|
36
|
-
"start-str",1077409677),
|
|
37
|
-
-1316370898),
|
|
2
|
+
var QB=function(a){return typeof a==="string"?(a=a.trim(),$APP.N(a,"")?a:null):null},RB=function(a){return a!=null&&$APP.N(a,"false")},SB=function(a){return a<10?"0"+$APP.S.g(a):""+$APP.S.g(a)},TB=function(a){return $APP.n(a)?""+$APP.S.g(a.getUTCFullYear())+"-"+$APP.S.g(SB(a.getUTCMonth()+1))+"-"+$APP.S.g(SB(a.getUTCDate())):null},UB=function(a){var b=(b=typeof a==="string")?$APP.Df(/\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},VB=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},WB=function(a){return $APP.n(a)?new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)):null},XB=function(a,b,c){if($APP.n($APP.n(a)?$APP.n(b)?c:b:a)){var d=VB(b,c)<0?c:b;return!(VB(a,VB(b,c)<0?b:c)<0)&&!(VB(a,d)>0)}return null},$B=function(a,b){var c=$APP.M(b);b=$APP.I(c,YB);c=$APP.I(c,$APP.dj);return $APP.n(a)?$APP.E.h(b,ZB)?(new Intl.DateTimeFormat($APP.n(c)?
|
|
4
|
+
c:"default",{year:"numeric",month:"long",day:"numeric",timeZone:"UTC"})).format(a):TB(a):null},cC=function(a){a=QB(a);a=$APP.n(a)?UB(a):null;return new $APP.P(null,2,[aC,a!=null,bC,a],null)},sC=function(a){var b=$APP.M(a),c=$APP.I(b,$APP.uh),d=$APP.I(b,$APP.ph),e=$APP.I(b,$APP.Vi);a=$APP.I(b,YB);var g=$APP.I(b,$APP.dj),h=$APP.I(b,dC),k=$APP.I(b,$APP.T),m=$APP.I(b,$APP.fi),q=$APP.I(b,$APP.zi),r=$APP.I(b,$APP.fh),v=$APP.I(b,eC);b=$APP.E.h(m,"range")?fC:gC;a=$APP.E.h(a,"localized")?ZB:hC;g=QB(g);m=function(){var A=
|
|
5
|
+
QB(d);return $APP.n(A)?A:" - "}();e=UB(e);r=UB(r);v=$APP.J(v);h=$APP.J(h);if($APP.E.h(b,gC))return b=UB(k),$APP.bf([YB,iC,$APP.dj,jC,$APP.fi,kC,eC,lC,$APP.ph,mC,nC],[a,b,g,h,gC,r,v,b!=null,m,e,function(){var A=QB(k);return $APP.n(A)?A:""}()]);var w=UB(q),z=UB(c);b=w!=null&&z!=null;return $APP.bf([oC,YB,pC,$APP.dj,jC,$APP.fi,kC,qC,rC,eC,lC,$APP.ph,mC],[function(){var A=QB(c);return $APP.n(A)?A:""}(),a,w,g,h,fC,r,function(){var A=QB(q);return $APP.n(A)?A:""}(),z,v,b,m,e])},uC=function(a){if($APP.n(a)){var b=
|
|
6
|
+
WB(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,[bC,d,tC,e],null)},$APP.Bf(0,42))}return null},vC=function(a){return document.createElement(a)},wC=function(a,b,c,d){b=new CustomEvent(b,{detail:d,bubbles:!0,composed:!0,cancelable:$APP.J(c)});a.dispatchEvent(b);return b},xC=function(a){var b=a.getAttribute("mode");$APP.E.h(b,
|
|
7
|
+
"range");b=sC($APP.bf([$APP.Vi,YB,$APP.dj,dC,$APP.T,$APP.fi,$APP.zi,$APP.fh,eC,$APP.uh,$APP.ph],[a.getAttribute("min"),a.getAttribute("format"),a.getAttribute("locale"),RB(a.getAttribute("range-allow-same-day")),a.getAttribute("value"),b,a.getAttribute("start"),a.getAttribute("max"),RB(a.getAttribute("auto-swap")),a.getAttribute("end"),a.getAttribute("separator")]));var c=new $APP.P(null,2,[YB,YB.g(b),$APP.dj,$APP.dj.g(b)],null);var d=$APP.M(c);var e=$APP.I(d,YB);d=$APP.I(d,$APP.dj);e=new $APP.P(null,
|
|
8
|
+
2,[YB,e,$APP.dj,d],null);if($APP.E.h($APP.fi.g(b),gC))e=$APP.n(iC.g(b))?$B(iC.g(b),e):"";else{d=$APP.ph.g(b);var g=pC.g(b);g=$APP.n(g)?rC.g(b):g;e=$APP.n(g)?""+$APP.S.g($B(pC.g(b),e))+$APP.S.g(d)+$APP.S.g($B(rC.g(b),e)):$APP.n(pC.g(b))?$B(pC.g(b),e):""}d=$APP.l(a,"__xDatePickerState");d=$APP.n(d)?$APP.l(d,"month"):null;g=iC.g(b);$APP.n(g)||(g=pC.g(b),g=$APP.n(g)?g:new Date(Date.now()));d=$APP.n(d)?d:WB(g);a.__xDatePickerState={canon:b,cfg:c,disp:e,month:d}},yC=function(a,b){var c=mC.g(b);c=$APP.n(c)?
|
|
9
|
+
VB(a,mC.g(b))<0:c;if($APP.n(c))return c;c=kC.g(b);return $APP.n(c)?VB(a,kC.g(b))>0:c},BC=function(a,b){if($APP.E.h($APP.fi.g(b),gC))return new $APP.P(null,3,[$APP.Jh,function(){var k=iC.g(b);return $APP.n(k)?$APP.E.h(0,VB(a,iC.g(b))):k}(),zC,!1,AC,!1],null);var c=pC.g(b),d=rC.g(b),e=function(){var k=$APP.n(c)?$APP.E.h(0,VB(a,c)):c;return $APP.n(k)?k:$APP.n(d)?$APP.E.h(0,VB(a,d)):d}(),g=$APP.n(c)?$APP.n(d)?XB(a,c,d):d:c,h=function(){var k=$APP.n(c)?$APP.E.h(0,VB(a,c)):c;return $APP.n(k)?k:$APP.n(d)?
|
|
10
|
+
$APP.E.h(0,VB(a,d)):d}();return new $APP.P(null,3,[$APP.Jh,e,zC,g,AC,h],null)},CC=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.dj.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=vC("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=uC($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,bC);a=$APP.I(a,tC);
|
|
12
|
+
var m=vC("button"),q=TB(k),r=k.getUTCDate(),v=yC(k,b);k=BC(k,b);var w=$APP.M(k);k=$APP.I(w,$APP.Jh);var z=$APP.I(w,zC);w=$APP.I(w,AC);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,bC),a=$APP.I(a,tC),c=vC("button"),h=TB(k),g=k.getUTCDate(),m=yC(k,b),k=BC(k,b),r=$APP.M(k),k=$APP.I(r,$APP.Jh),q=$APP.I(r,zC),r=$APP.I(r,AC),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},DC=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},EC=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));DC(a);return CC(a)}return null},FC=function(a,
|
|
17
|
+
b){$APP.n(b)?a.setAttribute("value",TB(b)):a.removeAttribute("value")},GC=function(a,b){var c=$APP.l(a,"__xDatePickerState");c=$APP.n(c)?$APP.l(c,"canon"):null;var d=$APP.n(c)?$APP.fi.g(c):null,e={iso:TB(b),reason:"click"},g=wC(a,"x-date-picker-change-request",!0,e);if($APP.n(g.defaultPrevented))return null;if($APP.E.h(d,gC))return FC(a,b),xC(a),EC(a),wC(a,"x-date-picker-change",!1,e),$APP.n(a.hasAttribute("close-on-select"))?(a.removeAttribute("open"),EC(a)):null;d=function(){var r=$APP.l(a,"__xDatePickerRangeStep");
|
|
18
|
+
return $APP.n(r)?r:0}();g=pC.g(c);rC.g(c);if($APP.E.h(d,0))a.setAttribute("start",TB(b)),a.removeAttribute("end"),a.__xDatePickerRangeStep=1;else if($APP.E.h(d,1)){var h=jC.g(c),k=VB(b,g);if($APP.n(function(){var r=k>0;return r?r:$APP.n(h)?k===0:h}())){var m=$APP.n(eC.g(c))?VB(g,b)<0?g:b:g,q=$APP.n(eC.g(c))?VB(g,b)>0?g:b:b;a.setAttribute("start",TB(m));a.setAttribute("end",TB(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",TB(b)),a.removeAttribute("end"),a.__xDatePickerRangeStep=1}else a.setAttribute("start",TB(b)),a.removeAttribute("end"),a.__xDatePickerRangeStep=1;xC(a);EC(a);return wC(a,"x-date-picker-change",!1,e)},HC=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.fi.g(d);wC(a,"x-date-picker-input",!1,{value:c});
|
|
20
|
+
if($APP.E.h(e,gC)){if(c=cC(c),d=$APP.M(c),c=$APP.I(d,aC),d=$APP.I(d,bC),$APP.n(c)){c=wC(a,"x-date-picker-change-request",!0,{iso:TB(d),reason:b});if($APP.n(c.defaultPrevented))return null;FC(a,d);xC(a);EC(a);return wC(a,"x-date-picker-change",!1,{iso:TB(d),reason:b})}}else if(d=new $APP.P(null,1,[$APP.ph,$APP.ph.g(d)],null),d=$APP.M(d),d=$APP.I(d,$APP.ph),d=typeof d==="string"&&d.length>0?d:" - ",c=QB(c),c==null?c=new $APP.P(null,3,[aC,!1,$APP.zi,null,$APP.uh,null],null):(e=c.indexOf(d),e<0?(c=cC(c),
|
|
21
|
+
d=$APP.M(c),c=$APP.I(d,aC),d=$APP.I(d,bC),c=new $APP.P(null,3,[aC,c,$APP.zi,d,$APP.uh,null],null)):(d=c.substring(e+d.length).trim(),c=UB(c.substring(0,e).trim()),d=UB(d),c=new $APP.P(null,3,[aC,c!=null&&d!=null,$APP.zi,c,$APP.uh,d],null))),e=$APP.M(c),c=$APP.I(e,aC),d=$APP.I(e,$APP.zi),e=$APP.I(e,$APP.uh),$APP.n(c)){c=wC(a,"x-date-picker-change-request",!0,{"start-iso":TB(d),"end-iso":TB(e),reason:b});if($APP.n(c.defaultPrevented))return null;a.setAttribute("start",TB(d));a.setAttribute("end",TB(e));
|
|
22
|
+
a.__xDatePickerRangeStep=0;xC(a);EC(a);return wC(a,"x-date-picker-change",!1,{"start-iso":TB(d),"end-iso":TB(e),reason:b})}return null},JC=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,IC)?new Date(Date.UTC(e,d+1,1)):new Date(Date.UTC(e,d-1,1));c.month=b;return CC(a)}return null},KC=function(a){return $APP.n(a.hasAttribute("open"))?a.removeAttribute("open"):null},MC=function(a,b){if($APP.n(a.hasAttribute("disabled")))return null;
|
|
23
|
+
b=b.currentTarget.getAttribute("data-nav");return $APP.E.h(b,"prev")?JC(a,LC):JC(a,IC)},NC=function(a){function b(D){return $APP.n(a.hasAttribute("open"))?$APP.n(D.composedPath().some(function(Q){return Q===a}))?null:KC(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=UB(D),D=$APP.n(D)?GC(a,D):null):D=null);return D}function e(D){return MC(a,
|
|
24
|
+
D)}function g(D){return MC(a,D)}function h(){if($APP.n(a.hasAttribute("disabled")))var D=null;else $APP.n(a.hasAttribute("open"))?D=KC(a):$APP.n(a.hasAttribute("open"))?D=null:(a.setAttribute("open",""),D=CC(a));return D}function k(){a.__xDatePickerFocused=!1;$APP.n(a.hasAttribute("disabled"))||HC(a,"blur");return DC(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=HC(a,"keyboard")):D=$APP.E.h(Q,
|
|
25
|
+
"Escape")?KC(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 wC(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})},OC=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
|
+
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},PC=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)}})},QC=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)}})},RC=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 HC(this,"programmatic")};a.clear=function(){var b=$APP.l(this,"__xDatePickerState");$APP.E.h($APP.fi.g($APP.n(b)?$APP.l(b,"canon"):null),gC)?this.removeAttribute("value"):(this.removeAttribute("start"),this.removeAttribute("end"));xC(this);return EC(this)}},TC=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=SC;c.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xDatePickerRefs"))){var d=this.attachShadow({mode:"open"}),e=vC("style"),g=vC("div"),h=vC("input"),k=vC("button"),m=vC("div"),q=vC("div"),r=vC("button"),v=vC("div"),w=vC("button"),z=vC("div"),A=vC("div"),C=vC("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
|
+
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
|
+
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}}OC(this);NC(this);xC(this);return EC(this)};c.disconnectedCallback=
|
|
34
|
+
function(){return OC(this)};c.attributeChangedCallback=function(){xC(this);return EC(this)};PC(c,"mode","mode");PC(c,"value","value");PC(c,"start","start");PC(c,"end","end");QC(c,"open","open");QC(c,"disabled","disabled");QC(c,"readOnly","readonly");QC(c,"required","required");RC(c);a.prototype=c;return a},UC=function(){return $APP.n(customElements.get("x-date-picker"))?null:customElements.define("x-date-picker",TC())},pC=new $APP.K(null,"start-d","start-d",-1546785820),aC=new $APP.K(null,"ok?","ok?",
|
|
35
|
+
447310304),bC=new $APP.K(null,"date","date",-1463434462),eC=new $APP.K(null,"auto-swap?","auto-swap?",-1675454411),oC=new $APP.K(null,"end-str","end-str",-558112319),ZB=new $APP.K(null,"localized","localized",1722109655),AC=new $APP.K(null,"edge?","edge?",203916303),nC=new $APP.K(null,"value-str","value-str",989198845),lC=new $APP.K(null,"complete?","complete?",-892991879),kC=new $APP.K(null,"max-d","max-d",-814680979),gC=new $APP.K(null,"single","single",1551466437),qC=new $APP.K(null,"start-str",
|
|
36
|
+
"start-str",1077409677),fC=new $APP.K(null,"range","range",1639692286),hC=new $APP.K(null,"iso","iso",-1366207543),tC=new $APP.K(null,"in-month?","in-month?",-1630426251),mC=new $APP.K(null,"min-d","min-d",-1118792932),YB=new $APP.K(null,"format","format",-1306924766),iC=new $APP.K(null,"value-d","value-d",-1768534876),zC=new $APP.K(null,"in-range?","in-range?",-291779262),LC=new $APP.K(null,"prev","prev",-1597069226),IC=new $APP.K(null,"next","next",-117701485),rC=new $APP.K(null,"end-d","end-d",
|
|
37
|
+
-1316370898),jC=new $APP.K(null,"allow-same-day?","allow-same-day?",-1971558934),dC=new $APP.K(null,"range-allow-same-day?","range-allow-same-day?",-714516856);var SC="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",UC);export const init=UC;
|
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.Ei);var d=$APP.I(c,
|
|
4
|
-
$APP.Ah);b=$APP.I(c,$APP.W);var
|
|
5
|
-
2,["none",null,"presentation",null],null),null),
|
|
6
|
-
m=document.createElement("span"),q=document.createElement("div"),
|
|
7
|
-
$APP.
|
|
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
|
|
11
|
-
|
|
2
|
+
var hB=function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.Cc(a,c)?c:b},iB=function(a){for(;;){var b=a.firstChild;if($APP.n(b))a.removeChild(b);else break}},uB=function(a){var b=$APP.bf([$APP.Eh,$APP.dh,$APP.Dh,jB,kB,lB,mB,$APP.li,$APP.Ei,nB],[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.Ei);var d=$APP.I(c,nB),e=$APP.I(c,$APP.dh);var g=$APP.I(c,$APP.Eh);var h=$APP.I(c,$APP.Dh),k=$APP.I(c,jB),m=$APP.I(c,kB),q=$APP.I(c,lB),r=$APP.I(c,mB);c=$APP.I(c,$APP.li);g=$APP.bf([$APP.Yg,$APP.ei,oB,pB,$APP.xi,$APP.Wg,$APP.Ah,$APP.W,qB,$APP.bi],[d,hB(rB,"center",h),m,r,q,hB(sB,"solid",g),hB(tB,"horizontal",c),e,k,b]);c=$APP.M(g);d=$APP.I(c,$APP.bi);h=$APP.I(c,$APP.ei);k=$APP.I(c,oB);m=$APP.I(c,pB);q=$APP.I(c,$APP.xi);r=$APP.I(c,$APP.Wg);e=$APP.I(c,
|
|
4
|
+
$APP.Ah);b=$APP.I(c,$APP.W);var v=$APP.I(c,qB);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.Yg.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"),iB(e),g=document.createElement("div"),h=document.createElement("span"),k=document.createElement("slot"),
|
|
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"),iB(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},vB=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})},wB=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})},xB=function(a){wB(a,"orientation","horizontal");wB(a,"variant","solid");wB(a,"align","center");vB(a,"label");vB(a,"thickness");vB(a,"color");vB(a,"inset");vB(a,"length")},yB=function(){function a(){return Reflect.construct(HTMLElement,[],$APP.Ra(b))}var b=new $APP.Dd;$APP.Ed(b,a);return a},AB=function(){if($APP.n(customElements.get("x-divider")))return null;
|
|
9
|
+
var a=Object.create(HTMLElement.prototype),b=yB();Object.setPrototypeOf(b,HTMLElement);a.constructor=b;xB(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 uB(this)};a.disconnectedCallback=function(){return null};a.attributeChangedCallback=function(c,d,e){return $APP.N(d,e)?$APP.n($APP.l(this,"__xDividerRefs"))?uB(this):null:null};b.observedAttributes=zB;b.prototype=a;return customElements.define("x-divider",b)},BB=function(){return AB()},
|
|
11
|
+
jB=new $APP.K(null,"length-raw","length-raw",-1832244116),mB=new $APP.K(null,"inset-raw","inset-raw",89351124),pB=new $APP.K(null,"inset","inset",-396367740),oB=new $APP.K(null,"thickness","thickness",-940175454),kB=new $APP.K(null,"thickness-raw","thickness-raw",1843812655),nB=new $APP.K(null,"role-raw","role-raw",777951354),qB=new $APP.K(null,"length","length",588987862),lB=new $APP.K(null,"color-raw","color-raw",1277647215);var zB="orientation variant thickness color inset length label align role aria-label".split(" "),tB=new $APP.R(null,new $APP.P(null,2,["vertical",null,"horizontal",null],null),null),sB=new $APP.R(null,new $APP.P(null,3,["dashed",null,"dotted",null,"solid",null],null),null),rB=new $APP.R(null,new $APP.P(null,3,["center",null,"start",null,"end",null],null),null);$APP.ka("baredom.exports.x_divider.init",BB);export const init=BB;
|