Skip to content

Commit

Permalink
Merge pull request #2063 from VisActor/release/1.5.1
Browse files Browse the repository at this point in the history
[Auto release] release 1.5.1
  • Loading branch information
fangsmile committed Jul 10, 2024
2 parents 80aae0b + 1b54fd3 commit 121f728
Show file tree
Hide file tree
Showing 16 changed files with 152 additions and 50 deletions.
2 changes: 1 addition & 1 deletion common/config/rush/version-policies.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"1.5.0","mainProject":"@visactor/vtable","nextBump":"minor"}]
[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"1.5.1","mainProject":"@visactor/vtable","nextBump":"patch"}]
25 changes: 25 additions & 0 deletions docs/assets/changelog/en/release.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# v1.5.0

2024-07-05


**🆕 New feature**

- **@visactor/vtable**: add showMoverLine and hideMoverLine api [#2009](https://github.com/VisActor/VTable/issues/2009)
- **@visactor/vtable**: add formatExcelJSCell config in vtable-export [#1989](https://github.com/VisActor/VTable/issues/1989)
- **@visactor/vtable**: optimize package size & add load on demand feature

**🐛 Bug fix**

- **@visactor/vtable**: pivot chart select state [#2017](https://github.com/VisActor/VTable/issues/2017)
- **@visactor/vtable**: disable select and edit input should move when input is outside of table [#2039](https://github.com/VisActor/VTable/issues/2039)
- **@visactor/vtable**: last column resize width error [#2040](https://github.com/VisActor/VTable/issues/2040)
- **@visactor/vtable**: fix test judgement in customMergeCell [#2031](https://github.com/VisActor/VTable/issues/2031)
- **@visactor/vtable**: fix selected highlight update when scrolling [#2028](https://github.com/VisActor/VTable/issues/2028)
- **@visactor/vtable**: fix select-rect update when scroll [#2015](https://github.com/VisActor/VTable/issues/2015)
- **@visactor/vtable**: fix frozen cell update problem in sort [#1997](https://github.com/VisActor/VTable/issues/1997)



[more detail about v1.5.0](https://github.com/VisActor/VTable/releases/tag/v1.5.0)

# v1.4.2

2024-07-05
Expand Down
56 changes: 39 additions & 17 deletions docs/assets/changelog/zh/release.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,51 @@
# v1.4.2
# v1.5.0

2024-07-05


**🆕 新增功能**

- **@visactor/vtable**: corner title can display row and column diemensionTitle [#1926](https://github.com/VisActor/VTable/issues/1926)
- **@visactor/vtable**: add column hide config [#1991](https://github.com/VisActor/VTable/issues/1991)
- **@visactor/vtable**: add getCellAtRelativePosition api

- **@visactor/vtable**: 添加 showMoverLine 和 hideMoverLine API [#2009](https://github.com/VisActor/VTable/issues/2009)
- **@visactor/vtable**: 在 vtable-export 中添加 formatExcelJSCell 配置 [#1989](https://github.com/VisActor/VTable/issues/1989)
- **@visactor/vtable**: 优化包大小并添加按需加载功能

**🐛 功能修复**

- **@visactor/vtable**: 修复数据透视图选择状态问题 [#2017](https://github.com/VisActor/VTable/issues/2017)
- **@visactor/vtable**: 修复输入框在表格外时选中进入编辑状态后表格移动的问题 [#2039](https://github.com/VisActor/VTable/issues/2039)
- **@visactor/vtable**: 修复最后一列调整宽度错误 [#2040](https://github.com/VisActor/VTable/issues/2040)
- **@visactor/vtable**: 修复自定义合并单元格的测试判断问题 [#2031](https://github.com/VisActor/VTable/issues/2031)
- **@visactor/vtable**: 修复滚动时选中高亮更新问题 [#2028](https://github.com/VisActor/VTable/issues/2028)
- **@visactor/vtable**: 修复滚动时选择矩形框更新问题 [#2015](https://github.com/VisActor/VTable/issues/2015)
- **@visactor/vtable**: 修复排序中冻结单元格更新问题 [#1997](https://github.com/VisActor/VTable/issues/1997)

[更多详情请查看 v1.5.0](https://github.com/VisActor/VTable/releases/tag/v1.5.0)

# v1.4.2

2024-07-05

**🆕 新增功能**

- **@visactor/vtable**: 角头标题可以显示行和列的维度标题 [#1926](https://github.com/VisActor/VTable/issues/1926)
- **@visactor/vtable**: 添加列隐藏配置 [#1991](https://github.com/VisActor/VTable/issues/1991)
- **@visactor/vtable**: 添加获取相对位置单元格的 API

**🐛 功能修复**

- **@visactor/vtable**: when not exit edit state then can not select other cells [#1974](https://github.com/VisActor/VTable/issues/1974)
- **@visactor/vtable**: selected_clear event trigger [#1981](https://github.com/VisActor/VTable/issues/1981)
- **@visactor/vtable**: pivotTable virtual node edit value not work [#2002](https://github.com/VisActor/VTable/issues/2002)
- **@visactor/vtable**: tooltip content can not be selected [#2003](https://github.com/VisActor/VTable/issues/2003)
- **@visactor/vtable**: fix vrender export module
- **@visactor/vtable**: fix merge cell update performance problem [#1972](https://github.com/VisActor/VTable/issues/1972)
- **@visactor/vtable**: fix regexp format for webpack 3 [#2005](https://github.com/VisActor/VTable/issues/2005)
- **@visactor/vtable**: fix width computation in shrinkSparklineFirst mode

- **@visactor/vtable**: 判断当未退出编辑状态时无法选择其他单元格 [#1974](https://github.com/VisActor/VTable/issues/1974)
- **@visactor/vtable**: 触发 selected_clear 事件 [#1981](https://github.com/VisActor/VTable/issues/1981)
- **@visactor/vtable**: 修复数据透视表虚拟节点编辑值不生效的问题 [#2002](https://github.com/VisActor/VTable/issues/2002)
- **@visactor/vtable**: 修复无法选择Tooltip提示内容的问题 [#2003](https://github.com/VisActor/VTable/issues/2003)
- **@visactor/vtable**: 修复 vrender 导出模块
- **@visactor/vtable**: 修复合并单元格更新性能问题 [#1972](https://github.com/VisActor/VTable/issues/1972)
- **@visactor/vtable**: 修复 webpack 3 的正则表达式格式问题 [#2005](https://github.com/VisActor/VTable/issues/2005)
- **@visactor/vtable**: 修复 shrinkSparklineFirst 模式下宽度计算问题

**🔨 功能重构**

- **@visactor/vtable**: sparkline cellType set aggregationType None automatically [#1999](https://github.com/VisActor/VTable/issues/1999)


- **@visactor/vtable**: 自动将 sparkline cellType 的聚合类型设置为 None [#1999](https://github.com/VisActor/VTable/issues/1999)



[更多详情请查看 v1.4.2](https://github.com/VisActor/VTable/releases/tag/v1.4.2)
Expand Down
3 changes: 2 additions & 1 deletion docs/assets/guide/en/basic_function/sort/list_sort.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,9 @@ const option = {
// 创建 VTable 实例
const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), option);
window.tableInstance = tableInstance;
const clickCount = 0;
let clickCount = 0;
tableInstance.on('sort_click', args => {
clickCount++;
const sortState = clickCount % 3 === 0 ? 'desc' : clickCount % 3 === 1 ? 'asc' : 'normal';
sortRecords(args.field, sortState)
.then(records => {
Expand Down
3 changes: 2 additions & 1 deletion docs/assets/guide/zh/basic_function/sort/list_sort.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,9 @@ const option = {
// 创建 VTable 实例
const tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), option);
window.tableInstance = tableInstance;
const clickCount = 0;
let clickCount = 0;
tableInstance.on('sort_click', args => {
clickCount++;
const sortState = clickCount % 3 === 0 ? 'desc' : clickCount % 3 === 1 ? 'asc' : 'normal';
sortRecords(args.field, sortState)
.then(records => {
Expand Down
2 changes: 1 addition & 1 deletion packages/openinula-vtable/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/openinula-vtable",
"version": "1.5.0",
"version": "1.5.1",
"description": "The openinula version of VTable",
"keywords": [
"openinula",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-vtable/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/react-vtable",
"version": "1.5.0",
"version": "1.5.1",
"description": "The react version of VTable",
"keywords": [
"react",
Expand Down
2 changes: 1 addition & 1 deletion packages/vtable-editors/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable-editors",
"version": "1.5.0",
"version": "1.5.1",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/vtable-export/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable-export",
"version": "1.5.0",
"version": "1.5.1",
"description": "The export util of VTable",
"author": {
"name": "VisActor",
Expand Down
2 changes: 1 addition & 1 deletion packages/vtable-search/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable-search",
"version": "1.5.0",
"version": "1.5.1",
"description": "The search util of VTable",
"author": {
"name": "VisActor",
Expand Down
15 changes: 15 additions & 0 deletions packages/vtable/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
{
"name": "@visactor/vtable",
"entries": [
{
"version": "1.5.1",
"tag": "@visactor/vtable_v1.5.1",
"date": "Wed, 10 Jul 2024 06:19:15 GMT",
"comments": {
"none": [
{
"comment": "fix: getCellAtRelativePosition api return value #2054\n\n"
},
{
"comment": "fix: add tolerance for scroll in _disableColumnAndRowSizeRound mode"
}
]
}
},
{
"version": "1.5.0",
"tag": "@visactor/vtable_v1.5.0",
Expand Down
12 changes: 11 additions & 1 deletion packages/vtable/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Change Log - @visactor/vtable

This log was last generated on Fri, 05 Jul 2024 10:43:51 GMT and should not be manually modified.
This log was last generated on Wed, 10 Jul 2024 06:19:15 GMT and should not be manually modified.

## 1.5.1
Wed, 10 Jul 2024 06:19:15 GMT

### Updates

- fix: getCellAtRelativePosition api return value #2054


- fix: add tolerance for scroll in _disableColumnAndRowSizeRound mode

## 1.5.0
Fri, 05 Jul 2024 10:43:51 GMT
Expand Down
2 changes: 1 addition & 1 deletion packages/vtable/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable",
"version": "1.5.0",
"version": "1.5.1",
"description": "canvas table width high performance",
"keywords": [
"grid",
Expand Down
49 changes: 30 additions & 19 deletions packages/vtable/src/core/utils/get-cell-position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ export function getTargetColAtConsiderRightFrozen(
if (
isConsider &&
absoluteX > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() &&
absoluteX < _this.tableNoFrameWidth
absoluteX < _this.tableNoFrameWidth &&
absoluteX <= _this.getAllColsWidth()
) {
for (let i = 0; i < _this.rightFrozenColCount; i++) {
if (absoluteX > _this.tableNoFrameWidth - _this.getColsWidth(_this.colCount - i - 1, _this.colCount - 1)) {
Expand Down Expand Up @@ -377,12 +378,20 @@ export function getCellAtRelativePosition(x: number, y: number, _this: BaseTable

// bottom frozen
let bottomFrozen = false;
if (y > _this.tableNoFrameHeight - _this.getBottomFrozenRowsHeight() && y < _this.tableNoFrameHeight) {
if (
y > _this.tableNoFrameHeight - _this.getBottomFrozenRowsHeight() &&
y < _this.tableNoFrameHeight &&
y <= _this.getAllRowsHeight()
) {
bottomFrozen = true;
}
// right frozen
let rightFrozen = false;
if (x > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() && x < _this.tableNoFrameWidth) {
if (
x > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() &&
x < _this.tableNoFrameWidth &&
x <= _this.getAllColsWidth()
) {
rightFrozen = true;
}

Expand All @@ -396,20 +405,22 @@ export function getCellAtRelativePosition(x: number, y: number, _this: BaseTable
bottomFrozen,
_this
);

const { row, top, bottom, height } = rowInfo;
const { col, left, right, width } = colInfo;
const rect = {
left,
right,
top,
bottom,
width,
height
};
return {
row,
col,
rect
};
if (colInfo && rowInfo) {
const { row, top, bottom, height } = rowInfo;
const { col, left, right, width } = colInfo;
const rect = {
left,
right,
top,
bottom,
width,
height
};
return {
row,
col,
rect
};
}
return { col: -1, row: -1 };
}
10 changes: 8 additions & 2 deletions packages/vtable/src/scenegraph/component/table-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,13 @@ export class TableComponent {
const frozenColsWidth = this.table.getFrozenColsWidth();
const bottomFrozenRowsHeight = this.table.getBottomFrozenRowsHeight();
const rightFrozenColsWidth = this.table.getRightFrozenColsWidth();
if (totalWidth > tableWidth) {

// _disableColumnAndRowSizeRound环境中,可能出现
// getAllColsWidth/getAllRowsHeight(A) + getAllColsWidth/getAllRowsHeight(B) < getAllColsWidth/getAllRowsHeight(A+B)
// (由于小数在取数时被省略)
// 这里加入tolerance,避免出现无用滚动
const sizeTolerance = this.table.options.customConfig?._disableColumnAndRowSizeRound ? 1 : 0;
if (totalWidth > tableWidth + sizeTolerance) {
const y = Math.min(tableHeight, totalHeight);
const rangeEnd = Math.max(0.05, (tableWidth - frozenColsWidth) / (totalWidth - frozenColsWidth));

Expand Down Expand Up @@ -384,7 +390,7 @@ export class TableComponent {
});
}

if (totalHeight > tableHeight) {
if (totalHeight > tableHeight + sizeTolerance) {
const x = Math.min(tableWidth, totalWidth);
const rangeEnd = Math.max(0.05, (tableHeight - frozenRowsHeight) / (totalHeight - frozenRowsHeight));

Expand Down
15 changes: 13 additions & 2 deletions packages/vtable/src/state/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,12 @@ export class StateManager {
setScrollTop(top: number) {
// 矫正top值范围
const totalHeight = this.table.getAllRowsHeight();
top = Math.max(0, Math.min(top, totalHeight - this.table.scenegraph.height));
// _disableColumnAndRowSizeRound环境中,可能出现
// getAllColsWidth/getAllRowsHeight(A) + getAllColsWidth/getAllRowsHeight(B) < getAllColsWidth/getAllRowsHeight(A+B)
// (由于小数在取数时被省略)
// 这里加入tolerance,避免出现无用滚动
const sizeTolerance = this.table.options.customConfig?._disableColumnAndRowSizeRound ? 1 : 0;
top = Math.max(0, Math.min(top, totalHeight - this.table.scenegraph.height - sizeTolerance));
top = Math.ceil(top);
// 滚动期间清空选中清空 如果调用接口hover状态需要保留,但是如果不调用updateHoverPos透视图处于hover状态的图就不能及时更新 所以这里单独判断了isPivotChart
if (top !== this.scroll.verticalBarPos || this.table.isPivotChart()) {
Expand Down Expand Up @@ -943,7 +948,13 @@ export class StateManager {
const totalWidth = this.table.getAllColsWidth();
const frozenWidth = this.table.getFrozenColsWidth();

left = Math.max(0, Math.min(left, totalWidth - this.table.scenegraph.width));
// _disableColumnAndRowSizeRound环境中,可能出现
// getAllColsWidth/getAllRowsHeight(A) + getAllColsWidth/getAllRowsHeight(B) < getAllColsWidth/getAllRowsHeight(A+B)
// (由于小数在取数时被省略)
// 这里加入tolerance,避免出现无用滚动
const sizeTolerance = this.table.options.customConfig?._disableColumnAndRowSizeRound ? 1 : 0;

left = Math.max(0, Math.min(left, totalWidth - this.table.scenegraph.width - sizeTolerance));
left = Math.ceil(left);
// 滚动期间清空选中清空
if (left !== this.scroll.horizontalBarPos) {
Expand Down

0 comments on commit 121f728

Please sign in to comment.