@antv/s2-vue 2.0.0-next.6 → 2.0.0-next.8

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/esm/index.d.ts CHANGED
@@ -1,11 +1,14 @@
1
1
  import { AllowedComponentProps } from 'vue';
2
2
  import { BaseTooltip } from '@antv/s2';
3
+ import { BaseTooltipOperatorMenuOptions } from '@antv/s2';
3
4
  import { Canvas } from '@antv/g';
4
- import { CellScrollPosition } from '@antv/s2';
5
+ import type { CanvasConfig } from '@antv/g';
6
+ import type { CellScrollPosition } from '@antv/s2';
5
7
  import { ComponentCustomProps } from 'vue';
6
8
  import { ComponentOptionsMixin } from 'vue';
7
9
  import { ComputedRef } from 'vue';
8
10
  import type * as CSS_2 from 'csstype';
11
+ import { CSSGlobalKeywords } from '@antv/g-lite/dist/css';
9
12
  import { DataCell } from '@antv/s2';
10
13
  import { DebouncedFunc } from 'lodash';
11
14
  import { DefineComponent } from 'vue';
@@ -16,8 +19,11 @@ import { ExtractPropTypes } from 'vue';
16
19
  import { FederatedPointerEvent } from '@antv/g';
17
20
  import { GEvent } from '@antv/s2';
18
21
  import { Group } from '@antv/g';
22
+ import { Group as Group_2 } from '@antv/g-lite';
23
+ import type { HeaderActionIcon } from '@antv/s2';
19
24
  import { HiddenColumnsInfo } from '@antv/s2';
20
25
  import { ICanvas } from '@antv/g';
26
+ import type { IEventTarget } from '@antv/g';
21
27
  import { Image as Image_2 } from '@antv/g';
22
28
  import { ImageStyleProps } from '@antv/g';
23
29
  import { LayoutResult } from '@antv/s2';
@@ -32,6 +38,7 @@ import { Polygon } from '@antv/g';
32
38
  import { PropType } from 'vue';
33
39
  import { RawData } from '@antv/s2';
34
40
  import { Rect } from '@antv/g';
41
+ import { Rectangle } from '@antv/g';
35
42
  import { Ref } from 'vue';
36
43
  import { ResizeInfo } from '@antv/s2';
37
44
  import { ResizeParams } from '@antv/s2';
@@ -41,6 +48,7 @@ import { S2DataConfig } from '@antv/s2';
41
48
  import { S2MountContainer } from '@antv/s2';
42
49
  import { S2Options } from '@antv/s2';
43
50
  import { S2RenderOptions } from '@antv/s2';
51
+ import { ScrollOffset } from '@antv/s2';
44
52
  import { ShallowRef } from 'vue';
45
53
  import { SortParams } from '@antv/s2';
46
54
  import { SpreadSheet } from '@antv/s2';
@@ -50,7 +58,6 @@ import { TextStyleProps } from '@antv/g';
50
58
  import { ThemeCfg } from '@antv/s2';
51
59
  import { Timer } from 'd3-timer';
52
60
  import { TooltipContentType } from '@antv/s2';
53
- import { ViewMeta } from '@antv/s2';
54
61
  import { ViewMetaData } from '@antv/s2';
55
62
  import { VNodeProps } from 'vue';
56
63
 
@@ -82,6 +89,7 @@ declare interface Background {
82
89
  color?: string;
83
90
  }
84
91
 
92
+ /** 柱状图样式配置 */
85
93
  declare interface BarTheme {
86
94
  intervalPadding?: number;
87
95
  fill?: string;
@@ -111,43 +119,23 @@ declare abstract class BaseBBox implements BBox {
111
119
  declare abstract class BaseCell<T extends SimpleBBox> extends Group {
112
120
  protected meta: T;
113
121
  protected spreadsheet: SpreadSheet_2;
114
- protected theme: S2Theme;
122
+ protected theme: InternalFullyTheme;
115
123
  protected backgroundShape: Rect | Polygon;
116
124
  protected textShape: CustomText;
117
125
  protected textShapes: CustomText[];
118
126
  protected linkFieldShape: Line;
119
127
  protected actualText: string;
120
- protected actualTextWidth: number;
128
+ protected originalText: string;
121
129
  protected conditions: Conditions;
122
130
  protected conditionIntervalShape: Rect | undefined;
123
131
  protected conditionIconShape: GuiIcon;
124
132
  protected conditionIconShapes: GuiIcon[];
133
+ protected groupedIcons: GroupedIcons;
125
134
  protected stateShapes: Map<StateShapeLayer, DisplayObject<any, any>>;
126
- constructor(meta: T, spreadsheet: SpreadSheet_2, ...restOptions: unknown[]);
127
- getMeta(): T;
128
- setMeta(viewMeta: T): void;
129
- getIconStyle(): IconTheme | undefined;
130
- getTextIconPosition(iconCount?: number): {
131
- text: {
132
- x: number;
133
- y: number;
134
- };
135
- icon: {
136
- x: number;
137
- y: number;
138
- };
139
- };
140
- getActualText(): string;
141
- getFieldValue(): string;
142
- /**
143
- * in case there are more params to be handled
144
- * @param options any type's rest params
145
- */
146
- protected handleRestOptions(...options: unknown[]): void;
147
135
  /**
148
136
  * Return the type of the cell
149
137
  */
150
- abstract get cellType(): CellTypes;
138
+ abstract get cellType(): CellType;
151
139
  /**
152
140
  * Determine how to render this cell area
153
141
  */
@@ -161,13 +149,67 @@ declare abstract class BaseCell<T extends SimpleBBox> extends Group {
161
149
  protected abstract getFormattedFieldValue(): FormatResult;
162
150
  protected abstract getMaxTextWidth(): number;
163
151
  protected abstract getTextPosition(): PointLike;
152
+ protected abstract getIconPosition(): PointLike;
164
153
  protected abstract findFieldCondition(conditions: Condition[] | undefined): Condition | undefined;
165
- protected abstract mappingValue(condition: Condition): MappingResult | undefined | null;
154
+ protected abstract mappingValue(condition: Condition): ConditionMappingResult | undefined | null;
155
+ constructor(meta: T, spreadsheet: SpreadSheet_2, ...restOptions: unknown[]);
156
+ /**
157
+ * in case there are more params to be handled
158
+ * @param options any type's rest params
159
+ */
160
+ protected handleRestOptions(...options: unknown[]): void;
161
+ getMeta(): T;
162
+ setMeta(viewMeta: T): void;
163
+ getIconStyle(): DeepRequired<IconTheme>;
164
+ /**
165
+ * 获取实际渲染的文本 (含省略号)
166
+ */
167
+ getActualText(): string;
168
+ /**
169
+ * 实际渲染的文本宽度, 如果是多行文本, 取最大的一行宽度
170
+ */
171
+ getActualTextWidth(): number;
172
+ /**
173
+ * 实际渲染的文本宽度, 如果是多行文本, 取每一行文本高度的总和)
174
+ * @alias getMultiLineActualTextHeight
175
+ */
176
+ getActualTextHeight(): number;
177
+ /**
178
+ * 获取实际渲染的多行文本 (含省略号)
179
+ */
180
+ getMultiLineActualTexts(): string[];
181
+ /**
182
+ * 实际渲染的多行文本宽度 (每一行文本宽度的总和)
183
+ */
184
+ getMultiLineActualTextWidth(): number;
185
+ /**
186
+ * 实际渲染的多行文本高度 (每一行文本高度的总和)
187
+ * @alias getActualTextHeight
188
+ */
189
+ getMultiLineActualTextHeight(): number;
190
+ /**
191
+ * 获取原始的文本 (不含省略号)
192
+ */
193
+ getOriginalText(): string;
194
+ /**
195
+ * 文本是否溢出 (有省略号)
196
+ */
197
+ isTextOverflowing(): boolean;
198
+ /**
199
+ * 是否是多行文本
200
+ */
201
+ isMultiLineText(): boolean;
202
+ getEmptyPlaceholder(): string | undefined;
203
+ /**
204
+ * 获取文本包围盒
205
+ */
206
+ getTextLineBoundingRects(): Rectangle[];
207
+ getFieldValue(): string;
166
208
  protected shouldInit(): boolean;
167
- getStyle<K extends keyof S2Theme = keyof CellThemes>(name?: K): DefaultCellTheme | S2Theme[K];
209
+ getStyle<K extends keyof InternalFullyTheme = CellType>(name?: K): InternalFullyTheme[K] | InternalFullyCellTheme;
168
210
  getLinkFieldShape(): Line;
169
211
  protected getResizeAreaStyle(): ResizeArea;
170
- protected shouldDrawResizeAreaByType(type: keyof ResizeInteractionOptions, cell: S2CellType_2): boolean | ((cell: S2CellType_2<ViewMeta_2>) => boolean) | ResizeType | ((resizeInfo: ResizeInfo_2) => boolean) | undefined;
212
+ protected shouldDrawResizeAreaByType(type: keyof ResizeInteractionOptions, cell: S2CellType_2): boolean | ResizeType | ((resizeInfo: ResizeInfo_2) => boolean) | ((cell: S2CellType_2) => boolean) | undefined;
171
213
  getBBoxByType(type?: CellClipBox): SimpleBBox;
172
214
  drawBorders(): void;
173
215
  /**
@@ -177,18 +219,19 @@ declare abstract class BaseCell<T extends SimpleBBox> extends Group {
177
219
  protected abstract getBackgroundColor(): {
178
220
  backgroundColor: string | undefined;
179
221
  backgroundColorOpacity: number | undefined;
222
+ intelligentReverseTextColor: boolean;
180
223
  };
181
224
  protected drawBackgroundShape(): void;
182
225
  /**
183
226
  * 交互使用的背景色
184
227
  */
185
228
  protected drawInteractiveBgShape(): void;
186
- protected getIconPosition(iconCount?: number): {
187
- x: number;
188
- y: number;
189
- };
190
- protected drawTextShape(): void;
229
+ renderTextShape(style: TextStyleProps, options?: RenderTextShapeOptions): CustomText;
230
+ updateTextPosition(position?: PointLike): void;
231
+ drawTextShape(options?: RenderTextShapeOptions): void;
191
232
  protected drawLinkFieldShape(showLinkFieldShape: boolean, linkFillColor: string): void;
233
+ protected getLinkFieldStyle(): string;
234
+ protected drawLinkField(meta: Node_2_2 | ViewMeta): void;
192
235
  updateByState(stateName: InteractionStateName, cell: S2CellType_2): void;
193
236
  protected getInteractiveBorderShapeStyle<T>(borderSize: T & number): {
194
237
  x: number;
@@ -207,7 +250,44 @@ declare abstract class BaseCell<T extends SimpleBBox> extends Group {
207
250
  resetTextAndConditionIconShapes(): void;
208
251
  get cellConditions(): Conditions;
209
252
  drawConditionIconShapes(): void;
210
- getTextConditionFill(textStyle: TextTheme): string | undefined;
253
+ getTextConditionMappingResult(): ConditionMappingResult | null | undefined;
254
+ getContainConditionMappingResultTextStyle(style: TextTheme | undefined): {
255
+ fill: string;
256
+ minValue?: number | undefined;
257
+ maxValue?: number | undefined;
258
+ icon?: string | undefined;
259
+ isCompare?: boolean | undefined;
260
+ intelligentReverseTextColor?: boolean | undefined;
261
+ fieldValue?: number | undefined;
262
+ fontSize?: number | undefined;
263
+ linkTextFill?: string | undefined;
264
+ textAlign?: TextAlign | undefined;
265
+ textBaseline?: TextBaseline | undefined;
266
+ opacity?: string | number | undefined;
267
+ fontFamily?: string | undefined;
268
+ fontWeight?: number | "bold" | CSSGlobalKeywords | "normal" | "bolder" | "lighter" | undefined;
269
+ wordWrap?: boolean | undefined;
270
+ maxLines?: number | undefined;
271
+ lineHeight?: string | number | undefined;
272
+ textOverflow?: string | undefined;
273
+ fontStyle?: CSSGlobalKeywords | "normal" | "italic" | "oblique" | undefined;
274
+ fontVariant?: string | undefined;
275
+ };
276
+ /**
277
+ * 获取默认字体颜色:根据字段标记背景颜色,设置字体颜色
278
+ * @param textStyle
279
+ * @private
280
+ */
281
+ protected getDefaultTextFill(textFill: string): string;
282
+ getBackgroundConditionFill(): {
283
+ backgroundColor: string | undefined;
284
+ intelligentReverseTextColor: boolean;
285
+ } | {
286
+ intelligentReverseTextColor: boolean;
287
+ backgroundColor?: undefined;
288
+ };
289
+ getIconConditionResult(): HeaderActionNameOptions | undefined;
290
+ protected getActionAndConditionIconWidth(position?: IconPosition): number;
211
291
  }
212
292
 
213
293
  declare interface BaseCellStyle {
@@ -269,15 +349,36 @@ declare interface BaseDataSet {
269
349
  }
270
350
 
271
351
  declare abstract class BaseDataSet_2 {
352
+ /**
353
+ * 字段信息
354
+ */
272
355
  fields: Fields;
356
+ /**
357
+ * 字段元信息,包含有字段名、格式化、描述等
358
+ */
273
359
  meta: Meta[];
360
+ /**
361
+ * 原始数据
362
+ */
274
363
  originData: RawData_2[];
364
+ /**
365
+ * 二维索引数据
366
+ */
275
367
  indexesData: RawData_2[][] | RawData_2[];
368
+ /**
369
+ * 高级排序, 组内排序
370
+ */
276
371
  sortParams: SortParams_2 | undefined;
372
+ /**
373
+ * 筛选配置
374
+ */
277
375
  filterParams: FilterParam[] | undefined;
376
+ /**
377
+ * 表格实例
378
+ */
278
379
  protected spreadsheet: SpreadSheet_2;
279
- constructor(spreadsheet: SpreadSheet_2);
280
380
  protected displayData: RawData_2[];
381
+ constructor(spreadsheet: SpreadSheet_2);
281
382
  private getField;
282
383
  /**
283
384
  * 获取字段信息
@@ -292,12 +393,12 @@ declare abstract class BaseDataSet_2 {
292
393
  * 获取自定义单元格字段名称
293
394
  * @param cell
294
395
  */
295
- getCustomRowFieldName(cell: S2CellType_2<ViewMeta_2 | Node_2_2>): string | undefined;
396
+ getCustomRowFieldName(cell: S2CellType_2<ViewMeta | Node_2_2>): string | undefined;
296
397
  /**
297
398
  * 获取自定义单元格字段描述
298
399
  * @param cell
299
400
  */
300
- getCustomFieldDescription: (cell: S2CellType_2<ViewMeta_2 | Node_2_2>) => string | undefined;
401
+ getCustomFieldDescription: (cell: S2CellType_2<ViewMeta | Node_2_2>) => string | undefined;
301
402
  /**
302
403
  * 获得字段格式方法
303
404
  * @param field
@@ -308,7 +409,15 @@ declare abstract class BaseDataSet_2 {
308
409
  * @param field
309
410
  */
310
411
  getFieldDescription(field: CustomHeaderField): string | undefined;
412
+ /**
413
+ * 设置数据配置
414
+ * @param dataCfg
415
+ */
311
416
  setDataCfg(dataCfg: S2DataConfig_2): void;
417
+ /**
418
+ * 添加 (角头/数值虚拟字段) 格式化信息
419
+ */
420
+ getFieldMetaWithExtraField(meta: Meta[] | undefined, defaultExtraFieldText: string): Meta[];
312
421
  getDisplayDataSet(): RawData_2[];
313
422
  getValueRangeByField(field: string): ValueRange;
314
423
  /** ******************NEED IMPLEMENT BY USER CASE************************ */
@@ -318,6 +427,7 @@ declare abstract class BaseDataSet_2 {
318
427
  */
319
428
  abstract processDataCfg(dataCfg: S2DataConfig_2): S2DataConfig_2;
320
429
  /**
430
+ * 获取指定字段下的维值
321
431
  * 1、query !== null
322
432
  * province city => field
323
433
  * 辽宁省
@@ -331,30 +441,28 @@ declare abstract class BaseDataSet_2 {
331
441
  * query param is not necessary, when just
332
442
  * get some field's all dimension values
333
443
  *
334
- * @param field current dimensions
335
- * @param query dimension value query
444
+ * @param field
445
+ * @param query
336
446
  */
337
447
  abstract getDimensionValues(field: string, query?: Query): string[];
338
448
  /**
339
- * In most cases, this function to get the specific
340
- * cross data cell data
341
- * @param params
449
+ * 获取单个的单元格数据
342
450
  */
343
- abstract getCellData(params: CellDataParams): ViewMetaData_2 | undefined;
451
+ abstract getCellData(params: GetCellDataParams): ViewMetaData_2 | undefined;
344
452
  /**
345
- * To get a row or column cells data;
346
- * if query is empty, return all data
347
- * @param query
348
- * @param totals @TotalSelectionsOfMultiData
349
- * @param drillDownFields
453
+ * 获取批量的单元格数据
454
+ * 如果 query 为空, 则返回全量数据
455
+ */
456
+ abstract getCellMultiData(params: GetCellMultiDataParams): ViewMetaData_2[];
457
+ /**
458
+ * 是否超过 1 个数值
350
459
  */
351
- abstract getMultiData(query: Query, totals?: TotalSelectionsOfMultiData, drillDownFields?: string[]): Data[] | CellData[];
352
460
  moreThanOneValue(): boolean;
353
461
  /**
354
462
  * get a row cells data including cell
355
- * @param cells
463
+ * @param cellMeta
356
464
  */
357
- abstract getRowData(cells: CellMeta): RowData;
465
+ abstract getRowData(cellMeta: CellMeta): RowData;
358
466
  }
359
467
 
360
468
  declare interface BaseDrillDownComponentProps<DataSet = BaseDataSet> {
@@ -393,7 +501,11 @@ declare abstract class BaseFacet {
393
501
  frozenTopGroup: FrozenGroup;
394
502
  frozenBottomGroup: FrozenGroup;
395
503
  foregroundGroup: Group;
396
- layoutResult: LayoutResult_2;
504
+ /**
505
+ * 当前布局节点信息
506
+ * @description 内部消费, 外部调用请使用 facet.getLayoutResult()
507
+ */
508
+ private layoutResult;
397
509
  viewCellWidths: number[];
398
510
  viewCellHeights: ViewCellHeights;
399
511
  protected mobileWheel: WheelEvent_2;
@@ -408,12 +520,15 @@ declare abstract class BaseFacet {
408
520
  centerFrame: Frame;
409
521
  gridInfo: GridInfo;
410
522
  protected abstract doLayout(): LayoutResult_2;
411
- abstract getViewCellHeights(layoutResult: LayoutResult_2): ViewCellHeights;
523
+ abstract getViewCellHeights(): ViewCellHeights;
524
+ abstract getCellMeta(rowIndex: number, colIndex: number): ViewMeta | null;
525
+ protected abstract getColNodeHeight(colNode: Node_2_2, colsHierarchy: Hierarchy): number;
412
526
  protected scrollFrameId: ReturnType<typeof requestAnimationFrame> | null;
413
- get scrollBarTheme(): ScrollBarTheme | undefined;
527
+ get scrollBarTheme(): DeepRequired<ScrollBarTheme>;
414
528
  get scrollBarSize(): number;
415
529
  protected preCellIndexes: PanelIndexes | null;
416
530
  constructor(spreadsheet: SpreadSheet_2);
531
+ getLayoutResult: () => LayoutResult_2;
417
532
  protected initGroups(): void;
418
533
  protected initPanelGroups(): void;
419
534
  protected getCellCustomSize(node: Node_2_2 | null, size: CellCustomSize): number | null | undefined;
@@ -422,7 +537,12 @@ declare abstract class BaseFacet {
422
537
  protected getRowCellHeight(node: Node_2_2): number;
423
538
  protected getColCellDraggedWidth(node: Node_2_2): number | undefined;
424
539
  protected getColCellDraggedHeight(node: Node_2_2): number | undefined;
425
- protected getDefaultColNodeHeight(colNode: Node_2_2): number;
540
+ protected getDefaultColNodeHeight(colNode: Node_2_2, colsHierarchy: Hierarchy): number;
541
+ protected getCellAdaptiveHeight(cell: HeaderCell, defaultHeight: number): number;
542
+ /**
543
+ * 将每一层级的采样节点更新为高度最大的节点 (未隐藏, 非汇总节点)
544
+ */
545
+ protected updateColsHierarchySampleMaxHeightNodes(colsHierarchy: Hierarchy): void;
426
546
  hideScrollBar: () => void;
427
547
  delayHideScrollBar: DebouncedFunc<() => void>;
428
548
  delayHideScrollbarOnMobile: () => void;
@@ -453,8 +573,8 @@ declare abstract class BaseFacet {
453
573
  updateScrollOffset(offsetConfig: OffsetConfig): void;
454
574
  getPaginationScrollY(): number;
455
575
  destroy(): void;
456
- setScrollOffset: (scrollOffset: ScrollOffset) => void;
457
- getScrollOffset: () => Required<ScrollOffset>;
576
+ setScrollOffset: (scrollOffset: ScrollOffset_2) => void;
577
+ getScrollOffset: () => Required<ScrollOffset_2>;
458
578
  resetScrollX: () => void;
459
579
  resetRowScrollX: () => void;
460
580
  resetScrollY: () => void;
@@ -484,12 +604,12 @@ declare abstract class BaseFacet {
484
604
  scrollImmediately: (offsetConfig?: OffsetConfig) => void;
485
605
  /**
486
606
  *
487
- * @param skipScrollEvent 如为true则不触发S2Event.GLOBAL_SCROLL
607
+ * @param skipScrollEvent 不触发 S2Event.GLOBAL_SCROLL
488
608
  */
489
609
  startScroll: (skipScrollEvent?: boolean) => void;
490
- getRendererHeight: () => number;
610
+ private getRendererHeight;
491
611
  private getAdjustedScrollOffset;
492
- renderRowScrollBar: (rowScrollX: number) => void;
612
+ private renderRowScrollBar;
493
613
  getValidScrollBarOffset: (offset: number, maxOffset: number) => number;
494
614
  renderHScrollBar: (width: number, realWidth: number, scrollX: number) => void;
495
615
  private getScrollbarPosition;
@@ -516,21 +636,12 @@ declare abstract class BaseFacet {
516
636
  cancelScrollFrame: () => boolean;
517
637
  clearScrollFrameIdOnMobile: () => void;
518
638
  /**
519
- *<<<<<<< HEAD
520
- *https://developer.mozilla.org/zh-CN/docs/Web/CSS/overscroll-behavior
521
- *阻止外部容器滚动: 表格是虚拟滚动, 这里按照标准模拟浏览器的 [overscroll-behavior] 实现
522
- *1. auto => 只有在滚动到表格顶部或底部时才触发外部容器滚动
523
- *1. contain => 默认的滚动边界行为不变(“触底”效果或者刷新),但是临近的滚动区域不会被滚动链影响到
524
- *2. none => 临近滚动区域不受到滚动链影响,而且默认的滚动到边界的表现也被阻止
525
- *所以只要不为 `auto`, 或者表格内, 都需要阻止外部容器滚动
526
- *=======
527
- *https://developer.mozilla.org/zh-CN/docs/Web/CSS/overscroll-behavior
528
- *阻止外部容器滚动: 表格是虚拟滚动, 这里按照标准模拟浏览器的 [overscroll-behavior] 实现
529
- *1. auto => 只有在滚动到表格顶部或底部时才触发外部容器滚动
530
- *1. contain => 默认的滚动边界行为不变(“触底”效果或者刷新),但是临近的滚动区域不会被滚动链影响到
531
- *2. none => 临近滚动区域不受到滚动链影响,而且默认的滚动到边界的表现也被阻止
532
- *所以只要不为 `auto`, 或者表格内, 都需要阻止外部容器滚动
533
- *>>>>>>> next
639
+ * https://developer.mozilla.org/zh-CN/docs/Web/CSS/overscroll-behavior
640
+ * 阻止外部容器滚动: 表格是虚拟滚动, 这里按照标准模拟浏览器的 [overscroll-behavior] 实现
641
+ * 1. auto => 只有在滚动到表格顶部或底部时才触发外部容器滚动
642
+ * 1. contain => 默认的滚动边界行为不变(“触底”效果或者刷新),但是临近的滚动区域不会被滚动链影响到
643
+ * 2. none => 临近滚动区域不受到滚动链影响,而且默认的滚动到边界的表现也被阻止
644
+ * 所以只要不为 `auto`, 或者表格内, 都需要阻止外部容器滚动
534
645
  */
535
646
  private stopScrollChainingIfNeeded;
536
647
  private stopScrollChaining;
@@ -544,7 +655,7 @@ declare abstract class BaseFacet {
544
655
  * @protected
545
656
  */
546
657
  protected translateRelatedGroups(scrollX: number, scrollY: number, hRowScroll: number): void;
547
- addCell: (cell: S2CellType_2<ViewMeta_2>) => void;
658
+ addCell: (cell: S2CellType_2<ViewMeta>) => void;
548
659
  realCellRender: (scrollX: number, scrollY: number) => void;
549
660
  protected init(): void;
550
661
  protected renderBackground(): void;
@@ -586,7 +697,7 @@ declare abstract class BaseFacet {
586
697
  protected onAfterScroll: DebouncedFunc<() => void>;
587
698
  protected saveInitColumnLeafNodes(columnNodes?: Node_2_2[]): void;
588
699
  getHiddenColumnsInfo(columnNode: Node_2_2): HiddenColumnsInfo_2 | undefined;
589
- getCornerNodes(): Node_2_2[];
700
+ updateCustomFieldsSampleNodes(colsHierarchy: Hierarchy): void;
590
701
  /**
591
702
  * @description 自定义行头时, 叶子节点层级不定, 需要自动对齐其宽度, 填充空白
592
703
  * -------------------------------------------------
@@ -608,12 +719,193 @@ declare abstract class BaseFacet {
608
719
  */
609
720
  adjustColLeafNodesHeight(params: AdjustLeafNodesParams): void;
610
721
  adjustLeafNodesSize(type: 'width' | 'height'): ({ leafNodes, hierarchy }: AdjustLeafNodesParams) => void;
722
+ /**
723
+ * 获取表头节点 (角头,序号, 行头,列头) (含可视区域)
724
+ * @example 获取全部: facet.getHeaderNodes()
725
+ * @example 获取一组 facet.getHeaderNodes(['root[&]浙江省[&]宁波市', 'root[&]浙江省[&]杭州市'])
726
+ */
727
+ getHeaderNodes(nodeIds?: string[]): Node_2_2[];
728
+ /**
729
+ * 获取角头节点
730
+ */
731
+ getCornerNodes(): Node_2_2[];
732
+ /**
733
+ * 获取序号节点
734
+ */
735
+ getSeriesNumberNodes(): Node_2_2[];
736
+ /**
737
+ * 获取列头节点 (含非可视区域)
738
+ * @description 获取列头单元格 (可视区域内) facet.getColCells()
739
+ * @example 获取全部: facet.getColNodes()
740
+ * @example 指定层级: facet.getColNodes(level)
741
+ */
742
+ getColNodes(level?: number): Node_2_2[];
743
+ /**
744
+ * 根据 id 获取指定列头节点
745
+ * @example facet.getColNodeById('root[&]节点1[&]数值')
746
+ */
747
+ getColNodeById(nodeId: string): Node_2_2 | undefined;
748
+ /**
749
+ * 根据列头索引获取指定列头节点
750
+ * @example facet.getColNodeByIndex(colIndex)
751
+ */
752
+ getColNodeByIndex(colIndex: number): Node_2_2 | undefined;
753
+ /**
754
+ * 根据列头索引获取指定列头叶子节点
755
+ * @example facet.getColLeafNodes(colIndex)
756
+ */
757
+ getColLeafNodeByIndex(colIndex: number): Node_2_2 | undefined;
758
+ /**
759
+ * 根据 field 获取指定列头节点
760
+ * @example facet.getColCellNodeByField('number')
761
+ */
762
+ getColNodesByField(nodeField: string): Node_2_2[];
763
+ /**
764
+ * 获取列头叶子节点节点 (含非可视区域)
765
+ */
766
+ getColLeafNodes(): Node_2_2[];
767
+ /**
768
+ * 获取列头小计/总计节点 (含非可视区域)
769
+ * @example 获取全部: facet.getColTotalsNodes()
770
+ * @example 指定层级: facet.getColTotalsNodes(level)
771
+ */
772
+ getColTotalsNodes(level?: number): Node_2_2[];
773
+ /**
774
+ * 获取列头小计节点 (含非可视区域)
775
+ * @example 获取全部: facet.getColSubTotalsNodes()
776
+ * @example 指定层级: facet.getColSubTotalsNodes(level)
777
+ */
778
+ getColSubTotalsNodes(level?: number): Node_2_2[];
779
+ /**
780
+ * 获取列头总计节点 (含非可视区域)
781
+ * @example 获取全部: facet.getColGrandTotalsNodes()
782
+ * @example 指定层级: facet.getColGrandTotalsNodes(level)
783
+ */
784
+ getColGrandTotalsNodes(level?: number): Node_2_2[];
785
+ /**
786
+ * 获取行头节点 (含非可视区域)
787
+ * @description 获取行头单元格 (可视区域内) facet.getRowCells()
788
+ * @example 获取全部: facet.getRowNodes()
789
+ * @example 指定层级: facet.getRowNodes(level)
790
+ */
791
+ getRowNodes(level?: number): Node_2_2[];
792
+ /**
793
+ * 根据 id 获取单个行头节点
794
+ * @example facet.getRowNodeById('root[&]节点1[&]数值')
795
+ */
796
+ getRowNodeById(nodeId: string): Node_2_2 | undefined;
797
+ /**
798
+ * 根据行头索引获取指定列头节点
799
+ * @example facet.getRowNodeByIndex(rowIndex)
800
+ */
801
+ getRowNodeByIndex(rowIndex: number): Node_2_2 | undefined;
802
+ /**
803
+ * 根据行头索引获取指定列头叶子节点
804
+ * @example facet.getRowLeafNodeByIndex(rowIndex)
805
+ */
806
+ getRowLeafNodeByIndex(rowIndex: number): Node_2_2 | undefined;
807
+ /**
808
+ * 根据 field 获取行头节点
809
+ * @example facet.getRowNodeByField('number')
810
+ */
811
+ getRowNodesByField(nodeField: string): Node_2_2[];
812
+ /**
813
+ * 获取行头叶子节点节点 (含非可视区域)
814
+ */
815
+ getRowLeafNodes(): Node_2_2[];
816
+ /**
817
+ * 获取行头小计/总计节点 (含非可视区域)
818
+ * @example 获取全部: facet.getRowTotalsNodes()
819
+ * @example 指定层级: facet.getRowTotalsNodes(level)
820
+ */
821
+ getRowTotalsNodes(level?: number): Node_2_2[];
822
+ /**
823
+ * 获取行头小计节点 (含非可视区域)
824
+ * @example 获取全部: facet.getRowSubTotalsNodes()
825
+ * @example 指定层级: facet.getRowSubTotalsNodes(level)
826
+ */
827
+ getRowSubTotalsNodes(level?: number): Node_2_2[];
828
+ /**
829
+ * 获取行头总计节点 (含非可视区域)
830
+ * @example 获取全部: facet.getRowGrandTotalsNodes()
831
+ * @example 指定层级: facet.getRowGrandTotalsNodes(level)
832
+ */
833
+ getRowGrandTotalsNodes(level?: number): Node_2_2[];
834
+ /**
835
+ * 获取单元格的所有子节点 (含非可视区域)
836
+ * @example
837
+ * const rowCell = facet.getRowCells()[0]
838
+ * facet.getCellChildrenNodes(rowCell)
839
+ */
840
+ getCellChildrenNodes: (cell: S2CellType_2) => Node_2_2[];
841
+ /**
842
+ * 获取数值单元格 (不含可视区域)
843
+ * @description 由于虚拟滚动, 按需加载的特性, 非可视区域的单元格未被实例化
844
+ * @example 获取非可视区域的数值节点 facet.getCellMeta(rowIndex, colIndex)
845
+ */
846
+ getDataCells(): DataCell_2[];
847
+ /**
848
+ * 获取行头单元格 (不含可视区域)
849
+ */
850
+ getRowCells(): RowCell[];
851
+ /**
852
+ * 获取行头叶子节点单元格 (不含可视区域)
853
+ */
854
+ getRowLeafCells(): RowCell[];
855
+ /**
856
+ * 获取列头单元格 (不含可视区域)
857
+ */
858
+ getColCells(): ColCell[];
859
+ /**
860
+ * 获取列头叶子节点单元格 (不含可视区域)
861
+ */
862
+ getColLeafCells(): ColCell[];
863
+ /**
864
+ * 获取合并单元格 (不含可视区域)
865
+ */
866
+ getMergedCells(): MergedCell[];
867
+ /**
868
+ * 获取角头单元格
869
+ */
870
+ getCornerCells(): CornerCell[];
871
+ /**
872
+ * 获取序号单元格
873
+ */
874
+ abstract getSeriesNumberCells(): SeriesNumberCell[] | TableSeriesNumberCell[];
875
+ /**
876
+ * 获取表头单元格 (角头,行头,列头) (不含可视区域)
877
+ * @example 获取全部: facet.getHeaderCells()
878
+ * @example 获取一组 facet.getHeaderCells(['root[&]浙江省[&]宁波市', 'root[&]浙江省[&]杭州市'])
879
+ */
880
+ getHeaderCells(cellIds?: string[]): S2CellType_2<ViewMeta>[];
881
+ /**
882
+ * 根据单元格 id 获取指定单元格 (不含可视区域)
883
+ * @example facet.getCellById('root[&]浙江省[&]宁波市')
884
+ */
885
+ getCellById(cellId: string): S2CellType_2<ViewMeta> | undefined;
886
+ /**
887
+ * 根据单元格 field 获取指定单元格 (不含可视区域)
888
+ * @example facet.getCellByField('city')
889
+ */
890
+ getCellsByField(cellField: string): S2CellType_2<ViewMeta>[];
891
+ /**
892
+ * 获取所有单元格 (角头,行头,列头,数值) (不含可视区域)
893
+ * @example 获取全部: facet.getCells()
894
+ * @example 获取一组 facet.getCells(['root[&]浙江省[&]宁波市', 'root[&]浙江省[&]杭州市'])
895
+ */
896
+ getCells(cellIds?: string[]): S2CellType_2<ViewMeta>[];
897
+ getInitColLeafNodes(): Node_2_2[];
898
+ clearInitColLeafNodes(): void;
611
899
  }
612
900
 
613
901
  declare interface BaseFields {
902
+ /** 行头字段 */
614
903
  rows?: CustomHeaderFields;
904
+ /** 列头字段 */
615
905
  columns?: CustomHeaderFields;
906
+ /** 数值字段 */
616
907
  values?: string[];
908
+ /** 数值是否置于列头 (透视表有效) */
617
909
  valueInCols?: boolean;
618
910
  }
619
911
 
@@ -623,8 +915,12 @@ declare interface BaseFields {
623
915
  * use {@see headerConfig} instead
624
916
  */
625
917
  declare abstract class BaseHeader<T extends BaseHeaderConfig> extends Group {
918
+ protected abstract layout(): void;
919
+ protected abstract offset(): void;
920
+ protected abstract clip(): void;
921
+ protected abstract getCellInstance(node: Node_2_2): S2CellType_2;
626
922
  protected headerConfig: T;
627
- protected constructor(cfg: T);
923
+ protected constructor(config: T);
628
924
  getHeaderConfig(): T;
629
925
  /**
630
926
  * 清空热区,为重绘做准备,防止热区重复渲染
@@ -641,13 +937,10 @@ declare abstract class BaseHeader<T extends BaseHeaderConfig> extends Group {
641
937
  onScrollXY(scrollX: number, scrollY: number, type: string): void;
642
938
  /**
643
939
  * Only call when hRowScrollBar scrolls
644
- * @param rowScrollX hRowScrollbar horizontal offset
940
+ * @param rowHeaderScrollX hRowScrollbar horizontal offset
645
941
  * @param type
646
942
  */
647
- onRowScrollX(rowScrollX: number, type: string): void;
648
- protected abstract layout(): void;
649
- protected abstract offset(): void;
650
- protected abstract clip(): void;
943
+ onRowScrollX(rowHeaderScrollX: number, type: string): void;
651
944
  clear(): void;
652
945
  /**
653
946
  * Check whether header cell in viewPort
@@ -733,14 +1026,14 @@ loading: BooleanConstructor;
733
1026
  partDrillDown: ObjectConstructor;
734
1027
  header: ObjectConstructor;
735
1028
  options: {
736
- type: PropType<S2Options<TooltipContentType, Pagination, string | Element, string>>;
737
- default: S2Options<TooltipContentType, Pagination, string | Element, string>;
1029
+ type: PropType<S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>>;
1030
+ default: S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>;
738
1031
  };
739
1032
  adaptive: {
740
1033
  type: PropType<Adaptive>;
741
1034
  default: Adaptive;
742
1035
  };
743
- onSpreadsheet: PropType<(container: S2MountContainer, dataCfg: S2DataConfig, options: S2Options<TooltipContentType, Pagination, string | Element, string>) => SpreadSheet>;
1036
+ onSpreadsheet: PropType<(container: S2MountContainer, dataCfg: S2DataConfig, options: S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>) => SpreadSheet>;
744
1037
  onMounted: PropType<(spreadsheet: SpreadSheet) => void>;
745
1038
  }, {
746
1039
  S2_PREFIX_CLS: string;
@@ -759,7 +1052,7 @@ showSizeChange: (nextPageSize: number) => void;
759
1052
  handlePageChange: (nextCurrent: number) => void;
760
1053
  handlePageSizeChange: (nextSize: number) => void;
761
1054
  }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
762
- spreadsheet: (container: S2MountContainer, dataCfg: S2DataConfig, options: S2Options<TooltipContentType, Pagination, string | Element, string>) => SpreadSheet;
1055
+ spreadsheet: (container: S2MountContainer, dataCfg: S2DataConfig, options: S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>) => SpreadSheet;
763
1056
  sheetUpdate: SheetUpdateCallback;
764
1057
  rowCellHover: (data: TargetCellInfo) => void;
765
1058
  rowCellClick: (data: TargetCellInfo) => void;
@@ -770,7 +1063,7 @@ rowCellMouseUp: (data: TargetCellInfo) => void;
770
1063
  rowCellMouseMove: (data: TargetCellInfo) => void;
771
1064
  rowCellCollapsed: (params: RowCellCollapsedParams) => void;
772
1065
  rowCellAllCollapsed: (isCollapsed: boolean) => void;
773
- rowCellScroll: (position: CellScrollPosition) => void;
1066
+ rowCellScroll: (position: Required<ScrollOffset>) => void;
774
1067
  colCellHover: (data: TargetCellInfo) => void;
775
1068
  colCellClick: (data: TargetCellInfo) => void;
776
1069
  colCellDoubleClick: (data: TargetCellInfo) => void;
@@ -791,7 +1084,7 @@ dataCellMouseDown: (data: TargetCellInfo) => void;
791
1084
  dataCellMouseUp: (data: TargetCellInfo) => void;
792
1085
  dataCellMouseMove: (data: TargetCellInfo) => void;
793
1086
  dataCellBrushSelection: (brushRangeDataCells: DataCell[]) => void;
794
- dataCellSelectMove: (metas: ViewMetaData[]) => void;
1087
+ dataCellSelectMove: (metaList: ViewMetaData[]) => void;
795
1088
  cornerCellHover: (data: TargetCellInfo) => void;
796
1089
  cornerCellClick: (data: TargetCellInfo) => void;
797
1090
  cornerCellDoubleClick: (data: TargetCellInfo) => void;
@@ -815,7 +1108,7 @@ filteredValues: string[];
815
1108
  rangeFiltered: (data: ViewMetaData[]) => void;
816
1109
  layoutAfterHeaderLayout: (layoutResult: LayoutResult) => void;
817
1110
  layoutPagination: (data: LayoutPaginationParams) => void;
818
- layoutCellMounted: (cell: S2CellType<ViewMeta>) => void;
1111
+ layoutCellMounted: (cell: S2CellType) => void;
819
1112
  beforeRender: () => void;
820
1113
  afterRender: () => void;
821
1114
  mounted: (spreadsheet: SpreadSheet) => void;
@@ -853,13 +1146,13 @@ mouseHover: (event: GEvent) => void;
853
1146
  mouseUp: (event: MouseEvent) => void;
854
1147
  mouseDown: (event: MouseEvent) => void;
855
1148
  mouseMove: (event: MouseEvent) => void;
856
- selected: (cells: S2CellType<ViewMeta>[]) => void;
1149
+ selected: (cells: S2CellType[]) => void;
857
1150
  reset: (event: KeyboardEvent) => void;
858
1151
  linkFieldJump: (data: {
859
1152
  field: string;
860
1153
  record: RawData;
861
1154
  }) => void;
862
- scroll: (position: CellScrollPosition) => void;
1155
+ scroll: (position: Required<ScrollOffset>) => void;
863
1156
  layoutAfterRealDataCellRender: (options: {
864
1157
  add: [number, number][];
865
1158
  remove: [number, number][];
@@ -885,14 +1178,14 @@ loading: BooleanConstructor;
885
1178
  partDrillDown: ObjectConstructor;
886
1179
  header: ObjectConstructor;
887
1180
  options: {
888
- type: PropType<S2Options<TooltipContentType, Pagination, string | Element, string>>;
889
- default: S2Options<TooltipContentType, Pagination, string | Element, string>;
1181
+ type: PropType<S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>>;
1182
+ default: S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>;
890
1183
  };
891
1184
  adaptive: {
892
1185
  type: PropType<Adaptive>;
893
1186
  default: Adaptive;
894
1187
  };
895
- onSpreadsheet: PropType<(container: S2MountContainer, dataCfg: S2DataConfig, options: S2Options<TooltipContentType, Pagination, string | Element, string>) => SpreadSheet>;
1188
+ onSpreadsheet: PropType<(container: S2MountContainer, dataCfg: S2DataConfig, options: S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>) => SpreadSheet>;
896
1189
  onMounted: PropType<(spreadsheet: SpreadSheet) => void>;
897
1190
  }>> & {
898
1191
  onSheetUpdate?: (params: S2RenderOptions) => any;
@@ -905,7 +1198,7 @@ onRowCellMouseUp?: (data: TargetCellInfo) => any;
905
1198
  onRowCellMouseMove?: (data: TargetCellInfo) => any;
906
1199
  onRowCellCollapsed?: (params: RowCellCollapsedParams) => any;
907
1200
  onRowCellAllCollapsed?: (isCollapsed: boolean) => any;
908
- onRowCellScroll?: (position: CellScrollPosition) => any;
1201
+ onRowCellScroll?: (position: Required<ScrollOffset>) => any;
909
1202
  onColCellHover?: (data: TargetCellInfo) => any;
910
1203
  onColCellClick?: (data: TargetCellInfo) => any;
911
1204
  onColCellDoubleClick?: (data: TargetCellInfo) => any;
@@ -926,7 +1219,7 @@ onDataCellMouseDown?: (data: TargetCellInfo) => any;
926
1219
  onDataCellMouseUp?: (data: TargetCellInfo) => any;
927
1220
  onDataCellMouseMove?: (data: TargetCellInfo) => any;
928
1221
  onDataCellBrushSelection?: (brushRangeDataCells: DataCell[]) => any;
929
- onDataCellSelectMove?: (metas: ViewMetaData[]) => any;
1222
+ onDataCellSelectMove?: (metaList: ViewMetaData[]) => any;
930
1223
  onCornerCellHover?: (data: TargetCellInfo) => any;
931
1224
  onCornerCellClick?: (data: TargetCellInfo) => any;
932
1225
  onCornerCellDoubleClick?: (data: TargetCellInfo) => any;
@@ -950,7 +1243,7 @@ filteredValues: string[];
950
1243
  onRangeFiltered?: (data: ViewMetaData[]) => any;
951
1244
  onLayoutAfterHeaderLayout?: (layoutResult: LayoutResult) => any;
952
1245
  onLayoutPagination?: (data: LayoutPaginationParams) => any;
953
- onLayoutCellMounted?: (cell: S2CellType<ViewMeta>) => any;
1246
+ onLayoutCellMounted?: (cell: S2CellType) => any;
954
1247
  onBeforeRender?: () => any;
955
1248
  onAfterRender?: () => any;
956
1249
  onMounted?: (spreadsheet: SpreadSheet) => any;
@@ -988,13 +1281,13 @@ onMouseHover?: (event: GEvent) => any;
988
1281
  onMouseUp?: (event: MouseEvent) => any;
989
1282
  onMouseDown?: (event: MouseEvent) => any;
990
1283
  onMouseMove?: (event: MouseEvent) => any;
991
- onSelected?: (cells: S2CellType<ViewMeta>[]) => any;
1284
+ onSelected?: (cells: S2CellType[]) => any;
992
1285
  onReset?: (event: KeyboardEvent) => any;
993
1286
  onLinkFieldJump?: (data: {
994
1287
  field: string;
995
1288
  record: RawData;
996
1289
  }) => any;
997
- onScroll?: (position: CellScrollPosition) => any;
1290
+ onScroll?: (position: Required<ScrollOffset>) => any;
998
1291
  onLayoutAfterRealDataCellRender?: (options: {
999
1292
  add: [number, number][];
1000
1293
  remove: [number, number][];
@@ -1002,9 +1295,9 @@ spreadsheet: SpreadSheet;
1002
1295
  }) => any;
1003
1296
  onRowCellBrushSelection?: (event: GEvent) => any;
1004
1297
  onColCellBrushSelection?: (event: GEvent) => any;
1005
- onSpreadsheet?: (container: S2MountContainer, dataCfg: S2DataConfig, options: S2Options<TooltipContentType, Pagination, string | Element, string>) => any;
1298
+ onSpreadsheet?: (container: S2MountContainer, dataCfg: S2DataConfig, options: S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>) => any;
1006
1299
  }, {
1007
- options: S2Options<TooltipContentType, Pagination, string | Element, string>;
1300
+ options: S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>;
1008
1301
  loading: boolean;
1009
1302
  adaptive: boolean | {
1010
1303
  width?: boolean;
@@ -1015,7 +1308,7 @@ showPagination: boolean | {
1015
1308
  onShowSizeChange?: (pageSize: number) => void;
1016
1309
  onChange?: (current: number) => void;
1017
1310
  };
1018
- }>;
1311
+ }, {}>;
1019
1312
 
1020
1313
  declare interface BaseSheetComponentProps<RenderHandler = unknown, PartialDrillDown = PartDrillDown, Header = unknown, Options = S2Options<TooltipContentType, Pagination>> {
1021
1314
  sheetType?: SheetType;
@@ -1064,7 +1357,7 @@ declare interface BaseSheetComponentProps<RenderHandler = unknown, PartialDrillD
1064
1357
  onDataCellMouseUp?: (data: TargetCellInfo) => void;
1065
1358
  onDataCellMouseMove?: (data: TargetCellInfo) => void;
1066
1359
  onDataCellBrushSelection?: (brushRangeDataCells: DataCell[]) => void;
1067
- onDataCellSelectMove?: (metas: ViewMetaData[]) => void;
1360
+ onDataCellSelectMove?: (metaList: ViewMetaData[]) => void;
1068
1361
  onCornerCellHover?: (data: TargetCellInfo) => void;
1069
1362
  onCornerCellClick?: (data: TargetCellInfo) => void;
1070
1363
  onCornerCellDoubleClick?: (data: TargetCellInfo) => void;
@@ -1143,16 +1436,24 @@ declare interface BaseSheetComponentProps<RenderHandler = unknown, PartialDrillD
1143
1436
  }
1144
1437
 
1145
1438
  /**
1146
- * Base tooltips component
1439
+ * Tooltip 基类
1440
+ * @see https://s2.antv.antgroup.com/manual/basic/tooltip#%E8%87%AA%E5%AE%9A%E4%B9%89
1441
+ * @example
1442
+ * import CustomTooltip extends BaseTooltip {
1443
+ renderContent() {}
1444
+ show() {}
1445
+ hide() {}
1446
+ destroy() {}
1447
+ }
1147
1448
  */
1148
- declare class BaseTooltip_2 {
1449
+ declare class BaseTooltip_2<Content = TooltipContentType_2, Menu = BaseTooltipOperatorMenuOptions_2> {
1149
1450
  visible: boolean;
1150
1451
  spreadsheet: SpreadSheet_2;
1151
1452
  container: HTMLElement | null;
1152
- options: TooltipShowOptions;
1453
+ options: TooltipShowOptions<Content, Menu>;
1153
1454
  position: TooltipPosition;
1154
1455
  constructor(spreadsheet: SpreadSheet_2);
1155
- show<T = Element | string>(showOptions: TooltipShowOptions<T>): void;
1456
+ show<T = Content, M = Menu>(options: TooltipShowOptions<T, M>): void;
1156
1457
  hide(): void;
1157
1458
  destroy(): void;
1158
1459
  renderContent<T = TooltipContentType_2>(content: T): void;
@@ -1162,18 +1463,53 @@ declare class BaseTooltip_2 {
1162
1463
  private getContainer;
1163
1464
  }
1164
1465
 
1165
- declare interface BaseTooltipConfig<T = TooltipContentType_2, Icon = Element | string, Text = string> {
1166
- showTooltip?: boolean;
1466
+ declare interface BaseTooltipConfig<T = TooltipContentType_2, Menu = BaseTooltipOperatorMenuOptions_2> {
1467
+ /**
1468
+ * 是否开启 tooltip, 在点击/悬停/停留/刷选/多选等场景会显示
1469
+ * @description @antv/s2 中只保留了 tooltip 的核心显隐逻辑,提供相应数据,不渲染内容
1470
+ * React 版本 和 Vue3 版本中通过 自定义 Tooltip 类 的方式渲染 tooltip 的内容,包括 排序下拉菜单, 单元格选中信息汇总, 列头隐藏按钮 等。
1471
+ * @see https://s2.antv.antgroup.com/manual/basic/tooltip
1472
+ */
1473
+ enable?: boolean;
1474
+ /**
1475
+ * 自定义内容
1476
+ * @see https://s2.antv.antgroup.com/manual/basic/tooltip#%E8%87%AA%E5%AE%9A%E4%B9%89
1477
+ */
1167
1478
  content?: TooltipShowOptions<T>['content'];
1168
- operation?: TooltipOperation<Icon, Text>;
1479
+ /**
1480
+ * 自定义操作项
1481
+ * @see https://s2.antv.antgroup.com/manual/basic/tooltip#%E8%87%AA%E5%AE%9A%E4%B9%89
1482
+ */
1483
+ operation?: TooltipOperation<Menu>;
1484
+ /**
1485
+ * 显示边界, 当 tooltip 超过边界时自动调整显示位置,container: 图表区域,body: 整个浏览器窗口,设置为 `null` 可关闭此功能
1486
+ */
1169
1487
  autoAdjustBoundary?: TooltipAutoAdjustBoundary;
1170
- renderTooltip?: (spreadsheet: SpreadSheet_2) => BaseTooltip_2;
1488
+ /**
1489
+ * 自定义 Tooltip 类
1490
+ * @see https://s2.antv.antgroup.com/zh/examples/react-component/tooltip/#custom-tooltip
1491
+ */
1492
+ render?: (spreadsheet: SpreadSheet_2) => BaseTooltip_2<T, Menu>;
1493
+ /**
1494
+ * 自定义坐标
1495
+ */
1171
1496
  adjustPosition?: (positionInfo: TooltipPositionInfo) => TooltipPosition;
1172
- getContainer?: () => HTMLElement;
1497
+ /**
1498
+ * 自定义挂载容器, 默认 body
1499
+ */
1500
+ getContainer?: () => HTMLElement | null;
1501
+ /**
1502
+ * 容器类名
1503
+ */
1173
1504
  className?: string | string[];
1505
+ /**
1506
+ * 容器样式
1507
+ */
1174
1508
  style?: CSS_2.Properties;
1175
1509
  }
1176
1510
 
1511
+ declare type BaseTooltipOperatorMenuOptions_2 = TooltipOperatorMenuOptions<Element | string, string>;
1512
+
1177
1513
  declare interface BBox {
1178
1514
  x: number;
1179
1515
  y: number;
@@ -1186,24 +1522,31 @@ declare interface BBox {
1186
1522
  }
1187
1523
 
1188
1524
  declare interface BrushSelection {
1189
- data?: boolean;
1190
- row?: boolean;
1191
- col?: boolean;
1525
+ dataCell?: boolean;
1526
+ rowCell?: boolean;
1527
+ colCell?: boolean;
1192
1528
  }
1193
1529
 
1530
+ /** 子弹图样式配置 */
1194
1531
  declare interface BulletTheme {
1532
+ /** 进度条 */
1195
1533
  progressBar: {
1534
+ /** 子弹图宽度相对单元格 content 占比,小数 */
1196
1535
  widthPercent: number;
1197
1536
  height: number;
1537
+ /** 内高度 */
1198
1538
  innerHeight: number;
1199
1539
  };
1540
+ /** 测量标记线 */
1200
1541
  comparativeMeasure: {
1201
1542
  width: number;
1202
1543
  height: number;
1203
1544
  fill?: string;
1204
1545
  opacity?: number;
1205
1546
  };
1547
+ /** 子弹图状态颜色 */
1206
1548
  rangeColors: RangeColors;
1549
+ /** 子弹图背景色 */
1207
1550
  backgroundColor: string;
1208
1551
  }
1209
1552
 
@@ -1224,8 +1567,13 @@ declare interface BulletValue {
1224
1567
  }
1225
1568
 
1226
1569
  declare interface CalcTotals {
1570
+ /** 聚合方式 */
1227
1571
  aggregation?: Aggregation;
1228
- calcFunc?: (query: Query, arr: CellData[]) => number;
1572
+ /**
1573
+ * 自定义计算汇总
1574
+ * @see https://s2.antv.antgroup.com/examples/analysis/totals/#custom
1575
+ */
1576
+ calcFunc?: (query: Query, data: CellData[]) => number;
1229
1577
  }
1230
1578
 
1231
1579
  declare type CanvasEventHandler = (event: FederatedPointerEvent) => void;
@@ -1280,20 +1628,13 @@ declare class CellData {
1280
1628
  get [VALUE_FIELD](): DataItem;
1281
1629
  }
1282
1630
 
1283
- declare interface CellDataParams {
1284
- query: Query;
1285
- isTotals?: boolean;
1286
- rowNode?: Node_2_2;
1287
- isRow?: boolean;
1288
- }
1289
-
1290
- declare type CellEventTarget = FederatedPointerEvent['target'] | null | undefined;
1631
+ declare type CellEventTarget = FederatedPointerEvent['target'] | null | undefined | EventTarget | IEventTarget;
1291
1632
 
1292
1633
  declare interface CellMeta {
1293
1634
  id: string;
1294
1635
  colIndex: number;
1295
1636
  rowIndex: number;
1296
- type: CellTypes;
1637
+ type: CellType;
1297
1638
  rowQuery?: Record<string, any>;
1298
1639
  [key: string]: unknown;
1299
1640
  }
@@ -1306,51 +1647,54 @@ declare interface CellScrollOffset {
1306
1647
  offsetY: number;
1307
1648
  }
1308
1649
 
1309
- declare interface CellScrollPosition_2 {
1310
- scrollX: number;
1311
- scrollY: number;
1312
- }
1650
+ declare type CellScrollPosition_2 = Required<ScrollOffset_2>;
1313
1651
 
1314
1652
  declare interface CellTheme {
1653
+ /** 奇数行单元格背景色 */
1315
1654
  crossBackgroundColor?: string;
1655
+ /** 单元格背景色 */
1316
1656
  backgroundColor?: string;
1657
+ /** 单元格背景色透明度 */
1317
1658
  backgroundColorOpacity?: number;
1659
+ /** 单元格水平边线颜色 */
1318
1660
  horizontalBorderColor?: string;
1661
+ /** 单元格水平边线颜色透明度 */
1319
1662
  horizontalBorderColorOpacity?: number;
1663
+ /** 单元格垂直边线颜色 */
1320
1664
  verticalBorderColor?: string;
1665
+ /** 单元格垂直边线颜色透明度 */
1321
1666
  verticalBorderColorOpacity?: number;
1667
+ /** 单元格水平边线宽度 */
1322
1668
  horizontalBorderWidth?: number;
1669
+ /** 单元格垂直边线宽度 */
1323
1670
  verticalBorderWidth?: number;
1671
+ /** 单元格内边距 */
1324
1672
  padding?: Padding;
1673
+ /** 交互态 */
1325
1674
  interactionState?: InteractionState;
1326
1675
  }
1327
1676
 
1328
1677
  declare type CellThemes = {
1329
- [K in CellTypes]?: DefaultCellTheme;
1678
+ [K in CellType]?: DefaultCellTheme;
1330
1679
  };
1331
1680
 
1332
- declare enum CellTypes {
1681
+ declare enum CellType {
1333
1682
  DATA_CELL = "dataCell",
1334
- HEADER_CELL = "headerCell",
1335
1683
  ROW_CELL = "rowCell",
1336
1684
  COL_CELL = "colCell",
1685
+ SERIES_NUMBER_CELL = "seriesNumberCell",
1337
1686
  CORNER_CELL = "cornerCell",
1338
1687
  MERGED_CELL = "mergedCell"
1339
1688
  }
1340
1689
 
1341
- declare class ColCell extends HeaderCell {
1342
- protected headerConfig: ColHeaderConfig;
1343
- /** icon 绘制起始坐标 */
1344
- protected iconPosition: PointLike;
1345
- get cellType(): CellTypes;
1690
+ declare class ColCell extends HeaderCell<ColHeaderConfig> {
1691
+ get cellType(): CellType;
1346
1692
  protected getBorderPositions(): CellBorderPosition[];
1347
1693
  protected initCell(): void;
1348
1694
  protected getFormattedFieldValue(): FormatResult;
1349
1695
  protected getMaxTextWidth(): number;
1350
1696
  protected isBolderText(): boolean;
1351
1697
  protected getTextPosition(): PointLike;
1352
- protected getIconPosition(): PointLike;
1353
- protected getActionIconsWidth(): number;
1354
1698
  protected getColResizeArea(): Group | undefined;
1355
1699
  protected getHorizontalResizeAreaName(): string;
1356
1700
  /**
@@ -1404,7 +1748,8 @@ declare interface ColCellStyle extends BaseCellStyle {
1404
1748
  declare class ColHeader extends BaseHeader<ColHeaderConfig> {
1405
1749
  protected scrollGroup: Group;
1406
1750
  protected background: DisplayObject;
1407
- constructor(cfg: ColHeaderConfig);
1751
+ constructor(config: ColHeaderConfig);
1752
+ protected getCellInstance(node: Node_2_2): S2CellType_2;
1408
1753
  private initScrollGroup;
1409
1754
  /**
1410
1755
  * Make colHeader scroll with hScrollBar
@@ -1415,7 +1760,6 @@ declare class ColHeader extends BaseHeader<ColHeaderConfig> {
1415
1760
  onColScroll(scrollX: number, type: string): void;
1416
1761
  protected clip(): void;
1417
1762
  clear(): void;
1418
- protected getCellInstance(node: Node_2_2, spreadsheet: SpreadSheet_2, headerConfig: ColHeaderConfig): S2CellType_2;
1419
1763
  protected getCellGroup(node: Node_2_2): Group;
1420
1764
  protected isColCellInRect(node: Node_2_2): boolean;
1421
1765
  protected layout(): void;
@@ -1429,13 +1773,31 @@ declare interface ColHeaderConfig extends BaseHeaderConfig {
1429
1773
  /**
1430
1774
  * One field can hold a condition
1431
1775
  */
1432
- declare interface Condition {
1776
+ declare interface Condition<T = unknown> {
1433
1777
  field?: string | RegExp;
1434
- mapping: MappingFunction;
1778
+ mapping: ConditionMapping<T>;
1435
1779
  }
1436
1780
 
1781
+ declare type ConditionMapping<T = unknown> = (fieldValue: number | string, data: RawData_2, cell?: DataCell_2 | HeaderCell) => ConditionMappingResult<T> | undefined | null;
1782
+
1783
+ declare type ConditionMappingResult<T = unknown> = ValueRange & T & {
1784
+ icon?: string;
1785
+ fill?: string;
1786
+ isCompare?: boolean;
1787
+ /**
1788
+ * @description only used in background condition, when the background color is too light, the font color will be white
1789
+ * @version 1.34.0
1790
+ */
1791
+ intelligentReverseTextColor?: boolean;
1792
+ /**
1793
+ * @description custom the interval condition's width
1794
+ * @version 1.38.0
1795
+ */
1796
+ fieldValue?: number;
1797
+ };
1798
+
1437
1799
  declare interface Conditions {
1438
- text?: Condition[];
1800
+ text?: TextCondition[];
1439
1801
  background?: Condition[];
1440
1802
  interval?: Condition[];
1441
1803
  icon?: IconCondition[];
@@ -1466,15 +1828,13 @@ declare class CornerBBox extends BaseBBox {
1466
1828
  private adjustCornerBBoxWidth;
1467
1829
  }
1468
1830
 
1469
- declare class CornerCell extends HeaderCell {
1470
- cornerType: CornerNodeType;
1471
- protected headerConfig: CornerHeaderConfig;
1831
+ declare class CornerCell extends HeaderCell<CornerHeaderConfig> {
1832
+ get cellType(): CellType;
1472
1833
  protected isBolderText(): boolean;
1473
- get cellType(): CellTypes;
1474
1834
  protected getBorderPositions(): CellBorderPosition[];
1475
1835
  update(): void;
1476
1836
  protected initCell(): void;
1477
- protected drawTextShape(): void;
1837
+ drawTextShape(options?: RenderTextShapeOptions): void;
1478
1838
  /**
1479
1839
  * 绘制折叠展开的icon
1480
1840
  */
@@ -1483,19 +1843,19 @@ declare class CornerCell extends HeaderCell {
1483
1843
  protected getResizeAreaEffect(): ResizeAreaEffect.Field | ResizeAreaEffect.Tree | ResizeAreaEffect.Series;
1484
1844
  protected drawResizeArea(): void;
1485
1845
  protected showTreeIcon(): boolean;
1486
- protected getIconPosition(): PointLike;
1487
1846
  protected getTreeIconWidth(): number;
1488
1847
  protected getTextStyle(): TextTheme;
1489
1848
  protected getMaxTextWidth(): number;
1490
1849
  protected getTextPosition(): PointLike;
1491
1850
  protected getFormattedFieldValue(): FormatResult;
1492
- protected getCornerText(): string;
1493
1851
  }
1494
1852
 
1495
1853
  /**
1496
1854
  * Corner Header for SpreadSheet
1497
1855
  */
1498
1856
  declare class CornerHeader extends BaseHeader<CornerHeaderConfig> {
1857
+ constructor(config: CornerHeaderConfig);
1858
+ protected getCellInstance(node: Node_2_2): S2CellType_2;
1499
1859
  /**
1500
1860
  * Get corner Header by config
1501
1861
  */
@@ -1509,7 +1869,6 @@ declare class CornerHeader extends BaseHeader<CornerHeaderConfig> {
1509
1869
  width: number;
1510
1870
  height: number;
1511
1871
  }): Node_2_2[];
1512
- constructor(cfg: CornerHeaderConfig);
1513
1872
  /**
1514
1873
  * Make cornerHeader scroll with hScrollBar
1515
1874
  * @param scrollX
@@ -1554,7 +1913,23 @@ declare interface CustomInteraction {
1554
1913
  }
1555
1914
 
1556
1915
  declare interface CustomSVGIcon {
1916
+ /**
1917
+ * icon 名称
1918
+ */
1557
1919
  name: string;
1920
+ /**
1921
+ * @example 1、base64
1922
+ * @example 2. svg本地文件 (兼容老方式, 可以改颜色)
1923
+
1924
+ import Icon from 'path/to/xxx.svg'
1925
+
1926
+ => { name: 'iconA', svg: Icon }
1927
+ => { name: 'iconB', svg: '<svg>...</svg>' }
1928
+
1929
+ * @example 3. 线上支持的图片地址
1930
+ 带后缀: https://gw.alipayobjects.com/zos/antfincdn/gu1Fsz3fw0/filter%26sort_filter.svg
1931
+ 无后缀: https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*5nsESLuvc_EAAAAAAAAAAAAADmJ7AQ/original
1932
+ */
1558
1933
  svg: string;
1559
1934
  }
1560
1935
 
@@ -1610,8 +1985,9 @@ declare type Data = (RawData_2 & ExtraData) | undefined | null;
1610
1985
  * 2、icon align in right with size {@link ICON_SIZE}
1611
1986
  * 3、left rect area is interval(in left) and text(in right)
1612
1987
  */
1613
- declare class DataCell_2 extends BaseCell<ViewMeta_2> {
1614
- get cellType(): CellTypes;
1988
+ declare class DataCell_2 extends BaseCell<ViewMeta> {
1989
+ iconPosition: PointLike;
1990
+ get cellType(): CellType;
1615
1991
  protected getBorderPositions(): CellBorderPosition[];
1616
1992
  get valueRangeByField(): ValueRange;
1617
1993
  protected handleByStateName(cells: CellMeta[], stateName: InteractionStateName): void;
@@ -1619,28 +1995,20 @@ declare class DataCell_2 extends BaseCell<ViewMeta_2> {
1619
1995
  protected handleSelect(cells: CellMeta[]): void;
1620
1996
  protected handleHover(cells: CellMeta[]): void;
1621
1997
  update(): void;
1622
- setMeta(viewMeta: ViewMeta_2): void;
1998
+ setMeta(viewMeta: ViewMeta): void;
1999
+ drawTextShape(options?: RenderTextShapeOptions): void;
1623
2000
  protected initCell(): void;
1624
- /**
1625
- * 获取默认字体颜色:根据字段标记背景颜色,设置字体颜色
1626
- * @param textStyle
1627
- * @private
1628
- */
1629
- private getDefaultTextFill;
2001
+ protected generateIconConfig(): void;
1630
2002
  protected getTextStyle(): TextTheme;
1631
- getIconStyle(): IconStyle | undefined;
1632
2003
  protected drawConditionIntervalShape(): void;
1633
2004
  protected shouldHideRowSubtotalData(): boolean;
1634
2005
  protected getFormattedFieldValue(): FormatResult;
1635
2006
  protected getMaxTextWidth(): number;
1636
2007
  protected getTextPosition(): PointLike;
2008
+ protected getIconPosition(): PointLike;
1637
2009
  getBackgroundColor(): {
1638
- backgroundColor: string | undefined;
1639
- backgroundColorOpacity: number | undefined;
1640
- intelligentReverseTextColor?: undefined;
1641
- } | {
1642
- backgroundColor: string | undefined;
1643
- backgroundColorOpacity: number | undefined;
2010
+ backgroundColor: string;
2011
+ backgroundColorOpacity: number;
1644
2012
  intelligentReverseTextColor: boolean;
1645
2013
  };
1646
2014
  protected changeRowColSelectState(indexType: ViewMetaIndexType): void;
@@ -1657,23 +2025,39 @@ declare class DataCell_2 extends BaseCell<ViewMeta_2> {
1657
2025
  * Mapping value to get condition related attrs
1658
2026
  * @param condition
1659
2027
  */
1660
- mappingValue(condition: Condition): MappingResult | undefined | null;
2028
+ mappingValue(condition: Condition): ConditionMappingResult | undefined | null;
1661
2029
  updateByState(stateName: InteractionStateName): void;
1662
2030
  clearUnselectedState(): void;
1663
2031
  private toggleConditionIntervalShapeOpacity;
1664
2032
  }
1665
2033
 
1666
- declare type DataCellCallback = (viewMeta: ViewMeta_2) => S2CellType_2;
2034
+ declare type DataCellCallback = (viewMeta: ViewMeta) => S2CellType_2;
1667
2035
 
1668
2036
  declare interface DataCellStyle {
2037
+ /**
2038
+ * 宽度
2039
+ */
1669
2040
  width?: number;
2041
+ /**
2042
+ * 高度
2043
+ */
1670
2044
  height?: number;
1671
2045
  /**
1672
2046
  * 多列数值配置
1673
2047
  */
1674
2048
  valuesCfg?: {
2049
+ /**
2050
+ * 原始值字段
2051
+ */
1675
2052
  originalValueField?: string;
2053
+ /**
2054
+ * 每一列数值占单元格宽度百分比
2055
+ * @example [0.1, 0.3, 0.6]
2056
+ */
1676
2057
  widthPercent?: number[];
2058
+ /**
2059
+ * 是否显示原始值 (tooltip 中显示)
2060
+ */
1677
2061
  showOriginalValue?: boolean;
1678
2062
  };
1679
2063
  }
@@ -1682,14 +2066,26 @@ declare type DataItem = SimpleData | MultiData | Record<string, unknown> | undef
1682
2066
 
1683
2067
  declare type DataPath = (number | string)[];
1684
2068
 
2069
+ declare type DeepRequired<T extends Record<string, any>> = {
2070
+ [K in keyof T]-?: NonNullable<T[K]> extends Record<string, any> ? DeepRequired<NonNullable<T[K]>> : NonNullable<T[K]>;
2071
+ };
2072
+
1685
2073
  declare interface DefaultCellTheme extends GridAnalysisCellTheme {
2074
+ /** 粗体文本样式 */
1686
2075
  bolderText?: TextTheme;
2076
+ /** 文本样式 */
1687
2077
  text?: TextTheme;
2078
+ /** 序号样式 */
1688
2079
  seriesText?: TextTheme;
2080
+ /** 度量值文本样式 */
1689
2081
  measureText?: TextTheme;
2082
+ /** 单元格样式 */
1690
2083
  cell?: CellTheme;
2084
+ /** 图标样式 */
1691
2085
  icon?: IconTheme;
2086
+ /** mini 图样式配置 */
1692
2087
  miniChart?: MiniChartTheme;
2088
+ /** 序号列宽 */
1693
2089
  seriesNumberWidth?: number;
1694
2090
  }
1695
2091
 
@@ -1788,7 +2184,7 @@ declare interface EmitterType {
1788
2184
  total: number;
1789
2185
  current: number;
1790
2186
  }) => void;
1791
- [S2Event.LAYOUT_AFTER_HEADER_LAYOUT]: (data: LayoutResult_2) => void;
2187
+ [S2Event.LAYOUT_AFTER_HEADER_LAYOUT]: (layoutResult: LayoutResult_2) => void;
1792
2188
  [S2Event.LAYOUT_AFTER_REAL_DATA_CELL_RENDER]: (options: {
1793
2189
  add: [number, number][];
1794
2190
  remove: [number, number][];
@@ -1823,6 +2219,7 @@ declare class EventController {
1823
2219
  private onKeyboardCopy;
1824
2220
  private onKeyboardEsc;
1825
2221
  private resetSheetStyle;
2222
+ private isMouseEvent;
1826
2223
  private isMouseOnTheCanvasContainer;
1827
2224
  private getContainerRect;
1828
2225
  private isMouseOnTheTooltip;
@@ -1877,6 +2274,9 @@ declare type ExtraData = {
1877
2274
  };
1878
2275
 
1879
2276
  declare interface Fields extends BaseFields {
2277
+ /**
2278
+ * 自定义指标维度在行列头中的层级顺序 (即 `values` 的 顺序,从 `0` 开始
2279
+ */
1880
2280
  customValueOrder?: number;
1881
2281
  }
1882
2282
 
@@ -1891,7 +2291,13 @@ declare interface FormatResult {
1891
2291
  value: DataItem;
1892
2292
  }
1893
2293
 
1894
- declare type Formatter = (v: unknown, data?: ViewMetaData_2 | ViewMetaData_2[], meta?: Node_2_2 | ViewMeta_2) => string;
2294
+ /**
2295
+ * 第二个参数在以下情况会传入:
2296
+ * 1. data cell 格式化
2297
+ * 2. copy/export
2298
+ * 3. tooltip, 且仅在选择多个单元格时,data 类型为数组
2299
+ */
2300
+ declare type Formatter = (v: unknown, data?: ViewMetaData_2 | ViewMetaData_2[], meta?: Node_2_2 | ViewMeta) => string;
1895
2301
 
1896
2302
  declare class Frame extends Group {
1897
2303
  cfg: FrameConfig;
@@ -1932,7 +2338,39 @@ declare interface FrameConfig {
1932
2338
  declare class FrozenGroup extends GridGroup {
1933
2339
  }
1934
2340
 
1935
- declare type GetCellMeta = (rowIndex: number, colIndex: number) => ViewMeta_2 | null;
2341
+ declare interface GetCellDataParams {
2342
+ /**
2343
+ * 查询条件
2344
+ */
2345
+ query: Query;
2346
+ /**
2347
+ * 是否是汇总节点
2348
+ */
2349
+ isTotals?: boolean;
2350
+ /**
2351
+ * 行头节点, 用于下钻场景
2352
+ */
2353
+ rowNode?: Node_2_2;
2354
+ /**
2355
+ * 是否是行头
2356
+ */
2357
+ isRow?: boolean;
2358
+ }
2359
+
2360
+ declare interface GetCellMultiDataParams {
2361
+ /**
2362
+ * 查询条件
2363
+ */
2364
+ query: Query;
2365
+ /**
2366
+ * 汇总
2367
+ */
2368
+ totals?: TotalSelectionsOfMultiData;
2369
+ /**
2370
+ * 下钻
2371
+ */
2372
+ drillDownFields?: string[];
2373
+ }
1936
2374
 
1937
2375
  declare type GetInitProps<T, OptionalKeys = GetOptionalKeys<T>> = {
1938
2376
  [K in keyof T as IsEmitKey<T[K]> extends true ? never : K]-?: K extends OptionalKeys ? PropOption<NonNullable<T[K]>> : RequiredPropOption<NonNullable<T[K]>>;
@@ -1943,7 +2381,9 @@ declare type GetOptionalKeys<T> = keyof {
1943
2381
  };
1944
2382
 
1945
2383
  declare interface GridAnalysisCellTheme {
2384
+ /** 次级文本,如副指标 */
1946
2385
  minorText?: TextTheme;
2386
+ /** 衍生指标 */
1947
2387
  derivedMeasureText?: {
1948
2388
  mainUp: string;
1949
2389
  mainDown: string;
@@ -1971,6 +2411,10 @@ declare interface GridInfo {
1971
2411
  rows: number[];
1972
2412
  }
1973
2413
 
2414
+ declare type GroupedIcons = {
2415
+ [key in IconPosition]: HeaderActionNameOptions[];
2416
+ };
2417
+
1974
2418
  /**
1975
2419
  * 使用 iconfont 上的 svg 来创建 Icon
1976
2420
  */
@@ -1979,7 +2423,8 @@ declare class GuiIcon extends Group {
1979
2423
  iconImageShape: CustomImage;
1980
2424
  private cfg;
1981
2425
  constructor(cfg: GuiIconCfg);
1982
- private getImage;
2426
+ getCfg(): GuiIconCfg;
2427
+ getImage(name: string, cacheKey: string, fill?: string): Promise<HTMLImageElement>;
1983
2428
  /**
1984
2429
  * 1. https://xxx.svg
1985
2430
  * 2. http://xxx.svg
@@ -1987,6 +2432,10 @@ declare class GuiIcon extends Group {
1987
2432
  */
1988
2433
  isOnlineLink: (src: string) => boolean;
1989
2434
  private render;
2435
+ setImageAttrs(attrs: Partial<{
2436
+ name: string;
2437
+ fill: string;
2438
+ }>): void;
1990
2439
  }
1991
2440
 
1992
2441
  declare interface GuiIconCfg extends Omit<ImageStyleProps, 'fill'> {
@@ -2016,45 +2465,98 @@ declare class HdAdapter {
2016
2465
  private renderByZoomScale;
2017
2466
  }
2018
2467
 
2019
- declare interface HeaderActionIcon {
2020
- iconNames: string[];
2021
- belongsCell: Omit<CellTypes, 'dataCell'>;
2468
+ declare interface HeaderActionIcon_2 extends HeaderActionIconBaseOptions {
2469
+ /**
2470
+ * 内置 icon 或通过 @customSVGIcons 自定义的 icon 名称
2471
+ * 如果是 string[], 则默认 icon 位置为右侧
2472
+ * @see https://s2.antv.antgroup.com/manual/advanced/custom/custom-icon
2473
+ * @example icons: ['iconNameA', 'iconNameB']
2474
+ * @example icons: [{ name: 'iconNameA', position: "left", fill: "red" }]
2475
+ */
2476
+ icons: HeaderActionName[];
2477
+ /**
2478
+ * 所属的 cell 类型, 即当前 icon 展示在哪种类型单元格中
2479
+ * @example belongsCell: 'rowCell'
2480
+ */
2481
+ belongsCell: Omit<CellType, 'dataCell' | 'mergedCell' | 'seriesNumberCell'>;
2482
+ }
2483
+
2484
+ declare interface HeaderActionIconBaseOptions {
2485
+ /**
2486
+ * 是否默认隐藏, 开启后 hover 后才显示, 关闭后则始终显示, 可根据当前单元格信息动态判断
2487
+ * @example defaultHide: (meta, iconName) => meta.id === 'xxx'
2488
+ * @default false
2489
+ */
2022
2490
  defaultHide?: boolean | ((meta: Node_2_2, iconName: string) => boolean);
2491
+ /**
2492
+ * 是否展示, 可根据当前单元格信息动态判断
2493
+ * @example displayCondition: (meta, iconName) => !meta.isTotals
2494
+ */
2023
2495
  displayCondition?: (mete: Node_2_2, iconName: string) => boolean;
2496
+ /**
2497
+ * 点击回调函数
2498
+ */
2024
2499
  onClick?: (headerIconClickParams: HeaderIconClickParams) => void;
2500
+ /**
2501
+ * 悬停回调函数
2502
+ */
2025
2503
  onHover?: (headerIconHoverParams: HeaderIconHoverParams) => void;
2026
2504
  }
2027
2505
 
2028
- declare interface HeaderActionIconOptions {
2029
- iconName: string;
2506
+ declare interface HeaderActionIconOptions extends HeaderActionIconBaseOptions {
2507
+ fill?: string;
2508
+ name: string;
2030
2509
  x: number;
2031
2510
  y: number;
2032
- onClick?: (headerIconClickParams: HeaderIconClickParams) => void;
2033
- onHover?: (headerIconHoverParams: HeaderIconHoverParams) => void;
2034
- defaultHide?: boolean;
2511
+ isSortIcon?: boolean;
2035
2512
  }
2036
2513
 
2037
- declare abstract class HeaderCell extends BaseCell<Node_2_2> {
2038
- protected headerConfig: BaseHeaderConfig;
2514
+ declare type HeaderActionName = string | Omit<HeaderActionNameOptions, 'isConditionIcon'>;
2515
+
2516
+ declare type HeaderActionNameOptions = HeaderActionIconBaseOptions & {
2517
+ /**
2518
+ * icon 颜色配置
2519
+ * @description 优先级: 单个 icon > 主题 icon 配置 > 文本颜色
2520
+ */
2521
+ fill?: string;
2522
+ /**
2523
+ * icon 名称
2524
+ */
2525
+ name: string;
2526
+ /**
2527
+ * icon 相对文本的位置
2528
+ * 可选: 'left' | 'right'
2529
+ */
2530
+ position?: IconPosition;
2531
+ /**
2532
+ * 是否是条件格式的 icon
2533
+ */
2534
+ isConditionIcon?: boolean;
2535
+ };
2536
+
2537
+ declare abstract class HeaderCell<T extends BaseHeaderConfig = BaseHeaderConfig> extends BaseCell<Node_2_2> {
2538
+ protected headerConfig: T;
2539
+ protected actionIconConfig: InternalFullyHeaderActionIcon | undefined;
2039
2540
  protected treeIcon: GuiIcon | undefined;
2040
2541
  protected treeLeafNodeAlignDot: DisplayObject | undefined;
2041
2542
  protected actionIcons: GuiIcon[];
2042
2543
  protected hasDefaultHiddenIcon: boolean;
2544
+ protected conditionIconMappingResult: HeaderActionNameOptions | undefined;
2545
+ /** left icon 绘制起始坐标 */
2546
+ protected leftIconPosition: PointLike;
2547
+ /** right icon 绘制起始坐标 */
2548
+ protected rightIconPosition: PointLike;
2043
2549
  protected abstract isBolderText(): boolean;
2044
- protected handleRestOptions(...[headerConfig]: [BaseHeaderConfig]): void;
2550
+ getHeaderConfig(): T;
2551
+ protected handleRestOptions(...[headerConfig]: [T]): void;
2045
2552
  protected initCell(): void;
2553
+ protected generateIconConfig(): void;
2046
2554
  protected getFormattedFieldValue(): FormatResult;
2047
- /**
2048
- * 获取操作 icons
2049
- */
2050
- protected getActionIconCfg(): HeaderActionIcon | undefined;
2051
2555
  protected showSortIcon(): boolean | "" | undefined;
2052
- protected getActionIconsCount(): number;
2053
- protected getActionIconsWidth(): number;
2054
- protected drawSortIcons(): void;
2556
+ protected getActionIconStyle(options: Partial<HeaderActionIconOptions>): Partial<GuiIconCfg>;
2055
2557
  protected hasDefaultHideActionIcon(): boolean;
2056
2558
  protected addActionIcon(options: HeaderActionIconOptions): void;
2057
- protected drawActionIcons(): void;
2559
+ protected drawActionAndConditionIcons(): void;
2058
2560
  protected isSortCell(): boolean;
2059
2561
  protected handleByStateName(cells: CellMeta[], stateName: InteractionStateName): void;
2060
2562
  protected handleSearchResult(cells: CellMeta[]): void;
@@ -2062,21 +2564,26 @@ declare abstract class HeaderCell extends BaseCell<Node_2_2> {
2062
2564
  protected handleSelect(cells: CellMeta[], nodes?: Node_2_2[]): void;
2063
2565
  protected getTextStyle(): TextTheme;
2064
2566
  getBackgroundColor(): {
2567
+ backgroundColor: string;
2568
+ backgroundColorOpacity: number;
2569
+ } & {
2065
2570
  backgroundColor: string | undefined;
2066
- backgroundColorOpacity: number | undefined;
2571
+ intelligentReverseTextColor: boolean;
2067
2572
  };
2068
2573
  toggleActionIcon(id: string): void;
2574
+ protected getIconPosition(): PointLike;
2069
2575
  update(): void;
2070
2576
  updateByState(stateName: InteractionStateName): void;
2071
2577
  hideInteractionShape(): void;
2072
2578
  isMeasureField(): boolean;
2073
- mappingValue(condition: Condition): MappingResult;
2579
+ mappingValue(condition: Condition): ConditionMappingResult;
2074
2580
  findFieldCondition(conditions: Condition[]): Condition | undefined;
2075
2581
  getTreeIcon(): GuiIcon | undefined;
2582
+ getActionIcons(): GuiIcon[];
2076
2583
  }
2077
2584
 
2078
2585
  declare interface HeaderIconClickParams {
2079
- iconName: string;
2586
+ name: string;
2080
2587
  meta: Node_2_2;
2081
2588
  event?: FederatedPointerEvent;
2082
2589
  }
@@ -2086,7 +2593,13 @@ declare interface HeaderIconHoverParams extends HeaderIconClickParams {
2086
2593
  }
2087
2594
 
2088
2595
  declare interface HiddenColumnsInfo_2 {
2596
+ /**
2597
+ * 当前显示的兄弟节点之前所隐藏的节点
2598
+ */
2089
2599
  hideColumnNodes: Node_2_2[];
2600
+ /**
2601
+ * 当前隐藏列所对应展示展开按钮的兄弟节点
2602
+ */
2090
2603
  displaySiblingNode: {
2091
2604
  prev: Node_2_2 | null;
2092
2605
  next: Node_2_2 | null;
@@ -2118,11 +2631,11 @@ declare class Hierarchy {
2118
2631
  getNodesLessThanLevel(lessThanLevel: number): Node_2_2[];
2119
2632
  /**
2120
2633
  * Add new node
2121
- * @param value
2634
+ * @param node
2122
2635
  * @param insetIndex
2123
2636
  */
2124
- pushNode(value: Node_2_2, insetIndex?: number): void;
2125
- pushIndexNode(value: Node_2_2): void;
2637
+ pushNode(node: Node_2_2, insetIndex?: number): void;
2638
+ pushIndexNode(node: Node_2_2): void;
2126
2639
  getIndexNodes(): Node_2_2[];
2127
2640
  }
2128
2641
 
@@ -2130,54 +2643,128 @@ declare interface HoverFocusOptions {
2130
2643
  duration?: number;
2131
2644
  }
2132
2645
 
2133
- declare interface IconCondition extends Condition {
2646
+ declare interface IconCondition extends Condition<IconTheme> {
2134
2647
  position?: IconPosition;
2135
2648
  }
2136
2649
 
2137
2650
  declare type IconPosition = 'left' | 'right';
2138
2651
 
2139
- declare type IconStyle = Pick<IconTheme, 'size' | 'margin'> & Pick<IconCondition, 'position'>;
2140
-
2141
2652
  declare interface IconTheme {
2653
+ /** icon 填充色 */
2142
2654
  fill?: string;
2143
- downIconColor?: string;
2144
- upIconColor?: string;
2655
+ /** icon 大小 */
2145
2656
  size?: number;
2657
+ /** icon 外边距 */
2146
2658
  margin?: Margin;
2147
2659
  }
2148
2660
 
2149
2661
  declare type Indexes = [number, number, number, number];
2150
2662
 
2151
- declare interface InteractionCellSelectedHighlightType {
2663
+ declare interface InteractionCellSelectedHighlightOptions {
2664
+ /** 高亮行头 */
2152
2665
  rowHeader?: boolean;
2666
+ /** 高亮列头 */
2153
2667
  colHeader?: boolean;
2668
+ /** 高亮选中单元格所在行 */
2154
2669
  currentRow?: boolean;
2670
+ /** 高亮选中单元格所在列 */
2155
2671
  currentCol?: boolean;
2156
2672
  }
2157
2673
 
2158
2674
  declare type InteractionConstructor = new (spreadsheet: SpreadSheet_2) => BaseEvent;
2159
2675
 
2160
2676
  declare interface InteractionOptions {
2161
- linkFields?: string[] | ((meta: Node_2_2 | ViewMeta_2) => boolean);
2677
+ /**
2678
+ * 链接跳转
2679
+ * @see https://s2.antv.antgroup.com/manual/advanced/interaction/link-jump
2680
+ */
2681
+ linkFields?: string[] | ((meta: Node_2_2 | ViewMeta) => boolean);
2682
+ /**
2683
+ * 选中单元格高亮聚焦
2684
+ */
2162
2685
  selectedCellsSpotlight?: boolean;
2686
+ /**
2687
+ * 十字器高亮效果
2688
+ */
2163
2689
  hoverHighlight?: boolean;
2690
+ /**
2691
+ * 悬停聚焦, 800ms 后会显示其对应 tooltip, 可以自定义 duration
2692
+ */
2164
2693
  hoverFocus?: HoverFocusOptions | boolean;
2694
+ /**
2695
+ * 开启复制 Command/Ctrl + C
2696
+ */
2165
2697
  enableCopy?: boolean;
2698
+ /**
2699
+ * 复制带格式的数据
2700
+ */
2166
2701
  copyWithFormat?: boolean;
2702
+ /**
2703
+ * 复制包含其对应行列头的数据
2704
+ */
2167
2705
  copyWithHeader?: boolean;
2706
+ /**
2707
+ * 复制时支持自定义(transformer)数据导出格式化方法
2708
+ */
2709
+ customTransformer?: (transformer: Transformer_2) => Partial<Transformer_2>;
2710
+ /**
2711
+ * 自动重置表格样式 (按下 ESC 键, 点击空白区域时, 关闭 tooltip/交互状态)
2712
+ */
2168
2713
  autoResetSheetStyle?: boolean;
2714
+ /**
2715
+ * 隐藏列头配置, 支持维度 (S2DataConfig.fields) 和具体维值 (id)
2716
+ * @example hiddenColumnFields: ['type', 'subType'];
2717
+ * @example hiddenColumnFields: ['root[&]家具[&]桌子[&]number']
2718
+ */
2169
2719
  hiddenColumnFields?: string[];
2720
+ /**
2721
+ * 自定义滚动速率, 默认 1
2722
+ * @see https://s2.antv.antgroup.com/manual/advanced/interaction/scroll
2723
+ */
2170
2724
  scrollSpeedRatio?: ScrollSpeedRatio;
2725
+ /**
2726
+ * 宽高调整
2727
+ */
2171
2728
  resize?: ResizeInteractionOptions | boolean;
2729
+ /**
2730
+ * 刷选
2731
+ */
2172
2732
  brushSelection?: BrushSelection | boolean;
2733
+ /**
2734
+ * 多选 Command/Ctrl + click
2735
+ */
2173
2736
  multiSelection?: boolean;
2737
+ /**
2738
+ * 区间快捷多选 Shift + click
2739
+ */
2174
2740
  rangeSelection?: boolean;
2741
+ /**
2742
+ * 键盘方向键移动选中单元格
2743
+ */
2175
2744
  selectedCellMove?: boolean;
2745
+ /**
2746
+ * 滚动条位置 (可用于表格内容未撑满 Canvas 的场景)
2747
+ */
2176
2748
  scrollbarPosition?: ScrollbarPositionType;
2749
+ /**
2750
+ * 透传 listener 属性的可选参数对象
2751
+ * @see https://developer.mozilla.org/zh-CN/docs/Web/API/EventTarget/addEventListener
2752
+ */
2177
2753
  eventListenerOptions?: boolean | AddEventListenerOptions;
2178
- selectedCellHighlight?: boolean | InteractionCellSelectedHighlightType;
2754
+ /**
2755
+ * 选中单元格高亮联动 (高亮所对应行头/列头, 高亮当前行/当前列)
2756
+ */
2757
+ selectedCellHighlight?: boolean | InteractionCellSelectedHighlightOptions;
2758
+ /**
2759
+ * 滚动到边界的行为
2760
+ * @see https://s2.antv.antgroup.com/manual/advanced/interaction/scroll
2761
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/overscroll-behavior
2762
+ */
2179
2763
  overscrollBehavior?: 'auto' | 'none' | 'contain' | null;
2180
- /** ***********CUSTOM INTERACTION HOOKS**************** */
2764
+ /**
2765
+ * 自定义交互
2766
+ * @see https://s2.antv.antgroup.com/manual/advanced/interaction/custom
2767
+ */
2181
2768
  customInteractions?: CustomInteraction[];
2182
2769
  }
2183
2770
 
@@ -2186,12 +2773,29 @@ declare type InteractionState = {
2186
2773
  };
2187
2774
 
2188
2775
  declare interface InteractionStateInfo {
2776
+ /**
2777
+ * 交互状态名
2778
+ */
2189
2779
  stateName?: InteractionStateName;
2780
+ /**
2781
+ * 单元格元数据 (包含不在可视范围内的)
2782
+ */
2190
2783
  cells?: CellMeta[];
2784
+ /**
2785
+ * 交互状态发生改变的单元格实例
2786
+ */
2191
2787
  interactedCells?: S2CellType_2[];
2788
+ /**
2789
+ * 选中的单元格节点
2790
+ */
2192
2791
  nodes?: Node_2_2[];
2792
+ /**
2793
+ * 如果单元格为空, 是否强制更新 (适用于反选等场景)
2794
+ */
2193
2795
  force?: boolean;
2194
- /** 交互行为改变后,会被更新和重绘的单元格回调 */
2796
+ /**
2797
+ * 交互行为改变后,会被更新和重绘的单元格回调
2798
+ */
2195
2799
  onUpdateCells?: OnUpdateCells;
2196
2800
  }
2197
2801
 
@@ -2207,12 +2811,19 @@ declare enum InteractionStateName {
2207
2811
  }
2208
2812
 
2209
2813
  declare interface InteractionStateTheme {
2814
+ /** 背景透明度 */
2210
2815
  backgroundOpacity?: number;
2816
+ /** 背景填充色 */
2211
2817
  backgroundColor?: string;
2818
+ /** 文本透明度 */
2212
2819
  textOpacity?: number;
2820
+ /** 边线颜色 */
2213
2821
  borderColor?: string;
2822
+ /** 边线宽度 */
2214
2823
  borderWidth?: number;
2824
+ /** 边线透明度 */
2215
2825
  borderOpacity?: number;
2826
+ /** 透明度 */
2216
2827
  opacity?: number;
2217
2828
  }
2218
2829
 
@@ -2221,13 +2832,23 @@ declare type Intercept = InterceptType[keyof InterceptType];
2221
2832
  declare enum InterceptType {
2222
2833
  HOVER = "hover",
2223
2834
  CLICK = "click",
2224
- BRUSH_SELECTION = "brushSelection",
2225
- ROW_BRUSH_SELECTION = "rowBrushSelection",
2226
- COL_BRUSH_SELECTION = "colBrushSelection",
2835
+ DATA_CELL_BRUSH_SELECTION = "dataCellBrushSelection",
2836
+ ROW_CELL_BRUSH_SELECTION = "rowCellBrushSelection",
2837
+ COL_CELL_BRUSH_SELECTION = "colCellBrushSelection",
2227
2838
  MULTI_SELECTION = "multiSelection",
2228
2839
  RESIZE = "resize"
2229
2840
  }
2230
2841
 
2842
+ declare type InternalFullyCellTheme = DeepRequired<DefaultCellTheme>;
2843
+
2844
+ declare interface InternalFullyHeaderActionIcon extends HeaderActionIcon_2 {
2845
+ icons: HeaderActionNameOptions[];
2846
+ isSortIcon?: boolean;
2847
+ }
2848
+
2849
+ declare type InternalFullyTheme = DeepRequired<S2Theme>;
2850
+
2851
+ /** 条件格式柱图样式配置 */
2231
2852
  declare interface IntervalTheme {
2232
2853
  height: number;
2233
2854
  fill: string;
@@ -2243,14 +2864,14 @@ declare type KeyboardEventHandler = (event: KeyboardEvent) => void;
2243
2864
  declare type LayoutArrange = (spreadsheet: SpreadSheet_2, parent: Node_2_2, field: string, fieldValues: string[]) => string[];
2244
2865
 
2245
2866
  /**
2246
- * determine the location(x,y,width,height eg..) of every node
2867
+ * determine the data of cells in Cartesian coordinates
2247
2868
  */
2248
- declare type LayoutCoordinate = (spreadsheet: SpreadSheet_2, rowNode: Node_2_2 | null, colNode: Node_2_2 | null) => void;
2869
+ declare type LayoutCellMeta = (viewMeta: ViewMeta) => ViewMeta | null;
2249
2870
 
2250
2871
  /**
2251
- * determine the data of cells in Cartesian coordinates
2872
+ * determine the location(x,y,width,height eg..) of every node
2252
2873
  */
2253
- declare type LayoutDataPosition = (spreadsheet: SpreadSheet_2, getCellData: GetCellMeta) => GetCellMeta;
2874
+ declare type LayoutCoordinate = (spreadsheet: SpreadSheet_2, rowNode: Node_2_2 | null, colNode: Node_2_2 | null) => void;
2254
2875
 
2255
2876
  /**
2256
2877
  * determine what does row/column hierarchy look like
@@ -2272,14 +2893,38 @@ declare type LayoutPaginationParams = {
2272
2893
  };
2273
2894
 
2274
2895
  declare interface LayoutResult_2 {
2896
+ /**
2897
+ * 列头节点, 对应 ColCell (含可视范围外)
2898
+ */
2275
2899
  colNodes: Node_2_2[];
2900
+ /**
2901
+ * 列头叶子节点, 对应 ColCell (含可视范围外)
2902
+ */
2903
+ colLeafNodes: Node_2_2[];
2904
+ /**
2905
+ * 列头节点层级结构 (含可视范围外)
2906
+ */
2276
2907
  colsHierarchy: Hierarchy;
2908
+ /**
2909
+ * 行头节点, 对应 RowCell (含可视范围外)
2910
+ */
2277
2911
  rowNodes: Node_2_2[];
2912
+ /**
2913
+ * 行头节点层级结构 (含可视范围外)
2914
+ */
2278
2915
  rowsHierarchy: Hierarchy;
2916
+ /**
2917
+ * 行头叶子节点, 对应 RowCell (含可视范围外)
2918
+ */
2279
2919
  rowLeafNodes: Node_2_2[];
2280
- colLeafNodes: Node_2_2[];
2281
- getCellMeta: GetCellMeta;
2282
- spreadsheet: SpreadSheet_2;
2920
+ /**
2921
+ * 序号节点, 对应 SeriesNumberCell (含可视范围外)
2922
+ */
2923
+ seriesNumberNodes?: Node_2_2[];
2924
+ /**
2925
+ * 角头节点, 对应 CornerCell (含可视范围外)
2926
+ */
2927
+ cornerNodes?: Node_2_2[];
2283
2928
  }
2284
2929
 
2285
2930
  /**
@@ -2295,12 +2940,15 @@ declare type LayoutSeriesNumberNodes = (rowsHierarchy: Hierarchy, seriesNumberWi
2295
2940
  */
2296
2941
  declare type LayoutWidthType = 'adaptive' | 'colAdaptive' | 'compact';
2297
2942
 
2943
+ /** 折线图样式配置 */
2298
2944
  declare interface LineTheme {
2945
+ /** 点 */
2299
2946
  point?: {
2300
2947
  size: number;
2301
2948
  fill?: string;
2302
2949
  opacity?: number;
2303
2950
  };
2951
+ /** 线 */
2304
2952
  linkLine?: {
2305
2953
  size: number;
2306
2954
  fill?: string;
@@ -2308,49 +2956,31 @@ declare interface LineTheme {
2308
2956
  };
2309
2957
  }
2310
2958
 
2311
- declare type MappingFunction = (fieldValue: number | string, data: RawData_2) => MappingResult | undefined | null;
2959
+ declare type Margin = Padding;
2312
2960
 
2313
- declare interface MappingResult extends ValueRange {
2314
- icon?: string;
2315
- fill: string;
2316
- isCompare?: boolean;
2317
- /**
2318
- * @description only used in background condition, when the background color is too light, the font color will be white
2319
- * @version 1.34.0
2320
- */
2321
- intelligentReverseTextColor?: boolean;
2322
- /**
2323
- * @description custom the interval condition's width
2324
- * @version 1.38.0
2325
- */
2326
- fieldValue?: number;
2327
- }
2961
+ declare type MatrixHTMLTransformer = (data: DataItem[][]) => CopyableHTML;
2328
2962
 
2329
- declare type Margin = Padding;
2963
+ declare type MatrixPlainTransformer = (data: DataItem[][], separator?: string) => CopyablePlain;
2330
2964
 
2331
2965
  /**
2332
2966
  * Cell for panelGroup area
2333
2967
  */
2334
2968
  declare class MergedCell extends DataCell_2 {
2335
2969
  cells: S2CellType_2[];
2336
- constructor(spreadsheet: SpreadSheet_2, cells: S2CellType_2[], meta?: ViewMeta_2);
2970
+ get cellType(): CellType;
2971
+ constructor(spreadsheet: SpreadSheet_2, cells: S2CellType_2[], meta?: ViewMeta);
2337
2972
  handleRestOptions(...[cells]: [S2CellType_2[]]): void;
2338
- get cellType(): CellTypes;
2339
2973
  update(): void;
2340
2974
  protected initCell(): void;
2341
2975
  /**
2342
2976
  * Draw merged cells background
2343
2977
  */
2344
2978
  protected drawBackgroundShape(): void;
2345
- /**
2346
- * Render data text
2347
- */
2348
- drawTextShape(): void;
2979
+ drawTextShape(options?: RenderTextShapeOptions): void;
2349
2980
  }
2350
2981
 
2351
- /**
2352
- * the index of rows or columns.
2353
- */
2982
+ declare type MergedCellCallback = (spreadsheet: SpreadSheet_2, cells: S2CellType_2[], meta?: ViewMeta) => MergedCell;
2983
+
2354
2984
  declare interface MergedCellInfo {
2355
2985
  colIndex?: number;
2356
2986
  rowIndex?: number;
@@ -2370,11 +3000,17 @@ declare interface Meta {
2370
3000
  * 字段描述
2371
3001
  */
2372
3002
  description?: string;
3003
+ /**
3004
+ * 格式化
3005
+ * 数值字段:一般用于格式化数字单位
3006
+ * 文本字段:一般用于做字段枚举值的别名
3007
+ */
2373
3008
  formatter?: Formatter;
2374
3009
  }
2375
3010
 
2376
3011
  declare type MiniChartData = BaseChartData | BulletValue;
2377
3012
 
3013
+ /** 迷你图样式 */
2378
3014
  declare interface MiniChartTheme {
2379
3015
  line?: LineTheme;
2380
3016
  bar?: BarTheme;
@@ -2392,19 +3028,24 @@ declare enum MiniChartTypes {
2392
3028
  declare type MouseEventHandler = (event: MouseEvent) => void;
2393
3029
 
2394
3030
  /**
2395
- * use for gridAnalysisSheet
2396
- * eg. { label: '余额女',
2397
- * values: [
2398
- * ['最近7天登端天数', 1, 3423423, 323],
2399
- * ['自然月新登用户数', 1, 3423423, 323],
2400
- * ['最近7天登端天数', 1, 3423423, 323],
2401
- * ['自然月新登用户数', 1, 3423423, 323],
2402
- * ],
2403
- * }
3031
+ * 单个单元格, 显示一组数据
3032
+ * 适用于 (网格分析表, 趋势分析表) 和其他自定义场景
3033
+ {
3034
+ label: '余额女',
3035
+ values: [
3036
+ ['最近7天登端天数', 1, 3423423, 323],
3037
+ ['自然月新登用户数', 1, 3423423, 323],
3038
+ ['最近7天登端天数', 1, 3423423, 323],
3039
+ ['自然月新登用户数', 1, 3423423, 323],
3040
+ ],
3041
+ }
2404
3042
  */
2405
3043
  declare interface MultiData<T = SimpleData[][] | MiniChartData> {
3044
+ /** 数值 */
2406
3045
  values: T;
3046
+ /** 原始值 */
2407
3047
  originalValues?: T;
3048
+ /** 单元格标题 */
2408
3049
  label?: string;
2409
3050
  [key: string]: unknown;
2410
3051
  }
@@ -2435,7 +3076,7 @@ declare class Node_2_2 {
2435
3076
  isPivotMode: boolean;
2436
3077
  seriesNumberWidth: number;
2437
3078
  spreadsheet: SpreadSheet_2;
2438
- query?: Record<string, any>;
3079
+ query?: Query;
2439
3080
  belongsCell?: S2CellType_2 | null | undefined;
2440
3081
  inCollapseNode?: boolean;
2441
3082
  cornerType?: CornerNodeType;
@@ -2507,6 +3148,10 @@ declare class Node_2_2 {
2507
3148
  }
2508
3149
 
2509
3150
  declare interface OffsetConfig {
3151
+ rowHeaderOffsetX?: {
3152
+ value: number | undefined;
3153
+ animate?: boolean;
3154
+ };
2510
3155
  offsetX?: {
2511
3156
  value: number | undefined;
2512
3157
  animate?: boolean;
@@ -2527,15 +3172,44 @@ declare interface Padding {
2527
3172
  }
2528
3173
 
2529
3174
  declare interface Pagination_2 {
3175
+ /** 每页数量 */
2530
3176
  pageSize: number;
3177
+ /** 当前页 (从 1 开始) */
2531
3178
  current: number;
3179
+ /** 数据总条数 */
2532
3180
  total?: number;
2533
3181
  }
2534
3182
 
2535
3183
  declare interface Palette extends PaletteMeta {
3184
+ /**
3185
+ * 基础色值(共15个)
3186
+ *
3187
+ * 1. 角头字体、列头字体
3188
+ * 2. 行头背景、数据格背景(斑马纹)
3189
+ * 3. 行头&数据格交互(hover、选中、十字)
3190
+ * 4. 角头背景、列头背景
3191
+ * 5. 列头交互(hover、选中)
3192
+ * 6. 刷选遮罩
3193
+ * 7. 行头 link
3194
+ * 8. mini bar、resize 交互(参考线等)
3195
+ * 9. 数据格背景(非斑马纹)、整体表底色(建议白色)
3196
+ * 10. 行头边框、数据格边框
3197
+ * 11. 角头边框、列头边框
3198
+ * 12. 竖向大分割线
3199
+ * 13. 横向大分割线
3200
+ * 14. 数据格字体
3201
+ * 15. 行头字体、数据格交互色(hover)
3202
+ */
2536
3203
  basicColors: string[];
2537
3204
  }
2538
3205
 
3206
+ declare const PALETTE_MAP: {
3207
+ readonly default: Palette;
3208
+ readonly colorful: Palette;
3209
+ readonly gray: Palette;
3210
+ readonly dark: Palette;
3211
+ };
3212
+
2539
3213
  declare interface PaletteMeta {
2540
3214
  /** 主题色 */
2541
3215
  brandColor: string;
@@ -2547,12 +3221,14 @@ declare interface PaletteMeta {
2547
3221
  basicColorIndex: number;
2548
3222
  standardColorIndex: number;
2549
3223
  }>;
3224
+ /** 语义色值 */
2550
3225
  semanticColors: {
2551
3226
  red: string;
2552
3227
  green: string;
2553
3228
  yellow: string;
2554
3229
  [key: string]: string;
2555
3230
  };
3231
+ /** 补充色值 */
2556
3232
  others?: {
2557
3233
  results: string;
2558
3234
  highlight: string;
@@ -2575,20 +3251,20 @@ declare type PanelIndexes = {
2575
3251
  declare class PanelScrollGroup extends GridGroup {
2576
3252
  protected mergedCellsGroup: Group;
2577
3253
  constructor(cfg: GridGroupConstructorParameters);
3254
+ getMergedCellsGroup(): Group;
2578
3255
  protected initMergedCellsGroup(): void;
2579
3256
  updateMergedCells(): void;
2580
3257
  addMergeCell(mergeCell: MergedCell): void;
2581
3258
  update(gridInfo: GridInfo): void;
2582
3259
  }
2583
3260
 
2584
- declare interface PartDrillDown<T = BaseDrillDownComponentProps> {
3261
+ declare interface PartDrillDown<T = BaseDrillDownComponentProps> extends Pick<HeaderActionIcon, 'displayCondition'> {
2585
3262
  drillConfig: T;
2586
3263
  drillItemsNum?: number;
2587
3264
  fetchData: (meta: Node_2, drillFields: string[]) => Promise<PartDrillDownInfo>;
2588
3265
  clearDrillDown?: {
2589
3266
  rowId: string;
2590
3267
  };
2591
- displayCondition?: (meta: Node_2) => boolean;
2592
3268
  }
2593
3269
 
2594
3270
  declare interface PartDrillDownFieldInLevel {
@@ -2619,20 +3295,20 @@ loading: BooleanConstructor;
2619
3295
  partDrillDown: ObjectConstructor;
2620
3296
  header: ObjectConstructor;
2621
3297
  options: {
2622
- type: PropType<S2Options<TooltipContentType, Pagination, string | Element, string>>;
2623
- default: S2Options<TooltipContentType, Pagination, string | Element, string>;
3298
+ type: PropType<S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>>;
3299
+ default: S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>;
2624
3300
  };
2625
3301
  adaptive: {
2626
3302
  type: PropType<Adaptive>;
2627
3303
  default: Adaptive;
2628
3304
  };
2629
- onSpreadsheet: PropType<(container: S2MountContainer, dataCfg: S2DataConfig, options: S2Options<TooltipContentType, Pagination, string | Element, string>) => SpreadSheet>;
3305
+ onSpreadsheet: PropType<(container: S2MountContainer, dataCfg: S2DataConfig, options: S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>) => SpreadSheet>;
2630
3306
  onMounted: PropType<(spreadsheet: SpreadSheet) => void>;
2631
3307
  }, {
2632
3308
  s2Ref: ShallowRef<SheetExpose>;
2633
- options: S2Options<TooltipContentType, Pagination, string | Element, string>;
3309
+ options: S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>;
2634
3310
  }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
2635
- spreadsheet: (container: S2MountContainer, dataCfg: S2DataConfig, options: S2Options<TooltipContentType, Pagination, string | Element, string>) => SpreadSheet;
3311
+ spreadsheet: (container: S2MountContainer, dataCfg: S2DataConfig, options: S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>) => SpreadSheet;
2636
3312
  sheetUpdate: SheetUpdateCallback;
2637
3313
  rowCellHover: (data: TargetCellInfo) => void;
2638
3314
  rowCellClick: (data: TargetCellInfo) => void;
@@ -2643,7 +3319,7 @@ rowCellMouseUp: (data: TargetCellInfo) => void;
2643
3319
  rowCellMouseMove: (data: TargetCellInfo) => void;
2644
3320
  rowCellCollapsed: (params: RowCellCollapsedParams) => void;
2645
3321
  rowCellAllCollapsed: (isCollapsed: boolean) => void;
2646
- rowCellScroll: (position: CellScrollPosition) => void;
3322
+ rowCellScroll: (position: Required<ScrollOffset>) => void;
2647
3323
  colCellHover: (data: TargetCellInfo) => void;
2648
3324
  colCellClick: (data: TargetCellInfo) => void;
2649
3325
  colCellDoubleClick: (data: TargetCellInfo) => void;
@@ -2664,7 +3340,7 @@ dataCellMouseDown: (data: TargetCellInfo) => void;
2664
3340
  dataCellMouseUp: (data: TargetCellInfo) => void;
2665
3341
  dataCellMouseMove: (data: TargetCellInfo) => void;
2666
3342
  dataCellBrushSelection: (brushRangeDataCells: DataCell[]) => void;
2667
- dataCellSelectMove: (metas: ViewMetaData[]) => void;
3343
+ dataCellSelectMove: (metaList: ViewMetaData[]) => void;
2668
3344
  cornerCellHover: (data: TargetCellInfo) => void;
2669
3345
  cornerCellClick: (data: TargetCellInfo) => void;
2670
3346
  cornerCellDoubleClick: (data: TargetCellInfo) => void;
@@ -2688,7 +3364,7 @@ filteredValues: string[];
2688
3364
  rangeFiltered: (data: ViewMetaData[]) => void;
2689
3365
  layoutAfterHeaderLayout: (layoutResult: LayoutResult) => void;
2690
3366
  layoutPagination: (data: LayoutPaginationParams) => void;
2691
- layoutCellMounted: (cell: S2CellType<ViewMeta>) => void;
3367
+ layoutCellMounted: (cell: S2CellType) => void;
2692
3368
  beforeRender: () => void;
2693
3369
  afterRender: () => void;
2694
3370
  mounted: (spreadsheet: SpreadSheet) => void;
@@ -2726,13 +3402,13 @@ mouseHover: (event: GEvent) => void;
2726
3402
  mouseUp: (event: MouseEvent) => void;
2727
3403
  mouseDown: (event: MouseEvent) => void;
2728
3404
  mouseMove: (event: MouseEvent) => void;
2729
- selected: (cells: S2CellType<ViewMeta>[]) => void;
3405
+ selected: (cells: S2CellType[]) => void;
2730
3406
  reset: (event: KeyboardEvent) => void;
2731
3407
  linkFieldJump: (data: {
2732
3408
  field: string;
2733
3409
  record: RawData;
2734
3410
  }) => void;
2735
- scroll: (position: CellScrollPosition) => void;
3411
+ scroll: (position: Required<ScrollOffset>) => void;
2736
3412
  layoutAfterRealDataCellRender: (options: {
2737
3413
  add: [number, number][];
2738
3414
  remove: [number, number][];
@@ -2758,14 +3434,14 @@ loading: BooleanConstructor;
2758
3434
  partDrillDown: ObjectConstructor;
2759
3435
  header: ObjectConstructor;
2760
3436
  options: {
2761
- type: PropType<S2Options<TooltipContentType, Pagination, string | Element, string>>;
2762
- default: S2Options<TooltipContentType, Pagination, string | Element, string>;
3437
+ type: PropType<S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>>;
3438
+ default: S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>;
2763
3439
  };
2764
3440
  adaptive: {
2765
3441
  type: PropType<Adaptive>;
2766
3442
  default: Adaptive;
2767
3443
  };
2768
- onSpreadsheet: PropType<(container: S2MountContainer, dataCfg: S2DataConfig, options: S2Options<TooltipContentType, Pagination, string | Element, string>) => SpreadSheet>;
3444
+ onSpreadsheet: PropType<(container: S2MountContainer, dataCfg: S2DataConfig, options: S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>) => SpreadSheet>;
2769
3445
  onMounted: PropType<(spreadsheet: SpreadSheet) => void>;
2770
3446
  }>> & {
2771
3447
  onSheetUpdate?: (params: S2RenderOptions) => any;
@@ -2778,7 +3454,7 @@ onRowCellMouseUp?: (data: TargetCellInfo) => any;
2778
3454
  onRowCellMouseMove?: (data: TargetCellInfo) => any;
2779
3455
  onRowCellCollapsed?: (params: RowCellCollapsedParams) => any;
2780
3456
  onRowCellAllCollapsed?: (isCollapsed: boolean) => any;
2781
- onRowCellScroll?: (position: CellScrollPosition) => any;
3457
+ onRowCellScroll?: (position: Required<ScrollOffset>) => any;
2782
3458
  onColCellHover?: (data: TargetCellInfo) => any;
2783
3459
  onColCellClick?: (data: TargetCellInfo) => any;
2784
3460
  onColCellDoubleClick?: (data: TargetCellInfo) => any;
@@ -2799,7 +3475,7 @@ onDataCellMouseDown?: (data: TargetCellInfo) => any;
2799
3475
  onDataCellMouseUp?: (data: TargetCellInfo) => any;
2800
3476
  onDataCellMouseMove?: (data: TargetCellInfo) => any;
2801
3477
  onDataCellBrushSelection?: (brushRangeDataCells: DataCell[]) => any;
2802
- onDataCellSelectMove?: (metas: ViewMetaData[]) => any;
3478
+ onDataCellSelectMove?: (metaList: ViewMetaData[]) => any;
2803
3479
  onCornerCellHover?: (data: TargetCellInfo) => any;
2804
3480
  onCornerCellClick?: (data: TargetCellInfo) => any;
2805
3481
  onCornerCellDoubleClick?: (data: TargetCellInfo) => any;
@@ -2823,7 +3499,7 @@ filteredValues: string[];
2823
3499
  onRangeFiltered?: (data: ViewMetaData[]) => any;
2824
3500
  onLayoutAfterHeaderLayout?: (layoutResult: LayoutResult) => any;
2825
3501
  onLayoutPagination?: (data: LayoutPaginationParams) => any;
2826
- onLayoutCellMounted?: (cell: S2CellType<ViewMeta>) => any;
3502
+ onLayoutCellMounted?: (cell: S2CellType) => any;
2827
3503
  onBeforeRender?: () => any;
2828
3504
  onAfterRender?: () => any;
2829
3505
  onMounted?: (spreadsheet: SpreadSheet) => any;
@@ -2861,13 +3537,13 @@ onMouseHover?: (event: GEvent) => any;
2861
3537
  onMouseUp?: (event: MouseEvent) => any;
2862
3538
  onMouseDown?: (event: MouseEvent) => any;
2863
3539
  onMouseMove?: (event: MouseEvent) => any;
2864
- onSelected?: (cells: S2CellType<ViewMeta>[]) => any;
3540
+ onSelected?: (cells: S2CellType[]) => any;
2865
3541
  onReset?: (event: KeyboardEvent) => any;
2866
3542
  onLinkFieldJump?: (data: {
2867
3543
  field: string;
2868
3544
  record: RawData;
2869
3545
  }) => any;
2870
- onScroll?: (position: CellScrollPosition) => any;
3546
+ onScroll?: (position: Required<ScrollOffset>) => any;
2871
3547
  onLayoutAfterRealDataCellRender?: (options: {
2872
3548
  add: [number, number][];
2873
3549
  remove: [number, number][];
@@ -2875,9 +3551,9 @@ spreadsheet: SpreadSheet;
2875
3551
  }) => any;
2876
3552
  onRowCellBrushSelection?: (event: GEvent) => any;
2877
3553
  onColCellBrushSelection?: (event: GEvent) => any;
2878
- onSpreadsheet?: (container: S2MountContainer, dataCfg: S2DataConfig, options: S2Options<TooltipContentType, Pagination, string | Element, string>) => any;
3554
+ onSpreadsheet?: (container: S2MountContainer, dataCfg: S2DataConfig, options: S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>) => any;
2879
3555
  }, {
2880
- options: S2Options<TooltipContentType, Pagination, string | Element, string>;
3556
+ options: S2Options<TooltipContentType, Pagination, BaseTooltipOperatorMenuOptions>;
2881
3557
  loading: boolean;
2882
3558
  adaptive: boolean | {
2883
3559
  width?: boolean;
@@ -2888,7 +3564,7 @@ showPagination: boolean | {
2888
3564
  onShowSizeChange?: (pageSize: number) => void;
2889
3565
  onChange?: (current: number) => void;
2890
3566
  };
2891
- }>;
3567
+ }, {}>;
2892
3568
 
2893
3569
  declare interface Point {
2894
3570
  x: number;
@@ -2909,27 +3585,49 @@ declare interface PropOption<T = any> {
2909
3585
 
2910
3586
  declare type Query = Record<string, any>;
2911
3587
 
3588
+ /** 子弹图状态颜色 */
2912
3589
  declare interface RangeColors {
3590
+ /** 满意 */
2913
3591
  good: string;
3592
+ /** 良好 */
2914
3593
  satisfactory: string;
3594
+ /** 不符合预期 */
2915
3595
  bad: string;
2916
3596
  }
2917
3597
 
2918
3598
  declare type RawData_2 = Record<string, DataItem>;
2919
3599
 
3600
+ declare interface RenderTextShapeOptions {
3601
+ /**
3602
+ * 只渲染文本, 不记录 textShape 信息
3603
+ */
3604
+ shallowRender: boolean;
3605
+ }
3606
+
2920
3607
  declare interface RequiredPropOption<T = any> {
2921
3608
  type?: PropType<T>;
2922
3609
  required: true;
2923
3610
  }
2924
3611
 
2925
3612
  declare interface ResizeArea {
3613
+ /** 热区尺寸 */
2926
3614
  size?: number;
3615
+ /** 热区背景色 */
2927
3616
  background?: string;
3617
+ /** 参考线颜色 */
2928
3618
  guideLineColor?: string;
3619
+ /** 参考线不可用颜色 */
2929
3620
  guideLineDisableColor?: string;
3621
+ /** 参考线间隔 */
2930
3622
  guideLineDash?: number[];
3623
+ /** 热区背景色透明度 */
2931
3624
  backgroundOpacity?: number;
3625
+ /** 交互态 */
2932
3626
  interactionState?: InteractionState;
3627
+ /** 单元格可拖拽最小宽度 */
3628
+ minCellWidth?: number;
3629
+ /** 单元格可拖拽最小高度 */
3630
+ minCellHeight?: number;
2933
3631
  }
2934
3632
 
2935
3633
  declare enum ResizeAreaEffect {
@@ -2965,7 +3663,7 @@ declare interface ResizeInfo_2 {
2965
3663
  isResizeArea?: boolean;
2966
3664
  isResizeMask?: boolean;
2967
3665
  /** 当前拖拽热区对应的节点信息 */
2968
- meta: Node_2_2 | ViewMeta_2;
3666
+ meta: Node_2_2 | ViewMeta;
2969
3667
  /** 拖拽后的宽度 */
2970
3668
  resizedWidth?: number;
2971
3669
  /** 拖拽后的高度 */
@@ -2985,7 +3683,9 @@ declare interface ResizeInteractionOptions {
2985
3683
  rowResizeType?: ResizeType;
2986
3684
  /** 列高调整时,影响当前列还是全部列 */
2987
3685
  colResizeType?: ResizeType;
3686
+ /** 是否允许调整, 返回 false 时拖拽的宽高无效 */
2988
3687
  disable?: (resizeInfo: ResizeInfo_2) => boolean;
3688
+ /** 是否显示热区 */
2989
3689
  visible?: (cell: S2CellType_2) => boolean;
2990
3690
  }
2991
3691
 
@@ -3013,7 +3713,7 @@ declare class RootInteraction {
3013
3713
  setState(interactionStateInfo: InteractionStateInfo): void;
3014
3714
  getState(): InteractionStateInfo;
3015
3715
  setInteractedCells(cell: S2CellType_2): void;
3016
- getInteractedCells(): S2CellType_2<ViewMeta_2>[];
3716
+ getInteractedCells(): S2CellType_2<ViewMeta>[];
3017
3717
  resetState(): void;
3018
3718
  getCurrentStateName(): InteractionStateName | undefined;
3019
3719
  isEqualStateName(stateName: InteractionStateName): boolean;
@@ -3024,22 +3724,16 @@ declare class RootInteraction {
3024
3724
  isHoverState(): boolean;
3025
3725
  isActiveCell(cell: S2CellType_2): boolean;
3026
3726
  isSelectedCell(cell: S2CellType_2): boolean;
3027
- getCells(cellType?: CellTypes[]): CellMeta[];
3727
+ getCells(cellType?: CellType[]): CellMeta[];
3028
3728
  getActiveCells(): S2CellType_2[];
3029
3729
  clearStyleIndependent(): void;
3030
- getPanelGroupAllUnSelectedDataCells(): DataCell_2[];
3031
- getPanelGroupAllDataCells(): DataCell_2[];
3032
- getAllRowHeaderCells(): RowCell[];
3033
- getAllColHeaderCells(): ColCell[];
3034
- getRowColActiveCells(ids: string[]): S2CellType_2<ViewMeta_2>[];
3035
- getAllCells(): S2CellType_2<ViewMeta_2>[];
3730
+ getUnSelectedDataCells(): DataCell_2[];
3036
3731
  selectAll: () => void;
3037
- getCellChildrenNodes: (cell: S2CellType_2) => Node_2_2[];
3038
3732
  selectHeaderCell: (selectHeaderCellInfo?: SelectHeaderCellInfo) => true | undefined;
3039
3733
  highlightNodes: (nodes?: Node_2_2[]) => void;
3040
3734
  mergeCells: (cellsInfo?: MergedCellInfo[], hideData?: boolean) => void;
3041
3735
  unmergeCell: (removedCells: MergedCell) => void;
3042
- hideColumns(hiddenColumnFields?: string[], forceRender?: boolean): void;
3736
+ hideColumns(hiddenColumnFields?: string[], forceRender?: boolean): Promise<void>;
3043
3737
  private getBrushSelectionInfo;
3044
3738
  private getDefaultInteractions;
3045
3739
  private registerInteractions;
@@ -3055,14 +3749,11 @@ declare class RootInteraction {
3055
3749
  clearHoverTimer(): void;
3056
3750
  setHoverTimer(timer: number): void;
3057
3751
  getHoverTimer(): number | null;
3058
- getSelectedCellHighlight(): InteractionCellSelectedHighlightType;
3752
+ getSelectedCellHighlight(): InteractionCellSelectedHighlightOptions;
3059
3753
  }
3060
3754
 
3061
- declare class RowCell extends HeaderCell {
3062
- protected headerConfig: RowHeaderConfig;
3063
- /** icon 绘制起始坐标 */
3064
- protected iconPosition: PointLike;
3065
- get cellType(): CellTypes;
3755
+ declare class RowCell extends HeaderCell<RowHeaderConfig> {
3756
+ get cellType(): CellType;
3066
3757
  protected getBorderPositions(): CellBorderPosition[];
3067
3758
  protected initCell(): void;
3068
3759
  protected showTreeIcon(): boolean;
@@ -3073,13 +3764,11 @@ declare class RowCell extends HeaderCell {
3073
3764
  protected drawTreeIcon(): void;
3074
3765
  protected drawTreeLeafNodeAlignDot(): void;
3075
3766
  protected isBolderText(): boolean;
3076
- protected drawTextShape(): void;
3077
- protected drawLinkFieldShape(): void;
3767
+ drawTextShape(options?: RenderTextShapeOptions): void;
3078
3768
  protected drawResizeAreaInLeaf(): void;
3079
3769
  protected getContentIndent(): number;
3080
3770
  protected getTextIndent(): number;
3081
3771
  protected isTreeLevel(): any;
3082
- protected getIconPosition(): PointLike;
3083
3772
  protected getMaxTextWidth(): number;
3084
3773
  protected getTextArea(): {
3085
3774
  x: number;
@@ -3124,7 +3813,8 @@ declare type RowData = Data | CellData[];
3124
3813
  * Row Header for SpreadSheet
3125
3814
  */
3126
3815
  declare class RowHeader extends BaseHeader<RowHeaderConfig> {
3127
- constructor(cfg: RowHeaderConfig);
3816
+ constructor(config: RowHeaderConfig);
3817
+ protected getCellInstance(node: Node_2_2): S2CellType_2;
3128
3818
  protected layout(): void;
3129
3819
  protected offset(): void;
3130
3820
  protected clip(): void;
@@ -3132,7 +3822,7 @@ declare class RowHeader extends BaseHeader<RowHeaderConfig> {
3132
3822
 
3133
3823
  declare type RowHeaderConfig = BaseHeaderConfig;
3134
3824
 
3135
- declare interface S2BasicOptions<T = TooltipContentType_2, P = Pagination_2, Icon = Element | string, Text = string> {
3825
+ declare interface S2BasicOptions<T = TooltipContentType_2, P = Pagination_2, Menu = BaseTooltipOperatorMenuOptions_2> {
3136
3826
  /**
3137
3827
  * 表格宽度
3138
3828
  */
@@ -3147,14 +3837,17 @@ declare interface S2BasicOptions<T = TooltipContentType_2, P = Pagination_2, Ico
3147
3837
  debug?: boolean;
3148
3838
  /**
3149
3839
  * 字段标记
3840
+ * @see https://s2.antv.antgroup.com/manual/basic/conditions
3150
3841
  */
3151
3842
  conditions?: Conditions | null;
3152
3843
  /**
3153
3844
  * 提示信息
3845
+ * @see https://s2.antv.antgroup.com/manual/basic/tooltip
3154
3846
  */
3155
- tooltip?: Tooltip<T, Icon, Text> | null;
3847
+ tooltip?: Tooltip<T, Menu> | null;
3156
3848
  /**
3157
3849
  * 交互配置
3850
+ * @see https://s2.antv.antgroup.com/manual/advanced/interaction/basic
3158
3851
  */
3159
3852
  interaction?: InteractionOptions;
3160
3853
  /**
@@ -3175,82 +3868,110 @@ declare interface S2BasicOptions<T = TooltipContentType_2, P = Pagination_2, Ico
3175
3868
  showDefaultHeaderActionIcon?: boolean;
3176
3869
  /**
3177
3870
  * 自定义表头图标配置
3871
+ * @see https://s2.antv.antgroup.com/manual/advanced/custom/custom-icon
3178
3872
  */
3179
- headerActionIcons?: HeaderActionIcon[];
3873
+ headerActionIcons?: HeaderActionIcon_2[];
3180
3874
  /**
3181
3875
  * 自定义 SVG 图标
3876
+ * @see https://s2.antv.antgroup.com/manual/advanced/custom/custom-icon
3182
3877
  */
3183
3878
  customSVGIcons?: CustomSVGIcon[];
3184
3879
  /**
3185
3880
  * 表格单元格宽高配置
3881
+ * @see https://s2.antv.antgroup.com/manual/advanced/custom/cell-size
3186
3882
  */
3187
3883
  style?: S2Style;
3188
3884
  /**
3189
3885
  * 是否开启高清适配
3886
+ * @see https://s2.antv.antgroup.com/manual/advanced/hd-adapter
3190
3887
  */
3191
3888
  hdAdapter?: boolean;
3192
3889
  /**
3193
3890
  * 空值单元格占位符
3194
3891
  */
3195
3892
  placeholder?: ((meta: Record<string, any>) => string) | string;
3196
- /**
3197
- * 是否支持 CSS 的 transform 属性
3198
- */
3199
- supportCSSTransform?: boolean;
3200
- /**
3201
- * 自定义 DPR, 默认 "window.devicePixelRatio"
3202
- */
3203
- devicePixelRatio?: number;
3204
3893
  /**
3205
3894
  * 设备类型: pc / mobile
3206
3895
  */
3207
3896
  device?: DeviceType;
3897
+ /**
3898
+ * 自定义 AntV/G 渲染引擎配置参数 & 插件注册
3899
+ * @see https://g.antv.antgroup.com/plugins/intro
3900
+ * @see https://g.antv.antgroup.com/api/canvas/options
3901
+ * @example
3902
+ import { Plugin as PluginA11y } from '@antv/g-plugin-a11y';
3903
+
3904
+ transformCanvasConfig(renderer) {
3905
+ console.log('当前已注册插件:', renderer.getPlugins(), renderer.getConfig());
3906
+ renderer.registerPlugin(new PluginA11y({ enableExtractingText: true }));
3907
+
3908
+ return {
3909
+ supportsCSSTransform: true,
3910
+ };
3911
+ },
3912
+ */
3913
+ transformCanvasConfig?: (renderer: CanvasConfig['renderer'], spreadsheet: SpreadSheet_2) => (Partial<CanvasConfig> | null | undefined) | void;
3208
3914
  /** *********** 自定义单元格 hooks **************** */
3209
3915
  /**
3210
3916
  * 自定义数值单元格
3917
+ * @see https://s2.antv.antgroup.com/examples/custom/custom-cell#data-cell
3211
3918
  */
3212
3919
  dataCell?: DataCellCallback;
3213
3920
  /**
3214
3921
  * 自定义角头单元格
3922
+ * @see https://s2.antv.antgroup.com/examples/custom/custom-cell#corner-cell
3215
3923
  */
3216
3924
  cornerCell?: CellCallback<CornerHeaderConfig>;
3217
3925
  /**
3218
3926
  * 自定义序号单元格
3927
+ * @see https://s2.antv.antgroup.com/examples/custom/custom-cell#series-number-cell
3219
3928
  */
3220
3929
  seriesNumberCell?: CellCallback<BaseHeaderConfig>;
3221
3930
  /**
3222
3931
  * 自定义行头单元格
3932
+ * @see https://s2.antv.antgroup.com/examples/custom/custom-cell#row-cell
3223
3933
  */
3224
3934
  rowCell?: CellCallback<RowHeaderConfig>;
3225
3935
  /**
3226
3936
  * 自定义列头单元格
3937
+ * @see https://s2.antv.antgroup.com/examples/custom/custom-cell#col-cell
3227
3938
  */
3228
3939
  colCell?: CellCallback<ColHeaderConfig>;
3940
+ /**
3941
+ * 自定义合并单元格
3942
+ */
3943
+ mergedCell?: MergedCellCallback;
3229
3944
  /**
3230
3945
  * 自定义表格框架/边框
3946
+ * @see https://s2.antv.antgroup.com/examples/case/comparison#measure-comparison
3231
3947
  */
3232
3948
  frame?: FrameCallback;
3233
3949
  /**
3234
3950
  * 自定义角头
3951
+ * @see https://s2.antv.antgroup.com/zh/examples/custom/custom-cell/#corner-header
3235
3952
  */
3236
3953
  cornerHeader?: CornerHeaderCallback;
3237
3954
  /** *********** 自定义布局 hooks **************** */
3238
3955
  /**
3239
3956
  * 自定义单元格层级, 动态增加/删除单元格
3957
+ * @see https://s2.antv.antgroup.com/examples/custom/custom-layout#custom-layout-hierarchy
3240
3958
  */
3241
3959
  layoutHierarchy?: LayoutHierarchy;
3242
3960
  /**
3243
3961
  * 自定义节点排列顺序 (树状模式有效)
3962
+ * @see https://s2.antv.antgroup.com/examples/custom/custom-layout#custom-layout-arrange
3244
3963
  */
3245
3964
  layoutArrange?: LayoutArrange;
3246
3965
  /**
3247
3966
  * 自定义单元格对应节点坐标/宽高
3967
+ * @see https://s2.antv.antgroup.com/examples/custom/custom-layout#custom-layout-coordinate
3248
3968
  */
3249
3969
  layoutCoordinate?: LayoutCoordinate;
3250
3970
  /**
3251
- * 自定义数据坐标, 动态修改单元格数值
3971
+ * 自定义单元格对应元数据
3972
+ * @see https://s2.antv.antgroup.com/zh/examples/custom/custom-layout/#custom-data-position
3252
3973
  */
3253
- layoutDataPosition?: LayoutDataPosition;
3974
+ layoutCellMeta?: LayoutCellMeta;
3254
3975
  /**
3255
3976
  * 自定义序号节点
3256
3977
  */
@@ -3260,9 +3981,13 @@ declare interface S2BasicOptions<T = TooltipContentType_2, P = Pagination_2, Ico
3260
3981
  * 自定义数据集
3261
3982
  */
3262
3983
  dataSet?: (spreadsheet: SpreadSheet_2) => BaseDataSet_2;
3984
+ /**
3985
+ * 自定义分面
3986
+ */
3987
+ facet?: (spreadsheet: SpreadSheet_2) => BaseFacet;
3263
3988
  }
3264
3989
 
3265
- declare type S2CellType_2<T extends SimpleBBox = ViewMeta_2> = DataCell_2 | HeaderCell | ColCell | CornerCell | RowCell | SeriesNumberCell | MergedCell | TableCornerCell | TableSeriesCell | BaseCell<T>;
3990
+ declare type S2CellType_2<T extends SimpleBBox = ViewMeta> = DataCell_2 | HeaderCell | ColCell | CornerCell | RowCell | SeriesNumberCell | MergedCell | TableCornerCell | TableSeriesNumberCell | BaseCell<T>;
3266
3991
 
3267
3992
  declare interface S2DataConfig_2 {
3268
3993
  /**
@@ -3391,7 +4116,10 @@ declare interface S2EventHandler {
3391
4116
 
3392
4117
  declare type S2MountContainer_2 = string | Element;
3393
4118
 
3394
- declare interface S2Options_2<T = TooltipContentType_2, P = Pagination_2, Icon = Element | string, Text = string> extends S2BasicOptions<T, P, Icon, Text>, S2PivotSheetOptions {
4119
+ declare interface S2Options_2<T = TooltipContentType_2, P = Pagination_2, Menu = BaseTooltipOperatorMenuOptions_2> extends S2BasicOptions<T, P, Menu>, S2PivotSheetOptions {
4120
+ /**
4121
+ * 行列冻结
4122
+ */
3395
4123
  frozen?: S2PivotSheetFrozenOptions & S2TableSheetFrozenOptions;
3396
4124
  }
3397
4125
 
@@ -3411,10 +4139,12 @@ declare interface S2PivotSheetOptions {
3411
4139
  hierarchyType?: 'grid' | 'tree';
3412
4140
  /**
3413
4141
  * 小计/总计配置
4142
+ * @see https://s2.antv.antgroup.com/manual/basic/totals
3414
4143
  */
3415
4144
  totals?: Totals | null;
3416
4145
  /**
3417
4146
  * 合并单元格配置
4147
+ * @see https://s2.antv.antgroup.com/manual/advanced/interaction/merge-cell
3418
4148
  */
3419
4149
  mergedCellsInfo?: MergedCellInfo[][];
3420
4150
  /**
@@ -3481,10 +4211,15 @@ declare interface S2TableSheetFrozenOptions {
3481
4211
  }
3482
4212
 
3483
4213
  declare interface S2Theme extends CellThemes {
4214
+ /** 列宽行高调整热区 */
3484
4215
  resizeArea?: ResizeArea;
4216
+ /** 滚动条样式 */
3485
4217
  scrollBar?: ScrollBarTheme;
4218
+ /** 分割线样式 */
3486
4219
  splitLine?: SplitLine;
4220
+ /** 刷选遮罩 */
3487
4221
  prepareSelectMask?: InteractionStateTheme;
4222
+ /** 画布背景底色 */
3488
4223
  background?: Background;
3489
4224
  }
3490
4225
 
@@ -3565,21 +4300,28 @@ declare enum ScrollbarPositionType {
3565
4300
  }
3566
4301
 
3567
4302
  declare interface ScrollBarTheme {
4303
+ /** 滚动条轨道颜色 */
3568
4304
  trackColor?: string;
4305
+ /** 滚动条 hover 态颜色 */
3569
4306
  thumbHoverColor?: string;
4307
+ /** 滚动条颜色 */
3570
4308
  thumbColor?: string;
4309
+ /** 滚动条水平最小尺寸 */
3571
4310
  thumbHorizontalMinSize?: number;
4311
+ /** 滚动条垂直最小尺寸 */
3572
4312
  thumbVerticalMinSize?: number;
4313
+ /** 滚动条尺寸 */
3573
4314
  size?: number;
4315
+ /** 滚动条 hover 态尺寸 */
3574
4316
  hoverSize?: number;
3575
4317
  /** 指定如何绘制每一条线段末端,lineCap?: 'butt' | 'round' | 'square'; */
3576
4318
  lineCap?: LineStyleProps['lineCap'];
3577
4319
  }
3578
4320
 
3579
- declare interface ScrollOffset {
4321
+ declare interface ScrollOffset_2 {
3580
4322
  scrollX?: number;
3581
4323
  scrollY?: number;
3582
- hRowScrollX?: number;
4324
+ rowHeaderScrollX?: number;
3583
4325
  }
3584
4326
 
3585
4327
  declare interface ScrollSpeedRatio {
@@ -3590,19 +4332,21 @@ declare interface ScrollSpeedRatio {
3590
4332
  declare type SelectedHandler = (cells: S2CellType_2[]) => void;
3591
4333
 
3592
4334
  declare interface SelectHeaderCellInfo {
3593
- cell: S2CellType_2<ViewMeta_2>;
4335
+ cell: S2CellType_2<ViewMeta>;
3594
4336
  isMultiSelection?: boolean;
3595
4337
  }
3596
4338
 
3597
4339
  declare class SeriesNumberCell extends BaseCell<Node_2_2> {
3598
4340
  protected headerConfig: BaseHeaderConfig;
3599
4341
  protected handleRestOptions(...[headerConfig]: [BaseHeaderConfig]): void;
3600
- get cellType(): CellTypes;
4342
+ getHeaderConfig(): BaseHeaderConfig;
4343
+ get cellType(): CellType;
3601
4344
  protected getBorderPositions(): CellBorderPosition[];
3602
4345
  protected initCell(): void;
3603
4346
  protected getBackgroundColor(): {
3604
- backgroundColor: string | undefined;
3605
- backgroundColorOpacity: number | undefined;
4347
+ backgroundColor: string;
4348
+ backgroundColorOpacity: number;
4349
+ intelligentReverseTextColor: boolean;
3606
4350
  };
3607
4351
  update(): void;
3608
4352
  protected getTextStyle(): TextTheme;
@@ -3610,10 +4354,13 @@ declare class SeriesNumberCell extends BaseCell<Node_2_2> {
3610
4354
  protected getMaxTextWidth(): number;
3611
4355
  protected getTextPosition(): PointLike;
3612
4356
  protected findFieldCondition(): Condition | undefined;
3613
- protected mappingValue(): MappingResult | undefined;
4357
+ protected mappingValue(): ConditionMappingResult | undefined;
4358
+ protected getIconPosition(): PointLike;
3614
4359
  }
3615
4360
 
3616
4361
  declare class SeriesNumberHeader extends BaseHeader<BaseHeaderConfig> {
4362
+ constructor(config: BaseHeaderConfig);
4363
+ protected getCellInstance(node: Node_2_2): S2CellType_2;
3617
4364
  /**
3618
4365
  * Get seriesNumber header by config
3619
4366
  */
@@ -3624,10 +4371,10 @@ declare class SeriesNumberHeader extends BaseHeader<BaseHeaderConfig> {
3624
4371
  spreadsheet: SpreadSheet_2;
3625
4372
  cornerWidth: number;
3626
4373
  }): SeriesNumberHeader;
3627
- constructor(cfg: BaseHeaderConfig);
3628
4374
  clip(): void;
3629
4375
  layout(): void;
3630
4376
  protected offset(): void;
4377
+ getNodes(): Node_2_2[];
3631
4378
  }
3632
4379
 
3633
4380
  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">, {
@@ -3650,20 +4397,20 @@ loading: BooleanConstructor;
3650
4397
  partDrillDown: ObjectConstructor;
3651
4398
  header: ObjectConstructor;
3652
4399
  options: {
3653
- type: PropType<S2Options_2<TooltipContentType_2, Pagination_2, string | Element, string>>;
3654
- default: S2Options_2<TooltipContentType_2, Pagination_2, string | Element, string>;
4400
+ type: PropType<S2Options_2<TooltipContentType_2, Pagination_2, BaseTooltipOperatorMenuOptions_2>>;
4401
+ default: S2Options_2<TooltipContentType_2, Pagination_2, BaseTooltipOperatorMenuOptions_2>;
3655
4402
  };
3656
4403
  adaptive: {
3657
4404
  type: PropType<Adaptive>;
3658
4405
  default: Adaptive;
3659
4406
  };
3660
- onSpreadsheet: PropType<(container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, string | Element, string>) => SpreadSheet_2>;
4407
+ onSpreadsheet: PropType<(container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, BaseTooltipOperatorMenuOptions_2>) => SpreadSheet_2>;
3661
4408
  onMounted: PropType<(spreadsheet: SpreadSheet_2) => void>;
3662
4409
  }, {
3663
4410
  s2Ref: ShallowRef<SheetExpose>;
3664
- options: S2Options_2<TooltipContentType_2, Pagination_2, string | Element, string>;
4411
+ options: S2Options_2<TooltipContentType_2, Pagination_2, BaseTooltipOperatorMenuOptions_2>;
3665
4412
  }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
3666
- spreadsheet: (container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, string | Element, string>) => SpreadSheet_2;
4413
+ spreadsheet: (container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, BaseTooltipOperatorMenuOptions_2>) => SpreadSheet_2;
3667
4414
  sheetUpdate: SheetUpdateCallback;
3668
4415
  rowCellHover: (data: TargetCellInfo_2) => void;
3669
4416
  rowCellClick: (data: TargetCellInfo_2) => void;
@@ -3674,7 +4421,7 @@ rowCellMouseUp: (data: TargetCellInfo_2) => void;
3674
4421
  rowCellMouseMove: (data: TargetCellInfo_2) => void;
3675
4422
  rowCellCollapsed: (params: RowCellCollapsedParams_2) => void;
3676
4423
  rowCellAllCollapsed: (isCollapsed: boolean) => void;
3677
- rowCellScroll: (position: CellScrollPosition_2) => void;
4424
+ rowCellScroll: (position: Required<ScrollOffset_2>) => void;
3678
4425
  colCellHover: (data: TargetCellInfo_2) => void;
3679
4426
  colCellClick: (data: TargetCellInfo_2) => void;
3680
4427
  colCellDoubleClick: (data: TargetCellInfo_2) => void;
@@ -3695,7 +4442,7 @@ dataCellMouseDown: (data: TargetCellInfo_2) => void;
3695
4442
  dataCellMouseUp: (data: TargetCellInfo_2) => void;
3696
4443
  dataCellMouseMove: (data: TargetCellInfo_2) => void;
3697
4444
  dataCellBrushSelection: (brushRangeDataCells: DataCell_2[]) => void;
3698
- dataCellSelectMove: (metas: ViewMetaData_2[]) => void;
4445
+ dataCellSelectMove: (metaList: ViewMetaData_2[]) => void;
3699
4446
  cornerCellHover: (data: TargetCellInfo_2) => void;
3700
4447
  cornerCellClick: (data: TargetCellInfo_2) => void;
3701
4448
  cornerCellDoubleClick: (data: TargetCellInfo_2) => void;
@@ -3719,7 +4466,7 @@ filteredValues: string[];
3719
4466
  rangeFiltered: (data: ViewMetaData_2[]) => void;
3720
4467
  layoutAfterHeaderLayout: (layoutResult: LayoutResult_2) => void;
3721
4468
  layoutPagination: (data: LayoutPaginationParams) => void;
3722
- layoutCellMounted: (cell: S2CellType_2<ViewMeta_2>) => void;
4469
+ layoutCellMounted: (cell: S2CellType_2) => void;
3723
4470
  beforeRender: () => void;
3724
4471
  afterRender: () => void;
3725
4472
  mounted: (spreadsheet: SpreadSheet_2) => void;
@@ -3757,13 +4504,13 @@ mouseHover: (event: FederatedPointerEvent) => void;
3757
4504
  mouseUp: (event: MouseEvent) => void;
3758
4505
  mouseDown: (event: MouseEvent) => void;
3759
4506
  mouseMove: (event: MouseEvent) => void;
3760
- selected: (cells: S2CellType_2<ViewMeta_2>[]) => void;
4507
+ selected: (cells: S2CellType_2[]) => void;
3761
4508
  reset: (event: KeyboardEvent) => void;
3762
4509
  linkFieldJump: (data: {
3763
4510
  field: string;
3764
4511
  record: RawData_2;
3765
4512
  }) => void;
3766
- scroll: (position: CellScrollPosition_2) => void;
4513
+ scroll: (position: Required<ScrollOffset_2>) => void;
3767
4514
  layoutAfterRealDataCellRender: (options: {
3768
4515
  add: [number, number][];
3769
4516
  remove: [number, number][];
@@ -3789,14 +4536,14 @@ loading: BooleanConstructor;
3789
4536
  partDrillDown: ObjectConstructor;
3790
4537
  header: ObjectConstructor;
3791
4538
  options: {
3792
- type: PropType<S2Options_2<TooltipContentType_2, Pagination_2, string | Element, string>>;
3793
- default: S2Options_2<TooltipContentType_2, Pagination_2, string | Element, string>;
4539
+ type: PropType<S2Options_2<TooltipContentType_2, Pagination_2, BaseTooltipOperatorMenuOptions_2>>;
4540
+ default: S2Options_2<TooltipContentType_2, Pagination_2, BaseTooltipOperatorMenuOptions_2>;
3794
4541
  };
3795
4542
  adaptive: {
3796
4543
  type: PropType<Adaptive>;
3797
4544
  default: Adaptive;
3798
4545
  };
3799
- onSpreadsheet: PropType<(container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, string | Element, string>) => SpreadSheet_2>;
4546
+ onSpreadsheet: PropType<(container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, BaseTooltipOperatorMenuOptions_2>) => SpreadSheet_2>;
3800
4547
  onMounted: PropType<(spreadsheet: SpreadSheet_2) => void>;
3801
4548
  }>> & {
3802
4549
  onSheetUpdate?: (params: S2RenderOptions_2) => any;
@@ -3809,7 +4556,7 @@ onRowCellMouseUp?: (data: TargetCellInfo_2) => any;
3809
4556
  onRowCellMouseMove?: (data: TargetCellInfo_2) => any;
3810
4557
  onRowCellCollapsed?: (params: RowCellCollapsedParams_2) => any;
3811
4558
  onRowCellAllCollapsed?: (isCollapsed: boolean) => any;
3812
- onRowCellScroll?: (position: CellScrollPosition_2) => any;
4559
+ onRowCellScroll?: (position: Required<ScrollOffset_2>) => any;
3813
4560
  onColCellHover?: (data: TargetCellInfo_2) => any;
3814
4561
  onColCellClick?: (data: TargetCellInfo_2) => any;
3815
4562
  onColCellDoubleClick?: (data: TargetCellInfo_2) => any;
@@ -3830,7 +4577,7 @@ onDataCellMouseDown?: (data: TargetCellInfo_2) => any;
3830
4577
  onDataCellMouseUp?: (data: TargetCellInfo_2) => any;
3831
4578
  onDataCellMouseMove?: (data: TargetCellInfo_2) => any;
3832
4579
  onDataCellBrushSelection?: (brushRangeDataCells: DataCell_2[]) => any;
3833
- onDataCellSelectMove?: (metas: ViewMetaData_2[]) => any;
4580
+ onDataCellSelectMove?: (metaList: ViewMetaData_2[]) => any;
3834
4581
  onCornerCellHover?: (data: TargetCellInfo_2) => any;
3835
4582
  onCornerCellClick?: (data: TargetCellInfo_2) => any;
3836
4583
  onCornerCellDoubleClick?: (data: TargetCellInfo_2) => any;
@@ -3854,7 +4601,7 @@ filteredValues: string[];
3854
4601
  onRangeFiltered?: (data: ViewMetaData_2[]) => any;
3855
4602
  onLayoutAfterHeaderLayout?: (layoutResult: LayoutResult_2) => any;
3856
4603
  onLayoutPagination?: (data: LayoutPaginationParams) => any;
3857
- onLayoutCellMounted?: (cell: S2CellType_2<ViewMeta_2>) => any;
4604
+ onLayoutCellMounted?: (cell: S2CellType_2) => any;
3858
4605
  onBeforeRender?: () => any;
3859
4606
  onAfterRender?: () => any;
3860
4607
  onMounted?: (spreadsheet: SpreadSheet_2) => any;
@@ -3892,13 +4639,13 @@ onMouseHover?: (event: FederatedPointerEvent) => any;
3892
4639
  onMouseUp?: (event: MouseEvent) => any;
3893
4640
  onMouseDown?: (event: MouseEvent) => any;
3894
4641
  onMouseMove?: (event: MouseEvent) => any;
3895
- onSelected?: (cells: S2CellType_2<ViewMeta_2>[]) => any;
4642
+ onSelected?: (cells: S2CellType_2[]) => any;
3896
4643
  onReset?: (event: KeyboardEvent) => any;
3897
4644
  onLinkFieldJump?: (data: {
3898
4645
  field: string;
3899
4646
  record: RawData_2;
3900
4647
  }) => any;
3901
- onScroll?: (position: CellScrollPosition_2) => any;
4648
+ onScroll?: (position: Required<ScrollOffset_2>) => any;
3902
4649
  onLayoutAfterRealDataCellRender?: (options: {
3903
4650
  add: [number, number][];
3904
4651
  remove: [number, number][];
@@ -3906,9 +4653,9 @@ spreadsheet: SpreadSheet_2;
3906
4653
  }) => any;
3907
4654
  onRowCellBrushSelection?: (event: FederatedPointerEvent) => any;
3908
4655
  onColCellBrushSelection?: (event: FederatedPointerEvent) => any;
3909
- onSpreadsheet?: (container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, string | Element, string>) => any;
4656
+ onSpreadsheet?: (container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, BaseTooltipOperatorMenuOptions_2>) => any;
3910
4657
  }, {
3911
- options: S2Options_2<TooltipContentType_2, Pagination_2, string | Element, string>;
4658
+ options: S2Options_2<TooltipContentType_2, Pagination_2, BaseTooltipOperatorMenuOptions_2>;
3912
4659
  loading: boolean;
3913
4660
  adaptive: boolean | {
3914
4661
  width?: boolean;
@@ -3919,10 +4666,10 @@ showPagination: boolean | {
3919
4666
  onShowSizeChange?: (pageSize: number) => void;
3920
4667
  onChange?: (current: number) => void;
3921
4668
  };
3922
- }> | 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">, {
4669
+ }, {}> | 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">, {
3923
4670
  s2Ref: ShallowRef<SheetExpose>;
3924
4671
  }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
3925
- spreadsheet: (container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, string | Element, string>) => SpreadSheet_2;
4672
+ spreadsheet: (container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, BaseTooltipOperatorMenuOptions_2>) => SpreadSheet_2;
3926
4673
  sheetUpdate: SheetUpdateCallback;
3927
4674
  rowCellHover: (data: TargetCellInfo_2) => void;
3928
4675
  rowCellClick: (data: TargetCellInfo_2) => void;
@@ -3933,7 +4680,7 @@ rowCellMouseUp: (data: TargetCellInfo_2) => void;
3933
4680
  rowCellMouseMove: (data: TargetCellInfo_2) => void;
3934
4681
  rowCellCollapsed: (params: RowCellCollapsedParams_2) => void;
3935
4682
  rowCellAllCollapsed: (isCollapsed: boolean) => void;
3936
- rowCellScroll: (position: CellScrollPosition_2) => void;
4683
+ rowCellScroll: (position: Required<ScrollOffset_2>) => void;
3937
4684
  colCellHover: (data: TargetCellInfo_2) => void;
3938
4685
  colCellClick: (data: TargetCellInfo_2) => void;
3939
4686
  colCellDoubleClick: (data: TargetCellInfo_2) => void;
@@ -3954,7 +4701,7 @@ dataCellMouseDown: (data: TargetCellInfo_2) => void;
3954
4701
  dataCellMouseUp: (data: TargetCellInfo_2) => void;
3955
4702
  dataCellMouseMove: (data: TargetCellInfo_2) => void;
3956
4703
  dataCellBrushSelection: (brushRangeDataCells: DataCell_2[]) => void;
3957
- dataCellSelectMove: (metas: ViewMetaData_2[]) => void;
4704
+ dataCellSelectMove: (metaList: ViewMetaData_2[]) => void;
3958
4705
  cornerCellHover: (data: TargetCellInfo_2) => void;
3959
4706
  cornerCellClick: (data: TargetCellInfo_2) => void;
3960
4707
  cornerCellDoubleClick: (data: TargetCellInfo_2) => void;
@@ -3978,7 +4725,7 @@ filteredValues: string[];
3978
4725
  rangeFiltered: (data: ViewMetaData_2[]) => void;
3979
4726
  layoutAfterHeaderLayout: (layoutResult: LayoutResult_2) => void;
3980
4727
  layoutPagination: (data: LayoutPaginationParams) => void;
3981
- layoutCellMounted: (cell: S2CellType_2<ViewMeta_2>) => void;
4728
+ layoutCellMounted: (cell: S2CellType_2) => void;
3982
4729
  beforeRender: () => void;
3983
4730
  afterRender: () => void;
3984
4731
  mounted: (spreadsheet: SpreadSheet_2) => void;
@@ -4016,13 +4763,13 @@ mouseHover: (event: FederatedPointerEvent) => void;
4016
4763
  mouseUp: (event: MouseEvent) => void;
4017
4764
  mouseDown: (event: MouseEvent) => void;
4018
4765
  mouseMove: (event: MouseEvent) => void;
4019
- selected: (cells: S2CellType_2<ViewMeta_2>[]) => void;
4766
+ selected: (cells: S2CellType_2[]) => void;
4020
4767
  reset: (event: KeyboardEvent) => void;
4021
4768
  linkFieldJump: (data: {
4022
4769
  field: string;
4023
4770
  record: RawData_2;
4024
4771
  }) => void;
4025
- scroll: (position: CellScrollPosition_2) => void;
4772
+ scroll: (position: Required<ScrollOffset_2>) => void;
4026
4773
  layoutAfterRealDataCellRender: (options: {
4027
4774
  add: [number, number][];
4028
4775
  remove: [number, number][];
@@ -4041,7 +4788,7 @@ onRowCellMouseUp?: (data: TargetCellInfo_2) => any;
4041
4788
  onRowCellMouseMove?: (data: TargetCellInfo_2) => any;
4042
4789
  onRowCellCollapsed?: (params: RowCellCollapsedParams_2) => any;
4043
4790
  onRowCellAllCollapsed?: (isCollapsed: boolean) => any;
4044
- onRowCellScroll?: (position: CellScrollPosition_2) => any;
4791
+ onRowCellScroll?: (position: Required<ScrollOffset_2>) => any;
4045
4792
  onColCellHover?: (data: TargetCellInfo_2) => any;
4046
4793
  onColCellClick?: (data: TargetCellInfo_2) => any;
4047
4794
  onColCellDoubleClick?: (data: TargetCellInfo_2) => any;
@@ -4062,7 +4809,7 @@ onDataCellMouseDown?: (data: TargetCellInfo_2) => any;
4062
4809
  onDataCellMouseUp?: (data: TargetCellInfo_2) => any;
4063
4810
  onDataCellMouseMove?: (data: TargetCellInfo_2) => any;
4064
4811
  onDataCellBrushSelection?: (brushRangeDataCells: DataCell_2[]) => any;
4065
- onDataCellSelectMove?: (metas: ViewMetaData_2[]) => any;
4812
+ onDataCellSelectMove?: (metaList: ViewMetaData_2[]) => any;
4066
4813
  onCornerCellHover?: (data: TargetCellInfo_2) => any;
4067
4814
  onCornerCellClick?: (data: TargetCellInfo_2) => any;
4068
4815
  onCornerCellDoubleClick?: (data: TargetCellInfo_2) => any;
@@ -4086,7 +4833,7 @@ filteredValues: string[];
4086
4833
  onRangeFiltered?: (data: ViewMetaData_2[]) => any;
4087
4834
  onLayoutAfterHeaderLayout?: (layoutResult: LayoutResult_2) => any;
4088
4835
  onLayoutPagination?: (data: LayoutPaginationParams) => any;
4089
- onLayoutCellMounted?: (cell: S2CellType_2<ViewMeta_2>) => any;
4836
+ onLayoutCellMounted?: (cell: S2CellType_2) => any;
4090
4837
  onBeforeRender?: () => any;
4091
4838
  onAfterRender?: () => any;
4092
4839
  onMounted?: (spreadsheet: SpreadSheet_2) => any;
@@ -4124,13 +4871,13 @@ onMouseHover?: (event: FederatedPointerEvent) => any;
4124
4871
  onMouseUp?: (event: MouseEvent) => any;
4125
4872
  onMouseDown?: (event: MouseEvent) => any;
4126
4873
  onMouseMove?: (event: MouseEvent) => any;
4127
- onSelected?: (cells: S2CellType_2<ViewMeta_2>[]) => any;
4874
+ onSelected?: (cells: S2CellType_2[]) => any;
4128
4875
  onReset?: (event: KeyboardEvent) => any;
4129
4876
  onLinkFieldJump?: (data: {
4130
4877
  field: string;
4131
4878
  record: RawData_2;
4132
4879
  }) => any;
4133
- onScroll?: (position: CellScrollPosition_2) => any;
4880
+ onScroll?: (position: Required<ScrollOffset_2>) => any;
4134
4881
  onLayoutAfterRealDataCellRender?: (options: {
4135
4882
  add: [number, number][];
4136
4883
  remove: [number, number][];
@@ -4138,10 +4885,10 @@ spreadsheet: SpreadSheet_2;
4138
4885
  }) => any;
4139
4886
  onRowCellBrushSelection?: (event: FederatedPointerEvent) => any;
4140
4887
  onColCellBrushSelection?: (event: FederatedPointerEvent) => any;
4141
- onSpreadsheet?: (container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, string | Element, string>) => any;
4142
- }, {}>>;
4888
+ onSpreadsheet?: (container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, BaseTooltipOperatorMenuOptions_2>) => any;
4889
+ }, {}, {}>>;
4143
4890
  }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
4144
- spreadsheet: (container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, string | Element, string>) => SpreadSheet_2;
4891
+ spreadsheet: (container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, BaseTooltipOperatorMenuOptions_2>) => SpreadSheet_2;
4145
4892
  sheetUpdate: SheetUpdateCallback;
4146
4893
  rowCellHover: (data: TargetCellInfo_2) => void;
4147
4894
  rowCellClick: (data: TargetCellInfo_2) => void;
@@ -4152,7 +4899,7 @@ rowCellMouseUp: (data: TargetCellInfo_2) => void;
4152
4899
  rowCellMouseMove: (data: TargetCellInfo_2) => void;
4153
4900
  rowCellCollapsed: (params: RowCellCollapsedParams_2) => void;
4154
4901
  rowCellAllCollapsed: (isCollapsed: boolean) => void;
4155
- rowCellScroll: (position: CellScrollPosition_2) => void;
4902
+ rowCellScroll: (position: Required<ScrollOffset_2>) => void;
4156
4903
  colCellHover: (data: TargetCellInfo_2) => void;
4157
4904
  colCellClick: (data: TargetCellInfo_2) => void;
4158
4905
  colCellDoubleClick: (data: TargetCellInfo_2) => void;
@@ -4173,7 +4920,7 @@ dataCellMouseDown: (data: TargetCellInfo_2) => void;
4173
4920
  dataCellMouseUp: (data: TargetCellInfo_2) => void;
4174
4921
  dataCellMouseMove: (data: TargetCellInfo_2) => void;
4175
4922
  dataCellBrushSelection: (brushRangeDataCells: DataCell_2[]) => void;
4176
- dataCellSelectMove: (metas: ViewMetaData_2[]) => void;
4923
+ dataCellSelectMove: (metaList: ViewMetaData_2[]) => void;
4177
4924
  cornerCellHover: (data: TargetCellInfo_2) => void;
4178
4925
  cornerCellClick: (data: TargetCellInfo_2) => void;
4179
4926
  cornerCellDoubleClick: (data: TargetCellInfo_2) => void;
@@ -4197,7 +4944,7 @@ filteredValues: string[];
4197
4944
  rangeFiltered: (data: ViewMetaData_2[]) => void;
4198
4945
  layoutAfterHeaderLayout: (layoutResult: LayoutResult_2) => void;
4199
4946
  layoutPagination: (data: LayoutPaginationParams) => void;
4200
- layoutCellMounted: (cell: S2CellType_2<ViewMeta_2>) => void;
4947
+ layoutCellMounted: (cell: S2CellType_2) => void;
4201
4948
  beforeRender: () => void;
4202
4949
  afterRender: () => void;
4203
4950
  mounted: (spreadsheet: SpreadSheet_2) => void;
@@ -4235,13 +4982,13 @@ mouseHover: (event: FederatedPointerEvent) => void;
4235
4982
  mouseUp: (event: MouseEvent) => void;
4236
4983
  mouseDown: (event: MouseEvent) => void;
4237
4984
  mouseMove: (event: MouseEvent) => void;
4238
- selected: (cells: S2CellType_2<ViewMeta_2>[]) => void;
4985
+ selected: (cells: S2CellType_2[]) => void;
4239
4986
  reset: (event: KeyboardEvent) => void;
4240
4987
  linkFieldJump: (data: {
4241
4988
  field: string;
4242
4989
  record: RawData_2;
4243
4990
  }) => void;
4244
- scroll: (position: CellScrollPosition_2) => void;
4991
+ scroll: (position: Required<ScrollOffset_2>) => void;
4245
4992
  layoutAfterRealDataCellRender: (options: {
4246
4993
  add: [number, number][];
4247
4994
  remove: [number, number][];
@@ -4260,7 +5007,7 @@ onRowCellMouseUp?: (data: TargetCellInfo_2) => any;
4260
5007
  onRowCellMouseMove?: (data: TargetCellInfo_2) => any;
4261
5008
  onRowCellCollapsed?: (params: RowCellCollapsedParams_2) => any;
4262
5009
  onRowCellAllCollapsed?: (isCollapsed: boolean) => any;
4263
- onRowCellScroll?: (position: CellScrollPosition_2) => any;
5010
+ onRowCellScroll?: (position: Required<ScrollOffset_2>) => any;
4264
5011
  onColCellHover?: (data: TargetCellInfo_2) => any;
4265
5012
  onColCellClick?: (data: TargetCellInfo_2) => any;
4266
5013
  onColCellDoubleClick?: (data: TargetCellInfo_2) => any;
@@ -4281,7 +5028,7 @@ onDataCellMouseDown?: (data: TargetCellInfo_2) => any;
4281
5028
  onDataCellMouseUp?: (data: TargetCellInfo_2) => any;
4282
5029
  onDataCellMouseMove?: (data: TargetCellInfo_2) => any;
4283
5030
  onDataCellBrushSelection?: (brushRangeDataCells: DataCell_2[]) => any;
4284
- onDataCellSelectMove?: (metas: ViewMetaData_2[]) => any;
5031
+ onDataCellSelectMove?: (metaList: ViewMetaData_2[]) => any;
4285
5032
  onCornerCellHover?: (data: TargetCellInfo_2) => any;
4286
5033
  onCornerCellClick?: (data: TargetCellInfo_2) => any;
4287
5034
  onCornerCellDoubleClick?: (data: TargetCellInfo_2) => any;
@@ -4305,7 +5052,7 @@ filteredValues: string[];
4305
5052
  onRangeFiltered?: (data: ViewMetaData_2[]) => any;
4306
5053
  onLayoutAfterHeaderLayout?: (layoutResult: LayoutResult_2) => any;
4307
5054
  onLayoutPagination?: (data: LayoutPaginationParams) => any;
4308
- onLayoutCellMounted?: (cell: S2CellType_2<ViewMeta_2>) => any;
5055
+ onLayoutCellMounted?: (cell: S2CellType_2) => any;
4309
5056
  onBeforeRender?: () => any;
4310
5057
  onAfterRender?: () => any;
4311
5058
  onMounted?: (spreadsheet: SpreadSheet_2) => any;
@@ -4343,13 +5090,13 @@ onMouseHover?: (event: FederatedPointerEvent) => any;
4343
5090
  onMouseUp?: (event: MouseEvent) => any;
4344
5091
  onMouseDown?: (event: MouseEvent) => any;
4345
5092
  onMouseMove?: (event: MouseEvent) => any;
4346
- onSelected?: (cells: S2CellType_2<ViewMeta_2>[]) => any;
5093
+ onSelected?: (cells: S2CellType_2[]) => any;
4347
5094
  onReset?: (event: KeyboardEvent) => any;
4348
5095
  onLinkFieldJump?: (data: {
4349
5096
  field: string;
4350
5097
  record: RawData_2;
4351
5098
  }) => any;
4352
- onScroll?: (position: CellScrollPosition_2) => any;
5099
+ onScroll?: (position: Required<ScrollOffset_2>) => any;
4353
5100
  onLayoutAfterRealDataCellRender?: (options: {
4354
5101
  add: [number, number][];
4355
5102
  remove: [number, number][];
@@ -4357,8 +5104,8 @@ spreadsheet: SpreadSheet_2;
4357
5104
  }) => any;
4358
5105
  onRowCellBrushSelection?: (event: FederatedPointerEvent) => any;
4359
5106
  onColCellBrushSelection?: (event: FederatedPointerEvent) => any;
4360
- onSpreadsheet?: (container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, string | Element, string>) => any;
4361
- }, {}>;
5107
+ onSpreadsheet?: (container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, BaseTooltipOperatorMenuOptions_2>) => any;
5108
+ }, {}, {}>;
4362
5109
 
4363
5110
  declare type SheetComponentOptions = S2Options<TooltipContentType, Pagination & PaginationProps>;
4364
5111
 
@@ -4383,8 +5130,9 @@ declare interface SimpleBBox {
4383
5130
  declare type SimpleData = string | number | null;
4384
5131
 
4385
5132
  declare interface Sort {
4386
- /** 字段id,业务中一般是displayId */
5133
+ /** 字段id */
4387
5134
  sortFieldId: string;
5135
+ /** 排序方式 */
4388
5136
  sortMethod?: SortMethod;
4389
5137
  /** 自定义排序 */
4390
5138
  sortBy?: string[];
@@ -4405,45 +5153,70 @@ declare interface SortFuncParam extends Sort {
4405
5153
  declare type SortMethod = 'ASC' | 'DESC' | 'asc' | 'desc';
4406
5154
 
4407
5155
  declare interface SortParam extends Sort {
4408
- /** 自定义func */
5156
+ /** 自定义排序 */
4409
5157
  sortFunc?: (param: SortFuncParam) => Array<string | Record<string, any>>;
4410
5158
  }
4411
5159
 
4412
5160
  declare type SortParams_2 = SortParam[];
4413
5161
 
4414
5162
  declare interface SplitLine {
5163
+ /** 水平分割线颜色 */
4415
5164
  horizontalBorderColor?: string;
5165
+ /** 水平分割线颜色透明度 */
4416
5166
  horizontalBorderColorOpacity?: number;
5167
+ /** 水平分割线宽度 */
4417
5168
  horizontalBorderWidth?: number;
5169
+ /** 垂直分割线颜色 */
4418
5170
  verticalBorderColor?: string;
5171
+ /** 垂直分割线颜色透明度 */
4419
5172
  verticalBorderColorOpacity?: number;
5173
+ /** 垂直分割线宽度 */
4420
5174
  verticalBorderWidth?: number;
5175
+ /** 分割线是否显示外阴影 */
4421
5176
  showShadow?: boolean;
5177
+ /** 阴影宽度 */
4422
5178
  shadowWidth?: number;
5179
+ /** 阴影线性渐变色 */
4423
5180
  shadowColors?: {
5181
+ /** 线性变化左侧颜色 */
4424
5182
  left: string;
5183
+ /** 线性变化右侧颜色 */
4425
5184
  right: string;
4426
5185
  };
4427
5186
  }
4428
5187
 
4429
5188
  declare abstract class SpreadSheet_2 extends EE {
4430
- theme: S2Theme;
5189
+ themeName: ThemeName;
5190
+ theme: InternalFullyTheme;
4431
5191
  store: Store;
4432
5192
  dataCfg: S2DataConfig_2;
4433
5193
  options: S2Options_2;
4434
5194
  dataSet: BaseDataSet_2;
4435
- /**
4436
- * Facet: determine how to render headers/cell
4437
- */
4438
5195
  facet: BaseFacet;
4439
5196
  tooltip: BaseTooltip_2;
4440
5197
  container: Canvas;
4441
5198
  interaction: RootInteraction;
4442
5199
  hdAdapter: HdAdapter;
5200
+ /**
5201
+ * 表格是否已销毁
5202
+ */
5203
+ private destroyed;
4443
5204
  private untypedOn;
4444
5205
  private untypedEmit;
4445
5206
  on: <K extends keyof EmitterType>(event: K, listener: EmitterType[K]) => this;
4446
5207
  emit: <K extends keyof EmitterType>(event: K, ...args: Parameters<EmitterType[K]>) => boolean;
5208
+ protected abstract bindEvents(): void;
5209
+ abstract getDataSet(): BaseDataSet_2;
5210
+ abstract enableFrozenHeaders(): boolean;
5211
+ abstract isPivotMode(): boolean;
5212
+ abstract isCustomRowFields(): boolean;
5213
+ abstract isHierarchyTreeType(): boolean;
5214
+ abstract isFrozenRowHeader(): boolean;
5215
+ abstract isTableMode(): boolean;
5216
+ abstract isValueInCols(): boolean;
5217
+ protected abstract buildFacet(): void;
5218
+ abstract clearDrillDownData(rowNodeId?: string, preventRender?: boolean): void;
5219
+ abstract groupSortByMethod(sortMethod: SortMethod, meta: Node_2_2): void;
4447
5220
  constructor(dom: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2 | null);
4448
5221
  isCustomHeaderFields(fieldType?: keyof Pick<Fields, 'columns' | 'rows'>): boolean;
4449
5222
  isCustomColumnFields(): boolean;
@@ -4456,38 +5229,8 @@ declare abstract class SpreadSheet_2 extends EE {
4456
5229
  private initInteraction;
4457
5230
  private initTooltip;
4458
5231
  private renderTooltip;
4459
- protected abstract bindEvents(): void;
4460
- abstract getDataSet(): BaseDataSet_2;
4461
- /**
4462
- * 是否开启冻结行列头效果
4463
- */
4464
- abstract enableFrozenHeaders(): boolean;
4465
- /**
4466
- * Check if is pivot mode
4467
- */
4468
- abstract isPivotMode(): boolean;
4469
- abstract isCustomRowFields(): boolean;
4470
- /**
4471
- * tree type must be in strategy mode
4472
- */
4473
- abstract isHierarchyTreeType(): boolean;
4474
- /**
4475
- * Scroll Freeze Row Header
4476
- */
4477
- abstract isFrozenRowHeader(): boolean;
4478
- /**
4479
- * Check if is pivot mode
4480
- */
4481
- abstract isTableMode(): boolean;
4482
- /**
4483
- * Check if the value is in the columns
4484
- */
4485
- abstract isValueInCols(): boolean;
4486
- protected abstract buildFacet(): void;
4487
- abstract clearDrillDownData(rowNodeId?: string, preventRender?: boolean): void;
4488
- abstract handleGroupSort(event: FederatedPointerEvent, meta: Node_2_2): void;
4489
- showTooltip<T = TooltipContentType_2>(showOptions: TooltipShowOptions<T>): void;
4490
- showTooltipWithInfo(event: FederatedPointerEvent | MouseEvent, data: TooltipData[], options?: TooltipOptions): void;
5232
+ showTooltip<T = TooltipContentType_2, Menu = BaseTooltipOperatorMenuOptions_2>(showOptions: TooltipShowOptions<T, Menu>): Promise<void>;
5233
+ showTooltipWithInfo(event: FederatedPointerEvent | MouseEvent, cellInfos: TooltipData[], options?: TooltipOptions): Promise<void> | void;
4491
5234
  hideTooltip(): void;
4492
5235
  destroyTooltip(): void;
4493
5236
  registerIcons(): void;
@@ -4500,10 +5243,19 @@ declare abstract class SpreadSheet_2 extends EE {
4500
5243
  */
4501
5244
  setDataCfg(dataCfg: S2DataConfig_2, reset?: boolean): void;
4502
5245
  setOptions(options: Partial<S2Options_2>, reset?: boolean): void;
4503
- render(reloadData?: boolean, options?: S2RenderOptions_2): void;
5246
+ private doRender;
5247
+ /**
5248
+ * 同步渲染
5249
+ * @deprecated 适配 g5.0 异步渲染过程中暂时保留
5250
+ */
5251
+ UNSAFE_render(reloadData?: boolean, options?: S2RenderOptions_2): void;
5252
+ render(reloadData?: boolean, options?: S2RenderOptions_2): Promise<void>;
4504
5253
  destroy(): void;
5254
+ private setThemeName;
4505
5255
  setThemeCfg(themeCfg?: ThemeCfg_2): void;
4506
5256
  setTheme(theme: S2Theme): void;
5257
+ getTheme(): InternalFullyTheme;
5258
+ getThemeName(): "default" | "colorful" | "gray" | "dark";
4507
5259
  /**
4508
5260
  * Update pagination config which store in {@see options}
4509
5261
  * @param pagination
@@ -4524,14 +5276,6 @@ declare abstract class SpreadSheet_2 extends EE {
4524
5276
  */
4525
5277
  getCanvasElement(): HTMLCanvasElement;
4526
5278
  getLayoutWidthType(): LayoutWidthType;
4527
- getRowNodes(level?: number): Node_2_2[];
4528
- getRowLeafNodes(): Node_2_2[];
4529
- /**
4530
- * get columnNode in levels,
4531
- * @param level -1 = get all
4532
- */
4533
- getColumnNodes(level?: number): Node_2_2[];
4534
- getColumnLeafNodes(): Node_2_2[];
4535
5279
  /**
4536
5280
  * Update scroll's offset, the value can be undefined,
4537
5281
  * indicate not update current value
@@ -4541,12 +5285,11 @@ declare abstract class SpreadSheet_2 extends EE {
4541
5285
  */
4542
5286
  updateScrollOffset(offsetConfig: OffsetConfig): void;
4543
5287
  getCell<T extends S2CellType_2 = S2CellType_2>(target: CellEventTarget): T | null;
4544
- getCellType(target: CellEventTarget): CellTypes | undefined;
5288
+ getCellType(target: CellEventTarget): CellType | undefined;
4545
5289
  /**
4546
- * get total's config by dimension id
4547
- * @param dimension unique dimension id
5290
+ * 获取当前维度对应的汇总配置
4548
5291
  */
4549
- getTotalsConfig(dimension: string): Partial<Totals['row']>;
5292
+ getTotalsConfig(dimension: string): Total;
4550
5293
  /**
4551
5294
  * Create all related groups, contains:
4552
5295
  * 1. container -- base canvas group
@@ -4558,8 +5301,6 @@ declare abstract class SpreadSheet_2 extends EE {
4558
5301
  */
4559
5302
  protected initContainer(dom: S2MountContainer_2): void;
4560
5303
  protected updateContainerStyle(): void;
4561
- getInitColumnLeafNodes(): Node_2_2[];
4562
- clearColumnLeafNodes(): void;
4563
5304
  private initHiddenColumnsDetail;
4564
5305
  private clearCanvasEvent;
4565
5306
  /**
@@ -4592,6 +5333,7 @@ declare abstract class SpreadSheet_2 extends EE {
4592
5333
  measureTextWidthRoughly: (text: any, font?: any) => number;
4593
5334
  updateSortMethodMap(nodeId: string, sortMethod: SortMethod, replace?: boolean): void;
4594
5335
  getMenuDefaultSelectedKeys(nodeId: string): string[];
5336
+ handleGroupSort(event: FederatedPointerEvent, meta: Node_2_2): void;
4595
5337
  }
4596
5338
 
4597
5339
  declare type StateShapeLayer = 'interactiveBgShape' | 'interactiveBorderShape';
@@ -4608,34 +5350,91 @@ declare class Store {
4608
5350
  size(): number;
4609
5351
  }
4610
5352
 
4611
- /**
4612
- * All stored keys need type define here
4613
- */
4614
5353
  declare interface StoreKey {
5354
+ /**
5355
+ * 水平滚动偏移
5356
+ */
4615
5357
  scrollX: number;
5358
+ /**
5359
+ * 垂直滚动偏移
5360
+ */
4616
5361
  scrollY: number;
4617
- hRowScrollX: number;
5362
+ /**
5363
+ * 行头水平滚动偏移
5364
+ */
5365
+ rowHeaderScrollX: number;
5366
+ /**
5367
+ * 列头点击排序配置
5368
+ */
4618
5369
  sortParam: SortParam;
5370
+ /**
5371
+ * 下钻节点id和对应生成的 path 寻址路径
5372
+ */
4619
5373
  drillDownIdPathMap: Map<string, DataPath[]>;
5374
+ /**
5375
+ * 当前下钻节点
5376
+ */
4620
5377
  drillDownNode: Node_2_2;
5378
+ /**
5379
+ * 下钻数据的个数控制
5380
+ */
4621
5381
  drillItemsNum: number;
5382
+ /**
5383
+ * 下钻节点层级信息
5384
+ */
4622
5385
  drillDownFieldInLevel: PartDrillDownFieldInLevel[];
5386
+ /**
5387
+ * 当前交互状态信息
5388
+ */
4623
5389
  interactionStateInfo: InteractionStateInfo;
5390
+ /**
5391
+ * 原始数据配置
5392
+ */
4624
5393
  originalDataCfg: S2DataConfig_2;
5394
+ /**
5395
+ * 可视区域包裹盒模型
5396
+ */
4625
5397
  panelBBox: BBox;
5398
+ /**
5399
+ * 当前调整大小区域 group
5400
+ */
4626
5401
  activeResizeArea: Group;
5402
+ /**
5403
+ * 条件格式值区间
5404
+ */
4627
5405
  valueRanges: ValueRanges;
4628
- initColumnLeafNodes: Node_2_2[] | undefined;
5406
+ /**
5407
+ * 初次渲染时的列头叶子节点
5408
+ */
5409
+ initColLeafNodes: Node_2_2[] | undefined;
4629
5410
  /**
4630
5411
  * 隐藏列详情
4631
5412
  * | a, b, [c,d 隐藏] [icon e ] , [f 隐藏], [icon g] |
4632
5413
  */
4633
5414
  hiddenColumnsDetail: HiddenColumnsInfo_2[];
5415
+ /**
5416
+ * 上一次渲染的列头
5417
+ */
4634
5418
  lastRenderedColumnFields: string[];
5419
+ /**
5420
+ * 是否手动调整过宽高
5421
+ */
4635
5422
  resized: boolean;
5423
+ /**
5424
+ * hover 显示的 icon 缓存
5425
+ */
4636
5426
  visibleActionIcons: GuiIcon[];
4637
- lastClickedCell: S2CellType_2<ViewMeta_2> | null;
5427
+ /**
5428
+ * 上一次点击的单元格
5429
+ */
5430
+ lastClickedCell: S2CellType_2<ViewMeta> | null;
5431
+ /**
5432
+ * 初始化时的边界滚动配置
5433
+ */
4638
5434
  initOverscrollBehavior: InteractionOptions['overscrollBehavior'];
5435
+ /**
5436
+ * 排序方式
5437
+ */
4639
5438
  sortMethodMap: Record<string, SortMethod> | null;
4640
5439
  [key: string]: unknown;
4641
5440
  }
@@ -4649,10 +5448,10 @@ declare class TableColCell extends ColCell {
4649
5448
  x: number;
4650
5449
  y: number;
4651
5450
  };
4652
- protected getColResizeArea(): Group | undefined;
5451
+ protected getColResizeArea(): Group_2 | undefined;
4653
5452
  protected isSortCell(): boolean;
4654
5453
  protected showSortIcon(): boolean | undefined;
4655
- protected getTextStyle(): TextTheme;
5454
+ protected getTextStyle(): DeepRequired<TextTheme>;
4656
5455
  protected getHorizontalResizeAreaName(): string;
4657
5456
  protected drawBackgroundShape(): void;
4658
5457
  protected handleViewport(viewport: AreaRange): AreaRange;
@@ -4664,22 +5463,21 @@ declare class TableCornerCell extends TableColCell {
4664
5463
  }
4665
5464
 
4666
5465
  declare class TableDataCell extends DataCell_2 {
4667
- protected drawTextShape(): void;
4668
- protected drawLinkFieldShape(): void;
5466
+ protected getLinkFieldStyle(): string;
4669
5467
  drawBorders(): void;
4670
5468
  protected shouldDrawResizeArea(): boolean;
4671
5469
  drawResizeArea(): void;
4672
5470
  }
4673
5471
 
4674
- declare class TableSeriesCell extends TableDataCell {
4675
- get cellType(): CellTypes;
5472
+ declare class TableSeriesNumberCell extends TableDataCell {
5473
+ get cellType(): CellType;
4676
5474
  protected getTextStyle(): TextTheme;
4677
5475
  }
4678
5476
 
4679
5477
  export declare const TableSheet: 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">, {
4680
5478
  s2Ref: ShallowRef<SheetExpose>;
4681
5479
  }, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
4682
- spreadsheet: (container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, string | Element, string>) => SpreadSheet_2;
5480
+ spreadsheet: (container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, BaseTooltipOperatorMenuOptions_2>) => SpreadSheet_2;
4683
5481
  sheetUpdate: SheetUpdateCallback;
4684
5482
  rowCellHover: (data: TargetCellInfo_2) => void;
4685
5483
  rowCellClick: (data: TargetCellInfo_2) => void;
@@ -4690,7 +5488,7 @@ rowCellMouseUp: (data: TargetCellInfo_2) => void;
4690
5488
  rowCellMouseMove: (data: TargetCellInfo_2) => void;
4691
5489
  rowCellCollapsed: (params: RowCellCollapsedParams_2) => void;
4692
5490
  rowCellAllCollapsed: (isCollapsed: boolean) => void;
4693
- rowCellScroll: (position: CellScrollPosition_2) => void;
5491
+ rowCellScroll: (position: Required<ScrollOffset_2>) => void;
4694
5492
  colCellHover: (data: TargetCellInfo_2) => void;
4695
5493
  colCellClick: (data: TargetCellInfo_2) => void;
4696
5494
  colCellDoubleClick: (data: TargetCellInfo_2) => void;
@@ -4711,7 +5509,7 @@ dataCellMouseDown: (data: TargetCellInfo_2) => void;
4711
5509
  dataCellMouseUp: (data: TargetCellInfo_2) => void;
4712
5510
  dataCellMouseMove: (data: TargetCellInfo_2) => void;
4713
5511
  dataCellBrushSelection: (brushRangeDataCells: DataCell_2[]) => void;
4714
- dataCellSelectMove: (metas: ViewMetaData_2[]) => void;
5512
+ dataCellSelectMove: (metaList: ViewMetaData_2[]) => void;
4715
5513
  cornerCellHover: (data: TargetCellInfo_2) => void;
4716
5514
  cornerCellClick: (data: TargetCellInfo_2) => void;
4717
5515
  cornerCellDoubleClick: (data: TargetCellInfo_2) => void;
@@ -4735,7 +5533,7 @@ filteredValues: string[];
4735
5533
  rangeFiltered: (data: ViewMetaData_2[]) => void;
4736
5534
  layoutAfterHeaderLayout: (layoutResult: LayoutResult_2) => void;
4737
5535
  layoutPagination: (data: LayoutPaginationParams) => void;
4738
- layoutCellMounted: (cell: S2CellType_2<ViewMeta_2>) => void;
5536
+ layoutCellMounted: (cell: S2CellType_2) => void;
4739
5537
  beforeRender: () => void;
4740
5538
  afterRender: () => void;
4741
5539
  mounted: (spreadsheet: SpreadSheet_2) => void;
@@ -4773,13 +5571,13 @@ mouseHover: (event: FederatedPointerEvent) => void;
4773
5571
  mouseUp: (event: MouseEvent) => void;
4774
5572
  mouseDown: (event: MouseEvent) => void;
4775
5573
  mouseMove: (event: MouseEvent) => void;
4776
- selected: (cells: S2CellType_2<ViewMeta_2>[]) => void;
5574
+ selected: (cells: S2CellType_2[]) => void;
4777
5575
  reset: (event: KeyboardEvent) => void;
4778
5576
  linkFieldJump: (data: {
4779
5577
  field: string;
4780
5578
  record: RawData_2;
4781
5579
  }) => void;
4782
- scroll: (position: CellScrollPosition_2) => void;
5580
+ scroll: (position: Required<ScrollOffset_2>) => void;
4783
5581
  layoutAfterRealDataCellRender: (options: {
4784
5582
  add: [number, number][];
4785
5583
  remove: [number, number][];
@@ -4798,7 +5596,7 @@ onRowCellMouseUp?: (data: TargetCellInfo_2) => any;
4798
5596
  onRowCellMouseMove?: (data: TargetCellInfo_2) => any;
4799
5597
  onRowCellCollapsed?: (params: RowCellCollapsedParams_2) => any;
4800
5598
  onRowCellAllCollapsed?: (isCollapsed: boolean) => any;
4801
- onRowCellScroll?: (position: CellScrollPosition_2) => any;
5599
+ onRowCellScroll?: (position: Required<ScrollOffset_2>) => any;
4802
5600
  onColCellHover?: (data: TargetCellInfo_2) => any;
4803
5601
  onColCellClick?: (data: TargetCellInfo_2) => any;
4804
5602
  onColCellDoubleClick?: (data: TargetCellInfo_2) => any;
@@ -4819,7 +5617,7 @@ onDataCellMouseDown?: (data: TargetCellInfo_2) => any;
4819
5617
  onDataCellMouseUp?: (data: TargetCellInfo_2) => any;
4820
5618
  onDataCellMouseMove?: (data: TargetCellInfo_2) => any;
4821
5619
  onDataCellBrushSelection?: (brushRangeDataCells: DataCell_2[]) => any;
4822
- onDataCellSelectMove?: (metas: ViewMetaData_2[]) => any;
5620
+ onDataCellSelectMove?: (metaList: ViewMetaData_2[]) => any;
4823
5621
  onCornerCellHover?: (data: TargetCellInfo_2) => any;
4824
5622
  onCornerCellClick?: (data: TargetCellInfo_2) => any;
4825
5623
  onCornerCellDoubleClick?: (data: TargetCellInfo_2) => any;
@@ -4843,7 +5641,7 @@ filteredValues: string[];
4843
5641
  onRangeFiltered?: (data: ViewMetaData_2[]) => any;
4844
5642
  onLayoutAfterHeaderLayout?: (layoutResult: LayoutResult_2) => any;
4845
5643
  onLayoutPagination?: (data: LayoutPaginationParams) => any;
4846
- onLayoutCellMounted?: (cell: S2CellType_2<ViewMeta_2>) => any;
5644
+ onLayoutCellMounted?: (cell: S2CellType_2) => any;
4847
5645
  onBeforeRender?: () => any;
4848
5646
  onAfterRender?: () => any;
4849
5647
  onMounted?: (spreadsheet: SpreadSheet_2) => any;
@@ -4881,13 +5679,13 @@ onMouseHover?: (event: FederatedPointerEvent) => any;
4881
5679
  onMouseUp?: (event: MouseEvent) => any;
4882
5680
  onMouseDown?: (event: MouseEvent) => any;
4883
5681
  onMouseMove?: (event: MouseEvent) => any;
4884
- onSelected?: (cells: S2CellType_2<ViewMeta_2>[]) => any;
5682
+ onSelected?: (cells: S2CellType_2[]) => any;
4885
5683
  onReset?: (event: KeyboardEvent) => any;
4886
5684
  onLinkFieldJump?: (data: {
4887
5685
  field: string;
4888
5686
  record: RawData_2;
4889
5687
  }) => any;
4890
- onScroll?: (position: CellScrollPosition_2) => any;
5688
+ onScroll?: (position: Required<ScrollOffset_2>) => any;
4891
5689
  onLayoutAfterRealDataCellRender?: (options: {
4892
5690
  add: [number, number][];
4893
5691
  remove: [number, number][];
@@ -4895,8 +5693,8 @@ spreadsheet: SpreadSheet_2;
4895
5693
  }) => any;
4896
5694
  onRowCellBrushSelection?: (event: FederatedPointerEvent) => any;
4897
5695
  onColCellBrushSelection?: (event: FederatedPointerEvent) => any;
4898
- onSpreadsheet?: (container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, string | Element, string>) => any;
4899
- }, {}>;
5696
+ onSpreadsheet?: (container: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2<TooltipContentType_2, Pagination_2, BaseTooltipOperatorMenuOptions_2>) => any;
5697
+ }, {}, {}>;
4900
5698
 
4901
5699
  declare interface TargetCellInfo_2 {
4902
5700
  target: S2CellType_2;
@@ -4913,40 +5711,47 @@ declare interface TextAlignStyle {
4913
5711
 
4914
5712
  declare type TextBaseline = 'top' | 'middle' | 'bottom';
4915
5713
 
4916
- declare interface TextTheme extends TextAlignStyle {
4917
- fontFamily?: string;
5714
+ declare interface TextCondition extends Condition<TextTheme> {
5715
+ position?: IconPosition;
5716
+ }
5717
+
5718
+ declare interface TextTheme extends TextAlignStyle, Pick<TextStyleProps, 'fontFamily' | 'fontSize' | 'fontWeight' | 'fill' | 'opacity' | 'wordWrap' | 'maxLines' | 'lineHeight' | 'textOverflow' | 'fontStyle' | 'fontVariant'> {
5719
+ /** 字体大小 */
4918
5720
  fontSize?: number;
4919
- fontWeight?: number | 'normal' | 'bold' | 'bolder' | 'lighter';
5721
+ /** 字体颜色 */
4920
5722
  fill?: string;
5723
+ /** 链接文本颜色 */
4921
5724
  linkTextFill?: string;
4922
- opacity?: number;
4923
5725
  }
4924
5726
 
4925
5727
  declare interface ThemeCfg_2 {
5728
+ /** 主题 */
4926
5729
  theme?: S2Theme;
5730
+ /** 色板 */
4927
5731
  palette?: Pick<Palette, 'basicColors' | 'semanticColors' | 'others'>;
5732
+ /** 主题名 */
4928
5733
  name?: ThemeName;
4929
5734
  }
4930
5735
 
4931
- declare type ThemeName = 'default' | 'colorful' | 'gray';
5736
+ declare type ThemeName = keyof typeof PALETTE_MAP;
4932
5737
 
4933
- declare interface Tooltip<T = TooltipContentType_2, Icon = Element | string, Text = string> extends BaseTooltipConfig<T, Icon, Text> {
5738
+ declare interface Tooltip<T = TooltipContentType_2, Menu = BaseTooltipOperatorMenuOptions_2> extends BaseTooltipConfig<T, Menu> {
4934
5739
  /**
4935
5740
  * Tooltip 行头单元格配置
4936
5741
  */
4937
- rowCell?: BaseTooltipConfig<T, Icon, Text>;
5742
+ rowCell?: BaseTooltipConfig<T, Menu>;
4938
5743
  /**
4939
5744
  * Tooltip 列头单元格配置
4940
5745
  */
4941
- colCell?: BaseTooltipConfig<T, Icon, Text>;
5746
+ colCell?: BaseTooltipConfig<T, Menu>;
4942
5747
  /**
4943
5748
  * Tooltip 角头单元格配置
4944
5749
  */
4945
- cornerCell?: BaseTooltipConfig<T, Icon, Text>;
5750
+ cornerCell?: BaseTooltipConfig<T, Menu>;
4946
5751
  /**
4947
5752
  * Tooltip 数值单元格配置
4948
5753
  */
4949
- dataCell?: BaseTooltipConfig<T, Icon, Text>;
5754
+ dataCell?: BaseTooltipConfig<T, Menu>;
4950
5755
  }
4951
5756
 
4952
5757
  declare type TooltipAutoAdjustBoundary = 'body' | 'container' | null | undefined;
@@ -4979,14 +5784,14 @@ declare type TooltipHeadInfo = {
4979
5784
  cols: TooltipDetailListItem[];
4980
5785
  };
4981
5786
 
4982
- declare type TooltipInterpretationOptions = {
5787
+ declare type TooltipInterpretationOptions<T = TooltipContentType_2, Icon = Element | string, Text = string> = {
4983
5788
  name: string;
4984
- icon?: Element | string;
4985
- text?: string;
4986
- render?: Element | string;
5789
+ icon?: Icon;
5790
+ text?: Text;
5791
+ content?: T;
4987
5792
  };
4988
5793
 
4989
- declare interface TooltipOperation<Icon = Element | string, Text = string> extends TooltipOperatorOptions<Icon, Text> {
5794
+ declare interface TooltipOperation<Menu = BaseTooltipOperatorMenuOptions_2> extends TooltipOperatorOptions<Menu> {
4990
5795
  /**
4991
5796
  * 隐藏列 (叶子节点有效)
4992
5797
  */
@@ -5001,35 +5806,99 @@ declare interface TooltipOperation<Icon = Element | string, Text = string> exten
5001
5806
  tableSort?: boolean;
5002
5807
  }
5003
5808
 
5004
- declare type TooltipOperatorClickHandler = (params: {
5005
- key: SortMethod;
5809
+ declare type TooltipOperatorClickHandler = (info: TooltipOperatorMenuInfo, cell: S2CellType_2 | undefined | null) => void;
5810
+
5811
+ declare interface TooltipOperatorMenuInfo {
5812
+ key: string;
5006
5813
  [key: string]: unknown;
5007
- }) => void;
5814
+ }
5008
5815
 
5009
- declare interface TooltipOperatorMenu<Icon = Element | string, Text = string> {
5816
+ declare interface TooltipOperatorMenuItem<Icon, Text> {
5817
+ /** 唯一标识 */
5010
5818
  key: string;
5819
+ /** 自定义 icon */
5011
5820
  icon?: Icon;
5012
- text?: Text;
5013
- onClick?: (cell: S2CellType_2) => void;
5821
+ /** 名称 */
5822
+ label?: Text;
5823
+ /** 点击回调 */
5824
+ onClick?: TooltipOperatorClickHandler;
5825
+ /** 是否显示 */
5014
5826
  visible?: boolean | ((cell: S2CellType_2) => boolean);
5015
- children?: TooltipOperatorMenu<Icon, Text>[];
5827
+ /** 子菜单 */
5828
+ children?: TooltipOperatorMenuItem<Icon, Text>[];
5016
5829
  }
5017
5830
 
5018
- declare interface TooltipOperatorOptions<Icon = Element | string, Text = string> {
5831
+ declare interface TooltipOperatorMenuOptions<Icon, Text> {
5832
+ /**
5833
+ * 菜单内容
5834
+ */
5835
+ items?: TooltipOperatorMenuItem<Icon, Text>[];
5836
+ /**
5837
+ * 菜单项点击
5838
+ */
5019
5839
  onClick?: TooltipOperatorClickHandler;
5020
- menus?: TooltipOperatorMenu<Icon, Text>[];
5840
+ /**
5841
+ * 默认选中的菜单项 key
5842
+ */
5021
5843
  defaultSelectedKeys?: string[];
5022
5844
  }
5023
5845
 
5024
- declare interface TooltipOptions<Icon = Element | string, Text = string> {
5846
+ declare interface TooltipOperatorOptions<Menu = BaseTooltipOperatorMenuOptions_2> {
5847
+ /**
5848
+ * 菜单项配置
5849
+ */
5850
+ menu?: Menu;
5851
+ }
5852
+
5853
+ declare interface TooltipOptions<Menu = BaseTooltipOperatorMenuOptions_2> {
5854
+ /**
5855
+ * 是否隐藏汇总项
5856
+ * @example "数量(总和) 999"
5857
+ */
5025
5858
  hideSummary?: boolean;
5026
- operator?: TooltipOperatorOptions<Icon, Text>;
5027
- enterable?: boolean;
5859
+ /**
5860
+ * 顶部操作项
5861
+ */
5862
+ operator?: TooltipOperatorOptions<Menu>;
5863
+ /**
5864
+ * 是否是小计/总计
5865
+ */
5028
5866
  isTotals?: boolean;
5029
- showSingleTips?: boolean;
5030
- onlyMenu?: boolean;
5867
+ /**
5868
+ * 只展示当前单元格文本 (不含汇总/行列头信息), 如果存在省略, 显示完整文本
5869
+ * 1. 用于单元格省略后 hover 显示完整文本
5870
+ * 2. 明细表 hover/click 显示当前单元格文本
5871
+ * 3. 自定义交互 hover/click 场景
5872
+ * @example
5873
+ s2.showTooltip({
5874
+ ...
5875
+ options: { onlyShowCellText: true }
5876
+ })
5877
+ */
5878
+ onlyShowCellText?: boolean;
5879
+ /**
5880
+ * 只展示顶部操作项菜单 (不含汇总/行列头/单元格信息)
5881
+ * 1. 用于排序场景
5882
+ * 2. 自定义交互
5883
+ * @example
5884
+ s2.showTooltip({
5885
+ ...
5886
+ options: { onlyShowOperator: true }
5887
+ })
5888
+ */
5889
+ onlyShowOperator?: boolean;
5890
+ /**
5891
+ * 是否格式化数据
5892
+ */
5031
5893
  enableFormat?: boolean;
5894
+ /**
5895
+ * 是否强制清空 dom
5896
+ */
5032
5897
  forceRender?: boolean;
5898
+ /**
5899
+ * 自定义数据
5900
+ */
5901
+ data?: TooltipData;
5033
5902
  }
5034
5903
 
5035
5904
  declare type TooltipPosition = Point;
@@ -5039,13 +5908,14 @@ declare interface TooltipPositionInfo {
5039
5908
  event: FederatedPointerEvent | MouseEvent;
5040
5909
  }
5041
5910
 
5042
- declare type TooltipShowOptions<T = TooltipContentType_2, Icon = Element | string, Text = string> = {
5911
+ declare type TooltipShowOptions<T = TooltipContentType_2, Menu = BaseTooltipOperatorMenuOptions_2> = {
5043
5912
  position: TooltipPosition;
5044
5913
  data?: TooltipData;
5045
5914
  cellInfos?: TooltipDataItem[];
5046
- options?: TooltipOptions<Icon, Text>;
5047
- content?: ((cell: S2CellType_2, defaultTooltipShowOptions: TooltipShowOptions<T, Icon, Text>) => T) | T;
5915
+ options?: TooltipOptions<Menu>;
5916
+ content?: ((cell: S2CellType_2, defaultTooltipShowOptions: TooltipShowOptions<T, Menu>) => T) | T;
5048
5917
  event?: FederatedPointerEvent | MouseEvent;
5918
+ onMounted?: () => void;
5049
5919
  };
5050
5920
 
5051
5921
  declare interface TooltipSummaryOptions {
@@ -5058,33 +5928,53 @@ declare interface TooltipSummaryOptions {
5058
5928
  declare type TooltipSummaryOptionsValue = number | string | undefined | null;
5059
5929
 
5060
5930
  declare interface Total {
5061
- /** 是否显示总计 */
5062
- showGrandTotals: boolean;
5063
- /** 是否显示小计 */
5064
- showSubTotals: boolean | {
5931
+ /**
5932
+ * 是否显示总计
5933
+ */
5934
+ showGrandTotals?: boolean;
5935
+ /**
5936
+ *是否显示小计
5937
+ */
5938
+ showSubTotals?: boolean | {
5065
5939
  /** 当子维度个数 <=1 时,仍然展示小计:默认 true */
5066
5940
  always: boolean;
5067
5941
  };
5068
- calcTotals?: CalcTotals;
5942
+ /**
5943
+ * 自定义计算总计
5944
+ */
5945
+ calcGrandTotals?: CalcTotals;
5946
+ /**
5947
+ * 自定义计算小计
5948
+ */
5069
5949
  calcSubTotals?: CalcTotals;
5070
- /** 小计的汇总维度 */
5071
- subTotalsDimensions: string[];
5072
- /** 总计布局位置,默认是下或右 */
5073
- reverseLayout: boolean;
5074
- /** 小计布局位置,默认下或者右 */
5075
- reverseSubLayout: boolean;
5076
- label?: string;
5077
- subLabel?: string;
5950
+ /**
5951
+ * 小计的汇总维度
5952
+ * @example subTotalsDimensions: ['province']
5953
+ */
5954
+ subTotalsDimensions?: string[];
5955
+ /**
5956
+ * 总计布局位置,默认是下或右
5957
+ */
5958
+ reverseGrandTotalsLayout?: boolean;
5959
+ /**
5960
+ * 小计布局位置,默认是下或右
5961
+ */
5962
+ reverseSubTotalsLayout?: boolean;
5963
+ /**
5964
+ * 总计展示名
5965
+ * @default "总计"
5966
+ */
5967
+ grandTotalsLabel?: string;
5968
+ /**
5969
+ * 小计展示名
5970
+ * @default "小计"
5971
+ */
5972
+ subTotalsLabel?: string;
5078
5973
  }
5079
5974
 
5080
- /**
5081
- * tableau的英文是这个,这里有个绕的概念
5082
- * 如,某行维度需要展示小计,实际上是将对应的一列数据进行聚合,所以文案上显示的应该是“展示列小计”
5083
- * 但是内部配置我倾向于仍然按照字段所属维度区,即配置的row,代表的是行维度而不是行小计
5084
- */
5085
5975
  declare interface Totals {
5086
- row?: Partial<Total>;
5087
- col?: Partial<Total>;
5976
+ row?: Total;
5977
+ col?: Total;
5088
5978
  }
5089
5979
 
5090
5980
  declare type TotalSelection = {
@@ -5098,6 +5988,11 @@ declare type TotalSelectionsOfMultiData = {
5098
5988
  column?: TotalSelection;
5099
5989
  };
5100
5990
 
5991
+ declare interface Transformer_2 {
5992
+ [CopyMIMEType.PLAIN]: MatrixPlainTransformer;
5993
+ [CopyMIMEType.HTML]: MatrixHTMLTransformer;
5994
+ }
5995
+
5101
5996
  export declare const useExpose: (expose: (exposed?: Record<string, any>) => void) => ShallowRef<SheetExpose>;
5102
5997
 
5103
5998
  declare const VALUE_FIELD = "$$value$$";
@@ -5119,7 +6014,7 @@ declare interface ViewCellHeights {
5119
6014
  };
5120
6015
  }
5121
6016
 
5122
- declare interface ViewMeta_2 {
6017
+ declare interface ViewMeta {
5123
6018
  spreadsheet: SpreadSheet_2;
5124
6019
  id: string;
5125
6020
  x: number;
@@ -5147,7 +6042,7 @@ declare interface ViewMeta_2 {
5147
6042
 
5148
6043
  declare type ViewMetaData_2 = Data | CellData;
5149
6044
 
5150
- declare type ViewMetaIndexType = keyof Pick<ViewMeta_2, 'colIndex' | 'rowIndex'>;
6045
+ declare type ViewMetaIndexType = keyof Pick<ViewMeta, 'colIndex' | 'rowIndex'>;
5151
6046
 
5152
6047
  /**
5153
6048
  * 移动端滚动事件