@canvas-components/pivot-table 0.2.1 → 0.2.3
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.cjs +485 -61
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +73 -23
- package/dist/index.d.ts +73 -23
- package/dist/index.js +484 -63
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -261,6 +261,18 @@ type PivotAggregatorRegistry<RecordType = Record<string, unknown>> = Record<stri
|
|
|
261
261
|
/** 第一阶段内置聚合器名称。 */
|
|
262
262
|
type BuiltInPivotAggregatorName = "sum" | "avg" | "count" | "distinctCount" | "min" | "max";
|
|
263
263
|
|
|
264
|
+
/** 透视表指标的快捷数据显示格式。 */
|
|
265
|
+
type PivotIndicatorDataFormatType = "default" | "text" | "number" | "thousands" | "decimal" | "percent" | "percentDecimal" | "scientific" | "numberToChineseUpper" | "chineseUpperToNumber" | "cny" | "cnyDecimal" | "usd" | "usdDecimal" | "dateSlash" | "dateDash" | "dateFullCN" | "time" | "timeShort" | "datetime" | "datetime12" | "custom";
|
|
266
|
+
/** 透视表指标的精确数据显示格式配置。 */
|
|
267
|
+
interface PivotIndicatorDataFormatOptions {
|
|
268
|
+
type: PivotIndicatorDataFormatType;
|
|
269
|
+
decimalPlaces?: number;
|
|
270
|
+
useGrouping?: boolean;
|
|
271
|
+
symbol?: string;
|
|
272
|
+
pattern?: string;
|
|
273
|
+
}
|
|
274
|
+
/** 透视表指标数据显示格式。 */
|
|
275
|
+
type PivotIndicatorDataFormat = PivotIndicatorDataFormatType | PivotIndicatorDataFormatOptions;
|
|
264
276
|
/** 指标格式化上下文。 */
|
|
265
277
|
interface PivotIndicatorFormatContext<RecordType> {
|
|
266
278
|
indicator: PivotIndicator<RecordType>;
|
|
@@ -284,6 +296,8 @@ interface PivotIndicator<RecordType = Record<string, unknown>> {
|
|
|
284
296
|
formatter?: (value: unknown, context: PivotIndicatorFormatContext<RecordType>) => string;
|
|
285
297
|
/** 数字精度。 */
|
|
286
298
|
precision?: number;
|
|
299
|
+
/** 指标数据显示格式。 */
|
|
300
|
+
dataFormat?: PivotIndicatorDataFormat;
|
|
287
301
|
/** 指标列宽。 */
|
|
288
302
|
width?: number;
|
|
289
303
|
/** 指标对齐方式。 */
|
|
@@ -383,11 +397,18 @@ interface PivotTooltipRequest {
|
|
|
383
397
|
interface PivotLoadingRequest {
|
|
384
398
|
text?: string;
|
|
385
399
|
}
|
|
386
|
-
/**
|
|
400
|
+
/** 透视表密度,与 ListTable 右键菜单语义保持一致。 */
|
|
401
|
+
type PivotTableDensity = "comfortable" | "middle" | "compact" | "ultra-compact" | "auto";
|
|
402
|
+
/** PivotTable 右键菜单请求。 */
|
|
387
403
|
interface PivotContextMenuRequest {
|
|
388
404
|
x: number;
|
|
389
405
|
y: number;
|
|
390
|
-
|
|
406
|
+
target?: "header" | "body" | "summary";
|
|
407
|
+
title?: string;
|
|
408
|
+
axis?: PivotFilterAxis;
|
|
409
|
+
nodeKind?: PivotNodeKind | "empty";
|
|
410
|
+
indicatorKey?: string;
|
|
411
|
+
recordCount?: number;
|
|
391
412
|
onCopy: () => void;
|
|
392
413
|
onCopySelection?: () => void;
|
|
393
414
|
customSelection?: {
|
|
@@ -406,6 +427,24 @@ interface PivotContextMenuRequest {
|
|
|
406
427
|
}) => void;
|
|
407
428
|
onExportCsv: () => void;
|
|
408
429
|
onExportXlsx: () => void;
|
|
430
|
+
sortDirection?: "asc" | "desc" | null;
|
|
431
|
+
onSortAsc?: () => void;
|
|
432
|
+
onSortDesc?: () => void;
|
|
433
|
+
onClearSort?: () => void;
|
|
434
|
+
onOpenFilter?: () => void;
|
|
435
|
+
expanded?: boolean;
|
|
436
|
+
onExpand?: () => void;
|
|
437
|
+
onCollapse?: () => void;
|
|
438
|
+
onExpandAll?: () => void;
|
|
439
|
+
onCollapseAll?: () => void;
|
|
440
|
+
summaryAggregator?: BuiltInPivotAggregatorName;
|
|
441
|
+
summaryPrecision?: number;
|
|
442
|
+
onChangeSummaryAggregator?: (aggregator: BuiltInPivotAggregatorName) => void;
|
|
443
|
+
onChangeSummaryPrecision?: (precision: number | undefined) => void;
|
|
444
|
+
density?: PivotTableDensity;
|
|
445
|
+
onChangeDensity?: (density: PivotTableDensity) => void;
|
|
446
|
+
dataFormat?: PivotIndicatorDataFormat;
|
|
447
|
+
onChangeDataFormat?: (dataFormat: PivotIndicatorDataFormat) => void;
|
|
409
448
|
onClose: () => void;
|
|
410
449
|
}
|
|
411
450
|
/** PivotTable UI 适配协议。 */
|
|
@@ -866,6 +905,9 @@ declare class PivotTable<RecordType = Record<string, unknown>> {
|
|
|
866
905
|
restoreState(snapshot: PivotTableStateSnapshot): boolean;
|
|
867
906
|
/** 选中指定值单元格。 */
|
|
868
907
|
selectCell(address: PivotCellAddress, extend?: boolean): PivotSelectionState | null;
|
|
908
|
+
/** 鼠标命中的单元格已在视口内,选中时不再校正滚动位置。 */
|
|
909
|
+
private selectPointerCell;
|
|
910
|
+
private commitCellSelection;
|
|
869
911
|
/** 选中行轴或列轴维度节点。 */
|
|
870
912
|
selectNode(axis: PivotAxis, nodeId: string): PivotSelectionState | null;
|
|
871
913
|
/** 将指定稳定地址滚动到可视区域。 */
|
|
@@ -905,6 +947,7 @@ declare class PivotTable<RecordType = Record<string, unknown>> {
|
|
|
905
947
|
private stopWheelScrollSmoothing;
|
|
906
948
|
private advanceWheelScrollSmoothing;
|
|
907
949
|
private readonly handleContextMenu;
|
|
950
|
+
private createContextMenuSettings;
|
|
908
951
|
private updateTooltip;
|
|
909
952
|
private readonly handlePointerDown;
|
|
910
953
|
private readonly handlePointerUp;
|
|
@@ -941,6 +984,33 @@ declare class PivotTable<RecordType = Record<string, unknown>> {
|
|
|
941
984
|
private render;
|
|
942
985
|
}
|
|
943
986
|
|
|
987
|
+
/** 自定义字段可放置的透视区域。 */
|
|
988
|
+
type PivotFieldArea = "filter" | "column" | "row" | "value";
|
|
989
|
+
/** 自定义面板中的字段定义。 */
|
|
990
|
+
interface PivotField<RecordType = Record<string, unknown>> extends PivotDimension<RecordType> {
|
|
991
|
+
/** 勾选未使用字段时进入的默认区域。 */
|
|
992
|
+
defaultArea?: PivotFieldArea;
|
|
993
|
+
/** 字段进入值区域时使用的指标配置。 */
|
|
994
|
+
indicator?: Omit<PivotIndicator<RecordType>, "key" | "title" | "dataIndex"> & {
|
|
995
|
+
title?: string;
|
|
996
|
+
dataIndex?: PivotIndicator<RecordType>["dataIndex"];
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
/** 自定义面板四个区域内的有序字段键。 */
|
|
1000
|
+
interface PivotFieldLayout {
|
|
1001
|
+
filters: string[];
|
|
1002
|
+
columns: string[];
|
|
1003
|
+
rows: string[];
|
|
1004
|
+
values: string[];
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
/** 将字段布局保存到 IndexedDB。 */
|
|
1008
|
+
declare function savePivotFieldLayout(key: string, layout: PivotFieldLayout): Promise<void>;
|
|
1009
|
+
/** 从 IndexedDB 读取字段布局;缓存内容无效时返回 undefined。 */
|
|
1010
|
+
declare function loadPivotFieldLayout(key: string): Promise<PivotFieldLayout | undefined>;
|
|
1011
|
+
/** 清除 IndexedDB 中指定键的字段布局。 */
|
|
1012
|
+
declare function clearPivotFieldLayout(key: string): Promise<void>;
|
|
1013
|
+
|
|
944
1014
|
/** 将原始记录聚合成第一版稀疏 PivotModel。 */
|
|
945
1015
|
declare function aggregatePivotRecords<RecordType>(params: {
|
|
946
1016
|
records: RecordType[];
|
|
@@ -1008,26 +1078,6 @@ declare function getPivotDimensionFilterOptions<RecordType>(params: {
|
|
|
1008
1078
|
dimensionKey: string;
|
|
1009
1079
|
}): PivotFilterOptionItem[];
|
|
1010
1080
|
|
|
1011
|
-
/** 自定义字段可放置的透视区域。 */
|
|
1012
|
-
type PivotFieldArea = "filter" | "column" | "row" | "value";
|
|
1013
|
-
/** 自定义面板中的字段定义。 */
|
|
1014
|
-
interface PivotField<RecordType = Record<string, unknown>> extends PivotDimension<RecordType> {
|
|
1015
|
-
/** 勾选未使用字段时进入的默认区域。 */
|
|
1016
|
-
defaultArea?: PivotFieldArea;
|
|
1017
|
-
/** 字段进入值区域时使用的指标配置。 */
|
|
1018
|
-
indicator?: Omit<PivotIndicator<RecordType>, "key" | "title" | "dataIndex"> & {
|
|
1019
|
-
title?: string;
|
|
1020
|
-
dataIndex?: PivotIndicator<RecordType>["dataIndex"];
|
|
1021
|
-
};
|
|
1022
|
-
}
|
|
1023
|
-
/** 自定义面板四个区域内的有序字段键。 */
|
|
1024
|
-
interface PivotFieldLayout {
|
|
1025
|
-
filters: string[];
|
|
1026
|
-
columns: string[];
|
|
1027
|
-
rows: string[];
|
|
1028
|
-
values: string[];
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
1081
|
/** 创建四个区域均为空的字段布局。 */
|
|
1032
1082
|
declare function createEmptyPivotFieldLayout(): PivotFieldLayout;
|
|
1033
1083
|
/** 根据当前透视配置创建字段区域布局。 */
|
|
@@ -1222,4 +1272,4 @@ declare function flattenVisiblePivotLeaves(params: {
|
|
|
1222
1272
|
defaultExpandDepth?: number;
|
|
1223
1273
|
}): PivotNode[];
|
|
1224
1274
|
|
|
1225
|
-
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 };
|
|
1275
|
+
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 PivotIndicatorDataFormat, type PivotIndicatorDataFormatOptions, type PivotIndicatorDataFormatType, 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 PivotTableDensity, 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
|
@@ -261,6 +261,18 @@ type PivotAggregatorRegistry<RecordType = Record<string, unknown>> = Record<stri
|
|
|
261
261
|
/** 第一阶段内置聚合器名称。 */
|
|
262
262
|
type BuiltInPivotAggregatorName = "sum" | "avg" | "count" | "distinctCount" | "min" | "max";
|
|
263
263
|
|
|
264
|
+
/** 透视表指标的快捷数据显示格式。 */
|
|
265
|
+
type PivotIndicatorDataFormatType = "default" | "text" | "number" | "thousands" | "decimal" | "percent" | "percentDecimal" | "scientific" | "numberToChineseUpper" | "chineseUpperToNumber" | "cny" | "cnyDecimal" | "usd" | "usdDecimal" | "dateSlash" | "dateDash" | "dateFullCN" | "time" | "timeShort" | "datetime" | "datetime12" | "custom";
|
|
266
|
+
/** 透视表指标的精确数据显示格式配置。 */
|
|
267
|
+
interface PivotIndicatorDataFormatOptions {
|
|
268
|
+
type: PivotIndicatorDataFormatType;
|
|
269
|
+
decimalPlaces?: number;
|
|
270
|
+
useGrouping?: boolean;
|
|
271
|
+
symbol?: string;
|
|
272
|
+
pattern?: string;
|
|
273
|
+
}
|
|
274
|
+
/** 透视表指标数据显示格式。 */
|
|
275
|
+
type PivotIndicatorDataFormat = PivotIndicatorDataFormatType | PivotIndicatorDataFormatOptions;
|
|
264
276
|
/** 指标格式化上下文。 */
|
|
265
277
|
interface PivotIndicatorFormatContext<RecordType> {
|
|
266
278
|
indicator: PivotIndicator<RecordType>;
|
|
@@ -284,6 +296,8 @@ interface PivotIndicator<RecordType = Record<string, unknown>> {
|
|
|
284
296
|
formatter?: (value: unknown, context: PivotIndicatorFormatContext<RecordType>) => string;
|
|
285
297
|
/** 数字精度。 */
|
|
286
298
|
precision?: number;
|
|
299
|
+
/** 指标数据显示格式。 */
|
|
300
|
+
dataFormat?: PivotIndicatorDataFormat;
|
|
287
301
|
/** 指标列宽。 */
|
|
288
302
|
width?: number;
|
|
289
303
|
/** 指标对齐方式。 */
|
|
@@ -383,11 +397,18 @@ interface PivotTooltipRequest {
|
|
|
383
397
|
interface PivotLoadingRequest {
|
|
384
398
|
text?: string;
|
|
385
399
|
}
|
|
386
|
-
/**
|
|
400
|
+
/** 透视表密度,与 ListTable 右键菜单语义保持一致。 */
|
|
401
|
+
type PivotTableDensity = "comfortable" | "middle" | "compact" | "ultra-compact" | "auto";
|
|
402
|
+
/** PivotTable 右键菜单请求。 */
|
|
387
403
|
interface PivotContextMenuRequest {
|
|
388
404
|
x: number;
|
|
389
405
|
y: number;
|
|
390
|
-
|
|
406
|
+
target?: "header" | "body" | "summary";
|
|
407
|
+
title?: string;
|
|
408
|
+
axis?: PivotFilterAxis;
|
|
409
|
+
nodeKind?: PivotNodeKind | "empty";
|
|
410
|
+
indicatorKey?: string;
|
|
411
|
+
recordCount?: number;
|
|
391
412
|
onCopy: () => void;
|
|
392
413
|
onCopySelection?: () => void;
|
|
393
414
|
customSelection?: {
|
|
@@ -406,6 +427,24 @@ interface PivotContextMenuRequest {
|
|
|
406
427
|
}) => void;
|
|
407
428
|
onExportCsv: () => void;
|
|
408
429
|
onExportXlsx: () => void;
|
|
430
|
+
sortDirection?: "asc" | "desc" | null;
|
|
431
|
+
onSortAsc?: () => void;
|
|
432
|
+
onSortDesc?: () => void;
|
|
433
|
+
onClearSort?: () => void;
|
|
434
|
+
onOpenFilter?: () => void;
|
|
435
|
+
expanded?: boolean;
|
|
436
|
+
onExpand?: () => void;
|
|
437
|
+
onCollapse?: () => void;
|
|
438
|
+
onExpandAll?: () => void;
|
|
439
|
+
onCollapseAll?: () => void;
|
|
440
|
+
summaryAggregator?: BuiltInPivotAggregatorName;
|
|
441
|
+
summaryPrecision?: number;
|
|
442
|
+
onChangeSummaryAggregator?: (aggregator: BuiltInPivotAggregatorName) => void;
|
|
443
|
+
onChangeSummaryPrecision?: (precision: number | undefined) => void;
|
|
444
|
+
density?: PivotTableDensity;
|
|
445
|
+
onChangeDensity?: (density: PivotTableDensity) => void;
|
|
446
|
+
dataFormat?: PivotIndicatorDataFormat;
|
|
447
|
+
onChangeDataFormat?: (dataFormat: PivotIndicatorDataFormat) => void;
|
|
409
448
|
onClose: () => void;
|
|
410
449
|
}
|
|
411
450
|
/** PivotTable UI 适配协议。 */
|
|
@@ -866,6 +905,9 @@ declare class PivotTable<RecordType = Record<string, unknown>> {
|
|
|
866
905
|
restoreState(snapshot: PivotTableStateSnapshot): boolean;
|
|
867
906
|
/** 选中指定值单元格。 */
|
|
868
907
|
selectCell(address: PivotCellAddress, extend?: boolean): PivotSelectionState | null;
|
|
908
|
+
/** 鼠标命中的单元格已在视口内,选中时不再校正滚动位置。 */
|
|
909
|
+
private selectPointerCell;
|
|
910
|
+
private commitCellSelection;
|
|
869
911
|
/** 选中行轴或列轴维度节点。 */
|
|
870
912
|
selectNode(axis: PivotAxis, nodeId: string): PivotSelectionState | null;
|
|
871
913
|
/** 将指定稳定地址滚动到可视区域。 */
|
|
@@ -905,6 +947,7 @@ declare class PivotTable<RecordType = Record<string, unknown>> {
|
|
|
905
947
|
private stopWheelScrollSmoothing;
|
|
906
948
|
private advanceWheelScrollSmoothing;
|
|
907
949
|
private readonly handleContextMenu;
|
|
950
|
+
private createContextMenuSettings;
|
|
908
951
|
private updateTooltip;
|
|
909
952
|
private readonly handlePointerDown;
|
|
910
953
|
private readonly handlePointerUp;
|
|
@@ -941,6 +984,33 @@ declare class PivotTable<RecordType = Record<string, unknown>> {
|
|
|
941
984
|
private render;
|
|
942
985
|
}
|
|
943
986
|
|
|
987
|
+
/** 自定义字段可放置的透视区域。 */
|
|
988
|
+
type PivotFieldArea = "filter" | "column" | "row" | "value";
|
|
989
|
+
/** 自定义面板中的字段定义。 */
|
|
990
|
+
interface PivotField<RecordType = Record<string, unknown>> extends PivotDimension<RecordType> {
|
|
991
|
+
/** 勾选未使用字段时进入的默认区域。 */
|
|
992
|
+
defaultArea?: PivotFieldArea;
|
|
993
|
+
/** 字段进入值区域时使用的指标配置。 */
|
|
994
|
+
indicator?: Omit<PivotIndicator<RecordType>, "key" | "title" | "dataIndex"> & {
|
|
995
|
+
title?: string;
|
|
996
|
+
dataIndex?: PivotIndicator<RecordType>["dataIndex"];
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
/** 自定义面板四个区域内的有序字段键。 */
|
|
1000
|
+
interface PivotFieldLayout {
|
|
1001
|
+
filters: string[];
|
|
1002
|
+
columns: string[];
|
|
1003
|
+
rows: string[];
|
|
1004
|
+
values: string[];
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
/** 将字段布局保存到 IndexedDB。 */
|
|
1008
|
+
declare function savePivotFieldLayout(key: string, layout: PivotFieldLayout): Promise<void>;
|
|
1009
|
+
/** 从 IndexedDB 读取字段布局;缓存内容无效时返回 undefined。 */
|
|
1010
|
+
declare function loadPivotFieldLayout(key: string): Promise<PivotFieldLayout | undefined>;
|
|
1011
|
+
/** 清除 IndexedDB 中指定键的字段布局。 */
|
|
1012
|
+
declare function clearPivotFieldLayout(key: string): Promise<void>;
|
|
1013
|
+
|
|
944
1014
|
/** 将原始记录聚合成第一版稀疏 PivotModel。 */
|
|
945
1015
|
declare function aggregatePivotRecords<RecordType>(params: {
|
|
946
1016
|
records: RecordType[];
|
|
@@ -1008,26 +1078,6 @@ declare function getPivotDimensionFilterOptions<RecordType>(params: {
|
|
|
1008
1078
|
dimensionKey: string;
|
|
1009
1079
|
}): PivotFilterOptionItem[];
|
|
1010
1080
|
|
|
1011
|
-
/** 自定义字段可放置的透视区域。 */
|
|
1012
|
-
type PivotFieldArea = "filter" | "column" | "row" | "value";
|
|
1013
|
-
/** 自定义面板中的字段定义。 */
|
|
1014
|
-
interface PivotField<RecordType = Record<string, unknown>> extends PivotDimension<RecordType> {
|
|
1015
|
-
/** 勾选未使用字段时进入的默认区域。 */
|
|
1016
|
-
defaultArea?: PivotFieldArea;
|
|
1017
|
-
/** 字段进入值区域时使用的指标配置。 */
|
|
1018
|
-
indicator?: Omit<PivotIndicator<RecordType>, "key" | "title" | "dataIndex"> & {
|
|
1019
|
-
title?: string;
|
|
1020
|
-
dataIndex?: PivotIndicator<RecordType>["dataIndex"];
|
|
1021
|
-
};
|
|
1022
|
-
}
|
|
1023
|
-
/** 自定义面板四个区域内的有序字段键。 */
|
|
1024
|
-
interface PivotFieldLayout {
|
|
1025
|
-
filters: string[];
|
|
1026
|
-
columns: string[];
|
|
1027
|
-
rows: string[];
|
|
1028
|
-
values: string[];
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
1081
|
/** 创建四个区域均为空的字段布局。 */
|
|
1032
1082
|
declare function createEmptyPivotFieldLayout(): PivotFieldLayout;
|
|
1033
1083
|
/** 根据当前透视配置创建字段区域布局。 */
|
|
@@ -1222,4 +1272,4 @@ declare function flattenVisiblePivotLeaves(params: {
|
|
|
1222
1272
|
defaultExpandDepth?: number;
|
|
1223
1273
|
}): PivotNode[];
|
|
1224
1274
|
|
|
1225
|
-
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 };
|
|
1275
|
+
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 PivotIndicatorDataFormat, type PivotIndicatorDataFormatOptions, type PivotIndicatorDataFormatType, 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 PivotTableDensity, 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 };
|