@univerjs-pro/sheets-pivot-ui 0.4.1-nightly.202410291304 → 0.4.2

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 (31) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/es/index.js +1 -1
  3. package/lib/types/commands/commands/add-pivot-field.command.d.ts +3 -0
  4. package/lib/types/commands/commands/add-pivot-table.command.d.ts +3 -0
  5. package/lib/types/commands/commands/move-pivot-field.command.d.ts +3 -0
  6. package/lib/types/commands/commands/pivot-drill-down.command.d.ts +3 -0
  7. package/lib/types/commands/commands/remove-pivot-field.command.d.ts +3 -0
  8. package/lib/types/commands/commands/set-pivot-collapse.command.d.ts +3 -0
  9. package/lib/types/commands/commands/set-pivot-filter.command.d.ts +3 -0
  10. package/lib/types/commands/commands/set-pivot-sort.command.d.ts +3 -0
  11. package/lib/types/commands/commands/update-pivot-setting.command.d.ts +3 -0
  12. package/lib/types/commands/commands/update-pivot-source.command.d.ts +3 -0
  13. package/lib/types/commands/commands/update-value-position.command.d.ts +3 -0
  14. package/lib/types/const.d.ts +1 -0
  15. package/lib/types/controllers/sheets-pivot-clear.controller.d.ts +12 -0
  16. package/lib/types/controllers/sheets-pivot-confirm.controller.d.ts +3 -1
  17. package/lib/types/controllers/sheets-pivot-permission.controller.d.ts +7 -0
  18. package/lib/types/controllers/sheets-pivot-ref-range.controller.d.ts +22 -0
  19. package/lib/types/controllers/sheets-pivot-remove-sheet.controller.d.ts +9 -0
  20. package/lib/types/controllers/sheets-pivot-render.controller.d.ts +1 -1
  21. package/lib/types/index.d.ts +10 -0
  22. package/lib/types/services/sheets-pivot-ui.service.d.ts +45 -0
  23. package/lib/types/type.d.ts +72 -2
  24. package/lib/types/util.d.ts +4 -1
  25. package/lib/types/views/components/PivotFilterPanel.d.ts +1 -1
  26. package/lib/types/views/components/PivotSourceList.d.ts +1 -1
  27. package/lib/types/views/components/util.d.ts +1 -1
  28. package/lib/types/views/widgets/pivot-button.shape.d.ts +2 -2
  29. package/lib/umd/index.js +1 -1
  30. package/package.json +16 -16
  31. package/lib/types/controllers/sheets-pivot-intercept-ui.controller.d.ts +0 -15
@@ -0,0 +1,3 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ import { IAddPivotFieldCommandParams } from '../../type';
3
+ export declare const AddPivotFieldCommand: ICommand<IAddPivotFieldCommandParams>;
@@ -0,0 +1,3 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ import { IAddPivotTableCommandParams } from '@univerjs-pro/sheets-pivot';
3
+ export declare const AddPivotTableCommand: ICommand<IAddPivotTableCommandParams>;
@@ -0,0 +1,3 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ import { IMovePivotFieldCommandParams } from '../../type';
3
+ export declare const MovePivotFieldCommand: ICommand<IMovePivotFieldCommandParams>;
@@ -0,0 +1,3 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ import { IPivotDrillDownCommandParams } from '../../type';
3
+ export declare const PivotDrillDownCommand: ICommand<IPivotDrillDownCommandParams>;
@@ -0,0 +1,3 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ import { IRemovePivotFieldCommandParams } from '../../type';
3
+ export declare const RemovePivotFieldCommand: ICommand<IRemovePivotFieldCommandParams>;
@@ -0,0 +1,3 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ import { ISetPivotCollapseCommandParams } from '../../type';
3
+ export declare const SetPivotCollapseCommand: ICommand<ISetPivotCollapseCommandParams>;
@@ -0,0 +1,3 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ import { ISetPivotFilterCommandParams } from '../../type';
3
+ export declare const SetPivotFilterCommand: ICommand<ISetPivotFilterCommandParams>;
@@ -0,0 +1,3 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ import { ISetPivotSortCommandParams } from '../../type';
3
+ export declare const SetPivotSortCommand: ICommand<ISetPivotSortCommandParams>;
@@ -0,0 +1,3 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ import { IUpdatePivotFieldSettingCommandParams } from '../../type';
3
+ export declare const UpdatePivotFieldSettingCommand: ICommand<IUpdatePivotFieldSettingCommandParams>;
@@ -0,0 +1,3 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ import { IUpdatePivotTableSourceRangeCommandParams } from '../../type';
3
+ export declare const UpdatePivotTableSourceRangeCommand: ICommand<IUpdatePivotTableSourceRangeCommandParams>;
@@ -0,0 +1,3 @@
1
+ import { ICommand } from '@univerjs/core';
2
+ import { IUpdatePivotValuePositionCommandParams } from '../../type';
3
+ export declare const UpdatePivotValuePositionCommand: ICommand<IUpdatePivotValuePositionCommandParams>;
@@ -10,6 +10,7 @@ export declare const DEFAULT_EMPTY_PIVOT_ROW_COUNT = 14;
10
10
  export declare const DEFAULT_EMPTY_PIVOT_COL_COUNT = 6;
11
11
  export declare const PIVOT_TABLE_ICON_KEY = "PIVOT_TABLE_ICON_KEY";
12
12
  export declare const PIVOT_TABLE_BACK_KEY = "PIVOT_TABLE_BACK_KEY";
13
+ export declare const SHEET_PIVOT_AUTO_FIT_COLUMN_TEST_COUNT = 100;
13
14
  export declare enum PivotFilterStatus {
14
15
  HasFilter = "HasFilter",
15
16
  NotFilter = "NotFilter"
@@ -0,0 +1,12 @@
1
+ import { Disposable, DisposableCollection, IUniverInstanceService } from '@univerjs/core';
2
+ import { SheetInterceptorService, SheetsSelectionsService } from '@univerjs/sheets';
3
+ import { SheetsPivotTableConfigModel } from '@univerjs-pro/sheets-pivot';
4
+ export declare class SheetsPivotClearController extends Disposable {
5
+ private readonly _univerInstanceService;
6
+ private readonly _sheetInterceptorService;
7
+ private readonly _sheetsSelectionsService;
8
+ private readonly _sheetsPivotTableConfigModel;
9
+ disposableCollection: DisposableCollection;
10
+ constructor(_univerInstanceService: IUniverInstanceService, _sheetInterceptorService: SheetInterceptorService, _sheetsSelectionsService: SheetsSelectionsService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel);
11
+ private _initClearSelectionCommandInterceptor;
12
+ }
@@ -2,6 +2,7 @@ import { Disposable, Injector, IUniverInstanceService, LocaleService } from '@un
2
2
  import { SheetInterceptorService } from '@univerjs/sheets';
3
3
  import { IConfirmService, IMessageService } from '@univerjs/ui';
4
4
  import { SheetsPivotTableAdaptorModel, SheetsPivotTableConfigModel } from '@univerjs-pro/sheets-pivot';
5
+ import { SheetsPivotTableUIService } from '../services/sheets-pivot-ui.service';
5
6
  export declare class SheetsPivotConfirmController extends Disposable {
6
7
  private readonly _injector;
7
8
  private readonly _univerInstanceService;
@@ -10,8 +11,9 @@ export declare class SheetsPivotConfirmController extends Disposable {
10
11
  private readonly _confirmService;
11
12
  private readonly _localeService;
12
13
  private readonly _sheetsPivotTableConfigModel;
14
+ private readonly _sheetsPivotTableUIService;
13
15
  private readonly _messageService;
14
- constructor(_injector: Injector, _univerInstanceService: IUniverInstanceService, _sheetsPivotTableAdaptorModel: SheetsPivotTableAdaptorModel, _sheetInterceptorService: SheetInterceptorService, _confirmService: IConfirmService, _localeService: LocaleService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _messageService: IMessageService);
16
+ constructor(_injector: Injector, _univerInstanceService: IUniverInstanceService, _sheetsPivotTableAdaptorModel: SheetsPivotTableAdaptorModel, _sheetInterceptorService: SheetInterceptorService, _confirmService: IConfirmService, _localeService: LocaleService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _sheetsPivotTableUIService: SheetsPivotTableUIService, _messageService: IMessageService);
15
17
  private _initMoveRangeConfirmCheck;
16
18
  private _initRowColOperationCheck;
17
19
  }
@@ -0,0 +1,7 @@
1
+ import { Disposable, ICommandService, IPermissionService } from '@univerjs/core';
2
+ export declare class SheetsPivotPrintController extends Disposable {
3
+ private readonly _permissionService;
4
+ private readonly _commandService;
5
+ constructor(_permissionService: IPermissionService, _commandService: ICommandService);
6
+ private _initPermissionWithPivot;
7
+ }
@@ -0,0 +1,22 @@
1
+ import { IMutationInfo, Disposable, DisposableCollection, ICommandService, Injector, IUniverInstanceService } from '@univerjs/core';
2
+ import { IMoveRangeCommandParams, RefRangeService, SheetInterceptorService } from '@univerjs/sheets';
3
+ import { SheetsPivotTableAdaptorModel, SheetsPivotTableConfigModel } from '@univerjs-pro/sheets-pivot';
4
+ import { SheetsPivotTableUIService } from '../services/sheets-pivot-ui.service';
5
+ export declare class SheetsPivotRefRangeController extends Disposable {
6
+ private readonly _injector;
7
+ private readonly _sheetsPivotTableUIService;
8
+ private readonly _refRangeService;
9
+ private readonly _commandService;
10
+ private readonly _univerInstanceService;
11
+ private readonly _sheetsPivotTableConfigModel;
12
+ private readonly _sheetsPivotTableAdaptorModel;
13
+ private readonly _sheetInterceptorService;
14
+ disposableCollection: DisposableCollection;
15
+ constructor(_injector: Injector, _sheetsPivotTableUIService: SheetsPivotTableUIService, _refRangeService: RefRangeService, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _sheetsPivotTableAdaptorModel: SheetsPivotTableAdaptorModel, _sheetInterceptorService: SheetInterceptorService);
16
+ private _onRefRangeChange;
17
+ private _refRangeHandle;
18
+ getRefRangeMutationsByMoveRange(params: IMoveRangeCommandParams, unitId: string, subUnitId: string): {
19
+ redos: IMutationInfo[];
20
+ undos: IMutationInfo[];
21
+ };
22
+ }
@@ -0,0 +1,9 @@
1
+ import { Disposable } from '@univerjs/core';
2
+ import { SheetInterceptorService } from '@univerjs/sheets';
3
+ import { SheetsPivotTableConfigModel } from '@univerjs-pro/sheets-pivot';
4
+ export declare class SheetsPivotRemoveSheetController extends Disposable {
5
+ private readonly _sheetInterceptorService;
6
+ private readonly _sheetsPivotTableConfigModel;
7
+ constructor(_sheetInterceptorService: SheetInterceptorService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel);
8
+ private _initRemoveSheetCommandInterceptor;
9
+ }
@@ -1,8 +1,8 @@
1
1
  import { Workbook, Disposable, ICommandService, Injector, IPermissionService } from '@univerjs/core';
2
2
  import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
3
3
  import { SheetPermissionInterceptorBaseController, SheetSkeletonManagerService } from '@univerjs/sheets-ui';
4
- import { ComponentManager } from '@univerjs/ui';
5
4
  import { SheetsPivotTableAdaptorModel, SheetsPivotTableConfigModel } from '@univerjs-pro/sheets-pivot';
5
+ import { ComponentManager } from '@univerjs/ui';
6
6
  export declare class SheetsPivotRenderController extends Disposable implements IRenderModule {
7
7
  private readonly _context;
8
8
  private readonly _injector;
@@ -3,3 +3,13 @@ export { OpenPivotTableRangeSelectorPanelOperation } from './commands/operations
3
3
  export { OpenPivotTableFilterPanelOperation } from './commands/operations/open-pivot-filter-panel.operation';
4
4
  export { OpenPivotTableFieldSettingDialogOperation } from './commands/operations/open-pivot-setting-dialog.operation';
5
5
  export { OpenPivotTablePanelOperation } from './commands/operations/open-pivot-table-panel.operation';
6
+ export { AddPivotFieldCommand } from './commands/commands/add-pivot-field.command';
7
+ export { AddPivotTableCommand } from './commands/commands/add-pivot-table.command';
8
+ export { MovePivotFieldCommand } from './commands/commands/move-pivot-field.command';
9
+ export { RemovePivotFieldCommand } from './commands/commands/remove-pivot-field.command';
10
+ export { SetPivotCollapseCommand } from './commands/commands/set-pivot-collapse.command';
11
+ export { SetPivotFilterCommand } from './commands/commands/set-pivot-filter.command';
12
+ export { SetPivotSortCommand } from './commands/commands/set-pivot-sort.command';
13
+ export { UpdatePivotFieldSettingCommand } from './commands/commands/update-pivot-setting.command';
14
+ export { UpdatePivotTableSourceRangeCommand } from './commands/commands/update-pivot-source.command';
15
+ export { UpdatePivotValuePositionCommand } from './commands/commands/update-value-position.command';
@@ -0,0 +1,45 @@
1
+ import { IMutationInfo, IRange, Disposable, Injector, IUniverInstanceService, LocaleService } from '@univerjs/core';
2
+ import { ISetRangeValuesMutationParams, SheetInterceptorService } from '@univerjs/sheets';
3
+ import { PivotView } from '@univerjs-pro/engine-pivot';
4
+ import { IPivotCellPositionInfo, SheetsPivotTableConfigModel } from '@univerjs-pro/sheets-pivot';
5
+ import { SheetPermissionInterceptorBaseController } from '@univerjs/sheets-ui';
6
+ import { IConfirmService } from '@univerjs/ui';
7
+ export declare class SheetsPivotTableUIService extends Disposable {
8
+ private readonly _injector;
9
+ private readonly _sheetInterceptorService;
10
+ private readonly _confirmService;
11
+ private readonly _localeService;
12
+ private readonly _univerInstanceService;
13
+ private readonly _sheetsPivotTableConfigModel;
14
+ private readonly _sheetPermissionInterceptorBaseController;
15
+ constructor(_injector: Injector, _sheetInterceptorService: SheetInterceptorService, _confirmService: IConfirmService, _localeService: LocaleService, _univerInstanceService: IUniverInstanceService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _sheetPermissionInterceptorBaseController: SheetPermissionInterceptorBaseController);
16
+ confirmCheckByView(cellInfo: IPivotCellPositionInfo, view: PivotView, isEmpty: boolean): Promise<{
17
+ perform: boolean;
18
+ mutations: import('@univerjs/core').IUndoRedoCommandInfosByInterceptor;
19
+ }>;
20
+ getEmptyPivotRanges(cellInfo: IPivotCellPositionInfo): {
21
+ startRow: number;
22
+ endRow: number;
23
+ startColumn: number;
24
+ endColumn: number;
25
+ }[];
26
+ getAutoFitColumnsMutations(view: PivotView, cellInfo: IPivotCellPositionInfo): {
27
+ undos: IMutationInfo<object>[];
28
+ redos: IMutationInfo<object>[];
29
+ };
30
+ getInsertRowColMutations(view: PivotView, cellInfo: IPivotCellPositionInfo, isEmpty: boolean): {
31
+ undos: IMutationInfo<object>[];
32
+ redos: IMutationInfo<object>[];
33
+ };
34
+ generateSetRangeValueMutations(injector: Injector, unitId: string, subUnitId: string, ranges: IRange[]): {
35
+ setRangeValueUndoMutation: {
36
+ id: string;
37
+ params: ISetRangeValuesMutationParams;
38
+ };
39
+ setRangeValueRedoMutation: {
40
+ id: string;
41
+ params: ISetRangeValuesMutationParams;
42
+ };
43
+ shouldClear: boolean;
44
+ };
45
+ }
@@ -1,5 +1,5 @@
1
- import { IPivotTableFilterInfo, IPivotTableSortInfo, PivotDataFieldDataTypeEnum } from '@univerjs-pro/engine-pivot';
2
- import { IPivotPanelSourceList, IPivotPanelTableListItemBase } from '@univerjs-pro/sheets-pivot';
1
+ import { IPivotTableFilterInfo, IPivotTableSortInfo, PivotDataFieldDataTypeEnum, PivotSubtotalTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum } from '@univerjs-pro/engine-pivot';
2
+ import { IPivotPanelSourceList, IPivotPanelTableListItemBase, IUnitRangeNameWithSubUnitId } from '@univerjs-pro/sheets-pivot';
3
3
  export interface IOpenPivotTablePanelOperationParams {
4
4
  pivotTableId: string;
5
5
  }
@@ -19,6 +19,66 @@ export interface IOpenPivotTableFieldSettingDialogOperationParams {
19
19
  tableFieldInfo: IPivotPanelTableListItemBase;
20
20
  dataFieldInfo: IPivotPanelSourceList;
21
21
  }
22
+ export interface IAddPivotFieldCommandParams {
23
+ unitId: string;
24
+ subUnitId: string;
25
+ pivotTableId: string;
26
+ dataFieldId: string;
27
+ fieldArea: PivotTableFiledAreaEnum;
28
+ index: number;
29
+ }
30
+ export interface IRemovePivotFieldCommandParams {
31
+ unitId: string;
32
+ subUnitId: string;
33
+ pivotTableId: string;
34
+ fieldIds: string[];
35
+ }
36
+ export interface IUpdatePivotValuePositionCommandParams {
37
+ pivotTableId: string;
38
+ position: PivotTableValuePositionEnum;
39
+ index: number;
40
+ }
41
+ export interface IMovePivotFieldCommandParams {
42
+ unitId: string;
43
+ subUnitId: string;
44
+ pivotTableId: string;
45
+ fieldId: string;
46
+ area: PivotTableFiledAreaEnum;
47
+ index: number;
48
+ }
49
+ export interface ISetPivotFilterCommandParams {
50
+ unitId: string;
51
+ subUnitId: string;
52
+ pivotTableId: string;
53
+ tableFieldId: string;
54
+ items: string[];
55
+ isAll?: boolean;
56
+ }
57
+ export interface ISetPivotSortCommandParams {
58
+ unitId: string;
59
+ subUnitId: string;
60
+ tableFieldId: string;
61
+ pivotTableId: string;
62
+ info: IPivotTableSortInfo;
63
+ }
64
+ export interface IUpdatePivotFieldSettingCommandParams {
65
+ unitId: string;
66
+ subUnitId: string;
67
+ tableFieldId: string;
68
+ pivotTableId: string;
69
+ displayName?: string;
70
+ format?: string;
71
+ subtotalType?: PivotSubtotalTypeEnum;
72
+ tableFieldInfo: IPivotPanelTableListItemBase;
73
+ dataFieldInfo: IPivotPanelSourceList;
74
+ }
75
+ export interface ISetPivotCollapseCommandParams {
76
+ unitId: string;
77
+ subUnitId: string;
78
+ row: number;
79
+ col: number;
80
+ collapse: boolean;
81
+ }
22
82
  export interface IFilterItemInfo {
23
83
  tableFieldId: string;
24
84
  pivotTableId: string;
@@ -28,3 +88,13 @@ export interface IFilterItemInfo {
28
88
  filterInfo: IPivotTableFilterInfo | undefined;
29
89
  sortInfo: IPivotTableSortInfo | undefined;
30
90
  }
91
+ export interface IUpdatePivotTableSourceRangeCommandParams {
92
+ unitId: string;
93
+ subUnitId: string;
94
+ token: string;
95
+ dataRangeInfo: IUnitRangeNameWithSubUnitId;
96
+ }
97
+ export interface IPivotDrillDownCommandParams {
98
+ row: number;
99
+ col: number;
100
+ }
@@ -1,4 +1,4 @@
1
- import { PivotView } from '@univerjs-pro/engine-pivot';
1
+ import { LabelViewItem, PivotView, PivotViewItem } from '@univerjs-pro/engine-pivot';
2
2
  export declare function getPivotRowColCount(view: PivotView, startCell: {
3
3
  row: number;
4
4
  col: number;
@@ -6,3 +6,6 @@ export declare function getPivotRowColCount(view: PivotView, startCell: {
6
6
  rowCount: number;
7
7
  colCount: number;
8
8
  };
9
+ export declare function getHeaderViewMaxText(labelView: LabelViewItem, textInfo: Record<string, string>, isCol: boolean, formatMap: Record<string, string>): string;
10
+ export declare function getValueViewMaxText(rowView: PivotViewItem): string;
11
+ export declare function getCornerMaxText(corner: PivotViewItem): string;
@@ -1,5 +1,5 @@
1
- import { IFilterItemInfo } from '../../type';
2
1
  import { default as React } from 'react';
2
+ import { IFilterItemInfo } from '../../type';
3
3
  interface IPivotFilterPanelProps {
4
4
  unitId: string;
5
5
  subUnitId: string;
@@ -1,5 +1,5 @@
1
- import { IPivotPanelDataInfo, IPivotPanelSourceList } from '@univerjs-pro/sheets-pivot';
2
1
  import { default as React } from 'react';
2
+ import { IPivotPanelDataInfo, IPivotPanelSourceList } from '@univerjs-pro/sheets-pivot';
3
3
  interface IPivotSourceListProps {
4
4
  sourceList: IPivotPanelSourceList[];
5
5
  refreshHandler: () => void;
@@ -1,5 +1,5 @@
1
- import { ICommandService, IRange, Nullable, Worksheet } from '@univerjs/core';
2
1
  import { IPivotTableFilterInfo, PivotSubtotalTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum } from '@univerjs-pro/engine-pivot';
2
+ import { ICommandService, IRange, Nullable, Worksheet } from '@univerjs/core';
3
3
  import { IPivotPanelDataInfo, IUnitRangeNameWithSubUnitId } from '@univerjs-pro/sheets-pivot';
4
4
  import { DraggingStyle, NotDraggingStyle } from 'react-beautiful-dnd';
5
5
  import { PivotFilterStatus } from '../../const';
@@ -1,6 +1,6 @@
1
- import { IMouseEvent, IPointerEvent, IShapeProps, UniverRenderingContext2D, Shape } from '@univerjs/engine-render';
2
- import { ICommandService, IContextService, ThemeService } from '@univerjs/core';
3
1
  import { PivotCellStyleTypeEnum } from '@univerjs-pro/engine-pivot';
2
+ import { ICommandService, IContextService, ThemeService } from '@univerjs/core';
3
+ import { IMouseEvent, IPointerEvent, IShapeProps, UniverRenderingContext2D, Shape } from '@univerjs/engine-render';
4
4
  export declare const PIVOT_ICON_SIZE = 16;
5
5
  export declare const PIVOT_PADDING_SIZE = 1;
6
6
  export declare const PIVOT_EXPEND_SIZE = 12;