@jimka/typescript-ui 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/{AbstractBooleanInput-DE5NNJT0.js → AbstractBooleanInput-CbW7ZrDT.js} +2 -2
- package/dist/lib/{AbstractBooleanInput-DE5NNJT0.js.map → AbstractBooleanInput-CbW7ZrDT.js.map} +1 -1
- package/dist/lib/{AbstractInput-BxfrmD2W.js → AbstractInput-B10DfLOf.js} +2 -2
- package/dist/lib/{AbstractInput-BxfrmD2W.js.map → AbstractInput-B10DfLOf.js.map} +1 -1
- package/dist/lib/Anchor-BsblS5it.js +2 -0
- package/dist/lib/Anchor-BsblS5it.js.map +1 -0
- package/dist/lib/AnchorConstraints-Bfkt8019.js +2 -0
- package/dist/lib/AnchorConstraints-Bfkt8019.js.map +1 -0
- package/dist/lib/{AnimatedDropdown-QLNasu_Y.js → AnimatedDropdown-kL47HPGP.js} +2 -2
- package/dist/lib/{AnimatedDropdown-QLNasu_Y.js.map → AnimatedDropdown-kL47HPGP.js.map} +1 -1
- package/dist/lib/Border-CNS6aEXB.js +2 -0
- package/dist/lib/{Border-CKKUk5G9.js.map → Border-CNS6aEXB.js.map} +1 -1
- package/dist/lib/Button-T16zSZip.js +2 -0
- package/dist/lib/Button-T16zSZip.js.map +1 -0
- package/dist/lib/{Card-a4dzYrbX.js → Card-CD3jxshU.js} +2 -2
- package/dist/lib/{Card-a4dzYrbX.js.map → Card-CD3jxshU.js.map} +1 -1
- package/dist/lib/CodeEditor-BGlB232h.js +2 -0
- package/dist/lib/CodeEditor-BGlB232h.js.map +1 -0
- package/dist/lib/ComboBox-C9FYMuLv.js +2 -0
- package/dist/lib/ComboBox-C9FYMuLv.js.map +1 -0
- package/dist/lib/Component-w65rPK75.js +2 -0
- package/dist/lib/Component-w65rPK75.js.map +1 -0
- package/dist/lib/Container-C7RPLQEc.js +2 -0
- package/dist/lib/{Container-0bsG2Q8Z.js.map → Container-C7RPLQEc.js.map} +1 -1
- package/dist/lib/DOM-Ba8YRVel.js +2 -0
- package/dist/lib/{DOM-67StIm5G.js.map → DOM-Ba8YRVel.js.map} +1 -1
- package/dist/lib/DragManager-UvPHSoRm.js +2 -0
- package/dist/lib/{DragManager-DRor_-1x.js.map → DragManager-UvPHSoRm.js.map} +1 -1
- package/dist/lib/{FieldDecorator-Bpx8J8n9.js → FieldDecorator-HG65hEtk.js} +2 -2
- package/dist/lib/{FieldDecorator-Bpx8J8n9.js.map → FieldDecorator-HG65hEtk.js.map} +1 -1
- package/dist/lib/{Fit-CL1m1nIZ.js → Fit-Cg3dPyZg.js} +2 -2
- package/dist/lib/{Fit-CL1m1nIZ.js.map → Fit-Cg3dPyZg.js.map} +1 -1
- package/dist/lib/FloatingPanel-D5buuVrQ.js +2 -0
- package/dist/lib/FloatingPanel-D5buuVrQ.js.map +1 -0
- package/dist/lib/{Glyph-wN7bk7mg.js → Glyph-DeJF_zsR.js} +2 -2
- package/dist/lib/{Glyph-wN7bk7mg.js.map → Glyph-DeJF_zsR.js.map} +1 -1
- package/dist/lib/{Grid-DHHmaB-Y.js → Grid-BYBohJIA.js} +2 -2
- package/dist/lib/{Grid-DHHmaB-Y.js.map → Grid-BYBohJIA.js.map} +1 -1
- package/dist/lib/{GridConstraints-DVc1BmlP.js → GridConstraints-Bts284FI.js} +2 -2
- package/dist/lib/{GridConstraints-DVc1BmlP.js.map → GridConstraints-Bts284FI.js.map} +1 -1
- package/dist/lib/{Header-2hKwQo_u.js → Header-BIFJK9nR.js} +2 -2
- package/dist/lib/{Header-2hKwQo_u.js.map → Header-BIFJK9nR.js.map} +1 -1
- package/dist/lib/{IconText-DC7Xe34b.js → IconText-Dsb1xS-E.js} +2 -2
- package/dist/lib/{IconText-DC7Xe34b.js.map → IconText-Dsb1xS-E.js.map} +1 -1
- package/dist/lib/LanguageRegistry-CcVnbKuh.js +2 -0
- package/dist/lib/LanguageRegistry-CcVnbKuh.js.map +1 -0
- package/dist/lib/LayoutSerialization-ySzY1h2l.js +2 -0
- package/dist/lib/{LayoutSerialization-D5bBas4W.js.map → LayoutSerialization-ySzY1h2l.js.map} +1 -1
- package/dist/lib/LayoutSizes-DKDK1Cle.js +2 -0
- package/dist/lib/LayoutSizes-DKDK1Cle.js.map +1 -0
- package/dist/lib/List-BPd-IXZR.js +2 -0
- package/dist/lib/{List-CG4NvwuV.js.map → List-BPd-IXZR.js.map} +1 -1
- package/dist/lib/MemoryStore-BgP7-Uzn.js +2 -0
- package/dist/lib/{MemoryStore-DT6iWWco.js.map → MemoryStore-BgP7-Uzn.js.map} +1 -1
- package/dist/lib/Menu-C0roOCY7.js +2 -0
- package/dist/lib/Menu-C0roOCY7.js.map +1 -0
- package/dist/lib/{MenuButton-wy_0RskC.js → MenuButton-BR4KOFld.js} +2 -2
- package/dist/lib/{MenuButton-wy_0RskC.js.map → MenuButton-BR4KOFld.js.map} +1 -1
- package/dist/lib/Panel-CpNQTLNF.js +2 -0
- package/dist/lib/{Panel-Rd9zkNXx.js.map → Panel-CpNQTLNF.js.map} +1 -1
- package/dist/lib/{Position-Ck_KD4cR.js → Position-PBVBW1JS.js} +2 -2
- package/dist/lib/{Position-Ck_KD4cR.js.map → Position-PBVBW1JS.js.map} +1 -1
- package/dist/lib/{ProgressSpinner-yt-VXyCb.js → ProgressSpinner-lAsK26C-.js} +2 -2
- package/dist/lib/{ProgressSpinner-yt-VXyCb.js.map → ProgressSpinner-lAsK26C-.js.map} +1 -1
- package/dist/lib/RadioButton-CCcIaL54.js +2 -0
- package/dist/lib/RadioButton-CCcIaL54.js.map +1 -0
- package/dist/lib/{RovingTabIndex-DFJyoveq.js → RovingTabIndex-C2Vzq0IX.js} +2 -2
- package/dist/lib/{RovingTabIndex-DFJyoveq.js.map → RovingTabIndex-C2Vzq0IX.js.map} +1 -1
- package/dist/lib/Scrollbar-C3ZZyZ1e.js +2 -0
- package/dist/lib/Scrollbar-C3ZZyZ1e.js.map +1 -0
- package/dist/lib/Slider-DZ9drUxn.js +2 -0
- package/dist/lib/Slider-DZ9drUxn.js.map +1 -0
- package/dist/lib/{Spacer-qalSEJ5i.js → Spacer-SDhOMp2g.js} +2 -2
- package/dist/lib/{Spacer-qalSEJ5i.js.map → Spacer-SDhOMp2g.js.map} +1 -1
- package/dist/lib/TabButton-DNo4ZgV8.js +2 -0
- package/dist/lib/TabButton-DNo4ZgV8.js.map +1 -0
- package/dist/lib/Text-CdHf3B-1.js +2 -0
- package/dist/lib/Text-CdHf3B-1.js.map +1 -0
- package/dist/lib/{Tooltip-Dro4DOZs.js → Tooltip-B_UF5bXD.js} +2 -2
- package/dist/lib/{Tooltip-Dro4DOZs.js.map → Tooltip-B_UF5bXD.js.map} +1 -1
- package/dist/lib/Tree-C7qLbIYH.js +2 -0
- package/dist/lib/Tree-C7qLbIYH.js.map +1 -0
- package/dist/lib/VBox-32fxpkDl.js +2 -0
- package/dist/lib/VBox-32fxpkDl.js.map +1 -0
- package/dist/lib/{Validator-Du8PqS5i.js → Validator-Cjs1EU5Q.js} +2 -2
- package/dist/lib/{Validator-Du8PqS5i.js.map → Validator-Cjs1EU5Q.js.map} +1 -1
- package/dist/lib/{VirtualScroller-Bv4KXGKW.js → VirtualScroller-cvFNMS7U.js} +2 -2
- package/dist/lib/{VirtualScroller-Bv4KXGKW.js.map → VirtualScroller-cvFNMS7U.js.map} +1 -1
- package/dist/lib/component/button.es.js +1 -1
- package/dist/lib/component/chart.es.js +1 -1
- package/dist/lib/component/chart.es.js.map +1 -1
- package/dist/lib/component/container.es.js +1 -1
- package/dist/lib/component/container.es.js.map +1 -1
- package/dist/lib/component/diagram.es.js +1 -1
- package/dist/lib/component/diagram.es.js.map +1 -1
- package/dist/lib/component/display.es.js +1 -1
- package/dist/lib/component/display.es.js.map +1 -1
- package/dist/lib/component/editor.es.js +3 -3
- package/dist/lib/component/editor.es.js.map +1 -1
- package/dist/lib/component/input.es.js +1 -1
- package/dist/lib/component/input.es.js.map +1 -1
- package/dist/lib/component/list.es.js +1 -1
- package/dist/lib/component/list.es.js.map +1 -1
- package/dist/lib/component/menubar.es.js +1 -1
- package/dist/lib/component/menubar.es.js.map +1 -1
- package/dist/lib/component/table.es.js +2 -2
- package/dist/lib/component/table.es.js.map +1 -1
- package/dist/lib/component/tree.es.js +1 -1
- package/dist/lib/component/tree.es.js.map +1 -1
- package/dist/lib/core.es.js +1 -1
- package/dist/lib/core.es.js.map +1 -1
- package/dist/lib/data.es.js +1 -1
- package/dist/lib/glyphs/solid/index.es.js +1 -1
- package/dist/lib/languages-Dl8qdL8a.js +2 -0
- package/dist/lib/languages-Dl8qdL8a.js.map +1 -0
- package/dist/lib/layout.es.js +1 -1
- package/dist/lib/layout.es.js.map +1 -1
- package/dist/lib/overlay.es.js +1 -1
- package/dist/lib/overlay.es.js.map +1 -1
- package/dist/lib/primitive.es.js +1 -1
- package/dist/lib/router.es.js +1 -1
- package/dist/lib/router.es.js.map +1 -1
- package/dist/lib/selectionsEqual-BrTxPMmK.js +2 -0
- package/dist/lib/{selectionsEqual-Ci3_uflt.js.map → selectionsEqual-BrTxPMmK.js.map} +1 -1
- package/dist/lib/types/component/button/TabButton.d.ts +1 -1
- package/dist/lib/types/component/button/ToggleButton.d.ts +1 -1
- package/dist/lib/types/component/chart/ChartLegend.d.ts +1 -1
- package/dist/lib/types/component/container/FloatingPanel.d.ts +23 -0
- package/dist/lib/types/component/container/ScrollStrip.d.ts +1 -1
- package/dist/lib/types/component/container/Scrollbar.d.ts +1 -3
- package/dist/lib/types/component/container/TabBar.d.ts +1 -1
- package/dist/lib/types/component/container/index.d.ts +2 -0
- package/dist/lib/types/component/diagram/DiagramGroupNode.d.ts +1 -1
- package/dist/lib/types/component/display/Markdown.d.ts +42 -1
- package/dist/lib/types/component/display/MarkdownMinimap.d.ts +38 -0
- package/dist/lib/types/component/display/MarkdownViewer.d.ts +60 -0
- package/dist/lib/types/component/display/index.d.ts +6 -0
- package/dist/lib/types/component/editor/CodeEditor.d.ts +13 -0
- package/dist/lib/types/component/editor/index.d.ts +1 -1
- package/dist/lib/types/component/input/Checkbox.d.ts +1 -1
- package/dist/lib/types/component/input/RadioButton.d.ts +1 -1
- package/dist/lib/types/component/input/Slider.d.ts +1 -1
- package/dist/lib/types/component/input/Text.d.ts +0 -2
- package/dist/lib/types/component/input/Toggle.d.ts +1 -1
- package/dist/lib/types/component/menubar/MenuBar.d.ts +1 -1
- package/dist/lib/types/component/menubar/ToolBar.d.ts +1 -0
- package/dist/lib/types/component/table/Body.d.ts +1 -0
- package/dist/lib/types/component/table/cell/SortPriorityBadge.d.ts +1 -1
- package/dist/lib/types/component/table/cell/editor/CellEditorPool.d.ts +1 -0
- package/dist/lib/types/component/table/cell/editor/Date.d.ts +1 -0
- package/dist/lib/types/component/table/cell/editor/DateTime.d.ts +1 -0
- package/dist/lib/types/component/table/cell/editor/Time.d.ts +1 -0
- package/dist/lib/types/component/tree/Tree.d.ts +9 -1
- package/dist/lib/types/component/tree/index.d.ts +1 -1
- package/dist/lib/types/component/tree/renderer/Label.d.ts +1 -1
- package/dist/lib/types/core/Component.d.ts +5 -0
- package/dist/lib/types/core/Theme.d.ts +4 -2
- package/dist/lib/types/layout/LayoutManager.d.ts +8 -0
- package/dist/lib/validation.es.js +1 -1
- package/llms.txt +3 -0
- package/package.json +15 -15
- package/dist/lib/AnchorConstraints-DdDYSDkf.js +0 -2
- package/dist/lib/AnchorConstraints-DdDYSDkf.js.map +0 -1
- package/dist/lib/Border-CKKUk5G9.js +0 -2
- package/dist/lib/Button-MZDYJOMC.js +0 -2
- package/dist/lib/Button-MZDYJOMC.js.map +0 -1
- package/dist/lib/ComboBox-C04SfXAR.js +0 -2
- package/dist/lib/ComboBox-C04SfXAR.js.map +0 -1
- package/dist/lib/Component-fRQvgaEY.js +0 -2
- package/dist/lib/Component-fRQvgaEY.js.map +0 -1
- package/dist/lib/Container-0bsG2Q8Z.js +0 -2
- package/dist/lib/DOM-67StIm5G.js +0 -2
- package/dist/lib/DragManager-DRor_-1x.js +0 -2
- package/dist/lib/LayoutSerialization-D5bBas4W.js +0 -2
- package/dist/lib/LayoutSizes-qNaURyiw.js +0 -2
- package/dist/lib/LayoutSizes-qNaURyiw.js.map +0 -1
- package/dist/lib/List-CG4NvwuV.js +0 -2
- package/dist/lib/MemoryStore-DT6iWWco.js +0 -2
- package/dist/lib/Menu-CrZy2u0g.js +0 -2
- package/dist/lib/Menu-CrZy2u0g.js.map +0 -1
- package/dist/lib/Panel-Rd9zkNXx.js +0 -2
- package/dist/lib/RadioButton-D23rId-V.js +0 -2
- package/dist/lib/RadioButton-D23rId-V.js.map +0 -1
- package/dist/lib/Scrollbar-SOj9psiP.js +0 -2
- package/dist/lib/Scrollbar-SOj9psiP.js.map +0 -1
- package/dist/lib/Slider-DBnAZ-F7.js +0 -2
- package/dist/lib/Slider-DBnAZ-F7.js.map +0 -1
- package/dist/lib/TabButton-DKECTTk1.js +0 -2
- package/dist/lib/TabButton-DKECTTk1.js.map +0 -1
- package/dist/lib/Text-KB5LksJl.js +0 -2
- package/dist/lib/Text-KB5LksJl.js.map +0 -1
- package/dist/lib/VBox-P3WFGkPc.js +0 -2
- package/dist/lib/VBox-P3WFGkPc.js.map +0 -1
- package/dist/lib/selectionsEqual-Ci3_uflt.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"./DOM-Ba8YRVel.js";import{n as t}from"./Position-PBVBW1JS.js";import{S as n,b as r,h as i,l as a,n as o,t as s}from"./Component-w65rPK75.js";import{t as c}from"./ListenerBag-WPdKuuds.js";import{t as l}from"./Panel-CpNQTLNF.js";import{t as u}from"./Tooltip-B_UF5bXD.js";import{t as d}from"./Fit-Cg3dPyZg.js";import{t as f}from"./Text-CdHf3B-1.js";import{t as p}from"./AbstractInput-B10DfLOf.js";import{t as m}from"./VBox-32fxpkDl.js";var ListItemRenderer=class extends s{constructor(){super()}getContentWidth(){return 0}},LabelListItemRenderer=class extends ListItemRenderer{_label;_measured=!1;constructor(){super(),this.clearInsets(),this._label=new f,this._label.clearInsets(),this._label.setAutoMeasure(!1)}getLabel(){return this._label}update(e){this._label.setText(e.item.label),this._measured=!1}getContentWidth(){return this._measured||=(this._label.measure(),!0),this._label.getPreferredSize()?.width??0}layoutChildren(e,t){let n=this.getContentBounds()??{x:0,y:0,width:e,height:t};this._label.setAutoCommitStyle(!1),this._label.setX(n.x),this._label.setY(n.y),this._label.setWidth(n.width),this._label.setHeight(n.height),this._label.setLineHeight(n.height),this._label.setAutoCommitStyle(!0)}init(t){super.init(t);let n=t||this.getElement();return n&&e.sink.appendChild(n,this._label.getElement(!0)),this}},h=i(LabelListItemRenderer),g=22,_=8,v=700,y={tag:`div`,backgroundColor:`var(--ts-ui-list-bg, rgb(255, 255, 255))`,foregroundColor:`var(--ts-ui-text-color, black)`,border:`1px solid var(--ts-ui-list-border, rgb(200, 200, 200))`,borderRadius:`var(--ts-ui-border-radius, 4px)`,preferredSize:{width:200,height:200},maxSize:{width:2**53-1,height:2**53-1}};new r({scope:`selector`,name:`.List, .MultiSelectList`,styles:{userSelect:`none`,outline:`none`}}),new r({scope:`selector`,name:`.List:focus::after, .MultiSelectList:focus::after`,styles:{content:`''`,position:`absolute`,inset:`0`,border:`2px solid var(--ts-ui-indicator-focus, rgb(30, 100, 200))`,borderRadius:`inherit`,boxSizing:`border-box`,pointerEvents:`none`,zIndex:`1`}}),new r({scope:`class`,name:`SelectableListRow`,styles:{lineHeight:`22px`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,cursor:`pointer`}}),new r({scope:`selector`,name:`.SelectableListRow:hover`,styles:{backgroundColor:`var(--ts-ui-list-row-hover-bg, rgba(30, 100, 200, 0.08))`}}),new r({scope:`selector`,name:`.SelectableListRow.selected`,styles:{backgroundColor:`var(--ts-ui-list-row-selected-bg, rgba(30, 100, 200, 0.18))`,color:`var(--ts-ui-list-row-selected-color, inherit)`}}),new r({scope:`selector`,name:`.SelectableListRow.focused`,styles:{outline:`var(--ts-ui-indicator-selection, 1px dashed rgb(120, 170, 240))`}});var SelectableListRow=class extends s{_selected=!1;_focused=!1;_index;_handlers;_tooltipAttached=!1;_renderer;constructor(e,r,i){super({tag:`div`}),this._handlers=e,this._index=r,this._renderer=i(),this._renderer.setPointerEvents(`none`),this.getAria().setRole(`option`),this.setPreferredSize({width:0,height:g}),this.setPadding(new t(0,_,0,_)),this.setBorder({borderBottom:`1px solid var(--ts-ui-list-row-separator, transparent)`}),this.setCursor(`pointer`),n.addListener(this,`pointerdown`,this.onPointerDown),n.addListener(this,`click`,this.onClick),n.addListener(this,`contextmenu`,this.onContextMenu),n.addListener(this,`dblclick`,this.onDblClick)}updateItem(e,t){return this._renderer.update({item:e,index:t}),this.applyTooltip(e.tooltip),this}applyTooltip(e){e?(u.attach(this,e),this._tooltipAttached=!0):this._tooltipAttached&&=(u.detach(this),!1)}getNaturalWidth(){return this._renderer.getContentWidth()+16}setRenderer(t){let n=this.getElement();if(n){let t=this._renderer.getElement();t&&e.source.getParentNode(t)===n&&e.sink.removeChild(n,t)}return this._renderer=t,this._renderer.setPointerEvents(`none`),n&&e.sink.appendChild(n,this._renderer.getElement(!0)),this}setIndex(e){return this._index=e,this}getIndex(){return this._index}setSelected(e){return this._selected=e,this.getAria().setSelected(e),this.applyRowClass(),this}isSelected(){return this._selected}setFocused(e){return this._focused=e,this.applyRowClass(),this}isFocused(){return this._focused}render(){let e=super.render();return this.applyRowClass(),e}init(t){super.init(t);let n=t||this.getElement();return n&&e.sink.appendChild(n,this._renderer.getElement(!0)),this}doLayout(){super.doLayout();let e=this.getContentBounds();return e?(this._renderer.setAutoCommitStyle(!1),this._renderer.setX(e.x),this._renderer.setY(e.y),this._renderer.setWidth(e.width),this._renderer.setHeight(e.height),this._renderer.setAutoCommitStyle(!0),this._renderer.layoutChildren(e.width,e.height),this):this}applyRowClass(){let e=[o,`SelectableListRow`];this._selected&&e.push(`selected`),this._focused&&e.push(`focused`),this.setElementAttribute(`class`,e.join(` `))}onPointerDown(e){e.preventDefault()}onClick(e){this._handlers.onClick(this._index,e)}onContextMenu(e){this._handlers.onContextMenu(this._index,e)}onDblClick(e){this._handlers.onDblClick(this._index,e)}},ListRowColumn=class extends m{computeTotalMinSize(){let e=super.computeTotalMinSize(),t=this.getContainer();if(!t||!this.isOverflowingX())return e;let n=0;for(let e of t.getLaidOutComponents())e instanceof SelectableListRow&&(n=Math.max(n,e.getNaturalWidth()));return{width:Math.max(e.width,n),height:e.height}}},AbstractSelectableList=class extends p{_items=[];_rowPool=[];_selectedSet=new Set;_anchorIndex=null;_focusedIndex=-1;_typeAheadBuf=``;_typeAheadAt=0;_focusOnRowClick=!0;_selectFollowsFocus=!0;_horizontalScrolling=!1;_innerPanel;_emptyPlaceholder=null;_placeholderAttached=!1;_storeRefresh=null;_rendererFactory=()=>new h;_rowListeners=new c;constructor(e,r){super(e,{...y,layoutManager:new d,...r??{}}),this.getAria().setRole(`listbox`),this.getAria().setTabIndex(0),this._innerPanel=new l({layoutManager:new ListRowColumn({spacing:0,stretching:!0}),autoScroll:`y`,insets:new t(0,0,0,0)}),this.addComponent(this._innerPanel),this._options.minSize===void 0&&this.setMinSize({width:100,height:100}),n.addListener(this,`keydown`,this.handleKeyDown),this._options.rendererFactory!==void 0&&this.setRendererFactory(this._options.rendererFactory),this._options.horizontalScrolling!==void 0&&this.setHorizontalScrolling(this._options.horizontalScrolling),this._options.store!==void 0&&this._options.displayField!==void 0&&this.setStore(this._options.store,this._options.displayField,this._options.valueField,this._options.glyphField,this._options.tooltipField),this._options.items!==void 0&&this.setItems(this._options.items),this._options.enabled!==void 0&&this.applyEnabled(this._options.enabled),this._options.readOnly!==void 0&&this.applyReadOnly(this._options.readOnly),(this._options.emptyText!==void 0||this._options.emptyComponent!==void 0)&&this.syncEmptyPlaceholder()}applyEnabled(e){this.getAria().setDisabled(!e),this.getAria().setTabIndex(e?0:-1),this.setCursor(e?`default`:`not-allowed`),e||(this._focusedIndex=-1,this.refreshRowVisualState(),this.updateActiveDescendant())}applyReadOnly(e){this.getAria().setReadOnly(e)}applyOptions(e){return super.applyOptions(e),e.items!==void 0&&(this._options.items=e.items),e.store!==void 0&&(this._options.store=e.store),e.displayField!==void 0&&(this._options.displayField=e.displayField),e.valueField!==void 0&&(this._options.valueField=e.valueField),e.glyphField!==void 0&&(this._options.glyphField=e.glyphField),e.tooltipField!==void 0&&(this._options.tooltipField=e.tooltipField),e.rendererFactory!==void 0&&(this._options.rendererFactory=e.rendererFactory),e.emptyText!==void 0&&(this._options.emptyText=e.emptyText),e.emptyComponent!==void 0&&(this._options.emptyComponent=e.emptyComponent),e.horizontalScrolling!==void 0&&(this._options.horizontalScrolling=e.horizontalScrolling),this}setHorizontalScrolling(e){return this._horizontalScrolling===e?this:(this._horizontalScrolling=e,this._innerPanel.setAutoScroll(e?`auto`:`y`),this.scheduleLayout(),this)}isHorizontalScrolling(){return this._horizontalScrolling}setEmptyText(e){return this._options.emptyText=e??void 0,this.resetEmptyPlaceholder(),this.syncEmptyPlaceholder(),this}getEmptyText(){return this._options.emptyText??null}setEmptyComponent(e){return this._options.emptyComponent=e??void 0,this.resetEmptyPlaceholder(),this.syncEmptyPlaceholder(),this}getEmptyComponent(){return this._options.emptyComponent??null}syncEmptyPlaceholder(){(this._options.emptyComponent!==void 0||this._options.emptyText!==void 0)&&this._items.length===0?(this._emptyPlaceholder||=this.buildEmptyPlaceholder(),this._placeholderAttached||=(this._innerPanel.addComponent(this._emptyPlaceholder,{weight:1}),!0)):this._placeholderAttached&&this._emptyPlaceholder&&(this._innerPanel.removeComponent(this._emptyPlaceholder),this._placeholderAttached=!1)}buildEmptyPlaceholder(){let e=this._options.emptyComponent;if(e)return e();let t=new f(this._options.emptyText??``,{textAlign:`center`});return t.setForegroundColor(`var(--ts-ui-list-row-disabled-color, rgb(170, 170, 170))`),t}resetEmptyPlaceholder(){this._placeholderAttached&&this._emptyPlaceholder&&(this._innerPanel.removeComponent(this._emptyPlaceholder),this._placeholderAttached=!1),this._emptyPlaceholder=null}getBaseline(){return null}getItems(){return this._items.slice()}setItems(e){a.isArray(e)||(e=[e]);let t=e,n=[];for(let e of t)n.push(typeof e==`string`?{key:e,label:e}:{key:e.key,label:e.label,glyph:e.glyph,tooltip:e.tooltip});return this.setItemsArray(n)}setItemsArray(e){return this._items=e.slice(),this._selectedSet.clear(),this._anchorIndex=null,this._focusedIndex=-1,this.pauseLayout(),this.syncRows(),this.resumeLayout(),this.updateActiveDescendant(),this}addItem(e){return this._items.push(typeof e==`string`?{key:e,label:e}:{key:e.key,label:e.label,glyph:e.glyph,tooltip:e.tooltip}),this.pauseLayout(),this.syncRows(),this.resumeLayout(),this}setStore(e,t,n,r,i){let a=this._options.store;this._storeRefresh&&a&&[`load`,`add`,`remove`,`datachange`,`sync`].forEach(e=>a.off(e,this._storeRefresh)),this._options.store=e,this._options.displayField=t,this._options.valueField=n,this._options.glyphField=r,this._options.tooltipField=i;let refresh=()=>this.refreshFromStore();return this._storeRefresh=refresh,e.on(`load`,refresh),e.on(`add`,refresh),e.on(`remove`,refresh),e.on(`datachange`,refresh),e.on(`sync`,refresh),this.refreshFromStore(),this}getStore(){return this._options.store??null}setRendererFactory(e){this._rendererFactory=e;for(let t of this._rowPool)t.setRenderer(e());return this.pauseLayout(),this.syncRows(),this.resumeLayout(),this}getRendererFactory(){return this._rendererFactory}getSelectedRecord(){let e=this._options.store;if(!e)return;let t=this.getSelectedIndex();if(!(t<0))return e.getRecords()[t]}getSelectedIndex(){return this._anchorIndex!==null&&this._selectedSet.has(this._anchorIndex)?this._anchorIndex:this._selectedSet.size===0?-1:Math.min(...this._selectedSet)}setSelectedIndex(e,t=!0){return this._selectedSet.clear(),e>=0&&e<this._items.length?(this._selectedSet.add(e),this._anchorIndex=e,this._focusedIndex=e):(this._anchorIndex=null,this._focusedIndex=-1),this.refreshRowVisualState(),this.updateActiveDescendant(),t&&this.fireChange(),this}on(e,t){return e===`action`?(n.addListener(this,`change`,t),this):e===`contextmenu`||e===`dblclick`?(this._rowListeners.add(e,t),this):super.on(e,t)}off(e,t){return e===`action`?(n.removeListener(this,`change`,t),this):e===`contextmenu`||e===`dblclick`?(this._rowListeners.remove(e,t),this):super.off(e,t)}refreshFromStore(){let e=this._options.store,t=this._options.displayField,n=this._options.valueField,r=this._options.glyphField,i=this._options.tooltipField;if(!e||!t)return;let a=this._anchorIndex!==null&&this._items[this._anchorIndex]?this._items[this._anchorIndex].key:null;this._items=[],this._selectedSet.clear(),this._anchorIndex=null;let o=e.getRecords(),s=-1;for(let e=0;e<o.length;e++){let c=o[e],l=String(c.get(t)),u=String(n?c.get(n):c.getId()),d=r?String(c.get(r)):void 0,f=i?String(c.get(i)):void 0;this._items.push({key:u,label:l,glyph:d,tooltip:f}),a!==null&&u===a&&(s=e)}s>=0?(this._selectedSet.add(s),this._anchorIndex=s,this._focusedIndex=s):this._focusedIndex=this._items.length>0?0:-1,this.pauseLayout(),this.syncRows(),this.resumeLayout(),this.updateActiveDescendant()}syncRows(){let e=this._items.length,t=this._rowPool.length,n=Math.min(e,t);for(let e=0;e<n;e++){let t=this._rowPool[e];t.updateItem(this._items[e],e),t.setIndex(e),t.setSelected(this._selectedSet.has(e)),t.setFocused(e===this._focusedIndex)}if(e>t)for(let n=t;n<e;n++){let e=new SelectableListRow({onClick:(e,t)=>this.handleRowClick(e,t),onContextMenu:(e,t)=>this.handleRowContextMenu(e,t),onDblClick:(e,t)=>this.handleRowDblClick(e,t)},n,this._rendererFactory);e.updateItem(this._items[n],n),e.setSelected(this._selectedSet.has(n)),e.setFocused(n===this._focusedIndex),this._innerPanel.addComponent(e),this._rowPool.push(e)}else if(e<t){for(let n=e;n<t;n++)u.detach(this._rowPool[n]),this._innerPanel.removeComponent(this._rowPool[n]);this._rowPool.splice(e)}this.syncEmptyPlaceholder()}refreshRowVisualState(){for(let e=0;e<this._rowPool.length;e++){let t=this._rowPool[e];t.setSelected(this._selectedSet.has(e)),t.setFocused(e===this._focusedIndex)}}updateActiveDescendant(){if(this._focusedIndex<0||this._focusedIndex>=this._rowPool.length){this.getAria().setActiveDescendant(``);return}this.getAria().setActiveDescendant(this._rowPool[this._focusedIndex].getId())}fireChange(){this.getElement()&&n.fireEvent(this,`change`),this.notifyChange(this.getValue())}handleRowClick(e,t){!this.isEnabled()||this.isReadOnly()||e<0||e>=this._items.length||(this.reduceSelection(e,{ctrl:t.ctrlKey||t.metaKey,shift:t.shiftKey}),this.refreshRowVisualState(),this.updateActiveDescendant(),this._focusOnRowClick&&this.focus(),this.notifyUserChange())}handleRowContextMenu(e,t){e<0||e>=this._items.length||(t.preventDefault(),this._rowListeners.fire(`contextmenu`,e,t))}handleRowDblClick(e,t){e<0||e>=this._items.length||this._rowListeners.fire(`dblclick`,e,t)}setFocusOnRowClick(e){return this._focusOnRowClick=e,this}setSelectFollowsFocus(e){return this._selectFollowsFocus=e,this}getFocusedIndex(){return this._focusedIndex}getFocusedRowId(){return this._focusedIndex<0||this._focusedIndex>=this._rowPool.length?null:this._rowPool[this._focusedIndex].getId()}handleKey(e){if(!this.isEnabled()||this.isReadOnly()||this._items.length===0||e.key===`Escape`)return!1;let t=e.ctrlKey||e.metaKey;return this.handleNavigationKey(e,t)?!0:e.key===`Enter`||e.key===` `?(e.preventDefault(),this.commitFocusedRow(t,e.shiftKey),!0):!t&&!e.altKey&&e.key.length===1&&(this.handleTypeAhead(e.key),!0)}handleKeyDown(e){if(!this.isEnabled()||this.isReadOnly()||this._items.length===0)return;let t=e.ctrlKey||e.metaKey;if(e.key===`Escape`){this._typeAheadBuf=``;return}if(!this.handleNavigationKey(e,t)){if(e.key===`Enter`||e.key===` `){e.preventDefault(),this.commitFocusedRow(t,e.shiftKey);return}!t&&!e.altKey&&e.key.length===1&&this.handleTypeAhead(e.key)}}handleNavigationKey(e,t){if(!new Set([`ArrowDown`,`ArrowUp`,`Home`,`End`,`PageDown`,`PageUp`]).has(e.key))return!1;e.preventDefault();let n=this.getHeight()||g,r=Math.max(1,Math.floor(n/g)),i=this._focusedIndex<0?0:this._focusedIndex,a;return a=e.key===`ArrowDown`?Math.min(i+1,this._items.length-1):e.key===`ArrowUp`?Math.max(i-1,0):e.key===`PageDown`?Math.min(i+r,this._items.length-1):e.key===`PageUp`?Math.max(i-r,0):e.key===`Home`?0:this._items.length-1,this.moveFocus(a,t,e.shiftKey),!0}moveFocus(e,t,n){this._focusedIndex=e;let r=!t&&this._selectFollowsFocus;r&&this.reduceSelection(e,{ctrl:!1,shift:n}),this.refreshRowVisualState(),this.updateActiveDescendant(),this.scrollIndexIntoView(e),r&&this.notifyUserChange()}commitFocusedRow(e,t){this._focusedIndex<0||(this.reduceSelection(this._focusedIndex,{ctrl:e,shift:t}),this.refreshRowVisualState(),this.updateActiveDescendant(),this.notifyUserChange())}handleTypeAhead(e){let t=Date.now();t-this._typeAheadAt>v&&(this._typeAheadBuf=``),this._typeAheadBuf+=e.toLowerCase(),this._typeAheadAt=t;let n=this._typeAheadBuf,r=this._items.findIndex(e=>e.label.toLowerCase().startsWith(n));r<0||(this._focusedIndex=r,this.refreshRowVisualState(),this.updateActiveDescendant(),this.scrollIndexIntoView(r))}scrollIndexIntoView(t){if(t<0||t>=this._items.length)return;let n=this._innerPanel.getElement();if(!n)return;let r=e.source.getScrollMetrics(n),i=t*g,a=i+g,o=r.scrollTop,s=o+r.clientHeight;i<o?e.sink.apply(n,{scrollTop:i}):a>s&&e.sink.apply(n,{scrollTop:a-r.clientHeight})}},List=class extends AbstractSelectableList{constructor(e){super(e),this._options.selectedIndex!==void 0&&this.setSelectedIndex(this._options.selectedIndex,!1),this._options.value!==void 0&&this.setValue(this._options.value),this._options.selectedItem!==void 0&&this.setValue(this._options.selectedItem)}applyOptions(e){return super.applyOptions(e),e.selectedIndex!==void 0&&(this._options.selectedIndex=e.selectedIndex),e.value!==void 0&&(this._options.value=e.value),e.selectedItem!==void 0&&(this._options.selectedItem=e.selectedItem),this}setItemsArray(e){return super.setItemsArray(e)}setValue(e){let t=this._items.findIndex(t=>t.key===e);return this.setSelectedIndex(t,!1),this}getValue(){let e=this.getSelectedIndex();return e<0||e>=this._items.length?``:this._items[e].key}reduceSelection(e,t){this._selectedSet.clear(),this._selectedSet.add(e),this._anchorIndex=e,this._focusedIndex=e}notifyUserChange(){this.fireChange()}},b=i(List);export{ListItemRenderer as i,AbstractSelectableList as n,h as r,b as t};
|
|
2
|
+
//# sourceMappingURL=List-BPd-IXZR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List-CG4NvwuV.js","names":[],"sources":["../../src/typescript/lib/component/list/ListItemRenderer.ts","../../src/typescript/lib/component/list/renderer/Label.ts","../../src/typescript/lib/component/list/AbstractSelectableList.ts","../../src/typescript/lib/component/list/List.ts"],"sourcesContent":["// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { Component } from \"~/core/Component.js\";\nimport { ListItemRenderContext } from \"~/component/list/ListItemRenderContext.js\";\n\n/**\n * Abstract base class for list item renderers.\n *\n * @remarks\n * A `ListItemRenderer` owns the content of a single list row — the label, and\n * optionally an icon or other affordance. The owning\n * [`List`](/api/component/list/classes/List) /\n * [`MultiSelectList`](/api/component/list/classes/MultiSelectList) holds a\n * renderer factory; each pooled row calls that factory once at construction and\n * rebinds via {@link update} when the row is remapped to a different item. The\n * collapsed [`ComboBox`](/api/component/input/classes/ComboBox) control hosts\n * one renderer built from the same factory, so the selected entry renders on\n * the closed control exactly as it does in the open dropdown.\n *\n * Selection / focus / hover chrome is applied by the list on the row element\n * directly and never reaches the renderer.\n *\n * Subclasses implement {@link update} and {@link layoutChildren}. See\n * [`LabelListItemRenderer`](/api/component/list/classes/LabelListItemRenderer)\n * for the canonical default. {@link getContentWidth} is optional: it is read\n * only by a list running with `horizontalScrolling` on, and the base\n * implementation already reports \"no intrinsic width\".\n *\n * Not wrapped with `callable()` — abstract classes are never instantiated.\n *\n * @category Components\n */\nexport abstract class ListItemRenderer extends Component {\n\n constructor() {\n super();\n }\n\n /**\n * Rebinds this renderer to new item data.\n *\n * @param context - The bound-item state for this render pass.\n *\n * @remarks Called every time the owning row (or collapsed control) is\n * mapped to a different item.\n */\n abstract update(context: ListItemRenderContext): void;\n\n /**\n * Returns the natural width of the currently bound content — the width at\n * which it renders without clipping.\n *\n * Read only by a list running with\n * [`horizontalScrolling`](/api/component/list/classes/List#sethorizontalscrolling)\n * on, which sizes every row to the widest value across the bound items so\n * over-long content scrolls into view instead of ellipsising. A list with\n * horizontal scrolling off — the default — never calls this, so a renderer\n * that measures lazily pays nothing for it.\n *\n * The base implementation returns 0, meaning \"no intrinsic width\": rows\n * stay at the viewport width and never extend the horizontal scroll extent.\n * That keeps a custom renderer written against the previous contract\n * working unchanged; override it to opt that renderer into horizontal\n * scrolling.\n *\n * @returns The bound content's natural width in pixels, or 0 when unknown.\n */\n getContentWidth(): number {\n return 0;\n }\n\n /**\n * Positions this renderer's internal children inside its content box.\n *\n * @param width - The horizontal extent of the renderer in pixels.\n * @param height - The vertical extent of the renderer in pixels.\n *\n * @remarks Called by the owning row after the renderer's own size has been\n * set via `setX` / `setY` / `setWidth` / `setHeight`.\n *\n * The `width` and `height` arguments are this renderer's **outer** box, so\n * an implementation must not place children against them directly: take the\n * rectangle from [`getContentBounds()`](/api/core/classes/Component), which\n * subtracts any border and padding the renderer carries, and fall back to\n * the arguments only when it returns `null` (no element yet). A child's\n * containing block is already this renderer's padding box, so one placed\n * at `(0, 0)` sized to `width` / `height` starts inside the border and\n * overruns the opposite edge by its width, where the `overflow: hidden`\n * every component carries clips it.\n */\n abstract layoutChildren(width: number, height: number): void;\n}\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { DOM } from \"~/core/DOM.js\";\nimport type { Handle } from \"~/core/DOM.js\";\nimport { Text } from \"~/component/input/Text.js\";\nimport { ListItemRenderer } from \"~/component/list/ListItemRenderer.js\";\nimport { ListItemRenderContext } from \"~/component/list/ListItemRenderContext.js\";\nimport { callable } from \"~/core/Callable.js\";\n\n/**\n * The default [`ListItemRenderer`](/api/component/list/classes/ListItemRenderer) —\n * a single [`Text`](/api/component/input/classes/Text) child carrying the\n * item's label.\n *\n * @remarks\n * Used as the implicit factory by [`List`](/api/component/list/classes/List) /\n * [`MultiSelectList`](/api/component/list/classes/MultiSelectList) and the\n * collapsed [`ComboBox`](/api/component/input/classes/ComboBox) control when no\n * custom renderer is set. The label keeps `Text`'s default `truncate: true`, so\n * a label wider than its row clips with an ellipsis — reproducing the row\n * chrome the list carried before renderers existed. The label is sized to fill\n * the row in {@link layoutChildren} rather than to its natural width: the row\n * is never narrower than {@link getContentWidth}, so filling it lets the\n * selection wash span the whole row without clipping the text.\n *\n * @example\n * ```typescript\n * list.setRendererFactory(() => new LabelListItemRenderer());\n * ```\n *\n * @category Components\n */\nclass LabelListItemRenderer extends ListItemRenderer {\n\n private _label: Text;\n /**\n * Whether `_label`'s cached natural width matches the bound text. The label\n * runs with `autoMeasure(false)`, so the measure is driven from\n * {@link getContentWidth} rather than {@link update} — a list with\n * horizontal scrolling off never asks, and so never pays for it.\n */\n private _measured: boolean = false;\n\n /**\n * Constructs a label renderer with an empty text node. The label is\n * populated on the first {@link update} call.\n */\n constructor() {\n super();\n this.clearInsets();\n\n this._label = new Text();\n this._label.clearInsets();\n this._label.setAutoMeasure(false);\n }\n\n /**\n * Returns the underlying label component so consumers can tweak font /\n * colour properties at construction time.\n *\n * @returns The internal [`Text`](/api/component/input/classes/Text) instance.\n */\n getLabel(): Text {\n return this._label;\n }\n\n /**\n * Updates the rendered label text.\n *\n * @param context - The bound-item state for this render pass.\n */\n update(context: ListItemRenderContext): void {\n this._label.setText(context.item.label);\n this._measured = false;\n }\n\n /**\n * Returns the natural width of the bound label, measuring it on first ask\n * after each {@link update}.\n *\n * @returns The label's natural width in pixels.\n */\n getContentWidth(): number {\n if (!this._measured) {\n this._label.measure();\n this._measured = true;\n }\n\n return this._label.getPreferredSize()?.width ?? 0;\n }\n\n /**\n * Sizes the label to fill the renderer's allocated box and centres its\n * line-box vertically by matching `line-height` to the row height.\n *\n * The label goes inside this renderer's content box, so a border or padding\n * on the renderer shrinks it rather than being painted over.\n *\n * @param width - The horizontal extent of the row in pixels. Used only\n * while the renderer has no element yet and the content box is\n * unavailable.\n * @param height - The vertical extent of the row in pixels, used under the\n * same condition as `width`.\n */\n layoutChildren(width: number, height: number): void {\n const box = this.getContentBounds() ?? { x: 0, y: 0, width, height };\n\n this._label.setAutoCommitStyle(false);\n this._label.setX(box.x);\n this._label.setY(box.y);\n this._label.setWidth(box.width);\n this._label.setHeight(box.height);\n this._label.setLineHeight(box.height);\n this._label.setAutoCommitStyle(true);\n }\n\n /**\n * Appends the label sub-component element to the renderer's DOM element.\n *\n * @param element - Optional element passed by the rendering pipeline; falls\n * back to getElement().\n *\n * @returns This renderer, for method chaining.\n */\n protected init(element?: Handle): this {\n super.init(element);\n\n const el = element || this.getElement();\n if (!el) {\n return this;\n }\n\n DOM.sink.appendChild(el, this._label.getElement(true)!);\n\n return this;\n }\n}\n\nconst LabelListItemRendererCallable = callable(LabelListItemRenderer);\ntype LabelListItemRendererCallable = LabelListItemRenderer;\nexport {\n LabelListItemRenderer as _LabelListItemRenderer,\n LabelListItemRendererCallable as LabelListItemRenderer,\n};\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { AbstractInput, AbstractInputOptions } from \"~/component/input/AbstractInput.js\";\nimport { Component } from \"~/core/Component.js\";\nimport { DOM } from \"~/core/DOM.js\";\nimport type { Handle } from \"~/core/DOM.js\";\nimport { Panel } from \"~/core/Panel.js\";\nimport { StyleRule } from \"~/core/StyleTarget.js\";\nimport { Event } from \"~/core/Event.js\";\nimport { ListenerBag } from \"~/core/ListenerBag.js\";\nimport { Tooltip } from \"~/overlay/Tooltip.js\";\nimport { Type } from \"~/core/Type.js\";\nimport { Insets } from \"~/primitive/Insets.js\";\nimport { Fit } from \"~/layout/Fit.js\";\nimport { _VBox } from \"~/layout/VBox.js\";\nimport { Size } from \"~/primitive/Size.js\";\nimport { AbstractStore } from \"~/data/AbstractStore.js\";\nimport { ModelRecord } from \"~/data/ModelRecord.js\";\nimport { ListItemRenderer } from \"~/component/list/ListItemRenderer.js\";\nimport { LabelListItemRenderer } from \"~/component/list/renderer/Label.js\";\nimport { COMPONENT_CLASS } from \"~/core/ClassStyleRules.js\";\nimport { Text } from \"~/component/input/Text.js\";\n\n/**\n * One entry in a [`List`](/api/component/list/classes/List) /\n * [`MultiSelectList`](/api/component/list/classes/MultiSelectList) item\n * array. Plain data — the row pool is the view layer.\n *\n * @category Components\n */\nexport interface SelectableListItem {\n /** Binding identifier — what `getValue` / `setValue` round-trip. */\n key: string;\n /** Display text rendered in the row. */\n label: string;\n /**\n * Optional registry glyph name, read by\n * [`GlyphListItemRenderer`](/api/component/list/classes/GlyphListItemRenderer)\n * to paint an icon beside the label. Ignored by the default label\n * renderer. Array-supplied items carry it directly; store-bound items\n * resolve it from the record field named by the list's `glyphField`.\n */\n glyph?: string;\n /**\n * Optional hover-tooltip text for the row, shown after the standard hover\n * delay via [`Tooltip`](/api/overlay/classes/Tooltip). Lets a host surface\n * the full value behind a truncated label without reaching into the row DOM.\n * Array-supplied items carry it directly; store-bound items resolve it from\n * the record field named by the list's `tooltipField`.\n */\n tooltip?: string;\n}\n\n/**\n * Accepted form for a single item passed to a custom list's `setItems` /\n * `addItem`: either a plain string (which becomes both the item's key and its\n * label, so a selection is written and read back as the string itself) or a\n * pre-formed {@link SelectableListItem} with an explicit caller-supplied key.\n *\n * @category Components\n */\nexport type SelectableListItemSpec = String | SelectableListItem;\n\n/**\n * Pixel height of one rendered row. Matches `SelectableListRow`'s cached\n * `preferredSize(0, 22)` and the `lineHeight: 22px` declaration in the\n * shared `.SelectableListRow` class rule. Keep these three values in lockstep\n * if the row chrome changes — keyboard `PageUp`/`PageDown` derives its\n * page size from this constant divided into the visible viewport height.\n */\nconst ROW_HEIGHT_PX = 22;\n\n/**\n * Horizontal padding on each side of a row, between the row edge and its\n * renderer. Read by {@link SelectableListRow.publishContentWidth} to convert a\n * renderer's content width into the row's own natural width, so keep it in step\n * with the row's `setPadding` call.\n */\nconst ROW_PADDING_X_PX = 8;\n\n/**\n * Maximum time (in milliseconds) between successive printable-character\n * keypresses before the type-ahead search buffer resets. Picked to match\n * the native `<select>` type-ahead window the custom list replaces — a\n * burst of letters within this window builds a single search prefix; a\n * pause longer than this starts a fresh search.\n */\nconst TYPE_AHEAD_TIMEOUT_MS = 700;\n\n/**\n * Construction-time options for {@link AbstractSelectableList}.\n *\n * @category Components\n */\nexport interface AbstractSelectableListOptions extends AbstractInputOptions {\n items?: String | Array<String>;\n store?: AbstractStore;\n displayField?: string;\n valueField?: string;\n /**\n * Record field whose value becomes each store-bound item's `glyph`, read\n * by [`GlyphListItemRenderer`](/api/component/list/classes/GlyphListItemRenderer).\n * Array-supplied items carry their glyph on the item instead.\n */\n glyphField?: string;\n /**\n * Record field whose value becomes each store-bound item's `tooltip` (the\n * hover text). Array-supplied items carry their tooltip on the item instead.\n */\n tooltipField?: string;\n /**\n * Zero-argument factory producing the renderer for each row. Defaults to a\n * label renderer reproducing the plain-text rows. Supply\n * `() => new GlyphListItemRenderer()` to paint each item's `glyph` beside\n * its label.\n */\n rendererFactory?: () => ListItemRenderer;\n /**\n * Construction-time listener bag — the declarative form of `on()`. Adds the\n * list's `action` shorthand to the inherited `change` / `binding`.\n */\n listeners?: {\n action?: () => void;\n change?: (value: any) => void;\n binding?: () => void;\n };\n /**\n * Muted placeholder text shown inside the scroll area when the list is\n * empty. Opt-in: with neither `emptyText` nor `emptyComponent` set, an empty\n * list has no placeholder child.\n */\n emptyText?: string;\n /**\n * Factory for a custom empty-state placeholder, shown inside the scroll area\n * when the list is empty. Takes precedence over `emptyText`. The returned\n * component should report an unbounded max (the `Component` default) so the\n * empty list still fills its region and drag-resizes.\n */\n emptyComponent?: () => Component;\n /**\n * Construction-time shortcut for\n * [`setHorizontalScrolling`](/api/component/list/classes/List#sethorizontalscrolling).\n * Defaults to `false` — a label wider than the row ellipsises.\n */\n horizontalScrolling?: boolean;\n}\n\n/**\n * Shared visual defaults for every {@link AbstractSelectableList} subclass.\n * Layered into the defaults bag passed to `super` from the abstract\n * constructor so {@link List} and {@link MultiSelectList} share row\n * chrome without duplicating the bag at every leaf.\n */\nconst _defaultAbstractSelectableListOptions: Partial<AbstractSelectableListOptions> = {\n tag: \"div\",\n backgroundColor: \"var(--ts-ui-list-bg, rgb(255, 255, 255))\",\n foregroundColor: \"var(--ts-ui-text-color, black)\",\n border: \"1px solid var(--ts-ui-list-border, rgb(200, 200, 200))\",\n borderRadius: \"var(--ts-ui-border-radius, 4px)\",\n preferredSize: { width: 200, height: 200 },\n maxSize: { width: Number.MAX_SAFE_INTEGER, height: Number.MAX_SAFE_INTEGER },\n};\n\n/**\n * Static styling registered once at module init. The container surface\n * carries the focus ring (matched against the framework auto-added\n * `.List` / `.MultiSelectList` classes that `Component.init()` derives\n * from `constructor.name`); `.SelectableListRow` carries the row chrome\n * (single-line text with ellipsis truncation); the row's theme-controlled\n * separator is a real border set through `setBorder` in the row constructor,\n * not a class rule, so the framework's box math can see it. The\n * `.selected` / `.focused` modifier classes layer the\n * selection wash and keyboard-focus outline on top.\n *\n * The `:focus` ring is attached via a compound selector covering both\n * concrete subclass names rather than the abstract base — TypeScript\n * `class.constructor.name` is the leaf class, so the framework adds\n * `\"List\"` / `\"MultiSelectList\"` (not `\"AbstractSelectableList\"`) to the\n * surface's classList. Keep this list in sync if a new concrete\n * subclass extends `AbstractSelectableList`.\n */\n(() => {\n new StyleRule({\n scope: \"selector\",\n name: \".List, .MultiSelectList\",\n styles: {\n userSelect: \"none\",\n outline: \"none\",\n },\n });\n\n // Pseudo-element overlay rather than a plain `outline:` rule so an\n // ancestor with `overflow: hidden` (the framework's Component default)\n // can't clip the focus indicator. `z-index: 1` lifts the ring above the\n // absolutely-positioned rows.\n new StyleRule({\n scope: \"selector\",\n name: \".List:focus::after, .MultiSelectList:focus::after\",\n styles: {\n content: \"''\",\n position: \"absolute\",\n inset: \"0\",\n border: \"2px solid var(--ts-ui-indicator-focus, rgb(30, 100, 200))\",\n borderRadius: \"inherit\",\n boxSizing: \"border-box\",\n pointerEvents: \"none\",\n zIndex: \"1\",\n },\n });\n\n // `lineHeight: 22px` centers the single line of label text vertically\n // without `display: flex` — matches `ROW_HEIGHT_PX` and the row's\n // cached `preferredSize(0, 22)`. The whiteSpace/overflow/textOverflow\n // trio truncates long labels with an ellipsis when the row is narrower\n // than the label text.\n new StyleRule({\n scope: \"class\",\n name: \"SelectableListRow\",\n styles: {\n lineHeight: \"22px\",\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n cursor: \"pointer\",\n },\n });\n\n new StyleRule({\n scope: \"selector\",\n name: \".SelectableListRow:hover\",\n styles: {\n backgroundColor: \"var(--ts-ui-list-row-hover-bg, rgba(30, 100, 200, 0.08))\",\n },\n });\n\n new StyleRule({\n scope: \"selector\",\n name: \".SelectableListRow.selected\",\n styles: {\n backgroundColor: \"var(--ts-ui-list-row-selected-bg, rgba(30, 100, 200, 0.18))\",\n color: \"var(--ts-ui-list-row-selected-color, inherit)\",\n },\n });\n\n // The keyboard-focused row is part of the *selection* indicator family\n // (a light per-row mark, distinct from the heavier focus border around\n // the focusable list root itself). Uses the dashed `indicator.selection`\n // shorthand so future themes can re-skin every \"selection mark\" in one\n // place. Rows have no positioned descendants, so the outline draws on\n // top of the row's text without any covering issue.\n new StyleRule({\n scope: \"selector\",\n name: \".SelectableListRow.focused\",\n styles: {\n outline: \"var(--ts-ui-indicator-selection, 1px dashed rgb(120, 170, 240))\",\n },\n });\n})();\n\n/**\n * A single row inside an {@link AbstractSelectableList}. Holds the static\n * row styling via the `.SelectableListRow` / `.SelectableListRow:hover` /\n * `.SelectableListRow.selected` / `.SelectableListRow.focused` class rules —\n * except the bottom separator, which is a real border set in the constructor so\n * it is measurable — and exposes typed setters for the label, the pool index,\n * the selected flag, and the focused flag.\n *\n * Internal — not re-exported from the per-subpath barrel; the public\n * surface lives on `List` / `MultiSelectList`.\n */\nclass SelectableListRow extends Component {\n // Cached so setter calls made before the element renders survive to\n // be applied at render time.\n private _selected: boolean = false;\n private _focused: boolean = false;\n /** Zero-based index in the row pool; forwarded to the handlers on a gesture. */\n private _index: number;\n /** Owner-supplied gesture handlers, each invoked with this row's `_index`. */\n private readonly _handlers: RowHandlers;\n /** Whether a tooltip is currently attached, so `updateItem` can detach it. */\n private _tooltipAttached: boolean = false;\n /**\n * The renderer owning this row's content (label, optional glyph). Built\n * from the owning list's factory, appended straight into the row DOM in\n * {@link init}, and positioned from {@link doLayout}. Rendered\n * `pointer-events: none` so a click on the label falls through to the\n * row element, whose exact-target `click` listener drives selection.\n */\n private _renderer: ListItemRenderer;\n\n /**\n * @param handlers - Owner-supplied gesture callbacks (click, contextmenu,\n * dblclick), each invoked with the row's index and the raw mouse event.\n * @param index - Initial pool index.\n * @param rendererFactory - Zero-argument factory producing this row's\n * content renderer.\n */\n constructor(handlers: RowHandlers, index: number, rendererFactory: () => ListItemRenderer) {\n super({ tag: \"div\" });\n\n this._handlers = handlers;\n this._index = index;\n this._renderer = rendererFactory();\n this._renderer.setPointerEvents(\"none\");\n\n this.getAria().setRole(\"option\");\n this.setPreferredSize({ width: 0, height: ROW_HEIGHT_PX });\n // Do NOT cap the row's max height. A finite per-row height max makes the\n // list's VBox sum to a finite content max (VBox.aggregateMaxSize), which\n // shrink-wraps the whole list to its content and breaks stretch/scroll\n // and the accordion's resizable drag. The row is already pinned to\n // ROW_HEIGHT_PX by its preferredSize above; leave its max unbounded (the\n // Component default).\n this.setPadding(new Insets(0, ROW_PADDING_X_PX, 0, ROW_PADDING_X_PX));\n // Declared through the typed setter rather than the shared class rule so\n // getBorderSize() sees the 1px the separator takes out of the row's\n // content box; a class-rule border is invisible to the framework's box\n // math, and the renderer would be sized a pixel too tall and clipped.\n this.setBorder({ borderBottom: \"1px solid var(--ts-ui-list-row-separator, transparent)\" });\n // Component's framework default writes `cursor: default` as an\n // inline style, which would beat the `.SelectableListRow` class rule\n // — set the inline cursor explicitly so rows show the hand\n // cursor on hover.\n this.setCursor(\"pointer\");\n\n Event.addListener(this, \"pointerdown\", this.onPointerDown);\n Event.addListener(this, \"click\", this.onClick);\n Event.addListener(this, \"contextmenu\", this.onContextMenu);\n Event.addListener(this, \"dblclick\", this.onDblClick);\n }\n\n /**\n * Rebinds this row's renderer to a new item, replacing the plain-text\n * label write the pool sync used before renderers existed.\n *\n * @param item - The item to display.\n * @param index - The item's zero-based index.\n *\n * @returns This row, for method chaining.\n */\n updateItem(item: SelectableListItem, index: number): this {\n this._renderer.update({ item, index });\n this.applyTooltip(item.tooltip);\n\n return this;\n }\n\n /**\n * Attaches (or detaches) the row's hover tooltip to match the item. Called\n * from {@link updateItem} so a pooled row reused for a different item tracks\n * the new item's `tooltip` — attaching when set, detaching when cleared.\n *\n * @param text - The item's tooltip text, or `undefined` for no tooltip.\n */\n private applyTooltip(text: string | undefined): void {\n if (text) {\n // Tooltip.attach replaces any prior attachment, so re-attaching with\n // new text on pool reuse is safe. The renderer is pointer-events:none,\n // so hover events target the row element and the component-level\n // attach matches (no need to reach the label child).\n Tooltip.attach(this, text);\n this._tooltipAttached = true;\n } else if (this._tooltipAttached) {\n Tooltip.detach(this);\n this._tooltipAttached = false;\n }\n }\n\n /**\n * Returns the row's natural width — its renderer's content width plus the\n * row's own horizontal padding — i.e. the width at which the bound item\n * renders without clipping.\n *\n * Read by {@link ListRowColumn.computeTotalMinSize}, and only while the\n * owning list scrolls horizontally, so a list with the setting off never\n * calls this and never makes its renderers measure.\n *\n * Deliberately *not* published as the row's `minSize`: a minimum is a\n * constraint that propagates outward (`VBox.getMinSize` → the inner\n * `Panel` → the list's `Fit` → `Component.clampWidth`), so a wide row would\n * inflate the whole `List` element inside its host rather than scroll\n * within it. The natural width is an input to the column's own overflow\n * inflation only.\n *\n * @returns The row's natural width in pixels.\n */\n getNaturalWidth(): number {\n return this._renderer.getContentWidth() + ROW_PADDING_X_PX * 2;\n }\n\n /**\n * Swaps in a new content renderer, removing the old renderer's element\n * and appending the new one. Used when the owning list's renderer factory\n * changes. The new renderer is left blank until the next\n * {@link updateItem}.\n *\n * @param renderer - The replacement renderer.\n *\n * @returns This row, for method chaining.\n */\n setRenderer(renderer: ListItemRenderer): this {\n const el = this.getElement();\n\n if (el) {\n const oldEl = this._renderer.getElement();\n if (oldEl && DOM.source.getParentNode(oldEl) === el) {\n DOM.sink.removeChild(el, oldEl);\n }\n }\n\n this._renderer = renderer;\n this._renderer.setPointerEvents(\"none\");\n\n if (el) {\n DOM.sink.appendChild(el, this._renderer.getElement(true)!);\n }\n\n return this;\n }\n\n /**\n * Updates the index this row reports through its click callback. Used\n * when the row pool is reconciled against a new item list and an\n * existing row is reused at a new position.\n *\n * @param index - The new zero-based row index.\n *\n * @returns This row, for method chaining.\n */\n setIndex(index: number): this {\n this._index = index;\n\n return this;\n }\n\n /**\n * Returns the row's current pool index.\n *\n * @returns The zero-based index.\n */\n getIndex(): number {\n return this._index;\n }\n\n /**\n * Toggles the `.selected` class and `aria-selected` to reflect\n * membership in the owning list's selection set.\n *\n * @param value - `true` when this row is currently selected.\n *\n * @returns This row, for method chaining.\n */\n setSelected(value: boolean): this {\n this._selected = value;\n this.getAria().setSelected(value);\n this.applyRowClass();\n\n return this;\n }\n\n /**\n * Returns the cached selected state.\n *\n * @returns `true` when this row is currently selected.\n */\n isSelected(): boolean {\n return this._selected;\n }\n\n /**\n * Toggles the `.focused` class to reflect the keyboard-focus position\n * inside the owning list.\n *\n * @param value - `true` when this row currently holds the keyboard\n * focus position.\n *\n * @returns This row, for method chaining.\n */\n setFocused(value: boolean): this {\n this._focused = value;\n this.applyRowClass();\n\n return this;\n }\n\n /**\n * Returns the cached focused state.\n *\n * @returns `true` when this row holds the keyboard-focus position.\n */\n isFocused(): boolean {\n return this._focused;\n }\n\n /**\n * Renders the row's `<div>` with its current class set. The label content\n * lives in the renderer child, appended by {@link init}.\n *\n * @returns The created element handle.\n */\n protected render(): Handle {\n const element = super.render();\n this.applyRowClass();\n\n return element;\n }\n\n /**\n * Appends the renderer's element to the row DOM. The renderer's own\n * children (label, optional glyph) are appended by the renderer's `init`.\n *\n * @param element - Optional element passed by the rendering pipeline;\n * falls back to getElement().\n *\n * @returns This row, for method chaining.\n */\n protected init(element?: Handle): this {\n super.init(element);\n\n const el = element || this.getElement();\n if (el) {\n DOM.sink.appendChild(el, this._renderer.getElement(true)!);\n }\n\n return this;\n }\n\n /**\n * Positions the renderer to fill the row's content box, then lets it lay\n * out its own children. Only writes setters (no geometry reads), so it is\n * safe under the `commitBounds` auto-commit path that drives it.\n *\n * @returns This row, for method chaining.\n */\n doLayout(): this {\n super.doLayout();\n\n const box = this.getContentBounds();\n if (!box) {\n return this;\n }\n\n this._renderer.setAutoCommitStyle(false);\n this._renderer.setX(box.x);\n this._renderer.setY(box.y);\n this._renderer.setWidth(box.width);\n this._renderer.setHeight(box.height);\n this._renderer.setAutoCommitStyle(true);\n\n this._renderer.layoutChildren(box.width, box.height);\n\n return this;\n }\n\n /**\n * Computes the row's class list from the cached selected/focused\n * state. Writes via `setElementAttribute(\"class\", …)` so the framework\n * defer-write seam owns the DOM write.\n *\n * The write replaces the whole `class` attribute, so it must re-state the\n * framework `COMPONENT_CLASS` that `Component.init` adds — otherwise a\n * post-init rewrite (a selection change) drops it, and with it the\n * `:where(.ts-ui-component)` rule that supplies `position: absolute`,\n * collapsing every row to `top: auto` so they stack on top of each other.\n */\n private applyRowClass(): void {\n const classes = [COMPONENT_CLASS, \"SelectableListRow\"];\n\n if (this._selected) {\n classes.push(\"selected\");\n }\n\n if (this._focused) {\n classes.push(\"focused\");\n }\n\n this.setElementAttribute(\"class\", classes.join(\" \"));\n }\n\n /**\n * Suppresses focus loss when the row is pointed at. Without this,\n * clicking a row while the list root has focus would blur the list,\n * and the keyboard model would lose its focus position before the\n * click handler runs. The same pattern guards the AutoComplete row\n * pool against blurring the host input on click.\n *\n * @param e - The pointerdown event.\n */\n private onPointerDown(e: PointerEvent): void {\n e.preventDefault();\n }\n\n /**\n * Forwards the row's index and the raw mouse event to the owner-supplied\n * click callback.\n *\n * @param e - The click event.\n */\n private onClick(e: MouseEvent): void {\n this._handlers.onClick(this._index, e);\n }\n\n /**\n * Forwards the row's index and the raw mouse event to the owner-supplied\n * context-menu callback.\n *\n * @param e - The contextmenu event.\n */\n private onContextMenu(e: MouseEvent): void {\n this._handlers.onContextMenu(this._index, e);\n }\n\n /**\n * Forwards the row's index and the raw mouse event to the owner-supplied\n * double-click callback.\n *\n * @param e - The dblclick event.\n */\n private onDblClick(e: MouseEvent): void {\n this._handlers.onDblClick(this._index, e);\n }\n}\n\n/**\n * The row stack inside a list's scroll panel: a `VBox` that additionally knows\n * how wide its rows want to be.\n *\n * Exists for one reason — the framework's cross-axis overflow inflation reads\n * the children's *minimum* width (`LayoutManager.inflateForOverflow` →\n * {@link computeTotalMinSize}), but a row's natural width must not become a\n * minimum. A minimum propagates outward — `VBox.getMinSize` → the scroll\n * `Panel` → the list's `Fit` → `Component.clampWidth` — and would inflate the\n * `List` element itself inside its host, so a long label would widen the whole\n * rail instead of scrolling inside it.\n *\n * Overriding `computeTotalMinSize` alone separates the two: the inflation\n * target picks up the widest row's natural width, while `getMinSize` (untouched\n * from `VBox`) keeps reporting the rows' real minimum of zero. So the column\n * lays out wide and scrolls, and nothing outside the scroll panel ever learns\n * of the content's width.\n *\n * Inert unless the host has opted into horizontal overflow — `inflateForOverflow`\n * ignores an axis the host does not scroll, so with `horizontalScrolling` off\n * this behaves exactly as a plain `VBox` and never measures a renderer.\n */\nclass ListRowColumn extends _VBox {\n\n /**\n * Widens the inflation target to the widest row's natural width, so a list\n * scrolling horizontally lays its rows out at full content width.\n *\n * @returns The children's combined min size, with the width raised to the\n * widest row's natural width.\n */\n protected computeTotalMinSize(): Size {\n const total = super.computeTotalMinSize();\n const container = this.getContainer();\n\n // Only the X-overflow path consumes the width, and the scan below makes\n // every row measure its renderer — so skip it whenever the host isn't\n // scrolling X. Not merely an optimisation: a list has always scrolled Y,\n // so `inflateForOverflow` calls this on every layout of every list, and\n // an ungated scan would put a per-row text measure into all of them.\n if (!container || !this.isOverflowingX()) {\n return total;\n }\n\n let natural = 0;\n\n for (const component of container.getLaidOutComponents()) {\n // The empty-state placeholder shares the column with the rows and has\n // no natural width to contribute — it tracks the viewport instead.\n if (component instanceof SelectableListRow) {\n natural = Math.max(natural, component.getNaturalWidth());\n }\n }\n\n return { width: Math.max(total.width, natural), height: total.height };\n }\n}\n\n/**\n * Owner-supplied gesture callbacks for a {@link SelectableListRow}, each invoked\n * with the row's current pool index and the originating mouse event. The row\n * owns no selection or event-dispatch logic itself — it forwards to the list.\n */\ninterface RowHandlers {\n /** Invoked on a left-click of the row. */\n onClick: (index: number, event: MouseEvent) => void;\n /** Invoked on a right-click of the row (before the list suppresses the native menu). */\n onContextMenu: (index: number, event: MouseEvent) => void;\n /** Invoked on a double-click of the row. */\n onDblClick: (index: number, event: MouseEvent) => void;\n}\n\n/**\n * Abstract base for the framework's custom selectable list controls.\n *\n * Owns the item array, the store binding, the row pool (one\n * {@link SelectableListRow} per visible item), the selection set, the\n * keyboard model (ArrowUp/Down, Home/End, PageUp/Down, Enter/Space,\n * type-ahead), and the ARIA listbox wiring. Concrete subclasses\n * ({@link List}, {@link MultiSelectList}) supply the\n * {@link AbstractSelectableList.reduceSelection} reducer that translates a\n * click or keyboard gesture into a new selection set, and the\n * {@link AbstractSelectableList.setValue} / `getValue` round-trip used by\n * [`Bindable`](/api/core/interfaces/Bindable).\n *\n * Not wrapped with `callable()` — abstract classes are never instantiated;\n * the wrapping rule applies only to concrete component subclasses.\n *\n * @category Components\n */\nabstract class AbstractSelectableList<\n TValue,\n TOptions extends AbstractSelectableListOptions = AbstractSelectableListOptions\n>\n extends AbstractInput<TValue, TOptions>\n{\n protected _items: Array<SelectableListItem> = [];\n protected _rowPool: Array<SelectableListRow> = [];\n protected _selectedSet: Set<number> = new Set();\n protected _anchorIndex: number | null = null;\n protected _focusedIndex: number = -1;\n /** Lower-cased type-ahead buffer; cleared on Escape or timeout. */\n protected _typeAheadBuf: string = \"\";\n /** Timestamp (ms) of the last printable keypress; used to time out the buffer. */\n protected _typeAheadAt: number = 0;\n /**\n * When true, {@link handleRowClick} pulls DOM focus to the list root\n * after the gesture commits so subsequent keystrokes route through\n * `handleKeyDown`. Hosts that own their own focus surface and forward\n * keystrokes (e.g. the ComboBox dropdown, which calls\n * {@link handleKey} from the ComboBox's own `keydown`) set this to\n * `false` so the embedded list never steals focus from the wrapping\n * input.\n */\n protected _focusOnRowClick: boolean = true;\n /**\n * When true (default), keyboard navigation\n * (ArrowUp/Down/Home/End/PageUp/Down) commits the focused row as the\n * selection — the \"selection follows focus\" pattern most listbox\n * controls use. Hosts that want a navigable highlight without\n * committing the row as the selected value (the WAI-ARIA\n * combobox-with-list-autocomplete pattern, exercised by\n * [`AutoCompleteField`](/api/component/input/classes/AutoCompleteField))\n * call `setSelectFollowsFocus(false)` so ArrowUp/Down moves only the\n * focus highlight; Enter / Space / click still commit.\n */\n protected _selectFollowsFocus: boolean = true;\n /**\n * Whether over-long rows scroll horizontally instead of ellipsising.\n * Written only by {@link setHorizontalScrolling}, dispatched from the\n * constructor body once `_innerPanel` exists, so the field-initializer\n * default survives the `super()` cascade without a `declare`.\n */\n private _horizontalScrolling: boolean = false;\n protected _innerPanel: Panel;\n /** Cached empty-state placeholder, built lazily on first need; null until then. */\n private _emptyPlaceholder: Component | null = null;\n /** Whether `_emptyPlaceholder` is currently a child of `_innerPanel`. */\n private _placeholderAttached: boolean = false;\n private _storeRefresh: (() => void) | null = null;\n /**\n * Factory producing each row's content renderer. Defaults to a label\n * renderer reproducing the plain-text rows. Written only by\n * {@link setRendererFactory}, dispatched from the constructor body, so the\n * field-initializer default survives the `super()` cascade without a\n * `declare`.\n */\n private _rendererFactory: () => ListItemRenderer = () => new LabelListItemRenderer();\n /**\n * Listeners for the row-gesture events that carry a row index payload\n * (`contextmenu`, `dblclick`) — kept off the DOM `Event` bus, which fires\n * bare DOM events without the index. `change` / `action` stay on the DOM\n * bus via {@link on}. Mirrors [`Tree`](/api/component/tree/classes/Tree)'s\n * `contextmenu` / `dblclick` wiring.\n */\n private _rowListeners: ListenerBag<\"contextmenu\" | \"dblclick\"> = new ListenerBag();\n\n /**\n * @param options - Caller-supplied options bag.\n * @param subclassDefaults - Per-subclass default bag layered over this\n * class's defaults; subclasses forward their `_defaultXxxOptions`\n * constant here.\n */\n constructor(options?: TOptions, subclassDefaults?: Partial<TOptions>) {\n // `Fit` makes the inner panel fill the list root; the Component\n // default `Absolute` would size every child to its preferredSize\n // (none here) and collapse the inner panel to 0×0. Layered into\n // the defaults bag so concrete subclass defaults and user options\n // can still override, alongside the shared list chrome.\n super(\n options,\n {\n ..._defaultAbstractSelectableListOptions,\n layoutManager: new Fit(),\n ...(subclassDefaults ?? {}),\n } as Partial<TOptions>,\n );\n\n // Element-level chrome: the list root carries the `listbox` role\n // and is focusable. The framework auto-adds the leaf-class name\n // (`\"List\"` / `\"MultiSelectList\"`) to the surface's classList in\n // `Component.init()`; the shared `.List, .MultiSelectList`\n // style rule registered at module init picks both up without an\n // extra opt-in.\n this.getAria().setRole(\"listbox\");\n this.getAria().setTabIndex(0);\n\n // Inner panel is the scrollable row stack. `autoScroll: \"y\"` opts\n // it into the framework's native-overflow path; `VBox` lays the\n // rows out vertically full-width with no gap.\n this._innerPanel = new Panel({\n layoutManager: new ListRowColumn({ spacing: 0, stretching: true }),\n autoScroll: \"y\",\n insets: new Insets(0, 0, 0, 0),\n });\n this.addComponent(this._innerPanel);\n\n // Default floor, but let a caller-supplied minSize option win. The\n // super() cascade writes `_options.minSize` only when the caller passed\n // one (the class default {0,0} lives in the defaults bag, not `_options`),\n // so its presence means \"caller set it\". maxSize stays unbounded.\n if (this._options.minSize === undefined) {\n // 100×100 keeps a short empty/placeholder list a usable size.\n this.setMinSize({ width: 100, height: 100 });\n }\n\n Event.addListener(this, \"keydown\", this.handleKeyDown);\n\n // Late-built state: `rendererFactory` / `store` / `items` / `enabled` /\n // `readOnly` were written pure to `_options` by the super-time cascade.\n // Dispatch them now that `_innerPanel` and `_rowPool` exist. The\n // factory is dispatched first so the row pool is built (by `setStore` /\n // `setItems` below) with the caller's renderer on first paint.\n if (this._options.rendererFactory !== undefined) {\n this.setRendererFactory(this._options.rendererFactory);\n }\n\n if (this._options.horizontalScrolling !== undefined) {\n this.setHorizontalScrolling(this._options.horizontalScrolling);\n }\n\n if (this._options.store !== undefined && this._options.displayField !== undefined) {\n this.setStore(this._options.store, this._options.displayField, this._options.valueField, this._options.glyphField, this._options.tooltipField);\n }\n\n if (this._options.items !== undefined) {\n this.setItems(this._options.items);\n }\n\n if (this._options.enabled !== undefined) {\n this.applyEnabled(this._options.enabled);\n }\n\n if (this._options.readOnly !== undefined) {\n this.applyReadOnly(this._options.readOnly);\n }\n\n // Dispatch the empty-state options last, after items/store — a list built\n // *with* items must show no placeholder. Needed because an empty list\n // configured with only `emptyText`/`emptyComponent` never calls syncRows\n // during construction.\n if (this._options.emptyText !== undefined || this._options.emptyComponent !== undefined) {\n this.syncEmptyPlaceholder();\n }\n }\n\n /**\n * Reflects the enabled flag on the ARIA tree, the tabindex, and the\n * cursor. Disabling the list parks the focus index at -1 so a\n * subsequent enable starts fresh, mirroring the native `<select>`\n * the framework replaces. Concrete subclasses can still override\n * for additional behaviour.\n *\n * @param value - The new enabled state.\n */\n protected applyEnabled(value: boolean): void {\n this.getAria().setDisabled(!value);\n this.getAria().setTabIndex(value ? 0 : -1);\n this.setCursor(value ? \"default\" : \"not-allowed\");\n\n if (!value) {\n this._focusedIndex = -1;\n this.refreshRowVisualState();\n this.updateActiveDescendant();\n }\n }\n\n /**\n * Reflects the read-only flag on the ARIA tree. Read-only lists\n * stay focusable and announce their state; the click / keyboard\n * reducers are gated separately in {@link handleRowClick} /\n * {@link handleKeyDown}.\n *\n * @param value - The new read-only state.\n */\n protected applyReadOnly(value: boolean): void {\n this.getAria().setReadOnly(value);\n }\n\n /**\n * Applies an {@link AbstractSelectableListOptions} bag. Item / store\n * fields are written pure into `_options` here and dispatched from the\n * constructor body — the row pool and inner panel only exist after\n * `super()` returns.\n *\n * @param options - The options bag carrying the values to apply.\n *\n * @returns This component, for method chaining.\n */\n protected applyOptions(options: TOptions): this {\n super.applyOptions(options);\n\n if (options.items !== undefined) this._options.items = options.items;\n if (options.store !== undefined) this._options.store = options.store;\n if (options.displayField !== undefined) this._options.displayField = options.displayField;\n if (options.valueField !== undefined) this._options.valueField = options.valueField;\n if (options.glyphField !== undefined) this._options.glyphField = options.glyphField;\n if (options.tooltipField !== undefined) this._options.tooltipField = options.tooltipField;\n if (options.rendererFactory !== undefined) this._options.rendererFactory = options.rendererFactory;\n if (options.emptyText !== undefined) this._options.emptyText = options.emptyText;\n if (options.emptyComponent !== undefined) this._options.emptyComponent = options.emptyComponent;\n\n if (options.horizontalScrolling !== undefined) this._options.horizontalScrolling = options.horizontalScrolling;\n\n return this;\n }\n\n /**\n * Sets whether a row wider than the viewport scrolls horizontally instead of\n * ellipsising.\n *\n * Off by default, which is the behaviour every list has always had: rows track\n * the viewport width and a label too long for its row clips with an ellipsis.\n * That is the right default for a narrow rail, and for the dropdown surfaces\n * (`ComboBox`, `AutoCompleteField`) where a horizontal bar under a popup reads\n * as a glitch. Turn it on for a list whose labels carry meaning past the\n * truncation point — a file path, a query — and whose host is too narrow to\n * show them.\n *\n * When on, every row is sized to the widest bound row's natural width (see\n * {@link ListItemRenderer.getContentWidth}) or the viewport, whichever is\n * larger, and the scroll area raises a horizontal scrollbar once the content\n * exceeds it. Rows stay full-width relative to each other, so the selection\n * wash still spans the whole row when scrolled. A custom renderer that does\n * not override `getContentWidth` reports no intrinsic width, so its rows stay\n * at the viewport width and nothing scrolls.\n *\n * @param value - True to scroll over-long rows horizontally.\n *\n * @returns This component, for method chaining.\n */\n setHorizontalScrolling(value: boolean): this {\n if (this._horizontalScrolling === value) {\n return this;\n }\n\n this._horizontalScrolling = value;\n\n // `\"auto\"` adds the X axis to the Y the list has always scrolled. That\n // alone drives everything: it is what lets `ListRowColumn` inflate past\n // the viewport, and what raises the bar once the rows do.\n this._innerPanel.setAutoScroll(value ? \"auto\" : \"y\");\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns whether over-long rows scroll horizontally rather than ellipsising.\n *\n * @returns True when horizontal scrolling is on.\n */\n isHorizontalScrolling(): boolean {\n return this._horizontalScrolling;\n }\n\n /**\n * Sets the muted placeholder text shown inside the scroll area when the list\n * is empty. Pass `null` to clear it. Takes effect immediately: an already\n * empty list shows (or drops) the placeholder on the next layout.\n *\n * @param text - The placeholder text, or `null` to remove it.\n *\n * @returns This component, for method chaining.\n */\n setEmptyText(text: string | null): this {\n this._options.emptyText = text ?? undefined;\n this.resetEmptyPlaceholder();\n this.syncEmptyPlaceholder();\n\n return this;\n }\n\n /**\n * Returns the configured empty-state placeholder text.\n *\n * @returns The placeholder text, or `null` if none is set.\n */\n getEmptyText(): string | null {\n return this._options.emptyText ?? null;\n }\n\n /**\n * Sets a factory for a custom empty-state placeholder, shown inside the\n * scroll area when the list is empty. Takes precedence over\n * {@link setEmptyText}. Pass `null` to clear it. The returned component\n * should report an unbounded max so the empty list still fills its region.\n *\n * @param factory - The placeholder factory, or `null` to remove it.\n *\n * @returns This component, for method chaining.\n */\n setEmptyComponent(factory: (() => Component) | null): this {\n this._options.emptyComponent = factory ?? undefined;\n this.resetEmptyPlaceholder();\n this.syncEmptyPlaceholder();\n\n return this;\n }\n\n /**\n * Returns the configured empty-state placeholder factory.\n *\n * @returns The placeholder factory, or `null` if none is set.\n */\n getEmptyComponent(): (() => Component) | null {\n return this._options.emptyComponent ?? null;\n }\n\n /**\n * Adds or removes the empty-state placeholder against the current item\n * count. Attaches the placeholder (building it lazily on first need) to\n * `_innerPanel` when an empty-state is configured and the list is empty;\n * detaches it otherwise. A no-op when no empty-state is configured — an\n * opted-out empty list keeps no placeholder child.\n *\n * Called at the tail of {@link syncRows}, from the empty-state setters, and\n * once at construction for a list built empty with an empty-state option.\n */\n protected syncEmptyPlaceholder(): void {\n const configured = this._options.emptyComponent !== undefined || this._options.emptyText !== undefined;\n const wants = configured && this._items.length === 0;\n\n if (wants) {\n if (!this._emptyPlaceholder) {\n this._emptyPlaceholder = this.buildEmptyPlaceholder();\n }\n\n if (!this._placeholderAttached) {\n // weight: 1 makes the single child absorb all leftover main-axis\n // (height) space so the placeholder fills the scroll area; the\n // inner VBox's stretching:true fills the width.\n this._innerPanel.addComponent(this._emptyPlaceholder, { weight: 1 });\n this._placeholderAttached = true;\n }\n } else if (this._placeholderAttached && this._emptyPlaceholder) {\n this._innerPanel.removeComponent(this._emptyPlaceholder);\n this._placeholderAttached = false;\n }\n }\n\n /**\n * Builds the empty-state placeholder: the `emptyComponent` factory's output\n * if set, otherwise a muted, horizontally-centered single-line `Text` from\n * `emptyText` using the list-scoped disabled token.\n *\n * @returns The placeholder component.\n */\n private buildEmptyPlaceholder(): Component {\n const factory = this._options.emptyComponent;\n if (factory) {\n return factory();\n }\n\n const text = new Text(this._options.emptyText ?? \"\", { textAlign: \"center\" });\n text.setForegroundColor(\"var(--ts-ui-list-row-disabled-color, rgb(170, 170, 170))\");\n\n return text;\n }\n\n /**\n * Detaches the cached placeholder (if attached) and drops it, so the next\n * {@link syncEmptyPlaceholder} rebuilds it from the current options. Used by\n * the empty-state setters when the configuration changes.\n */\n private resetEmptyPlaceholder(): void {\n if (this._placeholderAttached && this._emptyPlaceholder) {\n this._innerPanel.removeComponent(this._emptyPlaceholder);\n this._placeholderAttached = false;\n }\n\n this._emptyPlaceholder = null;\n }\n\n /**\n * Returns `null` so a multi-line list surface is treated as a\n * replaced/graphical element by horizontal layouts — matches the\n * behaviour the prior native `<select>`-backed `List` preserved.\n *\n * @returns Always `null`.\n */\n getBaseline(): number | null {\n return null;\n }\n\n /**\n * Returns a shallow copy of the current item array.\n *\n * @returns The items in display order.\n */\n getItems(): Array<SelectableListItem> {\n return this._items.slice();\n }\n\n /**\n * Replaces all items with the given specs. Each entry is either a plain\n * string — keyed by the string itself (`{ key: label }`), so `getValue` /\n * `setValue` round-trip the visible text for the common \"list of names\"\n * case — or a pre-formed {@link SelectableListItem} whose explicit key is kept\n * verbatim. Selection and focus are reset; the row pool is reconciled\n * against the new length.\n *\n * @param items - A single spec or an array of specs. Each spec is a string\n * (keyed by its own value) or a `{ key, label }` object (explicit key).\n *\n * @remarks The caller owns key uniqueness — repeated strings, or an explicit\n * key colliding with a string value, produce duplicate keys, and\n * `getValue` / `setValue` resolve to the first row whose `key` matches, so\n * a duplicate key is merely addressed by its lowest matching row.\n *\n * @returns This component, for method chaining.\n */\n setItems(items: SelectableListItemSpec | Array<SelectableListItemSpec>): this {\n if (!Type.isArray(items)) {\n items = [items as SelectableListItemSpec];\n }\n\n const list = items as Array<SelectableListItemSpec>;\n const built: Array<SelectableListItem> = [];\n\n for (const entry of list) {\n built.push(\n typeof entry === \"string\"\n ? { key: entry, label: entry }\n : { key: (entry as SelectableListItem).key, label: (entry as SelectableListItem).label, glyph: (entry as SelectableListItem).glyph, tooltip: (entry as SelectableListItem).tooltip },\n );\n }\n\n return this.setItemsArray(built);\n }\n\n /**\n * Replaces all items with the given pre-formed `{key, label}` pairs.\n * Mirrors {@link setItems} but skips the key-from-label step so a host\n * that already owns typed items (e.g. the [`ComboBox`](/api/component/input/classes/ComboBox)\n * dropdown pushing a `SelectableListItem` array) can hand them over\n * without the keys being overwritten by their labels. Selection and focus are reset; the row pool\n * is reconciled against the new length.\n *\n * Protected on the abstract base so each concrete subclass decides\n * whether to widen it into the public surface — {@link List} does;\n * `MultiSelectList` does not (the multi-select consumers haven't\n * needed the typed-array entry point so far).\n *\n * @param items - The pre-formed item pairs, in display order.\n *\n * @returns This component, for method chaining.\n */\n protected setItemsArray(items: Array<SelectableListItem>): this {\n this._items = items.slice();\n\n this._selectedSet.clear();\n this._anchorIndex = null;\n this._focusedIndex = -1;\n\n this.pauseLayout();\n this.syncRows();\n this.resumeLayout();\n this.updateActiveDescendant();\n\n return this;\n }\n\n /**\n * Appends a new item to the end of the list. A plain string is keyed by the\n * string itself (`{ key: label }`), so `getValue` / `setValue` round-trip the\n * visible text; a pre-formed {@link SelectableListItem} keeps its explicit key\n * verbatim.\n *\n * @param item - A string (keyed by its own value) or a `{ key, label }`\n * object (explicit key).\n *\n * @remarks The caller owns key uniqueness — appending a string equal to an\n * earlier string or explicit key produces a duplicate key, and `getValue` /\n * `setValue` resolve to the first matching row.\n *\n * @returns This component, for method chaining.\n */\n addItem(item: SelectableListItemSpec): this {\n this._items.push(\n typeof item === \"string\"\n ? { key: item, label: item }\n : { key: (item as SelectableListItem).key, label: (item as SelectableListItem).label, glyph: (item as SelectableListItem).glyph, tooltip: (item as SelectableListItem).tooltip },\n );\n\n this.pauseLayout();\n this.syncRows();\n this.resumeLayout();\n\n return this;\n }\n\n /**\n * Binds this list to a store. Records are pulled via `displayField` /\n * `valueField` whenever the store fires `load` / `add` / `remove` /\n * `datachange` / `sync`. Re-binding to a new store de-registers the\n * previous handlers first.\n *\n * @param store - The store to bind to.\n * @param displayField - The record field whose value becomes the row label.\n * @param valueField - Optional. The record field used as the row key;\n * defaults to the record's primary key when omitted.\n * @param glyphField - Optional. The record field whose value becomes each\n * item's `glyph` (read by the glyph renderer); omitted leaves items\n * glyph-less.\n * @param tooltipField - Optional. The record field whose value becomes each\n * item's hover `tooltip`; omitted leaves items tooltip-less.\n *\n * @returns This component, for method chaining.\n */\n setStore(store: AbstractStore, displayField: string, valueField?: string, glyphField?: string, tooltipField?: string): this {\n const oldStore = this._options.store;\n\n if (this._storeRefresh && oldStore) {\n (['load', 'add', 'remove', 'datachange', 'sync'] as const)\n .forEach(e => oldStore.off(e, this._storeRefresh!));\n }\n\n this._options.store = store;\n this._options.displayField = displayField;\n this._options.valueField = valueField;\n this._options.glyphField = glyphField;\n this._options.tooltipField = tooltipField;\n\n const refresh = (): void => this.refreshFromStore();\n this._storeRefresh = refresh;\n\n store.on('load', refresh);\n store.on('add', refresh);\n store.on('remove', refresh);\n store.on('datachange', refresh);\n store.on('sync', refresh);\n\n this.refreshFromStore();\n\n return this;\n }\n\n /**\n * Returns the currently bound store, or `null` when none is set.\n *\n * @returns The bound store, or `null`.\n */\n getStore(): AbstractStore | null {\n return this._options.store ?? null;\n }\n\n /**\n * Replaces the renderer factory. Every existing pool row swaps to a fresh\n * renderer from the new factory and the pool is re-synced so each renderer\n * rebinds to its item before the next layout. New rows built afterwards use\n * the new factory too.\n *\n * @param factory - Zero-argument factory producing a renderer per row.\n *\n * @returns This component, for method chaining.\n */\n setRendererFactory(factory: () => ListItemRenderer): this {\n this._rendererFactory = factory;\n\n for (const row of this._rowPool) {\n row.setRenderer(factory());\n }\n\n this.pauseLayout();\n this.syncRows();\n this.resumeLayout();\n\n return this;\n }\n\n /**\n * Returns the renderer factory currently in use.\n *\n * @returns The zero-argument renderer factory.\n */\n getRendererFactory(): () => ListItemRenderer {\n return this._rendererFactory;\n }\n\n /**\n * Returns the store record corresponding to the most recent\n * single-selection anchor — matches the prior `<select>`-backed\n * behaviour where `getSelectedRecord()` returned the active option's\n * record. For {@link MultiSelectList} consumers wanting the full set\n * of selected records, use [`getSelectedRecords`](/api/component/list/classes/MultiSelectList#getselectedrecords).\n *\n * @returns The selected [`ModelRecord`](/api/data/classes/ModelRecord), or `undefined` when no\n * store is bound or nothing is selected.\n */\n getSelectedRecord(): ModelRecord | undefined {\n const store = this._options.store;\n\n if (!store) {\n return undefined;\n }\n\n const idx = this.getSelectedIndex();\n\n if (idx < 0) {\n return undefined;\n }\n\n return store.getRecords()[idx];\n }\n\n /**\n * Returns the index of the most recent single-selection anchor, or\n * `-1` when nothing is selected.\n *\n * @returns The anchor index.\n */\n getSelectedIndex(): number {\n if (this._anchorIndex !== null && this._selectedSet.has(this._anchorIndex)) {\n return this._anchorIndex;\n }\n\n if (this._selectedSet.size === 0) {\n return -1;\n }\n\n // Fallback when the anchor is gone (e.g. after a programmatic\n // setValues that bypassed the click reducer): return the lowest\n // selected index so the contract stays single-valued.\n return Math.min(...this._selectedSet);\n }\n\n /**\n * Sets the single-selection anchor. The selection set becomes\n * exactly `{idx}` (or empty for `idx < 0`); `_focusedIndex` follows.\n * Optionally fires the `change` event so binding listeners run.\n *\n * @param idx - The zero-based index to select, or a negative value\n * to clear the selection.\n * @param fireEvent - When `true` (default), fires the `change` event\n * after updating; pass `false` for programmatic writes.\n *\n * @returns This component, for method chaining.\n */\n setSelectedIndex(idx: number, fireEvent: boolean = true): this {\n this._selectedSet.clear();\n\n if (idx >= 0 && idx < this._items.length) {\n this._selectedSet.add(idx);\n this._anchorIndex = idx;\n this._focusedIndex = idx;\n } else {\n this._anchorIndex = null;\n this._focusedIndex = -1;\n }\n\n this.refreshRowVisualState();\n this.updateActiveDescendant();\n\n if (fireEvent) {\n this.fireChange();\n }\n\n return this;\n }\n\n /**\n * Registers a listener for one of this list's events. `\"action\"` is a\n * typed semantic shorthand over {@link Event.addListener} for the DOM\n * change event — fired only on user-driven (click / keyboard) selection\n * changes, never on programmatic `setValue` / `setValues`, matching the\n * prior native `<select>`-backed semantics. `\"change\"` and `\"binding\"`\n * are the inherited {@link AbstractInput} listener-bag events.\n *\n * `\"contextmenu\"` fires when a row is right-clicked, with the row index and\n * the raw {@link MouseEvent} (the native menu is suppressed); `\"dblclick\"`\n * fires on a row double-click with the same payload. Both carry the row\n * index directly, so hosts need not walk the row DOM to resolve it.\n *\n * @param event - The event name.\n * @param listener - The callback to invoke when the event fires.\n *\n * @returns This component, for method chaining.\n */\n on(event: \"action\", listener: Event.Listener): this;\n on(event: \"change\", listener: (value: TValue) => void): this;\n on(event: \"binding\", listener: () => void): this;\n on(event: \"contextmenu\", listener: (index: number, event: MouseEvent) => void): this;\n on(event: \"dblclick\", listener: (index: number, event: MouseEvent) => void): this;\n on(event: \"action\" | \"change\" | \"binding\" | \"contextmenu\" | \"dblclick\", listener: Function): this {\n if (event === \"action\") {\n Event.addListener(this, \"change\", listener as Event.Listener);\n\n return this;\n }\n\n if (event === \"contextmenu\" || event === \"dblclick\") {\n this._rowListeners.add(event, listener);\n\n return this;\n }\n\n return super.on(event as \"change\", listener as (value: TValue) => void);\n }\n\n /**\n * Removes a previously registered listener. The exact callback\n * reference must match the one passed to {@link on}.\n *\n * @param event - The event the listener was registered for.\n * @param listener - The callback to remove.\n *\n * @returns This component, for method chaining.\n */\n off(event: \"action\" | \"change\" | \"binding\" | \"contextmenu\" | \"dblclick\", listener: Function): this {\n if (event === \"action\") {\n Event.removeListener(this, \"change\", listener as Event.Listener);\n\n return this;\n }\n\n if (event === \"contextmenu\" || event === \"dblclick\") {\n this._rowListeners.remove(event, listener);\n\n return this;\n }\n\n return super.off(event as \"change\" | \"binding\", listener);\n }\n\n /**\n * Subclass hook: translate a click or keyboard gesture at `idx` into\n * a new selection set. The modifier-key flags are normalised so the\n * same reducer runs for mouse and keyboard origins.\n *\n * @param idx - The row index targeted by the gesture.\n * @param ev - Normalised modifier flags. `ctrl` covers both Ctrl and\n * Cmd (macOS).\n */\n protected abstract reduceSelection(idx: number, ev: { ctrl: boolean, shift: boolean }): void;\n\n /**\n * Subclass hook used by user-driven gestures: encode the current\n * selection set into the subclass's `TValue` shape and fire change /\n * binding listeners. Called from the click and keyboard reducers\n * after {@link reduceSelection} mutates the selection set.\n */\n protected abstract notifyUserChange(): void;\n\n /**\n * Rebuilds `_items` from the bound store's current records. Preserves\n * the previously-selected key when possible — if the key still maps\n * to an item, the selection survives; otherwise the selection is\n * cleared and the focus collapses to row 0 (matching the native\n * `<select>` refresh behaviour the prior `List` inherited).\n */\n protected refreshFromStore(): void {\n const store = this._options.store;\n const displayField = this._options.displayField;\n const valueField = this._options.valueField;\n const glyphField = this._options.glyphField;\n const tooltipField = this._options.tooltipField;\n\n if (!store || !displayField) {\n return;\n }\n\n // Remember the active selection key so we can re-locate it in\n // the new item set; survives partial reorderings / additions.\n const previousAnchorKey = this._anchorIndex !== null && this._items[this._anchorIndex]\n ? this._items[this._anchorIndex].key\n : null;\n\n this._items = [];\n this._selectedSet.clear();\n this._anchorIndex = null;\n\n const records = store.getRecords();\n let restoredAnchor = -1;\n\n for (let i = 0; i < records.length; i++) {\n const record = records[i];\n const label = String(record.get(displayField));\n const key = valueField\n ? String(record.get(valueField))\n : String(record.getId());\n const glyph = glyphField ? String(record.get(glyphField)) : undefined;\n const tooltip = tooltipField ? String(record.get(tooltipField)) : undefined;\n\n this._items.push({ key, label, glyph, tooltip });\n\n if (previousAnchorKey !== null && key === previousAnchorKey) {\n restoredAnchor = i;\n }\n }\n\n if (restoredAnchor >= 0) {\n this._selectedSet.add(restoredAnchor);\n this._anchorIndex = restoredAnchor;\n this._focusedIndex = restoredAnchor;\n } else {\n this._focusedIndex = this._items.length > 0 ? 0 : -1;\n }\n\n this.pauseLayout();\n this.syncRows();\n this.resumeLayout();\n this.updateActiveDescendant();\n }\n\n /**\n * Reconciles the row pool with `_items`. Overlapping rows have their\n * label, index, selected, and focused state updated; surplus items\n * spawn new rows; surplus rows are removed.\n */\n protected syncRows(): void {\n const newLen = this._items.length;\n const oldLen = this._rowPool.length;\n const overlap = Math.min(newLen, oldLen);\n\n for (let i = 0; i < overlap; i++) {\n const row = this._rowPool[i];\n row.updateItem(this._items[i], i);\n row.setIndex(i);\n row.setSelected(this._selectedSet.has(i));\n row.setFocused(i === this._focusedIndex);\n }\n\n if (newLen > oldLen) {\n for (let i = oldLen; i < newLen; i++) {\n const row = new SelectableListRow(\n {\n onClick: (idx, e) => this.handleRowClick(idx, e),\n onContextMenu: (idx, e) => this.handleRowContextMenu(idx, e),\n onDblClick: (idx, e) => this.handleRowDblClick(idx, e),\n },\n i,\n this._rendererFactory,\n );\n row.updateItem(this._items[i], i);\n row.setSelected(this._selectedSet.has(i));\n row.setFocused(i === this._focusedIndex);\n this._innerPanel.addComponent(row);\n this._rowPool.push(row);\n }\n } else if (newLen < oldLen) {\n for (let i = newLen; i < oldLen; i++) {\n // Drop the row's tooltip attachment (a static id-keyed map) before\n // discarding the row, so a shrinking pool doesn't leak entries.\n Tooltip.detach(this._rowPool[i]);\n this._innerPanel.removeComponent(this._rowPool[i]);\n }\n this._rowPool.splice(newLen);\n }\n\n // Toggle the empty-state placeholder against the new item count. Runs\n // after the row reconciliation, so on a 0→N transition the rows are in\n // place before the placeholder is dropped (and on N→0, dropped rows are\n // gone before the placeholder attaches). syncRows runs inside a paused\n // layout, so the transient coexistence never renders.\n this.syncEmptyPlaceholder();\n }\n\n /**\n * Pushes the cached selection / focus state into every pool row.\n * Called after a selection mutation (click / keyboard reducer or\n * programmatic write) so the visible chrome catches up without a\n * full `syncRows` reconciliation.\n */\n protected refreshRowVisualState(): void {\n for (let i = 0; i < this._rowPool.length; i++) {\n const row = this._rowPool[i];\n row.setSelected(this._selectedSet.has(i));\n row.setFocused(i === this._focusedIndex);\n }\n }\n\n /**\n * Mirrors `_focusedIndex` onto `aria-activedescendant` so assistive\n * tech tracks the keyboard-focus row. Clears the attribute when no\n * row holds focus. Points at the row's framework-generated id — the\n * Event system already keys listeners off that id, so rewriting the\n * DOM id to a synthetic value (e.g. `ListRow-N`) would break row\n * click / pointerdown delivery.\n */\n protected updateActiveDescendant(): void {\n if (this._focusedIndex < 0 || this._focusedIndex >= this._rowPool.length) {\n this.getAria().setActiveDescendant(\"\");\n\n return;\n }\n\n this.getAria().setActiveDescendant(this._rowPool[this._focusedIndex].getId());\n }\n\n /**\n * Fires the `change` event so `on(\"change\", fn)` subscribers and\n * `notifyChange`-fed bindings run. Subclasses route their own\n * `notifyUserChange` through this after the reducer commits.\n */\n protected fireChange(): void {\n const element = this.getElement();\n\n if (element) {\n Event.fireEvent(this, \"change\");\n }\n\n this.notifyChange(this.getValue());\n }\n\n /**\n * Handles a click on a pool row: dispatches the gesture through the\n * subclass's {@link reduceSelection}, syncs the visible chrome, and\n * fires user-change notifications. The list root takes focus on\n * click (rows are not focusable) so subsequent keyboard navigation\n * starts from the clicked row.\n *\n * @param idx - The row index that was clicked.\n * @param e - The original mouse event — modifier-key flags drive the\n * reducer's multi-select branch.\n */\n protected handleRowClick(idx: number, e: MouseEvent): void {\n if (!this.isEnabled() || this.isReadOnly()) {\n return;\n }\n\n if (idx < 0 || idx >= this._items.length) {\n return;\n }\n\n this.reduceSelection(idx, { ctrl: e.ctrlKey || e.metaKey, shift: e.shiftKey });\n this.refreshRowVisualState();\n this.updateActiveDescendant();\n\n if (this._focusOnRowClick) {\n // Pull DOM focus back to the list root so subsequent keystrokes\n // route through `handleKeyDown` — rows themselves are not\n // focusable, only the listbox surface is. Suppressed when the\n // list is hosted by a focus-managing parent (e.g. the\n // ComboBox dropdown) so a programmatic focus shift can't\n // tear down a wrapping cell editor's input.\n this.focus();\n }\n\n this.notifyUserChange();\n }\n\n /**\n * Handles a right-click on a pool row: suppresses the browser's native\n * context menu and fires the `\"contextmenu\"` event with the row index and\n * the raw event. Deliberately does not change the selection — a host that\n * wants the right-clicked row highlighted calls {@link setSelectedIndex}\n * from its listener (mirrors [`Tree`](/api/component/tree/classes/Tree)'s\n * contextmenu contract). Out-of-range indices are ignored.\n *\n * @param idx - The row index that was right-clicked.\n * @param e - The original contextmenu event.\n */\n protected handleRowContextMenu(idx: number, e: MouseEvent): void {\n if (idx < 0 || idx >= this._items.length) {\n return;\n }\n\n e.preventDefault();\n this._rowListeners.fire(\"contextmenu\", idx, e);\n }\n\n /**\n * Handles a double-click on a pool row: fires the `\"dblclick\"` event with\n * the row index and the raw event. The first click of the pair already ran\n * through {@link handleRowClick} and set the selection, so this only layers\n * an activation signal on top. Out-of-range indices are ignored.\n *\n * @param idx - The row index that was double-clicked.\n * @param e - The original dblclick event.\n */\n protected handleRowDblClick(idx: number, e: MouseEvent): void {\n if (idx < 0 || idx >= this._items.length) {\n return;\n }\n\n this._rowListeners.fire(\"dblclick\", idx, e);\n }\n\n /**\n * Toggles whether a row-click gesture pulls DOM focus to the list\n * root after the commit. Hosts that own their own focus surface\n * (the ComboBox dropdown is the canonical example) call\n * `setFocusOnRowClick(false)` so the embedded list never steals\n * focus from a wrapping input or cell editor.\n *\n * @param value - `false` to suppress the focus call.\n *\n * @returns This component, for method chaining.\n */\n setFocusOnRowClick(value: boolean): this {\n this._focusOnRowClick = value;\n\n return this;\n }\n\n /**\n * Toggles whether keyboard navigation (ArrowUp/Down/Home/End/PageUp/Down)\n * commits the focused row as the selection. When `false`, the focus\n * highlight moves but the selection set is untouched and the `change`\n * event does not fire. Enter / Space / click still commit. The\n * [`AutoCompleteField`](/api/component/input/classes/AutoCompleteField)\n * dropdown sets this to `false` so ArrowUp/Down previews a row\n * without writing it into the host TextField.\n *\n * @param value - `false` to disable the selection-follows-focus\n * coupling on keyboard navigation.\n *\n * @returns This component, for method chaining.\n */\n setSelectFollowsFocus(value: boolean): this {\n this._selectFollowsFocus = value;\n\n return this;\n }\n\n /**\n * Returns the current keyboard-focus index, or `-1` when no row\n * holds focus.\n *\n * @returns The zero-based focus index, or `-1`.\n */\n getFocusedIndex(): number {\n return this._focusedIndex;\n }\n\n /**\n * Returns the framework-generated DOM element id of the keyboard-focus\n * row, suitable for writing into a host input's `aria-activedescendant`.\n * Returns `null` when no row holds focus or the focused row hasn't\n * been instantiated in the pool yet (rows materialise lazily as the\n * pool reconciles against the item array).\n *\n * @returns The focused row's element id, or `null`.\n */\n getFocusedRowId(): string | null {\n if (this._focusedIndex < 0 || this._focusedIndex >= this._rowPool.length) {\n return null;\n }\n\n return this._rowPool[this._focusedIndex].getId();\n }\n\n /**\n * Public entry point used by hosts that keep DOM focus on their own\n * surface while embedding this list (e.g. the [`ComboBox`](/api/component/input/classes/ComboBox)\n * dropdown forwarding keystrokes from the ComboBox surface).\n * Returns `true` when the list consumed the key — the caller\n * should then `e.preventDefault()` and stop further processing.\n * Escape is intentionally NOT consumed here so the host can use\n * it to close the wrapping overlay; the list-focused entry point\n * (the protected `handleKeyDown` registered as the list's own\n * `keydown` listener) still handles Escape inline.\n *\n * @param e - The keyboard event captured by the host.\n *\n * @returns `true` when the list consumed the key.\n */\n handleKey(e: KeyboardEvent): boolean {\n if (!this.isEnabled() || this.isReadOnly()) {\n return false;\n }\n\n if (this._items.length === 0) {\n return false;\n }\n\n if (e.key === \"Escape\") {\n return false;\n }\n\n const ctrl = e.ctrlKey || e.metaKey;\n\n if (this.handleNavigationKey(e, ctrl)) {\n return true;\n }\n\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n this.commitFocusedRow(ctrl, e.shiftKey);\n\n return true;\n }\n\n if (!ctrl && !e.altKey && e.key.length === 1) {\n this.handleTypeAhead(e.key);\n\n return true;\n }\n\n return false;\n }\n\n /**\n * Handles keydown on the list root: ArrowUp/Down/Home/End move the\n * focus index, PageUp/Down move by visible-row count, Enter/Space\n * commits the focused row, Ctrl+A in subclasses extends to select\n * all (handled in {@link MultiSelectList}), Escape clears the\n * type-ahead buffer, and printable characters feed the type-ahead\n * search.\n *\n * @param e - The keyboard event.\n */\n protected handleKeyDown(e: KeyboardEvent): void {\n if (!this.isEnabled() || this.isReadOnly()) {\n return;\n }\n\n if (this._items.length === 0) {\n return;\n }\n\n const ctrl = e.ctrlKey || e.metaKey;\n\n if (e.key === \"Escape\") {\n this._typeAheadBuf = \"\";\n\n return;\n }\n\n if (this.handleNavigationKey(e, ctrl)) {\n return;\n }\n\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n this.commitFocusedRow(ctrl, e.shiftKey);\n\n return;\n }\n\n // Printable single-character key — feed the type-ahead buffer.\n // `key.length === 1` filters out named keys (`\"Tab\"`, `\"Shift\"`,\n // `\"ArrowDown\"`, …) without an explicit allow-list.\n if (!ctrl && !e.altKey && e.key.length === 1) {\n this.handleTypeAhead(e.key);\n }\n }\n\n /**\n * Subset of `handleKeyDown` that processes the arrow / Home / End /\n * Page-* navigation keys. Returns `true` when a key was handled so\n * the caller can skip the remaining branches.\n *\n * @param e - The keyboard event.\n * @param ctrl - Pre-computed Ctrl-or-Cmd flag.\n *\n * @returns `true` when the key was handled.\n */\n protected handleNavigationKey(e: KeyboardEvent, ctrl: boolean): boolean {\n const navigable = new Set([\n \"ArrowDown\", \"ArrowUp\", \"Home\", \"End\", \"PageDown\", \"PageUp\",\n ]);\n\n if (!navigable.has(e.key)) {\n return false;\n }\n\n e.preventDefault();\n\n const viewportH = this.getHeight() || ROW_HEIGHT_PX;\n const pageSize = Math.max(1, Math.floor(viewportH / ROW_HEIGHT_PX));\n const curr = this._focusedIndex < 0 ? 0 : this._focusedIndex;\n let next: number;\n\n if (e.key === \"ArrowDown\") {\n next = Math.min(curr + 1, this._items.length - 1);\n } else if (e.key === \"ArrowUp\") {\n next = Math.max(curr - 1, 0);\n } else if (e.key === \"PageDown\") {\n next = Math.min(curr + pageSize, this._items.length - 1);\n } else if (e.key === \"PageUp\") {\n next = Math.max(curr - pageSize, 0);\n } else if (e.key === \"Home\") {\n next = 0;\n } else {\n next = this._items.length - 1;\n }\n\n this.moveFocus(next, ctrl, e.shiftKey);\n\n return true;\n }\n\n /**\n * Moves the keyboard focus to `idx`. By default the move also runs\n * the subclass's {@link reduceSelection} so single-select lists track\n * the focus highlight; pass `ctrl: true` to move the focus without\n * touching the selection (the standard \"browse without committing\"\n * gesture). `shift: true` forwards the range-extend hint to the\n * reducer. When the list-wide {@link setSelectFollowsFocus} flag is\n * `false`, the commit branch is suppressed entirely — the focus\n * highlight moves but the selection set is untouched and\n * `notifyUserChange` does not fire.\n *\n * @param idx - The new focus index.\n * @param ctrl - When `true`, skip the selection update.\n * @param shift - When `true`, ask the reducer to extend the\n * selection from `_anchorIndex` to `idx`.\n */\n protected moveFocus(idx: number, ctrl: boolean, shift: boolean): void {\n this._focusedIndex = idx;\n\n const commit = !ctrl && this._selectFollowsFocus;\n\n if (commit) {\n this.reduceSelection(idx, { ctrl: false, shift });\n }\n\n this.refreshRowVisualState();\n this.updateActiveDescendant();\n this.scrollIndexIntoView(idx);\n\n if (commit) {\n this.notifyUserChange();\n }\n }\n\n /**\n * Commits the focused row through {@link reduceSelection}. Mirrors\n * the gesture of clicking that row with the same modifier keys.\n *\n * @param ctrl - Ctrl-or-Cmd modifier flag at the time of the keypress.\n * @param shift - Shift modifier flag at the time of the keypress.\n */\n protected commitFocusedRow(ctrl: boolean, shift: boolean): void {\n if (this._focusedIndex < 0) {\n return;\n }\n\n this.reduceSelection(this._focusedIndex, { ctrl, shift });\n this.refreshRowVisualState();\n this.updateActiveDescendant();\n this.notifyUserChange();\n }\n\n /**\n * Appends `ch` to the type-ahead buffer (after timing out the\n * previous buffer when more than {@link TYPE_AHEAD_TIMEOUT_MS}\n * elapsed since the last key) and jumps the focus to the first item\n * whose lower-cased label starts with the buffer.\n *\n * @param ch - The character key pressed.\n */\n protected handleTypeAhead(ch: string): void {\n const now = Date.now();\n\n if (now - this._typeAheadAt > TYPE_AHEAD_TIMEOUT_MS) {\n this._typeAheadBuf = \"\";\n }\n\n this._typeAheadBuf += ch.toLowerCase();\n this._typeAheadAt = now;\n\n const buf = this._typeAheadBuf;\n const idx = this._items.findIndex(item => item.label.toLowerCase().startsWith(buf));\n\n if (idx < 0) {\n return;\n }\n\n // Type-ahead moves only the focus highlight; selection is\n // unaffected (same behaviour as the native `<select>` it\n // replaces — typing a letter previews the row without\n // committing).\n this._focusedIndex = idx;\n this.refreshRowVisualState();\n this.updateActiveDescendant();\n this.scrollIndexIntoView(idx);\n }\n\n /**\n * Scrolls the inner panel so the row at `idx` is fully visible, with\n * no movement when it already is. Reads / writes the panel's native\n * `scrollTop` directly — the framework's typed scroll setter only\n * lives on the `VirtualScroller`-backed components (`Table.Body`,\n * `Tree`); the `Panel`-with-`autoScroll: \"y\"` surface relies on\n * native browser overflow and exposes no setter.\n *\n * @param idx - The row index to scroll into view.\n */\n protected scrollIndexIntoView(idx: number): void {\n if (idx < 0 || idx >= this._items.length) {\n return;\n }\n\n const panelEl = this._innerPanel.getElement();\n\n if (!panelEl) {\n return;\n }\n\n const metrics = DOM.source.getScrollMetrics(panelEl);\n const top = idx * ROW_HEIGHT_PX;\n const bottom = top + ROW_HEIGHT_PX;\n const scrollTop = metrics.scrollTop;\n const visibleBottom = scrollTop + metrics.clientHeight;\n\n if (top < scrollTop) {\n DOM.sink.apply(panelEl, { scrollTop: top });\n } else if (bottom > visibleBottom) {\n DOM.sink.apply(panelEl, { scrollTop: bottom - metrics.clientHeight });\n }\n }\n}\n\nexport { AbstractSelectableList, SelectableListRow };\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { AbstractSelectableList, AbstractSelectableListOptions, SelectableListItem } from \"~/component/list/AbstractSelectableList.js\";\nimport { callable } from \"~/core/Callable.js\";\n\n/**\n * Construction-time options for {@link List}.\n *\n * @category Components\n */\nexport interface ListOptions extends AbstractSelectableListOptions {\n selectedIndex?: number;\n value?: string;\n selectedItem?: string;\n}\n\n/**\n * A scrollable single-selection list box.\n *\n * Rendered as a `<div role=\"listbox\">` populated with `<div role=\"option\">`\n * rows. Implements [`Bindable<string>`](/api/core/interfaces/Bindable) so it can be plugged into a\n * [`Binding`](/api/core/classes/Binding) directly. Keyboard model mirrors the WAI-ARIA listbox\n * pattern: ArrowUp/Down moves and selects, Home/End jump to the\n * extremes, PageUp/Down jump by viewport-row count, Enter / Space\n * commits the focused row, and printable characters drive a 700ms\n * type-ahead search.\n *\n * @category Components\n */\nclass List extends AbstractSelectableList<string, ListOptions> {\n\n /**\n * @param options - Optional. Construction-time options applied to\n * the list.\n */\n constructor(options?: ListOptions) {\n super(options);\n\n // Late-built state: `selectedIndex` / `value` / `selectedItem`\n // were written pure to `_options` by the super-time cascade.\n // Dispatch them now that the row pool and selection set exist\n // (`super()` already populated `_items` from `items` / `store`,\n // and applied `enabled` / `readOnly`).\n if (this._options.selectedIndex !== undefined) {\n this.setSelectedIndex(this._options.selectedIndex, false);\n }\n\n if (this._options.value !== undefined) {\n this.setValue(this._options.value);\n }\n\n if (this._options.selectedItem !== undefined) {\n this.setValue(this._options.selectedItem);\n }\n }\n\n /**\n * Applies a {@link ListOptions} bag. Single-select state fields are\n * written pure into `_options` here and dispatched from the constructor\n * body after the row pool is built.\n *\n * @param options - The options bag carrying the values to apply.\n *\n * @returns This component, for method chaining.\n */\n protected applyOptions(options: ListOptions): this {\n super.applyOptions(options);\n\n if (options.selectedIndex !== undefined) this._options.selectedIndex = options.selectedIndex;\n if (options.value !== undefined) this._options.value = options.value;\n if (options.selectedItem !== undefined) this._options.selectedItem = options.selectedItem;\n\n return this;\n }\n\n /**\n * Pushes pre-formed {@link SelectableListItem} pairs into the list,\n * bypassing the auto-keying that {@link setItems} applies to a\n * label-only array. Intended for hosts that already own typed\n * `{key, label}` data (e.g. the [`ComboBox`](/api/component/input/classes/ComboBox)\n * dropdown forwarding its item array). Selection and focus are\n * reset; the row pool is reconciled against the new length.\n *\n * @param items - The pre-formed item pairs, in display order.\n *\n * @returns This component, for method chaining.\n */\n setItemsArray(items: Array<SelectableListItem>): this {\n return super.setItemsArray(items);\n }\n\n /**\n * Selects the row whose `key` matches `value`. No-op when the value\n * doesn't appear in the current item set — same behaviour the prior\n * native `<select>` had when assigned an unknown `value`.\n *\n * @param value - The row key to select.\n *\n * @returns This component, for method chaining.\n */\n setValue(value: string): this {\n const idx = this._items.findIndex(item => item.key === value);\n\n this.setSelectedIndex(idx, false);\n\n return this;\n }\n\n /**\n * Returns the key of the currently selected row.\n *\n * @returns The selected row's key, or an empty string when nothing\n * is selected.\n */\n getValue(): string {\n const idx = this.getSelectedIndex();\n\n if (idx < 0 || idx >= this._items.length) {\n return \"\";\n }\n\n return this._items[idx].key;\n }\n\n /**\n * Reduces a click / keyboard gesture into the single-select shape:\n * the modifier keys are ignored, the selection becomes exactly\n * `{idx}`, and the anchor / focus collapse to the clicked row.\n *\n * @param idx - The row index the gesture targeted.\n * @param _ev - Ignored; single-select doesn't branch on modifier keys.\n */\n protected reduceSelection(idx: number, _ev: { ctrl: boolean, shift: boolean }): void {\n this._selectedSet.clear();\n this._selectedSet.add(idx);\n this._anchorIndex = idx;\n this._focusedIndex = idx;\n }\n\n /**\n * User-driven selection commit. Mirrors the prior native `<select>`\n * `change` event semantics — fired from the click / keyboard\n * reducers, not from programmatic `setValue` / `setSelectedIndex(idx,\n * false)`.\n */\n protected notifyUserChange(): void {\n this.fireChange();\n }\n\n}\n\nconst ListCallable = callable(List);\ntype ListCallable = List;\nexport {\n List as _List,\n ListCallable as List,\n};\n"],"mappings":"ocAgCA,IAAsB,iBAAtB,cAA+C,CAAU,CAErD,aAAc,CACV,MAAM,CACV,CA+BA,iBAA0B,CACtB,MAAO,EACX,CAsBJ,EC3DM,sBAAN,cAAoC,gBAAiB,CAEjD,OAOA,UAA6B,GAM7B,aAAc,CACV,MAAM,EACN,KAAK,YAAY,EAEjB,KAAK,OAAS,IAAI,EAClB,KAAK,OAAO,YAAY,EACxB,KAAK,OAAO,eAAe,EAAK,CACpC,CAQA,UAAiB,CACb,OAAO,KAAK,MAChB,CAOA,OAAO,EAAsC,CACzC,KAAK,OAAO,QAAQ,EAAQ,KAAK,KAAK,EACtC,KAAK,UAAY,EACrB,CAQA,iBAA0B,CAMtB,MALA,CAEI,KAAK,aADL,KAAK,OAAO,QAAQ,EACH,IAGd,KAAK,OAAO,iBAAiB,CAAC,EAAE,OAAS,CACpD,CAeA,eAAe,EAAe,EAAsB,CAChD,IAAM,EAAM,KAAK,iBAAiB,GAAK,CAAE,EAAG,EAAG,EAAG,EAAG,QAAO,QAAO,EAEnE,KAAK,OAAO,mBAAmB,EAAK,EACpC,KAAK,OAAO,KAAK,EAAI,CAAC,EACtB,KAAK,OAAO,KAAK,EAAI,CAAC,EACtB,KAAK,OAAO,SAAS,EAAI,KAAK,EAC9B,KAAK,OAAO,UAAU,EAAI,MAAM,EAChC,KAAK,OAAO,cAAc,EAAI,MAAM,EACpC,KAAK,OAAO,mBAAmB,EAAI,CACvC,CAUA,KAAe,EAAwB,CACnC,MAAM,KAAK,CAAO,EAElB,IAAM,EAAK,GAAW,KAAK,WAAW,EAOtC,OANK,GAIL,EAAI,KAAK,YAAY,EAAI,KAAK,OAAO,WAAW,EAAI,CAAE,EAH3C,IAMf,CACJ,EAEM,EAAgC,EAAS,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,iBAAiB,EAAK,EAAK,EAEzB,IACX,CAQA,UAAmB,CACf,IAAM,EAAM,KAAK,iBAAiB,EAMlC,OAJI,EAAM,GAAK,GAAO,KAAK,OAAO,OACvB,GAGJ,KAAK,OAAO,EAAI,CAAC,GAC5B,CAUA,gBAA0B,EAAa,EAA8C,CACjF,KAAK,aAAa,MAAM,EACxB,KAAK,aAAa,IAAI,CAAG,EACzB,KAAK,aAAgB,EACrB,KAAK,cAAgB,CACzB,CAQA,kBAAmC,CAC/B,KAAK,WAAW,CACpB,CAEJ,EAEM,EAAe,EAAS,IAAI"}
|
|
1
|
+
{"version":3,"file":"List-BPd-IXZR.js","names":[],"sources":["../../src/typescript/lib/component/list/ListItemRenderer.ts","../../src/typescript/lib/component/list/renderer/Label.ts","../../src/typescript/lib/component/list/AbstractSelectableList.ts","../../src/typescript/lib/component/list/List.ts"],"sourcesContent":["// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { Component } from \"~/core/Component.js\";\nimport { ListItemRenderContext } from \"~/component/list/ListItemRenderContext.js\";\n\n/**\n * Abstract base class for list item renderers.\n *\n * @remarks\n * A `ListItemRenderer` owns the content of a single list row — the label, and\n * optionally an icon or other affordance. The owning\n * [`List`](/api/component/list/classes/List) /\n * [`MultiSelectList`](/api/component/list/classes/MultiSelectList) holds a\n * renderer factory; each pooled row calls that factory once at construction and\n * rebinds via {@link update} when the row is remapped to a different item. The\n * collapsed [`ComboBox`](/api/component/input/classes/ComboBox) control hosts\n * one renderer built from the same factory, so the selected entry renders on\n * the closed control exactly as it does in the open dropdown.\n *\n * Selection / focus / hover chrome is applied by the list on the row element\n * directly and never reaches the renderer.\n *\n * Subclasses implement {@link update} and {@link layoutChildren}. See\n * [`LabelListItemRenderer`](/api/component/list/classes/LabelListItemRenderer)\n * for the canonical default. {@link getContentWidth} is optional: it is read\n * only by a list running with `horizontalScrolling` on, and the base\n * implementation already reports \"no intrinsic width\".\n *\n * Not wrapped with `callable()` — abstract classes are never instantiated.\n *\n * @category Components\n */\nexport abstract class ListItemRenderer extends Component {\n\n constructor() {\n super();\n }\n\n /**\n * Rebinds this renderer to new item data.\n *\n * @param context - The bound-item state for this render pass.\n *\n * @remarks Called every time the owning row (or collapsed control) is\n * mapped to a different item.\n */\n abstract update(context: ListItemRenderContext): void;\n\n /**\n * Returns the natural width of the currently bound content — the width at\n * which it renders without clipping.\n *\n * Read only by a list running with\n * [`horizontalScrolling`](/api/component/list/classes/List#sethorizontalscrolling)\n * on, which sizes every row to the widest value across the bound items so\n * over-long content scrolls into view instead of ellipsising. A list with\n * horizontal scrolling off — the default — never calls this, so a renderer\n * that measures lazily pays nothing for it.\n *\n * The base implementation returns 0, meaning \"no intrinsic width\": rows\n * stay at the viewport width and never extend the horizontal scroll extent.\n * That keeps a custom renderer written against the previous contract\n * working unchanged; override it to opt that renderer into horizontal\n * scrolling.\n *\n * @returns The bound content's natural width in pixels, or 0 when unknown.\n */\n getContentWidth(): number {\n return 0;\n }\n\n /**\n * Positions this renderer's internal children inside its content box.\n *\n * @param width - The horizontal extent of the renderer in pixels.\n * @param height - The vertical extent of the renderer in pixels.\n *\n * @remarks Called by the owning row after the renderer's own size has been\n * set via `setX` / `setY` / `setWidth` / `setHeight`.\n *\n * The `width` and `height` arguments are this renderer's **outer** box, so\n * an implementation must not place children against them directly: take the\n * rectangle from [`getContentBounds()`](/api/core/classes/Component), which\n * subtracts any border and padding the renderer carries, and fall back to\n * the arguments only when it returns `null` (no element yet). A child's\n * containing block is already this renderer's padding box, so one placed\n * at `(0, 0)` sized to `width` / `height` starts inside the border and\n * overruns the opposite edge by its width, where the `overflow: hidden`\n * every component carries clips it.\n */\n abstract layoutChildren(width: number, height: number): void;\n}\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { DOM } from \"~/core/DOM.js\";\nimport type { Handle } from \"~/core/DOM.js\";\nimport { Text } from \"~/component/input/Text.js\";\nimport { ListItemRenderer } from \"~/component/list/ListItemRenderer.js\";\nimport { ListItemRenderContext } from \"~/component/list/ListItemRenderContext.js\";\nimport { callable } from \"~/core/Callable.js\";\n\n/**\n * The default [`ListItemRenderer`](/api/component/list/classes/ListItemRenderer) —\n * a single [`Text`](/api/component/input/classes/Text) child carrying the\n * item's label.\n *\n * @remarks\n * Used as the implicit factory by [`List`](/api/component/list/classes/List) /\n * [`MultiSelectList`](/api/component/list/classes/MultiSelectList) and the\n * collapsed [`ComboBox`](/api/component/input/classes/ComboBox) control when no\n * custom renderer is set. The label keeps `Text`'s default `truncate: true`, so\n * a label wider than its row clips with an ellipsis — reproducing the row\n * chrome the list carried before renderers existed. The label is sized to fill\n * the row in {@link layoutChildren} rather than to its natural width: the row\n * is never narrower than {@link getContentWidth}, so filling it lets the\n * selection wash span the whole row without clipping the text.\n *\n * @example\n * ```typescript\n * list.setRendererFactory(() => new LabelListItemRenderer());\n * ```\n *\n * @category Components\n */\nclass LabelListItemRenderer extends ListItemRenderer {\n\n private _label: Text;\n /**\n * Whether `_label`'s cached natural width matches the bound text. The label\n * runs with `autoMeasure(false)`, so the measure is driven from\n * {@link getContentWidth} rather than {@link update} — a list with\n * horizontal scrolling off never asks, and so never pays for it.\n */\n private _measured: boolean = false;\n\n /**\n * Constructs a label renderer with an empty text node. The label is\n * populated on the first {@link update} call.\n */\n constructor() {\n super();\n this.clearInsets();\n\n this._label = new Text();\n this._label.clearInsets();\n this._label.setAutoMeasure(false);\n }\n\n /**\n * Returns the underlying label component so consumers can tweak font /\n * colour properties at construction time.\n *\n * @returns The internal [`Text`](/api/component/input/classes/Text) instance.\n */\n getLabel(): Text {\n return this._label;\n }\n\n /**\n * Updates the rendered label text.\n *\n * @param context - The bound-item state for this render pass.\n */\n update(context: ListItemRenderContext): void {\n this._label.setText(context.item.label);\n this._measured = false;\n }\n\n /**\n * Returns the natural width of the bound label, measuring it on first ask\n * after each {@link update}.\n *\n * @returns The label's natural width in pixels.\n */\n getContentWidth(): number {\n if (!this._measured) {\n this._label.measure();\n this._measured = true;\n }\n\n return this._label.getPreferredSize()?.width ?? 0;\n }\n\n /**\n * Sizes the label to fill the renderer's allocated box and centres its\n * line-box vertically by matching `line-height` to the row height.\n *\n * The label goes inside this renderer's content box, so a border or padding\n * on the renderer shrinks it rather than being painted over.\n *\n * @param width - The horizontal extent of the row in pixels. Used only\n * while the renderer has no element yet and the content box is\n * unavailable.\n * @param height - The vertical extent of the row in pixels, used under the\n * same condition as `width`.\n */\n layoutChildren(width: number, height: number): void {\n const box = this.getContentBounds() ?? { x: 0, y: 0, width, height };\n\n this._label.setAutoCommitStyle(false);\n this._label.setX(box.x);\n this._label.setY(box.y);\n this._label.setWidth(box.width);\n this._label.setHeight(box.height);\n this._label.setLineHeight(box.height);\n this._label.setAutoCommitStyle(true);\n }\n\n /**\n * Appends the label sub-component element to the renderer's DOM element.\n *\n * @param element - Optional element passed by the rendering pipeline; falls\n * back to getElement().\n *\n * @returns This renderer, for method chaining.\n */\n protected init(element?: Handle): this {\n super.init(element);\n\n const el = element || this.getElement();\n if (!el) {\n return this;\n }\n\n DOM.sink.appendChild(el, this._label.getElement(true)!);\n\n return this;\n }\n}\n\nconst LabelListItemRendererCallable = callable(LabelListItemRenderer);\ntype LabelListItemRendererCallable = LabelListItemRenderer;\nexport {\n LabelListItemRenderer as _LabelListItemRenderer,\n LabelListItemRendererCallable as LabelListItemRenderer,\n};\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { AbstractInput, AbstractInputOptions } from \"~/component/input/AbstractInput.js\";\nimport { Component } from \"~/core/Component.js\";\nimport { DOM } from \"~/core/DOM.js\";\nimport type { Handle } from \"~/core/DOM.js\";\nimport { Panel } from \"~/core/Panel.js\";\nimport { StyleRule } from \"~/core/StyleTarget.js\";\nimport { Event } from \"~/core/Event.js\";\nimport { ListenerBag } from \"~/core/ListenerBag.js\";\nimport { Tooltip } from \"~/overlay/Tooltip.js\";\nimport { Type } from \"~/core/Type.js\";\nimport { Insets } from \"~/primitive/Insets.js\";\nimport { Fit } from \"~/layout/Fit.js\";\nimport { _VBox } from \"~/layout/VBox.js\";\nimport { Size } from \"~/primitive/Size.js\";\nimport { AbstractStore } from \"~/data/AbstractStore.js\";\nimport { ModelRecord } from \"~/data/ModelRecord.js\";\nimport { ListItemRenderer } from \"~/component/list/ListItemRenderer.js\";\nimport { LabelListItemRenderer } from \"~/component/list/renderer/Label.js\";\nimport { COMPONENT_CLASS } from \"~/core/ClassStyleRules.js\";\nimport { Text } from \"~/component/input/Text.js\";\n\n/**\n * One entry in a [`List`](/api/component/list/classes/List) /\n * [`MultiSelectList`](/api/component/list/classes/MultiSelectList) item\n * array. Plain data — the row pool is the view layer.\n *\n * @category Components\n */\nexport interface SelectableListItem {\n /** Binding identifier — what `getValue` / `setValue` round-trip. */\n key: string;\n /** Display text rendered in the row. */\n label: string;\n /**\n * Optional registry glyph name, read by\n * [`GlyphListItemRenderer`](/api/component/list/classes/GlyphListItemRenderer)\n * to paint an icon beside the label. Ignored by the default label\n * renderer. Array-supplied items carry it directly; store-bound items\n * resolve it from the record field named by the list's `glyphField`.\n */\n glyph?: string;\n /**\n * Optional hover-tooltip text for the row, shown after the standard hover\n * delay via [`Tooltip`](/api/overlay/classes/Tooltip). Lets a host surface\n * the full value behind a truncated label without reaching into the row DOM.\n * Array-supplied items carry it directly; store-bound items resolve it from\n * the record field named by the list's `tooltipField`.\n */\n tooltip?: string;\n}\n\n/**\n * Accepted form for a single item passed to a custom list's `setItems` /\n * `addItem`: either a plain string (which becomes both the item's key and its\n * label, so a selection is written and read back as the string itself) or a\n * pre-formed {@link SelectableListItem} with an explicit caller-supplied key.\n *\n * @category Components\n */\nexport type SelectableListItemSpec = String | SelectableListItem;\n\n/**\n * Pixel height of one rendered row. Matches `SelectableListRow`'s cached\n * `preferredSize(0, 22)` and the `lineHeight: 22px` declaration in the\n * shared `.SelectableListRow` class rule. Keep these three values in lockstep\n * if the row chrome changes — keyboard `PageUp`/`PageDown` derives its\n * page size from this constant divided into the visible viewport height.\n */\nconst ROW_HEIGHT_PX = 22;\n\n/**\n * Horizontal padding on each side of a row, between the row edge and its\n * renderer. Read by {@link SelectableListRow.publishContentWidth} to convert a\n * renderer's content width into the row's own natural width, so keep it in step\n * with the row's `setPadding` call.\n */\nconst ROW_PADDING_X_PX = 8;\n\n/**\n * Maximum time (in milliseconds) between successive printable-character\n * keypresses before the type-ahead search buffer resets. Picked to match\n * the native `<select>` type-ahead window the custom list replaces — a\n * burst of letters within this window builds a single search prefix; a\n * pause longer than this starts a fresh search.\n */\nconst TYPE_AHEAD_TIMEOUT_MS = 700;\n\n/**\n * Construction-time options for {@link AbstractSelectableList}.\n *\n * @category Components\n */\nexport interface AbstractSelectableListOptions extends AbstractInputOptions {\n items?: String | Array<String>;\n store?: AbstractStore;\n displayField?: string;\n valueField?: string;\n /**\n * Record field whose value becomes each store-bound item's `glyph`, read\n * by [`GlyphListItemRenderer`](/api/component/list/classes/GlyphListItemRenderer).\n * Array-supplied items carry their glyph on the item instead.\n */\n glyphField?: string;\n /**\n * Record field whose value becomes each store-bound item's `tooltip` (the\n * hover text). Array-supplied items carry their tooltip on the item instead.\n */\n tooltipField?: string;\n /**\n * Zero-argument factory producing the renderer for each row. Defaults to a\n * label renderer reproducing the plain-text rows. Supply\n * `() => new GlyphListItemRenderer()` to paint each item's `glyph` beside\n * its label.\n */\n rendererFactory?: () => ListItemRenderer;\n /**\n * Construction-time listener bag — the declarative form of `on()`. Adds the\n * list's `action` shorthand to the inherited `change` / `binding`.\n */\n listeners?: {\n action?: () => void;\n change?: (value: any) => void;\n binding?: () => void;\n };\n /**\n * Muted placeholder text shown inside the scroll area when the list is\n * empty. Opt-in: with neither `emptyText` nor `emptyComponent` set, an empty\n * list has no placeholder child.\n */\n emptyText?: string;\n /**\n * Factory for a custom empty-state placeholder, shown inside the scroll area\n * when the list is empty. Takes precedence over `emptyText`. The returned\n * component should report an unbounded max (the `Component` default) so the\n * empty list still fills its region and drag-resizes.\n */\n emptyComponent?: () => Component;\n /**\n * Construction-time shortcut for\n * [`setHorizontalScrolling`](/api/component/list/classes/List#sethorizontalscrolling).\n * Defaults to `false` — a label wider than the row ellipsises.\n */\n horizontalScrolling?: boolean;\n}\n\n/**\n * Shared visual defaults for every {@link AbstractSelectableList} subclass.\n * Layered into the defaults bag passed to `super` from the abstract\n * constructor so {@link List} and {@link MultiSelectList} share row\n * chrome without duplicating the bag at every leaf.\n */\nconst _defaultAbstractSelectableListOptions: Partial<AbstractSelectableListOptions> = {\n tag: \"div\",\n backgroundColor: \"var(--ts-ui-list-bg, rgb(255, 255, 255))\",\n foregroundColor: \"var(--ts-ui-text-color, black)\",\n border: \"1px solid var(--ts-ui-list-border, rgb(200, 200, 200))\",\n borderRadius: \"var(--ts-ui-border-radius, 4px)\",\n preferredSize: { width: 200, height: 200 },\n maxSize: { width: Number.MAX_SAFE_INTEGER, height: Number.MAX_SAFE_INTEGER },\n};\n\n/**\n * Static styling registered once at module init. The container surface\n * carries the focus ring (matched against the framework auto-added\n * `.List` / `.MultiSelectList` classes that `Component.init()` derives\n * from `constructor.name`); `.SelectableListRow` carries the row chrome\n * (single-line text with ellipsis truncation); the row's theme-controlled\n * separator is a real border set through `setBorder` in the row constructor,\n * not a class rule, so the framework's box math can see it. The\n * `.selected` / `.focused` modifier classes layer the\n * selection wash and keyboard-focus outline on top.\n *\n * The `:focus` ring is attached via a compound selector covering both\n * concrete subclass names rather than the abstract base — TypeScript\n * `class.constructor.name` is the leaf class, so the framework adds\n * `\"List\"` / `\"MultiSelectList\"` (not `\"AbstractSelectableList\"`) to the\n * surface's classList. Keep this list in sync if a new concrete\n * subclass extends `AbstractSelectableList`.\n */\n(() => {\n new StyleRule({\n scope: \"selector\",\n name: \".List, .MultiSelectList\",\n styles: {\n userSelect: \"none\",\n outline: \"none\",\n },\n });\n\n // Pseudo-element overlay rather than a plain `outline:` rule so an\n // ancestor with `overflow: hidden` (the framework's Component default)\n // can't clip the focus indicator. `z-index: 1` lifts the ring above the\n // absolutely-positioned rows.\n new StyleRule({\n scope: \"selector\",\n name: \".List:focus::after, .MultiSelectList:focus::after\",\n styles: {\n content: \"''\",\n position: \"absolute\",\n inset: \"0\",\n border: \"2px solid var(--ts-ui-indicator-focus, rgb(30, 100, 200))\",\n borderRadius: \"inherit\",\n boxSizing: \"border-box\",\n pointerEvents: \"none\",\n zIndex: \"1\",\n },\n });\n\n // `lineHeight: 22px` centers the single line of label text vertically\n // without `display: flex` — matches `ROW_HEIGHT_PX` and the row's\n // cached `preferredSize(0, 22)`. The whiteSpace/overflow/textOverflow\n // trio truncates long labels with an ellipsis when the row is narrower\n // than the label text.\n new StyleRule({\n scope: \"class\",\n name: \"SelectableListRow\",\n styles: {\n lineHeight: \"22px\",\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n cursor: \"pointer\",\n },\n });\n\n new StyleRule({\n scope: \"selector\",\n name: \".SelectableListRow:hover\",\n styles: {\n backgroundColor: \"var(--ts-ui-list-row-hover-bg, rgba(30, 100, 200, 0.08))\",\n },\n });\n\n new StyleRule({\n scope: \"selector\",\n name: \".SelectableListRow.selected\",\n styles: {\n backgroundColor: \"var(--ts-ui-list-row-selected-bg, rgba(30, 100, 200, 0.18))\",\n color: \"var(--ts-ui-list-row-selected-color, inherit)\",\n },\n });\n\n // The keyboard-focused row is part of the *selection* indicator family\n // (a light per-row mark, distinct from the heavier focus border around\n // the focusable list root itself). Uses the dashed `indicator.selection`\n // shorthand so future themes can re-skin every \"selection mark\" in one\n // place. Rows have no positioned descendants, so the outline draws on\n // top of the row's text without any covering issue.\n new StyleRule({\n scope: \"selector\",\n name: \".SelectableListRow.focused\",\n styles: {\n outline: \"var(--ts-ui-indicator-selection, 1px dashed rgb(120, 170, 240))\",\n },\n });\n})();\n\n/**\n * A single row inside an {@link AbstractSelectableList}. Holds the static\n * row styling via the `.SelectableListRow` / `.SelectableListRow:hover` /\n * `.SelectableListRow.selected` / `.SelectableListRow.focused` class rules —\n * except the bottom separator, which is a real border set in the constructor so\n * it is measurable — and exposes typed setters for the label, the pool index,\n * the selected flag, and the focused flag.\n *\n * Internal — not re-exported from the per-subpath barrel; the public\n * surface lives on `List` / `MultiSelectList`.\n */\nclass SelectableListRow extends Component {\n // Cached so setter calls made before the element renders survive to\n // be applied at render time.\n private _selected: boolean = false;\n private _focused: boolean = false;\n /** Zero-based index in the row pool; forwarded to the handlers on a gesture. */\n private _index: number;\n /** Owner-supplied gesture handlers, each invoked with this row's `_index`. */\n private readonly _handlers: RowHandlers;\n /** Whether a tooltip is currently attached, so `updateItem` can detach it. */\n private _tooltipAttached: boolean = false;\n /**\n * The renderer owning this row's content (label, optional glyph). Built\n * from the owning list's factory, appended straight into the row DOM in\n * {@link init}, and positioned from {@link doLayout}. Rendered\n * `pointer-events: none` so a click on the label falls through to the\n * row element, whose exact-target `click` listener drives selection.\n */\n private _renderer: ListItemRenderer;\n\n /**\n * @param handlers - Owner-supplied gesture callbacks (click, contextmenu,\n * dblclick), each invoked with the row's index and the raw mouse event.\n * @param index - Initial pool index.\n * @param rendererFactory - Zero-argument factory producing this row's\n * content renderer.\n */\n constructor(handlers: RowHandlers, index: number, rendererFactory: () => ListItemRenderer) {\n super({ tag: \"div\" });\n\n this._handlers = handlers;\n this._index = index;\n this._renderer = rendererFactory();\n this._renderer.setPointerEvents(\"none\");\n\n this.getAria().setRole(\"option\");\n this.setPreferredSize({ width: 0, height: ROW_HEIGHT_PX });\n // Do NOT cap the row's max height. A finite per-row height max makes the\n // list's VBox sum to a finite content max (VBox.aggregateMaxSize), which\n // shrink-wraps the whole list to its content and breaks stretch/scroll\n // and the accordion's resizable drag. The row is already pinned to\n // ROW_HEIGHT_PX by its preferredSize above; leave its max unbounded (the\n // Component default).\n this.setPadding(new Insets(0, ROW_PADDING_X_PX, 0, ROW_PADDING_X_PX));\n // Declared through the typed setter rather than the shared class rule so\n // getBorderSize() sees the 1px the separator takes out of the row's\n // content box; a class-rule border is invisible to the framework's box\n // math, and the renderer would be sized a pixel too tall and clipped.\n this.setBorder({ borderBottom: \"1px solid var(--ts-ui-list-row-separator, transparent)\" });\n // Component's framework default writes `cursor: default` as an\n // inline style, which would beat the `.SelectableListRow` class rule\n // — set the inline cursor explicitly so rows show the hand\n // cursor on hover.\n this.setCursor(\"pointer\");\n\n Event.addListener(this, \"pointerdown\", this.onPointerDown);\n Event.addListener(this, \"click\", this.onClick);\n Event.addListener(this, \"contextmenu\", this.onContextMenu);\n Event.addListener(this, \"dblclick\", this.onDblClick);\n }\n\n /**\n * Rebinds this row's renderer to a new item, replacing the plain-text\n * label write the pool sync used before renderers existed.\n *\n * @param item - The item to display.\n * @param index - The item's zero-based index.\n *\n * @returns This row, for method chaining.\n */\n updateItem(item: SelectableListItem, index: number): this {\n this._renderer.update({ item, index });\n this.applyTooltip(item.tooltip);\n\n return this;\n }\n\n /**\n * Attaches (or detaches) the row's hover tooltip to match the item. Called\n * from {@link updateItem} so a pooled row reused for a different item tracks\n * the new item's `tooltip` — attaching when set, detaching when cleared.\n *\n * @param text - The item's tooltip text, or `undefined` for no tooltip.\n */\n private applyTooltip(text: string | undefined): void {\n if (text) {\n // Tooltip.attach replaces any prior attachment, so re-attaching with\n // new text on pool reuse is safe. The renderer is pointer-events:none,\n // so hover events target the row element and the component-level\n // attach matches (no need to reach the label child).\n Tooltip.attach(this, text);\n this._tooltipAttached = true;\n } else if (this._tooltipAttached) {\n Tooltip.detach(this);\n this._tooltipAttached = false;\n }\n }\n\n /**\n * Returns the row's natural width — its renderer's content width plus the\n * row's own horizontal padding — i.e. the width at which the bound item\n * renders without clipping.\n *\n * Read by {@link ListRowColumn.computeTotalMinSize}, and only while the\n * owning list scrolls horizontally, so a list with the setting off never\n * calls this and never makes its renderers measure.\n *\n * Deliberately *not* published as the row's `minSize`: a minimum is a\n * constraint that propagates outward (`VBox.getMinSize` → the inner\n * `Panel` → the list's `Fit` → `Component.clampWidth`), so a wide row would\n * inflate the whole `List` element inside its host rather than scroll\n * within it. The natural width is an input to the column's own overflow\n * inflation only.\n *\n * @returns The row's natural width in pixels.\n */\n getNaturalWidth(): number {\n return this._renderer.getContentWidth() + ROW_PADDING_X_PX * 2;\n }\n\n /**\n * Swaps in a new content renderer, removing the old renderer's element\n * and appending the new one. Used when the owning list's renderer factory\n * changes. The new renderer is left blank until the next\n * {@link updateItem}.\n *\n * @param renderer - The replacement renderer.\n *\n * @returns This row, for method chaining.\n */\n setRenderer(renderer: ListItemRenderer): this {\n const el = this.getElement();\n\n if (el) {\n const oldEl = this._renderer.getElement();\n if (oldEl && DOM.source.getParentNode(oldEl) === el) {\n DOM.sink.removeChild(el, oldEl);\n }\n }\n\n this._renderer = renderer;\n this._renderer.setPointerEvents(\"none\");\n\n if (el) {\n DOM.sink.appendChild(el, this._renderer.getElement(true)!);\n }\n\n return this;\n }\n\n /**\n * Updates the index this row reports through its click callback. Used\n * when the row pool is reconciled against a new item list and an\n * existing row is reused at a new position.\n *\n * @param index - The new zero-based row index.\n *\n * @returns This row, for method chaining.\n */\n setIndex(index: number): this {\n this._index = index;\n\n return this;\n }\n\n /**\n * Returns the row's current pool index.\n *\n * @returns The zero-based index.\n */\n getIndex(): number {\n return this._index;\n }\n\n /**\n * Toggles the `.selected` class and `aria-selected` to reflect\n * membership in the owning list's selection set.\n *\n * @param value - `true` when this row is currently selected.\n *\n * @returns This row, for method chaining.\n */\n setSelected(value: boolean): this {\n this._selected = value;\n this.getAria().setSelected(value);\n this.applyRowClass();\n\n return this;\n }\n\n /**\n * Returns the cached selected state.\n *\n * @returns `true` when this row is currently selected.\n */\n isSelected(): boolean {\n return this._selected;\n }\n\n /**\n * Toggles the `.focused` class to reflect the keyboard-focus position\n * inside the owning list.\n *\n * @param value - `true` when this row currently holds the keyboard\n * focus position.\n *\n * @returns This row, for method chaining.\n */\n setFocused(value: boolean): this {\n this._focused = value;\n this.applyRowClass();\n\n return this;\n }\n\n /**\n * Returns the cached focused state.\n *\n * @returns `true` when this row holds the keyboard-focus position.\n */\n isFocused(): boolean {\n return this._focused;\n }\n\n /**\n * Renders the row's `<div>` with its current class set. The label content\n * lives in the renderer child, appended by {@link init}.\n *\n * @returns The created element handle.\n */\n protected render(): Handle {\n const element = super.render();\n this.applyRowClass();\n\n return element;\n }\n\n /**\n * Appends the renderer's element to the row DOM. The renderer's own\n * children (label, optional glyph) are appended by the renderer's `init`.\n *\n * @param element - Optional element passed by the rendering pipeline;\n * falls back to getElement().\n *\n * @returns This row, for method chaining.\n */\n protected init(element?: Handle): this {\n super.init(element);\n\n const el = element || this.getElement();\n if (el) {\n DOM.sink.appendChild(el, this._renderer.getElement(true)!);\n }\n\n return this;\n }\n\n /**\n * Positions the renderer to fill the row's content box, then lets it lay\n * out its own children. Only writes setters (no geometry reads), so it is\n * safe under the `commitBounds` auto-commit path that drives it.\n *\n * @returns This row, for method chaining.\n */\n doLayout(): this {\n super.doLayout();\n\n const box = this.getContentBounds();\n if (!box) {\n return this;\n }\n\n this._renderer.setAutoCommitStyle(false);\n this._renderer.setX(box.x);\n this._renderer.setY(box.y);\n this._renderer.setWidth(box.width);\n this._renderer.setHeight(box.height);\n this._renderer.setAutoCommitStyle(true);\n\n this._renderer.layoutChildren(box.width, box.height);\n\n return this;\n }\n\n /**\n * Computes the row's class list from the cached selected/focused\n * state. Writes via `setElementAttribute(\"class\", …)` so the framework\n * defer-write seam owns the DOM write.\n *\n * The write replaces the whole `class` attribute, so it must re-state the\n * framework `COMPONENT_CLASS` that `Component.init` adds — otherwise a\n * post-init rewrite (a selection change) drops it, and with it the\n * `:where(.ts-ui-component)` rule that supplies `position: absolute`,\n * collapsing every row to `top: auto` so they stack on top of each other.\n */\n private applyRowClass(): void {\n const classes = [COMPONENT_CLASS, \"SelectableListRow\"];\n\n if (this._selected) {\n classes.push(\"selected\");\n }\n\n if (this._focused) {\n classes.push(\"focused\");\n }\n\n this.setElementAttribute(\"class\", classes.join(\" \"));\n }\n\n /**\n * Suppresses focus loss when the row is pointed at. Without this,\n * clicking a row while the list root has focus would blur the list,\n * and the keyboard model would lose its focus position before the\n * click handler runs. The same pattern guards the AutoComplete row\n * pool against blurring the host input on click.\n *\n * @param e - The pointerdown event.\n */\n private onPointerDown(e: PointerEvent): void {\n e.preventDefault();\n }\n\n /**\n * Forwards the row's index and the raw mouse event to the owner-supplied\n * click callback.\n *\n * @param e - The click event.\n */\n private onClick(e: MouseEvent): void {\n this._handlers.onClick(this._index, e);\n }\n\n /**\n * Forwards the row's index and the raw mouse event to the owner-supplied\n * context-menu callback.\n *\n * @param e - The contextmenu event.\n */\n private onContextMenu(e: MouseEvent): void {\n this._handlers.onContextMenu(this._index, e);\n }\n\n /**\n * Forwards the row's index and the raw mouse event to the owner-supplied\n * double-click callback.\n *\n * @param e - The dblclick event.\n */\n private onDblClick(e: MouseEvent): void {\n this._handlers.onDblClick(this._index, e);\n }\n}\n\n/**\n * The row stack inside a list's scroll panel: a `VBox` that additionally knows\n * how wide its rows want to be.\n *\n * Exists for one reason — the framework's cross-axis overflow inflation reads\n * the children's *minimum* width (`LayoutManager.inflateForOverflow` →\n * {@link computeTotalMinSize}), but a row's natural width must not become a\n * minimum. A minimum propagates outward — `VBox.getMinSize` → the scroll\n * `Panel` → the list's `Fit` → `Component.clampWidth` — and would inflate the\n * `List` element itself inside its host, so a long label would widen the whole\n * rail instead of scrolling inside it.\n *\n * Overriding `computeTotalMinSize` alone separates the two: the inflation\n * target picks up the widest row's natural width, while `getMinSize` (untouched\n * from `VBox`) keeps reporting the rows' real minimum of zero. So the column\n * lays out wide and scrolls, and nothing outside the scroll panel ever learns\n * of the content's width.\n *\n * Inert unless the host has opted into horizontal overflow — `inflateForOverflow`\n * ignores an axis the host does not scroll, so with `horizontalScrolling` off\n * this behaves exactly as a plain `VBox` and never measures a renderer.\n */\nclass ListRowColumn extends _VBox {\n\n /**\n * Widens the inflation target to the widest row's natural width, so a list\n * scrolling horizontally lays its rows out at full content width.\n *\n * @returns The children's combined min size, with the width raised to the\n * widest row's natural width.\n */\n protected computeTotalMinSize(): Size {\n const total = super.computeTotalMinSize();\n const container = this.getContainer();\n\n // Only the X-overflow path consumes the width, and the scan below makes\n // every row measure its renderer — so skip it whenever the host isn't\n // scrolling X. Not merely an optimisation: a list has always scrolled Y,\n // so `inflateForOverflow` calls this on every layout of every list, and\n // an ungated scan would put a per-row text measure into all of them.\n if (!container || !this.isOverflowingX()) {\n return total;\n }\n\n let natural = 0;\n\n for (const component of container.getLaidOutComponents()) {\n // The empty-state placeholder shares the column with the rows and has\n // no natural width to contribute — it tracks the viewport instead.\n if (component instanceof SelectableListRow) {\n natural = Math.max(natural, component.getNaturalWidth());\n }\n }\n\n return { width: Math.max(total.width, natural), height: total.height };\n }\n}\n\n/**\n * Owner-supplied gesture callbacks for a {@link SelectableListRow}, each invoked\n * with the row's current pool index and the originating mouse event. The row\n * owns no selection or event-dispatch logic itself — it forwards to the list.\n */\ninterface RowHandlers {\n /** Invoked on a left-click of the row. */\n onClick: (index: number, event: MouseEvent) => void;\n /** Invoked on a right-click of the row (before the list suppresses the native menu). */\n onContextMenu: (index: number, event: MouseEvent) => void;\n /** Invoked on a double-click of the row. */\n onDblClick: (index: number, event: MouseEvent) => void;\n}\n\n/**\n * Abstract base for the framework's custom selectable list controls.\n *\n * Owns the item array, the store binding, the row pool (one\n * {@link SelectableListRow} per visible item), the selection set, the\n * keyboard model (ArrowUp/Down, Home/End, PageUp/Down, Enter/Space,\n * type-ahead), and the ARIA listbox wiring. Concrete subclasses\n * ({@link List}, {@link MultiSelectList}) supply the\n * {@link AbstractSelectableList.reduceSelection} reducer that translates a\n * click or keyboard gesture into a new selection set, and the\n * {@link AbstractSelectableList.setValue} / `getValue` round-trip used by\n * [`Bindable`](/api/core/interfaces/Bindable).\n *\n * Not wrapped with `callable()` — abstract classes are never instantiated;\n * the wrapping rule applies only to concrete component subclasses.\n *\n * @category Components\n */\nabstract class AbstractSelectableList<\n TValue,\n TOptions extends AbstractSelectableListOptions = AbstractSelectableListOptions\n>\n extends AbstractInput<TValue, TOptions>\n{\n protected _items: Array<SelectableListItem> = [];\n protected _rowPool: Array<SelectableListRow> = [];\n protected _selectedSet: Set<number> = new Set();\n protected _anchorIndex: number | null = null;\n protected _focusedIndex: number = -1;\n /** Lower-cased type-ahead buffer; cleared on Escape or timeout. */\n protected _typeAheadBuf: string = \"\";\n /** Timestamp (ms) of the last printable keypress; used to time out the buffer. */\n protected _typeAheadAt: number = 0;\n /**\n * When true, {@link handleRowClick} pulls DOM focus to the list root\n * after the gesture commits so subsequent keystrokes route through\n * `handleKeyDown`. Hosts that own their own focus surface and forward\n * keystrokes (e.g. the ComboBox dropdown, which calls\n * {@link handleKey} from the ComboBox's own `keydown`) set this to\n * `false` so the embedded list never steals focus from the wrapping\n * input.\n */\n protected _focusOnRowClick: boolean = true;\n /**\n * When true (default), keyboard navigation\n * (ArrowUp/Down/Home/End/PageUp/Down) commits the focused row as the\n * selection — the \"selection follows focus\" pattern most listbox\n * controls use. Hosts that want a navigable highlight without\n * committing the row as the selected value (the WAI-ARIA\n * combobox-with-list-autocomplete pattern, exercised by\n * [`AutoCompleteField`](/api/component/input/classes/AutoCompleteField))\n * call `setSelectFollowsFocus(false)` so ArrowUp/Down moves only the\n * focus highlight; Enter / Space / click still commit.\n */\n protected _selectFollowsFocus: boolean = true;\n /**\n * Whether over-long rows scroll horizontally instead of ellipsising.\n * Written only by {@link setHorizontalScrolling}, dispatched from the\n * constructor body once `_innerPanel` exists, so the field-initializer\n * default survives the `super()` cascade without a `declare`.\n */\n private _horizontalScrolling: boolean = false;\n protected _innerPanel: Panel;\n /** Cached empty-state placeholder, built lazily on first need; null until then. */\n private _emptyPlaceholder: Component | null = null;\n /** Whether `_emptyPlaceholder` is currently a child of `_innerPanel`. */\n private _placeholderAttached: boolean = false;\n private _storeRefresh: (() => void) | null = null;\n /**\n * Factory producing each row's content renderer. Defaults to a label\n * renderer reproducing the plain-text rows. Written only by\n * {@link setRendererFactory}, dispatched from the constructor body, so the\n * field-initializer default survives the `super()` cascade without a\n * `declare`.\n */\n private _rendererFactory: () => ListItemRenderer = () => new LabelListItemRenderer();\n /**\n * Listeners for the row-gesture events that carry a row index payload\n * (`contextmenu`, `dblclick`) — kept off the DOM `Event` bus, which fires\n * bare DOM events without the index. `change` / `action` stay on the DOM\n * bus via {@link on}. Mirrors [`Tree`](/api/component/tree/classes/Tree)'s\n * `contextmenu` / `dblclick` wiring.\n */\n private _rowListeners: ListenerBag<\"contextmenu\" | \"dblclick\"> = new ListenerBag();\n\n /**\n * @param options - Caller-supplied options bag.\n * @param subclassDefaults - Per-subclass default bag layered over this\n * class's defaults; subclasses forward their `_defaultXxxOptions`\n * constant here.\n */\n constructor(options?: TOptions, subclassDefaults?: Partial<TOptions>) {\n // `Fit` makes the inner panel fill the list root; the Component\n // default `Absolute` would size every child to its preferredSize\n // (none here) and collapse the inner panel to 0×0. Layered into\n // the defaults bag so concrete subclass defaults and user options\n // can still override, alongside the shared list chrome.\n super(\n options,\n {\n ..._defaultAbstractSelectableListOptions,\n layoutManager: new Fit(),\n ...(subclassDefaults ?? {}),\n } as Partial<TOptions>,\n );\n\n // Element-level chrome: the list root carries the `listbox` role\n // and is focusable. The framework auto-adds the leaf-class name\n // (`\"List\"` / `\"MultiSelectList\"`) to the surface's classList in\n // `Component.init()`; the shared `.List, .MultiSelectList`\n // style rule registered at module init picks both up without an\n // extra opt-in.\n this.getAria().setRole(\"listbox\");\n this.getAria().setTabIndex(0);\n\n // Inner panel is the scrollable row stack. `autoScroll: \"y\"` opts\n // it into the framework's native-overflow path; `VBox` lays the\n // rows out vertically full-width with no gap.\n this._innerPanel = new Panel({\n layoutManager: new ListRowColumn({ spacing: 0, stretching: true }),\n autoScroll: \"y\",\n insets: new Insets(0, 0, 0, 0),\n });\n this.addComponent(this._innerPanel);\n\n // Default floor, but let a caller-supplied minSize option win. The\n // super() cascade writes `_options.minSize` only when the caller passed\n // one (the class default {0,0} lives in the defaults bag, not `_options`),\n // so its presence means \"caller set it\". maxSize stays unbounded.\n if (this._options.minSize === undefined) {\n // 100×100 keeps a short empty/placeholder list a usable size.\n this.setMinSize({ width: 100, height: 100 });\n }\n\n Event.addListener(this, \"keydown\", this.handleKeyDown);\n\n // Late-built state: `rendererFactory` / `store` / `items` / `enabled` /\n // `readOnly` were written pure to `_options` by the super-time cascade.\n // Dispatch them now that `_innerPanel` and `_rowPool` exist. The\n // factory is dispatched first so the row pool is built (by `setStore` /\n // `setItems` below) with the caller's renderer on first paint.\n if (this._options.rendererFactory !== undefined) {\n this.setRendererFactory(this._options.rendererFactory);\n }\n\n if (this._options.horizontalScrolling !== undefined) {\n this.setHorizontalScrolling(this._options.horizontalScrolling);\n }\n\n if (this._options.store !== undefined && this._options.displayField !== undefined) {\n this.setStore(this._options.store, this._options.displayField, this._options.valueField, this._options.glyphField, this._options.tooltipField);\n }\n\n if (this._options.items !== undefined) {\n this.setItems(this._options.items);\n }\n\n if (this._options.enabled !== undefined) {\n this.applyEnabled(this._options.enabled);\n }\n\n if (this._options.readOnly !== undefined) {\n this.applyReadOnly(this._options.readOnly);\n }\n\n // Dispatch the empty-state options last, after items/store — a list built\n // *with* items must show no placeholder. Needed because an empty list\n // configured with only `emptyText`/`emptyComponent` never calls syncRows\n // during construction.\n if (this._options.emptyText !== undefined || this._options.emptyComponent !== undefined) {\n this.syncEmptyPlaceholder();\n }\n }\n\n /**\n * Reflects the enabled flag on the ARIA tree, the tabindex, and the\n * cursor. Disabling the list parks the focus index at -1 so a\n * subsequent enable starts fresh, mirroring the native `<select>`\n * the framework replaces. Concrete subclasses can still override\n * for additional behaviour.\n *\n * @param value - The new enabled state.\n */\n protected applyEnabled(value: boolean): void {\n this.getAria().setDisabled(!value);\n this.getAria().setTabIndex(value ? 0 : -1);\n this.setCursor(value ? \"default\" : \"not-allowed\");\n\n if (!value) {\n this._focusedIndex = -1;\n this.refreshRowVisualState();\n this.updateActiveDescendant();\n }\n }\n\n /**\n * Reflects the read-only flag on the ARIA tree. Read-only lists\n * stay focusable and announce their state; the click / keyboard\n * reducers are gated separately in {@link handleRowClick} /\n * {@link handleKeyDown}.\n *\n * @param value - The new read-only state.\n */\n protected applyReadOnly(value: boolean): void {\n this.getAria().setReadOnly(value);\n }\n\n /**\n * Applies an {@link AbstractSelectableListOptions} bag. Item / store\n * fields are written pure into `_options` here and dispatched from the\n * constructor body — the row pool and inner panel only exist after\n * `super()` returns.\n *\n * @param options - The options bag carrying the values to apply.\n *\n * @returns This component, for method chaining.\n */\n protected applyOptions(options: TOptions): this {\n super.applyOptions(options);\n\n if (options.items !== undefined) this._options.items = options.items;\n if (options.store !== undefined) this._options.store = options.store;\n if (options.displayField !== undefined) this._options.displayField = options.displayField;\n if (options.valueField !== undefined) this._options.valueField = options.valueField;\n if (options.glyphField !== undefined) this._options.glyphField = options.glyphField;\n if (options.tooltipField !== undefined) this._options.tooltipField = options.tooltipField;\n if (options.rendererFactory !== undefined) this._options.rendererFactory = options.rendererFactory;\n if (options.emptyText !== undefined) this._options.emptyText = options.emptyText;\n if (options.emptyComponent !== undefined) this._options.emptyComponent = options.emptyComponent;\n\n if (options.horizontalScrolling !== undefined) this._options.horizontalScrolling = options.horizontalScrolling;\n\n return this;\n }\n\n /**\n * Sets whether a row wider than the viewport scrolls horizontally instead of\n * ellipsising.\n *\n * Off by default, which is the behaviour every list has always had: rows track\n * the viewport width and a label too long for its row clips with an ellipsis.\n * That is the right default for a narrow rail, and for the dropdown surfaces\n * (`ComboBox`, `AutoCompleteField`) where a horizontal bar under a popup reads\n * as a glitch. Turn it on for a list whose labels carry meaning past the\n * truncation point — a file path, a query — and whose host is too narrow to\n * show them.\n *\n * When on, every row is sized to the widest bound row's natural width (see\n * {@link ListItemRenderer.getContentWidth}) or the viewport, whichever is\n * larger, and the scroll area raises a horizontal scrollbar once the content\n * exceeds it. Rows stay full-width relative to each other, so the selection\n * wash still spans the whole row when scrolled. A custom renderer that does\n * not override `getContentWidth` reports no intrinsic width, so its rows stay\n * at the viewport width and nothing scrolls.\n *\n * @param value - True to scroll over-long rows horizontally.\n *\n * @returns This component, for method chaining.\n */\n setHorizontalScrolling(value: boolean): this {\n if (this._horizontalScrolling === value) {\n return this;\n }\n\n this._horizontalScrolling = value;\n\n // `\"auto\"` adds the X axis to the Y the list has always scrolled. That\n // alone drives everything: it is what lets `ListRowColumn` inflate past\n // the viewport, and what raises the bar once the rows do.\n this._innerPanel.setAutoScroll(value ? \"auto\" : \"y\");\n this.scheduleLayout();\n\n return this;\n }\n\n /**\n * Returns whether over-long rows scroll horizontally rather than ellipsising.\n *\n * @returns True when horizontal scrolling is on.\n */\n isHorizontalScrolling(): boolean {\n return this._horizontalScrolling;\n }\n\n /**\n * Sets the muted placeholder text shown inside the scroll area when the list\n * is empty. Pass `null` to clear it. Takes effect immediately: an already\n * empty list shows (or drops) the placeholder on the next layout.\n *\n * @param text - The placeholder text, or `null` to remove it.\n *\n * @returns This component, for method chaining.\n */\n setEmptyText(text: string | null): this {\n this._options.emptyText = text ?? undefined;\n this.resetEmptyPlaceholder();\n this.syncEmptyPlaceholder();\n\n return this;\n }\n\n /**\n * Returns the configured empty-state placeholder text.\n *\n * @returns The placeholder text, or `null` if none is set.\n */\n getEmptyText(): string | null {\n return this._options.emptyText ?? null;\n }\n\n /**\n * Sets a factory for a custom empty-state placeholder, shown inside the\n * scroll area when the list is empty. Takes precedence over\n * {@link setEmptyText}. Pass `null` to clear it. The returned component\n * should report an unbounded max so the empty list still fills its region.\n *\n * @param factory - The placeholder factory, or `null` to remove it.\n *\n * @returns This component, for method chaining.\n */\n setEmptyComponent(factory: (() => Component) | null): this {\n this._options.emptyComponent = factory ?? undefined;\n this.resetEmptyPlaceholder();\n this.syncEmptyPlaceholder();\n\n return this;\n }\n\n /**\n * Returns the configured empty-state placeholder factory.\n *\n * @returns The placeholder factory, or `null` if none is set.\n */\n getEmptyComponent(): (() => Component) | null {\n return this._options.emptyComponent ?? null;\n }\n\n /**\n * Adds or removes the empty-state placeholder against the current item\n * count. Attaches the placeholder (building it lazily on first need) to\n * `_innerPanel` when an empty-state is configured and the list is empty;\n * detaches it otherwise. A no-op when no empty-state is configured — an\n * opted-out empty list keeps no placeholder child.\n *\n * Called at the tail of {@link syncRows}, from the empty-state setters, and\n * once at construction for a list built empty with an empty-state option.\n */\n protected syncEmptyPlaceholder(): void {\n const configured = this._options.emptyComponent !== undefined || this._options.emptyText !== undefined;\n const wants = configured && this._items.length === 0;\n\n if (wants) {\n if (!this._emptyPlaceholder) {\n this._emptyPlaceholder = this.buildEmptyPlaceholder();\n }\n\n if (!this._placeholderAttached) {\n // weight: 1 makes the single child absorb all leftover main-axis\n // (height) space so the placeholder fills the scroll area; the\n // inner VBox's stretching:true fills the width.\n this._innerPanel.addComponent(this._emptyPlaceholder, { weight: 1 });\n this._placeholderAttached = true;\n }\n } else if (this._placeholderAttached && this._emptyPlaceholder) {\n this._innerPanel.removeComponent(this._emptyPlaceholder);\n this._placeholderAttached = false;\n }\n }\n\n /**\n * Builds the empty-state placeholder: the `emptyComponent` factory's output\n * if set, otherwise a muted, horizontally-centered single-line `Text` from\n * `emptyText` using the list-scoped disabled token.\n *\n * @returns The placeholder component.\n */\n private buildEmptyPlaceholder(): Component {\n const factory = this._options.emptyComponent;\n if (factory) {\n return factory();\n }\n\n const text = new Text(this._options.emptyText ?? \"\", { textAlign: \"center\" });\n text.setForegroundColor(\"var(--ts-ui-list-row-disabled-color, rgb(170, 170, 170))\");\n\n return text;\n }\n\n /**\n * Detaches the cached placeholder (if attached) and drops it, so the next\n * {@link syncEmptyPlaceholder} rebuilds it from the current options. Used by\n * the empty-state setters when the configuration changes.\n */\n private resetEmptyPlaceholder(): void {\n if (this._placeholderAttached && this._emptyPlaceholder) {\n this._innerPanel.removeComponent(this._emptyPlaceholder);\n this._placeholderAttached = false;\n }\n\n this._emptyPlaceholder = null;\n }\n\n /**\n * Returns `null` so a multi-line list surface is treated as a\n * replaced/graphical element by horizontal layouts — matches the\n * behaviour the prior native `<select>`-backed `List` preserved.\n *\n * @returns Always `null`.\n */\n getBaseline(): number | null {\n return null;\n }\n\n /**\n * Returns a shallow copy of the current item array.\n *\n * @returns The items in display order.\n */\n getItems(): Array<SelectableListItem> {\n return this._items.slice();\n }\n\n /**\n * Replaces all items with the given specs. Each entry is either a plain\n * string — keyed by the string itself (`{ key: label }`), so `getValue` /\n * `setValue` round-trip the visible text for the common \"list of names\"\n * case — or a pre-formed {@link SelectableListItem} whose explicit key is kept\n * verbatim. Selection and focus are reset; the row pool is reconciled\n * against the new length.\n *\n * @param items - A single spec or an array of specs. Each spec is a string\n * (keyed by its own value) or a `{ key, label }` object (explicit key).\n *\n * @remarks The caller owns key uniqueness — repeated strings, or an explicit\n * key colliding with a string value, produce duplicate keys, and\n * `getValue` / `setValue` resolve to the first row whose `key` matches, so\n * a duplicate key is merely addressed by its lowest matching row.\n *\n * @returns This component, for method chaining.\n */\n setItems(items: SelectableListItemSpec | Array<SelectableListItemSpec>): this {\n if (!Type.isArray(items)) {\n items = [items as SelectableListItemSpec];\n }\n\n const list = items as Array<SelectableListItemSpec>;\n const built: Array<SelectableListItem> = [];\n\n for (const entry of list) {\n built.push(\n typeof entry === \"string\"\n ? { key: entry, label: entry }\n : { key: (entry as SelectableListItem).key, label: (entry as SelectableListItem).label, glyph: (entry as SelectableListItem).glyph, tooltip: (entry as SelectableListItem).tooltip },\n );\n }\n\n return this.setItemsArray(built);\n }\n\n /**\n * Replaces all items with the given pre-formed `{key, label}` pairs.\n * Mirrors {@link setItems} but skips the key-from-label step so a host\n * that already owns typed items (e.g. the [`ComboBox`](/api/component/input/classes/ComboBox)\n * dropdown pushing a `SelectableListItem` array) can hand them over\n * without the keys being overwritten by their labels. Selection and focus are reset; the row pool\n * is reconciled against the new length.\n *\n * Protected on the abstract base so each concrete subclass decides\n * whether to widen it into the public surface — {@link List} does;\n * `MultiSelectList` does not (the multi-select consumers haven't\n * needed the typed-array entry point so far).\n *\n * @param items - The pre-formed item pairs, in display order.\n *\n * @returns This component, for method chaining.\n */\n protected setItemsArray(items: Array<SelectableListItem>): this {\n this._items = items.slice();\n\n this._selectedSet.clear();\n this._anchorIndex = null;\n this._focusedIndex = -1;\n\n this.pauseLayout();\n this.syncRows();\n this.resumeLayout();\n this.updateActiveDescendant();\n\n return this;\n }\n\n /**\n * Appends a new item to the end of the list. A plain string is keyed by the\n * string itself (`{ key: label }`), so `getValue` / `setValue` round-trip the\n * visible text; a pre-formed {@link SelectableListItem} keeps its explicit key\n * verbatim.\n *\n * @param item - A string (keyed by its own value) or a `{ key, label }`\n * object (explicit key).\n *\n * @remarks The caller owns key uniqueness — appending a string equal to an\n * earlier string or explicit key produces a duplicate key, and `getValue` /\n * `setValue` resolve to the first matching row.\n *\n * @returns This component, for method chaining.\n */\n addItem(item: SelectableListItemSpec): this {\n this._items.push(\n typeof item === \"string\"\n ? { key: item, label: item }\n : { key: (item as SelectableListItem).key, label: (item as SelectableListItem).label, glyph: (item as SelectableListItem).glyph, tooltip: (item as SelectableListItem).tooltip },\n );\n\n this.pauseLayout();\n this.syncRows();\n this.resumeLayout();\n\n return this;\n }\n\n /**\n * Binds this list to a store. Records are pulled via `displayField` /\n * `valueField` whenever the store fires `load` / `add` / `remove` /\n * `datachange` / `sync`. Re-binding to a new store de-registers the\n * previous handlers first.\n *\n * @param store - The store to bind to.\n * @param displayField - The record field whose value becomes the row label.\n * @param valueField - Optional. The record field used as the row key;\n * defaults to the record's primary key when omitted.\n * @param glyphField - Optional. The record field whose value becomes each\n * item's `glyph` (read by the glyph renderer); omitted leaves items\n * glyph-less.\n * @param tooltipField - Optional. The record field whose value becomes each\n * item's hover `tooltip`; omitted leaves items tooltip-less.\n *\n * @returns This component, for method chaining.\n */\n setStore(store: AbstractStore, displayField: string, valueField?: string, glyphField?: string, tooltipField?: string): this {\n const oldStore = this._options.store;\n\n if (this._storeRefresh && oldStore) {\n (['load', 'add', 'remove', 'datachange', 'sync'] as const)\n .forEach(e => oldStore.off(e, this._storeRefresh!));\n }\n\n this._options.store = store;\n this._options.displayField = displayField;\n this._options.valueField = valueField;\n this._options.glyphField = glyphField;\n this._options.tooltipField = tooltipField;\n\n const refresh = (): void => this.refreshFromStore();\n this._storeRefresh = refresh;\n\n store.on('load', refresh);\n store.on('add', refresh);\n store.on('remove', refresh);\n store.on('datachange', refresh);\n store.on('sync', refresh);\n\n this.refreshFromStore();\n\n return this;\n }\n\n /**\n * Returns the currently bound store, or `null` when none is set.\n *\n * @returns The bound store, or `null`.\n */\n getStore(): AbstractStore | null {\n return this._options.store ?? null;\n }\n\n /**\n * Replaces the renderer factory. Every existing pool row swaps to a fresh\n * renderer from the new factory and the pool is re-synced so each renderer\n * rebinds to its item before the next layout. New rows built afterwards use\n * the new factory too.\n *\n * @param factory - Zero-argument factory producing a renderer per row.\n *\n * @returns This component, for method chaining.\n */\n setRendererFactory(factory: () => ListItemRenderer): this {\n this._rendererFactory = factory;\n\n for (const row of this._rowPool) {\n row.setRenderer(factory());\n }\n\n this.pauseLayout();\n this.syncRows();\n this.resumeLayout();\n\n return this;\n }\n\n /**\n * Returns the renderer factory currently in use.\n *\n * @returns The zero-argument renderer factory.\n */\n getRendererFactory(): () => ListItemRenderer {\n return this._rendererFactory;\n }\n\n /**\n * Returns the store record corresponding to the most recent\n * single-selection anchor — matches the prior `<select>`-backed\n * behaviour where `getSelectedRecord()` returned the active option's\n * record. For {@link MultiSelectList} consumers wanting the full set\n * of selected records, use [`getSelectedRecords`](/api/component/list/classes/MultiSelectList#getselectedrecords).\n *\n * @returns The selected [`ModelRecord`](/api/data/classes/ModelRecord), or `undefined` when no\n * store is bound or nothing is selected.\n */\n getSelectedRecord(): ModelRecord | undefined {\n const store = this._options.store;\n\n if (!store) {\n return undefined;\n }\n\n const idx = this.getSelectedIndex();\n\n if (idx < 0) {\n return undefined;\n }\n\n return store.getRecords()[idx];\n }\n\n /**\n * Returns the index of the most recent single-selection anchor, or\n * `-1` when nothing is selected.\n *\n * @returns The anchor index.\n */\n getSelectedIndex(): number {\n if (this._anchorIndex !== null && this._selectedSet.has(this._anchorIndex)) {\n return this._anchorIndex;\n }\n\n if (this._selectedSet.size === 0) {\n return -1;\n }\n\n // Fallback when the anchor is gone (e.g. after a programmatic\n // setValues that bypassed the click reducer): return the lowest\n // selected index so the contract stays single-valued.\n return Math.min(...this._selectedSet);\n }\n\n /**\n * Sets the single-selection anchor. The selection set becomes\n * exactly `{idx}` (or empty for `idx < 0`); `_focusedIndex` follows.\n * Optionally fires the `change` event so binding listeners run.\n *\n * @param idx - The zero-based index to select, or a negative value\n * to clear the selection.\n * @param fireEvent - When `true` (default), fires the `change` event\n * after updating; pass `false` for programmatic writes.\n *\n * @returns This component, for method chaining.\n */\n setSelectedIndex(idx: number, fireEvent: boolean = true): this {\n this._selectedSet.clear();\n\n if (idx >= 0 && idx < this._items.length) {\n this._selectedSet.add(idx);\n this._anchorIndex = idx;\n this._focusedIndex = idx;\n } else {\n this._anchorIndex = null;\n this._focusedIndex = -1;\n }\n\n this.refreshRowVisualState();\n this.updateActiveDescendant();\n\n if (fireEvent) {\n this.fireChange();\n }\n\n return this;\n }\n\n /**\n * Registers a listener for one of this list's events. `\"action\"` is a\n * typed semantic shorthand over {@link Event.addListener} for the DOM\n * change event — fired only on user-driven (click / keyboard) selection\n * changes, never on programmatic `setValue` / `setValues`, matching the\n * prior native `<select>`-backed semantics. `\"change\"` and `\"binding\"`\n * are the inherited {@link AbstractInput} listener-bag events.\n *\n * `\"contextmenu\"` fires when a row is right-clicked, with the row index and\n * the raw {@link MouseEvent} (the native menu is suppressed); `\"dblclick\"`\n * fires on a row double-click with the same payload. Both carry the row\n * index directly, so hosts need not walk the row DOM to resolve it.\n *\n * @param event - The event name.\n * @param listener - The callback to invoke when the event fires.\n *\n * @returns This component, for method chaining.\n */\n on(event: \"action\", listener: Event.Listener): this;\n on(event: \"change\", listener: (value: TValue) => void): this;\n on(event: \"binding\", listener: () => void): this;\n on(event: \"contextmenu\", listener: (index: number, event: MouseEvent) => void): this;\n on(event: \"dblclick\", listener: (index: number, event: MouseEvent) => void): this;\n on(event: \"action\" | \"change\" | \"binding\" | \"contextmenu\" | \"dblclick\", listener: Function): this {\n if (event === \"action\") {\n Event.addListener(this, \"change\", listener as Event.Listener);\n\n return this;\n }\n\n if (event === \"contextmenu\" || event === \"dblclick\") {\n this._rowListeners.add(event, listener);\n\n return this;\n }\n\n return super.on(event as \"change\", listener as (value: TValue) => void);\n }\n\n /**\n * Removes a previously registered listener. The exact callback\n * reference must match the one passed to {@link on}.\n *\n * @param event - The event the listener was registered for.\n * @param listener - The callback to remove.\n *\n * @returns This component, for method chaining.\n */\n off(event: \"action\" | \"change\" | \"binding\" | \"contextmenu\" | \"dblclick\", listener: Function): this {\n if (event === \"action\") {\n Event.removeListener(this, \"change\", listener as Event.Listener);\n\n return this;\n }\n\n if (event === \"contextmenu\" || event === \"dblclick\") {\n this._rowListeners.remove(event, listener);\n\n return this;\n }\n\n return super.off(event as \"change\" | \"binding\", listener);\n }\n\n /**\n * Subclass hook: translate a click or keyboard gesture at `idx` into\n * a new selection set. The modifier-key flags are normalised so the\n * same reducer runs for mouse and keyboard origins.\n *\n * @param idx - The row index targeted by the gesture.\n * @param ev - Normalised modifier flags. `ctrl` covers both Ctrl and\n * Cmd (macOS).\n */\n protected abstract reduceSelection(idx: number, ev: { ctrl: boolean, shift: boolean }): void;\n\n /**\n * Subclass hook used by user-driven gestures: encode the current\n * selection set into the subclass's `TValue` shape and fire change /\n * binding listeners. Called from the click and keyboard reducers\n * after {@link reduceSelection} mutates the selection set.\n */\n protected abstract notifyUserChange(): void;\n\n /**\n * Rebuilds `_items` from the bound store's current records. Preserves\n * the previously-selected key when possible — if the key still maps\n * to an item, the selection survives; otherwise the selection is\n * cleared and the focus collapses to row 0 (matching the native\n * `<select>` refresh behaviour the prior `List` inherited).\n */\n protected refreshFromStore(): void {\n const store = this._options.store;\n const displayField = this._options.displayField;\n const valueField = this._options.valueField;\n const glyphField = this._options.glyphField;\n const tooltipField = this._options.tooltipField;\n\n if (!store || !displayField) {\n return;\n }\n\n // Remember the active selection key so we can re-locate it in\n // the new item set; survives partial reorderings / additions.\n const previousAnchorKey = this._anchorIndex !== null && this._items[this._anchorIndex]\n ? this._items[this._anchorIndex].key\n : null;\n\n this._items = [];\n this._selectedSet.clear();\n this._anchorIndex = null;\n\n const records = store.getRecords();\n let restoredAnchor = -1;\n\n for (let i = 0; i < records.length; i++) {\n const record = records[i];\n const label = String(record.get(displayField));\n const key = valueField\n ? String(record.get(valueField))\n : String(record.getId());\n const glyph = glyphField ? String(record.get(glyphField)) : undefined;\n const tooltip = tooltipField ? String(record.get(tooltipField)) : undefined;\n\n this._items.push({ key, label, glyph, tooltip });\n\n if (previousAnchorKey !== null && key === previousAnchorKey) {\n restoredAnchor = i;\n }\n }\n\n if (restoredAnchor >= 0) {\n this._selectedSet.add(restoredAnchor);\n this._anchorIndex = restoredAnchor;\n this._focusedIndex = restoredAnchor;\n } else {\n this._focusedIndex = this._items.length > 0 ? 0 : -1;\n }\n\n this.pauseLayout();\n this.syncRows();\n this.resumeLayout();\n this.updateActiveDescendant();\n }\n\n /**\n * Reconciles the row pool with `_items`. Overlapping rows have their\n * label, index, selected, and focused state updated; surplus items\n * spawn new rows; surplus rows are removed.\n */\n protected syncRows(): void {\n const newLen = this._items.length;\n const oldLen = this._rowPool.length;\n const overlap = Math.min(newLen, oldLen);\n\n for (let i = 0; i < overlap; i++) {\n const row = this._rowPool[i];\n row.updateItem(this._items[i], i);\n row.setIndex(i);\n row.setSelected(this._selectedSet.has(i));\n row.setFocused(i === this._focusedIndex);\n }\n\n if (newLen > oldLen) {\n for (let i = oldLen; i < newLen; i++) {\n const row = new SelectableListRow(\n {\n onClick: (idx, e) => this.handleRowClick(idx, e),\n onContextMenu: (idx, e) => this.handleRowContextMenu(idx, e),\n onDblClick: (idx, e) => this.handleRowDblClick(idx, e),\n },\n i,\n this._rendererFactory,\n );\n row.updateItem(this._items[i], i);\n row.setSelected(this._selectedSet.has(i));\n row.setFocused(i === this._focusedIndex);\n this._innerPanel.addComponent(row);\n this._rowPool.push(row);\n }\n } else if (newLen < oldLen) {\n for (let i = newLen; i < oldLen; i++) {\n // Drop the row's tooltip attachment (a static id-keyed map) before\n // discarding the row, so a shrinking pool doesn't leak entries.\n Tooltip.detach(this._rowPool[i]);\n this._innerPanel.removeComponent(this._rowPool[i]);\n }\n this._rowPool.splice(newLen);\n }\n\n // Toggle the empty-state placeholder against the new item count. Runs\n // after the row reconciliation, so on a 0→N transition the rows are in\n // place before the placeholder is dropped (and on N→0, dropped rows are\n // gone before the placeholder attaches). syncRows runs inside a paused\n // layout, so the transient coexistence never renders.\n this.syncEmptyPlaceholder();\n }\n\n /**\n * Pushes the cached selection / focus state into every pool row.\n * Called after a selection mutation (click / keyboard reducer or\n * programmatic write) so the visible chrome catches up without a\n * full `syncRows` reconciliation.\n */\n protected refreshRowVisualState(): void {\n for (let i = 0; i < this._rowPool.length; i++) {\n const row = this._rowPool[i];\n row.setSelected(this._selectedSet.has(i));\n row.setFocused(i === this._focusedIndex);\n }\n }\n\n /**\n * Mirrors `_focusedIndex` onto `aria-activedescendant` so assistive\n * tech tracks the keyboard-focus row. Clears the attribute when no\n * row holds focus. Points at the row's framework-generated id — the\n * Event system already keys listeners off that id, so rewriting the\n * DOM id to a synthetic value (e.g. `ListRow-N`) would break row\n * click / pointerdown delivery.\n */\n protected updateActiveDescendant(): void {\n if (this._focusedIndex < 0 || this._focusedIndex >= this._rowPool.length) {\n this.getAria().setActiveDescendant(\"\");\n\n return;\n }\n\n this.getAria().setActiveDescendant(this._rowPool[this._focusedIndex].getId());\n }\n\n /**\n * Fires the `change` event so `on(\"change\", fn)` subscribers and\n * `notifyChange`-fed bindings run. Subclasses route their own\n * `notifyUserChange` through this after the reducer commits.\n */\n protected fireChange(): void {\n const element = this.getElement();\n\n if (element) {\n Event.fireEvent(this, \"change\");\n }\n\n this.notifyChange(this.getValue());\n }\n\n /**\n * Handles a click on a pool row: dispatches the gesture through the\n * subclass's {@link reduceSelection}, syncs the visible chrome, and\n * fires user-change notifications. The list root takes focus on\n * click (rows are not focusable) so subsequent keyboard navigation\n * starts from the clicked row.\n *\n * @param idx - The row index that was clicked.\n * @param e - The original mouse event — modifier-key flags drive the\n * reducer's multi-select branch.\n */\n protected handleRowClick(idx: number, e: MouseEvent): void {\n if (!this.isEnabled() || this.isReadOnly()) {\n return;\n }\n\n if (idx < 0 || idx >= this._items.length) {\n return;\n }\n\n this.reduceSelection(idx, { ctrl: e.ctrlKey || e.metaKey, shift: e.shiftKey });\n this.refreshRowVisualState();\n this.updateActiveDescendant();\n\n if (this._focusOnRowClick) {\n // Pull DOM focus back to the list root so subsequent keystrokes\n // route through `handleKeyDown` — rows themselves are not\n // focusable, only the listbox surface is. Suppressed when the\n // list is hosted by a focus-managing parent (e.g. the\n // ComboBox dropdown) so a programmatic focus shift can't\n // tear down a wrapping cell editor's input.\n this.focus();\n }\n\n this.notifyUserChange();\n }\n\n /**\n * Handles a right-click on a pool row: suppresses the browser's native\n * context menu and fires the `\"contextmenu\"` event with the row index and\n * the raw event. Deliberately does not change the selection — a host that\n * wants the right-clicked row highlighted calls {@link setSelectedIndex}\n * from its listener (mirrors [`Tree`](/api/component/tree/classes/Tree)'s\n * contextmenu contract). Out-of-range indices are ignored.\n *\n * @param idx - The row index that was right-clicked.\n * @param e - The original contextmenu event.\n */\n protected handleRowContextMenu(idx: number, e: MouseEvent): void {\n if (idx < 0 || idx >= this._items.length) {\n return;\n }\n\n e.preventDefault();\n this._rowListeners.fire(\"contextmenu\", idx, e);\n }\n\n /**\n * Handles a double-click on a pool row: fires the `\"dblclick\"` event with\n * the row index and the raw event. The first click of the pair already ran\n * through {@link handleRowClick} and set the selection, so this only layers\n * an activation signal on top. Out-of-range indices are ignored.\n *\n * @param idx - The row index that was double-clicked.\n * @param e - The original dblclick event.\n */\n protected handleRowDblClick(idx: number, e: MouseEvent): void {\n if (idx < 0 || idx >= this._items.length) {\n return;\n }\n\n this._rowListeners.fire(\"dblclick\", idx, e);\n }\n\n /**\n * Toggles whether a row-click gesture pulls DOM focus to the list\n * root after the commit. Hosts that own their own focus surface\n * (the ComboBox dropdown is the canonical example) call\n * `setFocusOnRowClick(false)` so the embedded list never steals\n * focus from a wrapping input or cell editor.\n *\n * @param value - `false` to suppress the focus call.\n *\n * @returns This component, for method chaining.\n */\n setFocusOnRowClick(value: boolean): this {\n this._focusOnRowClick = value;\n\n return this;\n }\n\n /**\n * Toggles whether keyboard navigation (ArrowUp/Down/Home/End/PageUp/Down)\n * commits the focused row as the selection. When `false`, the focus\n * highlight moves but the selection set is untouched and the `change`\n * event does not fire. Enter / Space / click still commit. The\n * [`AutoCompleteField`](/api/component/input/classes/AutoCompleteField)\n * dropdown sets this to `false` so ArrowUp/Down previews a row\n * without writing it into the host TextField.\n *\n * @param value - `false` to disable the selection-follows-focus\n * coupling on keyboard navigation.\n *\n * @returns This component, for method chaining.\n */\n setSelectFollowsFocus(value: boolean): this {\n this._selectFollowsFocus = value;\n\n return this;\n }\n\n /**\n * Returns the current keyboard-focus index, or `-1` when no row\n * holds focus.\n *\n * @returns The zero-based focus index, or `-1`.\n */\n getFocusedIndex(): number {\n return this._focusedIndex;\n }\n\n /**\n * Returns the framework-generated DOM element id of the keyboard-focus\n * row, suitable for writing into a host input's `aria-activedescendant`.\n * Returns `null` when no row holds focus or the focused row hasn't\n * been instantiated in the pool yet (rows materialise lazily as the\n * pool reconciles against the item array).\n *\n * @returns The focused row's element id, or `null`.\n */\n getFocusedRowId(): string | null {\n if (this._focusedIndex < 0 || this._focusedIndex >= this._rowPool.length) {\n return null;\n }\n\n return this._rowPool[this._focusedIndex].getId();\n }\n\n /**\n * Public entry point used by hosts that keep DOM focus on their own\n * surface while embedding this list (e.g. the [`ComboBox`](/api/component/input/classes/ComboBox)\n * dropdown forwarding keystrokes from the ComboBox surface).\n * Returns `true` when the list consumed the key — the caller\n * should then `e.preventDefault()` and stop further processing.\n * Escape is intentionally NOT consumed here so the host can use\n * it to close the wrapping overlay; the list-focused entry point\n * (the protected `handleKeyDown` registered as the list's own\n * `keydown` listener) still handles Escape inline.\n *\n * @param e - The keyboard event captured by the host.\n *\n * @returns `true` when the list consumed the key.\n */\n handleKey(e: KeyboardEvent): boolean {\n if (!this.isEnabled() || this.isReadOnly()) {\n return false;\n }\n\n if (this._items.length === 0) {\n return false;\n }\n\n if (e.key === \"Escape\") {\n return false;\n }\n\n const ctrl = e.ctrlKey || e.metaKey;\n\n if (this.handleNavigationKey(e, ctrl)) {\n return true;\n }\n\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n this.commitFocusedRow(ctrl, e.shiftKey);\n\n return true;\n }\n\n if (!ctrl && !e.altKey && e.key.length === 1) {\n this.handleTypeAhead(e.key);\n\n return true;\n }\n\n return false;\n }\n\n /**\n * Handles keydown on the list root: ArrowUp/Down/Home/End move the\n * focus index, PageUp/Down move by visible-row count, Enter/Space\n * commits the focused row, Ctrl+A in subclasses extends to select\n * all (handled in {@link MultiSelectList}), Escape clears the\n * type-ahead buffer, and printable characters feed the type-ahead\n * search.\n *\n * @param e - The keyboard event.\n */\n protected handleKeyDown(e: KeyboardEvent): void {\n if (!this.isEnabled() || this.isReadOnly()) {\n return;\n }\n\n if (this._items.length === 0) {\n return;\n }\n\n const ctrl = e.ctrlKey || e.metaKey;\n\n if (e.key === \"Escape\") {\n this._typeAheadBuf = \"\";\n\n return;\n }\n\n if (this.handleNavigationKey(e, ctrl)) {\n return;\n }\n\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n this.commitFocusedRow(ctrl, e.shiftKey);\n\n return;\n }\n\n // Printable single-character key — feed the type-ahead buffer.\n // `key.length === 1` filters out named keys (`\"Tab\"`, `\"Shift\"`,\n // `\"ArrowDown\"`, …) without an explicit allow-list.\n if (!ctrl && !e.altKey && e.key.length === 1) {\n this.handleTypeAhead(e.key);\n }\n }\n\n /**\n * Subset of `handleKeyDown` that processes the arrow / Home / End /\n * Page-* navigation keys. Returns `true` when a key was handled so\n * the caller can skip the remaining branches.\n *\n * @param e - The keyboard event.\n * @param ctrl - Pre-computed Ctrl-or-Cmd flag.\n *\n * @returns `true` when the key was handled.\n */\n protected handleNavigationKey(e: KeyboardEvent, ctrl: boolean): boolean {\n const navigable = new Set([\n \"ArrowDown\", \"ArrowUp\", \"Home\", \"End\", \"PageDown\", \"PageUp\",\n ]);\n\n if (!navigable.has(e.key)) {\n return false;\n }\n\n e.preventDefault();\n\n const viewportH = this.getHeight() || ROW_HEIGHT_PX;\n const pageSize = Math.max(1, Math.floor(viewportH / ROW_HEIGHT_PX));\n const curr = this._focusedIndex < 0 ? 0 : this._focusedIndex;\n let next: number;\n\n if (e.key === \"ArrowDown\") {\n next = Math.min(curr + 1, this._items.length - 1);\n } else if (e.key === \"ArrowUp\") {\n next = Math.max(curr - 1, 0);\n } else if (e.key === \"PageDown\") {\n next = Math.min(curr + pageSize, this._items.length - 1);\n } else if (e.key === \"PageUp\") {\n next = Math.max(curr - pageSize, 0);\n } else if (e.key === \"Home\") {\n next = 0;\n } else {\n next = this._items.length - 1;\n }\n\n this.moveFocus(next, ctrl, e.shiftKey);\n\n return true;\n }\n\n /**\n * Moves the keyboard focus to `idx`. By default the move also runs\n * the subclass's {@link reduceSelection} so single-select lists track\n * the focus highlight; pass `ctrl: true` to move the focus without\n * touching the selection (the standard \"browse without committing\"\n * gesture). `shift: true` forwards the range-extend hint to the\n * reducer. When the list-wide {@link setSelectFollowsFocus} flag is\n * `false`, the commit branch is suppressed entirely — the focus\n * highlight moves but the selection set is untouched and\n * `notifyUserChange` does not fire.\n *\n * @param idx - The new focus index.\n * @param ctrl - When `true`, skip the selection update.\n * @param shift - When `true`, ask the reducer to extend the\n * selection from `_anchorIndex` to `idx`.\n */\n protected moveFocus(idx: number, ctrl: boolean, shift: boolean): void {\n this._focusedIndex = idx;\n\n const commit = !ctrl && this._selectFollowsFocus;\n\n if (commit) {\n this.reduceSelection(idx, { ctrl: false, shift });\n }\n\n this.refreshRowVisualState();\n this.updateActiveDescendant();\n this.scrollIndexIntoView(idx);\n\n if (commit) {\n this.notifyUserChange();\n }\n }\n\n /**\n * Commits the focused row through {@link reduceSelection}. Mirrors\n * the gesture of clicking that row with the same modifier keys.\n *\n * @param ctrl - Ctrl-or-Cmd modifier flag at the time of the keypress.\n * @param shift - Shift modifier flag at the time of the keypress.\n */\n protected commitFocusedRow(ctrl: boolean, shift: boolean): void {\n if (this._focusedIndex < 0) {\n return;\n }\n\n this.reduceSelection(this._focusedIndex, { ctrl, shift });\n this.refreshRowVisualState();\n this.updateActiveDescendant();\n this.notifyUserChange();\n }\n\n /**\n * Appends `ch` to the type-ahead buffer (after timing out the\n * previous buffer when more than {@link TYPE_AHEAD_TIMEOUT_MS}\n * elapsed since the last key) and jumps the focus to the first item\n * whose lower-cased label starts with the buffer.\n *\n * @param ch - The character key pressed.\n */\n protected handleTypeAhead(ch: string): void {\n const now = Date.now();\n\n if (now - this._typeAheadAt > TYPE_AHEAD_TIMEOUT_MS) {\n this._typeAheadBuf = \"\";\n }\n\n this._typeAheadBuf += ch.toLowerCase();\n this._typeAheadAt = now;\n\n const buf = this._typeAheadBuf;\n const idx = this._items.findIndex(item => item.label.toLowerCase().startsWith(buf));\n\n if (idx < 0) {\n return;\n }\n\n // Type-ahead moves only the focus highlight; selection is\n // unaffected (same behaviour as the native `<select>` it\n // replaces — typing a letter previews the row without\n // committing).\n this._focusedIndex = idx;\n this.refreshRowVisualState();\n this.updateActiveDescendant();\n this.scrollIndexIntoView(idx);\n }\n\n /**\n * Scrolls the inner panel so the row at `idx` is fully visible, with\n * no movement when it already is. Reads / writes the panel's native\n * `scrollTop` directly — the framework's typed scroll setter only\n * lives on the `VirtualScroller`-backed components (`Table.Body`,\n * `Tree`); the `Panel`-with-`autoScroll: \"y\"` surface relies on\n * native browser overflow and exposes no setter.\n *\n * @param idx - The row index to scroll into view.\n */\n protected scrollIndexIntoView(idx: number): void {\n if (idx < 0 || idx >= this._items.length) {\n return;\n }\n\n const panelEl = this._innerPanel.getElement();\n\n if (!panelEl) {\n return;\n }\n\n const metrics = DOM.source.getScrollMetrics(panelEl);\n const top = idx * ROW_HEIGHT_PX;\n const bottom = top + ROW_HEIGHT_PX;\n const scrollTop = metrics.scrollTop;\n const visibleBottom = scrollTop + metrics.clientHeight;\n\n if (top < scrollTop) {\n DOM.sink.apply(panelEl, { scrollTop: top });\n } else if (bottom > visibleBottom) {\n DOM.sink.apply(panelEl, { scrollTop: bottom - metrics.clientHeight });\n }\n }\n}\n\nexport { AbstractSelectableList, SelectableListRow };\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { AbstractSelectableList, AbstractSelectableListOptions, SelectableListItem } from \"~/component/list/AbstractSelectableList.js\";\nimport { callable } from \"~/core/Callable.js\";\n\n/**\n * Construction-time options for {@link List}.\n *\n * @category Components\n */\nexport interface ListOptions extends AbstractSelectableListOptions {\n selectedIndex?: number;\n value?: string;\n selectedItem?: string;\n}\n\n/**\n * A scrollable single-selection list box.\n *\n * Rendered as a `<div role=\"listbox\">` populated with `<div role=\"option\">`\n * rows. Implements [`Bindable<string>`](/api/core/interfaces/Bindable) so it can be plugged into a\n * [`Binding`](/api/core/classes/Binding) directly. Keyboard model mirrors the WAI-ARIA listbox\n * pattern: ArrowUp/Down moves and selects, Home/End jump to the\n * extremes, PageUp/Down jump by viewport-row count, Enter / Space\n * commits the focused row, and printable characters drive a 700ms\n * type-ahead search.\n *\n * @category Components\n */\nclass List extends AbstractSelectableList<string, ListOptions> {\n\n /**\n * @param options - Optional. Construction-time options applied to\n * the list.\n */\n constructor(options?: ListOptions) {\n super(options);\n\n // Late-built state: `selectedIndex` / `value` / `selectedItem`\n // were written pure to `_options` by the super-time cascade.\n // Dispatch them now that the row pool and selection set exist\n // (`super()` already populated `_items` from `items` / `store`,\n // and applied `enabled` / `readOnly`).\n if (this._options.selectedIndex !== undefined) {\n this.setSelectedIndex(this._options.selectedIndex, false);\n }\n\n if (this._options.value !== undefined) {\n this.setValue(this._options.value);\n }\n\n if (this._options.selectedItem !== undefined) {\n this.setValue(this._options.selectedItem);\n }\n }\n\n /**\n * Applies a {@link ListOptions} bag. Single-select state fields are\n * written pure into `_options` here and dispatched from the constructor\n * body after the row pool is built.\n *\n * @param options - The options bag carrying the values to apply.\n *\n * @returns This component, for method chaining.\n */\n protected applyOptions(options: ListOptions): this {\n super.applyOptions(options);\n\n if (options.selectedIndex !== undefined) this._options.selectedIndex = options.selectedIndex;\n if (options.value !== undefined) this._options.value = options.value;\n if (options.selectedItem !== undefined) this._options.selectedItem = options.selectedItem;\n\n return this;\n }\n\n /**\n * Pushes pre-formed {@link SelectableListItem} pairs into the list,\n * bypassing the auto-keying that {@link setItems} applies to a\n * label-only array. Intended for hosts that already own typed\n * `{key, label}` data (e.g. the [`ComboBox`](/api/component/input/classes/ComboBox)\n * dropdown forwarding its item array). Selection and focus are\n * reset; the row pool is reconciled against the new length.\n *\n * @param items - The pre-formed item pairs, in display order.\n *\n * @returns This component, for method chaining.\n */\n setItemsArray(items: Array<SelectableListItem>): this {\n return super.setItemsArray(items);\n }\n\n /**\n * Selects the row whose `key` matches `value`. No-op when the value\n * doesn't appear in the current item set — same behaviour the prior\n * native `<select>` had when assigned an unknown `value`.\n *\n * @param value - The row key to select.\n *\n * @returns This component, for method chaining.\n */\n setValue(value: string): this {\n const idx = this._items.findIndex(item => item.key === value);\n\n this.setSelectedIndex(idx, false);\n\n return this;\n }\n\n /**\n * Returns the key of the currently selected row.\n *\n * @returns The selected row's key, or an empty string when nothing\n * is selected.\n */\n getValue(): string {\n const idx = this.getSelectedIndex();\n\n if (idx < 0 || idx >= this._items.length) {\n return \"\";\n }\n\n return this._items[idx].key;\n }\n\n /**\n * Reduces a click / keyboard gesture into the single-select shape:\n * the modifier keys are ignored, the selection becomes exactly\n * `{idx}`, and the anchor / focus collapse to the clicked row.\n *\n * @param idx - The row index the gesture targeted.\n * @param _ev - Ignored; single-select doesn't branch on modifier keys.\n */\n protected reduceSelection(idx: number, _ev: { ctrl: boolean, shift: boolean }): void {\n this._selectedSet.clear();\n this._selectedSet.add(idx);\n this._anchorIndex = idx;\n this._focusedIndex = idx;\n }\n\n /**\n * User-driven selection commit. Mirrors the prior native `<select>`\n * `change` event semantics — fired from the click / keyboard\n * reducers, not from programmatic `setValue` / `setSelectedIndex(idx,\n * false)`.\n */\n protected notifyUserChange(): void {\n this.fireChange();\n }\n\n}\n\nconst ListCallable = callable(List);\ntype ListCallable = List;\nexport {\n List as _List,\n ListCallable as List,\n};\n"],"mappings":"ocAgCA,IAAsB,iBAAtB,cAA+C,CAAU,CAErD,aAAc,CACV,MAAM,CACV,CA+BA,iBAA0B,CACtB,MAAO,EACX,CAsBJ,EC3DM,sBAAN,cAAoC,gBAAiB,CAEjD,OAOA,UAA6B,GAM7B,aAAc,CACV,MAAM,EACN,KAAK,YAAY,EAEjB,KAAK,OAAS,IAAI,EAClB,KAAK,OAAO,YAAY,EACxB,KAAK,OAAO,eAAe,EAAK,CACpC,CAQA,UAAiB,CACb,OAAO,KAAK,MAChB,CAOA,OAAO,EAAsC,CACzC,KAAK,OAAO,QAAQ,EAAQ,KAAK,KAAK,EACtC,KAAK,UAAY,EACrB,CAQA,iBAA0B,CAMtB,MALA,CAEI,KAAK,aADL,KAAK,OAAO,QAAQ,EACH,IAGd,KAAK,OAAO,iBAAiB,CAAC,EAAE,OAAS,CACpD,CAeA,eAAe,EAAe,EAAsB,CAChD,IAAM,EAAM,KAAK,iBAAiB,GAAK,CAAE,EAAG,EAAG,EAAG,EAAG,QAAO,QAAO,EAEnE,KAAK,OAAO,mBAAmB,EAAK,EACpC,KAAK,OAAO,KAAK,EAAI,CAAC,EACtB,KAAK,OAAO,KAAK,EAAI,CAAC,EACtB,KAAK,OAAO,SAAS,EAAI,KAAK,EAC9B,KAAK,OAAO,UAAU,EAAI,MAAM,EAChC,KAAK,OAAO,cAAc,EAAI,MAAM,EACpC,KAAK,OAAO,mBAAmB,EAAI,CACvC,CAUA,KAAe,EAAwB,CACnC,MAAM,KAAK,CAAO,EAElB,IAAM,EAAK,GAAW,KAAK,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