@univerjs-pro/sheets-pivot 0.2.10 → 0.2.12

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.
@@ -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[];
@@ -0,0 +1,6 @@
1
+ export declare const PLUGIN_CONFIG_KEY = "sheets-pivot.config";
2
+ export declare const configSymbol: unique symbol;
3
+ export interface IUniverSheetsPivotConfig {
4
+ notExecuteFormula?: boolean;
5
+ }
6
+ export declare const defaultPluginConfig: IUniverSheetsPivotConfig;
@@ -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
- constructor(_sheetsPivotDataSourceModel: SheetsPivotDataSourceModel, _configService: IConfigService, _featureCalculationManagerService: IFeatureCalculationManagerService, _commandService: ICommandService);
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;
@@ -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;
@@ -1,10 +1,8 @@
1
1
  import { ICommandService, IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
2
2
  import { DataSyncPrimaryController } from '@univerjs/rpc';
3
- import { IUniverSheetsConfig } from '@univerjs/sheets';
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;
@@ -16,4 +14,3 @@ export declare class UniverSheetsPivotTablePlugin extends Plugin {
16
14
  onStarting(): void;
17
15
  private _initRegisterCommand;
18
16
  }
19
- export {};
@@ -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;