@visactor/vtable 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/cjs/PivotChart.js +2 -2
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +3 -3
- package/cjs/core/BaseTable.js +7 -7
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/dataset/dataset.js +2 -1
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/event/event.d.ts +9 -0
- package/cjs/event/event.js +158 -84
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/util.d.ts +1 -0
- package/cjs/event/util.js +13 -2
- package/cjs/event/util.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/chart-helper/get-axis-config.js +7 -1
- package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
- package/cjs/layout/pivot-header-layout.js +5 -3
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/scenegraph/graphic/active-cell-chart-list.js +62 -44
- package/cjs/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
- package/cjs/scenegraph/graphic/chart.js +14 -3
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +2 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.js +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +3 -3
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +7 -2
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +456 -256
- package/dist/vtable.min.js +2 -2
- package/es/PivotChart.js +2 -2
- package/es/PivotChart.js.map +1 -1
- package/es/core/BaseTable.d.ts +3 -3
- package/es/core/BaseTable.js +7 -7
- package/es/core/BaseTable.js.map +1 -1
- package/es/dataset/dataset.js +1 -1
- package/es/dataset/dataset.js.map +1 -1
- package/es/event/event.d.ts +9 -0
- package/es/event/event.js +158 -84
- package/es/event/event.js.map +1 -1
- package/es/event/util.d.ts +1 -0
- package/es/event/util.js +11 -0
- package/es/event/util.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/chart-helper/get-axis-config.js +7 -1
- package/es/layout/chart-helper/get-axis-config.js.map +1 -1
- package/es/layout/pivot-header-layout.js +5 -3
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/scenegraph/graphic/active-cell-chart-list.js +62 -44
- package/es/scenegraph/graphic/active-cell-chart-list.js.map +1 -1
- package/es/scenegraph/graphic/chart.js +14 -3
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +2 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.js +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/es/ts-types/base-table.d.ts +3 -3
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +7 -2
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
package/dist/vtable.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;
|
|
@@ -21088,16 +21088,16 @@
|
|
|
21088
21088
|
};
|
|
21089
21089
|
decompressFrames_1 = lib$1.decompressFrames = decompressFrames;
|
|
21090
21090
|
|
|
21091
|
-
const browser
|
|
21091
|
+
const browser = isBrowserEnv();
|
|
21092
21092
|
|
|
21093
21093
|
function _registerArc() {
|
|
21094
|
-
_registerArc.__loaded || (_registerArc.__loaded = !0, registerArcGraphic(), container.load(arcModule), container.load(browser
|
|
21094
|
+
_registerArc.__loaded || (_registerArc.__loaded = !0, registerArcGraphic(), container.load(arcModule), container.load(browser ? arcCanvasPickModule : arcMathPickModule));
|
|
21095
21095
|
}
|
|
21096
21096
|
_registerArc.__loaded = !1;
|
|
21097
21097
|
const registerArc = _registerArc;
|
|
21098
21098
|
|
|
21099
21099
|
function _registerCircle() {
|
|
21100
|
-
_registerCircle.__loaded || (_registerCircle.__loaded = !0, registerCircleGraphic(), container.load(circleModule), container.load(browser
|
|
21100
|
+
_registerCircle.__loaded || (_registerCircle.__loaded = !0, registerCircleGraphic(), container.load(circleModule), container.load(browser ? circleCanvasPickModule : circleMathPickModule));
|
|
21101
21101
|
}
|
|
21102
21102
|
_registerCircle.__loaded = !1;
|
|
21103
21103
|
const registerCircle = _registerCircle;
|
|
@@ -21109,37 +21109,37 @@
|
|
|
21109
21109
|
const registerGroup = _registerGroup;
|
|
21110
21110
|
|
|
21111
21111
|
function _registerImage() {
|
|
21112
|
-
_registerImage.__loaded || (_registerImage.__loaded = !0, registerImageGraphic(), container.load(imageModule), container.load(browser
|
|
21112
|
+
_registerImage.__loaded || (_registerImage.__loaded = !0, registerImageGraphic(), container.load(imageModule), container.load(browser ? imageCanvasPickModule : imageMathPickModule));
|
|
21113
21113
|
}
|
|
21114
21114
|
_registerImage.__loaded = !1;
|
|
21115
21115
|
const registerImage = _registerImage;
|
|
21116
21116
|
|
|
21117
21117
|
function _registerLine() {
|
|
21118
|
-
_registerLine.__loaded || (_registerLine.__loaded = !0, registerLineGraphic(), container.load(lineModule), container.load(browser
|
|
21118
|
+
_registerLine.__loaded || (_registerLine.__loaded = !0, registerLineGraphic(), container.load(lineModule), container.load(browser ? lineCanvasPickModule : lineMathPickModule));
|
|
21119
21119
|
}
|
|
21120
21120
|
_registerLine.__loaded = !1;
|
|
21121
21121
|
const registerLine = _registerLine;
|
|
21122
21122
|
|
|
21123
21123
|
function _registerPath() {
|
|
21124
|
-
_registerPath.__loaded || (_registerPath.__loaded = !0, registerPathGraphic(), container.load(pathModule), container.load(browser
|
|
21124
|
+
_registerPath.__loaded || (_registerPath.__loaded = !0, registerPathGraphic(), container.load(pathModule), container.load(browser ? pathCanvasPickModule : pathMathPickModule));
|
|
21125
21125
|
}
|
|
21126
21126
|
_registerPath.__loaded = !1;
|
|
21127
21127
|
const registerPath = _registerPath;
|
|
21128
21128
|
|
|
21129
21129
|
function _registerPolygon() {
|
|
21130
|
-
_registerPolygon.__loaded || (_registerPolygon.__loaded = !0, registerPolygonGraphic(), container.load(polygonModule), container.load(browser
|
|
21130
|
+
_registerPolygon.__loaded || (_registerPolygon.__loaded = !0, registerPolygonGraphic(), container.load(polygonModule), container.load(browser ? polygonCanvasPickModule : polygonMathPickModule));
|
|
21131
21131
|
}
|
|
21132
21132
|
_registerPolygon.__loaded = !1;
|
|
21133
21133
|
const registerPolygon = _registerPolygon;
|
|
21134
21134
|
|
|
21135
21135
|
function _registerRect() {
|
|
21136
|
-
_registerRect.__loaded || (_registerRect.__loaded = !0, registerRectGraphic(), container.load(rectModule), container.load(browser
|
|
21136
|
+
_registerRect.__loaded || (_registerRect.__loaded = !0, registerRectGraphic(), container.load(rectModule), container.load(browser ? rectCanvasPickModule : rectMathPickModule));
|
|
21137
21137
|
}
|
|
21138
21138
|
_registerRect.__loaded = !1;
|
|
21139
21139
|
const registerRect = _registerRect;
|
|
21140
21140
|
|
|
21141
21141
|
function _registerRichtext() {
|
|
21142
|
-
_registerRichtext.__loaded || (_registerRichtext.__loaded = !0, registerRichtextGraphic(), container.load(richtextModule), container.load(browser
|
|
21142
|
+
_registerRichtext.__loaded || (_registerRichtext.__loaded = !0, registerRichtextGraphic(), container.load(richtextModule), container.load(browser ? richtextCanvasPickModule : richTextMathPickModule));
|
|
21143
21143
|
}
|
|
21144
21144
|
_registerRichtext.__loaded = !1;
|
|
21145
21145
|
const registerRichtext = _registerRichtext;
|
|
@@ -21151,13 +21151,13 @@
|
|
|
21151
21151
|
const registerShadowRoot = _registerShadowRoot;
|
|
21152
21152
|
|
|
21153
21153
|
function _registerSymbol() {
|
|
21154
|
-
_registerSymbol.__loaded || (_registerSymbol.__loaded = !0, registerSymbolGraphic(), container.load(symbolModule), container.load(browser
|
|
21154
|
+
_registerSymbol.__loaded || (_registerSymbol.__loaded = !0, registerSymbolGraphic(), container.load(symbolModule), container.load(browser ? symbolCanvasPickModule : symbolMathPickModule));
|
|
21155
21155
|
}
|
|
21156
21156
|
_registerSymbol.__loaded = !1;
|
|
21157
21157
|
const registerSymbol = _registerSymbol;
|
|
21158
21158
|
|
|
21159
21159
|
function _registerText() {
|
|
21160
|
-
_registerText.__loaded || (_registerText.__loaded = !0, registerTextGraphic(), container.load(textModule), container.load(browser
|
|
21160
|
+
_registerText.__loaded || (_registerText.__loaded = !0, registerTextGraphic(), container.load(textModule), container.load(browser ? textCanvasPickModule : textMathPickModule));
|
|
21161
21161
|
}
|
|
21162
21162
|
_registerText.__loaded = !1;
|
|
21163
21163
|
const registerText = _registerText;
|
|
@@ -36226,7 +36226,7 @@
|
|
|
36226
36226
|
Safari: ua.indexOf('safari') > -1 && ua.indexOf('edge') === -1
|
|
36227
36227
|
};
|
|
36228
36228
|
}
|
|
36229
|
-
|
|
36229
|
+
analyzeUserAgent();
|
|
36230
36230
|
function isObject$4(obj) {
|
|
36231
36231
|
return obj === Object(obj);
|
|
36232
36232
|
}
|
|
@@ -36374,14 +36374,6 @@
|
|
|
36374
36374
|
}
|
|
36375
36375
|
return false;
|
|
36376
36376
|
}
|
|
36377
|
-
const browser = {
|
|
36378
|
-
IE,
|
|
36379
|
-
Edge,
|
|
36380
|
-
Chrome,
|
|
36381
|
-
Firefox,
|
|
36382
|
-
Safari,
|
|
36383
|
-
heightLimit: Chrome ? 33554431 : Firefox ? 17895588 : 10737433
|
|
36384
|
-
};
|
|
36385
36377
|
const obj = {
|
|
36386
36378
|
isObject: isObject$4
|
|
36387
36379
|
};
|
|
@@ -42951,6 +42943,44 @@
|
|
|
42951
42943
|
return undefined;
|
|
42952
42944
|
}
|
|
42953
42945
|
const regIndexReg = /radio-\d+-\d+-(\d+)/;
|
|
42946
|
+
function setDataToHTML(data) {
|
|
42947
|
+
const result = ['<table>'];
|
|
42948
|
+
const META_HEAD = [
|
|
42949
|
+
'<meta name="author" content="Visactor"/>',
|
|
42950
|
+
'<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'
|
|
42951
|
+
].join('');
|
|
42952
|
+
const rows = data.split('\r\n');
|
|
42953
|
+
rows.forEach(function (rowCells, rowIndex) {
|
|
42954
|
+
const cells = rowCells.split('\t');
|
|
42955
|
+
const rowValues = [];
|
|
42956
|
+
if (rowIndex === 0) {
|
|
42957
|
+
result.push('<tbody>');
|
|
42958
|
+
}
|
|
42959
|
+
cells.forEach(function (cell, cellIndex) {
|
|
42960
|
+
const parsedCellData = !cell
|
|
42961
|
+
? ' '
|
|
42962
|
+
: cell
|
|
42963
|
+
.toString()
|
|
42964
|
+
.replace(/&/g, '&')
|
|
42965
|
+
.replace(/'/g, ''')
|
|
42966
|
+
.replace(/</g, '<')
|
|
42967
|
+
.replace(/>/g, '>')
|
|
42968
|
+
.replace(/\n/g, '<br>')
|
|
42969
|
+
.replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g, '<br>\r\n')
|
|
42970
|
+
.replace(/\x20{2,}/gi, (substring) => {
|
|
42971
|
+
return `<span style="mso-spacerun: yes">${' '.repeat(substring.length - 1)} </span>`;
|
|
42972
|
+
})
|
|
42973
|
+
.replace(/\t/gi, '	');
|
|
42974
|
+
rowValues.push(`<td>${parsedCellData}</td>`);
|
|
42975
|
+
});
|
|
42976
|
+
result.push('<tr>', ...rowValues, '</tr>');
|
|
42977
|
+
if (rowIndex === rows.length - 1) {
|
|
42978
|
+
result.push('</tbody>');
|
|
42979
|
+
}
|
|
42980
|
+
});
|
|
42981
|
+
result.push('</table>');
|
|
42982
|
+
return [META_HEAD, result.join('')].join('');
|
|
42983
|
+
}
|
|
42954
42984
|
|
|
42955
42985
|
const CUSTOM_MERGE_PRE_NAME = '_custom_';
|
|
42956
42986
|
const CUSTOM_CONTAINER_NAME = 'custom-container';
|
|
@@ -48996,57 +49026,76 @@
|
|
|
48996
49026
|
chartInstanceListColumnByColumnDirection[col][i] = chartNode.activeChartInstance;
|
|
48997
49027
|
}
|
|
48998
49028
|
}
|
|
48999
|
-
|
|
49000
|
-
|
|
49001
|
-
|
|
49002
|
-
|
|
49003
|
-
|
|
49004
|
-
|
|
49005
|
-
if (
|
|
49006
|
-
|
|
49007
|
-
|
|
49008
|
-
|
|
49009
|
-
|
|
49010
|
-
|
|
49029
|
+
setTimeout(() => {
|
|
49030
|
+
if (chartInstanceListColumnByColumnDirection[col]?.[i]) {
|
|
49031
|
+
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
49032
|
+
let isShowTooltip = !isScatter;
|
|
49033
|
+
if (!isScatter && typeof chartDimensionLinkage === 'object') {
|
|
49034
|
+
isShowTooltip = chartDimensionLinkage.showTooltip ?? true;
|
|
49035
|
+
if (i === rowEnd && isShowTooltip) {
|
|
49036
|
+
const heightLimitToShowTooltipForEdgeRow = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow;
|
|
49037
|
+
const { rowEnd: rowEnd1 } = table.getBodyVisibleRowRange(0, -heightLimitToShowTooltipForEdgeRow);
|
|
49038
|
+
if (rowEnd1 === rowEnd) {
|
|
49039
|
+
isShowTooltip = true;
|
|
49040
|
+
}
|
|
49041
|
+
else {
|
|
49042
|
+
const { rowEnd: rowEnd2 } = table.getBodyVisibleRowRange(0, 5);
|
|
49043
|
+
if (rowEnd2 !== rowEnd) {
|
|
49011
49044
|
isShowTooltip = true;
|
|
49012
49045
|
}
|
|
49013
49046
|
else {
|
|
49014
|
-
|
|
49015
|
-
if (rowEnd2 !== rowEnd) {
|
|
49016
|
-
isShowTooltip = true;
|
|
49017
|
-
}
|
|
49018
|
-
else {
|
|
49019
|
-
isShowTooltip = false;
|
|
49020
|
-
}
|
|
49047
|
+
isShowTooltip = false;
|
|
49021
49048
|
}
|
|
49022
49049
|
}
|
|
49023
49050
|
}
|
|
49024
|
-
if (
|
|
49025
|
-
|
|
49026
|
-
|
|
49027
|
-
|
|
49051
|
+
else if (i === rowStart && isShowTooltip) {
|
|
49052
|
+
const heightLimitToShowTooltipForEdgeRow = chartDimensionLinkage.heightLimitToShowTooltipForEdgeRow;
|
|
49053
|
+
const { rowStart: rowStart1 } = table.getBodyVisibleRowRange(heightLimitToShowTooltipForEdgeRow, 0);
|
|
49054
|
+
if (rowStart1 === rowStart) {
|
|
49055
|
+
isShowTooltip = true;
|
|
49056
|
+
}
|
|
49057
|
+
else {
|
|
49058
|
+
const { rowStart: rowStart2 } = table.getBodyVisibleRowRange(0, -5);
|
|
49059
|
+
if (rowStart2 !== rowStart) {
|
|
49060
|
+
isShowTooltip = true;
|
|
49028
49061
|
}
|
|
49029
|
-
|
|
49030
|
-
|
|
49062
|
+
else {
|
|
49063
|
+
isShowTooltip = false;
|
|
49064
|
+
}
|
|
49065
|
+
}
|
|
49031
49066
|
}
|
|
49032
|
-
|
|
49033
|
-
|
|
49034
|
-
|
|
49035
|
-
|
|
49036
|
-
|
|
49037
|
-
showTooltipOption: { x: canvasXY.x, y: absolutePosition.top + 3, activeType: 'dimension' }
|
|
49038
|
-
});
|
|
49067
|
+
}
|
|
49068
|
+
if (isScatter) {
|
|
49069
|
+
chartInstanceListColumnByColumnDirection[col][i].showCrosshair?.((axis) => {
|
|
49070
|
+
if (axis.layoutOrient === 'left') {
|
|
49071
|
+
return positionValueOrYValue;
|
|
49039
49072
|
}
|
|
49040
|
-
|
|
49041
|
-
|
|
49042
|
-
|
|
49043
|
-
|
|
49044
|
-
|
|
49073
|
+
return dimensionValueOrXValue;
|
|
49074
|
+
});
|
|
49075
|
+
}
|
|
49076
|
+
else {
|
|
49077
|
+
const bodyBoundryTop = table.frozenRowCount
|
|
49078
|
+
? table.getCellRelativeRect(col, table.frozenRowCount - 1).bottom
|
|
49079
|
+
: 0;
|
|
49080
|
+
const absolutePositionTop = Math.max(bodyBoundryTop, table.getCellRelativeRect(col, i).top);
|
|
49081
|
+
if (hideTooltip) {
|
|
49082
|
+
if (table.stateManager.hover.cellPos.col !== col || table.stateManager.hover.cellPos.row !== i) {
|
|
49083
|
+
chartInstanceListColumnByColumnDirection[col][i].hideTooltip();
|
|
49045
49084
|
}
|
|
49085
|
+
chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
49086
|
+
tooltip: false,
|
|
49087
|
+
showTooltipOption: { x: canvasXY.x, y: absolutePositionTop, activeType: 'dimension' }
|
|
49088
|
+
});
|
|
49089
|
+
}
|
|
49090
|
+
else {
|
|
49091
|
+
chartInstanceListColumnByColumnDirection[col][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
49092
|
+
tooltip: isShowTooltip,
|
|
49093
|
+
showTooltipOption: { x: canvasXY.x, y: absolutePositionTop, activeType: 'dimension' }
|
|
49094
|
+
});
|
|
49046
49095
|
}
|
|
49047
49096
|
}
|
|
49048
|
-
}
|
|
49049
|
-
}
|
|
49097
|
+
}
|
|
49098
|
+
}, 0);
|
|
49050
49099
|
table.scenegraph.updateNextFrame();
|
|
49051
49100
|
}
|
|
49052
49101
|
}
|
|
@@ -49092,57 +49141,76 @@
|
|
|
49092
49141
|
chartInstanceListRowByRowDirection[row][i] = chartNode.activeChartInstance;
|
|
49093
49142
|
}
|
|
49094
49143
|
}
|
|
49095
|
-
|
|
49096
|
-
|
|
49097
|
-
|
|
49098
|
-
|
|
49099
|
-
|
|
49100
|
-
|
|
49101
|
-
if (
|
|
49102
|
-
|
|
49103
|
-
|
|
49104
|
-
|
|
49105
|
-
|
|
49106
|
-
|
|
49144
|
+
setTimeout(() => {
|
|
49145
|
+
if (chartInstanceListRowByRowDirection[row]?.[i]) {
|
|
49146
|
+
const chartDimensionLinkage = table.options.chartDimensionLinkage;
|
|
49147
|
+
let isShowTooltip = !isScatter;
|
|
49148
|
+
if (!isScatter && typeof chartDimensionLinkage === 'object') {
|
|
49149
|
+
isShowTooltip = chartDimensionLinkage.showTooltip ?? true;
|
|
49150
|
+
if (i === colEnd && isShowTooltip) {
|
|
49151
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn;
|
|
49152
|
+
const { colEnd: colEnd1 } = table.getBodyVisibleColRange(0, -widthLimitToShowTooltipForEdgeColumn);
|
|
49153
|
+
if (colEnd1 === colEnd) {
|
|
49154
|
+
isShowTooltip = true;
|
|
49155
|
+
}
|
|
49156
|
+
else {
|
|
49157
|
+
const { colEnd: colEnd2 } = table.getBodyVisibleColRange(0, 5);
|
|
49158
|
+
if (colEnd2 !== colEnd) {
|
|
49107
49159
|
isShowTooltip = true;
|
|
49108
49160
|
}
|
|
49109
49161
|
else {
|
|
49110
|
-
|
|
49111
|
-
if (colEnd2 !== colEnd) {
|
|
49112
|
-
isShowTooltip = true;
|
|
49113
|
-
}
|
|
49114
|
-
else {
|
|
49115
|
-
isShowTooltip = false;
|
|
49116
|
-
}
|
|
49162
|
+
isShowTooltip = false;
|
|
49117
49163
|
}
|
|
49118
49164
|
}
|
|
49119
49165
|
}
|
|
49120
|
-
if (
|
|
49121
|
-
|
|
49122
|
-
|
|
49123
|
-
|
|
49166
|
+
else if (i === colStart && isShowTooltip) {
|
|
49167
|
+
const widthLimitToShowTooltipForEdgeColumn = chartDimensionLinkage.widthLimitToShowTooltipForEdgeColumn;
|
|
49168
|
+
const { colStart: colStart1 } = table.getBodyVisibleColRange(widthLimitToShowTooltipForEdgeColumn, 0);
|
|
49169
|
+
if (colStart1 === colStart) {
|
|
49170
|
+
isShowTooltip = true;
|
|
49171
|
+
}
|
|
49172
|
+
else {
|
|
49173
|
+
const { colStart: colStart2 } = table.getBodyVisibleColRange(0, -5);
|
|
49174
|
+
if (colStart2 !== colStart) {
|
|
49175
|
+
isShowTooltip = true;
|
|
49124
49176
|
}
|
|
49125
|
-
|
|
49126
|
-
|
|
49177
|
+
else {
|
|
49178
|
+
isShowTooltip = false;
|
|
49179
|
+
}
|
|
49180
|
+
}
|
|
49127
49181
|
}
|
|
49128
|
-
|
|
49129
|
-
|
|
49130
|
-
|
|
49131
|
-
|
|
49132
|
-
|
|
49133
|
-
showTooltipOption: { x: absolutePosition.left + 3, y: canvasXY.y, activeType: 'dimension' }
|
|
49134
|
-
});
|
|
49182
|
+
}
|
|
49183
|
+
if (isScatter) {
|
|
49184
|
+
chartInstanceListRowByRowDirection[row][i].showCrosshair?.((axis) => {
|
|
49185
|
+
if (axis.layoutOrient === 'left') {
|
|
49186
|
+
return positionValueOrYValue;
|
|
49135
49187
|
}
|
|
49136
|
-
|
|
49137
|
-
|
|
49138
|
-
|
|
49139
|
-
|
|
49140
|
-
|
|
49188
|
+
return dimensionValueOrXValue;
|
|
49189
|
+
});
|
|
49190
|
+
}
|
|
49191
|
+
else {
|
|
49192
|
+
const bodyBoundryLeft = table.frozenColCount
|
|
49193
|
+
? table.getCellRelativeRect(table.frozenColCount - 1, row).right
|
|
49194
|
+
: 0;
|
|
49195
|
+
const absolutePositionLeft = Math.max(bodyBoundryLeft, table.getCellRelativeRect(i, row).left);
|
|
49196
|
+
if (hideTooltip) {
|
|
49197
|
+
if (table.stateManager.hover.cellPos.col !== i || table.stateManager.hover.cellPos.row !== row) {
|
|
49198
|
+
chartInstanceListRowByRowDirection[row][i].hideTooltip();
|
|
49141
49199
|
}
|
|
49200
|
+
chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
49201
|
+
tooltip: false,
|
|
49202
|
+
showTooltipOption: { x: absolutePositionLeft, y: canvasXY.y, activeType: 'dimension' }
|
|
49203
|
+
});
|
|
49204
|
+
}
|
|
49205
|
+
else {
|
|
49206
|
+
chartInstanceListRowByRowDirection[row][i].setDimensionIndex(dimensionValueOrXValue, {
|
|
49207
|
+
tooltip: isShowTooltip,
|
|
49208
|
+
showTooltipOption: { x: absolutePositionLeft, y: canvasXY.y, activeType: 'dimension' }
|
|
49209
|
+
});
|
|
49142
49210
|
}
|
|
49143
49211
|
}
|
|
49144
|
-
}
|
|
49145
|
-
}
|
|
49212
|
+
}
|
|
49213
|
+
}, 0);
|
|
49146
49214
|
table.scenegraph.updateNextFrame();
|
|
49147
49215
|
}
|
|
49148
49216
|
}
|
|
@@ -49529,8 +49597,11 @@
|
|
|
49529
49597
|
}, axisOption, {
|
|
49530
49598
|
orient: 'left',
|
|
49531
49599
|
type: axisOption?.type ?? 'band',
|
|
49532
|
-
|
|
49600
|
+
label: {
|
|
49601
|
+
flush: true
|
|
49602
|
+
},
|
|
49533
49603
|
inverse: transformInverse(axisOption, (spec?.direction ?? (chartType === 'scatter' ? 'vertical' : 'horizontal')) === "horizontal"),
|
|
49604
|
+
__vtableChartTheme: theme,
|
|
49534
49605
|
__vtableBodyChartCellPadding: bodyChartCellPadding
|
|
49535
49606
|
});
|
|
49536
49607
|
}
|
|
@@ -49679,6 +49750,9 @@
|
|
|
49679
49750
|
}, axisOption, {
|
|
49680
49751
|
orient: 'bottom',
|
|
49681
49752
|
type: axisOption?.type ?? 'band',
|
|
49753
|
+
label: {
|
|
49754
|
+
flush: true
|
|
49755
|
+
},
|
|
49682
49756
|
__vtableChartTheme: theme,
|
|
49683
49757
|
__vtableBodyChartCellPadding: bodyChartCellPadding
|
|
49684
49758
|
});
|
|
@@ -50206,7 +50280,16 @@
|
|
|
50206
50280
|
context.fill();
|
|
50207
50281
|
}
|
|
50208
50282
|
}
|
|
50209
|
-
}
|
|
50283
|
+
},
|
|
50284
|
+
componentShowContent: table.options.chartDimensionLinkage
|
|
50285
|
+
? {
|
|
50286
|
+
tooltip: {
|
|
50287
|
+
dimension: false,
|
|
50288
|
+
mark: true
|
|
50289
|
+
},
|
|
50290
|
+
crosshair: false
|
|
50291
|
+
}
|
|
50292
|
+
: undefined
|
|
50210
50293
|
}));
|
|
50211
50294
|
const chartStage = this.activeChartInstance.getStage();
|
|
50212
50295
|
const matrix = this.globalTransMatrix.clone();
|
|
@@ -50391,12 +50474,24 @@
|
|
|
50391
50474
|
this.activeChartInstance?.release();
|
|
50392
50475
|
this.activeChartInstance = null;
|
|
50393
50476
|
const { col, row } = this.parent;
|
|
50394
|
-
const table = this.stage.table;
|
|
50395
50477
|
table.internalProps.layoutMap.isAxisCell(table.rowHeaderLevelCount - 1, row) &&
|
|
50396
50478
|
table.scenegraph.getCell(table.rowHeaderLevelCount - 1, row).firstChild.hideLabelHoverOnAxis?.();
|
|
50397
50479
|
table.internalProps.layoutMap.isAxisCell(col, table.rowCount - table.bottomFrozenRowCount) &&
|
|
50398
50480
|
table.scenegraph.getCell(col, table.rowCount - table.bottomFrozenRowCount).firstChild.hideLabelHoverOnAxis?.();
|
|
50399
50481
|
}
|
|
50482
|
+
else {
|
|
50483
|
+
const { col, row } = this.parent;
|
|
50484
|
+
if (releaseColumnChartInstance) {
|
|
50485
|
+
table.internalProps.layoutMap.isAxisCell(col, table.rowCount - table.bottomFrozenRowCount) &&
|
|
50486
|
+
table.scenegraph
|
|
50487
|
+
.getCell(col, table.rowCount - table.bottomFrozenRowCount)
|
|
50488
|
+
.firstChild.hideLabelHoverOnAxis?.();
|
|
50489
|
+
}
|
|
50490
|
+
if (releaseRowChartInstance) {
|
|
50491
|
+
table.internalProps.layoutMap.isAxisCell(table.rowHeaderLevelCount - 1, row) &&
|
|
50492
|
+
table.scenegraph.getCell(table.rowHeaderLevelCount - 1, row).firstChild.hideLabelHoverOnAxis?.();
|
|
50493
|
+
}
|
|
50494
|
+
}
|
|
50400
50495
|
if (releaseColumnChartInstance) {
|
|
50401
50496
|
clearChartInstanceListByColumnDirection(this.parent.col, this.attribute.spec.type === 'scatter' ? this.parent.row : undefined, table);
|
|
50402
50497
|
}
|
|
@@ -50543,7 +50638,7 @@
|
|
|
50543
50638
|
}
|
|
50544
50639
|
});
|
|
50545
50640
|
table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(chartInstance);
|
|
50546
|
-
if (typeof dataId === 'string') {
|
|
50641
|
+
if (typeof dataId === 'string' || typeof dataId === 'number') {
|
|
50547
50642
|
chartInstance.getChart().setLayoutTag(true);
|
|
50548
50643
|
chartInstance.updateDataSync(dataId, data ?? []);
|
|
50549
50644
|
}
|
|
@@ -50722,7 +50817,7 @@
|
|
|
50722
50817
|
const stageMatrix = chart.stage.window.getViewBoxTransform().clone();
|
|
50723
50818
|
stageMatrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
|
|
50724
50819
|
chartStage.window.setViewBoxTransform(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
|
|
50725
|
-
if (typeof dataId === 'string') {
|
|
50820
|
+
if (typeof dataId === 'string' || typeof dataId === 'number') {
|
|
50726
50821
|
activeChartInstance.updateDataSync(dataId, data ?? []);
|
|
50727
50822
|
}
|
|
50728
50823
|
else {
|
|
@@ -65353,6 +65448,7 @@
|
|
|
65353
65448
|
cutOperationTime = 0;
|
|
65354
65449
|
lastClipboardContent = '';
|
|
65355
65450
|
cutCellRange = null;
|
|
65451
|
+
copySourceRange = null;
|
|
65356
65452
|
constructor(table) {
|
|
65357
65453
|
this.table = table;
|
|
65358
65454
|
this.handleTextStickBindId = [];
|
|
@@ -65746,76 +65842,122 @@
|
|
|
65746
65842
|
async handleCopy(e, isCut = false) {
|
|
65747
65843
|
const table = this.table;
|
|
65748
65844
|
!isCut && (this.cutWaitPaste = false);
|
|
65749
|
-
|
|
65845
|
+
this.copySourceRange = null;
|
|
65846
|
+
const sourceRanges = table.stateManager.select.ranges;
|
|
65847
|
+
if (sourceRanges && sourceRanges.length === 1) {
|
|
65848
|
+
const sourceRange = sourceRanges[0];
|
|
65849
|
+
this.copySourceRange = {
|
|
65850
|
+
startCol: Math.min(sourceRange.start.col, sourceRange.end.col),
|
|
65851
|
+
startRow: Math.min(sourceRange.start.row, sourceRange.end.row)
|
|
65852
|
+
};
|
|
65853
|
+
}
|
|
65854
|
+
else if (!sourceRanges?.length) {
|
|
65855
|
+
this.copySourceRange = null;
|
|
65856
|
+
return;
|
|
65857
|
+
}
|
|
65858
|
+
const data = this.table.getCopyValue(table.options.keyboardOptions?.getCopyCellValue?.value);
|
|
65750
65859
|
if (isValid$3(data)) {
|
|
65751
65860
|
e.preventDefault();
|
|
65752
|
-
const
|
|
65753
|
-
if (
|
|
65754
|
-
|
|
65755
|
-
|
|
65756
|
-
|
|
65757
|
-
|
|
65758
|
-
|
|
65759
|
-
|
|
65760
|
-
|
|
65761
|
-
|
|
65762
|
-
|
|
65763
|
-
|
|
65764
|
-
|
|
65765
|
-
|
|
65861
|
+
const element = table.getElement();
|
|
65862
|
+
if (element && element !== document.activeElement) {
|
|
65863
|
+
element.focus();
|
|
65864
|
+
await new Promise(resolve => setTimeout(resolve, 10));
|
|
65865
|
+
}
|
|
65866
|
+
try {
|
|
65867
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
65868
|
+
let hasPermission = true;
|
|
65869
|
+
if (navigator.permissions && navigator.permissions.query) {
|
|
65870
|
+
try {
|
|
65871
|
+
const permissionState = await navigator.permissions.query({
|
|
65872
|
+
name: 'clipboard-write'
|
|
65873
|
+
});
|
|
65874
|
+
hasPermission = permissionState.state === 'granted';
|
|
65766
65875
|
}
|
|
65767
|
-
|
|
65768
|
-
|
|
65769
|
-
? ' '
|
|
65770
|
-
: cell
|
|
65771
|
-
.toString()
|
|
65772
|
-
.replace(/&/g, '&')
|
|
65773
|
-
.replace(/'/g, ''')
|
|
65774
|
-
.replace(/</g, '<')
|
|
65775
|
-
.replace(/>/g, '>')
|
|
65776
|
-
.replace(/\n/g, '<br>')
|
|
65777
|
-
.replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g, '<br>\r\n')
|
|
65778
|
-
.replace(/\x20{2,}/gi, (substring) => {
|
|
65779
|
-
return `<span style="mso-spacerun: yes">${' '.repeat(substring.length - 1)} </span>`;
|
|
65780
|
-
})
|
|
65781
|
-
.replace(/\t/gi, '	');
|
|
65782
|
-
rowValues.push(`<td>${parsedCellData}</td>`);
|
|
65783
|
-
});
|
|
65784
|
-
result.push('<tr>', ...rowValues, '</tr>');
|
|
65785
|
-
if (rowIndex === rows.length - 1) {
|
|
65786
|
-
result.push('</tbody>');
|
|
65876
|
+
catch (permissionError) {
|
|
65877
|
+
hasPermission = true;
|
|
65787
65878
|
}
|
|
65788
|
-
}
|
|
65789
|
-
|
|
65790
|
-
|
|
65791
|
-
|
|
65792
|
-
|
|
65793
|
-
|
|
65794
|
-
|
|
65795
|
-
|
|
65796
|
-
|
|
65797
|
-
|
|
65798
|
-
|
|
65799
|
-
|
|
65800
|
-
|
|
65801
|
-
|
|
65802
|
-
|
|
65879
|
+
}
|
|
65880
|
+
if (hasPermission) {
|
|
65881
|
+
try {
|
|
65882
|
+
if (window.ClipboardItem) {
|
|
65883
|
+
let htmlValues = data;
|
|
65884
|
+
if (table.stateManager.select.ranges.length === 1 &&
|
|
65885
|
+
table.options.keyboardOptions?.getCopyCellValue?.html) {
|
|
65886
|
+
htmlValues = this.table.getCopyValue(table.options.keyboardOptions?.getCopyCellValue.html);
|
|
65887
|
+
}
|
|
65888
|
+
const dataHTML = setDataToHTML(htmlValues);
|
|
65889
|
+
await navigator.clipboard.write([
|
|
65890
|
+
new ClipboardItem({
|
|
65891
|
+
'text/html': new Blob([dataHTML], { type: 'text/html' }),
|
|
65892
|
+
'text/plain': new Blob([data], { type: 'text/plain' })
|
|
65893
|
+
})
|
|
65894
|
+
]);
|
|
65895
|
+
}
|
|
65896
|
+
else {
|
|
65897
|
+
await navigator.clipboard.writeText(data);
|
|
65898
|
+
}
|
|
65899
|
+
}
|
|
65900
|
+
catch (clipboardError) {
|
|
65901
|
+
this.fallbackCopyToClipboard(data, e);
|
|
65902
|
+
}
|
|
65903
|
+
}
|
|
65904
|
+
else {
|
|
65905
|
+
this.fallbackCopyToClipboard(data, e);
|
|
65906
|
+
}
|
|
65803
65907
|
}
|
|
65804
65908
|
else {
|
|
65805
|
-
|
|
65909
|
+
this.fallbackCopyToClipboard(data, e);
|
|
65806
65910
|
}
|
|
65911
|
+
table.fireListeners(TABLE_EVENT_TYPE.COPY_DATA, {
|
|
65912
|
+
cellRange: table.stateManager.select.ranges,
|
|
65913
|
+
copyData: data,
|
|
65914
|
+
isCut
|
|
65915
|
+
});
|
|
65916
|
+
}
|
|
65917
|
+
catch (error) {
|
|
65918
|
+
this.fallbackCopyToClipboard(data, e);
|
|
65807
65919
|
}
|
|
65808
|
-
table.fireListeners(TABLE_EVENT_TYPE.COPY_DATA, {
|
|
65809
|
-
cellRange: table.stateManager.select.ranges,
|
|
65810
|
-
copyData: data,
|
|
65811
|
-
isCut
|
|
65812
|
-
});
|
|
65813
65920
|
}
|
|
65814
65921
|
if (table.keyboardOptions?.showCopyCellBorder) {
|
|
65815
65922
|
setActiveCellRangeState(table);
|
|
65816
65923
|
table.clearSelected();
|
|
65817
65924
|
}
|
|
65818
65925
|
}
|
|
65926
|
+
fallbackCopyToClipboard(data, e) {
|
|
65927
|
+
try {
|
|
65928
|
+
if (e.clipboardData) {
|
|
65929
|
+
e.clipboardData.setData('text/plain', data);
|
|
65930
|
+
return;
|
|
65931
|
+
}
|
|
65932
|
+
if (document.activeElement && document.activeElement !== document.body) {
|
|
65933
|
+
document.activeElement.blur();
|
|
65934
|
+
}
|
|
65935
|
+
const textArea = document.createElement('textarea');
|
|
65936
|
+
textArea.value = data;
|
|
65937
|
+
textArea.style.position = 'fixed';
|
|
65938
|
+
textArea.style.left = '-999999px';
|
|
65939
|
+
textArea.style.top = '-999999px';
|
|
65940
|
+
textArea.style.opacity = '0';
|
|
65941
|
+
textArea.setAttribute('readonly', '');
|
|
65942
|
+
textArea.setAttribute('aria-hidden', 'true');
|
|
65943
|
+
document.body.appendChild(textArea);
|
|
65944
|
+
textArea.focus();
|
|
65945
|
+
textArea.select();
|
|
65946
|
+
textArea.setSelectionRange(0, data.length);
|
|
65947
|
+
try {
|
|
65948
|
+
const successful = document.execCommand('copy');
|
|
65949
|
+
if (!successful) {
|
|
65950
|
+
}
|
|
65951
|
+
}
|
|
65952
|
+
catch (execError) {
|
|
65953
|
+
}
|
|
65954
|
+
finally {
|
|
65955
|
+
document.body.removeChild(textArea);
|
|
65956
|
+
}
|
|
65957
|
+
}
|
|
65958
|
+
catch (error) {
|
|
65959
|
+
}
|
|
65960
|
+
}
|
|
65819
65961
|
async handleCut(e) {
|
|
65820
65962
|
this.handleCopy(e, true);
|
|
65821
65963
|
this.cutWaitPaste = true;
|
|
@@ -65866,59 +66008,99 @@
|
|
|
65866
66008
|
}
|
|
65867
66009
|
async executePaste(e) {
|
|
65868
66010
|
const table = this.table;
|
|
65869
|
-
if (table.
|
|
65870
|
-
|
|
65871
|
-
|
|
65872
|
-
|
|
65873
|
-
|
|
65874
|
-
if (navigator.clipboard
|
|
65875
|
-
|
|
66011
|
+
if (table.editorManager?.editingEditor) {
|
|
66012
|
+
return;
|
|
66013
|
+
}
|
|
66014
|
+
if (table.changeCellValues && table.stateManager.select.ranges?.length > 0) {
|
|
66015
|
+
try {
|
|
66016
|
+
if (navigator.clipboard && navigator.clipboard.read) {
|
|
66017
|
+
try {
|
|
66018
|
+
const clipboardItems = await navigator.clipboard.read();
|
|
66019
|
+
let handled = false;
|
|
65876
66020
|
for (const item of clipboardItems) {
|
|
65877
66021
|
if (item.types.includes('text/html')) {
|
|
65878
|
-
this.pasteHtmlToTable(item);
|
|
66022
|
+
await this.pasteHtmlToTable(item);
|
|
66023
|
+
handled = true;
|
|
66024
|
+
break;
|
|
65879
66025
|
}
|
|
65880
|
-
else if (item.types.
|
|
65881
|
-
this.pasteTextToTable(item);
|
|
66026
|
+
else if (item.types.includes('text/plain')) {
|
|
66027
|
+
await this.pasteTextToTable(item);
|
|
66028
|
+
handled = true;
|
|
66029
|
+
break;
|
|
65882
66030
|
}
|
|
65883
|
-
else ;
|
|
65884
66031
|
}
|
|
65885
|
-
|
|
66032
|
+
if (!handled) {
|
|
66033
|
+
await this.fallbackPasteFromClipboard(e);
|
|
66034
|
+
}
|
|
66035
|
+
}
|
|
66036
|
+
catch (clipboardError) {
|
|
66037
|
+
await this.fallbackPasteFromClipboard(e);
|
|
66038
|
+
}
|
|
65886
66039
|
}
|
|
65887
66040
|
else {
|
|
65888
|
-
|
|
65889
|
-
const col = Math.min(ranges[0].start.col, ranges[0].end.col);
|
|
65890
|
-
const row = Math.min(ranges[0].start.row, ranges[0].end.row);
|
|
65891
|
-
const clipboardData = e.clipboardData || window.Clipboard;
|
|
65892
|
-
const pastedData = clipboardData.getData('text');
|
|
65893
|
-
const rows = pastedData.split('\n');
|
|
65894
|
-
const values = [];
|
|
65895
|
-
rows.forEach(function (rowCells, rowIndex) {
|
|
65896
|
-
const cells = rowCells.split('\t');
|
|
65897
|
-
const rowValues = [];
|
|
65898
|
-
values.push(rowValues);
|
|
65899
|
-
cells.forEach(function (cell, cellIndex) {
|
|
65900
|
-
if (cellIndex === cells.length - 1) {
|
|
65901
|
-
cell = cell.trim();
|
|
65902
|
-
}
|
|
65903
|
-
rowValues.push(cell);
|
|
65904
|
-
});
|
|
65905
|
-
});
|
|
65906
|
-
const changedCellResults = await table.changeCellValues(col, row, values, true);
|
|
65907
|
-
if (table.hasListeners(TABLE_EVENT_TYPE.PASTED_DATA)) {
|
|
65908
|
-
table.fireListeners(TABLE_EVENT_TYPE.PASTED_DATA, {
|
|
65909
|
-
col,
|
|
65910
|
-
row,
|
|
65911
|
-
pasteData: values,
|
|
65912
|
-
changedCellResults
|
|
65913
|
-
});
|
|
65914
|
-
}
|
|
66041
|
+
await this.fallbackPasteFromClipboard(e);
|
|
65915
66042
|
}
|
|
65916
66043
|
}
|
|
66044
|
+
catch (error) {
|
|
66045
|
+
await this.fallbackPasteFromClipboard(e);
|
|
66046
|
+
}
|
|
65917
66047
|
}
|
|
65918
66048
|
if (table.keyboardOptions?.showCopyCellBorder) {
|
|
65919
66049
|
clearActiveCellRangeState(table);
|
|
65920
66050
|
}
|
|
65921
66051
|
}
|
|
66052
|
+
async fallbackPasteFromClipboard(e) {
|
|
66053
|
+
const table = this.table;
|
|
66054
|
+
const ranges = table.stateManager.select.ranges;
|
|
66055
|
+
const col = Math.min(ranges[0].start.col, ranges[0].end.col);
|
|
66056
|
+
const row = Math.min(ranges[0].start.row, ranges[0].end.row);
|
|
66057
|
+
try {
|
|
66058
|
+
const element = table.getElement();
|
|
66059
|
+
if (element && element !== document.activeElement) {
|
|
66060
|
+
element.focus();
|
|
66061
|
+
await new Promise(resolve => setTimeout(resolve, 10));
|
|
66062
|
+
}
|
|
66063
|
+
const clipboardData = e.clipboardData || window.clipboardData || window.Clipboard;
|
|
66064
|
+
if (clipboardData) {
|
|
66065
|
+
const pastedData = clipboardData.getData('text') || clipboardData.getData('Text');
|
|
66066
|
+
if (pastedData) {
|
|
66067
|
+
await this.processPastedText(pastedData, col, row);
|
|
66068
|
+
return;
|
|
66069
|
+
}
|
|
66070
|
+
}
|
|
66071
|
+
}
|
|
66072
|
+
catch (error) {
|
|
66073
|
+
}
|
|
66074
|
+
}
|
|
66075
|
+
async processPastedText(pastedData, col, row) {
|
|
66076
|
+
const table = this.table;
|
|
66077
|
+
const rows = pastedData.split('\n');
|
|
66078
|
+
const values = [];
|
|
66079
|
+
rows.forEach(function (rowCells) {
|
|
66080
|
+
const cells = rowCells.split('\t');
|
|
66081
|
+
const rowValues = [];
|
|
66082
|
+
values.push(rowValues);
|
|
66083
|
+
cells.forEach(function (cell, cellIndex) {
|
|
66084
|
+
if (cellIndex === cells.length - 1) {
|
|
66085
|
+
cell = cell.trim();
|
|
66086
|
+
}
|
|
66087
|
+
rowValues.push(cell);
|
|
66088
|
+
});
|
|
66089
|
+
});
|
|
66090
|
+
let processedValues;
|
|
66091
|
+
if (table.options.keyboardOptions?.processFormulaBeforePaste && this.copySourceRange) {
|
|
66092
|
+
processedValues = table.options.keyboardOptions.processFormulaBeforePaste(values, this.copySourceRange.startCol, this.copySourceRange.startRow, col, row);
|
|
66093
|
+
}
|
|
66094
|
+
const changedCellResults = await table.changeCellValues(col, row, processedValues ? processedValues : values, true);
|
|
66095
|
+
if (table.hasListeners(TABLE_EVENT_TYPE.PASTED_DATA)) {
|
|
66096
|
+
table.fireListeners(TABLE_EVENT_TYPE.PASTED_DATA, {
|
|
66097
|
+
col,
|
|
66098
|
+
row,
|
|
66099
|
+
pasteData: processedValues ? processedValues : values,
|
|
66100
|
+
changedCellResults
|
|
66101
|
+
});
|
|
66102
|
+
}
|
|
66103
|
+
}
|
|
65922
66104
|
clearCutArea(table) {
|
|
65923
66105
|
try {
|
|
65924
66106
|
const selectCells = this.cutCellRange;
|
|
@@ -65996,12 +66178,16 @@
|
|
|
65996
66178
|
}
|
|
65997
66179
|
pasteValuesRowCount = values.length ?? 0;
|
|
65998
66180
|
values = this.handlePasteValues(values, pasteValuesRowCount, pasteValuesColCount, maxRow - row + 1, maxCol - col + 1);
|
|
65999
|
-
|
|
66181
|
+
let processedValues;
|
|
66182
|
+
if (table.options.keyboardOptions?.processFormulaBeforePaste && this.copySourceRange) {
|
|
66183
|
+
processedValues = table.options.keyboardOptions.processFormulaBeforePaste(values, this.copySourceRange.startCol, this.copySourceRange.startRow, col, row);
|
|
66184
|
+
}
|
|
66185
|
+
const changedCellResults = await table.changeCellValues(col, row, processedValues ? processedValues : values, true);
|
|
66000
66186
|
if (table.hasListeners(TABLE_EVENT_TYPE.PASTED_DATA)) {
|
|
66001
66187
|
table.fireListeners(TABLE_EVENT_TYPE.PASTED_DATA, {
|
|
66002
66188
|
col,
|
|
66003
66189
|
row,
|
|
66004
|
-
pasteData: values,
|
|
66190
|
+
pasteData: processedValues ? processedValues : values,
|
|
66005
66191
|
changedCellResults
|
|
66006
66192
|
});
|
|
66007
66193
|
}
|
|
@@ -66046,17 +66232,21 @@
|
|
|
66046
66232
|
});
|
|
66047
66233
|
pasteValuesRowCount = values.length ?? 0;
|
|
66048
66234
|
values = this.handlePasteValues(values, pasteValuesRowCount, pasteValuesColCount, maxRow - row + 1, maxCol - col + 1);
|
|
66049
|
-
|
|
66235
|
+
let processedValues;
|
|
66236
|
+
if (table.options.keyboardOptions?.processFormulaBeforePaste && this.copySourceRange) {
|
|
66237
|
+
processedValues = table.options.keyboardOptions.processFormulaBeforePaste(values, this.copySourceRange.startCol, this.copySourceRange.startRow, col, row);
|
|
66238
|
+
}
|
|
66239
|
+
const changedCellResults = await table.changeCellValues(col, row, processedValues ? processedValues : values, true);
|
|
66050
66240
|
if (table.hasListeners(TABLE_EVENT_TYPE.PASTED_DATA)) {
|
|
66051
66241
|
table.fireListeners(TABLE_EVENT_TYPE.PASTED_DATA, {
|
|
66052
66242
|
col,
|
|
66053
66243
|
row,
|
|
66054
|
-
pasteData: values,
|
|
66244
|
+
pasteData: processedValues ? processedValues : values,
|
|
66055
66245
|
changedCellResults
|
|
66056
66246
|
});
|
|
66057
66247
|
}
|
|
66058
66248
|
}
|
|
66059
|
-
pasteTextToTable(item) {
|
|
66249
|
+
async pasteTextToTable(item) {
|
|
66060
66250
|
const table = this.table;
|
|
66061
66251
|
const ranges = table.stateManager.select.ranges;
|
|
66062
66252
|
const selectRangeLength = ranges.length;
|
|
@@ -66064,42 +66254,47 @@
|
|
|
66064
66254
|
const row = Math.min(ranges[selectRangeLength - 1].start.row, ranges[selectRangeLength - 1].end.row);
|
|
66065
66255
|
const maxCol = Math.max(ranges[selectRangeLength - 1].start.col, ranges[selectRangeLength - 1].end.col);
|
|
66066
66256
|
const maxRow = Math.max(ranges[selectRangeLength - 1].start.row, ranges[selectRangeLength - 1].end.row);
|
|
66067
|
-
|
|
66068
|
-
|
|
66069
|
-
|
|
66070
|
-
|
|
66071
|
-
|
|
66072
|
-
|
|
66073
|
-
|
|
66074
|
-
|
|
66075
|
-
|
|
66076
|
-
|
|
66077
|
-
|
|
66078
|
-
|
|
66079
|
-
|
|
66080
|
-
|
|
66081
|
-
if (cell.includes('\n')) {
|
|
66082
|
-
cell = cell
|
|
66083
|
-
.replace(/^"(.*)"$/, '$1')
|
|
66084
|
-
.replace(/["]*/g, match => new Array(Math.floor(match.length / 2)).fill('"').join(''));
|
|
66085
|
-
}
|
|
66086
|
-
rowValues.push(cell);
|
|
66087
|
-
});
|
|
66088
|
-
pasteValuesColCount = Math.max(pasteValuesColCount, rowValues?.length ?? 0);
|
|
66257
|
+
try {
|
|
66258
|
+
const blob = await item.getType('text/plain');
|
|
66259
|
+
const pastedData = await blob.text();
|
|
66260
|
+
const values = this.parsePastedData(pastedData);
|
|
66261
|
+
const pasteValuesRowCount = values.length;
|
|
66262
|
+
const pasteValuesColCount = Math.max(...values.map(row => row.length), 0);
|
|
66263
|
+
const processedValues = this.handlePasteValues(values, pasteValuesRowCount, pasteValuesColCount, maxRow - row + 1, maxCol - col + 1);
|
|
66264
|
+
const changedCellResults = await table.changeCellValues(col, row, processedValues, true);
|
|
66265
|
+
if (table.hasListeners(TABLE_EVENT_TYPE.PASTED_DATA)) {
|
|
66266
|
+
table.fireListeners(TABLE_EVENT_TYPE.PASTED_DATA, {
|
|
66267
|
+
col,
|
|
66268
|
+
row,
|
|
66269
|
+
pasteData: processedValues,
|
|
66270
|
+
changedCellResults
|
|
66089
66271
|
});
|
|
66090
|
-
|
|
66091
|
-
|
|
66092
|
-
|
|
66093
|
-
|
|
66094
|
-
|
|
66095
|
-
|
|
66096
|
-
|
|
66097
|
-
|
|
66098
|
-
|
|
66099
|
-
|
|
66100
|
-
|
|
66101
|
-
|
|
66272
|
+
}
|
|
66273
|
+
}
|
|
66274
|
+
catch (error) {
|
|
66275
|
+
}
|
|
66276
|
+
}
|
|
66277
|
+
parsePastedData(pastedData) {
|
|
66278
|
+
const rows = pastedData.replace(/\r(?!\n)/g, '\r\n').split('\r\n');
|
|
66279
|
+
const values = [];
|
|
66280
|
+
if (rows.length > 1 && rows[rows.length - 1] === '') {
|
|
66281
|
+
rows.pop();
|
|
66282
|
+
}
|
|
66283
|
+
rows.forEach((rowCells) => {
|
|
66284
|
+
const cells = rowCells.split('\t');
|
|
66285
|
+
const rowValues = cells.map(cell => this.processCellValue(cell));
|
|
66286
|
+
values.push(rowValues);
|
|
66102
66287
|
});
|
|
66288
|
+
return values;
|
|
66289
|
+
}
|
|
66290
|
+
processCellValue(cell) {
|
|
66291
|
+
if (cell.includes('\n')) {
|
|
66292
|
+
cell = cell
|
|
66293
|
+
.replace(/^"(.*)"$/, '$1')
|
|
66294
|
+
.replace(/["]*/g, match => new Array(Math.floor(match.length / 2)).fill('"').join(''));
|
|
66295
|
+
}
|
|
66296
|
+
const numValue = Number(cell);
|
|
66297
|
+
return isNaN(numValue) ? cell : numValue;
|
|
66103
66298
|
}
|
|
66104
66299
|
handlePasteValues(values, rowCount, colCount, selectedRowCount, selectedColCount) {
|
|
66105
66300
|
if (selectedColCount > colCount || selectedRowCount > rowCount) {
|
|
@@ -69961,7 +70156,7 @@
|
|
|
69961
70156
|
return TABLE_EVENT_TYPE;
|
|
69962
70157
|
}
|
|
69963
70158
|
options;
|
|
69964
|
-
version = "1.22.
|
|
70159
|
+
version = "1.22.7-alpha.0";
|
|
69965
70160
|
pagination;
|
|
69966
70161
|
id = `VTable${Date.now()}`;
|
|
69967
70162
|
headerStyleCache;
|
|
@@ -71433,26 +71628,26 @@
|
|
|
71433
71628
|
}
|
|
71434
71629
|
return { rowStart, colStart, rowEnd, colEnd };
|
|
71435
71630
|
}
|
|
71436
|
-
getBodyVisibleRowRange(
|
|
71631
|
+
getBodyVisibleRowRange(start_deltaY = 0, end_deltaY = 0) {
|
|
71437
71632
|
const { scrollTop } = this;
|
|
71438
71633
|
const frozenRowsHeight = this.getFrozenRowsHeight();
|
|
71439
71634
|
const bottomFrozenRowsHeight = this.getBottomFrozenRowsHeight();
|
|
71440
|
-
const { row: rowStart } = this.getRowAt(scrollTop + frozenRowsHeight + 1);
|
|
71635
|
+
const { row: rowStart } = this.getRowAt(scrollTop + frozenRowsHeight + 1 + start_deltaY);
|
|
71441
71636
|
const rowEnd = this.getAllRowsHeight() > this.tableNoFrameHeight
|
|
71442
|
-
? this.getRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight +
|
|
71637
|
+
? this.getRowAt(scrollTop + this.tableNoFrameHeight - 1 - bottomFrozenRowsHeight + end_deltaY).row
|
|
71443
71638
|
: this.rowCount - 1;
|
|
71444
71639
|
if (rowEnd < 0) {
|
|
71445
71640
|
return null;
|
|
71446
71641
|
}
|
|
71447
71642
|
return { rowStart, rowEnd };
|
|
71448
71643
|
}
|
|
71449
|
-
getBodyVisibleColRange(
|
|
71644
|
+
getBodyVisibleColRange(start_deltaX = 0, end_deltaX = 0) {
|
|
71450
71645
|
const { scrollLeft } = this;
|
|
71451
71646
|
const frozenColsWidth = this.getFrozenColsWidth();
|
|
71452
71647
|
const rightFrozenColsWidth = this.getRightFrozenColsWidth();
|
|
71453
|
-
const { col: colStart } = this.getColAt(scrollLeft + frozenColsWidth + 1);
|
|
71648
|
+
const { col: colStart } = this.getColAt(scrollLeft + frozenColsWidth + 1 + start_deltaX);
|
|
71454
71649
|
const colEnd = this.getAllColsWidth() > this.tableNoFrameWidth
|
|
71455
|
-
? this.getColAt(scrollLeft + this.tableNoFrameWidth - 1 - rightFrozenColsWidth +
|
|
71650
|
+
? this.getColAt(scrollLeft + this.tableNoFrameWidth - 1 - rightFrozenColsWidth + end_deltaX).col
|
|
71456
71651
|
: this.colCount - 1;
|
|
71457
71652
|
if (colEnd < 0) {
|
|
71458
71653
|
return null;
|
|
@@ -72535,7 +72730,7 @@
|
|
|
72535
72730
|
.fill(0)
|
|
72536
72731
|
.map((_, j) => this.getCellInfo(j + start.col, i + start.row)));
|
|
72537
72732
|
}
|
|
72538
|
-
getCopyValue() {
|
|
72733
|
+
getCopyValue(getCellValueFunction) {
|
|
72539
72734
|
if (this.stateManager.select?.ranges?.length > 0) {
|
|
72540
72735
|
const ranges = this.stateManager.select.ranges;
|
|
72541
72736
|
let minCol = Math.min(ranges[0].start.col, ranges[0].end.col);
|
|
@@ -72596,7 +72791,7 @@
|
|
|
72596
72791
|
if (copyStartCol !== col || copyStartRow !== row) {
|
|
72597
72792
|
return '';
|
|
72598
72793
|
}
|
|
72599
|
-
const value = this.getCellValue(col, row);
|
|
72794
|
+
const value = getCellValueFunction ? getCellValueFunction(col, row) : this.getCellValue(col, row);
|
|
72600
72795
|
return value;
|
|
72601
72796
|
};
|
|
72602
72797
|
let copyValue = '';
|
|
@@ -85887,6 +86082,7 @@
|
|
|
85887
86082
|
});
|
|
85888
86083
|
if (topAxis && bottomAxis) {
|
|
85889
86084
|
indicatorObject.hasTwoIndicatorAxes = true;
|
|
86085
|
+
this.hasTwoIndicatorAxes = true;
|
|
85890
86086
|
return true;
|
|
85891
86087
|
}
|
|
85892
86088
|
}
|
|
@@ -85905,6 +86101,7 @@
|
|
|
85905
86101
|
});
|
|
85906
86102
|
if (leftAxis && rightAxis) {
|
|
85907
86103
|
indicatorObject.hasTwoIndicatorAxes = true;
|
|
86104
|
+
this.hasTwoIndicatorAxes = true;
|
|
85908
86105
|
return true;
|
|
85909
86106
|
}
|
|
85910
86107
|
}
|
|
@@ -87487,7 +87684,10 @@
|
|
|
87487
87684
|
rowHeaderPath.dimensionKey = rowHeader.dimensionKey;
|
|
87488
87685
|
rowHeaderPath.indicatorKey = rowHeader.indicatorKey;
|
|
87489
87686
|
rowHeaderPath.value =
|
|
87490
|
-
rowHeader.value ??
|
|
87687
|
+
rowHeader.value ??
|
|
87688
|
+
(rowHeader.indicatorKey
|
|
87689
|
+
? this.getIndicatorInfoByIndicatorKey(rowHeader.indicatorKey)?.title ?? ''
|
|
87690
|
+
: rowHeader.value);
|
|
87491
87691
|
rowHeaderPath.virtual = rowHeader.virtual;
|
|
87492
87692
|
rowHeaderPath.role = rowHeader.role;
|
|
87493
87693
|
headerPaths.rowHeaderPaths.push(rowHeaderPath);
|
|
@@ -90040,8 +90240,8 @@
|
|
|
90040
90240
|
if (this.indicatorsAsCol) {
|
|
90041
90241
|
assignedIndicatorKey_value = colKeys[col_j].indicatorKey;
|
|
90042
90242
|
}
|
|
90043
|
-
const flatRowKey =
|
|
90044
|
-
const flatColKey =
|
|
90243
|
+
const flatRowKey = join(rowKey, this.stringJoinChar);
|
|
90244
|
+
const flatColKey = join(colKey, this.stringJoinChar);
|
|
90045
90245
|
if (isToTalRecord) {
|
|
90046
90246
|
if (!this.totalRecordsTree[flatRowKey]) {
|
|
90047
90247
|
this.totalRecordsTree[flatRowKey] = {};
|
|
@@ -93914,7 +94114,7 @@
|
|
|
93914
94114
|
matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
|
|
93915
94115
|
chartStage.window.setViewBoxTransform &&
|
|
93916
94116
|
chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
|
|
93917
|
-
if (typeof dataId === 'string') {
|
|
94117
|
+
if (typeof dataId === 'string' || typeof dataId === 'number') {
|
|
93918
94118
|
chartInstance.updateDataSync(dataId, data ?? []);
|
|
93919
94119
|
}
|
|
93920
94120
|
else {
|
|
@@ -93986,7 +94186,7 @@
|
|
|
93986
94186
|
const stageMatrix = chartNode.stage.window.getViewBoxTransform().clone();
|
|
93987
94187
|
stageMatrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
|
|
93988
94188
|
chartStage.window.setViewBoxTransform(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
|
|
93989
|
-
if (typeof dataId === 'string') {
|
|
94189
|
+
if (typeof dataId === 'string' || typeof dataId === 'number') {
|
|
93990
94190
|
activeChartInstance.updateDataSync(dataId, data ?? []);
|
|
93991
94191
|
}
|
|
93992
94192
|
else {
|
|
@@ -94688,7 +94888,7 @@
|
|
|
94688
94888
|
}
|
|
94689
94889
|
|
|
94690
94890
|
registerForVrender();
|
|
94691
|
-
const version = "1.22.
|
|
94891
|
+
const version = "1.22.7-alpha.0";
|
|
94692
94892
|
function getIcons() {
|
|
94693
94893
|
return get$2();
|
|
94694
94894
|
}
|