Skip to content

Commit

Permalink
Merge pull request #2049 from VisActor/release/1.5.0
Browse files Browse the repository at this point in the history
[Auto release] release 1.5.0
  • Loading branch information
fangsmile committed Jul 5, 2024
2 parents 7e6e3a2 + 9a4b343 commit 80aae0b
Show file tree
Hide file tree
Showing 129 changed files with 2,200 additions and 1,507 deletions.
9 changes: 9 additions & 0 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.4.2","mainProject":"@visactor/vtable","nextBump":"patch"}]
[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"1.5.0","mainProject":"@visactor/vtable","nextBump":"minor"}]
43 changes: 43 additions & 0 deletions docs/assets/api/en/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -1165,3 +1165,46 @@ Determines whether the cell is in the visible area of the cell. If the cell is c
```
cellIsInVisualView(col: number, row: number)
```

## getCellAtRelativePosition(Function)

Gets the cell position relative to the upper left corner of the table.

In the case of scrolling, the cells obtained are those after scrolling. For example, if the currently displayed rows are 100-120, the cell position relative to the upper left corner of the table (10,100) is (first column, 103rd row), assuming the row height is 40px.

```
/**
* Get the cell information corresponding to the screen coordinates, taking scrolling into account
* @param this
* @param relativeX The left x value, relative to the upper left corner of the container, taking into account the scrolling of the grid
* @param relativeY The left y value, relative to the upper left corner of the container, taking into account the scrolling of the grid
* @returns
*/
getCellAtRelativePosition(relativeX: number, relativeY: number): CellAddressWithBound
```

## showMoverLine(Function)

Displays a highlighted line for moving columns or rows

```
/**
* Display the highlight line of the moving column or row If the (col, row) cell is the column header, the highlight column line is displayed; If the (col, row) cell is the row header, the highlight row line is displayed
* @param col Which column in the table header should be highlighted after?
* @param row The row after which the highlighted line is displayed
*/
showMoverLine(col: number, row: number)
```

## hideMoverLine(Function)

Hide the highlight line of the moved column or row

```
/**
* Hide the highlight line of the moved column or row
* @param col
* @param row
*/
hideMoverLine(col: number, row: number)
```
43 changes: 43 additions & 0 deletions docs/assets/api/zh/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -1163,3 +1163,46 @@ interface ISortedMapItem {
```
cellIsInVisualView(col: number, row: number)
```

## getCellAtRelativePosition(Function)

获取相对于表格左上角的坐标对应的单元格位置。

有滚动的情况下,获取的单元格是滚动后的,如当前显示的行是 100-120 行,获取相对于表格左上角(10,100)位置的单元格位置是(第一列,第 103 行),假设行高 40px。

```
/**
* 获取屏幕坐标对应的单元格信息,考虑滚动
* @param this
* @param relativeX 左边x值,相对于容器左上角,已考虑格滚动情况
* @param relativeY 左边y值,相对于容器左上角,已考虑格滚动情况
* @returns
*/
getCellAtRelativePosition(relativeX: number, relativeY: number): CellAddressWithBound
```

## showMoverLine(Function)

显示移动列或移动行的高亮标记线

```
/**
* 显示移动列或移动行的高亮线 如果(col,row)单元格是列头 则显示高亮列线; 如果(col,row)单元格是行头 则显示高亮行线
* @param col 在表头哪一列后显示高亮线
* @param row 在表头哪一行后显示高亮线
*/
showMoverLine(col: number, row: number)
```

## hideMoverLine(Function)

隐藏掉移动列或移动行的高亮线

```
/**
* 隐藏掉移动列或移动行的高亮线
* @param col
* @param row
*/
hideMoverLine(col: number, row: number)
```
30 changes: 30 additions & 0 deletions docs/assets/changelog/en/release.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
# v1.4.2

2024-07-05


**🆕 New feature**

- **@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

**🐛 Bug fix**

- **@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

**🔨 Refactor**

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



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

# v1.4.0

2024-06-21
Expand Down
30 changes: 30 additions & 0 deletions docs/assets/changelog/zh/release.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
# v1.4.2

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**: 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**: sparkline cellType set aggregationType None automatically [#1999](https://github.com/VisActor/VTable/issues/1999)



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

# v1.4.0

2024-06-21
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/demo-react/en/custom-layout/cell-custom-dom.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ group: component
title: cell custom dom component
cover: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/preview/react-vtable-cell-dom-component.jpeg
order: 1-1
link: '../guide/Developer_Ecology/react'
link: '../../guide/Developer_Ecology/react'
---

# cell custom dom component
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/demo-react/zh/custom-layout/cell-custom-dom.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ group: component
title: 单元格内dom组件
cover: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/preview/react-vtable-cell-dom-component.jpeg
order: 1-1
link: '../guide/Developer_Ecology/react'
link: '../../guide/Developer_Ecology/react'
---

# 单元格内dom组件
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/demo/en/basic-functionality/frozen-col.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ category: examples
group: Basic Features
title: frozen column
cover: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/preview/frozen-col.gif
link: '../guide/basic_function/frozen_column'
link: '../guide/basic_function/frozen_column_row'
option: ListTable#frozenColCount
---

Expand Down
154 changes: 154 additions & 0 deletions docs/assets/demo/en/basic-functionality/frozen-row.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
---
category: examples
group: Basic Features
title: Freeze Row
cover: https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/preview/frozen-row.gif
link: '../guide/basic_function/frozen_column_row'
option: ListTable#frozenRowCount
---

# Freeze Row

In order to keep these key information rows visible throughout the horizontal scroll, we need to "freeze" these rows.

## Key Configurations

- `frozenRowCount` The number of frozen rows (including header), default is the number of header rows

## Code demo

```javascript livedemo template=vtable

let tableInstance;
fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/North_American_Superstore_Pivot_data.json')
.then(res => res.json())
.then(data => {
const option = {
records: data,
rows: [
{
dimensionKey: 'City',
title: 'City',
headerStyle: {
textStick: true,
color: (args) => {
if (args.row < 4) {
return 'red';
}
return '#000';
},
bgColor: (args) => {
if (args.row < 4) {
return 'rgba(255, 0, 0, 0.1)';
}
return '#fff';
}
},
width: 'auto'
}
],
columns: [
{
dimensionKey: 'Category',
title: 'Category',
headerStyle: {
textStick: true
},
width: 'auto'
}
],
indicators: [
{
indicatorKey: 'Quantity',
title: 'Quantity',
width: 'auto',
showSort: false,
headerStyle: {
fontWeight: 'normal'
},
style: {
padding: [16, 28, 16, 28],
color(args) {
if (args.dataValue >= 0) return 'black';
return 'red';
},
bgColor: (args) => {
if (args.row < 4) {
return 'rgba(255, 0, 0, 0.1)';
}
return '#fff';
}
}
},
{
indicatorKey: 'Sales',
title: 'Sales',
width: 'auto',
showSort: false,
headerStyle: {
fontWeight: 'normal'
},
format: rec => {
return '$' + Number(rec).toFixed(2);
},
style: {
padding: [16, 28, 16, 28],
color(args) {
if (args.dataValue >= 0) return 'black';
return 'red';
},
bgColor: (args) => {
if (args.row < 4) {
return 'rgba(255, 0, 0, 0.1)';
}
return '#fff';
}
}
},
{
indicatorKey: 'Profit',
title: 'Profit',
width: 'auto',
showSort: false,
headerStyle: {
fontWeight: 'normal'
},
format: rec => {
return '$' + Number(rec).toFixed(2);
},
style: {
padding: [16, 28, 16, 28],
color(args) {
if (args.dataValue >= 0) return 'black';
return 'red';
},
bgColor: (args) => {
if (args.row < 4) {
return 'rgba(255, 0, 0, 0.1)';
}
return '#fff';
}
}
}
],
corner: {
titleOnDimension: 'row',
headerStyle: {
textStick: true
}
},
dataConfig: {
sortRules: [
{
sortField: 'Category',
sortBy: ['Office Supplies', 'Technology', 'Furniture']
}
]
},
widthMode: 'standard',
frozenRowCount: 4,
};
tableInstance = new VTable.PivotTable(document.getElementById(CONTAINER_ID), option);
window['tableInstance'] = tableInstance;
});
```
Loading

0 comments on commit 80aae0b

Please sign in to comment.