Table
- Hierarchy
- constructor
- STATUSES
- async
- uid
- ownerWindow
- jodit
- componentName
- ownerDocument
- od
- ow
- isReady
- isDestructed
- isInDestruct
- componentStatus
- j
- defaultTimeout
- getFullElName
- get
- bindDestruct
- setStatus
- hookStatus
- isInstanceOf
- i18n
- setParentView
- className
- addSelection
- removeSelection
- getAllSelectedCells
- destruct
- getRowsCount
- getColumnsCount
- formalMatrix
- formalCoordinate
- appendRow
- removeRow
- appendColumn
- removeColumn
- getSelectedBound
- normalizeTable
- mergeSelected
- splitHorizontal
- splitVertical
- setColumnWidthByDelta
modules/table.Table
The base class of all Jodit UI components. Provides work with a life cycle.
Hierarchy
-
↳
Table
constructor
new Table(jodit
): Table
Parameters
Name | Type |
---|---|
jodit |
IJodit |
Returns
Inherited from
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
Defined in
src/core/component/component.ts#40
async
async: IAsync
Inherited from
Defined in
src/core/component/component.ts#44
uid
Readonly
uid: string
Inherited from
Defined in
src/core/component/component.ts#59
ownerWindow
ownerWindow: Window
= window
The window in which jodit was created
Inherited from
Defined in
src/core/component/component.ts#109
jodit
jodit: IJodit
Parent View element
Inherited from
Defined in
src/core/component/view-component.ts#22
componentName
get
componentName(): string
Returns
string
Inherited from
ViewComponent.componentName
Defined in
src/core/component/component.ts#46
ownerDocument
get
ownerDocument(): Document
The document in which jodit was created
Returns
Inherited from
ViewComponent.ownerDocument
Defined in
src/core/component/component.ts#95
od
get
od(): Document
Shortcut for this.ownerDocument
Returns
Inherited from
ViewComponent.od
Defined in
src/core/component/component.ts#102
ow
get
ow(): Window
Returns
Inherited from
ViewComponent.ow
Defined in
src/core/component/component.ts#110
isReady
get
isReady(): boolean
Component is ready for work
Returns
boolean
Inherited from
ViewComponent.isReady
Defined in
src/core/component/component.ts#145
isDestructed
get
isDestructed(): boolean
Component was destructed
Returns
boolean
Inherited from
ViewComponent.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
Inherited from
ViewComponent.isInDestruct
Defined in
src/core/component/component.ts#160
componentStatus
get
componentStatus(): ComponentStatus
Current component status
Returns
Inherited from
ViewComponent.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
Inherited from
ViewComponent.componentStatus
Defined in
src/core/component/component.ts#217
j
get
j(): T
Shortcut for this.jodit
Returns
T
Inherited from
ViewComponent.j
Defined in
src/core/component/view-component.ts#27
defaultTimeout
get
defaultTimeout(): number
Returns
number
Inherited from
ViewComponent.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
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
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
i18n
i18n(text
, ...params
): string
Parameters
Name | Type |
---|---|
text |
string |
...params |
(string | number )[] |
Returns
string
Inherited from
Defined in
src/core/component/view-component.ts#35
setParentView
setParentView(jodit
): this
Attach component to View
Parameters
Name | Type |
---|---|
jodit |
IJodit |
Returns
this
Inherited from
Defined in
src/core/component/view-component.ts#42
className
className(): string
Returns
string
Overrides
Defined in
addSelection
addSelection(td
): void
Parameters
Name | Type |
---|---|
td |
HTMLTableCellElement |
Returns
void
Defined in
removeSelection
removeSelection(td
): void
Parameters
Name | Type |
---|---|
td |
HTMLTableCellElement |
Returns
void
Defined in
getAllSelectedCells
getAllSelectedCells(): HTMLTableCellElement
[]
Returns array of selected cells
Returns
Defined in
destruct
destruct(): any
Returns
any
Overrides
Defined in
src/modules/table/table.ts#111
getRowsCount
getRowsCount(table
): number
Returns rows count in the table
Parameters
Name | Type |
---|---|
table |
HTMLTableElement |
Returns
number
Defined in
src/modules/table/table.ts#123
getColumnsCount
getColumnsCount(table
): number
Returns columns count in the table
Parameters
Name | Type |
---|---|
table |
HTMLTableElement |
Returns
number
Defined in
src/modules/table/table.ts#139
formalMatrix
formalMatrix(table
, callback?
): HTMLTableCellElement
[][]
Generate formal table martix columns*rows
Parameters
Name | Type | Description |
---|---|---|
table |
HTMLTableElement |
Working table |
callback? |
(cell : HTMLTableCellElement , row : number , col : number , colSpan : number , rowSpan : number ) => false | void |
if return false cycle break |
Returns
Defined in
src/modules/table/table.ts#215
formalCoordinate
formalCoordinate(table
, cell
, max?
): number
[]
Get cell coordinate in formal table (without colspan and rowspan)
Parameters
Name | Type | Default value |
---|---|---|
table |
HTMLTableElement |
undefined |
cell |
HTMLTableCellElement |
undefined |
max |
boolean |
false |
Returns
number
[]
Defined in
src/modules/table/table.ts#269
appendRow
appendRow(table
, line
, after
): void
Inserts a new line after row what contains the selected cell
Parameters
Name | Type | Description |
---|---|---|
table |
HTMLTableElement |
Working table |
line |
false | HTMLTableRowElement |
Insert a new line after/before this line contains the selected cell |
after |
boolean |
Insert a new line after line contains the selected cell |
Returns
void
Defined in
src/modules/table/table.ts#330
removeRow
removeRow(table
, rowIndex
): void
Remove row
Parameters
Name | Type |
---|---|
table |
HTMLTableElement |
rowIndex |
number |
Returns
void
Defined in
src/modules/table/table.ts#397
appendColumn
appendColumn(table
, selectedCell
, insertAfter?
): void
Insert column before / after all the columns containing the selected cells
Parameters
Name | Type | Default value |
---|---|---|
table |
HTMLTableElement |
undefined |
selectedCell |
HTMLTableCellElement |
undefined |
insertAfter |
boolean |
true |
Returns
void
Defined in
src/modules/table/table.ts#404
removeColumn
removeColumn(table
, j
): void
Remove column by index
Parameters
Name | Type |
---|---|
table |
HTMLTableElement |
j |
number |
Returns
void
Defined in
src/modules/table/table.ts#482
getSelectedBound
getSelectedBound(table
, selectedCells
): number
[][]
Define bound for selected cells
Parameters
Name | Type |
---|---|
table |
HTMLTableElement |
selectedCells |
HTMLTableCellElement [] |
Returns
number
[][]
Defined in
src/modules/table/table.ts#546
normalizeTable
normalizeTable(table
): void
Try recalculate all coluns and rows after change
Parameters
Name | Type |
---|---|
table |
HTMLTableElement |
Returns
void
Defined in
src/modules/table/table.ts#672
mergeSelected
mergeSelected(table
): void
It combines all the selected cells into one. The contents of the cells will also be combined
Parameters
Name | Type |
---|---|
table |
HTMLTableElement |
Returns
void
Defined in
src/modules/table/table.ts#801
splitHorizontal
splitHorizontal(table
): void
Divides all selected by jodit_focused_cell
class table cell in 2 parts vertical. Those division into 2 columns
Parameters
Name | Type |
---|---|
table |
HTMLTableElement |
Returns
void
Defined in
src/modules/table/table.ts#890
splitVertical
splitVertical(table
): void
It splits all the selected cells into 2 parts horizontally. Those. are added new row
Parameters
Name | Type |
---|---|
table |
HTMLTableElement |
Returns
void
Defined in
src/modules/table/table.ts#958
setColumnWidthByDelta
setColumnWidthByDelta(table
, column
, delta
, noUnmark
, marked
): void
Set column width used delta value
Parameters
Name | Type |
---|---|
table |
HTMLTableElement |
column |
number |
delta |
number |
noUnmark |
boolean |
marked |
HTMLTableCellElement [] |
Returns
void
Defined in
jodit/src/modules/table/table.ts:1007