1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _tools = require("../../tools");
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var _default = {
name: 'PlxTableContextMenu',
props: {
ctxMenuStore: Object
},
render: function render(h) {
var $table = this.$parent;
var _e = this._e,
ctxMenuStore = this.ctxMenuStore;
return h('div', {
class: ['plx-table--ctxmenu-wrapper', _defineProperty({
'is--show': ctxMenuStore.visible
}, "child-pos--".concat(ctxMenuStore.childPos), ctxMenuStore.childPos)],
style: ctxMenuStore.style
}, ctxMenuStore.list.map(function (options, gIndex) {
return h('ul', {
class: 'plx-ctxmenu--option-wrapper',
key: gIndex
}, options.map(function (item, index) {
var hasChildMenus = item.children && item.children.length;
return item.visible === false ? _e() : h('li', {
class: {
'link--disabled': item.disabled,
'link--active': item === ctxMenuStore.selected
},
key: "".concat(gIndex, "_").concat(index)
}, [h('a', {
class: 'plx-ctxmenu--link',
on: {
click: function click(evnt) {
$table.ctxMenuLinkEvent(evnt, item);
},
mouseover: function mouseover(evnt) {
$table.ctxMenuMouseoverEvent(evnt, item);
},
mouseout: function mouseout(evnt) {
$table.ctxMenuMouseoutEvent(evnt, item);
}
}
}, [h('i', {
class: ['plx-ctxmenu--link-prefix', item.prefixIcon]
}), h('span', {
class: 'plx-ctxmenu--link-content'
}, _tools.UtilTools.getFuncText(item.name)), h('i', {
class: ['plx-ctxmenu--link-suffix', hasChildMenus ? item.suffixIcon || 'suffix--haschild' : item.suffixIcon]
})]), hasChildMenus ? h('ul', {
class: ['plx-table--ctxmenu-clild-wrapper', {
'is--show': item === ctxMenuStore.selected && ctxMenuStore.showChild
}]
}, item.children.map(function (child, cIndex) {
return child.visible === false ? _e() : h('li', {
class: {
'link--disabled': child.disabled,
'link--active': child === ctxMenuStore.selectChild
},
key: "".concat(gIndex, "_").concat(index, "_").concat(cIndex)
}, [h('a', {
class: 'plx-ctxmenu--link',
on: {
click: function click(evnt) {
$table.ctxMenuLinkEvent(evnt, child);
},
mouseover: function mouseover(evnt) {
$table.ctxMenuMouseoverEvent(evnt, item, child);
},
mouseout: function mouseout(evnt) {
$table.ctxMenuMouseoutEvent(evnt, item, child);
}
}
}, [h('i', {
class: ['plx-ctxmenu--link-prefix', child.prefixIcon]
}), h('span', {
class: 'plx-ctxmenu--link-content'
}, _tools.UtilTools.getFuncText(child.name))])]);
})) : _e()]);
}));
}));
}
};
exports.default = _default;