@univerjs-pro/sheets-pivot 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ar-SA.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/de-DE.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/id-ID.js +1 -1
- package/lib/cjs/locale/it-IT.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/pl-PL.js +1 -1
- package/lib/cjs/locale/pt-BR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-HK.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/locale/ar-SA.js +1 -1
- package/lib/es/locale/ca-ES.js +1 -1
- package/lib/es/locale/de-DE.js +1 -1
- package/lib/es/locale/en-US.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fa-IR.js +1 -1
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/id-ID.js +1 -1
- package/lib/es/locale/it-IT.js +1 -1
- package/lib/es/locale/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.js +1 -1
- package/lib/es/locale/pl-PL.js +1 -1
- package/lib/es/locale/pt-BR.js +1 -1
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +1 -1
- package/lib/es/locale/vi-VN.js +1 -1
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/ar-SA.js +1 -1
- package/lib/locale/ca-ES.js +1 -1
- package/lib/locale/de-DE.js +1 -1
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fa-IR.js +1 -1
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/id-ID.js +1 -1
- package/lib/locale/it-IT.js +1 -1
- package/lib/locale/ja-JP.js +1 -1
- package/lib/locale/ko-KR.js +1 -1
- package/lib/locale/pl-PL.js +1 -1
- package/lib/locale/pt-BR.js +1 -1
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +1 -1
- package/lib/locale/vi-VN.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/types/commands/command/group-command-util.d.ts +12 -0
- package/lib/types/commands/command/set-pivot-excel-date-group.command.d.ts +10 -0
- package/lib/types/commands/command/set-pivot-filter.command.d.ts +2 -0
- package/lib/types/commands/command/set-pivot-manual-groups.command.d.ts +10 -0
- package/lib/types/commands/command/set-pivot-number-group.command.d.ts +10 -0
- package/lib/types/commands/command/util.d.ts +7 -1
- package/lib/types/commands/mutations/pivot-data-communication.mutation.d.ts +3 -1
- package/lib/types/config/config.d.ts +2 -2
- package/lib/types/const/const.d.ts +9 -2
- package/lib/types/const/type.d.ts +92 -1
- package/lib/types/controllers/sheets-pivot-ref-range.controller.d.ts +2 -0
- package/lib/types/controllers/sheets-pivot-rpc.controller.d.ts +9 -2
- package/lib/types/facade/f-enum.d.ts +12 -3
- package/lib/types/facade/f-generic-pivot-table.d.ts +2 -1
- package/lib/types/facade/f-pivot-table.d.ts +101 -1
- package/lib/types/index.d.ts +7 -2
- package/lib/types/locale/en-US.d.ts +9 -0
- package/lib/types/models/sheets-pivot-config-model.d.ts +55 -9
- package/lib/types/models/sheets-pivot-data-field-manager.d.ts +18 -7
- package/lib/types/models/sheets-pivot-data-source-model.d.ts +25 -3
- package/lib/types/record-filter-bridge.d.ts +9 -0
- package/lib/types/services/sheets-pivot-cache.service.d.ts +15 -3
- package/lib/types/services/sheets-pivot-table.service.d.ts +7 -0
- package/lib/types/util.d.ts +5 -11
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +12 -11
package/lib/locale/zh-HK.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x3d67(_0x4b438e,_0x506c61){_0x4b438e=_0x4b438e-0x16b;const _0x14cee2=_0x14ce();let _0x3d67ba=_0x14cee2[_0x4b438e];return _0x3d67ba;}const _0x397f8b=_0x3d67;(function(_0x590b1f,_0x5c2fc8){const _0x148a98=_0x3d67,_0x2f58a5=_0x590b1f();while(!![]){try{const _0x684d58=-parseInt(_0x148a98(0x18b))/0x1*(parseInt(_0x148a98(0x18c))/0x2)+-parseInt(_0x148a98(0x17a))/0x3*(parseInt(_0x148a98(0x16b))/0x4)+parseInt(_0x148a98(0x177))/0x5+-parseInt(_0x148a98(0x184))/0x6+-parseInt(_0x148a98(0x188))/0x7+-parseInt(_0x148a98(0x170))/0x8+parseInt(_0x148a98(0x16e))/0x9*(parseInt(_0x148a98(0x18a))/0xa);if(_0x684d58===_0x5c2fc8)break;else _0x2f58a5['push'](_0x2f58a5['shift']());}catch(_0x1890af){_0x2f58a5['push'](_0x2f58a5['shift']());}}}(_0x14ce,0xacbf1));const e={'sheets-pivot':{'sheet':'工作表','blankValue':_0x397f8b(0x178),'otherValue':'(其他)','columnName':'欄\x20','subTotalText':'小計','grandTotalText':'總計','valueText':'值','rowLabels':'列標籤','columnLabels':_0x397f8b(0x16d),'averageName':'平均值項:','countName':_0x397f8b(0x179),'countNumsName':_0x397f8b(0x16f),'maxName':_0x397f8b(0x17e),'minName':'最小值項:','productName':'乘積項:','stdDevName':'標準差項:','stdDevpName':_0x397f8b(0x171),'sumName':_0x397f8b(0x174),'varName':'變異數項:','varpName':_0x397f8b(0x17d),'subTotal':'小計','grandTotal':'總計','value':'值','blank':'空白','other':'其他','renderText':{'valueField':_0x397f8b(0x16c),'subtotal':'{0}\x20{1}','grandTotal':_0x397f8b(0x172),'multipleGrandTotal':_0x397f8b(0x182),'subtotalWithValue':_0x397f8b(0x172)},'emptyPivot':{'filter':'篩選','row':'列','column':'欄','values':'值'},'dateGroup':{'second':'秒','year':'年','month':'月','day':'日','date':'日','hour':'小時','minute':'分鐘','hourMinute':_0x397f8b(0x189),'quarter':'季','monthDate':_0x397f8b(0x175),'yearQuarter':'年-季','yearMonth':_0x397f8b(0x17f),'yearMonthDate':_0x397f8b(0x181)},'numberGroupRange':_0x397f8b(0x185),'numberGroupClosedRange':_0x397f8b(0x183),'numberGroupBefore':_0x397f8b(0x173),'numberGroupAfter':_0x397f8b(0x176),'cellDateGroupDisplay':{'second':_0x397f8b(0x182),'before':'之前','after':'之後','dayRange':_0x397f8b(0x180),'minute':_0x397f8b(0x182),'hour':_0x397f8b(0x182),'hourMinute':_0x397f8b(0x17b),'date':_0x397f8b(0x182),'month':_0x397f8b(0x182),'monthDate':_0x397f8b(0x17c),'quarter':'Q{0}','year':_0x397f8b(0x182),'yearMonth':'{0}-{1}','yearMonthDate':_0x397f8b(0x187),'yearQuarter':_0x397f8b(0x186)}}};function _0x14ce(){const _0x46718b=['年-月','{0}\x20–\x20{1}','年-月-日','{0}','{0}\x20–\x20≤{1}','6882798qDmQvf','{0}\x20–\x20<{1}','{0}-Q{1}','{0}-{1}-{2}','2453598pygNQF','小時-分鐘','10420lPpwEa','3rKZufc','713798zgBUZq','37788JZnQOp','{0}{1}','欄標籤','25938mKIMCu','數值計數項:','1918368EfYSjF','母體標準差項:','{0}\x20{1}','<{0}','總和項:','月-日','>{0}','5255720IFwkXD','(空白)','計數項:','171AQtzio','{0}:{1}','{0}-{1}','母體變異數項:','最大值項:'];_0x14ce=function(){return _0x46718b;};return _0x14ce();}export{e as default};
|
package/lib/locale/zh-TW.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0x2e0ea1=_0xaa21;(function(_0x4f9d90,_0x33b24c){const _0x5b37e8=_0xaa21,_0x3192a4=_0x4f9d90();while(!![]){try{const _0x5e0482=-parseInt(_0x5b37e8(0x199))/0x1*(-parseInt(_0x5b37e8(0x181))/0x2)+-parseInt(_0x5b37e8(0x196))/0x3+parseInt(_0x5b37e8(0x193))/0x4*(parseInt(_0x5b37e8(0x188))/0x5)+-parseInt(_0x5b37e8(0x177))/0x6*(-parseInt(_0x5b37e8(0x186))/0x7)+parseInt(_0x5b37e8(0x18d))/0x8+parseInt(_0x5b37e8(0x197))/0x9*(-parseInt(_0x5b37e8(0x17e))/0xa)+parseInt(_0x5b37e8(0x180))/0xb*(parseInt(_0x5b37e8(0x194))/0xc);if(_0x5e0482===_0x33b24c)break;else _0x3192a4['push'](_0x3192a4['shift']());}catch(_0x2fe6b2){_0x3192a4['push'](_0x3192a4['shift']());}}}(_0x3d1e,0x417dc));const e={'sheets-pivot':{'sheet':_0x2e0ea1(0x183),'blankValue':_0x2e0ea1(0x182),'otherValue':_0x2e0ea1(0x19b),'columnName':'欄\x20','subTotalText':'小計','grandTotalText':'總計','valueText':'值','rowLabels':_0x2e0ea1(0x185),'columnLabels':_0x2e0ea1(0x178),'averageName':'平均值項:','countName':'計數項:','countNumsName':_0x2e0ea1(0x18c),'maxName':'最大值項:','minName':'最小值項:','productName':_0x2e0ea1(0x18b),'stdDevName':_0x2e0ea1(0x198),'stdDevpName':_0x2e0ea1(0x192),'sumName':_0x2e0ea1(0x190),'varName':_0x2e0ea1(0x17a),'varpName':'母體變異數項:','subTotal':'小計','grandTotal':'總計','value':'值','blank':'空白','other':'其他','renderText':{'valueField':'{0}{1}','subtotal':_0x2e0ea1(0x18e),'grandTotal':_0x2e0ea1(0x18e),'multipleGrandTotal':'{0}','subtotalWithValue':_0x2e0ea1(0x18e)},'emptyPivot':{'filter':'篩選','row':'列','column':'欄','values':'值'},'dateGroup':{'second':'秒','year':'年','month':'月','day':'日','date':'日','hour':'小時','minute':'分鐘','hourMinute':_0x2e0ea1(0x195),'quarter':'季','monthDate':_0x2e0ea1(0x17f),'yearQuarter':_0x2e0ea1(0x189),'yearMonth':_0x2e0ea1(0x18a),'yearMonthDate':_0x2e0ea1(0x179)},'numberGroupRange':_0x2e0ea1(0x187),'numberGroupClosedRange':_0x2e0ea1(0x17b),'numberGroupBefore':_0x2e0ea1(0x19a),'numberGroupAfter':_0x2e0ea1(0x17c),'cellDateGroupDisplay':{'second':'{0}','before':'之前','after':'之後','dayRange':_0x2e0ea1(0x184),'minute':'{0}','hour':_0x2e0ea1(0x176),'hourMinute':_0x2e0ea1(0x191),'date':'{0}','month':_0x2e0ea1(0x176),'monthDate':_0x2e0ea1(0x17d),'quarter':_0x2e0ea1(0x18f),'year':'{0}','yearMonth':_0x2e0ea1(0x17d),'yearMonthDate':'{0}-{1}-{2}','yearQuarter':'{0}-Q{1}'}}};function _0xaa21(_0x4d80a2,_0x273295){_0x4d80a2=_0x4d80a2-0x176;const _0x3d1e82=_0x3d1e();let _0xaa2126=_0x3d1e82[_0x4d80a2];return _0xaa2126;}function _0x3d1e(){const _0x275aa0=['{0}\x20{1}','Q{0}','總和項:','{0}:{1}','母體標準差項:','340ipqotX','108EaafDl','小時-分鐘','1102383rtPuNt','4692078godNtp','標準差項:','8725yjKDkN','<{0}','(其他)','{0}','6WNIOWW','欄標籤','年-月-日','變異數項:','{0}\x20–\x20≤{1}','>{0}','{0}-{1}','10uAIiDi','月-日','148126revKiF','82wVFfAw','(空白)','工作表','{0}\x20–\x20{1}','列標籤','536627CiQqTD','{0}\x20–\x20<{1}','28645QtQOrS','年-季','年-月','乘積項:','數值計數項:','916080LKFvYi'];_0x3d1e=function(){return _0x275aa0;};return _0x3d1e();}export{e as default};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IFieldsCollectionJSON } from '@univerjs-pro/engine-pivot';
|
|
2
|
+
import type { IAccessor } from '@univerjs/core';
|
|
3
|
+
import type { IPivotDisplayBaseInfo, IPivotTableConfig } from '../../const/type';
|
|
4
|
+
interface IGroupCommandContext {
|
|
5
|
+
unitId: string;
|
|
6
|
+
subUnitId: string;
|
|
7
|
+
pivotTableId: string;
|
|
8
|
+
currentConfig: IPivotTableConfig;
|
|
9
|
+
currentCollection: IFieldsCollectionJSON;
|
|
10
|
+
}
|
|
11
|
+
export declare function applyPivotGroupPreview(accessor: IAccessor, context: IGroupCommandContext, preview: IPivotDisplayBaseInfo): Promise<boolean>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IExcelDateGrouping } from '@univerjs-pro/engine-pivot';
|
|
2
|
+
import type { ICommand } from '@univerjs/core';
|
|
3
|
+
export interface ISetPivotExcelDateGroupCommandParams {
|
|
4
|
+
unitId: string;
|
|
5
|
+
subUnitId: string;
|
|
6
|
+
pivotTableId: string;
|
|
7
|
+
tableFieldId: string;
|
|
8
|
+
grouping: IExcelDateGrouping;
|
|
9
|
+
}
|
|
10
|
+
export declare const SetPivotExcelDateGroupCommand: ICommand<ISetPivotExcelDateGroupCommandParams>;
|
|
@@ -20,6 +20,8 @@ export interface ISetPivotFilterCommandParams {
|
|
|
20
20
|
* @property {string[]} items The items to set the filter. Those items will be checked in the pivot table.
|
|
21
21
|
*/
|
|
22
22
|
items: string[];
|
|
23
|
+
/** Aggregate Pivot items that contain both selected and unselected typed source values. */
|
|
24
|
+
partialItems?: string[];
|
|
23
25
|
/**
|
|
24
26
|
* @property {boolean} isAll The flag to set all items. True means all items, false means only the items in the items array.
|
|
25
27
|
*/
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IManualGroup } from '@univerjs-pro/engine-pivot';
|
|
2
|
+
import type { ICommand } from '@univerjs/core';
|
|
3
|
+
export interface ISetPivotManualGroupsCommandParams {
|
|
4
|
+
unitId: string;
|
|
5
|
+
subUnitId: string;
|
|
6
|
+
pivotTableId: string;
|
|
7
|
+
sourceFieldId: string;
|
|
8
|
+
groups: IManualGroup[];
|
|
9
|
+
}
|
|
10
|
+
export declare const SetPivotManualGroupsCommand: ICommand<ISetPivotManualGroupsCommandParams>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { INumberGrouping } from '@univerjs-pro/engine-pivot';
|
|
2
|
+
import type { ICommand } from '@univerjs/core';
|
|
3
|
+
export interface ISetPivotNumberGroupCommandParams {
|
|
4
|
+
unitId: string;
|
|
5
|
+
subUnitId: string;
|
|
6
|
+
pivotTableId: string;
|
|
7
|
+
tableFieldId: string;
|
|
8
|
+
grouping: INumberGrouping;
|
|
9
|
+
}
|
|
10
|
+
export declare const SetPivotNumberGroupCommand: ICommand<ISetPivotNumberGroupCommandParams>;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { IPivotTableChangeSet } from '@univerjs-pro/engine-pivot';
|
|
2
|
-
import type { IAccessor, ICommandService, IMutationInfo } from '@univerjs/core';
|
|
2
|
+
import type { IAccessor, ICommandInfo, ICommandService, IMutationInfo } from '@univerjs/core';
|
|
3
3
|
import type { IPivotPerformCheckParams } from '../../const/type';
|
|
4
|
+
export interface IMutationPairGroup {
|
|
5
|
+
redos: ICommandInfo[];
|
|
6
|
+
undos: ICommandInfo[];
|
|
7
|
+
reverse: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function executeWithRollback(groups: IMutationPairGroup[], commandService: ICommandService): boolean;
|
|
4
10
|
interface IPivotHostInfo {
|
|
5
11
|
pivotTableId: string;
|
|
6
12
|
unitId: string;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { IMutation } from '@univerjs/core';
|
|
2
|
-
import type { IGetPivotDataLocalMutationParams, ISendInitPivotTextLocalMutationParams, ISendPivotConfigLocalMutationParams, ISendPivotDataLocalMutationParams, ISendPivotViewLocalMutationParams } from '../../const/type';
|
|
2
|
+
import type { IGetPivotDataLocalMutationParams, IInitializePivotRuntimeParams, IPivotRuntimeInitializedParams, ISendInitPivotTextLocalMutationParams, ISendPivotConfigLocalMutationParams, ISendPivotDataLocalMutationParams, ISendPivotViewLocalMutationParams } from '../../const/type';
|
|
3
|
+
export declare const InitializePivotRuntimeLocalMutation: IMutation<IInitializePivotRuntimeParams>;
|
|
4
|
+
export declare const PivotRuntimeInitializedLocalMutation: IMutation<IPivotRuntimeInitializedParams>;
|
|
3
5
|
export declare const GetPivotDataLocalMutation: IMutation<IGetPivotDataLocalMutationParams>;
|
|
4
6
|
export declare const SendPivotDataLocalMutation: IMutation<ISendPivotDataLocalMutationParams>;
|
|
5
7
|
export declare const SendPivotViewLocalMutation: IMutation<ISendPivotViewLocalMutationParams>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DateSystem } from '@univerjs/core';
|
|
2
2
|
export declare const SHEETS_PIVOT_PLUGIN_CONFIG_KEY = "sheets-pivot.config";
|
|
3
3
|
export declare const configSymbol: unique symbol;
|
|
4
4
|
export interface IUniverSheetsPivotConfig {
|
|
@@ -16,6 +16,6 @@ export interface IUniverSheetsPivotConfig {
|
|
|
16
16
|
/**
|
|
17
17
|
* Define the date system used for pivot date grouping calculations. The default value is Date1900.
|
|
18
18
|
*/
|
|
19
|
-
dateSystem?:
|
|
19
|
+
dateSystem?: DateSystem;
|
|
20
20
|
}
|
|
21
21
|
export declare const defaultPluginConfig: IUniverSheetsPivotConfig;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IPivotViewCellData, IPivotViewValueType, PivotView, PivotViewItem } from '@univerjs-pro/engine-pivot';
|
|
1
|
+
import type { IPivotTableDateGroupInfo, IPivotTableNumberGroupInfo, IPivotViewCellData, IPivotViewValueType, PivotView, PivotViewItem } from '@univerjs-pro/engine-pivot';
|
|
2
2
|
import type { Injector, IRange } from '@univerjs/core';
|
|
3
3
|
import type enUS from '../locale/en-US';
|
|
4
4
|
import type { IAdjustPivotTableRes, IPivotTableConfig, IThemeStyle } from './type';
|
|
@@ -60,6 +60,8 @@ export declare const defaultEmptyPivotDataCellStyle: {
|
|
|
60
60
|
};
|
|
61
61
|
export declare const defaultThemeStyle: IThemeStyle;
|
|
62
62
|
export declare function getDateGroupDisplayArgs(dateType: PivotDateGroupFieldDateTypeEnum, dateStr: string): string[] | undefined;
|
|
63
|
+
export declare function getExcelDateGroupStr(injector: Injector, group: IPivotTableDateGroupInfo, key: number, dateSystem: DateSystem): string;
|
|
64
|
+
export declare function getNumberGroupStr(injector: Injector, group: IPivotTableNumberGroupInfo, key: number | string): string;
|
|
63
65
|
export declare const generatorAdjustPositionData: (injector: Injector, data: PivotView, pivotTableConfig: IPivotTableConfig, textInfo: Record<string, string>, direction?: "ltr" | "rtl", dateSystem?: DateSystem) => IAdjustPivotTableRes;
|
|
64
66
|
export declare function transFromCellValue(cellData: IPivotViewCellData, isValue: boolean, format: string | undefined, textInfo: Record<string, string>, multipleGrandTotalLabel?: string, subtotalLabel?: string, dateSystem?: DateSystem): IPivotViewValueType;
|
|
65
67
|
export declare function formatPivotRenderText(textInfo: Record<string, string>, templateKey: string, fallbackTemplate: string, ...args: unknown[]): string;
|
|
@@ -90,7 +92,12 @@ export declare enum PivotDisplayDataType {
|
|
|
90
92
|
ResetPivotTable = "resetPivotTable",
|
|
91
93
|
SetOption = "setOption",
|
|
92
94
|
SetPivotLayout = "setPivotLayout",
|
|
93
|
-
SetPivotDateGroup = "setPivotDateGroup"
|
|
95
|
+
SetPivotDateGroup = "setPivotDateGroup",
|
|
96
|
+
SetPivotExcelDateGroup = "setPivotExcelDateGroup",
|
|
97
|
+
SetPivotNumberGroup = "setPivotNumberGroup",
|
|
98
|
+
SetPivotManualGroups = "setPivotManualGroups",
|
|
99
|
+
ManualGroupMembers = "manualGroupMembers",
|
|
100
|
+
NumberGroupDefaults = "numberGroupDefaults"
|
|
94
101
|
}
|
|
95
102
|
export declare const defaultTextInfo: {
|
|
96
103
|
'sheets-pivot.blankValue': string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DataField, FieldsCollection, IBaseGroupFieldJSON, IDataFieldManagerBaseJSON, IFieldsCollectionJSON, ILabelViewHeaderMapItem, IPivotTableChangeSet, IPivotTableFilterInfo, IPivotTableLabelFieldJSON, IPivotTableOptions, IPivotTableShowDataAsInfo, IPivotTableSnapshot, IPivotTableSortInfo, IPivotTableValueFieldJSON, IPivotTableValueFilter, IPivotViewInfo, IPivotViewJSON, IPivotViewValueType, PivotCellStyleTypeEnum, PivotDataFieldDataTypeEnum, PivotDateGroupFieldDateTypeEnum, PivotLayoutTypeEnum, PivotSubtotalTypeEnum, PivotTableChangeTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum, PivotView } from '@univerjs-pro/engine-pivot';
|
|
1
|
+
import type { DataField, FieldsCollection, IBaseGroupFieldJSON, IDataFieldManagerBaseJSON, IExcelDateGrouping, IFieldsCollectionJSON, ILabelViewHeaderMapItem, IManualGroup, INumberGrouping, IPivotTableChangeSet, IPivotTableFilterInfo, IPivotTableLabelFieldJSON, IPivotTableOptions, IPivotTableShowDataAsInfo, IPivotTableSnapshot, IPivotTableSortInfo, IPivotTableValueFieldJSON, IPivotTableValueFilter, IPivotViewInfo, IPivotViewJSON, IPivotViewValueType, PivotCellStyleTypeEnum, PivotDataFieldDataTypeEnum, PivotDateGroupFieldDateTypeEnum, PivotLayoutTypeEnum, PivotSubtotalTypeEnum, PivotTableChangeTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum, PivotView } from '@univerjs-pro/engine-pivot';
|
|
2
2
|
import type { CellValueType, ICellData, IRange, IStyleData, IUndoRedoCommandInfosByInterceptor, IUnitRangeName, Nullable, ObjectMatrix } from '@univerjs/core';
|
|
3
3
|
import type { PivotDisplayDataType, PositionType } from './const';
|
|
4
4
|
export interface IPivotPerformCheckParams {
|
|
@@ -6,8 +6,28 @@ export interface IPivotPerformCheckParams {
|
|
|
6
6
|
view: PivotView;
|
|
7
7
|
isEmpty: boolean;
|
|
8
8
|
}
|
|
9
|
+
export interface IPivotManualFilterCoordinationParams {
|
|
10
|
+
unitId: string;
|
|
11
|
+
subUnitId: string;
|
|
12
|
+
pivotTableId: string;
|
|
13
|
+
tableFieldId: string;
|
|
14
|
+
items: string[];
|
|
15
|
+
partialItems?: string[];
|
|
16
|
+
isAll?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface IPivotManualFilterCoordinationResult {
|
|
19
|
+
handled: boolean;
|
|
20
|
+
result: boolean;
|
|
21
|
+
}
|
|
9
22
|
export declare const PIVOT_PERFORM_CHECK: import("@univerjs/core").IAsyncInterceptor<boolean, IPivotPerformCheckParams>;
|
|
23
|
+
export declare const PIVOT_MANUAL_FILTER_COORDINATION: import("@univerjs/core").IAsyncInterceptor<IPivotManualFilterCoordinationResult, IPivotManualFilterCoordinationParams>;
|
|
10
24
|
export declare const PIVOT_MUTATION_GENERATE: import("@univerjs/core").IInterceptor<IUndoRedoCommandInfosByInterceptor, IPivotPerformCheckParams>;
|
|
25
|
+
export declare const PIVOT_FIELD_REMOVE_COORDINATION: import("@univerjs/core").IInterceptor<string[], {
|
|
26
|
+
unitId: string;
|
|
27
|
+
subUnitId: string;
|
|
28
|
+
pivotTableId: string;
|
|
29
|
+
fieldIds: string[];
|
|
30
|
+
}>;
|
|
11
31
|
export interface IPivotTableConfigChangeInfo {
|
|
12
32
|
unitId: string;
|
|
13
33
|
subUnitId: string;
|
|
@@ -27,6 +47,11 @@ export interface IPivotReportScope {
|
|
|
27
47
|
unitId: string;
|
|
28
48
|
subUnitId: string;
|
|
29
49
|
}
|
|
50
|
+
export interface IPivotCollectionChange {
|
|
51
|
+
/** Workbook owning the source collections, which can differ from the report's target workbook. */
|
|
52
|
+
unitId: string;
|
|
53
|
+
pivotTableIds: readonly string[];
|
|
54
|
+
}
|
|
30
55
|
export interface ICollectionChangeInfo {
|
|
31
56
|
token: string;
|
|
32
57
|
type: CollectionChangeEnum;
|
|
@@ -42,6 +67,7 @@ export interface IAddPivotTableParams {
|
|
|
42
67
|
export interface IUpdatePivotTableSourceRangeMutationParams {
|
|
43
68
|
pivotTableId: string;
|
|
44
69
|
pivotCacheId?: string;
|
|
70
|
+
preserveCacheId?: boolean;
|
|
45
71
|
deleteIds: string[];
|
|
46
72
|
collectionJSON: IFieldsCollectionJSON;
|
|
47
73
|
dataRangeInfo: IUnitRangeNameWithSubUnitId;
|
|
@@ -109,6 +135,8 @@ export interface ISetPivotOptionMutationParams {
|
|
|
109
135
|
subUnitId: string;
|
|
110
136
|
pivotTableId: string;
|
|
111
137
|
options: IPivotTableOptions;
|
|
138
|
+
/** Changeset options are complete snapshots; direct mutation callers still apply patches. */
|
|
139
|
+
replace?: boolean;
|
|
112
140
|
}
|
|
113
141
|
export interface ISetPivotLayoutMutationParams {
|
|
114
142
|
unitId: string;
|
|
@@ -210,6 +238,8 @@ export interface IPivotCellPositionInfo {
|
|
|
210
238
|
sheetName?: string;
|
|
211
239
|
}
|
|
212
240
|
export interface IPivotTableConfig {
|
|
241
|
+
/** User-facing report name. Missing legacy values are normalized to an empty string. */
|
|
242
|
+
name?: string;
|
|
213
243
|
targetCellInfo: IPivotCellPositionInfo;
|
|
214
244
|
sourceRangeInfo: IUnitRangeNameWithSubUnitId;
|
|
215
245
|
pivotCacheId?: string;
|
|
@@ -269,6 +299,7 @@ export interface IDataFieldManagerJSON extends IDataFieldManagerBaseJSON {
|
|
|
269
299
|
export interface ISheetsPivotCacheSnapshot {
|
|
270
300
|
pivotCacheId: string;
|
|
271
301
|
sourceRangeInfo: IUnitRangeNameWithSubUnitId;
|
|
302
|
+
retainedSource?: boolean;
|
|
272
303
|
}
|
|
273
304
|
export interface IPivotTableJson {
|
|
274
305
|
dataFieldManagerConfig: Record<string, IDataFieldManagerJSON>;
|
|
@@ -359,6 +390,9 @@ export interface IPivotDisplayFilterInfo {
|
|
|
359
390
|
pivotTableId: string;
|
|
360
391
|
items: string[];
|
|
361
392
|
itemTypes: PivotDataFieldDataTypeEnum[];
|
|
393
|
+
itemLabels?: Record<string, string>;
|
|
394
|
+
checkedItems?: string[];
|
|
395
|
+
partialItems?: string[];
|
|
362
396
|
filterInfo: IPivotTableFilterInfo | undefined;
|
|
363
397
|
sortInfo: IPivotTableSortInfo | undefined;
|
|
364
398
|
format: string | undefined;
|
|
@@ -389,6 +423,7 @@ export interface IGetMovePivotFieldDataParams {
|
|
|
389
423
|
}
|
|
390
424
|
export interface IGetRemovePivotFieldDataParams {
|
|
391
425
|
fieldIds: string[];
|
|
426
|
+
retainFilterFieldIds?: string[];
|
|
392
427
|
}
|
|
393
428
|
export type IGetPivotCollapseDataParams = {
|
|
394
429
|
tableFieldId: string;
|
|
@@ -405,6 +440,7 @@ export type IGetPivotCollapseDataParams = {
|
|
|
405
440
|
export interface IGetPivotFilterDataParams {
|
|
406
441
|
tableFieldId: string;
|
|
407
442
|
items: string[];
|
|
443
|
+
partialItems?: string[];
|
|
408
444
|
isAll?: boolean;
|
|
409
445
|
}
|
|
410
446
|
export interface IGetPivotValueFilterDataParams {
|
|
@@ -435,6 +471,18 @@ export interface IGetPivotDateGroupParams {
|
|
|
435
471
|
tableFieldId: string;
|
|
436
472
|
dateType: PivotDateGroupFieldDateTypeEnum;
|
|
437
473
|
}
|
|
474
|
+
export interface IGetPivotExcelDateGroupParams {
|
|
475
|
+
tableFieldId: string;
|
|
476
|
+
grouping: IExcelDateGrouping;
|
|
477
|
+
}
|
|
478
|
+
export interface IGetPivotNumberGroupParams {
|
|
479
|
+
tableFieldId: string;
|
|
480
|
+
grouping: INumberGrouping;
|
|
481
|
+
}
|
|
482
|
+
export interface IGetPivotManualGroupsParams {
|
|
483
|
+
sourceFieldId: string;
|
|
484
|
+
groups: IManualGroup[];
|
|
485
|
+
}
|
|
438
486
|
export interface IGetPivotDrillDownDataParams {
|
|
439
487
|
tuple: string[][];
|
|
440
488
|
}
|
|
@@ -478,6 +526,20 @@ export interface IGetPivotDataLocalMutationParams extends IPivotLocalMutationBas
|
|
|
478
526
|
setOptions?: IGetPivotOptionParams;
|
|
479
527
|
setPivotLayout?: IGetPivotLayoutParams;
|
|
480
528
|
setPivotDateGroup?: IGetPivotDateGroupParams;
|
|
529
|
+
setPivotExcelDateGroup?: IGetPivotExcelDateGroupParams;
|
|
530
|
+
setPivotNumberGroup?: IGetPivotNumberGroupParams;
|
|
531
|
+
setPivotManualGroups?: IGetPivotManualGroupsParams;
|
|
532
|
+
manualGroupMembers?: {
|
|
533
|
+
sourceFieldId: string;
|
|
534
|
+
paths: Array<{
|
|
535
|
+
path: string;
|
|
536
|
+
memberKey?: string;
|
|
537
|
+
tupleKey?: string;
|
|
538
|
+
}>;
|
|
539
|
+
};
|
|
540
|
+
numberGroupDefaults?: {
|
|
541
|
+
tableFieldId: string;
|
|
542
|
+
};
|
|
481
543
|
};
|
|
482
544
|
}
|
|
483
545
|
export interface IPivotDisplayResult {
|
|
@@ -503,8 +565,17 @@ export interface IPivotDisplayResult {
|
|
|
503
565
|
setPivotOption?: IPivotDisplayBaseInfo;
|
|
504
566
|
setPivotLayout?: IPivotDisplayBaseInfo;
|
|
505
567
|
setPivotDateGroup?: IPivotDisplayBaseInfo;
|
|
568
|
+
setPivotExcelDateGroup?: IPivotDisplayBaseInfo;
|
|
569
|
+
setPivotNumberGroup?: IPivotDisplayBaseInfo;
|
|
570
|
+
setPivotManualGroups?: IPivotDisplayBaseInfo;
|
|
571
|
+
manualGroupMembers?: {
|
|
572
|
+
members: IManualGroup['members'];
|
|
573
|
+
error?: 'invalidSelection' | 'ambiguousMember';
|
|
574
|
+
};
|
|
575
|
+
numberGroupDefaults?: INumberGrouping;
|
|
506
576
|
}
|
|
507
577
|
export interface IPivotUpdatePivotSourceInfo {
|
|
578
|
+
pivotCacheId: string;
|
|
508
579
|
view: IPivotViewJSON;
|
|
509
580
|
changesets: IPivotTableChangeSet[];
|
|
510
581
|
isEmpty: boolean;
|
|
@@ -512,8 +583,10 @@ export interface IPivotUpdatePivotSourceInfo {
|
|
|
512
583
|
collectionConfig: IFieldsCollectionJSON;
|
|
513
584
|
oldCollectionConfig: IFieldsCollectionJSON;
|
|
514
585
|
deleteIds?: string[];
|
|
586
|
+
createdFieldIds: string[];
|
|
515
587
|
}
|
|
516
588
|
export interface IPivotAddPivotTableInfo {
|
|
589
|
+
pivotCacheId: string;
|
|
517
590
|
view: IPivotViewJSON;
|
|
518
591
|
isEmpty: boolean;
|
|
519
592
|
fieldsConfig: IPivotTableSnapshot;
|
|
@@ -532,29 +605,45 @@ export interface IPivotDisplayBaseInfo {
|
|
|
532
605
|
isEmpty: boolean;
|
|
533
606
|
pivotTableConfig: IPivotTableConfig;
|
|
534
607
|
shouldBeAddedGroupJSON?: IBaseGroupFieldJSON;
|
|
608
|
+
addedGroupJSON?: IBaseGroupFieldJSON[];
|
|
609
|
+
removedGroupJSON?: IBaseGroupFieldJSON[];
|
|
535
610
|
}
|
|
536
611
|
export interface ISendPivotViewItemLocalParams extends IPivotLocalMutationBaseParams {
|
|
612
|
+
runtimeId?: string;
|
|
537
613
|
view: IPivotViewJSON;
|
|
538
614
|
pivotConfig: IPivotTableConfig;
|
|
539
615
|
type: PivotTableOperationEnum;
|
|
540
616
|
}
|
|
541
617
|
export interface ISendPivotViewLocalMutationParams {
|
|
618
|
+
runtimeIds?: Record<string, string>;
|
|
542
619
|
single?: ISendPivotViewItemLocalParams;
|
|
543
620
|
batch?: ISendPivotViewItemLocalParams[];
|
|
544
621
|
collectionConfig?: Record<string, IDataFieldManagerJSON>;
|
|
622
|
+
pivotCacheConfigs?: IPivotTableJson['pivotCacheConfigs'];
|
|
545
623
|
}
|
|
546
624
|
export interface ISendPivotConfigLocalMutationParams {
|
|
625
|
+
runtimeId?: string;
|
|
626
|
+
runtimeIds?: Record<string, string>;
|
|
547
627
|
unitId: string;
|
|
548
628
|
subUnitId: string;
|
|
549
629
|
oldSubUnitId: string;
|
|
550
630
|
pivotTableId: string;
|
|
551
631
|
pivotTableConfig: IPivotTableConfig;
|
|
552
632
|
collectionConfig: IDataFieldManagerJSON;
|
|
633
|
+
pivotCacheConfigs?: IPivotTableJson['pivotCacheConfigs'];
|
|
553
634
|
}
|
|
554
635
|
export interface ISendInitPivotTextLocalMutationParams {
|
|
555
636
|
textInfo: Record<string, string>;
|
|
556
637
|
direction: 'ltr' | 'rtl';
|
|
557
638
|
}
|
|
639
|
+
export interface IInitializePivotRuntimeParams {
|
|
640
|
+
unitId: string;
|
|
641
|
+
runtimeId: string;
|
|
642
|
+
sequence: number;
|
|
643
|
+
}
|
|
644
|
+
export interface IPivotRuntimeInitializedParams extends IInitializePivotRuntimeParams {
|
|
645
|
+
error?: 'calculation-failed';
|
|
646
|
+
}
|
|
558
647
|
export interface ISendPivotDataLocalMutationParams extends IPivotLocalMutationBaseParams {
|
|
559
648
|
version: string;
|
|
560
649
|
result: IPivotDisplayResult;
|
|
@@ -585,6 +674,7 @@ export interface IPivotPanelTableListItemBase {
|
|
|
585
674
|
format?: string;
|
|
586
675
|
subTotalType?: PivotSubtotalTypeEnum;
|
|
587
676
|
showDataAs?: IPivotTableShowDataAsInfo;
|
|
677
|
+
filterInfo?: IPivotTableFilterInfo;
|
|
588
678
|
}
|
|
589
679
|
export interface IPivotPanelSourceList {
|
|
590
680
|
id: string;
|
|
@@ -601,6 +691,7 @@ export interface IPivotPanelDataInfo {
|
|
|
601
691
|
columnFields: IPivotPanelTableListItemBase[];
|
|
602
692
|
valueFields: IPivotPanelTableListItemBase[];
|
|
603
693
|
filterFields: IPivotPanelTableListItemBase[];
|
|
694
|
+
hiddenFields?: IPivotPanelTableListItemBase[];
|
|
604
695
|
positionInfo: IPivotTableConfig['targetCellInfo'];
|
|
605
696
|
}
|
|
606
697
|
export interface ICurrentDataMatrix {
|
|
@@ -14,6 +14,8 @@ export declare class SheetsPivotRefRangeController extends Disposable {
|
|
|
14
14
|
private readonly _sheetInterceptorService;
|
|
15
15
|
disposableCollection: DisposableCollection;
|
|
16
16
|
constructor(_injector: Injector, _refRangeService: RefRangeService, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _sheetsPivotTableAdaptorModel: SheetsPivotTableAdaptorModel, _sheetInterceptorService: SheetInterceptorService);
|
|
17
|
+
private _getStructureMutations;
|
|
18
|
+
private _getRemovedFieldMutations;
|
|
17
19
|
private _onRefRangeChange;
|
|
18
20
|
private _refRangeHandle;
|
|
19
21
|
getRefRangeMutationsByMoveRange(params: IMoveRangeCommandParams, unitId: string, subUnitId: string): {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Disposable, ICommandService } from '@univerjs/core';
|
|
1
|
+
import { Disposable, ICommandService, IConfigService, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { IActiveDirtyManagerService } from '@univerjs/engine-formula';
|
|
3
3
|
import { SheetsPivotTableConfigModel } from '../models/sheets-pivot-config-model';
|
|
4
4
|
import { SheetsPivotTableAdaptorModel } from '../models/sheets-pivot-table-adaptor-model';
|
|
@@ -9,7 +9,14 @@ export declare class SheetsPivotRPCController extends Disposable {
|
|
|
9
9
|
private readonly _sheetsPivotTableAdaptorModel;
|
|
10
10
|
private readonly _sheetsPivotTableConfigModel;
|
|
11
11
|
readonly _activeDirtyManagerService: IActiveDirtyManagerService;
|
|
12
|
-
|
|
12
|
+
private readonly _configService;
|
|
13
|
+
private readonly _univerInstanceService;
|
|
14
|
+
private readonly _initializations;
|
|
15
|
+
private _runtimeSequence;
|
|
16
|
+
constructor(_commandService: ICommandService, _sheetsPivotRpcService: SheetsPivotRPCService, _sheetsPivotTableAdaptorModel: SheetsPivotTableAdaptorModel, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _activeDirtyManagerService: IActiveDirtyManagerService, _configService: IConfigService, _univerInstanceService: IUniverInstanceService);
|
|
17
|
+
private _initRuntimeLifecycle;
|
|
18
|
+
private _initializeRuntime;
|
|
19
|
+
dispose(): void;
|
|
13
20
|
private _initDataSendListener;
|
|
14
21
|
/**
|
|
15
22
|
* - register dirty service, used to mark the pivot table view dirty
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { PivotCallbackEnum, PivotCellStyleTypeEnum, PivotDataFieldDataTypeEnum, PivotDataFieldSortOperatorEnum, PivotDataFieldSortTypeEnum, PivotDataFieldTypeEnum,
|
|
1
|
+
import { PivotCallbackEnum, PivotCellStyleTypeEnum, PivotDataFieldDataTypeEnum, PivotDataFieldSortOperatorEnum, PivotDataFieldSortTypeEnum, PivotDataFieldTypeEnum, PivotDateGroupFieldDateTypeEnum, PivotDateGroupingMode, PivotExcelDateGroupUnit, PivotFilterTypeEnum, PivotLayoutTypeEnum, PivotShowAsBaseItemTypeEnum, PivotShowAsTypeEnum, PivotSubtotalPositionEnum, PivotSubtotalTypeEnum, PivotTableChangeTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum, PivotViewCellValueTypeEnum, ST_PivotFilterOperatorEnum } from '@univerjs-pro/engine-pivot';
|
|
2
2
|
import { PositionType } from '@univerjs-pro/sheets-pivot';
|
|
3
|
+
import { DateSystem } from '@univerjs/core';
|
|
3
4
|
/**
|
|
4
5
|
* @ignore
|
|
5
6
|
*/
|
|
@@ -50,6 +51,14 @@ export interface IFSheetsPivotEnumMixin {
|
|
|
50
51
|
* Represents the date type of the pivot date group field. {@link PivotDateGroupFieldDateTypeEnum}
|
|
51
52
|
*/
|
|
52
53
|
PivotDateGroupFieldDateTypeEnum: typeof PivotDateGroupFieldDateTypeEnum;
|
|
54
|
+
/**
|
|
55
|
+
* Represents the pivot table date grouping mode. {@link PivotDateGroupingMode}
|
|
56
|
+
*/
|
|
57
|
+
PivotDateGroupingMode: typeof PivotDateGroupingMode;
|
|
58
|
+
/**
|
|
59
|
+
* Represents a calendar unit for Excel-style date grouping. {@link PivotExcelDateGroupUnit}
|
|
60
|
+
*/
|
|
61
|
+
PivotExcelDateGroupUnit: typeof PivotExcelDateGroupUnit;
|
|
53
62
|
/**
|
|
54
63
|
* Represents the show-as calculation type of a pivot value field. {@link PivotShowAsTypeEnum}
|
|
55
64
|
*/
|
|
@@ -75,9 +84,9 @@ export interface IFSheetsPivotEnumMixin {
|
|
|
75
84
|
*/
|
|
76
85
|
PivotDataFieldTypeEnum: typeof PivotDataFieldTypeEnum;
|
|
77
86
|
/**
|
|
78
|
-
* Represents the date system used by pivot date group fields. {@link
|
|
87
|
+
* Represents the date system used by pivot date group fields. {@link DateSystem}
|
|
79
88
|
*/
|
|
80
|
-
|
|
89
|
+
DateSystem: typeof DateSystem;
|
|
81
90
|
/**
|
|
82
91
|
* Represents the pivot cell style type generated by the pivot view. {@link PivotCellStyleTypeEnum}
|
|
83
92
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IDataFieldValue, IPivotTableOptions, IPivotViewValueType, PivotLayoutTypeEnum, PivotTable, PivotTableLabelField, PivotTableValueField } from '@univerjs-pro/engine-pivot';
|
|
1
|
+
import type { IDataFieldValue, IPivotTableOptions, IPivotTableRecordFilter, IPivotViewValueType, PivotLayoutTypeEnum, PivotTable, PivotTableLabelField, PivotTableValueField } from '@univerjs-pro/engine-pivot';
|
|
2
2
|
import type { Injector } from '@univerjs/core';
|
|
3
3
|
import type { IDataFieldDataArray, IDimensionInfo, IFGenericPivotFilterOptions, IPivotTableCubeConfig, IPivotTableValueOptions } from './type';
|
|
4
4
|
import { DataFieldManager, PivotDataFieldDataTypeEnum, PivotTableFiledAreaEnum } from '@univerjs-pro/engine-pivot';
|
|
@@ -286,6 +286,7 @@ export declare class FGenericPivotTable {
|
|
|
286
286
|
remove(): void;
|
|
287
287
|
}
|
|
288
288
|
export declare class DefaultDataFieldManager extends DataFieldManager {
|
|
289
|
+
compileRecordFilter(filter: IPivotTableRecordFilter): (value: IDataFieldValue) => boolean;
|
|
289
290
|
getRangeData(data: IDataFieldDataArray): {
|
|
290
291
|
header: string[];
|
|
291
292
|
data: IDataFieldValue[][];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IPivotTableLabelFieldJSON, IPivotTableOptions, IPivotTableShowDataAsInfo, IPivotTableSortInfo, IPivotTableValueFieldJSON, IPivotTableValueFilter, IValueFilterInfoItem, PivotDataFieldDataTypeEnum, PivotDateGroupFieldDateTypeEnum, PivotSubtotalTypeEnum, PivotTableValuePositionEnum } from '@univerjs-pro/engine-pivot';
|
|
1
|
+
import type { IExcelDateGrouping, IManualGroup, INumberGrouping, IPivotTableLabelFieldJSON, IPivotTableOptions, IPivotTableShowDataAsInfo, IPivotTableSortInfo, IPivotTableValueFieldJSON, IPivotTableValueFilter, IValueFilterInfoItem, PivotDataFieldDataTypeEnum, PivotDateGroupFieldDateTypeEnum, PivotDateGroupingMode, PivotSubtotalTypeEnum, PivotTableValuePositionEnum } from '@univerjs-pro/engine-pivot';
|
|
2
2
|
import type { IPivotTableConfig, IPivotTableMatrixInfo, IUnitRangeNameWithSubUnitId } from '@univerjs-pro/sheets-pivot';
|
|
3
3
|
import type { Injector, IRange, Nullable } from '@univerjs/core';
|
|
4
4
|
import { PivotLayoutTypeEnum, PivotTableFiledAreaEnum } from '@univerjs-pro/engine-pivot';
|
|
@@ -162,6 +162,21 @@ export declare class FPivotTable extends FBase {
|
|
|
162
162
|
* ```
|
|
163
163
|
*/
|
|
164
164
|
getOptions(): IPivotTableOptions | undefined;
|
|
165
|
+
/**
|
|
166
|
+
* @description Get the effective date grouping mode of the pivot table. The mode defaults to legacy when not configured.
|
|
167
|
+
* @returns {PivotDateGroupingMode|undefined} The date grouping mode, or undefined if the pivot table no longer exists.
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```ts
|
|
171
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
172
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
173
|
+
* if (!fWorksheet) return;
|
|
174
|
+
* const fPivotTable = fWorkbook.getPivotTableByCell(fWorkbook.getId(), fWorksheet.getSheetId(), 0, 8);
|
|
175
|
+
* const mode = fPivotTable?.getDateGroupingMode();
|
|
176
|
+
* console.log(mode === univerAPI.Enum.PivotDateGroupingMode.ExcelLike);
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
getDateGroupingMode(): PivotDateGroupingMode | undefined;
|
|
165
180
|
/**
|
|
166
181
|
* @description Get the pivot table layout type.
|
|
167
182
|
* @returns {PivotLayoutTypeEnum|undefined} The layout type, or undefined if the pivot table no longer exists.
|
|
@@ -236,6 +251,21 @@ export declare class FPivotTable extends FBase {
|
|
|
236
251
|
* ```
|
|
237
252
|
*/
|
|
238
253
|
setOptions(options: IPivotTableOptions): Promise<boolean>;
|
|
254
|
+
/**
|
|
255
|
+
* @description Set the pivot table date grouping mode through the option command. Switching modes clears existing date groups.
|
|
256
|
+
* @param {PivotDateGroupingMode} mode The date grouping mode to set.
|
|
257
|
+
* @returns {Promise<boolean>} Whether the date grouping mode was set successfully.
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```ts
|
|
261
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
262
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
263
|
+
* if (!fWorksheet) return;
|
|
264
|
+
* const fPivotTable = fWorkbook.getPivotTableByCell(fWorkbook.getId(), fWorksheet.getSheetId(), 0, 8);
|
|
265
|
+
* await fPivotTable?.setDateGroupingMode(univerAPI.Enum.PivotDateGroupingMode.ExcelLike);
|
|
266
|
+
* ```
|
|
267
|
+
*/
|
|
268
|
+
setDateGroupingMode(mode: PivotDateGroupingMode): Promise<boolean>;
|
|
239
269
|
/**
|
|
240
270
|
* @description Set the pivot table layout type through command. It keeps undo/redo, collaboration and render update paths consistent with panel operations.
|
|
241
271
|
* @param {PivotLayoutTypeEnum} layout The layout type to set.
|
|
@@ -904,6 +934,76 @@ export declare class FPivotTable extends FBase {
|
|
|
904
934
|
* ```
|
|
905
935
|
*/
|
|
906
936
|
setDateGroupType(tableFieldId: string, dateType: PivotDateGroupFieldDateTypeEnum): Promise<boolean>;
|
|
937
|
+
/**
|
|
938
|
+
* @description Group a date label field by Excel-style calendar units. The pivot table must use Excel-like date grouping mode.
|
|
939
|
+
* @param {string} tableFieldId The source label field id.
|
|
940
|
+
* @param {IExcelDateGrouping} grouping The date units and range settings.
|
|
941
|
+
* @returns {Promise<boolean>} Whether the date group was set successfully.
|
|
942
|
+
*
|
|
943
|
+
* @example
|
|
944
|
+
* ```ts
|
|
945
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
946
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
947
|
+
* if (!fWorksheet) return;
|
|
948
|
+
* const fPivotTable = fWorkbook.getPivotTableByCell(fWorkbook.getId(), fWorksheet.getSheetId(), 0, 8);
|
|
949
|
+
* const rowIds = fPivotTable?.getFieldIdsByArea(univerAPI.Enum.PivotTableFiledAreaEnum.Row);
|
|
950
|
+
* if (rowIds?.length) {
|
|
951
|
+
* await fPivotTable?.setExcelDateGroup(rowIds[0], {
|
|
952
|
+
* units: [univerAPI.Enum.PivotExcelDateGroupUnit.Year, univerAPI.Enum.PivotExcelDateGroupUnit.Month],
|
|
953
|
+
* autoStart: true,
|
|
954
|
+
* autoEnd: true,
|
|
955
|
+
* });
|
|
956
|
+
* }
|
|
957
|
+
* ```
|
|
958
|
+
*/
|
|
959
|
+
setExcelDateGroup(tableFieldId: string, grouping: IExcelDateGrouping): Promise<boolean>;
|
|
960
|
+
/**
|
|
961
|
+
* @description Group a numeric label field into intervals.
|
|
962
|
+
* @param {string} tableFieldId The source label field id.
|
|
963
|
+
* @param {INumberGrouping} grouping The numeric range and interval settings.
|
|
964
|
+
* @returns {Promise<boolean>} Whether the number group was set successfully.
|
|
965
|
+
*
|
|
966
|
+
* @example
|
|
967
|
+
* ```ts
|
|
968
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
969
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
970
|
+
* if (!fWorksheet) return;
|
|
971
|
+
* const fPivotTable = fWorkbook.getPivotTableByCell(fWorkbook.getId(), fWorksheet.getSheetId(), 0, 8);
|
|
972
|
+
* const rowIds = fPivotTable?.getFieldIdsByArea(univerAPI.Enum.PivotTableFiledAreaEnum.Row);
|
|
973
|
+
* if (rowIds?.length) {
|
|
974
|
+
* await fPivotTable?.setNumberGroup(rowIds[0], { autoStart: true, autoEnd: true, interval: 10 });
|
|
975
|
+
* }
|
|
976
|
+
* ```
|
|
977
|
+
*/
|
|
978
|
+
setNumberGroup(tableFieldId: string, grouping: INumberGrouping): Promise<boolean>;
|
|
979
|
+
/**
|
|
980
|
+
* @description Replace the manual member groups of one source field. Pass an empty array to remove all manual groups.
|
|
981
|
+
* Each group keeps its stable `id` when renamed; members retain their value types even when displayed labels match.
|
|
982
|
+
* @param {string} sourceFieldId The original source field id, not the derived group or table field id.
|
|
983
|
+
* @param {IManualGroup[]} groups The complete next set of groups, each with an id, name, and at least two source members.
|
|
984
|
+
* @returns {Promise<boolean>} Whether the manual groups were updated successfully.
|
|
985
|
+
*
|
|
986
|
+
* @example
|
|
987
|
+
* ```ts
|
|
988
|
+
* import { RecordValueType } from '@univerjs/core';
|
|
989
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
990
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
991
|
+
* if (!fWorksheet) return;
|
|
992
|
+
* const fPivotTable = fWorkbook.getPivotTableByCell(fWorkbook.getId(), fWorksheet.getSheetId(), 0, 8);
|
|
993
|
+
* const sourceFieldId = fPivotTable?.getSourceFieldsInfo().find((field) => field.name === 'Region')?.id;
|
|
994
|
+
* if (sourceFieldId) {
|
|
995
|
+
* await fPivotTable?.setManualGroups(sourceFieldId, [{
|
|
996
|
+
* id: 'north',
|
|
997
|
+
* name: 'North',
|
|
998
|
+
* members: [
|
|
999
|
+
* { type: RecordValueType.String, value: 'East' },
|
|
1000
|
+
* { type: RecordValueType.String, value: 'West' },
|
|
1001
|
+
* ],
|
|
1002
|
+
* }]);
|
|
1003
|
+
* }
|
|
1004
|
+
* ```
|
|
1005
|
+
*/
|
|
1006
|
+
setManualGroups(sourceFieldId: string, groups: IManualGroup[]): Promise<boolean>;
|
|
907
1007
|
/**
|
|
908
1008
|
* @description Collapse or expand a pivot table item by the cell position through command.
|
|
909
1009
|
* @param {number} row - The row index of the pivot item cell.
|