Type Parameters

Hierarchy

Constructors

  • Type Parameters

    Parameters

    • id: DialogId
    • subId: string = ""
    • initializeSubpanels: boolean = true

    Returns default<T>

Properties

activePanel: undefined | T
activeSubpanel: undefined | SubpanelInformation
body: default<HTMLElement>
edges: IDialogEdges = ...

The positions of each edge of the dialog. Stored as percentages.

entered: boolean = false
event: IEventEmitter<default<T>, ITabDialogEvents>
header: Header
internalDialog: default<HTMLElement>
log: default
observing?: boolean
panelWrapper: default<HTMLElement>
removed?: string | boolean
scrollableHandler: void = ...
storePanels: boolean = true
subId: string = ""
subpanelInformations: SubpanelInformation[] = []
subpanelLinkWrapper: default<HTMLElement>
subpanels: T[]

Accessors

  • get childCount(): number
  • The number of child elements of this component.

    Returns number

  • get dataset(): DOMStringMap
  • The dataset of the internal element.

    Returns DOMStringMap

  • get element(): E
  • The element that this Component instance wraps.

    Returns E

  • get footer(): Footer
  • Returns Footer

  • get selectable(): false | SelectableLayer
  • The selectable layer of this element, or false if it is not selectable.

    Returns false | SelectableLayer

  • get square(): boolean
  • Returns boolean

Methods

  • Alias of .element.addEventListener, except it returns this instead and prevents memory leaks

    Type Parameters

    • K extends keyof HTMLElementEventMap

    Parameters

    • type: K
    • listener: ((this: HTMLElement, ev: HTMLElementEventMap[K]) => any)
        • (this: HTMLElement, ev: HTMLElementEventMap[K]): any
        • Parameters

          • this: HTMLElement
          • ev: HTMLElementEventMap[K]

          Returns any

    • Optional options: boolean | AddEventListenerOptions

    Returns default<T>

  • Parameters

    • id: string | number

    Returns default<HTMLElement>

  • Parameters

    • type: "auto" | "scroll" = "scroll"
    • Optional initializer: ((wrapper: default<HTMLElement>) => any)
        • (wrapper: default<HTMLElement>): any
        • Parameters

          Returns any

    Returns default<HTMLElement>

  • Appends every element of a list of components/elements.

    Parameters

    • Rest ...elements: ArrayOfIterablesOr<undefined | false | HTMLElement | default<HTMLElement>>

      A varargs list of elements or iterables of elements. Falsy values are skipped

    Returns default<T>

  • Appends every element of a list of components/elements.

    Parameters

    • appendStrategy: AppendStrategy

      Where in this component to insert new components. See AppendStrategy

    • Rest ...elements: ArrayOfIterablesOr<undefined | false | HTMLElement | default<HTMLElement>>

      A varargs list of elements or iterables of elements. Falsy values are skipped

    Returns default<T>

  • Appends this component to another element, by selector, element, or component.

    Parameters

    • Optional where: null | string | HTMLElement | default<HTMLElement>

      A CSS selector, an element, or a component to append this component to.

    • Optional appendStrategy: AppendStrategy

      Where in the new container to insert this component. See AppendStrategy

    Returns default<T>

  • Closes the dialog.

    Also the event handler for when the close button is pressed in the dialog's header.

    Returns Promise<boolean>

  • An alias for element.closest(selector)

    Parameters

    • selector: string

    Returns null | Element

  • Returns whether this component contains the given element.

    Parameters

    • Optional what: null | string | Node | default<HTMLElement>

    Returns boolean

  • Removes all children.

    Returns default<T>

  • Removes all children that are not filtered out with the given filter function.

    Parameters

    • Optional filter: ((element: HTMLElement, component?: default<HTMLElement>) => boolean)

      A function that returns true if the child should be kept.

        • (element: HTMLElement, component?: default<HTMLElement>): boolean
        • Parameters

          • element: HTMLElement
          • Optional component: default<HTMLElement>

          Returns boolean

    Returns default<T>

  • Returns boolean

  • An alias for element.querySelectorAll(selector)

    Type Parameters

    • E extends HTMLElement = HTMLElement

    Parameters

    • selector: string

    Returns NodeListOf<E>

  • Makes this dialog the top dialog.

    Returns void

  • Type Parameters

    Parameters

    • cls: Class<C, any[]>

    Returns undefined | C

  • Returns undefined | default

  • A cached alias for element.getBoundingClientRect(). Boxes are updated or regenerated as ancestors shift.

    Parameters

    • regenIfZero: boolean = true
    • forceRegen: boolean = false

    Returns default

  • Returns a stream of this component's child components. Child elements that don't have associated components will be undefined.

    Type Parameters

    Parameters

    • Optional selector: string

      A selector that each element must match to be included in the result stream

    Returns Stream<C>

  • Returns this component's containing dialog, if it exists.

    Type Parameters

    Returns null | D

  • Returns the index of this component amongst its sibling nodes. If it has no parent, it returns undefined.

    Parameters

    • elementsOnly: boolean = false

    Returns undefined | number

  • Returns this component's containing menu, if it exists.

    Type Parameters

    Returns null | M

  • Returns the nth child, defaulting to the first child

    Type Parameters

    • C extends undefined | default<HTMLElement> = undefined | default<HTMLElement>

    Parameters

    • nth: number = 0

    Returns undefined | C

  • Returns an object containing HTMLElement.offsetTop and HTMLElement.offsetLeft

    Returns {
        left: number;
        top: number;
    }

    • left: number
    • top: number
  • Parameters

    • id: string | number

    Returns undefined | default<HTMLElement>

  • Returns this component's parent component, if it exists.

    Type Parameters

    • C extends undefined | default<HTMLElement> = undefined | default<HTMLElement>

    Returns null | C

  • Returns this component's containing dialog, if it exists.

    Type Parameters

    Returns null | S

  • Implements the abstract method in "TabDialog". Returns an array of tuples containing information used to set-up the subpanels of this dialog.

    If the subpanel classes haven't been instantiated yet, it first instantiates them by calling getSubpanels. This includes binding a WillRemove event handler to the panel, which will store (cache) the panel instead of removing it, and trigger a SwitchAway event on the panel when this occurs.

    Parameters

    • subpanels: T[]

    Returns SubpanelInformation[]

  • Implements the abstract method in "TabDialog". Returns an array of subpanels. This will only be called once

    Returns T[]

  • Hides the element. If a tooltip is shown for this element, hides that as well.

    Returns default<T>

  • Returns void

  • Returns boolean

  • Returns boolean

  • Parameters

    • id: string | number

    Returns boolean

  • Returns boolean

  • Returns whether the element is visible.

    Returns boolean

  • Mark that this dialog is "active"

    Parameters

    • reason: any

    Returns void

  • Mark that this dialog is not "active"

    Parameters

    • reason: any

    Returns void

  • Parameters

    • selector: string

    Returns boolean

  • Enables a intersection observe on this component and fires an observe event once when the element is first observed

    Returns void

  • Event handler for when this dialog is appended

    Returns void

  • Parameters

    • reason: "focus" | "mouse"

    Returns void

  • Parameters

    • reason: "remove" | "focus" | "mouse"

    Returns void

  • Returns void

  • Returns void

  • Parameters

    • _: any
    • Optional component: default<HTMLElement>

    Returns void

  • Returns a function that will be executed when the passed subpanel is shown.

    When executed, the return function will append the panel to show to the passed component (which is the panel wrapper of the TabDialog), and trigger a SwitchTo event on the panel.

    Parameters

    • showPanel: T

    Returns ((component: default<HTMLElement>) => void)

      • (component: default<HTMLElement>): void
      • Parameters

        Returns void

  • Type Parameters

    • N extends Node = Node

    Parameters

    • selector: string

    Returns null | N

  • Type Parameters

    • N extends Node = Node

    Parameters

    • selector: string

    Returns N[]

  • Parameters

    • reason: string

    Returns void

  • Returns void

  • Forcibly regenerates the cached result of Component.getBox for this component and all descendants.

    Parameters

    • descendants: boolean = true

    Returns void

  • Parameters

    • Rest ...untilEvents: (keyof ITabDialogEvents)[]

    Returns void

  • Parameters

    • warnIfNoHandlers: false
    • Rest ...untilEvents: (keyof ITabDialogEvents)[]

    Returns void

  • Parameters

    • Rest ...untilEvents: (keyof ITabDialogEvents)[]

    Returns void

  • Removes this element and all descendants.

    Returns default<T>

  • Type Parameters

    • K extends keyof HTMLElementEventMap

    Parameters

    • type: K
    • listener: ((this: HTMLElement, ev: HTMLElementEventMap[K]) => any)
        • (this: HTMLElement, ev: HTMLElementEventMap[K]): any
        • Parameters

          • this: HTMLElement
          • ev: HTMLElementEventMap[K]

          Returns any

    Returns default<T>

  • Returns void

  • Triggers a repaint on this element.

    Returns void

  • Returns void

  • Runs the given callback with the given arguments. this and the first argument are this element.

    Type Parameters

    • A extends any[]

    Parameters

    • Optional cb: ((this: default<T>, component: default<T>, ...args: A) => any)

      The callback to run.

    • Rest ...args: A

      The arguments with which to call the callback.

    Returns default<T>

  • Runs the given callback with the given arguments. this and the first argument are this element.

    Parameters

    • Optional cb: ((this: default<T>, component: default<T>) => any)

      The callback to run.

    • Rest ...args: any[]

      The arguments with which to call the callback.

    Returns default<T>

  • Runs the given callback with the given arguments, after the specified amount of time. this and the first argument are this element.

    Type Parameters

    • A extends any[]

    Parameters

    • ms: number

      The amount of time to wait before running the callback, in milliseconds.

    • cb: ((this: default<T>, component: default<T>, ...args: A) => any)

      The callback to run.

    • Rest ...args: A

      The arguments with which to call the callback.

    Returns default<T>

  • Runs the given callback with the given arguments, after the specified amount of time. this and the first argument are this element.

    Parameters

    • ms: number

      The amount of time to wait before running the callback, in milliseconds.

    • Optional cb: ((this: default<T>, component: default<T>) => any)

      The callback to run.

    • Rest ...args: any[]

      The arguments with which to call the callback.

    Returns default<T>

  • Runs the given callback with the given arguments, after the specified amount of time. this and the first argument are this element.

    Type Parameters

    • A extends any[]

    Parameters

    • ms: number

      The amount of time to wait before running the callback, in milliseconds.

    • debounce: number

      The span of time to debounce in. (If this callback was scheduled again in this time, skip this earlier call)

    • cb: ((this: default<T>, component: default<T>, ...args: A) => any)

      The callback to run.

    • Rest ...args: A

      The arguments with which to call the callback.

    Returns default<T>

  • Runs the given callback with the given arguments, after the specified amount of time. this and the first argument are this element.

    Parameters

    • ms: number

      The amount of time to wait before running the callback, in milliseconds.

    • debounce: number

      The span of time to debounce in. (If this callback was scheduled again in this time, skip this earlier call)

    • Optional cb: ((this: default<T>, component: default<T>) => any)

      The callback to run.

    • Rest ...args: any[]

      The arguments with which to call the callback.

    Returns default<T>

  • Scrolls this element so the given child is at the top of the viewport.

    Parameters

    • Optional child: HTMLElement | default<HTMLElement>

      The child to scroll to

    • Optional ms: number

      The time to take, defaulting to 1000 (1 second)

    Returns void

  • Scrolls this element so the given child is at the top of the viewport.

    Parameters

    • child: undefined | HTMLElement | default<HTMLElement>

      The child to scroll to

    • offsetTop: number

      An offset for the position to scroll to, relative to the position of the child

    • Optional ms: number

      The time to take, defaulting to 1000 (1 second)

    Returns void

  • Sets the contents of this element using innerHTML.

    Parameters

    • html: string

      The content, an HTML string. Script tags will not be executed, as per the normal functionality of innerHTML

    • escape: boolean = false

      Only the text within the HTML will be appended, not the tags.

    Returns default<T>

  • Removes the context menu from this element.

    Returns default<T>

  • Sets the context menu for this element.

    Parameters

    • generator: ((contextMenu: ContextMenu, api: IBindHandlerApi) => undefined | ContextMenu)
        • (contextMenu: ContextMenu, api: IBindHandlerApi): undefined | ContextMenu
        • Parameters

          Returns undefined | ContextMenu

    • Optional priority: number

    Returns default<T>

  • Set the position of an edge.

    Parameters

    • edge: Edge
    • position: number
    • transform: boolean = true

    Returns void

  • Warning: This method will replace the internal element backing this component.

    Only call this directly after constructing the element.

    Parameters

    • element: HTMLElement

    Returns default<T>

  • Warning: This method will replace the internal element backing this component.

    Only call this directly after constructing the element.

    Parameters

    • Optional elementType: string
    • Optional namespace: SVG

    Returns default<T>

  • Sets the ID of this component's element.

    Parameters

    • id: string

    Returns default<T>

  • Parameters

    • initialSelection: boolean = true

    Returns default<T>

  • Parameters

    • property: string
    • value: string | number

    Returns default<T>

  • Sets the tooltip options for this element. Setting the tooltip to undefined, or not providing the argument removes the tooltip options.

    Type Parameters

    • ARGS extends any[]

    Parameters

    • Optional initializer: ((tooltip: default, ...args: ARGS) => any)
        • (tooltip: default, ...args: ARGS): any
        • Parameters

          • tooltip: default
          • Rest ...args: ARGS

          Returns any

    • Rest ...args: ARGS

    Returns default<T>

  • Shows the element.

    Returns default<T>

  • Parameters

    • id: string | number
    • Optional disableAnimations: boolean

    Returns undefined | default<HTMLElement>

  • Parameters

    Returns void

  • Parameters

    • id: string | number

    Returns ((link: default) => void)

  • Returns a stream of this component's sibling components. Child elements that don't have associated components will be undefined.

    Type Parameters

    Parameters

    • Optional selector: string

      A selector that each element must match to be included in the result stream

    Returns Stream<C>

  • Returns

    a promise that resolves when either the given time has passed, or this component has been removed. Returns true if this component exists, false if it has been removed.

    Parameters

    • ms: number

    Returns Promise<boolean>

  • Moves this element to a hidden element, in order to retain any information the element had. This allows the element to be re-appended later without re-adding event handlers, CSS, or any other data.

    Parameters

    Returns default<T>

  • Parameters

    • duration: number = 5000

    Returns void

  • Toggles the visibility of this element. Internally uses show and hide.

    Parameters

    • visible: boolean = ...

      The new visiblity of this element.

    Returns default<T>

  • Toggle whether this dialog is "active"

    Parameters

    • reason: any
    • active: boolean

    Returns void

  • Returns void

  • Parameters

    • selector: string

    Returns Stream<default<HTMLElement>>

  • Parameters

    • elementToMove: string | HTMLElement | default<HTMLElement>
    • placeToAppendTo: string | HTMLElement | default<HTMLElement>
    • strategy: AppendStrategy = "append"

    Returns void

  • Parameters

    • inElement: HTMLElement | default<HTMLElement>
    • selector: string
    • includeSelf: boolean = false

    Returns HTMLElement[]

  • Parameters

    • selector: string

    Returns undefined | default<HTMLElement>

  • Parameters

    • element: Element | default<HTMLElement>

    Returns default<HTMLElement>

  • Parameters

    • event: Event

    Returns default<HTMLElement>

  • Parameters

    • element: undefined | null | false | Element | default<HTMLElement>

    Returns undefined | default<HTMLElement>

  • Parameters

    • selector: string
    • create: undefined | false

    Returns undefined | default<HTMLElement>

  • Parameters

    • element: Element | default<HTMLElement>
    • create: undefined | false

    Returns undefined | default<HTMLElement>

  • Parameters

    • event: Event
    • create: undefined | false

    Returns undefined | default<HTMLElement>

  • Parameters

    • element: undefined | null | false | Element | default<HTMLElement>
    • create: undefined | false

    Returns undefined | default<HTMLElement>

  • Type Parameters

    Parameters

    • selector: string

    Returns undefined | C

  • Type Parameters

    Parameters

    • element: Element | C

    Returns C

  • Type Parameters

    Parameters

    • event: Event

    Returns C

  • Type Parameters

    Parameters

    • element: undefined | null | false | Element | C

    Returns undefined | C

  • Type Parameters

    Parameters

    • selector: string
    • create: undefined | false

    Returns undefined | C

  • Type Parameters

    Parameters

    • element: Element | C
    • create: undefined | false

    Returns undefined | C

  • Type Parameters

    Parameters

    • event: Event
    • create: undefined | false

    Returns undefined | C

  • Type Parameters

    Parameters

    • element: undefined | null | false | Element | C
    • create: undefined | false

    Returns undefined | C

  • Parameters

    • element: HTMLElement | default<HTMLElement>

    Returns number | false

  • Parameters

    • element: HTMLElement

    Returns void

  • Parameters

    • elementToRemove: null | string | Element | ChildNode | default<HTMLElement>
    • force: boolean = false

    Returns void

Generated using TypeDoc