@univerjs/sheets v0.5.0-beta.1 • Docs
Class: FRange
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
Constructors
new FRange()
new FRange(
_workbook,
_worksheet,
_range,
_injector,
_commandService,
_formulaDataModel): FRange
Parameters
Parameter | Type |
---|---|
_workbook | Workbook |
_worksheet | Worksheet |
_range | IRange |
_injector | Injector |
_commandService | ICommandService |
_formulaDataModel | FormulaDataModel |
Returns
Overrides
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:30
Properties
Property | Modifier | Type | Defined in |
---|---|---|---|
_commandService | readonly | ICommandService | submodules/univer/packages/sheets/src/facade/f-range.ts:35 |
_formulaDataModel | readonly | FormulaDataModel | submodules/univer/packages/sheets/src/facade/f-range.ts:36 |
_injector | readonly | Injector | submodules/univer/packages/sheets/src/facade/f-range.ts:34 |
_range | readonly | IRange | submodules/univer/packages/sheets/src/facade/f-range.ts:33 |
_workbook | readonly | Workbook | submodules/univer/packages/sheets/src/facade/f-range.ts:31 |
_worksheet | readonly | Worksheet | submodules/univer/packages/sheets/src/facade/f-range.ts:32 |
Methods
_initialize()
_initialize(): void
Returns
void
Inherited from
Defined in
submodules/univer/packages/core/src/facade/f-base.ts:33
breakApart()
breakApart(): FRange
Unmerge cells in the range
Returns
This range, for chaining
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:583
forEach()
forEach(callback): void
Iterate cells in this range. Merged cells will be respected.
Parameters
Parameter | Type |
---|---|
callback | (row , col , cell ) => void |
Returns
void
Defined in
submodules/univer/packages/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
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:108
getCellDataGrid()
getCellDataGrid(): Nullable<ICellData>[][]
Returns the cell data for the cells in the range.
Returns
A two-dimensional array of cell data.
Defined in
submodules/univer/packages/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
Defined in
submodules/univer/packages/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
Defined in
submodules/univer/packages/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.
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:187
getHeight()
getHeight(): number
Gets the height of the applied area
Returns
number
The height of the area
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:100
getHorizontalAlignment()
getHorizontalAlignment(): string
Returns
string
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:216
getRange()
getRange(): IRange
Gets the area where the statement is applied
Returns
The area where the statement is applied
Defined in
submodules/univer/packages/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
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:73
getSheetName()
getSheetName(): string
Gets the name of the worksheet
Returns
string
The name of the worksheet
Defined in
submodules/univer/packages/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
Defined in
submodules/univer/packages/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.
Defined in
submodules/univer/packages/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
A two-dimensional array of values.
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:149
getVerticalAlignment()
getVerticalAlignment(): string
Returns
string
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:220
getWidth()
getWidth(): number
Gets the width of the applied area
Returns
number
The width of the area
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:91
getWrap()
getWrap(): boolean
Returns
boolean
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:208
getWrapStrategy()
getWrapStrategy(): WrapStrategy
Returns
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:212
isMerged()
isMerged(): boolean
Return range whether this range is merged
Returns
boolean
if true is merged
Defined in
submodules/univer/packages/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
Defined in
submodules/univer/packages/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
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:533
mergeAcross()
mergeAcross(): Promise<FRange>
Merges cells in a range horizontally.
Returns
Promise
<FRange
>
This range, for chaining
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:546
mergeVertically()
mergeVertically(): Promise<FRange>
Merges cells in a range vertically.
Returns
Promise
<FRange
>
This range, for chaining
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:560
setBackgroundColor()
setBackgroundColor(color): Promise<boolean>
Parameters
Parameter | Type |
---|---|
color | string |
Returns
Promise
<boolean
>
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:226
setFontColor()
setFontColor(color): this
Sets the font color in CSS notation (such as ‘#ffffff’ or ‘white’).
Parameters
Parameter | Type | Description |
---|---|---|
color | null | string | The font color in CSS notation (such as ‘#ffffff’ or ‘white’); a null value resets the color. |
Returns
this
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:506
setFontFamily()
setFontFamily(fontFamily): this
Sets the font family, such as “Arial” or “Helvetica”.
Parameters
Parameter | Type | Description |
---|---|---|
fontFamily | null | string | The font family to set; a null value resets the font family. |
Returns
this
Defined in
submodules/univer/packages/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
Parameter | Type | Description |
---|---|---|
fontLine | null | FontLine | The font line style, either ‘underline’, ‘line-through’, or ‘none’; a null value resets the font line style. |
Returns
this
Defined in
submodules/univer/packages/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
Parameter | Type | Description |
---|---|---|
size | null | number | A font size in point size. A null value resets the font size. |
Returns
this
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:485
setFontStyle()
setFontStyle(fontStyle): this
Sets the font style for the given range (‘italic’ or ‘normal’).
Parameters
Parameter | Type | Description |
---|---|---|
fontStyle | null | FontStyle | The font style, either ‘italic’ or ‘normal’; a null value resets the font style. |
Returns
this
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:366
setFontWeight()
setFontWeight(fontWeight): this
Sets the font weight for the given range (normal/bold),
Parameters
Parameter | Type | Description |
---|---|---|
fontWeight | null | FontWeight | The font weight, either ‘normal’ or ‘bold’; a null value resets the font weight. |
Returns
this
Defined in
submodules/univer/packages/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
Parameter | Type |
---|---|
alignment | FHorizontalAlignment |
Returns
Promise
<boolean
>
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:299
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
Parameter | Type |
---|---|
value | ICellData | CellValue |
Returns
Promise
<boolean
>
Defined in
submodules/univer/packages/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
Parameter | Type |
---|---|
value | IObjectMatrixPrimitiveType <ICellData > | ICellData [][] | IObjectMatrixPrimitiveType <CellValue > | CellValue [][] |
Returns
Promise
<boolean
>
Defined in
submodules/univer/packages/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
Parameter | Type |
---|---|
alignment | FVerticalAlignment |
Returns
Promise
<boolean
>
Defined in
submodules/univer/packages/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
Parameter | Type |
---|---|
isWrapEnabled | boolean |
Returns
Promise
<boolean
>
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:263
setWrapStrategy()
setWrapStrategy(strategy): Promise<boolean>
Sets the text wrapping strategy for the cells in the range.
Parameters
Parameter | Type |
---|---|
strategy | WrapStrategy |
Returns
Promise
<boolean
>
Defined in
submodules/univer/packages/sheets/src/facade/f-range.ts:275
extend()
static extend(source): void
Parameters
Parameter | Type |
---|---|
source | any |
Returns
void
Inherited from
Defined in
submodules/univer/packages/core/src/facade/f-base.ts:35