@vanelsas/baredom 0.2.6-alpha → 1.0.0-rc.1
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/dist/base.js +349 -346
- package/dist/x-alert.js +17 -17
- package/dist/x-avatar-group.js +11 -11
- package/dist/x-avatar.js +17 -17
- package/dist/x-badge.js +11 -11
- package/dist/x-breadcrumbs.js +14 -14
- package/dist/x-button.js +15 -15
- package/dist/x-cancel-dialogue.js +16 -16
- package/dist/x-card.js +7 -7
- package/dist/x-chart.js +47 -47
- package/dist/x-checkbox.js +11 -11
- package/dist/x-chip.js +8 -8
- package/dist/x-collapse.js +10 -10
- package/dist/x-command-palette.js +30 -30
- package/dist/x-container.js +6 -6
- package/dist/x-context-menu.js +19 -19
- package/dist/x-copy.js +22 -22
- package/dist/x-currency-field.js +21 -21
- package/dist/x-date-picker.js +37 -37
- package/dist/x-divider.js +13 -10
- package/dist/x-drawer.js +11 -11
- package/dist/x-dropdown.js +9 -9
- package/dist/x-fieldset.js +6 -6
- package/dist/x-file-download.js +7 -7
- package/dist/x-form-field.js +15 -15
- package/dist/x-form.js +9 -9
- package/dist/x-grid.js +7 -7
- package/dist/x-menu-item.js +10 -10
- package/dist/x-menu.js +10 -10
- package/dist/x-modal.js +12 -12
- package/dist/x-navbar.js +13 -12
- package/dist/x-notification-center.js +10 -9
- package/dist/x-pagination.js +16 -16
- package/dist/x-popover.js +14 -11
- package/dist/x-progress-circle.js +7 -7
- package/dist/x-progress.js +9 -8
- package/dist/x-radio.js +11 -11
- package/dist/x-search-field.js +14 -14
- package/dist/x-select.js +10 -10
- package/dist/x-sidebar.js +17 -26
- package/dist/x-skeleton.js +5 -5
- package/dist/x-slider.js +16 -16
- package/dist/x-spacer.js +5 -5
- package/dist/x-spinner.js +5 -5
- package/dist/x-stat.js +12 -9
- package/dist/x-stepper.js +16 -16
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +8 -8
- package/dist/x-table-cell.js +20 -20
- package/dist/x-table-row.js +10 -10
- package/dist/x-table.js +15 -14
- package/dist/x-tabs.js +12 -11
- package/dist/x-text-area.js +17 -17
- package/dist/x-timeline-item.js +21 -21
- package/dist/x-timeline.js +9 -9
- package/dist/x-toast.js +23 -23
- package/dist/x-toaster.js +8 -8
- package/package.json +1 -1
package/dist/x-currency-field.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
"")?void 0:b,{minimumFractionDigits:2,maximumFractionDigits:2})).format(c)}catch(d){return a}},
|
|
2
|
+
var ex=function(a){a=(""+$APP.T.g($APP.n(a)?a:"")).trim().toUpperCase();return $APP.C.h(a,"")?"USD":a},fx=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},gx=function(a,b){try{var c=(new Intl.NumberFormat($APP.C.h(b,"")?"en-US":b,{style:"currency",currency:a})).formatToParts(0),d=$APP.xd(function(e){return $APP.C.h("currency",e.type)?e.value:null},$APP.dc(c));return $APP.n(d)?d:a}catch(e){return a}},hx=function(a,b){var c=parseFloat(a);if($APP.n(isNaN(c)))return a;try{return(new Intl.NumberFormat($APP.C.h(b,
|
|
3
|
+
"")?void 0:b,{minimumFractionDigits:2,maximumFractionDigits:2})).format(c)}catch(d){return a}},ix=function(a){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("label"),g=document.createElement("div"),h=document.createElement("span"),k=document.createElement("input"),m=document.createElement("span"),q=document.createElement("span");c.textContent=":host{display:block;color-scheme:light dark;--x-currency-field-bg:#ffffff;--x-currency-field-color:#111827;--x-currency-field-border:1px solid #d1d5db;--x-currency-field-border-radius:6px;--x-currency-field-focus-ring-color:#2563eb;--x-currency-field-symbol-color:#6b7280;--x-currency-field-label-color:#374151;--x-currency-field-hint-color:#6b7280;--x-currency-field-error-color:#dc2626;--x-currency-field-disabled-opacity:0.45;}@media (prefers-color-scheme:dark){:host{--x-currency-field-bg:#1f2937;--x-currency-field-color:#f9fafb;--x-currency-field-border:1px solid #4b5563;--x-currency-field-focus-ring-color:#3b82f6;--x-currency-field-symbol-color:#9ca3af;--x-currency-field-label-color:#d1d5db;--x-currency-field-hint-color:#9ca3af;--x-currency-field-error-color:#f87171;}}[part\x3dfield]{display:flex;flex-direction:column;gap:0.25rem;}[part\x3dlabel]{display:block;font-size:0.875rem;font-weight:500;color:var(--x-currency-field-label-color);}.label-hidden{display:none;}[part\x3dinput-wrapper]{display:flex;align-items:center;background:var(--x-currency-field-bg);border:var(--x-currency-field-border);border-radius:var(--x-currency-field-border-radius);transition:border-color 120ms ease,box-shadow 120ms ease;}[part\x3dinput-wrapper]:focus-within{border-color:var(--x-currency-field-focus-ring-color);box-shadow:0 0 0 3px color-mix(in srgb,var(--x-currency-field-focus-ring-color) 20%,transparent);}:host([data-invalid]) [part\x3dinput-wrapper]{border-color:var(--x-currency-field-error-color);}:host([data-invalid]) [part\x3dinput-wrapper]:focus-within{box-shadow:0 0 0 3px color-mix(in srgb,var(--x-currency-field-error-color) 20%,transparent);}[part\x3dsymbol]{flex-shrink:0;padding:0.5rem 0 0.5rem 0.75rem;font-size:1rem;color:var(--x-currency-field-symbol-color);user-select:none;pointer-events:none;}[part\x3dinput]{flex:1;min-width:0;padding:0.5rem 0.75rem;background:transparent;color:var(--x-currency-field-color);border:none;outline:none;font-size:1rem;line-height:1.5;font-family:inherit;}[part\x3dinput]:disabled{opacity:1;cursor:not-allowed;}:host([disabled]) [part\x3dinput-wrapper]{opacity:var(--x-currency-field-disabled-opacity);cursor:not-allowed;}[part\x3dhint]{display:block;font-size:0.8125rem;color:var(--x-currency-field-hint-color);}.hint-hidden{display:none;}[part\x3derror]{display:block;font-size:0.8125rem;color:var(--x-currency-field-error-color);}.error-hidden{display:none;}@media (prefers-reduced-motion:reduce){[part\x3dinput-wrapper]{transition:none;}}";
|
|
4
4
|
d.setAttribute("part","field");e.setAttribute("part","label");e.setAttribute("id","label");e.setAttribute("for","input");g.setAttribute("part","input-wrapper");h.setAttribute("part","symbol");h.setAttribute("aria-hidden","true");k.setAttribute("part","input");k.setAttribute("id","input");k.setAttribute("inputmode","decimal");k.setAttribute("aria-labelledby","label");m.setAttribute("part","hint");m.setAttribute("id","hint");m.setAttribute("aria-live","polite");q.setAttribute("part","error");q.setAttribute("id",
|
|
5
|
-
"error");q.setAttribute("role","alert");q.setAttribute("aria-live","assertive");g.appendChild(h);g.appendChild(k);d.appendChild(e);d.appendChild(g);d.appendChild(m);d.appendChild(q);b.appendChild(c);b.appendChild(d);a.__xCurrencyFieldRefs={field:d,label:e,wrapper:g,symbol:h,input:k,hint:m,error:q}},
|
|
5
|
+
"error");q.setAttribute("role","alert");q.setAttribute("aria-live","assertive");g.appendChild(h);g.appendChild(k);d.appendChild(e);d.appendChild(g);d.appendChild(m);d.appendChild(q);b.appendChild(c);b.appendChild(d);a.__xCurrencyFieldRefs={field:d,label:e,wrapper:g,symbol:h,input:k,hint:m,error:q}},jx=function(a,b,c,d){var e=a.hasAttribute("error");var g=a.getAttribute("error");g=$APP.n(g)?g:"";var h=a.hasAttribute("required"),k=a.getAttribute("min"),m=a.getAttribute("max");a=parseFloat(d);var q=
|
|
6
6
|
$APP.p(isNaN(a));k=$APP.n(k)?parseFloat(k):null;m=$APP.n(m)?parseFloat(m):null;return $APP.n(e)?b.setValidity({customError:!0},g,c):$APP.n($APP.n(h)?$APP.C.h(d,""):h)?b.setValidity({valueMissing:!0},"Please fill in this field.",c):$APP.O(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.T.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.T.g(m)+".",c):b.setValidity({},"",c)},
|
|
8
|
-
a.hasAttribute("required"),a.getAttribute("max"),a.hasAttribute("readonly"),a.getAttribute("value"),a.getAttribute("locale"),a.getAttribute("placeholder")]);var k=$APP.N(h);h=$APP.
|
|
9
|
-
$APP.
|
|
10
|
-
"")?parseFloat(r):null,D=$APP.O(v,"")?parseFloat(v):null,q=$APP.O(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.T.g(r)+".":$APP.n(z?$APP.n(D)?$APP.p(isNaN(D))&&w>D:D:z)?"Value must be at most "+$APP.T.g(v)+".":"");r=q;q=$APP.n(m)?m:$APP.O($APP.n(r)?r:"","");m=$APP.n(m)?$APP.
|
|
11
|
-
$APP.V.g(h);e.readOnly=$APP.
|
|
12
|
-
c.classList.add("label-hidden");g.textContent=$APP.
|
|
13
|
-
$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=a.getAttribute("value");return b.value=$APP.n(c)?c:""}return null}},
|
|
14
|
-
$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=b.value,d=parseFloat(c);c=$APP.n(isNaN(d))?c:""+$APP.T.g(d);d=a.getAttribute("name");d=$APP.n(d)?d:"";a.setAttribute("value",c);var e=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(e)&&(e.setFormValue(c),
|
|
15
|
-
c);b.addEventListener("input",d);b.addEventListener("change",e);a.__xCurrencyFieldHandlers={focus:c,input:d,change:e}}},
|
|
16
|
-
(
|
|
17
|
-
b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){d!=null&&$APP.O(d)?(d=""+$APP.T.g(d),d=this.setAttribute(c,d)):d=this.removeAttribute(c);return d}})},
|
|
18
|
-
this.getAttribute("value");return $APP.n(b)?b:""},set:function(b){b=b!=null&&$APP.O(b)?""+$APP.T.g(b):"";this.setAttribute("value",b);var c=$APP.l(this,"__xCurrencyFieldRefs");if($APP.n(c)){c=$APP.l(c,"input");
|
|
19
|
-
|
|
20
|
-
$APP.n(c)&&(c=$APP.l(c,"input"),$APP.C.h(c,this.shadowRoot.activeElement)||(
|
|
21
|
-
return
|
|
22
|
-
"currency","currency",-898327568),
|
|
23
|
-
$APP.
|
|
24
|
-
null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.
|
|
7
|
+
"Value must be at most "+$APP.T.g(m)+".",c):b.setValidity({},"",c)},ox=function(a){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){var c=$APP.l(b,"label"),d=$APP.l(b,"symbol"),e=$APP.l(b,"input"),g=$APP.l(b,"hint");b=$APP.l(b,"error");var h=$APP.Xe([$APP.Wg,kx,$APP.Dh,$APP.lh,$APP.yh,$APP.Sh,lx,$APP.ug,$APP.ah,$APP.mi,$APP.yi,mx,$APP.ph],[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.N(h);h=$APP.I(k,$APP.ph);var m=$APP.I(k,$APP.Wg),q=$APP.I(k,kx),r=$APP.I(k,$APP.Dh),v=$APP.I(k,$APP.lh),w=$APP.I(k,$APP.yh),z=$APP.I(k,$APP.Sh),A=$APP.I(k,lx),D=$APP.I(k,$APP.ug),G=$APP.I(k,$APP.ah),J=$APP.I(k,$APP.mi),E=$APP.I(k,$APP.yi);k=$APP.I(k,mx);var R=$APP.n(v)?v:"",ha=$APP.n(w)?w:"",ua=$APP.n(m)?m:"";h=$APP.Xe([$APP.Ni,$APP.Tg,
|
|
9
|
+
$APP.Vi,$APP.vi,$APP.Zg,$APP.Wi,$APP.ai,$APP.U,$APP.Gh,$APP.ch,$APP.ei,nx,$APP.Yg,$APP.W,$APP.ih,$APP.V],[$APP.n(A)?A:"",$APP.K(D),$APP.K(J),$APP.n(h)?h:"",typeof w==="string"&&$APP.O(w,""),$APP.n(k)?k:"",$APP.n(r)?r:"",$APP.n(E)?E:"",typeof m==="string"&&$APP.O(m,""),typeof v==="string"&&$APP.O(v,""),ha,ex(q),$APP.n(G)?G:"",ua,R,$APP.K(z)]);m=$APP.ch.g(h);$APP.n(m)?q=null:(v=$APP.N(h),q=$APP.I(v,$APP.U),r=$APP.I(v,$APP.Ni),v=$APP.I(v,$APP.Yg),w=parseFloat(q),z=$APP.O(q,"")&&$APP.p(isNaN(w)),A=$APP.O(r,
|
|
10
|
+
"")?parseFloat(r):null,D=$APP.O(v,"")?parseFloat(v):null,q=$APP.O(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.T.g(r)+".":$APP.n(z?$APP.n(D)?$APP.p(isNaN(D))&&w>D:D:z)?"Value must be at most "+$APP.T.g(v)+".":"");r=q;q=$APP.n(m)?m:$APP.O($APP.n(r)?r:"","");m=$APP.n(m)?$APP.ih.g(h):$APP.n(r)?r:"";r=$APP.Zg.g(h);v=$APP.Gh.g(h);z=nx.g(h);w=$APP.Wi.g(h);d.textContent=gx(z,w);e.name=$APP.ai.g(h);e.placeholder=$APP.vi.g(h);e.disabled=
|
|
11
|
+
$APP.V.g(h);e.readOnly=$APP.Vi.g(h);e.required=$APP.Tg.g(h);d=$APP.n($APP.Tg.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.C.h(e,a.shadowRoot.activeElement)||(d=$APP.U.g(h),e.value=$APP.C.h(d,"")?"":hx(d,w));c.textContent=$APP.W.g(h);$APP.n(v)?c.classList.remove("label-hidden"):
|
|
12
|
+
c.classList.add("label-hidden");g.textContent=$APP.ei.g(h);$APP.n(r)?g.classList.remove("hint-hidden"):g.classList.add("hint-hidden");b.textContent=m;$APP.n(q)?b.classList.remove("error-hidden"):b.classList.add("error-hidden");fx(a,"data-invalid",q);c=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(c)?(g=a.getAttribute("value"),a=jx(a,c,e,$APP.n(g)?g:"")):a=null;return a}return null},px=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},qx=function(a){return function(){var b=
|
|
13
|
+
$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=a.getAttribute("value");return b.value=$APP.n(c)?c:""}return null}},rx=function(a){return function(){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=b.value;var d=a.getAttribute("name");d=$APP.n(d)?d:"";var e=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(e)&&(e.setFormValue(c),jx(a,e,b,c));return px(a,"x-currency-field-input",{name:d,value:c})}return null}},sx=function(a){return function(){var b=
|
|
14
|
+
$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=b.value,d=parseFloat(c);c=$APP.n(isNaN(d))?c:""+$APP.T.g(d);d=a.getAttribute("name");d=$APP.n(d)?d:"";a.setAttribute("value",c);var e=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(e)&&(e.setFormValue(c),jx(a,e,b,c));return px(a,"x-currency-field-change",{name:d,value:c})}return null}},tx=function(a){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=qx(a),d=rx(a),e=sx(a);b.addEventListener("focus",
|
|
15
|
+
c);b.addEventListener("input",d);b.addEventListener("change",e);a.__xCurrencyFieldHandlers={focus:c,input:d,change:e}}},ux=function(a){var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){var c=$APP.l(a,"__xCurrencyFieldHandlers");if($APP.n(c)){b=$APP.l(b,"input");b.removeEventListener("focus",$APP.l(c,"focus"));b.removeEventListener("input",$APP.l(c,"input"));b.removeEventListener("change",$APP.l(c,"change"));a.__xCurrencyFieldHandlers=null;return}}return null},vx=function(a){$APP.n($APP.l(a,"__xCurrencyFieldRefs"))||
|
|
16
|
+
(ix(a),$APP.n(a.attachInternals)&&$APP.la(a,"__xCurrencyFieldInternals",a.attachInternals()));ux(a);var b=$APP.l(a,"__xCurrencyFieldRefs");if($APP.n(b)){b=$APP.l(b,"input");var c=a.getAttribute("value");ex(a.getAttribute("currency"));var d=function(){var e=a.getAttribute("locale");return $APP.n(e)?e:""}();$APP.n(c)&&(b.value=hx(c,d))}b=$APP.l(a,"__xCurrencyFieldInternals");$APP.n(b)&&b.setFormValue(function(){var e=a.getAttribute("value");return $APP.n(e)?e:""}());tx(a);return ox(a)},wx=function(a,
|
|
17
|
+
b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){d!=null&&$APP.O(d)?(d=""+$APP.T.g(d),d=this.setAttribute(c,d)):d=this.removeAttribute(c);return d}})},xx=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return fx(this,c,$APP.K(d))}})},yx=function(a){Object.defineProperty(a,"value",{configurable:!0,enumerable:!0,get:function(){var b=
|
|
18
|
+
this.getAttribute("value");return $APP.n(b)?b:""},set:function(b){b=b!=null&&$APP.O(b)?""+$APP.T.g(b):"";this.setAttribute("value",b);var c=$APP.l(this,"__xCurrencyFieldRefs");if($APP.n(c)){c=$APP.l(c,"input");ex(this.getAttribute("currency"));var d=this.getAttribute("locale");d=$APP.n(d)?d:"";return $APP.C.h(c,this.shadowRoot.activeElement)?null:c.value=$APP.C.h(b,"")?"":hx(b,d)}return null}})},Ax=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;a.observedAttributes=
|
|
19
|
+
zx;yx(b);wx(b,"name","name");wx(b,"currency","currency");wx(b,"locale","locale");wx(b,"min","min");wx(b,"max","max");wx(b,"placeholder","placeholder");wx(b,"label","label");wx(b,"hint","hint");wx(b,"error","error");xx(b,"disabled","disabled");xx(b,"readOnly","readonly");xx(b,"required","required");b.connectedCallback=function(){return vx(this)};b.disconnectedCallback=function(){return ux(this)};b.attributeChangedCallback=function(c,d,e){$APP.C.h(c,"value")&&(c=$APP.l(this,"__xCurrencyFieldRefs"),
|
|
20
|
+
$APP.n(c)&&(c=$APP.l(c,"input"),$APP.C.h(c,this.shadowRoot.activeElement)||(ex(this.getAttribute("currency")),d=this.getAttribute("locale"),d=$APP.n(d)?d:"",c.value=e==null||$APP.C.h(e,"")?"":hx(e,d))));return ox(this)};b.formDisabledCallback=function(c){fx(this,"disabled",$APP.K(c));return ox(this)};b.formResetCallback=function(){this.removeAttribute("value");var c=$APP.l(this,"__xCurrencyFieldRefs");$APP.n(c)&&($APP.l(c,"input").value="");c=$APP.l(this,"__xCurrencyFieldInternals");$APP.n(c)&&c.setFormValue("");
|
|
21
|
+
return ox(this)};b.checkValidity=function(){var c=$APP.l(this,"__xCurrencyFieldInternals");return $APP.n(c)?c.checkValidity():!0};b.reportValidity=function(){var c=$APP.l(this,"__xCurrencyFieldInternals");return $APP.n(c)?c.reportValidity():!0};return a},Bx=function(){return $APP.n(customElements.get("x-currency-field"))?null:customElements.define("x-currency-field",Ax())},lx=new $APP.M(null,"min-raw","min-raw",183137548),kx=new $APP.M(null,"currency-raw","currency-raw",1169887491),nx=new $APP.M(null,
|
|
22
|
+
"currency","currency",-898327568),mx=new $APP.M(null,"locale-raw","locale-raw",385401846);var zx="name value currency locale min max placeholder label hint error disabled required readonly".split(" ");
|
|
23
|
+
$APP.Xe([$APP.Ni,$APP.vi,$APP.pi,$APP.Wi,$APP.ai,$APP.U,$APP.ei,nx,$APP.si,$APP.Yg,$APP.W,$APP.ih,$APP.Eg],[new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Hg,"min"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Hg,"placeholder"],null),new $APP.Q(null,2,[$APP.Z,$APP.Di,$APP.Hg,"disabled"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Hg,"locale"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Hg,"name"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Hg,"value"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Hg,"hint"],
|
|
24
|
+
null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Hg,"currency"],null),new $APP.Q(null,2,[$APP.Z,$APP.Di,$APP.Hg,"readonly"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Hg,"max"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Hg,"label"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Hg,"error"],null),new $APP.Q(null,2,[$APP.Z,$APP.Di,$APP.Hg,"required"],null)]);$APP.ja("baredom.exports.x_currency_field.init",Bx);export const init=Bx;
|
package/dist/x-date-picker.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a):null},
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
a.getUTCMonth());return new $APP.Q(null,2,[
|
|
8
|
-
a.getAttribute("value"),b,a.getAttribute("start"),a.getAttribute("max"),
|
|
9
|
-
e)):$APP.n(
|
|
10
|
-
|
|
11
|
-
$APP.n(c)&&c.setAttribute("tabindex","-1");b=a.querySelector('[data-iso\x3d"'+$APP.T.g(b)+'"]');if($APP.n(b))return b.setAttribute("tabindex","0"),b.focus()}return null},
|
|
12
|
-
g:"default",{year:"numeric",month:"long",timeZone:"UTC"})).format(h),c.textContent=h);if(!$APP.n($APP.l(a,"__xDatePickerWeekdaysDone")))for(a.__xDatePickerWeekdaysDone=!0,c="Su Mo Tu We Th Fr Sa".split(" "),h=0;;)if(h<7)g=
|
|
13
|
-
g){e=h.
|
|
14
|
-
$APP.n(A)?"true":"false");q.setAttribute("data-range-edge",$APP.n(z)?"true":"false");q.setAttribute("aria-selected",$APP.n(m)?"true":"false");q.setAttribute("aria-disabled",$APP.n(w)?"true":"false");q.setAttribute("tabindex","-1");q.textContent=""+$APP.T.g(v);d.appendChild(q);k+=1}else if(e=$APP.u(c))c=e,$APP.
|
|
15
|
-
$APP.
|
|
16
|
-
h.setAttribute("aria-disabled",$APP.n(q)?"true":"false"),h.setAttribute("tabindex","-1"),h.textContent=""+$APP.T.g(k),d.appendChild(h),c=$APP.y(c),h=null,g=0),k=0;else break;d=$APP.l(a,"__xDatePickerGridFocus");a=$APP.l(a,"__xDatePickerRefs");a=$APP.n(a)?$APP.l(a,"grid"):null;$APP.n($APP.n(a)?d:a)?(a=a.querySelector('[data-iso\x3d"'+$APP.T.g(d)+'"]'),a=$APP.n(a)?a.setAttribute("tabindex","0"):null):a=null;return a}}return null},
|
|
17
|
-
"input"):null;var c=$APP.l(a,"__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},
|
|
2
|
+
var XB=function(a){return typeof a==="string"?(a=a.trim(),$APP.O(a,"")?a:null):null},YB=function(a){return a!=null&&$APP.O(a,"false")},ZB=function(a){return a<10?"0"+$APP.T.g(a):""+$APP.T.g(a)},$B=function(a){return $APP.n(a)?""+$APP.T.g(a.getUTCFullYear())+"-"+$APP.T.g(ZB(a.getUTCMonth()+1))+"-"+$APP.T.g(ZB(a.getUTCDate())):null},aC=function(a){var b=(b=typeof a==="string")?$APP.xf(/\d{4}-\d{2}-\d{2}/,a):b;return $APP.n(b)?(a=new Date(""+$APP.T.g(a)+"T00:00:00.000Z"),$APP.n(isNaN(a.getTime()))?null:
|
|
3
|
+
a):null},bC=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},cC=function(a,b){return $APP.n(a)?new Date(a.getTime()+b*864E5):null},dC=function(a){return $APP.n(a)?new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1)):null},eC=function(a,b){if($APP.n(a)){var c=a.getUTCFullYear(),d=a.getUTCDate();a=a.getUTCMonth()+b;b=(new Date(Date.UTC(c,a+1,0))).getUTCDate();return new Date(Date.UTC(c,a,$APP.eg.h(d,b)))}return null},
|
|
4
|
+
fC=function(a,b,c){a=$APP.n($APP.n(b)?$APP.n(a)?bC(a,b)<0:a:b)?b:a;return $APP.n($APP.n(c)?$APP.n(a)?bC(a,c)>0:a:c)?c:a},gC=function(a,b,c){if($APP.n($APP.n(a)?$APP.n(b)?c:b:a)){var d=bC(b,c)<0?c:b;return!(bC(a,bC(b,c)<0?b:c)<0)&&!(bC(a,d)>0)}return null},jC=function(a,b){var c=$APP.N(b);b=$APP.I(c,hC);c=$APP.I(c,$APP.Wi);return $APP.n(a)?$APP.C.h(b,iC)?(new Intl.DateTimeFormat($APP.n(c)?c:"default",{year:"numeric",month:"long",day:"numeric",timeZone:"UTC"})).format(a):$B(a):null},mC=function(a){a=
|
|
5
|
+
XB(a);a=$APP.n(a)?aC(a):null;return new $APP.Q(null,2,[kC,a!=null,lC,a],null)},CC=function(a){var b=$APP.N(a),c=$APP.I(b,$APP.nh),d=$APP.I(b,$APP.hh),e=$APP.I(b,$APP.Ni);a=$APP.I(b,hC);var g=$APP.I(b,$APP.Wi),h=$APP.I(b,nC),k=$APP.I(b,$APP.U),m=$APP.I(b,$APP.Yh),q=$APP.I(b,$APP.qi),r=$APP.I(b,$APP.Yg),v=$APP.I(b,oC);b=$APP.C.h(m,"range")?pC:qC;a=$APP.C.h(a,"localized")?iC:rC;g=XB(g);m=function(){var A=XB(d);return $APP.n(A)?A:" - "}();e=aC(e);r=aC(r);v=$APP.K(v);h=$APP.K(h);if($APP.C.h(b,qC))return b=
|
|
6
|
+
aC(k),$APP.Xe([hC,sC,$APP.Wi,tC,$APP.Yh,uC,oC,vC,$APP.hh,wC,xC],[a,b,g,h,qC,r,v,b!=null,m,e,function(){var A=XB(k);return $APP.n(A)?A:""}()]);var w=aC(q),z=aC(c);b=w!=null&&z!=null;return $APP.Xe([yC,hC,zC,$APP.Wi,tC,$APP.Yh,uC,AC,BC,oC,vC,$APP.hh,wC],[function(){var A=XB(c);return $APP.n(A)?A:""}(),a,w,g,h,pC,r,function(){var A=XB(q);return $APP.n(A)?A:""}(),z,v,b,m,e])},EC=function(a){if($APP.n(a)){var b=dC(a),c=cC(b,-($APP.n(b)?b.getUTCDay():0));return $APP.Gd(function(d){d=cC(c,d);var e=$APP.C.h(d.getUTCMonth(),
|
|
7
|
+
a.getUTCMonth());return new $APP.Q(null,2,[lC,d,DC,e],null)},$APP.wf(0,42))}return null},FC=function(a){return document.createElement(a)},GC=function(a,b,c,d){b=new CustomEvent(b,{detail:d,bubbles:!0,composed:!0,cancelable:$APP.K(c)});a.dispatchEvent(b);return b},HC=function(a){var b=a.getAttribute("mode");$APP.C.h(b,"range");b=CC($APP.Xe([$APP.Ni,hC,$APP.Wi,nC,$APP.U,$APP.Yh,$APP.qi,$APP.Yg,oC,$APP.nh,$APP.hh],[a.getAttribute("min"),a.getAttribute("format"),a.getAttribute("locale"),YB(a.getAttribute("range-allow-same-day")),
|
|
8
|
+
a.getAttribute("value"),b,a.getAttribute("start"),a.getAttribute("max"),YB(a.getAttribute("auto-swap")),a.getAttribute("end"),a.getAttribute("separator")]));var c=new $APP.Q(null,2,[hC,hC.g(b),$APP.Wi,$APP.Wi.g(b)],null);var d=$APP.N(c);var e=$APP.I(d,hC);d=$APP.I(d,$APP.Wi);e=new $APP.Q(null,2,[hC,e,$APP.Wi,d],null);if($APP.C.h($APP.Yh.g(b),qC))e=$APP.n(sC.g(b))?jC(sC.g(b),e):"";else{d=$APP.hh.g(b);var g=zC.g(b);g=$APP.n(g)?BC.g(b):g;e=$APP.n(g)?""+$APP.T.g(jC(zC.g(b),e))+$APP.T.g(d)+$APP.T.g(jC(BC.g(b),
|
|
9
|
+
e)):$APP.n(zC.g(b))?jC(zC.g(b),e):""}d=$APP.l(a,"__xDatePickerState");d=$APP.n(d)?$APP.l(d,"month"):null;g=sC.g(b);$APP.n(g)||(g=zC.g(b),g=$APP.n(g)?g:new Date(Date.now()));d=$APP.n(d)?d:dC(g);a.__xDatePickerState={canon:b,cfg:c,disp:e,month:d}},IC=function(a,b){var c=wC.g(b);c=$APP.n(c)?bC(a,wC.g(b))<0:c;if($APP.n(c))return c;c=uC.g(b);return $APP.n(c)?bC(a,uC.g(b))>0:c},LC=function(a,b){if($APP.C.h($APP.Yh.g(b),qC))return new $APP.Q(null,3,[$APP.Ch,function(){var k=sC.g(b);return $APP.n(k)?$APP.C.h(0,
|
|
10
|
+
bC(a,sC.g(b))):k}(),JC,!1,KC,!1],null);var c=zC.g(b),d=BC.g(b),e=function(){var k=$APP.n(c)?$APP.C.h(0,bC(a,c)):c;return $APP.n(k)?k:$APP.n(d)?$APP.C.h(0,bC(a,d)):d}(),g=$APP.n(c)?$APP.n(d)?gC(a,c,d):d:c,h=function(){var k=$APP.n(c)?$APP.C.h(0,bC(a,c)):c;return $APP.n(k)?k:$APP.n(d)?$APP.C.h(0,bC(a,d)):d}();return new $APP.Q(null,3,[$APP.Ch,e,JC,g,KC,h],null)},MC=function(a,b){a.__xDatePickerGridFocus=b;a=$APP.l(a,"__xDatePickerRefs");a=$APP.n(a)?$APP.l(a,"grid"):null;if($APP.n(a)){var c=a.querySelector('[tabindex\x3d"0"]');
|
|
11
|
+
$APP.n(c)&&c.setAttribute("tabindex","-1");b=a.querySelector('[data-iso\x3d"'+$APP.T.g(b)+'"]');if($APP.n(b))return b.setAttribute("tabindex","0"),b.focus()}return null},NC=function(a){var b=$APP.l(a,"__xDatePickerRefs");if($APP.n(b)){var c=$APP.l(b,"month-label"),d=$APP.l(b,"grid"),e=$APP.l(b,"weekdays"),g=$APP.l(a,"__xDatePickerState");b=$APP.n(g)?$APP.l(g,"canon"):null;var h=$APP.n(g)?$APP.l(g,"month"):null;g=$APP.n(g)?$APP.l(g,"cfg"):null;g=$APP.n(g)?$APP.Wi.g(g):null;$APP.n(c)&&(h=(new Intl.DateTimeFormat($APP.n(g)?
|
|
12
|
+
g:"default",{year:"numeric",month:"long",timeZone:"UTC"})).format(h),c.textContent=h);if(!$APP.n($APP.l(a,"__xDatePickerWeekdaysDone")))for(a.__xDatePickerWeekdaysDone=!0,c="Su Mo Tu We Th Fr Sa".split(" "),h=0;;)if(h<7)g=FC("div"),g.setAttribute("part","weekday"),g.setAttribute("aria-hidden","true"),g.textContent=c[h],e.appendChild(g),h+=1;else break;if($APP.n($APP.n(d)?b:d)){d.textContent="";e=$APP.l(a,"__xDatePickerState");e=EC($APP.n(e)?$APP.l(e,"month"):null);c=$APP.u(e);h=null;for(var k=g=0;;)if(k<
|
|
13
|
+
g){e=h.D(null,k);e=$APP.N(e);var m=$APP.I(e,lC);e=$APP.I(e,DC);var q=FC("button"),r=$B(m),v=m.getUTCDate(),w=IC(m,b);m=LC(m,b);var z=$APP.N(m);m=$APP.I(z,$APP.Ch);var A=$APP.I(z,JC);z=$APP.I(z,KC);q.setAttribute("part","day");q.setAttribute("type","button");q.setAttribute("role","gridcell");q.setAttribute("data-iso",r);q.setAttribute("data-outside",$APP.n(e)?"false":"true");q.setAttribute("data-disabled",$APP.n(w)?"true":"false");q.setAttribute("data-selected",$APP.n(m)?"true":"false");q.setAttribute("data-in-range",
|
|
14
|
+
$APP.n(A)?"true":"false");q.setAttribute("data-range-edge",$APP.n(z)?"true":"false");q.setAttribute("aria-selected",$APP.n(m)?"true":"false");q.setAttribute("aria-disabled",$APP.n(w)?"true":"false");q.setAttribute("tabindex","-1");q.textContent=""+$APP.T.g(v);d.appendChild(q);k+=1}else if(e=$APP.u(c))c=e,$APP.uc(c)?(h=$APP.mb(c),c=$APP.nb(c),e=h,g=$APP.B(h),h=e):(e=$APP.x(c),e=$APP.N(e),m=$APP.I(e,lC),e=$APP.I(e,DC),h=FC("button"),g=$B(m),k=m.getUTCDate(),q=IC(m,b),m=LC(m,b),v=$APP.N(m),m=$APP.I(v,
|
|
15
|
+
$APP.Ch),r=$APP.I(v,JC),v=$APP.I(v,KC),h.setAttribute("part","day"),h.setAttribute("type","button"),h.setAttribute("role","gridcell"),h.setAttribute("data-iso",g),h.setAttribute("data-outside",$APP.n(e)?"false":"true"),h.setAttribute("data-disabled",$APP.n(q)?"true":"false"),h.setAttribute("data-selected",$APP.n(m)?"true":"false"),h.setAttribute("data-in-range",$APP.n(r)?"true":"false"),h.setAttribute("data-range-edge",$APP.n(v)?"true":"false"),h.setAttribute("aria-selected",$APP.n(m)?"true":"false"),
|
|
16
|
+
h.setAttribute("aria-disabled",$APP.n(q)?"true":"false"),h.setAttribute("tabindex","-1"),h.textContent=""+$APP.T.g(k),d.appendChild(h),c=$APP.y(c),h=null,g=0),k=0;else break;d=$APP.l(a,"__xDatePickerGridFocus");a=$APP.l(a,"__xDatePickerRefs");a=$APP.n(a)?$APP.l(a,"grid"):null;$APP.n($APP.n(a)?d:a)?(a=a.querySelector('[data-iso\x3d"'+$APP.T.g(d)+'"]'),a=$APP.n(a)?a.setAttribute("tabindex","0"):null):a=null;return a}}return null},OC=function(a){var b=$APP.l(a,"__xDatePickerRefs");b=$APP.n(b)?$APP.l(b,
|
|
17
|
+
"input"):null;var c=$APP.l(a,"__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},PC=function(a){var b=$APP.l(a,"__xDatePickerRefs");if($APP.n(b)){var c=$APP.l(b,"input");b=$APP.l(b,"btn");var d=a.hasAttribute("disabled"),e=a.hasAttribute("readonly"),g=a.getAttribute("placeholder"),h=a.getAttribute("aria-label"),k=a.getAttribute("aria-describedby"),m=a.hasAttribute("open");$APP.n(b)&&($APP.n(d)?
|
|
18
18
|
b.setAttribute("disabled",""):b.removeAttribute("disabled"));$APP.n($APP.n(d)?m:d)&&a.removeAttribute("open");$APP.n(c)&&(c.setAttribute("aria-expanded",$APP.n(m)?"true":"false"),$APP.n(d)?(c.setAttribute("disabled",""),c.setAttribute("aria-disabled","true")):(c.removeAttribute("disabled"),c.removeAttribute("aria-disabled")),$APP.n(e)&&c.setAttribute("readonly",""),$APP.n(e)||c.removeAttribute("readonly"),$APP.n(g)&&c.setAttribute("placeholder",g),$APP.n(h)&&c.setAttribute("aria-label",h),$APP.n(k)&&
|
|
19
|
-
c.setAttribute("aria-describedby",k));
|
|
20
|
-
if($APP.C.h(e,
|
|
21
|
-
$APP.n(
|
|
22
|
-
$APP.l(b,"canon"):null;var v=$APP.n(
|
|
23
|
-
mode:c});if($APP.C.h(g,
|
|
24
|
-
(g=d.indexOf(e),g<0?(d=
|
|
25
|
-
e);a.setAttribute("end",g);a.__xDatePickerRangeStep=0;
|
|
26
|
-
b){if($APP.n(a.hasAttribute("disabled")))return null;b=b.currentTarget.getAttribute("data-nav");return $APP.C.h(b,"prev")?
|
|
27
|
-
-7);case "ArrowDown":return
|
|
28
|
-
$APP.n(e)?$APP.p(a.hasAttribute("readonly")):e:m}())?(b.preventDefault(),$APP.n(
|
|
29
|
-
$APP.n($APP.n(R)?R:a.hasAttribute("readonly"))?E=null:(E=E.target.closest("button[data-iso]"),$APP.n($APP.n(E)?$APP.O("true",E.getAttribute("data-disabled")):E)?(E=E.getAttribute("data-iso"),E=
|
|
30
|
-
"__xDatePickerState");E=$APP.n(E)?$APP.l(E,"canon"):null;var R=
|
|
31
|
-
"__xDatePickerRefs");E=$APP.n(E)?$APP.l(E,"input"):null;var R=$APP.l(a,"__xDatePickerState");R=$APP.C.h($APP.
|
|
32
|
-
r);z.addEventListener("focus",q);z.addEventListener("blur",m);A.addEventListener("click",k);D.addEventListener("click",h);
|
|
19
|
+
c.setAttribute("aria-describedby",k));OC(a);return NC(a)}return null},QC=function(a,b){$APP.n(b)?a.setAttribute("value",$B(b)):a.removeAttribute("value")},RC=function(a,b,c){if($APP.n(a.hasAttribute("readonly")))return null;var d=$APP.l(a,"__xDatePickerState");d=$APP.n(d)?$APP.l(d,"canon"):null;var e=$APP.n(d)?$APP.Yh.g(d):null,g=$APP.C.h(e,pC)?"range":"single",h=$APP.C.h(e,qC)?{value:$B(b),mode:g,reason:c}:{date:$B(b),mode:g,reason:c};h=GC(a,"x-date-picker-change-request",!0,h);if($APP.n(h.defaultPrevented))return null;
|
|
20
|
+
if($APP.C.h(e,qC))return d=$B(b),QC(a,b),HC(a),PC(a),GC(a,"x-date-picker-change",!1,{value:d,mode:g,reason:c}),$APP.n(a.hasAttribute("close-on-select"))?(a.removeAttribute("open"),PC(a)):null;e=function(){var z=$APP.l(a,"__xDatePickerRangeStep");return $APP.n(z)?z:0}();h=zC.g(d);BC.g(d);if($APP.C.h(e,0))a.setAttribute("start",$B(b)),a.removeAttribute("end"),a.__xDatePickerRangeStep=1;else if($APP.C.h(e,1)){var k=tC.g(d),m=bC(b,h);if($APP.n(function(){var z=m>0;return z?z:$APP.n(k)?m===0:k}())){var q=
|
|
21
|
+
$APP.n(oC.g(d))?bC(h,b)<0?h:b:h,r=$APP.n(oC.g(d))?bC(h,b)>0?h:b:b;a.setAttribute("start",$B(q));a.setAttribute("end",$B(r));a.__xDatePickerRangeStep=0;$APP.n(function(){var z=a.hasAttribute("close-on-select");return $APP.n(z)?q!=null&&r!=null:z}())&&a.removeAttribute("open")}else a.setAttribute("start",$B(b)),a.removeAttribute("end"),a.__xDatePickerRangeStep=1}else a.setAttribute("start",$B(b)),a.removeAttribute("end"),a.__xDatePickerRangeStep=1;HC(a);PC(a);b=$APP.l(a,"__xDatePickerState");b=$APP.n(b)?
|
|
22
|
+
$APP.l(b,"canon"):null;var v=$APP.n(zC.g(b))?$B(zC.g(b)):null,w=$APP.n(BC.g(b))?$B(BC.g(b)):null;b=function(){var z={mode:g,reason:c};$APP.n(v)&&(z.start=v);$APP.n(w)&&(z.end=w);return z}();return GC(a,"x-date-picker-change",!1,b)},SC=function(a,b){var c=$APP.l(a,"__xDatePickerRefs");c=$APP.n(c)?$APP.l(c,"input"):null;var d=$APP.n(c)?c.value:null;c=$APP.l(a,"__xDatePickerState");var e=$APP.n(c)?$APP.l(c,"canon"):null,g=$APP.Yh.g(e);c=$APP.C.h(g,pC)?"range":"single";GC(a,"x-date-picker-input",!1,{value:d,
|
|
23
|
+
mode:c});if($APP.C.h(g,qC)){if(d=mC(d),e=$APP.N(d),d=$APP.I(e,kC),e=$APP.I(e,lC),$APP.n(d)){g=$B(e);d=GC(a,"x-date-picker-change-request",!0,{value:g,mode:c,reason:b});if($APP.n(d.defaultPrevented))return null;QC(a,e);HC(a);PC(a);return GC(a,"x-date-picker-change",!1,{value:g,mode:c,reason:b})}}else if(e=new $APP.Q(null,1,[$APP.hh,$APP.hh.g(e)],null),e=$APP.N(e),e=$APP.I(e,$APP.hh),e=typeof e==="string"&&e.length>0?e:" - ",d=XB(d),d==null?d=new $APP.Q(null,3,[kC,!1,$APP.qi,null,$APP.nh,null],null):
|
|
24
|
+
(g=d.indexOf(e),g<0?(d=mC(d),e=$APP.N(d),d=$APP.I(e,kC),e=$APP.I(e,lC),d=new $APP.Q(null,3,[kC,d,$APP.qi,e,$APP.nh,null],null)):(e=d.substring(g+e.length).trim(),d=aC(d.substring(0,g).trim()),e=aC(e),d=new $APP.Q(null,3,[kC,d!=null&&e!=null,$APP.qi,d,$APP.nh,e],null))),g=$APP.N(d),d=$APP.I(g,kC),e=$APP.I(g,$APP.qi),g=$APP.I(g,$APP.nh),$APP.n(d)){e=$B(e);g=$B(g);d=GC(a,"x-date-picker-change-request",!0,{start:e,end:g,mode:c,reason:b});if($APP.n(d.defaultPrevented))return null;a.setAttribute("start",
|
|
25
|
+
e);a.setAttribute("end",g);a.__xDatePickerRangeStep=0;HC(a);PC(a);return GC(a,"x-date-picker-change",!1,{start:e,end:g,mode:c,reason:b})}return null},UC=function(a,b){var c=$APP.l(a,"__xDatePickerState"),d=$APP.n(c)?$APP.l(c,"month"):null;if($APP.n(d)){var e=d.getUTCFullYear();d=d.getUTCMonth();b=$APP.C.h(b,TC)?new Date(Date.UTC(e,d+1,1)):new Date(Date.UTC(e,d-1,1));c.month=b;return NC(a)}return null},VC=function(a){return $APP.n(a.hasAttribute("open"))?a.removeAttribute("open"):null},XC=function(a,
|
|
26
|
+
b){if($APP.n(a.hasAttribute("disabled")))return null;b=b.currentTarget.getAttribute("data-nav");return $APP.C.h(b,"prev")?UC(a,WC):UC(a,TC)},YC=function(a,b){if($APP.n(a.hasAttribute("disabled")))return null;var c=b.key,d=$APP.l(a,"__xDatePickerGridFocus"),e=$APP.n(d)?aC(d):null;d=$APP.l(a,"__xDatePickerState");var g=$APP.n(d)?$APP.l(d,"canon"):null,h=$APP.n(d)?$APP.l(d,"month"):null,k=$APP.n(e)?function(){switch(c){case "ArrowLeft":return cC(e,-1);case "ArrowRight":return cC(e,1);case "ArrowUp":return cC(e,
|
|
27
|
+
-7);case "ArrowDown":return cC(e,7);case "PageUp":return eC(e,-1);case "PageDown":return eC(e,1);case "Home":return $APP.n(e)?cC(e,-($APP.n(e)?e.getUTCDay():0)):null;case "End":return $APP.n(e)?cC(e,6-($APP.n(e)?e.getUTCDay():0)):null;default:return null}}():null;return k!=null?(b.preventDefault(),b=fC(k,wC.g(g),uC.g(g)),g=$B(b),$APP.n($APP.n(h)?$APP.O(b.getUTCMonth(),h.getUTCMonth()):h)&&($APP.la(d,"month",dC(b)),NC(a)),MC(a,g)):$APP.n(function(){var m=$APP.C.h(c,"Enter")||$APP.C.h(c," ");return m?
|
|
28
|
+
$APP.n(e)?$APP.p(a.hasAttribute("readonly")):e:m}())?(b.preventDefault(),$APP.n(IC(e,g))?null:RC(a,e,"keyboard")):$APP.C.h(c,"Escape")?(b.preventDefault(),VC(a),d=$APP.l(a,"__xDatePickerRefs"),d=$APP.n(d)?$APP.l(d,"input"):null,$APP.n(d)?d.focus():null):null},ZC=function(a){function b(E){return $APP.n(a.hasAttribute("open"))?$APP.n(E.composedPath().some(function(R){return R===a}))?null:VC(a):null}function c(E){return E.preventDefault()}function d(E){return YC(a,E)}function e(E){var R=a.hasAttribute("disabled");
|
|
29
|
+
$APP.n($APP.n(R)?R:a.hasAttribute("readonly"))?E=null:(E=E.target.closest("button[data-iso]"),$APP.n($APP.n(E)?$APP.O("true",E.getAttribute("data-disabled")):E)?(E=E.getAttribute("data-iso"),E=aC(E),E=$APP.n(E)?RC(a,E,"click"):null):E=null);return E}function g(E){return XC(a,E)}function h(E){return XC(a,E)}function k(){if($APP.n(a.hasAttribute("disabled")))var E=null;else if($APP.n(a.hasAttribute("open")))E=VC(a);else if($APP.n(a.hasAttribute("open")))E=null;else{a.setAttribute("open","");E=$APP.l(a,
|
|
30
|
+
"__xDatePickerState");E=$APP.n(E)?$APP.l(E,"canon"):null;var R=sC.g(E);$APP.n(R)?E=R:(E=zC.g(E),E=$APP.n(E)?E:new Date(Date.now()));E=$B(E);E=MC(a,E)}return E}function m(){a.__xDatePickerFocused=!1;$APP.n(a.hasAttribute("disabled"))||SC(a,"blur");return OC(a)}function q(){a.__xDatePickerFocused=!0}function r(E){if($APP.n(a.hasAttribute("disabled")))E=null;else{var R=E.key;$APP.C.h(R,"Enter")?(E.preventDefault(),E=SC(a,"keyboard")):E=$APP.C.h(R,"Escape")?VC(a):null}return E}function v(){var E=$APP.l(a,
|
|
31
|
+
"__xDatePickerRefs");E=$APP.n(E)?$APP.l(E,"input"):null;var R=$APP.l(a,"__xDatePickerState");R=$APP.C.h($APP.Yh.g($APP.n(R)?$APP.l(R,"canon"):null),pC)?"range":"single";a.__xDatePickerDisplay=$APP.n(E)?E.value:null;return GC(a,"x-date-picker-input",!1,{value:$APP.n(E)?E.value:null,mode:R})}var w=$APP.l(a,"__xDatePickerRefs"),z=$APP.l(w,"input"),A=$APP.l(w,"btn"),D=$APP.l(w,"nav-prev"),G=$APP.l(w,"nav-next"),J=$APP.l(w,"grid");w=$APP.l(w,"popover");z.addEventListener("input",v);z.addEventListener("keydown",
|
|
32
|
+
r);z.addEventListener("focus",q);z.addEventListener("blur",m);A.addEventListener("click",k);D.addEventListener("click",h);G.addEventListener("click",g);J.addEventListener("click",e);J.addEventListener("keydown",d);w.addEventListener("mousedown",c);document.addEventListener("pointerdown",b,!0);$APP.la(a,"__xDatePickerHandlers",{"pop-md":c,keydown:r,grid:e,"grid-kd":d,next:g,blur:m,prev:h,focus:q,input:v,btn:k,"doc-click":b})},$C=function(a){var b=$APP.l(a,"__xDatePickerRefs");a=$APP.l(a,"__xDatePickerHandlers");
|
|
33
33
|
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"),g=$APP.l(b,"nav-next"),h=$APP.l(b,"grid");b=$APP.l(b,"popover");c.removeEventListener("input",$APP.l(a,"input"));c.removeEventListener("keydown",$APP.l(a,"keydown"));c.removeEventListener("focus",$APP.l(a,"focus"));c.removeEventListener("blur",$APP.l(a,"blur"));d.removeEventListener("click",$APP.l(a,"btn"));e.removeEventListener("click",$APP.l(a,"prev"));g.removeEventListener("click",$APP.l(a,"next"));h.removeEventListener("click",
|
|
34
|
-
$APP.l(a,"grid"));h.removeEventListener("keydown",$APP.l(a,"grid-kd"));b.removeEventListener("mousedown",$APP.l(a,"pop-md"));return document.removeEventListener("pointerdown",$APP.l(a,"doc-click"),!0)}return null},
|
|
35
|
-
b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.n(d)?this.setAttribute(c,""):this.removeAttribute(c)}})},
|
|
36
|
-
(this.removeAttribute("start"),this.removeAttribute("end"));
|
|
34
|
+
$APP.l(a,"grid"));h.removeEventListener("keydown",$APP.l(a,"grid-kd"));b.removeEventListener("mousedown",$APP.l(a,"pop-md"));return document.removeEventListener("pointerdown",$APP.l(a,"doc-click"),!0)}return null},aD=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.O(d,"")?this.setAttribute(c,d):this.removeAttribute(c)}})},bD=function(a,b,c){Object.defineProperty(a,
|
|
35
|
+
b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.n(d)?this.setAttribute(c,""):this.removeAttribute(c)}})},cD=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 SC(this,"programmatic")};a.clear=function(){var b=$APP.l(this,"__xDatePickerState");$APP.C.h($APP.Yh.g($APP.n(b)?$APP.l(b,"canon"):null),qC)?this.removeAttribute("value"):
|
|
36
|
+
(this.removeAttribute("start"),this.removeAttribute("end"));HC(this);return PC(this)}},eD=function(){var a=class extends HTMLElement{},b=a.prototype;a.observedAttributes=dD;b.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xDatePickerRefs"))){var c=this.attachShadow({mode:"open"}),d=FC("style"),e=FC("div"),g=FC("input"),h=FC("button"),k=FC("div"),m=FC("div"),q=FC("button"),r=FC("div"),v=FC("button"),w=FC("div"),z=FC("div"),A=FC("div");d.textContent=":host{display:block;color-scheme:light dark;}[part\x3dcontainer]{position:relative;display:flex;align-items:stretch;gap:8px;width:100%;}[part\x3dinput]{flex:1;min-width:0;appearance:none;box-sizing:border-box;border:1px solid var(--x-date-picker-border,#cbd5e1);border-radius:var(--x-date-picker-radius,8px);padding:8px 12px;font-size:0.9375rem;background:var(--x-date-picker-input-bg,#fff);color:var(--x-date-picker-text,inherit);outline:none;}[part\x3dinput]:focus{border-color:var(--x-date-picker-focus,#60a5fa);box-shadow:0 0 0 3px rgba(96,165,250,0.25);}[part\x3dinput][disabled]{opacity:0.5;cursor:default;}[part\x3dbtn][disabled]{opacity:0.5;cursor:default;pointer-events:none;}[part\x3dinput]::placeholder{color:var(--x-date-picker-placeholder,#94a3b8);}[part\x3dbtn]{all:unset;cursor:pointer;flex:0 0 auto;width:42px;height:42px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--x-date-picker-border,#cbd5e1);border-radius:var(--x-date-picker-radius,8px);background:var(--x-date-picker-btn-bg,#f8fafc);color:var(--x-date-picker-text,inherit);box-sizing:border-box;}[part\x3dbtn]:hover{background:var(--x-date-picker-btn-hover,#f1f5f9);}[part\x3dbtn]:focus-visible{outline:2px solid var(--x-date-picker-focus,#60a5fa);}[part\x3dpopover]{display:none;position:absolute;z-index:1000;top:calc(100% + 8px);left:0;background:var(--x-date-picker-popover-bg,#fff);border:1px solid var(--x-date-picker-border,#e2e8f0);border-radius:var(--x-date-picker-popover-radius,12px);box-shadow:0 8px 32px rgba(0,0,0,0.12),0 2px 8px rgba(0,0,0,0.06);padding:16px;width:var(--x-date-picker-popover-width,304px);box-sizing:border-box;}:host([open]) [part\x3dpopover]{display:block;}[part\x3dnav]{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;}[part\x3dnavbtn]{all:unset;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:6px;color:var(--x-date-picker-text,inherit);}[part\x3dnavbtn]:hover{background:var(--x-date-picker-nav-hover,#f1f5f9);}[part\x3dnavbtn]:focus-visible{outline:2px solid var(--x-date-picker-focus,#60a5fa);}[part\x3dmonthlabel]{font-weight:600;font-size:0.9375rem;}[part\x3dweekdays]{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;margin-bottom:4px;}[part\x3dweekday]{text-align:center;font-size:0.75rem;font-weight:600;color:var(--x-date-picker-weekday,#94a3b8);padding:4px 0;}[part\x3dgrid]{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;}[part\x3dday]{all:unset;cursor:pointer;box-sizing:border-box;display:flex;align-items:center;justify-content:center;height:36px;border-radius:6px;font-size:0.875rem;color:var(--x-date-picker-day-text,inherit);}[part\x3dday]:hover:not([disabled]){background:var(--x-date-picker-day-hover,#f1f5f9);}[part\x3dday]:focus-visible{outline:2px solid var(--x-date-picker-focus,#60a5fa);}[part\x3dday][data-outside\x3dtrue]{opacity:0.4;}[part\x3dday][data-disabled\x3dtrue]{opacity:0.3;cursor:default;pointer-events:none;}[part\x3dday][data-selected\x3dtrue]{background:var(--x-date-picker-selected-bg,#2563eb);color:var(--x-date-picker-selected-text,#fff);font-weight:600;}[part\x3dday][data-in-range\x3dtrue]:not([data-range-edge\x3dtrue]){background:var(--x-date-picker-range-bg,#dbeafe);color:var(--x-date-picker-range-text,#1e40af);border-radius:0;}[part\x3dday][data-range-edge\x3dtrue]{background:var(--x-date-picker-selected-bg,#2563eb);color:var(--x-date-picker-selected-text,#fff);font-weight:600;}[part\x3dsr-status]{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;}@media (prefers-color-scheme:dark){:host{--x-date-picker-border:#334155;--x-date-picker-input-bg:#0f172a;--x-date-picker-btn-bg:#1e293b;--x-date-picker-btn-hover:#334155;--x-date-picker-popover-bg:#1e293b;--x-date-picker-day-hover:#334155;--x-date-picker-selected-bg:#3b82f6;--x-date-picker-range-bg:#1e3a8a;--x-date-picker-range-text:#93c5fd;--x-date-picker-nav-hover:#334155;}}@media (prefers-reduced-motion:reduce){[part\x3dpopover]{transition:none;}}";
|
|
37
37
|
e.setAttribute("part","container");g.setAttribute("part","input");g.setAttribute("type","text");g.setAttribute("inputmode","none");g.setAttribute("autocomplete","off");g.setAttribute("role","combobox");g.setAttribute("aria-haspopup","dialog");g.setAttribute("aria-expanded","false");h.setAttribute("part","btn");h.setAttribute("type","button");h.setAttribute("aria-label","Open calendar");h.textContent="\ud83d\udcc5";k.setAttribute("part","popover");k.setAttribute("role","dialog");k.setAttribute("aria-modal",
|
|
38
38
|
"true");k.setAttribute("aria-label","Calendar");m.setAttribute("part","nav");q.setAttribute("part","navbtn");q.setAttribute("data-nav","prev");q.setAttribute("type","button");q.setAttribute("aria-label","Previous month");q.textContent="‹";r.setAttribute("part","monthlabel");r.setAttribute("aria-live","polite");v.setAttribute("part","navbtn");v.setAttribute("data-nav","next");v.setAttribute("type","button");v.setAttribute("aria-label","Next month");v.textContent="›";w.setAttribute("part","weekdays");
|
|
39
39
|
w.setAttribute("aria-hidden","true");z.setAttribute("part","grid");z.setAttribute("role","grid");z.setAttribute("aria-label","Calendar grid");A.setAttribute("part","sr-status");A.setAttribute("aria-live","polite");A.setAttribute("aria-atomic","true");m.appendChild(q);m.appendChild(r);m.appendChild(v);k.appendChild(m);k.appendChild(w);k.appendChild(z);k.appendChild(A);e.appendChild(g);e.appendChild(h);e.appendChild(k);c.appendChild(d);c.appendChild(e);this.__xDatePickerRefs={weekdays:w,grid:z,popover:k,
|
|
40
|
-
"nav-next":v,"month-label":r,input:g,btn:h,sr:A,"nav-prev":q}}
|
|
41
|
-
|
|
42
|
-
-814680979),
|
|
43
|
-
-1597069226),
|
|
40
|
+
"nav-next":v,"month-label":r,input:g,btn:h,sr:A,"nav-prev":q}}$C(this);ZC(this);HC(this);return PC(this)};b.disconnectedCallback=function(){return $C(this)};b.attributeChangedCallback=function(){HC(this);return PC(this)};aD(b,"mode","mode");aD(b,"value","value");aD(b,"start","start");aD(b,"end","end");bD(b,"open","open");bD(b,"disabled","disabled");bD(b,"readOnly","readonly");bD(b,"required","required");cD(b);return a},fD=function(){return $APP.n(customElements.get("x-date-picker"))?null:customElements.define("x-date-picker",
|
|
41
|
+
eD())},zC=new $APP.M(null,"start-d","start-d",-1546785820),kC=new $APP.M(null,"ok?","ok?",447310304),lC=new $APP.M(null,"date","date",-1463434462),oC=new $APP.M(null,"auto-swap?","auto-swap?",-1675454411),yC=new $APP.M(null,"end-str","end-str",-558112319),iC=new $APP.M(null,"localized","localized",1722109655),KC=new $APP.M(null,"edge?","edge?",203916303),xC=new $APP.M(null,"value-str","value-str",989198845),vC=new $APP.M(null,"complete?","complete?",-892991879),uC=new $APP.M(null,"max-d","max-d",
|
|
42
|
+
-814680979),qC=new $APP.M(null,"single","single",1551466437),AC=new $APP.M(null,"start-str","start-str",1077409677),pC=new $APP.M(null,"range","range",1639692286),rC=new $APP.M(null,"iso","iso",-1366207543),DC=new $APP.M(null,"in-month?","in-month?",-1630426251),wC=new $APP.M(null,"min-d","min-d",-1118792932),hC=new $APP.M(null,"format","format",-1306924766),sC=new $APP.M(null,"value-d","value-d",-1768534876),JC=new $APP.M(null,"in-range?","in-range?",-291779262),WC=new $APP.M(null,"prev","prev",
|
|
43
|
+
-1597069226),TC=new $APP.M(null,"next","next",-117701485),BC=new $APP.M(null,"end-d","end-d",-1316370898),tC=new $APP.M(null,"allow-same-day?","allow-same-day?",-1971558934),nC=new $APP.M(null,"range-allow-same-day?","range-allow-same-day?",-714516856);var dD="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 open".split(" ");$APP.ja("baredom.exports.x_date_picker.init",fD);export const init=fD;
|
package/dist/x-divider.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
$APP.C.h($APP.l(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
var lB=function(a,b){if(a!=null&&a.dc!=null)a.dc(a,b);else{var c=lB[$APP.ca(a==null?null:a)];if(c!=null)c.h?c.h(a,b):c.call(null,a,b);else if(c=lB._,c!=null)c.h?c.h(a,b):c.call(null,a,b);else throw $APP.qa("IReset.-reset!",a);}},mB=function(){this.Ub=this.lc=this.u=this.state=null;this.C=16386;this.l=6455296},nB=function(a,b){if(a instanceof mB){var c=a.lc;if(c!=null&&!$APP.n(c.g?c.g(b):c.call(null,b)))throw Error("Validator rejected reference state");c=a.state;a.state=b;if(a.Ub!=null)a:for(var d=
|
|
3
|
+
$APP.u(a.Ub),e=null,g=0,h=0;;)if(h<g){var k=e.D(null,h),m=$APP.H(k,0,null);k=$APP.H(k,1,null);k.X?k.X(m,a,c,b):k.call(null,m,a,c,b);h+=1}else if(d=$APP.u(d))$APP.uc(d)?(e=$APP.mb(d),d=$APP.nb(d),m=e,g=$APP.B(e),e=m):(e=$APP.x(d),m=$APP.H(e,0,null),k=$APP.H(e,1,null),k.X?k.X(m,a,c,b):k.call(null,m,a,c,b),d=$APP.y(d),e=null,g=0),h=0;else break a}else lB(a,b)},oB=function(a,b,c){c=typeof c==="string"?c.trim().toLowerCase():null;return $APP.yc(a,c)?c:b},pB=function(a){for(;;){var b=a.firstChild;if($APP.n(b))a.removeChild(b);
|
|
4
|
+
else break}},BB=function(a){var b=$APP.Xe([$APP.xh,$APP.Wg,$APP.wh,qB,rB,sB,tB,$APP.di,$APP.wi,uB],[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"),a.getAttribute("role")]),c=$APP.N(b);b=$APP.I(c,$APP.wi);var d=$APP.I(c,uB),e=$APP.I(c,$APP.Wg);var g=$APP.I(c,$APP.xh);var h=$APP.I(c,$APP.wh),k=$APP.I(c,qB),m=$APP.I(c,
|
|
5
|
+
rB),q=$APP.I(c,sB),r=$APP.I(c,tB);c=$APP.I(c,$APP.di);g=$APP.Xe([$APP.Pg,$APP.Xh,vB,wB,$APP.oi,$APP.Ng,$APP.th,$APP.W,xB,$APP.Uh],[d,oB(yB,"center",h),m,r,q,oB(zB,"solid",g),oB(AB,"horizontal",c),e,k,b]);c=$APP.N(g);d=$APP.I(c,$APP.Uh);h=$APP.I(c,$APP.Xh);k=$APP.I(c,vB);m=$APP.I(c,wB);q=$APP.I(c,$APP.oi);r=$APP.I(c,$APP.Ng);e=$APP.I(c,$APP.th);b=$APP.I(c,$APP.W);var v=$APP.I(c,xB);c=typeof b==="string"&&b.trim().length>0;var w=a.style;a.setAttribute("data-orientation",e);a.setAttribute("data-variant",
|
|
6
|
+
r);a.setAttribute("data-align",h);w.setProperty("--x-divider-thickness",$APP.n(k)?k:"1px");w.setProperty("--x-divider-inset",$APP.n(m)?m:"0px");w.setProperty("--x-divider-length",$APP.n(v)?v:"auto");$APP.n(q)?w.setProperty("--x-divider-color",q):w.removeProperty("--x-divider-color");g=$APP.Pg.g(g);$APP.yc(new $APP.S(null,new $APP.Q(null,2,["none",null,"presentation",null],null),null),g)?a.setAttribute("role","presentation"):a.setAttribute("role","separator");$APP.C.h(e,"vertical")?a.setAttribute("aria-orientation",
|
|
7
|
+
"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.C.h($APP.l(d,"mode"),"no-label")&&(e=$APP.l(d,"container"),pB(e),g=document.createElement("div"),h=document.createElement("span"),k=document.createElement("slot"),m=document.createElement("span"),q=document.createElement("div"),g.setAttribute("part","line-left"),h.setAttribute("part","label"),k.setAttribute("name","label"),
|
|
8
|
+
m.setAttribute("part","label-text"),q.setAttribute("part","line-right"),h.appendChild(k),h.appendChild(m),e.appendChild(g),e.appendChild(h),e.appendChild(q),d["line-left"]=g,d["label-wrap"]=h,d["label-text"]=m,d["line-right"]=q,d.mode="label"),a=$APP.l($APP.l(a,"__xDividerRefs"),"label-text"),$APP.n(a)&&(a.textContent=b)):(a=$APP.l(a,"__xDividerRefs"),$APP.C.h($APP.l(a,"mode"),"label")&&(b=$APP.l(a,"container"),pB(b),d=document.createElement("div"),d.setAttribute("part","line"),b.appendChild(d),a["line-left"]=
|
|
9
|
+
null,a["label-wrap"]=null,a["label-text"]=null,a["line-right"]=null,a.mode="no-label"));return null},CB=function(a,b){Object.defineProperty(a,b,{get:function(){return this.getAttribute(b)},set:function(c){return c!=null?this.setAttribute(b,""+$APP.T.g(c)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},DB=function(a,b,c){Object.defineProperty(a,b,{get:function(){var d=this.getAttribute(b);return $APP.n(d)?d:c},set:function(d){return d!=null?this.setAttribute(b,""+$APP.T.g(d)):this.removeAttribute(b)},
|
|
10
|
+
enumerable:!0,configurable:!0})},EB=function(a){DB(a,"orientation","horizontal");DB(a,"variant","solid");DB(a,"align","center");CB(a,"label");CB(a,"thickness");CB(a,"color");CB(a,"inset");CB(a,"length")},FB=function(){function a(){return Reflect.construct(HTMLElement,[],$APP.Pa(b))}var b=new mB;nB(b,a);return a},HB=function(){if($APP.n(customElements.get("x-divider")))return null;var a=Object.create(HTMLElement.prototype),b=FB();Object.setPrototypeOf(b,HTMLElement);a.constructor=b;EB(a);a.connectedCallback=
|
|
11
|
+
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;}}";
|
|
12
|
+
e.setAttribute("part","container");var g=document.createElement("div");g.setAttribute("part","line");e.appendChild(g);c.appendChild(d);c.appendChild(e);this.__xDividerRefs={root:c,container:e,mode:"no-label"}}return BB(this)};a.disconnectedCallback=function(){return null};a.attributeChangedCallback=function(c,d,e){return $APP.O(d,e)?$APP.n($APP.l(this,"__xDividerRefs"))?BB(this):null:null};b.observedAttributes=GB;b.prototype=a;return customElements.define("x-divider",b)},IB=function(){return HB()};
|
|
13
|
+
$APP.f=mB.prototype;$APP.f.M=function(a,b){return this===b};$APP.f.Fb=function(){return this.state};$APP.f.R=function(){return this.u};$APP.f.P=function(){return $APP.fa(this)};$APP.f.V=$APP.t;$APP.f.N=function(a,b,c){$APP.cb(b,"#object[cljs.core.Atom ");$APP.Hf(new $APP.Q(null,1,[$APP.ui,this.state],null),b,c);return $APP.cb(b,"]")};
|
|
14
|
+
var qB=new $APP.M(null,"length-raw","length-raw",-1832244116),tB=new $APP.M(null,"inset-raw","inset-raw",89351124),wB=new $APP.M(null,"inset","inset",-396367740),vB=new $APP.M(null,"thickness","thickness",-940175454),rB=new $APP.M(null,"thickness-raw","thickness-raw",1843812655),uB=new $APP.M(null,"role-raw","role-raw",777951354),xB=new $APP.M(null,"length","length",588987862),sB=new $APP.M(null,"color-raw","color-raw",1277647215);var GB="orientation variant thickness color inset length label align role aria-label".split(" "),AB=new $APP.S(null,new $APP.Q(null,2,["vertical",null,"horizontal",null],null),null),zB=new $APP.S(null,new $APP.Q(null,3,["dashed",null,"dotted",null,"solid",null],null),null),yB=new $APP.S(null,new $APP.Q(null,3,["center",null,"start",null,"end",null],null),null);$APP.ja("baredom.exports.x_divider.init",IB);export const init=IB;
|
package/dist/x-drawer.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
2
|
+
var Wt=function(a){var b=$APP.l(a,"__xDrawerRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),g=document.createElement("div"),h=document.createElement("slot"),k=document.createElement("div"),m=document.createElement("slot"),q=document.createElement("div"),r=document.createElement("slot");c.textContent=":host{display:contents;color-scheme:light dark;--x-drawer-size:20rem;--x-drawer-bg:Canvas;--x-drawer-fg:CanvasText;--x-drawer-backdrop:rgb(0 0 0/0.4);--x-drawer-shadow:0 8px 24px rgb(0 0 0/0.18);--x-drawer-duration:200ms;--x-drawer-easing:ease;--x-drawer-z:1000;--x-drawer-header-padding:1rem 1.25rem;--x-drawer-body-padding:1rem 1.25rem;--x-drawer-footer-padding:0.75rem 1.25rem;--x-drawer-border:color-mix(in srgb,currentColor 12%,transparent);}[part\x3dbackdrop]{display:none;position:fixed;inset:0;background:var(--x-drawer-backdrop);z-index:var(--x-drawer-z);}:host([data-open\x3dtrue]) [part\x3dbackdrop]{display:block;}[part\x3dpanel]{position:fixed;background:var(--x-drawer-bg);color:var(--x-drawer-fg);box-shadow:var(--x-drawer-shadow);display:flex;flex-direction:column;overflow:hidden;z-index:calc(var(--x-drawer-z) + 1);transition:transform var(--x-drawer-duration) var(--x-drawer-easing);}:host([data-placement\x3dleft]) [part\x3dpanel],:host([data-placement\x3dright]) [part\x3dpanel]{top:0;bottom:0;width:var(--x-drawer-size);max-width:100vw;}:host([data-placement\x3dleft]) [part\x3dpanel]{left:0;transform:translateX(-100%);}:host([data-placement\x3dright]) [part\x3dpanel]{right:0;transform:translateX(100%);}:host([data-placement\x3dtop]) [part\x3dpanel],:host([data-placement\x3dbottom]) [part\x3dpanel]{left:0;right:0;height:var(--x-drawer-size);max-height:100vh;}:host([data-placement\x3dtop]) [part\x3dpanel]{top:0;transform:translateY(-100%);}:host([data-placement\x3dbottom]) [part\x3dpanel]{bottom:0;transform:translateY(100%);}:host([data-open\x3dtrue]) [part\x3dpanel]{transform:none;}[part\x3dpanel]:focus{outline:none;}[part\x3dheader]{padding:var(--x-drawer-header-padding);border-bottom:1px solid var(--x-drawer-border);flex-shrink:0;}[part\x3dbody]{padding:var(--x-drawer-body-padding);overflow-y:auto;flex:1;}[part\x3dfooter]{padding:var(--x-drawer-footer-padding);border-top:1px solid var(--x-drawer-border);flex-shrink:0;}@media (prefers-reduced-motion:reduce){[part\x3dpanel]{transition:none;}}@media (prefers-color-scheme:dark){:host{--x-drawer-bg:#1c1d24;--x-drawer-fg:#e2e4ef;--x-drawer-border:rgb(255 255 255/0.08);--x-drawer-shadow:0 8px 40px rgb(0 0 0/0.55);--x-drawer-backdrop:rgb(0 0 0/0.55);}}";
|
|
3
3
|
d.setAttribute("part","backdrop");e.setAttribute("part","panel");e.setAttribute("role","dialog");e.setAttribute("aria-modal","true");g.setAttribute("part","header");h.setAttribute("name","header");k.setAttribute("part","body");q.setAttribute("part","footer");r.setAttribute("name","footer");g.appendChild(h);k.appendChild(m);q.appendChild(r);e.appendChild(g);e.appendChild(k);e.appendChild(q);b.appendChild(c);b.appendChild(d);b.appendChild(e);a.__xDrawerRefs={root:b,backdrop:d,panel:e,header:g,body:k,
|
|
4
|
-
footer:q};return $APP.l(a,"__xDrawerRefs")},
|
|
5
|
-
composed:!0,cancelable:!1}))}
|
|
6
|
-
$APP.l(a,"__xDrawerPanelTab")===!0;a.__xDrawerTabbables=null;a.__xDrawerRestore=null;$APP.n($APP.n(b)?d:b)&&(b.removeAttribute("tabindex"),a.__xDrawerPanelTab=!1);$APP.n($APP.n(c)?c.isConnected:c)&&c.focus()}
|
|
7
|
-
$APP.
|
|
8
|
-
$APP.
|
|
9
|
-
$APP.n(k)&&k.focus();else{k=document.activeElement;var m=$APP.x(h);h=$APP.
|
|
10
|
-
if($APP.n($APP.n(b)?c:b)){var d=$APP.l(c,"backdrop");c=$APP.l(c,"panel");var e=$APP.l(b,"backdrop");b=$APP.l(b,"keydown");$APP.n(e)&&d.removeEventListener("click",e);$APP.n(b)&&c.removeEventListener("keydown",b)}a.__xDrawerHandlers=null},
|
|
11
|
-
return $APP.n(b)?b:"right"},set:function(b){return b==null?this.removeAttribute("placement"):this.setAttribute("placement",""+$APP.T.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.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"show",{value:function(){return
|
|
12
|
-
writable:!0});Object.defineProperty(a,"hide",{value:function(){return
|
|
13
|
-
function(){
|
|
4
|
+
footer:q};return $APP.l(a,"__xDrawerRefs")},Yt=function(a){a=new $APP.Q(null,3,[$APP.jh,a.hasAttribute("open"),$APP.Yi,a.getAttribute("placement"),$APP.Wg,a.getAttribute("label")],null);var b=$APP.N(a),c=$APP.I(b,$APP.jh);a=$APP.I(b,$APP.Yi);b=$APP.I(b,$APP.Wg);c=$APP.K(c);a=typeof a==="string"&&$APP.yc(Xt,a)?a:"right";b=typeof b==="string"&&$APP.O(b,"")?b:"Drawer";return new $APP.Q(null,3,[$APP.Hi,c,$APP.ri,a,$APP.W,b],null)},Zt=function(a,b,c){a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,
|
|
5
|
+
composed:!0,cancelable:!1}))},$t=function(a){return $APP.Wd($APP.Ed(function(b){var c=window.getComputedStyle(b);return $APP.O("none",c.display)&&$APP.O("hidden",c.visibility)&&b.offsetWidth>0&&b.offsetHeight>0},$APP.dc(a.querySelectorAll("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex\x3d'-1'])"))))},au=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()},bu=function(a,b){Zt(a,"x-drawer-dismiss",{reason:b});a.removeAttribute("open");return null},cu=function(a){$APP.n(a.hasAttribute("open"))||a.setAttribute("open","");return null},du=function(a){a.removeAttribute("open");return null},eu=function(a){var b=Wt(a);b=$APP.l(b,"panel");var c=Yt(a),d=
|
|
7
|
+
$APP.Hi.g(c),e=$APP.l(a,"__xDrawerPrevOpen");a.setAttribute("data-open",$APP.n(d)?"true":"false");a.setAttribute("data-placement",$APP.ri.g(c));b.setAttribute("aria-label",$APP.W.g(c));$APP.n(d)?b.removeAttribute("aria-hidden"):b.setAttribute("aria-hidden","true");$APP.O(e,d)&&(a.__xDrawerPrevOpen=d,Zt(a,"x-drawer-toggle",{open:d}),$APP.n(d)?setTimeout(function(){var g=$APP.l(a,"__xDrawerRefs");g=$APP.n(g)?$APP.l(g,"panel"):null;var h=$t(a);a.__xDrawerRestore=document.activeElement;var k=$APP.n(h)?
|
|
8
|
+
$APP.pg(h):null;a.__xDrawerTabbables=k;$APP.u(h)?$APP.x(h).focus():$APP.n(g)&&($APP.n(g.hasAttribute("tabindex"))||(g.setAttribute("tabindex","-1"),a.__xDrawerPanelTab=!0),g.focus());return null},0):au(a))},fu=function(a){function b(g){var h=g.key;if($APP.C.h(h,"Escape"))g.preventDefault(),bu(a,"escape");else if($APP.C.h(h,"Tab")){h=$APP.l(a,"__xDrawerTabbables");h=$APP.n(h)?$APP.Wd($APP.dc(h)):$APP.Fd;var k=$APP.l(a,"__xDrawerRefs");k=$APP.n(k)?$APP.l(k,"panel"):null;if($APP.oc(h))g.preventDefault(),
|
|
9
|
+
$APP.n(k)&&k.focus();else{k=document.activeElement;var m=$APP.x(h);h=$APP.fc(h);var q=g.shiftKey;$APP.n($APP.n(q)?$APP.C.h(k,m):q)?(g.preventDefault(),h.focus()):$APP.p(q)&&$APP.C.h(k,h)&&(g.preventDefault(),m.focus())}}return null}function c(){return bu(a,"backdrop")}var d=Wt(a),e=$APP.l(d,"panel");$APP.l(d,"backdrop").addEventListener("click",c);e.addEventListener("keydown",b);$APP.la(a,"__xDrawerHandlers",{backdrop:c,keydown:b})},gu=function(a){var b=$APP.l(a,"__xDrawerHandlers"),c=$APP.l(a,"__xDrawerRefs");
|
|
10
|
+
if($APP.n($APP.n(b)?c:b)){var d=$APP.l(c,"backdrop");c=$APP.l(c,"panel");var e=$APP.l(b,"backdrop");b=$APP.l(b,"keydown");$APP.n(e)&&d.removeEventListener("click",e);$APP.n(b)&&c.removeEventListener("keydown",b)}a.__xDrawerHandlers=null},hu=function(a){Object.defineProperty(a,"open",{get:function(){return this.hasAttribute("open")},set:function(b){return $APP.n(b)?cu(this):du(this)},enumerable:!0,configurable:!0});Object.defineProperty(a,"placement",{get:function(){var b=this.getAttribute("placement");
|
|
11
|
+
return $APP.n(b)?b:"right"},set:function(b){return b==null?this.removeAttribute("placement"):this.setAttribute("placement",""+$APP.T.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.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"show",{value:function(){return cu(this)},enumerable:!0,configurable:!0,
|
|
12
|
+
writable:!0});Object.defineProperty(a,"hide",{value:function(){return du(this)},enumerable:!0,configurable:!0,writable:!0});Object.defineProperty(a,"toggle",{value:function(){$APP.n(this.hasAttribute("open"))?du(this):cu(this);return null},enumerable:!0,configurable:!0,writable:!0})},ju=function(){if(!$APP.n(customElements.get("x-drawer"))){var a=class extends HTMLElement{};a.observedAttributes=iu;a.prototype.connectedCallback=function(){Wt(this);gu(this);fu(this);eu(this);return null};a.prototype.disconnectedCallback=
|
|
13
|
+
function(){gu(this);au(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&eu(this);return null};hu(a.prototype);customElements.define("x-drawer",a)}return null},ku=function(){return ju()};var Xt=new $APP.S(null,new $APP.Q(null,4,["right",null,"top",null,"bottom",null,"left",null],null),null),iu=["open","placement","label"];$APP.sd(["x-drawer-toggle",new $APP.Q(null,2,[$APP.ni,!1,$APP.Y,new $APP.Q(null,1,[$APP.ji,$APP.Di],null)],null),"x-drawer-dismiss",new $APP.Q(null,2,[$APP.ni,!1,$APP.Y,new $APP.Q(null,1,[$APP.qh,$APP.X],null)],null)]);$APP.ja("baredom.exports.x_drawer.init",ku);export const init=ku;
|
package/dist/x-dropdown.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a)}return null},
|
|
4
|
-
$APP.l(b,"docClick"),d=$APP.l(b,"docKeydown");return setTimeout(function(){return $APP.n(a.hasAttribute("open"))?(document.addEventListener("click",c),document.addEventListener("keydown",d)):null},0)}return null},
|
|
5
|
-
b.key;return $APP.C.h(c," ")||$APP.C.h(c,"Enter")?(b.preventDefault(),
|
|
6
|
-
"escape"):null}}},
|
|
7
|
-
function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){d!=null&&$APP.O(d)?(d=""+$APP.T.g(d),d=this.setAttribute(c,d)):d=this.removeAttribute(c);return d}})},
|
|
8
|
-
null:
|
|
2
|
+
var Fl=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},Hl=function(a){var b=$APP.l(a,"__xDropdownRefs");if($APP.n(b)){var c=$APP.l(b,"trigger"),d=$APP.l(b,"label");b=$APP.l(b,"panel");var e=a.hasAttribute("open"),g=a.hasAttribute("disabled");var h=a.getAttribute("label");h=$APP.n(h)?h:"";a=a.getAttribute("placement");a=$APP.yc(Gl,a)?a:"bottom-start";d.textContent=h;c.setAttribute("aria-expanded",$APP.n(e)?"true":"false");Fl(c,"disabled",g);return b.setAttribute("data-placement",
|
|
3
|
+
a)}return null},Il=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},Jl=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},Kl=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},Ll=function(a){return{triggerClick:function(){return Il(a,"pointer")},triggerKeydown:function(b){var c=
|
|
5
|
+
b.key;return $APP.C.h(c," ")||$APP.C.h(c,"Enter")?(b.preventDefault(),Il(a,"keyboard")):null},hostFocusout:function(b){return $APP.n(a.hasAttribute("open"))?(b=b.relatedTarget,b==null||$APP.p(a.contains(b))?Il(a,"focusout"):null):null},docClick:function(b){return $APP.n(a.hasAttribute("open"))?(b=$APP.ec(b.composedPath()),b=$APP.xd(function(c){return c===a},b),$APP.n(b)?null:Il(a,"outside-click")):null},docKeydown:function(b){b=$APP.C.h(b.key,"Escape");return $APP.n(b?a.hasAttribute("open"):b)?Il(a,
|
|
6
|
+
"escape"):null}}},Ml=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")))}},Nl=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return Fl(this,c,$APP.K(d))}})},Ol=
|
|
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.O(d)?(d=""+$APP.T.g(d),d=this.setAttribute(c,d)):d=this.removeAttribute(c);return d}})},Ql=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",{get:function(){return Pl}});Nl(b,"open","open");Nl(b,"disabled","disabled");Ol(b,"label","label");Ol(b,"placement","placement");b.show=function(){return $APP.n(this.hasAttribute("open"))?
|
|
8
|
+
null:Il(this,"programmatic")};b.hide=function(){return $APP.n(this.hasAttribute("open"))?Il(this,"programmatic"):null};b.toggle=function(){return Il(this,"programmatic")};b.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xDropdownRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("button"),g=document.createElement("span"),h=document.createElement("span"),k=document.createElement("div"),m=document.createElement("div"),q=document.createElement("slot");
|
|
9
9
|
d.textContent=":host{display:inline-block;position:relative;color-scheme:light dark;--x-dropdown-trigger-bg:#f8fafc;--x-dropdown-trigger-bg-hover:#f1f5f9;--x-dropdown-trigger-bg-active:#e2e8f0;--x-dropdown-trigger-color:#0f172a;--x-dropdown-trigger-border:1px solid #e2e8f0;--x-dropdown-trigger-radius:6px;--x-dropdown-trigger-padding:0 0.75rem;--x-dropdown-trigger-height:2.25rem;--x-dropdown-trigger-font-size:0.9375rem;--x-dropdown-trigger-font-weight:500;--x-dropdown-chevron-color:#64748b;--x-dropdown-focus-ring:#60a5fa;--x-dropdown-panel-bg:#ffffff;--x-dropdown-panel-border:1px solid #e2e8f0;--x-dropdown-panel-radius:8px;--x-dropdown-panel-shadow:0 4px 16px rgba(0,0,0,0.12);--x-dropdown-panel-padding:0.25rem;--x-dropdown-panel-min-width:10rem;--x-dropdown-panel-max-height:20rem;--x-dropdown-panel-offset:4px;--x-dropdown-transition-duration:150ms;--x-dropdown-transition-easing:ease;}@media (prefers-color-scheme:dark){:host{--x-dropdown-trigger-bg:#1e293b;--x-dropdown-trigger-bg-hover:#334155;--x-dropdown-trigger-bg-active:#475569;--x-dropdown-trigger-color:#e2e8f0;--x-dropdown-trigger-border:1px solid #334155;--x-dropdown-chevron-color:#94a3b8;--x-dropdown-focus-ring:#93c5fd;--x-dropdown-panel-bg:#1e293b;--x-dropdown-panel-border:1px solid #334155;--x-dropdown-panel-shadow:0 4px 24px rgba(0,0,0,0.4);}}[part\x3dtrigger]{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;gap:0.375rem;height:var(--x-dropdown-trigger-height);padding:var(--x-dropdown-trigger-padding);background:var(--x-dropdown-trigger-bg);color:var(--x-dropdown-trigger-color);border:var(--x-dropdown-trigger-border);border-radius:var(--x-dropdown-trigger-radius);font-size:var(--x-dropdown-trigger-font-size);font-weight:var(--x-dropdown-trigger-font-weight);font-family:inherit;cursor:pointer;user-select:none;white-space:nowrap;}[part\x3dtrigger]:hover:not(:disabled){background:var(--x-dropdown-trigger-bg-hover);}[part\x3dtrigger]:active:not(:disabled){background:var(--x-dropdown-trigger-bg-active);}[part\x3dtrigger]:disabled{cursor:default;opacity:0.55;}[part\x3dtrigger]:focus-visible{outline:none;box-shadow:0 0 0 2px var(--x-dropdown-focus-ring);}[part\x3dtrigger-label]{flex:1;}[part\x3dchevron]{display:inline-block;color:var(--x-dropdown-chevron-color);font-style:normal;flex-shrink:0;transition:transform 200ms ease;}:host([open]) [part\x3dchevron]{transform:rotate(180deg);}[part\x3dpanel]{position:absolute;z-index:1000;box-sizing:border-box;background:var(--x-dropdown-panel-bg);border:var(--x-dropdown-panel-border);border-radius:var(--x-dropdown-panel-radius);box-shadow:var(--x-dropdown-panel-shadow);padding:var(--x-dropdown-panel-padding);min-width:var(--x-dropdown-panel-min-width);max-height:var(--x-dropdown-panel-max-height);overflow-y:auto;visibility:hidden;pointer-events:none;opacity:0;transform:scaleY(0.95);transition:opacity var(--x-dropdown-transition-duration) var(--x-dropdown-transition-easing),transform var(--x-dropdown-transition-duration) var(--x-dropdown-transition-easing),visibility 0s var(--x-dropdown-transition-duration);}:host([open]) [part\x3dpanel]{visibility:visible;pointer-events:auto;opacity:1;transform:scaleY(1);transition:opacity var(--x-dropdown-transition-duration) var(--x-dropdown-transition-easing),transform var(--x-dropdown-transition-duration) var(--x-dropdown-transition-easing),visibility 0s 0s;}[part\x3dpanel][data-placement\x3dbottom-start]{top:calc(100% + var(--x-dropdown-panel-offset));left:0;transform-origin:top left;}[part\x3dpanel][data-placement\x3dbottom-end]{top:calc(100% + var(--x-dropdown-panel-offset));right:0;transform-origin:top right;}[part\x3dpanel][data-placement\x3dtop-start]{bottom:calc(100% + var(--x-dropdown-panel-offset));left:0;transform-origin:bottom left;}[part\x3dpanel][data-placement\x3dtop-end]{bottom:calc(100% + var(--x-dropdown-panel-offset));right:0;transform-origin:bottom right;}[part\x3dpanel-inner]{display:contents;}@media (prefers-reduced-motion:reduce){[part\x3dpanel]{transition:none !important;}[part\x3dchevron]{transition:none !important;}}";
|
|
10
10
|
e.setAttribute("part","trigger");e.setAttribute("type","button");e.setAttribute("aria-haspopup","true");e.setAttribute("aria-expanded","false");e.setAttribute("aria-controls","panel");g.setAttribute("part","trigger-label");h.setAttribute("part","chevron");h.setAttribute("aria-hidden","true");h.textContent="▾";k.setAttribute("part","panel");k.setAttribute("id","panel");k.setAttribute("data-placement","bottom-start");m.setAttribute("part","panel-inner");e.appendChild(g);e.appendChild(h);m.appendChild(q);
|
|
11
|
-
k.appendChild(m);c.appendChild(d);c.appendChild(e);c.appendChild(k);this.__xDropdownRefs={trigger:e,label:g,chevron:h,panel:k}}
|
|
12
|
-
|
|
11
|
+
k.appendChild(m);c.appendChild(d);c.appendChild(e);c.appendChild(k);this.__xDropdownRefs={trigger:e,label:g,chevron:h,panel:k}}Ml(this);Kl(this);this.__xDropdownHandlers=Ll(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
|
+
Jl(this);return Hl(this)};b.disconnectedCallback=function(){Ml(this);return Kl(this)};b.attributeChangedCallback=function(c){$APP.n($APP.l(this,"__xDropdownRefs"))?(Hl(this),c=$APP.C.h(c,"open")?$APP.n(this.hasAttribute("open"))?Jl(this):Kl(this):null):c=null;return c};return a},Rl=function(){return $APP.n(customElements.get("x-dropdown"))?null:customElements.define("x-dropdown",Ql())};var Gl=new $APP.S(null,new $APP.Q(null,4,["bottom-start",null,"bottom-end",null,"top-end",null,"top-start",null],null),null),Pl=["open","disabled","label","placement"];$APP.sd(["x-dropdown-toggle",new $APP.Q(null,2,[$APP.ni,!0,$APP.Y,new $APP.Q(null,2,[$APP.ji,$APP.Di,$APP.vh,$APP.X],null)],null),"x-dropdown-change",new $APP.Q(null,2,[$APP.ni,!1,$APP.Y,new $APP.Q(null,1,[$APP.ji,$APP.Di],null)],null)]);$APP.ja("baredom.exports.x_dropdown.init",Rl);export const init=Rl;
|