@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,525 @@
1
+ import { CellValueType, ICellData, IRange, IStyleData, IUndoRedoCommandInfosByInterceptor, IUnitRangeName, Nullable, ObjectMatrix } from '@univerjs/core';
2
+ import { DataField, FieldsCollection, IDataFieldManagerBaseJSON, IFieldsCollectionJSON, ILabelViewHeaderMapItem, IPivotTableChangeSet, IPivotTableFilterInfo, IPivotTableLabelFieldJSON, IPivotTableOptions, IPivotTableSnapshot, IPivotTableSortInfo, IPivotTableValueFieldJSON, IPivotViewInfo, IPivotViewJSON, IPivotViewValueType, PivotCellStyleTypeEnum, PivotDataFieldDataTypeEnum, PivotSubtotalTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum, PivotView } from '@univerjs-pro/engine-pivot';
3
+ import { PivotDisplayDataType } from './const';
4
+ export interface IPivotPerformCheckParams {
5
+ cellInfo: IPivotCellPositionInfo;
6
+ view: PivotView;
7
+ isEmpty: boolean;
8
+ }
9
+ export type IPivotGeneratedMutationsParams = IPivotPerformCheckParams;
10
+ export declare const PIVOT_PERFORM_CHECK: import('@univerjs/core/common/interceptor.js').IAsyncInterceptor<boolean, IPivotPerformCheckParams>;
11
+ export declare const PIVOT_MUTATION_GENERATE: import('@univerjs/core').IInterceptor<IUndoRedoCommandInfosByInterceptor, IPivotPerformCheckParams>;
12
+ export interface IPivotTableConfigChangeInfo {
13
+ unitId: string;
14
+ subUnitId: string;
15
+ type: PivotTableOperationEnum;
16
+ pivotTableId: string;
17
+ view?: Nullable<PivotView>;
18
+ }
19
+ export declare enum CollectionChangeEnum {
20
+ add = "add",
21
+ delete = "delete",
22
+ update = "update"
23
+ }
24
+ export type IUnitRangeNameWithSubUnitId = IUnitRangeName & {
25
+ subUnitId: string;
26
+ };
27
+ export interface ICollectionChangeInfo {
28
+ token: string;
29
+ type: CollectionChangeEnum;
30
+ dataRangeInfo?: IUnitRangeNameWithSubUnitId;
31
+ unitId?: string;
32
+ subUnitId?: string;
33
+ targetCellInfo?: IPivotCellPositionInfo;
34
+ oldSourceRangeInfo?: IUnitRangeNameWithSubUnitId;
35
+ }
36
+ export interface IAddPivotTableParams {
37
+ pivotTableConfig: IPivotTableConfig;
38
+ }
39
+ export interface IUpdatePivotTableSourceRangeMutationParams {
40
+ pivotTableId: string;
41
+ deleteIds: string[];
42
+ collectionJSON: IFieldsCollectionJSON;
43
+ dataRangeInfo: IUnitRangeNameWithSubUnitId;
44
+ unitId: string;
45
+ subUnitId: string;
46
+ }
47
+ export interface IAddPivotTableMutationParams {
48
+ unitId: string;
49
+ subUnitId: string;
50
+ pivotTableId: string;
51
+ pivotTableConfig: IPivotTableConfig;
52
+ collectionConfig: IFieldsCollectionJSON;
53
+ }
54
+ export interface IAddPivotFieldMutationParams {
55
+ unitId: string;
56
+ subUnitId: string;
57
+ pivotTableId: string;
58
+ fieldJson: IPivotTableValueFieldJSON | IPivotTableLabelFieldJSON;
59
+ area: PivotTableFiledAreaEnum;
60
+ index: number;
61
+ }
62
+ export interface IRemovePivotFieldMutationParams {
63
+ unitId: string;
64
+ subUnitId: string;
65
+ pivotTableId: string;
66
+ fieldId: string;
67
+ area: PivotTableFiledAreaEnum;
68
+ index: number;
69
+ }
70
+ export interface IRenamePivotFieldMutationParams {
71
+ unitId: string;
72
+ subUnitId: string;
73
+ pivotTableId: string;
74
+ name: string;
75
+ fieldId: string;
76
+ }
77
+ export interface ISetPivotSortMutationParams {
78
+ unitId: string;
79
+ subUnitId: string;
80
+ pivotTableId: string;
81
+ fieldId: string;
82
+ sortInfo: IPivotTableSortInfo | undefined;
83
+ }
84
+ export interface ISetPivotOptionMutationParams {
85
+ unitId: string;
86
+ subUnitId: string;
87
+ pivotTableId: string;
88
+ options: IPivotTableOptions;
89
+ }
90
+ export interface ISetPivotFieldFormatMutationParams {
91
+ unitId: string;
92
+ subUnitId: string;
93
+ pivotTableId: string;
94
+ fieldId: string;
95
+ format: string | undefined;
96
+ }
97
+ export interface IUpdateFieldPositionMutationParams {
98
+ unitId: string;
99
+ subUnitId: string;
100
+ pivotTableId: string;
101
+ fieldId: string;
102
+ area: PivotTableFiledAreaEnum;
103
+ index: number;
104
+ oldArea: PivotTableFiledAreaEnum;
105
+ oldIndex: number;
106
+ }
107
+ export interface IUpdateValuePositionMutationParams {
108
+ unitId: string;
109
+ subUnitId: string;
110
+ pivotTableId: string;
111
+ valuePosition: PivotTableValuePositionEnum;
112
+ index: number;
113
+ }
114
+ export interface IUpdatePivotFieldSourceInfoMutationParams {
115
+ unitId: string;
116
+ subUnitId: string;
117
+ pivotTableId: string;
118
+ dataFieldId: string;
119
+ sourceName: string;
120
+ tableFieldId: string;
121
+ }
122
+ export interface ISetPivotSubtotalTypeMutationParams {
123
+ unitId: string;
124
+ subUnitId: string;
125
+ pivotTableId: string;
126
+ fieldId: string;
127
+ subtotalType: PivotSubtotalTypeEnum;
128
+ }
129
+ export interface ISetPivotFilterMutationParams {
130
+ unitId: string;
131
+ subUnitId: string;
132
+ pivotTableId: string;
133
+ fieldId: string;
134
+ filterInfo: IPivotTableFilterInfo;
135
+ isAll?: boolean;
136
+ }
137
+ export interface ISetPivotCollapseMutation {
138
+ unitId: string;
139
+ subUnitId: string;
140
+ pivotTableId: string;
141
+ fieldId: string;
142
+ collapse: boolean;
143
+ item?: string;
144
+ }
145
+ export interface IAdjustPivotTableRes {
146
+ valueMatrix: ObjectMatrix<Nullable<IPivotTableCellData>>;
147
+ rowInfo: Record<string, IPivotViewInfo>;
148
+ colInfo: Record<string, IPivotViewInfo>;
149
+ cornerInfo: Record<string, IPivotViewInfo>;
150
+ rowHeaderMap: Record<string, ILabelViewHeaderMapItem>;
151
+ colHeaderMap: Record<string, ILabelViewHeaderMapItem>;
152
+ }
153
+ export interface IThemeStyle {
154
+ rowStyle?: IStyleData;
155
+ colStyle?: IStyleData;
156
+ cornerStyle?: IStyleData;
157
+ pageStyle?: IStyleData;
158
+ dataStyle?: IStyleData;
159
+ blankStyle?: IStyleData;
160
+ subTotalStyle?: IStyleData;
161
+ leafStyle?: IStyleData;
162
+ grandTotal?: IStyleData;
163
+ }
164
+ export interface IPivotTableFieldsConfig {
165
+ dim: unknown;
166
+ }
167
+ export interface IPivotCellPositionInfo {
168
+ row: number;
169
+ col: number;
170
+ unitId: string;
171
+ subUnitId: string;
172
+ sheetName?: string;
173
+ }
174
+ export interface IPivotTableConfig {
175
+ targetCellInfo: IPivotCellPositionInfo;
176
+ sourceRangeInfo: IUnitRangeNameWithSubUnitId;
177
+ themeId?: string;
178
+ fieldsConfig: IPivotTableSnapshot;
179
+ isEmpty: boolean;
180
+ }
181
+ export type IPivotTableConfigModel = Map<string, Map<string, Map<string, IPivotTableConfig>>>;
182
+ export type IPivotWorkerCache = Map<string, Map<string, Map<string, IPivotWorkerItemCache>>>;
183
+ export interface IPivotWorkerItemCache {
184
+ rangeCache?: IPivotRangesInfo;
185
+ matrix?: ObjectMatrix<Nullable<IPivotTableCellData>>;
186
+ oldRangeCache?: IPivotRangesInfo;
187
+ oldMatrix?: ObjectMatrix<Nullable<IPivotTableCellData>>;
188
+ }
189
+ export interface IPivotTableRangeInfo {
190
+ rangeInfo?: IPivotRangesInfo;
191
+ oldRangeInfo?: IPivotRangesInfo;
192
+ }
193
+ export interface IPivotTableMatrixInfo {
194
+ matrix: ObjectMatrix<Nullable<IPivotTableCellData>>;
195
+ oldMatrix?: ObjectMatrix<Nullable<IPivotTableCellData>>;
196
+ }
197
+ export declare enum PivotTableOperationEnum {
198
+ Add = "add",
199
+ Set = "set",
200
+ Delete = "delete"
201
+ }
202
+ export interface IPivotTableCellData {
203
+ v?: IPivotViewValueType;
204
+ /**
205
+ * pivot button type
206
+ */
207
+ pbt?: PivotCellStyleTypeEnum;
208
+ s?: string | IStyleData;
209
+ /**
210
+ * filter index
211
+ */
212
+ fi?: number;
213
+ t?: CellValueType;
214
+ }
215
+ export interface IDataFieldManagerJSON extends IDataFieldManagerBaseJSON {
216
+ dataRanges: Record<string, IUnitRangeName>;
217
+ }
218
+ export interface IPivotTableJson {
219
+ dataFieldManagerConfig: Record<string, IDataFieldManagerJSON>;
220
+ pivotTableConfigs: Record<string, Record<string, Record<string, IPivotTableConfig>>>;
221
+ }
222
+ export type IRangePosition = 'row' | 'col' | 'corner' | 'data';
223
+ export interface IPivotRenderCache {
224
+ areaInfo?: IPivotAreaViewInfo;
225
+ rangesInfo?: IPivotRangesInfo;
226
+ headerMap?: IPivotHeaderMap;
227
+ }
228
+ export interface IPivotAreaViewInfo {
229
+ rowInfo: Record<string, IPivotViewInfo>;
230
+ colInfo: Record<string, IPivotViewInfo>;
231
+ cornerInfo: Record<string, IPivotViewInfo>;
232
+ }
233
+ export interface IPivotRangesInfo {
234
+ rowRanges: IRange[];
235
+ colRanges: IRange[];
236
+ cornerRanges: IRange[];
237
+ dataRanges: IRange[];
238
+ pageRanges: IRange[];
239
+ }
240
+ export interface IPivotHeaderMap {
241
+ rowHeaderMap: Record<string, ILabelViewHeaderMapItem>;
242
+ colHeaderMap: Record<string, ILabelViewHeaderMapItem>;
243
+ }
244
+ export interface ISetPivotPositionMutationParams {
245
+ unitId: string;
246
+ subUnitId: string;
247
+ pivotTableId: string;
248
+ targetCellPosition: {
249
+ row: number;
250
+ col: number;
251
+ };
252
+ }
253
+ export interface IRemovePivotTableMutationParams {
254
+ unitId: string;
255
+ subUnitId: string;
256
+ pivotTableId: string;
257
+ }
258
+ export interface IPivotTableViewDirtyMarkOperationParams {
259
+ [unitId: string]: {
260
+ [sunUnitId: string]: {
261
+ [token: string]: boolean;
262
+ };
263
+ };
264
+ }
265
+ export interface ISheetPivotPluginConfig {
266
+ isPivotTableWorkerMode: boolean;
267
+ }
268
+ export interface IPivotMutationDirtyViewInfo {
269
+ unitId: string;
270
+ subUnitId: string;
271
+ token: string;
272
+ type: PivotTableOperationEnum;
273
+ pivotConfig?: IPivotTableConfig;
274
+ }
275
+ export interface IPivotLocalMutationBaseParams {
276
+ unitId: string;
277
+ subUnitId: string;
278
+ pivotTableId: string;
279
+ }
280
+ export interface IGetPivotFilterPanelDataParams {
281
+ row: number;
282
+ col: number;
283
+ tableFieldId?: string;
284
+ cellData?: IPivotTableCellData;
285
+ pivotItemRenderInfoCache?: IPivotRenderCache;
286
+ }
287
+ export interface IGetPivotPanelDataParams {
288
+ pivotTableId: string;
289
+ }
290
+ export interface IGetAddPivotFieldDataParams {
291
+ dataFieldId: string;
292
+ fieldArea: PivotTableFiledAreaEnum;
293
+ index: number;
294
+ }
295
+ export interface IPivotDisplayFilterInfo {
296
+ tableFieldId: string;
297
+ pivotTableId: string;
298
+ items: string[];
299
+ itemTypes: PivotDataFieldDataTypeEnum[];
300
+ filterInfo: IPivotTableFilterInfo | undefined;
301
+ sortInfo: IPivotTableSortInfo | undefined;
302
+ format: string | undefined;
303
+ }
304
+ export type IPivotDisplayPanelInfo = IPivotPanelDataInfo;
305
+ export interface IGetAddPivotTableDataParams {
306
+ sourceRangeInfo: IUnitRangeName & {
307
+ subUnitId: string;
308
+ };
309
+ }
310
+ export interface IGetAddPivotTableWithConfigDataParams {
311
+ sourceRangeInfo: IUnitRangeName & {
312
+ subUnitId: string;
313
+ };
314
+ pivotTableIndexConfig: {
315
+ filters?: IPivotFieldConfig[];
316
+ rows?: IPivotFieldConfig[];
317
+ columns?: IPivotFieldConfig[];
318
+ values?: IValueFieldConfig[];
319
+ };
320
+ }
321
+ export interface IGetMovePivotFieldDataParams {
322
+ fieldId: string;
323
+ area: PivotTableFiledAreaEnum;
324
+ index: number;
325
+ }
326
+ export interface IGetRemovePivotFieldDataParams {
327
+ fieldIds: string[];
328
+ }
329
+ export interface IGetPivotCollapseDataParams {
330
+ tableFieldId: string;
331
+ collapse: boolean;
332
+ item: string;
333
+ }
334
+ export interface IGetPivotFilterDataParams {
335
+ tableFieldId: string;
336
+ items: string[];
337
+ isAll?: boolean;
338
+ }
339
+ export interface IGetPivotSortDataParams {
340
+ tableFieldId: string;
341
+ info: IPivotTableSortInfo;
342
+ }
343
+ export interface IGetPivotDrillDownDataParams {
344
+ tuple: string[][];
345
+ }
346
+ export interface IGetPivotSettingDataParams {
347
+ tableFieldId: string;
348
+ displayName?: string;
349
+ format?: string;
350
+ subtotalType?: PivotSubtotalTypeEnum;
351
+ }
352
+ export interface IGetUpdatePivotSourceDataParams {
353
+ dataRangeInfo: IUnitRangeNameWithSubUnitId;
354
+ unitId: string;
355
+ subUnitId: string;
356
+ }
357
+ export interface IGetUpdateValuePositionDataParams {
358
+ position: PivotTableValuePositionEnum;
359
+ index: number;
360
+ }
361
+ export interface IGetPivotDataLocalMutationParams extends IPivotLocalMutationBaseParams {
362
+ version: string;
363
+ params: {
364
+ type: PivotDisplayDataType;
365
+ filter?: IGetPivotFilterPanelDataParams;
366
+ panel?: IGetPivotPanelDataParams;
367
+ addPivotField?: IGetAddPivotFieldDataParams;
368
+ addPivotTable?: IGetAddPivotTableDataParams;
369
+ movePivotField?: IGetMovePivotFieldDataParams;
370
+ removePivotField?: IGetRemovePivotFieldDataParams;
371
+ setPivotCollapse?: IGetPivotCollapseDataParams;
372
+ setPivotFilter?: IGetPivotFilterDataParams;
373
+ setPivotSort?: IGetPivotSortDataParams;
374
+ setPivotSetting?: IGetPivotSettingDataParams;
375
+ updatePivotSource?: IGetUpdatePivotSourceDataParams;
376
+ updateValuePosition?: IGetUpdateValuePositionDataParams;
377
+ addPivotTableWithConfig?: IGetAddPivotTableWithConfigDataParams;
378
+ drillDown?: IGetPivotDrillDownDataParams;
379
+ };
380
+ }
381
+ export interface IPivotDisplayResult {
382
+ filter?: IPivotDisplayFilterInfo;
383
+ panel?: IPivotDisplayPanelInfo;
384
+ addPivotTable?: IPivotAddPivotTableInfo;
385
+ addPivotField?: IPivotDisplayBaseInfo;
386
+ movePivotField?: IPivotDisplayBaseInfo;
387
+ removePivotField?: IPivotDisplayBaseInfo;
388
+ setPivotCollapse?: IPivotDisplayBaseInfo;
389
+ setPivotFilter?: IPivotDisplayBaseInfo;
390
+ setPivotSort?: IPivotDisplayBaseInfo;
391
+ setPivotSetting?: IPivotDisplayBaseInfo;
392
+ updatePivotSource?: IPivotUpdatePivotSourceInfo;
393
+ updateValuePosition?: IPivotDisplayBaseInfo;
394
+ addPivotTableWithConfig?: IPivotAddPivotTableInfo & {
395
+ changesets: IPivotTableChangeSet[];
396
+ };
397
+ drillDown?: IPivotDrillDownInfo;
398
+ }
399
+ export interface IPivotUpdatePivotSourceInfo {
400
+ view: IPivotViewJSON;
401
+ changesets: IPivotTableChangeSet[];
402
+ isEmpty: boolean;
403
+ pivotTableConfig: IPivotTableConfig;
404
+ collectionConfig: IFieldsCollectionJSON;
405
+ oldCollectionConfig: IFieldsCollectionJSON;
406
+ deleteIds?: string[];
407
+ }
408
+ export interface IPivotAddPivotTableInfo {
409
+ view: PivotView;
410
+ isEmpty: boolean;
411
+ fieldsConfig: IPivotTableSnapshot;
412
+ collectionConfig: IFieldsCollectionJSON;
413
+ }
414
+ export interface IPivotDrillDownInfo {
415
+ indexes: number[];
416
+ range: IRange;
417
+ sourceUnitId: string;
418
+ sourceSubUnitId: string;
419
+ formatMap: Record<string, string>;
420
+ }
421
+ export interface IPivotDisplayBaseInfo {
422
+ view: IPivotViewJSON;
423
+ changesets: IPivotTableChangeSet[];
424
+ isEmpty: boolean;
425
+ pivotTableConfig: IPivotTableConfig;
426
+ }
427
+ export interface ISendPivotViewItemLocalParams extends IPivotLocalMutationBaseParams {
428
+ view: IPivotViewJSON;
429
+ pivotConfig: IPivotTableConfig;
430
+ type: PivotTableOperationEnum;
431
+ }
432
+ export interface ISendPivotViewLocalMutationParams {
433
+ single?: ISendPivotViewItemLocalParams;
434
+ batch?: ISendPivotViewItemLocalParams[];
435
+ collectionConfig?: Record<string, IDataFieldManagerJSON>;
436
+ }
437
+ export interface ISendPivotConfigLocalMutationParams {
438
+ unitId: string;
439
+ subUnitId: string;
440
+ oldSubUnitId: string;
441
+ pivotTableId: string;
442
+ pivotTableConfig: IPivotTableConfig;
443
+ collectionConfig: IDataFieldManagerJSON;
444
+ }
445
+ export interface ISendInitPivotTextLocalMutationParams {
446
+ textInfo: Record<string, string>;
447
+ }
448
+ export interface ISendPivotDataLocalMutationParams extends IPivotLocalMutationBaseParams {
449
+ version: string;
450
+ result: IPivotDisplayResult;
451
+ }
452
+ export interface IPivotTextInfo {
453
+ subTotal: string;
454
+ grandTotal: string;
455
+ blank: string;
456
+ value: string;
457
+ averageName: string;
458
+ countName: string;
459
+ countNumsName: string;
460
+ maxName: string;
461
+ minName: string;
462
+ productName: string;
463
+ stdDevName: string;
464
+ stdDevpName: string;
465
+ sumName: string;
466
+ varName: string;
467
+ varpName: string;
468
+ }
469
+ export interface IPivotPanelTableListItemBase {
470
+ tableFieldId: string;
471
+ displayName: string;
472
+ dataFieldId: string;
473
+ format?: string;
474
+ subTotalType?: PivotSubtotalTypeEnum;
475
+ }
476
+ export interface IPivotPanelSourceList {
477
+ id: string;
478
+ dataFieldId: string;
479
+ name: string;
480
+ type: PivotDataFieldDataTypeEnum;
481
+ checked: boolean;
482
+ pivotTableId: string;
483
+ }
484
+ export interface IPivotPanelDataInfo {
485
+ sourceRange: IUnitRangeNameWithSubUnitId;
486
+ sourceList: IPivotPanelSourceList[];
487
+ rowFields: IPivotPanelTableListItemBase[];
488
+ columnFields: IPivotPanelTableListItemBase[];
489
+ valueFields: IPivotPanelTableListItemBase[];
490
+ filterFields: IPivotPanelTableListItemBase[];
491
+ positionInfo: IPivotTableConfig['targetCellInfo'];
492
+ }
493
+ export interface ICurrentDataMatrix {
494
+ arrayFormulaCellDataMatrix: ObjectMatrix<Nullable<ICellData>> | undefined;
495
+ unitDataMatrix: ObjectMatrix<Nullable<ICellData>> | undefined;
496
+ }
497
+ export interface IPivotFieldConfig {
498
+ field: number;
499
+ selectedItems?: string[];
500
+ }
501
+ export interface IValueFieldConfig {
502
+ field: number;
503
+ subTotalType?: PivotSubtotalTypeEnum;
504
+ formatString?: string;
505
+ }
506
+ export interface IAddPivotTableWithConfigCommandParams {
507
+ sourceDataInfo: {
508
+ unitId: string;
509
+ subUnitId: string;
510
+ range?: IRange;
511
+ };
512
+ pivotTableConfig: {
513
+ filters?: IPivotFieldConfig[];
514
+ rows?: IPivotFieldConfig[];
515
+ columns?: IPivotFieldConfig[];
516
+ values?: IValueFieldConfig[];
517
+ };
518
+ }
519
+ export interface IUpdateInfo {
520
+ collection: FieldsCollection;
521
+ updateDataFieldList: {
522
+ index: number;
523
+ dataField: DataField;
524
+ }[];
525
+ }
@@ -0,0 +1,6 @@
1
+ export declare const PLUGIN_CONFIG_KEY = "sheets-pivot.config";
2
+ export declare const configSymbol: unique symbol;
3
+ export interface IUniverSheetsPivotConfig {
4
+ notExecuteFormula?: boolean;
5
+ }
6
+ export declare const defaultPluginConfig: IUniverSheetsPivotConfig;
@@ -0,0 +1 @@
1
+ export declare const getLsInfoFuncStr = "IO7Pzsc7 HgPn2uzsc7(LsPg7Bg, uOwLsPbg2) { Pc7Bz LsPg7BgE7Iclhnzynnh2 = LsPg7Bg.BuLsz('-'); Pc7Bz cnsds7ZgBBhdg = v8Q4.uhnBg(hzcw(LsPg7BgE7Iclhnzynnh2[1])); sI (!cnsds7ZgBBhdg.OH) { cnsds7ZgBBhdg.OH = 4OAwgn(LsPg7BgE7Iclhnzynnh2[q]); } Pc7Bz sBMcnSgn = z2ugcI McnSgnWLcwhL8Pcug !== 'O7HgIs7gH' && BgLI s7Bzh7PgcI McnSgnWLcwhL8Pcug; Pc7Bz Pc7zgFz = sBMcnSgn ? BgLI : 6s7Hc6; Pc7Bz AgBBhdgMcnH = Pc7zgFz.__9hBgfq__.uhnBg(LsPg7BgE7Iclhnzynnh2[1]); Pc7Bz AgBBhdg = Pc7zgFz.__mgF__.Bzns7dsI2(AgBBhdgMcnH); Pc7Bz Bsd7hzOngMcnH = Pc7zgFz.__9hBgfq__.uhnBg(LsPg7BgE7Iclhnzynnh2[e]); Pc7Bz Bsd7hzOng = Pc7zgFz.__mgF__.Bzns7dsI2(Bsd7hzOngMcnH); Pc7Bz Bsd7ahLsH = Pc7zgFz.__VgnsI2__(Bsd7hzOng, AgBBhdg, uOwLsPbg2); Pc7Bz HcAhs7 = cnsds7ZgBBhdg.HA; IO7Pzsc7 sBRcAhs7ZhzPXs7d(clhzzgn7, cmcBz) { Pc7Bz uhzzgn7 = clhzzgn7.nguLhPg(/^.+/, ''); Pc7Bz XcBz = cmcBz.nguLhPg(/^.+/, ''); Pc7Bz uhzzgn7lhnzB = uhzzgn7.BuLsz('.'); Pc7Bz XcBzlhnzB = XcBz.BuLsz('.'); sI (!uhzzgn7.s7PLOHgB('*')) { ngzOn7 uhzzgn7 === XcBz; } sI (uhzzgn7lhnzB.Lg7dzX < 1 || uhzzgn7lhnzB[k] !== '*') { ngzOn7 IhLBg; } Pc7Bz uhzzgn78OIIsF = uhzzgn7lhnzB.BLsPg(Y).tcs7('.'); Pc7Bz XcBz8OIIsF = XcBzlhnzB.BLsPg(-uhzzgn7lhnzB.Lg7dzX + Y).tcs7('.'); ngzOn7 uhzzgn78OIIsF === XcBz8OIIsF; } Lgz HcAhs7ahLsH = HcAhs7?.Lg7dzX ? HcAhs7.BcAg((HAEzgA) => sBRcAhs7ZhzPXs7d(HAEzgA, LcPhzsc7.XcBz7hAg)) : znOg; sI (LcPhzsc7.XcBz7hAg === 'LcPhLXcBz') { HcAhs7ahLsH = znOg; } Pc7Bz VhLsH = Bsd7ahLsH && HcAhs7ahLsH; ngzOn7 { VhLsH, AgBBhdg: cnsds7ZgBBhdg, };}";
@@ -0,0 +1,44 @@
1
+ import { IAllRuntimeData, IFeatureDirtyRangeType, IRuntimeUnitDataType, IFeatureCalculationManagerService } from '@univerjs/engine-formula';
2
+ import { ICurrentDataMatrix, IPivotCellPositionInfo, IUnitRangeNameWithSubUnitId } from '../const/type';
3
+ import { Disposable, ICommandService, IConfigService, Injector } from '@univerjs/core';
4
+ import { SheetsPivotDataSourceModel } from '../models/sheets-pivot-data-source-model';
5
+ interface IPivotDirtyViewInfo {
6
+ unitId: string;
7
+ subUnitId: string;
8
+ token: string;
9
+ }
10
+ export declare class PivotCalculatorController extends Disposable {
11
+ private _sheetsPivotDataSourceModel;
12
+ private readonly _configService;
13
+ readonly _featureCalculationManagerService: IFeatureCalculationManagerService;
14
+ private readonly _commandService;
15
+ private readonly _injector;
16
+ constructor(_sheetsPivotDataSourceModel: SheetsPivotDataSourceModel, _configService: IConfigService, _featureCalculationManagerService: IFeatureCalculationManagerService, _commandService: ICommandService, _injector: Injector);
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,12 @@
1
+ import { Disposable, DisposableCollection, IUniverInstanceService } from '@univerjs/core';
2
+ import { SheetInterceptorService, SheetsSelectionsService } from '@univerjs/sheets';
3
+ import { SheetsPivotTableConfigModel } from '../models/sheets-pivot-config-model';
4
+ export declare class SheetsPivotClearController extends Disposable {
5
+ private readonly _univerInstanceService;
6
+ private readonly _sheetInterceptorService;
7
+ private readonly _sheetsSelectionsService;
8
+ private readonly _sheetsPivotTableConfigModel;
9
+ disposableCollection: DisposableCollection;
10
+ constructor(_univerInstanceService: IUniverInstanceService, _sheetInterceptorService: SheetInterceptorService, _sheetsSelectionsService: SheetsSelectionsService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel);
11
+ private _initClearSelectionCommandInterceptor;
12
+ }
@@ -0,0 +1,21 @@
1
+ import { IMutationInfo, Disposable, Injector, IUniverInstanceService, LocaleService } from '@univerjs/core';
2
+ import { PivotView } from '@univerjs-pro/engine-pivot';
3
+ import { IPivotCellPositionInfo } from '../const/type';
4
+ import { SheetInterceptorService } from '@univerjs/sheets';
5
+ import { SheetsPivotTableConfigModel } from '../models/sheets-pivot-config-model';
6
+ import { SheetsPivotTableService } from '../services/sheets-pivot-table.service';
7
+ export declare class SheetsPivotTableInterceptController extends Disposable {
8
+ private readonly _localeService;
9
+ private readonly _sheetInterceptorService;
10
+ private readonly _injector;
11
+ private readonly _univerInstanceService;
12
+ private readonly _sheetsPivotTableConfigModel;
13
+ private readonly _sheetsPivotTableService;
14
+ constructor(_localeService: LocaleService, _sheetInterceptorService: SheetInterceptorService, _injector: Injector, _univerInstanceService: IUniverInstanceService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _sheetsPivotTableService: SheetsPivotTableService);
15
+ private _getPivotAppliedRanges;
16
+ private _initCommandInterceptListener;
17
+ getAutoFitColumnsMutations(view: PivotView, cellInfo: IPivotCellPositionInfo): {
18
+ undos: IMutationInfo<object>[];
19
+ redos: IMutationInfo<object>[];
20
+ };
21
+ }
@@ -0,0 +1,7 @@
1
+ import { Disposable, ICommandService, IPermissionService } from '@univerjs/core';
2
+ export declare class SheetsPivotPrintController extends Disposable {
3
+ private readonly _permissionService;
4
+ private readonly _commandService;
5
+ constructor(_permissionService: IPermissionService, _commandService: ICommandService);
6
+ private _initPermissionWithPivot;
7
+ }
@@ -0,0 +1,21 @@
1
+ import { IMutationInfo, Disposable, DisposableCollection, ICommandService, Injector, IUniverInstanceService } from '@univerjs/core';
2
+ import { IMoveRangeCommandParams, RefRangeService, SheetInterceptorService } from '@univerjs/sheets';
3
+ import { SheetsPivotTableConfigModel } from '../models/sheets-pivot-config-model';
4
+ import { SheetsPivotTableAdaptorModel } from '../models/sheets-pivot-table-adaptor-model';
5
+ export declare class SheetsPivotRefRangeController extends Disposable {
6
+ private readonly _injector;
7
+ private readonly _refRangeService;
8
+ private readonly _commandService;
9
+ private readonly _univerInstanceService;
10
+ private readonly _sheetsPivotTableConfigModel;
11
+ private readonly _sheetsPivotTableAdaptorModel;
12
+ private readonly _sheetInterceptorService;
13
+ disposableCollection: DisposableCollection;
14
+ constructor(_injector: Injector, _refRangeService: RefRangeService, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _sheetsPivotTableAdaptorModel: SheetsPivotTableAdaptorModel, _sheetInterceptorService: SheetInterceptorService);
15
+ private _onRefRangeChange;
16
+ private _refRangeHandle;
17
+ getRefRangeMutationsByMoveRange(params: IMoveRangeCommandParams, unitId: string, subUnitId: string): {
18
+ redos: IMutationInfo[];
19
+ undos: IMutationInfo[];
20
+ };
21
+ }
@@ -0,0 +1,9 @@
1
+ import { Disposable } from '@univerjs/core';
2
+ import { SheetInterceptorService } from '@univerjs/sheets';
3
+ import { SheetsPivotTableConfigModel } from '../models/sheets-pivot-config-model';
4
+ export declare class SheetsPivotRemoveSheetController extends Disposable {
5
+ private readonly _sheetInterceptorService;
6
+ private readonly _sheetsPivotTableConfigModel;
7
+ constructor(_sheetInterceptorService: SheetInterceptorService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel);
8
+ private _initRemoveSheetCommandInterceptor;
9
+ }
@@ -0,0 +1,20 @@
1
+ import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
2
+ import { IActiveDirtyManagerService } from '@univerjs/engine-formula';
3
+ import { SheetsPivotTableConfigModel } from '../models/sheets-pivot-config-model';
4
+ import { SheetsPivotTableAdaptorModel } from '../models/sheets-pivot-table-adaptor-model';
5
+ import { SheetsPivotRPCService } from '../services/sheets-pivot-rpc.service';
6
+ export declare class SheetsPivotRPCController extends Disposable {
7
+ private readonly _commandService;
8
+ private readonly _sheetsPivotRpcService;
9
+ private readonly _sheetsPivotTableAdaptorModel;
10
+ private readonly _sheetsPivotTableConfigModel;
11
+ private readonly _univerInstanceService;
12
+ readonly _activeDirtyManagerService: IActiveDirtyManagerService;
13
+ constructor(_commandService: ICommandService, _sheetsPivotRpcService: SheetsPivotRPCService, _sheetsPivotTableAdaptorModel: SheetsPivotTableAdaptorModel, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _univerInstanceService: IUniverInstanceService, _activeDirtyManagerService: IActiveDirtyManagerService);
14
+ private _initDataSendListener;
15
+ /**
16
+ * - register dirty service, used to mark the pivot table view dirty
17
+ * @returns {void}
18
+ */
19
+ registerDirtyService(): void;
20
+ }