@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.
@@ -1,124 +0,0 @@
1
- import { IDataFieldValue, IDateValue, IMeasuresMapItem, IPivotTableCustomFilter, IPivotTableFilterInfo, IPivotTableManualFilter, IPivotTableSortInfo, ITupleItem, PivotCellStyleTypeEnum, PivotDataFieldDataTypeEnum, PivotSubtotalTypeEnum, PivotTableFiledAreaEnum } from './types';
2
- /**
3
- * - judge the value is date like type
4
- * @param {IDataFieldValue} value the date like value
5
- * @returns {boolean} - return true if the value is date like type
6
- */
7
- export declare function isDateValue(value: IDataFieldValue): value is IDateValue;
8
- /**
9
- * - judge the value is blank
10
- * @param {any} value the value to be test
11
- * @returns {boolean} return true if the value is blank
12
- */
13
- export declare function isBlankValue(value: unknown): value is null | undefined;
14
- /**
15
- * - judge the area type is in dim
16
- * @param {PivotTableFiledAreaEnum} area - the test area
17
- * @returns {boolean} - return true if the area is in dim
18
- */
19
- export declare function isDimArea(area: PivotTableFiledAreaEnum): boolean;
20
- /**
21
- * - judge the area type is in row or column
22
- * @param {PivotTableFiledAreaEnum} area - the test area
23
- * @returns {boolean} - return true if the area is in value
24
- */
25
- export declare function isRowOrColumnArea(area: PivotTableFiledAreaEnum): boolean;
26
- /**
27
- * - Get the auto display name of the value field.
28
- * @description - which may use prefix text like excel
29
- * - the prefix text is create by subtotal type
30
- * @param {string} baseName the name without prefix text
31
- * @param {PivotSubtotalTypeEnum} subtotalType the type of subtotal to be displayed for this value field.
32
- * @returns {string} the auto display name of the value field.
33
- */
34
- export declare function getAutoDisplayName(baseName: string, subtotalType: PivotSubtotalTypeEnum): string;
35
- /**
36
- * the value field name can be match with prefix rule
37
- * @description if user set a prefix like name ,the func can not get and it will return true
38
- * @param {string} fieldName - the given name to test
39
- * @returns {boolean} is match to the auto name rule
40
- */
41
- export declare function isAutoDisplayName(fieldName: string): boolean;
42
- /**
43
- * - get the field or field item collapse status
44
- * @param {Record<string, boolean|Record<string, boolean>>} collapseInfo
45
- * @param {string} fieldId the field id
46
- * @param {string} [item] the field item id
47
- * @returns {boolean} - return true if the field or field item is collapse
48
- */
49
- export declare function getCollapse(collapseInfo: Record<string, boolean | Record<string, boolean>>, fieldId: string, item?: string): boolean;
50
- /**
51
- * -judge the filter info is manual filter
52
- * @param {IPivotTableFilterInfo} filterInfo - the dimension filter info
53
- * @returns {boolean} return true if the filter info is manual filter
54
- */
55
- export declare function isManualFilter(filterInfo: IPivotTableFilterInfo): filterInfo is IPivotTableManualFilter;
56
- /**
57
- * -judge the filter info is customFilter filter
58
- * @param {IPivotTableFilterInfo} filterInfo - the dimension filter info
59
- * @returns {boolean} return true if the filter info is custom filter
60
- */
61
- export declare function isCustomFilter(filterInfo: IPivotTableFilterInfo): filterInfo is IPivotTableCustomFilter;
62
- /**
63
- * -judge the filter info is customFilter filter
64
- * @param {IPivotTableFilterInfo} filterInfo - the dimension filter info
65
- * @returns {boolean} return true if the filter info is custom filter
66
- */
67
- export declare function isValueFilter(filterInfo: IPivotTableFilterInfo): filterInfo is IPivotTableCustomFilter;
68
- /**
69
- * - Generate a random hex number text with specified length
70
- * @param {number} length the length of the generated hex number
71
- * @returns {string} the generated hex number
72
- */
73
- export declare function generateHexNumber(length: number): string;
74
- /**
75
- * - Represents the intersection of multiple indexes, this function only works for sorted arrays.
76
- * @param {number[][]} indexes the array of indexes to be intersected.
77
- * @returns {number[]} the intersection of the indexes
78
- */
79
- export declare function getIndexesIntersection(indexes: number[][]): number[];
80
- /**
81
- * - union the subtotal info to the parent tuple, we do subtotal for the deepest level tuple to the root tuple
82
- * @param {ITupleItem} tupleItem the tuple item
83
- * @param {ITupleItem} parenTupleItem the parent tuple item
84
- * @param {Record<string, IMeasuresMapItem>} measuresMap the measures map
85
- * @returns {void} - no return
86
- */
87
- export declare function subTotalTupleItem(tupleItem: ITupleItem, parenTupleItem: ITupleItem | undefined, measuresMap: Record<string, IMeasuresMapItem>): void;
88
- /**
89
- * - Get the filter status and value for the pivot table cell
90
- * @param {IPivotTableFilterInfo} filterInfo
91
- * @returns { status: PivotCellStyleTypeEnum, value?: string } the filter status and value
92
- */
93
- export declare function getFilterStatusAndValue(filterInfo: IPivotTableFilterInfo | undefined): {
94
- status: PivotCellStyleTypeEnum;
95
- value?: string;
96
- };
97
- /**
98
- * - get dim cell status with filter and sort info
99
- * @param {IPivotTableFilterInfo} filterInfo the filter info
100
- * @param {IPivotTableSortInfo} sortInfo the sort info
101
- * @returns {PivotCellStyleTypeEnum} the cell style type
102
- */
103
- export declare function getDimFilterSortStatus(filterInfo: IPivotTableFilterInfo | undefined, sortInfo: IPivotTableSortInfo): PivotCellStyleTypeEnum;
104
- /**
105
- * - use the paths and value index to get the unique key of in layout pivot view, which use same rule to create the key in pivot engine
106
- * @param {string[]} paths - the paths of the cell
107
- * @param {number|undefined} valueIndex - the value index of the cell
108
- * @returns {string} key of the path and value index
109
- */
110
- export declare function getPathWithValueIndex(paths: string[], valueIndex: number | undefined, considerValue: boolean): string;
111
- /**
112
- * - Merge multiple sorted arrays into a single sorted array
113
- * @param {arrays: number[][]} arrays - the arrays to be merged
114
- * @returns {number[]} - the merged array
115
- */
116
- export declare function unionSortedList(arrays: number[][]): number[];
117
- /**
118
- * sort the label item by the item type
119
- * @param {string[]} items - the items to be sorted
120
- * @param {PivotDataFieldDataTypeEnum[]} itemTypes - the item type of the items
121
- * @param {Record<string, number>} itemsMap - the original item map
122
- * @returns {Record<string, number>} the sorted item map
123
- */
124
- export declare function sortLabelItem(items: string[], itemTypes: PivotDataFieldDataTypeEnum[], itemsMap: Record<string, number>): Record<string, number>;