@visactor/vtable-calendar 1.22.6-alpha.3 → 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/dist/vtable-calendar.js +305 -188
- package/dist/vtable-calendar.min.js +1 -1
- package/package.json +4 -4
package/dist/vtable-calendar.js
CHANGED
|
@@ -7447,10 +7447,10 @@
|
|
|
7447
7447
|
}
|
|
7448
7448
|
ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [], ResourceLoader.onLoadSuccessCb = [];
|
|
7449
7449
|
|
|
7450
|
-
var Edge
|
|
7450
|
+
var Edge;
|
|
7451
7451
|
!function (Edge) {
|
|
7452
7452
|
Edge[Edge.Top = 1] = "Top", Edge[Edge.Right = 2] = "Right", Edge[Edge.Bottom = 4] = "Bottom", Edge[Edge.Left = 8] = "Left", Edge[Edge.ALL = 15] = "ALL";
|
|
7453
|
-
}(Edge
|
|
7453
|
+
}(Edge || (Edge = {}));
|
|
7454
7454
|
const _strokeVec4 = [!1, !1, !1, !1];
|
|
7455
7455
|
const parseStroke = stroke => {
|
|
7456
7456
|
var _a;
|
|
@@ -9498,7 +9498,7 @@
|
|
|
9498
9498
|
}
|
|
9499
9499
|
}]), noAnimateAttrs && this.setAttributesAndPreventAnimate(noAnimateAttrs, !1, {
|
|
9500
9500
|
type: AttributeUpdateType.STATE
|
|
9501
|
-
});
|
|
9501
|
+
}), this.finalAttribute && Object.assign(this.finalAttribute, attrs);
|
|
9502
9502
|
} else this.stopStateAnimates(), this.setAttributesAndPreventAnimate(attrs, !1, {
|
|
9503
9503
|
type: AttributeUpdateType.STATE
|
|
9504
9504
|
}), this.finalAttribute && Object.assign(this.finalAttribute, attrs);
|
|
@@ -9524,7 +9524,7 @@
|
|
|
9524
9524
|
getNormalAttribute(key) {
|
|
9525
9525
|
var _a, _b;
|
|
9526
9526
|
const value = this.attribute[key];
|
|
9527
|
-
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];
|
|
9527
|
+
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];
|
|
9528
9528
|
}
|
|
9529
9529
|
clearStates(hasAnimation) {
|
|
9530
9530
|
this.hasState() && this.normalAttrs ? (this.currentStates = [], this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)) : this.currentStates = [], this.normalAttrs = null;
|
|
@@ -20993,16 +20993,16 @@
|
|
|
20993
20993
|
};
|
|
20994
20994
|
decompressFrames_1 = lib$1.decompressFrames = decompressFrames;
|
|
20995
20995
|
|
|
20996
|
-
const browser
|
|
20996
|
+
const browser = isBrowserEnv();
|
|
20997
20997
|
|
|
20998
20998
|
function _registerArc() {
|
|
20999
|
-
_registerArc.__loaded || (_registerArc.__loaded = !0, registerArcGraphic(), container.load(arcModule), container.load(browser
|
|
20999
|
+
_registerArc.__loaded || (_registerArc.__loaded = !0, registerArcGraphic(), container.load(arcModule), container.load(browser ? arcCanvasPickModule : arcMathPickModule));
|
|
21000
21000
|
}
|
|
21001
21001
|
_registerArc.__loaded = !1;
|
|
21002
21002
|
const registerArc = _registerArc;
|
|
21003
21003
|
|
|
21004
21004
|
function _registerCircle() {
|
|
21005
|
-
_registerCircle.__loaded || (_registerCircle.__loaded = !0, registerCircleGraphic(), container.load(circleModule), container.load(browser
|
|
21005
|
+
_registerCircle.__loaded || (_registerCircle.__loaded = !0, registerCircleGraphic(), container.load(circleModule), container.load(browser ? circleCanvasPickModule : circleMathPickModule));
|
|
21006
21006
|
}
|
|
21007
21007
|
_registerCircle.__loaded = !1;
|
|
21008
21008
|
const registerCircle = _registerCircle;
|
|
@@ -21014,37 +21014,37 @@
|
|
|
21014
21014
|
const registerGroup = _registerGroup;
|
|
21015
21015
|
|
|
21016
21016
|
function _registerImage() {
|
|
21017
|
-
_registerImage.__loaded || (_registerImage.__loaded = !0, registerImageGraphic(), container.load(imageModule), container.load(browser
|
|
21017
|
+
_registerImage.__loaded || (_registerImage.__loaded = !0, registerImageGraphic(), container.load(imageModule), container.load(browser ? imageCanvasPickModule : imageMathPickModule));
|
|
21018
21018
|
}
|
|
21019
21019
|
_registerImage.__loaded = !1;
|
|
21020
21020
|
const registerImage = _registerImage;
|
|
21021
21021
|
|
|
21022
21022
|
function _registerLine() {
|
|
21023
|
-
_registerLine.__loaded || (_registerLine.__loaded = !0, registerLineGraphic(), container.load(lineModule), container.load(browser
|
|
21023
|
+
_registerLine.__loaded || (_registerLine.__loaded = !0, registerLineGraphic(), container.load(lineModule), container.load(browser ? lineCanvasPickModule : lineMathPickModule));
|
|
21024
21024
|
}
|
|
21025
21025
|
_registerLine.__loaded = !1;
|
|
21026
21026
|
const registerLine = _registerLine;
|
|
21027
21027
|
|
|
21028
21028
|
function _registerPath() {
|
|
21029
|
-
_registerPath.__loaded || (_registerPath.__loaded = !0, registerPathGraphic(), container.load(pathModule), container.load(browser
|
|
21029
|
+
_registerPath.__loaded || (_registerPath.__loaded = !0, registerPathGraphic(), container.load(pathModule), container.load(browser ? pathCanvasPickModule : pathMathPickModule));
|
|
21030
21030
|
}
|
|
21031
21031
|
_registerPath.__loaded = !1;
|
|
21032
21032
|
const registerPath = _registerPath;
|
|
21033
21033
|
|
|
21034
21034
|
function _registerPolygon() {
|
|
21035
|
-
_registerPolygon.__loaded || (_registerPolygon.__loaded = !0, registerPolygonGraphic(), container.load(polygonModule), container.load(browser
|
|
21035
|
+
_registerPolygon.__loaded || (_registerPolygon.__loaded = !0, registerPolygonGraphic(), container.load(polygonModule), container.load(browser ? polygonCanvasPickModule : polygonMathPickModule));
|
|
21036
21036
|
}
|
|
21037
21037
|
_registerPolygon.__loaded = !1;
|
|
21038
21038
|
const registerPolygon = _registerPolygon;
|
|
21039
21039
|
|
|
21040
21040
|
function _registerRect() {
|
|
21041
|
-
_registerRect.__loaded || (_registerRect.__loaded = !0, registerRectGraphic(), container.load(rectModule), container.load(browser
|
|
21041
|
+
_registerRect.__loaded || (_registerRect.__loaded = !0, registerRectGraphic(), container.load(rectModule), container.load(browser ? rectCanvasPickModule : rectMathPickModule));
|
|
21042
21042
|
}
|
|
21043
21043
|
_registerRect.__loaded = !1;
|
|
21044
21044
|
const registerRect = _registerRect;
|
|
21045
21045
|
|
|
21046
21046
|
function _registerRichtext() {
|
|
21047
|
-
_registerRichtext.__loaded || (_registerRichtext.__loaded = !0, registerRichtextGraphic(), container.load(richtextModule), container.load(browser
|
|
21047
|
+
_registerRichtext.__loaded || (_registerRichtext.__loaded = !0, registerRichtextGraphic(), container.load(richtextModule), container.load(browser ? richtextCanvasPickModule : richTextMathPickModule));
|
|
21048
21048
|
}
|
|
21049
21049
|
_registerRichtext.__loaded = !1;
|
|
21050
21050
|
const registerRichtext = _registerRichtext;
|
|
@@ -21056,13 +21056,13 @@
|
|
|
21056
21056
|
const registerShadowRoot = _registerShadowRoot;
|
|
21057
21057
|
|
|
21058
21058
|
function _registerSymbol() {
|
|
21059
|
-
_registerSymbol.__loaded || (_registerSymbol.__loaded = !0, registerSymbolGraphic(), container.load(symbolModule), container.load(browser
|
|
21059
|
+
_registerSymbol.__loaded || (_registerSymbol.__loaded = !0, registerSymbolGraphic(), container.load(symbolModule), container.load(browser ? symbolCanvasPickModule : symbolMathPickModule));
|
|
21060
21060
|
}
|
|
21061
21061
|
_registerSymbol.__loaded = !1;
|
|
21062
21062
|
const registerSymbol = _registerSymbol;
|
|
21063
21063
|
|
|
21064
21064
|
function _registerText() {
|
|
21065
|
-
_registerText.__loaded || (_registerText.__loaded = !0, registerTextGraphic(), container.load(textModule), container.load(browser
|
|
21065
|
+
_registerText.__loaded || (_registerText.__loaded = !0, registerTextGraphic(), container.load(textModule), container.load(browser ? textCanvasPickModule : textMathPickModule));
|
|
21066
21066
|
}
|
|
21067
21067
|
_registerText.__loaded = !1;
|
|
21068
21068
|
const registerText = _registerText;
|
|
@@ -34753,13 +34753,7 @@
|
|
|
34753
34753
|
Safari: ua.indexOf("safari") > -1 && -1 === ua.indexOf("edge")
|
|
34754
34754
|
};
|
|
34755
34755
|
}
|
|
34756
|
-
|
|
34757
|
-
IE: IE,
|
|
34758
|
-
Chrome: Chrome,
|
|
34759
|
-
Firefox: Firefox,
|
|
34760
|
-
Edge: Edge,
|
|
34761
|
-
Safari: Safari
|
|
34762
|
-
} = analyzeUserAgent();
|
|
34756
|
+
analyzeUserAgent();
|
|
34763
34757
|
function isObject$4(obj) {
|
|
34764
34758
|
return obj === Object(obj);
|
|
34765
34759
|
}
|
|
@@ -34849,14 +34843,6 @@
|
|
|
34849
34843
|
}
|
|
34850
34844
|
return !1;
|
|
34851
34845
|
}
|
|
34852
|
-
const browser = {
|
|
34853
|
-
IE: IE,
|
|
34854
|
-
Edge: Edge,
|
|
34855
|
-
Chrome: Chrome,
|
|
34856
|
-
Firefox: Firefox,
|
|
34857
|
-
Safari: Safari,
|
|
34858
|
-
heightLimit: Chrome ? 33554431 : Firefox ? 17895588 : 10737433
|
|
34859
|
-
};
|
|
34860
34846
|
const obj = {
|
|
34861
34847
|
isObject: isObject$4
|
|
34862
34848
|
};
|
|
@@ -40052,6 +40038,19 @@
|
|
|
40052
40038
|
};
|
|
40053
40039
|
}
|
|
40054
40040
|
const regIndexReg = /radio-\d+-\d+-(\d+)/;
|
|
40041
|
+
function setDataToHTML(data) {
|
|
40042
|
+
const result = ["<table>"],
|
|
40043
|
+
META_HEAD = ['<meta name="author" content="Visactor"/>', '<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join(""),
|
|
40044
|
+
rows = data.split("\r\n");
|
|
40045
|
+
return rows.forEach(function (rowCells, rowIndex) {
|
|
40046
|
+
const cells = rowCells.split("\t"),
|
|
40047
|
+
rowValues = [];
|
|
40048
|
+
0 === rowIndex && result.push("<tbody>"), cells.forEach(function (cell, cellIndex) {
|
|
40049
|
+
const parsedCellData = cell ? cell.toString().replace(/&/g, "&").replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">").replace(/\n/g, "<br>").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g, "<br>\r\n").replace(/\x20{2,}/gi, substring => `<span style="mso-spacerun: yes">${" ".repeat(substring.length - 1)} </span>`).replace(/\t/gi, "	") : " ";
|
|
40050
|
+
rowValues.push(`<td>${parsedCellData}</td>`);
|
|
40051
|
+
}), result.push("<tr>", ...rowValues, "</tr>"), rowIndex === rows.length - 1 && result.push("</tbody>");
|
|
40052
|
+
}), result.push("</table>"), [META_HEAD, result.join("")].join("");
|
|
40053
|
+
}
|
|
40055
40054
|
|
|
40056
40055
|
const CUSTOM_MERGE_PRE_NAME = "_custom_";
|
|
40057
40056
|
const CUSTOM_CONTAINER_NAME$1 = "custom-container";
|
|
@@ -43787,39 +43786,53 @@
|
|
|
43787
43786
|
for (let i = rowStart; i <= rowEnd; i++) {
|
|
43788
43787
|
const cellGroup = table.scenegraph.getCell(col, i),
|
|
43789
43788
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43790
|
-
chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$3(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance),
|
|
43789
|
+
chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListColumnByColumnDirection[col][i] || isValid$3(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance), setTimeout(() => {
|
|
43791
43790
|
var _a, _b, _c, _d;
|
|
43792
43791
|
if (null === (_a = chartInstanceListColumnByColumnDirection[col]) || void 0 === _a ? void 0 : _a[i]) {
|
|
43793
|
-
const
|
|
43794
|
-
chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43792
|
+
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43795
43793
|
let isShowTooltip = !isScatter;
|
|
43796
|
-
if (!isScatter && "object" == typeof chartDimensionLinkage
|
|
43797
|
-
const
|
|
43794
|
+
if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === rowEnd && isShowTooltip) {
|
|
43795
|
+
const heightLimitToShowTooltipForEdgeRow = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow,
|
|
43798
43796
|
{
|
|
43799
43797
|
rowEnd: rowEnd1
|
|
43800
|
-
} = table.getBodyVisibleRowRange(-
|
|
43798
|
+
} = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
|
|
43801
43799
|
if (rowEnd1 === rowEnd) isShowTooltip = !0;else {
|
|
43802
43800
|
const {
|
|
43803
43801
|
rowEnd: rowEnd2
|
|
43804
|
-
} = table.getBodyVisibleRowRange(5);
|
|
43802
|
+
} = table.getBodyVisibleRowRange(0, 5);
|
|
43805
43803
|
isShowTooltip = rowEnd2 !== rowEnd;
|
|
43806
43804
|
}
|
|
43807
|
-
}
|
|
43808
|
-
|
|
43809
|
-
|
|
43810
|
-
|
|
43811
|
-
|
|
43812
|
-
|
|
43813
|
-
|
|
43814
|
-
|
|
43815
|
-
|
|
43816
|
-
|
|
43817
|
-
showTooltipOption: {
|
|
43818
|
-
x: canvasXY.x,
|
|
43819
|
-
y: absolutePosition.top + 3,
|
|
43820
|
-
activeType: "dimension"
|
|
43805
|
+
} else if (i === rowStart && isShowTooltip) {
|
|
43806
|
+
const heightLimitToShowTooltipForEdgeRow = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow,
|
|
43807
|
+
{
|
|
43808
|
+
rowStart: rowStart1
|
|
43809
|
+
} = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
|
|
43810
|
+
if (rowStart1 === rowStart) isShowTooltip = !0;else {
|
|
43811
|
+
const {
|
|
43812
|
+
rowStart: rowStart2
|
|
43813
|
+
} = table.getBodyVisibleRowRange(0, -5);
|
|
43814
|
+
isShowTooltip = rowStart2 !== rowStart;
|
|
43821
43815
|
}
|
|
43822
|
-
}
|
|
43816
|
+
}
|
|
43817
|
+
if (isScatter) null === (_d = (_c = chartInstanceListColumnByColumnDirection[col][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
|
|
43818
|
+
const bodyBoundryTop = table.frozenRowCount ? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom : 0,
|
|
43819
|
+
absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
|
|
43820
|
+
hideTooltip ? (table.stateManager.hover.cellPos.col === col && table.stateManager.hover.cellPos.row === i || chartInstanceListColumnByColumnDirection[col][i].hideTooltip(), chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43821
|
+
tooltip: !1,
|
|
43822
|
+
showTooltipOption: {
|
|
43823
|
+
x: canvasXY.x,
|
|
43824
|
+
y: absolutePositionTop,
|
|
43825
|
+
activeType: "dimension"
|
|
43826
|
+
}
|
|
43827
|
+
})) : chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43828
|
+
tooltip: isShowTooltip,
|
|
43829
|
+
showTooltipOption: {
|
|
43830
|
+
x: canvasXY.x,
|
|
43831
|
+
y: absolutePositionTop,
|
|
43832
|
+
activeType: "dimension"
|
|
43833
|
+
}
|
|
43834
|
+
});
|
|
43835
|
+
}
|
|
43823
43836
|
}
|
|
43824
43837
|
}, 0), table.scenegraph.updateNextFrame();
|
|
43825
43838
|
}
|
|
@@ -43851,39 +43864,53 @@
|
|
|
43851
43864
|
for (let i = colStart; i <= colEnd; i++) {
|
|
43852
43865
|
const cellGroup = table.scenegraph.getCell(i, row),
|
|
43853
43866
|
chartNode = null === (_a = null == cellGroup ? void 0 : cellGroup.getChildren()) || void 0 === _a ? void 0 : _a[0];
|
|
43854
|
-
chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListRowByRowDirection[row][i] || isValid$3(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance),
|
|
43867
|
+
chartNode.addUpdateShapeAndBoundsTag(), chartInstanceListRowByRowDirection[row][i] || isValid$3(chartNode) && (chartNode.activeChartInstance || chartNode.activate(table), chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance), setTimeout(() => {
|
|
43855
43868
|
var _a, _b, _c, _d;
|
|
43856
43869
|
if (null === (_a = chartInstanceListRowByRowDirection[row]) || void 0 === _a ? void 0 : _a[i]) {
|
|
43857
|
-
const
|
|
43858
|
-
chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43870
|
+
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
43859
43871
|
let isShowTooltip = !isScatter;
|
|
43860
|
-
if (!isScatter && "object" == typeof chartDimensionLinkage
|
|
43861
|
-
const
|
|
43872
|
+
if (!isScatter && "object" == typeof chartDimensionLinkage) if (isShowTooltip = null === (_b = chartDimensionLinkage.showTooltip) || void 0 === _b || _b, i === colEnd && isShowTooltip) {
|
|
43873
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
43862
43874
|
{
|
|
43863
43875
|
colEnd: colEnd1
|
|
43864
|
-
} = table.getBodyVisibleColRange(-
|
|
43876
|
+
} = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
|
|
43865
43877
|
if (colEnd1 === colEnd) isShowTooltip = !0;else {
|
|
43866
43878
|
const {
|
|
43867
43879
|
colEnd: colEnd2
|
|
43868
|
-
} = table.getBodyVisibleColRange(5);
|
|
43880
|
+
} = table.getBodyVisibleColRange(0, 5);
|
|
43869
43881
|
isShowTooltip = colEnd2 !== colEnd;
|
|
43870
43882
|
}
|
|
43871
|
-
}
|
|
43872
|
-
|
|
43873
|
-
|
|
43874
|
-
|
|
43875
|
-
|
|
43876
|
-
|
|
43877
|
-
|
|
43878
|
-
|
|
43879
|
-
|
|
43880
|
-
|
|
43881
|
-
showTooltipOption: {
|
|
43882
|
-
x: absolutePosition.left + 3,
|
|
43883
|
-
y: canvasXY.y,
|
|
43884
|
-
activeType: "dimension"
|
|
43883
|
+
} else if (i === colStart && isShowTooltip) {
|
|
43884
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn,
|
|
43885
|
+
{
|
|
43886
|
+
colStart: colStart1
|
|
43887
|
+
} = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
|
|
43888
|
+
if (colStart1 === colStart) isShowTooltip = !0;else {
|
|
43889
|
+
const {
|
|
43890
|
+
colStart: colStart2
|
|
43891
|
+
} = table.getBodyVisibleColRange(0, -5);
|
|
43892
|
+
isShowTooltip = colStart2 !== colStart;
|
|
43885
43893
|
}
|
|
43886
|
-
}
|
|
43894
|
+
}
|
|
43895
|
+
if (isScatter) null === (_d = (_c = chartInstanceListRowByRowDirection[row][i]).showCrosshair) || void 0 === _d || _d.call(_c, axis => "left" === axis.layoutOrient ? positionValueOrYValue : dimensionValueOrXValue);else {
|
|
43896
|
+
const bodyBoundryLeft = table.frozenColCount ? table.getCellRelativeRect(table.frozenColCount - 1, row).right : 0,
|
|
43897
|
+
absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
|
|
43898
|
+
hideTooltip ? (table.stateManager.hover.cellPos.col === i && table.stateManager.hover.cellPos.row === row || chartInstanceListRowByRowDirection[row][i].hideTooltip(), chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43899
|
+
tooltip: !1,
|
|
43900
|
+
showTooltipOption: {
|
|
43901
|
+
x: absolutePositionLeft,
|
|
43902
|
+
y: canvasXY.y,
|
|
43903
|
+
activeType: "dimension"
|
|
43904
|
+
}
|
|
43905
|
+
})) : chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
43906
|
+
tooltip: isShowTooltip,
|
|
43907
|
+
showTooltipOption: {
|
|
43908
|
+
x: absolutePositionLeft,
|
|
43909
|
+
y: canvasXY.y,
|
|
43910
|
+
activeType: "dimension"
|
|
43911
|
+
}
|
|
43912
|
+
});
|
|
43913
|
+
}
|
|
43887
43914
|
}
|
|
43888
43915
|
}, 0), table.scenegraph.updateNextFrame();
|
|
43889
43916
|
}
|
|
@@ -44192,8 +44219,11 @@
|
|
|
44192
44219
|
}, axisOption, {
|
|
44193
44220
|
orient: "left",
|
|
44194
44221
|
type: null !== (_e = null == axisOption ? void 0 : axisOption.type) && void 0 !== _e ? _e : "band",
|
|
44195
|
-
|
|
44222
|
+
label: {
|
|
44223
|
+
flush: !0
|
|
44224
|
+
},
|
|
44196
44225
|
inverse: transformInverse(axisOption, "horizontal" === (null !== (_f = null == spec ? void 0 : spec.direction) && void 0 !== _f ? _f : "scatter" === chartType ? "vertical" : "horizontal")),
|
|
44226
|
+
__vtableChartTheme: theme,
|
|
44197
44227
|
__vtableBodyChartCellPadding: bodyChartCellPadding
|
|
44198
44228
|
});
|
|
44199
44229
|
}
|
|
@@ -44320,6 +44350,9 @@
|
|
|
44320
44350
|
}, axisOption, {
|
|
44321
44351
|
orient: "bottom",
|
|
44322
44352
|
type: null !== (_o = null == axisOption ? void 0 : axisOption.type) && void 0 !== _o ? _o : "band",
|
|
44353
|
+
label: {
|
|
44354
|
+
flush: !0
|
|
44355
|
+
},
|
|
44323
44356
|
__vtableChartTheme: theme,
|
|
44324
44357
|
__vtableBodyChartCellPadding: bodyChartCellPadding
|
|
44325
44358
|
});
|
|
@@ -44601,7 +44634,14 @@
|
|
|
44601
44634
|
} = drawParams;
|
|
44602
44635
|
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());
|
|
44603
44636
|
}
|
|
44604
|
-
}
|
|
44637
|
+
},
|
|
44638
|
+
componentShowContent: table.options.chartDimensionLinkage ? {
|
|
44639
|
+
tooltip: {
|
|
44640
|
+
dimension: !1,
|
|
44641
|
+
mark: !0
|
|
44642
|
+
},
|
|
44643
|
+
crosshair: !1
|
|
44644
|
+
} : void 0
|
|
44605
44645
|
}));
|
|
44606
44646
|
const chartStage = this.activeChartInstance.getStage(),
|
|
44607
44647
|
matrix = this.globalTransMatrix.clone(),
|
|
@@ -44684,7 +44724,7 @@
|
|
|
44684
44724
|
releaseColumnChartInstance = !0,
|
|
44685
44725
|
releaseRowChartInstance = !0
|
|
44686
44726
|
} = {}) {
|
|
44687
|
-
var _a, _b, _c, _d, _e, _f;
|
|
44727
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
44688
44728
|
if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0, releaseChartInstance) {
|
|
44689
44729
|
null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
|
|
44690
44730
|
x1: -1e3,
|
|
@@ -44693,11 +44733,16 @@
|
|
|
44693
44733
|
y2: -800
|
|
44694
44734
|
}, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null;
|
|
44695
44735
|
const {
|
|
44696
|
-
|
|
44697
|
-
|
|
44698
|
-
|
|
44699
|
-
table = this.stage.table;
|
|
44736
|
+
col: col,
|
|
44737
|
+
row: row
|
|
44738
|
+
} = this.parent;
|
|
44700
44739
|
table.internalProps.layoutMap.isAxisCell(table.rowHeaderLevelCount - 1, row) && (null === (_d = (_c = table.scenegraph.getCell(table.rowHeaderLevelCount - 1, row).firstChild).hideLabelHoverOnAxis) || void 0 === _d || _d.call(_c)), table.internalProps.layoutMap.isAxisCell(col, table.rowCount - table.bottomFrozenRowCount) && (null === (_f = (_e = table.scenegraph.getCell(col, table.rowCount - table.bottomFrozenRowCount).firstChild).hideLabelHoverOnAxis) || void 0 === _f || _f.call(_e));
|
|
44740
|
+
} else {
|
|
44741
|
+
const {
|
|
44742
|
+
col: col,
|
|
44743
|
+
row: row
|
|
44744
|
+
} = this.parent;
|
|
44745
|
+
releaseColumnChartInstance && table.internalProps.layoutMap.isAxisCell(col, table.rowCount - table.bottomFrozenRowCount) && (null === (_h = (_g = table.scenegraph.getCell(col, table.rowCount - table.bottomFrozenRowCount).firstChild).hideLabelHoverOnAxis) || void 0 === _h || _h.call(_g)), releaseRowChartInstance && table.internalProps.layoutMap.isAxisCell(table.rowHeaderLevelCount - 1, row) && (null === (_k = (_j = table.scenegraph.getCell(table.rowHeaderLevelCount - 1, row).firstChild).hideLabelHoverOnAxis) || void 0 === _k || _k.call(_j));
|
|
44701
44746
|
}
|
|
44702
44747
|
releaseColumnChartInstance && clearChartInstanceListByColumnDirection(this.parent.col, "scatter" === this.attribute.spec.type ? this.parent.row : void 0, table), releaseRowChartInstance && clearChartInstanceListByRowDirection(this.parent.row, "scatter" === this.attribute.spec.type ? this.parent.col : void 0, table);
|
|
44703
44748
|
}
|
|
@@ -44822,7 +44867,7 @@
|
|
|
44822
44867
|
tickMode: null === (_e = axis.tick) || void 0 === _e ? void 0 : _e.tickMode
|
|
44823
44868
|
}
|
|
44824
44869
|
}, !0);
|
|
44825
|
-
}), null === (_c = null === (_b = table.internalProps.layoutMap) || void 0 === _b ? void 0 : _b.updateDataStateToActiveChartInstance) || void 0 === _c || _c.call(_b, chartInstance), "string" == typeof dataId) chartInstance.getChart().setLayoutTag(!0), chartInstance.updateDataSync(dataId, null != data ? data : []);else {
|
|
44870
|
+
}), null === (_c = null === (_b = table.internalProps.layoutMap) || void 0 === _b ? void 0 : _b.updateDataStateToActiveChartInstance) || void 0 === _c || _c.call(_b, chartInstance), "string" == typeof dataId || "number" == typeof dataId) chartInstance.getChart().setLayoutTag(!0), chartInstance.updateDataSync(dataId, null != data ? data : []);else {
|
|
44826
44871
|
const dataBatch = [];
|
|
44827
44872
|
for (const dataIdStr in dataId) {
|
|
44828
44873
|
const dataIdAndField = dataId[dataIdStr],
|
|
@@ -44974,7 +45019,7 @@
|
|
|
44974
45019
|
chartStage.needRender = !0;
|
|
44975
45020
|
const matrix = chart.globalTransMatrix.clone(),
|
|
44976
45021
|
stageMatrix = chart.stage.window.getViewBoxTransform().clone();
|
|
44977
|
-
if (stageMatrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), chartStage.window.setViewBoxTransform(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f), "string" == typeof dataId) activeChartInstance.updateDataSync(dataId, null != data ? data : []);else {
|
|
45022
|
+
if (stageMatrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), chartStage.window.setViewBoxTransform(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f), "string" == typeof dataId || "number" == typeof dataId) activeChartInstance.updateDataSync(dataId, null != data ? data : []);else {
|
|
44978
45023
|
const dataBatch = [];
|
|
44979
45024
|
for (const dataIdStr in dataId) {
|
|
44980
45025
|
const dataIdAndField = dataId[dataIdStr],
|
|
@@ -53401,7 +53446,7 @@
|
|
|
53401
53446
|
};
|
|
53402
53447
|
class EventManager {
|
|
53403
53448
|
constructor(table) {
|
|
53404
|
-
this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
|
|
53449
|
+
this.isDown = !1, this.isDraging = !1, this.globalEventListeners = [], this._enableTableScroll = !0, this.cutWaitPaste = !1, this.clipboardCheckTimer = null, this.cutOperationTime = 0, this.lastClipboardContent = "", this.cutCellRange = null, this.copySourceRange = null, this.table = table, this.handleTextStickBindId = [], this.inertiaScroll = new InertiaScroll(table.stateManager), "node" === Env.mode || table.options.disableInteraction || (this.bindOuterEvent(), setTimeout(() => {
|
|
53405
53450
|
this.bindSelfEvent();
|
|
53406
53451
|
}, 0));
|
|
53407
53452
|
}
|
|
@@ -53631,49 +53676,76 @@
|
|
|
53631
53676
|
this._enableTableScroll = !1;
|
|
53632
53677
|
}
|
|
53633
53678
|
handleCopy(e, isCut = !1) {
|
|
53634
|
-
var _a, _b;
|
|
53679
|
+
var _a, _b, _c, _d, _e, _f;
|
|
53635
53680
|
return __awaiter$1(this, void 0, void 0, function* () {
|
|
53636
53681
|
const table = this.table;
|
|
53637
|
-
!isCut && (this.cutWaitPaste = !1);
|
|
53638
|
-
const
|
|
53682
|
+
!isCut && (this.cutWaitPaste = !1), this.copySourceRange = null;
|
|
53683
|
+
const sourceRanges = table.stateManager.select.ranges;
|
|
53684
|
+
if (sourceRanges && 1 === sourceRanges.length) {
|
|
53685
|
+
const sourceRange = sourceRanges[0];
|
|
53686
|
+
this.copySourceRange = {
|
|
53687
|
+
startCol: Math.min(sourceRange.start.col, sourceRange.end.col),
|
|
53688
|
+
startRow: Math.min(sourceRange.start.row, sourceRange.end.row)
|
|
53689
|
+
};
|
|
53690
|
+
} else if (!(null == sourceRanges ? void 0 : sourceRanges.length)) return void (this.copySourceRange = null);
|
|
53691
|
+
const data = this.table.getCopyValue(null === (_b = null === (_a = table.options.keyboardOptions) || void 0 === _a ? void 0 : _a.getCopyCellValue) || void 0 === _b ? void 0 : _b.value);
|
|
53639
53692
|
if (isValid$3(data)) {
|
|
53640
53693
|
e.preventDefault();
|
|
53641
|
-
const
|
|
53642
|
-
|
|
53643
|
-
|
|
53644
|
-
|
|
53645
|
-
|
|
53646
|
-
|
|
53647
|
-
|
|
53648
|
-
|
|
53649
|
-
|
|
53650
|
-
|
|
53651
|
-
|
|
53652
|
-
|
|
53653
|
-
|
|
53654
|
-
|
|
53655
|
-
|
|
53656
|
-
|
|
53657
|
-
|
|
53658
|
-
|
|
53659
|
-
|
|
53660
|
-
|
|
53661
|
-
|
|
53662
|
-
|
|
53663
|
-
|
|
53664
|
-
|
|
53665
|
-
|
|
53666
|
-
|
|
53667
|
-
|
|
53668
|
-
|
|
53669
|
-
|
|
53670
|
-
|
|
53671
|
-
|
|
53672
|
-
|
|
53694
|
+
const element = table.getElement();
|
|
53695
|
+
element && element !== document.activeElement && (element.focus(), yield new Promise(resolve => setTimeout(resolve, 10)));
|
|
53696
|
+
try {
|
|
53697
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
53698
|
+
let hasPermission = !0;
|
|
53699
|
+
if (navigator.permissions && navigator.permissions.query) try {
|
|
53700
|
+
hasPermission = "granted" === (yield navigator.permissions.query({
|
|
53701
|
+
name: "clipboard-write"
|
|
53702
|
+
})).state;
|
|
53703
|
+
} catch (permissionError) {
|
|
53704
|
+
hasPermission = !0;
|
|
53705
|
+
}
|
|
53706
|
+
if (hasPermission) try {
|
|
53707
|
+
if (window.ClipboardItem) {
|
|
53708
|
+
let htmlValues = data;
|
|
53709
|
+
1 === table.stateManager.select.ranges.length && (null === (_d = null === (_c = table.options.keyboardOptions) || void 0 === _c ? void 0 : _c.getCopyCellValue) || void 0 === _d ? void 0 : _d.html) && (htmlValues = this.table.getCopyValue(null === (_e = table.options.keyboardOptions) || void 0 === _e ? void 0 : _e.getCopyCellValue.html));
|
|
53710
|
+
const dataHTML = setDataToHTML(htmlValues);
|
|
53711
|
+
yield navigator.clipboard.write([new ClipboardItem({
|
|
53712
|
+
"text/html": new Blob([dataHTML], {
|
|
53713
|
+
type: "text/html"
|
|
53714
|
+
}),
|
|
53715
|
+
"text/plain": new Blob([data], {
|
|
53716
|
+
type: "text/plain"
|
|
53717
|
+
})
|
|
53718
|
+
})]);
|
|
53719
|
+
} else yield navigator.clipboard.writeText(data);
|
|
53720
|
+
} catch (clipboardError) {
|
|
53721
|
+
this.fallbackCopyToClipboard(data, e);
|
|
53722
|
+
} else this.fallbackCopyToClipboard(data, e);
|
|
53723
|
+
} else this.fallbackCopyToClipboard(data, e);
|
|
53724
|
+
table.fireListeners(TABLE_EVENT_TYPE.COPY_DATA, {
|
|
53725
|
+
cellRange: table.stateManager.select.ranges,
|
|
53726
|
+
copyData: data,
|
|
53727
|
+
isCut: isCut
|
|
53728
|
+
});
|
|
53729
|
+
} catch (error) {
|
|
53730
|
+
this.fallbackCopyToClipboard(data, e);
|
|
53731
|
+
}
|
|
53673
53732
|
}
|
|
53674
|
-
(null === (
|
|
53733
|
+
(null === (_f = table.keyboardOptions) || void 0 === _f ? void 0 : _f.showCopyCellBorder) && (setActiveCellRangeState(table), table.clearSelected());
|
|
53675
53734
|
});
|
|
53676
53735
|
}
|
|
53736
|
+
fallbackCopyToClipboard(data, e) {
|
|
53737
|
+
try {
|
|
53738
|
+
if (e.clipboardData) return void e.clipboardData.setData("text/plain", data);
|
|
53739
|
+
document.activeElement && document.activeElement !== document.body && document.activeElement.blur();
|
|
53740
|
+
const textArea = document.createElement("textarea");
|
|
53741
|
+
textArea.value = data, textArea.style.position = "fixed", textArea.style.left = "-999999px", textArea.style.top = "-999999px", textArea.style.opacity = "0", textArea.setAttribute("readonly", ""), textArea.setAttribute("aria-hidden", "true"), document.body.appendChild(textArea), textArea.focus(), textArea.select(), textArea.setSelectionRange(0, data.length);
|
|
53742
|
+
try {
|
|
53743
|
+
document.execCommand("copy");
|
|
53744
|
+
} catch (execError) {} finally {
|
|
53745
|
+
document.body.removeChild(textArea);
|
|
53746
|
+
}
|
|
53747
|
+
} catch (error) {}
|
|
53748
|
+
}
|
|
53677
53749
|
handleCut(e) {
|
|
53678
53750
|
return __awaiter$1(this, void 0, void 0, function* () {
|
|
53679
53751
|
this.handleCopy(e, !0), this.cutWaitPaste = !0, this.cutCellRange = this.table.getSelectedCellInfos(), this.clipboardCheckTimer && clearTimeout(this.clipboardCheckTimer), this.clipboardCheckTimer = window.setTimeout(() => {
|
|
@@ -53689,36 +53761,73 @@
|
|
|
53689
53761
|
}) : this.executePaste(e);
|
|
53690
53762
|
}
|
|
53691
53763
|
executePaste(e) {
|
|
53692
|
-
var _a, _b, _c
|
|
53764
|
+
var _a, _b, _c;
|
|
53693
53765
|
return __awaiter$1(this, void 0, void 0, function* () {
|
|
53694
53766
|
const table = this.table;
|
|
53695
|
-
if (table.
|
|
53696
|
-
if (null === (
|
|
53697
|
-
|
|
53698
|
-
|
|
53699
|
-
|
|
53700
|
-
|
|
53701
|
-
|
|
53702
|
-
|
|
53703
|
-
|
|
53704
|
-
|
|
53705
|
-
|
|
53706
|
-
|
|
53707
|
-
|
|
53708
|
-
|
|
53709
|
-
|
|
53710
|
-
|
|
53711
|
-
})
|
|
53712
|
-
|
|
53713
|
-
|
|
53714
|
-
|
|
53715
|
-
|
|
53716
|
-
pasteData: values,
|
|
53717
|
-
changedCellResults: changedCellResults
|
|
53718
|
-
});
|
|
53767
|
+
if (!(null === (_a = table.editorManager) || void 0 === _a ? void 0 : _a.editingEditor)) {
|
|
53768
|
+
if (table.changeCellValues && (null === (_b = table.stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length) > 0) try {
|
|
53769
|
+
if (navigator.clipboard && navigator.clipboard.read) try {
|
|
53770
|
+
const clipboardItems = yield navigator.clipboard.read();
|
|
53771
|
+
let handled = !1;
|
|
53772
|
+
for (const item of clipboardItems) {
|
|
53773
|
+
if (item.types.includes("text/html")) {
|
|
53774
|
+
yield this.pasteHtmlToTable(item), handled = !0;
|
|
53775
|
+
break;
|
|
53776
|
+
}
|
|
53777
|
+
if (item.types.includes("text/plain")) {
|
|
53778
|
+
yield this.pasteTextToTable(item), handled = !0;
|
|
53779
|
+
break;
|
|
53780
|
+
}
|
|
53781
|
+
}
|
|
53782
|
+
handled || (yield this.fallbackPasteFromClipboard(e));
|
|
53783
|
+
} catch (clipboardError) {
|
|
53784
|
+
yield this.fallbackPasteFromClipboard(e);
|
|
53785
|
+
} else yield this.fallbackPasteFromClipboard(e);
|
|
53786
|
+
} catch (error) {
|
|
53787
|
+
yield this.fallbackPasteFromClipboard(e);
|
|
53719
53788
|
}
|
|
53789
|
+
(null === (_c = table.keyboardOptions) || void 0 === _c ? void 0 : _c.showCopyCellBorder) && clearActiveCellRangeState(table);
|
|
53720
53790
|
}
|
|
53721
|
-
|
|
53791
|
+
});
|
|
53792
|
+
}
|
|
53793
|
+
fallbackPasteFromClipboard(e) {
|
|
53794
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
53795
|
+
const table = this.table,
|
|
53796
|
+
ranges = table.stateManager.select.ranges,
|
|
53797
|
+
col = Math.min(ranges[0].start.col, ranges[0].end.col),
|
|
53798
|
+
row = Math.min(ranges[0].start.row, ranges[0].end.row);
|
|
53799
|
+
try {
|
|
53800
|
+
const element = table.getElement();
|
|
53801
|
+
element && element !== document.activeElement && (element.focus(), yield new Promise(resolve => setTimeout(resolve, 10)));
|
|
53802
|
+
const clipboardData = e.clipboardData || window.clipboardData || window.Clipboard;
|
|
53803
|
+
if (clipboardData) {
|
|
53804
|
+
const pastedData = clipboardData.getData("text") || clipboardData.getData("Text");
|
|
53805
|
+
if (pastedData) return void (yield this.processPastedText(pastedData, col, row));
|
|
53806
|
+
}
|
|
53807
|
+
} catch (error) {}
|
|
53808
|
+
});
|
|
53809
|
+
}
|
|
53810
|
+
processPastedText(pastedData, col, row) {
|
|
53811
|
+
var _a;
|
|
53812
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
53813
|
+
const table = this.table,
|
|
53814
|
+
rows = pastedData.split("\n"),
|
|
53815
|
+
values = [];
|
|
53816
|
+
let processedValues;
|
|
53817
|
+
rows.forEach(function (rowCells) {
|
|
53818
|
+
const cells = rowCells.split("\t"),
|
|
53819
|
+
rowValues = [];
|
|
53820
|
+
values.push(rowValues), cells.forEach(function (cell, cellIndex) {
|
|
53821
|
+
cellIndex === cells.length - 1 && (cell = cell.trim()), rowValues.push(cell);
|
|
53822
|
+
});
|
|
53823
|
+
}), (null === (_a = table.options.keyboardOptions) || void 0 === _a ? void 0 : _a.processFormulaBeforePaste) && this.copySourceRange && (processedValues = table.options.keyboardOptions.processFormulaBeforePaste(values, this.copySourceRange.startCol, this.copySourceRange.startRow, col, row));
|
|
53824
|
+
const changedCellResults = yield table.changeCellValues(col, row, processedValues || values, !0);
|
|
53825
|
+
table.hasListeners(TABLE_EVENT_TYPE.PASTED_DATA) && table.fireListeners(TABLE_EVENT_TYPE.PASTED_DATA, {
|
|
53826
|
+
col: col,
|
|
53827
|
+
row: row,
|
|
53828
|
+
pasteData: processedValues || values,
|
|
53829
|
+
changedCellResults: changedCellResults
|
|
53830
|
+
});
|
|
53722
53831
|
});
|
|
53723
53832
|
}
|
|
53724
53833
|
clearCutArea(table) {
|
|
@@ -53760,7 +53869,7 @@
|
|
|
53760
53869
|
values = [];
|
|
53761
53870
|
item.getType("text/html").then(blob => {
|
|
53762
53871
|
blob.text().then(pastedData => __awaiter$1(this, void 0, void 0, function* () {
|
|
53763
|
-
var _a, _b;
|
|
53872
|
+
var _a, _b, _c;
|
|
53764
53873
|
if (pastedData && /(<table)|(<TABLE)/g.test(pastedData)) {
|
|
53765
53874
|
const matches = Array.from(pastedData.matchAll(regex));
|
|
53766
53875
|
for (const match of matches) {
|
|
@@ -53768,12 +53877,13 @@
|
|
|
53768
53877
|
rowValues = Array.from(rowContent.matchAll(cellRegex)).map(cellMatch => cellMatch[1].replace(/(<(?!br)([^>]+)>)/gi, "").replace(/<br(\s*|\/)>[\r\n]?/gim, "\n").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/	/gi, "\t").replace(/ /g, " "));
|
|
53769
53878
|
values.push(rowValues), pasteValuesColCount = Math.max(pasteValuesColCount, null !== (_a = null == rowValues ? void 0 : rowValues.length) && void 0 !== _a ? _a : 0);
|
|
53770
53879
|
}
|
|
53771
|
-
|
|
53772
|
-
|
|
53880
|
+
let processedValues;
|
|
53881
|
+
pasteValuesRowCount = null !== (_b = values.length) && void 0 !== _b ? _b : 0, values = this.handlePasteValues(values, pasteValuesRowCount, pasteValuesColCount, maxRow - row + 1, maxCol - col + 1), (null === (_c = table.options.keyboardOptions) || void 0 === _c ? void 0 : _c.processFormulaBeforePaste) && this.copySourceRange && (processedValues = table.options.keyboardOptions.processFormulaBeforePaste(values, this.copySourceRange.startCol, this.copySourceRange.startRow, col, row));
|
|
53882
|
+
const changedCellResults = yield table.changeCellValues(col, row, processedValues || values, !0);
|
|
53773
53883
|
table.hasListeners(TABLE_EVENT_TYPE.PASTED_DATA) && table.fireListeners(TABLE_EVENT_TYPE.PASTED_DATA, {
|
|
53774
53884
|
col: col,
|
|
53775
53885
|
row: row,
|
|
53776
|
-
pasteData: values,
|
|
53886
|
+
pasteData: processedValues || values,
|
|
53777
53887
|
changedCellResults: changedCellResults
|
|
53778
53888
|
});
|
|
53779
53889
|
} else navigator.clipboard.read().then(clipboardItems => {
|
|
@@ -53785,7 +53895,7 @@
|
|
|
53785
53895
|
});
|
|
53786
53896
|
}
|
|
53787
53897
|
_pasteValue(pastedData) {
|
|
53788
|
-
var _a;
|
|
53898
|
+
var _a, _b;
|
|
53789
53899
|
return __awaiter$1(this, void 0, void 0, function* () {
|
|
53790
53900
|
const table = this.table,
|
|
53791
53901
|
ranges = table.stateManager.select.ranges,
|
|
@@ -53797,6 +53907,7 @@
|
|
|
53797
53907
|
let pasteValuesColCount = 0,
|
|
53798
53908
|
pasteValuesRowCount = 0,
|
|
53799
53909
|
values = [];
|
|
53910
|
+
let processedValues;
|
|
53800
53911
|
pastedData.split("\n").forEach(function (rowCells, rowIndex) {
|
|
53801
53912
|
var _a;
|
|
53802
53913
|
const cells = rowCells.split("\t"),
|
|
@@ -53804,49 +53915,55 @@
|
|
|
53804
53915
|
values.push(rowValues), cells.forEach(function (cell, cellIndex) {
|
|
53805
53916
|
cellIndex === cells.length - 1 && (cell = cell.trim()), rowValues.push(cell);
|
|
53806
53917
|
}), pasteValuesColCount = Math.max(pasteValuesColCount, null !== (_a = null == rowValues ? void 0 : rowValues.length) && void 0 !== _a ? _a : 0);
|
|
53807
|
-
}), pasteValuesRowCount = null !== (_a = values.length) && void 0 !== _a ? _a : 0, values = this.handlePasteValues(values, pasteValuesRowCount, pasteValuesColCount, maxRow - row + 1, maxCol - col + 1);
|
|
53808
|
-
const changedCellResults = yield table.changeCellValues(col, row, values, !0);
|
|
53918
|
+
}), pasteValuesRowCount = null !== (_a = values.length) && void 0 !== _a ? _a : 0, values = this.handlePasteValues(values, pasteValuesRowCount, pasteValuesColCount, maxRow - row + 1, maxCol - col + 1), (null === (_b = table.options.keyboardOptions) || void 0 === _b ? void 0 : _b.processFormulaBeforePaste) && this.copySourceRange && (processedValues = table.options.keyboardOptions.processFormulaBeforePaste(values, this.copySourceRange.startCol, this.copySourceRange.startRow, col, row));
|
|
53919
|
+
const changedCellResults = yield table.changeCellValues(col, row, processedValues || values, !0);
|
|
53809
53920
|
table.hasListeners(TABLE_EVENT_TYPE.PASTED_DATA) && table.fireListeners(TABLE_EVENT_TYPE.PASTED_DATA, {
|
|
53810
53921
|
col: col,
|
|
53811
53922
|
row: row,
|
|
53812
|
-
pasteData: values,
|
|
53923
|
+
pasteData: processedValues || values,
|
|
53813
53924
|
changedCellResults: changedCellResults
|
|
53814
53925
|
});
|
|
53815
53926
|
});
|
|
53816
53927
|
}
|
|
53817
53928
|
pasteTextToTable(item) {
|
|
53818
|
-
|
|
53819
|
-
|
|
53820
|
-
|
|
53821
|
-
|
|
53822
|
-
|
|
53823
|
-
|
|
53824
|
-
|
|
53825
|
-
|
|
53826
|
-
|
|
53827
|
-
|
|
53828
|
-
|
|
53829
|
-
|
|
53830
|
-
|
|
53831
|
-
|
|
53832
|
-
|
|
53833
|
-
|
|
53834
|
-
const cells = rowCells.split("\t"),
|
|
53835
|
-
rowValues = [];
|
|
53836
|
-
values.push(rowValues), cells.forEach(function (cell, cellIndex) {
|
|
53837
|
-
cell.includes("\n") && (cell = cell.replace(/^"(.*)"$/, "$1").replace(/["]*/g, match => new Array(Math.floor(match.length / 2)).fill('"').join(""))), rowValues.push(cell);
|
|
53838
|
-
}), pasteValuesColCount = Math.max(pasteValuesColCount, null !== (_a = null == rowValues ? void 0 : rowValues.length) && void 0 !== _a ? _a : 0);
|
|
53839
|
-
}), pasteValuesRowCount = null !== (_a = values.length) && void 0 !== _a ? _a : 0, values = this.handlePasteValues(values, pasteValuesRowCount, pasteValuesColCount, maxRow - row + 1, maxCol - col + 1);
|
|
53840
|
-
const changedCellResults = yield table.changeCellValues(col, row, values, !0);
|
|
53929
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
53930
|
+
const table = this.table,
|
|
53931
|
+
ranges = table.stateManager.select.ranges,
|
|
53932
|
+
selectRangeLength = ranges.length,
|
|
53933
|
+
col = Math.min(ranges[selectRangeLength - 1].start.col, ranges[selectRangeLength - 1].end.col),
|
|
53934
|
+
row = Math.min(ranges[selectRangeLength - 1].start.row, ranges[selectRangeLength - 1].end.row),
|
|
53935
|
+
maxCol = Math.max(ranges[selectRangeLength - 1].start.col, ranges[selectRangeLength - 1].end.col),
|
|
53936
|
+
maxRow = Math.max(ranges[selectRangeLength - 1].start.row, ranges[selectRangeLength - 1].end.row);
|
|
53937
|
+
try {
|
|
53938
|
+
const blob = yield item.getType("text/plain"),
|
|
53939
|
+
pastedData = yield blob.text(),
|
|
53940
|
+
values = this.parsePastedData(pastedData),
|
|
53941
|
+
pasteValuesRowCount = values.length,
|
|
53942
|
+
pasteValuesColCount = Math.max(...values.map(row => row.length), 0),
|
|
53943
|
+
processedValues = this.handlePasteValues(values, pasteValuesRowCount, pasteValuesColCount, maxRow - row + 1, maxCol - col + 1),
|
|
53944
|
+
changedCellResults = yield table.changeCellValues(col, row, processedValues, !0);
|
|
53841
53945
|
table.hasListeners(TABLE_EVENT_TYPE.PASTED_DATA) && table.fireListeners(TABLE_EVENT_TYPE.PASTED_DATA, {
|
|
53842
53946
|
col: col,
|
|
53843
53947
|
row: row,
|
|
53844
|
-
pasteData:
|
|
53948
|
+
pasteData: processedValues,
|
|
53845
53949
|
changedCellResults: changedCellResults
|
|
53846
53950
|
});
|
|
53847
|
-
})
|
|
53951
|
+
} catch (error) {}
|
|
53848
53952
|
});
|
|
53849
53953
|
}
|
|
53954
|
+
parsePastedData(pastedData) {
|
|
53955
|
+
const rows = pastedData.replace(/\r(?!\n)/g, "\r\n").split("\r\n"),
|
|
53956
|
+
values = [];
|
|
53957
|
+
return rows.length > 1 && "" === rows[rows.length - 1] && rows.pop(), rows.forEach(rowCells => {
|
|
53958
|
+
const rowValues = rowCells.split("\t").map(cell => this.processCellValue(cell));
|
|
53959
|
+
values.push(rowValues);
|
|
53960
|
+
}), values;
|
|
53961
|
+
}
|
|
53962
|
+
processCellValue(cell) {
|
|
53963
|
+
cell.includes("\n") && (cell = cell.replace(/^"(.*)"$/, "$1").replace(/["]*/g, match => new Array(Math.floor(match.length / 2)).fill('"').join("")));
|
|
53964
|
+
const numValue = Number(cell);
|
|
53965
|
+
return isNaN(numValue) ? cell : numValue;
|
|
53966
|
+
}
|
|
53850
53967
|
handlePasteValues(values, rowCount, colCount, selectedRowCount, selectedColCount) {
|
|
53851
53968
|
if (selectedColCount > colCount || selectedRowCount > rowCount) {
|
|
53852
53969
|
if (selectedColCount % colCount == 0 && selectedRowCount % rowCount == 0) {
|
|
@@ -55953,7 +56070,7 @@
|
|
|
55953
56070
|
}
|
|
55954
56071
|
constructor(container, options = {}) {
|
|
55955
56072
|
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;
|
|
55956
|
-
if (super(), this.showFrozenIcon = !0, this.version = "1.22.
|
|
56073
|
+
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.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");
|
|
55957
56074
|
this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
|
|
55958
56075
|
options: options,
|
|
55959
56076
|
container: container
|
|
@@ -56794,7 +56911,7 @@
|
|
|
56794
56911
|
colEnd: colEnd
|
|
56795
56912
|
};
|
|
56796
56913
|
}
|
|
56797
|
-
getBodyVisibleRowRange(
|
|
56914
|
+
getBodyVisibleRowRange(start_deltaY = 0, end_deltaY = 0) {
|
|
56798
56915
|
const {
|
|
56799
56916
|
scrollTop: scrollTop
|
|
56800
56917
|
} = this,
|
|
@@ -56802,14 +56919,14 @@
|
|
|
56802
56919
|
bottomFrozenRowsHeight = this.getBottomFrozenRowsHeight(),
|
|
56803
56920
|
{
|
|
56804
56921
|
row: rowStart
|
|
56805
|
-
} = this.getRowAt(scrollTop + frozenRowsHeight + 1),
|
|
56806
|
-
rowEnd = this.getAllRowsHeight() > this.tableNoFrameHeight ? this.getRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight +
|
|
56922
|
+
} = this.getRowAt(scrollTop + frozenRowsHeight + 1 + start_deltaY),
|
|
56923
|
+
rowEnd = this.getAllRowsHeight() > this.tableNoFrameHeight ? this.getRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight + end_deltaY).row : this.rowCount - 1;
|
|
56807
56924
|
return rowEnd < 0 ? null : {
|
|
56808
56925
|
rowStart: rowStart,
|
|
56809
56926
|
rowEnd: rowEnd
|
|
56810
56927
|
};
|
|
56811
56928
|
}
|
|
56812
|
-
getBodyVisibleColRange(
|
|
56929
|
+
getBodyVisibleColRange(start_deltaX = 0, end_deltaX = 0) {
|
|
56813
56930
|
const {
|
|
56814
56931
|
scrollLeft: scrollLeft
|
|
56815
56932
|
} = this,
|
|
@@ -56817,8 +56934,8 @@
|
|
|
56817
56934
|
rightFrozenColsWidth = this.getRightFrozenColsWidth(),
|
|
56818
56935
|
{
|
|
56819
56936
|
col: colStart
|
|
56820
|
-
} = this.getColAt(scrollLeft + frozenColsWidth + 1),
|
|
56821
|
-
colEnd = this.getAllColsWidth() > this.tableNoFrameWidth ? this.getColAt(scrollLeft + this.tableNoFrameWidth - 1 - rightFrozenColsWidth +
|
|
56937
|
+
} = this.getColAt(scrollLeft + frozenColsWidth + 1 + start_deltaX),
|
|
56938
|
+
colEnd = this.getAllColsWidth() > this.tableNoFrameWidth ? this.getColAt(scrollLeft + this.tableNoFrameWidth - 1 - rightFrozenColsWidth + end_deltaX).col : this.colCount - 1;
|
|
56822
56939
|
return colEnd < 0 ? null : {
|
|
56823
56940
|
colStart: colStart,
|
|
56824
56941
|
colEnd: colEnd
|
|
@@ -57612,7 +57729,7 @@
|
|
|
57612
57729
|
end_row = this.rowCount - 1;
|
|
57613
57730
|
return Array(end_row - start_row + 1).fill(0).map((_, i) => Array(end_col - start_col + 1).fill(0).map((_, j) => this.getCellInfo(j + start_col, i + start_row)));
|
|
57614
57731
|
}
|
|
57615
|
-
getCopyValue() {
|
|
57732
|
+
getCopyValue(getCellValueFunction) {
|
|
57616
57733
|
var _a, _b, _c;
|
|
57617
57734
|
if ((null === (_b = null === (_a = this.stateManager.select) || void 0 === _a ? void 0 : _a.ranges) || void 0 === _b ? void 0 : _b.length) > 0) {
|
|
57618
57735
|
const ranges = this.stateManager.select.ranges;
|
|
@@ -57659,7 +57776,7 @@
|
|
|
57659
57776
|
copyStartCol = Math.max(rangeMinCol, cellRange.start.col), copyStartRow = Math.max(rangeMinRow, cellRange.start.row);
|
|
57660
57777
|
}
|
|
57661
57778
|
if (copyStartCol !== col || copyStartRow !== row) return "";
|
|
57662
|
-
return this.getCellValue(col, row);
|
|
57779
|
+
return getCellValueFunction ? getCellValueFunction(col, row) : this.getCellValue(col, row);
|
|
57663
57780
|
};
|
|
57664
57781
|
let copyValue = "";
|
|
57665
57782
|
for (let r = minRow; r <= maxRow; r++) {
|