Skip to main content

ElementButton

Namespace for creating HTML buttons

Index

Functions

Create

  • Create(id: string, onClick: (this: HTMLButtonElement, ev: MouseEvent | TouchEvent) => any, options?: { disabled: boolean; icons: readonly InventoryIcon[]; image: string; label: string; labelPosition: center | bottom | top; noStyling: boolean; role: radio | checkbox | menuitemradio | menuitemcheckbox; tooltip: string | Node | readonly (string | Node)[]; tooltipPosition: left | right | bottom | top }, htmlOptions?: Partial<Record<button | img | label | tooltip, Omit<HTMLOptions<any>, tag>>>): HTMLButtonElement
  • Parameters

    • id: string
    • onClick: (this: HTMLButtonElement, ev: MouseEvent | TouchEvent) => any
      • optionaloptions: { disabled: boolean; icons: readonly InventoryIcon[]; image: string; label: string; labelPosition: center | bottom | top; noStyling: boolean; role: radio | checkbox | menuitemradio | menuitemcheckbox; tooltip: string | Node | readonly (string | Node)[]; tooltipPosition: left | right | bottom | top } = null
        • disabled: boolean
        • icons: readonly InventoryIcon[]
        • image: string
        • label: string
        • labelPosition: center | bottom | top
        • noStyling: boolean
        • role: radio | checkbox | menuitemradio | menuitemcheckbox
        • tooltip: string | Node | readonly (string | Node)[]
        • tooltipPosition: left | right | bottom | top
      • htmlOptions: Partial<Record<button | img | label | tooltip, Omit<HTMLOptions<any>, tag>>> = null

      Returns HTMLButtonElement

    _KeyDownRadio

    • _KeyDownRadio(...this: any, ev: KeyboardEvent): void
    • Parameters

      • rest...this: any
      • ev: KeyboardEvent

      Returns void

    _ParseIcons

    • _ParseIcons(id: string, icons?: readonly InventoryIcon[]): { iconGrid: HTMLDivElement; tooltip: HTMLUListElement }
    • Parameters

      Returns { iconGrid: HTMLDivElement; tooltip: HTMLUListElement }

      • iconGrid: HTMLDivElement
      • tooltip: HTMLUListElement

    _QueryDFS

    • _QueryDFS(root: Element, query: string, filter: (el: Element) => boolean): Generator<Element, void, any>
    • Parameters

      • root: Element
      • query: string
      • filter: (el: Element) => boolean

        Returns Generator<Element, void, any>