@univerjs-pro/sheets-pivot 0.2.11 → 0.2.13
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/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/types/const/const.d.ts +3 -1
- package/lib/types/const/type.d.ts +12 -0
- package/lib/types/controllers/config.schema.d.ts +6 -0
- package/lib/types/controllers/sheets-pivot-caculate.controller.d.ts +3 -2
- package/lib/types/index.d.ts +1 -1
- package/lib/types/models/sheets-pivot-table-adaptor-model.d.ts +5 -1
- package/lib/types/plugin.d.ts +3 -6
- package/lib/types/util.d.ts +10 -2
- package/lib/umd/index.js +1 -1
- package/package.json +15 -15
|
@@ -52,6 +52,7 @@ export declare function getAdjustRangesPosition(startCell: {
|
|
|
52
52
|
col: number;
|
|
53
53
|
}, view: PivotViewItem, singleCellIsRange?: boolean, useLastRowOrCol?: boolean): IRange[];
|
|
54
54
|
export declare const SHEET_PIVOT_IN_MAIN_THREAD = "SHEET_PIVOT_IN_MAIN_THREAD";
|
|
55
|
+
export declare const SHEET_PIVOT_EXCLUSIVE_ID = "SHEET_PIVOT_EXCLUSIVE_ID";
|
|
55
56
|
export declare enum PivotDisplayDataType {
|
|
56
57
|
Filter = "filter",
|
|
57
58
|
Panel = "panel",
|
|
@@ -65,7 +66,8 @@ export declare enum PivotDisplayDataType {
|
|
|
65
66
|
SetPivotSort = "setPivotSort",
|
|
66
67
|
SetPivotSetting = "setPivotSetting",
|
|
67
68
|
UpdatePivotSource = "updatePivotSource",
|
|
68
|
-
UpdateValuePosition = "updateValuePosition"
|
|
69
|
+
UpdateValuePosition = "updateValuePosition",
|
|
70
|
+
DrillDown = "drillDown"
|
|
69
71
|
}
|
|
70
72
|
export declare const defaultTextInfo: {
|
|
71
73
|
'sheets-pivot.blankValue': string;
|
|
@@ -337,6 +337,9 @@ export interface IGetPivotSortDataParams {
|
|
|
337
337
|
tableFieldId: string;
|
|
338
338
|
info: IPivotTableSortInfo;
|
|
339
339
|
}
|
|
340
|
+
export interface IGetPivotDrillDownDataParams {
|
|
341
|
+
tuple: string[][];
|
|
342
|
+
}
|
|
340
343
|
export interface IGetPivotSettingDataParams {
|
|
341
344
|
tableFieldId: string;
|
|
342
345
|
displayName?: string;
|
|
@@ -369,6 +372,7 @@ export interface IGetPivotDataLocalMutationParams extends IPivotLocalMutationBas
|
|
|
369
372
|
updatePivotSource?: IGetUpdatePivotSourceDataParams;
|
|
370
373
|
updateValuePosition?: IGetUpdateValuePositionDataParams;
|
|
371
374
|
addPivotTableWithConfig?: IGetAddPivotTableWithConfigDataParams;
|
|
375
|
+
drillDown?: IGetPivotDrillDownDataParams;
|
|
372
376
|
};
|
|
373
377
|
}
|
|
374
378
|
export interface IPivotDisplayResult {
|
|
@@ -387,6 +391,7 @@ export interface IPivotDisplayResult {
|
|
|
387
391
|
addPivotTableWithConfig?: IPivotAddPivotTableInfo & {
|
|
388
392
|
changesets: IPivotTableChangeSet[];
|
|
389
393
|
};
|
|
394
|
+
drillDown?: IPivotDrillDownInfo;
|
|
390
395
|
}
|
|
391
396
|
export interface IPivotUpdatePivotSourceInfo {
|
|
392
397
|
view: IPivotViewJSON;
|
|
@@ -403,6 +408,13 @@ export interface IPivotAddPivotTableInfo {
|
|
|
403
408
|
fieldsConfig: IPivotTableSnapshot;
|
|
404
409
|
collectionConfig: IFieldsCollectionJSON;
|
|
405
410
|
}
|
|
411
|
+
export interface IPivotDrillDownInfo {
|
|
412
|
+
indexes: number[];
|
|
413
|
+
range: IRange;
|
|
414
|
+
sourceUnitId: string;
|
|
415
|
+
sourceSubUnitId: string;
|
|
416
|
+
formatMap: Record<string, string>;
|
|
417
|
+
}
|
|
406
418
|
export interface IPivotDisplayBaseInfo {
|
|
407
419
|
view: IPivotViewJSON;
|
|
408
420
|
changesets: IPivotTableChangeSet[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Disposable, ICommandService, IConfigService } from '@univerjs/core';
|
|
1
|
+
import { Disposable, ICommandService, IConfigService, Injector } from '@univerjs/core';
|
|
2
2
|
import { IAllRuntimeData, IFeatureDirtyRangeType, IRuntimeUnitDataType, IFeatureCalculationManagerService } from '@univerjs/engine-formula';
|
|
3
3
|
import { SheetsPivotDataSourceModel } from '../models/sheets-pivot-data-source-model';
|
|
4
4
|
import { ICurrentDataMatrix, IPivotCellPositionInfo, IUnitRangeNameWithSubUnitId } from '../const/type';
|
|
@@ -12,7 +12,8 @@ export declare class PivotCalculatorController extends Disposable {
|
|
|
12
12
|
private readonly _configService;
|
|
13
13
|
readonly _featureCalculationManagerService: IFeatureCalculationManagerService;
|
|
14
14
|
private readonly _commandService;
|
|
15
|
-
|
|
15
|
+
private readonly _injector;
|
|
16
|
+
constructor(_sheetsPivotDataSourceModel: SheetsPivotDataSourceModel, _configService: IConfigService, _featureCalculationManagerService: IFeatureCalculationManagerService, _commandService: ICommandService, _injector: Injector);
|
|
16
17
|
_init(): void;
|
|
17
18
|
private _initPivotDataGetListener;
|
|
18
19
|
private _initPivotTextInfo;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export { SheetsPivotTableConfigModel } from './models/sheets-pivot-config-model'
|
|
|
23
23
|
export type { IAddPivotTableCommandParams, IPivotTableConfig, ISetPivotSortMutationParams, ISetPivotOptionMutationParams, ISetPivotSubtotalTypeMutationParams, IUpdateFieldPositionMutationParams, IUpdateValuePositionMutationParams, IRenamePivotFieldMutationParams, IRemovePivotFieldMutationParams, IRangePosition, ISetPivotFilterMutationParams, IPivotRangesInfo, IPivotRenderCache, IPivotTableCellData, ISetPivotPositionMutationParams, IPivotCellPositionInfo, IAddPivotFieldMutationParams, ISetPivotCollapseMutation, ISetPivotFieldFormatMutationParams, IPivotPanelTableListItemBase, IPivotPanelSourceList, IPivotPanelDataInfo, IUpdatePivotFieldSourceInfoMutationParams, IUnitRangeNameWithSubUnitId, IRemovePivotTableMutationParams, } from './const/type';
|
|
24
24
|
export { PivotTableOperationEnum } from './const/type';
|
|
25
25
|
export { SheetsPivotTableAdaptorModel } from './models/sheets-pivot-table-adaptor-model';
|
|
26
|
-
export { getPivotCellInfo, getPivotTableInfo } from './util';
|
|
26
|
+
export { getPivotCellInfo, getPivotTableInfo, unionPivotViewRange } from './util';
|
|
27
27
|
export { defaultThemeStyle, transFromCellValue } from './const/const';
|
|
28
28
|
export { applyChangeSet } from './commands/command/util';
|
|
29
29
|
export { getFieldListByArea } from './commands/mutations/change-apply-util';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IRange, Nullable, Disposable, Injector, IUniverInstanceService, LocaleService, ObjectMatrix } from '@univerjs/core';
|
|
2
|
+
import { IExclusiveRangeService } from '@univerjs/sheets';
|
|
2
3
|
import { IPivotRangesInfo, IPivotRenderCache, IPivotTableCellData, IPivotTableConfigChangeInfo, PivotTableOperationEnum } from '../const/type';
|
|
3
4
|
import { SheetsPivotTableConfigModel } from './sheets-pivot-config-model';
|
|
4
5
|
export declare class SheetsPivotTableAdaptorModel extends Disposable {
|
|
@@ -6,6 +7,7 @@ export declare class SheetsPivotTableAdaptorModel extends Disposable {
|
|
|
6
7
|
private _injector;
|
|
7
8
|
private _sheetsPivotTableConfigModel;
|
|
8
9
|
private _univerInstanceService;
|
|
10
|
+
private readonly _exclusiveRangeService;
|
|
9
11
|
private _pivotRenderInfoCache;
|
|
10
12
|
private _pivotRenderValueMatrixCache;
|
|
11
13
|
private _markDirty$;
|
|
@@ -23,13 +25,15 @@ export declare class SheetsPivotTableAdaptorModel extends Disposable {
|
|
|
23
25
|
type: PivotTableOperationEnum;
|
|
24
26
|
}>;
|
|
25
27
|
private _textInfo;
|
|
26
|
-
constructor(_localeService: LocaleService, _injector: Injector, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _univerInstanceService: IUniverInstanceService);
|
|
28
|
+
constructor(_localeService: LocaleService, _injector: Injector, _sheetsPivotTableConfigModel: SheetsPivotTableConfigModel, _univerInstanceService: IUniverInstanceService, _exclusiveRangeService: IExclusiveRangeService);
|
|
27
29
|
private _initUnitDisposed;
|
|
28
30
|
private _initLocale;
|
|
29
31
|
updateRenderCache(config: IPivotTableConfigChangeInfo): {
|
|
30
32
|
rangeCache: IPivotRangesInfo | undefined;
|
|
31
33
|
matrix: ObjectMatrix<Nullable<IPivotTableCellData>>;
|
|
32
34
|
} | undefined;
|
|
35
|
+
private _updateRenderEmptyCache;
|
|
36
|
+
private _createExclusiveRange;
|
|
33
37
|
clearRenderCache(config: IPivotTableConfigChangeInfo): void;
|
|
34
38
|
private _ensurePivotItemRenderInfoCache;
|
|
35
39
|
private _ensurePivotItemRenderValueMatrixCache;
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
import { ICommandService, IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
2
2
|
import { DataSyncPrimaryController } from '@univerjs/rpc';
|
|
3
|
-
import {
|
|
4
|
-
interface IUniverSheetsPivotConfig extends IUniverSheetsConfig {
|
|
5
|
-
}
|
|
3
|
+
import { IUniverSheetsPivotConfig } from './controllers/config.schema';
|
|
6
4
|
export declare class UniverSheetsPivotTablePlugin extends Plugin {
|
|
7
|
-
private _config;
|
|
5
|
+
private readonly _config;
|
|
8
6
|
readonly _injector: Injector;
|
|
9
7
|
private readonly _commandService;
|
|
10
8
|
private readonly _configService;
|
|
11
9
|
private readonly _dataSyncPrimaryController?;
|
|
12
10
|
static pluginName: string;
|
|
13
11
|
static type: UniverInstanceType;
|
|
14
|
-
constructor(_config: IUniverSheetsPivotConfig, _injector: Injector, _commandService: ICommandService, _configService: IConfigService, _dataSyncPrimaryController?: DataSyncPrimaryController | undefined);
|
|
12
|
+
constructor(_config: IUniverSheetsPivotConfig | undefined, _injector: Injector, _commandService: ICommandService, _configService: IConfigService, _dataSyncPrimaryController?: DataSyncPrimaryController | undefined);
|
|
15
13
|
_initConfig(): void;
|
|
16
14
|
onStarting(): void;
|
|
17
15
|
private _initRegisterCommand;
|
|
18
16
|
}
|
|
19
|
-
export {};
|
package/lib/types/util.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Injector, Nullable, ObjectMatrix } from '@univerjs/core';
|
|
1
|
+
import { Injector, IRange, Nullable, ObjectMatrix } from '@univerjs/core';
|
|
2
2
|
import { ILabelViewHeaderMapItem, IPivotViewInfo, PivotTable, PivotSubtotalTypeEnum } from '@univerjs-pro/engine-pivot';
|
|
3
|
-
import { IPivotPanelDataInfo, IPivotRangesInfo, IPivotRenderCache, IPivotTableCellData, IPivotTableConfig } from './const/type';
|
|
3
|
+
import { IGetPivotDataLocalMutationParams, IPivotPanelDataInfo, IPivotRangesInfo, IPivotRenderCache, IPivotTableCellData, IPivotTableConfig } from './const/type';
|
|
4
4
|
import { SheetsPivotDataSourceModel } from './models/sheets-pivot-data-source-model';
|
|
5
5
|
export declare const generateDefaultEmptyCache: (textOptions: {
|
|
6
6
|
filter: string;
|
|
@@ -37,3 +37,11 @@ export declare function flattenObject(inject: Injector, obj: {
|
|
|
37
37
|
}): {
|
|
38
38
|
[key: string]: any;
|
|
39
39
|
};
|
|
40
|
+
export declare const unionPivotViewRange: (rangeInfo: IPivotRangesInfo | undefined) => IRange[];
|
|
41
|
+
export declare function getPivotDrillDownData(injector: Injector, params: IGetPivotDataLocalMutationParams): {
|
|
42
|
+
indexes: number[];
|
|
43
|
+
range: IRange;
|
|
44
|
+
sourceUnitId: string;
|
|
45
|
+
sourceSubUnitId: string;
|
|
46
|
+
formatMap: Record<string, string>;
|
|
47
|
+
} | undefined;
|