vue-devui 1.0.0-beta.4 → 1.0.0-beta.8
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/accordion/index.d.ts +7 -0
- package/accordion/index.es.js +186 -139
- package/accordion/index.umd.js +1 -1
- package/accordion/style.css +1 -1
- package/alert/index.d.ts +7 -0
- package/alert/index.es.js +1 -1
- package/alert/index.umd.js +1 -1
- package/anchor/index.d.ts +7 -0
- package/avatar/index.d.ts +7 -0
- package/avatar/index.es.js +1 -1
- package/avatar/index.umd.js +1 -1
- package/back-top/index.d.ts +7 -0
- package/back-top/index.es.js +128 -0
- package/back-top/index.umd.js +1 -0
- package/back-top/package.json +7 -0
- package/back-top/style.css +1 -0
- package/badge/index.d.ts +7 -0
- package/badge/index.es.js +1 -1
- package/badge/index.umd.js +1 -1
- package/breadcrumb/index.d.ts +7 -0
- package/button/index.d.ts +7 -0
- package/button/index.es.js +4 -4
- package/button/index.umd.js +1 -1
- package/card/index.d.ts +7 -0
- package/card/index.es.js +1 -1
- package/card/index.umd.js +1 -1
- package/carousel/index.d.ts +7 -0
- package/carousel/index.es.js +3 -3
- package/carousel/index.umd.js +1 -1
- package/cascader/index.d.ts +7 -0
- package/cascader/index.es.js +1239 -83
- package/cascader/index.umd.js +1 -1
- package/cascader/style.css +1 -1
- package/checkbox/index.d.ts +7 -0
- package/checkbox/index.es.js +1 -1
- package/checkbox/index.umd.js +1 -1
- package/comment/index.d.ts +7 -0
- package/comment/index.es.js +57 -0
- package/comment/index.umd.js +1 -0
- package/comment/package.json +7 -0
- package/comment/style.css +1 -0
- package/countdown/index.d.ts +7 -0
- package/countdown/index.es.js +167 -0
- package/countdown/index.umd.js +1 -0
- package/countdown/package.json +7 -0
- package/countdown/style.css +1 -0
- package/date-picker/index.d.ts +7 -0
- package/date-picker/index.es.js +15 -15
- package/date-picker/index.umd.js +1 -1
- package/dragdrop/index.d.ts +7 -0
- package/drawer/index.d.ts +7 -0
- package/drawer/index.es.js +33 -9
- package/drawer/index.umd.js +1 -1
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +61 -61
- package/dropdown/index.umd.js +1 -1
- package/editable-select/index.d.ts +7 -0
- package/editable-select/index.es.js +53 -26
- package/editable-select/index.umd.js +9 -9
- package/form/index.d.ts +7 -0
- package/form/index.es.js +175 -80
- package/form/index.umd.js +1 -1
- package/form/style.css +1 -1
- package/fullscreen/index.d.ts +7 -0
- package/fullscreen/index.es.js +1 -1
- package/fullscreen/index.umd.js +1 -1
- package/gantt/index.d.ts +7 -0
- package/grid/index.d.ts +7 -0
- package/grid/index.es.js +2 -2
- package/grid/index.umd.js +1 -1
- package/icon/index.d.ts +7 -0
- package/icon/index.es.js +4 -4
- package/icon/index.umd.js +1 -1
- package/image-preview/index.d.ts +7 -0
- package/image-preview/index.es.js +23 -2
- package/image-preview/index.umd.js +1 -1
- package/index.d.ts +7 -0
- package/input/index.d.ts +7 -0
- package/input/index.es.js +12 -12
- package/input/index.umd.js +1 -1
- package/input-icon/index.d.ts +7 -0
- package/input-icon/index.es.js +331 -0
- package/input-icon/index.umd.js +1 -0
- package/input-icon/package.json +7 -0
- package/input-icon/style.css +1 -0
- package/input-number/index.d.ts +7 -0
- package/input-number/index.es.js +3 -3
- package/input-number/index.umd.js +1 -1
- package/layout/index.d.ts +7 -0
- package/layout/index.es.js +1 -1
- package/layout/index.umd.js +1 -1
- package/loading/index.d.ts +7 -0
- package/loading/index.es.js +1 -1
- package/loading/index.umd.js +1 -1
- package/modal/index.d.ts +7 -0
- package/modal/index.es.js +58 -57
- package/modal/index.umd.js +1 -1
- package/nav-sprite/index.d.ts +7 -0
- package/overlay/index.d.ts +7 -0
- package/overlay/index.es.js +56 -55
- package/overlay/index.umd.js +1 -1
- package/package.json +2 -31
- package/pagination/index.d.ts +7 -0
- package/pagination/index.es.js +3 -3
- package/pagination/index.umd.js +1 -1
- package/panel/index.d.ts +7 -0
- package/popover/index.d.ts +7 -0
- package/popover/index.es.js +1 -1
- package/popover/index.umd.js +1 -1
- package/progress/index.d.ts +7 -0
- package/progress/index.es.js +1 -1
- package/progress/index.umd.js +2 -2
- package/quadrant-diagram/index.d.ts +7 -0
- package/radio/index.d.ts +7 -0
- package/radio/index.es.js +1 -1
- package/radio/index.umd.js +1 -1
- package/rate/index.d.ts +7 -0
- package/rate/index.es.js +1 -1
- package/rate/index.umd.js +1 -1
- package/read-tip/index.d.ts +7 -0
- package/read-tip/index.es.js +61 -24
- package/read-tip/index.umd.js +1 -1
- package/read-tip/style.css +1 -1
- package/result/index.d.ts +7 -0
- package/result/index.es.js +118 -0
- package/result/index.umd.js +1 -0
- package/result/package.json +7 -0
- package/result/style.css +1 -0
- package/ripple/index.d.ts +7 -0
- package/ripple/index.es.js +5 -2
- package/ripple/index.umd.js +1 -1
- package/search/index.d.ts +7 -0
- package/search/index.es.js +14 -14
- package/search/index.umd.js +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +3 -3
- package/select/index.umd.js +1 -1
- package/skeleton/index.d.ts +7 -0
- package/skeleton/index.es.js +148 -26
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.d.ts +7 -0
- package/slider/index.es.js +1 -1
- package/slider/index.umd.js +1 -1
- package/splitter/index.d.ts +7 -0
- package/splitter/index.es.js +24 -25
- package/splitter/index.umd.js +1 -1
- package/status/index.d.ts +7 -0
- package/status/index.es.js +1 -1
- package/status/index.umd.js +1 -1
- package/steps-guide/index.d.ts +7 -0
- package/steps-guide/index.es.js +97 -74
- package/steps-guide/index.umd.js +1 -1
- package/sticky/index.d.ts +7 -0
- package/style.css +1 -1
- package/switch/index.d.ts +7 -0
- package/switch/index.es.js +1 -1
- package/switch/index.umd.js +1 -1
- package/table/index.d.ts +7 -0
- package/table/index.es.js +1492 -157
- package/table/index.umd.js +1 -1
- package/table/style.css +1 -1
- package/tabs/index.d.ts +7 -0
- package/tabs/index.es.js +1 -0
- package/tabs/index.umd.js +1 -1
- package/tag/index.d.ts +7 -0
- package/tag/index.es.js +94 -12
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/tag-input/index.d.ts +7 -0
- package/tag-input/index.es.js +1 -1
- package/tag-input/index.umd.js +1 -1
- package/textarea/index.d.ts +7 -0
- package/textarea/index.es.js +1 -1
- package/textarea/index.umd.js +1 -1
- package/time-axis/index.d.ts +7 -0
- package/time-axis/index.es.js +240 -21
- package/time-axis/index.umd.js +1 -1
- package/time-axis/style.css +1 -1
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +12 -7
- package/time-picker/index.umd.js +1 -1
- package/time-picker/style.css +1 -1
- package/toast/index.d.ts +7 -0
- package/toast/index.es.js +4 -4
- package/toast/index.umd.js +1 -1
- package/tooltip/index.d.ts +7 -0
- package/transfer/index.d.ts +7 -0
- package/transfer/index.es.js +301 -62
- package/transfer/index.umd.js +1 -1
- package/transfer/style.css +1 -1
- package/tree/index.d.ts +7 -0
- package/tree/index.es.js +160 -31
- package/tree/index.umd.js +1 -1
- package/tree-select/index.d.ts +7 -0
- package/tree-select/index.es.js +435 -110
- package/tree-select/index.umd.js +1 -1
- package/tree-select/style.css +1 -1
- package/upload/index.d.ts +7 -0
- package/upload/index.es.js +4 -4
- package/upload/index.umd.js +1 -1
- package/vue-devui.es.js +14014 -11820
- package/vue-devui.umd.js +19 -19
package/transfer/index.es.js
CHANGED
|
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { computed, defineComponent, inject, createVNode, mergeProps, toRef, provide, ref, watch, withDirectives, resolveDirective, resolveComponent,
|
|
20
|
+
import { computed, defineComponent, inject, createVNode, mergeProps, toRef, provide, ref, watch, withDirectives, resolveDirective, resolveComponent, reactive, onMounted, onBeforeUnmount, renderSlot, useSlots, isVNode, createTextVNode } from "vue";
|
|
21
21
|
const transferBaseProps = {
|
|
22
22
|
sourceOption: {
|
|
23
23
|
type: Array,
|
|
@@ -47,10 +47,14 @@ const transferBaseProps = {
|
|
|
47
47
|
type: Boolean,
|
|
48
48
|
default: () => false
|
|
49
49
|
},
|
|
50
|
-
|
|
50
|
+
filter: {
|
|
51
51
|
type: String,
|
|
52
52
|
default: () => ""
|
|
53
53
|
},
|
|
54
|
+
height: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: () => "320px"
|
|
57
|
+
},
|
|
54
58
|
alltargetState: {
|
|
55
59
|
type: Boolean,
|
|
56
60
|
default: () => false
|
|
@@ -67,6 +71,14 @@ const transferBaseProps = {
|
|
|
67
71
|
type: Number,
|
|
68
72
|
default: () => 0
|
|
69
73
|
},
|
|
74
|
+
showTooltip: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: () => false
|
|
77
|
+
},
|
|
78
|
+
tooltipPosition: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: () => "top"
|
|
81
|
+
},
|
|
70
82
|
scopedSlots: {
|
|
71
83
|
type: Object
|
|
72
84
|
},
|
|
@@ -100,7 +112,7 @@ const initState = (props, type) => {
|
|
|
100
112
|
allChecked: false,
|
|
101
113
|
disabled: false,
|
|
102
114
|
checkedNum: initModel.model.length,
|
|
103
|
-
|
|
115
|
+
keyword: "",
|
|
104
116
|
checkedValues: initModel.model,
|
|
105
117
|
filterData: initModel.data
|
|
106
118
|
};
|
|
@@ -776,27 +788,27 @@ const inputProps = {
|
|
|
776
788
|
type: Boolean,
|
|
777
789
|
default: false
|
|
778
790
|
},
|
|
779
|
-
|
|
791
|
+
modelValue: {
|
|
780
792
|
type: String,
|
|
781
793
|
default: ""
|
|
782
794
|
},
|
|
783
|
-
"
|
|
795
|
+
"update:modelValue": {
|
|
784
796
|
type: Function,
|
|
785
797
|
default: void 0
|
|
786
798
|
},
|
|
787
|
-
|
|
799
|
+
onChange: {
|
|
788
800
|
type: Function,
|
|
789
801
|
default: void 0
|
|
790
802
|
},
|
|
791
|
-
|
|
803
|
+
onKeydown: {
|
|
792
804
|
type: Function,
|
|
793
805
|
default: void 0
|
|
794
806
|
},
|
|
795
|
-
|
|
807
|
+
onFocus: {
|
|
796
808
|
type: Function,
|
|
797
809
|
default: void 0
|
|
798
810
|
},
|
|
799
|
-
|
|
811
|
+
onBlur: {
|
|
800
812
|
type: Function,
|
|
801
813
|
default: void 0
|
|
802
814
|
}
|
|
@@ -820,7 +832,7 @@ var DInput = defineComponent({
|
|
|
820
832
|
}
|
|
821
833
|
},
|
|
822
834
|
props: inputProps,
|
|
823
|
-
emits: ["update:
|
|
835
|
+
emits: ["update:modelValue", "focus", "blur", "change", "keydown"],
|
|
824
836
|
setup(props, ctx) {
|
|
825
837
|
const formItem = inject(formItemInjectionKey, {});
|
|
826
838
|
const hasFormItem = Object.keys(formItem).length > 0;
|
|
@@ -840,11 +852,11 @@ var DInput = defineComponent({
|
|
|
840
852
|
}, {
|
|
841
853
|
immediate: true
|
|
842
854
|
});
|
|
843
|
-
watch(() => props.
|
|
855
|
+
watch(() => props.modelValue, (value) => {
|
|
844
856
|
value && value.length > 0 && showPreviewIcon.value ? showPwdIcon.value = true : showPwdIcon.value = false;
|
|
845
857
|
});
|
|
846
858
|
const onInput = ($event) => {
|
|
847
|
-
ctx.emit("update:
|
|
859
|
+
ctx.emit("update:modelValue", $event.target.value);
|
|
848
860
|
hasFormItem && formItem.formItemMitt.emit(dFormItemEvents.input);
|
|
849
861
|
}, onFocus = () => {
|
|
850
862
|
ctx.emit("focus");
|
|
@@ -874,7 +886,7 @@ var DInput = defineComponent({
|
|
|
874
886
|
},
|
|
875
887
|
render() {
|
|
876
888
|
const {
|
|
877
|
-
|
|
889
|
+
modelValue,
|
|
878
890
|
showPreviewIcon,
|
|
879
891
|
showPwdIcon,
|
|
880
892
|
inputCls,
|
|
@@ -895,7 +907,7 @@ var DInput = defineComponent({
|
|
|
895
907
|
}, [withDirectives(createVNode("input", mergeProps({
|
|
896
908
|
dinput: true
|
|
897
909
|
}, {
|
|
898
|
-
"value":
|
|
910
|
+
"value": modelValue,
|
|
899
911
|
"disabled": disabled,
|
|
900
912
|
"type": inputType,
|
|
901
913
|
"maxlength": maxLength,
|
|
@@ -957,12 +969,12 @@ var DSearch = defineComponent({
|
|
|
957
969
|
"size": props.size,
|
|
958
970
|
"disabled": props.disabled,
|
|
959
971
|
"autoFocus": props.autoFocus,
|
|
960
|
-
"
|
|
972
|
+
"modelValue": keywords.value,
|
|
961
973
|
"maxLength": props.maxLength,
|
|
962
974
|
"placeholder": props.placeholder,
|
|
963
975
|
"cssClass": props.cssClass,
|
|
964
976
|
"onKeydown": onInputKeydown,
|
|
965
|
-
"onUpdate:
|
|
977
|
+
"onUpdate:modelValue": onInputUpdate
|
|
966
978
|
}, null), clearIconShow.value && createVNode("div", {
|
|
967
979
|
"class": "devui-search__clear",
|
|
968
980
|
"onClick": onClearHandle
|
|
@@ -979,6 +991,164 @@ var DSearch = defineComponent({
|
|
|
979
991
|
};
|
|
980
992
|
}
|
|
981
993
|
});
|
|
994
|
+
const tooltipProps = {
|
|
995
|
+
position: {
|
|
996
|
+
type: String,
|
|
997
|
+
default: "top"
|
|
998
|
+
},
|
|
999
|
+
showAnimation: {
|
|
1000
|
+
type: Boolean,
|
|
1001
|
+
default: true
|
|
1002
|
+
},
|
|
1003
|
+
content: {
|
|
1004
|
+
type: String
|
|
1005
|
+
},
|
|
1006
|
+
mouseLeaveDelay: {
|
|
1007
|
+
type: String,
|
|
1008
|
+
default: "150"
|
|
1009
|
+
},
|
|
1010
|
+
mouseEnterDelay: {
|
|
1011
|
+
type: String,
|
|
1012
|
+
default: "100"
|
|
1013
|
+
}
|
|
1014
|
+
};
|
|
1015
|
+
const EventListener = {
|
|
1016
|
+
listen: function(target, eventType, callback) {
|
|
1017
|
+
if (target.addEventListener) {
|
|
1018
|
+
target.addEventListener(eventType, callback, false);
|
|
1019
|
+
return {
|
|
1020
|
+
remove() {
|
|
1021
|
+
target.removeEventListener(target, callback, false);
|
|
1022
|
+
}
|
|
1023
|
+
};
|
|
1024
|
+
} else {
|
|
1025
|
+
target.attchEvent(eventType, callback);
|
|
1026
|
+
return {
|
|
1027
|
+
remove() {
|
|
1028
|
+
target.detachEvent(eventType, callback);
|
|
1029
|
+
}
|
|
1030
|
+
};
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
};
|
|
1034
|
+
var tooltip = "";
|
|
1035
|
+
var DTooltip = defineComponent({
|
|
1036
|
+
name: "DTooltip",
|
|
1037
|
+
props: tooltipProps,
|
|
1038
|
+
setup(props, ctx) {
|
|
1039
|
+
const position = reactive({
|
|
1040
|
+
left: 0,
|
|
1041
|
+
top: 0
|
|
1042
|
+
});
|
|
1043
|
+
const show = ref(false);
|
|
1044
|
+
const slotElement = ref(null);
|
|
1045
|
+
const tooltip2 = ref(null);
|
|
1046
|
+
const arrow = ref(null);
|
|
1047
|
+
const tooltipcontent = ref(null);
|
|
1048
|
+
let enterEvent;
|
|
1049
|
+
let leaveEvent;
|
|
1050
|
+
const arrowStyle = (attr, value) => {
|
|
1051
|
+
arrow.value.style[attr] = value;
|
|
1052
|
+
};
|
|
1053
|
+
const delayShowTrue = function(fn, delay = props.mouseEnterDelay) {
|
|
1054
|
+
let start;
|
|
1055
|
+
if (parseInt(delay) >= 0) {
|
|
1056
|
+
return function() {
|
|
1057
|
+
if (start) {
|
|
1058
|
+
clearTimeout(start);
|
|
1059
|
+
}
|
|
1060
|
+
start = setTimeout(fn, parseInt(delay));
|
|
1061
|
+
};
|
|
1062
|
+
} else {
|
|
1063
|
+
console.error("the value of delay is bigger than 0 and the type of delay must be string!");
|
|
1064
|
+
return;
|
|
1065
|
+
}
|
|
1066
|
+
};
|
|
1067
|
+
onMounted(() => {
|
|
1068
|
+
if (!show.value) {
|
|
1069
|
+
tooltip2.value.style.opacity = "0";
|
|
1070
|
+
}
|
|
1071
|
+
enterEvent = EventListener.listen(slotElement.value.children[0], "mouseenter", delayShowTrue(function() {
|
|
1072
|
+
show.value = true;
|
|
1073
|
+
}, props.mouseEnterDelay));
|
|
1074
|
+
leaveEvent = EventListener.listen(slotElement.value.children[0], "mouseleave", function() {
|
|
1075
|
+
if (show.value) {
|
|
1076
|
+
setTimeout(function() {
|
|
1077
|
+
show.value = false;
|
|
1078
|
+
}, props.mouseLeaveDelay);
|
|
1079
|
+
}
|
|
1080
|
+
});
|
|
1081
|
+
});
|
|
1082
|
+
watch(show, function(newValue, oldValue) {
|
|
1083
|
+
if (newValue) {
|
|
1084
|
+
tooltip2.value.style.opacity = "1";
|
|
1085
|
+
tooltip2.value.style.zIndex = "999";
|
|
1086
|
+
arrow.value.style.border = "5px solid transparent";
|
|
1087
|
+
switch (props.position) {
|
|
1088
|
+
case "top":
|
|
1089
|
+
position.left = slotElement.value.children[0].offsetLeft - tooltip2.value.offsetWidth / 2 + slotElement.value.children[0].offsetWidth / 2 - 5;
|
|
1090
|
+
position.top = slotElement.value.children[0].offsetTop - 10 - tooltipcontent.value.offsetHeight;
|
|
1091
|
+
arrowStyle("borderTop", "5px solid rgb(70, 77, 110)");
|
|
1092
|
+
arrow.value.style.top = `${tooltipcontent.value.offsetHeight}px`;
|
|
1093
|
+
arrow.value.style.left = `${tooltipcontent.value.offsetWidth / 2 + 5}px`;
|
|
1094
|
+
break;
|
|
1095
|
+
case "right":
|
|
1096
|
+
position.left = slotElement.value.children[0].offsetLeft + slotElement.value.children[0].offsetWidth;
|
|
1097
|
+
position.top = slotElement.value.children[0].offsetTop + slotElement.value.children[0].offsetHeight / 2 - tooltipcontent.value.offsetHeight / 2;
|
|
1098
|
+
arrowStyle("borderRight", "5px solid rgb(70, 77, 110)");
|
|
1099
|
+
arrow.value.style.top = `${tooltipcontent.value.offsetHeight / 2 - 5}px`;
|
|
1100
|
+
arrow.value.style.left = "-0px";
|
|
1101
|
+
break;
|
|
1102
|
+
case "bottom":
|
|
1103
|
+
position.top = slotElement.value.children[0].offsetHeight + slotElement.value.children[0].offsetTop + 10;
|
|
1104
|
+
position.left = slotElement.value.children[0].offsetLeft + slotElement.value.children[0].offsetWidth / 2 - tooltipcontent.value.offsetWidth / 2 - 5;
|
|
1105
|
+
arrowStyle("borderBottom", "5px solid rgb(70, 77, 110)");
|
|
1106
|
+
arrow.value.style.top = "-10px";
|
|
1107
|
+
arrow.value.style.left = `${tooltipcontent.value.offsetWidth / 2 + 5}px`;
|
|
1108
|
+
break;
|
|
1109
|
+
case "left":
|
|
1110
|
+
position.top = slotElement.value.children[0].offsetTop + slotElement.value.children[0].offsetHeight / 2 - tooltipcontent.value.offsetHeight / 2;
|
|
1111
|
+
position.left = slotElement.value.children[0].offsetLeft - 20 - tooltipcontent.value.offsetWidth;
|
|
1112
|
+
arrowStyle("borderLeft", "5px solid rgb(70, 77, 110)");
|
|
1113
|
+
arrow.value.style.left = `${tooltipcontent.value.offsetWidth + 10}px`;
|
|
1114
|
+
arrow.value.style.top = `${tooltipcontent.value.offsetHeight / 2 - 5}px`;
|
|
1115
|
+
break;
|
|
1116
|
+
default:
|
|
1117
|
+
console.error("The attribute position value is wrong, the value is one of top\u3001right\u3001left\u3001bottom");
|
|
1118
|
+
break;
|
|
1119
|
+
}
|
|
1120
|
+
tooltip2.value.style.top = position.top + "px";
|
|
1121
|
+
tooltip2.value.style.left = position.left + "px";
|
|
1122
|
+
} else {
|
|
1123
|
+
position.top = 0;
|
|
1124
|
+
position.left = 0;
|
|
1125
|
+
tooltip2.value.style.opacity = "0";
|
|
1126
|
+
}
|
|
1127
|
+
});
|
|
1128
|
+
onBeforeUnmount(() => {
|
|
1129
|
+
enterEvent.remove();
|
|
1130
|
+
leaveEvent.remove();
|
|
1131
|
+
});
|
|
1132
|
+
return () => {
|
|
1133
|
+
const defaultSlot = renderSlot(useSlots(), "default");
|
|
1134
|
+
return createVNode("div", {
|
|
1135
|
+
"class": "devui-tooltip"
|
|
1136
|
+
}, [createVNode("div", {
|
|
1137
|
+
"class": "slotElement",
|
|
1138
|
+
"ref": slotElement
|
|
1139
|
+
}, [defaultSlot]), createVNode("div", {
|
|
1140
|
+
"class": "tooltip",
|
|
1141
|
+
"ref": tooltip2
|
|
1142
|
+
}, [createVNode("div", {
|
|
1143
|
+
"class": "arrow",
|
|
1144
|
+
"ref": arrow
|
|
1145
|
+
}, null), createVNode("div", {
|
|
1146
|
+
"class": "tooltipcontent",
|
|
1147
|
+
"ref": tooltipcontent
|
|
1148
|
+
}, [props.content])])]);
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
});
|
|
982
1152
|
function _isSlot(s) {
|
|
983
1153
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
984
1154
|
}
|
|
@@ -987,19 +1157,36 @@ var DTransferBase = defineComponent({
|
|
|
987
1157
|
components: {
|
|
988
1158
|
DSearch,
|
|
989
1159
|
DCheckboxGroup,
|
|
990
|
-
DCheckbox
|
|
1160
|
+
DCheckbox,
|
|
1161
|
+
DTooltip
|
|
991
1162
|
},
|
|
992
1163
|
props: transferBaseProps,
|
|
993
1164
|
setup(props, ctx) {
|
|
994
1165
|
const modelValues = computed(() => props.checkedValues);
|
|
995
|
-
const searchQuery = computed(() => props.
|
|
1166
|
+
const searchQuery = computed(() => props.filter);
|
|
996
1167
|
const baseClass = TransferBaseClass(props);
|
|
997
1168
|
const updateSearchQuery = (val) => ctx.emit("changeQuery", val);
|
|
1169
|
+
const renderCheckbox = (props2, key, showTooltip = false, tooltipPosition = "top") => {
|
|
1170
|
+
const checkbox2 = createVNode(DCheckbox, {
|
|
1171
|
+
"class": "devui-transfer-panel-body-list-item",
|
|
1172
|
+
"label": props2.key,
|
|
1173
|
+
"value": props2.value,
|
|
1174
|
+
"disabled": props2.disabled,
|
|
1175
|
+
"key": key
|
|
1176
|
+
}, null);
|
|
1177
|
+
return !showTooltip ? checkbox2 : createVNode(DTooltip, {
|
|
1178
|
+
"position": tooltipPosition,
|
|
1179
|
+
"content": props2.key
|
|
1180
|
+
}, _isSlot(checkbox2) ? checkbox2 : {
|
|
1181
|
+
default: () => [checkbox2]
|
|
1182
|
+
});
|
|
1183
|
+
};
|
|
998
1184
|
return {
|
|
999
1185
|
baseClass,
|
|
1000
1186
|
searchQuery,
|
|
1001
1187
|
modelValues,
|
|
1002
|
-
updateSearchQuery
|
|
1188
|
+
updateSearchQuery,
|
|
1189
|
+
renderCheckbox
|
|
1003
1190
|
};
|
|
1004
1191
|
},
|
|
1005
1192
|
render() {
|
|
@@ -1014,7 +1201,11 @@ var DTransferBase = defineComponent({
|
|
|
1014
1201
|
updateSearchQuery,
|
|
1015
1202
|
search: search2,
|
|
1016
1203
|
searchQuery,
|
|
1017
|
-
modelValues
|
|
1204
|
+
modelValues,
|
|
1205
|
+
height,
|
|
1206
|
+
showTooltip,
|
|
1207
|
+
tooltipPosition,
|
|
1208
|
+
renderCheckbox
|
|
1018
1209
|
} = this;
|
|
1019
1210
|
return createVNode("div", {
|
|
1020
1211
|
"class": baseClass
|
|
@@ -1039,19 +1230,13 @@ var DTransferBase = defineComponent({
|
|
|
1039
1230
|
}, null)]), createVNode("div", {
|
|
1040
1231
|
"class": "devui-transfer-panel-body-list",
|
|
1041
1232
|
"style": {
|
|
1042
|
-
height
|
|
1233
|
+
height
|
|
1043
1234
|
}
|
|
1044
1235
|
}, [sourceOption.length ? createVNode(DCheckboxGroup, {
|
|
1045
1236
|
"modelValue": modelValues,
|
|
1046
1237
|
"onChange": (values) => this.$emit("updateCheckeds", values)
|
|
1047
1238
|
}, _isSlot(_slot = sourceOption.map((item, idx) => {
|
|
1048
|
-
return
|
|
1049
|
-
"class": "devui-transfer-panel-body-list-item",
|
|
1050
|
-
"label": item.key,
|
|
1051
|
-
"value": item.value,
|
|
1052
|
-
"disabled": item.disabled,
|
|
1053
|
-
"key": idx
|
|
1054
|
-
}, null);
|
|
1239
|
+
return renderCheckbox(item, idx, showTooltip, tooltipPosition);
|
|
1055
1240
|
})) ? _slot : {
|
|
1056
1241
|
default: () => [_slot]
|
|
1057
1242
|
}) : createVNode("div", {
|
|
@@ -1089,7 +1274,7 @@ var Icon = defineComponent({
|
|
|
1089
1274
|
color,
|
|
1090
1275
|
classPrefix
|
|
1091
1276
|
} = this;
|
|
1092
|
-
return
|
|
1277
|
+
return /^((https?):)?\/\//.test(name) ? createVNode("img", {
|
|
1093
1278
|
"src": name,
|
|
1094
1279
|
"alt": name.split("/")[name.split("/").length - 1],
|
|
1095
1280
|
"style": {
|
|
@@ -1101,7 +1286,7 @@ var Icon = defineComponent({
|
|
|
1101
1286
|
fontSize: size,
|
|
1102
1287
|
color
|
|
1103
1288
|
}
|
|
1104
|
-
}, null)
|
|
1289
|
+
}, null);
|
|
1105
1290
|
}
|
|
1106
1291
|
});
|
|
1107
1292
|
Icon.install = function(app) {
|
|
@@ -1296,30 +1481,52 @@ const transferProps = {
|
|
|
1296
1481
|
},
|
|
1297
1482
|
height: {
|
|
1298
1483
|
type: String,
|
|
1299
|
-
default: "320px"
|
|
1484
|
+
default: () => "320px"
|
|
1300
1485
|
},
|
|
1301
1486
|
isSearch: {
|
|
1302
1487
|
type: Boolean,
|
|
1303
|
-
default: false
|
|
1488
|
+
default: () => false
|
|
1304
1489
|
},
|
|
1305
1490
|
isSourceDroppable: {
|
|
1306
1491
|
type: Boolean,
|
|
1307
|
-
default: false
|
|
1492
|
+
default: () => false
|
|
1308
1493
|
},
|
|
1309
1494
|
isTargetDroppable: {
|
|
1310
1495
|
type: Boolean,
|
|
1311
|
-
default: false
|
|
1496
|
+
default: () => false
|
|
1312
1497
|
},
|
|
1313
1498
|
disabled: {
|
|
1314
1499
|
type: Boolean,
|
|
1315
|
-
default: false
|
|
1500
|
+
default: () => false
|
|
1316
1501
|
},
|
|
1317
|
-
|
|
1502
|
+
showTooltip: {
|
|
1318
1503
|
type: Boolean,
|
|
1319
|
-
default: false
|
|
1504
|
+
default: () => false
|
|
1505
|
+
},
|
|
1506
|
+
tooltipPosition: {
|
|
1507
|
+
type: String,
|
|
1508
|
+
default: () => "top"
|
|
1509
|
+
},
|
|
1510
|
+
beforeTransfer: {
|
|
1511
|
+
type: Function
|
|
1320
1512
|
},
|
|
1321
1513
|
slots: {
|
|
1322
1514
|
type: Object
|
|
1515
|
+
},
|
|
1516
|
+
searching: {
|
|
1517
|
+
type: Function
|
|
1518
|
+
},
|
|
1519
|
+
transferToSource: {
|
|
1520
|
+
type: Function
|
|
1521
|
+
},
|
|
1522
|
+
transferToTarget: {
|
|
1523
|
+
type: Function
|
|
1524
|
+
},
|
|
1525
|
+
transferring: {
|
|
1526
|
+
type: Function
|
|
1527
|
+
},
|
|
1528
|
+
afterTransfer: {
|
|
1529
|
+
type: Function
|
|
1323
1530
|
}
|
|
1324
1531
|
};
|
|
1325
1532
|
const headerSlot = (ctx, name) => {
|
|
@@ -1341,10 +1548,16 @@ var Transfer = defineComponent({
|
|
|
1341
1548
|
},
|
|
1342
1549
|
props: transferProps,
|
|
1343
1550
|
setup(props, ctx) {
|
|
1344
|
-
|
|
1345
|
-
|
|
1551
|
+
let leftOptions = reactive(initState(props, "source"));
|
|
1552
|
+
let rightOptions = reactive(initState(props, "target"));
|
|
1346
1553
|
const origin = ref(null);
|
|
1347
|
-
watch(() =>
|
|
1554
|
+
watch(() => props.sourceOption, () => {
|
|
1555
|
+
leftOptions = reactive(initState(props, "source"));
|
|
1556
|
+
});
|
|
1557
|
+
watch(() => props.targetOption, () => {
|
|
1558
|
+
rightOptions = reactive(initState(props, "target"));
|
|
1559
|
+
});
|
|
1560
|
+
watch(() => leftOptions.keyword, (nVal) => {
|
|
1348
1561
|
searchFilterData(leftOptions);
|
|
1349
1562
|
});
|
|
1350
1563
|
watch(() => leftOptions.checkedValues, (values) => {
|
|
@@ -1353,7 +1566,7 @@ var Transfer = defineComponent({
|
|
|
1353
1566
|
}, {
|
|
1354
1567
|
deep: true
|
|
1355
1568
|
});
|
|
1356
|
-
watch(() => rightOptions.
|
|
1569
|
+
watch(() => rightOptions.keyword, (nVal) => {
|
|
1357
1570
|
searchFilterData(rightOptions);
|
|
1358
1571
|
});
|
|
1359
1572
|
watch(() => rightOptions.checkedValues, (values) => {
|
|
@@ -1369,19 +1582,35 @@ var Transfer = defineComponent({
|
|
|
1369
1582
|
source.allChecked = value.length === source.data.filter((item) => !item.disabled).length ? true : false;
|
|
1370
1583
|
}
|
|
1371
1584
|
};
|
|
1372
|
-
const updateFilterData = (source, target) => {
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
}
|
|
1379
|
-
|
|
1585
|
+
const updateFilterData = async (source, target, direction) => {
|
|
1586
|
+
if (isFunction("beforeTransfer")) {
|
|
1587
|
+
const res = await props.beforeTransfer.call(null, source, target);
|
|
1588
|
+
if (typeof res === "boolean" && res === false) {
|
|
1589
|
+
return;
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
const hasToSource = isFunction("transferToSource");
|
|
1593
|
+
const hasToTarget = isFunction("transferToTarget");
|
|
1594
|
+
const hasTransfering = isFunction("transferring");
|
|
1595
|
+
if (hasToSource || hasToTarget) {
|
|
1596
|
+
direction === "right" && props.transferToSource.call(null, source, target);
|
|
1597
|
+
direction === "left" && props.transferToTarget.call(null, source, target);
|
|
1598
|
+
} else {
|
|
1599
|
+
source.data = source.data.filter((item) => {
|
|
1600
|
+
const hasInclues = source.checkedValues.includes(item.value);
|
|
1601
|
+
hasInclues && target.data.push(item);
|
|
1602
|
+
return !hasInclues;
|
|
1603
|
+
});
|
|
1604
|
+
}
|
|
1605
|
+
if (hasTransfering) {
|
|
1606
|
+
props.transferring.call(null, target);
|
|
1607
|
+
}
|
|
1380
1608
|
source.checkedValues = [];
|
|
1381
1609
|
target.disabled = !target.disabled;
|
|
1382
1610
|
searchFilterData(source, target);
|
|
1383
1611
|
searchFilterData(target, source);
|
|
1384
1612
|
setOrigin("click");
|
|
1613
|
+
isFunction("afterTransfer") && props.afterTransfer.call(null, target);
|
|
1385
1614
|
};
|
|
1386
1615
|
const changeAllSource = (source, value) => {
|
|
1387
1616
|
if (source.filterData.every((item) => item.disabled))
|
|
@@ -1403,7 +1632,7 @@ var Transfer = defineComponent({
|
|
|
1403
1632
|
setOrigin("change");
|
|
1404
1633
|
};
|
|
1405
1634
|
const searchFilterData = (source, target) => {
|
|
1406
|
-
source.filterData = source.data.filter((item) => item.key.indexOf(source.
|
|
1635
|
+
source.filterData = source.data.filter((item) => item.key.indexOf(source.keyword) !== -1);
|
|
1407
1636
|
if (target) {
|
|
1408
1637
|
target.allChecked = false;
|
|
1409
1638
|
}
|
|
@@ -1411,25 +1640,35 @@ var Transfer = defineComponent({
|
|
|
1411
1640
|
const setOrigin = (value) => {
|
|
1412
1641
|
origin.value = value;
|
|
1413
1642
|
};
|
|
1643
|
+
const changeQueryHandle = (source, direction, value) => {
|
|
1644
|
+
if ((props == null ? void 0 : props.searching) && typeof props.searching === "function") {
|
|
1645
|
+
props.searching.call(null, direction, value, source);
|
|
1646
|
+
return;
|
|
1647
|
+
}
|
|
1648
|
+
source.keyword = value;
|
|
1649
|
+
};
|
|
1650
|
+
const isFunction = (type) => {
|
|
1651
|
+
return props[type] && typeof props[type] === "function";
|
|
1652
|
+
};
|
|
1414
1653
|
return () => {
|
|
1415
1654
|
return createVNode("div", {
|
|
1416
1655
|
"class": "devui-transfer"
|
|
1417
1656
|
}, [createVNode(DTransferBase, {
|
|
1418
|
-
"style": {
|
|
1419
|
-
height: props.height
|
|
1420
|
-
},
|
|
1421
1657
|
"sourceOption": leftOptions.filterData,
|
|
1422
1658
|
"title": props.titles[0],
|
|
1423
1659
|
"type": "source",
|
|
1424
1660
|
"search": props.isSearch,
|
|
1425
1661
|
"allChecked": leftOptions.allChecked,
|
|
1426
1662
|
"checkedNum": leftOptions.checkedNum,
|
|
1427
|
-
"
|
|
1663
|
+
"filter": leftOptions.keyword,
|
|
1664
|
+
"height": props.height,
|
|
1428
1665
|
"checkedValues": leftOptions.checkedValues,
|
|
1429
1666
|
"allCount": leftOptions.data.length,
|
|
1667
|
+
"showTooltip": props.showTooltip,
|
|
1668
|
+
"tooltipPosition": props.tooltipPosition,
|
|
1430
1669
|
"onChangeAllSource": (value) => changeAllSource(leftOptions, value),
|
|
1431
1670
|
"onUpdateCheckeds": updateLeftCheckeds,
|
|
1432
|
-
"onChangeQuery": (value) => leftOptions
|
|
1671
|
+
"onChangeQuery": (value) => changeQueryHandle(leftOptions, "left", value)
|
|
1433
1672
|
}, {
|
|
1434
1673
|
header: headerSlot(ctx, "left"),
|
|
1435
1674
|
body: bodySlot(ctx, "left")
|
|
@@ -1438,29 +1677,29 @@ var Transfer = defineComponent({
|
|
|
1438
1677
|
"sourceDisabled": rightOptions.checkedNum > 0 ? false : true,
|
|
1439
1678
|
"targetDisabled": leftOptions.checkedNum > 0 ? false : true,
|
|
1440
1679
|
"onUpdateSourceData": () => {
|
|
1441
|
-
updateFilterData(rightOptions, leftOptions);
|
|
1680
|
+
updateFilterData(rightOptions, leftOptions, "left");
|
|
1442
1681
|
},
|
|
1443
1682
|
"onUpdateTargetData": () => {
|
|
1444
|
-
updateFilterData(leftOptions, rightOptions);
|
|
1683
|
+
updateFilterData(leftOptions, rightOptions, "right");
|
|
1445
1684
|
}
|
|
1446
1685
|
}, {
|
|
1447
1686
|
operation: opeartionSlot(ctx)
|
|
1448
1687
|
}), createVNode(DTransferBase, {
|
|
1449
|
-
"style": {
|
|
1450
|
-
height: props.height
|
|
1451
|
-
},
|
|
1452
1688
|
"sourceOption": rightOptions.filterData,
|
|
1453
1689
|
"title": props.titles[1],
|
|
1454
1690
|
"type": "target",
|
|
1455
1691
|
"search": props.isSearch,
|
|
1456
1692
|
"allChecked": rightOptions.allChecked,
|
|
1457
1693
|
"checkedNum": rightOptions.checkedNum,
|
|
1458
|
-
"
|
|
1694
|
+
"filter": rightOptions.keyword,
|
|
1695
|
+
"height": props.height,
|
|
1459
1696
|
"checkedValues": rightOptions.checkedValues,
|
|
1460
1697
|
"allCount": rightOptions.data.length,
|
|
1698
|
+
"showTooltip": props.showTooltip,
|
|
1699
|
+
"tooltipPosition": props.tooltipPosition,
|
|
1461
1700
|
"onChangeAllSource": (value) => changeAllSource(rightOptions, value),
|
|
1462
1701
|
"onUpdateCheckeds": updateRightCheckeds,
|
|
1463
|
-
"onChangeQuery": (value) => rightOptions
|
|
1702
|
+
"onChangeQuery": (value) => changeQueryHandle(rightOptions, "right", value)
|
|
1464
1703
|
}, {
|
|
1465
1704
|
header: headerSlot(ctx, "right"),
|
|
1466
1705
|
body: bodySlot(ctx, "right")
|