@univerjs-pro/sheets-pivot 0.5.3 → 0.5.4

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 (49) 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/fr-FR.js +1 -1
  6. package/lib/cjs/locale/ru-RU.js +1 -1
  7. package/lib/cjs/locale/vi-VN.js +1 -1
  8. package/lib/cjs/locale/zh-CN.js +1 -1
  9. package/lib/cjs/locale/zh-TW.js +1 -1
  10. package/lib/es/facade.js +1 -1
  11. package/lib/es/index.js +1 -1
  12. package/lib/es/locale/en-US.js +1 -1
  13. package/lib/es/locale/fa-IR.js +1 -1
  14. package/lib/es/locale/fr-FR.js +1 -1
  15. package/lib/es/locale/ru-RU.js +1 -1
  16. package/lib/es/locale/vi-VN.js +1 -1
  17. package/lib/es/locale/zh-CN.js +1 -1
  18. package/lib/es/locale/zh-TW.js +1 -1
  19. package/lib/types/commands/command/add-pivot-field.command.d.ts +18 -0
  20. package/lib/types/commands/command/move-pivot-field.command.d.ts +19 -1
  21. package/lib/types/commands/command/remove-pivot-field.command.d.ts +12 -0
  22. package/lib/types/commands/command/set-pivot-collapse.command.d.ts +15 -0
  23. package/lib/types/commands/command/set-pivot-filter.command.d.ts +18 -0
  24. package/lib/types/commands/command/set-pivot-sort.command.d.ts +17 -2
  25. package/lib/types/commands/command/update-pivot-setting.command.d.ts +28 -1
  26. package/lib/types/commands/command/update-value-position.command.d.ts +10 -1
  27. package/lib/types/common/const.d.ts +39 -39
  28. package/lib/types/const/const.d.ts +10 -1
  29. package/lib/types/const/type.d.ts +213 -2
  30. package/lib/types/controllers/const.d.ts +1 -1
  31. package/lib/types/facade/f-enum.d.ts +50 -0
  32. package/lib/types/facade/f-event.d.ts +276 -0
  33. package/lib/types/facade/f-pivot-table.d.ts +205 -4
  34. package/lib/types/facade/f-univer.d.ts +18 -0
  35. package/lib/types/facade/f-workbook.d.ts +45 -14
  36. package/lib/types/facade/index.d.ts +5 -1
  37. package/lib/types/index.d.ts +3 -1
  38. package/lib/types/models/sheets-pivot-config-model.d.ts +2 -1
  39. package/lib/types/models/sheets-pivot-table-adaptor-model.d.ts +2 -9
  40. package/lib/umd/facade.js +1 -1
  41. package/lib/umd/index.js +1 -1
  42. package/lib/umd/locale/en-US.js +1 -1
  43. package/lib/umd/locale/fa-IR.js +1 -1
  44. package/lib/umd/locale/fr-FR.js +1 -1
  45. package/lib/umd/locale/ru-RU.js +1 -1
  46. package/lib/umd/locale/vi-VN.js +1 -1
  47. package/lib/umd/locale/zh-CN.js +1 -1
  48. package/lib/umd/locale/zh-TW.js +1 -1
  49. package/package.json +11 -11
@@ -1,6 +1,6 @@
1
- import { IPivotTableSortInfo, PivotSubtotalTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum } from '@univerjs-pro/engine-pivot';
2
1
  import { IPivotTableConfig } from '@univerjs-pro/sheets-pivot';
3
2
  import { Injector, IRange, Nullable } from '@univerjs/core';
3
+ import { IPivotTableLabelFieldJSON, IPivotTableSortInfo, IPivotTableValueFieldJSON, PivotSubtotalTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum } from '@univerjs-pro/engine-pivot';
4
4
  export declare class FPivotTable {
5
5
  unitId: string;
6
6
  subUnitId: string;
@@ -9,21 +9,103 @@ export declare class FPivotTable {
9
9
  constructor(unitId: string, subUnitId: string, pivotTableId: string, injector: Injector);
10
10
  /**
11
11
  * @description Get the pivot table config by the pivot table id.
12
- * @typedef NPivotTableConfig
12
+ * @typedef PivotTableConfig
13
13
  * @property {TargetInfo} targetCellInfo The target cell info of the pivot table.
14
14
  * @property {SourceInfo} sourceRangeInfo The source data range info of the pivot table.
15
15
  * @property {boolean} isEmpty The pivot table is empty or not.
16
16
  * @property {object} fieldsConfig The snapshot of the pivot table fields config.
17
17
  * @returns {PivotTableConfig|undefined} The pivot table config or undefined.
18
+ * @example
19
+ * ```ts
20
+ *const fWorkbook = univerAPI.getActiveWorkbook();
21
+ * const unitId = fWorkbook.getId();
22
+ * const fSheet = fWorkbook.getActiveSheet();
23
+ * const subUnitId = fSheet.getSheetId();
24
+ * const pivotTable = fWorkbook.getPivotTableByCell(unitId, subUnitId, 1, 1);
25
+ * const pivotTableConfig = fPivotTable.getConfig();
26
+ * const { targetCellInfo, sourceRangeInfo, isEmpty } = pivotTableConfig;
27
+ * console.log(targetCellInfo, sourceRangeInfo, isEmpty);
28
+ * ```
18
29
  */
19
30
  getConfig(): Nullable<IPivotTableConfig>;
31
+ /**
32
+ * @description Get the pivot table id.
33
+ * @returns {string} The pivot table id.
34
+ * @example
35
+ * ```ts
36
+ * const fWorkbook = univerAPI.getActiveWorkbook();
37
+ * const unitId = fWorkbook.getId();
38
+ * const fSheet = fWorkbook.getActiveSheet();
39
+ * const subUnitId = fSheet.getSheetId();
40
+ * const pivotTable = fWorkbook.getPivotTableByCell(unitId, subUnitId, 1, 1);
41
+ * const pivotTableId = fPivotTable.getPivotTableId();
42
+ * console.log(pivotTableId);
43
+ * ```
44
+ */
45
+ getPivotTableId(): string;
46
+ /**
47
+ * Get the pivot table field setting by the field id.
48
+ * @param fieldId The table field id.
49
+ * @returns { IPivotTableValueFieldJSON | IPivotTableLabelFieldJSON | undefined} The field setting.
50
+ * @example
51
+ * ```ts
52
+ * const fWorkbook = univerAPI.getActiveWorkbook();
53
+ * const unitId = fWorkbook.getId();
54
+ * const fSheet = fWorkbook.getActiveSheet();
55
+ * const subUnitId = fSheet.getSheetId();
56
+ * const pivotTable = fWorkbook.getPivotTableByCell(unitId, subUnitId, 1, 1);
57
+ * const fieldSetting = pivotTable.getFieldSetting('fieldId');
58
+ * ```
59
+ */
60
+ getFieldSetting(fieldId: string): IPivotTableValueFieldJSON | IPivotTableLabelFieldJSON | undefined;
61
+ /**
62
+ * @description Get the field ids by the field area.
63
+ * @param {PivotTableFiledAreaEnum} fieldArea The area of the field.
64
+ * @returns {string[]} The field ids in the target area.
65
+ * @example
66
+ * ```ts
67
+ * const fWorkbook = univerAPI.getActiveWorkbook();
68
+ * const unitId = fWorkbook.getId();
69
+ * const fSheet = fWorkbook.getActiveSheet();
70
+ * const subUnitId = fSheet.getSheetId();
71
+ * const pivotTable = fWorkbook.getPivotTableByCell(unitId, subUnitId, 1, 1);
72
+ * const fieldIds = pivotTable.getFieldIdsByArea(univerAPI.Enum.PivotTableFiledAreaEnum.Row);
73
+ * console.log(fieldIds);
74
+ * ```
75
+ */
76
+ getFieldIdsByArea(fieldArea: PivotTableFiledAreaEnum): string[];
20
77
  /**
21
78
  * @description Get the pivot table range info in worksheet.
22
79
  * @returns {IRange[]|undefined} The pivot table range list.
80
+ * @example
81
+ * ```ts
82
+ * const fWorkbook = univerAPI.getActiveWorkbook();
83
+ * const unitId = fWorkbook.getId();
84
+ * const fSheet = fWorkbook.getActiveSheet();
85
+ * const subUnitId = fSheet.getSheetId();
86
+ * const pivotTable = fWorkbook.getPivotTableByCell(unitId, subUnitId, 1, 1);
87
+ * if(fPivotTable) {
88
+ * const pivotTableRangeInfo = fPivotTable.getPivotTableRangeInfo();
89
+ * console.log(pivotTableRangeInfo);
90
+ * }
91
+ * ```
23
92
  */
24
93
  getPivotTableRangeInfo(): IRange[] | undefined;
25
94
  /**
26
95
  * @description Remove a pivot table from the workbook by pivot table id
96
+ * @returns {Promise<boolean>} Whether the pivot table is removed successfully.
97
+ * @example
98
+ * ```ts
99
+ * const fWorkbook = univerAPI.getActiveWorkbook();
100
+ * const unitId = fWorkbook.getId();
101
+ * const fSheet = fWorkbook.getActiveSheet();
102
+ * const subUnitId = fSheet.getSheetId();
103
+ * const fPivotTable = fWorkbook.getPivotTableByCell(unitId, subUnitId, 1, 1);
104
+ *
105
+ * if(fPivotTable) {
106
+ * fPivotTable.remove();
107
+ * }
108
+ * ```
27
109
  */
28
110
  remove(): Promise<boolean>;
29
111
  /**
@@ -32,12 +114,40 @@ export declare class FPivotTable {
32
114
  * @param {PivotTableFiledAreaEnum} fieldArea The area of the field.
33
115
  * @param {number} index The index of the field in the target area.
34
116
  * @returns {boolean} Whether the pivot field is added successfully.
117
+ * @example
118
+ * ```ts
119
+ * const fWorkbook = univerAPI.getActiveWorkbook();
120
+ * const unitId = fWorkbook.getId();
121
+ * const fSheet = fWorkbook.getActiveSheet();
122
+ * const subUnitId = fSheet.getSheetId();
123
+ * const fPivotTable = fWorkbook.getPivotTableByCell(unitId, subUnitId, 1, 1);
124
+ *
125
+ * if(fPivotTable) {
126
+ * // 1 means the source range index , 0 means the index in the target area.
127
+ * fPivotTable.addField(1, univerAPI.Enum.PivotTableFiledAreaEnum.Row, 0);
128
+ * }
129
+ * ```
35
130
  */
36
131
  addField(dataFieldIdOrIndex: string | number, fieldArea: PivotTableFiledAreaEnum, index: number): Promise<boolean>;
37
132
  /**
38
133
  * @description Remove a pivot field from the pivot table
39
134
  * @param {string[]} fieldIds The deleted field ids.
40
135
  * @returns {boolean} Whether the pivot field is removed successfully.
136
+ * @example
137
+ * ```ts
138
+ * const fWorkbook = univerAPI.getActiveWorkbook();
139
+ * const unitId = fWorkbook.getId();
140
+ * const fSheet = fWorkbook.getActiveSheet();
141
+ * const subUnitId = fSheet.getSheetId();
142
+ * const pivotTable = fWorkbook.getPivotTableByCell(unitId, subUnitId, 1, 1);
143
+ * if (pivotTable) {
144
+ * const rowIds = pivotTable.getFieldIdsByArea(univerAPI.Enum.PivotTableFiledAreaEnum.Row);
145
+ * if (rowIds.length > 0) {
146
+ * // remove all field in row.
147
+ * pivotTable.removeField(rowIds);
148
+ * }
149
+ * }
150
+ * ```
41
151
  */
42
152
  removeField(fieldIds: string[]): Promise<boolean>;
43
153
  /**
@@ -46,6 +156,21 @@ export declare class FPivotTable {
46
156
  * @param {PivotTableFiledAreaEnum} area - The target area of the field.
47
157
  * @param {number} index - The target index of the field, if the index is bigger than the field count in the target area, the field will be moved to the last, if the index is smaller than 0, the field will be moved to the first.
48
158
  * @returns {boolean} Whether the pivot field is moved successfully.
159
+ * @example
160
+ * ```typescript
161
+ * const fWorkbook = univerAPI.getActiveWorkbook();
162
+ * const unitId = fWorkbook.getId();
163
+ * const fSheet = fWorkbook.getActiveSheet();
164
+ * const subUnitId = fSheet.getSheetId();
165
+ * const pivotTable = fWorkbook.getPivotTableByCell(unitId, subUnitId, 1, 1);
166
+ * if (pivotTable) {
167
+ * const rowIds = pivotTable.getFieldIdsByArea(univerAPI.Enum.PivotTableFiledAreaEnum.Row);
168
+ * if (rowIds.length > 0) {
169
+ * // move to column
170
+ * pivotTable.updateFieldPosition(rowIds[0], univerAPI.Enum.PivotTableFiledAreaEnum.Column, 0);
171
+ * }
172
+ * }
173
+ * ```
49
174
  */
50
175
  updateFieldPosition(fieldId: string, area: PivotTableFiledAreaEnum, index: number): Promise<boolean>;
51
176
  /**
@@ -53,6 +178,18 @@ export declare class FPivotTable {
53
178
  * @param {PivotTableValuePositionEnum} position - The position of the value field.
54
179
  * @param {number} index - The index of the value field.
55
180
  * @returns {boolean} Whether the pivot value field is moved successfully.
181
+ * @example
182
+ * ```typescript
183
+ * const fWorkbook = univerAPI.getActiveWorkbook();
184
+ * const unitId = fWorkbook.getId();
185
+ * const fSheet = fWorkbook.getActiveSheet();
186
+ * const subUnitId = fSheet.getSheetId();
187
+ * const pivotTable = fWorkbook.getPivotTableByCell(unitId, subUnitId, 1, 1);
188
+ * if(pivotTable) {
189
+ * // if there are more than one value field, a ΣValue will in row area.
190
+ * pivotTable.updateValuePosition(univerAPI.Enum.PivotTableValuePositionEnum.Row, 0);
191
+ * }
192
+ * ```
56
193
  */
57
194
  updateValuePosition(position: PivotTableValuePositionEnum, index: number): Promise<boolean>;
58
195
  /**
@@ -60,6 +197,17 @@ export declare class FPivotTable {
60
197
  * @param {string} fieldId - The field id.
61
198
  * @param {PivotSubtotalTypeEnum} subtotalType - The subtotal type of the field.
62
199
  * @returns {boolean} Whether the pivot table subtotal type is set successfully.
200
+ * @example
201
+ * ```ts
202
+ * const fWorkbook = univerAPI.getActiveWorkbook();
203
+ * const unitId = fWorkbook.getId();
204
+ * const fSheet = fWorkbook.getActiveSheet();
205
+ * const subUnitId = fSheet.getSheetId();
206
+ * const pivotTable = fWorkbook.getPivotTableByCell(unitId, subUnitId, 1, 1);
207
+ * if (pivotTable) {
208
+ * pivotTable.setSubtotalType('fieldId', univerAPI.Enum.PivotSubtotalTypeEnum.Average);
209
+ * }
210
+ * ```
63
211
  */
64
212
  setSubtotalType(fieldId: string, subtotalType: PivotSubtotalTypeEnum): Promise<boolean>;
65
213
  /**
@@ -69,13 +217,42 @@ export declare class FPivotTable {
69
217
  * @typedef PivotTableSortInfo
70
218
  * @property {PivotDataFieldSortOperatorEnum} type The sort operator of the field items.
71
219
  * @returns {boolean} Whether the pivot table sort info is set successfully.
220
+ * @example
221
+ * ```ts
222
+ * const fWorkbook = univerAPI.getActiveWorkbook();
223
+ * const unitId = fWorkbook.getId();
224
+ * const fSheet = fWorkbook.getActiveSheet();
225
+ * const subUnitId = fSheet.getSheetId();
226
+ * const pivotTable = fWorkbook.getPivotTableByCell(unitId, subUnitId, 1, 1);
227
+ * if (pivotTable) {
228
+ * const rowIds = pivotTable.getFieldIdsByArea(univerAPI.Enum.PivotTableFiledAreaEnum.Row);
229
+ * if (rowIds.length > 0) {
230
+ * pivotTable.setLabelSort(rowIds[0], { type: univerAPI.Enum.PivotDataFieldSortOperatorEnum.Ascending });
231
+ * }
232
+ * }
233
+ * ```
72
234
  */
73
235
  setLabelSort(tableFieldId: string, info: IPivotTableSortInfo): Promise<boolean>;
74
236
  /**
75
237
  * @description Set the pivot table manual filter.
76
238
  * @param {string} tableFieldId - The field id of the filter.
77
239
  * @param {string[]} items - The items of the filter.
240
+ * @param {boolean} [isAll] - Whether the filter is all.If true, the filter will be all items, the items will be ignored.
78
241
  * @returns {boolean} Whether the pivot table filter is set successfully.
242
+ * @example
243
+ * ```ts
244
+ * const fWorkbook = univerAPI.getActiveWorkbook();
245
+ * const unitId = fWorkbook.getId();
246
+ * const fSheet = fWorkbook.getActiveSheet();
247
+ * const subUnitId = fSheet.getSheetId();
248
+ * const pivotTable = fWorkbook.getPivotTableByCell(unitId, subUnitId, 1, 1);
249
+ * if (pivotTable) {
250
+ * const rowIds = pivotTable.getFieldIdsByArea(univerAPI.Enum.PivotTableFiledAreaEnum.Row);
251
+ * if (rowIds.length > 0) {
252
+ * pivotTable.setLabelManualFilter(rowIds[0], ['item1', 'item2']);
253
+ * }
254
+ * }
255
+ * ```
79
256
  */
80
257
  setLabelManualFilter(tableFieldId: string, items: string[], isAll?: boolean): Promise<boolean>;
81
258
  /**
@@ -83,16 +260,40 @@ export declare class FPivotTable {
83
260
  * @param {string} fieldId - The field id.
84
261
  * @param {string} name - The new name of the field.
85
262
  * @returns {boolean} Whether the pivot table field is renamed successfully.
263
+ * @example
264
+ * ```typescript
265
+ * const fWorkbook = univerAPI.getActiveWorkbook();
266
+ * const unitId = fWorkbook.getId();
267
+ * const fSheet = fWorkbook.getActiveSheet();
268
+ * const subUnitId = fSheet.getSheetId();
269
+ * const pivotTable = fWorkbook.getPivotTableByCell(unitId, subUnitId, 1, 1);
270
+ * if (pivotTable) {
271
+ * const valueIds = pivotTable.getFieldIdsByArea(univerAPI.Enum.PivotTableFiledAreaEnum.Value);
272
+ * if (valueIds.length > 0) {
273
+ * pivotTable.renameField(valueIds[0], 'newName');
274
+ * }
275
+ * }
276
+ * ```
86
277
  */
87
278
  renameField(fieldId: string, name: string): Promise<boolean>;
88
279
  /**
89
280
  * @description Move the pivot table to the target cell.
90
- *
91
281
  * @param {string} sheetName - The target sheet name.
92
282
  * @param {number} row - The target row index.
93
283
  * @param {number} col - The target column index.
94
- *
95
284
  * @returns {boolean} Whether the pivot table field is moved successfully.
285
+ * @example
286
+ * ```typescript
287
+ * const fWorkbook = univerAPI.getActiveWorkbook();
288
+ * const unitId = fWorkbook.getId();
289
+ * const fSheet = fWorkbook.getActiveSheet();
290
+ * const subUnitId = fSheet.getSheetId();
291
+ * const pivotTable = fWorkbook.getPivotTableByCell(unitId, subUnitId, 1, 1);
292
+ * if (pivotTable) {
293
+ * // move pivot table to row:100, col:1
294
+ * pivotTable.move(subUnitId, 100, 1);
295
+ * }
296
+ * ```
96
297
  */
97
298
  move(sheetName: string, row: number, col: number): Promise<boolean>;
98
299
  }
@@ -0,0 +1,18 @@
1
+ import { Injector, FUniver } from '@univerjs/core';
2
+ export declare class FUniverPivotTableEventMixin extends FUniver {
3
+ _initialize(injector: Injector): void;
4
+ private _firePivotTableFieldAddedEvent;
5
+ private _firePivotTableFieldRemovedEvent;
6
+ private _firePivotTableFieldMovedEvent;
7
+ private _firePivotTableFieldCollapsedEvent;
8
+ private _firePivotTableFieldFilterChangedEvent;
9
+ private _firePivotTableFieldSortChangedEvent;
10
+ private _firePivotTableFieldSettingChangedEvent;
11
+ private _firePivotTableValuePositionChangedEvent;
12
+ private _fireAddPivotTableEvent;
13
+ private _fireBeforeAddPivotTableEvent;
14
+ private _firePivotTableRemovedEvent;
15
+ private _fireBeforeMovePivotTableEvent;
16
+ private _fireMovedPivotTableEvent;
17
+ private _fireRenderPivotTableEvent;
18
+ }
@@ -1,5 +1,5 @@
1
- import { IUnitRangeName } from '@univerjs/core';
2
1
  import { IPivotCellPositionInfo, PositionType } from '@univerjs-pro/sheets-pivot';
2
+ import { IUnitRangeName } from '@univerjs/core';
3
3
  import { FWorkbook } from '@univerjs/sheets/facade';
4
4
  import { FPivotTable } from './f-pivot-table';
5
5
  export interface IFWorkbookSheetsPivotMixin {
@@ -15,17 +15,17 @@ export interface IFWorkbookSheetsPivotMixin {
15
15
  * @property {string} subUnitId - The sub unit id of the target data.
16
16
  * @property {number} row - The range of the target data.
17
17
  * @property {number} col - The range of the target data.
18
- * @param {SourceInfo} sourceInfo The source data range info of the pivot table.
18
+ * @param {SourceInfo} sourceInfo The source data range info of the pivot table.
19
19
  * @param {PositionType} positionType whether new a sheet or insert a pivot table to the existing sheet.
20
20
  * @param {AnchorCellInfo} anchorCellInfo The target cell info of the pivot table.
21
21
  * @returns {string|undefined} The added pivot table id.
22
22
  * @example
23
23
  * ```typescript
24
24
  * // should ensure the sheet range {0,0,8,6} is not empty
25
- * const fWorkbook = univerAPI.getActiveWorkbook()
26
- * const unitId = fWorkbook.getId()
25
+ * const fWorkbook = univerAPI.getActiveWorkbook();
26
+ * const unitId = fWorkbook.getId();
27
27
  * const fSheet = fWorkbook.getActiveSheet();
28
- * const subUnitId = fSheet.getSheetId()
28
+ * const subUnitId = fSheet.getSheetId();
29
29
  * const sheetName = fSheet.getSheetName();
30
30
  * const sourceInfo = {
31
31
  * unitId,
@@ -37,20 +37,24 @@ export interface IFWorkbookSheetsPivotMixin {
37
37
  * startColumn: 0,
38
38
  * endColumn: 6
39
39
  * }
40
- * }
40
+ * };
41
41
  * const anchorCellInfo = {
42
42
  * unitId,
43
43
  * subUnitId,
44
- * row: 0,
44
+ * row: 20,
45
45
  * col: 8
46
- * }
47
- * const fp = await fWorkbook.addPivotTable(sourceInfo, 'exiting', anchorCellInfo)
46
+ * };
47
+ * const fPivotTable = await fWorkbook.addPivotTable(sourceInfo, 'existing', anchorCellInfo);
48
+ * const pivotTableId = fPivotTable.getPivotTableId();
49
+ * let hasAdded = false;
48
50
  * // the addPivotTable is async, you can add pivot fields after the pivot table is added
49
- * // in the future, we will support pivot table added event, you can add pivot fields in the event handler
50
- * setTimeout(function() {
51
- * fp.addField(1, 2)
52
- * fp.addField(1, 3)
53
- * }, 1000)
51
+ * univerAPI.addEvent(univerAPI.Event.PivotTableRendered, (params) => {
52
+ * if (!hasAdded && params.pivotTableId === pivotTableId) {
53
+ * fPivotTable.addField(1, univerAPI.Enum.PivotTableFiledAreaEnum.Row, 0);
54
+ * fPivotTable.addField(1, univerAPI.Enum.PivotTableFiledAreaEnum.Value, 0);
55
+ * hasAdded = true;
56
+ * }
57
+ * });
54
58
  * ```
55
59
  */
56
60
  addPivotTable(sourceInfo: IUnitRangeName & {
@@ -63,14 +67,41 @@ export interface IFWorkbookSheetsPivotMixin {
63
67
  * @param {number} row The checked row.
64
68
  * @param {number} col The checked column.
65
69
  * @returns {string|undefined} The pivot table id or undefined.
70
+ * @example
71
+ * ```typescript
72
+ * const fWorkbook = univerAPI.getActiveWorkbook();
73
+ * const unitId = fWorkbook.getId();
74
+ * const fSheet = fWorkbook.getActiveSheet();
75
+ * const subUnitId = fSheet.getSheetId();
76
+ * const pivotTable = fWorkbook.getPivotTableByCell(unitId, subUnitId, 1, 1);
77
+ * if(pivotTable) {
78
+ * pivotTable.addField(1, univerAPI.Enum.PivotTableFiledAreaEnum.Row, 0);
79
+ * }
80
+ * ```
66
81
  */
67
82
  getPivotTableByCell(unitId: string, subUnitId: string, row: number, col: number): FPivotTable | undefined;
83
+ /**
84
+ * @description Get the pivot table by the pivot table id.
85
+ * @param {string} pivotTableId The pivot table id.
86
+ * @returns {string|undefined} The pivot table instance or undefined.
87
+ * @example
88
+ * ```typescript
89
+ * const fWorkbook = univerAPI.getActiveWorkbook();
90
+ * const mockId = 'abc123456';
91
+ * const pivotTable = fWorkbook.getPivotTableById(mockId);
92
+ * if(pivotTable) {
93
+ * pivotTable.addField(1, univerAPI.Enum.PivotTableFiledAreaEnum.Row, 0);
94
+ * }
95
+ *```
96
+ */
97
+ getPivotTableById(pivotTableId: string): FPivotTable | undefined;
68
98
  }
69
99
  export declare class FWorkbookSheetsPivotMixin extends FWorkbook implements IFWorkbookSheetsPivotMixin {
70
100
  addPivotTable(sourceInfo: IUnitRangeName & {
71
101
  subUnitId: string;
72
102
  }, positionType: PositionType, anchorCellInfo: IPivotCellPositionInfo): Promise<FPivotTable | undefined>;
73
103
  getPivotTableByCell(unitId: string, subUnitId: string, row: number, col: number): FPivotTable | undefined;
104
+ getPivotTableById(pivotTableId: string): FPivotTable | undefined;
74
105
  }
75
106
  declare module '@univerjs/sheets/facade' {
76
107
  interface FWorkbook extends IFWorkbookSheetsPivotMixin {
@@ -1,4 +1,8 @@
1
1
  import './f-workbook';
2
- export { FPivotTable } from './f-pivot-table';
2
+ import './f-enum';
3
+ import './f-event';
4
+ import './f-univer';
5
+ export type * from './f-enum';
6
+ export type * from './f-event';
3
7
  export type * from './f-pivot-table';
4
8
  export type * from './f-workbook';
@@ -18,6 +18,7 @@ export { UpdatePivotTableSourceRangeMutation } from './commands/mutations/update
18
18
  export { UpdateValuePositionMutation } from './commands/mutations/update-value-position.mutation';
19
19
  export { PivotTableViewDirtyMarkOperation } from './commands/operations/pivot-table-dirty-view.operation';
20
20
  export { AddPivotFieldCommand } from './commands/command/add-pivot-field.command';
21
+ export { AddPivotTableWithConfigCommand } from './commands/command/add-pivot-table-with-config.command';
21
22
  export { AddPivotTableCommand } from './commands/command/add-pivot-table.command';
22
23
  export { MovePivotFieldCommand } from './commands/command/move-pivot-field.command';
23
24
  export { PivotDrillDownCommand } from './commands/command/pivot-drill-down.command';
@@ -31,7 +32,7 @@ export { UpdatePivotValuePositionCommand } from './commands/command/update-value
31
32
  export { MovePivotTableCommand } from './commands/command/move-pivot-table.command';
32
33
  export { BLANK_ROW_COUNT, getAdjustRangesPosition, PivotDisplayDataType, PositionType, SHEET_PIVOT_TABLE_PLUGIN } from './const/const';
33
34
  export { DEFAULT_PIVOT_NUMBER, defaultThemeStyle, transFromCellValue } from './const/const';
34
- export type { IAddPivotFieldMutationParams, 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';
35
+ export type { IAddPivotFieldMutationParams, IPivotCellPositionInfo, IPivotPanelDataInfo, IPivotPanelSourceList, IPivotPanelTableListItemBase, IPivotRangesInfo, IPivotRenderCache, IPivotTableAddedEventParams, IPivotTableCellData, IPivotTableConfig, IPivotTableMovedEventParams, IPivotTableRemovedEventParams, IPivotTableRenderedEventParams, IPivotTableUpdatedEventParams, IPivotViewUpdateInfo, IRangePosition, IRemovePivotFieldMutationParams, IRemovePivotTableMutationParams, IRenamePivotFieldMutationParams, ISetPivotCollapseMutation, ISetPivotFieldFormatMutationParams, ISetPivotFilterMutationParams, ISetPivotOptionMutationParams, ISetPivotPositionMutationParams, ISetPivotSortMutationParams, ISetPivotSubtotalTypeMutationParams, IUnitRangeNameWithSubUnitId, IUpdateFieldPositionMutationParams, IUpdatePivotFieldSourceInfoMutationParams, IUpdateValuePositionMutationParams, } from './const/type';
35
36
  export { PivotTableOperationEnum } from './const/type';
36
37
  export { SheetsPivotTableConfigModel } from './models/sheets-pivot-config-model';
37
38
  export { SheetsPivotDataSourceModel } from './models/sheets-pivot-data-source-model';
@@ -50,6 +51,7 @@ export type { ISetPivotSortCommandParams } from './commands/command/set-pivot-so
50
51
  export type { IUpdatePivotFieldSettingCommandParams } from './commands/command/update-pivot-setting.command';
51
52
  export type { IUpdatePivotTableSourceRangeCommandParams } from './commands/command/update-pivot-source.command';
52
53
  export type { IUpdatePivotValuePositionCommandParams } from './commands/command/update-value-position.command';
54
+ export type { IMovePivotTableCommandProps } from './commands/command/move-pivot-table.command';
53
55
  export { SheetsPivotTableService } from './services/sheets-pivot-table.service';
54
56
  export { SHEETS_PIVOT_PLUGIN_CONFIG_KEY } from './controllers/config.schema';
55
57
  export type { IUniverSheetsPivotConfig } from './controllers/config.schema';
@@ -1,5 +1,5 @@
1
- import { Nullable, ObjectMatrix, Disposable, ICommandService, Injector, IUniverInstanceService } from '@univerjs/core';
2
1
  import { IFieldsCollectionJSON } from '@univerjs-pro/engine-pivot';
2
+ import { Nullable, ObjectMatrix, Disposable, ICommandService, Injector, IUniverInstanceService } from '@univerjs/core';
3
3
  import { IDataFieldManagerJSON, IPivotCellPositionInfo, IPivotRangesInfo, IPivotTableCellData, IPivotTableConfig, IPivotTableMatrixInfo, IPivotTableRangeInfo } from '../const/type';
4
4
  export declare class SheetsPivotTableConfigModel extends Disposable {
5
5
  private _injector;
@@ -28,6 +28,7 @@ export declare class SheetsPivotTableConfigModel extends Disposable {
28
28
  getTextInfo(): Record<string, string>;
29
29
  updateViewInfo(unitId: string, subUnitId: string, pivotTableId: string, valueMatrix: ObjectMatrix<Nullable<IPivotTableCellData>>, rangesCache: IPivotRangesInfo | undefined): void;
30
30
  getPivotTableConfig(unitId: string, subUnitId: string, pivotTableId: string): Nullable<IPivotTableConfig>;
31
+ getTargetByPivotTableId(unitId: string, pivotTableId: string): IPivotCellPositionInfo | undefined;
31
32
  getTargetByPivotId(unitId: string, subUnitId: string, pivotTableId: string): Nullable<IPivotCellPositionInfo>;
32
33
  getSubUnitPivotConfigs(unitId: string, subUnitId: string): Map<string, IPivotTableConfig> | undefined;
33
34
  updateConfigCache(unitId: string, subUnitId: string, pivotTableId: string, pivotTableConfig: Nullable<IPivotTableConfig>): void;
@@ -1,5 +1,5 @@
1
1
  import { IRange, Nullable, Disposable, Injector, IUniverInstanceService, LocaleService, ObjectMatrix } from '@univerjs/core';
2
- import { IPivotRangesInfo, IPivotRenderCache, IPivotTableCellData, IPivotTableConfigChangeInfo, PivotTableOperationEnum } from '../const/type';
2
+ import { IPivotRangesInfo, IPivotRenderCache, IPivotTableCellData, IPivotTableConfigChangeInfo, IPivotViewUpdateInfo } from '../const/type';
3
3
  import { IExclusiveRangeService } from '@univerjs/sheets';
4
4
  import { SheetsPivotTableConfigModel } from './sheets-pivot-config-model';
5
5
  export declare class SheetsPivotTableAdaptorModel extends Disposable {
@@ -16,14 +16,7 @@ export declare class SheetsPivotTableAdaptorModel extends Disposable {
16
16
  subUnitId: string;
17
17
  }>;
18
18
  private _viewUpdate$;
19
- viewUpdate$: import('rxjs').Observable<{
20
- unitId: string;
21
- subUnitId: string;
22
- pivotTableId: string;
23
- rangesCache: IPivotRangesInfo | undefined;
24
- valueMatrix: ObjectMatrix<Nullable<IPivotTableCellData>>;
25
- type: PivotTableOperationEnum;
26
- }>;
19
+ viewUpdate$: import('rxjs').Observable<IPivotViewUpdateInfo>;
27
20
  private _textInfo;
28
21
  constructor(_localeService: LocaleService, _injector: Injector, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _univerInstanceService: IUniverInstanceService, _exclusiveRangeService: IExclusiveRangeService);
29
22
  private _initUnitDisposed;
package/lib/umd/facade.js CHANGED
@@ -1 +1 @@
1
- function _0x42b6(_0x1d1e41,_0x47d786){const _0x552b61=_0x552b();return _0x42b6=function(_0x42b65f,_0x10ac9a){_0x42b65f=_0x42b65f-0x11f;let _0x40b860=_0x552b61[_0x42b65f];return _0x40b860;},_0x42b6(_0x1d1e41,_0x47d786);}(function(_0x41c302,_0x213add){const _0x5f498d=_0x42b6,_0xc7595f=_0x41c302();while(!![]){try{const _0x2e920a=-parseInt(_0x5f498d(0x130))/0x1*(parseInt(_0x5f498d(0x135))/0x2)+parseInt(_0x5f498d(0x127))/0x3*(parseInt(_0x5f498d(0x152))/0x4)+parseInt(_0x5f498d(0x154))/0x5+-parseInt(_0x5f498d(0x13f))/0x6*(-parseInt(_0x5f498d(0x129))/0x7)+parseInt(_0x5f498d(0x144))/0x8+-parseInt(_0x5f498d(0x138))/0x9*(parseInt(_0x5f498d(0x148))/0xa)+parseInt(_0x5f498d(0x159))/0xb*(parseInt(_0x5f498d(0x15a))/0xc);if(_0x2e920a===_0x213add)break;else _0xc7595f['push'](_0xc7595f['shift']());}catch(_0xad8042){_0xc7595f['push'](_0xc7595f['shift']());}}}(_0x552b,0x51adb),function(_0x5b8f3d,_0x38d67b){const _0xf1c7a6=_0x42b6;typeof exports=='object'&&typeof module<'u'?_0x38d67b(exports,require(_0xf1c7a6(0x121)),require(_0xf1c7a6(0x137)),require(_0xf1c7a6(0x12d)),require(_0xf1c7a6(0x143))):typeof define==_0xf1c7a6(0x14f)&&define[_0xf1c7a6(0x14c)]?define(['exports',_0xf1c7a6(0x121),'@univerjs/sheets/facade',_0xf1c7a6(0x12d),_0xf1c7a6(0x143)],_0x38d67b):(_0x5b8f3d=typeof globalThis<'u'?globalThis:_0x5b8f3d||self,_0x38d67b(_0x5b8f3d[_0xf1c7a6(0x12f)]={},_0x5b8f3d[_0xf1c7a6(0x125)],_0x5b8f3d[_0xf1c7a6(0x155)],_0x5b8f3d[_0xf1c7a6(0x15d)],_0x5b8f3d[_0xf1c7a6(0x120)]));}(this,function(_0x3254d4,_0x271e0a,_0x3428df,_0x557c01,_0x25ef71){'use strict';const _0x46c7ba=_0x42b6;var _0x148de0=Object['defineProperty'],_0xec7707=(_0x26c511,_0x3afb19,_0x3d5512)=>_0x3afb19 in _0x26c511?_0x148de0(_0x26c511,_0x3afb19,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x3d5512}):_0x26c511[_0x3afb19]=_0x3d5512,_0x51da9f=(_0x168a85,_0x165f5b,_0x5ba0be)=>_0xec7707(_0x168a85,typeof _0x165f5b!=_0x46c7ba(0x141)?_0x165f5b+'':_0x165f5b,_0x5ba0be);class _0xf606f2{constructor(_0x14495c,_0x183e9a,_0x326922,_0x1b8d16){const _0x10bb97=_0x46c7ba;_0x51da9f(this,_0x10bb97(0x128)),_0x51da9f(this,'subUnitId'),_0x51da9f(this,_0x10bb97(0x146)),_0x51da9f(this,'_injector'),(this[_0x10bb97(0x128)]=_0x14495c,this[_0x10bb97(0x14d)]=_0x183e9a,this[_0x10bb97(0x146)]=_0x326922,this[_0x10bb97(0x140)]=_0x1b8d16);}['getConfig'](){const _0x374d31=_0x46c7ba;return this[_0x374d31(0x140)]['get'](_0x25ef71[_0x374d31(0x12e)])[_0x374d31(0x12b)](this[_0x374d31(0x128)],this[_0x374d31(0x14d)],this[_0x374d31(0x146)]);}['getPivotTableRangeInfo'](){const _0x53837b=_0x46c7ba;var _0x2e06b6;const _0x3d1f17=(_0x2e06b6=this[_0x53837b(0x140)][_0x53837b(0x131)](_0x25ef71[_0x53837b(0x12e)])[_0x53837b(0x15b)](this[_0x53837b(0x128)],this[_0x53837b(0x14d)],this[_0x53837b(0x146)]))==null?void 0x0:_0x2e06b6[_0x53837b(0x13a)];if(_0x3d1f17)return _0x25ef71[_0x53837b(0x122)](_0x3d1f17);}async['remove'](){const _0x1e3df7=_0x46c7ba;return await this['_injector'][_0x1e3df7(0x131)](_0x271e0a[_0x1e3df7(0x153)])['syncExecuteCommand'](_0x25ef71[_0x1e3df7(0x12a)]['id'],{'unitId':this[_0x1e3df7(0x128)],'subUnitId':this[_0x1e3df7(0x14d)],'pivotTableId':this[_0x1e3df7(0x146)]});}async[_0x46c7ba(0x123)](_0xf6a319,_0x4949a4,_0x2f33bc){const _0x460586=_0x46c7ba,_0x1cbc43=this[_0x460586(0x140)],_0x5eeea8=this['unitId'],_0x53eb2c=this[_0x460586(0x14d)],_0xd1c380=this[_0x460586(0x146)],_0xe190dc=_0x1cbc43[_0x460586(0x131)](_0x271e0a[_0x460586(0x153)]),_0x589dcb=_0x1cbc43[_0x460586(0x131)](_0x25ef71[_0x460586(0x12e)]),_0x1eeb31=_0x589dcb[_0x460586(0x12b)](_0x5eeea8,_0x53eb2c,_0xd1c380),_0x31e228=_0x589dcb[_0x460586(0x134)](_0x5eeea8,_0xd1c380);if(!_0x1eeb31||!_0x31e228)return!0x1;let _0x50aa0c=_0xf6a319;typeof _0x50aa0c==_0x460586(0x13c)&&(_0x50aa0c=_0x589dcb['getCollection'](_0x5eeea8,_0xd1c380)[_0x460586(0x136)][_0xf6a319]);const _0x192d77={'unitId':_0x5eeea8,'subUnitId':_0x53eb2c,'pivotTableId':_0xd1c380,'dataFieldId':_0x50aa0c,'fieldArea':_0x4949a4,'index':_0x2f33bc};return _0xe190dc[_0x460586(0x126)](_0x25ef71[_0x460586(0x147)]['id'],_0x192d77);}async[_0x46c7ba(0x11f)](_0x2a5977){const _0x36c4d2=_0x46c7ba,_0x9054a7=this[_0x36c4d2(0x140)],_0x5025f3=this[_0x36c4d2(0x128)],_0x1bbad2=this[_0x36c4d2(0x14d)],_0x8a22e4=this[_0x36c4d2(0x146)],_0x2527fb=_0x9054a7[_0x36c4d2(0x131)](_0x271e0a[_0x36c4d2(0x153)]),_0x206322={'unitId':_0x5025f3,'subUnitId':_0x1bbad2,'pivotTableId':_0x8a22e4,'fieldIds':_0x2a5977};return _0x2527fb[_0x36c4d2(0x126)](_0x25ef71['RemovePivotFieldCommand']['id'],_0x206322);}async['updateFieldPosition'](_0x52bb9f,_0x17db0b,_0xee7502){const _0x1c327c=_0x46c7ba,_0x5d03ea=this[_0x1c327c(0x140)],_0x22f924=this[_0x1c327c(0x128)],_0x26b6bd=this['subUnitId'],_0xaf1eab=this['pivotTableId'],_0x55fee5=_0x5d03ea[_0x1c327c(0x131)](_0x271e0a['ICommandService']),_0x3c690a={'unitId':_0x22f924,'subUnitId':_0x26b6bd,'pivotTableId':_0xaf1eab,'fieldId':_0x52bb9f,'area':_0x17db0b,'index':_0xee7502};return _0x55fee5[_0x1c327c(0x126)](_0x25ef71[_0x1c327c(0x14b)]['id'],_0x3c690a);}async['updateValuePosition'](_0x23e939,_0x4cbaad){const _0x5bd787=_0x46c7ba,_0x32a634=this[_0x5bd787(0x140)],_0x4e9a96=this[_0x5bd787(0x128)],_0x2136bf=this[_0x5bd787(0x14d)],_0x7eda91=this[_0x5bd787(0x146)],_0x3854df=_0x32a634[_0x5bd787(0x131)](_0x271e0a[_0x5bd787(0x153)]),_0x28c868={'unitId':_0x4e9a96,'subUnitId':_0x2136bf,'pivotTableId':_0x7eda91,'position':_0x23e939,'index':_0x4cbaad};return _0x3854df[_0x5bd787(0x126)](_0x25ef71[_0x5bd787(0x149)]['id'],_0x28c868);}async['setSubtotalType'](_0x51f987,_0x106b99){const _0x88e951=_0x46c7ba,_0x47cafa=this['_injector'],_0x57c0dc=this[_0x88e951(0x128)],_0xe10951=this[_0x88e951(0x14d)],_0x3271e5=this[_0x88e951(0x146)],_0x419433=_0x47cafa[_0x88e951(0x131)](_0x271e0a[_0x88e951(0x153)]),_0x2aa7a1={'unitId':_0x57c0dc,'subUnitId':_0xe10951,'pivotTableId':_0x3271e5,'fieldId':_0x51f987,'subtotalType':_0x106b99};return _0x419433['executeCommand'](_0x25ef71[_0x88e951(0x13d)]['id'],_0x2aa7a1);}async[_0x46c7ba(0x132)](_0x3e46d0,_0x997f9c){const _0x2dd7eb=_0x46c7ba,_0x316cc4=this[_0x2dd7eb(0x140)],_0x34b0c0=this[_0x2dd7eb(0x128)],_0x2bfcf1=this[_0x2dd7eb(0x14d)],_0x414147=this['pivotTableId'],_0x2c2ca7=_0x316cc4[_0x2dd7eb(0x131)](_0x271e0a[_0x2dd7eb(0x153)]),_0x3409e2={'unitId':_0x34b0c0,'subUnitId':_0x2bfcf1,'tableFieldId':_0x3e46d0,'pivotTableId':_0x414147,'info':_0x997f9c};return _0x2c2ca7[_0x2dd7eb(0x126)](_0x25ef71[_0x2dd7eb(0x139)]['id'],_0x3409e2);}async[_0x46c7ba(0x15c)](_0x5e8f55,_0x5c4a88,_0x5d8fa7){const _0x43113a=_0x46c7ba,_0xce6b8d=this[_0x43113a(0x140)],_0x40893c=this[_0x43113a(0x128)],_0x5e0ab1=this[_0x43113a(0x14d)],_0x3bcd3d=this[_0x43113a(0x146)],_0x34b5ac=_0xce6b8d[_0x43113a(0x131)](_0x271e0a[_0x43113a(0x153)]),_0x51ce6f={'unitId':_0x40893c,'subUnitId':_0x5e0ab1,'pivotTableId':_0x3bcd3d,'tableFieldId':_0x5e8f55,'items':_0x5c4a88,'isAll':_0x5d8fa7};return _0x34b5ac[_0x43113a(0x126)](_0x25ef71[_0x43113a(0x124)]['id'],_0x51ce6f);}async[_0x46c7ba(0x13b)](_0x3ea54c,_0x14112e){const _0x2581bb=_0x46c7ba,_0x4f4bac=this['_injector'],_0x1ce769=this[_0x2581bb(0x128)],_0x36dc1c=this[_0x2581bb(0x14d)],_0x5c8b1e=this['pivotTableId'],_0x1d5852=_0x4f4bac['get'](_0x271e0a[_0x2581bb(0x153)]),_0x44d021={'unitId':_0x1ce769,'subUnitId':_0x36dc1c,'pivotTableId':_0x5c8b1e,'fieldId':_0x3ea54c,'name':_0x14112e};return _0x1d5852[_0x2581bb(0x126)](_0x25ef71[_0x2581bb(0x14a)]['id'],_0x44d021);}async[_0x46c7ba(0x13e)](_0x1f2764,_0x1dd2e9,_0x4be492){const _0x4cf488=_0x46c7ba,_0x572144=this[_0x4cf488(0x140)][_0x4cf488(0x131)](_0x271e0a[_0x4cf488(0x153)]),_0x103aca=this[_0x4cf488(0x140)][_0x4cf488(0x131)](_0x271e0a['IUniverInstanceService'])['getUnit'](this[_0x4cf488(0x128)]),_0x58dd23=_0x103aca==null?void 0x0:_0x103aca[_0x4cf488(0x15e)](_0x1f2764);if(!_0x103aca||!_0x58dd23)throw new Error(_0x4cf488(0x151));return _0x572144['executeCommand'](_0x25ef71['MovePivotTableCommand']['id'],{'pivotTableId':this['pivotTableId'],'targetCellInfo':{'subUnitId':_0x58dd23['getSheetId'](),'unitId':this['unitId'],'row':_0x1dd2e9,'col':_0x4be492},'originTargetInfo':{'subUnitId':this['subUnitId'],'unitId':this[_0x4cf488(0x128)]}});}}class _0x5d66c8 extends _0x3428df[_0x46c7ba(0x145)]{async['addPivotTable'](_0x571bb2,_0x356b44,_0x4cb5d7){const _0x38db05=_0x46c7ba,_0x5e98a5=this['_injector'],_0x5bcc92=_0x5e98a5['get'](_0x271e0a[_0x38db05(0x153)]),_0x1ae175=_0x557c01[_0x38db05(0x158)](0x8),_0x210bb7={'positionType':_0x356b44,'pivotTableId':_0x1ae175,'pivotTableConfig':{'targetCellInfo':_0x4cb5d7,'sourceRangeInfo':_0x571bb2,'isEmpty':!0x0}};if(await _0x5bcc92[_0x38db05(0x126)](_0x25ef71['AddPivotTableCommand']['id'],_0x210bb7))return new _0xf606f2(_0x4cb5d7[_0x38db05(0x128)],_0x4cb5d7[_0x38db05(0x14d)],_0x1ae175,_0x5e98a5);}[_0x46c7ba(0x157)](_0x2528f9,_0x106239,_0x3a1727,_0x33a399){const _0x163939=_0x46c7ba,_0x17b412=this['_injector'],_0x23223e=_0x17b412[_0x163939(0x131)](_0x25ef71[_0x163939(0x133)])[_0x163939(0x156)](_0x2528f9,_0x106239,_0x3a1727,_0x33a399);if(_0x23223e)return new _0xf606f2(_0x2528f9,_0x106239,_0x23223e,_0x17b412);}}_0x3428df[_0x46c7ba(0x145)][_0x46c7ba(0x142)](_0x5d66c8),_0x3254d4['FPivotTable']=_0xf606f2,Object[_0x46c7ba(0x150)](_0x3254d4,Symbol[_0x46c7ba(0x14e)],{'value':_0x46c7ba(0x12c)});}));function _0x552b(){const _0x4741a1=['@univerjs-pro/sheets-pivot','1671680SzycgI','FWorkbook','pivotTableId','AddPivotFieldCommand','156210XELuHa','UpdatePivotValuePositionCommand','RenamePivotFieldMutation','MovePivotFieldCommand','amd','subUnitId','toStringTag','function','defineProperty','[Pivot\x20Table]:\x20Target\x20sheet\x20is\x20not\x20valid','52zmqOMP','ICommandService','1208325cMsNhL','UniverSheetsFacade','getPivotTableIdByCell','getPivotTableByCell','generateHexNumber','55iTsVNQ','264444kpktfx','getPivotTableRangeInfo','setLabelManualFilter','UniverProEnginePivot','getSheetBySheetName','removeField','UniverProSheetsPivot','@univerjs/core','unionPivotViewRange','addField','SetPivotFilterCommand','UniverCore','executeCommand','2949orRFGi','unitId','42QtiQsT','RemovePivotTableMutation','getPivotTableConfig','Module','@univerjs-pro/engine-pivot','SheetsPivotTableConfigModel','UniverProSheetsPivotFacade','1unQgYa','get','setLabelSort','SheetsPivotTableAdaptorModel','getCollection','159816mBljPm','fieldIds','@univerjs/sheets/facade','108JTSLdj','SetPivotSortCommand','rangeInfo','renameField','number','SetPivotSubtotalTypeMutation','move','28326cMdWpr','_injector','symbol','extend'];_0x552b=function(){return _0x4741a1;};return _0x552b();}
1
+ function _0x1ed3(_0x33d10f,_0x554c4d){const _0x4306c3=_0x4306();return _0x1ed3=function(_0x1ed3a1,_0xb85965){_0x1ed3a1=_0x1ed3a1-0x18e;let _0x3e47f5=_0x4306c3[_0x1ed3a1];return _0x3e47f5;},_0x1ed3(_0x33d10f,_0x554c4d);}function _0x4306(){const _0x3dd3ee=['executeCommand','range','PivotTableValuePositionEnum','SetPivotFilterCommand','setLabelSort','BeforePivotTableAdd','disposeWithMe','8331208VAfTUZ','PivotTableFieldMoved','AddPivotTableCommand','getSheetId','RemovePivotTableMutation','_firePivotTableFieldCollapsedEvent','startRow','PivotSubtotalTypeEnum','_fireRenderPivotTableEvent','@univerjs/sheets/facade','ICommandService','9MgGeEw','concat','MovePivotTableCommand','amd','UniverProSheetsPivot','params','UniverCore','PivotDataFieldSortTypeEnum','PivotTableFieldSortChanged','remove','unionPivotViewRange','BeforePivotTableMove','_firePivotTableValuePositionChangedEvent','RenamePivotFieldMutation','IUniverInstanceService','getFieldSetting','Row','subscribe','get','UniverProEnginePivot','_firePivotTableFieldSortChangedEvent','targetCellInfo','fireEvent','SheetsPivotTableConfigModel','pivotTableId','getCollection','FWorkbook','FEventName','PivotDataFieldSortOperatorEnum','152142qBxrqa','FEnum','[Pivot\x20Table]:\x20Target\x20sheet\x20is\x20not\x20valid','UpdatePivotFieldSettingCommand','PivotTableChangeTypeEnum','lifecycle$','extend','fieldIds','defineProperty','LifecycleService','Value','row','_fireAddPivotTableEvent','106YjWxfm','updateValuePosition','rowFields','getTargetByPivotTableId','Column','col','getPivotTableConfig','syncExecuteCommand','onCommandExecuted','PivotTableFieldSettingChanged','8suTvih','move','subUnitId','AddPivotTableWithConfigCommand','SheetsPivotTableAdaptorModel','PivotTableFiledAreaEnum','number','Event','159350zlitOg','getConfig','PivotTableFieldAdded','setSubtotalType','endRow','PivotFilterTypeEnum','object','@univerjs-pro/sheets-pivot','FUniver','addPivotTable','cancel','_injector','1661wacCVg','PivotDataFieldDataTypeEnum','PivotTableFieldFilterChanged','AddPivotFieldCommand','SetPivotSubtotalTypeMutation','_fireMovedPivotTableEvent','valueFields','getPivotTableId','dimension','_initialize','_firePivotTableFieldRemovedEvent','Ready','rangeInfo','Before\x20move\x20pivot\x20table\x20event\x20canceled','ST_PivotFilterOperatorEnum','19344534hWldzS','_firePivotTableFieldFilterChangedEvent','function','PivotTableRendered','_fireBeforeAddPivotTableEvent','viewUpdate$','beforeCommandExecuted','getPivotTableById','_firePivotTableFieldMovedEvent','getId','66540pLXRKg','PivotTableRemoved','filterFields','hasEventCallback','getUnit','endColumn','_fireBeforeMovePivotTableEvent','startColumn','getPivotTableIdByCell','PivotTableMoved','unitId','@univerjs/core','sheetName','PivotTableAdded','Before\x20add\x20pivot\x20table\x20event\x20canceled','PivotTableFieldCollapseChanged','_firePivotTableRemovedEvent','SetPivotCollapseCommand','PivotTableValuePositionChanged','329xaYkIy','fieldsConfig','UpdatePivotValuePositionCommand','Filter','MovePivotFieldCommand','691840hQxXGh','SetPivotSortCommand','columnFields','setLabelManualFilter','getPivotTableByCell','PositionType','RemovePivotFieldCommand','_firePivotTableFieldAddedEvent','PivotTableFieldRemoved'];_0x4306=function(){return _0x3dd3ee;};return _0x4306();}(function(_0x33964a,_0x2a4fff){const _0x444a4f=_0x1ed3,_0x2e7bba=_0x33964a();while(!![]){try{const _0x12eb7a=parseInt(_0x444a4f(0x1b7))/0x1*(parseInt(_0x444a4f(0x199))/0x2)+-parseInt(_0x444a4f(0x1d0))/0x3*(parseInt(_0x444a4f(0x1a3))/0x4)+parseInt(_0x444a4f(0x1e8))/0x5+parseInt(_0x444a4f(0x220))/0x6*(parseInt(_0x444a4f(0x1e3))/0x7)+parseInt(_0x444a4f(0x1f8))/0x8+parseInt(_0x444a4f(0x203))/0x9*(-parseInt(_0x444a4f(0x1ab))/0xa)+-parseInt(_0x444a4f(0x1c6))/0xb;if(_0x12eb7a===_0x2a4fff)break;else _0x2e7bba['push'](_0x2e7bba['shift']());}catch(_0x495b24){_0x2e7bba['push'](_0x2e7bba['shift']());}}}(_0x4306,0x9c6b4),function(_0x53dae8,_0x2c9b03){const _0x4f8156=_0x1ed3;typeof exports==_0x4f8156(0x1b1)&&typeof module<'u'?_0x2c9b03(require('@univerjs-pro/engine-pivot'),require(_0x4f8156(0x1b2)),require(_0x4f8156(0x1db)),require(_0x4f8156(0x201))):typeof define==_0x4f8156(0x1c8)&&define[_0x4f8156(0x206)]?define(['@univerjs-pro/engine-pivot',_0x4f8156(0x1b2),_0x4f8156(0x1db),_0x4f8156(0x201)],_0x2c9b03):(_0x53dae8=typeof globalThis<'u'?globalThis:_0x53dae8||self,_0x2c9b03(_0x53dae8[_0x4f8156(0x216)],_0x53dae8[_0x4f8156(0x207)],_0x53dae8[_0x4f8156(0x209)],_0x53dae8['UniverSheetsFacade']));}(this,function(_0x13d971,_0x1eff16,_0x15acbd,_0x1250f0){'use strict';const _0x5193ea=_0x1ed3;var _0x5bbda0=Object[_0x5193ea(0x194)],_0x4da5ec=(_0x3a4bb8,_0x1ac952,_0x4cd922)=>_0x1ac952 in _0x3a4bb8?_0x5bbda0(_0x3a4bb8,_0x1ac952,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x4cd922}):_0x3a4bb8[_0x1ac952]=_0x4cd922,_0x3e61bb=(_0x5be3c6,_0x39c2c4,_0x428f95)=>_0x4da5ec(_0x5be3c6,typeof _0x39c2c4!='symbol'?_0x39c2c4+'':_0x39c2c4,_0x428f95);class _0x2ade73{constructor(_0x36e511,_0x3e2843,_0x2bfd2b,_0xff5b7a){const _0x33edb1=_0x5193ea;_0x3e61bb(this,_0x33edb1(0x1da)),_0x3e61bb(this,_0x33edb1(0x1a5)),_0x3e61bb(this,_0x33edb1(0x21b)),_0x3e61bb(this,'_injector'),(this[_0x33edb1(0x1da)]=_0x36e511,this[_0x33edb1(0x1a5)]=_0x3e2843,this[_0x33edb1(0x21b)]=_0x2bfd2b,this['_injector']=_0xff5b7a);}[_0x5193ea(0x1ac)](){const _0x1337e6=_0x5193ea;return this[_0x1337e6(0x1b6)]['get'](_0x1eff16[_0x1337e6(0x21a)])[_0x1337e6(0x19f)](this['unitId'],this[_0x1337e6(0x1a5)],this[_0x1337e6(0x21b)]);}[_0x5193ea(0x1be)](){return this['pivotTableId'];}[_0x5193ea(0x212)](_0x5b7b20){const _0x22ca6a=_0x5193ea,_0xd264ae=this[_0x22ca6a(0x1b6)][_0x22ca6a(0x215)](_0x1eff16[_0x22ca6a(0x21a)])[_0x22ca6a(0x19f)](this[_0x22ca6a(0x1da)],this[_0x22ca6a(0x1a5)],this[_0x22ca6a(0x21b)]),_0x9329d4=_0xd264ae==null?void 0x0:_0xd264ae[_0x22ca6a(0x1e4)];if(_0x9329d4)return _0x9329d4[_0x22ca6a(0x1bf)][_0x5b7b20]||_0x9329d4['measure'][_0x5b7b20];}['getFieldIdsByArea'](_0x4ea909){const _0x119b9e=_0x5193ea,_0x3df9c2=this[_0x119b9e(0x1b6)][_0x119b9e(0x215)](_0x1eff16[_0x119b9e(0x21a)])[_0x119b9e(0x19f)](this['unitId'],this['subUnitId'],this[_0x119b9e(0x21b)]),_0x4cc799=_0x3df9c2==null?void 0x0:_0x3df9c2['fieldsConfig'];if(_0x4cc799)switch(_0x4ea909){case _0x13d971[_0x119b9e(0x1a8)][_0x119b9e(0x19d)]:return _0x4cc799[_0x119b9e(0x1ea)][_0x119b9e(0x204)]();case _0x13d971[_0x119b9e(0x1a8)][_0x119b9e(0x213)]:return _0x4cc799[_0x119b9e(0x19b)][_0x119b9e(0x204)]();case _0x13d971[_0x119b9e(0x1a8)][_0x119b9e(0x196)]:return _0x4cc799[_0x119b9e(0x1bd)]['concat']();case _0x13d971[_0x119b9e(0x1a8)][_0x119b9e(0x1e6)]:return _0x4cc799[_0x119b9e(0x1d2)]['concat']();case _0x13d971[_0x119b9e(0x1a8)]['Hidden']:return _0x4cc799['hiddenFields'][_0x119b9e(0x204)]();}return[];}['getPivotTableRangeInfo'](){const _0x145967=_0x5193ea;var _0x2e0296;const _0x48e359=(_0x2e0296=this['_injector'][_0x145967(0x215)](_0x1eff16[_0x145967(0x21a)])['getPivotTableRangeInfo'](this[_0x145967(0x1da)],this[_0x145967(0x1a5)],this[_0x145967(0x21b)]))==null?void 0x0:_0x2e0296[_0x145967(0x1c3)];if(_0x48e359)return _0x1eff16[_0x145967(0x20d)](_0x48e359);}async[_0x5193ea(0x20c)](){const _0x3ac84d=_0x5193ea;return await this['_injector'][_0x3ac84d(0x215)](_0x15acbd['ICommandService'])[_0x3ac84d(0x1a0)](_0x1eff16[_0x3ac84d(0x1fc)]['id'],{'unitId':this[_0x3ac84d(0x1da)],'subUnitId':this['subUnitId'],'pivotTableId':this[_0x3ac84d(0x21b)]});}async['addField'](_0x351a1c,_0x2f4f76,_0x412d57){const _0x1e70cd=_0x5193ea,_0x4547e1=this[_0x1e70cd(0x1b6)],_0x562853=this[_0x1e70cd(0x1da)],_0x1c5cb0=this['subUnitId'],_0x2c2512=this[_0x1e70cd(0x21b)],_0x3279fc=_0x4547e1[_0x1e70cd(0x215)](_0x15acbd[_0x1e70cd(0x202)]),_0x1b6b2f=_0x4547e1[_0x1e70cd(0x215)](_0x1eff16[_0x1e70cd(0x21a)]),_0x5a0649=_0x1b6b2f[_0x1e70cd(0x19f)](_0x562853,_0x1c5cb0,_0x2c2512),_0x327991=_0x1b6b2f['getCollection'](_0x562853,_0x2c2512);if(!_0x5a0649||!_0x327991)return!0x1;let _0x34a166=_0x351a1c;typeof _0x34a166==_0x1e70cd(0x1a9)&&(_0x34a166=_0x1b6b2f[_0x1e70cd(0x21c)](_0x562853,_0x2c2512)[_0x1e70cd(0x193)][_0x351a1c]);const _0x543455={'unitId':_0x562853,'subUnitId':_0x1c5cb0,'pivotTableId':_0x2c2512,'dataFieldId':_0x34a166,'fieldArea':_0x2f4f76,'index':_0x412d57};return _0x3279fc[_0x1e70cd(0x1f1)](_0x1eff16[_0x1e70cd(0x1ba)]['id'],_0x543455);}async['removeField'](_0x5a78eb){const _0x4be893=_0x5193ea,_0x203bd7=this['_injector'],_0x5e8ca8=this[_0x4be893(0x1da)],_0x2b98e6=this['subUnitId'],_0xa52e38=this[_0x4be893(0x21b)],_0x501fec=_0x203bd7['get'](_0x15acbd[_0x4be893(0x202)]),_0x2e0093={'unitId':_0x5e8ca8,'subUnitId':_0x2b98e6,'pivotTableId':_0xa52e38,'fieldIds':_0x5a78eb};return _0x501fec[_0x4be893(0x1f1)](_0x1eff16[_0x4be893(0x1ee)]['id'],_0x2e0093);}async['updateFieldPosition'](_0x26df01,_0x230ea7,_0x5cb57f){const _0x3957ab=_0x5193ea,_0x375748=this[_0x3957ab(0x1b6)],_0x2be921=this['unitId'],_0x56f4cd=this['subUnitId'],_0x1b5c9c=this[_0x3957ab(0x21b)],_0x1b905a=_0x375748['get'](_0x15acbd[_0x3957ab(0x202)]),_0xd37b4e={'unitId':_0x2be921,'subUnitId':_0x56f4cd,'pivotTableId':_0x1b5c9c,'fieldId':_0x26df01,'area':_0x230ea7,'index':_0x5cb57f};return _0x1b905a['executeCommand'](_0x1eff16[_0x3957ab(0x1e7)]['id'],_0xd37b4e);}async[_0x5193ea(0x19a)](_0x327a0d,_0x59ffad){const _0x5c9684=_0x5193ea,_0x2b2a03=this['_injector'],_0xadcb5=this[_0x5c9684(0x1da)],_0x472934=this[_0x5c9684(0x1a5)],_0x8b59f8=this['pivotTableId'],_0x32d0bd=_0x2b2a03[_0x5c9684(0x215)](_0x15acbd[_0x5c9684(0x202)]),_0x357129={'unitId':_0xadcb5,'subUnitId':_0x472934,'pivotTableId':_0x8b59f8,'position':_0x327a0d,'index':_0x59ffad};return _0x32d0bd['executeCommand'](_0x1eff16[_0x5c9684(0x1e5)]['id'],_0x357129);}async[_0x5193ea(0x1ae)](_0x280648,_0x83d4f9){const _0x2e3532=_0x5193ea,_0x21d610=this['_injector'],_0x28900c=this['unitId'],_0x46a4d=this[_0x2e3532(0x1a5)],_0x415407=this[_0x2e3532(0x21b)],_0x2b3a6f=_0x21d610[_0x2e3532(0x215)](_0x15acbd[_0x2e3532(0x202)]),_0x311687={'unitId':_0x28900c,'subUnitId':_0x46a4d,'pivotTableId':_0x415407,'fieldId':_0x280648,'subtotalType':_0x83d4f9};return _0x2b3a6f['executeCommand'](_0x1eff16[_0x2e3532(0x1bb)]['id'],_0x311687);}async[_0x5193ea(0x1f5)](_0x400e8c,_0xa2a6ee){const _0x1ad093=_0x5193ea,_0x33b99a=this['_injector'],_0x2e5c3b=this[_0x1ad093(0x1da)],_0x2255f7=this[_0x1ad093(0x1a5)],_0x10706d=this[_0x1ad093(0x21b)],_0x3f5631=_0x33b99a[_0x1ad093(0x215)](_0x15acbd[_0x1ad093(0x202)]),_0x32153f={'unitId':_0x2e5c3b,'subUnitId':_0x2255f7,'tableFieldId':_0x400e8c,'pivotTableId':_0x10706d,'info':_0xa2a6ee};return _0x3f5631['executeCommand'](_0x1eff16[_0x1ad093(0x1e9)]['id'],_0x32153f);}async[_0x5193ea(0x1eb)](_0x1f2175,_0x51be44,_0x3a578c){const _0x152d0f=_0x5193ea,_0x36fc50=this[_0x152d0f(0x1b6)],_0xc026e9=this['unitId'],_0xe27435=this[_0x152d0f(0x1a5)],_0x25f4f9=this[_0x152d0f(0x21b)],_0x380cc8=_0x36fc50[_0x152d0f(0x215)](_0x15acbd[_0x152d0f(0x202)]),_0x5cb7a5={'unitId':_0xc026e9,'subUnitId':_0xe27435,'pivotTableId':_0x25f4f9,'tableFieldId':_0x1f2175,'items':_0x51be44,'isAll':_0x3a578c};return _0x380cc8[_0x152d0f(0x1f1)](_0x1eff16['SetPivotFilterCommand']['id'],_0x5cb7a5);}async['renameField'](_0x3a9e82,_0x482618){const _0x53a9e0=_0x5193ea,_0x2afb2b=this[_0x53a9e0(0x1b6)],_0x2ebb98=this[_0x53a9e0(0x1da)],_0x23f70f=this[_0x53a9e0(0x1a5)],_0x2d5501=this[_0x53a9e0(0x21b)],_0x37bda4=_0x2afb2b[_0x53a9e0(0x215)](_0x15acbd['ICommandService']),_0x16bc9a={'unitId':_0x2ebb98,'subUnitId':_0x23f70f,'pivotTableId':_0x2d5501,'fieldId':_0x3a9e82,'name':_0x482618};return _0x37bda4[_0x53a9e0(0x1f1)](_0x1eff16[_0x53a9e0(0x210)]['id'],_0x16bc9a);}async[_0x5193ea(0x1a4)](_0x5200c2,_0x342e75,_0x127a42){const _0x2e0be3=_0x5193ea,_0x33ae69=this['_injector'][_0x2e0be3(0x215)](_0x15acbd['ICommandService']),_0x6eaec6=this[_0x2e0be3(0x1b6)][_0x2e0be3(0x215)](_0x15acbd[_0x2e0be3(0x211)])[_0x2e0be3(0x1d4)](this[_0x2e0be3(0x1da)]),_0x2b3c09=_0x6eaec6==null?void 0x0:_0x6eaec6['getSheetBySheetName'](_0x5200c2);if(!_0x6eaec6||!_0x2b3c09)throw new Error(_0x2e0be3(0x18e));return _0x33ae69[_0x2e0be3(0x1f1)](_0x1eff16['MovePivotTableCommand']['id'],{'pivotTableId':this['pivotTableId'],'targetCellInfo':{'subUnitId':_0x2b3c09[_0x2e0be3(0x1fb)](),'unitId':this['unitId'],'row':_0x342e75,'col':_0x127a42},'originTargetInfo':{'subUnitId':this[_0x2e0be3(0x1a5)],'unitId':this[_0x2e0be3(0x1da)]}});}}class _0x2b8730 extends _0x1250f0[_0x5193ea(0x21d)]{async[_0x5193ea(0x1b4)](_0x1dbda0,_0x16af2a,_0x58f646){const _0x927157=_0x5193ea,_0x17562d=this[_0x927157(0x1b6)],_0x59d547=_0x17562d[_0x927157(0x215)](_0x15acbd['ICommandService']),_0x195ba5=_0x13d971['generateHexNumber'](0x8),_0x29aa27={'positionType':_0x16af2a,'pivotTableId':_0x195ba5,'pivotTableConfig':{'targetCellInfo':_0x58f646,'sourceRangeInfo':_0x1dbda0,'isEmpty':!0x0}};if(await _0x59d547['executeCommand'](_0x1eff16[_0x927157(0x1fa)]['id'],_0x29aa27))return new _0x2ade73(_0x58f646[_0x927157(0x1da)],_0x58f646[_0x927157(0x1a5)],_0x195ba5,_0x17562d);}[_0x5193ea(0x1ec)](_0x1263fc,_0x5227ec,_0x47b7e8,_0x57205f){const _0x18d8e2=_0x5193ea,_0x23eea9=this['_injector'],_0x160b90=_0x23eea9[_0x18d8e2(0x215)](_0x1eff16[_0x18d8e2(0x1a7)])[_0x18d8e2(0x1d8)](_0x1263fc,_0x5227ec,_0x47b7e8,_0x57205f);if(_0x160b90)return new _0x2ade73(_0x1263fc,_0x5227ec,_0x160b90,_0x23eea9);}[_0x5193ea(0x1cd)](_0x54d509){const _0x4cd639=_0x5193ea,_0x6c428a=this[_0x4cd639(0x1b6)],_0x7a5267=_0x6c428a[_0x4cd639(0x215)](_0x1eff16[_0x4cd639(0x21a)])[_0x4cd639(0x19c)](this[_0x4cd639(0x1cf)](),_0x54d509);if(_0x7a5267)return new _0x2ade73(_0x7a5267[_0x4cd639(0x1da)],_0x7a5267[_0x4cd639(0x1a5)],_0x54d509,_0x6c428a);}}_0x1250f0[_0x5193ea(0x21d)][_0x5193ea(0x192)](_0x2b8730);class _0x3fba47 extends _0x15acbd[_0x5193ea(0x221)]{get[_0x5193ea(0x1ff)](){return _0x13d971['PivotSubtotalTypeEnum'];}get['PivotFilterTypeEnum'](){const _0x356633=_0x5193ea;return _0x13d971[_0x356633(0x1b0)];}get['PivotTableFiledAreaEnum'](){return _0x13d971['PivotTableFiledAreaEnum'];}get[_0x5193ea(0x1f3)](){const _0x222c86=_0x5193ea;return _0x13d971[_0x222c86(0x1f3)];}get[_0x5193ea(0x1b8)](){const _0x1224f3=_0x5193ea;return _0x13d971[_0x1224f3(0x1b8)];}get['PivotDataFieldSortTypeEnum'](){const _0x5092e1=_0x5193ea;return _0x13d971[_0x5092e1(0x20a)];}get[_0x5193ea(0x21f)](){const _0x544a19=_0x5193ea;return _0x13d971[_0x544a19(0x21f)];}get['PivotFilterOperatorEnum'](){const _0x5e0f9f=_0x5193ea;return _0x13d971[_0x5e0f9f(0x1c5)];}get['PositionTypeEnum'](){const _0xae690f=_0x5193ea;return _0x1eff16[_0xae690f(0x1ed)];}get[_0x5193ea(0x190)](){const _0x11362b=_0x5193ea;return _0x13d971[_0x11362b(0x190)];}}_0x15acbd[_0x5193ea(0x221)][_0x5193ea(0x192)](_0x3fba47);class _0x14a7ba extends _0x15acbd[_0x5193ea(0x21e)]{get[_0x5193ea(0x1dd)](){const _0x387cc4=_0x5193ea;return _0x387cc4(0x1dd);}get['BeforePivotTableAdd'](){const _0x2bfe59=_0x5193ea;return _0x2bfe59(0x1f6);}get[_0x5193ea(0x1d1)](){const _0x3cc3ca=_0x5193ea;return _0x3cc3ca(0x1d1);}get['PivotTableMoved'](){const _0x1b356a=_0x5193ea;return _0x1b356a(0x1d9);}get[_0x5193ea(0x1c9)](){const _0x5c2e40=_0x5193ea;return _0x5c2e40(0x1c9);}get[_0x5193ea(0x1ad)](){const _0x51aff1=_0x5193ea;return _0x51aff1(0x1ad);}get[_0x5193ea(0x1f0)](){const _0x3a771d=_0x5193ea;return _0x3a771d(0x1f0);}get[_0x5193ea(0x1f9)](){const _0x2f1a3a=_0x5193ea;return _0x2f1a3a(0x1f9);}get['PivotTableFieldCollapseChanged'](){const _0xe40d57=_0x5193ea;return _0xe40d57(0x1df);}get[_0x5193ea(0x1b9)](){return'PivotTableFieldFilterChanged';}get['PivotTableFieldSortChanged'](){const _0x139959=_0x5193ea;return _0x139959(0x20b);}get['PivotTableFieldSettingChanged'](){const _0x2118e7=_0x5193ea;return _0x2118e7(0x1a2);}get['PivotTableValuePositionChanged'](){const _0x106d8b=_0x5193ea;return _0x106d8b(0x1e2);}}_0x15acbd[_0x5193ea(0x21e)][_0x5193ea(0x192)](_0x14a7ba);class _0x201e1a extends _0x15acbd['FUniver']{[_0x5193ea(0x1c0)](_0x3d3254){const _0x568f17=_0x5193ea,_0x5180d6=_0x3d3254[_0x568f17(0x215)](_0x15acbd[_0x568f17(0x202)]);this[_0x568f17(0x1f7)](_0x5180d6[_0x568f17(0x1cc)](_0x3b4495=>{const _0x5e6458=_0x568f17;switch(_0x3b4495['id']){case _0x1eff16[_0x5e6458(0x1a6)]['id']:case _0x1eff16['AddPivotTableCommand']['id']:{const _0x493c35=_0x3b4495[_0x5e6458(0x208)];this[_0x5e6458(0x1ca)](_0x493c35);break;}case _0x1eff16[_0x5e6458(0x205)]['id']:{const _0x38535c=_0x3b4495[_0x5e6458(0x208)];this[_0x5e6458(0x1d6)](_0x38535c);break;}}})),this[_0x568f17(0x1f7)](_0x5180d6[_0x568f17(0x1a1)](_0x1ef6b3=>{const _0x46ca23=_0x568f17;switch(_0x1ef6b3['id']){case _0x1eff16[_0x46ca23(0x1a6)]['id']:case _0x1eff16[_0x46ca23(0x1fa)]['id']:{const _0x19704b=_0x1ef6b3[_0x46ca23(0x208)];this[_0x46ca23(0x198)](_0x19704b);break;}case _0x1eff16[_0x46ca23(0x205)]['id']:{const _0x1b2577=_0x1ef6b3[_0x46ca23(0x208)];this[_0x46ca23(0x1bc)](_0x1b2577);break;}case _0x1eff16[_0x46ca23(0x1fc)]['id']:{const _0x2e73c4=_0x1ef6b3[_0x46ca23(0x208)];this['_firePivotTableRemovedEvent'](_0x2e73c4);break;}case _0x1eff16[_0x46ca23(0x1ba)]['id']:{const _0x7c092a=_0x1ef6b3[_0x46ca23(0x208)];this['_firePivotTableFieldAddedEvent'](_0x7c092a);break;}case _0x1eff16[_0x46ca23(0x1ee)]['id']:{const _0x453e61=_0x1ef6b3[_0x46ca23(0x208)];this[_0x46ca23(0x1c1)](_0x453e61);break;}case _0x1eff16[_0x46ca23(0x1e7)]['id']:{const _0x3f7a73=_0x1ef6b3[_0x46ca23(0x208)];this[_0x46ca23(0x1ce)](_0x3f7a73);break;}case _0x1eff16[_0x46ca23(0x1e1)]['id']:{const _0x76e07e=_0x1ef6b3[_0x46ca23(0x208)];this[_0x46ca23(0x1fd)](_0x76e07e);break;}case _0x1eff16[_0x46ca23(0x1f4)]['id']:{const _0x2faa80=_0x1ef6b3[_0x46ca23(0x208)];this[_0x46ca23(0x1c7)](_0x2faa80);break;}case _0x1eff16[_0x46ca23(0x1e9)]['id']:{const _0x1066cd=_0x1ef6b3['params'];this[_0x46ca23(0x217)](_0x1066cd);break;}case _0x1eff16[_0x46ca23(0x18f)]['id']:{const _0x26174c=_0x1ef6b3[_0x46ca23(0x208)];this['_firePivotTableFieldSettingChangedEvent'](_0x26174c);break;}case _0x1eff16[_0x46ca23(0x1e5)]['id']:{const _0x398157=_0x1ef6b3[_0x46ca23(0x208)];this[_0x46ca23(0x20f)](_0x398157);break;}}}));const _0x22d9db=_0x3d3254['get'](_0x15acbd[_0x568f17(0x195)]);this['disposeWithMe'](_0x22d9db[_0x568f17(0x191)][_0x568f17(0x214)](_0x29b677=>{const _0x68b08b=_0x568f17;if(_0x29b677===_0x15acbd['LifecycleStages'][_0x68b08b(0x1c2)]){const _0x5e04ad=_0x3d3254['get'](_0x1eff16['SheetsPivotTableAdaptorModel']);this[_0x68b08b(0x1f7)](_0x5e04ad[_0x68b08b(0x1cb)][_0x68b08b(0x214)](_0x169f5d=>{const _0x201807=_0x68b08b;this[_0x201807(0x200)](_0x169f5d);}));}}));}[_0x5193ea(0x1ef)](_0x1889f0){const _0x36114e=_0x5193ea;if(this[_0x36114e(0x1d3)](this[_0x36114e(0x1aa)]['PivotTableFieldAdded'])&&_0x1889f0){const {unitId:_0x576658,subUnitId:_0x4fd42d,pivotTableId:_0x5cb66a,dataFieldId:_0xc45be5,fieldArea:_0x51c699,index:_0x135bc6}=_0x1889f0;this[_0x36114e(0x219)](this[_0x36114e(0x1aa)][_0x36114e(0x1ad)],{'unitId':_0x576658,'subUnitId':_0x4fd42d,'pivotTableId':_0x5cb66a,'dataFieldId':_0xc45be5,'fieldArea':_0x51c699,'index':_0x135bc6});}}[_0x5193ea(0x1c1)](_0xabd6cd){const _0x1b516c=_0x5193ea;if(this['hasEventCallback'](this['Event'][_0x1b516c(0x1f0)])&&_0xabd6cd){const {unitId:_0xb8964c,subUnitId:_0x373c47,pivotTableId:_0x557a7f,fieldIds:_0x1d9791}=_0xabd6cd;this[_0x1b516c(0x219)](this['Event']['PivotTableFieldRemoved'],{'unitId':_0xb8964c,'subUnitId':_0x373c47,'pivotTableId':_0x557a7f,'fieldIds':_0x1d9791[_0x1b516c(0x204)]()});}}[_0x5193ea(0x1ce)](_0x3951d0){const _0x591d80=_0x5193ea;if(this[_0x591d80(0x1d3)](this[_0x591d80(0x1aa)][_0x591d80(0x1f9)])&&_0x3951d0){const {unitId:_0x351b0e,subUnitId:_0x2776c5,pivotTableId:_0x1e88ef,fieldId:_0x518c83,area:_0x35df90,index:_0x53db52}=_0x3951d0;this['fireEvent'](this[_0x591d80(0x1aa)]['PivotTableFieldMoved'],{'unitId':_0x351b0e,'subUnitId':_0x2776c5,'pivotTableId':_0x1e88ef,'fieldId':_0x518c83,'area':_0x35df90,'index':_0x53db52});}}[_0x5193ea(0x1fd)](_0x372349){const _0x3664b9=_0x5193ea;if(this['hasEventCallback'](this[_0x3664b9(0x1aa)]['PivotTableFieldCollapseChanged'])&&_0x372349){const {unitId:_0x192f23,subUnitId:_0x47aa7d,row:_0x2c6598,col:_0x1eebd6,collapse:_0x38857f}=_0x372349;this[_0x3664b9(0x219)](this[_0x3664b9(0x1aa)][_0x3664b9(0x1df)],{'unitId':_0x192f23,'subUnitId':_0x47aa7d,'row':_0x2c6598,'col':_0x1eebd6,'collapse':_0x38857f});}}[_0x5193ea(0x1c7)](_0x3fadea){const _0x341d9d=_0x5193ea;if(this['hasEventCallback'](this[_0x341d9d(0x1aa)][_0x341d9d(0x1b9)])&&_0x3fadea){const {unitId:_0x6611a6,subUnitId:_0x18964f,pivotTableId:_0x5d3894,tableFieldId:_0x3c5731,items:_0x5e1ca2,isAll:_0x36935e}=_0x3fadea;this[_0x341d9d(0x219)](this[_0x341d9d(0x1aa)]['PivotTableFieldFilterChanged'],{'unitId':_0x6611a6,'subUnitId':_0x18964f,'pivotTableId':_0x5d3894,'tableFieldId':_0x3c5731,'items':_0x5e1ca2[_0x341d9d(0x204)](),'isAll':_0x36935e});}}[_0x5193ea(0x217)](_0x320c51){const _0x2db70c=_0x5193ea;if(this[_0x2db70c(0x1d3)](this[_0x2db70c(0x1aa)]['PivotTableFieldSortChanged'])&&_0x320c51){const {unitId:_0x413a81,subUnitId:_0x1015bf,pivotTableId:_0x4612d3,tableFieldId:_0x3f651d,info:_0x371dc1}=_0x320c51;this[_0x2db70c(0x219)](this[_0x2db70c(0x1aa)][_0x2db70c(0x20b)],{'unitId':_0x413a81,'subUnitId':_0x1015bf,'pivotTableId':_0x4612d3,'tableFieldId':_0x3f651d,'info':{..._0x371dc1}});}}['_firePivotTableFieldSettingChangedEvent'](_0x9fe5d1){const _0x125ef6=_0x5193ea;if(this[_0x125ef6(0x1d3)](this[_0x125ef6(0x1aa)][_0x125ef6(0x1a2)])&&_0x9fe5d1){const {unitId:_0x498cfd,subUnitId:_0x4f0a3c,tableFieldId:_0x30d603,pivotTableId:_0x40c8d6,displayName:_0x4e151e,format:_0x515c28,subtotalType:_0x226b93,tableFieldInfo:_0x4980f7,dataFieldInfo:_0x3c7630}=_0x9fe5d1;this['fireEvent'](this[_0x125ef6(0x1aa)]['PivotTableFieldSettingChanged'],{'unitId':_0x498cfd,'subUnitId':_0x4f0a3c,'tableFieldId':_0x30d603,'pivotTableId':_0x40c8d6,'displayName':_0x4e151e,'format':_0x515c28,'subtotalType':_0x226b93,'tableFieldInfo':_0x4980f7,'dataFieldInfo':_0x3c7630});}}[_0x5193ea(0x20f)](_0x30a731){const _0x11c50a=_0x5193ea;if(this[_0x11c50a(0x1d3)](this[_0x11c50a(0x1aa)]['PivotTableValuePositionChanged'])&&_0x30a731){const {pivotTableId:_0x4d42bf,position:_0x47e6a6,index:_0x25871f}=_0x30a731;this[_0x11c50a(0x219)](this[_0x11c50a(0x1aa)][_0x11c50a(0x1e2)],{'pivotTableId':_0x4d42bf,'position':_0x47e6a6,'index':_0x25871f});}}['_fireAddPivotTableEvent'](_0x12b1b6){const _0x2b281e=_0x5193ea;if(this['hasEventCallback'](this[_0x2b281e(0x1aa)][_0x2b281e(0x1dd)])&&_0x12b1b6){const {positionType:_0x45987f,pivotTableId:_0x47a113,pivotTableConfig:_0x1acf4b}=_0x12b1b6,{targetCellInfo:_0x209f69,sourceRangeInfo:_0x22c0f5}=_0x1acf4b,{unitId:_0x542b21}=_0x209f69;this[_0x2b281e(0x219)](this[_0x2b281e(0x1aa)]['PivotTableAdded'],{'unitId':_0x542b21,'positionType':_0x45987f,'pivotTableId':_0x47a113,'sourceRangeInfo':{'startRow':_0x22c0f5[_0x2b281e(0x1f2)][_0x2b281e(0x1fe)],'endRow':_0x22c0f5['range'][_0x2b281e(0x1af)],'startColumn':_0x22c0f5[_0x2b281e(0x1f2)]['startColumn'],'endColumn':_0x22c0f5[_0x2b281e(0x1f2)]['endColumn'],'unitId':_0x22c0f5[_0x2b281e(0x1da)],'subUnitId':_0x22c0f5[_0x2b281e(0x1a5)],'sheetName':_0x22c0f5[_0x2b281e(0x1dc)]},'targetCellInfo':{'row':_0x209f69[_0x2b281e(0x197)],'column':_0x209f69[_0x2b281e(0x19e)],'sheetName':_0x209f69['sheetName'],'unitId':_0x209f69['unitId'],'subUnitId':_0x209f69[_0x2b281e(0x1a5)]}});}}['_fireBeforeAddPivotTableEvent'](_0x539690){const _0x3ee162=_0x5193ea;if(this[_0x3ee162(0x1d3)](this[_0x3ee162(0x1aa)][_0x3ee162(0x1f6)])&&_0x539690){const {positionType:_0x224877,pivotTableId:_0x1c4a5a,pivotTableConfig:_0x149b4d}=_0x539690,{targetCellInfo:_0x4a4465,sourceRangeInfo:_0x33b584}=_0x149b4d,{unitId:_0xe155eb}=_0x4a4465,_0x47cd8e={'unitId':_0xe155eb,'positionType':_0x224877,'pivotTableId':_0x1c4a5a,'sourceRangeInfo':{'startRow':_0x33b584['range'][_0x3ee162(0x1fe)],'endRow':_0x33b584[_0x3ee162(0x1f2)][_0x3ee162(0x1af)],'startColumn':_0x33b584[_0x3ee162(0x1f2)][_0x3ee162(0x1d7)],'endColumn':_0x33b584['range'][_0x3ee162(0x1d5)],'unitId':_0x33b584[_0x3ee162(0x1da)],'subUnitId':_0x33b584[_0x3ee162(0x1a5)],'sheetName':_0x33b584[_0x3ee162(0x1dc)]},'targetCellInfo':{'row':_0x4a4465['row'],'column':_0x4a4465[_0x3ee162(0x19e)],'sheetName':_0x4a4465[_0x3ee162(0x1dc)],'unitId':_0x4a4465[_0x3ee162(0x1da)],'subUnitId':_0x4a4465[_0x3ee162(0x1a5)]},'cancel':!0x1};if(this['fireEvent'](this[_0x3ee162(0x1aa)][_0x3ee162(0x1f6)],_0x47cd8e),_0x47cd8e[_0x3ee162(0x1b5)])throw new Error(_0x3ee162(0x1de));}}[_0x5193ea(0x1e0)](_0x26dace){const _0x22659d=_0x5193ea;if(this[_0x22659d(0x1d3)](this[_0x22659d(0x1aa)][_0x22659d(0x1d1)])&&_0x26dace){const {unitId:_0x1153a5,pivotTableId:_0x222670}=_0x26dace;this[_0x22659d(0x219)](this[_0x22659d(0x1aa)]['PivotTableRemoved'],{'unitId':_0x1153a5,'pivotTableId':_0x222670});}}['_fireBeforeMovePivotTableEvent'](_0x424407){const _0x3bcf31=_0x5193ea;if(this[_0x3bcf31(0x1d3)](this[_0x3bcf31(0x1aa)][_0x3bcf31(0x20e)])&&_0x424407){const {originTargetInfo:_0x18861a,pivotTableId:_0x295964,targetCellInfo:_0x2323b8}=_0x424407,{unitId:_0x596826}=_0x18861a,_0x197a7d=this[_0x3bcf31(0x1b6)][_0x3bcf31(0x215)](_0x1eff16[_0x3bcf31(0x21a)])[_0x3bcf31(0x19f)](_0x18861a[_0x3bcf31(0x1da)],_0x18861a['subUnitId'],_0x295964);if(!_0x197a7d)return;const _0x4563c7={'unitId':_0x596826,'pivotTableId':_0x295964,'originTargetInfo':{'row':_0x197a7d[_0x3bcf31(0x218)][_0x3bcf31(0x197)],'column':_0x197a7d[_0x3bcf31(0x218)][_0x3bcf31(0x19e)],'unitId':_0x197a7d['targetCellInfo'][_0x3bcf31(0x1da)],'subUnitId':_0x197a7d[_0x3bcf31(0x218)][_0x3bcf31(0x1a5)]},'targetCellInfo':{'row':_0x2323b8['row'],'column':_0x2323b8[_0x3bcf31(0x19e)],'unitId':_0x2323b8['unitId'],'subUnitId':_0x2323b8[_0x3bcf31(0x1a5)]},'cancel':!0x1};if(this[_0x3bcf31(0x219)](this[_0x3bcf31(0x1aa)][_0x3bcf31(0x20e)],_0x4563c7),_0x4563c7[_0x3bcf31(0x1b5)])throw new Error(_0x3bcf31(0x1c4));}}[_0x5193ea(0x1bc)](_0x29ea60){const _0x4f81e5=_0x5193ea;if(this[_0x4f81e5(0x1d3)](this[_0x4f81e5(0x1aa)][_0x4f81e5(0x1d9)])&&_0x29ea60){const {originTargetInfo:_0x2813f5,pivotTableId:_0x301423,targetCellInfo:_0x314eea}=_0x29ea60,{unitId:_0x29fb10}=_0x2813f5,_0x45d405=this[_0x4f81e5(0x1b6)][_0x4f81e5(0x215)](_0x1eff16[_0x4f81e5(0x21a)])[_0x4f81e5(0x19f)](_0x2813f5[_0x4f81e5(0x1da)],_0x2813f5[_0x4f81e5(0x1a5)],_0x301423);if(!_0x45d405)return;this[_0x4f81e5(0x219)](this[_0x4f81e5(0x1aa)]['PivotTableMoved'],{'unitId':_0x29fb10,'pivotTableId':_0x301423,'originTargetInfo':{'row':_0x45d405[_0x4f81e5(0x218)][_0x4f81e5(0x197)],'column':_0x45d405[_0x4f81e5(0x218)]['col'],'unitId':_0x45d405[_0x4f81e5(0x218)][_0x4f81e5(0x1da)],'subUnitId':_0x45d405[_0x4f81e5(0x218)][_0x4f81e5(0x1a5)]},'targetCellInfo':{'row':_0x314eea['row'],'column':_0x314eea[_0x4f81e5(0x19e)],'unitId':_0x314eea[_0x4f81e5(0x1da)],'subUnitId':_0x314eea['subUnitId']}});}}['_fireRenderPivotTableEvent'](_0x264be3){const _0x42f5d9=_0x5193ea;if(this[_0x42f5d9(0x1d3)](this[_0x42f5d9(0x1aa)][_0x42f5d9(0x1c9)])&&_0x264be3){const {unitId:_0x6122ab,subUnitId:_0x8ee655,pivotTableId:_0x1aa0d1,type:_0x329f43,rangesCache:_0x5cbfc1,isEmpty:_0x351458}=_0x264be3;this['fireEvent'](this[_0x42f5d9(0x1aa)]['PivotTableRendered'],{'unitId':_0x6122ab,'subUnitId':_0x8ee655,'pivotTableId':_0x1aa0d1,'changeType':_0x329f43,'isEmpty':!!_0x351458,'rangeInfo':_0x5cbfc1});}}}_0x15acbd[_0x5193ea(0x1b3)][_0x5193ea(0x192)](_0x201e1a);}));