Component

component.Component

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

Hierarchy

Implements

constructor

new Component(): Component

Returns

Component

Defined in

src/core/component/component.ts#182

STATUSES

Static STATUSES: Object = STATUSES

Type declaration

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

Defined in

src/core/component/component.ts#41


async

async: IAsync

Implementation of

IComponent.async

Defined in

src/core/component/component.ts#45


uid

Readonly uid: string

Implementation of

IComponent.uid

Defined in

src/core/component/component.ts#60


ownerWindow

ownerWindow: Window = window

The window in which jodit was created

Implementation of

IComponent.ownerWindow

Defined in

src/core/component/component.ts#110

componentName

get componentName(): string

Returns

string

Implementation of

IComponent.componentName

Defined in

src/core/component/component.ts#47


ownerDocument

get ownerDocument(): Document

The document in which jodit was created

Returns

Document

Implementation of

IComponent.ownerDocument

Defined in

src/core/component/component.ts#96


od

get od(): Document

Shortcut for this.ownerDocument

Returns

Document

Implementation of

IComponent.od

Defined in

src/core/component/component.ts#103


ow

get ow(): Window

Returns

Window

Implementation of

IComponent.ow

Defined in

src/core/component/component.ts#111


isReady

get isReady(): boolean

Component is ready for work

Returns

boolean

Implementation of

IComponent.isReady

Defined in

src/core/component/component.ts#146


isDestructed

get isDestructed(): boolean

Component was destructed

Returns

boolean

Implementation of

IComponent.isDestructed

Defined in

src/core/component/component.ts#153


isInDestruct

get isInDestruct(): boolean

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

Returns

boolean

Implementation of

IComponent.isInDestruct

Defined in

src/core/component/component.ts#161


componentStatus

get componentStatus(): ComponentStatus

Current component status

Returns

ComponentStatus

Implementation of

IComponent.componentStatus

Defined in

src/core/component/component.ts#211

set componentStatus(componentStatus): void

Setter for current component status

Parameters

Name Type
componentStatus ComponentStatus

Returns

void

Implementation of

IComponent.componentStatus

Defined in

src/core/component/component.ts#218

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

IComponent.getFullElName

Defined in

src/core/component/component.ts#66

getFullElName(elementName, mod): string

Parameters

Name Type
elementName string
mod string

Returns

string

Implementation of

IComponent.getFullElName

Defined in

src/core/component/component.ts#67

getFullElName(elementName, mod, modValue): string

Parameters

Name Type
elementName string
mod string
modValue string | boolean

Returns

string

Implementation of

IComponent.getFullElName

Defined in

src/core/component/component.ts#68


get

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

Safe get any field

Type parameters

Name
T

Parameters

Name Type Description
chain string the path to be traversed in the obj object
obj? IDictionary the object in which the value is searched

Returns

Nullable<T>

Example

private a = {
  b: {
    c: {
      e: {
        g: {
          color: 'red'
        }
      }
    }
  }
}

this.get('a.b.c.e.g.color'); // Safe access to color
// instead using optionsl chaining
this?.a?.b?.c?.e?.g?.color

Implementation of

IComponent.get

Defined in

src/core/component/component.ts#139


bindDestruct

bindDestruct(component): this

Bind destructor to some View

Parameters

Name Type
component IComponent<IViewBased<IViewOptions>>

Returns

this

Implementation of

IComponent.bindDestruct

Defined in

src/core/component/component.ts#171


className

className(): string

Returns

string

Implementation of

IComponent.className

Defined in

src/core/component/component.ts#180


destruct

destruct(): void

Destruct component method

Returns

void

Implementation of

IComponent.destruct

Defined in

src/core/component/component.ts#189


setStatus

setStatus(componentStatus): void

Set component status

Parameters

Name Type Description
componentStatus ComponentStatus component status

Returns

void

See

ComponentStatus

Implementation of

IComponent.setStatus

Defined in

src/core/component/component.ts#227


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

IComponent.hookStatus

Defined in

src/core/component/component.ts#266


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

Defined in

jodit/src/core/component/component.ts:284