@antv/s2-vue 2.0.0-next.5 → 2.0.0-next.7
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/README.md +1 -0
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/style.min.css +1 -1
- package/esm/index.d.ts +986 -241
- package/esm/index.js +14 -12
- package/esm/index.js.map +1 -1
- package/esm/style.css +27 -20
- package/lib/index.js +14 -12
- package/lib/index.js.map +1 -1
- package/lib/style.css +27 -20
- package/package.json +1 -1
package/esm/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AllowedComponentProps } from 'vue';
|
|
2
2
|
import { BaseTooltip } from '@antv/s2';
|
|
3
3
|
import { Canvas } from '@antv/g';
|
|
4
|
-
import { CellScrollPosition } from '@antv/s2';
|
|
4
|
+
import type { CellScrollPosition } from '@antv/s2';
|
|
5
5
|
import { ComponentCustomProps } from 'vue';
|
|
6
6
|
import { ComponentOptionsMixin } from 'vue';
|
|
7
7
|
import { ComputedRef } from 'vue';
|
|
@@ -18,6 +18,7 @@ import { GEvent } from '@antv/s2';
|
|
|
18
18
|
import { Group } from '@antv/g';
|
|
19
19
|
import { HiddenColumnsInfo } from '@antv/s2';
|
|
20
20
|
import { ICanvas } from '@antv/g';
|
|
21
|
+
import type { IEventTarget } from '@antv/g';
|
|
21
22
|
import { Image as Image_2 } from '@antv/g';
|
|
22
23
|
import { ImageStyleProps } from '@antv/g';
|
|
23
24
|
import { LayoutResult } from '@antv/s2';
|
|
@@ -41,6 +42,7 @@ import { S2DataConfig } from '@antv/s2';
|
|
|
41
42
|
import { S2MountContainer } from '@antv/s2';
|
|
42
43
|
import { S2Options } from '@antv/s2';
|
|
43
44
|
import { S2RenderOptions } from '@antv/s2';
|
|
45
|
+
import { ScrollOffset } from '@antv/s2';
|
|
44
46
|
import { ShallowRef } from 'vue';
|
|
45
47
|
import { SortParams } from '@antv/s2';
|
|
46
48
|
import { SpreadSheet } from '@antv/s2';
|
|
@@ -54,12 +56,19 @@ import { ViewMeta } from '@antv/s2';
|
|
|
54
56
|
import { ViewMetaData } from '@antv/s2';
|
|
55
57
|
import { VNodeProps } from 'vue';
|
|
56
58
|
|
|
59
|
+
declare type ActionIconName = string | FullyIconName;
|
|
60
|
+
|
|
57
61
|
declare type Adaptive = boolean | {
|
|
58
62
|
width?: boolean;
|
|
59
63
|
height?: boolean;
|
|
60
64
|
getContainer?: () => HTMLElement;
|
|
61
65
|
};
|
|
62
66
|
|
|
67
|
+
declare interface AdjustLeafNodesParams {
|
|
68
|
+
leafNodes: Node_2_2[];
|
|
69
|
+
hierarchy: Hierarchy;
|
|
70
|
+
}
|
|
71
|
+
|
|
63
72
|
declare enum Aggregation {
|
|
64
73
|
SUM = "SUM",
|
|
65
74
|
MIN = "MIN",
|
|
@@ -69,7 +78,7 @@ declare enum Aggregation {
|
|
|
69
78
|
|
|
70
79
|
declare interface AreaRange {
|
|
71
80
|
start: number;
|
|
72
|
-
|
|
81
|
+
size: number;
|
|
73
82
|
}
|
|
74
83
|
|
|
75
84
|
declare interface Background {
|
|
@@ -77,6 +86,7 @@ declare interface Background {
|
|
|
77
86
|
color?: string;
|
|
78
87
|
}
|
|
79
88
|
|
|
89
|
+
/** 柱状图样式配置 */
|
|
80
90
|
declare interface BarTheme {
|
|
81
91
|
intervalPadding?: number;
|
|
82
92
|
fill?: string;
|
|
@@ -106,7 +116,7 @@ declare abstract class BaseBBox implements BBox {
|
|
|
106
116
|
declare abstract class BaseCell<T extends SimpleBBox> extends Group {
|
|
107
117
|
protected meta: T;
|
|
108
118
|
protected spreadsheet: SpreadSheet_2;
|
|
109
|
-
protected theme:
|
|
119
|
+
protected theme: InternalFullyTheme;
|
|
110
120
|
protected backgroundShape: Rect | Polygon;
|
|
111
121
|
protected textShape: CustomText;
|
|
112
122
|
protected textShapes: CustomText[];
|
|
@@ -117,21 +127,12 @@ declare abstract class BaseCell<T extends SimpleBBox> extends Group {
|
|
|
117
127
|
protected conditionIntervalShape: Rect | undefined;
|
|
118
128
|
protected conditionIconShape: GuiIcon;
|
|
119
129
|
protected conditionIconShapes: GuiIcon[];
|
|
130
|
+
protected groupedIcons: GroupedIcons;
|
|
120
131
|
protected stateShapes: Map<StateShapeLayer, DisplayObject<any, any>>;
|
|
121
132
|
constructor(meta: T, spreadsheet: SpreadSheet_2, ...restOptions: unknown[]);
|
|
122
133
|
getMeta(): T;
|
|
123
134
|
setMeta(viewMeta: T): void;
|
|
124
|
-
getIconStyle(): IconTheme
|
|
125
|
-
getTextAndIconPosition(iconCount?: number): {
|
|
126
|
-
text: {
|
|
127
|
-
x: number;
|
|
128
|
-
y: number;
|
|
129
|
-
};
|
|
130
|
-
icon: {
|
|
131
|
-
x: number;
|
|
132
|
-
y: number;
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
+
getIconStyle(): DeepRequired<IconTheme>;
|
|
135
136
|
getActualText(): string;
|
|
136
137
|
getFieldValue(): string;
|
|
137
138
|
/**
|
|
@@ -142,7 +143,7 @@ declare abstract class BaseCell<T extends SimpleBBox> extends Group {
|
|
|
142
143
|
/**
|
|
143
144
|
* Return the type of the cell
|
|
144
145
|
*/
|
|
145
|
-
abstract get cellType():
|
|
146
|
+
abstract get cellType(): CellType;
|
|
146
147
|
/**
|
|
147
148
|
* Determine how to render this cell area
|
|
148
149
|
*/
|
|
@@ -156,13 +157,14 @@ declare abstract class BaseCell<T extends SimpleBBox> extends Group {
|
|
|
156
157
|
protected abstract getFormattedFieldValue(): FormatResult;
|
|
157
158
|
protected abstract getMaxTextWidth(): number;
|
|
158
159
|
protected abstract getTextPosition(): PointLike;
|
|
160
|
+
protected abstract getIconPosition(): PointLike;
|
|
159
161
|
protected abstract findFieldCondition(conditions: Condition[] | undefined): Condition | undefined;
|
|
160
|
-
protected abstract mappingValue(condition: Condition):
|
|
162
|
+
protected abstract mappingValue(condition: Condition): ConditionMappingResult | undefined | null;
|
|
161
163
|
protected shouldInit(): boolean;
|
|
162
|
-
getStyle<K extends keyof
|
|
164
|
+
getStyle<K extends keyof InternalFullyTheme = CellType>(name?: K): InternalFullyTheme[K] | InternalFullyCellTheme;
|
|
163
165
|
getLinkFieldShape(): Line;
|
|
164
166
|
protected getResizeAreaStyle(): ResizeArea;
|
|
165
|
-
protected shouldDrawResizeAreaByType(type: keyof ResizeInteractionOptions, cell: S2CellType_2): boolean | ((
|
|
167
|
+
protected shouldDrawResizeAreaByType(type: keyof ResizeInteractionOptions, cell: S2CellType_2): boolean | ResizeType | ((resizeInfo: ResizeInfo_2) => boolean) | ((cell: S2CellType_2<ViewMeta_2>) => boolean) | undefined;
|
|
166
168
|
getBBoxByType(type?: CellClipBox): SimpleBBox;
|
|
167
169
|
drawBorders(): void;
|
|
168
170
|
/**
|
|
@@ -172,18 +174,17 @@ declare abstract class BaseCell<T extends SimpleBBox> extends Group {
|
|
|
172
174
|
protected abstract getBackgroundColor(): {
|
|
173
175
|
backgroundColor: string | undefined;
|
|
174
176
|
backgroundColorOpacity: number | undefined;
|
|
177
|
+
intelligentReverseTextColor: boolean;
|
|
175
178
|
};
|
|
176
179
|
protected drawBackgroundShape(): void;
|
|
177
180
|
/**
|
|
178
181
|
* 交互使用的背景色
|
|
179
182
|
*/
|
|
180
183
|
protected drawInteractiveBgShape(): void;
|
|
181
|
-
protected getIconPosition(iconCount?: number): {
|
|
182
|
-
x: number;
|
|
183
|
-
y: number;
|
|
184
|
-
};
|
|
185
184
|
protected drawTextShape(): void;
|
|
186
185
|
protected drawLinkFieldShape(showLinkFieldShape: boolean, linkFillColor: string): void;
|
|
186
|
+
protected getLinkFieldStyle(): string;
|
|
187
|
+
protected drawLinkField(meta: Node_2_2 | ViewMeta_2): void;
|
|
187
188
|
updateByState(stateName: InteractionStateName, cell: S2CellType_2): void;
|
|
188
189
|
protected getInteractiveBorderShapeStyle<T>(borderSize: T & number): {
|
|
189
190
|
x: number;
|
|
@@ -202,7 +203,38 @@ declare abstract class BaseCell<T extends SimpleBBox> extends Group {
|
|
|
202
203
|
resetTextAndConditionIconShapes(): void;
|
|
203
204
|
get cellConditions(): Conditions;
|
|
204
205
|
drawConditionIconShapes(): void;
|
|
205
|
-
|
|
206
|
+
getTextConditionMappingResult(): ConditionMappingResult<unknown> | null | undefined;
|
|
207
|
+
getContainConditionMappingResultTextStyle(style: TextTheme | undefined): {
|
|
208
|
+
fill: string;
|
|
209
|
+
minValue?: number | undefined;
|
|
210
|
+
maxValue?: number | undefined;
|
|
211
|
+
icon?: string | undefined;
|
|
212
|
+
isCompare?: boolean | undefined;
|
|
213
|
+
intelligentReverseTextColor?: boolean | undefined;
|
|
214
|
+
fieldValue?: number | undefined;
|
|
215
|
+
fontFamily?: string | undefined;
|
|
216
|
+
fontSize?: number | undefined;
|
|
217
|
+
fontWeight?: number | "bold" | "normal" | "bolder" | "lighter" | undefined;
|
|
218
|
+
linkTextFill?: string | undefined;
|
|
219
|
+
opacity?: number | undefined;
|
|
220
|
+
textAlign?: TextAlign | undefined;
|
|
221
|
+
textBaseline?: TextBaseline | undefined;
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* 获取默认字体颜色:根据字段标记背景颜色,设置字体颜色
|
|
225
|
+
* @param textStyle
|
|
226
|
+
* @private
|
|
227
|
+
*/
|
|
228
|
+
protected getDefaultTextFill(textFill: string): string;
|
|
229
|
+
getBackgroundConditionFill(): {
|
|
230
|
+
backgroundColor: string | undefined;
|
|
231
|
+
intelligentReverseTextColor: boolean;
|
|
232
|
+
} | {
|
|
233
|
+
intelligentReverseTextColor: boolean;
|
|
234
|
+
backgroundColor?: undefined;
|
|
235
|
+
};
|
|
236
|
+
getIconConditionResult(): FullyIconName | undefined;
|
|
237
|
+
protected getActionAndConditionIconWidth(position?: IconPosition): number;
|
|
206
238
|
}
|
|
207
239
|
|
|
208
240
|
declare interface BaseCellStyle {
|
|
@@ -233,8 +265,17 @@ declare interface BaseCellStyle {
|
|
|
233
265
|
}
|
|
234
266
|
|
|
235
267
|
declare interface BaseChartData {
|
|
268
|
+
/**
|
|
269
|
+
* 类型
|
|
270
|
+
*/
|
|
236
271
|
type: MiniChartTypes;
|
|
272
|
+
/**
|
|
273
|
+
* 数据
|
|
274
|
+
*/
|
|
237
275
|
data: RawData_2[];
|
|
276
|
+
/**
|
|
277
|
+
* 坐标轴数据
|
|
278
|
+
*/
|
|
238
279
|
encode?: {
|
|
239
280
|
x: keyof RawData_2;
|
|
240
281
|
y: keyof RawData_2;
|
|
@@ -295,6 +336,7 @@ declare abstract class BaseDataSet_2 {
|
|
|
295
336
|
*/
|
|
296
337
|
getFieldDescription(field: CustomHeaderField): string | undefined;
|
|
297
338
|
setDataCfg(dataCfg: S2DataConfig_2): void;
|
|
339
|
+
processMeta(meta: Meta[] | undefined, defaultExtraFieldText: string): Meta[];
|
|
298
340
|
getDisplayDataSet(): RawData_2[];
|
|
299
341
|
getValueRangeByField(field: string): ValueRange;
|
|
300
342
|
/** ******************NEED IMPLEMENT BY USER CASE************************ */
|
|
@@ -379,7 +421,11 @@ declare abstract class BaseFacet {
|
|
|
379
421
|
frozenTopGroup: FrozenGroup;
|
|
380
422
|
frozenBottomGroup: FrozenGroup;
|
|
381
423
|
foregroundGroup: Group;
|
|
382
|
-
|
|
424
|
+
/**
|
|
425
|
+
* 当前布局节点信息
|
|
426
|
+
* @description 内部消费, 外部调用请使用 facet.getLayoutResult()
|
|
427
|
+
*/
|
|
428
|
+
private layoutResult;
|
|
383
429
|
viewCellWidths: number[];
|
|
384
430
|
viewCellHeights: ViewCellHeights;
|
|
385
431
|
protected mobileWheel: WheelEvent_2;
|
|
@@ -394,12 +440,14 @@ declare abstract class BaseFacet {
|
|
|
394
440
|
centerFrame: Frame;
|
|
395
441
|
gridInfo: GridInfo;
|
|
396
442
|
protected abstract doLayout(): LayoutResult_2;
|
|
397
|
-
abstract getViewCellHeights(
|
|
443
|
+
abstract getViewCellHeights(): ViewCellHeights;
|
|
444
|
+
abstract getCellMeta(rowIndex: number, colIndex: number): ViewMeta_2 | null;
|
|
398
445
|
protected scrollFrameId: ReturnType<typeof requestAnimationFrame> | null;
|
|
399
|
-
get scrollBarTheme(): ScrollBarTheme
|
|
446
|
+
get scrollBarTheme(): DeepRequired<ScrollBarTheme>;
|
|
400
447
|
get scrollBarSize(): number;
|
|
401
448
|
protected preCellIndexes: PanelIndexes | null;
|
|
402
449
|
constructor(spreadsheet: SpreadSheet_2);
|
|
450
|
+
getLayoutResult: () => LayoutResult_2;
|
|
403
451
|
protected initGroups(): void;
|
|
404
452
|
protected initPanelGroups(): void;
|
|
405
453
|
protected getCellCustomSize(node: Node_2_2 | null, size: CellCustomSize): number | null | undefined;
|
|
@@ -439,8 +487,8 @@ declare abstract class BaseFacet {
|
|
|
439
487
|
updateScrollOffset(offsetConfig: OffsetConfig): void;
|
|
440
488
|
getPaginationScrollY(): number;
|
|
441
489
|
destroy(): void;
|
|
442
|
-
setScrollOffset: (scrollOffset:
|
|
443
|
-
getScrollOffset: () => Required<
|
|
490
|
+
setScrollOffset: (scrollOffset: ScrollOffset_2) => void;
|
|
491
|
+
getScrollOffset: () => Required<ScrollOffset_2>;
|
|
444
492
|
resetScrollX: () => void;
|
|
445
493
|
resetRowScrollX: () => void;
|
|
446
494
|
resetScrollY: () => void;
|
|
@@ -470,12 +518,12 @@ declare abstract class BaseFacet {
|
|
|
470
518
|
scrollImmediately: (offsetConfig?: OffsetConfig) => void;
|
|
471
519
|
/**
|
|
472
520
|
*
|
|
473
|
-
* @param skipScrollEvent
|
|
521
|
+
* @param skipScrollEvent 不触发 S2Event.GLOBAL_SCROLL
|
|
474
522
|
*/
|
|
475
523
|
startScroll: (skipScrollEvent?: boolean) => void;
|
|
476
|
-
getRendererHeight
|
|
524
|
+
private getRendererHeight;
|
|
477
525
|
private getAdjustedScrollOffset;
|
|
478
|
-
renderRowScrollBar
|
|
526
|
+
private renderRowScrollBar;
|
|
479
527
|
getValidScrollBarOffset: (offset: number, maxOffset: number) => number;
|
|
480
528
|
renderHScrollBar: (width: number, realWidth: number, scrollX: number) => void;
|
|
481
529
|
private getScrollbarPosition;
|
|
@@ -502,21 +550,12 @@ declare abstract class BaseFacet {
|
|
|
502
550
|
cancelScrollFrame: () => boolean;
|
|
503
551
|
clearScrollFrameIdOnMobile: () => void;
|
|
504
552
|
/**
|
|
505
|
-
|
|
506
|
-
*
|
|
507
|
-
|
|
508
|
-
*1.
|
|
509
|
-
*
|
|
510
|
-
*
|
|
511
|
-
*所以只要不为 `auto`, 或者表格内, 都需要阻止外部容器滚动
|
|
512
|
-
*=======
|
|
513
|
-
*https://developer.mozilla.org/zh-CN/docs/Web/CSS/overscroll-behavior
|
|
514
|
-
*阻止外部容器滚动: 表格是虚拟滚动, 这里按照标准模拟浏览器的 [overscroll-behavior] 实现
|
|
515
|
-
*1. auto => 只有在滚动到表格顶部或底部时才触发外部容器滚动
|
|
516
|
-
*1. contain => 默认的滚动边界行为不变(“触底”效果或者刷新),但是临近的滚动区域不会被滚动链影响到
|
|
517
|
-
*2. none => 临近滚动区域不受到滚动链影响,而且默认的滚动到边界的表现也被阻止
|
|
518
|
-
*所以只要不为 `auto`, 或者表格内, 都需要阻止外部容器滚动
|
|
519
|
-
*>>>>>>> next
|
|
553
|
+
* https://developer.mozilla.org/zh-CN/docs/Web/CSS/overscroll-behavior
|
|
554
|
+
* 阻止外部容器滚动: 表格是虚拟滚动, 这里按照标准模拟浏览器的 [overscroll-behavior] 实现
|
|
555
|
+
* 1. auto => 只有在滚动到表格顶部或底部时才触发外部容器滚动
|
|
556
|
+
* 1. contain => 默认的滚动边界行为不变(“触底”效果或者刷新),但是临近的滚动区域不会被滚动链影响到
|
|
557
|
+
* 2. none => 临近滚动区域不受到滚动链影响,而且默认的滚动到边界的表现也被阻止
|
|
558
|
+
* 所以只要不为 `auto`, 或者表格内, 都需要阻止外部容器滚动
|
|
520
559
|
*/
|
|
521
560
|
private stopScrollChainingIfNeeded;
|
|
522
561
|
private stopScrollChaining;
|
|
@@ -572,13 +611,215 @@ declare abstract class BaseFacet {
|
|
|
572
611
|
protected onAfterScroll: DebouncedFunc<() => void>;
|
|
573
612
|
protected saveInitColumnLeafNodes(columnNodes?: Node_2_2[]): void;
|
|
574
613
|
getHiddenColumnsInfo(columnNode: Node_2_2): HiddenColumnsInfo_2 | undefined;
|
|
614
|
+
updateCustomFieldsSampleNodes(colsHierarchy: Hierarchy): void;
|
|
615
|
+
/**
|
|
616
|
+
* @description 自定义行头时, 叶子节点层级不定, 需要自动对齐其宽度, 填充空白
|
|
617
|
+
* -------------------------------------------------
|
|
618
|
+
* | 自定义节点 a-1 | 自定义节点 a-1-1 |
|
|
619
|
+
* |------------- |------------- |------------|
|
|
620
|
+
* | 自定义节点 b-1 | 自定义节点 b-1-1 | 指标 1 |
|
|
621
|
+
* -------------------------------------------------
|
|
622
|
+
*/
|
|
623
|
+
adjustRowLeafNodesWidth(params: AdjustLeafNodesParams): void;
|
|
624
|
+
/**
|
|
625
|
+
* @description 自定义列头时, 叶子节点层级不定, 需要自动对齐其高度, 填充空白
|
|
626
|
+
* ------------------------------------------------------------------------
|
|
627
|
+
* | 自定义节点 a-1 |
|
|
628
|
+
* |----------------------------------------------------------------------|
|
|
629
|
+
* | 自定义节点 a-1-1 | |
|
|
630
|
+
* |-------------|-------------|------------------| 自定义节点 a-1-2 |
|
|
631
|
+
* | 指标 1 | 自定义节点 a-1-1-1 | 指标 2 | |
|
|
632
|
+
* ----------------------------------------------------------------------
|
|
633
|
+
*/
|
|
634
|
+
adjustColLeafNodesHeight(params: AdjustLeafNodesParams): void;
|
|
635
|
+
adjustLeafNodesSize(type: 'width' | 'height'): ({ leafNodes, hierarchy }: AdjustLeafNodesParams) => void;
|
|
636
|
+
/**
|
|
637
|
+
* 获取表头节点 (角头,序号, 行头,列头) (含可视区域)
|
|
638
|
+
* @example 获取全部: facet.getHeaderNodes()
|
|
639
|
+
* @example 获取一组 facet.getHeaderNodes(['root[&]浙江省[&]宁波市', 'root[&]浙江省[&]杭州市'])
|
|
640
|
+
*/
|
|
641
|
+
getHeaderNodes(nodeIds?: string[]): Node_2_2[];
|
|
642
|
+
/**
|
|
643
|
+
* 获取角头节点
|
|
644
|
+
*/
|
|
575
645
|
getCornerNodes(): Node_2_2[];
|
|
646
|
+
/**
|
|
647
|
+
* 获取序号节点
|
|
648
|
+
*/
|
|
649
|
+
getSeriesNumberNodes(): Node_2_2[];
|
|
650
|
+
/**
|
|
651
|
+
* 获取列头节点 (含非可视区域)
|
|
652
|
+
* @description 获取列头单元格 (可视区域内) facet.getColCells()
|
|
653
|
+
* @example 获取全部: facet.getColNodes()
|
|
654
|
+
* @example 指定层级: facet.getColNodes(level)
|
|
655
|
+
*/
|
|
656
|
+
getColNodes(level?: number): Node_2_2[];
|
|
657
|
+
/**
|
|
658
|
+
* 根据 id 获取指定列头节点
|
|
659
|
+
* @example facet.getColNodeById('root[&]节点1[&]数值')
|
|
660
|
+
*/
|
|
661
|
+
getColNodeById(nodeId: string): Node_2_2 | undefined;
|
|
662
|
+
/**
|
|
663
|
+
* 根据列头索引获取指定列头节点
|
|
664
|
+
* @example facet.getColNodeByIndex(colIndex)
|
|
665
|
+
*/
|
|
666
|
+
getColNodeByIndex(colIndex: number): Node_2_2 | undefined;
|
|
667
|
+
/**
|
|
668
|
+
* 根据列头索引获取指定列头叶子节点
|
|
669
|
+
* @example facet.getColLeafNodes(colIndex)
|
|
670
|
+
*/
|
|
671
|
+
getColLeafNodeByIndex(colIndex: number): Node_2_2 | undefined;
|
|
672
|
+
/**
|
|
673
|
+
* 根据 field 获取指定列头节点
|
|
674
|
+
* @example facet.getColCellNodeByField('number')
|
|
675
|
+
*/
|
|
676
|
+
getColNodesByField(nodeField: string): Node_2_2[];
|
|
677
|
+
/**
|
|
678
|
+
* 获取列头叶子节点节点 (含非可视区域)
|
|
679
|
+
*/
|
|
680
|
+
getColLeafNodes(): Node_2_2[];
|
|
681
|
+
/**
|
|
682
|
+
* 获取列头小计/总计节点 (含非可视区域)
|
|
683
|
+
* @example 获取全部: facet.getColTotalsNodes()
|
|
684
|
+
* @example 指定层级: facet.getColTotalsNodes(level)
|
|
685
|
+
*/
|
|
686
|
+
getColTotalsNodes(level?: number): Node_2_2[];
|
|
687
|
+
/**
|
|
688
|
+
* 获取列头小计节点 (含非可视区域)
|
|
689
|
+
* @example 获取全部: facet.getColSubTotalsNodes()
|
|
690
|
+
* @example 指定层级: facet.getColSubTotalsNodes(level)
|
|
691
|
+
*/
|
|
692
|
+
getColSubTotalsNodes(level?: number): Node_2_2[];
|
|
693
|
+
/**
|
|
694
|
+
* 获取列头总计节点 (含非可视区域)
|
|
695
|
+
* @example 获取全部: facet.getColGrandTotalsNodes()
|
|
696
|
+
* @example 指定层级: facet.getColGrandTotalsNodes(level)
|
|
697
|
+
*/
|
|
698
|
+
getColGrandTotalsNodes(level?: number): Node_2_2[];
|
|
699
|
+
/**
|
|
700
|
+
* 获取行头节点 (含非可视区域)
|
|
701
|
+
* @description 获取行头单元格 (可视区域内) facet.getRowCells()
|
|
702
|
+
* @example 获取全部: facet.getRowNodes()
|
|
703
|
+
* @example 指定层级: facet.getRowNodes(level)
|
|
704
|
+
*/
|
|
705
|
+
getRowNodes(level?: number): Node_2_2[];
|
|
706
|
+
/**
|
|
707
|
+
* 根据 id 获取单个行头节点
|
|
708
|
+
* @example facet.getRowNodeById('root[&]节点1[&]数值')
|
|
709
|
+
*/
|
|
710
|
+
getRowNodeById(nodeId: string): Node_2_2 | undefined;
|
|
711
|
+
/**
|
|
712
|
+
* 根据行头索引获取指定列头节点
|
|
713
|
+
* @example facet.getRowNodeByIndex(rowIndex)
|
|
714
|
+
*/
|
|
715
|
+
getRowNodeByIndex(rowIndex: number): Node_2_2 | undefined;
|
|
716
|
+
/**
|
|
717
|
+
* 根据行头索引获取指定列头叶子节点
|
|
718
|
+
* @example facet.getRowLeafNodeByIndex(rowIndex)
|
|
719
|
+
*/
|
|
720
|
+
getRowLeafNodeByIndex(rowIndex: number): Node_2_2 | undefined;
|
|
721
|
+
/**
|
|
722
|
+
* 根据 field 获取行头节点
|
|
723
|
+
* @example facet.getRowNodeByField('number')
|
|
724
|
+
*/
|
|
725
|
+
getRowNodesByField(nodeField: string): Node_2_2[];
|
|
726
|
+
/**
|
|
727
|
+
* 获取行头叶子节点节点 (含非可视区域)
|
|
728
|
+
*/
|
|
729
|
+
getRowLeafNodes(): Node_2_2[];
|
|
730
|
+
/**
|
|
731
|
+
* 获取行头小计/总计节点 (含非可视区域)
|
|
732
|
+
* @example 获取全部: facet.getRowTotalsNodes()
|
|
733
|
+
* @example 指定层级: facet.getRowTotalsNodes(level)
|
|
734
|
+
*/
|
|
735
|
+
getRowTotalsNodes(level?: number): Node_2_2[];
|
|
736
|
+
/**
|
|
737
|
+
* 获取行头小计节点 (含非可视区域)
|
|
738
|
+
* @example 获取全部: facet.getRowSubTotalsNodes()
|
|
739
|
+
* @example 指定层级: facet.getRowSubTotalsNodes(level)
|
|
740
|
+
*/
|
|
741
|
+
getRowSubTotalsNodes(level?: number): Node_2_2[];
|
|
742
|
+
/**
|
|
743
|
+
* 获取行头总计节点 (含非可视区域)
|
|
744
|
+
* @example 获取全部: facet.getRowGrandTotalsNodes()
|
|
745
|
+
* @example 指定层级: facet.getRowGrandTotalsNodes(level)
|
|
746
|
+
*/
|
|
747
|
+
getRowGrandTotalsNodes(level?: number): Node_2_2[];
|
|
748
|
+
/**
|
|
749
|
+
* 获取单元格的所有子节点 (含非可视区域)
|
|
750
|
+
* @example
|
|
751
|
+
* const rowCell = facet.getRowCells()[0]
|
|
752
|
+
* facet.getCellChildrenNodes(rowCell)
|
|
753
|
+
*/
|
|
754
|
+
getCellChildrenNodes: (cell: S2CellType_2) => Node_2_2[];
|
|
755
|
+
/**
|
|
756
|
+
* 获取数值单元格 (不含可视区域)
|
|
757
|
+
* @description 由于虚拟滚动, 按需加载的特性, 非可视区域的单元格未被实例化
|
|
758
|
+
* @example 获取非可视区域的数值节点 facet.getCellMeta(rowIndex, colIndex)
|
|
759
|
+
*/
|
|
760
|
+
getDataCells(): DataCell_2[];
|
|
761
|
+
/**
|
|
762
|
+
* 获取行头单元格 (不含可视区域)
|
|
763
|
+
*/
|
|
764
|
+
getRowCells(): RowCell[];
|
|
765
|
+
/**
|
|
766
|
+
* 获取行头叶子节点单元格 (不含可视区域)
|
|
767
|
+
*/
|
|
768
|
+
getRowLeafCells(): RowCell[];
|
|
769
|
+
/**
|
|
770
|
+
* 获取列头单元格 (不含可视区域)
|
|
771
|
+
*/
|
|
772
|
+
getColCells(): ColCell[];
|
|
773
|
+
/**
|
|
774
|
+
* 获取列头叶子节点单元格 (不含可视区域)
|
|
775
|
+
*/
|
|
776
|
+
getColLeafCells(): ColCell[];
|
|
777
|
+
/**
|
|
778
|
+
* 获取合并单元格 (不含可视区域)
|
|
779
|
+
*/
|
|
780
|
+
getMergedCells(): MergedCell[];
|
|
781
|
+
/**
|
|
782
|
+
* 获取角头单元格
|
|
783
|
+
*/
|
|
784
|
+
getCornerCells(): CornerCell[];
|
|
785
|
+
/**
|
|
786
|
+
* 获取序号单元格
|
|
787
|
+
*/
|
|
788
|
+
abstract getSeriesNumberCells(): SeriesNumberCell[] | TableSeriesNumberCell[];
|
|
789
|
+
/**
|
|
790
|
+
* 获取表头单元格 (角头,行头,列头) (不含可视区域)
|
|
791
|
+
* @example 获取全部: facet.getHeaderCells()
|
|
792
|
+
* @example 获取一组 facet.getHeaderCells(['root[&]浙江省[&]宁波市', 'root[&]浙江省[&]杭州市'])
|
|
793
|
+
*/
|
|
794
|
+
getHeaderCells(cellIds?: string[]): S2CellType_2<ViewMeta_2>[];
|
|
795
|
+
/**
|
|
796
|
+
* 根据单元格 id 获取指定单元格 (不含可视区域)
|
|
797
|
+
* @example facet.getCellById('root[&]浙江省[&]宁波市')
|
|
798
|
+
*/
|
|
799
|
+
getCellById(cellId: string): S2CellType_2<ViewMeta_2> | undefined;
|
|
800
|
+
/**
|
|
801
|
+
* 根据单元格 field 获取指定单元格 (不含可视区域)
|
|
802
|
+
* @example facet.getCellByField('city')
|
|
803
|
+
*/
|
|
804
|
+
getCellsByField(cellField: string): S2CellType_2<ViewMeta_2>[];
|
|
805
|
+
/**
|
|
806
|
+
* 获取所有单元格 (角头,行头,列头,数值) (不含可视区域)
|
|
807
|
+
* @example 获取全部: facet.getCells()
|
|
808
|
+
* @example 获取一组 facet.getCells(['root[&]浙江省[&]宁波市', 'root[&]浙江省[&]杭州市'])
|
|
809
|
+
*/
|
|
810
|
+
getCells(cellIds?: string[]): S2CellType_2<ViewMeta_2>[];
|
|
811
|
+
getInitColLeafNodes(): Node_2_2[];
|
|
812
|
+
clearInitColLeafNodes(): void;
|
|
576
813
|
}
|
|
577
814
|
|
|
578
815
|
declare interface BaseFields {
|
|
816
|
+
/** 行头字段 */
|
|
579
817
|
rows?: CustomHeaderFields;
|
|
818
|
+
/** 列头字段 */
|
|
580
819
|
columns?: CustomHeaderFields;
|
|
820
|
+
/** 数值字段 */
|
|
581
821
|
values?: string[];
|
|
822
|
+
/** 数值是否置于列头 (透视表有效) */
|
|
582
823
|
valueInCols?: boolean;
|
|
583
824
|
}
|
|
584
825
|
|
|
@@ -606,10 +847,10 @@ declare abstract class BaseHeader<T extends BaseHeaderConfig> extends Group {
|
|
|
606
847
|
onScrollXY(scrollX: number, scrollY: number, type: string): void;
|
|
607
848
|
/**
|
|
608
849
|
* Only call when hRowScrollBar scrolls
|
|
609
|
-
* @param
|
|
850
|
+
* @param rowHeaderScrollX hRowScrollbar horizontal offset
|
|
610
851
|
* @param type
|
|
611
852
|
*/
|
|
612
|
-
onRowScrollX(
|
|
853
|
+
onRowScrollX(rowHeaderScrollX: number, type: string): void;
|
|
613
854
|
protected abstract layout(): void;
|
|
614
855
|
protected abstract offset(): void;
|
|
615
856
|
protected abstract clip(): void;
|
|
@@ -638,11 +879,9 @@ declare interface BaseHeaderConfig {
|
|
|
638
879
|
viewportWidth: number;
|
|
639
880
|
viewportHeight: number;
|
|
640
881
|
position: PointLike;
|
|
641
|
-
|
|
882
|
+
nodes: Node_2_2[];
|
|
642
883
|
spreadsheet: SpreadSheet_2;
|
|
643
884
|
sortParam?: SortParam;
|
|
644
|
-
linkFields: string[] | ((meta: Node_2_2 | ViewMeta_2) => boolean);
|
|
645
|
-
hierarchyType: S2Options_2['hierarchyType'];
|
|
646
885
|
}
|
|
647
886
|
|
|
648
887
|
declare interface BaseNodeConfig {
|
|
@@ -737,7 +976,7 @@ rowCellMouseUp: (data: TargetCellInfo) => void;
|
|
|
737
976
|
rowCellMouseMove: (data: TargetCellInfo) => void;
|
|
738
977
|
rowCellCollapsed: (params: RowCellCollapsedParams) => void;
|
|
739
978
|
rowCellAllCollapsed: (isCollapsed: boolean) => void;
|
|
740
|
-
rowCellScroll: (position:
|
|
979
|
+
rowCellScroll: (position: Required<ScrollOffset>) => void;
|
|
741
980
|
colCellHover: (data: TargetCellInfo) => void;
|
|
742
981
|
colCellClick: (data: TargetCellInfo) => void;
|
|
743
982
|
colCellDoubleClick: (data: TargetCellInfo) => void;
|
|
@@ -826,7 +1065,7 @@ linkFieldJump: (data: {
|
|
|
826
1065
|
field: string;
|
|
827
1066
|
record: RawData;
|
|
828
1067
|
}) => void;
|
|
829
|
-
scroll: (position:
|
|
1068
|
+
scroll: (position: Required<ScrollOffset>) => void;
|
|
830
1069
|
layoutAfterRealDataCellRender: (options: {
|
|
831
1070
|
add: [number, number][];
|
|
832
1071
|
remove: [number, number][];
|
|
@@ -872,7 +1111,7 @@ onRowCellMouseUp?: (data: TargetCellInfo) => any;
|
|
|
872
1111
|
onRowCellMouseMove?: (data: TargetCellInfo) => any;
|
|
873
1112
|
onRowCellCollapsed?: (params: RowCellCollapsedParams) => any;
|
|
874
1113
|
onRowCellAllCollapsed?: (isCollapsed: boolean) => any;
|
|
875
|
-
onRowCellScroll?: (position:
|
|
1114
|
+
onRowCellScroll?: (position: Required<ScrollOffset>) => any;
|
|
876
1115
|
onColCellHover?: (data: TargetCellInfo) => any;
|
|
877
1116
|
onColCellClick?: (data: TargetCellInfo) => any;
|
|
878
1117
|
onColCellDoubleClick?: (data: TargetCellInfo) => any;
|
|
@@ -961,7 +1200,7 @@ onLinkFieldJump?: (data: {
|
|
|
961
1200
|
field: string;
|
|
962
1201
|
record: RawData;
|
|
963
1202
|
}) => any;
|
|
964
|
-
onScroll?: (position:
|
|
1203
|
+
onScroll?: (position: Required<ScrollOffset>) => any;
|
|
965
1204
|
onLayoutAfterRealDataCellRender?: (options: {
|
|
966
1205
|
add: [number, number][];
|
|
967
1206
|
remove: [number, number][];
|
|
@@ -1119,7 +1358,7 @@ declare class BaseTooltip_2 {
|
|
|
1119
1358
|
options: TooltipShowOptions;
|
|
1120
1359
|
position: TooltipPosition;
|
|
1121
1360
|
constructor(spreadsheet: SpreadSheet_2);
|
|
1122
|
-
show<T = Element | string>(
|
|
1361
|
+
show<T = Element | string>(options: TooltipShowOptions<T>): void;
|
|
1123
1362
|
hide(): void;
|
|
1124
1363
|
destroy(): void;
|
|
1125
1364
|
renderContent<T = TooltipContentType_2>(content: T): void;
|
|
@@ -1130,14 +1369,47 @@ declare class BaseTooltip_2 {
|
|
|
1130
1369
|
}
|
|
1131
1370
|
|
|
1132
1371
|
declare interface BaseTooltipConfig<T = TooltipContentType_2, Icon = Element | string, Text = string> {
|
|
1133
|
-
|
|
1372
|
+
/**
|
|
1373
|
+
* 是否开启 tooltip, 在点击/悬停/停留/刷选/多选等场景会显示
|
|
1374
|
+
* @description @antv/s2 中只保留了 tooltip 的核心显隐逻辑,提供相应数据,不渲染内容
|
|
1375
|
+
* React 版本 和 Vue3 版本中通过 自定义 Tooltip 类 的方式渲染 tooltip 的内容,包括 排序下拉菜单, 单元格选中信息汇总, 列头隐藏按钮 等。
|
|
1376
|
+
* @see https://s2.antv.antgroup.com/manual/basic/tooltip
|
|
1377
|
+
*/
|
|
1378
|
+
enable?: boolean;
|
|
1379
|
+
/**
|
|
1380
|
+
* 自定义内容
|
|
1381
|
+
* @see https://s2.antv.antgroup.com/manual/basic/tooltip#%E8%87%AA%E5%AE%9A%E4%B9%89
|
|
1382
|
+
*/
|
|
1134
1383
|
content?: TooltipShowOptions<T>['content'];
|
|
1384
|
+
/**
|
|
1385
|
+
* 自定义操作项
|
|
1386
|
+
* @see https://s2.antv.antgroup.com/manual/basic/tooltip#%E8%87%AA%E5%AE%9A%E4%B9%89
|
|
1387
|
+
*/
|
|
1135
1388
|
operation?: TooltipOperation<Icon, Text>;
|
|
1389
|
+
/**
|
|
1390
|
+
* 显示边界, 当 tooltip 超过边界时自动调整显示位置,container: 图表区域,body: 整个浏览器窗口,设置为 `null` 可关闭此功能
|
|
1391
|
+
*/
|
|
1136
1392
|
autoAdjustBoundary?: TooltipAutoAdjustBoundary;
|
|
1137
|
-
|
|
1393
|
+
/**
|
|
1394
|
+
* 自定义 Tooltip 类
|
|
1395
|
+
* @see https://s2.antv.antgroup.com/zh/examples/react-component/tooltip/#custom-tooltip
|
|
1396
|
+
*/
|
|
1397
|
+
render?: (spreadsheet: SpreadSheet_2) => BaseTooltip_2;
|
|
1398
|
+
/**
|
|
1399
|
+
* 自定义坐标
|
|
1400
|
+
*/
|
|
1138
1401
|
adjustPosition?: (positionInfo: TooltipPositionInfo) => TooltipPosition;
|
|
1402
|
+
/**
|
|
1403
|
+
* 自定义挂载容器, 默认 body
|
|
1404
|
+
*/
|
|
1139
1405
|
getContainer?: () => HTMLElement;
|
|
1406
|
+
/**
|
|
1407
|
+
* 容器类名
|
|
1408
|
+
*/
|
|
1140
1409
|
className?: string | string[];
|
|
1410
|
+
/**
|
|
1411
|
+
* 容器样式
|
|
1412
|
+
*/
|
|
1141
1413
|
style?: CSS_2.Properties;
|
|
1142
1414
|
}
|
|
1143
1415
|
|
|
@@ -1153,36 +1425,54 @@ declare interface BBox {
|
|
|
1153
1425
|
}
|
|
1154
1426
|
|
|
1155
1427
|
declare interface BrushSelection {
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1428
|
+
dataCell?: boolean;
|
|
1429
|
+
rowCell?: boolean;
|
|
1430
|
+
colCell?: boolean;
|
|
1159
1431
|
}
|
|
1160
1432
|
|
|
1433
|
+
/** 子弹图样式配置 */
|
|
1161
1434
|
declare interface BulletTheme {
|
|
1435
|
+
/** 进度条 */
|
|
1162
1436
|
progressBar: {
|
|
1437
|
+
/** 子弹图宽度相对单元格 content 占比,小数 */
|
|
1163
1438
|
widthPercent: number;
|
|
1164
1439
|
height: number;
|
|
1440
|
+
/** 内高度 */
|
|
1165
1441
|
innerHeight: number;
|
|
1166
1442
|
};
|
|
1443
|
+
/** 测量标记线 */
|
|
1167
1444
|
comparativeMeasure: {
|
|
1168
1445
|
width: number;
|
|
1169
1446
|
height: number;
|
|
1170
1447
|
fill?: string;
|
|
1171
1448
|
opacity?: number;
|
|
1172
1449
|
};
|
|
1450
|
+
/** 子弹图状态颜色 */
|
|
1173
1451
|
rangeColors: RangeColors;
|
|
1452
|
+
/** 子弹图背景色 */
|
|
1174
1453
|
backgroundColor: string;
|
|
1175
1454
|
}
|
|
1176
1455
|
|
|
1177
1456
|
declare interface BulletValue {
|
|
1457
|
+
/**
|
|
1458
|
+
* 类型
|
|
1459
|
+
*/
|
|
1178
1460
|
type: MiniChartTypes.Bullet;
|
|
1461
|
+
/**
|
|
1462
|
+
* 当前值
|
|
1463
|
+
*/
|
|
1179
1464
|
measure: number | string;
|
|
1465
|
+
/**
|
|
1466
|
+
* 目标值
|
|
1467
|
+
*/
|
|
1180
1468
|
target: number | string;
|
|
1181
1469
|
[key: string]: unknown;
|
|
1182
1470
|
}
|
|
1183
1471
|
|
|
1184
1472
|
declare interface CalcTotals {
|
|
1473
|
+
/** 聚合方式 */
|
|
1185
1474
|
aggregation?: Aggregation;
|
|
1475
|
+
/** 自定义计算 */
|
|
1186
1476
|
calcFunc?: (query: Query, arr: CellData[]) => number;
|
|
1187
1477
|
}
|
|
1188
1478
|
|
|
@@ -1245,13 +1535,13 @@ declare interface CellDataParams {
|
|
|
1245
1535
|
isRow?: boolean;
|
|
1246
1536
|
}
|
|
1247
1537
|
|
|
1248
|
-
declare type CellEventTarget = FederatedPointerEvent['target'] | null | undefined;
|
|
1538
|
+
declare type CellEventTarget = FederatedPointerEvent['target'] | null | undefined | EventTarget | IEventTarget;
|
|
1249
1539
|
|
|
1250
1540
|
declare interface CellMeta {
|
|
1251
1541
|
id: string;
|
|
1252
1542
|
colIndex: number;
|
|
1253
1543
|
rowIndex: number;
|
|
1254
|
-
type:
|
|
1544
|
+
type: CellType;
|
|
1255
1545
|
rowQuery?: Record<string, any>;
|
|
1256
1546
|
[key: string]: unknown;
|
|
1257
1547
|
}
|
|
@@ -1264,50 +1554,55 @@ declare interface CellScrollOffset {
|
|
|
1264
1554
|
offsetY: number;
|
|
1265
1555
|
}
|
|
1266
1556
|
|
|
1267
|
-
declare
|
|
1268
|
-
scrollX: number;
|
|
1269
|
-
scrollY: number;
|
|
1270
|
-
}
|
|
1557
|
+
declare type CellScrollPosition_2 = Required<ScrollOffset_2>;
|
|
1271
1558
|
|
|
1272
1559
|
declare interface CellTheme {
|
|
1560
|
+
/** 奇数行单元格背景色 */
|
|
1273
1561
|
crossBackgroundColor?: string;
|
|
1562
|
+
/** 单元格背景色 */
|
|
1274
1563
|
backgroundColor?: string;
|
|
1564
|
+
/** 单元格背景色透明度 */
|
|
1275
1565
|
backgroundColorOpacity?: number;
|
|
1566
|
+
/** 单元格水平边线颜色 */
|
|
1276
1567
|
horizontalBorderColor?: string;
|
|
1568
|
+
/** 单元格水平边线颜色透明度 */
|
|
1277
1569
|
horizontalBorderColorOpacity?: number;
|
|
1570
|
+
/** 单元格垂直边线颜色 */
|
|
1278
1571
|
verticalBorderColor?: string;
|
|
1572
|
+
/** 单元格垂直边线颜色透明度 */
|
|
1279
1573
|
verticalBorderColorOpacity?: number;
|
|
1574
|
+
/** 单元格水平边线宽度 */
|
|
1280
1575
|
horizontalBorderWidth?: number;
|
|
1576
|
+
/** 单元格垂直边线宽度 */
|
|
1281
1577
|
verticalBorderWidth?: number;
|
|
1578
|
+
/** 单元格内边距 */
|
|
1282
1579
|
padding?: Padding;
|
|
1580
|
+
/** 交互态 */
|
|
1283
1581
|
interactionState?: InteractionState;
|
|
1284
1582
|
}
|
|
1285
1583
|
|
|
1286
1584
|
declare type CellThemes = {
|
|
1287
|
-
[K in
|
|
1585
|
+
[K in CellType]?: DefaultCellTheme;
|
|
1288
1586
|
};
|
|
1289
1587
|
|
|
1290
|
-
declare enum
|
|
1588
|
+
declare enum CellType {
|
|
1291
1589
|
DATA_CELL = "dataCell",
|
|
1292
|
-
HEADER_CELL = "headerCell",
|
|
1293
1590
|
ROW_CELL = "rowCell",
|
|
1294
1591
|
COL_CELL = "colCell",
|
|
1592
|
+
SERIES_NUMBER_CELL = "seriesNumberCell",
|
|
1295
1593
|
CORNER_CELL = "cornerCell",
|
|
1296
1594
|
MERGED_CELL = "mergedCell"
|
|
1297
1595
|
}
|
|
1298
1596
|
|
|
1299
1597
|
declare class ColCell extends HeaderCell {
|
|
1300
1598
|
protected headerConfig: ColHeaderConfig;
|
|
1301
|
-
|
|
1302
|
-
protected textPosition: PointLike;
|
|
1303
|
-
get cellType(): CellTypes;
|
|
1599
|
+
get cellType(): CellType;
|
|
1304
1600
|
protected getBorderPositions(): CellBorderPosition[];
|
|
1305
1601
|
protected initCell(): void;
|
|
1602
|
+
protected getFormattedFieldValue(): FormatResult;
|
|
1306
1603
|
protected getMaxTextWidth(): number;
|
|
1307
|
-
protected getIconPosition(): PointLike;
|
|
1308
1604
|
protected isBolderText(): boolean;
|
|
1309
1605
|
protected getTextPosition(): PointLike;
|
|
1310
|
-
protected getActionIconsWidth(): number;
|
|
1311
1606
|
protected getColResizeArea(): Group | undefined;
|
|
1312
1607
|
protected getHorizontalResizeAreaName(): string;
|
|
1313
1608
|
/**
|
|
@@ -1362,6 +1657,7 @@ declare class ColHeader extends BaseHeader<ColHeaderConfig> {
|
|
|
1362
1657
|
protected scrollGroup: Group;
|
|
1363
1658
|
protected background: DisplayObject;
|
|
1364
1659
|
constructor(cfg: ColHeaderConfig);
|
|
1660
|
+
private initScrollGroup;
|
|
1365
1661
|
/**
|
|
1366
1662
|
* Make colHeader scroll with hScrollBar
|
|
1367
1663
|
* @param scrollX horizontal offset
|
|
@@ -1371,9 +1667,9 @@ declare class ColHeader extends BaseHeader<ColHeaderConfig> {
|
|
|
1371
1667
|
onColScroll(scrollX: number, type: string): void;
|
|
1372
1668
|
protected clip(): void;
|
|
1373
1669
|
clear(): void;
|
|
1374
|
-
protected getCellInstance(
|
|
1670
|
+
protected getCellInstance(node: Node_2_2, spreadsheet: SpreadSheet_2, headerConfig: ColHeaderConfig): S2CellType_2;
|
|
1375
1671
|
protected getCellGroup(node: Node_2_2): Group;
|
|
1376
|
-
protected isColCellInRect(
|
|
1672
|
+
protected isColCellInRect(node: Node_2_2): boolean;
|
|
1377
1673
|
protected layout(): void;
|
|
1378
1674
|
protected offset(): void;
|
|
1379
1675
|
}
|
|
@@ -1385,13 +1681,31 @@ declare interface ColHeaderConfig extends BaseHeaderConfig {
|
|
|
1385
1681
|
/**
|
|
1386
1682
|
* One field can hold a condition
|
|
1387
1683
|
*/
|
|
1388
|
-
declare interface Condition {
|
|
1684
|
+
declare interface Condition<T = unknown> {
|
|
1389
1685
|
field?: string | RegExp;
|
|
1390
|
-
mapping:
|
|
1686
|
+
mapping: ConditionMapping<T>;
|
|
1391
1687
|
}
|
|
1392
1688
|
|
|
1689
|
+
declare type ConditionMapping<T = unknown> = (fieldValue: number | string, data: RawData_2, cell?: DataCell_2 | HeaderCell) => ConditionMappingResult<T> | undefined | null;
|
|
1690
|
+
|
|
1691
|
+
declare type ConditionMappingResult<T = unknown> = ValueRange & T & {
|
|
1692
|
+
icon?: string;
|
|
1693
|
+
fill?: string;
|
|
1694
|
+
isCompare?: boolean;
|
|
1695
|
+
/**
|
|
1696
|
+
* @description only used in background condition, when the background color is too light, the font color will be white
|
|
1697
|
+
* @version 1.34.0
|
|
1698
|
+
*/
|
|
1699
|
+
intelligentReverseTextColor?: boolean;
|
|
1700
|
+
/**
|
|
1701
|
+
* @description custom the interval condition's width
|
|
1702
|
+
* @version 1.38.0
|
|
1703
|
+
*/
|
|
1704
|
+
fieldValue?: number;
|
|
1705
|
+
};
|
|
1706
|
+
|
|
1393
1707
|
declare interface Conditions {
|
|
1394
|
-
text?:
|
|
1708
|
+
text?: TextCondition[];
|
|
1395
1709
|
background?: Condition[];
|
|
1396
1710
|
interval?: Condition[];
|
|
1397
1711
|
icon?: IconCondition[];
|
|
@@ -1426,7 +1740,7 @@ declare class CornerCell extends HeaderCell {
|
|
|
1426
1740
|
cornerType: CornerNodeType;
|
|
1427
1741
|
protected headerConfig: CornerHeaderConfig;
|
|
1428
1742
|
protected isBolderText(): boolean;
|
|
1429
|
-
get cellType():
|
|
1743
|
+
get cellType(): CellType;
|
|
1430
1744
|
protected getBorderPositions(): CellBorderPosition[];
|
|
1431
1745
|
update(): void;
|
|
1432
1746
|
protected initCell(): void;
|
|
@@ -1439,7 +1753,6 @@ declare class CornerCell extends HeaderCell {
|
|
|
1439
1753
|
protected getResizeAreaEffect(): ResizeAreaEffect.Field | ResizeAreaEffect.Tree | ResizeAreaEffect.Series;
|
|
1440
1754
|
protected drawResizeArea(): void;
|
|
1441
1755
|
protected showTreeIcon(): boolean;
|
|
1442
|
-
protected getIconPosition(): PointLike;
|
|
1443
1756
|
protected getTreeIconWidth(): number;
|
|
1444
1757
|
protected getTextStyle(): TextTheme;
|
|
1445
1758
|
protected getMaxTextWidth(): number;
|
|
@@ -1510,7 +1823,13 @@ declare interface CustomInteraction {
|
|
|
1510
1823
|
}
|
|
1511
1824
|
|
|
1512
1825
|
declare interface CustomSVGIcon {
|
|
1826
|
+
/** icon 名称 */
|
|
1513
1827
|
name: string;
|
|
1828
|
+
/**
|
|
1829
|
+
* 1、base 64
|
|
1830
|
+
* 2、svg本地文件(兼容老方式,可以改颜色)
|
|
1831
|
+
* 3、线上支持的图片地址
|
|
1832
|
+
*/
|
|
1514
1833
|
svg: string;
|
|
1515
1834
|
}
|
|
1516
1835
|
|
|
@@ -1530,11 +1849,26 @@ export declare class CustomTooltip extends BaseTooltip {
|
|
|
1530
1849
|
}
|
|
1531
1850
|
|
|
1532
1851
|
declare interface CustomTreeNode {
|
|
1852
|
+
/**
|
|
1853
|
+
* 字段唯一标识
|
|
1854
|
+
*/
|
|
1533
1855
|
field: string;
|
|
1856
|
+
/**
|
|
1857
|
+
* 标题
|
|
1858
|
+
*/
|
|
1534
1859
|
title?: string;
|
|
1860
|
+
/**
|
|
1861
|
+
* 是否收起(默认都展开)
|
|
1862
|
+
*/
|
|
1535
1863
|
collapsed?: boolean;
|
|
1864
|
+
/**
|
|
1865
|
+
* 字段描述
|
|
1866
|
+
*/
|
|
1536
1867
|
description?: string;
|
|
1537
|
-
|
|
1868
|
+
/**
|
|
1869
|
+
* 子节点
|
|
1870
|
+
*/
|
|
1871
|
+
children?: CustomTreeNode[];
|
|
1538
1872
|
}
|
|
1539
1873
|
|
|
1540
1874
|
declare type Data = (RawData_2 & ExtraData) | undefined | null;
|
|
@@ -1552,7 +1886,8 @@ declare type Data = (RawData_2 & ExtraData) | undefined | null;
|
|
|
1552
1886
|
* 3、left rect area is interval(in left) and text(in right)
|
|
1553
1887
|
*/
|
|
1554
1888
|
declare class DataCell_2 extends BaseCell<ViewMeta_2> {
|
|
1555
|
-
|
|
1889
|
+
iconPosition: PointLike;
|
|
1890
|
+
get cellType(): CellType;
|
|
1556
1891
|
protected getBorderPositions(): CellBorderPosition[];
|
|
1557
1892
|
get valueRangeByField(): ValueRange;
|
|
1558
1893
|
protected handleByStateName(cells: CellMeta[], stateName: InteractionStateName): void;
|
|
@@ -1561,27 +1896,19 @@ declare class DataCell_2 extends BaseCell<ViewMeta_2> {
|
|
|
1561
1896
|
protected handleHover(cells: CellMeta[]): void;
|
|
1562
1897
|
update(): void;
|
|
1563
1898
|
setMeta(viewMeta: ViewMeta_2): void;
|
|
1899
|
+
protected drawTextShape(): void;
|
|
1564
1900
|
protected initCell(): void;
|
|
1565
|
-
|
|
1566
|
-
* 获取默认字体颜色:根据字段标记背景颜色,设置字体颜色
|
|
1567
|
-
* @param textStyle
|
|
1568
|
-
* @private
|
|
1569
|
-
*/
|
|
1570
|
-
private getDefaultTextFill;
|
|
1901
|
+
protected generateIconConfig(): void;
|
|
1571
1902
|
protected getTextStyle(): TextTheme;
|
|
1572
|
-
getIconStyle(): IconStyle | undefined;
|
|
1573
1903
|
protected drawConditionIntervalShape(): void;
|
|
1574
1904
|
protected shouldHideRowSubtotalData(): boolean;
|
|
1575
1905
|
protected getFormattedFieldValue(): FormatResult;
|
|
1576
1906
|
protected getMaxTextWidth(): number;
|
|
1577
1907
|
protected getTextPosition(): PointLike;
|
|
1908
|
+
protected getIconPosition(): PointLike;
|
|
1578
1909
|
getBackgroundColor(): {
|
|
1579
|
-
backgroundColor: string
|
|
1580
|
-
backgroundColorOpacity: number
|
|
1581
|
-
intelligentReverseTextColor?: undefined;
|
|
1582
|
-
} | {
|
|
1583
|
-
backgroundColor: string | undefined;
|
|
1584
|
-
backgroundColorOpacity: number | undefined;
|
|
1910
|
+
backgroundColor: string;
|
|
1911
|
+
backgroundColorOpacity: number;
|
|
1585
1912
|
intelligentReverseTextColor: boolean;
|
|
1586
1913
|
};
|
|
1587
1914
|
protected changeRowColSelectState(indexType: ViewMetaIndexType): void;
|
|
@@ -1598,7 +1925,7 @@ declare class DataCell_2 extends BaseCell<ViewMeta_2> {
|
|
|
1598
1925
|
* Mapping value to get condition related attrs
|
|
1599
1926
|
* @param condition
|
|
1600
1927
|
*/
|
|
1601
|
-
mappingValue(condition: Condition):
|
|
1928
|
+
mappingValue(condition: Condition): ConditionMappingResult | undefined | null;
|
|
1602
1929
|
updateByState(stateName: InteractionStateName): void;
|
|
1603
1930
|
clearUnselectedState(): void;
|
|
1604
1931
|
private toggleConditionIntervalShapeOpacity;
|
|
@@ -1607,14 +1934,30 @@ declare class DataCell_2 extends BaseCell<ViewMeta_2> {
|
|
|
1607
1934
|
declare type DataCellCallback = (viewMeta: ViewMeta_2) => S2CellType_2;
|
|
1608
1935
|
|
|
1609
1936
|
declare interface DataCellStyle {
|
|
1937
|
+
/**
|
|
1938
|
+
* 宽度
|
|
1939
|
+
*/
|
|
1610
1940
|
width?: number;
|
|
1941
|
+
/**
|
|
1942
|
+
* 高度
|
|
1943
|
+
*/
|
|
1611
1944
|
height?: number;
|
|
1612
1945
|
/**
|
|
1613
1946
|
* 多列数值配置
|
|
1614
1947
|
*/
|
|
1615
1948
|
valuesCfg?: {
|
|
1949
|
+
/**
|
|
1950
|
+
* 原始值字段
|
|
1951
|
+
*/
|
|
1616
1952
|
originalValueField?: string;
|
|
1953
|
+
/**
|
|
1954
|
+
* 每一列数值占单元格宽度百分比
|
|
1955
|
+
* @example [0.1, 0.3, 0.6]
|
|
1956
|
+
*/
|
|
1617
1957
|
widthPercent?: number[];
|
|
1958
|
+
/**
|
|
1959
|
+
* 是否显示原始值 (tooltip 中显示)
|
|
1960
|
+
*/
|
|
1618
1961
|
showOriginalValue?: boolean;
|
|
1619
1962
|
};
|
|
1620
1963
|
}
|
|
@@ -1623,14 +1966,26 @@ declare type DataItem = SimpleData | MultiData | Record<string, unknown> | undef
|
|
|
1623
1966
|
|
|
1624
1967
|
declare type DataPath = (number | string)[];
|
|
1625
1968
|
|
|
1969
|
+
declare type DeepRequired<T extends Record<string, any>> = {
|
|
1970
|
+
[K in keyof T]-?: NonNullable<T[K]> extends Record<string, any> ? DeepRequired<NonNullable<T[K]>> : NonNullable<T[K]>;
|
|
1971
|
+
};
|
|
1972
|
+
|
|
1626
1973
|
declare interface DefaultCellTheme extends GridAnalysisCellTheme {
|
|
1974
|
+
/** 粗体文本样式 */
|
|
1627
1975
|
bolderText?: TextTheme;
|
|
1976
|
+
/** 文本样式 */
|
|
1628
1977
|
text?: TextTheme;
|
|
1978
|
+
/** 序号样式 */
|
|
1629
1979
|
seriesText?: TextTheme;
|
|
1980
|
+
/** 度量值文本样式 */
|
|
1630
1981
|
measureText?: TextTheme;
|
|
1982
|
+
/** 单元格样式 */
|
|
1631
1983
|
cell?: CellTheme;
|
|
1984
|
+
/** 图标样式 */
|
|
1632
1985
|
icon?: IconTheme;
|
|
1986
|
+
/** mini 图样式配置 */
|
|
1633
1987
|
miniChart?: MiniChartTheme;
|
|
1988
|
+
/** 序号列宽 */
|
|
1634
1989
|
seriesNumberWidth?: number;
|
|
1635
1990
|
}
|
|
1636
1991
|
|
|
@@ -1729,7 +2084,7 @@ declare interface EmitterType {
|
|
|
1729
2084
|
total: number;
|
|
1730
2085
|
current: number;
|
|
1731
2086
|
}) => void;
|
|
1732
|
-
[S2Event.LAYOUT_AFTER_HEADER_LAYOUT]: (
|
|
2087
|
+
[S2Event.LAYOUT_AFTER_HEADER_LAYOUT]: (layoutResult: LayoutResult_2) => void;
|
|
1733
2088
|
[S2Event.LAYOUT_AFTER_REAL_DATA_CELL_RENDER]: (options: {
|
|
1734
2089
|
add: [number, number][];
|
|
1735
2090
|
remove: [number, number][];
|
|
@@ -1764,6 +2119,7 @@ declare class EventController {
|
|
|
1764
2119
|
private onKeyboardCopy;
|
|
1765
2120
|
private onKeyboardEsc;
|
|
1766
2121
|
private resetSheetStyle;
|
|
2122
|
+
private isMouseEvent;
|
|
1767
2123
|
private isMouseOnTheCanvasContainer;
|
|
1768
2124
|
private getContainerRect;
|
|
1769
2125
|
private isMouseOnTheTooltip;
|
|
@@ -1818,6 +2174,9 @@ declare type ExtraData = {
|
|
|
1818
2174
|
};
|
|
1819
2175
|
|
|
1820
2176
|
declare interface Fields extends BaseFields {
|
|
2177
|
+
/**
|
|
2178
|
+
* 自定义指标维度在行列头中的层级顺序 (即 `values` 的 顺序,从 `0` 开始
|
|
2179
|
+
*/
|
|
1821
2180
|
customValueOrder?: number;
|
|
1822
2181
|
}
|
|
1823
2182
|
|
|
@@ -1873,7 +2232,12 @@ declare interface FrameConfig {
|
|
|
1873
2232
|
declare class FrozenGroup extends GridGroup {
|
|
1874
2233
|
}
|
|
1875
2234
|
|
|
1876
|
-
declare type
|
|
2235
|
+
declare type FullyIconName = {
|
|
2236
|
+
name: string;
|
|
2237
|
+
position: IconPosition;
|
|
2238
|
+
fill?: string;
|
|
2239
|
+
isConditionIcon?: boolean;
|
|
2240
|
+
};
|
|
1877
2241
|
|
|
1878
2242
|
declare type GetInitProps<T, OptionalKeys = GetOptionalKeys<T>> = {
|
|
1879
2243
|
[K in keyof T as IsEmitKey<T[K]> extends true ? never : K]-?: K extends OptionalKeys ? PropOption<NonNullable<T[K]>> : RequiredPropOption<NonNullable<T[K]>>;
|
|
@@ -1884,7 +2248,9 @@ declare type GetOptionalKeys<T> = keyof {
|
|
|
1884
2248
|
};
|
|
1885
2249
|
|
|
1886
2250
|
declare interface GridAnalysisCellTheme {
|
|
2251
|
+
/** 次级文本,如副指标 */
|
|
1887
2252
|
minorText?: TextTheme;
|
|
2253
|
+
/** 衍生指标 */
|
|
1888
2254
|
derivedMeasureText?: {
|
|
1889
2255
|
mainUp: string;
|
|
1890
2256
|
mainDown: string;
|
|
@@ -1912,6 +2278,10 @@ declare interface GridInfo {
|
|
|
1912
2278
|
rows: number[];
|
|
1913
2279
|
}
|
|
1914
2280
|
|
|
2281
|
+
declare type GroupedIcons = {
|
|
2282
|
+
[key in IconPosition]: FullyIconName[];
|
|
2283
|
+
};
|
|
2284
|
+
|
|
1915
2285
|
/**
|
|
1916
2286
|
* 使用 iconfont 上的 svg 来创建 Icon
|
|
1917
2287
|
*/
|
|
@@ -1920,7 +2290,7 @@ declare class GuiIcon extends Group {
|
|
|
1920
2290
|
iconImageShape: CustomImage;
|
|
1921
2291
|
private cfg;
|
|
1922
2292
|
constructor(cfg: GuiIconCfg);
|
|
1923
|
-
|
|
2293
|
+
getImage(name: string, cacheKey: string, fill?: string): Promise<HTMLImageElement>;
|
|
1924
2294
|
/**
|
|
1925
2295
|
* 1. https://xxx.svg
|
|
1926
2296
|
* 2. http://xxx.svg
|
|
@@ -1928,6 +2298,10 @@ declare class GuiIcon extends Group {
|
|
|
1928
2298
|
*/
|
|
1929
2299
|
isOnlineLink: (src: string) => boolean;
|
|
1930
2300
|
private render;
|
|
2301
|
+
setImageAttrs(attrs: Partial<{
|
|
2302
|
+
name: string;
|
|
2303
|
+
fill: string;
|
|
2304
|
+
}>): void;
|
|
1931
2305
|
}
|
|
1932
2306
|
|
|
1933
2307
|
declare interface GuiIconCfg extends Omit<ImageStyleProps, 'fill'> {
|
|
@@ -1958,11 +2332,19 @@ declare class HdAdapter {
|
|
|
1958
2332
|
}
|
|
1959
2333
|
|
|
1960
2334
|
declare interface HeaderActionIcon {
|
|
1961
|
-
|
|
1962
|
-
|
|
2335
|
+
/**
|
|
2336
|
+
* 已注册的 icon 类型或自定义的 icon 类型名
|
|
2337
|
+
* 如果是 string[], 则默认 icon 位置为右侧
|
|
2338
|
+
*/
|
|
2339
|
+
icons: ActionIconName[];
|
|
2340
|
+
belongsCell: Omit<CellType, 'dataCell'>;
|
|
2341
|
+
/** 是否默认隐藏, true 为 hover后显示, false 为一直显示 */
|
|
1963
2342
|
defaultHide?: boolean | ((meta: Node_2_2, iconName: string) => boolean);
|
|
2343
|
+
/** 是否展示当前 iconNames 配置的 icon */
|
|
1964
2344
|
displayCondition?: (mete: Node_2_2, iconName: string) => boolean;
|
|
2345
|
+
/** 点击回调函数 */
|
|
1965
2346
|
onClick?: (headerIconClickParams: HeaderIconClickParams) => void;
|
|
2347
|
+
/** 悬停回调函数 */
|
|
1966
2348
|
onHover?: (headerIconHoverParams: HeaderIconHoverParams) => void;
|
|
1967
2349
|
}
|
|
1968
2350
|
|
|
@@ -1972,30 +2354,37 @@ declare interface HeaderActionIconOptions {
|
|
|
1972
2354
|
y: number;
|
|
1973
2355
|
onClick?: (headerIconClickParams: HeaderIconClickParams) => void;
|
|
1974
2356
|
onHover?: (headerIconHoverParams: HeaderIconHoverParams) => void;
|
|
2357
|
+
isSortIcon?: boolean;
|
|
1975
2358
|
defaultHide?: boolean;
|
|
1976
2359
|
}
|
|
1977
2360
|
|
|
1978
2361
|
declare abstract class HeaderCell extends BaseCell<Node_2_2> {
|
|
1979
2362
|
protected headerConfig: BaseHeaderConfig;
|
|
2363
|
+
protected actionIconConfig: InternalFullyHeaderActionIcon | undefined;
|
|
1980
2364
|
protected treeIcon: GuiIcon | undefined;
|
|
1981
2365
|
protected treeLeafNodeAlignDot: DisplayObject | undefined;
|
|
1982
2366
|
protected actionIcons: GuiIcon[];
|
|
1983
2367
|
protected hasDefaultHiddenIcon: boolean;
|
|
2368
|
+
protected conditionIconMappingResult: FullyIconName | undefined;
|
|
2369
|
+
/** left icon 绘制起始坐标 */
|
|
2370
|
+
protected leftIconPosition: PointLike;
|
|
2371
|
+
/** left icon 绘制起始坐标 */
|
|
2372
|
+
protected rightIconPosition: PointLike;
|
|
1984
2373
|
protected abstract isBolderText(): boolean;
|
|
1985
2374
|
protected handleRestOptions(...[headerConfig]: [BaseHeaderConfig]): void;
|
|
1986
2375
|
protected initCell(): void;
|
|
2376
|
+
protected generateIconConfig(): void;
|
|
1987
2377
|
protected getFormattedFieldValue(): FormatResult;
|
|
1988
|
-
/**
|
|
1989
|
-
* 获取操作 icons
|
|
1990
|
-
*/
|
|
1991
|
-
protected getActionIconCfg(): HeaderActionIcon | undefined;
|
|
1992
2378
|
protected showSortIcon(): boolean | "" | undefined;
|
|
1993
2379
|
protected getActionIconsCount(): number;
|
|
1994
|
-
protected
|
|
1995
|
-
|
|
2380
|
+
protected getActionIconStyle(): {
|
|
2381
|
+
width: number;
|
|
2382
|
+
height: number;
|
|
2383
|
+
fill: string;
|
|
2384
|
+
};
|
|
1996
2385
|
protected hasDefaultHideActionIcon(): boolean;
|
|
1997
2386
|
protected addActionIcon(options: HeaderActionIconOptions): void;
|
|
1998
|
-
protected
|
|
2387
|
+
protected drawActionAndConditionIcons(): void;
|
|
1999
2388
|
protected isSortCell(): boolean;
|
|
2000
2389
|
protected handleByStateName(cells: CellMeta[], stateName: InteractionStateName): void;
|
|
2001
2390
|
protected handleSearchResult(cells: CellMeta[]): void;
|
|
@@ -2003,15 +2392,19 @@ declare abstract class HeaderCell extends BaseCell<Node_2_2> {
|
|
|
2003
2392
|
protected handleSelect(cells: CellMeta[], nodes?: Node_2_2[]): void;
|
|
2004
2393
|
protected getTextStyle(): TextTheme;
|
|
2005
2394
|
getBackgroundColor(): {
|
|
2395
|
+
backgroundColor: string;
|
|
2396
|
+
backgroundColorOpacity: number;
|
|
2397
|
+
} & {
|
|
2006
2398
|
backgroundColor: string | undefined;
|
|
2007
|
-
|
|
2399
|
+
intelligentReverseTextColor: boolean;
|
|
2008
2400
|
};
|
|
2009
2401
|
toggleActionIcon(id: string): void;
|
|
2402
|
+
protected getIconPosition(): PointLike;
|
|
2010
2403
|
update(): void;
|
|
2011
2404
|
updateByState(stateName: InteractionStateName): void;
|
|
2012
2405
|
hideInteractionShape(): void;
|
|
2013
2406
|
isMeasureField(): boolean;
|
|
2014
|
-
mappingValue(condition: Condition):
|
|
2407
|
+
mappingValue(condition: Condition): ConditionMappingResult;
|
|
2015
2408
|
findFieldCondition(conditions: Condition[]): Condition | undefined;
|
|
2016
2409
|
getTreeIcon(): GuiIcon | undefined;
|
|
2017
2410
|
}
|
|
@@ -2027,7 +2420,13 @@ declare interface HeaderIconHoverParams extends HeaderIconClickParams {
|
|
|
2027
2420
|
}
|
|
2028
2421
|
|
|
2029
2422
|
declare interface HiddenColumnsInfo_2 {
|
|
2423
|
+
/**
|
|
2424
|
+
* 当前显示的兄弟节点之前所隐藏的节点
|
|
2425
|
+
*/
|
|
2030
2426
|
hideColumnNodes: Node_2_2[];
|
|
2427
|
+
/**
|
|
2428
|
+
* 当前隐藏列所对应展示展开按钮的兄弟节点
|
|
2429
|
+
*/
|
|
2031
2430
|
displaySiblingNode: {
|
|
2032
2431
|
prev: Node_2_2 | null;
|
|
2033
2432
|
next: Node_2_2 | null;
|
|
@@ -2059,11 +2458,11 @@ declare class Hierarchy {
|
|
|
2059
2458
|
getNodesLessThanLevel(lessThanLevel: number): Node_2_2[];
|
|
2060
2459
|
/**
|
|
2061
2460
|
* Add new node
|
|
2062
|
-
* @param
|
|
2461
|
+
* @param node
|
|
2063
2462
|
* @param insetIndex
|
|
2064
2463
|
*/
|
|
2065
|
-
pushNode(
|
|
2066
|
-
pushIndexNode(
|
|
2464
|
+
pushNode(node: Node_2_2, insetIndex?: number): void;
|
|
2465
|
+
pushIndexNode(node: Node_2_2): void;
|
|
2067
2466
|
getIndexNodes(): Node_2_2[];
|
|
2068
2467
|
}
|
|
2069
2468
|
|
|
@@ -2071,54 +2470,128 @@ declare interface HoverFocusOptions {
|
|
|
2071
2470
|
duration?: number;
|
|
2072
2471
|
}
|
|
2073
2472
|
|
|
2074
|
-
declare interface IconCondition extends Condition {
|
|
2473
|
+
declare interface IconCondition extends Condition<IconTheme> {
|
|
2075
2474
|
position?: IconPosition;
|
|
2076
2475
|
}
|
|
2077
2476
|
|
|
2078
2477
|
declare type IconPosition = 'left' | 'right';
|
|
2079
2478
|
|
|
2080
|
-
declare type IconStyle = Pick<IconTheme, 'size' | 'margin'> & Pick<IconCondition, 'position'>;
|
|
2081
|
-
|
|
2082
2479
|
declare interface IconTheme {
|
|
2480
|
+
/** icon 填充色 */
|
|
2083
2481
|
fill?: string;
|
|
2084
|
-
|
|
2085
|
-
upIconColor?: string;
|
|
2482
|
+
/** icon 大小 */
|
|
2086
2483
|
size?: number;
|
|
2484
|
+
/** icon 外边距 */
|
|
2087
2485
|
margin?: Margin;
|
|
2088
2486
|
}
|
|
2089
2487
|
|
|
2090
2488
|
declare type Indexes = [number, number, number, number];
|
|
2091
2489
|
|
|
2092
|
-
declare interface
|
|
2490
|
+
declare interface InteractionCellSelectedHighlightOptions {
|
|
2491
|
+
/** 高亮行头 */
|
|
2093
2492
|
rowHeader?: boolean;
|
|
2493
|
+
/** 高亮列头 */
|
|
2094
2494
|
colHeader?: boolean;
|
|
2495
|
+
/** 高亮选中单元格所在行 */
|
|
2095
2496
|
currentRow?: boolean;
|
|
2497
|
+
/** 高亮选中单元格所在列 */
|
|
2096
2498
|
currentCol?: boolean;
|
|
2097
2499
|
}
|
|
2098
2500
|
|
|
2099
2501
|
declare type InteractionConstructor = new (spreadsheet: SpreadSheet_2) => BaseEvent;
|
|
2100
2502
|
|
|
2101
2503
|
declare interface InteractionOptions {
|
|
2504
|
+
/**
|
|
2505
|
+
* 链接跳转
|
|
2506
|
+
* @see https://s2.antv.antgroup.com/manual/advanced/interaction/link-jump
|
|
2507
|
+
*/
|
|
2102
2508
|
linkFields?: string[] | ((meta: Node_2_2 | ViewMeta_2) => boolean);
|
|
2509
|
+
/**
|
|
2510
|
+
* 选中单元格高亮聚焦
|
|
2511
|
+
*/
|
|
2103
2512
|
selectedCellsSpotlight?: boolean;
|
|
2513
|
+
/**
|
|
2514
|
+
* 十字器高亮效果
|
|
2515
|
+
*/
|
|
2104
2516
|
hoverHighlight?: boolean;
|
|
2517
|
+
/**
|
|
2518
|
+
* 悬停聚焦, 800ms 后会显示其对应 tooltip, 可以自定义 duration
|
|
2519
|
+
*/
|
|
2105
2520
|
hoverFocus?: HoverFocusOptions | boolean;
|
|
2521
|
+
/**
|
|
2522
|
+
* 开启复制 Command/Ctrl + C
|
|
2523
|
+
*/
|
|
2106
2524
|
enableCopy?: boolean;
|
|
2525
|
+
/**
|
|
2526
|
+
* 复制带格式的数据
|
|
2527
|
+
*/
|
|
2107
2528
|
copyWithFormat?: boolean;
|
|
2529
|
+
/**
|
|
2530
|
+
* 复制包含其对应行列头的数据
|
|
2531
|
+
*/
|
|
2108
2532
|
copyWithHeader?: boolean;
|
|
2533
|
+
/**
|
|
2534
|
+
* 复制时支持自定义(transformer)数据导出格式化方法
|
|
2535
|
+
*/
|
|
2536
|
+
customTransformer?: (transformer: Transformer_2) => Partial<Transformer_2>;
|
|
2537
|
+
/**
|
|
2538
|
+
* 自动重置表格样式 (按下 ESC 键, 点击空白区域时, 关闭 tooltip/交互状态)
|
|
2539
|
+
*/
|
|
2109
2540
|
autoResetSheetStyle?: boolean;
|
|
2541
|
+
/**
|
|
2542
|
+
* 隐藏列头配置, 支持维度 (S2DataConfig.fields) 和具体维值 (id)
|
|
2543
|
+
* @example hiddenColumnFields: ['type', 'subType'];
|
|
2544
|
+
* @example hiddenColumnFields: ['root[&]家具[&]桌子[&]number']
|
|
2545
|
+
*/
|
|
2110
2546
|
hiddenColumnFields?: string[];
|
|
2547
|
+
/**
|
|
2548
|
+
* 自定义滚动速率, 默认 1
|
|
2549
|
+
* @see https://s2.antv.antgroup.com/manual/advanced/interaction/scroll
|
|
2550
|
+
*/
|
|
2111
2551
|
scrollSpeedRatio?: ScrollSpeedRatio;
|
|
2552
|
+
/**
|
|
2553
|
+
* 宽高调整
|
|
2554
|
+
*/
|
|
2112
2555
|
resize?: ResizeInteractionOptions | boolean;
|
|
2556
|
+
/**
|
|
2557
|
+
* 刷选
|
|
2558
|
+
*/
|
|
2113
2559
|
brushSelection?: BrushSelection | boolean;
|
|
2560
|
+
/**
|
|
2561
|
+
* 多选 Command/Ctrl + click
|
|
2562
|
+
*/
|
|
2114
2563
|
multiSelection?: boolean;
|
|
2564
|
+
/**
|
|
2565
|
+
* 区间快捷多选 Shift + click
|
|
2566
|
+
*/
|
|
2115
2567
|
rangeSelection?: boolean;
|
|
2568
|
+
/**
|
|
2569
|
+
* 键盘方向键移动选中单元格
|
|
2570
|
+
*/
|
|
2116
2571
|
selectedCellMove?: boolean;
|
|
2572
|
+
/**
|
|
2573
|
+
* 滚动条位置 (可用于表格内容未撑满 Canvas 的场景)
|
|
2574
|
+
*/
|
|
2117
2575
|
scrollbarPosition?: ScrollbarPositionType;
|
|
2576
|
+
/**
|
|
2577
|
+
* 透传 listener 属性的可选参数对象
|
|
2578
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/EventTarget/addEventListener
|
|
2579
|
+
*/
|
|
2118
2580
|
eventListenerOptions?: boolean | AddEventListenerOptions;
|
|
2119
|
-
|
|
2581
|
+
/**
|
|
2582
|
+
* 选中单元格高亮联动 (高亮所对应行头/列头, 高亮当前行/当前列)
|
|
2583
|
+
*/
|
|
2584
|
+
selectedCellHighlight?: boolean | InteractionCellSelectedHighlightOptions;
|
|
2585
|
+
/**
|
|
2586
|
+
* 滚动到边界的行为
|
|
2587
|
+
* @see https://s2.antv.antgroup.com/manual/advanced/interaction/scroll
|
|
2588
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior
|
|
2589
|
+
*/
|
|
2120
2590
|
overscrollBehavior?: 'auto' | 'none' | 'contain' | null;
|
|
2121
|
-
/**
|
|
2591
|
+
/**
|
|
2592
|
+
* 自定义交互
|
|
2593
|
+
* @see https://s2.antv.antgroup.com/manual/advanced/interaction/custom
|
|
2594
|
+
*/
|
|
2122
2595
|
customInteractions?: CustomInteraction[];
|
|
2123
2596
|
}
|
|
2124
2597
|
|
|
@@ -2127,12 +2600,29 @@ declare type InteractionState = {
|
|
|
2127
2600
|
};
|
|
2128
2601
|
|
|
2129
2602
|
declare interface InteractionStateInfo {
|
|
2603
|
+
/**
|
|
2604
|
+
* 交互状态名
|
|
2605
|
+
*/
|
|
2130
2606
|
stateName?: InteractionStateName;
|
|
2607
|
+
/**
|
|
2608
|
+
* 单元格元数据 (包含不在可视范围内的)
|
|
2609
|
+
*/
|
|
2131
2610
|
cells?: CellMeta[];
|
|
2611
|
+
/**
|
|
2612
|
+
* 交互状态发生改变的单元格实例
|
|
2613
|
+
*/
|
|
2132
2614
|
interactedCells?: S2CellType_2[];
|
|
2615
|
+
/**
|
|
2616
|
+
* 选中的单元格节点
|
|
2617
|
+
*/
|
|
2133
2618
|
nodes?: Node_2_2[];
|
|
2619
|
+
/**
|
|
2620
|
+
* 如果单元格为空, 是否强制更新 (适用于反选等场景)
|
|
2621
|
+
*/
|
|
2134
2622
|
force?: boolean;
|
|
2135
|
-
/**
|
|
2623
|
+
/**
|
|
2624
|
+
* 交互行为改变后,会被更新和重绘的单元格回调
|
|
2625
|
+
*/
|
|
2136
2626
|
onUpdateCells?: OnUpdateCells;
|
|
2137
2627
|
}
|
|
2138
2628
|
|
|
@@ -2148,12 +2638,19 @@ declare enum InteractionStateName {
|
|
|
2148
2638
|
}
|
|
2149
2639
|
|
|
2150
2640
|
declare interface InteractionStateTheme {
|
|
2641
|
+
/** 背景透明度 */
|
|
2151
2642
|
backgroundOpacity?: number;
|
|
2643
|
+
/** 背景填充色 */
|
|
2152
2644
|
backgroundColor?: string;
|
|
2645
|
+
/** 文本透明度 */
|
|
2153
2646
|
textOpacity?: number;
|
|
2647
|
+
/** 边线颜色 */
|
|
2154
2648
|
borderColor?: string;
|
|
2649
|
+
/** 边线宽度 */
|
|
2155
2650
|
borderWidth?: number;
|
|
2651
|
+
/** 边线透明度 */
|
|
2156
2652
|
borderOpacity?: number;
|
|
2653
|
+
/** 透明度 */
|
|
2157
2654
|
opacity?: number;
|
|
2158
2655
|
}
|
|
2159
2656
|
|
|
@@ -2162,13 +2659,23 @@ declare type Intercept = InterceptType[keyof InterceptType];
|
|
|
2162
2659
|
declare enum InterceptType {
|
|
2163
2660
|
HOVER = "hover",
|
|
2164
2661
|
CLICK = "click",
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2662
|
+
DATA_CELL_BRUSH_SELECTION = "dataCellBrushSelection",
|
|
2663
|
+
ROW_CELL_BRUSH_SELECTION = "rowCellBrushSelection",
|
|
2664
|
+
COL_CELL_BRUSH_SELECTION = "colCellBrushSelection",
|
|
2168
2665
|
MULTI_SELECTION = "multiSelection",
|
|
2169
2666
|
RESIZE = "resize"
|
|
2170
2667
|
}
|
|
2171
2668
|
|
|
2669
|
+
declare type InternalFullyCellTheme = DeepRequired<DefaultCellTheme>;
|
|
2670
|
+
|
|
2671
|
+
declare interface InternalFullyHeaderActionIcon extends HeaderActionIcon {
|
|
2672
|
+
icons: FullyIconName[];
|
|
2673
|
+
isSortIcon?: boolean;
|
|
2674
|
+
}
|
|
2675
|
+
|
|
2676
|
+
declare type InternalFullyTheme = DeepRequired<S2Theme>;
|
|
2677
|
+
|
|
2678
|
+
/** 条件格式柱图样式配置 */
|
|
2172
2679
|
declare interface IntervalTheme {
|
|
2173
2680
|
height: number;
|
|
2174
2681
|
fill: string;
|
|
@@ -2184,14 +2691,14 @@ declare type KeyboardEventHandler = (event: KeyboardEvent) => void;
|
|
|
2184
2691
|
declare type LayoutArrange = (spreadsheet: SpreadSheet_2, parent: Node_2_2, field: string, fieldValues: string[]) => string[];
|
|
2185
2692
|
|
|
2186
2693
|
/**
|
|
2187
|
-
* determine the
|
|
2694
|
+
* determine the data of cells in Cartesian coordinates
|
|
2188
2695
|
*/
|
|
2189
|
-
declare type
|
|
2696
|
+
declare type LayoutCellMeta = (viewMeta: ViewMeta_2) => ViewMeta_2 | null;
|
|
2190
2697
|
|
|
2191
2698
|
/**
|
|
2192
|
-
* determine the
|
|
2699
|
+
* determine the location(x,y,width,height eg..) of every node
|
|
2193
2700
|
*/
|
|
2194
|
-
declare type
|
|
2701
|
+
declare type LayoutCoordinate = (spreadsheet: SpreadSheet_2, rowNode: Node_2_2 | null, colNode: Node_2_2 | null) => void;
|
|
2195
2702
|
|
|
2196
2703
|
/**
|
|
2197
2704
|
* determine what does row/column hierarchy look like
|
|
@@ -2213,14 +2720,38 @@ declare type LayoutPaginationParams = {
|
|
|
2213
2720
|
};
|
|
2214
2721
|
|
|
2215
2722
|
declare interface LayoutResult_2 {
|
|
2723
|
+
/**
|
|
2724
|
+
* 列头节点, 对应 ColCell (含可视范围外)
|
|
2725
|
+
*/
|
|
2216
2726
|
colNodes: Node_2_2[];
|
|
2727
|
+
/**
|
|
2728
|
+
* 列头叶子节点, 对应 ColCell (含可视范围外)
|
|
2729
|
+
*/
|
|
2730
|
+
colLeafNodes: Node_2_2[];
|
|
2731
|
+
/**
|
|
2732
|
+
* 列头节点层级结构 (含可视范围外)
|
|
2733
|
+
*/
|
|
2217
2734
|
colsHierarchy: Hierarchy;
|
|
2735
|
+
/**
|
|
2736
|
+
* 行头节点, 对应 RowCell (含可视范围外)
|
|
2737
|
+
*/
|
|
2218
2738
|
rowNodes: Node_2_2[];
|
|
2739
|
+
/**
|
|
2740
|
+
* 行头节点层级结构 (含可视范围外)
|
|
2741
|
+
*/
|
|
2219
2742
|
rowsHierarchy: Hierarchy;
|
|
2743
|
+
/**
|
|
2744
|
+
* 行头叶子节点, 对应 RowCell (含可视范围外)
|
|
2745
|
+
*/
|
|
2220
2746
|
rowLeafNodes: Node_2_2[];
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2747
|
+
/**
|
|
2748
|
+
* 序号节点, 对应 SeriesNumberCell (含可视范围外)
|
|
2749
|
+
*/
|
|
2750
|
+
seriesNumberNodes?: Node_2_2[];
|
|
2751
|
+
/**
|
|
2752
|
+
* 角头节点, 对应 CornerCell (含可视范围外)
|
|
2753
|
+
*/
|
|
2754
|
+
cornerNodes?: Node_2_2[];
|
|
2224
2755
|
}
|
|
2225
2756
|
|
|
2226
2757
|
/**
|
|
@@ -2236,12 +2767,15 @@ declare type LayoutSeriesNumberNodes = (rowsHierarchy: Hierarchy, seriesNumberWi
|
|
|
2236
2767
|
*/
|
|
2237
2768
|
declare type LayoutWidthType = 'adaptive' | 'colAdaptive' | 'compact';
|
|
2238
2769
|
|
|
2770
|
+
/** 折线图样式配置 */
|
|
2239
2771
|
declare interface LineTheme {
|
|
2772
|
+
/** 点 */
|
|
2240
2773
|
point?: {
|
|
2241
2774
|
size: number;
|
|
2242
2775
|
fill?: string;
|
|
2243
2776
|
opacity?: number;
|
|
2244
2777
|
};
|
|
2778
|
+
/** 线 */
|
|
2245
2779
|
linkLine?: {
|
|
2246
2780
|
size: number;
|
|
2247
2781
|
fill?: string;
|
|
@@ -2249,25 +2783,11 @@ declare interface LineTheme {
|
|
|
2249
2783
|
};
|
|
2250
2784
|
}
|
|
2251
2785
|
|
|
2252
|
-
declare type
|
|
2786
|
+
declare type Margin = Padding;
|
|
2253
2787
|
|
|
2254
|
-
declare
|
|
2255
|
-
icon?: string;
|
|
2256
|
-
fill: string;
|
|
2257
|
-
isCompare?: boolean;
|
|
2258
|
-
/**
|
|
2259
|
-
* @description only used in background condition, when the background color is too light, the font color will be white
|
|
2260
|
-
* @version 1.34.0
|
|
2261
|
-
*/
|
|
2262
|
-
intelligentReverseTextColor?: boolean;
|
|
2263
|
-
/**
|
|
2264
|
-
* @description custom the interval condition's width
|
|
2265
|
-
* @version 1.38.0
|
|
2266
|
-
*/
|
|
2267
|
-
fieldValue?: number;
|
|
2268
|
-
}
|
|
2788
|
+
declare type MatrixHTMLTransformer = (data: DataItem[][]) => CopyableHTML;
|
|
2269
2789
|
|
|
2270
|
-
declare type
|
|
2790
|
+
declare type MatrixPlainTransformer = (data: DataItem[][], separator?: string) => CopyablePlain;
|
|
2271
2791
|
|
|
2272
2792
|
/**
|
|
2273
2793
|
* Cell for panelGroup area
|
|
@@ -2276,7 +2796,7 @@ declare class MergedCell extends DataCell_2 {
|
|
|
2276
2796
|
cells: S2CellType_2[];
|
|
2277
2797
|
constructor(spreadsheet: SpreadSheet_2, cells: S2CellType_2[], meta?: ViewMeta_2);
|
|
2278
2798
|
handleRestOptions(...[cells]: [S2CellType_2[]]): void;
|
|
2279
|
-
get cellType():
|
|
2799
|
+
get cellType(): CellType;
|
|
2280
2800
|
update(): void;
|
|
2281
2801
|
protected initCell(): void;
|
|
2282
2802
|
/**
|
|
@@ -2289,9 +2809,8 @@ declare class MergedCell extends DataCell_2 {
|
|
|
2289
2809
|
drawTextShape(): void;
|
|
2290
2810
|
}
|
|
2291
2811
|
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
*/
|
|
2812
|
+
declare type MergedCellCallback = (spreadsheet: SpreadSheet_2, cells: S2CellType_2[], meta?: ViewMeta_2) => MergedCell;
|
|
2813
|
+
|
|
2295
2814
|
declare interface MergedCellInfo {
|
|
2296
2815
|
colIndex?: number;
|
|
2297
2816
|
rowIndex?: number;
|
|
@@ -2311,11 +2830,17 @@ declare interface Meta {
|
|
|
2311
2830
|
* 字段描述
|
|
2312
2831
|
*/
|
|
2313
2832
|
description?: string;
|
|
2833
|
+
/**
|
|
2834
|
+
* 格式化
|
|
2835
|
+
* 数值字段:一般用于格式化数字单位
|
|
2836
|
+
* 文本字段:一般用于做字段枚举值的别名
|
|
2837
|
+
*/
|
|
2314
2838
|
formatter?: Formatter;
|
|
2315
2839
|
}
|
|
2316
2840
|
|
|
2317
2841
|
declare type MiniChartData = BaseChartData | BulletValue;
|
|
2318
2842
|
|
|
2843
|
+
/** 迷你图样式 */
|
|
2319
2844
|
declare interface MiniChartTheme {
|
|
2320
2845
|
line?: LineTheme;
|
|
2321
2846
|
bar?: BarTheme;
|
|
@@ -2333,19 +2858,24 @@ declare enum MiniChartTypes {
|
|
|
2333
2858
|
declare type MouseEventHandler = (event: MouseEvent) => void;
|
|
2334
2859
|
|
|
2335
2860
|
/**
|
|
2336
|
-
*
|
|
2337
|
-
*
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2861
|
+
* 单个单元格, 显示一组数据
|
|
2862
|
+
* 适用于 (网格分析表, 趋势分析表) 和其他自定义场景
|
|
2863
|
+
{
|
|
2864
|
+
label: '余额女',
|
|
2865
|
+
values: [
|
|
2866
|
+
['最近7天登端天数', 1, 3423423, 323],
|
|
2867
|
+
['自然月新登用户数', 1, 3423423, 323],
|
|
2868
|
+
['最近7天登端天数', 1, 3423423, 323],
|
|
2869
|
+
['自然月新登用户数', 1, 3423423, 323],
|
|
2870
|
+
],
|
|
2871
|
+
}
|
|
2345
2872
|
*/
|
|
2346
2873
|
declare interface MultiData<T = SimpleData[][] | MiniChartData> {
|
|
2874
|
+
/** 数值 */
|
|
2347
2875
|
values: T;
|
|
2876
|
+
/** 原始值 */
|
|
2348
2877
|
originalValues?: T;
|
|
2878
|
+
/** 单元格标题 */
|
|
2349
2879
|
label?: string;
|
|
2350
2880
|
[key: string]: unknown;
|
|
2351
2881
|
}
|
|
@@ -2383,7 +2913,11 @@ declare class Node_2_2 {
|
|
|
2383
2913
|
isGrandTotals?: boolean;
|
|
2384
2914
|
isSubTotals?: boolean;
|
|
2385
2915
|
hiddenChildNodeInfo?: HiddenColumnsInfo_2 | null;
|
|
2386
|
-
extra?:
|
|
2916
|
+
extra?: {
|
|
2917
|
+
description?: string;
|
|
2918
|
+
isCustomNode?: boolean;
|
|
2919
|
+
[key: string]: any;
|
|
2920
|
+
};
|
|
2387
2921
|
[key: string]: any;
|
|
2388
2922
|
constructor(cfg: BaseNodeConfig);
|
|
2389
2923
|
/**
|
|
@@ -2440,9 +2974,14 @@ declare class Node_2_2 {
|
|
|
2440
2974
|
*
|
|
2441
2975
|
*/
|
|
2442
2976
|
getTotalHeightForTreeHierarchy(): number;
|
|
2977
|
+
isSeriesNumberNode(): boolean;
|
|
2443
2978
|
}
|
|
2444
2979
|
|
|
2445
2980
|
declare interface OffsetConfig {
|
|
2981
|
+
rowHeaderOffsetX?: {
|
|
2982
|
+
value: number | undefined;
|
|
2983
|
+
animate?: boolean;
|
|
2984
|
+
};
|
|
2446
2985
|
offsetX?: {
|
|
2447
2986
|
value: number | undefined;
|
|
2448
2987
|
animate?: boolean;
|
|
@@ -2463,8 +3002,11 @@ declare interface Padding {
|
|
|
2463
3002
|
}
|
|
2464
3003
|
|
|
2465
3004
|
declare interface Pagination_2 {
|
|
3005
|
+
/** 每页数量 */
|
|
2466
3006
|
pageSize: number;
|
|
3007
|
+
/** 当前页 (从 1 开始) */
|
|
2467
3008
|
current: number;
|
|
3009
|
+
/** 数据总条数 */
|
|
2468
3010
|
total?: number;
|
|
2469
3011
|
}
|
|
2470
3012
|
|
|
@@ -2472,6 +3014,13 @@ declare interface Palette extends PaletteMeta {
|
|
|
2472
3014
|
basicColors: string[];
|
|
2473
3015
|
}
|
|
2474
3016
|
|
|
3017
|
+
declare const PALETTE_MAP: {
|
|
3018
|
+
readonly default: Palette;
|
|
3019
|
+
readonly colorful: Palette;
|
|
3020
|
+
readonly gray: Palette;
|
|
3021
|
+
readonly dark: Palette;
|
|
3022
|
+
};
|
|
3023
|
+
|
|
2475
3024
|
declare interface PaletteMeta {
|
|
2476
3025
|
/** 主题色 */
|
|
2477
3026
|
brandColor: string;
|
|
@@ -2483,12 +3032,14 @@ declare interface PaletteMeta {
|
|
|
2483
3032
|
basicColorIndex: number;
|
|
2484
3033
|
standardColorIndex: number;
|
|
2485
3034
|
}>;
|
|
3035
|
+
/** 语义色值 */
|
|
2486
3036
|
semanticColors: {
|
|
2487
3037
|
red: string;
|
|
2488
3038
|
green: string;
|
|
2489
3039
|
yellow: string;
|
|
2490
3040
|
[key: string]: string;
|
|
2491
3041
|
};
|
|
3042
|
+
/** 补充色值 */
|
|
2492
3043
|
others?: {
|
|
2493
3044
|
results: string;
|
|
2494
3045
|
highlight: string;
|
|
@@ -2511,6 +3062,7 @@ declare type PanelIndexes = {
|
|
|
2511
3062
|
declare class PanelScrollGroup extends GridGroup {
|
|
2512
3063
|
protected mergedCellsGroup: Group;
|
|
2513
3064
|
constructor(cfg: GridGroupConstructorParameters);
|
|
3065
|
+
getMergedCellsGroup(): Group;
|
|
2514
3066
|
protected initMergedCellsGroup(): void;
|
|
2515
3067
|
updateMergedCells(): void;
|
|
2516
3068
|
addMergeCell(mergeCell: MergedCell): void;
|
|
@@ -2579,7 +3131,7 @@ rowCellMouseUp: (data: TargetCellInfo) => void;
|
|
|
2579
3131
|
rowCellMouseMove: (data: TargetCellInfo) => void;
|
|
2580
3132
|
rowCellCollapsed: (params: RowCellCollapsedParams) => void;
|
|
2581
3133
|
rowCellAllCollapsed: (isCollapsed: boolean) => void;
|
|
2582
|
-
rowCellScroll: (position:
|
|
3134
|
+
rowCellScroll: (position: Required<ScrollOffset>) => void;
|
|
2583
3135
|
colCellHover: (data: TargetCellInfo) => void;
|
|
2584
3136
|
colCellClick: (data: TargetCellInfo) => void;
|
|
2585
3137
|
colCellDoubleClick: (data: TargetCellInfo) => void;
|
|
@@ -2668,7 +3220,7 @@ linkFieldJump: (data: {
|
|
|
2668
3220
|
field: string;
|
|
2669
3221
|
record: RawData;
|
|
2670
3222
|
}) => void;
|
|
2671
|
-
scroll: (position:
|
|
3223
|
+
scroll: (position: Required<ScrollOffset>) => void;
|
|
2672
3224
|
layoutAfterRealDataCellRender: (options: {
|
|
2673
3225
|
add: [number, number][];
|
|
2674
3226
|
remove: [number, number][];
|
|
@@ -2714,7 +3266,7 @@ onRowCellMouseUp?: (data: TargetCellInfo) => any;
|
|
|
2714
3266
|
onRowCellMouseMove?: (data: TargetCellInfo) => any;
|
|
2715
3267
|
onRowCellCollapsed?: (params: RowCellCollapsedParams) => any;
|
|
2716
3268
|
onRowCellAllCollapsed?: (isCollapsed: boolean) => any;
|
|
2717
|
-
onRowCellScroll?: (position:
|
|
3269
|
+
onRowCellScroll?: (position: Required<ScrollOffset>) => any;
|
|
2718
3270
|
onColCellHover?: (data: TargetCellInfo) => any;
|
|
2719
3271
|
onColCellClick?: (data: TargetCellInfo) => any;
|
|
2720
3272
|
onColCellDoubleClick?: (data: TargetCellInfo) => any;
|
|
@@ -2803,7 +3355,7 @@ onLinkFieldJump?: (data: {
|
|
|
2803
3355
|
field: string;
|
|
2804
3356
|
record: RawData;
|
|
2805
3357
|
}) => any;
|
|
2806
|
-
onScroll?: (position:
|
|
3358
|
+
onScroll?: (position: Required<ScrollOffset>) => any;
|
|
2807
3359
|
onLayoutAfterRealDataCellRender?: (options: {
|
|
2808
3360
|
add: [number, number][];
|
|
2809
3361
|
remove: [number, number][];
|
|
@@ -2845,9 +3397,13 @@ declare interface PropOption<T = any> {
|
|
|
2845
3397
|
|
|
2846
3398
|
declare type Query = Record<string, any>;
|
|
2847
3399
|
|
|
3400
|
+
/** 子弹图状态颜色 */
|
|
2848
3401
|
declare interface RangeColors {
|
|
3402
|
+
/** 满意 */
|
|
2849
3403
|
good: string;
|
|
3404
|
+
/** 良好 */
|
|
2850
3405
|
satisfactory: string;
|
|
3406
|
+
/** 不符合预期 */
|
|
2851
3407
|
bad: string;
|
|
2852
3408
|
}
|
|
2853
3409
|
|
|
@@ -2859,12 +3415,19 @@ declare interface RequiredPropOption<T = any> {
|
|
|
2859
3415
|
}
|
|
2860
3416
|
|
|
2861
3417
|
declare interface ResizeArea {
|
|
3418
|
+
/** 热区尺寸 */
|
|
2862
3419
|
size?: number;
|
|
3420
|
+
/** 热区背景色 */
|
|
2863
3421
|
background?: string;
|
|
3422
|
+
/** 参考线颜色 */
|
|
2864
3423
|
guideLineColor?: string;
|
|
3424
|
+
/** 参考线不可用颜色 */
|
|
2865
3425
|
guideLineDisableColor?: string;
|
|
3426
|
+
/** 参考线间隔 */
|
|
2866
3427
|
guideLineDash?: number[];
|
|
3428
|
+
/** 热区背景色透明度 */
|
|
2867
3429
|
backgroundOpacity?: number;
|
|
3430
|
+
/** 交互态 */
|
|
2868
3431
|
interactionState?: InteractionState;
|
|
2869
3432
|
}
|
|
2870
3433
|
|
|
@@ -2921,7 +3484,9 @@ declare interface ResizeInteractionOptions {
|
|
|
2921
3484
|
rowResizeType?: ResizeType;
|
|
2922
3485
|
/** 列高调整时,影响当前列还是全部列 */
|
|
2923
3486
|
colResizeType?: ResizeType;
|
|
3487
|
+
/** 是否允许调整, 返回 false 时拖拽的宽高无效 */
|
|
2924
3488
|
disable?: (resizeInfo: ResizeInfo_2) => boolean;
|
|
3489
|
+
/** 是否显示热区 */
|
|
2925
3490
|
visible?: (cell: S2CellType_2) => boolean;
|
|
2926
3491
|
}
|
|
2927
3492
|
|
|
@@ -2960,17 +3525,11 @@ declare class RootInteraction {
|
|
|
2960
3525
|
isHoverState(): boolean;
|
|
2961
3526
|
isActiveCell(cell: S2CellType_2): boolean;
|
|
2962
3527
|
isSelectedCell(cell: S2CellType_2): boolean;
|
|
2963
|
-
getCells(cellType?:
|
|
3528
|
+
getCells(cellType?: CellType[]): CellMeta[];
|
|
2964
3529
|
getActiveCells(): S2CellType_2[];
|
|
2965
3530
|
clearStyleIndependent(): void;
|
|
2966
|
-
|
|
2967
|
-
getPanelGroupAllDataCells(): DataCell_2[];
|
|
2968
|
-
getAllRowHeaderCells(): RowCell[];
|
|
2969
|
-
getAllColHeaderCells(): ColCell[];
|
|
2970
|
-
getRowColActiveCells(ids: string[]): S2CellType_2<ViewMeta_2>[];
|
|
2971
|
-
getAllCells(): S2CellType_2<ViewMeta_2>[];
|
|
3531
|
+
getUnSelectedDataCells(): DataCell_2[];
|
|
2972
3532
|
selectAll: () => void;
|
|
2973
|
-
getCellChildrenNodes: (cell: S2CellType_2) => Node_2_2[];
|
|
2974
3533
|
selectHeaderCell: (selectHeaderCellInfo?: SelectHeaderCellInfo) => true | undefined;
|
|
2975
3534
|
highlightNodes: (nodes?: Node_2_2[]) => void;
|
|
2976
3535
|
mergeCells: (cellsInfo?: MergedCellInfo[], hideData?: boolean) => void;
|
|
@@ -2991,12 +3550,12 @@ declare class RootInteraction {
|
|
|
2991
3550
|
clearHoverTimer(): void;
|
|
2992
3551
|
setHoverTimer(timer: number): void;
|
|
2993
3552
|
getHoverTimer(): number | null;
|
|
2994
|
-
getSelectedCellHighlight():
|
|
3553
|
+
getSelectedCellHighlight(): InteractionCellSelectedHighlightOptions;
|
|
2995
3554
|
}
|
|
2996
3555
|
|
|
2997
3556
|
declare class RowCell extends HeaderCell {
|
|
2998
3557
|
protected headerConfig: RowHeaderConfig;
|
|
2999
|
-
get cellType():
|
|
3558
|
+
get cellType(): CellType;
|
|
3000
3559
|
protected getBorderPositions(): CellBorderPosition[];
|
|
3001
3560
|
protected initCell(): void;
|
|
3002
3561
|
protected showTreeIcon(): boolean;
|
|
@@ -3008,15 +3567,10 @@ declare class RowCell extends HeaderCell {
|
|
|
3008
3567
|
protected drawTreeLeafNodeAlignDot(): void;
|
|
3009
3568
|
protected isBolderText(): boolean;
|
|
3010
3569
|
protected drawTextShape(): void;
|
|
3011
|
-
protected drawLinkFieldShape(): void;
|
|
3012
3570
|
protected drawResizeAreaInLeaf(): void;
|
|
3013
3571
|
protected getContentIndent(): number;
|
|
3014
3572
|
protected getTextIndent(): number;
|
|
3015
3573
|
protected isTreeLevel(): any;
|
|
3016
|
-
protected getIconPosition(): {
|
|
3017
|
-
x: number;
|
|
3018
|
-
y: number;
|
|
3019
|
-
};
|
|
3020
3574
|
protected getMaxTextWidth(): number;
|
|
3021
3575
|
protected getTextArea(): {
|
|
3022
3576
|
x: number;
|
|
@@ -3025,7 +3579,6 @@ declare class RowCell extends HeaderCell {
|
|
|
3025
3579
|
height: number;
|
|
3026
3580
|
};
|
|
3027
3581
|
protected getTextPosition(): PointLike;
|
|
3028
|
-
protected getIconYPosition(): number;
|
|
3029
3582
|
}
|
|
3030
3583
|
|
|
3031
3584
|
declare type RowCellCollapsedParams_2 = {
|
|
@@ -3085,14 +3638,17 @@ declare interface S2BasicOptions<T = TooltipContentType_2, P = Pagination_2, Ico
|
|
|
3085
3638
|
debug?: boolean;
|
|
3086
3639
|
/**
|
|
3087
3640
|
* 字段标记
|
|
3641
|
+
* @see https://s2.antv.antgroup.com/manual/basic/conditions
|
|
3088
3642
|
*/
|
|
3089
3643
|
conditions?: Conditions | null;
|
|
3090
3644
|
/**
|
|
3091
3645
|
* 提示信息
|
|
3646
|
+
* @see https://s2.antv.antgroup.com/manual/basic/tooltip
|
|
3092
3647
|
*/
|
|
3093
3648
|
tooltip?: Tooltip<T, Icon, Text> | null;
|
|
3094
3649
|
/**
|
|
3095
3650
|
* 交互配置
|
|
3651
|
+
* @see https://s2.antv.antgroup.com/manual/advanced/interaction/basic
|
|
3096
3652
|
*/
|
|
3097
3653
|
interaction?: InteractionOptions;
|
|
3098
3654
|
/**
|
|
@@ -3113,18 +3669,22 @@ declare interface S2BasicOptions<T = TooltipContentType_2, P = Pagination_2, Ico
|
|
|
3113
3669
|
showDefaultHeaderActionIcon?: boolean;
|
|
3114
3670
|
/**
|
|
3115
3671
|
* 自定义表头图标配置
|
|
3672
|
+
* @see https://s2.antv.antgroup.com/manual/advanced/custom/custom-icon
|
|
3116
3673
|
*/
|
|
3117
3674
|
headerActionIcons?: HeaderActionIcon[];
|
|
3118
3675
|
/**
|
|
3119
3676
|
* 自定义 SVG 图标
|
|
3677
|
+
* @see https://s2.antv.antgroup.com/manual/advanced/custom/custom-icon
|
|
3120
3678
|
*/
|
|
3121
3679
|
customSVGIcons?: CustomSVGIcon[];
|
|
3122
3680
|
/**
|
|
3123
3681
|
* 表格单元格宽高配置
|
|
3682
|
+
* @see https://s2.antv.antgroup.com/manual/advanced/custom/cell-size
|
|
3124
3683
|
*/
|
|
3125
3684
|
style?: S2Style;
|
|
3126
3685
|
/**
|
|
3127
3686
|
* 是否开启高清适配
|
|
3687
|
+
* @see https://s2.antv.antgroup.com/manual/advanced/hd-adapter
|
|
3128
3688
|
*/
|
|
3129
3689
|
hdAdapter?: boolean;
|
|
3130
3690
|
/**
|
|
@@ -3146,49 +3706,64 @@ declare interface S2BasicOptions<T = TooltipContentType_2, P = Pagination_2, Ico
|
|
|
3146
3706
|
/** *********** 自定义单元格 hooks **************** */
|
|
3147
3707
|
/**
|
|
3148
3708
|
* 自定义数值单元格
|
|
3709
|
+
* @see https://s2.antv.antgroup.com/examples/custom/custom-cell#data-cell
|
|
3149
3710
|
*/
|
|
3150
3711
|
dataCell?: DataCellCallback;
|
|
3151
3712
|
/**
|
|
3152
3713
|
* 自定义角头单元格
|
|
3714
|
+
* @see https://s2.antv.antgroup.com/examples/custom/custom-cell#corner-cell
|
|
3153
3715
|
*/
|
|
3154
3716
|
cornerCell?: CellCallback<CornerHeaderConfig>;
|
|
3155
3717
|
/**
|
|
3156
3718
|
* 自定义序号单元格
|
|
3719
|
+
* @see https://s2.antv.antgroup.com/examples/custom/custom-cell#series-number-cell
|
|
3157
3720
|
*/
|
|
3158
3721
|
seriesNumberCell?: CellCallback<BaseHeaderConfig>;
|
|
3159
3722
|
/**
|
|
3160
3723
|
* 自定义行头单元格
|
|
3724
|
+
* @see https://s2.antv.antgroup.com/examples/custom/custom-cell#row-cell
|
|
3161
3725
|
*/
|
|
3162
3726
|
rowCell?: CellCallback<RowHeaderConfig>;
|
|
3163
3727
|
/**
|
|
3164
3728
|
* 自定义列头单元格
|
|
3729
|
+
* @see https://s2.antv.antgroup.com/examples/custom/custom-cell#col-cell
|
|
3165
3730
|
*/
|
|
3166
3731
|
colCell?: CellCallback<ColHeaderConfig>;
|
|
3732
|
+
/**
|
|
3733
|
+
* 自定义合并单元格
|
|
3734
|
+
*/
|
|
3735
|
+
mergedCell?: MergedCellCallback;
|
|
3167
3736
|
/**
|
|
3168
3737
|
* 自定义表格框架/边框
|
|
3738
|
+
* @see https://s2.antv.antgroup.com/examples/case/comparison#measure-comparison
|
|
3169
3739
|
*/
|
|
3170
3740
|
frame?: FrameCallback;
|
|
3171
3741
|
/**
|
|
3172
3742
|
* 自定义角头
|
|
3743
|
+
* @see https://s2.antv.antgroup.com/zh/examples/custom/custom-cell/#corner-header
|
|
3173
3744
|
*/
|
|
3174
3745
|
cornerHeader?: CornerHeaderCallback;
|
|
3175
3746
|
/** *********** 自定义布局 hooks **************** */
|
|
3176
3747
|
/**
|
|
3177
3748
|
* 自定义单元格层级, 动态增加/删除单元格
|
|
3749
|
+
* @see https://s2.antv.antgroup.com/examples/custom/custom-layout#custom-layout-hierarchy
|
|
3178
3750
|
*/
|
|
3179
3751
|
layoutHierarchy?: LayoutHierarchy;
|
|
3180
3752
|
/**
|
|
3181
3753
|
* 自定义节点排列顺序 (树状模式有效)
|
|
3754
|
+
* @see https://s2.antv.antgroup.com/examples/custom/custom-layout#custom-layout-arrange
|
|
3182
3755
|
*/
|
|
3183
3756
|
layoutArrange?: LayoutArrange;
|
|
3184
3757
|
/**
|
|
3185
3758
|
* 自定义单元格对应节点坐标/宽高
|
|
3759
|
+
* @see https://s2.antv.antgroup.com/examples/custom/custom-layout#custom-layout-coordinate
|
|
3186
3760
|
*/
|
|
3187
3761
|
layoutCoordinate?: LayoutCoordinate;
|
|
3188
3762
|
/**
|
|
3189
|
-
*
|
|
3763
|
+
* 自定义单元格对应元数据
|
|
3764
|
+
* @see https://s2.antv.antgroup.com/zh/examples/custom/custom-layout/#custom-data-position
|
|
3190
3765
|
*/
|
|
3191
|
-
|
|
3766
|
+
layoutCellMeta?: LayoutCellMeta;
|
|
3192
3767
|
/**
|
|
3193
3768
|
* 自定义序号节点
|
|
3194
3769
|
*/
|
|
@@ -3198,15 +3773,34 @@ declare interface S2BasicOptions<T = TooltipContentType_2, P = Pagination_2, Ico
|
|
|
3198
3773
|
* 自定义数据集
|
|
3199
3774
|
*/
|
|
3200
3775
|
dataSet?: (spreadsheet: SpreadSheet_2) => BaseDataSet_2;
|
|
3776
|
+
/**
|
|
3777
|
+
* 自定义分面
|
|
3778
|
+
*/
|
|
3779
|
+
facet?: (spreadsheet: SpreadSheet_2) => BaseFacet;
|
|
3201
3780
|
}
|
|
3202
3781
|
|
|
3203
|
-
declare type S2CellType_2<T extends SimpleBBox = ViewMeta_2> = DataCell_2 | HeaderCell | ColCell | CornerCell | RowCell | SeriesNumberCell | MergedCell | TableCornerCell |
|
|
3782
|
+
declare type S2CellType_2<T extends SimpleBBox = ViewMeta_2> = DataCell_2 | HeaderCell | ColCell | CornerCell | RowCell | SeriesNumberCell | MergedCell | TableCornerCell | TableSeriesNumberCell | BaseCell<T>;
|
|
3204
3783
|
|
|
3205
3784
|
declare interface S2DataConfig_2 {
|
|
3785
|
+
/**
|
|
3786
|
+
* 原始明细数据
|
|
3787
|
+
*/
|
|
3206
3788
|
data: RawData_2[];
|
|
3789
|
+
/**
|
|
3790
|
+
* 维度字段
|
|
3791
|
+
*/
|
|
3207
3792
|
fields: Fields;
|
|
3793
|
+
/**
|
|
3794
|
+
* 字段元数据
|
|
3795
|
+
*/
|
|
3208
3796
|
meta?: Meta[];
|
|
3797
|
+
/**
|
|
3798
|
+
* 排序配置
|
|
3799
|
+
*/
|
|
3209
3800
|
sortParams?: SortParams_2;
|
|
3801
|
+
/**
|
|
3802
|
+
* 筛选配置
|
|
3803
|
+
*/
|
|
3210
3804
|
filterParams?: FilterParam[];
|
|
3211
3805
|
[key: string]: unknown;
|
|
3212
3806
|
}
|
|
@@ -3315,6 +3909,9 @@ declare interface S2EventHandler {
|
|
|
3315
3909
|
declare type S2MountContainer_2 = string | Element;
|
|
3316
3910
|
|
|
3317
3911
|
declare interface S2Options_2<T = TooltipContentType_2, P = Pagination_2, Icon = Element | string, Text = string> extends S2BasicOptions<T, P, Icon, Text>, S2PivotSheetOptions {
|
|
3912
|
+
/**
|
|
3913
|
+
* 行列冻结
|
|
3914
|
+
*/
|
|
3318
3915
|
frozen?: S2PivotSheetFrozenOptions & S2TableSheetFrozenOptions;
|
|
3319
3916
|
}
|
|
3320
3917
|
|
|
@@ -3334,10 +3931,12 @@ declare interface S2PivotSheetOptions {
|
|
|
3334
3931
|
hierarchyType?: 'grid' | 'tree';
|
|
3335
3932
|
/**
|
|
3336
3933
|
* 小计/总计配置
|
|
3934
|
+
* @see https://s2.antv.antgroup.com/manual/basic/totals
|
|
3337
3935
|
*/
|
|
3338
3936
|
totals?: Totals | null;
|
|
3339
3937
|
/**
|
|
3340
3938
|
* 合并单元格配置
|
|
3939
|
+
* @see https://s2.antv.antgroup.com/manual/advanced/interaction/merge-cell
|
|
3341
3940
|
*/
|
|
3342
3941
|
mergedCellsInfo?: MergedCellInfo[][];
|
|
3343
3942
|
/**
|
|
@@ -3404,10 +4003,15 @@ declare interface S2TableSheetFrozenOptions {
|
|
|
3404
4003
|
}
|
|
3405
4004
|
|
|
3406
4005
|
declare interface S2Theme extends CellThemes {
|
|
4006
|
+
/** 列宽行高调整热区 */
|
|
3407
4007
|
resizeArea?: ResizeArea;
|
|
4008
|
+
/** 滚动条样式 */
|
|
3408
4009
|
scrollBar?: ScrollBarTheme;
|
|
4010
|
+
/** 分割线样式 */
|
|
3409
4011
|
splitLine?: SplitLine;
|
|
4012
|
+
/** 刷选遮罩 */
|
|
3410
4013
|
prepareSelectMask?: InteractionStateTheme;
|
|
4014
|
+
/** 画布背景底色 */
|
|
3411
4015
|
background?: Background;
|
|
3412
4016
|
}
|
|
3413
4017
|
|
|
@@ -3488,21 +4092,28 @@ declare enum ScrollbarPositionType {
|
|
|
3488
4092
|
}
|
|
3489
4093
|
|
|
3490
4094
|
declare interface ScrollBarTheme {
|
|
4095
|
+
/** 滚动条轨道颜色 */
|
|
3491
4096
|
trackColor?: string;
|
|
4097
|
+
/** 滚动条 hover 态颜色 */
|
|
3492
4098
|
thumbHoverColor?: string;
|
|
4099
|
+
/** 滚动条颜色 */
|
|
3493
4100
|
thumbColor?: string;
|
|
4101
|
+
/** 滚动条水平最小尺寸 */
|
|
3494
4102
|
thumbHorizontalMinSize?: number;
|
|
4103
|
+
/** 滚动条垂直最小尺寸 */
|
|
3495
4104
|
thumbVerticalMinSize?: number;
|
|
4105
|
+
/** 滚动条尺寸 */
|
|
3496
4106
|
size?: number;
|
|
4107
|
+
/** 滚动条 hover 态尺寸 */
|
|
3497
4108
|
hoverSize?: number;
|
|
3498
4109
|
/** 指定如何绘制每一条线段末端,lineCap?: 'butt' | 'round' | 'square'; */
|
|
3499
4110
|
lineCap?: LineStyleProps['lineCap'];
|
|
3500
4111
|
}
|
|
3501
4112
|
|
|
3502
|
-
declare interface
|
|
4113
|
+
declare interface ScrollOffset_2 {
|
|
3503
4114
|
scrollX?: number;
|
|
3504
4115
|
scrollY?: number;
|
|
3505
|
-
|
|
4116
|
+
rowHeaderScrollX?: number;
|
|
3506
4117
|
}
|
|
3507
4118
|
|
|
3508
4119
|
declare interface ScrollSpeedRatio {
|
|
@@ -3520,12 +4131,13 @@ declare interface SelectHeaderCellInfo {
|
|
|
3520
4131
|
declare class SeriesNumberCell extends BaseCell<Node_2_2> {
|
|
3521
4132
|
protected headerConfig: BaseHeaderConfig;
|
|
3522
4133
|
protected handleRestOptions(...[headerConfig]: [BaseHeaderConfig]): void;
|
|
3523
|
-
get cellType():
|
|
4134
|
+
get cellType(): CellType;
|
|
3524
4135
|
protected getBorderPositions(): CellBorderPosition[];
|
|
3525
4136
|
protected initCell(): void;
|
|
3526
4137
|
protected getBackgroundColor(): {
|
|
3527
|
-
backgroundColor: string
|
|
3528
|
-
backgroundColorOpacity: number
|
|
4138
|
+
backgroundColor: string;
|
|
4139
|
+
backgroundColorOpacity: number;
|
|
4140
|
+
intelligentReverseTextColor: boolean;
|
|
3529
4141
|
};
|
|
3530
4142
|
update(): void;
|
|
3531
4143
|
protected getTextStyle(): TextTheme;
|
|
@@ -3533,7 +4145,8 @@ declare class SeriesNumberCell extends BaseCell<Node_2_2> {
|
|
|
3533
4145
|
protected getMaxTextWidth(): number;
|
|
3534
4146
|
protected getTextPosition(): PointLike;
|
|
3535
4147
|
protected findFieldCondition(): Condition | undefined;
|
|
3536
|
-
protected mappingValue():
|
|
4148
|
+
protected mappingValue(): ConditionMappingResult | undefined;
|
|
4149
|
+
protected getIconPosition(): PointLike;
|
|
3537
4150
|
}
|
|
3538
4151
|
|
|
3539
4152
|
declare class SeriesNumberHeader extends BaseHeader<BaseHeaderConfig> {
|
|
@@ -3551,6 +4164,7 @@ declare class SeriesNumberHeader extends BaseHeader<BaseHeaderConfig> {
|
|
|
3551
4164
|
clip(): void;
|
|
3552
4165
|
layout(): void;
|
|
3553
4166
|
protected offset(): void;
|
|
4167
|
+
getNodes(): Node_2_2[];
|
|
3554
4168
|
}
|
|
3555
4169
|
|
|
3556
4170
|
export declare const SheetComponent: DefineComponent<GetInitProps<SheetComponentProps, "sheetType" | "spreadsheet" | "options" | "loading" | "partDrillDown" | "renderConfig" | "adaptive" | "showPagination" | "themeCfg" | "header" | "onSheetUpdate" | "onRowCellHover" | "onRowCellClick" | "onRowCellDoubleClick" | "onRowCellContextMenu" | "onRowCellMouseDown" | "onRowCellMouseUp" | "onRowCellMouseMove" | "onRowCellCollapsed" | "onRowCellAllCollapsed" | "onRowCellScroll" | "onColCellHover" | "onColCellClick" | "onColCellDoubleClick" | "onColCellContextMenu" | "onColCellMouseDown" | "onColCellMouseUp" | "onColCellMouseMove" | "onColCellExpanded" | "onColCellHidden" | "onDataCellHover" | "onDataCellClick" | "onDataCellDoubleClick" | "onDataCellContextMenu" | "onDataCellMouseDown" | "onDataCellMouseUp" | "onDataCellMouseMove" | "onDataCellBrushSelection" | "onDataCellSelectMove" | "onCornerCellHover" | "onCornerCellClick" | "onCornerCellDoubleClick" | "onCornerCellContextMenu" | "onCornerCellMouseDown" | "onCornerCellMouseUp" | "onCornerCellMouseMove" | "onMergedCellsHover" | "onMergedCellsClick" | "onMergedCellsDoubleClick" | "onMergedCellsContextMenu" | "onMergedCellsMouseDown" | "onMergedCellsMouseUp" | "onMergedCellsMouseMove" | "onRangeSort" | "onRangeSorted" | "onRangeFilter" | "onRangeFiltered" | "onLayoutAfterHeaderLayout" | "onLayoutPagination" | "onLayoutCellMounted" | "onBeforeRender" | "onAfterRender" | "onMounted" | "onDestroy" | "onLayoutResize" | "onLayoutResizeSeriesWidth" | "onLayoutResizeRowWidth" | "onLayoutResizeRowHeight" | "onLayoutResizeColWidth" | "onLayoutResizeColHeight" | "onLayoutResizeTreeWidth" | "onLayoutResizeMouseDown" | "onLayoutResizeMouseUp" | "onLayoutResizeMouseMove" | "onKeyBoardDown" | "onKeyBoardUp" | "onCopied" | "onActionIconHover" | "onActionIconHoverOff" | "onActionIconClick" | "onContextMenu" | "onClick" | "onHover" | "onDoubleClick" | "onMouseHover" | "onMouseUp" | "onMouseDown" | "onMouseMove" | "onSelected" | "onReset" | "onLinkFieldJump" | "onScroll" | "onLayoutAfterRealDataCellRender" | "onRowCellBrushSelection" | "onColCellBrushSelection">, {
|
|
@@ -3597,7 +4211,7 @@ rowCellMouseUp: (data: TargetCellInfo_2) => void;
|
|
|
3597
4211
|
rowCellMouseMove: (data: TargetCellInfo_2) => void;
|
|
3598
4212
|
rowCellCollapsed: (params: RowCellCollapsedParams_2) => void;
|
|
3599
4213
|
rowCellAllCollapsed: (isCollapsed: boolean) => void;
|
|
3600
|
-
rowCellScroll: (position:
|
|
4214
|
+
rowCellScroll: (position: Required<ScrollOffset_2>) => void;
|
|
3601
4215
|
colCellHover: (data: TargetCellInfo_2) => void;
|
|
3602
4216
|
colCellClick: (data: TargetCellInfo_2) => void;
|
|
3603
4217
|
colCellDoubleClick: (data: TargetCellInfo_2) => void;
|
|
@@ -3686,7 +4300,7 @@ linkFieldJump: (data: {
|
|
|
3686
4300
|
field: string;
|
|
3687
4301
|
record: RawData_2;
|
|
3688
4302
|
}) => void;
|
|
3689
|
-
scroll: (position:
|
|
4303
|
+
scroll: (position: Required<ScrollOffset_2>) => void;
|
|
3690
4304
|
layoutAfterRealDataCellRender: (options: {
|
|
3691
4305
|
add: [number, number][];
|
|
3692
4306
|
remove: [number, number][];
|
|
@@ -3732,7 +4346,7 @@ onRowCellMouseUp?: (data: TargetCellInfo_2) => any;
|
|
|
3732
4346
|
onRowCellMouseMove?: (data: TargetCellInfo_2) => any;
|
|
3733
4347
|
onRowCellCollapsed?: (params: RowCellCollapsedParams_2) => any;
|
|
3734
4348
|
onRowCellAllCollapsed?: (isCollapsed: boolean) => any;
|
|
3735
|
-
onRowCellScroll?: (position:
|
|
4349
|
+
onRowCellScroll?: (position: Required<ScrollOffset_2>) => any;
|
|
3736
4350
|
onColCellHover?: (data: TargetCellInfo_2) => any;
|
|
3737
4351
|
onColCellClick?: (data: TargetCellInfo_2) => any;
|
|
3738
4352
|
onColCellDoubleClick?: (data: TargetCellInfo_2) => any;
|
|
@@ -3821,7 +4435,7 @@ onLinkFieldJump?: (data: {
|
|
|
3821
4435
|
field: string;
|
|
3822
4436
|
record: RawData_2;
|
|
3823
4437
|
}) => any;
|
|
3824
|
-
onScroll?: (position:
|
|
4438
|
+
onScroll?: (position: Required<ScrollOffset_2>) => any;
|
|
3825
4439
|
onLayoutAfterRealDataCellRender?: (options: {
|
|
3826
4440
|
add: [number, number][];
|
|
3827
4441
|
remove: [number, number][];
|
|
@@ -3856,7 +4470,7 @@ rowCellMouseUp: (data: TargetCellInfo_2) => void;
|
|
|
3856
4470
|
rowCellMouseMove: (data: TargetCellInfo_2) => void;
|
|
3857
4471
|
rowCellCollapsed: (params: RowCellCollapsedParams_2) => void;
|
|
3858
4472
|
rowCellAllCollapsed: (isCollapsed: boolean) => void;
|
|
3859
|
-
rowCellScroll: (position:
|
|
4473
|
+
rowCellScroll: (position: Required<ScrollOffset_2>) => void;
|
|
3860
4474
|
colCellHover: (data: TargetCellInfo_2) => void;
|
|
3861
4475
|
colCellClick: (data: TargetCellInfo_2) => void;
|
|
3862
4476
|
colCellDoubleClick: (data: TargetCellInfo_2) => void;
|
|
@@ -3945,7 +4559,7 @@ linkFieldJump: (data: {
|
|
|
3945
4559
|
field: string;
|
|
3946
4560
|
record: RawData_2;
|
|
3947
4561
|
}) => void;
|
|
3948
|
-
scroll: (position:
|
|
4562
|
+
scroll: (position: Required<ScrollOffset_2>) => void;
|
|
3949
4563
|
layoutAfterRealDataCellRender: (options: {
|
|
3950
4564
|
add: [number, number][];
|
|
3951
4565
|
remove: [number, number][];
|
|
@@ -3964,7 +4578,7 @@ onRowCellMouseUp?: (data: TargetCellInfo_2) => any;
|
|
|
3964
4578
|
onRowCellMouseMove?: (data: TargetCellInfo_2) => any;
|
|
3965
4579
|
onRowCellCollapsed?: (params: RowCellCollapsedParams_2) => any;
|
|
3966
4580
|
onRowCellAllCollapsed?: (isCollapsed: boolean) => any;
|
|
3967
|
-
onRowCellScroll?: (position:
|
|
4581
|
+
onRowCellScroll?: (position: Required<ScrollOffset_2>) => any;
|
|
3968
4582
|
onColCellHover?: (data: TargetCellInfo_2) => any;
|
|
3969
4583
|
onColCellClick?: (data: TargetCellInfo_2) => any;
|
|
3970
4584
|
onColCellDoubleClick?: (data: TargetCellInfo_2) => any;
|
|
@@ -4053,7 +4667,7 @@ onLinkFieldJump?: (data: {
|
|
|
4053
4667
|
field: string;
|
|
4054
4668
|
record: RawData_2;
|
|
4055
4669
|
}) => any;
|
|
4056
|
-
onScroll?: (position:
|
|
4670
|
+
onScroll?: (position: Required<ScrollOffset_2>) => any;
|
|
4057
4671
|
onLayoutAfterRealDataCellRender?: (options: {
|
|
4058
4672
|
add: [number, number][];
|
|
4059
4673
|
remove: [number, number][];
|
|
@@ -4075,7 +4689,7 @@ rowCellMouseUp: (data: TargetCellInfo_2) => void;
|
|
|
4075
4689
|
rowCellMouseMove: (data: TargetCellInfo_2) => void;
|
|
4076
4690
|
rowCellCollapsed: (params: RowCellCollapsedParams_2) => void;
|
|
4077
4691
|
rowCellAllCollapsed: (isCollapsed: boolean) => void;
|
|
4078
|
-
rowCellScroll: (position:
|
|
4692
|
+
rowCellScroll: (position: Required<ScrollOffset_2>) => void;
|
|
4079
4693
|
colCellHover: (data: TargetCellInfo_2) => void;
|
|
4080
4694
|
colCellClick: (data: TargetCellInfo_2) => void;
|
|
4081
4695
|
colCellDoubleClick: (data: TargetCellInfo_2) => void;
|
|
@@ -4164,7 +4778,7 @@ linkFieldJump: (data: {
|
|
|
4164
4778
|
field: string;
|
|
4165
4779
|
record: RawData_2;
|
|
4166
4780
|
}) => void;
|
|
4167
|
-
scroll: (position:
|
|
4781
|
+
scroll: (position: Required<ScrollOffset_2>) => void;
|
|
4168
4782
|
layoutAfterRealDataCellRender: (options: {
|
|
4169
4783
|
add: [number, number][];
|
|
4170
4784
|
remove: [number, number][];
|
|
@@ -4183,7 +4797,7 @@ onRowCellMouseUp?: (data: TargetCellInfo_2) => any;
|
|
|
4183
4797
|
onRowCellMouseMove?: (data: TargetCellInfo_2) => any;
|
|
4184
4798
|
onRowCellCollapsed?: (params: RowCellCollapsedParams_2) => any;
|
|
4185
4799
|
onRowCellAllCollapsed?: (isCollapsed: boolean) => any;
|
|
4186
|
-
onRowCellScroll?: (position:
|
|
4800
|
+
onRowCellScroll?: (position: Required<ScrollOffset_2>) => any;
|
|
4187
4801
|
onColCellHover?: (data: TargetCellInfo_2) => any;
|
|
4188
4802
|
onColCellClick?: (data: TargetCellInfo_2) => any;
|
|
4189
4803
|
onColCellDoubleClick?: (data: TargetCellInfo_2) => any;
|
|
@@ -4272,7 +4886,7 @@ onLinkFieldJump?: (data: {
|
|
|
4272
4886
|
field: string;
|
|
4273
4887
|
record: RawData_2;
|
|
4274
4888
|
}) => any;
|
|
4275
|
-
onScroll?: (position:
|
|
4889
|
+
onScroll?: (position: Required<ScrollOffset_2>) => any;
|
|
4276
4890
|
onLayoutAfterRealDataCellRender?: (options: {
|
|
4277
4891
|
add: [number, number][];
|
|
4278
4892
|
remove: [number, number][];
|
|
@@ -4328,29 +4942,40 @@ declare interface SortFuncParam extends Sort {
|
|
|
4328
4942
|
declare type SortMethod = 'ASC' | 'DESC' | 'asc' | 'desc';
|
|
4329
4943
|
|
|
4330
4944
|
declare interface SortParam extends Sort {
|
|
4331
|
-
/**
|
|
4945
|
+
/** 自定义排序 */
|
|
4332
4946
|
sortFunc?: (param: SortFuncParam) => Array<string | Record<string, any>>;
|
|
4333
4947
|
}
|
|
4334
4948
|
|
|
4335
4949
|
declare type SortParams_2 = SortParam[];
|
|
4336
4950
|
|
|
4337
4951
|
declare interface SplitLine {
|
|
4952
|
+
/** 水平分割线颜色 */
|
|
4338
4953
|
horizontalBorderColor?: string;
|
|
4954
|
+
/** 水平分割线颜色透明度 */
|
|
4339
4955
|
horizontalBorderColorOpacity?: number;
|
|
4956
|
+
/** 水平分割线宽度 */
|
|
4340
4957
|
horizontalBorderWidth?: number;
|
|
4958
|
+
/** 垂直分割线颜色 */
|
|
4341
4959
|
verticalBorderColor?: string;
|
|
4960
|
+
/** 垂直分割线颜色透明度 */
|
|
4342
4961
|
verticalBorderColorOpacity?: number;
|
|
4962
|
+
/** 垂直分割线宽度 */
|
|
4343
4963
|
verticalBorderWidth?: number;
|
|
4964
|
+
/** 分割线是否显示外阴影 */
|
|
4344
4965
|
showShadow?: boolean;
|
|
4966
|
+
/** 阴影宽度 */
|
|
4345
4967
|
shadowWidth?: number;
|
|
4968
|
+
/** 阴影线性渐变色 */
|
|
4346
4969
|
shadowColors?: {
|
|
4970
|
+
/** 线性变化左侧颜色 */
|
|
4347
4971
|
left: string;
|
|
4972
|
+
/** 线性变化右侧颜色 */
|
|
4348
4973
|
right: string;
|
|
4349
4974
|
};
|
|
4350
4975
|
}
|
|
4351
4976
|
|
|
4352
4977
|
declare abstract class SpreadSheet_2 extends EE {
|
|
4353
|
-
theme:
|
|
4978
|
+
theme: InternalFullyTheme;
|
|
4354
4979
|
store: Store;
|
|
4355
4980
|
dataCfg: S2DataConfig_2;
|
|
4356
4981
|
options: S2Options_2;
|
|
@@ -4365,9 +4990,15 @@ declare abstract class SpreadSheet_2 extends EE {
|
|
|
4365
4990
|
hdAdapter: HdAdapter;
|
|
4366
4991
|
private untypedOn;
|
|
4367
4992
|
private untypedEmit;
|
|
4993
|
+
/**
|
|
4994
|
+
* 表格是否已销毁
|
|
4995
|
+
*/
|
|
4996
|
+
private destroyed;
|
|
4368
4997
|
on: <K extends keyof EmitterType>(event: K, listener: EmitterType[K]) => this;
|
|
4369
4998
|
emit: <K extends keyof EmitterType>(event: K, ...args: Parameters<EmitterType[K]>) => boolean;
|
|
4370
4999
|
constructor(dom: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2 | null);
|
|
5000
|
+
isCustomHeaderFields(fieldType?: keyof Pick<Fields, 'columns' | 'rows'>): boolean;
|
|
5001
|
+
isCustomColumnFields(): boolean;
|
|
4371
5002
|
private setOverscrollBehavior;
|
|
4372
5003
|
private restoreOverscrollBehavior;
|
|
4373
5004
|
private setDebug;
|
|
@@ -4387,9 +5018,7 @@ declare abstract class SpreadSheet_2 extends EE {
|
|
|
4387
5018
|
* Check if is pivot mode
|
|
4388
5019
|
*/
|
|
4389
5020
|
abstract isPivotMode(): boolean;
|
|
4390
|
-
abstract isCustomHeaderFields(fieldType?: keyof Pick<Fields, 'columns' | 'rows'>): boolean;
|
|
4391
5021
|
abstract isCustomRowFields(): boolean;
|
|
4392
|
-
abstract isCustomColumnFields(): boolean;
|
|
4393
5022
|
/**
|
|
4394
5023
|
* tree type must be in strategy mode
|
|
4395
5024
|
*/
|
|
@@ -4410,7 +5039,7 @@ declare abstract class SpreadSheet_2 extends EE {
|
|
|
4410
5039
|
abstract clearDrillDownData(rowNodeId?: string, preventRender?: boolean): void;
|
|
4411
5040
|
abstract handleGroupSort(event: FederatedPointerEvent, meta: Node_2_2): void;
|
|
4412
5041
|
showTooltip<T = TooltipContentType_2>(showOptions: TooltipShowOptions<T>): void;
|
|
4413
|
-
showTooltipWithInfo(event: FederatedPointerEvent | MouseEvent,
|
|
5042
|
+
showTooltipWithInfo(event: FederatedPointerEvent | MouseEvent, cellInfos: TooltipData[], options?: TooltipOptions): void;
|
|
4414
5043
|
hideTooltip(): void;
|
|
4415
5044
|
destroyTooltip(): void;
|
|
4416
5045
|
registerIcons(): void;
|
|
@@ -4423,7 +5052,13 @@ declare abstract class SpreadSheet_2 extends EE {
|
|
|
4423
5052
|
*/
|
|
4424
5053
|
setDataCfg(dataCfg: S2DataConfig_2, reset?: boolean): void;
|
|
4425
5054
|
setOptions(options: Partial<S2Options_2>, reset?: boolean): void;
|
|
4426
|
-
|
|
5055
|
+
private doRender;
|
|
5056
|
+
/**
|
|
5057
|
+
* 同步渲染
|
|
5058
|
+
* @deprecated 适配 g5.0 异步渲染过程中暂时保留
|
|
5059
|
+
*/
|
|
5060
|
+
UNSAFE_render(reloadData?: boolean, options?: S2RenderOptions_2): void;
|
|
5061
|
+
render(reloadData?: boolean, options?: S2RenderOptions_2): Promise<void>;
|
|
4427
5062
|
destroy(): void;
|
|
4428
5063
|
setThemeCfg(themeCfg?: ThemeCfg_2): void;
|
|
4429
5064
|
setTheme(theme: S2Theme): void;
|
|
@@ -4447,14 +5082,6 @@ declare abstract class SpreadSheet_2 extends EE {
|
|
|
4447
5082
|
*/
|
|
4448
5083
|
getCanvasElement(): HTMLCanvasElement;
|
|
4449
5084
|
getLayoutWidthType(): LayoutWidthType;
|
|
4450
|
-
getRowNodes(level?: number): Node_2_2[];
|
|
4451
|
-
getRowLeafNodes(): Node_2_2[];
|
|
4452
|
-
/**
|
|
4453
|
-
* get columnNode in levels,
|
|
4454
|
-
* @param level -1 = get all
|
|
4455
|
-
*/
|
|
4456
|
-
getColumnNodes(level?: number): Node_2_2[];
|
|
4457
|
-
getColumnLeafNodes(): Node_2_2[];
|
|
4458
5085
|
/**
|
|
4459
5086
|
* Update scroll's offset, the value can be undefined,
|
|
4460
5087
|
* indicate not update current value
|
|
@@ -4464,7 +5091,7 @@ declare abstract class SpreadSheet_2 extends EE {
|
|
|
4464
5091
|
*/
|
|
4465
5092
|
updateScrollOffset(offsetConfig: OffsetConfig): void;
|
|
4466
5093
|
getCell<T extends S2CellType_2 = S2CellType_2>(target: CellEventTarget): T | null;
|
|
4467
|
-
getCellType(target: CellEventTarget):
|
|
5094
|
+
getCellType(target: CellEventTarget): CellType | undefined;
|
|
4468
5095
|
/**
|
|
4469
5096
|
* get total's config by dimension id
|
|
4470
5097
|
* @param dimension unique dimension id
|
|
@@ -4481,8 +5108,6 @@ declare abstract class SpreadSheet_2 extends EE {
|
|
|
4481
5108
|
*/
|
|
4482
5109
|
protected initContainer(dom: S2MountContainer_2): void;
|
|
4483
5110
|
protected updateContainerStyle(): void;
|
|
4484
|
-
getInitColumnLeafNodes(): Node_2_2[];
|
|
4485
|
-
clearColumnLeafNodes(): void;
|
|
4486
5111
|
private initHiddenColumnsDetail;
|
|
4487
5112
|
private clearCanvasEvent;
|
|
4488
5113
|
/**
|
|
@@ -4531,34 +5156,91 @@ declare class Store {
|
|
|
4531
5156
|
size(): number;
|
|
4532
5157
|
}
|
|
4533
5158
|
|
|
4534
|
-
/**
|
|
4535
|
-
* All stored keys need type define here
|
|
4536
|
-
*/
|
|
4537
5159
|
declare interface StoreKey {
|
|
5160
|
+
/**
|
|
5161
|
+
* 水平滚动偏移
|
|
5162
|
+
*/
|
|
4538
5163
|
scrollX: number;
|
|
5164
|
+
/**
|
|
5165
|
+
* 垂直滚动偏移
|
|
5166
|
+
*/
|
|
4539
5167
|
scrollY: number;
|
|
4540
|
-
|
|
5168
|
+
/**
|
|
5169
|
+
* 行头水平滚动偏移
|
|
5170
|
+
*/
|
|
5171
|
+
rowHeaderScrollX: number;
|
|
5172
|
+
/**
|
|
5173
|
+
* 列头点击排序配置
|
|
5174
|
+
*/
|
|
4541
5175
|
sortParam: SortParam;
|
|
5176
|
+
/**
|
|
5177
|
+
* 下钻节点id和对应生成的 path 寻址路径
|
|
5178
|
+
*/
|
|
4542
5179
|
drillDownIdPathMap: Map<string, DataPath[]>;
|
|
5180
|
+
/**
|
|
5181
|
+
* 当前下钻节点
|
|
5182
|
+
*/
|
|
4543
5183
|
drillDownNode: Node_2_2;
|
|
5184
|
+
/**
|
|
5185
|
+
* 下钻数据的个数控制
|
|
5186
|
+
*/
|
|
4544
5187
|
drillItemsNum: number;
|
|
5188
|
+
/**
|
|
5189
|
+
* 下钻节点层级信息
|
|
5190
|
+
*/
|
|
4545
5191
|
drillDownFieldInLevel: PartDrillDownFieldInLevel[];
|
|
5192
|
+
/**
|
|
5193
|
+
* 当前交互状态信息
|
|
5194
|
+
*/
|
|
4546
5195
|
interactionStateInfo: InteractionStateInfo;
|
|
5196
|
+
/**
|
|
5197
|
+
* 原始数据配置
|
|
5198
|
+
*/
|
|
4547
5199
|
originalDataCfg: S2DataConfig_2;
|
|
5200
|
+
/**
|
|
5201
|
+
* 可视区域包裹盒模型
|
|
5202
|
+
*/
|
|
4548
5203
|
panelBBox: BBox;
|
|
5204
|
+
/**
|
|
5205
|
+
* 当前调整大小区域 group
|
|
5206
|
+
*/
|
|
4549
5207
|
activeResizeArea: Group;
|
|
5208
|
+
/**
|
|
5209
|
+
* 条件格式值区间
|
|
5210
|
+
*/
|
|
4550
5211
|
valueRanges: ValueRanges;
|
|
4551
|
-
|
|
5212
|
+
/**
|
|
5213
|
+
* 初次渲染时的列头叶子节点
|
|
5214
|
+
*/
|
|
5215
|
+
initColLeafNodes: Node_2_2[] | undefined;
|
|
4552
5216
|
/**
|
|
4553
5217
|
* 隐藏列详情
|
|
4554
5218
|
* | a, b, [c,d 隐藏] [icon e ] , [f 隐藏], [icon g] |
|
|
4555
5219
|
*/
|
|
4556
5220
|
hiddenColumnsDetail: HiddenColumnsInfo_2[];
|
|
5221
|
+
/**
|
|
5222
|
+
* 上一次渲染的列头
|
|
5223
|
+
*/
|
|
4557
5224
|
lastRenderedColumnFields: string[];
|
|
5225
|
+
/**
|
|
5226
|
+
* 是否手动调整过宽高
|
|
5227
|
+
*/
|
|
4558
5228
|
resized: boolean;
|
|
5229
|
+
/**
|
|
5230
|
+
* hover 显示的 icon 缓存
|
|
5231
|
+
*/
|
|
4559
5232
|
visibleActionIcons: GuiIcon[];
|
|
5233
|
+
/**
|
|
5234
|
+
* 上一次点击的单元格
|
|
5235
|
+
*/
|
|
4560
5236
|
lastClickedCell: S2CellType_2<ViewMeta_2> | null;
|
|
5237
|
+
/**
|
|
5238
|
+
* 初始化时的边界滚动配置
|
|
5239
|
+
*/
|
|
4561
5240
|
initOverscrollBehavior: InteractionOptions['overscrollBehavior'];
|
|
5241
|
+
/**
|
|
5242
|
+
* 排序方式
|
|
5243
|
+
*/
|
|
4562
5244
|
sortMethodMap: Record<string, SortMethod> | null;
|
|
4563
5245
|
[key: string]: unknown;
|
|
4564
5246
|
}
|
|
@@ -4575,7 +5257,7 @@ declare class TableColCell extends ColCell {
|
|
|
4575
5257
|
protected getColResizeArea(): Group | undefined;
|
|
4576
5258
|
protected isSortCell(): boolean;
|
|
4577
5259
|
protected showSortIcon(): boolean | undefined;
|
|
4578
|
-
protected getTextStyle(): TextTheme
|
|
5260
|
+
protected getTextStyle(): DeepRequired<TextTheme>;
|
|
4579
5261
|
protected getHorizontalResizeAreaName(): string;
|
|
4580
5262
|
protected drawBackgroundShape(): void;
|
|
4581
5263
|
protected handleViewport(viewport: AreaRange): AreaRange;
|
|
@@ -4587,15 +5269,14 @@ declare class TableCornerCell extends TableColCell {
|
|
|
4587
5269
|
}
|
|
4588
5270
|
|
|
4589
5271
|
declare class TableDataCell extends DataCell_2 {
|
|
4590
|
-
protected
|
|
4591
|
-
protected drawLinkFieldShape(): void;
|
|
5272
|
+
protected getLinkFieldStyle(): string;
|
|
4592
5273
|
drawBorders(): void;
|
|
4593
5274
|
protected shouldDrawResizeArea(): boolean;
|
|
4594
5275
|
drawResizeArea(): void;
|
|
4595
5276
|
}
|
|
4596
5277
|
|
|
4597
|
-
declare class
|
|
4598
|
-
get cellType():
|
|
5278
|
+
declare class TableSeriesNumberCell extends TableDataCell {
|
|
5279
|
+
get cellType(): CellType;
|
|
4599
5280
|
protected getTextStyle(): TextTheme;
|
|
4600
5281
|
}
|
|
4601
5282
|
|
|
@@ -4613,7 +5294,7 @@ rowCellMouseUp: (data: TargetCellInfo_2) => void;
|
|
|
4613
5294
|
rowCellMouseMove: (data: TargetCellInfo_2) => void;
|
|
4614
5295
|
rowCellCollapsed: (params: RowCellCollapsedParams_2) => void;
|
|
4615
5296
|
rowCellAllCollapsed: (isCollapsed: boolean) => void;
|
|
4616
|
-
rowCellScroll: (position:
|
|
5297
|
+
rowCellScroll: (position: Required<ScrollOffset_2>) => void;
|
|
4617
5298
|
colCellHover: (data: TargetCellInfo_2) => void;
|
|
4618
5299
|
colCellClick: (data: TargetCellInfo_2) => void;
|
|
4619
5300
|
colCellDoubleClick: (data: TargetCellInfo_2) => void;
|
|
@@ -4702,7 +5383,7 @@ linkFieldJump: (data: {
|
|
|
4702
5383
|
field: string;
|
|
4703
5384
|
record: RawData_2;
|
|
4704
5385
|
}) => void;
|
|
4705
|
-
scroll: (position:
|
|
5386
|
+
scroll: (position: Required<ScrollOffset_2>) => void;
|
|
4706
5387
|
layoutAfterRealDataCellRender: (options: {
|
|
4707
5388
|
add: [number, number][];
|
|
4708
5389
|
remove: [number, number][];
|
|
@@ -4721,7 +5402,7 @@ onRowCellMouseUp?: (data: TargetCellInfo_2) => any;
|
|
|
4721
5402
|
onRowCellMouseMove?: (data: TargetCellInfo_2) => any;
|
|
4722
5403
|
onRowCellCollapsed?: (params: RowCellCollapsedParams_2) => any;
|
|
4723
5404
|
onRowCellAllCollapsed?: (isCollapsed: boolean) => any;
|
|
4724
|
-
onRowCellScroll?: (position:
|
|
5405
|
+
onRowCellScroll?: (position: Required<ScrollOffset_2>) => any;
|
|
4725
5406
|
onColCellHover?: (data: TargetCellInfo_2) => any;
|
|
4726
5407
|
onColCellClick?: (data: TargetCellInfo_2) => any;
|
|
4727
5408
|
onColCellDoubleClick?: (data: TargetCellInfo_2) => any;
|
|
@@ -4810,7 +5491,7 @@ onLinkFieldJump?: (data: {
|
|
|
4810
5491
|
field: string;
|
|
4811
5492
|
record: RawData_2;
|
|
4812
5493
|
}) => any;
|
|
4813
|
-
onScroll?: (position:
|
|
5494
|
+
onScroll?: (position: Required<ScrollOffset_2>) => any;
|
|
4814
5495
|
onLayoutAfterRealDataCellRender?: (options: {
|
|
4815
5496
|
add: [number, number][];
|
|
4816
5497
|
remove: [number, number][];
|
|
@@ -4836,22 +5517,35 @@ declare interface TextAlignStyle {
|
|
|
4836
5517
|
|
|
4837
5518
|
declare type TextBaseline = 'top' | 'middle' | 'bottom';
|
|
4838
5519
|
|
|
5520
|
+
declare interface TextCondition extends Condition<TextTheme> {
|
|
5521
|
+
position?: IconPosition;
|
|
5522
|
+
}
|
|
5523
|
+
|
|
4839
5524
|
declare interface TextTheme extends TextAlignStyle {
|
|
5525
|
+
/** 字体 */
|
|
4840
5526
|
fontFamily?: string;
|
|
5527
|
+
/** 字体大小 */
|
|
4841
5528
|
fontSize?: number;
|
|
5529
|
+
/** 字体粗细 */
|
|
4842
5530
|
fontWeight?: number | 'normal' | 'bold' | 'bolder' | 'lighter';
|
|
5531
|
+
/** 字体颜色 */
|
|
4843
5532
|
fill?: string;
|
|
5533
|
+
/** 链接文本颜色 */
|
|
4844
5534
|
linkTextFill?: string;
|
|
5535
|
+
/** 字体透明度 */
|
|
4845
5536
|
opacity?: number;
|
|
4846
5537
|
}
|
|
4847
5538
|
|
|
4848
5539
|
declare interface ThemeCfg_2 {
|
|
5540
|
+
/** 主题 */
|
|
4849
5541
|
theme?: S2Theme;
|
|
5542
|
+
/** 色板 */
|
|
4850
5543
|
palette?: Pick<Palette, 'basicColors' | 'semanticColors' | 'others'>;
|
|
5544
|
+
/** 主题名 */
|
|
4851
5545
|
name?: ThemeName;
|
|
4852
5546
|
}
|
|
4853
5547
|
|
|
4854
|
-
declare type ThemeName =
|
|
5548
|
+
declare type ThemeName = keyof typeof PALETTE_MAP;
|
|
4855
5549
|
|
|
4856
5550
|
declare interface Tooltip<T = TooltipContentType_2, Icon = Element | string, Text = string> extends BaseTooltipConfig<T, Icon, Text> {
|
|
4857
5551
|
/**
|
|
@@ -4930,11 +5624,17 @@ declare type TooltipOperatorClickHandler = (params: {
|
|
|
4930
5624
|
}) => void;
|
|
4931
5625
|
|
|
4932
5626
|
declare interface TooltipOperatorMenu<Icon = Element | string, Text = string> {
|
|
5627
|
+
/** 唯一标识 */
|
|
4933
5628
|
key: string;
|
|
5629
|
+
/** 自定义 icon */
|
|
4934
5630
|
icon?: Icon;
|
|
5631
|
+
/** 名称 */
|
|
4935
5632
|
text?: Text;
|
|
5633
|
+
/** 点击回调 */
|
|
4936
5634
|
onClick?: (cell: S2CellType_2) => void;
|
|
5635
|
+
/** 是否显示 */
|
|
4937
5636
|
visible?: boolean | ((cell: S2CellType_2) => boolean);
|
|
5637
|
+
/** 子菜单 */
|
|
4938
5638
|
children?: TooltipOperatorMenu<Icon, Text>[];
|
|
4939
5639
|
}
|
|
4940
5640
|
|
|
@@ -4945,14 +5645,54 @@ declare interface TooltipOperatorOptions<Icon = Element | string, Text = string>
|
|
|
4945
5645
|
}
|
|
4946
5646
|
|
|
4947
5647
|
declare interface TooltipOptions<Icon = Element | string, Text = string> {
|
|
5648
|
+
/**
|
|
5649
|
+
* 是否隐藏汇总项
|
|
5650
|
+
* @example "数量(总和) 999"
|
|
5651
|
+
*/
|
|
4948
5652
|
hideSummary?: boolean;
|
|
5653
|
+
/**
|
|
5654
|
+
* 顶部操作项
|
|
5655
|
+
*/
|
|
4949
5656
|
operator?: TooltipOperatorOptions<Icon, Text>;
|
|
4950
|
-
|
|
5657
|
+
/**
|
|
5658
|
+
* 是否是小计/总计
|
|
5659
|
+
*/
|
|
4951
5660
|
isTotals?: boolean;
|
|
4952
|
-
|
|
4953
|
-
|
|
5661
|
+
/**
|
|
5662
|
+
* 只展示当前单元格文本 (不含汇总/行列头信息), 如果存在省略, 显示完整文本
|
|
5663
|
+
* 1. 用于单元格省略后 hover 显示完整文本
|
|
5664
|
+
* 2. 明细表 hover/click 显示当前单元格文本
|
|
5665
|
+
* 3. 自定义交互 hover/click 场景
|
|
5666
|
+
* @example
|
|
5667
|
+
s2.showTooltip({
|
|
5668
|
+
...
|
|
5669
|
+
options: { onlyShowCellText: true }
|
|
5670
|
+
})
|
|
5671
|
+
*/
|
|
5672
|
+
onlyShowCellText?: boolean;
|
|
5673
|
+
/**
|
|
5674
|
+
* 只展示顶部操作项菜单 (不含汇总/行列头/单元格信息)
|
|
5675
|
+
* 1. 用于排序场景
|
|
5676
|
+
* 2. 自定义交互
|
|
5677
|
+
* @example
|
|
5678
|
+
s2.showTooltip({
|
|
5679
|
+
...
|
|
5680
|
+
options: { onlyShowOperator: true }
|
|
5681
|
+
})
|
|
5682
|
+
*/
|
|
5683
|
+
onlyShowOperator?: boolean;
|
|
5684
|
+
/**
|
|
5685
|
+
* 是否格式化数据
|
|
5686
|
+
*/
|
|
4954
5687
|
enableFormat?: boolean;
|
|
5688
|
+
/**
|
|
5689
|
+
* 是否强制清空 dom
|
|
5690
|
+
*/
|
|
4955
5691
|
forceRender?: boolean;
|
|
5692
|
+
/**
|
|
5693
|
+
* 自定义数据
|
|
5694
|
+
*/
|
|
5695
|
+
data?: TooltipData;
|
|
4956
5696
|
}
|
|
4957
5697
|
|
|
4958
5698
|
declare type TooltipPosition = Point;
|
|
@@ -5021,6 +5761,11 @@ declare type TotalSelectionsOfMultiData = {
|
|
|
5021
5761
|
column?: TotalSelection;
|
|
5022
5762
|
};
|
|
5023
5763
|
|
|
5764
|
+
declare interface Transformer_2 {
|
|
5765
|
+
[CopyMIMEType.PLAIN]: MatrixPlainTransformer;
|
|
5766
|
+
[CopyMIMEType.HTML]: MatrixHTMLTransformer;
|
|
5767
|
+
}
|
|
5768
|
+
|
|
5024
5769
|
export declare const useExpose: (expose: (exposed?: Record<string, any>) => void) => ShallowRef<SheetExpose>;
|
|
5025
5770
|
|
|
5026
5771
|
declare const VALUE_FIELD = "$$value$$";
|