Files
Basalt2/docs/.vitepress/dist/assets/references_elements_ComboBox.md.DB1XZzak.js
2025-09-16 17:41:40 +02:00

2 lines
7.2 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as t,a as o,b as a,ag as r}from"./chunks/framework.BcrMLAmg.js";const m=JSON.parse('{"title":"ComboBox","description":"","frontmatter":{},"headers":[],"relativePath":"references/elements/ComboBox.md","filePath":"references/elements/ComboBox.md","lastUpdated":1757846084000}'),d={name:"references/elements/ComboBox.md"};function l(n,e,h,b,s,c){return a(),o("div",null,e[0]||(e[0]=[r('<h1 id="combobox" tabindex="-1">ComboBox <a class="header-anchor" href="#combobox" aria-label="Permalink to &quot;ComboBox&quot;"></a></h1><p><em>This is the ComboBox class. It extends the dropdown functionality with editable text input,</em><em>allowing users to either select from a list or type their own custom text.</em></p><p>Extends: <code>DropDown</code></p><h2 id="properties" tabindex="-1">Properties <a class="header-anchor" href="#properties" aria-label="Permalink to &quot;Properties&quot;"></a></h2><table tabindex="0"><thead><tr><th>Property</th><th>Type</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td>editable</td><td>boolean</td><td>true</td><td>Whether the ComboBox allows text input</td></tr><tr><td>text</td><td>string</td><td>&quot;&quot;</td><td>The current text content of the ComboBox</td></tr><tr><td>cursorPos</td><td>number</td><td>1</td><td>The current cursor position in the text</td></tr><tr><td>viewOffset</td><td>number</td><td>0</td><td>The horizontal scroll offset for viewing long text</td></tr><tr><td>placeholder</td><td>string</td><td>&quot;...&quot;</td><td>Text to display when input is empty</td></tr><tr><td>placeholderColor</td><td>color</td><td>gray</td><td>Color of the placeholder text</td></tr><tr><td>focusedBackground</td><td>color</td><td>blue</td><td>Background color when ComboBox is focused</td></tr><tr><td>focusedForeground</td><td>color</td><td>white</td><td>Foreground color when ComboBox is focused</td></tr><tr><td>autoComplete</td><td>boolean</td><td>false</td><td>Whether to enable auto-complete filtering when typing</td></tr><tr><td>manuallyOpened</td><td>boolean</td><td>false</td><td>Whether the dropdown was manually opened (not by auto-complete)</td></tr></tbody></table><h2 id="functions" tabindex="-1">Functions <a class="header-anchor" href="#functions" aria-label="Permalink to &quot;Functions&quot;"></a></h2><table tabindex="0"><thead><tr><th>Method</th><th>Returns</th><th>Description</th></tr></thead><tbody><tr><td><a href="#combobox-new">ComboBox.new</a></td><td>ComboBox</td><td>Creates a new ComboBox instance</td></tr><tr><td><a href="#combobox-settext-text">ComboBox:setText</a></td><td>ComboBox</td><td>Sets the text content</td></tr><tr><td><a href="#combobox-gettext">ComboBox:getText</a></td><td>string</td><td>Gets the text content</td></tr><tr><td><a href="#combobox-seteditable-editable">ComboBox:setEditable</a></td><td>ComboBox</td><td>Sets editable state</td></tr><tr><td><a href="#combobox-char-char">ComboBox:char</a></td><td>-</td><td>Handles character input</td></tr><tr><td><a href="#combobox-key-key-held">ComboBox:key</a></td><td>-</td><td>Handles key input</td></tr><tr><td><a href="#combobox-render">ComboBox:render</a></td><td>-</td><td>Renders the ComboBox</td></tr><tr><td><a href="#combobox-focus">ComboBox:focus</a></td><td>-</td><td>Called when gaining focus</td></tr><tr><td><a href="#combobox-blur">ComboBox:blur</a></td><td>-</td><td>Called when losing focus</td></tr></tbody></table><h2 id="combobox-new" tabindex="-1">ComboBox.new() <a class="header-anchor" href="#combobox-new" aria-label="Permalink to &quot;ComboBox.new()&quot;"></a></h2><p>Creates a new ComboBox instance</p><h3 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ul><li><code>ComboBox</code> <code>self</code> The newly created ComboBox instance</li></ul><h2 id="combobox-settext-text" tabindex="-1">ComboBox:setText(text) <a class="header-anchor" href="#combobox-settext-text" aria-label="Permalink to &quot;ComboBox:setText(text)&quot;"></a></h2><p>Sets the text content of the ComboBox</p><h3 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to &quot;Parameters&quot;"></a></h3><ul><li><code>text</code> <code>string</code> The text to set</li></ul><h3 id="returns-1" tabindex="-1">Returns <a class="header-anchor" href="#returns-1" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ul><li><code>ComboBox</code> self</li></ul><h2 id="combobox-gettext" tabindex="-1">ComboBox:getText() <a class="header-anchor" href="#combobox-gettext" aria-label="Permalink to &quot;ComboBox:getText()&quot;"></a></h2><p>Gets the current text content</p><h3 id="returns-2" tabindex="-1">Returns <a class="header-anchor" href="#returns-2" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ul><li><code>string</code> <code>text</code> The current text</li></ul><h2 id="combobox-seteditable-editable" tabindex="-1">ComboBox:setEditable(editable) <a class="header-anchor" href="#combobox-seteditable-editable" aria-label="Permalink to &quot;ComboBox:setEditable(editable)&quot;"></a></h2><p>Sets whether the ComboBox is editable</p><h3 id="parameters-1" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-1" aria-label="Permalink to &quot;Parameters&quot;"></a></h3><ul><li><code>editable</code> <code>boolean</code> Whether the ComboBox should be editable</li></ul><h3 id="returns-3" tabindex="-1">Returns <a class="header-anchor" href="#returns-3" aria-label="Permalink to &quot;Returns&quot;"></a></h3><ul><li><code>ComboBox</code> self</li></ul><h2 id="combobox-char-char" tabindex="-1">ComboBox:char(char) <a class="header-anchor" href="#combobox-char-char" aria-label="Permalink to &quot;ComboBox:char(char)&quot;"></a></h2><p>Handles character input when editable</p><h3 id="parameters-2" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-2" aria-label="Permalink to &quot;Parameters&quot;"></a></h3><ul><li><code>char</code> <code>string</code> The character that was typed</li></ul><h2 id="combobox-key-key-held" tabindex="-1">ComboBox:key(key, held) <a class="header-anchor" href="#combobox-key-key-held" aria-label="Permalink to &quot;ComboBox:key(key, held)&quot;"></a></h2><p>Handles key input when editable</p><h3 id="parameters-3" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-3" aria-label="Permalink to &quot;Parameters&quot;"></a></h3><ul><li><code>key</code> <code>number</code> The key code that was pressed</li><li><code>held</code> <code>boolean</code> Whether the key is being held</li></ul><h2 id="combobox-render" tabindex="-1">ComboBox:render() <a class="header-anchor" href="#combobox-render" aria-label="Permalink to &quot;ComboBox:render()&quot;"></a></h2><p>Renders the ComboBox</p><h2 id="combobox-focus" tabindex="-1">ComboBox:focus() <a class="header-anchor" href="#combobox-focus" aria-label="Permalink to &quot;ComboBox:focus()&quot;"></a></h2><p>Called when the ComboBox gains focus</p><h2 id="combobox-blur" tabindex="-1">ComboBox:blur() <a class="header-anchor" href="#combobox-blur" aria-label="Permalink to &quot;ComboBox:blur()&quot;"></a></h2><p>Called when the ComboBox loses focus</p>',41)]))}const x=t(d,[["render",l]]);export{m as __pageData,x as default};