@univerjs-pro/sheets-pivot 0.2.7

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 (51) hide show
  1. package/README.md +34 -0
  2. package/lib/cjs/index.js +1 -0
  3. package/lib/es/index.js +1 -0
  4. package/lib/locale/en-US.json +30 -0
  5. package/lib/locale/ru-RU.json +30 -0
  6. package/lib/locale/vi-VN.json +30 -0
  7. package/lib/locale/zh-CN.json +30 -0
  8. package/lib/locale/zh-TW.json +30 -0
  9. package/lib/types/commands/command/add-pivot-table-with-config.command.d.ts +4 -0
  10. package/lib/types/commands/command/util.d.ts +13 -0
  11. package/lib/types/commands/mutations/add-pivot-field.mutation.d.ts +4 -0
  12. package/lib/types/commands/mutations/add-pivot-table.mutation.d.ts +4 -0
  13. package/lib/types/commands/mutations/change-apply-util.d.ts +15 -0
  14. package/lib/types/commands/mutations/pivot-data-communication.mutation.d.ts +7 -0
  15. package/lib/types/commands/mutations/remove-pivot-field.mutation.d.ts +4 -0
  16. package/lib/types/commands/mutations/remove-pivot-table.mutation.d.ts +4 -0
  17. package/lib/types/commands/mutations/rename-pivot-field.mutation.d.ts +4 -0
  18. package/lib/types/commands/mutations/set-pivot-collapse.mutation.d.ts +4 -0
  19. package/lib/types/commands/mutations/set-pivot-field-format.mutation.d.ts +4 -0
  20. package/lib/types/commands/mutations/set-pivot-filter.mutation.d.ts +4 -0
  21. package/lib/types/commands/mutations/set-pivot-option.mutation.d.ts +4 -0
  22. package/lib/types/commands/mutations/set-pivot-position.mutation.d.ts +4 -0
  23. package/lib/types/commands/mutations/set-pivot-sort.mutation.d.ts +4 -0
  24. package/lib/types/commands/mutations/set-pivot-subtotal-type.mutation.d.ts +4 -0
  25. package/lib/types/commands/mutations/update-field-position.mutation.d.ts +4 -0
  26. package/lib/types/commands/mutations/update-pivot-field-source-info.mutation.d.ts +4 -0
  27. package/lib/types/commands/mutations/update-pivot-table-source.mutation.d.ts +4 -0
  28. package/lib/types/commands/mutations/update-value-position.mutation.d.ts +4 -0
  29. package/lib/types/commands/operations/pivot-table-dirty-view.operation.d.ts +4 -0
  30. package/lib/types/const/const.d.ts +95 -0
  31. package/lib/types/const/template.d.ts +886 -0
  32. package/lib/types/const/type.d.ts +492 -0
  33. package/lib/types/controllers/sheets-pivot-caculate.controller.d.ts +44 -0
  34. package/lib/types/controllers/sheets-pivot-rpc.controller.d.ts +21 -0
  35. package/lib/types/index.d.ts +28 -0
  36. package/lib/types/locale/en-US.d.ts +4 -0
  37. package/lib/types/locale/ru-RU.d.ts +4 -0
  38. package/lib/types/locale/vi-VN.d.ts +4 -0
  39. package/lib/types/locale/zh-CN.d.ts +31 -0
  40. package/lib/types/locale/zh-TW.d.ts +4 -0
  41. package/lib/types/models/sheets-pivot-config-model.d.ts +58 -0
  42. package/lib/types/models/sheets-pivot-data-field-manager.d.ts +99 -0
  43. package/lib/types/models/sheets-pivot-data-source-model.d.ts +136 -0
  44. package/lib/types/models/sheets-pivot-table-adaptor-model.d.ts +43 -0
  45. package/lib/types/models/view-util.d.ts +17 -0
  46. package/lib/types/plugin.d.ts +21 -0
  47. package/lib/types/services/sheets-pivot-rpc.service.d.ts +12 -0
  48. package/lib/types/services/sheets-pivot-table.service.d.ts +11 -0
  49. package/lib/types/util.d.ts +40 -0
  50. package/lib/umd/index.js +1 -0
  51. package/package.json +94 -0
@@ -0,0 +1,492 @@
1
+ import { IDataFieldManagerBaseJSON, IFieldsCollectionJSON, ILabelViewHeaderMapItem, IPivotTableChangeSet, IPivotTableFilterInfo, IPivotTableLabelFieldJSON, IPivotTableOptions, IPivotTableSnapshot, IPivotTableSortInfo, IPivotTableValueFieldJSON, IPivotViewInfo, IPivotViewJSON, IPivotViewValueType, PivotCellStyleTypeEnum, PivotDataFieldDataTypeEnum, PivotSubtotalTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum, PivotView } from '@univerjs-pro/pivot-engine';
2
+ import { CellValueType, ICellData, IRange, IStyleData, IUnitRangeName, Nullable, ObjectMatrix } from '@univerjs/core';
3
+ import { PivotDisplayDataType, PositionType } from './const';
4
+
5
+ export interface IPivotTableConfigChangeInfo {
6
+ unitId: string;
7
+ subUnitId: string;
8
+ type: PivotTableOperationEnum;
9
+ pivotTableId: string;
10
+ view?: Nullable<PivotView>;
11
+ }
12
+ export declare enum CollectionChangeEnum {
13
+ add = "add",
14
+ delete = "delete"
15
+ }
16
+ export type IUnitRangeNameWithSubUnitId = IUnitRangeName & {
17
+ subUnitId: string;
18
+ };
19
+ export interface ICollectionChangeInfo {
20
+ token: string;
21
+ type: CollectionChangeEnum;
22
+ dataRangeInfo?: IUnitRangeNameWithSubUnitId;
23
+ unitId?: string;
24
+ subUnitId?: string;
25
+ targetCellInfo?: IPivotCellPositionInfo;
26
+ }
27
+ export interface IAddPivotTableParams {
28
+ pivotTableConfig: IPivotTableConfig;
29
+ }
30
+ export interface IAddPivotTableCommandParams {
31
+ positionType: PositionType;
32
+ pivotTableConfig: IPivotTableConfig;
33
+ }
34
+ export interface IUpdatePivotTableSourceRangeMutationParams {
35
+ pivotTableId: string;
36
+ deleteIds: string[];
37
+ collectionJSON: IFieldsCollectionJSON;
38
+ dataRangeInfo: IUnitRangeNameWithSubUnitId;
39
+ unitId: string;
40
+ subUnitId: string;
41
+ }
42
+ export interface IAddPivotTableMutationParams {
43
+ unitId: string;
44
+ subUnitId: string;
45
+ pivotTableId: string;
46
+ pivotTableConfig: IPivotTableConfig;
47
+ collectionConfig: IFieldsCollectionJSON;
48
+ }
49
+ export interface IAddPivotFieldMutationParams {
50
+ unitId: string;
51
+ subUnitId: string;
52
+ pivotTableId: string;
53
+ fieldJson: IPivotTableValueFieldJSON | IPivotTableLabelFieldJSON;
54
+ area: PivotTableFiledAreaEnum;
55
+ index: number;
56
+ }
57
+ export interface IRemovePivotFieldMutationParams {
58
+ unitId: string;
59
+ subUnitId: string;
60
+ pivotTableId: string;
61
+ fieldId: string;
62
+ area: PivotTableFiledAreaEnum;
63
+ index: number;
64
+ }
65
+ export interface IRenamePivotFieldMutationParams {
66
+ unitId: string;
67
+ subUnitId: string;
68
+ pivotTableId: string;
69
+ name: string;
70
+ fieldId: string;
71
+ }
72
+ export interface ISetPivotSortMutationParams {
73
+ unitId: string;
74
+ subUnitId: string;
75
+ pivotTableId: string;
76
+ fieldId: string;
77
+ sortInfo: IPivotTableSortInfo | undefined;
78
+ }
79
+ export interface ISetPivotOptionMutationParams {
80
+ unitId: string;
81
+ subUnitId: string;
82
+ pivotTableId: string;
83
+ options: IPivotTableOptions;
84
+ }
85
+ export interface ISetPivotFieldFormatMutationParams {
86
+ unitId: string;
87
+ subUnitId: string;
88
+ pivotTableId: string;
89
+ fieldId: string;
90
+ format: string | undefined;
91
+ }
92
+ export interface IUpdateFieldPositionMutationParams {
93
+ unitId: string;
94
+ subUnitId: string;
95
+ pivotTableId: string;
96
+ fieldId: string;
97
+ area: PivotTableFiledAreaEnum;
98
+ index: number;
99
+ oldArea: PivotTableFiledAreaEnum;
100
+ oldIndex: number;
101
+ }
102
+ export interface IUpdateValuePositionMutationParams {
103
+ unitId: string;
104
+ subUnitId: string;
105
+ pivotTableId: string;
106
+ valuePosition: PivotTableValuePositionEnum;
107
+ index: number;
108
+ }
109
+ export interface IUpdatePivotFieldSourceInfoMutationParams {
110
+ unitId: string;
111
+ subUnitId: string;
112
+ pivotTableId: string;
113
+ dataFieldId: string;
114
+ sourceName: string;
115
+ tableFieldId: string;
116
+ }
117
+ export interface ISetPivotSubtotalTypeMutationParams {
118
+ unitId: string;
119
+ subUnitId: string;
120
+ pivotTableId: string;
121
+ fieldId: string;
122
+ subtotalType: PivotSubtotalTypeEnum;
123
+ }
124
+ export interface ISetPivotFilterMutationParams {
125
+ unitId: string;
126
+ subUnitId: string;
127
+ pivotTableId: string;
128
+ fieldId: string;
129
+ filterInfo: IPivotTableFilterInfo;
130
+ isAll?: boolean;
131
+ }
132
+ export interface ISetPivotCollapseMutation {
133
+ unitId: string;
134
+ subUnitId: string;
135
+ pivotTableId: string;
136
+ fieldId: string;
137
+ collapse: boolean;
138
+ item?: string;
139
+ }
140
+ export interface IAdjustPivotTableRes {
141
+ valueMatrix: ObjectMatrix<Nullable<IPivotTableCellData>>;
142
+ rowInfo: Record<string, IPivotViewInfo>;
143
+ colInfo: Record<string, IPivotViewInfo>;
144
+ cornerInfo: Record<string, IPivotViewInfo>;
145
+ rowHeaderMap: Record<string, ILabelViewHeaderMapItem>;
146
+ colHeaderMap: Record<string, ILabelViewHeaderMapItem>;
147
+ }
148
+ export interface IThemeStyle {
149
+ rowStyle?: IStyleData;
150
+ colStyle?: IStyleData;
151
+ cornerStyle?: IStyleData;
152
+ pageStyle?: IStyleData;
153
+ dataStyle?: IStyleData;
154
+ blankStyle?: IStyleData;
155
+ subTotalStyle?: IStyleData;
156
+ leafStyle?: IStyleData;
157
+ grandTotal?: IStyleData;
158
+ }
159
+ export interface IPivotTableFieldsConfig {
160
+ dim: unknown;
161
+ }
162
+ export interface IPivotCellPositionInfo {
163
+ row: number;
164
+ col: number;
165
+ unitId: string;
166
+ subUnitId: string;
167
+ sheetName?: string;
168
+ }
169
+ export interface IPivotTableConfig {
170
+ targetCellInfo: IPivotCellPositionInfo;
171
+ sourceRangeInfo: IUnitRangeNameWithSubUnitId;
172
+ themeId?: string;
173
+ fieldsConfig: IPivotTableSnapshot;
174
+ isEmpty: boolean;
175
+ }
176
+ export type IPivotTableConfigModel = Map<string, Map<string, Map<string, IPivotTableConfig>>>;
177
+ export type IPivotWorkerCache = Map<string, Map<string, Map<string, IPivotWorkerItemCache>>>;
178
+ export interface IPivotWorkerItemCache {
179
+ rangeCache?: IPivotRangesInfo;
180
+ matrix?: ObjectMatrix<Nullable<IPivotTableCellData>>;
181
+ oldRangeCache?: IPivotRangesInfo;
182
+ oldMatrix?: ObjectMatrix<Nullable<IPivotTableCellData>>;
183
+ }
184
+ export interface IPivotTableRangeInfo {
185
+ rangeInfo?: IPivotRangesInfo;
186
+ oldRangeInfo?: IPivotRangesInfo;
187
+ }
188
+ export interface IPivotTableMatrixInfo {
189
+ matrix: ObjectMatrix<Nullable<IPivotTableCellData>>;
190
+ oldMatrix?: ObjectMatrix<Nullable<IPivotTableCellData>>;
191
+ }
192
+ export declare enum PivotTableOperationEnum {
193
+ Add = "add",
194
+ Set = "set",
195
+ Delete = "delete"
196
+ }
197
+ export interface IPivotTableCellData {
198
+ v?: IPivotViewValueType;
199
+ /**
200
+ * pivot button type
201
+ */
202
+ pbt?: PivotCellStyleTypeEnum;
203
+ s?: string | IStyleData;
204
+ /**
205
+ * filter index
206
+ */
207
+ fi?: number;
208
+ t?: CellValueType;
209
+ }
210
+ export interface IDataFieldManagerJSON extends IDataFieldManagerBaseJSON {
211
+ dataRanges: Record<string, IUnitRangeName>;
212
+ }
213
+ export interface IPivotTableJson {
214
+ dataFieldManagerConfig: Record<string, IDataFieldManagerJSON>;
215
+ pivotTableConfigs: Record<string, Record<string, Record<string, IPivotTableConfig>>>;
216
+ }
217
+ export type IRangePosition = 'row' | 'col' | 'corner' | 'data';
218
+ export interface IPivotRenderCache {
219
+ areaInfo?: IPivotAreaViewInfo;
220
+ rangesInfo?: IPivotRangesInfo;
221
+ headerMap?: IPivotHeaderMap;
222
+ }
223
+ export interface IPivotAreaViewInfo {
224
+ rowInfo: Record<string, IPivotViewInfo>;
225
+ colInfo: Record<string, IPivotViewInfo>;
226
+ cornerInfo: Record<string, IPivotViewInfo>;
227
+ }
228
+ export interface IPivotRangesInfo {
229
+ rowRanges: IRange[];
230
+ colRanges: IRange[];
231
+ cornerRanges: IRange[];
232
+ dataRanges: IRange[];
233
+ pageRanges: IRange[];
234
+ }
235
+ export interface IPivotHeaderMap {
236
+ rowHeaderMap: Record<string, ILabelViewHeaderMapItem>;
237
+ colHeaderMap: Record<string, ILabelViewHeaderMapItem>;
238
+ }
239
+ export interface ISetPivotPositionMutationParams {
240
+ unitId: string;
241
+ subUnitId: string;
242
+ pivotTableId: string;
243
+ targetCellPosition: {
244
+ row: number;
245
+ col: number;
246
+ };
247
+ }
248
+ export interface IRemovePivotTableMutationParams {
249
+ unitId: string;
250
+ subUnitId: string;
251
+ pivotTableId: string;
252
+ }
253
+ export interface IPivotTableViewDirtyMarkOperationParams {
254
+ [unitId: string]: {
255
+ [sunUnitId: string]: {
256
+ [token: string]: boolean;
257
+ };
258
+ };
259
+ }
260
+ export interface ISheetPivotPluginConfig {
261
+ isPivotTableWorkerMode: boolean;
262
+ }
263
+ export interface IPivotMutationDirtyViewInfo {
264
+ unitId: string;
265
+ subUnitId: string;
266
+ token: string;
267
+ type: PivotTableOperationEnum;
268
+ pivotConfig?: IPivotTableConfig;
269
+ }
270
+ export interface IPivotLocalMutationBaseParams {
271
+ unitId: string;
272
+ subUnitId: string;
273
+ pivotTableId: string;
274
+ }
275
+ export interface IGetPivotFilterPanelDataParams {
276
+ row: number;
277
+ col: number;
278
+ tableFieldId?: string;
279
+ cellData?: IPivotTableCellData;
280
+ pivotItemRenderInfoCache?: IPivotRenderCache;
281
+ }
282
+ export interface IGetPivotPanelDataParams {
283
+ pivotTableId: string;
284
+ }
285
+ export interface IGetAddPivotFieldDataParams {
286
+ fieldName: string;
287
+ fieldArea: PivotTableFiledAreaEnum;
288
+ index: number;
289
+ }
290
+ export interface IPivotDisplayFilterInfo {
291
+ tableFieldId: string;
292
+ pivotTableId: string;
293
+ items: string[];
294
+ itemTypes: PivotDataFieldDataTypeEnum[];
295
+ filterInfo: IPivotTableFilterInfo | undefined;
296
+ sortInfo: IPivotTableSortInfo | undefined;
297
+ format: string | undefined;
298
+ }
299
+ export type IPivotDisplayPanelInfo = IPivotPanelDataInfo;
300
+ export interface IGetAddPivotTableDataParams {
301
+ sourceRangeInfo: IUnitRangeName & {
302
+ subUnitId: string;
303
+ };
304
+ }
305
+ export interface IGetAddPivotTableWithConfigDataParams {
306
+ sourceRangeInfo: IUnitRangeName & {
307
+ subUnitId: string;
308
+ };
309
+ pivotTableIndexConfig: {
310
+ filters?: IPivotFieldConfig[];
311
+ rows?: IPivotFieldConfig[];
312
+ columns?: IPivotFieldConfig[];
313
+ values?: IValueFieldConfig[];
314
+ };
315
+ }
316
+ export interface IGetMovePivotFieldDataParams {
317
+ fieldId: string;
318
+ area: PivotTableFiledAreaEnum;
319
+ index: number;
320
+ }
321
+ export interface IGetRemovePivotFieldDataParams {
322
+ fieldIds: string[];
323
+ }
324
+ export interface IGetPivotCollapseDataParams {
325
+ tableFieldId: string;
326
+ collapse: boolean;
327
+ item: string;
328
+ }
329
+ export interface IGetPivotFilterDataParams {
330
+ tableFieldId: string;
331
+ items: string[];
332
+ isAll?: boolean;
333
+ }
334
+ export interface IGetPivotSortDataParams {
335
+ tableFieldId: string;
336
+ info: IPivotTableSortInfo;
337
+ }
338
+ export interface IGetPivotSettingDataParams {
339
+ tableFieldId: string;
340
+ displayName?: string;
341
+ format?: string;
342
+ subtotalType?: PivotSubtotalTypeEnum;
343
+ }
344
+ export interface IGetUpdatePivotSourceDataParams {
345
+ dataRangeInfo: IUnitRangeNameWithSubUnitId;
346
+ unitId: string;
347
+ subUnitId: string;
348
+ }
349
+ export interface IGetUpdateValuePositionDataParams {
350
+ position: PivotTableValuePositionEnum;
351
+ index: number;
352
+ }
353
+ export interface IGetPivotDataLocalMutationParams extends IPivotLocalMutationBaseParams {
354
+ version: string;
355
+ params: {
356
+ type: PivotDisplayDataType;
357
+ filter?: IGetPivotFilterPanelDataParams;
358
+ panel?: IGetPivotPanelDataParams;
359
+ addPivotField?: IGetAddPivotFieldDataParams;
360
+ addPivotTable?: IGetAddPivotTableDataParams;
361
+ movePivotField?: IGetMovePivotFieldDataParams;
362
+ removePivotField?: IGetRemovePivotFieldDataParams;
363
+ setPivotCollapse?: IGetPivotCollapseDataParams;
364
+ setPivotFilter?: IGetPivotFilterDataParams;
365
+ setPivotSort?: IGetPivotSortDataParams;
366
+ setPivotSetting?: IGetPivotSettingDataParams;
367
+ updatePivotSource?: IGetUpdatePivotSourceDataParams;
368
+ updateValuePosition?: IGetUpdateValuePositionDataParams;
369
+ addPivotTableWithConfig?: IGetAddPivotTableWithConfigDataParams;
370
+ };
371
+ }
372
+ export interface IPivotDisplayResult {
373
+ filter?: IPivotDisplayFilterInfo;
374
+ panel?: IPivotDisplayPanelInfo;
375
+ addPivotTable?: IPivotAddPivotTableInfo;
376
+ addPivotField?: IPivotDisplayBaseInfo;
377
+ movePivotField?: IPivotDisplayBaseInfo;
378
+ removePivotField?: IPivotDisplayBaseInfo;
379
+ setPivotCollapse?: IPivotDisplayBaseInfo;
380
+ setPivotFilter?: IPivotDisplayBaseInfo;
381
+ setPivotSort?: IPivotDisplayBaseInfo;
382
+ setPivotSetting?: IPivotDisplayBaseInfo;
383
+ updatePivotSource?: IPivotUpdatePivotSourceInfo;
384
+ updateValuePosition?: IPivotDisplayBaseInfo;
385
+ addPivotTableWithConfig?: IPivotAddPivotTableInfo & {
386
+ changesets: IPivotTableChangeSet[];
387
+ };
388
+ }
389
+ export interface IPivotUpdatePivotSourceInfo {
390
+ view: IPivotViewJSON;
391
+ changesets: IPivotTableChangeSet[];
392
+ isEmpty: boolean;
393
+ pivotTableConfig: IPivotTableConfig;
394
+ collectionConfig: IFieldsCollectionJSON;
395
+ oldCollectionConfig: IFieldsCollectionJSON;
396
+ deleteIds?: string[];
397
+ }
398
+ export interface IPivotAddPivotTableInfo {
399
+ view: PivotView;
400
+ isEmpty: boolean;
401
+ fieldsConfig: IPivotTableSnapshot;
402
+ collectionConfig: IFieldsCollectionJSON;
403
+ }
404
+ export interface IPivotDisplayBaseInfo {
405
+ view: IPivotViewJSON;
406
+ changesets: IPivotTableChangeSet[];
407
+ isEmpty: boolean;
408
+ pivotTableConfig: IPivotTableConfig;
409
+ }
410
+ export interface ISendPivotViewItemLocalParams extends IPivotLocalMutationBaseParams {
411
+ view: IPivotViewJSON;
412
+ pivotConfig: IPivotTableConfig;
413
+ type: PivotTableOperationEnum;
414
+ }
415
+ export interface ISendPivotViewLocalMutationParams {
416
+ single?: ISendPivotViewItemLocalParams;
417
+ batch?: ISendPivotViewItemLocalParams[];
418
+ collectionConfig?: Record<string, IDataFieldManagerJSON>;
419
+ }
420
+ export interface ISendInitPivotTextLocalMutationParams {
421
+ textInfo: Record<string, string>;
422
+ }
423
+ export interface ISendPivotDataLocalMutationParams extends IPivotLocalMutationBaseParams {
424
+ version: string;
425
+ result: IPivotDisplayResult;
426
+ }
427
+ export interface IPivotTextInfo {
428
+ subTotal: string;
429
+ grandTotal: string;
430
+ blank: string;
431
+ value: string;
432
+ averageName: string;
433
+ countName: string;
434
+ countNumsName: string;
435
+ maxName: string;
436
+ minName: string;
437
+ productName: string;
438
+ stdDevName: string;
439
+ stdDevpName: string;
440
+ sumName: string;
441
+ varName: string;
442
+ varpName: string;
443
+ }
444
+ export interface IPivotPanelTableListItemBase {
445
+ tableFieldId: string;
446
+ displayName: string;
447
+ dataFieldId: string;
448
+ format?: string;
449
+ subTotalType?: PivotSubtotalTypeEnum;
450
+ }
451
+ export interface IPivotPanelSourceList {
452
+ id: string;
453
+ dataFieldId: string;
454
+ name: string;
455
+ type: PivotDataFieldDataTypeEnum;
456
+ checked: boolean;
457
+ pivotTableId: string;
458
+ }
459
+ export interface IPivotPanelDataInfo {
460
+ sourceRange: IUnitRangeNameWithSubUnitId;
461
+ sourceList: IPivotPanelSourceList[];
462
+ rowFields: IPivotPanelTableListItemBase[];
463
+ columnFields: IPivotPanelTableListItemBase[];
464
+ valueFields: IPivotPanelTableListItemBase[];
465
+ filterFields: IPivotPanelTableListItemBase[];
466
+ positionInfo: IPivotTableConfig['targetCellInfo'];
467
+ }
468
+ export interface ICurrentDataMatrix {
469
+ arrayFormulaCellDataMatrix: ObjectMatrix<Nullable<ICellData>> | undefined;
470
+ unitDataMatrix: ObjectMatrix<Nullable<ICellData>> | undefined;
471
+ }
472
+ export interface IPivotFieldConfig {
473
+ field: number;
474
+ selectedItems?: string[];
475
+ }
476
+ export interface IValueFieldConfig {
477
+ field: number;
478
+ subTotalType?: PivotSubtotalTypeEnum;
479
+ }
480
+ export interface IAddPivotTableWithConfigCommandParams {
481
+ sourceDataInfo: {
482
+ unitId: string;
483
+ subUnitId: string;
484
+ range?: IRange;
485
+ };
486
+ pivotTableConfig: {
487
+ filters?: IPivotFieldConfig[];
488
+ rows?: IPivotFieldConfig[];
489
+ columns?: IPivotFieldConfig[];
490
+ values?: IValueFieldConfig[];
491
+ };
492
+ }
@@ -0,0 +1,44 @@
1
+ import { Disposable, ICommandService, IConfigService } from '@univerjs/core';
2
+ import { IAllRuntimeData, IFeatureDirtyRangeType, IRuntimeUnitDataType, IFeatureCalculationManagerService } from '@univerjs/engine-formula';
3
+ import { SheetsPivotDataSourceModel } from '../models/sheets-pivot-data-source-model';
4
+ import { ICurrentDataMatrix, IPivotCellPositionInfo, IUnitRangeNameWithSubUnitId } from '../const/type';
5
+
6
+ interface IPivotDirtyViewInfo {
7
+ unitId: string;
8
+ subUnitId: string;
9
+ token: string;
10
+ }
11
+ export declare class PivotCalculatorController extends Disposable {
12
+ private _sheetsPivotDataSourceModel;
13
+ private readonly _configService;
14
+ readonly _featureCalculationManagerService: IFeatureCalculationManagerService;
15
+ private readonly _commandService;
16
+ constructor(_sheetsPivotDataSourceModel: SheetsPivotDataSourceModel, _configService: IConfigService, _featureCalculationManagerService: IFeatureCalculationManagerService, _commandService: ICommandService);
17
+ _init(): void;
18
+ private _initPivotDataGetListener;
19
+ private _initPivotTextInfo;
20
+ _subjectCollectionChange(): void;
21
+ private _subjectFieldsCollectionChange;
22
+ _subjectViewChange(): void;
23
+ /**
24
+ * - trigger dirty view for pivot table, it will mark dirty for calc engine
25
+ * @param {IPivotDirtyViewInfo[]} dirtyInfos the dirty feature info
26
+ */
27
+ triggerDirtyFeature(dirtyInfos: IPivotDirtyViewInfo[]): void;
28
+ removeSourceRangeChange(unitId: string, subUnitId: string, token: string): void;
29
+ handleSourceRangeChange(token: string, dataRangeInfo: IUnitRangeNameWithSubUnitId, targetInfo: IPivotCellPositionInfo): void;
30
+ /**
31
+ * GET the runtime real data from runtime data, it use for refresh the data filed used rightly data
32
+ * @param {string} sourceUnitId the source unit id of pivot table
33
+ * @param {string} sourceSubunitId the source subunit id of pivot table
34
+ * @param {IAllRuntimeData} runtimeData the runtime data
35
+ * @returns {any} the matrix data
36
+ */
37
+ getMatrixFromRunTimeData(sourceUnitId: string, sourceSubunitId: string, runtimeData: IAllRuntimeData): ICurrentDataMatrix;
38
+ getDirtyInfo(unitId: string, subUnitId: string, token: string): {
39
+ runtimeCellData: IRuntimeUnitDataType;
40
+ dirtyRanges: IFeatureDirtyRangeType;
41
+ };
42
+ dispose(): void;
43
+ }
44
+ export {};
@@ -0,0 +1,21 @@
1
+ import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
2
+ import { IActiveDirtyManagerService } from '@univerjs/engine-formula';
3
+ import { SheetsPivotRPCService } from '../services/sheets-pivot-rpc.service';
4
+ import { SheetsPivotTableAdaptorModel } from '../models/sheets-pivot-table-adaptor-model';
5
+ import { SheetsPivotTableConfigModel } from '../models/sheets-pivot-config-model';
6
+
7
+ export declare class SheetsPivotRPCController extends Disposable {
8
+ private readonly _commandService;
9
+ private readonly _sheetsPivotRpcService;
10
+ private readonly _sheetsPivotTableAdaptorModel;
11
+ private readonly _sheetsPivotTableConfigModel;
12
+ private readonly _univerInstanceService;
13
+ readonly _activeDirtyManagerService: IActiveDirtyManagerService;
14
+ constructor(_commandService: ICommandService, _sheetsPivotRpcService: SheetsPivotRPCService, _sheetsPivotTableAdaptorModel: SheetsPivotTableAdaptorModel, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _univerInstanceService: IUniverInstanceService, _activeDirtyManagerService: IActiveDirtyManagerService);
15
+ private _initDataSendListener;
16
+ /**
17
+ * - register dirty service, used to mark the pivot table view dirty
18
+ * @returns {void}
19
+ */
20
+ registerDirtyService(): void;
21
+ }
@@ -0,0 +1,28 @@
1
+ export { UniverSheetsPivotTablePlugin } from './plugin';
2
+ export { SHEET_PIVOT_TABLE_PLUGIN, BLANK_ROW_COUNT, getAdjustRangesPosition, PositionType, PivotDisplayDataType } from './const/const';
3
+ export { SheetsPivotDataSourceModel } from './models/sheets-pivot-data-source-model';
4
+ export { SheetsPivotRPCService } from './services/sheets-pivot-rpc.service';
5
+ export { AddPivotTableMutation } from './commands/mutations/add-pivot-table.mutation';
6
+ export { AddPivotFieldMutation } from './commands/mutations/add-pivot-field.mutation';
7
+ export { SetPivotSubtotalTypeMutation } from './commands/mutations/set-pivot-subtotal-type.mutation';
8
+ export { SetPivotFilterMutation } from './commands/mutations/set-pivot-filter.mutation';
9
+ export { RemovePivotFieldMutation } from './commands/mutations/remove-pivot-field.mutation';
10
+ export { RenamePivotFieldMutation } from './commands/mutations/rename-pivot-field.mutation';
11
+ export { SetPivotSortMutation } from './commands/mutations/set-pivot-sort.mutation';
12
+ export { SetPivotOptionMutation } from './commands/mutations/set-pivot-option.mutation';
13
+ export { UpdateFieldPositionMutation } from './commands/mutations/update-field-position.mutation';
14
+ export { UpdateValuePositionMutation } from './commands/mutations/update-value-position.mutation';
15
+ export { SetPivotCollapseMutation } from './commands/mutations/set-pivot-collapse.mutation';
16
+ export { RemovePivotTableMutation } from './commands/mutations/remove-pivot-table.mutation';
17
+ export { SetPivotFieldFormatMutation } from './commands/mutations/set-pivot-field-format.mutation';
18
+ export { UpdatePivotTableSourceRangeMutation } from './commands/mutations/update-pivot-table-source.mutation';
19
+ export { PivotTableViewDirtyMarkOperation } from './commands/operations/pivot-table-dirty-view.operation';
20
+ export { UpdatePivotFieldSourceInfoMutation } from './commands/mutations/update-pivot-field-source-info.mutation';
21
+ export { SetPivotPositionMutation } from './commands/mutations/set-pivot-position.mutation';
22
+ export { SheetsPivotTableConfigModel } from './models/sheets-pivot-config-model';
23
+ export type { IAddPivotTableCommandParams, IPivotTableConfig, ISetPivotSortMutationParams, ISetPivotOptionMutationParams, ISetPivotSubtotalTypeMutationParams, IUpdateFieldPositionMutationParams, IUpdateValuePositionMutationParams, IRenamePivotFieldMutationParams, IRemovePivotFieldMutationParams, IRangePosition, ISetPivotFilterMutationParams, IPivotRangesInfo, IPivotRenderCache, IPivotTableCellData, ISetPivotPositionMutationParams, IPivotCellPositionInfo, IAddPivotFieldMutationParams, ISetPivotCollapseMutation, ISetPivotFieldFormatMutationParams, IPivotPanelTableListItemBase, IPivotPanelSourceList, IPivotPanelDataInfo, IUpdatePivotFieldSourceInfoMutationParams, IUnitRangeNameWithSubUnitId, IRemovePivotTableMutationParams, } from './const/type';
24
+ export { PivotTableOperationEnum } from './const/type';
25
+ export { SheetsPivotTableAdaptorModel } from './models/sheets-pivot-table-adaptor-model';
26
+ export { getPivotCellInfo, getPivotTableInfo } from './util';
27
+ export { defaultThemeStyle, transFromCellValue } from './const/const';
28
+ export { applyChangeSet } from './commands/command/util';
@@ -0,0 +1,4 @@
1
+ import { default as zhCN } from './zh-CN';
2
+
3
+ declare const locale: typeof zhCN;
4
+ export default locale;
@@ -0,0 +1,4 @@
1
+ import { default as zhCN } from './zh-CN';
2
+
3
+ declare const locale: typeof zhCN;
4
+ export default locale;
@@ -0,0 +1,4 @@
1
+ import { default as zhCN } from './zh-CN';
2
+
3
+ declare const locale: typeof zhCN;
4
+ 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,4 @@
1
+ import { default as zhCN } from './zh-CN';
2
+
3
+ declare const locale: typeof zhCN;
4
+ export default locale;