Skip to content

Class ModalsManager

Source: modalsManager.ts

Manages the opening, closing and ordering of modals.

Constructors

Constructor

new ModalsManager(): ModalsManager

Returns

ModalsManager

Properties

modals

modals: Record<string, Modal> = {}

Maps every modal ID to the corresponding modal.


containerRef?

optional containerRef: MutableRefObject<HTMLElement>


updateModals()

updateModals: (modals: Record<string, Modal>) => void

Function that handles changes to modals.

Parameters

modals

Record<string, Modal>

Returns

void

Methods

getModalIconUrl()

static getModalIconUrl(name: string): string

Parameters

name

string

Returns

string


open()

open(modal: Modal, single: boolean): void

Opens a modal.

Parameters

Modal

The modal to open.

single

boolean = true

Set to false to preserve other open modals.

Returns

void


close()

close(modalId: string | number, sendModalsUpdate: boolean): void

Closes a modal.

Parameters

modalId

The ID of the modal to close.

string | number

sendModalsUpdate

boolean = true

Returns

void


focus()

focus(modalId: string): void

Brings a modal into focus.

Parameters

modalId

string

The ID of the modal to bring into focus.

Returns

void


setUpdateModals()

setUpdateModals(updateModals: (modals: Record<string, Modal>) => void): void

Parameters

updateModals

(modals: Record<string, Modal>) => void

Returns

void

Accessors

modalIds

Get Signature

get modalIds(): string[]

Returns the IDs of all open modals.

Returns

string[]

Built by Prozilla