@univerjs-pro/sheets-pivot v0.5.4
Class: SheetsPivotDataSourceModel
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:19
Extends
Constructors
new SheetsPivotDataSourceModel()
new SheetsPivotDataSourceModel(
_injector,
_univerInstanceService,
_lifecycleService,
_configService,
_commandService,
_resourceManagerService): SheetsPivotDataSourceModel
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:43
Parameters
Parameter | Type |
---|---|
_injector | Injector |
_univerInstanceService | IUniverInstanceService |
_lifecycleService | LifecycleService |
_configService | IConfigService |
_commandService | ICommandService |
_resourceManagerService | IResourceManagerService |
Returns
Overrides
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Disposable ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:96 |
_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
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:342
Parameters
Parameter | Type |
---|---|
token | string |
collectionJSON | IFieldsCollectionJSON |
sourceRangeInfo | IUnitRangeNameWithSubUnitId |
targetCellInfo | IPivotCellPositionInfo |
Returns
IUpdateInfo
addDirtyPivotTable()
addDirtyPivotTable(dirtyInfo): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:406
Parameters
Parameter | Type |
---|---|
dirtyInfo | IPivotMutationDirtyViewInfo |
Returns
void
addPivotTable()
addPivotTable(
unitId,
subUnitId,
pivotTableId,
pivotTable,
pivotTableConfig): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:281
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
pivotTableId | string |
pivotTable | PivotTable |
pivotTableConfig | IPivotTableConfig |
Returns
void
broadcastCollectionChange()
broadcastCollectionChange(info): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:131
Parameters
Parameter | Type |
---|---|
info | ICollectionChangeInfo |
Returns
void
createCollectionWithDataRange()
createCollectionWithDataRange(dataRangeInfo): IUpdateInfo
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:349
- 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
deleteUnitId()
deleteUnitId(unitId): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:328
Parameters
Parameter | Type |
---|---|
unitId | string |
Returns
void
dispose()
dispose(): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:394
Returns
void
Overrides
disposeWithMe()
disposeWithMe(disposable): IDisposable
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:99
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
ensureNotDisposed()
protected ensureNotDisposed(): void
Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:103
Returns
void
Inherited from
fromJSON()
fromJSON(jsonData): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:477
Parameters
Parameter | Type |
---|---|
jsonData | IPivotTableJson |
Returns
void
getCollection()
getCollection(unitId, token): FieldsCollection
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:147
Parameters
Parameter | Type |
---|---|
unitId | string |
token | string |
Returns
getDataFieldManager()
getDataFieldManager(unitId): SheetsPivotDataFieldManager
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:135
Parameters
Parameter | Type |
---|---|
unitId | string |
Returns
SheetsPivotDataFieldManager
getPivotTableConfig()
getPivotTableConfig(
unitId,
subUnitId,
pivotTableId): undefined | IPivotTableConfig
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:301
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
pivotTableId | string |
Returns
undefined
| IPivotTableConfig
getPivotTableInstance()
getPivotTableInstance(pivotTableId): undefined | PivotTable
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:324
Parameters
Parameter | Type |
---|---|
pivotTableId | string |
Returns
undefined
| PivotTable
getPivotTableModelConfig()
getPivotTableModelConfig(
unitId,
subUnitId,
pivotTableId):
| undefined
| IPivotTableSnapshot
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:316
- 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
getSubUnitPivotConfigs()
getSubUnitPivotConfigs(unitId, subUnitId):
| undefined
| Map<string, IPivotTableConfig>
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:365
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
Returns
| undefined
| Map
<string
, IPivotTableConfig
>
getTargetByPivotId()
getTargetByPivotId(pivotTableId):
| null
| {
subUnitId: string;
unitId: string;
}
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:369
Parameters
Parameter | Type |
---|---|
pivotTableId | string |
Returns
| null
| {
subUnitId
: string
;
unitId
: string
;
}
getTextInfo()
getTextInfo(): Record<string, string>
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:55
Returns
Record
<string
, string
>
getUpdateRangeDeleteIds()
getUpdateRangeDeleteIds(
unitId,
token,
dataRangeInfo): undefined | string[]
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:151
Parameters
Parameter | Type |
---|---|
unitId | string |
token | string |
dataRangeInfo | IUnitRangeName |
Returns
undefined
| string
[]
getViewData()
getViewData(
unitId,
subUnitId,
pivotTableId): null | IPivotWorkerItemCache
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:398
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
pivotTableId | string |
Returns
null
| IPivotWorkerItemCache
handleMoveRange()
handleMoveRange(params): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:66
Parameters
Parameter | Type |
---|---|
params | IMoveRangeMutationParams |
Returns
void
queryDirtyPivotTable()
queryDirtyPivotTable(dirtyInfo): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:431
trigger the pivot table query
Parameters
Parameter | Type |
---|---|
dirtyInfo | IPivotMutationDirtyViewInfo |
Returns
void
refreshData()
refreshData(
collection,
updateDataFieldList,
dataRangeInfo): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:353
Parameters
Parameter | Type |
---|---|
collection | FieldsCollection |
updateDataFieldList | { dataField : DataField ; index : number ; }[] |
dataRangeInfo | IUnitRangeNameWithSubUnitId |
Returns
void
removeCollections()
removeCollections(unitId, token): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:361
Parameters
Parameter | Type |
---|---|
unitId | string |
token | string |
Returns
void
removeDataField()
removeDataField(unitId, dataFieldId): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:357
Parameters
Parameter | Type |
---|---|
unitId | string |
dataFieldId | string |
Returns
void
removePivotTable()
removePivotTable(
unitId,
subUnitId,
pivotTableId): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:286
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
pivotTableId | string |
Returns
void
setPivotTable()
setPivotTable(
unitId,
subUnitId,
pivotTableId,
pivotTableConfig): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:297
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
pivotTableId | string |
pivotTableConfig | IPivotTableConfig |
Returns
void
setTextInfo()
setTextInfo(textInfo): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:62
Parameters
Parameter | Type |
---|---|
textInfo | Record <string , string > |
Returns
void
sideEffectUpdateWorkerCache()
sideEffectUpdateWorkerCache(
unitId,
subUnitId,
pivotTableId,
workerCache?): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:380
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
pivotTableId | string |
workerCache ? | IPivotWorkerItemCache |
Returns
void
toJSON()
toJSON(unitId): IPivotTableJson
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:445
Parameters
Parameter | Type |
---|---|
unitId | string |
Returns
IPivotTableJson
updateConfig()
updateConfig(info): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:208
Parameters
Parameter | Type |
---|---|
info | ISendPivotConfigLocalMutationParams |
Returns
void
updateDirtyPivotTable()
updateDirtyPivotTable(dirtyInfo): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:410
Parameters
Parameter | Type |
---|---|
dirtyInfo | IPivotMutationDirtyViewInfo |
Returns
void
updateView()
updateView(
unitId,
subUnitId,
type,
pivotTableId,
view,
pivotConfig,
collectionConfig?,
ignoreDirty?): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:223
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
updateViewData()
updateViewData(ctx, ignoreDirty): void
Defined in: packages/sheets-pivot/src/models/sheets-pivot-data-source-model.ts:256
- 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