@univerjs-pro/sheets-pivot v0.5.0-beta.1 • Docs
Class: SheetsPivotDataSourceModel
Extends
Constructors
new SheetsPivotDataSourceModel()
new SheetsPivotDataSourceModel(
_injector,
_univerInstanceService,
_lifecycleService,
_configService,
_commandService,
_resourceManagerService): SheetsPivotDataSourceModel
Parameters
Parameter | Type |
---|---|
_injector | Injector |
_univerInstanceService | IUniverInstanceService |
_lifecycleService | LifecycleService |
_configService | IConfigService |
_commandService | ICommandService |
_resourceManagerService | IResourceManagerService |
Returns
Overrides
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:43
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Disposable ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:93 |
_lifecycleService | readonly | LifecycleService | undefined | - | packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:46 |
collectionChange$ | public | Observable <ICollectionChangeInfo > | undefined | - | packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:27 |
fieldsCollectionChange$ | public | Observable <Record <string , FieldsCollection >> | undefined | - | packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:33 |
needSameDeleteModel | public | { deleteUnitId : (unitId ) => void ; }[] | [] | - | packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:36 |
viewData$ | public | Observable <{ pivotTableId : string ; subUnitId : string ; unitId : string ; }> | undefined | - | packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:30 |
Methods
addCollectionByJSON()
addCollectionByJSON(
token,
collectionJSON,
sourceRangeInfo,
targetCellInfo): IUpdateInfo
Parameters
Parameter | Type |
---|---|
token | string |
collectionJSON | IFieldsCollectionJSON |
sourceRangeInfo | IUnitRangeNameWithSubUnitId |
targetCellInfo | IPivotCellPositionInfo |
Returns
IUpdateInfo
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:342
addDirtyPivotTable()
addDirtyPivotTable(dirtyInfo): void
Parameters
Parameter | Type |
---|---|
dirtyInfo | IPivotMutationDirtyViewInfo |
Returns
void
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:406
addPivotTable()
addPivotTable(
unitId,
subUnitId,
pivotTableId,
pivotTable,
pivotTableConfig): void
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
pivotTableId | string |
pivotTable | PivotTable |
pivotTableConfig | IPivotTableConfig |
Returns
void
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:281
broadcastCollectionChange()
broadcastCollectionChange(info): void
Parameters
Parameter | Type |
---|---|
info | ICollectionChangeInfo |
Returns
void
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:131
createCollectionWithDataRange()
createCollectionWithDataRange(dataRangeInfo): IUpdateInfo
- this function just create a collection with data range info, but wil not add it to the dataFieldManager
Parameters
Parameter | Type |
---|---|
dataRangeInfo | IUnitRangeNameWithSubUnitId |
Returns
IUpdateInfo
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:349
deleteUnitId()
deleteUnitId(unitId): void
Parameters
Parameter | Type |
---|---|
unitId | string |
Returns
void
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:328
dispose()
dispose(): void
Returns
void
Overrides
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:394
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
submodules/univer/packages/core/src/shared/lifecycle.ts:96
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
Defined in
submodules/univer/packages/core/src/shared/lifecycle.ts:100
fromJSON()
fromJSON(jsonData): void
Parameters
Parameter | Type |
---|---|
jsonData | IPivotTableJson |
Returns
void
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:475
getCollection()
getCollection(unitId, token): FieldsCollection
Parameters
Parameter | Type |
---|---|
unitId | string |
token | string |
Returns
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:147
getDataFieldManager()
getDataFieldManager(unitId): SheetsPivotDataFieldManager
Parameters
Parameter | Type |
---|---|
unitId | string |
Returns
SheetsPivotDataFieldManager
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:135
getPivotTableConfig()
getPivotTableConfig(
unitId,
subUnitId,
pivotTableId): undefined | IPivotTableConfig
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
pivotTableId | string |
Returns
undefined
| IPivotTableConfig
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:301
getPivotTableInstance()
getPivotTableInstance(pivotTableId): undefined | PivotTable
Parameters
Parameter | Type |
---|---|
pivotTableId | string |
Returns
undefined
| PivotTable
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:324
getPivotTableModelConfig()
getPivotTableModelConfig(
unitId,
subUnitId,
pivotTableId): undefined | IPivotTableSnapshot
- get the pivot table model json config
Parameters
Parameter | Type | Description |
---|---|---|
unitId | string | - |
subUnitId | string | - |
pivotTableId | string | the pivot table id |
Returns
undefined
| IPivotTableSnapshot
the pivot table model json config
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:316
getSubUnitPivotConfigs()
getSubUnitPivotConfigs(unitId, subUnitId): undefined | Map<string, IPivotTableConfig>
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
Returns
undefined
| Map
<string
, IPivotTableConfig
>
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:365
getTargetByPivotId()
getTargetByPivotId(pivotTableId): null | {
subUnitId: string;
unitId: string;
}
Parameters
Parameter | Type |
---|---|
pivotTableId | string |
Returns
null
| {
subUnitId
: string
;
unitId
: string
;
}
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:369
getTextInfo()
getTextInfo(): Record<string, string>
Returns
Record
<string
, string
>
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:55
getUpdateRangeDeleteIds()
getUpdateRangeDeleteIds(
unitId,
token,
dataRangeInfo): undefined | string[]
Parameters
Parameter | Type |
---|---|
unitId | string |
token | string |
dataRangeInfo | IUnitRangeName |
Returns
undefined
| string
[]
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:151
getViewData()
getViewData(
unitId,
subUnitId,
pivotTableId): null | IPivotWorkerItemCache
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
pivotTableId | string |
Returns
null
| IPivotWorkerItemCache
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:398
handleMoveRange()
handleMoveRange(params): void
Parameters
Parameter | Type |
---|---|
params | IMoveRangeMutationParams |
Returns
void
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:66
queryDirtyPivotTable()
queryDirtyPivotTable(dirtyInfo): void
trigger the pivot table query
Parameters
Parameter | Type |
---|---|
dirtyInfo | IPivotMutationDirtyViewInfo |
Returns
void
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:429
refreshData()
refreshData(
collection,
updateDataFieldList,
dataRangeInfo): void
Parameters
Parameter | Type |
---|---|
collection | FieldsCollection |
updateDataFieldList | { dataField : DataField ; index : number ; }[] |
dataRangeInfo | IUnitRangeNameWithSubUnitId |
Returns
void
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:353
removeCollections()
removeCollections(unitId, token): void
Parameters
Parameter | Type |
---|---|
unitId | string |
token | string |
Returns
void
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:361
removeDataField()
removeDataField(unitId, dataFieldId): void
Parameters
Parameter | Type |
---|---|
unitId | string |
dataFieldId | string |
Returns
void
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:357
removePivotTable()
removePivotTable(
unitId,
subUnitId,
pivotTableId): void
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
pivotTableId | string |
Returns
void
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:286
setPivotTable()
setPivotTable(
unitId,
subUnitId,
pivotTableId,
pivotTableConfig): void
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
pivotTableId | string |
pivotTableConfig | IPivotTableConfig |
Returns
void
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:297
setTextInfo()
setTextInfo(textInfo): void
Parameters
Parameter | Type |
---|---|
textInfo | Record <string , string > |
Returns
void
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:62
sideEffectUpdateWorkerCache()
sideEffectUpdateWorkerCache(
unitId,
subUnitId,
pivotTableId,
workerCache?): void
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
pivotTableId | string |
workerCache ? | IPivotWorkerItemCache |
Returns
void
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:380
toJSON()
toJSON(unitId): IPivotTableJson
Parameters
Parameter | Type |
---|---|
unitId | string |
Returns
IPivotTableJson
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:443
updateConfig()
updateConfig(info): void
Parameters
Parameter | Type |
---|---|
info | ISendPivotConfigLocalMutationParams |
Returns
void
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:208
updateDirtyPivotTable()
updateDirtyPivotTable(dirtyInfo): void
Parameters
Parameter | Type |
---|---|
dirtyInfo | IPivotMutationDirtyViewInfo |
Returns
void
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:410
updateView()
updateView(
unitId,
subUnitId,
type,
pivotTableId,
view,
pivotConfig,
collectionConfig?,
ignoreDirty?): void
Parameters
Parameter | Type | Default value |
---|---|---|
unitId | string | undefined |
subUnitId | string | undefined |
type | PivotTableOperationEnum | undefined |
pivotTableId | string | undefined |
view | Nullable <PivotView > | undefined |
pivotConfig | Nullable <IPivotTableConfig > | undefined |
collectionConfig ? | IDataFieldManagerJSON | undefined |
ignoreDirty ? | boolean | false |
Returns
void
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:223
updateViewData()
updateViewData(ctx, ignoreDirty): void
- the function is used to save the dirty view data and range for formula calculation
Parameters
Parameter | Type | Description |
---|---|---|
ctx | IViewTranslateCtx | the dirty context |
ignoreDirty | boolean | the flag to ignore the dirty view area, only in handleSourceRangeChange , we get a dirty change from the source range change, we need ignore the dirty view area,because the dirty view area has done immediately |
Returns
void
Defined in
packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:256