@univerjs-pro/sheets-pivot 0.5.0-alpha.0 → 0.5.0-beta.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.
Files changed (89) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +1 -1
  3. package/lib/cjs/locale/en-US.js +1 -1
  4. package/lib/cjs/locale/fa-IR.js +1 -1
  5. package/lib/cjs/locale/ru-RU.js +1 -1
  6. package/lib/cjs/locale/vi-VN.js +1 -1
  7. package/lib/cjs/locale/zh-CN.js +1 -1
  8. package/lib/cjs/locale/zh-TW.js +1 -1
  9. package/lib/es/facade.js +1 -1
  10. package/lib/es/index.js +1 -1
  11. package/lib/es/locale/en-US.js +1 -1
  12. package/lib/es/locale/fa-IR.js +1 -1
  13. package/lib/es/locale/ru-RU.js +1 -1
  14. package/lib/es/locale/vi-VN.js +1 -1
  15. package/lib/es/locale/zh-CN.js +1 -1
  16. package/lib/es/locale/zh-TW.js +1 -1
  17. package/lib/types/commands/command/add-pivot-field.command.d.ts +11 -0
  18. package/lib/types/commands/command/add-pivot-table-with-config.command.d.ts +3 -0
  19. package/lib/types/commands/command/add-pivot-table.command.d.ts +9 -0
  20. package/lib/types/commands/command/move-pivot-field.command.d.ts +11 -0
  21. package/lib/types/commands/command/pivot-drill-down.command.d.ts +6 -0
  22. package/lib/types/commands/command/remove-pivot-field.command.d.ts +8 -0
  23. package/lib/types/commands/command/set-pivot-collapse.command.d.ts +9 -0
  24. package/lib/types/commands/command/set-pivot-filter.command.d.ts +10 -0
  25. package/lib/types/commands/command/set-pivot-sort.command.d.ts +10 -0
  26. package/lib/types/commands/command/update-pivot-setting.command.d.ts +15 -0
  27. package/lib/types/commands/command/update-pivot-source.command.d.ts +9 -0
  28. package/lib/types/commands/command/update-value-position.command.d.ts +8 -0
  29. package/lib/types/commands/command/util.d.ts +14 -0
  30. package/lib/types/commands/mutations/add-pivot-field.mutation.d.ts +3 -0
  31. package/lib/types/commands/mutations/add-pivot-table.mutation.d.ts +3 -0
  32. package/lib/types/commands/mutations/change-apply-util.d.ts +15 -0
  33. package/lib/types/commands/mutations/pivot-data-communication.mutation.d.ts +7 -0
  34. package/lib/types/commands/mutations/remove-pivot-field.mutation.d.ts +3 -0
  35. package/lib/types/commands/mutations/remove-pivot-table.mutation.d.ts +3 -0
  36. package/lib/types/commands/mutations/rename-pivot-field.mutation.d.ts +3 -0
  37. package/lib/types/commands/mutations/set-pivot-collapse.mutation.d.ts +3 -0
  38. package/lib/types/commands/mutations/set-pivot-field-format.mutation.d.ts +3 -0
  39. package/lib/types/commands/mutations/set-pivot-filter.mutation.d.ts +3 -0
  40. package/lib/types/commands/mutations/set-pivot-option.mutation.d.ts +3 -0
  41. package/lib/types/commands/mutations/set-pivot-position.mutation.d.ts +3 -0
  42. package/lib/types/commands/mutations/set-pivot-sort.mutation.d.ts +3 -0
  43. package/lib/types/commands/mutations/set-pivot-subtotal-type.mutation.d.ts +3 -0
  44. package/lib/types/commands/mutations/update-field-position.mutation.d.ts +3 -0
  45. package/lib/types/commands/mutations/update-pivot-field-source-info.mutation.d.ts +3 -0
  46. package/lib/types/commands/mutations/update-pivot-table-source.mutation.d.ts +3 -0
  47. package/lib/types/commands/mutations/update-value-position.mutation.d.ts +3 -0
  48. package/lib/types/commands/operations/pivot-table-dirty-view.operation.d.ts +3 -0
  49. package/lib/types/common/const.d.ts +64 -0
  50. package/lib/types/const/const.d.ts +107 -0
  51. package/lib/types/const/template.d.ts +885 -0
  52. package/lib/types/const/type.d.ts +525 -0
  53. package/lib/types/controllers/config.schema.d.ts +6 -0
  54. package/lib/types/controllers/const.d.ts +1 -0
  55. package/lib/types/controllers/sheets-pivot-caculate.controller.d.ts +44 -0
  56. package/lib/types/controllers/sheets-pivot-clear.controller.d.ts +12 -0
  57. package/lib/types/controllers/sheets-pivot-interceptor.controller.d.ts +21 -0
  58. package/lib/types/controllers/sheets-pivot-permission.controller.d.ts +7 -0
  59. package/lib/types/controllers/sheets-pivot-ref-range.controller.d.ts +21 -0
  60. package/lib/types/controllers/sheets-pivot-remove-sheet.controller.d.ts +9 -0
  61. package/lib/types/controllers/sheets-pivot-rpc.controller.d.ts +20 -0
  62. package/lib/types/facade/f-pivot-table.d.ts +83 -0
  63. package/lib/types/facade/f-workbook.d.ts +72 -0
  64. package/lib/types/facade/index.d.ts +2 -0
  65. package/lib/types/index.d.ts +52 -1158
  66. package/lib/types/locale/en-US.d.ts +3 -0
  67. package/lib/types/locale/fa-IR.d.ts +3 -0
  68. package/lib/types/locale/ru-RU.d.ts +3 -0
  69. package/lib/types/locale/vi-VN.d.ts +3 -0
  70. package/lib/types/locale/zh-CN.d.ts +31 -0
  71. package/lib/types/locale/zh-TW.d.ts +3 -0
  72. package/lib/types/models/sheets-pivot-config-model.d.ts +58 -0
  73. package/lib/types/models/sheets-pivot-data-field-manager.d.ts +77 -0
  74. package/lib/types/models/sheets-pivot-data-source-model.d.ts +101 -0
  75. package/lib/types/models/sheets-pivot-table-adaptor-model.d.ts +54 -0
  76. package/lib/types/models/view-util.d.ts +16 -0
  77. package/lib/types/plugin.d.ts +17 -0
  78. package/lib/types/services/sheets-pivot-rpc.service.d.ts +11 -0
  79. package/lib/types/services/sheets-pivot-table.service.d.ts +18 -0
  80. package/lib/types/util.d.ts +84 -0
  81. package/lib/umd/facade.js +1 -1
  82. package/lib/umd/index.js +1 -1
  83. package/lib/umd/locale/en-US.js +1 -1
  84. package/lib/umd/locale/fa-IR.js +1 -1
  85. package/lib/umd/locale/ru-RU.js +1 -1
  86. package/lib/umd/locale/vi-VN.js +1 -1
  87. package/lib/umd/locale/zh-CN.js +1 -1
  88. package/lib/umd/locale/zh-TW.js +1 -1
  89. package/package.json +14 -14
@@ -0,0 +1,3 @@
1
+ import { default as zhCN } from './zh-CN';
2
+ declare const locale: typeof zhCN;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import { default as zhCN } from './zh-CN';
2
+ declare const locale: typeof zhCN;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import { default as zhCN } from './zh-CN';
2
+ declare const locale: typeof zhCN;
3
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import { default as zhCN } from './zh-CN';
2
+ declare const locale: typeof zhCN;
3
+ export default locale;
@@ -0,0 +1,31 @@
1
+ declare const locale: {
2
+ 'sheets-pivot': {
3
+ blankValue: string;
4
+ columnName: string;
5
+ subTotalText: string;
6
+ grandTotalText: string;
7
+ valueText: string;
8
+ averageName: string;
9
+ countName: string;
10
+ countNumsName: string;
11
+ maxName: string;
12
+ minName: string;
13
+ productName: string;
14
+ stdDevName: string;
15
+ stdDevpName: string;
16
+ sumName: string;
17
+ varName: string;
18
+ varpName: string;
19
+ subTotal: string;
20
+ grandTotal: string;
21
+ value: string;
22
+ blank: string;
23
+ emptyPivot: {
24
+ filter: string;
25
+ row: string;
26
+ column: string;
27
+ values: string;
28
+ };
29
+ };
30
+ };
31
+ export default locale;
@@ -0,0 +1,3 @@
1
+ import { default as zhCN } from './zh-CN';
2
+ declare const locale: typeof zhCN;
3
+ export default locale;
@@ -0,0 +1,58 @@
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
+ }
@@ -0,0 +1,77 @@
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 {};
@@ -0,0 +1,101 @@
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
+ }
@@ -0,0 +1,54 @@
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
+ }
@@ -0,0 +1,16 @@
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 {};
@@ -0,0 +1,17 @@
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
+ }
@@ -0,0 +1,11 @@
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
+ }
@@ -0,0 +1,18 @@
1
+ import { IPivotPerformCheckParams } from '../const/type';
2
+ import { AsyncInterceptorManager, Disposable, InterceptorManager } from '@univerjs/core';
3
+ import { SheetInterceptorService } from '@univerjs/sheets';
4
+ import { SheetsPivotTableAdaptorModel } from '../models/sheets-pivot-table-adaptor-model';
5
+ export declare class SheetsPivotTableService extends Disposable {
6
+ private _sheetInterceptorService;
7
+ private _sheetsPivotTableAdaptorModel;
8
+ readonly asyncInterceptor: AsyncInterceptorManager<{
9
+ PIVOT_PERFORM_CHECK: import('@univerjs/core/common/interceptor.js').IAsyncInterceptor<boolean, IPivotPerformCheckParams>;
10
+ }>;
11
+ readonly interceptor: InterceptorManager<{
12
+ PIVOT_MUTATION_GENERATE: import('@univerjs/core').IInterceptor<import('@univerjs/core').IUndoRedoCommandInfosByInterceptor, IPivotPerformCheckParams>;
13
+ }>;
14
+ constructor(_sheetInterceptorService: SheetInterceptorService, _sheetsPivotTableAdaptorModel: SheetsPivotTableAdaptorModel);
15
+ private _init;
16
+ getPivotPerformCheck(params: IPivotPerformCheckParams): Promise<import('@univerjs/core').Nullable<boolean>>;
17
+ private _initViewModelBySheetInterceptor;
18
+ }
@@ -0,0 +1,84 @@
1
+ import { IAccessor, IMutationInfo, Injector, IRange, Nullable, ObjectMatrix } from '@univerjs/core';
2
+ import { ISetRangeValuesMutationParams } from '@univerjs/sheets';
3
+ import { ILabelViewHeaderMapItem, IPivotViewInfo, LabelViewItem, PivotTable, PivotView, PivotViewItem, PivotSubtotalTypeEnum } from '@univerjs-pro/engine-pivot';
4
+ import { IGetPivotDataLocalMutationParams, IPivotCellPositionInfo, IPivotPanelDataInfo, IPivotRangesInfo, IPivotRenderCache, IPivotTableCellData, IPivotTableConfig } from './const/type';
5
+ import { SheetsPivotDataSourceModel } from './models/sheets-pivot-data-source-model';
6
+ export declare const generateDefaultEmptyCache: (textOptions: {
7
+ filter: string;
8
+ row: string;
9
+ column: string;
10
+ values: string;
11
+ }, startCell: {
12
+ row: number;
13
+ col: number;
14
+ }) => {
15
+ matrixCache: ObjectMatrix<IPivotTableCellData>;
16
+ rangesCache: IPivotRangesInfo;
17
+ };
18
+ /**
19
+ * - Get the auto display name of the value field.
20
+ * @description - which may use prefix text like excel
21
+ * - the prefix text is create by subtotal type
22
+ * @param {string} baseName the name without prefix text
23
+ * @param {PivotSubtotalTypeEnum} subtotalType the type of subtotal to be displayed for this value field.
24
+ * @returns {string} the auto display name of the value field.
25
+ */
26
+ export declare function getAutoDisplayName(this: SheetsPivotDataSourceModel, baseName: string, subtotalType: PivotSubtotalTypeEnum): string;
27
+ export declare function getPivotCellInfo(row: number, col: number, cellInfo: Nullable<IPivotTableCellData>, pivotTable: PivotTable, pivotItemRenderCache: IPivotRenderCache): {
28
+ filterId: Nullable<string>;
29
+ info: Nullable<IPivotViewInfo>;
30
+ data: Nullable<IPivotTableCellData>;
31
+ headerInfo: Nullable<ILabelViewHeaderMapItem>;
32
+ } | undefined;
33
+ export declare function getPivotTableInfo(pivotTable: PivotTable, pivotTableId: string, config: IPivotTableConfig): IPivotPanelDataInfo;
34
+ export declare function flattenObject(inject: Injector, obj: {
35
+ [key: string]: any;
36
+ }, parentKey?: string, result?: {
37
+ [key: string]: any;
38
+ }): {
39
+ [key: string]: any;
40
+ };
41
+ export declare const unionPivotViewRange: (rangeInfo: IPivotRangesInfo | undefined) => IRange[];
42
+ export declare function getPivotDrillDownData(injector: Injector, params: IGetPivotDataLocalMutationParams): {
43
+ indexes: number[];
44
+ range: IRange;
45
+ sourceUnitId: string;
46
+ sourceSubUnitId: string;
47
+ formatMap: Record<string, string>;
48
+ } | undefined;
49
+ export declare function canUsePivot(ls?: string, pbk?: string): boolean;
50
+ export declare function getPivotInfoByLicense(defaultPivotCount: number, ls?: string, pbk?: string): {
51
+ count: number;
52
+ timeValid: boolean;
53
+ };
54
+ export declare function generateSetRangeValueMutations(injector: Injector, unitId: string, subUnitId: string, ranges: IRange[]): {
55
+ setRangeValueUndoMutation: {
56
+ id: string;
57
+ params: ISetRangeValuesMutationParams;
58
+ };
59
+ setRangeValueRedoMutation: {
60
+ id: string;
61
+ params: ISetRangeValuesMutationParams;
62
+ };
63
+ shouldClear: boolean;
64
+ };
65
+ export declare function getEmptyPivotRanges(cellInfo: IPivotCellPositionInfo): {
66
+ startRow: number;
67
+ endRow: number;
68
+ startColumn: number;
69
+ endColumn: number;
70
+ }[];
71
+ export declare function getPivotRowColCount(view: PivotView, startCell: {
72
+ row: number;
73
+ col: number;
74
+ }, isEmpty: boolean): {
75
+ rowCount: number;
76
+ colCount: number;
77
+ };
78
+ export declare function getInsertRowColMutations(accessor: IAccessor, view: PivotView, cellInfo: IPivotCellPositionInfo, isEmpty: boolean): {
79
+ undos: IMutationInfo<object>[];
80
+ redos: IMutationInfo<object>[];
81
+ };
82
+ export declare function getHeaderViewMaxText(labelView: LabelViewItem, textInfo: Record<string, string>, isCol: boolean, formatMap: Record<string, string>): string;
83
+ export declare function getValueViewMaxText(rowView: PivotViewItem): string;
84
+ export declare function getCornerMaxText(corner: PivotViewItem): string;
package/lib/umd/facade.js CHANGED
@@ -1 +1 @@
1
- function _0x1317(_0x14f067,_0x128f31){const _0x22022d=_0x2202();return _0x1317=function(_0x131729,_0x3c6089){_0x131729=_0x131729-0x1c3;let _0x5ecbe2=_0x22022d[_0x131729];return _0x5ecbe2;},_0x1317(_0x14f067,_0x128f31);}function _0x2202(){const _0xb2cc36=['symbol','addField','updateFieldPosition','SetPivotFilterCommand','5410010rgbeTs','10bRXNDl','setLabelManualFilter','SetPivotSubtotalTypeMutation','subUnitId','SheetsPivotTableConfigModel','768mKVToD','number','UpdatePivotValuePositionCommand','getConfig','get','amd','function','setLabelSort','1162172XZkHlz','1805058OmenHy','9MZZsaa','UniverEnginePivot','object','getCollection','fieldIds','RemovePivotTableMutation','executeCommand','pivotTableId','getPivotTableByCell','_injector','defineProperty','renameField','Module','FPivotTable','ICommandService','SheetsPivotTableAdaptorModel','UniverSheetsFacade','updateValuePosition','11777337ujzKBS','unitId','removeField','@univerjs/core','toStringTag','FWorkbook','exports','SetPivotSortCommand','syncExecuteCommand','setSubtotalType','@univerjs/sheets/facade','385495QxzDGL','3460WgTlqg','AddPivotFieldCommand','getPivotTableConfig','21YnAEEN','UniverSheetsPivotFacade','MovePivotFieldCommand','RenamePivotFieldMutation','getPivotTableIdByCell','@univerjs-pro/sheets-pivot','UniverSheetsPivot','@univerjs-pro/engine-pivot','780272ODskYi'];_0x2202=function(){return _0xb2cc36;};return _0x2202();}(function(_0x38f8cd,_0x2620b4){const _0x2f0a6d=_0x1317,_0x22c687=_0x38f8cd();while(!![]){try{const _0x34e695=-parseInt(_0x2f0a6d(0x1c9))/0x1+parseInt(_0x2f0a6d(0x1ca))/0x2*(-parseInt(_0x2f0a6d(0x1e0))/0x3)+-parseInt(_0x2f0a6d(0x1e8))/0x4+-parseInt(_0x2f0a6d(0x1db))/0x5*(-parseInt(_0x2f0a6d(0x1e9))/0x6)+parseInt(_0x2f0a6d(0x1cd))/0x7*(parseInt(_0x2f0a6d(0x1d5))/0x8)+-parseInt(_0x2f0a6d(0x1ea))/0x9*(parseInt(_0x2f0a6d(0x1da))/0xa)+parseInt(_0x2f0a6d(0x1fc))/0xb;if(_0x34e695===_0x2620b4)break;else _0x22c687['push'](_0x22c687['shift']());}catch(_0xd87eee){_0x22c687['push'](_0x22c687['shift']());}}}(_0x2202,0x4a78c),function(_0x2dff2f,_0x534afe){const _0x164b27=_0x1317;typeof exports==_0x164b27(0x1ec)&&typeof module<'u'?_0x534afe(exports,require(_0x164b27(0x1ff)),require(_0x164b27(0x1c8)),require(_0x164b27(0x1d4)),require(_0x164b27(0x1d2))):typeof define==_0x164b27(0x1e6)&&define[_0x164b27(0x1e5)]?define([_0x164b27(0x1c4),_0x164b27(0x1ff),'@univerjs/sheets/facade','@univerjs-pro/engine-pivot',_0x164b27(0x1d2)],_0x534afe):(_0x2dff2f=typeof globalThis<'u'?globalThis:_0x2dff2f||self,_0x534afe(_0x2dff2f[_0x164b27(0x1ce)]={},_0x2dff2f['UniverCore'],_0x2dff2f[_0x164b27(0x1fa)],_0x2dff2f[_0x164b27(0x1eb)],_0x2dff2f[_0x164b27(0x1d3)]));}(this,function(_0x10f825,_0x26097,_0x1626ff,_0xadacc4,_0x2b6a91){'use strict';const _0x2b106c=_0x1317;var _0xeb87cf=Object[_0x2b106c(0x1f4)],_0x282aea=(_0x2d3b24,_0xe53ef3,_0x14eb4b)=>_0xe53ef3 in _0x2d3b24?_0xeb87cf(_0x2d3b24,_0xe53ef3,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x14eb4b}):_0x2d3b24[_0xe53ef3]=_0x14eb4b,_0x4dcf45=(_0x10e44b,_0xc5303a,_0x2f8dbe)=>_0x282aea(_0x10e44b,typeof _0xc5303a!=_0x2b106c(0x1d6)?_0xc5303a+'':_0xc5303a,_0x2f8dbe);class _0x3bc0a9{constructor(_0x5686a4,_0x5baea7,_0x21c37b,_0x1da93e){const _0x551d20=_0x2b106c;_0x4dcf45(this,_0x551d20(0x1fd)),_0x4dcf45(this,_0x551d20(0x1de)),_0x4dcf45(this,_0x551d20(0x1f1)),_0x4dcf45(this,_0x551d20(0x1f3)),(this[_0x551d20(0x1fd)]=_0x5686a4,this[_0x551d20(0x1de)]=_0x5baea7,this[_0x551d20(0x1f1)]=_0x21c37b,this[_0x551d20(0x1f3)]=_0x1da93e);}[_0x2b106c(0x1e3)](){const _0x31f0fe=_0x2b106c;return this[_0x31f0fe(0x1f3)][_0x31f0fe(0x1e4)](_0x2b6a91[_0x31f0fe(0x1df)])[_0x31f0fe(0x1cc)](this[_0x31f0fe(0x1fd)],this[_0x31f0fe(0x1de)],this['pivotTableId']);}async['remove'](){const _0x27ba2a=_0x2b106c;return await this['_injector']['get'](_0x26097[_0x27ba2a(0x1f8)])[_0x27ba2a(0x1c6)](_0x2b6a91[_0x27ba2a(0x1ef)]['id'],{'unitId':this[_0x27ba2a(0x1fd)],'subUnitId':this[_0x27ba2a(0x1de)],'pivotTableId':this[_0x27ba2a(0x1f1)]});}async[_0x2b106c(0x1d7)](_0x23a6a9,_0x32fe31,_0x396779){const _0x281192=_0x2b106c,_0x10725b=this[_0x281192(0x1f3)],_0x50187a=this[_0x281192(0x1fd)],_0x595903=this[_0x281192(0x1de)],_0x30ebde=this[_0x281192(0x1f1)],_0x57c5ee=_0x10725b[_0x281192(0x1e4)](_0x26097[_0x281192(0x1f8)]),_0x53d5b0=_0x10725b['get'](_0x2b6a91['SheetsPivotTableConfigModel']),_0x379902=_0x53d5b0[_0x281192(0x1cc)](_0x50187a,_0x595903,_0x30ebde),_0x129dd8=_0x53d5b0[_0x281192(0x1ed)](_0x50187a,_0x30ebde);if(!_0x379902||!_0x129dd8)return!0x1;let _0x4e81f5=_0x23a6a9;typeof _0x4e81f5==_0x281192(0x1e1)&&(_0x4e81f5=_0x53d5b0[_0x281192(0x1ed)](_0x50187a,_0x30ebde)[_0x281192(0x1ee)][_0x23a6a9]);const _0x3a498c={'unitId':_0x50187a,'subUnitId':_0x595903,'pivotTableId':_0x30ebde,'dataFieldId':_0x4e81f5,'fieldArea':_0x32fe31,'index':_0x396779};return _0x57c5ee[_0x281192(0x1f0)](_0x2b6a91[_0x281192(0x1cb)]['id'],_0x3a498c);}async[_0x2b106c(0x1fe)](_0x3bec06){const _0xc0a8f1=_0x2b106c,_0x3decbd=this[_0xc0a8f1(0x1f3)],_0x189379=this[_0xc0a8f1(0x1fd)],_0xeceffc=this[_0xc0a8f1(0x1de)],_0x3982fe=this[_0xc0a8f1(0x1f1)],_0x2e4aca=_0x3decbd['get'](_0x26097['ICommandService']),_0x5f08cf={'unitId':_0x189379,'subUnitId':_0xeceffc,'pivotTableId':_0x3982fe,'fieldIds':_0x3bec06};return _0x2e4aca[_0xc0a8f1(0x1f0)](_0x2b6a91['RemovePivotFieldCommand']['id'],_0x5f08cf);}async[_0x2b106c(0x1d8)](_0x14529f,_0x1d90aa,_0x3730b2){const _0x21b8cb=_0x2b106c,_0x5c170a=this['_injector'],_0x26dd83=this[_0x21b8cb(0x1fd)],_0xf75ff0=this[_0x21b8cb(0x1de)],_0x24d789=this[_0x21b8cb(0x1f1)],_0x285b84=_0x5c170a[_0x21b8cb(0x1e4)](_0x26097[_0x21b8cb(0x1f8)]),_0x59ce34={'unitId':_0x26dd83,'subUnitId':_0xf75ff0,'pivotTableId':_0x24d789,'fieldId':_0x14529f,'area':_0x1d90aa,'index':_0x3730b2};return _0x285b84[_0x21b8cb(0x1f0)](_0x2b6a91[_0x21b8cb(0x1cf)]['id'],_0x59ce34);}async[_0x2b106c(0x1fb)](_0x25d97f,_0x4b7765){const _0x3eb343=_0x2b106c,_0x2900be=this['_injector'],_0x475a81=this[_0x3eb343(0x1fd)],_0x48f171=this['subUnitId'],_0x44e73d=this[_0x3eb343(0x1f1)],_0x1524cf=_0x2900be[_0x3eb343(0x1e4)](_0x26097[_0x3eb343(0x1f8)]),_0x1cba52={'unitId':_0x475a81,'subUnitId':_0x48f171,'pivotTableId':_0x44e73d,'position':_0x25d97f,'index':_0x4b7765};return _0x1524cf[_0x3eb343(0x1f0)](_0x2b6a91[_0x3eb343(0x1e2)]['id'],_0x1cba52);}async[_0x2b106c(0x1c7)](_0x1df348,_0x558dc9){const _0x6b1cfa=_0x2b106c,_0x1033b1=this[_0x6b1cfa(0x1f3)],_0xb91831=this['unitId'],_0x5e748e=this[_0x6b1cfa(0x1de)],_0x342232=this[_0x6b1cfa(0x1f1)],_0x36fd9c=_0x1033b1['get'](_0x26097[_0x6b1cfa(0x1f8)]),_0x537e45={'unitId':_0xb91831,'subUnitId':_0x5e748e,'pivotTableId':_0x342232,'fieldId':_0x1df348,'subtotalType':_0x558dc9};return _0x36fd9c['executeCommand'](_0x2b6a91[_0x6b1cfa(0x1dd)]['id'],_0x537e45);}async[_0x2b106c(0x1e7)](_0x24c8cf,_0x10f8dd){const _0x3bd23a=_0x2b106c,_0x513b08=this['_injector'],_0x4d683f=this[_0x3bd23a(0x1fd)],_0x2b112b=this[_0x3bd23a(0x1de)],_0x4b491c=this[_0x3bd23a(0x1f1)],_0x5d0881=_0x513b08['get'](_0x26097[_0x3bd23a(0x1f8)]),_0x7126d0={'unitId':_0x4d683f,'subUnitId':_0x2b112b,'tableFieldId':_0x24c8cf,'pivotTableId':_0x4b491c,'info':_0x10f8dd};return _0x5d0881[_0x3bd23a(0x1f0)](_0x2b6a91[_0x3bd23a(0x1c5)]['id'],_0x7126d0);}async[_0x2b106c(0x1dc)](_0x84a03c,_0x961edc,_0x52060c){const _0x2153ac=_0x2b106c,_0x34c130=this[_0x2153ac(0x1f3)],_0x1856ea=this[_0x2153ac(0x1fd)],_0x143c72=this[_0x2153ac(0x1de)],_0x4c23d5=this[_0x2153ac(0x1f1)],_0x480854=_0x34c130['get'](_0x26097[_0x2153ac(0x1f8)]),_0x5f0e5f={'unitId':_0x1856ea,'subUnitId':_0x143c72,'pivotTableId':_0x4c23d5,'tableFieldId':_0x84a03c,'items':_0x961edc,'isAll':_0x52060c};return _0x480854['executeCommand'](_0x2b6a91[_0x2153ac(0x1d9)]['id'],_0x5f0e5f);}async[_0x2b106c(0x1f5)](_0x437099,_0x4c27a5){const _0x501cb7=_0x2b106c,_0x3b8b63=this[_0x501cb7(0x1f3)],_0x4349c8=this[_0x501cb7(0x1fd)],_0x5744f5=this['subUnitId'],_0xce6707=this[_0x501cb7(0x1f1)],_0x28fa82=_0x3b8b63['get'](_0x26097[_0x501cb7(0x1f8)]),_0x5b0721={'unitId':_0x4349c8,'subUnitId':_0x5744f5,'pivotTableId':_0xce6707,'fieldId':_0x437099,'name':_0x4c27a5};return _0x28fa82['executeCommand'](_0x2b6a91[_0x501cb7(0x1d0)]['id'],_0x5b0721);}}class _0x326c74 extends _0x1626ff['FWorkbook']{async['addPivotTable'](_0x4a27b0,_0x43e40b,_0x38494b){const _0x14f03b=_0x2b106c,_0x3e8bd0=this['_injector'],_0x262b14=_0x3e8bd0[_0x14f03b(0x1e4)](_0x26097[_0x14f03b(0x1f8)]),_0x2383db=_0xadacc4['generateHexNumber'](0x8),_0x4fd76b={'positionType':_0x43e40b,'pivotTableId':_0x2383db,'pivotTableConfig':{'targetCellInfo':_0x38494b,'sourceRangeInfo':_0x4a27b0,'isEmpty':!0x0}};if(await _0x262b14[_0x14f03b(0x1f0)](_0x2b6a91['AddPivotTableCommand']['id'],_0x4fd76b))return new _0x3bc0a9(_0x38494b['unitId'],_0x38494b[_0x14f03b(0x1de)],_0x2383db,_0x3e8bd0);}[_0x2b106c(0x1f2)](_0x150ebd,_0x129fd2,_0x1cb749,_0x8710ac){const _0x9ee93e=_0x2b106c,_0x1b778c=this[_0x9ee93e(0x1f3)],_0x1944b4=_0x1b778c[_0x9ee93e(0x1e4)](_0x2b6a91[_0x9ee93e(0x1f9)])[_0x9ee93e(0x1d1)](_0x150ebd,_0x129fd2,_0x1cb749,_0x8710ac);if(_0x1944b4)return new _0x3bc0a9(_0x150ebd,_0x129fd2,_0x1944b4,_0x1b778c);}}_0x1626ff[_0x2b106c(0x1c3)]['extend'](_0x326c74),_0x10f825[_0x2b106c(0x1f7)]=_0x3bc0a9,Object[_0x2b106c(0x1f4)](_0x10f825,Symbol[_0x2b106c(0x200)],{'value':_0x2b106c(0x1f6)});}));
1
+ (function(_0x247be7,_0x3b48e6){const _0x732653=_0x401c,_0x384539=_0x247be7();while(!![]){try{const _0x19b229=parseInt(_0x732653(0x1d9))/0x1+-parseInt(_0x732653(0x1d5))/0x2+parseInt(_0x732653(0x1e1))/0x3*(-parseInt(_0x732653(0x1f0))/0x4)+parseInt(_0x732653(0x206))/0x5*(parseInt(_0x732653(0x1db))/0x6)+parseInt(_0x732653(0x1f3))/0x7+parseInt(_0x732653(0x1d7))/0x8*(-parseInt(_0x732653(0x1dd))/0x9)+parseInt(_0x732653(0x1fa))/0xa;if(_0x19b229===_0x3b48e6)break;else _0x384539['push'](_0x384539['shift']());}catch(_0x13deee){_0x384539['push'](_0x384539['shift']());}}}(_0x280a,0xd5bf1),function(_0x5af1b4,_0x2e1cfc){const _0x104fd4=_0x401c;typeof exports==_0x104fd4(0x1e5)&&typeof module<'u'?_0x2e1cfc(exports,require(_0x104fd4(0x1f2)),require(_0x104fd4(0x201)),require(_0x104fd4(0x1d8)),require(_0x104fd4(0x1f5))):typeof define==_0x104fd4(0x1dc)&&define[_0x104fd4(0x200)]?define([_0x104fd4(0x1e8),_0x104fd4(0x1f2),_0x104fd4(0x201),_0x104fd4(0x1d8),_0x104fd4(0x1f5)],_0x2e1cfc):(_0x5af1b4=typeof globalThis<'u'?globalThis:_0x5af1b4||self,_0x2e1cfc(_0x5af1b4['UniverProSheetsPivotFacade']={},_0x5af1b4[_0x104fd4(0x1d3)],_0x5af1b4['UniverSheetsFacade'],_0x5af1b4[_0x104fd4(0x1eb)],_0x5af1b4[_0x104fd4(0x1ea)]));}(this,function(_0x4cbd3b,_0x5dc1ad,_0x335d9c,_0x67b590,_0x478e1d){'use strict';const _0x43ca6b=_0x401c;var _0xf909d9=Object['defineProperty'],_0x437731=(_0x5de9e4,_0x11f64d,_0x58a056)=>_0x11f64d in _0x5de9e4?_0xf909d9(_0x5de9e4,_0x11f64d,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x58a056}):_0x5de9e4[_0x11f64d]=_0x58a056,_0x6171aa=(_0x31e77f,_0x4683fa,_0x5413fb)=>_0x437731(_0x31e77f,typeof _0x4683fa!='symbol'?_0x4683fa+'':_0x4683fa,_0x5413fb);class _0x35d6f6{constructor(_0x57d8f5,_0x4362af,_0x39761b,_0x3959a5){const _0x39032d=_0x401c;_0x6171aa(this,'unitId'),_0x6171aa(this,_0x39032d(0x1ef)),_0x6171aa(this,_0x39032d(0x1e7)),_0x6171aa(this,'_injector'),(this[_0x39032d(0x1f9)]=_0x57d8f5,this[_0x39032d(0x1ef)]=_0x4362af,this[_0x39032d(0x1e7)]=_0x39761b,this['_injector']=_0x3959a5);}[_0x43ca6b(0x1e9)](){const _0x363937=_0x43ca6b;return this[_0x363937(0x1e0)]['get'](_0x478e1d[_0x363937(0x207)])['getPivotTableConfig'](this['unitId'],this['subUnitId'],this[_0x363937(0x1e7)]);}async['remove'](){const _0x501e61=_0x43ca6b;return await this[_0x501e61(0x1e0)][_0x501e61(0x1e6)](_0x5dc1ad[_0x501e61(0x202)])[_0x501e61(0x1ff)](_0x478e1d[_0x501e61(0x204)]['id'],{'unitId':this['unitId'],'subUnitId':this[_0x501e61(0x1ef)],'pivotTableId':this[_0x501e61(0x1e7)]});}async['addField'](_0x450024,_0x5e7a05,_0x18ab17){const _0x448dbf=_0x43ca6b,_0x259b71=this[_0x448dbf(0x1e0)],_0x35aac2=this[_0x448dbf(0x1f9)],_0x21c47d=this[_0x448dbf(0x1ef)],_0x13b8bb=this[_0x448dbf(0x1e7)],_0x1ea348=_0x259b71[_0x448dbf(0x1e6)](_0x5dc1ad['ICommandService']),_0x283aa1=_0x259b71[_0x448dbf(0x1e6)](_0x478e1d['SheetsPivotTableConfigModel']),_0x301668=_0x283aa1['getPivotTableConfig'](_0x35aac2,_0x21c47d,_0x13b8bb),_0x53037b=_0x283aa1[_0x448dbf(0x1f4)](_0x35aac2,_0x13b8bb);if(!_0x301668||!_0x53037b)return!0x1;let _0x47df7b=_0x450024;typeof _0x47df7b==_0x448dbf(0x205)&&(_0x47df7b=_0x283aa1['getCollection'](_0x35aac2,_0x13b8bb)['fieldIds'][_0x450024]);const _0x521373={'unitId':_0x35aac2,'subUnitId':_0x21c47d,'pivotTableId':_0x13b8bb,'dataFieldId':_0x47df7b,'fieldArea':_0x5e7a05,'index':_0x18ab17};return _0x1ea348[_0x448dbf(0x1df)](_0x478e1d[_0x448dbf(0x1ee)]['id'],_0x521373);}async[_0x43ca6b(0x1f6)](_0x370ece){const _0x527131=_0x43ca6b,_0x12090a=this[_0x527131(0x1e0)],_0x48e527=this['unitId'],_0x4df0ec=this[_0x527131(0x1ef)],_0x14acfe=this['pivotTableId'],_0x4970bc=_0x12090a[_0x527131(0x1e6)](_0x5dc1ad[_0x527131(0x202)]),_0x158810={'unitId':_0x48e527,'subUnitId':_0x4df0ec,'pivotTableId':_0x14acfe,'fieldIds':_0x370ece};return _0x4970bc['executeCommand'](_0x478e1d[_0x527131(0x1f7)]['id'],_0x158810);}async[_0x43ca6b(0x1da)](_0x3ed42d,_0x59de46,_0x4edb4b){const _0x5312d5=_0x43ca6b,_0x573499=this[_0x5312d5(0x1e0)],_0xde2b23=this[_0x5312d5(0x1f9)],_0x48beff=this[_0x5312d5(0x1ef)],_0x5d38c9=this['pivotTableId'],_0x2e5cf8=_0x573499[_0x5312d5(0x1e6)](_0x5dc1ad[_0x5312d5(0x202)]),_0x38995b={'unitId':_0xde2b23,'subUnitId':_0x48beff,'pivotTableId':_0x5d38c9,'fieldId':_0x3ed42d,'area':_0x59de46,'index':_0x4edb4b};return _0x2e5cf8['executeCommand'](_0x478e1d[_0x5312d5(0x203)]['id'],_0x38995b);}async['updateValuePosition'](_0x342dfe,_0x41402d){const _0x48bf61=_0x43ca6b,_0x2501d7=this[_0x48bf61(0x1e0)],_0xe62fe2=this[_0x48bf61(0x1f9)],_0x492cb2=this['subUnitId'],_0x15ec5b=this[_0x48bf61(0x1e7)],_0x2ddbb5=_0x2501d7[_0x48bf61(0x1e6)](_0x5dc1ad[_0x48bf61(0x202)]),_0x5c4164={'unitId':_0xe62fe2,'subUnitId':_0x492cb2,'pivotTableId':_0x15ec5b,'position':_0x342dfe,'index':_0x41402d};return _0x2ddbb5[_0x48bf61(0x1df)](_0x478e1d[_0x48bf61(0x1fb)]['id'],_0x5c4164);}async['setSubtotalType'](_0x5afed4,_0x22598e){const _0x4434b7=_0x43ca6b,_0x16e6dc=this[_0x4434b7(0x1e0)],_0x5bb88a=this['unitId'],_0x443e20=this[_0x4434b7(0x1ef)],_0xac303a=this['pivotTableId'],_0x42e303=_0x16e6dc[_0x4434b7(0x1e6)](_0x5dc1ad[_0x4434b7(0x202)]),_0x536396={'unitId':_0x5bb88a,'subUnitId':_0x443e20,'pivotTableId':_0xac303a,'fieldId':_0x5afed4,'subtotalType':_0x22598e};return _0x42e303[_0x4434b7(0x1df)](_0x478e1d['SetPivotSubtotalTypeMutation']['id'],_0x536396);}async[_0x43ca6b(0x1fe)](_0x3377f9,_0x943da6){const _0xb72f69=_0x43ca6b,_0x4715ec=this[_0xb72f69(0x1e0)],_0xbd59b9=this[_0xb72f69(0x1f9)],_0x5ab688=this[_0xb72f69(0x1ef)],_0x2cef11=this[_0xb72f69(0x1e7)],_0x200a82=_0x4715ec[_0xb72f69(0x1e6)](_0x5dc1ad[_0xb72f69(0x202)]),_0xe0da49={'unitId':_0xbd59b9,'subUnitId':_0x5ab688,'tableFieldId':_0x3377f9,'pivotTableId':_0x2cef11,'info':_0x943da6};return _0x200a82['executeCommand'](_0x478e1d['SetPivotSortCommand']['id'],_0xe0da49);}async[_0x43ca6b(0x1de)](_0x4a1183,_0x4f8228,_0x23bba5){const _0x448739=_0x43ca6b,_0x5131e9=this[_0x448739(0x1e0)],_0x498245=this[_0x448739(0x1f9)],_0x47deb2=this[_0x448739(0x1ef)],_0x51c488=this[_0x448739(0x1e7)],_0x4a6437=_0x5131e9[_0x448739(0x1e6)](_0x5dc1ad[_0x448739(0x202)]),_0x4f13d6={'unitId':_0x498245,'subUnitId':_0x47deb2,'pivotTableId':_0x51c488,'tableFieldId':_0x4a1183,'items':_0x4f8228,'isAll':_0x23bba5};return _0x4a6437[_0x448739(0x1df)](_0x478e1d[_0x448739(0x1e4)]['id'],_0x4f13d6);}async[_0x43ca6b(0x1d6)](_0x54827f,_0x4bc220){const _0x3150c4=_0x43ca6b,_0x244c4e=this['_injector'],_0x129f97=this[_0x3150c4(0x1f9)],_0x377501=this[_0x3150c4(0x1ef)],_0x19accf=this['pivotTableId'],_0x30434c=_0x244c4e[_0x3150c4(0x1e6)](_0x5dc1ad[_0x3150c4(0x202)]),_0x51a74d={'unitId':_0x129f97,'subUnitId':_0x377501,'pivotTableId':_0x19accf,'fieldId':_0x54827f,'name':_0x4bc220};return _0x30434c[_0x3150c4(0x1df)](_0x478e1d[_0x3150c4(0x1e2)]['id'],_0x51a74d);}}class _0x582375 extends _0x335d9c[_0x43ca6b(0x1fd)]{async[_0x43ca6b(0x1f1)](_0x36dcaa,_0x130962,_0x56abac){const _0x3602a2=_0x43ca6b,_0x5a1a75=this[_0x3602a2(0x1e0)],_0x589a2a=_0x5a1a75[_0x3602a2(0x1e6)](_0x5dc1ad[_0x3602a2(0x202)]),_0x3f8a2e=_0x67b590[_0x3602a2(0x1ec)](0x8),_0x283d69={'positionType':_0x130962,'pivotTableId':_0x3f8a2e,'pivotTableConfig':{'targetCellInfo':_0x56abac,'sourceRangeInfo':_0x36dcaa,'isEmpty':!0x0}};if(await _0x589a2a['executeCommand'](_0x478e1d['AddPivotTableCommand']['id'],_0x283d69))return new _0x35d6f6(_0x56abac[_0x3602a2(0x1f9)],_0x56abac[_0x3602a2(0x1ef)],_0x3f8a2e,_0x5a1a75);}['getPivotTableByCell'](_0x295eeb,_0x46e7af,_0x2c1c80,_0x1d991b){const _0x2ee3b4=_0x43ca6b,_0x1e2c71=this['_injector'],_0x3dc64a=_0x1e2c71['get'](_0x478e1d[_0x2ee3b4(0x1fc)])[_0x2ee3b4(0x1ed)](_0x295eeb,_0x46e7af,_0x2c1c80,_0x1d991b);if(_0x3dc64a)return new _0x35d6f6(_0x295eeb,_0x46e7af,_0x3dc64a,_0x1e2c71);}}_0x335d9c[_0x43ca6b(0x1fd)][_0x43ca6b(0x1d4)](_0x582375),_0x4cbd3b[_0x43ca6b(0x1e3)]=_0x35d6f6,Object['defineProperty'](_0x4cbd3b,Symbol[_0x43ca6b(0x208)],{'value':_0x43ca6b(0x1f8)});}));function _0x401c(_0xb81f60,_0xb9a96d){const _0x280a0d=_0x280a();return _0x401c=function(_0x401ce9,_0x1c6423){_0x401ce9=_0x401ce9-0x1d3;let _0x3a7634=_0x280a0d[_0x401ce9];return _0x3a7634;},_0x401c(_0xb81f60,_0xb9a96d);}function _0x280a(){const _0x535ec=['function','27RxqwCy','setLabelManualFilter','executeCommand','_injector','44670qnIJWY','RenamePivotFieldMutation','FPivotTable','SetPivotFilterCommand','object','get','pivotTableId','exports','getConfig','UniverProSheetsPivot','UniverProEnginePivot','generateHexNumber','getPivotTableIdByCell','AddPivotFieldCommand','subUnitId','364FlpeYX','addPivotTable','@univerjs/core','636440YAlrbT','getCollection','@univerjs-pro/sheets-pivot','removeField','RemovePivotFieldCommand','Module','unitId','24031180igrnIE','UpdatePivotValuePositionCommand','SheetsPivotTableAdaptorModel','FWorkbook','setLabelSort','syncExecuteCommand','amd','@univerjs/sheets/facade','ICommandService','MovePivotFieldCommand','RemovePivotTableMutation','number','4013355gTZXht','SheetsPivotTableConfigModel','toStringTag','UniverCore','extend','2054378PBtwNf','renameField','2013136kfjfjQ','@univerjs-pro/engine-pivot','715901gtGLTL','updateFieldPosition','6sJpBXs'];_0x280a=function(){return _0x535ec;};return _0x280a();}