@ixfx/components 0.14.2 → 0.14.3

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/bundle/index.d.ts CHANGED
@@ -9,7 +9,7 @@ declare class IxfxIconElement extends LitElement {
9
9
  rotate: string;
10
10
  connectedCallback(): void;
11
11
  disconnectedCallback(): void;
12
- protected render(): typeof nothing | import("lit").TemplateResult<1>;
12
+ protected render(): import("lit").TemplateResult<1> | typeof nothing;
13
13
  protected updated(changed: Map<string, unknown>): void;
14
14
  static styles: import("lit").CSSResult[];
15
15
  }
@@ -596,7 +596,7 @@ declare class ButtonElement extends LitElement {
596
596
  * attribute).
597
597
  */
598
598
  value: boolean;
599
- protected _renderIcon(): typeof nothing | import("lit").TemplateResult<1>;
599
+ protected _renderIcon(): import("lit").TemplateResult<1> | typeof nothing;
600
600
  protected render(): import("lit").TemplateResult<1>;
601
601
  static styles: import("lit").CSSResult[];
602
602
  }
@@ -2101,7 +2101,7 @@ declare abstract class LabelledInputBase extends LitElement {
2101
2101
  value: number;
2102
2102
  }>) => void;
2103
2103
  protected _syncValue(v: number): void;
2104
- protected _renderEditableNumber(): typeof nothing | import("lit").TemplateResult<1>;
2104
+ protected _renderEditableNumber(): import("lit").TemplateResult<1> | typeof nothing;
2105
2105
  updated(changedProperties: Map<string, unknown>): void;
2106
2106
  }
2107
2107
  //#endregion
@@ -2441,6 +2441,14 @@ type TreeItem = {
2441
2441
  * (`beginEdit`) uses it; other components ignore it.
2442
2442
  */
2443
2443
  editable?: boolean;
2444
+ /**
2445
+ * Set to `false` to make this node unselectable, regardless of
2446
+ * `selectionFilter`. In `ixfx-tree-list`'s `checked` mode no checkbox is
2447
+ * drawn for it (see `alignCheckboxes`). Unselectable branches can still be
2448
+ * expanded, and their selectable descendants can still be selected.
2449
+ * Default: selectable.
2450
+ */
2451
+ selectable?: boolean;
2444
2452
  /** Tooltip text shown on hover. */
2445
2453
  tooltip?: string;
2446
2454
  /** Optional string value, e.g. for use as a command/route. */
@@ -5784,7 +5792,7 @@ declare class SplitLayoutElement extends LitElement {
5784
5792
  private _onPointerUp;
5785
5793
  private _emitResize;
5786
5794
  private _emitChange;
5787
- protected render(): typeof nothing | import("lit").TemplateResult<1>;
5795
+ protected render(): import("lit").TemplateResult<1> | typeof nothing;
5788
5796
  private _getTrackSizes;
5789
5797
  private _resolveTracks;
5790
5798
  private _renderGutter;
@@ -7990,7 +7998,7 @@ declare class GroupedItemListerElement<T = unknown> extends LitElement {
7990
7998
  connectedCallback(): void;
7991
7999
  disconnectedCallback(): void;
7992
8000
  protected updated(changed: PropertyValues): void;
7993
- protected render(): typeof nothing | import("lit").TemplateResult<1>;
8001
+ protected render(): import("lit").TemplateResult<1> | typeof nothing;
7994
8002
  }
7995
8003
  declare global {
7996
8004
  interface HTMLElementTagNameMap {
@@ -8219,6 +8227,12 @@ declare class TreeListElement extends TreeBaseElement {
8219
8227
  * </svg>`;
8220
8228
  */
8221
8229
  checkboxRenderer: ((state: TreeCheckboxState) => unknown) | undefined;
8230
+ /**
8231
+ * In `checked` mode, whether unselectable rows (`item.selectable === false`)
8232
+ * keep the space their checkbox would occupy, so their carets and labels line
8233
+ * up with selectable siblings. When off (default) they reserve no space.
8234
+ */
8235
+ alignCheckboxes: boolean;
8222
8236
  willUpdate(changedProps: PropertyValues): void;
8223
8237
  protected renderNodeContent(node: TreeNode, depth: number): TemplateResult;
8224
8238
  protected _renderNode(node: TreeNode, depth: number): TemplateResult;
@@ -9435,7 +9449,7 @@ declare class LabelledRadialInput extends LabelledInputBase {
9435
9449
  private _isWide;
9436
9450
  private _getEffectivePrecision;
9437
9451
  protected _handleResize(entries: ResizeObserverEntry[]): void;
9438
- protected _renderEditableNumber(): typeof nothing | import("lit").TemplateResult<1>;
9452
+ protected _renderEditableNumber(): import("lit").TemplateResult<1> | typeof nothing;
9439
9453
  render(): import("lit").TemplateResult<1>;
9440
9454
  private _getTooltipValue;
9441
9455
  static styles: CSSResultGroup;
package/bundle/index.js CHANGED
@@ -7738,7 +7738,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
7738
7738
  height: 100%;
7739
7739
  transform: none;
7740
7740
  }
7741
- `]}};E([d({type:Boolean,reflect:!0})],ob.prototype,`collapsed`,void 0),E([d({type:String,attribute:`orientation`,reflect:!0})],ob.prototype,`orientation`,void 0),E([d({type:Boolean})],ob.prototype,`closable`,void 0),E([d({type:Boolean,reflect:!0})],ob.prototype,`collapsible`,void 0),E([d({type:String})],ob.prototype,`title`,void 0),E([d({type:String,attribute:`icon-name`})],ob.prototype,`iconName`,void 0),E([d({type:String,attribute:`toggle-interaction`})],ob.prototype,`toggleInteraction`,void 0),E([d({type:String,attribute:`variant`,reflect:!0})],ob.prototype,`variant`,void 0),E([d({type:Boolean,attribute:`hide-titlebar`})],ob.prototype,`hideTitlebar`,void 0),E([d({type:Boolean,attribute:`keep-toolbar`})],ob.prototype,`keepToolbar`,void 0),ob=E([T(`ixfx-panel`)],ob);const sb=`__ungrouped__`;let cb=class extends n{constructor(...e){super(...e),this.grouped=!1,this.crossGroupSelection=!1,this.#n=new Map,this.#i=!1,this.#a=new Ae(this),this.#d=e=>{if(this.#i)return;let n=e.target,r;for(let[e,i]of this.#n)if(i===n){r=e;break}if(r!==void 0){if(this.grouped&&!this.crossGroupSelection){this.#i=!0;for(let[e,n]of this.#n)e!==r&&n.clearSelection();this.#i=!1}this.dispatchEvent(new CustomEvent(`grouped-select`,{detail:{selected:this.selectedItems,groupKey:r===sb?void 0:r},bubbles:!0,composed:!0}))}}}#e;#t;#n;#r;#i;#a;get groupBy(){return this.#e}set groupBy(e){this.#e=e,this.requestUpdate()}get factory(){return this.#t}set factory(e){e!==this.#t&&(this.#s(),this.#t=e,this.requestUpdate())}get provider(){return this.#a.provider}set provider(e){this.#a.provider=e,e&&this.#a.request(void 0)}get selectedItems(){let e=new Set;for(let n of this.#n.values())for(let r of n.selectedItems)e.add(r);return e}dispatch(e,n){for(let r of this.#n.values())r.dispatch(e,n)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener(`select`,this.#d)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`select`,this.#d)}updated(e){super.updated(e),e.has(`grouped`)&&this.#s(),this.#c()}render(){return this.#t?this.grouped?this.#e?(this.#r=this.#o(),i`${_(this.#r.keys(),e=>e,e=>i`<ixfx-panel data-group-key=${e} .title=${e}></ixfx-panel>`)}`):a:i`<div class="ungrouped-host"></div>`:a}#o(){let e=new Map;if(!this.#e)return e;for(let n of this.#a.items){let r=this.#e(n),i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return e}#s(){for(let e of this.#n.values())e.remove();this.#n.clear()}#c(){if(this.#t){if(!this.grouped){this.#l();return}this.#e&&this.#u()}}#l(){let e=this.querySelector(`.ungrouped-host`);if(!e)return;let n=this.#n.get(sb);n||(n=this.#t(void 0),e.appendChild(n),this.#n.set(sb,n)),n.setItems(this.#a.items)}#u(){let e=this.#r??this.#o();for(let n of[...this.#n.keys()])e.has(n)||(this.#n.get(n)?.remove(),this.#n.delete(n));for(let[n,r]of e){let e=[...this.children].find(e=>e instanceof HTMLElement&&e.dataset.groupKey===n);if(!e)continue;let i=this.#n.get(n);i||(i=this.#t(n),e.appendChild(i),this.#n.set(n,i)),i.setItems(r)}}#d};E([d({type:Boolean,reflect:!0})],cb.prototype,`grouped`,void 0),E([d({type:Boolean,attribute:`cross-group-selection`,reflect:!0})],cb.prototype,`crossGroupSelection`,void 0),cb=E([T(`ixfx-grouped-item-lister`)],cb);const lb=`application/x-ixfx-tree`,ub=new Map,db=new Map;let fb,pb=0;function mb(){return`tree-drag-${++pb}-${Date.now()}`}function hb(e,n,r,i){ub.set(e,{sourceId:e,nodes:r,keys:i}),db.set(e,new WeakRef(n)),fb=e}function gb(e){ub.delete(e),db.delete(e),fb===e&&(fb=void 0)}function _b(){if(fb===void 0)return;let e=ub.get(fb);if(e)return{sourceId:fb,keys:e.keys,nodes:e.nodes,element:db.get(fb)?.deref()}}function vb(e,n,r){return Math.max(n,Math.min(r,e))}var yb=class{#e;#t;#n=!1;#r;#i=`internal`;#a=[];#o=[];#s;#c;#l=0;#u=0;#d=0;#f;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}get isDragging(){return this.#n}get isRejected(){return this.#n&&this.#r===void 0}get dropState(){return this.#r}hostConnected(){this.#p()}hostUpdated(){this.#p()}#p(){let e=this.#t.getScrollContainer();!e||e===this.#f||(this.#m(),this.#f=e,e.addEventListener(`dragenter`,this.#h),e.addEventListener(`dragover`,this.#g),e.addEventListener(`dragleave`,this.#v),e.addEventListener(`drop`,this.#y))}#m(){let e=this.#f;e&&(e.removeEventListener(`dragenter`,this.#h),e.removeEventListener(`dragover`,this.#g),e.removeEventListener(`dragleave`,this.#v),e.removeEventListener(`drop`,this.#y),this.#f=void 0)}hostDisconnected(){this.#m(),this.#w(),this.#D(),this.#n=!1,this.#r=void 0}#h=e=>{this.#t.getDndMode()===`none`||!e.dataTransfer||this.#t.resolveDrag(e.dataTransfer,`hover`)!==void 0&&(e.preventDefault(),this.#n||(this.#n=!0,this.#t.onActiveChange(!0)))};#g=e=>{if(this.#t.getDndMode()===`none`||!e.dataTransfer)return;this.#u=e.clientX,this.#d=e.clientY;let n=this.#t.resolveDrag(e.dataTransfer,`hover`);if(!n){this.#_(e);return}this.#n||(this.#n=!0,this.#t.onActiveChange(!0)),this.#i=n.source,this.#a=n.keys,this.#o=n.nodes;let r=this.#t.getVisibleRows();this.#C(this.#x(r,e.clientY)),this.#T();let i=this.#S(e,r,n.source);if(!i){this.#_(e,!1);return}let a={source:n.source,dragged:n.nodes.length>0?n.nodes:void 0,draggedKeys:n.keys,target:i,dataTransfer:e.dataTransfer};if(!this.#t.vet(a)){this.#_(e,!1);return}e.preventDefault(),e.dataTransfer.dropEffect=n.source===`internal`?`move`:`copy`,this.#O(i)};#_(e,n=!0){e.dataTransfer&&(e.dataTransfer.dropEffect=`none`),this.#O(void 0),n&&this.#w()}#v=e=>{let n=this.#t.getScrollContainer(),r=e.relatedTarget;n&&r&&n.contains(r)||this.#b()};#y=e=>{if(!e.dataTransfer){this.#b();return}e.preventDefault(),this.#D(),this.#w();let n=e=>{this.#r=void 0,this.#n=!1,this.#t.onDropStateChange(void 0),this.#t.onActiveChange(!1),this.#t.onDragEnd(e)};if(this.#t.getDndMode()===`none`){n(!1);return}let r=this.#t.resolveDrag(e.dataTransfer,`drop`);if(!r){n(!1);return}this.#a=r.keys,this.#o=r.nodes;let i=this.#S(e,this.#t.getVisibleRows(),r.source);if(!i){n(!1);return}let a={source:r.source,dragged:r.nodes.length>0?r.nodes:void 0,draggedKeys:r.keys,target:i,dataTransfer:e.dataTransfer};if(!this.#t.vet(a)){n(!1);return}let o={...a,external:r.source===`external`?r.nodes:void 0};n(this.#t.commitDrop(o))};#b(){this.#w(),this.#D(),this.#r!==void 0&&(this.#r=void 0,this.#t.onDropStateChange(void 0)),this.#n&&(this.#n=!1,this.#t.onActiveChange(!1))}#x(e,n){if(e.length!==0)return n<e[0].rect.top?e[0]:n>e[e.length-1].rect.bottom?e[e.length-1]:e.find(e=>n>=e.rect.top&&n<=e.rect.bottom)??e[e.length-1]}#S(e,n,r){if(n.length===0)return;let i=this.#x(n,e.clientY);if(!i)return;let a=vb((e.clientY-i.rect.top)/i.rect.height,0,1),o=a<.25?`before`:a>.75?`after`:`inside`,s=i.node.item.isLeaf===!0;o===`inside`&&s&&(o=`after`);let c=!1;o===`after`&&!s&&this.#t.isExpanded(i.key)&&(o=`inside`,c=!0);let l,u,d,f;if(o===`inside`)l=i.key,u=i.key,d=i.depth+1,f=c?0:i.node.children?.length??0;else{let r=this.#t.getIndentPx()||1,a=n[0].rect.left,s=vb(Math.round((e.clientX-a)/r),0,i.depth),c={node:i.node,depth:i.depth,parentKey:this.#t.getRowInfo(i.key)?.parentKey};u=i.key;for(let e=i.depth-s;e>0&&c.parentKey!==void 0;e--){let e=this.#t.getRowInfo(c.parentKey);if(!e)break;u=c.parentKey,c=e}d=c.depth,l=c.parentKey;let p=this.#t.getChildren(l).findIndex(e=>e.item.key===u);f=(p<0?0:p)+ +(o===`after`)}if(r===`internal`){for(let e of this.#a)if(e===l||e===u||l!==void 0&&this.#t.isSelfOrDescendant(e,l)||o!==`inside`&&this.#t.isSelfOrDescendant(e,u))return;if(this.#a.length>0&&!this.#t.isReorderAllowed()&&!this.#a.some(e=>this.#t.getParentKey(e)!==l))return}return{parentKey:l,index:f,referenceKey:u,position:o,depth:d}}#C(e){if(!e||e.node.item.isLeaf===!0||this.#t.isExpanded(e.key)){this.#w();return}if(e.key===this.#c)return;this.#w();let n=this.#c=e.key;this.#s=setTimeout(()=>{this.#s=void 0,this.#c===n&&(this.#c=void 0,this.#t.expandKey(n))},Math.max(0,this.#t.getExpandHoverMs()))}#w(){this.#s!==void 0&&(clearTimeout(this.#s),this.#s=void 0),this.#c=void 0}#T(){this.#l===0&&(this.#l=requestAnimationFrame(this.#E))}#E=()=>{if(this.#l=0,!this.#n)return;let e=this.#t.getScrollContainer();if(!e)return;let n=e.getBoundingClientRect(),r=this.#d-n.top,i=0;r<24?i=-Math.ceil(16*(1-Math.max(0,r)/24)):r>n.height-24&&(i=Math.ceil(16*(1-Math.max(0,n.height-r)/24))),i!==0&&this.#u>=n.left&&this.#u<=n.right&&(e.scrollTop+=i,this.#T())};#D(){this.#l!==0&&(cancelAnimationFrame(this.#l),this.#l=0)}#O(e){let n=e===void 0?this.#r===void 0:e.referenceKey===this.#r?.referenceKey&&e.position===this.#r?.position&&e.depth===this.#r?.depth&&e.index===this.#r?.index;this.#r=e,(!n||this.#n)&&this.#t.onDropStateChange(e)}};function bb(e,n){let r=[],i=new Map,a=[],o=(e,r,i)=>{if(!e||e.length===0)return;let o=e.filter(e=>n.isShown(e,r));for(let e=o.length-1;e>=0;e--)a.push({node:o[e],depth:r,parentKey:i,posInSet:e+1,setSize:o.length})};for(o(e.children,0,void 0);a.length>0;){let{node:e,depth:s,parentKey:c,posInSet:l,setSize:u}=a.pop();i.set(e.item.key,r.length),r.push({node:e,depth:s,parentKey:c,posInSet:l,setSize:u}),e.children&&e.children.length>0&&n.isExpanded(e,s)&&o(e.children,s+1,e.item.key)}return{rows:r,indexByKey:i}}function xb(e){let n=new Map,r=new Set,i=[];if(e.children)for(let r of e.children)n.set(r.item.key,e.item.key),i.push({node:r,depth:0,parentKey:e.item.key});for(;i.length>0;){let{node:e,depth:a,parentKey:o}=i.pop();if(n.set(e.item.key,o),e.item.icon&&r.add(a),e.children)for(let n=e.children.length-1;n>=0;n--){let r=e.children[n];i.push({node:r,depth:a+1,parentKey:e.item.key})}}return{parentByKey:n,depthsWithIcons:r}}function Sb(e,n){let r=new Set;if(!e.children)return r;let i=[],a=(e,r)=>{i.push({node:e,depth:r,next:0,matched:n(e,r)})};for(let n of e.children)for(a(n,0);i.length>0;){let e=i[i.length-1],n=e.node.children;if(n&&e.next<n.length){a(n[e.next++],e.depth+1);continue}i.pop(),e.matched&&(r.add(e.node.item.key),i.length>0&&(i[i.length-1].matched=!0))}return r}function Cb(e,n,r){if(r.size===0)return[...e];let i=new Set;for(let n of e)i.add(n.node.item.key);let a=Symbol(`end`),o=new Map,s=a;for(let e=n.length-1;e>=0;e--){let a=n[e];if(i.has(a)){s=a;continue}let c=r.get(a);if(!c)continue;let l=o.get(s);l?l.push(c):o.set(s,[c])}let c=[];for(let n of e){let e=o.get(n.node.item.key);if(e)for(let n=e.length-1;n>=0;n--)c.push(e[n]);c.push(n)}let l=o.get(a);if(l)for(let e=l.length-1;e>=0;e--)c.push(l[e]);return c}function wb(e,n){let r=new Map;if(!e.children)return r;let i=[];for(let a of e.children)for(i.push({node:a,next:0,checked:0,unchecked:0});i.length>0;){let e=i[i.length-1],{node:a}=e,o=a.children,s=a.item.isLeaf||!o?.length;if(!s&&e.next<o.length){i.push({node:o[e.next++],next:0,checked:0,unchecked:0});continue}i.pop();let c;if(c=s?n.has(a)?`checked`:`unchecked`:e.checked===o.length?`checked`:e.unchecked===o.length?`unchecked`:`indeterminate`,r.set(a.item.key,c),i.length>0){let e=i[i.length-1];c===`checked`?e.checked++:c===`unchecked`&&e.unchecked++}}return r}function Tb(e,n){if(e.has(n))return e;let r=new Set(e);return r.add(n),r}function Eb(e,n){if(!e.has(n))return e;let r=new Set(e);return r.delete(n),r}function Db(e,n){let r;for(let i of e)n(i)&&(r??=new Set(e),r.delete(i));return r??e}function Ob(e){return Math.max(1,e.rowHeight+e.gap)}function kb(e,n){return e.listOffset+n*Ob(e)+e.gap}function Ab(e,n){return kb(e,n)+e.rowHeight}function jb(e,n,r=5){let{count:i}=e;if(i<=0)return{start:0,end:0};let a=Ob(e),o=Math.max(0,n-e.listOffset),s=Math.floor(o/a),c=Math.ceil((o+e.viewportHeight)/a),l=Math.min(i,Math.max(0,s-r));return{start:l,end:Math.min(i,Math.max(l,c+r))}}function Mb(e,n,r,i=0){if(n<0||n>=e.count)return r;let a=kb(e,n),o=a+e.rowHeight;return a<r+i?n===0?0:Math.max(0,a-i):o>r+e.viewportHeight?Math.max(0,o-e.viewportHeight):r}function Nb(e,n,r,i=0){if(n<0||n>=e.count)return r;let a=kb(e,n),o=a+e.rowHeight;if(a>=r+i&&o<=r+e.viewportHeight)return r;let s=a+e.rowHeight/2-(e.viewportHeight+i)/2;return Math.max(0,s)}function Pb(e){return Math.max(1,Math.floor(e.viewportHeight/Ob(e))-1)}function Fb(e){return{count:e.count,topOf:n=>kb(e,n),bottomOf:n=>Ab(e,n)}}function Ib(e,n){let r=0,i=e.count;for(;r<i;){let a=r+i>>>1;e.bottomOf(a)>n?i=a:r=a+1}return r}function Lb(e,n,r,i=0){if(e.count===0)return;let a=Math.min(Ib(e,n),e.count-1),o=a,s=e.count;for(;o<s;){let n=o+s>>>1;e.topOf(n)>=r?s=n:o=n+1}let c=Math.max(a,o-1);return{first:Math.max(0,a-i),last:Math.min(e.count-1,c+i)}}const Rb={rows:[],indexByKey:new Map};let q=class extends n{constructor(...e){super(...e),this.exclusivity=`none`,this.selectionFilter=`all`,this.interactionMode=`standard`,this._selectedNodes=new Set,this.disableKeyboardNavigation=!1,this.registry=void 0,this.itemDnd=`none`,this.dndExpandHoverMs=500,this.reorderable=!0,this.stickyHeaders=!0,this.virtualize=`auto`,this.virtualizeThreshold=200,this.applyInternalDrop=!0,this._expandedKeys=new Set,this.#i=0,this._selectionVersion=0,this._scrollTop=0,this.#l={rowHeight:30,gap:1,listOffset:0},this.#u=0,this.#d=0,this.#m=0,this.#h=0,this.#g=!1,this.#S=()=>{this.#d===0&&(this.#d=requestAnimationFrame(()=>{this.#d=0,this.#C()}))},this.tickled=new ie(this,{getItems:()=>this.#s().rows.map(({node:e})=>({id:e.item.key,enabled:!0})),hoverDisabled:()=>this.#J?.isDragging===!0||this.#Y?.isDragging===!0,onStateChange:()=>{this.setAttribute(`data-input-mode`,this.tickled.inputMode)}}),this._focusedDepth=0,this.search=new Bt(this,{adapter:Ut(this,{labelSelector:`.tree-label`,highlightKey:`incr-search-highlight`})}),this.#I={indent:20},this.#L=[],this.#R=[],this.#z=new Map,this.#B=new Map,this.#V=new Set,this.#H=new Map,this.#U=new Map,this.#W=!1,this.#G=``,this.#X=new Set,this.#Z=!1,this.#$=()=>{this.#Q=void 0},this.#te=()=>{this.#de===0&&(this.#de=requestAnimationFrame(()=>{this.#de=0,this.#re()}))},this._stickyKeys=[],this.#le=new Map,this.#ue=!0,this.#de=0,this.#pe=!1,this.#Ie=`user`,this.#Le=!1,this.#$e=0,this.#dt=e=>{if(this.search.isOpen)return;let n=this.#s().rows;if(n.length===0)return;if((e.ctrlKey||e.metaKey)&&e.key===`a`){e.preventDefault(),this.selectAll();return}[`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`,`Home`,`End`,`PageUp`,`PageDown`,`Enter`,` `].includes(e.key)&&this.tickled.setInputMode(`keyboard`);let r=this.#ot();switch(e.key){case`ArrowDown`:e.preventDefault(),this.#ut(n,r,Math.min(r+1,n.length-1),e.shiftKey);break;case`ArrowUp`:e.preventDefault(),this.#ut(n,r,Math.max(r-1,0),e.shiftKey);break;case`Home`:e.preventDefault(),this.#ut(n,r,0,e.shiftKey);break;case`End`:e.preventDefault(),this.#ut(n,r,n.length-1,e.shiftKey);break;case`PageDown`:{e.preventDefault();let i=this.#lt();this.#ut(n,r,Math.min(r+i,n.length-1),e.shiftKey);break}case`PageUp`:{e.preventDefault();let i=this.#lt();this.#ut(n,r,Math.max(r-i,0),e.shiftKey);break}case`ArrowRight`:{e.preventDefault();let i=n[r];i&&i.node.item.isLeaf!==!0&&(this._expandedKeys.has(i.node.item.key)?r+1<n.length&&this.#st(r+1):this.#Ke(i.node,i.depth)),this.requestUpdate();break}case`ArrowLeft`:{e.preventDefault();let i=n[r];if(i&&this._expandedKeys.has(i.node.item.key))this.#e(Eb(this._expandedKeys,i.node.item.key)),this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:i.node,depth:i.depth},bubbles:!0,composed:!0}));else if(i.depth>0){let e=i.depth-1;for(let i=r-1;i>=0;i--)if(n[i].depth===e){this.#st(i);break}}this.requestUpdate();break}case`Enter`:{e.preventDefault();let i=n[r];i&&(this.interactionMode!==`manual`&&this.interactionMode!==`checked`&&this.select(i.node),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:i.node,depth:i.depth},bubbles:!0,composed:!0})),this.requestUpdate());break}case` `:{e.preventDefault();let i=n[r];if(!i)break;this.interactionMode===`checked`?this._handleCheckboxClick(new MouseEvent(`click`),i.node,i.depth):(this.interactionMode===`standard`||this.interactionMode===`vscode`||this.interactionMode===`manual`)&&this.#Ge(i.node,i.depth);break}case`Escape`:e.preventDefault(),this.#tt()}},this.#ft=e=>{let n=e.target.closest(`ul.tree-list li`);if(!n)return;let r=n.dataset.key;if(!r)return;let i=this.#s(),a=i.indexByKey.get(r),o=a===void 0?void 0:i.rows[a];if(!o)return;let s={node:o.node,depth:o.depth};this.dispatchEvent(new CustomEvent(`item-dblclick`,{detail:s,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`activate`,{detail:s,bubbles:!0,composed:!0}))}}get selectedNodes(){return this._selectedNodes}#e(e){e!==this._expandedKeys&&(this._expandedKeys=e,this.#t=void 0,this.#ue=!0)}#t;#n;#r;#i;#a;#o;invalidateStructure(){this.#i++,this.#t=void 0,this.requestUpdate()}#s(){if(!this.root)return Rb;if(this.#t&&this.#n===this.root&&this.#r===this.filterPredicate)return this.#t;let e=this.#D();return this.#t=bb(this.root,{isExpanded:(e,n)=>this._isExpanded(e,n),isShown:e?n=>e.matches.has(n.item.key):()=>!0}),this.#n=this.root,this.#r=this.filterPredicate,this.#t}#c(){let e=this.root;if(!e)return{parentByKey:new Map,depthsWithIcons:new Set};let n=this.#a;if(n&&n.root===e&&n.version===this.#i)return n.index;let r=xb(e);return this.#a={root:e,version:this.#i,index:r},r}#l;#u;#d;#f;#p;#m;#h;#g;#_(){return this.virtualize===`off`?!1:this.virtualize===`on`||this.#s().rows.length>this.virtualizeThreshold}#v(e){return{count:e,rowHeight:this.#l.rowHeight,gap:this.#l.gap,listOffset:this.#l.listOffset,viewportHeight:this.#u>0?this.#u:600}}#y(){let e=this.renderRoot.querySelector(`ul.tree-list`),n=e?.querySelector(`li.item:not(.leaving)`),r=n?.getBoundingClientRect().height??0,i=r>0?r:this.#Se(),a=n?Number.parseFloat(getComputedStyle(n).marginTop):NaN,o=Number.isNaN(a)?Number.parseFloat(getComputedStyle(this).getPropertyValue(`--tree-item-gap`)):a,s=Number.isNaN(o)?1:o,c=this.#l.listOffset;if(e){let n=Number.parseFloat(getComputedStyle(e).paddingTop);c=e.offsetTop+(Number.isNaN(n)?0:n)}let l=this.#be()?.clientHeight??0,u=l>0&&l!==this.#u;l>0&&(this.#u=l);let d=this.#l,f=d.rowHeight!==i||d.gap!==s||d.listOffset!==c;return this.#l={rowHeight:i,gap:s,listOffset:c},f||u}#b(e){return jb(this.#v(e),this._scrollTop)}#x(){let e=this.#be()?.scrollTop;e!==void 0&&e!==this._scrollTop&&(this._scrollTop=e)}#S;#C(){let e=this.#be();if(!e||!this.root||!this.#_())return;let n=e.scrollTop;if(n===this._scrollTop)return;let r=jb(this.#v(this.#s().rows.length),n);(r.start!==this.#m||r.end!==this.#h)&&(this._scrollTop=n)}#w(){let e=this.#be();e!==this.#f&&(this.#f?.removeEventListener(`scroll`,this.#S),this.#p?.disconnect(),this.#p=void 0,this.#f=e,e&&(e.addEventListener(`scroll`,this.#S,{passive:!0}),typeof ResizeObserver<`u`&&(this.#p=new ResizeObserver(e=>{let n=e.at(-1)?.contentRect.height??0;n>0&&n!==this.#u&&this.#_()&&this.requestUpdate()}),this.#p.observe(e))))}#T(){this.#f?.removeEventListener(`scroll`,this.#S),this.#f=void 0,this.#p?.disconnect(),this.#p=void 0,this.#d!==0&&(cancelAnimationFrame(this.#d),this.#d=0)}#E(e,n=`edge`){let r=this.#be();if(!r)return;let i=this.#v(this.#s().rows.length),a=this.renderRoot.querySelector(`.sticky-headers`)?.getBoundingClientRect().height??0,o=(n===`center-if-hidden`?Nb:Mb)(i,e,r.scrollTop,a);(o!==r.scrollTop||o!==this._scrollTop)&&(r.scrollTop=o,this._scrollTop=o)}#D(){let e=this.filterPredicate,n=this.root;if(!e||!n)return;let r=this.#o;if(r&&r.predicate===e&&r.root===n&&r.version===this.#i)return r;let i=Sb(n,e),{parentByKey:a}=this.#c(),o=new Set;for(let e of i){let n=a.get(e);n!==void 0&&o.add(n)}let s={predicate:e,root:n,version:this.#i,matches:i,autoExpanded:o};return this.#o=s,s}get _structureVersion(){return this.#i}get _depthsWithIcons(){return this.#c().depthsWithIcons}#O;#k(){let e=this.searchModes?.trim();if(e===void 0)return[...Rt];let n=new Set(e.split(/\s+/));return Rt.filter(e=>n.has(e))}#A(){this.#F&&(this.search.setModes(this.#k()),this.#O?.(),this.#O=Lt(this.#F,this.search))}#j;#M;#N;#P;#F;#I;#L;#R;#z;#B;#V;#H;#U;#W;#G;#K;#q;#J;#Y;#X;#Z;#Q;#$;#ee(){let e=this.#be();this.stickyHeaders&&e?(!this.#pe||this.#fe!==e)&&(this.#fe?.removeEventListener(`scroll`,this.#te),e.addEventListener(`scroll`,this.#te,{passive:!0}),this.#fe=e,this.#pe=!0):this.#pe&&=(this.#fe?.removeEventListener(`scroll`,this.#te),this.#fe=void 0,!1)}#te;#ne(e){return{count:e.length,topOf:n=>e[n].offsetTop,bottomOf:n=>e[n].offsetTop+e[n].offsetHeight}}#re(){this.#ue=!1;let e=new Map,n=()=>this.#ie([],e);if(!this.stickyHeaders||!this.root)return n();let r=this.#be(),i=this.renderRoot.querySelector(`ul.tree-list`);if(!r||!i)return n();let a=this.#s(),o=this.#_(),s=i.children,c=this.#R;if(a.rows.length===0||!o&&(s.length===0||s.length!==c.length))return n();let l=o?Fb(this.#v(a.rows.length)):this.#ne(s),u=r.scrollTop,d=u+(this.renderRoot.querySelector(`.sticky-headers`)?.getBoundingClientRect().height??0),f=Ib(l,u);if(!o)for(;f<s.length&&s[f].classList.contains(`leaving`);)f++;if(f>=l.count)return n();let p=o?f:a.indexByKey.get(c[f]);if(p===void 0)return n();let m=[],h=a.rows[p].parentKey;for(;h!==void 0;){let e=a.indexByKey.get(h);if(e===void 0)break;m.unshift(a.rows[e]),h=a.rows[e].parentKey}let g=new Map,_=[];for(let e of m){let n=e.node.item.key,r=o?a.indexByKey.get(n):this.#z.get(n);r===void 0||l.bottomOf(r)>d||(_.push(n),g.set(n,{node:e.node,depth:e.depth}))}this.#ie(_,g)}#ie(e,n){let r=this._stickyKeys;r.length===e.length&&r.every((n,r)=>n===e[r])||(this.#le=n,this._stickyKeys=e)}#ae(){return!this.stickyHeaders||this._stickyKeys.length===0?a:i`
7741
+ `]}};E([d({type:Boolean,reflect:!0})],ob.prototype,`collapsed`,void 0),E([d({type:String,attribute:`orientation`,reflect:!0})],ob.prototype,`orientation`,void 0),E([d({type:Boolean})],ob.prototype,`closable`,void 0),E([d({type:Boolean,reflect:!0})],ob.prototype,`collapsible`,void 0),E([d({type:String})],ob.prototype,`title`,void 0),E([d({type:String,attribute:`icon-name`})],ob.prototype,`iconName`,void 0),E([d({type:String,attribute:`toggle-interaction`})],ob.prototype,`toggleInteraction`,void 0),E([d({type:String,attribute:`variant`,reflect:!0})],ob.prototype,`variant`,void 0),E([d({type:Boolean,attribute:`hide-titlebar`})],ob.prototype,`hideTitlebar`,void 0),E([d({type:Boolean,attribute:`keep-toolbar`})],ob.prototype,`keepToolbar`,void 0),ob=E([T(`ixfx-panel`)],ob);const sb=`__ungrouped__`;let cb=class extends n{constructor(...e){super(...e),this.grouped=!1,this.crossGroupSelection=!1,this.#n=new Map,this.#i=!1,this.#a=new Ae(this),this.#d=e=>{if(this.#i)return;let n=e.target,r;for(let[e,i]of this.#n)if(i===n){r=e;break}if(r!==void 0){if(this.grouped&&!this.crossGroupSelection){this.#i=!0;for(let[e,n]of this.#n)e!==r&&n.clearSelection();this.#i=!1}this.dispatchEvent(new CustomEvent(`grouped-select`,{detail:{selected:this.selectedItems,groupKey:r===sb?void 0:r},bubbles:!0,composed:!0}))}}}#e;#t;#n;#r;#i;#a;get groupBy(){return this.#e}set groupBy(e){this.#e=e,this.requestUpdate()}get factory(){return this.#t}set factory(e){e!==this.#t&&(this.#s(),this.#t=e,this.requestUpdate())}get provider(){return this.#a.provider}set provider(e){this.#a.provider=e,e&&this.#a.request(void 0)}get selectedItems(){let e=new Set;for(let n of this.#n.values())for(let r of n.selectedItems)e.add(r);return e}dispatch(e,n){for(let r of this.#n.values())r.dispatch(e,n)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener(`select`,this.#d)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`select`,this.#d)}updated(e){super.updated(e),e.has(`grouped`)&&this.#s(),this.#c()}render(){return this.#t?this.grouped?this.#e?(this.#r=this.#o(),i`${_(this.#r.keys(),e=>e,e=>i`<ixfx-panel data-group-key=${e} .title=${e}></ixfx-panel>`)}`):a:i`<div class="ungrouped-host"></div>`:a}#o(){let e=new Map;if(!this.#e)return e;for(let n of this.#a.items){let r=this.#e(n),i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return e}#s(){for(let e of this.#n.values())e.remove();this.#n.clear()}#c(){if(this.#t){if(!this.grouped){this.#l();return}this.#e&&this.#u()}}#l(){let e=this.querySelector(`.ungrouped-host`);if(!e)return;let n=this.#n.get(sb);n||(n=this.#t(void 0),e.appendChild(n),this.#n.set(sb,n)),n.setItems(this.#a.items)}#u(){let e=this.#r??this.#o();for(let n of[...this.#n.keys()])e.has(n)||(this.#n.get(n)?.remove(),this.#n.delete(n));for(let[n,r]of e){let e=[...this.children].find(e=>e instanceof HTMLElement&&e.dataset.groupKey===n);if(!e)continue;let i=this.#n.get(n);i||(i=this.#t(n),e.appendChild(i),this.#n.set(n,i)),i.setItems(r)}}#d};E([d({type:Boolean,reflect:!0})],cb.prototype,`grouped`,void 0),E([d({type:Boolean,attribute:`cross-group-selection`,reflect:!0})],cb.prototype,`crossGroupSelection`,void 0),cb=E([T(`ixfx-grouped-item-lister`)],cb);const lb=`application/x-ixfx-tree`,ub=new Map,db=new Map;let fb,pb=0;function mb(){return`tree-drag-${++pb}-${Date.now()}`}function hb(e,n,r,i){ub.set(e,{sourceId:e,nodes:r,keys:i}),db.set(e,new WeakRef(n)),fb=e}function gb(e){ub.delete(e),db.delete(e),fb===e&&(fb=void 0)}function _b(){if(fb===void 0)return;let e=ub.get(fb);if(e)return{sourceId:fb,keys:e.keys,nodes:e.nodes,element:db.get(fb)?.deref()}}function vb(e,n,r){return Math.max(n,Math.min(r,e))}var yb=class{#e;#t;#n=!1;#r;#i=`internal`;#a=[];#o=[];#s;#c;#l=0;#u=0;#d=0;#f;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}get isDragging(){return this.#n}get isRejected(){return this.#n&&this.#r===void 0}get dropState(){return this.#r}hostConnected(){this.#p()}hostUpdated(){this.#p()}#p(){let e=this.#t.getScrollContainer();!e||e===this.#f||(this.#m(),this.#f=e,e.addEventListener(`dragenter`,this.#h),e.addEventListener(`dragover`,this.#g),e.addEventListener(`dragleave`,this.#v),e.addEventListener(`drop`,this.#y))}#m(){let e=this.#f;e&&(e.removeEventListener(`dragenter`,this.#h),e.removeEventListener(`dragover`,this.#g),e.removeEventListener(`dragleave`,this.#v),e.removeEventListener(`drop`,this.#y),this.#f=void 0)}hostDisconnected(){this.#m(),this.#w(),this.#D(),this.#n=!1,this.#r=void 0}#h=e=>{this.#t.getDndMode()===`none`||!e.dataTransfer||this.#t.resolveDrag(e.dataTransfer,`hover`)!==void 0&&(e.preventDefault(),this.#n||(this.#n=!0,this.#t.onActiveChange(!0)))};#g=e=>{if(this.#t.getDndMode()===`none`||!e.dataTransfer)return;this.#u=e.clientX,this.#d=e.clientY;let n=this.#t.resolveDrag(e.dataTransfer,`hover`);if(!n){this.#_(e);return}this.#n||(this.#n=!0,this.#t.onActiveChange(!0)),this.#i=n.source,this.#a=n.keys,this.#o=n.nodes;let r=this.#t.getVisibleRows();this.#C(this.#x(r,e.clientY)),this.#T();let i=this.#S(e,r,n.source);if(!i){this.#_(e,!1);return}let a={source:n.source,dragged:n.nodes.length>0?n.nodes:void 0,draggedKeys:n.keys,target:i,dataTransfer:e.dataTransfer};if(!this.#t.vet(a)){this.#_(e,!1);return}e.preventDefault(),e.dataTransfer.dropEffect=n.source===`internal`?`move`:`copy`,this.#O(i)};#_(e,n=!0){e.dataTransfer&&(e.dataTransfer.dropEffect=`none`),this.#O(void 0),n&&this.#w()}#v=e=>{let n=this.#t.getScrollContainer(),r=e.relatedTarget;n&&r&&n.contains(r)||this.#b()};#y=e=>{if(!e.dataTransfer){this.#b();return}e.preventDefault(),this.#D(),this.#w();let n=e=>{this.#r=void 0,this.#n=!1,this.#t.onDropStateChange(void 0),this.#t.onActiveChange(!1),this.#t.onDragEnd(e)};if(this.#t.getDndMode()===`none`){n(!1);return}let r=this.#t.resolveDrag(e.dataTransfer,`drop`);if(!r){n(!1);return}this.#a=r.keys,this.#o=r.nodes;let i=this.#S(e,this.#t.getVisibleRows(),r.source);if(!i){n(!1);return}let a={source:r.source,dragged:r.nodes.length>0?r.nodes:void 0,draggedKeys:r.keys,target:i,dataTransfer:e.dataTransfer};if(!this.#t.vet(a)){n(!1);return}let o={...a,external:r.source===`external`?r.nodes:void 0};n(this.#t.commitDrop(o))};#b(){this.#w(),this.#D(),this.#r!==void 0&&(this.#r=void 0,this.#t.onDropStateChange(void 0)),this.#n&&(this.#n=!1,this.#t.onActiveChange(!1))}#x(e,n){if(e.length!==0)return n<e[0].rect.top?e[0]:n>e[e.length-1].rect.bottom?e[e.length-1]:e.find(e=>n>=e.rect.top&&n<=e.rect.bottom)??e[e.length-1]}#S(e,n,r){if(n.length===0)return;let i=this.#x(n,e.clientY);if(!i)return;let a=vb((e.clientY-i.rect.top)/i.rect.height,0,1),o=a<.25?`before`:a>.75?`after`:`inside`,s=i.node.item.isLeaf===!0;o===`inside`&&s&&(o=`after`);let c=!1;o===`after`&&!s&&this.#t.isExpanded(i.key)&&(o=`inside`,c=!0);let l,u,d,f;if(o===`inside`)l=i.key,u=i.key,d=i.depth+1,f=c?0:i.node.children?.length??0;else{let r=this.#t.getIndentPx()||1,a=n[0].rect.left,s=vb(Math.round((e.clientX-a)/r),0,i.depth),c={node:i.node,depth:i.depth,parentKey:this.#t.getRowInfo(i.key)?.parentKey};u=i.key;for(let e=i.depth-s;e>0&&c.parentKey!==void 0;e--){let e=this.#t.getRowInfo(c.parentKey);if(!e)break;u=c.parentKey,c=e}d=c.depth,l=c.parentKey;let p=this.#t.getChildren(l).findIndex(e=>e.item.key===u);f=(p<0?0:p)+ +(o===`after`)}if(r===`internal`){for(let e of this.#a)if(e===l||e===u||l!==void 0&&this.#t.isSelfOrDescendant(e,l)||o!==`inside`&&this.#t.isSelfOrDescendant(e,u))return;if(this.#a.length>0&&!this.#t.isReorderAllowed()&&!this.#a.some(e=>this.#t.getParentKey(e)!==l))return}return{parentKey:l,index:f,referenceKey:u,position:o,depth:d}}#C(e){if(!e||e.node.item.isLeaf===!0||this.#t.isExpanded(e.key)){this.#w();return}if(e.key===this.#c)return;this.#w();let n=this.#c=e.key;this.#s=setTimeout(()=>{this.#s=void 0,this.#c===n&&(this.#c=void 0,this.#t.expandKey(n))},Math.max(0,this.#t.getExpandHoverMs()))}#w(){this.#s!==void 0&&(clearTimeout(this.#s),this.#s=void 0),this.#c=void 0}#T(){this.#l===0&&(this.#l=requestAnimationFrame(this.#E))}#E=()=>{if(this.#l=0,!this.#n)return;let e=this.#t.getScrollContainer();if(!e)return;let n=e.getBoundingClientRect(),r=this.#d-n.top,i=0;r<24?i=-Math.ceil(16*(1-Math.max(0,r)/24)):r>n.height-24&&(i=Math.ceil(16*(1-Math.max(0,n.height-r)/24))),i!==0&&this.#u>=n.left&&this.#u<=n.right&&(e.scrollTop+=i,this.#T())};#D(){this.#l!==0&&(cancelAnimationFrame(this.#l),this.#l=0)}#O(e){let n=e===void 0?this.#r===void 0:e.referenceKey===this.#r?.referenceKey&&e.position===this.#r?.position&&e.depth===this.#r?.depth&&e.index===this.#r?.index;this.#r=e,(!n||this.#n)&&this.#t.onDropStateChange(e)}};function bb(e,n){let r=[],i=new Map,a=[],o=(e,r,i)=>{if(!e||e.length===0)return;let o=e.filter(e=>n.isShown(e,r));for(let e=o.length-1;e>=0;e--)a.push({node:o[e],depth:r,parentKey:i,posInSet:e+1,setSize:o.length})};for(o(e.children,0,void 0);a.length>0;){let{node:e,depth:s,parentKey:c,posInSet:l,setSize:u}=a.pop();i.set(e.item.key,r.length),r.push({node:e,depth:s,parentKey:c,posInSet:l,setSize:u}),e.children&&e.children.length>0&&n.isExpanded(e,s)&&o(e.children,s+1,e.item.key)}return{rows:r,indexByKey:i}}function xb(e){let n=new Map,r=new Set,i=[];if(e.children)for(let r of e.children)n.set(r.item.key,e.item.key),i.push({node:r,depth:0,parentKey:e.item.key});for(;i.length>0;){let{node:e,depth:a,parentKey:o}=i.pop();if(n.set(e.item.key,o),e.item.icon&&r.add(a),e.children)for(let n=e.children.length-1;n>=0;n--){let r=e.children[n];i.push({node:r,depth:a+1,parentKey:e.item.key})}}return{parentByKey:n,depthsWithIcons:r}}function Sb(e,n){let r=new Set;if(!e.children)return r;let i=[],a=(e,r)=>{i.push({node:e,depth:r,next:0,matched:n(e,r)})};for(let n of e.children)for(a(n,0);i.length>0;){let e=i[i.length-1],n=e.node.children;if(n&&e.next<n.length){a(n[e.next++],e.depth+1);continue}i.pop(),e.matched&&(r.add(e.node.item.key),i.length>0&&(i[i.length-1].matched=!0))}return r}function Cb(e,n,r){if(r.size===0)return[...e];let i=new Set;for(let n of e)i.add(n.node.item.key);let a=Symbol(`end`),o=new Map,s=a;for(let e=n.length-1;e>=0;e--){let a=n[e];if(i.has(a)){s=a;continue}let c=r.get(a);if(!c)continue;let l=o.get(s);l?l.push(c):o.set(s,[c])}let c=[];for(let n of e){let e=o.get(n.node.item.key);if(e)for(let n=e.length-1;n>=0;n--)c.push(e[n]);c.push(n)}let l=o.get(a);if(l)for(let e=l.length-1;e>=0;e--)c.push(l[e]);return c}function wb(e,n){let r=new Map;if(!e.children)return r;let i=[];for(let a of e.children)for(i.push({node:a,next:0,checked:0,unchecked:0,counted:0});i.length>0;){let e=i[i.length-1],{node:a}=e,o=a.children,s=a.item.isLeaf||!o?.length;if(!s&&e.next<o.length){i.push({node:o[e.next++],next:0,checked:0,unchecked:0,counted:0});continue}i.pop();let c;c=s?n.has(a)?`checked`:`unchecked`:e.counted===0?`unchecked`:e.checked===e.counted?`checked`:e.unchecked===e.counted?`unchecked`:`indeterminate`,r.set(a.item.key,c);let l=s&&a.item.selectable===!1;if(i.length>0&&!l){let e=i[i.length-1];e.counted++,c===`checked`?e.checked++:c===`unchecked`&&e.unchecked++}}return r}function Tb(e,n){if(e.has(n))return e;let r=new Set(e);return r.add(n),r}function Eb(e,n){if(!e.has(n))return e;let r=new Set(e);return r.delete(n),r}function Db(e,n){let r;for(let i of e)n(i)&&(r??=new Set(e),r.delete(i));return r??e}function Ob(e){return Math.max(1,e.rowHeight+e.gap)}function kb(e,n){return e.listOffset+n*Ob(e)+e.gap}function Ab(e,n){return kb(e,n)+e.rowHeight}function jb(e,n,r=5){let{count:i}=e;if(i<=0)return{start:0,end:0};let a=Ob(e),o=Math.max(0,n-e.listOffset),s=Math.floor(o/a),c=Math.ceil((o+e.viewportHeight)/a),l=Math.min(i,Math.max(0,s-r));return{start:l,end:Math.min(i,Math.max(l,c+r))}}function Mb(e,n,r,i=0){if(n<0||n>=e.count)return r;let a=kb(e,n),o=a+e.rowHeight;return a<r+i?n===0?0:Math.max(0,a-i):o>r+e.viewportHeight?Math.max(0,o-e.viewportHeight):r}function Nb(e,n,r,i=0){if(n<0||n>=e.count)return r;let a=kb(e,n),o=a+e.rowHeight;if(a>=r+i&&o<=r+e.viewportHeight)return r;let s=a+e.rowHeight/2-(e.viewportHeight+i)/2;return Math.max(0,s)}function Pb(e){return Math.max(1,Math.floor(e.viewportHeight/Ob(e))-1)}function Fb(e){return{count:e.count,topOf:n=>kb(e,n),bottomOf:n=>Ab(e,n)}}function Ib(e,n){let r=0,i=e.count;for(;r<i;){let a=r+i>>>1;e.bottomOf(a)>n?i=a:r=a+1}return r}function Lb(e,n,r,i=0){if(e.count===0)return;let a=Math.min(Ib(e,n),e.count-1),o=a,s=e.count;for(;o<s;){let n=o+s>>>1;e.topOf(n)>=r?s=n:o=n+1}let c=Math.max(a,o-1);return{first:Math.max(0,a-i),last:Math.min(e.count-1,c+i)}}const Rb={rows:[],indexByKey:new Map};let q=class extends n{constructor(...e){super(...e),this.exclusivity=`none`,this.selectionFilter=`all`,this.interactionMode=`standard`,this._selectedNodes=new Set,this.disableKeyboardNavigation=!1,this.registry=void 0,this.itemDnd=`none`,this.dndExpandHoverMs=500,this.reorderable=!0,this.stickyHeaders=!0,this.virtualize=`auto`,this.virtualizeThreshold=200,this.applyInternalDrop=!0,this._expandedKeys=new Set,this.#i=0,this._selectionVersion=0,this._scrollTop=0,this.#l={rowHeight:30,gap:1,listOffset:0},this.#u=0,this.#d=0,this.#m=0,this.#h=0,this.#g=!1,this.#S=()=>{this.#d===0&&(this.#d=requestAnimationFrame(()=>{this.#d=0,this.#C()}))},this.tickled=new ie(this,{getItems:()=>this.#s().rows.map(({node:e})=>({id:e.item.key,enabled:!0})),hoverDisabled:()=>this.#J?.isDragging===!0||this.#Y?.isDragging===!0,onStateChange:()=>{this.setAttribute(`data-input-mode`,this.tickled.inputMode)}}),this._focusedDepth=0,this.search=new Bt(this,{adapter:Ut(this,{labelSelector:`.tree-label`,highlightKey:`incr-search-highlight`})}),this.#I={indent:20},this.#L=[],this.#R=[],this.#z=new Map,this.#B=new Map,this.#V=new Set,this.#H=new Map,this.#U=new Map,this.#W=!1,this.#G=``,this.#X=new Set,this.#Z=!1,this.#$=()=>{this.#Q=void 0},this.#te=()=>{this.#de===0&&(this.#de=requestAnimationFrame(()=>{this.#de=0,this.#re()}))},this._stickyKeys=[],this.#le=new Map,this.#ue=!0,this.#de=0,this.#pe=!1,this.#Ie=`user`,this.#Le=!1,this.#$e=0,this.#dt=e=>{if(this.search.isOpen)return;let n=this.#s().rows;if(n.length===0)return;if((e.ctrlKey||e.metaKey)&&e.key===`a`){e.preventDefault(),this.selectAll();return}[`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`,`Home`,`End`,`PageUp`,`PageDown`,`Enter`,` `].includes(e.key)&&this.tickled.setInputMode(`keyboard`);let r=this.#ot();switch(e.key){case`ArrowDown`:e.preventDefault(),this.#ut(n,r,Math.min(r+1,n.length-1),e.shiftKey);break;case`ArrowUp`:e.preventDefault(),this.#ut(n,r,Math.max(r-1,0),e.shiftKey);break;case`Home`:e.preventDefault(),this.#ut(n,r,0,e.shiftKey);break;case`End`:e.preventDefault(),this.#ut(n,r,n.length-1,e.shiftKey);break;case`PageDown`:{e.preventDefault();let i=this.#lt();this.#ut(n,r,Math.min(r+i,n.length-1),e.shiftKey);break}case`PageUp`:{e.preventDefault();let i=this.#lt();this.#ut(n,r,Math.max(r-i,0),e.shiftKey);break}case`ArrowRight`:{e.preventDefault();let i=n[r];i&&i.node.item.isLeaf!==!0&&(this._expandedKeys.has(i.node.item.key)?r+1<n.length&&this.#st(r+1):this.#Ke(i.node,i.depth)),this.requestUpdate();break}case`ArrowLeft`:{e.preventDefault();let i=n[r];if(i&&this._expandedKeys.has(i.node.item.key))this.#e(Eb(this._expandedKeys,i.node.item.key)),this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:i.node,depth:i.depth},bubbles:!0,composed:!0}));else if(i.depth>0){let e=i.depth-1;for(let i=r-1;i>=0;i--)if(n[i].depth===e){this.#st(i);break}}this.requestUpdate();break}case`Enter`:{e.preventDefault();let i=n[r];i&&(this.interactionMode!==`manual`&&this.interactionMode!==`checked`&&this.select(i.node),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:i.node,depth:i.depth},bubbles:!0,composed:!0})),this.requestUpdate());break}case` `:{e.preventDefault();let i=n[r];if(!i)break;this.interactionMode===`checked`?this._handleCheckboxClick(new MouseEvent(`click`),i.node,i.depth):(this.interactionMode===`standard`||this.interactionMode===`vscode`||this.interactionMode===`manual`)&&this.#Ge(i.node,i.depth);break}case`Escape`:e.preventDefault(),this.#tt()}},this.#ft=e=>{let n=e.target.closest(`ul.tree-list li`);if(!n)return;let r=n.dataset.key;if(!r)return;let i=this.#s(),a=i.indexByKey.get(r),o=a===void 0?void 0:i.rows[a];if(!o)return;let s={node:o.node,depth:o.depth};this.dispatchEvent(new CustomEvent(`item-dblclick`,{detail:s,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`activate`,{detail:s,bubbles:!0,composed:!0}))}}get selectedNodes(){return this._selectedNodes}#e(e){e!==this._expandedKeys&&(this._expandedKeys=e,this.#t=void 0,this.#ue=!0)}#t;#n;#r;#i;#a;#o;invalidateStructure(){this.#i++,this.#t=void 0,this.requestUpdate()}#s(){if(!this.root)return Rb;if(this.#t&&this.#n===this.root&&this.#r===this.filterPredicate)return this.#t;let e=this.#D();return this.#t=bb(this.root,{isExpanded:(e,n)=>this._isExpanded(e,n),isShown:e?n=>e.matches.has(n.item.key):()=>!0}),this.#n=this.root,this.#r=this.filterPredicate,this.#t}#c(){let e=this.root;if(!e)return{parentByKey:new Map,depthsWithIcons:new Set};let n=this.#a;if(n&&n.root===e&&n.version===this.#i)return n.index;let r=xb(e);return this.#a={root:e,version:this.#i,index:r},r}#l;#u;#d;#f;#p;#m;#h;#g;#_(){return this.virtualize===`off`?!1:this.virtualize===`on`||this.#s().rows.length>this.virtualizeThreshold}#v(e){return{count:e,rowHeight:this.#l.rowHeight,gap:this.#l.gap,listOffset:this.#l.listOffset,viewportHeight:this.#u>0?this.#u:600}}#y(){let e=this.renderRoot.querySelector(`ul.tree-list`),n=e?.querySelector(`li.item:not(.leaving)`),r=n?.getBoundingClientRect().height??0,i=r>0?r:this.#Se(),a=n?Number.parseFloat(getComputedStyle(n).marginTop):NaN,o=Number.isNaN(a)?Number.parseFloat(getComputedStyle(this).getPropertyValue(`--tree-item-gap`)):a,s=Number.isNaN(o)?1:o,c=this.#l.listOffset;if(e){let n=Number.parseFloat(getComputedStyle(e).paddingTop);c=e.offsetTop+(Number.isNaN(n)?0:n)}let l=this.#be()?.clientHeight??0,u=l>0&&l!==this.#u;l>0&&(this.#u=l);let d=this.#l,f=d.rowHeight!==i||d.gap!==s||d.listOffset!==c;return this.#l={rowHeight:i,gap:s,listOffset:c},f||u}#b(e){return jb(this.#v(e),this._scrollTop)}#x(){let e=this.#be()?.scrollTop;e!==void 0&&e!==this._scrollTop&&(this._scrollTop=e)}#S;#C(){let e=this.#be();if(!e||!this.root||!this.#_())return;let n=e.scrollTop;if(n===this._scrollTop)return;let r=jb(this.#v(this.#s().rows.length),n);(r.start!==this.#m||r.end!==this.#h)&&(this._scrollTop=n)}#w(){let e=this.#be();e!==this.#f&&(this.#f?.removeEventListener(`scroll`,this.#S),this.#p?.disconnect(),this.#p=void 0,this.#f=e,e&&(e.addEventListener(`scroll`,this.#S,{passive:!0}),typeof ResizeObserver<`u`&&(this.#p=new ResizeObserver(e=>{let n=e.at(-1)?.contentRect.height??0;n>0&&n!==this.#u&&this.#_()&&this.requestUpdate()}),this.#p.observe(e))))}#T(){this.#f?.removeEventListener(`scroll`,this.#S),this.#f=void 0,this.#p?.disconnect(),this.#p=void 0,this.#d!==0&&(cancelAnimationFrame(this.#d),this.#d=0)}#E(e,n=`edge`){let r=this.#be();if(!r)return;let i=this.#v(this.#s().rows.length),a=this.renderRoot.querySelector(`.sticky-headers`)?.getBoundingClientRect().height??0,o=(n===`center-if-hidden`?Nb:Mb)(i,e,r.scrollTop,a);(o!==r.scrollTop||o!==this._scrollTop)&&(r.scrollTop=o,this._scrollTop=o)}#D(){let e=this.filterPredicate,n=this.root;if(!e||!n)return;let r=this.#o;if(r&&r.predicate===e&&r.root===n&&r.version===this.#i)return r;let i=Sb(n,e),{parentByKey:a}=this.#c(),o=new Set;for(let e of i){let n=a.get(e);n!==void 0&&o.add(n)}let s={predicate:e,root:n,version:this.#i,matches:i,autoExpanded:o};return this.#o=s,s}get _structureVersion(){return this.#i}get _depthsWithIcons(){return this.#c().depthsWithIcons}#O;#k(){let e=this.searchModes?.trim();if(e===void 0)return[...Rt];let n=new Set(e.split(/\s+/));return Rt.filter(e=>n.has(e))}#A(){this.#F&&(this.search.setModes(this.#k()),this.#O?.(),this.#O=Lt(this.#F,this.search))}#j;#M;#N;#P;#F;#I;#L;#R;#z;#B;#V;#H;#U;#W;#G;#K;#q;#J;#Y;#X;#Z;#Q;#$;#ee(){let e=this.#be();this.stickyHeaders&&e?(!this.#pe||this.#fe!==e)&&(this.#fe?.removeEventListener(`scroll`,this.#te),e.addEventListener(`scroll`,this.#te,{passive:!0}),this.#fe=e,this.#pe=!0):this.#pe&&=(this.#fe?.removeEventListener(`scroll`,this.#te),this.#fe=void 0,!1)}#te;#ne(e){return{count:e.length,topOf:n=>e[n].offsetTop,bottomOf:n=>e[n].offsetTop+e[n].offsetHeight}}#re(){this.#ue=!1;let e=new Map,n=()=>this.#ie([],e);if(!this.stickyHeaders||!this.root)return n();let r=this.#be(),i=this.renderRoot.querySelector(`ul.tree-list`);if(!r||!i)return n();let a=this.#s(),o=this.#_(),s=i.children,c=this.#R;if(a.rows.length===0||!o&&(s.length===0||s.length!==c.length))return n();let l=o?Fb(this.#v(a.rows.length)):this.#ne(s),u=r.scrollTop,d=u+(this.renderRoot.querySelector(`.sticky-headers`)?.getBoundingClientRect().height??0),f=Ib(l,u);if(!o)for(;f<s.length&&s[f].classList.contains(`leaving`);)f++;if(f>=l.count)return n();let p=o?f:a.indexByKey.get(c[f]);if(p===void 0)return n();let m=[],h=a.rows[p].parentKey;for(;h!==void 0;){let e=a.indexByKey.get(h);if(e===void 0)break;m.unshift(a.rows[e]),h=a.rows[e].parentKey}let g=new Map,_=[];for(let e of m){let n=e.node.item.key,r=o?a.indexByKey.get(n):this.#z.get(n);r===void 0||l.bottomOf(r)>d||(_.push(n),g.set(n,{node:e.node,depth:e.depth}))}this.#ie(_,g)}#ie(e,n){let r=this._stickyKeys;r.length===e.length&&r.every((n,r)=>n===e[r])||(this.#le=n,this._stickyKeys=e)}#ae(){return!this.stickyHeaders||this._stickyKeys.length===0?a:i`
7742
7742
  <div class="sticky-anchor">
7743
7743
  <div class="sticky-headers" part="sticky-headers">
7744
7744
  ${this._stickyKeys.map(e=>{let n=this.#le.get(e);return n?this.#oe(n.node,n.depth):a})}
@@ -7756,13 +7756,13 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
7756
7756
  @click=${n=>this.#se(n,e)}
7757
7757
  @keydown=${n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),this.#ce(e))}}
7758
7758
  >${this.renderNodeContent(e,n)}</div>
7759
- `}#se(e,n){if(!(this.#J?.isDragging||this.#Y?.isDragging)){if(n.item.isLeaf!==!0&&e.target instanceof Element&&e.target.closest(`.tree-caret`)){let e=this.#le.get(n.item.key)?.depth??0;this.#Ke(n,e),this.#ue=!0,this.requestUpdate();return}this.#ce(n)}}#ce(e){this.#Pe(e)&&this.select(e),this.#Qe(e.item.key),this.#ue=!0,this.requestUpdate()}#le;#ue;#de;#fe;#pe;get nativeDrag(){return this.#Y}get dropState(){return this.#q}get nativeDragKeys(){return this.#X}#me(e){this.#U.get(e)?.cancel(),this.#U.delete(e)}#he(){for(let e of this.#U.values())try{e.cancel()}catch{}this.#U.clear()}willUpdate(e){super.willUpdate(e);let n=this.#t!==void 0&&e.size===1&&e.has(`_scrollTop`)&&this.#_();if(this.#g=n,n){this.#x();return}this.#t=void 0,(e.has(`root`)||e.has(`model`))&&this.#i++,this.#ge(e.has(`filterPredicate`));let r=this.#_();this.toggleAttribute(`data-virtual`,r),r&&(this.#y(),this.#x()),(e.has(`root`)||e.has(`model`)||e.has(`filterPredicate`)||e.has(`stickyHeaders`))&&(this.#ue=!0),this.#ue&&this.#re()}#ge(e){let n=this.#s().rows;if(this.#_()){this.#V.clear(),this.#he(),this.#H.clear(),this.#L=[];return}let r=new Set(n.map(e=>e.node.item.key));if(this.#V.clear(),e)this.#he(),this.#H.clear();else if(this.#W&&this.#L.length>0){let e=new Set(this.#L);for(let{node:r}of n)e.has(r.item.key)||this.#V.add(r.item.key);this.#V.size>50&&this.#V.clear();for(let e of this.#L)if(!r.has(e)&&!this.#H.has(e)){let n=this.#B.get(e);n&&this.#H.set(e,n)}}for(let e of[...this.#H.keys()])r.has(e)&&(this.#me(e),this.#H.delete(e));this.#H.size>50&&(this.#he(),this.#H.clear())}_isLeaving(e){return this.#H.has(e.item.key)}_isFilteredOut(e,n){return!1}#_e(){if(this.#V.size>0){for(let e of this.renderRoot.querySelectorAll(`.item`)){let n=e.dataset.key;if(!(n===void 0||!this.#V.has(n))){if(this.#U.has(n))this.#me(n);else for(let n of e.getAnimations())n.cancel();Gn(e)}}this.#V.clear()}if(this.#H.size>0)for(let e of this.renderRoot.querySelectorAll(`.item.leaving`)){let n=e.dataset.key;if(n===void 0||this.#U.has(n))continue;let r=Jn(e),i=r.animation;if(!i){r.then(()=>{this.#H.has(n)&&(this.#H.delete(n),this.requestUpdate())});continue}this.#me(n),this.#U.set(n,i),r.then(()=>{this.#U.get(n)===i&&(this.#U.delete(n),this.#H.delete(n),this.requestUpdate(),this.updateComplete.then(()=>{try{i.cancel()}catch{}}))})}let e=this.#s().rows;this.#L=e.map(e=>e.node.item.key),this.#B.clear();for(let n of e)this.#B.set(n.node.item.key,n);this.#W=!0}updated(e){if(this.#Q=void 0,this.#w(),this.#g){this.#g=!1,this.#ve();return}if(this.#ee(),e.has(`root`)&&this.root&&(this.#tt(),this.#e(new Set),this.#Fe(),this.tickled.clearTickled(),this._focusedDepth=0,this.#he(),this.#H.clear(),this.#V.clear()),e.has(`model`)){this.#N?.(),this.#N=void 0;let e=this.model;e&&(this.root=e.root,this.#N=e._subscribe(e=>{e.type===`root`?(this.root=e.root,this.requestUpdate()):e.type===`invalidate`&&this._expandedKeys.has(e.key)&&(this.#e(Eb(this._expandedKeys,e.key)),this.requestUpdate())}))}e.has(`interactionMode`)&&(this.#P=void 0,this.clearSelection()),e.has(`selectedNode`)&&this.selectedNode&&e.get(`selectedNode`)!==this.selectedNode&&this.tickled.setTickled(this.selectedNode.item.key),this.#_()?(this.#L=[],this.#B.clear(),this.#y()&&queueMicrotask(()=>this.requestUpdate()),this.#ve()):this.#_e()}#ve(){this.search.isOpen&&this.search.repaintHighlights()}connectedCallback(){super.connectedCallback(),this.setAttribute(`data-input-mode`,`mouse`);let e=this.#F=Jt();e.register({id:`select-all`,label:`Select All`,description:`Select all visible items`,execute:()=>this.selectAll()}),e.register({id:`deselect-all`,label:`Deselect All`,description:`Clear all selection`,execute:()=>this.deselectAll()}),this.registry=e,this.#A(),this.#ye()}#ye(){this.#G=mb(),this.#Y=new Yn(this,{source:`tree-list`,isEnabled:()=>this.itemDnd!==`none`&&this.#je(),resolveEventToKey:e=>{if(e instanceof Element)return e.closest(`ul.tree-list li[data-key]`)?.getAttribute(`data-key`)??void 0},prepareSelection:e=>{let n=this.#s(),r=n.rows,i=n.indexByKey.get(e),a=i===void 0?void 0:r[i];if(!a)return;let o=new Set(this._selectedNodes);o.has(a.node)||o.clear(),o.add(a.node);let s=r.filter(e=>o.has(e.node)).map(e=>e.node.item.key),c=new Set(this.root?yg(this.root,s):s),l=r.filter(e=>c.has(e.node.item.key)).map((e,n)=>({key:e.node.item.key,index:n,item:e.node,element:this.shadowRoot?.querySelector(`ul.tree-list li[data-key="${CSS.escape(e.node.item.key)}"]`)??void 0})),u=l.find(n=>n.key===e)??{key:e,index:0,item:a.node,element:void 0};return l.some(e=>e.key===u.key)||l.unshift(u),{origin:u,selected:l}},getMetrics:()=>({rowHeight:this.#Se()}),getRenderer:()=>this.dragPreviewRenderer,getDragPreviewSourceResolver:()=>this.dragPreviewSource,dispatch:e=>{let n=e.selected.map(e=>e.key),r=e.selected.map(e=>e.item),i=new CustomEvent(`list-native-drag-start`,{detail:e,bubbles:!0,composed:!0,cancelable:!0}),a=this.dispatchEvent(i);return a&&(this.#X=new Set(n),this.#Z=!1,(this.itemDnd===`internal`||this.itemDnd===`both`)&&hb(this.#G,this,r,n),this.dispatchEvent(new CustomEvent(`tree-drag-start`,{detail:{nodes:r,keys:n},bubbles:!0,composed:!0}))),a},writeDataTransfer:(e,n)=>{if(this.itemDnd!==`internal`&&this.itemDnd!==`both`)return;let r=n.selected.map(e=>e.key),i=n.selected.map(e=>e.item);try{e.setData(lb,JSON.stringify({sourceId:this.#G,keys:r,nodes:i})),e.setData(`text/plain`,i.map(e=>e.item.label).join(`
7760
- `))}catch{}},onActiveChange:e=>{this.toggleAttribute(`data-native-dragging`,e),e||(this.#X=new Set),this.requestUpdate()},onEnd:()=>{gb(this.#G),this.#X=new Set,this.#K=setTimeout(()=>{this.#K=void 0},150),this.#Z||this.dispatchEvent(new CustomEvent(`tree-drag-end`,{detail:{dropped:!1},bubbles:!0,composed:!0})),this.#Z=!1}}),this.#J=new yb(this,{getDndMode:()=>this.itemDnd,getExpandHoverMs:()=>this.dndExpandHoverMs,getVisibleRows:()=>this.#Te(),getRowInfo:e=>{let n=this.#s(),r=n.indexByKey.get(e);if(r===void 0)return;let{node:i,depth:a,parentKey:o}=n.rows[r];return{node:i,depth:a,parentKey:o}},getChildren:e=>this.#Ce(e),getIndentPx:()=>this.#xe(),getScrollContainer:()=>this.#be(),isSelfOrDescendant:(e,n)=>this.#De(e,n),isExpanded:e=>this._expandedKeys.has(e),isReorderAllowed:()=>this.reorderable,getParentKey:e=>this.#Oe(e)?.item.key,resolveDrag:(e,n)=>this.#Ae(e,n),vet:e=>{if(this.canDrop&&!this.canDrop(e))return!1;let n=new CustomEvent(`tree-drag-over`,{detail:e,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(n)},expandKey:e=>this.#Ee(e),onDropStateChange:e=>{this.#q=e,this.toggleAttribute(`data-drop-rejected`,this.#J.isDragging&&e===void 0),this.requestUpdate()},onActiveChange:e=>{e?(this.#Q=void 0,this.#be()?.addEventListener(`scroll`,this.#$,{passive:!0})):(this.#be()?.removeEventListener(`scroll`,this.#$),this.#Q=void 0,this.toggleAttribute(`data-drop-rejected`,!1)),this.requestUpdate()},commitDrop:e=>this.dispatchEvent(new CustomEvent(`tree-drop`,{detail:e,bubbles:!0,composed:!0,cancelable:!0}))?(this.applyInternalDrop&&e.source===`internal`&&this.model&&this.model.applyDrop({source:`internal`,draggedKeys:e.draggedKeys,target:e.target}),this.#Z=!0,!0):!1,onDragEnd:e=>{this.#q=void 0,this.toggleAttribute(`data-drop-rejected`,!1),this.requestUpdate(),this.dispatchEvent(new CustomEvent(`tree-drag-end`,{detail:{dropped:e},bubbles:!0,composed:!0}))}})}#be(){return this.shadowRoot?.querySelector(`#container`)??void 0}#xe(){let e=Number.parseInt(getComputedStyle(this).getPropertyValue(`--tree-indent`),10);return Number.isNaN(e)?20:e}#Se(){let e=Number.parseInt(getComputedStyle(this).getPropertyValue(`--tree-item-height`),10);return Number.isNaN(e)?30:e}#Ce(e){if(e===void 0)return this.root?.children??[];let n=this.#s(),r=n.indexByKey.get(e);return r===void 0?[]:n.rows[r].node.children??[]}#we(e,n,r){let i=this.#s(),a=this.#v(i.rows.length),o=Lb(Fb(a),e.scrollTop,e.scrollTop+e.clientHeight,1);if(!o)return;let s=e.getBoundingClientRect(),c=n.querySelector(`li.item`)?.getBoundingClientRect()??s;for(let n=o.first;n<=o.last;n++){let{node:o,depth:l}=i.rows[n],u=s.top-e.scrollTop+kb(a,n),d={x:c.left,y:u,left:c.left,right:c.left+c.width,top:u,bottom:u+a.rowHeight,width:c.width,height:a.rowHeight,toJSON:()=>({})};r.push({key:o.item.key,node:o,depth:l,index:n,rect:d})}}#Te(){if(this.#Q)return this.#Q;let e=[],n=this.#be(),r=this.renderRoot.querySelector(`ul.tree-list`),i=this.#R;if(n&&r&&this.#_())this.#we(n,r,e);else if(n&&r&&r.children.length===i.length){let a=this.#s(),o=r.children,s=Lb(this.#ne(o),n.scrollTop,n.scrollTop+n.clientHeight,1);if(s)for(let n=s.first;n<=s.last;n++){let r=o[n];if(r.classList.contains(`leaving`))continue;let s=a.indexByKey.get(i[n]);if(s===void 0)continue;let{node:c,depth:l}=a.rows[s];e.push({key:c.item.key,node:c,depth:l,index:s,rect:r.getBoundingClientRect()})}}return this.#Q=e,e}#Ee(e){if(this._expandedKeys.has(e))return;let n=this.#s(),r=n.indexByKey.get(e),i=r===void 0?void 0:n.rows[r];!i||i.node.item.isLeaf===!0||(this.#Ke(i.node,i.depth),this.#Q=void 0,this.requestUpdate())}#De(e,n){if(e===n)return!0;let{parentByKey:r}=this.#c(),i=r.get(n);for(;i!==void 0;){if(i===e)return!0;i=r.get(i)}return!1}#Oe(e){let n=this.#c().parentByKey.get(e);if(n!==void 0&&n!==this.root?.item.key)return this.#ke(n)}#ke(e){let n=this.#s(),r=n.indexByKey.get(e);if(r!==void 0)return n.rows[r].node;let{parentByKey:i}=this.#c(),a=[];for(let n=e;n!==void 0&&n!==this.root?.item.key;n=i.get(n))a.unshift(n);let o=this.root;for(let e of a)o=o?.children?.find(n=>n.item.key===e);return o}#Ae(e,n){let r=this.itemDnd;if(r===`none`)return;let i=r===`internal`||r===`both`,a=r===`external`||r===`both`,o=[];try{o=Array.from(e.types)}catch{}let s=_b(),c=o.includes(lb)||s!==void 0;if(i&&c){if(s&&s.keys.length>0){let e=this.root?yg(this.root,s.keys):s.keys;return{source:`internal`,keys:e,nodes:e.map(e=>this.#ke(e)).filter(e=>e!==void 0)}}if(n===`drop`)try{let n=e.getData(lb);if(n){let e=JSON.parse(n);return{source:`internal`,keys:e.keys??[],nodes:e.nodes??[]}}}catch{}return{source:`internal`,keys:[],nodes:[]}}if(a&&!c){if(this.acceptDropTypes!==void 0){let n=this.acceptDropTypes.trim().split(/\s+/).filter(Boolean),r=Array.from(e.types);if(n.length>0&&!n.some(e=>r.includes(e)))return}if(n===`drop`){let n=this.parseExternalDrop?.(e);return!n||n.length===0?void 0:{source:`external`,keys:n.map(e=>e.item.key),nodes:n}}return this.parseExternalDrop?{source:`external`,keys:[],nodes:[]}:void 0}}#je(){if(this.itemDnd===`none`)return!1;let e=this.#s().rows;return e.length===0?!1:!this.canDrag||e.some(({node:e})=>this.canDrag({nodes:[e],keys:[e.item.key]}))}disconnectedCallback(){super.disconnectedCallback(),this.#he(),this.#H.clear(),this.#V.clear(),this.#N?.(),this.#N=void 0,this.#O?.(),this.#O=void 0,this.#K!==void 0&&(clearTimeout(this.#K),this.#K=void 0),this.#be()?.removeEventListener(`scroll`,this.#$),this.#T(),this.#pe&&=(this.#fe?.removeEventListener(`scroll`,this.#te),this.#fe=void 0,!1),this.#de!==0&&(cancelAnimationFrame(this.#de),this.#de=0),gb(this.#G),this.#F&&(this.#F.unregister(`select-all`),this.#F.unregister(`deselect-all`),this.#F=void 0,this.registry=void 0)}getConfig(){return{...this.#I}}setConfig(e){this.#I={...this.#I,...e},this.requestUpdate()}select(e){if(!this.#Pe(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,this.#Re(n),this.requestUpdate()}deselect(e){if(!this._selectedNodes.has(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1)),this.#Re(n),this.requestUpdate()}clearSelection(){if(this._selectedNodes.size===0)return;let e=new Set(this._selectedNodes);this.#Fe(),this.#Re(e),this.requestUpdate()}selectAll(){let e=new Set(this._selectedNodes);if(this.interactionMode===`checked`)for(let{node:e}of this.#s().rows)this.#Pe(e)&&this.#Je(e,!0);else{for(let{node:e}of this.#s().rows)this.#Pe(e)&&this._selectedNodes.add(e);this.selectedNode=[...this._selectedNodes].at(-1)}this.#Re(e),this.requestUpdate()}deselectAll(){let e=new Set(this._selectedNodes);if(this.interactionMode===`checked`)for(let{node:e}of this.#s().rows)this.#Pe(e)&&this.#Je(e,!1);else this.#Fe();this.#Re(e),this.requestUpdate()}expandAll(e){this.#Me(!0,e)}collapseAll(e){this.#Me(!1,e)}#Me(e,n){let r=this.root;if(!r)return;let i=r=>e?r<(n??1/0):r>=(n??0),a=[],o=this._expandedKeys,s=(n,r)=>{let c=n.children;if(n.item.isLeaf!==!0&&c!==void 0&&c.length>0&&i(r)){let i=o.has(n.item.key);e&&!i?(o=Tb(o,n.item.key),this._isExpanded(n,r)||a.push({node:n,depth:r})):!e&&i&&(o=Eb(o,n.item.key),a.push({node:n,depth:r}))}for(let e of c??[])s(e,r+1)};for(let e of r.children??[])s(e,0);if(o===this._expandedKeys)return;this.#e(o);let c=e?`expand`:`collapse`;for(let{node:e,depth:n}of a)this.dispatchEvent(new CustomEvent(c,{detail:{node:e,depth:n},bubbles:!0,composed:!0}));this.requestUpdate()}navigateTo(e,n={}){if(!this.root?.children)return!1;let r=this.#Ie,i=this.#Le;this.#Ie=`programmatic`,this.#Le=n.silent===!0;try{return this.#Ne(e,n.reveal??`edge`)}finally{this.#Ie=r,this.#Le=i}}#Ne(e,n){this.#tt(),this.#Fe(),this.tickled.clearTickled(),this._focusedDepth=0;let r=this.root;for(let n of e){let i=r?.children;if(!i)return!1;let a=i.find(e=>e.item.key===n);if(!a)return!1;this.#nt(a.item.key),this.#e(Tb(this._expandedKeys,a.item.key)),n===e.at(-1)&&(this.select(a),this.tickled.setTickled(a.item.key)),r=a}return this.#ue=!0,this.requestUpdate(),this.#Qe(e.at(-1),n),!0}navigateToNode(e){if(!this.root?.children)return!1;let n=this.#ze(this.root.children,e);return n?this.navigateTo(n):!1}revealKey(e){if(!this.root?.children)return!1;let n=this.#ze(this.root.children,n=>n.item.key===e);if(!n)return!1;for(let e=0;e<n.length-1;e++)this.#nt(n[e]),this.#e(Tb(this._expandedKeys,n[e]));return this.tickled.setTickled(e),this.#ue=!0,this.requestUpdate(),this.updateComplete.then(()=>this.#Qe(e)),!0}selectMany(e){let n=new Set(this._selectedNodes);this._selectedNodes=new Set([...e].filter(e=>this.#Pe(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#Re(n),this.requestUpdate()}getNodes(){if(!this.root?.children)return[];let e=[],n=(r,i)=>{if(e.push({node:r,depth:i}),r.children)for(let e of r.children)n(e,i+1)};for(let e of this.root.children)n(e,0);return e}#Pe(e){return this.selectionFilter===`none`?!1:this.selectionFilter===`leaf`?e.item.isLeaf===!0:this.selectionFilter!==`branch`||e.item.isLeaf===!1||e.children!==void 0&&e.children.length>0}#Fe(){this._selectionVersion++,this._selectedNodes.clear(),this.selectedNode=void 0}#Ie;#Le;#Re(e){if(this._selectionVersion++,this.#Le)return;let n={selected:new Set(this._selectedNodes),previous:e,origin:this.#Ie};this.dispatchEvent(new CustomEvent(`select`,{detail:n,bubbles:!0,composed:!0}))}#ze(e,n,r=[]){for(let i of e){let e=[...r,i.item.key];if(n(i))return e;if(i.children?.length){let r=this.#ze(i.children,n,e);if(r)return r}}}renderNodeContent(e,n){let r=e.item.isLeaf!==!0,o=this._isExpanded(e,n);return i`
7759
+ `}#se(e,n){if(!(this.#J?.isDragging||this.#Y?.isDragging)){if(n.item.isLeaf!==!0&&e.target instanceof Element&&e.target.closest(`.tree-caret`)){let e=this.#le.get(n.item.key)?.depth??0;this.#Ke(n,e),this.#ue=!0,this.requestUpdate();return}this.#ce(n)}}#ce(e){this.#Pe(e)&&this.select(e),this.#Qe(e.item.key),this.#ue=!0,this.requestUpdate()}#le;#ue;#de;#fe;#pe;get nativeDrag(){return this.#Y}get dropState(){return this.#q}get nativeDragKeys(){return this.#X}#me(e){this.#U.get(e)?.cancel(),this.#U.delete(e)}#he(){for(let e of this.#U.values())try{e.cancel()}catch{}this.#U.clear()}willUpdate(e){super.willUpdate(e);let n=this.#t!==void 0&&e.size===1&&e.has(`_scrollTop`)&&this.#_();if(this.#g=n,n){this.#x();return}if(this.#t=void 0,(e.has(`root`)||e.has(`model`))&&this.#i++,e.has(`root`)&&this.root&&this._expandedKeys.size>0){let{parentByKey:e}=this.#c();this.#e(Db(this._expandedKeys,n=>!e.has(n)))}this.#ge(e.has(`filterPredicate`));let r=this.#_();this.toggleAttribute(`data-virtual`,r),r&&(this.#y(),this.#x()),(e.has(`root`)||e.has(`model`)||e.has(`filterPredicate`)||e.has(`stickyHeaders`))&&(this.#ue=!0),this.#ue&&this.#re()}#ge(e){let n=this.#s().rows;if(this.#_()){this.#V.clear(),this.#he(),this.#H.clear(),this.#L=[];return}let r=new Set(n.map(e=>e.node.item.key));if(this.#V.clear(),e)this.#he(),this.#H.clear();else if(this.#W&&this.#L.length>0){let e=new Set(this.#L);for(let{node:r}of n)e.has(r.item.key)||this.#V.add(r.item.key);this.#V.size>50&&this.#V.clear();for(let e of this.#L)if(!r.has(e)&&!this.#H.has(e)){let n=this.#B.get(e);n&&this.#H.set(e,n)}}for(let e of[...this.#H.keys()])r.has(e)&&(this.#me(e),this.#H.delete(e));this.#H.size>50&&(this.#he(),this.#H.clear())}_isLeaving(e){return this.#H.has(e.item.key)}_isFilteredOut(e,n){return!1}#_e(){if(this.#V.size>0){for(let e of this.renderRoot.querySelectorAll(`.item`)){let n=e.dataset.key;if(!(n===void 0||!this.#V.has(n))){if(this.#U.has(n))this.#me(n);else for(let n of e.getAnimations())n.cancel();Gn(e)}}this.#V.clear()}if(this.#H.size>0)for(let e of this.renderRoot.querySelectorAll(`.item.leaving`)){let n=e.dataset.key;if(n===void 0||this.#U.has(n))continue;let r=Jn(e),i=r.animation;if(!i){r.then(()=>{this.#H.has(n)&&(this.#H.delete(n),this.requestUpdate())});continue}this.#me(n),this.#U.set(n,i),r.then(()=>{this.#U.get(n)===i&&(this.#U.delete(n),this.#H.delete(n),this.requestUpdate(),this.updateComplete.then(()=>{try{i.cancel()}catch{}}))})}let e=this.#s().rows;this.#L=e.map(e=>e.node.item.key),this.#B.clear();for(let n of e)this.#B.set(n.node.item.key,n);this.#W=!0}updated(e){if(this.#Q=void 0,this.#w(),this.#g){this.#g=!1,this.#ve();return}if(this.#ee(),e.has(`root`)&&this.root&&(this.#tt(),this.#Fe(),this.tickled.clearTickled(),this._focusedDepth=0,this.#he(),this.#H.clear(),this.#V.clear()),e.has(`model`)){this.#N?.(),this.#N=void 0;let e=this.model;e&&(this.root=e.root,this.#N=e._subscribe(e=>{e.type===`root`?(this.root=e.root,this.requestUpdate()):e.type===`invalidate`&&this._expandedKeys.has(e.key)&&(this.#e(Eb(this._expandedKeys,e.key)),this.requestUpdate())}))}e.has(`interactionMode`)&&(this.#P=void 0,this.clearSelection()),e.has(`selectedNode`)&&this.selectedNode&&e.get(`selectedNode`)!==this.selectedNode&&this.tickled.setTickled(this.selectedNode.item.key),this.#_()?(this.#L=[],this.#B.clear(),this.#y()&&queueMicrotask(()=>this.requestUpdate()),this.#ve()):this.#_e()}#ve(){this.search.isOpen&&this.search.repaintHighlights()}connectedCallback(){super.connectedCallback(),this.setAttribute(`data-input-mode`,`mouse`);let e=this.#F=Jt();e.register({id:`select-all`,label:`Select All`,description:`Select all visible items`,execute:()=>this.selectAll()}),e.register({id:`deselect-all`,label:`Deselect All`,description:`Clear all selection`,execute:()=>this.deselectAll()}),this.registry=e,this.#A(),this.#ye()}#ye(){this.#G=mb(),this.#Y=new Yn(this,{source:`tree-list`,isEnabled:()=>this.itemDnd!==`none`&&this.#je(),resolveEventToKey:e=>{if(e instanceof Element)return e.closest(`ul.tree-list li[data-key]`)?.getAttribute(`data-key`)??void 0},prepareSelection:e=>{let n=this.#s(),r=n.rows,i=n.indexByKey.get(e),a=i===void 0?void 0:r[i];if(!a)return;let o=new Set(this._selectedNodes);o.has(a.node)||o.clear(),o.add(a.node);let s=r.filter(e=>o.has(e.node)).map(e=>e.node.item.key),c=new Set(this.root?yg(this.root,s):s),l=r.filter(e=>c.has(e.node.item.key)).map((e,n)=>({key:e.node.item.key,index:n,item:e.node,element:this.shadowRoot?.querySelector(`ul.tree-list li[data-key="${CSS.escape(e.node.item.key)}"]`)??void 0})),u=l.find(n=>n.key===e)??{key:e,index:0,item:a.node,element:void 0};return l.some(e=>e.key===u.key)||l.unshift(u),{origin:u,selected:l}},getMetrics:()=>({rowHeight:this.#Se()}),getRenderer:()=>this.dragPreviewRenderer,getDragPreviewSourceResolver:()=>this.dragPreviewSource,dispatch:e=>{let n=e.selected.map(e=>e.key),r=e.selected.map(e=>e.item),i=new CustomEvent(`list-native-drag-start`,{detail:e,bubbles:!0,composed:!0,cancelable:!0}),a=this.dispatchEvent(i);return a&&(this.#X=new Set(n),this.#Z=!1,(this.itemDnd===`internal`||this.itemDnd===`both`)&&hb(this.#G,this,r,n),this.dispatchEvent(new CustomEvent(`tree-drag-start`,{detail:{nodes:r,keys:n},bubbles:!0,composed:!0}))),a},writeDataTransfer:(e,n)=>{if(this.itemDnd!==`internal`&&this.itemDnd!==`both`)return;let r=n.selected.map(e=>e.key),i=n.selected.map(e=>e.item);try{e.setData(lb,JSON.stringify({sourceId:this.#G,keys:r,nodes:i})),e.setData(`text/plain`,i.map(e=>e.item.label).join(`
7760
+ `))}catch{}},onActiveChange:e=>{this.toggleAttribute(`data-native-dragging`,e),e||(this.#X=new Set),this.requestUpdate()},onEnd:()=>{gb(this.#G),this.#X=new Set,this.#K=setTimeout(()=>{this.#K=void 0},150),this.#Z||this.dispatchEvent(new CustomEvent(`tree-drag-end`,{detail:{dropped:!1},bubbles:!0,composed:!0})),this.#Z=!1}}),this.#J=new yb(this,{getDndMode:()=>this.itemDnd,getExpandHoverMs:()=>this.dndExpandHoverMs,getVisibleRows:()=>this.#Te(),getRowInfo:e=>{let n=this.#s(),r=n.indexByKey.get(e);if(r===void 0)return;let{node:i,depth:a,parentKey:o}=n.rows[r];return{node:i,depth:a,parentKey:o}},getChildren:e=>this.#Ce(e),getIndentPx:()=>this.#xe(),getScrollContainer:()=>this.#be(),isSelfOrDescendant:(e,n)=>this.#De(e,n),isExpanded:e=>this._expandedKeys.has(e),isReorderAllowed:()=>this.reorderable,getParentKey:e=>this.#Oe(e)?.item.key,resolveDrag:(e,n)=>this.#Ae(e,n),vet:e=>{if(this.canDrop&&!this.canDrop(e))return!1;let n=new CustomEvent(`tree-drag-over`,{detail:e,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(n)},expandKey:e=>this.#Ee(e),onDropStateChange:e=>{this.#q=e,this.toggleAttribute(`data-drop-rejected`,this.#J.isDragging&&e===void 0),this.requestUpdate()},onActiveChange:e=>{e?(this.#Q=void 0,this.#be()?.addEventListener(`scroll`,this.#$,{passive:!0})):(this.#be()?.removeEventListener(`scroll`,this.#$),this.#Q=void 0,this.toggleAttribute(`data-drop-rejected`,!1)),this.requestUpdate()},commitDrop:e=>this.dispatchEvent(new CustomEvent(`tree-drop`,{detail:e,bubbles:!0,composed:!0,cancelable:!0}))?(this.applyInternalDrop&&e.source===`internal`&&this.model&&this.model.applyDrop({source:`internal`,draggedKeys:e.draggedKeys,target:e.target}),this.#Z=!0,!0):!1,onDragEnd:e=>{this.#q=void 0,this.toggleAttribute(`data-drop-rejected`,!1),this.requestUpdate(),this.dispatchEvent(new CustomEvent(`tree-drag-end`,{detail:{dropped:e},bubbles:!0,composed:!0}))}})}#be(){return this.shadowRoot?.querySelector(`#container`)??void 0}#xe(){let e=Number.parseInt(getComputedStyle(this).getPropertyValue(`--tree-indent`),10);return Number.isNaN(e)?20:e}#Se(){let e=Number.parseInt(getComputedStyle(this).getPropertyValue(`--tree-item-height`),10);return Number.isNaN(e)?30:e}#Ce(e){if(e===void 0)return this.root?.children??[];let n=this.#s(),r=n.indexByKey.get(e);return r===void 0?[]:n.rows[r].node.children??[]}#we(e,n,r){let i=this.#s(),a=this.#v(i.rows.length),o=Lb(Fb(a),e.scrollTop,e.scrollTop+e.clientHeight,1);if(!o)return;let s=e.getBoundingClientRect(),c=n.querySelector(`li.item`)?.getBoundingClientRect()??s;for(let n=o.first;n<=o.last;n++){let{node:o,depth:l}=i.rows[n],u=s.top-e.scrollTop+kb(a,n),d={x:c.left,y:u,left:c.left,right:c.left+c.width,top:u,bottom:u+a.rowHeight,width:c.width,height:a.rowHeight,toJSON:()=>({})};r.push({key:o.item.key,node:o,depth:l,index:n,rect:d})}}#Te(){if(this.#Q)return this.#Q;let e=[],n=this.#be(),r=this.renderRoot.querySelector(`ul.tree-list`),i=this.#R;if(n&&r&&this.#_())this.#we(n,r,e);else if(n&&r&&r.children.length===i.length){let a=this.#s(),o=r.children,s=Lb(this.#ne(o),n.scrollTop,n.scrollTop+n.clientHeight,1);if(s)for(let n=s.first;n<=s.last;n++){let r=o[n];if(r.classList.contains(`leaving`))continue;let s=a.indexByKey.get(i[n]);if(s===void 0)continue;let{node:c,depth:l}=a.rows[s];e.push({key:c.item.key,node:c,depth:l,index:s,rect:r.getBoundingClientRect()})}}return this.#Q=e,e}#Ee(e){if(this._expandedKeys.has(e))return;let n=this.#s(),r=n.indexByKey.get(e),i=r===void 0?void 0:n.rows[r];!i||i.node.item.isLeaf===!0||(this.#Ke(i.node,i.depth),this.#Q=void 0,this.requestUpdate())}#De(e,n){if(e===n)return!0;let{parentByKey:r}=this.#c(),i=r.get(n);for(;i!==void 0;){if(i===e)return!0;i=r.get(i)}return!1}#Oe(e){let n=this.#c().parentByKey.get(e);if(n!==void 0&&n!==this.root?.item.key)return this.#ke(n)}#ke(e){let n=this.#s(),r=n.indexByKey.get(e);if(r!==void 0)return n.rows[r].node;let{parentByKey:i}=this.#c(),a=[];for(let n=e;n!==void 0&&n!==this.root?.item.key;n=i.get(n))a.unshift(n);let o=this.root;for(let e of a)o=o?.children?.find(n=>n.item.key===e);return o}#Ae(e,n){let r=this.itemDnd;if(r===`none`)return;let i=r===`internal`||r===`both`,a=r===`external`||r===`both`,o=[];try{o=Array.from(e.types)}catch{}let s=_b(),c=o.includes(lb)||s!==void 0;if(i&&c){if(s&&s.keys.length>0){let e=this.root?yg(this.root,s.keys):s.keys;return{source:`internal`,keys:e,nodes:e.map(e=>this.#ke(e)).filter(e=>e!==void 0)}}if(n===`drop`)try{let n=e.getData(lb);if(n){let e=JSON.parse(n);return{source:`internal`,keys:e.keys??[],nodes:e.nodes??[]}}}catch{}return{source:`internal`,keys:[],nodes:[]}}if(a&&!c){if(this.acceptDropTypes!==void 0){let n=this.acceptDropTypes.trim().split(/\s+/).filter(Boolean),r=Array.from(e.types);if(n.length>0&&!n.some(e=>r.includes(e)))return}if(n===`drop`){let n=this.parseExternalDrop?.(e);return!n||n.length===0?void 0:{source:`external`,keys:n.map(e=>e.item.key),nodes:n}}return this.parseExternalDrop?{source:`external`,keys:[],nodes:[]}:void 0}}#je(){if(this.itemDnd===`none`)return!1;let e=this.#s().rows;return e.length===0?!1:!this.canDrag||e.some(({node:e})=>this.canDrag({nodes:[e],keys:[e.item.key]}))}disconnectedCallback(){super.disconnectedCallback(),this.#he(),this.#H.clear(),this.#V.clear(),this.#N?.(),this.#N=void 0,this.#O?.(),this.#O=void 0,this.#K!==void 0&&(clearTimeout(this.#K),this.#K=void 0),this.#be()?.removeEventListener(`scroll`,this.#$),this.#T(),this.#pe&&=(this.#fe?.removeEventListener(`scroll`,this.#te),this.#fe=void 0,!1),this.#de!==0&&(cancelAnimationFrame(this.#de),this.#de=0),gb(this.#G),this.#F&&(this.#F.unregister(`select-all`),this.#F.unregister(`deselect-all`),this.#F=void 0,this.registry=void 0)}getConfig(){return{...this.#I}}setConfig(e){this.#I={...this.#I,...e},this.requestUpdate()}select(e){if(!this.#Pe(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,this.#Re(n),this.requestUpdate()}deselect(e){if(!this._selectedNodes.has(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1)),this.#Re(n),this.requestUpdate()}clearSelection(){if(this._selectedNodes.size===0)return;let e=new Set(this._selectedNodes);this.#Fe(),this.#Re(e),this.requestUpdate()}selectAll(){let e=new Set(this._selectedNodes);if(this.interactionMode===`checked`)for(let{node:e}of this.#s().rows)this.#Pe(e)&&this.#Je(e,!0);else{for(let{node:e}of this.#s().rows)this.#Pe(e)&&this._selectedNodes.add(e);this.selectedNode=[...this._selectedNodes].at(-1)}this.#Re(e),this.requestUpdate()}deselectAll(){let e=new Set(this._selectedNodes);if(this.interactionMode===`checked`)for(let{node:e}of this.#s().rows)this.#Pe(e)&&this.#Je(e,!1);else this.#Fe();this.#Re(e),this.requestUpdate()}expandAll(e){this.#Me(!0,e)}collapseAll(e){this.#Me(!1,e)}#Me(e,n){let r=this.root;if(!r)return;let i=r=>e?r<(n??1/0):r>=(n??0),a=[],o=this._expandedKeys,s=(n,r)=>{let c=n.children;if(n.item.isLeaf!==!0&&c!==void 0&&c.length>0&&i(r)){let i=o.has(n.item.key);e&&!i?(o=Tb(o,n.item.key),this._isExpanded(n,r)||a.push({node:n,depth:r})):!e&&i&&(o=Eb(o,n.item.key),a.push({node:n,depth:r}))}for(let e of c??[])s(e,r+1)};for(let e of r.children??[])s(e,0);if(o===this._expandedKeys)return;this.#e(o);let c=e?`expand`:`collapse`;for(let{node:e,depth:n}of a)this.dispatchEvent(new CustomEvent(c,{detail:{node:e,depth:n},bubbles:!0,composed:!0}));this.requestUpdate()}navigateTo(e,n={}){if(!this.root?.children)return!1;let r=this.#Ie,i=this.#Le;this.#Ie=`programmatic`,this.#Le=n.silent===!0;try{return this.#Ne(e,n.reveal??`edge`)}finally{this.#Ie=r,this.#Le=i}}#Ne(e,n){this.#tt(),this.#Fe(),this.tickled.clearTickled(),this._focusedDepth=0;let r=this.root;for(let n of e){let i=r?.children;if(!i)return!1;let a=i.find(e=>e.item.key===n);if(!a)return!1;this.#nt(a.item.key),this.#e(Tb(this._expandedKeys,a.item.key)),n===e.at(-1)&&(this.select(a),this.tickled.setTickled(a.item.key)),r=a}return this.#ue=!0,this.requestUpdate(),this.#Qe(e.at(-1),n),!0}navigateToNode(e){if(!this.root?.children)return!1;let n=this.#ze(this.root.children,e);return n?this.navigateTo(n):!1}revealKey(e){if(!this.root?.children)return!1;let n=this.#ze(this.root.children,n=>n.item.key===e);if(!n)return!1;for(let e=0;e<n.length-1;e++)this.#nt(n[e]),this.#e(Tb(this._expandedKeys,n[e]));return this.tickled.setTickled(e),this.#ue=!0,this.requestUpdate(),this.updateComplete.then(()=>this.#Qe(e)),!0}selectMany(e){let n=new Set(this._selectedNodes);this._selectedNodes=new Set([...e].filter(e=>this.#Pe(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#Re(n),this.requestUpdate()}getNodes(){if(!this.root?.children)return[];let e=[],n=(r,i)=>{if(e.push({node:r,depth:i}),r.children)for(let e of r.children)n(e,i+1)};for(let e of this.root.children)n(e,0);return e}#Pe(e){return e.item.selectable===!1||this.selectionFilter===`none`?!1:this.selectionFilter===`leaf`?e.item.isLeaf===!0||e.item.isLeaf!==!1&&e.children?.length===0:this.selectionFilter!==`branch`||e.item.isLeaf===!1||e.children!==void 0&&e.children.length>0}#Fe(){this._selectionVersion++,this._selectedNodes.clear(),this.selectedNode=void 0}#Ie;#Le;#Re(e){if(this._selectionVersion++,this.#Le)return;let n={selected:new Set(this._selectedNodes),previous:e,origin:this.#Ie};this.dispatchEvent(new CustomEvent(`select`,{detail:n,bubbles:!0,composed:!0}))}#ze(e,n,r=[]){for(let i of e){let e=[...r,i.item.key];if(n(i))return e;if(i.children?.length){let r=this.#ze(i.children,n,e);if(r)return r}}}renderNodeContent(e,n){let r=e.item.isLeaf!==!0,o=this._isExpanded(e,n);return i`
7761
7761
  <span class="tree-caret">
7762
7762
  ${r?i`<ixfx-icon class="caret-icon" name="chevron-down" .rotate=${o?a:`-90deg`}></ixfx-icon>`:``}
7763
7763
  </span>
7764
7764
  <span class="tree-label">${e.item.label}</span>
7765
- `}_handleItemClick(e,n,r){if(!(this.#J?.isDragging||this.#Y?.isDragging||this.#K!==void 0)&&!(r&&r.detail>=2)){if(this.interactionMode===`checked`&&r&&!(r.target instanceof Element&&r.target.closest(`.tree-label`))){this._handleCheckboxClick(r,e,n);return}switch(this.#j&&this._expandedKeys.has(this.#j.item.key)&&this.#tt(),this.tickled.handlePointerEnter(e.item.key),this._focusedDepth=n,this.dispatchEvent(new CustomEvent(`item-click`,{detail:{node:e,depth:n},bubbles:!0,composed:!0})),this.interactionMode){case`implicit`:this.#Ve(e,n,r);break;case`standard`:this.#He(e,n,r);break;case`vscode`:this.#He(e,n,r);break;case`manual`:this.#We(e,n,r);break;case`checked`:this.#Ue(e,n)}this.requestUpdate()}}#Be(e,n){if(e.item.isLeaf===!0)return!1;let r=n?.target;return r instanceof Element&&r.closest(`.tree-caret`)!==null}#Ve(e,n,r){if(!this.#Be(e,r)&&this.#Pe(e)){let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,(!n.has(e)||n.size!==1)&&this.#Re(n)}this.#Ke(e,n)}#He(e,n,r){let i=r?r.metaKey||r.ctrlKey:!1,a=r?r.shiftKey:!1;if(i){if(this.#Pe(e)){let n=new Set(this._selectedNodes);this._selectedNodes.has(e)?(this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1))):(this._selectedNodes.add(e),this.selectedNode=e,this.#P={node:e,flatIndex:this.#Ye(e)}),this.#Re(n)}return}if(a&&this.#P){let n=this.#s(),r=n.rows,i=n.indexByKey.get(this.#P.node.item.key)??-1,a=n.indexByKey.get(e.item.key)??-1;if(i>=0&&a>=0){let n=new Set(this._selectedNodes),o=Math.min(i,a),s=Math.max(i,a),c=r.slice(o,s+1).map(e=>e.node).filter(e=>this.#Pe(e));this._selectedNodes=new Set(c),this.selectedNode=e,this.#Re(n)}return}if(!this.#Be(e,r)&&this.#Pe(e)){let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,this.#P={node:e,flatIndex:this.#Ye(e)},(!n.has(e)||n.size!==1)&&this.#Re(n)}this.#Ke(e,n)}#Ue(e,n){this.#Ke(e,n)}#We(e,n,r){let i=r?r.metaKey||r.ctrlKey:!1,a=r?r.shiftKey:!1;if(i){if(this.#Pe(e)){let n=new Set(this._selectedNodes);this._selectedNodes.has(e)?(this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1))):(this._selectedNodes.add(e),this.selectedNode=e,this.#P={node:e,flatIndex:this.#Ye(e)}),this.#Re(n)}return}if(a&&this.#P){let n=this.#s(),r=n.rows,i=n.indexByKey.get(this.#P.node.item.key)??-1,a=n.indexByKey.get(e.item.key)??-1;if(i>=0&&a>=0){let n=new Set(this._selectedNodes),o=Math.min(i,a),s=Math.max(i,a),c=r.slice(o,s+1).map(e=>e.node).filter(e=>this.#Pe(e));this._selectedNodes=new Set(c),this.selectedNode=e,this.#Re(n)}return}this.#Ke(e,n)}#Ge(e,n){if(!this.#Pe(e))return;let r=new Set(this._selectedNodes);this._selectedNodes.has(e)?(this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1))):(this._selectedNodes.add(e),this.selectedNode=e,this.#P={node:e,flatIndex:this.#Ye(e)}),this.#Re(r)}_handleCheckboxClick(e,n,r){e.stopPropagation();let i=new Set(this._selectedNodes),a=this.#qe(n);this.#Je(n,!a),(this.selectedNode===void 0||!this._selectedNodes.has(this.selectedNode))&&(this.selectedNode=[...this._selectedNodes].at(-1)),this.#Re(i),this.requestUpdate()}#Ke(e,n){let r=this._expandedKeys.has(e.item.key);if(this.#ue=!0,r)this.#e(Eb(this._expandedKeys,e.item.key)),this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:e,depth:n},bubbles:!0,composed:!0}));else if(e.children===void 0){if(e.item.isLeaf!==!1)return;if(this.model??(this.loadChildren?this:void 0)){this.#j=e;let r=new AbortController;this.#M=r,this.#Ze(e,n,r).catch(()=>{})}}else this.#nt(e.item.key),this.#e(Tb(this._expandedKeys,e.item.key)),this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:e,depth:n},bubbles:!0,composed:!0}))}#qe(e){let n=[],r=e=>{this.#Pe(e)&&n.push(e),e.children?.forEach(r)};return r(e),n.length>0&&n.every(e=>this._selectedNodes.has(e))}#Je(e,n){if(this.#Pe(e)&&(n?this._selectedNodes.add(e):this._selectedNodes.delete(e)),e.children)for(let r of e.children)this.#Je(r,n)}#Ye(e){return this.#s().indexByKey.get(e.item.key)??-1}#Xe(e,n,r){if(!this.#P){let r=e[n]?.node;r&&(this.#P={node:r,flatIndex:n})}if(!this.#P)return;let i=this.#s().indexByKey.get(this.#P.node.item.key)??-1;if(i<0)return;let a=Math.min(i,r),o=Math.max(i,r);if(this.interactionMode===`vscode`){this.#P.selectionSnapshot||(this.#P={...this.#P,selectionSnapshot:new Set(this._selectedNodes)});let n=this.#P.selectionSnapshot,i=e.slice(a,o+1).map(e=>e.node).filter(e=>this.#Pe(e)),s=new Set(n);for(let e of i)n.has(e)?s.delete(e):s.add(e);let c=new Set(this._selectedNodes);this._selectedNodes=s,this.selectedNode=e[r]?.node??this.selectedNode,this.#Re(c)}else{let n=new Set(this._selectedNodes),i=e.slice(a,o+1).map(e=>e.node).filter(e=>this.#Pe(e));this._selectedNodes=new Set(i),this.selectedNode=e[r]?.node??this.selectedNode,this.#Re(n)}}async#Ze(e,n,r){try{let i;if(i=this.model?await this.model.getChildren(e,n,r.signal):[...await dg(this.loadChildren({node:e,depth:n},r.signal),r.signal)],r.signal.aborted)return;e.children=i,this.#i++,this.#nt(e.item.key),this.#e(Tb(this._expandedKeys,e.item.key)),this.#t=void 0,this.#ue=!0,this.#j=void 0,this.#M=void 0,this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:e,depth:n},bubbles:!0,composed:!0})),this.requestUpdate()}catch{if(r.signal.aborted)return;e.children=[],this.#i++,this.#t=void 0,this.#j=void 0,this.#M=void 0,this.requestUpdate()}}_isSelected(e){return this._selectedNodes.has(e)}_isFocused(e){return this.tickled.isTickled(e.item.key)}_isExpanded(e,n=0){return this._expandedKeys.has(e.item.key)?!0:this.#D()?.autoExpanded.has(e.item.key)??!1}get _pendingNode(){return this.#j}#Qe(e,n=`edge`){if(n===`center-if-hidden`){this.updateComplete.then(()=>{this.#y();let r=this.#s().indexByKey.get(e);r!==void 0&&this.#E(r,n)});return}if(this.#_()){this.updateComplete.then(()=>{let n=this.#s().indexByKey.get(e);n!==void 0&&this.#E(n)});return}let r=++this.#$e;requestAnimationFrame(()=>{this.#et(e);let n=this.#be()?.getAnimations?.({subtree:!0})??[];n.length>0&&Promise.allSettled(n.map(e=>e.finished)).then(()=>{r===this.#$e&&this.#et(e)})})}#$e;#et(e){let n=this.#be(),r=this.shadowRoot?.querySelector(`ul.tree-list [data-key="${CSS.escape(e)}"]`);if(!r||!n)return;let i=r.getBoundingClientRect(),a=n.getBoundingClientRect(),o=i.top-a.top,s=o+i.height,c=this.renderRoot.querySelector(`.sticky-headers`)?.getBoundingClientRect().height??0;o<c?n.scrollTop+=o-c:s>n.clientHeight&&(n.scrollTop+=s-n.clientHeight)}#tt(){this.#M&&(this.#M.abort(),this.#M=void 0,this.#j=void 0)}#nt(e){if(this.exclusivity!==`none`){if(this.exclusivity===`depth`)this.#rt(e);else if(this.exclusivity===`global`){let n=this.#it(e);this.#e(Db(this._expandedKeys,r=>!n.has(r)&&r!==e))}}}#rt(e){if(!this.root)return;let n=this.#at(this.root,e);if(!n?.children)return;let r=new Set(n.children.map(e=>e.item.key));this.#e(Db(this._expandedKeys,n=>n!==e&&r.has(n)))}#it(e){let n=new Set,r=i=>{if(i.item.key===e)return!0;if(!i.children)return!1;for(let e of i.children)if(r(e))return n.add(i.item.key),!0;return!1};return this.root&&r(this.root),n}#at(e,n,r=void 0){if(e.children)for(let i of e.children){if(i.item.key===n)return r??e;let a=this.#at(i,n,i);if(a)return a}}#ot(){let e=this.tickled.tickledId;return e?this.#s().indexByKey.get(e)??0:0}#st(e){let n=this.#s().rows;if(e<0||e>=n.length)return;let{node:r,depth:i}=n[e];if(this.tickled.setTickled(r.item.key),this._focusedDepth=i,this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:r,depth:i},bubbles:!0,composed:!0})),this.requestUpdate(),this.#_()){this.#E(e);return}this.updateComplete.then(()=>this.#ct())}#ct(){let e=this.tickled.tickledId;e!==void 0&&(this.shadowRoot?.querySelector(`ul.tree-list [data-key="${CSS.escape(e)}"]`))?.scrollIntoView({block:`nearest`,behavior:`smooth`})}#lt(){return this.#y(),Pb(this.#v(this.#s().rows.length))}#ut(e,n,r,i){this.interactionMode===`implicit`&&this.select(e[r].node),this.#st(r),i&&(this.interactionMode===`standard`||this.interactionMode===`vscode`)?this.#Xe(e,n,r):this.interactionMode===`vscode`&&(this.#P=void 0),this.requestUpdate()}#dt;renderLoadingIndicator(){return i`<span class="loading-spinner"></span>`}render(){let e=this.#s().rows;return i`
7765
+ `}_handleItemClick(e,n,r){if(!(this.#J?.isDragging||this.#Y?.isDragging||this.#K!==void 0)&&!(r&&r.detail>=2)){if(this.interactionMode===`checked`&&e.item.selectable!==!1&&r&&!(r.target instanceof Element&&r.target.closest(`.tree-label`))){this._handleCheckboxClick(r,e,n);return}switch(this.#j&&this._expandedKeys.has(this.#j.item.key)&&this.#tt(),this.tickled.handlePointerEnter(e.item.key),this._focusedDepth=n,this.dispatchEvent(new CustomEvent(`item-click`,{detail:{node:e,depth:n},bubbles:!0,composed:!0})),this.interactionMode){case`implicit`:this.#Ve(e,n,r);break;case`standard`:this.#He(e,n,r);break;case`vscode`:this.#He(e,n,r);break;case`manual`:this.#We(e,n,r);break;case`checked`:this.#Ue(e,n)}this.requestUpdate()}}#Be(e,n){if(e.item.isLeaf===!0)return!1;let r=n?.target;return r instanceof Element&&r.closest(`.tree-caret`)!==null}#Ve(e,n,r){if(!this.#Be(e,r)&&this.#Pe(e)){let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,(!n.has(e)||n.size!==1)&&this.#Re(n)}this.#Ke(e,n)}#He(e,n,r){let i=r?r.metaKey||r.ctrlKey:!1,a=r?r.shiftKey:!1;if(i){if(this.#Pe(e)){let n=new Set(this._selectedNodes);this._selectedNodes.has(e)?(this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1))):(this._selectedNodes.add(e),this.selectedNode=e,this.#P={node:e,flatIndex:this.#Ye(e)}),this.#Re(n)}return}if(a&&this.#P){let n=this.#s(),r=n.rows,i=n.indexByKey.get(this.#P.node.item.key)??-1,a=n.indexByKey.get(e.item.key)??-1;if(i>=0&&a>=0){let n=new Set(this._selectedNodes),o=Math.min(i,a),s=Math.max(i,a),c=r.slice(o,s+1).map(e=>e.node).filter(e=>this.#Pe(e));this._selectedNodes=new Set(c),this.selectedNode=e,this.#Re(n)}return}if(!this.#Be(e,r)&&this.#Pe(e)){let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,this.#P={node:e,flatIndex:this.#Ye(e)},(!n.has(e)||n.size!==1)&&this.#Re(n)}this.#Ke(e,n)}#Ue(e,n){this.#Ke(e,n)}#We(e,n,r){let i=r?r.metaKey||r.ctrlKey:!1,a=r?r.shiftKey:!1;if(i){if(this.#Pe(e)){let n=new Set(this._selectedNodes);this._selectedNodes.has(e)?(this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1))):(this._selectedNodes.add(e),this.selectedNode=e,this.#P={node:e,flatIndex:this.#Ye(e)}),this.#Re(n)}return}if(a&&this.#P){let n=this.#s(),r=n.rows,i=n.indexByKey.get(this.#P.node.item.key)??-1,a=n.indexByKey.get(e.item.key)??-1;if(i>=0&&a>=0){let n=new Set(this._selectedNodes),o=Math.min(i,a),s=Math.max(i,a),c=r.slice(o,s+1).map(e=>e.node).filter(e=>this.#Pe(e));this._selectedNodes=new Set(c),this.selectedNode=e,this.#Re(n)}return}this.#Ke(e,n)}#Ge(e,n){if(!this.#Pe(e))return;let r=new Set(this._selectedNodes);this._selectedNodes.has(e)?(this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1))):(this._selectedNodes.add(e),this.selectedNode=e,this.#P={node:e,flatIndex:this.#Ye(e)}),this.#Re(r)}_handleCheckboxClick(e,n,r){e.stopPropagation();let i=new Set(this._selectedNodes),a=this.#qe(n);this.#Je(n,!a),(this.selectedNode===void 0||!this._selectedNodes.has(this.selectedNode))&&(this.selectedNode=[...this._selectedNodes].at(-1)),this.#Re(i),this.requestUpdate()}#Ke(e,n){let r=this._expandedKeys.has(e.item.key);if(this.#ue=!0,r)this.#e(Eb(this._expandedKeys,e.item.key)),this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:e,depth:n},bubbles:!0,composed:!0}));else if(e.children===void 0){if(e.item.isLeaf!==!1)return;if(this.model??(this.loadChildren?this:void 0)){this.#j=e;let r=new AbortController;this.#M=r,this.#Ze(e,n,r).catch(()=>{})}}else this.#nt(e.item.key),this.#e(Tb(this._expandedKeys,e.item.key)),this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:e,depth:n},bubbles:!0,composed:!0}))}#qe(e){let n=[],r=e=>{this.#Pe(e)&&n.push(e),e.children?.forEach(r)};return r(e),n.length>0&&n.every(e=>this._selectedNodes.has(e))}#Je(e,n){if(this.#Pe(e)&&(n?this._selectedNodes.add(e):this._selectedNodes.delete(e)),e.children)for(let r of e.children)this.#Je(r,n)}#Ye(e){return this.#s().indexByKey.get(e.item.key)??-1}#Xe(e,n,r){if(!this.#P){let r=e[n]?.node;r&&(this.#P={node:r,flatIndex:n})}if(!this.#P)return;let i=this.#s().indexByKey.get(this.#P.node.item.key)??-1;if(i<0)return;let a=Math.min(i,r),o=Math.max(i,r);if(this.interactionMode===`vscode`){this.#P.selectionSnapshot||(this.#P={...this.#P,selectionSnapshot:new Set(this._selectedNodes)});let n=this.#P.selectionSnapshot,i=e.slice(a,o+1).map(e=>e.node).filter(e=>this.#Pe(e)),s=new Set(n);for(let e of i)n.has(e)?s.delete(e):s.add(e);let c=new Set(this._selectedNodes);this._selectedNodes=s,this.selectedNode=e[r]?.node??this.selectedNode,this.#Re(c)}else{let n=new Set(this._selectedNodes),i=e.slice(a,o+1).map(e=>e.node).filter(e=>this.#Pe(e));this._selectedNodes=new Set(i),this.selectedNode=e[r]?.node??this.selectedNode,this.#Re(n)}}async#Ze(e,n,r){try{let i;if(i=this.model?await this.model.getChildren(e,n,r.signal):[...await dg(this.loadChildren({node:e,depth:n},r.signal),r.signal)],r.signal.aborted)return;e.children=i,this.#i++,this.#nt(e.item.key),this.#e(Tb(this._expandedKeys,e.item.key)),this.#t=void 0,this.#ue=!0,this.#j=void 0,this.#M=void 0,this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:e,depth:n},bubbles:!0,composed:!0})),this.requestUpdate()}catch{if(r.signal.aborted)return;e.children=[],this.#i++,this.#t=void 0,this.#j=void 0,this.#M=void 0,this.requestUpdate()}}_isSelected(e){return this._selectedNodes.has(e)}_isFocused(e){return this.tickled.isTickled(e.item.key)}_isExpanded(e,n=0){return this._expandedKeys.has(e.item.key)?!0:this.#D()?.autoExpanded.has(e.item.key)??!1}get _pendingNode(){return this.#j}#Qe(e,n=`edge`){if(n===`center-if-hidden`){this.updateComplete.then(()=>{this.#y();let r=this.#s().indexByKey.get(e);r!==void 0&&this.#E(r,n)});return}if(this.#_()){this.updateComplete.then(()=>{let n=this.#s().indexByKey.get(e);n!==void 0&&this.#E(n)});return}let r=++this.#$e;requestAnimationFrame(()=>{this.#et(e);let n=this.#be()?.getAnimations?.({subtree:!0})??[];n.length>0&&Promise.allSettled(n.map(e=>e.finished)).then(()=>{r===this.#$e&&this.#et(e)})})}#$e;#et(e){let n=this.#be(),r=this.shadowRoot?.querySelector(`ul.tree-list [data-key="${CSS.escape(e)}"]`);if(!r||!n)return;let i=r.getBoundingClientRect(),a=n.getBoundingClientRect(),o=i.top-a.top,s=o+i.height,c=this.renderRoot.querySelector(`.sticky-headers`)?.getBoundingClientRect().height??0;o<c?n.scrollTop+=o-c:s>n.clientHeight&&(n.scrollTop+=s-n.clientHeight)}#tt(){this.#M&&(this.#M.abort(),this.#M=void 0,this.#j=void 0)}#nt(e){if(this.exclusivity!==`none`){if(this.exclusivity===`depth`)this.#rt(e);else if(this.exclusivity===`global`){let n=this.#it(e);this.#e(Db(this._expandedKeys,r=>!n.has(r)&&r!==e))}}}#rt(e){if(!this.root)return;let n=this.#at(this.root,e);if(!n?.children)return;let r=new Set(n.children.map(e=>e.item.key));this.#e(Db(this._expandedKeys,n=>n!==e&&r.has(n)))}#it(e){let n=new Set,r=i=>{if(i.item.key===e)return!0;if(!i.children)return!1;for(let e of i.children)if(r(e))return n.add(i.item.key),!0;return!1};return this.root&&r(this.root),n}#at(e,n,r=void 0){if(e.children)for(let i of e.children){if(i.item.key===n)return r??e;let a=this.#at(i,n,i);if(a)return a}}#ot(){let e=this.tickled.tickledId;return e?this.#s().indexByKey.get(e)??0:0}#st(e){let n=this.#s().rows;if(e<0||e>=n.length)return;let{node:r,depth:i}=n[e];if(this.tickled.setTickled(r.item.key),this._focusedDepth=i,this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:r,depth:i},bubbles:!0,composed:!0})),this.requestUpdate(),this.#_()){this.#E(e);return}this.updateComplete.then(()=>this.#ct())}#ct(){let e=this.tickled.tickledId;e!==void 0&&(this.shadowRoot?.querySelector(`ul.tree-list [data-key="${CSS.escape(e)}"]`))?.scrollIntoView({block:`nearest`,behavior:`smooth`})}#lt(){return this.#y(),Pb(this.#v(this.#s().rows.length))}#ut(e,n,r,i){this.interactionMode===`implicit`&&this.select(e[r].node),this.#st(r),i&&(this.interactionMode===`standard`||this.interactionMode===`vscode`)?this.#Xe(e,n,r):this.interactionMode===`vscode`&&(this.#P=void 0),this.requestUpdate()}#dt;renderLoadingIndicator(){return i`<span class="loading-spinner"></span>`}render(){let e=this.#s().rows;return i`
7766
7766
  <div
7767
7767
  id="container"
7768
7768
  data-input-mode=${this.tickled.inputMode}
@@ -8032,7 +8032,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
8032
8032
  :host([data-drop-rejected]) {
8033
8033
  cursor: not-allowed;
8034
8034
  }
8035
- `]}};E([d({type:Object})],q.prototype,`root`,void 0),E([d({attribute:!1})],q.prototype,`model`,void 0),E([d({attribute:!1})],q.prototype,`loadChildren`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],q.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],q.prototype,`selectionFilter`,void 0),E([d({type:String,attribute:`interaction-mode`})],q.prototype,`interactionMode`,void 0),E([d({attribute:!1})],q.prototype,`selectedNode`,void 0),E([m()],q.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],q.prototype,`filterPredicate`,void 0),E([d({type:Boolean,attribute:`disable-keyboard-navigation`})],q.prototype,`disableKeyboardNavigation`,void 0),E([d({attribute:!1})],q.prototype,`registry`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],q.prototype,`searchModes`,void 0),E([d({reflect:!0,attribute:`item-dnd`})],q.prototype,`itemDnd`,void 0),E([d({type:String,attribute:`accept-drop-types`})],q.prototype,`acceptDropTypes`,void 0),E([d({type:Number,attribute:`dnd-expand-hover-ms`})],q.prototype,`dndExpandHoverMs`,void 0),E([d({reflect:!0,attribute:`reorderable`,converter:{fromAttribute:e=>e!==`false`,toAttribute:e=>e?null:`false`}})],q.prototype,`reorderable`,void 0),E([d({reflect:!0,attribute:`sticky-headers`,converter:{fromAttribute:e=>e!==`false`,toAttribute:e=>e?null:`false`}})],q.prototype,`stickyHeaders`,void 0),E([d({reflect:!0,attribute:`virtualize`})],q.prototype,`virtualize`,void 0),E([d({type:Number,attribute:`virtualize-threshold`})],q.prototype,`virtualizeThreshold`,void 0),E([d({attribute:!1})],q.prototype,`dragPreviewRenderer`,void 0),E([d({attribute:!1})],q.prototype,`dragPreviewSource`,void 0),E([d({attribute:!1})],q.prototype,`canDrag`,void 0),E([d({attribute:!1})],q.prototype,`canDrop`,void 0),E([d({attribute:!1})],q.prototype,`parseExternalDrop`,void 0),E([d({attribute:!1})],q.prototype,`applyInternalDrop`,void 0),E([m()],q.prototype,`_expandedKeys`,void 0),E([m()],q.prototype,`_scrollTop`,void 0),E([m()],q.prototype,`_focusedDepth`,void 0),E([m()],q.prototype,`_stickyKeys`,void 0),q=E([T(`ixfx-tree-base`)],q);let zb=class extends q{#e;willUpdate(e){super.willUpdate(e),this.#t()}#t(){let e=this.root;if(this.interactionMode!==`checked`||!e){this.#e=void 0;return}let n=this.#e;n&&n.root===e&&n.structureVersion===this._structureVersion&&n.selectionVersion===this._selectionVersion||(this.#e={root:e,structureVersion:this._structureVersion,selectionVersion:this._selectionVersion,states:wb(e,this._selectedNodes)})}renderNodeContent(e,n){let r=e.item.isLeaf!==!0,o=this._isExpanded(e,n),s=e.item.icon,c=e.item.tooltip,l=i`
8035
+ `]}};E([d({type:Object})],q.prototype,`root`,void 0),E([d({attribute:!1})],q.prototype,`model`,void 0),E([d({attribute:!1})],q.prototype,`loadChildren`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],q.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],q.prototype,`selectionFilter`,void 0),E([d({type:String,attribute:`interaction-mode`})],q.prototype,`interactionMode`,void 0),E([d({attribute:!1})],q.prototype,`selectedNode`,void 0),E([m()],q.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],q.prototype,`filterPredicate`,void 0),E([d({type:Boolean,attribute:`disable-keyboard-navigation`})],q.prototype,`disableKeyboardNavigation`,void 0),E([d({attribute:!1})],q.prototype,`registry`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],q.prototype,`searchModes`,void 0),E([d({reflect:!0,attribute:`item-dnd`})],q.prototype,`itemDnd`,void 0),E([d({type:String,attribute:`accept-drop-types`})],q.prototype,`acceptDropTypes`,void 0),E([d({type:Number,attribute:`dnd-expand-hover-ms`})],q.prototype,`dndExpandHoverMs`,void 0),E([d({reflect:!0,attribute:`reorderable`,converter:{fromAttribute:e=>e!==`false`,toAttribute:e=>e?null:`false`}})],q.prototype,`reorderable`,void 0),E([d({reflect:!0,attribute:`sticky-headers`,converter:{fromAttribute:e=>e!==`false`,toAttribute:e=>e?null:`false`}})],q.prototype,`stickyHeaders`,void 0),E([d({reflect:!0,attribute:`virtualize`})],q.prototype,`virtualize`,void 0),E([d({type:Number,attribute:`virtualize-threshold`})],q.prototype,`virtualizeThreshold`,void 0),E([d({attribute:!1})],q.prototype,`dragPreviewRenderer`,void 0),E([d({attribute:!1})],q.prototype,`dragPreviewSource`,void 0),E([d({attribute:!1})],q.prototype,`canDrag`,void 0),E([d({attribute:!1})],q.prototype,`canDrop`,void 0),E([d({attribute:!1})],q.prototype,`parseExternalDrop`,void 0),E([d({attribute:!1})],q.prototype,`applyInternalDrop`,void 0),E([m()],q.prototype,`_expandedKeys`,void 0),E([m()],q.prototype,`_scrollTop`,void 0),E([m()],q.prototype,`_focusedDepth`,void 0),E([m()],q.prototype,`_stickyKeys`,void 0),q=E([T(`ixfx-tree-base`)],q);let zb=class extends q{constructor(...e){super(...e),this.alignCheckboxes=!1}#e;willUpdate(e){super.willUpdate(e),this.#t()}#t(){let e=this.root;if(this.interactionMode!==`checked`||!e){this.#e=void 0;return}let n=this.#e;n&&n.root===e&&n.structureVersion===this._structureVersion&&n.selectionVersion===this._selectionVersion||(this.#e={root:e,structureVersion:this._structureVersion,selectionVersion:this._selectionVersion,states:wb(e,this._selectedNodes)})}renderNodeContent(e,n){let r=e.item.isLeaf!==!0,o=this._isExpanded(e,n),s=e.item.icon,c=e.item.tooltip,l=i`
8036
8036
  <span class="tree-caret">
8037
8037
  ${r?i`<ixfx-icon class="caret-icon" name="chevron-down" .rotate=${o?a:`-90deg`}></ixfx-icon>`:``}
8038
8038
  </span>
@@ -8041,7 +8041,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
8041
8041
  ${e.item.label}
8042
8042
  ${c?i`<ixfx-tooltip class="tree-tooltip" anchor="--tooltip-tree-${e.item.key}" .value=${c}></ixfx-tooltip>`:a}
8043
8043
  </span>
8044
- `;if(this.interactionMode===`checked`){let r=this.#e?.states.get(e.item.key)??`unchecked`;return i`${this.#n(e,n,r)}${l}`}return l}#n(e,n,r){let a=r=>this._handleCheckboxClick(r,e,n);return this.checkboxRenderer?i`
8044
+ `;if(this.interactionMode===`checked`){if(e.item.selectable===!1)return this.alignCheckboxes?i`<span class="tree-checkbox-spacer" aria-hidden="true"></span>${l}`:l;let r=this.#e?.states.get(e.item.key)??`unchecked`;return i`${this.#n(e,n,r)}${l}`}return l}#n(e,n,r){let a=r=>this._handleCheckboxClick(r,e,n);return this.checkboxRenderer?i`
8045
8045
  <span
8046
8046
  class="tree-checkbox tree-checkbox-custom"
8047
8047
  part="checkbox"
@@ -8130,9 +8130,16 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
8130
8130
  anchor-name: --tooltip-tree;
8131
8131
  }
8132
8132
 
8133
- .tree-checkbox {
8133
+ .tree-checkbox,
8134
+ .tree-checkbox-spacer {
8134
8135
  flex-shrink: 0;
8135
- margin-right: var(--space-xs, 3px);
8136
+ box-sizing: border-box;
8137
+ width: var(--tree-checkbox-size, 14px);
8138
+ height: var(--tree-checkbox-size, 14px);
8139
+ margin: 0 var(--space-xs, 3px) 0 0;
8140
+ }
8141
+
8142
+ .tree-checkbox {
8136
8143
  cursor: pointer;
8137
8144
  accent-color: var(--accent);
8138
8145
  pointer-events: auto;
@@ -8166,7 +8173,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
8166
8173
  white-space: nowrap;
8167
8174
  position: relative;
8168
8175
  }
8169
- `]}};E([d({attribute:!1})],zb.prototype,`checkboxRenderer`,void 0),zb=E([T(`ixfx-tree-list`)],zb);function Bb(e,n){let r=document.createElement(`div`);r.style.cssText=`display:contents;`;let i;function a(r){let i={...e(r),data:r},o=n?.getChildren?.(r);return{item:i,children:o?o.map(a):i.isLeaf?[]:void 0}}function o(){return i||(i=document.createElement(`ixfx-tree-list`),i.interactionMode=n?.interactionMode??`standard`,i.selectionFilter=n?.selectionFilter??`all`,i.exclusivity=n?.exclusivity??`none`,i.style.cssText=`display:block;width:100%;`,r.appendChild(i),c(),i)}function s(e){let n=new Set;for(let r of e)r.item.data!==void 0&&n.add(r.item.data);return n}function c(){i.addEventListener(`select`,e=>{e.stopPropagation();let n={selected:s(e.detail.selected),previous:s(e.detail.previous)};r.dispatchEvent(new CustomEvent(`select`,{detail:n,bubbles:!0,composed:!0}))}),i.addEventListener(`activate`,e=>{e.stopPropagation();let n=e.detail.node.item.data;if(n===void 0)return;let i={item:n};r.dispatchEvent(new CustomEvent(`activate`,{detail:i,bubbles:!0,composed:!0}))}),i.addEventListener(`item-click`,e=>{e.stopPropagation();let n=e.detail.node.item.data;if(n===void 0)return;let i={item:n};r.dispatchEvent(new CustomEvent(`item-click`,{detail:i,bubbles:!0,composed:!0}))}),i.addEventListener(`tickle`,e=>{e.stopPropagation();let n=e.detail.node.item.data;if(n===void 0)return;let i={item:n};r.dispatchEvent(new CustomEvent(`tickle`,{detail:i,bubbles:!0,composed:!0}))})}let l=`single`,u=Object.assign(r,{setItems(e){let n=o();n.root={item:{key:`__adapter_root__`,label:``,isLeaf:!1},children:e.map(a)}},clearSelection(){i?.clearSelection()},dispatch(e,r){n?.onDispatch?.(e,r,i)}});return Object.defineProperties(u,{selectedItems:{get(){return i?s(i.selectedNodes):new Set},enumerable:!0,configurable:!0},selectionMode:{get(){return l},set(e){l=e,i&&(e===`none`?i.selectionFilter=`none`:e===`single`?(i.selectionFilter=n?.selectionFilter??`all`,i.interactionMode=`implicit`):(i.selectionFilter=n?.selectionFilter??`all`,i.interactionMode=n?.interactionMode??`standard`))},enumerable:!0,configurable:!0}}),u}function Vb(e,n){let r=document.createElement(`div`);r.style.cssText=`display:contents;`;let i,a=n?.selectionMode??`single`,o=new WeakMap;function s(){return i||(i=document.createElement(`ixfx-vertical-list`),i.style.cssText=`height:auto;width:100%;`,i.selectionMode=a,n?.interactionMode&&(i.interactionMode=n.interactionMode),r.appendChild(i),c(),i)}function c(){i.addEventListener(`list-select`,e=>{let n={selected:u(e.detail.selected),previous:u(e.detail.previous)};r.dispatchEvent(new CustomEvent(`select`,{detail:n,bubbles:!0,composed:!0}))}),i.addEventListener(`list-activate`,e=>{let n=o.get(e.detail.item);n!==void 0&&r.dispatchEvent(new CustomEvent(`activate`,{detail:{item:n},bubbles:!0,composed:!0}))}),i.addEventListener(`list-item-click`,e=>{let n=o.get(e.detail.item);n!==void 0&&r.dispatchEvent(new CustomEvent(`item-click`,{detail:{item:n},bubbles:!0,composed:!0}))}),i.addEventListener(`list-tickle`,e=>{let n=o.get(e.detail.item);n!==void 0&&r.dispatchEvent(new CustomEvent(`tickle`,{detail:{item:n},bubbles:!0,composed:!0}))})}function l(n){let r=s();r.clearItems(),o=new WeakMap;for(let i of n){let n=e(i);o.set(n,i),r.addItem(n)}}function u(e){let n=new Set;for(let r of e){let e=o.get(r);e!==void 0&&n.add(e)}return n}let d=Object.assign(r,{setItems(e){l(e)},clearSelection(){i?.clearSelection()},dispatch(e,r){n?.onDispatch?.(e,r,i)}});return Object.defineProperties(d,{selectedItems:{get(){return i?u(i.selectedItems):new Set},enumerable:!0,configurable:!0},selectionMode:{get(){return i?.selectionMode??a},set(e){a=e,i&&(i.selectionMode=e)},enumerable:!0,configurable:!0}}),d}const Hb=new Set([9,10,11,12,13,32]);function Ub(e){return e<32&&e!==9&&e!==10&&e!==11&&e!==12&&e!==13}function Wb(e){return e>=32&&e<=126}function Gb(e){return e===0?`byte-null`:Hb.has(e)?`byte-whitespace`:Ub(e)?`byte-control`:Wb(e)?`byte-printable`:`byte-other`}function Kb(e,n,r,i){let a=eg.createSteps(r,i,{steps:16}).map(eg.toCssColour);return{forByte:r=>r===0?e:r===255?n:a[r>>4]}}function qb(e){return{data:new Uint8Array(e),changeset:new Set}}function Jb(e,n){return e.data[n]??0}function Yb(e){return e.data.length}function Xb(e){return Math.max(0,Math.min(255,e))}function Zb(e,n,r){let i=Xb(r),a=e.data[n],o=new Map([[n,{before:a,after:i}]]);return e.data[n]=i,e.changeset.add(n),o}function Qb(e,n){let r=new Map;return n.forEach((n,i)=>{let a=Xb(n),o=e.data[i];r.set(i,{before:o,after:a}),e.data[i]=a,e.changeset.add(i)}),r}function $b(e,n){let r=new Map;return n.forEach((n,i)=>{let a=e.data[i];r.set(i,{before:n.after,after:a}),e.data[i]=n.after,e.changeset.add(i)}),r}function ex(e){let n=new Map;return e.forEach((e,r)=>{n.set(r,{before:e.after,after:e.before})}),n}function tx(e){return e.changeset}function nx(){return{undos:[],redos:[]}}function rx(e,n){e.undos.push(n),e.redos=[]}function ix(e){let n=e.undos.pop();return n&&e.redos.push(n),n}function ax(e){let n=e.redos.pop();return n&&e.undos.push(n),n}const ox=e=>e*4,sx=(e,n)=>e<n?e:n,cx=(e,n)=>e>n?e:n;function lx(e,n){return Math.max(0,Math.min(e,n-1))}function ux(e,n){if(!e)return[];let r=ox(n);if(e.kind===`single`)return[e.pos];if(e.kind===`contiguous`){let n=sx(e.start,e.end),r=cx(e.start,e.end),i=[];for(let e=n;e<=r;e++)i.push(e);return i}if(e.kind===`rectangular`){let n=[];for(let i=0;i<e.height;i++)for(let a=0;a<e.width;a++){let o=e.y+i,s=e.x+a,c=o*r+s;n.push(c)}return n}return[]}function dx(e,n,r){if(!e)return!1;let i=ox(r);if(e.kind===`single`)return n===e.pos;if(e.kind===`contiguous`){let r=sx(e.start,e.end),i=cx(e.start,e.end);return n>=r&&n<=i}if(e.kind===`rectangular`){let r=Math.floor(n/i),a=n%i,o=e.x,s=e.y,c=e.width,l=e.height;return r>=s&&r<s+l&&a>=o&&a<o+c}return!1}function fx(e,n,r,i){let a;a=e?e.kind===`single`?e.pos:e.kind===`contiguous`?cx(e.start,e.end):e.kind===`rectangular`?e.y*ox(r)+e.x+e.width-1:0:0;let o=ox(r),s;switch(n){case`left`:s=a-1;break;case`right`:s=a+1;break;case`up`:s=a-o;break;case`down`:s=a+o;break;default:s=a}return lx(s,i)}function px(e,n,r,i){return{kind:`single`,pos:fx(e,n,r,i)}}function mx(e,n,r,i,a=0,o=0){let s=ox(r),c,l,u,d;if(!e||e.kind===`single`){let n=e?.kind===`single`?e.pos:0;c=n%s,l=Math.floor(n/s),u=1,d=1}else if(e.kind===`contiguous`){let n=sx(e.start,e.end),r=cx(e.start,e.end);c=n%s,l=Math.floor(n/s),u=r-n+1,d=1}else e.kind===`rectangular`?(c=e.x,l=e.y,u=e.width,d=e.height):(c=0,l=0,u=1,d=1);let f=a>0||e?.kind===`rectangular`?a:c,p=o>0||e?.kind===`rectangular`?o:l;switch(n){case`left`:c>f?--u:(c===f&&u>1||c>0)&&(--c,u+=1);break;case`right`:c+u<s&&(u+=1);break;case`up`:l>p?--d:(l===p&&d>1||l>0)&&(--l,d+=1);break;case`down`:d+=1}return{kind:`rectangular`,x:c,y:l,width:u,height:d}}function hx(e,n,r,i){let a=ox(i);if(r===`contiguous`)return{kind:`contiguous`,start:sx(e,n),end:cx(e,n)};let o=e%a,s=Math.floor(e/a),c=n%a,l=Math.floor(n/a);return{kind:`rectangular`,x:sx(o,c),y:sx(s,l),width:Math.abs(c-o)+1,height:Math.abs(l-s)+1}}let gx=class extends n{constructor(...e){super(...e),this.columns=4,this.colourScheme=`ascii`,this.showChangeset=!0,this.hideOffsetCol=!1,this.hideHexCol=!1,this.hideTextCol=!1,this._selection=null,this._scrollTop=0,this._editState=null,this._containerH=0,this._shadeMap=null,this._focusSide=null,this._store=qb(new Uint8Array),this._undoStack=nx(),this._copyBuffer=null,this._rowHeight=24,this._dragStart=null,this._dragAnchor=null,this._rectAnchorX=0,this._rectAnchorY=0,this._rectAnchorXFromKeyboard=0,this._rectAnchorYFromKeyboard=0,this._initialSelectionPoint=0,this._currentCursorPoint=0,this._pointerMode=null,this._currentDragDiff=null,this._shiftClickTarget=null,this._onScroll=e=>{let n=e.target;this._scrollTop=n.scrollTop,this.requestUpdate()},this._onKeyDown=e=>{if([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(e.key)){e.preventDefault(),e.stopPropagation(),this._editState&&=null;let n=e.key.replace(`Arrow`,``).toLowerCase(),r=Yb(this._store),i=ox(this.columns);if(e.metaKey||e.ctrlKey){if(!this._selection||this._selection.kind!==`rectangular`){let e=0;this._selection?.kind===`single`?e=this._selection.pos:this._selection?.kind===`contiguous`&&(e=Math.min(this._selection.start,this._selection.end)),this._rectAnchorXFromKeyboard=e%i,this._rectAnchorYFromKeyboard=Math.floor(e/i),this._selection={kind:`rectangular`,x:this._rectAnchorXFromKeyboard,y:this._rectAnchorYFromKeyboard,width:1,height:1}}this._selection=mx(this._selection,n,this.columns,r,this._rectAnchorXFromKeyboard,this._rectAnchorYFromKeyboard)}else if(e.shiftKey){if(!this._selection)this._initialSelectionPoint=0,this._currentCursorPoint=0;else if(this._selection.kind===`single`)this._initialSelectionPoint=this._selection.pos,this._currentCursorPoint=this._selection.pos;else if(this._selection.kind===`rectangular`){let e=this._selection.y*i+this._selection.x;this._initialSelectionPoint=e,this._currentCursorPoint=e}let e=fx(this._selection,n,this.columns,r),a=Math.min(this._initialSelectionPoint,e),o=Math.max(this._initialSelectionPoint,e);this._currentCursorPoint=e,this._selection={kind:`contiguous`,start:a,end:o}}else{this._selection=px(this._selection,n,this.columns,r);let e=fx(this._selection,n,this.columns,r);this._initialSelectionPoint=e,this._currentCursorPoint=e}this._dispatchSelectEvent(),this.requestUpdate();return}if(e.key===`Tab`){if(e.preventDefault(),e.stopPropagation(),this._editState)this._advanceCursor();else{let e=Yb(this._store);this._selection=px(this._selection,`right`,this.columns,e),this._dispatchSelectEvent()}this.requestUpdate();return}if(e.key===`Escape`){if(e.preventDefault(),e.stopPropagation(),this._editState)this._editState=null;else if(this._selection&&this._selection.kind!==`single`){let e=this._selection,n=0;if(e.kind===`contiguous`){let r=e;n=Math.min(r.start,r.end)}if(e.kind===`rectangular`){let r=e;n=r.y*ox(this.columns)+r.x}this._selection={kind:`single`,pos:n},this._dispatchSelectEvent()}this.requestUpdate();return}if(this._editState){if(e.stopPropagation(),e.key===`Backspace`){this._handleBackspace();return}if(e.key===`Enter`){this._editState.side===`hex`&&this._editState.partial.startsWith(`.`)&&this._commitDecimalValue();return}e.key.length===1&&this._handleValueEntry(e.key);return}if(this._selection&&this._selection.kind===`single`&&e.key.length===1){e.preventDefault(),e.stopPropagation();let n=this._selection.pos,r=this._focusSide??`hex`;this._editState={pos:n,side:r,partial:``},this._handleValueEntry(e.key)}}}static{this.styles=r`
8176
+ `]}};E([d({attribute:!1})],zb.prototype,`checkboxRenderer`,void 0),E([d({type:Boolean,reflect:!0,attribute:`align-checkboxes`})],zb.prototype,`alignCheckboxes`,void 0),zb=E([T(`ixfx-tree-list`)],zb);function Bb(e,n){let r=document.createElement(`div`);r.style.cssText=`display:contents;`;let i;function a(r){let i={...e(r),data:r},o=n?.getChildren?.(r);return{item:i,children:o?o.map(a):i.isLeaf?[]:void 0}}function o(){return i||(i=document.createElement(`ixfx-tree-list`),i.interactionMode=n?.interactionMode??`standard`,i.selectionFilter=n?.selectionFilter??`all`,i.exclusivity=n?.exclusivity??`none`,i.style.cssText=`display:block;width:100%;`,r.appendChild(i),c(),i)}function s(e){let n=new Set;for(let r of e)r.item.data!==void 0&&n.add(r.item.data);return n}function c(){i.addEventListener(`select`,e=>{e.stopPropagation();let n={selected:s(e.detail.selected),previous:s(e.detail.previous)};r.dispatchEvent(new CustomEvent(`select`,{detail:n,bubbles:!0,composed:!0}))}),i.addEventListener(`activate`,e=>{e.stopPropagation();let n=e.detail.node.item.data;if(n===void 0)return;let i={item:n};r.dispatchEvent(new CustomEvent(`activate`,{detail:i,bubbles:!0,composed:!0}))}),i.addEventListener(`item-click`,e=>{e.stopPropagation();let n=e.detail.node.item.data;if(n===void 0)return;let i={item:n};r.dispatchEvent(new CustomEvent(`item-click`,{detail:i,bubbles:!0,composed:!0}))}),i.addEventListener(`tickle`,e=>{e.stopPropagation();let n=e.detail.node.item.data;if(n===void 0)return;let i={item:n};r.dispatchEvent(new CustomEvent(`tickle`,{detail:i,bubbles:!0,composed:!0}))})}let l=`single`,u=Object.assign(r,{setItems(e){let n=o();n.root={item:{key:`__adapter_root__`,label:``,isLeaf:!1},children:e.map(a)}},clearSelection(){i?.clearSelection()},dispatch(e,r){n?.onDispatch?.(e,r,i)}});return Object.defineProperties(u,{selectedItems:{get(){return i?s(i.selectedNodes):new Set},enumerable:!0,configurable:!0},selectionMode:{get(){return l},set(e){l=e,i&&(e===`none`?i.selectionFilter=`none`:e===`single`?(i.selectionFilter=n?.selectionFilter??`all`,i.interactionMode=`implicit`):(i.selectionFilter=n?.selectionFilter??`all`,i.interactionMode=n?.interactionMode??`standard`))},enumerable:!0,configurable:!0}}),u}function Vb(e,n){let r=document.createElement(`div`);r.style.cssText=`display:contents;`;let i,a=n?.selectionMode??`single`,o=new WeakMap;function s(){return i||(i=document.createElement(`ixfx-vertical-list`),i.style.cssText=`height:auto;width:100%;`,i.selectionMode=a,n?.interactionMode&&(i.interactionMode=n.interactionMode),r.appendChild(i),c(),i)}function c(){i.addEventListener(`list-select`,e=>{let n={selected:u(e.detail.selected),previous:u(e.detail.previous)};r.dispatchEvent(new CustomEvent(`select`,{detail:n,bubbles:!0,composed:!0}))}),i.addEventListener(`list-activate`,e=>{let n=o.get(e.detail.item);n!==void 0&&r.dispatchEvent(new CustomEvent(`activate`,{detail:{item:n},bubbles:!0,composed:!0}))}),i.addEventListener(`list-item-click`,e=>{let n=o.get(e.detail.item);n!==void 0&&r.dispatchEvent(new CustomEvent(`item-click`,{detail:{item:n},bubbles:!0,composed:!0}))}),i.addEventListener(`list-tickle`,e=>{let n=o.get(e.detail.item);n!==void 0&&r.dispatchEvent(new CustomEvent(`tickle`,{detail:{item:n},bubbles:!0,composed:!0}))})}function l(n){let r=s();r.clearItems(),o=new WeakMap;for(let i of n){let n=e(i);o.set(n,i),r.addItem(n)}}function u(e){let n=new Set;for(let r of e){let e=o.get(r);e!==void 0&&n.add(e)}return n}let d=Object.assign(r,{setItems(e){l(e)},clearSelection(){i?.clearSelection()},dispatch(e,r){n?.onDispatch?.(e,r,i)}});return Object.defineProperties(d,{selectedItems:{get(){return i?u(i.selectedItems):new Set},enumerable:!0,configurable:!0},selectionMode:{get(){return i?.selectionMode??a},set(e){a=e,i&&(i.selectionMode=e)},enumerable:!0,configurable:!0}}),d}const Hb=new Set([9,10,11,12,13,32]);function Ub(e){return e<32&&e!==9&&e!==10&&e!==11&&e!==12&&e!==13}function Wb(e){return e>=32&&e<=126}function Gb(e){return e===0?`byte-null`:Hb.has(e)?`byte-whitespace`:Ub(e)?`byte-control`:Wb(e)?`byte-printable`:`byte-other`}function Kb(e,n,r,i){let a=eg.createSteps(r,i,{steps:16}).map(eg.toCssColour);return{forByte:r=>r===0?e:r===255?n:a[r>>4]}}function qb(e){return{data:new Uint8Array(e),changeset:new Set}}function Jb(e,n){return e.data[n]??0}function Yb(e){return e.data.length}function Xb(e){return Math.max(0,Math.min(255,e))}function Zb(e,n,r){let i=Xb(r),a=e.data[n],o=new Map([[n,{before:a,after:i}]]);return e.data[n]=i,e.changeset.add(n),o}function Qb(e,n){let r=new Map;return n.forEach((n,i)=>{let a=Xb(n),o=e.data[i];r.set(i,{before:o,after:a}),e.data[i]=a,e.changeset.add(i)}),r}function $b(e,n){let r=new Map;return n.forEach((n,i)=>{let a=e.data[i];r.set(i,{before:n.after,after:a}),e.data[i]=n.after,e.changeset.add(i)}),r}function ex(e){let n=new Map;return e.forEach((e,r)=>{n.set(r,{before:e.after,after:e.before})}),n}function tx(e){return e.changeset}function nx(){return{undos:[],redos:[]}}function rx(e,n){e.undos.push(n),e.redos=[]}function ix(e){let n=e.undos.pop();return n&&e.redos.push(n),n}function ax(e){let n=e.redos.pop();return n&&e.undos.push(n),n}const ox=e=>e*4,sx=(e,n)=>e<n?e:n,cx=(e,n)=>e>n?e:n;function lx(e,n){return Math.max(0,Math.min(e,n-1))}function ux(e,n){if(!e)return[];let r=ox(n);if(e.kind===`single`)return[e.pos];if(e.kind===`contiguous`){let n=sx(e.start,e.end),r=cx(e.start,e.end),i=[];for(let e=n;e<=r;e++)i.push(e);return i}if(e.kind===`rectangular`){let n=[];for(let i=0;i<e.height;i++)for(let a=0;a<e.width;a++){let o=e.y+i,s=e.x+a,c=o*r+s;n.push(c)}return n}return[]}function dx(e,n,r){if(!e)return!1;let i=ox(r);if(e.kind===`single`)return n===e.pos;if(e.kind===`contiguous`){let r=sx(e.start,e.end),i=cx(e.start,e.end);return n>=r&&n<=i}if(e.kind===`rectangular`){let r=Math.floor(n/i),a=n%i,o=e.x,s=e.y,c=e.width,l=e.height;return r>=s&&r<s+l&&a>=o&&a<o+c}return!1}function fx(e,n,r,i){let a;a=e?e.kind===`single`?e.pos:e.kind===`contiguous`?cx(e.start,e.end):e.kind===`rectangular`?e.y*ox(r)+e.x+e.width-1:0:0;let o=ox(r),s;switch(n){case`left`:s=a-1;break;case`right`:s=a+1;break;case`up`:s=a-o;break;case`down`:s=a+o;break;default:s=a}return lx(s,i)}function px(e,n,r,i){return{kind:`single`,pos:fx(e,n,r,i)}}function mx(e,n,r,i,a=0,o=0){let s=ox(r),c,l,u,d;if(!e||e.kind===`single`){let n=e?.kind===`single`?e.pos:0;c=n%s,l=Math.floor(n/s),u=1,d=1}else if(e.kind===`contiguous`){let n=sx(e.start,e.end),r=cx(e.start,e.end);c=n%s,l=Math.floor(n/s),u=r-n+1,d=1}else e.kind===`rectangular`?(c=e.x,l=e.y,u=e.width,d=e.height):(c=0,l=0,u=1,d=1);let f=a>0||e?.kind===`rectangular`?a:c,p=o>0||e?.kind===`rectangular`?o:l;switch(n){case`left`:c>f?--u:(c===f&&u>1||c>0)&&(--c,u+=1);break;case`right`:c+u<s&&(u+=1);break;case`up`:l>p?--d:(l===p&&d>1||l>0)&&(--l,d+=1);break;case`down`:d+=1}return{kind:`rectangular`,x:c,y:l,width:u,height:d}}function hx(e,n,r,i){let a=ox(i);if(r===`contiguous`)return{kind:`contiguous`,start:sx(e,n),end:cx(e,n)};let o=e%a,s=Math.floor(e/a),c=n%a,l=Math.floor(n/a);return{kind:`rectangular`,x:sx(o,c),y:sx(s,l),width:Math.abs(c-o)+1,height:Math.abs(l-s)+1}}let gx=class extends n{constructor(...e){super(...e),this.columns=4,this.colourScheme=`ascii`,this.showChangeset=!0,this.hideOffsetCol=!1,this.hideHexCol=!1,this.hideTextCol=!1,this._selection=null,this._scrollTop=0,this._editState=null,this._containerH=0,this._shadeMap=null,this._focusSide=null,this._store=qb(new Uint8Array),this._undoStack=nx(),this._copyBuffer=null,this._rowHeight=24,this._dragStart=null,this._dragAnchor=null,this._rectAnchorX=0,this._rectAnchorY=0,this._rectAnchorXFromKeyboard=0,this._rectAnchorYFromKeyboard=0,this._initialSelectionPoint=0,this._currentCursorPoint=0,this._pointerMode=null,this._currentDragDiff=null,this._shiftClickTarget=null,this._onScroll=e=>{let n=e.target;this._scrollTop=n.scrollTop,this.requestUpdate()},this._onKeyDown=e=>{if([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(e.key)){e.preventDefault(),e.stopPropagation(),this._editState&&=null;let n=e.key.replace(`Arrow`,``).toLowerCase(),r=Yb(this._store),i=ox(this.columns);if(e.metaKey||e.ctrlKey){if(!this._selection||this._selection.kind!==`rectangular`){let e=0;this._selection?.kind===`single`?e=this._selection.pos:this._selection?.kind===`contiguous`&&(e=Math.min(this._selection.start,this._selection.end)),this._rectAnchorXFromKeyboard=e%i,this._rectAnchorYFromKeyboard=Math.floor(e/i),this._selection={kind:`rectangular`,x:this._rectAnchorXFromKeyboard,y:this._rectAnchorYFromKeyboard,width:1,height:1}}this._selection=mx(this._selection,n,this.columns,r,this._rectAnchorXFromKeyboard,this._rectAnchorYFromKeyboard)}else if(e.shiftKey){if(!this._selection)this._initialSelectionPoint=0,this._currentCursorPoint=0;else if(this._selection.kind===`single`)this._initialSelectionPoint=this._selection.pos,this._currentCursorPoint=this._selection.pos;else if(this._selection.kind===`rectangular`){let e=this._selection.y*i+this._selection.x;this._initialSelectionPoint=e,this._currentCursorPoint=e}let e=fx(this._selection,n,this.columns,r),a=Math.min(this._initialSelectionPoint,e),o=Math.max(this._initialSelectionPoint,e);this._currentCursorPoint=e,this._selection={kind:`contiguous`,start:a,end:o}}else{this._selection=px(this._selection,n,this.columns,r);let e=fx(this._selection,n,this.columns,r);this._initialSelectionPoint=e,this._currentCursorPoint=e}this._dispatchSelectEvent(),this.requestUpdate();return}if(e.key===`Tab`){if(e.preventDefault(),e.stopPropagation(),this._editState)this._advanceCursor();else{let e=Yb(this._store);this._selection=px(this._selection,`right`,this.columns,e),this._dispatchSelectEvent()}this.requestUpdate();return}if(e.key===`Escape`){if(e.preventDefault(),e.stopPropagation(),this._editState)this._editState=null;else if(this._selection&&this._selection.kind!==`single`){let e=this._selection,n=0;if(e.kind===`contiguous`){let r=e;n=Math.min(r.start,r.end)}if(e.kind===`rectangular`){let r=e;n=r.y*ox(this.columns)+r.x}this._selection={kind:`single`,pos:n},this._dispatchSelectEvent()}this.requestUpdate();return}if(this._editState){if(e.stopPropagation(),e.key===`Backspace`){this._handleBackspace();return}if(e.key===`Enter`){this._editState.side===`hex`&&this._editState.partial.startsWith(`.`)&&this._commitDecimalValue();return}e.key.length===1&&this._handleValueEntry(e.key);return}if(this._selection&&this._selection.kind===`single`&&e.key.length===1){e.preventDefault(),e.stopPropagation();let n=this._selection.pos,r=this._focusSide??`hex`;this._editState={pos:n,side:r,partial:``},this._handleValueEntry(e.key)}}}static{this.styles=r`
8170
8177
  :host {
8171
8178
  --hex-row-height: 24px;
8172
8179
  --hex-offset-width: 8ch;
package/dist/crumbs.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as TreeTickleEvent, O as TreeSelectEvent, a as TreeComponent, j as TreeDataModel, n as TreeActivateEvent, o as TreeComponentEventMap, x as TreeItemClickEvent, y as TreeExpandEvent } from "./tree-component-Tslymyyl.js";
2
- import { n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-DQ7KOUIj.js";
1
+ import { A as TreeTickleEvent, O as TreeSelectEvent, a as TreeComponent, j as TreeDataModel, n as TreeActivateEvent, o as TreeComponentEventMap, x as TreeItemClickEvent, y as TreeExpandEvent } from "./tree-component-CDsYTBDi.js";
2
+ import { n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-Jky6oNAp.js";
3
3
  import "./menu-item-bF6narIz.js";
4
4
  import "./index-o-CWDt11.js";
5
5
  import { LitElement, PropertyValues } from "lit";
@@ -1,8 +1,8 @@
1
1
  import "./icon-CDGprSdE.js";
2
- import { B as ListNativeDragStartEvent, I as ListDragPreviewRenderer, L as ListDragPreviewSourceResolver } from "./tree-component-Tslymyyl.js";
2
+ import { B as ListNativeDragStartEvent, I as ListDragPreviewRenderer, L as ListDragPreviewSourceResolver } from "./tree-component-CDsYTBDi.js";
3
3
  import { n as ListViewportChangeEvent, t as ListViewportChangeDetail } from "./list-viewport-types-BRZsLcvp.js";
4
- import { S as ListSearchController } from "./index-CO6m-YC0.js";
5
- import "./index-B-hzcIP0.js";
4
+ import { S as ListSearchController } from "./index-BvoXLnBf.js";
5
+ import "./index-DxyyVqzA.js";
6
6
  import "./pan-text-CoYmt2qd.js";
7
7
  import { LitElement } from "lit";
8
8
  import { CommandId, CommandRegistry } from "@clinth/ui-commands";
@@ -1,3 +1,3 @@
1
- import { B as ListNativeDragStartEvent, F as ListDragPreviewContext, I as ListDragPreviewRenderer, N as ListDragEntry, P as ListDragPreview, R as ListDragSource, z as ListNativeDragStartDetail } from "./tree-component-Tslymyyl.js";
2
- import { A as DataGridEditorFactory, B as GlobalFormatter, C as BuiltInFormatterName, D as DataGridDataType, E as DataGridColumnMenu, F as DataGridInteractionMode, I as DataGridRowLook, L as DataGridSelectionMode, M as DataGridGetRowKey, N as DataGridGroupBy, O as DataGridEditability, P as DataGridGroupLabel, R as DataGridSortDirection, S as DataGridViewportChangeEvent, T as DataGridColumn, _ as DataGridSelectDetail, a as DataGridColumnReorderDetail, b as DataGridSortEvent, c as DataGridColumnResizeEvent, d as DataGridElement, f as DataGridElementEventMap, g as DataGridRowActivateEvent, h as DataGridRowActivateDetail, i as DataGridCellEditEvent, j as DataGridEditorType, k as DataGridEditorContext, l as DataGridColumnVisibilityDetail, m as DataGridGroupChangeEvent, n as DataGridCellClickEvent, o as DataGridColumnReorderEvent, p as DataGridGroupChangeDetail, r as DataGridCellEditDetail, s as DataGridColumnResizeDetail, t as DataGridCellClickDetail, u as DataGridColumnVisibilityEvent, v as DataGridSelectEvent, w as BuiltInFormatterOptions, x as DataGridViewportChangeDetail, y as DataGridSortDetail, z as DataGridSortState } from "./data-grid-D7RxYISt.js";
1
+ import { B as ListNativeDragStartEvent, F as ListDragPreviewContext, I as ListDragPreviewRenderer, N as ListDragEntry, P as ListDragPreview, R as ListDragSource, z as ListNativeDragStartDetail } from "./tree-component-CDsYTBDi.js";
2
+ import { A as DataGridEditorFactory, B as GlobalFormatter, C as BuiltInFormatterName, D as DataGridDataType, E as DataGridColumnMenu, F as DataGridInteractionMode, I as DataGridRowLook, L as DataGridSelectionMode, M as DataGridGetRowKey, N as DataGridGroupBy, O as DataGridEditability, P as DataGridGroupLabel, R as DataGridSortDirection, S as DataGridViewportChangeEvent, T as DataGridColumn, _ as DataGridSelectDetail, a as DataGridColumnReorderDetail, b as DataGridSortEvent, c as DataGridColumnResizeEvent, d as DataGridElement, f as DataGridElementEventMap, g as DataGridRowActivateEvent, h as DataGridRowActivateDetail, i as DataGridCellEditEvent, j as DataGridEditorType, k as DataGridEditorContext, l as DataGridColumnVisibilityDetail, m as DataGridGroupChangeEvent, n as DataGridCellClickEvent, o as DataGridColumnReorderEvent, p as DataGridGroupChangeDetail, r as DataGridCellEditDetail, s as DataGridColumnResizeDetail, t as DataGridCellClickDetail, u as DataGridColumnVisibilityEvent, v as DataGridSelectEvent, w as BuiltInFormatterOptions, x as DataGridViewportChangeDetail, y as DataGridSortDetail, z as DataGridSortState } from "./data-grid-DmkId8bu.js";
3
3
  export { type BuiltInFormatterName, type BuiltInFormatterOptions, DataGridCellClickDetail, DataGridCellClickEvent, DataGridCellEditDetail, DataGridCellEditEvent, type DataGridColumn, type DataGridColumnMenu, DataGridColumnReorderDetail, DataGridColumnReorderEvent, DataGridColumnResizeDetail, DataGridColumnResizeEvent, DataGridColumnVisibilityDetail, DataGridColumnVisibilityEvent, type DataGridDataType, type DataGridEditability, type DataGridEditorContext, type DataGridEditorFactory, type DataGridEditorType, DataGridElement, DataGridElementEventMap, type DataGridGetRowKey, type DataGridGroupBy, DataGridGroupChangeDetail, DataGridGroupChangeEvent, type DataGridGroupLabel, type DataGridInteractionMode, DataGridRowActivateDetail, DataGridRowActivateEvent, type DataGridRowLook, DataGridSelectDetail, DataGridSelectEvent, type DataGridSelectionMode, DataGridSortDetail, type DataGridSortDirection, DataGridSortEvent, type DataGridSortState, DataGridViewportChangeDetail, DataGridViewportChangeEvent, type GlobalFormatter, type ListDragEntry, type ListDragPreview, type ListDragPreviewContext, type ListDragPreviewRenderer, type ListDragSource, type ListNativeDragStartDetail, type ListNativeDragStartEvent };
@@ -1,11 +1,11 @@
1
1
  import "./icon-CDGprSdE.js";
2
2
  import { r as IDataProvider } from "./data-provider-BAn_-oR1.js";
3
- import { B as ListNativeDragStartEvent, I as ListDragPreviewRenderer, L as ListDragPreviewSourceResolver } from "./tree-component-Tslymyyl.js";
3
+ import { B as ListNativeDragStartEvent, I as ListDragPreviewRenderer, L as ListDragPreviewSourceResolver } from "./tree-component-CDsYTBDi.js";
4
4
  import { n as ListViewportChangeEvent } from "./list-viewport-types-BRZsLcvp.js";
5
- import { S as ListSearchController } from "./index-CO6m-YC0.js";
5
+ import { S as ListSearchController } from "./index-BvoXLnBf.js";
6
6
  import { a as ListGroupEventMap, o as ListGroupInfo, s as ListGroupLabel } from "./grouping-CUKgmkMm.js";
7
7
  import { i as ListInteractionMode, l as ListSelectionMode, r as ListElementEventMap } from "./list-selection-types-PjKdhF-a.js";
8
- import { n as CustomCheckboxOptions, t as AddItemOptions } from "./vertical-list-B1Fq06xr.js";
8
+ import { n as CustomCheckboxOptions, t as AddItemOptions } from "./vertical-list-ztrdFvyT.js";
9
9
  import "./list-group-header.js";
10
10
  import { LitElement, PropertyValues } from "lit";
11
11
  import { CommandId, CommandRegistry } from "@clinth/ui-commands";
@@ -1,6 +1,6 @@
1
- import { B as ListNativeDragStartEvent, F as ListDragPreviewContext, I as ListDragPreviewRenderer, N as ListDragEntry, P as ListDragPreview, R as ListDragSource, z as ListNativeDragStartDetail } from "./tree-component-Tslymyyl.js";
1
+ import { B as ListNativeDragStartEvent, F as ListDragPreviewContext, I as ListDragPreviewRenderer, N as ListDragEntry, P as ListDragPreview, R as ListDragSource, z as ListNativeDragStartDetail } from "./tree-component-CDsYTBDi.js";
2
2
  import { n as ListViewportChangeEvent, t as ListViewportChangeDetail } from "./list-viewport-types-BRZsLcvp.js";
3
3
  import { i as ListGroupChangeEvent, l as ListGroupToggleDetail, n as ListGroupBy, o as ListGroupInfo, r as ListGroupChangeDetail, s as ListGroupLabel, u as ListGroupToggleEvent } from "./grouping-CUKgmkMm.js";
4
- import { n as CustomCheckboxOptions, t as AddItemOptions } from "./vertical-list-B1Fq06xr.js";
5
- import { a as DetailSortComparator, i as DetailGroupBy, n as DetailListElementEventMap, o as DetailSortItem, r as DetailFormatter, s as DetailSortMode, t as DetailListElement } from "./detail-list-w32XZEgH.js";
4
+ import { n as CustomCheckboxOptions, t as AddItemOptions } from "./vertical-list-ztrdFvyT.js";
5
+ import { a as DetailSortComparator, i as DetailGroupBy, n as DetailListElementEventMap, o as DetailSortItem, r as DetailFormatter, s as DetailSortMode, t as DetailListElement } from "./detail-list-CmQqeXvp.js";
6
6
  export { type AddItemOptions, type CustomCheckboxOptions, type DetailFormatter, type DetailGroupBy, DetailListElement, DetailListElementEventMap, type DetailSortComparator, type DetailSortItem, type DetailSortMode, type ListDragEntry, type ListDragPreview, type ListDragPreviewContext, type ListDragPreviewRenderer, type ListDragSource, type ListGroupBy, type ListGroupChangeDetail, type ListGroupChangeEvent, type ListGroupInfo, type ListGroupLabel, type ListGroupToggleDetail, type ListGroupToggleEvent, type ListNativeDragStartDetail, type ListNativeDragStartEvent, type ListViewportChangeDetail, type ListViewportChangeEvent };
@@ -1,9 +1,9 @@
1
1
  import "./icon-CDGprSdE.js";
2
- import { j as TreeDataModel } from "./tree-component-Tslymyyl.js";
3
- import { o as TreeNode, r as TreeFilterPredicate, t as LoadChildrenCallback } from "./types-DQ7KOUIj.js";
2
+ import { j as TreeDataModel } from "./tree-component-CDsYTBDi.js";
3
+ import { o as TreeNode, r as TreeFilterPredicate, t as LoadChildrenCallback } from "./types-Jky6oNAp.js";
4
4
  import "./crumbs.js";
5
5
  import { i as ListInteractionMode, l as ListSelectionMode } from "./list-selection-types-PjKdhF-a.js";
6
- import { r as VerticalListElement } from "./vertical-list-B1Fq06xr.js";
6
+ import { r as VerticalListElement } from "./vertical-list-ztrdFvyT.js";
7
7
  import { LitElement, PropertyValues } from "lit";
8
8
  //#region src/flat-list/types.d.ts
9
9
  /** How branches and leaves are ordered within one level. */
@@ -1,2 +1,2 @@
1
- import { _ as FlatListSelectEvent, a as FlatListContextMenuDetail, c as FlatListDropEvent, d as FlatListEditCommitDetail, f as FlatListEditCommitEvent, g as FlatListSelectDetail, h as FlatListNavigateEvent, i as FlatListBranchOrder, l as FlatListEditCancelDetail, m as FlatListNavigateDetail, n as FlatListActivateDetail, o as FlatListContextMenuEvent, p as FlatListElementEventMap, r as FlatListActivateEvent, s as FlatListDropDetail, t as FlatListElement, u as FlatListEditCancelEvent } from "./flat-list-CkRIZCuR.js";
1
+ import { _ as FlatListSelectEvent, a as FlatListContextMenuDetail, c as FlatListDropEvent, d as FlatListEditCommitDetail, f as FlatListEditCommitEvent, g as FlatListSelectDetail, h as FlatListNavigateEvent, i as FlatListBranchOrder, l as FlatListEditCancelDetail, m as FlatListNavigateDetail, n as FlatListActivateDetail, o as FlatListContextMenuEvent, p as FlatListElementEventMap, r as FlatListActivateEvent, s as FlatListDropDetail, t as FlatListElement, u as FlatListEditCancelEvent } from "./flat-list-BmQBB3ZC.js";
2
2
  export { type FlatListActivateDetail, type FlatListActivateEvent, type FlatListBranchOrder, type FlatListContextMenuDetail, type FlatListContextMenuEvent, type FlatListDropDetail, type FlatListDropEvent, type FlatListEditCancelDetail, type FlatListEditCancelEvent, type FlatListEditCommitDetail, type FlatListEditCommitEvent, FlatListElement, type FlatListElementEventMap, type FlatListNavigateDetail, type FlatListNavigateEvent, type FlatListSelectDetail, type FlatListSelectEvent };
@@ -1,10 +1,10 @@
1
- import { B as ListNativeDragStartEvent, I as ListDragPreviewRenderer, L as ListDragPreviewSourceResolver } from "./tree-component-Tslymyyl.js";
2
- import { S as ListSearchController } from "./index-CO6m-YC0.js";
1
+ import { B as ListNativeDragStartEvent, I as ListDragPreviewRenderer, L as ListDragPreviewSourceResolver } from "./tree-component-CDsYTBDi.js";
2
+ import { S as ListSearchController } from "./index-BvoXLnBf.js";
3
3
  import "./pan-text-CoYmt2qd.js";
4
4
  import { i as ListGroupChangeEvent, n as ListGroupBy, o as ListGroupInfo, s as ListGroupLabel, u as ListGroupToggleEvent } from "./grouping-CUKgmkMm.js";
5
5
  import { i as ListInteractionMode, l as ListSelectionMode } from "./list-selection-types-PjKdhF-a.js";
6
6
  import "./list-group-header.js";
7
- import "./list-native-drag-controller-CvXN3NB7.js";
7
+ import "./list-native-drag-controller-NMspr0E1.js";
8
8
  import { i as TickledItem, n as TickledController } from "./tickled-controller-DodxD3eQ.js";
9
9
  import { LitElement, PropertyValues, ReactiveController, ReactiveControllerHost, html } from "lit";
10
10
  import { CommandRegistry } from "@clinth/ui-commands";
@@ -1,5 +1,5 @@
1
- import { B as ListNativeDragStartEvent, F as ListDragPreviewContext, I as ListDragPreviewRenderer, N as ListDragEntry, P as ListDragPreview, R as ListDragSource, z as ListNativeDragStartDetail } from "./tree-component-Tslymyyl.js";
1
+ import { B as ListNativeDragStartEvent, F as ListDragPreviewContext, I as ListDragPreviewRenderer, N as ListDragEntry, P as ListDragPreview, R as ListDragSource, z as ListNativeDragStartDetail } from "./tree-component-CDsYTBDi.js";
2
2
  import { i as ListGroupChangeEvent, l as ListGroupToggleDetail, n as ListGroupBy, o as ListGroupInfo, r as ListGroupChangeDetail, s as ListGroupLabel, u as ListGroupToggleEvent } from "./grouping-CUKgmkMm.js";
3
3
  import { i as ListInteractionMode, l as ListSelectionMode } from "./list-selection-types-PjKdhF-a.js";
4
- import { _ as GridListTickleDetail, a as GridListCaptionBackdrop, b as GridListViewportChangeEvent, c as GridListDataAdapter, d as GridListItemClickDetail, f as GridListItemClickEvent, g as GridListSelectEvent, h as GridListSelectDetail, i as GridListCaptionAlign, l as GridListElementEventMap, m as GridListOrientation, n as GridListActivateDetail, o as GridListCaptionPosition, p as GridListItemEventDetail, r as GridListActivateEvent, s as GridListCaptionStyle, t as GridListElement, u as GridListFullElementEventMap, v as GridListTickleEvent, y as GridListViewportChangeDetail } from "./grid-list-DUvhSoT2.js";
4
+ import { _ as GridListTickleDetail, a as GridListCaptionBackdrop, b as GridListViewportChangeEvent, c as GridListDataAdapter, d as GridListItemClickDetail, f as GridListItemClickEvent, g as GridListSelectEvent, h as GridListSelectDetail, i as GridListCaptionAlign, l as GridListElementEventMap, m as GridListOrientation, n as GridListActivateDetail, o as GridListCaptionPosition, p as GridListItemEventDetail, r as GridListActivateEvent, s as GridListCaptionStyle, t as GridListElement, u as GridListFullElementEventMap, v as GridListTickleEvent, y as GridListViewportChangeDetail } from "./grid-list-BVsUEvgd.js";
5
5
  export { type GridListActivateDetail, type GridListActivateEvent, type GridListCaptionAlign, type GridListCaptionBackdrop, type GridListCaptionPosition, type GridListCaptionStyle, type GridListDataAdapter, GridListElement, type GridListElementEventMap, type GridListFullElementEventMap, type GridListItemClickDetail, type GridListItemClickEvent, type GridListItemEventDetail, type GridListOrientation, type GridListSelectDetail, type GridListSelectEvent, type GridListTickleDetail, type GridListTickleEvent, type GridListViewportChangeDetail, type GridListViewportChangeEvent, type ListDragEntry, type ListDragPreview, type ListDragPreviewContext, type ListDragPreviewRenderer, type ListDragSource, type ListGroupBy, type ListGroupChangeDetail, type ListGroupChangeEvent, type ListGroupInfo, type ListGroupLabel, type ListGroupToggleDetail, type ListGroupToggleEvent, type ListInteractionMode, type ListNativeDragStartDetail, type ListNativeDragStartEvent, type ListSelectionMode };
@@ -1,2 +1,2 @@
1
- import { A as FuzzySearch, C as ListSearchControllerOptions, D as IncrSearchTreeOptions, E as IncrSearchTreeController, F as IncrSearchChangeCallback, I as IncrSearchOptions, L as IncrSearchResult, M as HighlightOptions, N as HighlightTarget, O as createAcCompletionProvider, P as IncrSearch, R as IncrSearchState, S as ListSearchController, T as ListSearchMode, _ as DataListSearchAdapterOptions, a as RegisterListSearchCommandsOptions, b as LIST_SEARCH_MODES, c as applyHighlights, d as createFuzzySearch, f as ElementIncrSearch, g as createElementListSearchAdapter, h as ElementListSearchHost, i as LIST_SEARCH_COMMAND_IDS, j as FuzzySearchOptions, k as ElementIncrSearchOptions, l as buildHighlightTargets, m as ElementListSearchAdapterOptions, n as createTreeListSearchAdapter, o as registerListSearchCommands, p as createElementIncrSearch, r as listSearchStyles, s as createIncrSearch, t as TreeListSearchAdapterOptions, u as clearHighlights, v as DataListSearchItem, w as ListSearchHost, x as ListSearchAdapter, y as createDataListSearchAdapter } from "./index-CO6m-YC0.js";
1
+ import { A as FuzzySearch, C as ListSearchControllerOptions, D as IncrSearchTreeOptions, E as IncrSearchTreeController, F as IncrSearchChangeCallback, I as IncrSearchOptions, L as IncrSearchResult, M as HighlightOptions, N as HighlightTarget, O as createAcCompletionProvider, P as IncrSearch, R as IncrSearchState, S as ListSearchController, T as ListSearchMode, _ as DataListSearchAdapterOptions, a as RegisterListSearchCommandsOptions, b as LIST_SEARCH_MODES, c as applyHighlights, d as createFuzzySearch, f as ElementIncrSearch, g as createElementListSearchAdapter, h as ElementListSearchHost, i as LIST_SEARCH_COMMAND_IDS, j as FuzzySearchOptions, k as ElementIncrSearchOptions, l as buildHighlightTargets, m as ElementListSearchAdapterOptions, n as createTreeListSearchAdapter, o as registerListSearchCommands, p as createElementIncrSearch, r as listSearchStyles, s as createIncrSearch, t as TreeListSearchAdapterOptions, u as clearHighlights, v as DataListSearchItem, w as ListSearchHost, x as ListSearchAdapter, y as createDataListSearchAdapter } from "./index-BvoXLnBf.js";
2
2
  export { type DataListSearchAdapterOptions, type DataListSearchItem, type ElementIncrSearch, type ElementIncrSearchOptions, type ElementListSearchAdapterOptions, type ElementListSearchHost, type FuzzySearch, type FuzzySearchOptions, type HighlightOptions, type HighlightTarget, type IncrSearch, type IncrSearchChangeCallback, IncrSearchTreeController as IncrSearchMillerController, IncrSearchTreeController, type IncrSearchTreeOptions as IncrSearchMillerOptions, type IncrSearchTreeOptions, type IncrSearchOptions, type IncrSearchResult, type IncrSearchState, LIST_SEARCH_COMMAND_IDS, LIST_SEARCH_MODES, type ListSearchAdapter, ListSearchController, type ListSearchControllerOptions, type ListSearchHost, type ListSearchMode, type RegisterListSearchCommandsOptions, type TreeListSearchAdapterOptions, applyHighlights, buildHighlightTargets, clearHighlights, createAcCompletionProvider, createDataListSearchAdapter, createElementIncrSearch, createElementListSearchAdapter, createFuzzySearch, createIncrSearch, createTreeListSearchAdapter, listSearchStyles, registerListSearchCommands };
@@ -1,6 +1,6 @@
1
1
  import "./icon-CDGprSdE.js";
2
- import { E as TreeSearchHost } from "./tree-component-Tslymyyl.js";
3
- import { o as TreeNode } from "./types-DQ7KOUIj.js";
2
+ import { E as TreeSearchHost } from "./tree-component-CDsYTBDi.js";
3
+ import { o as TreeNode } from "./types-Jky6oNAp.js";
4
4
  import { ReactiveController, ReactiveControllerHost, TemplateResult, nothing } from "lit";
5
5
  import { FzfOptions } from "fzf";
6
6
  import { CommandRegistry } from "@clinth/ui-commands";
@@ -1,7 +1,7 @@
1
- import { A as TreeTickleEvent, C as TreeItemDblClickEvent, E as TreeSearchHost, I as ListDragPreviewRenderer, L as ListDragPreviewSourceResolver, O as TreeSelectEvent, _ as TreeDropTarget, a as TreeComponent, c as TreeDragContext, d as TreeDragStartEvent, h as TreeDropEvent, i as TreeCollapseEvent, j as TreeDataModel, l as TreeDragEndEvent, m as TreeDropDetail, n as TreeActivateEvent, o as TreeComponentEventMap, p as TreeDropContext, s as TreeDndMode, u as TreeDragOverEvent, w as TreeNavigateOptions, x as TreeItemClickEvent, y as TreeExpandEvent, z as ListNativeDragStartDetail } from "./tree-component-Tslymyyl.js";
2
- import { a as TreeItem, i as TreeInteractionMode, n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-DQ7KOUIj.js";
3
- import { S as ListSearchController } from "./index-CO6m-YC0.js";
4
- import { t as ListNativeDragController } from "./list-native-drag-controller-CvXN3NB7.js";
1
+ import { A as TreeTickleEvent, C as TreeItemDblClickEvent, E as TreeSearchHost, I as ListDragPreviewRenderer, L as ListDragPreviewSourceResolver, O as TreeSelectEvent, _ as TreeDropTarget, a as TreeComponent, c as TreeDragContext, d as TreeDragStartEvent, h as TreeDropEvent, i as TreeCollapseEvent, j as TreeDataModel, l as TreeDragEndEvent, m as TreeDropDetail, n as TreeActivateEvent, o as TreeComponentEventMap, p as TreeDropContext, s as TreeDndMode, u as TreeDragOverEvent, w as TreeNavigateOptions, x as TreeItemClickEvent, y as TreeExpandEvent, z as ListNativeDragStartDetail } from "./tree-component-CDsYTBDi.js";
2
+ import { a as TreeItem, i as TreeInteractionMode, n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-Jky6oNAp.js";
3
+ import { S as ListSearchController } from "./index-BvoXLnBf.js";
4
+ import { t as ListNativeDragController } from "./list-native-drag-controller-NMspr0E1.js";
5
5
  import { n as TickledController } from "./tickled-controller-DodxD3eQ.js";
6
6
  import { LitElement, PropertyValues, ReactiveController, ReactiveControllerHost, TemplateResult, nothing } from "lit";
7
7
  import { CommandRegistry } from "@clinth/ui-commands";
@@ -230,6 +230,12 @@ declare class TreeListElement extends TreeBaseElement {
230
230
  * </svg>`;
231
231
  */
232
232
  checkboxRenderer: ((state: TreeCheckboxState) => unknown) | undefined;
233
+ /**
234
+ * In `checked` mode, whether unselectable rows (`item.selectable === false`)
235
+ * keep the space their checkbox would occupy, so their carets and labels line
236
+ * up with selectable siblings. When off (default) they reserve no space.
237
+ */
238
+ alignCheckboxes: boolean;
233
239
  willUpdate(changedProps: PropertyValues): void;
234
240
  protected renderNodeContent(node: TreeNode, depth: number): TemplateResult;
235
241
  protected _renderNode(node: TreeNode, depth: number): TemplateResult;
@@ -1,5 +1,5 @@
1
1
  import "./icon-CDGprSdE.js";
2
- import { o as TreeNode } from "./types-DQ7KOUIj.js";
2
+ import { o as TreeNode } from "./types-Jky6oNAp.js";
3
3
  import { i as MenuContainer, n as MenuTrigger, r as MenuTriggerCommandDetail, t as MenuItem } from "./menu-item-bF6narIz.js";
4
4
  import { LitElement, TemplateResult } from "lit";
5
5
  import { CommandRegistry, KeyboardManager } from "@clinth/ui-commands";
package/dist/index.d.ts CHANGED
@@ -7,28 +7,28 @@ import { Checkbox, CheckboxChangeDetail, CheckboxChangeEvent, CheckboxEventMap }
7
7
  import { a as CheckState, c as ItemOrientation, i as CheckedSelectEventMap, n as CheckedSelectChangeDetail, o as CheckedSelectItem, r as CheckedSelectChangeEvent, s as ItemDisplay, t as CheckedSelect } from "./checked-select-CglRukbP.js";
8
8
  import { a as ColourPickerInputEvent, i as ColourPickerEventDetail, n as ColourPicker, o as OklchValue, r as ColourPickerChangeEvent, t as ColourPickerPopup } from "./index-tq6f8007.js";
9
9
  import { t as LabelledRangeInput } from "./index-CoqtMSd9.js";
10
- import { A as TreeTickleEvent, B as ListNativeDragStartEvent, C as TreeItemDblClickEvent, D as TreeSelectDetail, E as TreeSearchHost, F as ListDragPreviewContext, I as ListDragPreviewRenderer, L as ListDragPreviewSourceResolver, M as TreeDataModelOptions, N as ListDragEntry, O as TreeSelectEvent, P as ListDragPreview, R as ListDragSource, S as TreeItemDblClickDetail, T as TreeRevealMode, _ as TreeDropTarget, a as TreeComponent, b as TreeItemClickDetail, c as TreeDragContext, d as TreeDragStartEvent, f as TreeDropApplyContext, g as TreeDropPosition, h as TreeDropEvent, i as TreeCollapseEvent, j as TreeDataModel, k as TreeTickleDetail, l as TreeDragEndEvent, m as TreeDropDetail, n as TreeActivateEvent, o as TreeComponentEventMap, p as TreeDropContext, r as TreeCollapseDetail, s as TreeDndMode, t as TreeActivateDetail, u as TreeDragOverEvent, v as TreeExpandDetail, w as TreeNavigateOptions, x as TreeItemClickEvent, y as TreeExpandEvent, z as ListNativeDragStartDetail } from "./tree-component-Tslymyyl.js";
11
- import { a as TreeItem, i as TreeInteractionMode, n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-DQ7KOUIj.js";
12
- import { a as TreeDropVisibleRow, c as TreeListElement, d as TreeBaseElementEventMap, f as TreeVirtualize, i as TreeDropRowInfo, l as TreeCheckboxState, n as TreeDropControllerConfig, o as TreeController, p as TreeConfig, r as TreeDropResolvedDrag, s as TreeControllerOptions, t as TreeDropController, u as TreeBaseElement } from "./index-CSCrK0hR.js";
10
+ import { A as TreeTickleEvent, B as ListNativeDragStartEvent, C as TreeItemDblClickEvent, D as TreeSelectDetail, E as TreeSearchHost, F as ListDragPreviewContext, I as ListDragPreviewRenderer, L as ListDragPreviewSourceResolver, M as TreeDataModelOptions, N as ListDragEntry, O as TreeSelectEvent, P as ListDragPreview, R as ListDragSource, S as TreeItemDblClickDetail, T as TreeRevealMode, _ as TreeDropTarget, a as TreeComponent, b as TreeItemClickDetail, c as TreeDragContext, d as TreeDragStartEvent, f as TreeDropApplyContext, g as TreeDropPosition, h as TreeDropEvent, i as TreeCollapseEvent, j as TreeDataModel, k as TreeTickleDetail, l as TreeDragEndEvent, m as TreeDropDetail, n as TreeActivateEvent, o as TreeComponentEventMap, p as TreeDropContext, r as TreeCollapseDetail, s as TreeDndMode, t as TreeActivateDetail, u as TreeDragOverEvent, v as TreeExpandDetail, w as TreeNavigateOptions, x as TreeItemClickEvent, y as TreeExpandEvent, z as ListNativeDragStartDetail } from "./tree-component-CDsYTBDi.js";
11
+ import { a as TreeItem, i as TreeInteractionMode, n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-Jky6oNAp.js";
12
+ import { a as TreeDropVisibleRow, c as TreeListElement, d as TreeBaseElementEventMap, f as TreeVirtualize, i as TreeDropRowInfo, l as TreeCheckboxState, n as TreeDropControllerConfig, o as TreeController, p as TreeConfig, r as TreeDropResolvedDrag, s as TreeControllerOptions, t as TreeDropController, u as TreeBaseElement } from "./index-DuhzWWTr.js";
13
13
  import "./menu-item-bF6narIz.js";
14
14
  import { a as NarrowedTextItem, i as NarrowedTextChangeEvent, n as FuzzySearchResult, o as Orientation, r as NarrowedTextChangeDetail, s as SelectionMode, t as NarrowedTextElement } from "./index-o-CWDt11.js";
15
15
  import { CrumbNavigationChangeDetail, CrumbNavigationChangeEvent, CrumbNavigationElement, CrumbNavigationElementEventMap, CrumbNavigationExpandDetail, CrumbNavigationExpandEvent, CrumbNavigationItemClickDetail, CrumbNavigationItemClickEvent } from "./crumbs.js";
16
16
  import { ConfigEntry, DataDisplayComponent, FormattingOptions, RendererStyle } from "./data-display.js";
17
17
  import { n as ListViewportChangeEvent, t as ListViewportChangeDetail } from "./list-viewport-types-BRZsLcvp.js";
18
- import { A as DataGridEditorFactory, B as GlobalFormatter, C as BuiltInFormatterName, D as DataGridDataType, E as DataGridColumnMenu, F as DataGridInteractionMode, I as DataGridRowLook, L as DataGridSelectionMode, M as DataGridGetRowKey, N as DataGridGroupBy, O as DataGridEditability, P as DataGridGroupLabel, R as DataGridSortDirection, S as DataGridViewportChangeEvent, T as DataGridColumn, _ as DataGridSelectDetail, a as DataGridColumnReorderDetail, b as DataGridSortEvent, c as DataGridColumnResizeEvent, d as DataGridElement, f as DataGridElementEventMap, g as DataGridRowActivateEvent, h as DataGridRowActivateDetail, i as DataGridCellEditEvent, j as DataGridEditorType, k as DataGridEditorContext, l as DataGridColumnVisibilityDetail, m as DataGridGroupChangeEvent, n as DataGridCellClickEvent, o as DataGridColumnReorderEvent, p as DataGridGroupChangeDetail, r as DataGridCellEditDetail, s as DataGridColumnResizeDetail, t as DataGridCellClickDetail, u as DataGridColumnVisibilityEvent, v as DataGridSelectEvent, w as BuiltInFormatterOptions, x as DataGridViewportChangeDetail, y as DataGridSortDetail, z as DataGridSortState } from "./data-grid-D7RxYISt.js";
19
- import { A as FuzzySearch, C as ListSearchControllerOptions, D as IncrSearchTreeOptions, E as IncrSearchTreeController, F as IncrSearchChangeCallback, I as IncrSearchOptions, L as IncrSearchResult, M as HighlightOptions, N as HighlightTarget, O as createAcCompletionProvider, P as IncrSearch, R as IncrSearchState, S as ListSearchController, T as ListSearchMode, _ as DataListSearchAdapterOptions, a as RegisterListSearchCommandsOptions, b as LIST_SEARCH_MODES, c as applyHighlights, d as createFuzzySearch, f as ElementIncrSearch, g as createElementListSearchAdapter, h as ElementListSearchHost, i as LIST_SEARCH_COMMAND_IDS, j as FuzzySearchOptions, k as ElementIncrSearchOptions, l as buildHighlightTargets, m as ElementListSearchAdapterOptions, n as createTreeListSearchAdapter, o as registerListSearchCommands, p as createElementIncrSearch, r as listSearchStyles, s as createIncrSearch, t as TreeListSearchAdapterOptions, u as clearHighlights, v as DataListSearchItem, w as ListSearchHost, x as ListSearchAdapter, y as createDataListSearchAdapter } from "./index-CO6m-YC0.js";
20
- import { t as index_d_exports } from "./index-B-hzcIP0.js";
18
+ import { A as DataGridEditorFactory, B as GlobalFormatter, C as BuiltInFormatterName, D as DataGridDataType, E as DataGridColumnMenu, F as DataGridInteractionMode, I as DataGridRowLook, L as DataGridSelectionMode, M as DataGridGetRowKey, N as DataGridGroupBy, O as DataGridEditability, P as DataGridGroupLabel, R as DataGridSortDirection, S as DataGridViewportChangeEvent, T as DataGridColumn, _ as DataGridSelectDetail, a as DataGridColumnReorderDetail, b as DataGridSortEvent, c as DataGridColumnResizeEvent, d as DataGridElement, f as DataGridElementEventMap, g as DataGridRowActivateEvent, h as DataGridRowActivateDetail, i as DataGridCellEditEvent, j as DataGridEditorType, k as DataGridEditorContext, l as DataGridColumnVisibilityDetail, m as DataGridGroupChangeEvent, n as DataGridCellClickEvent, o as DataGridColumnReorderEvent, p as DataGridGroupChangeDetail, r as DataGridCellEditDetail, s as DataGridColumnResizeDetail, t as DataGridCellClickDetail, u as DataGridColumnVisibilityEvent, v as DataGridSelectEvent, w as BuiltInFormatterOptions, x as DataGridViewportChangeDetail, y as DataGridSortDetail, z as DataGridSortState } from "./data-grid-DmkId8bu.js";
19
+ import { A as FuzzySearch, C as ListSearchControllerOptions, D as IncrSearchTreeOptions, E as IncrSearchTreeController, F as IncrSearchChangeCallback, I as IncrSearchOptions, L as IncrSearchResult, M as HighlightOptions, N as HighlightTarget, O as createAcCompletionProvider, P as IncrSearch, R as IncrSearchState, S as ListSearchController, T as ListSearchMode, _ as DataListSearchAdapterOptions, a as RegisterListSearchCommandsOptions, b as LIST_SEARCH_MODES, c as applyHighlights, d as createFuzzySearch, f as ElementIncrSearch, g as createElementListSearchAdapter, h as ElementListSearchHost, i as LIST_SEARCH_COMMAND_IDS, j as FuzzySearchOptions, k as ElementIncrSearchOptions, l as buildHighlightTargets, m as ElementListSearchAdapterOptions, n as createTreeListSearchAdapter, o as registerListSearchCommands, p as createElementIncrSearch, r as listSearchStyles, s as createIncrSearch, t as TreeListSearchAdapterOptions, u as clearHighlights, v as DataListSearchItem, w as ListSearchHost, x as ListSearchAdapter, y as createDataListSearchAdapter } from "./index-BvoXLnBf.js";
20
+ import { t as index_d_exports } from "./index-DxyyVqzA.js";
21
21
  import { n as PanTextMode, t as PanTextElement } from "./pan-text-CoYmt2qd.js";
22
22
  import { a as ListGroupEventMap, c as ListGroupPartition, d as defaultGroupLabel, f as partitionByGroup, h as toggleInSet, i as ListGroupChangeEvent, l as ListGroupToggleDetail, m as toGroupKey, n as ListGroupBy, o as ListGroupInfo, p as resolveGroupKey, r as ListGroupChangeDetail, s as ListGroupLabel, t as EMPTY_GROUP_LABEL, u as ListGroupToggleEvent } from "./grouping-CUKgmkMm.js";
23
23
  import { a as ListItemClickDetail, c as ListSelectEvent, d as ListTickleEvent, i as ListInteractionMode, l as ListSelectionMode, n as ListActivateEvent, o as ListItemClickEvent, r as ListElementEventMap, s as ListSelectDetail, t as ListActivateDetail, u as ListTickleDetail } from "./list-selection-types-PjKdhF-a.js";
24
- import { a as ListContextMenuDetail, c as ListDragLeaveEvent, d as ListDropEvent, f as ListEditCancelDetail, h as ListEditCommitEvent, i as VerticalListElementEventMap, l as ListDragOverEvent, m as ListEditCommitDetail, n as CustomCheckboxOptions, o as ListContextMenuEvent, p as ListEditCancelEvent, r as VerticalListElement, s as ListDragLeaveDetail, t as AddItemOptions, u as ListDropDetail } from "./vertical-list-B1Fq06xr.js";
24
+ import { a as ListContextMenuDetail, c as ListDragLeaveEvent, d as ListDropEvent, f as ListEditCancelDetail, h as ListEditCommitEvent, i as VerticalListElementEventMap, l as ListDragOverEvent, m as ListEditCommitDetail, n as CustomCheckboxOptions, o as ListContextMenuEvent, p as ListEditCancelEvent, r as VerticalListElement, s as ListDragLeaveDetail, t as AddItemOptions, u as ListDropDetail } from "./vertical-list-ztrdFvyT.js";
25
25
  import { a as EditableMode, i as EditableLabelChangeEvent, n as EditableLabel, o as EntryMode, r as EditableLabelChangeDetail, t as DisplayTextLogic } from "./editable-label-rzXkjf1H.js";
26
- import { a as DetailSortComparator, i as DetailGroupBy, n as DetailListElementEventMap, o as DetailSortItem, r as DetailFormatter, s as DetailSortMode, t as DetailListElement } from "./detail-list-w32XZEgH.js";
26
+ import { a as DetailSortComparator, i as DetailGroupBy, n as DetailListElementEventMap, o as DetailSortItem, r as DetailFormatter, s as DetailSortMode, t as DetailListElement } from "./detail-list-CmQqeXvp.js";
27
27
  import { ListGroupHeaderElement } from "./list-group-header.js";
28
- import { _ as FlatListSelectEvent, a as FlatListContextMenuDetail, c as FlatListDropEvent, d as FlatListEditCommitDetail, f as FlatListEditCommitEvent, g as FlatListSelectDetail, h as FlatListNavigateEvent, i as FlatListBranchOrder, l as FlatListEditCancelDetail, m as FlatListNavigateDetail, n as FlatListActivateDetail, o as FlatListContextMenuEvent, p as FlatListElementEventMap, r as FlatListActivateEvent, s as FlatListDropDetail, t as FlatListElement, u as FlatListEditCancelEvent } from "./flat-list-CkRIZCuR.js";
28
+ import { _ as FlatListSelectEvent, a as FlatListContextMenuDetail, c as FlatListDropEvent, d as FlatListEditCommitDetail, f as FlatListEditCommitEvent, g as FlatListSelectDetail, h as FlatListNavigateEvent, i as FlatListBranchOrder, l as FlatListEditCancelDetail, m as FlatListNavigateDetail, n as FlatListActivateDetail, o as FlatListContextMenuEvent, p as FlatListElementEventMap, r as FlatListActivateEvent, s as FlatListDropDetail, t as FlatListElement, u as FlatListEditCancelEvent } from "./flat-list-BmQBB3ZC.js";
29
29
  import { FormElement } from "./form.js";
30
- import { A as DragSelectRect, C as TreeKeyboardNavControllerConfig, D as ListSelectionGesture, E as ListSelectionControllerConfig, M as ListDragSelectControllerConfig, O as ListSelectionModes, S as TreeKeyboardNavController, T as ListSelectionController, _ as GridListTickleDetail, a as GridListCaptionBackdrop, b as GridListViewportChangeEvent, c as GridListDataAdapter, d as GridListItemClickDetail, f as GridListItemClickEvent, g as GridListSelectEvent, h as GridListSelectDetail, i as GridListCaptionAlign, j as ListDragSelectController, k as isMultiMode, l as GridListElementEventMap, m as GridListOrientation, n as GridListActivateDetail, o as GridListCaptionPosition, p as GridListItemEventDetail, r as GridListActivateEvent, s as GridListCaptionStyle, t as GridListElement, u as GridListFullElementEventMap, v as GridListTickleEvent, w as TreeKeyboardNavItemId, x as TreeKeyboardNavCallbacks, y as GridListViewportChangeDetail } from "./grid-list-DUvhSoT2.js";
31
- import { n as ListNativeDragControllerConfig, t as ListNativeDragController } from "./list-native-drag-controller-CvXN3NB7.js";
30
+ import { A as DragSelectRect, C as TreeKeyboardNavControllerConfig, D as ListSelectionGesture, E as ListSelectionControllerConfig, M as ListDragSelectControllerConfig, O as ListSelectionModes, S as TreeKeyboardNavController, T as ListSelectionController, _ as GridListTickleDetail, a as GridListCaptionBackdrop, b as GridListViewportChangeEvent, c as GridListDataAdapter, d as GridListItemClickDetail, f as GridListItemClickEvent, g as GridListSelectEvent, h as GridListSelectDetail, i as GridListCaptionAlign, j as ListDragSelectController, k as isMultiMode, l as GridListElementEventMap, m as GridListOrientation, n as GridListActivateDetail, o as GridListCaptionPosition, p as GridListItemEventDetail, r as GridListActivateEvent, s as GridListCaptionStyle, t as GridListElement, u as GridListFullElementEventMap, v as GridListTickleEvent, w as TreeKeyboardNavItemId, x as TreeKeyboardNavCallbacks, y as GridListViewportChangeDetail } from "./grid-list-BVsUEvgd.js";
31
+ import { n as ListNativeDragControllerConfig, t as ListNativeDragController } from "./list-native-drag-controller-NMspr0E1.js";
32
32
  import { i as TickledItem, n as TickledController, r as TickledControllerConfig, t as InputMode } from "./tickled-controller-DodxD3eQ.js";
33
33
  import { a as IGroupedSubComponent, c as SubComponentActivateEvent, d as SubComponentItemClickEvent, f as SubComponentSelectDetail, h as SubComponentTickleEvent, i as GroupedSelectEvent, l as SubComponentFactory, m as SubComponentTickleDetail, n as GroupedItemListerElementEventMap, o as IGroupedSubComponentEventMap, p as SubComponentSelectEvent, r as GroupedSelectDetail, s as SubComponentActivateDetail, t as GroupedItemListerElement, u as SubComponentItemClickDetail } from "./grouped-item-lister-DETte0Dh.js";
34
34
  import { a as TitlebarToggleDetail, c as TitlebarVariant, i as TitlebarOrientation, n as TitlebarElement, o as TitlebarToggleEvent, r as TitlebarElementEventMap, s as TitlebarToggleInteraction, t as TitlebarCloseEvent } from "./titlebar-Tqu-VvMU.js";
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ import { t as CheckedSelect } from "./checked-select-lDgAQQ7v.js";
27
27
  import { n as ColourPicker, t as ColourPickerPopup } from "./colour-picker-BCMU7W7R.js";
28
28
  import { LabelledRangeInput } from "./labelled-range-input.js";
29
29
  import { t as collectDataResult } from "./data-provider-35TyWclX.js";
30
- import { a as TreeDataModel, c as pruneDraggedDescendants, i as TreeDropController, n as TreeListElement, o as applyTreeDrop, r as TreeBaseElement, s as dropTargetFor, t as TreeController } from "./tree-BM2CY6uu.js";
30
+ import { a as TreeDataModel, c as pruneDraggedDescendants, i as TreeDropController, n as TreeListElement, o as applyTreeDrop, r as TreeBaseElement, s as dropTargetFor, t as TreeController } from "./tree-BFoN2Z_P.js";
31
31
  import { t as scrollFadeStyles } from "./scroll-fade-Xx28D7mH.js";
32
32
  import { NarrowedTextElement } from "./narrowed-text.js";
33
33
  import { CrumbNavigationElement } from "./crumbs.js";
@@ -1,4 +1,4 @@
1
- import { F as ListDragPreviewContext, I as ListDragPreviewRenderer, L as ListDragPreviewSourceResolver, N as ListDragEntry, R as ListDragSource, z as ListNativeDragStartDetail } from "./tree-component-Tslymyyl.js";
1
+ import { F as ListDragPreviewContext, I as ListDragPreviewRenderer, L as ListDragPreviewSourceResolver, N as ListDragEntry, R as ListDragSource, z as ListNativeDragStartDetail } from "./tree-component-CDsYTBDi.js";
2
2
  import { ReactiveController, ReactiveControllerHost } from "lit";
3
3
  //#region src/interaction/list-native-drag-controller.d.ts
4
4
  type ListNativeDragControllerConfig<T> = {
package/dist/menu.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { i as MenuContainer, n as MenuTrigger, t as MenuItem } from "./menu-item-bF6narIz.js";
2
- import { a as menuFromTree, c as MenuSeparator, d as MenuCheckItem, f as MenuBar, i as MenuFromTreeOptions, l as MenuSubTrigger, n as MenuRadioGroup, o as menuFromTreeToElements, r as MenuRadioItem, s as MenuHeader, u as MenuCommandController } from "./index-B-hzcIP0.js";
2
+ import { a as menuFromTree, c as MenuSeparator, d as MenuCheckItem, f as MenuBar, i as MenuFromTreeOptions, l as MenuSubTrigger, n as MenuRadioGroup, o as menuFromTreeToElements, r as MenuRadioItem, s as MenuHeader, u as MenuCommandController } from "./index-DxyyVqzA.js";
3
3
  export { MenuBar, MenuCheckItem, MenuCommandController, MenuContainer, type MenuFromTreeOptions, MenuHeader, MenuItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuSubTrigger, MenuTrigger, menuFromTree, menuFromTreeToElements };
package/dist/miller.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { A as TreeTickleEvent, D as TreeSelectDetail, E as TreeSearchHost, O as TreeSelectEvent, a as TreeComponent, b as TreeItemClickDetail, i as TreeCollapseEvent, j as TreeDataModel, k as TreeTickleDetail, n as TreeActivateEvent, o as TreeComponentEventMap, r as TreeCollapseDetail, t as TreeActivateDetail, v as TreeExpandDetail, w as TreeNavigateOptions, x as TreeItemClickEvent, y as TreeExpandEvent } from "./tree-component-Tslymyyl.js";
2
- import { a as TreeItem, n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-DQ7KOUIj.js";
3
- import { S as ListSearchController } from "./index-CO6m-YC0.js";
1
+ import { A as TreeTickleEvent, D as TreeSelectDetail, E as TreeSearchHost, O as TreeSelectEvent, a as TreeComponent, b as TreeItemClickDetail, i as TreeCollapseEvent, j as TreeDataModel, k as TreeTickleDetail, n as TreeActivateEvent, o as TreeComponentEventMap, r as TreeCollapseDetail, t as TreeActivateDetail, v as TreeExpandDetail, w as TreeNavigateOptions, x as TreeItemClickEvent, y as TreeExpandEvent } from "./tree-component-CDsYTBDi.js";
2
+ import { a as TreeItem, n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-Jky6oNAp.js";
3
+ import { S as ListSearchController } from "./index-BvoXLnBf.js";
4
4
  import { n as TickledController } from "./tickled-controller-DodxD3eQ.js";
5
5
  import { LitElement, PropertyValues, TemplateResult, nothing } from "lit";
6
6
  import { CommandRegistry } from "@clinth/ui-commands";
@@ -919,7 +919,8 @@ function weaveGhosts(rows, prevKeys, ghosts) {
919
919
  * Compute checkbox states for all nodes in a single iterative post-order pass.
920
920
  * A leaf (or a branch with no children) uses `selected.has(node)`; otherwise a
921
921
  * branch is checked if all children are checked, unchecked if all are
922
- * unchecked, else indeterminate.
922
+ * unchecked, else indeterminate. Unselectable leaves (`item.selectable === false`)
923
+ * are ignored when deriving a parent's state.
923
924
  *
924
925
  * @param root - The root node
925
926
  * @param selected - Set of selected nodes
@@ -934,7 +935,8 @@ function computeCheckboxStates(root, selected) {
934
935
  node: top,
935
936
  next: 0,
936
937
  checked: 0,
937
- unchecked: 0
938
+ unchecked: 0,
939
+ counted: 0
938
940
  });
939
941
  while (stack.length > 0) {
940
942
  const frame = stack[stack.length - 1];
@@ -946,19 +948,23 @@ function computeCheckboxStates(root, selected) {
946
948
  node: children[frame.next++],
947
949
  next: 0,
948
950
  checked: 0,
949
- unchecked: 0
951
+ unchecked: 0,
952
+ counted: 0
950
953
  });
951
954
  continue;
952
955
  }
953
956
  stack.pop();
954
957
  let state;
955
958
  if (isLeafLike) state = selected.has(node) ? `checked` : `unchecked`;
956
- else if (frame.checked === children.length) state = `checked`;
957
- else if (frame.unchecked === children.length) state = `unchecked`;
959
+ else if (frame.counted === 0) state = `unchecked`;
960
+ else if (frame.checked === frame.counted) state = `checked`;
961
+ else if (frame.unchecked === frame.counted) state = `unchecked`;
958
962
  else state = `indeterminate`;
959
963
  states.set(node.item.key, state);
960
- if (stack.length > 0) {
964
+ const abstains = isLeafLike && node.item.selectable === false;
965
+ if (stack.length > 0 && !abstains) {
961
966
  const parent = stack[stack.length - 1];
967
+ parent.counted++;
962
968
  if (state === `checked`) parent.checked++;
963
969
  else if (state === `unchecked`) parent.unchecked++;
964
970
  }
@@ -1739,6 +1745,10 @@ let TreeBaseElement = class TreeBaseElement extends LitElement {
1739
1745
  }
1740
1746
  this.#flat = void 0;
1741
1747
  if (changedProps.has(`root`) || changedProps.has(`model`)) this.#structureVersion++;
1748
+ if (changedProps.has(`root`) && this.root && this._expandedKeys.size > 0) {
1749
+ const { parentByKey } = this.#getTreeIndex();
1750
+ this.#setExpanded(withoutKeys(this._expandedKeys, (key) => !parentByKey.has(key)));
1751
+ }
1742
1752
  this.#diffVisibleNodes(changedProps.has(`filterPredicate`));
1743
1753
  const virtual = this.#virtualActive();
1744
1754
  this.toggleAttribute(`data-virtual`, virtual);
@@ -1853,7 +1863,6 @@ let TreeBaseElement = class TreeBaseElement extends LitElement {
1853
1863
  this.#syncStickyScroll();
1854
1864
  if (changedProps.has(`root`) && this.root) {
1855
1865
  this.#abortPending();
1856
- this.#setExpanded(/* @__PURE__ */ new Set());
1857
1866
  this.#clearSelectionInternal();
1858
1867
  this.tickled.clearTickled();
1859
1868
  this._focusedDepth = 0;
@@ -2529,8 +2538,9 @@ let TreeBaseElement = class TreeBaseElement extends LitElement {
2529
2538
  return result;
2530
2539
  }
2531
2540
  #canSelect(node) {
2541
+ if (node.item.selectable === false) return false;
2532
2542
  if (this.selectionFilter === `none`) return false;
2533
- if (this.selectionFilter === `leaf`) return node.item.isLeaf === true;
2543
+ if (this.selectionFilter === `leaf`) return node.item.isLeaf === true || node.item.isLeaf !== false && node.children?.length === 0;
2534
2544
  if (this.selectionFilter === `branch`) return node.item.isLeaf === false || node.children !== void 0 && node.children.length > 0;
2535
2545
  return true;
2536
2546
  }
@@ -2578,7 +2588,7 @@ let TreeBaseElement = class TreeBaseElement extends LitElement {
2578
2588
  _handleItemClick(node, depth, event) {
2579
2589
  if (this.#drop?.isDragging || this.#nativeDrag?.isDragging || this.#postDragSuppressTimer !== void 0) return;
2580
2590
  if (event && event.detail >= 2) return;
2581
- if (this.interactionMode === `checked` && event && !(event.target instanceof Element && event.target.closest(`.tree-label`))) {
2591
+ if (this.interactionMode === `checked` && node.item.selectable !== false && event && !(event.target instanceof Element && event.target.closest(`.tree-label`))) {
2582
2592
  this._handleCheckboxClick(event, node, depth);
2583
2593
  return;
2584
2594
  }
@@ -3458,6 +3468,10 @@ TreeBaseElement = __decorate([safeCustomElement(`ixfx-tree-base`)], TreeBaseElem
3458
3468
  //#endregion
3459
3469
  //#region src/tree/tree-list.ts
3460
3470
  let TreeListElement = class TreeListElement extends TreeBaseElement {
3471
+ constructor(..._args) {
3472
+ super(..._args);
3473
+ this.alignCheckboxes = false;
3474
+ }
3461
3475
  /** Checkbox tri-states for the whole loaded tree, rebuilt only when the structure or selection changes. */
3462
3476
  #checkboxCache;
3463
3477
  willUpdate(changedProps) {
@@ -3495,6 +3509,7 @@ let TreeListElement = class TreeListElement extends TreeBaseElement {
3495
3509
  </span>
3496
3510
  `;
3497
3511
  if (this.interactionMode === `checked`) {
3512
+ if (node.item.selectable === false) return this.alignCheckboxes ? html`<span class="tree-checkbox-spacer" aria-hidden="true"></span>${caretAndLabel}` : caretAndLabel;
3498
3513
  const state = this.#checkboxCache?.states.get(node.item.key) ?? `unchecked`;
3499
3514
  return html`${this.#renderCheckbox(node, depth, state)}${caretAndLabel}`;
3500
3515
  }
@@ -3609,9 +3624,16 @@ let TreeListElement = class TreeListElement extends TreeBaseElement {
3609
3624
  anchor-name: --tooltip-tree;
3610
3625
  }
3611
3626
 
3612
- .tree-checkbox {
3627
+ .tree-checkbox,
3628
+ .tree-checkbox-spacer {
3613
3629
  flex-shrink: 0;
3614
- margin-right: var(--space-xs, 3px);
3630
+ box-sizing: border-box;
3631
+ width: var(--tree-checkbox-size, 14px);
3632
+ height: var(--tree-checkbox-size, 14px);
3633
+ margin: 0 var(--space-xs, 3px) 0 0;
3634
+ }
3635
+
3636
+ .tree-checkbox {
3615
3637
  cursor: pointer;
3616
3638
  accent-color: var(--accent);
3617
3639
  pointer-events: auto;
@@ -3650,6 +3672,11 @@ let TreeListElement = class TreeListElement extends TreeBaseElement {
3650
3672
  }
3651
3673
  };
3652
3674
  __decorate([property({ attribute: false })], TreeListElement.prototype, "checkboxRenderer", void 0);
3675
+ __decorate([property({
3676
+ type: Boolean,
3677
+ reflect: true,
3678
+ attribute: `align-checkboxes`
3679
+ })], TreeListElement.prototype, "alignCheckboxes", void 0);
3653
3680
  TreeListElement = __decorate([safeCustomElement(`ixfx-tree-list`)], TreeListElement);
3654
3681
  //#endregion
3655
3682
  //#region src/tree/tree-controller.ts
@@ -1,4 +1,4 @@
1
- import { a as TreeItem, n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-DQ7KOUIj.js";
1
+ import { a as TreeItem, n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-Jky6oNAp.js";
2
2
  //#region src/interaction/list-drag-types.d.ts
3
3
  interface ListDragEntry<T> {
4
4
  readonly key: string;
package/dist/tree.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as TreeTickleEvent, D as TreeSelectDetail, M as TreeDataModelOptions, O as TreeSelectEvent, T as TreeRevealMode, _ as TreeDropTarget, b as TreeItemClickDetail, c as TreeDragContext, d as TreeDragStartEvent, g as TreeDropPosition, h as TreeDropEvent, i as TreeCollapseEvent, j as TreeDataModel, k as TreeTickleDetail, l as TreeDragEndEvent, m as TreeDropDetail, n as TreeActivateEvent, o as TreeComponentEventMap, p as TreeDropContext, r as TreeCollapseDetail, s as TreeDndMode, t as TreeActivateDetail, u as TreeDragOverEvent, v as TreeExpandDetail, w as TreeNavigateOptions, x as TreeItemClickEvent, y as TreeExpandEvent } from "./tree-component-Tslymyyl.js";
2
- import { a as TreeItem, n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-DQ7KOUIj.js";
3
- import { a as TreeDropVisibleRow, c as TreeListElement, d as TreeBaseElementEventMap, f as TreeVirtualize, i as TreeDropRowInfo, l as TreeCheckboxState, n as TreeDropControllerConfig, o as TreeController, p as TreeConfig, r as TreeDropResolvedDrag, s as TreeControllerOptions, t as TreeDropController, u as TreeBaseElement } from "./index-CSCrK0hR.js";
1
+ import { A as TreeTickleEvent, D as TreeSelectDetail, M as TreeDataModelOptions, O as TreeSelectEvent, T as TreeRevealMode, _ as TreeDropTarget, b as TreeItemClickDetail, c as TreeDragContext, d as TreeDragStartEvent, g as TreeDropPosition, h as TreeDropEvent, i as TreeCollapseEvent, j as TreeDataModel, k as TreeTickleDetail, l as TreeDragEndEvent, m as TreeDropDetail, n as TreeActivateEvent, o as TreeComponentEventMap, p as TreeDropContext, r as TreeCollapseDetail, s as TreeDndMode, t as TreeActivateDetail, u as TreeDragOverEvent, v as TreeExpandDetail, w as TreeNavigateOptions, x as TreeItemClickEvent, y as TreeExpandEvent } from "./tree-component-CDsYTBDi.js";
2
+ import { a as TreeItem, n as TreeExclusivity, o as TreeNode, r as TreeFilterPredicate, s as TreeSelectionFilter, t as LoadChildrenCallback } from "./types-Jky6oNAp.js";
3
+ import { a as TreeDropVisibleRow, c as TreeListElement, d as TreeBaseElementEventMap, f as TreeVirtualize, i as TreeDropRowInfo, l as TreeCheckboxState, n as TreeDropControllerConfig, o as TreeController, p as TreeConfig, r as TreeDropResolvedDrag, s as TreeControllerOptions, t as TreeDropController, u as TreeBaseElement } from "./index-DuhzWWTr.js";
4
4
  export { type LoadChildrenCallback, type TreeActivateDetail, type TreeActivateEvent, TreeBaseElement, TreeBaseElementEventMap, type TreeCheckboxState, type TreeCollapseDetail, type TreeCollapseEvent, type TreeComponentEventMap, TreeConfig, TreeController, TreeControllerOptions, TreeDataModel, type TreeDataModelOptions, type TreeDndMode, type TreeDragContext, type TreeDragEndEvent, type TreeDragOverEvent, type TreeDragStartEvent, type TreeDropContext, TreeDropController, TreeDropControllerConfig, type TreeDropDetail, type TreeDropEvent, type TreeDropPosition, TreeDropResolvedDrag, TreeDropRowInfo, type TreeDropTarget, TreeDropVisibleRow, type TreeExclusivity, type TreeExpandDetail, type TreeExpandEvent, type TreeFilterPredicate, type TreeItem, type TreeItemClickDetail, type TreeItemClickEvent, TreeListElement, type TreeNavigateOptions, type TreeNode, type TreeRevealMode, type TreeSelectDetail, type TreeSelectEvent, type TreeSelectionFilter, type TreeTickleDetail, type TreeTickleEvent, TreeVirtualize };
package/dist/tree.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as TreeDataModel, i as TreeDropController, n as TreeListElement, r as TreeBaseElement, t as TreeController } from "./tree-BM2CY6uu.js";
1
+ import { a as TreeDataModel, i as TreeDropController, n as TreeListElement, r as TreeBaseElement, t as TreeController } from "./tree-BFoN2Z_P.js";
2
2
  export { TreeBaseElement, TreeController, TreeDataModel, TreeDropController, TreeListElement };
@@ -36,6 +36,14 @@ type TreeItem = {
36
36
  * (`beginEdit`) uses it; other components ignore it.
37
37
  */
38
38
  editable?: boolean;
39
+ /**
40
+ * Set to `false` to make this node unselectable, regardless of
41
+ * `selectionFilter`. In `ixfx-tree-list`'s `checked` mode no checkbox is
42
+ * drawn for it (see `alignCheckboxes`). Unselectable branches can still be
43
+ * expanded, and their selectable descendants can still be selected.
44
+ * Default: selectable.
45
+ */
46
+ selectable?: boolean;
39
47
  /** Tooltip text shown on hover. */
40
48
  tooltip?: string;
41
49
  /** Optional string value, e.g. for use as a command/route. */
@@ -1,6 +1,6 @@
1
- import { B as ListNativeDragStartEvent, I as ListDragPreviewRenderer, L as ListDragPreviewSourceResolver } from "./tree-component-Tslymyyl.js";
1
+ import { B as ListNativeDragStartEvent, I as ListDragPreviewRenderer, L as ListDragPreviewSourceResolver } from "./tree-component-CDsYTBDi.js";
2
2
  import { n as ListViewportChangeEvent } from "./list-viewport-types-BRZsLcvp.js";
3
- import { S as ListSearchController } from "./index-CO6m-YC0.js";
3
+ import { S as ListSearchController } from "./index-BvoXLnBf.js";
4
4
  import { i as ListInteractionMode, l as ListSelectionMode, r as ListElementEventMap } from "./list-selection-types-PjKdhF-a.js";
5
5
  import "./editable-label-rzXkjf1H.js";
6
6
  import { LitElement, PropertyValues } from "lit";
@@ -1,5 +1,5 @@
1
- import { B as ListNativeDragStartEvent, F as ListDragPreviewContext, I as ListDragPreviewRenderer, N as ListDragEntry, P as ListDragPreview, R as ListDragSource, z as ListNativeDragStartDetail } from "./tree-component-Tslymyyl.js";
1
+ import { B as ListNativeDragStartEvent, F as ListDragPreviewContext, I as ListDragPreviewRenderer, N as ListDragEntry, P as ListDragPreview, R as ListDragSource, z as ListNativeDragStartDetail } from "./tree-component-CDsYTBDi.js";
2
2
  import { n as ListViewportChangeEvent, t as ListViewportChangeDetail } from "./list-viewport-types-BRZsLcvp.js";
3
3
  import { a as ListItemClickDetail, c as ListSelectEvent, d as ListTickleEvent, i as ListInteractionMode, l as ListSelectionMode, n as ListActivateEvent, o as ListItemClickEvent, r as ListElementEventMap, s as ListSelectDetail, t as ListActivateDetail, u as ListTickleDetail } from "./list-selection-types-PjKdhF-a.js";
4
- import { a as ListContextMenuDetail, c as ListDragLeaveEvent, d as ListDropEvent, f as ListEditCancelDetail, h as ListEditCommitEvent, i as VerticalListElementEventMap, l as ListDragOverEvent, m as ListEditCommitDetail, n as CustomCheckboxOptions, o as ListContextMenuEvent, p as ListEditCancelEvent, r as VerticalListElement, s as ListDragLeaveDetail, t as AddItemOptions, u as ListDropDetail } from "./vertical-list-B1Fq06xr.js";
4
+ import { a as ListContextMenuDetail, c as ListDragLeaveEvent, d as ListDropEvent, f as ListEditCancelDetail, h as ListEditCommitEvent, i as VerticalListElementEventMap, l as ListDragOverEvent, m as ListEditCommitDetail, n as CustomCheckboxOptions, o as ListContextMenuEvent, p as ListEditCancelEvent, r as VerticalListElement, s as ListDragLeaveDetail, t as AddItemOptions, u as ListDropDetail } from "./vertical-list-ztrdFvyT.js";
5
5
  export { AddItemOptions, CustomCheckboxOptions, type ListActivateDetail, type ListActivateEvent, type ListContextMenuDetail, type ListContextMenuEvent, type ListDragEntry, type ListDragLeaveDetail, type ListDragLeaveEvent, type ListDragOverEvent, type ListDragPreview, type ListDragPreviewContext, type ListDragPreviewRenderer, type ListDragSource, type ListDropDetail, type ListDropEvent, type ListEditCancelDetail, type ListEditCancelEvent, type ListEditCommitDetail, type ListEditCommitEvent, type ListElementEventMap, type ListInteractionMode, type ListItemClickDetail, type ListItemClickEvent, type ListNativeDragStartDetail, type ListNativeDragStartEvent, type ListSelectDetail, type ListSelectEvent, type ListSelectionMode, type ListTickleDetail, type ListTickleEvent, type ListViewportChangeDetail, type ListViewportChangeEvent, VerticalListElement, VerticalListElementEventMap };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ixfx/components",
3
- "version": "0.14.2",
4
- "generated": "2026-10-13T12:04:47.321Z",
3
+ "version": "0.14.3",
4
+ "generated": "2026-10-16T15:45:06.852Z",
5
5
  "components": [
6
6
  {
7
7
  "name": "ac-text",
package/docs-user/tree.md CHANGED
@@ -11,6 +11,7 @@ Three components share a common `TreeComponent` interface: **`ixfx-tree-list`**,
11
11
  1. [Data model](#data-model)
12
12
  2. [Properties](#properties)
13
13
  - [Custom checkbox (`checkboxRenderer`)](#custom-checkbox-ixfx-tree-list-only--checkboxrenderer)
14
+ - [Unselectable items (`selectable`, `alignCheckboxes`)](#unselectable-items-selectable-aligncheckboxes)
14
15
  - [Virtualisation](#virtualisation-ixfx-tree-list)
15
16
  3. [Selection](#selection)
16
17
  4. [Events](#events)
@@ -31,6 +32,7 @@ type TreeItem = {
31
32
  key: string; // Unique identifier across the whole tree
32
33
  label: string; // Display text
33
34
  isLeaf?: boolean; // true = never expandable; undefined/false = branch
35
+ selectable?: boolean; // false = can never be selected (and gets no checkbox in `checked` mode)
34
36
  data?: unknown; // Arbitrary user payload
35
37
  icon?: string; // Icon name (passed to <ixfx-icon>)
36
38
  tooltip?: string; // Tooltip content
@@ -138,19 +140,33 @@ These properties are present on all three components (`ixfx-tree-list`, `ixfx-mi
138
140
 
139
141
  | Property / Attribute | Type | Default | Description |
140
142
  |----------------------|------|---------|-------------|
141
- | `root` | `TreeNode \| undefined` | `undefined` | Root node of the tree |
143
+ | `root` | `TreeNode \| undefined` | `undefined` | Root node of the tree. Replacing it keeps expansion for every `item.key` still present (see [Replacing `root`](#replacing-root)); selection and focus are reset |
142
144
  | `model` | `TreeDataModel \| undefined` | `undefined` | Shared data model; takes precedence over `loadChildren` |
143
145
  | `loadChildren` | `LoadChildrenCallback \| undefined` | `undefined` | Callback for lazy child loading |
144
146
  | `selectedNode` | `TreeNode \| undefined` | `undefined` | Primary (most recent) selected node |
145
147
  | `selectedNodes` | `ReadonlySet<TreeNode>` | `{}` | Full selection set (read-only) |
146
148
  | `interactionMode` | `TreeInteractionMode` | `'standard'` | How gestures map to selection changes (`ixfx-tree-list` / `ixfx-miller-list` only) |
147
149
  | `selectionFilter` | `'none' \| 'leaf' \| 'branch'` | `'leaf'` | Which node kinds can be selected (reflected attribute) |
150
+ | `alignCheckboxes` (`align-checkboxes`) | `boolean` | `false` | In `checked` mode, unselectable rows keep the space their checkbox would take so they line up with selectable siblings (`ixfx-tree-list` only). See [Unselectable items](#unselectable-items-selectable-aligncheckboxes) |
148
151
  | `filterPredicate` | `TreeFilterPredicate \| undefined` | `undefined` | Filter; only matching nodes and their ancestors are rendered (non-matching rows are not in the DOM, keyboard navigation, `selectAll` and Shift-range skip them) |
149
152
  | `exclusivity` | `'none' \| 'depth' \| 'global'` | `'none'` | Expansion exclusivity (reflected attribute) |
150
153
  | `stickyHeaders` (`sticky-headers`) | `boolean` | `true` | VS Code-style sticky headers; set `sticky-headers="false"` to opt out (`ixfx-tree-list` only) |
151
154
  | `virtualize` | `'auto' \| 'on' \| 'off'` | `'auto'` | Render only the rows near the viewport; `auto` switches on above `virtualizeThreshold` visible rows (`ixfx-tree-list` only). See [Virtualisation](#virtualisation-ixfx-tree-list) |
152
155
  | `virtualizeThreshold` (`virtualize-threshold`) | `number` | `200` | Visible-row count above which `virtualize="auto"` windows the list |
153
156
 
157
+ ### Replacing `root`
158
+
159
+ Because `TreeNode` is immutable, any structural change means assigning a new `root`. When you do:
160
+
161
+ - **Expansion is kept** for every branch whose `item.key` still exists in the new root, and dropped for keys that are gone. A key that disappears and later returns comes back collapsed. Call `collapseAll()` if you want a fresh tree.
162
+ - **Selection, focus and any pending lazy load are reset**, since they may refer to nodes that no longer exist.
163
+ - The reconciliation happens before the render, so assigning `root` and then calling `expandAll()` (or `navigateTo()`) synchronously works as you'd expect:
164
+
165
+ ```ts
166
+ tree.root = rebuild();
167
+ tree.expandAll(); // stays expanded after the update
168
+ ```
169
+
154
170
  ### `interactionMode` (`ixfx-tree-list` / `ixfx-miller-list`)
155
171
 
156
172
  Controls how pointer and keyboard gestures translate to selection changes.
@@ -201,12 +217,47 @@ ixfx-tree-list::part(checkbox) {
201
217
  }
202
218
  ```
203
219
 
220
+ ### Unselectable items (`ixfx-tree-list`) — `selectable`, `alignCheckboxes`
221
+
222
+ Set `selectable: false` on a `TreeItem` to stop that one node being selected, independent of `selectionFilter` and of the interaction mode. Selection APIs (`selectNode`, `selectAll`, `Shift`-range, search "select" mode) skip it.
223
+
224
+ ```typescript
225
+ const root: TreeNode = {
226
+ item: { key: 'root', label: 'root' },
227
+ children: [
228
+ {
229
+ item: { key: 'fruit', label: 'Fruit', selectable: false }, // heading only
230
+ children: [
231
+ { item: { key: 'apple', label: 'Apple', isLeaf: true } }, // selectable
232
+ { item: { key: 'pear', label: 'Pear', isLeaf: true } },
233
+ ],
234
+ },
235
+ ],
236
+ };
237
+ ```
238
+
239
+ In `checked` mode:
240
+
241
+ - An unselectable row is drawn **without a checkbox**, and clicks in its leading region (indent, caret, icon) expand/collapse it like a normal row instead of toggling a checkbox.
242
+ - Its selectable descendants behave as normal. Unselectable leaves are ignored when working out a parent's `checked` / `indeterminate` state, so a branch whose only selectable children are all checked shows as checked.
243
+ - Only the item's own flag decides whether a checkbox is drawn. A branch that `selectionFilter="leaf"` stops being selected itself still gets a checkbox, because that checkbox toggles its descendants.
244
+
245
+ **Alignment.** By default an unselectable row reserves no space where the checkbox would be, so its caret and label sit further left than its selectable siblings. Set the `align-checkboxes` attribute (or `alignCheckboxes = true`) to keep that space:
246
+
247
+ ```html
248
+ <ixfx-tree-list interaction-mode="checked" align-checkboxes></ixfx-tree-list>
249
+ ```
250
+
251
+ The reserved space is an empty `<span class="tree-checkbox-spacer" aria-hidden="true">` the same size as a checkbox (`--tree-checkbox-size`, default `14px`, plus a `--space-xs` right margin). The native checkbox uses the same size, so rows line up exactly.
252
+
253
+ `alignCheckboxes` has no effect outside `checked` mode. `selectable: false` is honoured by the other tree components for selection, but only `ixfx-tree-list` draws checkboxes. See the "Unselectable items" section of `demo/tree-list.html` for a live example with a toggle.
254
+
204
255
  ### `selectionFilter`
205
256
 
206
257
  | Value | Behaviour |
207
258
  |-------|-----------|
208
259
  | `'none'` | No nodes can be selected |
209
- | `'leaf'` | Only leaf nodes (`isLeaf: true` or `children: []`) can be selected |
260
+ | `'leaf'` | Only leaf nodes can be selected: `isLeaf: true`, or a loaded node with `children: []` (unless `isLeaf: false`). A node whose `children` are not loaded yet is not a leaf |
210
261
  | `'branch'` | Only branch nodes can be selected |
211
262
 
212
263
  ### `exclusivity`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ixfx/components",
3
3
  "type": "module",
4
- "version": "0.14.2",
4
+ "version": "0.14.3",
5
5
  "packageManager": "pnpm@10.0.0",
6
6
  "description": "Web components for ixfx — Lit-based UI toolkit",
7
7
  "author": "Clint Heyer",