@vanelsas/baredom 0.2.3-alpha → 0.2.6-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 +8 -1
- package/README.md +4 -4
- package/dist/base.js +118 -118
- package/dist/x-alert.js +19 -19
- package/dist/x-avatar-group.js +10 -10
- package/dist/x-avatar.js +15 -15
- package/dist/x-badge.js +11 -11
- package/dist/x-breadcrumbs.js +11 -11
- package/dist/x-button.js +15 -15
- package/dist/x-cancel-dialogue.js +16 -16
- package/dist/x-card.js +7 -7
- package/dist/x-chart.js +47 -47
- package/dist/x-checkbox.js +11 -11
- package/dist/x-chip.js +7 -7
- package/dist/x-collapse.js +11 -11
- package/dist/x-command-palette.js +31 -31
- package/dist/x-container.js +6 -6
- package/dist/x-context-menu.js +17 -17
- package/dist/x-copy.js +22 -23
- package/dist/x-currency-field.js +22 -20
- package/dist/x-date-picker.js +42 -36
- package/dist/x-divider.js +9 -9
- package/dist/x-drawer.js +11 -11
- package/dist/x-dropdown.js +4 -4
- 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-grid.js +7 -7
- package/dist/x-menu-item.js +6 -6
- package/dist/x-menu.js +10 -10
- package/dist/x-modal.js +11 -11
- package/dist/x-navbar.js +10 -10
- package/dist/x-notification-center.js +8 -8
- package/dist/x-pagination.js +16 -16
- package/dist/x-popover.js +6 -6
- package/dist/x-progress-circle.js +8 -8
- package/dist/x-progress.js +7 -7
- package/dist/x-radio.js +9 -9
- package/dist/x-search-field.js +10 -10
- package/dist/x-select.js +9 -9
- package/dist/x-sidebar.js +18 -18
- package/dist/x-skeleton.js +6 -6
- 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 +9 -9
- package/dist/x-stepper.js +14 -14
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +6 -6
- package/dist/x-table-cell.js +23 -23
- package/dist/x-table-row.js +10 -10
- package/dist/x-table.js +14 -14
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +12 -12
- package/dist/x-timeline-item.js +23 -23
- package/dist/x-timeline.js +7 -7
- package/dist/x-toast.js +17 -17
- package/dist/x-toaster.js +7 -7
- package/package.json +1 -1
package/dist/x-slider.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
a.hasAttribute("disabled"),a.hasAttribute("show-value"),a.getAttribute("name"),a.getAttribute("value"),a.hasAttribute("readonly"),a.getAttribute("aria-labelledby"),a.getAttribute("size"),a.getAttribute("max"),a.getAttribute("label"),a.getAttribute("aria-describedby"),a.getAttribute("aria-label"),a.getAttribute("step")]);var k=$APP.
|
|
4
|
-
$APP.Mi),F=$APP.
|
|
5
|
-
A,typeof z==="string"&&$APP.
|
|
6
|
-
r);
|
|
7
|
-
|
|
8
|
-
$APP.
|
|
9
|
-
parseFloat($APP.l($APP.l(a,"__xSliderRefs"),"input").value),c=parseFloat(function(){var e=a.getAttribute("min");return $APP.n(e)?e:"0"}()),d=parseFloat(function(){var e=a.getAttribute("max");return $APP.n(e)?e:"100"}());return
|
|
10
|
-
$APP.l(a,"__xSliderHandlers");if($APP.n(c)){b=$APP.l(b,"input");b.removeEventListener("input",$APP.l(c,"input"));b.removeEventListener("change",$APP.l(c,"change"));b.removeEventListener("keydown",$APP.l(c,"keydown"));a.__xSliderHandlers=null;return}}return null},
|
|
11
|
-
get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:null},set:function(d){return d!=null&&$APP.
|
|
12
|
-
|
|
13
|
-
e.setAttribute("part","base");g.setAttribute("part","header");h.setAttribute("part","label-text");k.setAttribute("part","value-text");m.setAttribute("part","input");m.setAttribute("type","range");g.appendChild(h);g.appendChild(k);e.appendChild(g);e.appendChild(m);c.appendChild(d);c.appendChild(e);this.__xSliderRefs={base:e,header:g,label:h,value:k,input:m};$APP.n(this.attachInternals)&&(this.__xSliderInternals=this.attachInternals())}
|
|
14
|
-
"input"),d=
|
|
15
|
-
null:customElements.define("x-slider",
|
|
16
|
-
$APP.cf([$APP.Ti,$APP.wi,$APP.Eg,$APP.gi,$APP.
|
|
17
|
-
2,[$APP.Z,$APP.X,$APP.Pg,"max"],null),new $APP.
|
|
2
|
+
var ju=function(a,b){return typeof a==="string"?(a=parseFloat(a),$APP.n(isNaN(a))?b:a):b},ku=function(a,b,c){return a.setAttribute(b,c)},lu=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},qu=function(a){var b=$APP.l(a,"__xSliderRefs");if($APP.n(b)){var c=$APP.l(b,"base"),d=$APP.l(b,"header"),e=$APP.l(b,"label"),g=$APP.l(b,"value");b=$APP.l(b,"input");var h=$APP.cf([$APP.Ti,$APP.wi,$APP.Yi,$APP.gi,$APP.U,$APP.hi,$APP.Mi,$APP.Ag,$APP.eh,$APP.W,$APP.Vi,$APP.$h,mu],[a.getAttribute("min"),
|
|
3
|
+
a.hasAttribute("disabled"),a.hasAttribute("show-value"),a.getAttribute("name"),a.getAttribute("value"),a.hasAttribute("readonly"),a.getAttribute("aria-labelledby"),a.getAttribute("size"),a.getAttribute("max"),a.getAttribute("label"),a.getAttribute("aria-describedby"),a.getAttribute("aria-label"),a.getAttribute("step")]);var k=$APP.N(h);h=$APP.J(k,$APP.$h);var m=$APP.J(k,mu),q=$APP.J(k,$APP.Ti),r=$APP.J(k,$APP.wi),v=$APP.J(k,$APP.Yi),w=$APP.J(k,$APP.U),z=$APP.J(k,$APP.gi),A=$APP.J(k,$APP.hi),D=$APP.J(k,
|
|
4
|
+
$APP.Mi),F=$APP.J(k,$APP.Ag),I=$APP.J(k,$APP.W),E=$APP.J(k,$APP.eh);k=$APP.J(k,$APP.Vi);q=ju(q,0);E=ju(E,100);w=$APP.lg.h($APP.kg.h(ju(w,0),q),E);$APP.C.h(m,"any")?m="any":(m=typeof m==="string"?parseFloat(m):NaN,m=$APP.p(isNaN(m))&&m>0?""+$APP.T.g(m):"1");F=typeof F==="string"&&$APP.Cc(nu,F)?F:"md";r=$APP.K(r);A=$APP.K(A);v=$APP.K(v);var R=E>q?$APP.lg.h($APP.kg.h((w-q)/(E-q)*100,0),100):0;h=$APP.cf([$APP.Ti,$APP.aj,$APP.gi,$APP.U,$APP.Mi,ou,$APP.Ag,$APP.eh,$APP.W,$APP.Vi,$APP.$h,$APP.V,mu,pu],[q,
|
|
5
|
+
A,typeof z==="string"&&$APP.O("",z)?z:null,w,typeof D==="string"&&$APP.O("",D)?D:null,v,F,E,typeof I==="string"&&$APP.O("",I)?I:null,typeof k==="string"&&$APP.O("",k)?k:null,typeof h==="string"&&$APP.O("",h)?h:null,r,m,R]);m=$APP.N(h);z=$APP.J(m,$APP.$h);D=$APP.J(m,$APP.V);I=$APP.J(m,mu);k=$APP.J(m,pu);v=$APP.J(m,$APP.Ti);q=$APP.J(m,$APP.aj);h=$APP.J(m,$APP.U);A=$APP.J(m,$APP.Mi);E=$APP.J(m,ou);r=$APP.J(m,$APP.Ag);w=$APP.J(m,$APP.W);F=$APP.J(m,$APP.eh);m=$APP.J(m,$APP.Vi);R=(R=w!=null)?R:E;c.setAttribute("data-size",
|
|
6
|
+
r);lu(a,"data-disabled",D);lu(a,"data-readonly",q);d.style.display=$APP.n(R)?"flex":"none";e.textContent=$APP.n(w)?w:"";e.style.display=w!=null?"":"none";g.textContent=$APP.n(E)?""+$APP.T.g(h):"";g.style.display=$APP.n(E)?"":"none";a.style.setProperty("--_x-slider-fill",""+$APP.T.g(k.toFixed(2))+"%");ku(b,"min",""+$APP.T.g(v));ku(b,"max",""+$APP.T.g(F));b.setAttribute("step",I);$APP.O(b.value,""+$APP.T.g(h))&&(b.value=""+$APP.T.g(h));ku(b,"aria-valuemin",""+$APP.T.g(v));ku(b,"aria-valuemax",""+$APP.T.g(F));
|
|
7
|
+
ku(b,"aria-valuenow",""+$APP.T.g(h));b.setAttribute("aria-readonly",$APP.n(q)?"true":"false");$APP.n(z)?b.setAttribute("aria-label",z):w!=null?b.setAttribute("aria-label",w):b.removeAttribute("aria-label");$APP.n(A)?b.setAttribute("aria-labelledby",A):b.removeAttribute("aria-labelledby");$APP.n(m)?b.setAttribute("aria-describedby",m):b.removeAttribute("aria-describedby");$APP.n(D)?b.setAttribute("disabled",""):b.removeAttribute("disabled");a=$APP.l(a,"__xSliderInternals");return $APP.n(a)?a.setFormValue(""+
|
|
8
|
+
$APP.T.g(h)):null}return null},ru=function(a,b,c){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1}))},su=function(a){return function(){var b=$APP.l($APP.l(a,"__xSliderRefs"),"input").value,c=parseFloat(b),d=parseFloat(function(){var g=a.getAttribute("min");return $APP.n(g)?g:"0"}()),e=parseFloat(function(){var g=a.getAttribute("max");return $APP.n(g)?g:"100"}());a.setAttribute("value",b);return ru(a,"x-slider-input",{value:c,min:d,max:e})}},tu=function(a){return function(){var b=
|
|
9
|
+
parseFloat($APP.l($APP.l(a,"__xSliderRefs"),"input").value),c=parseFloat(function(){var e=a.getAttribute("min");return $APP.n(e)?e:"0"}()),d=parseFloat(function(){var e=a.getAttribute("max");return $APP.n(e)?e:"100"}());return ru(a,"x-slider-change",{value:b,min:c,max:d})}},uu=function(a){return function(b){var c=a.hasAttribute("disabled");return $APP.n($APP.n(c)?c:a.hasAttribute("readonly"))?(b.preventDefault(),b.stopPropagation()):null}},vu=function(a){var b=$APP.l(a,"__xSliderRefs");if($APP.n(b)){var c=
|
|
10
|
+
$APP.l(a,"__xSliderHandlers");if($APP.n(c)){b=$APP.l(b,"input");b.removeEventListener("input",$APP.l(c,"input"));b.removeEventListener("change",$APP.l(c,"change"));b.removeEventListener("keydown",$APP.l(c,"keydown"));a.__xSliderHandlers=null;return}}return null},wu=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return lu(this,c,$APP.K(d))}})},xu=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,
|
|
11
|
+
get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:null},set:function(d){return d!=null&&$APP.O(d)?ku(this,c,""+$APP.T.g(d)):this.removeAttribute(c)}})},zu=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return yu}});wu(b,"disabled","disabled");wu(b,"readOnly","readonly");wu(b,"showValue","show-value");xu(b,"value","value");xu(b,"min","min");xu(b,"max","max");xu(b,"step","step");xu(b,"name","name");
|
|
12
|
+
xu(b,"label","label");xu(b,"size","size");b.connectedCallback=function(){if(!$APP.n($APP.l(this,"__xSliderRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("div"),h=document.createElement("span"),k=document.createElement("span"),m=document.createElement("input");d.textContent=":host{display:block;color-scheme:light dark;--x-slider-track-color:rgba(0,0,0,0.15);--x-slider-fill-color:#3b82f6;--x-slider-thumb-color:#ffffff;--x-slider-thumb-border:2px solid #3b82f6;--x-slider-thumb-shadow:0 1px 4px rgba(0,0,0,0.20);--x-slider-focus-ring:#60a5fa;--x-slider-disabled-opacity:0.45;--x-slider-label-color:rgba(0,0,0,0.60);--x-slider-value-color:rgba(0,0,0,0.50);--x-slider-radius:9999px;}@media (prefers-color-scheme:dark){:host{--x-slider-track-color:rgba(255,255,255,0.15);--x-slider-fill-color:#3b82f6;--x-slider-thumb-color:#ffffff;--x-slider-thumb-border:2px solid #3b82f6;--x-slider-focus-ring:#93c5fd;--x-slider-label-color:rgba(255,255,255,0.60);--x-slider-value-color:rgba(255,255,255,0.50);}}[part\x3dbase]{width:100%;box-sizing:border-box;}[part\x3dbase][data-size\x3dsm]{--_x-slider-track-h:4px;--_x-slider-thumb-sz:14px;}[part\x3dbase][data-size\x3dmd]{--_x-slider-track-h:6px;--_x-slider-thumb-sz:18px;}[part\x3dbase][data-size\x3dlg]{--_x-slider-track-h:8px;--_x-slider-thumb-sz:22px;}[part\x3dheader]{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:4px;}[part\x3dlabel-text]{font-size:0.875rem;color:var(--x-slider-label-color);font-weight:500;}[part\x3dvalue-text]{font-size:0.8125rem;color:var(--x-slider-value-color);}[part\x3dinput]{-webkit-appearance:none;appearance:none;display:block;width:100%;height:var(--_x-slider-thumb-sz,18px);cursor:pointer;margin:0;padding:0;background:transparent;outline:none;box-sizing:border-box;}[part\x3dinput]::-webkit-slider-runnable-track{height:var(--_x-slider-track-h,6px);border-radius:var(--x-slider-radius);background:linear-gradient(to right,var(--x-slider-fill-color) var(--_x-slider-fill,0%),var(--x-slider-track-color) var(--_x-slider-fill,0%));}[part\x3dinput]::-moz-range-track{height:var(--_x-slider-track-h,6px);border-radius:var(--x-slider-radius);background:var(--x-slider-track-color);border:none;}[part\x3dinput]::-moz-range-progress{height:var(--_x-slider-track-h,6px);border-radius:var(--x-slider-radius);background:var(--x-slider-fill-color);}[part\x3dinput]::-webkit-slider-thumb{-webkit-appearance:none;width:var(--_x-slider-thumb-sz,18px);height:var(--_x-slider-thumb-sz,18px);border-radius:50%;background:var(--x-slider-thumb-color);border:var(--x-slider-thumb-border);box-shadow:var(--x-slider-thumb-shadow);margin-top:calc(var(--_x-slider-track-h,6px)/2 - var(--_x-slider-thumb-sz,18px)/2);cursor:pointer;transition:box-shadow 100ms ease;}[part\x3dinput]::-moz-range-thumb{width:var(--_x-slider-thumb-sz,18px);height:var(--_x-slider-thumb-sz,18px);border-radius:50%;background:var(--x-slider-thumb-color);border:var(--x-slider-thumb-border);box-shadow:var(--x-slider-thumb-shadow);cursor:pointer;transition:box-shadow 100ms ease;}[part\x3dinput]:focus-visible::-webkit-slider-thumb{box-shadow:var(--x-slider-thumb-shadow),0 0 0 3px var(--x-slider-focus-ring);}[part\x3dinput]:focus-visible::-moz-range-thumb{box-shadow:var(--x-slider-thumb-shadow),0 0 0 3px var(--x-slider-focus-ring);}:host([data-disabled]) [part\x3dinput]{opacity:var(--x-slider-disabled-opacity);cursor:default;pointer-events:none;}:host([data-readonly]) [part\x3dinput]{pointer-events:none;}@media (prefers-reduced-motion:reduce){[part\x3dinput]::-webkit-slider-thumb{transition:none;}[part\x3dinput]::-moz-range-thumb{transition:none;}}";
|
|
13
|
+
e.setAttribute("part","base");g.setAttribute("part","header");h.setAttribute("part","label-text");k.setAttribute("part","value-text");m.setAttribute("part","input");m.setAttribute("type","range");g.appendChild(h);g.appendChild(k);e.appendChild(g);e.appendChild(m);c.appendChild(d);c.appendChild(e);this.__xSliderRefs={base:e,header:g,label:h,value:k,input:m};$APP.n(this.attachInternals)&&(this.__xSliderInternals=this.attachInternals())}vu(this);c=$APP.l(this,"__xSliderRefs");$APP.n(c)&&(c=$APP.l(c,
|
|
14
|
+
"input"),d=su(this),e=tu(this),g=uu(this),h={input:d,change:e,keydown:g},c.addEventListener("input",d),c.addEventListener("change",e),c.addEventListener("keydown",g),this.__xSliderHandlers=h);return qu(this)};b.disconnectedCallback=function(){return vu(this)};b.attributeChangedCallback=function(){return qu(this)};b.formDisabledCallback=function(c){lu(this,"disabled",$APP.K(c));return qu(this)};b.formResetCallback=function(){ku(this,"value",""+$APP.T.g(0));return qu(this)};return a},Au=function(){return $APP.n(customElements.get("x-slider"))?
|
|
15
|
+
null:customElements.define("x-slider",zu())},ou=new $APP.M(null,"show-value?","show-value?",-1960833108),pu=new $APP.M(null,"fill-percent","fill-percent",-1813848228),mu=new $APP.M(null,"step","step",1288888124);var nu=new $APP.S(null,new $APP.Q(null,3,["md",null,"lg",null,"sm",null],null),null),yu="value min max step disabled readonly name label show-value size aria-label aria-labelledby aria-describedby".split(" ");
|
|
16
|
+
$APP.cf([$APP.Ti,$APP.wi,$APP.Eg,$APP.gi,$APP.U,$APP.Ag,$APP.zi,$APP.eh,$APP.W,mu],[new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Pg,"min"],null),new $APP.Q(null,2,[$APP.Z,$APP.Ji,$APP.Pg,"disabled"],null),new $APP.Q(null,2,[$APP.Z,$APP.Ji,$APP.Pg,"show-value"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Pg,"name"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Pg,"value"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Pg,"size"],null),new $APP.Q(null,2,[$APP.Z,$APP.Ji,$APP.Pg,"readonly"],null),new $APP.Q(null,
|
|
17
|
+
2,[$APP.Z,$APP.X,$APP.Pg,"max"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Pg,"label"],null),new $APP.Q(null,2,[$APP.Z,$APP.X,$APP.Pg,"step"],null)]);$APP.wd(["x-slider-input",new $APP.Q(null,1,[$APP.Y,new $APP.Q(null,3,[$APP.U,$APP.Fh,$APP.Ti,$APP.Fh,$APP.eh,$APP.Fh],null)],null),"x-slider-change",new $APP.Q(null,1,[$APP.Y,new $APP.Q(null,3,[$APP.U,$APP.Fh,$APP.Ti,$APP.Fh,$APP.eh,$APP.Fh],null)],null)]);$APP.ka("baredom.exports.x_slider.init",Au);export const init=Au;
|
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 tv=function(a){return a!=null&&$APP.O((""+$APP.T.g(a)).trim().toLowerCase(),"false")},zv=function(a){var b=new $APP.Q(null,3,[$APP.fi,a.getAttribute("size"),uv,a.getAttribute("axis"),vv,a.getAttribute("grow")],null);b=$APP.N(b);var c=$APP.J(b,$APP.fi),d=$APP.J(b,uv);b=$APP.J(b,vv);c=typeof c==="string"&&c.trim().length>0?c.trim():"1rem";d=typeof d==="string"?d.trim().toLowerCase():null;d=$APP.Cc(wv,d)?d:"vertical";b=new $APP.Q(null,3,[$APP.Ag,c,xv,d,yv,tv(b)],null);c=$APP.N(b);b=$APP.J(c,$APP.Ag);
|
|
3
|
+
d=$APP.J(c,xv);c=$APP.J(c,yv);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")},Av=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})},Bv=function(a){Object.defineProperty(a,
|
|
4
|
+
"grow",{get:function(){return tv(this.getAttribute("grow"))},set:function(b){return $APP.n(b)?this.setAttribute("grow",""):this.removeAttribute("grow")},enumerable:!0,configurable:!0})},Cv=function(a){Av(a,"size","1rem");Av(a,"axis","vertical");Bv(a)},Ev=function(){var a=class extends HTMLElement{};a.observedAttributes=Dv;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}}zv(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)&&zv(this);return null};Cv(a.prototype);return a},Fv=function(){$APP.n(customElements.get("x-spacer"))||customElements.define("x-spacer",Ev());return null},xv=new $APP.M(null,"axis","axis",-1215390822),yv=new $APP.M(null,"grow?","grow?",2124334580),vv=new $APP.M(null,"grow-raw",
|
|
6
|
+
"grow-raw",441172903),uv=new $APP.M(null,"axis-raw","axis-raw",291213231);var Dv=["size","axis","grow"],wv=new $APP.S(null,new $APP.Q(null,2,["vertical",null,"horizontal",null],null),null);$APP.ka("baredom.exports.x_spacer.init",Fv);export const init=Fv;
|
package/dist/x-spinner.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var bG=function(a){var b=new $APP.
|
|
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.
|
|
4
|
-
""+$APP.
|
|
2
|
+
var bG=function(a){var b=new $APP.Q(null,3,[$APP.Ag,a.getAttribute("size"),$APP.Vg,a.getAttribute("variant"),$APP.W,a.getAttribute("label")],null);var c=$APP.N(b),d=$APP.J(c,$APP.Ag);b=$APP.J(c,$APP.Vg);c=$APP.J(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.O("",c.trim())?c.trim():"Loading";d=$APP.N(new $APP.Q(null,3,[$APP.Ag,d,$APP.Vg,b,$APP.W,c],null));b=$APP.J(d,$APP.Ag);c=$APP.J(d,$APP.Vg);d=$APP.J(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.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})},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}bG(this);return null};a.prototype.disconnectedCallback=function(){return null};a.prototype.attributeChangedCallback=function(b,c,d){b=$APP.
|
|
7
|
-
customElements.define("x-spinner",eG());return null};var dG=["size","variant","label"],$F=new $APP.
|
|
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.O(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.S(null,new $APP.Q(null,5,["xs",null,"md",null,"lg",null,"xl",null,"sm",null],null),null),aG=new $APP.S(null,new $APP.Q(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)?(
|
|
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"),
|
|
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");
|
|
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"
|
|
2
|
+
var Dy=function(a,b,c){return $APP.Cc(b,a)?a:c},Ey=function(a){return $APP.n($APP.n(a)?$APP.O("",a):a)?a:null},Ny=function(a){var b=$APP.N(a),c=$APP.J(b,Fy),d=$APP.J(b,Gy),e=$APP.J(b,$APP.ci),g=$APP.J(b,$APP.Vg);a=$APP.J(b,$APP.U);var h=$APP.J(b,$APP.ki),k=$APP.J(b,$APP.Ag),m=$APP.J(b,$APP.Gh);b=$APP.J(b,$APP.W);g=Dy(g,Hy,"default");e=Dy(e,Iy,"start");k=Dy(k,Jy,"md");c=Dy(c,Ky,"normal");d=Dy(d,Ly,"neutral");m=$APP.K(m);return $APP.cf([Gy,$APP.ci,$APP.Vg,$APP.U,$APP.ki,$APP.Ag,$APP.Gh,$APP.W,My,Fy],
|
|
3
|
+
[d,e,g,Ey(a),Ey(h),k,m,Ey(b),m?"true":null,c])},Oy=function(a){return $APP.cf([Gy,$APP.ci,$APP.Vg,$APP.U,$APP.ki,$APP.Ag,$APP.Gh,$APP.W,Fy],[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")])},Py=function(a,b){a.setAttribute("role","figure");var c=My.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")},Qy=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",Fy.g(b));a.setAttribute("data-trend",Gy.g(b));$APP.n($APP.Gh.g(b))?a.setAttribute("data-loading","true"):a.removeAttribute("data-loading")},Ry=function(a){var b=Ny(Oy(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)?(Py(a,b),Qy(c,b),d.textContent=function(){var h=$APP.W.g(b);return $APP.n(h)?h:""}(),e.textContent=function(){var h=$APP.U.g(b);return $APP.n(h)?h:""}(),g.textContent=function(){var h=$APP.ki.g(b);return $APP.n(h)?h:""}()):null},Sy=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"),q=document.createElement("span"),r=document.createElement("span"),v=document.createElement("span"),w=document.createElement("slot"),z=document.createElement("slot"),A=document.createElement("slot"),D=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
|
+
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");D.setAttribute("name","hint");e.appendChild(w);h.appendChild(z);h.appendChild(q);k.appendChild(A);k.appendChild(r);m.appendChild(D);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}Ry(a);return a},Uy=function(){var a=class extends HTMLElement{};a.observedAttributes=Ty;a.prototype.connectedCallback=function(){return Sy(this)};a.prototype.attributeChangedCallback=function(){return $APP.l(this,"__x_stat_initialized")===!0?Ry(this):Sy(this)};return a},Vy=function(){return $APP.n(customElements.get("x-stat"))?null:
|
|
9
|
+
customElements.define("x-stat",Uy())},Fy=new $APP.M(null,"emphasis","emphasis",293543451),My=new $APP.M(null,"aria-busy","aria-busy",793864247),Gy=new $APP.M(null,"trend","trend",54563841);var Ty="variant align size emphasis trend loading label value hint".split(" "),Hy=new $APP.S(null,new $APP.Q(null,5,["warning",null,"positive",null,"subtle",null,"danger",null,"default",null],null),null),Iy=new $APP.S(null,new $APP.Q(null,3,["center",null,"start",null,"end",null],null),null),Jy=new $APP.S(null,new $APP.Q(null,3,["md",null,"lg",null,"sm",null],null),null),Ky=new $APP.S(null,new $APP.Q(null,2,["high",null,"normal",null],null),null),Ly=new $APP.S(null,new $APP.Q(null,3,["neutral",null,
|
|
10
|
+
"up",null,"down",null],null),null);$APP.ka("baredom.exports.x_stat.init",Vy);export const init=Vy;
|
package/dist/x-stepper.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var Qk=function(a){a=$APP.
|
|
3
|
-
b)))return a=parseInt(b,10),a>0&&a<=200?$APP.Md(function(d){return new $APP.
|
|
2
|
+
var Qk=function(a){a=$APP.J(Ok,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:Pk},Sk=function(a){a=$APP.J(Rk,a);return $APP.n(a)?a:"horizontal"},Vk=function(a){a=$APP.J(Tk,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:Uk},Xk=function(a){a=$APP.J(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.Q(null,2,[$APP.W,"Step "+$APP.T.g(d),$APP.Dg,null],null)},$APP.Cf(1,a+1)):$APP.Ld;if($APP.n(function(){var d=$APP.O("",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.Q(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
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.
|
|
6
|
-
c=Zk(c);var g=$APP.B(c);return new $APP.
|
|
7
|
-
$APP.W);e=$APP.
|
|
8
|
-
}}b=$APP.n(b)?b:"";g.setAttribute("part","step");g.setAttribute("role","listitem");g.setAttribute("data-index",""+$APP.
|
|
9
|
-
"true");m.textContent=$APP.
|
|
10
|
-
function(a){var b=el(a);if($APP.
|
|
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.
|
|
12
|
-
e)&&(e=$APP.xg(new $APP.
|
|
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.
|
|
14
|
-
""+$APP.
|
|
5
|
+
d.setAttribute("part","container");d.setAttribute("role","list");b.appendChild(c);b.appendChild(d);a.__xStepperRefs=new $APP.Q(null,2,[$APP.rh,b,$APP.pi,d],null);return $APP.l(a,"__xStepperRefs")},el=function(a){a=new $APP.Q(null,5,[al,a.getAttribute("steps"),bl,a.getAttribute("current"),$APP.ji,a.getAttribute("orientation"),$APP.fi,a.getAttribute("size"),$APP.V,a.hasAttribute("disabled")],null);var b=$APP.N(a),c=$APP.J(b,al);a=$APP.J(b,bl);var d=$APP.J(b,$APP.ji),e=$APP.J(b,$APP.fi);b=$APP.J(b,$APP.V);
|
|
6
|
+
c=Zk(c);var g=$APP.B(c);return new $APP.Q(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.V,$APP.K(b)],null)},fl=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.oa: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));}}())+")"},gl=function(a,b,c,d){var e=$APP.N(b);b=$APP.J(e,
|
|
7
|
+
$APP.W);e=$APP.J(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.M?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.T.g(z));
|
|
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",z);h.setAttribute("part","step-track");k.setAttribute("part","step-indicator");k.setAttribute("type","button");k.setAttribute("aria-label",fl(a,b,c));$APP.C.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.C.h(c,$APP.Oi)?"✓":""+$APP.T.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.O(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.O($APP.l(a,"__xStepperModel"),b)){b=$APP.N(b);var c=$APP.J(b,cl),d=$APP.J(b,dl),e=$APP.J(b,$APP.zh),g=$APP.J(b,$APP.Ag),h=$APP.J(b,$APP.V),k=$k(a);k=$APP.N(k);k=$APP.J(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.C.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.C.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.V.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.O(d,
|
|
12
|
+
e)&&(e=$APP.xg(new $APP.Q(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.T.g(d)))));return null}var c=$k(a);c=$APP.N(c);$APP.J(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.T.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.T.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.T.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.T.g(b)):this.removeAttribute("size")},enumerable:!0,
|
|
15
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.
|
|
17
|
-
"vertical","vertical",718696748),sl=new $APP.
|
|
16
|
+
function(b,c,d){$APP.O(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.M(null,"upcoming","upcoming",1873315471),dl=new $APP.M(null,"current","current",-1088038603),al=new $APP.M(null,"steps-raw","steps-raw",1741812533),Uk=new $APP.M(null,"md","md",707286655),ql=new $APP.M(null,"lg","lg",-80787836),Pk=new $APP.M(null,"horizontal","horizontal",2062109475),rl=new $APP.M(null,
|
|
17
|
+
"vertical","vertical",718696748),sl=new $APP.M(null,"sm","sm",-1402575065),jl=new $APP.M(null,"to","to",192099007),cl=new $APP.M(null,"steps","steps",-128433302),bl=new $APP.M(null,"current-raw","current-raw",-1440665509);var nl=["steps","current","orientation","size","disabled"];$APP.wd(["x-stepper-change",new $APP.Q(null,2,[$APP.Y,new $APP.Q(null,2,[$APP.Lg,$APP.Fh,jl,$APP.Fh],null),$APP.ui,!0],null)]);var Ok=new $APP.Q(null,2,["horizontal",Pk,"vertical",rl],null),Rk=new $APP.Q(null,2,[Pk,"horizontal",rl,"vertical"],null),Tk=new $APP.Q(null,3,["sm",sl,"md",Uk,"lg",ql],null),Wk=new $APP.Q(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.
|
|
4
|
-
e=$APP.ni.g(b);
|
|
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.
|
|
2
|
+
var SA=function(a,b,c){return a.setAttribute(b,c)},TA=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},UA=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.N(a);a=
|
|
3
|
+
$APP.J(b,$APP.Ci);var c=$APP.J(b,$APP.ii),d=$APP.J(b,$APP.Jh),e=$APP.J(b,$APP.Yh),g=$APP.J(b,$APP.Cg),h=$APP.J(b,$APP.Qg),k=$APP.J(b,$APP.Zh),m=$APP.J(b,$APP.ti);b=$APP.J(b,$APP.Ei);k=$APP.K(k);g=$APP.K(g);return $APP.cf([$APP.ah,$APP.Wg,$APP.aj,$APP.ni,$APP.Ig,$APP.gi,$APP.U,$APP.Mi,$APP.Vi,$APP.$h,$APP.V],[g,k?"true":"false",$APP.K(m),k,$APP.n(g)?k:!0,d,b!=null?b:"on",h,c,a,$APP.K(e)])},VA=function(a){var b=$APP.l(a,"__xSwitchRefs");if($APP.n(b)){var c=$APP.l(b,"control");b=UA(a);var d=$APP.V.g(b),
|
|
4
|
+
e=$APP.ni.g(b);SA(c,"aria-checked",$APP.Wg.g(b));c.setAttribute("aria-disabled",$APP.n(d)?"true":"false");SA(c,"aria-required",$APP.n($APP.ah.g(b))?"true":"false");SA(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");TA(a,"data-checked",e);TA(a,"data-disabled",d);a=$APP.l(a,"__xSwitchInternals");return $APP.n(a)?a.setFormValue($APP.n(e)?$APP.U.g(b):null):null}return null},WA=function(a){var b=UA(a),c=$APP.V.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.U.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)?(TA(a,"checked",c),VA(a),a.dispatchEvent(new CustomEvent("x-switch-change",{detail:{value:b,checked:c},bubbles:!0,composed:!0,cancelable:!1}))):null},XA=function(a){return function(){return WA(a)}},YA=function(a){return function(b){var c=b.key;return $APP.C.h(c," ")||$APP.C.h(c,"Enter")?(b.preventDefault(),WA(a)):null}},ZA=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},$A=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return TA(this,c,$APP.K(d))}})},aB=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)?SA(this,c,""+$APP.T.g(d)):this.removeAttribute(c)}})},cB=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return bB}});$A(b,"checked","checked");$A(b,"disabled","disabled");$A(b,"readOnly","readonly");$A(b,"required","required");aB(b,"name","name");aB(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())}ZA(this);c=$APP.l(this,"__xSwitchRefs");$APP.n(c)&&(c=$APP.l(c,"control"),d=XA(this),e=YA(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 VA(this)};b.disconnectedCallback=function(){return ZA(this)};b.attributeChangedCallback=function(){return VA(this)};b.formDisabledCallback=
|
|
12
|
+
function(c){TA(this,"disabled",$APP.K(c));return VA(this)};b.formResetCallback=function(){this.removeAttribute("checked");return VA(this)};return a},dB=function(){return $APP.n(customElements.get("x-switch"))?null:customElements.define("x-switch",cB())};var bB="checked disabled readonly required name value aria-label aria-describedby aria-labelledby".split(" ");$APP.wd(["x-switch-change-request",new $APP.Q(null,2,[$APP.ui,!0,$APP.Y,new $APP.Q(null,3,[$APP.U,$APP.X,$APP.Bg,$APP.Ji,$APP.ei,$APP.Ji],null)],null),"x-switch-change",new $APP.Q(null,2,[$APP.ui,!1,$APP.Y,new $APP.Q(null,2,[$APP.U,$APP.X,$APP.Qi,$APP.Ji],null)],null)]);$APP.ka("baredom.exports.x_switch.init",dB);export const init=dB;
|
package/dist/x-tab.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var hj=function(a,b,c){return $APP.Cc(b,a)?a:c},mj=function(a){var b=$APP.
|
|
2
|
+
var hj=function(a,b,c){return $APP.Cc(b,a)?a:c},mj=function(a){var b=$APP.N(a),c=$APP.J(b,$APP.$i),d=$APP.J(b,$APP.wi);a=$APP.J(b,$APP.zh);var e=$APP.J(b,$APP.Ag),g=$APP.J(b,$APP.Vg),h=$APP.J(b,$APP.W);b=$APP.J(b,ij);c=$APP.K(c);var k=(d=$APP.K(d))?"-1":c?"0":"-1";return new $APP.Q(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.Q(null,8,[$APP.U,a.getAttribute("value"),$APP.$i,
|
|
3
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.
|
|
5
|
-
$APP.zh.g(b))}return null},pj=function(a){var b=mj(nj(a)),c=$APP.
|
|
4
|
+
$APP.Tg.g(b));var d=ij.g(b),e=$APP.W.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.$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.N(b);b=$APP.J(c,$APP.$i);c=$APP.J(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.C.h(c,"Enter")||$APP.C.h(c," ")?(b.preventDefault(),b=pj(a)):b=null;return b})},rj=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;qj(a);a.__x_tab_initialized=!0}oj(a);return a},
|
|
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?oj(this):
|
|
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},sj=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})},uj=function(){var a=class extends HTMLElement{};a.observedAttributes=tj;a.prototype.connectedCallback=function(){return rj(this)};a.prototype.attributeChangedCallback=
|
|
9
|
+
function(){return $APP.l(this,"__x_tab_initialized")===!0?oj(this):rj(this)};sj(a);return a},zj=function(){return $APP.n(customElements.get("x-tab"))?null:customElements.define("x-tab",uj())},ij=new $APP.M(null,"controls","controls",1340701452);var tj="value selected disabled orientation size variant label controls".split(" "),jj=new $APP.S(null,new $APP.Q(null,2,["vertical",null,"horizontal",null],null),null),kj=new $APP.S(null,new $APP.Q(null,3,["md",null,"lg",null,"sm",null],null),null),lj=new $APP.S(null,new $APP.Q(null,3,["default",null,"underline",null,"pill",null],null),null);$APP.wd(["tab-select",new $APP.Q(null,1,[$APP.Y,new $APP.Q(null,1,[$APP.U,$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 yx=function(a,b,c){a=typeof a==="string"?a.trim().toLowerCase():null;return $APP.Cc(b,a)?a:c},zx=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),$APP.p(isNaN(a))&&a>0?Math.floor(a):1):1},Cx=function(a){var b=$APP.N(a);a=$APP.J(b,Ax);b=$APP.J(b,Bx);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},Dx=function(a){var b=$APP.N(a);a=$APP.J(b,$APP.Z);b=$APP.J(b,Ax);return(a=$APP.C.h(a,
|
|
3
|
+
"header"))?b:a},Ex=function(a){switch(a){case "none":return"asc";case "asc":return"desc";case "desc":return"none";default:return"asc"}},Fx=function(a){switch(a){case "none":return"Sort ascending";case "asc":return"Sort descending";case "desc":return"Remove sort";default:return"Sort ascending"}},Kx=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.
|
|
8
|
-
|
|
9
|
-
a.removeAttribute("aria-sort");$APP.n(
|
|
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
|
-
$APP.ci);b.call(this,new d("x-table-cell-connected",{detail:$APP.xg(new $APP.
|
|
20
|
-
customElements.define("x-table-cell",
|
|
21
|
-
|
|
22
|
-
"scope-raw","scope-raw",-773628648),
|
|
23
|
-
$APP.cf([$APP.ci,
|
|
24
|
-
1,[$APP.Z,$APP.Fh],null),new $APP.
|
|
25
|
-
var
|
|
26
|
-
"desc",null,"asc",null],null),null);$APP.ka("baredom.exports.x_table_cell.init",
|
|
6
|
+
b.appendChild(c);b.appendChild(d);a.__xTableCellRefs=new $APP.Q(null,5,[$APP.rh,b,Gx,d,Hx,e,Ix,h,Jx,m],null);return $APP.l(a,"__xTableCellRefs")},by=function(a){a=$APP.cf([$APP.Ch,Lx,Mx,Nx,Ax,Ox,$APP.ih,Px,Qx,$APP.V,Rx],[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.J(b,$APP.V);var c=$APP.J(b,Rx),d=$APP.J(b,$APP.Ch),e=$APP.J(b,Lx),g=$APP.J(b,Mx),h=$APP.J(b,Nx),k=$APP.J(b,Ax),m=$APP.J(b,Ox),q=$APP.J(b,$APP.ih),r=$APP.J(b,Px);b=$APP.J(b,Qx);return $APP.cf([$APP.ci,Bx,Sx,$APP.Z,Tx,Ax,$APP.Qh,Ux,Ox,$APP.V,Vx],[yx(d,Wx,"start"),yx(h,Xx,"none"),yx(g,Yx,"middle"),yx(q,Zx,"data"),yx(b,$x,"col"),$APP.K(k),yx(r,ay,"none"),zx(c),$APP.K(m),$APP.K(a),zx(e)])},cy=function(a){var b=by(a);if($APP.O($APP.l(a,"__xTableCellModel"),b)){b=$APP.N(b);var c=$APP.J(b,
|
|
8
|
+
Ux),d=$APP.J(b,Vx),e=$APP.J(b,$APP.V),g=$APP.J(b,Bx),h=Kx(a);h=$APP.N(h);var k=$APP.J(h,Ix);h=$APP.J(h,Jx);var m=Dx(b),q=$APP.N(b),r=$APP.J(q,$APP.Z),v=$APP.J(q,$APP.ci),w=$APP.J(q,Sx),z=$APP.J(q,$APP.Qh),A=$APP.J(q,Ox),D=$APP.J(q,$APP.V);$APP.J(q,Ax);$APP.J(q,Bx);var F=a.setAttribute,I=$APP.N(q);var E=$APP.J(I,$APP.Z);I=$APP.J(I,Tx);E=$APP.C.h(E,"header")?$APP.C.h(I,"row")||$APP.C.h(I,"rowgroup")?"rowheader":"columnheader":"cell";F.call(a,"role",E);q=Cx(q);$APP.n(q)?a.setAttribute("aria-sort",q):
|
|
9
|
+
a.removeAttribute("aria-sort");$APP.n(D)?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.C.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.T.g(c):"";a.style.gridRow=d>1?"span "+$APP.T.g(d):"";k.hidden=$APP.p(m);c=parseInt;r=$APP.N(b);
|
|
10
|
+
m=$APP.J(r,$APP.Z);d=$APP.J(r,Ax);r=$APP.J(r,$APP.V);m=$APP.C.h(m,"header");k.tabIndex=c($APP.n(m?$APP.n(d)?$APP.p(r):d:m)?"0":"-1",10);k.setAttribute("aria-label",Fx(g));k.disabled=$APP.K(e);a:switch(e=$APP.N(b),$APP.J(e,Bx)){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}},dy=function(a){var b=a.getAttribute("sort-direction");b=yx(b,Xx,"none");b=new CustomEvent("x-table-cell-sort",{detail:{direction:Ex(b),previousDirection:b},bubbles:!0,composed:!0,cancelable:!0});a.dispatchEvent(b)},ey=function(a){var b=function(){var c=$APP.l(a,"__xTableCellModel");
|
|
12
|
+
return $APP.n(c)?c:by(a)}();$APP.n(function(){var c=Dx(b);return $APP.n(c)?$APP.p($APP.V.g(b)):c}())&&dy(a);return null},fy=function(a){function b(){return ey(a)}var c=Kx(a);c=$APP.N(c);$APP.J(c,Ix).addEventListener("click",b);$APP.ma(a,"__xTableCellHandlers",{"sort-click":b})},gy=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.J(c,Ix),b=$APP.l(b,"sort-click"),$APP.n(b)&&c.removeEventListener("click",b));a.__xTableCellHandlers=
|
|
13
|
+
null},hy=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 zx(this.getAttribute("col-span"))},set:function(b){b=parseInt(b,10);return $APP.p(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 zx(this.getAttribute("row-span"))},set:function(b){b=parseInt(b,10);return $APP.p(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})},ly=function(){var a=class extends HTMLElement{};a.observedAttributes=iy;a.prototype.connectedCallback=function(){Kx(this);gy(this);fy(this);cy(this);var b=$APP.l(this,"__xTableCellModel");var c=$APP.n(b)?b:by(this);b=this.dispatchEvent;var d=CustomEvent,e=$APP.N(c);c=$APP.J(e,$APP.Z);var g=$APP.J(e,Tx),h=$APP.J(e,Ux),k=$APP.J(e,Vx);e=$APP.J(e,
|
|
19
|
+
$APP.ci);b.call(this,new d("x-table-cell-connected",{detail:$APP.xg(new $APP.Q(null,5,[$APP.Z,c,Tx,g,jy,h,ky,k,$APP.ci,e],null)),bubbles:!0,composed:!0,cancelable:!1}));return null};a.prototype.disconnectedCallback=function(){gy(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)&&cy(this);return null};hy(a.prototype);return a},my=function(){$APP.n(customElements.get("x-table-cell"))||
|
|
20
|
+
customElements.define("x-table-cell",ly());return null},Vx=new $APP.M(null,"row-span","row-span",-365554241),Tx=new $APP.M(null,"scope","scope",-439358418),Ix=new $APP.M(null,"sort-btn","sort-btn",1913954560),Hx=new $APP.M(null,"content","content",15833224),Ox=new $APP.M(null,"truncate?","truncate?",135673334),jy=new $APP.M(null,"colSpan","colSpan",872137394),Gx=new $APP.M(null,"cell","cell",764245084),Sx=new $APP.M(null,"valign","valign",1485197511),Ax=new $APP.M(null,"sortable?","sortable?",291547474),
|
|
21
|
+
Jx=new $APP.M(null,"sort-icon-default","sort-icon-default",-596209230),Rx=new $APP.M(null,"col-span-raw","col-span-raw",1425293661),Mx=new $APP.M(null,"valign-raw","valign-raw",-1083375124),Nx=new $APP.M(null,"sort-direction-raw","sort-direction-raw",-1822100883),Px=new $APP.M(null,"sticky-raw","sticky-raw",1857578519),Ux=new $APP.M(null,"col-span","col-span",-232603210),ky=new $APP.M(null,"rowSpan","rowSpan",826884002),Lx=new $APP.M(null,"row-span-raw","row-span-raw",-1130003707),Qx=new $APP.M(null,
|
|
22
|
+
"scope-raw","scope-raw",-773628648),Bx=new $APP.M(null,"sort-direction","sort-direction",-1635889628);var iy="type scope align valign col-span row-span truncate sticky sortable sort-direction disabled".split(" ");
|
|
23
|
+
$APP.cf([$APP.ci,ky,new $APP.M(null,"truncate","truncate",-1327322939),$APP.wi,Sx,$APP.Z,Tx,jy,$APP.Qh,new $APP.M(null,"sortable","sortable",2109633621),new $APP.M(null,"sortDirection","sortDirection",-45816999)],[new $APP.Q(null,1,[$APP.Z,$APP.X],null),new $APP.Q(null,1,[$APP.Z,$APP.Fh],null),new $APP.Q(null,1,[$APP.Z,$APP.Ji],null),new $APP.Q(null,1,[$APP.Z,$APP.Ji],null),new $APP.Q(null,1,[$APP.Z,$APP.X],null),new $APP.Q(null,1,[$APP.Z,$APP.X],null),new $APP.Q(null,1,[$APP.Z,$APP.X],null),new $APP.Q(null,
|
|
24
|
+
1,[$APP.Z,$APP.Fh],null),new $APP.Q(null,1,[$APP.Z,$APP.X],null),new $APP.Q(null,1,[$APP.Z,$APP.Ji],null),new $APP.Q(null,1,[$APP.Z,$APP.X],null)]);$APP.wd(["x-table-cell-sort",new $APP.Q(null,2,[$APP.Y,new $APP.Q(null,2,[$APP.ai,$APP.X,$APP.Hi,$APP.X],null),$APP.ui,!0],null),"x-table-cell-connected",new $APP.Q(null,1,[$APP.Y,new $APP.Q(null,5,[$APP.Z,$APP.X,Tx,$APP.X,jy,$APP.Fh,ky,$APP.Fh,$APP.ci,$APP.X],null)],null),"x-table-cell-disconnected",new $APP.Q(null,1,[$APP.Y,$APP.xd],null)]);
|
|
25
|
+
var Zx=new $APP.S(null,new $APP.Q(null,2,["data",null,"header",null],null),null),$x=new $APP.S(null,new $APP.Q(null,4,["rowgroup",null,"col",null,"row",null,"colgroup",null],null),null),Wx=new $APP.S(null,new $APP.Q(null,3,["center",null,"start",null,"end",null],null),null),Yx=new $APP.S(null,new $APP.Q(null,3,["top",null,"middle",null,"bottom",null],null),null),ay=new $APP.S(null,new $APP.Q(null,3,["none",null,"start",null,"end",null],null),null),Xx=new $APP.S(null,new $APP.Q(null,3,["none",null,
|
|
26
|
+
"desc",null,"asc",null],null),null);$APP.ka("baredom.exports.x_table_cell.init",my);export const init=my;
|
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.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(){
|
|
11
|
-
|
|
2
|
+
var zp=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),$APP.p(isNaN(a))&&a>0?Math.floor(a):null):null},Bp=function(a){var b=$APP.N(a);a=$APP.J(b,Ap);b=$APP.J(b,$APP.V);return $APP.n(a)?$APP.p(b):a},Cp=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.Q(null,2,[$APP.rh,b,$APP.Ph,d],null)}},Fp=function(a){a=new $APP.Q(null,4,[$APP.Ih,a.hasAttribute("selected"),$APP.V,a.hasAttribute("disabled"),Ap,a.hasAttribute("interactive"),Dp,a.getAttribute("row-index")],null);var b=$APP.N(a);a=$APP.J(b,$APP.Ih);var c=$APP.J(b,$APP.V),d=$APP.J(b,Ap);b=$APP.J(b,Dp);return new $APP.Q(null,4,[$APP.Ih,$APP.K(a),$APP.V,$APP.K(c),Ap,$APP.K(d),Ep,zp(b)],null)},Gp=function(a){var b=Fp(a);if($APP.O($APP.l(a,
|
|
4
|
+
"__xTableRowModel"),b)){Cp(a);var c=$APP.N(b),d=$APP.J(c,$APP.Ih),e=$APP.J(c,$APP.V),g=$APP.J(c,Ap),h=$APP.J(c,Ep);a.setAttribute("role","row");var k=$APP.N(c);var m=$APP.J(k,$APP.Ih);k=$APP.J(k,Ap);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");$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(Bp(c))?0:-1;a.__xTableRowModel=b}},Hp=function(a){var b=$APP.l(a,"__xTableRowModel");var c=$APP.n(b)?b:Fp(a);b=a.dispatchEvent;var d=CustomEvent,e=$APP.N(c);c=$APP.J(e,$APP.Ih);var g=$APP.J(e,$APP.V);e=$APP.J(e,Ep);b.call(a,new d("x-table-row-click",{detail:$APP.xg(new $APP.Q(null,3,[$APP.ri,$APP.n(e)?e:0,$APP.$i,c,$APP.wi,g],
|
|
6
|
+
null)),bubbles:!0,composed:!0,cancelable:!0}))},Ip=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:Fp(a),$APP.n(Bp(e))&&(d.preventDefault(),Hp(a));return null}function c(){var d=$APP.l(a,"__xTableRowModel");d=$APP.n(d)?d:Fp(a);$APP.n(Bp(d))&&Hp(a);return null}a.addEventListener("click",c);a.addEventListener("keydown",b);$APP.ma(a,"__xTableRowHandlers",{click:c,keydown:b})},Jp=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},Kp=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 zp(this.getAttribute("row-index"))},set:function(b){b=parseInt(b,10);return $APP.p(isNaN(b))&&
|
|
9
|
+
b>0?this.setAttribute("row-index",""+$APP.T.g(b)):this.removeAttribute("row-index")},enumerable:!0,configurable:!0})},Mp=function(){var a=class extends HTMLElement{};a.observedAttributes=Lp;a.prototype.connectedCallback=function(){Cp(this);Jp(this);Ip(this);Gp(this);var b=$APP.l(this,"__xTableRowModel");var c=$APP.n(b)?b:Fp(this);b=this.dispatchEvent;var d=CustomEvent,e=$APP.N(c);c=$APP.J(e,$APP.Ih);var g=$APP.J(e,$APP.V),h=$APP.J(e,Ap);e=$APP.J(e,Ep);b.call(this,new d("x-table-row-connected",{detail:$APP.xg(new $APP.Q(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(){Jp(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)&&Gp(this);return null};Kp(a.prototype);return a},Np=function(){$APP.n(customElements.get("x-table-row"))||customElements.define("x-table-row",
|
|
11
|
+
Mp());return null},Ap=new $APP.M(null,"interactive?","interactive?",367617676),Ep=new $APP.M(null,"row-index","row-index",-828710296),Dp=new $APP.M(null,"row-index-raw","row-index-raw",1490649093);var Lp=["selected","disabled","interactive","row-index"];$APP.wd(["x-table-row-click",new $APP.Q(null,2,[$APP.Y,new $APP.Q(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.Q(null,2,[$APP.Y,new $APP.Q(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.Q(null,2,[$APP.Y,$APP.xd,$APP.ui,!1],null)]);$APP.ka("baredom.exports.x_table_row.init",Np);export const init=Np;
|