vxe-table 3.9.0-rc.8 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/es/grid/src/grid.js +120 -66
- package/es/grid/style.css +0 -1
- package/es/grid/style.min.css +1 -1
- package/es/index.esm.js +22 -3
- package/es/locale/lang/en-US.js +2 -8
- package/es/locale/lang/es-ES.js +2 -1
- package/es/locale/lang/hu-HU.d.ts +2 -0
- package/es/locale/lang/hu-HU.js +497 -501
- package/es/locale/lang/ja-JP.js +2 -8
- package/es/locale/lang/ko-KR.d.ts +2 -0
- package/es/locale/lang/ko-KR.js +2 -8
- package/es/locale/lang/pt-BR.js +2 -8
- package/es/locale/lang/ru-RU.d.ts +2 -0
- package/es/locale/lang/ru-RU.js +497 -503
- package/es/locale/lang/uk-UA.d.ts +2 -0
- package/es/locale/lang/uk-UA.js +667 -0
- package/es/locale/lang/vi-VN.js +2 -8
- package/es/locale/lang/zh-CHT.d.ts +2 -0
- package/es/locale/lang/zh-CHT.js +667 -0
- package/es/locale/lang/zh-CN.js +2 -8
- package/es/locale/lang/zh-HK.js +2 -2
- package/es/locale/lang/zh-MO.js +2 -2
- package/es/locale/lang/zh-TC.js +2 -673
- package/es/locale/lang/zh-TW.js +2 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/panel.js +183 -173
- package/es/table/module/edit/mixin.js +33 -24
- package/es/table/module/export/export-panel.js +32 -4
- package/es/table/module/export/import-panel.js +25 -6
- package/es/table/module/export/mixin.js +11 -11
- package/es/table/module/menu/mixin.js +2 -2
- package/es/table/module/validator/mixin.js +4 -4
- package/es/table/render/index.js +17 -11
- package/es/table/src/body.js +1 -0
- package/es/table/src/columnInfo.js +3 -3
- package/es/table/src/methods.js +54 -42
- package/es/table/src/props.js +65 -15
- package/es/table/src/table.js +175 -60
- package/es/table/src/util.js +3 -2
- package/es/table/style.css +37 -48
- package/es/table/style.min.css +1 -1
- package/es/toolbar/src/toolbar.js +21 -7
- package/es/toolbar/style.css +0 -1
- package/es/toolbar/style.min.css +1 -1
- package/es/ui/index.js +5 -3
- package/es/ui/src/log.js +1 -1
- package/es/vxe-grid/style.css +0 -1
- package/es/vxe-grid/style.min.css +1 -1
- package/es/vxe-table/style.css +37 -48
- package/es/vxe-table/style.min.css +1 -1
- package/es/vxe-toolbar/style.css +0 -1
- package/es/vxe-toolbar/style.min.css +1 -1
- package/lib/colgroup/index.js +3 -3
- package/lib/colgroup/index.min.js +1 -1
- package/lib/column/index.js +3 -3
- package/lib/column/index.min.js +1 -1
- package/lib/components.js +9 -11
- package/lib/components.min.js +1 -1
- package/lib/grid/index.js +3 -3
- package/lib/grid/index.min.js +1 -1
- package/lib/grid/src/grid.js +581 -491
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/grid/style/style.css +0 -1
- package/lib/grid/style/style.min.css +1 -1
- package/lib/index.common.js +3 -4
- package/lib/index.umd.js +9212 -17224
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -8
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -8
- package/lib/locale/lang/es-ES.js +2 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +2 -1
- package/lib/locale/lang/hu-HU.d.ts +2 -0
- package/lib/locale/lang/hu-HU.js +497 -501
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +687 -0
- package/lib/locale/lang/ja-JP.js +2 -8
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -8
- package/lib/locale/lang/ko-KR.d.ts +2 -0
- package/lib/locale/lang/ko-KR.js +2 -8
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +687 -0
- package/lib/locale/lang/pt-BR.js +2 -8
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -8
- package/lib/locale/lang/ru-RU.d.ts +2 -0
- package/lib/locale/lang/ru-RU.js +497 -503
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +687 -0
- package/lib/locale/lang/uk-UA.d.ts +2 -0
- package/lib/locale/lang/uk-UA.js +673 -0
- package/lib/locale/lang/uk-UA.min.js +1 -0
- package/lib/locale/lang/uk-UA.umd.js +687 -0
- package/lib/locale/lang/vi-VN.js +2 -8
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.d.ts +2 -0
- package/lib/locale/lang/zh-CHT.js +673 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -0
- package/lib/locale/lang/zh-CHT.umd.js +687 -0
- package/lib/locale/lang/zh-CN.js +2 -8
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -8
- package/lib/locale/lang/zh-HK.js +2 -2
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +7 -677
- package/lib/locale/lang/zh-MO.js +2 -2
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +7 -677
- package/lib/locale/lang/zh-TC.js +3 -673
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +7 -677
- package/lib/locale/lang/zh-TW.js +2 -2
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +7 -677
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/index.js +4 -4
- package/lib/table/index.min.js +1 -1
- package/lib/table/module/custom/mixin.js +53 -44
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +310 -239
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +436 -371
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +136 -106
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +75 -54
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +592 -597
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/export/util.js +6 -4
- package/lib/table/module/export/util.min.js +1 -1
- package/lib/table/module/filter/mixin.js +147 -118
- package/lib/table/module/filter/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +86 -65
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +163 -151
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +125 -114
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/menu/panel.js +36 -34
- package/lib/table/module/menu/panel.min.js +1 -1
- package/lib/table/module/validator/mixin.js +225 -214
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +401 -297
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +411 -349
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +470 -344
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +10 -10
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +46 -55
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +157 -132
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/group.js +1 -1
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/header.js +170 -153
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +2758 -2478
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +33 -74
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +519 -397
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +143 -131
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +37 -48
- package/lib/table/style/style.min.css +1 -1
- package/lib/toolbar/index.js +3 -3
- package/lib/toolbar/index.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +332 -284
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/toolbar/style/style.css +0 -1
- package/lib/toolbar/style/style.min.css +1 -1
- package/lib/ui/index.js +50 -41
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/comp.js +2 -3
- package/lib/ui/src/comp.min.js +1 -1
- package/lib/ui/src/dom.js +29 -28
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +6 -4
- package/lib/ui/src/log.min.js +1 -1
- package/lib/ui/src/utils.js +7 -7
- package/lib/v-x-e-table/index.js +3 -4
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/vxe-colgroup/index.js +3 -4
- package/lib/vxe-colgroup/index.min.js +1 -1
- package/lib/vxe-column/index.js +3 -4
- package/lib/vxe-column/index.min.js +1 -1
- package/lib/vxe-grid/index.js +3 -4
- package/lib/vxe-grid/index.min.js +1 -1
- package/lib/vxe-grid/style/style.css +0 -1
- package/lib/vxe-grid/style/style.min.css +1 -1
- package/lib/vxe-table/index.js +3 -4
- package/lib/vxe-table/index.min.js +1 -1
- package/lib/vxe-table/style/style.css +37 -48
- package/lib/vxe-table/style/style.min.css +1 -1
- package/lib/vxe-toolbar/index.js +3 -4
- package/lib/vxe-toolbar/index.min.js +1 -1
- package/lib/vxe-toolbar/style/style.css +0 -1
- package/lib/vxe-toolbar/style/style.min.css +1 -1
- package/lib/vxe-ui/index.js +3 -4
- package/lib/vxe-ui/index.min.js +1 -1
- package/lib/vxe-v-x-e-table/index.js +3 -4
- package/lib/vxe-v-x-e-table/index.min.js +1 -1
- package/package.json +5 -4
- package/packages/grid/src/grid.ts +127 -65
- package/packages/locale/lang/en-US.ts +2 -10
- package/packages/locale/lang/es-ES.ts +2 -1
- package/packages/locale/lang/hu-HU.ts +497 -503
- package/packages/locale/lang/ja-JP.ts +2 -10
- package/packages/locale/lang/ko-KR.ts +2 -10
- package/packages/locale/lang/pt-BR.ts +2 -10
- package/packages/locale/lang/ru-RU.ts +497 -505
- package/packages/locale/lang/uk-UA.ts +667 -0
- package/packages/locale/lang/vi-VN.ts +2 -10
- package/packages/locale/lang/zh-CHT.ts +667 -0
- package/packages/locale/lang/zh-CN.ts +2 -10
- package/packages/locale/lang/zh-HK.ts +2 -2
- package/packages/locale/lang/zh-MO.ts +2 -2
- package/packages/locale/lang/zh-TC.ts +2 -674
- package/packages/locale/lang/zh-TW.ts +2 -2
- package/packages/table/module/custom/panel.ts +186 -175
- package/packages/table/module/edit/mixin.ts +32 -23
- package/packages/table/module/export/export-panel.ts +36 -4
- package/packages/table/module/export/import-panel.ts +29 -6
- package/packages/table/module/export/mixin.ts +11 -11
- package/packages/table/module/menu/mixin.ts +2 -2
- package/packages/table/module/validator/mixin.ts +4 -4
- package/packages/table/render/index.ts +20 -11
- package/packages/table/src/body.ts +1 -0
- package/packages/table/src/columnInfo.ts +3 -3
- package/packages/table/src/methods.ts +53 -42
- package/packages/table/src/props.ts +68 -15
- package/packages/table/src/table.ts +183 -57
- package/packages/table/src/util.ts +3 -2
- package/packages/toolbar/src/toolbar.ts +21 -7
- package/packages/ui/index.ts +3 -1
- package/styles/components/table.scss +82 -17
- package/types/all.d.ts +1 -0
- /package/es/{iconfont.1726318179195.ttf → iconfont.1728348263835.ttf} +0 -0
- /package/es/{iconfont.1726318179195.woff → iconfont.1728348263835.woff} +0 -0
- /package/es/{iconfont.1726318179195.woff2 → iconfont.1728348263835.woff2} +0 -0
- /package/lib/{iconfont.1726318179195.ttf → iconfont.1728348263835.ttf} +0 -0
- /package/lib/{iconfont.1726318179195.woff → iconfont.1728348263835.woff} +0 -0
- /package/lib/{iconfont.1726318179195.woff2 → iconfont.1728348263835.woff2} +0 -0
|
@@ -10,13 +10,15 @@ var _dom = require("../../../ui/src/dom");
|
|
|
10
10
|
var _utils = require("../../../ui/src/utils");
|
|
11
11
|
var _log = require("../../../ui/src/log");
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
|
|
13
|
+
const {
|
|
14
|
+
menus
|
|
15
|
+
} = _ui.VxeUI;
|
|
14
16
|
var _default = exports.default = {
|
|
15
17
|
methods: {
|
|
16
18
|
/**
|
|
17
19
|
* 关闭快捷菜单
|
|
18
20
|
*/
|
|
19
|
-
_closeMenu
|
|
21
|
+
_closeMenu() {
|
|
20
22
|
Object.assign(this.ctxMenuStore, {
|
|
21
23
|
visible: false,
|
|
22
24
|
selected: null,
|
|
@@ -26,11 +28,9 @@ var _default = exports.default = {
|
|
|
26
28
|
return this.$nextTick();
|
|
27
29
|
},
|
|
28
30
|
// 处理菜单的移动
|
|
29
|
-
moveCtxMenu
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return ctxMenuStore[property] === item;
|
|
33
|
-
});
|
|
31
|
+
moveCtxMenu(evnt, keyCode, ctxMenuStore, property, operKey, operRest, menuList) {
|
|
32
|
+
let selectItem;
|
|
33
|
+
const selectIndex = _xeUtils.default.findIndexOf(menuList, item => ctxMenuStore[property] === item);
|
|
34
34
|
if (keyCode === operKey) {
|
|
35
35
|
if (operRest && (0, _utils.hasChildrenList)(ctxMenuStore.selected)) {
|
|
36
36
|
ctxMenuStore.showChild = true;
|
|
@@ -39,7 +39,7 @@ var _default = exports.default = {
|
|
|
39
39
|
ctxMenuStore.selectChild = null;
|
|
40
40
|
}
|
|
41
41
|
} else if (keyCode === 38) {
|
|
42
|
-
for (
|
|
42
|
+
for (let len = selectIndex - 1; len >= 0; len--) {
|
|
43
43
|
if (menuList[len].visible !== false) {
|
|
44
44
|
selectItem = menuList[len];
|
|
45
45
|
break;
|
|
@@ -47,7 +47,7 @@ var _default = exports.default = {
|
|
|
47
47
|
}
|
|
48
48
|
ctxMenuStore[property] = selectItem || menuList[menuList.length - 1];
|
|
49
49
|
} else if (keyCode === 40) {
|
|
50
|
-
for (
|
|
50
|
+
for (let index = selectIndex + 1; index < menuList.length; index++) {
|
|
51
51
|
if (menuList[index].visible !== false) {
|
|
52
52
|
selectItem = menuList[index];
|
|
53
53
|
break;
|
|
@@ -61,27 +61,31 @@ var _default = exports.default = {
|
|
|
61
61
|
/**
|
|
62
62
|
* 快捷菜单事件处理
|
|
63
63
|
*/
|
|
64
|
-
handleGlobalContextmenuEvent
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
64
|
+
handleGlobalContextmenuEvent(evnt) {
|
|
65
|
+
const {
|
|
66
|
+
$refs,
|
|
67
|
+
tId,
|
|
68
|
+
editStore,
|
|
69
|
+
menuConfig,
|
|
70
|
+
contextMenu,
|
|
71
|
+
ctxMenuStore,
|
|
72
|
+
ctxMenuOpts,
|
|
73
|
+
mouseConfig,
|
|
74
|
+
mouseOpts
|
|
75
|
+
} = this;
|
|
76
|
+
const {
|
|
77
|
+
selected
|
|
78
|
+
} = editStore;
|
|
79
|
+
const layoutList = ['header', 'body', 'footer'];
|
|
76
80
|
if ((0, _utils.isEnableConf)(menuConfig) || contextMenu) {
|
|
77
81
|
if (ctxMenuStore.visible && $refs.ctxWrapper && (0, _dom.getEventTargetNode)(evnt, $refs.ctxWrapper.$el).flag) {
|
|
78
82
|
evnt.preventDefault();
|
|
79
83
|
return;
|
|
80
84
|
}
|
|
81
85
|
if (this._keyCtx) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
type
|
|
86
|
+
const type = 'body';
|
|
87
|
+
const params = {
|
|
88
|
+
type,
|
|
85
89
|
$grid: this.$xegrid,
|
|
86
90
|
$table: this,
|
|
87
91
|
keyboard: true,
|
|
@@ -90,7 +94,7 @@ var _default = exports.default = {
|
|
|
90
94
|
};
|
|
91
95
|
// 如果开启单元格区域
|
|
92
96
|
if (mouseConfig && mouseOpts.area) {
|
|
93
|
-
|
|
97
|
+
const activeArea = this.getActiveCellArea();
|
|
94
98
|
if (activeArea && activeArea.row && activeArea.column) {
|
|
95
99
|
params.row = activeArea.row;
|
|
96
100
|
params.column = activeArea.column;
|
|
@@ -108,13 +112,13 @@ var _default = exports.default = {
|
|
|
108
112
|
}
|
|
109
113
|
}
|
|
110
114
|
// 分别匹配表尾、内容、表尾的快捷菜单
|
|
111
|
-
for (
|
|
112
|
-
|
|
113
|
-
|
|
115
|
+
for (let index = 0; index < layoutList.length; index++) {
|
|
116
|
+
const layout = layoutList[index];
|
|
117
|
+
const columnTargetNode = (0, _dom.getEventTargetNode)(evnt, this.$el, `vxe-${layout}--column`, target => {
|
|
114
118
|
// target=td|th,直接向上找 table 去匹配即可
|
|
115
119
|
return target.parentNode.parentNode.parentNode.getAttribute('xid') === tId;
|
|
116
120
|
});
|
|
117
|
-
|
|
121
|
+
const params = {
|
|
118
122
|
type: layout,
|
|
119
123
|
$grid: this.$xegrid,
|
|
120
124
|
$table: this,
|
|
@@ -122,38 +126,36 @@ var _default = exports.default = {
|
|
|
122
126
|
$event: evnt
|
|
123
127
|
};
|
|
124
128
|
if (columnTargetNode.flag) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
Object.assign(
|
|
129
|
-
column
|
|
129
|
+
const cell = columnTargetNode.targetElem;
|
|
130
|
+
const column = this.getColumnNode(cell).item;
|
|
131
|
+
let typePrefix = `${layout}-`;
|
|
132
|
+
Object.assign(params, {
|
|
133
|
+
column,
|
|
130
134
|
columnIndex: this.getColumnIndex(column),
|
|
131
|
-
cell
|
|
135
|
+
cell
|
|
132
136
|
});
|
|
133
137
|
if (layout === 'body') {
|
|
134
|
-
|
|
138
|
+
const row = this.getRowNode(cell.parentNode).item;
|
|
135
139
|
typePrefix = '';
|
|
136
|
-
|
|
137
|
-
|
|
140
|
+
params.row = row;
|
|
141
|
+
params.rowIndex = this.getRowIndex(row);
|
|
138
142
|
}
|
|
139
|
-
this.handleOpenMenuEvent(evnt, layout,
|
|
143
|
+
this.handleOpenMenuEvent(evnt, layout, params);
|
|
140
144
|
// 在 v4 中废弃事件 cell-context-menu、header-cell-context-menu、footer-cell-context-menu
|
|
141
|
-
if (this.$listeners[
|
|
142
|
-
if (process.env.
|
|
143
|
-
(0, _log.warnLog)('vxe.error.delEvent', [
|
|
145
|
+
if (this.$listeners[`${typePrefix}cell-context-menu`]) {
|
|
146
|
+
if (process.env.NODE_ENV === 'development') {
|
|
147
|
+
(0, _log.warnLog)('vxe.error.delEvent', [`${typePrefix}cell-context-menu`, `${typePrefix}cell-menu`]);
|
|
144
148
|
}
|
|
145
|
-
this.emitEvent(
|
|
149
|
+
this.emitEvent(`${typePrefix}cell-context-menu`, params, evnt);
|
|
146
150
|
} else {
|
|
147
|
-
this.emitEvent(
|
|
151
|
+
this.emitEvent(`${typePrefix}cell-menu`, params, evnt);
|
|
148
152
|
}
|
|
149
153
|
return;
|
|
150
|
-
} else if ((0, _dom.getEventTargetNode)(evnt, this.$el,
|
|
151
|
-
return target.getAttribute('xid') === tId;
|
|
152
|
-
}).flag) {
|
|
154
|
+
} else if ((0, _dom.getEventTargetNode)(evnt, this.$el, `vxe-table--${layout}-wrapper`, target => target.getAttribute('xid') === tId).flag) {
|
|
153
155
|
if (ctxMenuOpts.trigger === 'cell') {
|
|
154
156
|
evnt.preventDefault();
|
|
155
157
|
} else {
|
|
156
|
-
this.handleOpenMenuEvent(evnt, layout,
|
|
158
|
+
this.handleOpenMenuEvent(evnt, layout, params);
|
|
157
159
|
}
|
|
158
160
|
return;
|
|
159
161
|
}
|
|
@@ -167,32 +169,36 @@ var _default = exports.default = {
|
|
|
167
169
|
/**
|
|
168
170
|
* 显示快捷菜单
|
|
169
171
|
*/
|
|
170
|
-
handleOpenMenuEvent
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
ctxMenuStore
|
|
174
|
-
ctxMenuOpts
|
|
175
|
-
|
|
176
|
-
|
|
172
|
+
handleOpenMenuEvent(evnt, type, params) {
|
|
173
|
+
const {
|
|
174
|
+
isCtxMenu,
|
|
175
|
+
ctxMenuStore,
|
|
176
|
+
ctxMenuOpts
|
|
177
|
+
} = this;
|
|
178
|
+
const config = ctxMenuOpts[type];
|
|
179
|
+
const visibleMethod = ctxMenuOpts.visibleMethod;
|
|
177
180
|
if (config) {
|
|
178
|
-
|
|
179
|
-
|
|
181
|
+
const {
|
|
182
|
+
options,
|
|
183
|
+
disabled
|
|
184
|
+
} = config;
|
|
180
185
|
if (disabled) {
|
|
181
186
|
evnt.preventDefault();
|
|
182
187
|
} else if (isCtxMenu && options && options.length) {
|
|
183
188
|
params.options = options;
|
|
184
|
-
this.preventEvent(evnt, 'event.showMenu', params,
|
|
189
|
+
this.preventEvent(evnt, 'event.showMenu', params, () => {
|
|
185
190
|
if (!visibleMethod || visibleMethod(params)) {
|
|
186
191
|
evnt.preventDefault();
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
scrollTop
|
|
190
|
-
scrollLeft
|
|
191
|
-
visibleHeight
|
|
192
|
-
visibleWidth
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
this.updateZindex();
|
|
193
|
+
const {
|
|
194
|
+
scrollTop,
|
|
195
|
+
scrollLeft,
|
|
196
|
+
visibleHeight,
|
|
197
|
+
visibleWidth
|
|
198
|
+
} = (0, _dom.getDomNode)();
|
|
199
|
+
let top = evnt.clientY + scrollTop;
|
|
200
|
+
let left = evnt.clientX + scrollLeft;
|
|
201
|
+
const handleVisible = () => {
|
|
196
202
|
Object.assign(ctxMenuStore, {
|
|
197
203
|
args: params,
|
|
198
204
|
visible: true,
|
|
@@ -201,37 +207,41 @@ var _default = exports.default = {
|
|
|
201
207
|
selectChild: null,
|
|
202
208
|
showChild: false,
|
|
203
209
|
style: {
|
|
204
|
-
zIndex:
|
|
205
|
-
top:
|
|
206
|
-
left:
|
|
210
|
+
zIndex: this.tZindex,
|
|
211
|
+
top: `${top}px`,
|
|
212
|
+
left: `${left}px`
|
|
207
213
|
}
|
|
208
214
|
});
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
boundingTop
|
|
215
|
-
boundingLeft
|
|
216
|
-
|
|
217
|
-
|
|
215
|
+
this.$nextTick(() => {
|
|
216
|
+
const ctxElem = this.$refs.ctxWrapper.$el;
|
|
217
|
+
const clientHeight = ctxElem.clientHeight;
|
|
218
|
+
const clientWidth = ctxElem.clientWidth;
|
|
219
|
+
const {
|
|
220
|
+
boundingTop,
|
|
221
|
+
boundingLeft
|
|
222
|
+
} = (0, _dom.getAbsolutePos)(ctxElem);
|
|
223
|
+
const offsetTop = boundingTop + clientHeight - visibleHeight;
|
|
224
|
+
const offsetLeft = boundingLeft + clientWidth - visibleWidth;
|
|
218
225
|
if (offsetTop > -10) {
|
|
219
|
-
ctxMenuStore.style.top =
|
|
226
|
+
ctxMenuStore.style.top = `${Math.max(scrollTop + 2, top - clientHeight - 2)}px`;
|
|
220
227
|
}
|
|
221
228
|
if (offsetLeft > -10) {
|
|
222
|
-
ctxMenuStore.style.left =
|
|
229
|
+
ctxMenuStore.style.left = `${Math.max(scrollLeft + 2, left - clientWidth - 2)}px`;
|
|
223
230
|
}
|
|
224
231
|
});
|
|
225
232
|
};
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
233
|
+
const {
|
|
234
|
+
keyboard,
|
|
235
|
+
row,
|
|
236
|
+
column
|
|
237
|
+
} = params;
|
|
229
238
|
if (keyboard && row && column) {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
boundingTop
|
|
234
|
-
boundingLeft
|
|
239
|
+
this.scrollToRow(row, column).then(() => {
|
|
240
|
+
const cell = this.getCellElement(row, column);
|
|
241
|
+
const {
|
|
242
|
+
boundingTop,
|
|
243
|
+
boundingLeft
|
|
244
|
+
} = (0, _dom.getAbsolutePos)(cell);
|
|
235
245
|
top = boundingTop + scrollTop + Math.floor(cell.offsetHeight / 2);
|
|
236
246
|
left = boundingLeft + scrollLeft + Math.floor(cell.offsetWidth / 2);
|
|
237
247
|
handleVisible();
|
|
@@ -240,16 +250,16 @@ var _default = exports.default = {
|
|
|
240
250
|
handleVisible();
|
|
241
251
|
}
|
|
242
252
|
} else {
|
|
243
|
-
|
|
253
|
+
this.closeMenu();
|
|
244
254
|
}
|
|
245
255
|
});
|
|
246
256
|
}
|
|
247
257
|
}
|
|
248
258
|
this.closeFilter();
|
|
249
259
|
},
|
|
250
|
-
ctxMenuMouseoverEvent
|
|
251
|
-
|
|
252
|
-
|
|
260
|
+
ctxMenuMouseoverEvent(evnt, item, child) {
|
|
261
|
+
const menuElem = evnt.currentTarget;
|
|
262
|
+
const ctxMenuStore = this.ctxMenuStore;
|
|
253
263
|
evnt.preventDefault();
|
|
254
264
|
evnt.stopPropagation();
|
|
255
265
|
ctxMenuStore.selected = item;
|
|
@@ -257,26 +267,27 @@ var _default = exports.default = {
|
|
|
257
267
|
if (!child) {
|
|
258
268
|
ctxMenuStore.showChild = (0, _utils.hasChildrenList)(item);
|
|
259
269
|
if (ctxMenuStore.showChild) {
|
|
260
|
-
this.$nextTick(
|
|
261
|
-
|
|
270
|
+
this.$nextTick(() => {
|
|
271
|
+
const childWrapperElem = menuElem.nextElementSibling;
|
|
262
272
|
if (childWrapperElem) {
|
|
263
|
-
|
|
264
|
-
boundingTop
|
|
265
|
-
boundingLeft
|
|
266
|
-
visibleHeight
|
|
267
|
-
visibleWidth
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
273
|
+
const {
|
|
274
|
+
boundingTop,
|
|
275
|
+
boundingLeft,
|
|
276
|
+
visibleHeight,
|
|
277
|
+
visibleWidth
|
|
278
|
+
} = (0, _dom.getAbsolutePos)(menuElem);
|
|
279
|
+
const posTop = boundingTop + menuElem.offsetHeight;
|
|
280
|
+
const posLeft = boundingLeft + menuElem.offsetWidth;
|
|
281
|
+
let left = '';
|
|
282
|
+
let right = '';
|
|
272
283
|
// 是否超出右侧
|
|
273
284
|
if (posLeft + childWrapperElem.offsetWidth > visibleWidth - 10) {
|
|
274
285
|
left = 'auto';
|
|
275
|
-
right =
|
|
286
|
+
right = `${menuElem.offsetWidth}px`;
|
|
276
287
|
}
|
|
277
288
|
// 是否超出底部
|
|
278
|
-
|
|
279
|
-
|
|
289
|
+
let top = '';
|
|
290
|
+
let bottom = '';
|
|
280
291
|
if (posTop + childWrapperElem.offsetHeight > visibleHeight - 10) {
|
|
281
292
|
top = 'auto';
|
|
282
293
|
bottom = '0';
|
|
@@ -290,8 +301,8 @@ var _default = exports.default = {
|
|
|
290
301
|
}
|
|
291
302
|
}
|
|
292
303
|
},
|
|
293
|
-
ctxMenuMouseoutEvent
|
|
294
|
-
|
|
304
|
+
ctxMenuMouseoutEvent(evnt, item) {
|
|
305
|
+
const ctxMenuStore = this.ctxMenuStore;
|
|
295
306
|
if (!item.children) {
|
|
296
307
|
ctxMenuStore.selected = null;
|
|
297
308
|
}
|
|
@@ -300,12 +311,12 @@ var _default = exports.default = {
|
|
|
300
311
|
/**
|
|
301
312
|
* 快捷菜单点击事件
|
|
302
313
|
*/
|
|
303
|
-
ctxMenuLinkEvent
|
|
314
|
+
ctxMenuLinkEvent(evnt, menu) {
|
|
304
315
|
// 如果一级菜单有配置 code 则允许点击,否则不能点击
|
|
305
316
|
if (!menu.disabled && (menu.code || !menu.children || !menu.children.length)) {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
menu
|
|
317
|
+
const gMenuOpts = menus.get(menu.code);
|
|
318
|
+
const params = Object.assign({
|
|
319
|
+
menu,
|
|
309
320
|
$grid: this.$xegrid,
|
|
310
321
|
$table: this,
|
|
311
322
|
$event: evnt
|
|
@@ -315,7 +326,7 @@ var _default = exports.default = {
|
|
|
315
326
|
}
|
|
316
327
|
// 在 v4 中废弃事件 context-menu-click
|
|
317
328
|
if (this.$listeners['context-menu-click']) {
|
|
318
|
-
if (process.env.
|
|
329
|
+
if (process.env.NODE_ENV === 'development') {
|
|
319
330
|
(0, _log.warnLog)('vxe.error.delEvent', ['context-menu-click', 'menu-click']);
|
|
320
331
|
}
|
|
321
332
|
this.emitEvent('context-menu-click', params, evnt);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../../ui"),_dom=require("../../../ui/src/dom"),_utils=require("../../../ui/src/utils"),_log=require("../../../ui/src/log");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_ui=require("../../../ui"),_dom=require("../../../ui/src/dom"),_utils=require("../../../ui/src/utils"),_log=require("../../../ui/src/log");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}let menus=_ui.VxeUI.menus;var _default=exports.default={methods:{_closeMenu(){return Object.assign(this.ctxMenuStore,{visible:!1,selected:null,selectChild:null,showChild:!1}),this.$nextTick()},moveCtxMenu(e,t,i,l,n,o,s){let r;var u=_xeUtils.default.findIndexOf(s,e=>i[l]===e);if(t===n)o&&(0,_utils.hasChildrenList)(i.selected)?i.showChild=!0:(i.showChild=!1,i.selectChild=null);else if(38===t){for(let e=u-1;0<=e;e--)if(!1!==s[e].visible){r=s[e];break}i[l]=r||s[s.length-1]}else if(40===t){for(let e=u+1;e<s.length;e++)if(!1!==s[e].visible){r=s[e];break}i[l]=r||s[0]}else!i[l]||13!==t&&32!==t||this.ctxMenuLinkEvent(e,i[l])},handleGlobalContextmenuEvent(t){let{$refs:e,tId:i,editStore:l,menuConfig:n,contextMenu:o,ctxMenuStore:s,ctxMenuOpts:r,mouseConfig:u,mouseOpts:d}=this;var h=l.selected,c=["header","body","footer"];if((0,_utils.isEnableConf)(n)||o){if(s.visible&&e.ctxWrapper&&(0,_dom.getEventTargetNode)(t,e.ctxWrapper.$el).flag)return void t.preventDefault();if(this._keyCtx){var a="body",v={type:a,$grid:this.$xegrid,$table:this,keyboard:!0,columns:this.visibleColumn.slice(0),$event:t};if(u&&d.area){var f=this.getActiveCellArea();if(f&&f.row&&f.column)return v.row=f.row,v.column=f.column,void this.handleOpenMenuEvent(t,a,v)}else if(u&&d.selected&&h.row&&h.column)return v.row=h.row,v.column=h.column,void this.handleOpenMenuEvent(t,a,v)}for(let e=0;e<c.length;e++){var g=c[e],m=(0,_dom.getEventTargetNode)(t,this.$el,`vxe-${g}--column`,e=>e.parentNode.parentNode.parentNode.getAttribute("xid")===i),x={type:g,$grid:this.$xegrid,$table:this,columns:this.visibleColumn.slice(0),$event:t};if(m.flag){var m=m.targetElem,p=this.getColumnNode(m).item;let e=g+"-";return Object.assign(x,{column:p,columnIndex:this.getColumnIndex(p),cell:m}),"body"===g&&(p=this.getRowNode(m.parentNode).item,e="",x.row=p,x.rowIndex=this.getRowIndex(p)),this.handleOpenMenuEvent(t,g,x),void(this.$listeners[e+"cell-context-menu"]?("development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.delEvent",[e+"cell-context-menu",e+"cell-menu"]),this.emitEvent(e+"cell-context-menu",x,t)):this.emitEvent(e+"cell-menu",x,t))}if((0,_dom.getEventTargetNode)(t,this.$el,`vxe-table--${g}-wrapper`,e=>e.getAttribute("xid")===i).flag)return void("cell"===r.trigger?t.preventDefault():this.handleOpenMenuEvent(t,g,x))}}e.filterWrapper&&!(0,_dom.getEventTargetNode)(t,e.filterWrapper.$el).flag&&this.closeFilter(),this.closeMenu()},handleOpenMenuEvent(i,l,a){let{isCtxMenu:n,ctxMenuStore:v,ctxMenuOpts:e}=this;l=e[l];let o=e.visibleMethod;if(l){let{options:t,disabled:e}=l;e?i.preventDefault():n&&t&&t.length&&(a.options=t,this.preventEvent(i,"event.showMenu",a,()=>{if(!o||o(a)){i.preventDefault(),this.updateZindex();let{scrollTop:n,scrollLeft:o,visibleHeight:s,visibleWidth:r}=(0,_dom.getDomNode)(),u=i.clientY+n,d=i.clientX+o,l=()=>{Object.assign(v,{args:a,visible:!0,list:t,selected:null,selectChild:null,showChild:!1,style:{zIndex:this.tZindex,top:u+"px",left:d+"px"}}),this.$nextTick(()=>{var e=this.$refs.ctxWrapper.$el,t=e.clientHeight,i=e.clientWidth,{boundingTop:e,boundingLeft:l}=(0,_dom.getAbsolutePos)(e),e=e+t-s,l=l+i-r;-10<e&&(v.style.top=Math.max(n+2,u-t-2)+"px"),-10<l&&(v.style.left=Math.max(o+2,d-i-2)+"px")})},{keyboard:e,row:h,column:c}=a;e&&h&&c?this.scrollToRow(h,c).then(()=>{var e=this.getCellElement(h,c),{boundingTop:t,boundingLeft:i}=(0,_dom.getAbsolutePos)(e);u=t+n+Math.floor(e.offsetHeight/2),d=i+o+Math.floor(e.offsetWidth/2),l()}):l()}else this.closeMenu()}))}this.closeFilter()},ctxMenuMouseoverEvent(e,t,i){let d=e.currentTarget;var l=this.ctxMenuStore;e.preventDefault(),e.stopPropagation(),l.selected=t,(l.selectChild=i)||(l.showChild=(0,_utils.hasChildrenList)(t),l.showChild&&this.$nextTick(()=>{var n=d.nextElementSibling;if(n){var{boundingTop:o,boundingLeft:s,visibleHeight:r,visibleWidth:u}=(0,_dom.getAbsolutePos)(d),o=o+d.offsetHeight;let e="",t="",i=(s+d.offsetWidth+n.offsetWidth>u-10&&(e="auto",t=d.offsetWidth+"px"),""),l="";o+n.offsetHeight>r-10&&(i="auto",l="0"),n.style.left=e,n.style.right=t,n.style.top=i,n.style.bottom=l}}))},ctxMenuMouseoutEvent(e,t){var i=this.ctxMenuStore;t.children||(i.selected=null),i.selectChild=null},ctxMenuLinkEvent(e,t){var i;t.disabled||!t.code&&t.children&&t.children.length||(i=menus.get(t.code),t=Object.assign({menu:t,$grid:this.$xegrid,$table:this,$event:e},this.ctxMenuStore.args),i&&i.menuMethod&&i.menuMethod(t,e),this.$listeners["context-menu-click"]?("development"===process.env.NODE_ENV&&(0,_log.warnLog)("vxe.error.delEvent",["context-menu-click","menu-click"]),this.emitEvent("context-menu-click",t,e)):this.emitEvent("menu-click",t,e),this.closeMenu())}}};
|
|
@@ -6,60 +6,62 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _ui = require("../../../ui");
|
|
8
8
|
var _utils = require("../../../ui/src/utils");
|
|
9
|
-
|
|
9
|
+
const {
|
|
10
|
+
getIcon
|
|
11
|
+
} = _ui.VxeUI;
|
|
10
12
|
var _default = exports.default = {
|
|
11
13
|
name: 'VxeTableMenuPanel',
|
|
12
14
|
props: {
|
|
13
15
|
ctxMenuStore: Object,
|
|
14
16
|
ctxMenuOpts: Object
|
|
15
17
|
},
|
|
16
|
-
mounted
|
|
18
|
+
mounted() {
|
|
17
19
|
document.body.appendChild(this.$el);
|
|
18
20
|
},
|
|
19
|
-
beforeDestroy
|
|
20
|
-
|
|
21
|
+
beforeDestroy() {
|
|
22
|
+
const {
|
|
23
|
+
$el
|
|
24
|
+
} = this;
|
|
21
25
|
if ($el.parentNode) {
|
|
22
26
|
$el.parentNode.removeChild($el);
|
|
23
27
|
}
|
|
24
28
|
},
|
|
25
|
-
render
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
render(h) {
|
|
30
|
+
const $xetable = this.$parent;
|
|
31
|
+
const {
|
|
32
|
+
_e,
|
|
33
|
+
ctxMenuOpts,
|
|
34
|
+
ctxMenuStore
|
|
35
|
+
} = this;
|
|
30
36
|
return h('div', {
|
|
31
37
|
class: ['vxe-table--context-menu-wrapper', ctxMenuOpts.className, {
|
|
32
38
|
'is--visible': ctxMenuStore.visible
|
|
33
39
|
}],
|
|
34
40
|
style: ctxMenuStore.style
|
|
35
|
-
}, ctxMenuStore.list.map(
|
|
36
|
-
return options.every(
|
|
37
|
-
return item.visible === false;
|
|
38
|
-
}) ? _e() : h('ul', {
|
|
41
|
+
}, ctxMenuStore.list.map((options, gIndex) => {
|
|
42
|
+
return options.every(item => item.visible === false) ? _e() : h('ul', {
|
|
39
43
|
class: 'vxe-context-menu--option-wrapper',
|
|
40
44
|
key: gIndex
|
|
41
|
-
}, options.map(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
45
|
-
var prefixOpts = Object.assign({}, item.prefixConfig);
|
|
46
|
-
var suffixOpts = Object.assign({}, item.suffixConfig);
|
|
45
|
+
}, options.map((item, index) => {
|
|
46
|
+
const hasChildMenus = item.children && item.children.some(child => child.visible !== false);
|
|
47
|
+
const prefixOpts = Object.assign({}, item.prefixConfig);
|
|
48
|
+
const suffixOpts = Object.assign({}, item.suffixConfig);
|
|
47
49
|
return item.visible === false ? null : h('li', {
|
|
48
50
|
class: [item.className, {
|
|
49
51
|
'link--disabled': item.disabled,
|
|
50
52
|
'link--active': item === ctxMenuStore.selected
|
|
51
53
|
}],
|
|
52
|
-
key:
|
|
54
|
+
key: `${gIndex}_${index}`
|
|
53
55
|
}, [h('a', {
|
|
54
56
|
class: 'vxe-context-menu--link',
|
|
55
57
|
on: {
|
|
56
|
-
click
|
|
58
|
+
click(evnt) {
|
|
57
59
|
$xetable.ctxMenuLinkEvent(evnt, item);
|
|
58
60
|
},
|
|
59
|
-
mouseover
|
|
61
|
+
mouseover(evnt) {
|
|
60
62
|
$xetable.ctxMenuMouseoverEvent(evnt, item);
|
|
61
63
|
},
|
|
62
|
-
mouseout
|
|
64
|
+
mouseout(evnt) {
|
|
63
65
|
$xetable.ctxMenuMouseoutEvent(evnt, item);
|
|
64
66
|
}
|
|
65
67
|
}
|
|
@@ -67,35 +69,35 @@ var _default = exports.default = {
|
|
|
67
69
|
class: ['vxe-context-menu--link-prefix', prefixOpts.className || '']
|
|
68
70
|
}, [h('i', {
|
|
69
71
|
class: prefixOpts.icon || item.prefixIcon
|
|
70
|
-
}), prefixOpts.content ? h('span', {},
|
|
72
|
+
}), prefixOpts.content ? h('span', {}, `${prefixOpts.content}`) : _e()]), h('span', {
|
|
71
73
|
class: 'vxe-context-menu--link-content'
|
|
72
74
|
}, (0, _utils.getFuncText)(item.name)), h('div', {
|
|
73
75
|
class: ['vxe-context-menu--link-suffix', suffixOpts.className || '']
|
|
74
76
|
}, [h('i', {
|
|
75
77
|
class: suffixOpts.icon || item.suffixIcon || (hasChildMenus ? getIcon().TABLE_MENU_OPTIONS : '')
|
|
76
|
-
}), suffixOpts.content ? h('span',
|
|
78
|
+
}), suffixOpts.content ? h('span', `${suffixOpts.content}`) : _e()])]), hasChildMenus ? h('ul', {
|
|
77
79
|
class: ['vxe-table--context-menu-clild-wrapper', {
|
|
78
80
|
'is--show': item === ctxMenuStore.selected && ctxMenuStore.showChild
|
|
79
81
|
}]
|
|
80
|
-
}, item.children.map(
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
}, item.children.map((child, cIndex) => {
|
|
83
|
+
const childPrefixOpts = Object.assign({}, child.prefixConfig);
|
|
84
|
+
const childSuffixOpts = Object.assign({}, child.suffixConfig);
|
|
83
85
|
return child.visible === false ? null : h('li', {
|
|
84
86
|
class: [child.className, {
|
|
85
87
|
'link--disabled': child.disabled,
|
|
86
88
|
'link--active': child === ctxMenuStore.selectChild
|
|
87
89
|
}],
|
|
88
|
-
key:
|
|
90
|
+
key: `${gIndex}_${index}_${cIndex}`
|
|
89
91
|
}, [h('a', {
|
|
90
92
|
class: 'vxe-context-menu--link',
|
|
91
93
|
on: {
|
|
92
|
-
click
|
|
94
|
+
click(evnt) {
|
|
93
95
|
$xetable.ctxMenuLinkEvent(evnt, child);
|
|
94
96
|
},
|
|
95
|
-
mouseover
|
|
97
|
+
mouseover(evnt) {
|
|
96
98
|
$xetable.ctxMenuMouseoverEvent(evnt, item, child);
|
|
97
99
|
},
|
|
98
|
-
mouseout
|
|
100
|
+
mouseout(evnt) {
|
|
99
101
|
$xetable.ctxMenuMouseoutEvent(evnt, item, child);
|
|
100
102
|
}
|
|
101
103
|
}
|
|
@@ -103,13 +105,13 @@ var _default = exports.default = {
|
|
|
103
105
|
class: ['vxe-context-menu--link-prefix', childPrefixOpts.className || '']
|
|
104
106
|
}, [h('i', {
|
|
105
107
|
class: childPrefixOpts.icon || child.prefixIcon
|
|
106
|
-
}), childPrefixOpts.content ? h('span',
|
|
108
|
+
}), childPrefixOpts.content ? h('span', `${childPrefixOpts.content}`) : _e()]), h('span', {
|
|
107
109
|
class: 'vxe-context-menu--link-content'
|
|
108
110
|
}, (0, _utils.getFuncText)(child.name)), h('div', {
|
|
109
111
|
class: ['vxe-context-menu--link-suffix', childSuffixOpts.className || '']
|
|
110
112
|
}, [h('i', {
|
|
111
113
|
class: childSuffixOpts.icon
|
|
112
|
-
}), childSuffixOpts.content ? h('span',
|
|
114
|
+
}), childSuffixOpts.content ? h('span', `${childSuffixOpts.content}`) : _e()])])]);
|
|
113
115
|
})) : null]);
|
|
114
116
|
}));
|
|
115
117
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _ui=require("../../../ui"),_utils=require("../../../ui/src/utils")
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _ui=require("../../../ui"),_utils=require("../../../ui/src/utils");let getIcon=_ui.VxeUI.getIcon;var _default=exports.default={name:"VxeTableMenuPanel",props:{ctxMenuStore:Object,ctxMenuOpts:Object},mounted(){document.body.appendChild(this.$el)},beforeDestroy(){var e=this.$el;e.parentNode&&e.parentNode.removeChild(e)},render(a){let o=this.$parent,{_e:u,ctxMenuOpts:e,ctxMenuStore:r}=this;return a("div",{class:["vxe-table--context-menu-wrapper",e.className,{"is--visible":r.visible}],style:r.style},r.list.map((e,c)=>e.every(e=>!1===e.visible)?u():a("ul",{class:"vxe-context-menu--option-wrapper",key:c},e.map((i,l)=>{var e=i.children&&i.children.some(e=>!1!==e.visible),n=Object.assign({},i.prefixConfig),t=Object.assign({},i.suffixConfig);return!1===i.visible?null:a("li",{class:[i.className,{"link--disabled":i.disabled,"link--active":i===r.selected}],key:c+"_"+l},[a("a",{class:"vxe-context-menu--link",on:{click(e){o.ctxMenuLinkEvent(e,i)},mouseover(e){o.ctxMenuMouseoverEvent(e,i)},mouseout(e){o.ctxMenuMouseoutEvent(e,i)}}},[a("div",{class:["vxe-context-menu--link-prefix",n.className||""]},[a("i",{class:n.icon||i.prefixIcon}),n.content?a("span",{},""+n.content):u()]),a("span",{class:"vxe-context-menu--link-content"},(0,_utils.getFuncText)(i.name)),a("div",{class:["vxe-context-menu--link-suffix",t.className||""]},[a("i",{class:t.icon||i.suffixIcon||(e?getIcon().TABLE_MENU_OPTIONS:"")}),t.content?a("span",""+t.content):u()])]),e?a("ul",{class:["vxe-table--context-menu-clild-wrapper",{"is--show":i===r.selected&&r.showChild}]},i.children.map((n,e)=>{var t=Object.assign({},n.prefixConfig),s=Object.assign({},n.suffixConfig);return!1===n.visible?null:a("li",{class:[n.className,{"link--disabled":n.disabled,"link--active":n===r.selectChild}],key:c+`_${l}_`+e},[a("a",{class:"vxe-context-menu--link",on:{click(e){o.ctxMenuLinkEvent(e,n)},mouseover(e){o.ctxMenuMouseoverEvent(e,i,n)},mouseout(e){o.ctxMenuMouseoutEvent(e,i,n)}}},[a("div",{class:["vxe-context-menu--link-prefix",t.className||""]},[a("i",{class:t.icon||n.prefixIcon}),t.content?a("span",""+t.content):u()]),a("span",{class:"vxe-context-menu--link-content"},(0,_utils.getFuncText)(n.name)),a("div",{class:["vxe-context-menu--link-suffix",s.className||""]},[a("i",{class:s.icon}),s.content?a("span",""+s.content):u()])])])})):null])}))))}};
|