From 30a9e6f1cfc7760765faa79f6a0fc4e864dcf0fc Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Fri, 18 Oct 2024 18:57:33 +0800
Subject: [PATCH 01/65] fix: when collapse last group occor error #2600
---
.../examples/list/list-group-manyChild.ts | 162 ++++++++++++++++++
packages/vtable/examples/menu.ts | 4 +
packages/vtable/src/ListTable.ts | 21 ++-
.../src/scenegraph/layout/update-row.ts | 4 +-
4 files changed, 187 insertions(+), 4 deletions(-)
create mode 100644 packages/vtable/examples/list/list-group-manyChild.ts
diff --git a/packages/vtable/examples/list/list-group-manyChild.ts b/packages/vtable/examples/list/list-group-manyChild.ts
new file mode 100644
index 000000000..786fe0135
--- /dev/null
+++ b/packages/vtable/examples/list/list-group-manyChild.ts
@@ -0,0 +1,162 @@
+import * as VTable from '../../src';
+const CONTAINER_ID = 'vTable';
+const generatePersons = count => {
+ return Array.from(new Array(count)).map((_, i) => ({
+ id: i + 1,
+ email1: `${i + 1}@xxx.com`,
+ name: `小明${i + 1}`,
+ lastName: '王',
+ date1: '2022年9月1日',
+ tel: '000-0000-0000',
+ sex: i % 2 === 0 ? 'boy' : 'girl',
+ work: i % 2 === 0 ? 'back-end engineer' + (i + 1) : 'front-end engineer' + (i + 1),
+ city: 'beijing'
+ }));
+};
+
+export function createTable() {
+ let tableInstance;
+
+ fetch('https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/olympic-winners.json')
+ .then(res => res.json())
+ .then(data => {
+ const columns = [
+ {
+ field: 'athlete',
+ title: 'athlete',
+ width: 120
+ },
+ {
+ field: 'age',
+ title: 'age'
+ },
+ {
+ field: 'country',
+ title: 'country',
+ width: 240,
+ headerIcon: 'filter'
+ },
+ { field: 'year', title: 'year', headerIcon: 'filter' },
+ { field: 'sport', title: 'sport', headerIcon: 'filter' },
+ {
+ field: 'gold',
+ title: 'gold'
+ },
+ {
+ field: 'silver',
+ title: 'silver'
+ },
+ {
+ field: 'bronze',
+ title: 'bronze'
+ },
+ {
+ field: 'total',
+ title: 'total'
+ }
+ ];
+ const option = {
+ columns,
+ records: data,
+ autoWrapText: true,
+ heightMode: 'autoHeight',
+ widthMode: 'autoWidth',
+ bottomFrozenRowCount: 1,
+ groupBy: 'country',
+ rowSeriesNumber: {
+ title: '序号',
+ width: 'auto',
+ headerStyle: {
+ color: 'black',
+ bgColor: 'pink'
+ },
+ style: {
+ color: 'blue'
+ }
+ },
+ theme: VTable.themes.ARCO.extends({
+ bottomFrozenStyle: {
+ fontFamily: 'PingFang SC',
+ fontWeight: 500
+ }
+ })
+ };
+ const t0 = window.performance.now();
+ tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), option);
+ window.tableInstance = tableInstance;
+ const filterListValues = {
+ country: ['all', 'China', 'United States', 'Australia'],
+ year: ['all', '2004', '2008', '2012', '2016', '2020'],
+ sport: ['all', 'Swimming', 'Cycling', 'Biathlon', 'Short-Track Speed Skating', 'Nordic Combined']
+ };
+ let filterListSelectedValues = '';
+ let lastFilterField;
+ tableInstance.on('icon_click', args => {
+ const { col, row, name } = args;
+ if (name === 'filter') {
+ const field = tableInstance.getHeaderField(col, row);
+ if (select && lastFilterField === field) {
+ removeFilterElement();
+ lastFilterField = null;
+ } else if (!select || lastFilterField !== field) {
+ const rect = tableInstance.getCellRelativeRect(col, row);
+ createFilterElement(filterListValues[field], filterListSelectedValues, field, rect);
+ lastFilterField = field;
+ }
+ }
+ });
+
+ const filterContainer = tableInstance.getElement();
+ let select;
+ function createFilterElement(values, curValue, field, positonRect) {
+ // create select tag
+ select = document.createElement('select');
+ select.setAttribute('type', 'text');
+ select.style.position = 'absolute';
+ select.style.padding = '4px';
+ select.style.width = '100%';
+ select.style.boxSizing = 'border-box';
+
+ // create option tags
+ let opsStr = '';
+ values.forEach(item => {
+ opsStr +=
+ item === curValue
+ ? ``
+ : ``;
+ });
+ select.innerHTML = opsStr;
+
+ filterContainer.appendChild(select);
+
+ select.style.top = positonRect.top + positonRect.height + 'px';
+ select.style.left = positonRect.left + 'px';
+ select.style.width = positonRect.width + 'px';
+ select.style.height = positonRect.height + 'px';
+ select.addEventListener('change', () => {
+ filterListSelectedValues = select.value;
+ tableInstance.updateFilterRules([
+ {
+ filterKey: field,
+ filteredValues: select.value
+ }
+ ]);
+ removeFilterElement();
+ //更新列头icon
+ columns.forEach(col => {
+ if (col.field === field) {
+ col.headerIcon = 'filtered';
+ }
+ });
+ tableInstance.updateColumns(columns);
+ });
+ }
+ function removeFilterElement() {
+ filterContainer.removeChild(select);
+ select.removeEventListener('change', () => {
+ // this.successCallback();
+ });
+ select = null;
+ }
+ });
+}
diff --git a/packages/vtable/examples/menu.ts b/packages/vtable/examples/menu.ts
index 40f7d7af6..6a1f53bb4 100644
--- a/packages/vtable/examples/menu.ts
+++ b/packages/vtable/examples/menu.ts
@@ -134,6 +134,10 @@ export const menus = [
{
path: 'list',
name: 'list-group'
+ },
+ {
+ path: 'list',
+ name: 'list-group-manyChild'
}
]
},
diff --git a/packages/vtable/src/ListTable.ts b/packages/vtable/src/ListTable.ts
index cb08cc600..d8ee519e0 100644
--- a/packages/vtable/src/ListTable.ts
+++ b/packages/vtable/src/ListTable.ts
@@ -891,8 +891,25 @@ export class ListTable extends BaseTable implements ListTableAPI {
this.clearCellStyleCache();
this.internalProps.layoutMap.clearCellRangeMap();
this.internalProps.useOneRowHeightFillAll = false;
- // this.scenegraph.updateHierarchyIcon(col, row);// 添加了updateCells:[{ col, row }] 就不需要单独更新图标了(只更新图标针对有自定义元素的情况 会有更新不到问题)
- this.scenegraph.updateRow(diffPositions.removeCellPositions, diffPositions.addCellPositions, [{ col, row }]);
+ // this.scenegraph.updateHierarchyIcon(col, row);// 添加了updateCells:[{ col, row }] 就不需要单独更新图标了(只更新图标针对有自定义元素的情况 会有更新不到问题)'
+ const updateCells = [{ col, row }];
+ // // 如果需要移出的节点超过了当前加载部分最后一行 则转变成更新对应的行
+ // if (
+ // diffPositions.removeCellPositions?.length > 0 &&
+ // diffPositions.removeCellPositions[diffPositions.removeCellPositions.length - 1].row >=
+ // this.scenegraph.proxy.rowEnd
+ // ) {
+ // for (let i = 0; i <= diffPositions.removeCellPositions.length - 1; i++) {
+ // if (diffPositions.removeCellPositions[i].row <= this.scenegraph.proxy.rowEnd) {
+ // updateCells.push({
+ // col: diffPositions.removeCellPositions[i].col,
+ // row: diffPositions.removeCellPositions[i].row
+ // });
+ // }
+ // }
+ // diffPositions.removeCellPositions = [];
+ // }
+ this.scenegraph.updateRow(diffPositions.removeCellPositions, diffPositions.addCellPositions, updateCells);
if (checkHasChart) {
// 检查更新节点状态后总宽高未撑满autoFill是否在起作用
if (this.autoFillWidth && !notFillWidth) {
diff --git a/packages/vtable/src/scenegraph/layout/update-row.ts b/packages/vtable/src/scenegraph/layout/update-row.ts
index b79762c0d..3d563cce3 100644
--- a/packages/vtable/src/scenegraph/layout/update-row.ts
+++ b/packages/vtable/src/scenegraph/layout/update-row.ts
@@ -134,7 +134,7 @@ export function updateRow(
scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);
updateBottomFrozeCellGroups();
- scene.proxy.progress();
+ // scene.proxy.progress();
}
scene.proxy.progress();
@@ -184,7 +184,7 @@ function removeRow(row: number, scene: Scenegraph) {
// proxy.totalRow--;
const totalActualBodyRowCount = Math.min(proxy.rowLimit, proxy.bodyBottomRow - proxy.bodyTopRow + 1); // 渐进加载总row数量
proxy.totalActualBodyRowCount = totalActualBodyRowCount;
- proxy.totalRow = proxy.rowStart + totalActualBodyRowCount - 1; // 目标渐进完成的row
+ proxy.totalRow = Math.min(proxy.table.rowCount - 1, proxy.rowStart + totalActualBodyRowCount - 1); // 目标渐进完成的row
}
function addRow(row: number, scene: Scenegraph) {
From d2e330d84dc0837231507e4ba555a49ff380a617 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Fri, 18 Oct 2024 18:57:56 +0800
Subject: [PATCH 02/65] docs: update changlog of rush
---
...00-bug-group-rowSeriesNumber_2024-10-18-10-57.json | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 common/changes/@visactor/vtable/2600-bug-group-rowSeriesNumber_2024-10-18-10-57.json
diff --git a/common/changes/@visactor/vtable/2600-bug-group-rowSeriesNumber_2024-10-18-10-57.json b/common/changes/@visactor/vtable/2600-bug-group-rowSeriesNumber_2024-10-18-10-57.json
new file mode 100644
index 000000000..35d02063d
--- /dev/null
+++ b/common/changes/@visactor/vtable/2600-bug-group-rowSeriesNumber_2024-10-18-10-57.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "fix: when collapse last group occor error #2600\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
From be0e27ddf35e22422f44b71f7030f140b5d1c1c0 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Sun, 20 Oct 2024 21:56:11 +0800
Subject: [PATCH 03/65] fix: when collapse tree node occor error #2600
---
packages/vtable/src/ListTable.ts | 32 +++++++++----------
packages/vtable/src/core/BaseTable.ts | 6 +++-
.../progress/update-position/dynamic-set-x.ts | 2 +-
.../progress/update-position/dynamic-set-y.ts | 25 ++++++++++++---
.../progress/update-position/sort-vertical.ts | 6 +++-
packages/vtable/src/scenegraph/scenegraph.ts | 3 ++
6 files changed, 50 insertions(+), 24 deletions(-)
diff --git a/packages/vtable/src/ListTable.ts b/packages/vtable/src/ListTable.ts
index 92779a89a..dcfc1b835 100644
--- a/packages/vtable/src/ListTable.ts
+++ b/packages/vtable/src/ListTable.ts
@@ -893,22 +893,22 @@ export class ListTable extends BaseTable implements ListTableAPI {
this.internalProps.useOneRowHeightFillAll = false;
// this.scenegraph.updateHierarchyIcon(col, row);// 添加了updateCells:[{ col, row }] 就不需要单独更新图标了(只更新图标针对有自定义元素的情况 会有更新不到问题)'
const updateCells = [{ col, row }];
- // // 如果需要移出的节点超过了当前加载部分最后一行 则转变成更新对应的行
- // if (
- // diffPositions.removeCellPositions?.length > 0 &&
- // diffPositions.removeCellPositions[diffPositions.removeCellPositions.length - 1].row >=
- // this.scenegraph.proxy.rowEnd
- // ) {
- // for (let i = 0; i <= diffPositions.removeCellPositions.length - 1; i++) {
- // if (diffPositions.removeCellPositions[i].row <= this.scenegraph.proxy.rowEnd) {
- // updateCells.push({
- // col: diffPositions.removeCellPositions[i].col,
- // row: diffPositions.removeCellPositions[i].row
- // });
- // }
- // }
- // diffPositions.removeCellPositions = [];
- // }
+ // 如果需要移出的节点超过了当前加载部分最后一行 则转变成更新对应的行
+ if (
+ diffPositions.removeCellPositions?.length > 0 &&
+ diffPositions.removeCellPositions[diffPositions.removeCellPositions.length - 1].row >=
+ this.scenegraph.proxy.rowEnd
+ ) {
+ for (let i = 0; i <= diffPositions.removeCellPositions.length - 1; i++) {
+ if (diffPositions.removeCellPositions[i].row <= this.scenegraph.proxy.rowEnd) {
+ updateCells.push({
+ col: diffPositions.removeCellPositions[i].col,
+ row: diffPositions.removeCellPositions[i].row
+ });
+ }
+ }
+ diffPositions.removeCellPositions = [];
+ }
this.scenegraph.updateRow(diffPositions.removeCellPositions, diffPositions.addCellPositions, updateCells);
if (checkHasChart) {
// 检查更新节点状态后总宽高未撑满autoFill是否在起作用
diff --git a/packages/vtable/src/core/BaseTable.ts b/packages/vtable/src/core/BaseTable.ts
index 6961f09c3..9dd5b11c0 100644
--- a/packages/vtable/src/core/BaseTable.ts
+++ b/packages/vtable/src/core/BaseTable.ts
@@ -2553,7 +2553,11 @@ export abstract class BaseTable extends EventTarget implements BaseTableAPI {
* @returns
*/
getTargetRowAt(absoluteY: number): RowInfo | null {
- return getTargetRowAt(absoluteY, this);
+ const targetRow = getTargetRowAt(absoluteY, this);
+ if (targetRow) {
+ targetRow.row = Math.min(targetRow.row, this.rowCount - 1);
+ }
+ return targetRow;
}
/**
diff --git a/packages/vtable/src/scenegraph/group-creater/progress/update-position/dynamic-set-x.ts b/packages/vtable/src/scenegraph/group-creater/progress/update-position/dynamic-set-x.ts
index 5f43d9b36..2d0bbc489 100644
--- a/packages/vtable/src/scenegraph/group-creater/progress/update-position/dynamic-set-x.ts
+++ b/packages/vtable/src/scenegraph/group-creater/progress/update-position/dynamic-set-x.ts
@@ -215,7 +215,7 @@ function updateColGroupContentAsync(colGroup: Group, proxy: SceneProxy) {
}
const screenTopRow = proxy.screenTopRow;
const topRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);
- const bottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);
+ const bottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2, proxy.table.rowCount - 1);
for (let row = topRow; row <= bottomRow; row++) {
// const cellGroup = proxy.table.scenegraph.getCell(col, row);
diff --git a/packages/vtable/src/scenegraph/group-creater/progress/update-position/dynamic-set-y.ts b/packages/vtable/src/scenegraph/group-creater/progress/update-position/dynamic-set-y.ts
index a51c21d1c..15ed96550 100644
--- a/packages/vtable/src/scenegraph/group-creater/progress/update-position/dynamic-set-y.ts
+++ b/packages/vtable/src/scenegraph/group-creater/progress/update-position/dynamic-set-y.ts
@@ -91,7 +91,11 @@ async function moveCell(
syncBottomRow = distEndRow;
} else {
const topRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);
- const bottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);
+ const bottomRow = Math.min(
+ proxy.bodyBottomRow,
+ screenTopRow + proxy.screenRowCount * 2,
+ proxy.table.rowCount - 1
+ );
// get coincide of distStartRow&distEndRow and topRow&BottomRow
// syncTopRow = Math.max(distStartRow, topRow);
// syncBottomRow = Math.min(distEndRow, bottomRow);
@@ -162,7 +166,11 @@ async function moveCell(
proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;
proxy.totalRow = Math.max(
0,
- Math.min(proxy.bodyBottomRow, direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count)
+ Math.min(
+ proxy.bodyBottomRow,
+ direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count,
+ proxy.table.rowCount - 1
+ )
);
proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);
// proxy.referenceRow = screenTopRow;
@@ -178,7 +186,10 @@ async function moveCell(
await proxy.progress();
} else {
const distStartRow = direction === 'up' ? proxy.rowStart + count : proxy.rowStart - count;
- const distEndRow = direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count;
+ const distEndRow = Math.min(
+ proxy.table.rowCount - 1,
+ direction === 'up' ? proxy.rowEnd + count : proxy.rowEnd - count
+ );
const distStartRowY = proxy.table.getRowsHeight(proxy.bodyTopRow, distStartRow - 1);
let syncTopRow;
@@ -188,7 +199,7 @@ async function moveCell(
syncBottomRow = distEndRow;
} else {
syncTopRow = Math.max(proxy.bodyTopRow, screenTopRow - proxy.screenRowCount * 1);
- syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2);
+ syncBottomRow = Math.min(proxy.bodyBottomRow, screenTopRow + proxy.screenRowCount * 2, proxy.table.rowCount - 1);
}
computeRowsHeight(proxy.table, syncTopRow, syncBottomRow, false);
@@ -256,7 +267,11 @@ async function moveCell(
proxy.currentRow = direction === 'up' ? proxy.currentRow + count : proxy.currentRow - count;
proxy.totalRow = Math.max(
0,
- Math.min(proxy.bodyBottomRow, direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count)
+ Math.min(
+ proxy.bodyBottomRow,
+ direction === 'up' ? proxy.totalRow + count : proxy.totalRow - count,
+ proxy.table.rowCount - 1
+ )
);
proxy.referenceRow = proxy.rowStart + Math.floor((proxy.rowEnd - proxy.rowStart) / 2);
// proxy.referenceRow = screenTopRow;
diff --git a/packages/vtable/src/scenegraph/group-creater/progress/update-position/sort-vertical.ts b/packages/vtable/src/scenegraph/group-creater/progress/update-position/sort-vertical.ts
index 6f8a21d3d..a8e3a5a03 100644
--- a/packages/vtable/src/scenegraph/group-creater/progress/update-position/sort-vertical.ts
+++ b/packages/vtable/src/scenegraph/group-creater/progress/update-position/sort-vertical.ts
@@ -23,7 +23,11 @@ export async function sortVertical(proxy: SceneProxy) {
syncBottomRow = proxy.rowEnd;
} else {
syncTopRow = Math.max(proxy.bodyTopRow, proxy.screenTopRow - proxy.screenRowCount * 1);
- syncBottomRow = Math.min(proxy.bodyBottomRow, proxy.screenTopRow + proxy.screenRowCount * 2);
+ syncBottomRow = Math.min(
+ proxy.bodyBottomRow,
+ proxy.screenTopRow + proxy.screenRowCount * 2,
+ proxy.table.rowCount - 1
+ );
}
// console.log('sort更新同步范围', syncTopRow, syncBottomRow);
diff --git a/packages/vtable/src/scenegraph/scenegraph.ts b/packages/vtable/src/scenegraph/scenegraph.ts
index d14bd18d3..ec12bde38 100644
--- a/packages/vtable/src/scenegraph/scenegraph.ts
+++ b/packages/vtable/src/scenegraph/scenegraph.ts
@@ -1948,6 +1948,9 @@ export class Scenegraph {
) {
this.table.scenegraph.recalculateRowHeights();
} else if (this.table.heightMode === 'autoHeight') {
+ if (updateCells.length > 0) {
+ this.table.scenegraph.recalculateRowHeights();
+ }
for (let i = 0; i < updateRows.length; i++) {
const row = updateRows[i];
const oldHeight = this.table.getRowHeight(row);
From 621c4dce8c29f319f944c64964e8382c9b051dc0 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Sun, 20 Oct 2024 22:00:15 +0800
Subject: [PATCH 04/65] docs: update changlog of rush
---
...00-bug-group-rowSeriesNumber_2024-10-20-14-00.json | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 common/changes/@visactor/vtable/2600-bug-group-rowSeriesNumber_2024-10-20-14-00.json
diff --git a/common/changes/@visactor/vtable/2600-bug-group-rowSeriesNumber_2024-10-20-14-00.json b/common/changes/@visactor/vtable/2600-bug-group-rowSeriesNumber_2024-10-20-14-00.json
new file mode 100644
index 000000000..234ed84ae
--- /dev/null
+++ b/common/changes/@visactor/vtable/2600-bug-group-rowSeriesNumber_2024-10-20-14-00.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "fix: when collapse tree node occor error #2600\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
From 365fe5298ea40ea7f9a115eb63f267757f52dfe8 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Mon, 21 Oct 2024 11:18:20 +0800
Subject: [PATCH 05/65] feat: add freeze_click event #2641
---
packages/vtable/src/state/state.ts | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/packages/vtable/src/state/state.ts b/packages/vtable/src/state/state.ts
index d6603bffa..f33a09b14 100644
--- a/packages/vtable/src/state/state.ts
+++ b/packages/vtable/src/state/state.ts
@@ -1409,7 +1409,16 @@ export class StateManager {
// 更新frozen
dealFreeze(col, row, this.table);
-
+ if ((this.table as any).hasListeners(PIVOT_TABLE_EVENT_TYPE.FREEZE_CLICK)) {
+ this.table.fireListeners(PIVOT_TABLE_EVENT_TYPE.FREEZE_CLICK, {
+ col: col,
+ row: row,
+ fields: this.table.internalProps.layoutMap.columnObjects
+ .slice(0, col + 1)
+ .reduce((pre: any, cur: any) => pre.concat(cur.field), []),
+ colCount: this.table.frozenColCount
+ });
+ }
// // 更新scenegraph,这里因为dealFreeze更新了table里存储的frozen信息,会影响scenegraph里的getCell
// // 因此先更新scenegraph结构再更新icon
// this.table.scenegraph.updateFrozen(this.frowzen.col);
From 3f9c1fe6b8733f8c0c6bba881a93517ee909f38e Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Mon, 21 Oct 2024 11:19:22 +0800
Subject: [PATCH 06/65] docs: update changlog of rush
---
.../2641-bug-freeze_click-event_2024-10-21-03-19.json | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 common/changes/@visactor/vtable/2641-bug-freeze_click-event_2024-10-21-03-19.json
diff --git a/common/changes/@visactor/vtable/2641-bug-freeze_click-event_2024-10-21-03-19.json b/common/changes/@visactor/vtable/2641-bug-freeze_click-event_2024-10-21-03-19.json
new file mode 100644
index 000000000..521852808
--- /dev/null
+++ b/common/changes/@visactor/vtable/2641-bug-freeze_click-event_2024-10-21-03-19.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "feat: add freeze_click event #2641\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
From 9cf7df3d26569291ce19828020970eba054f31fb Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Mon, 21 Oct 2024 11:35:38 +0800
Subject: [PATCH 07/65] feat: add freeze_click event #2641
---
packages/vtable/src/state/state.ts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/packages/vtable/src/state/state.ts b/packages/vtable/src/state/state.ts
index f33a09b14..9e089903b 100644
--- a/packages/vtable/src/state/state.ts
+++ b/packages/vtable/src/state/state.ts
@@ -50,6 +50,7 @@ import { updateResizeRow } from './resize/update-resize-row';
import { deleteAllSelectingBorder } from '../scenegraph/select/delete-select-border';
import type { PivotTable } from '../PivotTable';
import { traverseObject } from '../tools/util';
+import type { ColumnData } from '../ts-types/list-table/layout-map/api';
export class StateManager {
table: BaseTableAPI;
@@ -1410,12 +1411,11 @@ export class StateManager {
// 更新frozen
dealFreeze(col, row, this.table);
if ((this.table as any).hasListeners(PIVOT_TABLE_EVENT_TYPE.FREEZE_CLICK)) {
+ const fields: ColumnData[] = (this.table as ListTable).internalProps.layoutMap.columnObjects.slice(0, col + 1);
this.table.fireListeners(PIVOT_TABLE_EVENT_TYPE.FREEZE_CLICK, {
col: col,
row: row,
- fields: this.table.internalProps.layoutMap.columnObjects
- .slice(0, col + 1)
- .reduce((pre: any, cur: any) => pre.concat(cur.field), []),
+ fields: fields.reduce((pre: any, cur: any) => pre.concat(cur.field), []),
colCount: this.table.frozenColCount
});
}
From 5a674e1eef77389498669bc14cff55f91f6f6847 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Tue, 22 Oct 2024 14:43:33 +0800
Subject: [PATCH 08/65] fix: when drag row series number cells not scroll #2647
---
packages/vtable/src/event/listener/container-dom.ts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/packages/vtable/src/event/listener/container-dom.ts b/packages/vtable/src/event/listener/container-dom.ts
index 6d80d17cb..94430b6ad 100644
--- a/packages/vtable/src/event/listener/container-dom.ts
+++ b/packages/vtable/src/event/listener/container-dom.ts
@@ -626,6 +626,10 @@ export function bindContainerDomListener(eventManager: EventManager) {
const leftFrozenColsWidth = table.getFrozenColsWidth();
const rightFrozenColsWidth = table.getRightFrozenColsWidth();
const startCell = table.stateManager.select.ranges[table.stateManager.select.ranges.length - 1].start;
+ if (table.isSeriesNumber(startCell.col, startCell.row)) {
+ //如果是鼠标落到了序号列 不自动滚动
+ return;
+ }
const endCell = table.stateManager.select.ranges[table.stateManager.select.ranges.length - 1].end;
const canScrollY =
(table.isFrozenRow(startCell.row) === false || table.isFrozenRow(endCell.row) === false) &&
From c12477927c1047639e8cbb3ab7cf0d768f5dc6f0 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Tue, 22 Oct 2024 14:44:00 +0800
Subject: [PATCH 09/65] docs: update changlog of rush
---
...647-bug-dragSelect-rowNumber_2024-10-22-06-43.json | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 common/changes/@visactor/vtable/2647-bug-dragSelect-rowNumber_2024-10-22-06-43.json
diff --git a/common/changes/@visactor/vtable/2647-bug-dragSelect-rowNumber_2024-10-22-06-43.json b/common/changes/@visactor/vtable/2647-bug-dragSelect-rowNumber_2024-10-22-06-43.json
new file mode 100644
index 000000000..dd081884d
--- /dev/null
+++ b/common/changes/@visactor/vtable/2647-bug-dragSelect-rowNumber_2024-10-22-06-43.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "fix: when drag row series number cells not scroll #2647\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
From 04637bff36080adc8bf33c6db90c635fb10553d6 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Tue, 22 Oct 2024 15:28:26 +0800
Subject: [PATCH 10/65] fix: min aggregator type handle with NaN value #2627
---
packages/vtable/src/dataset/statistics-helper.ts | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/packages/vtable/src/dataset/statistics-helper.ts b/packages/vtable/src/dataset/statistics-helper.ts
index 3ee84b6e2..646c30b99 100644
--- a/packages/vtable/src/dataset/statistics-helper.ts
+++ b/packages/vtable/src/dataset/statistics-helper.ts
@@ -715,6 +715,8 @@ export class MinAggregator extends Aggregator {
this.min = record < this.min ? record : this.min;
} else if (this.field && typeof record[this.field] === 'number') {
this.min = record[this.field] < this.min ? record[this.field] : this.min;
+ } else if (this.field && !isNaN(record[this.field])) {
+ this.min = parseFloat(record[this.field]) < this.min ? parseFloat(record[this.field]) : this.min;
}
}
this.clearCacheValue();
@@ -759,6 +761,8 @@ export class MinAggregator extends Aggregator {
this.min = record < this.min ? record : this.min;
} else if (this.field && typeof record[this.field] === 'number') {
this.min = record[this.field] < this.min ? record[this.field] : this.min;
+ } else if (this.field && !isNaN(record[this.field])) {
+ this.min = parseFloat(record[this.field]) < this.min ? parseFloat(record[this.field]) : this.min;
}
}
}
From ce58bcd369e09cdab7c4aec6c5aadebe2008a797 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Tue, 22 Oct 2024 15:28:51 +0800
Subject: [PATCH 11/65] docs: update changlog of rush
---
.../2627-bug-minAggregator-NaN_2024-10-22-07-28.json | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 common/changes/@visactor/vtable/2627-bug-minAggregator-NaN_2024-10-22-07-28.json
diff --git a/common/changes/@visactor/vtable/2627-bug-minAggregator-NaN_2024-10-22-07-28.json b/common/changes/@visactor/vtable/2627-bug-minAggregator-NaN_2024-10-22-07-28.json
new file mode 100644
index 000000000..6117a8bdc
--- /dev/null
+++ b/common/changes/@visactor/vtable/2627-bug-minAggregator-NaN_2024-10-22-07-28.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "fix: min aggregator type handle with NaN value #2627\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
From dce164afdb89921b669ec8045f571b9edaf3dd53 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Tue, 22 Oct 2024 17:26:49 +0800
Subject: [PATCH 12/65] feat: headerSelectMode option add body setting #2491
---
docs/assets/demo/en/interaction/select.md | 2 +-
docs/assets/demo/zh/interaction/select.md | 8 +-
docs/assets/guide/en/interaction/select.md | 2 +-
docs/assets/guide/zh/interaction/select.md | 2 +-
.../option/en/common/option-secondary.md | 12 +-
.../option/zh/common/option-secondary.md | 12 +-
.../src/state/select/update-position.ts | 153 +++++++++++++++---
packages/vtable/src/state/state.ts | 8 +-
packages/vtable/src/ts-types/base-table.ts | 8 +-
.../list-table/define/basic-define.ts | 2 -
.../pivot-table/dimension/basic-dimension.ts | 2 -
.../pivot-table/indicator/basic-indicator.ts | 2 -
12 files changed, 164 insertions(+), 49 deletions(-)
diff --git a/docs/assets/demo/en/interaction/select.md b/docs/assets/demo/en/interaction/select.md
index 0d05f721a..c93ada7c4 100644
--- a/docs/assets/demo/en/interaction/select.md
+++ b/docs/assets/demo/en/interaction/select.md
@@ -15,7 +15,7 @@ Hold down ctrl or shift to make multiple selections.
Turn on the shortcut key selectAllOnCtrlA configuration to select all.
-Clicking on the header cell will select the entire row or column by default. If you only want to select the current cell, you can set select.headerSelectMode to 'cell'.
+Clicking on the header cell will select the entire row or column by default. If you only want to select the current cell, you can set `select.headerSelectMode` to `'cell'`, Or if you only want to select cells in the body, you can set `select.headerSelectMode` to `'body'`..
## Key Configurations
diff --git a/docs/assets/demo/zh/interaction/select.md b/docs/assets/demo/zh/interaction/select.md
index c47e1c106..c791ea707 100644
--- a/docs/assets/demo/zh/interaction/select.md
+++ b/docs/assets/demo/zh/interaction/select.md
@@ -15,14 +15,14 @@ option: ListTable#keyboardOptions
开启快捷键 selectAllOnCtrlA 配置进行全选。
-点击表头单元格的行为默认会选中整行或者整列,如果只想选中当前单元格可以设置 select.headerSelectMode 为'cell'。
+点击表头单元格的行为默认会选中整行或者整列,如果只想选中当前单元格可以设置 `select.headerSelectMode` 为`'cell'`, 或者只想选中 body 主体中的单元格可以设置 `select.headerSelectMode` 为`'body'`。
## 关键配置
- ` keyboardOptions: {
- selectAllOnCtrlA: true,
- copySelected: true
- }`
+ selectAllOnCtrlA: true,
+ copySelected: true
+}`
开启 ctrl+A 可选功能,及快捷键复制选中内容。
## 代码演示
diff --git a/docs/assets/guide/en/interaction/select.md b/docs/assets/guide/en/interaction/select.md
index 7bfcd30ab..f7eb9a9fa 100644
--- a/docs/assets/guide/en/interaction/select.md
+++ b/docs/assets/guide/en/interaction/select.md
@@ -8,7 +8,7 @@ When using VTable for data analytics, individual cells can be selected with a mo
As shown above, after clicking on cell (2,3), the cell is selected.
-Clicking on the header cell will select the entire row or column by default. If you only want to select the current cell, you can set select.headerSelectMode to 'cell'.
+Clicking on the header cell will select the entire row or column by default. If you only want to select the current cell, you can set `select.headerSelectMode` to `'cell'`, Or if you only want to select cells in the body, you can set `select.headerSelectMode` to `'body'`.
## Mouse box selection
diff --git a/docs/assets/guide/zh/interaction/select.md b/docs/assets/guide/zh/interaction/select.md
index c6fdffe71..ff39c81fb 100644
--- a/docs/assets/guide/zh/interaction/select.md
+++ b/docs/assets/guide/zh/interaction/select.md
@@ -8,7 +8,7 @@
如上图所示,点击单元格 (2, 3) 后,该单元格被选中。
-点击表头单元格的行为默认会选中整行或者整列,如果只想选中当前单元格可以设置 select.headerSelectMode 为'cell'。
+点击表头单元格的行为默认会选中整行或者整列,如果只想选中当前单元格可以设置 `select.headerSelectMode` 为'`cell'`, 或者只想选中 body 主体中的单元格可以设置 `select.headerSelectMode` 为`'body'`。
## 鼠标框选
diff --git a/docs/assets/option/en/common/option-secondary.md b/docs/assets/option/en/common/option-secondary.md
index 0ffa6606d..69208900d 100644
--- a/docs/assets/option/en/common/option-secondary.md
+++ b/docs/assets/option/en/common/option-secondary.md
@@ -209,11 +209,17 @@ Separately set the header not to respond to mouse hover interaction.
Cell selection interaction configuration, specific configuration items as follows:
-##${prefix} headerSelectMode ('inline' | 'cell') = 'inline'
+##${prefix} headerSelectMode ('inline' | 'cell' | 'body') = 'inline'
-When you click on the header cell, the entire row or column of the body will be selected, or only the current cell will be selected. By default, the entire row or column will be selected.
+When clicking on a header cell, whether the entire row or column needs to be selected along with the body.
-Optional values: 'inline' | 'cell'.
+Possible values:
+
+'inline': Clicking a row header selects the entire row, and selecting a column header selects the entire column;
+
+'cell': select only the currently clicked header cell;
+
+'body': Do not select the table header. Clicking a row header selects all body cells in the row. Clicking a column header selects all body cells in the column.
##${prefix} disableSelect (boolean) = false
diff --git a/docs/assets/option/zh/common/option-secondary.md b/docs/assets/option/zh/common/option-secondary.md
index 92ff1018d..9cf751edf 100644
--- a/docs/assets/option/zh/common/option-secondary.md
+++ b/docs/assets/option/zh/common/option-secondary.md
@@ -204,11 +204,17 @@ hover 交互响应模式:十字交叉、整列、整行或者单个单元格
选择单元格交互配置,具体配置项如下:
-##${prefix} headerSelectMode ('inline' | 'cell') = 'inline'
+##${prefix} headerSelectMode ('inline' | 'cell' | 'body') = 'inline'
-点击表头单元格时连带 body 整行或整列选中 或仅选中当前单元格,默认或整行或整列选中。
+点击表头单元格时连带 body 是否需要整行或整列选中。
-可选值:'inline' | 'cell'。
+可选值:
+
+'inline': 点击行表头则整行选中,选择列表头则整列选中;
+
+'cell': 仅仅选择当前点击的表头单元格;
+
+'body': 不选择表头,点击行表头则选择该行所有 body 单元格,点击列表头则选择该列所有 body 单元格。
##${prefix} disableSelect (boolean) = false
diff --git a/packages/vtable/src/state/select/update-position.ts b/packages/vtable/src/state/select/update-position.ts
index c80eb8023..f81884185 100644
--- a/packages/vtable/src/state/select/update-position.ts
+++ b/packages/vtable/src/state/select/update-position.ts
@@ -107,16 +107,37 @@ export function updateSelectPosition(
const endCol = Math.max(currentRange.start.col, currentRange.end.col, col);
const startRow = Math.min(currentRange.start.row, currentRange.end.row, row);
const endRow = table.rowCount - 1;
-
- currentRange.start = { col: startCol, row: startRow };
- currentRange.end = { col: endCol, row: endRow };
+ if (state.select.headerSelectMode === 'body') {
+ currentRange.start = { col: startCol, row: table.columnHeaderLevelCount };
+ currentRange.end = { col: endCol, row: table.rowCount - 1 };
+ } else {
+ currentRange.start = { col: startCol, row: startRow };
+ currentRange.end = { col: endCol, row: endRow };
+ }
} else if (state.select.headerSelectMode !== 'cell' && table.isRowHeader(col, row)) {
const startCol = Math.min(currentRange.start.col, currentRange.end.col, col);
const endCol = table.colCount - 1;
const startRow = Math.min(currentRange.start.row, currentRange.end.row, row);
const endRow = Math.max(currentRange.start.row, currentRange.end.row, row);
- currentRange.start = { col: startCol, row: startRow };
- currentRange.end = { col: endCol, row: endRow };
+ if (state.select.headerSelectMode === 'body') {
+ currentRange.start = { col: table.leftRowSeriesNumberCount + table.rowHeaderLevelCount, row: startRow };
+ currentRange.end = { col: table.colCount - 1, row: endRow };
+ } else {
+ currentRange.start = { col: startCol, row: startRow };
+ currentRange.end = { col: endCol, row: endRow };
+ }
+ } else if (state.select.headerSelectMode !== 'cell' && table.isSeriesNumberInBody(col, row)) {
+ const startCol = Math.min(currentRange.start.col, currentRange.end.col, col);
+ const endCol = table.colCount - 1;
+ const startRow = Math.min(currentRange.start.row, currentRange.end.row, row);
+ const endRow = Math.max(currentRange.start.row, currentRange.end.row, row);
+ if (state.select.headerSelectMode === 'body') {
+ currentRange.start = { col: table.leftRowSeriesNumberCount, row: startRow };
+ currentRange.end = { col: table.colCount - 1, row: endRow };
+ } else {
+ currentRange.start = { col: startCol, row: startRow };
+ currentRange.end = { col: endCol, row: endRow };
+ }
} else {
currentRange.end = { col, row };
}
@@ -146,35 +167,94 @@ export function updateSelectPosition(
if (state.select.headerSelectMode !== 'cell' && table.isColumnHeader(col, row)) {
// 选中行表头
const cellRange = table.getCellRange(col, row);
- state.select.ranges.push({
- start: { col: cellRange.start.col, row },
- end: { col: cellRange.end.col, row: table.rowCount - 1 },
- skipBodyMerge: true
- });
+ if (state.select.headerSelectMode === 'body') {
+ state.select.ranges.push({
+ start: { col: cellRange.start.col, row: table.columnHeaderLevelCount },
+ end: { col: cellRange.end.col, row: table.rowCount - 1 },
+ skipBodyMerge: true
+ });
+ } else {
+ state.select.ranges.push({
+ start: { col: cellRange.start.col, row },
+ end: { col: cellRange.end.col, row: table.rowCount - 1 },
+ skipBodyMerge: true
+ });
+ }
} else if (state.select.headerSelectMode !== 'cell' && table.isRowHeader(col, row)) {
// 选中列表头
const cellRange = table.getCellRange(col, row);
- state.select.ranges.push({
- start: { col, row: cellRange.start.row },
- end: { col: table.colCount - 1, row: cellRange.end.row },
- skipBodyMerge: true
- });
+ if (state.select.headerSelectMode === 'body') {
+ state.select.ranges.push({
+ start: { col: table.rowHeaderLevelCount + table.leftRowSeriesNumberCount, row: cellRange.start.row },
+ end: { col: table.colCount - 1, row: cellRange.end.row },
+ skipBodyMerge: true
+ });
+ } else {
+ state.select.ranges.push({
+ start: { col, row: cellRange.start.row },
+ end: { col: table.colCount - 1, row: cellRange.end.row },
+ skipBodyMerge: true
+ });
+ }
} else if ((table.internalProps.layoutMap as SimpleHeaderLayoutMap).isSeriesNumberInHeader(col, row)) {
// 选中表头行号单元格
extendSelectRange = false;
- state.select.ranges.push({
- start: { col: 0, row: 0 },
- end: { col: table.colCount - 1, row: table.rowCount - 1 },
- skipBodyMerge: true
- });
+
+ if (state.select.headerSelectMode === 'body') {
+ state.select.ranges.push({
+ start: {
+ col: table.leftRowSeriesNumberCount,
+ row: table.columnHeaderLevelCount
+ },
+ end: { col: table.colCount - 1, row: table.rowCount - 1 },
+ skipBodyMerge: true
+ });
+ } else {
+ state.select.ranges.push({
+ start: { col: 0, row: 0 },
+ end: { col: table.colCount - 1, row: table.rowCount - 1 },
+ skipBodyMerge: true
+ });
+ }
} else if ((table.internalProps.layoutMap as SimpleHeaderLayoutMap).isSeriesNumberInBody(col, row)) {
// 选中内容行号单元格
extendSelectRange = false;
- state.select.ranges.push({
- start: { col, row: row },
- end: { col: table.colCount - 1, row: row },
- skipBodyMerge: true
- });
+ if (state.select.headerSelectMode === 'body') {
+ state.select.ranges.push({
+ start: {
+ col: table.leftRowSeriesNumberCount,
+ row
+ },
+ end: { col: table.colCount - 1, row: row },
+ skipBodyMerge: true
+ });
+ } else {
+ state.select.ranges.push({
+ start: { col, row },
+ end: { col: table.colCount - 1, row: row },
+ skipBodyMerge: true
+ });
+ }
+ } else if ((table.internalProps.layoutMap as SimpleHeaderLayoutMap).isCornerHeader(col, row)) {
+ // 选中表头行号单元格
+ extendSelectRange = false;
+
+ if (state.select.headerSelectMode === 'body') {
+ state.select.ranges.push({
+ start: {
+ col: table.rowHeaderLevelCount + table.leftRowSeriesNumberCount,
+ row: table.columnHeaderLevelCount
+ },
+ end: { col: table.colCount - 1, row: table.rowCount - 1 },
+ skipBodyMerge: true
+ });
+ } else {
+ state.select.ranges.push({
+ start: { col: 0, row: 0 },
+ end: { col: table.colCount - 1, row: table.rowCount - 1 },
+ skipBodyMerge: true
+ });
+ }
} else if (col >= 0 && row >= 0) {
// 选中普通单元格
const cellRange = skipBodyMerge ? { start: { col, row }, end: { col, row } } : table.getCellRange(col, row);
@@ -279,7 +359,6 @@ export function updateSelectPosition(
col,
row
};
-
const cellRange = skipBodyMerge ? { start: { col, row }, end: { col, row } } : table.getCellRange(col, row);
if (currentRange.start.col < cellRange.end.col) {
currentRange.end.col = cellRange.end.col;
@@ -293,6 +372,28 @@ export function updateSelectPosition(
currentRange.end.row = cellRange.start.row;
}
+ if (state.select.headerSelectMode === 'body') {
+ if (table.isRowHeader(col, row)) {
+ currentRange.start.col = table.rowHeaderLevelCount + table.leftRowSeriesNumberCount;
+ currentRange.end.col = table.colCount - 1;
+ } else if (table.isColumnHeader(col, row)) {
+ currentRange.start.row = table.columnHeaderLevelCount;
+ currentRange.end.row = table.rowCount - 1;
+ } else if ((table.internalProps.layoutMap as SimpleHeaderLayoutMap).isSeriesNumberInBody(col, row)) {
+ currentRange.start.col = table.leftRowSeriesNumberCount;
+ currentRange.end.col = table.colCount - 1;
+ } else if (table.isCornerHeader(col, row)) {
+ currentRange.start.col = table.rowHeaderLevelCount + table.leftRowSeriesNumberCount;
+ currentRange.start.row = table.columnHeaderLevelCount;
+ currentRange.end.col = table.colCount - 1;
+ currentRange.end.row = table.rowCount - 1;
+ } else if (table.isSeriesNumber(col, row)) {
+ currentRange.start.col = table.leftRowSeriesNumberCount;
+ currentRange.start.row = table.columnHeaderLevelCount;
+ currentRange.end.col = table.colCount - 1;
+ currentRange.end.row = table.rowCount - 1;
+ }
+ }
if (skipBodyMerge) {
currentRange.skipBodyMerge = true;
}
diff --git a/packages/vtable/src/state/state.ts b/packages/vtable/src/state/state.ts
index d6603bffa..57aa001f9 100644
--- a/packages/vtable/src/state/state.ts
+++ b/packages/vtable/src/state/state.ts
@@ -72,8 +72,12 @@ export class StateManager {
// cellPosEnd: CellPosition;
singleStyle?: boolean; // select当前单元格是否使用单独样式
disableHeader?: boolean; // 是否禁用表头select
- /** 点击表头单元格时连带body整行或整列选中 或仅选中当前单元格,默认或整行或整列选中*/
- headerSelectMode?: 'inline' | 'cell';
+ /** 点击表头单元格效果
+ * 'inline': 点击行表头则整行选中,选择列表头则整列选中;
+ * 'cell': 仅仅选择当前点击的表头单元格;
+ * 'body': 不选择表头,点击行表头则选择该行所有 body 单元格,点击列表头则选择该列所有 body 单元格。
+ */
+ headerSelectMode?: 'inline' | 'cell' | 'body';
selecting: boolean;
};
fillHandle: {
diff --git a/packages/vtable/src/ts-types/base-table.ts b/packages/vtable/src/ts-types/base-table.ts
index 73a1f9198..5a2bc0aff 100644
--- a/packages/vtable/src/ts-types/base-table.ts
+++ b/packages/vtable/src/ts-types/base-table.ts
@@ -357,8 +357,12 @@ export interface BaseTableConstructorOptions {
select?: {
/** 高亮范围模式:十字交叉 整列 整行 或者单个单元格。默认`cell` */
highlightMode?: 'cross' | 'column' | 'row' | 'cell';
- /** 点击表头单元格时连带body整行或整列选中 或仅选中当前单元格,默认或整行或整列选中*/
- headerSelectMode?: 'inline' | 'cell';
+ /** 点击表头单元格效果
+ * 'inline': 点击行表头则整行选中,选择列表头则整列选中;
+ * 'cell': 仅仅选择当前点击的表头单元格;
+ * 'body': 不选择表头,点击行表头则选择该行所有 body 单元格,点击列表头则选择该列所有 body 单元格。
+ */
+ headerSelectMode?: 'inline' | 'cell' | 'body';
/** 不响应鼠标select交互 */
disableSelect?: boolean;
/** 单独设置表头不响应鼠标select交互 */
diff --git a/packages/vtable/src/ts-types/list-table/define/basic-define.ts b/packages/vtable/src/ts-types/list-table/define/basic-define.ts
index f2328514f..565570249 100644
--- a/packages/vtable/src/ts-types/list-table/define/basic-define.ts
+++ b/packages/vtable/src/ts-types/list-table/define/basic-define.ts
@@ -25,8 +25,6 @@ export interface IBasicHeaderDefine {
showSort?: boolean;
/** 该列不支持hover交互行为 */
disableHover?: boolean;
- // /** 点击表头单元格时连带body整行或整列选中 或仅选中当前单元格,默认或整行或整列选中*/
- // headerSelectMode?: 'inline' | 'cell';
/** 该列不支持选中 */
disableSelect?: boolean;
/** 该列表头不支持hover交互行为 */
diff --git a/packages/vtable/src/ts-types/pivot-table/dimension/basic-dimension.ts b/packages/vtable/src/ts-types/pivot-table/dimension/basic-dimension.ts
index 4e5379a1e..4953f2829 100644
--- a/packages/vtable/src/ts-types/pivot-table/dimension/basic-dimension.ts
+++ b/packages/vtable/src/ts-types/pivot-table/dimension/basic-dimension.ts
@@ -59,8 +59,6 @@ export interface IBasicDimension {
*/
cornerDescription?: string;
- // /** 点击表头单元格时连带body整行或整列选中 或仅选中当前单元格,默认或整行或整列选中*/
- // headerSelectMode?: 'inline' | 'cell';
/** 该维度单元格不支持hover交互行为 */
disableHeaderHover?: boolean;
/** 该维度单元格不支持选中 */
diff --git a/packages/vtable/src/ts-types/pivot-table/indicator/basic-indicator.ts b/packages/vtable/src/ts-types/pivot-table/indicator/basic-indicator.ts
index c0ca9628a..e7e0248dc 100644
--- a/packages/vtable/src/ts-types/pivot-table/indicator/basic-indicator.ts
+++ b/packages/vtable/src/ts-types/pivot-table/indicator/basic-indicator.ts
@@ -36,8 +36,6 @@ export interface IBasicHeaderIndicator {
headerCustomLayout?: ICustomLayout;
editor?: string | IEditor | ((args: BaseCellInfo & { table: BaseTableAPI }) => string | IEditor);
- // /** 点击表头单元格时连带body整行或整列选中 或仅选中当前单元格,默认或整行或整列选中*/
- // headerSelectMode?: 'inline' | 'cell';
/** 该指标表头单元格不支持hover交互行为 */
disableHeaderHover?: boolean;
/** 该指标表头单元格不支持选中 */
From 8adead0b5cff23c02c286e5c692823b71b7037f9 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Tue, 22 Oct 2024 17:28:04 +0800
Subject: [PATCH 13/65] docs: update changlog of rush
---
.../2491-feature-justSelectBody_2024-10-22-09-28.json | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 common/changes/@visactor/vtable/2491-feature-justSelectBody_2024-10-22-09-28.json
diff --git a/common/changes/@visactor/vtable/2491-feature-justSelectBody_2024-10-22-09-28.json b/common/changes/@visactor/vtable/2491-feature-justSelectBody_2024-10-22-09-28.json
new file mode 100644
index 000000000..53d7edb33
--- /dev/null
+++ b/common/changes/@visactor/vtable/2491-feature-justSelectBody_2024-10-22-09-28.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "feat: headerSelectMode option add body setting #2491\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
From 6851b4c606fb3323940a6ae29269f08996e9dc0a Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Wed, 23 Oct 2024 12:10:46 +0800
Subject: [PATCH 14/65] fix: isColumnHeader api judement logic #2491
---
packages/vtable/src/layout/pivot-header-layout.ts | 6 +++++-
packages/vtable/src/state/select/update-position.ts | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/packages/vtable/src/layout/pivot-header-layout.ts b/packages/vtable/src/layout/pivot-header-layout.ts
index 801c9fa0b..8bdcdaa53 100644
--- a/packages/vtable/src/layout/pivot-header-layout.ts
+++ b/packages/vtable/src/layout/pivot-header-layout.ts
@@ -1224,7 +1224,11 @@ export class PivotHeaderLayoutMap implements LayoutMapAPI {
return false;
}
isColumnHeader(col: number, row: number): boolean {
- if (col >= this.rowHeaderLevelCount && row >= 0 && row < this.columnHeaderLevelCount) {
+ if (
+ col >= this.rowHeaderLevelCount + this.leftRowSeriesNumberColumnCount &&
+ row >= 0 &&
+ row < this.columnHeaderLevelCount
+ ) {
return true;
}
return false;
diff --git a/packages/vtable/src/state/select/update-position.ts b/packages/vtable/src/state/select/update-position.ts
index f81884185..f9c64b165 100644
--- a/packages/vtable/src/state/select/update-position.ts
+++ b/packages/vtable/src/state/select/update-position.ts
@@ -250,7 +250,7 @@ export function updateSelectPosition(
});
} else {
state.select.ranges.push({
- start: { col: 0, row: 0 },
+ start: { col: table.leftRowSeriesNumberCount, row: 0 },
end: { col: table.colCount - 1, row: table.rowCount - 1 },
skipBodyMerge: true
});
From 33277fc430d04d25294eb9a1aaf75520d673da7f Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Wed, 23 Oct 2024 12:12:28 +0800
Subject: [PATCH 15/65] docs: update changlog of rush
---
.../2491-feature-justSelectBody_2024-10-23-04-12.json | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 common/changes/@visactor/vtable/2491-feature-justSelectBody_2024-10-23-04-12.json
diff --git a/common/changes/@visactor/vtable/2491-feature-justSelectBody_2024-10-23-04-12.json b/common/changes/@visactor/vtable/2491-feature-justSelectBody_2024-10-23-04-12.json
new file mode 100644
index 000000000..5b20e4f14
--- /dev/null
+++ b/common/changes/@visactor/vtable/2491-feature-justSelectBody_2024-10-23-04-12.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "fix: isColumnHeader api judement logic #2491\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
From 2e7e89f1c0f1fed18c6f4477642c7ce209bf2d96 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Wed, 23 Oct 2024 17:35:58 +0800
Subject: [PATCH 16/65] fix: rowSeriesNumber when be frozen can render
customlayout #2653
---
.../src/scenegraph/group-creater/column-helper.ts | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/packages/vtable/src/scenegraph/group-creater/column-helper.ts b/packages/vtable/src/scenegraph/group-creater/column-helper.ts
index 6ee045909..b47473d76 100644
--- a/packages/vtable/src/scenegraph/group-creater/column-helper.ts
+++ b/packages/vtable/src/scenegraph/group-creater/column-helper.ts
@@ -131,10 +131,16 @@ export function createComplexColumn(
) {
cellLocation = 'body';
}
- const define =
- cellLocation !== 'body'
- ? table.getHeaderDefine(colForDefine, rowForDefine)
- : table.getBodyColumnDefine(colForDefine, rowForDefine);
+ let define;
+ if (!table.isPivotTable() && table.isSeriesNumberInBody(col, row)) {
+ // 序号列 传入的cellLocation是'rowHeader'(不清楚为什么)。这里处理下获取到的define值
+ define = table.getBodyColumnDefine(colForDefine, rowForDefine);
+ } else {
+ define =
+ cellLocation !== 'body'
+ ? table.getHeaderDefine(colForDefine, rowForDefine)
+ : table.getBodyColumnDefine(colForDefine, rowForDefine);
+ }
let mayHaveIcon =
cellLocation !== 'body'
? true
From a98dcb52146e4155789dfb59b644fa3fe850d980 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Wed, 23 Oct 2024 17:36:29 +0800
Subject: [PATCH 17/65] docs: update changlog of rush
---
...ozencolcount-rowseriesnumber_2024-10-23-09-36.json | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 common/changes/@visactor/vtable/2653-bug-frozencolcount-rowseriesnumber_2024-10-23-09-36.json
diff --git a/common/changes/@visactor/vtable/2653-bug-frozencolcount-rowseriesnumber_2024-10-23-09-36.json b/common/changes/@visactor/vtable/2653-bug-frozencolcount-rowseriesnumber_2024-10-23-09-36.json
new file mode 100644
index 000000000..fb53413c7
--- /dev/null
+++ b/common/changes/@visactor/vtable/2653-bug-frozencolcount-rowseriesnumber_2024-10-23-09-36.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "fix: rowSeriesNumber when be frozen can render customlayout #2653\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
From 3fed01a626507d5100f143fc0ec4ae371eadca38 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Mon, 28 Oct 2024 17:12:04 +0800
Subject: [PATCH 18/65] refactor: custom merge cell ignore check state jude
#2683
---
.../vtable/src/event/listener/table-group.ts | 6 ++-
.../vtable/src/state/checkbox/checkbox.ts | 37 ++++++++++++++-----
packages/vtable/src/state/state.ts | 4 +-
packages/vtable/src/ts-types/table-engine.ts | 1 +
4 files changed, 36 insertions(+), 12 deletions(-)
diff --git a/packages/vtable/src/event/listener/table-group.ts b/packages/vtable/src/event/listener/table-group.ts
index b61f21579..1481b28c8 100644
--- a/packages/vtable/src/event/listener/table-group.ts
+++ b/packages/vtable/src/event/listener/table-group.ts
@@ -947,7 +947,11 @@ export function bindTableGroupListener(eventManager: EventManager) {
const cellType = table.getCellType(col, row);
if (cellType === 'checkbox') {
const oldHeaderCheckedState = table.stateManager.headerCheckedState[cellInfo.field as string | number];
- const newHeaderCheckedState = table.stateManager.updateHeaderCheckedState(cellInfo.field as string | number);
+ const newHeaderCheckedState = table.stateManager.updateHeaderCheckedState(
+ cellInfo.field as string | number,
+ col,
+ row
+ );
if (oldHeaderCheckedState !== newHeaderCheckedState) {
table.scenegraph.updateHeaderCheckboxCellState(col, row, newHeaderCheckedState);
}
diff --git a/packages/vtable/src/state/checkbox/checkbox.ts b/packages/vtable/src/state/checkbox/checkbox.ts
index 1a8f3f741..48dd5bec5 100644
--- a/packages/vtable/src/state/checkbox/checkbox.ts
+++ b/packages/vtable/src/state/checkbox/checkbox.ts
@@ -1,6 +1,6 @@
import { isArray, isObject, isValid } from '@visactor/vutils';
import type { StateManager } from '../state';
-import type { CheckboxColumnDefine } from '../../ts-types';
+import type { CheckboxColumnDefine, ListTableAPI } from '../../ts-types';
import { getOrApply } from '../../tools/helper';
import type { BaseTableAPI } from '../../ts-types/base-table';
import type { CheckBox } from '@visactor/vrender-components';
@@ -57,7 +57,7 @@ export function syncCheckedState(
} else if (isValid(checked)) {
state.headerCheckedState[field] = checked;
} else if (state.checkedState?.length > 0) {
- const isAllChecked = state.updateHeaderCheckedState(field);
+ const isAllChecked = state.updateHeaderCheckedState(field, col, row);
return isAllChecked;
}
return state.headerCheckedState[field];
@@ -149,23 +149,42 @@ export function initCheckedState(records: any[], state: StateManager) {
* @param field
* @returns
*/
-export function updateHeaderCheckedState(field: string | number, state: StateManager): boolean | 'indeterminate' {
- const allChecked = state.checkedState.every((state: Record) => {
- return state[field] === true;
+export function updateHeaderCheckedState(
+ field: string | number,
+ state: StateManager,
+ col: number,
+ row: number
+): boolean | 'indeterminate' {
+ const allChecked = state.checkedState.every((check_state: Record, index: number) => {
+ const tableIndex = state.table.getTableIndexByRecordIndex(index);
+ const mergeCell = (state.table as ListTableAPI).transpose
+ ? state.table.getCustomMerge(tableIndex, row)
+ : state.table.getCustomMerge(col, tableIndex);
+ if (mergeCell) {
+ return true;
+ }
+ return check_state[field] === true;
});
if (allChecked) {
state.headerCheckedState[field] = true;
return allChecked;
}
- const allUnChecked = state.checkedState.every((state: Record) => {
- return state[field] === false;
+ const allUnChecked = state.checkedState.every((check_state: Record, index: number) => {
+ const tableIndex = state.table.getTableIndexByRecordIndex(index);
+ const mergeCell = (state.table as ListTableAPI).transpose
+ ? state.table.getCustomMerge(tableIndex, row)
+ : state.table.getCustomMerge(col, tableIndex);
+ if (mergeCell) {
+ return true;
+ }
+ return check_state[field] === false;
});
if (allUnChecked) {
state.headerCheckedState[field] = false;
return false;
}
- const hasChecked = state.checkedState.find((state: Record) => {
- return state[field] === true;
+ const hasChecked = state.checkedState.find((check_state: Record) => {
+ return check_state?.[field] === true;
});
if (hasChecked) {
state.headerCheckedState[field] = 'indeterminate';
diff --git a/packages/vtable/src/state/state.ts b/packages/vtable/src/state/state.ts
index 369e8c5a0..dd039f265 100644
--- a/packages/vtable/src/state/state.ts
+++ b/packages/vtable/src/state/state.ts
@@ -1513,8 +1513,8 @@ export class StateManager {
* @param field
* @returns
*/
- updateHeaderCheckedState(field: string | number): boolean | 'indeterminate' {
- return updateHeaderCheckedState(field, this);
+ updateHeaderCheckedState(field: string | number, col: number, row: number): boolean | 'indeterminate' {
+ return updateHeaderCheckedState(field, this, col, row);
}
/**
* setRecords的时候虽然调用了initCheckedState 进行了初始化 但当每个表头的checked状态都用配置了的话 初始化不会遍历全部数据
diff --git a/packages/vtable/src/ts-types/table-engine.ts b/packages/vtable/src/ts-types/table-engine.ts
index 287cae6f4..bf3da7fca 100644
--- a/packages/vtable/src/ts-types/table-engine.ts
+++ b/packages/vtable/src/ts-types/table-engine.ts
@@ -273,6 +273,7 @@ export type GroupConfig = {
};
export interface ListTableAPI extends BaseTableAPI {
+ transpose: boolean;
options: ListTableConstructorOptions;
editorManager: EditManeger;
sortState: SortState[] | SortState | null;
From 9ca4182cc89d561a300eda90482ce54467dbf58a Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Mon, 28 Oct 2024 17:15:44 +0800
Subject: [PATCH 19/65] docs: update changlog of rush
---
...actor-customMerge-checkState_2024-10-28-09-15.json | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 common/changes/@visactor/vtable/2683-refactor-customMerge-checkState_2024-10-28-09-15.json
diff --git a/common/changes/@visactor/vtable/2683-refactor-customMerge-checkState_2024-10-28-09-15.json b/common/changes/@visactor/vtable/2683-refactor-customMerge-checkState_2024-10-28-09-15.json
new file mode 100644
index 000000000..5f6e1e398
--- /dev/null
+++ b/common/changes/@visactor/vtable/2683-refactor-customMerge-checkState_2024-10-28-09-15.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "refactor: custom merge cell ignore check state jude #2683\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
From da2357e3c2b311af70bbbbacfca80259d5d19ced Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Tue, 29 Oct 2024 13:59:56 +0800
Subject: [PATCH 20/65] refactor: paste cell value should use editor
validateValidate api #2691
---
packages/vtable-editors/src/types.ts | 4 +++-
packages/vtable/src/core/record-helper.ts | 21 ++++++++++++++++++++-
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/packages/vtable-editors/src/types.ts b/packages/vtable-editors/src/types.ts
index 71328f065..b0615db3f 100644
--- a/packages/vtable-editors/src/types.ts
+++ b/packages/vtable-editors/src/types.ts
@@ -27,8 +27,10 @@ export interface IEditor {
/**
* Before set new value to table, use it to validate value.
* If the interface returns true, the value takes effect; otherwise, it does not take effect.
+ * @param newValue new value to be set. If not provided, the current input element value will be used.
+ * @param oldValue old value of the cell.
*/
- validateValue?: () => boolean | Promise;
+ validateValue?: (newValue?: V, oldValue?: V) => boolean | Promise;
/**
* Called when editor mode is exited by any means.
* Expected to return the current value of the cell.
diff --git a/packages/vtable/src/core/record-helper.ts b/packages/vtable/src/core/record-helper.ts
index 10a514639..a7b932a0b 100644
--- a/packages/vtable/src/core/record-helper.ts
+++ b/packages/vtable/src/core/record-helper.ts
@@ -3,6 +3,7 @@ import type { ListTable } from '../ListTable';
import type { CachedDataSource } from '../data';
import { computeColWidth } from '../scenegraph/layout/compute-col-width';
import { computeRowHeight } from '../scenegraph/layout/compute-row-height';
+import { isPromise } from '../tools/helper';
import { defaultOrderFn } from '../tools/util';
import type { SortState } from '../ts-types';
import { TABLE_EVENT_TYPE } from './TABLE_EVENT_TYPE';
@@ -154,7 +155,25 @@ export function listTableChangeCellValues(
break;
}
thisRowPasteColEnd = startCol + j;
- if ((workOnEditableCell && table.isHasEditorDefine(startCol + j, startRow + i)) || workOnEditableCell === false) {
+ let isCanChange = false;
+ if (workOnEditableCell === false) {
+ isCanChange = true;
+ } else {
+ if (table.isHasEditorDefine(startCol + j, startRow + i)) {
+ const editor = table.getEditor(startCol + j, startRow + i);
+ const oldValue = oldValues[i][j];
+ const value = rowValues[j];
+ const maybePromiseOrValue = editor.validateValue(value, oldValue);
+ if (isPromise(maybePromiseOrValue)) {
+ //TODO 处理promise的情况
+ isCanChange = true;
+ } else {
+ isCanChange = maybePromiseOrValue;
+ }
+ }
+ }
+ // if ((workOnEditableCell && table.isHasEditorDefine(startCol + j, startRow + i)) || workOnEditableCell === false) {
+ if (isCanChange) {
const value = rowValues[j];
const recordIndex = table.getRecordShowIndexByCell(startCol + j, startRow + i);
const { field } = table.internalProps.layoutMap.getBody(startCol + j, startRow + i);
From e388733a4b1d8f1f6f01c2bd81fbc6d7f2a1587c Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Tue, 29 Oct 2024 14:41:34 +0800
Subject: [PATCH 21/65] docs: update changlog of rush
---
...91-paste-cell-value-validate_2024-10-29-06-41.json | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 common/changes/@visactor/vtable/2691-paste-cell-value-validate_2024-10-29-06-41.json
diff --git a/common/changes/@visactor/vtable/2691-paste-cell-value-validate_2024-10-29-06-41.json b/common/changes/@visactor/vtable/2691-paste-cell-value-validate_2024-10-29-06-41.json
new file mode 100644
index 000000000..3f7747ecd
--- /dev/null
+++ b/common/changes/@visactor/vtable/2691-paste-cell-value-validate_2024-10-29-06-41.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "refactor: paste cell value should use editor validateValidate api #2691\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
From 0d706b303c7dc54c71e7ce22fac76030a30d9b7b Mon Sep 17 00:00:00 2001
From: wangjing
Date: Tue, 29 Oct 2024 16:17:25 +0800
Subject: [PATCH 22/65] feat: contextMenuItems add table params
---
docs/assets/option/en/common/option-secondary.md | 2 +-
docs/assets/option/zh/common/option-secondary.md | 2 +-
.../src/components/component/menu.tsx | 5 ++++-
.../src/table-components/component/menu.tsx | 5 ++++-
packages/vtable/examples/list/list-title.ts | 15 +++++++++++++++
.../vtable/src/components/menu/dom/MenuHandler.ts | 8 +++++++-
packages/vtable/src/ts-types/base-table.ts | 8 ++++++--
7 files changed, 38 insertions(+), 7 deletions(-)
diff --git a/docs/assets/option/en/common/option-secondary.md b/docs/assets/option/en/common/option-secondary.md
index 0ffa6606d..8c92e285d 100644
--- a/docs/assets/option/en/common/option-secondary.md
+++ b/docs/assets/option/en/common/option-secondary.md
@@ -260,7 +260,7 @@ Global settings for built-in drop-down menus, type is `MenuListItem[]`. Currentl
Right-click menu. Declaration type:
```
-MenuListItem[] | ((field: string, row: number) => MenuListItem[]);
+MenuListItem[] | ((field: string, row: number, col: number, table?: BaseTableAPI) => MenuListItem[]);
```
{{ use: common-menu-list-item() }}
diff --git a/docs/assets/option/zh/common/option-secondary.md b/docs/assets/option/zh/common/option-secondary.md
index 92ff1018d..c7fdeb7cf 100644
--- a/docs/assets/option/zh/common/option-secondary.md
+++ b/docs/assets/option/zh/common/option-secondary.md
@@ -254,7 +254,7 @@ menu 渲染方式,html 目前实现较完整,先默认使用 html 渲染方
右键菜单。声明类型:
```
-MenuListItem[] | ((field: string, row: number) => MenuListItem[]);
+MenuListItem[] | ((field: string, row: number, col: number, table?: BaseTableAPI) => MenuListItem[]);
```
{{ use: common-menu-list-item() }}
diff --git a/packages/openinula-vtable/src/components/component/menu.tsx b/packages/openinula-vtable/src/components/component/menu.tsx
index 282e09123..af27cad71 100644
--- a/packages/openinula-vtable/src/components/component/menu.tsx
+++ b/packages/openinula-vtable/src/components/component/menu.tsx
@@ -1,3 +1,4 @@
+import type { BaseTable } from '@visactor/vtable/src/core';
import type { BaseComponentProps } from '../base-component';
import { createComponent } from '../base-component';
import type { TYPES } from '@visactor/vtable';
@@ -8,7 +9,9 @@ export type MenuProps = {
/** 内置下拉菜单的全局设置项 目前只针对基本表格有效 会对每个表头单元格开启默认的下拉菜单功能。代替原来的option.dropDownMenu*/
defaultHeaderMenuItems?: TYPES.MenuListItem[];
/** 右键菜单。代替原来的option.contextmenu */
- contextMenuItems?: TYPES.MenuListItem[] | ((field: string, row: number, col: number) => TYPES.MenuListItem[]);
+ contextMenuItems?:
+ | TYPES.MenuListItem[]
+ | ((field: string, row: number, col: number, table?: BaseTable) => TYPES.MenuListItem[]);
/** 设置选中状态的菜单。代替原来的option.dropDownMenuHighlight */
dropDownMenuHighlight?: TYPES.DropDownMenuHighlightInfo[];
} & BaseComponentProps;
diff --git a/packages/react-vtable/src/table-components/component/menu.tsx b/packages/react-vtable/src/table-components/component/menu.tsx
index 282e09123..af27cad71 100644
--- a/packages/react-vtable/src/table-components/component/menu.tsx
+++ b/packages/react-vtable/src/table-components/component/menu.tsx
@@ -1,3 +1,4 @@
+import type { BaseTable } from '@visactor/vtable/src/core';
import type { BaseComponentProps } from '../base-component';
import { createComponent } from '../base-component';
import type { TYPES } from '@visactor/vtable';
@@ -8,7 +9,9 @@ export type MenuProps = {
/** 内置下拉菜单的全局设置项 目前只针对基本表格有效 会对每个表头单元格开启默认的下拉菜单功能。代替原来的option.dropDownMenu*/
defaultHeaderMenuItems?: TYPES.MenuListItem[];
/** 右键菜单。代替原来的option.contextmenu */
- contextMenuItems?: TYPES.MenuListItem[] | ((field: string, row: number, col: number) => TYPES.MenuListItem[]);
+ contextMenuItems?:
+ | TYPES.MenuListItem[]
+ | ((field: string, row: number, col: number, table?: BaseTable) => TYPES.MenuListItem[]);
/** 设置选中状态的菜单。代替原来的option.dropDownMenuHighlight */
dropDownMenuHighlight?: TYPES.DropDownMenuHighlightInfo[];
} & BaseComponentProps;
diff --git a/packages/vtable/examples/list/list-title.ts b/packages/vtable/examples/list/list-title.ts
index 9efd89f39..1798fae8a 100644
--- a/packages/vtable/examples/list/list-title.ts
+++ b/packages/vtable/examples/list/list-title.ts
@@ -1,4 +1,5 @@
import * as VTable from '../../src';
+import type { BaseTableAPI } from '../../src/ts-types/base-table';
const CONTAINER_ID = 'vTable';
const generatePersons = count => {
return Array.from(new Array(count)).map((_, i) => ({
@@ -132,6 +133,20 @@ export function createTable() {
position: 'start',
maxRow: 1,
padding: [50, 0, 0, 0]
+ },
+ menu: {
+ contextMenuItems: (field: string, row: number, col: number, table: BaseTableAPI) => {
+ if (row === 0) {
+ return [];
+ }
+ const data = table.getCellOriginRecord(col, row);
+ if (data.id === 1) {
+ return ['复制', '粘贴', '删除'];
+ } else if (data.id === 3) {
+ return [];
+ }
+ return ['复制', '粘贴'];
+ }
}
};
const tableInstance = new VTable.ListTable(option);
diff --git a/packages/vtable/src/components/menu/dom/MenuHandler.ts b/packages/vtable/src/components/menu/dom/MenuHandler.ts
index 5e4cbb349..a6f04d50f 100644
--- a/packages/vtable/src/components/menu/dom/MenuHandler.ts
+++ b/packages/vtable/src/components/menu/dom/MenuHandler.ts
@@ -206,10 +206,16 @@ export class MenuHandler {
const abstractPos = table._getMouseAbstractPoint(e.event, false);
let menu = null;
if (abstractPos.inTable && typeof table.internalProps.menu?.contextMenuItems === 'function') {
- menu = table.internalProps.menu.contextMenuItems(table.getHeaderField(e.col, e.row) as string, e.row, e.col);
+ menu = table.internalProps.menu.contextMenuItems(
+ table.getHeaderField(e.col, e.row) as string,
+ e.row,
+ e.col,
+ table
+ );
} else if (abstractPos.inTable && Array.isArray(table.internalProps.menu?.contextMenuItems)) {
menu = table.internalProps.menu?.contextMenuItems;
}
+
this._bindToCell(e.col, e.row, 'context-menu', {
content: menu,
position: { x: abstractPos.x, y: abstractPos.y }
diff --git a/packages/vtable/src/ts-types/base-table.ts b/packages/vtable/src/ts-types/base-table.ts
index 73a1f9198..4f54b38c5 100644
--- a/packages/vtable/src/ts-types/base-table.ts
+++ b/packages/vtable/src/ts-types/base-table.ts
@@ -195,7 +195,9 @@ export interface IBaseTableProtected {
/** 内置下拉菜单的全局设置项 目前只针对基本表格有效 会对每个表头单元格开启默认的下拉菜单功能。代替原来的option.dropDownMenu*/
defaultHeaderMenuItems?: MenuListItem[];
/** 右键菜单。代替原来的option.contextmenu */
- contextMenuItems?: MenuListItem[] | ((field: FieldDef, row: number, col: number) => MenuListItem[]);
+ contextMenuItems?:
+ | MenuListItem[]
+ | ((field: FieldDef, row: number, col: number, table?: BaseTableAPI) => MenuListItem[]);
/** 设置选中状态的菜单。代替原来的option.dropDownMenuHighlight */
dropDownMenuHighlight?: DropDownMenuHighlightInfo[];
};
@@ -377,7 +379,9 @@ export interface BaseTableConstructorOptions {
/** 内置下拉菜单的全局设置项 目前只针对基本表格有效 会对每个表头单元格开启默认的下拉菜单功能。代替原来的option.dropDownMenu*/
defaultHeaderMenuItems?: MenuListItem[];
/** 右键菜单。代替原来的option.contextmenu */
- contextMenuItems?: MenuListItem[] | ((field: string, row: number, col: number) => MenuListItem[]);
+ contextMenuItems?:
+ | MenuListItem[]
+ | ((field: string, row: number, col: number, table?: BaseTableAPI) => MenuListItem[]);
/** 设置选中状态的菜单。代替原来的option.dropDownMenuHighlight */
dropDownMenuHighlight?: DropDownMenuHighlightInfo[];
};
From 2422a9a5a3c3249d4af96b497e3c645b1216dfc8 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Tue, 29 Oct 2024 16:40:45 +0800
Subject: [PATCH 23/65] fix: when has empty tip scrollbar can not be clicked
#2690
---
.../src/components/empty-tip/empty-tip.ts | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/packages/vtable/src/components/empty-tip/empty-tip.ts b/packages/vtable/src/components/empty-tip/empty-tip.ts
index f5a0a55c6..a1719ba76 100644
--- a/packages/vtable/src/components/empty-tip/empty-tip.ts
+++ b/packages/vtable/src/components/empty-tip/empty-tip.ts
@@ -6,6 +6,7 @@ import type { BaseTableAPI } from '../../ts-types/base-table';
import { isEqual } from '@visactor/vutils';
import type { ListTable } from '../../ListTable';
import type { PivotTable } from '../../PivotTable';
+import type { BaseTable } from '../../core';
const emptyTipSvg =
'';
@@ -68,11 +69,16 @@ export class EmptyTip {
const width =
(this.table.columnHeaderLevelCount > 0 && this.table.isListTable()
? this.table.getDrawRange().width
- : this.table.tableNoFrameWidth) - leftHeaderWidth;
+ : this.table.tableNoFrameWidth) -
+ leftHeaderWidth -
+ (this.table as BaseTable).getTheme().scrollStyle.width;
+
const height =
(this.table.rowHeaderLevelCount > 0 && this.table.isListTable()
? this.table.getDrawRange().height
- : this.table.tableNoFrameHeight) - topHeaderHeight;
+ : this.table.tableNoFrameHeight) -
+ topHeaderHeight -
+ (this.table as BaseTable).getTheme().scrollStyle.width;
this._emptyTipComponent.setAttributes({
spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,
x: this.table.tableX + leftHeaderWidth,
@@ -131,11 +137,15 @@ export class EmptyTip {
const width =
(this.table.columnHeaderLevelCount > 0 && this.table.isListTable()
? this.table.getDrawRange().width
- : this.table.tableNoFrameWidth) - leftHeaderWidth;
+ : this.table.tableNoFrameWidth) -
+ leftHeaderWidth -
+ (this.table as BaseTable).getTheme().scrollStyle.width;
const height =
(this.table.rowHeaderLevelCount > 0 && this.table.isListTable()
? this.table.getDrawRange().height
- : this.table.tableNoFrameHeight) - topHeaderHeight;
+ : this.table.tableNoFrameHeight) -
+ topHeaderHeight -
+ (this.table as BaseTable).getTheme().scrollStyle.width;
return {
spaceBetweenTextAndIcon: this._emptyTipOption.spaceBetweenTextAndIcon,
From 32dc839dd8485fb9708d48a2f41f108bc6342d8d Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Tue, 29 Oct 2024 16:44:09 +0800
Subject: [PATCH 24/65] docs: update changlog of rush
---
...bug-emptyTip-ScrollBartoside_2024-10-29-08-44.json | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 common/changes/@visactor/vtable/2690-bug-emptyTip-ScrollBartoside_2024-10-29-08-44.json
diff --git a/common/changes/@visactor/vtable/2690-bug-emptyTip-ScrollBartoside_2024-10-29-08-44.json b/common/changes/@visactor/vtable/2690-bug-emptyTip-ScrollBartoside_2024-10-29-08-44.json
new file mode 100644
index 000000000..1acae8148
--- /dev/null
+++ b/common/changes/@visactor/vtable/2690-bug-emptyTip-ScrollBartoside_2024-10-29-08-44.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "fix: when has empty tip scrollbar can not be clicked #2690\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
From 4bd64139204a6fb8b56654a7d263409d9304129f Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Tue, 29 Oct 2024 18:34:52 +0800
Subject: [PATCH 25/65] =?UTF-8?q?fix:=20when=20field=20set=20array?=
=?UTF-8?q?=EF=BC=8Crecord=20no=20corresponding=20field=EF=BC=8Coccur=20er?=
=?UTF-8?q?ror=20#2702?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
packages/vtable/src/tools/util.ts | 3 +++
1 file changed, 3 insertions(+)
diff --git a/packages/vtable/src/tools/util.ts b/packages/vtable/src/tools/util.ts
index 375126c32..bdaca6522 100644
--- a/packages/vtable/src/tools/util.ts
+++ b/packages/vtable/src/tools/util.ts
@@ -356,6 +356,9 @@ export function getValueByPath(obj: any, paths: string[]) {
let prop;
while ((prop = paths.shift())) {
res = res[prop];
+ if (!res) {
+ break;
+ }
}
return res;
}
From c46397165379ffa656af304ff4061ac711909469 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Tue, 29 Oct 2024 18:35:06 +0800
Subject: [PATCH 26/65] docs: update changlog of rush
---
...02-bug-field-set-array-error_2024-10-29-10-35.json | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 common/changes/@visactor/vtable/2702-bug-field-set-array-error_2024-10-29-10-35.json
diff --git a/common/changes/@visactor/vtable/2702-bug-field-set-array-error_2024-10-29-10-35.json b/common/changes/@visactor/vtable/2702-bug-field-set-array-error_2024-10-29-10-35.json
new file mode 100644
index 000000000..da2c37d14
--- /dev/null
+++ b/common/changes/@visactor/vtable/2702-bug-field-set-array-error_2024-10-29-10-35.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "fix: when field set array,record no corresponding field,occur error #2702\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
From 4248da431d63e76099bf2cfa46acfa0749acb86d Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Wed, 30 Oct 2024 11:47:56 +0800
Subject: [PATCH 27/65] feat: add columnWidthConfig to set width by dimensions
#2696
---
packages/vtable/examples/menu.ts | 4 +
.../examples/pivot/pivot-column-width.ts | 474 ++++++++++++++++++
packages/vtable/src/PivotTable.ts | 15 +
.../scenegraph/layout/compute-col-width.ts | 4 +-
packages/vtable/src/ts-types/base-table.ts | 14 +-
packages/vtable/src/ts-types/table-engine.ts | 5 +
6 files changed, 508 insertions(+), 8 deletions(-)
create mode 100644 packages/vtable/examples/pivot/pivot-column-width.ts
diff --git a/packages/vtable/examples/menu.ts b/packages/vtable/examples/menu.ts
index 40f7d7af6..8afdd7c87 100644
--- a/packages/vtable/examples/menu.ts
+++ b/packages/vtable/examples/menu.ts
@@ -487,6 +487,10 @@ export const menus = [
{
path: 'pivot',
name: 'pivot-extension-bp'
+ },
+ {
+ path: 'pivot',
+ name: 'pivot-column-width'
}
]
},
diff --git a/packages/vtable/examples/pivot/pivot-column-width.ts b/packages/vtable/examples/pivot/pivot-column-width.ts
new file mode 100644
index 000000000..d00e3c796
--- /dev/null
+++ b/packages/vtable/examples/pivot/pivot-column-width.ts
@@ -0,0 +1,474 @@
+import * as VTable from '../../src';
+import { generatePivotDataSource } from '../util/pivot-data';
+const PivotTable = VTable.PivotTable;
+const CONTAINER_ID = 'vTable';
+
+export function createTable() {
+ const option: VTable.PivotTableConstructorOptions = {
+ allowRangePaste: true,
+ columnTree: [
+ {
+ dimensionKey: '地区',
+ //title: '地区',
+ value: '东北22'
+ },
+ {
+ dimensionKey: '地区',
+ //title: '地区',
+ value: '东北',
+ children: [
+ {
+ dimensionKey: '邮寄方式',
+ //title: '邮寄方式',
+ value: '一级',
+ children: [
+ {
+ //title: '指标名称',
+ indicatorKey: '1',
+ value: '销售额'
+ },
+ {
+ //title: '指标名称',
+ indicatorKey: '2',
+ value: '利润'
+ }
+ ]
+ },
+ {
+ dimensionKey: '邮寄方式',
+ //title: '邮寄方式',
+ value: '二级',
+ children: [
+ {
+ //title: '指标名称',
+ indicatorKey: '1',
+ value: '销售额'
+ },
+ {
+ //title: '指标名称',
+ indicatorKey: '2',
+ value: '利润'
+ }
+ ]
+ },
+ {
+ dimensionKey: '邮寄方式',
+ //title: '邮寄方式',
+ value: '三级',
+ children: [
+ {
+ //title: '指标名称',
+ indicatorKey: '1',
+ value: '销售额'
+ },
+ {
+ //title: '指标名称',
+ indicatorKey: '2',
+ value: '利润'
+ }
+ ]
+ }
+ ]
+ },
+ {
+ dimensionKey: '地区',
+ //title: '地区',
+ value: '华北',
+ children: [
+ {
+ dimensionKey: '邮寄方式',
+ //title: '邮寄方式',
+ value: '一级',
+ children: [
+ {
+ //title: '指标名称',
+ indicatorKey: '1',
+ value: '销售额'
+ },
+ {
+ //title: '指标名称',
+ indicatorKey: '2',
+ value: '利润'
+ }
+ ]
+ },
+ {
+ dimensionKey: '邮寄方式',
+ //title: '邮寄方式',
+ value: '二级',
+ children: [
+ {
+ //title: '指标名称',
+ indicatorKey: '1',
+ value: '销售额'
+ },
+ {
+ //title: '指标名称',
+ indicatorKey: '2',
+ value: '利润'
+ }
+ ]
+ },
+ {
+ dimensionKey: '邮寄方式',
+ //title: '邮寄方式',
+ value: '三级',
+ children: [
+ {
+ //title: '指标名称',
+ indicatorKey: '1',
+ value: '销售额'
+ },
+ {
+ //title: '指标名称',
+ indicatorKey: '2',
+ value: '利润'
+ }
+ ]
+ }
+ ]
+ },
+ {
+ dimensionKey: '地区',
+ //title: '地区',
+ value: '中南',
+ children: [
+ {
+ dimensionKey: '邮寄方式',
+ //title: '邮寄方式',
+ value: '一级',
+ children: [
+ {
+ //title: '指标名称',
+ indicatorKey: '1',
+ value: '销售额'
+ },
+ {
+ //title: '指标名称',
+ indicatorKey: '2',
+ value: '利润'
+ }
+ ]
+ },
+ {
+ dimensionKey: '邮寄方式',
+ //title: '邮寄方式',
+ value: '二级',
+ children: [
+ {
+ //title: '指标名称',
+ indicatorKey: '1',
+ value: '销售额'
+ },
+ {
+ //title: '指标名称',
+ indicatorKey: '2',
+ value: '利润'
+ }
+ ]
+ },
+ {
+ dimensionKey: '邮寄方式',
+ //title: '邮寄方式',
+ value: '三级',
+ children: [
+ {
+ //title: '指标名称',
+ indicatorKey: '1',
+ value: '销售额'
+ },
+ {
+ //title: '指标名称',
+ indicatorKey: '2',
+ value: '利润'
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ rowTree: [
+ {
+ dimensionKey: '类别',
+ //title: '类别',
+ value: '办公用品',
+ children: [
+ {
+ dimensionKey: '子类别', //title: '子类别',
+ value: '电脑'
+ },
+ {
+ dimensionKey: '子类别',
+ //title: '子类别',
+ value: '装订机'
+ },
+ {
+ dimensionKey: '子类别',
+ //title: '子类别',
+ value: '签字笔'
+ },
+ {
+ dimensionKey: '子类别', //title: '子类别',
+ value: '标签'
+ },
+ {
+ dimensionKey: '子类别',
+ //title: '子类别',
+ value: '收纳柜'
+ },
+ {
+ dimensionKey: '子类别', //title: '子类别',
+ value: '纸张'
+ },
+ {
+ dimensionKey: '子类别', //title: '子类别',
+ value: '电灯'
+ }
+ ]
+ },
+ {
+ dimensionKey: '类别',
+ //title: '类别',
+ value: '家具',
+ children: [
+ {
+ dimensionKey: '子类别', //title: '子类别',
+ value: '衣柜'
+ },
+ {
+ dimensionKey: '子类别', //title: '子类别',
+ value: '沙发'
+ },
+ {
+ dimensionKey: '子类别', //title: '子类别',
+ value: '餐桌'
+ },
+ {
+ dimensionKey: '子类别', //title: '子类别',
+ value: '椅子'
+ },
+ {
+ dimensionKey: '子类别', //title: '子类别',
+ value: '桌子'
+ }
+ ]
+ },
+ {
+ dimensionKey: '类别',
+ //title: '类别',
+ value: '餐饮',
+ children: [
+ {
+ dimensionKey: '子类别', //title: '子类别',
+ value: '锅具'
+ },
+ {
+ dimensionKey: '子类别',
+ //title: '子类别',
+ value: '油盐酱醋'
+ },
+ {
+ dimensionKey: '子类别', //title: '子类别',
+ value: '米面'
+ }
+ ]
+ },
+ {
+ dimensionKey: '类别',
+ //title: '类别',
+ value: '技术',
+ children: [
+ {
+ dimensionKey: '子类别', //title: '子类别',
+ value: '设备'
+ },
+ {
+ dimensionKey: '子类别', //title: '子类别',
+ value: '配件'
+ },
+ {
+ dimensionKey: '子类别', //title: '子类别',
+ value: '电话'
+ },
+ {
+ dimensionKey: '子类别',
+ //title: '子类别',
+ value: '复印机'
+ }
+ ]
+ }
+ ],
+ corner: {
+ titleOnDimension: 'column'
+ },
+ columnHeaderTitle: {
+ title: true,
+ headerType: 'text',
+ headerStyle: { autoWrapText: true, textAlign: 'center' }
+ },
+ rowHeaderTitle: {
+ title: '自定义表头',
+ headerType: 'text',
+ headerStyle: { autoWrapText: true }
+ },
+ rows: [
+ {
+ dimensionKey: '类别',
+ title: '类别',
+ cornerDescription: '这是类别维度的提示信息',
+ drillUp: true,
+ // width: 'auto',
+ width: 60,
+ minWidth: 40,
+ maxWidth: 200
+ },
+ {
+ dimensionKey: '子类别',
+ title: '子类别'
+ // headerType: 'multilinetext',
+ }
+ ],
+ columns: [
+ {
+ dimensionKey: '地区',
+ title: '地区',
+ description(args) {
+ if (args.dataValue === '东北') {
+ return '东北东北的提示';
+ }
+ return args.value;
+ },
+ cornerDescription: '这是地区维度的提示信息',
+ headerFormat(value) {
+ return `${value}地区`;
+ },
+ drillDown: true
+ },
+ {
+ dimensionKey: '邮寄方式',
+ title: '邮寄方式11',
+ showSort: true,
+ headerFormat(value) {
+ return `${value}邮寄方式`;
+ },
+ // width: 'auto',
+ width: 100,
+ minWidth: 60,
+ maxWidth: 300,
+ drillUp: false
+ }
+ ],
+ indicators: [
+ {
+ showSort: true,
+ indicatorKey: '1',
+ title: '销售额',
+ format(value) {
+ return `${value}%`;
+ },
+ maxWidth: 200,
+ minWidth: 10,
+ cellType: 'progressbar'
+ },
+ {
+ showSort: false,
+ indicatorKey: '2',
+ title: '利润',
+ width: 500,
+ format(value) {
+ // if (rec.rowDimensions[0].value === '东北') return `${rec.dataValue}%`;
+ return value;
+ },
+ cellType: 'progressbar'
+ }
+ ],
+ records: generatePivotDataSource(19, 18),
+ frozenColCount: 0, //冻结列
+ defaultRowHeight: 80,
+ defaultHeaderColWidth: [40, 80, 100],
+ // allowFrozenColCount: 5,//最多允许冻结的列数,设置5列显示冻结图标
+ enableColumnResizeOnAllRows: true, //是否可以在所有行上调整列宽
+ disableColumnResize: false, //关闭调整列宽
+ showFrozenIcon: false, //显示VTable内置冻结列图标
+ pagination: {
+ //分页配置
+ perPageCount: 5,
+ currentPage: 0
+ },
+ padding: { top: 10, bottom: 10, left: 10, right: 20 }, //整体表格的内边距 与parentElement的定位
+ hover: {
+ highlightMode: 'cross'
+ },
+ widthMode: 'standard', // 宽度模式:standard 标准模式; adaptive 自动填满容器
+ // heightMode: 'autoHeight',
+ autoWrapText: true,
+ // columnResizeType: 'indicator', // 'column' | 'indicator' | 'all'
+ columnWidthConfig: [
+ {
+ dimensions: [
+ {
+ dimensionKey: '地区',
+ value: '东北',
+ isPivotCorner: false,
+ indicatorKey: undefined
+ },
+ {
+ dimensionKey: '邮寄方式',
+ value: '二级',
+ isPivotCorner: false,
+ indicatorKey: undefined
+ },
+ {
+ indicatorKey: '2',
+ value: '利润',
+ isPivotCorner: false
+ }
+ ],
+ width: 100
+ },
+ {
+ dimensions: [
+ {
+ dimensionKey: '地区',
+ value: '华北',
+ isPivotCorner: false,
+ indicatorKey: undefined
+ },
+ {
+ dimensionKey: '邮寄方式',
+ value: '二级',
+ isPivotCorner: false,
+ indicatorKey: undefined
+ },
+ {
+ indicatorKey: '1',
+ value: '销售额',
+ isPivotCorner: false
+ }
+ ],
+ width: 500
+ }
+ ],
+ // tooltip: {
+ // isShowOverflowTextTooltip: true,
+ // },
+ columnResizeMode: 'header',
+ dragHeaderMode: 'all',
+ keyboardOptions: {
+ selectAllOnCtrlA: true,
+ copySelected: true
+ },
+ indicatorTitle: 'zhibiaomingc'
+ };
+ option.container = document.getElementById(CONTAINER_ID);
+ const instance = new PivotTable(option);
+ // 只为了方便控制太调试用,不要拷贝
+ window.tableInstance = instance;
+ instance.on('copy_data', e => {
+ console.log('copy_data', e);
+ });
+
+ // VTable.bindDebugTool(instance.scenegraph.stage as any, {
+ // customGrapicKeys: ['role', '_updateTag']
+ // });
+}
diff --git a/packages/vtable/src/PivotTable.ts b/packages/vtable/src/PivotTable.ts
index 51d66fa3f..cce3c9df6 100644
--- a/packages/vtable/src/PivotTable.ts
+++ b/packages/vtable/src/PivotTable.ts
@@ -100,6 +100,7 @@ export class PivotTable extends BaseTable implements PivotTableAPI {
this.internalProps.columnResizeType = options.columnResizeType ?? 'column';
this.internalProps.rowResizeType = options.rowResizeType ?? 'row';
this.internalProps.dataConfig = cloneDeep(options.dataConfig);
+ this.internalProps.columnWidthConfig = options.columnWidthConfig;
const records = this.internalProps.records;
this.internalProps.recordsIsTwoDimensionalArray = false;
@@ -290,6 +291,7 @@ export class PivotTable extends BaseTable implements PivotTableAPI {
internalProps.columnResizeType = options.columnResizeType ?? 'column';
internalProps.rowResizeType = options.rowResizeType ?? 'row';
internalProps.dataConfig = cloneDeep(options.dataConfig);
+ this.internalProps.columnWidthConfig = options.columnWidthConfig;
//维护tree树形结构的展开状态
if (
@@ -1103,6 +1105,19 @@ export class PivotTable extends BaseTable implements PivotTableAPI {
// }
}
}
+ /** 解析配置columnWidthConfig传入的列宽配置 */
+ _parseColumnWidthConfig(columnWidthConfig: { dimensions: IDimensionInfo[]; width: number }[]) {
+ for (let i = 0; i < columnWidthConfig?.length; i++) {
+ const item = columnWidthConfig[i];
+ const dimensions = item.dimensions;
+ const width = item.width;
+ const cell = this.getCellAddressByHeaderPaths(dimensions);
+ if (cell && !this.internalProps._widthResizedColMap.has(cell.col)) {
+ this._setColWidth(cell.col, width);
+ this.internalProps._widthResizedColMap.add(cell.col); // add resize tag
+ }
+ }
+ }
/**
* 更新排序状态
* @param pivotSortStateConfig.dimensions 排序状态维度对应关系;pivotSortStateConfig.order 排序状态
diff --git a/packages/vtable/src/scenegraph/layout/compute-col-width.ts b/packages/vtable/src/scenegraph/layout/compute-col-width.ts
index a715c24e0..a91a0ad4a 100644
--- a/packages/vtable/src/scenegraph/layout/compute-col-width.ts
+++ b/packages/vtable/src/scenegraph/layout/compute-col-width.ts
@@ -3,6 +3,7 @@ import type {
ColumnDefine,
ColumnTypeOption,
IRowSeriesNumber,
+ PivotTableAPI,
RadioColumnDefine,
RadioStyleOption,
TextColumnDefine
@@ -23,7 +24,8 @@ import { breakString } from '../utils/break-string';
import { emptyCustomLayout } from '../../components/react/react-custom-layout';
export function computeColsWidth(table: BaseTableAPI, colStart?: number, colEnd?: number, update?: boolean): void {
- const time = typeof window !== 'undefined' ? window.performance.now() : 0;
+ // const time = typeof window !== 'undefined' ? window.performance.now() : 0;
+ (table as PivotTableAPI)._parseColumnWidthConfig(table.internalProps.columnWidthConfig);
colStart = colStart ?? 0;
colEnd = colEnd ?? table.colCount - 1;
// table._clearColRangeWidthsMap();
diff --git a/packages/vtable/src/ts-types/base-table.ts b/packages/vtable/src/ts-types/base-table.ts
index 73a1f9198..eb84593b9 100644
--- a/packages/vtable/src/ts-types/base-table.ts
+++ b/packages/vtable/src/ts-types/base-table.ts
@@ -5,7 +5,8 @@ import type {
ICellHeaderPaths,
CellInfo,
CustomCellStyle,
- CustomCellStyleArrangement
+ CustomCellStyleArrangement,
+ IDimensionInfo
} from './common';
import type {
TableEventListener,
@@ -134,6 +135,10 @@ export interface IBaseTableProtected {
rowResizeMode?: 'all' | 'none' | 'header' | 'body';
columnResizeType?: 'column' | 'indicator' | 'all' | 'indicatorGroup';
rowResizeType?: 'row' | 'indicator' | 'all' | 'indicatorGroup';
+ columnWidthConfig?: {
+ dimensions: IDimensionInfo[];
+ width: number;
+ }[];
/** 控制拖拽表头移动位置顺序开关 */
dragHeaderMode?: 'all' | 'none' | 'column' | 'row';
/** 拖拽表头移动位置 针对冻结部分的规则
@@ -163,7 +168,7 @@ export interface IBaseTableProtected {
_rowRangeHeightsMap: Map; //存储指定行范围的总高度
_colRangeWidthsMap: Map; //存储指定列范围的总宽度
- _widthResizedColMap: Set; //记录下被手动调整过列宽的列号
+ _widthResizedColMap: Set; //记录下被手动调整过列宽的列号
_heightResizedRowMap: Set; //记录下被手动调整过行高的行号
bodyHelper: BodyHelper;
@@ -174,11 +179,6 @@ export interface IBaseTableProtected {
// headerDescriptions: { [at: string]: string };
focusedTable: boolean;
- config:
- | {
- [name: string]: any;
- }
- | undefined;
// scroll: {
// left: number;
// top: number;
diff --git a/packages/vtable/src/ts-types/table-engine.ts b/packages/vtable/src/ts-types/table-engine.ts
index 287cae6f4..b1d206e94 100644
--- a/packages/vtable/src/ts-types/table-engine.ts
+++ b/packages/vtable/src/ts-types/table-engine.ts
@@ -331,6 +331,10 @@ export interface PivotTableConstructorOptions extends BaseTableConstructorOption
dimensions: IDimensionInfo[];
order: SortOrder;
}[];
+ columnWidthConfig: {
+ dimensions: IDimensionInfo[];
+ width: number;
+ }[];
//#region layout中挪到外层的属性
/**层级维度结构显示形式 */
@@ -475,6 +479,7 @@ export interface PivotTableAPI extends BaseTableAPI {
* @param values 多个单元格的数据数组
*/
changeCellValues: (col: number, row: number, values: (string | number)[][], workOnEditableCell: boolean) => void;
+ _parseColumnWidthConfig: (columnWidthConfig: { dimensions: IDimensionInfo[]; width: string | number }[]) => void;
}
export interface PivotChartAPI extends BaseTableAPI {
records?: any | Record;
From 09ef4b6b1ae65906d6c95f5b91a2e3e34085ba4d Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Wed, 30 Oct 2024 11:49:15 +0800
Subject: [PATCH 28/65] docs: update changlog of rush
---
...ture-pivot-table-columnWdith_2024-10-30-03-49.json | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 common/changes/@visactor/vtable/2696-feature-pivot-table-columnWdith_2024-10-30-03-49.json
diff --git a/common/changes/@visactor/vtable/2696-feature-pivot-table-columnWdith_2024-10-30-03-49.json b/common/changes/@visactor/vtable/2696-feature-pivot-table-columnWdith_2024-10-30-03-49.json
new file mode 100644
index 000000000..4cbb5b77e
--- /dev/null
+++ b/common/changes/@visactor/vtable/2696-feature-pivot-table-columnWdith_2024-10-30-03-49.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "feat: add columnWidthConfig to set width by dimensions #2696\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
From 7aaa5c6ebc8889d7c6d4d69df94a0767a84151a7 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Wed, 30 Oct 2024 14:05:08 +0800
Subject: [PATCH 29/65] feat: add columnWidthConfig to set width by dimensions
#2696
---
packages/vtable/src/scenegraph/layout/compute-col-width.ts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/packages/vtable/src/scenegraph/layout/compute-col-width.ts b/packages/vtable/src/scenegraph/layout/compute-col-width.ts
index a91a0ad4a..e43a711f8 100644
--- a/packages/vtable/src/scenegraph/layout/compute-col-width.ts
+++ b/packages/vtable/src/scenegraph/layout/compute-col-width.ts
@@ -25,7 +25,8 @@ import { emptyCustomLayout } from '../../components/react/react-custom-layout';
export function computeColsWidth(table: BaseTableAPI, colStart?: number, colEnd?: number, update?: boolean): void {
// const time = typeof window !== 'undefined' ? window.performance.now() : 0;
- (table as PivotTableAPI)._parseColumnWidthConfig(table.internalProps.columnWidthConfig);
+ table.internalProps.columnWidthConfig &&
+ (table as PivotTableAPI)._parseColumnWidthConfig(table.internalProps.columnWidthConfig);
colStart = colStart ?? 0;
colEnd = colEnd ?? table.colCount - 1;
// table._clearColRangeWidthsMap();
From f31671e8eadedba707994347629defe2b21127ee Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Wed, 30 Oct 2024 14:57:39 +0800
Subject: [PATCH 30/65] fix: when has gantt and table same time internal theme
should not be changed #2708
---
.../examples/gantt/gantt-listTable.ts | 1085 +++++++++++++++++
packages/vtable-gantt/examples/menu.ts | 4 +
packages/vtable-gantt/src/Gantt.ts | 3 +-
packages/vtable/src/themes/theme.ts | 4 +-
4 files changed, 1093 insertions(+), 3 deletions(-)
create mode 100644 packages/vtable-gantt/examples/gantt/gantt-listTable.ts
diff --git a/packages/vtable-gantt/examples/gantt/gantt-listTable.ts b/packages/vtable-gantt/examples/gantt/gantt-listTable.ts
new file mode 100644
index 000000000..c204a9f5d
--- /dev/null
+++ b/packages/vtable-gantt/examples/gantt/gantt-listTable.ts
@@ -0,0 +1,1085 @@
+import * as VTable from '@visactor/vtable';
+import type { ColumnsDefine } from '@visactor/vtable';
+import type { GanttConstructorOptions, TYPES } from '../../src/index';
+import { Gantt } from '../../src/index';
+import { bindDebugTool } from '../../src/scenegraph/debug-tool';
+const generatePersons = count => {
+ return Array.from(new Array(count)).map((_, i) => ({
+ id: i + 1,
+ email1: `${i + 1}@xxx.com`,
+ name: `小明${i + 1}`,
+ lastName: '王',
+ date1: '2022年9月1日',
+ tel: '000-0000-0000',
+ sex: i % 2 === 0 ? 'boy' : 'girl',
+ work: i % 2 === 0 ? 'back-end engineer' : 'front-end engineer',
+ city: 'beijing'
+ }));
+};
+
+const ListTable = VTable.ListTable;
+const CONTAINER_ID = 'vTable';
+
+const container = document.getElementById(CONTAINER_ID)!;
+// const parent = container.container;
+const container1 = document.createElement('div');
+container.appendChild(container1);
+const container2 = document.createElement('div');
+container.appendChild(container2);
+const container3 = document.createElement('div');
+container.appendChild(container3);
+const container4 = document.createElement('div');
+container.appendChild(container4);
+const container5 = document.createElement('div');
+container.appendChild(container5);
+// container.style =
+container1.style =
+ container2.style =
+ container3.style =
+ container4.style =
+ container5.style =
+ 'height: 100%; width: 50%; position:relative';
+container.style =
+ 'height: 500px; width: 100%;overflow: visible; display: flex; place-content: flex-start; flex-wrap: wrap;';
+
+createTable(container1);
+createTable(container2);
+createGantt(container3);
+createTable(container4);
+createTable(container5);
+export function createTable(container) {
+ const records = generatePersons(100);
+ const columns: VTable.ColumnsDefine = [
+ {
+ field: 'id',
+ title: 'ID',
+ width: 120,
+ sort: true
+ },
+ {
+ field: 'email1',
+ title: 'email',
+ width: 200,
+ sort: true
+ },
+ {
+ title: 'full name',
+ columns: [
+ {
+ field: 'name',
+ title: 'First Name',
+ width: 200
+ },
+ {
+ field: 'name',
+ title: 'Last Name',
+ width: 200
+ }
+ ]
+ },
+ {
+ field: 'date1',
+ title: 'birthday',
+ width: 200
+ },
+ {
+ field: 'sex',
+ title: 'sex',
+ width: 100
+ },
+ {
+ field: 'tel',
+ title: 'telephone',
+ width: 150
+ },
+ {
+ field: 'work',
+ title: 'job',
+ width: 200
+ },
+ {
+ field: 'city',
+ title: 'city',
+ width: 150
+ }
+ ];
+ const option: VTable.ListTableConstructorOptions = {
+ container: container,
+ columns,
+ records,
+ showFrozenIcon: true, //显示VTable内置冻结列图标
+ widthMode: 'standard',
+ allowFrozenColCount: 2,
+ overscrollBehavior: container === container1 ? 'none' : 'auto',
+ theme: VTable.themes.ARCO
+ };
+
+ const instance = new ListTable(option);
+ container === container2 && instance.disableScroll();
+ // 只为了方便控制太调试用,不要拷贝
+ window.tableInstance = instance;
+}
+
+export function createGantt(container) {
+ const records = [
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-30',
+ end: '2024-08-14',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024/07/24',
+ end: '2024/08/04',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-08-04',
+ end: '2024-08-04',
+ progress: 90,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '07/24/2024',
+ end: '08/04/2024',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024.07.06',
+ end: '2024.07.08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024/07/09',
+ end: '2024/07/11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '07.24.2024',
+ end: '08.04.2024',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-08-09',
+ end: '2024-09-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-30',
+ end: '2024-08-14',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024/07/24',
+ end: '2024/08/04',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-08-04',
+ end: '2024-08-04',
+ progress: 90,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '07/24/2024',
+ end: '08/04/2024',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024.07.06',
+ end: '2024.07.08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024/07/09',
+ end: '2024/07/11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '07.24.2024',
+ end: '08.04.2024',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-08-09',
+ end: '2024-09-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ },
+ {
+ id: 1,
+ title: 'Software Development',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-24',
+ end: '2024-08-04',
+ progress: 31,
+ priority: 'P0'
+ },
+ {
+ id: 2,
+ title: 'Scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-06',
+ end: '2024-07-08',
+ progress: 60,
+ priority: 'P0'
+ },
+ {
+ id: 3,
+ title: 'Determine project scope',
+ developer: 'liufangfang.jane@bytedance.com',
+ start: '2024-07-09',
+ end: '2024-07-11',
+ progress: 100,
+ priority: 'P1'
+ }
+ ];
+
+ const columns: ColumnsDefine = [
+ // {
+ // field: 'id',
+ // title: 'ID',
+ // width: 80,
+ // sort: true
+ // },
+ {
+ field: 'title',
+ title: 'title',
+ width: 200,
+ sort: true
+ },
+ {
+ field: 'start',
+ title: 'start',
+ width: 150,
+ sort: true
+ },
+ {
+ field: 'end',
+ title: 'end',
+ width: 150,
+ sort: true
+ },
+ {
+ field: 'priority',
+ title: 'priority',
+ width: 100,
+ sort: true
+ },
+
+ {
+ field: 'progress',
+ title: 'progress',
+ width: 200,
+ sort: true
+ }
+ ];
+ const option: GanttConstructorOptions = {
+ records,
+ taskListTable: {
+ columns: columns,
+ tableWidth: 400,
+ minTableWidth: 100,
+ maxTableWidth: 600,
+ theme: VTable.themes.ARCO
+ },
+
+ frame: {
+ verticalSplitLineMoveable: true,
+ outerFrameStyle: {
+ borderLineWidth: 2,
+ borderColor: 'red',
+ cornerRadius: 8
+ },
+ verticalSplitLine: {
+ lineWidth: 3,
+ lineColor: '#e1e4e8'
+ },
+ verticalSplitLineHighlight: {
+ lineColor: 'green',
+ lineWidth: 3
+ }
+ },
+ grid: {
+ // backgroundColor: 'gray',
+ verticalLine: {
+ lineWidth: 1,
+ lineColor: '#e1e4e8'
+ },
+ horizontalLine: {
+ lineWidth: 1,
+ lineColor: '#e1e4e8'
+ }
+ },
+ headerRowHeight: 60,
+ rowHeight: 40,
+
+ taskBar: {
+ selectable: false,
+ startDateField: 'start',
+ endDateField: 'end',
+ progressField: 'progress',
+ labelText: '{title} {progress}%',
+ labelTextStyle: {
+ fontFamily: 'Arial',
+ fontSize: 16,
+ textAlign: 'left'
+ },
+ barStyle: {
+ width: 20,
+ /** 任务条的颜色 */
+ barColor: '#ee8800',
+ /** 已完成部分任务条的颜色 */
+ completedBarColor: '#91e8e0',
+ /** 任务条的圆角 */
+ cornerRadius: 10
+ }
+ },
+ timelineHeader: {
+ verticalLine: {
+ lineWidth: 1,
+ lineColor: '#e1e4e8'
+ },
+ horizontalLine: {
+ lineWidth: 1,
+ lineColor: '#e1e4e8'
+ },
+ backgroundColor: '#EEF1F5',
+ colWidth: 60,
+ scales: [
+ {
+ unit: 'week',
+ step: 1,
+ startOfWeek: 'sunday',
+ format(date: TYPES.DateFormatArgumentType) {
+ return `Week ${date.dateIndex}`;
+ },
+ style: {
+ fontSize: 20,
+ fontWeight: 'bold',
+ color: 'red'
+ }
+ },
+ {
+ unit: 'day',
+ step: 1,
+ format(date: TYPES.DateFormatArgumentType) {
+ return date.dateIndex.toString();
+ },
+ style: {
+ fontSize: 20,
+ fontWeight: 'bold',
+ color: 'red'
+ }
+ }
+ // {
+ // unit: 'quarter',
+ // step: 1,
+ // format(date: TYPES.DateFormatArgumentType) {
+ // return '第' + date.index + '季度';
+ // }
+ // }
+ ]
+ },
+ minDate: '2024-07-01',
+ maxDate: '2024-10-15',
+ markLine: [
+ {
+ date: '2024-07-17',
+ style: {
+ lineWidth: 1,
+ lineColor: 'blue',
+ lineDash: [8, 4]
+ }
+ },
+ {
+ date: '2024-08-17',
+ position: 'middle',
+ scrollToMarkLine: true,
+ style: {
+ lineWidth: 2,
+ lineColor: 'red',
+ lineDash: [8, 4]
+ }
+ }
+ ],
+ rowSeriesNumber: {
+ title: '行号',
+ dragOrder: true,
+ headerStyle: {
+ bgColor: '#EEF1F5',
+
+ borderColor: '#e1e4e8'
+ },
+ style: {
+ borderColor: '#e1e4e8'
+ }
+ },
+ scrollStyle: {
+ visible: 'scrolling'
+ },
+ overscrollBehavior: 'none'
+ };
+ // columns:[
+ // {
+ // title:'2024-07',
+ // columns:[
+ // {
+ // title:'01'
+ // },
+ // {
+ // title:'02'
+ // },
+ // ...
+ // ]
+ // },
+ // ...
+ // ]
+ const ganttInstance = new Gantt(container, option);
+ window.ganttInstance = ganttInstance;
+}
diff --git a/packages/vtable-gantt/examples/menu.ts b/packages/vtable-gantt/examples/menu.ts
index e55195715..2e41aebea 100644
--- a/packages/vtable-gantt/examples/menu.ts
+++ b/packages/vtable-gantt/examples/menu.ts
@@ -57,6 +57,10 @@ export const menus = [
{
path: 'gantt',
name: 'gantt-dependency'
+ },
+ {
+ path: 'gantt',
+ name: 'gantt-listTable'
}
// ]
// }
diff --git a/packages/vtable-gantt/src/Gantt.ts b/packages/vtable-gantt/src/Gantt.ts
index 972e4ad1b..f9b070a08 100644
--- a/packages/vtable-gantt/src/Gantt.ts
+++ b/packages/vtable-gantt/src/Gantt.ts
@@ -329,7 +329,8 @@ export class Gantt extends EventTarget {
if (this.options.taskListTable?.theme) {
listTable_options.theme = this.options.taskListTable?.theme;
if (listTable_options.theme.bodyStyle && !isPropertyWritable(listTable_options.theme, 'bodyStyle')) {
- //测试是否使用了主题 使用了主题配置项不可写。需要使用extends方式覆盖配置
+ //测试是否使用了主题 使用了主题配置项不可写。
+ listTable_options.theme = this.options.taskListTable?.theme.extends({}); //防止将原主题如DARK ARCO的属性改掉
const extendThemeOption = (listTable_options.theme as themes.TableTheme).getExtendTheme();
(listTable_options.theme as themes.TableTheme).clearBodyStyleCache(); // listTable_options.theme.bodyStyle 获取过需要清除缓存
if (!listTable_options.theme.headerStyle?.bgColor) {
diff --git a/packages/vtable/src/themes/theme.ts b/packages/vtable/src/themes/theme.ts
index 5fd398bfc..71cb87ccb 100644
--- a/packages/vtable/src/themes/theme.ts
+++ b/packages/vtable/src/themes/theme.ts
@@ -91,8 +91,8 @@ export class TableTheme implements ITableThemeDefine {
name: string = '';
constructor(obj: PartialTableThemeDefine | ITableThemeDefine, superTheme: ITableThemeDefine) {
this.internalTheme = {
- obj,
- superTheme
+ obj: ingoreNoneValueMerge({}, obj),
+ superTheme: ingoreNoneValueMerge({}, superTheme)
};
this.name = getProp(obj, superTheme, ['name']);
}
From 8641ddbb845bdcfce8987553f5b7ed29143494fb Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Wed, 30 Oct 2024 14:58:06 +0800
Subject: [PATCH 31/65] docs: update changlog of rush
---
...or-gantt-change-vtable-theme_2024-10-30-06-58.json | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 common/changes/@visactor/vtable/2708-refactor-gantt-change-vtable-theme_2024-10-30-06-58.json
diff --git a/common/changes/@visactor/vtable/2708-refactor-gantt-change-vtable-theme_2024-10-30-06-58.json b/common/changes/@visactor/vtable/2708-refactor-gantt-change-vtable-theme_2024-10-30-06-58.json
new file mode 100644
index 000000000..fb359cfc5
--- /dev/null
+++ b/common/changes/@visactor/vtable/2708-refactor-gantt-change-vtable-theme_2024-10-30-06-58.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "fix: when has gantt and table same time internal theme should not be changed #2708\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
From 9386913a17cd62749214ddadfb485997757aafa5 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Wed, 30 Oct 2024 16:24:18 +0800
Subject: [PATCH 32/65] docs: update faq file name delete colons #2713
---
docs/assets/faq/menu.json | 62 +++++++++----------
... collapsed state of the tree structure.md} | 0
...e and the actual height of the content.md} | 0
...ll to show or hide part of the content.md} | 0
...rollbar DOM container boundary display.md} | 0
...rag-and-drop adjustment of line-height.md} | 0
... 34-How to implement text type buttons.md} | 0
...e border style around cells separately.md} | 0
... the content width of the table header.md} | 0
...d column total information to the list.md} | 0
...area selection and cancellation events.md} | 0
...olumn to not be selected for operation.md} | 0
...o manually control the tooltip display.md} | 0
...6-How to set multi-level table headers.md} | 0
14 files changed, 31 insertions(+), 31 deletions(-)
rename docs/assets/faq/zh/{27-VTable usage problem: How to set the expanded and collapsed state of the tree structure.md => 27-How to set the expanded and collapsed state of the tree structure.md} (100%)
rename docs/assets/faq/zh/{29- VTable usage issue: How to obtain the total number of rows in a table and the actual height of the content.md => 29-How to obtain the total number of rows in a table and the actual height of the content.md} (100%)
rename docs/assets/faq/zh/{31-VTable usage issue: How to implement hover to a cell to show or hide part of the content.md => 31-How to implement hover to a cell to show or hide part of the content.md} (100%)
rename docs/assets/faq/zh/{32-VTable usage issue: How to implement scrollbar DOM container boundary display.md => 32-How to implement scrollbar DOM container boundary display.md} (100%)
rename docs/assets/faq/zh/{33-VTable usage issue: How to implement drag-and-drop adjustment of line-height.md => 33-How to implement drag-and-drop adjustment of line-height.md} (100%)
rename docs/assets/faq/zh/{34-VTable usage issue: How to implement text type buttons.md => 34-How to implement text type buttons.md} (100%)
rename docs/assets/faq/zh/{35-VTable usage issue: How to set the border style around cells separately.md => 35-How to set the border style around cells separately.md} (100%)
rename docs/assets/faq/zh/{36-VTable usage issue: How to make the table automatically calculate column width based only on the content width of the table header.md => 36-How to make the table automatically calculate column width based only on the content width of the table header.md} (100%)
rename docs/assets/faq/zh/{42-VTable usage issue: How to add column total information to the list.md => 42-How to add column total information to the list.md} (100%)
rename docs/assets/faq/zh/{43-VTable usage issue: How to listen to table area selection and cancellation events.md => 43-How to listen to table area selection and cancellation events.md} (100%)
rename docs/assets/faq/zh/{44-VTable usage issue: How to set only one column to not be selected for operation.md => 44-How to set only one column to not be selected for operation.md} (100%)
rename docs/assets/faq/zh/{45-VTable usage issue: How to manually control the tooltip display.md => 45-How to manually control the tooltip display.md} (100%)
rename docs/assets/faq/zh/{46-VTable usage issue: How to set multi-level table headers.md => 46-How to set multi-level table headers.md} (100%)
diff --git a/docs/assets/faq/menu.json b/docs/assets/faq/menu.json
index 38bca37a0..e76e6be63 100644
--- a/docs/assets/faq/menu.json
+++ b/docs/assets/faq/menu.json
@@ -33,14 +33,14 @@
"path": "5-How to customize the content of a tooltip in a pop-up box",
"title": {
"zh": "5.VTable使用问题:怎么自定义弹出框tooltip内容?",
- "en": "5.VTable Usage Issue: How to customize the content of a tooltip in a pop-up box?"
+ "en": "5.How to customize the content of a tooltip in a pop-up box?"
}
},
{
"path": "6-How to sort table contents by data records",
"title": {
"zh": "6.VTable使用问题:如何实现表格内容按数据记录排序?",
- "en": "6.VTable Usage Issue: How to sort table contents by data records?"
+ "en": "6.How to sort table contents by data records?"
}
},
{
@@ -54,7 +54,7 @@
"path": "8-How to insert sparklines in table",
"title": {
"zh": "8.VTable使用问题:如何在表格中插入迷你图?",
- "en": "8.VTable Usage Issue: How to insert sparklines in table?"
+ "en": "8.How to insert sparklines in table?"
}
},
{
@@ -165,10 +165,10 @@
},
{
"Index": 24,
- "path": "24-VTable usage problem: How to display table row numbers",
+ "path": "24- How to display table row numbers",
"title": {
"zh": "24. VTable使用问题:如何显示表格行号",
- "en": "24.VTable usage problem: How to display table row numbers"
+ "en": "24. How to display table row numbers"
}
},
{
@@ -189,10 +189,10 @@
},
{
"Index": 27,
- "path": "27-VTable usage problem: How to set the expanded and collapsed state of the tree structure",
+ "path": "27-How to set the expanded and collapsed state of the tree structure",
"title": {
"zh": "27. VTable使用问题:如何设置树形结构展开收起状态",
- "en": "27.VTable usage problem: How to set the expanded and collapsed state of the tree structure"
+ "en": "27. How to set the expanded and collapsed state of the tree structure"
}
},
{
@@ -205,10 +205,10 @@
},
{
"Index": 29,
- "path": "29- VTable usage issue: How to obtain the total number of rows in a table and the actual height of the content",
+ "path": "29- How to obtain the total number of rows in a table and the actual height of the content",
"title": {
"zh": "29. VTable使用问题:如何获取表格总行数和内容实际高度",
- "en": "29. VTable usage issue: How to obtain the total number of rows in a table and the actual height of the content"
+ "en": "29. How to obtain the total number of rows in a table and the actual height of the content"
}
},
{
@@ -221,50 +221,50 @@
},
{
"Index": 31,
- "path": "31-VTable usage issue: How to implement hover to a cell to show or hide part of the content",
+ "path": "31-How to implement hover to a cell to show or hide part of the content",
"title": {
"zh": "31. VTable使用问题:如何实现hover到单元格显示或隐藏部分内容",
- "en": "31.VTable usage issue: How to implement hover to a cell to show or hide part of the content"
+ "en": "31.How to implement hover to a cell to show or hide part of the content"
}
},
{
"Index": 32,
- "path": "32-VTable usage issue: How to implement scrollbar DOM container boundary display",
+ "path": "32-How to implement scrollbar DOM container boundary display",
"title": {
"zh": "32. VTable使用问题:如何实现滚动条贴DOM容器边界展示",
- "en": "32.VTable usage issue: How to implement scrollbar DOM container boundary display"
+ "en": "32.How to implement scrollbar DOM container boundary display"
}
},
{
"Index": 33,
- "path": "33-VTable usage issue: How to implement drag-and-drop adjustment of line-height",
+ "path": "33-How to implement drag-and-drop adjustment of line-height",
"title": {
"zh": "33. VTable使用问题:如何实现拖拽调整行高",
- "en": "33.VTable usage issue: How to implement drag-and-drop adjustment of line-height"
+ "en": "33.How to implement drag-and-drop adjustment of line-height"
}
},
{
"Index": 34,
- "path": "34-VTable usage issue: How to implement text type buttons",
+ "path": "34-How to implement text type buttons",
"title": {
"zh": "34. VTable使用问题:如何实现文本类型的按钮",
- "en": "34.VTable usage issue: How to implement text type buttons"
+ "en": "34.How to implement text type buttons"
}
},
{
"Index": 35,
- "path": "35-VTable usage issue: How to set the border style around cells separately",
+ "path": "35-How to set the border style around cells separately",
"title": {
"zh": "35. VTable使用问题:如何分别设置单元格四周边框样式",
- "en": "35.VTable usage issue: How to set the border style around cells separately"
+ "en": "35.How to set the border style around cells separately"
}
},
{
"Index": 36,
- "path": "36-VTable usage issue: How to make the table automatically calculate column width based only on the content width of the table header",
+ "path": "36-How to make the table automatically calculate column width based only on the content width of the table header",
"title": {
"zh": "36. VTable使用问题:如何让表格只根据表头的内容宽度自动计算列宽",
- "en": "36.VTable usage issue: How to make the table automatically calculate column width based only on the content width of the table header"
+ "en": "36.How to make the table automatically calculate column width based only on the content width of the table header"
}
},
{
@@ -309,42 +309,42 @@
},
{
"Index": 42,
- "path": "42-VTable usage issue: How to add column total information to the list",
+ "path": "42-How to add column total information to the list",
"title": {
"zh": "42. VTable使用问题:如何在列表中加入列总计信息",
- "en": "42.VTable usage issue: How to add column total information to the list"
+ "en": "42.How to add column total information to the list"
}
},
{
"Index": 43,
- "path": "43-VTable usage issue: How to listen to table area selection and cancellation events",
+ "path": "43-How to listen to table area selection and cancellation events",
"title": {
"zh": "43. VTable使用问题:如何监听表格区域选中取消事件",
- "en": "43.VTable usage issue: How to listen to table area selection and cancellation events"
+ "en": "43.How to listen to table area selection and cancellation events"
}
},
{
"Index": 44,
- "path": "44-VTable usage issue: How to set only one column to not be selected for operation",
+ "path": "44-How to set only one column to not be selected for operation",
"title": {
"zh": "44. VTable使用问题:如何何设置只有一列不能选中操作",
- "en": "44.VTable usage issue: How to set only one column to not be selected for operation"
+ "en": "44.How to set only one column to not be selected for operation"
}
},
{
"Index": 45,
- "path": "45-VTable usage issue: How to manually control the tooltip display",
+ "path": "45-How to manually control the tooltip display",
"title": {
"zh": "45. VTable使用问题:如何手动控制tooltip展示",
- "en": "45.VTable usage issue: How to manually control the tooltip display"
+ "en": "45.How to manually control the tooltip display"
}
},
{
"Index": 46,
- "path": "46-VTable usage issue: How to set multi-level table headers",
+ "path": "46-How to set multi-level table headers",
"title": {
"zh": "46. VTable使用问题:如何设置多级表头",
- "en": "46.VTable usage issue: How to set multi-level table headers"
+ "en": "46.How to set multi-level table headers"
}
},
{
diff --git a/docs/assets/faq/zh/27-VTable usage problem: How to set the expanded and collapsed state of the tree structure.md b/docs/assets/faq/zh/27-How to set the expanded and collapsed state of the tree structure.md
similarity index 100%
rename from docs/assets/faq/zh/27-VTable usage problem: How to set the expanded and collapsed state of the tree structure.md
rename to docs/assets/faq/zh/27-How to set the expanded and collapsed state of the tree structure.md
diff --git a/docs/assets/faq/zh/29- VTable usage issue: How to obtain the total number of rows in a table and the actual height of the content.md b/docs/assets/faq/zh/29-How to obtain the total number of rows in a table and the actual height of the content.md
similarity index 100%
rename from docs/assets/faq/zh/29- VTable usage issue: How to obtain the total number of rows in a table and the actual height of the content.md
rename to docs/assets/faq/zh/29-How to obtain the total number of rows in a table and the actual height of the content.md
diff --git a/docs/assets/faq/zh/31-VTable usage issue: How to implement hover to a cell to show or hide part of the content.md b/docs/assets/faq/zh/31-How to implement hover to a cell to show or hide part of the content.md
similarity index 100%
rename from docs/assets/faq/zh/31-VTable usage issue: How to implement hover to a cell to show or hide part of the content.md
rename to docs/assets/faq/zh/31-How to implement hover to a cell to show or hide part of the content.md
diff --git a/docs/assets/faq/zh/32-VTable usage issue: How to implement scrollbar DOM container boundary display.md b/docs/assets/faq/zh/32-How to implement scrollbar DOM container boundary display.md
similarity index 100%
rename from docs/assets/faq/zh/32-VTable usage issue: How to implement scrollbar DOM container boundary display.md
rename to docs/assets/faq/zh/32-How to implement scrollbar DOM container boundary display.md
diff --git a/docs/assets/faq/zh/33-VTable usage issue: How to implement drag-and-drop adjustment of line-height.md b/docs/assets/faq/zh/33-How to implement drag-and-drop adjustment of line-height.md
similarity index 100%
rename from docs/assets/faq/zh/33-VTable usage issue: How to implement drag-and-drop adjustment of line-height.md
rename to docs/assets/faq/zh/33-How to implement drag-and-drop adjustment of line-height.md
diff --git a/docs/assets/faq/zh/34-VTable usage issue: How to implement text type buttons.md b/docs/assets/faq/zh/34-How to implement text type buttons.md
similarity index 100%
rename from docs/assets/faq/zh/34-VTable usage issue: How to implement text type buttons.md
rename to docs/assets/faq/zh/34-How to implement text type buttons.md
diff --git a/docs/assets/faq/zh/35-VTable usage issue: How to set the border style around cells separately.md b/docs/assets/faq/zh/35-How to set the border style around cells separately.md
similarity index 100%
rename from docs/assets/faq/zh/35-VTable usage issue: How to set the border style around cells separately.md
rename to docs/assets/faq/zh/35-How to set the border style around cells separately.md
diff --git a/docs/assets/faq/zh/36-VTable usage issue: How to make the table automatically calculate column width based only on the content width of the table header.md b/docs/assets/faq/zh/36-How to make the table automatically calculate column width based only on the content width of the table header.md
similarity index 100%
rename from docs/assets/faq/zh/36-VTable usage issue: How to make the table automatically calculate column width based only on the content width of the table header.md
rename to docs/assets/faq/zh/36-How to make the table automatically calculate column width based only on the content width of the table header.md
diff --git a/docs/assets/faq/zh/42-VTable usage issue: How to add column total information to the list.md b/docs/assets/faq/zh/42-How to add column total information to the list.md
similarity index 100%
rename from docs/assets/faq/zh/42-VTable usage issue: How to add column total information to the list.md
rename to docs/assets/faq/zh/42-How to add column total information to the list.md
diff --git a/docs/assets/faq/zh/43-VTable usage issue: How to listen to table area selection and cancellation events.md b/docs/assets/faq/zh/43-How to listen to table area selection and cancellation events.md
similarity index 100%
rename from docs/assets/faq/zh/43-VTable usage issue: How to listen to table area selection and cancellation events.md
rename to docs/assets/faq/zh/43-How to listen to table area selection and cancellation events.md
diff --git a/docs/assets/faq/zh/44-VTable usage issue: How to set only one column to not be selected for operation.md b/docs/assets/faq/zh/44-How to set only one column to not be selected for operation.md
similarity index 100%
rename from docs/assets/faq/zh/44-VTable usage issue: How to set only one column to not be selected for operation.md
rename to docs/assets/faq/zh/44-How to set only one column to not be selected for operation.md
diff --git a/docs/assets/faq/zh/45-VTable usage issue: How to manually control the tooltip display.md b/docs/assets/faq/zh/45-How to manually control the tooltip display.md
similarity index 100%
rename from docs/assets/faq/zh/45-VTable usage issue: How to manually control the tooltip display.md
rename to docs/assets/faq/zh/45-How to manually control the tooltip display.md
diff --git a/docs/assets/faq/zh/46-VTable usage issue: How to set multi-level table headers.md b/docs/assets/faq/zh/46-How to set multi-level table headers.md
similarity index 100%
rename from docs/assets/faq/zh/46-VTable usage issue: How to set multi-level table headers.md
rename to docs/assets/faq/zh/46-How to set multi-level table headers.md
From c0eb1133bd9fdc7434f2ab917b9cd1fa9747f2b3 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Wed, 30 Oct 2024 17:02:01 +0800
Subject: [PATCH 33/65] fix: when has gantt and table same time internal theme
should not be changed #2708
---
... row numbers.md => 24-How to display table row numbers.md} | 0
...f rows in a table and the actual height of the content.md} | 0
...nt hover to a cell to show or hide part of the content.md} | 0
... to implement scrollbar DOM container boundary display.md} | 0
...w to implement drag-and-drop adjustment of line-height.md} | 0
...pe buttons.md => 34-How to implement text type buttons.md} | 0
...35-How to set the border style around cells separately.md} | 0
...th based only on the content width of the table header.md} | 0
... => 42-How to add column total information to the list.md} | 0
...listen to table area selection and cancellation events.md} | 0
...o set only one column to not be selected for operation.md} | 0
...y.md => 45-How to manually control the tooltip display.md} | 0
... headers.md => 46-How to set multi-level table headers.md} | 0
docs/assets/faq/menu.json | 4 ++--
... row numbers.md => 24-How to display table row numbers.md} | 0
15 files changed, 2 insertions(+), 2 deletions(-)
rename docs/assets/faq/en/{24-VTable usage problem: How to display table row numbers.md => 24-How to display table row numbers.md} (100%)
rename docs/assets/faq/en/{29- VTable usage issue: How to obtain the total number of rows in a table and the actual height of the content.md => 29-How to obtain the total number of rows in a table and the actual height of the content.md} (100%)
rename docs/assets/faq/en/{31-VTable usage issue: How to implement hover to a cell to show or hide part of the content.md => 31-How to implement hover to a cell to show or hide part of the content.md} (100%)
rename docs/assets/faq/en/{32-VTable usage issue: How to implement scrollbar DOM container boundary display.md => 32-How to implement scrollbar DOM container boundary display.md} (100%)
rename docs/assets/faq/en/{33-VTable usage issue: How to implement drag-and-drop adjustment of line-height.md => 33-How to implement drag-and-drop adjustment of line-height.md} (100%)
rename docs/assets/faq/en/{34-VTable usage issue: How to implement text type buttons.md => 34-How to implement text type buttons.md} (100%)
rename docs/assets/faq/en/{35-VTable usage issue: How to set the border style around cells separately.md => 35-How to set the border style around cells separately.md} (100%)
rename docs/assets/faq/en/{36-VTable usage issue: How to make the table automatically calculate column width based only on the content width of the table header.md => 36-How to make the table automatically calculate column width based only on the content width of the table header.md} (100%)
rename docs/assets/faq/en/{42-VTable usage issue: How to add column total information to the list.md => 42-How to add column total information to the list.md} (100%)
rename docs/assets/faq/en/{43-VTable usage issue: How to listen to table area selection and cancellation events.md => 43-How to listen to table area selection and cancellation events.md} (100%)
rename docs/assets/faq/en/{44-VTable usage issue: How to set only one column to not be selected for operation.md => 44-How to set only one column to not be selected for operation.md} (100%)
rename docs/assets/faq/en/{45-VTable usage issue: How to manually control the tooltip display.md => 45-How to manually control the tooltip display.md} (100%)
rename docs/assets/faq/en/{46-VTable usage issue: How to set multi-level table headers.md => 46-How to set multi-level table headers.md} (100%)
rename docs/assets/faq/zh/{24-VTable usage problem: How to display table row numbers.md => 24-How to display table row numbers.md} (100%)
diff --git a/docs/assets/faq/en/24-VTable usage problem: How to display table row numbers.md b/docs/assets/faq/en/24-How to display table row numbers.md
similarity index 100%
rename from docs/assets/faq/en/24-VTable usage problem: How to display table row numbers.md
rename to docs/assets/faq/en/24-How to display table row numbers.md
diff --git a/docs/assets/faq/en/29- VTable usage issue: How to obtain the total number of rows in a table and the actual height of the content.md b/docs/assets/faq/en/29-How to obtain the total number of rows in a table and the actual height of the content.md
similarity index 100%
rename from docs/assets/faq/en/29- VTable usage issue: How to obtain the total number of rows in a table and the actual height of the content.md
rename to docs/assets/faq/en/29-How to obtain the total number of rows in a table and the actual height of the content.md
diff --git a/docs/assets/faq/en/31-VTable usage issue: How to implement hover to a cell to show or hide part of the content.md b/docs/assets/faq/en/31-How to implement hover to a cell to show or hide part of the content.md
similarity index 100%
rename from docs/assets/faq/en/31-VTable usage issue: How to implement hover to a cell to show or hide part of the content.md
rename to docs/assets/faq/en/31-How to implement hover to a cell to show or hide part of the content.md
diff --git a/docs/assets/faq/en/32-VTable usage issue: How to implement scrollbar DOM container boundary display.md b/docs/assets/faq/en/32-How to implement scrollbar DOM container boundary display.md
similarity index 100%
rename from docs/assets/faq/en/32-VTable usage issue: How to implement scrollbar DOM container boundary display.md
rename to docs/assets/faq/en/32-How to implement scrollbar DOM container boundary display.md
diff --git a/docs/assets/faq/en/33-VTable usage issue: How to implement drag-and-drop adjustment of line-height.md b/docs/assets/faq/en/33-How to implement drag-and-drop adjustment of line-height.md
similarity index 100%
rename from docs/assets/faq/en/33-VTable usage issue: How to implement drag-and-drop adjustment of line-height.md
rename to docs/assets/faq/en/33-How to implement drag-and-drop adjustment of line-height.md
diff --git a/docs/assets/faq/en/34-VTable usage issue: How to implement text type buttons.md b/docs/assets/faq/en/34-How to implement text type buttons.md
similarity index 100%
rename from docs/assets/faq/en/34-VTable usage issue: How to implement text type buttons.md
rename to docs/assets/faq/en/34-How to implement text type buttons.md
diff --git a/docs/assets/faq/en/35-VTable usage issue: How to set the border style around cells separately.md b/docs/assets/faq/en/35-How to set the border style around cells separately.md
similarity index 100%
rename from docs/assets/faq/en/35-VTable usage issue: How to set the border style around cells separately.md
rename to docs/assets/faq/en/35-How to set the border style around cells separately.md
diff --git a/docs/assets/faq/en/36-VTable usage issue: How to make the table automatically calculate column width based only on the content width of the table header.md b/docs/assets/faq/en/36-How to make the table automatically calculate column width based only on the content width of the table header.md
similarity index 100%
rename from docs/assets/faq/en/36-VTable usage issue: How to make the table automatically calculate column width based only on the content width of the table header.md
rename to docs/assets/faq/en/36-How to make the table automatically calculate column width based only on the content width of the table header.md
diff --git a/docs/assets/faq/en/42-VTable usage issue: How to add column total information to the list.md b/docs/assets/faq/en/42-How to add column total information to the list.md
similarity index 100%
rename from docs/assets/faq/en/42-VTable usage issue: How to add column total information to the list.md
rename to docs/assets/faq/en/42-How to add column total information to the list.md
diff --git a/docs/assets/faq/en/43-VTable usage issue: How to listen to table area selection and cancellation events.md b/docs/assets/faq/en/43-How to listen to table area selection and cancellation events.md
similarity index 100%
rename from docs/assets/faq/en/43-VTable usage issue: How to listen to table area selection and cancellation events.md
rename to docs/assets/faq/en/43-How to listen to table area selection and cancellation events.md
diff --git a/docs/assets/faq/en/44-VTable usage issue: How to set only one column to not be selected for operation.md b/docs/assets/faq/en/44-How to set only one column to not be selected for operation.md
similarity index 100%
rename from docs/assets/faq/en/44-VTable usage issue: How to set only one column to not be selected for operation.md
rename to docs/assets/faq/en/44-How to set only one column to not be selected for operation.md
diff --git a/docs/assets/faq/en/45-VTable usage issue: How to manually control the tooltip display.md b/docs/assets/faq/en/45-How to manually control the tooltip display.md
similarity index 100%
rename from docs/assets/faq/en/45-VTable usage issue: How to manually control the tooltip display.md
rename to docs/assets/faq/en/45-How to manually control the tooltip display.md
diff --git a/docs/assets/faq/en/46-VTable usage issue: How to set multi-level table headers.md b/docs/assets/faq/en/46-How to set multi-level table headers.md
similarity index 100%
rename from docs/assets/faq/en/46-VTable usage issue: How to set multi-level table headers.md
rename to docs/assets/faq/en/46-How to set multi-level table headers.md
diff --git a/docs/assets/faq/menu.json b/docs/assets/faq/menu.json
index e76e6be63..ede9bdcfb 100644
--- a/docs/assets/faq/menu.json
+++ b/docs/assets/faq/menu.json
@@ -165,7 +165,7 @@
},
{
"Index": 24,
- "path": "24- How to display table row numbers",
+ "path": "24-How to display table row numbers",
"title": {
"zh": "24. VTable使用问题:如何显示表格行号",
"en": "24. How to display table row numbers"
@@ -205,7 +205,7 @@
},
{
"Index": 29,
- "path": "29- How to obtain the total number of rows in a table and the actual height of the content",
+ "path": "29-How to obtain the total number of rows in a table and the actual height of the content",
"title": {
"zh": "29. VTable使用问题:如何获取表格总行数和内容实际高度",
"en": "29. How to obtain the total number of rows in a table and the actual height of the content"
diff --git a/docs/assets/faq/zh/24-VTable usage problem: How to display table row numbers.md b/docs/assets/faq/zh/24-How to display table row numbers.md
similarity index 100%
rename from docs/assets/faq/zh/24-VTable usage problem: How to display table row numbers.md
rename to docs/assets/faq/zh/24-How to display table row numbers.md
From 08eea6d6761d48d89d96078de0474daf8ef44d9a Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Wed, 30 Oct 2024 17:26:13 +0800
Subject: [PATCH 34/65] docs: update faq file name #2713
---
...t the expanded and collapsed state of the tree structure.md} | 0
...How to configure the editor and whether it can be reused.md} | 0
docs/assets/faq/menu.json | 2 +-
...How to configure the editor and whether it can be reused.md} | 0
4 files changed, 1 insertion(+), 1 deletion(-)
rename docs/assets/faq/en/{27-VTable usage problem: How to set the expanded and collapsed state of the tree structure.md => 27-How to set the expanded and collapsed state of the tree structure.md} (100%)
rename docs/assets/faq/en/{52- Usage issues of the editing cell ability of the VTable component: How to configure the editor and whether it can be reused.md => 52-How to configure the editor and whether it can be reused.md} (100%)
rename docs/assets/faq/zh/{52- Usage issues of the editing cell ability of the VTable component: How to configure the editor and whether it can be reused.md => 52-How to configure the editor and whether it can be reused.md} (100%)
diff --git a/docs/assets/faq/en/27-VTable usage problem: How to set the expanded and collapsed state of the tree structure.md b/docs/assets/faq/en/27-How to set the expanded and collapsed state of the tree structure.md
similarity index 100%
rename from docs/assets/faq/en/27-VTable usage problem: How to set the expanded and collapsed state of the tree structure.md
rename to docs/assets/faq/en/27-How to set the expanded and collapsed state of the tree structure.md
diff --git a/docs/assets/faq/en/52- Usage issues of the editing cell ability of the VTable component: How to configure the editor and whether it can be reused.md b/docs/assets/faq/en/52-How to configure the editor and whether it can be reused.md
similarity index 100%
rename from docs/assets/faq/en/52- Usage issues of the editing cell ability of the VTable component: How to configure the editor and whether it can be reused.md
rename to docs/assets/faq/en/52-How to configure the editor and whether it can be reused.md
diff --git a/docs/assets/faq/menu.json b/docs/assets/faq/menu.json
index ede9bdcfb..b1d46a816 100644
--- a/docs/assets/faq/menu.json
+++ b/docs/assets/faq/menu.json
@@ -389,7 +389,7 @@
},
{
"Index": 52,
- "path": "52- Usage issues of the editing cell ability of the VTable component: How to configure the editor and whether it can be reused",
+ "path": "52-How to configure the editor and whether it can be reused",
"title": {
"zh": "52. VTable表格组件的编辑单元格能力使用问题:编辑器怎么配置,是否可以复用?",
"en": "52. Usage issues of the editing cell ability of the VTable component: How to configure the editor and whether it can be reused?"
diff --git a/docs/assets/faq/zh/52- Usage issues of the editing cell ability of the VTable component: How to configure the editor and whether it can be reused.md b/docs/assets/faq/zh/52-How to configure the editor and whether it can be reused.md
similarity index 100%
rename from docs/assets/faq/zh/52- Usage issues of the editing cell ability of the VTable component: How to configure the editor and whether it can be reused.md
rename to docs/assets/faq/zh/52-How to configure the editor and whether it can be reused.md
From 7949d303cdd2aaca7cfe6d41514f4233eb10cc71 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Wed, 30 Oct 2024 19:42:05 +0800
Subject: [PATCH 35/65] docs: add tutorial about columnWidthConfig
---
.../basic_function/row_height_column_width.md | 52 +++++++++++++++++-
.../basic_function/row_height_column_width.md | 53 ++++++++++++++++++-
docs/assets/option/en/table/pivotTable.md | 16 ++++++
docs/assets/option/zh/table/pivotTable.md | 16 ++++++
4 files changed, 135 insertions(+), 2 deletions(-)
diff --git a/docs/assets/guide/en/basic_function/row_height_column_width.md b/docs/assets/guide/en/basic_function/row_height_column_width.md
index 77b17a3a5..fd8e889fc 100644
--- a/docs/assets/guide/en/basic_function/row_height_column_width.md
+++ b/docs/assets/guide/en/basic_function/row_height_column_width.md
@@ -86,6 +86,8 @@ const table = new VTable.ListTable({
Pivot table column width configuration:
+1. Set column width for associated indicators
+
```javascript
const table = new VTable.PivotTable({
indicators: [
@@ -97,7 +99,55 @@ const table = new VTable.PivotTable({
});
```
-##Default column width
+2. Set column width via dimension path
+
+This is set via the `columnWidthConfig` configuration item, which can be set to an array corresponding to the column widths of each level of the dimension path.
+
+```javascript
+const table = new VTable.PivotTable({
+ columnWidthConfig: [
+ {
+ dimensions: [
+ {
+ dimensionKey: '地区',
+ value: '东北'
+ },
+ {
+ dimensionKey: '邮寄方式',
+ value: '二级'
+ },
+ {
+ indicatorKey: '2',
+ value: '利润'
+ }
+ ],
+ width: 130
+ },
+ {
+ dimensions: [
+ {
+ dimensionKey: '地区',
+ value: '东北22'
+ },
+ {
+ indicatorKey: '1',
+ value: '销售额'
+ }
+ ],
+ width: 160
+ }
+ ],
+ ...
+});
+```
+
+The effect is as follows:
+
+
+
+
+
+## Default column width
In a VTable, you can set a uniform default column width value. The default column width can be set through the `defaultColWidth` configuration item. The following code example shows how to set the column width to 100:
diff --git a/docs/assets/guide/zh/basic_function/row_height_column_width.md b/docs/assets/guide/zh/basic_function/row_height_column_width.md
index 1be21c450..bd340cc53 100644
--- a/docs/assets/guide/zh/basic_function/row_height_column_width.md
+++ b/docs/assets/guide/zh/basic_function/row_height_column_width.md
@@ -86,6 +86,8 @@ const table = new VTable.ListTable({
透视表列宽配置:
+1. 关联指标设置列宽
+
```javascript
const table = new VTable.PivotTable({
indicators: [
@@ -93,10 +95,59 @@ const table = new VTable.PivotTable({
// ...其他配置项
width: 200
}
- ]
+ ],
+ ...
+});
+```
+
+2. 通过维度路径设置列宽
+
+通过`columnWidthConfig`配置项进行设置,该配置项可以设定为一个数组,分别对应各级维度路径的列的宽度。
+
+```javascript
+const table = new VTable.PivotTable({
+ columnWidthConfig: [
+ {
+ dimensions: [
+ {
+ dimensionKey: '地区',
+ value: '东北'
+ },
+ {
+ dimensionKey: '邮寄方式',
+ value: '二级'
+ },
+ {
+ indicatorKey: '2',
+ value: '利润'
+ }
+ ],
+ width: 130
+ },
+ {
+ dimensions: [
+ {
+ dimensionKey: '地区',
+ value: '东北22'
+ },
+ {
+ indicatorKey: '1',
+ value: '销售额'
+ }
+ ],
+ width: 160
+ }
+ ],
+ ...
});
```
+效果如下:
+
+
+
+
+
## 默认列宽
在 VTable 中,您可以设置一个统一的默认列宽值。默认列宽可以通过 `defaultColWidth` 配置项进行设置。以下代码示例展示了如何设置列宽为 100:
diff --git a/docs/assets/option/en/table/pivotTable.md b/docs/assets/option/en/table/pivotTable.md
index 6e162672d..4f532fcb4 100644
--- a/docs/assets/option/en/table/pivotTable.md
+++ b/docs/assets/option/en/table/pivotTable.md
@@ -419,3 +419,19 @@ If you have configured rowTree or columnTree and it is a non-regular tree struct
The regular tree structure refers to: the nodes on the same layer have the same dimension keys.
The non-regular tree structure is the tree where nodes on the same layer exist with different dimension values.
+
+## columnWidthConfig(Array)
+
+Set column width based on dimension information
+
+```
+{
+ dimensions: IDimensionInfo[];
+ width: number;
+}[];
+```
+
+- dimensions The dimension information of each level of the dimension is an array of IDimensionInfo type. The vtable will locate the specific column according to this path.
+ {{ use: common-IDimensionInfo()}}
+
+-width specifies the column width.
diff --git a/docs/assets/option/zh/table/pivotTable.md b/docs/assets/option/zh/table/pivotTable.md
index ab10251ea..5113a9039 100644
--- a/docs/assets/option/zh/table/pivotTable.md
+++ b/docs/assets/option/zh/table/pivotTable.md
@@ -423,3 +423,19 @@ export interface IIndicatorHeaderNode {
规则的树结构指的是:同一层的节点它们的维度 key 是相同的。
非规则的树结构即树的同一层存在不同维度的维度值时。
+
+## columnWidthConfig(Array)
+
+依据维度信息设置列宽
+
+```
+ {
+ dimensions: IDimensionInfo[];
+ width: number;
+ }[];
+```
+
+- dimensions 维度各层级的维度信息,是一个 IDimensionInfo 类型的数组,vtable 会根据这个路径来定位到具体的列。
+ {{ use: common-IDimensionInfo()}}
+
+- width 指定列宽。
From e6ab6c79ccd17ad0074e44c009ee1066420138d2 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Wed, 30 Oct 2024 20:11:21 +0800
Subject: [PATCH 36/65] fix: when gantt and table use same theme not conflict
#2708
---
packages/vtable/src/themes/theme.ts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/packages/vtable/src/themes/theme.ts b/packages/vtable/src/themes/theme.ts
index 71cb87ccb..7ef8ad37d 100644
--- a/packages/vtable/src/themes/theme.ts
+++ b/packages/vtable/src/themes/theme.ts
@@ -91,8 +91,8 @@ export class TableTheme implements ITableThemeDefine {
name: string = '';
constructor(obj: PartialTableThemeDefine | ITableThemeDefine, superTheme: ITableThemeDefine) {
this.internalTheme = {
- obj: ingoreNoneValueMerge({}, obj),
- superTheme: ingoreNoneValueMerge({}, superTheme)
+ obj,
+ superTheme
};
this.name = getProp(obj, superTheme, ['name']);
}
@@ -788,7 +788,7 @@ export class TableTheme implements ITableThemeDefine {
return hasThemeProperty(obj, names) || hasThemeProperty(superTheme, names);
}
extends(obj: PartialTableThemeDefine): TableTheme {
- return new TableTheme(obj, this.internalTheme.superTheme || this.internalTheme.obj);
+ return new TableTheme(ingoreNoneValueMerge({}, this.internalTheme.obj, obj), this.internalTheme.superTheme);
}
private getStyle(style: ThemeStyle) {
const that = this;
From eb3317de6e82a48d8942c92c69e84cdbb331df3d Mon Sep 17 00:00:00 2001
From: Rui-Sun
Date: Thu, 31 Oct 2024 14:28:32 +0800
Subject: [PATCH 37/65] fix: fix large children tree update
---
.../vtable/examples/list/list-group-manyChild.ts | 3 +++
packages/vtable/src/ListTable.ts | 10 ++++++++++
packages/vtable/src/layout/row-height-map.ts | 6 ++++++
.../scenegraph/group-creater/progress/proxy.ts | 15 +++++++++++++++
packages/vtable/src/scenegraph/scenegraph.ts | 6 +++---
5 files changed, 37 insertions(+), 3 deletions(-)
diff --git a/packages/vtable/examples/list/list-group-manyChild.ts b/packages/vtable/examples/list/list-group-manyChild.ts
index 786fe0135..cbd8c942e 100644
--- a/packages/vtable/examples/list/list-group-manyChild.ts
+++ b/packages/vtable/examples/list/list-group-manyChild.ts
@@ -1,4 +1,6 @@
import * as VTable from '../../src';
+import { bindDebugTool } from '../../src/scenegraph/debug-tool';
+
const CONTAINER_ID = 'vTable';
const generatePersons = count => {
return Array.from(new Array(count)).map((_, i) => ({
@@ -84,6 +86,7 @@ export function createTable() {
const t0 = window.performance.now();
tableInstance = new VTable.ListTable(document.getElementById(CONTAINER_ID), option);
window.tableInstance = tableInstance;
+ bindDebugTool(tableInstance.scenegraph.stage, { customGrapicKeys: ['col', 'row'] });
const filterListValues = {
country: ['all', 'China', 'United States', 'Australia'],
year: ['all', '2004', '2008', '2012', '2016', '2020'],
diff --git a/packages/vtable/src/ListTable.ts b/packages/vtable/src/ListTable.ts
index dcfc1b835..d535679dc 100644
--- a/packages/vtable/src/ListTable.ts
+++ b/packages/vtable/src/ListTable.ts
@@ -625,6 +625,7 @@ export class ListTable extends BaseTable implements ListTableAPI {
}
}
this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
+ // this.scenegraph.proxy?.refreshRowColCount();
}
/**
* 获取records数据源中 字段对应的value 值是format之后的
@@ -888,6 +889,12 @@ export class ListTable extends BaseTable implements ListTableAPI {
//影响行数
this.refreshRowColCount();
+ // for bottom frozen row height map
+ for (let row = this.rowCount - this.frozenRowCount; row < this.rowCount; row++) {
+ const newHeight = computeRowHeight(row, 0, this.colCount - 1, this);
+ this._setRowHeight(row, newHeight);
+ }
+
this.clearCellStyleCache();
this.internalProps.layoutMap.clearCellRangeMap();
this.internalProps.useOneRowHeightFillAll = false;
@@ -908,6 +915,9 @@ export class ListTable extends BaseTable implements ListTableAPI {
}
}
diffPositions.removeCellPositions = [];
+
+ // reset proxy row config
+ this.scenegraph.proxy.refreshRowCount();
}
this.scenegraph.updateRow(diffPositions.removeCellPositions, diffPositions.addCellPositions, updateCells);
if (checkHasChart) {
diff --git a/packages/vtable/src/layout/row-height-map.ts b/packages/vtable/src/layout/row-height-map.ts
index ff8fe142a..571741af3 100644
--- a/packages/vtable/src/layout/row-height-map.ts
+++ b/packages/vtable/src/layout/row-height-map.ts
@@ -38,6 +38,9 @@ export class NumberRangeMap {
}
add(position: number, value: number) {
+ if (!isValid(value)) {
+ return;
+ }
const defaultValue = this.table.getRowHeight(position);
if (!this.data.has(position)) {
this._keys.push(position);
@@ -65,6 +68,9 @@ export class NumberRangeMap {
}
put(position: number, newValue: number) {
+ if (!isValid(newValue)) {
+ return;
+ }
if (this.data.has(position)) {
const oldValue = this.data.get(position);
diff --git a/packages/vtable/src/scenegraph/group-creater/progress/proxy.ts b/packages/vtable/src/scenegraph/group-creater/progress/proxy.ts
index be6b44e8f..e2316a7f8 100644
--- a/packages/vtable/src/scenegraph/group-creater/progress/proxy.ts
+++ b/packages/vtable/src/scenegraph/group-creater/progress/proxy.ts
@@ -165,6 +165,21 @@ export class SceneProxy {
this.rowUpdatePos = this.bodyBottomRow;
}
+ refreshRowCount() {
+ this.bodyTopRow = this.table.frozenRowCount;
+ this.bodyBottomRow = this.table.rowCount - 1 - this.table.bottomFrozenRowCount;
+ const totalActualBodyRowCount = Math.min(this.rowLimit, this.bodyBottomRow - this.bodyTopRow + 1); // 渐进加载总row数量
+ this.totalActualBodyRowCount = totalActualBodyRowCount;
+ this.totalRow = this.rowStart + totalActualBodyRowCount - 1; // 目标渐进完成的row
+ }
+
+ refreshColCount() {
+ this.bodyRightCol = this.table.colCount - 1 - this.table.rightFrozenColCount;
+ const totalActualBodyColCount = Math.min(this.colLimit, this.bodyRightCol - this.bodyLeftCol + 1);
+ this.totalActualBodyColCount = totalActualBodyColCount;
+ this.totalCol = this.bodyLeftCol + totalActualBodyColCount - 1; // 目标渐进完成的col
+ }
+
resize() {
const defaultColWidth = this.table.defaultColWidth;
this.taskColCount = Math.ceil(this.table.tableNoFrameWidth / defaultColWidth) * 1;
diff --git a/packages/vtable/src/scenegraph/scenegraph.ts b/packages/vtable/src/scenegraph/scenegraph.ts
index ec12bde38..14490a947 100644
--- a/packages/vtable/src/scenegraph/scenegraph.ts
+++ b/packages/vtable/src/scenegraph/scenegraph.ts
@@ -1948,9 +1948,9 @@ export class Scenegraph {
) {
this.table.scenegraph.recalculateRowHeights();
} else if (this.table.heightMode === 'autoHeight') {
- if (updateCells.length > 0) {
- this.table.scenegraph.recalculateRowHeights();
- }
+ // if (updateCells.length > 0) {
+ // this.table.scenegraph.recalculateRowHeights();
+ // }
for (let i = 0; i < updateRows.length; i++) {
const row = updateRows[i];
const oldHeight = this.table.getRowHeight(row);
From d18cc585a4b5e7fe5e701defa97b7f7a7b0b65e7 Mon Sep 17 00:00:00 2001
From: Rui-Sun
Date: Thu, 31 Oct 2024 15:03:16 +0800
Subject: [PATCH 38/65] fix: fix bottomFrozenRowCount in
_refreshHierarchyState()
---
packages/vtable/src/ListTable.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/vtable/src/ListTable.ts b/packages/vtable/src/ListTable.ts
index d535679dc..fd53f1850 100644
--- a/packages/vtable/src/ListTable.ts
+++ b/packages/vtable/src/ListTable.ts
@@ -890,7 +890,7 @@ export class ListTable extends BaseTable implements ListTableAPI {
this.refreshRowColCount();
// for bottom frozen row height map
- for (let row = this.rowCount - this.frozenRowCount; row < this.rowCount; row++) {
+ for (let row = this.rowCount - this.bottomFrozenRowCount; row < this.rowCount; row++) {
const newHeight = computeRowHeight(row, 0, this.colCount - 1, this);
this._setRowHeight(row, newHeight);
}
From 5cb9fa87b53ce328ec35efc3ac6cdc0f7cb1e34c Mon Sep 17 00:00:00 2001
From: Rui-Sun
Date: Fri, 25 Oct 2024 19:40:43 +0800
Subject: [PATCH 39/65] fix: fix check state update #2667
---
.../fix-check-state-update_2024-10-25-11-40.json | 10 ++++++++++
packages/vtable/src/ListTable.ts | 2 ++
packages/vtable/src/state/checkbox/checkbox.ts | 6 +++---
3 files changed, 15 insertions(+), 3 deletions(-)
create mode 100644 common/changes/@visactor/vtable/fix-check-state-update_2024-10-25-11-40.json
diff --git a/common/changes/@visactor/vtable/fix-check-state-update_2024-10-25-11-40.json b/common/changes/@visactor/vtable/fix-check-state-update_2024-10-25-11-40.json
new file mode 100644
index 000000000..62d62c789
--- /dev/null
+++ b/common/changes/@visactor/vtable/fix-check-state-update_2024-10-25-11-40.json
@@ -0,0 +1,10 @@
+{
+ "changes": [
+ {
+ "packageName": "@visactor/vtable",
+ "comment": "fix: fix check state update #2667",
+ "type": "none"
+ }
+ ],
+ "packageName": "@visactor/vtable"
+}
\ No newline at end of file
diff --git a/packages/vtable/src/ListTable.ts b/packages/vtable/src/ListTable.ts
index 4280eb60e..66c79d0b3 100644
--- a/packages/vtable/src/ListTable.ts
+++ b/packages/vtable/src/ListTable.ts
@@ -555,6 +555,7 @@ export class ListTable extends BaseTable implements ListTableAPI {
//数据源缓存数据更新
this.dataSource.updatePagination(this.pagination);
this.refreshRowColCount();
+ this.stateManager.initCheckedState(this.records);
// 生成单元格场景树
this.scenegraph.createSceneGraph();
this.renderAsync();
@@ -1007,6 +1008,7 @@ export class ListTable extends BaseTable implements ListTableAPI {
this.dataSource.updateFilterRules(filterRules);
}
this.refreshRowColCount();
+ this.stateManager.initCheckedState(this.records);
this.scenegraph.createSceneGraph();
}
/** 获取某个字段下checkbox 全部数据的选中状态 顺序对应原始传入数据records 不是对应表格展示row的状态值 */
diff --git a/packages/vtable/src/state/checkbox/checkbox.ts b/packages/vtable/src/state/checkbox/checkbox.ts
index 1a8f3f741..ce7ff3b7e 100644
--- a/packages/vtable/src/state/checkbox/checkbox.ts
+++ b/packages/vtable/src/state/checkbox/checkbox.ts
@@ -151,21 +151,21 @@ export function initCheckedState(records: any[], state: StateManager) {
*/
export function updateHeaderCheckedState(field: string | number, state: StateManager): boolean | 'indeterminate' {
const allChecked = state.checkedState.every((state: Record) => {
- return state[field] === true;
+ return state && state[field] === true;
});
if (allChecked) {
state.headerCheckedState[field] = true;
return allChecked;
}
const allUnChecked = state.checkedState.every((state: Record) => {
- return state[field] === false;
+ return state && state[field] === false;
});
if (allUnChecked) {
state.headerCheckedState[field] = false;
return false;
}
const hasChecked = state.checkedState.find((state: Record) => {
- return state[field] === true;
+ return state && state[field] === true;
});
if (hasChecked) {
state.headerCheckedState[field] = 'indeterminate';
From fc46afb2949dd0138cffb921bc5a56e344aa7e7a Mon Sep 17 00:00:00 2001
From: Rui-Sun
Date: Fri, 25 Oct 2024 20:11:37 +0800
Subject: [PATCH 40/65] fix: add selected_cell event in select-all #2664
---
.../vtable/fix-select-all-event_2024-10-25-12-11.json | 10 ++++++++++
packages/vtable/src/event/event.ts | 5 +++++
2 files changed, 15 insertions(+)
create mode 100644 common/changes/@visactor/vtable/fix-select-all-event_2024-10-25-12-11.json
diff --git a/common/changes/@visactor/vtable/fix-select-all-event_2024-10-25-12-11.json b/common/changes/@visactor/vtable/fix-select-all-event_2024-10-25-12-11.json
new file mode 100644
index 000000000..3c80cdfbd
--- /dev/null
+++ b/common/changes/@visactor/vtable/fix-select-all-event_2024-10-25-12-11.json
@@ -0,0 +1,10 @@
+{
+ "changes": [
+ {
+ "packageName": "@visactor/vtable",
+ "comment": "fix: add selected_cell event in select-all #2664",
+ "type": "none"
+ }
+ ],
+ "packageName": "@visactor/vtable"
+}
\ No newline at end of file
diff --git a/packages/vtable/src/event/event.ts b/packages/vtable/src/event/event.ts
index 9ed5e9ad4..562522009 100644
--- a/packages/vtable/src/event/event.ts
+++ b/packages/vtable/src/event/event.ts
@@ -477,6 +477,11 @@ export class EventManager {
deelTableSelectAll() {
this.table.stateManager.updateSelectPos(-1, -1, false, false, true);
+ this.table.fireListeners(TABLE_EVENT_TYPE.SELECTED_CELL, {
+ ranges: this.table.stateManager.select.ranges,
+ col: 0,
+ row: 0
+ });
}
dealMenuSelect(eventArgsSet: SceneEvent) {
From 49cec3ea30c0f7ae88fc3f395fe4eed578faf01d Mon Sep 17 00:00:00 2001
From: Rui-Sun
Date: Mon, 28 Oct 2024 16:52:47 +0800
Subject: [PATCH 41/65] fix: fix list-editor space problem
---
.../vtable/fix-list-editor_2024-10-28-08-52.json | 10 ++++++++++
docs/assets/demo/zh/edit/edit-cell.md | 1 +
packages/vtable-editors/src/list-editor.ts | 4 +++-
3 files changed, 14 insertions(+), 1 deletion(-)
create mode 100644 common/changes/@visactor/vtable/fix-list-editor_2024-10-28-08-52.json
diff --git a/common/changes/@visactor/vtable/fix-list-editor_2024-10-28-08-52.json b/common/changes/@visactor/vtable/fix-list-editor_2024-10-28-08-52.json
new file mode 100644
index 000000000..51e81d0ae
--- /dev/null
+++ b/common/changes/@visactor/vtable/fix-list-editor_2024-10-28-08-52.json
@@ -0,0 +1,10 @@
+{
+ "changes": [
+ {
+ "packageName": "@visactor/vtable",
+ "comment": "fix: fix list-editor space problem",
+ "type": "none"
+ }
+ ],
+ "packageName": "@visactor/vtable"
+}
\ No newline at end of file
diff --git a/docs/assets/demo/zh/edit/edit-cell.md b/docs/assets/demo/zh/edit/edit-cell.md
index fbbf176f4..77d1111d1 100644
--- a/docs/assets/demo/zh/edit/edit-cell.md
+++ b/docs/assets/demo/zh/edit/edit-cell.md
@@ -39,6 +39,7 @@ const list_editor = new VTable_editors.ListEditor({ values: ['girl', 'boy'] });
const textArea_editor = new VTable_editors.TextAreaEditor({ readonly: false });
VTable.register.editor('input-editor', input_editor);
VTable.register.editor('date-input-editor', date_input_editor);
+VTable.register.editor('list-editor', list_editor);
VTable.register.editor('textArea-editor', textArea_editor);
function generateRandomString(length) {
diff --git a/packages/vtable-editors/src/list-editor.ts b/packages/vtable-editors/src/list-editor.ts
index b0143dbc7..f65889259 100644
--- a/packages/vtable-editors/src/list-editor.ts
+++ b/packages/vtable-editors/src/list-editor.ts
@@ -32,7 +32,9 @@ export class ListEditor implements IEditor {
let opsStr = '';
values.forEach(item => {
opsStr +=
- item === value ? `` : ``;
+ item === value
+ ? ``
+ : ``;
});
select.innerHTML = opsStr;
From 4715c1a1d8d8a7412afefbbdc71e420e665321a6 Mon Sep 17 00:00:00 2001
From: Rui-Sun
Date: Mon, 28 Oct 2024 17:24:47 +0800
Subject: [PATCH 42/65] fix: add event in react-vtable
---
.../fix-react-event_2024-10-28-09-24.json | 10 +++++
packages/react-vtable/src/eventsUtils.ts | 42 ++++++++++++-------
2 files changed, 37 insertions(+), 15 deletions(-)
create mode 100644 common/changes/@visactor/vtable/fix-react-event_2024-10-28-09-24.json
diff --git a/common/changes/@visactor/vtable/fix-react-event_2024-10-28-09-24.json b/common/changes/@visactor/vtable/fix-react-event_2024-10-28-09-24.json
new file mode 100644
index 000000000..6ec3518be
--- /dev/null
+++ b/common/changes/@visactor/vtable/fix-react-event_2024-10-28-09-24.json
@@ -0,0 +1,10 @@
+{
+ "changes": [
+ {
+ "packageName": "@visactor/vtable",
+ "comment": "fix: add event in react-vtable",
+ "type": "none"
+ }
+ ],
+ "packageName": "@visactor/vtable"
+}
\ No newline at end of file
diff --git a/packages/react-vtable/src/eventsUtils.ts b/packages/react-vtable/src/eventsUtils.ts
index acdf13006..0577f6c74 100644
--- a/packages/react-vtable/src/eventsUtils.ts
+++ b/packages/react-vtable/src/eventsUtils.ts
@@ -25,19 +25,27 @@ export interface EventsProps {
onMouseLeaveTable?: EventCallback;
onMouseDownTable?: EventCallback;
onMouseMoveCell?: EventCallback;
+ onMousemoveTable?: EventCallback;
onMouseEnterCell?: EventCallback;
onMouseLeaveCell?: EventCallback;
onContextMenuCell?: EventCallback;
onResizeColumn?: EventCallback;
onResizeColumnEnd?: EventCallback;
+ onResizeRow?: EventCallback;
+ onResizeRowEnd?: EventCallback;
+ onChangeHeaderPositionStart?: EventCallback;
onChangeHeaderPosition?: EventCallback;
onSortClick?: EventCallback;
+
+ onAfterSort?: EventCallback;
onFreezeClick?: EventCallback;
onScroll?: EventCallback;
+ onScrollVerticalEnd?: EventCallback;
+ onScrollHorizontalEnd?: EventCallback;
onDropdownMenuClick?: EventCallback;
onMouseOverChartSymbol?: EventCallback;
onDragSelectEnd?: EventCallback;
-
+ onCopyData?: EventCallback;
onDropdownIconClick?: EventCallback;
onDropdownMenuClear?: EventCallback;
@@ -60,6 +68,10 @@ export interface EventsProps {
onRadioStateChange?: EventCallback;
onAfterRender?: EventCallback;
onInitialized?: EventCallback;
+ onChangeCellValue?: EventCallback;
+ onDragFillHandleEnd?: EventCallback;
+ onMousedownFillHandle?: EventCallback;
+ onDblclickFillHandle?: EventCallback;
// pivot table only
onPivotSortClick?: EventCallback;
@@ -69,13 +81,6 @@ export interface EventsProps {
onVChartEventType?: EventCallback;
onChangCellValue?: EventCallback;
-
- onMousedownFillHandle?: EventCallback;
- onDragFillHandleEnd?: EventCallback;
- onDblclickFillHandle?: EventCallback;
-
- onScrollVerticalEnd?: EventCallback;
- onScrollHorizontalEnd?: EventCallback;
}
export const TABLE_EVENTS = {
@@ -90,19 +95,27 @@ export const TABLE_EVENTS = {
onMouseLeaveTable: EVENT_TYPE.MOUSELEAVE_TABLE,
onMouseDownTable: EVENT_TYPE.MOUSEDOWN_TABLE,
onMouseMoveCell: EVENT_TYPE.MOUSEMOVE_CELL,
+ onMouseMoveTable: EVENT_TYPE.MOUSEMOVE_TABLE,
onMouseEnterCell: EVENT_TYPE.MOUSEENTER_CELL,
onMouseLeaveCell: EVENT_TYPE.MOUSELEAVE_CELL,
onContextMenuCell: EVENT_TYPE.CONTEXTMENU_CELL,
onResizeColumn: EVENT_TYPE.RESIZE_COLUMN,
onResizeColumnEnd: EVENT_TYPE.RESIZE_COLUMN_END,
+ onResizeRow: EVENT_TYPE.RESIZE_ROW,
+ onResizeRowEnd: EVENT_TYPE.RESIZE_ROW_END,
+ onChangeHeaderPositionStart: EVENT_TYPE.CHANGE_HEADER_POSITION_START,
onChangeHeaderPosition: EVENT_TYPE.CHANGE_HEADER_POSITION,
onSortClick: EVENT_TYPE.SORT_CLICK,
+
+ onAfterSort: EVENT_TYPE.AFTER_SORT,
onFreezeClick: EVENT_TYPE.FREEZE_CLICK,
onScroll: EVENT_TYPE.SCROLL,
+ onScrollHorizontalEnd: EVENT_TYPE.SCROLL_HORIZONTAL_END,
+ onScrollVerticalEnd: EVENT_TYPE.SCROLL_VERTICAL_END,
onDropdownMenuClick: EVENT_TYPE.DROPDOWN_MENU_CLICK,
onMouseOverChartSymbol: EVENT_TYPE.MOUSEOVER_CHART_SYMBOL,
onDragSelectEnd: EVENT_TYPE.DRAG_SELECT_END,
-
+ onCopyData: EVENT_TYPE.COPY_DATA,
onDropdownIconClick: EVENT_TYPE.DROPDOWN_ICON_CLICK,
onDropdownMenuClear: EVENT_TYPE.DROPDOWN_MENU_CLEAR,
@@ -125,6 +138,10 @@ export const TABLE_EVENTS = {
onRadioStateChange: EVENT_TYPE.RADIO_STATE_CHANGE,
onAfterRender: EVENT_TYPE.AFTER_RENDER,
onInitialized: EVENT_TYPE.INITIALIZED,
+ onChangeCellValue: EVENT_TYPE.CHANGE_CELL_VALUE,
+ onDragFillHandleEnd: EVENT_TYPE.DRAG_FILL_HANDLE_END,
+ onMousedownFillHandle: EVENT_TYPE.MOUSEDOWN_FILL_HANDLE,
+ onDblclickFillHandle: EVENT_TYPE.DBLCLICK_FILL_HANDLE,
// pivot table only
onPivotSortClick: EVENT_TYPE.PIVOT_SORT_CLICK,
@@ -133,12 +150,7 @@ export const TABLE_EVENTS = {
// pivot chart only
onVChartEventType: EVENT_TYPE.VCHART_EVENT_TYPE,
- onChangCellValue: EVENT_TYPE.CHANGE_CELL_VALUE,
- onMousedownFillHandle: EVENT_TYPE.MOUSEDOWN_FILL_HANDLE,
- onDragFillHandleEnd: EVENT_TYPE.DRAG_FILL_HANDLE_END,
- onDblclickFillHandle: EVENT_TYPE.DBLCLICK_FILL_HANDLE,
- onScrollVerticalEnd: EVENT_TYPE.SCROLL_VERTICAL_END,
- onScrollHorizontalEnd: EVENT_TYPE.SCROLL_HORIZONTAL_END
+ onChangCellValue: EVENT_TYPE.CHANGE_CELL_VALUE
};
export const TABLE_EVENTS_KEYS = Object.keys(TABLE_EVENTS);
From 8c3ba530362f2ca892f5476c5f685d5c08e655ea Mon Sep 17 00:00:00 2001
From: Rui-Sun
Date: Mon, 28 Oct 2024 17:43:23 +0800
Subject: [PATCH 43/65] fix: fix disableRowSeriesNumberSelect in select-all
#2665
---
.../fix-select-all-series-number_2024-10-28-09-43.json | 10 ++++++++++
packages/vtable/src/state/select/update-position.ts | 2 +-
2 files changed, 11 insertions(+), 1 deletion(-)
create mode 100644 common/changes/@visactor/vtable/fix-select-all-series-number_2024-10-28-09-43.json
diff --git a/common/changes/@visactor/vtable/fix-select-all-series-number_2024-10-28-09-43.json b/common/changes/@visactor/vtable/fix-select-all-series-number_2024-10-28-09-43.json
new file mode 100644
index 000000000..c9c642467
--- /dev/null
+++ b/common/changes/@visactor/vtable/fix-select-all-series-number_2024-10-28-09-43.json
@@ -0,0 +1,10 @@
+{
+ "changes": [
+ {
+ "packageName": "@visactor/vtable",
+ "comment": "fix: fix disableRowSeriesNumberSelect in select-all #2665",
+ "type": "none"
+ }
+ ],
+ "packageName": "@visactor/vtable"
+}
\ No newline at end of file
diff --git a/packages/vtable/src/state/select/update-position.ts b/packages/vtable/src/state/select/update-position.ts
index c80eb8023..9b0530c66 100644
--- a/packages/vtable/src/state/select/update-position.ts
+++ b/packages/vtable/src/state/select/update-position.ts
@@ -73,7 +73,7 @@ export function updateSelectPosition(
_startRow = table.columnHeaderLevelCount;
}
// 行号列选中
- if ((disableRowSeriesNumberSelect || disableHeaderSelect) && table.options.rowSeriesNumber) {
+ if (disableRowSeriesNumberSelect && table.options.rowSeriesNumber) {
_startCol += 1;
}
From 1cc598aa4f317eb81a6f36992a15017eb6b394be Mon Sep 17 00:00:00 2001
From: Rui-Sun
Date: Mon, 28 Oct 2024 20:12:22 +0800
Subject: [PATCH 44/65] fix: change pointerupoutside event callback #2674 #2659
---
...fix-pointerupoutside_2024-10-28-12-12.json | 10 ++
.../src/event/listener/container-dom.ts | 64 ++++++++-
.../vtable/src/event/listener/table-group.ts | 124 +++++++++---------
3 files changed, 135 insertions(+), 63 deletions(-)
create mode 100644 common/changes/@visactor/vtable/fix-pointerupoutside_2024-10-28-12-12.json
diff --git a/common/changes/@visactor/vtable/fix-pointerupoutside_2024-10-28-12-12.json b/common/changes/@visactor/vtable/fix-pointerupoutside_2024-10-28-12-12.json
new file mode 100644
index 000000000..2eb35e853
--- /dev/null
+++ b/common/changes/@visactor/vtable/fix-pointerupoutside_2024-10-28-12-12.json
@@ -0,0 +1,10 @@
+{
+ "changes": [
+ {
+ "packageName": "@visactor/vtable",
+ "comment": "fix: change pointerupoutside event callback #2674 #2659",
+ "type": "none"
+ }
+ ],
+ "packageName": "@visactor/vtable"
+}
\ No newline at end of file
diff --git a/packages/vtable/src/event/listener/container-dom.ts b/packages/vtable/src/event/listener/container-dom.ts
index 6d80d17cb..c3f449403 100644
--- a/packages/vtable/src/event/listener/container-dom.ts
+++ b/packages/vtable/src/event/listener/container-dom.ts
@@ -1,6 +1,6 @@
import { isValid } from '@visactor/vutils';
import type { EventHandler } from '../EventHandler';
-import type { ListTableConstructorOptions } from '../../ts-types';
+import type { ListTableConstructorOptions, MousePointerMultiCellEvent } from '../../ts-types';
import { InteractionState, type KeydownEvent, type ListTableAPI } from '../../ts-types';
import { TABLE_EVENT_TYPE } from '../../core/TABLE_EVENT_TYPE';
import { handleWhell } from '../scroll';
@@ -547,7 +547,69 @@ export function bindContainerDomListener(eventManager: EventManager) {
});
document.body.addEventListener('pointerdown', globalPointerdownCallback);
+ const globalPointerupOutsideCallback = (e: MouseEvent) => {
+ // console.log('pointerupoutside');
+ // const eventArgsSet: SceneEvent = getCellEventArgsSet(e);
+ if (stateManager.menu.isShow) {
+ setTimeout(() => {
+ // conside page scroll
+ if (!table.internalProps.menuHandler.pointInMenuElement(e.clientX, e.clientY)) {
+ stateManager.menu.isShow && stateManager.hideMenu();
+ }
+ }, 0);
+ }
+ // 同pointerup中的逻辑
+ if (stateManager.isResizeCol()) {
+ endResizeCol(table);
+ } else if (stateManager.isResizeRow()) {
+ endResizeRow(table);
+ } else if (stateManager.isMoveCol()) {
+ const endMoveColSuccess = table.stateManager.endMoveCol();
+ if (
+ endMoveColSuccess &&
+ table.stateManager.columnMove?.colSource !== -1 &&
+ table.stateManager.columnMove?.rowSource !== -1 &&
+ table.stateManager.columnMove?.colTarget !== -1 &&
+ table.stateManager.columnMove?.rowTarget !== -1
+ ) {
+ // 下面触发CHANGE_HEADER_POSITION 区别于pointerup
+ if ((table as any).hasListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION)) {
+ table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION, {
+ target: { col: table.stateManager.columnMove.colTarget, row: table.stateManager.columnMove.rowTarget },
+ source: {
+ col: table.stateManager.columnMove.colSource,
+ row: table.stateManager.columnMove.rowSource
+ },
+ event: e
+ });
+ }
+ }
+ } else if (stateManager.isSelecting()) {
+ if (table.stateManager.select?.ranges?.length) {
+ const lastCol = table.stateManager.select.ranges[table.stateManager.select.ranges.length - 1].end.col;
+ const lastRow = table.stateManager.select.ranges[table.stateManager.select.ranges.length - 1].end.row;
+ table.stateManager.endSelectCells();
+ if ((table as any).hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {
+ const cellsEvent: MousePointerMultiCellEvent = {
+ event: e,
+ cells: [],
+ col: lastCol,
+ row: lastRow,
+ scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,
+ target: undefined
+ };
+ cellsEvent.cells = table.getSelectedCellInfos();
+ table.fireListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END, cellsEvent);
+ }
+ }
+ }
+ };
+
const globalPointerupCallback = (e: MouseEvent) => {
+ const target = e.target as HTMLElement;
+ if (target !== table.canvas) {
+ globalPointerupOutsideCallback(e);
+ }
table.eventManager.LastBodyPointerXY = null;
// console.log('body pointerup', table.eventManager.isDown, table.eventManager.isDraging);
table.eventManager.isDown = false;
diff --git a/packages/vtable/src/event/listener/table-group.ts b/packages/vtable/src/event/listener/table-group.ts
index b61f21579..b9be33061 100644
--- a/packages/vtable/src/event/listener/table-group.ts
+++ b/packages/vtable/src/event/listener/table-group.ts
@@ -317,68 +317,68 @@ export function bindTableGroupListener(eventManager: EventManager) {
});
}
});
- /**
- * 两种场景会触发这里的pointerupoutside TODO 第二种并不应该触发,待vrender修改后再整理这里的逻辑
- * 1. 鼠标down和up的场景树节点不一样
- * 2. 点击到非stage的(非canvas) 其他dom节点
- */
- table.scenegraph.tableGroup.addEventListener('pointerupoutside', (e: FederatedPointerEvent) => {
- console.log('pointerupoutside');
- const eventArgsSet: SceneEvent = getCellEventArgsSet(e);
- if (stateManager.menu.isShow && (eventArgsSet.eventArgs?.target as any) !== stateManager.residentHoverIcon?.icon) {
- setTimeout(() => {
- // conside page scroll
- if (!table.internalProps.menuHandler.pointInMenuElement(e.client.x, e.client.y)) {
- stateManager.menu.isShow && stateManager.hideMenu();
- }
- }, 0);
- }
- // 同pointerup中的逻辑
- if (stateManager.isResizeCol()) {
- endResizeCol(table);
- } else if (stateManager.isResizeRow()) {
- endResizeRow(table);
- } else if (stateManager.isMoveCol()) {
- const endMoveColSuccess = table.stateManager.endMoveCol();
- if (
- endMoveColSuccess &&
- table.stateManager.columnMove?.colSource !== -1 &&
- table.stateManager.columnMove?.rowSource !== -1 &&
- table.stateManager.columnMove?.colTarget !== -1 &&
- table.stateManager.columnMove?.rowTarget !== -1
- ) {
- // 下面触发CHANGE_HEADER_POSITION 区别于pointerup
- if ((table as any).hasListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION)) {
- table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION, {
- target: { col: table.stateManager.columnMove.colTarget, row: table.stateManager.columnMove.rowTarget },
- source: {
- col: table.stateManager.columnMove.colSource,
- row: table.stateManager.columnMove.rowSource
- },
- event: e.nativeEvent
- });
- }
- }
- } else if (stateManager.isSelecting()) {
- if (table.stateManager.select?.ranges?.length) {
- const lastCol = table.stateManager.select.ranges[table.stateManager.select.ranges.length - 1].end.col;
- const lastRow = table.stateManager.select.ranges[table.stateManager.select.ranges.length - 1].end.row;
- table.stateManager.endSelectCells();
- if ((table as any).hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {
- const cellsEvent: MousePointerMultiCellEvent = {
- event: e.nativeEvent,
- cells: [],
- col: lastCol,
- row: lastRow,
- scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,
- target: undefined
- };
- cellsEvent.cells = table.getSelectedCellInfos();
- table.fireListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END, cellsEvent);
- }
- }
- }
- });
+ // /**
+ // * 两种场景会触发这里的pointerupoutside TODO 第二种并不应该触发,待vrender修改后再整理这里的逻辑
+ // * 1. 鼠标down和up的场景树节点不一样
+ // * 2. 点击到非stage的(非canvas) 其他dom节点
+ // */
+ // table.scenegraph.tableGroup.addEventListener('pointerupoutside', (e: FederatedPointerEvent) => {
+ // console.log('pointerupoutside');
+ // const eventArgsSet: SceneEvent = getCellEventArgsSet(e);
+ // if (stateManager.menu.isShow && (eventArgsSet.eventArgs?.target as any) !== stateManager.residentHoverIcon?.icon) {
+ // setTimeout(() => {
+ // // conside page scroll
+ // if (!table.internalProps.menuHandler.pointInMenuElement(e.client.x, e.client.y)) {
+ // stateManager.menu.isShow && stateManager.hideMenu();
+ // }
+ // }, 0);
+ // }
+ // // 同pointerup中的逻辑
+ // if (stateManager.isResizeCol()) {
+ // endResizeCol(table);
+ // } else if (stateManager.isResizeRow()) {
+ // endResizeRow(table);
+ // } else if (stateManager.isMoveCol()) {
+ // const endMoveColSuccess = table.stateManager.endMoveCol();
+ // if (
+ // endMoveColSuccess &&
+ // table.stateManager.columnMove?.colSource !== -1 &&
+ // table.stateManager.columnMove?.rowSource !== -1 &&
+ // table.stateManager.columnMove?.colTarget !== -1 &&
+ // table.stateManager.columnMove?.rowTarget !== -1
+ // ) {
+ // // 下面触发CHANGE_HEADER_POSITION 区别于pointerup
+ // if ((table as any).hasListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION)) {
+ // table.fireListeners(TABLE_EVENT_TYPE.CHANGE_HEADER_POSITION, {
+ // target: { col: table.stateManager.columnMove.colTarget, row: table.stateManager.columnMove.rowTarget },
+ // source: {
+ // col: table.stateManager.columnMove.colSource,
+ // row: table.stateManager.columnMove.rowSource
+ // },
+ // event: e.nativeEvent
+ // });
+ // }
+ // }
+ // } else if (stateManager.isSelecting()) {
+ // if (table.stateManager.select?.ranges?.length) {
+ // const lastCol = table.stateManager.select.ranges[table.stateManager.select.ranges.length - 1].end.col;
+ // const lastRow = table.stateManager.select.ranges[table.stateManager.select.ranges.length - 1].end.row;
+ // table.stateManager.endSelectCells();
+ // if ((table as any).hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {
+ // const cellsEvent: MousePointerMultiCellEvent = {
+ // event: e.nativeEvent,
+ // cells: [],
+ // col: lastCol,
+ // row: lastRow,
+ // scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,
+ // target: undefined
+ // };
+ // cellsEvent.cells = table.getSelectedCellInfos();
+ // table.fireListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END, cellsEvent);
+ // }
+ // }
+ // }
+ // });
const globalPointerupCallback = (e: MouseEvent) => {
const target = e.target as HTMLElement;
From 6b8d6d17e9c8224ae20afcc5a4f0db6061e2a5e0 Mon Sep 17 00:00:00 2001
From: Rui-Sun
Date: Tue, 29 Oct 2024 21:01:30 +0800
Subject: [PATCH 45/65] fix: fix title resize in adaptive mode #2704
---
.../vtable/fix-title-resize_2024-10-29-13-01.json | 10 ++++++++++
packages/vtable/src/components/title/title.ts | 12 ++++++++++--
2 files changed, 20 insertions(+), 2 deletions(-)
create mode 100644 common/changes/@visactor/vtable/fix-title-resize_2024-10-29-13-01.json
diff --git a/common/changes/@visactor/vtable/fix-title-resize_2024-10-29-13-01.json b/common/changes/@visactor/vtable/fix-title-resize_2024-10-29-13-01.json
new file mode 100644
index 000000000..df6dfe748
--- /dev/null
+++ b/common/changes/@visactor/vtable/fix-title-resize_2024-10-29-13-01.json
@@ -0,0 +1,10 @@
+{
+ "changes": [
+ {
+ "packageName": "@visactor/vtable",
+ "comment": "fix: fix title resize in adaptive mode #2704",
+ "type": "none"
+ }
+ ],
+ "packageName": "@visactor/vtable"
+}
\ No newline at end of file
diff --git a/packages/vtable/src/components/title/title.ts b/packages/vtable/src/components/title/title.ts
index bf742dd79..ad214a0e5 100644
--- a/packages/vtable/src/components/title/title.ts
+++ b/packages/vtable/src/components/title/title.ts
@@ -48,10 +48,18 @@ export class Title {
const padding = getQuadProps(this._titleOption.padding ?? 10);
const realWidth =
this._titleOption.width ??
- Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width) - padding[1] - padding[3];
+ (this.table.widthMode === 'adaptive'
+ ? this.table.tableNoFrameWidth
+ : Math.min(this.table.tableNoFrameWidth, this.table.getDrawRange().width)) -
+ padding[1] -
+ padding[3];
const realHeight =
this._titleOption.height ??
- Math.min(this.table.tableNoFrameHeight, this.table.getDrawRange().height) - padding[0] - padding[2];
+ (this.table.heightMode === 'adaptive'
+ ? this.table.tableNoFrameHeight
+ : Math.min(this.table.tableNoFrameHeight, this.table.getDrawRange().height)) -
+ padding[0] -
+ padding[2];
this._titleComponent.setAttributes({
x:
this._titleOption.x ?? this._titleOption.orient === 'right'
From caaa39b86566e64a900cb748b30efc66ca2dfa64 Mon Sep 17 00:00:00 2001
From: Rui-Sun
Date: Wed, 30 Oct 2024 11:22:26 +0800
Subject: [PATCH 46/65] fix: fix animation config in TableAnimatinManager
---
packages/vtable/src/core/animation.ts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/packages/vtable/src/core/animation.ts b/packages/vtable/src/core/animation.ts
index 80750a045..61096aa93 100644
--- a/packages/vtable/src/core/animation.ts
+++ b/packages/vtable/src/core/animation.ts
@@ -1,5 +1,5 @@
import type { EasingType, IRect } from '@src/vrender';
-import { DefaultTimeline, DefaultTicker, Animate, ACustomAnimate, createRect } from '@src/vrender';
+import { DefaultTimeline, DefaultTicker, Animate, ACustomAnimate, createRect, Generator } from '@src/vrender';
import type { BaseTableAPI } from '../ts-types/base-table';
import { isBoolean, isNumber } from '@visactor/vutils';
@@ -48,13 +48,13 @@ export class TableAnimationManager {
const duration = !isBoolean(animationOption) ? animationOption?.duration ?? 3000 : animationOption ? 3000 : 0;
const easing = !isBoolean(animationOption) ? animationOption?.easing ?? 'linear' : animationOption ? 'linear' : '';
- const animation = new Animate().bind(this.tempGraphic).play(
+ const animation = new Animate(Generator.GenAutoIncrementId(), this.timeline).bind(this.tempGraphic).play(
new Animateaaa(from, to, duration, easing, {
graphic: this.tempGraphic,
table: this.table
})
);
- this.timeline.addAnimate(animation);
+ // this.timeline.addAnimate(animation);
this.ticker.start();
}
From cb0c20d36a9d26c15df24d6f19bb05486aab4a41 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Thu, 31 Oct 2024 16:01:27 +0800
Subject: [PATCH 47/65] fix: theme extend usage not work #2708
---
packages/vtable/src/themes/theme.ts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/packages/vtable/src/themes/theme.ts b/packages/vtable/src/themes/theme.ts
index 7ef8ad37d..2253dea42 100644
--- a/packages/vtable/src/themes/theme.ts
+++ b/packages/vtable/src/themes/theme.ts
@@ -788,7 +788,8 @@ export class TableTheme implements ITableThemeDefine {
return hasThemeProperty(obj, names) || hasThemeProperty(superTheme, names);
}
extends(obj: PartialTableThemeDefine): TableTheme {
- return new TableTheme(ingoreNoneValueMerge({}, this.internalTheme.obj, obj), this.internalTheme.superTheme);
+ const cloneObj = ingoreNoneValueMerge({}, this.internalTheme.obj);
+ return new TableTheme(ingoreNoneValueMerge(cloneObj, obj), this.internalTheme.superTheme);
}
private getStyle(style: ThemeStyle) {
const that = this;
From eddb82871f094566dbeb7fd9e5a358485b65b1df Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Thu, 31 Oct 2024 16:04:45 +0800
Subject: [PATCH 48/65] fix: validateValue api not exist case
---
packages/vtable/src/core/record-helper.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/vtable/src/core/record-helper.ts b/packages/vtable/src/core/record-helper.ts
index a7b932a0b..b40ff6c75 100644
--- a/packages/vtable/src/core/record-helper.ts
+++ b/packages/vtable/src/core/record-helper.ts
@@ -163,7 +163,7 @@ export function listTableChangeCellValues(
const editor = table.getEditor(startCol + j, startRow + i);
const oldValue = oldValues[i][j];
const value = rowValues[j];
- const maybePromiseOrValue = editor.validateValue(value, oldValue);
+ const maybePromiseOrValue = editor.validateValue?.(value, oldValue) ?? true;
if (isPromise(maybePromiseOrValue)) {
//TODO 处理promise的情况
isCanChange = true;
From eb88b4334d6265ee0654d791c229204d840856cf Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Thu, 31 Oct 2024 16:47:15 +0800
Subject: [PATCH 49/65] fix: theme extend problem
---
packages/vtable/src/themes/theme.ts | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/packages/vtable/src/themes/theme.ts b/packages/vtable/src/themes/theme.ts
index 2253dea42..1ac2639f9 100644
--- a/packages/vtable/src/themes/theme.ts
+++ b/packages/vtable/src/themes/theme.ts
@@ -788,8 +788,7 @@ export class TableTheme implements ITableThemeDefine {
return hasThemeProperty(obj, names) || hasThemeProperty(superTheme, names);
}
extends(obj: PartialTableThemeDefine): TableTheme {
- const cloneObj = ingoreNoneValueMerge({}, this.internalTheme.obj);
- return new TableTheme(ingoreNoneValueMerge(cloneObj, obj), this.internalTheme.superTheme);
+ return new TableTheme(obj, ingoreNoneValueMerge(this.internalTheme.superTheme, this.internalTheme.obj));
}
private getStyle(style: ThemeStyle) {
const that = this;
From 7396c9dd5836d21771525093d9462cf799fad629 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Thu, 31 Oct 2024 17:04:01 +0800
Subject: [PATCH 50/65] fix: when transpose table and set disableHeaderSelect
rowSeries not selected
---
packages/vtable/src/state/select/update-position.ts | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/packages/vtable/src/state/select/update-position.ts b/packages/vtable/src/state/select/update-position.ts
index 03d28d4f8..ac61118c7 100644
--- a/packages/vtable/src/state/select/update-position.ts
+++ b/packages/vtable/src/state/select/update-position.ts
@@ -1,3 +1,4 @@
+import type { ListTable } from '../..';
import type { SimpleHeaderLayoutMap } from '../../layout';
import type { Scenegraph } from '../../scenegraph/scenegraph';
import type { SelectAllOnCtrlAOption } from '../../ts-types';
@@ -73,7 +74,10 @@ export function updateSelectPosition(
_startRow = table.columnHeaderLevelCount;
}
// 行号列选中
- if (disableRowSeriesNumberSelect && table.options.rowSeriesNumber) {
+ if (
+ (disableRowSeriesNumberSelect || (disableHeaderSelect && (table as ListTable).transpose)) &&
+ table.options.rowSeriesNumber
+ ) {
_startCol += 1;
}
From d0d88325b7d9e196bb5b3dfb830469571dbf9f5e Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Thu, 31 Oct 2024 17:55:11 +0800
Subject: [PATCH 51/65] fix: judge if has editor
---
packages/vtable/src/core/record-helper.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/vtable/src/core/record-helper.ts b/packages/vtable/src/core/record-helper.ts
index b40ff6c75..d06103c05 100644
--- a/packages/vtable/src/core/record-helper.ts
+++ b/packages/vtable/src/core/record-helper.ts
@@ -163,7 +163,7 @@ export function listTableChangeCellValues(
const editor = table.getEditor(startCol + j, startRow + i);
const oldValue = oldValues[i][j];
const value = rowValues[j];
- const maybePromiseOrValue = editor.validateValue?.(value, oldValue) ?? true;
+ const maybePromiseOrValue = editor?.validateValue?.(value, oldValue) ?? true;
if (isPromise(maybePromiseOrValue)) {
//TODO 处理promise的情况
isCanChange = true;
From 7ec7e59c26c722c4b3fa7a4c4a56f33f743d9c13 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Thu, 31 Oct 2024 18:12:03 +0800
Subject: [PATCH 52/65] fix: when has gantt and table same time internal theme
should not be changed #2708
---
packages/vtable-gantt/src/Gantt.ts | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/packages/vtable-gantt/src/Gantt.ts b/packages/vtable-gantt/src/Gantt.ts
index f9b070a08..9f380f5d2 100644
--- a/packages/vtable-gantt/src/Gantt.ts
+++ b/packages/vtable-gantt/src/Gantt.ts
@@ -330,7 +330,9 @@ export class Gantt extends EventTarget {
listTable_options.theme = this.options.taskListTable?.theme;
if (listTable_options.theme.bodyStyle && !isPropertyWritable(listTable_options.theme, 'bodyStyle')) {
//测试是否使用了主题 使用了主题配置项不可写。
- listTable_options.theme = this.options.taskListTable?.theme.extends({}); //防止将原主题如DARK ARCO的属性改掉
+ listTable_options.theme = (this.options.taskListTable?.theme as themes.TableTheme).extends(
+ (this.options.taskListTable?.theme as themes.TableTheme).getExtendTheme()
+ ); //防止将原主题如DARK ARCO的属性改掉
const extendThemeOption = (listTable_options.theme as themes.TableTheme).getExtendTheme();
(listTable_options.theme as themes.TableTheme).clearBodyStyleCache(); // listTable_options.theme.bodyStyle 获取过需要清除缓存
if (!listTable_options.theme.headerStyle?.bgColor) {
From aee69d36b9931bd4c67af8e2f66f32295405b52c Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Thu, 31 Oct 2024 18:13:48 +0800
Subject: [PATCH 53/65] fix: when has gantt and table same time internal theme
should not be changed #2708
---
packages/vtable/src/themes/theme.ts | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/packages/vtable/src/themes/theme.ts b/packages/vtable/src/themes/theme.ts
index 1ac2639f9..1567d33a4 100644
--- a/packages/vtable/src/themes/theme.ts
+++ b/packages/vtable/src/themes/theme.ts
@@ -788,7 +788,10 @@ export class TableTheme implements ITableThemeDefine {
return hasThemeProperty(obj, names) || hasThemeProperty(superTheme, names);
}
extends(obj: PartialTableThemeDefine): TableTheme {
- return new TableTheme(obj, ingoreNoneValueMerge(this.internalTheme.superTheme, this.internalTheme.obj));
+ return new TableTheme(
+ ingoreNoneValueMerge({}, obj),
+ ingoreNoneValueMerge(this.internalTheme.superTheme, this.internalTheme.obj)
+ );
}
private getStyle(style: ThemeStyle) {
const that = this;
From a64ebaf3c469db2889c100feb6154d6e2a4b97f3 Mon Sep 17 00:00:00 2001
From: Rui-Sun
Date: Thu, 31 Oct 2024 20:01:57 +0800
Subject: [PATCH 54/65] fix: fix large number rows in updateRow()
---
.../group-creater/progress/proxy.ts | 6 +++++
.../src/scenegraph/layout/update-row.ts | 27 ++++++++++++-------
2 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/packages/vtable/src/scenegraph/group-creater/progress/proxy.ts b/packages/vtable/src/scenegraph/group-creater/progress/proxy.ts
index e2316a7f8..d5789caa9 100644
--- a/packages/vtable/src/scenegraph/group-creater/progress/proxy.ts
+++ b/packages/vtable/src/scenegraph/group-creater/progress/proxy.ts
@@ -171,6 +171,9 @@ export class SceneProxy {
const totalActualBodyRowCount = Math.min(this.rowLimit, this.bodyBottomRow - this.bodyTopRow + 1); // 渐进加载总row数量
this.totalActualBodyRowCount = totalActualBodyRowCount;
this.totalRow = this.rowStart + totalActualBodyRowCount - 1; // 目标渐进完成的row
+
+ this.rowStart = this.bodyTopRow;
+ this.rowEnd = this.totalRow; // temp for first screen, will replace in createGroupForFirstScreen()
}
refreshColCount() {
@@ -178,6 +181,9 @@ export class SceneProxy {
const totalActualBodyColCount = Math.min(this.colLimit, this.bodyRightCol - this.bodyLeftCol + 1);
this.totalActualBodyColCount = totalActualBodyColCount;
this.totalCol = this.bodyLeftCol + totalActualBodyColCount - 1; // 目标渐进完成的col
+
+ this.colStart = this.bodyLeftCol;
+ this.colEnd = this.totalCol; // temp for first screen, will replace in createGroupForFirstScreen()
}
resize() {
diff --git a/packages/vtable/src/scenegraph/layout/update-row.ts b/packages/vtable/src/scenegraph/layout/update-row.ts
index 3d563cce3..2f678aadf 100644
--- a/packages/vtable/src/scenegraph/layout/update-row.ts
+++ b/packages/vtable/src/scenegraph/layout/update-row.ts
@@ -83,17 +83,26 @@ export function updateRow(
for (let col = 0; col < table.colCount; col++) {
// add cells
- updateRows.forEach(r => {
- // updateRowAttr(row, scene);
- const mergeInfo = getCellMergeInfo(scene.table, col, r);
- if (mergeInfo) {
- for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) {
- for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {
- updateCell(col, row, scene.table, false);
+ updateRows.forEach(row => {
+ if (
+ row < table.frozenRowCount || // not top frozen
+ row > table.rowCount - 1 || // greater than rowCount - 1
+ (row < scene.table.rowCount - scene.table.bottomFrozenRowCount && // not bottom frozen
+ (row < scene.proxy.rowStart || row > scene.proxy.rowEnd)) // not in row range
+ ) {
+ removeCellGroup(row, scene);
+ } else {
+ // updateRowAttr(row, scene);
+ const mergeInfo = getCellMergeInfo(scene.table, col, row);
+ if (mergeInfo) {
+ for (let col = mergeInfo.start.col; col <= mergeInfo.end.col; col++) {
+ for (let row = mergeInfo.start.row; row <= mergeInfo.end.row; row++) {
+ updateCell(col, row, scene.table, false);
+ }
}
+ } else {
+ updateCell(col, row, scene.table, false);
}
- } else {
- updateCell(col, r, scene.table, false);
}
});
}
From 8fbf802db828485b1117f79c31a15276bbe607c1 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Thu, 31 Oct 2024 12:59:01 +0000
Subject: [PATCH 55/65] build: prelease version 1.10.2
---
...ature-justSelectBody_2024-10-22-09-28.json | 11 ---
...ature-justSelectBody_2024-10-23-04-12.json | 11 ---
...roup-rowSeriesNumber_2024-10-18-10-57.json | 11 ---
...roup-rowSeriesNumber_2024-10-20-14-00.json | 11 ---
...ug-minAggregator-NaN_2024-10-22-07-28.json | 11 ---
...g-freeze_click-event_2024-10-21-03-19.json | 11 ---
...dragSelect-rowNumber_2024-10-22-06-43.json | 11 ---
...ount-rowseriesnumber_2024-10-23-09-36.json | 11 ---
...stomMerge-checkState_2024-10-28-09-15.json | 11 ---
...yTip-ScrollBartoside_2024-10-29-08-44.json | 11 ---
...-cell-value-validate_2024-10-29-06-41.json | 11 ---
...ot-table-columnWdith_2024-10-30-03-49.json | 11 ---
...ield-set-array-error_2024-10-29-10-35.json | 11 ---
...-change-vtable-theme_2024-10-30-06-58.json | 11 ---
...x-check-state-update_2024-10-25-11-40.json | 10 ---
.../fix-list-editor_2024-10-28-08-52.json | 10 ---
...fix-pointerupoutside_2024-10-28-12-12.json | 10 ---
.../fix-react-event_2024-10-28-09-24.json | 10 ---
...fix-select-all-event_2024-10-25-12-11.json | 10 ---
...ct-all-series-number_2024-10-28-09-43.json | 10 ---
.../fix-title-resize_2024-10-29-13-01.json | 10 ---
common/config/rush/version-policies.json | 2 +-
packages/openinula-vtable/package.json | 2 +-
packages/react-vtable/package.json | 2 +-
packages/vtable-editors/package.json | 2 +-
packages/vtable-export/package.json | 2 +-
packages/vtable-gantt/package.json | 2 +-
packages/vtable-search/package.json | 2 +-
packages/vtable/CHANGELOG.json | 72 +++++++++++++++++++
packages/vtable/CHANGELOG.md | 57 ++++++++++++++-
packages/vtable/package.json | 2 +-
packages/vue-vtable/package.json | 2 +-
32 files changed, 137 insertions(+), 234 deletions(-)
delete mode 100644 common/changes/@visactor/vtable/2491-feature-justSelectBody_2024-10-22-09-28.json
delete mode 100644 common/changes/@visactor/vtable/2491-feature-justSelectBody_2024-10-23-04-12.json
delete mode 100644 common/changes/@visactor/vtable/2600-bug-group-rowSeriesNumber_2024-10-18-10-57.json
delete mode 100644 common/changes/@visactor/vtable/2600-bug-group-rowSeriesNumber_2024-10-20-14-00.json
delete mode 100644 common/changes/@visactor/vtable/2627-bug-minAggregator-NaN_2024-10-22-07-28.json
delete mode 100644 common/changes/@visactor/vtable/2641-bug-freeze_click-event_2024-10-21-03-19.json
delete mode 100644 common/changes/@visactor/vtable/2647-bug-dragSelect-rowNumber_2024-10-22-06-43.json
delete mode 100644 common/changes/@visactor/vtable/2653-bug-frozencolcount-rowseriesnumber_2024-10-23-09-36.json
delete mode 100644 common/changes/@visactor/vtable/2683-refactor-customMerge-checkState_2024-10-28-09-15.json
delete mode 100644 common/changes/@visactor/vtable/2690-bug-emptyTip-ScrollBartoside_2024-10-29-08-44.json
delete mode 100644 common/changes/@visactor/vtable/2691-paste-cell-value-validate_2024-10-29-06-41.json
delete mode 100644 common/changes/@visactor/vtable/2696-feature-pivot-table-columnWdith_2024-10-30-03-49.json
delete mode 100644 common/changes/@visactor/vtable/2702-bug-field-set-array-error_2024-10-29-10-35.json
delete mode 100644 common/changes/@visactor/vtable/2708-refactor-gantt-change-vtable-theme_2024-10-30-06-58.json
delete mode 100644 common/changes/@visactor/vtable/fix-check-state-update_2024-10-25-11-40.json
delete mode 100644 common/changes/@visactor/vtable/fix-list-editor_2024-10-28-08-52.json
delete mode 100644 common/changes/@visactor/vtable/fix-pointerupoutside_2024-10-28-12-12.json
delete mode 100644 common/changes/@visactor/vtable/fix-react-event_2024-10-28-09-24.json
delete mode 100644 common/changes/@visactor/vtable/fix-select-all-event_2024-10-25-12-11.json
delete mode 100644 common/changes/@visactor/vtable/fix-select-all-series-number_2024-10-28-09-43.json
delete mode 100644 common/changes/@visactor/vtable/fix-title-resize_2024-10-29-13-01.json
diff --git a/common/changes/@visactor/vtable/2491-feature-justSelectBody_2024-10-22-09-28.json b/common/changes/@visactor/vtable/2491-feature-justSelectBody_2024-10-22-09-28.json
deleted file mode 100644
index 53d7edb33..000000000
--- a/common/changes/@visactor/vtable/2491-feature-justSelectBody_2024-10-22-09-28.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "changes": [
- {
- "comment": "feat: headerSelectMode option add body setting #2491\n\n",
- "type": "none",
- "packageName": "@visactor/vtable"
- }
- ],
- "packageName": "@visactor/vtable",
- "email": "892739385@qq.com"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/2491-feature-justSelectBody_2024-10-23-04-12.json b/common/changes/@visactor/vtable/2491-feature-justSelectBody_2024-10-23-04-12.json
deleted file mode 100644
index 5b20e4f14..000000000
--- a/common/changes/@visactor/vtable/2491-feature-justSelectBody_2024-10-23-04-12.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "changes": [
- {
- "comment": "fix: isColumnHeader api judement logic #2491\n\n",
- "type": "none",
- "packageName": "@visactor/vtable"
- }
- ],
- "packageName": "@visactor/vtable",
- "email": "892739385@qq.com"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/2600-bug-group-rowSeriesNumber_2024-10-18-10-57.json b/common/changes/@visactor/vtable/2600-bug-group-rowSeriesNumber_2024-10-18-10-57.json
deleted file mode 100644
index 35d02063d..000000000
--- a/common/changes/@visactor/vtable/2600-bug-group-rowSeriesNumber_2024-10-18-10-57.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "changes": [
- {
- "comment": "fix: when collapse last group occor error #2600\n\n",
- "type": "none",
- "packageName": "@visactor/vtable"
- }
- ],
- "packageName": "@visactor/vtable",
- "email": "892739385@qq.com"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/2600-bug-group-rowSeriesNumber_2024-10-20-14-00.json b/common/changes/@visactor/vtable/2600-bug-group-rowSeriesNumber_2024-10-20-14-00.json
deleted file mode 100644
index 234ed84ae..000000000
--- a/common/changes/@visactor/vtable/2600-bug-group-rowSeriesNumber_2024-10-20-14-00.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "changes": [
- {
- "comment": "fix: when collapse tree node occor error #2600\n\n",
- "type": "none",
- "packageName": "@visactor/vtable"
- }
- ],
- "packageName": "@visactor/vtable",
- "email": "892739385@qq.com"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/2627-bug-minAggregator-NaN_2024-10-22-07-28.json b/common/changes/@visactor/vtable/2627-bug-minAggregator-NaN_2024-10-22-07-28.json
deleted file mode 100644
index 6117a8bdc..000000000
--- a/common/changes/@visactor/vtable/2627-bug-minAggregator-NaN_2024-10-22-07-28.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "changes": [
- {
- "comment": "fix: min aggregator type handle with NaN value #2627\n\n",
- "type": "none",
- "packageName": "@visactor/vtable"
- }
- ],
- "packageName": "@visactor/vtable",
- "email": "892739385@qq.com"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/2641-bug-freeze_click-event_2024-10-21-03-19.json b/common/changes/@visactor/vtable/2641-bug-freeze_click-event_2024-10-21-03-19.json
deleted file mode 100644
index 521852808..000000000
--- a/common/changes/@visactor/vtable/2641-bug-freeze_click-event_2024-10-21-03-19.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "changes": [
- {
- "comment": "feat: add freeze_click event #2641\n\n",
- "type": "none",
- "packageName": "@visactor/vtable"
- }
- ],
- "packageName": "@visactor/vtable",
- "email": "892739385@qq.com"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/2647-bug-dragSelect-rowNumber_2024-10-22-06-43.json b/common/changes/@visactor/vtable/2647-bug-dragSelect-rowNumber_2024-10-22-06-43.json
deleted file mode 100644
index dd081884d..000000000
--- a/common/changes/@visactor/vtable/2647-bug-dragSelect-rowNumber_2024-10-22-06-43.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "changes": [
- {
- "comment": "fix: when drag row series number cells not scroll #2647\n\n",
- "type": "none",
- "packageName": "@visactor/vtable"
- }
- ],
- "packageName": "@visactor/vtable",
- "email": "892739385@qq.com"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/2653-bug-frozencolcount-rowseriesnumber_2024-10-23-09-36.json b/common/changes/@visactor/vtable/2653-bug-frozencolcount-rowseriesnumber_2024-10-23-09-36.json
deleted file mode 100644
index fb53413c7..000000000
--- a/common/changes/@visactor/vtable/2653-bug-frozencolcount-rowseriesnumber_2024-10-23-09-36.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "changes": [
- {
- "comment": "fix: rowSeriesNumber when be frozen can render customlayout #2653\n\n",
- "type": "none",
- "packageName": "@visactor/vtable"
- }
- ],
- "packageName": "@visactor/vtable",
- "email": "892739385@qq.com"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/2683-refactor-customMerge-checkState_2024-10-28-09-15.json b/common/changes/@visactor/vtable/2683-refactor-customMerge-checkState_2024-10-28-09-15.json
deleted file mode 100644
index 5f6e1e398..000000000
--- a/common/changes/@visactor/vtable/2683-refactor-customMerge-checkState_2024-10-28-09-15.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "changes": [
- {
- "comment": "refactor: custom merge cell ignore check state jude #2683\n\n",
- "type": "none",
- "packageName": "@visactor/vtable"
- }
- ],
- "packageName": "@visactor/vtable",
- "email": "892739385@qq.com"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/2690-bug-emptyTip-ScrollBartoside_2024-10-29-08-44.json b/common/changes/@visactor/vtable/2690-bug-emptyTip-ScrollBartoside_2024-10-29-08-44.json
deleted file mode 100644
index 1acae8148..000000000
--- a/common/changes/@visactor/vtable/2690-bug-emptyTip-ScrollBartoside_2024-10-29-08-44.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "changes": [
- {
- "comment": "fix: when has empty tip scrollbar can not be clicked #2690\n\n",
- "type": "none",
- "packageName": "@visactor/vtable"
- }
- ],
- "packageName": "@visactor/vtable",
- "email": "892739385@qq.com"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/2691-paste-cell-value-validate_2024-10-29-06-41.json b/common/changes/@visactor/vtable/2691-paste-cell-value-validate_2024-10-29-06-41.json
deleted file mode 100644
index 3f7747ecd..000000000
--- a/common/changes/@visactor/vtable/2691-paste-cell-value-validate_2024-10-29-06-41.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "changes": [
- {
- "comment": "refactor: paste cell value should use editor validateValidate api #2691\n\n",
- "type": "none",
- "packageName": "@visactor/vtable"
- }
- ],
- "packageName": "@visactor/vtable",
- "email": "892739385@qq.com"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/2696-feature-pivot-table-columnWdith_2024-10-30-03-49.json b/common/changes/@visactor/vtable/2696-feature-pivot-table-columnWdith_2024-10-30-03-49.json
deleted file mode 100644
index 4cbb5b77e..000000000
--- a/common/changes/@visactor/vtable/2696-feature-pivot-table-columnWdith_2024-10-30-03-49.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "changes": [
- {
- "comment": "feat: add columnWidthConfig to set width by dimensions #2696\n\n",
- "type": "none",
- "packageName": "@visactor/vtable"
- }
- ],
- "packageName": "@visactor/vtable",
- "email": "892739385@qq.com"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/2702-bug-field-set-array-error_2024-10-29-10-35.json b/common/changes/@visactor/vtable/2702-bug-field-set-array-error_2024-10-29-10-35.json
deleted file mode 100644
index da2c37d14..000000000
--- a/common/changes/@visactor/vtable/2702-bug-field-set-array-error_2024-10-29-10-35.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "changes": [
- {
- "comment": "fix: when field set array,record no corresponding field,occur error #2702\n\n",
- "type": "none",
- "packageName": "@visactor/vtable"
- }
- ],
- "packageName": "@visactor/vtable",
- "email": "892739385@qq.com"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/2708-refactor-gantt-change-vtable-theme_2024-10-30-06-58.json b/common/changes/@visactor/vtable/2708-refactor-gantt-change-vtable-theme_2024-10-30-06-58.json
deleted file mode 100644
index fb359cfc5..000000000
--- a/common/changes/@visactor/vtable/2708-refactor-gantt-change-vtable-theme_2024-10-30-06-58.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "changes": [
- {
- "comment": "fix: when has gantt and table same time internal theme should not be changed #2708\n\n",
- "type": "none",
- "packageName": "@visactor/vtable"
- }
- ],
- "packageName": "@visactor/vtable",
- "email": "892739385@qq.com"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/fix-check-state-update_2024-10-25-11-40.json b/common/changes/@visactor/vtable/fix-check-state-update_2024-10-25-11-40.json
deleted file mode 100644
index 62d62c789..000000000
--- a/common/changes/@visactor/vtable/fix-check-state-update_2024-10-25-11-40.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "changes": [
- {
- "packageName": "@visactor/vtable",
- "comment": "fix: fix check state update #2667",
- "type": "none"
- }
- ],
- "packageName": "@visactor/vtable"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/fix-list-editor_2024-10-28-08-52.json b/common/changes/@visactor/vtable/fix-list-editor_2024-10-28-08-52.json
deleted file mode 100644
index 51e81d0ae..000000000
--- a/common/changes/@visactor/vtable/fix-list-editor_2024-10-28-08-52.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "changes": [
- {
- "packageName": "@visactor/vtable",
- "comment": "fix: fix list-editor space problem",
- "type": "none"
- }
- ],
- "packageName": "@visactor/vtable"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/fix-pointerupoutside_2024-10-28-12-12.json b/common/changes/@visactor/vtable/fix-pointerupoutside_2024-10-28-12-12.json
deleted file mode 100644
index 2eb35e853..000000000
--- a/common/changes/@visactor/vtable/fix-pointerupoutside_2024-10-28-12-12.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "changes": [
- {
- "packageName": "@visactor/vtable",
- "comment": "fix: change pointerupoutside event callback #2674 #2659",
- "type": "none"
- }
- ],
- "packageName": "@visactor/vtable"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/fix-react-event_2024-10-28-09-24.json b/common/changes/@visactor/vtable/fix-react-event_2024-10-28-09-24.json
deleted file mode 100644
index 6ec3518be..000000000
--- a/common/changes/@visactor/vtable/fix-react-event_2024-10-28-09-24.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "changes": [
- {
- "packageName": "@visactor/vtable",
- "comment": "fix: add event in react-vtable",
- "type": "none"
- }
- ],
- "packageName": "@visactor/vtable"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/fix-select-all-event_2024-10-25-12-11.json b/common/changes/@visactor/vtable/fix-select-all-event_2024-10-25-12-11.json
deleted file mode 100644
index 3c80cdfbd..000000000
--- a/common/changes/@visactor/vtable/fix-select-all-event_2024-10-25-12-11.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "changes": [
- {
- "packageName": "@visactor/vtable",
- "comment": "fix: add selected_cell event in select-all #2664",
- "type": "none"
- }
- ],
- "packageName": "@visactor/vtable"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/fix-select-all-series-number_2024-10-28-09-43.json b/common/changes/@visactor/vtable/fix-select-all-series-number_2024-10-28-09-43.json
deleted file mode 100644
index c9c642467..000000000
--- a/common/changes/@visactor/vtable/fix-select-all-series-number_2024-10-28-09-43.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "changes": [
- {
- "packageName": "@visactor/vtable",
- "comment": "fix: fix disableRowSeriesNumberSelect in select-all #2665",
- "type": "none"
- }
- ],
- "packageName": "@visactor/vtable"
-}
\ No newline at end of file
diff --git a/common/changes/@visactor/vtable/fix-title-resize_2024-10-29-13-01.json b/common/changes/@visactor/vtable/fix-title-resize_2024-10-29-13-01.json
deleted file mode 100644
index df6dfe748..000000000
--- a/common/changes/@visactor/vtable/fix-title-resize_2024-10-29-13-01.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "changes": [
- {
- "packageName": "@visactor/vtable",
- "comment": "fix: fix title resize in adaptive mode #2704",
- "type": "none"
- }
- ],
- "packageName": "@visactor/vtable"
-}
\ No newline at end of file
diff --git a/common/config/rush/version-policies.json b/common/config/rush/version-policies.json
index 2efe38df5..180af56ae 100644
--- a/common/config/rush/version-policies.json
+++ b/common/config/rush/version-policies.json
@@ -1 +1 @@
-[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"1.10.1","mainProject":"@visactor/vtable","nextBump":"patch"}]
+[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"1.10.2","mainProject":"@visactor/vtable","nextBump":"patch"}]
diff --git a/packages/openinula-vtable/package.json b/packages/openinula-vtable/package.json
index 64bbf9592..59294b1d3 100644
--- a/packages/openinula-vtable/package.json
+++ b/packages/openinula-vtable/package.json
@@ -1,6 +1,6 @@
{
"name": "@visactor/openinula-vtable",
- "version": "1.10.1",
+ "version": "1.10.2",
"description": "The openinula version of VTable",
"keywords": [
"openinula",
diff --git a/packages/react-vtable/package.json b/packages/react-vtable/package.json
index 55b9fd36e..a870811ab 100644
--- a/packages/react-vtable/package.json
+++ b/packages/react-vtable/package.json
@@ -1,6 +1,6 @@
{
"name": "@visactor/react-vtable",
- "version": "1.10.1",
+ "version": "1.10.2",
"description": "The react version of VTable",
"keywords": [
"react",
diff --git a/packages/vtable-editors/package.json b/packages/vtable-editors/package.json
index 5aa5d79cc..7c65728de 100644
--- a/packages/vtable-editors/package.json
+++ b/packages/vtable-editors/package.json
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable-editors",
- "version": "1.10.1",
+ "version": "1.10.2",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
diff --git a/packages/vtable-export/package.json b/packages/vtable-export/package.json
index 1e4c0f298..0d0188a07 100644
--- a/packages/vtable-export/package.json
+++ b/packages/vtable-export/package.json
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable-export",
- "version": "1.10.1",
+ "version": "1.10.2",
"description": "The export util of VTable",
"author": {
"name": "VisActor",
diff --git a/packages/vtable-gantt/package.json b/packages/vtable-gantt/package.json
index 39b0c28fc..2114b4cb0 100644
--- a/packages/vtable-gantt/package.json
+++ b/packages/vtable-gantt/package.json
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable-gantt",
- "version": "1.10.1",
+ "version": "1.10.2",
"description": "canvas table width high performance",
"keywords": [
"vtable-gantt",
diff --git a/packages/vtable-search/package.json b/packages/vtable-search/package.json
index ee2e243ba..11ba748bd 100644
--- a/packages/vtable-search/package.json
+++ b/packages/vtable-search/package.json
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable-search",
- "version": "1.10.1",
+ "version": "1.10.2",
"description": "The search util of VTable",
"author": {
"name": "VisActor",
diff --git a/packages/vtable/CHANGELOG.json b/packages/vtable/CHANGELOG.json
index 29b52965f..ba5e3fae0 100644
--- a/packages/vtable/CHANGELOG.json
+++ b/packages/vtable/CHANGELOG.json
@@ -1,6 +1,78 @@
{
"name": "@visactor/vtable",
"entries": [
+ {
+ "version": "1.10.2",
+ "tag": "@visactor/vtable_v1.10.2",
+ "date": "Thu, 31 Oct 2024 12:52:23 GMT",
+ "comments": {
+ "none": [
+ {
+ "comment": "feat: headerSelectMode option add body setting #2491\n\n"
+ },
+ {
+ "comment": "fix: isColumnHeader api judement logic #2491\n\n"
+ },
+ {
+ "comment": "fix: when collapse last group occor error #2600\n\n"
+ },
+ {
+ "comment": "fix: when collapse tree node occor error #2600\n\n"
+ },
+ {
+ "comment": "fix: min aggregator type handle with NaN value #2627\n\n"
+ },
+ {
+ "comment": "feat: add freeze_click event #2641\n\n"
+ },
+ {
+ "comment": "fix: when drag row series number cells not scroll #2647\n\n"
+ },
+ {
+ "comment": "fix: rowSeriesNumber when be frozen can render customlayout #2653\n\n"
+ },
+ {
+ "comment": "refactor: custom merge cell ignore check state jude #2683\n\n"
+ },
+ {
+ "comment": "fix: when has empty tip scrollbar can not be clicked #2690\n\n"
+ },
+ {
+ "comment": "refactor: paste cell value should use editor validateValidate api #2691\n\n"
+ },
+ {
+ "comment": "feat: add columnWidthConfig to set width by dimensions #2696\n\n"
+ },
+ {
+ "comment": "fix: when field set array,record no corresponding field,occur error #2702\n\n"
+ },
+ {
+ "comment": "fix: when has gantt and table same time internal theme should not be changed #2708\n\n"
+ },
+ {
+ "comment": "fix: fix check state update #2667"
+ },
+ {
+ "comment": "fix: fix list-editor space problem"
+ },
+ {
+ "comment": "fix: change pointerupoutside event callback #2674 #2659"
+ },
+ {
+ "comment": "fix: add event in react-vtable"
+ },
+ {
+ "comment": "fix: add selected_cell event in select-all #2664"
+ },
+ {
+ "comment": "fix: fix disableRowSeriesNumberSelect in select-all #2665"
+ },
+ {
+ "comment": "fix: fix title resize in adaptive mode #2704"
+ }
+ ]
+ }
+ },
{
"version": "1.10.1",
"tag": "@visactor/vtable_v1.10.1",
diff --git a/packages/vtable/CHANGELOG.md b/packages/vtable/CHANGELOG.md
index 46f972ab0..be9056bce 100644
--- a/packages/vtable/CHANGELOG.md
+++ b/packages/vtable/CHANGELOG.md
@@ -1,6 +1,61 @@
# Change Log - @visactor/vtable
-This log was last generated on Tue, 22 Oct 2024 09:49:27 GMT and should not be manually modified.
+This log was last generated on Thu, 31 Oct 2024 12:52:23 GMT and should not be manually modified.
+
+## 1.10.2
+Thu, 31 Oct 2024 12:52:23 GMT
+
+### Updates
+
+- feat: headerSelectMode option add body setting #2491
+
+
+- fix: isColumnHeader api judement logic #2491
+
+
+- fix: when collapse last group occor error #2600
+
+
+- fix: when collapse tree node occor error #2600
+
+
+- fix: min aggregator type handle with NaN value #2627
+
+
+- feat: add freeze_click event #2641
+
+
+- fix: when drag row series number cells not scroll #2647
+
+
+- fix: rowSeriesNumber when be frozen can render customlayout #2653
+
+
+- refactor: custom merge cell ignore check state jude #2683
+
+
+- fix: when has empty tip scrollbar can not be clicked #2690
+
+
+- refactor: paste cell value should use editor validateValidate api #2691
+
+
+- feat: add columnWidthConfig to set width by dimensions #2696
+
+
+- fix: when field set array,record no corresponding field,occur error #2702
+
+
+- fix: when has gantt and table same time internal theme should not be changed #2708
+
+
+- fix: fix check state update #2667
+- fix: fix list-editor space problem
+- fix: change pointerupoutside event callback #2674 #2659
+- fix: add event in react-vtable
+- fix: add selected_cell event in select-all #2664
+- fix: fix disableRowSeriesNumberSelect in select-all #2665
+- fix: fix title resize in adaptive mode #2704
## 1.10.1
Tue, 22 Oct 2024 09:49:27 GMT
diff --git a/packages/vtable/package.json b/packages/vtable/package.json
index e28face97..6b1edf2a3 100644
--- a/packages/vtable/package.json
+++ b/packages/vtable/package.json
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable",
- "version": "1.10.1",
+ "version": "1.10.2",
"description": "canvas table width high performance",
"keywords": [
"grid",
diff --git a/packages/vue-vtable/package.json b/packages/vue-vtable/package.json
index a154efe01..7bc6cee10 100644
--- a/packages/vue-vtable/package.json
+++ b/packages/vue-vtable/package.json
@@ -1,6 +1,6 @@
{
"name": "@visactor/vue-vtable",
- "version": "1.10.1",
+ "version": "1.10.2",
"description": "The vue version of VTable",
"keywords": [
"vue",
From c33e20c0f27e17ea35f4ce60e4fa85809677d937 Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Fri, 1 Nov 2024 10:28:35 +0800
Subject: [PATCH 56/65] fix: type define columnWidthConfig
---
packages/vtable/src/ts-types/table-engine.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/vtable/src/ts-types/table-engine.ts b/packages/vtable/src/ts-types/table-engine.ts
index 5fb7a4ee5..ed517ee56 100644
--- a/packages/vtable/src/ts-types/table-engine.ts
+++ b/packages/vtable/src/ts-types/table-engine.ts
@@ -332,7 +332,7 @@ export interface PivotTableConstructorOptions extends BaseTableConstructorOption
dimensions: IDimensionInfo[];
order: SortOrder;
}[];
- columnWidthConfig: {
+ columnWidthConfig?: {
dimensions: IDimensionInfo[];
width: number;
}[];
From f642ac2bdbd589b4a6489fbf9192864d2e2e13bc Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Fri, 1 Nov 2024 10:28:58 +0800
Subject: [PATCH 57/65] docs: update changlog of rush
---
...ype_define_columnWidthConfig_2024-11-01-02-28.json | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 common/changes/@visactor/vtable/fix-type_define_columnWidthConfig_2024-11-01-02-28.json
diff --git a/common/changes/@visactor/vtable/fix-type_define_columnWidthConfig_2024-11-01-02-28.json b/common/changes/@visactor/vtable/fix-type_define_columnWidthConfig_2024-11-01-02-28.json
new file mode 100644
index 000000000..7fcc26e62
--- /dev/null
+++ b/common/changes/@visactor/vtable/fix-type_define_columnWidthConfig_2024-11-01-02-28.json
@@ -0,0 +1,11 @@
+{
+ "changes": [
+ {
+ "comment": "fix: type define columnWidthConfig\n\n",
+ "type": "none",
+ "packageName": "@visactor/vtable"
+ }
+ ],
+ "packageName": "@visactor/vtable",
+ "email": "892739385@qq.com"
+}
\ No newline at end of file
From 10903da40f7061a5da81fd69467eec81cadb74fe Mon Sep 17 00:00:00 2001
From: fangsmile
Date: Fri, 1 Nov 2024 02:33:34 +0000
Subject: [PATCH 58/65] docs: generate changelog of release v1.10.2
---
docs/assets/changelog/en/release.md | 39 +++++++++++++++++++++++++++++
docs/assets/changelog/zh/release.md | 39 +++++++++++++++++++++++++++++
2 files changed, 78 insertions(+)
diff --git a/docs/assets/changelog/en/release.md b/docs/assets/changelog/en/release.md
index 42b70e24d..7400191f8 100644
--- a/docs/assets/changelog/en/release.md
+++ b/docs/assets/changelog/en/release.md
@@ -1,3 +1,42 @@
+# v1.10.2
+
+2024-11-01
+
+
+**🆕 New feature**
+
+- **@visactor/vtable**: headerSelectMode option add body setting [#2491](https://github.com/VisActor/VTable/issues/2491)
+- **@visactor/vtable**: add freeze_click event [#2641](https://github.com/VisActor/VTable/issues/2641)
+- **@visactor/vtable**: add columnWidthConfig to set width by dimensions [#2696](https://github.com/VisActor/VTable/issues/2696)
+
+**🐛 Bug fix**
+
+- **@visactor/vtable**: isColumnHeader api judement logic [#2491](https://github.com/VisActor/VTable/issues/2491)
+- **@visactor/vtable**: when collapse last group occor error [#2600](https://github.com/VisActor/VTable/issues/2600)
+- **@visactor/vtable**: when collapse tree node occor error [#2600](https://github.com/VisActor/VTable/issues/2600)
+- **@visactor/vtable**: min aggregator type handle with NaN value [#2627](https://github.com/VisActor/VTable/issues/2627)
+- **@visactor/vtable**: when drag row series number cells not scroll [#2647](https://github.com/VisActor/VTable/issues/2647)
+- **@visactor/vtable**: rowSeriesNumber when be frozen can render customlayout [#2653](https://github.com/VisActor/VTable/issues/2653)
+- **@visactor/vtable**: when has empty tip scrollbar can not be clicked [#2690](https://github.com/VisActor/VTable/issues/2690)
+- **@visactor/vtable**: when field set array,record no corresponding field,occur error [#2702](https://github.com/VisActor/VTable/issues/2702)
+- **@visactor/vtable**: when has gantt and table same time internal theme should not be changed [#2708](https://github.com/VisActor/VTable/issues/2708)
+- **@visactor/vtable**: fix check state update [#2667](https://github.com/VisActor/VTable/issues/2667)
+- **@visactor/vtable**: fix list-editor space problem
+- **@visactor/vtable**: change pointerupoutside event callback [#2674](https://github.com/VisActor/VTable/issues/2674) [#2659](https://github.com/VisActor/VTable/issues/2659)
+- **@visactor/vtable**: add event in react-vtable
+- **@visactor/vtable**: add selected_cell event in select-all [#2664](https://github.com/VisActor/VTable/issues/2664)
+- **@visactor/vtable**: fix disableRowSeriesNumberSelect in select-all [#2665](https://github.com/VisActor/VTable/issues/2665)
+- **@visactor/vtable**: fix title resize in adaptive mode [#2704](https://github.com/VisActor/VTable/issues/2704)
+
+**🔨 Refactor**
+
+- **@visactor/vtable**: custom merge cell ignore check state jude [#2683](https://github.com/VisActor/VTable/issues/2683)
+- **@visactor/vtable**: paste cell value should use editor validateValidate api [#2691](https://github.com/VisActor/VTable/issues/2691)
+
+
+
+[more detail about v1.10.2](https://github.com/VisActor/VTable/releases/tag/v1.10.2)
+
# v1.10.1
2024-10-23
diff --git a/docs/assets/changelog/zh/release.md b/docs/assets/changelog/zh/release.md
index f3c09676e..95c89ef30 100644
--- a/docs/assets/changelog/zh/release.md
+++ b/docs/assets/changelog/zh/release.md
@@ -1,3 +1,42 @@
+# v1.10.2
+
+2024-11-01
+
+
+**🆕 新增功能**
+
+- **@visactor/vtable**: headerSelectMode option add body setting [#2491](https://github.com/VisActor/VTable/issues/2491)
+- **@visactor/vtable**: add freeze_click event [#2641](https://github.com/VisActor/VTable/issues/2641)
+- **@visactor/vtable**: add columnWidthConfig to set width by dimensions [#2696](https://github.com/VisActor/VTable/issues/2696)
+
+**🐛 功能修复**
+
+- **@visactor/vtable**: isColumnHeader api judement logic [#2491](https://github.com/VisActor/VTable/issues/2491)
+- **@visactor/vtable**: when collapse last group occor error [#2600](https://github.com/VisActor/VTable/issues/2600)
+- **@visactor/vtable**: when collapse tree node occor error [#2600](https://github.com/VisActor/VTable/issues/2600)
+- **@visactor/vtable**: min aggregator type handle with NaN value [#2627](https://github.com/VisActor/VTable/issues/2627)
+- **@visactor/vtable**: when drag row series number cells not scroll [#2647](https://github.com/VisActor/VTable/issues/2647)
+- **@visactor/vtable**: rowSeriesNumber when be frozen can render customlayout [#2653](https://github.com/VisActor/VTable/issues/2653)
+- **@visactor/vtable**: when has empty tip scrollbar can not be clicked [#2690](https://github.com/VisActor/VTable/issues/2690)
+- **@visactor/vtable**: when field set array,record no corresponding field,occur error [#2702](https://github.com/VisActor/VTable/issues/2702)
+- **@visactor/vtable**: when has gantt and table same time internal theme should not be changed [#2708](https://github.com/VisActor/VTable/issues/2708)
+- **@visactor/vtable**: fix check state update [#2667](https://github.com/VisActor/VTable/issues/2667)
+- **@visactor/vtable**: fix list-editor space problem
+- **@visactor/vtable**: change pointerupoutside event callback [#2674](https://github.com/VisActor/VTable/issues/2674) [#2659](https://github.com/VisActor/VTable/issues/2659)
+- **@visactor/vtable**: add event in react-vtable
+- **@visactor/vtable**: add selected_cell event in select-all [#2664](https://github.com/VisActor/VTable/issues/2664)
+- **@visactor/vtable**: fix disableRowSeriesNumberSelect in select-all [#2665](https://github.com/VisActor/VTable/issues/2665)
+- **@visactor/vtable**: fix title resize in adaptive mode [#2704](https://github.com/VisActor/VTable/issues/2704)
+
+**🔨 功能重构**
+
+- **@visactor/vtable**: custom merge cell ignore check state jude [#2683](https://github.com/VisActor/VTable/issues/2683)
+- **@visactor/vtable**: paste cell value should use editor validateValidate api [#2691](https://github.com/VisActor/VTable/issues/2691)
+
+
+
+[更多详情请查看 v1.10.2](https://github.com/VisActor/VTable/releases/tag/v1.10.2)
+
# v1.10.1
2024-10-23
From b59a189c0294d42e31a690a0cd726ce81c60f84d Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Fri, 1 Nov 2024 11:26:12 +0800
Subject: [PATCH 59/65] docs: update release log
---
docs/assets/changelog/zh/release.md | 64 +++++++++++++++--------------
1 file changed, 33 insertions(+), 31 deletions(-)
diff --git a/docs/assets/changelog/zh/release.md b/docs/assets/changelog/zh/release.md
index 95c89ef30..ae338e96b 100644
--- a/docs/assets/changelog/zh/release.md
+++ b/docs/assets/changelog/zh/release.md
@@ -4,36 +4,38 @@
**🆕 新增功能**
-
-- **@visactor/vtable**: headerSelectMode option add body setting [#2491](https://github.com/VisActor/VTable/issues/2491)
-- **@visactor/vtable**: add freeze_click event [#2641](https://github.com/VisActor/VTable/issues/2641)
-- **@visactor/vtable**: add columnWidthConfig to set width by dimensions [#2696](https://github.com/VisActor/VTable/issues/2696)
-
-**🐛 功能修复**
-
-- **@visactor/vtable**: isColumnHeader api judement logic [#2491](https://github.com/VisActor/VTable/issues/2491)
-- **@visactor/vtable**: when collapse last group occor error [#2600](https://github.com/VisActor/VTable/issues/2600)
-- **@visactor/vtable**: when collapse tree node occor error [#2600](https://github.com/VisActor/VTable/issues/2600)
-- **@visactor/vtable**: min aggregator type handle with NaN value [#2627](https://github.com/VisActor/VTable/issues/2627)
-- **@visactor/vtable**: when drag row series number cells not scroll [#2647](https://github.com/VisActor/VTable/issues/2647)
-- **@visactor/vtable**: rowSeriesNumber when be frozen can render customlayout [#2653](https://github.com/VisActor/VTable/issues/2653)
-- **@visactor/vtable**: when has empty tip scrollbar can not be clicked [#2690](https://github.com/VisActor/VTable/issues/2690)
-- **@visactor/vtable**: when field set array,record no corresponding field,occur error [#2702](https://github.com/VisActor/VTable/issues/2702)
-- **@visactor/vtable**: when has gantt and table same time internal theme should not be changed [#2708](https://github.com/VisActor/VTable/issues/2708)
-- **@visactor/vtable**: fix check state update [#2667](https://github.com/VisActor/VTable/issues/2667)
-- **@visactor/vtable**: fix list-editor space problem
-- **@visactor/vtable**: change pointerupoutside event callback [#2674](https://github.com/VisActor/VTable/issues/2674) [#2659](https://github.com/VisActor/VTable/issues/2659)
-- **@visactor/vtable**: add event in react-vtable
-- **@visactor/vtable**: add selected_cell event in select-all [#2664](https://github.com/VisActor/VTable/issues/2664)
-- **@visactor/vtable**: fix disableRowSeriesNumberSelect in select-all [#2665](https://github.com/VisActor/VTable/issues/2665)
-- **@visactor/vtable**: fix title resize in adaptive mode [#2704](https://github.com/VisActor/VTable/issues/2704)
+# v1.10.2
+
+2024-11-01
+
+
+**🆕 新增功能**
+- **@visactor/vtable**: 添加headerSelectMode选项的可设置body [#2491](https://github.com/VisActor/VTable/issues/2491)
+- **@visactor/vtable**: 添加freeze_click事件 [#2641](https://github.com/VisActor/VTable/issues/2641)
+- **@visactor/vtable**: 透视表添加columnWidthConfig以根据维度设置宽度 [#2696](https://github.com/VisActor/VTable/issues/2696)
+
+**🐛 功能修复**
+
+- **@visactor/vtable**: 修正isColumnHeader api判断逻辑 [#2491](https://github.com/VisActor/VTable/issues/2491)
+- **@visactor/vtable**: 修复当折叠最后一个分组时发生错误 [#2600](https://github.com/VisActor/VTable/issues/2600)
+- **@visactor/vtable**: 修复最小聚合器类型处理NaN值 [#2627](https://github.com/VisActor/VTable/issues/2627)
+- **@visactor/vtable**: 修复当拖拽行系列编号单元格时不滚动问题 [#2647](https://github.com/VisActor/VTable/issues/2647)
+- **@visactor/vtable**: 修复当行系列编号被冻结时可以渲染自定义布局问题 [#2653](https://github.com/VisActor/VTable/issues/2653)
+- **@visactor/vtable**: 修复当有空提示时滚动条不能被点击的问题 [#2690](https://github.com/VisActor/VTable/issues/2690)
+- **@visactor/vtable**: 修复当字段设置为数组时,记录没有对应的字段,发生错误的问题 [#2702](https://github.com/VisActor/VTable/issues/2702)
+- **@visactor/vtable**: 修复当同时有甘特图和表格时,内部主题不应该被更改的问题 [#2708](https://github.com/VisActor/VTable/issues/2708)
+- **@visactor/vtable**: 修复检查状态更新 [#2667](https://github.com/VisActor/VTable/issues/2667)
+- **@visactor/vtable**: 修复列表编辑器空间问题
+- **@visactor/vtable**: 更改pointerupoutside事件回调 [#2674](https://github.com/VisActor/VTable/issues/2674) [#2659](https://github.com/VisActor/VTable/issues/2659)
+- **@visactor/vtable**: 在react-vtable中补充vtable中事件
+- **@visactor/vtable**: 在选择所有中添加selected_cell事件 [#2664](https://github.com/VisActor/VTable/issues/2664)
+- **@visactor/vtable**: 修复选择所有中的disableRowSeriesNumberSelect [#2665](https://github.com/VisActor/VTable/issues/2665)
+- **@visactor/vtable**: 修复自适应模式下的标题调整大小问题 [#2704](https://github.com/VisActor/VTable/issues/2704)
**🔨 功能重构**
-
-- **@visactor/vtable**: custom merge cell ignore check state jude [#2683](https://github.com/VisActor/VTable/issues/2683)
-- **@visactor/vtable**: paste cell value should use editor validateValidate api [#2691](https://github.com/VisActor/VTable/issues/2691)
-
+- **@visactor/vtable**: 自定义合并单元格忽略检查状态判断 [#2683](https://github.com/VisActor/VTable/issues/2683)
+- **@visactor/vtable**: 粘贴单元格值应该使用编辑器验证api [#2691](https://github.com/VisActor/VTable/issues/2691)
[更多详情请查看 v1.10.2](https://github.com/VisActor/VTable/releases/tag/v1.10.2)
@@ -43,10 +45,10 @@
**🐛 功能修复**
-
-- **@visactor/vtable**: when set rowSeriesNumber then sort icon not update [#2643](https://github.com/VisActor/VTable/issues/2643)
-- **@visactor/vtable**: disable cellInnerBorder when no frame border
-
+
+- **@visactor/vtable**: 当设置行系列编号时排序图标不更新 [#2643](https://github.com/VisActor/VTable/issues/2643)
+- **@visactor/vtable**: 当没有边框时禁用cellInnerBorder
+
[更多详情请查看 v1.10.1](https://github.com/VisActor/VTable/releases/tag/v1.10.1)
From 542f78cdeb6553e60423d3cf4b03c680b36456cc Mon Sep 17 00:00:00 2001
From: fangsmile <892739385@qq.com>
Date: Fri, 1 Nov 2024 11:35:59 +0800
Subject: [PATCH 60/65] docs: update release log
---
docs/assets/changelog/zh/release.md | 69 +++++++++++------------------
1 file changed, 26 insertions(+), 43 deletions(-)
diff --git a/docs/assets/changelog/zh/release.md b/docs/assets/changelog/zh/release.md
index ae338e96b..45e6e818a 100644
--- a/docs/assets/changelog/zh/release.md
+++ b/docs/assets/changelog/zh/release.md
@@ -2,23 +2,17 @@
2024-11-01
-
**🆕 新增功能**
-# v1.10.2
-
-2024-11-01
-
-**🆕 新增功能**
-- **@visactor/vtable**: 添加headerSelectMode选项的可设置body [#2491](https://github.com/VisActor/VTable/issues/2491)
-- **@visactor/vtable**: 添加freeze_click事件 [#2641](https://github.com/VisActor/VTable/issues/2641)
-- **@visactor/vtable**: 透视表添加columnWidthConfig以根据维度设置宽度 [#2696](https://github.com/VisActor/VTable/issues/2696)
+- **@visactor/vtable**: 添加 headerSelectMode 选项的可设置 body [#2491](https://github.com/VisActor/VTable/issues/2491)
+- **@visactor/vtable**: 添加 freeze_click 事件 [#2641](https://github.com/VisActor/VTable/issues/2641)
+- **@visactor/vtable**: 透视表添加 columnWidthConfig 以根据维度设置宽度 [#2696](https://github.com/VisActor/VTable/issues/2696)
**🐛 功能修复**
-- **@visactor/vtable**: 修正isColumnHeader api判断逻辑 [#2491](https://github.com/VisActor/VTable/issues/2491)
+- **@visactor/vtable**: 修正 isColumnHeader api 判断逻辑 [#2491](https://github.com/VisActor/VTable/issues/2491)
- **@visactor/vtable**: 修复当折叠最后一个分组时发生错误 [#2600](https://github.com/VisActor/VTable/issues/2600)
-- **@visactor/vtable**: 修复最小聚合器类型处理NaN值 [#2627](https://github.com/VisActor/VTable/issues/2627)
+- **@visactor/vtable**: 修复最小聚合器类型处理 NaN 值 [#2627](https://github.com/VisActor/VTable/issues/2627)
- **@visactor/vtable**: 修复当拖拽行系列编号单元格时不滚动问题 [#2647](https://github.com/VisActor/VTable/issues/2647)
- **@visactor/vtable**: 修复当行系列编号被冻结时可以渲染自定义布局问题 [#2653](https://github.com/VisActor/VTable/issues/2653)
- **@visactor/vtable**: 修复当有空提示时滚动条不能被点击的问题 [#2690](https://github.com/VisActor/VTable/issues/2690)
@@ -26,16 +20,16 @@
- **@visactor/vtable**: 修复当同时有甘特图和表格时,内部主题不应该被更改的问题 [#2708](https://github.com/VisActor/VTable/issues/2708)
- **@visactor/vtable**: 修复检查状态更新 [#2667](https://github.com/VisActor/VTable/issues/2667)
- **@visactor/vtable**: 修复列表编辑器空间问题
-- **@visactor/vtable**: 更改pointerupoutside事件回调 [#2674](https://github.com/VisActor/VTable/issues/2674) [#2659](https://github.com/VisActor/VTable/issues/2659)
-- **@visactor/vtable**: 在react-vtable中补充vtable中事件
-- **@visactor/vtable**: 在选择所有中添加selected_cell事件 [#2664](https://github.com/VisActor/VTable/issues/2664)
-- **@visactor/vtable**: 修复选择所有中的disableRowSeriesNumberSelect [#2665](https://github.com/VisActor/VTable/issues/2665)
+- **@visactor/vtable**: 更改 pointerupoutside 事件回调 [#2674](https://github.com/VisActor/VTable/issues/2674) [#2659](https://github.com/VisActor/VTable/issues/2659)
+- **@visactor/vtable**: 在 react-vtable 中补充 vtable 中事件
+- **@visactor/vtable**: 在选择所有中添加 selected_cell 事件 [#2664](https://github.com/VisActor/VTable/issues/2664)
+- **@visactor/vtable**: 修复选择所有中的 disableRowSeriesNumberSelect [#2665](https://github.com/VisActor/VTable/issues/2665)
- **@visactor/vtable**: 修复自适应模式下的标题调整大小问题 [#2704](https://github.com/VisActor/VTable/issues/2704)
**🔨 功能重构**
- **@visactor/vtable**: 自定义合并单元格忽略检查状态判断 [#2683](https://github.com/VisActor/VTable/issues/2683)
-- **@visactor/vtable**: 粘贴单元格值应该使用编辑器验证api [#2691](https://github.com/VisActor/VTable/issues/2691)
+- **@visactor/vtable**: 粘贴单元格值应该使用编辑器验证 api [#2691](https://github.com/VisActor/VTable/issues/2691)
[更多详情请查看 v1.10.2](https://github.com/VisActor/VTable/releases/tag/v1.10.2)
@@ -43,13 +37,10 @@
2024-10-23
-
**🐛 功能修复**
- **@visactor/vtable**: 当设置行系列编号时排序图标不更新 [#2643](https://github.com/VisActor/VTable/issues/2643)
-- **@visactor/vtable**: 当没有边框时禁用cellInnerBorder
-
-
+- **@visactor/vtable**: 当没有边框时禁用 cellInnerBorder
[更多详情请查看 v1.10.1](https://github.com/VisActor/VTable/releases/tag/v1.10.1)
@@ -57,25 +48,25 @@
2024-10-18
-
**🆕 新增功能**
-- **@visactor/vtable**: 在菜单容器中添加maxHeight [#2602](https://github.com/VisActor/VTable/issues/2602)
-- **@visactor/vtable**: 添加after_sort事件
+
+- **@visactor/vtable**: 在菜单容器中添加 maxHeight [#2602](https://github.com/VisActor/VTable/issues/2602)
+- **@visactor/vtable**: 添加 after_sort 事件
- **@visactor/vtable-gantt**: 添加未计划任务记录的创建按钮
- **@visactor/vtable-gantt**: 为甘特图添加依赖线
- **@visactor/vtable-gantt**: 添加任务条选中样式
- **@visactor/vtable-gantt**: 添加依赖线选中样式
-- **@visactor/vtable-gantt**: 为甘特图添加underlayBackgroundColor [#2607](https://github.com/VisActor/VTable/issues/2607)
+- **@visactor/vtable-gantt**: 为甘特图添加 underlayBackgroundColor [#2607](https://github.com/VisActor/VTable/issues/2607)
**🐛 功能修复**
- **@visactor/vtable**: 当维度路径包含虚拟时无法识别问题 [#2510](https://github.com/VisActor/VTable/issues/2510)
-- **@visactor/vtable**: toggleHierarchyState api无法更新自定义布局单元格 [#2609](https://github.com/VisActor/VTable/issues/2609)
+- **@visactor/vtable**: toggleHierarchyState api 无法更新自定义布局单元格 [#2609](https://github.com/VisActor/VTable/issues/2609)
- **@visactor/vtable**: 修复图例布局问题
-- **@visactor/vtable**: 修复borderLineWidth为0时边框矩形缺失的问题
-- **@visactor/vtable**: 修复updateSortState()中的多排序图标更新问题 [#2614](https://github.com/VisActor/VTable/issues/2614)
-- **@visactor/vtable**: 修复createGroupForFirstScreen()中的列/行结束问题 [#2585](https://github.com/VisActor/VTable/issues/2585)
-- **@visactor/vtable**: 修复react-vtable中的customConfig
+- **@visactor/vtable**: 修复 borderLineWidth 为 0 时边框矩形缺失的问题
+- **@visactor/vtable**: 修复 updateSortState()中的多排序图标更新问题 [#2614](https://github.com/VisActor/VTable/issues/2614)
+- **@visactor/vtable**: 修复 createGroupForFirstScreen()中的列/行结束问题 [#2585](https://github.com/VisActor/VTable/issues/2585)
+- **@visactor/vtable**: 修复 react-vtable 中的 customConfig
- **@visactor/vtable**: 修复当垂直滚动时行调整标记位置的问题 [#2606](https://github.com/VisActor/VTable/issues/2606)
- **@visactor/vtable**: 修复列表-表格转置中的排序图标更新问题
@@ -85,36 +76,32 @@
2024-10-12
-
**🐛 功能修复**
- **@visactor/vtable**: 修复合并单元格中的排序图标更新问题
-
-
[更多详情请查看 v1.9.1](https://github.com/VisActor/VTable/releases/tag/v1.9.1)
# v1.9.0
2024-10-11
-
**🆕 新增功能**
-- **@visactor/vtable**: 增加scrollTo动画功能
+- **@visactor/vtable**: 增加 scrollTo 动画功能
**🐛 功能修复**
- **@visactor/vtable**: 修复无数据时维度列宽计算 [#2515](https://github.com/VisActor/VTable/issues/2515)
-- **@visactor/vtable**: 修复updateColumns调用时的聚合更新 [#2519](https://github.com/VisActor/VTable/issues/2519)
-- **@visactor/vtable**: 修复pointerdown事件中outsideClickDeselect判断时机 [#2553](https://github.com/VisActor/VTable/issues/2553)
+- **@visactor/vtable**: 修复 updateColumns 调用时的聚合更新 [#2519](https://github.com/VisActor/VTable/issues/2519)
+- **@visactor/vtable**: 修复 pointerdown 事件中 outsideClickDeselect 判断时机 [#2553](https://github.com/VisActor/VTable/issues/2553)
- **@visactor/vtable**: 修复序号列排序问题 [#2558](https://github.com/VisActor/VTable/issues/2558)
- **@visactor/vtable**: 修复底部单元格选中无法自动滚动问题 [#2546](https://github.com/VisActor/VTable/issues/2546)
- **@visactor/vtable**: 修复自定义组件自动行高列宽的计算问题
- **@visactor/vtable**: 修复拖拽行列时自定义组件的闪烁问题 [#2516](https://github.com/VisActor/VTable/issues/2516)
- **@visactor/vtable**: 修复冻结单元格中自定义组件的更新问题 [#2568](https://github.com/VisActor/VTable/issues/2568)
-- **@visactor/vtable**: 修复带有padding的图例布局计算
-- **@visactor/vtable**: 修复创建单元格时的cellLocation计算问题 [#2517](https://github.com/VisActor/VTable/issues/2517)
+- **@visactor/vtable**: 修复带有 padding 的图例布局计算
+- **@visactor/vtable**: 修复创建单元格时的 cellLocation 计算问题 [#2517](https://github.com/VisActor/VTable/issues/2517)
- **@visactor/vtable**: 修复合并单元格选中区域记录 [#2521](https://github.com/VisActor/VTable/issues/2521)
**🔨 功能重构**
@@ -127,23 +114,19 @@
2024-10-08
-
**🐛 功能修复**
- **@visactor/vtable**: 修复富文本图标状态更新问题 [#2281](https://github.com/VisActor/VTable/issues/2281)
-
-
[更多详情请查看 v1.8.2](https://github.com/VisActor/VTable/releases/tag/v1.8.2)
# v1.8.1
2024-09-30
-
**🔨 功能重构**
-- **@visactor/vue-vtable**: 重命名vue组件
+- **@visactor/vue-vtable**: 重命名 vue 组件
[更多详情请查看 v1.8.1](https://github.com/VisActor/VTable/releases/tag/v1.8.1)
From 4e196f19b1bd27fba322624a53705f65a8e5d942 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Fri, 1 Nov 2024 03:37:18 +0000
Subject: [PATCH 61/65] build: prelease version 1.10.3
---
...pe_define_columnWidthConfig_2024-11-01-02-28.json | 11 -----------
common/config/rush/version-policies.json | 2 +-
packages/openinula-vtable/package.json | 2 +-
packages/react-vtable/package.json | 2 +-
packages/vtable-editors/package.json | 2 +-
packages/vtable-export/package.json | 2 +-
packages/vtable-gantt/package.json | 2 +-
packages/vtable-search/package.json | 2 +-
packages/vtable/CHANGELOG.json | 12 ++++++++++++
packages/vtable/CHANGELOG.md | 11 ++++++++++-
packages/vtable/package.json | 2 +-
packages/vue-vtable/package.json | 2 +-
12 files changed, 31 insertions(+), 21 deletions(-)
delete mode 100644 common/changes/@visactor/vtable/fix-type_define_columnWidthConfig_2024-11-01-02-28.json
diff --git a/common/changes/@visactor/vtable/fix-type_define_columnWidthConfig_2024-11-01-02-28.json b/common/changes/@visactor/vtable/fix-type_define_columnWidthConfig_2024-11-01-02-28.json
deleted file mode 100644
index 7fcc26e62..000000000
--- a/common/changes/@visactor/vtable/fix-type_define_columnWidthConfig_2024-11-01-02-28.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "changes": [
- {
- "comment": "fix: type define columnWidthConfig\n\n",
- "type": "none",
- "packageName": "@visactor/vtable"
- }
- ],
- "packageName": "@visactor/vtable",
- "email": "892739385@qq.com"
-}
\ No newline at end of file
diff --git a/common/config/rush/version-policies.json b/common/config/rush/version-policies.json
index 180af56ae..e96c544c3 100644
--- a/common/config/rush/version-policies.json
+++ b/common/config/rush/version-policies.json
@@ -1 +1 @@
-[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"1.10.2","mainProject":"@visactor/vtable","nextBump":"patch"}]
+[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"1.10.3","mainProject":"@visactor/vtable","nextBump":"patch"}]
diff --git a/packages/openinula-vtable/package.json b/packages/openinula-vtable/package.json
index 59294b1d3..5bf359f45 100644
--- a/packages/openinula-vtable/package.json
+++ b/packages/openinula-vtable/package.json
@@ -1,6 +1,6 @@
{
"name": "@visactor/openinula-vtable",
- "version": "1.10.2",
+ "version": "1.10.3",
"description": "The openinula version of VTable",
"keywords": [
"openinula",
diff --git a/packages/react-vtable/package.json b/packages/react-vtable/package.json
index a870811ab..0637ee1ab 100644
--- a/packages/react-vtable/package.json
+++ b/packages/react-vtable/package.json
@@ -1,6 +1,6 @@
{
"name": "@visactor/react-vtable",
- "version": "1.10.2",
+ "version": "1.10.3",
"description": "The react version of VTable",
"keywords": [
"react",
diff --git a/packages/vtable-editors/package.json b/packages/vtable-editors/package.json
index 7c65728de..6b90c0343 100644
--- a/packages/vtable-editors/package.json
+++ b/packages/vtable-editors/package.json
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable-editors",
- "version": "1.10.2",
+ "version": "1.10.3",
"description": "",
"sideEffects": false,
"main": "cjs/index.js",
diff --git a/packages/vtable-export/package.json b/packages/vtable-export/package.json
index 0d0188a07..da43314d4 100644
--- a/packages/vtable-export/package.json
+++ b/packages/vtable-export/package.json
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable-export",
- "version": "1.10.2",
+ "version": "1.10.3",
"description": "The export util of VTable",
"author": {
"name": "VisActor",
diff --git a/packages/vtable-gantt/package.json b/packages/vtable-gantt/package.json
index 2114b4cb0..de746a36a 100644
--- a/packages/vtable-gantt/package.json
+++ b/packages/vtable-gantt/package.json
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable-gantt",
- "version": "1.10.2",
+ "version": "1.10.3",
"description": "canvas table width high performance",
"keywords": [
"vtable-gantt",
diff --git a/packages/vtable-search/package.json b/packages/vtable-search/package.json
index 11ba748bd..d870eb5f5 100644
--- a/packages/vtable-search/package.json
+++ b/packages/vtable-search/package.json
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable-search",
- "version": "1.10.2",
+ "version": "1.10.3",
"description": "The search util of VTable",
"author": {
"name": "VisActor",
diff --git a/packages/vtable/CHANGELOG.json b/packages/vtable/CHANGELOG.json
index ba5e3fae0..0895e9096 100644
--- a/packages/vtable/CHANGELOG.json
+++ b/packages/vtable/CHANGELOG.json
@@ -1,6 +1,18 @@
{
"name": "@visactor/vtable",
"entries": [
+ {
+ "version": "1.10.3",
+ "tag": "@visactor/vtable_v1.10.3",
+ "date": "Fri, 01 Nov 2024 03:33:15 GMT",
+ "comments": {
+ "none": [
+ {
+ "comment": "fix: type define columnWidthConfig\n\n"
+ }
+ ]
+ }
+ },
{
"version": "1.10.2",
"tag": "@visactor/vtable_v1.10.2",
diff --git a/packages/vtable/CHANGELOG.md b/packages/vtable/CHANGELOG.md
index be9056bce..2c7aafe17 100644
--- a/packages/vtable/CHANGELOG.md
+++ b/packages/vtable/CHANGELOG.md
@@ -1,6 +1,15 @@
# Change Log - @visactor/vtable
-This log was last generated on Thu, 31 Oct 2024 12:52:23 GMT and should not be manually modified.
+This log was last generated on Fri, 01 Nov 2024 03:33:15 GMT and should not be manually modified.
+
+## 1.10.3
+Fri, 01 Nov 2024 03:33:15 GMT
+
+### Updates
+
+- fix: type define columnWidthConfig
+
+
## 1.10.2
Thu, 31 Oct 2024 12:52:23 GMT
diff --git a/packages/vtable/package.json b/packages/vtable/package.json
index 6b1edf2a3..dd8eb5b98 100644
--- a/packages/vtable/package.json
+++ b/packages/vtable/package.json
@@ -1,6 +1,6 @@
{
"name": "@visactor/vtable",
- "version": "1.10.2",
+ "version": "1.10.3",
"description": "canvas table width high performance",
"keywords": [
"grid",
diff --git a/packages/vue-vtable/package.json b/packages/vue-vtable/package.json
index 7bc6cee10..638c285c6 100644
--- a/packages/vue-vtable/package.json
+++ b/packages/vue-vtable/package.json
@@ -1,6 +1,6 @@
{
"name": "@visactor/vue-vtable",
- "version": "1.10.2",
+ "version": "1.10.3",
"description": "The vue version of VTable",
"keywords": [
"vue",
From c86718925f0e7fe966ffd14b7d8b36f8fc2fa32e Mon Sep 17 00:00:00 2001
From: fangsmile
Date: Fri, 1 Nov 2024 03:51:00 +0000
Subject: [PATCH 62/65] docs: generate changelog of release v1.10.3
---
docs/assets/changelog/en/release.md | 13 +++++++++++++
docs/assets/changelog/zh/release.md | 13 +++++++++++++
2 files changed, 26 insertions(+)
diff --git a/docs/assets/changelog/en/release.md b/docs/assets/changelog/en/release.md
index 7400191f8..4d6e26855 100644
--- a/docs/assets/changelog/en/release.md
+++ b/docs/assets/changelog/en/release.md
@@ -1,3 +1,16 @@
+# v1.10.3
+
+2024-11-01
+
+
+**🐛 Bug fix**
+
+- **@visactor/vtable**: type define columnWidthConfig
+
+
+
+[more detail about v1.10.3](https://github.com/VisActor/VTable/releases/tag/v1.10.3)
+
# v1.10.2
2024-11-01
diff --git a/docs/assets/changelog/zh/release.md b/docs/assets/changelog/zh/release.md
index ae338e96b..54b5e7463 100644
--- a/docs/assets/changelog/zh/release.md
+++ b/docs/assets/changelog/zh/release.md
@@ -1,3 +1,16 @@
+# v1.10.3
+
+2024-11-01
+
+
+**🐛 功能修复**
+
+- **@visactor/vtable**: type define columnWidthConfig
+
+
+
+[更多详情请查看 v1.10.3](https://github.com/VisActor/VTable/releases/tag/v1.10.3)
+
# v1.10.2
2024-11-01
From ada47b984c53057ac4078643d1447754c261d7a8 Mon Sep 17 00:00:00 2001
From: YEL!ne <1638317920@qq.com>
Date: Fri, 1 Nov 2024 14:23:56 +0800
Subject: [PATCH 63/65] feat: refactor utils to optimize functionality
---
packages/vue-vtable/src/tables/base-table.vue | 15 +--
packages/vue-vtable/src/tables/list-table.vue | 60 +---------
.../vue-vtable/src/tables/pivot-chart.vue | 62 ++--------
.../vue-vtable/src/tables/pivot-table.vue | 58 ++-------
packages/vue-vtable/src/tables/utils.ts | 112 +++++++++++++++++-
packages/vue-vtable/src/utils.ts | 4 +
.../vue-vtable/src/utils/customLayoutUtils.ts | 100 ++++++++++++++++
packages/vue-vtable/src/utils/slotUtils.ts | 82 +++++++++++++
packages/vue-vtable/src/utils/stringUtils.ts | 16 +++
packages/vue-vtable/src/utils/vnodeUtils.ts | 4 +
10 files changed, 345 insertions(+), 168 deletions(-)
create mode 100644 packages/vue-vtable/src/utils.ts
create mode 100644 packages/vue-vtable/src/utils/customLayoutUtils.ts
create mode 100644 packages/vue-vtable/src/utils/slotUtils.ts
create mode 100644 packages/vue-vtable/src/utils/stringUtils.ts
create mode 100644 packages/vue-vtable/src/utils/vnodeUtils.ts
diff --git a/packages/vue-vtable/src/tables/base-table.vue b/packages/vue-vtable/src/tables/base-table.vue
index b33e71237..bc5631ce4 100644
--- a/packages/vue-vtable/src/tables/base-table.vue
+++ b/packages/vue-vtable/src/tables/base-table.vue
@@ -57,6 +57,10 @@ const bindEvents = (instance: IVTable) => {
};
// 创建表格实例
+const createTableInstance = (Type: new (container: HTMLElement, options: IOption) => IVTable, options: IOption) => {
+ vTableInstance.value = new Type(vTableContainer.value!, options);
+};
+
const createVTable = () => {
if (!vTableContainer.value) return;
@@ -68,10 +72,6 @@ const createVTable = () => {
return props.records !== undefined && props.records !== null && props.records.length > 0 ? props.records : props.options.records;
};
- const createTableInstance = (Type: any, options: any) => {
- vTableInstance.value = new Type(vTableContainer.value, options);
- };
-
try {
switch (props.type) {
case 'list':
@@ -96,8 +96,8 @@ const createVTable = () => {
bindEvents(vTableInstance.value);
props.onReady?.(vTableInstance.value, true);
} catch (err) {
- // props.onError?.(err as Error);
- console.error(err);
+ console.error('Error creating table instance:', err);
+ props.onError?.(err as Error);
}
};
@@ -134,6 +134,7 @@ onBeforeUnmount(() => vTableInstance.value?.release());
// 监听 options 属性的变化
// 需要去做细颗粒度的比较
+// deep 选中会导致tree失效
watch(
() => props.options,
(newOptions) => {
@@ -143,7 +144,7 @@ watch(
createVTable();
}
},
- { deep: true },
+ // { deep: true },
);
// 监听 records 属性的变化并更新表格
diff --git a/packages/vue-vtable/src/tables/list-table.vue b/packages/vue-vtable/src/tables/list-table.vue
index 9310cb6d4..f44feeeb0 100644
--- a/packages/vue-vtable/src/tables/list-table.vue
+++ b/packages/vue-vtable/src/tables/list-table.vue
@@ -14,11 +14,9 @@