@univerjs-pro/engine-pivot 0.4.2 → 0.5.0-alpha.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs-pro/engine-pivot",
3
- "version": "0.4.2",
3
+ "version": "0.5.0-alpha.0",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -30,8 +30,7 @@
30
30
  },
31
31
  "./lib/*": "./lib/*"
32
32
  },
33
- "main": "./lib/cjs/index.js",
34
- "module": "./lib/es/index.js",
33
+ "main": "./lib/es/index.js",
35
34
  "types": "./lib/types/index.d.ts",
36
35
  "publishConfig": {
37
36
  "access": "public"
@@ -42,18 +41,15 @@
42
41
  "files": [
43
42
  "lib"
44
43
  ],
45
- "peerDependencies": {
46
- "@univerjs/core": "0.4.2"
47
- },
48
44
  "dependencies": {
49
- "@univerjs/core": "0.4.2"
45
+ "@univerjs/core": "0.5.0-alpha.0"
50
46
  },
51
47
  "devDependencies": {
52
48
  "typescript": "5.6.3",
53
- "vite": "^5.4.8",
54
- "vitest": "^2.1.2"
49
+ "vite": "^5.4.10",
50
+ "vitest": "^2.1.4"
55
51
  },
56
- "univerSpace": {
52
+ "space": {
57
53
  ".": {
58
54
  "import": "./lib/es/index.js",
59
55
  "require": "./lib/cjs/index.js",
@@ -71,6 +67,7 @@
71
67
  "test:watch": "vitest",
72
68
  "coverage": "vitest run --coverage",
73
69
  "lint:types": "tsc --noEmit",
74
- "build": "tsc && vite build"
75
- }
70
+ "build": "tsx build.ts"
71
+ },
72
+ "module": "./lib/es/index.js"
76
73
  }
@@ -1,15 +0,0 @@
1
- /**
2
- * @description blank placeholder for empty cells
3
- * the get/set functions are used to allow for customization
4
- * @constant {string} BLANK_PLACEHOLDER - default value is '--$blk$--'
5
- */
6
- export declare const GlobalConfig: {
7
- TUPLE_PLACEHOLDER: string;
8
- TUPLE_FIELD_SEPARATOR: string;
9
- COl_ROOT_PATH: string;
10
- ROW_ROOT_PATH: string;
11
- BLANK_PLACEHOLDER: string;
12
- isDev: boolean;
13
- };
14
- export declare const setBlankPlaceholder: (value: string) => string;
15
- export declare const setDevMode: (value: boolean) => boolean;
@@ -1,22 +0,0 @@
1
- import { IDataFieldManagerBaseJSON, IDataFieldValue, PivotSubtotalTypeEnum } from '../types';
2
- import { DataField } from './data-field';
3
- import { FieldsCollection } from './fields-collection';
4
- type autoDisplayNameFunction = (name: string, subtotalType: PivotSubtotalTypeEnum) => string;
5
- export declare abstract class DataFieldManager {
6
- dataFields: Record<string, DataField>;
7
- collections: Record<string, FieldsCollection>;
8
- constructor();
9
- createDataFieldId(): string;
10
- getAutoDisplayNameFunction(): autoDisplayNameFunction | null;
11
- getNoUsedDataFieldIds(excludeCollectionToken: string): string[];
12
- createCollection(id: string, rangeStr: unknown): FieldsCollection;
13
- dispose(): void;
14
- toJSON(): IDataFieldManagerBaseJSON;
15
- addCollection(token: string, collection: FieldsCollection, sourceRangeInfo: any, ...args: any): void;
16
- fromJSON(jsonData: IDataFieldManagerBaseJSON): void;
17
- abstract getRangeData(rangeKey: unknown): {
18
- header: unknown[];
19
- data: IDataFieldValue[][];
20
- };
21
- }
22
- export {};
@@ -1,161 +0,0 @@
1
- import { IDataFieldInfo, IDataFieldJSON, IDataFieldValue, PivotDataFieldDataTypeEnum } from '../types';
2
- /**
3
- * Represents a data field in a pivot table , it match the excel pivot cache field data structure.
4
- * @param {string} id - The unique identifier of the data field.
5
- * @param {string} name - The name of the data field. Almost is the row header of pivot table data source, the custom field such as calculated field or grouped field will have a different name.
6
- * @method addRecord - Add a record to the data field.
7
- */
8
- export declare class DataField {
9
- /**
10
- * @property {string} id - The unique identifier of the data field.
11
- */
12
- readonly id: string;
13
- /**
14
- * @property {string} name - The name of the data field.
15
- */
16
- name: string;
17
- /**
18
- * @property {string} hexCode - The hex code of the data field, which is used to create unique path in tuple group.
19
- */
20
- hexCode: string;
21
- /**
22
- * @property {string} rangeKey - The range key of the data field.
23
- */
24
- rangeKey: string;
25
- /**
26
- * @property {IDataFieldValue[]} records - The records of the data field.
27
- */
28
- records: IDataFieldValue[];
29
- /**
30
- * @property {string[]} items - The items of the data field.
31
- */
32
- items: string[];
33
- /**
34
- * @property {PivotDataFieldDataTypeEnum[]} itemTypes - The item types of the data field.
35
- */
36
- itemTypes: PivotDataFieldDataTypeEnum[];
37
- /**
38
- * @property {PivotDataFieldDataTypeEnum} fieldDataType - The data type of the data field.
39
- */
40
- private _fieldDataType;
41
- /**
42
- * @property {boolean} hasInteger - Whether the data field has integer value. this property is used in number group.
43
- */
44
- hasInteger: boolean;
45
- /**
46
- * @property {boolean} hasDecimal - Whether the data field has decimal value. this property is used in number group.
47
- */
48
- hasDecimal: boolean;
49
- /**
50
- * @property {boolean} hasDate - Whether the data field has date value. this property is used in date group.
51
- */
52
- hasDate: boolean;
53
- /**
54
- * @property {boolean} hasBlank - Whether the data field has blank value. The blank value is represented by a placeholder in Pivot table. in en-us locale, the placeholder is "(blank)".
55
- */
56
- hasBlank: boolean;
57
- /**
58
- * @property {boolean} hasText - Whether the data field has text value.
59
- */
60
- hasText: boolean;
61
- /**
62
- * @property {string} format - The format of the data field. only date field has format property, the format is the date format string.
63
- */
64
- format: string;
65
- /**
66
- * @property {number} maxNumber - The max number of the data field. this property is used in number group to set the max value of the number group.
67
- */
68
- maxNumber: number;
69
- /**
70
- * @property {number} minNumber - The min number of the data field. this property is used in number group to set the min value of the number group.
71
- */
72
- minNumber: number;
73
- /**
74
- * @property {number} maxDate - The max date of the data field. this property is used in date group to set the max value of the date group.
75
- */
76
- maxDate: number;
77
- /**
78
- * @property {number} minDate - The min date of the data field. this property is used in date group to set the min value of the date group.
79
- */
80
- minDate: number;
81
- /**
82
- * @property {Record<string, number>} - The index of the items in the data field.
83
- */
84
- private _itemIndexMap;
85
- /**
86
- * @property {Record<string, number[]>} itemsMap -Save the index of the items in the data field. The key is the item key, the value is the index array of the item in the data field.
87
- */
88
- private _itemsMap;
89
- constructor(id: string, name: string, hexCode: string);
90
- /**
91
- * - Returns the name of the data field.
92
- * @returns {string} the range key of the data field.
93
- */
94
- getRangeKey(): string;
95
- getformat(): string;
96
- /**
97
- * - set the range key of the data field.
98
- * @param {string} rangeKey the range key of the data field.
99
- */
100
- setRangeKey(rangeKey: string): void;
101
- getId(): string;
102
- getName(): string;
103
- setName(name: string): void;
104
- /**
105
- * - if the field contains date value and blank only, the field data type is date. if the field contains number value and blank only, the field data type is number. otherwise, the field data type is text.
106
- * @returns {string} the name of the data field.
107
- */
108
- getFieldDataType(): PivotDataFieldDataTypeEnum;
109
- /**
110
- * - Returns the shared key with the data field item, this can be combined in the tuple group with other data field item key to create a unique path.
111
- * @param {string} dataIndex the index in data records
112
- * @returns {string} key with field and item info
113
- */
114
- getItemSharedKey(key: string): string;
115
- /**
116
- * - Returns the key of the data field item. the key logic should be same with addRecord method.
117
- * @param {number} index - the index of data records
118
- * @returns {string} The key of the data field item.
119
- */
120
- getItemKey(index: number): string;
121
- /**
122
- * - get the type of date by key
123
- * @param {string} key - the key of the data field item.
124
- * @returns {PivotDataFieldDataTypeEnum} the data type
125
- */
126
- getTypeByKey(key: string): PivotDataFieldDataTypeEnum;
127
- /**
128
- * - Returns the value of the data field record
129
- * @param {number} index - The index of the data field record.
130
- * @returns {IDataFieldValue} - The value of the data field record.
131
- */
132
- getValue(index: number): IDataFieldValue;
133
- /**
134
- * @description Add a record to the data field.
135
- * @param {IDataFieldValue} record - The record to be added.
136
- * @param {number} index - The index of the record.
137
- * @returns {void}
138
- */
139
- addRecord(record: IDataFieldValue, index: number): void;
140
- getIndexesByKey(key: string): number[];
141
- /**
142
- * @description Update the item key in the data field.
143
- * @param {IDateValue} record - The date value.
144
- * @param {number} index - The index of the record.
145
- * @returns {void}
146
- */
147
- private _updateDateItemKey;
148
- private _updateBlankItemKey;
149
- private _updateStringItemKey;
150
- private _updateNumberItemKey;
151
- private _updateItemKey;
152
- getItemsMap(): Record<string, number>;
153
- /**
154
- * @description Get the data field info for pivot table, some properties are not included in the data field info because they are not necessary for the pivot table. only the import/export need them.
155
- * @returns {IDataFieldInfo} The data field info.
156
- */
157
- getFieldInfo(): IDataFieldInfo;
158
- toJSON(): IDataFieldJSON;
159
- fromJSON(data: IDataFieldJSON): void;
160
- reset(): void;
161
- }
@@ -1,70 +0,0 @@
1
- import { IDataFieldInfo, IFieldsCollectionJSON } from '../types';
2
- import { DataFieldManager } from './data-field-manager';
3
- import { DataField } from './data-field';
4
- /**
5
- * Represents the collection of fields in the pivot table. which one to one with a pivot table.
6
- * @description The collection of fields in the pivot table. The fields collection uses shared the base data field id.For Grouped fields or calculated fields, it will save in custom field.
7
- * @class FieldsCollection
8
- * @param {DataFieldManager} host - The data field manager.
9
- */
10
- export declare class FieldsCollection {
11
- /**
12
- * @property The base fields id which saved in host <the DataFieldManager>, this part of fields are the original fields in the pivot table.
13
- */
14
- fieldIds: string[];
15
- /**
16
- * @property The display name of the fields in the pivot table. key is field id, value is the display name.
17
- */
18
- displayNameRecord: Record<string, string>;
19
- /**
20
- * @property The custom fields in the pivot table. such as calculated fields or grouped fields.
21
- */
22
- customFields: Record<string, DataField>;
23
- range: any;
24
- dataRecordCount: number;
25
- readonly host: DataFieldManager;
26
- constructor(host: DataFieldManager);
27
- getFieldIds(): string[];
28
- hasField(fieldId: string): boolean;
29
- /**
30
- * find the is there has a data field whose name is the same as the sourceName.
31
- * @param {string} sourceName - the source name of the field.
32
- * @returns {boolean} - true if has the field, otherwise false.
33
- */
34
- hasSourceName(sourceName: string): boolean;
35
- setRange(range: any): void;
36
- /**
37
- * - add a field to the collection. the field should be ensured in the host.
38
- * @param fieldId
39
- */
40
- addField(fieldId: string, displayName: string): void;
41
- /**
42
- * get the display name of the field by the field id in this collection, in different collection, the display name may be different.
43
- * @param {string} fieldId the data field id.
44
- * @returns {string} the display name of the field.
45
- */
46
- getDisplayName(fieldId: string): string;
47
- setDisplayName(fieldId: string, fieldName: string, displayNameRecord?: Record<string, string>): void;
48
- getUniqueDataFieldName(displayName: string, displayNameRecord?: Record<string, string>): string;
49
- /**
50
- * @description remove the field from the collection.
51
- */
52
- updateAllDisplayName(): void;
53
- /**
54
- * @description Gets the field by the specified id.
55
- * @param {string} id - The field id.
56
- * @returns {DataField} - The field.
57
- */
58
- getFieldById(id: string): DataField;
59
- setDataRecordCount(count: number): void;
60
- getDataRecordCount(): number;
61
- getDataFieldBySourceName(sourceName: string): DataField | undefined;
62
- /**
63
- * @description Gets the field by the specified name.
64
- * @returns {IDataFieldInfo[]} -returns the field infos.
65
- */
66
- getFieldInfo(): IDataFieldInfo[];
67
- toJSON(): IFieldsCollectionJSON;
68
- fromJSON(jsonData: IFieldsCollectionJSON): void;
69
- dispose(): void;
70
- }
@@ -1,58 +0,0 @@
1
- import { PivotTable } from '../pivot/pivot-table';
2
- import { NodeTree } from '../summary/node-tree';
3
- import { SummaryManager } from '../summary/summary-manager';
4
- import { IColumnNodeSizeInfo, INodeSizeInfo, IPivotLayoutCtx, IPivotTableLabelFieldQueryData, IPivotTableQueryData, PivotErrorTypeEnum } from '../types';
5
- import { PageViewItem } from './pivot-view';
6
- export declare class BaseLayout {
7
- /**
8
- *
9
- * @param pivotTable - the pivot table
10
- * @param summaryManager - the summary manager
11
- * @returns {IPivotLayoutCtx} the layout context
12
- */
13
- static prepareLayoutCtx(pivotTable: PivotTable, summaryManager: SummaryManager, queryData: IPivotTableQueryData): IPivotLayoutCtx;
14
- static layoutPage(ctx: IPivotLayoutCtx): void;
15
- static layoutPageOverThenDown(filters: IPivotTableLabelFieldQueryData[], page: PageViewItem, pageWrap?: number): void;
16
- static layoutPageDownThenOver(filters: IPivotTableLabelFieldQueryData[], page: PageViewItem, pageWrap?: number): void;
17
- static layoutCol(ctx: IPivotLayoutCtx): void;
18
- static layoutCorner(ctx: IPivotLayoutCtx): void;
19
- static layoutColHeader(ctx: IPivotLayoutCtx): void;
20
- static setValueSize(ctx: IPivotLayoutCtx): void;
21
- static layoutNoneColFields(ctx: IPivotLayoutCtx, nodeTree: NodeTree): IColumnNodeSizeInfo;
22
- static layoutColFields(ctx: IPivotLayoutCtx): void;
23
- /**
24
- * - the node is leaf node when the level of the node is equal to the deep, but the node is not the real leaf node
25
- * @param {NodeTree} nodeTree - the node tree
26
- * @param {number} deep - the deep of the tree
27
- * @returns {boolean} - the node is leaf node or not
28
- */
29
- static isLeafNode(nodeTree: NodeTree, deep: number): boolean;
30
- static getRealSize(sizeInfo: INodeSizeInfo): number;
31
- /**
32
- * - get the node value from the summary manager, the node index is the tuples of summary manager
33
- * @param {IPivotLayoutCtx} ctx
34
- * @param {NodeTree} nodeTree
35
- * @param {number} measureIndex
36
- * @returns {number} - the value of the node
37
- */
38
- static getNodeValue(ctx: IPivotLayoutCtx, nodeTree: NodeTree, measureIndex: number): number | {
39
- errorType: PivotErrorTypeEnum;
40
- } | undefined;
41
- static doColLeafNode(ctx: IPivotLayoutCtx, nodeTree: NodeTree, col: number, valueIds: string[]): IColumnNodeSizeInfo;
42
- static buildColPathMap(ctx: IPivotLayoutCtx, nodeTree: NodeTree): Record<string, number>;
43
- static iterateColLeafNodeChildren(ctx: IPivotLayoutCtx, nodeTree: NodeTree, paths: string[], map: Record<string, number>): void;
44
- /**
45
- * - build the path map for the collapse node
46
- * @param ctx - the layout context
47
- * @param nodeTree - the node tree
48
- * @param colPathMapList - the path map list
49
- */
50
- static buildColPathMapForCollapse(ctx: IPivotLayoutCtx, nodeTree: NodeTree, colPathMapList: Record<string, number>[]): void;
51
- static doColBranchNode(ctx: IPivotLayoutCtx, nodeTree: NodeTree, col: number, valueIds: string[]): IColumnNodeSizeInfo;
52
- static shouldMultipleTotal(hasMultiValue: boolean, nodeLevel: number, valueIndex: number): boolean;
53
- static shouldMultipleNode(hasMultiValue: boolean, nodeLevel: number, valueIndex: number): boolean;
54
- static getRowIndexForColHeader(nodeLevel: number, valueIndex: number, hasMultiValue: boolean): number;
55
- static layoutColNode(ctx: IPivotLayoutCtx, nodeTree: NodeTree, col: number, valueIds: string[]): IColumnNodeSizeInfo;
56
- static getMeasureIndex(isColMultiMeasure: boolean, valueIds: string[], measureIndexesMap: Record<string, number>): number;
57
- static updateColumnSubtotal(ctx: IPivotLayoutCtx, col: number, nodeTree: NodeTree, valueIds: string[], colPathMap: Record<string, number>): void;
58
- }
@@ -1,9 +0,0 @@
1
- import { PivotTable } from '../pivot/pivot-table';
2
- import { SummaryManager } from '../summary/summary-manager';
3
- import { IPivotLayoutCtx, IPivotTableQueryData } from '../types';
4
- import { BaseLayout } from './base-layout';
5
- import { PivotView } from './pivot-view';
6
- export declare class CompactLayout extends BaseLayout {
7
- static layout(pivotTable: PivotTable, SummaryManager: SummaryManager, queryData: IPivotTableQueryData): PivotView;
8
- static layoutRow(ctx: IPivotLayoutCtx): void;
9
- }
@@ -1,9 +0,0 @@
1
- import { PivotTable } from '../pivot/pivot-table';
2
- import { SummaryManager } from '../summary/summary-manager';
3
- import { IPivotLayoutCtx, IPivotTableQueryData } from '../types';
4
- import { BaseLayout } from './base-layout';
5
- import { PivotView } from './pivot-view';
6
- export declare class OutlineLayout extends BaseLayout {
7
- static layout(pivotTable: PivotTable, SummaryManager: SummaryManager, queryData: IPivotTableQueryData): PivotView;
8
- static layoutRow(ctx: IPivotLayoutCtx): void;
9
- }
@@ -1,135 +0,0 @@
1
- import { PivotModel } from '../pivot/model';
2
- import { ILabelViewHeaderMapItem, ILabelViewItemJSON, IPageViewItemJSON, IPageViewItemRange, IPivotViewCellData, IPivotViewErrorValue, IPivotViewInfo, IPivotViewItemData, IPivotViewItemJSON, IPivotViewJSON, IPivotViewPrefixValue, IPivotViewValueType, PivotCellStyleTypeEnum } from '../types';
3
- /**
4
- * @class PivotView
5
- * @description the view of pivot table, which contains the page, row, col, data view, the page view separation the pivot table to two areas, the row and col view as the header of data area
6
- */
7
- export declare class PivotView {
8
- /**
9
- * the page view of the pivot table
10
- */
11
- pageView: PageViewItem;
12
- /**
13
- * the row view of the pivot table
14
- */
15
- rowView: LabelViewItem;
16
- /**
17
- * the col view of the pivot table
18
- */
19
- colView: LabelViewItem;
20
- /**
21
- * the data view of the pivot table
22
- */
23
- dataView: PivotViewItem;
24
- /**
25
- * the corner view of the pivot table
26
- */
27
- cornerView: PivotViewItem;
28
- /**
29
- * the version of the pivot view, it will be used to check the view is the latest
30
- */
31
- version: number;
32
- /**
33
- * the format map of the table field id, it will be used to store the format of the pivot view
34
- */
35
- formatMap: Record<string, string>;
36
- constructor();
37
- setVersion(version?: number): void;
38
- /**
39
- * - the func effect is to set the format code , for label view, it will used to format the header , such as date type data, in the data view, it will used to format the data of show data as
40
- * @param model the pivot model, it will be used to set the format of the pivot view
41
- */
42
- setFormat(model: PivotModel): void;
43
- getVersion(): number;
44
- toJSON(): IPivotViewJSON;
45
- formJSON(data: IPivotViewJSON): void;
46
- }
47
- export declare class PivotViewItem {
48
- /**
49
- * - how many rows in the view
50
- */
51
- rowCount: number;
52
- /**
53
- * - how many cols in the view
54
- */
55
- colCount: number;
56
- /**
57
- * the data of the view, the key is the row index, the value is the column data
58
- */
59
- data: IPivotViewItemData;
60
- /**
61
- * the info of the view, the index is the index of the view item, the value is the info of the view item
62
- */
63
- info: IPivotViewInfo[];
64
- lastCol: number;
65
- lastRow: number;
66
- getLastCol(): number;
67
- getLastRow(): number;
68
- setValue(row: number, col: number, value: IPivotViewValueType): void;
69
- setStyle(row: number, col: number, styleType: PivotCellStyleTypeEnum): void;
70
- setBlank(row: number, col: number): void;
71
- protected getCell(row: number, col: number): IPivotViewCellData;
72
- setInfo(index: number, info: IPivotViewInfo): void;
73
- buildPathMap(considerValue: boolean): Record<string, number>;
74
- setRowCount(rowCount: number): void;
75
- setColCount(colCount: number): void;
76
- getRowCount(): number;
77
- getColCount(): number;
78
- getValue(row: number, col: number): IPivotViewValueType;
79
- getStyle(row: number, col: number): PivotCellStyleTypeEnum | undefined;
80
- toJSON(): IPivotViewItemJSON;
81
- fromJSON(json: IPivotViewItemJSON): void;
82
- }
83
- export declare class PageViewItem extends PivotViewItem {
84
- /**
85
- * the range group of the page view, all range is base on the left top of the page view
86
- */
87
- ranges: IPageViewItemRange[];
88
- /**
89
- * the last col index of the page view
90
- */
91
- lastCol: number;
92
- /**
93
- * the last row index of the page view
94
- */
95
- lastRow: number;
96
- setPageIndex(row: number, col: number, index: number): void;
97
- addRange(range: IPageViewItemRange): void;
98
- getRanges(): IPageViewItemRange[];
99
- setLastCol(col: number): void;
100
- setLastRow(row: number): void;
101
- getLastCol(): number;
102
- getLastRow(): number;
103
- toJSON(): IPageViewItemJSON;
104
- fromJSON(json: IPageViewItemJSON): void;
105
- }
106
- export declare class LabelViewItem extends PivotViewItem {
107
- /**
108
- * this property is used to store the header map of the label view
109
- * - in the row view, the header map saved the every column in row view, the key is the column index, the value is the header map item
110
- * - in the col view, the header map saved the every row in col view, the key is the row index, the value is the header map item
111
- */
112
- headerMap: ILabelViewHeaderMapItem[];
113
- addHeaderMapItem(index: number, item: ILabelViewHeaderMapItem): void;
114
- getHeaderMapItem(index: number): ILabelViewHeaderMapItem;
115
- toJSON(): ILabelViewItemJSON;
116
- fromJSON(json: ILabelViewItemJSON): void;
117
- }
118
- export declare class RowViewItem extends LabelViewItem {
119
- getLastCol(): number;
120
- }
121
- export declare class ColViewItem extends LabelViewItem {
122
- getLastRow(): number;
123
- }
124
- /**
125
- * judge the value is the prefix value, once when the value is a subtotal and there are multiple value field, the value will be the prefix value
126
- * @param {IPivotViewValueType} value the pivot view value
127
- * @returns {boolean} the value is the prefix value
128
- */
129
- export declare const isPrefixValue: (value: IPivotViewValueType) => value is IPivotViewPrefixValue;
130
- /**
131
- * judge the value is the error value, it will be a error value when the show data as or the product bigger than the max value of number in javascript
132
- * @param {IPivotViewValueType} value - the pivot view value
133
- * @returns {boolean} the value is the error value
134
- */
135
- export declare const isErrorValue: (value: IPivotViewValueType) => value is IPivotViewErrorValue;
@@ -1,28 +0,0 @@
1
- import { PivotTable } from '../pivot/pivot-table';
2
- import { NodeTree } from '../summary/node-tree';
3
- import { SummaryManager } from '../summary/summary-manager';
4
- import { INodeSizeInfo, IPivotLayoutCtx, IPivotTableQueryData, IPivotTableValueFieldQueryData, IPivotViewInfo, IRowNodeSizeInfo } from '../types';
5
- import { BaseLayout } from './base-layout';
6
- import { PivotView } from './pivot-view';
7
- export declare class TabularLayout extends BaseLayout {
8
- static layout(pivotTable: PivotTable, summaryManager: SummaryManager, queryData: IPivotTableQueryData): PivotView;
9
- static layoutCorner(ctx: IPivotLayoutCtx): void;
10
- static layoutRowFields(ctx: IPivotLayoutCtx): void;
11
- static doRowLeafNode(ctx: IPivotLayoutCtx, nodeTree: NodeTree, row: number, valueIds: string[]): IRowNodeSizeInfo;
12
- /**
13
- * - layout the data area of the pivot table
14
- * @param {IPivotLayoutCtx} ctx the context of layout
15
- * @param {NodeTree} nodeTree the current node
16
- * @param {number} row the current row index
17
- * @param {number} measureIndex the current measure index, if the row does not have multiple measures, the measureIndex is -1
18
- */
19
- static startContent(ctx: IPivotLayoutCtx, nodeTree: NodeTree, row: number, measureIndex: number): void;
20
- static layoutValueNode(ctx: IPivotLayoutCtx, nodeTree: NodeTree, row: number, measureIndex: number, paths: string[]): void;
21
- static layoutValueNodeSubtotal(ctx: IPivotLayoutCtx, row: number): void;
22
- static getMeasureInfoByIndex(ctx: IPivotLayoutCtx, valueQueryInfo: IPivotTableValueFieldQueryData[], rowInfo: IPivotViewInfo, colInfo: IPivotViewInfo): IPivotTableValueFieldQueryData;
23
- static layoutValueLeafNode(ctx: IPivotLayoutCtx, nodeTree: NodeTree, row: number, paths: string[], measureIndex: number): void;
24
- static getColIndexForRowHeader(nodeLevel: number, valueIndex: number, hasMultiValue: boolean): number;
25
- static doRowBrachNode(ctx: IPivotLayoutCtx, nodeTree: NodeTree, row: number, valueIds: string[]): INodeSizeInfo;
26
- static layoutRowNode(ctx: IPivotLayoutCtx, nodeTree: NodeTree, row: number, valueIds: string[]): INodeSizeInfo;
27
- static updateRowSubtotal(ctx: IPivotLayoutCtx, row: number, nodeTree: NodeTree, valueIds: string[]): void;
28
- }