@univerjs/sheets-data-validation v0.5.1 • Docs
Class: FWorkbookDataValidationMixin
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 FWorkbookDataValidationMixin()
new FWorkbookDataValidationMixin(
_workbook,
_injector,
_resourceLoaderService,
_selectionManagerService,
_univerInstanceService,
_commandService,
_permissionService,
_logService): FWorkbookDataValidationMixin
Parameters
Parameter | Type |
---|---|
_workbook | Workbook |
_injector | Injector |
_resourceLoaderService | IResourceLoaderService |
_selectionManagerService | SheetsSelectionsService |
_univerInstanceService | IUniverInstanceService |
_commandService | ICommandService |
_permissionService | IPermissionService |
_logService | ILogService |
Returns
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:27
Properties
Property | Modifier | Type | Inherited from | Defined in |
---|---|---|---|---|
_commandService | readonly | ICommandService | FWorkbook ._commandService | sheets/src/facade/f-workbook.ts:33 |
_dataValidationModel | public | SheetDataValidationModel | - | sheets-data-validation/src/facade/f-workbook.ts:125 |
_injector | readonly | Injector | FWorkbook ._injector | sheets/src/facade/f-workbook.ts:29 |
_logService | readonly | ILogService | FWorkbook ._logService | sheets/src/facade/f-workbook.ts:35 |
_permissionService | readonly | IPermissionService | FWorkbook ._permissionService | sheets/src/facade/f-workbook.ts:34 |
_resourceLoaderService | readonly | IResourceLoaderService | FWorkbook ._resourceLoaderService | sheets/src/facade/f-workbook.ts:30 |
_selectionManagerService | readonly | SheetsSelectionsService | FWorkbook ._selectionManagerService | sheets/src/facade/f-workbook.ts:31 |
_univerInstanceService | readonly | IUniverInstanceService | FWorkbook ._univerInstanceService | sheets/src/facade/f-workbook.ts:32 |
_workbook | readonly | Workbook | FWorkbook ._workbook | sheets/src/facade/f-workbook.ts:28 |
id | readonly | string | FWorkbook .id | sheets/src/facade/f-workbook.ts:25 |
Methods
_initialize()
_initialize(): void
Returns
void
Overrides
Defined in
sheets-data-validation/src/facade/f-workbook.ts:127
create()
create(
name,
rows,
column): FWorksheet
Create a new worksheet and returns a handle to it.
Parameters
Parameter | Type | Description |
---|---|---|
name | string | Name of the new sheet |
rows | number | How may rows would the new sheet have |
column | number | How many columns would the new sheet have |
Returns
The new created sheet
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:94
deleteSheet()
deleteSheet(sheet): void
Deletes the specified worksheet.
Parameters
Parameter | Type | Description |
---|---|---|
sheet | FWorksheet | The worksheet to delete. |
Returns
void
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:189
getActiveRange()
getActiveRange(): null | FRange
Returns the selected range in the active sheet, or null if there is no active range.
Returns
null
| FRange
the active range
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:303
getActiveSheet()
getActiveSheet(): FWorksheet
Get the active sheet of the workbook.
Returns
The active sheet of the workbook
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:72
getId()
getId(): string
Returns
string
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:42
getName()
getName(): string
Returns
string
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:46
getSheetByName()
getSheetByName(name): null | FWorksheet
Get a worksheet by sheet name.
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The name of the sheet to get. |
Returns
null
| FWorksheet
The worksheet with given sheet name
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:139
getSheetBySheetId()
getSheetBySheetId(sheetId): null | FWorksheet
Get a worksheet by sheet id.
Parameters
Parameter | Type | Description |
---|---|---|
sheetId | string | The id of the sheet to get. |
Returns
null
| FWorksheet
The worksheet with given sheet id
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:125
getSheets()
getSheets(): FWorksheet[]
Gets all the worksheets in this workbook
Returns
An array of all the worksheets in the workbook
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:81
getSnapshot()
getSnapshot(): IWorkbookData
Returns
{IWorkbookData}
Deprecated
use ‘save’ instead.
Memberof
FWorkbook
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:63
getValidatorStatus()
getValidatorStatus(): Promise<Record<string, ObjectMatrix<Nullable<DataValidationStatus>>>>
get data validation validator status for current workbook
Returns
Promise
<Record
<string
, ObjectMatrix
<Nullable
<DataValidationStatus
>>>>
matrix of validator status
Implementation of
IFWorkbookDataValidationMixin
.getValidatorStatus
Overrides
FWorkbook.getValidatorStatus
Defined in
sheets-data-validation/src/facade/f-workbook.ts:139
insertSheet()
insertSheet(): FWorksheet
Inserts a new worksheet into the workbook. Using a default sheet name. The new sheet becomes the active sheet
Returns
The new sheet
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:167
onBeforeAddDataValidation()
onBeforeAddDataValidation(callback): IDisposable
The onBeforeAddDataValidation event is fired before the data validation rule is added.
Parameters
Parameter | Type | Description |
---|---|---|
callback | (params , options ) => false | void | Callback function that will be called when the event is fired |
Returns
A disposable object that can be used to unsubscribe from the event
Implementation of
IFWorkbookDataValidationMixin
.onBeforeAddDataValidation
Overrides
FWorkbook.onBeforeAddDataValidation
Defined in
sheets-data-validation/src/facade/f-workbook.ts:177
onBeforeCommandExecute()
onBeforeCommandExecute(callback): IDisposable
Register a callback that will be triggered before invoking a command targeting the Univer sheet.
Parameters
Parameter | Type | Description |
---|---|---|
callback | CommandListener | the callback. |
Returns
A function to dispose the listening.
Inherited from
FWorkbook
.onBeforeCommandExecute
Defined in
sheets/src/facade/f-workbook.ts:215
onBeforeDeleteAllDataValidation()
onBeforeDeleteAllDataValidation(callback): IDisposable
The onBeforeDeleteAllDataValidation event is fired before delete all data validation rules.
Parameters
Parameter | Type | Description |
---|---|---|
callback | (params , options ) => false | void | Callback function that will be called when the event is fired |
Returns
A disposable object that can be used to unsubscribe from the event
Implementation of
IFWorkbookDataValidationMixin
.onBeforeDeleteAllDataValidation
Overrides
FWorkbook.onBeforeDeleteAllDataValidation
Defined in
sheets-data-validation/src/facade/f-workbook.ts:254
onBeforeDeleteDataValidation()
onBeforeDeleteDataValidation(callback): IDisposable
The onBeforeDeleteDataValidation event is fired before the data validation rule is deleted.
Parameters
Parameter | Type | Description |
---|---|---|
callback | (params , options ) => false | void | Callback function that will be called when the event is fired |
Returns
A disposable object that can be used to unsubscribe from the event
Implementation of
IFWorkbookDataValidationMixin
.onBeforeDeleteDataValidation
Overrides
FWorkbook.onBeforeDeleteDataValidation
Defined in
sheets-data-validation/src/facade/f-workbook.ts:240
onBeforeUpdateDataValidationCriteria()
onBeforeUpdateDataValidationCriteria(callback): IDisposable
The onBeforeUpdateDataValidationCriteria event is fired before the data validation rule is updated.
Parameters
Parameter | Type | Description |
---|---|---|
callback | (params , options ) => false | void | Callback function that will be called when the event is fired |
Returns
A disposable object that can be used to unsubscribe from the event
Implementation of
IFWorkbookDataValidationMixin
.onBeforeUpdateDataValidationCriteria
Overrides
FWorkbook.onBeforeUpdateDataValidationCriteria
Defined in
sheets-data-validation/src/facade/f-workbook.ts:193
onBeforeUpdateDataValidationOptions()
onBeforeUpdateDataValidationOptions(callback): IDisposable
The onBeforeUpdateDataValidationOptions event is fired before the data validation rule is updated.
Parameters
Parameter | Type | Description |
---|---|---|
callback | (params , options ) => false | void | Callback function that will be called when the event is fired |
Returns
A disposable object that can be used to unsubscribe from the event
Implementation of
IFWorkbookDataValidationMixin
.onBeforeUpdateDataValidationOptions
Overrides
FWorkbook.onBeforeUpdateDataValidationOptions
Defined in
sheets-data-validation/src/facade/f-workbook.ts:225
onBeforeUpdateDataValidationRange()
onBeforeUpdateDataValidationRange(callback): IDisposable
The onBeforeUpdateDataValidationRange event is fired before the data validation rule is updated.
Parameters
Parameter | Type | Description |
---|---|---|
callback | (params , options ) => false | void | Callback function that will be called when the event is fired |
Returns
A disposable object that can be used to unsubscribe from the event
Implementation of
IFWorkbookDataValidationMixin
.onBeforeUpdateDataValidationRange
Overrides
FWorkbook.onBeforeUpdateDataValidationRange
Defined in
sheets-data-validation/src/facade/f-workbook.ts:210
onCommandExecuted()
onCommandExecuted(callback): IDisposable
Register a callback that will be triggered when a command is invoked targeting the Univer sheet.
Parameters
Parameter | Type | Description |
---|---|---|
callback | CommandListener | the callback. |
Returns
A function to dispose the listening.
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:230
onDataValidationChange()
onDataValidationChange(callback): IDisposable
The onDataValidationChange event is fired when the data validation rule of this sheet is changed.
Parameters
Parameter | Type | Description |
---|---|---|
callback | (ruleChange ) => void | Callback function that will be called when the event is fired |
Returns
A disposable object that can be used to unsubscribe from the event
Implementation of
IFWorkbookDataValidationMixin
.onDataValidationChange
Overrides
FWorkbook.onDataValidationChange
Defined in
sheets-data-validation/src/facade/f-workbook.ts:150
onDataValidationStatusChange()
onDataValidationStatusChange(callback): IDisposable
The onDataValidationStatusChange event is fired when the data validation status of this sheet is changed.
Parameters
Parameter | Type | Description |
---|---|---|
callback | (statusChange ) => void | Callback function that will be called when the event is fired |
Returns
A disposable object that can be used to unsubscribe from the event
Implementation of
IFWorkbookDataValidationMixin
.onDataValidationStatusChange
Overrides
FWorkbook.onDataValidationStatusChange
Defined in
sheets-data-validation/src/facade/f-workbook.ts:164
onSelectionChange()
onSelectionChange(callback): IDisposable
Parameters
Parameter | Type |
---|---|
callback | (selections ) => void |
Returns
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:240
redo()
redo(): Promise<boolean>
Returns
Promise
<boolean
>
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:205
save()
save(): IWorkbookData
save workbook snapshot data, including conditional formatting, data validation, and other plugin data.
Returns
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:53
setActiveRange()
setActiveRange(range): void
Sets the active selection region for this sheet.
Parameters
Parameter | Type | Description |
---|---|---|
range | FRange | The range to set as the active selection. |
Returns
void
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:274
setActiveSheet()
setActiveSheet(sheet): FWorksheet
Sets the given worksheet to be the active worksheet in the workbook.
Parameters
Parameter | Type | Description |
---|---|---|
sheet | FWorksheet | The worksheet to set as the active worksheet. |
Returns
The active worksheet
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:153
setEditable()
setEditable(value): void
Used to modify the editing permissions of the workbook. When the value is false, editing is not allowed.
Parameters
Parameter | Type | Description |
---|---|---|
value | boolean | editable value want to set |
Returns
void
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:261
undo()
undo(): Promise<boolean>
Returns
Promise
<boolean
>
Inherited from
Defined in
sheets/src/facade/f-workbook.ts:200
extend()
static extend(source): void
Parameters
Parameter | Type |
---|---|
source | any |
Returns
void
Inherited from
Defined in
core/src/facade/f-base.ts:35