@univerjs-pro/sheets-pivot 0.4.2 → 0.5.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -15
- package/lib/cjs/facade.js +1 -0
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/facade.js +1 -0
- package/lib/es/index.js +1 -1
- package/lib/es/locale/en-US.js +1 -0
- package/lib/es/locale/fa-IR.js +1 -0
- package/lib/es/locale/ru-RU.js +1 -0
- package/lib/es/locale/vi-VN.js +1 -0
- package/lib/es/locale/zh-CN.js +1 -0
- package/lib/es/locale/zh-TW.js +1 -0
- package/lib/types/index.d.ts +1158 -29
- package/lib/umd/facade.js +1 -0
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/en-US.js +1 -0
- package/lib/umd/locale/fa-IR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -0
- package/lib/umd/locale/vi-VN.js +1 -0
- package/lib/umd/locale/zh-CN.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -0
- package/package.json +39 -20
- package/lib/locale/en-US.json +0 -30
- package/lib/locale/fa-IR.json +0 -30
- package/lib/locale/ru-RU.json +0 -30
- package/lib/locale/vi-VN.json +0 -30
- package/lib/locale/zh-CN.json +0 -30
- package/lib/locale/zh-TW.json +0 -30
- package/lib/types/commands/command/add-pivot-table-with-config.command.d.ts +0 -3
- package/lib/types/commands/command/util.d.ts +0 -12
- package/lib/types/commands/mutations/add-pivot-field.mutation.d.ts +0 -3
- package/lib/types/commands/mutations/add-pivot-table.mutation.d.ts +0 -3
- package/lib/types/commands/mutations/change-apply-util.d.ts +0 -15
- package/lib/types/commands/mutations/pivot-data-communication.mutation.d.ts +0 -7
- package/lib/types/commands/mutations/remove-pivot-field.mutation.d.ts +0 -3
- package/lib/types/commands/mutations/remove-pivot-table.mutation.d.ts +0 -3
- package/lib/types/commands/mutations/rename-pivot-field.mutation.d.ts +0 -3
- package/lib/types/commands/mutations/set-pivot-collapse.mutation.d.ts +0 -3
- package/lib/types/commands/mutations/set-pivot-field-format.mutation.d.ts +0 -3
- package/lib/types/commands/mutations/set-pivot-filter.mutation.d.ts +0 -3
- package/lib/types/commands/mutations/set-pivot-option.mutation.d.ts +0 -3
- package/lib/types/commands/mutations/set-pivot-position.mutation.d.ts +0 -3
- package/lib/types/commands/mutations/set-pivot-sort.mutation.d.ts +0 -3
- package/lib/types/commands/mutations/set-pivot-subtotal-type.mutation.d.ts +0 -3
- package/lib/types/commands/mutations/update-field-position.mutation.d.ts +0 -3
- package/lib/types/commands/mutations/update-pivot-field-source-info.mutation.d.ts +0 -3
- package/lib/types/commands/mutations/update-pivot-table-source.mutation.d.ts +0 -3
- package/lib/types/commands/mutations/update-value-position.mutation.d.ts +0 -3
- package/lib/types/commands/operations/pivot-table-dirty-view.operation.d.ts +0 -3
- package/lib/types/common/const.d.ts +0 -64
- package/lib/types/const/const.d.ts +0 -99
- package/lib/types/const/template.d.ts +0 -885
- package/lib/types/const/type.d.ts +0 -522
- package/lib/types/controllers/config.schema.d.ts +0 -6
- package/lib/types/controllers/const.d.ts +0 -1
- package/lib/types/controllers/sheets-pivot-caculate.controller.d.ts +0 -44
- package/lib/types/controllers/sheets-pivot-rpc.controller.d.ts +0 -20
- package/lib/types/locale/en-US.d.ts +0 -3
- package/lib/types/locale/fa-IR.d.ts +0 -3
- package/lib/types/locale/ru-RU.d.ts +0 -3
- package/lib/types/locale/vi-VN.d.ts +0 -3
- package/lib/types/locale/zh-CN.d.ts +0 -31
- package/lib/types/locale/zh-TW.d.ts +0 -3
- package/lib/types/models/sheets-pivot-config-model.d.ts +0 -58
- package/lib/types/models/sheets-pivot-data-field-manager.d.ts +0 -77
- package/lib/types/models/sheets-pivot-data-source-model.d.ts +0 -101
- package/lib/types/models/sheets-pivot-table-adaptor-model.d.ts +0 -54
- package/lib/types/models/view-util.d.ts +0 -16
- package/lib/types/plugin.d.ts +0 -17
- package/lib/types/services/sheets-pivot-rpc.service.d.ts +0 -11
- package/lib/types/services/sheets-pivot-table.service.d.ts +0 -10
- package/lib/types/util.d.ts +0 -52
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Nullable, ObjectMatrix, Disposable, ICommandService, Injector, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
-
import { IFieldsCollectionJSON } from '@univerjs-pro/engine-pivot';
|
|
3
|
-
import { IDataFieldManagerJSON, IPivotCellPositionInfo, IPivotRangesInfo, IPivotTableCellData, IPivotTableConfig, IPivotTableMatrixInfo, IPivotTableRangeInfo } from '../const/type';
|
|
4
|
-
export declare class SheetsPivotTableConfigModel extends Disposable {
|
|
5
|
-
private _injector;
|
|
6
|
-
private _commandService;
|
|
7
|
-
private _univerInstanceService;
|
|
8
|
-
private _model;
|
|
9
|
-
private _collectionConfigModel;
|
|
10
|
-
private _pivotTableRangeInfo;
|
|
11
|
-
private _pivotTableMatrixInfo;
|
|
12
|
-
private _configVersion$;
|
|
13
|
-
private _pivotInitCompleted$;
|
|
14
|
-
pivotInitCompleted$: import('rxjs').Observable<boolean>;
|
|
15
|
-
private _pivotConfigChange$;
|
|
16
|
-
pivotConfigChange$: import('rxjs').Observable<{
|
|
17
|
-
unitId: string;
|
|
18
|
-
subUnitId: string;
|
|
19
|
-
pivotTableId: string;
|
|
20
|
-
pivotTableConfig: Nullable<IPivotTableConfig>;
|
|
21
|
-
}>;
|
|
22
|
-
private _textInfo;
|
|
23
|
-
configVersion$: import('rxjs').Observable<number>;
|
|
24
|
-
constructor(_injector: Injector, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService);
|
|
25
|
-
private _initUnitDisposed;
|
|
26
|
-
setPivotInitCompleted(): void;
|
|
27
|
-
private _initLocale;
|
|
28
|
-
getTextInfo(): Record<string, string>;
|
|
29
|
-
updateViewInfo(unitId: string, subUnitId: string, pivotTableId: string, valueMatrix: ObjectMatrix<Nullable<IPivotTableCellData>>, rangesCache: IPivotRangesInfo | undefined): void;
|
|
30
|
-
getPivotTableConfig(unitId: string, subUnitId: string, pivotTableId: string): Nullable<IPivotTableConfig>;
|
|
31
|
-
getTargetByPivotId(unitId: string, subUnitId: string, pivotTableId: string): Nullable<IPivotCellPositionInfo>;
|
|
32
|
-
getSubUnitPivotConfigs(unitId: string, subUnitId: string): Map<string, IPivotTableConfig> | undefined;
|
|
33
|
-
updateConfigCache(unitId: string, subUnitId: string, pivotTableId: string, pivotTableConfig: Nullable<IPivotTableConfig>): void;
|
|
34
|
-
getCollection(unitId: string, pivotTableId: string): IFieldsCollectionJSON | undefined;
|
|
35
|
-
updateCollectionConfig(unitId: string, collectionConfig: IDataFieldManagerJSON): void;
|
|
36
|
-
private _ensurePivotMap;
|
|
37
|
-
private _ensurePivotTableRangeInfo;
|
|
38
|
-
private _ensurePivotTableMatrixInfo;
|
|
39
|
-
updatePivotTableRangeInfo(unitId: string, subUnitId: string, pivotTableId: string, rangeInfo: IPivotRangesInfo | undefined): void;
|
|
40
|
-
updatePivotTableMatrixInfo(unitId: string, subUnitId: string, pivotTableId: string, matrixInfo: ObjectMatrix<Nullable<IPivotTableCellData>>): void;
|
|
41
|
-
/**
|
|
42
|
-
* - get the pivot table range info for sheet or calc engine
|
|
43
|
-
* @param {string} unitId - the unit id
|
|
44
|
-
* @param {string} subUnitId - the sub unit id
|
|
45
|
-
* @param {string} pivotTableId - the pivot table id
|
|
46
|
-
* @returns {IPivotTableRangeInfo} - the pivot table range info
|
|
47
|
-
*/
|
|
48
|
-
getPivotTableRangeInfo(unitId: string, subUnitId: string, pivotTableId: string): IPivotTableRangeInfo | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* - get the pivot table matrix info for sheet or calc engine
|
|
51
|
-
* @param {string} unitId - the unit id
|
|
52
|
-
* @param {string} subUnitId - the sub unit id
|
|
53
|
-
* @param {string} pivotTableId - the pivot table id
|
|
54
|
-
* @returns {IPivotTableMatrixInfo} - the pivot table matrix info
|
|
55
|
-
*/
|
|
56
|
-
getPivotTableMatrixInfo(unitId: string, subUnitId: string, pivotTableId: string): IPivotTableMatrixInfo | undefined;
|
|
57
|
-
deleteUnitId(unitId: string): void;
|
|
58
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { ICellData, IRange, IUnitRangeName, IUniverInstanceService, Nullable, ObjectMatrix, Styles, Worksheet } from '@univerjs/core';
|
|
2
|
-
import { IDataFieldValue, IFieldsCollectionJSON, PivotSubtotalTypeEnum, DataField, DataFieldManager, FieldsCollection } from '@univerjs-pro/engine-pivot';
|
|
3
|
-
import { IRuntimeUnitDataType } from '@univerjs/engine-formula';
|
|
4
|
-
import { ICurrentDataMatrix, IDataFieldManagerJSON, IPivotCellPositionInfo, IUnitRangeNameWithSubUnitId, IUpdateInfo } from '../const/type';
|
|
5
|
-
import { SheetsPivotDataSourceModel } from './sheets-pivot-data-source-model';
|
|
6
|
-
interface IFeatureDirtyRangeType {
|
|
7
|
-
[unitId: string]: Nullable<{
|
|
8
|
-
[sheetId: string]: IRange[];
|
|
9
|
-
}>;
|
|
10
|
-
}
|
|
11
|
-
export declare class SheetsPivotDataFieldManager extends DataFieldManager {
|
|
12
|
-
/**
|
|
13
|
-
* the key is pivot table id, the value is the data range info. those data range is one-to-one with the pivot table
|
|
14
|
-
*/
|
|
15
|
-
rangeKeyMap: Record<string, string>;
|
|
16
|
-
private _univerInstanceService;
|
|
17
|
-
_host: SheetsPivotDataSourceModel;
|
|
18
|
-
constructor(host: SheetsPivotDataSourceModel, univerInstanceService: IUniverInstanceService);
|
|
19
|
-
initDataRanges(): void;
|
|
20
|
-
getAutoDisplayNameFunction(): (baseName: string, subtotalType: PivotSubtotalTypeEnum) => string;
|
|
21
|
-
deleteDataField(dataFieldId: string): void;
|
|
22
|
-
removeCollectionImp(token: string): void;
|
|
23
|
-
getRangeKey(rangeInfo: IUnitRangeName, colIndex: number): string;
|
|
24
|
-
getDataFieldByRangeKey(rangeKey: string): DataField | undefined;
|
|
25
|
-
setRangeKeyMap(rangeKey: string, dataFieldId: string): void;
|
|
26
|
-
updateRangeKeyMap(oldRangeKey: string, newRangeKey: string): void;
|
|
27
|
-
addCollectionByJSON(token: string, collectionJSON: IFieldsCollectionJSON, sourceRangeInfo: IUnitRangeNameWithSubUnitId, targetCellInfo: IPivotCellPositionInfo): IUpdateInfo;
|
|
28
|
-
getRangeStartEndInfo(range: IRange, sheet: Worksheet): IRange;
|
|
29
|
-
/**
|
|
30
|
-
* - when add pivot table, we should create a collection with data range first
|
|
31
|
-
* @param {IUnitRangeName} dataRangeInfo the data range info
|
|
32
|
-
* @returns {FieldsCollection} the created collection
|
|
33
|
-
*/
|
|
34
|
-
createCollectionWithDataRange(dataRangeInfo: IUnitRangeName): IUpdateInfo;
|
|
35
|
-
_getAutoName(colIndex: number): string;
|
|
36
|
-
uniqueDataFieldName(name: IDataFieldValue, colIndex: number): string;
|
|
37
|
-
getCollection(token: string): FieldsCollection;
|
|
38
|
-
addCollection(token: string, collection: FieldsCollection, sourceRangeInfo: IUnitRangeNameWithSubUnitId, targetCellInfo: IPivotCellPositionInfo): void;
|
|
39
|
-
handleMoveRange(token: string, sourceRangeInfo: IUnitRangeNameWithSubUnitId): void;
|
|
40
|
-
getPivotDirtyViewInfo(): {
|
|
41
|
-
runtimeCellData: IRuntimeUnitDataType;
|
|
42
|
-
dirtyRanges: IFeatureDirtyRangeType;
|
|
43
|
-
};
|
|
44
|
-
getUpdateRangeDeleteIds(token: string, dataRangeInfo: IUnitRangeName): string[] | undefined;
|
|
45
|
-
/**
|
|
46
|
-
* get the matrix value from different matrix, when refresh the data source of pivot table
|
|
47
|
-
* @param matrix the sheet cell matrix
|
|
48
|
-
* @param arrayFormulaCellDataMatrix the array formula cell data matrix from run time data
|
|
49
|
-
* @param unitDataMatrix the unit data matrix from runtime data
|
|
50
|
-
* @param {number} rowIndex - the row index
|
|
51
|
-
* @param {number} colIndex - the column index
|
|
52
|
-
* @returns {Nullable<ICellData>} the cell data
|
|
53
|
-
*/
|
|
54
|
-
getMatrixValue(matrix: ObjectMatrix<Nullable<ICellData>>, arrayFormulaCellDataMatrix: ObjectMatrix<Nullable<ICellData>> | undefined, unitDataMatrix: ObjectMatrix<Nullable<ICellData>> | undefined, rowIndex: number, colIndex: number): Nullable<ICellData>;
|
|
55
|
-
refreshDataField(dataFieldId: string, dataRangeInfo: IUnitRangeNameWithSubUnitId, index: number, currentDataMatrix?: ICurrentDataMatrix): void;
|
|
56
|
-
refreshData(collection: FieldsCollection, list: {
|
|
57
|
-
index: number;
|
|
58
|
-
dataField: DataField;
|
|
59
|
-
}[], dataRangeInfo: IUnitRangeNameWithSubUnitId): void;
|
|
60
|
-
getRangeKeyList(dataRangeInfo: IUnitRangeName): string[];
|
|
61
|
-
/**
|
|
62
|
-
* - adjust sheet cell value to the type that pivot engine can recognize
|
|
63
|
-
* @param {Nullable<ICellData>} cellData the cell data
|
|
64
|
-
* @param {Styles} styles styles in the workbook
|
|
65
|
-
* @param {Record<string, any>} patternInfoRecord the pattern info record
|
|
66
|
-
* @returns {IDataFieldValue} the value to add into the data field
|
|
67
|
-
*/
|
|
68
|
-
adjustSheetCellData(cellData: Nullable<ICellData>, styles: Styles, patternInfoRecord: Record<string, any>): IDataFieldValue;
|
|
69
|
-
getRangeData(dataRangeInfo: IUnitRangeName): {
|
|
70
|
-
header: (string | null)[];
|
|
71
|
-
data: IDataFieldValue[][];
|
|
72
|
-
};
|
|
73
|
-
toJSON(): IDataFieldManagerJSON;
|
|
74
|
-
fromJSON(jsonData: IDataFieldManagerJSON): void;
|
|
75
|
-
dispose(): void;
|
|
76
|
-
}
|
|
77
|
-
export {};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { IUnitRangeName, Nullable, Disposable, ICommandService, IConfigService, Injector, IResourceManagerService, IUniverInstanceService, LifecycleService } from '@univerjs/core';
|
|
2
|
-
import { IMoveRangeMutationParams } from '@univerjs/sheets';
|
|
3
|
-
import { DataField, FieldsCollection, IFieldsCollectionJSON, IPivotTableSnapshot, PivotView, PivotTable } from '@univerjs-pro/engine-pivot';
|
|
4
|
-
import { ICollectionChangeInfo, IDataFieldManagerJSON, IPivotCellPositionInfo, IPivotMutationDirtyViewInfo, IPivotTableConfig, IPivotTableJson, IPivotWorkerItemCache, ISendPivotConfigLocalMutationParams, IUnitRangeNameWithSubUnitId, IUpdateInfo, PivotTableOperationEnum } from '../const/type';
|
|
5
|
-
import { IViewTranslateCtx } from './view-util';
|
|
6
|
-
import { SheetsPivotDataFieldManager } from './sheets-pivot-data-field-manager';
|
|
7
|
-
export declare class SheetsPivotDataSourceModel extends Disposable {
|
|
8
|
-
private readonly _injector;
|
|
9
|
-
private readonly _univerInstanceService;
|
|
10
|
-
readonly _lifecycleService: LifecycleService;
|
|
11
|
-
private readonly _configService;
|
|
12
|
-
private readonly _commandService;
|
|
13
|
-
private _resourceManagerService;
|
|
14
|
-
private _model;
|
|
15
|
-
private _pivotTableInstanceCache;
|
|
16
|
-
private _viewData;
|
|
17
|
-
private _textInfo;
|
|
18
|
-
private _collectionChange$;
|
|
19
|
-
collectionChange$: import('rxjs').Observable<ICollectionChangeInfo>;
|
|
20
|
-
private _viewData$;
|
|
21
|
-
viewData$: import('rxjs').Observable<{
|
|
22
|
-
unitId: string;
|
|
23
|
-
subUnitId: string;
|
|
24
|
-
pivotTableId: string;
|
|
25
|
-
}>;
|
|
26
|
-
private _fieldsCollectionChange$;
|
|
27
|
-
fieldsCollectionChange$: import('rxjs').Observable<Record<string, FieldsCollection>>;
|
|
28
|
-
private _dataFieldManagerCollection;
|
|
29
|
-
needSameDeleteModel: {
|
|
30
|
-
deleteUnitId: (unitId: string) => void;
|
|
31
|
-
}[];
|
|
32
|
-
/**
|
|
33
|
-
* - this property is used to store the dirty pivot table collection which need to be marked dirty when mutations is executed
|
|
34
|
-
*/
|
|
35
|
-
private _queryingMap;
|
|
36
|
-
constructor(_injector: Injector, _univerInstanceService: IUniverInstanceService, _lifecycleService: LifecycleService, _configService: IConfigService, _commandService: ICommandService, _resourceManagerService: IResourceManagerService);
|
|
37
|
-
getTextInfo(): Record<string, string>;
|
|
38
|
-
setTextInfo(textInfo: Record<string, string>): void;
|
|
39
|
-
handleMoveRange(params: IMoveRangeMutationParams): void;
|
|
40
|
-
broadcastCollectionChange(info: ICollectionChangeInfo): void;
|
|
41
|
-
getDataFieldManager(unitId: string): SheetsPivotDataFieldManager;
|
|
42
|
-
getCollection(unitId: string, token: string): FieldsCollection;
|
|
43
|
-
getUpdateRangeDeleteIds(unitId: string, token: string, dataRangeInfo: IUnitRangeName): string[] | undefined;
|
|
44
|
-
private _ensurePivotMap;
|
|
45
|
-
private _updateModelCache;
|
|
46
|
-
private _deleteModelCache;
|
|
47
|
-
private _updatePivotTableInstanceCache;
|
|
48
|
-
private _deletePivotTableInstanceCache;
|
|
49
|
-
private _ensureViewDataMap;
|
|
50
|
-
updateConfig(info: ISendPivotConfigLocalMutationParams): void;
|
|
51
|
-
updateView(unitId: string, subUnitId: string, type: PivotTableOperationEnum, pivotTableId: string, view: Nullable<PivotView>, pivotConfig: Nullable<IPivotTableConfig>, collectionConfig?: IDataFieldManagerJSON, ignoreDirty?: boolean): void;
|
|
52
|
-
/**
|
|
53
|
-
* - the function is used to save the dirty view data and range for formula calculation
|
|
54
|
-
* @param {IViewTranslateCtx} ctx the dirty context
|
|
55
|
-
* @param {boolean} ignoreDirty 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
|
|
56
|
-
*/
|
|
57
|
-
updateViewData(ctx: IViewTranslateCtx, ignoreDirty: boolean): void;
|
|
58
|
-
addPivotTable(unitId: string, subUnitId: string, pivotTableId: string, pivotTable: PivotTable, pivotTableConfig: IPivotTableConfig): void;
|
|
59
|
-
removePivotTable(unitId: string, subUnitId: string, pivotTableId: string): void;
|
|
60
|
-
setPivotTable(unitId: string, subUnitId: string, pivotTableId: string, pivotTableConfig: IPivotTableConfig): void;
|
|
61
|
-
getPivotTableConfig(unitId: string, subUnitId: string, pivotTableId: string): IPivotTableConfig | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* - get the pivot table model json config
|
|
64
|
-
* @param {string} unitId
|
|
65
|
-
* @param {string} subUnitId
|
|
66
|
-
* @param {string} pivotTableId - the pivot table id
|
|
67
|
-
* @returns {IPivotTableSnapshot|undefined} the pivot table model json config
|
|
68
|
-
*/
|
|
69
|
-
getPivotTableModelConfig(unitId: string, subUnitId: string, pivotTableId: string): IPivotTableSnapshot | undefined;
|
|
70
|
-
getPivotTableInstance(pivotTableId: string): PivotTable | undefined;
|
|
71
|
-
deleteUnitId(unitId: string): void;
|
|
72
|
-
addCollectionByJSON(token: string, collectionJSON: IFieldsCollectionJSON, sourceRangeInfo: IUnitRangeNameWithSubUnitId, targetCellInfo: IPivotCellPositionInfo): IUpdateInfo;
|
|
73
|
-
/**
|
|
74
|
-
* - this function just create a collection with data range info, but wil not add it to the dataFieldManager
|
|
75
|
-
*/
|
|
76
|
-
createCollectionWithDataRange(dataRangeInfo: IUnitRangeNameWithSubUnitId): IUpdateInfo;
|
|
77
|
-
refreshData(collection: FieldsCollection, updateDataFieldList: {
|
|
78
|
-
index: number;
|
|
79
|
-
dataField: DataField;
|
|
80
|
-
}[], dataRangeInfo: IUnitRangeNameWithSubUnitId): void;
|
|
81
|
-
removeDataField(unitId: string, dataFieldId: string): void;
|
|
82
|
-
removeCollections(unitId: string, token: string): void;
|
|
83
|
-
getSubUnitPivotConfigs(unitId: string, subUnitId: string): Map<string, IPivotTableConfig> | undefined;
|
|
84
|
-
getTargetByPivotId(pivotTableId: string): {
|
|
85
|
-
unitId: string;
|
|
86
|
-
subUnitId: string;
|
|
87
|
-
} | null;
|
|
88
|
-
sideEffectUpdateWorkerCache(unitId: string, subUnitId: string, pivotTableId: string, workerCache?: IPivotWorkerItemCache): void;
|
|
89
|
-
dispose(): void;
|
|
90
|
-
getViewData(unitId: string, subUnitId: string, pivotTableId: string): IPivotWorkerItemCache | null;
|
|
91
|
-
addDirtyPivotTable(dirtyInfo: IPivotMutationDirtyViewInfo): void;
|
|
92
|
-
updateDirtyPivotTable(dirtyInfo: IPivotMutationDirtyViewInfo): void;
|
|
93
|
-
/**
|
|
94
|
-
* trigger the pivot table query
|
|
95
|
-
* @param dirtyInfo
|
|
96
|
-
*/
|
|
97
|
-
queryDirtyPivotTable(dirtyInfo: IPivotMutationDirtyViewInfo): void;
|
|
98
|
-
toJSON(unitId: string): IPivotTableJson;
|
|
99
|
-
fromJSON(jsonData: IPivotTableJson): void;
|
|
100
|
-
private _initSnapshot;
|
|
101
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { IRange, Nullable, Disposable, Injector, IUniverInstanceService, LocaleService, ObjectMatrix } from '@univerjs/core';
|
|
2
|
-
import { IPivotRangesInfo, IPivotRenderCache, IPivotTableCellData, IPivotTableConfigChangeInfo, PivotTableOperationEnum } from '../const/type';
|
|
3
|
-
import { IExclusiveRangeService } from '@univerjs/sheets';
|
|
4
|
-
import { SheetsPivotTableConfigModel } from './sheets-pivot-config-model';
|
|
5
|
-
export declare class SheetsPivotTableAdaptorModel extends Disposable {
|
|
6
|
-
private _localeService;
|
|
7
|
-
private _injector;
|
|
8
|
-
private _sheetsPivotTableConfigModel;
|
|
9
|
-
private _univerInstanceService;
|
|
10
|
-
private readonly _exclusiveRangeService;
|
|
11
|
-
private _pivotRenderInfoCache;
|
|
12
|
-
private _pivotRenderValueMatrixCache;
|
|
13
|
-
private _markDirty$;
|
|
14
|
-
markDirty$: import('rxjs').Observable<{
|
|
15
|
-
unitId: string;
|
|
16
|
-
subUnitId: string;
|
|
17
|
-
}>;
|
|
18
|
-
private _viewUpdate$;
|
|
19
|
-
viewUpdate$: import('rxjs').Observable<{
|
|
20
|
-
unitId: string;
|
|
21
|
-
subUnitId: string;
|
|
22
|
-
pivotTableId: string;
|
|
23
|
-
rangesCache: IPivotRangesInfo | undefined;
|
|
24
|
-
valueMatrix: ObjectMatrix<Nullable<IPivotTableCellData>>;
|
|
25
|
-
type: PivotTableOperationEnum;
|
|
26
|
-
}>;
|
|
27
|
-
private _textInfo;
|
|
28
|
-
constructor(_localeService: LocaleService, _injector: Injector, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _univerInstanceService: IUniverInstanceService, _exclusiveRangeService: IExclusiveRangeService);
|
|
29
|
-
private _initUnitDisposed;
|
|
30
|
-
private _initLocale;
|
|
31
|
-
updateRenderCache(config: IPivotTableConfigChangeInfo): {
|
|
32
|
-
rangeCache: IPivotRangesInfo | undefined;
|
|
33
|
-
matrix: ObjectMatrix<Nullable<IPivotTableCellData>>;
|
|
34
|
-
} | undefined;
|
|
35
|
-
private _updateRenderEmptyCache;
|
|
36
|
-
private _createExclusiveRange;
|
|
37
|
-
clearRenderCache(config: IPivotTableConfigChangeInfo): void;
|
|
38
|
-
private _ensurePivotItemRenderInfoCache;
|
|
39
|
-
private _ensurePivotItemRenderValueMatrixCache;
|
|
40
|
-
getPivotTableCellData(unitId: string, subUnitId: string, row: number, col: number): IPivotTableCellData | undefined;
|
|
41
|
-
getPivotTableIdByCell(unitId: string, subUnitId: string, row: number, col: number): Nullable<string>;
|
|
42
|
-
/**
|
|
43
|
-
* Get pivot table ids that intersect with the range
|
|
44
|
-
* @param {string} unitId The test unit id of range
|
|
45
|
-
* @param {string} subUnitId The sub unit id of range
|
|
46
|
-
* @param {IRange} range The range to check
|
|
47
|
-
* @returns {string[]} The pivot table ids that intersect with the range
|
|
48
|
-
*/
|
|
49
|
-
getIntersectsPivotTable(unitId: string, subUnitId: string, range: IRange): string[];
|
|
50
|
-
getSubUnitPivotMatrix(unitId: string, subUnitId: string): ObjectMatrix<Nullable<IPivotTableCellData>>;
|
|
51
|
-
getPivotItemRenderInfoCache(unitId: string, subUnitId: string, pivotTableId: string): Nullable<IPivotRenderCache>;
|
|
52
|
-
deleteUnitId(unitId: string): void;
|
|
53
|
-
markDirty(unitId: string, subUnitId: string): void;
|
|
54
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { PivotView } from '@univerjs-pro/engine-pivot';
|
|
2
|
-
import { Nullable, ObjectMatrix } from '@univerjs/core';
|
|
3
|
-
import { IPivotCellPositionInfo, IPivotRangesInfo, IPivotTableCellData } from '../const/type';
|
|
4
|
-
export interface IViewTranslateCtx {
|
|
5
|
-
view: Nullable<PivotView>;
|
|
6
|
-
pivotTableId: string;
|
|
7
|
-
isEmpty: boolean;
|
|
8
|
-
targetCellInfo: IPivotCellPositionInfo;
|
|
9
|
-
textInfo: Record<string, string>;
|
|
10
|
-
}
|
|
11
|
-
interface IViewTranslateResult {
|
|
12
|
-
matrix: ObjectMatrix<Nullable<IPivotTableCellData>>;
|
|
13
|
-
rangesCache: IPivotRangesInfo;
|
|
14
|
-
}
|
|
15
|
-
export declare const adjustViewForCalcEngine: (ctx: IViewTranslateCtx) => IViewTranslateResult;
|
|
16
|
-
export {};
|
package/lib/types/plugin.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IUniverSheetsPivotConfig } from './controllers/config.schema';
|
|
2
|
-
import { ICommandService, IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
3
|
-
import { DataSyncPrimaryController } from '@univerjs/rpc';
|
|
4
|
-
export declare class UniverSheetsPivotTablePlugin extends Plugin {
|
|
5
|
-
private readonly _config;
|
|
6
|
-
readonly _injector: Injector;
|
|
7
|
-
private readonly _commandService;
|
|
8
|
-
private readonly _configService;
|
|
9
|
-
private readonly _dataSyncPrimaryController?;
|
|
10
|
-
static pluginName: string;
|
|
11
|
-
static type: UniverInstanceType;
|
|
12
|
-
constructor(_config: IUniverSheetsPivotConfig | undefined, _injector: Injector, _commandService: ICommandService, _configService: IConfigService, _dataSyncPrimaryController?: DataSyncPrimaryController | undefined);
|
|
13
|
-
_initConfig(): void;
|
|
14
|
-
onStarting(): void;
|
|
15
|
-
private _initRegisterCommand;
|
|
16
|
-
private _initTimeValid;
|
|
17
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Disposable, ICommandService, Injector } from '@univerjs/core';
|
|
2
|
-
import { IGetPivotDataLocalMutationParams, ISendPivotDataLocalMutationParams } from '../const/type';
|
|
3
|
-
export declare class SheetsPivotRPCService extends Disposable {
|
|
4
|
-
private readonly _injector;
|
|
5
|
-
private readonly _commandService;
|
|
6
|
-
private _requestResolvers;
|
|
7
|
-
constructor(_injector: Injector, _commandService: ICommandService);
|
|
8
|
-
handleAsyncResponse(data: ISendPivotDataLocalMutationParams): void;
|
|
9
|
-
getPivotDisplayConfig(params: Omit<IGetPivotDataLocalMutationParams, 'version'>): Promise<ISendPivotDataLocalMutationParams>;
|
|
10
|
-
private _generateUniqueVersion;
|
|
11
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Disposable } from '@univerjs/core';
|
|
2
|
-
import { SheetInterceptorService } from '@univerjs/sheets';
|
|
3
|
-
import { SheetsPivotTableAdaptorModel } from '../models/sheets-pivot-table-adaptor-model';
|
|
4
|
-
export declare class SheetsPivotTableService extends Disposable {
|
|
5
|
-
private _sheetInterceptorService;
|
|
6
|
-
private _sheetsPivotTableAdaptorModel;
|
|
7
|
-
constructor(_sheetInterceptorService: SheetInterceptorService, _sheetsPivotTableAdaptorModel: SheetsPivotTableAdaptorModel);
|
|
8
|
-
private _init;
|
|
9
|
-
private _initViewModelBySheetInterceptor;
|
|
10
|
-
}
|
package/lib/types/util.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Injector, IRange, Nullable, ObjectMatrix } from '@univerjs/core';
|
|
2
|
-
import { ILabelViewHeaderMapItem, IPivotViewInfo, PivotTable, PivotSubtotalTypeEnum } from '@univerjs-pro/engine-pivot';
|
|
3
|
-
import { IGetPivotDataLocalMutationParams, IPivotPanelDataInfo, IPivotRangesInfo, IPivotRenderCache, IPivotTableCellData, IPivotTableConfig } from './const/type';
|
|
4
|
-
import { SheetsPivotDataSourceModel } from './models/sheets-pivot-data-source-model';
|
|
5
|
-
export declare const generateDefaultEmptyCache: (textOptions: {
|
|
6
|
-
filter: string;
|
|
7
|
-
row: string;
|
|
8
|
-
column: string;
|
|
9
|
-
values: string;
|
|
10
|
-
}, startCell: {
|
|
11
|
-
row: number;
|
|
12
|
-
col: number;
|
|
13
|
-
}) => {
|
|
14
|
-
matrixCache: ObjectMatrix<IPivotTableCellData>;
|
|
15
|
-
rangesCache: IPivotRangesInfo;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* - Get the auto display name of the value field.
|
|
19
|
-
* @description - which may use prefix text like excel
|
|
20
|
-
* - the prefix text is create by subtotal type
|
|
21
|
-
* @param {string} baseName the name without prefix text
|
|
22
|
-
* @param {PivotSubtotalTypeEnum} subtotalType the type of subtotal to be displayed for this value field.
|
|
23
|
-
* @returns {string} the auto display name of the value field.
|
|
24
|
-
*/
|
|
25
|
-
export declare function getAutoDisplayName(this: SheetsPivotDataSourceModel, baseName: string, subtotalType: PivotSubtotalTypeEnum): string;
|
|
26
|
-
export declare function getPivotCellInfo(row: number, col: number, cellInfo: Nullable<IPivotTableCellData>, pivotTable: PivotTable, pivotItemRenderCache: IPivotRenderCache): {
|
|
27
|
-
filterId: Nullable<string>;
|
|
28
|
-
info: Nullable<IPivotViewInfo>;
|
|
29
|
-
data: Nullable<IPivotTableCellData>;
|
|
30
|
-
headerInfo: Nullable<ILabelViewHeaderMapItem>;
|
|
31
|
-
} | undefined;
|
|
32
|
-
export declare function getPivotTableInfo(pivotTable: PivotTable, pivotTableId: string, config: IPivotTableConfig): IPivotPanelDataInfo;
|
|
33
|
-
export declare function flattenObject(inject: Injector, obj: {
|
|
34
|
-
[key: string]: any;
|
|
35
|
-
}, parentKey?: string, result?: {
|
|
36
|
-
[key: string]: any;
|
|
37
|
-
}): {
|
|
38
|
-
[key: string]: any;
|
|
39
|
-
};
|
|
40
|
-
export declare const unionPivotViewRange: (rangeInfo: IPivotRangesInfo | undefined) => IRange[];
|
|
41
|
-
export declare function getPivotDrillDownData(injector: Injector, params: IGetPivotDataLocalMutationParams): {
|
|
42
|
-
indexes: number[];
|
|
43
|
-
range: IRange;
|
|
44
|
-
sourceUnitId: string;
|
|
45
|
-
sourceSubUnitId: string;
|
|
46
|
-
formatMap: Record<string, string>;
|
|
47
|
-
} | undefined;
|
|
48
|
-
export declare function canUsePivot(ls?: string, pbk?: string): boolean;
|
|
49
|
-
export declare function getPivotInfoByLicense(defaultPivotCount: number, ls?: string, pbk?: string): {
|
|
50
|
-
count: number;
|
|
51
|
-
timeValid: boolean;
|
|
52
|
-
};
|