ViewComponent

component.ViewComponent

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 ViewComponent<T>(jodit): ViewComponent<T>

Type parameters

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

Parameters

Name Type
jodit T

Returns

ViewComponent<T>

Overrides

Component.constructor

Defined in

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

STATUSES

Static STATUSES: Object = STATUSES

Type declaration

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

Inherited from

Component.STATUSES

Defined in

src/core/component/component.ts#40


async

async: IAsync

Implementation of

IViewComponent.async

Inherited from

Component.async

Defined in

src/core/component/component.ts#44


uid

Readonly uid: string

Implementation of

IViewComponent.uid

Inherited from

Component.uid

Defined in

src/core/component/component.ts#59


ownerWindow

ownerWindow: Window = window

The window in which jodit was created

Implementation of

IViewComponent.ownerWindow

Inherited from

Component.ownerWindow

Defined in

src/core/component/component.ts#109


jodit

jodit: T

Parent View element

Implementation of

IViewComponent.jodit

Defined in

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

componentName

get componentName(): string

Returns

string

Implementation of

IViewComponent.componentName

Inherited from

Component.componentName

Defined in

src/core/component/component.ts#46


ownerDocument

get ownerDocument(): Document

The document in which jodit was created

Returns

Document

Implementation of

IViewComponent.ownerDocument

Inherited from

Component.ownerDocument

Defined in

src/core/component/component.ts#95


od

get od(): Document

Shortcut for this.ownerDocument

Returns

Document

Implementation of

IViewComponent.od

Inherited from

Component.od

Defined in

src/core/component/component.ts#102


ow

get ow(): Window

Returns

Window

Implementation of

IViewComponent.ow

Inherited from

Component.ow

Defined in

src/core/component/component.ts#110


isReady

get isReady(): boolean

Component is ready for work

Returns

boolean

Implementation of

IViewComponent.isReady

Inherited from

Component.isReady

Defined in

src/core/component/component.ts#145


isDestructed

get isDestructed(): boolean

Component was destructed

Returns

boolean

Implementation of

IViewComponent.isDestructed

Inherited from

Component.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

IViewComponent.isInDestruct

Inherited from

Component.isInDestruct

Defined in

src/core/component/component.ts#160


componentStatus

get componentStatus(): ComponentStatus

Current component status

Returns

ComponentStatus

Implementation of

IViewComponent.componentStatus

Inherited from

Component.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

IViewComponent.componentStatus

Inherited from

Component.componentStatus

Defined in

src/core/component/component.ts#217


j

get j(): T

Shortcut for this.jodit

Returns

T

Implementation of

IViewComponent.j

Defined in

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


defaultTimeout

get defaultTimeout(): number

Returns

number

Implementation of

IViewComponent.defaultTimeout

Defined in

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

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

IViewComponent.getFullElName

Inherited from

Component.getFullElName

Defined in

src/core/component/component.ts#65

getFullElName(elementName, mod): string

Parameters

Name Type
elementName string
mod string

Returns

string

Implementation of

IViewComponent.getFullElName

Inherited from

Component.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

IViewComponent.getFullElName

Inherited from

Component.getFullElName

Defined in

src/core/component/component.ts#67


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

IViewComponent.get

Inherited from

Component.get

Defined in

src/core/component/component.ts#138


bindDestruct

bindDestruct(component): this

Bind destructor to some View

Parameters

Name Type
component IComponent<IViewBased<IViewOptions>>

Returns

this

Implementation of

IViewComponent.bindDestruct

Inherited from

Component.bindDestruct

Defined in

src/core/component/component.ts#170


className

className(): string

Returns

string

Implementation of

IViewComponent.className

Inherited from

Component.className

Defined in

src/core/component/component.ts#179


setStatus

setStatus(componentStatus): void

Set component status

Parameters

Name Type Description
componentStatus ComponentStatus component status

Returns

void

See

ComponentStatus

Implementation of

IViewComponent.setStatus

Inherited from

Component.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

IViewComponent.hookStatus

Inherited from

Component.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

Component.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

IViewComponent.i18n

Defined in

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


setParentView

setParentView(jodit): this

Attach component to View

Parameters

Name Type
jodit T

Returns

this

Implementation of

IViewComponent.setParentView

Defined in

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


destruct

destruct(): any

Returns

any

Implementation of

IViewComponent.destruct

Overrides

Component.destruct

Defined in

jodit/src/core/component/view-component.ts:56