@univerjs/sheets-numfmt v0.5.1 • Docs
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
Parameter | Type |
---|---|
_workbook | Workbook |
_worksheet | Worksheet |
_range | IRange |
_injector | Injector |
_commandService | ICommandService |
_formulaDataModel | FormulaDataModel |
Returns
Inherited from
Defined in
sheets/src/facade/f-range.ts:30
Properties
Property | Modifier | Type | Inherited from | Defined in |
---|---|---|---|---|
_commandService | readonly | ICommandService | FRange ._commandService | sheets/src/facade/f-range.ts:35 |
_formulaDataModel | readonly | FormulaDataModel | FRange ._formulaDataModel | sheets/src/facade/f-range.ts:36 |
_injector | readonly | Injector | FRange ._injector | sheets/src/facade/f-range.ts:34 |
_range | readonly | IRange | FRange ._range | sheets/src/facade/f-range.ts:33 |
_workbook | readonly | Workbook | FRange ._workbook | sheets/src/facade/f-range.ts:31 |
_worksheet | readonly | Worksheet | FRange ._worksheet | sheets/src/facade/f-range.ts:32 |
Methods
_initialize()
_initialize(): void
Returns
void
Inherited from
Defined in
core/src/facade/f-base.ts:33
breakApart()
breakApart(): FRange
Unmerge cells in the range
Returns
This range, for chaining
Inherited from
Defined in
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
Inherited from
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
Defined in
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.
Inherited from
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
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
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
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
Defined in
sheets/src/facade/f-range.ts:100
getHorizontalAlignment()
getHorizontalAlignment(): string
Returns
string
Inherited from
Defined in
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
Inherited from
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
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
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
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
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
A two-dimensional array of values.
Inherited from
Defined in
sheets/src/facade/f-range.ts:149
getVerticalAlignment()
getVerticalAlignment(): string
Returns
string
Inherited from
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
Defined in
sheets/src/facade/f-range.ts:91
getWrap()
getWrap(): boolean
Returns
boolean
Inherited from
Defined in
sheets/src/facade/f-range.ts:208
getWrapStrategy()
getWrapStrategy(): WrapStrategy
Returns
Inherited from
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
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
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
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
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
Defined in
sheets/src/facade/f-range.ts:560
setBackgroundColor()
setBackgroundColor(color): Promise<boolean>
Parameters
Parameter | Type |
---|---|
color | string |
Returns
Promise
<boolean
>
Inherited from
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
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
Inherited from
Defined in
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
Inherited from
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
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
Inherited from
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
Parameter | Type | Description |
---|---|---|
size | null | number | A font size in point size. A null value resets the font size. |
Returns
this
Inherited from
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
Parameter | Type | Description |
---|---|---|
fontStyle | null | FontStyle | The font style, either ‘italic’ or ‘normal’; a null value resets the font style. |
Returns
this
Inherited from
Defined in
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
Inherited from
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
Parameter | Type |
---|---|
alignment | FHorizontalAlignment |
Returns
Promise
<boolean
>
Inherited from
Defined in
sheets/src/facade/f-range.ts:299
setNumberFormat()
setNumberFormat(pattern): Promise<boolean>
Set the number format of the range.
Parameters
Parameter | Type | Description |
---|---|---|
pattern | string | number 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
Parameter | Type |
---|---|
value | ICellData | CellValue |
Returns
Promise
<boolean
>
Inherited from
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
Parameter | Type |
---|---|
value | IObjectMatrixPrimitiveType <ICellData > | ICellData [][] | IObjectMatrixPrimitiveType <CellValue > | CellValue [][] |
Returns
Promise
<boolean
>
Inherited from
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
Parameter | Type |
---|---|
alignment | FVerticalAlignment |
Returns
Promise
<boolean
>
Inherited from
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
Parameter | Type |
---|---|
isWrapEnabled | boolean |
Returns
Promise
<boolean
>
Inherited from
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
Parameter | Type |
---|---|
strategy | WrapStrategy |
Returns
Promise
<boolean
>
Inherited from
Defined in
sheets/src/facade/f-range.ts:275
extend()
static extend(source): void
Parameters
Parameter | Type |
---|---|
source | any |
Returns
void
Inherited from
Defined in
core/src/facade/f-base.ts:35