@univerjssheets-numfmtfacadeclassesFrangelegacy

@univerjs/sheets-numfmt v0.5.1Docs


Class: FRangeLegacy

FBase is a base class for all facade classes. It provides a way to extend classes with static and instance methods. The _initialize as a special method that will be called after the constructor. You should never call it directly.

Extends

Implements

Constructors

new FRangeLegacy()

new FRangeLegacy(
   _workbook, 
   _worksheet, 
   _range, 
   _injector, 
   _commandService, 
   _formulaDataModel): FRangeLegacy

Parameters

ParameterType
_workbookWorkbook
_worksheetWorksheet
_rangeIRange
_injectorInjector
_commandServiceICommandService
_formulaDataModelFormulaDataModel

Returns

FRangeLegacy

Inherited from

FRange.constructor

Defined in

sheets/src/facade/f-range.ts:30

Properties

PropertyModifierTypeInherited fromDefined in
_commandServicereadonlyICommandServiceFRange._commandServicesheets/src/facade/f-range.ts:35
_formulaDataModelreadonlyFormulaDataModelFRange._formulaDataModelsheets/src/facade/f-range.ts:36
_injectorreadonlyInjectorFRange._injectorsheets/src/facade/f-range.ts:34
_rangereadonlyIRangeFRange._rangesheets/src/facade/f-range.ts:33
_workbookreadonlyWorkbookFRange._workbooksheets/src/facade/f-range.ts:31
_worksheetreadonlyWorksheetFRange._worksheetsheets/src/facade/f-range.ts:32

Methods

_initialize()

_initialize(): void

Returns

void

Inherited from

FRange._initialize

Defined in

core/src/facade/f-base.ts:33


breakApart()

breakApart(): FRange

Unmerge cells in the range

Returns

FRange

This range, for chaining

Inherited from

FRange.breakApart

Defined in

sheets/src/facade/f-range.ts:583


forEach()

forEach(callback): void

Iterate cells in this range. Merged cells will be respected.

Parameters

ParameterType
callback(row, col, cell) => void

Returns

void

Inherited from

FRange.forEach

Defined in

sheets/src/facade/f-range.ts:594


getCellData()

getCellData(): null | ICellData

Return first cell model data in this range

Returns

null | ICellData

The cell model data

Inherited from

FRange.getCellData

Defined in

sheets/src/facade/f-range.ts:108


getCellDataGrid()

getCellDataGrid(): Nullable<ICellData>[][]

Returns the cell data for the cells in the range.

Returns

Nullable<ICellData>[][]

A two-dimensional array of cell data.

Inherited from

FRange.getCellDataGrid

Defined in

sheets/src/facade/f-range.ts:169


getCellStyleData()

getCellStyleData(): null | IStyleData

Return first cell style data in this range

Returns

null | IStyleData

The cell style data

Inherited from

FRange.getCellStyleData

Defined in

sheets/src/facade/f-range.ts:126


getColumn()

getColumn(): number

Gets the starting column number of the applied area

Returns

number

The starting column number of the area

Inherited from

FRange.getColumn

Defined in

sheets/src/facade/f-range.ts:82


getFormulas()

getFormulas(): string[][]

Returns the formulas (A1 notation) for the cells in the range. Entries in the 2D array are empty strings for cells with no formula.

Returns

string[][]

A two-dimensional array of formulas in string format.

Inherited from

FRange.getFormulas

Defined in

sheets/src/facade/f-range.ts:187


getHeight()

getHeight(): number

Gets the height of the applied area

Returns

number

The height of the area

Inherited from

FRange.getHeight

Defined in

sheets/src/facade/f-range.ts:100


getHorizontalAlignment()

getHorizontalAlignment(): string

Returns

string

Inherited from

FRange.getHorizontalAlignment

Defined in

sheets/src/facade/f-range.ts:216


getRange()

getRange(): IRange

Gets the area where the statement is applied

Returns

IRange

The area where the statement is applied

Inherited from

FRange.getRange

Defined in

sheets/src/facade/f-range.ts:64


getRow()

getRow(): number

Gets the starting row number of the applied area

Returns

number

The starting row number of the area

Inherited from

FRange.getRow

Defined in

sheets/src/facade/f-range.ts:73


getSheetName()

getSheetName(): string

Gets the name of the worksheet

Returns

string

The name of the worksheet

Inherited from

FRange.getSheetName

Defined in

sheets/src/facade/f-range.ts:55


getUnitId()

getUnitId(): string

Get the unit ID of the current workbook

Returns

string

The unit ID of the workbook

Inherited from

FRange.getUnitId

Defined in

sheets/src/facade/f-range.ts:46


getValue()

getValue(): null | CellValue

Returns the value of the cell at the start of this range.

Returns

null | CellValue

The value of the cell.

Inherited from

FRange.getValue

Defined in

sheets/src/facade/f-range.ts:140


getValues()

getValues(): Nullable<CellValue>[][]

Returns the rectangular grid of values for this range. Returns a two-dimensional array of values, indexed by row, then by column.

Returns

Nullable<CellValue>[][]

A two-dimensional array of values.

Inherited from

FRange.getValues

Defined in

sheets/src/facade/f-range.ts:149


getVerticalAlignment()

getVerticalAlignment(): string

Returns

string

Inherited from

FRange.getVerticalAlignment

Defined in

sheets/src/facade/f-range.ts:220


getWidth()

getWidth(): number

Gets the width of the applied area

Returns

number

The width of the area

Inherited from

FRange.getWidth

Defined in

sheets/src/facade/f-range.ts:91


getWrap()

getWrap(): boolean

Returns

boolean

Inherited from

FRange.getWrap

Defined in

sheets/src/facade/f-range.ts:208


getWrapStrategy()

getWrapStrategy(): WrapStrategy

Returns

WrapStrategy

Inherited from

FRange.getWrapStrategy

Defined in

sheets/src/facade/f-range.ts:212


isMerged()

isMerged(): boolean

Return range whether this range is merged

Returns

boolean

if true is merged

Inherited from

FRange.isMerged

Defined in

sheets/src/facade/f-range.ts:116


isPartOfMerge()

isPartOfMerge(): boolean

Returns true if cells in the current range overlap a merged cell.

Returns

boolean

is overlap with a merged cell

Inherited from

FRange.isPartOfMerge

Defined in

sheets/src/facade/f-range.ts:574


merge()

merge(): Promise<FRange>

Merge cells in a range into one merged cell

Returns

Promise<FRange>

This range, for chaining

Inherited from

FRange.merge

Defined in

sheets/src/facade/f-range.ts:533


mergeAcross()

mergeAcross(): Promise<FRange>

Merges cells in a range horizontally.

Returns

Promise<FRange>

This range, for chaining

Inherited from

FRange.mergeAcross

Defined in

sheets/src/facade/f-range.ts:546


mergeVertically()

mergeVertically(): Promise<FRange>

Merges cells in a range vertically.

Returns

Promise<FRange>

This range, for chaining

Inherited from

FRange.mergeVertically

Defined in

sheets/src/facade/f-range.ts:560


setBackgroundColor()

setBackgroundColor(color): Promise<boolean>

Parameters

ParameterType
colorstring

Returns

Promise<boolean>

Inherited from

FRange.setBackgroundColor

Defined in

sheets/src/facade/f-range.ts:226


setFontColor()

setFontColor(color): this

Sets the font color in CSS notation (such as ‘#ffffff’ or ‘white’).

Parameters

ParameterTypeDescription
colornull | stringThe font color in CSS notation (such as ‘#ffffff’ or ‘white’); a null value resets the color.

Returns

this

Inherited from

FRange.setFontColor

Defined in

sheets/src/facade/f-range.ts:506


setFontFamily()

setFontFamily(fontFamily): this

Sets the font family, such as “Arial” or “Helvetica”.

Parameters

ParameterTypeDescription
fontFamilynull | stringThe font family to set; a null value resets the font family.

Returns

this

Inherited from

FRange.setFontFamily

Defined in

sheets/src/facade/f-range.ts:464


setFontLine()

setFontLine(fontLine): this

Sets the font line style of the given range (‘underline’, ‘line-through’, or ‘none’).

Parameters

ParameterTypeDescription
fontLinenull | FontLineThe font line style, either ‘underline’, ‘line-through’, or ‘none’; a null value resets the font line style.

Returns

this

Inherited from

FRange.setFontLine

Defined in

sheets/src/facade/f-range.ts:399


setFontSize()

setFontSize(size): this

Sets the font size, with the size being the point size to use.

Parameters

ParameterTypeDescription
sizenull | numberA font size in point size. A null value resets the font size.

Returns

this

Inherited from

FRange.setFontSize

Defined in

sheets/src/facade/f-range.ts:485


setFontStyle()

setFontStyle(fontStyle): this

Sets the font style for the given range (‘italic’ or ‘normal’).

Parameters

ParameterTypeDescription
fontStylenull | FontStyleThe font style, either ‘italic’ or ‘normal’; a null value resets the font style.

Returns

this

Inherited from

FRange.setFontStyle

Defined in

sheets/src/facade/f-range.ts:366


setFontWeight()

setFontWeight(fontWeight): this

Sets the font weight for the given range (normal/bold),

Parameters

ParameterTypeDescription
fontWeightnull | FontWeightThe font weight, either ‘normal’ or ‘bold’; a null value resets the font weight.

Returns

this

Inherited from

FRange.setFontWeight

Defined in

sheets/src/facade/f-range.ts:333


setHorizontalAlignment()

setHorizontalAlignment(alignment): Promise<boolean>

Set the horizontal (left to right) alignment for the given range (left/center/right).

Parameters

ParameterType
alignmentFHorizontalAlignment

Returns

Promise<boolean>

Inherited from

FRange.setHorizontalAlignment

Defined in

sheets/src/facade/f-range.ts:299


setNumberFormat()

setNumberFormat(pattern): Promise<boolean>

Set the number format of the range.

Parameters

ParameterTypeDescription
patternstringnumber format pattern.

Returns

Promise<boolean>

Execution result.

Implementation of

IFRangeSheetsNumfmtMixin.setNumberFormat

Overrides

FRange.setNumberFormat

Defined in

sheets-numfmt/src/facade/f-range.ts:33


setValue()

setValue(value): Promise<boolean>

The value can be a number, string, boolean, or standard cell format. If it begins with =, it is interpreted as a formula. The value is tiled to all cells in the range.

Parameters

ParameterType
valueICellData | CellValue

Returns

Promise<boolean>

Inherited from

FRange.setValue

Defined in

sheets/src/facade/f-range.ts:244


setValues()

setValues(value): Promise<boolean>

Sets a different value for each cell in the range. The value can be a two-dimensional array or a standard range matrix (must match the dimensions of this range), consisting of numbers, strings, Boolean values or Composed of standard cell formats. If a value begins with =, it is interpreted as a formula.

Parameters

ParameterType
valueIObjectMatrixPrimitiveType<ICellData> | ICellData[][] | IObjectMatrixPrimitiveType<CellValue> | CellValue[][]

Returns

Promise<boolean>

Inherited from

FRange.setValues

Defined in

sheets/src/facade/f-range.ts:312


setVerticalAlignment()

setVerticalAlignment(alignment): Promise<boolean>

Set the vertical (top to bottom) alignment for the given range (top/middle/bottom).

Parameters

ParameterType
alignmentFVerticalAlignment

Returns

Promise<boolean>

Inherited from

FRange.setVerticalAlignment

Defined in

sheets/src/facade/f-range.ts:287


setWrap()

setWrap(isWrapEnabled): Promise<boolean>

Set the cell wrap of the given range. Cells with wrap enabled (the default) resize to display their full content. Cells with wrap disabled display as much as possible in the cell without resizing or running to multiple lines.

Parameters

ParameterType
isWrapEnabledboolean

Returns

Promise<boolean>

Inherited from

FRange.setWrap

Defined in

sheets/src/facade/f-range.ts:263


setWrapStrategy()

setWrapStrategy(strategy): Promise<boolean>

Sets the text wrapping strategy for the cells in the range.

Parameters

ParameterType
strategyWrapStrategy

Returns

Promise<boolean>

Inherited from

FRange.setWrapStrategy

Defined in

sheets/src/facade/f-range.ts:275


extend()

static extend(source): void

Parameters

ParameterType
sourceany

Returns

void

Inherited from

FRange.extend

Defined in

core/src/facade/f-base.ts:35