@univerjs-pro/engine-pivot 1.0.0-alpha.8 → 1.0.0-beta.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.
@@ -146,8 +146,10 @@ export declare class PivotModel {
146
146
  isExistFieldName(fieldName: string): boolean;
147
147
  /**
148
148
  * @description Rename a field in the pivot table.
149
+ * Renaming a field to its current display name is an idempotent no-op. A display name already
150
+ * used by another field is rejected.
149
151
  * @param {string} fieldId - The id of the field to be renamed.
150
- * @param displayName - The new display name of the field.
152
+ * @param {string} displayName - The new display name of the field.
151
153
  * @returns {void}
152
154
  */
153
155
  renameField(fieldId: string, displayName: string): void;
@@ -45,5 +45,6 @@ export declare class NodeTree {
45
45
  setName(name: string): void;
46
46
  addNode(node: NodeTree, path: string, sortMap: Record<string, number> | undefined, sortType: PivotDataFieldSortOperatorEnum): void;
47
47
  sortNode(path: string, sortedMap: Record<string, number>, sortType: PivotDataFieldSortOperatorEnum): void;
48
+ sortChildrenByValue(fieldId: string, sortType: PivotDataFieldSortOperatorEnum, getValue: (index: number) => number | undefined): void;
48
49
  getNode(path: string): NodeTree | undefined;
49
50
  }
@@ -1,5 +1,5 @@
1
1
  import type { DataField } from '../field/data-field';
2
- import type { IDimensionMapItem, IMeasuresMapItem, IPivotSummaryLevelPool, IPivotTableQueryData, IPivotTableValueFilter, ITupleItem, IValueFilterInfoItem, PivotErrorTypeEnum, PivotSubtotalTypeEnum } from '../types';
2
+ import type { IDimensionMapItem, IMeasuresMapItem, IPivotSummaryLevelPool, IPivotTableQueryData, IPivotTableValueFilter, IPivotTableValueSortInfo, ITupleItem, IValueFilterInfoItem, PivotErrorTypeEnum, PivotSubtotalTypeEnum } from '../types';
3
3
  import type { TupleGroup } from './tuple-group';
4
4
  import { PivotDataFieldSortOperatorEnum } from '../types';
5
5
  import { NodeTree } from './node-tree';
@@ -45,6 +45,7 @@ export declare class SummaryManager {
45
45
  type: PivotDataFieldSortOperatorEnum;
46
46
  sortMap: Record<string, number>;
47
47
  }>;
48
+ valueSortInfo: Record<string, IPivotTableValueSortInfo>;
48
49
  valueFilterInfo: IValueFilterInfoItem[];
49
50
  subtotalMap: Record<string, {
50
51
  subTotal: PivotSubtotalTypeEnum;
@@ -57,6 +58,7 @@ export declare class SummaryManager {
57
58
  } | undefined;
58
59
  getSortedMap(tableFieldId: string, dataField: DataField): Record<string, number>;
59
60
  doSummary(): void;
61
+ private _applyValueSorts;
60
62
  private _getIndex;
61
63
  buildNodeTree(ignoreLeafSet: Set<number>): void;
62
64
  createTupleWithoutCheck(paths: string[], nodeIndex: number, tupleKey: string): void;
@@ -117,6 +117,8 @@ export interface IPivotTableValueFilter {
117
117
  operator: ST_PivotFilterOperatorEnum;
118
118
  expected: any;
119
119
  valueFieldId: string;
120
+ /** Whether a count/percent rank filter keeps the bottom values instead of the top values. */
121
+ isBottom?: boolean;
120
122
  }
121
123
  export interface IPivotTableShowDataAsInfo {
122
124
  type: PivotShowAsTypeEnum;