View

view.View

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

Hierarchy

Implements

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#41


async

async: IAsync

Implementation of

IViewBased.async

Inherited from

Component.async

Defined in

src/core/component/component.ts#45


uid

Readonly uid: string

Implementation of

IViewBased.uid

Inherited from

Component.uid

Defined in

src/core/component/component.ts#60


ownerWindow

ownerWindow: Window = window

The window in which jodit was created

Implementation of

IViewBased.ownerWindow

Inherited from

Component.ownerWindow

Defined in

src/core/component/component.ts#110


isView

Readonly isView: true

Implementation of

IViewBased.isView

Defined in

src/core/view/view.ts#61


parent

parent: Nullable<IViewBased<IViewOptions>> = null

Implementation of

IViewBased.parent

Defined in

src/core/view/view.ts#62


mods

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

Implementation of

Mods.mods

Inherited from

Mods.mods

Defined in

src/core/view/view.ts#64


id

id: string

ID attribute for source element, id add {id}_editor it's editor's id

Implementation of

IViewBased.id

Defined in

src/core/view/view.ts#69


components

Readonly components: Set<IComponent<IViewBased<IViewOptions>>>

All created ViewComponent inside this view

Implementation of

IViewBased.components

Defined in

src/core/view/view.ts#74


ES

Static Readonly ES: "es5" | "es2015" | "es2018" | "es2021" = ES

Defined in

src/core/view/view.ts#88


version

Static Readonly version: string = APP_VERSION

Defined in

src/core/view/view.ts#89


esNext

Static Readonly esNext: boolean = IS_ES_NEXT

Defined in

src/core/view/view.ts#90


esModern

Static Readonly esModern: boolean = IS_ES_MODERN

Defined in

src/core/view/view.ts#91


create

Readonly create: ICreate

Implementation of

IViewBased.create

Defined in

src/core/view/view.ts#127


events

events: IEventEmitter

Implementation of

IViewBased.events

Defined in

src/core/view/view.ts#146


OPTIONS

OPTIONS: IViewOptions = View.defaultOptions

Implementation of

IViewBased.OPTIONS

Defined in

src/core/view/view.ts#164


isJodit

Readonly isJodit: boolean = false

Defined in

src/core/view/view.ts#286


defaultOptions

Static defaultOptions: IViewOptions

Defined in

src/core/view/view.ts#393

componentName

get componentName(): string

Returns

string

Implementation of

IViewBased.componentName

Defined in

src/core/component/component.ts#47


ownerDocument

get ownerDocument(): Document

The document in which jodit was created

Returns

Document

Implementation of

IViewBased.ownerDocument

Defined in

src/core/component/component.ts#96


od

get od(): Document

Shortcut for this.ownerDocument

Returns

Document

Implementation of

IViewBased.od

Defined in

src/core/component/component.ts#103


ow

get ow(): Window

Returns

Window

Implementation of

IViewBased.ow

Defined in

src/core/component/component.ts#111


isReady

get isReady(): boolean

Component is ready for work

Returns

boolean

Implementation of

IViewBased.isReady

Defined in

src/core/component/component.ts#146


isDestructed

get isDestructed(): boolean

Component was destructed

Returns

boolean

Implementation of

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

IViewBased.isInDestruct

Defined in

src/core/component/component.ts#161


componentStatus

get componentStatus(): ComponentStatus

Current component status

Returns

ComponentStatus

Implementation of

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

IViewBased.componentStatus

Defined in

src/core/component/component.ts#218


basePath

get basePath(): string

Get path for loading extra staff

Returns

string

Implementation of

IViewBased.basePath

Defined in

src/core/view/view.ts#79


defaultTimeout

get defaultTimeout(): number

Return default timeout period in milliseconds for some debounce or throttle functions.
By default, {history.timeout} options

Returns

number

Implementation of

IViewBased.defaultTimeout

Defined in

src/core/view/view.ts#97


buffer

get buffer(): IStorage<StorageValueType>

Some extra data inside editor

Returns

IStorage<StorageValueType>

See

copyformat plugin

Implementation of

IViewBased.buffer

Defined in

src/core/view/view.ts#106


message

get message(): IMessages

Returns

IMessages

Implementation of

IViewBased.message

Defined in

src/core/view/view.ts#111


storage

get storage(): IStorage<StorageValueType>

Container for persistent set/get value

Returns

IStorage<StorageValueType>

Implementation of

IViewBased.storage

Defined in

src/core/view/view.ts#123


c

get c(): this["create"]

Short alias for create

Returns

this["create"]

Implementation of

IViewBased.c

Defined in

src/core/view/view.ts#133


container

get container(): HTMLDivElement

Returns

HTMLDivElement

Implementation of

IViewBased.container

Defined in

src/core/view/view.ts#138

set container(container): void

Parameters

Name Type
container HTMLDivElement

Returns

void

Implementation of

IViewBased.container

Defined in

src/core/view/view.ts#142


e

get e(): this["events"]

Short alias for events

Returns

this["events"]

Implementation of

IViewBased.e

Defined in

src/core/view/view.ts#152


progressbar

get progressbar(): IProgressBar

progress_bar Progress bar

Returns

IProgressBar

Implementation of

IViewBased.progressbar

Defined in

src/core/view/view.ts#160


options

get options(): this["OPTIONS"]

Returns

this["OPTIONS"]

Implementation of

IViewBased.options

Defined in

src/core/view/view.ts#166

set options(options): void

Parameters

Name Type
options this["OPTIONS"]

Returns

void

Implementation of

IViewBased.options

Defined in

src/core/view/view.ts#170


o

get o(): this["options"]

Short alias for options

Returns

this["options"]

Implementation of

IViewBased.o

Defined in

src/core/view/view.ts#177


isLocked

get isLocked(): boolean

View is locked

Returns

boolean

Implementation of

IViewBased.isLocked

Defined in

src/core/view/view.ts#208


isFullSize

get isFullSize(): boolean

View is in fullSize

Returns

boolean

Implementation of

IViewBased.isFullSize

Defined in

src/core/view/view.ts#242

getFullElName

getFullElName(elementName): string

Calc BEM element class name

Parameters

Name Type Description
elementName string element name in the bem classification

Returns

string

Inherited from

Component.getFullElName

Defined in

src/core/component/component.ts#66

getFullElName(elementName, mod): string

Parameters

Name Type
elementName string
mod string

Returns

string

Inherited from

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

Inherited from

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

Inherited from

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

Inherited from

Component.bindDestruct

Defined in

src/core/component/component.ts#171


className

className(): string

Returns

string

Inherited from

Component.className

Defined in

src/core/component/component.ts#180


setStatus

setStatus(componentStatus): void

Set component status

Parameters

Name Type Description
componentStatus ComponentStatus component status

Returns

void

See

ComponentStatus

Inherited from

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

Inherited from

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

Inherited from

Component.isInstanceOf

Defined in

src/core/component/component.ts#284


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>

Inherited from

Elms.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[]

Inherited from

Elms.getElms

Defined in

src/core/traits/elms.ts#30


afterSetMod

afterSetMod(name, value): void

Parameters

Name Type
name string
value ModType

Returns

void

Inherited from

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

Inherited from

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

Inherited from

Mods.getMod

Defined in

src/core/traits/mods.ts#64


i18n

i18n(text, ...params): string

Internationalization method. Uses Jodit.lang object

Parameters

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

Returns

string

Defined in

src/core/view/view.ts#184


toggleFullSize

toggleFullSize(isFullSize?): void

Parameters

Name Type
isFullSize? boolean

Returns

void

Defined in

src/core/view/view.ts#190


isLockedNotBy

isLockedNotBy(name): boolean

Parameters

Name Type
name string

Returns

boolean

Defined in

src/core/view/view.ts#212


lock

lock(name?): boolean

Disable selecting

Parameters

Name Type Default value
name string 'any'

Returns

boolean

Defined in

src/core/view/view.ts#218


unlock

unlock(): boolean

Enable selecting

Returns

boolean

Defined in

src/core/view/view.ts#230


getVersion

getVersion(): string

Return current version

Returns

string

Defined in

src/core/view/view.ts#249


getVersion

getVersion(): string

Returns

string

Defined in

src/core/view/view.ts#253


getInstance

getInstance<T>(module, options?): T

Make one instance of one module

Type parameters

Name Type
T extends IComponent<IViewBased<IViewOptions>>

Parameters

Name Type
module Function
options? object

Returns

T

Defined in

src/core/view/view.ts#306

getInstance<T>(moduleName, options?): T

Type parameters

Name Type
T extends IComponent<IViewBased<IViewOptions>>

Parameters

Name Type
moduleName string
options? object

Returns

T

Defined in

src/core/view/view.ts#307


destruct

destruct(): void

Returns

void

Inherited from

Component.destruct

Defined in

jodit/src/core/view/view.ts:370