@univerjs-pro/sheets-pivot-ui 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +1 -0
  2. package/lib/cjs/index.js +1 -0
  3. package/lib/es/index.js +1 -0
  4. package/lib/index.css +1 -0
  5. package/lib/locale/en-US.json +89 -0
  6. package/lib/locale/ru-RU.json +89 -0
  7. package/lib/locale/vi-VN.json +89 -0
  8. package/lib/locale/zh-CN.json +89 -0
  9. package/lib/locale/zh-TW.json +89 -0
  10. package/lib/types/commands/commands/add-pivot-field.command.d.ts +4 -0
  11. package/lib/types/commands/commands/add-pivot-table.command.d.ts +4 -0
  12. package/lib/types/commands/commands/move-pivot-field.command.d.ts +4 -0
  13. package/lib/types/commands/commands/remove-pivot-field.command.d.ts +4 -0
  14. package/lib/types/commands/commands/set-pivot-collapse.command.d.ts +4 -0
  15. package/lib/types/commands/commands/set-pivot-filter.command.d.ts +4 -0
  16. package/lib/types/commands/commands/set-pivot-sort.command.d.ts +4 -0
  17. package/lib/types/commands/commands/update-pivot-setting.command.d.ts +4 -0
  18. package/lib/types/commands/commands/update-pivot-source.command.d.ts +4 -0
  19. package/lib/types/commands/commands/update-value-position.command.d.ts +4 -0
  20. package/lib/types/commands/operations/open-pivot-filter-panel.operation.d.ts +4 -0
  21. package/lib/types/commands/operations/open-pivot-range-panel.operation.d.ts +3 -0
  22. package/lib/types/commands/operations/open-pivot-setting-dialog.operation.d.ts +4 -0
  23. package/lib/types/commands/operations/open-pivot-table-panel.operation.d.ts +4 -0
  24. package/lib/types/const.d.ts +13 -0
  25. package/lib/types/controllers/sheets-pivot-clear.controller.d.ts +13 -0
  26. package/lib/types/controllers/sheets-pivot-confirm.controller.d.ts +20 -0
  27. package/lib/types/controllers/sheets-pivot-edit.controller.d.ts +16 -0
  28. package/lib/types/controllers/sheets-pivot-menu.controller.d.ts +11 -0
  29. package/lib/types/controllers/sheets-pivot-panel.controller.d.ts +18 -0
  30. package/lib/types/controllers/sheets-pivot-ref-range.controller.d.ts +23 -0
  31. package/lib/types/controllers/sheets-pivot-remove-sheet.controller.d.ts +10 -0
  32. package/lib/types/controllers/sheets-pivot-render.controller.d.ts +21 -0
  33. package/lib/types/controllers/sheets-pivot-table-menu.controller.d.ts +13 -0
  34. package/lib/types/index.d.ts +15 -0
  35. package/lib/types/locale/en-US.d.ts +4 -0
  36. package/lib/types/locale/ru-RU.d.ts +4 -0
  37. package/lib/types/locale/vi-VN.d.ts +4 -0
  38. package/lib/types/locale/zh-CN.d.ts +90 -0
  39. package/lib/types/locale/zh-TW.d.ts +4 -0
  40. package/lib/types/plugin.d.ts +20 -0
  41. package/lib/types/services/sheets-pivot-ui.service.d.ts +44 -0
  42. package/lib/types/type.d.ts +97 -0
  43. package/lib/types/util.d.ts +12 -0
  44. package/lib/types/views/components/PivotFilterPanel.d.ts +10 -0
  45. package/lib/types/views/components/PivotNumfmtDialog.d.ts +14 -0
  46. package/lib/types/views/components/PivotPanel.d.ts +13 -0
  47. package/lib/types/views/components/PivotPanelArea.d.ts +14 -0
  48. package/lib/types/views/components/PivotPanelSourceRange.d.ts +11 -0
  49. package/lib/types/views/components/PivotSourceList.d.ts +16 -0
  50. package/lib/types/views/components/PivotTableRangeSelector.d.ts +25 -0
  51. package/lib/types/views/components/SettingDialog.d.ts +15 -0
  52. package/lib/types/views/components/const.d.ts +24 -0
  53. package/lib/types/views/components/util.d.ts +78 -0
  54. package/lib/types/views/menu.d.ts +4 -0
  55. package/lib/types/views/widgets/drawing.d.ts +9 -0
  56. package/lib/types/views/widgets/icons.d.ts +5 -0
  57. package/lib/types/views/widgets/pivot-button.shape.d.ts +35 -0
  58. package/lib/umd/index.js +1 -0
  59. package/package.json +111 -0
@@ -0,0 +1,11 @@
1
+ import { SheetsPivotTableConfigModel } from '@univerjs-pro/sheets-pivot';
2
+ import { Disposable, IUniverInstanceService } from '@univerjs/core';
3
+ import { MergeCellController } from '@univerjs/sheets';
4
+
5
+ export declare class SheetsPivotMenuController extends Disposable {
6
+ private _mergeCellController;
7
+ private _univerInstanceService;
8
+ private readonly _sheetsPivotTableConfigModel;
9
+ constructor(_mergeCellController: MergeCellController, _univerInstanceService: IUniverInstanceService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel);
10
+ private _initMenuInterceptor;
11
+ }
@@ -0,0 +1,18 @@
1
+ import { SheetsPivotTableAdaptorModel } from '@univerjs-pro/sheets-pivot';
2
+ import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
3
+ import { SheetsSelectionsService } from '@univerjs/sheets';
4
+ import { IRangeSelectorService, ISidebarService } from '@univerjs/ui';
5
+
6
+ export declare class SheetsPivotTablePanelController extends Disposable {
7
+ private readonly _sheetsSelectionsService;
8
+ private readonly _univerInstanceService;
9
+ private readonly _sheetsPivotTableAdaptorModel;
10
+ private readonly _commandService;
11
+ private readonly _sidebarService;
12
+ private _rangeSelectorService;
13
+ private _pivotTableId;
14
+ constructor(_sheetsSelectionsService: SheetsSelectionsService, _univerInstanceService: IUniverInstanceService, _sheetsPivotTableAdaptorModel: SheetsPivotTableAdaptorModel, _commandService: ICommandService, _sidebarService: ISidebarService, _rangeSelectorService: IRangeSelectorService);
15
+ private _setPivotTableId;
16
+ private _initPanelOpen;
17
+ private _initSheetChange;
18
+ }
@@ -0,0 +1,23 @@
1
+ import { SheetsPivotTableAdaptorModel, SheetsPivotTableConfigModel } from '@univerjs-pro/sheets-pivot';
2
+ import { IMutationInfo, Disposable, DisposableCollection, ICommandService, Injector, IUniverInstanceService } from '@univerjs/core';
3
+ import { IMoveRangeCommandParams, RefRangeService, SheetInterceptorService } from '@univerjs/sheets';
4
+ import { SheetsPivotTableUIService } from '../services/sheets-pivot-ui.service';
5
+
6
+ export declare class SheetsPivotRefRangeController extends Disposable {
7
+ private readonly _injector;
8
+ private readonly _sheetsPivotTableUIService;
9
+ private readonly _refRangeService;
10
+ private readonly _commandService;
11
+ private readonly _univerInstanceService;
12
+ private readonly _sheetsPivotTableConfigModel;
13
+ private readonly _sheetsPivotTableAdaptorModel;
14
+ private readonly _sheetInterceptorService;
15
+ disposableCollection: DisposableCollection;
16
+ constructor(_injector: Injector, _sheetsPivotTableUIService: SheetsPivotTableUIService, _refRangeService: RefRangeService, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _sheetsPivotTableAdaptorModel: SheetsPivotTableAdaptorModel, _sheetInterceptorService: SheetInterceptorService);
17
+ private _onRefRangeChange;
18
+ private _refRangeHandle;
19
+ getRefRangeMutationsByMoveRange(params: IMoveRangeCommandParams, unitId: string, subUnitId: string): {
20
+ undos: IMutationInfo<object>[];
21
+ redos: IMutationInfo<object>[];
22
+ };
23
+ }
@@ -0,0 +1,10 @@
1
+ import { SheetsPivotTableConfigModel } from '@univerjs-pro/sheets-pivot';
2
+ import { Disposable } from '@univerjs/core';
3
+ import { SheetInterceptorService } from '@univerjs/sheets';
4
+
5
+ export declare class SheetsPivotRemoveSheetController extends Disposable {
6
+ private readonly _sheetInterceptorService;
7
+ private readonly _sheetsPivotTableConfigModel;
8
+ constructor(_sheetInterceptorService: SheetInterceptorService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel);
9
+ private _initRemoveSheetCommandInterceptor;
10
+ }
@@ -0,0 +1,21 @@
1
+ import { Disposable, Injector, IUniverInstanceService } from '@univerjs/core';
2
+ import { IRenderContext, IRenderModule, IRenderManagerService } from '@univerjs/engine-render';
3
+ import { SheetSkeletonManagerService } from '@univerjs/sheets-ui';
4
+ import { SheetsPivotTableAdaptorModel, SheetsPivotTableConfigModel } from '@univerjs-pro/sheets-pivot';
5
+ import { ComponentManager } from '@univerjs/ui';
6
+
7
+ export declare class SheetsPivotRenderController extends Disposable implements IRenderModule {
8
+ private readonly _context;
9
+ private readonly _injector;
10
+ private readonly _sheetsPivotTableAdaptorModel;
11
+ private _sheetSkeletonManagerService;
12
+ private readonly _renderManagerService;
13
+ private _componentManager;
14
+ private readonly _univerInstanceService;
15
+ private readonly _sheetsPivotTableConfigModel;
16
+ private _pivotButtonShapesArr;
17
+ constructor(_context: IRenderContext, _injector: Injector, _sheetsPivotTableAdaptorModel: SheetsPivotTableAdaptorModel, _sheetSkeletonManagerService: SheetSkeletonManagerService, _renderManagerService: IRenderManagerService, _componentManager: ComponentManager, _univerInstanceService: IUniverInstanceService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel);
18
+ private _initButtonRender;
19
+ private _initSkeleton;
20
+ private _initComponents;
21
+ }
@@ -0,0 +1,13 @@
1
+ import { Disposable, Injector } from '@univerjs/core';
2
+ import { ComponentManager, IMenuService } from '@univerjs/ui';
3
+ import { IUniverSheetsPivotTableUIConfig } from '../plugin';
4
+
5
+ export declare class SheetsPivotTableMenuController extends Disposable {
6
+ private readonly _config;
7
+ private readonly _injector;
8
+ private _menuService;
9
+ private readonly _componentManager;
10
+ constructor(_config: Partial<IUniverSheetsPivotTableUIConfig>, _injector: Injector, _menuService: IMenuService, _componentManager: ComponentManager);
11
+ initDialogComponent(): void;
12
+ private _initMenu;
13
+ }
@@ -0,0 +1,15 @@
1
+ export { UniverSheetsPivotTableUIPlugin } from './plugin';
2
+ export { OpenPivotTableRangeSelectorPanelOperation } from './commands/operations/open-pivot-range-panel.operation';
3
+ export { OpenPivotTableFilterPanelOperation } from './commands/operations/open-pivot-filter-panel.operation';
4
+ export { OpenPivotTableFieldSettingDialogOperation } from './commands/operations/open-pivot-setting-dialog.operation';
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,4 @@
1
+ import { default as zhCN } from './zh-CN';
2
+
3
+ declare const locale: typeof zhCN;
4
+ export default locale;
@@ -0,0 +1,4 @@
1
+ import { default as zhCN } from './zh-CN';
2
+
3
+ declare const locale: typeof zhCN;
4
+ export default locale;
@@ -0,0 +1,4 @@
1
+ import { default as zhCN } from './zh-CN';
2
+
3
+ declare const locale: typeof zhCN;
4
+ export default locale;
@@ -0,0 +1,90 @@
1
+ declare const locale: {
2
+ 'sheets-pivot-panel': {
3
+ title: string;
4
+ sourceRangeLabel: string;
5
+ sourceRangePlaceholder: string;
6
+ sourceFieldTile: string;
7
+ sourceFieldDescription: string;
8
+ filter: string;
9
+ column: string;
10
+ row: string;
11
+ value: string;
12
+ multipleValue: string;
13
+ filterDesc: string;
14
+ columnDesc: string;
15
+ rowDesc: string;
16
+ valueDesc: string;
17
+ addToFilter: string;
18
+ addToColumn: string;
19
+ addToRow: string;
20
+ addToValue: string;
21
+ removeField: string;
22
+ filterField: string;
23
+ fieldSettings: string;
24
+ moveToRow: string;
25
+ moveToColumn: string;
26
+ dialog: {
27
+ fieldName: string;
28
+ sourceName: string;
29
+ summarizeBy: string;
30
+ format: string;
31
+ ok: string;
32
+ cancel: string;
33
+ filter: {
34
+ ascending: string;
35
+ descending: string;
36
+ selectAll: string;
37
+ clearFilter: string;
38
+ blank: string;
39
+ cancel: string;
40
+ confirm: string;
41
+ };
42
+ numfmt: {
43
+ general: string;
44
+ accounting: string;
45
+ currency: string;
46
+ date: string;
47
+ thousandthPercentile: string;
48
+ fieldSetting: string;
49
+ formatTypes: string;
50
+ confirm: string;
51
+ cancel: string;
52
+ generalDesc: string;
53
+ accountingDesc: string;
54
+ currencyDesc: string;
55
+ dateDesc: string;
56
+ thousandthPercentileDesc: string;
57
+ decimalPlaces: string;
58
+ currencyTypes: string;
59
+ negativeNumberTypes: string;
60
+ dateTypes: string;
61
+ };
62
+ };
63
+ subtotal: {
64
+ average: string;
65
+ count: string;
66
+ countNums: string;
67
+ max: string;
68
+ min: string;
69
+ product: string;
70
+ stdDev: string;
71
+ stdDevp: string;
72
+ sum: string;
73
+ var: string;
74
+ varp: string;
75
+ };
76
+ subTotalText: string;
77
+ grandTotalText: string;
78
+ perform: {
79
+ info: string;
80
+ confirm: string;
81
+ cancel: string;
82
+ rowColError: string;
83
+ };
84
+ msg: {
85
+ emptySourceRange: string;
86
+ invalidSize: string;
87
+ };
88
+ };
89
+ };
90
+ export default locale;
@@ -0,0 +1,4 @@
1
+ import { default as zhCN } from './zh-CN';
2
+
3
+ declare const locale: typeof zhCN;
4
+ export default locale;
@@ -0,0 +1,20 @@
1
+ import { ICommandService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
2
+ import { IRenderManagerService } from '@univerjs/engine-render';
3
+ import { MenuConfig } from '@univerjs/ui';
4
+
5
+ export interface IUniverSheetsPivotTableUIConfig {
6
+ menu: MenuConfig;
7
+ }
8
+ export declare class UniverSheetsPivotTableUIPlugin extends Plugin {
9
+ private readonly _config;
10
+ readonly _injector: Injector;
11
+ private readonly _commandService;
12
+ private readonly _renderManagerService;
13
+ static pluginName: string;
14
+ static type: UniverInstanceType;
15
+ constructor(_config: Partial<IUniverSheetsPivotTableUIConfig>, _injector: Injector, _commandService: ICommandService, _renderManagerService: IRenderManagerService);
16
+ onStarting(injector: Injector): void;
17
+ onReady(): void;
18
+ private _registerRenderModules;
19
+ private _initRegisterCommand;
20
+ }
@@ -0,0 +1,44 @@
1
+ import { PivotView } from '@univerjs-pro/pivot-engine';
2
+ import { IPivotCellPositionInfo, SheetsPivotTableConfigModel } from '@univerjs-pro/sheets-pivot';
3
+ import { IMutationInfo, IRange, Disposable, Injector, IUniverInstanceService, LocaleService } from '@univerjs/core';
4
+ import { ISetRangeValuesMutationParams, SheetInterceptorService } from '@univerjs/sheets';
5
+ import { IConfirmService } from '@univerjs/ui';
6
+
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
+ constructor(_injector: Injector, _sheetInterceptorService: SheetInterceptorService, _confirmService: IConfirmService, _localeService: LocaleService, _univerInstanceService: IUniverInstanceService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel);
15
+ confirmCheckByView(cellInfo: IPivotCellPositionInfo, view: PivotView, isEmpty: boolean): Promise<{
16
+ perform: boolean;
17
+ mutations: import('@univerjs/core').IUndoRedoCommandInfosByInterceptor;
18
+ }>;
19
+ getEmptyPivotRanges(cellInfo: IPivotCellPositionInfo): {
20
+ startRow: number;
21
+ endRow: number;
22
+ startColumn: number;
23
+ endColumn: number;
24
+ }[];
25
+ getAutoFitColumnsMutations(view: PivotView, cellInfo: IPivotCellPositionInfo): {
26
+ undos: IMutationInfo<object>[];
27
+ redos: IMutationInfo<object>[];
28
+ };
29
+ getInsertRowColMutations(view: PivotView, cellInfo: IPivotCellPositionInfo, isEmpty: boolean): {
30
+ undos: IMutationInfo<object>[];
31
+ redos: IMutationInfo<object>[];
32
+ };
33
+ generateSetRangeValueMutations(injector: Injector, unitId: string, subUnitId: string, ranges: IRange[]): {
34
+ setRangeValueUndoMutation: {
35
+ id: string;
36
+ params: ISetRangeValuesMutationParams;
37
+ };
38
+ setRangeValueRedoMutation: {
39
+ id: string;
40
+ params: ISetRangeValuesMutationParams;
41
+ };
42
+ shouldClear: boolean;
43
+ };
44
+ }
@@ -0,0 +1,97 @@
1
+ import { IPivotTableFilterInfo, IPivotTableSortInfo, PivotDataFieldDataTypeEnum, PivotSubtotalTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum } from '@univerjs-pro/pivot-engine';
2
+ import { IPivotPanelSourceList, IPivotPanelTableListItemBase, IUnitRangeNameWithSubUnitId } from '@univerjs-pro/sheets-pivot';
3
+
4
+ export interface IOpenPivotTablePanelOperationParams {
5
+ pivotTableId: string;
6
+ }
7
+ export interface IOpenPivotTableFilterPanelOperationParams {
8
+ row: number;
9
+ col: number;
10
+ unitId: string;
11
+ subUnitId: string;
12
+ tableFieldId?: string;
13
+ pivotTableId?: string;
14
+ }
15
+ export interface IOpenPivotTableFieldSettingDialogOperationParams {
16
+ tableFieldId: string;
17
+ pivotTableId: string;
18
+ unitId: string;
19
+ subUnitId: string;
20
+ tableFieldInfo: IPivotPanelTableListItemBase;
21
+ dataFieldInfo: IPivotPanelSourceList;
22
+ }
23
+ export interface IAddPivotFieldCommandParams {
24
+ unitId: string;
25
+ subUnitId: string;
26
+ pivotTableId: string;
27
+ fieldName: string;
28
+ fieldArea: PivotTableFiledAreaEnum;
29
+ index: number;
30
+ }
31
+ export interface IRemovePivotFieldCommandParams {
32
+ unitId: string;
33
+ subUnitId: string;
34
+ pivotTableId: string;
35
+ fieldIds: string[];
36
+ }
37
+ export interface IUpdatePivotValuePositionCommandParams {
38
+ pivotTableId: string;
39
+ position: PivotTableValuePositionEnum;
40
+ index: number;
41
+ }
42
+ export interface IMovePivotFieldCommandParams {
43
+ unitId: string;
44
+ subUnitId: string;
45
+ pivotTableId: string;
46
+ fieldId: string;
47
+ area: PivotTableFiledAreaEnum;
48
+ index: number;
49
+ }
50
+ export interface ISetPivotFilterCommandParams {
51
+ unitId: string;
52
+ subUnitId: string;
53
+ pivotTableId: string;
54
+ tableFieldId: string;
55
+ items: string[];
56
+ isAll?: boolean;
57
+ }
58
+ export interface ISetPivotSortCommandParams {
59
+ unitId: string;
60
+ subUnitId: string;
61
+ tableFieldId: string;
62
+ pivotTableId: string;
63
+ info: IPivotTableSortInfo;
64
+ }
65
+ export interface IUpdatePivotFieldSettingCommandParams {
66
+ unitId: string;
67
+ subUnitId: string;
68
+ tableFieldId: string;
69
+ pivotTableId: string;
70
+ displayName?: string;
71
+ format?: string;
72
+ subtotalType?: PivotSubtotalTypeEnum;
73
+ tableFieldInfo: IPivotPanelTableListItemBase;
74
+ dataFieldInfo: IPivotPanelSourceList;
75
+ }
76
+ export interface ISetPivotCollapseCommandParams {
77
+ unitId: string;
78
+ subUnitId: string;
79
+ row: number;
80
+ col: number;
81
+ collapse: boolean;
82
+ }
83
+ export interface IFilterItemInfo {
84
+ tableFieldId: string;
85
+ pivotTableId: string;
86
+ items: string[];
87
+ itemTypes: PivotDataFieldDataTypeEnum[];
88
+ format?: string;
89
+ filterInfo: IPivotTableFilterInfo | undefined;
90
+ sortInfo: IPivotTableSortInfo | undefined;
91
+ }
92
+ export interface IUpdatePivotTableSourceRangeCommandParams {
93
+ unitId: string;
94
+ subUnitId: string;
95
+ token: string;
96
+ dataRangeInfo: IUnitRangeNameWithSubUnitId;
97
+ }
@@ -0,0 +1,12 @@
1
+ import { LabelViewItem, PivotView, PivotViewItem } from '@univerjs-pro/pivot-engine';
2
+
3
+ export declare function getPivotRowColCount(view: PivotView, startCell: {
4
+ row: number;
5
+ col: number;
6
+ }, isEmpty: boolean): {
7
+ rowCount: number;
8
+ colCount: number;
9
+ };
10
+ export declare function getHeaderViewMaxText(labelView: LabelViewItem, textInfo: Record<string, string>, isCol: boolean, formatMap: Record<string, string>): string;
11
+ export declare function getValueViewMaxText(rowView: PivotViewItem): string;
12
+ export declare function getCornerMaxText(corner: PivotViewItem): string;
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ import { IFilterItemInfo } from '../../type';
3
+
4
+ interface IPivotFilterPanelProps {
5
+ unitId: string;
6
+ subUnitId: string;
7
+ filterItemInfo: IFilterItemInfo;
8
+ }
9
+ export declare function PivotFilterPanel(props: IPivotFilterPanelProps): React.JSX.Element | undefined;
10
+ export {};
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ import { IPivotPanelSourceList, IPivotPanelTableListItemBase } from '@univerjs-pro/sheets-pivot';
3
+
4
+ interface IPivotNumfmtPanelProps {
5
+ unitId: string;
6
+ subUnitId: string;
7
+ pivotTableId: string;
8
+ tableFieldId: string;
9
+ originPattern?: string;
10
+ tableFieldInfo: IPivotPanelTableListItemBase;
11
+ dataFieldInfo: IPivotPanelSourceList;
12
+ }
13
+ export declare const PivotNumfmtDialog: ({ unitId, subUnitId, pivotTableId, tableFieldId, originPattern, tableFieldInfo, dataFieldInfo }: IPivotNumfmtPanelProps) => React.JSX.Element;
14
+ export {};
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ import { IPivotPanelDataInfo } from '@univerjs-pro/sheets-pivot';
3
+
4
+ interface IPivotPanelProps {
5
+ pivotTableId: string;
6
+ version: number;
7
+ setVersion: (version: number) => void;
8
+ unitId: string;
9
+ subUnitId: string;
10
+ panelInfo: IPivotPanelDataInfo;
11
+ }
12
+ export declare function PivotPanel(props: IPivotPanelProps): React.JSX.Element | undefined;
13
+ export {};
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ import { IPivotPanelDataInfo, IPivotPanelTableListItemBase, IPivotTableConfig } from '@univerjs-pro/sheets-pivot';
3
+ import { PivotPanelAreaType } from './util';
4
+
5
+ interface IPivotFieldAreaItemProps {
6
+ areaType: PivotPanelAreaType;
7
+ items: IPivotPanelTableListItemBase[];
8
+ positionInfo: IPivotTableConfig['targetCellInfo'];
9
+ pivotTableId: string;
10
+ pivotTableInfo: IPivotPanelDataInfo;
11
+ refreshHandler: () => void;
12
+ }
13
+ export declare function PivotFieldAreaItem(props: IPivotFieldAreaItemProps): React.JSX.Element;
14
+ export {};
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ import { IPivotTableConfig, IUnitRangeNameWithSubUnitId } from '@univerjs-pro/sheets-pivot';
3
+
4
+ interface IPivotSourceRangeProps {
5
+ sourceRangeInfo: IUnitRangeNameWithSubUnitId;
6
+ pivotTableId: string;
7
+ refreshHandler: () => void;
8
+ positionInfo: IPivotTableConfig['targetCellInfo'];
9
+ }
10
+ export declare function PivotSourceRange(props: IPivotSourceRangeProps): React.JSX.Element;
11
+ export {};
@@ -0,0 +1,16 @@
1
+ import { default as React } from 'react';
2
+ import { IPivotPanelDataInfo, IPivotPanelSourceList } from '@univerjs-pro/sheets-pivot';
3
+
4
+ interface IPivotSourceListProps {
5
+ sourceList: IPivotPanelSourceList[];
6
+ refreshHandler: () => void;
7
+ pivotTableId: string;
8
+ isDropDisabled: boolean;
9
+ pivotTableInfo: IPivotPanelDataInfo;
10
+ unitId: string;
11
+ subUnitId: string;
12
+ sourceRef: React.RefObject<HTMLDivElement>;
13
+ draggingId: string;
14
+ }
15
+ export declare function PivotSourceList(props: IPivotSourceListProps): React.JSX.Element;
16
+ export {};
@@ -0,0 +1,25 @@
1
+ import { IRange } from '@univerjs/core';
2
+ import { default as React } from 'react';
3
+ import { PositionType } from '@univerjs-pro/sheets-pivot';
4
+
5
+ export interface IPivotTableRangeSelectorReturns {
6
+ sourceRange: IRange;
7
+ sourceSheetName: string;
8
+ positionRange?: IRange;
9
+ positionSheetName?: string;
10
+ positionType: PositionType;
11
+ }
12
+ export interface IPivotTableRangeSelectorProps {
13
+ unitId: string;
14
+ subUnitId: string;
15
+ sourceRange: IRange;
16
+ sourceSheetName: string;
17
+ positionRange: IRange | null;
18
+ positionSheetName: string;
19
+ onConfirm: (info: IPivotTableRangeSelectorReturns) => void;
20
+ onCancel: () => void;
21
+ }
22
+ export declare function PivotTableRangeSelector(props: IPivotTableRangeSelectorProps): React.JSX.Element;
23
+ export declare namespace PivotTableRangeSelector {
24
+ var componentKey: string;
25
+ }
@@ -0,0 +1,15 @@
1
+ import { default as React } from 'react';
2
+ import { IPivotPanelSourceList, IPivotPanelTableListItemBase } from '@univerjs-pro/sheets-pivot';
3
+
4
+ interface IPivotFilterPanelProps {
5
+ pivotTableId: string;
6
+ tableFieldId: string;
7
+ unitId: string;
8
+ subUnitId: string;
9
+ closeFn: () => void;
10
+ format?: string;
11
+ tableFieldInfo: IPivotPanelTableListItemBase;
12
+ dataFieldInfo: IPivotPanelSourceList;
13
+ }
14
+ export declare function PivotSettingDialog(props: IPivotFilterPanelProps): React.JSX.Element | undefined;
15
+ export {};
@@ -0,0 +1,24 @@
1
+ export declare const DateFormatList: {
2
+ label: string;
3
+ suffix: string;
4
+ }[];
5
+ export declare const ThousandsSeparatorFormatList: ({
6
+ label: string;
7
+ suffix: string;
8
+ color?: undefined;
9
+ } | {
10
+ label: string;
11
+ suffix: string;
12
+ color: string;
13
+ })[];
14
+ export declare const CurrencyFormatList: ({
15
+ label: (suffix: string) => string;
16
+ suffix: (suffix: string) => string;
17
+ color?: undefined;
18
+ } | {
19
+ label: (suffix: string) => string;
20
+ suffix: (suffix: string) => string;
21
+ color: string;
22
+ })[];
23
+ export declare const currencySymbols: string[];
24
+ export declare const SHEET_PIVOT_PANEL_SOURCE_RANGE = "sheet.pivot-panel-source-range";
@@ -0,0 +1,78 @@
1
+ import { PivotSubtotalTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum } from '@univerjs-pro/pivot-engine';
2
+ import { ICommandService, IRange, Worksheet } from '@univerjs/core';
3
+ import { IPivotPanelDataInfo, IUnitRangeNameWithSubUnitId } from '@univerjs-pro/sheets-pivot';
4
+
5
+ export declare const PivotDropId = "PivotDropId";
6
+ export declare const PivotMultipleValueId = "PivotMultipleValueId";
7
+ interface IExecuteRemoveCommandCtx {
8
+ pivotTableId: string;
9
+ unitId: string;
10
+ subUnitId: string;
11
+ commandService: ICommandService;
12
+ }
13
+ export declare enum PivotPanelAreaType {
14
+ Filter = "filter",
15
+ Row = "row",
16
+ Column = "column",
17
+ Value = "value",
18
+ Source = "source"
19
+ }
20
+ export declare function getDraggedStyle(isDragging: boolean): React.CSSProperties;
21
+ interface IPivotPanelDragCtx {
22
+ pivotTableInfo: IPivotPanelDataInfo;
23
+ pivotTableId: string;
24
+ commandService: ICommandService;
25
+ unitId: string;
26
+ subUnitId: string;
27
+ }
28
+ export declare enum PivotSourceRangeErrorEnum {
29
+ EmptyRange = 0,
30
+ InvalidSize = 1,
31
+ Valid = 2
32
+ }
33
+ /**
34
+ * - check if the range is valid for pivot source
35
+ * @param {Worksheet} sheet - the sheet to check
36
+ * @param {IRange} range -the range to check
37
+ * @returns {boolean} - if the range is valid for pivot source
38
+ */
39
+ export declare function isValidPivotSourceRange(sheet: Worksheet, range: IRange): PivotSourceRangeErrorEnum;
40
+ export declare function handlerDropItemOut(ctx: IPivotPanelDragCtx, dragId: string, from: PivotPanelAreaType): Promise<void>;
41
+ export declare function handleUpdateSourceRange(commandService: ICommandService, pivotTableId: string, dataRangeInfo: IUnitRangeNameWithSubUnitId, unitId: string, subUnitId: string): Promise<void>;
42
+ export declare function handlerDragEnd(ctx: IPivotPanelDragCtx, dragId: string, from: PivotPanelAreaType, to: PivotPanelAreaType, index: number): Promise<void>;
43
+ export declare function executeRemoveCommand(ctx: IExecuteRemoveCommandCtx, fieldIds: string[]): Promise<void>;
44
+ export declare function executeUpdateValuePositionCommand(ctx: IExecuteRemoveCommandCtx, position: PivotTableValuePositionEnum, index: number): Promise<void>;
45
+ export declare function openFilterDialog(commandService: ICommandService, unitId: string, subUnitId: string, pivotTableId: string, tableFieldId: string): void;
46
+ export declare function openFieldSettingDialog(commandService: ICommandService, pivotTableId: string, tableFieldId: string, unitId: string, subUnitId: string, pivotTableInfo: IPivotPanelDataInfo): void;
47
+ interface ISummarizeListItem {
48
+ type: PivotSubtotalTypeEnum;
49
+ textKey: string;
50
+ }
51
+ export declare const SummarizeByList: ISummarizeListItem[];
52
+ export declare const getDecimalFromPattern: (pattern: string, defaultValue?: number) => any;
53
+ /**
54
+ * Determines whether two pattern are equal, excluding differences in decimal places
55
+ */
56
+ export declare const isPatternEqualWithoutDecimal: (patternA: string, patternB: string) => boolean;
57
+ export declare const getDecimalString: (length: number) => string;
58
+ export declare const setPatternDecimal: (patterns: string, decimalLength: number) => string;
59
+ export declare const isPatternHasDecimal: (pattern: string) => boolean;
60
+ export declare const getCurrencyType: (pattern: string) => string | undefined;
61
+ export declare const isGeneralPanel: (pattern: string) => boolean;
62
+ export declare const isAccountingPanel: (pattern: string) => boolean;
63
+ export declare const isCurrencyPanel: (pattern: string) => boolean;
64
+ export declare const getDateFormatOptions: () => {
65
+ label: string;
66
+ value: string;
67
+ }[];
68
+ export declare const isDatePanel: (pattern: string) => boolean;
69
+ export declare const getNumberFormatOptions: () => {
70
+ label: string;
71
+ value: string;
72
+ color: string | undefined;
73
+ }[];
74
+ export declare const isThousandthPercentilePanel: (pattern: string) => boolean;
75
+ export declare const getAreaFieldCount: (pivotTableInfo: IPivotPanelDataInfo, area: PivotTableFiledAreaEnum) => number;
76
+ export declare const isPrefixName: (baseName: string, name: string, textInfo: Record<string, string>) => boolean;
77
+ export declare const getPrefixName: (baseName: string, textInfo: Record<string, string>, subtotalType: PivotSubtotalTypeEnum) => string;
78
+ export {};
@@ -0,0 +1,4 @@
1
+ import { IMenuItem } from '@univerjs/ui';
2
+ import { IAccessor } from '@univerjs/core';
3
+
4
+ export declare function sheetsPivotTableToolbarMenuFactory(accessor: IAccessor): IMenuItem;