@canvas-components/pivot-table 0.1.9 → 0.2.2

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/dist/index.d.cts CHANGED
@@ -153,6 +153,8 @@ interface PivotDimensionFilter {
153
153
  searchExact?: boolean;
154
154
  condition?: PivotFilterCondition;
155
155
  secondCondition?: PivotFilterCondition;
156
+ /** 动态条件列表;存在时优先于旧的两条件字段。 */
157
+ conditions?: PivotFilterCondition[];
156
158
  conditionRelation?: "and" | "or";
157
159
  }
158
160
  /** 行轴、列轴和报告筛选字段的独立过滤状态。 */
@@ -793,6 +795,8 @@ declare class PivotTable<RecordType = Record<string, unknown>> {
793
795
  private wheelScrollTarget;
794
796
  private wheelScrollFrameId;
795
797
  private wheelScrollLastTime;
798
+ private continuousScrollTimer;
799
+ private continuousScrollPointerId;
796
800
  private resizeSession;
797
801
  private resizeGuideX;
798
802
  private suppressNextClick;
@@ -920,6 +924,8 @@ declare class PivotTable<RecordType = Record<string, unknown>> {
920
924
  private beginScrollbarInteraction;
921
925
  private updateScrollbarDrag;
922
926
  private stepScrollbar;
927
+ private startContinuousScrollbarScroll;
928
+ private stopContinuousScrollbarScroll;
923
929
  private applyScrollPosition;
924
930
  private applyResize;
925
931
  private openFilterPanel;
@@ -935,6 +941,33 @@ declare class PivotTable<RecordType = Record<string, unknown>> {
935
941
  private render;
936
942
  }
937
943
 
944
+ /** 自定义字段可放置的透视区域。 */
945
+ type PivotFieldArea = "filter" | "column" | "row" | "value";
946
+ /** 自定义面板中的字段定义。 */
947
+ interface PivotField<RecordType = Record<string, unknown>> extends PivotDimension<RecordType> {
948
+ /** 勾选未使用字段时进入的默认区域。 */
949
+ defaultArea?: PivotFieldArea;
950
+ /** 字段进入值区域时使用的指标配置。 */
951
+ indicator?: Omit<PivotIndicator<RecordType>, "key" | "title" | "dataIndex"> & {
952
+ title?: string;
953
+ dataIndex?: PivotIndicator<RecordType>["dataIndex"];
954
+ };
955
+ }
956
+ /** 自定义面板四个区域内的有序字段键。 */
957
+ interface PivotFieldLayout {
958
+ filters: string[];
959
+ columns: string[];
960
+ rows: string[];
961
+ values: string[];
962
+ }
963
+
964
+ /** 将字段布局保存到 IndexedDB。 */
965
+ declare function savePivotFieldLayout(key: string, layout: PivotFieldLayout): Promise<void>;
966
+ /** 从 IndexedDB 读取字段布局;缓存内容无效时返回 undefined。 */
967
+ declare function loadPivotFieldLayout(key: string): Promise<PivotFieldLayout | undefined>;
968
+ /** 清除 IndexedDB 中指定键的字段布局。 */
969
+ declare function clearPivotFieldLayout(key: string): Promise<void>;
970
+
938
971
  /** 将原始记录聚合成第一版稀疏 PivotModel。 */
939
972
  declare function aggregatePivotRecords<RecordType>(params: {
940
973
  records: RecordType[];
@@ -1002,26 +1035,6 @@ declare function getPivotDimensionFilterOptions<RecordType>(params: {
1002
1035
  dimensionKey: string;
1003
1036
  }): PivotFilterOptionItem[];
1004
1037
 
1005
- /** 自定义字段可放置的透视区域。 */
1006
- type PivotFieldArea = "filter" | "column" | "row" | "value";
1007
- /** 自定义面板中的字段定义。 */
1008
- interface PivotField<RecordType = Record<string, unknown>> extends PivotDimension<RecordType> {
1009
- /** 勾选未使用字段时进入的默认区域。 */
1010
- defaultArea?: PivotFieldArea;
1011
- /** 字段进入值区域时使用的指标配置。 */
1012
- indicator?: Omit<PivotIndicator<RecordType>, "key" | "title" | "dataIndex"> & {
1013
- title?: string;
1014
- dataIndex?: PivotIndicator<RecordType>["dataIndex"];
1015
- };
1016
- }
1017
- /** 自定义面板四个区域内的有序字段键。 */
1018
- interface PivotFieldLayout {
1019
- filters: string[];
1020
- columns: string[];
1021
- rows: string[];
1022
- values: string[];
1023
- }
1024
-
1025
1038
  /** 创建四个区域均为空的字段布局。 */
1026
1039
  declare function createEmptyPivotFieldLayout(): PivotFieldLayout;
1027
1040
  /** 根据当前透视配置创建字段区域布局。 */
@@ -1216,4 +1229,4 @@ declare function flattenVisiblePivotLeaves(params: {
1216
1229
  defaultExpandDepth?: number;
1217
1230
  }): PivotNode[];
1218
1231
 
1219
- export { type BuiltInPivotAggregatorName, type PivotAggregateCell, type PivotAggregator, type PivotAggregatorContext, type PivotAggregatorRegistry, type PivotAxis, type PivotAxisScrollbarLayout, type PivotAxisSlot, type PivotBodyCellLayout, type PivotCellAddress, type PivotCellStyle, type PivotContextMenuRequest, type PivotDataIndex, type PivotDimension, type PivotDimensionFilter, type PivotDimensionFilterOption, type PivotDimensionFilterPanelRequest, type PivotDimensionHeaderContent, type PivotDimensionHeaderImageContent, type PivotDimensionHeaderTextContent, type PivotDimensionTitle, type PivotDimensionValue, type PivotExpansionChangeEvent, type PivotExportMatrix, type PivotExportOptions, type PivotField, type PivotFieldArea, type PivotFieldLayout, type PivotFilterAxis, type PivotFilterChangeEvent, type PivotFilterCondition, type PivotFilterConditionOperator, type PivotFilterOptionItem, type PivotFilterState, type PivotGrandTotalPosition, type PivotHeaderCellLayout, type PivotHighlightMode, type PivotHitRegion, type PivotHitTestResult, type PivotIndicator, type PivotIndicatorFormatContext, type PivotLayoutSnapshot, type PivotLoadingRequest, type PivotModel, type PivotNode, type PivotNodeKind, type PivotRect, type PivotRenderStats, type PivotReportFilterCellLayout, type PivotResizeHit, type PivotResolvedPath, type PivotScrollState, type PivotScrollbarAxis, type PivotScrollbarLayout, type PivotScrollbarRect, type PivotScrollbarRole, type PivotSelectionChangeEvent, type PivotSelectionRange, type PivotSelectionState, type PivotSortChangeEvent, type PivotSortRule, type PivotSubtotalPosition, PivotTable, type PivotTableOptions, type PivotTableStateSnapshot, type PivotTableTheme, type PivotTableUiOptions, type PivotTextAlign, type PivotTooltipRequest, type PivotTotalsOptions, type ResolvedPivotDimensionValue, aggregatePivotRecords, buildPivotDimensionTree, buildPivotLayoutSnapshot, computePivotScrollbarLayout, createBuiltInPivotAggregators, createEmptyPivotFieldLayout, createEmptyPivotFilterState, createPivotAggregatorRegistry, createPivotAxisSlots, createPivotCellKey, createPivotExportMatrix, createPivotFieldCatalog, createPivotFieldLayout, createPivotSelectionText, defaultPivotTableTheme, encodePivotDimensionValue, encodePivotPath, exportPivotMatrixToCsv, exportPivotMatrixToXlsx, filterPivotRecords, findPivotFieldArea, flattenVisiblePivotLeaves, getPivotDimensionFilterOptions, hitTestPivotLayout, hitTestPivotResize, hitTestPivotScrollbar, movePivotField, removePivotField, renderPivotTable, resolvePivotDefaultSorts, resolvePivotDimensionKey, resolvePivotDimensionTitle, resolvePivotDimensionValue, resolvePivotDimensionWidth, resolvePivotFieldLayoutOptions, resolvePivotIndicatorAggregator, resolvePivotValueFieldTitle };
1232
+ export { type BuiltInPivotAggregatorName, type PivotAggregateCell, type PivotAggregator, type PivotAggregatorContext, type PivotAggregatorRegistry, type PivotAxis, type PivotAxisScrollbarLayout, type PivotAxisSlot, type PivotBodyCellLayout, type PivotCellAddress, type PivotCellStyle, type PivotContextMenuRequest, type PivotDataIndex, type PivotDimension, type PivotDimensionFilter, type PivotDimensionFilterOption, type PivotDimensionFilterPanelRequest, type PivotDimensionHeaderContent, type PivotDimensionHeaderImageContent, type PivotDimensionHeaderTextContent, type PivotDimensionTitle, type PivotDimensionValue, type PivotExpansionChangeEvent, type PivotExportMatrix, type PivotExportOptions, type PivotField, type PivotFieldArea, type PivotFieldLayout, type PivotFilterAxis, type PivotFilterChangeEvent, type PivotFilterCondition, type PivotFilterConditionOperator, type PivotFilterOptionItem, type PivotFilterState, type PivotGrandTotalPosition, type PivotHeaderCellLayout, type PivotHighlightMode, type PivotHitRegion, type PivotHitTestResult, type PivotIndicator, type PivotIndicatorFormatContext, type PivotLayoutSnapshot, type PivotLoadingRequest, type PivotModel, type PivotNode, type PivotNodeKind, type PivotRect, type PivotRenderStats, type PivotReportFilterCellLayout, type PivotResizeHit, type PivotResolvedPath, type PivotScrollState, type PivotScrollbarAxis, type PivotScrollbarLayout, type PivotScrollbarRect, type PivotScrollbarRole, type PivotSelectionChangeEvent, type PivotSelectionRange, type PivotSelectionState, type PivotSortChangeEvent, type PivotSortRule, type PivotSubtotalPosition, PivotTable, type PivotTableOptions, type PivotTableStateSnapshot, type PivotTableTheme, type PivotTableUiOptions, type PivotTextAlign, type PivotTooltipRequest, type PivotTotalsOptions, type ResolvedPivotDimensionValue, aggregatePivotRecords, buildPivotDimensionTree, buildPivotLayoutSnapshot, clearPivotFieldLayout, computePivotScrollbarLayout, createBuiltInPivotAggregators, createEmptyPivotFieldLayout, createEmptyPivotFilterState, createPivotAggregatorRegistry, createPivotAxisSlots, createPivotCellKey, createPivotExportMatrix, createPivotFieldCatalog, createPivotFieldLayout, createPivotSelectionText, defaultPivotTableTheme, encodePivotDimensionValue, encodePivotPath, exportPivotMatrixToCsv, exportPivotMatrixToXlsx, filterPivotRecords, findPivotFieldArea, flattenVisiblePivotLeaves, getPivotDimensionFilterOptions, hitTestPivotLayout, hitTestPivotResize, hitTestPivotScrollbar, loadPivotFieldLayout, movePivotField, removePivotField, renderPivotTable, resolvePivotDefaultSorts, resolvePivotDimensionKey, resolvePivotDimensionTitle, resolvePivotDimensionValue, resolvePivotDimensionWidth, resolvePivotFieldLayoutOptions, resolvePivotIndicatorAggregator, resolvePivotValueFieldTitle, savePivotFieldLayout };
package/dist/index.d.ts CHANGED
@@ -153,6 +153,8 @@ interface PivotDimensionFilter {
153
153
  searchExact?: boolean;
154
154
  condition?: PivotFilterCondition;
155
155
  secondCondition?: PivotFilterCondition;
156
+ /** 动态条件列表;存在时优先于旧的两条件字段。 */
157
+ conditions?: PivotFilterCondition[];
156
158
  conditionRelation?: "and" | "or";
157
159
  }
158
160
  /** 行轴、列轴和报告筛选字段的独立过滤状态。 */
@@ -793,6 +795,8 @@ declare class PivotTable<RecordType = Record<string, unknown>> {
793
795
  private wheelScrollTarget;
794
796
  private wheelScrollFrameId;
795
797
  private wheelScrollLastTime;
798
+ private continuousScrollTimer;
799
+ private continuousScrollPointerId;
796
800
  private resizeSession;
797
801
  private resizeGuideX;
798
802
  private suppressNextClick;
@@ -920,6 +924,8 @@ declare class PivotTable<RecordType = Record<string, unknown>> {
920
924
  private beginScrollbarInteraction;
921
925
  private updateScrollbarDrag;
922
926
  private stepScrollbar;
927
+ private startContinuousScrollbarScroll;
928
+ private stopContinuousScrollbarScroll;
923
929
  private applyScrollPosition;
924
930
  private applyResize;
925
931
  private openFilterPanel;
@@ -935,6 +941,33 @@ declare class PivotTable<RecordType = Record<string, unknown>> {
935
941
  private render;
936
942
  }
937
943
 
944
+ /** 自定义字段可放置的透视区域。 */
945
+ type PivotFieldArea = "filter" | "column" | "row" | "value";
946
+ /** 自定义面板中的字段定义。 */
947
+ interface PivotField<RecordType = Record<string, unknown>> extends PivotDimension<RecordType> {
948
+ /** 勾选未使用字段时进入的默认区域。 */
949
+ defaultArea?: PivotFieldArea;
950
+ /** 字段进入值区域时使用的指标配置。 */
951
+ indicator?: Omit<PivotIndicator<RecordType>, "key" | "title" | "dataIndex"> & {
952
+ title?: string;
953
+ dataIndex?: PivotIndicator<RecordType>["dataIndex"];
954
+ };
955
+ }
956
+ /** 自定义面板四个区域内的有序字段键。 */
957
+ interface PivotFieldLayout {
958
+ filters: string[];
959
+ columns: string[];
960
+ rows: string[];
961
+ values: string[];
962
+ }
963
+
964
+ /** 将字段布局保存到 IndexedDB。 */
965
+ declare function savePivotFieldLayout(key: string, layout: PivotFieldLayout): Promise<void>;
966
+ /** 从 IndexedDB 读取字段布局;缓存内容无效时返回 undefined。 */
967
+ declare function loadPivotFieldLayout(key: string): Promise<PivotFieldLayout | undefined>;
968
+ /** 清除 IndexedDB 中指定键的字段布局。 */
969
+ declare function clearPivotFieldLayout(key: string): Promise<void>;
970
+
938
971
  /** 将原始记录聚合成第一版稀疏 PivotModel。 */
939
972
  declare function aggregatePivotRecords<RecordType>(params: {
940
973
  records: RecordType[];
@@ -1002,26 +1035,6 @@ declare function getPivotDimensionFilterOptions<RecordType>(params: {
1002
1035
  dimensionKey: string;
1003
1036
  }): PivotFilterOptionItem[];
1004
1037
 
1005
- /** 自定义字段可放置的透视区域。 */
1006
- type PivotFieldArea = "filter" | "column" | "row" | "value";
1007
- /** 自定义面板中的字段定义。 */
1008
- interface PivotField<RecordType = Record<string, unknown>> extends PivotDimension<RecordType> {
1009
- /** 勾选未使用字段时进入的默认区域。 */
1010
- defaultArea?: PivotFieldArea;
1011
- /** 字段进入值区域时使用的指标配置。 */
1012
- indicator?: Omit<PivotIndicator<RecordType>, "key" | "title" | "dataIndex"> & {
1013
- title?: string;
1014
- dataIndex?: PivotIndicator<RecordType>["dataIndex"];
1015
- };
1016
- }
1017
- /** 自定义面板四个区域内的有序字段键。 */
1018
- interface PivotFieldLayout {
1019
- filters: string[];
1020
- columns: string[];
1021
- rows: string[];
1022
- values: string[];
1023
- }
1024
-
1025
1038
  /** 创建四个区域均为空的字段布局。 */
1026
1039
  declare function createEmptyPivotFieldLayout(): PivotFieldLayout;
1027
1040
  /** 根据当前透视配置创建字段区域布局。 */
@@ -1216,4 +1229,4 @@ declare function flattenVisiblePivotLeaves(params: {
1216
1229
  defaultExpandDepth?: number;
1217
1230
  }): PivotNode[];
1218
1231
 
1219
- export { type BuiltInPivotAggregatorName, type PivotAggregateCell, type PivotAggregator, type PivotAggregatorContext, type PivotAggregatorRegistry, type PivotAxis, type PivotAxisScrollbarLayout, type PivotAxisSlot, type PivotBodyCellLayout, type PivotCellAddress, type PivotCellStyle, type PivotContextMenuRequest, type PivotDataIndex, type PivotDimension, type PivotDimensionFilter, type PivotDimensionFilterOption, type PivotDimensionFilterPanelRequest, type PivotDimensionHeaderContent, type PivotDimensionHeaderImageContent, type PivotDimensionHeaderTextContent, type PivotDimensionTitle, type PivotDimensionValue, type PivotExpansionChangeEvent, type PivotExportMatrix, type PivotExportOptions, type PivotField, type PivotFieldArea, type PivotFieldLayout, type PivotFilterAxis, type PivotFilterChangeEvent, type PivotFilterCondition, type PivotFilterConditionOperator, type PivotFilterOptionItem, type PivotFilterState, type PivotGrandTotalPosition, type PivotHeaderCellLayout, type PivotHighlightMode, type PivotHitRegion, type PivotHitTestResult, type PivotIndicator, type PivotIndicatorFormatContext, type PivotLayoutSnapshot, type PivotLoadingRequest, type PivotModel, type PivotNode, type PivotNodeKind, type PivotRect, type PivotRenderStats, type PivotReportFilterCellLayout, type PivotResizeHit, type PivotResolvedPath, type PivotScrollState, type PivotScrollbarAxis, type PivotScrollbarLayout, type PivotScrollbarRect, type PivotScrollbarRole, type PivotSelectionChangeEvent, type PivotSelectionRange, type PivotSelectionState, type PivotSortChangeEvent, type PivotSortRule, type PivotSubtotalPosition, PivotTable, type PivotTableOptions, type PivotTableStateSnapshot, type PivotTableTheme, type PivotTableUiOptions, type PivotTextAlign, type PivotTooltipRequest, type PivotTotalsOptions, type ResolvedPivotDimensionValue, aggregatePivotRecords, buildPivotDimensionTree, buildPivotLayoutSnapshot, computePivotScrollbarLayout, createBuiltInPivotAggregators, createEmptyPivotFieldLayout, createEmptyPivotFilterState, createPivotAggregatorRegistry, createPivotAxisSlots, createPivotCellKey, createPivotExportMatrix, createPivotFieldCatalog, createPivotFieldLayout, createPivotSelectionText, defaultPivotTableTheme, encodePivotDimensionValue, encodePivotPath, exportPivotMatrixToCsv, exportPivotMatrixToXlsx, filterPivotRecords, findPivotFieldArea, flattenVisiblePivotLeaves, getPivotDimensionFilterOptions, hitTestPivotLayout, hitTestPivotResize, hitTestPivotScrollbar, movePivotField, removePivotField, renderPivotTable, resolvePivotDefaultSorts, resolvePivotDimensionKey, resolvePivotDimensionTitle, resolvePivotDimensionValue, resolvePivotDimensionWidth, resolvePivotFieldLayoutOptions, resolvePivotIndicatorAggregator, resolvePivotValueFieldTitle };
1232
+ export { type BuiltInPivotAggregatorName, type PivotAggregateCell, type PivotAggregator, type PivotAggregatorContext, type PivotAggregatorRegistry, type PivotAxis, type PivotAxisScrollbarLayout, type PivotAxisSlot, type PivotBodyCellLayout, type PivotCellAddress, type PivotCellStyle, type PivotContextMenuRequest, type PivotDataIndex, type PivotDimension, type PivotDimensionFilter, type PivotDimensionFilterOption, type PivotDimensionFilterPanelRequest, type PivotDimensionHeaderContent, type PivotDimensionHeaderImageContent, type PivotDimensionHeaderTextContent, type PivotDimensionTitle, type PivotDimensionValue, type PivotExpansionChangeEvent, type PivotExportMatrix, type PivotExportOptions, type PivotField, type PivotFieldArea, type PivotFieldLayout, type PivotFilterAxis, type PivotFilterChangeEvent, type PivotFilterCondition, type PivotFilterConditionOperator, type PivotFilterOptionItem, type PivotFilterState, type PivotGrandTotalPosition, type PivotHeaderCellLayout, type PivotHighlightMode, type PivotHitRegion, type PivotHitTestResult, type PivotIndicator, type PivotIndicatorFormatContext, type PivotLayoutSnapshot, type PivotLoadingRequest, type PivotModel, type PivotNode, type PivotNodeKind, type PivotRect, type PivotRenderStats, type PivotReportFilterCellLayout, type PivotResizeHit, type PivotResolvedPath, type PivotScrollState, type PivotScrollbarAxis, type PivotScrollbarLayout, type PivotScrollbarRect, type PivotScrollbarRole, type PivotSelectionChangeEvent, type PivotSelectionRange, type PivotSelectionState, type PivotSortChangeEvent, type PivotSortRule, type PivotSubtotalPosition, PivotTable, type PivotTableOptions, type PivotTableStateSnapshot, type PivotTableTheme, type PivotTableUiOptions, type PivotTextAlign, type PivotTooltipRequest, type PivotTotalsOptions, type ResolvedPivotDimensionValue, aggregatePivotRecords, buildPivotDimensionTree, buildPivotLayoutSnapshot, clearPivotFieldLayout, computePivotScrollbarLayout, createBuiltInPivotAggregators, createEmptyPivotFieldLayout, createEmptyPivotFilterState, createPivotAggregatorRegistry, createPivotAxisSlots, createPivotCellKey, createPivotExportMatrix, createPivotFieldCatalog, createPivotFieldLayout, createPivotSelectionText, defaultPivotTableTheme, encodePivotDimensionValue, encodePivotPath, exportPivotMatrixToCsv, exportPivotMatrixToXlsx, filterPivotRecords, findPivotFieldArea, flattenVisiblePivotLeaves, getPivotDimensionFilterOptions, hitTestPivotLayout, hitTestPivotResize, hitTestPivotScrollbar, loadPivotFieldLayout, movePivotField, removePivotField, renderPivotTable, resolvePivotDefaultSorts, resolvePivotDimensionKey, resolvePivotDimensionTitle, resolvePivotDimensionValue, resolvePivotDimensionWidth, resolvePivotFieldLayoutOptions, resolvePivotIndicatorAggregator, resolvePivotValueFieldTitle, savePivotFieldLayout };