table/tablerowresize/utils
Functions
getRowEdgesIndexes( cell, tableUtils ) → objectinternalmodule:table/tablerowresize/utils~getRowEdgesIndexesReturns the row indexes on the top and bottom edges of a cell. They differ if the cell spans across multiple rows. The bottom edge is the row that dragging the bottom edge of the cell resizes.
Parameters
cell: ModelElementA table cell model element.
tableUtils: TableUtilsThe Table Utils plugin instance.
Returns
objectAn object containing the indexes of the top and bottom edges of the cell.
getTableRows( table ) → Array<ModelElement>internalmodule:table/tablerowresize/utils~getTableRowsReturns the
tableRowelements of a table, skipping other children such as the column group or the caption.Parameters
table: ModelElement
Returns
Array<ModelElement>
getUnsetHeightValue( editor, table, type ) → string | nullinternalmodule:table/tablerowresize/utils~getUnsetHeightValueReturns the value that unsets the table or the cell height:
'auto'when a default height is configured, as a removed height would fall back to the default one from the content styles, ornullto remove the height. The layout tables do not use the default table and cell properties.Parameters
editor: Editortable: ModelElementtype: 'table' | 'cell'
Returns
string | null
isEmptyHeightValue( value ) → booleaninternalmodule:table/tablerowresize/utils~isEmptyHeightValueChecks whether a height value is empty: missing, an empty string, or only whitespace (the height field accepts whitespace as an empty value).
Parameters
value: string | number | undefined
Returns
boolean
removeRowHeight( writer, row, unsetCellHeight ) → voidinternalmodule:table/tablerowresize/utils~removeRowHeightRemoves the height of a table row, together with the height of every cell covering that row, so the row gets the height its content requires.
Parameters
writer: ModelWriterrow: ModelElementunsetCellHeight: string | nullThe height set on the cells covering the row in place of their own height:
'auto'to override a configured default cell height, ornullto remove the cell height.
Returns
void
setRowHeight( writer, row, height, unsetCellHeight ) → voidinternalmodule:table/tablerowresize/utils~setRowHeightSets the height of a table row and clears the height of every cell covering that row, including cells spanned from the rows above. The browser renders a row as high as its highest cell, so a cell height would keep the row from shrinking.
Parameters
writer: ModelWriterrow: ModelElementheight: stringunsetCellHeight: string | nullThe height set on the cells covering the row in place of their own height:
'auto'to override a configured default cell height, ornullto remove the cell height.
Returns
void
toRowHeightInPixels( value ) → string | nullinternalmodule:table/tablerowresize/utils~toRowHeightInPixelsReturns a row height value (a non-negative number without a unit or in pixels) as a height in pixels, for example
'50'as'50px'. Returnsnullfor any other value, as a changed row height is always stored in pixels.Parameters
value: string | number
Returns
string | null