@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.
Files changed (77) hide show
  1. package/README.md +13 -15
  2. package/lib/cjs/facade.js +1 -0
  3. package/lib/cjs/index.js +1 -1
  4. package/lib/cjs/locale/en-US.js +1 -0
  5. package/lib/cjs/locale/fa-IR.js +1 -0
  6. package/lib/cjs/locale/ru-RU.js +1 -0
  7. package/lib/cjs/locale/vi-VN.js +1 -0
  8. package/lib/cjs/locale/zh-CN.js +1 -0
  9. package/lib/cjs/locale/zh-TW.js +1 -0
  10. package/lib/es/facade.js +1 -0
  11. package/lib/es/index.js +1 -1
  12. package/lib/es/locale/en-US.js +1 -0
  13. package/lib/es/locale/fa-IR.js +1 -0
  14. package/lib/es/locale/ru-RU.js +1 -0
  15. package/lib/es/locale/vi-VN.js +1 -0
  16. package/lib/es/locale/zh-CN.js +1 -0
  17. package/lib/es/locale/zh-TW.js +1 -0
  18. package/lib/types/index.d.ts +1158 -29
  19. package/lib/umd/facade.js +1 -0
  20. package/lib/umd/index.js +1 -1
  21. package/lib/umd/locale/en-US.js +1 -0
  22. package/lib/umd/locale/fa-IR.js +1 -0
  23. package/lib/umd/locale/ru-RU.js +1 -0
  24. package/lib/umd/locale/vi-VN.js +1 -0
  25. package/lib/umd/locale/zh-CN.js +1 -0
  26. package/lib/umd/locale/zh-TW.js +1 -0
  27. package/package.json +39 -20
  28. package/lib/locale/en-US.json +0 -30
  29. package/lib/locale/fa-IR.json +0 -30
  30. package/lib/locale/ru-RU.json +0 -30
  31. package/lib/locale/vi-VN.json +0 -30
  32. package/lib/locale/zh-CN.json +0 -30
  33. package/lib/locale/zh-TW.json +0 -30
  34. package/lib/types/commands/command/add-pivot-table-with-config.command.d.ts +0 -3
  35. package/lib/types/commands/command/util.d.ts +0 -12
  36. package/lib/types/commands/mutations/add-pivot-field.mutation.d.ts +0 -3
  37. package/lib/types/commands/mutations/add-pivot-table.mutation.d.ts +0 -3
  38. package/lib/types/commands/mutations/change-apply-util.d.ts +0 -15
  39. package/lib/types/commands/mutations/pivot-data-communication.mutation.d.ts +0 -7
  40. package/lib/types/commands/mutations/remove-pivot-field.mutation.d.ts +0 -3
  41. package/lib/types/commands/mutations/remove-pivot-table.mutation.d.ts +0 -3
  42. package/lib/types/commands/mutations/rename-pivot-field.mutation.d.ts +0 -3
  43. package/lib/types/commands/mutations/set-pivot-collapse.mutation.d.ts +0 -3
  44. package/lib/types/commands/mutations/set-pivot-field-format.mutation.d.ts +0 -3
  45. package/lib/types/commands/mutations/set-pivot-filter.mutation.d.ts +0 -3
  46. package/lib/types/commands/mutations/set-pivot-option.mutation.d.ts +0 -3
  47. package/lib/types/commands/mutations/set-pivot-position.mutation.d.ts +0 -3
  48. package/lib/types/commands/mutations/set-pivot-sort.mutation.d.ts +0 -3
  49. package/lib/types/commands/mutations/set-pivot-subtotal-type.mutation.d.ts +0 -3
  50. package/lib/types/commands/mutations/update-field-position.mutation.d.ts +0 -3
  51. package/lib/types/commands/mutations/update-pivot-field-source-info.mutation.d.ts +0 -3
  52. package/lib/types/commands/mutations/update-pivot-table-source.mutation.d.ts +0 -3
  53. package/lib/types/commands/mutations/update-value-position.mutation.d.ts +0 -3
  54. package/lib/types/commands/operations/pivot-table-dirty-view.operation.d.ts +0 -3
  55. package/lib/types/common/const.d.ts +0 -64
  56. package/lib/types/const/const.d.ts +0 -99
  57. package/lib/types/const/template.d.ts +0 -885
  58. package/lib/types/const/type.d.ts +0 -522
  59. package/lib/types/controllers/config.schema.d.ts +0 -6
  60. package/lib/types/controllers/const.d.ts +0 -1
  61. package/lib/types/controllers/sheets-pivot-caculate.controller.d.ts +0 -44
  62. package/lib/types/controllers/sheets-pivot-rpc.controller.d.ts +0 -20
  63. package/lib/types/locale/en-US.d.ts +0 -3
  64. package/lib/types/locale/fa-IR.d.ts +0 -3
  65. package/lib/types/locale/ru-RU.d.ts +0 -3
  66. package/lib/types/locale/vi-VN.d.ts +0 -3
  67. package/lib/types/locale/zh-CN.d.ts +0 -31
  68. package/lib/types/locale/zh-TW.d.ts +0 -3
  69. package/lib/types/models/sheets-pivot-config-model.d.ts +0 -58
  70. package/lib/types/models/sheets-pivot-data-field-manager.d.ts +0 -77
  71. package/lib/types/models/sheets-pivot-data-source-model.d.ts +0 -101
  72. package/lib/types/models/sheets-pivot-table-adaptor-model.d.ts +0 -54
  73. package/lib/types/models/view-util.d.ts +0 -16
  74. package/lib/types/plugin.d.ts +0 -17
  75. package/lib/types/services/sheets-pivot-rpc.service.d.ts +0 -11
  76. package/lib/types/services/sheets-pivot-table.service.d.ts +0 -10
  77. package/lib/types/util.d.ts +0 -52
@@ -1,29 +1,1158 @@
1
- export { applyChangeSet } from './commands/command/util';
2
- export { AddPivotFieldMutation } from './commands/mutations/add-pivot-field.mutation';
3
- export { AddPivotTableMutation } from './commands/mutations/add-pivot-table.mutation';
4
- export { getFieldListByArea } from './commands/mutations/change-apply-util';
5
- export { RemovePivotFieldMutation } from './commands/mutations/remove-pivot-field.mutation';
6
- export { RemovePivotTableMutation } from './commands/mutations/remove-pivot-table.mutation';
7
- export { RenamePivotFieldMutation } from './commands/mutations/rename-pivot-field.mutation';
8
- export { SetPivotCollapseMutation } from './commands/mutations/set-pivot-collapse.mutation';
9
- export { SetPivotFieldFormatMutation } from './commands/mutations/set-pivot-field-format.mutation';
10
- export { SetPivotFilterMutation } from './commands/mutations/set-pivot-filter.mutation';
11
- export { SetPivotOptionMutation } from './commands/mutations/set-pivot-option.mutation';
12
- export { SetPivotPositionMutation } from './commands/mutations/set-pivot-position.mutation';
13
- export { SetPivotSortMutation } from './commands/mutations/set-pivot-sort.mutation';
14
- export { SetPivotSubtotalTypeMutation } from './commands/mutations/set-pivot-subtotal-type.mutation';
15
- export { UpdateFieldPositionMutation } from './commands/mutations/update-field-position.mutation';
16
- export { UpdatePivotFieldSourceInfoMutation } from './commands/mutations/update-pivot-field-source-info.mutation';
17
- export { UpdatePivotTableSourceRangeMutation } from './commands/mutations/update-pivot-table-source.mutation';
18
- export { UpdateValuePositionMutation } from './commands/mutations/update-value-position.mutation';
19
- export { PivotTableViewDirtyMarkOperation } from './commands/operations/pivot-table-dirty-view.operation';
20
- export { BLANK_ROW_COUNT, getAdjustRangesPosition, PivotDisplayDataType, PositionType, SHEET_PIVOT_TABLE_PLUGIN } from './const/const';
21
- export { DEFAULT_PIVOT_NUMBER, defaultThemeStyle, transFromCellValue } from './const/const';
22
- export type { IAddPivotFieldMutationParams, IAddPivotTableCommandParams, IPivotCellPositionInfo, IPivotPanelDataInfo, IPivotPanelSourceList, IPivotPanelTableListItemBase, IPivotRangesInfo, IPivotRenderCache, IPivotTableCellData, IPivotTableConfig, IRangePosition, IRemovePivotFieldMutationParams, IRemovePivotTableMutationParams, IRenamePivotFieldMutationParams, ISetPivotCollapseMutation, ISetPivotFieldFormatMutationParams, ISetPivotFilterMutationParams, ISetPivotOptionMutationParams, ISetPivotPositionMutationParams, ISetPivotSortMutationParams, ISetPivotSubtotalTypeMutationParams, IUnitRangeNameWithSubUnitId, IUpdateFieldPositionMutationParams, IUpdatePivotFieldSourceInfoMutationParams, IUpdateValuePositionMutationParams, } from './const/type';
23
- export { PivotTableOperationEnum } from './const/type';
24
- export { SheetsPivotTableConfigModel } from './models/sheets-pivot-config-model';
25
- export { SheetsPivotDataSourceModel } from './models/sheets-pivot-data-source-model';
26
- export { SheetsPivotTableAdaptorModel } from './models/sheets-pivot-table-adaptor-model';
27
- export { UniverSheetsPivotTablePlugin } from './plugin';
28
- export { SheetsPivotRPCService } from './services/sheets-pivot-rpc.service';
29
- export { canUsePivot, getPivotCellInfo, getPivotInfoByLicense, getPivotTableInfo, unionPivotViewRange } from './util';
1
+ import { AsyncInterceptorManager } from '@univerjs/core';
2
+ import { CellValueType } from '@univerjs/core';
3
+ import { DataField } from '@univerjs-pro/engine-pivot';
4
+ import { DataFieldManager } from '@univerjs-pro/engine-pivot';
5
+ import { DataSyncPrimaryController } from '@univerjs/rpc';
6
+ import { Disposable as Disposable_2 } from '@univerjs/core';
7
+ import { FieldsCollection } from '@univerjs-pro/engine-pivot';
8
+ import { IAccessor } from '@univerjs/core';
9
+ import { IAsyncInterceptor } from '@univerjs/core/common/interceptor.js';
10
+ import { ICellData } from '@univerjs/core';
11
+ import { ICommand } from '@univerjs/core';
12
+ import { ICommandService } from '@univerjs/core';
13
+ import { IConfigService } from '@univerjs/core';
14
+ import { IDataFieldManagerBaseJSON } from '@univerjs-pro/engine-pivot';
15
+ import { IDataFieldValue } from '@univerjs-pro/engine-pivot';
16
+ import { IExclusiveRangeService } from '@univerjs/sheets';
17
+ import { IFieldsCollectionJSON } from '@univerjs-pro/engine-pivot';
18
+ import { IInterceptor } from '@univerjs/core';
19
+ import { ILabelViewHeaderMapItem } from '@univerjs-pro/engine-pivot';
20
+ import { IMoveRangeMutationParams } from '@univerjs/sheets';
21
+ import { IMutation } from '@univerjs/core';
22
+ import { IMutationInfo } from '@univerjs/core';
23
+ import { Injector } from '@univerjs/core';
24
+ import { InterceptorManager } from '@univerjs/core';
25
+ import { IPivotTableChangeSet } from '@univerjs-pro/engine-pivot';
26
+ import { IPivotTableFilterInfo } from '@univerjs-pro/engine-pivot';
27
+ import { IPivotTableLabelFieldJSON } from '@univerjs-pro/engine-pivot';
28
+ import { IPivotTableOptions } from '@univerjs-pro/engine-pivot';
29
+ import { IPivotTableSnapshot } from '@univerjs-pro/engine-pivot';
30
+ import { IPivotTableSortInfo } from '@univerjs-pro/engine-pivot';
31
+ import { IPivotTableValueFieldJSON } from '@univerjs-pro/engine-pivot';
32
+ import { IPivotViewCellData } from '@univerjs-pro/engine-pivot';
33
+ import { IPivotViewInfo } from '@univerjs-pro/engine-pivot';
34
+ import { IPivotViewJSON } from '@univerjs-pro/engine-pivot';
35
+ import { IPivotViewValueType } from '@univerjs-pro/engine-pivot';
36
+ import { IRange } from '@univerjs/core';
37
+ import { IResourceManagerService } from '@univerjs/core';
38
+ import { IRuntimeUnitDataType } from '@univerjs/engine-formula';
39
+ import { ISetRangeValuesMutationParams } from '@univerjs/sheets';
40
+ import { IStyleData } from '@univerjs/core';
41
+ import { IUndoRedoCommandInfosByInterceptor } from '@univerjs/core';
42
+ import { IUnitRangeName } from '@univerjs/core';
43
+ import { IUniverInstanceService } from '@univerjs/core';
44
+ import { LifecycleService } from '@univerjs/core';
45
+ import { LocaleService } from '@univerjs/core';
46
+ import { Nullable } from '@univerjs/core';
47
+ import { ObjectMatrix } from '@univerjs/core';
48
+ import { Observable } from 'rxjs';
49
+ import { PivotCellStyleTypeEnum } from '@univerjs-pro/engine-pivot';
50
+ import { PivotDataFieldDataTypeEnum } from '@univerjs-pro/engine-pivot';
51
+ import { PivotSubtotalTypeEnum } from '@univerjs-pro/engine-pivot';
52
+ import { PivotTable } from '@univerjs-pro/engine-pivot';
53
+ import { PivotTableFiledAreaEnum } from '@univerjs-pro/engine-pivot';
54
+ import { PivotTableValuePositionEnum } from '@univerjs-pro/engine-pivot';
55
+ import { PivotView } from '@univerjs-pro/engine-pivot';
56
+ import { PivotViewItem } from '@univerjs-pro/engine-pivot';
57
+ import { Plugin as Plugin_2 } from '@univerjs/core';
58
+ import { SheetInterceptorService } from '@univerjs/sheets';
59
+ import { Styles } from '@univerjs/core';
60
+ import { UniverInstanceType } from '@univerjs/core';
61
+ import { Worksheet } from '@univerjs/core';
62
+
63
+ export declare const AddPivotFieldCommand: ICommand<IAddPivotFieldCommandParams>;
64
+
65
+ export declare const AddPivotFieldMutation: IMutation<IAddPivotFieldMutationParams>;
66
+
67
+ export declare const AddPivotTableCommand: ICommand<IAddPivotTableCommandParams>;
68
+
69
+ export declare const AddPivotTableMutation: IMutation<IAddPivotTableMutationParams>;
70
+
71
+ export declare function applyChangeSet(_commandService: ICommandService, pivotInfo: IPivotHostInfo, changesets: IPivotTableChangeSet[]): {
72
+ redos: IMutationInfo<object>[];
73
+ undos: IMutationInfo<object>[];
74
+ };
75
+
76
+ export declare const BLANK_ROW_COUNT = 1;
77
+
78
+ export declare function canUsePivot(ls?: string, pbk?: string): boolean;
79
+
80
+ declare enum CollectionChangeEnum {
81
+ add = "add",
82
+ delete = "delete",
83
+ update = "update"
84
+ }
85
+
86
+ export declare const DEFAULT_PIVOT_NUMBER = 1;
87
+
88
+ export declare const defaultThemeStyle: IThemeStyle;
89
+
90
+ export declare function generateSetRangeValueMutations(injector: Injector, unitId: string, subUnitId: string, ranges: IRange[]): {
91
+ setRangeValueUndoMutation: {
92
+ id: string;
93
+ params: ISetRangeValuesMutationParams;
94
+ };
95
+ setRangeValueRedoMutation: {
96
+ id: string;
97
+ params: ISetRangeValuesMutationParams;
98
+ };
99
+ shouldClear: boolean;
100
+ };
101
+
102
+ export declare function getAdjustRangesPosition(startCell: {
103
+ row: number;
104
+ col: number;
105
+ }, view: PivotViewItem, singleCellIsRange?: boolean, useLastRowOrCol?: boolean): IRange[];
106
+
107
+ export declare function getEmptyPivotRanges(cellInfo: IPivotCellPositionInfo): {
108
+ startRow: number;
109
+ endRow: number;
110
+ startColumn: number;
111
+ endColumn: number;
112
+ }[];
113
+
114
+ export declare function getFieldListByArea(config: IPivotTableSnapshot, area: PivotTableFiledAreaEnum): string[];
115
+
116
+ export declare function getInsertRowColMutations(accessor: IAccessor, view: PivotView, cellInfo: IPivotCellPositionInfo, isEmpty: boolean): {
117
+ undos: IMutationInfo<object>[];
118
+ redos: IMutationInfo<object>[];
119
+ };
120
+
121
+ export declare function getPivotCellInfo(row: number, col: number, cellInfo: Nullable<IPivotTableCellData>, pivotTable: PivotTable, pivotItemRenderCache: IPivotRenderCache): {
122
+ filterId: Nullable<string>;
123
+ info: Nullable<IPivotViewInfo>;
124
+ data: Nullable<IPivotTableCellData>;
125
+ headerInfo: Nullable<ILabelViewHeaderMapItem>;
126
+ } | undefined;
127
+
128
+ export declare function getPivotInfoByLicense(defaultPivotCount: number, ls?: string, pbk?: string): {
129
+ count: number;
130
+ timeValid: boolean;
131
+ };
132
+
133
+ export declare function getPivotTableInfo(pivotTable: PivotTable, pivotTableId: string, config: IPivotTableConfig): IPivotPanelDataInfo;
134
+
135
+ export declare interface IAddPivotFieldCommandParams {
136
+ unitId: string;
137
+ subUnitId: string;
138
+ pivotTableId: string;
139
+ dataFieldId: string;
140
+ fieldArea: PivotTableFiledAreaEnum;
141
+ index: number;
142
+ }
143
+
144
+ export declare interface IAddPivotFieldMutationParams {
145
+ unitId: string;
146
+ subUnitId: string;
147
+ pivotTableId: string;
148
+ fieldJson: IPivotTableValueFieldJSON | IPivotTableLabelFieldJSON;
149
+ area: PivotTableFiledAreaEnum;
150
+ index: number;
151
+ }
152
+
153
+ export declare interface IAddPivotTableCommandParams {
154
+ positionType: PositionType;
155
+ pivotTableId?: string;
156
+ pivotTableConfig: Omit<IPivotTableConfig, 'fieldsConfig'>;
157
+ }
158
+
159
+ declare interface IAddPivotTableMutationParams {
160
+ unitId: string;
161
+ subUnitId: string;
162
+ pivotTableId: string;
163
+ pivotTableConfig: IPivotTableConfig;
164
+ collectionConfig: IFieldsCollectionJSON;
165
+ }
166
+
167
+ declare interface ICollectionChangeInfo {
168
+ token: string;
169
+ type: CollectionChangeEnum;
170
+ dataRangeInfo?: IUnitRangeNameWithSubUnitId;
171
+ unitId?: string;
172
+ subUnitId?: string;
173
+ targetCellInfo?: IPivotCellPositionInfo;
174
+ oldSourceRangeInfo?: IUnitRangeNameWithSubUnitId;
175
+ }
176
+
177
+ declare interface ICurrentDataMatrix {
178
+ arrayFormulaCellDataMatrix: ObjectMatrix<Nullable<ICellData>> | undefined;
179
+ unitDataMatrix: ObjectMatrix<Nullable<ICellData>> | undefined;
180
+ }
181
+
182
+ declare interface IDataFieldManagerJSON extends IDataFieldManagerBaseJSON {
183
+ dataRanges: Record<string, IUnitRangeName>;
184
+ }
185
+
186
+ declare interface IFeatureDirtyRangeType {
187
+ [unitId: string]: Nullable<{
188
+ [sheetId: string]: IRange[];
189
+ }>;
190
+ }
191
+
192
+ declare interface IGetAddPivotFieldDataParams {
193
+ dataFieldId: string;
194
+ fieldArea: PivotTableFiledAreaEnum;
195
+ index: number;
196
+ }
197
+
198
+ declare interface IGetAddPivotTableDataParams {
199
+ sourceRangeInfo: IUnitRangeName & {
200
+ subUnitId: string;
201
+ };
202
+ }
203
+
204
+ declare interface IGetAddPivotTableWithConfigDataParams {
205
+ sourceRangeInfo: IUnitRangeName & {
206
+ subUnitId: string;
207
+ };
208
+ pivotTableIndexConfig: {
209
+ filters?: IPivotFieldConfig[];
210
+ rows?: IPivotFieldConfig[];
211
+ columns?: IPivotFieldConfig[];
212
+ values?: IValueFieldConfig[];
213
+ };
214
+ }
215
+
216
+ declare interface IGetMovePivotFieldDataParams {
217
+ fieldId: string;
218
+ area: PivotTableFiledAreaEnum;
219
+ index: number;
220
+ }
221
+
222
+ declare interface IGetPivotCollapseDataParams {
223
+ tableFieldId: string;
224
+ collapse: boolean;
225
+ item: string;
226
+ }
227
+
228
+ declare interface IGetPivotDataLocalMutationParams extends IPivotLocalMutationBaseParams {
229
+ version: string;
230
+ params: {
231
+ type: PivotDisplayDataType;
232
+ filter?: IGetPivotFilterPanelDataParams;
233
+ panel?: IGetPivotPanelDataParams;
234
+ addPivotField?: IGetAddPivotFieldDataParams;
235
+ addPivotTable?: IGetAddPivotTableDataParams;
236
+ movePivotField?: IGetMovePivotFieldDataParams;
237
+ removePivotField?: IGetRemovePivotFieldDataParams;
238
+ setPivotCollapse?: IGetPivotCollapseDataParams;
239
+ setPivotFilter?: IGetPivotFilterDataParams;
240
+ setPivotSort?: IGetPivotSortDataParams;
241
+ setPivotSetting?: IGetPivotSettingDataParams;
242
+ updatePivotSource?: IGetUpdatePivotSourceDataParams;
243
+ updateValuePosition?: IGetUpdateValuePositionDataParams;
244
+ addPivotTableWithConfig?: IGetAddPivotTableWithConfigDataParams;
245
+ drillDown?: IGetPivotDrillDownDataParams;
246
+ };
247
+ }
248
+
249
+ declare interface IGetPivotDrillDownDataParams {
250
+ tuple: string[][];
251
+ }
252
+
253
+ declare interface IGetPivotFilterDataParams {
254
+ tableFieldId: string;
255
+ items: string[];
256
+ isAll?: boolean;
257
+ }
258
+
259
+ declare interface IGetPivotFilterPanelDataParams {
260
+ row: number;
261
+ col: number;
262
+ tableFieldId?: string;
263
+ cellData?: IPivotTableCellData;
264
+ pivotItemRenderInfoCache?: IPivotRenderCache;
265
+ }
266
+
267
+ declare interface IGetPivotPanelDataParams {
268
+ pivotTableId: string;
269
+ }
270
+
271
+ declare interface IGetPivotSettingDataParams {
272
+ tableFieldId: string;
273
+ displayName?: string;
274
+ format?: string;
275
+ subtotalType?: PivotSubtotalTypeEnum;
276
+ }
277
+
278
+ declare interface IGetPivotSortDataParams {
279
+ tableFieldId: string;
280
+ info: IPivotTableSortInfo;
281
+ }
282
+
283
+ declare interface IGetRemovePivotFieldDataParams {
284
+ fieldIds: string[];
285
+ }
286
+
287
+ declare interface IGetUpdatePivotSourceDataParams {
288
+ dataRangeInfo: IUnitRangeNameWithSubUnitId;
289
+ unitId: string;
290
+ subUnitId: string;
291
+ }
292
+
293
+ declare interface IGetUpdateValuePositionDataParams {
294
+ position: PivotTableValuePositionEnum;
295
+ index: number;
296
+ }
297
+
298
+ export declare interface IMovePivotFieldCommandParams {
299
+ unitId: string;
300
+ subUnitId: string;
301
+ pivotTableId: string;
302
+ fieldId: string;
303
+ area: PivotTableFiledAreaEnum;
304
+ index: number;
305
+ }
306
+
307
+ declare interface IPivotAddPivotTableInfo {
308
+ view: PivotView;
309
+ isEmpty: boolean;
310
+ fieldsConfig: IPivotTableSnapshot;
311
+ collectionConfig: IFieldsCollectionJSON;
312
+ }
313
+
314
+ declare interface IPivotAreaViewInfo {
315
+ rowInfo: Record<string, IPivotViewInfo>;
316
+ colInfo: Record<string, IPivotViewInfo>;
317
+ cornerInfo: Record<string, IPivotViewInfo>;
318
+ }
319
+
320
+ export declare interface IPivotCellPositionInfo {
321
+ row: number;
322
+ col: number;
323
+ unitId: string;
324
+ subUnitId: string;
325
+ sheetName?: string;
326
+ }
327
+
328
+ declare interface IPivotDisplayBaseInfo {
329
+ view: IPivotViewJSON;
330
+ changesets: IPivotTableChangeSet[];
331
+ isEmpty: boolean;
332
+ pivotTableConfig: IPivotTableConfig;
333
+ }
334
+
335
+ declare interface IPivotDisplayFilterInfo {
336
+ tableFieldId: string;
337
+ pivotTableId: string;
338
+ items: string[];
339
+ itemTypes: PivotDataFieldDataTypeEnum[];
340
+ filterInfo: IPivotTableFilterInfo | undefined;
341
+ sortInfo: IPivotTableSortInfo | undefined;
342
+ format: string | undefined;
343
+ }
344
+
345
+ declare type IPivotDisplayPanelInfo = IPivotPanelDataInfo;
346
+
347
+ declare interface IPivotDisplayResult {
348
+ filter?: IPivotDisplayFilterInfo;
349
+ panel?: IPivotDisplayPanelInfo;
350
+ addPivotTable?: IPivotAddPivotTableInfo;
351
+ addPivotField?: IPivotDisplayBaseInfo;
352
+ movePivotField?: IPivotDisplayBaseInfo;
353
+ removePivotField?: IPivotDisplayBaseInfo;
354
+ setPivotCollapse?: IPivotDisplayBaseInfo;
355
+ setPivotFilter?: IPivotDisplayBaseInfo;
356
+ setPivotSort?: IPivotDisplayBaseInfo;
357
+ setPivotSetting?: IPivotDisplayBaseInfo;
358
+ updatePivotSource?: IPivotUpdatePivotSourceInfo;
359
+ updateValuePosition?: IPivotDisplayBaseInfo;
360
+ addPivotTableWithConfig?: IPivotAddPivotTableInfo & {
361
+ changesets: IPivotTableChangeSet[];
362
+ };
363
+ drillDown?: IPivotDrillDownInfo;
364
+ }
365
+
366
+ export declare interface IPivotDrillDownCommandParams {
367
+ row: number;
368
+ col: number;
369
+ }
370
+
371
+ declare interface IPivotDrillDownInfo {
372
+ indexes: number[];
373
+ range: IRange;
374
+ sourceUnitId: string;
375
+ sourceSubUnitId: string;
376
+ formatMap: Record<string, string>;
377
+ }
378
+
379
+ declare interface IPivotFieldConfig {
380
+ field: number;
381
+ selectedItems?: string[];
382
+ }
383
+
384
+ declare interface IPivotHeaderMap {
385
+ rowHeaderMap: Record<string, ILabelViewHeaderMapItem>;
386
+ colHeaderMap: Record<string, ILabelViewHeaderMapItem>;
387
+ }
388
+
389
+ declare interface IPivotHostInfo {
390
+ pivotTableId: string;
391
+ unitId: string;
392
+ subUnitId: string;
393
+ }
394
+
395
+ declare interface IPivotLocalMutationBaseParams {
396
+ unitId: string;
397
+ subUnitId: string;
398
+ pivotTableId: string;
399
+ }
400
+
401
+ declare interface IPivotMutationDirtyViewInfo {
402
+ unitId: string;
403
+ subUnitId: string;
404
+ token: string;
405
+ type: PivotTableOperationEnum;
406
+ pivotConfig?: IPivotTableConfig;
407
+ }
408
+
409
+ export declare interface IPivotPanelDataInfo {
410
+ sourceRange: IUnitRangeNameWithSubUnitId;
411
+ sourceList: IPivotPanelSourceList[];
412
+ rowFields: IPivotPanelTableListItemBase[];
413
+ columnFields: IPivotPanelTableListItemBase[];
414
+ valueFields: IPivotPanelTableListItemBase[];
415
+ filterFields: IPivotPanelTableListItemBase[];
416
+ positionInfo: IPivotTableConfig['targetCellInfo'];
417
+ }
418
+
419
+ export declare interface IPivotPanelSourceList {
420
+ id: string;
421
+ dataFieldId: string;
422
+ name: string;
423
+ type: PivotDataFieldDataTypeEnum;
424
+ checked: boolean;
425
+ pivotTableId: string;
426
+ }
427
+
428
+ export declare interface IPivotPanelTableListItemBase {
429
+ tableFieldId: string;
430
+ displayName: string;
431
+ dataFieldId: string;
432
+ format?: string;
433
+ subTotalType?: PivotSubtotalTypeEnum;
434
+ }
435
+
436
+ declare interface IPivotPerformCheckParams {
437
+ cellInfo: IPivotCellPositionInfo;
438
+ view: PivotView;
439
+ isEmpty: boolean;
440
+ }
441
+
442
+ export declare interface IPivotRangesInfo {
443
+ rowRanges: IRange[];
444
+ colRanges: IRange[];
445
+ cornerRanges: IRange[];
446
+ dataRanges: IRange[];
447
+ pageRanges: IRange[];
448
+ }
449
+
450
+ export declare interface IPivotRenderCache {
451
+ areaInfo?: IPivotAreaViewInfo;
452
+ rangesInfo?: IPivotRangesInfo;
453
+ headerMap?: IPivotHeaderMap;
454
+ }
455
+
456
+ export declare interface IPivotTableCellData {
457
+ v?: IPivotViewValueType;
458
+ /**
459
+ * pivot button type
460
+ */
461
+ pbt?: PivotCellStyleTypeEnum;
462
+ s?: string | IStyleData;
463
+ /**
464
+ * filter index
465
+ */
466
+ fi?: number;
467
+ t?: CellValueType;
468
+ }
469
+
470
+ export declare interface IPivotTableConfig {
471
+ targetCellInfo: IPivotCellPositionInfo;
472
+ sourceRangeInfo: IUnitRangeNameWithSubUnitId;
473
+ themeId?: string;
474
+ fieldsConfig: IPivotTableSnapshot;
475
+ isEmpty: boolean;
476
+ }
477
+
478
+ declare interface IPivotTableConfigChangeInfo {
479
+ unitId: string;
480
+ subUnitId: string;
481
+ type: PivotTableOperationEnum;
482
+ pivotTableId: string;
483
+ view?: Nullable<PivotView>;
484
+ }
485
+
486
+ declare interface IPivotTableJson {
487
+ dataFieldManagerConfig: Record<string, IDataFieldManagerJSON>;
488
+ pivotTableConfigs: Record<string, Record<string, Record<string, IPivotTableConfig>>>;
489
+ }
490
+
491
+ declare interface IPivotTableMatrixInfo {
492
+ matrix: ObjectMatrix<Nullable<IPivotTableCellData>>;
493
+ oldMatrix?: ObjectMatrix<Nullable<IPivotTableCellData>>;
494
+ }
495
+
496
+ declare interface IPivotTableRangeInfo {
497
+ rangeInfo?: IPivotRangesInfo;
498
+ oldRangeInfo?: IPivotRangesInfo;
499
+ }
500
+
501
+ declare interface IPivotTableViewDirtyMarkOperationParams {
502
+ [unitId: string]: {
503
+ [sunUnitId: string]: {
504
+ [token: string]: boolean;
505
+ };
506
+ };
507
+ }
508
+
509
+ declare interface IPivotUpdatePivotSourceInfo {
510
+ view: IPivotViewJSON;
511
+ changesets: IPivotTableChangeSet[];
512
+ isEmpty: boolean;
513
+ pivotTableConfig: IPivotTableConfig;
514
+ collectionConfig: IFieldsCollectionJSON;
515
+ oldCollectionConfig: IFieldsCollectionJSON;
516
+ deleteIds?: string[];
517
+ }
518
+
519
+ declare interface IPivotWorkerItemCache {
520
+ rangeCache?: IPivotRangesInfo;
521
+ matrix?: ObjectMatrix<Nullable<IPivotTableCellData>>;
522
+ oldRangeCache?: IPivotRangesInfo;
523
+ oldMatrix?: ObjectMatrix<Nullable<IPivotTableCellData>>;
524
+ }
525
+
526
+ export declare type IRangePosition = 'row' | 'col' | 'corner' | 'data';
527
+
528
+ export declare interface IRemovePivotFieldCommandParams {
529
+ unitId: string;
530
+ subUnitId: string;
531
+ pivotTableId: string;
532
+ fieldIds: string[];
533
+ }
534
+
535
+ export declare interface IRemovePivotFieldMutationParams {
536
+ unitId: string;
537
+ subUnitId: string;
538
+ pivotTableId: string;
539
+ fieldId: string;
540
+ area: PivotTableFiledAreaEnum;
541
+ index: number;
542
+ }
543
+
544
+ export declare interface IRemovePivotTableMutationParams {
545
+ unitId: string;
546
+ subUnitId: string;
547
+ pivotTableId: string;
548
+ }
549
+
550
+ export declare interface IRenamePivotFieldMutationParams {
551
+ unitId: string;
552
+ subUnitId: string;
553
+ pivotTableId: string;
554
+ name: string;
555
+ fieldId: string;
556
+ }
557
+
558
+ declare interface ISendPivotConfigLocalMutationParams {
559
+ unitId: string;
560
+ subUnitId: string;
561
+ oldSubUnitId: string;
562
+ pivotTableId: string;
563
+ pivotTableConfig: IPivotTableConfig;
564
+ collectionConfig: IDataFieldManagerJSON;
565
+ }
566
+
567
+ declare interface ISendPivotDataLocalMutationParams extends IPivotLocalMutationBaseParams {
568
+ version: string;
569
+ result: IPivotDisplayResult;
570
+ }
571
+
572
+ export declare interface ISetPivotCollapseCommandParams {
573
+ unitId: string;
574
+ subUnitId: string;
575
+ row: number;
576
+ col: number;
577
+ collapse: boolean;
578
+ }
579
+
580
+ export declare interface ISetPivotCollapseMutation {
581
+ unitId: string;
582
+ subUnitId: string;
583
+ pivotTableId: string;
584
+ fieldId: string;
585
+ collapse: boolean;
586
+ item?: string;
587
+ }
588
+
589
+ export declare interface ISetPivotFieldFormatMutationParams {
590
+ unitId: string;
591
+ subUnitId: string;
592
+ pivotTableId: string;
593
+ fieldId: string;
594
+ format: string | undefined;
595
+ }
596
+
597
+ export declare interface ISetPivotFilterCommandParams {
598
+ unitId: string;
599
+ subUnitId: string;
600
+ pivotTableId: string;
601
+ tableFieldId: string;
602
+ items: string[];
603
+ isAll?: boolean;
604
+ }
605
+
606
+ export declare interface ISetPivotFilterMutationParams {
607
+ unitId: string;
608
+ subUnitId: string;
609
+ pivotTableId: string;
610
+ fieldId: string;
611
+ filterInfo: IPivotTableFilterInfo;
612
+ isAll?: boolean;
613
+ }
614
+
615
+ export declare interface ISetPivotOptionMutationParams {
616
+ unitId: string;
617
+ subUnitId: string;
618
+ pivotTableId: string;
619
+ options: IPivotTableOptions;
620
+ }
621
+
622
+ export declare interface ISetPivotPositionMutationParams {
623
+ unitId: string;
624
+ subUnitId: string;
625
+ pivotTableId: string;
626
+ targetCellPosition: {
627
+ row: number;
628
+ col: number;
629
+ };
630
+ }
631
+
632
+ export declare interface ISetPivotSortCommandParams {
633
+ unitId: string;
634
+ subUnitId: string;
635
+ tableFieldId: string;
636
+ pivotTableId: string;
637
+ info: IPivotTableSortInfo;
638
+ }
639
+
640
+ export declare interface ISetPivotSortMutationParams {
641
+ unitId: string;
642
+ subUnitId: string;
643
+ pivotTableId: string;
644
+ fieldId: string;
645
+ sortInfo: IPivotTableSortInfo | undefined;
646
+ }
647
+
648
+ export declare interface ISetPivotSubtotalTypeMutationParams {
649
+ unitId: string;
650
+ subUnitId: string;
651
+ pivotTableId: string;
652
+ fieldId: string;
653
+ subtotalType: PivotSubtotalTypeEnum;
654
+ }
655
+
656
+ declare interface IThemeStyle {
657
+ rowStyle?: IStyleData;
658
+ colStyle?: IStyleData;
659
+ cornerStyle?: IStyleData;
660
+ pageStyle?: IStyleData;
661
+ dataStyle?: IStyleData;
662
+ blankStyle?: IStyleData;
663
+ subTotalStyle?: IStyleData;
664
+ leafStyle?: IStyleData;
665
+ grandTotal?: IStyleData;
666
+ }
667
+
668
+ export declare type IUnitRangeNameWithSubUnitId = IUnitRangeName & {
669
+ subUnitId: string;
670
+ };
671
+
672
+ declare interface IUniverSheetsPivotConfig {
673
+ notExecuteFormula?: boolean;
674
+ }
675
+
676
+ export declare interface IUpdateFieldPositionMutationParams {
677
+ unitId: string;
678
+ subUnitId: string;
679
+ pivotTableId: string;
680
+ fieldId: string;
681
+ area: PivotTableFiledAreaEnum;
682
+ index: number;
683
+ oldArea: PivotTableFiledAreaEnum;
684
+ oldIndex: number;
685
+ }
686
+
687
+ declare interface IUpdateInfo {
688
+ collection: FieldsCollection;
689
+ updateDataFieldList: {
690
+ index: number;
691
+ dataField: DataField;
692
+ }[];
693
+ }
694
+
695
+ export declare interface IUpdatePivotFieldSettingCommandParams {
696
+ unitId: string;
697
+ subUnitId: string;
698
+ tableFieldId: string;
699
+ pivotTableId: string;
700
+ displayName?: string;
701
+ format?: string;
702
+ subtotalType?: PivotSubtotalTypeEnum;
703
+ tableFieldInfo: IPivotPanelTableListItemBase;
704
+ dataFieldInfo: IPivotPanelSourceList;
705
+ }
706
+
707
+ export declare interface IUpdatePivotFieldSourceInfoMutationParams {
708
+ unitId: string;
709
+ subUnitId: string;
710
+ pivotTableId: string;
711
+ dataFieldId: string;
712
+ sourceName: string;
713
+ tableFieldId: string;
714
+ }
715
+
716
+ export declare interface IUpdatePivotTableSourceRangeCommandParams {
717
+ unitId: string;
718
+ subUnitId: string;
719
+ token: string;
720
+ dataRangeInfo: IUnitRangeNameWithSubUnitId;
721
+ }
722
+
723
+ declare interface IUpdatePivotTableSourceRangeMutationParams {
724
+ pivotTableId: string;
725
+ deleteIds: string[];
726
+ collectionJSON: IFieldsCollectionJSON;
727
+ dataRangeInfo: IUnitRangeNameWithSubUnitId;
728
+ unitId: string;
729
+ subUnitId: string;
730
+ }
731
+
732
+ export declare interface IUpdatePivotValuePositionCommandParams {
733
+ pivotTableId: string;
734
+ position: PivotTableValuePositionEnum;
735
+ index: number;
736
+ }
737
+
738
+ export declare interface IUpdateValuePositionMutationParams {
739
+ unitId: string;
740
+ subUnitId: string;
741
+ pivotTableId: string;
742
+ valuePosition: PivotTableValuePositionEnum;
743
+ index: number;
744
+ }
745
+
746
+ declare interface IValueFieldConfig {
747
+ field: number;
748
+ subTotalType?: PivotSubtotalTypeEnum;
749
+ formatString?: string;
750
+ }
751
+
752
+ declare interface IViewTranslateCtx {
753
+ view: Nullable<PivotView>;
754
+ pivotTableId: string;
755
+ isEmpty: boolean;
756
+ targetCellInfo: IPivotCellPositionInfo;
757
+ textInfo: Record<string, string>;
758
+ }
759
+
760
+ export declare const MovePivotFieldCommand: ICommand<IMovePivotFieldCommandParams>;
761
+
762
+ export declare enum PivotDisplayDataType {
763
+ Filter = "filter",
764
+ Panel = "panel",
765
+ AddPivotField = "addPivotField",
766
+ AddPivotTableWithConfig = "AddPivotTableWithConfig",
767
+ AddPivotTable = "addPivotTable",
768
+ MovePivotField = "movePivotField",
769
+ RemovePivotField = "removePivotField",
770
+ SetPivotCollapse = "setPivotCollapse",
771
+ SetPivotFilter = "setPivotFilter",
772
+ SetPivotSort = "setPivotSort",
773
+ SetPivotSetting = "setPivotSetting",
774
+ UpdatePivotSource = "updatePivotSource",
775
+ UpdateValuePosition = "updateValuePosition",
776
+ DrillDown = "drillDown"
777
+ }
778
+
779
+ export declare const PivotDrillDownCommand: ICommand<IPivotDrillDownCommandParams>;
780
+
781
+ export declare enum PivotTableOperationEnum {
782
+ Add = "add",
783
+ Set = "set",
784
+ Delete = "delete"
785
+ }
786
+
787
+ export declare const PivotTableViewDirtyMarkOperation: IMutation<IPivotTableViewDirtyMarkOperationParams>;
788
+
789
+ export declare enum PositionType {
790
+ Exiting = "exiting",
791
+ New = "new"
792
+ }
793
+
794
+ export declare const RemovePivotFieldCommand: ICommand<IRemovePivotFieldCommandParams>;
795
+
796
+ export declare const RemovePivotFieldMutation: IMutation<IRemovePivotFieldMutationParams>;
797
+
798
+ export declare const RemovePivotTableMutation: IMutation<IRemovePivotTableMutationParams>;
799
+
800
+ export declare const RenamePivotFieldMutation: IMutation<IRenamePivotFieldMutationParams>;
801
+
802
+ export declare const SetPivotCollapseCommand: ICommand<ISetPivotCollapseCommandParams>;
803
+
804
+ export declare const SetPivotCollapseMutation: IMutation<ISetPivotCollapseMutation>;
805
+
806
+ export declare const SetPivotFieldFormatMutation: IMutation<ISetPivotFieldFormatMutationParams>;
807
+
808
+ export declare const SetPivotFilterCommand: ICommand<ISetPivotFilterCommandParams>;
809
+
810
+ export declare const SetPivotFilterMutation: IMutation<ISetPivotFilterMutationParams>;
811
+
812
+ export declare const SetPivotOptionMutation: IMutation<ISetPivotOptionMutationParams>;
813
+
814
+ export declare const SetPivotPositionMutation: IMutation<ISetPivotPositionMutationParams>;
815
+
816
+ export declare const SetPivotSortCommand: ICommand<ISetPivotSortCommandParams>;
817
+
818
+ export declare const SetPivotSortMutation: IMutation<ISetPivotSortMutationParams>;
819
+
820
+ export declare const SetPivotSubtotalTypeMutation: IMutation<ISetPivotSubtotalTypeMutationParams>;
821
+
822
+ export declare const SHEET_PIVOT_TABLE_PLUGIN = "SHEET_PIVOT_TABLE_PLUGIN";
823
+
824
+ declare class SheetsPivotDataFieldManager extends DataFieldManager {
825
+ /**
826
+ * the key is pivot table id, the value is the data range info. those data range is one-to-one with the pivot table
827
+ */
828
+ rangeKeyMap: Record<string, string>;
829
+ private _univerInstanceService;
830
+ _host: SheetsPivotDataSourceModel;
831
+ constructor(host: SheetsPivotDataSourceModel, univerInstanceService: IUniverInstanceService);
832
+ initDataRanges(): void;
833
+ getAutoDisplayNameFunction(): (baseName: string, subtotalType: PivotSubtotalTypeEnum) => string;
834
+ deleteDataField(dataFieldId: string): void;
835
+ removeCollectionImp(token: string): void;
836
+ getRangeKey(rangeInfo: IUnitRangeName, colIndex: number): string;
837
+ getDataFieldByRangeKey(rangeKey: string): DataField | undefined;
838
+ setRangeKeyMap(rangeKey: string, dataFieldId: string): void;
839
+ updateRangeKeyMap(oldRangeKey: string, newRangeKey: string): void;
840
+ addCollectionByJSON(token: string, collectionJSON: IFieldsCollectionJSON, sourceRangeInfo: IUnitRangeNameWithSubUnitId, targetCellInfo: IPivotCellPositionInfo): IUpdateInfo;
841
+ getRangeStartEndInfo(range: IRange, sheet: Worksheet): IRange;
842
+ /**
843
+ * - when add pivot table, we should create a collection with data range first
844
+ * @param {IUnitRangeName} dataRangeInfo the data range info
845
+ * @returns {FieldsCollection} the created collection
846
+ */
847
+ createCollectionWithDataRange(dataRangeInfo: IUnitRangeName): IUpdateInfo;
848
+ _getAutoName(colIndex: number): string;
849
+ uniqueDataFieldName(name: IDataFieldValue, colIndex: number): string;
850
+ getCollection(token: string): FieldsCollection;
851
+ addCollection(token: string, collection: FieldsCollection, sourceRangeInfo: IUnitRangeNameWithSubUnitId, targetCellInfo: IPivotCellPositionInfo): void;
852
+ handleMoveRange(token: string, sourceRangeInfo: IUnitRangeNameWithSubUnitId): void;
853
+ getPivotDirtyViewInfo(): {
854
+ runtimeCellData: IRuntimeUnitDataType;
855
+ dirtyRanges: IFeatureDirtyRangeType;
856
+ };
857
+ getUpdateRangeDeleteIds(token: string, dataRangeInfo: IUnitRangeName): string[] | undefined;
858
+ /**
859
+ * get the matrix value from different matrix, when refresh the data source of pivot table
860
+ * @param matrix the sheet cell matrix
861
+ * @param arrayFormulaCellDataMatrix the array formula cell data matrix from run time data
862
+ * @param unitDataMatrix the unit data matrix from runtime data
863
+ * @param {number} rowIndex - the row index
864
+ * @param {number} colIndex - the column index
865
+ * @returns {Nullable<ICellData>} the cell data
866
+ */
867
+ getMatrixValue(matrix: ObjectMatrix<Nullable<ICellData>>, arrayFormulaCellDataMatrix: ObjectMatrix<Nullable<ICellData>> | undefined, unitDataMatrix: ObjectMatrix<Nullable<ICellData>> | undefined, rowIndex: number, colIndex: number): Nullable<ICellData>;
868
+ refreshDataField(dataFieldId: string, dataRangeInfo: IUnitRangeNameWithSubUnitId, index: number, currentDataMatrix?: ICurrentDataMatrix): void;
869
+ refreshData(collection: FieldsCollection, list: {
870
+ index: number;
871
+ dataField: DataField;
872
+ }[], dataRangeInfo: IUnitRangeNameWithSubUnitId): void;
873
+ getRangeKeyList(dataRangeInfo: IUnitRangeName): string[];
874
+ /**
875
+ * - adjust sheet cell value to the type that pivot engine can recognize
876
+ * @param {Nullable<ICellData>} cellData the cell data
877
+ * @param {Styles} styles styles in the workbook
878
+ * @param {Record<string, any>} patternInfoRecord the pattern info record
879
+ * @returns {IDataFieldValue} the value to add into the data field
880
+ */
881
+ adjustSheetCellData(cellData: Nullable<ICellData>, styles: Styles, patternInfoRecord: Record<string, any>): IDataFieldValue;
882
+ getRangeData(dataRangeInfo: IUnitRangeName): {
883
+ header: (string | null)[];
884
+ data: IDataFieldValue[][];
885
+ };
886
+ toJSON(): IDataFieldManagerJSON;
887
+ fromJSON(jsonData: IDataFieldManagerJSON): void;
888
+ dispose(): void;
889
+ }
890
+
891
+ export declare class SheetsPivotDataSourceModel extends Disposable_2 {
892
+ private readonly _injector;
893
+ private readonly _univerInstanceService;
894
+ readonly _lifecycleService: LifecycleService;
895
+ private readonly _configService;
896
+ private readonly _commandService;
897
+ private _resourceManagerService;
898
+ private _model;
899
+ private _pivotTableInstanceCache;
900
+ private _viewData;
901
+ private _textInfo;
902
+ private _collectionChange$;
903
+ collectionChange$: Observable<ICollectionChangeInfo>;
904
+ private _viewData$;
905
+ viewData$: Observable< {
906
+ unitId: string;
907
+ subUnitId: string;
908
+ pivotTableId: string;
909
+ }>;
910
+ private _fieldsCollectionChange$;
911
+ fieldsCollectionChange$: Observable<Record<string, FieldsCollection>>;
912
+ private _dataFieldManagerCollection;
913
+ needSameDeleteModel: {
914
+ deleteUnitId: (unitId: string) => void;
915
+ }[];
916
+ /**
917
+ * - this property is used to store the dirty pivot table collection which need to be marked dirty when mutations is executed
918
+ */
919
+ private _queryingMap;
920
+ constructor(_injector: Injector, _univerInstanceService: IUniverInstanceService, _lifecycleService: LifecycleService, _configService: IConfigService, _commandService: ICommandService, _resourceManagerService: IResourceManagerService);
921
+ getTextInfo(): Record<string, string>;
922
+ setTextInfo(textInfo: Record<string, string>): void;
923
+ handleMoveRange(params: IMoveRangeMutationParams): void;
924
+ broadcastCollectionChange(info: ICollectionChangeInfo): void;
925
+ getDataFieldManager(unitId: string): SheetsPivotDataFieldManager;
926
+ getCollection(unitId: string, token: string): FieldsCollection;
927
+ getUpdateRangeDeleteIds(unitId: string, token: string, dataRangeInfo: IUnitRangeName): string[] | undefined;
928
+ private _ensurePivotMap;
929
+ private _updateModelCache;
930
+ private _deleteModelCache;
931
+ private _updatePivotTableInstanceCache;
932
+ private _deletePivotTableInstanceCache;
933
+ private _ensureViewDataMap;
934
+ updateConfig(info: ISendPivotConfigLocalMutationParams): void;
935
+ updateView(unitId: string, subUnitId: string, type: PivotTableOperationEnum, pivotTableId: string, view: Nullable<PivotView>, pivotConfig: Nullable<IPivotTableConfig>, collectionConfig?: IDataFieldManagerJSON, ignoreDirty?: boolean): void;
936
+ /**
937
+ * - the function is used to save the dirty view data and range for formula calculation
938
+ * @param {IViewTranslateCtx} ctx the dirty context
939
+ * @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
940
+ */
941
+ updateViewData(ctx: IViewTranslateCtx, ignoreDirty: boolean): void;
942
+ addPivotTable(unitId: string, subUnitId: string, pivotTableId: string, pivotTable: PivotTable, pivotTableConfig: IPivotTableConfig): void;
943
+ removePivotTable(unitId: string, subUnitId: string, pivotTableId: string): void;
944
+ setPivotTable(unitId: string, subUnitId: string, pivotTableId: string, pivotTableConfig: IPivotTableConfig): void;
945
+ getPivotTableConfig(unitId: string, subUnitId: string, pivotTableId: string): IPivotTableConfig | undefined;
946
+ /**
947
+ * - get the pivot table model json config
948
+ * @param {string} unitId
949
+ * @param {string} subUnitId
950
+ * @param {string} pivotTableId - the pivot table id
951
+ * @returns {IPivotTableSnapshot|undefined} the pivot table model json config
952
+ */
953
+ getPivotTableModelConfig(unitId: string, subUnitId: string, pivotTableId: string): IPivotTableSnapshot | undefined;
954
+ getPivotTableInstance(pivotTableId: string): PivotTable | undefined;
955
+ deleteUnitId(unitId: string): void;
956
+ addCollectionByJSON(token: string, collectionJSON: IFieldsCollectionJSON, sourceRangeInfo: IUnitRangeNameWithSubUnitId, targetCellInfo: IPivotCellPositionInfo): IUpdateInfo;
957
+ /**
958
+ * - this function just create a collection with data range info, but wil not add it to the dataFieldManager
959
+ */
960
+ createCollectionWithDataRange(dataRangeInfo: IUnitRangeNameWithSubUnitId): IUpdateInfo;
961
+ refreshData(collection: FieldsCollection, updateDataFieldList: {
962
+ index: number;
963
+ dataField: DataField;
964
+ }[], dataRangeInfo: IUnitRangeNameWithSubUnitId): void;
965
+ removeDataField(unitId: string, dataFieldId: string): void;
966
+ removeCollections(unitId: string, token: string): void;
967
+ getSubUnitPivotConfigs(unitId: string, subUnitId: string): Map<string, IPivotTableConfig> | undefined;
968
+ getTargetByPivotId(pivotTableId: string): {
969
+ unitId: string;
970
+ subUnitId: string;
971
+ } | null;
972
+ sideEffectUpdateWorkerCache(unitId: string, subUnitId: string, pivotTableId: string, workerCache?: IPivotWorkerItemCache): void;
973
+ dispose(): void;
974
+ getViewData(unitId: string, subUnitId: string, pivotTableId: string): IPivotWorkerItemCache | null;
975
+ addDirtyPivotTable(dirtyInfo: IPivotMutationDirtyViewInfo): void;
976
+ updateDirtyPivotTable(dirtyInfo: IPivotMutationDirtyViewInfo): void;
977
+ /**
978
+ * trigger the pivot table query
979
+ * @param dirtyInfo
980
+ */
981
+ queryDirtyPivotTable(dirtyInfo: IPivotMutationDirtyViewInfo): void;
982
+ toJSON(unitId: string): IPivotTableJson;
983
+ fromJSON(jsonData: IPivotTableJson): void;
984
+ private _initSnapshot;
985
+ }
986
+
987
+ export declare class SheetsPivotRPCService extends Disposable_2 {
988
+ private readonly _injector;
989
+ private readonly _commandService;
990
+ private _requestResolvers;
991
+ constructor(_injector: Injector, _commandService: ICommandService);
992
+ handleAsyncResponse(data: ISendPivotDataLocalMutationParams): void;
993
+ getPivotDisplayConfig(params: Omit<IGetPivotDataLocalMutationParams, 'version'>): Promise<ISendPivotDataLocalMutationParams>;
994
+ private _generateUniqueVersion;
995
+ }
996
+
997
+ export declare class SheetsPivotTableAdaptorModel extends Disposable_2 {
998
+ private _localeService;
999
+ private _injector;
1000
+ private _sheetsPivotTableConfigModel;
1001
+ private _univerInstanceService;
1002
+ private readonly _exclusiveRangeService;
1003
+ private _pivotRenderInfoCache;
1004
+ private _pivotRenderValueMatrixCache;
1005
+ private _markDirty$;
1006
+ markDirty$: Observable< {
1007
+ unitId: string;
1008
+ subUnitId: string;
1009
+ }>;
1010
+ private _viewUpdate$;
1011
+ viewUpdate$: Observable< {
1012
+ unitId: string;
1013
+ subUnitId: string;
1014
+ pivotTableId: string;
1015
+ rangesCache: IPivotRangesInfo | undefined;
1016
+ valueMatrix: ObjectMatrix<Nullable<IPivotTableCellData>>;
1017
+ type: PivotTableOperationEnum;
1018
+ }>;
1019
+ private _textInfo;
1020
+ constructor(_localeService: LocaleService, _injector: Injector, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _univerInstanceService: IUniverInstanceService, _exclusiveRangeService: IExclusiveRangeService);
1021
+ private _initUnitDisposed;
1022
+ private _initLocale;
1023
+ updateRenderCache(config: IPivotTableConfigChangeInfo): {
1024
+ rangeCache: IPivotRangesInfo | undefined;
1025
+ matrix: ObjectMatrix<Nullable<IPivotTableCellData>>;
1026
+ } | undefined;
1027
+ private _updateRenderEmptyCache;
1028
+ private _createExclusiveRange;
1029
+ clearRenderCache(config: IPivotTableConfigChangeInfo): void;
1030
+ private _ensurePivotItemRenderInfoCache;
1031
+ private _ensurePivotItemRenderValueMatrixCache;
1032
+ getPivotTableCellData(unitId: string, subUnitId: string, row: number, col: number): IPivotTableCellData | undefined;
1033
+ getPivotTableIdByCell(unitId: string, subUnitId: string, row: number, col: number): Nullable<string>;
1034
+ /**
1035
+ * Get pivot table ids that intersect with the range
1036
+ * @param {string} unitId The test unit id of range
1037
+ * @param {string} subUnitId The sub unit id of range
1038
+ * @param {IRange} range The range to check
1039
+ * @returns {string[]} The pivot table ids that intersect with the range
1040
+ */
1041
+ getIntersectsPivotTable(unitId: string, subUnitId: string, range: IRange): string[];
1042
+ getSubUnitPivotMatrix(unitId: string, subUnitId: string): ObjectMatrix<Nullable<IPivotTableCellData>>;
1043
+ getPivotItemRenderInfoCache(unitId: string, subUnitId: string, pivotTableId: string): Nullable<IPivotRenderCache>;
1044
+ deleteUnitId(unitId: string): void;
1045
+ markDirty(unitId: string, subUnitId: string): void;
1046
+ }
1047
+
1048
+ export declare class SheetsPivotTableConfigModel extends Disposable_2 {
1049
+ private _injector;
1050
+ private _commandService;
1051
+ private _univerInstanceService;
1052
+ private _model;
1053
+ private _collectionConfigModel;
1054
+ private _pivotTableRangeInfo;
1055
+ private _pivotTableMatrixInfo;
1056
+ private _configVersion$;
1057
+ private _pivotInitCompleted$;
1058
+ pivotInitCompleted$: Observable<boolean>;
1059
+ private _pivotConfigChange$;
1060
+ pivotConfigChange$: Observable< {
1061
+ unitId: string;
1062
+ subUnitId: string;
1063
+ pivotTableId: string;
1064
+ pivotTableConfig: Nullable<IPivotTableConfig>;
1065
+ }>;
1066
+ private _textInfo;
1067
+ configVersion$: Observable<number>;
1068
+ constructor(_injector: Injector, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService);
1069
+ private _initUnitDisposed;
1070
+ setPivotInitCompleted(): void;
1071
+ private _initLocale;
1072
+ getTextInfo(): Record<string, string>;
1073
+ updateViewInfo(unitId: string, subUnitId: string, pivotTableId: string, valueMatrix: ObjectMatrix<Nullable<IPivotTableCellData>>, rangesCache: IPivotRangesInfo | undefined): void;
1074
+ getPivotTableConfig(unitId: string, subUnitId: string, pivotTableId: string): Nullable<IPivotTableConfig>;
1075
+ getTargetByPivotId(unitId: string, subUnitId: string, pivotTableId: string): Nullable<IPivotCellPositionInfo>;
1076
+ getSubUnitPivotConfigs(unitId: string, subUnitId: string): Map<string, IPivotTableConfig> | undefined;
1077
+ updateConfigCache(unitId: string, subUnitId: string, pivotTableId: string, pivotTableConfig: Nullable<IPivotTableConfig>): void;
1078
+ getCollection(unitId: string, pivotTableId: string): IFieldsCollectionJSON | undefined;
1079
+ updateCollectionConfig(unitId: string, collectionConfig: IDataFieldManagerJSON): void;
1080
+ private _ensurePivotMap;
1081
+ private _ensurePivotTableRangeInfo;
1082
+ private _ensurePivotTableMatrixInfo;
1083
+ updatePivotTableRangeInfo(unitId: string, subUnitId: string, pivotTableId: string, rangeInfo: IPivotRangesInfo | undefined): void;
1084
+ updatePivotTableMatrixInfo(unitId: string, subUnitId: string, pivotTableId: string, matrixInfo: ObjectMatrix<Nullable<IPivotTableCellData>>): void;
1085
+ /**
1086
+ * - get the pivot table range info for sheet or calc engine
1087
+ * @param {string} unitId - the unit id
1088
+ * @param {string} subUnitId - the sub unit id
1089
+ * @param {string} pivotTableId - the pivot table id
1090
+ * @returns {IPivotTableRangeInfo} - the pivot table range info
1091
+ */
1092
+ getPivotTableRangeInfo(unitId: string, subUnitId: string, pivotTableId: string): IPivotTableRangeInfo | undefined;
1093
+ /**
1094
+ * - get the pivot table matrix info for sheet or calc engine
1095
+ * @param {string} unitId - the unit id
1096
+ * @param {string} subUnitId - the sub unit id
1097
+ * @param {string} pivotTableId - the pivot table id
1098
+ * @returns {IPivotTableMatrixInfo} - the pivot table matrix info
1099
+ */
1100
+ getPivotTableMatrixInfo(unitId: string, subUnitId: string, pivotTableId: string): IPivotTableMatrixInfo | undefined;
1101
+ deleteUnitId(unitId: string): void;
1102
+ }
1103
+
1104
+ export declare class SheetsPivotTableService extends Disposable_2 {
1105
+ private _sheetInterceptorService;
1106
+ private _sheetsPivotTableAdaptorModel;
1107
+ readonly asyncInterceptor: AsyncInterceptorManager<{
1108
+ PIVOT_PERFORM_CHECK: IAsyncInterceptor<boolean, IPivotPerformCheckParams>;
1109
+ }>;
1110
+ readonly interceptor: InterceptorManager<{
1111
+ PIVOT_MUTATION_GENERATE: IInterceptor<IUndoRedoCommandInfosByInterceptor, IPivotPerformCheckParams>;
1112
+ }>;
1113
+ constructor(_sheetInterceptorService: SheetInterceptorService, _sheetsPivotTableAdaptorModel: SheetsPivotTableAdaptorModel);
1114
+ private _init;
1115
+ getPivotPerformCheck(params: IPivotPerformCheckParams): Promise<Nullable<boolean>>;
1116
+ private _initViewModelBySheetInterceptor;
1117
+ }
1118
+
1119
+ export declare function transFromCellValue(cellData: IPivotViewCellData, isValue: boolean, format: string | undefined, textInfo: Record<string, string>): IPivotViewValueType;
1120
+
1121
+ export declare const unionPivotViewRange: (rangeInfo: IPivotRangesInfo | undefined) => IRange[];
1122
+
1123
+ export declare class UniverSheetsPivotTablePlugin extends Plugin_2 {
1124
+ private readonly _config;
1125
+ readonly _injector: Injector;
1126
+ private readonly _commandService;
1127
+ private readonly _configService;
1128
+ private readonly _dataSyncPrimaryController?;
1129
+ static pluginName: string;
1130
+ static type: UniverInstanceType;
1131
+ constructor(_config: IUniverSheetsPivotConfig | undefined, _injector: Injector, _commandService: ICommandService, _configService: IConfigService, _dataSyncPrimaryController?: DataSyncPrimaryController | undefined);
1132
+ _initConfig(): void;
1133
+ onStarting(): void;
1134
+ private _initRegisterCommand;
1135
+ private _initTimeValid;
1136
+ }
1137
+
1138
+ export declare const UpdateFieldPositionMutation: IMutation<IUpdateFieldPositionMutationParams>;
1139
+
1140
+ export declare const UpdatePivotFieldSettingCommand: ICommand<IUpdatePivotFieldSettingCommandParams>;
1141
+
1142
+ export declare const UpdatePivotFieldSourceInfoMutation: IMutation<IUpdatePivotFieldSourceInfoMutationParams>;
1143
+
1144
+ export declare const UpdatePivotTableSourceRangeCommand: ICommand<IUpdatePivotTableSourceRangeCommandParams>;
1145
+
1146
+ export declare const UpdatePivotTableSourceRangeMutation: IMutation<IUpdatePivotTableSourceRangeMutationParams>;
1147
+
1148
+ export declare const UpdatePivotValuePositionCommand: ICommand<IUpdatePivotValuePositionCommandParams>;
1149
+
1150
+ export declare const UpdateValuePositionMutation: IMutation<IUpdateValuePositionMutationParams>;
1151
+
1152
+ export { }
1153
+
1154
+
1155
+ declare module '@univerjs/sheets/facade' {
1156
+ interface FWorkbook extends IFWorkbookSheetsPivotMixin {
1157
+ }
1158
+ }