ElementButton
Index
Interfaces
Options
Various options that can be passed along to ElementButton.Create
optionalclickDisabled
A click event listener to-be fired when a button is disabled via aria-disabled: "true"
.
Type declaration
Parameters
this: HTMLButtonElement
event: MouseEvent
Returns any
optionaldisabled
Whether the button should be disabled or not
optionalicons
Button icons to-be displayed in the top-left corner of the button.
Alternatively, one can directly pass the icon's HTMLImageElement.src and its tooltip component.
optionalimage
A background image for the button
optionallabel
A button label
optionallabelPosition
The position of the button label
optionalnoStyling
Whether to limit the default styling of the button's border and background
optionalrole
The role of the button. All accepted values are currently special-cased in order to set role-specific event listeners and/or attributes.
optionaltooltip
Optional tooltip content. If not supplied then one should manually prepend it to the tooltip later
optionaltooltipPosition
The position of the tooltip w.r.t. the button
Functions
Create
Parameters
id: string
onClick: (this: HTMLButtonElement, ev: MouseEvent | TouchEvent) => any
optionaloptions: Options = null
htmlOptions: Partial<Record<button | img | label | tooltip, Omit<HTMLOptions<any>, tag>>> = null
Returns HTMLButtonElement
CreateForActivity
Parameters
idPrefix: string
activity: ItemActivity
C: Character
onClick: (this: HTMLButtonElement, ev: MouseEvent | TouchEvent) => any
optionaloptions: Options = null
htmlOptions: Partial<Record<button | img | label | tooltip, Omit<HTMLOptions<any>, tag>>> = null
Returns HTMLButtonElement
CreateForAsset
Parameters
idPrefix: string
asset: Asset | Item
C: Character
onClick: (this: HTMLButtonElement, ev: MouseEvent | TouchEvent) => any
optionaloptions: Options = null
htmlOptions: Partial<Record<button | img | label | tooltip, Omit<HTMLOptions<any>, tag>>> = null
Returns HTMLButtonElement
ReloadAssetIcons
_KeyDownRadio
Parameters
rest...this: any
ev: KeyboardEvent
Returns void
_ParseIcons
Parameters
id: string
optionalicons: readonly (InventoryIcon | { iconSrc: string; name: string; tooltipText: string | Node })[]
Returns { iconGrid: HTMLDivElement; tooltip: (string | HTMLElement)[] }
iconGrid: HTMLDivElement
tooltip: (string | HTMLElement)[]
_QueryDFS
Parameters
root: Element
query: string
filter: (el: Element) => boolean
Returns Generator<Element, void, any>
Namespace for creating HTML buttons