@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/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/types/index.d.ts +2539 -11
- package/lib/umd/index.js +1 -1
- package/package.json +9 -12
- package/lib/types/const.d.ts +0 -15
- package/lib/types/field/data-field-manager.d.ts +0 -22
- package/lib/types/field/data-field.d.ts +0 -161
- package/lib/types/field/fields-collection.d.ts +0 -70
- package/lib/types/layout/base-layout.d.ts +0 -58
- package/lib/types/layout/compact.d.ts +0 -9
- package/lib/types/layout/outline.d.ts +0 -9
- package/lib/types/layout/pivot-view.d.ts +0 -135
- package/lib/types/layout/tabular.d.ts +0 -28
- package/lib/types/pivot/model.d.ts +0 -189
- package/lib/types/pivot/pivot-table.d.ts +0 -233
- package/lib/types/pivot/table-field.d.ts +0 -131
- package/lib/types/summary/node-tree.d.ts +0 -48
- package/lib/types/summary/pivot-tuple.d.ts +0 -24
- package/lib/types/summary/summary-manager.d.ts +0 -72
- package/lib/types/summary/tuple-group.d.ts +0 -82
- package/lib/types/types/enum.d.ts +0 -624
- package/lib/types/types/index.d.ts +0 -5
- package/lib/types/types/interface.d.ts +0 -187
- package/lib/types/types/json-types.d.ts +0 -184
- package/lib/types/types/layout-type.d.ts +0 -237
- package/lib/types/types/summary-type.d.ts +0 -41
- package/lib/types/util.d.ts +0 -124
package/lib/types/index.d.ts
CHANGED
|
@@ -1,11 +1,2539 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
declare type autoDisplayNameFunction = (name: string, subtotalType: PivotSubtotalTypeEnum) => string;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Clone the label field to a value field.
|
|
5
|
+
* @param {PivotTableLabelField} labelField - The label field to be cloned.
|
|
6
|
+
* @param {boolean} [keepUnknown] - Whether to keep the unknown property of the label field. the default value is true.
|
|
7
|
+
* @returns {PivotTableValueField} - the value field may has sortInfo and filterInfo in the property lossLessProperty.
|
|
8
|
+
*/
|
|
9
|
+
export declare function cloneLabelFieldToValueField(labelField: PivotTableLabelField, keepUnknown?: boolean): PivotTableValueField;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Clone the value field to a label field.
|
|
13
|
+
* @param {PivotTableValueField} valueField - The value field to be cloned.
|
|
14
|
+
* @param {boolean} [keepUnknown] - Whether to keep the unknown property of the value field. the default value is true.
|
|
15
|
+
* @returns {PivotTableLabelField} - the label field may has sortInfo and filterInfo in the property lossLessProperty.
|
|
16
|
+
*/
|
|
17
|
+
export declare function cloneValueFieldToLabelField(valueField: PivotTableValueField, keepUnknown?: boolean): PivotTableLabelField;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* - Create a label field from the JSON data.
|
|
21
|
+
* @param {IPivotTableLabelFieldJSON} data - The JSON data of the label field.
|
|
22
|
+
* @returns {PivotTableLabelField} - The label field created from the JSON data.
|
|
23
|
+
*/
|
|
24
|
+
export declare function createLabelField(data: IPivotTableLabelFieldJSON): PivotTableLabelField;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* - Create a value field from the JSON data.
|
|
28
|
+
* @param {IPivotTableValueFieldJSON} data - The JSON data of the value field.
|
|
29
|
+
* @returns {PivotTableValueField} - The value field created from the JSON data.
|
|
30
|
+
*/
|
|
31
|
+
export declare function createValueField(data: IPivotTableValueFieldJSON): PivotTableValueField;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Represents a data field in a pivot table , it match the excel pivot cache field data structure.
|
|
35
|
+
* @param {string} id - The unique identifier of the data field.
|
|
36
|
+
* @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.
|
|
37
|
+
* @method addRecord - Add a record to the data field.
|
|
38
|
+
*/
|
|
39
|
+
export declare class DataField {
|
|
40
|
+
/**
|
|
41
|
+
* @property {string} id - The unique identifier of the data field.
|
|
42
|
+
*/
|
|
43
|
+
readonly id: string;
|
|
44
|
+
/**
|
|
45
|
+
* @property {string} name - The name of the data field.
|
|
46
|
+
*/
|
|
47
|
+
name: string;
|
|
48
|
+
/**
|
|
49
|
+
* @property {string} hexCode - The hex code of the data field, which is used to create unique path in tuple group.
|
|
50
|
+
*/
|
|
51
|
+
hexCode: string;
|
|
52
|
+
/**
|
|
53
|
+
* @property {string} rangeKey - The range key of the data field.
|
|
54
|
+
*/
|
|
55
|
+
rangeKey: string;
|
|
56
|
+
/**
|
|
57
|
+
* @property {IDataFieldValue[]} records - The records of the data field.
|
|
58
|
+
*/
|
|
59
|
+
records: IDataFieldValue[];
|
|
60
|
+
/**
|
|
61
|
+
* @property {string[]} items - The items of the data field.
|
|
62
|
+
*/
|
|
63
|
+
items: string[];
|
|
64
|
+
/**
|
|
65
|
+
* @property {PivotDataFieldDataTypeEnum[]} itemTypes - The item types of the data field.
|
|
66
|
+
*/
|
|
67
|
+
itemTypes: PivotDataFieldDataTypeEnum[];
|
|
68
|
+
/**
|
|
69
|
+
* @property {PivotDataFieldDataTypeEnum} fieldDataType - The data type of the data field.
|
|
70
|
+
*/
|
|
71
|
+
private _fieldDataType;
|
|
72
|
+
/**
|
|
73
|
+
* @property {boolean} hasInteger - Whether the data field has integer value. this property is used in number group.
|
|
74
|
+
*/
|
|
75
|
+
hasInteger: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* @property {boolean} hasDecimal - Whether the data field has decimal value. this property is used in number group.
|
|
78
|
+
*/
|
|
79
|
+
hasDecimal: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* @property {boolean} hasDate - Whether the data field has date value. this property is used in date group.
|
|
82
|
+
*/
|
|
83
|
+
hasDate: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* @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)".
|
|
86
|
+
*/
|
|
87
|
+
hasBlank: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* @property {boolean} hasText - Whether the data field has text value.
|
|
90
|
+
*/
|
|
91
|
+
hasText: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* @property {string} format - The format of the data field. only date field has format property, the format is the date format string.
|
|
94
|
+
*/
|
|
95
|
+
format: string;
|
|
96
|
+
/**
|
|
97
|
+
* @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.
|
|
98
|
+
*/
|
|
99
|
+
maxNumber: number;
|
|
100
|
+
/**
|
|
101
|
+
* @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.
|
|
102
|
+
*/
|
|
103
|
+
minNumber: number;
|
|
104
|
+
/**
|
|
105
|
+
* @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.
|
|
106
|
+
*/
|
|
107
|
+
maxDate: number;
|
|
108
|
+
/**
|
|
109
|
+
* @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.
|
|
110
|
+
*/
|
|
111
|
+
minDate: number;
|
|
112
|
+
/**
|
|
113
|
+
* @property {Record<string, number>} - The index of the items in the data field.
|
|
114
|
+
*/
|
|
115
|
+
private _itemIndexMap;
|
|
116
|
+
/**
|
|
117
|
+
* @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.
|
|
118
|
+
*/
|
|
119
|
+
private _itemsMap;
|
|
120
|
+
constructor(id: string, name: string, hexCode: string);
|
|
121
|
+
/**
|
|
122
|
+
* - Returns the name of the data field.
|
|
123
|
+
* @returns {string} the range key of the data field.
|
|
124
|
+
*/
|
|
125
|
+
getRangeKey(): string;
|
|
126
|
+
getformat(): string;
|
|
127
|
+
/**
|
|
128
|
+
* - set the range key of the data field.
|
|
129
|
+
* @param {string} rangeKey the range key of the data field.
|
|
130
|
+
*/
|
|
131
|
+
setRangeKey(rangeKey: string): void;
|
|
132
|
+
getId(): string;
|
|
133
|
+
getName(): string;
|
|
134
|
+
setName(name: string): void;
|
|
135
|
+
/**
|
|
136
|
+
* - 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.
|
|
137
|
+
* @returns {string} the name of the data field.
|
|
138
|
+
*/
|
|
139
|
+
getFieldDataType(): PivotDataFieldDataTypeEnum;
|
|
140
|
+
/**
|
|
141
|
+
* - 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.
|
|
142
|
+
* @param {string} dataIndex the index in data records
|
|
143
|
+
* @returns {string} key with field and item info
|
|
144
|
+
*/
|
|
145
|
+
getItemSharedKey(key: string): string;
|
|
146
|
+
/**
|
|
147
|
+
* - Returns the key of the data field item. the key logic should be same with addRecord method.
|
|
148
|
+
* @param {number} index - the index of data records
|
|
149
|
+
* @returns {string} The key of the data field item.
|
|
150
|
+
*/
|
|
151
|
+
getItemKey(index: number): string;
|
|
152
|
+
/**
|
|
153
|
+
* - get the type of date by key
|
|
154
|
+
* @param {string} key - the key of the data field item.
|
|
155
|
+
* @returns {PivotDataFieldDataTypeEnum} the data type
|
|
156
|
+
*/
|
|
157
|
+
getTypeByKey(key: string): PivotDataFieldDataTypeEnum;
|
|
158
|
+
/**
|
|
159
|
+
* - Returns the value of the data field record
|
|
160
|
+
* @param {number} index - The index of the data field record.
|
|
161
|
+
* @returns {IDataFieldValue} - The value of the data field record.
|
|
162
|
+
*/
|
|
163
|
+
getValue(index: number): IDataFieldValue;
|
|
164
|
+
/**
|
|
165
|
+
* @description Add a record to the data field.
|
|
166
|
+
* @param {IDataFieldValue} record - The record to be added.
|
|
167
|
+
* @param {number} index - The index of the record.
|
|
168
|
+
* @returns {void}
|
|
169
|
+
*/
|
|
170
|
+
addRecord(record: IDataFieldValue, index: number): void;
|
|
171
|
+
getIndexesByKey(key: string): number[];
|
|
172
|
+
/**
|
|
173
|
+
* @description Update the item key in the data field.
|
|
174
|
+
* @param {IDateValue} record - The date value.
|
|
175
|
+
* @param {number} index - The index of the record.
|
|
176
|
+
* @returns {void}
|
|
177
|
+
*/
|
|
178
|
+
private _updateDateItemKey;
|
|
179
|
+
private _updateBlankItemKey;
|
|
180
|
+
private _updateStringItemKey;
|
|
181
|
+
private _updateNumberItemKey;
|
|
182
|
+
private _updateItemKey;
|
|
183
|
+
getItemsMap(): Record<string, number>;
|
|
184
|
+
/**
|
|
185
|
+
* @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.
|
|
186
|
+
* @returns {IDataFieldInfo} The data field info.
|
|
187
|
+
*/
|
|
188
|
+
getFieldInfo(): IDataFieldInfo;
|
|
189
|
+
toJSON(): IDataFieldJSON;
|
|
190
|
+
fromJSON(data: IDataFieldJSON): void;
|
|
191
|
+
reset(): void;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export declare abstract class DataFieldManager {
|
|
195
|
+
dataFields: Record<string, DataField>;
|
|
196
|
+
collections: Record<string, FieldsCollection>;
|
|
197
|
+
constructor();
|
|
198
|
+
createDataFieldId(): string;
|
|
199
|
+
getAutoDisplayNameFunction(): autoDisplayNameFunction | null;
|
|
200
|
+
getNoUsedDataFieldIds(excludeCollectionToken: string): string[];
|
|
201
|
+
createCollection(id: string, rangeStr: unknown): FieldsCollection;
|
|
202
|
+
dispose(): void;
|
|
203
|
+
toJSON(): IDataFieldManagerBaseJSON;
|
|
204
|
+
addCollection(token: string, collection: FieldsCollection, sourceRangeInfo: any, ...args: any): void;
|
|
205
|
+
fromJSON(jsonData: IDataFieldManagerBaseJSON): void;
|
|
206
|
+
abstract getRangeData(rangeKey: unknown): {
|
|
207
|
+
header: unknown[];
|
|
208
|
+
data: IDataFieldValue[][];
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Represents the collection of fields in the pivot table. which one to one with a pivot table.
|
|
214
|
+
* @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.
|
|
215
|
+
* @class FieldsCollection
|
|
216
|
+
* @param {DataFieldManager} host - The data field manager.
|
|
217
|
+
*/
|
|
218
|
+
export declare class FieldsCollection {
|
|
219
|
+
/**
|
|
220
|
+
* @property The base fields id which saved in host <the DataFieldManager>, this part of fields are the original fields in the pivot table.
|
|
221
|
+
*/
|
|
222
|
+
fieldIds: string[];
|
|
223
|
+
/**
|
|
224
|
+
* @property The display name of the fields in the pivot table. key is field id, value is the display name.
|
|
225
|
+
*/
|
|
226
|
+
displayNameRecord: Record<string, string>;
|
|
227
|
+
/**
|
|
228
|
+
* @property The custom fields in the pivot table. such as calculated fields or grouped fields.
|
|
229
|
+
*/
|
|
230
|
+
customFields: Record<string, DataField>;
|
|
231
|
+
range: any;
|
|
232
|
+
dataRecordCount: number;
|
|
233
|
+
readonly host: DataFieldManager;
|
|
234
|
+
constructor(host: DataFieldManager);
|
|
235
|
+
getFieldIds(): string[];
|
|
236
|
+
hasField(fieldId: string): boolean;
|
|
237
|
+
/**
|
|
238
|
+
* find the is there has a data field whose name is the same as the sourceName.
|
|
239
|
+
* @param {string} sourceName - the source name of the field.
|
|
240
|
+
* @returns {boolean} - true if has the field, otherwise false.
|
|
241
|
+
*/
|
|
242
|
+
hasSourceName(sourceName: string): boolean;
|
|
243
|
+
setRange(range: any): void;
|
|
244
|
+
/**
|
|
245
|
+
* - add a field to the collection. the field should be ensured in the host.
|
|
246
|
+
* @param fieldId
|
|
247
|
+
*/
|
|
248
|
+
addField(fieldId: string, displayName: string): void;
|
|
249
|
+
/**
|
|
250
|
+
* get the display name of the field by the field id in this collection, in different collection, the display name may be different.
|
|
251
|
+
* @param {string} fieldId the data field id.
|
|
252
|
+
* @returns {string} the display name of the field.
|
|
253
|
+
*/
|
|
254
|
+
getDisplayName(fieldId: string): string;
|
|
255
|
+
setDisplayName(fieldId: string, fieldName: string, displayNameRecord?: Record<string, string>): void;
|
|
256
|
+
getUniqueDataFieldName(displayName: string, displayNameRecord?: Record<string, string>): string;
|
|
257
|
+
/**
|
|
258
|
+
* @description remove the field from the collection.
|
|
259
|
+
*/
|
|
260
|
+
updateAllDisplayName(): void;
|
|
261
|
+
/**
|
|
262
|
+
* @description Gets the field by the specified id.
|
|
263
|
+
* @param {string} id - The field id.
|
|
264
|
+
* @returns {DataField} - The field.
|
|
265
|
+
*/
|
|
266
|
+
getFieldById(id: string): DataField;
|
|
267
|
+
setDataRecordCount(count: number): void;
|
|
268
|
+
getDataRecordCount(): number;
|
|
269
|
+
getDataFieldBySourceName(sourceName: string): DataField | undefined;
|
|
270
|
+
/**
|
|
271
|
+
* @description Gets the field by the specified name.
|
|
272
|
+
* @returns {IDataFieldInfo[]} -returns the field infos.
|
|
273
|
+
*/
|
|
274
|
+
getFieldInfo(): IDataFieldInfo[];
|
|
275
|
+
toJSON(): IFieldsCollectionJSON;
|
|
276
|
+
fromJSON(jsonData: IFieldsCollectionJSON): void;
|
|
277
|
+
dispose(): void;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* - Generate a random hex number text with specified length
|
|
282
|
+
* @param {number} length the length of the generated hex number
|
|
283
|
+
* @returns {string} the generated hex number
|
|
284
|
+
*/
|
|
285
|
+
export declare function generateHexNumber(length: number): string;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* - Get the auto display name of the value field.
|
|
289
|
+
* @description - which may use prefix text like excel
|
|
290
|
+
* - the prefix text is create by subtotal type
|
|
291
|
+
* @param {string} baseName the name without prefix text
|
|
292
|
+
* @param {PivotSubtotalTypeEnum} subtotalType the type of subtotal to be displayed for this value field.
|
|
293
|
+
* @returns {string} the auto display name of the value field.
|
|
294
|
+
*/
|
|
295
|
+
export declare function getAutoDisplayName(baseName: string, subtotalType: PivotSubtotalTypeEnum): string;
|
|
296
|
+
|
|
297
|
+
declare type IBlankValue = null | undefined;
|
|
298
|
+
|
|
299
|
+
export declare interface IColumnNodeSizeInfo extends INodeSizeInfo {
|
|
300
|
+
colPathMap: Record<string, number>;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export declare interface IDataFieldInfo {
|
|
304
|
+
id: string;
|
|
305
|
+
name: string;
|
|
306
|
+
fieldDataType: PivotDataFieldDataTypeEnum;
|
|
307
|
+
format: string;
|
|
308
|
+
maxNumber: number;
|
|
309
|
+
minNumber: number;
|
|
310
|
+
maxDate: number;
|
|
311
|
+
minDate: number;
|
|
312
|
+
records: IDataFieldValue[];
|
|
313
|
+
rangeKey: string;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Represents the data field serialized to JSON data structure.
|
|
318
|
+
*/
|
|
319
|
+
export declare interface IDataFieldJSON {
|
|
320
|
+
id: string;
|
|
321
|
+
name: string;
|
|
322
|
+
hexCode: string;
|
|
323
|
+
rangeKey: string;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export declare interface IDataFieldManagerBaseJSON {
|
|
327
|
+
collections: Record<string, IFieldsCollectionJSON>;
|
|
328
|
+
dataFields: Record<string, IDataFieldJSON>;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Represents the value of a data field in a pivot table data field
|
|
333
|
+
*/
|
|
334
|
+
export declare type IDataFieldValue = string | number | boolean | IDateValue | IBlankValue;
|
|
335
|
+
|
|
336
|
+
export declare interface IDateValue {
|
|
337
|
+
/**
|
|
338
|
+
* @description the date value, it stores the number of seconds since January 1, 1970, 00:00:00 UTC, it is same to excel date value
|
|
339
|
+
*/
|
|
340
|
+
v: number;
|
|
341
|
+
/**
|
|
342
|
+
* @description only date type has this property, we can use it to format the date
|
|
343
|
+
*/
|
|
344
|
+
f: string;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export declare interface IDimensionMapItem {
|
|
348
|
+
field: DataField;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export declare interface IFieldsCollectionJSON {
|
|
352
|
+
fieldIds: string[];
|
|
353
|
+
customFields: IDataFieldJSON[];
|
|
354
|
+
displayNameRecord: Record<string, string>;
|
|
355
|
+
dataRecordCount: number;
|
|
356
|
+
range: unknown;
|
|
357
|
+
fields: Record<string, IDataFieldJSON>;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export declare interface ILabelViewHeaderMapItem {
|
|
361
|
+
isValue: boolean;
|
|
362
|
+
level: number;
|
|
363
|
+
tableFieldId: string;
|
|
364
|
+
dataFieldId: string;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export declare interface ILabelViewItemJSON extends IPivotViewItemJSON {
|
|
368
|
+
headerMap: ILabelViewHeaderMapItem[];
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export declare interface IMeasuresMapItem {
|
|
372
|
+
field: DataField;
|
|
373
|
+
subTotal: PivotSubtotalTypeEnum[];
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
export declare interface IMeasureTupleItem {
|
|
377
|
+
[DataFieldId: string]: PivotTuple;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export declare interface INodeSizeInfo {
|
|
381
|
+
/**
|
|
382
|
+
* The size of the item
|
|
383
|
+
*/
|
|
384
|
+
itemSize: number;
|
|
385
|
+
/**
|
|
386
|
+
* The size of the children item top total size
|
|
387
|
+
*/
|
|
388
|
+
topTotalSize: number;
|
|
389
|
+
/**
|
|
390
|
+
* The size of the children item bottom total size
|
|
391
|
+
*/
|
|
392
|
+
bottomTotalSize: number;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export declare interface IPageViewItemJSON extends IPivotViewItemJSON {
|
|
396
|
+
lastRow: number;
|
|
397
|
+
lastCol: number;
|
|
398
|
+
ranges: IPageViewItemRange[];
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export declare interface IPageViewItemRange {
|
|
402
|
+
row: number;
|
|
403
|
+
col: number;
|
|
404
|
+
rowCount: number;
|
|
405
|
+
colCount: number;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
export declare interface IPivotField {
|
|
409
|
+
id: string;
|
|
410
|
+
displayName: string;
|
|
411
|
+
subtotalType: PivotSubtotalTypeEnum;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
export declare interface IPivotLayoutCtx {
|
|
415
|
+
view: PivotView;
|
|
416
|
+
rowDeep: number;
|
|
417
|
+
colDeep: number;
|
|
418
|
+
rowNodeTree: NodeTree;
|
|
419
|
+
colNodeTree: NodeTree;
|
|
420
|
+
measureCount: number;
|
|
421
|
+
pageWrap: number;
|
|
422
|
+
pageOverThenDown: boolean;
|
|
423
|
+
queryData: IPivotTableQueryData;
|
|
424
|
+
isColMultiMeasure: boolean;
|
|
425
|
+
isRowMultiMeasure: boolean;
|
|
426
|
+
valueIndex: number;
|
|
427
|
+
valueQueryInfo: IPivotTableValueFieldQueryData[];
|
|
428
|
+
measuresMap: Record<string, IPivotTableValueFieldQueryData>;
|
|
429
|
+
colMap: Record<string, number>;
|
|
430
|
+
summaryManager: SummaryManager;
|
|
431
|
+
measureIndexesMap: Record<string, number>;
|
|
432
|
+
collapseInfo: Record<string, boolean | Record<string, boolean>>;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
export declare interface IPivotSummaryLevelPool {
|
|
436
|
+
[level: number]: IPivotSummaryLevelPoolItem[];
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
export declare interface IPivotSummaryLevelPoolItem {
|
|
440
|
+
v: number;
|
|
441
|
+
p: number;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export declare interface IPivotTableAddFieldChange {
|
|
445
|
+
type: PivotTableChangeTypeEnum.AddField;
|
|
446
|
+
fieldJson: IPivotTableValueFieldJSON | IPivotTableLabelFieldJSON;
|
|
447
|
+
area: PivotTableFiledAreaEnum;
|
|
448
|
+
index: number;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export declare type IPivotTableChangeSet = IPivotTableAddFieldChange | IPivotTableSetSubtotalTypeChange | IPivotTableRemoveFieldChange | IPivotTableRenameFieldChange | IPivotTableSetFilterInfoChange | IPivotTableSetSortInfoChange | IPivotTableUpdatePositionChange | IPivotTableUpdateValuePositionChange | IPivotTableSetOptionsChange | IPivotTableSetFormatChange | IPivotTableSetCollapseChange | IPivotUpdateSourceChange;
|
|
452
|
+
|
|
453
|
+
export declare interface IPivotTableCustomFilter {
|
|
454
|
+
type: PivotFilterTypeEnum.CustomFilter;
|
|
455
|
+
operator: ST_PivotFilterOperatorEnum;
|
|
456
|
+
expected: any;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
export declare type IPivotTableFilterInfo = IPivotTableManualFilter | IPivotTableCustomFilter | IPivotTableValueFilter;
|
|
460
|
+
|
|
461
|
+
export declare interface IPivotTableLabelFieldJSON {
|
|
462
|
+
dataFieldId: string;
|
|
463
|
+
id: string;
|
|
464
|
+
sourceName: string;
|
|
465
|
+
displayName: string;
|
|
466
|
+
format: string | undefined;
|
|
467
|
+
sortInfo?: IPivotTableSortInfo;
|
|
468
|
+
filterInfo?: IPivotTableFilterInfo;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Represents the query data for a label field in a pivot table.
|
|
473
|
+
*/
|
|
474
|
+
export declare interface IPivotTableLabelFieldQueryData {
|
|
475
|
+
/**
|
|
476
|
+
* The unique identifier of the label field.
|
|
477
|
+
*/
|
|
478
|
+
id: string;
|
|
479
|
+
/**
|
|
480
|
+
* The unique identifier of the data field associated with the label field.
|
|
481
|
+
*/
|
|
482
|
+
dataFieldId: string;
|
|
483
|
+
/**
|
|
484
|
+
* The display name of the label field.
|
|
485
|
+
*/
|
|
486
|
+
displayName: string;
|
|
487
|
+
/**
|
|
488
|
+
* Information about the filter applied to the label field.
|
|
489
|
+
*/
|
|
490
|
+
filterInfo?: IPivotTableFilterInfo;
|
|
491
|
+
/**
|
|
492
|
+
* Information about the sort applied to the label field.
|
|
493
|
+
*/
|
|
494
|
+
sortInfo: IPivotTableSortInfo;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
export declare interface IPivotTableLabelSortInfo {
|
|
498
|
+
type: PivotDataFieldSortOperatorEnum;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* Represents the Pivot Table Manual Filter info
|
|
503
|
+
*/
|
|
504
|
+
export declare interface IPivotTableManualFilter {
|
|
505
|
+
/**
|
|
506
|
+
* @property {PivotFilterTypeEnum} - The filter type.
|
|
507
|
+
*/
|
|
508
|
+
type: PivotFilterTypeEnum.ManualFilter;
|
|
509
|
+
/**
|
|
510
|
+
* @property {string[]} - The list of selected items.
|
|
511
|
+
*/
|
|
512
|
+
list: string[];
|
|
513
|
+
isAll?: boolean;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Represents the query data for a measure field in a pivot table.
|
|
518
|
+
*/
|
|
519
|
+
export declare interface IPivotTableMeasureData {
|
|
520
|
+
/**
|
|
521
|
+
* @property {IPivotTableLabelFieldQueryData[]} - The query data for the value fields.
|
|
522
|
+
*/
|
|
523
|
+
values: IPivotTableValueFieldQueryData[];
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Represents the data structure for a pivot table config, which is match CT_pivotTableDefinition
|
|
528
|
+
*/
|
|
529
|
+
export declare interface IPivotTableOptions {
|
|
530
|
+
/**
|
|
531
|
+
* The page wrap, it is the wrap of page, the page will wrap to next row when the wrapCursor is equal to pageWrap
|
|
532
|
+
*/
|
|
533
|
+
pageWrap?: number;
|
|
534
|
+
/**
|
|
535
|
+
* The page over then down, it is the layout of page, if the pageOverThenDown is true, the page will layout over then down, otherwise, the page will layout down then over
|
|
536
|
+
*/
|
|
537
|
+
pageOverThenDown?: boolean;
|
|
538
|
+
showColHeaders?: boolean;
|
|
539
|
+
showColStripes?: boolean;
|
|
540
|
+
showLastColumn?: boolean;
|
|
541
|
+
showRowHeaders?: boolean;
|
|
542
|
+
showRowStripes?: boolean;
|
|
543
|
+
/**
|
|
544
|
+
* use span in the pivot table header
|
|
545
|
+
*/
|
|
546
|
+
mergeItems?: boolean;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Represents the data structure for a pivot table query.
|
|
551
|
+
*/
|
|
552
|
+
export declare interface IPivotTableQueryData {
|
|
553
|
+
/**
|
|
554
|
+
* The query info of row fields in the pivot table.
|
|
555
|
+
*/
|
|
556
|
+
rowQueryInfo: IPivotTableLabelFieldQueryData[];
|
|
557
|
+
/**
|
|
558
|
+
* The query info of column fields in the pivot table.
|
|
559
|
+
*/
|
|
560
|
+
colQueryInfo: IPivotTableLabelFieldQueryData[];
|
|
561
|
+
/**
|
|
562
|
+
* The query info of filter fields in the pivot table.
|
|
563
|
+
*/
|
|
564
|
+
filterQueryInfo: IPivotTableLabelFieldQueryData[];
|
|
565
|
+
/**
|
|
566
|
+
* The query info of value fields in the pivot table.
|
|
567
|
+
*/
|
|
568
|
+
valueQueryInfo: IPivotTableValueFieldQueryData[];
|
|
569
|
+
/**
|
|
570
|
+
* The collapse state of the fields.
|
|
571
|
+
* @property {Record<string, boolean|Record<string, boolean>>} - The collapse state of the pivot table.
|
|
572
|
+
*/
|
|
573
|
+
collapseInfo: Record<string, boolean | Record<string, boolean>>;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
export declare interface IPivotTableRemoveFieldChange {
|
|
577
|
+
type: PivotTableChangeTypeEnum.RemoveField;
|
|
578
|
+
fieldId: string;
|
|
579
|
+
area: PivotTableFiledAreaEnum;
|
|
580
|
+
index: number;
|
|
581
|
+
fieldJson: IPivotTableValueFieldJSON | IPivotTableLabelFieldJSON;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
export declare interface IPivotTableRenameFieldChange {
|
|
585
|
+
type: PivotTableChangeTypeEnum.RenameField;
|
|
586
|
+
fieldId: string;
|
|
587
|
+
oldName: string;
|
|
588
|
+
newName: string;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
export declare interface IPivotTableSetCollapseChange {
|
|
592
|
+
type: PivotTableChangeTypeEnum.SetCollapse;
|
|
593
|
+
fieldId: string;
|
|
594
|
+
collapse: boolean;
|
|
595
|
+
item?: string;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export declare interface IPivotTableSetFilterInfoChange {
|
|
599
|
+
type: PivotTableChangeTypeEnum.SetFilterInfo;
|
|
600
|
+
fieldId: string;
|
|
601
|
+
oldFilterInfo: IPivotTableFilterInfo;
|
|
602
|
+
newFilterInfo: IPivotTableFilterInfo;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
export declare interface IPivotTableSetFormatChange {
|
|
606
|
+
type: PivotTableChangeTypeEnum.SetFieldFormat;
|
|
607
|
+
fieldId: string;
|
|
608
|
+
oldFormat: string | undefined;
|
|
609
|
+
newFormat: string | undefined;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
export declare interface IPivotTableSetOptionsChange {
|
|
613
|
+
type: PivotTableChangeTypeEnum.SetOptions;
|
|
614
|
+
oldOptions: IPivotTableOptions;
|
|
615
|
+
newOptions: IPivotTableOptions;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
export declare interface IPivotTableSetSortInfoChange {
|
|
619
|
+
type: PivotTableChangeTypeEnum.SetSortInfo;
|
|
620
|
+
fieldId: string;
|
|
621
|
+
oldSortInfo: IPivotTableSortInfo | undefined;
|
|
622
|
+
newSortInfo: IPivotTableSortInfo | undefined;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
export declare interface IPivotTableSetSubtotalTypeChange {
|
|
626
|
+
type: PivotTableChangeTypeEnum.SetSubtotalType;
|
|
627
|
+
fieldId: string;
|
|
628
|
+
newSubtotalType: PivotSubtotalTypeEnum;
|
|
629
|
+
oldSubtotalType: PivotSubtotalTypeEnum;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
export declare interface IPivotTableShowDataAsInfo {
|
|
633
|
+
type: PivotShowAsTypeEnum;
|
|
634
|
+
baseFieldId: string;
|
|
635
|
+
baseItem: string;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* Represents a snapshot of a pivot table.
|
|
640
|
+
*/
|
|
641
|
+
export declare interface IPivotTableSnapshot {
|
|
642
|
+
/**
|
|
643
|
+
* Represents the label fields in the pivot table.
|
|
644
|
+
*/
|
|
645
|
+
dimension: Record<string, IPivotTableLabelFieldJSON>;
|
|
646
|
+
/**
|
|
647
|
+
* Represents the value fields in the pivot table.
|
|
648
|
+
*/
|
|
649
|
+
measure: Record<string, IPivotTableValueFieldJSON>;
|
|
650
|
+
/**
|
|
651
|
+
* Represents the fields id used for grouping value in the pivot table.
|
|
652
|
+
*/
|
|
653
|
+
valueFields: string[];
|
|
654
|
+
/**
|
|
655
|
+
* Represents the fields id used for filtering in the pivot table.
|
|
656
|
+
*/
|
|
657
|
+
filterFields: string[];
|
|
658
|
+
/**
|
|
659
|
+
* Represents the fields id used for grouping rows in the pivot table.
|
|
660
|
+
*/
|
|
661
|
+
rowFields: string[];
|
|
662
|
+
/**
|
|
663
|
+
* Represents the fields id used for grouping columns in the pivot table.
|
|
664
|
+
*/
|
|
665
|
+
columnFields: string[];
|
|
666
|
+
/**
|
|
667
|
+
* Represents the fields id that are hidden in the pivot table.
|
|
668
|
+
*/
|
|
669
|
+
hiddenFields: string[];
|
|
670
|
+
/**
|
|
671
|
+
* Represents the special ΣValue fields order index in the dimension fields.
|
|
672
|
+
*/
|
|
673
|
+
valueIndex: number;
|
|
674
|
+
/**
|
|
675
|
+
* Represents the special ΣValue fields position in row or column area.
|
|
676
|
+
*/
|
|
677
|
+
valuePosition: PivotTableValuePositionEnum;
|
|
678
|
+
/**
|
|
679
|
+
* Represents the layout of the pivot table.
|
|
680
|
+
*/
|
|
681
|
+
layout: PivotLayoutTypeEnum;
|
|
682
|
+
/**
|
|
683
|
+
* Represents the collapse information of the pivot table.
|
|
684
|
+
*/
|
|
685
|
+
collapseInfo: Record<string, any>;
|
|
686
|
+
options: IPivotTableOptions;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
export declare type IPivotTableSortInfo = IPivotTableLabelSortInfo | IPivotTableValueSortInfo;
|
|
690
|
+
|
|
691
|
+
export declare interface IPivotTableUpdatePositionChange {
|
|
692
|
+
type: PivotTableChangeTypeEnum.UpdateFieldPosition;
|
|
693
|
+
fieldId: string;
|
|
694
|
+
oldArea: PivotTableFiledAreaEnum;
|
|
695
|
+
newArea: PivotTableFiledAreaEnum;
|
|
696
|
+
oldIndex: number;
|
|
697
|
+
newIndex: number;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
export declare interface IPivotTableUpdateValuePositionChange {
|
|
701
|
+
type: PivotTableChangeTypeEnum.UpdateValuePosition;
|
|
702
|
+
oldValuePosition: PivotTableValuePositionEnum;
|
|
703
|
+
newValuePosition: PivotTableValuePositionEnum;
|
|
704
|
+
oldIndex: number;
|
|
705
|
+
newIndex: number;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
export declare interface IPivotTableValueFieldJSON {
|
|
709
|
+
dataFieldId: string;
|
|
710
|
+
id: string;
|
|
711
|
+
sourceName: string;
|
|
712
|
+
displayName: string;
|
|
713
|
+
format: string | undefined;
|
|
714
|
+
subtotal: PivotSubtotalTypeEnum;
|
|
715
|
+
showDataAs: IPivotTableShowDataAsInfo;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Represents the query data for a value field in a pivot table.
|
|
720
|
+
*/
|
|
721
|
+
export declare interface IPivotTableValueFieldQueryData {
|
|
722
|
+
/**
|
|
723
|
+
* The unique identifier of the value field.
|
|
724
|
+
*/
|
|
725
|
+
id: string;
|
|
726
|
+
/**
|
|
727
|
+
* The unique identifier of the data field associated with the value field.
|
|
728
|
+
*/
|
|
729
|
+
dataFieldId: string;
|
|
730
|
+
/**
|
|
731
|
+
* The display name of the value field.
|
|
732
|
+
*/
|
|
733
|
+
displayName: string;
|
|
734
|
+
/**
|
|
735
|
+
* The type of subtotal to be displayed for this value field.
|
|
736
|
+
*/
|
|
737
|
+
subtotal: PivotSubtotalTypeEnum;
|
|
738
|
+
/**
|
|
739
|
+
* Information about how to show the data for this value field.
|
|
740
|
+
*/
|
|
741
|
+
showDataAs: IPivotTableShowDataAsInfo;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
export declare interface IPivotTableValueFilter {
|
|
745
|
+
type: PivotFilterTypeEnum.ValueFilter;
|
|
746
|
+
operator: ST_PivotFilterOperatorEnum;
|
|
747
|
+
expected: any;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
export declare interface IPivotTableValueSortInfo {
|
|
751
|
+
/**
|
|
752
|
+
* @property {PivotDataFieldSortOperatorEnum} - The sort operator of the field items.
|
|
753
|
+
*/
|
|
754
|
+
type: PivotDataFieldSortOperatorEnum;
|
|
755
|
+
/**
|
|
756
|
+
* @property {string} - The base field id of the field items to sort.
|
|
757
|
+
*/
|
|
758
|
+
baseFieldId: string;
|
|
759
|
+
/**
|
|
760
|
+
* @property {string[]} - The path list of field items to sort.
|
|
761
|
+
*/
|
|
762
|
+
sortItems: string[];
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* @description using Wefloder to store the pivot table data
|
|
767
|
+
* @typedef Tuple@typedef Tuple
|
|
768
|
+
* @property {number} sum - The sum of the values in the tuple.
|
|
769
|
+
* @property {number} count - The count of the values in the tuple.
|
|
770
|
+
* @property {number} countN - The count of the number values in the tuple.
|
|
771
|
+
* @property {number} product - The product of the values in the tuple.
|
|
772
|
+
* @property {number} min - The minimum value in the tuple.
|
|
773
|
+
* @property {number} max - The maximum value in the tuple.
|
|
774
|
+
* @property {number} squareSum - The sum of the squares of the values in the tuple.
|
|
775
|
+
*/
|
|
776
|
+
export declare interface IPivotTuple {
|
|
777
|
+
sum: number;
|
|
778
|
+
count: number;
|
|
779
|
+
countN: number;
|
|
780
|
+
product: number;
|
|
781
|
+
min: number;
|
|
782
|
+
max: number;
|
|
783
|
+
squareSum: number;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
export declare interface IPivotUpdateSourceChange {
|
|
787
|
+
type: PivotTableChangeTypeEnum.UpdateSource;
|
|
788
|
+
tableFieldId: string;
|
|
789
|
+
oldSourceName: string;
|
|
790
|
+
newSourceName: string;
|
|
791
|
+
oldDataFieldId: string;
|
|
792
|
+
newDataFieldId: string;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
export declare interface IPivotViewCellData {
|
|
796
|
+
v?: IPivotViewValueType;
|
|
797
|
+
s?: PivotCellStyleTypeEnum;
|
|
798
|
+
/**
|
|
799
|
+
* @description only for the pivot table page filter cell, the value is the page filter index
|
|
800
|
+
*/
|
|
801
|
+
i?: number;
|
|
802
|
+
/**
|
|
803
|
+
* means the cell is blank, the only value is 1
|
|
804
|
+
*/
|
|
805
|
+
t?: PivotViewCellValueTypeEnum;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
declare interface IPivotViewColData {
|
|
809
|
+
[col: number]: IPivotViewCellData;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
export declare interface IPivotViewErrorValue {
|
|
813
|
+
errorType: PivotErrorTypeEnum;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* Represents the pivot view info data structure, which is used to store row /col path and value index
|
|
818
|
+
*/
|
|
819
|
+
export declare interface IPivotViewInfo {
|
|
820
|
+
/**
|
|
821
|
+
* The pivot table field id
|
|
822
|
+
*/
|
|
823
|
+
tableFieldId: string;
|
|
824
|
+
/**
|
|
825
|
+
* The paths of the row/col
|
|
826
|
+
*/
|
|
827
|
+
paths: string[];
|
|
828
|
+
/**
|
|
829
|
+
* The value index of the row/col
|
|
830
|
+
*/
|
|
831
|
+
valueIndex: number;
|
|
832
|
+
/**
|
|
833
|
+
* is this row/col is bottom total, in excel, maybe has top total in outline layout
|
|
834
|
+
*/
|
|
835
|
+
isBottomTotal?: boolean;
|
|
836
|
+
/**
|
|
837
|
+
* the node level of row or col
|
|
838
|
+
*/
|
|
839
|
+
level: number;
|
|
840
|
+
/**
|
|
841
|
+
* only for col view, to match some node does not save in node tree
|
|
842
|
+
*/
|
|
843
|
+
colPathMap?: Record<string, number>;
|
|
844
|
+
/**
|
|
845
|
+
* the info is ΣValue
|
|
846
|
+
*/
|
|
847
|
+
isValue?: boolean;
|
|
848
|
+
/**
|
|
849
|
+
* the data field id
|
|
850
|
+
*/
|
|
851
|
+
dataFieldId?: string;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
export declare interface IPivotViewItemData {
|
|
855
|
+
[row: number]: IPivotViewColData;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
export declare interface IPivotViewItemJSON {
|
|
859
|
+
data: IPivotViewItemData;
|
|
860
|
+
info: IPivotViewInfo[];
|
|
861
|
+
rowCount: number;
|
|
862
|
+
colCount: number;
|
|
863
|
+
lastCol: number;
|
|
864
|
+
lastRow: number;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
export declare interface IPivotViewJSON {
|
|
868
|
+
pageView: IPageViewItemJSON;
|
|
869
|
+
rowView: ILabelViewItemJSON;
|
|
870
|
+
colView: ILabelViewItemJSON;
|
|
871
|
+
dataView: IPivotViewItemJSON;
|
|
872
|
+
cornerView: IPivotViewItemJSON;
|
|
873
|
+
version: number;
|
|
874
|
+
formatMap: Record<string, string>;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
export declare interface IPivotViewPrefixValue {
|
|
878
|
+
prefix: string;
|
|
879
|
+
value: string;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
export declare type IPivotViewValueType = number | string | undefined | IPivotViewErrorValue | IPivotViewPrefixValue;
|
|
883
|
+
|
|
884
|
+
export declare interface IRowNodeSizeInfo extends INodeSizeInfo {
|
|
885
|
+
valueIndex?: number;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* -judge the filter info is customFilter filter
|
|
890
|
+
* @param {IPivotTableFilterInfo} filterInfo - the dimension filter info
|
|
891
|
+
* @returns {boolean} return true if the filter info is custom filter
|
|
892
|
+
*/
|
|
893
|
+
export declare function isCustomFilter(filterInfo: IPivotTableFilterInfo): filterInfo is IPivotTableCustomFilter;
|
|
894
|
+
|
|
895
|
+
/**
|
|
896
|
+
* - judge the value is date like type
|
|
897
|
+
* @param {IDataFieldValue} value the date like value
|
|
898
|
+
* @returns {boolean} - return true if the value is date like type
|
|
899
|
+
*/
|
|
900
|
+
export declare function isDateValue(value: IDataFieldValue): value is IDateValue;
|
|
901
|
+
|
|
902
|
+
/**
|
|
903
|
+
* 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
|
|
904
|
+
* @param {IPivotViewValueType} value - the pivot view value
|
|
905
|
+
* @returns {boolean} the value is the error value
|
|
906
|
+
*/
|
|
907
|
+
export declare const isErrorValue: (value: IPivotViewValueType) => value is IPivotViewErrorValue;
|
|
908
|
+
|
|
909
|
+
/**
|
|
910
|
+
* -judge the filter info is manual filter
|
|
911
|
+
* @param {IPivotTableFilterInfo} filterInfo - the dimension filter info
|
|
912
|
+
* @returns {boolean} return true if the filter info is manual filter
|
|
913
|
+
*/
|
|
914
|
+
export declare function isManualFilter(filterInfo: IPivotTableFilterInfo): filterInfo is IPivotTableManualFilter;
|
|
915
|
+
|
|
916
|
+
/**
|
|
917
|
+
* 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
|
|
918
|
+
* @param {IPivotViewValueType} value the pivot view value
|
|
919
|
+
* @returns {boolean} the value is the prefix value
|
|
920
|
+
*/
|
|
921
|
+
export declare const isPrefixValue: (value: IPivotViewValueType) => value is IPivotViewPrefixValue;
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
* -judge the filter info is customFilter filter
|
|
925
|
+
* @param {IPivotTableFilterInfo} filterInfo - the dimension filter info
|
|
926
|
+
* @returns {boolean} return true if the filter info is custom filter
|
|
927
|
+
*/
|
|
928
|
+
export declare function isValueFilter(filterInfo: IPivotTableFilterInfo): filterInfo is IPivotTableCustomFilter;
|
|
929
|
+
|
|
930
|
+
export declare interface ITPivotTupleInfo {
|
|
931
|
+
sum: number;
|
|
932
|
+
count: number;
|
|
933
|
+
countN: number;
|
|
934
|
+
product: number;
|
|
935
|
+
min: number;
|
|
936
|
+
max: number;
|
|
937
|
+
squareSum: number;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
export declare interface ITupleItem {
|
|
941
|
+
path: string[];
|
|
942
|
+
types: PivotDataFieldDataTypeEnum[];
|
|
943
|
+
tuple: IMeasureTupleItem;
|
|
944
|
+
indexes: number[];
|
|
945
|
+
summary?: Record<string, ITupleItemSummary>;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
export declare type ITupleItemSummary = ITPivotTupleInfo & {
|
|
949
|
+
[subtotalType in PivotSubtotalTypeEnum]?: number | {
|
|
950
|
+
errorType: PivotErrorTypeEnum;
|
|
951
|
+
};
|
|
952
|
+
};
|
|
953
|
+
|
|
954
|
+
export declare class LabelViewItem extends PivotViewItem {
|
|
955
|
+
/**
|
|
956
|
+
* this property is used to store the header map of the label view
|
|
957
|
+
* - 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
|
|
958
|
+
* - 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
|
|
959
|
+
*/
|
|
960
|
+
headerMap: ILabelViewHeaderMapItem[];
|
|
961
|
+
addHeaderMapItem(index: number, item: ILabelViewHeaderMapItem): void;
|
|
962
|
+
getHeaderMapItem(index: number): ILabelViewHeaderMapItem;
|
|
963
|
+
toJSON(): ILabelViewItemJSON;
|
|
964
|
+
fromJSON(json: ILabelViewItemJSON): void;
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
declare class NodeTree {
|
|
968
|
+
/**
|
|
969
|
+
* @property {number} index - The id of the node tree.which is the index of summary-manager tuples
|
|
970
|
+
*/
|
|
971
|
+
private readonly _index;
|
|
972
|
+
/**
|
|
973
|
+
* @property {number} level - The level of the node tree. the root level is 0.
|
|
974
|
+
*/
|
|
975
|
+
private _level;
|
|
976
|
+
/**
|
|
977
|
+
* @property {number} parentIndex - The parent index of the node tree. the root node parent index is -1.
|
|
978
|
+
*/
|
|
979
|
+
parentIndex: number;
|
|
980
|
+
paths: string[];
|
|
981
|
+
isLeaf: boolean;
|
|
982
|
+
/**
|
|
983
|
+
* @property {string} name - The name of the node tree.
|
|
984
|
+
*/
|
|
985
|
+
name: string;
|
|
986
|
+
fieldId: string;
|
|
987
|
+
collapse: boolean;
|
|
988
|
+
sortedList: string[];
|
|
989
|
+
hasSort: boolean;
|
|
990
|
+
/**
|
|
991
|
+
* - the data type of the node tree.
|
|
992
|
+
*/
|
|
993
|
+
type: PivotDataFieldDataTypeEnum;
|
|
994
|
+
private _nodes;
|
|
995
|
+
constructor(index: number, fieldId: string, type: PivotDataFieldDataTypeEnum);
|
|
996
|
+
getCollapse(): boolean;
|
|
997
|
+
setCollapse(collapse: boolean): void;
|
|
998
|
+
getFieldsId(): string;
|
|
999
|
+
iterate(callback: (node: NodeTree) => void): void;
|
|
1000
|
+
getIndex(): number;
|
|
1001
|
+
hasNode(path: string): boolean;
|
|
1002
|
+
setParentIndex(parentIndex: number): void;
|
|
1003
|
+
setLevel(level: number): void;
|
|
1004
|
+
getLevel(): number;
|
|
1005
|
+
setPaths(paths: string[]): void;
|
|
1006
|
+
getPaths(): string[];
|
|
1007
|
+
setLeaf(): void;
|
|
1008
|
+
getIsLeaf(): boolean;
|
|
1009
|
+
setName(name: string): void;
|
|
1010
|
+
addNode(node: NodeTree, path: string, sortMap: Record<string, number> | undefined, isAsc: boolean): void;
|
|
1011
|
+
sortNode(path: string, sortedMap: Record<string, number>, isAsc: boolean): void;
|
|
1012
|
+
getNode(path: string): NodeTree | undefined;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
export declare class PageViewItem extends PivotViewItem {
|
|
1016
|
+
/**
|
|
1017
|
+
* the range group of the page view, all range is base on the left top of the page view
|
|
1018
|
+
*/
|
|
1019
|
+
ranges: IPageViewItemRange[];
|
|
1020
|
+
/**
|
|
1021
|
+
* the last col index of the page view
|
|
1022
|
+
*/
|
|
1023
|
+
lastCol: number;
|
|
1024
|
+
/**
|
|
1025
|
+
* the last row index of the page view
|
|
1026
|
+
*/
|
|
1027
|
+
lastRow: number;
|
|
1028
|
+
setPageIndex(row: number, col: number, index: number): void;
|
|
1029
|
+
addRange(range: IPageViewItemRange): void;
|
|
1030
|
+
getRanges(): IPageViewItemRange[];
|
|
1031
|
+
setLastCol(col: number): void;
|
|
1032
|
+
setLastRow(row: number): void;
|
|
1033
|
+
getLastCol(): number;
|
|
1034
|
+
getLastRow(): number;
|
|
1035
|
+
toJSON(): IPageViewItemJSON;
|
|
1036
|
+
fromJSON(json: IPageViewItemJSON): void;
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* Represents the pivot cell style type enum
|
|
1041
|
+
*/
|
|
1042
|
+
export declare enum PivotCellStyleTypeEnum {
|
|
1043
|
+
/**
|
|
1044
|
+
* the pivot table page filter selected all
|
|
1045
|
+
*/
|
|
1046
|
+
FilterAll = 1,
|
|
1047
|
+
/**
|
|
1048
|
+
* the pivot table page filter selected partial
|
|
1049
|
+
*/
|
|
1050
|
+
FilterPartial = 2,
|
|
1051
|
+
/**
|
|
1052
|
+
* the pivot table page filter selected one
|
|
1053
|
+
*/
|
|
1054
|
+
FilterSingle = 3,
|
|
1055
|
+
/**
|
|
1056
|
+
* the pivot table area cell is blank
|
|
1057
|
+
*/
|
|
1058
|
+
BlankValue = 4,
|
|
1059
|
+
/**
|
|
1060
|
+
* the pivot table dimension cell has filter but not sort
|
|
1061
|
+
*/
|
|
1062
|
+
FilteredSortNone = 5,
|
|
1063
|
+
/**
|
|
1064
|
+
* the pivot table dimension cell has filter and sort asc
|
|
1065
|
+
*/
|
|
1066
|
+
FilteredSortAsc = 6,
|
|
1067
|
+
/**
|
|
1068
|
+
* the pivot table dimension cell has filter and sort desc
|
|
1069
|
+
*/
|
|
1070
|
+
FilteredSortDesc = 7,
|
|
1071
|
+
/**
|
|
1072
|
+
* the pivot table dimension cell has no filter and sort
|
|
1073
|
+
*/
|
|
1074
|
+
FilterNoneSortNone = 8,
|
|
1075
|
+
/**
|
|
1076
|
+
* the pivot table dimension cell has no filter and sort asc
|
|
1077
|
+
*/
|
|
1078
|
+
FilterNoneSortAsc = 9,
|
|
1079
|
+
/**
|
|
1080
|
+
* the pivot table dimension cell has no filter and sort desc
|
|
1081
|
+
*/
|
|
1082
|
+
FilterNoneSortDesc = 10,
|
|
1083
|
+
/**
|
|
1084
|
+
* the branch node of tree can be collapse
|
|
1085
|
+
*/
|
|
1086
|
+
Collapse = 11,
|
|
1087
|
+
/**
|
|
1088
|
+
* the branch node of tree can be expand
|
|
1089
|
+
*/
|
|
1090
|
+
Expand = 12,
|
|
1091
|
+
/**
|
|
1092
|
+
* the subtotal cell, the real value should be `${value} Total` or `${value} 汇总`
|
|
1093
|
+
*/
|
|
1094
|
+
Subtotal = 13,
|
|
1095
|
+
/**
|
|
1096
|
+
* the grand total cell, the value template should be `GrandTotal` or `总计`
|
|
1097
|
+
*/
|
|
1098
|
+
GrandTotal = 14,
|
|
1099
|
+
/**
|
|
1100
|
+
* the grandtotal has more than oen value, the real value should be `Total ${value}` or `总计 ${value}`
|
|
1101
|
+
*/
|
|
1102
|
+
MultipleGrandTotal = 15
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
/**
|
|
1106
|
+
* Enum for pivot table data field types.
|
|
1107
|
+
* @readonly
|
|
1108
|
+
* @enum {number}
|
|
1109
|
+
*/
|
|
1110
|
+
export declare enum PivotDataFieldDataTypeEnum {
|
|
1111
|
+
/**
|
|
1112
|
+
*the string data type
|
|
1113
|
+
*/
|
|
1114
|
+
text = 1,
|
|
1115
|
+
/**
|
|
1116
|
+
* the number data type
|
|
1117
|
+
*/
|
|
1118
|
+
number = 2,
|
|
1119
|
+
/**
|
|
1120
|
+
* the boolean data type
|
|
1121
|
+
*/
|
|
1122
|
+
boolean = 3,
|
|
1123
|
+
/**
|
|
1124
|
+
* the date data type
|
|
1125
|
+
*/
|
|
1126
|
+
date = 4,
|
|
1127
|
+
/**
|
|
1128
|
+
* the blank data type
|
|
1129
|
+
*/
|
|
1130
|
+
blank = 5
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
/**
|
|
1134
|
+
* Enum for pivot table data field sort types.
|
|
1135
|
+
* @readonly
|
|
1136
|
+
* @enum {number}
|
|
1137
|
+
* @property {number} ascending - the ascending sort
|
|
1138
|
+
* @property {number} descending - the descending sort
|
|
1139
|
+
* @property {number} manual - the manual sort
|
|
1140
|
+
*/
|
|
1141
|
+
export declare enum PivotDataFieldSortOperatorEnum {
|
|
1142
|
+
/**
|
|
1143
|
+
* - the ascending sort
|
|
1144
|
+
*/
|
|
1145
|
+
ascending = 1,
|
|
1146
|
+
/**
|
|
1147
|
+
* - the descending sort
|
|
1148
|
+
*/
|
|
1149
|
+
descending = 2
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
/**
|
|
1153
|
+
* Represents the sort types for pivot data fields.
|
|
1154
|
+
*/
|
|
1155
|
+
export declare enum PivotDataFieldSortTypeEnum {
|
|
1156
|
+
/**
|
|
1157
|
+
* Sorts by the value of the data field.
|
|
1158
|
+
*/
|
|
1159
|
+
value = 1,
|
|
1160
|
+
/**
|
|
1161
|
+
* Sorts by the field name of the data field.
|
|
1162
|
+
*/
|
|
1163
|
+
field = 2
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
/**
|
|
1167
|
+
* Enum for pivot table error types.
|
|
1168
|
+
* @description those error types almost occur in the pivot table show data as calculation.
|
|
1169
|
+
*/
|
|
1170
|
+
export declare enum PivotErrorTypeEnum {
|
|
1171
|
+
/**
|
|
1172
|
+
* #DIV/0! - the divide by zero error
|
|
1173
|
+
*/
|
|
1174
|
+
Div0 = 1,
|
|
1175
|
+
/**
|
|
1176
|
+
* #N/A - the not available error
|
|
1177
|
+
*/
|
|
1178
|
+
NotNumber = 2,
|
|
1179
|
+
/**
|
|
1180
|
+
* #NAME! - The error occurs when a function is used incorrectly in a formula.
|
|
1181
|
+
*/
|
|
1182
|
+
NotFunction = 3,
|
|
1183
|
+
/**
|
|
1184
|
+
* #NAME? error, The error occurs a function not defined in the workbook.
|
|
1185
|
+
*/
|
|
1186
|
+
NotName = 4,
|
|
1187
|
+
/**
|
|
1188
|
+
* #REF! - the reference error , The error occurs when a cell reference is not valid.
|
|
1189
|
+
*/
|
|
1190
|
+
BadReference = 5
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
/**
|
|
1194
|
+
* Enum for pivot table data field types.
|
|
1195
|
+
* @readonly
|
|
1196
|
+
* @enum {number}
|
|
1197
|
+
*/
|
|
1198
|
+
export declare enum PivotFilterTypeEnum {
|
|
1199
|
+
/**
|
|
1200
|
+
* the label filter
|
|
1201
|
+
*/
|
|
1202
|
+
CustomFilter = 1,
|
|
1203
|
+
/**
|
|
1204
|
+
* - the value filter
|
|
1205
|
+
*/
|
|
1206
|
+
ValueFilter = 2,
|
|
1207
|
+
/**
|
|
1208
|
+
*- the manual filter
|
|
1209
|
+
*/
|
|
1210
|
+
ManualFilter = 3
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* Enum for pivot table layout types.
|
|
1215
|
+
* @readonly
|
|
1216
|
+
* @enum {number}
|
|
1217
|
+
*/
|
|
1218
|
+
export declare enum PivotLayoutTypeEnum {
|
|
1219
|
+
/**
|
|
1220
|
+
* @property {number} compact - the compact layout
|
|
1221
|
+
*/
|
|
1222
|
+
compact = 1,
|
|
1223
|
+
/**
|
|
1224
|
+
* @property {number} outline - the outline layout
|
|
1225
|
+
*/
|
|
1226
|
+
outline = 2,
|
|
1227
|
+
/**
|
|
1228
|
+
* @property {number} tabular - the tabular layout
|
|
1229
|
+
*/
|
|
1230
|
+
tabular = 3
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
/**
|
|
1234
|
+
* @class PivotModel represents a config model for a pivot table.
|
|
1235
|
+
* @description The pivot model is a class that stores the pivot table's configuration information.
|
|
1236
|
+
* @typedef PivotModel@typedef PivotModel
|
|
1237
|
+
* @property {string[]} rowFields - An array of row fields id.
|
|
1238
|
+
* @property {string[]} columnFields - An array of column fields id.
|
|
1239
|
+
* @property {string[]} valueFields - An array of value fields id.
|
|
1240
|
+
* @property {string[]} filterFields - An array of filter fields id.
|
|
1241
|
+
* @property {string[]} hiddenFields - An array of hidden fields id.
|
|
1242
|
+
* @property {Record<string, PivotTableLabelField>} dimension - A object of dimension fields, which key is the field id and value is the field.
|
|
1243
|
+
* @property {Record<string, PivotTableValueField>} measure - A object of measure fields, which key is the field id and value is the field.
|
|
1244
|
+
* @property {number} valueIndex - The special ΣValue fields order index in the dimension fields
|
|
1245
|
+
* @property {PivotTableValuePositionEnum} valuePosition - The special ΣValue fields position in row or column area.
|
|
1246
|
+
* @property {PivotLayoutTypeEnum} layout - The layout type of the pivot table.
|
|
1247
|
+
* @property {Record<string, any>} collapseInfo - The collapse information of the pivot table. Which data structure is {fieldId: boolean | {item: boolean}}
|
|
1248
|
+
*/
|
|
1249
|
+
export declare class PivotModel {
|
|
1250
|
+
/**
|
|
1251
|
+
*@property An array of row fields id.
|
|
1252
|
+
*/
|
|
1253
|
+
rowFields: string[];
|
|
1254
|
+
/**
|
|
1255
|
+
*@property An array of column fields id.
|
|
1256
|
+
*/
|
|
1257
|
+
columnFields: string[];
|
|
1258
|
+
/**
|
|
1259
|
+
*@property An array of value fields id.
|
|
1260
|
+
*/
|
|
1261
|
+
valueFields: string[];
|
|
1262
|
+
/**
|
|
1263
|
+
*@property An array of filter fields id.
|
|
1264
|
+
*/
|
|
1265
|
+
filterFields: string[];
|
|
1266
|
+
/**
|
|
1267
|
+
*@property An array of hidden fields id.
|
|
1268
|
+
*/
|
|
1269
|
+
hiddenFields: string[];
|
|
1270
|
+
/**
|
|
1271
|
+
*@property An array of dimension fields.
|
|
1272
|
+
*/
|
|
1273
|
+
dimension: Record<string, PivotTableLabelField>;
|
|
1274
|
+
/**
|
|
1275
|
+
*@property An array of measure fields.
|
|
1276
|
+
*/
|
|
1277
|
+
measure: Record<string, PivotTableValueField>;
|
|
1278
|
+
/**
|
|
1279
|
+
*@property The special ΣValue fields order index in the dimension fields.
|
|
1280
|
+
*@description The special ΣValue fields order index in the dimension fields, the index value is equal to the index of the field in the row or column area which the ΣValue field followed.
|
|
1281
|
+
*/
|
|
1282
|
+
valueIndex: number;
|
|
1283
|
+
/**
|
|
1284
|
+
*@property The special ΣValue fields position in row or column area.
|
|
1285
|
+
*/
|
|
1286
|
+
valuePosition: PivotTableValuePositionEnum;
|
|
1287
|
+
/**
|
|
1288
|
+
*@property The layout type of the pivot table.
|
|
1289
|
+
*/
|
|
1290
|
+
layout: PivotLayoutTypeEnum;
|
|
1291
|
+
/**
|
|
1292
|
+
* @property The collapse information of the pivot table.
|
|
1293
|
+
*/
|
|
1294
|
+
collapseInfo: Record<string, boolean | Record<string, boolean>>;
|
|
1295
|
+
/**
|
|
1296
|
+
* Creates an instance of PivotModel.
|
|
1297
|
+
*/
|
|
1298
|
+
options: IPivotTableOptions;
|
|
1299
|
+
_changeStack: IPivotTableChangeSet[];
|
|
1300
|
+
/**
|
|
1301
|
+
* the dirty status is used to flag the pivot table need to be queried data from the data source or just use cached tuple data.
|
|
1302
|
+
*/
|
|
1303
|
+
private _isDirty;
|
|
1304
|
+
constructor();
|
|
1305
|
+
startChangeStack(): void;
|
|
1306
|
+
endChangeStack(): IPivotTableChangeSet[];
|
|
1307
|
+
/**
|
|
1308
|
+
* - set a dirty status to flag the pivot table whether it is changed.
|
|
1309
|
+
* @param {boolean} dirty
|
|
1310
|
+
*/
|
|
1311
|
+
setDirty(dirty: boolean): void;
|
|
1312
|
+
/**
|
|
1313
|
+
* - get the dirty status of the pivot table.
|
|
1314
|
+
* @returns {boolean} - The dirty status of the pivot table.
|
|
1315
|
+
*/
|
|
1316
|
+
getDirty(): boolean;
|
|
1317
|
+
/**
|
|
1318
|
+
* - Set the options of the pivot table.
|
|
1319
|
+
* @param {IPivotTableOptions} options - The options to be set.
|
|
1320
|
+
* @returns {void}
|
|
1321
|
+
*/
|
|
1322
|
+
setOptions(options: IPivotTableOptions): void;
|
|
1323
|
+
/**
|
|
1324
|
+
* - Get the options of the pivot table. It is a copy of the options.
|
|
1325
|
+
* @returns {IPivotTableOptions} - The options of the pivot table.
|
|
1326
|
+
*/
|
|
1327
|
+
getOptions(): IPivotTableOptions;
|
|
1328
|
+
/**
|
|
1329
|
+
* @description Set the collapse status of the field. Those properties are used to save the collapse status of the field in the pivot table.
|
|
1330
|
+
* @param {string} fieldId - The id of the field.
|
|
1331
|
+
* @param {boolean} collapse - The collapse status of the field.
|
|
1332
|
+
* @param {string} [item] - The item of the field.
|
|
1333
|
+
*/
|
|
1334
|
+
setCollapse(fieldId: string, collapse: boolean, item?: string): void;
|
|
1335
|
+
setFilterInfo(fieldId: string, filterInfo: IPivotTableFilterInfo): void;
|
|
1336
|
+
getFieldFormat(fieldId: string): string | undefined;
|
|
1337
|
+
setFieldFormat(fieldId: string, format: string | undefined): void;
|
|
1338
|
+
setSortInfo(fieldId: string, sortInfo: IPivotTableSortInfo | undefined): void;
|
|
1339
|
+
getSortInfo(fieldId: string): IPivotTableSortInfo | undefined;
|
|
1340
|
+
getFilterInfo(fieldId: string): IPivotTableFilterInfo | undefined;
|
|
1341
|
+
iterateField(callback: (field: PivotTableLabelField | PivotTableValueField) => void): void;
|
|
1342
|
+
iterateFieldDim(callback: (field: PivotTableLabelField) => void): void;
|
|
1343
|
+
iterateFieldMeasure(callback: (field: PivotTableValueField) => void): void;
|
|
1344
|
+
iterateFieldByArea(area: PivotTableFiledAreaEnum, callback: (field: PivotTableLabelField | PivotTableValueField) => void): void;
|
|
1345
|
+
/**
|
|
1346
|
+
* @description Add a field to the pivot table.
|
|
1347
|
+
* @param {PivotTableLabelField | PivotTableValueField} field -the field to be added.
|
|
1348
|
+
* @param {PivotTableFiledAreaEnum} area -The area to add the field.
|
|
1349
|
+
* @param {number} index - The index of the field in the area.
|
|
1350
|
+
*/
|
|
1351
|
+
addField(field: PivotTableLabelField | PivotTableValueField, area: PivotTableFiledAreaEnum, index?: number): void;
|
|
1352
|
+
/**
|
|
1353
|
+
* @description Get where the field bo be position info by field id.
|
|
1354
|
+
* @param {string} fieldId - The id of the field.
|
|
1355
|
+
* @typedef PositionInfo@typedef PositionInfo
|
|
1356
|
+
* @property {PivotTableFiledAreaEnum} area - The area of the field.
|
|
1357
|
+
* @property {number} index - The index of the field in the area.
|
|
1358
|
+
* @returns PositionInfo - The position info of the field. if the field is not in the pivot table, the area will be undefined and the index will be -1.
|
|
1359
|
+
*/
|
|
1360
|
+
getFieldPositionInfoById(fieldId: string): {
|
|
1361
|
+
area: PivotTableFiledAreaEnum | undefined;
|
|
1362
|
+
index: number;
|
|
1363
|
+
};
|
|
1364
|
+
updateFieldSourceInfo(fieldId: string, sourceName: string, dataFieldId: string): void;
|
|
1365
|
+
getFieldsAreaByType(type: PivotTableFiledAreaEnum): string[];
|
|
1366
|
+
getFieldById(fieldId: string): PivotTableLabelField | PivotTableValueField | undefined;
|
|
1367
|
+
isExistFieldName(fieldName: string): boolean;
|
|
1368
|
+
/**
|
|
1369
|
+
* @description Rename a field in the pivot table.
|
|
1370
|
+
* @param {string} fieldId - The id of the field to be renamed.
|
|
1371
|
+
* @param displayName - The new display name of the field.
|
|
1372
|
+
* @returns {void}
|
|
1373
|
+
*/
|
|
1374
|
+
renameField(fieldId: string, displayName: string): void;
|
|
1375
|
+
/**
|
|
1376
|
+
* @description Remove a field from the pivot table by the field id.
|
|
1377
|
+
* @param {string} fieldId - The id of the field to be removed.
|
|
1378
|
+
* @returns {void} -void
|
|
1379
|
+
*/
|
|
1380
|
+
removeField(fieldId: string): void;
|
|
1381
|
+
updateFieldPosition(fieldId: string, area: PivotTableFiledAreaEnum, index: number): void;
|
|
1382
|
+
/**
|
|
1383
|
+
* - Update the value position of the pivot table.
|
|
1384
|
+
* @param valuePosition
|
|
1385
|
+
* @param valueIndex
|
|
1386
|
+
*/
|
|
1387
|
+
updateValuePosition(valuePosition: PivotTableValuePositionEnum, valueIndex: number): void;
|
|
1388
|
+
/**
|
|
1389
|
+
* - The special ΣValue fields order index in the dimension fields
|
|
1390
|
+
* @returns {number} the index
|
|
1391
|
+
*/
|
|
1392
|
+
getValueIndex(): number;
|
|
1393
|
+
getValuePosition(): PivotTableValuePositionEnum;
|
|
1394
|
+
/**
|
|
1395
|
+
* - Whether the pivot table has the special ΣValue fields in column area.
|
|
1396
|
+
* @returns {boolean} - has or not.
|
|
1397
|
+
*/
|
|
1398
|
+
isColMultiMeasure(): boolean;
|
|
1399
|
+
/**
|
|
1400
|
+
* - Whether the pivot table has the special ΣValue fields in row area.
|
|
1401
|
+
* @returns {boolean} - has or not.
|
|
1402
|
+
*/
|
|
1403
|
+
isRowMultiMeasure(): boolean;
|
|
1404
|
+
isEmpty(): boolean;
|
|
1405
|
+
/**
|
|
1406
|
+
* - set or update a field's subtotal type. , the table field must in the value area.
|
|
1407
|
+
* @param {string} tableFieldId - The id of the pivot table field.
|
|
1408
|
+
* @param {PivotSubtotalTypeEnum} subtotal - The subtotal type.
|
|
1409
|
+
*/
|
|
1410
|
+
setSubtotalType(tableFieldId: string, subtotal: PivotSubtotalTypeEnum): void;
|
|
1411
|
+
/**
|
|
1412
|
+
* Represents the query data of the pivot table.Which is used to query the data from the data collection.
|
|
1413
|
+
* @returns {IPivotTableQueryData} - The query data of the pivot table.
|
|
1414
|
+
*/
|
|
1415
|
+
getQueryData(): IPivotTableQueryData;
|
|
1416
|
+
fromJSON(data: IPivotTableSnapshot): void;
|
|
1417
|
+
toJSON(): IPivotTableSnapshot;
|
|
1418
|
+
cloneBufferModel(): PivotModel;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
/**
|
|
1422
|
+
* Enum for pivot table show as types.
|
|
1423
|
+
* @readonly
|
|
1424
|
+
* @enum {number}
|
|
1425
|
+
*/
|
|
1426
|
+
export declare enum PivotShowAsTypeEnum {
|
|
1427
|
+
/**
|
|
1428
|
+
* - the normal value
|
|
1429
|
+
*/
|
|
1430
|
+
normal = 1,
|
|
1431
|
+
/**
|
|
1432
|
+
* - the value as a percentage of the column total
|
|
1433
|
+
*/
|
|
1434
|
+
percentOfColumnTotal = 2,
|
|
1435
|
+
/**
|
|
1436
|
+
* - the value as a percentage of the row total
|
|
1437
|
+
*/
|
|
1438
|
+
percentOfRowTotal = 3,
|
|
1439
|
+
/**
|
|
1440
|
+
* - the value as a percentage of the grand total
|
|
1441
|
+
*/
|
|
1442
|
+
percentOfGrandTotal = 4,
|
|
1443
|
+
/**
|
|
1444
|
+
* - the value as a percentage of the parent column total
|
|
1445
|
+
*/
|
|
1446
|
+
percentOfParentColumnTotal = 5,
|
|
1447
|
+
/**
|
|
1448
|
+
* - the value as a percentage of the parent row total
|
|
1449
|
+
*/
|
|
1450
|
+
percentOfParentRowTotal = 6,
|
|
1451
|
+
/**
|
|
1452
|
+
* - the value as a percentage of the parent grand total
|
|
1453
|
+
*/
|
|
1454
|
+
percentOfParentGrandTotal = 7,
|
|
1455
|
+
/**
|
|
1456
|
+
* - the index of the value
|
|
1457
|
+
*/
|
|
1458
|
+
index = 8,
|
|
1459
|
+
/**
|
|
1460
|
+
* - the difference from the value
|
|
1461
|
+
*/
|
|
1462
|
+
differenceFrom = 9,
|
|
1463
|
+
/**
|
|
1464
|
+
* - the percentage difference from the value
|
|
1465
|
+
*/
|
|
1466
|
+
percentDifferenceFrom = 10,
|
|
1467
|
+
/**
|
|
1468
|
+
* - the running total of the value
|
|
1469
|
+
*/
|
|
1470
|
+
runningTotal = 11,
|
|
1471
|
+
/**
|
|
1472
|
+
* - the percentage running total of the value
|
|
1473
|
+
*/
|
|
1474
|
+
percentRunningTotal = 12,
|
|
1475
|
+
/**
|
|
1476
|
+
*- the percentage of the value
|
|
1477
|
+
*/
|
|
1478
|
+
percentOf = 13,
|
|
1479
|
+
/**
|
|
1480
|
+
* - the percentage of the parent value
|
|
1481
|
+
*/
|
|
1482
|
+
percentOfParent = 14
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
/**
|
|
1486
|
+
*Enum for pivot table subtotal types.
|
|
1487
|
+
@readonly
|
|
1488
|
+
@enum {number}
|
|
1489
|
+
*/
|
|
1490
|
+
export declare enum PivotSubtotalTypeEnum {
|
|
1491
|
+
/**
|
|
1492
|
+
*- the average of the values
|
|
1493
|
+
*/
|
|
1494
|
+
average = 1,
|
|
1495
|
+
/**
|
|
1496
|
+
*- the count of the values
|
|
1497
|
+
*/
|
|
1498
|
+
count = 2,
|
|
1499
|
+
/**
|
|
1500
|
+
*- the count of the numbers in the values
|
|
1501
|
+
*/
|
|
1502
|
+
countNums = 3,
|
|
1503
|
+
/**
|
|
1504
|
+
*- the maximum value in the values
|
|
1505
|
+
*/
|
|
1506
|
+
max = 4,
|
|
1507
|
+
/**
|
|
1508
|
+
*- the minimum value in the values
|
|
1509
|
+
*/
|
|
1510
|
+
min = 5,
|
|
1511
|
+
/**
|
|
1512
|
+
*- the product of the values
|
|
1513
|
+
*/
|
|
1514
|
+
product = 6,
|
|
1515
|
+
/**
|
|
1516
|
+
*- the standard deviation of the values
|
|
1517
|
+
*/
|
|
1518
|
+
stdDev = 7,
|
|
1519
|
+
/**
|
|
1520
|
+
*- the population standard deviation of the values
|
|
1521
|
+
*/
|
|
1522
|
+
stdDevp = 8,
|
|
1523
|
+
/**
|
|
1524
|
+
*- the sum of the values
|
|
1525
|
+
*/
|
|
1526
|
+
sum = 9,
|
|
1527
|
+
/**
|
|
1528
|
+
*- the variance of the values
|
|
1529
|
+
*/
|
|
1530
|
+
var = 10,
|
|
1531
|
+
/**
|
|
1532
|
+
*- the population variance of the values
|
|
1533
|
+
*/
|
|
1534
|
+
varp = 11
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
/**
|
|
1538
|
+
* @class PivotTable - represents the wrapper class pivot table.
|
|
1539
|
+
* @description The pivot table is a wrapper class which references the data fields collection and pivot table model.
|
|
1540
|
+
* @implements IPivotTable
|
|
1541
|
+
*/
|
|
1542
|
+
export declare class PivotTable {
|
|
1543
|
+
dataFieldsCollection: FieldsCollection;
|
|
1544
|
+
private _viewVersion;
|
|
1545
|
+
private _model;
|
|
1546
|
+
_bufferModel: PivotModel;
|
|
1547
|
+
private _tupleGroupCache;
|
|
1548
|
+
constructor(dataFieldsCollection: FieldsCollection, model?: PivotModel);
|
|
1549
|
+
updateDataFieldsCollection(dataFieldsCollection: FieldsCollection): void;
|
|
1550
|
+
private _getModel;
|
|
1551
|
+
startCollectChangeset(): void;
|
|
1552
|
+
endCollectChangeset(): IPivotTableChangeSet[];
|
|
1553
|
+
_generateModel(): void;
|
|
1554
|
+
createLabelFieldByDataFieldId(dataFieldId: string, tableName?: string): PivotTableLabelField | undefined;
|
|
1555
|
+
createValueFieldByDataFieldId(dataFieldId: string): PivotTableValueField | undefined;
|
|
1556
|
+
updateValuePosition(valuePosition: PivotTableValuePositionEnum, valueIndex: number): void;
|
|
1557
|
+
isColMultiMeasure(): boolean;
|
|
1558
|
+
isRowMultiMeasure(): boolean;
|
|
1559
|
+
/**
|
|
1560
|
+
* get the order index of ΣValue in row or col
|
|
1561
|
+
* @returns {number} -1 means not exist, otherwise the index of the ΣValue
|
|
1562
|
+
*/
|
|
1563
|
+
getValueIndex(): number;
|
|
1564
|
+
/**
|
|
1565
|
+
* - get the value position
|
|
1566
|
+
* @returns {PivotTableValuePositionEnum} the value position, only row or column
|
|
1567
|
+
*/
|
|
1568
|
+
getValuePosition(): PivotTableValuePositionEnum;
|
|
1569
|
+
/**
|
|
1570
|
+
* - iterate all pivot table fields
|
|
1571
|
+
* @param {(field: PivotTableLabelField | PivotTableValueField) => void} callback the callback function
|
|
1572
|
+
*/
|
|
1573
|
+
iterateField(callback: (field: PivotTableLabelField | PivotTableValueField) => void): void;
|
|
1574
|
+
/**
|
|
1575
|
+
* - iterate the dimension field, it means all the label fields
|
|
1576
|
+
* @param {(field: PivotTableLabelField | PivotTableValueField) => void} callback the callback function
|
|
1577
|
+
*/
|
|
1578
|
+
iterateFieldDim(callback: (field: PivotTableLabelField) => void): void;
|
|
1579
|
+
/**
|
|
1580
|
+
* - iterate the field by the area
|
|
1581
|
+
* @param {PivotTableFiledAreaEnum} area the area of the field enum
|
|
1582
|
+
* @param {(field: PivotTableLabelField | PivotTableValueField) => void} callback the callback function
|
|
1583
|
+
*/
|
|
1584
|
+
iterateFieldByArea(area: PivotTableFiledAreaEnum, callback: (field: PivotTableLabelField | PivotTableValueField) => void): void;
|
|
1585
|
+
/**
|
|
1586
|
+
* - get how many fields in the area
|
|
1587
|
+
* @param {PivotTableFiledAreaEnum} area - the area of the field enum
|
|
1588
|
+
* @returns {number} the field count
|
|
1589
|
+
*/
|
|
1590
|
+
getFieldCountByArea(area: PivotTableFiledAreaEnum): number;
|
|
1591
|
+
getValueFields(): string[];
|
|
1592
|
+
/**
|
|
1593
|
+
* - get a unique field name in the pivot table
|
|
1594
|
+
* @param {string} autoName the given field name
|
|
1595
|
+
* @returns {string} the unique field name
|
|
1596
|
+
*/
|
|
1597
|
+
getUniqueValueFieldName(autoName: string): string;
|
|
1598
|
+
/**
|
|
1599
|
+
* - get the data field by the table field id
|
|
1600
|
+
* @param {string} tableField - the table field id
|
|
1601
|
+
* @returns {DataField|undefined} the data field or undefined
|
|
1602
|
+
*/
|
|
1603
|
+
getDataFieldByTableId(tableField: string): DataField | undefined;
|
|
1604
|
+
/**
|
|
1605
|
+
* - get all the table fields by use the data field id
|
|
1606
|
+
* @param dataFieldId
|
|
1607
|
+
* @returns {string[]} the table field ids
|
|
1608
|
+
*/
|
|
1609
|
+
getTableFieldsByDataFieldId(dataFieldId: string): (PivotTableLabelField | PivotTableValueField)[];
|
|
1610
|
+
/**
|
|
1611
|
+
* - get the table field by the table field id
|
|
1612
|
+
* @param {string} tableFieldId - the table field id
|
|
1613
|
+
* @returns {PivotTableLabelField | PivotTableValueField | undefined} the table field or undefined
|
|
1614
|
+
*/
|
|
1615
|
+
getTableFieldById(tableFieldId: string): PivotTableLabelField | PivotTableValueField | undefined;
|
|
1616
|
+
/**
|
|
1617
|
+
* - check the field is exist in the pivot table or not
|
|
1618
|
+
* @param {string} tableFieldId the check field id
|
|
1619
|
+
* @returns {boolean} exist or not
|
|
1620
|
+
*/
|
|
1621
|
+
isExistField(tableFieldId: string): boolean;
|
|
1622
|
+
/**
|
|
1623
|
+
* - get the pivot table is empty or not
|
|
1624
|
+
* @returns {boolean} empty or not
|
|
1625
|
+
*/
|
|
1626
|
+
isEmpty(): boolean;
|
|
1627
|
+
/**
|
|
1628
|
+
* - get the data field by the data field id
|
|
1629
|
+
* @param {string} dataFieldId the data field id
|
|
1630
|
+
* @returns {DataField|undefined} the data field or undefined
|
|
1631
|
+
*/
|
|
1632
|
+
getDataFieldByDataFieldId(dataFieldId: string): DataField | undefined;
|
|
1633
|
+
getDataFieldItemInfo(dataField: DataField): {
|
|
1634
|
+
items: string[];
|
|
1635
|
+
itemTypes: PivotDataFieldDataTypeEnum[];
|
|
1636
|
+
};
|
|
1637
|
+
getUniqueFieldId(): string;
|
|
1638
|
+
/**
|
|
1639
|
+
* - add a field to the pivot table by the source name , if the field is a measure field, it will be use auto name.
|
|
1640
|
+
* @param {string} dataFieldId data field name
|
|
1641
|
+
* @param {PivotTableFiledAreaEnum} area the area of the added field
|
|
1642
|
+
* @param {number} [index] the position of the field in the area, if not set, the field will be added to the end of the area.
|
|
1643
|
+
* @returns {PivotTableLabelField|PivotTableValueField} the added field
|
|
1644
|
+
*/
|
|
1645
|
+
addFieldWithSourceId(dataFieldId: string, area: PivotTableFiledAreaEnum, index?: number): PivotTableLabelField | PivotTableValueField | undefined;
|
|
1646
|
+
setOptions(options: IPivotTableOptions): void;
|
|
1647
|
+
/**
|
|
1648
|
+
* the func is only use for when refresh
|
|
1649
|
+
* @param {string} fieldId the table field id
|
|
1650
|
+
* @param {string} sourceName the source name of the field
|
|
1651
|
+
* @param {string} dataFieldId the data field id
|
|
1652
|
+
*/
|
|
1653
|
+
updateFieldSourceInfo(fieldId: string, sourceName: string, dataFieldId: string): void;
|
|
1654
|
+
/**
|
|
1655
|
+
* - Set the subtotal type of the field. only the value field can set the subtotal type. only effective for the value field.
|
|
1656
|
+
* @param {string} fieldId - The id of the field.
|
|
1657
|
+
* @param {PivotSubtotalTypeEnum} subtotalType - The subtotal type of the field.
|
|
1658
|
+
*/
|
|
1659
|
+
setSubtotalType(fieldId: string, subtotalType: PivotSubtotalTypeEnum): void;
|
|
1660
|
+
/**
|
|
1661
|
+
* - Rename the field.
|
|
1662
|
+
* @param {string} fieldId - The id of the field.
|
|
1663
|
+
* @param {string} displayName - The display name of the field.
|
|
1664
|
+
*/
|
|
1665
|
+
renameField(fieldId: string, displayName: string): void;
|
|
1666
|
+
/**
|
|
1667
|
+
* - Set the filter information of the dimension field. only the dimension field can set the filter information.
|
|
1668
|
+
* @param fieldId
|
|
1669
|
+
* @param filterInfo
|
|
1670
|
+
*/
|
|
1671
|
+
setFilterInfo(fieldId: string, filterInfo: IPivotTableFilterInfo): void;
|
|
1672
|
+
/**
|
|
1673
|
+
* - Set the sort information of the dimension field. only the dimension field can set the sort information.
|
|
1674
|
+
* @param {string} fieldId - The id of the field.
|
|
1675
|
+
* @param {IPivotTableSortInfo} sortInfo - The sort information of the field.
|
|
1676
|
+
*/
|
|
1677
|
+
setSortInfo(fieldId: string, sortInfo: IPivotTableSortInfo | undefined): void;
|
|
1678
|
+
/**
|
|
1679
|
+
* - get the sort information of the dimension field.
|
|
1680
|
+
* @param fieldId - The id of the field.
|
|
1681
|
+
* @returns {IPivotTableSortInfo} -The sort information of the field.
|
|
1682
|
+
*/
|
|
1683
|
+
getSortInfo(fieldId: string): IPivotTableSortInfo | undefined;
|
|
1684
|
+
getFilterInfo(fieldId: string): IPivotTableFilterInfo | undefined;
|
|
1685
|
+
/**
|
|
1686
|
+
* get the filter information by the filter index
|
|
1687
|
+
* @param {number} index - The index of the filter field.
|
|
1688
|
+
* @returns {string | undefined} the table field id
|
|
1689
|
+
*/
|
|
1690
|
+
getFilterFieldIdByIndex(index: number): string | undefined;
|
|
1691
|
+
/**
|
|
1692
|
+
* - set the position of the field in the pivot table. which used in pivot panel drag field.
|
|
1693
|
+
* @param {string} fieldId - The id of the pivot table field.
|
|
1694
|
+
* @param {PivotTableFiledAreaEnum} area which area the field will be placed.
|
|
1695
|
+
* @param {number} index the index of the field in the area.
|
|
1696
|
+
*/
|
|
1697
|
+
updateFieldPosition(fieldId: string, area: PivotTableFiledAreaEnum, index: number): void;
|
|
1698
|
+
/**
|
|
1699
|
+
* - get a format for pivot table field, which will be applied in the pivot table view. the label field will use the format to format the date value.
|
|
1700
|
+
* @description when a show data as type is selected, we should set the format for the field.
|
|
1701
|
+
* @param {string} fieldId -the field id
|
|
1702
|
+
* @returns {string} the field format code
|
|
1703
|
+
*/
|
|
1704
|
+
getFieldFormat(fieldId: string): string | undefined;
|
|
1705
|
+
/**
|
|
1706
|
+
* - set the format for pivot table field, which will be applied in the pivot table view. the label field will use the format to format the date value.
|
|
1707
|
+
* @description when a show data as type is selected, we should set the format for the field. a label field which contains the date value should set the format.
|
|
1708
|
+
* @param {string} fieldId
|
|
1709
|
+
* @param {string|undefined} format
|
|
1710
|
+
*/
|
|
1711
|
+
setFieldFormat(fieldId: string, format: string | undefined): void;
|
|
1712
|
+
/**
|
|
1713
|
+
*
|
|
1714
|
+
* @param field
|
|
1715
|
+
* @param area
|
|
1716
|
+
* @example
|
|
1717
|
+
* const pt= new PivotTable(fieldsCollection);
|
|
1718
|
+
* var areaField = pt.addFieldWithSourceName('区域', PivotTableFiledAreaEnum.Column);
|
|
1719
|
+
* pt.addFieldWithSourceName('省份', PivotTableFiledAreaEnum.Filter);
|
|
1720
|
+
*/
|
|
1721
|
+
addField(field: PivotTableLabelField | PivotTableValueField, area: PivotTableFiledAreaEnum, index?: number): void;
|
|
1722
|
+
removeField(fieldId: string): void;
|
|
1723
|
+
getOptions(): IPivotTableOptions;
|
|
1724
|
+
/**
|
|
1725
|
+
* @description Set the collapse status of the field. Those properties are used to save the collapse status of the field in the pivot table.
|
|
1726
|
+
* @param {string} fieldId - The id of the field.
|
|
1727
|
+
* @param {boolean} collapse - The collapse status of the field.
|
|
1728
|
+
* @param {string} [item] - The item of the field.
|
|
1729
|
+
*/
|
|
1730
|
+
setCollapse(fieldId: string, collapse: boolean, item?: string): void;
|
|
1731
|
+
/**
|
|
1732
|
+
* - get the pivot view need query or not
|
|
1733
|
+
* @param {number} viewVersion
|
|
1734
|
+
* @returns {boolean} - need query or not
|
|
1735
|
+
*/
|
|
1736
|
+
getNeedQuery(viewVersion: number): boolean;
|
|
1737
|
+
/**
|
|
1738
|
+
* @description Get the field position information by the field id.
|
|
1739
|
+
* @param {string} fieldId the field id
|
|
1740
|
+
* @returns {PositionInfo} - The position information of the field or undefined.
|
|
1741
|
+
*/
|
|
1742
|
+
getFieldPositionInfoById(fieldId: string): {
|
|
1743
|
+
area: PivotTableFiledAreaEnum | undefined;
|
|
1744
|
+
index: number;
|
|
1745
|
+
};
|
|
1746
|
+
private _getTupleCache;
|
|
1747
|
+
/**
|
|
1748
|
+
* Find the tupleItem in the cache that matches the position order according to the passed array,
|
|
1749
|
+
* and after obtaining the row number array marked on it,
|
|
1750
|
+
* summarize and sort to get all the relevant source data rows
|
|
1751
|
+
*
|
|
1752
|
+
* The key point here is that `dimensionIdList` and `dimensionTableIdList` are one-to-one index corresponding
|
|
1753
|
+
*
|
|
1754
|
+
* @param {string[][]} -A two-dimensional array with path and tableFieldId
|
|
1755
|
+
* @returns {number[]} -Sorted row numbers
|
|
1756
|
+
*/
|
|
1757
|
+
getIndexesByPathStr(tuple: string[][]): number[];
|
|
1758
|
+
setDirty(dirty: boolean): void;
|
|
1759
|
+
query(config?: IPivotTableQueryData): PivotView;
|
|
1760
|
+
toJSON(): IPivotTableSnapshot;
|
|
1761
|
+
fromJSON(data: IPivotTableSnapshot): void;
|
|
1762
|
+
dispose(): void;
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
export declare enum PivotTableChangeTypeEnum {
|
|
1766
|
+
AddField = 0,
|
|
1767
|
+
SetSubtotalType = 1,
|
|
1768
|
+
RemoveField = 2,
|
|
1769
|
+
RenameField = 3,
|
|
1770
|
+
SetFilterInfo = 4,
|
|
1771
|
+
SetSortInfo = 5,
|
|
1772
|
+
UpdateFieldPosition = 6,
|
|
1773
|
+
UpdateValuePosition = 7,
|
|
1774
|
+
SetOptions = 8,
|
|
1775
|
+
SetFieldFormat = 9,
|
|
1776
|
+
SetCollapse = 10,
|
|
1777
|
+
UpdateSource = 11
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
/**
|
|
1781
|
+
* Represents a base class for the field in a pivot table.
|
|
1782
|
+
* @abstract
|
|
1783
|
+
* @description The base class for the field in a pivot table.
|
|
1784
|
+
* @property {string} dataFieldId - The base data field id of the field.
|
|
1785
|
+
* @property {string} id - The unique identifier of the field.
|
|
1786
|
+
* @property {string} displayName - The display name of the field. the default value is the data field name.
|
|
1787
|
+
* @property {string} lossLessProperty - thr public object to save the property not defined but should be saved.
|
|
1788
|
+
*
|
|
1789
|
+
*/
|
|
1790
|
+
export declare abstract class PivotTableFieldBase {
|
|
1791
|
+
/**
|
|
1792
|
+
* @property {string} - The base data field id of the field.
|
|
1793
|
+
*/
|
|
1794
|
+
readonly dataFieldId: string;
|
|
1795
|
+
readonly id: string;
|
|
1796
|
+
readonly sourceName: string;
|
|
1797
|
+
displayName: string;
|
|
1798
|
+
format: string | undefined;
|
|
1799
|
+
lossLessProperty?: any;
|
|
1800
|
+
constructor(dataFieldId: string, id: string, displayName: string | undefined, sourceName: string);
|
|
1801
|
+
getId(): string;
|
|
1802
|
+
/**
|
|
1803
|
+
* - the read only name in collection
|
|
1804
|
+
* @returns {string} - the source name of the field, which is the name of the data field.
|
|
1805
|
+
*/
|
|
1806
|
+
getSourceName(): string;
|
|
1807
|
+
setSourceName(sourceName: string): void;
|
|
1808
|
+
setDataFieldId(dataFieldId: string): void;
|
|
1809
|
+
getDataFieldId(): string;
|
|
1810
|
+
getFormat(): string | undefined;
|
|
1811
|
+
setFormat(format: string | undefined): void;
|
|
1812
|
+
setDisplayName(displayName: string): void;
|
|
1813
|
+
getDisplayName(): string;
|
|
1814
|
+
/**
|
|
1815
|
+
* @abstract
|
|
1816
|
+
*/
|
|
1817
|
+
abstract toJSON(): object;
|
|
1818
|
+
/**
|
|
1819
|
+
* @abstract
|
|
1820
|
+
* @param {object} data - the data config a field.
|
|
1821
|
+
*/
|
|
1822
|
+
abstract fromJSON(data: object): void;
|
|
1823
|
+
/**
|
|
1824
|
+
* @abstract
|
|
1825
|
+
* @returns {object} - the query data of the field.
|
|
1826
|
+
*/
|
|
1827
|
+
abstract getQueryData(): object;
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
/**
|
|
1831
|
+
* Enum for pivot table field types.
|
|
1832
|
+
* @description those field types are used in the pivot table or pivot chart.
|
|
1833
|
+
* @readonly
|
|
1834
|
+
* @typedef {number} PivotTableFieldTypeEnum
|
|
1835
|
+
* @property {number} Column - the label field position in the pivot table column area
|
|
1836
|
+
* @property {number} Row - the label field position in the pivot table row area
|
|
1837
|
+
* @property {number} Value - the value field position in the pivot table
|
|
1838
|
+
* @property {number} Filter - the filter field position in the pivot table, it called the page field in Excel
|
|
1839
|
+
* @property {number} Hidden - the hidden field, it is not shown in the pivot table, but when a slice is created, it will be relation to the slice.
|
|
1840
|
+
*/
|
|
1841
|
+
export declare enum PivotTableFiledAreaEnum {
|
|
1842
|
+
/**
|
|
1843
|
+
* Column - the column field
|
|
1844
|
+
*/
|
|
1845
|
+
Column = 1,
|
|
1846
|
+
/**
|
|
1847
|
+
* Row - the row field
|
|
1848
|
+
*/
|
|
1849
|
+
Row = 2,
|
|
1850
|
+
/**
|
|
1851
|
+
* Value - the value field
|
|
1852
|
+
*/
|
|
1853
|
+
Value = 3,
|
|
1854
|
+
/**
|
|
1855
|
+
* Filter - the filter field
|
|
1856
|
+
*/
|
|
1857
|
+
Filter = 4,
|
|
1858
|
+
/**
|
|
1859
|
+
* Hidden - the hidden field, it is not shown in the pivot table, but when a slice is created, it will be relation to the slice.
|
|
1860
|
+
*/
|
|
1861
|
+
Hidden = 5
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1864
|
+
/**
|
|
1865
|
+
* Represents a label field in a pivot table.
|
|
1866
|
+
*/
|
|
1867
|
+
export declare class PivotTableLabelField extends PivotTableFieldBase {
|
|
1868
|
+
sortInfo: IPivotTableSortInfo | undefined;
|
|
1869
|
+
filterInfo: IPivotTableFilterInfo;
|
|
1870
|
+
constructor(dataFieldId: string, id: string, displayName: string | undefined, sourceName: string);
|
|
1871
|
+
/**
|
|
1872
|
+
* @method setSortInfo
|
|
1873
|
+
* @description Set the sort information of the label field.
|
|
1874
|
+
* @param {IPivotTableSortInfo} sortInfo - The sort information of the label field.
|
|
1875
|
+
*/
|
|
1876
|
+
setSortInfo(sortInfo: IPivotTableSortInfo | undefined): void;
|
|
1877
|
+
/**
|
|
1878
|
+
* @method getSortInfo
|
|
1879
|
+
* @description Get the sort information of the label field.
|
|
1880
|
+
* @returns {IPivotTableSortInfo} The sort information of the label field.
|
|
1881
|
+
*/
|
|
1882
|
+
getSortInfo(): IPivotTableSortInfo | undefined;
|
|
1883
|
+
/**
|
|
1884
|
+
* @method setFilterInfo
|
|
1885
|
+
* @description Set the filter information of the label field. Only one of the manual filter, custom filter or value filter can be effective.
|
|
1886
|
+
* @param {IPivotTableFilterInfo} filterInfo - The filter information of the label field. the manual filter, custom filter or value filter is opposite to each other.
|
|
1887
|
+
*/
|
|
1888
|
+
setFilterInfo(filterInfo: IPivotTableFilterInfo): void;
|
|
1889
|
+
/**
|
|
1890
|
+
* @method getFilterInfo
|
|
1891
|
+
* @description Get the filter information of the label field.
|
|
1892
|
+
* @returns {IPivotTableFilterInfo} The filter information of the label field.
|
|
1893
|
+
*/
|
|
1894
|
+
getFilterInfo(): IPivotTableFilterInfo;
|
|
1895
|
+
getQueryData(): IPivotTableLabelFieldQueryData;
|
|
1896
|
+
toJSON(): IPivotTableLabelFieldJSON;
|
|
1897
|
+
fromJSON(data: IPivotTableLabelFieldJSON): void;
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
export declare class PivotTableValueField extends PivotTableFieldBase {
|
|
1901
|
+
subtotal: PivotSubtotalTypeEnum;
|
|
1902
|
+
showDataAs: IPivotTableShowDataAsInfo;
|
|
1903
|
+
constructor(dataFieldId: string, id: string, displayName: string | undefined, sourceName: string);
|
|
1904
|
+
setSubtotal(subtotal: PivotSubtotalTypeEnum): void;
|
|
1905
|
+
getSubtotal(): PivotSubtotalTypeEnum;
|
|
1906
|
+
setShowDataAs(showDataAs: IPivotTableShowDataAsInfo): void;
|
|
1907
|
+
getShowDataAs(): IPivotTableShowDataAsInfo;
|
|
1908
|
+
getQueryData(): IPivotTableValueFieldQueryData;
|
|
1909
|
+
/**
|
|
1910
|
+
* @override
|
|
1911
|
+
* @returns {IPivotTableValueFieldJSON} - the JSON data of the value field.
|
|
1912
|
+
*/
|
|
1913
|
+
toJSON(): IPivotTableValueFieldJSON;
|
|
1914
|
+
/**
|
|
1915
|
+
* @override
|
|
1916
|
+
* @param data
|
|
1917
|
+
*/
|
|
1918
|
+
fromJSON(data: IPivotTableValueFieldJSON): void;
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
/**
|
|
1922
|
+
* Enum for pivot table value field position types. in the pivot table, the value field can be placed in the column or row field.
|
|
1923
|
+
* @readonly
|
|
1924
|
+
* @enum {number}
|
|
1925
|
+
*/
|
|
1926
|
+
export declare enum PivotTableValuePositionEnum {
|
|
1927
|
+
/**
|
|
1928
|
+
* - the value field not exist in the column or row field
|
|
1929
|
+
*/
|
|
1930
|
+
None = -1,
|
|
1931
|
+
/**
|
|
1932
|
+
* - the value field position in the column field
|
|
1933
|
+
*/
|
|
1934
|
+
Column = 1,
|
|
1935
|
+
/**
|
|
1936
|
+
* - the value field position in the row field
|
|
1937
|
+
*/
|
|
1938
|
+
Row = 2
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
/**
|
|
1942
|
+
* @class PivotTuple
|
|
1943
|
+
* @description use Welford algorithm calc subtotal
|
|
1944
|
+
* https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
|
|
1945
|
+
*/
|
|
1946
|
+
export declare class PivotTuple {
|
|
1947
|
+
private _sum;
|
|
1948
|
+
private _count;
|
|
1949
|
+
private _countN;
|
|
1950
|
+
private _product;
|
|
1951
|
+
private _min;
|
|
1952
|
+
private _max;
|
|
1953
|
+
private _squareSum;
|
|
1954
|
+
constructor();
|
|
1955
|
+
getInfo(): ITPivotTupleInfo;
|
|
1956
|
+
reset(): void;
|
|
1957
|
+
addValue(value: IDataFieldValue): void;
|
|
1958
|
+
unionTuples(tuples: PivotTuple[]): void;
|
|
1959
|
+
unionTupleInfo(tupleInfo: ITPivotTupleInfo): void;
|
|
1960
|
+
getSubtotal(subtotalType: PivotSubtotalTypeEnum): number | {
|
|
1961
|
+
errorType: PivotErrorTypeEnum;
|
|
1962
|
+
};
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
/**
|
|
1966
|
+
* @class PivotView
|
|
1967
|
+
* @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
|
|
1968
|
+
*/
|
|
1969
|
+
export declare class PivotView {
|
|
1970
|
+
/**
|
|
1971
|
+
* the page view of the pivot table
|
|
1972
|
+
*/
|
|
1973
|
+
pageView: PageViewItem;
|
|
1974
|
+
/**
|
|
1975
|
+
* the row view of the pivot table
|
|
1976
|
+
*/
|
|
1977
|
+
rowView: LabelViewItem;
|
|
1978
|
+
/**
|
|
1979
|
+
* the col view of the pivot table
|
|
1980
|
+
*/
|
|
1981
|
+
colView: LabelViewItem;
|
|
1982
|
+
/**
|
|
1983
|
+
* the data view of the pivot table
|
|
1984
|
+
*/
|
|
1985
|
+
dataView: PivotViewItem;
|
|
1986
|
+
/**
|
|
1987
|
+
* the corner view of the pivot table
|
|
1988
|
+
*/
|
|
1989
|
+
cornerView: PivotViewItem;
|
|
1990
|
+
/**
|
|
1991
|
+
* the version of the pivot view, it will be used to check the view is the latest
|
|
1992
|
+
*/
|
|
1993
|
+
version: number;
|
|
1994
|
+
/**
|
|
1995
|
+
* the format map of the table field id, it will be used to store the format of the pivot view
|
|
1996
|
+
*/
|
|
1997
|
+
formatMap: Record<string, string>;
|
|
1998
|
+
constructor();
|
|
1999
|
+
setVersion(version?: number): void;
|
|
2000
|
+
/**
|
|
2001
|
+
* - 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
|
|
2002
|
+
* @param model the pivot model, it will be used to set the format of the pivot view
|
|
2003
|
+
*/
|
|
2004
|
+
setFormat(model: PivotModel): void;
|
|
2005
|
+
getVersion(): number;
|
|
2006
|
+
toJSON(): IPivotViewJSON;
|
|
2007
|
+
formJSON(data: IPivotViewJSON): void;
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
export declare enum PivotViewCellValueTypeEnum {
|
|
2011
|
+
blank = 2,
|
|
2012
|
+
date = 4
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2015
|
+
export declare class PivotViewItem {
|
|
2016
|
+
/**
|
|
2017
|
+
* - how many rows in the view
|
|
2018
|
+
*/
|
|
2019
|
+
rowCount: number;
|
|
2020
|
+
/**
|
|
2021
|
+
* - how many cols in the view
|
|
2022
|
+
*/
|
|
2023
|
+
colCount: number;
|
|
2024
|
+
/**
|
|
2025
|
+
* the data of the view, the key is the row index, the value is the column data
|
|
2026
|
+
*/
|
|
2027
|
+
data: IPivotViewItemData;
|
|
2028
|
+
/**
|
|
2029
|
+
* the info of the view, the index is the index of the view item, the value is the info of the view item
|
|
2030
|
+
*/
|
|
2031
|
+
info: IPivotViewInfo[];
|
|
2032
|
+
lastCol: number;
|
|
2033
|
+
lastRow: number;
|
|
2034
|
+
getLastCol(): number;
|
|
2035
|
+
getLastRow(): number;
|
|
2036
|
+
setValue(row: number, col: number, value: IPivotViewValueType): void;
|
|
2037
|
+
setStyle(row: number, col: number, styleType: PivotCellStyleTypeEnum): void;
|
|
2038
|
+
setBlank(row: number, col: number): void;
|
|
2039
|
+
protected getCell(row: number, col: number): IPivotViewCellData;
|
|
2040
|
+
setInfo(index: number, info: IPivotViewInfo): void;
|
|
2041
|
+
buildPathMap(considerValue: boolean): Record<string, number>;
|
|
2042
|
+
setRowCount(rowCount: number): void;
|
|
2043
|
+
setColCount(colCount: number): void;
|
|
2044
|
+
getRowCount(): number;
|
|
2045
|
+
getColCount(): number;
|
|
2046
|
+
getValue(row: number, col: number): IPivotViewValueType;
|
|
2047
|
+
getStyle(row: number, col: number): PivotCellStyleTypeEnum | undefined;
|
|
2048
|
+
toJSON(): IPivotViewItemJSON;
|
|
2049
|
+
fromJSON(json: IPivotViewItemJSON): void;
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
/**
|
|
2053
|
+
* Enum for IST_PivotFilter Operator
|
|
2054
|
+
* @enum {number}
|
|
2055
|
+
*/
|
|
2056
|
+
export declare enum ST_PivotFilterOperatorEnum {
|
|
2057
|
+
/**
|
|
2058
|
+
* Filter by caption that begins with a specific value
|
|
2059
|
+
* @type {number}
|
|
2060
|
+
*/
|
|
2061
|
+
captionBeginsWith = 1,
|
|
2062
|
+
/**
|
|
2063
|
+
* Filter by caption that is between two values
|
|
2064
|
+
* @type {number}
|
|
2065
|
+
*/
|
|
2066
|
+
captionBetween = 2,
|
|
2067
|
+
/**
|
|
2068
|
+
* Filter by caption that contains a specific value
|
|
2069
|
+
* @type {number}
|
|
2070
|
+
*/
|
|
2071
|
+
captionContains = 3,
|
|
2072
|
+
/**
|
|
2073
|
+
* Filter by caption that ends with a specific value
|
|
2074
|
+
* @type {number}
|
|
2075
|
+
*/
|
|
2076
|
+
captionEndsWith = 4,
|
|
2077
|
+
/**
|
|
2078
|
+
* Filter by caption that is equal to a specific value
|
|
2079
|
+
* @type {number}
|
|
2080
|
+
*/
|
|
2081
|
+
captionEqual = 5,
|
|
2082
|
+
/**
|
|
2083
|
+
* Filter by caption that is greater than a specific value
|
|
2084
|
+
* @type {number}
|
|
2085
|
+
*/
|
|
2086
|
+
captionGreaterThan = 6,
|
|
2087
|
+
/**
|
|
2088
|
+
* Filter by caption that is greater than or equal to a specific value
|
|
2089
|
+
* @type {number}
|
|
2090
|
+
*/
|
|
2091
|
+
captionGreaterThanOrEqual = 7,
|
|
2092
|
+
/**
|
|
2093
|
+
* Filter by caption that is less than a specific value
|
|
2094
|
+
* @type {number}
|
|
2095
|
+
*/
|
|
2096
|
+
captionLessThan = 8,
|
|
2097
|
+
/**
|
|
2098
|
+
* Filter by caption that is less than or equal to a specific value
|
|
2099
|
+
* @type {number}
|
|
2100
|
+
*/
|
|
2101
|
+
captionLessThanOrEqual = 9,
|
|
2102
|
+
/**
|
|
2103
|
+
* Filter by caption that does not begin with a specific value
|
|
2104
|
+
* @type {number}
|
|
2105
|
+
*/
|
|
2106
|
+
captionNotBeginsWith = 10,
|
|
2107
|
+
/**
|
|
2108
|
+
* Filter by caption that is not between two values
|
|
2109
|
+
* @type {number}
|
|
2110
|
+
*/
|
|
2111
|
+
captionNotBetween = 11,
|
|
2112
|
+
/**
|
|
2113
|
+
* Filter by caption that does not contain a specific value
|
|
2114
|
+
* @type {number}
|
|
2115
|
+
*/
|
|
2116
|
+
captionNotContains = 12,
|
|
2117
|
+
/**
|
|
2118
|
+
* Filter by caption that does not end with a specific value
|
|
2119
|
+
* @type {number}
|
|
2120
|
+
*/
|
|
2121
|
+
captionNotEndsWith = 13,
|
|
2122
|
+
/**
|
|
2123
|
+
* Filter by caption that is not equal to a specific value
|
|
2124
|
+
* @type {number}
|
|
2125
|
+
*/
|
|
2126
|
+
captionNotEqual = 14,
|
|
2127
|
+
/**
|
|
2128
|
+
* Filter by count
|
|
2129
|
+
* @type {number}
|
|
2130
|
+
*/
|
|
2131
|
+
count = 15,
|
|
2132
|
+
/**
|
|
2133
|
+
* Filter by date that is between two values
|
|
2134
|
+
* @type {number}
|
|
2135
|
+
*/
|
|
2136
|
+
dateBetween = 16,
|
|
2137
|
+
/**
|
|
2138
|
+
* Filter by date that is equal to a specific value
|
|
2139
|
+
* @type {number}
|
|
2140
|
+
*/
|
|
2141
|
+
dateEqual = 17,
|
|
2142
|
+
/**
|
|
2143
|
+
* Filter by date that is newer than a specific value
|
|
2144
|
+
* @type {number}
|
|
2145
|
+
*/
|
|
2146
|
+
dateNewerThan = 18,
|
|
2147
|
+
/**
|
|
2148
|
+
* Filter by date that is newer than or equal to a specific value
|
|
2149
|
+
* @type {number}
|
|
2150
|
+
*/
|
|
2151
|
+
dateNewerThanOrEqual = 19,
|
|
2152
|
+
/**
|
|
2153
|
+
* Filter by date that is not between two values
|
|
2154
|
+
* @type {number}
|
|
2155
|
+
*/
|
|
2156
|
+
dateNotBetween = 20,
|
|
2157
|
+
/**
|
|
2158
|
+
* Filter by date that is not equal to a specific value
|
|
2159
|
+
* @type {number}
|
|
2160
|
+
*/
|
|
2161
|
+
dateNotEqual = 21,
|
|
2162
|
+
/**
|
|
2163
|
+
* Filter by date that is older than a specific value
|
|
2164
|
+
* @type {number}
|
|
2165
|
+
*/
|
|
2166
|
+
dateOlderThan = 22,
|
|
2167
|
+
/**
|
|
2168
|
+
* Filter by date that is older than or equal to a specific value
|
|
2169
|
+
* @type {number}
|
|
2170
|
+
*/
|
|
2171
|
+
dateOlderThanOrEqual = 23,
|
|
2172
|
+
/**
|
|
2173
|
+
* Filter by last month
|
|
2174
|
+
* @type {number}
|
|
2175
|
+
*/
|
|
2176
|
+
lastMonth = 24,
|
|
2177
|
+
/**
|
|
2178
|
+
* Filter by last quarter
|
|
2179
|
+
* @type {number}
|
|
2180
|
+
*/
|
|
2181
|
+
lastQuarter = 25,
|
|
2182
|
+
/**
|
|
2183
|
+
* Filter by last week
|
|
2184
|
+
* @type {number}
|
|
2185
|
+
*/
|
|
2186
|
+
lastWeek = 26,
|
|
2187
|
+
/**
|
|
2188
|
+
* Filter by last year
|
|
2189
|
+
* @type {number}
|
|
2190
|
+
*/
|
|
2191
|
+
lastYear = 27,
|
|
2192
|
+
/**
|
|
2193
|
+
* Filter by dates in January
|
|
2194
|
+
* @type {number}
|
|
2195
|
+
*/
|
|
2196
|
+
M1 = 28,
|
|
2197
|
+
/**
|
|
2198
|
+
* Filter by dates in October
|
|
2199
|
+
* @type {number}
|
|
2200
|
+
*/
|
|
2201
|
+
M10 = 29,
|
|
2202
|
+
/**
|
|
2203
|
+
* Filter by dates in November
|
|
2204
|
+
* @type {number}
|
|
2205
|
+
*/
|
|
2206
|
+
M11 = 30,
|
|
2207
|
+
/**
|
|
2208
|
+
* Filter by dates in December
|
|
2209
|
+
* @type {number}
|
|
2210
|
+
*/
|
|
2211
|
+
M12 = 31,
|
|
2212
|
+
/**
|
|
2213
|
+
* Filter by dates in February
|
|
2214
|
+
* @type {number}
|
|
2215
|
+
*/
|
|
2216
|
+
M2 = 32,
|
|
2217
|
+
/**
|
|
2218
|
+
* Filter by dates in March
|
|
2219
|
+
* @type {number}
|
|
2220
|
+
*/
|
|
2221
|
+
M3 = 33,
|
|
2222
|
+
/**
|
|
2223
|
+
* Filter by dates in April
|
|
2224
|
+
* @type {number}
|
|
2225
|
+
*/
|
|
2226
|
+
M4 = 34,
|
|
2227
|
+
/**
|
|
2228
|
+
* Filter by dates in May
|
|
2229
|
+
* @type {number}
|
|
2230
|
+
*/
|
|
2231
|
+
M5 = 35,
|
|
2232
|
+
/**
|
|
2233
|
+
* Filter by dates in June
|
|
2234
|
+
* @type {number}
|
|
2235
|
+
*/
|
|
2236
|
+
M6 = 36,
|
|
2237
|
+
/**
|
|
2238
|
+
* Filter by dates in July
|
|
2239
|
+
* @type {number}
|
|
2240
|
+
*/
|
|
2241
|
+
M7 = 37,
|
|
2242
|
+
/**
|
|
2243
|
+
* Filter by dates in August
|
|
2244
|
+
* @type {number}
|
|
2245
|
+
*/
|
|
2246
|
+
M8 = 38,
|
|
2247
|
+
/**
|
|
2248
|
+
* Filter by dates in September
|
|
2249
|
+
* @type {number}
|
|
2250
|
+
*/
|
|
2251
|
+
M9 = 39,
|
|
2252
|
+
/**
|
|
2253
|
+
* Filter by next month
|
|
2254
|
+
* @type {number}
|
|
2255
|
+
*/
|
|
2256
|
+
nextMonth = 40,
|
|
2257
|
+
/**
|
|
2258
|
+
* Filter by next quarter
|
|
2259
|
+
* @type {number}
|
|
2260
|
+
*/
|
|
2261
|
+
nextQuarter = 41,
|
|
2262
|
+
/**
|
|
2263
|
+
* Filter by next week
|
|
2264
|
+
* @type {number}
|
|
2265
|
+
*/
|
|
2266
|
+
nextWeek = 42,
|
|
2267
|
+
/**
|
|
2268
|
+
* Filter by next year
|
|
2269
|
+
* @type {number}
|
|
2270
|
+
*/
|
|
2271
|
+
nextYear = 43,
|
|
2272
|
+
/**
|
|
2273
|
+
* Filter by percent
|
|
2274
|
+
* @type {number}
|
|
2275
|
+
*/
|
|
2276
|
+
percent = 44,
|
|
2277
|
+
/**
|
|
2278
|
+
* Filter by first quarter
|
|
2279
|
+
* @type {number}
|
|
2280
|
+
*/
|
|
2281
|
+
Q1 = 45,
|
|
2282
|
+
/**
|
|
2283
|
+
* Filter by second quarter
|
|
2284
|
+
* @type {number}
|
|
2285
|
+
*/
|
|
2286
|
+
Q2 = 46,
|
|
2287
|
+
/**
|
|
2288
|
+
* Filter by third quarter
|
|
2289
|
+
* @type {number}
|
|
2290
|
+
*/
|
|
2291
|
+
Q3 = 47,
|
|
2292
|
+
/**
|
|
2293
|
+
* Filter by fourth quarter
|
|
2294
|
+
* @type {number}
|
|
2295
|
+
*/
|
|
2296
|
+
Q4 = 48,
|
|
2297
|
+
/**
|
|
2298
|
+
* Filter by sum
|
|
2299
|
+
* @type {number}
|
|
2300
|
+
*/
|
|
2301
|
+
sum = 49,
|
|
2302
|
+
/**
|
|
2303
|
+
* Filter by this month
|
|
2304
|
+
* @type {number}
|
|
2305
|
+
*/
|
|
2306
|
+
thisMonth = 50,
|
|
2307
|
+
/**
|
|
2308
|
+
* Filter by this quarter
|
|
2309
|
+
* @type {number}
|
|
2310
|
+
*/
|
|
2311
|
+
thisQuarter = 51,
|
|
2312
|
+
/**
|
|
2313
|
+
* Filter by this week
|
|
2314
|
+
* @type {number}
|
|
2315
|
+
*/
|
|
2316
|
+
thisWeek = 52,
|
|
2317
|
+
/**
|
|
2318
|
+
* Filter by this year
|
|
2319
|
+
* @type {number}
|
|
2320
|
+
*/
|
|
2321
|
+
thisYear = 53,
|
|
2322
|
+
/**
|
|
2323
|
+
* Filter by today
|
|
2324
|
+
* @type {number}
|
|
2325
|
+
*/
|
|
2326
|
+
today = 54,
|
|
2327
|
+
/**
|
|
2328
|
+
* Filter by tomorrow
|
|
2329
|
+
* @type {number}
|
|
2330
|
+
*/
|
|
2331
|
+
tomorrow = 55,
|
|
2332
|
+
/**
|
|
2333
|
+
* Filter by unknown
|
|
2334
|
+
* @type {number}
|
|
2335
|
+
*/
|
|
2336
|
+
unknown = 56,
|
|
2337
|
+
/**
|
|
2338
|
+
* Filter by value that is between two values
|
|
2339
|
+
* @type {number}
|
|
2340
|
+
*/
|
|
2341
|
+
valueBetween = 57,
|
|
2342
|
+
/**
|
|
2343
|
+
* Filter by value that is equal to a specific value
|
|
2344
|
+
* @type {number}
|
|
2345
|
+
*/
|
|
2346
|
+
valueEqual = 58,
|
|
2347
|
+
/**
|
|
2348
|
+
* Filter by value that is greater than a specific value
|
|
2349
|
+
* @type {number}
|
|
2350
|
+
*/
|
|
2351
|
+
valueGreaterThan = 59,
|
|
2352
|
+
/**
|
|
2353
|
+
* Filter by value that is greater than or equal to a specific value
|
|
2354
|
+
* @type {number}
|
|
2355
|
+
*/
|
|
2356
|
+
valueGreaterThanOrEqual = 60,
|
|
2357
|
+
/**
|
|
2358
|
+
* Filter by value that is less than a specific value
|
|
2359
|
+
* @type {number}
|
|
2360
|
+
*/
|
|
2361
|
+
valueLessThan = 61,
|
|
2362
|
+
/**
|
|
2363
|
+
* Filter by value that is less than or equal to a specific value
|
|
2364
|
+
* @type {number}
|
|
2365
|
+
*/
|
|
2366
|
+
valueLessThanOrEqual = 62,
|
|
2367
|
+
/**
|
|
2368
|
+
* Filter by value that is not between two values
|
|
2369
|
+
* @type {number}
|
|
2370
|
+
*/
|
|
2371
|
+
valueNotBetween = 63,
|
|
2372
|
+
/**
|
|
2373
|
+
* Filter by value that is not equal to a specific value
|
|
2374
|
+
* @type {number}
|
|
2375
|
+
*/
|
|
2376
|
+
valueNotEqual = 64,
|
|
2377
|
+
/**
|
|
2378
|
+
* Filter by year-to-date
|
|
2379
|
+
* @type {number}
|
|
2380
|
+
*/
|
|
2381
|
+
yearToDate = 65,
|
|
2382
|
+
/**
|
|
2383
|
+
* Filter by yesterday
|
|
2384
|
+
* @type {number}
|
|
2385
|
+
*/
|
|
2386
|
+
yesterday = 66
|
|
2387
|
+
}
|
|
2388
|
+
|
|
2389
|
+
export declare class SummaryManager {
|
|
2390
|
+
counter: number;
|
|
2391
|
+
rowDimOrder: number[];
|
|
2392
|
+
colDimOrder: number[];
|
|
2393
|
+
rowTableIdList: string[];
|
|
2394
|
+
colTableIdList: string[];
|
|
2395
|
+
rowDeep: number;
|
|
2396
|
+
colDeep: number;
|
|
2397
|
+
measureCount: number;
|
|
2398
|
+
leafCount: number;
|
|
2399
|
+
measuresMap: Record<string, IMeasuresMapItem>;
|
|
2400
|
+
/**
|
|
2401
|
+
* @property The tuples of the pivot table, it contains the path, indexes, and save the measure value of each tuple.
|
|
2402
|
+
*/
|
|
2403
|
+
tuples: ITupleItem[];
|
|
2404
|
+
/**
|
|
2405
|
+
* @property The map of tuple, it is used to quickly find the tuple by the path of tuple. the key is the path of tuple, the value is the index of tuple in tuples.
|
|
2406
|
+
*/
|
|
2407
|
+
tupleMap: Record<string, number>;
|
|
2408
|
+
/**
|
|
2409
|
+
* @property The dimensionIdList, it contains the id of dimension fields.Only the the row and col fields are dimension fields.
|
|
2410
|
+
*/
|
|
2411
|
+
dimensionIdList: string[];
|
|
2412
|
+
dimensionTableIdList: string[];
|
|
2413
|
+
/**
|
|
2414
|
+
* @property The measureIdList, it contains the id of measure fields.It used to quickly find the measure field.
|
|
2415
|
+
*/
|
|
2416
|
+
measureIdList: string[];
|
|
2417
|
+
_rowLevelPool: IPivotSummaryLevelPool;
|
|
2418
|
+
_colLevelPool: IPivotSummaryLevelPool;
|
|
2419
|
+
rowNodeTree: NodeTree;
|
|
2420
|
+
colNodeTree: NodeTree;
|
|
2421
|
+
dimensionMap: Record<string, IDimensionMapItem>;
|
|
2422
|
+
/**
|
|
2423
|
+
* fist Record key is combinePathMap
|
|
2424
|
+
*/
|
|
2425
|
+
combinePathMap: Record<string, Record<string, number>>;
|
|
2426
|
+
collapseInfo: Record<string, boolean | Record<string, boolean>>;
|
|
2427
|
+
dimensionSortInfo: Record<string, {
|
|
2428
|
+
type: PivotDataFieldSortOperatorEnum;
|
|
2429
|
+
sortMap: Record<string, number>;
|
|
2430
|
+
}>;
|
|
2431
|
+
constructor(queryData: IPivotTableQueryData, tupleGroup: TupleGroup);
|
|
2432
|
+
createSummaryLabelSortedMap(queryData: IPivotTableQueryData): void;
|
|
2433
|
+
getCellValue(index: number, id: string, subtotal: PivotSubtotalTypeEnum): number | {
|
|
2434
|
+
errorType: PivotErrorTypeEnum;
|
|
2435
|
+
} | undefined;
|
|
2436
|
+
getSortedMap(tableFieldId: string, dataField: DataField): Record<string, number>;
|
|
2437
|
+
doSummary(): void;
|
|
2438
|
+
private _getIndex;
|
|
2439
|
+
buildNodeTree(): void;
|
|
2440
|
+
createTupleWithoutCheck(paths: string[], nodeIndex: number, tupleKey: string): void;
|
|
2441
|
+
_buildNodeTreeImp(dimOrder: number[], tableIdList: string[], levelPool: IPivotSummaryLevelPool, nodePathStr: string): NodeTree;
|
|
2442
|
+
combinePathMapList(colPathMapList: Record<string, number>[], basePath: string): Record<string, number>;
|
|
2443
|
+
calculateListSubtotal(tupleItem: ITupleItem, indexes: number[]): void;
|
|
2444
|
+
calculateSubtotal(): void;
|
|
2445
|
+
getPathKeyWithFiledId(paths: string[], tableIdList: string[]): string;
|
|
2446
|
+
ensureTupleItem(index: number, paths: string[], tableIdList: string[]): void;
|
|
2447
|
+
ensureTupleItemByString(index: number, pathString: string): void;
|
|
2448
|
+
/**
|
|
2449
|
+
* - create tuple if not exist
|
|
2450
|
+
* @param {string[]} paths the path of tuple
|
|
2451
|
+
* @param {string} [pathsStr] the joined path string of tuple
|
|
2452
|
+
* @returns {void}
|
|
2453
|
+
*/
|
|
2454
|
+
createTuple(paths: string[], pathsStr?: string, nodeIndex?: number): void;
|
|
2455
|
+
_calculateSubtotalImp(levelPool: IPivotSummaryLevelPool): void;
|
|
2456
|
+
}
|
|
2457
|
+
|
|
2458
|
+
declare class TupleGroup {
|
|
2459
|
+
/**
|
|
2460
|
+
* @property The tuples of the pivot table, it contains the path, indexes, and save the measure value of each tuple.
|
|
2461
|
+
*/
|
|
2462
|
+
tuples: ITupleItem[];
|
|
2463
|
+
/**
|
|
2464
|
+
* @property The map of tuple, it is used to quickly find the tuple by the path of tuple. the key is the path of tuple, the value is the index of tuple in tuples.
|
|
2465
|
+
*/
|
|
2466
|
+
tupleMap: Record<string, number>;
|
|
2467
|
+
/**
|
|
2468
|
+
* @property The measuresMap, it contains the field and subtotal of each measure.
|
|
2469
|
+
*/
|
|
2470
|
+
measuresMap: Record<string, IMeasuresMapItem>;
|
|
2471
|
+
/**
|
|
2472
|
+
* @property The dimensionIdList, it contains the id of dimension fields.Only the the row and col fields are dimension fields.
|
|
2473
|
+
*/
|
|
2474
|
+
dimensionIdList: string[];
|
|
2475
|
+
dimensionTableIdList: string[];
|
|
2476
|
+
/**
|
|
2477
|
+
* @property The measureIdList, it contains the id of measure fields.It used to quickly find the measure field.
|
|
2478
|
+
*/
|
|
2479
|
+
measureIdList: string[];
|
|
2480
|
+
/**
|
|
2481
|
+
* @property The dimensionMap, it contains the field of each dimension.
|
|
2482
|
+
*/
|
|
2483
|
+
dimensionMap: Record<string, IDimensionMapItem>;
|
|
2484
|
+
/**
|
|
2485
|
+
* @property The rowDeep, the deep of row fields.
|
|
2486
|
+
*/
|
|
2487
|
+
rowDeep: number;
|
|
2488
|
+
/**
|
|
2489
|
+
* @property The colDeep, the deep of col fields.
|
|
2490
|
+
*/
|
|
2491
|
+
colDeep: number;
|
|
2492
|
+
constructor();
|
|
2493
|
+
/**
|
|
2494
|
+
* - prepare the measuresMap and dimensionMap, it will prepare the measuresMap and dimensionMap based on the query data
|
|
2495
|
+
* @param {FieldsCollection} dataFieldsCollection - the fields collection of pivot table
|
|
2496
|
+
* @param {IPivotTableQueryData} queryData - the query data of pivot table, which contains the value, row, col, filter information,it the configuration of pivot table
|
|
2497
|
+
*/
|
|
2498
|
+
prepare(dataFieldsCollection: FieldsCollection, queryData: IPivotTableQueryData): void;
|
|
2499
|
+
/**
|
|
2500
|
+
* - filter the data records by the query data
|
|
2501
|
+
* @param {IPivotTableQueryData} queryData - the query data of pivot table, which contains the value, row, col, filter information,it the configuration of pivot table
|
|
2502
|
+
* @returns {number[]} list - the indexes of data records, which is used to iterate the data records, isALL - whether all the data records are selected
|
|
2503
|
+
*/
|
|
2504
|
+
filter(queryData: IPivotTableQueryData): {
|
|
2505
|
+
isAll: boolean;
|
|
2506
|
+
list: number[];
|
|
2507
|
+
};
|
|
2508
|
+
/**
|
|
2509
|
+
* - the core method of tuple group, it will prepare, filter, iterate the data records, and create or update tuple
|
|
2510
|
+
* @param {FieldsCollection} dataFieldsCollection - the fields collection of pivot table
|
|
2511
|
+
* @param {IPivotTableQueryData} queryData - the query data of pivot table, which contains the value, row, col, filter information,it the configuration of pivot table
|
|
2512
|
+
* @returns {void}
|
|
2513
|
+
*/
|
|
2514
|
+
query(dataFieldsCollection: FieldsCollection, queryData: IPivotTableQueryData): void;
|
|
2515
|
+
reset(): void;
|
|
2516
|
+
/**
|
|
2517
|
+
* - iterate the indexes of data records, and create or update tuple
|
|
2518
|
+
* @param {boolean} isALL - whether all the data records are selected
|
|
2519
|
+
* @param {number} indexes - the indexes of data records
|
|
2520
|
+
*/
|
|
2521
|
+
iterate(isALL: boolean, indexes: number[], recordCount?: number): void;
|
|
2522
|
+
/**
|
|
2523
|
+
* - create or update tuple, which is the core logic of tuple group, it will create a new tuple if not exist, or update the existing tuple., the judgment is based on the paths of tuple.
|
|
2524
|
+
* @param {string} paths the path of tuple
|
|
2525
|
+
* @param {string} pathsWithField the joined path string of tuple
|
|
2526
|
+
* @param {number} index the index of data
|
|
2527
|
+
* @returns {void}
|
|
2528
|
+
*/
|
|
2529
|
+
createOrUpdateTuple(paths: string[], pathsWithField: string[], index: number, types: PivotDataFieldDataTypeEnum[]): void;
|
|
2530
|
+
/**
|
|
2531
|
+
* - create tuple if not exist
|
|
2532
|
+
* @param {string[]} paths the path of tuple
|
|
2533
|
+
* @param {string} [pathsStr] the joined path string of tuple
|
|
2534
|
+
* @returns {void}
|
|
2535
|
+
*/
|
|
2536
|
+
createTuple(paths: string[], pathsStr?: string, nodeIndex?: number, types?: PivotDataFieldDataTypeEnum[]): void;
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
export { }
|