Class Window

This class represents a window with various settings and the ability to add child elements.

Hierarchy (view full)

Constructors

  • Creates a new window element.

    Parameters

    • options: {
          collapseThreshold?: number;
          collapsible?: boolean;
          dragThreshold?: number;
          draggable?: boolean;
          expanded?: boolean;
          height?: number;
          resizable?: boolean;
          title?: string;
          width?: number;
          x?: number;
          y?: number;
      }

      The options for the window

      • Optional collapseThreshold?: number

        The threshold at which the window can be collapsed

      • Optional collapsible?: boolean

        Whether the window can be collapsed

      • Optional dragThreshold?: number

        The threshold at which the window can be dragged

      • Optional draggable?: boolean

        Whether the window can be dragged

      • Optional expanded?: boolean

        Whether the window is initially expanded

      • Optional height?: number

        The height of the window

      • Optional resizable?: boolean

        Whether the window can be resized

      • Optional title?: string

        The title of the window

      • Optional width?: number

        The width of the window

      • Optional x?: number

        The x position of the window

      • Optional y?: number

        The y position of the window

    Returns Window

Properties

arrowRef: HTMLElement
collapsed: boolean
contentRef: HTMLElement
headerRef: HTMLElement
height: number
isDragging: boolean
isResizing: boolean
listeners: {
    [key: string]: Function[];
}

Type declaration

  • [key: string]: Function[]
ref: HTMLElement
resizeRef: HTMLElement
titleRef: HTMLElement
view: View
width: number
x: number
y: number

Accessors

Methods

  • The append function appends a widget to a parent element and updates the list of children.

    Parameters

    Returns this

  • The focus function sends the window to the top of the window stack and adds active class.

    Returns this

  • The getConfig function returns a JSON representation of all values in the window.

    Returns object

  • The loadConfig function loads a JSON configuration into the window.

    Parameters

    • config: object

      The JSON configuration.

    Returns this

  • The move function moves the window to the specified coordinates.

    Parameters

    • x: number

      The x coordinate of the window.

    • y: number

      The y coordinate of the window.

    Returns this

  • The resize function sets the width and height of the window.

    Parameters

    • width: number

      The new width of the window

    • height: number

      The new height of the window

    Returns this

  • The setContent function sets the content of a view.

    Parameters

    • value: string

      The value parameter in the setContent function represents the content that you want to set for a particular view. It is the data or information that you want to display or update in the view.

    Returns this

  • The setHeight function sets the height of the window.

    Parameters

    • height: number

    Returns this

  • The setText function sets the text value of a view element.

    Parameters

    • value: string

      The value parameter in the setText function represents the text that you want to set for a particular view. It is the text that you want to display or update in the view.

    Returns this

  • Set the title of the window to the specified HTML string.

    Parameters

    • html: string

      The HTML to set as the title

    Returns this

  • The setWidth function sets the width of the window.

    Parameters

    • width: number

    Returns this

  • The toggle function toggles the window between collapsed and expanded.

    Returns this