Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
09e2a94
feat: column header of the ListTable supports folding
Apr 2, 2025
d7ed551
fix: mobile touch event resize column width #3693
fangsmile Apr 3, 2025
ebfea82
docs: update changlog of rush
fangsmile Apr 3, 2025
8dd8aa4
docs: add docs and guide of ListTable header folding
Apr 3, 2025
32a3598
chore: listtable header grouping configuration parameter name modific…
Apr 3, 2025
81563b7
Merge pull request #3691 from 7dingdang0/feat/listtree-columntree-col…
fangsmile Apr 3, 2025
c723daf
Merge pull request #3698 from VisActor/develop
fangsmile Apr 3, 2025
7f61042
docs: update changlog of rush
fangsmile Apr 3, 2025
609790a
docs: update changelog
fangsmile Apr 3, 2025
4a981ea
fix: list table create DimensionTree
fangsmile Apr 3, 2025
422c3c0
fix: frame border set array render bottom line position error #3684
fangsmile Apr 7, 2025
2237993
docs: update changlog of rush
fangsmile Apr 7, 2025
0edd814
fix: when set frozen disableDragSelect not work #3702
fangsmile Apr 7, 2025
e064f4e
docs: update changlog of rush
fangsmile Apr 7, 2025
c79ab7c
Merge remote-tracking branch 'origin/develop' into feat/cornerHeaderS…
fangsmile Apr 7, 2025
5af5a00
fix: updateTaskRecord api #3639
fangsmile Apr 7, 2025
7751c7e
docs: update changlog of rush
fangsmile Apr 7, 2025
18fadbd
fix: when move tree node position code occor error #3645 #3706
fangsmile Apr 8, 2025
04aae32
docs: update changlog of rush
fangsmile Apr 8, 2025
8bcd898
refactor: computeColsWidth api call time
fangsmile Apr 8, 2025
e7f922c
feat: listTable added tiggerEvent parameter to changeCellValue
BlInYo Apr 5, 2025
5de71ec
docs: update changlog of rush
BlInYo Apr 8, 2025
247611c
fix: repeat call computeColsWidth adaptive mode result error
fangsmile Apr 9, 2025
5d3f0d7
docs: update changlog of rush
fangsmile Apr 9, 2025
63fcb95
Merge pull request #3700 from BlInYo/feat/changeCellValue
fangsmile Apr 9, 2025
2d76bc2
docs: correct the dropdown menu click event name
libondev Apr 10, 2025
2b35e78
Merge pull request #3720 from libondev/develop
fangsmile Apr 10, 2025
6e170b2
fix: fix flex layout update in react-custom-layout component #3696
Rui-Sun Apr 9, 2025
0c665e9
Merge pull request #3694 from VisActor/3693-bug-mobile-touch-event-error
fangsmile Apr 10, 2025
e38af15
Merge pull request #3695 from VisActor/feat/cornerHeaderSelectMode
fangsmile Apr 10, 2025
3de23fe
Merge pull request #3697 from VisActor/feat/listtable-columntree
fangsmile Apr 10, 2025
fae89ff
Merge pull request #3701 from VisActor/3684-bug-frame-border-with-array
fangsmile Apr 10, 2025
f16c6d6
Merge pull request #3707 from VisActor/fix/gantt-updateRecord
fangsmile Apr 10, 2025
865ea4f
Merge pull request #3708 from VisActor/3702-bug-disabledragselect-fro…
fangsmile Apr 10, 2025
f179464
Merge pull request #3709 from VisActor/3645-bug-tree-node-move-positi…
fangsmile Apr 10, 2025
cc2a253
Merge pull request #3711 from VisActor/refactor/computeColsWidth_api_…
fangsmile Apr 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: when move tree node position code occor error #3645 #3706\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "892739385@qq.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: frame border set array render bottom line position error #3684\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "892739385@qq.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: mobile touch event resize column width #3693\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "892739385@qq.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: when set frozen disableDragSelect not work #3702\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "892739385@qq.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "feat: listTable added tiggerEvent parameter to changeCellValue\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "blinyo@163.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "feat: list table header support hierarchy \n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "892739385@qq.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vtable",
"comment": "fix: fix flex layout update in react-custom-layout component #3696",
"type": "none"
}
],
"packageName": "@visactor/vtable"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: updateTaskRecord api #3639\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "892739385@qq.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"comment": "fix: repeat call computeColsWidth adaptive mode result error\n\n",
"type": "none",
"packageName": "@visactor/vtable"
}
],
"packageName": "@visactor/vtable",
"email": "892739385@qq.com"
}
4 changes: 2 additions & 2 deletions docs/assets/api/en/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ Change the value of a cell:
```

/\*_ Set the value of the cell. Note that it corresponds to the original value of the source data, and the vtable instance records will be modified accordingly _/
changeCellValue: (col: number, row: number, value: string | number | null, workOnEditableCell = false) => void;
changeCellValue: (col: number, row: number, value: string | number | null, workOnEditableCell = false, triggerEvent = true) => void;

```

Expand All @@ -1077,7 +1077,7 @@ Change the value of cells in batches:
- @param row The starting row number of pasted data
- @param values Data array of multiple cells
\*/
changeCellValues(startCol: number, startRow: number, values: string[][])
changeCellValues(startCol: number, startRow: number, values: string[][], workOnEditableCell = false, triggerEvent=true) => void;

```

Expand Down
14 changes: 11 additions & 3 deletions docs/assets/api/zh/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -956,8 +956,15 @@ use case: 对于透视图的场景上,点击图例项后 更新过滤规则
更改单元格的 value 值:

```
/** 设置单元格的value值,注意对应的是源数据的原始值,vtable实例records会做对应修改 */
changeCellValue: (col: number, row: number, value: string | number | null, workOnEditableCell = false) => void;
/**
* 设置单元格的value值,注意对应的是源数据的原始值,vtable实例records会做对应修改
* @param col 单元格的起始列号
* @param row 单元格的起始行号
* @param value 更改后的值
* @param workOnEditableCell 是否仅更改可编辑单元格
* @param triggerEvent 是否在值发生改变的时候触发change_cell_value事件
*/
changeCellValue: (col: number, row: number, value: string | number | null, workOnEditableCell = false, triggerEvent = true) => void;
```

## changeCellValues(Function)
Expand All @@ -971,8 +978,9 @@ use case: 对于透视图的场景上,点击图例项后 更新过滤规则
* @param row 粘贴数据的起始行号
* @param values 多个单元格的数据数组
* @param workOnEditableCell 是否仅更改可编辑单元格
* @param triggerEvent 是否在值发生改变的时候触发change_cell_value事件
*/
changeCellValues(startCol: number, startRow: number, values: string[][], workOnEditableCell = false)
changeCellValues(startCol: number, startRow: number, values: string[][], workOnEditableCell = false, triggerEvent=true) => void;
```

## getEditor(Function)
Expand Down
181 changes: 60 additions & 121 deletions docs/assets/demo-vue/en/custom-layout/cell-dom-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,76 @@ link: custom_define/vue-dom-component

# Cell Rendering DOM Components

In `vue-vtable`, it is possible to directly render DOM components within cells, allowing for the easy embedding of complex Vue components to achieve highly customized table display effects. Two forms are supported: **slot-based** and **directly passing into the `column` configuration**. Both methods require wrapping with the `Group` component.
In `vue-vtable`, you can directly render DOM components within table cells, enabling seamless integration of complex Vue components for highly customizable table displays. Two approaches are supported: **slot-based** and **directly passing components into the `column` configuration**. Both methods require wrapping components with the `Group` component.

Detailed Explanation:
**🛠️ Core configuration steps: Enable DOM component rendering**

**Key point 1. Enabling the Feature**
To render DOM components in `vue-vtable`, follow these key steps:

In `vue-vtable`, rendering DOM components requires two key steps:
- **Pass the `vue` property to the `Group` component**: This allows the `Group` component to recognize and process Vue components.
- **Enable `customConfig.createReactContainer`**: This configuration creates a table container to ensure Vue components render correctly within the table.

- **Pass the `vue` property in the `Group` component**: This allows the `Group` component to recognize and handle Vue components.
- **Enable `customConfig.createReactContainer`**: This configuration item is used to create a table container, ensuring that Vue components can be correctly rendered into the table container.
**✨ Method 1: Slot-Based Rendering**

**Key point 2. Slot-Based Rendering**
Slot-based rendering uses the `headerCustomLayout` and `customLayout` slots of the `ListColumn` component. Custom components must be wrapped in the `Group` component.

Slot-based rendering is achieved through the two slots `headerCustomLayout` and `customLayout` of the `ListColumn` component. Custom components need to be wrapped with the `Group` component.
- **`headerCustomLayout`**: Customizes header cell rendering.
- **`customLayout`**: Customizes body cell rendering.

- **`headerCustomLayout`**: Used for custom rendering of header cells.
- **`customLayout`**: Used for custom rendering of body cells.
**✨ Method 2: Direct Configuration-Based Rendering**

**Key point 3. Direct Configuration-Based Rendering**
This method is similar to slot-based rendering but does not use slots. Instead, directly pass virtual nodes via the `element` property in the `column.headerCustomLayout` or `column.customLayout` configuration. The usage aligns with [Custom Components](../../guide/custom_define/custom_layout).

Direct configuration-based rendering is similar to slot-based rendering, with the difference being that you do not need to pass components through slots. Instead, you directly pass virtual nodes in the `element` property of the `column.headerCustomLayout` or `column.customLayout` configuration. The usage is largely the same as with [custom components](../../guide/custom_define/custom_layout).
**⚠️ Notes**

## Code Demonstration
- **Enabling Interactions**: If custom cells require mouse interactions, manually enable `pointer-events`. See the example below.

```javascript livedemo template=vtable-vue

// In the code demonstration, we show how to render custom Vue components within the table. Specifically, it includes:
## Code Demo

// - **Gender Column**: Uses the `ArcoDesignVue.Tag` component to render gender information and dynamically changes the tag color based on the gender value.
// - **Comment Column**: Uses the `ArcoDesignVue.Comment` component to render comment information, including like, collect, and reply action buttons.
```javascript livedemo template=vtable-vue
// In this demo, we show how to render custom Vue components in the table. Specifically:
// - **Gender Column**: Renders gender headers using the `ArcoDesignVue.Tag` component.
// - **Comment Column**: Renders comments with the `ArcoDesignVue.Comment` component, including action buttons for likes, favorites, and replies.

const app = createApp({
template: `
<vue-list-table :options="option" :records="records" ref="tableRef" />
<vue-list-table :options="option" :records="records" ref="tableRef">
<ListColumn field="name" title="Name" width="200" />
<ListColumn field="age" title="Age" width="150" />
<ListColumn field="city" title="City" width="150" />
<ListColumn field="gender" title="Gender" width="100">
<template #headerCustomLayout="{ width, height }">
<Group :width="width" :height="height" display="flex" align-items="center" :vue="{}">
<ATag color="green"> Gender </ATag>
</Group>
</template>
</ListColumn>
<ListColumn field="comment" title="Comment" width="300">
<template #customLayout="{ width, height, record }">
<Group :width="width" :height="height" display="flex" align-items="center" :vue="{}">
<AComment author="Socrates" :content="record['comment']" datetime="1 hour">
<template #actions>
<span key="heart" style="cursor: pointer; pointer-events: auto">
{{ 83 }}
</span>
<span key="star" style="cursor: pointer; pointer-events: auto">
{{ 3 }}
</span>
<span key="reply" style="cursor: pointer; pointer-events: auto"> Reply </span>
</template>
<template #avatar>
<AAvatar>
<img
alt="avatar"
src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp"
/>
</AAvatar>
</template>
</AComment>
</Group>
</template>
</ListColumn>
</vue-list-table>
`,
data() {
return {
Expand All @@ -57,108 +93,6 @@ const app = createApp({
{ gender: 'Female', name: 'Zhou Ba', age: 25, city: 'Chongqing' },
{ gender: 'Male', name: 'Wu Jiu', age: 26, city: "Xi'an" }
],
columns: [
{
field: 'name',
title: 'Name',
width: 200
},
{ field: 'age', title: 'Age', width: 150 },
{ field: 'city', title: 'City', width: 200 },
{
field: 'gender',
title: 'Gender',
width: 100,
headerCustomLayout: args => {
const { table, row, col, rect, value } = args;
const { height, width } = rect ?? table.getCellRect(col, row);

const container = new VTable.CustomLayout.Group({
height,
width,
display: 'flex',
alignItems: 'center',
vue: {
element: h(ArcoDesignVue.Tag, { color: 'green' }, value),
container: table.headerDomContainer
}
});
return {
rootContainer: container,
renderDefault: false
};
},
customLayout: args => {
const { table, row, col, rect, value } = args;
const { height, width } = rect ?? table.getCellRect(col, row);

const container = new VTable.CustomLayout.Group({
height,
width,
display: 'flex',
alignItems: 'center',
vue: {
element: h(ArcoDesignVue.Tag, { color: value === 'Female' ? 'magenta' : 'arcoblue' }, value),
container: table.bodyDomContainer
}
});

return {
rootContainer: container,
renderDefault: false
};
}
},
{
field: 'comment',
title: 'Comment',
width: 300,
customLayout: args => {
const { table, row, col, rect, value } = args;
const { height, width } = rect ?? table.getCellRect(col, row);

const container = new VTable.CustomLayout.Group({
height,
width,
display: 'flex',
alignItems: 'center',
vue: {
element: h(
ArcoDesignVue.Comment,
{ author: 'Socrates', content: value, datetime: '1 hour' },
{
actions: () => [
h('span', { key: 'heart', style: { cursor: 'pointer' } }, [h('span', 'Like')]),
h('span', { key: 'star', style: { cursor: 'pointer' } }, [h('span', 'Collect')]),
h('span', { key: 'reply', style: { cursor: 'pointer' } }, [h('span', 'Reply')])
],
avatar: () => [
h(
ArcoDesignVue.Avatar,
{},
{
default: () => [
h('img', {
alt: 'avatar',
src: 'https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp'
})
]
}
)
]
}
),
container: table.bodyDomContainer
}
});

return {
rootContainer: container,
renderDefault: false
};
}
}
],
defaultHeaderRowHeight: 40,
defaultRowHeight: 80,
customConfig: {
Expand All @@ -170,6 +104,11 @@ const app = createApp({
});

app.component('vue-list-table', VueVTable.ListTable);
app.component('ListColumn', VueVTable.ListColumn);
app.component('Group', VueVTable.Group);
app.component('ATag', ArcoDesignVue.Tag);
app.component('AComment', ArcoDesignVue.Comment);
app.component('AAvatar', ArcoDesignVue.Avatar);

app.mount(`#${CONTAINER_ID}`);

Expand Down
Loading