View
- Hierarchy
- Implements
- STATUSES
- async
- uid
- ownerWindow
- isView
- parent
- mods
- id
- components
- ES
- version
- esNext
- esModern
- create
- events
- OPTIONS
- isJodit
- defaultOptions
- componentName
- ownerDocument
- od
- ow
- isReady
- isDestructed
- isInDestruct
- componentStatus
- basePath
- defaultTimeout
- buffer
- message
- storage
- c
- container
- e
- progressbar
- options
- o
- isLocked
- isFullSize
- getFullElName
- get
- bindDestruct
- className
- setStatus
- hookStatus
- isInstanceOf
- getElm
- getElms
- afterSetMod
- setMod
- getMod
- i18n
- toggleFullSize
- isLockedNotBy
- lock
- unlock
- getVersion
- getVersion
- getInstance
- destruct
view.View
The base class of all Jodit UI components. Provides work with a life cycle.
Hierarchy
-
↳
View
↳↳
ViewWithToolbar
Implements
STATUSES
Static
STATUSES: Object
= STATUSES
Type declaration
Name | Type |
---|---|
beforeInit |
"beforeInit" |
ready |
"ready" |
beforeDestruct |
"beforeDestruct" |
destructed |
"destructed" |
Inherited from
Defined in
src/core/component/component.ts#40
async
async: IAsync
Implementation of
Inherited from
Defined in
src/core/component/component.ts#44
uid
Readonly
uid: string
Implementation of
Inherited from
Defined in
src/core/component/component.ts#59
ownerWindow
ownerWindow: Window
= window
The window in which jodit was created
Implementation of
Inherited from
Defined in
src/core/component/component.ts#109
isView
Readonly
isView: true
Implementation of
Defined in
parent
parent: Nullable
<IViewBased
<IViewOptions
>> = null
Implementation of
Defined in
mods
Readonly
mods: IDictionary
<null
| string
| boolean
> = {}
Implementation of
Inherited from
Defined in
id
id: string
ID attribute for a source element, id add {id}_editor
it's editor's id
Implementation of
Defined in
components
Readonly
components: Set
<IComponent
<IViewBased
<IViewOptions
>>>
All created ViewComponent inside this view
Implementation of
Defined in
ES
Static
Readonly
ES: "es5"
| "es2015"
| "es2018"
| "es2021"
= ES
Defined in
version
Static
Readonly
version: string
= APP_VERSION
Defined in
esNext
Static
Readonly
esNext: boolean
= IS_ES_NEXT
Defined in
esModern
Static
Readonly
esModern: boolean
= IS_ES_MODERN
Defined in
create
Readonly
create: ICreate
Implementation of
Defined in
events
events: IEventEmitter
Implementation of
Defined in
OPTIONS
OPTIONS: IViewOptions
= View.defaultOptions
Implementation of
Defined in
isJodit
Readonly
isJodit: boolean
= false
Defined in
defaultOptions
Static
defaultOptions: IViewOptions
Defined in
componentName
get
componentName(): string
Returns
string
Implementation of
Defined in
src/core/component/component.ts#46
ownerDocument
get
ownerDocument(): Document
The document in which jodit was created
Returns
Implementation of
Defined in
src/core/component/component.ts#95
od
get
od(): Document
Shortcut for this.ownerDocument
Returns
Implementation of
Defined in
src/core/component/component.ts#102
ow
get
ow(): Window
Returns
Implementation of
Defined in
src/core/component/component.ts#110
isReady
get
isReady(): boolean
Component is ready for work
Returns
boolean
Implementation of
Defined in
src/core/component/component.ts#145
isDestructed
get
isDestructed(): boolean
Component was destructed
Returns
boolean
Implementation of
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
Defined in
src/core/component/component.ts#160
componentStatus
get
componentStatus(): ComponentStatus
Current component status
Returns
Implementation of
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
Defined in
src/core/component/component.ts#217
basePath
get
basePath(): string
Get a path for loading extra staff
Returns
string
Implementation of
Defined in
defaultTimeout
get
defaultTimeout(): number
Return a default timeout period in milliseconds for some debounce or throttle functions.
By default, {history.timeout}
options
Returns
number
Implementation of
Defined in
buffer
get
buffer(): IStorage
<StorageValueType
>
Some extra data inside editor
Returns
See
copyformat plugin
Implementation of
Defined in
message
get
message(): IMessages
Returns
Implementation of
Defined in
storage
get
storage(): IStorage
<StorageValueType
>
Container for persistent set/get value
Returns
Implementation of
Defined in
c
get
c(): this
["create"
]
Short alias for create
Returns
this
["create"
]
Implementation of
Defined in
container
get
container(): HTMLDivElement
Returns
Implementation of
Defined in
set
container(container
): void
Parameters
Name | Type |
---|---|
container |
HTMLDivElement |
Returns
void
Implementation of
Defined in
e
get
e(): this
["events"
]
Short alias for events
Returns
this
["events"
]
Implementation of
Defined in
progressbar
get
progressbar(): IProgressBar
progress_bar Progress bar
Returns
Implementation of
Defined in
options
get
options(): this
["OPTIONS"
]
Returns
this
["OPTIONS"
]
Implementation of
Defined in
set
options(options
): void
Parameters
Name | Type |
---|---|
options |
this ["OPTIONS" ] |
Returns
void
Implementation of
Defined in
o
get
o(): this
["options"
]
Short alias for options
Returns
this
["options"
]
Implementation of
Defined in
isLocked
get
isLocked(): boolean
View is locked
Returns
boolean
Implementation of
Defined in
isFullSize
get
isFullSize(): boolean
View is in fullSize
Returns
boolean
Implementation of
Defined in
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
Defined in
src/core/component/component.ts#65
getFullElName(elementName
, mod
): string
Parameters
Name | Type |
---|---|
elementName |
string |
mod |
string |
Returns
string
Inherited from
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
Inherited from
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
Inherited from
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
Inherited from
Defined in
src/core/component/component.ts#170
className
className(): string
Returns
string
Inherited from
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
Inherited from
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
Inherited from
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
Defined in
src/core/component/component.ts#283
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
Inherited from
Defined in
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
Inherited from
Defined in
afterSetMod
afterSetMod(name
, value
): void
Parameters
Name | Type |
---|---|
name |
string |
value |
ModType |
Returns
void
Inherited from
Defined in
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
Defined in
getMod
getMod(this
, name
): ModType
Get BEM class modification value
Parameters
Name | Type |
---|---|
this |
IMods |
name |
string |
Returns
Inherited from
Defined in
i18n
i18n(text
, ...params
): string
Internationalization method. Uses Jodit.lang object
Parameters
Name | Type |
---|---|
text |
string |
...params |
(string | number )[] |
Returns
string
Defined in
toggleFullSize
toggleFullSize(isFullSize?
): void
Parameters
Name | Type |
---|---|
isFullSize? |
boolean |
Returns
void
Defined in
isLockedNotBy
isLockedNotBy(name
): boolean
Parameters
Name | Type |
---|---|
name |
string |
Returns
boolean
Defined in
lock
lock(name?
): boolean
Disable selecting
Parameters
Name | Type | Default value |
---|---|---|
name |
string |
'any' |
Returns
boolean
Defined in
unlock
unlock(): boolean
Enable selecting
Returns
boolean
Defined in
getVersion
getVersion(): string
Return current version
Returns
string
Defined in
getVersion
getVersion(): string
Returns
string
Defined in
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
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
destruct
destruct(): void
Returns
void
Inherited from
Defined in
jodit/src/core/view/view.ts:370