@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 { DataField, FieldsCollection, IDataFieldManagerBaseJSON, IFieldsCollectionJSON, ILabelViewHeaderMapItem, IPivotTableChangeSet, IPivotTableFilterInfo, IPivotTableLabelFieldJSON, IPivotTableOptions, IPivotTableSnapshot, IPivotTableSortInfo, IPivotTableValueFieldJSON, IPivotViewInfo, IPivotViewJSON, IPivotViewValueType, PivotCellStyleTypeEnum, PivotDataFieldDataTypeEnum, PivotSubtotalTypeEnum, PivotTableChangeTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum, PivotView } from '@univerjs-pro/engine-pivot';
1
2
  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';
3
+ import { PivotDisplayDataType, PositionType } from './const';
4
4
  export interface IPivotPerformCheckParams {
5
5
  cellInfo: IPivotCellPositionInfo;
6
6
  view: PivotView;
@@ -194,9 +194,21 @@ export interface IPivotTableMatrixInfo {
194
194
  matrix: ObjectMatrix<Nullable<IPivotTableCellData>>;
195
195
  oldMatrix?: ObjectMatrix<Nullable<IPivotTableCellData>>;
196
196
  }
197
+ /**
198
+ * The pivot table view change operation type.
199
+ */
197
200
  export declare enum PivotTableOperationEnum {
201
+ /**
202
+ * A pivot table added to the sheet cells.
203
+ */
198
204
  Add = "add",
205
+ /**
206
+ * A pivot table updated in the sheet cells, maybe the range of the pivot table changed or the values of the pivot table cell changed.
207
+ */
199
208
  Set = "set",
209
+ /**
210
+ * A pivot table removed from the sheet cells.
211
+ */
200
212
  Delete = "delete"
201
213
  }
202
214
  export interface IPivotTableCellData {
@@ -523,3 +535,202 @@ export interface IUpdateInfo {
523
535
  dataField: DataField;
524
536
  }[];
525
537
  }
538
+ export interface IPivotViewUpdateInfo {
539
+ unitId: string;
540
+ subUnitId: string;
541
+ pivotTableId: string;
542
+ rangesCache: IPivotRangesInfo | undefined;
543
+ valueMatrix: ObjectMatrix<Nullable<IPivotTableCellData>>;
544
+ type: PivotTableOperationEnum;
545
+ isEmpty?: boolean;
546
+ }
547
+ interface IPivotTableEventParamsBase {
548
+ /**
549
+ * The pivot table id.When create a pivot table, the id maybe undefined.
550
+ */
551
+ pivotTableId: string | undefined;
552
+ /**
553
+ * The unit id of workbook which the pivot table belongs to.
554
+ */
555
+ unitId: string;
556
+ }
557
+ /**
558
+ * The pivot table added event callback argument.
559
+ */
560
+ export interface IPivotTableAddedEventParams extends IPivotTableEventParamsBase {
561
+ /**
562
+ * @property {PositionType} positionType The position type of the pivot table.
563
+ */
564
+ positionType: PositionType;
565
+ /**
566
+ * The source range info of the pivot table.
567
+ */
568
+ sourceRangeInfo: {
569
+ /**
570
+ * @property {number} startRow The start row of the range.
571
+ */
572
+ startRow: number;
573
+ /**
574
+ * @property {number} endRow The end row of the range.
575
+ */
576
+ endRow: number;
577
+ /**
578
+ * @property {number} startColumn The start column of the range.
579
+ */
580
+ startColumn: number;
581
+ /**
582
+ * @property {number} endColumn The end column of the range.
583
+ */
584
+ endColumn: number;
585
+ /**
586
+ * @property {string} unitId The unit id of workbook which the pivot table source range belongs to.
587
+ */
588
+ unitId: string;
589
+ /**
590
+ * @property {string} subUnitId The sheet id of workbook which the pivot table source range belongs to.
591
+ */
592
+ subUnitId: string;
593
+ /**
594
+ * @property {string} sheetName The sheet name of workbook which the pivot table source range belongs to.
595
+ */
596
+ sheetName?: string;
597
+ };
598
+ /**
599
+ * The target cell info of the pivot table.Only the PositionType is 'exiting' will have this property.
600
+ */
601
+ targetCellInfo?: {
602
+ /**
603
+ * @property {number} row The row of the target cell.
604
+ */
605
+ row: number;
606
+ /**
607
+ * @property {number} col The column of the target cell.
608
+ */
609
+ column: number;
610
+ /**
611
+ * @property {string} unitId The unit id of workbook which the pivot table target cell belongs to.
612
+ */
613
+ unitId: string;
614
+ /**
615
+ * @property {string} subUnitId The sheet id of workbook which the pivot table target cell belongs to.
616
+ */
617
+ subUnitId: string;
618
+ /**
619
+ * @property {string} sheetName The sheet name of workbook which the pivot table target cell belongs to.
620
+ */
621
+ sheetName?: string;
622
+ };
623
+ }
624
+ /**
625
+ * The pivot table removed event callback argument.
626
+ */
627
+ export interface IPivotTableRemovedEventParams extends IPivotTableEventParamsBase {
628
+ }
629
+ /**
630
+ * The pivot table updated event callback argument.
631
+ */
632
+ export interface IPivotTableUpdatedEventParams extends IPivotTableEventParamsBase {
633
+ /**
634
+ * The pivot table change infos, may be a ui drag operation may cause multiple changes.
635
+ */
636
+ changes: {
637
+ /**
638
+ * @property {PivotTableChangeTypeEnum} changeType The change type of the pivot table.
639
+ */
640
+ changeType: PivotTableChangeTypeEnum;
641
+ /**
642
+ * The pivot table change info.
643
+ */
644
+ changeInfo: IPivotTableChangeSet;
645
+ }[];
646
+ }
647
+ /**
648
+ * The pivot table moved event callback argument.
649
+ */
650
+ export interface IPivotTableMovedEventParams extends IPivotTableEventParamsBase {
651
+ /**
652
+ * @property {object} originTargetInfo The origin target info of the pivot table.
653
+ */
654
+ originTargetInfo: {
655
+ /**
656
+ * @property {string} subUnitId The sheet id of workbook which the pivot table belongs to.
657
+ */
658
+ subUnitId: string;
659
+ /**
660
+ * @property {string} unitId The unit id of workbook which the pivot table belongs to.
661
+ */
662
+ unitId: string;
663
+ /**
664
+ * @property {number} row The origin row of the pivot table.
665
+ */
666
+ row: number;
667
+ /**
668
+ * @property {number} column The origin column of the pivot table.
669
+ */
670
+ column: number;
671
+ };
672
+ /**
673
+ * @property {object} targetCellInfo The target cell info of the pivot table.
674
+ */
675
+ targetCellInfo: {
676
+ /**
677
+ * @property {number} row The row of the target cell.
678
+ */
679
+ row: number;
680
+ /**
681
+ * @property {number} col The column of the target cell.
682
+ */
683
+ column: number;
684
+ /**
685
+ * @property {string} unitId The unit id of workbook which the pivot table target cell belongs to.
686
+ */
687
+ unitId: string;
688
+ /**
689
+ * @property {string} subUnitId The sheet id of workbook which the pivot table target cell belongs to.
690
+ */
691
+ subUnitId: string;
692
+ };
693
+ }
694
+ /**
695
+ * The pivot table rendered event callback argument.
696
+ */
697
+ export interface IPivotTableRenderedEventParams extends IPivotTableEventParamsBase {
698
+ /**
699
+ * @property {boolean} isEmpty Whether the pivot table is empty.
700
+ */
701
+ isEmpty: boolean;
702
+ /**
703
+ * @property {string} subUnitId The sheet id of workbook which the pivot table belongs to.
704
+ */
705
+ subUnitId: string;
706
+ /**
707
+ * @property {changeType} changeType The change type of the pivot table.
708
+ */
709
+ changeType: PivotTableOperationEnum;
710
+ /**
711
+ * @property {object} rangeInfo The current range info of the pivot table.When the pivot table is empty, the rangeInfo will be undefined.
712
+ */
713
+ rangeInfo?: {
714
+ /**
715
+ * @property {Array<IRange>} rowRanges The row header ranges of the pivot table.
716
+ */
717
+ rowRanges: IRange[];
718
+ /**
719
+ * @property {Array<IRange>} colRanges The column header ranges of the pivot table.
720
+ */
721
+ colRanges: IRange[];
722
+ /**
723
+ * @property {Array<IRange>} cornerRanges The cross range of the pivot table row and column header in the left&top.
724
+ */
725
+ cornerRanges: IRange[];
726
+ /**
727
+ * @property {Array<IRange>} dataRanges The data ranges of the pivot table.Which is the main data of the pivot table.
728
+ */
729
+ dataRanges: IRange[];
730
+ /**
731
+ * @property {Array<IRange>} pageRanges The page ranges of the pivot table.Which match the pivot table filters area.In excel it is the page field.
732
+ */
733
+ pageRanges: IRange[];
734
+ };
735
+ }
736
+ export {};
@@ -1 +1 @@
1
- export declare const getLsInfoFuncStr = "KTpnvVIp LanYM9vVIp(HVnapCa, 9TXHVnjaM) { vYM { nIpCv HVnapCacpKIemYvZYYmM = HVnapCa.C9HVv('-'); nIpCv IYV3VpoaCCm3a = NWrF.9mYCa(mvIX(HVnapCacpKIemYvZYYmM[B])); VK (!IYV3VpoaCCm3a.TL) { IYV3VpoaCCm3a.TL = FTkXaY(HVnapCacpKIemYvZYYmM[R]); } nIpCv VCwIYgaY = vM9aIK wIYgaYdHIXmHWnI9a !== 'TpLaKVpaL' && CaHK VpCvmpnaIK wIYgaYdHIXmHWnI9a; nIpCv nIpvaSv = VCwIYgaY ? CaHK : lVpLIl; nIpCv kaCCm3awIYL = nIpvaSv.__umCaOR__.9mYCa(HVnapCacpKIemYvZYYmM[B]); nIpCv kaCCm3a = nIpvaSv.__haS__.CvYVp3VKM(kaCCm3awIYL); nIpCv CV3pmvTYawIYL = nIpvaSv.__umCaOR__.9mYCa(HVnapCacpKIemYvZYYmM[s]); nIpCv CV3pmvTYa = nIpvaSv.__haS__.CvYVp3VKM(CV3pmvTYawIYL); nIpCv CV3pJmHVL = nIpvaSv.__baYVKM__(CV3pmvTYa, kaCCm3a, 9TXHVnjaM); nIpCv LIkmVp = IYV3VpoaCCm3a.Lk; KTpnvVIp VCEIkmVpomvn6Vp3(IemvvaYp, IhICv) { nIpCv 9mvvaYp = IemvvaYp.Ya9Hmna(/^.+/, ''); nIpCv 6ICv = IhICv.Ya9Hmna(/^.+/, ''); nIpCv 9mvvaYpemYvC = 9mvvaYp.C9HVv('.'); nIpCv 6ICvemYvC = 6ICv.C9HVv('.'); VK (!9mvvaYp.VpnHTLaC('*')) { YavTYp 9mvvaYp === 6ICv; } VK (9mvvaYpemYvC.Hap3v6 < B || 9mvvaYpemYvC[z] !== '*') { YavTYp KmHCa; } nIpCv 9mvvaYpWTKKVS = 9mvvaYpemYvC.CHVna(A).0IVp('.'); nIpCv 6ICvWTKKVS = 6ICvemYvC.CHVna(-9mvvaYpemYvC.Hap3v6 + A).0IVp('.'); YavTYp 9mvvaYpWTKKVS === 6ICvWTKKVS; } Hav LIkmVpJmHVL = (LIkmVp && LIkmVp.Hap3v6) ? LIkmVp.CIka((Lkcvak) => VCEIkmVpomvn6Vp3(Lkcvak, HInmvVIp.6ICvpmka)) : vYTa; VK (HInmvVIp.6ICvpmka === 'HInmH6ICv') { LIkmVpJmHVL = vYTa; } nIpCv bmHVL = CV3pJmHVL && LIkmVpJmHVL; YavTYp { bmHVL, kaCCm3a: IYV3VpoaCCm3a, }; } nmvn6 (aYYIY) { YavTYp { bmHVL: KmHCa, kaCCm3a: {}, }; }}";
1
+ export declare const getLsInfoFuncStr = "fU51j965 V31MJWj965(a9135L3, WUxa91K3J) { jMJ { 165Lj a9135L3I5f6vrMjgMMrJ = a9135L3.LWa9j('-'); 165Lj 6M9A95d3LLrA3 = OZbD.WrML3(rj6x(a9135L3I5f6vrMjgMMrJ[s])); 9f (!6M9A95d3LLrA3.UV) { 6M9A95d3LLrA3.UV = DUhx3M(a9135L3I5f6vrMjgMMrJ[C]); } 165Lj 9Ll6M83M = jJW36f l6M83MRa6xraZ16W3 !== 'U5V3f953V' && L3af 95Ljr5136f l6M83MRa6xraZ16W3; 165Lj 165j3Nj = 9Ll6M83M ? L3af : u95V6u; 165Lj h3LLrA3l6MV = 165j3Nj.__HrL3GC__.WrML3(a9135L3I5f6vrMjgMMrJ[s]); 165Lj h3LLrA3 = 165j3Nj.__73N__.LjM95A9fJ(h3LLrA3l6MV); 165Lj L9A5rjUM3l6MV = 165j3Nj.__HrL3GC__.WrML3(a9135L3I5f6vrMjgMMrJ[F]); 165Lj L9A5rjUM3 = 165j3Nj.__73N__.LjM95A9fJ(L9A5rjUM3l6MV); 165Lj L9A5era9V = 165j3Nj.__i3M9fJ__(L9A5rjUM3, h3LLrA3, WUxa91K3J); 165Lj V6hr95 = 6M9A95d3LLrA3.Vh; fU51j965 9L06hr95drj1P95A(6vrjj3M5, 676Lj) { 165Lj Wrjj3M5 = 6vrjj3M5.M3War13(/^.+/, ''); 165Lj P6Lj = 676Lj.M3War13(/^.+/, ''); 165Lj Wrjj3M5vrMjL = Wrjj3M5.LWa9j('.'); 165Lj P6LjvrMjL = P6Lj.LWa9j('.'); 9f (!Wrjj3M5.951aUV3L('*')) { M3jUM5 Wrjj3M5 === P6Lj; } 9f (Wrjj3M5vrMjL.a35AjP < s || Wrjj3M5vrMjL[T] !== '*') { M3jUM5 fraL3; } 165Lj Wrjj3M5ZUff9N = Wrjj3M5vrMjL.La913(w).B695('.'); 165Lj P6LjZUff9N = P6LjvrMjL.La913(-Wrjj3M5vrMjL.a35AjP + w).B695('.'); M3jUM5 Wrjj3M5ZUff9N === P6LjZUff9N; } a3j V6hr95era9V = (V6hr95 && V6hr95.a35AjP) ? V6hr95.L6h3((VhIj3h) => 9L06hr95drj1P95A(VhIj3h, a61rj965.P6Lj5rh3)) : jMU3; 9f (a61rj965.P6Lj5rh3 === 'a61raP6Lj') { V6hr95era9V = jMU3; } 165Lj ira9V = L9A5era9V && V6hr95era9V; M3jUM5 { ira9V, h3LLrA3: 6M9A95d3LLrA3, }; } 1rj1P (3MM6M) { M3jUM5 { ira9V: fraL3, h3LLrA3: {}, }; }}";
@@ -0,0 +1,50 @@
1
+ import { PivotDataFieldDataTypeEnum, PivotDataFieldSortOperatorEnum, PivotDataFieldSortTypeEnum, PivotFilterTypeEnum, PivotSubtotalTypeEnum, PivotTableChangeTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum, ST_PivotFilterOperatorEnum } from '@univerjs-pro/engine-pivot';
2
+ import { PositionType } from '@univerjs-pro/sheets-pivot';
3
+ export interface IPivotEnumMixin {
4
+ /**
5
+ * Represents the subtotal type of the pivot table. {@link PivotSubtotalTypeEnum}
6
+ */
7
+ PivotSubtotalTypeEnum: typeof PivotSubtotalTypeEnum;
8
+ /**
9
+ * Represents the filter type of the pivot table. {@link PivotFilterTypeEnum}
10
+ */
11
+ PivotFilterTypeEnum: typeof PivotFilterTypeEnum;
12
+ /**
13
+ * Represents the field area of the pivot table. {@link PivotTableFiledAreaEnum}
14
+ */
15
+ PivotTableFiledAreaEnum: typeof PivotTableFiledAreaEnum;
16
+ /**
17
+ * Represents the value position of the pivot table. {@link PivotTableValuePositionEnum}
18
+ * @description In excel pivot table, the value position can be placed in the row, column area, but only there are more than one value field it will be placed.
19
+ */
20
+ PivotTableValuePositionEnum: typeof PivotTableValuePositionEnum;
21
+ /**
22
+ * Represents the data type of the pivot data field. {@link PivotDataFieldDataTypeEnum}
23
+ * @description This is enum is used to specify the data type of the pivot source field.
24
+ */
25
+ PivotDataFieldDataTypeEnum: typeof PivotDataFieldDataTypeEnum;
26
+ /**
27
+ * Represents the sort type of the pivot data field. {@link PivotDataFieldSortTypeEnum}
28
+ */
29
+ PivotDataFieldSortTypeEnum: typeof PivotDataFieldSortTypeEnum;
30
+ /**
31
+ * Represents the sort operator of the pivot data field. {@link PivotDataFieldSortOperatorEnum}
32
+ */
33
+ PivotDataFieldSortOperatorEnum: typeof PivotDataFieldSortOperatorEnum;
34
+ /**
35
+ * Represents the filter operator of the pivot filter. {@link ST_PivotFilterOperatorEnum}
36
+ */
37
+ PivotFilterOperatorEnum: typeof ST_PivotFilterOperatorEnum;
38
+ /**
39
+ * Represents the position type of the pivot table. {@link PositionType}
40
+ */
41
+ PositionTypeEnum: typeof PositionType;
42
+ /**
43
+ * Represents the change type of the pivot table. {@link PivotTableChangeTypeEnum}
44
+ */
45
+ PivotTableChangeTypeEnum: typeof PivotTableChangeTypeEnum;
46
+ }
47
+ declare module '@univerjs/core' {
48
+ interface FEnum extends IPivotEnumMixin {
49
+ }
50
+ }
@@ -0,0 +1,276 @@
1
+ import { IAddPivotFieldCommandParams, IMovePivotFieldCommandParams, IPivotTableAddedEventParams, IPivotTableMovedEventParams, IPivotTableRemovedEventParams, IPivotTableRenderedEventParams, IRemovePivotFieldCommandParams, ISetPivotCollapseCommandParams, ISetPivotFilterCommandParams, ISetPivotSortCommandParams, IUpdatePivotFieldSettingCommandParams, IUpdatePivotValuePositionCommandParams } from '@univerjs-pro/sheets-pivot';
2
+ import { IEventBase, FEventName } from '@univerjs/core';
3
+ interface IPivotTableEventMixin {
4
+ /**
5
+ * The before pivot table add event.The event parameter is {@link IPivotTableAddedEventParams}
6
+ * @example
7
+ * ```typescript
8
+ * univerAPI.addEvent(univerAPI.Event.BeforePivotTableAdd, (params) => {
9
+ * const { positionType, targetCellInfo } = params;
10
+ * if (positionType === univerAPI.Enum.PositionTypeEnum.Existing && targetCellInfo.sheetName === 'Sheet 1') {
11
+ * params.cancel = true;
12
+ * console.log(`The pivot table can't be added to the sheet ${targetCellInfo.sheetName}`);
13
+ * }
14
+ * });
15
+ * ```
16
+ */
17
+ readonly BeforePivotTableAdd: 'BeforePivotTableAdd';
18
+ /**
19
+ * The pivot table added event.The event parameter is {@link IPivotTableAddedEventParams}
20
+ * @example
21
+ * ```typescript
22
+ * univerAPI.addEvent(univerAPI.Event.PivotTableAdded, (params) => {
23
+ * const { positionType, targetCellInfo } = params;
24
+ * if (positionType === univerAPI.Enum.PositionTypeEnum.Existing) {
25
+ * console.log('A pivot table created in an existing sheet');
26
+ * console.log(`The target sheet name is ${targetCellInfo.sheetName}, the target row is ${targetCellInfo.row}, the target column is ${targetCellInfo.column}`);
27
+ * } else {
28
+ * console.log('A pivot table created in a new sheet');
29
+ * }
30
+ * });
31
+ * ```
32
+ */
33
+ readonly PivotTableAdded: 'PivotTableAdded';
34
+ /**
35
+ * The before pivot table moved event.The event parameter is {@link IPivotTableMovedEventParams}
36
+ * @example
37
+ * ```typescript
38
+ * univerAPI.addEvent(univerAPI.Event.BeforePivotTableMove, (params) => {
39
+ * const { pivotTableId, targetCellInfo } = params;
40
+ * if (pivotTableId === 'pivotTable1' && targetCellInfo.sheetName === 'Sheet 1') {
41
+ * params.cancel = true;
42
+ * console.log(`The pivot table can't be moved to the sheet ${targetCellInfo.sheetName}`);
43
+ * }
44
+ * });
45
+ * ```
46
+ */
47
+ readonly BeforePivotTableMove: 'BeforePivotTableMove';
48
+ /**
49
+ * The pivot table moved event. The event parameter is {@link IPivotTableMovedEventParams}
50
+ * @example
51
+ * ```typescript
52
+ * univerAPI.addEvent(univerAPI.Event.PivotTableMoved, (params) => {
53
+ * const { pivotTableId, targetCellInfo, originTargetInfo } = params;
54
+ * if (pivotTableId === 'pivotTable1') {
55
+ * console.log(`The pivot table moved from row: ${originTargetInfo.row} & column: ${originTargetInfo.column} to the sheet ${targetCellInfo.sheetName} row: ${targetCellInfo.row} & column: ${targetCellInfo.column}`);
56
+ * }
57
+ * });
58
+ * ```
59
+ */
60
+ readonly PivotTableMoved: 'PivotTableMoved';
61
+ /**
62
+ * The pivot table calculated done and fill the value to worksheet, the event parameter is {@link IPivotTableRenderedEventParams}
63
+ * @example
64
+ * ```typescript
65
+ * // import { unionPivotViewRange } from '@univerjs-pro/sheets-pivot';
66
+ * univerAPI.addEvent(univerAPI.Event.PivotTableRendered, (params) => {
67
+ * const { pivotTableId, rangeInfo } = params;
68
+ * console.log(`The pivot table ${pivotTableId} has been rendered`);
69
+ * if (rangeInfo) {
70
+ * console.log(unionPivotViewRange(rangeInfo));
71
+ * }
72
+ * });
73
+ * ```
74
+ */
75
+ readonly PivotTableRendered: 'PivotTableRendered';
76
+ /**
77
+ * The pivot table removed event. The event parameter is {@link IPivotTableRemovedEventParams}
78
+ * @example
79
+ * ```typescript
80
+ * univerAPI.addEvent(univerAPI.Event.PivotTableRemoved, (params) => {
81
+ * const { pivotTableId } = params;
82
+ * console.log(`The pivot table ${pivotTableId} has been removed`);
83
+ * });
84
+ */
85
+ readonly PivotTableRemoved: 'PivotTableRemoved';
86
+ /**
87
+ * The pivot table field added event. The event parameter is {@link IAddPivotFieldCommandParams}
88
+ * @example
89
+ * ```typescript
90
+ * const fWorkbook = univerAPI.getActiveWorkbook();
91
+ * univerAPI.addEvent(univerAPI.Event.PivotTableFieldAdded, (params) => {
92
+ * const { pivotTableId, fieldId, fieldArea, fieldIndex } = params;
93
+ * const pivotTable = fWorkbook.getPivotTableById(pivotTableId);
94
+ * const fieldSetting = pivotTable.getFieldSetting('fieldId');
95
+ * console.log(fieldSetting);
96
+ * ```
97
+ */
98
+ readonly PivotTableFieldAdded: 'PivotTableFieldAdded';
99
+ /**
100
+ * The pivot table field removed event. The event parameter is {@link IRemovePivotFieldCommandParams}
101
+ * @example
102
+ * ```typescript
103
+ * const fWorkbook = univerAPI.getActiveWorkbook();
104
+ * univerAPI.addEvent(univerAPI.Event.PivotTableFieldRemoved, (params) => {
105
+ * const { pivotTableId, fieldId } = params;
106
+ * const pivotTable = fWorkbook.getPivotTableById(pivotTableId);
107
+ * const fieldSetting = pivotTable.getFieldSetting(fieldId);
108
+ * console.log(fieldSetting);
109
+ * });
110
+ * ```
111
+ */
112
+ readonly PivotTableFieldRemoved: 'PivotTableFieldRemoved';
113
+ /**
114
+ * The pivot table field moved event. The event parameter is {@link IMovePivotFieldCommandParams}
115
+ * @example
116
+ * ```typescript
117
+ * const fWorkbook = univerAPI.getActiveWorkbook();
118
+ * univerAPI.addEvent(univerAPI.Event.PivotTableFieldMoved, (params) => {
119
+ * const { pivotTableId, fieldId, fieldArea, fieldIndex } = params;
120
+ * const pivotTable = fWorkbook.getPivotTableById(pivotTableId);
121
+ * const fieldSetting = pivotTable.getFieldSetting(fieldId);
122
+ * console.log(`The source name ${fieldSetting.sourceName} the display name ${fieldSetting.displayName}`);
123
+ * });
124
+ * ```
125
+ */
126
+ readonly PivotTableFieldMoved: 'PivotTableFieldMoved';
127
+ /**
128
+ * The pivot table field collapse changed event. The event parameter is {@link ISetPivotCollapseCommandParams}
129
+ * @example
130
+ * ```typescript
131
+ * const fWorkbook = univerAPI.getActiveWorkbook();
132
+ * univerAPI.addEvent(univerAPI.Event.PivotTableFieldCollapseChanged, (params) => {
133
+ * const { pivotTableId, fieldId, isCollapsed } = params;
134
+ * const pivotTable = fWorkbook.getPivotTableById(pivotTableId);
135
+ * const fieldSetting = pivotTable.getFieldSetting(fieldId);
136
+ * console.log(`The source name ${fieldSetting.sourceName} the display name ${fieldSetting.displayName}`);
137
+ * });
138
+ */
139
+ readonly PivotTableFieldCollapseChanged: 'PivotTableFieldCollapseChanged';
140
+ /**
141
+ * The pivot table field filter changed event. The event parameter is {@link ISetPivotFilterCommandParams}
142
+ * @example
143
+ * ```typescript
144
+ * const fWorkbook = univerAPI.getActiveWorkbook();
145
+ * univerAPI.addEvent(univerAPI.Event.PivotTableFieldFilterChanged, (params) => {
146
+ * const { pivotTableId, fieldId, filter } = params;
147
+ * const pivotTable = fWorkbook.getPivotTableById(pivotTableId);
148
+ * const fieldSetting = pivotTable.getFieldSetting(fieldId);
149
+ * console.log(`The Checklist filter value is ${fieldSetting.filterInfo.checklist}`);
150
+ * });
151
+ * ```
152
+ */
153
+ readonly PivotTableFieldFilterChanged: 'PivotTableFieldFilterChanged';
154
+ /**
155
+ * The pivot table field sort changed event. The event parameter is {@link ISetPivotSortCommandParams}
156
+ * @example
157
+ * ```typescript
158
+ * const fWorkbook = univerAPI.getActiveWorkbook();
159
+ * univerAPI.addEvent(univerAPI.Event.PivotTableFieldSortChanged, (params) => {
160
+ * const { pivotTableId, fieldId, sort } = params;
161
+ * const pivotTable = fWorkbook.getPivotTableById(pivotTableId);
162
+ * const fieldSetting = pivotTable.getFieldSetting(fieldId);
163
+ * console.log(`The sort info is ${fieldSetting.sortInfo}`);
164
+ * });
165
+ * ```
166
+ */
167
+ readonly PivotTableFieldSortChanged: 'PivotTableFieldSortChanged';
168
+ /**
169
+ * The pivot table field setting changed event. The event parameter is {@link IUpdatePivotFieldSettingCommandParams}
170
+ * @example
171
+ * ```typescript
172
+ * const fWorkbook = univerAPI.getActiveWorkbook();
173
+ * univerAPI.addEvent(univerAPI.Event.PivotTableFieldSettingChanged, (params) => {
174
+ * const { pivotTableId, fieldId, setting } = params;
175
+ * const pivotTable = fWorkbook.getPivotTableById(pivotTableId);
176
+ * const fieldSetting = pivotTable.getFieldSetting(fieldId);
177
+ * console.log(`The source name ${fieldSetting.sourceName} the display name ${fieldSetting.displayName}`);
178
+ * });
179
+ * ```
180
+ */
181
+ readonly PivotTableFieldSettingChanged: 'PivotTableFieldSettingChanged';
182
+ /**
183
+ * The pivot table value position changed event. The event parameter is {@link IUpdatePivotValuePositionCommandParams}
184
+ * @example
185
+ * ```typescript
186
+ * const fWorkbook = univerAPI.getActiveWorkbook();
187
+ * univerAPI.addEvent(univerAPI.Event.PivotTableValuePositionChanged, (params) => {
188
+ * const { pivotTableId, valueId, position } = params;
189
+ * const pivotTable = fWorkbook.getPivotTableById(pivotTableId);
190
+ * const valueSetting = pivotTable.getValueSetting(valueId);
191
+ * console.log(`The source name ${valueSetting.sourceName} the display name ${valueSetting.displayName}`);
192
+ * });
193
+ * ```
194
+ */
195
+ readonly PivotTableValuePositionChanged: 'PivotTableValuePositionChanged';
196
+ }
197
+ export interface IPivotTableEventParamConfig {
198
+ /**
199
+ * The event parameter for the PivotTableAdded event. {@link IPivotTableAddedEventParams}
200
+ */
201
+ PivotTableAdded: IPivotTableAddedEventParams & IEventBase;
202
+ /**
203
+ * The event parameter for the BeforePivotTableAdd event. {@link IPivotTableAddedEventParams}
204
+ */
205
+ BeforePivotTableAdd: IPivotTableAddedEventParams & IEventBase;
206
+ /**
207
+ * The event parameter for the BeforePivotTableMove event. {@link IPivotTableMovedEventParams}
208
+ */
209
+ BeforePivotTableMove: IPivotTableMovedEventParams & IEventBase;
210
+ /**
211
+ * The event parameter for the PivotTableMoved event. {@link IPivotTableMovedEventParams}
212
+ */
213
+ PivotTableMoved: IPivotTableMovedEventParams & IEventBase;
214
+ /**
215
+ * The event parameter for the PivotTableRendered event. {@link IPivotTableRenderedEventParams}
216
+ */
217
+ PivotTableRendered: IPivotTableRenderedEventParams & IEventBase;
218
+ /**
219
+ * The event parameter for the PivotTableRemoved event. {@link IPivotTableRemovedEventParams}
220
+ */
221
+ PivotTableRemoved: IPivotTableRemovedEventParams & IEventBase;
222
+ /**
223
+ * The event parameter for the PivotTableFieldAdded event. {@link IAddPivotFieldCommandParams}
224
+ */
225
+ PivotTableFieldAdded: IAddPivotFieldCommandParams & IEventBase;
226
+ /**
227
+ * The event parameter for the PivotTableFieldRemoved event. {@link IRemovePivotFieldCommandParams}
228
+ */
229
+ PivotTableFieldRemoved: IRemovePivotFieldCommandParams & IEventBase;
230
+ /**
231
+ * The event parameter for the PivotTableFieldMoved event. {@link IMovePivotFieldCommandParams}
232
+ */
233
+ PivotTableFieldMoved: IMovePivotFieldCommandParams & IEventBase;
234
+ /**
235
+ * The event parameter for the PivotTableFieldCollapseChanged event. {@link ISetPivotCollapseCommandParams}
236
+ */
237
+ PivotTableFieldCollapseChanged: ISetPivotCollapseCommandParams & IEventBase;
238
+ /**
239
+ * The event parameter for the PivotTableFieldFilterChanged event. {@link ISetPivotFilterCommandParams}
240
+ */
241
+ PivotTableFieldFilterChanged: ISetPivotFilterCommandParams & IEventBase;
242
+ /**
243
+ * The event parameter for the PivotTableFieldSortChanged event. {@link ISetPivotSortCommandParams}
244
+ */
245
+ PivotTableFieldSortChanged: ISetPivotSortCommandParams & IEventBase;
246
+ /**
247
+ * The event parameter for the PivotTableFieldSettingChanged event. {@link IUpdatePivotFieldSettingCommandParams}
248
+ */
249
+ PivotTableFieldSettingChanged: IUpdatePivotFieldSettingCommandParams & IEventBase;
250
+ /**
251
+ * The event parameter for the PivotTableValuePositionChanged event. {@link IUpdatePivotValuePositionCommand
252
+ */
253
+ PivotTableValuePositionChanged: IUpdatePivotValuePositionCommandParams & IEventBase;
254
+ }
255
+ export declare class FPivotTableEvent extends FEventName implements IPivotTableEventMixin {
256
+ get PivotTableAdded(): 'PivotTableAdded';
257
+ get BeforePivotTableAdd(): 'BeforePivotTableAdd';
258
+ get PivotTableRemoved(): 'PivotTableRemoved';
259
+ get PivotTableMoved(): 'PivotTableMoved';
260
+ get PivotTableRendered(): 'PivotTableRendered';
261
+ get PivotTableFieldAdded(): 'PivotTableFieldAdded';
262
+ get PivotTableFieldRemoved(): 'PivotTableFieldRemoved';
263
+ get PivotTableFieldMoved(): 'PivotTableFieldMoved';
264
+ get PivotTableFieldCollapseChanged(): 'PivotTableFieldCollapseChanged';
265
+ get PivotTableFieldFilterChanged(): 'PivotTableFieldFilterChanged';
266
+ get PivotTableFieldSortChanged(): 'PivotTableFieldSortChanged';
267
+ get PivotTableFieldSettingChanged(): 'PivotTableFieldSettingChanged';
268
+ get PivotTableValuePositionChanged(): 'PivotTableValuePositionChanged';
269
+ }
270
+ declare module '@univerjs/core' {
271
+ interface FEventName extends IPivotTableEventMixin {
272
+ }
273
+ interface IEventParamConfig extends IPivotTableEventParamConfig {
274
+ }
275
+ }
276
+ export {};