@univerjs-pro/engine-pivot 1.0.0-rc.0 → 1.0.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/index.js +1 -1
- package/lib/types/pivot/model.d.ts +8 -4
- package/lib/types/pivot/pivot-table.d.ts +9 -2
- package/lib/types/types/json-types.d.ts +6 -2
- package/lib/types/util.d.ts +6 -2
- package/lib/umd/index.js +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { PivotSubtotalTypeEnum } from '../types/enum';
|
|
2
|
+
import type { IPivotTableFilterInfo, IPivotTableQueryData, IPivotTableShowDataAsInfo, IPivotTableSortInfo, IPivotTableValueFilter, IValueFilterInfoItem } from '../types/interface';
|
|
3
|
+
import type { IPivotTableChangeSet, IPivotTableSnapshot } from '../types/json-types';
|
|
4
|
+
import type { IPivotTableOptions } from '../types/layout-type';
|
|
5
|
+
import { PivotLayoutTypeEnum, PivotTableFiledAreaEnum, PivotTableValuePositionEnum } from '../types/enum';
|
|
3
6
|
import { PivotTableLabelField, PivotTableValueField } from './table-field';
|
|
4
7
|
/**
|
|
5
8
|
* @class PivotModel represents a config model for a pivot table.
|
|
@@ -102,10 +105,11 @@ export declare class PivotModel {
|
|
|
102
105
|
/**
|
|
103
106
|
* @description Set the collapse status of the field. Those properties are used to save the collapse status of the field in the pivot table.
|
|
104
107
|
* @param {string} fieldId - The id of the field.
|
|
105
|
-
* @param {boolean} collapse - The
|
|
108
|
+
* @param {boolean | Record<string, boolean> | undefined} collapse - The field state, or undefined to clear it.
|
|
106
109
|
* @param {string} [item] - The item of the field.
|
|
110
|
+
* @param {readonly string[]} [items] - Cached members used to expand one item of a fully collapsed field.
|
|
107
111
|
*/
|
|
108
|
-
setCollapse(fieldId: string, collapse: boolean, item?: string): void;
|
|
112
|
+
setCollapse(fieldId: string, collapse: boolean | Record<string, boolean> | undefined, item?: string, items?: readonly string[]): void;
|
|
109
113
|
setLabelFilterInfo(fieldId: string, filterInfo: IPivotTableFilterInfo): void;
|
|
110
114
|
setValueFilterInfo(fieldId: string, filterInfo: IPivotTableValueFilter | undefined, index?: number): void;
|
|
111
115
|
getValueFilterInfo(fieldId: string): IPivotTableValueFilter | undefined;
|
|
@@ -239,10 +239,17 @@ export declare class PivotTable {
|
|
|
239
239
|
/**
|
|
240
240
|
* @description Set the collapse status of the field. Those properties are used to save the collapse status of the field in the pivot table.
|
|
241
241
|
* @param {string} fieldId - The id of the field.
|
|
242
|
-
* @param {boolean} collapse - The
|
|
242
|
+
* @param {boolean | Record<string, boolean> | undefined} collapse - The field state, or undefined to clear it.
|
|
243
243
|
* @param {string} [item] - The item of the field.
|
|
244
244
|
*/
|
|
245
|
-
setCollapse(fieldId: string, collapse: boolean, item?: string): void;
|
|
245
|
+
setCollapse(fieldId: string, collapse: boolean | Record<string, boolean> | undefined, item?: string): void;
|
|
246
|
+
/**
|
|
247
|
+
* @description Set the visible row hierarchy depth without querying the pivot table. Ancestors are expanded,
|
|
248
|
+
* the target and deeper parent fields are collapsed. Column fields and the Values position are unchanged.
|
|
249
|
+
* @param {string} fieldId - The row field to display as the deepest category.
|
|
250
|
+
* @returns {boolean} Whether the target is a row field.
|
|
251
|
+
*/
|
|
252
|
+
setRowCollapseLevel(fieldId: string): boolean;
|
|
246
253
|
/**
|
|
247
254
|
* - get the pivot view need query or not
|
|
248
255
|
* @param {number} viewVersion
|
|
@@ -504,12 +504,16 @@ export interface IPivotTableSetCollapseChange {
|
|
|
504
504
|
*/
|
|
505
505
|
fieldId: string;
|
|
506
506
|
/**
|
|
507
|
-
* @property {boolean} collapse The
|
|
507
|
+
* @property {boolean | Record<string, boolean> | undefined} collapse The field state, or undefined to clear it.
|
|
508
508
|
*/
|
|
509
|
-
collapse: boolean;
|
|
509
|
+
collapse: boolean | Record<string, boolean> | undefined;
|
|
510
510
|
/**
|
|
511
511
|
* @property {string} [item] The item associated with the collapse state.
|
|
512
512
|
*/
|
|
513
513
|
item?: string;
|
|
514
|
+
/** Previous full field state. Absent on legacy item-only changesets. */
|
|
515
|
+
previous?: {
|
|
516
|
+
collapse?: boolean | Record<string, boolean>;
|
|
517
|
+
};
|
|
514
518
|
}
|
|
515
519
|
export type IPivotTableChangeSet = IPivotTableAddFieldChange | IPivotTableSetSubtotalTypeChange | IPivotTableSetShowDataAsChange | IPivotTableRemoveFieldChange | IPivotTableRenameFieldChange | IPivotTableSetFilterInfoChange | IPivotTableSetSortInfoChange | IPivotTableUpdatePositionChange | IPivotTableUpdateValuePositionChange | IPivotTableSetOptionsChange | IPivotTableSetFormatChange | IPivotTableSetCollapseChange | IPivotUpdateSourceChange | IPivotTableSetValueFilterChange | IPivotTableSetLayoutChange;
|
package/lib/types/util.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { BaseGroupField } from './field/base-group-field';
|
|
2
2
|
import type { DataField } from './field/data-field';
|
|
3
3
|
import type { DateGroupField } from './field/date-group-field';
|
|
4
|
-
import type {
|
|
4
|
+
import type { PivotErrorTypeEnum, ST_PivotFilterOperatorEnum } from './types/enum';
|
|
5
|
+
import type { IDataFieldValue, IDateValue, IPivotTableCustomFilter, IPivotTableDateGroupInfo, IPivotTableFilterInfo, IPivotTableLabelCustomSortInfo, IPivotTableManualFilter, IPivotTableSortInfo, IValueFilterInfoItem } from './types/interface';
|
|
6
|
+
import type { IBaseGroupFieldJSON, IDataFieldJSON, IDateGroupFieldJSON } from './types/json-types';
|
|
7
|
+
import type { IMeasuresMapItem, ITupleItem } from './types/summary-type';
|
|
5
8
|
import { PivotTuple } from './summary/pivot-tuple';
|
|
6
|
-
import {
|
|
9
|
+
import { PivotDataFieldDataTypeEnum, PivotDateGroupFieldDateTypeEnum, PivotSubtotalTypeEnum, PivotTableFiledAreaEnum } from './types/enum';
|
|
10
|
+
import { PivotCellStyleTypeEnum } from './types/layout-type';
|
|
7
11
|
/**
|
|
8
12
|
* - judge the value is date like type
|
|
9
13
|
* @param {IDataFieldValue} value the date like value
|