Skip to content

Commit e4a053e

Browse files
committed
Merge remote-tracking branch 'origin/header-contextmenu'
2 parents a8d08dc + 1554165 commit e4a053e

File tree

90 files changed

+4821
-867
lines changed

Some content is hidden

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

90 files changed

+4821
-867
lines changed

CHANGE-LOG.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,72 @@ Vx.x.x(TPL)
77
- Style changes
88
- Dependencies Changes
99

10+
V2.19.0
11+
12+
### Breaking Changes
13+
14+
- Modify the non Chinese text in the right-click menu of the table, and convert the first lower case letter to upper case letter
15+
- Contextmenu of table, remove callback function `callback({type, selection})` replace with `afterMenuClick({ type, selectionRangeKeys, selectionRangeIndexes })` [detail](https://happy-coding-clans.github.io/vue-easytable/#/en/doc/table/contextmenu)
16+
17+
### Feature
18+
19+
- Cell selection [detail](https://happy-coding-clans.github.io/vue-easytable/#/zh/doc/table/cell-selection)
20+
21+
- Add multi column selection feature
22+
- Add multi row selection feature
23+
- Cell selection feature, adding header and column indicator effects
24+
- Cell selection feature, add range selection instance method `setRangeCellSelection({ startRowKey,startColKey,endRowKey,endColKey,isScrollToStartCell })`
25+
- Cell selection feature, add cell select all instance method`setAllCellSelection()` [detail](https://happy-coding-clans.github.io/vue-easytable/#/zh/doc/table/cell-selection)
26+
27+
- Table contextmenu [detail](https://happy-coding-clans.github.io/vue-easytable/#/zh/doc/table/contextmenu)
28+
29+
- Add table header contextmenu
30+
- Add table body contextmenu
31+
- Add table body contextmenu callback `beforeShow({ isWholeRowSelection, selectionRangeKeys, selectionRangeIndexes, })`
32+
- Add theme vars
33+
- @ve-table-head-indicator-active-text-color
34+
- @ve-table-body-indicator-active-text-color
35+
- @ve-table-header-cell-indicator-active-background-color
36+
- @ve-table-body-cell-indicator-active-background-color
37+
38+
- Contextmenu comp adds instance method `hideContextmenu()`
39+
40+
### Bug Fixes
41+
42+
- Fixed the problem that the menu could not be expanded and collapsed after the right menu expansion node was clicked
43+
44+
---
45+
46+
### Breaking Changes
47+
48+
- 修改表格右键菜单的非中文文字,将开头小写字母转大写字母
49+
- 表格右键菜单功能,移除回调函数`callback({type, selection})` 使用`afterMenuClick({ type, selectionRangeKeys, selectionRangeIndexes })`替代 [详情](https://happy-coding-clans.github.io/vue-easytable/#/zh/doc/table/contextmenu)
50+
51+
### Feature
52+
53+
- 单元格选择功能 [详情](https://happy-coding-clans.github.io/vue-easytable/#/zh/doc/table/cell-selection)
54+
55+
- 添加多列选择功能
56+
- 添加多行选择功能
57+
- 单元格选择功能,添加表头和列指示器效果
58+
- 单元格选择功能,添加区域选择实例方法 `setRangeCellSelection({ startRowKey,startColKey,endRowKey,endColKey,isScrollToStartCell })`
59+
- 单元格选择功能,添加单元格全选实例方法`setAllCellSelection()` [详情](https://happy-coding-clans.github.io/vue-easytable/#/zh/doc/table/cell-selection)
60+
61+
- 表格右键菜单功能 [详情](https://happy-coding-clans.github.io/vue-easytable/#/zh/doc/table/contextmenu)
62+
- 表格 header 添加右键菜单功能
63+
- 表格 body 右键菜单功能增强
64+
- 表格 body 右键菜单功能添加回调方法 `beforeShow({ isWholeRowSelection, selectionRangeKeys, selectionRangeIndexes, })`
65+
- 右键菜单组件添加`hideContextmenu()`实例方法
66+
- 添加主题变量
67+
- @ve-table-head-indicator-active-text-color
68+
- @ve-table-body-indicator-active-text-color
69+
- @ve-table-header-cell-indicator-active-background-color
70+
- @ve-table-body-cell-indicator-active-background-color
71+
72+
### Bug Fixes
73+
74+
- 修复右侧菜单展开节点被点击后,菜单无法展开折叠的问题
75+
1076
V2.18.3
1177

1278
### Bug Fixes

examples/src/comp/app.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
@-header-height: 60px;
1818
@-footer-height: 60px;
19-
@-header-index: 9999999;
19+
@-header-index: 999;
2020
@-left-menu-index: 2;
2121
@-right-content-index: 1;
2222

@@ -31,7 +31,7 @@
3131
.main-banner {
3232
width: 100%;
3333
position: fixed;
34-
top: 2px;
34+
top: 0px;
3535
height: 60px;
3636
background-color: #fff;
3737
z-index: @-header-index;

examples/src/demo/spreadsheet.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
:cell-autofill-option="cellAutofillOption"
1414
:edit-option="editOption"
1515
:contextmenu-body-option="contextmenuBodyOption"
16+
:row-style-option="rowStyleOption"
1617
/>
1718
</div>
1819
</template>
@@ -105,6 +106,10 @@ export default {
105106
},
106107
],
107108
},
109+
rowStyleOption: {
110+
clickHighlight: false,
111+
hoverHighlight: false,
112+
},
108113
tableData: [],
109114
};
110115
},
@@ -116,7 +121,7 @@ export default {
116121
key: "index",
117122
// is operation column
118123
operationColumn: true,
119-
title: "#",
124+
title: "",
120125
width: 35,
121126
fixed: "left",
122127
renderBodyCell: this.renderRowIndex,

examples/src/docs/en/ve-contextmenu/api.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@
99

1010
### options
1111

12-
| Property | Description | Type | Optional value | Default |
13-
| -------- | ------------------------------------------------------------------------------------------------------------------ | -------- | -------------- | ------- |
14-
| label | Displayed menu name | `String` | - | - |
15-
| type | contextmenu item type,The split line through ‘SEPARATOR’。It will be used as a parameter for callback after cliked | `String` | - | - |
16-
| disabled | Disable the current menu, click will be invalid | `String` | - | - |
12+
| Property | Description | Type | Optional value | Default |
13+
| -------- | ------------------------------------------------------------------------------------------------------------------ | --------- | -------------- | ------- |
14+
| label | Displayed menu name | `String` | - | - |
15+
| type | contextmenu item type,The split line through ‘SEPARATOR’。It will be used as a parameter for callback after cliked | `String` | - | - |
16+
| disabled | Disable the current menu, click will be invalid | `Boolean` | - | - |
1717

1818
### Event
1919

2020
| Event Name | Description | Parameters |
2121
| ------------- | ------------------- | --------------------------- |
2222
| on-node-click | menu click callback | currently clicked menu type |
23+
24+
### Instance Methods
25+
26+
| Method Name | Description | Parameters |
27+
| --------------- | ----------- | ---------- |
28+
| hideContextmenu | 该右键菜单 | - |

examples/src/docs/en/ve-table/api/contextmenu-body-option-props.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default {
1616
props: {
1717
anchor: {
1818
type: String,
19-
default: "Contextmenu option",
19+
default: "Body contextmenu option",
2020
},
2121
desc: {
2222
type: String,
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<template>
2+
<div>
3+
<tpl
4+
:desc="desc"
5+
:anchor="anchor"
6+
:table-data="db.contextmenuHeaderOption.data"
7+
:columns="db.contextmenuHeaderOption.columns"
8+
/>
9+
</div>
10+
</template>
11+
<script>
12+
import tpl from "@/comp/api-tpl";
13+
import { db } from "./db";
14+
export default {
15+
components: { tpl },
16+
props: {
17+
anchor: {
18+
type: String,
19+
default: "Header contextmenu option",
20+
},
21+
desc: {
22+
type: String,
23+
default: "contextmenuHeaderOption",
24+
},
25+
},
26+
data() {
27+
return {
28+
db: db,
29+
};
30+
},
31+
};
32+
</script>

examples/src/docs/en/ve-table/api/db.js

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,16 @@ export const db = {
257257
optionalVal: "-",
258258
default: "-",
259259
},
260+
{
261+
param: "contextmenuHeaderOption",
262+
desc: "table header contextmenu option,Refer to contextmenuHeaderOption",
263+
type: "<code>Object</code>",
264+
optionalVal: "-",
265+
default: "-",
266+
},
260267
{
261268
param: "contextmenuBodyOption",
262-
desc: "contextmenu option,Refer to contextmenuBodyOption",
269+
desc: "table body contextmenu option,Refer to contextmenuBodyOption",
263270
type: "<code>Object</code>",
264271
optionalVal: "-",
265272
default: "-",
@@ -549,9 +556,19 @@ export const db = {
549556
},
550557
{
551558
name: "setCellSelection",
552-
desc: `Set cell selection <a href='#/en/doc/table/cell-selection?anchor=cell-selection-instance-method'>Refer To Demo</a>`,
559+
desc: `Set single cell selection <a href='#/en/doc/table/cell-selection?anchor=single-cell-selection-instance-method'>Refer To Demo</a>`,
553560
param: "{ rowKey, colKey }",
554561
},
562+
{
563+
name: "setAllCellSelection",
564+
desc: `Set all cell selection <a href='#/en/doc/table/cell-selection?anchor=range-cell-selection-instance-method'>Refer To Demo</a>`,
565+
param: "-",
566+
},
567+
{
568+
name: "setRangeCellSelection",
569+
desc: `Set range cell selection <a href='#/en/doc/table/cell-selection?anchor=range-cell-selection-instance-method'>Refer To Demo</a>`,
570+
param: "{ startRowKey,startColKey,endRowKey,endColKey,isScrollToStartCell }",
571+
},
555572
],
556573
columns: columnsType2,
557574
},
@@ -942,13 +959,48 @@ export const db = {
942959
columns: columnsType1,
943960
},
944961

945-
// 右键菜单配置
962+
// table header contextmenu
963+
contextmenuHeaderOption: {
964+
data: [
965+
{
966+
param: "beforeShow",
967+
desc: `For the callback event before the menu is displayed, you can change the menu item information at this stage.<br/><code>isWholeColSelection</code>It's whole column selection,<br/><code>selectionRangeKeys </code>The currently cellSelection key information,<br/><code>selectionRangeIndexes </code>The currently cellSelection index information`,
968+
type: `<code>Function({ isWholeColSelection, selectionRangeKeys, selectionRangeIndexes })</code>`,
969+
optionalVal: "-",
970+
default: "-",
971+
},
972+
{
973+
param: "afterMenuClick",
974+
desc: `Callback when a menu item is clicked, returning false will prevent the current right-click operation.<br/><code>type</code>menu item,<br/><code>selectionRangeKeys </code>The currently cellSelection key information,<br/><code>selectionRangeIndexes </code>The currently cellSelection index information`,
975+
type: `<code>Function({ type, selectionRangeKeys, selectionRangeIndexes })</code>`,
976+
optionalVal: "-",
977+
default: "-",
978+
},
979+
{
980+
param: "contextmenus",
981+
desc: `contextmenu option. <a href='#/en/doc/base/contextmenu'>contextmenu component</a>`,
982+
type: `<code>Array</code>`,
983+
optionalVal: "-",
984+
default: "-",
985+
},
986+
],
987+
columns: columnsType1,
988+
},
989+
990+
// table body contextmenu
946991
contextmenuBodyOption: {
947992
data: [
948993
{
949-
param: "callback",
950-
desc: `The callback of the right-click menu item.<code>type</code>menu type,<code>selection </code>Currently selected cell`,
951-
type: `<code>Function({ type, selection })</code>`,
994+
param: "beforeShow",
995+
desc: `For the callback event before the menu is displayed, you can change the menu item information at this stage.<br/><code>isWholeRowSelection</code>It's whole row selection,<br/><code>selectionRangeKeys </code>The currently cellSelection key information,<br/><code>selectionRangeIndexes </code>The currently cellSelection index information`,
996+
type: `<code>Function({ isWholeRowSelection, selectionRangeKeys, selectionRangeIndexes })</code>`,
997+
optionalVal: "-",
998+
default: "-",
999+
},
1000+
{
1001+
param: "afterMenuClick",
1002+
desc: `Callback when a menu item is clicked, returning false will prevent the current right-click operation.<br/><code>type</code>menu item,<br/><code>selectionRangeKeys </code>The currently cellSelection key information,<br/><code>selectionRangeIndexes </code>The currently cellSelection index information`,
1003+
type: `<code>Function({ type, selectionRangeKeys, selectionRangeIndexes })</code>`,
9521004
optionalVal: "-",
9531005
default: "-",
9541006
},

examples/src/docs/en/ve-table/api/main.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
<CellSelectionOption />
3030
<!-- edit Option -->
3131
<EditOption />
32+
<!-- contextmenu header option -->
33+
<contextmenuHeaderOption />
3234
<!-- contextmenu body option -->
3335
<contextmenuBodyOption />
3436
<!-- Event Custom Option -->
@@ -56,6 +58,7 @@ import CellStyleOption from "./cell-style-option-props";
5658
import RowStyleOption from "./row-style-option-props";
5759
import CellSelectionOption from "./cell-selection-option-props";
5860
import EditOption from "./edit-option-props";
61+
import contextmenuHeaderOption from "./contextmenu-header-option-props";
5962
import contextmenuBodyOption from "./contextmenu-body-option-props";
6063
import cellAutofillOption from "./cell-autofill-option-props";
6164
import clipboardOption from "./clipboard-option-props";
@@ -76,6 +79,7 @@ export default {
7679
SortOption,
7780
CellSelectionOption,
7881
EditOption,
82+
contextmenuHeaderOption,
7983
contextmenuBodyOption,
8084
cellAutofillOption,
8185
clipboardOption,

examples/src/docs/en/ve-table/cell-autofill/autofill-direction.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
:table-data="tableData"
2020
:cell-autofill-option="cellAutofillOption"
2121
rowKeyFieldName="rowKey"
22+
:rowStyleOption="rowStyleOption"
2223
/>
2324
</div>
2425
</template>
@@ -32,6 +33,10 @@
3233
directionX: true,
3334
directionY: true,
3435
},
36+
rowStyleOption: {
37+
clickHighlight: false,
38+
hoverHighlight: false,
39+
},
3540
columns: [
3641
{ field: "col1", key: "col1", title: "Col1" },
3742
{ field: "col2", key: "col2", title: "Col2" },

examples/src/docs/en/ve-table/cell-autofill/base.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,18 @@
1414
rowKeyFieldName="rowKey"
1515
:virtual-scroll-option="virtualScrollOption"
1616
:cell-autofill-option="cellAutofillOption"
17+
:rowStyleOption="rowStyleOption"
1718
/>
1819
</template>
1920

2021
<script>
2122
export default {
2223
data() {
2324
return {
25+
rowStyleOption: {
26+
clickHighlight: false,
27+
hoverHighlight: false,
28+
},
2429
virtualScrollOption: {
2530
enable: true,
2631
},

0 commit comments

Comments
 (0)