@visactor/vtable-sheet 1.22.6 → 1.22.7-alpha.0
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/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/vtable-sheet.js +90 -55
- package/dist/vtable-sheet.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +7 -7
package/cjs/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ import VTableSheet from './components/vtable-sheet';
|
|
|
2
2
|
import type { ISheetDefine, IVTableSheetOptions } from './ts-types';
|
|
3
3
|
import * as TYPES from './ts-types';
|
|
4
4
|
import * as VTable from './vtable';
|
|
5
|
-
export declare const version = "1.22.
|
|
5
|
+
export declare const version = "1.22.7-alpha.0";
|
|
6
6
|
export { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions };
|
package/cjs/index.js
CHANGED
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAAoD;AAW3C,sBAXF,sBAAW,CAWE;AATpB,kDAAoC;AASd,sBAAK;AAR3B,iDAAmC;AAQN,wBAAM;AAPnC,0DAAsD;AACzC,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAAoD;AAW3C,sBAXF,sBAAW,CAWE;AATpB,kDAAoC;AASd,sBAAK;AAR3B,iDAAmC;AAQN,wBAAM;AAPnC,0DAAsD;AACzC,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,IAAA,4BAAY,GAAE,CAAC","file":"index.js","sourcesContent":["import VTableSheet from './components/vtable-sheet';\nimport type { ISheetDefine, IVTableSheetOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport * as VTable from './vtable';\nimport { importStyles } from './styles/style-manager';\nexport const version = \"1.22.7-alpha.0\";\n// 导入样式\nimportStyles();\n/**\n * @namespace VTableSheet\n */\nexport { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions };\n"]}
|
package/dist/vtable-sheet.js
CHANGED
|
@@ -12278,7 +12278,7 @@
|
|
|
12278
12278
|
}
|
|
12279
12279
|
}]), noAnimateAttrs && this.setAttributesAndPreventAnimate(noAnimateAttrs, !1, {
|
|
12280
12280
|
type: AttributeUpdateType.STATE
|
|
12281
|
-
});
|
|
12281
|
+
}), this.finalAttribute && Object.assign(this.finalAttribute, attrs);
|
|
12282
12282
|
} else this.stopStateAnimates(), this.setAttributesAndPreventAnimate(attrs, !1, {
|
|
12283
12283
|
type: AttributeUpdateType.STATE
|
|
12284
12284
|
}), this.finalAttribute && Object.assign(this.finalAttribute, attrs);
|
|
@@ -12304,7 +12304,7 @@
|
|
|
12304
12304
|
getNormalAttribute(key) {
|
|
12305
12305
|
var _a, _b;
|
|
12306
12306
|
const value = this.attribute[key];
|
|
12307
|
-
return this.animates ? null === (_a = this.finalAttribute) || void 0 === _a ? void 0 : _a[key] : null != value ? value : null === (_b = this.finalAttribute) || void 0 === _b ? void 0 : _b[key];
|
|
12307
|
+
return this.animates && this.animates.size ? null === (_a = this.finalAttribute) || void 0 === _a ? void 0 : _a[key] : null != value ? value : null === (_b = this.finalAttribute) || void 0 === _b ? void 0 : _b[key];
|
|
12308
12308
|
}
|
|
12309
12309
|
clearStates(hasAnimation) {
|
|
12310
12310
|
this.hasState() && this.normalAttrs ? (this.currentStates = [], this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)) : this.currentStates = [], this.normalAttrs = null;
|
|
@@ -47497,39 +47497,53 @@
|
|
|
47497
47497
|
for (let i = rowStart; i <= rowEnd; i++) {
|
|
47498
47498
|
const cellGroup = table.scenegraph.getCell(col, i),
|
|
47499
47499
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
47500
|
-
chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$4(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance),
|
|
47500
|
+
chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$4(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance), setTimeout(() => {
|
|
47501
47501
|
var _a, _b, _c, _d;
|
|
47502
47502
|
if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
|
|
47503
|
-
const
|
|
47504
|
-
chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47503
|
+
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47505
47504
|
let isShowTooltip = !isScatter;
|
|
47506
|
-
if (!isScatter && "object" == typeof chartDimensionLinkage
|
|
47507
|
-
const
|
|
47505
|
+
if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === rowEnd && isShowTooltip) {
|
|
47506
|
+
const heightLimitToShowTooltipForEdgeRow = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow,
|
|
47508
47507
|
{
|
|
47509
47508
|
rowEnd: rowEnd1
|
|
47510
|
-
} = table.getBodyVisibleRowRange(-
|
|
47509
|
+
} = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
|
|
47511
47510
|
if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
|
|
47512
47511
|
const {
|
|
47513
47512
|
rowEnd: rowEnd2
|
|
47514
|
-
} = table.getBodyVisibleRowRange(5);
|
|
47513
|
+
} = table.getBodyVisibleRowRange(0, 5);
|
|
47515
47514
|
isShowTooltip = rowEnd2 !== rowEnd;
|
|
47516
47515
|
}
|
|
47517
|
-
}
|
|
47518
|
-
|
|
47519
|
-
|
|
47520
|
-
|
|
47521
|
-
|
|
47522
|
-
|
|
47523
|
-
|
|
47524
|
-
|
|
47525
|
-
|
|
47526
|
-
|
|
47527
|
-
showTooltipOption: {
|
|
47528
|
-
x: canvasXY.x,
|
|
47529
|
-
y: absolutePosition.top + 3,
|
|
47530
|
-
activeType: "dimension"
|
|
47516
|
+
} else if (i === rowStart && isShowTooltip) {
|
|
47517
|
+
const heightLimitToShowTooltipForEdgeRow = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow,
|
|
47518
|
+
{
|
|
47519
|
+
rowStart: rowStart1
|
|
47520
|
+
} = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
|
|
47521
|
+
if (rowStart1 === rowStart) isShowTooltip = !0;else {
|
|
47522
|
+
const {
|
|
47523
|
+
rowStart: rowStart2
|
|
47524
|
+
} = table.getBodyVisibleRowRange(0, -5);
|
|
47525
|
+
isShowTooltip = rowStart2 !== rowStart;
|
|
47531
47526
|
}
|
|
47532
|
-
}
|
|
47527
|
+
}
|
|
47528
|
+
if (isScatter) null === (_d = (_c = chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
|
|
47529
|
+
const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
|
|
47530
|
+
absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
|
|
47531
|
+
hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
47532
|
+
tooltip: !1,
|
|
47533
|
+
showTooltipOption: {
|
|
47534
|
+
x: canvasXY.x,
|
|
47535
|
+
y: absolutePositionTop,
|
|
47536
|
+
activeType: "dimension"
|
|
47537
|
+
}
|
|
47538
|
+
})) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
47539
|
+
tooltip: isShowTooltip,
|
|
47540
|
+
showTooltipOption: {
|
|
47541
|
+
x: canvasXY.x,
|
|
47542
|
+
y: absolutePositionTop,
|
|
47543
|
+
activeType: "dimension"
|
|
47544
|
+
}
|
|
47545
|
+
});
|
|
47546
|
+
}
|
|
47533
47547
|
}
|
|
47534
47548
|
}, 0), table.scenegraph.updateNextFrame();
|
|
47535
47549
|
}
|
|
@@ -47561,39 +47575,53 @@
|
|
|
47561
47575
|
for (let i = colStart; i <= colEnd; i++) {
|
|
47562
47576
|
const cellGroup = table.scenegraph.getCell(i, row),
|
|
47563
47577
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
47564
|
-
chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListRowByRowDirection[row][i] || isValid$4(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance),
|
|
47578
|
+
chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListRowByRowDirection[row][i] || isValid$4(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance), setTimeout(() => {
|
|
47565
47579
|
var _a, _b, _c, _d;
|
|
47566
47580
|
if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
|
|
47567
|
-
const
|
|
47568
|
-
chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47581
|
+
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
47569
47582
|
let isShowTooltip = !isScatter;
|
|
47570
|
-
if (!isScatter && "object" == typeof chartDimensionLinkage
|
|
47571
|
-
const
|
|
47583
|
+
if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === colEnd && isShowTooltip) {
|
|
47584
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
47572
47585
|
{
|
|
47573
47586
|
colEnd: colEnd1
|
|
47574
|
-
} = table.getBodyVisibleColRange(-
|
|
47587
|
+
} = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
|
|
47575
47588
|
if (colEnd1 === colEnd) isShowTooltip = !0;else {
|
|
47576
47589
|
const {
|
|
47577
47590
|
colEnd: colEnd2
|
|
47578
|
-
} = table.getBodyVisibleColRange(5);
|
|
47591
|
+
} = table.getBodyVisibleColRange(0, 5);
|
|
47579
47592
|
isShowTooltip = colEnd2 !== colEnd;
|
|
47580
47593
|
}
|
|
47581
|
-
}
|
|
47582
|
-
|
|
47583
|
-
|
|
47584
|
-
|
|
47585
|
-
|
|
47586
|
-
|
|
47587
|
-
|
|
47588
|
-
|
|
47589
|
-
|
|
47590
|
-
|
|
47591
|
-
showTooltipOption: {
|
|
47592
|
-
x: absolutePosition.left + 3,
|
|
47593
|
-
y: canvasXY.y,
|
|
47594
|
-
activeType: "dimension"
|
|
47594
|
+
} else if (i === colStart && isShowTooltip) {
|
|
47595
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
47596
|
+
{
|
|
47597
|
+
colStart: colStart1
|
|
47598
|
+
} = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
|
|
47599
|
+
if (colStart1 === colStart) isShowTooltip = !0;else {
|
|
47600
|
+
const {
|
|
47601
|
+
colStart: colStart2
|
|
47602
|
+
} = table.getBodyVisibleColRange(0, -5);
|
|
47603
|
+
isShowTooltip = colStart2 !== colStart;
|
|
47595
47604
|
}
|
|
47596
|
-
}
|
|
47605
|
+
}
|
|
47606
|
+
if (isScatter) null === (_d = (_c = chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
|
|
47607
|
+
const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
|
|
47608
|
+
absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
|
|
47609
|
+
hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
47610
|
+
tooltip: !1,
|
|
47611
|
+
showTooltipOption: {
|
|
47612
|
+
x: absolutePositionLeft,
|
|
47613
|
+
y: canvasXY.y,
|
|
47614
|
+
activeType: "dimension"
|
|
47615
|
+
}
|
|
47616
|
+
})) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
47617
|
+
tooltip: isShowTooltip,
|
|
47618
|
+
showTooltipOption: {
|
|
47619
|
+
x: absolutePositionLeft,
|
|
47620
|
+
y: canvasXY.y,
|
|
47621
|
+
activeType: "dimension"
|
|
47622
|
+
}
|
|
47623
|
+
});
|
|
47624
|
+
}
|
|
47597
47625
|
}
|
|
47598
47626
|
}, 0), table.scenegraph.updateNextFrame();
|
|
47599
47627
|
}
|
|
@@ -48317,7 +48345,14 @@
|
|
|
48317
48345
|
} = drawParams;
|
|
48318
48346
|
layer.main && drawParams.clear && hoverColor && (context.beginPath(), context.fillStyle = hoverColor, context.rect(viewBox.x1, viewBox.y1, viewBox.x2 - viewBox.x1, viewBox.y2 - viewBox.y1), context.fill());
|
|
48319
48347
|
}
|
|
48320
|
-
}
|
|
48348
|
+
},
|
|
48349
|
+
componentShowContent: table.options.chartDimensionLinkage ? {
|
|
48350
|
+
tooltip: {
|
|
48351
|
+
dimension: !1,
|
|
48352
|
+
mark: !0
|
|
48353
|
+
},
|
|
48354
|
+
crosshair: !1
|
|
48355
|
+
} : void 0
|
|
48321
48356
|
}));
|
|
48322
48357
|
const chartStage = this.activeChartInstance.getStage(),
|
|
48323
48358
|
matrix = this.globalTransMatrix.clone(),
|
|
@@ -59746,7 +59781,7 @@
|
|
|
59746
59781
|
}
|
|
59747
59782
|
constructor(container, options = {}) {
|
|
59748
59783
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
59749
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.
|
|
59784
|
+
if (super(), this.showFrozenIcon = !0, this.version = "1.22.7-alpha.0", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env$1.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
|
|
59750
59785
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
59751
59786
|
options: options,
|
|
59752
59787
|
container: container
|
|
@@ -60587,7 +60622,7 @@
|
|
|
60587
60622
|
colEnd: colEnd
|
|
60588
60623
|
};
|
|
60589
60624
|
}
|
|
60590
|
-
getBodyVisibleRowRange(
|
|
60625
|
+
getBodyVisibleRowRange(start_deltaY = 0, end_deltaY = 0) {
|
|
60591
60626
|
const {
|
|
60592
60627
|
scrollTop: scrollTop
|
|
60593
60628
|
} = this,
|
|
@@ -60595,14 +60630,14 @@
|
|
|
60595
60630
|
bottomFrozenRowsHeight = this.getBottomFrozenRowsHeight(),
|
|
60596
60631
|
{
|
|
60597
60632
|
row: rowStart
|
|
60598
|
-
} = this.getRowAt(scrollTop + frozenRowsHeight + 1),
|
|
60599
|
-
rowEnd = this.getAllRowsHeight() > this.tableNoFrameHeight ? this.getRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight +
|
|
60633
|
+
} = this.getRowAt(scrollTop + frozenRowsHeight + 1 + start_deltaY),
|
|
60634
|
+
rowEnd = this.getAllRowsHeight() > this.tableNoFrameHeight ? this.getRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight + end_deltaY).row : this.rowCount - 1;
|
|
60600
60635
|
return rowEnd < 0 ? null : {
|
|
60601
60636
|
rowStart: rowStart,
|
|
60602
60637
|
rowEnd: rowEnd
|
|
60603
60638
|
};
|
|
60604
60639
|
}
|
|
60605
|
-
getBodyVisibleColRange(
|
|
60640
|
+
getBodyVisibleColRange(start_deltaX = 0, end_deltaX = 0) {
|
|
60606
60641
|
const {
|
|
60607
60642
|
scrollLeft: scrollLeft
|
|
60608
60643
|
} = this,
|
|
@@ -60610,8 +60645,8 @@
|
|
|
60610
60645
|
rightFrozenColsWidth = this.getRightFrozenColsWidth(),
|
|
60611
60646
|
{
|
|
60612
60647
|
col: colStart
|
|
60613
|
-
} = this.getColAt(scrollLeft + frozenColsWidth + 1),
|
|
60614
|
-
colEnd = this.getAllColsWidth() > this.tableNoFrameWidth ? this.getColAt(scrollLeft + this.tableNoFrameWidth - 1 - rightFrozenColsWidth +
|
|
60648
|
+
} = this.getColAt(scrollLeft + frozenColsWidth + 1 + start_deltaX),
|
|
60649
|
+
colEnd = this.getAllColsWidth() > this.tableNoFrameWidth ? this.getColAt(scrollLeft + this.tableNoFrameWidth - 1 - rightFrozenColsWidth + end_deltaX).col : this.colCount - 1;
|
|
60615
60650
|
return colEnd < 0 ? null : {
|
|
60616
60651
|
colStart: colStart,
|
|
60617
60652
|
colEnd: colEnd
|
|
@@ -81486,7 +81521,7 @@
|
|
|
81486
81521
|
importStyle();
|
|
81487
81522
|
}
|
|
81488
81523
|
|
|
81489
|
-
const version = "1.22.
|
|
81524
|
+
const version = "1.22.7-alpha.0";
|
|
81490
81525
|
importStyles();
|
|
81491
81526
|
|
|
81492
81527
|
exports.TYPES = index;
|