@jetlinks-web/components 2.0.37 → 2.1.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/es/CardSelect/style/index.js +1 -0
- package/es/CheckButton/style/index.js +1 -0
- package/es/DragModal/DragModal.js +307 -0
- package/es/DragModal/index.js +5 -0
- package/es/DragModal/style/index.css +81 -0
- package/es/DragModal/style/index.js +1 -0
- package/es/DragModal/style/index.less +96 -0
- package/es/EditTable/Body.js +368 -0
- package/es/EditTable/EditTable.js +412 -0
- package/es/EditTable/Header.js +242 -0
- package/es/EditTable/components/ContextMenu/Menu.js +154 -0
- package/es/EditTable/components/ContextMenu/index.js +81 -0
- package/es/EditTable/components/Search/Search.js +290 -0
- package/es/EditTable/components/Search/index.js +1 -0
- package/es/EditTable/consts.js +7 -0
- package/es/EditTable/hooks/index.js +40 -0
- package/es/EditTable/hooks/useResizeObserver.js +31 -0
- package/es/EditTable/hooks/useValidate.js +87 -0
- package/es/EditTable/index.js +9 -0
- package/es/EditTable/props.js +50 -0
- package/es/EditTable/style/body.less +76 -0
- package/es/EditTable/style/header.less +77 -0
- package/es/EditTable/style/index.css +214 -0
- package/es/EditTable/style/index.js +1 -0
- package/es/EditTable/style/index.less +38 -0
- package/es/EditTable/style/table.less +42 -0
- package/es/EditTable/utils.js +97 -0
- package/es/Ellipsis/style/index.js +1 -0
- package/es/FullPage/FullPage.js +1 -1
- package/es/Search/Advanced/SaveHistory.js +1 -1
- package/es/Search/Item.js +1 -1
- package/es/Search/Search.js +1 -1
- package/es/components.js +3 -1
- package/es/style/index.css +287 -0
- package/es/style/index.less +9 -7
- package/es/style.js +3 -1
- package/lib/CardSelect/style/index.js +3 -0
- package/lib/CheckButton/style/index.js +3 -0
- package/lib/DragModal/DragModal.js +307 -0
- package/lib/DragModal/index.js +12 -0
- package/lib/DragModal/style/index.css +81 -0
- package/lib/DragModal/style/index.js +3 -0
- package/lib/DragModal/style/index.less +96 -0
- package/lib/EditTable/Body.js +368 -0
- package/lib/EditTable/EditTable.js +412 -0
- package/lib/EditTable/Header.js +242 -0
- package/lib/EditTable/components/ContextMenu/Menu.js +154 -0
- package/lib/EditTable/components/ContextMenu/index.js +88 -0
- package/lib/EditTable/components/Search/Search.js +290 -0
- package/lib/EditTable/components/Search/index.js +13 -0
- package/lib/EditTable/consts.js +13 -0
- package/lib/EditTable/hooks/index.js +79 -0
- package/lib/EditTable/hooks/useResizeObserver.js +38 -0
- package/lib/EditTable/hooks/useValidate.js +94 -0
- package/lib/EditTable/index.js +16 -0
- package/lib/EditTable/props.js +56 -0
- package/lib/EditTable/style/body.less +76 -0
- package/lib/EditTable/style/header.less +77 -0
- package/lib/EditTable/style/index.css +214 -0
- package/lib/EditTable/style/index.js +3 -0
- package/lib/EditTable/style/index.less +38 -0
- package/lib/EditTable/style/table.less +42 -0
- package/lib/EditTable/utils.js +104 -0
- package/lib/Ellipsis/style/index.js +3 -0
- package/lib/FullPage/FullPage.js +1 -1
- package/lib/Search/Advanced/SaveHistory.js +1 -1
- package/lib/Search/Item.js +1 -1
- package/lib/Search/Search.js +1 -1
- package/lib/components.js +14 -0
- package/lib/style/components.less +2 -0
- package/lib/style/index.css +287 -0
- package/lib/style/index.less +9 -7
- package/lib/style.js +3 -1
- package/package.json +3 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
|
|
2
|
+
/* stylelint-disable no-duplicate-selectors */
|
|
3
|
+
/* stylelint-disable */
|
|
4
|
+
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
|
|
5
|
+
.dialog-enter-active,
|
|
6
|
+
.dialog-leave-active {
|
|
7
|
+
transition: opacity 0.5s;
|
|
8
|
+
}
|
|
9
|
+
.dialog-enter,
|
|
10
|
+
.dialog-leave-to {
|
|
11
|
+
opacity: 0;
|
|
12
|
+
}
|
|
13
|
+
.jetlinks-drag-modal {
|
|
14
|
+
position: fixed;
|
|
15
|
+
z-index: 1000;
|
|
16
|
+
}
|
|
17
|
+
.jetlinks-drag-modal .jetlinks-drag-modal-sprite {
|
|
18
|
+
position: absolute;
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
z-index: 23456765435;
|
|
25
|
+
background-color: #ffffff;
|
|
26
|
+
border-radius: 4px;
|
|
27
|
+
border: 1px solid #91CAFF;
|
|
28
|
+
box-shadow: 0 3px 8px 0 rgba(22, 119, 255, 0.24);
|
|
29
|
+
}
|
|
30
|
+
.jetlinks-drag-modal .jetlinks-drag-modal-sprite .header {
|
|
31
|
+
padding: 5px 15px;
|
|
32
|
+
font-size: 18px;
|
|
33
|
+
font-weight: 700;
|
|
34
|
+
color: #333;
|
|
35
|
+
display: flex;
|
|
36
|
+
justify-content: space-between;
|
|
37
|
+
align-items: center;
|
|
38
|
+
border-bottom: 1px solid #f0f0f0;
|
|
39
|
+
cursor: move;
|
|
40
|
+
}
|
|
41
|
+
.jetlinks-drag-modal .jetlinks-drag-modal-sprite .jetlinks-drag-modal-body {
|
|
42
|
+
flex: 1;
|
|
43
|
+
min-height: 0;
|
|
44
|
+
overflow-y: auto;
|
|
45
|
+
padding: 24px 20px;
|
|
46
|
+
}
|
|
47
|
+
.jetlinks-drag-modal .jetlinks-drag-modal-sprite .jetlinks-drag-modal-footer {
|
|
48
|
+
border-top: 1px solid #f0f0f0;
|
|
49
|
+
padding: 5px 15px;
|
|
50
|
+
}
|
|
51
|
+
.jetlinks-drag-modal .jetlinks-drag-modal-range {
|
|
52
|
+
position: absolute;
|
|
53
|
+
width: 16px;
|
|
54
|
+
height: 16px;
|
|
55
|
+
border-radius: 100%;
|
|
56
|
+
z-index: 23456765436;
|
|
57
|
+
}
|
|
58
|
+
.jetlinks-drag-modal .jetlinks-drag-modal-range .drag-bottom-right:hover,
|
|
59
|
+
.jetlinks-drag-modal .jetlinks-drag-modal-range .drag-top-left:hover {
|
|
60
|
+
cursor: nwse-resize;
|
|
61
|
+
}
|
|
62
|
+
.jetlinks-drag-modal .jetlinks-drag-modal-range .drag-bottom-left:hover,
|
|
63
|
+
.jetlinks-drag-modal .jetlinks-drag-modal-range .drag-top-right:hover {
|
|
64
|
+
cursor: nesw-resize;
|
|
65
|
+
}
|
|
66
|
+
.jetlinks-drag-modal .jetlinks-drag-modal-range .drag-top-right {
|
|
67
|
+
top: -6px;
|
|
68
|
+
right: -6px;
|
|
69
|
+
}
|
|
70
|
+
.jetlinks-drag-modal .jetlinks-drag-modal-range .drag-top-left {
|
|
71
|
+
top: -6px;
|
|
72
|
+
left: -6px;
|
|
73
|
+
}
|
|
74
|
+
.jetlinks-drag-modal .jetlinks-drag-modal-range .drag-bottom-right {
|
|
75
|
+
bottom: -6px;
|
|
76
|
+
right: -6px;
|
|
77
|
+
}
|
|
78
|
+
.jetlinks-drag-modal .jetlinks-drag-modal-range .drag-bottom-left {
|
|
79
|
+
bottom: -6px;
|
|
80
|
+
left: -6px;
|
|
81
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
@import "ant-design-vue/es/style/themes/index.less";
|
|
2
|
+
@boxColor: rgb(@primary-color);
|
|
3
|
+
|
|
4
|
+
// 弹窗动画
|
|
5
|
+
.dialog-enter-active,
|
|
6
|
+
.dialog-leave-active {
|
|
7
|
+
transition: opacity .5s;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.dialog-enter,
|
|
11
|
+
.dialog-leave-to {
|
|
12
|
+
opacity: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.jetlinks-drag-modal {
|
|
16
|
+
position: fixed;
|
|
17
|
+
z-index: 1000;
|
|
18
|
+
|
|
19
|
+
.jetlinks-drag-modal-sprite {
|
|
20
|
+
position: absolute;
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
z-index: 23456765435;
|
|
27
|
+
background-color: #ffffff;
|
|
28
|
+
border-radius: 4px;
|
|
29
|
+
border: 1px solid #91CAFF;
|
|
30
|
+
box-shadow: 0 3px 8px 0 rgba(#1677FF, 0.24);
|
|
31
|
+
|
|
32
|
+
.header {
|
|
33
|
+
padding: 5px 15px;
|
|
34
|
+
font-size: 18px;
|
|
35
|
+
font-weight: 700;
|
|
36
|
+
color: #333;
|
|
37
|
+
display: flex;
|
|
38
|
+
justify-content: space-between;
|
|
39
|
+
align-items: center;
|
|
40
|
+
border-bottom: 1px solid #f0f0f0;
|
|
41
|
+
cursor: move;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.jetlinks-drag-modal-body {
|
|
45
|
+
flex: 1;
|
|
46
|
+
min-height: 0;
|
|
47
|
+
overflow-y: auto;
|
|
48
|
+
padding: 24px 20px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.jetlinks-drag-modal-footer {
|
|
52
|
+
border-top: 1px solid #f0f0f0;
|
|
53
|
+
padding: 5px 15px;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.jetlinks-drag-modal-range {
|
|
58
|
+
position: absolute;
|
|
59
|
+
width: 16px;
|
|
60
|
+
height: 16px;
|
|
61
|
+
border-radius: 100%;
|
|
62
|
+
z-index: 23456765436;
|
|
63
|
+
|
|
64
|
+
.drag-bottom-right, .drag-top-left {
|
|
65
|
+
&:hover {
|
|
66
|
+
cursor: nwse-resize
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.drag-bottom-left, .drag-top-right {
|
|
71
|
+
&:hover {
|
|
72
|
+
cursor: nesw-resize
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.drag-top-right {
|
|
77
|
+
top: -6px;
|
|
78
|
+
right: -6px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.drag-top-left {
|
|
82
|
+
top: -6px;
|
|
83
|
+
left: -6px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.drag-bottom-right {
|
|
87
|
+
bottom: -6px;
|
|
88
|
+
right: -6px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.drag-bottom-left {
|
|
92
|
+
bottom: -6px;
|
|
93
|
+
left: -6px;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) {
|
|
2
|
+
const op = ops[i];
|
|
3
|
+
const fn = ops[i + 1];
|
|
4
|
+
i += 2;
|
|
5
|
+
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
if (op === 'access' || op === 'optionalAccess') {
|
|
9
|
+
lastAccessLHS = value;
|
|
10
|
+
value = fn(value);
|
|
11
|
+
}
|
|
12
|
+
else if (op === 'call' || op === 'optionalCall') {
|
|
13
|
+
value = fn((...args) => value.call(lastAccessLHS, ...args));
|
|
14
|
+
lastAccessLHS = undefined;
|
|
15
|
+
}
|
|
16
|
+
} return value; }
|
|
17
|
+
/* Analyzed bindings: {
|
|
18
|
+
"groupKey": "props",
|
|
19
|
+
"ContextMenu": "setup-maybe-ref",
|
|
20
|
+
"useRightMenuContext": "setup-maybe-ref",
|
|
21
|
+
"useTableTool": "setup-maybe-ref",
|
|
22
|
+
"randomString": "setup-maybe-ref",
|
|
23
|
+
"bodyProps": "setup-maybe-ref",
|
|
24
|
+
"defaultProps": "setup-maybe-ref",
|
|
25
|
+
"ref": "setup-const",
|
|
26
|
+
"reactive": "setup-const",
|
|
27
|
+
"computed": "setup-const",
|
|
28
|
+
"watch": "setup-const",
|
|
29
|
+
"onMounted": "setup-const",
|
|
30
|
+
"onBeforeUnmount": "setup-const",
|
|
31
|
+
"handleColumnFixed": "setup-maybe-ref",
|
|
32
|
+
"props": "setup-reactive-const",
|
|
33
|
+
"emit": "setup-const",
|
|
34
|
+
"viewScrollRef": "setup-ref",
|
|
35
|
+
"virtualRang": "setup-reactive-const",
|
|
36
|
+
"containerStyle": "setup-ref",
|
|
37
|
+
"context": "setup-maybe-ref",
|
|
38
|
+
"tableTool": "setup-maybe-ref",
|
|
39
|
+
"selectedRowKeys": "setup-ref",
|
|
40
|
+
"hoverKeys": "setup-ref",
|
|
41
|
+
"scrollLock": "setup-ref",
|
|
42
|
+
"menuInstance": "setup-let",
|
|
43
|
+
"maxLen": "setup-ref",
|
|
44
|
+
"virtualData": "setup-ref",
|
|
45
|
+
"columnFixedMap": "setup-ref",
|
|
46
|
+
"onScroll": "setup-const",
|
|
47
|
+
"scrollTo": "setup-const",
|
|
48
|
+
"showContextMenu": "setup-const",
|
|
49
|
+
"rowClick": "setup-const",
|
|
50
|
+
"updateSelectedKeys": "setup-const",
|
|
51
|
+
"getViewScrollRef": "setup-const"
|
|
52
|
+
} */
|
|
53
|
+
import { normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withModifiers as _withModifiers, normalizeClass as _normalizeClass, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createVNode as _createVNode } from "vue";
|
|
54
|
+
const _hoisted_1 = {
|
|
55
|
+
class: "jetlinks-edit-table-body-container",
|
|
56
|
+
style: { position: 'relative' }
|
|
57
|
+
};
|
|
58
|
+
const _hoisted_2 = ["data-row-key", "onContextmenu", "onClick", "onMouseover"];
|
|
59
|
+
const _hoisted_3 = { class: "body-cell-box" };
|
|
60
|
+
const _hoisted_4 = ["data-row-key", "onContextmenu", "onClick", "onMouseover"];
|
|
61
|
+
const _hoisted_5 = { class: "body-cell-box" };
|
|
62
|
+
const _hoisted_6 = ["data-row-key", "onContextmenu", "onClick", "onMouseover"];
|
|
63
|
+
const _hoisted_7 = { class: "body-cell-box" };
|
|
64
|
+
const _hoisted_8 = { class: "jetlinks-edit-table-body-empty" };
|
|
65
|
+
import ContextMenu from './components/ContextMenu';
|
|
66
|
+
import { useRightMenuContext, useTableTool } from "./hooks";
|
|
67
|
+
import { randomString } from "@jetlinks-web/utils";
|
|
68
|
+
import { bodyProps, defaultProps } from "./props";
|
|
69
|
+
import { ref, reactive, computed, watch, onMounted, onBeforeUnmount } from 'vue';
|
|
70
|
+
import { handleColumnFixed } from "./utils";
|
|
71
|
+
const __sfc_main__ = Object.assign({
|
|
72
|
+
name: 'JEditTableBody'
|
|
73
|
+
}, {
|
|
74
|
+
props: {
|
|
75
|
+
...defaultProps(),
|
|
76
|
+
...bodyProps(),
|
|
77
|
+
groupKey: {
|
|
78
|
+
type: [String, Number],
|
|
79
|
+
default: undefined
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
emits: ['update:dataSource', 'scrollDown'],
|
|
83
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
84
|
+
const props = __props;
|
|
85
|
+
const emit = __emit;
|
|
86
|
+
const viewScrollRef = ref();
|
|
87
|
+
const virtualRang = reactive({
|
|
88
|
+
start: 0,
|
|
89
|
+
end: 15
|
|
90
|
+
});
|
|
91
|
+
const containerStyle = ref(0);
|
|
92
|
+
const context = useRightMenuContext();
|
|
93
|
+
const tableTool = useTableTool();
|
|
94
|
+
const selectedRowKeys = ref([]);
|
|
95
|
+
const hoverKeys = ref();
|
|
96
|
+
const scrollLock = ref(false);
|
|
97
|
+
let menuInstance;
|
|
98
|
+
const maxLen = computed(() => {
|
|
99
|
+
return Math.trunc(props.height / props.cellHeight);
|
|
100
|
+
});
|
|
101
|
+
const virtualData = computed(() => props.dataSource.slice(virtualRang.start, virtualRang.end));
|
|
102
|
+
const columnFixedMap = computed(() => {
|
|
103
|
+
return handleColumnFixed(props.columns);
|
|
104
|
+
});
|
|
105
|
+
const onScroll = () => {
|
|
106
|
+
if (!viewScrollRef.value)
|
|
107
|
+
return;
|
|
108
|
+
const height = viewScrollRef.value.scrollTop;
|
|
109
|
+
const clientHeight = viewScrollRef.value.clientHeight;
|
|
110
|
+
const scrollHeight = viewScrollRef.value.scrollHeight;
|
|
111
|
+
const _index = Math.round(height / props.cellHeight) - 1;
|
|
112
|
+
const start = _index < 0 ? 0 : _index;
|
|
113
|
+
const end = start + maxLen.value + 4;
|
|
114
|
+
if (height + clientHeight >= props.dataSource.length * props.cellHeight && !scrollLock.value) { // 滚动到底
|
|
115
|
+
emit('scrollDown');
|
|
116
|
+
scrollLock.value = true;
|
|
117
|
+
}
|
|
118
|
+
virtualRang.start = start;
|
|
119
|
+
virtualRang.end = end;
|
|
120
|
+
// updateVirtualData(start, end)
|
|
121
|
+
};
|
|
122
|
+
const scrollTo = (index) => {
|
|
123
|
+
if (viewScrollRef.value) {
|
|
124
|
+
let top = index * props.cellHeight;
|
|
125
|
+
viewScrollRef.value.scrollTop = top;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const showContextMenu = (e, record, _index) => {
|
|
129
|
+
e.preventDefault();
|
|
130
|
+
if (!props.disableMenu) {
|
|
131
|
+
record = {
|
|
132
|
+
...record,
|
|
133
|
+
__index: _index
|
|
134
|
+
};
|
|
135
|
+
menuInstance = ContextMenu(e, record, context);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
const rowClick = (record) => {
|
|
139
|
+
if (_optionalChain([props, 'access', _ => _.rowSelection, 'optionalAccess', _2 => _2.selectedRowKeys])) {
|
|
140
|
+
const rowSet = new Set(selectedRowKeys.value);
|
|
141
|
+
const key = record[props.rowKey];
|
|
142
|
+
const selected = !rowSet.has(key);
|
|
143
|
+
if (selected) {
|
|
144
|
+
rowSet.delete(key);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
rowSet.add(key);
|
|
148
|
+
}
|
|
149
|
+
_optionalChain([props, 'access', _3 => _3.rowSelection, 'access', _4 => _4.onSelect, 'optionalCall', _5 => _5(record, selected)]);
|
|
150
|
+
selectedRowKeys.value = [...rowSet.values()];
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
const updateSelectedKeys = (keys) => {
|
|
154
|
+
selectedRowKeys.value = keys;
|
|
155
|
+
};
|
|
156
|
+
const getViewScrollRef = () => viewScrollRef.value;
|
|
157
|
+
watch(() => JSON.stringify(_optionalChain([props, 'access', _6 => _6.rowSelection, 'optionalAccess', _7 => _7.selectedRowKeys])), (val) => {
|
|
158
|
+
selectedRowKeys.value = JSON.parse(val || '[]');
|
|
159
|
+
}, { immediate: true });
|
|
160
|
+
watch(() => props.dataSource, (val, oldVal) => {
|
|
161
|
+
props.dataSource.forEach((item, index) => {
|
|
162
|
+
if (!item.__key) {
|
|
163
|
+
item.__key = randomString();
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}, {
|
|
167
|
+
immediate: true,
|
|
168
|
+
deep: true
|
|
169
|
+
});
|
|
170
|
+
watch(() => props.dataSource.length, () => {
|
|
171
|
+
scrollLock.value = false;
|
|
172
|
+
containerStyle.value = {
|
|
173
|
+
height: props.dataSource.length * props.cellHeight + 'px'
|
|
174
|
+
};
|
|
175
|
+
if (props.dataSource.length <= maxLen.value || props.dataSource.length === 0) {
|
|
176
|
+
emit('scrollDown', maxLen.value - props.dataSource.length + 3);
|
|
177
|
+
}
|
|
178
|
+
}, { immediate: true });
|
|
179
|
+
// watch(() => props.height, () => {
|
|
180
|
+
// updateView()
|
|
181
|
+
// })
|
|
182
|
+
onMounted(() => {
|
|
183
|
+
nextTick(() => {
|
|
184
|
+
onScroll();
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
onBeforeUnmount(() => {
|
|
188
|
+
_optionalChain([menuInstance, 'optionalAccess', _8 => _8.destroy, 'call', _9 => _9()]);
|
|
189
|
+
_optionalChain([menuInstance, 'optionalAccess', _10 => _10.cleanCopy, 'call', _11 => _11()]);
|
|
190
|
+
});
|
|
191
|
+
__expose({
|
|
192
|
+
scrollTo,
|
|
193
|
+
updateSelectedKeys,
|
|
194
|
+
getViewScrollRef
|
|
195
|
+
});
|
|
196
|
+
return (_ctx, _cache) => {
|
|
197
|
+
const _component_j_empty = _resolveComponent("j-empty");
|
|
198
|
+
return (_ctx.dataSource.length)
|
|
199
|
+
? (_openBlock(), _createElementBlock("div", {
|
|
200
|
+
key: 0,
|
|
201
|
+
class: "jetlinks-edit-table-body-viewport",
|
|
202
|
+
style: _normalizeStyle({ ..._ctx.style, height: _ctx.height + 'px' }),
|
|
203
|
+
ref_key: "viewScrollRef",
|
|
204
|
+
ref: viewScrollRef,
|
|
205
|
+
onScroll: onScroll
|
|
206
|
+
}, [
|
|
207
|
+
_createElementVNode("div", _hoisted_1, [
|
|
208
|
+
_createElementVNode("div", {
|
|
209
|
+
class: "jetlinks-edit-scrollbar",
|
|
210
|
+
style: _normalizeStyle(containerStyle.value)
|
|
211
|
+
}, null, 4 /* STYLE */),
|
|
212
|
+
(columnFixedMap.value.left.keys.length)
|
|
213
|
+
? (_openBlock(), _createElementBlock("div", {
|
|
214
|
+
key: 0,
|
|
215
|
+
class: "jetlinks-edit-table-left",
|
|
216
|
+
style: _normalizeStyle({
|
|
217
|
+
webkitTransform: `translate3d(0, ${virtualRang.start * props.cellHeight}px, 0)`,
|
|
218
|
+
maxWidth: columnFixedMap.value.left.width + 'px',
|
|
219
|
+
minWidth: columnFixedMap.value.left.width + 'px',
|
|
220
|
+
width: columnFixedMap.value.left.width + 'px',
|
|
221
|
+
boxShadow: _unref(tableTool).scrollMap.x ? '0 0 12px 0 rgba(0 ,0, 0, .2)' : ''
|
|
222
|
+
})
|
|
223
|
+
}, [
|
|
224
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(virtualData.value, (item, index) => {
|
|
225
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
226
|
+
class: _normalizeClass({
|
|
227
|
+
'jetlinks-edit-table-row': true,
|
|
228
|
+
'jetlinks-edit-table-row-selected': _optionalChain([selectedRowKeys, 'access', _12 => _12.value, 'optionalAccess', _13 => _13.includes, 'call', _14 => _14(item[_ctx.rowKey] || virtualRang.start + index + 1)]),
|
|
229
|
+
'jetlinks-edit-table-row-hover': hoverKeys.value === (item[_ctx.rowKey] || virtualRang.start + index + 1)
|
|
230
|
+
}),
|
|
231
|
+
key: 'left' + index,
|
|
232
|
+
style: _normalizeStyle({ height: `${_ctx.cellHeight}px` }),
|
|
233
|
+
"data-row-key": item[_ctx.rowKey] || virtualRang.start + index + 1,
|
|
234
|
+
onContextmenu: _withModifiers((e) => showContextMenu(e, item, virtualRang.start + index), ["right"]),
|
|
235
|
+
onClick: _withModifiers(() => rowClick(item), ["stop"]),
|
|
236
|
+
onMouseover: $event => (hoverKeys.value = (item[_ctx.rowKey] || virtualRang.start + index + 1)),
|
|
237
|
+
onMouseleave: _cache[0] || (_cache[0] = $event => (hoverKeys.value = undefined))
|
|
238
|
+
}, [
|
|
239
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(columnFixedMap.value.left.keys, (column) => {
|
|
240
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
241
|
+
class: "jetlinks-edit-table-cell",
|
|
242
|
+
style: _normalizeStyle({
|
|
243
|
+
width: `${column._width}px`,
|
|
244
|
+
})
|
|
245
|
+
}, [
|
|
246
|
+
_createElementVNode("div", _hoisted_3, [
|
|
247
|
+
_renderSlot(_ctx.$slots, column.dataIndex, {
|
|
248
|
+
record: item,
|
|
249
|
+
index: item.__dataIndex,
|
|
250
|
+
column: column
|
|
251
|
+
}, () => [
|
|
252
|
+
_createTextVNode(_toDisplayString(column.dataIndex === '__serial' ? virtualRang.start + index + 1 : item[column.dataIndex]), 1 /* TEXT */)
|
|
253
|
+
])
|
|
254
|
+
])
|
|
255
|
+
], 4 /* STYLE */));
|
|
256
|
+
}), 256 /* UNKEYED_FRAGMENT */))
|
|
257
|
+
], 46 /* CLASS, STYLE, PROPS, NEED_HYDRATION */, _hoisted_2));
|
|
258
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
259
|
+
], 4 /* STYLE */))
|
|
260
|
+
: _createCommentVNode("v-if", true),
|
|
261
|
+
_createElementVNode("div", {
|
|
262
|
+
class: "jetlinks-edit-table-center",
|
|
263
|
+
style: _normalizeStyle({
|
|
264
|
+
webkitTransform: `translate3d(-${_unref(tableTool).scrollMap.x}px, ${virtualRang.start * props.cellHeight}px, 0)`
|
|
265
|
+
})
|
|
266
|
+
}, [
|
|
267
|
+
_createElementVNode("div", {
|
|
268
|
+
style: _normalizeStyle({ width: columnFixedMap.value.center.width + 'px' })
|
|
269
|
+
}, [
|
|
270
|
+
(virtualData.value.length)
|
|
271
|
+
? (_openBlock(true), _createElementBlock(_Fragment, { key: 0 }, _renderList(virtualData.value, (item, index) => {
|
|
272
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
273
|
+
class: _normalizeClass({
|
|
274
|
+
'jetlinks-edit-table-row': true,
|
|
275
|
+
'jetlinks-edit-table-row-selected': _optionalChain([selectedRowKeys, 'access', _15 => _15.value, 'optionalAccess', _16 => _16.includes, 'call', _17 => _17(item[_ctx.rowKey] || virtualRang.start + index + 1)]),
|
|
276
|
+
'jetlinks-edit-table-row-hover': hoverKeys.value === (item[_ctx.rowKey] || virtualRang.start + index + 1)
|
|
277
|
+
}),
|
|
278
|
+
key: 'center' + index,
|
|
279
|
+
style: _normalizeStyle({ height: `${_ctx.cellHeight}px`, }),
|
|
280
|
+
"data-row-key": item[_ctx.rowKey] || virtualRang.start + index + 1,
|
|
281
|
+
onContextmenu: _withModifiers((e) => showContextMenu(e, item, virtualRang.start + index), ["right"]),
|
|
282
|
+
onClick: _withModifiers(() => rowClick(item), ["stop"]),
|
|
283
|
+
onMouseover: $event => (hoverKeys.value = (item[_ctx.rowKey] || virtualRang.start + index + 1)),
|
|
284
|
+
onMouseleave: _cache[1] || (_cache[1] = $event => (hoverKeys.value = undefined))
|
|
285
|
+
}, [
|
|
286
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(columnFixedMap.value.center.keys, (column) => {
|
|
287
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
288
|
+
class: "jetlinks-edit-table-cell",
|
|
289
|
+
style: _normalizeStyle({
|
|
290
|
+
width: `${column._width}px`,
|
|
291
|
+
})
|
|
292
|
+
}, [
|
|
293
|
+
_createElementVNode("div", _hoisted_5, [
|
|
294
|
+
_renderSlot(_ctx.$slots, column.dataIndex, {
|
|
295
|
+
record: item,
|
|
296
|
+
index: item.__dataIndex,
|
|
297
|
+
column: column
|
|
298
|
+
}, () => [
|
|
299
|
+
_createTextVNode(_toDisplayString(column.dataIndex === '__serial' ? virtualRang.start + index + 1 : item[column.dataIndex]), 1 /* TEXT */)
|
|
300
|
+
])
|
|
301
|
+
])
|
|
302
|
+
], 4 /* STYLE */));
|
|
303
|
+
}), 256 /* UNKEYED_FRAGMENT */))
|
|
304
|
+
], 46 /* CLASS, STYLE, PROPS, NEED_HYDRATION */, _hoisted_4));
|
|
305
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
306
|
+
: _createCommentVNode("v-if", true)
|
|
307
|
+
], 4 /* STYLE */)
|
|
308
|
+
], 4 /* STYLE */),
|
|
309
|
+
(columnFixedMap.value.right.keys.length)
|
|
310
|
+
? (_openBlock(), _createElementBlock("div", {
|
|
311
|
+
key: 1,
|
|
312
|
+
class: "jetlinks-edit-table-right",
|
|
313
|
+
style: _normalizeStyle({
|
|
314
|
+
webkitTransform: `translate3d(0, ${virtualRang.start * props.cellHeight}px, 0)`,
|
|
315
|
+
maxWidth: columnFixedMap.value.right.width + 'px',
|
|
316
|
+
minWidth: columnFixedMap.value.right.width + 'px',
|
|
317
|
+
width: columnFixedMap.value.right.width + 'px',
|
|
318
|
+
boxShadow: _unref(tableTool).scrollMap.down !== 'right' ? '0 0 12px 0 rgba(0 ,0, 0, .2)' : ''
|
|
319
|
+
})
|
|
320
|
+
}, [
|
|
321
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(virtualData.value, (item, index) => {
|
|
322
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
323
|
+
class: _normalizeClass({
|
|
324
|
+
'jetlinks-edit-table-row': true,
|
|
325
|
+
'jetlinks-edit-table-row-selected': _optionalChain([selectedRowKeys, 'access', _18 => _18.value, 'optionalAccess', _19 => _19.includes, 'call', _20 => _20(item[_ctx.rowKey] || virtualRang.start + index + 1)]),
|
|
326
|
+
'jetlinks-edit-table-row-hover': hoverKeys.value === (item[_ctx.rowKey] || virtualRang.start + index + 1)
|
|
327
|
+
}),
|
|
328
|
+
key: 'right' + index,
|
|
329
|
+
style: _normalizeStyle({ height: `${_ctx.cellHeight}px` }),
|
|
330
|
+
"data-row-key": item[_ctx.rowKey] || virtualRang.start + index + 1,
|
|
331
|
+
onContextmenu: _withModifiers((e) => showContextMenu(e, item, virtualRang.start + index), ["right"]),
|
|
332
|
+
onClick: _withModifiers(() => rowClick(item), ["stop"]),
|
|
333
|
+
onMouseover: $event => (hoverKeys.value = (item[_ctx.rowKey] || virtualRang.start + index + 1)),
|
|
334
|
+
onMouseleave: _cache[2] || (_cache[2] = $event => (hoverKeys.value = undefined))
|
|
335
|
+
}, [
|
|
336
|
+
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(columnFixedMap.value.right.keys, (column) => {
|
|
337
|
+
return (_openBlock(), _createElementBlock("div", {
|
|
338
|
+
class: "jetlinks-edit-table-cell",
|
|
339
|
+
style: _normalizeStyle({
|
|
340
|
+
width: `${column._width}px`,
|
|
341
|
+
})
|
|
342
|
+
}, [
|
|
343
|
+
_createElementVNode("div", _hoisted_7, [
|
|
344
|
+
_renderSlot(_ctx.$slots, column.dataIndex, {
|
|
345
|
+
record: item,
|
|
346
|
+
index: item.__dataIndex,
|
|
347
|
+
column: column
|
|
348
|
+
}, () => [
|
|
349
|
+
_createTextVNode(_toDisplayString(column.dataIndex === '__serial' ? virtualRang.start + index + 1 : item[column.dataIndex]), 1 /* TEXT */)
|
|
350
|
+
])
|
|
351
|
+
])
|
|
352
|
+
], 4 /* STYLE */));
|
|
353
|
+
}), 256 /* UNKEYED_FRAGMENT */))
|
|
354
|
+
], 46 /* CLASS, STYLE, PROPS, NEED_HYDRATION */, _hoisted_6));
|
|
355
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
356
|
+
], 4 /* STYLE */))
|
|
357
|
+
: _createCommentVNode("v-if", true)
|
|
358
|
+
])
|
|
359
|
+
], 36 /* STYLE, NEED_HYDRATION */))
|
|
360
|
+
: _renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
|
|
361
|
+
_createElementVNode("div", _hoisted_8, [
|
|
362
|
+
_createVNode(_component_j_empty)
|
|
363
|
+
])
|
|
364
|
+
]);
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
export default __sfc_main__;
|