lituix 0.1.30 → 0.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/components.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$comment": "Generated by scripts/generate-llm-docs.mjs from source. Do not edit by hand; run pnpm docs:llm.",
3
3
  "package": "lituix",
4
- "version": "0.1.30",
4
+ "version": "0.1.32",
5
5
  "generatedFrom": {
6
6
  "components": "src/components",
7
7
  "stories": "stories"
@@ -73,6 +73,7 @@ export declare class LuiButtonGroup extends LitElement {
73
73
  private _resizeObserver?;
74
74
  private _layoutFrame;
75
75
  private _indicatorFrame;
76
+ private _indicatorLastKey;
76
77
  private _observedParent?;
77
78
  private _applyInheritedItemProp;
78
79
  connectedCallback(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"lui-button-group.d.ts","sourceRoot":"","sources":["../../src/components/lui-button-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAW,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAI1E,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,yBAAyB,CAAC;AACjC,OAAO,cAAc,CAAC;AACtB,OAAO,gBAAgB,CAAC;AACxB,OAAO,YAAY,CAAC;AAEpB,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAOD,MAAM,WAAW,+BAA+B;IAC9C,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,C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AIxB;IAEF,OAAO,CAAC,mBAAmB,CAKzB;IAEF,OAAO,CAAC,iBAAiB,CAEvB;IAEF,OAAO,CAAC,sBAAsB;IAM9B,OAAO,CAAC,gBAAgB;IAqBxB,MAAM;CAmEP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
@@ -2219,7 +2219,7 @@
2219
2219
  .submenu-chevron lui-icon {
2220
2220
  --lui-icon-size: 16px;
2221
2221
  }
2222
- `],s([h({attribute:!1})],Le.prototype,"items",2),s([h()],Le.prototype,"placement",2),s([h()],Le.prototype,"trigger",2),s([h({type:Boolean,attribute:"close-on-select"})],Le.prototype,"closeOnSelect",2),s([h({type:Boolean})],Le.prototype,"disabled",2),s([h()],Le.prototype,"heading",2),s([h({attribute:"heading-icon"})],Le.prototype,"headingIcon",2),s([h({type:Boolean,attribute:"show-arrow"})],Le.prototype,"showArrow",2),s([h({type:Boolean,attribute:"close-on-outside-press"})],Le.prototype,"closeOnOutsidePress",2),s([h({type:Boolean,attribute:"close-on-esc"})],Le.prototype,"closeOnEsc",2),s([h({type:Boolean,reflect:!0})],Le.prototype,"open",2),s([h({type:Number,attribute:"open-delay"})],Le.prototype,"openDelay",2),s([h({type:Number,attribute:"close-delay"})],Le.prototype,"closeDelay",2),s([h({type:Number,attribute:"offset"})],Le.prototype,"offsetDistance",2),s([h({reflect:!0})],Le.prototype,"backdrop",2),s([h({attribute:"backdrop-style"})],Le.prototype,"backdropStyle",2),s([h({type:Boolean})],Le.prototype,"portal",2),s([h({type:Boolean,attribute:"same-width"})],Le.prototype,"sameWidth",2),s([h({type:Number,attribute:"max-width"})],Le.prototype,"maxWidth",2),s([h({type:Number,attribute:"max-height"})],Le.prototype,"maxHeight",2),s([h({attribute:!1})],Le.prototype,"dropdownProps",2),s([h({attribute:!1})],Le.prototype,"menuProps",2),s([h({reflect:!0,attribute:"submenu-trigger"})],Le.prototype,"submenuTrigger",2),s([h({attribute:"submenu-icon"})],Le.prototype,"submenuIcon",2),s([G("lui-dropdown")],Le.prototype,"_dropdown",2),s([ro("lui-menu")],Le.prototype,"_menus",2),s([G('slot[name="trigger"]')],Le.prototype,"_triggerSlot",2),s([Y()],Le.prototype,"_submenuPlacements",2),Le=s([L("lui-dropmenu")],Le);var et=class extends N{constructor(){super(...arguments);this.selection="none";this.values=[];this.variant="default";this.size="md";this.radius="md";this.vertical=!1;this.disabled=!1;this.ripple=!1;this.block=!1;this.collapse="none";this.overflowLabel="\u66F4\u591A";this.overflowIcon="more-horizontal";this.overflowPlacement="bottom-end";this.overflowTriggerWidth=0;this.overflowTriggerProps={};this.items=[];this._overflowIndexes=[];this._activeInteractionIndex=-1;this._layoutFrame=0;this._indicatorFrame=0;this._onItemActivate=e=>{let t=e.detail?.item,o=e.detail?.value??t?.value??"";t&&this._commitItemActivation(t,o)};this._onSlotChange=()=>{this.items.length>0||(this._syncItems(),this._scheduleLayout())};this._onOverflowSelect=e=>{let t=Number(e.detail?.value),o=this._collectItems()[t];if(!o||o.item.disabled)return;let n=o.element;n!==o.item&&typeof n.trigger=="function"&&n.trigger(),o.item.trigger()};this._onGroupPointerOver=e=>{let t=e.composedPath(),n=this._collectItems().findIndex(({element:a,item:l})=>t.includes(a)||t.includes(l));this._setInteractionIndex(n)};this._onGroupPointerOut=e=>{let t=e.relatedTarget;t&&this._groupEl?.contains(t)||this._clearInteractionIndex()};this._onGroupPointerDown=e=>{let t=e.composedPath(),n=this._collectItems().findIndex(({element:a,item:l})=>t.includes(a)||t.includes(l));this._setInteractionIndex(n)};this._onGroupPointerUp=()=>{this._clearInteractionIndex()}}_applyInheritedItemProp(e,t,o){let n=`data-lui-button-group-${t}`;e.hasAttribute(t)&&!e.hasAttribute(n)||(e[t]=o,e.setAttribute(n,""))}connectedCallback(){super.connectedCallback(),this.addEventListener("button-group-item-activate",this._onItemActivate),this._resizeObserver=new ResizeObserver(()=>this._scheduleLayout())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("button-group-item-activate",this._onItemActivate),this._resizeObserver?.disconnect(),this._observedParent=void 0,this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame)}firstUpdated(){this._groupEl&&this._resizeObserver?.observe(this._groupEl),this._resizeObserver?.observe(this),this.parentElement&&(this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._scheduleLayout()}updated(e){this.parentElement&&this.parentElement!==this._observedParent&&(this._observedParent&&this._resizeObserver?.unobserve(this._observedParent),this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._syncItems(),this._syncOverflowTriggerProps(),(e.has("items")||e.has("collapse")||e.has("vertical")||e.has("block")||e.has("size")||e.has("radius")||e.has("overflowTriggerWidth"))&&this._scheduleLayout()}_collectItems(){return this.items.length>0?Array.from(this.renderRoot.querySelectorAll('lui-button-group-item[data-lui-generated="true"]')).map(e=>({element:e,item:e})):(this._assignedElements??[]).map(e=>{if(e.tagName.toLowerCase()==="lui-button-group-item")return{element:e,item:e};let t=e.shadowRoot?.querySelector("lui-button-group-item");return t?{element:e,item:t}:null}).filter(e=>!!e)}_syncItems(){let e=this._collectItems(),t=this._resolvedValues(),o=e.map((d,p)=>p).filter(d=>!this._overflowIndexes.includes(d)),n=this._overflowIndexes.length>0,a=this._usesSelectionIndicator(),l=new Set(o.filter(d=>t.includes(e[d]?.item.value??"")));e.forEach(({element:d,item:p},f)=>{let b=o.indexOf(f),k=b>0?o[b-1]:-1;p.grouped=!0,p.first=o[0]===f,p.last=!n&&o[o.length-1]===f,p.vertical=this.vertical,p.dividerHidden=a&&(l.has(f)||l.has(k)),p.interactionActive=this._activeInteractionIndex===f||k===this._activeInteractionIndex,this._applyInheritedItemProp(p,"variant",this.variant),this._applyInheritedItemProp(p,"size",this.size),this._applyInheritedItemProp(p,"radius",this.radius),this._applyInheritedItemProp(p,"ripple",this.ripple),this.disabled?(p.disabled||p.setAttribute("data-lui-button-group-disabled",""),p.disabled=!0):p.hasAttribute("data-lui-button-group-disabled")&&(p.removeAttribute("data-lui-button-group-disabled"),p.disabled=!1),(this.selection!=="none"||!p.hasAttribute("pressed"))&&(p.pressed=t.includes(p.value)),p.indicatorSelected=this._usesSelectionIndicator()&&p.pressed&&!this._overflowIndexes.includes(f),d.toggleAttribute("data-overflow-hidden",this._overflowIndexes.includes(f))})}_resolvedValues(){return this.selection==="single"?this.value?[this.value]:[]:this.selection==="multiple"?this.values.slice():this._collectItems().filter(({item:e})=>e.pressed).map(({item:e})=>e.value)}_readOverflowIcon(e,t){return e.getAttribute("icon")||t.getAttribute("icon")||t.querySelector('lui-icon[slot="prefix"], [slot="prefix"][name]')?.getAttribute("name")||e.shadowRoot?.querySelector('lui-button-group-item lui-icon[slot="prefix"], lui-button-group-item [slot="prefix"][name]')?.getAttribute("name")||void 0||void 0}_syncOverflowTriggerProps(){this._overflowTriggerButton&&Se(this._overflowTriggerButton,this.overflowTriggerProps)}_readOverflowLabel(e,t,o){let n=e.getAttribute("label")||t.getAttribute("label")||e.getAttribute("aria-label")||t.getAttribute("aria-label")||e.getAttribute("title")||t.getAttribute("title"),a=t.textContent?.trim()||e.textContent?.trim();return n||a||t.value||`item-${o}`}_overflowItems(){let e=this._collectItems();return this._overflowIndexes.flatMap(t=>{let o=e[t];if(!o)return[];let{element:n,item:a}=o;return[{key:String(t),value:String(t),label:this._readOverflowLabel(n,a,t),icon:this._readOverflowIcon(n,a),disabled:a.disabled,active:this.selection==="single"&&a.pressed,checked:this.selection!=="single"&&a.pressed}]})}_scheduleLayout(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._recomputeLayout(),this._scheduleSelectionIndicatorLayout()})}_usesSelectionIndicator(){return this.selection==="single"&&!this.vertical}_scheduleSelectionIndicatorLayout(){this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._indicatorFrame=requestAnimationFrame(()=>{this._indicatorFrame=0,this._updateSelectionIndicator()})}_updateSelectionIndicator(){let e=this._groupEl;if(!e||!this._usesSelectionIndicator()){e?.style.setProperty("--lui-button-group-indicator-opacity","0");return}let o=this._collectItems().find((l,d)=>l.item.pressed&&!this._overflowIndexes.includes(d));if(!o){e.style.setProperty("--lui-button-group-indicator-opacity","0");return}let n=e.getBoundingClientRect(),a=o.element.getBoundingClientRect();e.style.setProperty("--lui-button-group-indicator-x",`${a.left-n.left+e.scrollLeft}px`),e.style.setProperty("--lui-button-group-indicator-y",`${a.top-n.top+e.scrollTop}px`),e.style.setProperty("--lui-button-group-indicator-width",`${a.width}px`),e.style.setProperty("--lui-button-group-indicator-height",`${a.height}px`),e.style.setProperty("--lui-button-group-indicator-radius",getComputedStyle(o.item).getPropertyValue("--lui-button-group-item-radius")||"0px"),e.style.setProperty("--lui-button-group-indicator-opacity","1")}_getContainerWidth(){let e=Math.round(this.getBoundingClientRect().width),t=this._groupEl?.clientWidth??0,o=this.parentElement?.getBoundingClientRect(),n=Math.round(o?.width??0),a=o?Math.max(0,Math.round(o.right-this.getBoundingClientRect().left)):0,l=this.style.width.trim().length>0;return this.block||l?e||t||n:a||n||e||t}_defaultOverflowTriggerWidth(){let e=Number.parseFloat(getComputedStyle(this).getPropertyValue("--lui-button-height"));return Number.isFinite(e)&&e>0?Math.round(e):this.overflowTriggerWidth>0?this.overflowTriggerWidth:this.size==="sm"?32:this.size==="lg"?44:38}_readItemWidth(e){let t=e.getBoundingClientRect().width,o=Math.ceil(t||e.scrollWidth||e.offsetWidth||0);return Math.max(0,o)}_setOverflowIndexes(e){if(!(e.length!==this._overflowIndexes.length||e.some((o,n)=>o!==this._overflowIndexes[n]))){this._syncItems(),this._scheduleSelectionIndicatorLayout();return}this._overflowIndexes=e,this._syncItems(),this._scheduleSelectionIndicatorLayout()}_recomputeLayout(){if(this.collapse!=="auto"||this.vertical){this._setOverflowIndexes([]);return}let e=this._collectItems(),t=this._getContainerWidth();if(!e.length||!t){this._setOverflowIndexes([]);return}let o=e.map(({element:a})=>this._readItemWidth(a)),n=Gp({itemWidths:o,containerWidth:t,overflowTriggerWidth:this._defaultOverflowTriggerWidth(),minVisibleItems:0});this._setOverflowIndexes(n.overflowIndexes)}_commitItemActivation(e,t=e.value){if(e){if(this.selection!=="none"){let o=Yp({selection:this.selection,currentValue:this.value,currentValues:this.values,nextValue:t});this.value=o.value,this.values=o.values,this._syncItems(),this._scheduleSelectionIndicatorLayout()}this.dispatchEvent(new CustomEvent("change",{detail:{value:this.selection==="multiple"?void 0:this.value,values:this._resolvedValues(),item:e},bubbles:!0,composed:!0})),this.items.find(o=>o.value===t)?.onClick?.(this.items.find(o=>o.value===t))}}_setInteractionIndex(e){this._activeInteractionIndex!==e&&(this._activeInteractionIndex=e,this._syncItems())}_clearInteractionIndex(){this._activeInteractionIndex<0||(this._activeInteractionIndex=-1,this._syncItems())}_overflowTriggerRadius(){return this._overflowIndexes.length<this._collectItems().length?"0 var(--lui-button-group-radius) var(--lui-button-group-radius) 0":"var(--lui-button-group-radius)"}_renderDataItems(){return this.items.map(e=>v`
2222
+ `],s([h({attribute:!1})],Le.prototype,"items",2),s([h()],Le.prototype,"placement",2),s([h()],Le.prototype,"trigger",2),s([h({type:Boolean,attribute:"close-on-select"})],Le.prototype,"closeOnSelect",2),s([h({type:Boolean})],Le.prototype,"disabled",2),s([h()],Le.prototype,"heading",2),s([h({attribute:"heading-icon"})],Le.prototype,"headingIcon",2),s([h({type:Boolean,attribute:"show-arrow"})],Le.prototype,"showArrow",2),s([h({type:Boolean,attribute:"close-on-outside-press"})],Le.prototype,"closeOnOutsidePress",2),s([h({type:Boolean,attribute:"close-on-esc"})],Le.prototype,"closeOnEsc",2),s([h({type:Boolean,reflect:!0})],Le.prototype,"open",2),s([h({type:Number,attribute:"open-delay"})],Le.prototype,"openDelay",2),s([h({type:Number,attribute:"close-delay"})],Le.prototype,"closeDelay",2),s([h({type:Number,attribute:"offset"})],Le.prototype,"offsetDistance",2),s([h({reflect:!0})],Le.prototype,"backdrop",2),s([h({attribute:"backdrop-style"})],Le.prototype,"backdropStyle",2),s([h({type:Boolean})],Le.prototype,"portal",2),s([h({type:Boolean,attribute:"same-width"})],Le.prototype,"sameWidth",2),s([h({type:Number,attribute:"max-width"})],Le.prototype,"maxWidth",2),s([h({type:Number,attribute:"max-height"})],Le.prototype,"maxHeight",2),s([h({attribute:!1})],Le.prototype,"dropdownProps",2),s([h({attribute:!1})],Le.prototype,"menuProps",2),s([h({reflect:!0,attribute:"submenu-trigger"})],Le.prototype,"submenuTrigger",2),s([h({attribute:"submenu-icon"})],Le.prototype,"submenuIcon",2),s([G("lui-dropdown")],Le.prototype,"_dropdown",2),s([ro("lui-menu")],Le.prototype,"_menus",2),s([G('slot[name="trigger"]')],Le.prototype,"_triggerSlot",2),s([Y()],Le.prototype,"_submenuPlacements",2),Le=s([L("lui-dropmenu")],Le);var et=class extends N{constructor(){super(...arguments);this.selection="none";this.values=[];this.variant="default";this.size="md";this.radius="md";this.vertical=!1;this.disabled=!1;this.ripple=!1;this.block=!1;this.collapse="none";this.overflowLabel="\u66F4\u591A";this.overflowIcon="more-horizontal";this.overflowPlacement="bottom-end";this.overflowTriggerWidth=0;this.overflowTriggerProps={};this.items=[];this._overflowIndexes=[];this._activeInteractionIndex=-1;this._layoutFrame=0;this._indicatorFrame=0;this._indicatorLastKey=null;this._onItemActivate=e=>{let t=e.detail?.item,o=e.detail?.value??t?.value??"";t&&this._commitItemActivation(t,o)};this._onSlotChange=()=>{this.items.length>0||(this._syncItems(),this._scheduleLayout())};this._onOverflowSelect=e=>{let t=Number(e.detail?.value),o=this._collectItems()[t];if(!o||o.item.disabled)return;let n=o.element;n!==o.item&&typeof n.trigger=="function"&&n.trigger(),o.item.trigger()};this._onGroupPointerOver=e=>{let t=e.composedPath(),n=this._collectItems().findIndex(({element:a,item:l})=>t.includes(a)||t.includes(l));this._setInteractionIndex(n)};this._onGroupPointerOut=e=>{let t=e.relatedTarget;t&&this._groupEl?.contains(t)||this._clearInteractionIndex()};this._onGroupPointerDown=e=>{let t=e.composedPath(),n=this._collectItems().findIndex(({element:a,item:l})=>t.includes(a)||t.includes(l));this._setInteractionIndex(n)};this._onGroupPointerUp=()=>{this._clearInteractionIndex()}}_applyInheritedItemProp(e,t,o){let n=`data-lui-button-group-${t}`;e.hasAttribute(t)&&!e.hasAttribute(n)||(e[t]=o,e.setAttribute(n,""))}connectedCallback(){super.connectedCallback(),this.addEventListener("button-group-item-activate",this._onItemActivate),this._resizeObserver=new ResizeObserver(()=>this._scheduleLayout())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("button-group-item-activate",this._onItemActivate),this._resizeObserver?.disconnect(),this._observedParent=void 0,this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame)}firstUpdated(){this._groupEl&&this._resizeObserver?.observe(this._groupEl),this._resizeObserver?.observe(this),this.parentElement&&(this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._scheduleLayout()}updated(e){this.parentElement&&this.parentElement!==this._observedParent&&(this._observedParent&&this._resizeObserver?.unobserve(this._observedParent),this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._syncItems(),this._syncOverflowTriggerProps(),(e.has("items")||e.has("collapse")||e.has("vertical")||e.has("block")||e.has("size")||e.has("radius")||e.has("overflowTriggerWidth"))&&this._scheduleLayout(),this._groupEl?.setAttribute("data-indicator-still","")}_collectItems(){return this.items.length>0?Array.from(this.renderRoot.querySelectorAll('lui-button-group-item[data-lui-generated="true"]')).map(e=>({element:e,item:e})):(this._assignedElements??[]).map(e=>{if(e.tagName.toLowerCase()==="lui-button-group-item")return{element:e,item:e};let t=e.shadowRoot?.querySelector("lui-button-group-item");return t?{element:e,item:t}:null}).filter(e=>!!e)}_syncItems(){let e=this._collectItems(),t=this._resolvedValues(),o=e.map((d,p)=>p).filter(d=>!this._overflowIndexes.includes(d)),n=this._overflowIndexes.length>0,a=this._usesSelectionIndicator(),l=new Set(o.filter(d=>t.includes(e[d]?.item.value??"")));e.forEach(({element:d,item:p},f)=>{let b=o.indexOf(f),k=b>0?o[b-1]:-1;p.grouped=!0,p.first=o[0]===f,p.last=!n&&o[o.length-1]===f,p.vertical=this.vertical,p.dividerHidden=a&&(l.has(f)||l.has(k)),p.interactionActive=this._activeInteractionIndex===f||k===this._activeInteractionIndex,this._applyInheritedItemProp(p,"variant",this.variant),this._applyInheritedItemProp(p,"size",this.size),this._applyInheritedItemProp(p,"radius",this.radius),this._applyInheritedItemProp(p,"ripple",this.ripple),this.disabled?(p.disabled||p.setAttribute("data-lui-button-group-disabled",""),p.disabled=!0):p.hasAttribute("data-lui-button-group-disabled")&&(p.removeAttribute("data-lui-button-group-disabled"),p.disabled=!1),(this.selection!=="none"||!p.hasAttribute("pressed"))&&(p.pressed=t.includes(p.value)),p.indicatorSelected=this._usesSelectionIndicator()&&p.pressed&&!this._overflowIndexes.includes(f),d.toggleAttribute("data-overflow-hidden",this._overflowIndexes.includes(f))})}_resolvedValues(){return this.selection==="single"?this.value?[this.value]:[]:this.selection==="multiple"?this.values.slice():this._collectItems().filter(({item:e})=>e.pressed).map(({item:e})=>e.value)}_readOverflowIcon(e,t){return e.getAttribute("icon")||t.getAttribute("icon")||t.querySelector('lui-icon[slot="prefix"], [slot="prefix"][name]')?.getAttribute("name")||e.shadowRoot?.querySelector('lui-button-group-item lui-icon[slot="prefix"], lui-button-group-item [slot="prefix"][name]')?.getAttribute("name")||void 0||void 0}_syncOverflowTriggerProps(){this._overflowTriggerButton&&Se(this._overflowTriggerButton,this.overflowTriggerProps)}_readOverflowLabel(e,t,o){let n=e.getAttribute("label")||t.getAttribute("label")||e.getAttribute("aria-label")||t.getAttribute("aria-label")||e.getAttribute("title")||t.getAttribute("title"),a=t.textContent?.trim()||e.textContent?.trim();return n||a||t.value||`item-${o}`}_overflowItems(){let e=this._collectItems();return this._overflowIndexes.flatMap(t=>{let o=e[t];if(!o)return[];let{element:n,item:a}=o;return[{key:String(t),value:String(t),label:this._readOverflowLabel(n,a,t),icon:this._readOverflowIcon(n,a),disabled:a.disabled,active:this.selection==="single"&&a.pressed,checked:this.selection!=="single"&&a.pressed}]})}_scheduleLayout(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._recomputeLayout(),this._scheduleSelectionIndicatorLayout()})}_usesSelectionIndicator(){return this.selection==="single"&&!this.vertical}_scheduleSelectionIndicatorLayout(){this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._indicatorFrame=requestAnimationFrame(()=>{this._indicatorFrame=0,this._updateSelectionIndicator()})}_updateSelectionIndicator(){let e=this._groupEl;if(!e||!this._usesSelectionIndicator()){e?.style.setProperty("--lui-button-group-indicator-opacity","0"),this._indicatorLastKey=null;return}let o=this._collectItems().find((d,p)=>d.item.pressed&&!this._overflowIndexes.includes(p));if(!o){e.style.setProperty("--lui-button-group-indicator-opacity","0"),this._indicatorLastKey=null;return}let n=String(o.item.value??o.item.textContent??"");this._indicatorLastKey!==null&&this._indicatorLastKey!==n&&e.removeAttribute("data-indicator-still");let a=e.getBoundingClientRect(),l=o.element.getBoundingClientRect();e.style.setProperty("--lui-button-group-indicator-x",`${l.left-a.left+e.scrollLeft}px`),e.style.setProperty("--lui-button-group-indicator-y",`${l.top-a.top+e.scrollTop}px`),e.style.setProperty("--lui-button-group-indicator-width",`${l.width}px`),e.style.setProperty("--lui-button-group-indicator-height",`${l.height}px`),e.style.setProperty("--lui-button-group-indicator-radius",getComputedStyle(o.item).getPropertyValue("--lui-button-group-item-radius")||"0px"),e.style.setProperty("--lui-button-group-indicator-opacity","1"),this._indicatorLastKey=n}_getContainerWidth(){let e=Math.round(this.getBoundingClientRect().width),t=this._groupEl?.clientWidth??0,o=this.parentElement?.getBoundingClientRect(),n=Math.round(o?.width??0),a=o?Math.max(0,Math.round(o.right-this.getBoundingClientRect().left)):0,l=this.style.width.trim().length>0;return this.block||l?e||t||n:a||n||e||t}_defaultOverflowTriggerWidth(){let e=Number.parseFloat(getComputedStyle(this).getPropertyValue("--lui-button-height"));return Number.isFinite(e)&&e>0?Math.round(e):this.overflowTriggerWidth>0?this.overflowTriggerWidth:this.size==="sm"?32:this.size==="lg"?44:38}_readItemWidth(e){let t=e.getBoundingClientRect().width,o=Math.ceil(t||e.scrollWidth||e.offsetWidth||0);return Math.max(0,o)}_setOverflowIndexes(e){if(!(e.length!==this._overflowIndexes.length||e.some((o,n)=>o!==this._overflowIndexes[n]))){this._syncItems(),this._scheduleSelectionIndicatorLayout();return}this._overflowIndexes=e,this._syncItems(),this._scheduleSelectionIndicatorLayout()}_recomputeLayout(){if(this.collapse!=="auto"||this.vertical){this._setOverflowIndexes([]);return}let e=this._collectItems(),t=this._getContainerWidth();if(!e.length||!t){this._setOverflowIndexes([]);return}let o=e.map(({element:a})=>this._readItemWidth(a)),n=Gp({itemWidths:o,containerWidth:t,overflowTriggerWidth:this._defaultOverflowTriggerWidth(),minVisibleItems:0});this._setOverflowIndexes(n.overflowIndexes)}_commitItemActivation(e,t=e.value){if(e){if(this.selection!=="none"){let o=Yp({selection:this.selection,currentValue:this.value,currentValues:this.values,nextValue:t});this.value=o.value,this.values=o.values,this._syncItems(),this._scheduleSelectionIndicatorLayout()}this.dispatchEvent(new CustomEvent("change",{detail:{value:this.selection==="multiple"?void 0:this.value,values:this._resolvedValues(),item:e},bubbles:!0,composed:!0})),this.items.find(o=>o.value===t)?.onClick?.(this.items.find(o=>o.value===t))}}_setInteractionIndex(e){this._activeInteractionIndex!==e&&(this._activeInteractionIndex=e,this._syncItems())}_clearInteractionIndex(){this._activeInteractionIndex<0||(this._activeInteractionIndex=-1,this._syncItems())}_overflowTriggerRadius(){return this._overflowIndexes.length<this._collectItems().length?"0 var(--lui-button-group-radius) var(--lui-button-group-radius) 0":"var(--lui-button-group-radius)"}_renderDataItems(){return this.items.map(e=>v`
2223
2223
  <lui-button-group-item
2224
2224
  data-lui-generated="true"
2225
2225
  value=${e.value}
@@ -2241,6 +2241,7 @@
2241
2241
  class="group"
2242
2242
  part="group"
2243
2243
  role="group"
2244
+ data-indicator-still
2244
2245
  data-has-overflow=${t?"true":"false"}
2245
2246
  @pointerover=${this._onGroupPointerOver}
2246
2247
  @pointerout=${this._onGroupPointerOut}
@@ -2387,6 +2388,12 @@
2387
2388
  will-change: transform, width, height;
2388
2389
  z-index: 0;
2389
2390
  }
2391
+ /* 初始挂载/布局重建时禁过渡:指示器从 0,0 跳到目标位置的滑动
2392
+ 不是用户要的"点击切换"反馈,反而会看到一块东西从左上角飞过去。
2393
+ 真实的选项切换在 _updateSelectionIndicator 里移除该标记 */
2394
+ [data-indicator-still] .selection-indicator {
2395
+ transition: none;
2396
+ }
2390
2397
  .group[data-has-overflow="true"] {
2391
2398
  align-items: stretch;
2392
2399
  }
@@ -5294,15 +5301,15 @@
5294
5301
  justify-content: flex-end;
5295
5302
  text-align: right;
5296
5303
  }
5297
- th[data-resizable="true"],
5298
- th[data-reorderable="true"],
5299
- .vhead-cell[data-resizable="true"],
5300
- .vhead-cell[data-reorderable="true"] {
5304
+ /* resizer/拖拽把手需要 th 是定位上下文;但 position:relative 与
5305
+ fixed 列的 position:sticky 同优先级且在后会覆盖它,导致表头不吸。
5306
+ 所以 relative 只给非 fixed 的 th——fixed 的 th 自带 sticky 定位,
5307
+ 本身就是 containing block。 */
5308
+ th[data-resizable="true"]:not(.fixed-left):not(.fixed-right),
5309
+ th[data-reorderable="true"]:not(.fixed-left):not(.fixed-right),
5310
+ .vhead-cell[data-resizable="true"]:not(.fixed-left):not(.fixed-right),
5311
+ .vhead-cell[data-reorderable="true"]:not(.fixed-left):not(.fixed-right) {
5301
5312
  position: relative;
5302
- /* Safari/老 Firefox 对 display:table-cell 的 position:relative 会忽略,
5303
- 把手回落到 .table-wrap 全部堆在表右缘;translateZ(0) 把 th 提升为
5304
- transform containing block,等效定位且全平台一致 */
5305
- transform: translateZ(0);
5306
5313
  }
5307
5314
  .column-drag-handle {
5308
5315
  display: inline-flex;