ToolbarButton

modules/toolbar/button.ToolbarButton

The base class of all Jodit UI components. Provides work with a life cycle.

Type parameters

Name Type
T extends IViewBased = IViewBased

Hierarchy

Implements

constructor

new ToolbarButton<T>(jodit, control, target?): ToolbarButton<T>

Type parameters

Name Type
T extends IViewBased<IViewOptions> = IViewBased<IViewOptions>

Parameters

Name Type Default value
jodit T undefined
control IControlTypeStrong undefined
target Nullable<HTMLElement> null

Returns

ToolbarButton<T>

Overrides

UIButton.constructor

Defined in

src/modules/toolbar/button/button.ts#214

STATUSES

Static STATUSES: Object = STATUSES

Type declaration

Name Type
beforeInit "beforeInit"
ready "ready"
beforeDestruct "beforeDestruct"
destructed "destructed"

Inherited from

UIButton.STATUSES

Defined in

src/core/component/component.ts#40


async

async: IAsync

Implementation of

IToolbarButton.async

Inherited from

UIButton.async

Defined in

src/core/component/component.ts#44


uid

Readonly uid: string

Implementation of

IToolbarButton.uid

Inherited from

UIButton.uid

Defined in

src/core/component/component.ts#59


ownerWindow

ownerWindow: Window = window

The window in which jodit was created

Implementation of

IToolbarButton.ownerWindow

Inherited from

UIButton.ownerWindow

Defined in

src/core/component/component.ts#109


jodit

jodit: IViewBased<IViewOptions>

Parent View element

Implementation of

IToolbarButton.jodit

Inherited from

UIButton.jodit

Defined in

src/core/component/view-component.ts#22


isButton

Readonly isButton: true

Marker for buttons

Implementation of

IToolbarButton.isButton

Inherited from

UIButton.isButton

Defined in

src/core/ui/button/button/button.ts#61


container

container: HTMLElement

Implementation of

IToolbarButton.container

Inherited from

UIButton.container

Defined in

src/core/ui/element.ts#32


name

name: string = ''

Implementation of

IToolbarButton.name

Inherited from

UIButton.name

Defined in

src/core/ui/element.ts#33


mods

Readonly mods: IDictionary<null | string | boolean> = {}

Implementation of

IToolbarButton.mods

Inherited from

UIButton.mods

Defined in

src/core/ui/element.ts#119


state

Readonly state: Object

Type declaration

Name Type
theme string
currentValue string
hasTrigger boolean
size "small" | "tiny" | "xsmall" | "middle" | "large"
name string
value string | number | boolean
variant ButtonVariant
type "button" | "submit"
role "button" | "tab"
disabled boolean
activated boolean
icon IUIIconState
text string
tooltip string
tabIndex CanUndef<number>

Implementation of

IToolbarButton.state

Overrides

UIButton.state

Defined in

src/modules/toolbar/button/button.ts#60


control

Readonly control: IControlTypeStrong

Implementation of

IToolbarButton.control

Defined in

src/modules/toolbar/button/button.ts#216


target

Readonly target: Nullable<HTMLElement> = null

Implementation of

IToolbarButton.target

Defined in

src/modules/toolbar/button/button.ts#217

componentName

get componentName(): string

Returns

string

Implementation of

IToolbarButton.componentName

Inherited from

UIButton.componentName

Defined in

src/core/component/component.ts#46


ownerDocument

get ownerDocument(): Document

The document in which jodit was created

Returns

Document

Implementation of

IToolbarButton.ownerDocument

Inherited from

UIButton.ownerDocument

Defined in

src/core/component/component.ts#95


od

get od(): Document

Shortcut for this.ownerDocument

Returns

Document

Implementation of

IToolbarButton.od

Inherited from

UIButton.od

Defined in

src/core/component/component.ts#102


ow

get ow(): Window

Returns

Window

Implementation of

IToolbarButton.ow

Inherited from

UIButton.ow

Defined in

src/core/component/component.ts#110


isReady

get isReady(): boolean

Component is ready for work

Returns

boolean

Implementation of

IToolbarButton.isReady

Inherited from

UIButton.isReady

Defined in

src/core/component/component.ts#145


isDestructed

get isDestructed(): boolean

Component was destructed

Returns

boolean

Implementation of

IToolbarButton.isDestructed

Inherited from

UIButton.isDestructed

Defined in

src/core/component/component.ts#152


isInDestruct

get isInDestruct(): boolean

The component is currently undergoing destructuring or has already been destroyed.
Those. you should not the app froze new events on him now or do anything else with him.

Returns

boolean

Implementation of

IToolbarButton.isInDestruct

Inherited from

UIButton.isInDestruct

Defined in

src/core/component/component.ts#160


componentStatus

get componentStatus(): ComponentStatus

Current component status

Returns

ComponentStatus

Implementation of

IToolbarButton.componentStatus

Inherited from

UIButton.componentStatus

Defined in

src/core/component/component.ts#210

set componentStatus(componentStatus): void

Setter for current component status

Parameters

Name Type
componentStatus ComponentStatus

Returns

void

Implementation of

IToolbarButton.componentStatus

Inherited from

UIButton.componentStatus

Defined in

src/core/component/component.ts#217


j

get j(): T

Shortcut for this.jodit

Returns

T

Implementation of

IToolbarButton.j

Inherited from

UIButton.j

Defined in

src/core/component/view-component.ts#27


defaultTimeout

get defaultTimeout(): number

Returns

number

Implementation of

IToolbarButton.defaultTimeout

Inherited from

UIButton.defaultTimeout

Defined in

src/core/component/view-component.ts#31


text

get text(): HTMLElement

DOM container for text content

Returns

HTMLElement

Implementation of

IToolbarButton.text

Inherited from

UIButton.text

Defined in

src/core/ui/button/button/button.ts#77


icon

get icon(): HTMLElement

DOM container for icon

Returns

HTMLElement

Implementation of

IToolbarButton.icon

Inherited from

UIButton.icon

Defined in

src/core/ui/button/button/button.ts#87


parentElement

get parentElement(): Nullable<IUIElement>

Returns

Nullable<IUIElement>

Implementation of

IToolbarButton.parentElement

Inherited from

UIButton.parentElement

Defined in

src/core/ui/element.ts#37

set parentElement(parentElement): void

Parameters

Name Type
parentElement Nullable<IUIElement>

Returns

void

Implementation of

IToolbarButton.parentElement

Inherited from

UIButton.parentElement

Defined in

src/core/ui/element.ts#41

getFullElName

getFullElName(elementName): string

Calc BEM element class name

Parameters

Name Type Description
elementName string element name in the bem classification

Returns

string

Implementation of

IToolbarButton.getFullElName

Inherited from

UIButton.getFullElName

Defined in

src/core/component/component.ts#65

getFullElName(elementName, mod): string

Parameters

Name Type
elementName string
mod string

Returns

string

Implementation of

IToolbarButton.getFullElName

Inherited from

UIButton.getFullElName

Defined in

src/core/component/component.ts#66

getFullElName(elementName, mod, modValue): string

Parameters

Name Type
elementName string
mod string
modValue string | boolean

Returns

string

Implementation of

IToolbarButton.getFullElName

Inherited from

UIButton.getFullElName

Defined in

src/core/component/component.ts#67


bindDestruct

bindDestruct(component): this

Bind destructor to some View

Parameters

Name Type
component IComponent<IViewBased<IViewOptions>>

Returns

this

Implementation of

IToolbarButton.bindDestruct

Inherited from

UIButton.bindDestruct

Defined in

src/core/component/component.ts#170


setStatus

setStatus(componentStatus): void

Set component status

Parameters

Name Type Description
componentStatus ComponentStatus component status

Returns

void

See

ComponentStatus

Implementation of

IToolbarButton.setStatus

Inherited from

UIButton.setStatus

Defined in

src/core/component/component.ts#226


hookStatus

hookStatus(status, callback): void

Adds a handler for changing the component's status

Parameters

Name Type Description
status ComponentStatus the status at which the callback is triggered
callback (component: this) => void a function that will be called when the status is status

Returns

void

Implementation of

IToolbarButton.hookStatus

Inherited from

UIButton.hookStatus

Defined in

src/core/component/component.ts#265


isInstanceOf

isInstanceOf<T>(c, constructorFunc): c is T

Type parameters

Name Type
T extends Component

Parameters

Name Type
c unknown
constructorFunc Function

Returns

c is T

Inherited from

UIButton.isInstanceOf

Defined in

src/core/component/component.ts#283


i18n

i18n(text, ...params): string

Parameters

Name Type
text string
...params (string | number)[]

Returns

string

Implementation of

IToolbarButton.i18n

Inherited from

UIButton.i18n

Defined in

src/core/component/view-component.ts#35


setParentView

setParentView(jodit): this

Attach component to View

Parameters

Name Type
jodit IViewBased<IViewOptions>

Returns

this

Implementation of

IToolbarButton.setParentView

Inherited from

UIButton.setParentView

Defined in

src/core/component/view-component.ts#42


getElm

getElm<T>(this, elementName): Nullable<HTMLElement>

Return element with BEM class name

Type parameters

Name Type
T extends IComponent<IViewBased<IViewOptions>> & IContainer & IElms

Parameters

Name Type
this T
elementName string

Returns

Nullable<HTMLElement>

Implementation of

IToolbarButton.getElm

Inherited from

UIButton.getElm

Defined in

src/core/traits/elms.ts#18


getElms

getElms<T>(this, elementName): HTMLElement[]

Return elements with BEM class name

Type parameters

Name Type
T extends IComponent<IViewBased<IViewOptions>> & IContainer & IElms

Parameters

Name Type
this T
elementName string

Returns

HTMLElement[]

Implementation of

IToolbarButton.getElms

Inherited from

UIButton.getElms

Defined in

src/core/traits/elms.ts#30


afterSetMod

afterSetMod(name, value): void

Parameters

Name Type
name string
value ModType

Returns

void

Implementation of

IToolbarButton.afterSetMod

Inherited from

UIButton.afterSetMod

Defined in

src/core/traits/mods.ts#23


setMod

setMod<T>(this, name, value, container?): T

Set/remove BEM class modification

Type parameters

Name Type
T extends IComponent<IViewBased<IViewOptions>> & IContainer & IMods

Parameters

Name Type Description
this T -
name string -
value ModType if null, mod will be removed
container? HTMLElement -

Returns

T

Implementation of

IToolbarButton.setMod

Inherited from

UIButton.setMod

Defined in

src/core/traits/mods.ts#30


getMod

getMod(this, name): ModType

Get BEM class modification value

Parameters

Name Type
this IMods
name string

Returns

ModType

Implementation of

IToolbarButton.getMod

Inherited from

UIButton.getMod

Defined in

src/core/traits/mods.ts#64


setState

setState(state): this

Set state

Parameters

Name Type
state IUIButtonStatePartial

Returns

this

Implementation of

IToolbarButton.setState

Inherited from

UIButton.setState

Defined in

src/core/ui/button/button/button.ts#68


isFocused

isFocused(): boolean

Element has focus

Returns

boolean

Implementation of

IToolbarButton.isFocused

Inherited from

UIButton.isFocused

Defined in

src/core/ui/button/button/button.ts#204


onAction

onAction(callback): this

Add action handler

Parameters

Name Type
callback (originalEvent: MouseEvent) => void

Returns

this

Implementation of

IToolbarButton.onAction

Inherited from

UIButton.onAction

Defined in

src/core/ui/button/button/button.ts#259


bubble

bubble(callback): this

Apply callback for all parents

Parameters

Name Type
callback (parent: IUIElement) => void

Returns

this

Implementation of

IToolbarButton.bubble

Inherited from

UIButton.bubble

Defined in

src/core/ui/element.ts#51


updateParentElement

updateParentElement(target): this

Parameters

Name Type
target IUIElement

Returns

this

Implementation of

IToolbarButton.updateParentElement

Inherited from

UIButton.updateParentElement

Defined in

src/core/ui/element.ts#62


get

get<T>(chain, obj?): Nullable<T>

Type parameters

Name
T

Parameters

Name Type
chain string
obj? IDictionary

Returns

Nullable<T>

Implementation of

IToolbarButton.get

Inherited from

UIButton.get

Defined in

src/core/ui/element.ts#68


closest

closest<T>(type): Nullable<T extends typeof UIElement ? InstanceType<T<T>> : T>

Find match parent

Type parameters

Name Type
T extends typeof UIElement | UIElement<IViewBased<IViewOptions>>

Parameters

Name Type
type Function | UIElement<IViewBased<IViewOptions>>

Returns

Nullable<T extends typeof UIElement ? InstanceType<T<T>> : T>

Implementation of

IToolbarButton.closest

Inherited from

UIButton.closest

Defined in

src/core/ui/element.ts#75


closestElement

closestElement(node, type): Nullable<IUIElement>

Find closest UIElement in DOM

Parameters

Name Type
node Node
type Function

Returns

Nullable<IUIElement>

Inherited from

UIButton.closestElement

Defined in

src/core/ui/element.ts#106


appendTo

appendTo(element): this

Append container to element

Parameters

Name Type
element HTMLElement

Returns

this

Implementation of

IToolbarButton.appendTo

Inherited from

UIButton.appendTo

Defined in

src/core/ui/element.ts#131


className

className(): string

Returns

string

Implementation of

IToolbarButton.className

Overrides

UIButton.className

Defined in

src/modules/toolbar/button/button.ts#56


update

update(): void

Returns

void

Implementation of

IToolbarButton.update

Overrides

UIButton.update

Defined in

src/modules/toolbar/button/button.ts#77


focus

focus(): void

Returns

void

Implementation of

IToolbarButton.focus

Overrides

UIButton.focus

Defined in

src/modules/toolbar/button/button.ts#190


destruct

destruct(): any

Returns

any

Implementation of

IToolbarButton.destruct

Overrides

UIButton.destruct

Defined in

jodit/src/modules/toolbar/button/button.ts:565