@visactor/vtable 0.18.1 → 0.18.2-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/core/BaseTable.js +3 -3
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/style.js +2 -1
- package/cjs/data/CachedDataSource.js +1 -2
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js +32 -17
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/cjs/scenegraph/stick-text/index.js +5 -5
- package/cjs/scenegraph/stick-text/index.js.map +1 -1
- package/cjs/themes/ARCO.js +1 -2
- package/cjs/themes/BRIGHT.js +2 -1
- package/cjs/ts-types/base-table.d.ts +1 -1
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +90 -50
- package/dist/vtable.min.js +2 -2
- package/es/core/BaseTable.js +4 -3
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/style.js +2 -1
- package/es/data/CachedDataSource.js +1 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.js +30 -15
- package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/es/scenegraph/stick-text/index.js +5 -5
- package/es/scenegraph/stick-text/index.js.map +1 -1
- package/es/themes/ARCO.js +1 -2
- package/es/themes/BRIGHT.js +2 -1
- package/es/ts-types/base-table.d.ts +1 -1
- package/es/ts-types/base-table.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
package/dist/vtable.js
CHANGED
|
@@ -32707,31 +32707,29 @@
|
|
|
32707
32707
|
image.name = 'image';
|
|
32708
32708
|
image.keepAspectRatio = keepAspectRatio;
|
|
32709
32709
|
if (keepAspectRatio || imageAutoSizing) {
|
|
32710
|
-
image.
|
|
32711
|
-
|
|
32712
|
-
|
|
32713
|
-
|
|
32714
|
-
|
|
32715
|
-
|
|
32716
|
-
|
|
32717
|
-
|
|
32718
|
-
|
|
32719
|
-
|
|
32720
|
-
|
|
32721
|
-
y: pos.y,
|
|
32722
|
-
width: imageWidth,
|
|
32723
|
-
height: imageHeight,
|
|
32724
|
-
dx: isMerge ? -table.getColsWidth(cellGroup.mergeStartCol, col - 1) : 0,
|
|
32725
|
-
dy: isMerge ? -table.getRowsHeight(cellGroup.mergeStartRow, row - 1) : 0
|
|
32726
|
-
});
|
|
32727
|
-
}
|
|
32728
|
-
table.scenegraph.updateNextFrame();
|
|
32729
|
-
};
|
|
32710
|
+
if (image.resources &&
|
|
32711
|
+
image.resources.has(image.attribute.image) &&
|
|
32712
|
+
image.resources.get(image.attribute.image).state === 'success') {
|
|
32713
|
+
updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table);
|
|
32714
|
+
}
|
|
32715
|
+
else {
|
|
32716
|
+
image.successCallback = () => {
|
|
32717
|
+
updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table);
|
|
32718
|
+
table.scenegraph.updateNextFrame();
|
|
32719
|
+
};
|
|
32720
|
+
}
|
|
32730
32721
|
}
|
|
32731
32722
|
else {
|
|
32732
|
-
image.
|
|
32723
|
+
if (image.resources &&
|
|
32724
|
+
image.resources.has(image.attribute.image) &&
|
|
32725
|
+
image.resources.get(image.attribute.image).state === 'success') {
|
|
32733
32726
|
updateImageCellContentWhileResize(cellGroup, col, row, table);
|
|
32734
|
-
}
|
|
32727
|
+
}
|
|
32728
|
+
else {
|
|
32729
|
+
image.successCallback = () => {
|
|
32730
|
+
updateImageCellContentWhileResize(cellGroup, col, row, table);
|
|
32731
|
+
};
|
|
32732
|
+
}
|
|
32735
32733
|
}
|
|
32736
32734
|
image.failCallback = () => {
|
|
32737
32735
|
const regedIcons = get$1();
|
|
@@ -32844,6 +32842,43 @@
|
|
|
32844
32842
|
isMerge: false
|
|
32845
32843
|
};
|
|
32846
32844
|
}
|
|
32845
|
+
function updateImageDxDy(startCol, endCol, startRow, endRow, table) {
|
|
32846
|
+
for (let col = startCol; col <= endCol; col++) {
|
|
32847
|
+
for (let row = startRow; row <= endRow; row++) {
|
|
32848
|
+
const cellGroup = table.scenegraph.getCell(col, row);
|
|
32849
|
+
if (cellGroup) {
|
|
32850
|
+
const image = cellGroup.getChildByName('image');
|
|
32851
|
+
if (image) {
|
|
32852
|
+
image.setAttributes({
|
|
32853
|
+
dx: -table.getColsWidth(cellGroup.mergeStartCol, col - 1),
|
|
32854
|
+
dy: -table.getRowsHeight(cellGroup.mergeStartRow, row - 1)
|
|
32855
|
+
});
|
|
32856
|
+
}
|
|
32857
|
+
}
|
|
32858
|
+
}
|
|
32859
|
+
}
|
|
32860
|
+
}
|
|
32861
|
+
function updateAutoSizingAndKeepAspectRatio(imageAutoSizing, keepAspectRatio, padding, textAlign, textBaseline, image, cellGroup, table) {
|
|
32862
|
+
const originImage = image.resources.get(image.attribute.image).data;
|
|
32863
|
+
const { col, row } = cellGroup;
|
|
32864
|
+
if (imageAutoSizing) {
|
|
32865
|
+
_adjustWidthHeight(col, row, originImage.width, originImage.height, table.scenegraph, padding);
|
|
32866
|
+
}
|
|
32867
|
+
if (keepAspectRatio) {
|
|
32868
|
+
const { width: cellWidth, height: cellHeight, isMerge } = getCellRange(cellGroup, table);
|
|
32869
|
+
const { width: imageWidth, height: imageHeight } = calcKeepAspectRatioSize(originImage.width, originImage.height, cellWidth - padding[1] - padding[3], cellHeight - padding[0] - padding[2]);
|
|
32870
|
+
const pos = calcStartPosition(0, 0, cellWidth, cellHeight, imageWidth, imageHeight, textAlign, textBaseline, padding);
|
|
32871
|
+
image.setAttributes({
|
|
32872
|
+
x: pos.x,
|
|
32873
|
+
y: pos.y,
|
|
32874
|
+
width: imageWidth,
|
|
32875
|
+
height: imageHeight
|
|
32876
|
+
});
|
|
32877
|
+
if (isMerge) {
|
|
32878
|
+
updateImageDxDy(cellGroup.mergeStartCol, cellGroup.mergeEndCol, cellGroup.mergeStartRow, cellGroup.mergeEndRow, table);
|
|
32879
|
+
}
|
|
32880
|
+
}
|
|
32881
|
+
}
|
|
32847
32882
|
|
|
32848
32883
|
function createProgressBarCell(progressBarDefine, style, width, value, dataValue, col, row, padding, table) {
|
|
32849
32884
|
if (progressBarDefine.dependField) {
|
|
@@ -41863,7 +41898,7 @@
|
|
|
41863
41898
|
});
|
|
41864
41899
|
});
|
|
41865
41900
|
});
|
|
41866
|
-
changedCells.
|
|
41901
|
+
changedCells.clear();
|
|
41867
41902
|
const { scrollTop, scrollLeft, frozenRowCount, frozenColCount } = table;
|
|
41868
41903
|
const frozenRowsHeight = table.getFrozenRowsHeight();
|
|
41869
41904
|
const frozenColsWidth = table.getFrozenColsWidth();
|
|
@@ -41962,24 +41997,26 @@
|
|
|
41962
41997
|
const textBottom = graphic.globalAABBBounds.y2;
|
|
41963
41998
|
if (textTop < minTop) {
|
|
41964
41999
|
const deltaHeight = textTop - minTop;
|
|
41965
|
-
changedCells.
|
|
41966
|
-
col
|
|
41967
|
-
|
|
41968
|
-
|
|
41969
|
-
|
|
41970
|
-
|
|
42000
|
+
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
42001
|
+
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
42002
|
+
col: cellGroup.col,
|
|
42003
|
+
row: cellGroup.row,
|
|
42004
|
+
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
42005
|
+
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
42006
|
+
});
|
|
41971
42007
|
cellGroup.forEachChildren((child) => {
|
|
41972
42008
|
child.setAttribute('dy', (child.attribute.dy ?? 0) - deltaHeight + 2);
|
|
41973
42009
|
});
|
|
41974
42010
|
}
|
|
41975
42011
|
else if (textBottom > maxTop) {
|
|
41976
42012
|
const deltaHeight = textBottom - maxTop;
|
|
41977
|
-
changedCells.
|
|
41978
|
-
col
|
|
41979
|
-
|
|
41980
|
-
|
|
41981
|
-
|
|
41982
|
-
|
|
42013
|
+
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
42014
|
+
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
42015
|
+
col: cellGroup.col,
|
|
42016
|
+
row: cellGroup.row,
|
|
42017
|
+
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
42018
|
+
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
42019
|
+
});
|
|
41983
42020
|
cellGroup.forEachChildren((child) => {
|
|
41984
42021
|
child.setAttribute('dy', (child.attribute.dy ?? 0) - deltaHeight);
|
|
41985
42022
|
});
|
|
@@ -42011,24 +42048,26 @@
|
|
|
42011
42048
|
const textRight = text.globalAABBBounds.x2;
|
|
42012
42049
|
if (textLeft < minLeft) {
|
|
42013
42050
|
const deltaWidth = textLeft - minLeft;
|
|
42014
|
-
changedCells.
|
|
42015
|
-
col
|
|
42016
|
-
|
|
42017
|
-
|
|
42018
|
-
|
|
42019
|
-
|
|
42051
|
+
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
42052
|
+
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
42053
|
+
col: cellGroup.col,
|
|
42054
|
+
row: cellGroup.row,
|
|
42055
|
+
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
42056
|
+
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
42057
|
+
});
|
|
42020
42058
|
cellGroup.forEachChildren((child) => {
|
|
42021
42059
|
child.setAttribute('dx', (child.attribute.dx ?? 0) - deltaWidth + 2);
|
|
42022
42060
|
});
|
|
42023
42061
|
}
|
|
42024
42062
|
else if (textRight > maxLeft) {
|
|
42025
42063
|
const deltaWidth = textRight - maxLeft;
|
|
42026
|
-
changedCells.
|
|
42027
|
-
col
|
|
42028
|
-
|
|
42029
|
-
|
|
42030
|
-
|
|
42031
|
-
|
|
42064
|
+
!changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
|
|
42065
|
+
changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
|
|
42066
|
+
col: cellGroup.col,
|
|
42067
|
+
row: cellGroup.row,
|
|
42068
|
+
dx: cellGroup.firstChild?.attribute.dx ?? 0,
|
|
42069
|
+
dy: cellGroup.firstChild?.attribute.dy ?? 0
|
|
42070
|
+
});
|
|
42032
42071
|
cellGroup.forEachChildren((child) => {
|
|
42033
42072
|
child.setAttribute('dx', (child.attribute.dx ?? 0) - deltaWidth);
|
|
42034
42073
|
});
|
|
@@ -50623,7 +50662,7 @@
|
|
|
50623
50662
|
return TABLE_EVENT_TYPE;
|
|
50624
50663
|
}
|
|
50625
50664
|
options;
|
|
50626
|
-
version = "0.18.
|
|
50665
|
+
version = "0.18.2-alpha.0";
|
|
50627
50666
|
pagination;
|
|
50628
50667
|
id = `VTable${Date.now()}`;
|
|
50629
50668
|
headerStyleCache;
|
|
@@ -50768,7 +50807,7 @@
|
|
|
50768
50807
|
this.headerStyleCache = new Map();
|
|
50769
50808
|
this.bodyStyleCache = new Map();
|
|
50770
50809
|
this.bodyBottomStyleCache = new Map();
|
|
50771
|
-
internalProps.stick = { changedCells:
|
|
50810
|
+
internalProps.stick = { changedCells: new Map() };
|
|
50772
50811
|
internalProps.customMergeCell = options.customMergeCell;
|
|
50773
50812
|
}
|
|
50774
50813
|
throttleInvalidate = throttle2(this.render.bind(this), 200);
|
|
@@ -51734,6 +51773,7 @@
|
|
|
51734
51773
|
this.colWidthsMap = new NumberMap();
|
|
51735
51774
|
this.colContentWidthsMap = new NumberMap();
|
|
51736
51775
|
this.colWidthsLimit = {};
|
|
51776
|
+
internalProps.stick.changedCells.clear();
|
|
51737
51777
|
internalProps.theme = themes.of(options.theme ?? themes.DEFAULT);
|
|
51738
51778
|
this.scenegraph.updateStageBackground();
|
|
51739
51779
|
internalProps.autoWrapText = options.autoWrapText;
|
|
@@ -61869,7 +61909,7 @@
|
|
|
61869
61909
|
}
|
|
61870
61910
|
|
|
61871
61911
|
registerForVrender();
|
|
61872
|
-
const version = "0.18.
|
|
61912
|
+
const version = "0.18.2-alpha.0";
|
|
61873
61913
|
function getIcons() {
|
|
61874
61914
|
return get$1();
|
|
61875
61915
|
}
|