Skip to content

Commit 97541aa

Browse files
authored
Merge pull request #5054 from VisActor/fix/groupBy-with-rowSeriesNumber
Fix/group by with row series number
2 parents 2f20e3d + 6c2df1e commit 97541aa

111 files changed

Lines changed: 9391 additions & 611 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// Eslint
33
"eslint.format.enable": true,
44
"eslint.validate": ["typescript", "javascript", "javascriptreact", "typescriptreact"],
5+
"eslint.workingDirectories": [
6+
{ "mode": "auto" }
7+
],
8+
"eslint.nodePath": "common/autoinstallers/lint/node_modules",
59
// Formatter
610
"javascript.format.enable": false,
711
"typescript.format.enable": false,
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "fix: formula has formula case compute result error\n\n",
5+
"type": "none",
6+
"packageName": "@visactor/vtable"
7+
}
8+
],
9+
"packageName": "@visactor/vtable",
10+
"email": "892739385@qq.com"
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"changes": [
3+
{
4+
"comment": "fix: checkbox cell render error when set groupBy with rowSeriesNumber\n\n",
5+
"type": "none",
6+
"packageName": "@visactor/vtable"
7+
}
8+
],
9+
"packageName": "@visactor/vtable",
10+
"email": "892739385@qq.com"
11+
}

docs/assets/api/en/SheetAPI.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,46 @@ Get the formula manager
143143
getFormulaManager: () => FormulaManager
144144
```
145145

146+
### getWorkbookHistoryManager(Function)
147+
148+
Get the workbook history manager (workbook-level undo/redo).
149+
150+
```
151+
getWorkbookHistoryManager: () => WorkbookHistoryManager
152+
```
153+
154+
### undo(Function)
155+
156+
Undo the latest workbook transaction.
157+
158+
```
159+
undo: () => void
160+
```
161+
162+
### redo(Function)
163+
164+
Redo the latest workbook transaction.
165+
166+
```
167+
redo: () => void
168+
```
169+
170+
### startHistoryTransaction(Function)
171+
172+
Start a workbook-level transaction. Operations recorded during the transaction are grouped into a single undo/redo step.
173+
174+
```
175+
startHistoryTransaction: () => void
176+
```
177+
178+
### endHistoryTransaction(Function)
179+
180+
End the current workbook-level transaction and push it into the history stack.
181+
182+
```
183+
endHistoryTransaction: () => void
184+
```
185+
146186

147187
## Events
148188

docs/assets/api/en/event/event.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ Supported event types:
3939
RESIZE_COLUMN_END: 'resize_column_end',
4040
RESIZE_ROW: 'resize_row',
4141
RESIZE_ROW_END: 'resize_row_end',
42+
MERGE_CELLS: 'merge_cells',
43+
UNMERGE_CELLS: 'unmerge_cells',
4244
CHANGE_HEADER_POSITION: 'change_header_position',
4345
CHANGE_HEADER_POSITION_START: 'change_header_position_start',
4446
CHANGING_HEADER_POSITION: 'changing_header_position',
@@ -217,7 +219,6 @@ Column width adjustment end event.
217219

218220
Event callback function parameter types.
219221
``
220-
221222
{
222223
col: number.
223224
colWidths: number[]
@@ -253,6 +254,34 @@ rowHeight: number
253254

254255
``
255256

257+
## MERGE_CELLS
258+
259+
Triggered after `mergeCells` succeeds.
260+
261+
Callback parameter:
262+
```ts
263+
{
264+
startCol: number;
265+
startRow: number;
266+
endCol: number;
267+
endRow: number;
268+
}
269+
```
270+
271+
## UNMERGE_CELLS
272+
273+
Triggered after `unmergeCells` is called.
274+
275+
Callback parameter:
276+
```ts
277+
{
278+
startCol: number;
279+
startRow: number;
280+
endCol: number;
281+
endRow: number;
282+
}
283+
```
284+
256285
## CHANGE_HEADER_POSITION
257286

258287
Events for dragging table headers or rows to move positions

docs/assets/api/en/methods.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,44 @@ Corresponding property update interface (see tutorial: https://visactor.io/vtabl
7676
tableInstance.columns = newColumns;
7777
```
7878

79+
## changeHeaderPosition(Function)
80+
81+
Programmatically move header position (drag header behavior), returns whether the move succeeded.
82+
83+
```ts
84+
changeHeaderPosition: (args: {
85+
source: CellAddress;
86+
target: CellAddress;
87+
movingColumnOrRow?: 'column' | 'row';
88+
}) => boolean
89+
```
90+
91+
Usage:
92+
93+
```ts
94+
tableInstance.changeHeaderPosition({
95+
source: { col: 1, row: 0 },
96+
target: { col: 3, row: 0 },
97+
movingColumnOrRow: 'column'
98+
});
99+
```
100+
101+
## mergeCells(Function)
102+
103+
Merge cells by creating a custom merge range (ListTable only). After merging, the table will refresh and emit the `merge_cells` event.
104+
105+
```ts
106+
mergeCells: (startCol: number, startRow: number, endCol: number, endRow: number) => void
107+
```
108+
109+
## unmergeCells(Function)
110+
111+
Unmerge cells by removing the corresponding custom merge range (ListTable only). After unmerging, the table will refresh and emit the `unmerge_cells` event.
112+
113+
```ts
114+
unmergeCells: (startCol: number, startRow: number, endCol: number, endRow: number) => void
115+
```
116+
79117
## updatePagination(Function)
80118

81119
Update pagination configuration information, automatically redraws after calling.

docs/assets/api/zh/SheetAPI.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,46 @@ VTableSheet组件支持的方法如下:
144144
getFormulaManager: () => FormulaManager
145145
```
146146

147+
### getWorkbookHistoryManager(Function)
148+
149+
获取工作簿历史管理器(工作簿级别撤销/重做)。
150+
151+
```
152+
getWorkbookHistoryManager: () => WorkbookHistoryManager
153+
```
154+
155+
### undo(Function)
156+
157+
撤销最近一次工作簿事务。
158+
159+
```
160+
undo: () => void
161+
```
162+
163+
### redo(Function)
164+
165+
重做最近一次工作簿事务。
166+
167+
```
168+
redo: () => void
169+
```
170+
171+
### startHistoryTransaction(Function)
172+
173+
开始一个工作簿级别事务。在该事务期间产生的操作会合并为一次撤销/重做步骤。
174+
175+
```
176+
startHistoryTransaction: () => void
177+
```
178+
179+
### endHistoryTransaction(Function)
180+
181+
结束当前工作簿级别事务,并将其推入历史栈。
182+
183+
```
184+
endHistoryTransaction: () => void
185+
```
186+
147187
## Events
148188

149189
表格事件列表,可以根据实际需要,监听所需事件,实现自定义业务。

docs/assets/api/zh/event/event.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ TABLE_EVENT_TYPE = {
4141
RESIZE_COLUMN_END: 'resize_column_end',
4242
RESIZE_ROW: 'resize_row',
4343
RESIZE_ROW_END: 'resize_row_end',
44+
MERGE_CELLS: 'merge_cells',
45+
UNMERGE_CELLS: 'unmerge_cells',
4446
CHANGE_HEADER_POSITION: 'change_header_position',
4547
CHANGE_HEADER_POSITION_START: 'change_header_position_start',
4648
CHANGING_HEADER_POSITION: 'changing_header_position',
@@ -261,6 +263,34 @@ TABLE_EVENT_TYPE = {
261263
262264
```
263265

266+
## MERGE_CELLS
267+
268+
`mergeCells` 调用成功后触发。
269+
270+
回调参数:
271+
```ts
272+
{
273+
startCol: number;
274+
startRow: number;
275+
endCol: number;
276+
endRow: number;
277+
}
278+
```
279+
280+
## UNMERGE_CELLS
281+
282+
`unmergeCells` 调用后触发。
283+
284+
回调参数:
285+
```ts
286+
{
287+
startCol: number;
288+
startRow: number;
289+
endCol: number;
290+
endRow: number;
291+
}
292+
```
293+
264294
## CHANGE_HEADER_POSITION
265295

266296
拖拽表头或者行来移动位置的事件

docs/assets/api/zh/methods.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,44 @@ tableInstance.updateColumns(newColumns, { clearColWidthCache: true })
7676
tableInstance.columns = newColumns;
7777
```
7878

79+
## changeHeaderPosition(Function)
80+
81+
以编程方式移动表头位置(等价于拖拽表头移动),返回是否移动成功。
82+
83+
```ts
84+
changeHeaderPosition: (args: {
85+
source: CellAddress;
86+
target: CellAddress;
87+
movingColumnOrRow?: 'column' | 'row';
88+
}) => boolean
89+
```
90+
91+
使用示例:
92+
93+
```ts
94+
tableInstance.changeHeaderPosition({
95+
source: { col: 1, row: 0 },
96+
target: { col: 3, row: 0 },
97+
movingColumnOrRow: 'column'
98+
});
99+
```
100+
101+
## mergeCells(Function)
102+
103+
合并单元格(仅 ListTable)。调用后会刷新渲染,并触发 `merge_cells` 事件。
104+
105+
```ts
106+
mergeCells: (startCol: number, startRow: number, endCol: number, endRow: number) => void
107+
```
108+
109+
## unmergeCells(Function)
110+
111+
取消合并单元格(仅 ListTable)。调用后会刷新渲染,并触发 `unmerge_cells` 事件。
112+
113+
```ts
114+
unmergeCells: (startCol: number, startRow: number, endCol: number, endRow: number) => void
115+
```
116+
79117
## updatePagination(Function)
80118

81119
更新页码配置信息 调用后会自动重绘。

docs/assets/demo/en/vtable-sheet/sheet.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This example shows how to configure a simple online spreadsheet. The spreadsheet
1414
## Key Configurations
1515

1616
- `VTableSheet` Configure the theme name or custom theme style
17+
- `undoRedo` Enable undo/redo buttons (Ctrl/Cmd+Z, Ctrl/Cmd+Y)
1718

1819
## Code Demo
1920

@@ -23,6 +24,7 @@ This example shows how to configure a simple online spreadsheet. The spreadsheet
2324

2425
const container = document.getElementById(CONTAINER_ID);
2526
const sheetInstance = new VTableSheet.VTableSheet(container, {
27+
undoRedo: { show: true },
2628
VTablePluginModules: [
2729
{ module: VTablePlugins.TableExportPlugin },
2830
{ module: VTablePlugins.ExcelImportPlugin },
@@ -79,4 +81,4 @@ const sheetInstance = new VTableSheet.VTableSheet(container, {
7981
}
8082
});
8183
window.sheetInstance = sheetInstance;
82-
```
84+
```

0 commit comments

Comments
 (0)