Window
A window with a title bar and three control buttons. Minimizing hides the window, maximizing makes it fill the screen and closing removes it from the page.
Import
Importing the library registers <pix-window>.
import '@ilusiva/pix';Basic
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
label | string | '' | Text shown in the title bar. |
minimized | boolean | false | Hides the window while it stays open. Remove it to show the window again. |
maximized | boolean | false | Makes the window fill the screen. |
inactive | boolean | false | Marks the window as not being the one in use, which mutes its title bar. |
resizable | boolean | false | Lets the window be resized by dragging its edges and corners. Only the right and bottom edges work when the window is not positioned. |
Methods
| Method | Description |
|---|---|
focusContent(): Promise<void> | Moves the keyboard focus into the window: to the first control of its content, such as a field or a terminal, or to the window itself when it has none. |
close(): void | Fires the close event and removes the window from the page, unless the event is cancelled. |
minimize(): void | Hides the window, keeping it open, and fires the minimize event. |
maximize(): void | Makes the window fill the screen and fires the maximize event. The inline position and size of the window are set aside until it is restored, since they would keep it from filling the screen. Does nothing when the window is already maximized. |
restore(): void | Returns a maximized window to the position and size it had and fires the maximize event, the same one that maximizing fires. Does nothing when the window is not maximized, and does not show a minimized window. |
Events
| Name | Description |
|---|---|
close | The window is about to be removed from the page. Cancel the event to keep it. |
minimize | The window was minimized. |
maximize | The window was maximized or restored to its size. |
resize | The window was resized by dragging an edge or a corner. |
Style properties
| Name | Description |
|---|---|
--pix-window-inset-bottom | Height left free under a maximized window, for a taskbar. |
--pix-window-padding | Space between the border of the window and its content. Defaults to `--pix-space-4`. |
Slots
| Name | Description |
|---|---|
| default | Content of the window. |