vue-devui 1.0.0-beta.5 → 1.0.0-beta.9
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 +61 -5
- package/back-top/index.umd.js +1 -1
- package/back-top/style.css +1 -1
- 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 +7 -5
- package/dropdown/index.umd.js +1 -1
- package/editable-select/index.d.ts +7 -0
- package/editable-select/index.es.js +166 -104
- package/editable-select/index.umd.js +16 -16
- package/editable-select/style.css +1 -1
- package/form/index.d.ts +7 -0
- package/form/index.es.js +23 -8
- 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 +14 -4
- 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 +51 -11
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +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 +9 -7
- 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 +6 -4
- 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 +74 -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 +23 -20
- 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/statistic/index.d.ts +7 -0
- package/statistic/index.es.js +280 -0
- package/statistic/index.umd.js +1 -0
- package/statistic/package.json +7 -0
- package/statistic/style.css +1 -0
- package/status/index.d.ts +7 -0
- package/status/index.es.js +2 -2
- package/status/index.umd.js +1 -1
- package/steps-guide/index.d.ts +7 -0
- package/steps-guide/index.es.js +100 -75
- 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/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 +6 -4
- package/time-axis/index.umd.js +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 +310 -68
- 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 +14125 -11791
- package/vue-devui.umd.js +18 -18
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
|
};
|
|
@@ -497,7 +509,7 @@ const searchProps = {
|
|
|
497
509
|
type: String,
|
|
498
510
|
default: ""
|
|
499
511
|
},
|
|
500
|
-
|
|
512
|
+
onSearch: {
|
|
501
513
|
type: Function,
|
|
502
514
|
default: void 0
|
|
503
515
|
},
|
|
@@ -735,7 +747,7 @@ const keydownHandles = (ctx, keywords, delay) => {
|
|
|
735
747
|
useEmitKeyword(keywords.value);
|
|
736
748
|
};
|
|
737
749
|
const useEmitKeyword = debounce((value) => {
|
|
738
|
-
ctx.emit("
|
|
750
|
+
ctx.emit("onSearch", value);
|
|
739
751
|
}, delay);
|
|
740
752
|
return {
|
|
741
753
|
onInputKeydown,
|
|
@@ -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,
|
|
@@ -924,7 +936,7 @@ var search = "";
|
|
|
924
936
|
var DSearch = defineComponent({
|
|
925
937
|
name: "DSearch",
|
|
926
938
|
props: searchProps,
|
|
927
|
-
emits: ["update:modelValue", "
|
|
939
|
+
emits: ["update:modelValue", "onSearch"],
|
|
928
940
|
setup(props, ctx) {
|
|
929
941
|
const rootClasses = getRootClass(props);
|
|
930
942
|
const {
|
|
@@ -952,33 +964,194 @@ var DSearch = defineComponent({
|
|
|
952
964
|
"onClick": onClickHandle
|
|
953
965
|
}, [createVNode(resolveComponent("d-icon"), {
|
|
954
966
|
"name": "search",
|
|
955
|
-
"size": "inherit"
|
|
967
|
+
"size": "inherit",
|
|
968
|
+
"key": "search"
|
|
956
969
|
}, null)]), createVNode(DInput, {
|
|
957
970
|
"size": props.size,
|
|
958
971
|
"disabled": props.disabled,
|
|
959
972
|
"autoFocus": props.autoFocus,
|
|
960
|
-
"
|
|
973
|
+
"modelValue": keywords.value,
|
|
961
974
|
"maxLength": props.maxLength,
|
|
962
975
|
"placeholder": props.placeholder,
|
|
963
976
|
"cssClass": props.cssClass,
|
|
964
977
|
"onKeydown": onInputKeydown,
|
|
965
|
-
"onUpdate:
|
|
978
|
+
"onUpdate:modelValue": onInputUpdate
|
|
966
979
|
}, null), clearIconShow.value && createVNode("div", {
|
|
967
980
|
"class": "devui-search__clear",
|
|
968
981
|
"onClick": onClearHandle
|
|
969
982
|
}, [createVNode(resolveComponent("d-icon"), {
|
|
970
983
|
"name": "close",
|
|
971
|
-
"size": "inherit"
|
|
984
|
+
"size": "inherit",
|
|
985
|
+
"key": "close"
|
|
972
986
|
}, null)]), props.iconPosition === "right" && createVNode("div", {
|
|
973
987
|
"class": "devui-search__icon",
|
|
974
988
|
"onClick": onClickHandle
|
|
975
989
|
}, [createVNode(resolveComponent("d-icon"), {
|
|
976
990
|
"name": "search",
|
|
977
|
-
"size": "inherit"
|
|
991
|
+
"size": "inherit",
|
|
992
|
+
"key": "search"
|
|
978
993
|
}, null)])]);
|
|
979
994
|
};
|
|
980
995
|
}
|
|
981
996
|
});
|
|
997
|
+
const tooltipProps = {
|
|
998
|
+
position: {
|
|
999
|
+
type: String,
|
|
1000
|
+
default: "top"
|
|
1001
|
+
},
|
|
1002
|
+
showAnimation: {
|
|
1003
|
+
type: Boolean,
|
|
1004
|
+
default: true
|
|
1005
|
+
},
|
|
1006
|
+
content: {
|
|
1007
|
+
type: String
|
|
1008
|
+
},
|
|
1009
|
+
mouseLeaveDelay: {
|
|
1010
|
+
type: String,
|
|
1011
|
+
default: "150"
|
|
1012
|
+
},
|
|
1013
|
+
mouseEnterDelay: {
|
|
1014
|
+
type: String,
|
|
1015
|
+
default: "100"
|
|
1016
|
+
}
|
|
1017
|
+
};
|
|
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
|
+
var tooltip = "";
|
|
1038
|
+
var DTooltip = defineComponent({
|
|
1039
|
+
name: "DTooltip",
|
|
1040
|
+
props: tooltipProps,
|
|
1041
|
+
setup(props, ctx) {
|
|
1042
|
+
const position = reactive({
|
|
1043
|
+
left: 0,
|
|
1044
|
+
top: 0
|
|
1045
|
+
});
|
|
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
|
+
const arrowStyle = (attr, value) => {
|
|
1054
|
+
arrow.value.style[attr] = value;
|
|
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
|
+
}
|
|
1069
|
+
};
|
|
1070
|
+
onMounted(() => {
|
|
1071
|
+
if (!show.value) {
|
|
1072
|
+
tooltip2.value.style.opacity = "0";
|
|
1073
|
+
}
|
|
1074
|
+
enterEvent = EventListener.listen(slotElement.value.children[0], "mouseenter", delayShowTrue(function() {
|
|
1075
|
+
show.value = true;
|
|
1076
|
+
}, props.mouseEnterDelay));
|
|
1077
|
+
leaveEvent = EventListener.listen(slotElement.value.children[0], "mouseleave", function() {
|
|
1078
|
+
if (show.value) {
|
|
1079
|
+
setTimeout(function() {
|
|
1080
|
+
show.value = false;
|
|
1081
|
+
}, props.mouseLeaveDelay);
|
|
1082
|
+
}
|
|
1083
|
+
});
|
|
1084
|
+
});
|
|
1085
|
+
watch(show, function(newValue, oldValue) {
|
|
1086
|
+
if (newValue) {
|
|
1087
|
+
tooltip2.value.style.opacity = "1";
|
|
1088
|
+
tooltip2.value.style.zIndex = "999";
|
|
1089
|
+
arrow.value.style.border = "5px solid transparent";
|
|
1090
|
+
switch (props.position) {
|
|
1091
|
+
case "top":
|
|
1092
|
+
position.left = slotElement.value.children[0].offsetLeft - tooltip2.value.offsetWidth / 2 + slotElement.value.children[0].offsetWidth / 2 - 5;
|
|
1093
|
+
position.top = slotElement.value.children[0].offsetTop - 10 - tooltipcontent.value.offsetHeight;
|
|
1094
|
+
arrowStyle("borderTop", "5px solid rgb(70, 77, 110)");
|
|
1095
|
+
arrow.value.style.top = `${tooltipcontent.value.offsetHeight}px`;
|
|
1096
|
+
arrow.value.style.left = `${tooltipcontent.value.offsetWidth / 2 + 5}px`;
|
|
1097
|
+
break;
|
|
1098
|
+
case "right":
|
|
1099
|
+
position.left = slotElement.value.children[0].offsetLeft + slotElement.value.children[0].offsetWidth;
|
|
1100
|
+
position.top = slotElement.value.children[0].offsetTop + slotElement.value.children[0].offsetHeight / 2 - tooltipcontent.value.offsetHeight / 2;
|
|
1101
|
+
arrowStyle("borderRight", "5px solid rgb(70, 77, 110)");
|
|
1102
|
+
arrow.value.style.top = `${tooltipcontent.value.offsetHeight / 2 - 5}px`;
|
|
1103
|
+
arrow.value.style.left = "-0px";
|
|
1104
|
+
break;
|
|
1105
|
+
case "bottom":
|
|
1106
|
+
position.top = slotElement.value.children[0].offsetHeight + slotElement.value.children[0].offsetTop + 10;
|
|
1107
|
+
position.left = slotElement.value.children[0].offsetLeft + slotElement.value.children[0].offsetWidth / 2 - tooltipcontent.value.offsetWidth / 2 - 5;
|
|
1108
|
+
arrowStyle("borderBottom", "5px solid rgb(70, 77, 110)");
|
|
1109
|
+
arrow.value.style.top = "-10px";
|
|
1110
|
+
arrow.value.style.left = `${tooltipcontent.value.offsetWidth / 2 + 5}px`;
|
|
1111
|
+
break;
|
|
1112
|
+
case "left":
|
|
1113
|
+
position.top = slotElement.value.children[0].offsetTop + slotElement.value.children[0].offsetHeight / 2 - tooltipcontent.value.offsetHeight / 2;
|
|
1114
|
+
position.left = slotElement.value.children[0].offsetLeft - 20 - tooltipcontent.value.offsetWidth;
|
|
1115
|
+
arrowStyle("borderLeft", "5px solid rgb(70, 77, 110)");
|
|
1116
|
+
arrow.value.style.left = `${tooltipcontent.value.offsetWidth + 10}px`;
|
|
1117
|
+
arrow.value.style.top = `${tooltipcontent.value.offsetHeight / 2 - 5}px`;
|
|
1118
|
+
break;
|
|
1119
|
+
default:
|
|
1120
|
+
console.error("The attribute position value is wrong, the value is one of top\u3001right\u3001left\u3001bottom");
|
|
1121
|
+
break;
|
|
1122
|
+
}
|
|
1123
|
+
tooltip2.value.style.top = position.top + "px";
|
|
1124
|
+
tooltip2.value.style.left = position.left + "px";
|
|
1125
|
+
} else {
|
|
1126
|
+
position.top = 0;
|
|
1127
|
+
position.left = 0;
|
|
1128
|
+
tooltip2.value.style.opacity = "0";
|
|
1129
|
+
}
|
|
1130
|
+
});
|
|
1131
|
+
onBeforeUnmount(() => {
|
|
1132
|
+
enterEvent.remove();
|
|
1133
|
+
leaveEvent.remove();
|
|
1134
|
+
});
|
|
1135
|
+
return () => {
|
|
1136
|
+
const defaultSlot = renderSlot(useSlots(), "default");
|
|
1137
|
+
return createVNode("div", {
|
|
1138
|
+
"class": "devui-tooltip"
|
|
1139
|
+
}, [createVNode("div", {
|
|
1140
|
+
"class": "slotElement",
|
|
1141
|
+
"ref": slotElement
|
|
1142
|
+
}, [defaultSlot]), createVNode("div", {
|
|
1143
|
+
"class": "tooltip",
|
|
1144
|
+
"ref": tooltip2
|
|
1145
|
+
}, [createVNode("div", {
|
|
1146
|
+
"class": "arrow",
|
|
1147
|
+
"ref": arrow
|
|
1148
|
+
}, null), createVNode("div", {
|
|
1149
|
+
"class": "tooltipcontent",
|
|
1150
|
+
"ref": tooltipcontent
|
|
1151
|
+
}, [props.content])])]);
|
|
1152
|
+
};
|
|
1153
|
+
}
|
|
1154
|
+
});
|
|
982
1155
|
function _isSlot(s) {
|
|
983
1156
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
984
1157
|
}
|
|
@@ -987,19 +1160,36 @@ var DTransferBase = defineComponent({
|
|
|
987
1160
|
components: {
|
|
988
1161
|
DSearch,
|
|
989
1162
|
DCheckboxGroup,
|
|
990
|
-
DCheckbox
|
|
1163
|
+
DCheckbox,
|
|
1164
|
+
DTooltip
|
|
991
1165
|
},
|
|
992
1166
|
props: transferBaseProps,
|
|
993
1167
|
setup(props, ctx) {
|
|
994
1168
|
const modelValues = computed(() => props.checkedValues);
|
|
995
|
-
const searchQuery = computed(() => props.
|
|
1169
|
+
const searchQuery = computed(() => props.filter);
|
|
996
1170
|
const baseClass = TransferBaseClass(props);
|
|
997
1171
|
const updateSearchQuery = (val) => ctx.emit("changeQuery", val);
|
|
1172
|
+
const renderCheckbox = (props2, key, showTooltip = false, tooltipPosition = "top") => {
|
|
1173
|
+
const checkbox2 = createVNode(DCheckbox, {
|
|
1174
|
+
"class": "devui-transfer-panel-body-list-item",
|
|
1175
|
+
"label": props2.key,
|
|
1176
|
+
"value": props2.value,
|
|
1177
|
+
"disabled": props2.disabled,
|
|
1178
|
+
"key": key
|
|
1179
|
+
}, null);
|
|
1180
|
+
return !showTooltip ? checkbox2 : createVNode(DTooltip, {
|
|
1181
|
+
"position": tooltipPosition,
|
|
1182
|
+
"content": props2.key
|
|
1183
|
+
}, _isSlot(checkbox2) ? checkbox2 : {
|
|
1184
|
+
default: () => [checkbox2]
|
|
1185
|
+
});
|
|
1186
|
+
};
|
|
998
1187
|
return {
|
|
999
1188
|
baseClass,
|
|
1000
1189
|
searchQuery,
|
|
1001
1190
|
modelValues,
|
|
1002
|
-
updateSearchQuery
|
|
1191
|
+
updateSearchQuery,
|
|
1192
|
+
renderCheckbox
|
|
1003
1193
|
};
|
|
1004
1194
|
},
|
|
1005
1195
|
render() {
|
|
@@ -1014,7 +1204,11 @@ var DTransferBase = defineComponent({
|
|
|
1014
1204
|
updateSearchQuery,
|
|
1015
1205
|
search: search2,
|
|
1016
1206
|
searchQuery,
|
|
1017
|
-
modelValues
|
|
1207
|
+
modelValues,
|
|
1208
|
+
height,
|
|
1209
|
+
showTooltip,
|
|
1210
|
+
tooltipPosition,
|
|
1211
|
+
renderCheckbox
|
|
1018
1212
|
} = this;
|
|
1019
1213
|
return createVNode("div", {
|
|
1020
1214
|
"class": baseClass
|
|
@@ -1039,19 +1233,13 @@ var DTransferBase = defineComponent({
|
|
|
1039
1233
|
}, null)]), createVNode("div", {
|
|
1040
1234
|
"class": "devui-transfer-panel-body-list",
|
|
1041
1235
|
"style": {
|
|
1042
|
-
height
|
|
1236
|
+
height
|
|
1043
1237
|
}
|
|
1044
1238
|
}, [sourceOption.length ? createVNode(DCheckboxGroup, {
|
|
1045
1239
|
"modelValue": modelValues,
|
|
1046
1240
|
"onChange": (values) => this.$emit("updateCheckeds", values)
|
|
1047
1241
|
}, _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);
|
|
1242
|
+
return renderCheckbox(item, idx, showTooltip, tooltipPosition);
|
|
1055
1243
|
})) ? _slot : {
|
|
1056
1244
|
default: () => [_slot]
|
|
1057
1245
|
}) : createVNode("div", {
|
|
@@ -1089,7 +1277,7 @@ var Icon = defineComponent({
|
|
|
1089
1277
|
color,
|
|
1090
1278
|
classPrefix
|
|
1091
1279
|
} = this;
|
|
1092
|
-
return
|
|
1280
|
+
return /^((https?):)?\/\//.test(name) ? createVNode("img", {
|
|
1093
1281
|
"src": name,
|
|
1094
1282
|
"alt": name.split("/")[name.split("/").length - 1],
|
|
1095
1283
|
"style": {
|
|
@@ -1101,7 +1289,7 @@ var Icon = defineComponent({
|
|
|
1101
1289
|
fontSize: size,
|
|
1102
1290
|
color
|
|
1103
1291
|
}
|
|
1104
|
-
}, null)
|
|
1292
|
+
}, null);
|
|
1105
1293
|
}
|
|
1106
1294
|
});
|
|
1107
1295
|
Icon.install = function(app) {
|
|
@@ -1296,30 +1484,52 @@ const transferProps = {
|
|
|
1296
1484
|
},
|
|
1297
1485
|
height: {
|
|
1298
1486
|
type: String,
|
|
1299
|
-
default: "320px"
|
|
1487
|
+
default: () => "320px"
|
|
1300
1488
|
},
|
|
1301
1489
|
isSearch: {
|
|
1302
1490
|
type: Boolean,
|
|
1303
|
-
default: false
|
|
1491
|
+
default: () => false
|
|
1304
1492
|
},
|
|
1305
1493
|
isSourceDroppable: {
|
|
1306
1494
|
type: Boolean,
|
|
1307
|
-
default: false
|
|
1495
|
+
default: () => false
|
|
1308
1496
|
},
|
|
1309
1497
|
isTargetDroppable: {
|
|
1310
1498
|
type: Boolean,
|
|
1311
|
-
default: false
|
|
1499
|
+
default: () => false
|
|
1312
1500
|
},
|
|
1313
1501
|
disabled: {
|
|
1314
1502
|
type: Boolean,
|
|
1315
|
-
default: false
|
|
1503
|
+
default: () => false
|
|
1316
1504
|
},
|
|
1317
|
-
|
|
1505
|
+
showTooltip: {
|
|
1318
1506
|
type: Boolean,
|
|
1319
|
-
default: false
|
|
1507
|
+
default: () => false
|
|
1508
|
+
},
|
|
1509
|
+
tooltipPosition: {
|
|
1510
|
+
type: String,
|
|
1511
|
+
default: () => "top"
|
|
1512
|
+
},
|
|
1513
|
+
beforeTransfer: {
|
|
1514
|
+
type: Function
|
|
1320
1515
|
},
|
|
1321
1516
|
slots: {
|
|
1322
1517
|
type: Object
|
|
1518
|
+
},
|
|
1519
|
+
searching: {
|
|
1520
|
+
type: Function
|
|
1521
|
+
},
|
|
1522
|
+
transferToSource: {
|
|
1523
|
+
type: Function
|
|
1524
|
+
},
|
|
1525
|
+
transferToTarget: {
|
|
1526
|
+
type: Function
|
|
1527
|
+
},
|
|
1528
|
+
transferring: {
|
|
1529
|
+
type: Function
|
|
1530
|
+
},
|
|
1531
|
+
afterTransfer: {
|
|
1532
|
+
type: Function
|
|
1323
1533
|
}
|
|
1324
1534
|
};
|
|
1325
1535
|
const headerSlot = (ctx, name) => {
|
|
@@ -1341,10 +1551,16 @@ var Transfer = defineComponent({
|
|
|
1341
1551
|
},
|
|
1342
1552
|
props: transferProps,
|
|
1343
1553
|
setup(props, ctx) {
|
|
1344
|
-
|
|
1345
|
-
|
|
1554
|
+
let leftOptions = reactive(initState(props, "source"));
|
|
1555
|
+
let rightOptions = reactive(initState(props, "target"));
|
|
1346
1556
|
const origin = ref(null);
|
|
1347
|
-
watch(() =>
|
|
1557
|
+
watch(() => props.sourceOption, () => {
|
|
1558
|
+
leftOptions = reactive(initState(props, "source"));
|
|
1559
|
+
});
|
|
1560
|
+
watch(() => props.targetOption, () => {
|
|
1561
|
+
rightOptions = reactive(initState(props, "target"));
|
|
1562
|
+
});
|
|
1563
|
+
watch(() => leftOptions.keyword, (nVal) => {
|
|
1348
1564
|
searchFilterData(leftOptions);
|
|
1349
1565
|
});
|
|
1350
1566
|
watch(() => leftOptions.checkedValues, (values) => {
|
|
@@ -1353,7 +1569,7 @@ var Transfer = defineComponent({
|
|
|
1353
1569
|
}, {
|
|
1354
1570
|
deep: true
|
|
1355
1571
|
});
|
|
1356
|
-
watch(() => rightOptions.
|
|
1572
|
+
watch(() => rightOptions.keyword, (nVal) => {
|
|
1357
1573
|
searchFilterData(rightOptions);
|
|
1358
1574
|
});
|
|
1359
1575
|
watch(() => rightOptions.checkedValues, (values) => {
|
|
@@ -1369,19 +1585,35 @@ var Transfer = defineComponent({
|
|
|
1369
1585
|
source.allChecked = value.length === source.data.filter((item) => !item.disabled).length ? true : false;
|
|
1370
1586
|
}
|
|
1371
1587
|
};
|
|
1372
|
-
const updateFilterData = (source, target) => {
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
}
|
|
1379
|
-
|
|
1588
|
+
const updateFilterData = async (source, target, direction) => {
|
|
1589
|
+
if (isFunction("beforeTransfer")) {
|
|
1590
|
+
const res = await props.beforeTransfer.call(null, source, target);
|
|
1591
|
+
if (typeof res === "boolean" && res === false) {
|
|
1592
|
+
return;
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
const hasToSource = isFunction("transferToSource");
|
|
1596
|
+
const hasToTarget = isFunction("transferToTarget");
|
|
1597
|
+
const hasTransfering = isFunction("transferring");
|
|
1598
|
+
if (hasToSource || hasToTarget) {
|
|
1599
|
+
direction === "right" && props.transferToSource.call(null, source, target);
|
|
1600
|
+
direction === "left" && props.transferToTarget.call(null, source, target);
|
|
1601
|
+
} else {
|
|
1602
|
+
source.data = source.data.filter((item) => {
|
|
1603
|
+
const hasInclues = source.checkedValues.includes(item.value);
|
|
1604
|
+
hasInclues && target.data.push(item);
|
|
1605
|
+
return !hasInclues;
|
|
1606
|
+
});
|
|
1607
|
+
}
|
|
1608
|
+
if (hasTransfering) {
|
|
1609
|
+
props.transferring.call(null, target);
|
|
1610
|
+
}
|
|
1380
1611
|
source.checkedValues = [];
|
|
1381
1612
|
target.disabled = !target.disabled;
|
|
1382
1613
|
searchFilterData(source, target);
|
|
1383
1614
|
searchFilterData(target, source);
|
|
1384
1615
|
setOrigin("click");
|
|
1616
|
+
isFunction("afterTransfer") && props.afterTransfer.call(null, target);
|
|
1385
1617
|
};
|
|
1386
1618
|
const changeAllSource = (source, value) => {
|
|
1387
1619
|
if (source.filterData.every((item) => item.disabled))
|
|
@@ -1403,7 +1635,7 @@ var Transfer = defineComponent({
|
|
|
1403
1635
|
setOrigin("change");
|
|
1404
1636
|
};
|
|
1405
1637
|
const searchFilterData = (source, target) => {
|
|
1406
|
-
source.filterData = source.data.filter((item) => item.key.indexOf(source.
|
|
1638
|
+
source.filterData = source.data.filter((item) => item.key.indexOf(source.keyword) !== -1);
|
|
1407
1639
|
if (target) {
|
|
1408
1640
|
target.allChecked = false;
|
|
1409
1641
|
}
|
|
@@ -1411,25 +1643,35 @@ var Transfer = defineComponent({
|
|
|
1411
1643
|
const setOrigin = (value) => {
|
|
1412
1644
|
origin.value = value;
|
|
1413
1645
|
};
|
|
1646
|
+
const changeQueryHandle = (source, direction, value) => {
|
|
1647
|
+
if ((props == null ? void 0 : props.searching) && typeof props.searching === "function") {
|
|
1648
|
+
props.searching.call(null, direction, value, source);
|
|
1649
|
+
return;
|
|
1650
|
+
}
|
|
1651
|
+
source.keyword = value;
|
|
1652
|
+
};
|
|
1653
|
+
const isFunction = (type) => {
|
|
1654
|
+
return props[type] && typeof props[type] === "function";
|
|
1655
|
+
};
|
|
1414
1656
|
return () => {
|
|
1415
1657
|
return createVNode("div", {
|
|
1416
1658
|
"class": "devui-transfer"
|
|
1417
1659
|
}, [createVNode(DTransferBase, {
|
|
1418
|
-
"style": {
|
|
1419
|
-
height: props.height
|
|
1420
|
-
},
|
|
1421
1660
|
"sourceOption": leftOptions.filterData,
|
|
1422
1661
|
"title": props.titles[0],
|
|
1423
1662
|
"type": "source",
|
|
1424
1663
|
"search": props.isSearch,
|
|
1425
1664
|
"allChecked": leftOptions.allChecked,
|
|
1426
1665
|
"checkedNum": leftOptions.checkedNum,
|
|
1427
|
-
"
|
|
1666
|
+
"filter": leftOptions.keyword,
|
|
1667
|
+
"height": props.height,
|
|
1428
1668
|
"checkedValues": leftOptions.checkedValues,
|
|
1429
1669
|
"allCount": leftOptions.data.length,
|
|
1670
|
+
"showTooltip": props.showTooltip,
|
|
1671
|
+
"tooltipPosition": props.tooltipPosition,
|
|
1430
1672
|
"onChangeAllSource": (value) => changeAllSource(leftOptions, value),
|
|
1431
1673
|
"onUpdateCheckeds": updateLeftCheckeds,
|
|
1432
|
-
"onChangeQuery": (value) => leftOptions
|
|
1674
|
+
"onChangeQuery": (value) => changeQueryHandle(leftOptions, "left", value)
|
|
1433
1675
|
}, {
|
|
1434
1676
|
header: headerSlot(ctx, "left"),
|
|
1435
1677
|
body: bodySlot(ctx, "left")
|
|
@@ -1438,29 +1680,29 @@ var Transfer = defineComponent({
|
|
|
1438
1680
|
"sourceDisabled": rightOptions.checkedNum > 0 ? false : true,
|
|
1439
1681
|
"targetDisabled": leftOptions.checkedNum > 0 ? false : true,
|
|
1440
1682
|
"onUpdateSourceData": () => {
|
|
1441
|
-
updateFilterData(rightOptions, leftOptions);
|
|
1683
|
+
updateFilterData(rightOptions, leftOptions, "left");
|
|
1442
1684
|
},
|
|
1443
1685
|
"onUpdateTargetData": () => {
|
|
1444
|
-
updateFilterData(leftOptions, rightOptions);
|
|
1686
|
+
updateFilterData(leftOptions, rightOptions, "right");
|
|
1445
1687
|
}
|
|
1446
1688
|
}, {
|
|
1447
1689
|
operation: opeartionSlot(ctx)
|
|
1448
1690
|
}), createVNode(DTransferBase, {
|
|
1449
|
-
"style": {
|
|
1450
|
-
height: props.height
|
|
1451
|
-
},
|
|
1452
1691
|
"sourceOption": rightOptions.filterData,
|
|
1453
1692
|
"title": props.titles[1],
|
|
1454
1693
|
"type": "target",
|
|
1455
1694
|
"search": props.isSearch,
|
|
1456
1695
|
"allChecked": rightOptions.allChecked,
|
|
1457
1696
|
"checkedNum": rightOptions.checkedNum,
|
|
1458
|
-
"
|
|
1697
|
+
"filter": rightOptions.keyword,
|
|
1698
|
+
"height": props.height,
|
|
1459
1699
|
"checkedValues": rightOptions.checkedValues,
|
|
1460
1700
|
"allCount": rightOptions.data.length,
|
|
1701
|
+
"showTooltip": props.showTooltip,
|
|
1702
|
+
"tooltipPosition": props.tooltipPosition,
|
|
1461
1703
|
"onChangeAllSource": (value) => changeAllSource(rightOptions, value),
|
|
1462
1704
|
"onUpdateCheckeds": updateRightCheckeds,
|
|
1463
|
-
"onChangeQuery": (value) => rightOptions
|
|
1705
|
+
"onChangeQuery": (value) => changeQueryHandle(rightOptions, "right", value)
|
|
1464
1706
|
}, {
|
|
1465
1707
|
header: headerSlot(ctx, "right"),
|
|
1466
1708
|
body: bodySlot(ctx, "right")
|