@vanelsas/baredom 0.1.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 +30 -0
- package/LICENSE +21 -0
- package/README.md +444 -0
- package/dist/base.js +352 -0
- package/dist/x-alert.js +20 -0
- package/dist/x-avatar-group.js +12 -0
- package/dist/x-avatar.js +18 -0
- package/dist/x-badge.js +12 -0
- package/dist/x-breadcrumbs.js +15 -0
- package/dist/x-button.js +17 -0
- package/dist/x-cancel-dialogue.js +20 -0
- package/dist/x-card.js +8 -0
- package/dist/x-chart.js +45 -0
- package/dist/x-checkbox.js +12 -0
- package/dist/x-chip.js +10 -0
- package/dist/x-collapse.js +13 -0
- package/dist/x-command-palette.js +33 -0
- package/dist/x-container.js +7 -0
- package/dist/x-context-menu.js +20 -0
- package/dist/x-copy.js +26 -0
- package/dist/x-currency-field.js +22 -0
- package/dist/x-date-picker.js +37 -0
- package/dist/x-divider.js +11 -0
- package/dist/x-drawer.js +13 -0
- package/dist/x-dropdown.js +12 -0
- package/dist/x-fieldset.js +7 -0
- package/dist/x-file-download.js +9 -0
- package/dist/x-form-field.js +16 -0
- package/dist/x-form.js +11 -0
- package/dist/x-grid.js +8 -0
- package/dist/x-menu-item.js +11 -0
- package/dist/x-menu.js +13 -0
- package/dist/x-modal.js +14 -0
- package/dist/x-navbar.js +13 -0
- package/dist/x-notification-center.js +10 -0
- package/dist/x-pagination.js +17 -0
- package/dist/x-popover.js +13 -0
- package/dist/x-progress-circle.js +12 -0
- package/dist/x-progress.js +11 -0
- package/dist/x-radio.js +13 -0
- package/dist/x-search-field.js +17 -0
- package/dist/x-select.js +12 -0
- package/dist/x-sidebar.js +27 -0
- package/dist/x-skeleton.js +8 -0
- package/dist/x-slider.js +17 -0
- package/dist/x-spacer.js +6 -0
- package/dist/x-spinner.js +7 -0
- package/dist/x-stat.js +10 -0
- package/dist/x-stepper.js +17 -0
- package/dist/x-switch.js +12 -0
- package/dist/x-tab.js +9 -0
- package/dist/x-table-cell.js +26 -0
- package/dist/x-table-row.js +11 -0
- package/dist/x-table.js +16 -0
- package/dist/x-tabs.js +12 -0
- package/dist/x-text-area.js +20 -0
- package/dist/x-timeline-item.js +25 -0
- package/dist/x-timeline.js +10 -0
- package/dist/x-toast.js +26 -0
- package/dist/x-toaster.js +9 -0
- package/package.json +275 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var Go=function(a){if(a!=null&&a.sa!=null)a=a.sa(a);else{var b=Go[$APP.da(a==null?null:a)];if(b!=null)a=b.g?b.g(a):b.call(null,a);else if(b=Go._,b!=null)a=b.g?b.g(a):b.call(null,a);else throw $APP.sa("IStack.-pop",a);}return a},Ho=function(a,b){return $APP.jd($APP.Fc(function(c,d){return $APP.n(a.g?a.g(d):a.call(null,d))?$APP.ib(c,d):c},$APP.hb($APP.Ld),b))},Io=function(a){var b=/\s+/;a="/(?:)/"===""+$APP.S.g(b)?$APP.ef.h($APP.be($APP.Xc("",$APP.Id.h($APP.S,$APP.v(a)))),""):$APP.be((""+$APP.S.g(a)).split(b));
|
|
3
|
+
if(1<$APP.B(a))a:{for(;;)if(""===(a==null?null:$APP.Pa(a)))a=a==null?null:Go(a);else break a;a=void 0}return a},Jo=function(a){return a==null?!0:$APP.N(a,"false")},Ko=function(a){return typeof a==="string"?(a=a.trim(),$APP.N(a,"")?a:null):null},No=function(a){if(a==null||$APP.p($APP.pa(a)))return $APP.Ld;for(var b=a.length,c=0,d=$APP.hb($APP.Ld);;){if($APP.D.h(c,b))return $APP.jb(d);var e=a[c],f=""+$APP.S.g(function(){var A=e.id;return $APP.n(A)?A:c}()),h=""+$APP.S.g(function(){var A=e.label;return $APP.n(A)?
|
|
4
|
+
A:""}()),k=Ko(e.group),m=e.value,q=e.icon,r=$APP.D.h(!0,e.disabled),u=e.keywords;u=$APP.n($APP.pa(u))?u.join(" "):typeof u==="string"?u:"";var w=function(){var A=k;return $APP.n(A)?A:""}(),z=typeof m==="string"?m:"";w=(""+$APP.S.g(h)+" "+$APP.S.g(u)+" "+$APP.S.g(w)+" "+$APP.S.g(z)).toLowerCase();u=c+1;d=$APP.kd(d,new $APP.P(null,7,[$APP.Ih,f,$APP.W,h,Lo,k,$APP.T,m,$APP.$g,q,$APP.U,r,Mo,w],null));c=u}},Po=function(a,b){b=typeof b==="string"?b.trim():"";var c=$APP.N(b,"")?$APP.Cd(Ko,Io(b)):null;if($APP.rc(c))return new $APP.P(null,
|
|
5
|
+
2,[$APP.Wh,a,Oo,$APP.Ae.h($APP.rf,$APP.Cd(Lo,a))],null);a=Ho(function(d){return $APP.zd(function(e){return $APP.N(-1,Mo.g(d).indexOf(e.toLowerCase()))},c)},a);return new $APP.P(null,2,[$APP.Wh,a,Oo,$APP.Ae.h($APP.rf,$APP.Cd(Lo,a))],null)},Qo=function(a,b,c){var d=$APP.B(a);if(d>0)for(var e=1;;)if(e<=d){var f=$APP.Qc(b+e*c,d),h=$APP.H(a,f,null),k=h;h=$APP.n(k)?$APP.p($APP.U.g(h)):k;if($APP.n(h))return f;e+=1}else return null;else return null},cp=function(a){var b=$APP.M(a);a=$APP.I(b,$APP.rh);var c=
|
|
6
|
+
$APP.I(b,$APP.wh),d=$APP.I(b,$APP.dh),e=$APP.I(b,Ro),f=$APP.I(b,$APP.Jg),h=$APP.I(b,So),k=$APP.I(b,To),m=$APP.I(b,Uo),q=$APP.I(b,Vo),r=$APP.I(b,Wo);b=$APP.I(b,Xo);b=Jo(b);r=Jo(r);q=q!=null&&$APP.N(q,"false");q=b&&!q;h=h!=null?h!=null&&$APP.N(h,"false"):q;m=Jo(m);return $APP.bf([$APP.Th,$APP.Di,$APP.vh,Yo,Zo,$o,ap,$APP.W,$APP.Pi,bp,$APP.U],[Ko(f),function(){var u=Ko(c);return $APP.n(u)?u:"Search…"}(),r,function(){var u=Ko(e);return $APP.n(u)?u:"No results"}(),h,m,q,Ko(d),$APP.J(a),b,k!=null&&$APP.N(k,
|
|
7
|
+
"false")])},dp=function(a){return document.createElement(a)},ep=function(a){return cp($APP.bf([$APP.dh,Ro,$APP.Jg,So,To,Uo,Vo,Wo,Xo,$APP.rh,$APP.wh],[a.getAttribute("label"),a.getAttribute("empty-text"),a.getAttribute("portal"),a.getAttribute("close-on-scrim"),a.getAttribute("disabled"),a.getAttribute("close-on-escape"),a.getAttribute("no-scrim"),a.getAttribute("dismissible"),a.getAttribute("modal"),a.hasAttribute("open"),a.getAttribute("placeholder")]))},fp=function(a,b,c,d){b=new CustomEvent(b,
|
|
8
|
+
{detail:d,bubbles:!0,composed:!0,cancelable:$APP.J(c)});a.dispatchEvent(b);return b},gp=function(a){var b=$APP.l(a,"__xCommandPaletteRefs");if($APP.n(b)){var c=$APP.l(b,"list"),d=$APP.l(b,"empty");b=function(){var r=$APP.l(a,"__xCommandPaletteQuery");return $APP.n(r)?r:""}();var e=No($APP.l(a,"__xCommandPaletteItems"));b=Po(e,b);b=$APP.M(b);e=$APP.I(b,$APP.Wh);b=function(){var r=$APP.l(a,"__xCommandPaletteActiveIdx");return $APP.n(r)?r:0}();c.textContent="";if($APP.rc(e))return d.removeAttribute("hidden");
|
|
9
|
+
d.setAttribute("hidden","");e=$APP.v($APP.Bd($APP.og,e));for(var f=null,h=0,k=0;;)if(k<h){var m=f.F(null,k);d=$APP.H(m,0,null);m=$APP.H(m,1,null);var q=dp("div");q.setAttribute("part","item");q.setAttribute("role","option");q.setAttribute("data-id",""+$APP.S.g($APP.Ih.g(m)));q.setAttribute("data-idx",""+$APP.S.g(d));q.setAttribute("tabindex","-1");$APP.n($APP.U.g(m))&&q.setAttribute("aria-disabled","true");q.textContent=$APP.W.g(m);$APP.D.h(d,b)&&q.setAttribute("aria-selected","true");c.appendChild(q);
|
|
10
|
+
k+=1}else if(d=$APP.v(e))e=d,$APP.yc(e)?(f=$APP.ob(e),e=$APP.pb(e),d=f,m=$APP.B(f),f=d,h=m):(f=$APP.x(e),d=$APP.H(f,0,null),m=$APP.H(f,1,null),f=dp("div"),f.setAttribute("part","item"),f.setAttribute("role","option"),f.setAttribute("data-id",""+$APP.S.g($APP.Ih.g(m))),f.setAttribute("data-idx",""+$APP.S.g(d)),f.setAttribute("tabindex","-1"),$APP.n($APP.U.g(m))&&f.setAttribute("aria-disabled","true"),f.textContent=$APP.W.g(m),$APP.D.h(d,b)&&f.setAttribute("aria-selected","true"),c.appendChild(f),e=
|
|
11
|
+
$APP.y(e),f=null,h=0),k=0;else return null}else return null},hp=function(a){var b=$APP.l(a,"__xCommandPaletteRefs");if($APP.n(b)){var c=ep(a),d=$APP.l(b,"panel"),e=$APP.l(b,"input"),f=$APP.l(b,"overlay");b=$APP.l(b,"empty");var h=$APP.W.g(c),k=$APP.Di.g(c),m=Yo.g(c);$APP.n(h)?d.setAttribute("aria-label",h):d.setAttribute("aria-label","Command palette");$APP.n(ap.g(c))?f.removeAttribute("hidden"):f.setAttribute("hidden","");e.setAttribute("placeholder",k);e.setAttribute("aria-expanded",$APP.n($APP.Pi.g(c))?
|
|
12
|
+
"true":"false");$APP.n($APP.U.g(c))&&(e.setAttribute("disabled",""),e.setAttribute("aria-disabled","true"));$APP.n($APP.U.g(c))||(e.removeAttribute("disabled"),e.removeAttribute("aria-disabled"));b.textContent=m;return gp(a)}return null},ip=function(a){if($APP.n(a.hasAttribute("open")))return null;var b=fp(a,"x-command-palette-open-request",!0,{});$APP.n(b.defaultPrevented)?a=null:(a.setAttribute("open",""),b=$APP.l(a,"__xCommandPaletteRefs"),b=$APP.n(b)?$APP.l(b,"input"):null,$APP.n(b)&&b.focus(),
|
|
13
|
+
hp(a),a=fp(a,"x-command-palette-open",!1,{}));return a},jp=function(a){if($APP.n(a.hasAttribute("open"))){var b=fp(a,"x-command-palette-close-request",!0,{});$APP.n(b.defaultPrevented)?a=null:(a.removeAttribute("open"),hp(a),a=fp(a,"x-command-palette-close",!1,{}));return a}return null},kp=function(a){var b=$APP.l(a,"__xCommandPaletteQuery");b=$APP.n(b)?b:"";a=No($APP.l(a,"__xCommandPaletteItems"));a=Po(a,b);a=$APP.M(a);return $APP.I(a,$APP.Wh)},mp=function(a,b){var c=kp(a);var d=$APP.l(a,"__xCommandPaletteActiveIdx");
|
|
14
|
+
d=$APP.n(d)?d:0;$APP.D.h(b,lp)?(c=Qo(c,$APP.n(d)?d:-1,1),c=$APP.n(c)?c:0):(b=$APP.B(c),c=Qo(c,$APP.n(d)?d:b,-1),c=$APP.n(c)?c:0);a.__xCommandPaletteActiveIdx=c;gp(a);a=$APP.l(a,"__xCommandPaletteRefs");a=$APP.n(a)?$APP.l(a,"list"):null;a=$APP.n(a)?a.querySelector("[data-idx\x3d'"+$APP.S.g(c)+"']"):null;return $APP.n(a)?a.scrollIntoView({block:"nearest"}):null},op=function(a,b){var c=b.key;return $APP.D.h(c,"ArrowDown")?(b.preventDefault(),mp(a,lp)):$APP.D.h(c,"ArrowUp")?(b.preventDefault(),mp(a,np)):
|
|
15
|
+
$APP.D.h(c,"Enter")?(b.preventDefault(),b=kp(a),c=$APP.l(a,"__xCommandPaletteActiveIdx"),b=$APP.H(b,$APP.n(c)?c:0,null),$APP.n($APP.n(b)?$APP.p($APP.U.g(b)):b)?(c=fp(a,"x-command-palette-select-request",!0,{item:$APP.xg(b)}),$APP.n(c.defaultPrevented)?a=null:(fp(a,"x-command-palette-select",!1,{item:$APP.xg(b)}),a=jp(a))):a=null,a):$APP.D.h(c,"Escape")?(b=ep(a),$APP.n($o.g(b))?jp(a):null):null},pp=function(a){function b(){var r=$APP.l(a,"__xCommandPaletteRefs"),u=$APP.n(r)?$APP.l(r,"input"):null;
|
|
16
|
+
r=$APP.n(r)?$APP.l(r,"clear-btn"):null;$APP.n(u)&&(u.value="");$APP.n(r)&&r.setAttribute("hidden","");a.__xCommandPaletteQuery="";a.__xCommandPaletteActiveIdx=0;fp(a,"x-command-palette-query-change",!1,{query:""});gp(a);return $APP.n(u)?u.focus():null}function c(r){a:{r=r.target.closest("[part\x3ditem]");if($APP.n(r)){r=parseInt(r.getAttribute("data-idx"),10);var u=kp(a);r=$APP.H(u,r,null);if($APP.n($APP.n(r)?$APP.p($APP.U.g(r)):r)){u=fp(a,"x-command-palette-select-request",!0,{item:$APP.xg(r)});
|
|
17
|
+
if($APP.n(u.defaultPrevented)){r=null;break a}fp(a,"x-command-palette-select",!1,{item:$APP.xg(r)});r=jp(a);break a}}r=null}return r}function d(){var r=ep(a);return $APP.n(Zo.g(r))?jp(a):null}function e(r){return op(a,r)}function f(){var r=$APP.l(a,"__xCommandPaletteRefs"),u=$APP.n(r)?$APP.l(r,"input"):null;r=$APP.n(r)?$APP.l(r,"clear-btn"):null;u=$APP.n(u)?u.value:null;a.__xCommandPaletteQuery=$APP.n(u)?u:"";a.__xCommandPaletteActiveIdx=0;$APP.n(r)&&($APP.n($APP.n(u)?$APP.N(u,""):u)?r.removeAttribute("hidden"):
|
|
18
|
+
r.setAttribute("hidden",""));fp(a,"x-command-palette-query-change",!1,{query:$APP.n(u)?u:""});return gp(a)}var h=$APP.l(a,"__xCommandPaletteRefs"),k=$APP.l(h,"input"),m=$APP.l(h,"overlay"),q=$APP.l(h,"list");h=$APP.l(h,"clear-btn");k.addEventListener("input",f);k.addEventListener("keydown",e);m.addEventListener("click",d);q.addEventListener("click",c);h.addEventListener("click",b);$APP.ma(a,"__xCommandPaletteHandlers",{input:f,keydown:e,scrim:d,list:c,clear:b})},qp=function(a){var b=$APP.l(a,"__xCommandPaletteRefs");
|
|
19
|
+
a=$APP.l(a,"__xCommandPaletteHandlers");if($APP.n($APP.n(b)?a:b)){var c=$APP.l(b,"input"),d=$APP.l(b,"overlay"),e=$APP.l(b,"list");b=$APP.l(b,"clear-btn");c.removeEventListener("input",$APP.l(a,"input"));c.removeEventListener("keydown",$APP.l(a,"keydown"));d.removeEventListener("click",$APP.l(a,"scrim"));e.removeEventListener("click",$APP.l(a,"list"));return b.removeEventListener("click",$APP.l(a,"clear"))}return null},rp=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},
|
|
20
|
+
set:function(d){return $APP.n(d)?this.setAttribute(c,""):this.removeAttribute(c)}})},sp=function(a){Object.defineProperty(a,"items",{configurable:!0,enumerable:!0,get:function(){var b=$APP.l(this,"__xCommandPaletteItems");return $APP.n(b)?b:[]},set:function(b){this.__xCommandPaletteItems=b;this.__xCommandPaletteActiveIdx=0;return gp(this)}})},tp=function(a){Object.defineProperty(a,"open",{configurable:!0,writable:!0,value:function(){return ip(this)}});a.close=function(){return jp(this)};a.toggle=
|
|
21
|
+
function(){return $APP.n(this.hasAttribute("open"))?jp(this):ip(this)}},up=function(){function a(){return Reflect.construct(HTMLElement,[],$APP.Ra(b))}var b=new $APP.Dd;$APP.Ed(b,a);return a},wp=function(){if($APP.n(customElements.get("x-command-palette")))return null;var a=Object.create(HTMLElement.prototype),b=up();Object.setPrototypeOf(b,HTMLElement);a.constructor=b;rp(a,"open","open");rp(a,"disabled","disabled");sp(a);tp(a);a.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xCommandPaletteRefs"))){var c=
|
|
22
|
+
this.attachShadow({mode:"open"}),d=dp("style"),e=dp("div"),f=dp("div"),h=dp("div"),k=dp("span"),m=dp("input"),q=dp("button"),r=dp("div"),u=dp("div"),w=dp("div");d.textContent=":host{display:contents;}[part\x3doverlay]{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.45);z-index:var(--x-command-palette-z,800);}[part\x3dpanel]{display:none;position:fixed;top:20vh;left:50%;transform:translateX(-50%);width:var(--x-command-palette-width,560px);max-height:60vh;z-index:calc(var(--x-command-palette-z,800) + 1);flex-direction:column;border-radius:var(--x-command-palette-radius,12px);background:var(--x-command-palette-bg,#fff);box-shadow:0 20px 60px rgba(0,0,0,0.25),0 4px 16px rgba(0,0,0,0.12);overflow:hidden;}:host([open]) [part\x3doverlay]{display:block;}:host([open]) [part\x3dpanel]{display:flex;}[part\x3dsearch-wrap]{display:flex;align-items:center;gap:8px;padding:12px 16px;border-bottom:1px solid var(--x-command-palette-divider,rgba(0,0,0,0.08));}[part\x3dsearch-icon]{flex:none;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;color:var(--x-command-palette-icon-color,#64748b);}[part\x3dinput]{flex:1;border:none;outline:none;background:transparent;font-size:1rem;line-height:1.5;color:var(--x-command-palette-text,inherit);}[part\x3dinput]::placeholder{color:var(--x-command-palette-placeholder,#94a3b8);}[part\x3dclear-btn]{all:unset;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;color:var(--x-command-palette-icon-color,#64748b);}[part\x3dclear-btn]:focus-visible{outline:2px solid var(--x-command-palette-focus-ring,#60a5fa);}[part\x3dclear-btn][hidden]{display:none;}[part\x3dlist-wrap]{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:8px 0;}[part\x3dlist]{display:flex;flex-direction:column;}[part\x3ditem]{padding:10px 16px;cursor:default;font-size:0.9375rem;line-height:1.4;color:var(--x-command-palette-item-text,inherit);border-radius:0;outline:none;}[part\x3ditem]:hover,[part\x3ditem]:focus{background:var(--x-command-palette-item-hover,#f1f5f9);}[part\x3ditem][aria-selected\x3dtrue]{background:var(--x-command-palette-item-active,#e0e7ff);color:var(--x-command-palette-item-active-text,#3730a3);}[part\x3ditem][aria-disabled\x3dtrue]{opacity:0.45;cursor:default;pointer-events:none;}[part\x3dgroup-header]{padding:8px 16px 4px;font-size:0.75rem;font-weight:600;letter-spacing:0.05em;text-transform:uppercase;color:var(--x-command-palette-group-text,#94a3b8);}[part\x3dempty]{padding:32px 16px;text-align:center;color:var(--x-command-palette-empty-text,#94a3b8);font-size:0.9375rem;}[part\x3dempty][hidden]{display:none;}@media (prefers-color-scheme:dark){[part\x3dpanel]{background:var(--x-command-palette-bg,#1e293b);box-shadow:0 20px 60px rgba(0,0,0,0.6),0 4px 16px rgba(0,0,0,0.4);}[part\x3dsearch-wrap]{border-bottom-color:var(--x-command-palette-divider,rgba(255,255,255,0.08));}[part\x3ditem]:hover,[part\x3ditem]:focus{background:var(--x-command-palette-item-hover,#334155);}[part\x3ditem][aria-selected\x3dtrue]{background:var(--x-command-palette-item-active,#312e81);color:var(--x-command-palette-item-active-text,#c7d2fe);}}@media (prefers-reduced-motion:reduce){[part\x3dpanel],[part\x3doverlay]{transition:none;}}";
|
|
23
|
+
e.setAttribute("part","overlay");f.setAttribute("part","panel");f.setAttribute("role","dialog");f.setAttribute("aria-modal","true");h.setAttribute("part","search-wrap");k.setAttribute("part","search-icon");k.setAttribute("aria-hidden","true");k.textContent="\ud83d\udd0d";m.setAttribute("part","input");m.setAttribute("type","search");m.setAttribute("role","combobox");m.setAttribute("autocomplete","off");m.setAttribute("autocorrect","off");m.setAttribute("spellcheck","false");m.setAttribute("aria-autocomplete",
|
|
24
|
+
"list");m.setAttribute("aria-expanded","false");q.setAttribute("part","clear-btn");q.setAttribute("type","button");q.setAttribute("aria-label","Clear");q.setAttribute("hidden","");r.setAttribute("part","list-wrap");u.setAttribute("part","list");u.setAttribute("role","listbox");u.setAttribute("aria-label","Results");w.setAttribute("part","empty");w.setAttribute("hidden","");h.appendChild(k);h.appendChild(m);h.appendChild(q);r.appendChild(u);r.appendChild(w);f.appendChild(h);f.appendChild(r);c.appendChild(d);
|
|
25
|
+
c.appendChild(e);c.appendChild(f);this.__xCommandPaletteRefs={overlay:e,panel:f,input:m,"clear-btn":q,list:u,empty:w}}qp(this);pp(this);return hp(this)};a.disconnectedCallback=function(){return qp(this)};a.attributeChangedCallback=function(){return hp(this)};b.observedAttributes=vp;b.prototype=a;return customElements.define("x-command-palette",b)},xp=function(){return wp()},yp=function yp(a,b,c){var e=a.j-2>>>b&31;if(b>5){b-=5;var f=c.i[e];a=yp.m?yp.m(a,b,f):yp.call(null,a,b,f);if(a==null&&e===0)return null;
|
|
26
|
+
c=$APP.Pd(c);c.i[e]=a;return c}if(e===0)return null;c=$APP.Pd(c);c.i[e]=null;return c};$APP.Uc.prototype.sa=$APP.ca(30,function(){return this.ga(null)});$APP.Vc.prototype.sa=$APP.ca(29,function(){throw Error("Can't pop empty list");});
|
|
27
|
+
$APP.O.prototype.sa=$APP.ca(28,function(){if(this.j===0)throw Error("Can't pop empty vector");if(1===this.j)return $APP.Ua($APP.Ld,this.s);if(1<this.j-$APP.Qd(this))return new $APP.O(this.s,this.j-1,this.shift,this.root,this.la.slice(0,-1),null);var a=$APP.Sd(this,this.j-2),b=yp(this,this.shift,this.root);b=b==null?$APP.Xd:b;var c=this.j-1;return 5<this.shift&&b.i[1]==null?new $APP.O(this.s,c,this.shift-5,b.i[0],a,null):new $APP.O(this.s,c,this.shift,b,a,null)});
|
|
28
|
+
$APP.te.prototype.sa=$APP.ca(27,function(){return new $APP.O(null,1,5,$APP.Xd,[this.key],null)});$APP.hf.prototype.sa=$APP.ca(26,function(){return new $APP.O(null,1,5,$APP.Xd,[this.key],null)});$APP.jf.prototype.sa=$APP.ca(25,function(){return new $APP.O(null,1,5,$APP.Xd,[this.key],null)});
|
|
29
|
+
var Yo=new $APP.K(null,"empty-text","empty-text",1554384594),Zo=new $APP.K(null,"close-on-scrim?","close-on-scrim?",-367113965),So=new $APP.K(null,"close-on-scrim-raw","close-on-scrim-raw",159828234),Ro=new $APP.K(null,"empty-text-raw","empty-text-raw",1477406757),zp=new $APP.Gb(null,"object","object",-1179821820,null),Lo=new $APP.K(null,"group","group",582596132),Wo=new $APP.K(null,"dismissible-raw","dismissible-raw",947680658),lp=new $APP.K(null,"down","down",1565245570),Mo=new $APP.K(null,"search-str",
|
|
30
|
+
"search-str",-821246171),Xo=new $APP.K(null,"modal-raw","modal-raw",-263722282),$o=new $APP.K(null,"close-on-escape?","close-on-escape?",-1559868909),np=new $APP.K(null,"up","up",-269712113),bp=new $APP.K(null,"modal?","modal?",2146094679),Oo=new $APP.K(null,"groups","groups",-136896102),Uo=new $APP.K(null,"close-on-escape-raw","close-on-escape-raw",-1942646255),ap=new $APP.K(null,"scrim?","scrim?",744210580),Vo=new $APP.K(null,"no-scrim-raw","no-scrim-raw",-1344365743),To=new $APP.K(null,"disabled-raw",
|
|
31
|
+
"disabled-raw",498098381),Ap=new $APP.K(null,"item","item",249373802);var vp="open modal dismissible disabled no-scrim close-on-scrim close-on-escape label placeholder empty-text portal".split(" ");
|
|
32
|
+
$APP.wd(["x-command-palette-open-request",new $APP.P(null,2,[$APP.wi,!0,$APP.Y,$APP.xd],null),"x-command-palette-open",new $APP.P(null,2,[$APP.wi,!1,$APP.Y,$APP.xd],null),"x-command-palette-close-request",new $APP.P(null,2,[$APP.wi,!0,$APP.Y,$APP.xd],null),"x-command-palette-close",new $APP.P(null,2,[$APP.wi,!1,$APP.Y,$APP.xd],null),"x-command-palette-select-request",new $APP.P(null,2,[$APP.wi,!0,$APP.Y,new $APP.P(null,1,[Ap,zp],null)],null),"x-command-palette-select",new $APP.P(null,2,[$APP.wi,!1,
|
|
33
|
+
$APP.Y,new $APP.P(null,1,[Ap,zp],null)],null),"x-command-palette-query-change",new $APP.P(null,2,[$APP.wi,!1,$APP.Y,new $APP.P(null,1,[new $APP.K(null,"query","query",-1288509510),$APP.X],null)],null)]);$APP.ka("app.exports.x_command_palette.init",xp);export const init=xp;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var Kv=function(a,b,c){return typeof a==="string"&&$APP.Cc(b,a)?a:c},Lv=function(a){return a.__xContainerState},Mv=function(a){Object.defineProperty(a,"fluid",{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute("fluid")},set:function(b){return $APP.n($APP.J(b))?this.setAttribute("fluid",""):this.removeAttribute("fluid")}})},Nv=function(a){Object.defineProperty(a,"center",{configurable:!0,enumerable:!0,get:function(){return $APP.N("false",this.getAttribute("center"))},set:function(b){return $APP.J(b)?
|
|
3
|
+
this.removeAttribute("center"):this.setAttribute("center","false")}})},Uv=function(a,b){var c=a.getAttribute("as"),d=a.getAttribute("size"),e=a.getAttribute("padding"),f=$APP.N("false",a.getAttribute("center"));a=new $APP.P(null,6,[Ov,c,$APP.Ag,d,$APP.Ni,e,Pv,f,Qv,a.hasAttribute("fluid"),$APP.W,a.getAttribute("label")],null);var h=$APP.M(a);a=$APP.I(h,Ov);c=$APP.I(h,$APP.Ag);d=$APP.I(h,$APP.Ni);e=$APP.I(h,Pv);f=$APP.I(h,Qv);h=$APP.I(h,$APP.W);a=new $APP.P(null,6,[Ov,Kv(a,Rv,"div"),$APP.Ag,Kv(c,Sv,
|
|
4
|
+
"lg"),$APP.Ni,Kv(d,Tv,"md"),Pv,$APP.J(e),Qv,$APP.J(f),$APP.W,typeof h==="string"&&$APP.N(h,"")?h:null],null);f=Ov.g(a);c=b.base;$APP.N(c.tagName.toLowerCase(),f)&&(d=b.root,e=b.slot,f=document.createElement(f),f.setAttribute("part","base"),f.appendChild(e),d.replaceChild(f,c),b.base=f);b=b.base;b.setAttribute("data-size",$APP.Ag.g(a));b.setAttribute("data-padding",$APP.Ni.g(a));b.setAttribute("data-center",$APP.n(Pv.g(a))?"true":"false");b.setAttribute("data-fluid",$APP.n(Qv.g(a))?"true":"false");
|
|
5
|
+
a=$APP.W.g(a);return $APP.n(a)?b.setAttribute("aria-label",a):b.removeAttribute("aria-label")},Vv=function(){function a(){return Reflect.construct(HTMLElement,[],$APP.Ra(b))}var b=new $APP.Dd;$APP.Ed(b,a);return a},Xv=function(){if($APP.n(customElements.get("x-container")))return null;var a=Object.create(HTMLElement.prototype),b=Vv();Object.setPrototypeOf(b,HTMLElement);a.constructor=b;Nv(a);Mv(a);a.connectedCallback=function(){if(!$APP.n(Lv(this))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),
|
|
6
|
+
e=document.createElement("div"),f=document.createElement("slot");d.textContent="\n :host{\n display:block;\n color-scheme:light dark;\n\n --x-container-max-width-xs:480px;\n --x-container-max-width-sm:640px;\n --x-container-max-width-md:768px;\n --x-container-max-width-lg:1024px;\n --x-container-max-width-xl:1280px;\n\n --x-container-padding-sm:0.5rem;\n --x-container-padding-md:1rem;\n --x-container-padding-lg:1.5rem;\n\n --x-container-padding-block:0;\n --x-container-margin-inline:auto;\n\n --x-container-bg:transparent;\n --x-container-color:#0f172a;\n --x-container-border:transparent;\n --x-container-radius:0;\n --x-container-shadow:none;\n }\n\n @media (prefers-color-scheme: dark){\n :host{\n --x-container-bg:transparent;\n --x-container-color:#e5e7eb;\n --x-container-border:transparent;\n --x-container-radius:0;\n --x-container-shadow:none;\n }\n }\n\n [part\x3d'base']{\n display:block;\n box-sizing:border-box;\n width:100%;\n max-width:var(--x-container-max-width-lg);\n padding-inline:var(--x-container-padding-md);\n padding-block:var(--x-container-padding-block);\n margin-inline:0;\n background:var(--x-container-bg);\n color:var(--x-container-color);\n border:1px solid var(--x-container-border);\n border-radius:var(--x-container-radius);\n box-shadow:var(--x-container-shadow);\n }\n\n [part\x3d'base'][data-size\x3d'xs']{max-width:var(--x-container-max-width-xs);}\n [part\x3d'base'][data-size\x3d'sm']{max-width:var(--x-container-max-width-sm);}\n [part\x3d'base'][data-size\x3d'md']{max-width:var(--x-container-max-width-md);}\n [part\x3d'base'][data-size\x3d'lg']{max-width:var(--x-container-max-width-lg);}\n [part\x3d'base'][data-size\x3d'xl']{max-width:var(--x-container-max-width-xl);}\n [part\x3d'base'][data-size\x3d'full']{max-width:none;width:100%;}\n\n [part\x3d'base'][data-padding\x3d'none']{padding-inline:0;}\n [part\x3d'base'][data-padding\x3d'sm']{padding-inline:var(--x-container-padding-sm);}\n [part\x3d'base'][data-padding\x3d'md']{padding-inline:var(--x-container-padding-md);}\n [part\x3d'base'][data-padding\x3d'lg']{padding-inline:var(--x-container-padding-lg);}\n\n [part\x3d'base'][data-center\x3d'true']{\n margin-inline:var(--x-container-margin-inline);\n }\n\n [part\x3d'base'][data-center\x3d'false']{\n margin-inline:0;\n }\n\n [part\x3d'base'][data-fluid\x3d'true']{\n max-width:none;\n width:100%;\n }\n\n ";
|
|
7
|
+
e.setAttribute("part","base");e.appendChild(f);c.appendChild(d);c.appendChild(e);this.__xContainerState={root:c,base:e,slot:f}}return Uv(this,Lv(this))};a.attributeChangedCallback=function(){var c=Lv(this);return $APP.n(c)?Uv(this,c):null};b.observedAttributes=Wv;b.prototype=a;return customElements.define("x-container",b)},Yv=function(){return Xv()},Ov=new $APP.K(null,"as","as",1148689641),Pv=new $APP.K(null,"center","center",-748944368),Qv=new $APP.K(null,"fluid","fluid",-1823657759);var Rv=new $APP.R(null,new $APP.P(null,8,["article",null,"footer",null,"section",null,"main",null,"nav",null,"div",null,"aside",null,"header",null],null),null),Sv=new $APP.R(null,new $APP.P(null,6,["xs",null,"md",null,"lg",null,"full",null,"xl",null,"sm",null],null),null),Tv=new $APP.R(null,new $APP.P(null,4,["none",null,"md",null,"lg",null,"sm",null],null),null),Wv="as size padding center fluid label".split(" ");$APP.ka("app.exports.x_container.init",Yv);export const init=Yv;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var dH=function(a,b){return typeof a==="string"?(a=parseInt(a,10),$APP.p(isNaN(a))&&a>0?a:b):b},eH=function(a){return $APP.D.h(a,"bottom-start")?"top-start":$APP.D.h(a,"bottom-end")?"top-end":$APP.D.h(a,"top-start")?"bottom-start":$APP.D.h(a,"top-end")?"bottom-end":$APP.D.h(a,"right-start")?"left-start":$APP.D.h(a,"left-start")?"right-start":a},fH=function(a,b,c,d){var e=$APP.M(c);c=$APP.I(e,$APP.Vh);var f=$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,f+e+b],null);case "bottom-end":return new $APP.P(null,2,[$APP.Vh,c+h-d,$APP.Uh,f+e+b],null);case "top-start":return new $APP.P(null,2,[$APP.Vh,c,$APP.Uh,f-k-b],null);case "top-end":return new $APP.P(null,2,[$APP.Vh,c+h-d,$APP.Uh,f-k-b],null);case "right-start":return new $APP.P(null,2,[$APP.Vh,c+h+b,$APP.Uh,f],null);case "left-start":return new $APP.P(null,2,[$APP.Vh,c-d-b,$APP.Uh,f],null);default:return new $APP.P(null,
|
|
4
|
+
2,[$APP.Vh,c,$APP.Uh,f+e+b],null)}},jH=function(a,b,c,d,e){function f(w){var z=fH(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,gH,w,hH,z&&F,iH,$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=f(a),u=f(eH(a));return $APP.n(function(){var w=
|
|
5
|
+
hH.g(r);return $APP.n(w)?w:$APP.p(hH.g(u))}())?r:u},pH=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"),kH,a.getAttribute("offset"),lH,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,kH);b=$APP.I(b,lH);c=c!=null&&$APP.N(c,"false");d=d!=null&&$APP.N(d,"false");e=typeof e===
|
|
6
|
+
"string"&&$APP.Cc(mH,e)?e:"bottom-start";return new $APP.P(null,5,[$APP.Pi,c,$APP.U,d,$APP.Ai,e,nH,dH(a,8),oH,dH(b,1E3)],null)},qH=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)},rH=function(a){return $APP.gc(a.querySelectorAll("[role\x3dmenuitem]:not([disabled]):not([aria-disabled\x3dtrue])"))},sH=function(a){return $APP.n(a)?a.focus():null},tH=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"),f=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:rgba(30,30,35,0.97);--x-context-menu-border:rgba(255,255,255,0.1);--x-context-menu-shadow:0 8px 32px rgba(0,0,0,0.55),0 2px 8px rgba(0,0,0,0.35);--x-context-menu-item-hover:rgba(255,255,255,0.07);--x-context-menu-item-active:rgba(255,255,255,0.12);--x-context-menu-item-fg:rgba(255,255,255,0.87);--x-context-menu-separator:rgba(255,255,255,0.1);}}[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;}}";
|
|
8
|
+
f.setAttribute("part","panel");f.setAttribute("role","menu");f.setAttribute("tabindex","-1");d.appendChild(e);d.appendChild(f);b.appendChild(c);return c},uH=function(a){return $APP.n(a)?a.shadowRoot.querySelector("[part\x3dpanel]"):null},vH=function(a,b,c,d){var e=$APP.M(d);d=$APP.I(e,oH);e=$APP.I(e,iH);a.style.zIndex=""+$APP.S.g(d);a=uH(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")},wH=function(a,b){a=$APP.v($APP.gc(a.children));
|
|
9
|
+
for(var c=null,d=0,e=0;;)if(e<d){var f=c.F(null,e);b.appendChild(f.cloneNode(!0));e+=1}else if(a=$APP.v(a))c=a,$APP.yc(c)?(a=$APP.ob(c),d=$APP.pb(c),c=a,f=$APP.B(a),a=d,d=f):(f=$APP.x(c),b.appendChild(f.cloneNode(!0)),a=$APP.y(c),c=null,d=0),e=0;else break},yH=function(a,b){function c(h){h.stopPropagation();h=h.target.closest("[role\x3dmenuitem]");return $APP.n(h)?(qH(a,"x-context-menu-select",!1,{item:h}),xH.h?xH.h(a,"select"):xH.call(null,a,"select")):null}function d(h){var k=uH(b);return $APP.n($APP.n(k)?
|
|
10
|
+
$APP.p(k.contains(h.target)):k)?xH.h?xH.h(a,"backdrop"):xH.call(null,a,"backdrop"):null}function e(h){var k=h.key,m=b.shadowRoot.activeElement;return $APP.D.h(k,"Escape")?(h.preventDefault(),h.stopPropagation(),xH.h?xH.h(a,"keyboard"):xH.call(null,a,"keyboard")):$APP.D.h(k,"ArrowDown")?(h.preventDefault(),$APP.n(m)?(h=rH(f),m=$APP.hd(h).indexOf(m),m=$APP.H(h,$APP.Qc(m+1,$APP.B(h)),null),m=sH(m)):m=sH($APP.x(rH(f))),m):$APP.D.h(k,"ArrowUp")?(h.preventDefault(),$APP.n(m)?(h=rH(f),k=$APP.B(h),m=$APP.hd(h).indexOf(m),
|
|
11
|
+
m=$APP.H(h,$APP.Qc(m+(k-1),k),null),m=sH(m)):m=sH($APP.x(rH(f))),m):($APP.D.h(k,"Enter")||$APP.D.h(k," "))&&$APP.n(m)?(h.preventDefault(),m.click()):null}var f=uH(b);b.addEventListener("keydown",e,!0);b.addEventListener("click",d);$APP.n(f)&&f.addEventListener("click",c);b.__onKey=e;b.__onClickBackdrop=d;b.__onItemClick=c},zH=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)}},xH=function(a,b){return $APP.n(a.hasAttribute("open"))&&qH(a,"x-context-menu-close-request",!0,{reason:b})?(a.removeAttribute("open"),zH($APP.l(a,"__xContextMenuLayer")),a.__xContextMenuLayer=null,qH(a,"x-context-menu-close",!1,{reason:b})):null},AH=function(a,b,c,d){if($APP.n(a.hasAttribute("disabled")))return null;if(qH(a,"x-context-menu-open-request",!0,{reason:d})){var e=pH(a);e=$APP.M(e);var f=$APP.I(e,$APP.Ai),h=$APP.I(e,nH),k=$APP.I(e,
|
|
13
|
+
oH),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=jH(f,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 u=tH(k);wH(a,uH(u));yH(a,u);vH(u,$APP.Vh.g(b),$APP.Uh.g(b),$APP.jg.m(b,oH,k));a.setAttribute("open","");a.__xContextMenuLayer=u;requestAnimationFrame(function(){var w=uH(u);if($APP.n(w)){var z=jH(f,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));vH(u,$APP.Vh.g(z),$APP.Uh.g(z),$APP.jg.m(z,oH,k));return sH($APP.x(rH(w)))}return null});return qH(a,"x-context-menu-open",!1,{reason:d})}return null},BH=function(a,b){b=b.getBoundingClientRect();var c=pH(a);c=$APP.M(c);var d=$APP.I(c,$APP.Ai),e=$APP.I(c,nH),f=$APP.I(c,oH),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(qH(a,"x-context-menu-open-request",!0,{reason:"programmatic"})){b=
|
|
15
|
+
jH(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=tH(f);wH(a,uH(q));yH(a,q);vH(q,$APP.Vh.g(b),$APP.Uh.g(b),$APP.jg.m(b,oH,f));a.setAttribute("open","");a.__xContextMenuLayer=q;requestAnimationFrame(function(){var r=uH(q);if($APP.n(r)){var u=jH(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));vH(q,$APP.Vh.g(u),$APP.Uh.g(u),$APP.jg.m(u,oH,f));return sH($APP.x(rH(r)))}return null});
|
|
16
|
+
return qH(a,"x-context-menu-open",!1,{reason:"programmatic"})}return null},CH=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)}})},DH=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
|
+
EH=function(a){a.openAt=function(b,c){return AH(this,b,c,"programmatic")};a.toggleAt=function(b,c){return $APP.n(this.hasAttribute("open"))?xH(this,"toggle"):AH(this,b,c,"toggle")};a.openForElement=function(b){return BH(this,b)};a.close=function(){return xH(this,"programmatic")}},FH=function(){function a(){return Reflect.construct(HTMLElement,[],$APP.Ra(b))}var b=new $APP.Dd;$APP.Ed(b,a);return a},HH=function(){if($APP.n(customElements.get("x-context-menu")))return null;var a=Object.create(HTMLElement.prototype),
|
|
18
|
+
b=FH();Object.setPrototypeOf(b,HTMLElement);a.constructor=b;CH(a,"open","open");CH(a,"disabled","disabled");DH(a);EH(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)?(zH(c),this.__xContextMenuLayer=null,c=void 0):c=null;return c};a.attributeChangedCallback=function(c){a:{if($APP.D.h(c,"open")){if($APP.n(this.hasAttribute("open"))){c=null;break a}c=$APP.l(this,"__xContextMenuLayer");if($APP.n(c)){zH(c);this.__xContextMenuLayer=null;c=void 0;break a}}c=null}return c};b.observedAttributes=GH;b.prototype=a;return customElements.define("x-context-menu",b)},IH=function(){return HH()},
|
|
20
|
+
iH=new $APP.K(null,"max-height","max-height",-612563804),nH=new $APP.K(null,"offset","offset",296498311),gH=new $APP.K(null,"final-placement","final-placement",-1586044424),hH=new $APP.K(null,"fits","fits",2008565808),oH=new $APP.K(null,"z-index","z-index",1892827090),lH=new $APP.K(null,"z-index-raw","z-index-raw",-1179679257),kH=new $APP.K(null,"offset-raw","offset-raw",-1418404095);var GH=["open","disabled","placement","offset","z-index"],mH=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("app.exports.x_context_menu.init",IH);export const init=IH;
|
package/dist/x-copy.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var Nr=function(a){return a==null?!0:$APP.D.h(a,"false")?!1:$APP.D.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),f=$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.D.h(f,"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"),f=document.createElement("slot"),h=document.createElement("span"),k=document.createElement("slot"),m=document.createElement("span");
|
|
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(f);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
|
+
$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.D.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 f=document.createElement("textarea");f.value=b;document.body.appendChild(f);f.select();document.execCommand("copy");f.remove();return d.g?d.g(b):d.call(null,b)}catch(h){if(h instanceof Error)return f=h,e.g?e.g(f):e.call(null,f);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 f=document.createElement("textarea"),f.value=b,f.style.position="fixed",f.style.opacity="0",document.body.appendChild(f),f.select(),document.execCommand("copy"),f.remove(),d.g?d.g(b):d.call(null,b)}catch(h){if(h instanceof Error)return f=h,e.g?e.g(f):e.call(null,f);throw h;}}})},js=function(a,b,c,d){var e=
|
|
11
|
+
$APP.l(a,"__xCopyRefs");if($APP.n(e)){var f=$APP.l(a,"__xCopyTid");$APP.n(f)&&(clearTimeout(f),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
|
+
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.D.h(h,"ctrl")},c)),e=$APP.J($APP.Ad(function(h){return $APP.D.h(h,"shift")},c)),f=$APP.J($APP.Ad(function(h){return $APP.D.h(h,"alt")},c));c=$APP.J($APP.Ad(function(h){return $APP.D.h(h,"meta")},c));return $APP.D.h(a.key.toLowerCase(),b)&&$APP.D.h(d,a.ctrlKey)&&$APP.D.h(e,a.shiftKey)&&$APP.D.h(f,a.altKey)&&$APP.D.h(c,a.metaKey)}return null},ns=function(a){function b(e){var f=
|
|
14
|
+
a.getAttribute("hotkey");return $APP.n(ms(e,f))?(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.v(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 f=c.F(null,e),h=$APP.H(f,0,null),k=$APP.H(f,1,null);Object.defineProperty(a,h,{get:function(r,u,w,z,A,C,F){return function(){return this.getAttribute(F)}}(b,c,d,e,f,h,k),set:function(r,u,w,z,A,C,F){return function(E){return E==
|
|
17
|
+
null?this.removeAttribute(F):this.setAttribute(F,""+$APP.S.g(E))}}(b,c,d,e,f,h,k),enumerable:!0,configurable:!0});e+=1}else if(h=$APP.v(b)){f=h;if($APP.yc(f))b=$APP.ob(f),e=$APP.pb(f),c=b,d=$APP.B(b),b=e;else{k=$APP.x(f);var m=$APP.H(k,0,null),q=$APP.H(k,1,null);Object.defineProperty(a,m,{get:function(r,u,w,z,A,C,F){return function(){return this.getAttribute(F)}}(b,c,d,e,k,m,q,f,h),set:function(r,u,w,z,A,C,F){return function(E){return E==null?this.removeAttribute(F):this.setAttribute(F,""+$APP.S.g(E))}}(b,
|
|
18
|
+
c,d,e,k,m,q,f,h),enumerable:!0,configurable:!0});b=$APP.y(f);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
|
+
"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
|
+
"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
|
+
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),
|
|
22
|
+
Tr=new $APP.K(null,"mode-raw","mode-raw",-112711707),as=new $APP.K(null,"tooltip-ms","tooltip-ms",1062450417),Ur=new $APP.K(null,"error-message-raw","error-message-raw",1910536231),$r=new $APP.K(null,"hotkey","hotkey",-329017295),Wr=new $APP.K(null,"success-message-raw","success-message-raw",388691116),Sr=new $APP.K(null,"from-raw","from-raw",-44462428),Zr=new $APP.K(null,"from-attr","from-attr",1217901743),Qr=new $APP.K(null,"hotkey-raw","hotkey-raw",1972404222),bs=new $APP.K(null,"error-message",
|
|
23
|
+
"error-message",1756021561),Xr=new $APP.K(null,"show-tooltip-raw","show-tooltip-raw",453600717);var ss="text from from-attr mode disabled show-tooltip tooltip-ms success-message error-message hotkey".split(" ");
|
|
24
|
+
$APP.bf([new $APP.K(null,"errorMessage","errorMessage",982744869),$APP.yi,new $APP.K(null,"textValue","textValue",-598870870),$APP.fi,vs,new $APP.K(null,"tooltipMs","tooltipMs",1056463375),$r,$APP.Mg,new $APP.K(null,"showTooltip","showTooltip",482349691),new $APP.K(null,"successMessage","successMessage",-789572803),$APP.Mh],[new $APP.P(null,2,[$APP.Z,$APP.X,$APP.Qg,"error-message"],null),new $APP.P(null,2,[$APP.Z,$APP.Li,$APP.Qg,"disabled"],null),new $APP.P(null,3,[$APP.Z,$APP.X,$APP.Qg,null,new $APP.K(null,
|
|
25
|
+
"note","note",1426297904),"property-only override"],null),new $APP.P(null,2,[$APP.Z,$APP.X,$APP.Qg,"mode"],null),new $APP.P(null,2,[$APP.Z,$APP.X,$APP.Qg,"from-attr"],null),new $APP.P(null,2,[$APP.Z,$APP.Gh,$APP.Qg,"tooltip-ms"],null),new $APP.P(null,2,[$APP.Z,$APP.X,$APP.Qg,"hotkey"],null),new $APP.P(null,2,[$APP.Z,$APP.X,$APP.Qg,"from"],null),new $APP.P(null,2,[$APP.Z,$APP.Li,$APP.Qg,"show-tooltip"],null),new $APP.P(null,2,[$APP.Z,$APP.X,$APP.Qg,"success-message"],null),new $APP.P(null,2,[$APP.Z,
|
|
26
|
+
$APP.X,$APP.Qg,"text"],null)]);$APP.wd(["x-copy-request",new $APP.P(null,2,[$APP.wi,!0,$APP.Y,new $APP.P(null,4,[$APP.Mh,$APP.X,$APP.fi,$APP.X,$APP.Mg,$APP.X,vs,$APP.X],null)],null),"x-copy-success",new $APP.P(null,2,[$APP.wi,!1,$APP.Y,new $APP.P(null,1,[$APP.Mh,$APP.X],null)],null),"x-copy-error",new $APP.P(null,2,[$APP.wi,!1,$APP.Y,new $APP.P(null,1,[$APP.qh,$APP.X],null)],null)]);$APP.ka("app.exports.x_copy.init",us);export const init=us;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var fx=function(a){a=(""+$APP.S.g($APP.n(a)?a:"")).trim().toUpperCase();return $APP.D.h(a,"")?"USD":a},gx=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},hx=function(a,b){try{var c=(new Intl.NumberFormat($APP.D.h(b,"")?"en-US":b,{style:"currency",currency:a})).formatToParts(0),d=$APP.Ad(function(e){return $APP.D.h("currency",e.type)?e.value:null},$APP.gc(c));return $APP.n(d)?d:a}catch(e){return a}},ix=function(a,b){var c=parseFloat(a);if($APP.n(isNaN(c)))return a;try{return(new Intl.NumberFormat($APP.D.h(b,
|
|
3
|
+
"")?void 0:b,{minimumFractionDigits:2,maximumFractionDigits:2})).format(c)}catch(d){return a}},jx=function(a){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("label"),f=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");f.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");f.appendChild(h);f.appendChild(k);d.appendChild(e);d.appendChild(f);d.appendChild(m);d.appendChild(q);b.appendChild(c);b.appendChild(d);a.__xCurrencyFieldRefs={field:d,label:e,wrapper:f,symbol:h,input:k,hint:m,error:q}},kx=function(a,b,c,d){var e=a.hasAttribute("error");var f=a.getAttribute("error");f=$APP.n(f)?f:"";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},f,c):$APP.n($APP.n(h)?$APP.D.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)},px=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"),f=$APP.l(b,"hint");b=$APP.l(b,"error");var h=$APP.bf([$APP.dh,lx,$APP.Kh,$APP.th,$APP.Fh,$APP.$h,mx,$APP.Cg,$APP.ih,$APP.vi,$APP.Gi,nx,$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,lx),r=$APP.I(k,$APP.Kh),u=$APP.I(k,$APP.th),w=$APP.I(k,$APP.Fh),z=$APP.I(k,$APP.$h),A=$APP.I(k,mx),C=$APP.I(k,$APP.Cg),F=$APP.I(k,$APP.ih),E=$APP.I(k,$APP.vi),Q=$APP.I(k,$APP.Gi);k=$APP.I(k,nx);var V=$APP.n(u)?u:"",ea=$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,ox,$APP.fh,$APP.W,$APP.qh,$APP.U],[$APP.n(A)?A:"",$APP.J(C),$APP.J(E),$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 u==="string"&&$APP.N(u,"")&&u!=null,ea,fx(q),$APP.n(F)?F:"",wa,V,$APP.J(z)]);m=$APP.kh.g(h);$APP.n(m)?q=null:(u=$APP.M(h),q=$APP.I(u,$APP.T),r=$APP.I(u,$APP.Vi),u=$APP.I(u,$APP.fh),w=parseFloat(q),z=$APP.N(q,
|
|
10
|
+
"")&&$APP.p(isNaN(w)),A=$APP.N(r,"")?parseFloat(r):null,C=$APP.N(u,"")?parseFloat(u):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(u)+".":"");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);u=$APP.Nh.g(h);z=ox.g(h);w=$APP.dj.g(h);d.textContent=hx(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.D.h(e,a.shadowRoot.activeElement)||(d=$APP.T.g(h),e.value=$APP.D.h(d,"")?"":ix(d,w));c.textContent=$APP.W.g(h);$APP.n(u)?c.classList.remove("label-hidden"):
|
|
12
|
+
c.classList.add("label-hidden");f.textContent=$APP.mi.g(h);$APP.n(r)?f.classList.remove("hint-hidden"):f.classList.add("hint-hidden");b.textContent=m;$APP.n(q)?b.classList.remove("error-hidden"):b.classList.add("error-hidden");gx(a,"data-invalid",q);c=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(c)?(f=a.getAttribute("value"),a=kx(a,c,e,$APP.n(f)?f:"")):a=null;return a}return null},qx=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},rx=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}},sx=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),kx(a,e,b,c));return qx(a,"x-currency-field-input",{name:d,value:c})}return null}},tx=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),kx(a,e,b,c));return qx(a,"x-currency-field-change",{name:d,value:c})}return null}},ux=function(a){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=rx(a),d=sx(a),e=tx(a);b.addEventListener("focus",
|
|
15
|
+
c);b.addEventListener("input",d);b.addEventListener("change",e);a.__xCurrencyFieldHandlers={focus:c,input:d,change:e}}},vx=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},wx=function(a){$APP.n($APP.l(a,"__xCurrencyFieldRefs"))||
|
|
16
|
+
(jx(a),$APP.n(a.attachInternals)&&$APP.ma(a,"__xCurrencyFieldInternals",a.attachInternals()));vx(a);var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=a.getAttribute("value");fx(a.getAttribute("currency"));var d=function(){var e=a.getAttribute("locale");return $APP.n(e)?e:""}();$APP.n(c)&&(b.value=ix(c,d))}b=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(b)&&b.setFormValue(function(){var e=a.getAttribute("value");return $APP.n(e)?e:""}());ux(a);return px(a)},xx=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}})},yx=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return gx(this,c,$APP.J(d))}})},zx=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");fx(this.getAttribute("currency"));var d=this.getAttribute("locale");d=$APP.n(d)?d:"";return $APP.D.h(c,this.shadowRoot.activeElement)?null:c.value=$APP.D.h(b,"")?"":ix(b,d)}return null}})},Bx=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,
|
|
19
|
+
"observedAttributes",{get:function(){return Ax}});zx(b);xx(b,"name","name");xx(b,"currency","currency");xx(b,"locale","locale");xx(b,"min","min");xx(b,"max","max");xx(b,"placeholder","placeholder");xx(b,"label","label");xx(b,"hint","hint");xx(b,"error","error");yx(b,"disabled","disabled");yx(b,"readOnly","readonly");yx(b,"required","required");b.connectedCallback=function(){return wx(this)};b.disconnectedCallback=function(){return vx(this)};b.attributeChangedCallback=function(c,d,e){$APP.D.h(c,"value")&&
|
|
20
|
+
(c=$APP.l(this,"__xCurrencyFieldRefs"),$APP.n(c)&&(c=$APP.l(c,"input"),$APP.D.h(c,this.shadowRoot.activeElement)||(fx(this.getAttribute("currency")),d=this.getAttribute("locale"),d=$APP.n(d)?d:"",c.value=e==null||$APP.D.h(e,"")?"":ix(e,d))));return px(this)};b.formDisabledCallback=function(c){gx(this,"disabled",$APP.J(c));return px(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 px(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},Cx=function(){return $APP.n(customElements.get("x-currency-field"))?null:customElements.define("x-currency-field",Bx())},mx=new $APP.K(null,"min-raw","min-raw",183137548),lx=new $APP.K(null,"currency-raw","currency-raw",
|
|
22
|
+
1169887491),ox=new $APP.K(null,"currency","currency",-898327568),nx=new $APP.K(null,"locale-raw","locale-raw",385401846);var Ax="name value currency locale min max placeholder label hint error disabled required readonly".split(" ");$APP.ka("app.exports.x_currency_field.init",Cx);export const init=Cx;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var RB=function(a){return typeof a==="string"?(a=a.trim(),$APP.N(a,"")?a:null):null},SB=function(a){return a!=null&&$APP.N(a,"false")},TB=function(a){return a<10?"0"+$APP.S.g(a):""+$APP.S.g(a)},UB=function(a){return $APP.n(a)?""+$APP.S.g(a.getUTCFullYear())+"-"+$APP.S.g(TB(a.getUTCMonth()+1))+"-"+$APP.S.g(TB(a.getUTCDate())):null},VB=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},WB=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},XB=function(a){return $APP.n(a)?new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)):null},YB=function(a,b,c){if($APP.n($APP.n(a)?$APP.n(b)?c:b:a)){var d=WB(b,c)<0?c:b;return!(WB(a,WB(b,c)<0?b:c)<0)&&!(WB(a,d)>0)}return null},aC=function(a,b){var c=$APP.M(b);b=$APP.I(c,ZB);c=$APP.I(c,$APP.dj);return $APP.n(a)?$APP.D.h(b,$B)?(new Intl.DateTimeFormat($APP.n(c)?
|
|
4
|
+
c:"default",{year:"numeric",month:"long",day:"numeric",timeZone:"UTC"})).format(a):UB(a):null},dC=function(a){a=RB(a);a=$APP.n(a)?VB(a):null;return new $APP.P(null,2,[bC,a!=null,cC,a],null)},tC=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,ZB);var f=$APP.I(b,$APP.dj),h=$APP.I(b,eC),k=$APP.I(b,$APP.T),m=$APP.I(b,$APP.fi),q=$APP.I(b,$APP.zi),r=$APP.I(b,$APP.fh),u=$APP.I(b,fC);b=$APP.D.h(m,"range")?gC:hC;a=$APP.D.h(a,"localized")?$B:iC;f=RB(f);m=function(){var A=
|
|
5
|
+
RB(d);return $APP.n(A)?A:" - "}();e=VB(e);r=VB(r);u=$APP.J(u);h=$APP.J(h);if($APP.D.h(b,hC))return b=VB(k),$APP.bf([ZB,jC,$APP.dj,kC,$APP.fi,lC,fC,mC,$APP.ph,nC,oC],[a,b,f,h,hC,r,u,b!=null,m,e,function(){var A=RB(k);return $APP.n(A)?A:""}()]);var w=VB(q),z=VB(c);b=w!=null&&z!=null;return $APP.bf([pC,ZB,qC,$APP.dj,kC,$APP.fi,lC,rC,sC,fC,mC,$APP.ph,nC],[function(){var A=RB(c);return $APP.n(A)?A:""}(),a,w,f,h,gC,r,function(){var A=RB(q);return $APP.n(A)?A:""}(),z,u,b,m,e])},vC=function(a){if($APP.n(a)){var b=
|
|
6
|
+
XB(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.D.h(d.getUTCMonth(),a.getUTCMonth());return new $APP.P(null,2,[cC,d,uC,e],null)},$APP.Bf(0,42))}return null},wC=function(a){return document.createElement(a)},xC=function(a,b,c,d){b=new CustomEvent(b,{detail:d,bubbles:!0,composed:!0,cancelable:$APP.J(c)});a.dispatchEvent(b);return b},yC=function(a){var b=a.getAttribute("mode");$APP.D.h(b,
|
|
7
|
+
"range");b=tC($APP.bf([$APP.Vi,ZB,$APP.dj,eC,$APP.T,$APP.fi,$APP.zi,$APP.fh,fC,$APP.uh,$APP.ph],[a.getAttribute("min"),a.getAttribute("format"),a.getAttribute("locale"),SB(a.getAttribute("range-allow-same-day")),a.getAttribute("value"),b,a.getAttribute("start"),a.getAttribute("max"),SB(a.getAttribute("auto-swap")),a.getAttribute("end"),a.getAttribute("separator")]));var c=new $APP.P(null,2,[ZB,ZB.g(b),$APP.dj,$APP.dj.g(b)],null);var d=$APP.M(c);var e=$APP.I(d,ZB);d=$APP.I(d,$APP.dj);e=new $APP.P(null,
|
|
8
|
+
2,[ZB,e,$APP.dj,d],null);if($APP.D.h($APP.fi.g(b),hC))e=$APP.n(jC.g(b))?aC(jC.g(b),e):"";else{d=$APP.ph.g(b);var f=qC.g(b);f=$APP.n(f)?sC.g(b):f;e=$APP.n(f)?""+$APP.S.g(aC(qC.g(b),e))+$APP.S.g(d)+$APP.S.g(aC(sC.g(b),e)):$APP.n(qC.g(b))?aC(qC.g(b),e):""}d=$APP.l(a,"__xDatePickerState");d=$APP.n(d)?$APP.l(d,"month"):null;f=jC.g(b);$APP.n(f)||(f=qC.g(b),f=$APP.n(f)?f:new Date(Date.now()));d=$APP.n(d)?d:XB(f);a.__xDatePickerState={canon:b,cfg:c,disp:e,month:d}},zC=function(a,b){var c=nC.g(b);c=$APP.n(c)?
|
|
9
|
+
WB(a,nC.g(b))<0:c;if($APP.n(c))return c;c=lC.g(b);return $APP.n(c)?WB(a,lC.g(b))>0:c},CC=function(a,b){if($APP.D.h($APP.fi.g(b),hC))return new $APP.P(null,3,[$APP.Jh,function(){var k=jC.g(b);return $APP.n(k)?$APP.D.h(0,WB(a,jC.g(b))):k}(),AC,!1,BC,!1],null);var c=qC.g(b),d=sC.g(b),e=function(){var k=$APP.n(c)?$APP.D.h(0,WB(a,c)):c;return $APP.n(k)?k:$APP.n(d)?$APP.D.h(0,WB(a,d)):d}(),f=$APP.n(c)?$APP.n(d)?YB(a,c,d):d:c,h=function(){var k=$APP.n(c)?$APP.D.h(0,WB(a,c)):c;return $APP.n(k)?k:$APP.n(d)?
|
|
10
|
+
$APP.D.h(0,WB(a,d)):d}();return new $APP.P(null,3,[$APP.Jh,e,AC,f,BC,h],null)},DC=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"),f=$APP.l(a,"__xDatePickerState");b=$APP.n(f)?$APP.l(f,"canon"):null;var h=$APP.n(f)?$APP.l(f,"month"):null;f=$APP.n(f)?$APP.l(f,"cfg"):null;f=$APP.n(f)?$APP.dj.g(f):null;$APP.n(c)&&(h=(new Intl.DateTimeFormat($APP.n(f)?f:"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)f=wC("div"),f.setAttribute("part","weekday"),f.setAttribute("aria-hidden","true"),f.textContent=c[h],e.appendChild(f),h+=1;else break;if($APP.n($APP.n(d)?b:d))a:{d.textContent="";a=$APP.l(a,"__xDatePickerState");a=vC($APP.n(a)?$APP.l(a,"month"):null);e=$APP.v(a);c=null;for(f=h=0;;)if(f<h){a=c.F(null,f);a=$APP.M(a);var k=$APP.I(a,cC);a=$APP.I(a,uC);
|
|
12
|
+
var m=wC("button"),q=UB(k),r=k.getUTCDate(),u=zC(k,b);k=CC(k,b);var w=$APP.M(k);k=$APP.I(w,$APP.Jh);var z=$APP.I(w,AC);w=$APP.I(w,BC);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(u)?"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(u)&&m.setAttribute("disabled","");m.textContent=""+$APP.S.g(r);d.appendChild(m);f+=1}else if(a=$APP.v(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,cC),a=$APP.I(a,uC),c=wC("button"),h=UB(k),f=k.getUTCDate(),m=zC(k,b),k=CC(k,b),r=$APP.M(k),k=$APP.I(r,$APP.Jh),q=$APP.I(r,AC),r=$APP.I(r,BC),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(f),d.appendChild(c),e=$APP.y(e),c=null,h=0),f=0;else{d=null;break a}d=void 0}else d=null;return d}return null},EC=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},FC=function(a){var b=$APP.l(a,"__xDatePickerRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=a.hasAttribute("disabled"),d=a.hasAttribute("readonly"),e=a.getAttribute("placeholder"),f=a.getAttribute("aria-label"),h=a.getAttribute("aria-describedby");$APP.n(b)&&($APP.n(c)?(b.setAttribute("disabled",""),b.setAttribute("aria-disabled","true")):(b.removeAttribute("disabled"),
|
|
16
|
+
b.removeAttribute("aria-disabled")),$APP.n(d)&&b.setAttribute("readonly",""),$APP.n(d)||b.removeAttribute("readonly"),$APP.n(e)&&b.setAttribute("placeholder",e),$APP.n(f)&&b.setAttribute("aria-label",f),$APP.n(h)&&b.setAttribute("aria-describedby",h));EC(a);return DC(a)}return null},GC=function(a,b){$APP.n(b)?a.setAttribute("value",UB(b)):a.removeAttribute("value")},HC=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:UB(b),
|
|
17
|
+
reason:"click"},f=xC(a,"x-date-picker-change-request",!0,e);if($APP.n(f.defaultPrevented))return null;if($APP.D.h(d,hC))return GC(a,b),yC(a),FC(a),xC(a,"x-date-picker-change",!1,e),$APP.n(a.hasAttribute("close-on-select"))?(a.removeAttribute("open"),FC(a)):null;d=function(){var r=$APP.l(a,"__xDatePickerRangeStep");return $APP.n(r)?r:0}();f=qC.g(c);sC.g(c);if($APP.D.h(d,0))a.setAttribute("start",UB(b)),a.removeAttribute("end"),a.__xDatePickerRangeStep=1;else if($APP.D.h(d,1)){var h=kC.g(c),k=WB(b,
|
|
18
|
+
f);if($APP.n(function(){var r=k>0;return r?r:$APP.n(h)?k===0:h}())){var m=$APP.n(fC.g(c))?WB(f,b)<0?f:b:f,q=$APP.n(fC.g(c))?WB(f,b)>0?f:b:b;a.setAttribute("start",UB(m));a.setAttribute("end",UB(q));a.__xDatePickerRangeStep=0;$APP.n(function(){var r=a.hasAttribute("close-on-select");return $APP.n(r)?m!=null&&q!=null:r}())&&a.removeAttribute("open")}else a.setAttribute("start",UB(b)),a.removeAttribute("end"),a.__xDatePickerRangeStep=1}else a.setAttribute("start",UB(b)),a.removeAttribute("end"),a.__xDatePickerRangeStep=
|
|
19
|
+
1;yC(a);FC(a);return xC(a,"x-date-picker-change",!1,e)},IC=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);xC(a,"x-date-picker-input",!1,{value:c});if($APP.D.h(e,hC)){if(c=dC(c),d=$APP.M(c),c=$APP.I(d,bC),d=$APP.I(d,cC),$APP.n(c)){c=xC(a,"x-date-picker-change-request",!0,{iso:UB(d),reason:b});if($APP.n(c.defaultPrevented))return null;GC(a,d);yC(a);
|
|
20
|
+
FC(a);return xC(a,"x-date-picker-change",!1,{iso:UB(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=RB(c),c==null?c=new $APP.P(null,3,[bC,!1,$APP.zi,null,$APP.uh,null],null):(e=c.indexOf(d),e<0?(c=dC(c),d=$APP.M(c),c=$APP.I(d,bC),d=$APP.I(d,cC),c=new $APP.P(null,3,[bC,c,$APP.zi,d,$APP.uh,null],null)):(d=c.substring(e+d.length).trim(),c=VB(c.substring(0,e).trim()),d=VB(d),c=new $APP.P(null,3,[bC,c!=
|
|
21
|
+
null&&d!=null,$APP.zi,c,$APP.uh,d],null))),e=$APP.M(c),c=$APP.I(e,bC),d=$APP.I(e,$APP.zi),e=$APP.I(e,$APP.uh),$APP.n(c)){c=xC(a,"x-date-picker-change-request",!0,{"start-iso":UB(d),"end-iso":UB(e),reason:b});if($APP.n(c.defaultPrevented))return null;a.setAttribute("start",UB(d));a.setAttribute("end",UB(e));a.__xDatePickerRangeStep=0;yC(a);FC(a);return xC(a,"x-date-picker-change",!1,{"start-iso":UB(d),"end-iso":UB(e),reason:b})}return null},KC=function(a,b){var c=$APP.l(a,"__xDatePickerState"),d=$APP.n(c)?
|
|
22
|
+
$APP.l(c,"month"):null;if($APP.n(d)){var e=d.getUTCFullYear();d=d.getUTCMonth();b=$APP.D.h(b,JC)?new Date(Date.UTC(e,d+1,1)):new Date(Date.UTC(e,d-1,1));c.month=b;return DC(a)}return null},LC=function(a){return $APP.n(a.hasAttribute("open"))?a.removeAttribute("open"):null},NC=function(a,b){b=b.currentTarget.getAttribute("data-nav");return $APP.D.h(b,"prev")?KC(a,MC):KC(a,JC)},OC=function(a){function b(E){return $APP.n(a.hasAttribute("open"))?$APP.n(E.composedPath().some(function(Q){return Q===a}))?
|
|
23
|
+
null:LC(a):null}function c(E){return E.preventDefault()}function d(E){E=E.target.closest("button[data-iso]");$APP.n($APP.n(E)?$APP.p(E.hasAttribute("disabled")):E)?(E=E.getAttribute("data-iso"),E=VB(E),E=$APP.n(E)?HC(a,E):null):E=null;return E}function e(E){return NC(a,E)}function f(E){return NC(a,E)}function h(){if($APP.n(a.hasAttribute("open")))var E=LC(a);else $APP.n(a.hasAttribute("open"))?E=null:(a.setAttribute("open",""),E=DC(a));return E}function k(){a.__xDatePickerFocused=!1;IC(a,"blur");
|
|
24
|
+
return EC(a)}function m(){a.__xDatePickerFocused=!0}function q(E){var Q=E.key;$APP.D.h(Q,"Enter")?(E.preventDefault(),E=IC(a,"keyboard")):E=$APP.D.h(Q,"Escape")?LC(a):null;return E}function r(){var E=$APP.l(a,"__xDatePickerRefs");E=$APP.n(E)?$APP.l(E,"input"):null;a.__xDatePickerDisplay=$APP.n(E)?E.value:null;return xC(a,"x-date-picker-input",!1,{value:$APP.n(E)?E.value:null})}var u=$APP.l(a,"__xDatePickerRefs"),w=$APP.l(u,"input"),z=$APP.l(u,"btn"),A=$APP.l(u,"nav-prev"),C=$APP.l(u,"nav-next"),F=
|
|
25
|
+
$APP.l(u,"grid");u=$APP.l(u,"popover");w.addEventListener("input",r);w.addEventListener("keydown",q);w.addEventListener("focus",m);w.addEventListener("blur",k);z.addEventListener("click",h);A.addEventListener("click",f);C.addEventListener("click",e);F.addEventListener("click",d);u.addEventListener("mousedown",c);document.addEventListener("pointerdown",b,!0);$APP.ma(a,"__xDatePickerHandlers",{"pop-md":c,keydown:q,grid:d,next:e,blur:k,prev:f,focus:m,input:r,btn:h,"doc-click":b})},PC=function(a){var b=
|
|
26
|
+
$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"),f=$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,
|
|
27
|
+
"prev"));f.removeEventListener("click",$APP.l(a,"next"));h.removeEventListener("click",$APP.l(a,"grid"));b.removeEventListener("mousedown",$APP.l(a,"pop-md"));return document.removeEventListener("pointerdown",$APP.l(a,"doc-click"),!0)}return null},QC=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)}})},RC=
|
|
28
|
+
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)}})},SC=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 IC(this,"programmatic")};a.clear=function(){var b=$APP.l(this,"__xDatePickerState");$APP.D.h($APP.fi.g($APP.n(b)?$APP.l(b,"canon"):
|
|
29
|
+
null),hC)?this.removeAttribute("value"):(this.removeAttribute("start"),this.removeAttribute("end"));yC(this);return FC(this)}},UC=function(){function a(){return Reflect.construct(HTMLElement,[],$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=TC;c.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xDatePickerRefs"))){var d=this.attachShadow({mode:"open"}),e=wC("style"),f=wC("div"),h=
|
|
30
|
+
wC("input"),k=wC("button"),m=wC("div"),q=wC("div"),r=wC("button"),u=wC("div"),w=wC("button"),z=wC("div"),A=wC("div"),C=wC("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\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
|
+
f.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="‹";u.setAttribute("part","monthlabel");u.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(u);q.appendChild(w);m.appendChild(q);m.appendChild(z);m.appendChild(A);m.appendChild(C);f.appendChild(h);f.appendChild(k);f.appendChild(m);d.appendChild(e);d.appendChild(f);this.__xDatePickerRefs={weekdays:z,grid:A,popover:m,"nav-next":w,"month-label":u,input:h,btn:k,sr:C,"nav-prev":r}}PC(this);OC(this);yC(this);return FC(this)};c.disconnectedCallback=
|
|
34
|
+
function(){return PC(this)};c.attributeChangedCallback=function(){yC(this);return FC(this)};QC(c,"mode","mode");QC(c,"value","value");QC(c,"start","start");QC(c,"end","end");RC(c,"open","open");RC(c,"disabled","disabled");RC(c,"readOnly","readonly");RC(c,"required","required");SC(c);a.prototype=c;return a},VC=function(){return $APP.n(customElements.get("x-date-picker"))?null:customElements.define("x-date-picker",UC())},qC=new $APP.K(null,"start-d","start-d",-1546785820),bC=new $APP.K(null,"ok?","ok?",
|
|
35
|
+
447310304),cC=new $APP.K(null,"date","date",-1463434462),fC=new $APP.K(null,"auto-swap?","auto-swap?",-1675454411),pC=new $APP.K(null,"end-str","end-str",-558112319),$B=new $APP.K(null,"localized","localized",1722109655),BC=new $APP.K(null,"edge?","edge?",203916303),oC=new $APP.K(null,"value-str","value-str",989198845),mC=new $APP.K(null,"complete?","complete?",-892991879),lC=new $APP.K(null,"max-d","max-d",-814680979),hC=new $APP.K(null,"single","single",1551466437),rC=new $APP.K(null,"start-str",
|
|
36
|
+
"start-str",1077409677),gC=new $APP.K(null,"range","range",1639692286),iC=new $APP.K(null,"iso","iso",-1366207543),uC=new $APP.K(null,"in-month?","in-month?",-1630426251),nC=new $APP.K(null,"min-d","min-d",-1118792932),ZB=new $APP.K(null,"format","format",-1306924766),jC=new $APP.K(null,"value-d","value-d",-1768534876),AC=new $APP.K(null,"in-range?","in-range?",-291779262),MC=new $APP.K(null,"prev","prev",-1597069226),JC=new $APP.K(null,"next","next",-117701485),sC=new $APP.K(null,"end-d","end-d",
|
|
37
|
+
-1316370898),kC=new $APP.K(null,"allow-same-day?","allow-same-day?",-1971558934),eC=new $APP.K(null,"range-allow-same-day?","range-allow-same-day?",-714516856);var TC="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("app.exports.x_date_picker.init",VC);export const init=VC;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var iB=function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.Cc(a,c)?c:b},jB=function(a){for(;;){var b=a.firstChild;if($APP.n(b))a.removeChild(b);else break}},vB=function(a){var b=$APP.bf([$APP.Eh,$APP.dh,$APP.Dh,kB,lB,mB,nB,$APP.li,$APP.Ei,oB],[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,oB),e=$APP.I(c,$APP.dh);var f=$APP.I(c,$APP.Eh);var h=$APP.I(c,$APP.Dh),k=$APP.I(c,kB),m=$APP.I(c,lB),q=$APP.I(c,mB),r=$APP.I(c,nB);c=$APP.I(c,$APP.li);f=$APP.bf([$APP.Yg,$APP.ei,pB,qB,$APP.xi,$APP.Wg,$APP.Ah,$APP.W,rB,$APP.bi],[d,iB(sB,"center",h),m,r,q,iB(tB,"solid",f),iB(uB,"horizontal",c),e,k,b]);c=$APP.M(f);d=$APP.I(c,$APP.bi);h=$APP.I(c,$APP.ei);k=$APP.I(c,pB);m=$APP.I(c,qB);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 u=$APP.I(c,rB);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(u)?u:"auto");$APP.n(q)?w.setProperty("--x-divider-color",q):w.removeProperty("--x-divider-color");f=$APP.Yg.g(f);$APP.Cc(new $APP.R(null,new $APP.P(null,
|
|
5
|
+
2,["none",null,"presentation",null],null),null),f)?a.setAttribute("role","presentation"):a.setAttribute("role","separator");$APP.D.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.D.h($APP.l(d,"mode"),"no-label")&&(e=$APP.l(d,"container"),jB(e),f=document.createElement("div"),h=document.createElement("span"),k=document.createElement("slot"),
|
|
6
|
+
m=document.createElement("span"),q=document.createElement("div"),f.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(f),e.appendChild(h),e.appendChild(q),d["line-left"]=f,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.D.h($APP.l(a,"mode"),"label")&&(b=$APP.l(a,"container"),jB(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},wB=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})},xB=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})},yB=function(a){xB(a,"orientation","horizontal");xB(a,"variant","solid");xB(a,"align","center");wB(a,"label");wB(a,"thickness");wB(a,"color");wB(a,"inset");wB(a,"length")},zB=function(){function a(){return Reflect.construct(HTMLElement,[],$APP.Ra(b))}var b=new $APP.Dd;$APP.Ed(b,a);return a},BB=function(){if($APP.n(customElements.get("x-divider")))return null;
|
|
9
|
+
var a=Object.create(HTMLElement.prototype),b=zB();Object.setPrototypeOf(b,HTMLElement);a.constructor=b;yB(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 f=document.createElement("div");f.setAttribute("part","line");e.appendChild(f);c.appendChild(d);c.appendChild(e);this.__xDividerRefs={root:c,container:e,mode:"no-label"}}return vB(this)};a.disconnectedCallback=function(){return null};a.attributeChangedCallback=function(c,d,e){return $APP.N(d,e)?$APP.n($APP.l(this,"__xDividerRefs"))?vB(this):null:null};b.observedAttributes=AB;b.prototype=a;return customElements.define("x-divider",b)},CB=function(){return BB()},
|
|
11
|
+
kB=new $APP.K(null,"length-raw","length-raw",-1832244116),nB=new $APP.K(null,"inset-raw","inset-raw",89351124),qB=new $APP.K(null,"inset","inset",-396367740),pB=new $APP.K(null,"thickness","thickness",-940175454),lB=new $APP.K(null,"thickness-raw","thickness-raw",1843812655),oB=new $APP.K(null,"role-raw","role-raw",777951354),rB=new $APP.K(null,"length","length",588987862),mB=new $APP.K(null,"color-raw","color-raw",1277647215);var AB="orientation variant thickness color inset length label align role aria-label".split(" "),uB=new $APP.R(null,new $APP.P(null,2,["vertical",null,"horizontal",null],null),null),tB=new $APP.R(null,new $APP.P(null,3,["dashed",null,"dotted",null,"solid",null],null),null),sB=new $APP.R(null,new $APP.P(null,3,["center",null,"start",null,"end",null],null),null);$APP.ka("app.exports.x_divider.init",CB);export const init=CB;
|
package/dist/x-drawer.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var Xt=function(a){var b=$APP.l(a,"__xDrawerRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("div"),h=document.createElement("slot"),k=document.createElement("div"),m=document.createElement("slot"),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;}}";
|
|
3
|
+
d.setAttribute("part","backdrop");e.setAttribute("part","panel");e.setAttribute("role","dialog");e.setAttribute("aria-modal","true");f.setAttribute("part","header");h.setAttribute("name","header");k.setAttribute("part","body");q.setAttribute("part","footer");r.setAttribute("name","footer");f.appendChild(h);k.appendChild(m);q.appendChild(r);e.appendChild(f);e.appendChild(k);e.appendChild(q);b.appendChild(c);b.appendChild(d);b.appendChild(e);a.__xDrawerRefs={root:b,backdrop:d,panel:e,header:f,body:k,
|
|
4
|
+
footer:q};return $APP.l(a,"__xDrawerRefs")},Zt=function(a){a=new $APP.P(null,3,[$APP.rh,a.hasAttribute("open"),$APP.fj,a.getAttribute("placement"),$APP.dh,a.getAttribute("label")],null);var b=$APP.M(a),c=$APP.I(b,$APP.rh);a=$APP.I(b,$APP.fj);b=$APP.I(b,$APP.dh);c=$APP.J(c);a=typeof a==="string"&&$APP.Cc(Yt,a)?a:"right";b=typeof b==="string"&&$APP.N(b,"")?b:"Drawer";return new $APP.P(null,3,[$APP.Pi,c,$APP.Ai,a,$APP.W,b],null)},$t=function(a,b,c){a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,
|
|
5
|
+
composed:!0,cancelable:!1}))},au=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'])"))))},bu=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()},cu=function(a,b){$t(a,"x-drawer-dismiss",{reason:b});a.removeAttribute("open");return null},du=function(a){$APP.n(a.hasAttribute("open"))||a.setAttribute("open","");return null},eu=function(a){a.removeAttribute("open");return null},fu=function(a){var b=Xt(a);b=$APP.l(b,"panel");var c=Zt(a),d=
|
|
7
|
+
$APP.Pi.g(c),e=$APP.l(a,"__xDrawerPrevOpen");a.setAttribute("data-open",$APP.n(d)?"true":"false");a.setAttribute("data-placement",$APP.Ai.g(c));b.setAttribute("aria-label",$APP.W.g(c));$APP.N(e,d)&&(a.__xDrawerPrevOpen=d,$t(a,"x-drawer-toggle",{open:d}),$APP.n(d)?setTimeout(function(){var f=$APP.l(a,"__xDrawerRefs");f=$APP.n(f)?$APP.l(f,"panel"):null;var h=$APP.n(f)?au(f):null;a.__xDrawerRestore=document.activeElement;var k=$APP.n(h)?$APP.xg(h):null;a.__xDrawerTabbables=k;$APP.v(h)?$APP.x(h).focus():
|
|
8
|
+
$APP.n(f)&&($APP.n(f.hasAttribute("tabindex"))||(f.setAttribute("tabindex","-1"),a.__xDrawerPanelTab=!0),f.focus());return null},0):bu(a))},gu=function(a){function b(f){var h=f.key;if($APP.D.h(h,"Escape"))f.preventDefault(),cu(a,"escape");else if($APP.D.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))f.preventDefault(),$APP.n(k)&&k.focus();else{k=document.activeElement;var m=$APP.x(h);
|
|
9
|
+
h=$APP.ic(h);var q=f.shiftKey;$APP.n($APP.n(q)?$APP.D.h(k,m):q)?(f.preventDefault(),h.focus()):$APP.p(q)&&$APP.D.h(k,h)&&(f.preventDefault(),m.focus())}}return null}function c(){return cu(a,"backdrop")}var d=Xt(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})},hu=function(a){var b=$APP.l(a,"__xDrawerHandlers"),c=$APP.l(a,"__xDrawerRefs");if($APP.n($APP.n(b)?c:b)){var d=$APP.l(c,"backdrop");
|
|
10
|
+
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},iu=function(a){Object.defineProperty(a,"open",{get:function(){return this.hasAttribute("open")},set:function(b){return $APP.n(b)?du(this):eu(this)},enumerable:!0,configurable:!0});Object.defineProperty(a,"placement",{get:function(){var b=this.getAttribute("placement");return $APP.n(b)?b:"right"},set:function(b){return b==
|
|
11
|
+
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 du(this)},enumerable:!0,configurable:!0,writable:!0});Object.defineProperty(a,"hide",
|
|
12
|
+
{value:function(){return eu(this)},enumerable:!0,configurable:!0,writable:!0});Object.defineProperty(a,"toggle",{value:function(){$APP.n(this.hasAttribute("open"))?eu(this):du(this);return null},enumerable:!0,configurable:!0,writable:!0})},ku=function(){if(!$APP.n(customElements.get("x-drawer"))){var a=class extends HTMLElement{};a.observedAttributes=ju;a.prototype.connectedCallback=function(){Xt(this);hu(this);gu(this);fu(this);return null};a.prototype.disconnectedCallback=function(){hu(this);bu(this);
|
|
13
|
+
return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&fu(this);return null};iu(a.prototype);customElements.define("x-drawer",a)}return null},lu=function(){return ku()};var Yt=new $APP.R(null,new $APP.P(null,4,["right",null,"top",null,"bottom",null,"left",null],null),null),ju=["open","placement","label"];$APP.wd(["x-drawer-toggle",new $APP.P(null,2,[$APP.wi,!1,$APP.Y,new $APP.P(null,1,[$APP.si,$APP.Li],null)],null),"x-drawer-dismiss",new $APP.P(null,2,[$APP.wi,!1,$APP.Y,new $APP.P(null,1,[$APP.xh,$APP.X],null)],null)]);$APP.ka("app.exports.x_drawer.init",lu);export const init=lu;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var Ll=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},Nl=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"),f=a.hasAttribute("disabled");var h=a.getAttribute("label");h=$APP.n(h)?h:"";a=a.getAttribute("placement");a=$APP.Cc(Ml,a)?a:"bottom-start";d.textContent=h;c.setAttribute("aria-expanded",$APP.n(e)?"true":"false");Ll(c,"disabled",f);return b.setAttribute("data-placement",
|
|
3
|
+
a)}return null},Ol=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},Pl=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},Ql=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},Rl=function(a){return{triggerClick:function(){return Ol(a,"pointer")},triggerKeydown:function(b){var c=
|
|
5
|
+
b.key;return $APP.D.h(c," ")||$APP.D.h(c,"Enter")?(b.preventDefault(),Ol(a,"keyboard")):null},hostFocusout:function(b){return $APP.n(a.hasAttribute("open"))?(b=b.relatedTarget,b==null||$APP.p(a.contains(b))?Ol(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:Ol(a,"outside-click")):null},docKeydown:function(b){b=$APP.D.h(b.key,"Escape");return $APP.n(b?a.hasAttribute("open"):b)?Ol(a,
|
|
6
|
+
"escape"):null}}},Sl=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")))}},Tl=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return Ll(this,c,$APP.J(d))}})},Ul=
|
|
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}})},Wl=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",{get:function(){return Vl}});Tl(b,"open","open");Tl(b,"disabled","disabled");Ul(b,"label","label");Ul(b,"placement","placement");b.show=function(){return $APP.n(this.hasAttribute("open"))?
|
|
8
|
+
null:Ol(this,"programmatic")};b.hide=function(){return $APP.n(this.hasAttribute("open"))?Ol(this,"programmatic"):null};b.toggle=function(){return Ol(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"),f=document.createElement("span"),h=document.createElement("span"),k=document.createElement("div"),m=document.createElement("div"),q=document.createElement("slot");
|
|
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
|
+
e.setAttribute("part","trigger");e.setAttribute("type","button");e.setAttribute("aria-haspopup","true");e.setAttribute("aria-expanded","false");e.setAttribute("aria-controls","panel");f.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(f);e.appendChild(h);m.appendChild(q);
|
|
11
|
+
k.appendChild(m);c.appendChild(d);c.appendChild(e);c.appendChild(k);this.__xDropdownRefs={trigger:e,label:f,chevron:h,panel:k}}Sl(this);Ql(this);this.__xDropdownHandlers=Rl(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
|
+
Pl(this);return Nl(this)};b.disconnectedCallback=function(){Sl(this);return Ql(this)};b.attributeChangedCallback=function(c){$APP.n($APP.l(this,"__xDropdownRefs"))?(Nl(this),c=$APP.D.h(c,"open")?$APP.n(this.hasAttribute("open"))?Pl(this):Ql(this):null):c=null;return c};return a},Xl=function(){return $APP.n(customElements.get("x-dropdown"))?null:customElements.define("x-dropdown",Wl())};var Ml=new $APP.R(null,new $APP.P(null,4,["bottom-start",null,"bottom-end",null,"top-end",null,"top-start",null],null),null),Vl=["open","disabled","label","placement"];$APP.wd(["x-dropdown-toggle",new $APP.P(null,2,[$APP.wi,!0,$APP.Y,new $APP.P(null,2,[$APP.si,$APP.Li,$APP.Ch,$APP.X],null)],null),"x-dropdown-change",new $APP.P(null,2,[$APP.wi,!1,$APP.Y,new $APP.P(null,1,[$APP.si,$APP.Li],null)],null)]);$APP.ka("app.exports.x_dropdown.init",Xl);export const init=Xl;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var Vs=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},Zs=function(a){var b=$APP.l(a,"__xFieldsetRefs");if($APP.n(b)){var c=$APP.l(b,"root-el");b=$APP.l(b,"legend-el");var d=a.getAttribute("legend");d=new $APP.P(null,4,[Ws,d,$APP.$h,a.hasAttribute("disabled"),$APP.Ei,a.getAttribute("aria-label"),$APP.ki,a.getAttribute("aria-describedby")],null);var e=$APP.M(d),f=$APP.I(e,Ws);var h=$APP.I(e,$APP.$h);d=$APP.I(e,$APP.Ei);e=$APP.I(e,$APP.ki);f=$APP.n(f)?f:"";h=$APP.J(h);h=
|
|
3
|
+
new $APP.P(null,5,[Xs,f,Ys,$APP.N(f,""),$APP.U,h,$APP.bi,d,$APP.Xi,e],null);f=Xs.g(h);e=Ys.g(h);d=$APP.U.g(h);b.textContent=f;$APP.n(e)?b.removeAttribute("hidden"):b.setAttribute("hidden","");b=$APP.bi.g(h);$APP.n(b)?(c.setAttribute("aria-label",b),c.removeAttribute("aria-labelledby")):(c.removeAttribute("aria-label"),$APP.n(e)?c.setAttribute("aria-labelledby","x-fieldset-legend"):c.removeAttribute("aria-labelledby"));b=$APP.Xi.g(h);$APP.n(b)?c.setAttribute("aria-describedby",b):c.removeAttribute("aria-describedby");
|
|
4
|
+
return Vs(a,"data-disabled",d)}return null},$s=function(a){Object.defineProperty(a,"disabled",{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute("disabled")},set:function(b){return Vs(this,"disabled",$APP.J(b))}})},at=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",b)):b=this.removeAttribute("legend");
|
|
5
|
+
return b}})},ct=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",{get:function(){return bt}});at(b);$s(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"),f=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");f.setAttribute("part","legend");f.setAttribute("id","x-fieldset-legend");h.setAttribute("part","content");h.appendChild(k);e.appendChild(f);e.appendChild(h);c.appendChild(d);c.appendChild(e);this.__xFieldsetRefs={root:c,"root-el":e,"legend-el":f,"content-el":h}}return Zs(this)};b.disconnectedCallback=function(){return null};b.attributeChangedCallback=function(){return Zs(this)};return a},dt=function(){return $APP.n(customElements.get("x-fieldset"))?
|
|
7
|
+
null:customElements.define("x-fieldset",ct())},Xs=new $APP.K(null,"legend","legend",-1027192245),Ys=new $APP.K(null,"legend-visible?","legend-visible?",-281107501),Ws=new $APP.K(null,"legend-raw","legend-raw",907427195);var bt=["legend","disabled","aria-label","aria-describedby"];$APP.ka("app.exports.x_fieldset.init",dt);export const init=dt;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var Qp=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},Up=function(a){a=new $APP.P(null,4,[Rp,a.getAttribute("href"),Sp,a.getAttribute("filename"),$APP.$h,a.hasAttribute("disabled"),$APP.Ei,a.getAttribute("aria-label")],null);var b=$APP.M(a);a=$APP.I(b,Rp);var c=$APP.I(b,Sp),d=$APP.I(b,$APP.$h);b=$APP.I(b,$APP.Ei);return new $APP.P(null,4,[$APP.Yi,$APP.n(a)?a:"",Tp,$APP.n(c)?c:"",$APP.U,$APP.J(d),$APP.bi,b],null)},Vp=function(a){var b=$APP.l(a,"__xFileDownloadRefs");if($APP.n(b)){b=
|
|
3
|
+
$APP.l(b,"anchor-el");var c=Up(a),d=$APP.Yi.g(c),e=Tp.g(c),f=$APP.U.g(c);c=$APP.bi.g(c);b.href=d;typeof e==="string"&&$APP.N(e,"")?b.setAttribute("download",e):b.removeAttribute("download");$APP.n(f)?b.setAttribute("aria-disabled","true"):b.removeAttribute("aria-disabled");$APP.n(c)?b.setAttribute("aria-label",c):b.removeAttribute("aria-label");return Qp(a,"data-disabled",f)}return null},Wp=function(a){return function(b){if($APP.n(a.hasAttribute("disabled")))return b.preventDefault();var c=Up(a);
|
|
4
|
+
c={href:$APP.Yi.g(c),filename:Tp.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}},Xp=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},Yp=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,
|
|
5
|
+
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}})},Zp=function(a){Object.defineProperty(a,"disabled",{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute("disabled")},set:function(b){return Qp(this,"disabled",$APP.J(b))}})},aq=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",{get:function(){return $p}});
|
|
6
|
+
Yp(b,"href","href");Yp(b,"filename","filename");Zp(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"),f=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
|
+
e.setAttribute("part","anchor");f.setAttribute("part","icon");h.setAttribute("part","content");f.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(f);e.appendChild(h);c.appendChild(d);c.appendChild(e);this.__xFileDownloadRefs={"anchor-el":e,"icon-el":f,"content-el":h}}Xp(this);c=Wp(this);$APP.l($APP.l(this,"__xFileDownloadRefs"),"anchor-el").addEventListener("click",c);this.__xFileDownloadHandlers={click:c};return Vp(this)};b.disconnectedCallback=function(){return Xp(this)};b.attributeChangedCallback=function(){return Vp(this)};return a},bq=function(){return $APP.n(customElements.get("x-file-download"))?null:customElements.define("x-file-download",
|
|
9
|
+
aq())},Sp=new $APP.K(null,"filename-raw","filename-raw",-706184256),Tp=new $APP.K(null,"filename","filename",-1428840783),Rp=new $APP.K(null,"href-raw","href-raw",-1680949453);var $p=["href","filename","disabled","aria-label"];$APP.ka("app.exports.x_file_download.init",bq);export const init=bq;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var DB=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},EB=function(a,b,c){var d=a.hasAttribute("error");var e=a.getAttribute("error");e=$APP.n(e)?e:"";a=a.hasAttribute("required");var f=c.value;return $APP.n(d)?b.setValidity({customError:!0},e,c):$APP.n($APP.n(a)?$APP.D.h(f,""):a)?b.setValidity({valueMissing:!0},"Please fill in this field.",c):b.setValidity({},"",c)},GB=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 f=$APP.bf([$APP.dh,$APP.Kh,$APP.th,$APP.Fh,$APP.$h,$APP.Cg,$APP.vi,$APP.Gi,$APP.ch,$APP.jh,$APP.wh],[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(f),k=$APP.I(h,$APP.wh),m=$APP.I(h,$APP.dh),q=$APP.I(h,$APP.Kh);
|
|
4
|
+
f=$APP.I(h,$APP.th);var r=$APP.I(h,$APP.Fh),u=$APP.I(h,$APP.$h),w=$APP.I(h,$APP.Cg),z=$APP.I(h,$APP.vi),A=$APP.I(h,$APP.Gi),C=$APP.I(h,$APP.ch),F=$APP.I(h,$APP.jh);h=$APP.n(f)?f:"";var E=$APP.n(r)?r:"",Q=$APP.n(m)?m:"",V=[$APP.bh,$APP.cj,$APP.Di,$APP.gh,$APP.ii,$APP.T,$APP.Nh,$APP.Z,$APP.kh,$APP.mi,$APP.W,$APP.qh,$APP.oi,$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(FB,F)?F:"text";f=$APP.bf(V,[w,z,k,r,q,A,m,F,typeof f==="string"&&$APP.N(f,"")&&f!=null,E,Q,h,$APP.n(C)?C:"",$APP.J(u)]);u=$APP.kh.g(f);C=$APP.gh.g(f);h=$APP.Nh.g(f);d.type=$APP.Z.g(f);d.name=$APP.ii.g(f);d.placeholder=$APP.Di.g(f);d.disabled=$APP.U.g(f);d.readOnly=$APP.cj.g(f);d.required=$APP.bh.g(f);d.autocomplete=$APP.oi.g(f);E=$APP.n($APP.bh.g(f))?"true":"false";d.setAttribute("aria-required",E);d.setAttribute("aria-invalid",$APP.n(u)?"true":"false");E=$APP.n($APP.n(C)?u:C)?"hint error":
|
|
6
|
+
$APP.n(C)?"hint":$APP.n(u)?"error":null;$APP.n(E)?d.setAttribute("aria-describedby",E):d.removeAttribute("aria-describedby");c.textContent=$APP.W.g(f);$APP.n(h)?c.classList.remove("label-hidden"):c.classList.add("label-hidden");e.textContent=$APP.mi.g(f);$APP.n(C)?e.classList.remove("hint-hidden"):e.classList.add("hint-hidden");b.textContent=$APP.qh.g(f);$APP.n(u)?b.classList.remove("error-hidden"):b.classList.add("error-hidden");DB(a,"data-invalid",u);c=$APP.l(a,"__xFormFieldInternals");return $APP.n(c)?
|
|
7
|
+
EB(a,c,d):null}return null},HB=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},IB=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),EB(a,e,b));return HB(a,"x-form-field-input",{name:d,value:c})}return null}},JB=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),EB(a,e,b));return HB(a,"x-form-field-change",{name:d,value:c})}return null}},KB=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},LB=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}})},MB=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return DB(this,c,$APP.J(d))}})},NB=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}})},PB=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return OB}});NB(b);LB(b,
|
|
11
|
+
"name","name");LB(b,"placeholder","placeholder");LB(b,"autocomplete","autocomplete");MB(b,"disabled","disabled");MB(b,"readOnly","readonly");MB(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"),f=document.createElement("label"),h=document.createElement("div"),k=document.createElement("input"),m=document.createElement("span"),q=document.createElement("span");
|
|
12
|
+
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
|
+
e.setAttribute("part","field");f.setAttribute("part","label");f.setAttribute("id","label");f.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(f);e.appendChild(h);e.appendChild(m);e.appendChild(q);c.appendChild(d);c.appendChild(e);this.__xFormFieldRefs={field:e,label:f,input:k,hint:m,error:q};$APP.n(this.attachInternals)&&(this.__xFormFieldInternals=this.attachInternals())}KB(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=IB(this),e=JB(this),c.addEventListener("input",d),c.addEventListener("change",e),this.__xFormFieldHandlers={input:d,change:e});return GB(this)};b.disconnectedCallback=function(){return KB(this)};b.attributeChangedCallback=function(c,d,e){$APP.D.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 GB(this)};b.formDisabledCallback=function(c){DB(this,"disabled",$APP.J(c));
|
|
16
|
+
return GB(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 GB(this)};return a},QB=function(){return $APP.n(customElements.get("x-form-field"))?null:customElements.define("x-form-field",PB())};var OB="label type name value placeholder hint error disabled readonly required autocomplete".split(" "),FB=new $APP.R(null,new $APP.P(null,6,["url",null,"tel",null,"email",null,"text",null,"number",null,"password",null],null),null);$APP.ka("app.exports.x_form_field.init",QB);export const init=QB;
|
package/dist/x-form.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var sy=function(a,b){return a.setAttribute("autocomplete",b)},xy=function(a){a=new $APP.P(null,3,[ty,a.getAttribute("loading"),uy,$APP.n(a.hasAttribute("novalidate"))?"":null,$APP.ch,a.getAttribute("autocomplete")],null);var b=$APP.M(a),c=$APP.I(b,ty);a=$APP.I(b,uy);b=$APP.I(b,$APP.ch);c=c!=null&&$APP.N(c,"false");b=$APP.Cc(vy,b)?b:"on";return new $APP.P(null,3,[$APP.oh,c,wy,a!=null,$APP.oi,b],null)},yy=function(a){var b=$APP.l(a,"__xFormRefs");if($APP.n(b)){b=$APP.l(b,"form");a=xy(a);sy(b,$APP.oi.g(a));
|
|
3
|
+
if($APP.n($APP.oh.g(a)))return b.setAttribute("aria-busy","true"),b.setAttribute("data-loading","");b.removeAttribute("aria-busy");return b.removeAttribute("data-loading")}return null},zy=function(a){a=a.querySelectorAll("[name]:not([disabled])");for(var b={},c=a.length,d=0;;)if(d<c){var e=a[d],f=e.name;if($APP.n(function(){var m=f;return $APP.n(m)?$APP.N(f,""):m}())){var h=e.tagName.toLowerCase(),k=e.getAttribute("type");$APP.D.h(k,"checkbox")||$APP.D.h(k,"radio")||$APP.D.h(h,"x-checkbox")?$APP.n(e.checked)&&
|
|
4
|
+
(b[f]=function(){var m=e.value;return $APP.n(m)?m:"on"}()):b[f]=function(){var m=e.value;return $APP.n(m)?m:""}()}d+=1}else break;return b},Ay=function(a,b,c,d){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:d}))},By=function(a){var b=$APP.l(a,"__xFormRefs");if($APP.n(b)){b=$APP.l(b,"form");var c=function(f){f.preventDefault();f=xy(a);if($APP.n($APP.oh.g(f)))f=null;else{f=wy.g(f);if(!$APP.n(f)){f=a.querySelectorAll("[name]:not([disabled])");for(var h={ok:!0},
|
|
5
|
+
k=f.length,m=0;;)if(m<k){var q=f[m];$APP.n(q.reportValidity)&&($APP.n(q.reportValidity())||(h.ok=!1));m+=1}else break;f=h.ok}$APP.n(f)?(f=zy(a),f=Ay(a,"x-form-submit",{values:f},!0)):f=null}return f},d=function(){for(var f=a.querySelectorAll("[name]"),h=f.length,k=0;;)if(k<h){var m=f[k];$APP.n(m.formResetCallback)&&m.formResetCallback();k+=1}else break;return Ay(a,"x-form-reset",{},!1)},e=function(f){a:{f=f.target.closest("button,input[type\x3dsubmit],input[type\x3dreset]");if($APP.n(f)){f=f.type;
|
|
6
|
+
var h=$APP.l(a,"__xFormRefs");if($APP.n(h)){h=$APP.l(h,"form");f=$APP.D.h(f,"submit")||$APP.D.h(f,"")?h.requestSubmit():$APP.D.h(f,"reset")?h.reset():null;break a}}f=null}return f};b.addEventListener("submit",c);b.addEventListener("reset",d);a.addEventListener("click",e);$APP.ma(a,"__xFormHandlers",{submit:c,reset:d,click:e})}},Cy=function(a){var b=$APP.l(a,"__xFormRefs");if($APP.n(b)){var c=$APP.l(a,"__xFormHandlers");if($APP.n(c)){b=$APP.l(b,"form");b.removeEventListener("submit",$APP.l(c,"submit"));
|
|
7
|
+
b.removeEventListener("reset",$APP.l(c,"reset"));a.removeEventListener("click",$APP.l(c,"click"));a.__xFormHandlers=null;return}}return null},Dy=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.J(d)?this.setAttribute(c,""):this.removeAttribute(c)}})},Ey=function(a){Object.defineProperty(a,"autocomplete",{configurable:!0,enumerable:!0,get:function(){var b=this.getAttribute("autocomplete");return $APP.n(b)?
|
|
8
|
+
b:""},set:function(b){return b!=null&&$APP.N(b)?sy(this,""+$APP.S.g(b)):this.removeAttribute("autocomplete")}})},Gy=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",{get:function(){return Fy}});Dy(b,"loading","loading");Dy(b,"novalidate","novalidate");Ey(b);b.connectedCallback=function(){if(!$APP.n(this.shadowRoot)){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("form"),f=document.createElement("slot");
|
|
9
|
+
d.textContent=":host{display:block;}[part\x3droot]{display:flex;flex-direction:column;gap:var(--x-form-gap,1rem);width:var(--x-form-width,100%);}:host([loading]){pointer-events:none;opacity:0.6;}";e.setAttribute("part","root");e.setAttribute("novalidate","");e.appendChild(f);c.appendChild(d);c.appendChild(e);this.__xFormRefs={form:e}}Cy(this);By(this);return yy(this)};b.disconnectedCallback=function(){return Cy(this)};b.attributeChangedCallback=function(){return yy(this)};b.submit=function(){var c=
|
|
10
|
+
$APP.l(this,"__xFormRefs");return $APP.n(c)?$APP.l(c,"form").requestSubmit():null};b.reset=function(){var c=$APP.l(this,"__xFormRefs");return $APP.n(c)?$APP.l(c,"form").reset():null};b.setFieldError=function(c,d){c=this.querySelector('[name\x3d"'+$APP.S.g(c)+'"]');return $APP.n(c)?d==null||$APP.D.h(d,"")||$APP.D.h(d,void 0)?c.removeAttribute("error"):c.setAttribute("error",d):null};b.clearErrors=function(){for(var c=this.querySelectorAll("[error]"),d=c.length,e=0;;)if(e<d)c[e].removeAttribute("error"),
|
|
11
|
+
e+=1;else return null};return a},Hy=function(){return $APP.n(customElements.get("x-form"))?null:customElements.define("x-form",Gy())},ty=new $APP.K(null,"loading-raw","loading-raw",-1707143099),wy=new $APP.K(null,"novalidate?","novalidate?",491529885),uy=new $APP.K(null,"novalidate-raw","novalidate-raw",1783236714);var Fy=["loading","novalidate","autocomplete"],vy=new $APP.R(null,new $APP.P(null,2,["off",null,"on",null],null),null);$APP.ka("app.exports.x_form.init",Hy);export const init=Hy;
|
package/dist/x-grid.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var Iw=function(a){switch(a){case "none":return"0";case "xs":return"4px";case "sm":return"8px";case "md":return"16px";case "lg":return"24px";case "xl":return"32px";default:return"16px"}},Jw=function(a,b,c){return $APP.Cc(b,a)?a:c},Kw=function(a){switch(a){case "row-dense":return"row dense";case "column-dense":return"column dense";default:return a}},Lw=function(a){return $APP.n($APP.n(a)?$APP.N("",a):a)?a:null},Mw=function(a){return $APP.n($APP.n(a)?$APP.N("",a):a)?a:"16rem"},$w=function(a){var b=
|
|
3
|
+
$APP.M(a);a=$APP.I(b,Nw);var c=$APP.I(b,Ow),d=$APP.I(b,Pw),e=$APP.I(b,Qw),f=$APP.I(b,Rw),h=$APP.I(b,$APP.Tg),k=$APP.I(b,Sw),m=$APP.I(b,Tw);b=$APP.I(b,Uw);h=Lw(h);k=Mw(k);var q=Jw(b,Vw,"md");b=function(){var u=$APP.Cc(Vw,d)?d:null;return $APP.n(u)?u:q}();var r=function(){var u=$APP.Cc(Vw,m)?m:null;return $APP.n(u)?u:q}();f=Jw(f,Ww,"stretch");c=Jw(c,Ww,"stretch");e=Kw(Jw(e,Xw,"row"));h=$APP.n(h)?h:"repeat(auto-fit,minmax("+$APP.S.g(k)+",1fr))";return $APP.bf([Qw,Rw,$APP.Tg,Tw,Uw,Yw,Nw,Zw,Pw,Ow],[e,
|
|
4
|
+
f,h,Iw(r),q,b,$APP.J(a),r,Iw(b),c])},ax=function(a){var b=$APP.bf([Qw,Rw,$APP.Tg,Sw,Tw,Uw,Nw,Pw,Ow],[a.getAttribute("auto-flow"),a.getAttribute("align-items"),a.getAttribute("columns"),a.getAttribute("min-column-size"),a.getAttribute("column-gap"),a.getAttribute("gap"),a.hasAttribute("inline"),a.getAttribute("row-gap"),a.getAttribute("justify-items")]);b=$w(b);a=$APP.l(a,"__x_grid_base");if($APP.n(a)){var c=a.style;a.setAttribute("data-gap",Uw.g(b));c.setProperty("--x-grid-columns",$APP.Tg.g(b));
|
|
5
|
+
c.setProperty("--x-grid-row-gap",Pw.g(b));c.setProperty("--x-grid-column-gap",Tw.g(b));c.setProperty("--x-grid-align-items",Rw.g(b));c.setProperty("--x-grid-justify-items",Ow.g(b));b=c.setProperty("--x-grid-auto-flow",Qw.g(b))}else b=null;return b},bx=function(a){if($APP.l(a,"__x_grid_initialized")!==!0){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("slot");c.textContent="\n :host {\n display:block;\n }\n\n :host([inline]) {\n display:inline-block;\n }\n\n .base {\n display:grid;\n box-sizing:border-box;\n grid-template-columns:var(--x-grid-columns);\n row-gap:var(--x-grid-row-gap);\n column-gap:var(--x-grid-column-gap);\n align-items:var(--x-grid-align-items);\n justify-items:var(--x-grid-justify-items);\n grid-auto-flow:var(--x-grid-auto-flow);\n\n @media (prefers-reduced-motion: reduce) {\n .base {\n transition: none;\n }\n }\n }\n ";
|
|
6
|
+
d.setAttribute("part","base");d.className="base";d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__x_grid_root=b;a.__x_grid_base=d;a.__x_grid_initialized=!0}ax(a);return a},dx=function(){var a=class extends HTMLElement{};a.observedAttributes=cx;a.prototype.connectedCallback=function(){return bx(this)};a.prototype.attributeChangedCallback=function(){return $APP.l(this,"__x_grid_initialized")===!0?ax(this):bx(this)};return a},ex=function(){return $APP.n(customElements.get("x-grid"))?null:customElements.define("x-grid",
|
|
7
|
+
dx())},Sw=new $APP.K(null,"min-column-size","min-column-size",-1066019378),Nw=new $APP.K(null,"inline","inline",1399884222),Qw=new $APP.K(null,"auto-flow","auto-flow",-1524521728),Tw=new $APP.K(null,"column-gap","column-gap",384822863),Ow=new $APP.K(null,"justify-items","justify-items",1638310783),Pw=new $APP.K(null,"row-gap","row-gap",-1809905537),Zw=new $APP.K(null,"column-gap-token","column-gap-token",-10192833),Uw=new $APP.K(null,"gap","gap",80255254),Rw=new $APP.K(null,"align-items","align-items",
|
|
8
|
+
-267946462),Yw=new $APP.K(null,"row-gap-token","row-gap-token",-219143816);var cx="columns min-column-size gap row-gap column-gap align-items justify-items auto-flow inline".split(" "),Vw=new $APP.R(null,new $APP.P(null,6,["none",null,"xs",null,"md",null,"lg",null,"xl",null,"sm",null],null),null),Ww=new $APP.R(null,new $APP.P(null,4,["center",null,"start",null,"stretch",null,"end",null],null),null),Xw=new $APP.R(null,new $APP.P(null,5,["column-dense",null,"row-dense",null,"dense",null,"column",null,"row",null],null),null);$APP.ka("app.exports.x_grid.init",ex);export const init=ex;
|