Skip to main content

Class: ItemSlots<T>

Type parameters

NameType
Tnumber

Constructors

constructor

new ItemSlots<T>(options?): ItemSlots<T>

Type parameters

NameType
Tnumber

Parameters

NameType
optionsPartial<ItemSlotsOptions>

Returns

ItemSlots<T>

Properties

activated

activated: boolean = false


canvas

canvas: HTMLCanvasElement


focusedCol

focusedCol: number = -1


focusedRow

focusedRow: number = -1


hoveredCol

hoveredCol: number = -1


hoveredRow

hoveredRow: number = -1


onSlotClick

onSlotClick: (slot: ItemSlot<T>) => void = noop

Type declaration

▸ (slot): void

Parameters
NameType
slotItemSlot<T>
Returns

void


onSlotUpdate

onSlotUpdate: (slot: ItemSlot<T>) => void = noop

Type declaration

▸ (slot): void

Parameters
NameType
slotItemSlot<T>
Returns

void


options

options: ItemSlotsOptions


renderer

renderer: WebGLRenderer


slotTotalHeight

slotTotalHeight: number


slotTotalWidth

slotTotalWidth: number


wrapper

wrapper: HTMLDivElement

Accessors

element

get element(): HTMLDivElement

Returns

HTMLDivElement

Methods

activate

activate(): void

Returns

void


connect

connect(inputs, namespace?): () => void

Parameters

NameTypeDefault value
inputsInputs<any>undefined
namespacestring"*"

Returns

fn

▸ (): void

Returns

void


deactivate

deactivate(): void

Returns

void


getContent

getContent(row, col): T

Parameters

NameType
rownumber
colnumber

Returns

T


getFocused

getFocused(): ItemSlot<T>

Returns

ItemSlot<T>


getObject

getObject(row, col): Object3D<Object3DEventMap>

Parameters

NameType
rownumber
colnumber

Returns

Object3D<Object3DEventMap>


getRowColFromEvent

getRowColFromEvent(event): Object

Parameters

NameType
eventMouseEvent

Returns

Object

NameType
colnumber
rownumber

getSlot

getSlot(row, col): ItemSlot<T>

Parameters

NameType
rownumber
colnumber

Returns

ItemSlot<T>


getSubscript

getSubscript(row, col): string

Parameters

NameType
rownumber
colnumber

Returns

string


onFocusChange

onFocusChange(callbackFunc): void

Parameters

NameType
callbackFunc(prevSlot: ItemSlot<T>, nextSlot: ItemSlot<T>) => void

Returns

void


render

render(): void

Returns

void


setContent

setContent(row, col, content): void

Parameters

NameType
rownumber
colnumber
contentT

Returns

void


setFocused

setFocused(row, col): void

Parameters

NameType
rownumber
colnumber

Returns

void


setObject

setObject(row, col, object): void

Parameters

NameType
rownumber
colnumber
objectObject3D<Object3DEventMap>

Returns

void


setSubscript

setSubscript(row, col, subscript): void

Parameters

NameType
rownumber
colnumber
subscriptstring

Returns

void


triggerFocusChange

triggerFocusChange(prevSlot, nextSlot): void

Parameters

NameType
prevSlotItemSlot<T>
nextSlotItemSlot<T>

Returns

void