@vanelsas/baredom 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +2 -2
- package/dist/base.js +364 -353
- package/dist/x-alert.js +19 -19
- package/dist/x-avatar-group.js +11 -11
- package/dist/x-avatar.js +15 -15
- package/dist/x-badge.js +11 -11
- package/dist/x-bento-grid.js +6 -0
- package/dist/x-bento-item.js +5 -0
- package/dist/x-breadcrumbs.js +14 -14
- package/dist/x-button.js +16 -16
- package/dist/x-cancel-dialogue.js +17 -17
- 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 +12 -12
- package/dist/x-command-palette.js +31 -31
- package/dist/x-container.js +6 -6
- package/dist/x-context-menu.js +19 -19
- package/dist/x-copy.js +23 -23
- package/dist/x-currency-field.js +22 -22
- package/dist/x-date-picker.js +40 -40
- package/dist/x-divider.js +12 -12
- package/dist/x-drawer.js +12 -12
- 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 +10 -10
- package/dist/x-gaussian-blur.js +19 -32
- package/dist/x-grid.js +6 -7
- package/dist/x-kinetic-typography.js +61 -61
- package/dist/x-menu-item.js +10 -10
- package/dist/x-menu.js +10 -10
- package/dist/x-metaball-cursor.js +28 -0
- package/dist/x-modal.js +13 -13
- package/dist/x-navbar.js +13 -13
- package/dist/x-neural-glow.js +35 -0
- package/dist/x-notification-center.js +10 -10
- package/dist/x-organic-divider.js +16 -16
- package/dist/x-organic-progress.js +40 -0
- package/dist/x-organic-shape.js +12 -12
- package/dist/x-pagination.js +16 -16
- package/dist/x-popover.js +15 -15
- package/dist/x-progress-circle.js +9 -9
- package/dist/x-progress.js +10 -10
- package/dist/x-radio.js +11 -11
- package/dist/x-ripple-effect.js +12 -12
- package/dist/x-scroll-parallax.js +19 -19
- package/dist/x-scroll-stack.js +18 -18
- package/dist/x-scroll-story.js +35 -35
- package/dist/x-scroll-timeline.js +47 -47
- package/dist/x-scroll.js +40 -40
- package/dist/x-search-field.js +14 -14
- package/dist/x-select.js +9 -9
- package/dist/x-sidebar.js +16 -16
- package/dist/x-skeleton.js +4 -4
- package/dist/x-slider.js +16 -16
- package/dist/x-spacer.js +5 -5
- package/dist/x-spinner.js +5 -5
- package/dist/x-splash.js +15 -0
- package/dist/x-stat.js +11 -11
- package/dist/x-stepper.js +16 -16
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +7 -7
- package/dist/x-table-cell.js +22 -23
- package/dist/x-table-row.js +10 -10
- package/dist/x-table.js +15 -15
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +17 -17
- package/dist/x-timeline-item.js +24 -24
- package/dist/x-timeline.js +9 -9
- package/dist/x-toast.js +24 -24
- package/dist/x-toaster.js +8 -8
- package/dist/x-typography.js +10 -10
- package/package.json +26 -2
package/dist/x-spacer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
d=$APP.
|
|
4
|
-
"grow",{get:function(){return
|
|
5
|
-
b.appendChild(c);this.__xSpacerRefs={root:b}}
|
|
6
|
-
"grow-raw",441172903),
|
|
2
|
+
var GD=function(a){return a!=null&&$APP.O((""+$APP.T.g(a)).trim().toLowerCase(),"false")},MD=function(a){var b=new $APP.R(null,3,[$APP.hk,a.getAttribute("size"),HD,a.getAttribute("axis"),ID,a.getAttribute("grow")],null);b=$APP.N(b);var c=$APP.I(b,$APP.hk),d=$APP.I(b,HD);b=$APP.I(b,ID);c=typeof c==="string"&&c.trim().length>0?c.trim():"1rem";d=typeof d==="string"?d.trim().toLowerCase():null;d=$APP.K(JD,d)?d:"vertical";b=new $APP.R(null,3,[$APP.Wg,c,KD,d,LD,GD(b)],null);c=$APP.N(b);b=$APP.I(c,$APP.Wg);
|
|
3
|
+
d=$APP.I(c,KD);c=$APP.I(c,LD);var e=a.style;a.setAttribute("data-axis",d);a.setAttribute("data-grow",$APP.n(c)?"true":"false");e.setProperty("--x-spacer-size",b);a.setAttribute("role","none");a.setAttribute("aria-hidden","true")},ND=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)},enumerable:!0,configurable:!0})},OD=function(a){Object.defineProperty(a,
|
|
4
|
+
"grow",{get:function(){return GD(this.getAttribute("grow"))},set:function(b){return $APP.n(b)?this.setAttribute("grow",""):this.removeAttribute("grow")},enumerable:!0,configurable:!0})},PD=function(a){ND(a,"size","1rem");ND(a,"axis","vertical");OD(a)},RD=function(){var a=class extends HTMLElement{};a.observedAttributes=QD;a.prototype.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xSpacerRefs"))){var b=this.attachShadow({mode:"open"}),c=document.createElement("style");c.textContent=":host{display:block;flex-shrink:0;height:var(--x-spacer-size,1rem);width:0;pointer-events:none;}:host([data-axis\x3d'horizontal']){height:0;width:var(--x-spacer-size,1rem);}:host([data-grow\x3d'true']){flex:1 0 var(--x-spacer-size,0px);height:0;width:0;}";
|
|
5
|
+
b.appendChild(c);this.__xSpacerRefs={root:b}}MD(this);return null};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(b,c,d){b=$APP.O(c,d);$APP.n(b?$APP.l(this,"__xSpacerRefs"):b)&&MD(this);return null};PD(a.prototype);return a},SD=function(){$APP.n(customElements.get("x-spacer"))||customElements.define("x-spacer",RD());return null},KD=new $APP.M(null,"axis","axis",-1215390822),LD=new $APP.M(null,"grow?","grow?",2124334580),ID=new $APP.M(null,"grow-raw",
|
|
6
|
+
"grow-raw",441172903),HD=new $APP.M(null,"axis-raw","axis-raw",291213231);var QD=["size","axis","grow"],JD=new $APP.S(null,new $APP.R(null,2,["vertical",null,"horizontal",null],null),null);$APP.ja("baredom.exports.x_spacer.init",SD);export const init=SD;
|
package/dist/x-spinner.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
b);a.setAttribute("data-variant",c);a.setAttribute("aria-label",d)},
|
|
4
|
-
$APP.
|
|
2
|
+
var LQ=function(a){var b=new $APP.R(null,3,[$APP.Wg,a.getAttribute("size"),$APP.jh,a.getAttribute("variant"),$APP.U,a.getAttribute("label")],null);var c=$APP.N(b),d=$APP.I(c,$APP.Wg);b=$APP.I(c,$APP.jh);c=$APP.I(c,$APP.U);d=typeof d==="string"&&$APP.K(JQ,d)?d:"md";b=typeof b==="string"&&$APP.K(KQ,b)?b:"default";c=typeof c==="string"&&$APP.O("",c.trim())?c.trim():"Loading";d=$APP.N(new $APP.R(null,3,[$APP.Wg,d,$APP.jh,b,$APP.U,c],null));b=$APP.I(d,$APP.Wg);c=$APP.I(d,$APP.jh);d=$APP.I(d,$APP.U);a.setAttribute("data-size",
|
|
3
|
+
b);a.setAttribute("data-variant",c);a.setAttribute("aria-label",d)},MQ=function(a){Object.defineProperty(a,"size",{get:function(){var b=this.getAttribute("size");return $APP.n(b)?b:"md"},set:function(b){return $APP.n(b)?this.setAttribute("size",""+$APP.T.g(b)):this.removeAttribute("size")},enumerable:!0,configurable:!0});Object.defineProperty(a,"variant",{get:function(){var b=this.getAttribute("variant");return $APP.n(b)?b:"default"},set:function(b){return $APP.n(b)?this.setAttribute("variant",""+
|
|
4
|
+
$APP.T.g(b)):this.removeAttribute("variant")},enumerable:!0,configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:"Loading"},set:function(b){return $APP.n(b)?this.setAttribute("label",""+$APP.T.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0})},OQ=function(){var a=class extends HTMLElement{};a.observedAttributes=NQ;a.prototype.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xSpinnerInit"))){var b=this.attachShadow({mode:"open"}),
|
|
5
5
|
c=document.createElement("style"),d=document.createElement("span");c.textContent=":host{display:inline-flex;align-items:center;justify-content:center;color-scheme:light dark;--x-spinner-size:24px;--x-spinner-color:currentColor;--x-spinner-track-color:rgba(0,0,0,0.12);--x-spinner-thickness:2px;--x-spinner-duration:0.75s;}@media (prefers-color-scheme:dark){:host{--x-spinner-track-color:rgba(255,255,255,0.15);}}:host([data-size\x3d'xs']){--x-spinner-size:16px;}:host([data-size\x3d'sm']){--x-spinner-size:20px;}:host([data-size\x3d'md']){--x-spinner-size:24px;}:host([data-size\x3d'lg']){--x-spinner-size:32px;}:host([data-size\x3d'xl']){--x-spinner-size:48px;}:host([data-variant\x3d'primary']){--x-spinner-color:#3b82f6;}:host([data-variant\x3d'success']){--x-spinner-color:#22c55e;}:host([data-variant\x3d'warning']){--x-spinner-color:#f59e0b;}:host([data-variant\x3d'danger']){--x-spinner-color:#ef4444;}[part\x3dring]{display:block;width:var(--x-spinner-size);height:var(--x-spinner-size);border-radius:50%;border:var(--x-spinner-thickness) solid var(--x-spinner-track-color);border-top-color:var(--x-spinner-color);box-sizing:border-box;animation:x-spinner-spin var(--x-spinner-duration) linear infinite;}@keyframes x-spinner-spin{to{transform:rotate(360deg);}}@media (prefers-reduced-motion:reduce){[part\x3dring]{animation-play-state:paused;}}";
|
|
6
|
-
d.setAttribute("part","ring");d.setAttribute("aria-hidden","true");b.appendChild(c);b.appendChild(d);this.setAttribute("role","status");this.setAttribute("aria-live","polite");this.__xSpinnerRing=d;this.__xSpinnerInit=!0}
|
|
7
|
-
customElements.define("x-spinner",
|
|
6
|
+
d.setAttribute("part","ring");d.setAttribute("aria-hidden","true");b.appendChild(c);b.appendChild(d);this.setAttribute("role","status");this.setAttribute("aria-live","polite");this.__xSpinnerRing=d;this.__xSpinnerInit=!0}LQ(this);return null};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(b,c,d){b=$APP.O(c,d);$APP.n(b?$APP.l(this,"__xSpinnerInit"):b)&&LQ(this);return null};MQ(a.prototype);return a},PQ=function(){$APP.n(customElements.get("x-spinner"))||
|
|
7
|
+
customElements.define("x-spinner",OQ());return null};var NQ=["size","variant","label"],JQ=new $APP.S(null,new $APP.R(null,5,["xs",null,"md",null,"lg",null,"xl",null,"sm",null],null),null),KQ=new $APP.S(null,new $APP.R(null,5,["success",null,"warning",null,"primary",null,"danger",null,"default",null],null),null);$APP.ja("baredom.exports.x_spinner.init",PQ);export const init=PQ;
|
package/dist/x-splash.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
+
var FF=function(a){return typeof a==="string"?(a=parseFloat(a.trim()),$APP.n(isNaN(a))?null:$APP.Fg.h(0,$APP.Gg.h(100,a))):null},GF=function(a){return a==null?!0:$APP.O((""+$APP.T.g(a)).trim().toLowerCase(),"false")},LF=function(a){var b=$APP.l(a,"__xSplashRefs");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("slot"),h=document.createElement("span"),k=document.createElement("div"),
|
|
3
|
+
m=document.createElement("div");c.textContent=":host{display:block;color-scheme:light dark;--x-splash-bg:#ffffff;--x-splash-color:#0f172a;--x-splash-z-index:9999;--x-splash-fade-duration:400ms;--x-splash-fade-ease:cubic-bezier(0.4,0,0.2,1);--x-splash-spinner-size:40px;--x-splash-spinner-color:currentColor;--x-splash-spinner-track-color:rgba(0,0,0,0.12);--x-splash-spinner-thickness:3px;--x-splash-spinner-duration:0.75s;--x-splash-progress-height:4px;--x-splash-progress-color:#3b82f6;--x-splash-progress-track-color:rgba(0,0,0,0.08);--x-splash-progress-radius:2px;--x-splash-gap:20px;--x-splash-blur-amount:8px;}@media (prefers-color-scheme:dark){:host{--x-splash-bg:#0f172a;--x-splash-color:#f8fafc;--x-splash-spinner-track-color:rgba(255,255,255,0.15);--x-splash-progress-track-color:rgba(255,255,255,0.12);}}[part\x3doverlay]{position:fixed;inset:0;z-index:var(--x-splash-z-index);display:none;align-items:center;justify-content:center;background:var(--x-splash-bg);color:var(--x-splash-color);opacity:0;transition:opacity var(--x-splash-fade-duration) var(--x-splash-fade-ease);}:host([active]) [part\x3doverlay]{display:flex;opacity:1;}:host([data-fading-out]) [part\x3doverlay]{display:flex;opacity:0;}:host([data-variant\x3d'minimal']) [part\x3doverlay]{background:transparent;}:host([data-variant\x3d'branded']) [part\x3doverlay]{background:var(--x-splash-branded-bg,var(--x-splash-bg));}:host([data-overlay\x3d'blur']) [part\x3doverlay]{background:rgba(255,255,255,0.7);backdrop-filter:blur(var(--x-splash-blur-amount));-webkit-backdrop-filter:blur(var(--x-splash-blur-amount));}@media (prefers-color-scheme:dark){:host([data-overlay\x3d'blur']) [part\x3doverlay]{background:rgba(15,23,42,0.7);}}:host([data-overlay\x3d'transparent']) [part\x3doverlay]{background:transparent;}[part\x3dcontent]{display:flex;flex-direction:column;align-items:center;gap:var(--x-splash-gap);max-width:80vw;text-align:center;}[part\x3dspinner]{display:block;width:var(--x-splash-spinner-size);height:var(--x-splash-spinner-size);border:var(--x-splash-spinner-thickness) solid var(--x-splash-spinner-track-color);border-top-color:var(--x-splash-spinner-color);border-radius:50%;animation:x-splash-spin var(--x-splash-spinner-duration) linear infinite;box-sizing:border-box;}@keyframes x-splash-spin{to{transform:rotate(360deg);}}[part\x3dprogress]{display:none;width:min(300px,60vw);height:var(--x-splash-progress-height);background:var(--x-splash-progress-track-color);border-radius:var(--x-splash-progress-radius);overflow:hidden;}[part\x3dbar]{height:100%;background:var(--x-splash-progress-color);border-radius:var(--x-splash-progress-radius);transition:width 200ms ease;width:0%;}@media (prefers-reduced-motion:reduce){[part\x3doverlay]{transition:none !important;}[part\x3dspinner]{animation:none !important;}[part\x3dbar]{transition:none !important;}}";
|
|
4
|
+
d.setAttribute("part","overlay");e.setAttribute("part","content");h.setAttribute("part","spinner");h.setAttribute("aria-hidden","true");k.setAttribute("part","progress");k.setAttribute("role","progressbar");k.setAttribute("aria-valuemin","0");k.setAttribute("aria-valuemax","100");m.setAttribute("part","bar");k.appendChild(m);e.appendChild(g);e.appendChild(h);e.appendChild(k);d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xSplashRefs=new $APP.R(null,6,[$APP.Jh,b,HF,d,IF,e,JF,h,$APP.ei,k,KF,
|
|
5
|
+
m],null);return $APP.l(a,"__xSplashRefs")},MF=function(a){a=typeof a==="string"?a.trim():"";return $APP.C.h(a,"")||$APP.C.h(a,"0")||$APP.C.h(a,"0ms")||$APP.C.h(a,"0s")?0:$APP.n(a.endsWith("ms"))?(a=parseFloat(a.slice(0,a.length-2)),$APP.n(isNaN(a))?0:Math.max(0,Math.round(a))):$APP.n(a.endsWith("s"))?(a=parseFloat(a.slice(0,a.length-1)),$APP.n(isNaN(a))?0:Math.max(0,Math.round(1E3*a))):0},NF=function(a){a=window.getComputedStyle(a);a=MF(a.getPropertyValue("--x-splash-fade-duration"));return a>0?a:
|
|
6
|
+
400},OF=function(a){var b=$APP.l(a,"__xSplashFadeTimer");$APP.n(b)&&(clearTimeout(b),a.__xSplashFadeTimer=null)},PF=function(a){OF(a);a.__xSplashFadingOut=!1;a.removeAttribute("data-fading-out");var b=LF(a);b=$APP.N(b);$APP.I(b,HF).style.display="none";a.removeAttribute("aria-busy");b=new CustomEvent("x-splash-hidden",{detail:{},bubbles:!0,composed:!0,cancelable:!1});a.dispatchEvent(b);return null},QF=function(a){if(!$APP.n($APP.l(a,"__xSplashFadingOut")))if(a.__xSplashFadingOut=!0,$APP.J(window.matchMedia("(prefers-reduced-motion:reduce)").matches))PF(a);
|
|
7
|
+
else{var b=LF(a);b=$APP.N(b);var c=$APP.I(b,HF),d=function h(g){return $APP.C.h(g.target,c)&&$APP.C.h(g.propertyName,"opacity")?(c.removeEventListener("transitionend",h),$APP.n($APP.l(a,"__xSplashFadingOut"))?PF(a):null):null};c.style.display="flex";c.style.opacity="1";a.setAttribute("data-fading-out","");c.addEventListener("transitionend",d);requestAnimationFrame(function(){return requestAnimationFrame(function(){return $APP.n($APP.l(a,"__xSplashFadingOut"))?c.style.opacity="0":null})});$APP.ma(a,
|
|
8
|
+
"__xSplashFadeTimer",setTimeout(function(){return $APP.n($APP.l(a,"__xSplashFadingOut"))?(c.removeEventListener("transitionend",d),PF(a)):null},NF(a)+60))}},ZF=function(a){var b=new $APP.R(null,5,[RF,a.hasAttribute("active"),$APP.Lj,a.getAttribute("variant"),$APP.Qi,a.getAttribute("progress"),SF,a.getAttribute("spinner"),TF,a.getAttribute("overlay")],null);var c=$APP.N(b);b=$APP.I(c,RF);var d=$APP.I(c,$APP.Lj),e=$APP.I(c,$APP.Qi),g=$APP.I(c,SF);c=$APP.I(c,TF);b=$APP.J(b);d=typeof d==="string"?d.trim().toLowerCase():
|
|
9
|
+
null;d=$APP.K(UF,d)?d:"default";e=FF(e);g=GF(g);c=typeof c==="string"?c.trim().toLowerCase():null;c=$APP.K(VF,c)?c:"solid";b=new $APP.R(null,5,[WF,b,$APP.jh,d,$APP.mk,e,XF,g,YF,c],null);if($APP.O($APP.l(a,"__xSplashModel"),b)){b=$APP.N(b);c=$APP.I(b,WF);e=$APP.I(b,$APP.jh);d=$APP.I(b,$APP.mk);var h=$APP.I(b,XF),k=$APP.I(b,YF);g=LF(a);var m=$APP.N(g);g=$APP.I(m,HF);var p=$APP.I(m,JF),q=$APP.I(m,$APP.ei),v=$APP.I(m,KF);m=$APP.l(a,"__xSplashModel");var x=WF.g(m);a.setAttribute("data-variant",e);a.setAttribute("data-overlay",
|
|
10
|
+
k);p.style.display=$APP.n(h)?"block":"none";d!=null?(q.style.display="block",v.style.width=""+$APP.T.g(d)+"%",q.setAttribute("aria-valuenow",""+$APP.T.g(d))):(q.style.display="none",q.removeAttribute("aria-valuenow"));$APP.n($APP.n(c)?$APP.r(x):c)?($APP.n($APP.l(a,"__xSplashFadingOut"))&&(OF(a),a.__xSplashFadingOut=!1,a.removeAttribute("data-fading-out"),c=LF(a),c=$APP.N(c),c=$APP.I(c,HF),c.style.display="",c.style.opacity=""),a.setAttribute("aria-busy","true"),a.setAttribute("aria-live","polite"),
|
|
11
|
+
a.setAttribute("role","status"),g.style.display="",g.style.opacity=""):(e=$APP.r(c),$APP.n(e?x:e)?QF(a):$APP.r(c)&&m==null&&(g.style.display="none",a.removeAttribute("aria-busy")));$APP.n(a.hasAttribute("aria-label"))||a.setAttribute("aria-label","Loading");a.__xSplashModel=b}},$F=function(a){Object.defineProperty(a,"active",{get:function(){return this.hasAttribute("active")},set:function(b){return $APP.n(b)?this.setAttribute("active",""):this.removeAttribute("active")},enumerable:!0,configurable:!0});
|
|
12
|
+
Object.defineProperty(a,"variant",{get:function(){var b=this.getAttribute("variant");return $APP.n(b)?b:"default"},set:function(b){return $APP.n(b)?this.setAttribute("variant",""+$APP.T.g(b)):this.removeAttribute("variant")},enumerable:!0,configurable:!0});Object.defineProperty(a,"progress",{get:function(){return FF(this.getAttribute("progress"))},set:function(b){return b==null?this.removeAttribute("progress"):this.setAttribute("progress",""+$APP.T.g(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,
|
|
13
|
+
"spinner",{get:function(){return GF(this.getAttribute("spinner"))},set:function(b){return $APP.n(b)?this.setAttribute("spinner",""):this.setAttribute("spinner","false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"overlay",{get:function(){var b=this.getAttribute("overlay");return $APP.n(b)?b:"solid"},set:function(b){return $APP.n(b)?this.setAttribute("overlay",""+$APP.T.g(b)):this.removeAttribute("overlay")},enumerable:!0,configurable:!0})},bG=function(){var a=class extends HTMLElement{};
|
|
14
|
+
a.observedAttributes=aG;a.prototype.connectedCallback=function(){LF(this);OF(this);ZF(this);return null};a.prototype.disconnectedCallback=function(){OF(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&ZF(this);return null};$F(a.prototype);return a},cG=function(){$APP.n(customElements.get("x-splash"))||customElements.define("x-splash",bG());return null},HF=new $APP.M(null,"overlay-el","overlay-el",-308547109),IF=new $APP.M(null,"content-el","content-el",-1423019925),
|
|
15
|
+
JF=new $APP.M(null,"spinner-el","spinner-el",-1536400516),KF=new $APP.M(null,"bar-el","bar-el",2050414242),XF=new $APP.M(null,"spinner?","spinner?",939139177),WF=new $APP.M(null,"active?","active?",459499776),RF=new $APP.M(null,"active-present?","active-present?",73064660),SF=new $APP.M(null,"spinner-attr","spinner-attr",-479327548),TF=new $APP.M(null,"overlay-raw","overlay-raw",1018775670),YF=new $APP.M(null,"overlay","overlay",-139131598);var aG=["active","variant","progress","spinner","overlay"];$APP.Ed(["x-splash-hidden",new $APP.R(null,2,[$APP.V,$APP.Fd,$APP.rk,!1],null)]);var UF=new $APP.S(null,new $APP.R(null,3,["minimal",null,"branded",null,"default",null],null),null),VF=new $APP.S(null,new $APP.R(null,3,["transparent",null,"solid",null,"blur",null],null),null);$APP.ja("baredom.exports.x_splash.init",cG);export const init=cG;
|
package/dist/x-stat.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
[d,e,g,
|
|
4
|
-
$APP.
|
|
5
|
-
g=$APP.l(a,"__x_stat_hint");return $APP.n(c)?(
|
|
6
|
-
k=document.createElement("div"),m=document.createElement("div"),p=document.createElement("span"),
|
|
7
|
-
d.setAttribute("part","base");e.setAttribute("part","icon");g.setAttribute("part","body");h.setAttribute("part","label");k.setAttribute("part","value");m.setAttribute("part","hint");x.setAttribute("name","icon");y.setAttribute("name","label");A.setAttribute("name","value");D.setAttribute("name","hint");e.appendChild(x);h.appendChild(y);h.appendChild(p);k.appendChild(A);k.appendChild(
|
|
8
|
-
d.appendChild(g);b.appendChild(c);b.appendChild(d);a.__x_stat_root=b;a.__x_stat_base=d;a.__x_stat_label=p;a.__x_stat_value=
|
|
9
|
-
"trend");
|
|
10
|
-
|
|
2
|
+
var fH=function(a,b,c){return $APP.K(b,a)?a:c},gH=function(a){return $APP.n($APP.n(a)?$APP.O("",a):a)?a:null},pH=function(a){var b=$APP.N(a),c=$APP.I(b,hH),d=$APP.I(b,iH),e=$APP.I(b,$APP.qi),g=$APP.I(b,$APP.jh);a=$APP.I(b,$APP.Xh);var h=$APP.I(b,$APP.jk),k=$APP.I(b,$APP.Wg),m=$APP.I(b,$APP.Nj);b=$APP.I(b,$APP.U);g=fH(g,jH,"default");e=fH(e,kH,"start");k=fH(k,lH,"md");c=fH(c,mH,"normal");d=fH(d,nH,"neutral");m=$APP.J(m);return $APP.mf([iH,$APP.qi,$APP.jh,$APP.Xh,$APP.jk,$APP.Wg,$APP.Nj,$APP.U,oH,hH],
|
|
3
|
+
[d,e,g,gH(a),gH(h),k,m,gH(b),m?"true":null,c])},qH=function(a){return $APP.mf([iH,$APP.qi,$APP.jh,$APP.Xh,$APP.jk,$APP.Wg,$APP.Nj,$APP.U,hH],[a.getAttribute("trend"),a.getAttribute("align"),a.getAttribute("variant"),a.getAttribute("value"),a.getAttribute("hint"),a.getAttribute("size"),a.hasAttribute("loading"),a.getAttribute("label"),a.getAttribute("emphasis")])},rH=function(a,b){a.setAttribute("role","figure");var c=oH.g(b);$APP.n(c)?a.setAttribute("aria-busy",c):a.removeAttribute("aria-busy");b=
|
|
4
|
+
$APP.U.g(b);$APP.n(b)?a.setAttribute("aria-label",b):a.removeAttribute("aria-label")},sH=function(a,b){a.setAttribute("data-variant",$APP.jh.g(b));a.setAttribute("data-align",$APP.qi.g(b));a.setAttribute("data-size",$APP.Wg.g(b));a.setAttribute("data-emphasis",hH.g(b));a.setAttribute("data-trend",iH.g(b));$APP.n($APP.Nj.g(b))?a.setAttribute("data-loading","true"):a.removeAttribute("data-loading")},tH=function(a){var b=pH(qH(a)),c=$APP.l(a,"__x_stat_base"),d=$APP.l(a,"__x_stat_label"),e=$APP.l(a,"__x_stat_value"),
|
|
5
|
+
g=$APP.l(a,"__x_stat_hint");return $APP.n(c)?(rH(a,b),sH(c,b),d.textContent=function(){var h=$APP.U.g(b);return $APP.n(h)?h:""}(),e.textContent=function(){var h=$APP.Xh.g(b);return $APP.n(h)?h:""}(),g.textContent=function(){var h=$APP.jk.g(b);return $APP.n(h)?h:""}()):null},uH=function(a){if($APP.l(a,"__x_stat_initialized")!==!0){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),g=document.createElement("div"),h=document.createElement("div"),
|
|
6
|
+
k=document.createElement("div"),m=document.createElement("div"),p=document.createElement("span"),q=document.createElement("span"),v=document.createElement("span"),x=document.createElement("slot"),y=document.createElement("slot"),A=document.createElement("slot"),D=document.createElement("slot"),G=document.createElement("slot");c.textContent=":host{display:block;color-scheme:light dark;--x-stat-background:transparent;--x-stat-color:inherit;--x-stat-muted-color:rgba(0,0,0,0.55);--x-stat-border-color:transparent;--x-stat-radius:12px;--x-stat-padding:16px;--x-stat-gap:6px;--x-stat-label-color:var(--x-stat-muted-color);--x-stat-label-size:12px;--x-stat-value-color:var(--x-stat-color);--x-stat-value-size:20px;--x-stat-hint-color:var(--x-stat-muted-color);--x-stat-hint-size:12px;--x-stat-icon-color:var(--x-stat-color);--x-stat-positive-color:#16a34a;--x-stat-warning-color:#d97706;--x-stat-danger-color:#dc2626;--x-stat-transition-duration:120ms;--x-stat-transition-timing:ease;--x-stat-loading-opacity:0.6;}@media (prefers-color-scheme:dark){:host{--x-stat-muted-color:rgba(255,255,255,0.55);--x-stat-positive-color:#4ade80;--x-stat-warning-color:#fbbf24;--x-stat-danger-color:#f87171;}}:host([variant\x3d'positive']){--x-stat-value-color:var(--x-stat-positive-color);}:host([variant\x3d'warning']){--x-stat-value-color:var(--x-stat-warning-color);}:host([variant\x3d'danger']){--x-stat-value-color:var(--x-stat-danger-color);}:host([variant\x3d'subtle']){--x-stat-value-color:var(--x-stat-muted-color);}[part\x3dbase]{display:grid;gap:var(--x-stat-gap);padding:var(--x-stat-padding);border-radius:var(--x-stat-radius);background:var(--x-stat-background);border:1px solid var(--x-stat-border-color);color:var(--x-stat-color);transition:background var(--x-stat-transition-duration) var(--x-stat-transition-timing),border-color var(--x-stat-transition-duration) var(--x-stat-transition-timing),color var(--x-stat-transition-duration) var(--x-stat-transition-timing),opacity var(--x-stat-transition-duration) var(--x-stat-transition-timing);}[part\x3dbase][data-align\x3d'center']{text-align:center;}[part\x3dbase][data-align\x3d'end']{text-align:end;}[part\x3dbase][data-size\x3d'sm'] [part\x3dvalue]{font-size:calc(var(--x-stat-value-size) * 0.8);}[part\x3dbase][data-size\x3d'lg'] [part\x3dvalue]{font-size:calc(var(--x-stat-value-size) * 1.6);}[part\x3dbase][data-emphasis\x3d'high'] [part\x3dvalue]{font-weight:800;}[part\x3dicon]{flex:0 0 auto;color:var(--x-stat-icon-color);line-height:1;}slot[name\x3dicon]::slotted(*){display:block;}[part\x3dlabel]{font-size:var(--x-stat-label-size);color:var(--x-stat-label-color);}[part\x3dvalue]{font-weight:600;font-size:var(--x-stat-value-size);color:var(--x-stat-value-color);}[part\x3dhint]{font-size:var(--x-stat-hint-size);color:var(--x-stat-hint-color);}[part\x3dbase][data-loading\x3d'true']{opacity:var(--x-stat-loading-opacity);}@media (prefers-reduced-motion:reduce){[part\x3dbase]{transition:none;}}";
|
|
7
|
+
d.setAttribute("part","base");e.setAttribute("part","icon");g.setAttribute("part","body");h.setAttribute("part","label");k.setAttribute("part","value");m.setAttribute("part","hint");x.setAttribute("name","icon");y.setAttribute("name","label");A.setAttribute("name","value");D.setAttribute("name","hint");e.appendChild(x);h.appendChild(y);h.appendChild(p);k.appendChild(A);k.appendChild(q);m.appendChild(D);m.appendChild(v);g.appendChild(h);g.appendChild(k);g.appendChild(m);g.appendChild(G);d.appendChild(e);
|
|
8
|
+
d.appendChild(g);b.appendChild(c);b.appendChild(d);a.__x_stat_root=b;a.__x_stat_base=d;a.__x_stat_label=p;a.__x_stat_value=q;a.__x_stat_hint=v;a.__x_stat_initialized=!0}tH(a);return a},vH=function(a,b){Object.defineProperty(a,b,{get:function(){var c=this.getAttribute(b);return $APP.n(c)?c:""},set:function(c){return $APP.n(c)?this.setAttribute(b,""+$APP.T.g(c)):this.removeAttribute(b)},enumerable:!0,configurable:!0})},wH=function(a){vH(a,"variant");vH(a,"align");vH(a,"size");vH(a,"emphasis");vH(a,
|
|
9
|
+
"trend");vH(a,"label");vH(a,"value");vH(a,"hint");Object.defineProperty(a,"loading",{get:function(){return this.hasAttribute("loading")},set:function(b){return $APP.n(b)?this.setAttribute("loading",""):this.removeAttribute("loading")},enumerable:!0,configurable:!0})},yH=function(){var a=class extends HTMLElement{};a.observedAttributes=xH;a.prototype.connectedCallback=function(){return uH(this)};a.prototype.attributeChangedCallback=function(){return $APP.l(this,"__x_stat_initialized")===!0?tH(this):
|
|
10
|
+
uH(this)};wH(a.prototype);return a},zH=function(){return $APP.n(customElements.get("x-stat"))?null:customElements.define("x-stat",yH())},hH=new $APP.M(null,"emphasis","emphasis",293543451),oH=new $APP.M(null,"aria-busy","aria-busy",793864247),iH=new $APP.M(null,"trend","trend",54563841);var xH="variant align size emphasis trend loading label value hint".split(" "),jH=new $APP.S(null,new $APP.R(null,5,["warning",null,"positive",null,"subtle",null,"danger",null,"default",null],null),null),kH=new $APP.S(null,new $APP.R(null,3,["center",null,"start",null,"end",null],null),null),lH=new $APP.S(null,new $APP.R(null,3,["md",null,"lg",null,"sm",null],null),null),mH=new $APP.S(null,new $APP.R(null,2,["high",null,"normal",null],null),null),nH=new $APP.S(null,new $APP.R(null,3,["neutral",null,
|
|
11
11
|
"up",null,"down",null],null),null);
|
|
12
|
-
$APP.
|
|
13
|
-
"size",$APP.Z,$APP.
|
|
12
|
+
$APP.mf([iH,$APP.qi,$APP.jh,$APP.Xh,$APP.jk,$APP.Wg,$APP.Nj,$APP.U,hH],[new $APP.R(null,4,[$APP.Gj,"trend",$APP.Z,$APP.Y,$APP.oh,"neutral",$APP.qh,!0],null),new $APP.R(null,4,[$APP.Gj,"align",$APP.Z,$APP.Y,$APP.oh,"start",$APP.qh,!0],null),new $APP.R(null,4,[$APP.Gj,"variant",$APP.Z,$APP.Y,$APP.oh,"default",$APP.qh,!0],null),new $APP.R(null,4,[$APP.Gj,"value",$APP.Z,$APP.Y,$APP.oh,"",$APP.qh,!0],null),new $APP.R(null,4,[$APP.Gj,"hint",$APP.Z,$APP.Y,$APP.oh,"",$APP.qh,!0],null),new $APP.R(null,4,[$APP.Gj,
|
|
13
|
+
"size",$APP.Z,$APP.Y,$APP.oh,"md",$APP.qh,!0],null),new $APP.R(null,4,[$APP.Gj,"loading",$APP.Z,$APP.Ni,$APP.oh,!1,$APP.qh,!0],null),new $APP.R(null,4,[$APP.Gj,"label",$APP.Z,$APP.Y,$APP.oh,"",$APP.qh,!0],null),new $APP.R(null,4,[$APP.Gj,"emphasis",$APP.Z,$APP.Y,$APP.oh,"normal",$APP.qh,!0],null)]);$APP.ja("baredom.exports.x_stat.init",zH);export const init=zH;
|
package/dist/x-stepper.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
10),typeof a==="number"&&$APP.
|
|
4
|
-
2,[$APP.
|
|
5
|
-
d.setAttribute("part","container");d.setAttribute("role","list");b.appendChild(c);b.appendChild(d);a.__xStepperRefs=new $APP.
|
|
6
|
-
c=
|
|
7
|
-
$APP.
|
|
8
|
-
}}b=$APP.n(b)?b:"";g.setAttribute("part","step");g.setAttribute("role","listitem");g.setAttribute("data-index",""+$APP.
|
|
9
|
-
"step-number");m.setAttribute("aria-hidden","true");m.textContent=$APP.C.h(c,$APP.
|
|
10
|
-
g.appendChild(
|
|
11
|
-
p,v,h));m+=1}else if(c=$APP.u(c))$APP.
|
|
12
|
-
typeof d==="number"&&$APP.
|
|
13
|
-
(c=$APP.
|
|
14
|
-
this.removeAttribute("current"):this.setAttribute("current",""+$APP.
|
|
15
|
-
""+$APP.
|
|
16
|
-
return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&
|
|
17
|
-
"
|
|
2
|
+
var Lm=function(a,b){return new $APP.gd(null,function(){if(a>0){var c=$APP.u(b);return c?$APP.dd($APP.w(c),Lm(a-1,$APP.Ob(c))):null}return null},null)},Om=function(a){a=$APP.I(Mm,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:Nm},Qm=function(a){a=$APP.I(Pm,a);return $APP.n(a)?a:"horizontal"},Tm=function(a){a=$APP.I(Rm,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:Sm},Vm=function(a){a=$APP.I(Um,a);return $APP.n(a)?a:"md"},Wm=function(a){return typeof a==="string"?(a=parseInt(a.trim(),
|
|
3
|
+
10),typeof a==="number"&&$APP.r(isNaN(a))&&a>=0?a:0):0},Xm=function(a){if(typeof a==="string"){var b=a.trim();if($APP.n($APP.Vf(/^\d+$/,b)))return a=parseInt(b,10),a>0&&a<=200?$APP.Ud(function(g){return new $APP.R(null,2,[$APP.U,"Step "+$APP.T.g(g),$APP.hj,null],null)},$APP.Uf(1,a+1)):$APP.Td;if($APP.n(function(){var g=$APP.O("",b);return g?b.startsWith("["):g}()))try{var c=JSON.parse(b);if($APP.n(Array.isArray(c))){var d=$APP.kc(c),e=$APP.B(d)>200?Lm(200,d):d;return $APP.Ud(function(g){return new $APP.R(null,
|
|
4
|
+
2,[$APP.U,function(){var h=$APP.l(g,"label");return typeof h==="string"?h:""}(),$APP.hj,function(){var h=$APP.l(g,"description");return typeof h==="string"?h:null}()],null)},e)}return $APP.Td}catch(g){return $APP.Td}else return $APP.Td}else return $APP.Td},Ym=function(a){var b=$APP.l(a,"__xStepperRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div");c.textContent=":host{display:block;color-scheme:light dark;--x-stepper-indicator-size:2rem;--x-stepper-connector-thickness:2px;--x-stepper-step-gap:0.75rem;--x-stepper-font-size:0.875rem;--x-stepper-label-font-weight:500;--x-stepper-desc-font-size:0.75rem;--x-stepper-radius:999px;--x-stepper-motion:120ms;--x-stepper-press-scale:0.93;--x-stepper-focus-ring:rgba(0,0,0,0.55);--x-stepper-disabled-opacity:0.5;--x-stepper-complete-bg:rgba(16,140,72,1);--x-stepper-complete-color:#fff;--x-stepper-complete-connector:rgba(16,140,72,1);--x-stepper-current-bg:rgba(0,102,204,1);--x-stepper-current-color:#fff;--x-stepper-upcoming-bg:rgba(0,0,0,0.08);--x-stepper-upcoming-color:rgba(0,0,0,0.45);--x-stepper-idle-connector:rgba(0,0,0,0.12);--x-stepper-label-done-color:rgba(0,0,0,0.85);--x-stepper-label-current-color:rgba(0,0,0,0.85);--x-stepper-label-upcoming-color:rgba(0,0,0,0.4);--x-stepper-desc-color:rgba(0,0,0,0.4);}@media (prefers-color-scheme:dark){:host{--x-stepper-focus-ring:rgba(255,255,255,0.7);--x-stepper-complete-bg:rgba(60,210,120,1);--x-stepper-complete-color:#000;--x-stepper-complete-connector:rgba(60,210,120,1);--x-stepper-current-bg:rgba(80,160,255,1);--x-stepper-current-color:#000;--x-stepper-upcoming-bg:rgba(255,255,255,0.1);--x-stepper-upcoming-color:rgba(255,255,255,0.35);--x-stepper-idle-connector:rgba(255,255,255,0.12);--x-stepper-label-done-color:rgba(255,255,255,0.9);--x-stepper-label-current-color:rgba(255,255,255,0.9);--x-stepper-label-upcoming-color:rgba(255,255,255,0.3);--x-stepper-desc-color:rgba(255,255,255,0.35);}}[part\x3dcontainer]{display:flex;align-items:flex-start;margin:0;padding:0;list-style:none;}:host([data-orientation\x3dhorizontal]) [part\x3dcontainer]{flex-direction:row;}:host([data-orientation\x3dhorizontal]) [part\x3dstep]{display:flex;flex-direction:column;align-items:center;flex:1;min-width:0;}:host([data-orientation\x3dhorizontal]) [part\x3dstep-track]{display:flex;align-items:center;width:100%;}:host([data-orientation\x3dhorizontal]) [part\x3dstep-connector]{flex:1;height:var(--x-stepper-connector-thickness);min-width:8px;}:host([data-orientation\x3dhorizontal]) [part\x3dstep-content]{display:flex;flex-direction:column;align-items:center;text-align:center;padding:var(--x-stepper-step-gap) 4px 0;width:100%;}:host([data-orientation\x3dvertical]) [part\x3dcontainer]{flex-direction:column;}:host([data-orientation\x3dvertical]) [part\x3dstep]{display:flex;flex-direction:row;gap:var(--x-stepper-step-gap);}:host([data-orientation\x3dvertical]) [part\x3dstep-track]{display:flex;flex-direction:column;align-items:center;flex-shrink:0;width:var(--x-stepper-indicator-size);}:host([data-orientation\x3dvertical]) [part\x3dstep-connector]{flex:1;width:var(--x-stepper-connector-thickness);min-height:16px;margin:4px 0;}:host([data-orientation\x3dvertical]) [part\x3dstep-content]{display:flex;flex-direction:column;flex:1;min-width:0;padding-bottom:var(--x-stepper-step-gap);}[part\x3dstep-indicator]{display:inline-flex;align-items:center;justify-content:center;width:var(--x-stepper-indicator-size);height:var(--x-stepper-indicator-size);border-radius:var(--x-stepper-radius);border:none;padding:0;margin:0;cursor:pointer;font-size:0.875em;font-weight:600;font-family:inherit;flex-shrink:0;position:relative;z-index:1;transition:background var(--x-stepper-motion) ease,color var(--x-stepper-motion) ease,transform 80ms ease;}[part\x3dstep-indicator]:focus{outline:none;}[part\x3dstep-indicator]:focus-visible{outline:2px solid var(--x-stepper-focus-ring);outline-offset:3px;}[data-state\x3dcomplete] [part\x3dstep-indicator]{background:var(--x-stepper-complete-bg);color:var(--x-stepper-complete-color);}[data-state\x3dcurrent] [part\x3dstep-indicator]{background:var(--x-stepper-current-bg);color:var(--x-stepper-current-color);cursor:default;}[data-state\x3dupcoming] [part\x3dstep-indicator]{background:var(--x-stepper-upcoming-bg);color:var(--x-stepper-upcoming-color);}[data-state\x3dcomplete] [part\x3dstep-connector]{background:var(--x-stepper-complete-connector);}[data-state\x3dcurrent] [part\x3dstep-connector],[data-state\x3dupcoming] [part\x3dstep-connector]{background:var(--x-stepper-idle-connector);}[part\x3dstep]:last-child [part\x3dstep-connector]{display:none;}[part\x3dstep-label]{font-size:var(--x-stepper-font-size);line-height:1.3;font-family:inherit;}[data-state\x3dcomplete] [part\x3dstep-label]{color:var(--x-stepper-label-done-color);}[data-state\x3dcurrent] [part\x3dstep-label]{color:var(--x-stepper-label-current-color);font-weight:var(--x-stepper-label-font-weight);}[data-state\x3dupcoming] [part\x3dstep-label]{color:var(--x-stepper-label-upcoming-color);}[part\x3dstep-description]{font-size:var(--x-stepper-desc-font-size);color:var(--x-stepper-desc-color);line-height:1.3;margin-top:0.2em;}:host(:not([disabled])) [data-state\x3dcomplete] [part\x3dstep-indicator]:hover,:host(:not([disabled])) [data-state\x3dupcoming] [part\x3dstep-indicator]:hover{filter:brightness(0.88);}:host(:not([disabled])) [data-state\x3dcomplete] [part\x3dstep-indicator]:active,:host(:not([disabled])) [data-state\x3dupcoming] [part\x3dstep-indicator]:active{transform:scale(var(--x-stepper-press-scale));}:host([disabled]){opacity:var(--x-stepper-disabled-opacity);}:host([disabled]) [part\x3dstep-indicator]{cursor:default;pointer-events:none;}:host([data-size\x3dsm]){--x-stepper-indicator-size:1.5rem;--x-stepper-font-size:0.8125rem;--x-stepper-desc-font-size:0.6875rem;}:host([data-size\x3dlg]){--x-stepper-indicator-size:2.5rem;--x-stepper-font-size:1rem;--x-stepper-desc-font-size:0.875rem;}@media (prefers-reduced-motion:reduce){[part\x3dstep-indicator]{transition:none;}}";
|
|
5
|
+
d.setAttribute("part","container");d.setAttribute("role","list");b.appendChild(c);b.appendChild(d);a.__xStepperRefs=new $APP.R(null,2,[$APP.Jh,b,$APP.yi,d],null);return $APP.l(a,"__xStepperRefs")},bn=function(a){a=new $APP.R(null,5,[Zm,a.getAttribute("steps"),$m,a.getAttribute("current"),$APP.ik,a.getAttribute("orientation"),$APP.hk,a.getAttribute("size"),$APP.X,a.hasAttribute("disabled")],null);var b=$APP.N(a),c=$APP.I(b,Zm);a=$APP.I(b,$m);var d=$APP.I(b,$APP.ik),e=$APP.I(b,$APP.hk);b=$APP.I(b,$APP.X);
|
|
6
|
+
c=Xm(c);var g=$APP.B(c);return new $APP.R(null,5,[$APP.Bk,c,an,g===0?0:$APP.Fg.h(0,$APP.Gg.h(Wm(a),g-1)),$APP.Ij,Om(d),$APP.Wg,Tm(e),$APP.X,$APP.J(b)],null)},cn=function(a,b,c){return"Step "+$APP.T.g(a+1)+": "+$APP.T.g(b)+" ("+$APP.T.g(function(){var d=c instanceof $APP.M?c.qa:null;switch(d){case "complete":return"completed";case "current":return"current";case "upcoming":return"upcoming";default:throw Error("No matching clause: "+$APP.T.g(d));}}())+")"},dn=function(a,b,c,d){var e=$APP.N(b);b=$APP.I(e,
|
|
7
|
+
$APP.U);e=$APP.I(e,$APP.hj);var g=document.createElement("div"),h=document.createElement("div"),k=document.createElement("button"),m=document.createElement("span"),p=document.createElement("div"),q=document.createElement("div"),v=document.createElement("span"),x=document.createElement("span");a:{var y=c instanceof $APP.M?c.qa:null;switch(y){case "complete":y="complete";break a;case "current":y="current";break a;case "upcoming":y="upcoming";break a;default:throw Error("No matching clause: "+$APP.T.g(y));
|
|
8
|
+
}}b=$APP.n(b)?b:"";g.setAttribute("part","step");g.setAttribute("role","listitem");g.setAttribute("data-index",""+$APP.T.g(a));g.setAttribute("data-state",y);h.setAttribute("part","step-track");k.setAttribute("part","step-indicator");k.setAttribute("type","button");k.setAttribute("aria-label",cn(a,b,c));$APP.C.h(c,an)?k.setAttribute("aria-current","step"):k.removeAttribute("aria-current");k.setAttribute("tabindex",$APP.n(d)?"-1":"0");$APP.n(d)&&k.setAttribute("aria-disabled","true");m.setAttribute("part",
|
|
9
|
+
"step-number");m.setAttribute("aria-hidden","true");m.textContent=$APP.C.h(c,$APP.Jk)?"✓":""+$APP.T.g(a+1);p.setAttribute("part","step-connector");p.setAttribute("aria-hidden","true");q.setAttribute("part","step-content");v.setAttribute("part","step-label");v.textContent=b;x.setAttribute("part","step-description");$APP.n($APP.n(e)?$APP.O(e,""):e)?(x.textContent=e,x.style.display="block"):x.style.display="none";k.appendChild(m);h.appendChild(k);h.appendChild(p);q.appendChild(v);q.appendChild(x);g.appendChild(h);
|
|
10
|
+
g.appendChild(q);return g},fn=function(a){var b=bn(a);if($APP.O($APP.l(a,"__xStepperModel"),b)){b=$APP.N(b);var c=$APP.I(b,$APP.Bk),d=$APP.I(b,an),e=$APP.I(b,$APP.Ij),g=$APP.I(b,$APP.Wg),h=$APP.I(b,$APP.X),k=Ym(a);k=$APP.N(k);k=$APP.I(k,$APP.yi);a.setAttribute("data-orientation",Qm(e));a.setAttribute("data-size",Vm(g));k.innerHTML="";c=$APP.u($APP.Kd($APP.Kg,c));e=null;for(var m=g=0;;)if(m<g){var p=e.G(null,m),q=$APP.E(p,0,null);p=$APP.E(p,1,null);var v=q<d?$APP.Jk:$APP.C.h(q,d)?an:en;k.appendChild(dn(q,
|
|
11
|
+
p,v,h));m+=1}else if(c=$APP.u(c))$APP.Cc(c)?(g=$APP.qb(c),c=$APP.rb(c),e=g,g=$APP.B(g)):(g=$APP.w(c),e=$APP.E(g,0,null),g=$APP.E(g,1,null),m=e<d?$APP.Jk:$APP.C.h(e,d)?an:en,k.appendChild(dn(e,g,m,h)),c=$APP.z(c),e=null,g=0),m=0;else break;a.__xStepperModel=b}},hn=function(a){function b(d){var e=$APP.l(a,"__xStepperModel");e=$APP.n(e)?e:bn(a);$APP.n($APP.X.g(e))||(d=d.target.closest("[part\x3dstep-indicator]"),$APP.n(d)&&(d=parseInt(d.closest("[part\x3dstep]").getAttribute("data-index"),10),e=an.g(e),
|
|
12
|
+
typeof d==="number"&&$APP.r(isNaN(d))&&$APP.O(d,e)&&(e=$APP.Sg(new $APP.R(null,2,[$APP.dh,e,gn,d],null)),e=new CustomEvent("x-stepper-change",{detail:e,bubbles:!0,composed:!0,cancelable:!0}),e=a.dispatchEvent(e),$APP.n(e)&&a.setAttribute("current",""+$APP.T.g(d)))));return null}var c=Ym(a);c=$APP.N(c);$APP.I(c,$APP.yi).addEventListener("click",b);$APP.ma(a,"__xStepperHandlers",{click:b})},jn=function(a){var b=$APP.l(a,"__xStepperHandlers");if($APP.n(b)){var c=$APP.l(a,"__xStepperRefs");$APP.n(c)&&
|
|
13
|
+
(c=$APP.yi.g(c),b=$APP.l(b,"click"),$APP.n($APP.n(c)?b:c)&&c.removeEventListener("click",b))}a.__xStepperHandlers=null},kn=function(a){Object.defineProperty(a,"steps",{get:function(){var b=this.getAttribute("steps");return $APP.n(b)?b:"[]"},set:function(b){return $APP.n(b)?this.setAttribute("steps",""+$APP.T.g(b)):this.removeAttribute("steps")},enumerable:!0,configurable:!0});Object.defineProperty(a,"current",{get:function(){return Wm(this.getAttribute("current"))},set:function(b){return b==null?
|
|
14
|
+
this.removeAttribute("current"):this.setAttribute("current",""+$APP.T.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"orientation",{get:function(){return Qm(Om(this.getAttribute("orientation")))},set:function(b){return $APP.n(b)?this.setAttribute("orientation",""+$APP.T.g(b)):this.removeAttribute("orientation")},enumerable:!0,configurable:!0});Object.defineProperty(a,"size",{get:function(){return Vm(Tm(this.getAttribute("size")))},set:function(b){return $APP.n(b)?this.setAttribute("size",
|
|
15
|
+
""+$APP.T.g(b)):this.removeAttribute("size")},enumerable:!0,configurable:!0});Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.n(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0})},mn=function(){var a=class extends HTMLElement{};a.observedAttributes=ln;a.prototype.connectedCallback=function(){Ym(this);jn(this);hn(this);fn(this);return null};a.prototype.disconnectedCallback=function(){jn(this);
|
|
16
|
+
return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&fn(this);return null};kn(a.prototype);return a},nn=function(){$APP.n(customElements.get("x-stepper"))||customElements.define("x-stepper",mn());return null},an=new $APP.M(null,"current","current",-1088038603),on=new $APP.M(null,"vertical","vertical",718696748),en=new $APP.M(null,"upcoming","upcoming",1873315471),Zm=new $APP.M(null,"steps-raw","steps-raw",1741812533),Sm=new $APP.M(null,"md","md",707286655),pn=new $APP.M(null,
|
|
17
|
+
"lg","lg",-80787836),Nm=new $APP.M(null,"horizontal","horizontal",2062109475),qn=new $APP.M(null,"sm","sm",-1402575065),gn=new $APP.M(null,"to","to",192099007),$m=new $APP.M(null,"current-raw","current-raw",-1440665509);var ln=["steps","current","orientation","size","disabled"];$APP.Ed(["x-stepper-change",new $APP.R(null,2,[$APP.V,new $APP.R(null,2,[$APP.dh,$APP.W,gn,$APP.W],null),$APP.rk,!0],null)]);var Mm=new $APP.R(null,2,["horizontal",Nm,"vertical",on],null),Pm=new $APP.R(null,2,[Nm,"horizontal",on,"vertical"],null),Rm=new $APP.R(null,3,["sm",qn,"md",Sm,"lg",pn],null),Um=new $APP.R(null,3,[qn,"sm",Sm,"md",pn,"lg"],null);$APP.ja("baredom.exports.x_stepper.init",nn);export const init=nn;
|
package/dist/x-switch.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.
|
|
4
|
-
e=$APP.
|
|
5
|
-
c.tabIndex=$APP.n(d)?-1:0;$APP.n(d)?c.setAttribute("disabled",""):c.removeAttribute("disabled");
|
|
6
|
-
cancelable:!0});a.dispatchEvent(d);return $APP.
|
|
7
|
-
$APP.l(b,"control");b.removeEventListener("click",$APP.l(c,"click"));b.removeEventListener("keydown",$APP.l(c,"keydown"));a.__xSwitchHandlers=null;return}}return null},
|
|
8
|
-
null&&$APP.O(d)?
|
|
2
|
+
var hK=function(a,b,c){return a.setAttribute(b,c)},iK=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},jK=function(a){a=$APP.mf([$APP.Pj,$APP.ck,$APP.Xg,$APP.hh,$APP.mi,$APP.Bi,$APP.Ak,$APP.Hi,$APP.ui],[a.getAttribute("name"),a.hasAttribute("disabled"),a.hasAttribute("required"),a.getAttribute("aria-labelledby"),a.hasAttribute("checked"),a.hasAttribute("readonly"),a.getAttribute("value"),a.getAttribute("aria-label"),a.getAttribute("aria-describedby")]);var b=$APP.N(a);a=
|
|
3
|
+
$APP.I(b,$APP.Hi);var c=$APP.I(b,$APP.ui),d=$APP.I(b,$APP.Pj),e=$APP.I(b,$APP.ck),g=$APP.I(b,$APP.Xg),h=$APP.I(b,$APP.hh),k=$APP.I(b,$APP.mi),m=$APP.I(b,$APP.Bi);b=$APP.I(b,$APP.Ak);k=$APP.J(k);g=$APP.J(g);return $APP.mf([$APP.ph,$APP.kh,$APP.Uk,$APP.wi,$APP.bh,$APP.si,$APP.Xh,$APP.Pi,$APP.Qk,$APP.dk,$APP.X],[g,k?"true":"false",$APP.J(m),k,$APP.n(g)?k:!0,d,b!=null?b:"on",h,c,a,$APP.J(e)])},kK=function(a){var b=$APP.l(a,"__xSwitchRefs");if($APP.n(b)){var c=$APP.l(b,"control");b=jK(a);var d=$APP.X.g(b),
|
|
4
|
+
e=$APP.wi.g(b);hK(c,"aria-checked",$APP.kh.g(b));c.setAttribute("aria-disabled",$APP.n(d)?"true":"false");hK(c,"aria-required",$APP.n($APP.ph.g(b))?"true":"false");hK(c,"aria-readonly",$APP.n($APP.Uk.g(b))?"true":"false");var g=$APP.dk.g(b);$APP.n(g)?c.setAttribute("aria-label",g):c.removeAttribute("aria-label");g=$APP.Pi.g(b);$APP.n(g)?c.setAttribute("aria-labelledby",g):c.removeAttribute("aria-labelledby");g=$APP.Qk.g(b);$APP.n(g)?c.setAttribute("aria-describedby",g):c.removeAttribute("aria-describedby");
|
|
5
|
+
c.tabIndex=$APP.n(d)?-1:0;$APP.n(d)?c.setAttribute("disabled",""):c.removeAttribute("disabled");iK(a,"data-checked",e);iK(a,"data-disabled",d);a=$APP.l(a,"__xSwitchInternals");return $APP.n(a)?a.setFormValue($APP.n(e)?$APP.Xh.g(b):null):null}return null},lK=function(a){var b=jK(a),c=$APP.X.g(b),d=$APP.Uk.g(b);if($APP.n($APP.n(c)?c:d))return null;d=$APP.wi.g(b);c=$APP.r(d);b=$APP.Xh.g(b);d=new CustomEvent("x-switch-change-request",{detail:{value:b,previousChecked:d,nextChecked:c},bubbles:!0,composed:!0,
|
|
6
|
+
cancelable:!0});a.dispatchEvent(d);return $APP.r(d.defaultPrevented)?(iK(a,"checked",c),kK(a),a.dispatchEvent(new CustomEvent("x-switch-change",{detail:{value:b,checked:c},bubbles:!0,composed:!0,cancelable:!1}))):null},mK=function(a){return function(){return lK(a)}},nK=function(a){return function(b){var c=b.key;return $APP.C.h(c," ")||$APP.C.h(c,"Enter")?(b.preventDefault(),lK(a)):null}},oK=function(a){var b=$APP.l(a,"__xSwitchRefs");if($APP.n(b)){var c=$APP.l(a,"__xSwitchHandlers");if($APP.n(c)){b=
|
|
7
|
+
$APP.l(b,"control");b.removeEventListener("click",$APP.l(c,"click"));b.removeEventListener("keydown",$APP.l(c,"keydown"));a.__xSwitchHandlers=null;return}}return null},pK=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return iK(this,c,$APP.J(d))}})},qK=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 d!=
|
|
8
|
+
null&&$APP.O(d)?hK(this,c,""+$APP.T.g(d)):this.removeAttribute(c)}})},sK=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return rK}});pK(b,"checked","checked");pK(b,"disabled","disabled");pK(b,"readOnly","readonly");pK(b,"required","required");qK(b,"name","name");qK(b,"value","value");b.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xSwitchRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),
|
|
9
9
|
e=document.createElement("button"),g=document.createElement("span"),h=document.createElement("span");d.textContent=":host{display:inline-block;vertical-align:middle;color-scheme:light dark;--x-switch-track-width:44px;--x-switch-track-height:24px;--x-switch-thumb-size:18px;--x-switch-thumb-offset:3px;--x-switch-track-radius:999px;--x-switch-track-bg:#d1d5db;--x-switch-track-bg-checked:#2563eb;--x-switch-thumb-bg:#ffffff;--x-switch-focus-ring:#60a5fa;--x-switch-disabled-opacity:0.45;--x-switch-transition:background 150ms ease,transform 150ms ease;}@media (prefers-color-scheme:dark){:host{--x-switch-track-bg:#4b5563;--x-switch-track-bg-checked:#3b82f6;--x-switch-thumb-bg:#f9fafb;--x-switch-focus-ring:#93c5fd;}}[part\x3dcontrol]{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;padding:0;cursor:pointer;}[part\x3dcontrol][disabled]{cursor:default;opacity:var(--x-switch-disabled-opacity);}[part\x3dcontrol]:focus-visible{outline:none;box-shadow:0 0 0 3px var(--x-switch-focus-ring);border-radius:calc(var(--x-switch-track-radius) + 2px);}[part\x3dtrack]{position:relative;display:inline-block;width:var(--x-switch-track-width);height:var(--x-switch-track-height);border-radius:var(--x-switch-track-radius);background:var(--x-switch-track-bg);transition:background 150ms ease;flex-shrink:0;}:host([data-checked]) [part\x3dtrack]{background:var(--x-switch-track-bg-checked);}[part\x3dthumb]{position:absolute;top:var(--x-switch-thumb-offset);left:var(--x-switch-thumb-offset);width:var(--x-switch-thumb-size);height:var(--x-switch-thumb-size);border-radius:50%;background:var(--x-switch-thumb-bg);box-shadow:0 1px 3px rgba(0,0,0,0.25);transition:transform 150ms ease;}:host([data-checked]) [part\x3dthumb]{transform:translateX(calc(var(--x-switch-track-width) - var(--x-switch-thumb-size) - calc(var(--x-switch-thumb-offset) * 2)));}@media (prefers-reduced-motion:reduce){[part\x3dtrack]{transition:none;}[part\x3dthumb]{transition:none;}}";
|
|
10
|
-
e.setAttribute("part","control");e.setAttribute("type","button");e.setAttribute("role","switch");g.setAttribute("part","track");h.setAttribute("part","thumb");g.appendChild(h);e.appendChild(g);c.appendChild(d);c.appendChild(e);this.__xSwitchRefs={root:c,control:e,track:g,thumb:h};$APP.n(this.attachInternals)&&(this.__xSwitchInternals=this.attachInternals())}
|
|
11
|
-
d),c.addEventListener("keydown",e),this.__xSwitchHandlers=g);d=this.getAttribute("id");$APP.n(d)&&(c=document.querySelector("label[for\x3d'"+$APP.
|
|
12
|
-
function(c){
|
|
10
|
+
e.setAttribute("part","control");e.setAttribute("type","button");e.setAttribute("role","switch");g.setAttribute("part","track");h.setAttribute("part","thumb");g.appendChild(h);e.appendChild(g);c.appendChild(d);c.appendChild(e);this.__xSwitchRefs={root:c,control:e,track:g,thumb:h};$APP.n(this.attachInternals)&&(this.__xSwitchInternals=this.attachInternals())}oK(this);c=$APP.l(this,"__xSwitchRefs");$APP.n(c)&&(c=$APP.l(c,"control"),d=mK(this),e=nK(this),g={click:d,keydown:e},c.addEventListener("click",
|
|
11
|
+
d),c.addEventListener("keydown",e),this.__xSwitchHandlers=g);d=this.getAttribute("id");$APP.n(d)&&(c=document.querySelector("label[for\x3d'"+$APP.T.g(d)+"']"),$APP.n(c)&&(e=c.getAttribute("id"),$APP.n(e)?c=e:(d="x-sw-lbl-"+$APP.T.g(d),c.setAttribute("id",d),c=d),d=$APP.l(this,"__xSwitchRefs"),$APP.n(d)&&$APP.l(d,"control").setAttribute("aria-labelledby",c)));return kK(this)};b.disconnectedCallback=function(){return oK(this)};b.attributeChangedCallback=function(){return kK(this)};b.formDisabledCallback=
|
|
12
|
+
function(c){iK(this,"disabled",$APP.J(c));return kK(this)};b.formResetCallback=function(){this.removeAttribute("checked");return kK(this)};return a},tK=function(){return $APP.n(customElements.get("x-switch"))?null:customElements.define("x-switch",sK())};var rK="checked disabled readonly required name value aria-label aria-describedby aria-labelledby".split(" ");$APP.Ed(["x-switch-change-request",new $APP.R(null,2,[$APP.rk,!0,$APP.V,new $APP.R(null,3,[$APP.Xh,$APP.Y,$APP.fj,$APP.Ni,$APP.gk,$APP.Ni],null)],null),"x-switch-change",new $APP.R(null,2,[$APP.rk,!1,$APP.V,new $APP.R(null,2,[$APP.Xh,$APP.Y,$APP.Lk,$APP.Ni],null)],null)]);$APP.ja("baredom.exports.x_switch.init",tK);export const init=tK;
|
package/dist/x-tab.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a.hasAttribute("selected"),$APP.
|
|
4
|
-
$APP.
|
|
5
|
-
$APP.
|
|
2
|
+
var bl=function(a,b,c){return $APP.K(b,a)?a:c},gl=function(a){var b=$APP.N(a),c=$APP.I(b,$APP.Vi),d=$APP.I(b,$APP.Di);a=$APP.I(b,$APP.Ij);var e=$APP.I(b,$APP.Wg),g=$APP.I(b,$APP.jh),h=$APP.I(b,$APP.U);b=$APP.I(b,cl);c=$APP.J(c);var k=(d=$APP.J(d))?"-1":c?"0":"-1";return new $APP.R(null,8,[$APP.Vi,c,$APP.Di,d,$APP.Ij,bl(a,dl,"horizontal"),$APP.Wg,bl(e,el,"md"),$APP.jh,bl(g,fl,"default"),$APP.U,h,cl,b,$APP.rj,k],null)},hl=function(a){return new $APP.R(null,8,[$APP.Xh,a.getAttribute("value"),$APP.Vi,
|
|
3
|
+
a.hasAttribute("selected"),$APP.Di,a.hasAttribute("disabled"),$APP.Ij,a.getAttribute("orientation"),$APP.Wg,a.getAttribute("size"),$APP.jh,a.getAttribute("variant"),$APP.U,a.getAttribute("label"),cl,a.getAttribute("controls")],null)},il=function(a){var b=gl(hl(a)),c=$APP.l(a,"__x_tab_base");if($APP.n(c)){a.setAttribute("role","tab");a.setAttribute("aria-selected",$APP.n($APP.Vi.g(b))?"true":"false");$APP.n($APP.Di.g(b))?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");a.setAttribute("tabindex",
|
|
4
|
+
$APP.rj.g(b));var d=cl.g(b),e=$APP.U.g(b);$APP.n($APP.n(d)?$APP.O(d,""):d)?a.setAttribute("aria-controls",d):a.removeAttribute("aria-controls");$APP.n($APP.n(e)?$APP.O(e,""):e)?a.setAttribute("aria-label",e):a.removeAttribute("aria-label");c.setAttribute("data-selected",$APP.n($APP.Vi.g(b))?"true":"false");c.setAttribute("data-disabled",$APP.n($APP.Di.g(b))?"true":"false");c.setAttribute("data-size",$APP.Wg.g(b));c.setAttribute("data-variant",$APP.jh.g(b));return c.setAttribute("data-orientation",
|
|
5
|
+
$APP.Ij.g(b))}return null},jl=function(a){var b=gl(hl(a)),c=$APP.N(b);b=$APP.I(c,$APP.Vi);c=$APP.I(c,$APP.Di);$APP.r(c)&&$APP.r(b)?(b=a.getAttribute("value"),a=a.dispatchEvent(new CustomEvent("tab-select",{detail:{value:$APP.n(b)?b:""},bubbles:!0,composed:!0}))):a=null;return a},kl=function(a){a.addEventListener("click",function(){return jl(a)});a.addEventListener("keydown",function(b){var c=b.key;$APP.C.h(c,"Enter")||$APP.C.h(c," ")?(b.preventDefault(),b=jl(a)):b=null;return b})},ll=function(a){if($APP.l(a,
|
|
6
6
|
"__x_tab_initialized")!==!0){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("slot");c.textContent=":host{display:inline-block;color-scheme:light dark;outline:none;--x-tab-color:#0f172a;--x-tab-hover-background:rgba(15,23,42,0.05);--x-tab-selected-color:#1d4ed8;--x-tab-selected-background:rgba(59,130,246,0.12);--x-tab-selected-border-color:transparent;}@media (prefers-color-scheme:dark){:host{--x-tab-color:#94a3b8;--x-tab-hover-background:rgba(248,250,252,0.06);--x-tab-selected-color:#60a5fa;--x-tab-selected-background:rgba(59,130,246,0.18);--x-tab-selected-border-color:#60a5fa;}}.base{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;user-select:none;padding:var(--x-tab-padding-md,10px 16px);border-radius:var(--x-tab-radius,8px);color:var(--x-tab-color);background:var(--x-tab-background,transparent);border:1px solid var(--x-tab-border-color,transparent);transition:background var(--x-tab-transition-duration,120ms) var(--x-tab-transition-timing,ease),color var(--x-tab-transition-duration,120ms) var(--x-tab-transition-timing,ease),border-color var(--x-tab-transition-duration,120ms) var(--x-tab-transition-timing,ease);}.base[data-size\x3d'sm']{padding:var(--x-tab-padding-sm,6px 12px);}.base[data-size\x3d'md']{padding:var(--x-tab-padding-md,10px 16px);}.base[data-size\x3d'lg']{padding:var(--x-tab-padding-lg,14px 20px);}.base:hover{background:var(--x-tab-hover-background);}.base[data-selected\x3d'true']{color:var(--x-tab-selected-color);background:var(--x-tab-selected-background);border-color:var(--x-tab-selected-border-color);}.base[data-variant\x3d'underline'][data-selected\x3d'true']{border-bottom:2px solid var(--x-tab-selected-color);background:transparent;}.base[data-variant\x3d'pill'][data-selected\x3d'true']{background:var(--x-tab-selected-background);}.base[data-disabled\x3d'true']{opacity:var(--x-tab-disabled-opacity,0.5);cursor:default;}:host(:focus-visible) .base{box-shadow:0 0 0 3px var(--x-tab-focus-ring,rgba(59,130,246,0.4));}@media (prefers-reduced-motion: reduce){.base{transition:none;}}";
|
|
7
|
-
d.setAttribute("part","base");d.className="base";d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__x_tab_root=b;a.__x_tab_base=d;
|
|
8
|
-
set:function(b){return $APP.n(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},configurable:!0,enumerable:!0});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})},
|
|
9
|
-
function(){return $APP.l(this,"__x_tab_initialized")===!0?
|
|
7
|
+
d.setAttribute("part","base");d.className="base";d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__x_tab_root=b;a.__x_tab_base=d;kl(a);a.__x_tab_initialized=!0}il(a);return a},ml=function(a){Object.defineProperty(a.prototype,"selected",{get:function(){return this.hasAttribute("selected")},set:function(b){return $APP.n(b)?this.setAttribute("selected",""):this.removeAttribute("selected")},configurable:!0,enumerable:!0});Object.defineProperty(a.prototype,"disabled",{get:function(){return this.hasAttribute("disabled")},
|
|
8
|
+
set:function(b){return $APP.n(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},configurable:!0,enumerable:!0});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})},ol=function(){var a=class extends HTMLElement{};a.observedAttributes=nl;a.prototype.connectedCallback=function(){return ll(this)};a.prototype.attributeChangedCallback=
|
|
9
|
+
function(){return $APP.l(this,"__x_tab_initialized")===!0?il(this):ll(this)};ml(a);return a},pl=function(){return $APP.n(customElements.get("x-tab"))?null:customElements.define("x-tab",ol())},cl=new $APP.M(null,"controls","controls",1340701452);var nl="value selected disabled orientation size variant label controls".split(" "),dl=new $APP.S(null,new $APP.R(null,2,["vertical",null,"horizontal",null],null),null),el=new $APP.S(null,new $APP.R(null,3,["md",null,"lg",null,"sm",null],null),null),fl=new $APP.S(null,new $APP.R(null,3,["default",null,"underline",null,"pill",null],null),null);$APP.Ed(["tab-select",new $APP.R(null,1,[$APP.V,new $APP.R(null,1,[$APP.Xh,$APP.Y],null)],null)]);$APP.ja("baredom.exports.x_tab.init",pl);export const init=pl;
|
package/dist/x-table-cell.js
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
"header"))?b:a},
|
|
2
|
+
var dG=function(a,b,c){a=typeof a==="string"?a.trim().toLowerCase():null;return $APP.K(b,a)?a:c},eG=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),$APP.r(isNaN(a))&&a>0?Math.floor(a):1):1},hG=function(a){var b=$APP.N(a);a=$APP.I(b,fG);b=$APP.I(b,gG);if($APP.n($APP.n(a)?a:$APP.O(b,"none")))switch(b){case "asc":return"ascending";case "desc":return"descending";default:return"none"}else return null},iG=function(a){var b=$APP.N(a);a=$APP.I(b,$APP.Z);b=$APP.I(b,fG);return(a=$APP.C.h(a,
|
|
3
|
+
"header"))?b:a},jG=function(a){switch(a){case "none":return"asc";case "asc":return"desc";case "desc":return"none";default:return"asc"}},kG=function(a){switch(a){case "none":return"Sort ascending";case "asc":return"Sort descending";case "desc":return"Remove sort";default:return"Sort ascending"}},pG=function(a){var b=$APP.l(a,"__xTableCellRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("span"),
|
|
4
4
|
g=document.createElement("slot"),h=document.createElement("button"),k=document.createElement("slot"),m=document.createElement("span");c.textContent=":host{display:block;box-sizing:border-box;color-scheme:light dark;--x-table-cell-padding:0.5rem 0.75rem;--x-table-cell-bg:transparent;--x-table-cell-header-bg:rgba(0,0,0,0.04);--x-table-cell-border-color:rgba(0,0,0,0.1);--x-table-cell-border-width:1px;--x-table-cell-color:inherit;--x-table-cell-header-color:inherit;--x-table-cell-font-size:inherit;--x-table-cell-header-font-weight:600;--x-table-cell-min-width:0;--x-table-cell-max-width:none;--x-table-cell-sort-color:rgba(0,0,0,0.4);--x-table-cell-sort-hover-color:rgba(0,0,0,0.7);--x-table-cell-focus-ring:rgba(59,130,246,0.5);--x-table-cell-transition-duration:150ms;--x-table-cell-sticky-bg:#ffffff;--x-table-cell-disabled-opacity:0.45;min-width:var(--x-table-cell-min-width);max-width:var(--x-table-cell-max-width);}@media (prefers-color-scheme:dark){:host{--x-table-cell-header-bg:rgba(255,255,255,0.06);--x-table-cell-border-color:rgba(255,255,255,0.1);--x-table-cell-sort-color:rgba(255,255,255,0.4);--x-table-cell-sort-hover-color:rgba(255,255,255,0.7);--x-table-cell-sticky-bg:#1f2937;}}:host([data-sticky\x3d'start']){position:sticky;inset-inline-start:0;background:var(--x-table-cell-sticky-bg);z-index:1;}:host([data-sticky\x3d'end']){position:sticky;inset-inline-end:0;background:var(--x-table-cell-sticky-bg);z-index:1;}:host([disabled]){opacity:var(--x-table-cell-disabled-opacity);}[part\x3dcell]{display:flex;align-items:center;justify-content:flex-start;padding:var(--x-table-cell-padding);background:var(--x-table-cell-bg);border-bottom:var(--x-table-cell-border-width) solid var(--x-table-cell-border-color);color:var(--x-table-cell-color);font-size:var(--x-table-cell-font-size);min-width:0;box-sizing:border-box;}:host([data-type\x3d'header']) [part\x3dcell]{background:var(--x-table-cell-header-bg);color:var(--x-table-cell-header-color);font-weight:var(--x-table-cell-header-font-weight);}:host([data-align\x3d'start']) [part\x3dcell]{justify-content:flex-start;}:host([data-align\x3d'center']) [part\x3dcell]{justify-content:center;}:host([data-align\x3d'end']) [part\x3dcell]{justify-content:flex-end;}:host([data-valign\x3d'top']) [part\x3dcell]{align-items:flex-start;}:host([data-valign\x3d'middle']) [part\x3dcell]{align-items:center;}:host([data-valign\x3d'bottom']) [part\x3dcell]{align-items:flex-end;}[part\x3dcontent]{flex:1 1 auto;min-width:0;}:host([data-truncate]) [part\x3dcontent]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}[part\x3dsort-btn]{flex:0 0 auto;appearance:none;border:0;background:transparent;padding:2px;margin:0 0 0 4px;cursor:pointer;color:var(--x-table-cell-sort-color);display:inline-flex;align-items:center;justify-content:center;border-radius:4px;transition:color var(--x-table-cell-transition-duration) ease;line-height:1;}[part\x3dsort-btn]:hover{color:var(--x-table-cell-sort-hover-color);}[part\x3dsort-btn]:focus{outline:none;}[part\x3dsort-btn]:focus-visible{outline:2px solid var(--x-table-cell-focus-ring);outline-offset:2px;}[part\x3dsort-btn][disabled]{cursor:default;pointer-events:none;opacity:0.4;}[part\x3dsort-btn][hidden]{display:none !important;}@media (prefers-reduced-motion:reduce){[part\x3dsort-btn]{transition:none !important;}}";
|
|
5
5
|
d.setAttribute("part","cell");e.setAttribute("part","content");e.appendChild(g);h.setAttribute("part","sort-btn");h.setAttribute("type","button");k.setAttribute("name","sort-icon");m.setAttribute("part","sort-icon-default");m.setAttribute("aria-hidden","true");m.innerHTML='\x3csvg width\x3d"16" height\x3d"16" viewBox\x3d"0 0 16 16" fill\x3d"currentColor" aria-hidden\x3d"true"\x3e\x3cpath d\x3d"M8 3L5 7h6L8 3zm0 10l3-4H5l3 4z"/\x3e\x3c/svg\x3e';k.appendChild(m);h.appendChild(k);d.appendChild(e);d.appendChild(h);
|
|
6
|
-
b.appendChild(c);b.appendChild(d);a.__xTableCellRefs=new $APP.
|
|
7
|
-
var b=$APP.N(a);a=$APP.
|
|
8
|
-
var c=$APP.
|
|
9
|
-
p):a.removeAttribute("aria-sort");$APP.n(D)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");a.setAttribute("data-type",
|
|
10
|
-
m=$APP.
|
|
11
|
-
break a;default:e='\x3csvg width\x3d"16" height\x3d"16" viewBox\x3d"0 0 16 16" fill\x3d"currentColor" aria-hidden\x3d"true"\x3e\x3cpath d\x3d"M8 3L5 7h6L8 3zm0 10l3-4H5l3 4z"/\x3e\x3c/svg\x3e'}h.innerHTML=e;a.__xTableCellModel=b}},
|
|
12
|
-
return $APP.n(c)?c:
|
|
13
|
-
null},
|
|
14
|
-
Object.defineProperty(a,"align",{get:function(){var b=this.getAttribute("align");return $APP.n(b)?b:"start"},set:function(b){return $APP.n(b)?this.setAttribute("align",""+$APP.
|
|
15
|
-
"truncate",{get:function(){return this.hasAttribute("truncate")},set:function(b){return $APP.n(b)?this.setAttribute("truncate",""):this.removeAttribute("truncate")},enumerable:!0,configurable:!0});Object.defineProperty(a,"sticky",{get:function(){var b=this.getAttribute("sticky");return $APP.n(b)?b:"none"},set:function(b){return $APP.n(b)?this.setAttribute("sticky",""+$APP.
|
|
16
|
-
set:function(b){return $APP.n(b)?this.setAttribute("sortable",""):this.removeAttribute("sortable")},enumerable:!0,configurable:!0});Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.n(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0});Object.defineProperty(a,"colSpan",{get:function(){return
|
|
17
|
-
b>0?this.setAttribute("col-span",""+$APP.
|
|
18
|
-
set:function(b){return $APP.n(b)?this.setAttribute("sort-direction",""+$APP.
|
|
19
|
-
|
|
20
|
-
customElements.define("x-table-cell",
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"desc",null,"asc",null],null),null);$APP.ja("baredom.exports.x_table_cell.init",WD);export const init=WD;
|
|
6
|
+
b.appendChild(c);b.appendChild(d);a.__xTableCellRefs=new $APP.R(null,5,[$APP.Jh,b,lG,d,mG,e,nG,h,oG,m],null);return $APP.l(a,"__xTableCellRefs")},EG=function(a){a=$APP.mf([$APP.Wh,qG,rG,sG,fG,$APP.Nh,$APP.yh,tG,uG,$APP.X,vG],[a.getAttribute("align"),a.getAttribute("row-span"),a.getAttribute("valign"),a.getAttribute("sort-direction"),a.hasAttribute("sortable"),a.hasAttribute("truncate"),a.getAttribute("type"),a.getAttribute("sticky"),a.getAttribute("scope"),a.hasAttribute("disabled"),a.getAttribute("col-span")]);
|
|
7
|
+
var b=$APP.N(a);a=$APP.I(b,$APP.X);var c=$APP.I(b,vG),d=$APP.I(b,$APP.Wh),e=$APP.I(b,qG),g=$APP.I(b,rG),h=$APP.I(b,sG),k=$APP.I(b,fG),m=$APP.I(b,$APP.Nh),p=$APP.I(b,$APP.yh),q=$APP.I(b,tG);b=$APP.I(b,uG);return $APP.mf([$APP.qi,gG,wG,$APP.Z,xG,fG,$APP.Wj,$APP.zk,$APP.Nh,$APP.X,$APP.gh],[dG(d,yG,"start"),dG(h,zG,"none"),dG(g,AG,"middle"),dG(p,BG,"data"),dG(b,CG,"col"),$APP.J(k),dG(q,DG,"none"),eG(c),$APP.J(m),$APP.J(a),eG(e)])},FG=function(a){var b=EG(a);if($APP.O($APP.l(a,"__xTableCellModel"),b)){b=
|
|
8
|
+
$APP.N(b);var c=$APP.I(b,$APP.zk),d=$APP.I(b,$APP.gh),e=$APP.I(b,$APP.X),g=$APP.I(b,gG),h=pG(a);h=$APP.N(h);var k=$APP.I(h,nG);h=$APP.I(h,oG);var m=iG(b),p=$APP.N(b),q=$APP.I(p,$APP.Z),v=$APP.I(p,$APP.qi),x=$APP.I(p,wG),y=$APP.I(p,$APP.Wj),A=$APP.I(p,$APP.Nh),D=$APP.I(p,$APP.X);$APP.I(p,fG);$APP.I(p,gG);var G=a.setAttribute,H=$APP.N(p);var F=$APP.I(H,$APP.Z);H=$APP.I(H,xG);F=$APP.C.h(F,"header")?$APP.C.h(H,"row")||$APP.C.h(H,"rowgroup")?"rowheader":"columnheader":"cell";G.call(a,"role",F);p=hG(p);
|
|
9
|
+
$APP.n(p)?a.setAttribute("aria-sort",p):a.removeAttribute("aria-sort");$APP.n(D)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");a.setAttribute("data-type",q);a.setAttribute("data-align",v);a.setAttribute("data-valign",x);$APP.C.h(y,"none")?a.removeAttribute("data-sticky"):a.setAttribute("data-sticky",y);$APP.n(A)?a.setAttribute("data-truncate",""):a.removeAttribute("data-truncate");a.style.gridColumn=c>1?"span "+$APP.T.g(c):"";a.style.gridRow=d>1?"span "+$APP.T.g(d):"";
|
|
10
|
+
k.hidden=$APP.r(m);c=parseInt;q=$APP.N(b);m=$APP.I(q,$APP.Z);d=$APP.I(q,fG);q=$APP.I(q,$APP.X);m=$APP.C.h(m,"header");k.tabIndex=c($APP.n(m?$APP.n(d)?$APP.r(q):d:m)?"0":"-1",10);k.setAttribute("aria-label",kG(g));k.disabled=$APP.J(e);a:switch(e=$APP.N(b),$APP.I(e,gG)){case "asc":e='\x3csvg width\x3d"16" height\x3d"16" viewBox\x3d"0 0 16 16" fill\x3d"currentColor" aria-hidden\x3d"true"\x3e\x3cpath d\x3d"M8 4L4 10h8L8 4z"/\x3e\x3c/svg\x3e';break a;case "desc":e='\x3csvg width\x3d"16" height\x3d"16" viewBox\x3d"0 0 16 16" fill\x3d"currentColor" aria-hidden\x3d"true"\x3e\x3cpath d\x3d"M8 12l4-6H4l4 6z"/\x3e\x3c/svg\x3e';
|
|
11
|
+
break a;default:e='\x3csvg width\x3d"16" height\x3d"16" viewBox\x3d"0 0 16 16" fill\x3d"currentColor" aria-hidden\x3d"true"\x3e\x3cpath d\x3d"M8 3L5 7h6L8 3zm0 10l3-4H5l3 4z"/\x3e\x3c/svg\x3e'}h.innerHTML=e;a.__xTableCellModel=b}},GG=function(a){var b=a.getAttribute("sort-direction");b=dG(b,zG,"none");b=new CustomEvent("x-table-cell-sort",{detail:{direction:jG(b),previousDirection:b},bubbles:!0,composed:!0,cancelable:!0});a.dispatchEvent(b)},HG=function(a){var b=function(){var c=$APP.l(a,"__xTableCellModel");
|
|
12
|
+
return $APP.n(c)?c:EG(a)}();$APP.n(function(){var c=iG(b);return $APP.n(c)?$APP.r($APP.X.g(b)):c}())&&GG(a);return null},IG=function(a){function b(){return HG(a)}var c=pG(a);c=$APP.N(c);$APP.I(c,nG).addEventListener("click",b);$APP.ma(a,"__xTableCellHandlers",{"sort-click":b})},JG=function(a){var b=$APP.l(a,"__xTableCellHandlers"),c=$APP.l(a,"__xTableCellRefs");$APP.n($APP.n(b)?c:b)&&(c=$APP.N(c),c=$APP.I(c,nG),b=$APP.l(b,"sort-click"),$APP.n(b)&&c.removeEventListener("click",b));a.__xTableCellHandlers=
|
|
13
|
+
null},KG=function(a){Object.defineProperty(a,"type",{get:function(){var b=this.getAttribute("type");return $APP.n(b)?b:"data"},set:function(b){return $APP.n(b)?this.setAttribute("type",""+$APP.T.g(b)):this.removeAttribute("type")},enumerable:!0,configurable:!0});Object.defineProperty(a,"scope",{get:function(){var b=this.getAttribute("scope");return $APP.n(b)?b:"col"},set:function(b){return $APP.n(b)?this.setAttribute("scope",""+$APP.T.g(b)):this.removeAttribute("scope")},enumerable:!0,configurable:!0});
|
|
14
|
+
Object.defineProperty(a,"align",{get:function(){var b=this.getAttribute("align");return $APP.n(b)?b:"start"},set:function(b){return $APP.n(b)?this.setAttribute("align",""+$APP.T.g(b)):this.removeAttribute("align")},enumerable:!0,configurable:!0});Object.defineProperty(a,"valign",{get:function(){var b=this.getAttribute("valign");return $APP.n(b)?b:"middle"},set:function(b){return $APP.n(b)?this.setAttribute("valign",""+$APP.T.g(b)):this.removeAttribute("valign")},enumerable:!0,configurable:!0});Object.defineProperty(a,
|
|
15
|
+
"truncate",{get:function(){return this.hasAttribute("truncate")},set:function(b){return $APP.n(b)?this.setAttribute("truncate",""):this.removeAttribute("truncate")},enumerable:!0,configurable:!0});Object.defineProperty(a,"sticky",{get:function(){var b=this.getAttribute("sticky");return $APP.n(b)?b:"none"},set:function(b){return $APP.n(b)?this.setAttribute("sticky",""+$APP.T.g(b)):this.removeAttribute("sticky")},enumerable:!0,configurable:!0});Object.defineProperty(a,"sortable",{get:function(){return this.hasAttribute("sortable")},
|
|
16
|
+
set:function(b){return $APP.n(b)?this.setAttribute("sortable",""):this.removeAttribute("sortable")},enumerable:!0,configurable:!0});Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.n(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0});Object.defineProperty(a,"colSpan",{get:function(){return eG(this.getAttribute("col-span"))},set:function(b){b=parseInt(b,10);return $APP.r(isNaN(b))&&
|
|
17
|
+
b>0?this.setAttribute("col-span",""+$APP.T.g(b)):this.removeAttribute("col-span")},enumerable:!0,configurable:!0});Object.defineProperty(a,"rowSpan",{get:function(){return eG(this.getAttribute("row-span"))},set:function(b){b=parseInt(b,10);return $APP.r(isNaN(b))&&b>0?this.setAttribute("row-span",""+$APP.T.g(b)):this.removeAttribute("row-span")},enumerable:!0,configurable:!0});Object.defineProperty(a,"sortDirection",{get:function(){var b=this.getAttribute("sort-direction");return $APP.n(b)?b:"none"},
|
|
18
|
+
set:function(b){return $APP.n(b)?this.setAttribute("sort-direction",""+$APP.T.g(b)):this.removeAttribute("sort-direction")},enumerable:!0,configurable:!0})},OG=function(){var a=class extends HTMLElement{};a.observedAttributes=LG;a.prototype.connectedCallback=function(){pG(this);JG(this);IG(this);FG(this);var b=$APP.l(this,"__xTableCellModel");var c=$APP.n(b)?b:EG(this);b=this.dispatchEvent;var d=CustomEvent,e=$APP.N(c);c=$APP.I(e,$APP.Z);var g=$APP.I(e,xG),h=$APP.I(e,$APP.zk),k=$APP.I(e,$APP.gh);
|
|
19
|
+
e=$APP.I(e,$APP.qi);b.call(this,new d("x-table-cell-connected",{detail:$APP.Sg(new $APP.R(null,5,[$APP.Z,c,xG,g,MG,h,NG,k,$APP.qi,e],null)),bubbles:!0,composed:!0,cancelable:!1}));return null};a.prototype.disconnectedCallback=function(){JG(this);this.dispatchEvent(new CustomEvent("x-table-cell-disconnected",{detail:{},bubbles:!0,composed:!0,cancelable:!1}));return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&FG(this);return null};KG(a.prototype);return a},PG=function(){$APP.n(customElements.get("x-table-cell"))||
|
|
20
|
+
customElements.define("x-table-cell",OG());return null},nG=new $APP.M(null,"sort-btn","sort-btn",1913954560),mG=new $APP.M(null,"content","content",15833224),MG=new $APP.M(null,"colSpan","colSpan",872137394),lG=new $APP.M(null,"cell","cell",764245084),wG=new $APP.M(null,"valign","valign",1485197511),oG=new $APP.M(null,"sort-icon-default","sort-icon-default",-596209230),vG=new $APP.M(null,"col-span-raw","col-span-raw",1425293661),sG=new $APP.M(null,"sort-direction-raw","sort-direction-raw",-1822100883),
|
|
21
|
+
tG=new $APP.M(null,"sticky-raw","sticky-raw",1857578519),qG=new $APP.M(null,"row-span-raw","row-span-raw",-1130003707),uG=new $APP.M(null,"scope-raw","scope-raw",-773628648),gG=new $APP.M(null,"sort-direction","sort-direction",-1635889628),xG=new $APP.M(null,"scope","scope",-439358418),fG=new $APP.M(null,"sortable?","sortable?",291547474),rG=new $APP.M(null,"valign-raw","valign-raw",-1083375124),NG=new $APP.M(null,"rowSpan","rowSpan",826884002);var LG="type scope align valign col-span row-span truncate sticky sortable sort-direction disabled".split(" ");
|
|
22
|
+
$APP.mf([$APP.qi,NG,$APP.Vh,$APP.Di,wG,$APP.Z,xG,MG,$APP.Wj,new $APP.M(null,"sortable","sortable",2109633621),new $APP.M(null,"sortDirection","sortDirection",-45816999)],[new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.W],null),new $APP.R(null,1,[$APP.Z,$APP.Ni],null),new $APP.R(null,1,[$APP.Z,$APP.Ni],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.W],null),new $APP.R(null,
|
|
23
|
+
1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.Ni],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null)]);$APP.Ed(["x-table-cell-sort",new $APP.R(null,2,[$APP.V,new $APP.R(null,2,[$APP.ni,$APP.Y,$APP.Dk,$APP.Y],null),$APP.rk,!0],null),"x-table-cell-connected",new $APP.R(null,1,[$APP.V,new $APP.R(null,5,[$APP.Z,$APP.Y,xG,$APP.Y,MG,$APP.W,NG,$APP.W,$APP.qi,$APP.Y],null)],null),"x-table-cell-disconnected",new $APP.R(null,1,[$APP.V,$APP.Fd],null)]);
|
|
24
|
+
var BG=new $APP.S(null,new $APP.R(null,2,["data",null,"header",null],null),null),CG=new $APP.S(null,new $APP.R(null,4,["rowgroup",null,"col",null,"row",null,"colgroup",null],null),null),yG=new $APP.S(null,new $APP.R(null,3,["center",null,"start",null,"end",null],null),null),AG=new $APP.S(null,new $APP.R(null,3,["top",null,"middle",null,"bottom",null],null),null),DG=new $APP.S(null,new $APP.R(null,3,["none",null,"start",null,"end",null],null),null),zG=new $APP.S(null,new $APP.R(null,3,["none",null,
|
|
25
|
+
"desc",null,"asc",null],null),null);$APP.ja("baredom.exports.x_table_cell.init",PG);export const init=PG;
|
package/dist/x-table-row.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
b.appendChild(c);b.appendChild(d);a.__xTableRowRefs=new $APP.
|
|
4
|
-
"__xTableRowModel"),b)){
|
|
5
|
-
a.setAttribute("data-selected",""):a.removeAttribute("data-selected");$APP.n(g)?a.setAttribute("data-interactive",""):a.removeAttribute("data-interactive");a.tabIndex=$APP.n(
|
|
6
|
-
null)),bubbles:!0,composed:!0,cancelable:!0}))},
|
|
7
|
-
if($APP.n(b)){var c=$APP.l(b,"click");b=$APP.l(b,"keydown");$APP.n(c)&&a.removeEventListener("click",c);$APP.n(b)&&a.removeEventListener("keydown",b)}a.__xTableRowHandlers=null},
|
|
8
|
-
set:function(b){return $APP.n(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0});Object.defineProperty(a,"interactive",{get:function(){return this.hasAttribute("interactive")},set:function(b){return $APP.n(b)?this.setAttribute("interactive",""):this.removeAttribute("interactive")},enumerable:!0,configurable:!0});Object.defineProperty(a,"rowIndex",{get:function(){return
|
|
9
|
-
b>0?this.setAttribute("row-index",""+$APP.
|
|
10
|
-
4,[$APP.
|
|
11
|
-
|
|
2
|
+
var Us=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),$APP.r(isNaN(a))&&a>0?Math.floor(a):null):null},Vs=function(a){var b=$APP.N(a);a=$APP.I(b,$APP.Xj);b=$APP.I(b,$APP.X);return $APP.n(a)?$APP.r(b):a},Ws=function(a){if(!$APP.n($APP.l(a,"__xTableRowRefs"))){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("slot");c.textContent=":host{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;box-sizing:border-box;color-scheme:light dark;--x-table-row-bg:transparent;--x-table-row-hover-bg:rgba(0,0,0,0.03);--x-table-row-selected-bg:rgba(59,130,246,0.08);--x-table-row-selected-hover-bg:rgba(59,130,246,0.12);--x-table-row-focus-ring:rgba(59,130,246,0.5);--x-table-row-transition-duration:150ms;--x-table-row-disabled-opacity:0.45;--x-table-row-cursor:pointer;background:var(--x-table-row-bg);transition:background var(--x-table-row-transition-duration) ease;}@media (prefers-color-scheme:dark){:host{--x-table-row-hover-bg:rgba(255,255,255,0.04);--x-table-row-selected-bg:rgba(99,160,255,0.12);--x-table-row-selected-hover-bg:rgba(99,160,255,0.16);}}:host([data-selected]){background:var(--x-table-row-selected-bg);}:host([data-interactive]){cursor:var(--x-table-row-cursor);}:host([data-interactive]:hover){background:var(--x-table-row-hover-bg);}:host([data-interactive][data-selected]:hover){background:var(--x-table-row-selected-hover-bg);}:host([data-interactive]:focus){outline:none;}:host([data-interactive]:focus-visible){outline:2px solid var(--x-table-row-focus-ring);outline-offset:-2px;}:host([disabled]){opacity:var(--x-table-row-disabled-opacity);pointer-events:none;}slot{display:contents;}@media (prefers-reduced-motion:reduce){:host{transition:none !important;}}";
|
|
3
|
+
b.appendChild(c);b.appendChild(d);a.__xTableRowRefs=new $APP.R(null,2,[$APP.Jh,b,$APP.Uj,d],null)}},Zs=function(a){a=new $APP.R(null,4,[$APP.$h,a.hasAttribute("selected"),$APP.X,a.hasAttribute("disabled"),$APP.Xj,a.hasAttribute("interactive"),Xs,a.getAttribute("row-index")],null);var b=$APP.N(a);a=$APP.I(b,$APP.$h);var c=$APP.I(b,$APP.X),d=$APP.I(b,$APP.Xj);b=$APP.I(b,Xs);return new $APP.R(null,4,[$APP.$h,$APP.J(a),$APP.X,$APP.J(c),$APP.Xj,$APP.J(d),Ys,Us(b)],null)},$s=function(a){var b=Zs(a);if($APP.O($APP.l(a,
|
|
4
|
+
"__xTableRowModel"),b)){Ws(a);var c=$APP.N(b),d=$APP.I(c,$APP.$h),e=$APP.I(c,$APP.X),g=$APP.I(c,$APP.Xj),h=$APP.I(c,Ys);a.setAttribute("role","row");var k=$APP.N(c);var m=$APP.I(k,$APP.$h);k=$APP.I(k,$APP.Xj);m=$APP.n(m)?"true":$APP.n(k)?"false":null;$APP.n(m)?a.setAttribute("aria-selected",m):a.removeAttribute("aria-selected");$APP.n(e)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");h!=null?a.setAttribute("aria-rowindex",""+$APP.T.g(h)):a.removeAttribute("aria-rowindex");
|
|
5
|
+
$APP.n(d)?a.setAttribute("data-selected",""):a.removeAttribute("data-selected");$APP.n(g)?a.setAttribute("data-interactive",""):a.removeAttribute("data-interactive");a.tabIndex=$APP.n(Vs(c))?0:-1;a.__xTableRowModel=b}},at=function(a){var b=$APP.l(a,"__xTableRowModel");var c=$APP.n(b)?b:Zs(a);b=a.dispatchEvent;var d=CustomEvent,e=$APP.N(c);c=$APP.I(e,$APP.$h);var g=$APP.I(e,$APP.X);e=$APP.I(e,Ys);b.call(a,new d("x-table-row-click",{detail:$APP.Sg(new $APP.R(null,3,[$APP.zi,$APP.n(e)?e:0,$APP.Vi,c,
|
|
6
|
+
$APP.Di,g],null)),bubbles:!0,composed:!0,cancelable:!0}))},bt=function(a){function b(d){var e=d.key;if($APP.C.h(e,"Enter")||$APP.C.h(e," "))e=$APP.l(a,"__xTableRowModel"),e=$APP.n(e)?e:Zs(a),$APP.n(Vs(e))&&(d.preventDefault(),at(a));return null}function c(){var d=$APP.l(a,"__xTableRowModel");d=$APP.n(d)?d:Zs(a);$APP.n(Vs(d))&&at(a);return null}a.addEventListener("click",c);a.addEventListener("keydown",b);$APP.ma(a,"__xTableRowHandlers",{click:c,keydown:b})},ct=function(a){var b=$APP.l(a,"__xTableRowHandlers");
|
|
7
|
+
if($APP.n(b)){var c=$APP.l(b,"click");b=$APP.l(b,"keydown");$APP.n(c)&&a.removeEventListener("click",c);$APP.n(b)&&a.removeEventListener("keydown",b)}a.__xTableRowHandlers=null},dt=function(a){Object.defineProperty(a,"selected",{get:function(){return this.hasAttribute("selected")},set:function(b){return $APP.n(b)?this.setAttribute("selected",""):this.removeAttribute("selected")},enumerable:!0,configurable:!0});Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},
|
|
8
|
+
set:function(b){return $APP.n(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0});Object.defineProperty(a,"interactive",{get:function(){return this.hasAttribute("interactive")},set:function(b){return $APP.n(b)?this.setAttribute("interactive",""):this.removeAttribute("interactive")},enumerable:!0,configurable:!0});Object.defineProperty(a,"rowIndex",{get:function(){return Us(this.getAttribute("row-index"))},set:function(b){b=parseInt(b,10);return $APP.r(isNaN(b))&&
|
|
9
|
+
b>0?this.setAttribute("row-index",""+$APP.T.g(b)):this.removeAttribute("row-index")},enumerable:!0,configurable:!0})},ft=function(){var a=class extends HTMLElement{};a.observedAttributes=et;a.prototype.connectedCallback=function(){Ws(this);ct(this);bt(this);$s(this);var b=$APP.l(this,"__xTableRowModel");var c=$APP.n(b)?b:Zs(this);b=this.dispatchEvent;var d=CustomEvent,e=$APP.N(c);c=$APP.I(e,$APP.$h);var g=$APP.I(e,$APP.X),h=$APP.I(e,$APP.Xj);e=$APP.I(e,Ys);b.call(this,new d("x-table-row-connected",
|
|
10
|
+
{detail:$APP.Sg(new $APP.R(null,4,[$APP.zi,$APP.n(e)?e:0,$APP.Vi,c,$APP.Di,g,$APP.gi,h],null)),bubbles:!0,composed:!0,cancelable:!1}));return null};a.prototype.disconnectedCallback=function(){ct(this);document.dispatchEvent(new CustomEvent("x-table-row-disconnected",{detail:{},bubbles:!1,composed:!1,cancelable:!1}));return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.O(c,d)&&$s(this);return null};dt(a.prototype);return a},gt=function(){$APP.n(customElements.get("x-table-row"))||
|
|
11
|
+
customElements.define("x-table-row",ft());return null},Ys=new $APP.M(null,"row-index","row-index",-828710296),Xs=new $APP.M(null,"row-index-raw","row-index-raw",1490649093);var et=["selected","disabled","interactive","row-index"];$APP.Ed(["x-table-row-click",new $APP.R(null,2,[$APP.V,new $APP.R(null,3,[$APP.zi,$APP.W,$APP.Vi,$APP.Ni,$APP.Di,$APP.Ni],null),$APP.rk,!0],null),"x-table-row-connected",new $APP.R(null,2,[$APP.V,new $APP.R(null,4,[$APP.zi,$APP.W,$APP.Vi,$APP.Ni,$APP.Di,$APP.Ni,$APP.gi,$APP.Ni],null),$APP.rk,!1],null),"x-table-row-disconnected",new $APP.R(null,2,[$APP.V,$APP.Fd,$APP.rk,!1],null)]);$APP.ja("baredom.exports.x_table_row.init",gt);export const init=gt;
|