@vanelsas/baredom 2.6.0 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +12 -41
  3. package/dist/base.js +355 -349
  4. package/dist/integrity.json +93 -93
  5. package/dist/x-alert.js +18 -19
  6. package/dist/x-avatar-group.js +10 -11
  7. package/dist/x-avatar.js +14 -14
  8. package/dist/x-badge.js +10 -11
  9. package/dist/x-bento-grid.js +5 -5
  10. package/dist/x-bento-item.js +4 -4
  11. package/dist/x-breadcrumbs.js +14 -14
  12. package/dist/x-button.js +18 -16
  13. package/dist/x-cancel-dialogue.js +17 -17
  14. package/dist/x-card.js +7 -7
  15. package/dist/x-carousel.js +34 -34
  16. package/dist/x-chart.js +46 -48
  17. package/dist/x-checkbox.js +10 -11
  18. package/dist/x-chip.js +9 -9
  19. package/dist/x-collapse.js +10 -12
  20. package/dist/x-color-picker.js +44 -45
  21. package/dist/x-combobox.js +26 -27
  22. package/dist/x-command-palette.js +26 -27
  23. package/dist/x-container.js +5 -6
  24. package/dist/x-context-menu.js +18 -18
  25. package/dist/x-copy.js +22 -22
  26. package/dist/x-currency-field.js +22 -24
  27. package/dist/x-date-picker.js +41 -42
  28. package/dist/x-divider.js +8 -9
  29. package/dist/x-drawer.js +11 -12
  30. package/dist/x-dropdown.js +10 -11
  31. package/dist/x-fieldset.js +6 -6
  32. package/dist/x-file-download.js +7 -8
  33. package/dist/x-file-upload.js +22 -25
  34. package/dist/x-form-field.js +15 -17
  35. package/dist/x-form.js +8 -10
  36. package/dist/x-gaussian-blur.js +18 -18
  37. package/dist/x-grid.js +6 -6
  38. package/dist/x-icon.js +7 -7
  39. package/dist/x-image.js +19 -19
  40. package/dist/x-kinetic-font.js +28 -29
  41. package/dist/x-kinetic-typography.js +39 -39
  42. package/dist/x-liquid-dock.js +39 -39
  43. package/dist/x-liquid-fill.js +44 -44
  44. package/dist/x-liquid-glass.js +47 -47
  45. package/dist/x-menu-item.js +9 -10
  46. package/dist/x-menu.js +11 -11
  47. package/dist/x-metaball-cursor.js +27 -27
  48. package/dist/x-modal.js +12 -13
  49. package/dist/x-morph-stack.js +38 -39
  50. package/dist/x-navbar.js +12 -13
  51. package/dist/x-neural-glow.js +32 -33
  52. package/dist/x-notification-center.js +9 -10
  53. package/dist/x-organic-divider.js +18 -19
  54. package/dist/x-organic-progress.js +37 -38
  55. package/dist/x-organic-shape.js +13 -14
  56. package/dist/x-pagination.js +16 -17
  57. package/dist/x-particle-button.js +48 -49
  58. package/dist/x-popover.js +24 -25
  59. package/dist/x-progress-circle.js +8 -9
  60. package/dist/x-progress.js +11 -11
  61. package/dist/x-radio.js +10 -12
  62. package/dist/x-ripple-effect.js +11 -11
  63. package/dist/x-scroll-parallax.js +19 -19
  64. package/dist/x-scroll-stack.js +18 -18
  65. package/dist/x-scroll-story.js +35 -35
  66. package/dist/x-scroll-timeline.js +46 -47
  67. package/dist/x-scroll.js +40 -41
  68. package/dist/x-search-field.js +15 -17
  69. package/dist/x-select.js +10 -11
  70. package/dist/x-sidebar.js +16 -16
  71. package/dist/x-skeleton-group.js +12 -14
  72. package/dist/x-skeleton.js +1 -1
  73. package/dist/x-slider.js +16 -18
  74. package/dist/x-soft-body.js +21 -21
  75. package/dist/x-spacer.js +5 -5
  76. package/dist/x-spinner.js +5 -6
  77. package/dist/x-splash.js +13 -13
  78. package/dist/x-stat.js +11 -11
  79. package/dist/x-stepper.js +15 -15
  80. package/dist/x-switch.js +9 -11
  81. package/dist/x-tab.js +7 -7
  82. package/dist/x-table-cell.js +22 -22
  83. package/dist/x-table-row.js +9 -10
  84. package/dist/x-table.js +14 -15
  85. package/dist/x-tabs.js +11 -11
  86. package/dist/x-text-area.js +19 -21
  87. package/dist/x-theme.d.ts +1 -1
  88. package/dist/x-theme.js +25 -25
  89. package/dist/x-timeline-item.js +23 -23
  90. package/dist/x-timeline.js +9 -9
  91. package/dist/x-toast.js +24 -24
  92. package/dist/x-toaster.js +8 -8
  93. package/dist/x-tooltip.js +11 -13
  94. package/dist/x-typography.js +11 -11
  95. package/dist/x-welcome-tour.js +64 -65
  96. package/package.json +181 -181
package/dist/x-stepper.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import { $APP, shadow$provide } from "./base.js";
2
- var mp=function(a,b){return new $APP.rd(null,function(){if(a>0){var c=$APP.t(b);return c?$APP.od($APP.u(c),mp(a-1,$APP.Yb(c))):null}return null},null)},op=function(a){a=$APP.D(np,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:$APP.Il},qp=function(a){a=$APP.D(pp,a);return $APP.n(a)?a:"horizontal"},tp=function(a){a=$APP.D(rp,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:sp},vp=function(a){a=$APP.D(up,a);return $APP.n(a)?a:"md"},wp=function(a){return typeof a==="string"?
3
- (a=parseInt(a.trim(),10),typeof a==="number"&&$APP.r(isNaN(a))&&a>=0?a:0):0},xp=function(a){if(typeof a==="string"){var b=a.trim();if($APP.n($APP.eg(/^\d+$/,b)))return a=parseInt(b,10),a>0&&a<=200?$APP.ge(function(g){return new $APP.Q(null,2,[$APP.U,"Step "+$APP.T.g(g),$APP.yk,null],null)},$APP.dg(1,a+1)):$APP.fe;if($APP.n(function(){var g=$APP.N("",b);return g?b.startsWith("["):g}()))try{var c=JSON.parse(b);if($APP.n(Array.isArray(c))){var d=$APP.uc(c),e=$APP.z(d)>200?mp(200,d):d;return $APP.ge(function(g){return new $APP.Q(null,
4
- 2,[$APP.U,function(){var h=$APP.k(g,"label");return typeof h==="string"?h:""}(),$APP.yk,function(){var h=$APP.k(g,"description");return typeof h==="string"?h:null}()],null)},e)}return $APP.fe}catch(g){return $APP.fe}else return $APP.fe}else return $APP.fe},yp=function(a){var b=$APP.k(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:var(--x-font-size-sm,0.875rem);--x-stepper-label-font-weight:500;--x-stepper-desc-font-size:0.75rem;--x-stepper-radius:var(--x-radius-full,999px);--x-stepper-motion:var(--x-transition-duration,120ms);--x-stepper-press-scale:0.93;--x-stepper-focus-ring:var(--x-color-focus-ring,rgba(0,0,0,0.55));--x-stepper-disabled-opacity:0.5;--x-stepper-complete-bg:var(--x-color-success,rgba(16,140,72,1));--x-stepper-complete-color:#fff;--x-stepper-complete-connector:var(--x-color-success,rgba(16,140,72,1));--x-stepper-current-bg:var(--x-color-primary,rgba(0,102,204,1));--x-stepper-current-color:#fff;--x-stepper-upcoming-bg:rgba(0,0,0,0.08);--x-stepper-upcoming-color:var(--x-color-text-muted,rgba(0,0,0,0.45));--x-stepper-idle-connector:var(--x-color-border,rgba(0,0,0,0.12));--x-stepper-label-done-color:var(--x-color-text,rgba(0,0,0,0.85));--x-stepper-label-current-color:var(--x-color-text,rgba(0,0,0,0.85));--x-stepper-label-upcoming-color:var(--x-color-text-muted,rgba(0,0,0,0.4));--x-stepper-desc-color:var(--x-color-text-muted,rgba(0,0,0,0.4));}@media (prefers-color-scheme:dark){:host{--x-stepper-focus-ring:var(--x-color-focus-ring,rgba(255,255,255,0.7));--x-stepper-complete-bg:var(--x-color-success,rgba(60,210,120,1));--x-stepper-complete-color:#000;--x-stepper-complete-connector:var(--x-color-success,rgba(60,210,120,1));--x-stepper-current-bg:var(--x-color-primary,rgba(80,160,255,1));--x-stepper-current-color:#000;--x-stepper-upcoming-bg:rgba(255,255,255,0.1);--x-stepper-upcoming-color:var(--x-color-text-muted,rgba(255,255,255,0.35));--x-stepper-idle-connector:var(--x-color-border,rgba(255,255,255,0.12));--x-stepper-label-done-color:var(--x-color-text,rgba(255,255,255,0.9));--x-stepper-label-current-color:var(--x-color-text,rgba(255,255,255,0.9));--x-stepper-label-upcoming-color:var(--x-color-text-muted,rgba(255,255,255,0.3));--x-stepper-desc-color:var(--x-color-text-muted,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.Q(null,2,[$APP.Hi,b,$APP.Hj,d],null);return $APP.k(a,"__xStepperRefs")},Ap=function(a){a=new $APP.Q(null,5,[zp,a.getAttribute("steps"),$APP.Xm,a.getAttribute("current"),$APP.Yl,a.getAttribute("orientation"),$APP.Wl,a.getAttribute("size"),$APP.X,a.hasAttribute("disabled")],null);var b=$APP.M(a),c=$APP.D(b,zp);a=$APP.D(b,$APP.Xm);var d=$APP.D(b,$APP.Yl),e=$APP.D(b,$APP.Wl);b=
6
- $APP.D(b,$APP.X);c=xp(c);var g=$APP.z(c);return new $APP.Q(null,5,[$APP.Fm,c,$APP.$h,g===0?0:$APP.oh.i(0,$APP.ph.i(wp(a),g-1)),$APP.rl,op(d),$APP.Mh,tp(e),$APP.X,$APP.F(b)],null)},Bp=function(a,b,c){return"Step "+$APP.T.g(a+1)+": "+$APP.T.g(b)+" ("+$APP.T.g(function(){var d=c instanceof $APP.K?c.pa: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));}}())+")"},Cp=function(a,b,c,d){var e=
7
- $APP.M(b);b=$APP.D(e,$APP.U);e=$APP.D(e,$APP.yk);var g=document.createElement("div"),h=document.createElement("div"),l=document.createElement("button"),m=document.createElement("span"),p=document.createElement("div"),q=document.createElement("div"),v=document.createElement("span"),x=document.createElement("span");a:{var y=c instanceof $APP.K?c.pa:null;switch(y){case "complete":y="complete";break a;case "current":y="current";break a;case "upcoming":y="upcoming";break a;default:throw Error("No matching clause: "+
8
- $APP.T.g(y));}}b=$APP.n(b)?b:"";g.setAttribute("part","step");g.setAttribute("role","listitem");g.setAttribute("data-index",""+$APP.T.g(a));g.setAttribute("data-state",y);h.setAttribute("part","step-track");l.setAttribute("part","step-indicator");l.setAttribute("type","button");l.setAttribute("aria-label",Bp(a,b,c));$APP.B.i(c,$APP.$h)?l.setAttribute("aria-current","step"):l.removeAttribute("aria-current");l.setAttribute("tabindex",$APP.n(d)?"-1":"0");$APP.n(d)&&l.setAttribute("aria-disabled","true");
9
- m.setAttribute("part","step-number");m.setAttribute("aria-hidden","true");m.textContent=$APP.B.i(c,$APP.Pm)?"✓":""+$APP.T.g(a+1);p.setAttribute("part","step-connector");p.setAttribute("aria-hidden","true");q.setAttribute("part","step-content");v.setAttribute("part","step-label");v.textContent=b;x.setAttribute("part","step-description");$APP.n($APP.n(e)?$APP.N(e,""):e)?(x.textContent=e,x.style.display="block"):x.style.display="none";l.appendChild(m);h.appendChild(l);h.appendChild(p);q.appendChild(v);
10
- q.appendChild(x);g.appendChild(h);g.appendChild(q);return g},Ep=function(a){var b=Ap(a);if($APP.N($APP.k(a,"__xStepperModel"),b)){b=$APP.M(b);var c=$APP.D(b,$APP.Fm),d=$APP.D(b,$APP.$h),e=$APP.D(b,$APP.rl),g=$APP.D(b,$APP.Mh),h=$APP.D(b,$APP.X),l=yp(a);l=$APP.M(l);l=$APP.D(l,$APP.Hj);a.setAttribute("data-orientation",qp(e));a.setAttribute("data-size",vp(g));l.innerHTML="";c=$APP.t($APP.Wd($APP.xh,c));e=null;for(var m=g=0;;)if(m<g){var p=e.F(null,m),q=$APP.Ac(p,0,null);p=$APP.Ac(p,1,null);var v=q<
11
- d?$APP.Pm:$APP.B.i(q,d)?$APP.$h:Dp;l.appendChild(Cp(q,p,v,h));m+=1}else if(c=$APP.t(c))$APP.Nc(c)?(g=$APP.yb(c),c=$APP.zb(c),e=g,g=$APP.z(g)):(g=$APP.u(c),e=$APP.Ac(g,0,null),g=$APP.Ac(g,1,null),m=e<d?$APP.Pm:$APP.B.i(e,d)?$APP.$h:Dp,l.appendChild(Cp(e,g,m,h)),c=$APP.w(c),e=null,g=0),m=0;else break;a.__xStepperModel=b}},Fp=function(a){function b(d){var e=$APP.k(a,"__xStepperModel");e=$APP.n(e)?e:Ap(a);$APP.n($APP.X.g(e))||(d=d.target.closest("[part\x3dstep-indicator]"),$APP.n(d)&&(d=parseInt(d.closest("[part\x3dstep]").getAttribute("data-index"),
12
- 10),e=$APP.$h.g(e),typeof d==="number"&&$APP.r(isNaN(d))&&$APP.N(d,e)&&(e=$APP.Hh(new $APP.Q(null,2,[$APP.Vh,e,$APP.dm,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=yp(a);c=$APP.M(c);$APP.D(c,$APP.Hj).addEventListener("click",b);$APP.ja(a,"__xStepperHandlers",{click:b})},Gp=function(a){var b=$APP.k(a,"__xStepperHandlers");if($APP.n(b)){var c=$APP.k(a,"__xStepperRefs");
13
- $APP.n(c)&&(c=$APP.Hj.g(c),b=$APP.k(b,"click"),$APP.n($APP.n(c)?b:c)&&c.removeEventListener("click",b))}a.__xStepperHandlers=null},Hp=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 wp(this.getAttribute("current"))},set:function(b){return b==
14
- null?this.removeAttribute("current"):this.setAttribute("current",""+$APP.T.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"orientation",{get:function(){return qp(op(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 vp(tp(this.getAttribute("size")))},set:function(b){return $APP.n(b)?this.setAttribute("size",
15
- ""+$APP.T.g(b)):this.removeAttribute("size")},enumerable:!0,configurable:!0});Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.n(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,configurable:!0})},Jp=function(){var a=class extends HTMLElement{};a.observedAttributes=Ip;a.prototype.connectedCallback=function(){yp(this);Gp(this);Fp(this);Ep(this);return null};a.prototype.disconnectedCallback=function(){Gp(this);
16
- return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&Ep(this);return null};Hp(a.prototype);return a},Kp=function(){$APP.n(customElements.get("x-stepper"))||customElements.define("x-stepper",Jp());return null},Dp=new $APP.K(null,"upcoming","upcoming",1873315471),zp=new $APP.K(null,"steps-raw","steps-raw",1741812533),sp=new $APP.K(null,"md","md",707286655),Lp=new $APP.K(null,"lg","lg",-80787836),Mp=new $APP.K(null,"sm","sm",-1402575065);var Ip=["steps","current","orientation","size","disabled"];$APP.Pd(["x-stepper-change",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,2,[$APP.Vh,$APP.W,$APP.dm,$APP.W],null),$APP.lm,!0],null)]);var np=new $APP.Q(null,2,["horizontal",$APP.Il,"vertical",$APP.zj],null),pp=new $APP.Q(null,2,[$APP.Il,"horizontal",$APP.zj,"vertical"],null),rp=new $APP.Q(null,3,["sm",Mp,"md",sp,"lg",Lp],null),up=new $APP.Q(null,3,[Mp,"sm",sp,"md",Lp,"lg"],null);$APP.ha("baredom.exports.x_stepper.init",Kp);export const init=Kp;
2
+ var Ip=function(a,b){return new $APP.rd(null,function(){if(a>0){var c=$APP.t(b);return c?$APP.od($APP.u(c),Ip(a-1,$APP.Xb(c))):null}return null},null)},Kp=function(a){a=$APP.D(Jp,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:$APP.$l},Mp=function(a){a=$APP.D(Lp,a);return $APP.n(a)?a:"horizontal"},Pp=function(a){a=$APP.D(Np,typeof a==="string"?a.toLowerCase():null);return $APP.n(a)?a:Op},Rp=function(a){a=$APP.D(Qp,a);return $APP.n(a)?a:"md"},Sp=function(a){return typeof a==="string"?
3
+ (a=parseInt(a.trim(),10),typeof a==="number"&&$APP.q(isNaN(a))&&a>=0?a:0):0},Tp=function(a){if(typeof a==="string"){var b=a.trim();if($APP.n($APP.eg(/^\d+$/,b)))return a=parseInt(b,10),a>0&&a<=200?$APP.fe(function(g){return new $APP.Q(null,2,[$APP.T,"Step "+$APP.S.g(g),$APP.Qk,null],null)},$APP.dg(1,a+1)):$APP.ee;if($APP.n(function(){var g=$APP.N("",b);return g?b.startsWith("["):g}()))try{var c=JSON.parse(b);if($APP.n(Array.isArray(c))){var d=$APP.uc(c),e=$APP.z(d)>200?Ip(200,d):d;return $APP.fe(function(g){return new $APP.Q(null,
4
+ 2,[$APP.T,function(){var h=$APP.k(g,"label");return typeof h==="string"?h:""}(),$APP.Qk,function(){var h=$APP.k(g,"description");return typeof h==="string"?h:null}()],null)},e)}return $APP.ee}catch(g){return $APP.ee}else return $APP.ee}else return $APP.ee},Up=function(a){var b=$APP.k(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:var(--x-font-size-sm,0.875rem);--x-stepper-label-font-weight:500;--x-stepper-desc-font-size:0.75rem;--x-stepper-radius:var(--x-radius-full,999px);--x-stepper-motion:var(--x-transition-duration,120ms);--x-stepper-press-scale:0.93;--x-stepper-focus-ring:var(--x-color-focus-ring,rgba(0,0,0,0.55));--x-stepper-disabled-opacity:0.5;--x-stepper-complete-bg:var(--x-color-success,rgba(16,140,72,1));--x-stepper-complete-color:#fff;--x-stepper-complete-connector:var(--x-color-success,rgba(16,140,72,1));--x-stepper-current-bg:var(--x-color-primary,rgba(0,102,204,1));--x-stepper-current-color:#fff;--x-stepper-upcoming-bg:rgba(0,0,0,0.08);--x-stepper-upcoming-color:var(--x-color-text-muted,rgba(0,0,0,0.45));--x-stepper-idle-connector:var(--x-color-border,rgba(0,0,0,0.12));--x-stepper-label-done-color:var(--x-color-text,rgba(0,0,0,0.85));--x-stepper-label-current-color:var(--x-color-text,rgba(0,0,0,0.85));--x-stepper-label-upcoming-color:var(--x-color-text-muted,rgba(0,0,0,0.4));--x-stepper-desc-color:var(--x-color-text-muted,rgba(0,0,0,0.4));}@media (prefers-color-scheme:dark){:host{--x-stepper-focus-ring:var(--x-color-focus-ring,rgba(255,255,255,0.7));--x-stepper-complete-bg:var(--x-color-success,rgba(60,210,120,1));--x-stepper-complete-color:#000;--x-stepper-complete-connector:var(--x-color-success,rgba(60,210,120,1));--x-stepper-current-bg:var(--x-color-primary,rgba(80,160,255,1));--x-stepper-current-color:#000;--x-stepper-upcoming-bg:rgba(255,255,255,0.1);--x-stepper-upcoming-color:var(--x-color-text-muted,rgba(255,255,255,0.35));--x-stepper-idle-connector:var(--x-color-border,rgba(255,255,255,0.12));--x-stepper-label-done-color:var(--x-color-text,rgba(255,255,255,0.9));--x-stepper-label-current-color:var(--x-color-text,rgba(255,255,255,0.9));--x-stepper-label-upcoming-color:var(--x-color-text-muted,rgba(255,255,255,0.3));--x-stepper-desc-color:var(--x-color-text-muted,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.Q(null,2,[$APP.Zi,b,$APP.Zj,d],null);return $APP.k(a,"__xStepperRefs")},Wp=function(a){a=new $APP.Q(null,5,[Vp,a.getAttribute("steps"),$APP.pn,a.getAttribute("current"),$APP.pm,a.getAttribute("orientation"),$APP.nm,a.getAttribute("size"),$APP.X,a.hasAttribute("disabled")],null);var b=$APP.M(a),c=$APP.D(b,Vp);a=$APP.D(b,$APP.pn);var d=$APP.D(b,$APP.pm),e=$APP.D(b,$APP.nm);b=
6
+ $APP.D(b,$APP.X);c=Tp(c);var g=$APP.z(c);return new $APP.Q(null,5,[$APP.Xm,c,$APP.vi,g===0?0:$APP.Jh.i(0,$APP.Kh.i(Sp(a),g-1)),$APP.Jl,Kp(d),$APP.di,Pp(e),$APP.X,$APP.F(b)],null)},Xp=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.pa: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));}}())+")"},Yp=function(a,b,c,d){var e=
7
+ $APP.M(b);b=$APP.D(e,$APP.T);e=$APP.D(e,$APP.Qk);var g=document.createElement("div"),h=document.createElement("div"),l=document.createElement("button"),m=document.createElement("span"),p=document.createElement("div"),r=document.createElement("div"),v=document.createElement("span"),x=document.createElement("span");a:{var y=c instanceof $APP.K?c.pa:null;switch(y){case "complete":y="complete";break a;case "current":y="current";break a;case "upcoming":y="upcoming";break a;default:throw Error("No matching clause: "+
8
+ $APP.S.g(y));}}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",y);h.setAttribute("part","step-track");l.setAttribute("part","step-indicator");l.setAttribute("type","button");l.setAttribute("aria-label",Xp(a,b,c));$APP.B.i(c,$APP.vi)?l.setAttribute("aria-current","step"):l.removeAttribute("aria-current");l.setAttribute("tabindex",$APP.n(d)?"-1":"0");$APP.n(d)&&l.setAttribute("aria-disabled","true");
9
+ m.setAttribute("part","step-number");m.setAttribute("aria-hidden","true");m.textContent=$APP.B.i(c,$APP.gn)?"✓":""+$APP.S.g(a+1);p.setAttribute("part","step-connector");p.setAttribute("aria-hidden","true");r.setAttribute("part","step-content");v.setAttribute("part","step-label");v.textContent=b;x.setAttribute("part","step-description");$APP.n($APP.n(e)?$APP.N(e,""):e)?(x.textContent=e,x.style.display="block"):x.style.display="none";l.appendChild(m);h.appendChild(l);h.appendChild(p);r.appendChild(v);
10
+ r.appendChild(x);g.appendChild(h);g.appendChild(r);return g},$p=function(a){var b=Wp(a);if($APP.N($APP.k(a,"__xStepperModel"),b)){b=$APP.M(b);var c=$APP.D(b,$APP.Xm),d=$APP.D(b,$APP.vi),e=$APP.D(b,$APP.Jl),g=$APP.D(b,$APP.di),h=$APP.D(b,$APP.X),l=Up(a);l=$APP.M(l);l=$APP.D(l,$APP.Zj);a.setAttribute("data-orientation",Mp(e));a.setAttribute("data-size",Rp(g));l.innerHTML="";c=$APP.t($APP.Wd($APP.Ph,c));e=null;for(var m=g=0;;)if(m<g){var p=e.F(null,m),r=$APP.Ac(p,0,null);p=$APP.Ac(p,1,null);var v=r<
11
+ d?$APP.gn:$APP.B.i(r,d)?$APP.vi:Zp;l.appendChild(Yp(r,p,v,h));m+=1}else if(c=$APP.t(c))$APP.Nc(c)?(g=$APP.xb(c),c=$APP.yb(c),e=g,g=$APP.z(g)):(g=$APP.u(c),e=$APP.Ac(g,0,null),g=$APP.Ac(g,1,null),m=e<d?$APP.gn:$APP.B.i(e,d)?$APP.vi:Zp,l.appendChild(Yp(e,g,m,h)),c=$APP.w(c),e=null,g=0),m=0;else break;a.__xStepperModel=b}},aq=function(a){function b(d){var e=$APP.k(a,"__xStepperModel");e=$APP.n(e)?e:Wp(a);$APP.n($APP.X.g(e))||(d=d.target.closest("[part\x3dstep-indicator]"),$APP.n(d)&&(d=parseInt(d.closest("[part\x3dstep]").getAttribute("data-index"),
12
+ 10),e=$APP.vi.g(e),typeof d==="number"&&$APP.q(isNaN(d))&&$APP.N(d,e)&&(e=$APP.Zh(new $APP.Q(null,2,[$APP.qi,e,$APP.Cm,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=Up(a);c=$APP.M(c);$APP.D(c,$APP.Zj).addEventListener("click",b);$APP.ja(a,"__xStepperHandlers",{click:b})},bq=function(a){var b=$APP.k(a,"__xStepperHandlers");if($APP.n(b)){var c=$APP.k(a,"__xStepperRefs");
13
+ $APP.n(c)&&(c=$APP.Zj.g(c),b=$APP.k(b,"click"),$APP.n($APP.n(c)?b:c)&&c.removeEventListener("click",b))}a.__xStepperHandlers=null},cq=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 Sp(this.getAttribute("current"))},set:function(b){return b==
14
+ null?this.removeAttribute("current"):this.setAttribute("current",""+$APP.S.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"orientation",{get:function(){return Mp(Kp(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 Rp(Pp(this.getAttribute("size")))},set:function(b){return $APP.n(b)?this.setAttribute("size",
15
+ ""+$APP.S.g(b)):this.removeAttribute("size")},enumerable:!0,configurable:!0});return 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})},dq=function(a){Up(a);bq(a);aq(a);$p(a);return null},eq=function(a){bq(a);return null},fq=function(a,b,c,d){$APP.N(c,d)&&$p(a);return null},hq=function(){return $APP.Lg("x-stepper",new $APP.Q(null,
16
+ 5,[$APP.Cg,gq,$APP.Dg,dq,$APP.Eg,eq,$APP.Fg,fq,$APP.Jg,cq],null))},Zp=new $APP.K(null,"upcoming","upcoming",1873315471),Vp=new $APP.K(null,"steps-raw","steps-raw",1741812533),Op=new $APP.K(null,"md","md",707286655),iq=new $APP.K(null,"lg","lg",-80787836),jq=new $APP.K(null,"sm","sm",-1402575065);var gq=["steps","current","orientation","size","disabled"];$APP.Pd(["x-stepper-change",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,2,[$APP.qi,$APP.W,$APP.Cm,$APP.W],null),$APP.Km,!0],null)]);var Jp=new $APP.Q(null,2,["horizontal",$APP.$l,"vertical",$APP.Rj],null),Lp=new $APP.Q(null,2,[$APP.$l,"horizontal",$APP.Rj,"vertical"],null),Np=new $APP.Q(null,3,["sm",jq,"md",Op,"lg",iq],null),Qp=new $APP.Q(null,3,[jq,"sm",Op,"md",iq,"lg"],null);$APP.ha("baredom.exports.x_stepper.init",hq);export const init=hq;
package/dist/x-switch.js CHANGED
@@ -1,12 +1,10 @@
1
1
  import { $APP, shadow$provide } from "./base.js";
2
- var bV=function(a,b,c){return a.setAttribute(b,c)},cV=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},dV=function(a){a=$APP.zf([$APP.Al,$APP.Ol,$APP.Nh,$APP.Zh,$APP.sj,$APP.Lj,$APP.Em,$APP.Uj,$APP.Cj],[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.D(b,$APP.Uj);var c=$APP.D(b,$APP.Cj),d=$APP.D(b,$APP.Al),e=$APP.D(b,$APP.Ol),g=$APP.D(b,$APP.Nh),h=$APP.D(b,$APP.Zh),l=$APP.D(b,$APP.sj),m=$APP.D(b,$APP.Lj);b=$APP.D(b,$APP.Em);l=$APP.F(l);g=$APP.F(g);return $APP.zf([$APP.mi,$APP.ci,$APP.dn,$APP.Ej,$APP.Th,$APP.Aj,$APP.Yi,$APP.bk,$APP.$m,$APP.Ql,$APP.X],[g,l?"true":"false",$APP.F(m),l,$APP.n(g)?l:!0,d,b!=null?b:"on",h,c,a,$APP.F(e)])},eV=function(a){var b=$APP.k(a,"__xSwitchRefs");if($APP.n(b)){var c=$APP.k(b,"control");b=dV(a);var d=$APP.X.g(b),
4
- e=$APP.Ej.g(b);bV(c,"aria-checked",$APP.ci.g(b));c.setAttribute("aria-disabled",$APP.n(d)?"true":"false");bV(c,"aria-required",$APP.n($APP.mi.g(b))?"true":"false");bV(c,"aria-readonly",$APP.n($APP.dn.g(b))?"true":"false");var g=$APP.Ql.g(b);$APP.n(g)?c.setAttribute("aria-label",g):c.removeAttribute("aria-label");g=$APP.bk.g(b);$APP.n(g)?c.setAttribute("aria-labelledby",g):c.removeAttribute("aria-labelledby");g=$APP.$m.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");cV(a,"data-checked",e);cV(a,"data-disabled",d);a=$APP.k(a,"__xSwitchInternals");return $APP.n(a)?a.setFormValue($APP.n(e)?$APP.Yi.g(b):null):null}return null},fV=function(a){var b=dV(a),c=$APP.X.g(b),d=$APP.dn.g(b);if($APP.n($APP.n(c)?c:d))return null;d=$APP.Ej.g(b);c=$APP.r(d);b=$APP.Yi.g(b);d=new CustomEvent("x-switch-change-request",{detail:{value:b,previousChecked:d,nextChecked:c},bubbles:!0,composed:!0,
6
- cancelable:!0});a.dispatchEvent(d);return $APP.r(d.defaultPrevented)?(cV(a,"checked",c),eV(a),a.dispatchEvent(new CustomEvent("x-switch-change",{detail:{value:b,checked:c},bubbles:!0,composed:!0,cancelable:!1}))):null},gV=function(a){return function(){return fV(a)}},hV=function(a){return function(b){var c=b.key;return $APP.B.i(c," ")||$APP.B.i(c,"Enter")?(b.preventDefault(),fV(a)):null}},iV=function(a){var b=$APP.k(a,"__xSwitchRefs");if($APP.n(b)){var c=$APP.k(a,"__xSwitchHandlers");if($APP.n(c)){b=
7
- $APP.k(b,"control");b.removeEventListener("click",$APP.k(c,"click"));b.removeEventListener("keydown",$APP.k(c,"keydown"));a.__xSwitchHandlers=null;return}}return null},jV=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return cV(this,c,$APP.F(d))}})},kV=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)?bV(this,c,""+$APP.T.g(d)):this.removeAttribute(c)}})},mV=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return lV}});jV(b,"checked","checked");jV(b,"disabled","disabled");jV(b,"readOnly","readonly");jV(b,"required","required");kV(b,"name","name");kV(b,"value","value");b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xSwitchRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),
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:var(--x-radius-full,999px);--x-switch-track-bg:var(--x-color-border,#d1d5db);--x-switch-track-bg-checked:var(--x-color-primary,#2563eb);--x-switch-thumb-bg:var(--x-color-bg,#ffffff);--x-switch-focus-ring:var(--x-color-focus-ring,#60a5fa);--x-switch-disabled-opacity:0.45;--x-switch-transition:background var(--x-transition-duration,150ms) var(--x-transition-easing,ease),transform var(--x-transition-duration,150ms) var(--x-transition-easing,ease);}@media (prefers-color-scheme:dark){:host{--x-switch-track-bg:var(--x-color-border,#4b5563);--x-switch-track-bg-checked:var(--x-color-primary,#3b82f6);--x-switch-thumb-bg:var(--x-color-bg,#f9fafb);--x-switch-focus-ring:var(--x-color-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())}iV(this);c=$APP.k(this,"__xSwitchRefs");$APP.n(c)&&(c=$APP.k(c,"control"),d=gV(this),e=hV(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.k(this,"__xSwitchRefs"),$APP.n(d)&&$APP.k(d,"control").setAttribute("aria-labelledby",c)));return eV(this)};b.disconnectedCallback=function(){return iV(this)};b.attributeChangedCallback=function(){return eV(this)};b.formDisabledCallback=
12
- function(c){cV(this,"disabled",$APP.F(c));return eV(this)};b.formResetCallback=function(){this.removeAttribute("checked");return eV(this)};return a},nV=function(){return $APP.n(customElements.get("x-switch"))?null:customElements.define("x-switch",mV())};var lV="checked disabled readonly required name value aria-label aria-describedby aria-labelledby".split(" ");$APP.Pd(["x-switch-change-request",new $APP.Q(null,2,[$APP.lm,!0,$APP.V,new $APP.Q(null,3,[$APP.Yi,$APP.Y,$APP.vk,$APP.Zj,$APP.Vl,$APP.Zj],null)],null),"x-switch-change",new $APP.Q(null,2,[$APP.lm,!1,$APP.V,new $APP.Q(null,2,[$APP.Yi,$APP.Y,$APP.Sm,$APP.Zj],null)],null)]);$APP.ha("baredom.exports.x_switch.init",nV);export const init=nV;
2
+ var OW=function(a){a=$APP.zf([$APP.Sl,$APP.fm,$APP.ei,$APP.ui,$APP.Kj,$APP.dk,$APP.Wm,$APP.pk,$APP.Uj],[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=$APP.D(b,$APP.pk);var c=$APP.D(b,$APP.Uj),d=$APP.D(b,$APP.Sl),e=$APP.D(b,$APP.fm),g=$APP.D(b,$APP.ei),h=$APP.D(b,$APP.ui),l=$APP.D(b,
3
+ $APP.Kj),m=$APP.D(b,$APP.dk);b=$APP.D(b,$APP.Wm);l=$APP.F(l);g=$APP.F(g);return $APP.zf([$APP.Ei,$APP.yi,$APP.wn,$APP.Wj,$APP.oi,$APP.Sj,$APP.pj,$APP.wk,$APP.sn,$APP.hm,$APP.X],[g,l?"true":"false",$APP.F(m),l,$APP.n(g)?l:!0,d,b!=null?b:"on",h,c,a,$APP.F(e)])},PW=function(a){var b=$APP.k(a,"__xSwitchRefs");if($APP.n(b)){var c=$APP.k(b,"control");b=OW(a);var d=$APP.X.g(b),e=$APP.Wj.g(b);$APP.Og(c,"aria-checked",$APP.yi.g(b));c.setAttribute("aria-disabled",$APP.n(d)?"true":"false");$APP.Og(c,"aria-required",
4
+ $APP.n($APP.Ei.g(b))?"true":"false");$APP.Og(c,"aria-readonly",$APP.n($APP.wn.g(b))?"true":"false");var g=$APP.hm.g(b);$APP.n(g)?c.setAttribute("aria-label",g):c.removeAttribute("aria-label");g=$APP.wk.g(b);$APP.n(g)?c.setAttribute("aria-labelledby",g):c.removeAttribute("aria-labelledby");g=$APP.sn.g(b);$APP.n(g)?c.setAttribute("aria-describedby",g):c.removeAttribute("aria-describedby");c.tabIndex=$APP.n(d)?-1:0;$APP.n(d)?c.setAttribute("disabled",""):c.removeAttribute("disabled");$APP.Pg(a,"data-checked",
5
+ e);$APP.Pg(a,"data-disabled",d);a=$APP.k(a,"__xSwitchInternals");return $APP.n(a)?a.setFormValue($APP.n(e)?$APP.pj.g(b):null):null}return null},QW=function(a){var b=OW(a),c=$APP.X.g(b),d=$APP.wn.g(b);if($APP.n($APP.n(c)?c:d))return null;c=$APP.Wj.g(b);d=$APP.q(c);b=$APP.pj.g(b);return $APP.Rg(a,"x-switch-change-request",{value:b,previousChecked:c,nextChecked:d})?($APP.Pg(a,"checked",d),PW(a),$APP.Qg(a,"x-switch-change",{value:b,checked:d})):null},RW=function(a){return function(){return QW(a)}},SW=
6
+ function(a){return function(b){var c=b.key;return $APP.B.i(c," ")||$APP.B.i(c,"Enter")?(b.preventDefault(),QW(a)):null}},TW=function(a){var b=$APP.k(a,"__xSwitchRefs");if($APP.n(b)){var c=$APP.k(a,"__xSwitchHandlers");if($APP.n(c)){b=$APP.k(b,"control");b.removeEventListener("click",$APP.k(c,"click"));b.removeEventListener("keydown",$APP.k(c,"keydown"));a.__xSwitchHandlers=null;return}}return null},UW=function(a,b){$APP.Pg(a,"disabled",$APP.F(b));return PW(a)},VW=function(a){a.removeAttribute("checked");
7
+ return PW(a)},WW=function(a){if(!$APP.n($APP.k(a,"__xSwitchRefs"))){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("button"),e=document.createElement("span"),g=document.createElement("span");c.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:var(--x-radius-full,999px);--x-switch-track-bg:var(--x-color-border,#d1d5db);--x-switch-track-bg-checked:var(--x-color-primary,#2563eb);--x-switch-thumb-bg:var(--x-color-bg,#ffffff);--x-switch-focus-ring:var(--x-color-focus-ring,#60a5fa);--x-switch-disabled-opacity:0.45;--x-switch-transition:background var(--x-transition-duration,150ms) var(--x-transition-easing,ease),transform var(--x-transition-duration,150ms) var(--x-transition-easing,ease);}@media (prefers-color-scheme:dark){:host{--x-switch-track-bg:var(--x-color-border,#4b5563);--x-switch-track-bg-checked:var(--x-color-primary,#3b82f6);--x-switch-thumb-bg:var(--x-color-bg,#f9fafb);--x-switch-focus-ring:var(--x-color-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;}}";
8
+ d.setAttribute("part","control");d.setAttribute("type","button");d.setAttribute("role","switch");e.setAttribute("part","track");g.setAttribute("part","thumb");e.appendChild(g);d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xSwitchRefs={root:b,control:d,track:e,thumb:g};$APP.n(a.attachInternals)&&(b=a.attachInternals(),a.__xSwitchInternals=b)}TW(a);b=$APP.k(a,"__xSwitchRefs");$APP.n(b)&&(b=$APP.k(b,"control"),c=RW(a),d=SW(a),e={click:c,keydown:d},b.addEventListener("click",c),b.addEventListener("keydown",
9
+ d),a.__xSwitchHandlers=e);c=a.getAttribute("id");$APP.n(c)&&(b=document.querySelector("label[for\x3d'"+$APP.S.g(c)+"']"),$APP.n(b)&&(d=b.getAttribute("id"),$APP.n(d)?b=d:(c="x-sw-lbl-"+$APP.S.g(c),b.setAttribute("id",c),b=c),c=$APP.k(a,"__xSwitchRefs"),$APP.n(c)&&$APP.k(c,"control").setAttribute("aria-labelledby",b)));return PW(a)},XW=function(a){return TW(a)},YW=function(a){return PW(a)},ZW=function(a){$APP.Sg(a,"checked","checked");$APP.Sg(a,"disabled","disabled");$APP.Sg(a,"readOnly","readonly");
10
+ $APP.Sg(a,"required","required");$APP.Ug(a,"name","name");return $APP.Ug(a,"value","value")},aX=function(){return $APP.Lg("x-switch",new $APP.Q(null,8,[$APP.Cg,$W,$APP.Dg,WW,$APP.Eg,XW,$APP.Fg,YW,$APP.Gg,!0,$APP.Hg,UW,$APP.Ig,VW,$APP.Jg,ZW],null))};var $W="checked disabled readonly required name value aria-label aria-describedby aria-labelledby".split(" ");$APP.Pd(["x-switch-change-request",new $APP.Q(null,2,[$APP.Km,!0,$APP.V,new $APP.Q(null,3,[$APP.pj,$APP.Y,$APP.Nk,$APP.uk,$APP.mm,$APP.uk],null)],null),"x-switch-change",new $APP.Q(null,2,[$APP.Km,!1,$APP.V,new $APP.Q(null,2,[$APP.pj,$APP.Y,$APP.kn,$APP.uk],null)],null)]);$APP.ha("baredom.exports.x_switch.init",aX);export const init=aX;
package/dist/x-tab.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { $APP, shadow$provide } from "./base.js";
2
- var on=function(a,b,c){return $APP.I(b,a)?a:c},tn=function(a){var b=$APP.M(a),c=$APP.D(b,$APP.ok),d=$APP.D(b,$APP.Pj);a=$APP.D(b,$APP.rl);var e=$APP.D(b,$APP.Mh),g=$APP.D(b,$APP.Vg),h=$APP.D(b,$APP.U);b=$APP.D(b,pn);c=$APP.F(c);var l=(d=$APP.F(d))?"-1":c?"0":"-1";return new $APP.Q(null,8,[$APP.ok,c,$APP.Pj,d,$APP.rl,on(a,qn,"horizontal"),$APP.Mh,on(e,rn,"md"),$APP.Vg,on(g,sn,"default"),$APP.U,h,pn,b,$APP.Nk,l],null)},un=function(a){return new $APP.Q(null,8,[$APP.Yi,a.getAttribute("value"),$APP.ok,
3
- a.hasAttribute("selected"),$APP.Pj,a.hasAttribute("disabled"),$APP.rl,a.getAttribute("orientation"),$APP.Mh,a.getAttribute("size"),$APP.Vg,a.getAttribute("variant"),$APP.U,a.getAttribute("label"),pn,a.getAttribute("controls")],null)},vn=function(a){var b=tn(un(a)),c=$APP.k(a,"__x_tab_base");if($APP.n(c)){a.setAttribute("role","tab");a.setAttribute("aria-selected",$APP.n($APP.ok.g(b))?"true":"false");$APP.n($APP.Pj.g(b))?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");a.setAttribute("tabindex",
4
- $APP.Nk.g(b));var d=pn.g(b),e=$APP.U.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.ok.g(b))?"true":"false");c.setAttribute("data-disabled",$APP.n($APP.Pj.g(b))?"true":"false");c.setAttribute("data-size",$APP.Mh.g(b));c.setAttribute("data-variant",$APP.Vg.g(b));return c.setAttribute("data-orientation",
5
- $APP.rl.g(b))}return null},wn=function(a){var b=tn(un(a)),c=$APP.M(b);b=$APP.D(c,$APP.ok);c=$APP.D(c,$APP.Pj);$APP.r(c)&&$APP.r(b)?(b=a.getAttribute("value"),a=a.dispatchEvent(new CustomEvent("tab-select",{detail:{value:$APP.n(b)?b:""},bubbles:!0,composed:!0}))):a=null;return a},xn=function(a){a.addEventListener("click",function(){return wn(a)});a.addEventListener("keydown",function(b){var c=b.key;$APP.B.i(c,"Enter")||$APP.B.i(c," ")?(b.preventDefault(),b=wn(a)):b=null;return b})},yn=function(a){if(!$APP.Dg(a,
2
+ var Gn=function(a,b,c){return $APP.I(b,a)?a:c},Ln=function(a){var b=$APP.M(a),c=$APP.D(b,$APP.Gk),d=$APP.D(b,$APP.kk);a=$APP.D(b,$APP.Jl);var e=$APP.D(b,$APP.di),g=$APP.D(b,$APP.lh),h=$APP.D(b,$APP.T);b=$APP.D(b,Hn);c=$APP.F(c);var l=(d=$APP.F(d))?"-1":c?"0":"-1";return new $APP.Q(null,8,[$APP.Gk,c,$APP.kk,d,$APP.Jl,Gn(a,In,"horizontal"),$APP.di,Gn(e,Jn,"md"),$APP.lh,Gn(g,Kn,"default"),$APP.T,h,Hn,b,$APP.el,l],null)},Mn=function(a){return new $APP.Q(null,8,[$APP.pj,a.getAttribute("value"),$APP.Gk,
3
+ a.hasAttribute("selected"),$APP.kk,a.hasAttribute("disabled"),$APP.Jl,a.getAttribute("orientation"),$APP.di,a.getAttribute("size"),$APP.lh,a.getAttribute("variant"),$APP.T,a.getAttribute("label"),Hn,a.getAttribute("controls")],null)},Nn=function(a){var b=Ln(Mn(a)),c=$APP.k(a,"__x_tab_base");if($APP.n(c)){a.setAttribute("role","tab");a.setAttribute("aria-selected",$APP.n($APP.Gk.g(b))?"true":"false");$APP.n($APP.kk.g(b))?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");a.setAttribute("tabindex",
4
+ $APP.el.g(b));var d=Hn.g(b),e=$APP.T.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.Gk.g(b))?"true":"false");c.setAttribute("data-disabled",$APP.n($APP.kk.g(b))?"true":"false");c.setAttribute("data-size",$APP.di.g(b));c.setAttribute("data-variant",$APP.lh.g(b));return c.setAttribute("data-orientation",
5
+ $APP.Jl.g(b))}return null},On=function(a){var b=Ln(Mn(a)),c=$APP.M(b);b=$APP.D(c,$APP.Gk);c=$APP.D(c,$APP.kk);$APP.q(c)&&$APP.q(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},Pn=function(a){a.addEventListener("click",function(){return On(a)});a.addEventListener("keydown",function(b){var c=b.key;$APP.B.i(c,"Enter")||$APP.B.i(c," ")?(b.preventDefault(),b=On(a)):b=null;return b})},Qn=function(a){if(!$APP.Ng(a,
6
6
  "__x_tab_initialized")){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:var(--x-color-text,#0f172a);--x-tab-hover-background:rgba(15,23,42,0.05);--x-tab-selected-color:var(--x-color-primary-hover,#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:var(--x-color-text-muted,#94a3b8);--x-tab-hover-background:rgba(248,250,252,0.06);--x-tab-selected-color:var(--x-color-focus-ring,#60a5fa);--x-tab-selected-background:rgba(59,130,246,0.18);--x-tab-selected-border-color:var(--x-color-focus-ring,#60a5fa);}}.base{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;user-select:none;padding:var(--x-tab-padding-md,10px 16px);border-radius:var(--x-tab-radius,8px);color:var(--x-tab-color);background:var(--x-tab-background,transparent);border:1px solid var(--x-tab-border-color,transparent);transition:background var(--x-tab-transition-duration,120ms) var(--x-tab-transition-timing,ease),color var(--x-tab-transition-duration,120ms) var(--x-tab-transition-timing,ease),border-color var(--x-tab-transition-duration,120ms) var(--x-tab-transition-timing,ease);}.base[data-size\x3d'sm']{padding:var(--x-tab-padding-sm,6px 12px);}.base[data-size\x3d'md']{padding:var(--x-tab-padding-md,10px 16px);}.base[data-size\x3d'lg']{padding:var(--x-tab-padding-lg,14px 20px);}.base:hover{background:var(--x-tab-hover-background);}.base[data-selected\x3d'true']{color:var(--x-tab-selected-color);background:var(--x-tab-selected-background);border-color:var(--x-tab-selected-border-color);}.base[data-variant\x3d'underline'][data-selected\x3d'true']{border-bottom:2px solid var(--x-tab-selected-color);background:transparent;}.base[data-variant\x3d'pill'][data-selected\x3d'true']{background:var(--x-tab-selected-background);}.base[data-disabled\x3d'true']{opacity:var(--x-tab-disabled-opacity,0.5);cursor:default;}:host(:focus-visible) .base{box-shadow:0 0 0 3px var(--x-tab-focus-ring,rgba(59,130,246,0.4));}@media (prefers-reduced-motion: reduce){.base{transition:none;}}";
7
- d.setAttribute("part","base");d.className="base";d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__x_tab_root=b;a.__x_tab_base=d;xn(a);a.__x_tab_initialized=!0}vn(a);return a},zn=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})},Bn=function(){var a=class extends HTMLElement{};a.observedAttributes=An;a.prototype.connectedCallback=function(){return yn(this)};a.prototype.attributeChangedCallback=
9
- function(){return $APP.Dg(this,"__x_tab_initialized")?vn(this):yn(this)};zn(a);return a},Cn=function(){return $APP.n(customElements.get("x-tab"))?null:customElements.define("x-tab",Bn())},pn=new $APP.K(null,"controls","controls",1340701452);var An="value selected disabled orientation size variant label controls".split(" "),qn=new $APP.S(null,new $APP.Q(null,2,["vertical",null,"horizontal",null],null),null),rn=new $APP.S(null,new $APP.Q(null,3,["md",null,"lg",null,"sm",null],null),null),sn=new $APP.S(null,new $APP.Q(null,3,["default",null,"underline",null,"pill",null],null),null);$APP.Pd(["tab-select",new $APP.Q(null,1,[$APP.V,new $APP.Q(null,1,[$APP.Yi,$APP.Y],null)],null)]);$APP.ha("baredom.exports.x_tab.init",Cn);export const init=Cn;
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;Pn(a);a.__x_tab_initialized=!0}Nn(a);return a},Rn=function(a){return Qn(a)},Sn=function(a){return $APP.Ng(a,"__x_tab_initialized")?Nn(a):Qn(a)},Tn=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")},configurable:!0,enumerable:!0});
8
+ Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.n(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},configurable:!0,enumerable:!0});return Object.defineProperty(a,"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})},Vn=function(){return $APP.Lg("x-tab",new $APP.Q(null,4,[$APP.Cg,
9
+ Un,$APP.Dg,Rn,$APP.Fg,Sn,$APP.Jg,Tn],null))},Hn=new $APP.K(null,"controls","controls",1340701452);var Un="value selected disabled orientation size variant label controls".split(" "),In=new $APP.R(null,new $APP.Q(null,2,["vertical",null,"horizontal",null],null),null),Jn=new $APP.R(null,new $APP.Q(null,3,["md",null,"lg",null,"sm",null],null),null),Kn=new $APP.R(null,new $APP.Q(null,3,["default",null,"underline",null,"pill",null],null),null);$APP.Pd(["tab-select",new $APP.Q(null,1,[$APP.V,new $APP.Q(null,1,[$APP.pj,$APP.Y],null)],null)]);$APP.ha("baredom.exports.x_tab.init",Vn);export const init=Vn;
@@ -1,25 +1,25 @@
1
1
  import { $APP, shadow$provide } from "./base.js";
2
- var mR=function(a,b,c){a=typeof a==="string"?a.trim().toLowerCase():null;return $APP.I(b,a)?a:c},nR=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),$APP.r(isNaN(a))&&a>0?Math.floor(a):1):1},qR=function(a){var b=$APP.M(a);a=$APP.D(b,oR);b=$APP.D(b,pR);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},rR=function(a){var b=$APP.M(a);a=$APP.D(b,$APP.Z);b=$APP.D(b,oR);return(a=$APP.B.i(a,
3
- "header"))?b:a},sR=function(a){switch(a){case "none":return"asc";case "asc":return"desc";case "desc":return"none";default:return"asc"}},tR=function(a){switch(a){case "none":return"Sort ascending";case "asc":return"Sort descending";case "desc":return"Remove sort";default:return"Sort ascending"}},xR=function(a){var b=$APP.k(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"),
2
+ var US=function(a,b,c){a=typeof a==="string"?a.trim().toLowerCase():null;return $APP.I(b,a)?a:c},VS=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),$APP.q(isNaN(a))&&a>0?Math.floor(a):1):1},YS=function(a){var b=$APP.M(a);a=$APP.D(b,WS);b=$APP.D(b,XS);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},ZS=function(a){var b=$APP.M(a);a=$APP.D(b,$APP.Z);b=$APP.D(b,WS);return(a=$APP.B.i(a,
3
+ "header"))?b:a},$S=function(a){switch(a){case "none":return"asc";case "asc":return"desc";case "desc":return"none";default:return"asc"}},aT=function(a){switch(a){case "none":return"Sort ascending";case "asc":return"Sort descending";case "desc":return"Remove sort";default:return"Sort ascending"}},eT=function(a){var b=$APP.k(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"),l=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:var(--x-color-border,rgba(0,0,0,0.1));--x-table-cell-border-width:1px;--x-table-cell-color:var(--x-color-text,inherit);--x-table-cell-header-color:var(--x-color-text,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:var(--x-color-text-muted,rgba(0,0,0,0.4));--x-table-cell-sort-hover-color:var(--x-color-text,rgba(0,0,0,0.7));--x-table-cell-focus-ring:var(--x-color-focus-ring,rgba(59,130,246,0.5));--x-table-cell-transition-duration:var(--x-transition-duration,150ms);--x-table-cell-sticky-bg:var(--x-color-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:var(--x-color-border,rgba(255,255,255,0.1));--x-table-cell-sort-color:var(--x-color-text-muted,rgba(255,255,255,0.4));--x-table-cell-sort-hover-color:var(--x-color-text,rgba(255,255,255,0.7));--x-table-cell-sticky-bg:var(--x-color-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;height:100%;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");l.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';l.appendChild(m);h.appendChild(l);d.appendChild(e);d.appendChild(h);
6
- b.appendChild(c);b.appendChild(d);a.__xTableCellRefs=new $APP.Q(null,5,[$APP.Hi,b,uR,d,$APP.zi,e,vR,h,wR,m],null);return $APP.k(a,"__xTableCellRefs")},MR=function(a){a=$APP.zf([$APP.Xi,yR,zR,AR,oR,$APP.Mi,$APP.yi,BR,CR,$APP.X,DR],[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.D(b,$APP.X);var c=$APP.D(b,DR),d=$APP.D(b,$APP.Xi),e=$APP.D(b,yR),g=$APP.D(b,zR),h=$APP.D(b,AR),l=$APP.D(b,oR),m=$APP.D(b,$APP.Mi),p=$APP.D(b,$APP.yi),q=$APP.D(b,BR);b=$APP.D(b,CR);return $APP.zf([$APP.vj,pR,ER,$APP.Z,FR,oR,$APP.Hl,$APP.vm,$APP.Mi,$APP.X,$APP.Yh],[mR(d,GR,"start"),mR(h,HR,"none"),mR(g,IR,"middle"),mR(p,JR,"data"),mR(b,KR,"col"),$APP.F(l),mR(q,LR,"none"),nR(c),$APP.F(m),$APP.F(a),nR(e)])},NR=function(a){var b=MR(a);if($APP.N($APP.k(a,"__xTableCellModel"),b)){b=
8
- $APP.M(b);var c=$APP.D(b,$APP.vm),d=$APP.D(b,$APP.Yh),e=$APP.D(b,$APP.X),g=$APP.D(b,pR),h=xR(a);h=$APP.M(h);var l=$APP.D(h,vR);h=$APP.D(h,wR);var m=rR(b),p=$APP.M(b),q=$APP.D(p,$APP.Z),v=$APP.D(p,$APP.vj),x=$APP.D(p,ER),y=$APP.D(p,$APP.Hl),A=$APP.D(p,$APP.Mi),C=$APP.D(p,$APP.X),E=a.setAttribute,H=$APP.M(p);var G=$APP.D(H,$APP.Z);H=$APP.D(H,FR);G=$APP.B.i(G,"header")?$APP.B.i(H,"row")||$APP.B.i(H,"rowgroup")?"rowheader":"columnheader":"cell";E.call(a,"role",G);p=qR(p);$APP.n(p)?a.setAttribute("aria-sort",
9
- p):a.removeAttribute("aria-sort");$APP.n(C)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");a.setAttribute("data-type",q);a.setAttribute("data-align",v);a.setAttribute("data-valign",x);$APP.B.i(y,"none")?a.removeAttribute("data-sticky"):a.setAttribute("data-sticky",y);$APP.n(A)?a.setAttribute("data-truncate",""):a.removeAttribute("data-truncate");a.style.gridColumn=c>1?"span "+$APP.T.g(c):"";a.style.gridRow=d>1?"span "+$APP.T.g(d):"";l.hidden=$APP.r(m);c=parseInt;q=$APP.M(b);
10
- m=$APP.D(q,$APP.Z);d=$APP.D(q,oR);q=$APP.D(q,$APP.X);m=$APP.B.i(m,"header");l.tabIndex=c($APP.n(m?$APP.n(d)?$APP.r(q):d:m)?"0":"-1",10);l.setAttribute("aria-label",tR(g));l.disabled=$APP.F(e);a:switch(e=$APP.M(b),$APP.D(e,pR)){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}},OR=function(a){var b=a.getAttribute("sort-direction");b=mR(b,HR,"none");b=new CustomEvent("x-table-cell-sort",{detail:{direction:sR(b),previousDirection:b},bubbles:!0,composed:!0,cancelable:!0});a.dispatchEvent(b)},PR=function(a){var b=function(){var c=$APP.k(a,"__xTableCellModel");
12
- return $APP.n(c)?c:MR(a)}();$APP.n(function(){var c=rR(b);return $APP.n(c)?$APP.r($APP.X.g(b)):c}())&&OR(a);return null},QR=function(a){function b(){return PR(a)}var c=xR(a);c=$APP.M(c);$APP.D(c,vR).addEventListener("click",b);$APP.ja(a,"__xTableCellHandlers",{"sort-click":b})},RR=function(a){var b=$APP.k(a,"__xTableCellHandlers"),c=$APP.k(a,"__xTableCellRefs");$APP.n($APP.n(b)?c:b)&&(c=$APP.M(c),c=$APP.D(c,vR),b=$APP.k(b,"sort-click"),$APP.n(b)&&c.removeEventListener("click",b));a.__xTableCellHandlers=
13
- null},SR=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 nR(this.getAttribute("col-span"))},set:function(b){b=parseInt(b,10);return $APP.r(isNaN(b))&&
17
- b>0?this.setAttribute("col-span",""+$APP.T.g(b)):this.removeAttribute("col-span")},enumerable:!0,configurable:!0});Object.defineProperty(a,"rowSpan",{get:function(){return nR(this.getAttribute("row-span"))},set:function(b){b=parseInt(b,10);return $APP.r(isNaN(b))&&b>0?this.setAttribute("row-span",""+$APP.T.g(b)):this.removeAttribute("row-span")},enumerable:!0,configurable:!0});Object.defineProperty(a,"sortDirection",{get:function(){var b=this.getAttribute("sort-direction");return $APP.n(b)?b:"none"},
18
- set:function(b){return $APP.n(b)?this.setAttribute("sort-direction",""+$APP.T.g(b)):this.removeAttribute("sort-direction")},enumerable:!0,configurable:!0})},WR=function(){var a=class extends HTMLElement{};a.observedAttributes=TR;a.prototype.connectedCallback=function(){xR(this);RR(this);QR(this);NR(this);var b=$APP.k(this,"__xTableCellModel");var c=$APP.n(b)?b:MR(this);b=this.dispatchEvent;var d=CustomEvent,e=$APP.M(c);c=$APP.D(e,$APP.Z);var g=$APP.D(e,FR),h=$APP.D(e,$APP.vm),l=$APP.D(e,$APP.Yh);
19
- e=$APP.D(e,$APP.vj);b.call(this,new d("x-table-cell-connected",{detail:$APP.Hh(new $APP.Q(null,5,[$APP.Z,c,FR,g,UR,h,VR,l,$APP.vj,e],null)),bubbles:!0,composed:!0,cancelable:!1}));return null};a.prototype.disconnectedCallback=function(){RR(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)&&NR(this);return null};SR(a.prototype);return a},YR=function(){$APP.n(customElements.get("x-table-cell"))||
20
- customElements.define("x-table-cell",WR());return null},vR=new $APP.K(null,"sort-btn","sort-btn",1913954560),UR=new $APP.K(null,"colSpan","colSpan",872137394),uR=new $APP.K(null,"cell","cell",764245084),ER=new $APP.K(null,"valign","valign",1485197511),wR=new $APP.K(null,"sort-icon-default","sort-icon-default",-596209230),DR=new $APP.K(null,"col-span-raw","col-span-raw",1425293661),AR=new $APP.K(null,"sort-direction-raw","sort-direction-raw",-1822100883),BR=new $APP.K(null,"sticky-raw","sticky-raw",
21
- 1857578519),yR=new $APP.K(null,"row-span-raw","row-span-raw",-1130003707),CR=new $APP.K(null,"scope-raw","scope-raw",-773628648),pR=new $APP.K(null,"sort-direction","sort-direction",-1635889628),FR=new $APP.K(null,"scope","scope",-439358418),oR=new $APP.K(null,"sortable?","sortable?",291547474),zR=new $APP.K(null,"valign-raw","valign-raw",-1083375124),VR=new $APP.K(null,"rowSpan","rowSpan",826884002);var TR="type scope align valign col-span row-span truncate sticky sortable sort-direction disabled".split(" ");
22
- $APP.zf([$APP.vj,VR,$APP.Ui,$APP.Pj,ER,$APP.Z,FR,UR,$APP.Hl,new $APP.K(null,"sortable","sortable",2109633621),new $APP.K(null,"sortDirection","sortDirection",-45816999)],[new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null),new $APP.Q(null,1,[$APP.Z,$APP.Zj],null),new $APP.Q(null,1,[$APP.Z,$APP.Zj],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null),new $APP.Q(null,
23
- 1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.Zj],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null)]);$APP.Pd(["x-table-cell-sort",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,2,[$APP.tj,$APP.Y,$APP.Im,$APP.Y],null),$APP.lm,!0],null),"x-table-cell-connected",new $APP.Q(null,1,[$APP.V,new $APP.Q(null,5,[$APP.Z,$APP.Y,FR,$APP.Y,UR,$APP.W,VR,$APP.W,$APP.vj,$APP.Y],null)],null),"x-table-cell-disconnected",new $APP.Q(null,1,[$APP.V,$APP.Qd],null)]);
24
- var JR=new $APP.S(null,new $APP.Q(null,2,["data",null,"header",null],null),null),KR=new $APP.S(null,new $APP.Q(null,4,["rowgroup",null,"col",null,"row",null,"colgroup",null],null),null),GR=new $APP.S(null,new $APP.Q(null,3,["center",null,"start",null,"end",null],null),null),IR=new $APP.S(null,new $APP.Q(null,3,["top",null,"middle",null,"bottom",null],null),null),LR=new $APP.S(null,new $APP.Q(null,3,["none",null,"start",null,"end",null],null),null),HR=new $APP.S(null,new $APP.Q(null,3,["none",null,
25
- "desc",null,"asc",null],null),null);$APP.ha("baredom.exports.x_table_cell.init",YR);export const init=YR;
6
+ b.appendChild(c);b.appendChild(d);a.__xTableCellRefs=new $APP.Q(null,5,[$APP.Zi,b,bT,d,$APP.Ri,e,cT,h,dT,m],null);return $APP.k(a,"__xTableCellRefs")},tT=function(a){a=$APP.zf([$APP.oj,fT,gT,hT,WS,$APP.dj,$APP.Qi,iT,jT,$APP.X,kT],[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.D(b,$APP.X);var c=$APP.D(b,kT),d=$APP.D(b,$APP.oj),e=$APP.D(b,fT),g=$APP.D(b,gT),h=$APP.D(b,hT),l=$APP.D(b,WS),m=$APP.D(b,$APP.dj),p=$APP.D(b,$APP.Qi),r=$APP.D(b,iT);b=$APP.D(b,jT);return $APP.zf([$APP.Nj,XS,lT,$APP.Z,mT,WS,$APP.Zl,$APP.Um,$APP.dj,$APP.X,$APP.ti],[US(d,nT,"start"),US(h,oT,"none"),US(g,pT,"middle"),US(p,qT,"data"),US(b,rT,"col"),$APP.F(l),US(r,sT,"none"),VS(c),$APP.F(m),$APP.F(a),VS(e)])},uT=function(a){var b=tT(a);if($APP.N($APP.k(a,"__xTableCellModel"),b)){b=
8
+ $APP.M(b);var c=$APP.D(b,$APP.Um),d=$APP.D(b,$APP.ti),e=$APP.D(b,$APP.X),g=$APP.D(b,XS),h=eT(a);h=$APP.M(h);var l=$APP.D(h,cT);h=$APP.D(h,dT);var m=ZS(b),p=$APP.M(b),r=$APP.D(p,$APP.Z),v=$APP.D(p,$APP.Nj),x=$APP.D(p,lT),y=$APP.D(p,$APP.Zl),A=$APP.D(p,$APP.dj),C=$APP.D(p,$APP.X),E=a.setAttribute,H=$APP.M(p);var G=$APP.D(H,$APP.Z);H=$APP.D(H,mT);G=$APP.B.i(G,"header")?$APP.B.i(H,"row")||$APP.B.i(H,"rowgroup")?"rowheader":"columnheader":"cell";E.call(a,"role",G);p=YS(p);$APP.n(p)?a.setAttribute("aria-sort",
9
+ p):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",x);$APP.B.i(y,"none")?a.removeAttribute("data-sticky"):a.setAttribute("data-sticky",y);$APP.n(A)?a.setAttribute("data-truncate",""):a.removeAttribute("data-truncate");a.style.gridColumn=c>1?"span "+$APP.S.g(c):"";a.style.gridRow=d>1?"span "+$APP.S.g(d):"";l.hidden=$APP.q(m);c=parseInt;r=$APP.M(b);
10
+ m=$APP.D(r,$APP.Z);d=$APP.D(r,WS);r=$APP.D(r,$APP.X);m=$APP.B.i(m,"header");l.tabIndex=c($APP.n(m?$APP.n(d)?$APP.q(r):d:m)?"0":"-1",10);l.setAttribute("aria-label",aT(g));l.disabled=$APP.F(e);a:switch(e=$APP.M(b),$APP.D(e,XS)){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}},vT=function(a){var b=a.getAttribute("sort-direction");b=US(b,oT,"none");b=new CustomEvent("x-table-cell-sort",{detail:{direction:$S(b),previousDirection:b},bubbles:!0,composed:!0,cancelable:!0});a.dispatchEvent(b)},wT=function(a){var b=function(){var c=$APP.k(a,"__xTableCellModel");
12
+ return $APP.n(c)?c:tT(a)}();$APP.n(function(){var c=ZS(b);return $APP.n(c)?$APP.q($APP.X.g(b)):c}())&&vT(a);return null},xT=function(a){function b(){return wT(a)}var c=eT(a);c=$APP.M(c);$APP.D(c,cT).addEventListener("click",b);$APP.ja(a,"__xTableCellHandlers",{"sort-click":b})},yT=function(a){var b=$APP.k(a,"__xTableCellHandlers"),c=$APP.k(a,"__xTableCellRefs");$APP.n($APP.n(b)?c:b)&&(c=$APP.M(c),c=$APP.D(c,cT),b=$APP.k(b,"sort-click"),$APP.n(b)&&c.removeEventListener("click",b));a.__xTableCellHandlers=
13
+ null},zT=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
+ 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
+ "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 VS(this.getAttribute("col-span"))},set:function(b){b=parseInt(b,10);return $APP.q(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 VS(this.getAttribute("row-span"))},set:function(b){b=parseInt(b,10);return $APP.q(isNaN(b))&&b>0?this.setAttribute("row-span",""+$APP.S.g(b)):this.removeAttribute("row-span")},enumerable:!0,configurable:!0});return Object.defineProperty(a,"sortDirection",{get:function(){var b=this.getAttribute("sort-direction");return $APP.n(b)?
18
+ b:"none"},set:function(b){return $APP.n(b)?this.setAttribute("sort-direction",""+$APP.S.g(b)):this.removeAttribute("sort-direction")},enumerable:!0,configurable:!0})},CT=function(a){eT(a);yT(a);xT(a);uT(a);var b=$APP.k(a,"__xTableCellModel");var c=$APP.n(b)?b:tT(a);b=a.dispatchEvent;var d=CustomEvent,e=$APP.M(c);c=$APP.D(e,$APP.Z);var g=$APP.D(e,mT),h=$APP.D(e,$APP.Um),l=$APP.D(e,$APP.ti);e=$APP.D(e,$APP.Nj);b.call(a,new d("x-table-cell-connected",{detail:$APP.Zh(new $APP.Q(null,5,[$APP.Z,c,mT,g,
19
+ AT,h,BT,l,$APP.Nj,e],null)),bubbles:!0,composed:!0,cancelable:!1}));return null},DT=function(a){yT(a);a.dispatchEvent(new CustomEvent("x-table-cell-disconnected",{detail:{},bubbles:!0,composed:!0,cancelable:!1}));return null},ET=function(a,b,c,d){$APP.N(c,d)&&uT(a);return null},GT=function(){return $APP.Lg("x-table-cell",new $APP.Q(null,5,[$APP.Cg,FT,$APP.Dg,CT,$APP.Eg,DT,$APP.Fg,ET,$APP.Jg,zT],null))},cT=new $APP.K(null,"sort-btn","sort-btn",1913954560),AT=new $APP.K(null,"colSpan","colSpan",872137394),
20
+ bT=new $APP.K(null,"cell","cell",764245084),lT=new $APP.K(null,"valign","valign",1485197511),dT=new $APP.K(null,"sort-icon-default","sort-icon-default",-596209230),kT=new $APP.K(null,"col-span-raw","col-span-raw",1425293661),hT=new $APP.K(null,"sort-direction-raw","sort-direction-raw",-1822100883),iT=new $APP.K(null,"sticky-raw","sticky-raw",1857578519),fT=new $APP.K(null,"row-span-raw","row-span-raw",-1130003707),jT=new $APP.K(null,"scope-raw","scope-raw",-773628648),XS=new $APP.K(null,"sort-direction",
21
+ "sort-direction",-1635889628),mT=new $APP.K(null,"scope","scope",-439358418),WS=new $APP.K(null,"sortable?","sortable?",291547474),gT=new $APP.K(null,"valign-raw","valign-raw",-1083375124),BT=new $APP.K(null,"rowSpan","rowSpan",826884002);var FT="type scope align valign col-span row-span truncate sticky sortable sort-direction disabled".split(" ");
22
+ $APP.zf([$APP.Nj,BT,$APP.lj,$APP.kk,lT,$APP.Z,mT,AT,$APP.Zl,new $APP.K(null,"sortable","sortable",2109633621),new $APP.K(null,"sortDirection","sortDirection",-45816999)],[new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null),new $APP.Q(null,1,[$APP.Z,$APP.uk],null),new $APP.Q(null,1,[$APP.Z,$APP.uk],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.W],null),new $APP.Q(null,
23
+ 1,[$APP.Z,$APP.Y],null),new $APP.Q(null,1,[$APP.Z,$APP.uk],null),new $APP.Q(null,1,[$APP.Z,$APP.Y],null)]);$APP.Pd(["x-table-cell-sort",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,2,[$APP.Lj,$APP.Y,$APP.$m,$APP.Y],null),$APP.Km,!0],null),"x-table-cell-connected",new $APP.Q(null,1,[$APP.V,new $APP.Q(null,5,[$APP.Z,$APP.Y,mT,$APP.Y,AT,$APP.W,BT,$APP.W,$APP.Nj,$APP.Y],null)],null),"x-table-cell-disconnected",new $APP.Q(null,1,[$APP.V,$APP.Qd],null)]);
24
+ var qT=new $APP.R(null,new $APP.Q(null,2,["data",null,"header",null],null),null),rT=new $APP.R(null,new $APP.Q(null,4,["rowgroup",null,"col",null,"row",null,"colgroup",null],null),null),nT=new $APP.R(null,new $APP.Q(null,3,["center",null,"start",null,"end",null],null),null),pT=new $APP.R(null,new $APP.Q(null,3,["top",null,"middle",null,"bottom",null],null),null),sT=new $APP.R(null,new $APP.Q(null,3,["none",null,"start",null,"end",null],null),null),oT=new $APP.R(null,new $APP.Q(null,3,["none",null,
25
+ "desc",null,"asc",null],null),null);$APP.ha("baredom.exports.x_table_cell.init",GT);export const init=GT;
@@ -1,11 +1,10 @@
1
1
  import { $APP, shadow$provide } from "./base.js";
2
- var xz=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),$APP.r(isNaN(a))&&a>0?Math.floor(a):null):null},yz=function(a){var b=$APP.M(a);a=$APP.D(b,$APP.Jl);b=$APP.D(b,$APP.X);return $APP.n(a)?$APP.r(b):a},zz=function(a){if(!$APP.n($APP.k(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:var(--x-color-focus-ring,rgba(59,130,246,0.5));--x-table-row-transition-duration:var(--x-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.Hi,b,$APP.Fl,d],null)}},Cz=function(a){a=new $APP.Q(null,4,[$APP.cj,a.hasAttribute("selected"),$APP.X,a.hasAttribute("disabled"),$APP.Jl,a.hasAttribute("interactive"),Az,a.getAttribute("row-index")],null);var b=$APP.M(a);a=$APP.D(b,$APP.cj);var c=$APP.D(b,$APP.X),d=$APP.D(b,$APP.Jl);b=$APP.D(b,Az);return new $APP.Q(null,4,[$APP.cj,$APP.F(a),$APP.X,$APP.F(c),$APP.Jl,$APP.F(d),Bz,xz(b)],null)},Dz=function(a){var b=Cz(a);if($APP.N($APP.k(a,
4
- "__xTableRowModel"),b)){zz(a);var c=$APP.M(b),d=$APP.D(c,$APP.cj),e=$APP.D(c,$APP.X),g=$APP.D(c,$APP.Jl),h=$APP.D(c,Bz);a.setAttribute("role","row");var l=$APP.M(c);var m=$APP.D(l,$APP.cj);l=$APP.D(l,$APP.Jl);m=$APP.n(m)?"true":$APP.n(l)?"false":null;$APP.n(m)?a.setAttribute("aria-selected",m):a.removeAttribute("aria-selected");$APP.n(e)?a.setAttribute("aria-disabled","true"):a.removeAttribute("aria-disabled");h!=null?a.setAttribute("aria-rowindex",""+$APP.T.g(h)):a.removeAttribute("aria-rowindex");
5
- $APP.n(d)?a.setAttribute("data-selected",""):a.removeAttribute("data-selected");$APP.n(g)?a.setAttribute("data-interactive",""):a.removeAttribute("data-interactive");a.tabIndex=$APP.n(yz(c))?0:-1;a.__xTableRowModel=b}},Ez=function(a){var b=$APP.k(a,"__xTableRowModel");var c=$APP.n(b)?b:Cz(a);b=a.dispatchEvent;var d=CustomEvent,e=$APP.M(c);c=$APP.D(e,$APP.cj);var g=$APP.D(e,$APP.X);e=$APP.D(e,Bz);b.call(a,new d("x-table-row-click",{detail:$APP.Hh(new $APP.Q(null,3,[$APP.Jj,$APP.n(e)?e:0,$APP.ok,c,
6
- $APP.Pj,g],null)),bubbles:!0,composed:!0,cancelable:!0}))},Fz=function(a){function b(d){var e=d.key;if($APP.B.i(e,"Enter")||$APP.B.i(e," "))e=$APP.k(a,"__xTableRowModel"),e=$APP.n(e)?e:Cz(a),$APP.n(yz(e))&&(d.preventDefault(),Ez(a));return null}function c(){var d=$APP.k(a,"__xTableRowModel");d=$APP.n(d)?d:Cz(a);$APP.n(yz(d))&&Ez(a);return null}a.addEventListener("click",c);a.addEventListener("keydown",b);$APP.ja(a,"__xTableRowHandlers",{click:c,keydown:b})},Gz=function(a){var b=$APP.k(a,"__xTableRowHandlers");
7
- if($APP.n(b)){var c=$APP.k(b,"click");b=$APP.k(b,"keydown");$APP.n(c)&&a.removeEventListener("click",c);$APP.n(b)&&a.removeEventListener("keydown",b)}a.__xTableRowHandlers=null},Hz=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 xz(this.getAttribute("row-index"))},set:function(b){b=parseInt(b,10);return $APP.r(isNaN(b))&&
9
- b>0?this.setAttribute("row-index",""+$APP.T.g(b)):this.removeAttribute("row-index")},enumerable:!0,configurable:!0})},Jz=function(){var a=class extends HTMLElement{};a.observedAttributes=Iz;a.prototype.connectedCallback=function(){zz(this);Gz(this);Fz(this);Dz(this);var b=$APP.k(this,"__xTableRowModel");var c=$APP.n(b)?b:Cz(this);b=this.dispatchEvent;var d=CustomEvent,e=$APP.M(c);c=$APP.D(e,$APP.cj);var g=$APP.D(e,$APP.X),h=$APP.D(e,$APP.Jl);e=$APP.D(e,Bz);b.call(this,new d("x-table-row-connected",
10
- {detail:$APP.Hh(new $APP.Q(null,4,[$APP.Jj,$APP.n(e)?e:0,$APP.ok,c,$APP.Pj,g,$APP.lj,h],null)),bubbles:!0,composed:!0,cancelable:!1}));return null};a.prototype.disconnectedCallback=function(){Gz(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)&&Dz(this);return null};Hz(a.prototype);return a},Kz=function(){$APP.n(customElements.get("x-table-row"))||
11
- customElements.define("x-table-row",Jz());return null},Bz=new $APP.K(null,"row-index","row-index",-828710296),Az=new $APP.K(null,"row-index-raw","row-index-raw",1490649093);var Iz=["selected","disabled","interactive","row-index"];$APP.Pd(["x-table-row-click",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,3,[$APP.Jj,$APP.W,$APP.ok,$APP.Zj,$APP.Pj,$APP.Zj],null),$APP.lm,!0],null),"x-table-row-connected",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,4,[$APP.Jj,$APP.W,$APP.ok,$APP.Zj,$APP.Pj,$APP.Zj,$APP.lj,$APP.Zj],null),$APP.lm,!1],null),"x-table-row-disconnected",new $APP.Q(null,2,[$APP.V,$APP.Qd,$APP.lm,!1],null)]);$APP.ha("baredom.exports.x_table_row.init",Kz);export const init=Kz;
2
+ var jA=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),$APP.q(isNaN(a))&&a>0?Math.floor(a):null):null},kA=function(a){var b=$APP.M(a);a=$APP.D(b,$APP.am);b=$APP.D(b,$APP.X);return $APP.n(a)?$APP.q(b):a},lA=function(a){if(!$APP.n($APP.k(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:var(--x-color-focus-ring,rgba(59,130,246,0.5));--x-table-row-transition-duration:var(--x-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.Zi,b,$APP.Xl,d],null)}},oA=function(a){a=new $APP.Q(null,4,[$APP.uj,a.hasAttribute("selected"),$APP.X,a.hasAttribute("disabled"),$APP.am,a.hasAttribute("interactive"),mA,a.getAttribute("row-index")],null);var b=$APP.M(a);a=$APP.D(b,$APP.uj);var c=$APP.D(b,$APP.X),d=$APP.D(b,$APP.am);b=$APP.D(b,mA);return new $APP.Q(null,4,[$APP.uj,$APP.F(a),$APP.X,$APP.F(c),$APP.am,$APP.F(d),nA,jA(b)],null)},pA=function(a){var b=oA(a);if($APP.N($APP.k(a,
4
+ "__xTableRowModel"),b)){lA(a);var c=$APP.M(b),d=$APP.D(c,$APP.uj),e=$APP.D(c,$APP.X),g=$APP.D(c,$APP.am),h=$APP.D(c,nA);a.setAttribute("role","row");var l=$APP.M(c);var m=$APP.D(l,$APP.uj);l=$APP.D(l,$APP.am);m=$APP.n(m)?"true":$APP.n(l)?"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");
5
+ $APP.n(d)?a.setAttribute("data-selected",""):a.removeAttribute("data-selected");$APP.n(g)?a.setAttribute("data-interactive",""):a.removeAttribute("data-interactive");a.tabIndex=$APP.n(kA(c))?0:-1;a.__xTableRowModel=b}},qA=function(a){var b=$APP.k(a,"__xTableRowModel");var c=$APP.n(b)?b:oA(a);b=a.dispatchEvent;var d=CustomEvent,e=$APP.M(c);c=$APP.D(e,$APP.uj);var g=$APP.D(e,$APP.X);e=$APP.D(e,nA);b.call(a,new d("x-table-row-click",{detail:$APP.Zh(new $APP.Q(null,3,[$APP.bk,$APP.n(e)?e:0,$APP.Gk,c,
6
+ $APP.kk,g],null)),bubbles:!0,composed:!0,cancelable:!0}))},rA=function(a){function b(d){var e=d.key;if($APP.B.i(e,"Enter")||$APP.B.i(e," "))e=$APP.k(a,"__xTableRowModel"),e=$APP.n(e)?e:oA(a),$APP.n(kA(e))&&(d.preventDefault(),qA(a));return null}function c(){var d=$APP.k(a,"__xTableRowModel");d=$APP.n(d)?d:oA(a);$APP.n(kA(d))&&qA(a);return null}a.addEventListener("click",c);a.addEventListener("keydown",b);$APP.ja(a,"__xTableRowHandlers",{click:c,keydown:b})},sA=function(a){var b=$APP.k(a,"__xTableRowHandlers");
7
+ if($APP.n(b)){var c=$APP.k(b,"click");b=$APP.k(b,"keydown");$APP.n(c)&&a.removeEventListener("click",c);$APP.n(b)&&a.removeEventListener("keydown",b)}a.__xTableRowHandlers=null},tA=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});return Object.defineProperty(a,"rowIndex",{get:function(){return jA(this.getAttribute("row-index"))},set:function(b){b=parseInt(b,10);return $APP.q(isNaN(b))&&
9
+ b>0?this.setAttribute("row-index",""+$APP.S.g(b)):this.removeAttribute("row-index")},enumerable:!0,configurable:!0})},uA=function(a){lA(a);sA(a);rA(a);pA(a);var b=$APP.k(a,"__xTableRowModel");var c=$APP.n(b)?b:oA(a);b=a.dispatchEvent;var d=CustomEvent,e=$APP.M(c);c=$APP.D(e,$APP.uj);var g=$APP.D(e,$APP.X),h=$APP.D(e,$APP.am);e=$APP.D(e,nA);b.call(a,new d("x-table-row-connected",{detail:$APP.Zh(new $APP.Q(null,4,[$APP.bk,$APP.n(e)?e:0,$APP.Gk,c,$APP.kk,g,$APP.Dj,h],null)),bubbles:!0,composed:!0,cancelable:!1}));
10
+ return null},vA=function(a){sA(a);document.dispatchEvent(new CustomEvent("x-table-row-disconnected",{detail:{},bubbles:!1,composed:!1,cancelable:!1}));return null},wA=function(a,b,c,d){$APP.N(c,d)&&pA(a);return null},yA=function(){return $APP.Lg("x-table-row",new $APP.Q(null,5,[$APP.Cg,xA,$APP.Dg,uA,$APP.Eg,vA,$APP.Fg,wA,$APP.Jg,tA],null))},nA=new $APP.K(null,"row-index","row-index",-828710296),mA=new $APP.K(null,"row-index-raw","row-index-raw",1490649093);var xA=["selected","disabled","interactive","row-index"];$APP.Pd(["x-table-row-click",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,3,[$APP.bk,$APP.W,$APP.Gk,$APP.uk,$APP.kk,$APP.uk],null),$APP.Km,!0],null),"x-table-row-connected",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,4,[$APP.bk,$APP.W,$APP.Gk,$APP.uk,$APP.kk,$APP.uk,$APP.Dj,$APP.uk],null),$APP.Km,!1],null),"x-table-row-disconnected",new $APP.Q(null,2,[$APP.V,$APP.Qd,$APP.Km,!1],null)]);$APP.ha("baredom.exports.x_table_row.init",yA);export const init=yA;
package/dist/x-table.js CHANGED
@@ -1,17 +1,16 @@
1
1
  import { $APP, shadow$provide } from "./base.js";
2
- var aG=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),$APP.r(isNaN(a))&&a>0?Math.floor(a):null):null},cG=function(a){var b=$APP.k(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:var(--x-color-border,rgba(0,0,0,0.1));--x-table-border-radius:var(--x-radius-md,8px);--x-table-stripe-bg:rgba(0,0,0,0.025);--x-table-caption-color:var(--x-color-text,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:var(--x-color-border,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.Q(null,3,[$APP.Hi,b,bG,d,$APP.Fl,e],null);return $APP.k(a,"__xTableRefs")},oG=function(a){a=new $APP.Q(null,8,[dG,a.getAttribute("columns"),eG,a.getAttribute("caption"),fG,a.getAttribute("selectable"),$APP.bl,a.hasAttribute("striped"),gG,a.hasAttribute("bordered"),hG,a.hasAttribute("full-width"),iG,a.hasAttribute("compact"),jG,a.getAttribute("row-count")],null);var b=
4
- $APP.M(a),c=$APP.D(b,dG),d=$APP.D(b,eG),e=$APP.D(b,fG);a=$APP.D(b,$APP.bl);var g=$APP.D(b,gG),h=$APP.D(b,hG),l=$APP.D(b,iG);b=$APP.D(b,jG);a:{if(typeof c==="string"&&(c=c.trim(),$APP.N(c,""))){var m=parseInt(c,10);c=$APP.r(isNaN(m))&&m>0&&$APP.B.i(c,""+$APP.T.g(m))?"repeat("+$APP.T.g(m)+",1fr)":c;break a}c=null}d=$APP.n(d)?d:"";e=typeof e==="string"?e.trim().toLowerCase():null;e=$APP.I(kG,e)?e:"none";return new $APP.Q(null,8,[$APP.Mk,c,lG,d,mG,e,$APP.bl,$APP.F(a),gG,$APP.F(g),hG,$APP.F(h),iG,$APP.F(l),
5
- nG,aG(b)],null)},pG=function(a){a=a.querySelectorAll("x-table-row");for(var b=a.length,c=0;;)if(c<b){var d=a[c];$APP.fd(c+1,2)===0?d.setAttribute("data-stripe","even"):d.removeAttribute("data-stripe");c+=1}else break},qG=function(a){var b=oG(a);if($APP.N($APP.k(a,"__xTableModel"),b)){b=$APP.M(b);var c=$APP.D(b,$APP.Mk),d=$APP.D(b,lG),e=$APP.D(b,mG),g=$APP.D(b,$APP.bl),h=$APP.D(b,gG),l=$APP.D(b,hG),m=$APP.D(b,iG),p=$APP.D(b,nG),q=cG(a);q=$APP.M(q);q=$APP.D(q,bG);a.style.gridTemplateColumns=$APP.n(c)?
6
- c:"";a.setAttribute("role",$APP.B.i(e,"none")?"table":"grid");c=$APP.B.i(e,"multi")?"true":null;$APP.n(c)?a.setAttribute("aria-multiselectable",c):a.removeAttribute("aria-multiselectable");p!=null?a.setAttribute("aria-rowcount",""+$APP.T.g(p)):a.removeAttribute("aria-rowcount");$APP.N(d,"")?a.setAttribute("aria-label",d):a.removeAttribute("aria-label");$APP.N(d,"")?(q.textContent=d,q.removeAttribute("hidden")):(q.textContent="",q.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(l)?a.setAttribute("data-full-width",""):a.removeAttribute("data-full-width");$APP.n(m)?a.setAttribute("data-compact",""):a.removeAttribute("data-compact");$APP.n(g)&&pG(a);a.__xTableModel=b}},tG=function(a){function b(){var e=$APP.k(a,"__xTableModel");e=$APP.n(e)?e:oG(a);$APP.n($APP.bl.g(e))&&pG(a);return null}function c(e){var g=$APP.k(a,"__xTableModel");g=$APP.n(g)?g:oG(a);
8
- var h=mG.g(g);if($APP.N(h,"none"))if(g=e.target,e=$APP.k(e.detail,"rowIndex"),e=$APP.Hh(new $APP.Q(null,3,[$APP.Jj,$APP.n(e)?e:0,$APP.ok,$APP.r(g.hasAttribute("selected")),rG,h],null)),a.dispatchEvent(new CustomEvent("x-table-row-select",{detail:e,bubbles:!0,composed:!0,cancelable:!0})),$APP.B.i(h,"single")){e=g.hasAttribute("selected");h=a.querySelectorAll("x-table-row[selected]");for(var l=h.length,m=0;;)if(m<l)h[m].removeAttribute("selected"),m+=1;else break;$APP.n(e)||g.setAttribute("selected",
9
- "")}else $APP.B.i(h,"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.k(e.detail,"direction"),l=$APP.k(e.detail,"previousDirection");g>=0&&(e.stopPropagation(),e=$APP.Hh(new $APP.Q(null,3,[sG,g,$APP.tj,h,$APP.Im,l],null)),a.dispatchEvent(new CustomEvent("x-table-sort",{detail:e,bubbles:!0,composed:!0,cancelable:!0})));
10
- return null}a.addEventListener("x-table-cell-sort",d);a.addEventListener("x-table-row-click",c);a.addEventListener("x-table-row-connected",b);$APP.ja(a,"__xTableHandlers",{sort:d,"row-click":c,"row-conn":b})},uG=function(a){var b=$APP.k(a,"__xTableHandlers");if($APP.n(b)){var c=$APP.k(b,"sort"),d=$APP.k(b,"row-click");b=$APP.k(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",
11
- b)}a.__xTableHandlers=null},vG=function(a){Object.defineProperty(a,"columns",{get:function(){var b=this.getAttribute("columns");return $APP.n(b)?b:""},set:function(b){return $APP.n(b)?this.setAttribute("columns",""+$APP.T.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.T.g(b)):this.removeAttribute("caption")},
12
- enumerable:!0,configurable:!0});Object.defineProperty(a,"selectable",{get:function(){var b=this.getAttribute("selectable");return $APP.n(b)?b:"none"},set:function(b){return $APP.n(b)?this.setAttribute("selectable",""+$APP.T.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});
2
+ var $G=function(a){return typeof a==="string"?(a=parseInt(a.trim(),10),$APP.q(isNaN(a))&&a>0?Math.floor(a):null):null},bH=function(a){var b=$APP.k(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:var(--x-color-border,rgba(0,0,0,0.1));--x-table-border-radius:var(--x-radius-md,8px);--x-table-stripe-bg:rgba(0,0,0,0.025);--x-table-caption-color:var(--x-color-text,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:var(--x-color-border,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.Q(null,3,[$APP.Zi,b,aH,d,$APP.Xl,e],null);return $APP.k(a,"__xTableRefs")},nH=function(a){a=new $APP.Q(null,8,[cH,a.getAttribute("columns"),dH,a.getAttribute("caption"),eH,a.getAttribute("selectable"),$APP.tl,a.hasAttribute("striped"),fH,a.hasAttribute("bordered"),gH,a.hasAttribute("full-width"),hH,a.hasAttribute("compact"),iH,a.getAttribute("row-count")],null);var b=
4
+ $APP.M(a),c=$APP.D(b,cH),d=$APP.D(b,dH),e=$APP.D(b,eH);a=$APP.D(b,$APP.tl);var g=$APP.D(b,fH),h=$APP.D(b,gH),l=$APP.D(b,hH);b=$APP.D(b,iH);a:{if(typeof c==="string"&&(c=c.trim(),$APP.N(c,""))){var m=parseInt(c,10);c=$APP.q(isNaN(m))&&m>0&&$APP.B.i(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.I(jH,e)?e:"none";return new $APP.Q(null,8,[$APP.dl,c,kH,d,lH,e,$APP.tl,$APP.F(a),fH,$APP.F(g),gH,$APP.F(h),hH,$APP.F(l),
5
+ mH,$G(b)],null)},oH=function(a){a=a.querySelectorAll("x-table-row");for(var b=a.length,c=0;;)if(c<b){var d=a[c];$APP.ed(c+1,2)===0?d.setAttribute("data-stripe","even"):d.removeAttribute("data-stripe");c+=1}else break},pH=function(a){var b=nH(a);if($APP.N($APP.k(a,"__xTableModel"),b)){b=$APP.M(b);var c=$APP.D(b,$APP.dl),d=$APP.D(b,kH),e=$APP.D(b,lH),g=$APP.D(b,$APP.tl),h=$APP.D(b,fH),l=$APP.D(b,gH),m=$APP.D(b,hH),p=$APP.D(b,mH),r=bH(a);r=$APP.M(r);r=$APP.D(r,aH);a.style.gridTemplateColumns=$APP.n(c)?
6
+ c:"";a.setAttribute("role",$APP.B.i(e,"none")?"table":"grid");c=$APP.B.i(e,"multi")?"true":null;$APP.n(c)?a.setAttribute("aria-multiselectable",c):a.removeAttribute("aria-multiselectable");p!=null?a.setAttribute("aria-rowcount",""+$APP.S.g(p)):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(l)?a.setAttribute("data-full-width",""):a.removeAttribute("data-full-width");$APP.n(m)?a.setAttribute("data-compact",""):a.removeAttribute("data-compact");$APP.n(g)&&oH(a);a.__xTableModel=b}},sH=function(a){function b(){var e=$APP.k(a,"__xTableModel");e=$APP.n(e)?e:nH(a);$APP.n($APP.tl.g(e))&&oH(a);return null}function c(e){var g=$APP.k(a,"__xTableModel");g=$APP.n(g)?g:nH(a);
8
+ var h=lH.g(g);if($APP.N(h,"none"))if(g=e.target,e=$APP.k(e.detail,"rowIndex"),e=$APP.Zh(new $APP.Q(null,3,[$APP.bk,$APP.n(e)?e:0,$APP.Gk,$APP.q(g.hasAttribute("selected")),qH,h],null)),a.dispatchEvent(new CustomEvent("x-table-row-select",{detail:e,bubbles:!0,composed:!0,cancelable:!0})),$APP.B.i(h,"single")){e=g.hasAttribute("selected");h=a.querySelectorAll("x-table-row[selected]");for(var l=h.length,m=0;;)if(m<l)h[m].removeAttribute("selected"),m+=1;else break;$APP.n(e)||g.setAttribute("selected",
9
+ "")}else $APP.B.i(h,"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.k(e.detail,"direction"),l=$APP.k(e.detail,"previousDirection");g>=0&&(e.stopPropagation(),e=$APP.Zh(new $APP.Q(null,3,[rH,g,$APP.Lj,h,$APP.$m,l],null)),a.dispatchEvent(new CustomEvent("x-table-sort",{detail:e,bubbles:!0,composed:!0,cancelable:!0})));
10
+ return null}a.addEventListener("x-table-cell-sort",d);a.addEventListener("x-table-row-click",c);a.addEventListener("x-table-row-connected",b);$APP.ja(a,"__xTableHandlers",{sort:d,"row-click":c,"row-conn":b})},tH=function(a){var b=$APP.k(a,"__xTableHandlers");if($APP.n(b)){var c=$APP.k(b,"sort"),d=$APP.k(b,"row-click");b=$APP.k(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",
11
+ b)}a.__xTableHandlers=null},uH=function(a){Object.defineProperty(a,"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")},
12
+ enumerable:!0,configurable:!0});Object.defineProperty(a,"selectable",{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});
13
13
  Object.defineProperty(a,"bordered",{get:function(){return this.hasAttribute("bordered")},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")},
14
- set:function(b){return $APP.n(b)?this.setAttribute("full-width",""):this.removeAttribute("full-width")},enumerable:!0,configurable:!0});Object.defineProperty(a,"rowCount",{get:function(){return aG(this.getAttribute("row-count"))},set:function(b){return b==null?this.removeAttribute("row-count"):this.setAttribute("row-count",""+$APP.T.g(Math.floor(b)))},enumerable:!0,configurable:!0})},xG=function(){var a=class extends HTMLElement{};a.observedAttributes=wG;a.prototype.connectedCallback=function(){cG(this);
15
- uG(this);tG(this);qG(this);return null};a.prototype.disconnectedCallback=function(){uG(this);return null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&qG(this);return null};vG(a.prototype);return a},yG=function(){$APP.n(customElements.get("x-table"))||customElements.define("x-table",xG());return null},hG=new $APP.K(null,"full-width?","full-width?",1477288349),jG=new $APP.K(null,"row-count-raw","row-count-raw",-1432781274),fG=new $APP.K(null,"selectable-raw","selectable-raw",-1276314763),
16
- sG=new $APP.K(null,"colIndex","colIndex",171239635),nG=new $APP.K(null,"row-count","row-count",1060167988),eG=new $APP.K(null,"caption-raw","caption-raw",-375935083),rG=new $APP.K(null,"selectionMode","selectionMode",1264773367),dG=new $APP.K(null,"columns-raw","columns-raw",-2093994046),mG=new $APP.K(null,"selectable","selectable",370587038),lG=new $APP.K(null,"caption","caption",-855383902),gG=new $APP.K(null,"bordered?","bordered?",562358476),bG=new $APP.K(null,"caption-div","caption-div",1485363333),
17
- iG=new $APP.K(null,"compact?","compact?",1216893298);var wG="columns caption selectable striped bordered full-width compact row-count".split(" ");$APP.Pd(["x-table-sort",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,3,[sG,$APP.W,$APP.tj,$APP.Y,$APP.Im,$APP.Y],null),$APP.lm,!0],null),"x-table-row-select",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,3,[$APP.Jj,$APP.W,$APP.ok,$APP.Zj,rG,$APP.Y],null),$APP.lm,!0],null)]);var kG=new $APP.S(null,new $APP.Q(null,3,["none",null,"single",null,"multi",null],null),null);$APP.ha("baredom.exports.x_table.init",yG);export const init=yG;
14
+ set:function(b){return $APP.n(b)?this.setAttribute("full-width",""):this.removeAttribute("full-width")},enumerable:!0,configurable:!0});return Object.defineProperty(a,"rowCount",{get:function(){return $G(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})},vH=function(a){bH(a);tH(a);sH(a);pH(a);return null},wH=function(a){tH(a);return null},xH=function(a,b,c,d){$APP.N(c,
15
+ d)&&pH(a);return null},zH=function(){return $APP.Lg("x-table",new $APP.Q(null,5,[$APP.Cg,yH,$APP.Dg,vH,$APP.Eg,wH,$APP.Fg,xH,$APP.Jg,uH],null))},gH=new $APP.K(null,"full-width?","full-width?",1477288349),iH=new $APP.K(null,"row-count-raw","row-count-raw",-1432781274),eH=new $APP.K(null,"selectable-raw","selectable-raw",-1276314763),rH=new $APP.K(null,"colIndex","colIndex",171239635),mH=new $APP.K(null,"row-count","row-count",1060167988),dH=new $APP.K(null,"caption-raw","caption-raw",-375935083),qH=
16
+ new $APP.K(null,"selectionMode","selectionMode",1264773367),cH=new $APP.K(null,"columns-raw","columns-raw",-2093994046),lH=new $APP.K(null,"selectable","selectable",370587038),kH=new $APP.K(null,"caption","caption",-855383902),fH=new $APP.K(null,"bordered?","bordered?",562358476),aH=new $APP.K(null,"caption-div","caption-div",1485363333),hH=new $APP.K(null,"compact?","compact?",1216893298);var yH="columns caption selectable striped bordered full-width compact row-count".split(" ");$APP.Pd(["x-table-sort",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,3,[rH,$APP.W,$APP.Lj,$APP.Y,$APP.$m,$APP.Y],null),$APP.Km,!0],null),"x-table-row-select",new $APP.Q(null,2,[$APP.V,new $APP.Q(null,3,[$APP.bk,$APP.W,$APP.Gk,$APP.uk,qH,$APP.Y],null),$APP.Km,!0],null)]);var jH=new $APP.R(null,new $APP.Q(null,3,["none",null,"single",null,"multi",null],null),null);$APP.ha("baredom.exports.x_table.init",zH);export const init=zH;
package/dist/x-tabs.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { $APP, shadow$provide } from "./base.js";
2
- var qJ=function(a){var b=$APP.M(a);a=$APP.D(b,$APP.Yi);var c=$APP.D(b,$APP.rl),d=$APP.D(b,nJ),e=$APP.D(b,$APP.U);b=$APP.D(b,$APP.Jm);c=$APP.I(oJ,c)?c:"horizontal";d=$APP.I(pJ,d)?d:"auto";return new $APP.Q(null,5,[$APP.Yi,a,$APP.rl,c,nJ,d,$APP.U,e,$APP.Jm,$APP.F(b)],null)},rJ=function(a){return new $APP.Q(null,5,[$APP.Yi,a.getAttribute("value"),$APP.rl,a.getAttribute("orientation"),nJ,a.getAttribute("activation"),$APP.U,a.getAttribute("label"),$APP.Jm,a.hasAttribute("loop")],null)},sJ=function(a){return $APP.xe($APP.de(function(b){return $APP.B.i("X-TAB",
3
- b.tagName)},$APP.uc(a.children)))},tJ=function(a){return $APP.r(a.hasAttribute("disabled"))},uJ=function(a){return a.getAttribute("value")},vJ=function(a){return $APP.Td(function(b){return tJ(b)?b:null},a)},wJ=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.B.i(b,""),$APP.n(b?c:b)&&a.removeAttribute("value"))},xJ=function(a,b){var c=a.hasAttribute("selected");$APP.n($APP.n(b)?$APP.r(c):b)?a.setAttribute("selected",""):(b=$APP.r(b),
4
- $APP.n(b?c:b)&&a.removeAttribute("selected"))},yJ=function(a,b){var c=a.getAttribute("tabindex");$APP.N(c,b)&&a.setAttribute("tabindex",b)},zJ=function(a,b){a=a.getAttribute("controls");$APP.n($APP.n(a)?$APP.N(a,""):a)&&(a=document.getElementById(a),$APP.n(a)&&($APP.n(b)?a.removeAttribute("hidden"):a.setAttribute("hidden","")))},AJ=function(a){var b=sJ(a),c=a.getAttribute("value"),d=$APP.Xf($APP.Yd(uJ,b));$APP.n($APP.n(c)?$APP.I(d,c):c)||(c=vJ(b),c=$APP.n(c)?uJ(c):null);if($APP.n(c)){a:{d=$APP.t(b);
5
- for(var e=null,g=0,h=0;;)if(h<g){var l=e.F(null,h),m=$APP.B.i(uJ(l),c);xJ(l,m);m&&tJ(l)?yJ(l,"0"):yJ(l,"-1");h+=1}else if(d=$APP.t(d))$APP.Nc(d)?(e=$APP.yb(d),d=$APP.zb(d),l=e,g=$APP.z(e),e=l):(l=$APP.u(d),e=$APP.B.i(uJ(l),c),xJ(l,e),e&&tJ(l)?yJ(l,"0"):yJ(l,"-1"),d=$APP.w(d),e=null,g=0),h=0;else break a}a:for(b=$APP.t(b),d=null,g=e=0;;)if(g<e)l=d.F(null,g),zJ(l,$APP.B.i(uJ(l),c)),g+=1;else if(b=$APP.t(b))d=b,$APP.Nc(d)?(b=$APP.yb(d),e=$APP.zb(d),d=b,l=$APP.z(b),b=e,e=l):(l=$APP.u(d),zJ(l,$APP.B.i(uJ(l),
6
- c)),b=$APP.w(d),d=null,e=0),g=0;else break a;wJ(a,c)}return c},BJ=function(a,b){var c=a.getAttribute("value"),d;if(d=$APP.n($APP.n(b)?$APP.N(c,b):b))c=new CustomEvent("value-change-request",{detail:{value:b,previousValue:$APP.n(c)?c:""},bubbles:!0,composed:!0,cancelable:!0}),a.dispatchEvent(c),d=$APP.r(c.defaultPrevented);return d?(wJ(a,b),AJ(a),a.dispatchEvent(new CustomEvent("value-change",{detail:{value:$APP.n(b)?b:""},bubbles:!0,composed:!0}))):null},CJ=function(a,b,c){b=$APP.z(b)-1;var d=a+1;
7
- return d<=b?d:$APP.n(c)?0:a},DJ=function(a,b,c){var d=a-1;b=$APP.z(b)-1;return d>=0?d:$APP.n(c)?b:a},EJ=function(a){var b=$APP.k(a,"__x_tabs_base"),c=qJ(rJ(a));$APP.n(b)&&(b.setAttribute("role","tablist"),b.setAttribute("aria-orientation",$APP.rl.g(c)),c=$APP.U.g(c),$APP.n($APP.n(c)?$APP.N(c,""):c)?b.setAttribute("aria-label",c):b.removeAttribute("aria-label"));return AJ(a)},FJ=function(a){var b=new MutationObserver(function(){return EJ(a)});b.observe(a,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value",
8
- "selected","disabled","controls"]});a.__x_tabs_observer=b},GJ=function(a){function b(d){a:{var e=$APP.xe($APP.de(tJ,sJ(a))),g=qJ(rJ(a)),h=$APP.rl.g(g);var l=nJ.g(g);g=$APP.Jm.g(g);var m=d.key,p=e.indexOf(document.activeElement);if(p>=0&&(h=$APP.B.i(h,"horizontal")&&$APP.B.i(m,"ArrowRight")?CJ(p,e,g):$APP.B.i(h,"horizontal")&&$APP.B.i(m,"ArrowLeft")?DJ(p,e,g):$APP.B.i(h,"vertical")&&$APP.B.i(m,"ArrowDown")?CJ(p,e,g):$APP.B.i(h,"vertical")&&$APP.B.i(m,"ArrowUp")?DJ(p,e,g):$APP.B.i(m,"Home")?0:$APP.B.i(m,
9
- "End")?$APP.z(e)-1:null,h!=null)){d.preventDefault();d=$APP.Ac(e,h,null);$APP.n(d)?d.focus():d=null;l=$APP.n(d)?$APP.B.i(l,"auto")?BJ(a,uJ(d)):null:null;break a}l=null}return l}function c(d){d.stopPropagation();return BJ(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;FJ(a)},HJ=function(a){Object.defineProperty(a.prototype,"value",{get:function(){return this.getAttribute("value")},set:function(b){return $APP.n(b)?
10
- this.setAttribute("value",b):this.removeAttribute("value")},configurable:!0,enumerable:!0})},JJ=function(){var a=class extends HTMLElement{};a.observedAttributes=IJ;a.prototype.connectedCallback=function(){if($APP.Dg(this,"__x_tabs_initialized")){GJ(this);var b=EJ(this)}else{if(!$APP.Dg(this,"__x_tabs_initialized")){b=this.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("slot");c.textContent=":host{display:block;color-scheme:light dark;}.base{display:flex;flex-direction:row;}.base[aria-orientation\x3d'vertical']{flex-direction:column;}::slotted(x-tab){margin-inline-end:var(--x-tabs-gap,8px);}:host([orientation\x3d'vertical']) ::slotted(x-tab){margin-inline-end:0;margin-block-end:var(--x-tabs-gap,8px);}";
11
- 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;GJ(this);this.__x_tabs_initialized=!0}EJ(this);b=this}return b};a.prototype.disconnectedCallback=function(){var b=$APP.k(this,"__x_tabs_on_tab_select");$APP.n(b)&&this.removeEventListener("tab-select",b);b=$APP.k(this,"__x_tabs_on_keydown");$APP.n(b)&&this.removeEventListener("keydown",b);b=$APP.k(this,"__x_tabs_observer");return $APP.n(b)?
12
- b.disconnect():null};a.prototype.attributeChangedCallback=function(){return $APP.Dg(this,"__x_tabs_initialized")?EJ(this):null};HJ(a);return a},KJ=function(){return $APP.n(customElements.get("x-tabs"))?null:customElements.define("x-tabs",JJ())},nJ=new $APP.K(null,"activation","activation",2128521072);var IJ=["value","orientation","activation","label","loop"],oJ=new $APP.S(null,new $APP.Q(null,2,["vertical",null,"horizontal",null],null),null),pJ=new $APP.S(null,new $APP.Q(null,2,["auto",null,"manual",null],null),null);$APP.Pd(["value-change-request",new $APP.Q(null,2,[$APP.lm,!0,$APP.V,new $APP.Q(null,2,[$APP.Yi,$APP.Y,$APP.Tk,$APP.Y],null)],null),"value-change",new $APP.Q(null,1,[$APP.V,new $APP.Q(null,1,[$APP.Yi,$APP.Y],null)],null)]);$APP.ha("baredom.exports.x_tabs.init",KJ);export const init=KJ;
2
+ var XK=function(a){var b=$APP.M(a);a=$APP.D(b,$APP.pj);var c=$APP.D(b,$APP.Jl),d=$APP.D(b,UK),e=$APP.D(b,$APP.T);b=$APP.D(b,$APP.an);c=$APP.I(VK,c)?c:"horizontal";d=$APP.I(WK,d)?d:"auto";return new $APP.Q(null,5,[$APP.pj,a,$APP.Jl,c,UK,d,$APP.T,e,$APP.an,$APP.F(b)],null)},YK=function(a){return new $APP.Q(null,5,[$APP.pj,a.getAttribute("value"),$APP.Jl,a.getAttribute("orientation"),UK,a.getAttribute("activation"),$APP.T,a.getAttribute("label"),$APP.an,a.hasAttribute("loop")],null)},ZK=function(a){return $APP.xe($APP.ce(function(b){return $APP.B.i("X-TAB",
3
+ b.tagName)},$APP.uc(a.children)))},$K=function(a){return $APP.q(a.hasAttribute("disabled"))},aL=function(a){return a.getAttribute("value")},bL=function(a){return $APP.Td(function(b){return $K(b)?b:null},a)},cL=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.B.i(b,""),$APP.n(b?c:b)&&a.removeAttribute("value"))},dL=function(a,b){var c=a.hasAttribute("selected");$APP.n($APP.n(b)?$APP.q(c):b)?a.setAttribute("selected",""):(b=$APP.q(b),
4
+ $APP.n(b?c:b)&&a.removeAttribute("selected"))},eL=function(a,b){var c=a.getAttribute("tabindex");$APP.N(c,b)&&a.setAttribute("tabindex",b)},fL=function(a,b){a=a.getAttribute("controls");$APP.n($APP.n(a)?$APP.N(a,""):a)&&(a=document.getElementById(a),$APP.n(a)&&($APP.n(b)?a.removeAttribute("hidden"):a.setAttribute("hidden","")))},gL=function(a){var b=ZK(a),c=a.getAttribute("value"),d=$APP.Xf($APP.Xd(aL,b));$APP.n($APP.n(c)?$APP.I(d,c):c)||(c=bL(b),c=$APP.n(c)?aL(c):null);if($APP.n(c)){a:{d=$APP.t(b);
5
+ for(var e=null,g=0,h=0;;)if(h<g){var l=e.F(null,h),m=$APP.B.i(aL(l),c);dL(l,m);m&&$K(l)?eL(l,"0"):eL(l,"-1");h+=1}else if(d=$APP.t(d))$APP.Nc(d)?(e=$APP.xb(d),d=$APP.yb(d),l=e,g=$APP.z(e),e=l):(l=$APP.u(d),e=$APP.B.i(aL(l),c),dL(l,e),e&&$K(l)?eL(l,"0"):eL(l,"-1"),d=$APP.w(d),e=null,g=0),h=0;else break a}a:for(b=$APP.t(b),d=null,g=e=0;;)if(g<e)l=d.F(null,g),fL(l,$APP.B.i(aL(l),c)),g+=1;else if(b=$APP.t(b))d=b,$APP.Nc(d)?(b=$APP.xb(d),e=$APP.yb(d),d=b,l=$APP.z(b),b=e,e=l):(l=$APP.u(d),fL(l,$APP.B.i(aL(l),
6
+ c)),b=$APP.w(d),d=null,e=0),g=0;else break a;cL(a,c)}return c},hL=function(a,b){var c=a.getAttribute("value");return $APP.n($APP.n(b)?$APP.N(c,b):b)&&$APP.Rg(a,"value-change-request",{value:b,previousValue:$APP.n(c)?c:""})?(cL(a,b),gL(a),a.dispatchEvent(new CustomEvent("value-change",{detail:{value:$APP.n(b)?b:""},bubbles:!0,composed:!0}))):null},iL=function(a,b,c){b=$APP.z(b)-1;var d=a+1;return d<=b?d:$APP.n(c)?0:a},jL=function(a,b,c){var d=a-1;b=$APP.z(b)-1;return d>=0?d:$APP.n(c)?b:a},kL=function(a){var b=
7
+ $APP.k(a,"__x_tabs_base"),c=XK(YK(a));$APP.n(b)&&(b.setAttribute("role","tablist"),b.setAttribute("aria-orientation",$APP.Jl.g(c)),c=$APP.T.g(c),$APP.n($APP.n(c)?$APP.N(c,""):c)?b.setAttribute("aria-label",c):b.removeAttribute("aria-label"));return gL(a)},lL=function(a){var b=new MutationObserver(function(){return kL(a)});b.observe(a,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value","selected","disabled","controls"]});a.__x_tabs_observer=b},mL=function(a){function b(d){a:{var e=$APP.xe($APP.ce($K,
8
+ ZK(a))),g=XK(YK(a)),h=$APP.Jl.g(g);var l=UK.g(g);g=$APP.an.g(g);var m=d.key,p=e.indexOf(document.activeElement);if(p>=0&&(h=$APP.B.i(h,"horizontal")&&$APP.B.i(m,"ArrowRight")?iL(p,e,g):$APP.B.i(h,"horizontal")&&$APP.B.i(m,"ArrowLeft")?jL(p,e,g):$APP.B.i(h,"vertical")&&$APP.B.i(m,"ArrowDown")?iL(p,e,g):$APP.B.i(h,"vertical")&&$APP.B.i(m,"ArrowUp")?jL(p,e,g):$APP.B.i(m,"Home")?0:$APP.B.i(m,"End")?$APP.z(e)-1:null,h!=null)){d.preventDefault();d=$APP.Ac(e,h,null);$APP.n(d)?d.focus():d=null;l=$APP.n(d)?
9
+ $APP.B.i(l,"auto")?hL(a,aL(d)):null:null;break a}l=null}return l}function c(d){d.stopPropagation();return hL(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;lL(a)},nL=function(a){if($APP.Ng(a,"__x_tabs_initialized"))return mL(a),kL(a);if(!$APP.Ng(a,"__x_tabs_initialized")){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("slot");c.textContent=
10
+ ":host{display:block;color-scheme:light dark;}.base{display:flex;flex-direction:row;}.base[aria-orientation\x3d'vertical']{flex-direction:column;}::slotted(x-tab){margin-inline-end:var(--x-tabs-gap,8px);}:host([orientation\x3d'vertical']) ::slotted(x-tab){margin-inline-end:0;margin-block-end:var(--x-tabs-gap,8px);}";d.setAttribute("part","base");d.className="base";d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__x_tabs_root=b;a.__x_tabs_base=d;a.__x_tabs_slot=e;mL(a);a.__x_tabs_initialized=
11
+ !0}kL(a);return a},oL=function(a){var b=$APP.k(a,"__x_tabs_on_tab_select");$APP.n(b)&&a.removeEventListener("tab-select",b);b=$APP.k(a,"__x_tabs_on_keydown");$APP.n(b)&&a.removeEventListener("keydown",b);a=$APP.k(a,"__x_tabs_observer");return $APP.n(a)?a.disconnect():null},pL=function(a){return $APP.Ng(a,"__x_tabs_initialized")?kL(a):null},qL=function(a){return Object.defineProperty(a,"value",{get:function(){return this.getAttribute("value")},set:function(b){return $APP.n(b)?this.setAttribute("value",
12
+ b):this.removeAttribute("value")},configurable:!0,enumerable:!0})},sL=function(){return $APP.Lg("x-tabs",new $APP.Q(null,5,[$APP.Cg,rL,$APP.Dg,nL,$APP.Eg,oL,$APP.Fg,pL,$APP.Jg,qL],null))},UK=new $APP.K(null,"activation","activation",2128521072);var rL=["value","orientation","activation","label","loop"],VK=new $APP.R(null,new $APP.Q(null,2,["vertical",null,"horizontal",null],null),null),WK=new $APP.R(null,new $APP.Q(null,2,["auto",null,"manual",null],null),null);$APP.Pd(["value-change-request",new $APP.Q(null,2,[$APP.Km,!0,$APP.V,new $APP.Q(null,2,[$APP.pj,$APP.Y,$APP.kl,$APP.Y],null)],null),"value-change",new $APP.Q(null,1,[$APP.V,new $APP.Q(null,1,[$APP.pj,$APP.Y],null)],null)]);$APP.ha("baredom.exports.x_tabs.init",sL);export const init=sL;