vue-devui 1.0.0-beta.11 → 1.0.0-beta.15
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 +43 -18
- package/accordion/style.css +1 -1
- package/alert/index.es.js +5 -2
- package/alert/index.umd.js +1 -1
- package/auto-complete/index.d.ts +7 -0
- package/auto-complete/index.es.js +1121 -0
- package/auto-complete/index.umd.js +1 -0
- package/auto-complete/package.json +7 -0
- package/auto-complete/style.css +1 -0
- package/button/index.es.js +116 -113
- package/button/index.umd.js +1 -1
- package/button/style.css +1 -1
- package/carousel/index.es.js +5 -5
- package/carousel/index.umd.js +1 -1
- package/color-picker/index.d.ts +7 -0
- package/color-picker/index.es.js +2960 -0
- package/color-picker/index.umd.js +1 -0
- package/color-picker/package.json +7 -0
- package/color-picker/style.css +1 -0
- package/comment/index.es.js +3 -2
- package/comment/index.umd.js +1 -1
- package/comment/style.css +1 -1
- package/dragdrop/index.es.js +135 -10
- package/dragdrop/index.umd.js +1 -1
- package/drawer/index.es.js +142 -30
- package/drawer/index.umd.js +1 -1
- package/dropdown/index.es.js +30 -22
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/form/index.es.js +59 -17
- package/form/index.umd.js +1 -1
- package/gantt/index.es.js +3 -3
- package/gantt/index.umd.js +1 -1
- package/image-preview/index.es.js +33 -15
- package/image-preview/index.umd.js +1 -1
- package/modal/index.es.js +121 -118
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/nuxt/components/AutoComplete.js +3 -0
- package/nuxt/components/CarouselItem.js +3 -0
- package/nuxt/components/ColorPicker.js +3 -0
- package/nuxt/components/DrawerService.js +3 -0
- package/overlay/index.es.js +1 -1
- package/overlay/index.umd.js +1 -1
- package/package.json +21 -16
- package/popover/index.es.js +13 -4
- package/popover/index.umd.js +1 -1
- package/slider/index.es.js +2 -5
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +145 -14
- package/splitter/index.umd.js +1 -1
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +2 -2
- package/statistic/index.umd.js +1 -1
- package/statistic/style.css +1 -1
- package/style.css +1 -1
- package/table/index.es.js +29 -21
- package/table/index.umd.js +1 -1
- package/table/style.css +1 -1
- package/tag/index.es.js +2 -2
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/time-picker/index.es.js +124 -116
- package/time-picker/index.umd.js +1 -1
- package/time-picker/style.css +1 -1
- package/toast/index.es.js +7 -4
- package/toast/index.umd.js +1 -1
- package/tooltip/index.es.js +69 -115
- package/tooltip/index.umd.js +1 -1
- package/transfer/index.es.js +570 -172
- package/transfer/index.umd.js +1 -1
- package/transfer/style.css +1 -1
- package/tree/index.es.js +6 -5
- package/tree/index.umd.js +1 -1
- package/tree-select/index.es.js +129 -34
- package/tree-select/index.umd.js +1 -1
- package/tree-select/style.css +1 -1
- package/upload/index.es.js +8 -5
- package/upload/index.umd.js +1 -1
- package/vue-devui.es.js +15782 -13138
- package/vue-devui.umd.js +14 -14
package/transfer/index.es.js
CHANGED
|
@@ -17,8 +17,42 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
var __publicField = (obj, key, value) => {
|
|
21
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
import { computed, defineComponent, inject, createVNode, mergeProps, toRef, provide, ref, watch, withDirectives, resolveDirective, resolveComponent, reactive, onMounted, onBeforeUnmount, renderSlot, useSlots, isVNode, onUnmounted, createTextVNode, h, render } from "vue";
|
|
25
|
+
const transferCommon = {
|
|
26
|
+
showTooltip: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: () => false
|
|
29
|
+
},
|
|
30
|
+
tooltipPosition: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: () => "top"
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const transferDragFunctions = {
|
|
36
|
+
onDragstart: {
|
|
37
|
+
type: Function
|
|
38
|
+
},
|
|
39
|
+
onDrop: {
|
|
40
|
+
type: Function
|
|
41
|
+
},
|
|
42
|
+
onDragleave: {
|
|
43
|
+
type: Function
|
|
44
|
+
},
|
|
45
|
+
onDragover: {
|
|
46
|
+
type: Function
|
|
47
|
+
},
|
|
48
|
+
onDragenter: {
|
|
49
|
+
type: Function
|
|
50
|
+
},
|
|
51
|
+
onDragend: {
|
|
52
|
+
type: Function
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const transferBaseProps = __spreadProps(__spreadValues(__spreadValues({}, transferCommon), transferDragFunctions), {
|
|
22
56
|
sourceOption: {
|
|
23
57
|
type: Array,
|
|
24
58
|
default() {
|
|
@@ -71,13 +105,13 @@ const transferBaseProps = {
|
|
|
71
105
|
type: Number,
|
|
72
106
|
default: () => 0
|
|
73
107
|
},
|
|
74
|
-
|
|
108
|
+
isSourceDroppable: {
|
|
75
109
|
type: Boolean,
|
|
76
110
|
default: () => false
|
|
77
111
|
},
|
|
78
|
-
|
|
79
|
-
type:
|
|
80
|
-
default: () =>
|
|
112
|
+
isTargetDroppable: {
|
|
113
|
+
type: Boolean,
|
|
114
|
+
default: () => false
|
|
81
115
|
},
|
|
82
116
|
scopedSlots: {
|
|
83
117
|
type: Object
|
|
@@ -90,8 +124,11 @@ const transferBaseProps = {
|
|
|
90
124
|
},
|
|
91
125
|
onUpdateCheckeds: {
|
|
92
126
|
type: Function
|
|
127
|
+
},
|
|
128
|
+
onDragend: {
|
|
129
|
+
type: Function
|
|
93
130
|
}
|
|
94
|
-
};
|
|
131
|
+
});
|
|
95
132
|
const getFilterData = (props, type) => {
|
|
96
133
|
const newModel = [];
|
|
97
134
|
const data = type === "source" ? props.sourceOption : props.targetOption;
|
|
@@ -994,6 +1031,15 @@ var DSearch = defineComponent({
|
|
|
994
1031
|
};
|
|
995
1032
|
}
|
|
996
1033
|
});
|
|
1034
|
+
const transferDragProps = __spreadProps(__spreadValues(__spreadValues({}, transferCommon), transferDragFunctions), {
|
|
1035
|
+
itemData: {
|
|
1036
|
+
type: Object
|
|
1037
|
+
},
|
|
1038
|
+
id: {
|
|
1039
|
+
type: Number,
|
|
1040
|
+
default: () => null
|
|
1041
|
+
}
|
|
1042
|
+
});
|
|
997
1043
|
const tooltipProps = {
|
|
998
1044
|
position: {
|
|
999
1045
|
type: String,
|
|
@@ -1015,140 +1061,247 @@ const tooltipProps = {
|
|
|
1015
1061
|
default: "100"
|
|
1016
1062
|
}
|
|
1017
1063
|
};
|
|
1018
|
-
const EventListener = {
|
|
1019
|
-
listen: function(target, eventType, callback) {
|
|
1020
|
-
if (target.addEventListener) {
|
|
1021
|
-
target.addEventListener(eventType, callback, false);
|
|
1022
|
-
return {
|
|
1023
|
-
remove() {
|
|
1024
|
-
target.removeEventListener(target, callback, false);
|
|
1025
|
-
}
|
|
1026
|
-
};
|
|
1027
|
-
} else {
|
|
1028
|
-
target.attchEvent(eventType, callback);
|
|
1029
|
-
return {
|
|
1030
|
-
remove() {
|
|
1031
|
-
target.detachEvent(eventType, callback);
|
|
1032
|
-
}
|
|
1033
|
-
};
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
};
|
|
1037
1064
|
var tooltip = "";
|
|
1038
1065
|
var DTooltip = defineComponent({
|
|
1039
1066
|
name: "DTooltip",
|
|
1040
1067
|
props: tooltipProps,
|
|
1041
|
-
setup(props
|
|
1068
|
+
setup(props) {
|
|
1042
1069
|
const position = reactive({
|
|
1043
1070
|
left: 0,
|
|
1044
1071
|
top: 0
|
|
1045
1072
|
});
|
|
1046
|
-
const show = ref(false);
|
|
1047
|
-
const slotElement = ref(null);
|
|
1048
|
-
const tooltip2 = ref(null);
|
|
1049
|
-
const arrow = ref(null);
|
|
1050
|
-
const tooltipcontent = ref(null);
|
|
1051
|
-
let enterEvent;
|
|
1052
|
-
let leaveEvent;
|
|
1053
1073
|
const arrowStyle = (attr, value) => {
|
|
1054
|
-
arrow.
|
|
1055
|
-
};
|
|
1056
|
-
const delayShowTrue = function(fn, delay = props.mouseEnterDelay) {
|
|
1057
|
-
let start;
|
|
1058
|
-
if (parseInt(delay) >= 0) {
|
|
1059
|
-
return function() {
|
|
1060
|
-
if (start) {
|
|
1061
|
-
clearTimeout(start);
|
|
1062
|
-
}
|
|
1063
|
-
start = setTimeout(fn, parseInt(delay));
|
|
1064
|
-
};
|
|
1065
|
-
} else {
|
|
1066
|
-
console.error("the value of delay is bigger than 0 and the type of delay must be string!");
|
|
1067
|
-
return;
|
|
1068
|
-
}
|
|
1074
|
+
document.getElementById("devui-arrow").style[attr] = value;
|
|
1069
1075
|
};
|
|
1076
|
+
const slotElement = ref(null);
|
|
1070
1077
|
onMounted(() => {
|
|
1071
|
-
|
|
1072
|
-
tooltip2
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1078
|
+
slotElement.value.children[0].onmouseenter = function() {
|
|
1079
|
+
const tooltip2 = document.createElement("div");
|
|
1080
|
+
const arrow = document.createElement("div");
|
|
1081
|
+
const tooltipcontent = document.createElement("div");
|
|
1082
|
+
tooltip2.classList.add("tooltip");
|
|
1083
|
+
arrow.classList.add("arrow");
|
|
1084
|
+
tooltipcontent.classList.add("tooltipcontent");
|
|
1085
|
+
arrow.id = "devui-arrow";
|
|
1086
|
+
tooltip2.id = "devui-tooltip1";
|
|
1087
|
+
setTimeout(() => {
|
|
1088
|
+
document.getElementById("devui-tooltip").appendChild(tooltip2);
|
|
1089
|
+
tooltip2.appendChild(arrow);
|
|
1090
|
+
tooltip2.appendChild(tooltipcontent);
|
|
1091
|
+
tooltipcontent.innerHTML = props.content;
|
|
1092
|
+
tooltip2.style.opacity = "1";
|
|
1093
|
+
tooltip2.style.zIndex = "999";
|
|
1094
|
+
arrow.style.border = "5px solid transparent";
|
|
1095
|
+
switch (props.position) {
|
|
1096
|
+
case "top":
|
|
1097
|
+
position.left = slotElement.value.children[0].offsetLeft - tooltip2.offsetWidth / 2 + slotElement.value.children[0].offsetWidth / 2 - 5;
|
|
1098
|
+
position.top = slotElement.value.children[0].offsetTop - 10 - tooltipcontent.offsetHeight;
|
|
1099
|
+
arrow.style.top = `${tooltipcontent.offsetHeight}px`;
|
|
1100
|
+
arrow.style.left = `${tooltipcontent.offsetWidth / 2 + 5}px`;
|
|
1101
|
+
arrow.style.borderTop = "5px solid rgb(70, 77, 110)";
|
|
1102
|
+
break;
|
|
1103
|
+
case "bottom":
|
|
1104
|
+
position.top = slotElement.value.children[0].offsetHeight + slotElement.value.children[0].offsetTop + 10;
|
|
1105
|
+
position.left = slotElement.value.children[0].offsetLeft + slotElement.value.children[0].offsetWidth / 2 - tooltipcontent.offsetWidth / 2 - 5;
|
|
1106
|
+
arrowStyle("borderBottom", "5px solid rgb(70, 77, 110)");
|
|
1107
|
+
arrow.style.top = "-10px";
|
|
1108
|
+
arrow.style.left = `${tooltipcontent.offsetWidth / 2 + 5}px`;
|
|
1109
|
+
arrow.style.borderBottom = "5px solid rgb(70, 77, 110)";
|
|
1110
|
+
break;
|
|
1111
|
+
case "left":
|
|
1112
|
+
position.top = slotElement.value.children[0].offsetTop + slotElement.value.children[0].offsetHeight / 2 - tooltipcontent.offsetHeight / 2;
|
|
1113
|
+
position.left = slotElement.value.children[0].offsetLeft - 20 - tooltipcontent.offsetWidth;
|
|
1114
|
+
arrowStyle("borderLeft", "5px solid rgb(70, 77, 110)");
|
|
1115
|
+
arrow.style.left = `${tooltipcontent.offsetWidth + 10}px`;
|
|
1116
|
+
arrow.style.top = `${tooltipcontent.offsetHeight / 2 - 5}px`;
|
|
1117
|
+
arrow.style.borderLeft = "5px solid rgb(70, 77, 110)";
|
|
1118
|
+
break;
|
|
1119
|
+
case "right":
|
|
1120
|
+
position.left = slotElement.value.children[0].offsetLeft + slotElement.value.children[0].offsetWidth;
|
|
1121
|
+
position.top = slotElement.value.children[0].offsetTop + slotElement.value.children[0].offsetHeight / 2 - tooltipcontent.offsetHeight / 2;
|
|
1122
|
+
arrowStyle("borderRight", "5px solid rgb(70, 77, 110)");
|
|
1123
|
+
arrow.style.top = `${tooltipcontent.offsetHeight / 2 - 5}px`;
|
|
1124
|
+
arrow.style.left = "-0px";
|
|
1125
|
+
arrow.style.borderRight = "5px solid rgb(70, 77, 110)";
|
|
1126
|
+
break;
|
|
1127
|
+
}
|
|
1128
|
+
tooltip2.style.top = position.top + 5 + "px";
|
|
1129
|
+
tooltip2.style.left = position.left + "px";
|
|
1130
|
+
}, props.mouseEnterDelay);
|
|
1131
|
+
};
|
|
1132
|
+
slotElement.value.children[0].onmouseleave = function() {
|
|
1133
|
+
setTimeout(() => {
|
|
1134
|
+
document.getElementById("devui-tooltip1").removeChild(document.getElementById("devui-arrow"));
|
|
1135
|
+
document.getElementById("devui-tooltip").removeChild(document.getElementById("devui-tooltip1"));
|
|
1136
|
+
}, props.mouseLeaveDelay);
|
|
1137
|
+
};
|
|
1130
1138
|
});
|
|
1131
1139
|
onBeforeUnmount(() => {
|
|
1132
|
-
|
|
1133
|
-
|
|
1140
|
+
slotElement.value.children[0].onmouseenter = null;
|
|
1141
|
+
slotElement.value.children[0].onmouseleave = null;
|
|
1134
1142
|
});
|
|
1135
1143
|
return () => {
|
|
1136
1144
|
const defaultSlot = renderSlot(useSlots(), "default");
|
|
1137
1145
|
return createVNode("div", {
|
|
1138
|
-
"class": "devui-tooltip"
|
|
1146
|
+
"class": "devui-tooltip",
|
|
1147
|
+
"id": "devui-tooltip"
|
|
1139
1148
|
}, [createVNode("div", {
|
|
1140
1149
|
"class": "slotElement",
|
|
1141
1150
|
"ref": slotElement
|
|
1142
|
-
}, [defaultSlot])
|
|
1143
|
-
|
|
1144
|
-
|
|
1151
|
+
}, [defaultSlot])]);
|
|
1152
|
+
};
|
|
1153
|
+
}
|
|
1154
|
+
});
|
|
1155
|
+
const transferCheckboxProps = __spreadProps(__spreadValues({}, transferCommon), {
|
|
1156
|
+
data: {
|
|
1157
|
+
type: Object
|
|
1158
|
+
},
|
|
1159
|
+
id: {
|
|
1160
|
+
type: Number
|
|
1161
|
+
}
|
|
1162
|
+
});
|
|
1163
|
+
function _isSlot$1(s) {
|
|
1164
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
1165
|
+
}
|
|
1166
|
+
var DTransfeCheckbox = defineComponent({
|
|
1167
|
+
name: "DTransferCheckbox",
|
|
1168
|
+
components: {
|
|
1169
|
+
DCheckbox,
|
|
1170
|
+
DTooltip
|
|
1171
|
+
},
|
|
1172
|
+
props: transferCheckboxProps,
|
|
1173
|
+
setup(props) {
|
|
1174
|
+
const renderCheckbox = () => {
|
|
1175
|
+
return createVNode(DCheckbox, {
|
|
1176
|
+
"label": props.data.key,
|
|
1177
|
+
"value": props.data.value,
|
|
1178
|
+
"disabled": props.data.disabled,
|
|
1179
|
+
"class": "devui-transfer-panel-body-list-item",
|
|
1180
|
+
"key": props.id
|
|
1181
|
+
}, null);
|
|
1182
|
+
};
|
|
1183
|
+
return () => {
|
|
1184
|
+
let _slot;
|
|
1185
|
+
return !props.showTooltip ? renderCheckbox() : createVNode(DTooltip, {
|
|
1186
|
+
"class": "devui-transfer-panel-body-list-tooltip",
|
|
1187
|
+
"position": props.tooltipPosition,
|
|
1188
|
+
"content": props.data.key
|
|
1189
|
+
}, _isSlot$1(_slot = renderCheckbox()) ? _slot : {
|
|
1190
|
+
default: () => [_slot]
|
|
1191
|
+
});
|
|
1192
|
+
};
|
|
1193
|
+
}
|
|
1194
|
+
});
|
|
1195
|
+
var devuiIcon = "";
|
|
1196
|
+
var DTransferDrag = defineComponent({
|
|
1197
|
+
name: "DTransferDrag",
|
|
1198
|
+
components: {
|
|
1199
|
+
DTransfeCheckbox
|
|
1200
|
+
},
|
|
1201
|
+
props: transferDragProps,
|
|
1202
|
+
setup(props) {
|
|
1203
|
+
const dragRef = ref(null);
|
|
1204
|
+
const dragHighlight = ref(false);
|
|
1205
|
+
const dragOverNodeKey = ref("");
|
|
1206
|
+
const dropPosition = ref(null);
|
|
1207
|
+
const dragTimer = ref(null);
|
|
1208
|
+
const calcDropPosition = (event) => {
|
|
1209
|
+
const {
|
|
1210
|
+
clientY
|
|
1211
|
+
} = event;
|
|
1212
|
+
const {
|
|
1213
|
+
top,
|
|
1214
|
+
bottom,
|
|
1215
|
+
height
|
|
1216
|
+
} = dragRef.value.getBoundingClientRect();
|
|
1217
|
+
const des = Math.max(height * 0.25, 2);
|
|
1218
|
+
if (clientY <= top + des) {
|
|
1219
|
+
return -1;
|
|
1220
|
+
}
|
|
1221
|
+
if (clientY >= bottom - des) {
|
|
1222
|
+
return 1;
|
|
1223
|
+
}
|
|
1224
|
+
return 0;
|
|
1225
|
+
};
|
|
1226
|
+
const resetState = () => {
|
|
1227
|
+
dragOverNodeKey.value = "";
|
|
1228
|
+
dropPosition.value = null;
|
|
1229
|
+
dragHighlight.value = null;
|
|
1230
|
+
};
|
|
1231
|
+
onUnmounted(() => {
|
|
1232
|
+
clearTimeout(dragTimer.value);
|
|
1233
|
+
});
|
|
1234
|
+
return () => {
|
|
1235
|
+
const state = dragOverNodeKey.value === props.itemData.key;
|
|
1236
|
+
return createVNode("div", {
|
|
1237
|
+
"class": {
|
|
1238
|
+
"devui-transfer-panel-body-list-item": true,
|
|
1239
|
+
"devui-transfer-drag-dragging": dragHighlight.value,
|
|
1240
|
+
"devui-transfer-drag-over": state && dropPosition.value === 0,
|
|
1241
|
+
"devui-transfer\u2013drag-over-top": state && dropPosition.value === -1,
|
|
1242
|
+
"devui-transfer\u2013drag-over-bottom": state && dropPosition.value === 1
|
|
1243
|
+
},
|
|
1244
|
+
"onDragenter": (event) => {
|
|
1245
|
+
event.preventDefault();
|
|
1246
|
+
event.stopPropagation();
|
|
1247
|
+
clearTimeout(dragTimer.value);
|
|
1248
|
+
const curDropPosition = calcDropPosition(event);
|
|
1249
|
+
if (props.itemData.key === dragOverNodeKey.value && curDropPosition === 0) {
|
|
1250
|
+
resetState();
|
|
1251
|
+
return;
|
|
1252
|
+
}
|
|
1253
|
+
dragTimer.value = setTimeout(() => {
|
|
1254
|
+
dragOverNodeKey.value = props.itemData.key;
|
|
1255
|
+
dropPosition.value = curDropPosition;
|
|
1256
|
+
}, 0);
|
|
1257
|
+
props.onDragenter && props.onDragenter(event, props.itemData);
|
|
1258
|
+
},
|
|
1259
|
+
"onDragover": (event) => {
|
|
1260
|
+
event.preventDefault();
|
|
1261
|
+
event.stopPropagation();
|
|
1262
|
+
if (props.itemData.key === dragOverNodeKey.value) {
|
|
1263
|
+
const curDropPosition = calcDropPosition(event);
|
|
1264
|
+
if (curDropPosition === dropPosition.value) {
|
|
1265
|
+
return;
|
|
1266
|
+
}
|
|
1267
|
+
dropPosition.value = curDropPosition;
|
|
1268
|
+
}
|
|
1269
|
+
props.onDragover && props.onDragover(event, props.itemData);
|
|
1270
|
+
},
|
|
1271
|
+
"onDragleave": (event) => {
|
|
1272
|
+
event.stopPropagation();
|
|
1273
|
+
resetState();
|
|
1274
|
+
props.onDragleave && props.onDragleave(event, props.itemData);
|
|
1275
|
+
},
|
|
1276
|
+
"onDrop": (event) => {
|
|
1277
|
+
event.preventDefault();
|
|
1278
|
+
event.stopPropagation();
|
|
1279
|
+
resetState();
|
|
1280
|
+
props.onDrop && props.onDrop(event, props.itemData);
|
|
1281
|
+
},
|
|
1282
|
+
"onDragend": (event) => {
|
|
1283
|
+
event.stopPropagation();
|
|
1284
|
+
props.onDragend && props.onDragend(event, props.itemData);
|
|
1285
|
+
}
|
|
1145
1286
|
}, [createVNode("div", {
|
|
1146
|
-
"class": "
|
|
1147
|
-
"
|
|
1148
|
-
|
|
1149
|
-
"
|
|
1150
|
-
|
|
1151
|
-
|
|
1287
|
+
"class": "devui-transfer-panel-body-list-drag",
|
|
1288
|
+
"draggable": true,
|
|
1289
|
+
"ref": dragRef,
|
|
1290
|
+
"onDragstart": (event) => {
|
|
1291
|
+
event.stopPropagation();
|
|
1292
|
+
dragHighlight.value = true;
|
|
1293
|
+
props.onDragstart && props.onDragstart(event, props.itemData);
|
|
1294
|
+
}
|
|
1295
|
+
}, [createVNode("span", {
|
|
1296
|
+
"class": "devui-transfer-panel-body-list-drag__icon"
|
|
1297
|
+
}, [createVNode(resolveComponent("d-icon"), {
|
|
1298
|
+
"name": "drag-small"
|
|
1299
|
+
}, null)]), createVNode(DTransfeCheckbox, {
|
|
1300
|
+
"data": props.itemData,
|
|
1301
|
+
"id": props.id,
|
|
1302
|
+
"showTooltip": props.showTooltip,
|
|
1303
|
+
"tooltipPosition": props.tooltipPosition
|
|
1304
|
+
}, null)])]);
|
|
1152
1305
|
};
|
|
1153
1306
|
}
|
|
1154
1307
|
});
|
|
@@ -1161,54 +1314,98 @@ var DTransferBase = defineComponent({
|
|
|
1161
1314
|
DSearch,
|
|
1162
1315
|
DCheckboxGroup,
|
|
1163
1316
|
DCheckbox,
|
|
1164
|
-
|
|
1317
|
+
DTransferDrag,
|
|
1318
|
+
DTransfeCheckbox
|
|
1165
1319
|
},
|
|
1166
1320
|
props: transferBaseProps,
|
|
1167
1321
|
setup(props, ctx) {
|
|
1322
|
+
const allHalfchecked = ref(false);
|
|
1168
1323
|
const modelValues = computed(() => props.checkedValues);
|
|
1324
|
+
const dragWrapClass = computed(() => {
|
|
1325
|
+
const isDrag = props.isSourceDroppable || props.isTargetDroppable;
|
|
1326
|
+
return `devui-transfer-panel-body-list devui-transfer-panel-body-${isDrag ? "" : "no"}drag`;
|
|
1327
|
+
});
|
|
1169
1328
|
const searchQuery = computed(() => props.filter);
|
|
1170
1329
|
const baseClass = TransferBaseClass(props);
|
|
1330
|
+
const dropItem = ref(null);
|
|
1331
|
+
watch(() => props.checkedNum, (nVal) => {
|
|
1332
|
+
if (props.allChecked) {
|
|
1333
|
+
allHalfchecked.value = !props.allChecked;
|
|
1334
|
+
} else {
|
|
1335
|
+
allHalfchecked.value = nVal !== 0;
|
|
1336
|
+
}
|
|
1337
|
+
}, {
|
|
1338
|
+
immediate: true
|
|
1339
|
+
});
|
|
1171
1340
|
const updateSearchQuery = (val) => ctx.emit("changeQuery", val);
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
"
|
|
1176
|
-
"
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1341
|
+
const renderCheckboxGroup = () => {
|
|
1342
|
+
let _slot;
|
|
1343
|
+
return createVNode(DCheckboxGroup, {
|
|
1344
|
+
"modelValue": modelValues.value,
|
|
1345
|
+
"onChange": (values) => ctx.emit("updateCheckeds", values)
|
|
1346
|
+
}, _isSlot(_slot = props.sourceOption.map((item, idx) => {
|
|
1347
|
+
return createVNode(DTransfeCheckbox, {
|
|
1348
|
+
"data": item,
|
|
1349
|
+
"id": idx,
|
|
1350
|
+
"showTooltip": props.showTooltip,
|
|
1351
|
+
"tooltipPosition": props.tooltipPosition
|
|
1352
|
+
}, null);
|
|
1353
|
+
})) ? _slot : {
|
|
1354
|
+
default: () => [_slot]
|
|
1355
|
+
});
|
|
1356
|
+
};
|
|
1357
|
+
const renderDragCheckboxGroup = () => {
|
|
1358
|
+
let _slot2;
|
|
1359
|
+
return createVNode(DCheckboxGroup, {
|
|
1360
|
+
"modelValue": modelValues.value,
|
|
1361
|
+
"onChange": (values) => ctx.emit("updateCheckeds", values)
|
|
1362
|
+
}, _isSlot(_slot2 = props.sourceOption.map((item, idx) => {
|
|
1363
|
+
return createVNode(DTransferDrag, {
|
|
1364
|
+
"itemData": item,
|
|
1365
|
+
"id": idx,
|
|
1366
|
+
"showTooltip": props.showTooltip,
|
|
1367
|
+
"tooltipPosition": props.tooltipPosition,
|
|
1368
|
+
"onDrop": (event, item2) => {
|
|
1369
|
+
dropItem.value = item2;
|
|
1370
|
+
},
|
|
1371
|
+
"onDragend": (event, dragItem) => {
|
|
1372
|
+
props.onDragend && props.onDragend(dragItem, dropItem.value);
|
|
1373
|
+
}
|
|
1374
|
+
}, null);
|
|
1375
|
+
})) ? _slot2 : {
|
|
1376
|
+
default: () => [_slot2]
|
|
1185
1377
|
});
|
|
1186
1378
|
};
|
|
1187
1379
|
return {
|
|
1188
1380
|
baseClass,
|
|
1189
1381
|
searchQuery,
|
|
1382
|
+
dragWrapClass,
|
|
1190
1383
|
modelValues,
|
|
1384
|
+
dropItem,
|
|
1385
|
+
allHalfchecked,
|
|
1191
1386
|
updateSearchQuery,
|
|
1192
|
-
|
|
1387
|
+
renderCheckboxGroup,
|
|
1388
|
+
renderDragCheckboxGroup
|
|
1193
1389
|
};
|
|
1194
1390
|
},
|
|
1195
1391
|
render() {
|
|
1196
|
-
let _slot;
|
|
1197
1392
|
const {
|
|
1198
1393
|
title,
|
|
1199
1394
|
baseClass,
|
|
1200
1395
|
checkedNum,
|
|
1201
1396
|
allChecked,
|
|
1397
|
+
allHalfchecked,
|
|
1202
1398
|
sourceOption,
|
|
1203
1399
|
allCount,
|
|
1204
1400
|
updateSearchQuery,
|
|
1205
1401
|
search: search2,
|
|
1206
1402
|
searchQuery,
|
|
1207
|
-
|
|
1403
|
+
dragWrapClass,
|
|
1208
1404
|
height,
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1405
|
+
isSourceDroppable,
|
|
1406
|
+
isTargetDroppable,
|
|
1407
|
+
renderCheckboxGroup,
|
|
1408
|
+
renderDragCheckboxGroup
|
|
1212
1409
|
} = this;
|
|
1213
1410
|
return createVNode("div", {
|
|
1214
1411
|
"class": baseClass
|
|
@@ -1217,8 +1414,11 @@ var DTransferBase = defineComponent({
|
|
|
1217
1414
|
}, [createVNode("div", {
|
|
1218
1415
|
"class": "devui-transfer-panel-header-allChecked"
|
|
1219
1416
|
}, [createVNode(DCheckbox, {
|
|
1417
|
+
"halfchecked": allHalfchecked,
|
|
1220
1418
|
"modelValue": allChecked,
|
|
1221
|
-
"onChange": (value) =>
|
|
1419
|
+
"onChange": (value) => {
|
|
1420
|
+
this.$emit("changeAllSource", value);
|
|
1421
|
+
}
|
|
1222
1422
|
}, _isSlot(title) ? title : {
|
|
1223
1423
|
default: () => [title]
|
|
1224
1424
|
})]), createVNode("div", {
|
|
@@ -1231,18 +1431,11 @@ var DTransferBase = defineComponent({
|
|
|
1231
1431
|
"modelValue": searchQuery,
|
|
1232
1432
|
"onUpdate:modelValue": updateSearchQuery
|
|
1233
1433
|
}, null)]), createVNode("div", {
|
|
1234
|
-
"class":
|
|
1434
|
+
"class": dragWrapClass,
|
|
1235
1435
|
"style": {
|
|
1236
1436
|
height
|
|
1237
1437
|
}
|
|
1238
|
-
}, [sourceOption.length ? createVNode(
|
|
1239
|
-
"modelValue": modelValues,
|
|
1240
|
-
"onChange": (values) => this.$emit("updateCheckeds", values)
|
|
1241
|
-
}, _isSlot(_slot = sourceOption.map((item, idx) => {
|
|
1242
|
-
return renderCheckbox(item, idx, showTooltip, tooltipPosition);
|
|
1243
|
-
})) ? _slot : {
|
|
1244
|
-
default: () => [_slot]
|
|
1245
|
-
}) : createVNode("div", {
|
|
1438
|
+
}, [sourceOption.length ? isSourceDroppable || isTargetDroppable ? renderDragCheckboxGroup() : renderCheckboxGroup() : createVNode("div", {
|
|
1246
1439
|
"class": "devui-transfer-panel-body-list-empty"
|
|
1247
1440
|
}, [createTextVNode("\u65E0\u6570\u636E")])])])]);
|
|
1248
1441
|
}
|
|
@@ -1296,12 +1489,208 @@ var Icon = defineComponent({
|
|
|
1296
1489
|
Icon.install = function(app) {
|
|
1297
1490
|
app.component(Icon.name, Icon);
|
|
1298
1491
|
};
|
|
1492
|
+
class View {
|
|
1493
|
+
constructor() {
|
|
1494
|
+
__publicField(this, "top", "50%");
|
|
1495
|
+
__publicField(this, "left", "50%");
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
const componentProps = {
|
|
1499
|
+
message: String,
|
|
1500
|
+
backdrop: Boolean,
|
|
1501
|
+
view: {
|
|
1502
|
+
type: Object,
|
|
1503
|
+
default: () => new View()
|
|
1504
|
+
},
|
|
1505
|
+
zIndex: Number,
|
|
1506
|
+
isFull: {
|
|
1507
|
+
type: Boolean,
|
|
1508
|
+
default: false
|
|
1509
|
+
}
|
|
1510
|
+
};
|
|
1511
|
+
class LoadingProps {
|
|
1512
|
+
constructor() {
|
|
1513
|
+
__publicField(this, "target");
|
|
1514
|
+
__publicField(this, "message");
|
|
1515
|
+
__publicField(this, "loadingTemplateRef");
|
|
1516
|
+
__publicField(this, "backdrop", true);
|
|
1517
|
+
__publicField(this, "positionType", "relative");
|
|
1518
|
+
__publicField(this, "view", new View());
|
|
1519
|
+
__publicField(this, "zIndex");
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
var loading = "";
|
|
1523
|
+
var Loading = defineComponent({
|
|
1524
|
+
name: "DLoading",
|
|
1525
|
+
inheritAttrs: false,
|
|
1526
|
+
props: componentProps,
|
|
1527
|
+
setup(props) {
|
|
1528
|
+
const style = {
|
|
1529
|
+
top: props.view.top,
|
|
1530
|
+
left: props.view.left,
|
|
1531
|
+
zIndex: props.zIndex
|
|
1532
|
+
};
|
|
1533
|
+
if (!props.message) {
|
|
1534
|
+
style.background = "none";
|
|
1535
|
+
}
|
|
1536
|
+
const isShow = ref(false);
|
|
1537
|
+
const open = () => {
|
|
1538
|
+
isShow.value = true;
|
|
1539
|
+
};
|
|
1540
|
+
const close = () => {
|
|
1541
|
+
isShow.value = false;
|
|
1542
|
+
};
|
|
1543
|
+
return {
|
|
1544
|
+
style,
|
|
1545
|
+
isShow,
|
|
1546
|
+
open,
|
|
1547
|
+
close
|
|
1548
|
+
};
|
|
1549
|
+
},
|
|
1550
|
+
render() {
|
|
1551
|
+
var _a;
|
|
1552
|
+
const {
|
|
1553
|
+
isShow,
|
|
1554
|
+
isFull,
|
|
1555
|
+
backdrop,
|
|
1556
|
+
style,
|
|
1557
|
+
message,
|
|
1558
|
+
$slots
|
|
1559
|
+
} = this;
|
|
1560
|
+
return isShow && createVNode("div", {
|
|
1561
|
+
"class": ["devui-loading-contanier", isFull ? "devui-loading--full" : ""]
|
|
1562
|
+
}, [((_a = $slots.default) == null ? void 0 : _a.call($slots)) || createVNode("div", {
|
|
1563
|
+
"class": "devui-loading-wrapper"
|
|
1564
|
+
}, [backdrop ? createVNode("div", {
|
|
1565
|
+
"class": "devui-loading-mask"
|
|
1566
|
+
}, null) : null, createVNode("div", {
|
|
1567
|
+
"style": style,
|
|
1568
|
+
"class": "devui-loading-area"
|
|
1569
|
+
}, [createVNode("div", {
|
|
1570
|
+
"class": "devui-busy-default-spinner"
|
|
1571
|
+
}, [createVNode("div", {
|
|
1572
|
+
"class": "devui-loading-bar1"
|
|
1573
|
+
}, null), createVNode("div", {
|
|
1574
|
+
"class": "devui-loading-bar2"
|
|
1575
|
+
}, null), createVNode("div", {
|
|
1576
|
+
"class": "devui-loading-bar3"
|
|
1577
|
+
}, null), createVNode("div", {
|
|
1578
|
+
"class": "devui-loading-bar4"
|
|
1579
|
+
}, null)]), message ? createVNode("span", {
|
|
1580
|
+
"class": "devui-loading-text"
|
|
1581
|
+
}, [message]) : null])])]);
|
|
1582
|
+
}
|
|
1583
|
+
});
|
|
1584
|
+
const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
|
|
1585
|
+
function createComponent(Component, props, children = null) {
|
|
1586
|
+
const vnode = h(Component, __spreadValues({}, props), children);
|
|
1587
|
+
const container = document.createElement("div");
|
|
1588
|
+
vnode[COMPONENT_CONTAINER_SYMBOL] = container;
|
|
1589
|
+
render(vnode, container);
|
|
1590
|
+
return vnode.component;
|
|
1591
|
+
}
|
|
1592
|
+
function unmountComponent(ComponnetInstance) {
|
|
1593
|
+
render(null, ComponnetInstance == null ? void 0 : ComponnetInstance.vnode[COMPONENT_CONTAINER_SYMBOL]);
|
|
1594
|
+
}
|
|
1595
|
+
const loadingConstructor = defineComponent(Loading);
|
|
1596
|
+
const cacheInstance = new WeakSet();
|
|
1597
|
+
const isEmpty = (val) => {
|
|
1598
|
+
if (!val)
|
|
1599
|
+
return true;
|
|
1600
|
+
if (Array.isArray(val))
|
|
1601
|
+
return val.length === 0;
|
|
1602
|
+
if (val instanceof Set || val instanceof Map)
|
|
1603
|
+
return val.size === 0;
|
|
1604
|
+
if (val instanceof Promise)
|
|
1605
|
+
return false;
|
|
1606
|
+
if (typeof val === "object") {
|
|
1607
|
+
try {
|
|
1608
|
+
return Object.keys(val).length === 0;
|
|
1609
|
+
} catch (e) {
|
|
1610
|
+
return false;
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
return false;
|
|
1614
|
+
};
|
|
1615
|
+
const getType = (vari) => {
|
|
1616
|
+
return Object.prototype.toString.call(vari).slice(8, -1).toLowerCase();
|
|
1617
|
+
};
|
|
1618
|
+
const isPromise = (value) => {
|
|
1619
|
+
const type = getType(value);
|
|
1620
|
+
switch (type) {
|
|
1621
|
+
case "promise":
|
|
1622
|
+
return [value];
|
|
1623
|
+
case "array":
|
|
1624
|
+
if (value.some((val) => getType(val) !== "promise")) {
|
|
1625
|
+
console.error(new TypeError("Binding values should all be of type Promise"));
|
|
1626
|
+
return "error";
|
|
1627
|
+
}
|
|
1628
|
+
return value;
|
|
1629
|
+
default:
|
|
1630
|
+
return false;
|
|
1631
|
+
}
|
|
1632
|
+
};
|
|
1633
|
+
const unmount = (el) => {
|
|
1634
|
+
cacheInstance.delete(el);
|
|
1635
|
+
el.instance.proxy.close();
|
|
1636
|
+
unmountComponent(el.instance);
|
|
1637
|
+
};
|
|
1638
|
+
const toggleLoading = (el, binding) => {
|
|
1639
|
+
if (binding.value) {
|
|
1640
|
+
const vals = isPromise(binding.value);
|
|
1641
|
+
if (vals === "error")
|
|
1642
|
+
return;
|
|
1643
|
+
el.instance.proxy.open();
|
|
1644
|
+
el.appendChild(el.mask);
|
|
1645
|
+
cacheInstance.add(el);
|
|
1646
|
+
if (vals) {
|
|
1647
|
+
Promise.all(vals).catch((err) => {
|
|
1648
|
+
console.error(new Error("Promise handling errors"), err);
|
|
1649
|
+
}).finally(() => {
|
|
1650
|
+
unmount(el);
|
|
1651
|
+
});
|
|
1652
|
+
}
|
|
1653
|
+
} else {
|
|
1654
|
+
unmount(el);
|
|
1655
|
+
}
|
|
1656
|
+
};
|
|
1657
|
+
const removeAttribute = (el) => {
|
|
1658
|
+
el.removeAttribute("zindex");
|
|
1659
|
+
el.removeAttribute("positiontype");
|
|
1660
|
+
el.removeAttribute("backdrop");
|
|
1661
|
+
el.removeAttribute("message");
|
|
1662
|
+
el.removeAttribute("view");
|
|
1663
|
+
el.removeAttribute("loadingtemplateref");
|
|
1664
|
+
};
|
|
1665
|
+
const handleProps = (el, vprops) => {
|
|
1666
|
+
const props = __spreadValues(__spreadValues({}, new LoadingProps()), vprops);
|
|
1667
|
+
const loadingTemplateRef = props.loadingTemplateRef;
|
|
1668
|
+
const loadingInstance = createComponent(loadingConstructor, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
|
|
1669
|
+
el.style.position = props.positionType;
|
|
1670
|
+
el.options = props;
|
|
1671
|
+
el.instance = loadingInstance;
|
|
1672
|
+
el.mask = loadingInstance.proxy.$el;
|
|
1673
|
+
};
|
|
1674
|
+
const loadingDirective = {
|
|
1675
|
+
mounted: function(el, binding, vnode) {
|
|
1676
|
+
handleProps(el, vnode.props);
|
|
1677
|
+
removeAttribute(el);
|
|
1678
|
+
!isEmpty(binding.value) && toggleLoading(el, binding);
|
|
1679
|
+
},
|
|
1680
|
+
updated: function(el, binding, vnode) {
|
|
1681
|
+
if (!isEmpty(binding.value) && cacheInstance.has(el) || isEmpty(binding.value) && !cacheInstance.has(el))
|
|
1682
|
+
return;
|
|
1683
|
+
!cacheInstance.has(el) && handleProps(el, vnode.props);
|
|
1684
|
+
removeAttribute(el);
|
|
1685
|
+
toggleLoading(el, binding);
|
|
1686
|
+
}
|
|
1687
|
+
};
|
|
1299
1688
|
const buttonProps = {
|
|
1300
1689
|
type: {
|
|
1301
1690
|
type: String,
|
|
1302
1691
|
default: "button"
|
|
1303
1692
|
},
|
|
1304
|
-
|
|
1693
|
+
variant: {
|
|
1305
1694
|
type: String,
|
|
1306
1695
|
default: "primary"
|
|
1307
1696
|
},
|
|
@@ -1343,6 +1732,9 @@ const buttonProps = {
|
|
|
1343
1732
|
var button = "";
|
|
1344
1733
|
var DButton = defineComponent({
|
|
1345
1734
|
name: "DButton",
|
|
1735
|
+
directives: {
|
|
1736
|
+
devLoading: loadingDirective
|
|
1737
|
+
},
|
|
1346
1738
|
props: buttonProps,
|
|
1347
1739
|
setup(props, ctx) {
|
|
1348
1740
|
const buttonContent = ref(null);
|
|
@@ -1356,15 +1748,15 @@ var DButton = defineComponent({
|
|
|
1356
1748
|
const hasContent = computed(() => ctx.slots.default);
|
|
1357
1749
|
const btnClass = computed(() => {
|
|
1358
1750
|
const {
|
|
1359
|
-
|
|
1751
|
+
variant,
|
|
1360
1752
|
size,
|
|
1361
1753
|
position,
|
|
1362
1754
|
bordered,
|
|
1363
1755
|
icon
|
|
1364
1756
|
} = props;
|
|
1365
|
-
const origin = `devui-btn devui-btn-${
|
|
1757
|
+
const origin = `devui-btn devui-btn-${variant} devui-btn-${size} devui-btn-${position}`;
|
|
1366
1758
|
const borderedClass = bordered ? "bordered" : "";
|
|
1367
|
-
const btnIcon = !!icon && !hasContent.value &&
|
|
1759
|
+
const btnIcon = !!icon && !hasContent.value && variant !== "primary" ? "d-btn-icon" : "";
|
|
1368
1760
|
const btnIconWrap = !!icon ? "d-btn-icon-wrap" : "";
|
|
1369
1761
|
return `${origin} ${borderedClass} ${btnIcon} ${btnIconWrap}`;
|
|
1370
1762
|
});
|
|
@@ -1388,9 +1780,9 @@ var DButton = defineComponent({
|
|
|
1388
1780
|
showLoading,
|
|
1389
1781
|
width
|
|
1390
1782
|
} = props;
|
|
1391
|
-
return
|
|
1783
|
+
return createVNode("div", mergeProps({
|
|
1392
1784
|
"class": "devui-btn-host"
|
|
1393
|
-
}, ctx.attrs), [createVNode("button", {
|
|
1785
|
+
}, ctx.attrs), [withDirectives(createVNode("button", {
|
|
1394
1786
|
"class": btnClass.value,
|
|
1395
1787
|
"type": type,
|
|
1396
1788
|
"disabled": disabled,
|
|
@@ -1404,7 +1796,7 @@ var DButton = defineComponent({
|
|
|
1404
1796
|
}, null) : null, createVNode("span", {
|
|
1405
1797
|
"class": "button-content",
|
|
1406
1798
|
"ref": buttonContent
|
|
1407
|
-
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])])
|
|
1799
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])]), [[resolveDirective("devLoading"), showLoading]])]);
|
|
1408
1800
|
};
|
|
1409
1801
|
}
|
|
1410
1802
|
});
|
|
@@ -1460,7 +1852,7 @@ var DTransferOperation = defineComponent({
|
|
|
1460
1852
|
};
|
|
1461
1853
|
}
|
|
1462
1854
|
});
|
|
1463
|
-
const transferProps = {
|
|
1855
|
+
const transferProps = __spreadProps(__spreadValues({}, transferCommon), {
|
|
1464
1856
|
sourceOption: {
|
|
1465
1857
|
type: Array,
|
|
1466
1858
|
require: true,
|
|
@@ -1503,14 +1895,6 @@ const transferProps = {
|
|
|
1503
1895
|
type: Boolean,
|
|
1504
1896
|
default: () => false
|
|
1505
1897
|
},
|
|
1506
|
-
showTooltip: {
|
|
1507
|
-
type: Boolean,
|
|
1508
|
-
default: () => false
|
|
1509
|
-
},
|
|
1510
|
-
tooltipPosition: {
|
|
1511
|
-
type: String,
|
|
1512
|
-
default: () => "top"
|
|
1513
|
-
},
|
|
1514
1898
|
beforeTransfer: {
|
|
1515
1899
|
type: Function
|
|
1516
1900
|
},
|
|
@@ -1531,8 +1915,11 @@ const transferProps = {
|
|
|
1531
1915
|
},
|
|
1532
1916
|
afterTransfer: {
|
|
1533
1917
|
type: Function
|
|
1918
|
+
},
|
|
1919
|
+
onDragend: {
|
|
1920
|
+
type: Function
|
|
1534
1921
|
}
|
|
1535
|
-
};
|
|
1922
|
+
});
|
|
1536
1923
|
const headerSlot = (ctx, name) => {
|
|
1537
1924
|
return !ctx.slots[`${name}-header`] ? null : () => ctx.slots[`${name}-header`] && ctx.slots[`${name}-header`]();
|
|
1538
1925
|
};
|
|
@@ -1561,7 +1948,7 @@ var Transfer = defineComponent({
|
|
|
1561
1948
|
watch(() => props.targetOption, () => {
|
|
1562
1949
|
rightOptions = reactive(initState(props, "target"));
|
|
1563
1950
|
});
|
|
1564
|
-
watch(() => leftOptions.keyword, (
|
|
1951
|
+
watch(() => leftOptions.keyword, () => {
|
|
1565
1952
|
searchFilterData(leftOptions);
|
|
1566
1953
|
});
|
|
1567
1954
|
watch(() => leftOptions.checkedValues, (values) => {
|
|
@@ -1570,7 +1957,7 @@ var Transfer = defineComponent({
|
|
|
1570
1957
|
}, {
|
|
1571
1958
|
deep: true
|
|
1572
1959
|
});
|
|
1573
|
-
watch(() => rightOptions.keyword, (
|
|
1960
|
+
watch(() => rightOptions.keyword, () => {
|
|
1574
1961
|
searchFilterData(rightOptions);
|
|
1575
1962
|
});
|
|
1576
1963
|
watch(() => rightOptions.checkedValues, (values) => {
|
|
@@ -1654,6 +2041,13 @@ var Transfer = defineComponent({
|
|
|
1654
2041
|
const isFunction = (type) => {
|
|
1655
2042
|
return props[type] && typeof props[type] === "function";
|
|
1656
2043
|
};
|
|
2044
|
+
const dataSort = (target, dragItem, dropItem, direction) => {
|
|
2045
|
+
const startIndex = target.filterData.findIndex((item) => item.key === dragItem.key);
|
|
2046
|
+
const endIndex = target.filterData.findIndex((item) => item.key === dropItem.key);
|
|
2047
|
+
target.filterData.splice(endIndex, 1, dragItem);
|
|
2048
|
+
target.filterData.splice(startIndex, 1, dropItem);
|
|
2049
|
+
props.onDragend && props.onDragend(direction, dragItem, dropItem);
|
|
2050
|
+
};
|
|
1657
2051
|
return () => {
|
|
1658
2052
|
return createVNode("div", {
|
|
1659
2053
|
"class": "devui-transfer"
|
|
@@ -1670,9 +2064,11 @@ var Transfer = defineComponent({
|
|
|
1670
2064
|
"allCount": leftOptions.data.length,
|
|
1671
2065
|
"showTooltip": props.showTooltip,
|
|
1672
2066
|
"tooltipPosition": props.tooltipPosition,
|
|
2067
|
+
"isSourceDroppable": props.isSourceDroppable,
|
|
1673
2068
|
"onChangeAllSource": (value) => changeAllSource(leftOptions, value),
|
|
1674
2069
|
"onUpdateCheckeds": updateLeftCheckeds,
|
|
1675
|
-
"onChangeQuery": (value) => changeQueryHandle(leftOptions, "left", value)
|
|
2070
|
+
"onChangeQuery": (value) => changeQueryHandle(leftOptions, "left", value),
|
|
2071
|
+
"onDragend": (dragItem, dropItem) => dataSort(leftOptions, dragItem, dropItem, "left")
|
|
1676
2072
|
}, {
|
|
1677
2073
|
header: headerSlot(ctx, "left"),
|
|
1678
2074
|
body: bodySlot(ctx, "left")
|
|
@@ -1701,9 +2097,11 @@ var Transfer = defineComponent({
|
|
|
1701
2097
|
"allCount": rightOptions.data.length,
|
|
1702
2098
|
"showTooltip": props.showTooltip,
|
|
1703
2099
|
"tooltipPosition": props.tooltipPosition,
|
|
2100
|
+
"isTargetDroppable": props.isTargetDroppable,
|
|
1704
2101
|
"onChangeAllSource": (value) => changeAllSource(rightOptions, value),
|
|
1705
2102
|
"onUpdateCheckeds": updateRightCheckeds,
|
|
1706
|
-
"onChangeQuery": (value) => changeQueryHandle(rightOptions, "right", value)
|
|
2103
|
+
"onChangeQuery": (value) => changeQueryHandle(rightOptions, "right", value),
|
|
2104
|
+
"onDragend": (dragItem, dropItem) => dataSort(rightOptions, dragItem, dropItem, "right")
|
|
1707
2105
|
}, {
|
|
1708
2106
|
header: headerSlot(ctx, "right"),
|
|
1709
2107
|
body: bodySlot(ctx, "right")
|
|
@@ -1717,7 +2115,7 @@ Transfer.install = function(app) {
|
|
|
1717
2115
|
var index = {
|
|
1718
2116
|
title: "Transfer \u7A7F\u68AD\u6846",
|
|
1719
2117
|
category: "\u6570\u636E\u5F55\u5165",
|
|
1720
|
-
status: "
|
|
2118
|
+
status: "40%",
|
|
1721
2119
|
install(app) {
|
|
1722
2120
|
app.use(Transfer);
|
|
1723
2121
|
}
|