@visactor/vtable 1.5.4-beta.1 → 1.5.5-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/ListTable.d.ts +0 -2
- package/cjs/ListTable.js +1 -1
- 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 +2 -3
- 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/stick-text/index.js +5 -6
- package/cjs/scenegraph/stick-text/index.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/column/style.d.ts +2 -2
- package/cjs/ts-types/column/style.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 +330 -332
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.d.ts +0 -2
- package/es/ListTable.js +1 -1
- 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 +2 -3
- 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/stick-text/index.js +5 -6
- package/es/scenegraph/stick-text/index.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/column/style.d.ts +2 -2
- package/es/ts-types/column/style.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 +5 -5
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) {
|
|
@@ -57792,7 +57787,7 @@
|
|
|
57792
57787
|
}
|
|
57793
57788
|
[colStart, colEnd].forEach((col) => {
|
|
57794
57789
|
const style = table._getCellStyle(col, row);
|
|
57795
|
-
if (style?.textStick) {
|
|
57790
|
+
if (style?.textStick && style?.textStick !== 'vertical') {
|
|
57796
57791
|
const cellGroup = table.scenegraph.getCell(col, row);
|
|
57797
57792
|
adjustCellContentHorizontalLayout(cellGroup, frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, style?.textStickBaseOnAlign, table);
|
|
57798
57793
|
}
|
|
@@ -57804,7 +57799,9 @@
|
|
|
57804
57799
|
}
|
|
57805
57800
|
[rowStart, rowEnd].forEach((row) => {
|
|
57806
57801
|
const style = table._getCellStyle(col, row);
|
|
57807
|
-
if (style?.textStick &&
|
|
57802
|
+
if (style?.textStick &&
|
|
57803
|
+
table.internalProps.layoutMap.rowHierarchyType !== 'tree' &&
|
|
57804
|
+
style?.textStick !== 'horizontal') {
|
|
57808
57805
|
const cellGroup = table.scenegraph.getCell(col, row);
|
|
57809
57806
|
adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, style?.textStickBaseOnAlign, table);
|
|
57810
57807
|
}
|
|
@@ -57816,19 +57813,19 @@
|
|
|
57816
57813
|
}
|
|
57817
57814
|
[rowStart, rowEnd].forEach((row) => {
|
|
57818
57815
|
const style = table._getCellStyle(col, row);
|
|
57819
|
-
if (style?.textStick) {
|
|
57816
|
+
if (style?.textStick && style?.textStick !== 'horizontal') {
|
|
57820
57817
|
const cellGroup = table.scenegraph.getCell(col, row);
|
|
57821
57818
|
adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, style?.textStickBaseOnAlign, table);
|
|
57822
57819
|
}
|
|
57823
57820
|
});
|
|
57824
57821
|
}
|
|
57825
|
-
for (let row = rowStart; row
|
|
57822
|
+
for (let row = rowStart; row <= rowEnd; row++) {
|
|
57826
57823
|
if (colEnd < colStart) {
|
|
57827
57824
|
break;
|
|
57828
57825
|
}
|
|
57829
57826
|
[colStart, colEnd].forEach((col) => {
|
|
57830
57827
|
const style = table._getCellStyle(col, row);
|
|
57831
|
-
if (
|
|
57828
|
+
if (style?.textStick && style?.textStick !== 'vertical') {
|
|
57832
57829
|
const cellGroup = table.scenegraph.getCell(col, row);
|
|
57833
57830
|
adjustCellContentHorizontalLayout(cellGroup, frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, style?.textStickBaseOnAlign, table);
|
|
57834
57831
|
}
|
|
@@ -59094,7 +59091,9 @@
|
|
|
59094
59091
|
const bodyClickLineWidth = theme.selectionStyle?.cellBorderLineWidth;
|
|
59095
59092
|
const rect = createRect({
|
|
59096
59093
|
pickable: false,
|
|
59097
|
-
fill: theme.selectionStyle?.
|
|
59094
|
+
fill: theme.selectionStyle?.selectionFillMode === 'replace'
|
|
59095
|
+
? false
|
|
59096
|
+
: theme.selectionStyle?.cellBgColor ?? 'rgba(0, 0, 255,0.1)',
|
|
59098
59097
|
lineWidth: bodyClickLineWidth,
|
|
59099
59098
|
stroke: strokes.map(stroke => {
|
|
59100
59099
|
if (stroke) {
|
|
@@ -59969,7 +59968,7 @@
|
|
|
59969
59968
|
}
|
|
59970
59969
|
}
|
|
59971
59970
|
|
|
59972
|
-
function
|
|
59971
|
+
function updateChartSizeForResizeColWidth(scenegraph, col) {
|
|
59973
59972
|
for (let c = col; c <= scenegraph.proxy.colEnd; c++) {
|
|
59974
59973
|
const columnGroup = scenegraph.getColGroup(c);
|
|
59975
59974
|
columnGroup?.getChildren()?.forEach((cellNode) => {
|
|
@@ -60001,6 +60000,39 @@
|
|
|
60001
60000
|
}
|
|
60002
60001
|
}
|
|
60003
60002
|
}
|
|
60003
|
+
function updateChartSizeForResizeRowHeight(scenegraph, row) {
|
|
60004
|
+
const updateCellNode = (c, r) => {
|
|
60005
|
+
const cellNode = scenegraph.getCell(c, r);
|
|
60006
|
+
const width = scenegraph.table.getColWidth(cellNode.col);
|
|
60007
|
+
const height = scenegraph.table.getRowHeight(cellNode.row);
|
|
60008
|
+
cellNode.children.forEach((node) => {
|
|
60009
|
+
if (node.type === 'chart') {
|
|
60010
|
+
node.cacheCanvas = null;
|
|
60011
|
+
node.setAttribute('width', Math.ceil(width - node.attribute.cellPadding[3] - node.attribute.cellPadding[1]));
|
|
60012
|
+
node.setAttribute('height', Math.ceil(height - node.attribute.cellPadding[0] - node.attribute.cellPadding[2]));
|
|
60013
|
+
}
|
|
60014
|
+
});
|
|
60015
|
+
};
|
|
60016
|
+
for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {
|
|
60017
|
+
for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {
|
|
60018
|
+
updateCellNode(c, r);
|
|
60019
|
+
}
|
|
60020
|
+
}
|
|
60021
|
+
if (scenegraph.table.rightFrozenColCount >= 1) {
|
|
60022
|
+
for (let c = scenegraph.table.colCount - scenegraph.table.rightFrozenColCount; c <= scenegraph.table.colCount - 1; c++) {
|
|
60023
|
+
for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {
|
|
60024
|
+
updateCellNode(c, r);
|
|
60025
|
+
}
|
|
60026
|
+
}
|
|
60027
|
+
}
|
|
60028
|
+
if (scenegraph.table.frozenColCount >= 1) {
|
|
60029
|
+
for (let c = 0; c <= scenegraph.table.frozenColCount - 1; c++) {
|
|
60030
|
+
for (let r = row; r <= scenegraph.proxy.rowEnd; r++) {
|
|
60031
|
+
updateCellNode(c, r);
|
|
60032
|
+
}
|
|
60033
|
+
}
|
|
60034
|
+
}
|
|
60035
|
+
}
|
|
60004
60036
|
function clearChartCacheImage(scenegraph) {
|
|
60005
60037
|
for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {
|
|
60006
60038
|
const columnGroup = scenegraph.getColGroup(c);
|
|
@@ -60014,15 +60046,6 @@
|
|
|
60014
60046
|
});
|
|
60015
60047
|
}
|
|
60016
60048
|
}
|
|
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
60049
|
function updateChartData(scenegraph) {
|
|
60027
60050
|
const table = scenegraph.table;
|
|
60028
60051
|
for (let c = scenegraph.proxy.colStart; c <= scenegraph.proxy.colEnd; c++) {
|
|
@@ -60884,12 +60907,7 @@
|
|
|
60884
60907
|
setPoptipTheme(this.table.theme.textPopTipStyle);
|
|
60885
60908
|
let width;
|
|
60886
60909
|
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') {
|
|
60910
|
+
if (Env.mode === 'node') {
|
|
60893
60911
|
vglobal.setEnv('node', table.options.modeParams);
|
|
60894
60912
|
width = table.canvasWidth;
|
|
60895
60913
|
height = table.canvasHeight;
|
|
@@ -60907,15 +60925,9 @@
|
|
|
60907
60925
|
background: table.theme.underlayBackgroundColor,
|
|
60908
60926
|
dpr: table.internalProps.pixelRatio,
|
|
60909
60927
|
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);
|
|
60928
|
+
afterRender: () => {
|
|
60915
60929
|
this.table.fireListeners('after_render', null);
|
|
60916
60930
|
},
|
|
60917
|
-
canvasControled: !table.options.canvas,
|
|
60918
|
-
viewBox: table.options.viewBox,
|
|
60919
60931
|
...table.options.renderOption
|
|
60920
60932
|
});
|
|
60921
60933
|
this.stage.defaultLayer.setTheme({
|
|
@@ -61047,6 +61059,7 @@
|
|
|
61047
61059
|
delete this.tableGroup.border;
|
|
61048
61060
|
}
|
|
61049
61061
|
this.proxy?.release();
|
|
61062
|
+
this.table.reactCustomLayout?.clearCache();
|
|
61050
61063
|
}
|
|
61051
61064
|
updateStageBackground() {
|
|
61052
61065
|
this.stage.background = this.table.theme.underlayBackgroundColor;
|
|
@@ -61064,6 +61077,7 @@
|
|
|
61064
61077
|
createSceneGraph(skipRowHeightClear = false) {
|
|
61065
61078
|
if (!skipRowHeightClear) {
|
|
61066
61079
|
this.table.rowHeightsMap.clear();
|
|
61080
|
+
this.table.internalProps.layoutMap.clearCellRangeMap();
|
|
61067
61081
|
}
|
|
61068
61082
|
if (this.table.isPivotChart() || this.table._hasCustomRenderOrLayout()) {
|
|
61069
61083
|
this.stage.pluginService.autoEnablePlugins.getContributions().forEach((p) => {
|
|
@@ -61286,8 +61300,11 @@
|
|
|
61286
61300
|
this.updateContainer(true);
|
|
61287
61301
|
}
|
|
61288
61302
|
}
|
|
61289
|
-
|
|
61290
|
-
|
|
61303
|
+
updateChartSizeForResizeColWidth(col) {
|
|
61304
|
+
updateChartSizeForResizeColWidth(this, col);
|
|
61305
|
+
}
|
|
61306
|
+
updateChartSizeForResizeRowHeight(col) {
|
|
61307
|
+
updateChartSizeForResizeRowHeight(this, col);
|
|
61291
61308
|
}
|
|
61292
61309
|
updateChartState(datum) {
|
|
61293
61310
|
this.table.isPivotChart() && updateChartState(this, datum);
|
|
@@ -61423,7 +61440,7 @@
|
|
|
61423
61440
|
this.table.heightMode === 'adaptive' ||
|
|
61424
61441
|
this.table.autoFillWidth ||
|
|
61425
61442
|
this.table.autoFillHeight) {
|
|
61426
|
-
this.
|
|
61443
|
+
this.updateChartSizeForResizeColWidth(this.table.rowHeaderLevelCount);
|
|
61427
61444
|
}
|
|
61428
61445
|
this.proxy.progress();
|
|
61429
61446
|
this.updateNextFrame();
|
|
@@ -62929,63 +62946,66 @@
|
|
|
62929
62946
|
return;
|
|
62930
62947
|
}
|
|
62931
62948
|
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 });
|
|
62949
|
+
const canMove = state.table.internalProps.layoutMap.canMoveHeaderPosition({ col: state.columnMove.colSource, row: state.columnMove.rowSource }, { col: targetCell.col, row: targetCell.row });
|
|
62937
62950
|
if (!canMove) {
|
|
62938
62951
|
state.updateCursor('not-allowed');
|
|
62952
|
+
state.columnMove.colTarget = state.columnMove.colSource;
|
|
62953
|
+
state.columnMove.rowTarget = state.columnMove.rowSource;
|
|
62939
62954
|
}
|
|
62940
62955
|
else {
|
|
62956
|
+
state.columnMove.x = x - state.table.tableX;
|
|
62957
|
+
state.columnMove.y = y - state.table.tableY;
|
|
62958
|
+
state.columnMove.colTarget = targetCell.col;
|
|
62959
|
+
state.columnMove.rowTarget = targetCell.row;
|
|
62941
62960
|
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);
|
|
62961
|
+
let lineX;
|
|
62962
|
+
let backX;
|
|
62963
|
+
let lineY;
|
|
62964
|
+
let backY;
|
|
62965
|
+
const cellLocation = state.table.getCellLocation(state.columnMove.colSource, state.columnMove.rowSource);
|
|
62966
|
+
if (cellLocation === 'columnHeader') {
|
|
62967
|
+
backX = state.columnMove.x;
|
|
62968
|
+
if (state.table.isLeftFrozenColumn(col)) {
|
|
62969
|
+
lineX =
|
|
62970
|
+
state.columnMove.colTarget >= state.columnMove.colSource
|
|
62971
|
+
? state.table.getColsWidth(0, state.columnMove.colTarget)
|
|
62972
|
+
: state.table.getColsWidth(0, state.columnMove.colTarget - 1);
|
|
62973
|
+
}
|
|
62974
|
+
else if (state.table.isRightFrozenColumn(col)) {
|
|
62975
|
+
lineX = state.table.tableNoFrameWidth - state.table.getColsWidth(targetCell.col + 1, state.table.colCount - 1);
|
|
62976
|
+
}
|
|
62977
|
+
else {
|
|
62978
|
+
lineX =
|
|
62979
|
+
(state.columnMove.colTarget >= state.columnMove.colSource
|
|
62980
|
+
? state.table.getColsWidth(0, state.columnMove.colTarget)
|
|
62981
|
+
: state.table.getColsWidth(0, state.columnMove.colTarget - 1)) -
|
|
62982
|
+
state.table.stateManager.scroll.horizontalBarPos;
|
|
62983
|
+
}
|
|
62978
62984
|
}
|
|
62979
|
-
else
|
|
62980
|
-
|
|
62981
|
-
|
|
62982
|
-
|
|
62983
|
-
|
|
62984
|
-
state.
|
|
62985
|
+
else if (cellLocation === 'rowHeader' ||
|
|
62986
|
+
state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row)) {
|
|
62987
|
+
backY = state.columnMove.y;
|
|
62988
|
+
if (state.table.isFrozenRow(row)) {
|
|
62989
|
+
lineY =
|
|
62990
|
+
state.columnMove.rowTarget >= state.columnMove.rowSource
|
|
62991
|
+
? state.table.getRowsHeight(0, state.columnMove.rowTarget)
|
|
62992
|
+
: state.table.getRowsHeight(0, state.columnMove.rowTarget - 1);
|
|
62993
|
+
}
|
|
62994
|
+
else if (state.table.isBottomFrozenRow(row)) {
|
|
62995
|
+
lineY =
|
|
62996
|
+
state.table.tableNoFrameHeight - state.table.getRowsHeight(targetCell.row + 1, state.table.rowCount - 1);
|
|
62997
|
+
}
|
|
62998
|
+
else {
|
|
62999
|
+
lineY =
|
|
63000
|
+
(state.columnMove.rowTarget >= state.columnMove.rowSource
|
|
63001
|
+
? state.table.getRowsHeight(0, state.columnMove.rowTarget)
|
|
63002
|
+
: state.table.getRowsHeight(0, state.columnMove.rowTarget - 1)) -
|
|
63003
|
+
state.table.stateManager.scroll.verticalBarPos;
|
|
63004
|
+
}
|
|
62985
63005
|
}
|
|
63006
|
+
state.table.scenegraph.component.updateMoveCol(backX, lineX, backY, lineY);
|
|
63007
|
+
state.table.scenegraph.updateNextFrame();
|
|
62986
63008
|
}
|
|
62987
|
-
state.table.scenegraph.component.updateMoveCol(backX, lineX, backY, lineY);
|
|
62988
|
-
state.table.scenegraph.updateNextFrame();
|
|
62989
63009
|
}
|
|
62990
63010
|
function endMoveCol(state) {
|
|
62991
63011
|
if ('canMoveHeaderPosition' in state.table.internalProps.layoutMap &&
|
|
@@ -64152,7 +64172,7 @@
|
|
|
64152
64172
|
setTimeout(() => {
|
|
64153
64173
|
this.columnResize.resizing = false;
|
|
64154
64174
|
}, 0);
|
|
64155
|
-
this.table.scenegraph.
|
|
64175
|
+
this.table.scenegraph.updateChartSizeForResizeColWidth(this.columnResize.col);
|
|
64156
64176
|
this.checkFrozen();
|
|
64157
64177
|
this.table.scenegraph.component.hideResizeCol();
|
|
64158
64178
|
this.table.scenegraph.updateNextFrame();
|
|
@@ -64175,7 +64195,7 @@
|
|
|
64175
64195
|
setTimeout(() => {
|
|
64176
64196
|
this.rowResize.resizing = false;
|
|
64177
64197
|
}, 0);
|
|
64178
|
-
this.table.scenegraph.
|
|
64198
|
+
this.table.scenegraph.updateChartSizeForResizeColWidth(this.rowResize.row);
|
|
64179
64199
|
this.table.scenegraph.component.hideResizeRow();
|
|
64180
64200
|
this.table.scenegraph.updateNextFrame();
|
|
64181
64201
|
}
|
|
@@ -64420,7 +64440,7 @@
|
|
|
64420
64440
|
if (autoHide) {
|
|
64421
64441
|
clearTimeout(this._clearVerticalScrollBar);
|
|
64422
64442
|
this._clearVerticalScrollBar = setTimeout(() => {
|
|
64423
|
-
this.table.scenegraph
|
|
64443
|
+
this.table.scenegraph?.component.hideVerticalScrollBar();
|
|
64424
64444
|
}, 1000);
|
|
64425
64445
|
}
|
|
64426
64446
|
}
|
|
@@ -64432,7 +64452,7 @@
|
|
|
64432
64452
|
if (autoHide) {
|
|
64433
64453
|
clearTimeout(this._clearHorizontalScrollBar);
|
|
64434
64454
|
this._clearHorizontalScrollBar = setTimeout(() => {
|
|
64435
|
-
this.table.scenegraph
|
|
64455
|
+
this.table.scenegraph?.component.hideHorizontalScrollBar();
|
|
64436
64456
|
}, 1000);
|
|
64437
64457
|
}
|
|
64438
64458
|
}
|
|
@@ -65924,6 +65944,7 @@
|
|
|
65924
65944
|
eventManager.dealTableHover();
|
|
65925
65945
|
});
|
|
65926
65946
|
handler.on(table.getElement(), 'wheel', (e) => {
|
|
65947
|
+
table.editorManager?.completeEdit();
|
|
65927
65948
|
if (table.eventManager._enableTableScroll) {
|
|
65928
65949
|
handleWhell(e, stateManager);
|
|
65929
65950
|
}
|
|
@@ -66016,16 +66037,32 @@
|
|
|
66016
66037
|
}
|
|
66017
66038
|
}
|
|
66018
66039
|
else if (e.key === 'Escape') {
|
|
66019
|
-
table.editorManager
|
|
66040
|
+
table.editorManager?.cancelEdit();
|
|
66020
66041
|
}
|
|
66021
66042
|
else if (e.key === 'Enter') {
|
|
66022
66043
|
if (table.editorManager?.editingEditor) {
|
|
66023
66044
|
handleKeydownListener(e);
|
|
66024
66045
|
table.editorManager.completeEdit();
|
|
66025
66046
|
table.getElement().focus();
|
|
66047
|
+
if (table.options.keyboardOptions?.moveFocusCellOnEnter === true) {
|
|
66048
|
+
const targetCol = stateManager.select.cellPos.col;
|
|
66049
|
+
const targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
|
|
66050
|
+
if (isCellDisableSelect(table, targetCol, targetRow)) {
|
|
66051
|
+
return;
|
|
66052
|
+
}
|
|
66053
|
+
table.selectCell(targetCol, targetRow, e.shiftKey);
|
|
66054
|
+
}
|
|
66026
66055
|
return;
|
|
66027
66056
|
}
|
|
66028
|
-
if (
|
|
66057
|
+
if (table.options.keyboardOptions?.moveFocusCellOnEnter === true) {
|
|
66058
|
+
const targetCol = stateManager.select.cellPos.col;
|
|
66059
|
+
const targetRow = Math.min(table.rowCount - 1, Math.max(0, stateManager.select.cellPos.row + 1));
|
|
66060
|
+
if (isCellDisableSelect(table, targetCol, targetRow)) {
|
|
66061
|
+
return;
|
|
66062
|
+
}
|
|
66063
|
+
table.selectCell(targetCol, targetRow, e.shiftKey);
|
|
66064
|
+
}
|
|
66065
|
+
else if ((table.options.keyboardOptions?.editCellOnEnter ?? true) &&
|
|
66029
66066
|
(table.stateManager.select.ranges?.length ?? 0) === 1) {
|
|
66030
66067
|
const startCol = table.stateManager.select.ranges[0].start.col;
|
|
66031
66068
|
const startRow = table.stateManager.select.ranges[0].start.row;
|
|
@@ -66070,6 +66107,16 @@
|
|
|
66070
66107
|
}
|
|
66071
66108
|
}
|
|
66072
66109
|
}
|
|
66110
|
+
else {
|
|
66111
|
+
const editCellTrigger = table.options.editCellTrigger;
|
|
66112
|
+
if ((editCellTrigger === 'keydown' || (Array.isArray(editCellTrigger) && editCellTrigger.includes('keydown'))) &&
|
|
66113
|
+
!table.editorManager?.editingEditor) {
|
|
66114
|
+
const allowedKeys = /^[a-zA-Z0-9+\-*\/%=.,\s]$/;
|
|
66115
|
+
if (e.key.match(allowedKeys)) {
|
|
66116
|
+
table.editorManager.startEditCell(stateManager.select.cellPos.col, stateManager.select.cellPos.row, '');
|
|
66117
|
+
}
|
|
66118
|
+
}
|
|
66119
|
+
}
|
|
66073
66120
|
handleKeydownListener(e);
|
|
66074
66121
|
});
|
|
66075
66122
|
function handleKeydownListener(e) {
|
|
@@ -66198,19 +66245,20 @@
|
|
|
66198
66245
|
e.preventDefault();
|
|
66199
66246
|
}
|
|
66200
66247
|
});
|
|
66201
|
-
|
|
66202
|
-
|
|
66203
|
-
|
|
66204
|
-
|
|
66205
|
-
|
|
66206
|
-
|
|
66207
|
-
|
|
66208
|
-
|
|
66209
|
-
|
|
66210
|
-
|
|
66211
|
-
|
|
66212
|
-
|
|
66213
|
-
|
|
66248
|
+
handler.on(table.getContainer(), 'resize', e => {
|
|
66249
|
+
if (e.width === 0 && e.height === 0) {
|
|
66250
|
+
return;
|
|
66251
|
+
}
|
|
66252
|
+
if (table.autoFillWidth || table.autoFillHeight) {
|
|
66253
|
+
table.editorManager?.completeEdit();
|
|
66254
|
+
}
|
|
66255
|
+
if (!isValid$1(table.options.pixelRatio)) {
|
|
66256
|
+
table.setPixelRatio(getPixelRatio());
|
|
66257
|
+
}
|
|
66258
|
+
if (!e.windowSizeNotChange) {
|
|
66259
|
+
table.resize();
|
|
66260
|
+
}
|
|
66261
|
+
});
|
|
66214
66262
|
const regex = /<tr[^>]*>([\s\S]*?)<\/tr>/g;
|
|
66215
66263
|
const cellRegex = /<td[^>]*>([\s\S]*?)<\/td>/g;
|
|
66216
66264
|
function pasteHtmlToTable(item) {
|
|
@@ -66358,10 +66406,10 @@
|
|
|
66358
66406
|
table.eventManager.isDown = false;
|
|
66359
66407
|
table.eventManager.isDraging = false;
|
|
66360
66408
|
table.eventManager.inertiaScroll.endInertia();
|
|
66361
|
-
if (stateManager.isResizeCol()) {
|
|
66409
|
+
if (stateManager.interactionState === 'grabing' && stateManager.isResizeCol()) {
|
|
66362
66410
|
endResizeCol(table);
|
|
66363
66411
|
}
|
|
66364
|
-
else if (stateManager.isResizeRow()) {
|
|
66412
|
+
else if (stateManager.interactionState === 'grabing' && stateManager.isResizeRow()) {
|
|
66365
66413
|
endResizeRow(table);
|
|
66366
66414
|
}
|
|
66367
66415
|
};
|
|
@@ -66772,7 +66820,7 @@
|
|
|
66772
66820
|
this.table = table;
|
|
66773
66821
|
this.handleTextStickBindId = [];
|
|
66774
66822
|
this.inertiaScroll = new InertiaScroll(table.stateManager);
|
|
66775
|
-
if (Env.mode === 'node'
|
|
66823
|
+
if (Env.mode === 'node') {
|
|
66776
66824
|
return;
|
|
66777
66825
|
}
|
|
66778
66826
|
this.bindOuterEvent();
|
|
@@ -66853,7 +66901,7 @@
|
|
|
66853
66901
|
else if (this.table._canResizeColumn(resizeCol.col, resizeCol.row) && resizeCol.col >= 0) {
|
|
66854
66902
|
this.table.scenegraph.updateAutoColWidth(resizeCol.col);
|
|
66855
66903
|
this.table.internalProps._widthResizedColMap.add(resizeCol.col);
|
|
66856
|
-
this.table.scenegraph.
|
|
66904
|
+
this.table.scenegraph.updateChartSizeForResizeColWidth(resizeCol.col);
|
|
66857
66905
|
const state = this.table.stateManager;
|
|
66858
66906
|
if (state.columnResize.col < state.table.frozenColCount &&
|
|
66859
66907
|
!state.table.isPivotTable() &&
|
|
@@ -68373,7 +68421,6 @@
|
|
|
68373
68421
|
}
|
|
68374
68422
|
|
|
68375
68423
|
class FocusInput extends EventTarget {
|
|
68376
|
-
_container;
|
|
68377
68424
|
_table;
|
|
68378
68425
|
_input;
|
|
68379
68426
|
constructor(table, parentElement) {
|
|
@@ -68393,7 +68440,6 @@
|
|
|
68393
68440
|
input.dataset.vtable = 'vtable';
|
|
68394
68441
|
input.readOnly = true;
|
|
68395
68442
|
parentElement.appendChild(div);
|
|
68396
|
-
this._container = div;
|
|
68397
68443
|
}
|
|
68398
68444
|
focus() {
|
|
68399
68445
|
this._input.focus({ preventScroll: true });
|
|
@@ -68413,7 +68459,6 @@
|
|
|
68413
68459
|
return this._input;
|
|
68414
68460
|
}
|
|
68415
68461
|
release() {
|
|
68416
|
-
this._container.parentElement?.removeChild(this._container);
|
|
68417
68462
|
}
|
|
68418
68463
|
}
|
|
68419
68464
|
|
|
@@ -70557,12 +70602,13 @@
|
|
|
70557
70602
|
scenegraph;
|
|
70558
70603
|
stateManager;
|
|
70559
70604
|
eventManager;
|
|
70605
|
+
editorManager;
|
|
70560
70606
|
_pixelRatio;
|
|
70561
70607
|
static get EVENT_TYPE() {
|
|
70562
70608
|
return TABLE_EVENT_TYPE;
|
|
70563
70609
|
}
|
|
70564
70610
|
options;
|
|
70565
|
-
version = "1.5.
|
|
70611
|
+
version = "1.5.5-alpha.0";
|
|
70566
70612
|
pagination;
|
|
70567
70613
|
id = `VTable${Date.now()}`;
|
|
70568
70614
|
headerStyleCache;
|
|
@@ -70577,7 +70623,7 @@
|
|
|
70577
70623
|
_hasAutoImageColumn;
|
|
70578
70624
|
constructor(container, options = {}) {
|
|
70579
70625
|
super();
|
|
70580
|
-
if (!container && options.mode !== 'node'
|
|
70626
|
+
if (!container && options.mode !== 'node') {
|
|
70581
70627
|
throw new Error("vtable's container is undefined");
|
|
70582
70628
|
}
|
|
70583
70629
|
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;
|
|
@@ -70615,14 +70661,7 @@
|
|
|
70615
70661
|
if (typeof allowFrozenColCount === 'number' && allowFrozenColCount <= 0) {
|
|
70616
70662
|
this.showFrozenIcon = false;
|
|
70617
70663
|
}
|
|
70618
|
-
if (
|
|
70619
|
-
internalProps.element = this.options.canvas.parentElement;
|
|
70620
|
-
internalProps.element.style.position = 'relative';
|
|
70621
|
-
internalProps.focusControl = new FocusInput(this, internalProps.element);
|
|
70622
|
-
internalProps.canvas = this.options.canvas;
|
|
70623
|
-
internalProps.context = internalProps.canvas.getContext('2d');
|
|
70624
|
-
}
|
|
70625
|
-
else if (Env.mode !== 'node') {
|
|
70664
|
+
if (Env.mode !== 'node') {
|
|
70626
70665
|
internalProps.element = createRootElement(this.padding);
|
|
70627
70666
|
internalProps.focusControl = new FocusInput(this, internalProps.element);
|
|
70628
70667
|
internalProps.canvas = document.createElement('canvas');
|
|
@@ -71030,21 +71069,7 @@
|
|
|
71030
71069
|
const { padding } = this;
|
|
71031
71070
|
let widthP = 0;
|
|
71032
71071
|
let heightP = 0;
|
|
71033
|
-
|
|
71034
|
-
this.tableY = 0;
|
|
71035
|
-
if (this.options.canvas && this.options.viewBox) {
|
|
71036
|
-
widthP = this.options.viewBox.x2 - this.options.viewBox.x1;
|
|
71037
|
-
heightP = this.options.viewBox.y2 - this.options.viewBox.y1;
|
|
71038
|
-
if (this?.scenegraph?.stage) {
|
|
71039
|
-
if (this.options.viewBox) {
|
|
71040
|
-
this.scenegraph.stage.setViewBox(this.options.viewBox, false);
|
|
71041
|
-
}
|
|
71042
|
-
else {
|
|
71043
|
-
this.scenegraph.stage.resize(widthP, heightP);
|
|
71044
|
-
}
|
|
71045
|
-
}
|
|
71046
|
-
}
|
|
71047
|
-
else if (Env.mode === 'browser') {
|
|
71072
|
+
if (Env.mode === 'browser') {
|
|
71048
71073
|
const element = this.getElement();
|
|
71049
71074
|
let widthWithoutPadding = 0;
|
|
71050
71075
|
let heightWithoutPadding = 0;
|
|
@@ -71111,23 +71136,6 @@
|
|
|
71111
71136
|
}
|
|
71112
71137
|
}
|
|
71113
71138
|
}
|
|
71114
|
-
updateViewBox(newViewBox) {
|
|
71115
|
-
const oldWidth = this.options?.viewBox.x2 ?? 0 - this.options?.viewBox.x1 ?? 0;
|
|
71116
|
-
const oldHeight = this.options?.viewBox.y2 ?? 0 - this.options?.viewBox.y1 ?? 0;
|
|
71117
|
-
const newWidth = newViewBox.x2 - newViewBox.x1;
|
|
71118
|
-
const newHeight = newViewBox.y2 - newViewBox.y1;
|
|
71119
|
-
this.options.viewBox = newViewBox;
|
|
71120
|
-
if (oldWidth !== newWidth || oldHeight !== newHeight) {
|
|
71121
|
-
this.resize();
|
|
71122
|
-
}
|
|
71123
|
-
else {
|
|
71124
|
-
this.scenegraph.stage.setViewBox(this.options.viewBox, true);
|
|
71125
|
-
}
|
|
71126
|
-
}
|
|
71127
|
-
setViewBoxTransform(a, b, c, d, e, f) {
|
|
71128
|
-
this.internalProps.modifiedViewBoxTransform = true;
|
|
71129
|
-
this.scenegraph.stage.window.setViewBoxTransform(a, b, c, d, e, f);
|
|
71130
|
-
}
|
|
71131
71139
|
get rowHierarchyType() {
|
|
71132
71140
|
return 'grid';
|
|
71133
71141
|
}
|
|
@@ -71224,6 +71232,7 @@
|
|
|
71224
71232
|
}
|
|
71225
71233
|
setRowHeight(row, height) {
|
|
71226
71234
|
this.scenegraph.setRowHeight(row, height);
|
|
71235
|
+
this.scenegraph.updateChartSizeForResizeRowHeight(row);
|
|
71227
71236
|
this.internalProps._heightResizedRowMap.add(row);
|
|
71228
71237
|
}
|
|
71229
71238
|
getRowsHeight(startRow, endRow) {
|
|
@@ -71321,6 +71330,7 @@
|
|
|
71321
71330
|
}
|
|
71322
71331
|
setColWidth(col, width) {
|
|
71323
71332
|
this.scenegraph.setColWidth(col, width);
|
|
71333
|
+
this.scenegraph.updateChartSizeForResizeColWidth(col);
|
|
71324
71334
|
this.internalProps._widthResizedColMap.add(col);
|
|
71325
71335
|
}
|
|
71326
71336
|
_clearColRangeWidthsMap(col) {
|
|
@@ -71652,8 +71662,6 @@
|
|
|
71652
71662
|
const visibleRect = this.getVisibleRect();
|
|
71653
71663
|
rect.offsetLeft(this.tableX - (relativeX ? visibleRect.left : 0));
|
|
71654
71664
|
rect.offsetTop(this.tableY - (relativeY ? visibleRect.top : 0));
|
|
71655
|
-
rect.offsetLeft(this.options.viewBox?.x1 ?? 0);
|
|
71656
|
-
rect.offsetTop(this.options.viewBox?.y1 ?? 0);
|
|
71657
71665
|
return rect;
|
|
71658
71666
|
}
|
|
71659
71667
|
getVisibleRect() {
|
|
@@ -71813,9 +71821,8 @@
|
|
|
71813
71821
|
}
|
|
71814
71822
|
this.scenegraph.stage.release();
|
|
71815
71823
|
this.scenegraph.proxy.release();
|
|
71816
|
-
internalProps.focusControl.release();
|
|
71817
71824
|
const { parentElement } = internalProps.element;
|
|
71818
|
-
if (parentElement
|
|
71825
|
+
if (parentElement) {
|
|
71819
71826
|
parentElement.removeChild(internalProps.element);
|
|
71820
71827
|
}
|
|
71821
71828
|
this.editorManager?.editingEditor?.onEnd?.();
|
|
@@ -71859,7 +71866,7 @@
|
|
|
71859
71866
|
this.autoFillHeight = autoFillHeight ?? false;
|
|
71860
71867
|
this.customRender = customRender;
|
|
71861
71868
|
const internalProps = this.internalProps;
|
|
71862
|
-
if (Env.mode !== 'node'
|
|
71869
|
+
if (Env.mode !== 'node') {
|
|
71863
71870
|
updateRootElementPadding(internalProps.element, this.padding);
|
|
71864
71871
|
}
|
|
71865
71872
|
this.columnWidthComputeMode = options.columnWidthComputeMode ?? 'normal';
|
|
@@ -72040,14 +72047,9 @@
|
|
|
72040
72047
|
const currentHeight = rect.height;
|
|
72041
72048
|
const originHeight = this.canvas.offsetHeight || currentHeight;
|
|
72042
72049
|
const heightRatio = currentHeight / originHeight;
|
|
72043
|
-
const x = (clientX - rect.left) / widthRatio + (isAddScroll ? table.scrollLeft : 0)
|
|
72044
|
-
const y = (clientY - rect.top) / heightRatio + (isAddScroll ? table.scrollTop : 0)
|
|
72045
|
-
|
|
72046
|
-
if (this.internalProps.modifiedViewBoxTransform && this.scenegraph.stage.window.getViewBoxTransform()) {
|
|
72047
|
-
const transform = this.scenegraph.stage.window.getViewBoxTransform();
|
|
72048
|
-
transform.transformPoint(point, point);
|
|
72049
|
-
}
|
|
72050
|
-
return point;
|
|
72050
|
+
const x = (clientX - rect.left) / widthRatio + (isAddScroll ? table.scrollLeft : 0);
|
|
72051
|
+
const y = (clientY - rect.top) / heightRatio + (isAddScroll ? table.scrollTop : 0);
|
|
72052
|
+
return { x, y, inTable };
|
|
72051
72053
|
}
|
|
72052
72054
|
getTheme() {
|
|
72053
72055
|
return this.internalProps.theme;
|
|
@@ -73275,6 +73277,9 @@
|
|
|
73275
73277
|
setMinMaxLimitWidth(setWidth = false) {
|
|
73276
73278
|
const internalProps = this.internalProps;
|
|
73277
73279
|
for (let col = 0; col < internalProps.layoutMap.columnWidths.length; col++) {
|
|
73280
|
+
if (this.internalProps._widthResizedColMap.has(col)) {
|
|
73281
|
+
continue;
|
|
73282
|
+
}
|
|
73278
73283
|
const { width, minWidth, maxWidth } = internalProps.layoutMap.columnWidths?.[col] ?? {};
|
|
73279
73284
|
if (setWidth &&
|
|
73280
73285
|
width &&
|
|
@@ -73292,9 +73297,9 @@
|
|
|
73292
73297
|
setSortedIndexMap(field, filedMap) {
|
|
73293
73298
|
this.dataSource?.setSortedIndexMap(field, filedMap);
|
|
73294
73299
|
}
|
|
73295
|
-
checkReactCustomLayout() {
|
|
73300
|
+
checkReactCustomLayout(removeAllContainer) {
|
|
73296
73301
|
if (!this.reactCustomLayout) {
|
|
73297
|
-
this.reactCustomLayout = new ReactCustomLayout(this);
|
|
73302
|
+
this.reactCustomLayout = new ReactCustomLayout(removeAllContainer, this);
|
|
73298
73303
|
}
|
|
73299
73304
|
}
|
|
73300
73305
|
get bodyDomContainer() {
|
|
@@ -75678,10 +75683,12 @@
|
|
|
75678
75683
|
this.bindEvent();
|
|
75679
75684
|
}
|
|
75680
75685
|
bindEvent() {
|
|
75681
|
-
|
|
75686
|
+
this.table.internalProps.handler;
|
|
75687
|
+
const editCellTrigger = this.table.options.editCellTrigger;
|
|
75682
75688
|
this.table.on(TABLE_EVENT_TYPE.DBLCLICK_CELL, e => {
|
|
75683
|
-
if (!
|
|
75684
|
-
|
|
75689
|
+
if (!editCellTrigger ||
|
|
75690
|
+
editCellTrigger === 'doubleclick' ||
|
|
75691
|
+
(Array.isArray(editCellTrigger) && editCellTrigger.includes('doubleclick'))) {
|
|
75685
75692
|
const { col, row } = e;
|
|
75686
75693
|
const eventArgsSet = getCellEventArgsSet(e.federatedEvent);
|
|
75687
75694
|
const resizeCol = this.table.scenegraph.getResizeColAt(eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y, eventArgsSet.eventArgs?.targetCell);
|
|
@@ -75692,19 +75699,11 @@
|
|
|
75692
75699
|
}
|
|
75693
75700
|
});
|
|
75694
75701
|
this.table.on(TABLE_EVENT_TYPE.CLICK_CELL, e => {
|
|
75695
|
-
if (
|
|
75702
|
+
if (editCellTrigger === 'click' || (Array.isArray(editCellTrigger) && editCellTrigger.includes('click'))) {
|
|
75696
75703
|
const { col, row } = e;
|
|
75697
75704
|
this.startEditCell(col, row);
|
|
75698
75705
|
}
|
|
75699
75706
|
});
|
|
75700
|
-
handler.on(this.table.getElement(), 'wheel', (e) => {
|
|
75701
|
-
this.completeEdit();
|
|
75702
|
-
});
|
|
75703
|
-
handler.on(this.table.getElement(), 'resize', (e) => {
|
|
75704
|
-
if (this.table.autoFillWidth || this.table.autoFillHeight) {
|
|
75705
|
-
this.completeEdit();
|
|
75706
|
-
}
|
|
75707
|
-
});
|
|
75708
75707
|
}
|
|
75709
75708
|
startEditCell(col, row, value) {
|
|
75710
75709
|
const editor = this.table.getEditor(col, row);
|
|
@@ -75810,7 +75809,6 @@
|
|
|
75810
75809
|
|
|
75811
75810
|
class ListTable extends BaseTable {
|
|
75812
75811
|
showHeader = true;
|
|
75813
|
-
editorManager;
|
|
75814
75812
|
constructor(container, options) {
|
|
75815
75813
|
if (Env.mode === 'node') {
|
|
75816
75814
|
options = container;
|
|
@@ -76373,7 +76371,7 @@
|
|
|
76373
76371
|
notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight;
|
|
76374
76372
|
}
|
|
76375
76373
|
if (this.widthMode === 'adaptive' || notFillWidth || this.heightMode === 'adaptive' || notFillHeight) {
|
|
76376
|
-
this.scenegraph.
|
|
76374
|
+
this.scenegraph.updateChartSizeForResizeColWidth(0);
|
|
76377
76375
|
}
|
|
76378
76376
|
}
|
|
76379
76377
|
}
|
|
@@ -77690,9 +77688,7 @@
|
|
|
77690
77688
|
const axisStylrAttrs = getAxisAttributes(this.option);
|
|
77691
77689
|
const attrs = this.getUpdateAttribute();
|
|
77692
77690
|
attrs.verticalFactor = this.orient === 'top' || this.orient === 'right' ? -1 : 1;
|
|
77693
|
-
this.component = new LineAxis(merge({
|
|
77694
|
-
disableTriggerEvent: this.table.options.disableInteraction
|
|
77695
|
-
}, axisStylrAttrs, attrs));
|
|
77691
|
+
this.component = new LineAxis(merge({}, axisStylrAttrs, attrs));
|
|
77696
77692
|
this.component.setAttributes(this.setLayoutStartPosition({ x: 0, y: 0 }));
|
|
77697
77693
|
this.component.originAxis = this;
|
|
77698
77694
|
}
|
|
@@ -78273,11 +78269,20 @@
|
|
|
78273
78269
|
height: this.table.tableNoFrameHeight
|
|
78274
78270
|
});
|
|
78275
78271
|
const legend = new DiscreteLegend(merge({}, attrs, {
|
|
78276
|
-
defaultSelected: this.selectedData
|
|
78277
|
-
disableTriggerEvent: this.table.options.disableInteraction
|
|
78272
|
+
defaultSelected: this.selectedData
|
|
78278
78273
|
}));
|
|
78279
78274
|
legend.name = 'legend';
|
|
78280
78275
|
this.legendComponent = legend;
|
|
78276
|
+
if (this.visible === false) {
|
|
78277
|
+
legend.setAttributes({
|
|
78278
|
+
maxWidth: 0,
|
|
78279
|
+
width: 0,
|
|
78280
|
+
maxHeight: 0,
|
|
78281
|
+
height: 0,
|
|
78282
|
+
clip: true
|
|
78283
|
+
});
|
|
78284
|
+
legend.hideAll();
|
|
78285
|
+
}
|
|
78281
78286
|
this.table.scenegraph.stage.defaultLayer.appendChild(legend);
|
|
78282
78287
|
this.adjustTableSize(attrs);
|
|
78283
78288
|
}
|
|
@@ -79964,8 +79969,7 @@
|
|
|
79964
79969
|
data: table.getCellValue(col, row),
|
|
79965
79970
|
cellPadding: padding,
|
|
79966
79971
|
dpr: table.internalProps.pixelRatio,
|
|
79967
|
-
axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : []
|
|
79968
|
-
tableChartOption: table.options.chartOption
|
|
79972
|
+
axes: table.isPivotChart() ? table.internalProps.layoutMap.getChartAxes(col, row) : []
|
|
79969
79973
|
});
|
|
79970
79974
|
cellGroup.appendChild(chartGroup);
|
|
79971
79975
|
table.internalProps.layoutMap.setChartInstance(col, row, chartGroup.chartInstance);
|
|
@@ -83398,6 +83402,9 @@
|
|
|
83398
83402
|
if (this.isSeriesNumberInHeader(target.col, target.row) || this.isSeriesNumberInHeader(source.col, source.row)) {
|
|
83399
83403
|
return false;
|
|
83400
83404
|
}
|
|
83405
|
+
if (this.isCornerHeader(target.col, target.row)) {
|
|
83406
|
+
return false;
|
|
83407
|
+
}
|
|
83401
83408
|
if (source.col < 0 || source.row < 0 || target.col < 0 || target.row < 0) {
|
|
83402
83409
|
return false;
|
|
83403
83410
|
}
|
|
@@ -86046,7 +86053,6 @@
|
|
|
86046
86053
|
class PivotTable extends BaseTable {
|
|
86047
86054
|
layoutNodeId = { seqId: 0 };
|
|
86048
86055
|
pivotSortState;
|
|
86049
|
-
editorManager;
|
|
86050
86056
|
dataset;
|
|
86051
86057
|
flatDataToObjects;
|
|
86052
86058
|
constructor(container, options) {
|
|
@@ -87013,7 +87019,7 @@
|
|
|
87013
87019
|
notFillHeight = this.getAllRowsHeight() <= this.tableNoFrameHeight;
|
|
87014
87020
|
}
|
|
87015
87021
|
if (this.widthMode === 'adaptive' || notFillWidth || this.heightMode === 'adaptive' || notFillHeight) {
|
|
87016
|
-
this.scenegraph.
|
|
87022
|
+
this.scenegraph.updateChartSizeForResizeColWidth(0);
|
|
87017
87023
|
}
|
|
87018
87024
|
}
|
|
87019
87025
|
}
|
|
@@ -88312,14 +88318,6 @@
|
|
|
88312
88318
|
updateChartData(this.scenegraph);
|
|
88313
88319
|
this.render();
|
|
88314
88320
|
}
|
|
88315
|
-
clearChartCacheImage(col, row) {
|
|
88316
|
-
if (isNumber$2(col) && isNumber$2(row)) {
|
|
88317
|
-
clearCellChartCacheImage(col, row, this.scenegraph);
|
|
88318
|
-
}
|
|
88319
|
-
else {
|
|
88320
|
-
clearChartCacheImage(this.scenegraph);
|
|
88321
|
-
}
|
|
88322
|
-
}
|
|
88323
88321
|
getLegendSelected() {
|
|
88324
88322
|
const selected = [];
|
|
88325
88323
|
this.internalProps.legends?.forEach(legend => {
|
|
@@ -89113,7 +89111,7 @@
|
|
|
89113
89111
|
}
|
|
89114
89112
|
|
|
89115
89113
|
registerForVrender();
|
|
89116
|
-
const version = "1.5.
|
|
89114
|
+
const version = "1.5.5-alpha.0";
|
|
89117
89115
|
function getIcons() {
|
|
89118
89116
|
return get$2();
|
|
89119
89117
|
}
|