@vanelsas/baredom 0.2.2-alpha → 0.2.3-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/dist/base.js +164 -164
- package/dist/x-alert.js +17 -17
- package/dist/x-avatar-group.js +11 -11
- package/dist/x-avatar.js +16 -16
- 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 -18
- package/dist/x-card.js +7 -7
- package/dist/x-chart.js +47 -43
- package/dist/x-checkbox.js +11 -11
- package/dist/x-chip.js +9 -9
- package/dist/x-collapse.js +10 -10
- package/dist/x-command-palette.js +29 -29
- package/dist/x-container.js +5 -5
- package/dist/x-context-menu.js +19 -18
- package/dist/x-copy.js +21 -21
- package/dist/x-currency-field.js +19 -19
- package/dist/x-date-picker.js +33 -33
- package/dist/x-divider.js +9 -9
- 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 +11 -11
- package/dist/x-notification-center.js +9 -9
- package/dist/x-pagination.js +16 -16
- package/dist/x-popover.js +11 -11
- package/dist/x-progress-circle.js +7 -7
- package/dist/x-progress.js +7 -7
- package/dist/x-radio.js +11 -11
- package/dist/x-search-field.js +14 -14
- package/dist/x-select.js +9 -9
- package/dist/x-sidebar.js +25 -25
- 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 +7 -7
- package/dist/x-stepper.js +15 -15
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +7 -7
- package/dist/x-table-cell.js +20 -20
- package/dist/x-table-row.js +10 -10
- package/dist/x-table.js +11 -11
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +17 -17
- package/dist/x-timeline-item.js +20 -20
- package/dist/x-timeline.js +9 -9
- package/dist/x-toast.js +21 -21
- package/dist/x-toaster.js +8 -8
- package/package.json +1 -1
package/dist/x-spinner.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a.setAttribute("data-size",b);a.setAttribute("data-variant",c);a.setAttribute("aria-label",d)},
|
|
4
|
-
""+$APP.S.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.S.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0})},
|
|
2
|
+
var bG=function(a){var b=new $APP.P(null,3,[$APP.Ag,a.getAttribute("size"),$APP.Vg,a.getAttribute("variant"),$APP.W,a.getAttribute("label")],null);var c=$APP.M(b),d=$APP.I(c,$APP.Ag);b=$APP.I(c,$APP.Vg);c=$APP.I(c,$APP.W);d=typeof d==="string"&&$APP.Cc($F,d)?d:"md";b=typeof b==="string"&&$APP.Cc(aG,b)?b:"default";c=typeof c==="string"&&$APP.N("",c.trim())?c.trim():"Loading";d=$APP.M(new $APP.P(null,3,[$APP.Ag,d,$APP.Vg,b,$APP.W,c],null));b=$APP.I(d,$APP.Ag);c=$APP.I(d,$APP.Vg);d=$APP.I(d,$APP.W);
|
|
3
|
+
a.setAttribute("data-size",b);a.setAttribute("data-variant",c);a.setAttribute("aria-label",d)},cG=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.S.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.S.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.S.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0})},eG=function(){var a=class extends HTMLElement{};a.observedAttributes=dG;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}bG(this);return null};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(b,c,d){b=$APP.N(c,d);$APP.n(b?$APP.l(this,"__xSpinnerInit"):b)&&bG(this);return null};cG(a.prototype);return a},fG=function(){$APP.n(customElements.get("x-spinner"))||
|
|
7
|
+
customElements.define("x-spinner",eG());return null};var dG=["size","variant","label"],$F=new $APP.R(null,new $APP.P(null,5,["xs",null,"md",null,"lg",null,"xl",null,"sm",null],null),null),aG=new $APP.R(null,new $APP.P(null,5,["success",null,"warning",null,"primary",null,"danger",null,"default",null],null),null);$APP.ka("baredom.exports.x_spinner.init",fG);export const init=fG;
|
package/dist/x-stat.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
[d,e,g,
|
|
4
|
-
$APP.W.g(b);$APP.n(b)?a.setAttribute("aria-label",b):a.removeAttribute("aria-label")},
|
|
5
|
-
g=$APP.l(a,"__x_stat_hint");return $APP.n(c)?(
|
|
2
|
+
var Iy=function(a,b,c){return $APP.Cc(b,a)?a:c},Jy=function(a){return $APP.n($APP.n(a)?$APP.N("",a):a)?a:null},Sy=function(a){var b=$APP.M(a),c=$APP.I(b,Ky),d=$APP.I(b,Ly),e=$APP.I(b,$APP.ci),g=$APP.I(b,$APP.Vg);a=$APP.I(b,$APP.T);var h=$APP.I(b,$APP.ki),k=$APP.I(b,$APP.Ag),m=$APP.I(b,$APP.Gh);b=$APP.I(b,$APP.W);g=Iy(g,My,"default");e=Iy(e,Ny,"start");k=Iy(k,Oy,"md");c=Iy(c,Py,"normal");d=Iy(d,Qy,"neutral");m=$APP.J(m);return $APP.cf([Ly,$APP.ci,$APP.Vg,$APP.T,$APP.ki,$APP.Ag,$APP.Gh,$APP.W,Ry,Ky],
|
|
3
|
+
[d,e,g,Jy(a),Jy(h),k,m,Jy(b),m?"true":null,c])},Ty=function(a){return $APP.cf([Ly,$APP.ci,$APP.Vg,$APP.T,$APP.ki,$APP.Ag,$APP.Gh,$APP.W,Ky],[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")])},Uy=function(a,b){a.setAttribute("role","figure");var c=Ry.g(b);$APP.n(c)?a.setAttribute("aria-busy",c):a.removeAttribute("aria-busy");b=
|
|
4
|
+
$APP.W.g(b);$APP.n(b)?a.setAttribute("aria-label",b):a.removeAttribute("aria-label")},Vy=function(a,b){a.setAttribute("data-variant",$APP.Vg.g(b));a.setAttribute("data-align",$APP.ci.g(b));a.setAttribute("data-size",$APP.Ag.g(b));a.setAttribute("data-emphasis",Ky.g(b));a.setAttribute("data-trend",Ly.g(b));$APP.n($APP.Gh.g(b))?a.setAttribute("data-loading","true"):a.removeAttribute("data-loading")},Wy=function(a){var b=Sy(Ty(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)?(Uy(a,b),Vy(c,b),d.textContent=function(){var h=$APP.W.g(b);return $APP.n(h)?h:""}(),e.textContent=function(){var h=$APP.T.g(b);return $APP.n(h)?h:""}(),g.textContent=function(){var h=$APP.ki.g(b);return $APP.n(h)?h:""}()):null},Xy=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
6
|
k=document.createElement("div"),m=document.createElement("div"),q=document.createElement("span"),r=document.createElement("span"),v=document.createElement("span"),w=document.createElement("slot"),z=document.createElement("slot"),A=document.createElement("slot"),C=document.createElement("slot"),F=document.createElement("slot");c.textContent=":host{display:block;color-scheme:light dark;}.base{display:grid;gap:6px;}.label{font-size:12px;opacity:0.8;}.value{font-weight:600;font-size:20px;}.hint{font-size:12px;opacity:0.7;}.base[data-loading\x3d'true']{opacity:0.6;}";
|
|
7
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");w.setAttribute("name","icon");z.setAttribute("name","label");A.setAttribute("name","value");C.setAttribute("name","hint");e.appendChild(w);h.appendChild(z);h.appendChild(q);k.appendChild(A);k.appendChild(r);m.appendChild(C);m.appendChild(v);g.appendChild(h);g.appendChild(k);g.appendChild(m);g.appendChild(F);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=q;a.__x_stat_value=r;a.__x_stat_hint=v;a.__x_stat_initialized=!0}
|
|
9
|
-
customElements.define("x-stat",
|
|
10
|
-
"up",null,"down",null],null),null);$APP.ka("baredom.exports.x_stat.init"
|
|
8
|
+
d.appendChild(g);b.appendChild(c);b.appendChild(d);a.__x_stat_root=b;a.__x_stat_base=d;a.__x_stat_label=q;a.__x_stat_value=r;a.__x_stat_hint=v;a.__x_stat_initialized=!0}Wy(a);return a},Zy=function(){var a=class extends HTMLElement{};a.observedAttributes=Yy;a.prototype.connectedCallback=function(){return Xy(this)};a.prototype.attributeChangedCallback=function(){return $APP.l(this,"__x_stat_initialized")===!0?Wy(this):Xy(this)};return a},$y=function(){return $APP.n(customElements.get("x-stat"))?null:
|
|
9
|
+
customElements.define("x-stat",Zy())},Ky=new $APP.K(null,"emphasis","emphasis",293543451),Ry=new $APP.K(null,"aria-busy","aria-busy",793864247),Ly=new $APP.K(null,"trend","trend",54563841);var Yy="variant align size emphasis trend loading label value hint".split(" "),My=new $APP.R(null,new $APP.P(null,5,["warning",null,"positive",null,"subtle",null,"danger",null,"default",null],null),null),Ny=new $APP.R(null,new $APP.P(null,3,["center",null,"start",null,"end",null],null),null),Oy=new $APP.R(null,new $APP.P(null,3,["md",null,"lg",null,"sm",null],null),null),Py=new $APP.R(null,new $APP.P(null,2,["high",null,"normal",null],null),null),Qy=new $APP.R(null,new $APP.P(null,3,["neutral",null,
|
|
10
|
+
"up",null,"down",null],null),null);$APP.ka("baredom.exports.x_stat.init",$y);export const init=$y;
|
package/dist/x-stepper.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
b)))return a=parseInt(b,10),a>0&&a<=200?$APP.Md(function(d){return new $APP.P(null,2,[$APP.W,"Step "+$APP.S.g(d),$APP.Dg,null],null)},$APP.
|
|
4
|
-
$APP.gc(c)):$APP.Ld}catch(d){return $APP.Ld}else return $APP.Ld}else return $APP.Ld}
|
|
5
|
-
d.setAttribute("part","container");d.setAttribute("role","list");b.appendChild(c);b.appendChild(d);a.__xStepperRefs=new $APP.P(null,2,[$APP.
|
|
6
|
-
c
|
|
2
|
+
var Qk=function(a){a=$APP.I(Ok,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:Pk},Sk=function(a){a=$APP.I(Rk,a);return $APP.n(a)?a:"horizontal"},Vk=function(a){a=$APP.I(Tk,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:Uk},Xk=function(a){a=$APP.I(Wk,a);return $APP.n(a)?a:"md"},Yk=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),typeof a==="number"&&$APP.p(isNaN(a))&&a>=0?a:0):0},Zk=function(a){if(typeof a==="string"){var b=a.trim();if($APP.n($APP.Ef(/^\d+$/,
|
|
3
|
+
b)))return a=parseInt(b,10),a>0&&a<=200?$APP.Md(function(d){return new $APP.P(null,2,[$APP.W,"Step "+$APP.S.g(d),$APP.Dg,null],null)},$APP.Cf(1,a+1)):$APP.Ld;if($APP.n(function(){var d=$APP.N("",b);return d?b.startsWith("["):d}()))try{var c=JSON.parse(b);return $APP.n(Array.isArray(c))?$APP.Md(function(d){return new $APP.P(null,2,[$APP.W,function(){var e=$APP.l(d,"label");return typeof e==="string"?e:""}(),$APP.Dg,function(){var e=$APP.l(d,"description");return typeof e==="string"?e:null}()],null)},
|
|
4
|
+
$APP.gc(c)):$APP.Ld}catch(d){return $APP.Ld}else return $APP.Ld}else return $APP.Ld},$k=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.P(null,2,[$APP.rh,b,$APP.pi,d],null);return $APP.l(a,"__xStepperRefs")},el=function(a){a=new $APP.P(null,5,[al,a.getAttribute("steps"),bl,a.getAttribute("current"),$APP.ji,a.getAttribute("orientation"),$APP.fi,a.getAttribute("size"),$APP.U,a.hasAttribute("disabled")],null);var b=$APP.M(a),c=$APP.I(b,al);a=$APP.I(b,bl);var d=$APP.I(b,$APP.ji),e=$APP.I(b,$APP.fi);b=$APP.I(b,$APP.U);
|
|
6
|
+
c=Zk(c);var g=$APP.B(c);return new $APP.P(null,5,[cl,c,dl,g===0?0:$APP.kg.h(0,$APP.lg.h(Yk(a),g-1)),$APP.zh,Qk(d),$APP.Ag,Vk(e),$APP.U,$APP.J(b)],null)},fl=function(a,b,c){return"Step "+$APP.S.g(a+1)+": "+$APP.S.g(b)+" ("+$APP.S.g(function(){var d=c instanceof $APP.K?c.oa:null;switch(d){case "complete":return"completed";case "current":return"current";case "upcoming":return"upcoming";default:throw Error("No matching clause: "+$APP.S.g(d));}}())+")"},gl=function(a,b,c,d){var e=$APP.M(b);b=$APP.I(e,
|
|
7
7
|
$APP.W);e=$APP.I(e,$APP.Dg);var g=document.createElement("div"),h=document.createElement("div"),k=document.createElement("button"),m=document.createElement("span"),q=document.createElement("div"),r=document.createElement("div"),v=document.createElement("span"),w=document.createElement("span");a:{var z=c instanceof $APP.K?c.oa:null;switch(z){case "complete":z="complete";break a;case "current":z="current";break a;case "upcoming":z="upcoming";break a;default:throw Error("No matching clause: "+$APP.S.g(z));
|
|
8
|
-
}}b=$APP.n(b)?b:"";g.setAttribute("part","step");g.setAttribute("role","listitem");g.setAttribute("data-index",""+$APP.S.g(a));g.setAttribute("data-state",z);h.setAttribute("part","step-track");k.setAttribute("part","step-indicator");k.setAttribute("type","button");k.setAttribute("aria-label",
|
|
9
|
-
"true");m.textContent=$APP.E.h(c,$APP.
|
|
10
|
-
function(a){var b=
|
|
11
|
-
(g=$APP.ob(c),c=$APP.pb(c),e=g,g=$APP.B(g)):(g=$APP.x(c),e=$APP.H(g,0,null),g=$APP.H(g,1,null),m=e<d?$APP.
|
|
12
|
-
e)&&(e=$APP.xg(new $APP.P(null,2,[$APP.
|
|
13
|
-
b:c)&&c.removeEventListener("click",b))}a.__xStepperHandlers=null},
|
|
14
|
-
""+$APP.S.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"orientation",{get:function(){return
|
|
15
|
-
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})},
|
|
16
|
-
function(b,c,d){$APP.N(c,d)&&
|
|
17
|
-
"vertical","vertical",718696748),
|
|
8
|
+
}}b=$APP.n(b)?b:"";g.setAttribute("part","step");g.setAttribute("role","listitem");g.setAttribute("data-index",""+$APP.S.g(a));g.setAttribute("data-state",z);h.setAttribute("part","step-track");k.setAttribute("part","step-indicator");k.setAttribute("type","button");k.setAttribute("aria-label",fl(a,b,c));$APP.E.h(c,dl)?k.setAttribute("aria-current","step"):k.removeAttribute("aria-current");k.setAttribute("tabindex",$APP.n(d)?"-1":"0");m.setAttribute("part","step-number");m.setAttribute("aria-hidden",
|
|
9
|
+
"true");m.textContent=$APP.E.h(c,$APP.Oi)?"✓":""+$APP.S.g(a+1);q.setAttribute("part","step-connector");q.setAttribute("aria-hidden","true");r.setAttribute("part","step-content");v.setAttribute("part","step-label");v.textContent=b;w.setAttribute("part","step-description");$APP.n($APP.n(e)?$APP.N(e,""):e)?(w.textContent=e,w.style.display="block"):w.style.display="none";k.appendChild(m);h.appendChild(k);h.appendChild(q);r.appendChild(v);r.appendChild(w);g.appendChild(h);g.appendChild(r);return g},il=
|
|
10
|
+
function(a){var b=el(a);if($APP.N($APP.l(a,"__xStepperModel"),b)){b=$APP.M(b);var c=$APP.I(b,cl),d=$APP.I(b,dl),e=$APP.I(b,$APP.zh),g=$APP.I(b,$APP.Ag),h=$APP.I(b,$APP.U),k=$k(a);k=$APP.M(k);k=$APP.I(k,$APP.pi);a.setAttribute("data-orientation",Sk(e));a.setAttribute("data-size",Xk(g));k.innerHTML="";c=$APP.u($APP.Bd($APP.og,c));e=null;for(var m=g=0;;)if(m<g){var q=e.F(null,m),r=$APP.H(q,0,null);q=$APP.H(q,1,null);var v=r<d?$APP.Oi:$APP.E.h(r,d)?dl:hl;k.appendChild(gl(r,q,v,h));m+=1}else if(c=$APP.u(c))$APP.yc(c)?
|
|
11
|
+
(g=$APP.ob(c),c=$APP.pb(c),e=g,g=$APP.B(g)):(g=$APP.x(c),e=$APP.H(g,0,null),g=$APP.H(g,1,null),m=e<d?$APP.Oi:$APP.E.h(e,d)?dl:hl,k.appendChild(gl(e,g,m,h)),c=$APP.y(c),e=null,g=0),m=0;else break;a.__xStepperModel=b}},kl=function(a){function b(d){var e=$APP.l(a,"__xStepperModel");e=$APP.n(e)?e:el(a);$APP.n($APP.U.g(e))||(d=d.target.closest("[part\x3dstep-indicator]"),$APP.n(d)&&(d=parseInt(d.closest("[part\x3dstep]").getAttribute("data-index"),10),e=dl.g(e),typeof d==="number"&&$APP.p(isNaN(d))&&$APP.N(d,
|
|
12
|
+
e)&&(e=$APP.xg(new $APP.P(null,2,[$APP.Lg,e,jl,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.S.g(d)))));return null}var c=$k(a);c=$APP.M(c);$APP.I(c,$APP.pi).addEventListener("click",b);$APP.ma(a,"__xStepperHandlers",{click:b})},ll=function(a){var b=$APP.l(a,"__xStepperHandlers");if($APP.n(b)){var c=$APP.l(a,"__xStepperRefs");$APP.n(c)&&(c=$APP.pi.g(c),b=$APP.l(b,"click"),$APP.n($APP.n(c)?
|
|
13
|
+
b:c)&&c.removeEventListener("click",b))}a.__xStepperHandlers=null},ml=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.S.g(b)):this.removeAttribute("steps")},enumerable:!0,configurable:!0});Object.defineProperty(a,"current",{get:function(){return Yk(this.getAttribute("current"))},set:function(b){return b==null?this.removeAttribute("current"):this.setAttribute("current",
|
|
14
|
+
""+$APP.S.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"orientation",{get:function(){return Sk(Qk(this.getAttribute("orientation")))},set:function(b){return $APP.n(b)?this.setAttribute("orientation",""+$APP.S.g(b)):this.removeAttribute("orientation")},enumerable:!0,configurable:!0});Object.defineProperty(a,"size",{get:function(){return Xk(Vk(this.getAttribute("size")))},set:function(b){return $APP.n(b)?this.setAttribute("size",""+$APP.S.g(b)):this.removeAttribute("size")},enumerable:!0,
|
|
15
|
+
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})},ol=function(){var a=class extends HTMLElement{};a.observedAttributes=nl;a.prototype.connectedCallback=function(){$k(this);ll(this);kl(this);il(this);return null};a.prototype.disconnectedCallback=function(){ll(this);return null};a.prototype.attributeChangedCallback=
|
|
16
|
+
function(b,c,d){$APP.N(c,d)&&il(this);return null};ml(a.prototype);return a},pl=function(){$APP.n(customElements.get("x-stepper"))||customElements.define("x-stepper",ol());return null},hl=new $APP.K(null,"upcoming","upcoming",1873315471),dl=new $APP.K(null,"current","current",-1088038603),al=new $APP.K(null,"steps-raw","steps-raw",1741812533),Uk=new $APP.K(null,"md","md",707286655),ql=new $APP.K(null,"lg","lg",-80787836),Pk=new $APP.K(null,"horizontal","horizontal",2062109475),rl=new $APP.K(null,
|
|
17
|
+
"vertical","vertical",718696748),sl=new $APP.K(null,"sm","sm",-1402575065),jl=new $APP.K(null,"to","to",192099007),cl=new $APP.K(null,"steps","steps",-128433302),bl=new $APP.K(null,"current-raw","current-raw",-1440665509);var nl=["steps","current","orientation","size","disabled"];$APP.wd(["x-stepper-change",new $APP.P(null,2,[$APP.Y,new $APP.P(null,2,[$APP.Lg,$APP.Fh,jl,$APP.Fh],null),$APP.ui,!0],null)]);var Ok=new $APP.P(null,2,["horizontal",Pk,"vertical",rl],null),Rk=new $APP.P(null,2,[Pk,"horizontal",rl,"vertical"],null),Tk=new $APP.P(null,3,["sm",sl,"md",Uk,"lg",ql],null),Wk=new $APP.P(null,3,[sl,"sm",Uk,"md",ql,"lg"],null);$APP.ka("baredom.exports.x_stepper.init",pl);export const init=pl;
|
package/dist/x-switch.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.I(b,$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.p(d.defaultPrevented)?(
|
|
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.N(d)?
|
|
2
|
+
var XA=function(a,b,c){return a.setAttribute(b,c)},YA=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},ZA=function(a){a=$APP.cf([$APP.Jh,$APP.Yh,$APP.Cg,$APP.Qg,$APP.Zh,$APP.ti,$APP.Ei,$APP.Ci,$APP.ii],[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.M(a);a=
|
|
3
|
+
$APP.I(b,$APP.Ci);var c=$APP.I(b,$APP.ii),d=$APP.I(b,$APP.Jh),e=$APP.I(b,$APP.Yh),g=$APP.I(b,$APP.Cg),h=$APP.I(b,$APP.Qg),k=$APP.I(b,$APP.Zh),m=$APP.I(b,$APP.ti);b=$APP.I(b,$APP.Ei);k=$APP.J(k);g=$APP.J(g);return $APP.cf([$APP.ah,$APP.Wg,$APP.aj,$APP.ni,$APP.Ig,$APP.gi,$APP.T,$APP.Mi,$APP.Vi,$APP.$h,$APP.U],[g,k?"true":"false",$APP.J(m),k,$APP.n(g)?k:!0,d,b!=null?b:"on",h,c,a,$APP.J(e)])},$A=function(a){var b=$APP.l(a,"__xSwitchRefs");if($APP.n(b)){var c=$APP.l(b,"control");b=ZA(a);var d=$APP.U.g(b),
|
|
4
|
+
e=$APP.ni.g(b);XA(c,"aria-checked",$APP.Wg.g(b));c.setAttribute("aria-disabled",$APP.n(d)?"true":"false");XA(c,"aria-required",$APP.n($APP.ah.g(b))?"true":"false");XA(c,"aria-readonly",$APP.n($APP.aj.g(b))?"true":"false");var g=$APP.$h.g(b);$APP.n(g)?c.setAttribute("aria-label",g):c.removeAttribute("aria-label");g=$APP.Mi.g(b);$APP.n(g)?c.setAttribute("aria-labelledby",g):c.removeAttribute("aria-labelledby");g=$APP.Vi.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");YA(a,"data-checked",e);YA(a,"data-disabled",d);a=$APP.l(a,"__xSwitchInternals");return $APP.n(a)?a.setFormValue($APP.n(e)?$APP.T.g(b):null):null}return null},aB=function(a){var b=ZA(a),c=$APP.U.g(b),d=$APP.aj.g(b);if($APP.n($APP.n(c)?c:d))return null;d=$APP.ni.g(b);c=$APP.p(d);b=$APP.T.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.p(d.defaultPrevented)?(YA(a,"checked",c),$A(a),a.dispatchEvent(new CustomEvent("x-switch-change",{detail:{value:b,checked:c},bubbles:!0,composed:!0,cancelable:!1}))):null},bB=function(a){return function(){return aB(a)}},cB=function(a){return function(b){var c=b.key;return $APP.E.h(c," ")||$APP.E.h(c,"Enter")?(b.preventDefault(),aB(a)):null}},dB=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},eB=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return YA(this,c,$APP.J(d))}})},fB=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.N(d)?XA(this,c,""+$APP.S.g(d)):this.removeAttribute(c)}})},hB=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return gB}});eB(b,"checked","checked");eB(b,"disabled","disabled");eB(b,"readOnly","readonly");eB(b,"required","required");fB(b,"name","name");fB(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.S.g(d)+"']"),$APP.n(c)&&(e=c.getAttribute("id"),$APP.n(e)?c=e:(d="x-sw-lbl-"+$APP.S.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
|
|
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())}dB(this);c=$APP.l(this,"__xSwitchRefs");$APP.n(c)&&(c=$APP.l(c,"control"),d=bB(this),e=cB(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.S.g(d)+"']"),$APP.n(c)&&(e=c.getAttribute("id"),$APP.n(e)?c=e:(d="x-sw-lbl-"+$APP.S.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 $A(this)};b.disconnectedCallback=function(){return dB(this)};b.attributeChangedCallback=function(){return $A(this)};b.formDisabledCallback=
|
|
12
|
+
function(c){YA(this,"disabled",$APP.J(c));return $A(this)};b.formResetCallback=function(){this.removeAttribute("checked");return $A(this)};return a},iB=function(){return $APP.n(customElements.get("x-switch"))?null:customElements.define("x-switch",hB())};var gB="checked disabled readonly required name value aria-label aria-describedby aria-labelledby".split(" ");$APP.wd(["x-switch-change-request",new $APP.P(null,2,[$APP.ui,!0,$APP.Y,new $APP.P(null,3,[$APP.T,$APP.X,$APP.Bg,$APP.Ji,$APP.ei,$APP.Ji],null)],null),"x-switch-change",new $APP.P(null,2,[$APP.ui,!1,$APP.Y,new $APP.P(null,2,[$APP.T,$APP.X,$APP.Qi,$APP.Ji],null)],null)]);$APP.ka("baredom.exports.x_switch.init",iB);export const init=iB;
|
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 hj=function(a,b,c){return $APP.Cc(b,a)?a:c},mj=function(a){var b=$APP.M(a),c=$APP.I(b,$APP.$i),d=$APP.I(b,$APP.wi);a=$APP.I(b,$APP.zh);var e=$APP.I(b,$APP.Ag),g=$APP.I(b,$APP.Vg),h=$APP.I(b,$APP.W);b=$APP.I(b,ij);c=$APP.J(c);var k=(d=$APP.J(d))?"-1":c?"0":"-1";return new $APP.P(null,8,[$APP.$i,c,$APP.wi,d,$APP.zh,hj(a,jj,"horizontal"),$APP.Ag,hj(e,kj,"md"),$APP.Vg,hj(g,lj,"default"),$APP.W,h,ij,b,$APP.Tg,k],null)},nj=function(a){return new $APP.P(null,8,[$APP.T,a.getAttribute("value"),$APP.$i,
|
|
3
|
+
a.hasAttribute("selected"),$APP.wi,a.hasAttribute("disabled"),$APP.zh,a.getAttribute("orientation"),$APP.Ag,a.getAttribute("size"),$APP.Vg,a.getAttribute("variant"),$APP.W,a.getAttribute("label"),ij,a.getAttribute("controls")],null)},oj=function(a){var b=mj(nj(a)),c=$APP.l(a,"__x_tab_base");if($APP.n(c)){a.setAttribute("role","tab");a.setAttribute("aria-selected",$APP.n($APP.$i.g(b))?"true":"false");$APP.n($APP.wi.g(b))?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");a.setAttribute("tabindex",
|
|
4
|
+
$APP.Tg.g(b));var d=ij.g(b),e=$APP.W.g(b);$APP.n($APP.n(d)?$APP.N(d,""):d)?a.setAttribute("aria-controls",d):a.removeAttribute("aria-controls");$APP.n($APP.n(e)?$APP.N(e,""):e)?a.setAttribute("aria-label",e):a.removeAttribute("aria-label");c.setAttribute("data-selected",$APP.n($APP.$i.g(b))?"true":"false");c.setAttribute("data-disabled",$APP.n($APP.wi.g(b))?"true":"false");c.setAttribute("data-size",$APP.Ag.g(b));c.setAttribute("data-variant",$APP.Vg.g(b));return c.setAttribute("data-orientation",
|
|
5
|
+
$APP.zh.g(b))}return null},pj=function(a){var b=mj(nj(a)),c=$APP.M(b);b=$APP.I(c,$APP.$i);c=$APP.I(c,$APP.wi);$APP.p(c)&&$APP.p(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},qj=function(a){a.addEventListener("click",function(){return pj(a)});a.addEventListener("keydown",function(b){var c=b.key;$APP.E.h(c,"Enter")||$APP.E.h(c," ")?(b.preventDefault(),b=pj(a)):b=null;return b})},vj=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) ease,color var(--x-tab-transition-duration,120ms) ease,border-color var(--x-tab-transition-duration,120ms) 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;qj(a);a.__x_tab_initialized=!0}oj(a);return a},wj=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})},yj=function(){var a=class extends HTMLElement{};a.observedAttributes=xj;a.prototype.connectedCallback=function(){return vj(this)};a.prototype.attributeChangedCallback=
|
|
9
|
+
function(){return $APP.l(this,"__x_tab_initialized")===!0?oj(this):vj(this)};wj(a);return a},zj=function(){return $APP.n(customElements.get("x-tab"))?null:customElements.define("x-tab",yj())},ij=new $APP.K(null,"controls","controls",1340701452);var xj="value selected disabled orientation size variant label controls".split(" "),jj=new $APP.R(null,new $APP.P(null,2,["vertical",null,"horizontal",null],null),null),kj=new $APP.R(null,new $APP.P(null,3,["md",null,"lg",null,"sm",null],null),null),lj=new $APP.R(null,new $APP.P(null,3,["default",null,"underline",null,"pill",null],null),null);$APP.wd(["tab-select",new $APP.P(null,1,[$APP.Y,new $APP.P(null,1,[$APP.T,$APP.X],null)],null)]);$APP.ka("baredom.exports.x_tab.init",zj);export const init=zj;
|
package/dist/x-table-cell.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
"header"))?b:a},
|
|
2
|
+
var Dx=function(a,b,c){a=typeof a==="string"?a.trim().toLowerCase():null;return $APP.Cc(b,a)?a:c},Ex=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),$APP.p(isNaN(a))&&a>0?Math.floor(a):1):1},Hx=function(a){var b=$APP.M(a);a=$APP.I(b,Fx);b=$APP.I(b,Gx);if($APP.n($APP.n(a)?a:$APP.N(b,"none")))switch(b){case "asc":return"ascending";case "desc":return"descending";default:return"none"}else return null},Ix=function(a){var b=$APP.M(a);a=$APP.I(b,$APP.Z);b=$APP.I(b,Fx);return(a=$APP.E.h(a,
|
|
3
|
+
"header"))?b:a},Jx=function(a){switch(a){case "none":return"asc";case "asc":return"desc";case "desc":return"none";default:return"asc"}},Kx=function(a){switch(a){case "none":return"Sort ascending";case "asc":return"Sort descending";case "desc":return"Remove sort";default:return"Sort ascending"}},Px=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.P(null,5,[$APP.
|
|
7
|
-
var b=$APP.M(a);a=$APP.I(b,$APP.U);var c=$APP.I(b,
|
|
8
|
-
|
|
6
|
+
b.appendChild(c);b.appendChild(d);a.__xTableCellRefs=new $APP.P(null,5,[$APP.rh,b,Lx,d,Mx,e,Nx,h,Ox,m],null);return $APP.l(a,"__xTableCellRefs")},gy=function(a){a=$APP.cf([$APP.Ch,Qx,Rx,Sx,Fx,Tx,$APP.ih,Ux,Vx,$APP.U,Wx],[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.M(a);a=$APP.I(b,$APP.U);var c=$APP.I(b,Wx),d=$APP.I(b,$APP.Ch),e=$APP.I(b,Qx),g=$APP.I(b,Rx),h=$APP.I(b,Sx),k=$APP.I(b,Fx),m=$APP.I(b,Tx),q=$APP.I(b,$APP.ih),r=$APP.I(b,Ux);b=$APP.I(b,Vx);return $APP.cf([$APP.ci,Gx,Xx,$APP.Z,Yx,Fx,$APP.Qh,Zx,Tx,$APP.U,$x],[Dx(d,ay,"start"),Dx(h,by,"none"),Dx(g,cy,"middle"),Dx(q,dy,"data"),Dx(b,ey,"col"),$APP.J(k),Dx(r,fy,"none"),Ex(c),$APP.J(m),$APP.J(a),Ex(e)])},hy=function(a){var b=gy(a);if($APP.N($APP.l(a,"__xTableCellModel"),b)){b=$APP.M(b);var c=$APP.I(b,
|
|
8
|
+
Zx),d=$APP.I(b,$x),e=$APP.I(b,$APP.U),g=$APP.I(b,Gx),h=Px(a);h=$APP.M(h);var k=$APP.I(h,Nx);h=$APP.I(h,Ox);var m=Ix(b),q=$APP.M(b),r=$APP.I(q,$APP.Z),v=$APP.I(q,$APP.ci),w=$APP.I(q,Xx),z=$APP.I(q,$APP.Qh),A=$APP.I(q,Tx),C=$APP.I(q,$APP.U);$APP.I(q,Fx);$APP.I(q,Gx);var F=a.setAttribute,D=$APP.M(q);var Q=$APP.I(D,$APP.Z);D=$APP.I(D,Yx);Q=$APP.E.h(Q,"header")?$APP.E.h(D,"row")||$APP.E.h(D,"rowgroup")?"rowheader":"columnheader":"cell";F.call(a,"role",Q);q=Hx(q);$APP.n(q)?a.setAttribute("aria-sort",q):
|
|
9
9
|
a.removeAttribute("aria-sort");$APP.n(C)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");a.setAttribute("data-type",r);a.setAttribute("data-align",v);a.setAttribute("data-valign",w);$APP.E.h(z,"none")?a.removeAttribute("data-sticky"):a.setAttribute("data-sticky",z);$APP.n(A)?a.setAttribute("data-truncate",""):a.removeAttribute("data-truncate");a.style.gridColumn=c>1?"span "+$APP.S.g(c):"";a.style.gridRow=d>1?"span "+$APP.S.g(d):"";k.hidden=$APP.p(m);c=parseInt;r=$APP.M(b);
|
|
10
|
-
m=$APP.I(r,$APP.Z);d=$APP.I(r,
|
|
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},
|
|
10
|
+
m=$APP.I(r,$APP.Z);d=$APP.I(r,Fx);r=$APP.I(r,$APP.U);m=$APP.E.h(m,"header");k.tabIndex=c($APP.n(m?$APP.n(d)?$APP.p(r):d:m)?"0":"-1",10);k.setAttribute("aria-label",Kx(g));k.disabled=$APP.J(e);a:switch(e=$APP.M(b),$APP.I(e,Gx)){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}},iy=function(a){var b=a.getAttribute("sort-direction");b=Dx(b,by,"none");b=new CustomEvent("x-table-cell-sort",{detail:{direction:Jx(b),previousDirection:b},bubbles:!0,composed:!0,cancelable:!0});a.dispatchEvent(b)},jy=function(a){var b=function(){var c=$APP.l(a,"__xTableCellModel");
|
|
12
|
+
return $APP.n(c)?c:gy(a)}();$APP.n(function(){var c=Ix(b);return $APP.n(c)?$APP.p($APP.U.g(b)):c}())&&iy(a);return null},ky=function(a){function b(){return jy(a)}var c=Px(a);c=$APP.M(c);$APP.I(c,Nx).addEventListener("click",b);$APP.ma(a,"__xTableCellHandlers",{"sort-click":b})},ly=function(a){var b=$APP.l(a,"__xTableCellHandlers"),c=$APP.l(a,"__xTableCellRefs");$APP.n($APP.n(b)?c:b)&&(c=$APP.M(c),c=$APP.I(c,Nx),b=$APP.l(b,"sort-click"),$APP.n(b)&&c.removeEventListener("click",b));a.__xTableCellHandlers=
|
|
13
|
+
null},my=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.S.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.S.g(b)):this.removeAttribute("scope")},enumerable:!0,configurable:!0});
|
|
14
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.S.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.S.g(b)):this.removeAttribute("valign")},enumerable:!0,configurable:!0});Object.defineProperty(a,
|
|
15
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.S.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
|
|
17
|
-
b>0?this.setAttribute("col-span",""+$APP.S.g(b)):this.removeAttribute("col-span")},enumerable:!0,configurable:!0});Object.defineProperty(a,"rowSpan",{get:function(){return
|
|
18
|
-
set:function(b){return $APP.n(b)?this.setAttribute("sort-direction",""+$APP.S.g(b)):this.removeAttribute("sort-direction")},enumerable:!0,configurable:!0})},
|
|
19
|
-
$APP.
|
|
20
|
-
customElements.define("x-table-cell",
|
|
21
|
-
|
|
22
|
-
"scope-raw","scope-raw",-773628648),
|
|
23
|
-
$APP.
|
|
24
|
-
1,[$APP.Z,$APP.
|
|
25
|
-
var
|
|
26
|
-
"desc",null,"asc",null],null),null);$APP.ka("baredom.exports.x_table_cell.init",
|
|
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 Ex(this.getAttribute("col-span"))},set:function(b){b=parseInt(b,10);return $APP.p(isNaN(b))&&
|
|
17
|
+
b>0?this.setAttribute("col-span",""+$APP.S.g(b)):this.removeAttribute("col-span")},enumerable:!0,configurable:!0});Object.defineProperty(a,"rowSpan",{get:function(){return Ex(this.getAttribute("row-span"))},set:function(b){b=parseInt(b,10);return $APP.p(isNaN(b))&&b>0?this.setAttribute("row-span",""+$APP.S.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.S.g(b)):this.removeAttribute("sort-direction")},enumerable:!0,configurable:!0})},qy=function(){var a=class extends HTMLElement{};a.observedAttributes=ny;a.prototype.connectedCallback=function(){Px(this);ly(this);ky(this);hy(this);var b=$APP.l(this,"__xTableCellModel");var c=$APP.n(b)?b:gy(this);b=this.dispatchEvent;var d=CustomEvent,e=$APP.M(c);c=$APP.I(e,$APP.Z);var g=$APP.I(e,Yx),h=$APP.I(e,Zx),k=$APP.I(e,$x);e=$APP.I(e,
|
|
19
|
+
$APP.ci);b.call(this,new d("x-table-cell-connected",{detail:$APP.xg(new $APP.P(null,5,[$APP.Z,c,Yx,g,oy,h,py,k,$APP.ci,e],null)),bubbles:!0,composed:!0,cancelable:!1}));return null};a.prototype.disconnectedCallback=function(){ly(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.N(c,d)&&hy(this);return null};my(a.prototype);return a},ry=function(){$APP.n(customElements.get("x-table-cell"))||
|
|
20
|
+
customElements.define("x-table-cell",qy());return null},$x=new $APP.K(null,"row-span","row-span",-365554241),Yx=new $APP.K(null,"scope","scope",-439358418),Nx=new $APP.K(null,"sort-btn","sort-btn",1913954560),Mx=new $APP.K(null,"content","content",15833224),Tx=new $APP.K(null,"truncate?","truncate?",135673334),oy=new $APP.K(null,"colSpan","colSpan",872137394),Lx=new $APP.K(null,"cell","cell",764245084),Xx=new $APP.K(null,"valign","valign",1485197511),Fx=new $APP.K(null,"sortable?","sortable?",291547474),
|
|
21
|
+
Ox=new $APP.K(null,"sort-icon-default","sort-icon-default",-596209230),Wx=new $APP.K(null,"col-span-raw","col-span-raw",1425293661),Rx=new $APP.K(null,"valign-raw","valign-raw",-1083375124),Sx=new $APP.K(null,"sort-direction-raw","sort-direction-raw",-1822100883),Ux=new $APP.K(null,"sticky-raw","sticky-raw",1857578519),Zx=new $APP.K(null,"col-span","col-span",-232603210),py=new $APP.K(null,"rowSpan","rowSpan",826884002),Qx=new $APP.K(null,"row-span-raw","row-span-raw",-1130003707),Vx=new $APP.K(null,
|
|
22
|
+
"scope-raw","scope-raw",-773628648),Gx=new $APP.K(null,"sort-direction","sort-direction",-1635889628);var ny="type scope align valign col-span row-span truncate sticky sortable sort-direction disabled".split(" ");
|
|
23
|
+
$APP.cf([$APP.ci,py,new $APP.K(null,"truncate","truncate",-1327322939),$APP.wi,Xx,$APP.Z,Yx,oy,$APP.Qh,new $APP.K(null,"sortable","sortable",2109633621),new $APP.K(null,"sortDirection","sortDirection",-45816999)],[new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,1,[$APP.Z,$APP.Fh],null),new $APP.P(null,1,[$APP.Z,$APP.Ji],null),new $APP.P(null,1,[$APP.Z,$APP.Ji],null),new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,
|
|
24
|
+
1,[$APP.Z,$APP.Fh],null),new $APP.P(null,1,[$APP.Z,$APP.X],null),new $APP.P(null,1,[$APP.Z,$APP.Ji],null),new $APP.P(null,1,[$APP.Z,$APP.X],null)]);$APP.wd(["x-table-cell-sort",new $APP.P(null,2,[$APP.Y,new $APP.P(null,2,[$APP.ai,$APP.X,$APP.Hi,$APP.X],null),$APP.ui,!0],null),"x-table-cell-connected",new $APP.P(null,1,[$APP.Y,new $APP.P(null,5,[$APP.Z,$APP.X,Yx,$APP.X,oy,$APP.Fh,py,$APP.Fh,$APP.ci,$APP.X],null)],null),"x-table-cell-disconnected",new $APP.P(null,1,[$APP.Y,$APP.xd],null)]);
|
|
25
|
+
var dy=new $APP.R(null,new $APP.P(null,2,["data",null,"header",null],null),null),ey=new $APP.R(null,new $APP.P(null,4,["rowgroup",null,"col",null,"row",null,"colgroup",null],null),null),ay=new $APP.R(null,new $APP.P(null,3,["center",null,"start",null,"end",null],null),null),cy=new $APP.R(null,new $APP.P(null,3,["top",null,"middle",null,"bottom",null],null),null),fy=new $APP.R(null,new $APP.P(null,3,["none",null,"start",null,"end",null],null),null),by=new $APP.R(null,new $APP.P(null,3,["none",null,
|
|
26
|
+
"desc",null,"asc",null],null),null);$APP.ka("baredom.exports.x_table_cell.init",ry);export const init=ry;
|
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.P(null,2,[$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.S.g(b)):this.removeAttribute("row-index")},enumerable:!0,configurable:!0})},
|
|
10
|
-
4,[$APP.
|
|
11
|
-
|
|
2
|
+
var Cp=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),$APP.p(isNaN(a))&&a>0?Math.floor(a):null):null},Ep=function(a){var b=$APP.M(a);a=$APP.I(b,Dp);b=$APP.I(b,$APP.U);return $APP.n(a)?$APP.p(b):a},Fp=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.P(null,2,[$APP.rh,b,$APP.Ph,d],null)}},Ip=function(a){a=new $APP.P(null,4,[$APP.Ih,a.hasAttribute("selected"),$APP.U,a.hasAttribute("disabled"),Dp,a.hasAttribute("interactive"),Gp,a.getAttribute("row-index")],null);var b=$APP.M(a);a=$APP.I(b,$APP.Ih);var c=$APP.I(b,$APP.U),d=$APP.I(b,Dp);b=$APP.I(b,Gp);return new $APP.P(null,4,[$APP.Ih,$APP.J(a),$APP.U,$APP.J(c),Dp,$APP.J(d),Hp,Cp(b)],null)},Jp=function(a){var b=Ip(a);if($APP.N($APP.l(a,
|
|
4
|
+
"__xTableRowModel"),b)){Fp(a);var c=$APP.M(b),d=$APP.I(c,$APP.Ih),e=$APP.I(c,$APP.U),g=$APP.I(c,Dp),h=$APP.I(c,Hp);a.setAttribute("role","row");var k=$APP.M(c);var m=$APP.I(k,$APP.Ih);k=$APP.I(k,Dp);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.S.g(h)):a.removeAttribute("aria-rowindex");$APP.n(d)?
|
|
5
|
+
a.setAttribute("data-selected",""):a.removeAttribute("data-selected");$APP.n(g)?a.setAttribute("data-interactive",""):a.removeAttribute("data-interactive");a.tabIndex=$APP.n(Ep(c))?0:-1;a.__xTableRowModel=b}},Kp=function(a){var b=$APP.l(a,"__xTableRowModel");var c=$APP.n(b)?b:Ip(a);b=a.dispatchEvent;var d=CustomEvent,e=$APP.M(c);c=$APP.I(e,$APP.Ih);var g=$APP.I(e,$APP.U);e=$APP.I(e,Hp);b.call(a,new d("x-table-row-click",{detail:$APP.xg(new $APP.P(null,3,[$APP.ri,$APP.n(e)?e:0,$APP.$i,c,$APP.wi,g],
|
|
6
|
+
null)),bubbles:!0,composed:!0,cancelable:!0}))},Lp=function(a){function b(d){var e=d.key;if($APP.E.h(e,"Enter")||$APP.E.h(e," "))e=$APP.l(a,"__xTableRowModel"),e=$APP.n(e)?e:Ip(a),$APP.n(Ep(e))&&(d.preventDefault(),Kp(a));return null}function c(){var d=$APP.l(a,"__xTableRowModel");d=$APP.n(d)?d:Ip(a);$APP.n(Ep(d))&&Kp(a);return null}a.addEventListener("click",c);a.addEventListener("keydown",b);$APP.ma(a,"__xTableRowHandlers",{click:c,keydown:b})},Mp=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},Np=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 Cp(this.getAttribute("row-index"))},set:function(b){b=parseInt(b,10);return $APP.p(isNaN(b))&&
|
|
9
|
+
b>0?this.setAttribute("row-index",""+$APP.S.g(b)):this.removeAttribute("row-index")},enumerable:!0,configurable:!0})},Pp=function(){var a=class extends HTMLElement{};a.observedAttributes=Op;a.prototype.connectedCallback=function(){Fp(this);Mp(this);Lp(this);Jp(this);var b=$APP.l(this,"__xTableRowModel");var c=$APP.n(b)?b:Ip(this);b=this.dispatchEvent;var d=CustomEvent,e=$APP.M(c);c=$APP.I(e,$APP.Ih);var g=$APP.I(e,$APP.U),h=$APP.I(e,Dp);e=$APP.I(e,Hp);b.call(this,new d("x-table-row-connected",{detail:$APP.xg(new $APP.P(null,
|
|
10
|
+
4,[$APP.ri,$APP.n(e)?e:0,$APP.$i,c,$APP.wi,g,$APP.Rh,h],null)),bubbles:!0,composed:!0,cancelable:!1}));return null};a.prototype.disconnectedCallback=function(){Mp(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.N(c,d)&&Jp(this);return null};Np(a.prototype);return a},Qp=function(){$APP.n(customElements.get("x-table-row"))||customElements.define("x-table-row",
|
|
11
|
+
Pp());return null},Dp=new $APP.K(null,"interactive?","interactive?",367617676),Hp=new $APP.K(null,"row-index","row-index",-828710296),Gp=new $APP.K(null,"row-index-raw","row-index-raw",1490649093);var Op=["selected","disabled","interactive","row-index"];$APP.wd(["x-table-row-click",new $APP.P(null,2,[$APP.Y,new $APP.P(null,3,[$APP.ri,$APP.Fh,$APP.$i,$APP.Ji,$APP.wi,$APP.Ji],null),$APP.ui,!0],null),"x-table-row-connected",new $APP.P(null,2,[$APP.Y,new $APP.P(null,4,[$APP.ri,$APP.Fh,$APP.$i,$APP.Ji,$APP.wi,$APP.Ji,$APP.Rh,$APP.Ji],null),$APP.ui,!1],null),"x-table-row-disconnected",new $APP.P(null,2,[$APP.Y,$APP.xd,$APP.ui,!1],null)]);$APP.ka("baredom.exports.x_table_row.init",Qp);export const init=Qp;
|
package/dist/x-table.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
d.setAttribute("part","caption");d.setAttribute("hidden","");b.appendChild(c);b.appendChild(d);b.appendChild(e);a.__xTableRefs=new $APP.P(null,3,[$APP.
|
|
4
|
-
$APP.M(a),c=$APP.I(b,
|
|
5
|
-
|
|
2
|
+
var xs=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),$APP.p(isNaN(a))&&a>0?Math.floor(a):null):null},zs=function(a){var b=$APP.l(a,"__xTableRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("slot");c.textContent=":host{display:grid;box-sizing:border-box;color-scheme:light dark;--x-table-border-color:rgba(0,0,0,0.1);--x-table-border-radius:8px;--x-table-stripe-bg:rgba(0,0,0,0.025);--x-table-caption-color:inherit;--x-table-caption-font-size:0.875rem;--x-table-caption-font-weight:600;--x-table-caption-padding:0 0 0.5rem;--x-table-compact-padding:0.25rem 0.5rem;}@media (prefers-color-scheme:dark){:host{--x-table-border-color:rgba(255,255,255,0.1);--x-table-stripe-bg:rgba(255,255,255,0.03);}}:host([data-bordered]){border:1px solid var(--x-table-border-color);border-radius:var(--x-table-border-radius);overflow:hidden;}:host([data-full-width]){width:100%;}:host([data-compact]){--x-table-cell-padding:var(--x-table-compact-padding);}:host([data-striped]) ::slotted(x-table-row[data-stripe\x3d'even']){--x-table-row-bg:var(--x-table-stripe-bg);}[part\x3dcaption]{grid-column:1 / -1;color:var(--x-table-caption-color);font-size:var(--x-table-caption-font-size);font-weight:var(--x-table-caption-font-weight);padding:var(--x-table-caption-padding);box-sizing:border-box;}[part\x3dcaption][hidden]{display:none !important;}slot{display:contents;}";
|
|
3
|
+
d.setAttribute("part","caption");d.setAttribute("hidden","");b.appendChild(c);b.appendChild(d);b.appendChild(e);a.__xTableRefs=new $APP.P(null,3,[$APP.rh,b,ys,d,$APP.Ph,e],null);return $APP.l(a,"__xTableRefs")},Ls=function(a){a=new $APP.P(null,8,[As,a.getAttribute("columns"),Bs,a.getAttribute("caption"),Cs,a.getAttribute("selectable"),$APP.kh,a.hasAttribute("striped"),Ds,a.hasAttribute("bordered"),Es,a.hasAttribute("full-width"),Fs,a.hasAttribute("compact"),Gs,a.getAttribute("row-count")],null);var b=
|
|
4
|
+
$APP.M(a),c=$APP.I(b,As),d=$APP.I(b,Bs),e=$APP.I(b,Cs);a=$APP.I(b,$APP.kh);var g=$APP.I(b,Ds),h=$APP.I(b,Es),k=$APP.I(b,Fs);b=$APP.I(b,Gs);a:{if(typeof c==="string"&&(c=c.trim(),$APP.N(c,""))){var m=parseInt(c,10);c=$APP.p(isNaN(m))&&m>0&&$APP.E.h(c,""+$APP.S.g(m))?"repeat("+$APP.S.g(m)+",1fr)":c;break a}c=null}d=$APP.n(d)?d:"";e=typeof e==="string"?e.trim().toLowerCase():null;e=$APP.Cc(Hs,e)?e:"none";return new $APP.P(null,8,[$APP.Sg,c,Is,d,Js,e,$APP.kh,$APP.J(a),Ds,$APP.J(g),Es,$APP.J(h),Fs,$APP.J(k),
|
|
5
|
+
Ks,xs(b)],null)},Ms=function(a){a=a.querySelectorAll("x-table-row");for(var b=a.length,c=0;;)if(c<b){var d=a[c];$APP.Qc(c+1,2)===0?d.setAttribute("data-stripe","even"):d.removeAttribute("data-stripe");c+=1}else break},Ns=function(a){var b=Ls(a);if($APP.N($APP.l(a,"__xTableModel"),b)){b=$APP.M(b);var c=$APP.I(b,$APP.Sg),d=$APP.I(b,Is),e=$APP.I(b,Js),g=$APP.I(b,$APP.kh),h=$APP.I(b,Ds),k=$APP.I(b,Es),m=$APP.I(b,Fs),q=$APP.I(b,Ks),r=zs(a);r=$APP.M(r);r=$APP.I(r,ys);a.style.gridTemplateColumns=$APP.n(c)?
|
|
6
6
|
c:"";a.setAttribute("role",$APP.E.h(e,"none")?"table":"grid");c=$APP.E.h(e,"multi")?"true":null;$APP.n(c)?a.setAttribute("aria-multiselectable",c):a.removeAttribute("aria-multiselectable");q!=null?a.setAttribute("aria-rowcount",""+$APP.S.g(q)):a.removeAttribute("aria-rowcount");$APP.N(d,"")?a.setAttribute("aria-label",d):a.removeAttribute("aria-label");$APP.N(d,"")?(r.textContent=d,r.removeAttribute("hidden")):(r.textContent="",r.setAttribute("hidden",""));$APP.n(g)?a.setAttribute("data-striped",
|
|
7
|
-
""):a.removeAttribute("data-striped");$APP.n(h)?a.setAttribute("data-bordered",""):a.removeAttribute("data-bordered");$APP.n(k)?a.setAttribute("data-full-width",""):a.removeAttribute("data-full-width");$APP.n(m)?a.setAttribute("data-compact",""):a.removeAttribute("data-compact");$APP.n(g)&&
|
|
8
|
-
var h=
|
|
9
|
-
"multi")&&($APP.n(g.hasAttribute("selected"))?g.removeAttribute("selected"):g.setAttribute("selected",""))}return null}function d(e){var g=e.target;g=Array.from(g.parentElement.querySelectorAll("x-table-cell")).indexOf(g);var h=$APP.l(e.detail,"direction"),k=$APP.l(e.detail,"previousDirection");g>=0&&(e.stopPropagation(),e=$APP.xg(new $APP.P(null,3,[
|
|
10
|
-
d);a.addEventListener("x-table-row-click",c);a.addEventListener("x-table-row-connected",b);$APP.ma(a,"__xTableHandlers",{sort:d,"row-click":c,"row-conn":b})},
|
|
7
|
+
""):a.removeAttribute("data-striped");$APP.n(h)?a.setAttribute("data-bordered",""):a.removeAttribute("data-bordered");$APP.n(k)?a.setAttribute("data-full-width",""):a.removeAttribute("data-full-width");$APP.n(m)?a.setAttribute("data-compact",""):a.removeAttribute("data-compact");$APP.n(g)&&Ms(a);a.__xTableModel=b}},Qs=function(a){function b(){var e=$APP.l(a,"__xTableModel");e=$APP.n(e)?e:Ls(a);$APP.n($APP.kh.g(e))&&Ms(a);return null}function c(e){var g=$APP.l(a,"__xTableModel");g=$APP.n(g)?g:Ls(a);
|
|
8
|
+
var h=Js.g(g);if($APP.N(h,"none")){g=e.target;e=$APP.l(e.detail,"rowIndex");var k=g.hasAttribute("selected");k=($APP.E.h(h,"single"),$APP.p(k));e=$APP.xg(new $APP.P(null,3,[$APP.ri,$APP.n(e)?e:0,$APP.$i,k,Os,h],null));a.dispatchEvent(new CustomEvent("x-table-row-select",{detail:e,bubbles:!0,composed:!0,cancelable:!0}));if($APP.E.h(h,"single")){h=a.querySelectorAll("x-table-row[selected]");e=h.length;for(k=0;;)if(k<e)h[k].removeAttribute("selected"),k+=1;else break;g.setAttribute("selected","")}else $APP.E.h(h,
|
|
9
|
+
"multi")&&($APP.n(g.hasAttribute("selected"))?g.removeAttribute("selected"):g.setAttribute("selected",""))}return null}function d(e){var g=e.target;g=Array.from(g.parentElement.querySelectorAll("x-table-cell")).indexOf(g);var h=$APP.l(e.detail,"direction"),k=$APP.l(e.detail,"previousDirection");g>=0&&(e.stopPropagation(),e=$APP.xg(new $APP.P(null,3,[Ps,g,$APP.ai,h,$APP.Hi,k],null)),a.dispatchEvent(new CustomEvent("x-table-sort",{detail:e,bubbles:!0,composed:!0,cancelable:!0})));return null}a.addEventListener("x-table-cell-sort",
|
|
10
|
+
d);a.addEventListener("x-table-row-click",c);a.addEventListener("x-table-row-connected",b);$APP.ma(a,"__xTableHandlers",{sort:d,"row-click":c,"row-conn":b})},Rs=function(a){var b=$APP.l(a,"__xTableHandlers");if($APP.n(b)){var c=$APP.l(b,"sort"),d=$APP.l(b,"row-click");b=$APP.l(b,"row-conn");$APP.n(c)&&a.removeEventListener("x-table-cell-sort",c);$APP.n(d)&&a.removeEventListener("x-table-row-click",d);$APP.n(b)&&a.removeEventListener("x-table-row-connected",b)}a.__xTableHandlers=null},Ss=function(a){Object.defineProperty(a,
|
|
11
11
|
"columns",{get:function(){var b=this.getAttribute("columns");return $APP.n(b)?b:""},set:function(b){return $APP.n(b)?this.setAttribute("columns",""+$APP.S.g(b)):this.removeAttribute("columns")},enumerable:!0,configurable:!0});Object.defineProperty(a,"caption",{get:function(){var b=this.getAttribute("caption");return $APP.n(b)?b:""},set:function(b){return $APP.n(b)?this.setAttribute("caption",""+$APP.S.g(b)):this.removeAttribute("caption")},enumerable:!0,configurable:!0});Object.defineProperty(a,"selectable",
|
|
12
12
|
{get:function(){var b=this.getAttribute("selectable");return $APP.n(b)?b:"none"},set:function(b){return $APP.n(b)?this.setAttribute("selectable",""+$APP.S.g(b)):this.removeAttribute("selectable")},enumerable:!0,configurable:!0});Object.defineProperty(a,"striped",{get:function(){return this.hasAttribute("striped")},set:function(b){return $APP.n(b)?this.setAttribute("striped",""):this.removeAttribute("striped")},enumerable:!0,configurable:!0});Object.defineProperty(a,"bordered",{get:function(){return this.hasAttribute("bordered")},
|
|
13
13
|
set:function(b){return $APP.n(b)?this.setAttribute("bordered",""):this.removeAttribute("bordered")},enumerable:!0,configurable:!0});Object.defineProperty(a,"compact",{get:function(){return this.hasAttribute("compact")},set:function(b){return $APP.n(b)?this.setAttribute("compact",""):this.removeAttribute("compact")},enumerable:!0,configurable:!0});Object.defineProperty(a,"fullWidth",{get:function(){return this.hasAttribute("full-width")},set:function(b){return $APP.n(b)?this.setAttribute("full-width",
|
|
14
|
-
""):this.removeAttribute("full-width")},enumerable:!0,configurable:!0});Object.defineProperty(a,"rowCount",{get:function(){return
|
|
15
|
-
function(){
|
|
16
|
-
"colIndex","colIndex",171239635),
|
|
14
|
+
""):this.removeAttribute("full-width")},enumerable:!0,configurable:!0});Object.defineProperty(a,"rowCount",{get:function(){return xs(this.getAttribute("row-count"))},set:function(b){return b==null?this.removeAttribute("row-count"):this.setAttribute("row-count",""+$APP.S.g(Math.floor(b)))},enumerable:!0,configurable:!0})},Us=function(){var a=class extends HTMLElement{};a.observedAttributes=Ts;a.prototype.connectedCallback=function(){zs(this);Rs(this);Qs(this);Ns(this);return null};a.prototype.disconnectedCallback=
|
|
15
|
+
function(){Rs(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&Ns(this);return null};Ss(a.prototype);return a},Vs=function(){$APP.n(customElements.get("x-table"))||customElements.define("x-table",Us());return null},Js=new $APP.K(null,"selectable","selectable",370587038),Es=new $APP.K(null,"full-width?","full-width?",1477288349),Gs=new $APP.K(null,"row-count-raw","row-count-raw",-1432781274),Cs=new $APP.K(null,"selectable-raw","selectable-raw",-1276314763),Ps=new $APP.K(null,
|
|
16
|
+
"colIndex","colIndex",171239635),Is=new $APP.K(null,"caption","caption",-855383902),Ds=new $APP.K(null,"bordered?","bordered?",562358476),Ks=new $APP.K(null,"row-count","row-count",1060167988),ys=new $APP.K(null,"caption-div","caption-div",1485363333),Bs=new $APP.K(null,"caption-raw","caption-raw",-375935083),Os=new $APP.K(null,"selectionMode","selectionMode",1264773367),As=new $APP.K(null,"columns-raw","columns-raw",-2093994046),Fs=new $APP.K(null,"compact?","compact?",1216893298);var Ts="columns caption selectable striped bordered full-width compact row-count".split(" ");$APP.wd(["x-table-sort",new $APP.P(null,2,[$APP.Y,new $APP.P(null,3,[Ps,$APP.Fh,$APP.ai,$APP.X,$APP.Hi,$APP.X],null),$APP.ui,!0],null),"x-table-row-select",new $APP.P(null,2,[$APP.Y,new $APP.P(null,3,[$APP.ri,$APP.Fh,$APP.$i,$APP.Ji,Os,$APP.X],null),$APP.ui,!0],null)]);var Hs=new $APP.R(null,new $APP.P(null,3,["none",null,"single",null,"multi",null],null),null);$APP.ka("baredom.exports.x_table.init",Vs);export const init=Vs;
|
package/dist/x-tabs.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
null)},
|
|
4
|
-
b:null},a)},
|
|
5
|
-
$APP.N(a,""):a)&&(a=document.getElementById(a),$APP.n(a)&&($APP.n(b)?a.removeAttribute("hidden"):a.setAttribute("hidden","")))},
|
|
6
|
-
e=$APP.E.h(
|
|
7
|
-
{detail:{value:$APP.n(b)?b:""},bubbles:!0,composed:!0}))):null},
|
|
8
|
-
new MutationObserver(function(){return
|
|
9
|
-
$APP.E.h(m,"ArrowDown")?
|
|
10
|
-
"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})},
|
|
11
|
-
":host{display:block;color-scheme:light dark;}.base{display:block;}::slotted(x-tab){margin-inline-end:var(--x-tabs-gap,8px);}";d.setAttribute("part","base");d.className="base";d.appendChild(e);b.appendChild(c);b.appendChild(d);this.__x_tabs_root=b;this.__x_tabs_base=d;this.__x_tabs_slot=e;
|
|
12
|
-
"__x_tabs_on_keydown");$APP.n(b)&&this.removeEventListener("keydown",b);b=$APP.l(this,"__x_tabs_observer");return $APP.n(b)?b.disconnect():null};a.prototype.attributeChangedCallback=function(){return
|
|
2
|
+
var xt=function(a){if($APP.tc(a))return $APP.pc(a,null);a=$APP.u(a);if(a==null)return $APP.sf;if(a instanceof $APP.Ib&&a.u===0)return $APP.tf(a.i);for(var b=$APP.hb($APP.sf);;)if(a!=null){var c=$APP.y(a);b=$APP.ib(b,$APP.Da(a));a=c}else return $APP.jb(b)},Ct=function(a){var b=$APP.M(a);a=$APP.I(b,$APP.T);var c=$APP.I(b,$APP.zh),d=$APP.I(b,yt),e=$APP.I(b,$APP.W);b=$APP.I(b,zt);c=$APP.Cc(At,c)?c:"horizontal";d=$APP.Cc(Bt,d)?d:"auto";return new $APP.P(null,5,[$APP.T,a,$APP.zh,c,yt,d,$APP.W,e,zt,$APP.J(b)],
|
|
3
|
+
null)},Dt=function(a){return $APP.l(a,"__x_tabs_initialized")===!0},Et=function(a){return new $APP.P(null,5,[$APP.T,a.getAttribute("value"),$APP.zh,a.getAttribute("orientation"),yt,a.getAttribute("activation"),$APP.W,a.getAttribute("label"),zt,a.hasAttribute("loop")],null)},Ft=function(a){return $APP.be($APP.Kd(function(b){return $APP.E.h("X-TAB",b.tagName)},$APP.gc(a.children)))},Gt=function(a){return $APP.p(a.hasAttribute("disabled"))},Ht=function(a){return a.getAttribute("value")},It=function(a){return $APP.Ad(function(b){return Gt(b)?
|
|
4
|
+
b:null},a)},Jt=function(a,b){var c=a.getAttribute("value");$APP.n($APP.n(b)?$APP.N(c,b):b)?a.setAttribute("value",b):(b=b==null||$APP.E.h(b,""),$APP.n(b?c:b)&&a.removeAttribute("value"))},Kt=function(a,b){var c=a.hasAttribute("selected");$APP.n($APP.n(b)?$APP.p(c):b)?a.setAttribute("selected",""):(b=$APP.p(b),$APP.n(b?c:b)&&a.removeAttribute("selected"))},Lt=function(a,b){var c=a.getAttribute("tabindex");$APP.N(c,b)&&a.setAttribute("tabindex",b)},Mt=function(a,b){a=a.getAttribute("controls");$APP.n($APP.n(a)?
|
|
5
|
+
$APP.N(a,""):a)&&(a=document.getElementById(a),$APP.n(a)&&($APP.n(b)?a.removeAttribute("hidden"):a.setAttribute("hidden","")))},Nt=function(a){var b=Ft(a),c=a.getAttribute("value"),d=xt($APP.Cd(Ht,b));$APP.n($APP.n(c)?$APP.Cc(d,c):c)||(c=It(b),c=$APP.n(c)?Ht(c):null);if($APP.n(c)){a:{d=$APP.u(b);for(var e=null,g=0,h=0;;)if(h<g){var k=e.F(null,h),m=$APP.E.h(Ht(k),c);Kt(k,m);m&&Gt(k)?Lt(k,"0"):Lt(k,"-1");h+=1}else if(d=$APP.u(d))$APP.yc(d)?(e=$APP.ob(d),d=$APP.pb(d),k=e,g=$APP.B(e),e=k):(k=$APP.x(d),
|
|
6
|
+
e=$APP.E.h(Ht(k),c),Kt(k,e),e&&Gt(k)?Lt(k,"0"):Lt(k,"-1"),d=$APP.y(d),e=null,g=0),h=0;else break a}a:for(b=$APP.u(b),d=null,g=e=0;;)if(g<e)k=d.F(null,g),Mt(k,$APP.E.h(Ht(k),c)),g+=1;else if(b=$APP.u(b))d=b,$APP.yc(d)?(b=$APP.ob(d),e=$APP.pb(d),d=b,k=$APP.B(b),b=e,e=k):(k=$APP.x(d),Mt(k,$APP.E.h(Ht(k),c)),b=$APP.y(d),d=null,e=0),g=0;else break a;Jt(a,c)}return c},Ot=function(a,b){var c=a.getAttribute("value");return $APP.n($APP.n(b)?$APP.N(c,b):b)?(Jt(a,b),Nt(a),a.dispatchEvent(new CustomEvent("value-change",
|
|
7
|
+
{detail:{value:$APP.n(b)?b:""},bubbles:!0,composed:!0}))):null},Pt=function(a,b,c){b=$APP.B(b)-1;var d=a+1;return d<=b?d:$APP.n(c)?0:a},Qt=function(a,b,c){var d=a-1;b=$APP.B(b)-1;return d>=0?d:$APP.n(c)?b:a},Rt=function(a){var b=$APP.l(a,"__x_tabs_base"),c=Ct(Et(a));$APP.n(b)&&(b.setAttribute("role","tablist"),b.setAttribute("aria-orientation",$APP.zh.g(c)),c=$APP.W.g(c),$APP.n($APP.n(c)?$APP.N(c,""):c)?b.setAttribute("aria-label",c):b.removeAttribute("aria-label"));return Nt(a)},St=function(a){var b=
|
|
8
|
+
new MutationObserver(function(){return Rt(a)});b.observe(a,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["value","selected","disabled","controls"]});a.__x_tabs_observer=b},Tt=function(a){function b(d){a:{var e=$APP.be($APP.Kd(Gt,Ft(a))),g=Ct(Et(a)),h=$APP.zh.g(g);var k=yt.g(g);g=zt.g(g);var m=d.key,q=e.indexOf(document.activeElement);if(q>=0&&(h=$APP.E.h(h,"horizontal")&&$APP.E.h(m,"ArrowRight")?Pt(q,e,g):$APP.E.h(h,"horizontal")&&$APP.E.h(m,"ArrowLeft")?Qt(q,e,g):$APP.E.h(h,"vertical")&&
|
|
9
|
+
$APP.E.h(m,"ArrowDown")?Pt(q,e,g):$APP.E.h(h,"vertical")&&$APP.E.h(m,"ArrowUp")?Qt(q,e,g):$APP.E.h(m,"Home")?0:$APP.E.h(m,"End")?$APP.B(e)-1:null,h!=null)){d.preventDefault();d=$APP.H(e,h,null);$APP.n(d)?d.focus():d=null;k=$APP.n(d)?$APP.E.h(k,"auto")?Ot(a,Ht(d)):null:null;break a}k=null}return k}function c(d){d.stopPropagation();return Ot(a,d.detail.value)}a.addEventListener("tab-select",c);a.addEventListener("keydown",b);a.__x_tabs_on_tab_select=c;a.__x_tabs_on_keydown=b;St(a)},Ut=function(a){Object.defineProperty(a.prototype,
|
|
10
|
+
"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})},Wt=function(){var a=class extends HTMLElement{};a.observedAttributes=Vt;a.prototype.connectedCallback=function(){if(Dt(this)){Tt(this);var b=Rt(this)}else{if(!Dt(this)){b=this.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("slot");c.textContent=
|
|
11
|
+
":host{display:block;color-scheme:light dark;}.base{display:block;}::slotted(x-tab){margin-inline-end:var(--x-tabs-gap,8px);}";d.setAttribute("part","base");d.className="base";d.appendChild(e);b.appendChild(c);b.appendChild(d);this.__x_tabs_root=b;this.__x_tabs_base=d;this.__x_tabs_slot=e;Tt(this);this.__x_tabs_initialized=!0}Rt(this);b=this}return b};a.prototype.disconnectedCallback=function(){var b=$APP.l(this,"__x_tabs_on_tab_select");$APP.n(b)&&this.removeEventListener("tab-select",b);b=$APP.l(this,
|
|
12
|
+
"__x_tabs_on_keydown");$APP.n(b)&&this.removeEventListener("keydown",b);b=$APP.l(this,"__x_tabs_observer");return $APP.n(b)?b.disconnect():null};a.prototype.attributeChangedCallback=function(){return Dt(this)?Rt(this):null};Ut(a);return a},Xt=function(){return $APP.n(customElements.get("x-tabs"))?null:customElements.define("x-tabs",Wt())},yt=new $APP.K(null,"activation","activation",2128521072),zt=new $APP.K(null,"loop","loop",-395552849);var Vt=["value","orientation","activation","label","loop"],At=new $APP.R(null,new $APP.P(null,2,["vertical",null,"horizontal",null],null),null),Bt=new $APP.R(null,new $APP.P(null,2,["auto",null,"manual",null],null),null);$APP.wd(["value-change",new $APP.P(null,1,[$APP.Y,new $APP.P(null,1,[$APP.T,$APP.X],null)],null)]);$APP.ka("baredom.exports.x_tabs.init",Xt);export const init=Xt;
|