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

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.
Files changed (2) hide show
  1. package/esm/index.d.ts +96 -19
  2. package/package.json +1 -1
package/esm/index.d.ts CHANGED
@@ -60,6 +60,11 @@ declare type Adaptive = boolean | {
60
60
  getContainer?: () => HTMLElement;
61
61
  };
62
62
 
63
+ declare interface AdjustLeafNodesParams {
64
+ leafNodes: Node_2_2[];
65
+ hierarchy: Hierarchy;
66
+ }
67
+
63
68
  declare enum Aggregation {
64
69
  SUM = "SUM",
65
70
  MIN = "MIN",
@@ -69,7 +74,7 @@ declare enum Aggregation {
69
74
 
70
75
  declare interface AreaRange {
71
76
  start: number;
72
- width: number;
77
+ size: number;
73
78
  }
74
79
 
75
80
  declare interface Background {
@@ -122,7 +127,7 @@ declare abstract class BaseCell<T extends SimpleBBox> extends Group {
122
127
  getMeta(): T;
123
128
  setMeta(viewMeta: T): void;
124
129
  getIconStyle(): IconTheme | undefined;
125
- getTextAndIconPosition(iconCount?: number): {
130
+ getTextIconPosition(iconCount?: number): {
126
131
  text: {
127
132
  x: number;
128
133
  y: number;
@@ -233,8 +238,17 @@ declare interface BaseCellStyle {
233
238
  }
234
239
 
235
240
  declare interface BaseChartData {
241
+ /**
242
+ * 类型
243
+ */
236
244
  type: MiniChartTypes;
245
+ /**
246
+ * 数据
247
+ */
237
248
  data: RawData_2[];
249
+ /**
250
+ * 坐标轴数据
251
+ */
238
252
  encode?: {
239
253
  x: keyof RawData_2;
240
254
  y: keyof RawData_2;
@@ -573,6 +587,27 @@ declare abstract class BaseFacet {
573
587
  protected saveInitColumnLeafNodes(columnNodes?: Node_2_2[]): void;
574
588
  getHiddenColumnsInfo(columnNode: Node_2_2): HiddenColumnsInfo_2 | undefined;
575
589
  getCornerNodes(): Node_2_2[];
590
+ /**
591
+ * @description 自定义行头时, 叶子节点层级不定, 需要自动对齐其宽度, 填充空白
592
+ * -------------------------------------------------
593
+ * | 自定义节点 a-1 | 自定义节点 a-1-1 |
594
+ * |------------- |------------- |------------|
595
+ * | 自定义节点 b-1 | 自定义节点 b-1-1 | 指标 1 |
596
+ * -------------------------------------------------
597
+ */
598
+ adjustRowLeafNodesWidth(params: AdjustLeafNodesParams): void;
599
+ /**
600
+ * @description 自定义列头时, 叶子节点层级不定, 需要自动对齐其高度, 填充空白
601
+ * ------------------------------------------------------------------------
602
+ * | 自定义节点 a-1 |
603
+ * |----------------------------------------------------------------------|
604
+ * | 自定义节点 a-1-1 | |
605
+ * |-------------|-------------|------------------| 自定义节点 a-1-2 |
606
+ * | 指标 1 | 自定义节点 a-1-1-1 | 指标 2 | |
607
+ * ----------------------------------------------------------------------
608
+ */
609
+ adjustColLeafNodesHeight(params: AdjustLeafNodesParams): void;
610
+ adjustLeafNodesSize(type: 'width' | 'height'): ({ leafNodes, hierarchy }: AdjustLeafNodesParams) => void;
576
611
  }
577
612
 
578
613
  declare interface BaseFields {
@@ -638,11 +673,9 @@ declare interface BaseHeaderConfig {
638
673
  viewportWidth: number;
639
674
  viewportHeight: number;
640
675
  position: PointLike;
641
- data: Node_2_2[];
676
+ nodes: Node_2_2[];
642
677
  spreadsheet: SpreadSheet_2;
643
678
  sortParam?: SortParam;
644
- linkFields: string[] | ((meta: Node_2_2 | ViewMeta_2) => boolean);
645
- hierarchyType: S2Options_2['hierarchyType'];
646
679
  }
647
680
 
648
681
  declare interface BaseNodeConfig {
@@ -1175,8 +1208,17 @@ declare interface BulletTheme {
1175
1208
  }
1176
1209
 
1177
1210
  declare interface BulletValue {
1211
+ /**
1212
+ * 类型
1213
+ */
1178
1214
  type: MiniChartTypes.Bullet;
1215
+ /**
1216
+ * 当前值
1217
+ */
1179
1218
  measure: number | string;
1219
+ /**
1220
+ * 目标值
1221
+ */
1180
1222
  target: number | string;
1181
1223
  [key: string]: unknown;
1182
1224
  }
@@ -1298,15 +1340,16 @@ declare enum CellTypes {
1298
1340
 
1299
1341
  declare class ColCell extends HeaderCell {
1300
1342
  protected headerConfig: ColHeaderConfig;
1301
- /** 文字绘制起始坐标 */
1302
- protected textPosition: PointLike;
1343
+ /** icon 绘制起始坐标 */
1344
+ protected iconPosition: PointLike;
1303
1345
  get cellType(): CellTypes;
1304
1346
  protected getBorderPositions(): CellBorderPosition[];
1305
1347
  protected initCell(): void;
1348
+ protected getFormattedFieldValue(): FormatResult;
1306
1349
  protected getMaxTextWidth(): number;
1307
- protected getIconPosition(): PointLike;
1308
1350
  protected isBolderText(): boolean;
1309
1351
  protected getTextPosition(): PointLike;
1352
+ protected getIconPosition(): PointLike;
1310
1353
  protected getActionIconsWidth(): number;
1311
1354
  protected getColResizeArea(): Group | undefined;
1312
1355
  protected getHorizontalResizeAreaName(): string;
@@ -1362,6 +1405,7 @@ declare class ColHeader extends BaseHeader<ColHeaderConfig> {
1362
1405
  protected scrollGroup: Group;
1363
1406
  protected background: DisplayObject;
1364
1407
  constructor(cfg: ColHeaderConfig);
1408
+ private initScrollGroup;
1365
1409
  /**
1366
1410
  * Make colHeader scroll with hScrollBar
1367
1411
  * @param scrollX horizontal offset
@@ -1371,9 +1415,9 @@ declare class ColHeader extends BaseHeader<ColHeaderConfig> {
1371
1415
  onColScroll(scrollX: number, type: string): void;
1372
1416
  protected clip(): void;
1373
1417
  clear(): void;
1374
- protected getCellInstance(item: Node_2_2, spreadsheet: SpreadSheet_2, headerConfig: ColHeaderConfig): S2CellType_2;
1418
+ protected getCellInstance(node: Node_2_2, spreadsheet: SpreadSheet_2, headerConfig: ColHeaderConfig): S2CellType_2;
1375
1419
  protected getCellGroup(node: Node_2_2): Group;
1376
- protected isColCellInRect(item: Node_2_2): boolean;
1420
+ protected isColCellInRect(node: Node_2_2): boolean;
1377
1421
  protected layout(): void;
1378
1422
  protected offset(): void;
1379
1423
  }
@@ -1530,11 +1574,26 @@ export declare class CustomTooltip extends BaseTooltip {
1530
1574
  }
1531
1575
 
1532
1576
  declare interface CustomTreeNode {
1577
+ /**
1578
+ * 字段唯一标识
1579
+ */
1533
1580
  field: string;
1581
+ /**
1582
+ * 标题
1583
+ */
1534
1584
  title?: string;
1585
+ /**
1586
+ * 是否收起(默认都展开)
1587
+ */
1535
1588
  collapsed?: boolean;
1589
+ /**
1590
+ * 字段描述
1591
+ */
1536
1592
  description?: string;
1537
- children?: string[] | CustomTreeNode[];
1593
+ /**
1594
+ * 子节点
1595
+ */
1596
+ children?: CustomTreeNode[];
1538
1597
  }
1539
1598
 
1540
1599
  declare type Data = (RawData_2 & ExtraData) | undefined | null;
@@ -2383,7 +2442,11 @@ declare class Node_2_2 {
2383
2442
  isGrandTotals?: boolean;
2384
2443
  isSubTotals?: boolean;
2385
2444
  hiddenChildNodeInfo?: HiddenColumnsInfo_2 | null;
2386
- extra?: Record<string, any>;
2445
+ extra?: {
2446
+ description?: string;
2447
+ isCustomNode?: boolean;
2448
+ [key: string]: any;
2449
+ };
2387
2450
  [key: string]: any;
2388
2451
  constructor(cfg: BaseNodeConfig);
2389
2452
  /**
@@ -2440,6 +2503,7 @@ declare class Node_2_2 {
2440
2503
  *
2441
2504
  */
2442
2505
  getTotalHeightForTreeHierarchy(): number;
2506
+ isSeriesNumberNode(): boolean;
2443
2507
  }
2444
2508
 
2445
2509
  declare interface OffsetConfig {
@@ -2996,6 +3060,8 @@ declare class RootInteraction {
2996
3060
 
2997
3061
  declare class RowCell extends HeaderCell {
2998
3062
  protected headerConfig: RowHeaderConfig;
3063
+ /** icon 绘制起始坐标 */
3064
+ protected iconPosition: PointLike;
2999
3065
  get cellType(): CellTypes;
3000
3066
  protected getBorderPositions(): CellBorderPosition[];
3001
3067
  protected initCell(): void;
@@ -3013,10 +3079,7 @@ declare class RowCell extends HeaderCell {
3013
3079
  protected getContentIndent(): number;
3014
3080
  protected getTextIndent(): number;
3015
3081
  protected isTreeLevel(): any;
3016
- protected getIconPosition(): {
3017
- x: number;
3018
- y: number;
3019
- };
3082
+ protected getIconPosition(): PointLike;
3020
3083
  protected getMaxTextWidth(): number;
3021
3084
  protected getTextArea(): {
3022
3085
  x: number;
@@ -3025,7 +3088,6 @@ declare class RowCell extends HeaderCell {
3025
3088
  height: number;
3026
3089
  };
3027
3090
  protected getTextPosition(): PointLike;
3028
- protected getIconYPosition(): number;
3029
3091
  }
3030
3092
 
3031
3093
  declare type RowCellCollapsedParams_2 = {
@@ -3203,10 +3265,25 @@ declare interface S2BasicOptions<T = TooltipContentType_2, P = Pagination_2, Ico
3203
3265
  declare type S2CellType_2<T extends SimpleBBox = ViewMeta_2> = DataCell_2 | HeaderCell | ColCell | CornerCell | RowCell | SeriesNumberCell | MergedCell | TableCornerCell | TableSeriesCell | BaseCell<T>;
3204
3266
 
3205
3267
  declare interface S2DataConfig_2 {
3268
+ /**
3269
+ * 原始明细数据
3270
+ */
3206
3271
  data: RawData_2[];
3272
+ /**
3273
+ * 维度字段
3274
+ */
3207
3275
  fields: Fields;
3276
+ /**
3277
+ * 字段元数据
3278
+ */
3208
3279
  meta?: Meta[];
3280
+ /**
3281
+ * 排序配置
3282
+ */
3209
3283
  sortParams?: SortParams_2;
3284
+ /**
3285
+ * 筛选配置
3286
+ */
3210
3287
  filterParams?: FilterParam[];
3211
3288
  [key: string]: unknown;
3212
3289
  }
@@ -4368,6 +4445,8 @@ declare abstract class SpreadSheet_2 extends EE {
4368
4445
  on: <K extends keyof EmitterType>(event: K, listener: EmitterType[K]) => this;
4369
4446
  emit: <K extends keyof EmitterType>(event: K, ...args: Parameters<EmitterType[K]>) => boolean;
4370
4447
  constructor(dom: S2MountContainer_2, dataCfg: S2DataConfig_2, options: S2Options_2 | null);
4448
+ isCustomHeaderFields(fieldType?: keyof Pick<Fields, 'columns' | 'rows'>): boolean;
4449
+ isCustomColumnFields(): boolean;
4371
4450
  private setOverscrollBehavior;
4372
4451
  private restoreOverscrollBehavior;
4373
4452
  private setDebug;
@@ -4387,9 +4466,7 @@ declare abstract class SpreadSheet_2 extends EE {
4387
4466
  * Check if is pivot mode
4388
4467
  */
4389
4468
  abstract isPivotMode(): boolean;
4390
- abstract isCustomHeaderFields(fieldType?: keyof Pick<Fields, 'columns' | 'rows'>): boolean;
4391
4469
  abstract isCustomRowFields(): boolean;
4392
- abstract isCustomColumnFields(): boolean;
4393
4470
  /**
4394
4471
  * tree type must be in strategy mode
4395
4472
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@antv/s2-vue",
4
- "version": "2.0.0-next.5",
4
+ "version": "2.0.0-next.6",
5
5
  "main": "lib/index.js",
6
6
  "unpkg": "dist/index.min.js",
7
7
  "module": "esm/index.js",