@visactor/vtable 1.5.4-beta.0 → 1.5.4
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/ListTable.d.ts +0 -2
- package/cjs/ListTable.js +3 -2
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.d.ts +0 -1
- package/cjs/PivotChart.js +0 -4
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.d.ts +0 -2
- package/cjs/PivotTable.js +1 -1
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/components/axis/axis.js +2 -3
- package/cjs/components/axis/axis.js.map +1 -1
- package/cjs/components/legend/discrete-legend/discrete-legend.js +8 -3
- package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/cjs/components/react/react-custom-layout.d.ts +3 -1
- package/cjs/components/react/react-custom-layout.js +7 -3
- package/cjs/components/react/react-custom-layout.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +3 -4
- package/cjs/core/BaseTable.js +31 -48
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/FouseInput.d.ts +0 -1
- package/cjs/core/FouseInput.js +2 -5
- package/cjs/core/FouseInput.js.map +1 -1
- package/cjs/core/tableHelper.d.ts +2 -2
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/core/utils/get-cell-position.d.ts +25 -5
- package/cjs/core/utils/get-cell-position.js.map +1 -1
- package/cjs/edit/edit-manager.js +4 -7
- package/cjs/edit/edit-manager.js.map +1 -1
- package/cjs/event/event.js +4 -5
- package/cjs/event/event.js.map +1 -1
- package/cjs/event/listener/container-dom.js +44 -20
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/util.js +2 -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/pivot-header-layout.js +1 -0
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/scenegraph/debug-tool/debug-tool.js +1 -4
- package/cjs/scenegraph/debug-tool/debug-tool.js.map +1 -1
- package/cjs/scenegraph/graphic/chart.d.ts +0 -1
- package/cjs/scenegraph/graphic/chart.js +20 -34
- package/cjs/scenegraph/graphic/chart.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js +32 -28
- package/cjs/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/cjs/scenegraph/graphic/contributions/chart-render.d.ts +1 -2
- package/cjs/scenegraph/graphic/contributions/chart-render.js +24 -40
- package/cjs/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +1 -2
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +1 -1
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +1 -1
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/refresh-node/update-chart.d.ts +2 -2
- package/cjs/scenegraph/refresh-node/update-chart.js +17 -10
- package/cjs/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/cjs/scenegraph/scenegraph.d.ts +2 -1
- package/cjs/scenegraph/scenegraph.js +15 -16
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/select/create-select-border.js +2 -2
- package/cjs/scenegraph/select/create-select-border.js.map +1 -1
- package/cjs/scenegraph/utils/text-icon-layout.js +6 -5
- package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/cjs/state/cell-move/index.js +14 -11
- package/cjs/state/cell-move/index.js.map +1 -1
- package/cjs/state/select/is-cell-select-highlight.js +6 -0
- package/cjs/state/select/is-cell-select-highlight.js.map +1 -1
- package/cjs/state/state.js +8 -6
- package/cjs/state/state.js.map +1 -1
- package/cjs/themes/theme.js +8 -0
- package/cjs/themes/theme.js.map +1 -1
- package/cjs/tools/helper.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +4 -13
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +2 -1
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/ts-types/theme.d.ts +2 -0
- package/cjs/ts-types/theme.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +327 -328
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +0 -2
- package/es/ListTable.js +3 -2
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.d.ts +0 -1
- package/es/PivotChart.js +2 -5
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.d.ts +0 -2
- package/es/PivotTable.js +1 -1
- package/es/PivotTable.js.map +1 -1
- package/es/components/axis/axis.js +1 -3
- package/es/components/axis/axis.js.map +1 -1
- package/es/components/legend/discrete-legend/discrete-legend.js +8 -3
- package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
- package/es/components/react/react-custom-layout.d.ts +3 -1
- package/es/components/react/react-custom-layout.js +7 -3
- package/es/components/react/react-custom-layout.js.map +1 -1
- package/es/core/BaseTable.d.ts +3 -4
- package/es/core/BaseTable.js +30 -47
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/FouseInput.d.ts +0 -1
- package/es/core/FouseInput.js +2 -5
- package/es/core/FouseInput.js.map +1 -1
- package/es/core/tableHelper.d.ts +2 -2
- package/es/core/tableHelper.js.map +1 -1
- package/es/core/utils/get-cell-position.d.ts +25 -5
- package/es/core/utils/get-cell-position.js.map +1 -1
- package/es/edit/edit-manager.js +4 -7
- package/es/edit/edit-manager.js.map +1 -1
- package/es/event/event.js +4 -5
- package/es/event/event.js.map +1 -1
- package/es/event/listener/container-dom.js +40 -19
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/util.js +2 -2
- 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/pivot-header-layout.js +1 -0
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/scenegraph/debug-tool/debug-tool.js +1 -4
- package/es/scenegraph/debug-tool/debug-tool.js.map +1 -1
- package/es/scenegraph/graphic/chart.d.ts +0 -1
- package/es/scenegraph/graphic/chart.js +21 -33
- package/es/scenegraph/graphic/chart.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render-helper.js +32 -28
- package/es/scenegraph/graphic/contributions/chart-render-helper.js.map +1 -1
- package/es/scenegraph/graphic/contributions/chart-render.d.ts +1 -2
- package/es/scenegraph/graphic/contributions/chart-render.js +25 -41
- package/es/scenegraph/graphic/contributions/chart-render.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +1 -2
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +1 -1
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +1 -1
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/refresh-node/update-chart.d.ts +2 -2
- package/es/scenegraph/refresh-node/update-chart.js +14 -7
- package/es/scenegraph/refresh-node/update-chart.js.map +1 -1
- package/es/scenegraph/scenegraph.d.ts +2 -1
- package/es/scenegraph/scenegraph.js +16 -17
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/select/create-select-border.js +2 -2
- package/es/scenegraph/select/create-select-border.js.map +1 -1
- package/es/scenegraph/utils/text-icon-layout.js +7 -4
- package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
- package/es/state/cell-move/index.js +14 -11
- package/es/state/cell-move/index.js.map +1 -1
- package/es/state/select/is-cell-select-highlight.js +6 -0
- package/es/state/select/is-cell-select-highlight.js.map +1 -1
- package/es/state/state.js +8 -6
- package/es/state/state.js.map +1 -1
- package/es/themes/theme.js +8 -0
- package/es/themes/theme.js.map +1 -1
- package/es/tools/helper.js.map +1 -1
- package/es/ts-types/base-table.d.ts +4 -13
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +2 -1
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/ts-types/theme.d.ts +2 -0
- package/es/ts-types/theme.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +6 -6
package/dist/vtable.js
CHANGED
|
@@ -44372,11 +44372,9 @@
|
|
|
44372
44372
|
}
|
|
44373
44373
|
function getPromiseValue(value, callback) {
|
|
44374
44374
|
if (isPromise(value)) {
|
|
44375
|
-
value
|
|
44376
|
-
.then(result => {
|
|
44375
|
+
value.then(result => {
|
|
44377
44376
|
callback(result);
|
|
44378
|
-
})
|
|
44379
|
-
.catch((err) => {
|
|
44377
|
+
}).catch((err) => {
|
|
44380
44378
|
});
|
|
44381
44379
|
}
|
|
44382
44380
|
else {
|
|
@@ -46080,6 +46078,9 @@
|
|
|
46080
46078
|
},
|
|
46081
46079
|
get inlineRowBgColor() {
|
|
46082
46080
|
return selectionStyle?.inlineRowBgColor;
|
|
46081
|
+
},
|
|
46082
|
+
get selectionFillMode() {
|
|
46083
|
+
return selectionStyle?.selectionFillMode ?? 'overlay';
|
|
46083
46084
|
}
|
|
46084
46085
|
};
|
|
46085
46086
|
}
|
|
@@ -46201,6 +46202,12 @@
|
|
|
46201
46202
|
? changeColor(that.selectionStyle.cellBgColor, 0.1, false)
|
|
46202
46203
|
: undefined) ??
|
|
46203
46204
|
undefined);
|
|
46205
|
+
},
|
|
46206
|
+
get cellBgColor() {
|
|
46207
|
+
if (that.selectionStyle.selectionFillMode === 'replace') {
|
|
46208
|
+
return style.select?.cellBgColor ?? that.selectionStyle.cellBgColor ?? undefined;
|
|
46209
|
+
}
|
|
46210
|
+
return undefined;
|
|
46204
46211
|
}
|
|
46205
46212
|
};
|
|
46206
46213
|
},
|
|
@@ -48909,12 +48916,14 @@
|
|
|
48909
48916
|
};
|
|
48910
48917
|
}
|
|
48911
48918
|
class ReactCustomLayout {
|
|
48919
|
+
removeAllContainer;
|
|
48912
48920
|
table;
|
|
48913
48921
|
customLayoutFuncCache;
|
|
48914
48922
|
reactRemoveGraphicCache;
|
|
48915
48923
|
headerCustomLayoutFuncCache;
|
|
48916
48924
|
headerReactRemoveGraphicCache;
|
|
48917
|
-
constructor(table) {
|
|
48925
|
+
constructor(removeAllContainer, table) {
|
|
48926
|
+
this.removeAllContainer = removeAllContainer;
|
|
48918
48927
|
this.table = table;
|
|
48919
48928
|
this.customLayoutFuncCache = new Map();
|
|
48920
48929
|
this.reactRemoveGraphicCache = new Map();
|
|
@@ -48992,6 +49001,9 @@
|
|
|
48992
49001
|
removeFun(col, row);
|
|
48993
49002
|
}
|
|
48994
49003
|
}
|
|
49004
|
+
clearCache() {
|
|
49005
|
+
this.removeAllContainer();
|
|
49006
|
+
}
|
|
48995
49007
|
}
|
|
48996
49008
|
function getUpdateCustomCellRangeInListTable(componentId, table, isHeaderCustomLayout) {
|
|
48997
49009
|
const rowSeriesNumber = table.internalProps.rowSeriesNumber ? 1 : 0;
|
|
@@ -49107,8 +49119,8 @@
|
|
|
49107
49119
|
function getCellEventArgsSet(e) {
|
|
49108
49120
|
const tableEvent = {
|
|
49109
49121
|
abstractPos: {
|
|
49110
|
-
x: e.
|
|
49111
|
-
y: e.
|
|
49122
|
+
x: e.x,
|
|
49123
|
+
y: e.y
|
|
49112
49124
|
}
|
|
49113
49125
|
};
|
|
49114
49126
|
const targetCell = getTargetCell(e.target);
|
|
@@ -50580,7 +50592,8 @@
|
|
|
50580
50592
|
x: 0,
|
|
50581
50593
|
y: 0,
|
|
50582
50594
|
fill: false,
|
|
50583
|
-
stroke: false
|
|
50595
|
+
stroke: false,
|
|
50596
|
+
pickable: false
|
|
50584
50597
|
});
|
|
50585
50598
|
cellContent.name = 'content';
|
|
50586
50599
|
cellContent.setCellContentOption({
|
|
@@ -50822,7 +50835,7 @@
|
|
|
50822
50835
|
}
|
|
50823
50836
|
newHeight = (cellGroup.contentHeight ?? cellHeight) - (padding[0] + padding[2]);
|
|
50824
50837
|
cellGroup.forEachChildren((child) => {
|
|
50825
|
-
if (child.type === 'rect' || child.type === 'chart') {
|
|
50838
|
+
if (child.type === 'rect' || child.type === 'chart' || child.name === CUSTOM_CONTAINER_NAME) {
|
|
50826
50839
|
return;
|
|
50827
50840
|
}
|
|
50828
50841
|
if (child.name === 'mark') {
|
|
@@ -50841,7 +50854,7 @@
|
|
|
50841
50854
|
}
|
|
50842
50855
|
else if (textBaseline === 'middle' || textBaseline === 'bottom') {
|
|
50843
50856
|
cellGroup.forEachChildren((child) => {
|
|
50844
|
-
if (child.type === 'rect' || child.type === 'chart') {
|
|
50857
|
+
if (child.type === 'rect' || child.type === 'chart' || child.name === CUSTOM_CONTAINER_NAME) {
|
|
50845
50858
|
return;
|
|
50846
50859
|
}
|
|
50847
50860
|
if (child.name === 'mark') {
|
|
@@ -50879,7 +50892,7 @@
|
|
|
50879
50892
|
}
|
|
50880
50893
|
cellGroup.forEachChildren((child) => {
|
|
50881
50894
|
child.setAttribute('dy', 0);
|
|
50882
|
-
if (child.type === 'rect' || child.type === 'chart') ;
|
|
50895
|
+
if (child.type === 'rect' || child.type === 'chart' || child.name === CUSTOM_CONTAINER_NAME) ;
|
|
50883
50896
|
else if (child.name === 'mark') {
|
|
50884
50897
|
child.setAttribute('y', 0);
|
|
50885
50898
|
}
|
|
@@ -52827,8 +52840,8 @@
|
|
|
52827
52840
|
continue;
|
|
52828
52841
|
}
|
|
52829
52842
|
const mergedCell = scene.getCell(col, mergeRow);
|
|
52830
|
-
const customContainer =
|
|
52831
|
-
|
|
52843
|
+
const customContainer = mergedCell.getChildByName(CUSTOM_CONTAINER_NAME) ||
|
|
52844
|
+
mergedCell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME);
|
|
52832
52845
|
customContainer.removeAllChild();
|
|
52833
52846
|
mergedCell.removeChild(customContainer);
|
|
52834
52847
|
getCustomCellMergeCustom(col, mergeRow, mergedCell, scene.table);
|
|
@@ -53161,7 +53174,7 @@
|
|
|
53161
53174
|
}
|
|
53162
53175
|
const mergedCell = scene.getCell(mergeCol, row);
|
|
53163
53176
|
const customContainer = mergedCell.getChildByName(CUSTOM_CONTAINER_NAME) ||
|
|
53164
|
-
|
|
53177
|
+
mergedCell.getChildByName(CUSTOM_MERGE_CONTAINER_NAME);
|
|
53165
53178
|
customContainer.removeAllChild();
|
|
53166
53179
|
mergedCell.removeChild(customContainer);
|
|
53167
53180
|
getCustomCellMergeCustom(mergeCol, row, mergedCell, scene.table);
|
|
@@ -54746,7 +54759,7 @@
|
|
|
54746
54759
|
this.numberType = CHART_NUMBER_TYPE;
|
|
54747
54760
|
this.isShareChartSpec = isShareChartSpec;
|
|
54748
54761
|
if (!params.chartInstance) {
|
|
54749
|
-
const chartInstance =
|
|
54762
|
+
const chartInstance = new params.ClassType(params.spec, {
|
|
54750
54763
|
renderCanvas: params.canvas,
|
|
54751
54764
|
mode: this.attribute.mode === 'node' ? 'node' : 'desktop-browser',
|
|
54752
54765
|
modeParams: this.attribute.modeParams,
|
|
@@ -54756,9 +54769,8 @@
|
|
|
54756
54769
|
interactive: false,
|
|
54757
54770
|
animation: false,
|
|
54758
54771
|
autoFit: false
|
|
54759
|
-
})
|
|
54772
|
+
});
|
|
54760
54773
|
chartInstance.renderSync();
|
|
54761
|
-
chartInstance.getStage().enableDirtyBounds();
|
|
54762
54774
|
params.chartInstance = this.chartInstance = chartInstance;
|
|
54763
54775
|
}
|
|
54764
54776
|
else {
|
|
@@ -54776,53 +54788,34 @@
|
|
|
54776
54788
|
y1: y1 - table.scrollTop,
|
|
54777
54789
|
y2: y2 - table.scrollTop
|
|
54778
54790
|
});
|
|
54779
|
-
this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec,
|
|
54791
|
+
this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, {
|
|
54780
54792
|
renderCanvas: this.attribute.canvas,
|
|
54781
54793
|
mode: 'desktop-browser',
|
|
54782
54794
|
canvasControled: false,
|
|
54783
54795
|
viewBox: {
|
|
54784
|
-
x1:
|
|
54785
|
-
x2: x2 -
|
|
54786
|
-
y1:
|
|
54787
|
-
y2: y2 -
|
|
54796
|
+
x1: x1 - table.scrollLeft,
|
|
54797
|
+
x2: x2 - table.scrollLeft,
|
|
54798
|
+
y1: y1 - table.scrollTop,
|
|
54799
|
+
y2: y2 - table.scrollTop
|
|
54788
54800
|
},
|
|
54789
54801
|
dpr: table.internalProps.pixelRatio,
|
|
54790
54802
|
animation: false,
|
|
54791
54803
|
interactive: true,
|
|
54792
54804
|
autoFit: false,
|
|
54793
|
-
beforeRender: (
|
|
54794
|
-
const
|
|
54795
|
-
const ctx = chartStage.window.getContext();
|
|
54796
|
-
const stageMatrix = stage.window.getViewBoxTransform();
|
|
54797
|
-
const viewBox = stage.window.getViewBox();
|
|
54805
|
+
beforeRender: (stage) => {
|
|
54806
|
+
const ctx = stage.window.getContext();
|
|
54798
54807
|
ctx.inuse = true;
|
|
54799
54808
|
ctx.clearMatrix();
|
|
54800
|
-
ctx.setTransform(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f, true);
|
|
54801
|
-
ctx.translate(viewBox.x1, viewBox.y1);
|
|
54802
54809
|
ctx.setTransformForCurrent(true);
|
|
54803
54810
|
ctx.beginPath();
|
|
54804
54811
|
ctx.rect(clipBound.x1, clipBound.y1, clipBound.x2 - clipBound.x1, clipBound.y2 - clipBound.y1);
|
|
54805
54812
|
ctx.clip();
|
|
54806
|
-
ctx.clearMatrix();
|
|
54807
|
-
if (!chartStage.needRender) {
|
|
54808
|
-
chartStage.pauseRender();
|
|
54809
|
-
table.scenegraph.stage.dirtyBounds.union(this.globalAABBBounds);
|
|
54810
|
-
table.scenegraph.updateNextFrame();
|
|
54811
|
-
}
|
|
54812
54813
|
},
|
|
54813
54814
|
afterRender(stage) {
|
|
54814
54815
|
const ctx = stage.window.getContext();
|
|
54815
54816
|
ctx.inuse = false;
|
|
54816
|
-
stage.needRender = false;
|
|
54817
|
-
chartStage.resumeRender();
|
|
54818
54817
|
}
|
|
54819
|
-
})
|
|
54820
|
-
const chartStage = this.activeChartInstance.getStage();
|
|
54821
|
-
const matrix = this.globalTransMatrix.clone();
|
|
54822
|
-
const stageMatrix = this.stage.window.getViewBoxTransform();
|
|
54823
|
-
matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
|
|
54824
|
-
chartStage.window.setViewBoxTransform &&
|
|
54825
|
-
chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
|
|
54818
|
+
});
|
|
54826
54819
|
this.activeChartInstance.renderSync();
|
|
54827
54820
|
table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(this.activeChartInstance);
|
|
54828
54821
|
this.activeChartInstance.on('click', (params) => {
|
|
@@ -54858,12 +54851,11 @@
|
|
|
54858
54851
|
const cellGroup = this.parent;
|
|
54859
54852
|
const padding = this.attribute.cellPadding;
|
|
54860
54853
|
const table = this.stage.table;
|
|
54861
|
-
const { x1, y1, x2, y2 } = cellGroup.globalAABBBounds;
|
|
54862
54854
|
return {
|
|
54863
|
-
x1: Math.ceil(x1 + padding[3] + table.scrollLeft
|
|
54864
|
-
x2: Math.ceil(x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft
|
|
54865
|
-
y1: Math.ceil(y1 + padding[0] + table.scrollTop
|
|
54866
|
-
y2: Math.ceil(y1 + cellGroup.attribute.height - padding[2] + table.scrollTop
|
|
54855
|
+
x1: Math.ceil(cellGroup.globalAABBBounds.x1 + padding[3] + table.scrollLeft),
|
|
54856
|
+
x2: Math.ceil(cellGroup.globalAABBBounds.x1 + cellGroup.attribute.width - padding[1] + table.scrollLeft),
|
|
54857
|
+
y1: Math.ceil(cellGroup.globalAABBBounds.y1 + padding[0] + table.scrollTop),
|
|
54858
|
+
y2: Math.ceil(cellGroup.globalAABBBounds.y1 + cellGroup.attribute.height - padding[2] + table.scrollTop)
|
|
54867
54859
|
};
|
|
54868
54860
|
}
|
|
54869
54861
|
}
|
|
@@ -54894,10 +54886,6 @@
|
|
|
54894
54886
|
bodyBound.x1 = tableBound.x1 + table.getFrozenColsWidth();
|
|
54895
54887
|
bodyBound.x2 = tableBound.x2 - table.getRightFrozenColsWidth();
|
|
54896
54888
|
}
|
|
54897
|
-
bodyBound.x1 = bodyBound.x1 + (table.options.viewBox?.x1 ?? 0);
|
|
54898
|
-
bodyBound.x2 = bodyBound.x2 + (table.options.viewBox?.x1 ?? 0);
|
|
54899
|
-
bodyBound.y1 = bodyBound.y1 + (table.options.viewBox?.y1 ?? 0);
|
|
54900
|
-
bodyBound.y2 = bodyBound.y2 + (table.options.viewBox?.y1 ?? 0);
|
|
54901
54889
|
return bodyBound;
|
|
54902
54890
|
}
|
|
54903
54891
|
|
|
@@ -54914,8 +54902,23 @@
|
|
|
54914
54902
|
return isHandlingChartQueue;
|
|
54915
54903
|
}
|
|
54916
54904
|
function renderChart(chart) {
|
|
54917
|
-
const { axes, dataId, data, spec } = chart.attribute;
|
|
54918
|
-
|
|
54905
|
+
const { axes, dataId, data, spec, ClassType, canvas, mode, modeParams, dpr } = chart.attribute;
|
|
54906
|
+
let { chartInstance } = chart;
|
|
54907
|
+
if (!chartInstance) {
|
|
54908
|
+
chartInstance = new ClassType(spec, {
|
|
54909
|
+
renderCanvas: canvas,
|
|
54910
|
+
mode: mode === 'node' ? 'node' : 'desktop-browser',
|
|
54911
|
+
modeParams: modeParams,
|
|
54912
|
+
canvasControled: false,
|
|
54913
|
+
viewBox: { x1: 0, x2: 0, y1: 0, y2: 0 },
|
|
54914
|
+
dpr: dpr,
|
|
54915
|
+
interactive: false,
|
|
54916
|
+
animation: false,
|
|
54917
|
+
autoFit: false
|
|
54918
|
+
});
|
|
54919
|
+
chartInstance.renderSync();
|
|
54920
|
+
chart.chartInstance = chartInstance;
|
|
54921
|
+
}
|
|
54919
54922
|
const viewBox = chart.getViewBox();
|
|
54920
54923
|
if (viewBox.x2 <= viewBox.x1) {
|
|
54921
54924
|
viewBox.x2 = viewBox.x1 + 1;
|
|
@@ -54923,65 +54926,46 @@
|
|
|
54923
54926
|
if (viewBox.y2 <= viewBox.y1) {
|
|
54924
54927
|
viewBox.y2 = viewBox.y1 + 1;
|
|
54925
54928
|
}
|
|
54926
|
-
|
|
54927
|
-
|
|
54928
|
-
|
|
54929
|
-
y1: 0,
|
|
54930
|
-
y2: viewBox.y2 - viewBox.y1
|
|
54931
|
-
}, false, false);
|
|
54932
|
-
const chartStage = chartInstance.getStage();
|
|
54933
|
-
const matrix = chart.globalTransMatrix.clone();
|
|
54934
|
-
const stageMatrix = chart.stage.window.getViewBoxTransform();
|
|
54935
|
-
matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
|
|
54936
|
-
chartStage.window.setViewBoxTransform &&
|
|
54937
|
-
chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
|
|
54938
|
-
const { table } = chart.getRootNode();
|
|
54939
|
-
let updateSpec = false;
|
|
54940
|
-
if (table.options.specFormat) {
|
|
54941
|
-
const formatResult = table.options.specFormat(chart.attribute.spec);
|
|
54942
|
-
if (formatResult.needFormatSpec && formatResult.spec) {
|
|
54943
|
-
const spec = formatResult.spec;
|
|
54944
|
-
chartInstance.updateSpecSync(spec);
|
|
54945
|
-
updateSpec = true;
|
|
54946
|
-
}
|
|
54947
|
-
}
|
|
54948
|
-
if (!updateSpec) {
|
|
54949
|
-
axes?.forEach((axis, index) => {
|
|
54950
|
-
if (axis.type === 'band') {
|
|
54951
|
-
chartInstance.updateModelSpec({ type: 'axes', index }, { domain: axis.domain.slice(0) }, true);
|
|
54952
|
-
}
|
|
54953
|
-
else {
|
|
54954
|
-
chartInstance.updateModelSpecSync({ type: 'axes', index }, { min: axis.range?.min ?? 0, max: axis.range?.max ?? 0 }, true);
|
|
54955
|
-
}
|
|
54956
|
-
});
|
|
54957
|
-
table.internalProps.layoutMap?.updateDataStateToActiveChartInstance?.(chartInstance);
|
|
54958
|
-
if (typeof dataId === 'string') {
|
|
54959
|
-
chartInstance.updateDataSync(dataId, data ?? []);
|
|
54929
|
+
axes?.forEach((axis, index) => {
|
|
54930
|
+
if (axis.type === 'band') {
|
|
54931
|
+
chartInstance.updateModelSpec({ type: 'axes', index }, { domain: axis.domain.slice(0) }, true);
|
|
54960
54932
|
}
|
|
54961
54933
|
else {
|
|
54962
|
-
|
|
54963
|
-
|
|
54964
|
-
|
|
54965
|
-
|
|
54966
|
-
|
|
54967
|
-
|
|
54968
|
-
|
|
54969
|
-
|
|
54970
|
-
|
|
54971
|
-
|
|
54972
|
-
|
|
54973
|
-
|
|
54974
|
-
|
|
54975
|
-
|
|
54976
|
-
|
|
54977
|
-
|
|
54978
|
-
|
|
54979
|
-
|
|
54980
|
-
|
|
54981
|
-
|
|
54934
|
+
chartInstance.updateModelSpecSync({ type: 'axes', index }, { min: axis.range?.min ?? 0, max: axis.range?.max ?? 0 }, true);
|
|
54935
|
+
}
|
|
54936
|
+
});
|
|
54937
|
+
chartInstance.updateViewBox({
|
|
54938
|
+
x1: viewBox.x1 - chart.getRootNode().table.scrollLeft,
|
|
54939
|
+
x2: viewBox.x2 - chart.getRootNode().table.scrollLeft,
|
|
54940
|
+
y1: viewBox.y1 - chart.getRootNode().table.scrollTop,
|
|
54941
|
+
y2: viewBox.y2 - chart.getRootNode().table.scrollTop
|
|
54942
|
+
}, false, false);
|
|
54943
|
+
if (typeof dataId === 'string') {
|
|
54944
|
+
chartInstance.updateDataSync(dataId, data ?? []);
|
|
54945
|
+
}
|
|
54946
|
+
else {
|
|
54947
|
+
const dataBatch = [];
|
|
54948
|
+
for (const dataIdStr in dataId) {
|
|
54949
|
+
const dataIdAndField = dataId[dataIdStr];
|
|
54950
|
+
const series = spec.series.find((item) => item?.data?.id === dataIdStr);
|
|
54951
|
+
dataBatch.push({
|
|
54952
|
+
id: dataIdStr,
|
|
54953
|
+
values: dataIdAndField
|
|
54954
|
+
? data?.filter((item) => {
|
|
54955
|
+
return item.hasOwnProperty(dataIdAndField);
|
|
54956
|
+
}) ?? []
|
|
54957
|
+
: data ?? [],
|
|
54958
|
+
fields: series?.data?.fields
|
|
54959
|
+
});
|
|
54960
|
+
if (!chartInstance.updateFullDataSync) {
|
|
54961
|
+
chartInstance.updateDataSync(dataIdStr, dataIdAndField
|
|
54962
|
+
? data?.filter((item) => {
|
|
54963
|
+
return item.hasOwnProperty(dataIdAndField);
|
|
54964
|
+
}) ?? []
|
|
54965
|
+
: data ?? []);
|
|
54982
54966
|
}
|
|
54983
|
-
chartInstance.updateFullDataSync?.(dataBatch);
|
|
54984
54967
|
}
|
|
54968
|
+
chartInstance.updateFullDataSync?.(dataBatch);
|
|
54985
54969
|
}
|
|
54986
54970
|
const sg = chartInstance.getStage();
|
|
54987
54971
|
cacheStageCanvas(sg, chart);
|
|
@@ -55043,7 +55027,7 @@
|
|
|
55043
55027
|
}
|
|
55044
55028
|
|
|
55045
55029
|
const ChartRender = Symbol.for('ChartRender');
|
|
55046
|
-
let DefaultCanvasChartRender = class DefaultCanvasChartRender
|
|
55030
|
+
let DefaultCanvasChartRender = class DefaultCanvasChartRender {
|
|
55047
55031
|
type;
|
|
55048
55032
|
numberType = CHART_NUMBER_TYPE;
|
|
55049
55033
|
drawShape(chart, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
@@ -55051,7 +55035,6 @@
|
|
|
55051
55035
|
const { dataId, data, spec } = chart.attribute;
|
|
55052
55036
|
chart.getViewBox();
|
|
55053
55037
|
const { width = groupAttribute.width, height = groupAttribute.height } = chart.attribute;
|
|
55054
|
-
const { table } = chart.getRootNode();
|
|
55055
55038
|
const { active, cacheCanvas, activeChartInstance } = chart;
|
|
55056
55039
|
if (!active && cacheCanvas) {
|
|
55057
55040
|
if (isArray$1(cacheCanvas)) {
|
|
@@ -55065,27 +55048,6 @@
|
|
|
55065
55048
|
}
|
|
55066
55049
|
}
|
|
55067
55050
|
else if (activeChartInstance) {
|
|
55068
|
-
if (table.options.specFormat) {
|
|
55069
|
-
const formatResult = table.options.specFormat(chart.attribute.spec);
|
|
55070
|
-
if (formatResult.needFormatSpec && formatResult.spec) {
|
|
55071
|
-
const spec = formatResult.spec;
|
|
55072
|
-
activeChartInstance.updateSpecSync(spec);
|
|
55073
|
-
return;
|
|
55074
|
-
}
|
|
55075
|
-
}
|
|
55076
|
-
const viewBox = chart.getViewBox();
|
|
55077
|
-
activeChartInstance.updateViewBox({
|
|
55078
|
-
x1: 0,
|
|
55079
|
-
x2: viewBox.x2 - viewBox.x1,
|
|
55080
|
-
y1: 0,
|
|
55081
|
-
y2: viewBox.y2 - viewBox.y1
|
|
55082
|
-
}, false, false);
|
|
55083
|
-
const chartStage = activeChartInstance.getStage();
|
|
55084
|
-
chartStage.needRender = true;
|
|
55085
|
-
const matrix = chart.globalTransMatrix.clone();
|
|
55086
|
-
const stageMatrix = chart.stage.window.getViewBoxTransform().clone();
|
|
55087
|
-
stageMatrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
|
|
55088
|
-
chartStage.window.setViewBoxTransform(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f);
|
|
55089
55051
|
if (typeof dataId === 'string') {
|
|
55090
55052
|
activeChartInstance.updateDataSync(dataId, data ?? []);
|
|
55091
55053
|
}
|
|
@@ -55115,13 +55077,13 @@
|
|
|
55115
55077
|
}
|
|
55116
55078
|
}
|
|
55117
55079
|
else {
|
|
55118
|
-
if (table.internalProps.renderChartAsync) {
|
|
55080
|
+
if (chart.getRootNode().table.internalProps.renderChartAsync) {
|
|
55119
55081
|
if (chartRenderKeys.indexOf(`${chart.parent.col}+${chart.parent.row}`) === -1) {
|
|
55120
55082
|
chartRenderKeys.push(`${chart.parent.col}+${chart.parent.row}`);
|
|
55121
55083
|
chartRenderQueueList.push(chart);
|
|
55122
55084
|
}
|
|
55123
55085
|
if (!IsHandlingChartQueue()) {
|
|
55124
|
-
startRenderChartQueue(table);
|
|
55086
|
+
startRenderChartQueue(chart.getRootNode().table);
|
|
55125
55087
|
}
|
|
55126
55088
|
}
|
|
55127
55089
|
else {
|
|
@@ -55130,7 +55092,31 @@
|
|
|
55130
55092
|
}
|
|
55131
55093
|
}
|
|
55132
55094
|
draw(chart, renderService, drawContext, params) {
|
|
55133
|
-
|
|
55095
|
+
const { context } = drawContext;
|
|
55096
|
+
if (!context) {
|
|
55097
|
+
return;
|
|
55098
|
+
}
|
|
55099
|
+
const { clip } = chart.attribute;
|
|
55100
|
+
if (clip) {
|
|
55101
|
+
context.save();
|
|
55102
|
+
}
|
|
55103
|
+
else {
|
|
55104
|
+
context.highPerformanceSave();
|
|
55105
|
+
}
|
|
55106
|
+
context.transformFromMatrix(chart.transMatrix, true);
|
|
55107
|
+
context.beginPath();
|
|
55108
|
+
if (params.skipDraw) {
|
|
55109
|
+
this.drawShape(chart, context, 0, 0, drawContext, params, () => false, () => false);
|
|
55110
|
+
}
|
|
55111
|
+
else {
|
|
55112
|
+
this.drawShape(chart, context, 0, 0, drawContext);
|
|
55113
|
+
}
|
|
55114
|
+
if (clip) {
|
|
55115
|
+
context.restore();
|
|
55116
|
+
}
|
|
55117
|
+
else {
|
|
55118
|
+
context.highPerformanceRestore();
|
|
55119
|
+
}
|
|
55134
55120
|
}
|
|
55135
55121
|
};
|
|
55136
55122
|
DefaultCanvasChartRender = __decorate([
|
|
@@ -55383,6 +55369,15 @@
|
|
|
55383
55369
|
}
|
|
55384
55370
|
}
|
|
55385
55371
|
}
|
|
55372
|
+
else if (state.table.theme.selectionStyle.selectionFillMode === 'replace') {
|
|
55373
|
+
for (let i = 0; i < ranges.length; i++) {
|
|
55374
|
+
const range = ranges[i];
|
|
55375
|
+
if (range.start.col <= col && range.start.row <= row && range.end.col >= col && range.end.row >= row) {
|
|
55376
|
+
selectMode = 'cellBgColor';
|
|
55377
|
+
break;
|
|
55378
|
+
}
|
|
55379
|
+
}
|
|
55380
|
+
}
|
|
55386
55381
|
return selectMode;
|
|
55387
55382
|
}
|
|
55388
55383
|
function isCellDisableSelect(table, col, row) {
|
|
@@ -59094,7 +59089,9 @@
|
|
|
59094
59089
|
const bodyClickLineWidth = theme.selectionStyle?.cellBorderLineWidth;
|
|
59095
59090
|
const rect = createRect({
|
|
59096
59091
|
pickable: false,
|
|
59097
|
-
fill: theme.selectionStyle?.
|
|
59092
|
+
fill: theme.selectionStyle?.selectionFillMode === 'replace'
|
|
59093
|
+
? false
|
|
59094
|
+
: theme.selectionStyle?.cellBgColor ?? 'rgba(0, 0, 255,0.1)',
|
|
59098
59095
|
lineWidth: bodyClickLineWidth,
|
|
59099
59096
|
stroke: strokes.map(stroke => {
|
|
59100
59097
|
if (stroke) {
|
|
@@ -59969,7 +59966,7 @@
|
|
|
59969
59966
|
}
|
|
59970
59967
|
}
|
|
59971
59968
|
|
|
59972
|
-
function
|
|
59969
|
+
function updateChartSizeForResizeColWidth(scenegraph, col) {
|
|
59973
59970
|
for (let c = col; c <= scenegraph.proxy.colEnd; c++) {
|
|
59974
59971
|
const columnGroup = scenegraph.getColGroup(c);
|
|
59975
59972
|
columnGroup?.getChildren()?.forEach((cellNode) => {
|
|
@@ -60001,6 +59998,39 @@
|
|
|
60001
59998
|
}
|
|
60002
59999
|
}
|
|
60003
60000
|
}
|
|
60001
|
+
function updateChartSizeForResizeRowHeight(scenegraph, row) {
|
|
60002
|
+
const updateCellNode = (c, r) => {
|
|
60003
|
+
const cellNode = scenegraph.getCell(c, r);
|
|
60004
|
+
const width = scenegraph.table.getColWidth(cellNode.col);
|
|
60005
|
+
const height = scenegraph.table.getRowHeight(cellNode.row);
|
|
60006
|
+
cellNode.children.forEach((node) => {
|
|
60007
|
+
if (node.type === 'chart') {
|
|
60008
|
+
node.cacheCanvas = null;
|
|
60009
|
+
node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));
|
|
60010
|
+
node.setAttribute('height', Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2]));
|
|
60011
|
+
}
|
|
60012
|
+
});
|
|
60013
|
+
};
|
|
60014
|
+
for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {
|
|
60015
|
+
for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {
|
|
60016
|
+
updateCellNode(c, r);
|
|
60017
|
+
}
|
|
60018
|
+
}
|
|
60019
|
+
if (scenegraph.table.rightFrozenColCount >= 1) {
|
|
60020
|
+
for (let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount; c <= scenegraph.table.colCount - 1; c++) {
|
|
60021
|
+
for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {
|
|
60022
|
+
updateCellNode(c, r);
|
|
60023
|
+
}
|
|
60024
|
+
}
|
|
60025
|
+
}
|
|
60026
|
+
if (scenegraph.table.frozenColCount >= 1) {
|
|
60027
|
+
for (let c = 0; c <= scenegraph.table.frozenColCount - 1; c++) {
|
|
60028
|
+
for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {
|
|
60029
|
+
updateCellNode(c, r);
|
|
60030
|
+
}
|
|
60031
|
+
}
|
|
60032
|
+
}
|
|
60033
|
+
}
|
|
60004
60034
|
function clearChartCacheImage(scenegraph) {
|
|
60005
60035
|
for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {
|
|
60006
60036
|
const columnGroup = scenegraph.getColGroup(c);
|
|
@@ -60014,15 +60044,6 @@
|
|
|
60014
60044
|
});
|
|
60015
60045
|
}
|
|
60016
60046
|
}
|
|
60017
|
-
function clearCellChartCacheImage(col, row, scenegraph) {
|
|
60018
|
-
const cellGroup = scenegraph.getCell(col, row);
|
|
60019
|
-
cellGroup.children.forEach((node) => {
|
|
60020
|
-
if (node.type === 'chart') {
|
|
60021
|
-
node.cacheCanvas = null;
|
|
60022
|
-
node.addUpdateBoundTag();
|
|
60023
|
-
}
|
|
60024
|
-
});
|
|
60025
|
-
}
|
|
60026
60047
|
function updateChartData(scenegraph) {
|
|
60027
60048
|
const table = scenegraph.table;
|
|
60028
60049
|
for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {
|
|
@@ -60884,12 +60905,7 @@
|
|
|
60884
60905
|
setPoptipTheme(this.table.theme.textPopTipStyle);
|
|
60885
60906
|
let width;
|
|
60886
60907
|
let height;
|
|
60887
|
-
if (
|
|
60888
|
-
vglobal.setEnv('browser');
|
|
60889
|
-
width = table.options.viewBox.x2 - table.options.viewBox.x1;
|
|
60890
|
-
height = table.options.viewBox.y2 - table.options.viewBox.y1;
|
|
60891
|
-
}
|
|
60892
|
-
else if (Env.mode === 'node') {
|
|
60908
|
+
if (Env.mode === 'node') {
|
|
60893
60909
|
vglobal.setEnv('node', table.options.modeParams);
|
|
60894
60910
|
width = table.canvasWidth;
|
|
60895
60911
|
height = table.canvasHeight;
|
|
@@ -60907,15 +60923,9 @@
|
|
|
60907
60923
|
background: table.theme.underlayBackgroundColor,
|
|
60908
60924
|
dpr: table.internalProps.pixelRatio,
|
|
60909
60925
|
enableLayout: true,
|
|
60910
|
-
|
|
60911
|
-
this.table.options.beforeRender && this.table.options.beforeRender(stage);
|
|
60912
|
-
},
|
|
60913
|
-
afterRender: (stage) => {
|
|
60914
|
-
this.table.options.afterRender && this.table.options.afterRender(stage);
|
|
60926
|
+
afterRender: () => {
|
|
60915
60927
|
this.table.fireListeners('after_render', null);
|
|
60916
60928
|
},
|
|
60917
|
-
canvasControled: !table.options.canvas,
|
|
60918
|
-
viewBox: table.options.viewBox,
|
|
60919
60929
|
...table.options.renderOption
|
|
60920
60930
|
});
|
|
60921
60931
|
this.stage.defaultLayer.setTheme({
|
|
@@ -61047,6 +61057,7 @@
|
|
|
61047
61057
|
delete this.tableGroup.border;
|
|
61048
61058
|
}
|
|
61049
61059
|
this.proxy?.release();
|
|
61060
|
+
this.table.reactCustomLayout?.clearCache();
|
|
61050
61061
|
}
|
|
61051
61062
|
updateStageBackground() {
|
|
61052
61063
|
this.stage.background = this.table.theme.underlayBackgroundColor;
|
|
@@ -61064,6 +61075,7 @@
|
|
|
61064
61075
|
createSceneGraph(skipRowHeightClear = false) {
|
|
61065
61076
|
if (!skipRowHeightClear) {
|
|
61066
61077
|
this.table.rowHeightsMap.clear();
|
|
61078
|
+
this.table.internalProps.layoutMap.clearCellRangeMap();
|
|
61067
61079
|
}
|
|
61068
61080
|
if (this.table.isPivotChart() || this.table._hasCustomRenderOrLayout()) {
|
|
61069
61081
|
this.stage.pluginService.autoEnablePlugins.getContributions().forEach((p) => {
|
|
@@ -61286,8 +61298,11 @@
|
|
|
61286
61298
|
this.updateContainer(true);
|
|
61287
61299
|
}
|
|
61288
61300
|
}
|
|
61289
|
-
|
|
61290
|
-
|
|
61301
|
+
updateChartSizeForResizeColWidth(col) {
|
|
61302
|
+
updateChartSizeForResizeColWidth(this, col);
|
|
61303
|
+
}
|
|
61304
|
+
updateChartSizeForResizeRowHeight(col) {
|
|
61305
|
+
updateChartSizeForResizeRowHeight(this, col);
|
|
61291
61306
|
}
|
|
61292
61307
|
updateChartState(datum) {
|
|
61293
61308
|
this.table.isPivotChart() && updateChartState(this, datum);
|
|
@@ -61423,7 +61438,7 @@
|
|
|
61423
61438
|
this.table.heightMode === 'adaptive' ||
|
|
61424
61439
|
this.table.autoFillWidth ||
|
|
61425
61440
|
this.table.autoFillHeight) {
|
|
61426
|
-
this.
|
|
61441
|
+
this.updateChartSizeForResizeColWidth(this.table.rowHeaderLevelCount);
|
|
61427
61442
|
}
|
|
61428
61443
|
this.proxy.progress();
|
|
61429
61444
|
this.updateNextFrame();
|
|
@@ -62929,63 +62944,66 @@
|
|
|
62929
62944
|
return;
|
|
62930
62945
|
}
|
|
62931
62946
|
const targetCell = adjustMoveHeaderTarget({ col: state.columnMove.colSource, row: state.columnMove.rowSource }, { col, row }, state.table);
|
|
62932
|
-
state.
|
|
62933
|
-
state.columnMove.y = y - state.table.tableY;
|
|
62934
|
-
state.columnMove.colTarget = targetCell.col;
|
|
62935
|
-
state.columnMove.rowTarget = targetCell.row;
|
|
62936
|
-
const canMove = state.table.internalProps.layoutMap.canMoveHeaderPosition({ col: state.columnMove.colSource, row: state.columnMove.rowSource }, { col: state.columnMove.colTarget, row: state.columnMove.rowTarget });
|
|
62947
|
+
const canMove = state.table.internalProps.layoutMap.canMoveHeaderPosition({ col: state.columnMove.colSource, row: state.columnMove.rowSource }, { col: targetCell.col, row: targetCell.row });
|
|
62937
62948
|
if (!canMove) {
|
|
62938
62949
|
state.updateCursor('not-allowed');
|
|
62950
|
+
state.columnMove.colTarget = state.columnMove.colSource;
|
|
62951
|
+
state.columnMove.rowTarget = state.columnMove.rowSource;
|
|
62939
62952
|
}
|
|
62940
62953
|
else {
|
|
62954
|
+
state.columnMove.x = x - state.table.tableX;
|
|
62955
|
+
state.columnMove.y = y - state.table.tableY;
|
|
62956
|
+
state.columnMove.colTarget = targetCell.col;
|
|
62957
|
+
state.columnMove.rowTarget = targetCell.row;
|
|
62941
62958
|
state.updateCursor('grabbing');
|
|
62942
|
-
|
|
62943
|
-
|
|
62944
|
-
|
|
62945
|
-
|
|
62946
|
-
|
|
62947
|
-
|
|
62948
|
-
|
|
62949
|
-
|
|
62950
|
-
|
|
62951
|
-
|
|
62952
|
-
|
|
62953
|
-
|
|
62954
|
-
|
|
62955
|
-
|
|
62956
|
-
|
|
62957
|
-
|
|
62958
|
-
|
|
62959
|
-
|
|
62960
|
-
|
|
62961
|
-
|
|
62962
|
-
|
|
62963
|
-
|
|
62964
|
-
|
|
62965
|
-
}
|
|
62966
|
-
}
|
|
62967
|
-
else if (cellLocation === 'rowHeader' ||
|
|
62968
|
-
state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row)) {
|
|
62969
|
-
backY = state.columnMove.y;
|
|
62970
|
-
if (state.table.isFrozenRow(row)) {
|
|
62971
|
-
lineY =
|
|
62972
|
-
state.columnMove.rowTarget >= state.columnMove.rowSource
|
|
62973
|
-
? state.table.getRowsHeight(0, state.columnMove.rowTarget)
|
|
62974
|
-
: state.table.getRowsHeight(0, state.columnMove.rowTarget - 1);
|
|
62975
|
-
}
|
|
62976
|
-
else if (state.table.isBottomFrozenRow(row)) {
|
|
62977
|
-
lineY = state.table.tableNoFrameHeight - state.table.getRowsHeight(targetCell.row + 1, state.table.rowCount - 1);
|
|
62959
|
+
let lineX;
|
|
62960
|
+
let backX;
|
|
62961
|
+
let lineY;
|
|
62962
|
+
let backY;
|
|
62963
|
+
const cellLocation = state.table.getCellLocation(state.columnMove.colSource, state.columnMove.rowSource);
|
|
62964
|
+
if (cellLocation === 'columnHeader') {
|
|
62965
|
+
backX = state.columnMove.x;
|
|
62966
|
+
if (state.table.isLeftFrozenColumn(col)) {
|
|
62967
|
+
lineX =
|
|
62968
|
+
state.columnMove.colTarget >= state.columnMove.colSource
|
|
62969
|
+
? state.table.getColsWidth(0, state.columnMove.colTarget)
|
|
62970
|
+
: state.table.getColsWidth(0, state.columnMove.colTarget - 1);
|
|
62971
|
+
}
|
|
62972
|
+
else if (state.table.isRightFrozenColumn(col)) {
|
|
62973
|
+
lineX = state.table.tableNoFrameWidth - state.table.getColsWidth(targetCell.col + 1, state.table.colCount - 1);
|
|
62974
|
+
}
|
|
62975
|
+
else {
|
|
62976
|
+
lineX =
|
|
62977
|
+
(state.columnMove.colTarget >= state.columnMove.colSource
|
|
62978
|
+
? state.table.getColsWidth(0, state.columnMove.colTarget)
|
|
62979
|
+
: state.table.getColsWidth(0, state.columnMove.colTarget - 1)) -
|
|
62980
|
+
state.table.stateManager.scroll.horizontalBarPos;
|
|
62981
|
+
}
|
|
62978
62982
|
}
|
|
62979
|
-
else
|
|
62980
|
-
|
|
62981
|
-
|
|
62982
|
-
|
|
62983
|
-
|
|
62984
|
-
state.
|
|
62983
|
+
else if (cellLocation === 'rowHeader' ||
|
|
62984
|
+
state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row)) {
|
|
62985
|
+
backY = state.columnMove.y;
|
|
62986
|
+
if (state.table.isFrozenRow(row)) {
|
|
62987
|
+
lineY =
|
|
62988
|
+
state.columnMove.rowTarget >= state.columnMove.rowSource
|
|
62989
|
+
? state.table.getRowsHeight(0, state.columnMove.rowTarget)
|
|
62990
|
+
: state.table.getRowsHeight(0, state.columnMove.rowTarget - 1);
|
|
62991
|
+
}
|
|
62992
|
+
else if (state.table.isBottomFrozenRow(row)) {
|
|
62993
|
+
lineY =
|
|
62994
|
+
state.table.tableNoFrameHeight - state.table.getRowsHeight(targetCell.row + 1, state.table.rowCount - 1);
|
|
62995
|
+
}
|
|
62996
|
+
else {
|
|
62997
|
+
lineY =
|
|
62998
|
+
(state.columnMove.rowTarget >= state.columnMove.rowSource
|
|
62999
|
+
? state.table.getRowsHeight(0, state.columnMove.rowTarget)
|
|
63000
|
+
: state.table.getRowsHeight(0, state.columnMove.rowTarget - 1)) -
|
|
63001
|
+
state.table.stateManager.scroll.verticalBarPos;
|
|
63002
|
+
}
|
|
62985
63003
|
}
|
|
63004
|
+
state.table.scenegraph.component.updateMoveCol(backX, lineX, backY, lineY);
|
|
63005
|
+
state.table.scenegraph.updateNextFrame();
|
|
62986
63006
|
}
|
|
62987
|
-
state.table.scenegraph.component.updateMoveCol(backX, lineX, backY, lineY);
|
|
62988
|
-
state.table.scenegraph.updateNextFrame();
|
|
62989
63007
|
}
|
|
62990
63008
|
function endMoveCol(state) {
|
|
62991
63009
|
if ('canMoveHeaderPosition' in state.table.internalProps.layoutMap &&
|
|
@@ -64152,7 +64170,7 @@
|
|
|
64152
64170
|
setTimeout(() => {
|
|
64153
64171
|
this.columnResize.resizing = false;
|
|
64154
64172
|
}, 0);
|
|
64155
|
-
this.table.scenegraph.
|
|
64173
|
+
this.table.scenegraph.updateChartSizeForResizeColWidth(this.columnResize.col);
|
|
64156
64174
|
this.checkFrozen();
|
|
64157
64175
|
this.table.scenegraph.component.hideResizeCol();
|
|
64158
64176
|
this.table.scenegraph.updateNextFrame();
|
|
@@ -64175,7 +64193,7 @@
|
|
|
64175
64193
|
setTimeout(() => {
|
|
64176
64194
|
this.rowResize.resizing = false;
|
|
64177
64195
|
}, 0);
|
|
64178
|
-
this.table.scenegraph.
|
|
64196
|
+
this.table.scenegraph.updateChartSizeForResizeColWidth(this.rowResize.row);
|
|
64179
64197
|
this.table.scenegraph.component.hideResizeRow();
|
|
64180
64198
|
this.table.scenegraph.updateNextFrame();
|
|
64181
64199
|
}
|
|
@@ -64420,7 +64438,7 @@
|
|
|
64420
64438
|
if (autoHide) {
|
|
64421
64439
|
clearTimeout(this._clearVerticalScrollBar);
|
|
64422
64440
|
this._clearVerticalScrollBar = setTimeout(() => {
|
|
64423
|
-
this.table.scenegraph
|
|
64441
|
+
this.table.scenegraph?.component.hideVerticalScrollBar();
|
|
64424
64442
|
}, 1000);
|
|
64425
64443
|
}
|
|
64426
64444
|
}
|
|
@@ -64432,7 +64450,7 @@
|
|
|
64432
64450
|
if (autoHide) {
|
|
64433
64451
|
clearTimeout(this._clearHorizontalScrollBar);
|
|
64434
64452
|
this._clearHorizontalScrollBar = setTimeout(() => {
|
|
64435
|
-
this.table.scenegraph
|
|
64453
|
+
this.table.scenegraph?.component.hideHorizontalScrollBar();
|
|
64436
64454
|
}, 1000);
|
|
64437
64455
|
}
|
|
64438
64456
|
}
|
|
@@ -65924,6 +65942,7 @@
|
|
|
65924
65942
|
eventManager.dealTableHover();
|
|
65925
65943
|
});
|
|
65926
65944
|
handler.on(table.getElement(), 'wheel', (e) => {
|
|
65945
|
+
table.editorManager?.completeEdit();
|
|
65927
65946
|
if (table.eventManager._enableTableScroll) {
|
|
65928
65947
|
handleWhell(e, stateManager);
|
|
65929
65948
|
}
|
|
@@ -66016,16 +66035,32 @@
|
|
|
66016
66035
|
}
|
|
66017
66036
|
}
|
|
66018
66037
|
else if (e.key === 'Escape') {
|
|
66019
|
-
table.editorManager
|
|
66038
|
+
table.editorManager?.cancelEdit();
|
|
66020
66039
|
}
|
|
66021
66040
|
else if (e.key === 'Enter') {
|
|
66022
66041
|
if (table.editorManager?.editingEditor) {
|
|
66023
66042
|
handleKeydownListener(e);
|
|
66024
66043
|
table.editorManager.completeEdit();
|
|
66025
66044
|
table.getElement().focus();
|
|
66045
|
+
if (table.options.keyboardOptions?.moveFocusCellOnEnter === true) {
|
|
66046
|
+
const targetCol = stateManager.select.cellPos.col;
|
|
66047
|
+
const targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
|
|
66048
|
+
if (isCellDisableSelect(table, targetCol, targetRow)) {
|
|
66049
|
+
return;
|
|
66050
|
+
}
|
|
66051
|
+
table.selectCell(targetCol, targetRow, e.shiftKey);
|
|
66052
|
+
}
|
|
66026
66053
|
return;
|
|
66027
66054
|
}
|
|
66028
|
-
if (
|
|
66055
|
+
if (table.options.keyboardOptions?.moveFocusCellOnEnter === true) {
|
|
66056
|
+
const targetCol = stateManager.select.cellPos.col;
|
|
66057
|
+
const targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
|
|
66058
|
+
if (isCellDisableSelect(table, targetCol, targetRow)) {
|
|
66059
|
+
return;
|
|
66060
|
+
}
|
|
66061
|
+
table.selectCell(targetCol, targetRow, e.shiftKey);
|
|
66062
|
+
}
|
|
66063
|
+
else if ((table.options.keyboardOptions?.editCellOnEnter ?? true) &&
|
|
66029
66064
|
(table.stateManager.select.ranges?.length ?? 0) === 1) {
|
|
66030
66065
|
const startCol = table.stateManager.select.ranges[0].start.col;
|
|
66031
66066
|
const startRow = table.stateManager.select.ranges[0].start.row;
|
|
@@ -66070,6 +66105,16 @@
|
|
|
66070
66105
|
}
|
|
66071
66106
|
}
|
|
66072
66107
|
}
|
|
66108
|
+
else {
|
|
66109
|
+
const editCellTrigger = table.options.editCellTrigger;
|
|
66110
|
+
if ((editCellTrigger === 'keydown' || (Array.isArray(editCellTrigger) && editCellTrigger.includes('keydown'))) &&
|
|
66111
|
+
!table.editorManager?.editingEditor) {
|
|
66112
|
+
const allowedKeys = /^[a-zA-Z0-9+\-*\/%=.,\s]$/;
|
|
66113
|
+
if (e.key.match(allowedKeys)) {
|
|
66114
|
+
table.editorManager.startEditCell(stateManager.select.cellPos.col, stateManager.select.cellPos.row, '');
|
|
66115
|
+
}
|
|
66116
|
+
}
|
|
66117
|
+
}
|
|
66073
66118
|
handleKeydownListener(e);
|
|
66074
66119
|
});
|
|
66075
66120
|
function handleKeydownListener(e) {
|
|
@@ -66198,19 +66243,20 @@
|
|
|
66198
66243
|
e.preventDefault();
|
|
66199
66244
|
}
|
|
66200
66245
|
});
|
|
66201
|
-
|
|
66202
|
-
|
|
66203
|
-
|
|
66204
|
-
|
|
66205
|
-
|
|
66206
|
-
|
|
66207
|
-
|
|
66208
|
-
|
|
66209
|
-
|
|
66210
|
-
|
|
66211
|
-
|
|
66212
|
-
|
|
66213
|
-
|
|
66246
|
+
handler.on(table.getContainer(), 'resize', e => {
|
|
66247
|
+
if (e.width === 0 && e.height === 0) {
|
|
66248
|
+
return;
|
|
66249
|
+
}
|
|
66250
|
+
if (table.autoFillWidth || table.autoFillHeight) {
|
|
66251
|
+
table.editorManager?.completeEdit();
|
|
66252
|
+
}
|
|
66253
|
+
if (!isValid$1(table.options.pixelRatio)) {
|
|
66254
|
+
table.setPixelRatio(getPixelRatio());
|
|
66255
|
+
}
|
|
66256
|
+
if (!e.windowSizeNotChange) {
|
|
66257
|
+
table.resize();
|
|
66258
|
+
}
|
|
66259
|
+
});
|
|
66214
66260
|
const regex = /<tr[^>]*>([\s\S]*?)<\/tr>/g;
|
|
66215
66261
|
const cellRegex = /<td[^>]*>([\s\S]*?)<\/td>/g;
|
|
66216
66262
|
function pasteHtmlToTable(item) {
|
|
@@ -66358,10 +66404,10 @@
|
|
|
66358
66404
|
table.eventManager.isDown = false;
|
|
66359
66405
|
table.eventManager.isDraging = false;
|
|
66360
66406
|
table.eventManager.inertiaScroll.endInertia();
|
|
66361
|
-
if (stateManager.isResizeCol()) {
|
|
66407
|
+
if (stateManager.interactionState === 'grabing' && stateManager.isResizeCol()) {
|
|
66362
66408
|
endResizeCol(table);
|
|
66363
66409
|
}
|
|
66364
|
-
else if (stateManager.isResizeRow()) {
|
|
66410
|
+
else if (stateManager.interactionState === 'grabing' && stateManager.isResizeRow()) {
|
|
66365
66411
|
endResizeRow(table);
|
|
66366
66412
|
}
|
|
66367
66413
|
};
|
|
@@ -66772,7 +66818,7 @@
|
|
|
66772
66818
|
this.table = table;
|
|
66773
66819
|
this.handleTextStickBindId = [];
|
|
66774
66820
|
this.inertiaScroll = new InertiaScroll(table.stateManager);
|
|
66775
|
-
if (Env.mode === 'node'
|
|
66821
|
+
if (Env.mode === 'node') {
|
|
66776
66822
|
return;
|
|
66777
66823
|
}
|
|
66778
66824
|
this.bindOuterEvent();
|
|
@@ -66789,6 +66835,9 @@
|
|
|
66789
66835
|
}
|
|
66790
66836
|
updateEventBinder() {
|
|
66791
66837
|
setTimeout(() => {
|
|
66838
|
+
if (this.table.isReleased) {
|
|
66839
|
+
return;
|
|
66840
|
+
}
|
|
66792
66841
|
if (checkHaveTextStick(this.table) && this.handleTextStickBindId?.length === 0) {
|
|
66793
66842
|
this.handleTextStickBindId.push(this.table.on(TABLE_EVENT_TYPE.SCROLL, e => {
|
|
66794
66843
|
handleTextStick(this.table);
|
|
@@ -66850,7 +66899,7 @@
|
|
|
66850
66899
|
else if (this.table._canResizeColumn(resizeCol.col, resizeCol.row) && resizeCol.col >= 0) {
|
|
66851
66900
|
this.table.scenegraph.updateAutoColWidth(resizeCol.col);
|
|
66852
66901
|
this.table.internalProps._widthResizedColMap.add(resizeCol.col);
|
|
66853
|
-
this.table.scenegraph.
|
|
66902
|
+
this.table.scenegraph.updateChartSizeForResizeColWidth(resizeCol.col);
|
|
66854
66903
|
const state = this.table.stateManager;
|
|
66855
66904
|
if (state.columnResize.col < state.table.frozenColCount &&
|
|
66856
66905
|
!state.table.isPivotTable() &&
|
|
@@ -68370,7 +68419,6 @@
|
|
|
68370
68419
|
}
|
|
68371
68420
|
|
|
68372
68421
|
class FocusInput extends EventTarget {
|
|
68373
|
-
_container;
|
|
68374
68422
|
_table;
|
|
68375
68423
|
_input;
|
|
68376
68424
|
constructor(table, parentElement) {
|
|
@@ -68390,7 +68438,6 @@
|
|
|
68390
68438
|
input.dataset.vtable = 'vtable';
|
|
68391
68439
|
input.readOnly = true;
|
|
68392
68440
|
parentElement.appendChild(div);
|
|
68393
|
-
this._container = div;
|
|
68394
68441
|
}
|
|
68395
68442
|
focus() {
|
|
68396
68443
|
this._input.focus({ preventScroll: true });
|
|
@@ -68410,7 +68457,6 @@
|
|
|
68410
68457
|
return this._input;
|
|
68411
68458
|
}
|
|
68412
68459
|
release() {
|
|
68413
|
-
this._container.parentElement?.removeChild(this._container);
|
|
68414
68460
|
}
|
|
68415
68461
|
}
|
|
68416
68462
|
|
|
@@ -70554,12 +70600,13 @@
|
|
|
70554
70600
|
scenegraph;
|
|
70555
70601
|
stateManager;
|
|
70556
70602
|
eventManager;
|
|
70603
|
+
editorManager;
|
|
70557
70604
|
_pixelRatio;
|
|
70558
70605
|
static get EVENT_TYPE() {
|
|
70559
70606
|
return TABLE_EVENT_TYPE;
|
|
70560
70607
|
}
|
|
70561
70608
|
options;
|
|
70562
|
-
version = "1.5.4
|
|
70609
|
+
version = "1.5.4";
|
|
70563
70610
|
pagination;
|
|
70564
70611
|
id = `VTable${Date.now()}`;
|
|
70565
70612
|
headerStyleCache;
|
|
@@ -70574,7 +70621,7 @@
|
|
|
70574
70621
|
_hasAutoImageColumn;
|
|
70575
70622
|
constructor(container, options = {}) {
|
|
70576
70623
|
super();
|
|
70577
|
-
if (!container && options.mode !== 'node'
|
|
70624
|
+
if (!container && options.mode !== 'node') {
|
|
70578
70625
|
throw new Error("vtable's container is undefined");
|
|
70579
70626
|
}
|
|
70580
70627
|
const { frozenColCount = 0, frozenRowCount, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, autoFillHeight = false, widthAdaptiveMode = 'only-body', heightAdaptiveMode = 'only-body', keyboardOptions, eventOptions, rowSeriesNumber, columnResizeMode, rowResizeMode = 'none', dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio, renderChartAsync, renderChartAsyncBatchCount, mode, modeParams, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth, limitMinHeight, clearDOM = true } = options;
|
|
@@ -70612,14 +70659,7 @@
|
|
|
70612
70659
|
if (typeof allowFrozenColCount === 'number' && allowFrozenColCount <= 0) {
|
|
70613
70660
|
this.showFrozenIcon = false;
|
|
70614
70661
|
}
|
|
70615
|
-
if (
|
|
70616
|
-
internalProps.element = this.options.canvas.parentElement;
|
|
70617
|
-
internalProps.element.style.position = 'relative';
|
|
70618
|
-
internalProps.focusControl = new FocusInput(this, internalProps.element);
|
|
70619
|
-
internalProps.canvas = this.options.canvas;
|
|
70620
|
-
internalProps.context = internalProps.canvas.getContext('2d');
|
|
70621
|
-
}
|
|
70622
|
-
else if (Env.mode !== 'node') {
|
|
70662
|
+
if (Env.mode !== 'node') {
|
|
70623
70663
|
internalProps.element = createRootElement(this.padding);
|
|
70624
70664
|
internalProps.focusControl = new FocusInput(this, internalProps.element);
|
|
70625
70665
|
internalProps.canvas = document.createElement('canvas');
|
|
@@ -71027,21 +71067,7 @@
|
|
|
71027
71067
|
const { padding } = this;
|
|
71028
71068
|
let widthP = 0;
|
|
71029
71069
|
let heightP = 0;
|
|
71030
|
-
|
|
71031
|
-
this.tableY = 0;
|
|
71032
|
-
if (this.options.canvas && this.options.viewBox) {
|
|
71033
|
-
widthP = this.options.viewBox.x2 - this.options.viewBox.x1;
|
|
71034
|
-
heightP = this.options.viewBox.y2 - this.options.viewBox.y1;
|
|
71035
|
-
if (this?.scenegraph?.stage) {
|
|
71036
|
-
if (this.options.viewBox) {
|
|
71037
|
-
this.scenegraph.stage.setViewBox(this.options.viewBox, false);
|
|
71038
|
-
}
|
|
71039
|
-
else {
|
|
71040
|
-
this.scenegraph.stage.resize(widthP, heightP);
|
|
71041
|
-
}
|
|
71042
|
-
}
|
|
71043
|
-
}
|
|
71044
|
-
else if (Env.mode === 'browser') {
|
|
71070
|
+
if (Env.mode === 'browser') {
|
|
71045
71071
|
const element = this.getElement();
|
|
71046
71072
|
let widthWithoutPadding = 0;
|
|
71047
71073
|
let heightWithoutPadding = 0;
|
|
@@ -71108,23 +71134,6 @@
|
|
|
71108
71134
|
}
|
|
71109
71135
|
}
|
|
71110
71136
|
}
|
|
71111
|
-
updateViewBox(newViewBox) {
|
|
71112
|
-
const oldWidth = this.options?.viewBox.x2 ?? 0 - this.options?.viewBox.x1 ?? 0;
|
|
71113
|
-
const oldHeight = this.options?.viewBox.y2 ?? 0 - this.options?.viewBox.y1 ?? 0;
|
|
71114
|
-
const newWidth = newViewBox.x2 - newViewBox.x1;
|
|
71115
|
-
const newHeight = newViewBox.y2 - newViewBox.y1;
|
|
71116
|
-
this.options.viewBox = newViewBox;
|
|
71117
|
-
if (oldWidth !== newWidth || oldHeight !== newHeight) {
|
|
71118
|
-
this.resize();
|
|
71119
|
-
}
|
|
71120
|
-
else {
|
|
71121
|
-
this.scenegraph.stage.setViewBox(this.options.viewBox, true);
|
|
71122
|
-
}
|
|
71123
|
-
}
|
|
71124
|
-
setViewBoxTransform(a, b, c, d, e, f) {
|
|
71125
|
-
this.internalProps.modifiedViewBoxTransform = true;
|
|
71126
|
-
this.scenegraph.stage.window.setViewBoxTransform(a, b, c, d, e, f);
|
|
71127
|
-
}
|
|
71128
71137
|
get rowHierarchyType() {
|
|
71129
71138
|
return 'grid';
|
|
71130
71139
|
}
|
|
@@ -71221,6 +71230,7 @@
|
|
|
71221
71230
|
}
|
|
71222
71231
|
setRowHeight(row, height) {
|
|
71223
71232
|
this.scenegraph.setRowHeight(row, height);
|
|
71233
|
+
this.scenegraph.updateChartSizeForResizeRowHeight(row);
|
|
71224
71234
|
this.internalProps._heightResizedRowMap.add(row);
|
|
71225
71235
|
}
|
|
71226
71236
|
getRowsHeight(startRow, endRow) {
|
|
@@ -71318,6 +71328,7 @@
|
|
|
71318
71328
|
}
|
|
71319
71329
|
setColWidth(col, width) {
|
|
71320
71330
|
this.scenegraph.setColWidth(col, width);
|
|
71331
|
+
this.scenegraph.updateChartSizeForResizeColWidth(col);
|
|
71321
71332
|
this.internalProps._widthResizedColMap.add(col);
|
|
71322
71333
|
}
|
|
71323
71334
|
_clearColRangeWidthsMap(col) {
|
|
@@ -71649,8 +71660,6 @@
|
|
|
71649
71660
|
const visibleRect = this.getVisibleRect();
|
|
71650
71661
|
rect.offsetLeft(this.tableX - (relativeX ? visibleRect.left : 0));
|
|
71651
71662
|
rect.offsetTop(this.tableY - (relativeY ? visibleRect.top : 0));
|
|
71652
|
-
rect.offsetLeft(this.options.viewBox?.x1 ?? 0);
|
|
71653
|
-
rect.offsetTop(this.options.viewBox?.y1 ?? 0);
|
|
71654
71663
|
return rect;
|
|
71655
71664
|
}
|
|
71656
71665
|
getVisibleRect() {
|
|
@@ -71810,9 +71819,8 @@
|
|
|
71810
71819
|
}
|
|
71811
71820
|
this.scenegraph.stage.release();
|
|
71812
71821
|
this.scenegraph.proxy.release();
|
|
71813
|
-
internalProps.focusControl.release();
|
|
71814
71822
|
const { parentElement } = internalProps.element;
|
|
71815
|
-
if (parentElement
|
|
71823
|
+
if (parentElement) {
|
|
71816
71824
|
parentElement.removeChild(internalProps.element);
|
|
71817
71825
|
}
|
|
71818
71826
|
this.editorManager?.editingEditor?.onEnd?.();
|
|
@@ -71856,7 +71864,7 @@
|
|
|
71856
71864
|
this.autoFillHeight = autoFillHeight ?? false;
|
|
71857
71865
|
this.customRender = customRender;
|
|
71858
71866
|
const internalProps = this.internalProps;
|
|
71859
|
-
if (Env.mode !== 'node'
|
|
71867
|
+
if (Env.mode !== 'node') {
|
|
71860
71868
|
updateRootElementPadding(internalProps.element, this.padding);
|
|
71861
71869
|
}
|
|
71862
71870
|
this.columnWidthComputeMode = options.columnWidthComputeMode ?? 'normal';
|
|
@@ -72037,14 +72045,9 @@
|
|
|
72037
72045
|
const currentHeight = rect.height;
|
|
72038
72046
|
const originHeight = this.canvas.offsetHeight || currentHeight;
|
|
72039
72047
|
const heightRatio = currentHeight / originHeight;
|
|
72040
|
-
const x = (clientX - rect.left) / widthRatio + (isAddScroll ? table.scrollLeft : 0)
|
|
72041
|
-
const y = (clientY - rect.top) / heightRatio + (isAddScroll ? table.scrollTop : 0)
|
|
72042
|
-
|
|
72043
|
-
if (this.internalProps.modifiedViewBoxTransform && this.scenegraph.stage.window.getViewBoxTransform()) {
|
|
72044
|
-
const transform = this.scenegraph.stage.window.getViewBoxTransform();
|
|
72045
|
-
transform.transformPoint(point, point);
|
|
72046
|
-
}
|
|
72047
|
-
return point;
|
|
72048
|
+
const x = (clientX - rect.left) / widthRatio + (isAddScroll ? table.scrollLeft : 0);
|
|
72049
|
+
const y = (clientY - rect.top) / heightRatio + (isAddScroll ? table.scrollTop : 0);
|
|
72050
|
+
return { x, y, inTable };
|
|
72048
72051
|
}
|
|
72049
72052
|
getTheme() {
|
|
72050
72053
|
return this.internalProps.theme;
|
|
@@ -73272,6 +73275,9 @@
|
|
|
73272
73275
|
setMinMaxLimitWidth(setWidth = false) {
|
|
73273
73276
|
const internalProps = this.internalProps;
|
|
73274
73277
|
for (let col = 0; col < internalProps.layoutMap.columnWidths.length; col++) {
|
|
73278
|
+
if (this.internalProps._widthResizedColMap.has(col)) {
|
|
73279
|
+
continue;
|
|
73280
|
+
}
|
|
73275
73281
|
const { width, minWidth, maxWidth } = internalProps.layoutMap.columnWidths?.[col] ?? {};
|
|
73276
73282
|
if (setWidth &&
|
|
73277
73283
|
width &&
|
|
@@ -73289,9 +73295,9 @@
|
|
|
73289
73295
|
setSortedIndexMap(field, filedMap) {
|
|
73290
73296
|
this.dataSource?.setSortedIndexMap(field, filedMap);
|
|
73291
73297
|
}
|
|
73292
|
-
checkReactCustomLayout() {
|
|
73298
|
+
checkReactCustomLayout(removeAllContainer) {
|
|
73293
73299
|
if (!this.reactCustomLayout) {
|
|
73294
|
-
this.reactCustomLayout = new ReactCustomLayout(this);
|
|
73300
|
+
this.reactCustomLayout = new ReactCustomLayout(removeAllContainer, this);
|
|
73295
73301
|
}
|
|
73296
73302
|
}
|
|
73297
73303
|
get bodyDomContainer() {
|
|
@@ -75675,10 +75681,12 @@
|
|
|
75675
75681
|
this.bindEvent();
|
|
75676
75682
|
}
|
|
75677
75683
|
bindEvent() {
|
|
75678
|
-
|
|
75684
|
+
this.table.internalProps.handler;
|
|
75685
|
+
const editCellTrigger = this.table.options.editCellTrigger;
|
|
75679
75686
|
this.table.on(TABLE_EVENT_TYPE.DBLCLICK_CELL, e => {
|
|
75680
|
-
if (!
|
|
75681
|
-
|
|
75687
|
+
if (!editCellTrigger ||
|
|
75688
|
+
editCellTrigger === 'doubleclick' ||
|
|
75689
|
+
(Array.isArray(editCellTrigger) && editCellTrigger.includes('doubleclick'))) {
|
|
75682
75690
|
const { col, row } = e;
|
|
75683
75691
|
const eventArgsSet = getCellEventArgsSet(e.federatedEvent);
|
|
75684
75692
|
const resizeCol = this.table.scenegraph.getResizeColAt(eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, eventArgsSet.eventArgs?.targetCell);
|
|
@@ -75689,19 +75697,11 @@
|
|
|
75689
75697
|
}
|
|
75690
75698
|
});
|
|
75691
75699
|
this.table.on(TABLE_EVENT_TYPE.CLICK_CELL, e => {
|
|
75692
|
-
if (
|
|
75700
|
+
if (editCellTrigger === 'click' || (Array.isArray(editCellTrigger) && editCellTrigger.includes('click'))) {
|
|
75693
75701
|
const { col, row } = e;
|
|
75694
75702
|
this.startEditCell(col, row);
|
|
75695
75703
|
}
|
|
75696
75704
|
});
|
|
75697
|
-
handler.on(this.table.getElement(), 'wheel', (e) => {
|
|
75698
|
-
this.completeEdit();
|
|
75699
|
-
});
|
|
75700
|
-
handler.on(this.table.getElement(), 'resize', (e) => {
|
|
75701
|
-
if (this.table.autoFillWidth || this.table.autoFillHeight) {
|
|
75702
|
-
this.completeEdit();
|
|
75703
|
-
}
|
|
75704
|
-
});
|
|
75705
75705
|
}
|
|
75706
75706
|
startEditCell(col, row, value) {
|
|
75707
75707
|
const editor = this.table.getEditor(col, row);
|
|
@@ -75807,7 +75807,6 @@
|
|
|
75807
75807
|
|
|
75808
75808
|
class ListTable extends BaseTable {
|
|
75809
75809
|
showHeader = true;
|
|
75810
|
-
editorManager;
|
|
75811
75810
|
constructor(container, options) {
|
|
75812
75811
|
if (Env.mode === 'node') {
|
|
75813
75812
|
options = container;
|
|
@@ -76370,7 +76369,7 @@
|
|
|
76370
76369
|
notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight;
|
|
76371
76370
|
}
|
|
76372
76371
|
if (this.widthMode === 'adaptive' || notFillWidth || this.heightMode === 'adaptive' || notFillHeight) {
|
|
76373
|
-
this.scenegraph.
|
|
76372
|
+
this.scenegraph.updateChartSizeForResizeColWidth(0);
|
|
76374
76373
|
}
|
|
76375
76374
|
}
|
|
76376
76375
|
}
|
|
@@ -76565,7 +76564,7 @@
|
|
|
76565
76564
|
this.render();
|
|
76566
76565
|
if (isValid$1(oldHoverState.col) && isValid$1(oldHoverState.row) && oldHoverState.col >= 0 && oldHoverState.row >= 0) {
|
|
76567
76566
|
setTimeout(() => {
|
|
76568
|
-
this.internalProps
|
|
76567
|
+
this.internalProps?.tooltipHandler.showTooltip(oldHoverState.col, oldHoverState.row);
|
|
76569
76568
|
}, 0);
|
|
76570
76569
|
}
|
|
76571
76570
|
}
|
|
@@ -77687,9 +77686,7 @@
|
|
|
77687
77686
|
const axisStylrAttrs = getAxisAttributes(this.option);
|
|
77688
77687
|
const attrs = this.getUpdateAttribute();
|
|
77689
77688
|
attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;
|
|
77690
|
-
this.component = new LineAxis(merge({
|
|
77691
|
-
disableTriggerEvent: this.table.options.disableInteraction
|
|
77692
|
-
}, axisStylrAttrs, attrs));
|
|
77689
|
+
this.component = new LineAxis(merge({}, axisStylrAttrs, attrs));
|
|
77693
77690
|
this.component.setAttributes(this.setLayoutStartPosition({ x: 0, y: 0 }));
|
|
77694
77691
|
this.component.originAxis = this;
|
|
77695
77692
|
}
|
|
@@ -78270,11 +78267,20 @@
|
|
|
78270
78267
|
height: this.table.tableNoFrameHeight
|
|
78271
78268
|
});
|
|
78272
78269
|
const legend = new DiscreteLegend(merge({}, attrs, {
|
|
78273
|
-
defaultSelected: this.selectedData
|
|
78274
|
-
disableTriggerEvent: this.table.options.disableInteraction
|
|
78270
|
+
defaultSelected: this.selectedData
|
|
78275
78271
|
}));
|
|
78276
78272
|
legend.name = 'legend';
|
|
78277
78273
|
this.legendComponent = legend;
|
|
78274
|
+
if (this.visible === false) {
|
|
78275
|
+
legend.setAttributes({
|
|
78276
|
+
maxWidth: 0,
|
|
78277
|
+
width: 0,
|
|
78278
|
+
maxHeight: 0,
|
|
78279
|
+
height: 0,
|
|
78280
|
+
clip: true
|
|
78281
|
+
});
|
|
78282
|
+
legend.hideAll();
|
|
78283
|
+
}
|
|
78278
78284
|
this.table.scenegraph.stage.defaultLayer.appendChild(legend);
|
|
78279
78285
|
this.adjustTableSize(attrs);
|
|
78280
78286
|
}
|
|
@@ -79961,8 +79967,7 @@
|
|
|
79961
79967
|
data: table.getCellValue(col, row),
|
|
79962
79968
|
cellPadding: padding,
|
|
79963
79969
|
dpr: table.internalProps.pixelRatio,
|
|
79964
|
-
axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : []
|
|
79965
|
-
tableChartOption: table.options.chartOption
|
|
79970
|
+
axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : []
|
|
79966
79971
|
});
|
|
79967
79972
|
cellGroup.appendChild(chartGroup);
|
|
79968
79973
|
table.internalProps.layoutMap.setChartInstance(col, row, chartGroup.chartInstance);
|
|
@@ -83395,6 +83400,9 @@
|
|
|
83395
83400
|
if (this.isSeriesNumberInHeader(target.col, target.row) || this.isSeriesNumberInHeader(source.col, source.row)) {
|
|
83396
83401
|
return false;
|
|
83397
83402
|
}
|
|
83403
|
+
if (this.isCornerHeader(target.col, target.row)) {
|
|
83404
|
+
return false;
|
|
83405
|
+
}
|
|
83398
83406
|
if (source.col < 0 || source.row < 0 || target.col < 0 || target.row < 0) {
|
|
83399
83407
|
return false;
|
|
83400
83408
|
}
|
|
@@ -86043,7 +86051,6 @@
|
|
|
86043
86051
|
class PivotTable extends BaseTable {
|
|
86044
86052
|
layoutNodeId = { seqId: 0 };
|
|
86045
86053
|
pivotSortState;
|
|
86046
|
-
editorManager;
|
|
86047
86054
|
dataset;
|
|
86048
86055
|
flatDataToObjects;
|
|
86049
86056
|
constructor(container, options) {
|
|
@@ -87010,7 +87017,7 @@
|
|
|
87010
87017
|
notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight;
|
|
87011
87018
|
}
|
|
87012
87019
|
if (this.widthMode === 'adaptive' || notFillWidth || this.heightMode === 'adaptive' || notFillHeight) {
|
|
87013
|
-
this.scenegraph.
|
|
87020
|
+
this.scenegraph.updateChartSizeForResizeColWidth(0);
|
|
87014
87021
|
}
|
|
87015
87022
|
}
|
|
87016
87023
|
}
|
|
@@ -88309,14 +88316,6 @@
|
|
|
88309
88316
|
updateChartData(this.scenegraph);
|
|
88310
88317
|
this.render();
|
|
88311
88318
|
}
|
|
88312
|
-
clearChartCacheImage(col, row) {
|
|
88313
|
-
if (isNumber$2(col) && isNumber$2(row)) {
|
|
88314
|
-
clearCellChartCacheImage(col, row, this.scenegraph);
|
|
88315
|
-
}
|
|
88316
|
-
else {
|
|
88317
|
-
clearChartCacheImage(this.scenegraph);
|
|
88318
|
-
}
|
|
88319
|
-
}
|
|
88320
88319
|
getLegendSelected() {
|
|
88321
88320
|
const selected = [];
|
|
88322
88321
|
this.internalProps.legends?.forEach(legend => {
|
|
@@ -89110,7 +89109,7 @@
|
|
|
89110
89109
|
}
|
|
89111
89110
|
|
|
89112
89111
|
registerForVrender();
|
|
89113
|
-
const version = "1.5.4
|
|
89112
|
+
const version = "1.5.4";
|
|
89114
89113
|
function getIcons() {
|
|
89115
89114
|
return get$2();
|
|
89116
89115
|
}
|