Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feat/package-size
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun committed Jul 4, 2024
2 parents e9e4ff1 + 89cb688 commit 90c8f28
Show file tree
Hide file tree
Showing 33 changed files with 665 additions and 151 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "feat: add showMoverLine and hideMoverLine api #2009\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "[email protected]"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: pivot chart select state #2017\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "[email protected]"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix test judgement in customMergeCell #2031",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix selected highlight update when scrolling #2028",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix select-rect update when scroll #2015",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}
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)
```
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;
});
```
18 changes: 17 additions & 1 deletion docs/assets/demo/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,23 @@
"category": "demo",
"group": "Basic Features",
"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": ""
}
},
{
"path": "frozen-row",
"title": {
"zh": "冻结行",
"en": "frozen row"
},
"meta": {
"title": "frozen row",
"keywords": "",
"category": "demo",
"group": "Basic Features",
"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": ""
}
},
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/demo/zh/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: 冻结列
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
Loading

0 comments on commit 90c8f28

Please sign in to comment.