2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
import{_ as t,a,b as r,ag as n}from"./chunks/framework.BcrMLAmg.js";const m=JSON.parse('{"title":"Container","description":"","frontmatter":{},"headers":[],"relativePath":"references/elements/Container.md","filePath":"references/elements/Container.md","lastUpdated":1757844696000}'),i={name:"references/elements/Container.md"};function d(o,e,l,h,c,s){return r(),a("div",null,e[0]||(e[0]=[n('<h1 id="container" tabindex="-1">Container <a class="header-anchor" href="#container" aria-label="Permalink to "Container""></a></h1><p><em>The Container class serves as a fundamental building block for organizing UI elements. It acts as a parent element that can hold and manage child elements.</em></p><p>Extends: <code>VisualElement</code></p><h2 id="properties" tabindex="-1">Properties <a class="header-anchor" href="#properties" aria-label="Permalink to "Properties""></a></h2><table tabindex="0"><thead><tr><th>Property</th><th>Type</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td>children</td><td>table</td><td>{}</td><td>The children of the container</td></tr><tr><td>childrenSorted</td><td>boolean</td><td>true</td><td>Whether the children are sorted</td></tr><tr><td>childrenEventsSorted</td><td>boolean</td><td>true</td><td>Whether the children events are sorted</td></tr><tr><td>childrenEvents</td><td>table</td><td>{}</td><td>The children events of the container</td></tr><tr><td>eventListenerCount</td><td>table</td><td>{}</td><td>The event listener count of the container</td></tr><tr><td>focusedChild</td><td>table</td><td>nil</td><td>The focused child of the container</td></tr><tr><td>visibleChildren</td><td>table</td><td>{}</td><td>The visible children of the container</td></tr><tr><td>visibleChildrenEvents</td><td>table</td><td>{}</td><td>The visible children events of the container</td></tr><tr><td>offsetX</td><td>number</td><td>0</td><td>Horizontal content offset</td></tr><tr><td>offsetY</td><td>number</td><td>0</td><td>Vertical content offset</td></tr></tbody></table><h2 id="functions" tabindex="-1">Functions <a class="header-anchor" href="#functions" aria-label="Permalink to "Functions""></a></h2><table tabindex="0"><thead><tr><th>Method</th><th>Returns</th><th>Description</th></tr></thead><tbody><tr><td><a href="#container-ischildvisible-child">Container:isChildVisible</a></td><td>boolean</td><td>Returns whether a child is visible</td></tr><tr><td><a href="#container-addchild-child">Container:addChild</a></td><td>Container</td><td>Adds a child to the container</td></tr><tr><td><a href="#container-clear">Container:clear</a></td><td>Container</td><td>Clears the container</td></tr><tr><td><a href="#container-sortchildren">Container:sortChildren</a></td><td>Container</td><td>Sorts the children of the container</td></tr><tr><td><a href="#container-sortchildrenevents-eventname">Container:sortChildrenEvents</a></td><td>Container</td><td>Sorts the children events of the container</td></tr><tr><td><a href="#container-registerchildrenevents-child">Container:registerChildrenEvents</a></td><td>Container</td><td>Registers the children events of the container</td></tr><tr><td><a href="#container-registerchildevent-child-eventname">Container:registerChildEvent</a></td><td>Container</td><td>Registers the children events of the container</td></tr><tr><td><a href="#container-removechildrenevents-child">Container:removeChildrenEvents</a></td><td>Container</td><td>Unregisters the children events of the container</td></tr><tr><td><a href="#container-unregisterchildevent-child-eventname">Container:unregisterChildEvent</a></td><td>Container</td><td>Unregisters the children events of the container</td></tr><tr><td><a href="#container-removechild-child">Container:removeChild</a></td><td>Container</td><td>Removes a child from the container</td></tr><tr><td><a href="#container-getchild-path">Container:getChild</a></td><td>self</td><td>Removes a child from the container</td></tr><tr><td><a href="#container-callchildrenevent-visibleonly-event">Container:callChildrenEvent</a></td><td>boolean, child</td><td>Calls a event on all children</td></tr></tbody></table><h2 id="container-ischildvisible-child" tabindex="-1">Container:isChildVisible(child) <a class="header-anchor" href="#container-ischildvisible-child" aria-label="Permalink to "Container:isChildVisible(child)""></a></h2><p>Returns whether a child is visible</p><h3 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>child</code> <code>table</code> The child to check</li></ul><h3 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to "Returns""></a></h3><ul><li><code>boolean</code> <code>boolean</code> the child is visible</li></ul><h2 id="container-addchild-child" tabindex="-1">Container:addChild(child) <a class="header-anchor" href="#container-addchild-child" aria-label="Permalink to "Container:addChild(child)""></a></h2><p>Adds a child to the container</p><h3 id="parameters-1" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-1" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>child</code> <code>table</code> The child to add</li></ul><h3 id="returns-1" tabindex="-1">Returns <a class="header-anchor" href="#returns-1" aria-label="Permalink to "Returns""></a></h3><ul><li><code>Container</code> <code>self</code> The container instance</li></ul><h2 id="container-clear" tabindex="-1">Container:clear() <a class="header-anchor" href="#container-clear" aria-label="Permalink to "Container:clear()""></a></h2><p>Clears the container</p><h3 id="returns-2" tabindex="-1">Returns <a class="header-anchor" href="#returns-2" aria-label="Permalink to "Returns""></a></h3><ul><li><code>Container</code> <code>self</code> The container instance</li></ul><h2 id="container-sortchildren" tabindex="-1">Container:sortChildren() <a class="header-anchor" href="#container-sortchildren" aria-label="Permalink to "Container:sortChildren()""></a></h2><p>Sorts the children of the container</p><h3 id="returns-3" tabindex="-1">Returns <a class="header-anchor" href="#returns-3" aria-label="Permalink to "Returns""></a></h3><ul><li><code>Container</code> <code>self</code> The container instance</li></ul><h2 id="container-sortchildrenevents-eventname" tabindex="-1">Container:sortChildrenEvents(eventName) <a class="header-anchor" href="#container-sortchildrenevents-eventname" aria-label="Permalink to "Container:sortChildrenEvents(eventName)""></a></h2><p>Sorts the children events of the container</p><h3 id="parameters-2" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-2" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>eventName</code> <code>string</code> The event name to sort</li></ul><h3 id="returns-4" tabindex="-1">Returns <a class="header-anchor" href="#returns-4" aria-label="Permalink to "Returns""></a></h3><ul><li><code>Container</code> <code>self</code> The container instance</li></ul><h2 id="container-registerchildrenevents-child" tabindex="-1">Container:registerChildrenEvents(child) <a class="header-anchor" href="#container-registerchildrenevents-child" aria-label="Permalink to "Container:registerChildrenEvents(child)""></a></h2><p>Registers the children events of the container</p><h3 id="parameters-3" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-3" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>child</code> <code>table</code> The child to register events for</li></ul><h3 id="returns-5" tabindex="-1">Returns <a class="header-anchor" href="#returns-5" aria-label="Permalink to "Returns""></a></h3><ul><li><code>Container</code> <code>self</code> The container instance</li></ul><h2 id="container-registerchildevent-child-eventname" tabindex="-1">Container:registerChildEvent(child, eventName) <a class="header-anchor" href="#container-registerchildevent-child-eventname" aria-label="Permalink to "Container:registerChildEvent(child, eventName)""></a></h2><p>Registers the children events of the container</p><h3 id="parameters-4" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-4" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>child</code> <code>table</code> The child to register events for</li><li><code>eventName</code> <code>string</code> The event name to register</li></ul><h3 id="returns-6" tabindex="-1">Returns <a class="header-anchor" href="#returns-6" aria-label="Permalink to "Returns""></a></h3><ul><li><code>Container</code> <code>self</code> The container instance</li></ul><h2 id="container-removechildrenevents-child" tabindex="-1">Container:removeChildrenEvents(child) <a class="header-anchor" href="#container-removechildrenevents-child" aria-label="Permalink to "Container:removeChildrenEvents(child)""></a></h2><p>Unregisters the children events of the container</p><h3 id="parameters-5" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-5" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>child</code> <code>table</code> The child to unregister events for</li></ul><h3 id="returns-7" tabindex="-1">Returns <a class="header-anchor" href="#returns-7" aria-label="Permalink to "Returns""></a></h3><ul><li><code>Container</code> <code>self</code> The container instance</li></ul><h2 id="container-unregisterchildevent-child-eventname" tabindex="-1">Container:unregisterChildEvent(child, eventName) <a class="header-anchor" href="#container-unregisterchildevent-child-eventname" aria-label="Permalink to "Container:unregisterChildEvent(child, eventName)""></a></h2><p>Unregisters the children events of the container</p><h3 id="parameters-6" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-6" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>child</code> <code>table</code> The child to unregister events for</li><li><code>eventName</code> <code>string</code> The event name to unregister</li></ul><h3 id="returns-8" tabindex="-1">Returns <a class="header-anchor" href="#returns-8" aria-label="Permalink to "Returns""></a></h3><ul><li><code>Container</code> <code>self</code> The container instance</li></ul><h2 id="container-removechild-child" tabindex="-1">Container:removeChild(child) <a class="header-anchor" href="#container-removechild-child" aria-label="Permalink to "Container:removeChild(child)""></a></h2><p>Removes a child from the container</p><h3 id="parameters-7" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-7" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>child</code> <code>table</code> The child to remove</li></ul><h3 id="returns-9" tabindex="-1">Returns <a class="header-anchor" href="#returns-9" aria-label="Permalink to "Returns""></a></h3><ul><li><code>Container</code> <code>self</code> The container instance</li></ul><h2 id="container-getchild-path" tabindex="-1">Container:getChild(path) <a class="header-anchor" href="#container-getchild-path" aria-label="Permalink to "Container:getChild(path)""></a></h2><p>Removes a child from the container</p><h3 id="parameters-8" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-8" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>path</code> <code>string</code> The path to the child to remove</li></ul><h3 id="returns-10" tabindex="-1">Returns <a class="header-anchor" href="#returns-10" aria-label="Permalink to "Returns""></a></h3><ul><li><code>self</code> <code>The</code> container instance</li></ul><h2 id="container-callchildrenevent-visibleonly-event" tabindex="-1">Container:callChildrenEvent(visibleOnly, event) <a class="header-anchor" href="#container-callchildrenevent-visibleonly-event" aria-label="Permalink to "Container:callChildrenEvent(visibleOnly, event)""></a></h2><p>Calls a event on all children</p><h3 id="parameters-9" tabindex="-1">Parameters <a class="header-anchor" href="#parameters-9" aria-label="Permalink to "Parameters""></a></h3><ul><li><code>visibleOnly</code> <code>boolean</code> Whether to only call the event on visible children</li><li><code>event</code> <code>string</code> The event to call</li></ul><h3 id="returns-11" tabindex="-1">Returns <a class="header-anchor" href="#returns-11" aria-label="Permalink to "Returns""></a></h3><ul><li><code>boolean</code> <code>handled</code> Whether the event was handled</li><li><code>child</code> <code>The</code> child that handled the event</li></ul>',75)]))}const b=t(i,[["render",d]]);export{m as __pageData,b as default};
|