@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-fieldset.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
h:"";k=$APP.K(k);k=new $APP.Q(null,5,[
|
|
4
|
-
c.removeAttribute("aria-describedby");
|
|
5
|
-
b)):b=this.removeAttribute("legend");return b}})}
|
|
6
|
-
e.setAttribute("part","root");e.setAttribute("role","group");g.setAttribute("part","legend");g.setAttribute("id","x-fieldset-legend");h.setAttribute("part","content");h.appendChild(k);e.appendChild(g);e.appendChild(h);c.appendChild(d);c.appendChild(e);this.__xFieldsetRefs={root:c,"root-el":e,"legend-el":g,"content-el":h}}return
|
|
7
|
-
null:customElements.define("x-fieldset"
|
|
2
|
+
var Us=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},Ys=function(a){var b=$APP.l(a,"__xFieldsetRefs");if($APP.n(b)){var c=$APP.l(b,"root-el"),d=$APP.l(b,"legend-el");b=$APP.l(b,"content-el");var e=a.getAttribute("legend");e=new $APP.Q(null,4,[Vs,e,$APP.Sh,a.hasAttribute("disabled"),$APP.wi,a.getAttribute("aria-label"),$APP.ci,a.getAttribute("aria-describedby")],null);var g=$APP.N(e),h=$APP.I(g,Vs);var k=$APP.I(g,$APP.Sh);e=$APP.I(g,$APP.wi);g=$APP.I(g,$APP.ci);h=$APP.n(h)?
|
|
3
|
+
h:"";k=$APP.K(k);k=new $APP.Q(null,5,[Ws,h,Xs,$APP.O(h,""),$APP.V,k,$APP.Uh,e,$APP.Pi,g],null);h=Ws.g(k);g=Xs.g(k);e=$APP.V.g(k);d.textContent=h;$APP.n(g)?d.removeAttribute("hidden"):d.setAttribute("hidden","");d=$APP.Uh.g(k);$APP.n(d)?(c.setAttribute("aria-label",d),c.removeAttribute("aria-labelledby")):(c.removeAttribute("aria-label"),$APP.n(g)?c.setAttribute("aria-labelledby","x-fieldset-legend"):c.removeAttribute("aria-labelledby"));d=$APP.Pi.g(k);$APP.n(d)?c.setAttribute("aria-describedby",d):
|
|
4
|
+
c.removeAttribute("aria-describedby");Us(a,"data-disabled",e);return Us(b,"inert",e)}return null},Zs=function(a){Object.defineProperty(a,"disabled",{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute("disabled")},set:function(b){return Us(this,"disabled",$APP.K(b))}})},$s=function(a){Object.defineProperty(a,"legend",{configurable:!0,enumerable:!0,get:function(){return this.getAttribute("legend")},set:function(b){b!=null&&$APP.O(b)?(b=""+$APP.T.g(b),b=this.setAttribute("legend",
|
|
5
|
+
b)):b=this.removeAttribute("legend");return b}})},bt=function(){var a=class extends HTMLElement{},b=a.prototype;a.observedAttributes=at;$s(b);Zs(b);b.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xFieldsetRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("div"),h=document.createElement("div"),k=document.createElement("slot");d.textContent=":host{display:block;color-scheme:light dark;--x-fieldset-border-color:#d1d5db;--x-fieldset-border-width:1px;--x-fieldset-border-radius:8px;--x-fieldset-padding:1rem;--x-fieldset-gap:0.75rem;--x-fieldset-bg:transparent;--x-fieldset-legend-color:#374151;--x-fieldset-legend-font-size:0.875rem;--x-fieldset-legend-font-weight:600;--x-fieldset-legend-padding:0 0.375rem;--x-fieldset-disabled-opacity:0.45;}@media (prefers-color-scheme:dark){:host{--x-fieldset-border-color:#374151;--x-fieldset-legend-color:#d1d5db;}}[part\x3droot]{display:block;border:var(--x-fieldset-border-width) solid var(--x-fieldset-border-color);border-radius:var(--x-fieldset-border-radius);padding:var(--x-fieldset-padding);background:var(--x-fieldset-bg);position:relative;}:host([data-disabled]) [part\x3droot]{opacity:var(--x-fieldset-disabled-opacity);}[part\x3dlegend]{display:block;position:absolute;top:calc(-0.5em);left:calc(var(--x-fieldset-border-radius) - 0.375rem);padding:var(--x-fieldset-legend-padding);color:var(--x-fieldset-legend-color);font-size:var(--x-fieldset-legend-font-size);font-weight:var(--x-fieldset-legend-font-weight);background:inherit;line-height:1;white-space:nowrap;}[part\x3dlegend][hidden]{display:none;}[part\x3dcontent]{display:flex;flex-direction:column;gap:var(--x-fieldset-gap);}";
|
|
6
|
+
e.setAttribute("part","root");e.setAttribute("role","group");g.setAttribute("part","legend");g.setAttribute("id","x-fieldset-legend");h.setAttribute("part","content");h.appendChild(k);e.appendChild(g);e.appendChild(h);c.appendChild(d);c.appendChild(e);this.__xFieldsetRefs={root:c,"root-el":e,"legend-el":g,"content-el":h}}return Ys(this)};b.disconnectedCallback=function(){return null};b.attributeChangedCallback=function(){return Ys(this)};return a},ct=function(){return $APP.n(customElements.get("x-fieldset"))?
|
|
7
|
+
null:customElements.define("x-fieldset",bt())},Ws=new $APP.M(null,"legend","legend",-1027192245),Xs=new $APP.M(null,"legend-visible?","legend-visible?",-281107501),Vs=new $APP.M(null,"legend-raw","legend-raw",907427195);var at=["legend","disabled","aria-label","aria-describedby"];$APP.ja("baredom.exports.x_fieldset.init",ct);export const init=ct;
|
package/dist/x-file-download.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.l(b,"anchor-el");var c=
|
|
4
|
-
var c=
|
|
5
|
-
b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){d!=null&&$APP.O(d)?(d=""+$APP.T.g(d),d=this.setAttribute(c,d)):d=this.removeAttribute(c);return d}})},
|
|
6
|
-
{get:function(){return
|
|
2
|
+
var Qp=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},Up=function(a){a=new $APP.Q(null,4,[Rp,a.getAttribute("href"),Sp,a.getAttribute("filename"),$APP.Sh,a.hasAttribute("disabled"),$APP.wi,a.getAttribute("aria-label")],null);var b=$APP.N(a);a=$APP.I(b,Rp);var c=$APP.I(b,Sp),d=$APP.I(b,$APP.Sh);b=$APP.I(b,$APP.wi);return new $APP.Q(null,4,[$APP.Qi,$APP.n(a)?a:"",Tp,$APP.n(c)?c:"",$APP.V,$APP.K(d),$APP.Uh,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.Qi.g(c),e=Tp.g(c),g=$APP.V.g(c);c=$APP.Uh.g(c);b.href=d;typeof e==="string"&&$APP.O(e,"")?b.setAttribute("download",e):(e=typeof d==="string",$APP.n(e?d.startsWith("data:"):e)?b.setAttribute("download",""):b.removeAttribute("download"));$APP.n(g)?b.setAttribute("aria-disabled","true"):b.removeAttribute("aria-disabled");$APP.n(c)?b.setAttribute("aria-label",c):b.removeAttribute("aria-label");return Qp(a,"data-disabled",g)}return null},Wp=function(a){return function(b){if($APP.n(a.hasAttribute("disabled")))return b.preventDefault();
|
|
4
|
+
var c=Up(a);c={href:$APP.Qi.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,
|
|
5
|
+
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}})},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.K(b))}})},aq=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",
|
|
6
|
+
{get:function(){return $p}});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"),g=document.createElement("span"),h=document.createElement("span"),k=document.createElement("slot");d.textContent=":host{display:inline-block;color-scheme:light dark;--x-file-download-bg:#2563eb;--x-file-download-color:#ffffff;--x-file-download-hover-bg:#1d4ed8;--x-file-download-active-bg:#1e40af;--x-file-download-border-radius:6px;--x-file-download-padding:0.5rem 1rem;--x-file-download-font-size:0.875rem;--x-file-download-font-weight:500;--x-file-download-gap:0.375rem;--x-file-download-icon-size:1em;--x-file-download-focus-ring:#60a5fa;--x-file-download-disabled-opacity:0.45;--x-file-download-transition:background 120ms ease;}@media (prefers-color-scheme:dark){:host{--x-file-download-bg:#3b82f6;--x-file-download-hover-bg:#2563eb;--x-file-download-active-bg:#1d4ed8;--x-file-download-focus-ring:#93c5fd;}}[part\x3danchor]{display:inline-flex;align-items:center;gap:var(--x-file-download-gap);padding:var(--x-file-download-padding);background:var(--x-file-download-bg);color:var(--x-file-download-color);border-radius:var(--x-file-download-border-radius);font-size:var(--x-file-download-font-size);font-weight:var(--x-file-download-font-weight);text-decoration:none;cursor:pointer;box-sizing:border-box;transition:var(--x-file-download-transition);outline:none;user-select:none;-webkit-user-select:none;}[part\x3danchor]:hover{background:var(--x-file-download-hover-bg);}[part\x3danchor]:active{background:var(--x-file-download-active-bg);}[part\x3danchor]:focus-visible{outline:2px solid var(--x-file-download-focus-ring);outline-offset:2px;}[part\x3dicon]{display:inline-flex;align-items:center;justify-content:center;width:var(--x-file-download-icon-size);height:var(--x-file-download-icon-size);flex-shrink:0;}[part\x3dcontent]{display:inline;}:host([data-disabled]) [part\x3danchor]{opacity:var(--x-file-download-disabled-opacity);pointer-events:none;cursor:default;}@media (prefers-reduced-motion:reduce){[part\x3danchor]{transition:none;}}";
|
|
7
7
|
e.setAttribute("part","anchor");g.setAttribute("part","icon");h.setAttribute("part","content");g.innerHTML='\x3csvg xmlns\x3d"http://www.w3.org/2000/svg" viewBox\x3d"0 0 16 16" fill\x3d"currentColor" width\x3d"1em" height\x3d"1em" aria-hidden\x3d"true"\x3e\x3cpath d\x3d"M8 1a.75.75 0 0 1 .75.75v6.19l1.97-1.97a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.03a.75.75 0 0 1 1.06-1.06L7.25 7.94V1.75A.75.75 0 0 1 8 1ZM2.5 13.25a.75.75 0 0 1 .75-.75h9.5a.75.75 0 0 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75Z"/\x3e\x3c/svg\x3e';
|
|
8
|
-
h.appendChild(k);e.appendChild(g);e.appendChild(h);c.appendChild(d);c.appendChild(e);this.__xFileDownloadRefs={"anchor-el":e,"icon-el":g,"content-el":h}}
|
|
9
|
-
|
|
8
|
+
h.appendChild(k);e.appendChild(g);e.appendChild(h);c.appendChild(d);c.appendChild(e);this.__xFileDownloadRefs={"anchor-el":e,"icon-el":g,"content-el":h}}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.M(null,"filename-raw","filename-raw",-706184256),Tp=new $APP.M(null,"filename","filename",-1428840783),Rp=new $APP.M(null,"href-raw","href-raw",-1680949453);var $p=["href","filename","disabled","aria-label"];$APP.ja("baredom.exports.x_file_download.init",bq);export const init=bq;
|
package/dist/x-form-field.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
e=$APP.l(b,"hint");b=$APP.l(b,"error");var g=$APP.
|
|
4
|
-
g=$APP.
|
|
5
|
-
"string"&&$APP.
|
|
6
|
-
$APP.n(D)?"hint":$APP.n(v)?"error":null;$APP.n(
|
|
7
|
-
|
|
8
|
-
if($APP.n(b)){b=$APP.l(b,"input");var c=b.value;var d=a.getAttribute("name");d=$APP.n(d)?d:"";var e=$APP.l(a,"__xFormFieldInternals");$APP.n(e)&&(e.setFormValue(c),
|
|
9
|
-
null;return}}return null},
|
|
10
|
-
enumerable:!0,get:function(){var b=$APP.l(this,"__xFormFieldRefs");if($APP.n(b))return $APP.l(b,"input").value;b=this.getAttribute("value");return $APP.n(b)?b:""},set:function(b){b=b!=null&&$APP.O(b)?""+$APP.T.g(b):"";this.setAttribute("value",b);var c=$APP.l(this,"__xFormFieldRefs");return $APP.n(c)?$APP.l(c,"input").value=b:null}})},
|
|
11
|
-
"label","label");
|
|
2
|
+
var JB=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},KB=function(a,b,c){var d=a.hasAttribute("error");var e=a.getAttribute("error");e=$APP.n(e)?e:"";a=a.hasAttribute("required");var g=c.value;return $APP.n(d)?b.setValidity({customError:!0},e,c):$APP.n($APP.n(a)?$APP.C.h(g,""):a)?b.setValidity({valueMissing:!0},"Please fill in this field.",c):b.setValidity({},"",c)},MB=function(a){var b=$APP.l(a,"__xFormFieldRefs");if($APP.n(b)){var c=$APP.l(b,"label"),d=$APP.l(b,"input"),
|
|
3
|
+
e=$APP.l(b,"hint");b=$APP.l(b,"error");var g=$APP.Xe([$APP.Wg,$APP.Dh,$APP.lh,$APP.yh,$APP.Sh,$APP.ug,$APP.mi,$APP.yi,$APP.Vg,$APP.bh,$APP.ph],[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.N(g),k=$APP.I(h,$APP.ph),m=$APP.I(h,$APP.Wg),q=$APP.I(h,$APP.Dh);
|
|
4
|
+
g=$APP.I(h,$APP.lh);var r=$APP.I(h,$APP.yh),v=$APP.I(h,$APP.Sh),w=$APP.I(h,$APP.ug),z=$APP.I(h,$APP.mi),A=$APP.I(h,$APP.yi),D=$APP.I(h,$APP.Vg),G=$APP.I(h,$APP.bh);h=$APP.n(g)?g:"";var J=$APP.n(r)?r:"",E=$APP.n(m)?m:"",R=[$APP.Tg,$APP.Vi,$APP.vi,$APP.Zg,$APP.ai,$APP.U,$APP.Gh,$APP.Z,$APP.ch,$APP.ei,$APP.W,$APP.ih,$APP.gi,$APP.V];w=$APP.K(w);z=$APP.K(z);k=$APP.n(k)?k:"";r=typeof r==="string"&&$APP.O(r,"")&&r!=null;q=$APP.n(q)?q:"";A=$APP.n(A)?A:"";m=typeof m==="string"&&$APP.O(m,"")&&m!=null;G=typeof G===
|
|
5
|
+
"string"&&$APP.yc(LB,G)?G:"text";g=$APP.Xe(R,[w,z,k,r,q,A,m,G,typeof g==="string"&&$APP.O(g,"")&&g!=null,J,E,h,$APP.n(D)?D:"",$APP.K(v)]);v=$APP.ch.g(g);D=$APP.Zg.g(g);h=$APP.Gh.g(g);d.type=$APP.Z.g(g);d.name=$APP.ai.g(g);d.placeholder=$APP.vi.g(g);d.disabled=$APP.V.g(g);d.readOnly=$APP.Vi.g(g);d.required=$APP.Tg.g(g);d.autocomplete=$APP.gi.g(g);J=$APP.n($APP.Tg.g(g))?"true":"false";d.setAttribute("aria-required",J);d.setAttribute("aria-invalid",$APP.n(v)?"true":"false");J=$APP.n($APP.n(D)?v:D)?"hint error":
|
|
6
|
+
$APP.n(D)?"hint":$APP.n(v)?"error":null;$APP.n(J)?d.setAttribute("aria-describedby",J):d.removeAttribute("aria-describedby");c.textContent=$APP.W.g(g);$APP.n(h)?c.classList.remove("label-hidden"):c.classList.add("label-hidden");e.textContent=$APP.ei.g(g);$APP.n(D)?e.classList.remove("hint-hidden"):e.classList.add("hint-hidden");b.textContent=$APP.ih.g(g);$APP.n(v)?b.classList.remove("error-hidden"):b.classList.add("error-hidden");JB(a,"data-invalid",v);c=$APP.l(a,"__xFormFieldInternals");return $APP.n(c)?
|
|
7
|
+
KB(a,c,d):null}return null},NB=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},OB=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),KB(a,e,b));return NB(a,"x-form-field-input",{name:d,value:c})}return null}},PB=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),KB(a,e,b));return NB(a,"x-form-field-change",{name:d,value:c})}return null}},QB=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},RB=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}})},SB=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return JB(this,c,$APP.K(d))}})},TB=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.O(b)?""+$APP.T.g(b):"";this.setAttribute("value",b);var c=$APP.l(this,"__xFormFieldRefs");return $APP.n(c)?$APP.l(c,"input").value=b:null}})},VB=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return UB}});TB(b);RB(b,
|
|
11
|
+
"label","label");RB(b,"type","type");RB(b,"name","name");RB(b,"placeholder","placeholder");RB(b,"autocomplete","autocomplete");SB(b,"disabled","disabled");SB(b,"readOnly","readonly");SB(b,"required","required");b.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xFormFieldRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("label"),h=document.createElement("div"),k=document.createElement("input"),m=document.createElement("span"),
|
|
12
12
|
q=document.createElement("span");d.textContent=":host{display:block;color-scheme:light dark;--x-form-field-label-color:#374151;--x-form-field-label-font-size:0.875rem;--x-form-field-input-bg:#ffffff;--x-form-field-input-color:#111827;--x-form-field-input-border:1px solid #d1d5db;--x-form-field-input-border-radius:6px;--x-form-field-input-padding:0.5rem 0.75rem;--x-form-field-focus-ring-color:#2563eb;--x-form-field-error-color:#dc2626;--x-form-field-hint-color:#6b7280;--x-form-field-disabled-opacity:0.45;}@media (prefers-color-scheme:dark){:host{--x-form-field-label-color:#d1d5db;--x-form-field-input-bg:#1f2937;--x-form-field-input-color:#f9fafb;--x-form-field-input-border:1px solid #4b5563;--x-form-field-focus-ring-color:#3b82f6;--x-form-field-error-color:#f87171;--x-form-field-hint-color:#9ca3af;}}[part\x3dfield]{display:flex;flex-direction:column;gap:0.25rem;}[part\x3dlabel]{display:block;font-size:var(--x-form-field-label-font-size);font-weight:500;color:var(--x-form-field-label-color);}.label-hidden{display:none;}[part\x3dinput-wrapper]{display:block;}[part\x3dinput]{display:block;width:100%;box-sizing:border-box;padding:var(--x-form-field-input-padding);background:var(--x-form-field-input-bg);color:var(--x-form-field-input-color);border:var(--x-form-field-input-border);border-radius:var(--x-form-field-input-border-radius);font-size:1rem;line-height:1.5;font-family:inherit;outline:none;transition:border-color 120ms ease,box-shadow 120ms ease;}[part\x3dinput]:focus{border-color:var(--x-form-field-focus-ring-color);box-shadow:0 0 0 3px color-mix(in srgb,var(--x-form-field-focus-ring-color) 20%,transparent);}:host([data-invalid]) [part\x3dinput]{border-color:var(--x-form-field-error-color);}:host([data-invalid]) [part\x3dinput]:focus{box-shadow:0 0 0 3px color-mix(in srgb,var(--x-form-field-error-color) 20%,transparent);}[part\x3dinput]:disabled{opacity:var(--x-form-field-disabled-opacity);cursor:not-allowed;}[part\x3dhint]{display:block;font-size:0.8125rem;color:var(--x-form-field-hint-color);}.hint-hidden{display:none;}[part\x3derror]{display:block;font-size:0.8125rem;color:var(--x-form-field-error-color);}.error-hidden{display:none;}@media (prefers-reduced-motion:reduce){[part\x3dinput]{transition:none;}}";
|
|
13
13
|
e.setAttribute("part","field");g.setAttribute("part","label");g.setAttribute("id","label");g.setAttribute("for","input");h.setAttribute("part","input-wrapper");k.setAttribute("part","input");k.setAttribute("id","input");k.setAttribute("aria-labelledby","label");m.setAttribute("part","hint");m.setAttribute("id","hint");m.setAttribute("aria-live","polite");q.setAttribute("part","error");q.setAttribute("id","error");q.setAttribute("role","alert");q.setAttribute("aria-live","assertive");h.appendChild(k);
|
|
14
|
-
e.appendChild(g);e.appendChild(h);e.appendChild(m);e.appendChild(q);c.appendChild(d);c.appendChild(e);this.__xFormFieldRefs={field:e,label:g,input:k,hint:m,error:q};$APP.n(this.attachInternals)&&(this.__xFormFieldInternals=this.attachInternals())}
|
|
15
|
-
"__xFormFieldRefs");$APP.n(c)&&(c=$APP.l(c,"input"),d=
|
|
16
|
-
return
|
|
17
|
-
$APP.
|
|
18
|
-
[$APP.Z,$APP.X,$APP.
|
|
14
|
+
e.appendChild(g);e.appendChild(h);e.appendChild(m);e.appendChild(q);c.appendChild(d);c.appendChild(e);this.__xFormFieldRefs={field:e,label:g,input:k,hint:m,error:q};$APP.n(this.attachInternals)&&(this.__xFormFieldInternals=this.attachInternals())}QB(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=OB(this),e=PB(this),c.addEventListener("input",d),c.addEventListener("change",e),this.__xFormFieldHandlers={input:d,change:e});return MB(this)};b.disconnectedCallback=function(){return QB(this)};b.attributeChangedCallback=function(c,d,e){$APP.C.h(c,"value")&&(c=$APP.l(this,"__xFormFieldRefs"),$APP.n(c)&&(c=$APP.l(c,"input"),$APP.O(c.value,e)&&(c.value=$APP.n(e)?e:"")));return MB(this)};b.formDisabledCallback=function(c){JB(this,"disabled",$APP.K(c));
|
|
16
|
+
return MB(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 MB(this)};return a},WB=function(){return $APP.n(customElements.get("x-form-field"))?null:customElements.define("x-form-field",VB())};var UB="label type name value placeholder hint error disabled readonly required autocomplete".split(" "),LB=new $APP.S(null,new $APP.Q(null,6,["url",null,"tel",null,"email",null,"text",null,"number",null,"password",null],null),null);
|
|
17
|
+
$APP.Xe([$APP.vi,$APP.pi,$APP.ai,$APP.U,$APP.bi,$APP.Z,$APP.W,$APP.gi,$APP.Eg],[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,"name"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Hg,"value"],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,"type"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Hg,"label"],null),new $APP.Q(null,2,
|
|
18
|
+
[$APP.Z,$APP.X,$APP.Hg,"autocomplete"],null),new $APP.Q(null,2,[$APP.Z,$APP.Di,$APP.Hg,"required"],null)]);$APP.ja("baredom.exports.x_form_field.init",WB);export const init=WB;
|
package/dist/x-form.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
if($APP.n($APP.
|
|
4
|
-
(b[g]=function(){var m=e.value;return $APP.n(m)?m:"on"}()):b[g]=function(){var m=e.value;return $APP.n(m)?m:""}()}d+=1}else break;return b},
|
|
5
|
-
k=g.length,m=0;;)if(m<k){var q=g[m];$APP.n(q.reportValidity)&&($APP.n(q.reportValidity())||(h.ok=!1));m+=1}else break;g=h.ok}$APP.n(g)?(g=
|
|
6
|
-
var h=$APP.l(a,"__xFormRefs");if($APP.n(h)){h=$APP.l(h,"form");g=$APP.C.h(g,"submit")||$APP.C.h(g,"")?h.requestSubmit():$APP.C.h(g,"reset")?h.reset():null;break a}}g=null}return g};b.addEventListener("submit",c);b.addEventListener("reset",d);a.addEventListener("click",e);$APP.
|
|
7
|
-
b.removeEventListener("reset",$APP.l(c,"reset"));a.removeEventListener("click",$APP.l(c,"click"));a.__xFormHandlers=null;return}}return null},
|
|
8
|
-
b:""},set:function(b){return b!=null&&$APP.O(b)?
|
|
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(g);c.appendChild(d);c.appendChild(e);this.__xFormRefs={form:e}}
|
|
2
|
+
var ry=function(a,b){return a.setAttribute("autocomplete",b)},wy=function(a){a=new $APP.Q(null,3,[sy,a.getAttribute("loading"),ty,$APP.n(a.hasAttribute("novalidate"))?"":null,$APP.Vg,a.getAttribute("autocomplete")],null);var b=$APP.N(a),c=$APP.I(b,sy);a=$APP.I(b,ty);b=$APP.I(b,$APP.Vg);c=c!=null&&$APP.O(c,"false");b=$APP.yc(uy,b)?b:"on";return new $APP.Q(null,3,[$APP.gh,c,vy,a!=null,$APP.gi,b],null)},xy=function(a){var b=$APP.l(a,"__xFormRefs");if($APP.n(b)){b=$APP.l(b,"form");a=wy(a);ry(b,$APP.gi.g(a));
|
|
3
|
+
if($APP.n($APP.gh.g(a)))return b.setAttribute("aria-busy","true"),b.setAttribute("data-loading","");b.removeAttribute("aria-busy");return b.removeAttribute("data-loading")}return null},yy=function(a){a=a.querySelectorAll("[name]:not([disabled])");for(var b={},c=a.length,d=0;;)if(d<c){var e=a[d],g=e.name;if($APP.n(function(){var m=g;return $APP.n(m)?$APP.O(g,""):m}())){var h=e.tagName.toLowerCase(),k=e.getAttribute("type");$APP.C.h(k,"checkbox")||$APP.C.h(k,"radio")||$APP.C.h(h,"x-checkbox")?$APP.n(e.checked)&&
|
|
4
|
+
(b[g]=function(){var m=e.value;return $APP.n(m)?m:"on"}()):b[g]=function(){var m=e.value;return $APP.n(m)?m:""}()}d+=1}else break;return b},zy=function(a,b,c,d){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:d}))},Ay=function(a){var b=$APP.l(a,"__xFormRefs");if($APP.n(b)){b=$APP.l(b,"form");var c=function(g){g.preventDefault();g=wy(a);if($APP.n($APP.gh.g(g)))g=null;else{g=vy.g(g);if(!$APP.n(g)){g=a.querySelectorAll("[name]:not([disabled])");for(var h={ok:!0},
|
|
5
|
+
k=g.length,m=0;;)if(m<k){var q=g[m];$APP.n(q.reportValidity)&&($APP.n(q.reportValidity())||(h.ok=!1));m+=1}else break;g=h.ok}$APP.n(g)?(g=yy(a),g=zy(a,"x-form-submit",{values:g},!0)):g=null}return g},d=function(){for(var g=a.querySelectorAll("[name]"),h=g.length,k=0;;)if(k<h){var m=g[k];$APP.n(m.formResetCallback)&&m.formResetCallback();k+=1}else break;return zy(a,"x-form-reset",{},!1)},e=function(g){a:{g=g.target.closest("button,input[type\x3dsubmit],input[type\x3dreset]");if($APP.n(g)){g=g.type;
|
|
6
|
+
var h=$APP.l(a,"__xFormRefs");if($APP.n(h)){h=$APP.l(h,"form");g=$APP.C.h(g,"submit")||$APP.C.h(g,"")?h.requestSubmit():$APP.C.h(g,"reset")?h.reset():null;break a}}g=null}return g};b.addEventListener("submit",c);b.addEventListener("reset",d);a.addEventListener("click",e);$APP.la(a,"__xFormHandlers",{submit:c,reset:d,click:e})}},By=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},Cy=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.K(d)?this.setAttribute(c,""):this.removeAttribute(c)}})},Dy=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.O(b)?ry(this,""+$APP.T.g(b)):this.removeAttribute("autocomplete")}})},Fy=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",{get:function(){return Ey}});Cy(b,"loading","loading");Cy(b,"novalidate","novalidate");Dy(b);b.connectedCallback=function(){if(!$APP.n(this.shadowRoot)){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("form"),g=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(g);c.appendChild(d);c.appendChild(e);this.__xFormRefs={form:e}}By(this);Ay(this);return xy(this)};b.disconnectedCallback=function(){return By(this)};b.attributeChangedCallback=function(){return xy(this)};b.submit=function(){var c=
|
|
10
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.T.g(c)+'"]');return $APP.n(c)?d==null||$APP.C.h(d,"")||$APP.C.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},
|
|
11
|
+
e+=1;else return null};return a},Gy=function(){return $APP.n(customElements.get("x-form"))?null:customElements.define("x-form",Fy())},sy=new $APP.M(null,"loading-raw","loading-raw",-1707143099),vy=new $APP.M(null,"novalidate?","novalidate?",491529885),ty=new $APP.M(null,"novalidate-raw","novalidate-raw",1783236714);var Ey=["loading","novalidate","autocomplete"],uy=new $APP.S(null,new $APP.Q(null,2,["off",null,"on",null],null),null);$APP.ja("baredom.exports.x_form.init",Gy);export const init=Gy;
|
package/dist/x-grid.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.N(a);a=$APP.
|
|
4
|
-
g,h,
|
|
5
|
-
c.setProperty("--x-grid-row-gap",
|
|
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}
|
|
7
|
-
|
|
8
|
-
-267946462),
|
|
2
|
+
var Hw=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"}},Iw=function(a,b,c){return $APP.yc(b,a)?a:c},Jw=function(a){switch(a){case "row-dense":return"row dense";case "column-dense":return"column dense";default:return a}},Kw=function(a){return $APP.n($APP.n(a)?$APP.O("",a):a)?a:null},Lw=function(a){return $APP.n($APP.n(a)?$APP.O("",a):a)?a:"16rem"},Zw=function(a){var b=
|
|
3
|
+
$APP.N(a);a=$APP.I(b,Mw);var c=$APP.I(b,Nw),d=$APP.I(b,Ow),e=$APP.I(b,Pw),g=$APP.I(b,Qw),h=$APP.I(b,$APP.Kg),k=$APP.I(b,Rw),m=$APP.I(b,Sw);b=$APP.I(b,Tw);h=Kw(h);k=Lw(k);var q=Iw(b,Uw,"md");b=function(){var v=$APP.yc(Uw,d)?d:null;return $APP.n(v)?v:q}();var r=function(){var v=$APP.yc(Uw,m)?m:null;return $APP.n(v)?v:q}();g=Iw(g,Vw,"stretch");c=Iw(c,Vw,"stretch");e=Jw(Iw(e,Ww,"row"));h=$APP.n(h)?h:"repeat(auto-fit,minmax("+$APP.T.g(k)+",1fr))";return $APP.Xe([Pw,Qw,$APP.Kg,Sw,Tw,Xw,Mw,Yw,Ow,Nw],[e,
|
|
4
|
+
g,h,Hw(r),q,b,$APP.K(a),r,Hw(b),c])},$w=function(a){var b=$APP.Xe([Pw,Qw,$APP.Kg,Rw,Sw,Tw,Mw,Ow,Nw],[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=Zw(b);a=$APP.l(a,"__x_grid_base");if($APP.n(a)){var c=a.style;a.setAttribute("data-gap",Tw.g(b));c.setProperty("--x-grid-columns",$APP.Kg.g(b));
|
|
5
|
+
c.setProperty("--x-grid-row-gap",Ow.g(b));c.setProperty("--x-grid-column-gap",Sw.g(b));c.setProperty("--x-grid-align-items",Qw.g(b));c.setProperty("--x-grid-justify-items",Nw.g(b));b=c.setProperty("--x-grid-auto-flow",Pw.g(b))}else b=null;return b},ax=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 ";
|
|
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}$w(a);return a},cx=function(){var a=class extends HTMLElement{};a.observedAttributes=bx;a.prototype.connectedCallback=function(){return ax(this)};a.prototype.attributeChangedCallback=function(){return $APP.l(this,"__x_grid_initialized")===!0?$w(this):ax(this)};return a},dx=function(){return $APP.n(customElements.get("x-grid"))?null:customElements.define("x-grid",
|
|
7
|
+
cx())},Rw=new $APP.M(null,"min-column-size","min-column-size",-1066019378),Mw=new $APP.M(null,"inline","inline",1399884222),Pw=new $APP.M(null,"auto-flow","auto-flow",-1524521728),Sw=new $APP.M(null,"column-gap","column-gap",384822863),Nw=new $APP.M(null,"justify-items","justify-items",1638310783),Ow=new $APP.M(null,"row-gap","row-gap",-1809905537),Yw=new $APP.M(null,"column-gap-token","column-gap-token",-10192833),Tw=new $APP.M(null,"gap","gap",80255254),Qw=new $APP.M(null,"align-items","align-items",
|
|
8
|
+
-267946462),Xw=new $APP.M(null,"row-gap-token","row-gap-token",-219143816);var bx="columns min-column-size gap row-gap column-gap align-items justify-items auto-flow inline".split(" "),Uw=new $APP.S(null,new $APP.Q(null,6,["none",null,"xs",null,"md",null,"lg",null,"xl",null,"sm",null],null),null),Vw=new $APP.S(null,new $APP.Q(null,4,["center",null,"start",null,"stretch",null,"end",null],null),null),Ww=new $APP.S(null,new $APP.Q(null,5,["column-dense",null,"row-dense",null,"dense",null,"column",null,"row",null],null),null);$APP.ja("baredom.exports.x_grid.init",dx);export const init=dx;
|
package/dist/x-menu-item.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
null)},
|
|
4
|
-
"false");a.setAttribute("role","menuitem");a.setAttribute("tabindex","-1");b.setAttribute("data-type","");b.setAttribute("data-variant",$APP.
|
|
5
|
-
"Enter")||$APP.C.h(k," "))&&$APP.p($APP.
|
|
6
|
-
b;a.__xMenuItemHandlers=g},
|
|
7
|
-
"variant",{get:function(){return this.getAttribute("variant")},set:function(b){return $APP.n(b)?this.setAttribute("variant",b):this.removeAttribute("variant")},configurable:!0,enumerable:!0});Object.defineProperty(a.prototype,"type",{get:function(){return this.getAttribute("type")},set:function(b){return $APP.n(b)?this.setAttribute("type",b):this.removeAttribute("type")},configurable:!0,enumerable:!0})},
|
|
8
|
-
function(){if(
|
|
9
|
-
b.setAttribute("part","base");b.className="base";e.setAttribute("part","icon");e.className="icon-span";g.setAttribute("name","icon");e.appendChild(g);h.className="label-span";h.appendChild(k);m.className="divider-hr";b.appendChild(e);b.appendChild(h);b.appendChild(m);c.appendChild(d);c.appendChild(b);c={};c.base=b;c["icon-span"]=e;c["icon-slot"]=g;this.__xMenuItemRefs=c;
|
|
10
|
-
var c=$APP.l(this,"__xMenuItemRefs");if($APP.n(b)){var d=$APP.l(b,"keydown"),e=$APP.l(b,"icon-slotchange");c=$APP.n(c)?$APP.l(c,"icon-slot"):null;this.removeEventListener("click",$APP.l(b,"click"));this.removeEventListener("keydown",d);b=$APP.n(c)?c.removeEventListener("slotchange",e):null}else b=null;return b};a.prototype.attributeChangedCallback=function(){return
|
|
11
|
-
|
|
2
|
+
var iD=function(a){var b=$APP.N(a);a=$APP.I(b,$APP.U);var c=$APP.I(b,$APP.pi),d=$APP.I(b,$APP.Ng);b=$APP.I(b,$APP.Z);a=$APP.n(a)?a:"";c=$APP.K(c);d=$APP.n(d)?d:"";d=$APP.yc(gD,d)?d:"";b=$APP.n(b)?b:"";b=$APP.yc(hD,b)?b:"";return new $APP.Q(null,4,[$APP.U,a,$APP.pi,c,$APP.Ng,d,$APP.Z,b],null)},jD=function(a){return $APP.l(a,"__xMenuItemInit")===!0},kD=function(a){return new $APP.Q(null,4,[$APP.U,a.getAttribute("value"),$APP.pi,a.hasAttribute("disabled"),$APP.Ng,a.getAttribute("variant"),$APP.Z,a.getAttribute("type")],
|
|
3
|
+
null)},lD=function(a){var b=a.getAttribute("value");return a.dispatchEvent(new CustomEvent("x-menu-item-select",{detail:{value:$APP.n(b)?b:""},bubbles:!0,composed:!0}))},mD=function(a){var b=$APP.l(a,"__xMenuItemRefs");b=$APP.n(b)?$APP.l(b,"base"):null;var c=iD(kD(a));if($APP.n(b)){if($APP.C.h($APP.Z.g(c),"divider"))return a.setAttribute("role","separator"),a.removeAttribute("tabindex"),a.removeAttribute("aria-disabled"),b.setAttribute("data-type","divider"),b.setAttribute("data-variant",""),b.setAttribute("data-disabled",
|
|
4
|
+
"false");a.setAttribute("role","menuitem");a.setAttribute("tabindex","-1");b.setAttribute("data-type","");b.setAttribute("data-variant",$APP.Ng.g(c));b.setAttribute("data-disabled",$APP.n($APP.pi.g(c))?"true":"false");return $APP.n($APP.pi.g(c))?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled")}return null},nD=function(a){function b(){return e.assignedNodes().length>0?a.setAttribute("has-icon",""):a.removeAttribute("has-icon")}function c(h){var k=h.key,m=iD(kD(a));($APP.C.h(k,
|
|
5
|
+
"Enter")||$APP.C.h(k," "))&&$APP.p($APP.pi.g(m))&&$APP.O($APP.Z.g(m),"divider")?(h.preventDefault(),h=lD(a)):h=null;return h}function d(h){var k=iD(kD(a));var m=$APP.pi.g(k);m=$APP.n(m)?m:$APP.C.h($APP.Z.g(k),"divider");$APP.n(m)&&h.preventDefault();return $APP.p($APP.pi.g(k))&&$APP.O($APP.Z.g(k),"divider")?lD(a):null}var e=$APP.l($APP.l(a,"__xMenuItemRefs"),"icon-slot"),g={};a.addEventListener("click",d);a.addEventListener("keydown",c);e.addEventListener("slotchange",b);g.click=d;g.keydown=c;g["icon-slotchange"]=
|
|
6
|
+
b;a.__xMenuItemHandlers=g},oD=function(a){Object.defineProperty(a.prototype,"value",{get:function(){return this.getAttribute("value")},set:function(b){return $APP.n(b)?this.setAttribute("value",b):this.removeAttribute("value")},configurable:!0,enumerable:!0});Object.defineProperty(a.prototype,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.n(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},configurable:!0,enumerable:!0});Object.defineProperty(a.prototype,
|
|
7
|
+
"variant",{get:function(){return this.getAttribute("variant")},set:function(b){return $APP.n(b)?this.setAttribute("variant",b):this.removeAttribute("variant")},configurable:!0,enumerable:!0});Object.defineProperty(a.prototype,"type",{get:function(){return this.getAttribute("type")},set:function(b){return $APP.n(b)?this.setAttribute("type",b):this.removeAttribute("type")},configurable:!0,enumerable:!0})},qD=function(){var a=class extends HTMLElement{};a.observedAttributes=pD;a.prototype.connectedCallback=
|
|
8
|
+
function(){if(jD(this)){nD(this);var b=mD(this)}else{if(!jD(this)){var c=this.attachShadow({mode:"open"}),d=document.createElement("style");b=document.createElement("div");var e=document.createElement("span"),g=document.createElement("slot"),h=document.createElement("span"),k=document.createElement("slot"),m=document.createElement("hr");d.textContent=":host{display:block;outline:none;color-scheme:light dark;--x-menu-item-color:#111827;--x-menu-item-hover-bg:#f3f4f6;--x-menu-item-focus-bg:#eff6ff;--x-menu-item-focus-color:#1d4ed8;--x-menu-item-disabled-opacity:0.45;--x-menu-item-danger-color:#dc2626;--x-menu-item-danger-hover-bg:#fef2f2;--x-menu-item-padding:8px 12px;--x-menu-item-border-radius:4px;--x-menu-item-font-size:0.9375rem;--x-menu-item-icon-gap:8px;--x-menu-item-divider-color:#e5e7eb;}:host([disabled]){pointer-events:none;}@media (prefers-color-scheme:dark){:host{--x-menu-item-color:#f9fafb;--x-menu-item-hover-bg:#1f2937;--x-menu-item-focus-bg:#1e3a5f;--x-menu-item-focus-color:#60a5fa;--x-menu-item-danger-color:#f87171;--x-menu-item-danger-hover-bg:#2d1515;--x-menu-item-divider-color:#374151;}}.base{display:flex;align-items:center;gap:var(--x-menu-item-icon-gap);padding:var(--x-menu-item-padding);border-radius:var(--x-menu-item-border-radius);font-size:var(--x-menu-item-font-size);color:var(--x-menu-item-color);cursor:pointer;user-select:none;transition:background 100ms ease,color 100ms ease;}.base:hover{background:var(--x-menu-item-hover-bg);}:host(:focus) .base{background:var(--x-menu-item-focus-bg);color:var(--x-menu-item-focus-color);}.base[data-variant\x3d'danger']{color:var(--x-menu-item-danger-color);}.base[data-variant\x3d'danger']:hover{background:var(--x-menu-item-danger-hover-bg);}:host(:focus) .base[data-variant\x3d'danger']{background:var(--x-menu-item-danger-hover-bg);}.base[data-disabled\x3d'true']{opacity:var(--x-menu-item-disabled-opacity);cursor:default;pointer-events:none;}.base[data-type\x3d'divider']{padding:0;cursor:default;pointer-events:none;}.icon-span{display:none;flex-shrink:0;align-items:center;}:host([has-icon]) .icon-span{display:flex;}.divider-hr{display:none;}.base[data-type\x3d'divider'] .icon-span,.base[data-type\x3d'divider'] .label-span{display:none;}.base[data-type\x3d'divider'] .divider-hr{display:block;width:100%;border:none;border-top:1px solid var(--x-menu-item-divider-color);margin:4px 0;}@media (prefers-reduced-motion:reduce){.base{transition:none;}}";
|
|
9
|
+
b.setAttribute("part","base");b.className="base";e.setAttribute("part","icon");e.className="icon-span";g.setAttribute("name","icon");e.appendChild(g);h.className="label-span";h.appendChild(k);m.className="divider-hr";b.appendChild(e);b.appendChild(h);b.appendChild(m);c.appendChild(d);c.appendChild(b);c={};c.base=b;c["icon-span"]=e;c["icon-slot"]=g;this.__xMenuItemRefs=c;nD(this);this.__xMenuItemInit=!0}mD(this);b=this}return b};a.prototype.disconnectedCallback=function(){var b=$APP.l(this,"__xMenuItemHandlers");
|
|
10
|
+
var c=$APP.l(this,"__xMenuItemRefs");if($APP.n(b)){var d=$APP.l(b,"keydown"),e=$APP.l(b,"icon-slotchange");c=$APP.n(c)?$APP.l(c,"icon-slot"):null;this.removeEventListener("click",$APP.l(b,"click"));this.removeEventListener("keydown",d);b=$APP.n(c)?c.removeEventListener("slotchange",e):null}else b=null;return b};a.prototype.attributeChangedCallback=function(){return jD(this)?mD(this):null};oD(a);return a},rD=function(){return $APP.n(customElements.get("x-menu-item"))?null:customElements.define("x-menu-item",
|
|
11
|
+
qD())};var pD=["value","disabled","variant","type"],gD=new $APP.S(null,new $APP.Q(null,2,["",null,"danger",null],null),null),hD=new $APP.S(null,new $APP.Q(null,2,["",null,"divider",null],null),null);$APP.sd(["x-menu-item-select",new $APP.Q(null,1,[$APP.Y,new $APP.Q(null,1,[$APP.U,$APP.X],null)],null)]);$APP.ja("baredom.exports.x_menu_item.init",rD);export const init=rD;
|
package/dist/x-menu.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
return b>0?$APP.C.h(null,
|
|
4
|
-
-1},a))},
|
|
5
|
-
(e=
|
|
6
|
-
d)?d:"bottom-start";a=new $APP.Q(null,3,[$APP.
|
|
7
|
-
h.indexOf(a))?
|
|
2
|
+
var gv=function(a){return $APP.l(a,"__xMenuInit")===!0},hv=function(a){a=a.querySelectorAll("x-menu-item");for(var b=[],c=a.length,d=0;;)if(d<c){var e=a[d];$APP.p(e.hasAttribute("disabled"))&&$APP.O(e.getAttribute("type"),"divider")&&b.push(e);d+=1}else break;return b},iv=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0}))},lv=function(a){$APP.n(a.hasAttribute("open"))||(a.setAttribute("open",""),iv(a,"x-menu-open",{}));if($APP.n(null)){a=hv(a);var b=a.length;
|
|
3
|
+
return b>0?$APP.C.h(null,jv)?a[0].focus():$APP.C.h(null,kv)?a[b-1].focus():null:null}return null},mv=function(a,b){$APP.n(a.hasAttribute("open"))&&(a.removeAttribute("open"),iv(a,"x-menu-close",{}));return $APP.n(b)?(a=$APP.l(a,"__xMenuRefs"),a=$APP.n(a)?$APP.l(a,"trigger-slot"):null,a=$APP.n(a)?a.assignedElements():null,a=$APP.n($APP.n(a)?a.length>0:a)?a[0]:null,$APP.n(a)?a.focus():null):null},nv=function(a,b){var c=b.composedPath();a=$APP.ec(a.assignedElements());return $APP.K($APP.xd(function(d){return c.indexOf(d)>
|
|
4
|
+
-1},a))},ov=function(a,b){var c=b.key,d=a.hasAttribute("open");if($APP.C.h(c,"Escape"))return $APP.n(d)?(b.preventDefault(),mv(a,!0)):null;if($APP.C.h(c,"Tab"))return $APP.n(d)?mv(a,!1):null;if($APP.C.h(c,"ArrowDown")||$APP.C.h(c,"ArrowUp")){var e=hv(a),g=e.length;if(g>0){b.preventDefault();if($APP.n(d))return a=e.indexOf(document.activeElement),c=$APP.C.h(c,"ArrowDown")?a>=g-1?0:a<0?0:a+1:a<=0?g-1:a-1,e[c].focus();lv(a);return e[$APP.C.h(c,"ArrowDown")?0:g-1].focus()}}else if($APP.C.h(c,"Home")){if($APP.n(d)&&
|
|
5
|
+
(e=hv(a),e.length>0))return b.preventDefault(),e[0].focus()}else if($APP.C.h(c,"End")&&$APP.n(d)&&(e=hv(a),e.length>0))return b.preventDefault(),e[e.length-1].focus();return null},qv=function(a){var b=$APP.l(a,"__xMenuRefs");b=$APP.n(b)?$APP.l(b,"popup"):null;a=new $APP.Q(null,3,[$APP.ji,a.hasAttribute("open"),$APP.ri,a.getAttribute("placement"),$APP.W,a.getAttribute("label")],null);a=$APP.N(a);var c=$APP.I(a,$APP.ji),d=$APP.I(a,$APP.ri);a=$APP.I(a,$APP.W);c=$APP.K(c);d=$APP.n(d)?d:"";d=$APP.yc(pv,
|
|
6
|
+
d)?d:"bottom-start";a=new $APP.Q(null,3,[$APP.ji,c,$APP.ri,d,$APP.W,$APP.n(a)?a:""],null);return $APP.n(b)?(b.setAttribute("data-placement",$APP.ri.g(a)),a=$APP.W.g(a),$APP.n($APP.n(a)?$APP.O(a,""):a)?b.setAttribute("aria-label",a):b.removeAttribute("aria-label")):null},rv=function(a){function b(h){h.stopPropagation();h=h.detail.value;mv(a,!1);return iv(a,"x-menu-select",{value:$APP.n(h)?h:""})}function c(h){return ov(a,h)}function d(h){$APP.n(a.hasAttribute("open"))?(h=h.composedPath(),h=$APP.C.h(-1,
|
|
7
|
+
h.indexOf(a))?mv(a,!1):null):h=null;return h}function e(h){var k=$APP.l(a,"__xMenuRefs");k=$APP.n(k)?$APP.l(k,"trigger-slot"):null;return $APP.n($APP.n(k)?nv(k,h):k)?$APP.n(a.hasAttribute("open"))?mv(a,!0):lv(a):null}var g={};a.addEventListener("click",e);document.addEventListener("click",d,!0);a.addEventListener("keydown",c);a.addEventListener("x-menu-item-select",b);g.click=e;g["doc-click"]=d;g.keydown=c;g["item-select"]=b;a.__xMenuHandlers=g},sv=function(a){Object.defineProperty(a.prototype,"open",
|
|
8
8
|
{get:function(){return this.hasAttribute("open")},set:function(b){return $APP.n(b)?this.setAttribute("open",""):this.removeAttribute("open")},configurable:!0,enumerable:!0});Object.defineProperty(a.prototype,"placement",{get:function(){return this.getAttribute("placement")},set:function(b){return $APP.n(b)?this.setAttribute("placement",b):this.removeAttribute("placement")},configurable:!0,enumerable:!0});Object.defineProperty(a.prototype,"label",{get:function(){return this.getAttribute("label")},
|
|
9
|
-
set:function(b){return $APP.n(b)?this.setAttribute("label",b):this.removeAttribute("label")},configurable:!0,enumerable:!0})},
|
|
9
|
+
set:function(b){return $APP.n(b)?this.setAttribute("label",b):this.removeAttribute("label")},configurable:!0,enumerable:!0})},uv=function(){var a=class extends HTMLElement{};a.observedAttributes=tv;a.prototype.connectedCallback=function(){if(gv(this)){rv(this);var b=qv(this)}else{if(!gv(this)){var c=this.attachShadow({mode:"open"}),d=document.createElement("style");b=document.createElement("div");var e=document.createElement("slot"),g=document.createElement("div"),h=document.createElement("slot");
|
|
10
10
|
d.textContent=":host{display:inline-block;position:relative;color-scheme:light dark;--x-menu-bg:#ffffff;--x-menu-border:1px solid #e5e7eb;--x-menu-border-radius:8px;--x-menu-shadow:0 4px 16px rgba(0,0,0,0.12);--x-menu-min-width:160px;--x-menu-padding:4px;--x-menu-z-index:1000;}@media (prefers-color-scheme:dark){:host{--x-menu-bg:#1f2937;--x-menu-border:1px solid #374151;--x-menu-shadow:0 4px 16px rgba(0,0,0,0.4);}}.base{position:relative;display:inline-block;}.popup{display:none;position:absolute;background:var(--x-menu-bg);border:var(--x-menu-border);border-radius:var(--x-menu-border-radius);box-shadow:var(--x-menu-shadow);min-width:var(--x-menu-min-width);padding:var(--x-menu-padding);z-index:var(--x-menu-z-index);box-sizing:border-box;}:host([open]) .popup{display:block;}.popup[data-placement\x3d'bottom-start']{top:100%;left:0;margin-top:4px;}.popup[data-placement\x3d'bottom-end']{top:100%;right:0;margin-top:4px;}.popup[data-placement\x3d'top-start']{bottom:100%;left:0;margin-bottom:4px;}.popup[data-placement\x3d'top-end']{bottom:100%;right:0;margin-bottom:4px;}";
|
|
11
|
-
b.setAttribute("part","base");b.className="base";e.setAttribute("name","trigger");g.setAttribute("part","popup");g.className="popup";g.setAttribute("role","menu");g.appendChild(h);b.appendChild(e);b.appendChild(g);c.appendChild(d);c.appendChild(b);c={};c.base=b;c.popup=g;c["trigger-slot"]=e;c["item-slot"]=h;this.__xMenuRefs=c;
|
|
12
|
-
d=$APP.l(b,"keydown"),e=$APP.l(b,"item-select");this.removeEventListener("click",$APP.l(b,"click"));document.removeEventListener("click",c,!0);this.removeEventListener("keydown",d);b=this.removeEventListener("x-menu-item-select",e)}else b=null;return b};a.prototype.attributeChangedCallback=function(){return
|
|
13
|
-
"last","last",1105735132);var
|
|
11
|
+
b.setAttribute("part","base");b.className="base";e.setAttribute("name","trigger");g.setAttribute("part","popup");g.className="popup";g.setAttribute("role","menu");g.appendChild(h);b.appendChild(e);b.appendChild(g);c.appendChild(d);c.appendChild(b);c={};c.base=b;c.popup=g;c["trigger-slot"]=e;c["item-slot"]=h;this.__xMenuRefs=c;rv(this);this.__xMenuInit=!0}qv(this);b=this}return b};a.prototype.disconnectedCallback=function(){var b=$APP.l(this,"__xMenuHandlers");if($APP.n(b)){var c=$APP.l(b,"doc-click"),
|
|
12
|
+
d=$APP.l(b,"keydown"),e=$APP.l(b,"item-select");this.removeEventListener("click",$APP.l(b,"click"));document.removeEventListener("click",c,!0);this.removeEventListener("keydown",d);b=this.removeEventListener("x-menu-item-select",e)}else b=null;return b};a.prototype.attributeChangedCallback=function(){return gv(this)?qv(this):null};sv(a);return a},vv=function(){return $APP.n(customElements.get("x-menu"))?null:customElements.define("x-menu",uv())},jv=new $APP.M(null,"first","first",-644103046),kv=new $APP.M(null,
|
|
13
|
+
"last","last",1105735132);var tv=["open","placement","label"],pv=new $APP.S(null,new $APP.Q(null,4,["bottom-start",null,"bottom-end",null,"top-end",null,"top-start",null],null),null);$APP.sd(["x-menu-open",new $APP.Q(null,1,[$APP.Y,$APP.td],null),"x-menu-close",new $APP.Q(null,1,[$APP.Y,$APP.td],null),"x-menu-select",new $APP.Q(null,1,[$APP.Y,new $APP.Q(null,1,[$APP.U,$APP.X],null)],null)]);$APP.ja("baredom.exports.x_menu.init",vv);export const init=vv;
|
package/dist/x-modal.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
2
|
+
var TD=function(a){var b=$APP.l(a,"__xModalRefs");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-modal-bg:Canvas;--x-modal-fg:CanvasText;--x-modal-backdrop:rgb(0 0 0/0.45);--x-modal-shadow:0 20px 60px rgb(0 0 0/0.25);--x-modal-radius:0.75rem;--x-modal-width-sm:22rem;--x-modal-width-md:32rem;--x-modal-width-lg:44rem;--x-modal-width-xl:60rem;--x-modal-max-height:90vh;--x-modal-header-padding:1rem 1.25rem;--x-modal-body-padding:1rem 1.25rem;--x-modal-footer-padding:0.75rem 1.25rem;--x-modal-border:color-mix(in srgb,currentColor 12%,transparent);--x-modal-duration:180ms;--x-modal-easing:ease;--x-modal-z:1000;}[part\x3dbackdrop]{position:fixed;inset:0;background:var(--x-modal-backdrop);z-index:var(--x-modal-z);opacity:0;visibility:hidden;pointer-events:none;transition:opacity var(--x-modal-duration) var(--x-modal-easing),visibility 0s var(--x-modal-easing) var(--x-modal-duration);}:host([data-open\x3dtrue]) [part\x3dbackdrop]{opacity:1;visibility:visible;pointer-events:auto;transition:opacity var(--x-modal-duration) var(--x-modal-easing),visibility 0s;}[part\x3ddialog]{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%) scale(0.96);opacity:0;visibility:hidden;pointer-events:none;background:var(--x-modal-bg);color:var(--x-modal-fg);box-shadow:var(--x-modal-shadow);border-radius:var(--x-modal-radius);display:flex;flex-direction:column;overflow:hidden;z-index:calc(var(--x-modal-z) + 1);max-height:var(--x-modal-max-height);transition:opacity var(--x-modal-duration) var(--x-modal-easing),transform var(--x-modal-duration) var(--x-modal-easing),visibility 0s var(--x-modal-easing) var(--x-modal-duration);}:host([data-size\x3dsm]) [part\x3ddialog]{width:var(--x-modal-width-sm);}:host([data-size\x3dmd]) [part\x3ddialog]{width:var(--x-modal-width-md);}:host([data-size\x3dlg]) [part\x3ddialog]{width:var(--x-modal-width-lg);}:host([data-size\x3dxl]) [part\x3ddialog]{width:var(--x-modal-width-xl);}:host([data-size\x3dfull]) [part\x3ddialog]{inset:0;top:0;left:0;width:100vw;height:100dvh;border-radius:0;max-width:100vw;max-height:100dvh;transform:scale(0.98);}:host([data-open\x3dtrue]) [part\x3ddialog]{opacity:1;transform:translate(-50%,-50%) scale(1);visibility:visible;pointer-events:auto;transition:opacity var(--x-modal-duration) var(--x-modal-easing),transform var(--x-modal-duration) var(--x-modal-easing),visibility 0s;}:host([data-open\x3dtrue][data-size\x3dfull]) [part\x3ddialog]{transform:scale(1);}[part\x3ddialog]:focus{outline:none;}[part\x3dheader]{padding:var(--x-modal-header-padding);border-bottom:1px solid var(--x-modal-border);flex-shrink:0;}[part\x3dbody]{padding:var(--x-modal-body-padding);overflow-y:auto;flex:1;}[part\x3dfooter]{padding:var(--x-modal-footer-padding);border-top:1px solid var(--x-modal-border);flex-shrink:0;}@media (prefers-reduced-motion:reduce){[part\x3ddialog],[part\x3dbackdrop]{transition:none;}}";
|
|
3
3
|
d.setAttribute("part","backdrop");e.setAttribute("part","dialog");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.__xModalRefs={root:b,backdrop:d,dialog:e,header:g,body:k,
|
|
4
|
-
footer:q};return $APP.l(a,"__xModalRefs")},
|
|
5
|
-
a=$APP.
|
|
6
|
-
return $APP.
|
|
7
|
-
"");return null},
|
|
8
|
-
"-1"),a.__xModalDialogTab=!0),d.focus());return null},0):
|
|
9
|
-
$APP.n(d)?"true":"false");a.setAttribute("data-size",$APP.
|
|
10
|
-
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
|
|
11
|
-
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.__xModalHandlers=null},
|
|
12
|
-
this.setAttribute("size",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:"Modal"},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
|
|
13
|
-
configurable:!0,writable:!0});Object.defineProperty(a,"toggle",{value:function(){$APP.n(this.hasAttribute("open"))?
|
|
14
|
-
function(b,c,d){$APP.O(c,d)&&
|
|
4
|
+
footer:q};return $APP.l(a,"__xModalRefs")},UD=function(a,b,c){a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},VD=function(a){function b(d){var e=window.getComputedStyle(d);return $APP.O("none",e.display)&&$APP.O("hidden",e.visibility)&&d.offsetWidth>0&&d.offsetHeight>0}var c=$APP.Ed(b,$APP.dc($APP.l(a,"dialog").querySelectorAll("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex\x3d'-1'])")));
|
|
5
|
+
a=$APP.Dd(function(d){return $APP.Ed(b,$APP.Dd(function(e){var g=$APP.dc(e.querySelectorAll("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex\x3d'-1'])"));return $APP.n(e.matches("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex\x3d'-1'])"))?$APP.Tc(e,g):g},$APP.dc([$APP.ec(d.assignedElements({flatten:!0}))])))},$APP.dc([$APP.dc($APP.l(a,"root").querySelectorAll("slot"))]));
|
|
6
|
+
return $APP.Wd($APP.Bd.h(c,a))},WD=function(a){var b=$APP.l(a,"__xModalRefs");b=$APP.n(b)?$APP.l(b,"dialog"):null;var c=$APP.l(a,"__xModalRestore"),d=$APP.l(a,"__xModalDialogTab")===!0;a.__xModalTabbables=null;a.__xModalRestore=null;$APP.n($APP.n(b)?d:b)&&(b.removeAttribute("tabindex"),a.__xModalDialogTab=!1);$APP.n($APP.n(c)?c.isConnected:c)&&c.focus()},XD=function(a,b){UD(a,"x-modal-dismiss",{reason:b});a.removeAttribute("open");return null},YD=function(a){$APP.n(a.hasAttribute("open"))||a.setAttribute("open",
|
|
7
|
+
"");return null},ZD=function(a){a.removeAttribute("open");return null},$D=function(a,b){$APP.O($APP.l(a,"__xModalPrevOpen"),b)&&(a.__xModalPrevOpen=b,UD(a,"x-modal-toggle",{open:b}),$APP.n(b)?setTimeout(function(){var c=$APP.l(a,"__xModalRefs"),d=$APP.n(c)?$APP.l(c,"dialog"):null;c=$APP.n(c)?VD(c):null;a.__xModalRestore=document.activeElement;var e=$APP.n(c)?$APP.pg(c):null;a.__xModalTabbables=e;$APP.u(c)?$APP.x(c).focus():$APP.n(d)&&($APP.n(d.hasAttribute("tabindex"))||(d.setAttribute("tabindex",
|
|
8
|
+
"-1"),a.__xModalDialogTab=!0),d.focus());return null},0):WD(a))},bE=function(a){var b=TD(a);b=$APP.l(b,"dialog");var c=new $APP.Q(null,3,[$APP.jh,a.hasAttribute("open"),$APP.$h,a.getAttribute("size"),$APP.Wg,a.getAttribute("label")],null);var d=$APP.N(c),e=$APP.I(d,$APP.jh);c=$APP.I(d,$APP.$h);d=$APP.I(d,$APP.Wg);e=$APP.K(e);c=typeof c==="string"&&$APP.yc(aE,c)?c:"md";d=typeof d==="string"&&$APP.O(d,"")?d:"Modal";c=new $APP.Q(null,3,[$APP.Hi,e,$APP.sg,c,$APP.W,d],null);d=$APP.Hi.g(c);a.setAttribute("data-open",
|
|
9
|
+
$APP.n(d)?"true":"false");a.setAttribute("data-size",$APP.sg.g(c));b.setAttribute("aria-label",$APP.W.g(c));$D(a,d)},cE=function(a){function b(g){var h=g.key;if($APP.C.h(h,"Escape"))g.preventDefault(),XD(a,"escape");else if($APP.C.h(h,"Tab")){h=$APP.l(a,"__xModalTabbables");h=$APP.n(h)?$APP.Wd($APP.dc(h)):$APP.Fd;var k=$APP.l(a,"__xModalRefs");k=$APP.n(k)?$APP.l(k,"dialog"):null;if($APP.oc(h))g.preventDefault(),$APP.n(k)&&k.focus();else{k=document.activeElement;var m=$APP.x(h);h=$APP.fc(h);var q=
|
|
10
|
+
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 XD(a,"backdrop")}var d=TD(a),e=$APP.l(d,"dialog");$APP.l(d,"backdrop").addEventListener("click",c);e.addEventListener("keydown",b);$APP.la(a,"__xModalHandlers",{backdrop:c,keydown:b})},dE=function(a){var b=$APP.l(a,"__xModalHandlers"),c=$APP.l(a,"__xModalRefs");if($APP.n($APP.n(b)?c:b)){var d=$APP.l(c,"backdrop");c=$APP.l(c,"dialog");
|
|
11
|
+
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.__xModalHandlers=null},eE=function(a){Object.defineProperty(a,"open",{get:function(){return this.hasAttribute("open")},set:function(b){return $APP.n(b)?YD(this):ZD(this)},enumerable:!0,configurable:!0});Object.defineProperty(a,"size",{get:function(){var b=this.getAttribute("size");return $APP.n(b)?b:"md"},set:function(b){return b==null?this.removeAttribute("size"):
|
|
12
|
+
this.setAttribute("size",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:"Modal"},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 YD(this)},enumerable:!0,configurable:!0,writable:!0});Object.defineProperty(a,"hide",{value:function(){return ZD(this)},enumerable:!0,
|
|
13
|
+
configurable:!0,writable:!0});Object.defineProperty(a,"toggle",{value:function(){$APP.n(this.hasAttribute("open"))?ZD(this):YD(this);return null},enumerable:!0,configurable:!0,writable:!0})},gE=function(){if(!$APP.n(customElements.get("x-modal"))){var a=class extends HTMLElement{};a.observedAttributes=fE;a.prototype.connectedCallback=function(){TD(this);dE(this);cE(this);bE(this);return null};a.prototype.disconnectedCallback=function(){dE(this);WD(this);return null};a.prototype.attributeChangedCallback=
|
|
14
|
+
function(b,c,d){$APP.O(c,d)&&bE(this);return null};eE(a.prototype);customElements.define("x-modal",a)}return null},hE=function(){return gE()};var aE=new $APP.S(null,new $APP.Q(null,5,["md",null,"lg",null,"full",null,"xl",null,"sm",null],null),null),fE=["open","size","label"];$APP.sd(["x-modal-toggle",new $APP.Q(null,2,[$APP.ni,!1,$APP.Y,new $APP.Q(null,1,[$APP.ji,$APP.Di],null)],null),"x-modal-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_modal.init",hE);export const init=hE;
|
package/dist/x-navbar.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
"string"?a:null,$APP.
|
|
5
|
-
$APP.
|
|
6
|
-
KeyboardEvent?"keyboard":"programmatic";$APP.n(g)&&(g=g.getAttribute("href"),
|
|
7
|
-
|
|
8
|
-
c)
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
var AD=function(a,b,c){return typeof a==="string"&&$APP.yc(b,a)?a:c},BD=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},CD=function(a){return a.assignedNodes({flatten:!0})},DD=function(a){return document.createElement(a)},KD=function(a,b){var c=$APP.l(b,"base"),d=$APP.l(b,"bar"),e=$APP.l(b,"brand"),g=$APP.l(b,"start"),h=$APP.l(b,"actions"),k=$APP.l(b,"toggle"),m=$APP.l(b,"end"),q=$APP.l(b,"brand-slot"),r=$APP.l(b,"start-slot"),v=$APP.l(b,
|
|
3
|
+
"actions-slot"),w=$APP.l(b,"toggle-slot");b=$APP.l(b,"end-slot");a=new $APP.Q(null,7,[$APP.W,a.getAttribute("label"),$APP.th,a.getAttribute("orientation"),$APP.Ng,a.getAttribute("variant"),$APP.Kh,a.hasAttribute("sticky"),ED,a.hasAttribute("elevated"),$APP.Ih,a.getAttribute("breakpoint"),FD,a.getAttribute("alignment")],null);var z=$APP.N(a);a=$APP.I(z,$APP.W);var A=$APP.I(z,$APP.th),D=$APP.I(z,$APP.Ng),G=$APP.I(z,$APP.Kh),J=$APP.I(z,ED),E=$APP.I(z,$APP.Ih);z=$APP.I(z,FD);a=new $APP.Q(null,7,[$APP.W,
|
|
4
|
+
typeof a==="string"?a:null,$APP.th,AD(A,GD,"horizontal"),$APP.Ng,AD(D,HD,"default"),$APP.Kh,$APP.K(G),ED,$APP.K(J),$APP.Ih,AD(E,ID,"md"),FD,AD(z,JD,"space-between")],null);q=CD(q).length>0;r=CD(r).length>0;v=CD(v).length>0;w=CD(w).length>0;b=CD(b).length>0;A=$APP.N(a);A=$APP.I(A,$APP.W);A=typeof A==="string"&&$APP.O("",A)?A:null;$APP.n(A)?c.setAttribute("aria-label",A):c.removeAttribute("aria-label");c.setAttribute("data-variant",$APP.Ng.g(a));c.setAttribute("data-orientation",$APP.th.g(a));c.setAttribute("data-breakpoint",
|
|
5
|
+
$APP.Ih.g(a));d.setAttribute("data-alignment",FD.g(a));e.setAttribute("data-has-brand",q?"true":"false");g.setAttribute("data-has-start",r?"true":"false");h.setAttribute("data-has-actions",v?"true":"false");k.setAttribute("data-has-toggle",w?"true":"false");return m.setAttribute("data-has-end",b?"true":"false")},LD=function(a,b){b.addEventListener("click",function(c){var d=$APP.l(a,"__xNavbarRefs"),e=c.target,g=$APP.n(e)?e.closest("a"):null;c=c instanceof PointerEvent?"pointer":c instanceof MouseEvent?
|
|
6
|
+
"pointer":c instanceof KeyboardEvent?"keyboard":"programmatic";$APP.n(g)&&(g=g.getAttribute("href"),BD(a,"navigate",{href:$APP.n(g)?g:"",source:c}));a:{d=CD($APP.l(d,"brand-slot"));for(g=0;;)if(g<d.length){var h=d[g];var k=$APP.C.h(h,e);h=k?k:(k=$APP.C.h(h.nodeType,Node.ELEMENT_NODE))?h.contains(e):k;if($APP.n(h)){e=!0;break a}g+=1}else{e=!1;break a}e=void 0}return e?BD(a,"brand-activate",{source:c}):null});b.addEventListener("focusin",function(c){c=c.target;if($APP.n($APP.n(c)?c.matches(":focus-visible"):
|
|
7
|
+
c)){if($APP.n($APP.l(a,"__xNavbarFocusVisible")))return null;a.__xNavbarFocusVisible=!0;a.setAttribute("data-focus-visible-within","true");return BD(a,"focus-visible",{})}return null});b.addEventListener("focusout",function(c){c=c.relatedTarget;if($APP.n($APP.n(c)?a.contains(c):c))return null;a.__xNavbarFocusVisible=!1;return a.removeAttribute("data-focus-visible-within")})},MD=function(a,b){function c(){return KD(a,b)}$APP.l(b,"brand-slot").addEventListener("slotchange",c);$APP.l(b,"start-slot").addEventListener("slotchange",
|
|
8
|
+
c);$APP.l(b,"default-slot").addEventListener("slotchange",c);$APP.l(b,"actions-slot").addEventListener("slotchange",c);$APP.l(b,"toggle-slot").addEventListener("slotchange",c);$APP.l(b,"end-slot").addEventListener("slotchange",c)},ND=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.n($APP.K(d))?this.setAttribute(c,""):this.removeAttribute(c)}})},OD=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,
|
|
9
|
+
enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){return $APP.n(d)?this.setAttribute(c,""+$APP.T.g(d)):this.removeAttribute(c)}})},PD=function(a){ND(a,"sticky","sticky");ND(a,"elevated","elevated");OD(a,"label","label");OD(a,"variant","variant");OD(a,"orientation","orientation");OD(a,"alignment","alignment");OD(a,"breakpoint","breakpoint")},RD=function(){var a=class extends HTMLElement{};a.observedAttributes=QD;a.prototype.connectedCallback=function(){var b=
|
|
10
|
+
$APP.l(this,"__xNavbarRefs")==null;var c=$APP.l(this,"__xNavbarRefs");if(!$APP.n(c)){c=this.attachShadow({mode:"open"});var d=DD("style"),e=DD("nav"),g=DD("div"),h=DD("div"),k=DD("div"),m=DD("div"),q=DD("div"),r=DD("div"),v=DD("div"),w=DD("slot"),z=DD("slot"),A=DD("slot"),D=DD("slot"),G=DD("slot"),J=DD("slot");d.textContent=":host{display:block;color-scheme:light dark;--x-navbar-height:4rem;--x-navbar-padding-inline:1rem;--x-navbar-gap:0.75rem;--x-navbar-bg:rgba(255,255,255,0.88);--x-navbar-color:#0f172a;--x-navbar-border:rgba(148,163,184,0.22);--x-navbar-shadow:0 8px 24px rgba(15,23,42,0.08);--x-navbar-focus-ring:#60a5fa;--x-navbar-z-index:40;--x-navbar-radius:1rem;--x-navbar-transition-duration:180ms;--x-navbar-transition-easing:cubic-bezier(0.2,0,0,1);--x-navbar-align-items:center;}@media (prefers-color-scheme: dark){:host{--x-navbar-bg:rgba(15,23,42,0.84);--x-navbar-color:#e5e7eb;--x-navbar-border:rgba(51,65,85,0.9);--x-navbar-shadow:0 14px 36px rgba(0,0,0,0.35);--x-navbar-focus-ring:#93c5fd;}}:host([hidden]){display:none;}[part\x3d'base']{display:block;color:var(--x-navbar-color);background:var(--x-navbar-bg);border:1px solid var(--x-navbar-border);border-radius:var(--x-navbar-radius);box-shadow:none;backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);transition:background var(--x-navbar-transition-duration) var(--x-navbar-transition-easing),border-color var(--x-navbar-transition-duration) var(--x-navbar-transition-easing),box-shadow var(--x-navbar-transition-duration) var(--x-navbar-transition-easing);}:host([sticky]) [part\x3d'base']{position:sticky;top:0;z-index:var(--x-navbar-z-index);}:host([elevated]) [part\x3d'base']{box-shadow:var(--x-navbar-shadow);}[part\x3d'base'][data-variant\x3d'subtle']{background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;box-shadow:none;}[part\x3d'base'][data-variant\x3d'inverted']{background:#0f172a;color:#f8fafc;border-color:#1e293b;}@media (prefers-color-scheme: dark){[part\x3d'base'][data-variant\x3d'inverted']{background:#020617;color:#f8fafc;border-color:#172033;}}[part\x3d'base'][data-variant\x3d'transparent']{background:transparent;border-color:transparent;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;}[part\x3d'bar']{display:grid;grid-template-columns:auto auto 1fr auto auto auto;align-items:var(--x-navbar-align-items, center);gap:var(--x-navbar-gap);min-block-size:var(--x-navbar-height);padding-inline:var(--x-navbar-padding-inline);}[part\x3d'bar'][data-alignment\x3d'start']{justify-items:start;}[part\x3d'bar'][data-alignment\x3d'center']{justify-items:center;}[part\x3d'bar'][data-alignment\x3d'space-between']{justify-items:stretch;}[part\x3d'base'][data-orientation\x3d'vertical'] [part\x3d'bar']{grid-template-columns:1fr;grid-auto-rows:auto;align-items:var(--x-navbar-align-items, center);padding-block:0.75rem;}[part\x3d'brand'],[part\x3d'start'],[part\x3d'nav'],[part\x3d'actions'],[part\x3d'toggle'],[part\x3d'end']{display:flex;align-items:inherit;min-inline-size:0;}[part\x3d'nav']{gap:var(--x-navbar-gap);}[part\x3d'actions'],[part\x3d'end'],[part\x3d'toggle']{justify-self:end;}[part\x3d'base'][data-orientation\x3d'vertical'] [part\x3d'actions'],[part\x3d'base'][data-orientation\x3d'vertical'] [part\x3d'end'],[part\x3d'base'][data-orientation\x3d'vertical'] [part\x3d'toggle']{justify-self:start;}[part\x3d'brand'][data-has-brand\x3d'false'],[part\x3d'start'][data-has-start\x3d'false'],[part\x3d'actions'][data-has-actions\x3d'false'],[part\x3d'toggle'][data-has-toggle\x3d'false'],[part\x3d'end'][data-has-end\x3d'false']{display:none;}slot[name\x3d'brand'],slot[name\x3d'start'],slot[name\x3d'actions'],slot[name\x3d'toggle'],slot[name\x3d'end']{display:contents;}slot{display:contents;}:host(:focus-within) [part\x3d'base']{box-shadow:var(--x-navbar-shadow);}:host([data-focus-visible-within\x3d'true']) [part\x3d'base']{box-shadow:0 0 0 2px var(--x-navbar-focus-ring), var(--x-navbar-shadow);}@media (prefers-reduced-motion: reduce){[part\x3d'base']{transition:none;}}";
|
|
11
|
+
e.setAttribute("part","base");g.setAttribute("part","bar");h.setAttribute("part","brand");k.setAttribute("part","start");m.setAttribute("part","nav");q.setAttribute("part","actions");r.setAttribute("part","toggle");v.setAttribute("part","end");w.setAttribute("name","brand");z.setAttribute("name","start");D.setAttribute("name","actions");G.setAttribute("name","toggle");J.setAttribute("name","end");h.appendChild(w);k.appendChild(z);m.appendChild(A);q.appendChild(D);r.appendChild(G);v.appendChild(J);
|
|
12
|
+
g.appendChild(h);g.appendChild(k);g.appendChild(m);g.appendChild(q);g.appendChild(r);g.appendChild(v);e.appendChild(g);c.appendChild(d);c.appendChild(e);this.__xNavbarRefs=c={"end-slot":J,bar:g,start:k,toggle:r,actions:q,brand:h,"default-slot":A,root:c,"brand-slot":w,"start-slot":z,"actions-slot":D,"toggle-slot":G,end:v,base:e,nav:m}}b&&(this.__xNavbarFocusVisible=!1,LD(this,$APP.l(c,"base")),MD(this,c));return KD(this,c)};a.prototype.disconnectedCallback=function(){this.__xNavbarFocusVisible=!1};
|
|
13
|
+
a.prototype.attributeChangedCallback=function(){var b=$APP.l(this,"__xNavbarRefs");return $APP.n(b)?KD(this,b):null};PD(a.prototype);return a},SD=function(){$APP.n(customElements.get("x-navbar"))||customElements.define("x-navbar",RD());return null},ED=new $APP.M(null,"elevated","elevated",-7323953),FD=new $APP.M(null,"alignment","alignment",1040093386);var GD=new $APP.S(null,new $APP.Q(null,2,["vertical",null,"horizontal",null],null),null),HD=new $APP.S(null,new $APP.Q(null,4,["transparent",null,"inverted",null,"subtle",null,"default",null],null),null),ID=new $APP.S(null,new $APP.Q(null,4,["md",null,"lg",null,"xl",null,"sm",null],null),null),JD=new $APP.S(null,new $APP.Q(null,3,["center",null,"start",null,"space-between",null],null),null),QD="label orientation variant sticky elevated breakpoint alignment".split(" ");
|
|
14
|
+
$APP.sd(["focus-visible",new $APP.Q(null,1,[$APP.Y,$APP.td],null),"navigate",new $APP.Q(null,1,[$APP.Y,new $APP.Q(null,2,[$APP.Qi,$APP.X,$APP.vh,$APP.X],null)],null),"brand-activate",new $APP.Q(null,1,[$APP.Y,new $APP.Q(null,1,[$APP.vh,$APP.X],null)],null)]);$APP.ja("baredom.exports.x_navbar.init",SD);export const init=SD;
|