vue-devui 1.0.0-beta.1 → 1.0.0-beta.13
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 +62 -45
- package/accordion/index.d.ts +7 -0
- package/accordion/index.es.js +460 -142
- 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 +7 -5
- package/alert/index.umd.js +1 -1
- package/alert/style.css +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 +218 -12
- package/button/index.umd.js +1 -1
- package/button/style.css +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 +5 -4
- 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 +43 -8
- package/checkbox/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.d.ts +7 -0
- package/comment/index.es.js +85 -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 +176 -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 +32 -21
- package/date-picker/index.umd.js +1 -1
- package/date-picker/style.css +1 -1
- package/dragdrop/index.d.ts +7 -0
- package/dragdrop/index.es.js +157 -0
- package/dragdrop/index.umd.js +1 -0
- package/dragdrop/package.json +7 -0
- package/drawer/index.d.ts +7 -0
- package/drawer/index.es.js +194 -42
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +535 -0
- package/dropdown/index.umd.js +1 -0
- package/dropdown/package.json +7 -0
- package/dropdown/style.css +1 -0
- package/editable-select/index.d.ts +7 -0
- package/editable-select/index.es.js +5782 -469
- package/editable-select/index.umd.js +27 -1
- package/editable-select/style.css +1 -1
- package/form/index.d.ts +7 -0
- package/form/index.es.js +2257 -0
- package/form/index.umd.js +1 -0
- package/form/package.json +7 -0
- package/form/style.css +1 -0
- 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/gantt/index.es.js +535 -0
- package/gantt/index.umd.js +1 -0
- package/gantt/package.json +7 -0
- package/gantt/style.css +1 -0
- package/grid/index.d.ts +7 -0
- package/grid/index.es.js +269 -0
- package/grid/index.umd.js +1 -0
- package/grid/package.json +7 -0
- package/grid/style.css +1 -0
- package/icon/index.d.ts +7 -0
- package/icon/index.es.js +6 -5
- package/icon/index.umd.js +1 -1
- package/image-preview/index.d.ts +7 -0
- package/image-preview/index.es.js +99 -20
- 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 +24 -13
- package/input/index.umd.js +1 -1
- package/input-icon/index.d.ts +7 -0
- package/input-icon/index.es.js +332 -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 +5 -4
- 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 +328 -109
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/nav-sprite/index.d.ts +7 -0
- package/nuxt/components/Accordion.js +3 -0
- package/nuxt/components/Alert.js +3 -0
- package/nuxt/components/Anchor.js +3 -0
- package/nuxt/components/Aside.js +3 -0
- package/nuxt/components/Avatar.js +3 -0
- package/nuxt/components/BackTop.js +3 -0
- package/nuxt/components/Badge.js +3 -0
- package/nuxt/components/Breadcrumb.js +3 -0
- package/nuxt/components/Button.js +3 -0
- package/nuxt/components/Card.js +3 -0
- package/nuxt/components/Carousel.js +3 -0
- package/nuxt/components/Cascader.js +3 -0
- package/nuxt/components/Checkbox.js +3 -0
- package/nuxt/components/Col.js +3 -0
- package/nuxt/components/ColorPicker.js +3 -0
- package/nuxt/components/Column.js +3 -0
- package/nuxt/components/Comment.js +3 -0
- package/nuxt/components/Content.js +3 -0
- package/nuxt/components/Countdown.js +3 -0
- package/nuxt/components/DatePicker.js +3 -0
- package/nuxt/components/Drawer.js +3 -0
- package/nuxt/components/DrawerService.js +3 -0
- package/nuxt/components/Dropdown.js +3 -0
- package/nuxt/components/EditableSelect.js +3 -0
- package/nuxt/components/FixedOverlay.js +3 -0
- package/nuxt/components/FlexibleOverlay.js +3 -0
- package/nuxt/components/Footer.js +3 -0
- package/nuxt/components/Form.js +3 -0
- package/nuxt/components/FormControl.js +3 -0
- package/nuxt/components/FormItem.js +3 -0
- package/nuxt/components/FormLabel.js +3 -0
- package/nuxt/components/FormOperation.js +3 -0
- package/nuxt/components/Fullscreen.js +3 -0
- package/nuxt/components/Gantt.js +3 -0
- package/nuxt/components/Header.js +3 -0
- package/nuxt/components/Icon.js +2 -0
- package/nuxt/components/ImagePreviewService.js +3 -0
- package/nuxt/components/Input.js +3 -0
- package/nuxt/components/InputIcon.js +3 -0
- package/nuxt/components/InputNumber.js +3 -0
- package/nuxt/components/Layout.js +3 -0
- package/nuxt/components/Loading.js +3 -0
- package/nuxt/components/LoadingService.js +3 -0
- package/nuxt/components/Modal.js +3 -0
- package/nuxt/components/NavSprite.js +2 -0
- package/nuxt/components/Pagination.js +3 -0
- package/nuxt/components/Panel.js +3 -0
- package/nuxt/components/Popover.js +3 -0
- package/nuxt/components/Progress.js +3 -0
- package/nuxt/components/QuadrantDiagram.js +3 -0
- package/nuxt/components/Radio.js +3 -0
- package/nuxt/components/RadioGroup.js +3 -0
- package/nuxt/components/Rate.js +3 -0
- package/nuxt/components/ReadTip.js +3 -0
- package/nuxt/components/Result.js +3 -0
- package/nuxt/components/Row.js +3 -0
- package/nuxt/components/Search.js +3 -0
- package/nuxt/components/Select.js +3 -0
- package/nuxt/components/Skeleton.js +3 -0
- package/nuxt/components/SkeletonItem.js +3 -0
- package/nuxt/components/Slider.js +3 -0
- package/nuxt/components/Splitter.js +3 -0
- package/nuxt/components/Statistic.js +3 -0
- package/nuxt/components/Status.js +3 -0
- package/nuxt/components/StepsGuide.js +3 -0
- package/nuxt/components/StickSlider.js +3 -0
- package/nuxt/components/Sticky.js +2 -0
- package/nuxt/components/Switch.js +3 -0
- package/nuxt/components/Table.js +3 -0
- package/nuxt/components/Tabs.js +3 -0
- package/nuxt/components/Tag.js +3 -0
- package/nuxt/components/TagInput.js +3 -0
- package/nuxt/components/Textarea.js +3 -0
- package/nuxt/components/TimeAxis.js +3 -0
- package/nuxt/components/TimeAxisItem.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/Toast.js +3 -0
- package/nuxt/components/ToastService.js +3 -0
- package/nuxt/components/Tooltip.js +3 -0
- package/nuxt/components/Transfer.js +3 -0
- package/nuxt/components/Tree.js +3 -0
- package/nuxt/components/TreeSelect.js +3 -0
- package/nuxt/components/Upload.js +3 -0
- package/nuxt/components/buttonProps.js +3 -0
- package/nuxt/index.js +13 -0
- package/overlay/index.d.ts +7 -0
- package/overlay/index.es.js +111 -94
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +5 -47
- 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/panel/index.es.js +25 -22
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.d.ts +7 -0
- package/popover/index.es.js +18 -6
- package/popover/index.umd.js +1 -1
- package/progress/index.d.ts +7 -0
- package/progress/index.es.js +9 -9
- package/progress/index.umd.js +3 -3
- package/quadrant-diagram/index.d.ts +7 -0
- package/radio/index.d.ts +7 -0
- package/radio/index.es.js +6 -6
- 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 +258 -0
- package/read-tip/index.umd.js +1 -0
- package/read-tip/package.json +7 -0
- package/read-tip/style.css +1 -0
- package/result/index.d.ts +7 -0
- package/result/index.es.js +119 -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 +35 -21
- package/search/index.umd.js +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +47 -11
- 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 +32 -182
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.d.ts +7 -0
- package/splitter/index.es.js +295 -100
- package/splitter/index.umd.js +1 -1
- package/splitter/style.css +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 +101 -73
- package/steps-guide/index.umd.js +1 -1
- package/steps-guide/style.css +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 +1708 -156
- 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 +6 -3
- package/tabs/index.umd.js +1 -1
- package/tag/index.d.ts +7 -0
- package/tag/index.es.js +131 -0
- package/tag/index.umd.js +1 -0
- package/tag/package.json +7 -0
- package/tag/style.css +1 -0
- package/tag-input/index.d.ts +7 -0
- package/tag-input/index.es.js +1 -13
- package/tag-input/index.umd.js +1 -1
- package/textarea/index.d.ts +7 -0
- package/textarea/index.es.js +132 -0
- package/textarea/index.umd.js +1 -0
- package/textarea/package.json +7 -0
- package/textarea/style.css +1 -0
- package/time-axis/index.d.ts +7 -0
- package/time-axis/index.es.js +241 -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 +266 -32
- 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 +16 -12
- package/toast/index.umd.js +1 -1
- package/toast/style.css +1 -1
- package/tooltip/index.d.ts +7 -0
- package/transfer/index.d.ts +7 -0
- package/transfer/index.es.js +575 -83
- 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 +171 -35
- package/tree/index.umd.js +1 -1
- package/tree-select/index.d.ts +7 -0
- package/tree-select/index.es.js +528 -0
- package/tree-select/index.umd.js +1 -0
- package/tree-select/package.json +7 -0
- package/tree-select/style.css +1 -0
- package/upload/index.d.ts +7 -0
- package/upload/index.es.js +172 -513
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +22079 -8773
- package/vue-devui.umd.js +29 -3
package/transfer/index.es.js
CHANGED
|
@@ -17,7 +17,11 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
|
|
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, createTextVNode, h, render } from "vue";
|
|
21
25
|
const transferBaseProps = {
|
|
22
26
|
sourceOption: {
|
|
23
27
|
type: Array,
|
|
@@ -47,10 +51,14 @@ const transferBaseProps = {
|
|
|
47
51
|
type: Boolean,
|
|
48
52
|
default: () => false
|
|
49
53
|
},
|
|
50
|
-
|
|
54
|
+
filter: {
|
|
51
55
|
type: String,
|
|
52
56
|
default: () => ""
|
|
53
57
|
},
|
|
58
|
+
height: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: () => "320px"
|
|
61
|
+
},
|
|
54
62
|
alltargetState: {
|
|
55
63
|
type: Boolean,
|
|
56
64
|
default: () => false
|
|
@@ -67,6 +75,14 @@ const transferBaseProps = {
|
|
|
67
75
|
type: Number,
|
|
68
76
|
default: () => 0
|
|
69
77
|
},
|
|
78
|
+
showTooltip: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
default: () => false
|
|
81
|
+
},
|
|
82
|
+
tooltipPosition: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: () => "top"
|
|
85
|
+
},
|
|
70
86
|
scopedSlots: {
|
|
71
87
|
type: Object
|
|
72
88
|
},
|
|
@@ -100,7 +116,7 @@ const initState = (props, type) => {
|
|
|
100
116
|
allChecked: false,
|
|
101
117
|
disabled: false,
|
|
102
118
|
checkedNum: initModel.model.length,
|
|
103
|
-
|
|
119
|
+
keyword: "",
|
|
104
120
|
checkedValues: initModel.model,
|
|
105
121
|
filterData: initModel.data
|
|
106
122
|
};
|
|
@@ -117,10 +133,17 @@ const commonProps = {
|
|
|
117
133
|
type: String,
|
|
118
134
|
default: void 0
|
|
119
135
|
},
|
|
136
|
+
halfchecked: {
|
|
137
|
+
type: Boolean,
|
|
138
|
+
default: false
|
|
139
|
+
},
|
|
120
140
|
isShowTitle: {
|
|
121
141
|
type: Boolean,
|
|
122
142
|
default: true
|
|
123
143
|
},
|
|
144
|
+
title: {
|
|
145
|
+
type: String
|
|
146
|
+
},
|
|
124
147
|
color: {
|
|
125
148
|
type: String,
|
|
126
149
|
default: void 0
|
|
@@ -216,15 +239,15 @@ var DCheckbox = defineComponent({
|
|
|
216
239
|
});
|
|
217
240
|
const mergedIsShowTitle = computed(() => {
|
|
218
241
|
var _a;
|
|
219
|
-
return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.isShowTitle) != null ? _a : props.isShowTitle;
|
|
242
|
+
return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.isShowTitle.value) != null ? _a : props.isShowTitle;
|
|
220
243
|
});
|
|
221
244
|
const mergedShowAnimation = computed(() => {
|
|
222
245
|
var _a;
|
|
223
|
-
return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.showAnimation) != null ? _a : props.showAnimation;
|
|
246
|
+
return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.showAnimation.value) != null ? _a : props.showAnimation;
|
|
224
247
|
});
|
|
225
248
|
const mergedColor = computed(() => {
|
|
226
249
|
var _a;
|
|
227
|
-
return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.color) != null ? _a : props.color;
|
|
250
|
+
return (_a = checkboxGroupConf == null ? void 0 : checkboxGroupConf.color.value) != null ? _a : props.color;
|
|
228
251
|
});
|
|
229
252
|
const itemWidth = checkboxGroupConf == null ? void 0 : checkboxGroupConf.itemWidth.value;
|
|
230
253
|
const direction = checkboxGroupConf == null ? void 0 : checkboxGroupConf.direction.value;
|
|
@@ -251,7 +274,7 @@ var DCheckbox = defineComponent({
|
|
|
251
274
|
ctx.emit("change", current);
|
|
252
275
|
};
|
|
253
276
|
const handleClick = () => {
|
|
254
|
-
canChange(!isChecked.value, props.
|
|
277
|
+
canChange(!isChecked.value, props.label).then((res) => res && toggle());
|
|
255
278
|
};
|
|
256
279
|
return {
|
|
257
280
|
itemWidth,
|
|
@@ -366,8 +389,20 @@ var DCheckboxGroup = defineComponent({
|
|
|
366
389
|
disabled: false
|
|
367
390
|
};
|
|
368
391
|
const toggleGroupVal = (val) => {
|
|
369
|
-
|
|
392
|
+
let index2 = -1;
|
|
393
|
+
if (typeof valList.value[0] === "string") {
|
|
394
|
+
index2 = valList.value.findIndex((item) => item === val);
|
|
395
|
+
} else if (typeof valList.value[0] === "object") {
|
|
396
|
+
index2 = valList.value.findIndex((item) => item.value === val);
|
|
397
|
+
}
|
|
370
398
|
if (index2 === -1) {
|
|
399
|
+
if (typeof props.options[0] === "object") {
|
|
400
|
+
const newOne = props.options.find((item) => item.value === val);
|
|
401
|
+
const res2 = [...valList.value, newOne];
|
|
402
|
+
ctx.emit("update:modelValue", res2);
|
|
403
|
+
ctx.emit("change", res2);
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
371
406
|
const res = [...valList.value, val];
|
|
372
407
|
ctx.emit("update:modelValue", res);
|
|
373
408
|
ctx.emit("change", res);
|
|
@@ -377,7 +412,13 @@ var DCheckboxGroup = defineComponent({
|
|
|
377
412
|
ctx.emit("update:modelValue", valList.value);
|
|
378
413
|
ctx.emit("change", valList.value);
|
|
379
414
|
};
|
|
380
|
-
const isItemChecked = (itemVal) =>
|
|
415
|
+
const isItemChecked = (itemVal) => {
|
|
416
|
+
if (typeof valList.value[0] === "string") {
|
|
417
|
+
return valList.value.includes(itemVal);
|
|
418
|
+
} else if (typeof valList.value[0] === "object") {
|
|
419
|
+
return valList.value.some((item) => item.value === itemVal);
|
|
420
|
+
}
|
|
421
|
+
};
|
|
381
422
|
provide(checkboxGroupInjectionKey, {
|
|
382
423
|
disabled: toRef(props, "disabled"),
|
|
383
424
|
isShowTitle: toRef(props, "isShowTitle"),
|
|
@@ -404,7 +445,17 @@ var DCheckboxGroup = defineComponent({
|
|
|
404
445
|
let children = (_a = $slots.default) == null ? void 0 : _a.call($slots);
|
|
405
446
|
if ((options == null ? void 0 : options.length) > 0) {
|
|
406
447
|
children = options.map((opt) => {
|
|
407
|
-
|
|
448
|
+
let mergedOpt = null;
|
|
449
|
+
if (typeof opt === "string") {
|
|
450
|
+
mergedOpt = Object.assign({}, defaultOpt, {
|
|
451
|
+
label: opt,
|
|
452
|
+
value: opt
|
|
453
|
+
});
|
|
454
|
+
} else if (typeof opt === "object") {
|
|
455
|
+
mergedOpt = Object.assign({}, defaultOpt, __spreadProps(__spreadValues({}, opt), {
|
|
456
|
+
label: opt.name
|
|
457
|
+
}));
|
|
458
|
+
}
|
|
408
459
|
return createVNode(DCheckbox, mergedOpt, null);
|
|
409
460
|
});
|
|
410
461
|
}
|
|
@@ -462,7 +513,7 @@ const searchProps = {
|
|
|
462
513
|
type: String,
|
|
463
514
|
default: ""
|
|
464
515
|
},
|
|
465
|
-
|
|
516
|
+
onSearch: {
|
|
466
517
|
type: Function,
|
|
467
518
|
default: void 0
|
|
468
519
|
},
|
|
@@ -700,7 +751,7 @@ const keydownHandles = (ctx, keywords, delay) => {
|
|
|
700
751
|
useEmitKeyword(keywords.value);
|
|
701
752
|
};
|
|
702
753
|
const useEmitKeyword = debounce((value) => {
|
|
703
|
-
ctx.emit("
|
|
754
|
+
ctx.emit("onSearch", value);
|
|
704
755
|
}, delay);
|
|
705
756
|
return {
|
|
706
757
|
onInputKeydown,
|
|
@@ -741,32 +792,38 @@ const inputProps = {
|
|
|
741
792
|
type: Boolean,
|
|
742
793
|
default: false
|
|
743
794
|
},
|
|
744
|
-
|
|
795
|
+
modelValue: {
|
|
745
796
|
type: String,
|
|
746
797
|
default: ""
|
|
747
798
|
},
|
|
748
|
-
"
|
|
799
|
+
"update:modelValue": {
|
|
749
800
|
type: Function,
|
|
750
801
|
default: void 0
|
|
751
802
|
},
|
|
752
|
-
|
|
803
|
+
onChange: {
|
|
753
804
|
type: Function,
|
|
754
805
|
default: void 0
|
|
755
806
|
},
|
|
756
|
-
|
|
807
|
+
onKeydown: {
|
|
757
808
|
type: Function,
|
|
758
809
|
default: void 0
|
|
759
810
|
},
|
|
760
|
-
|
|
811
|
+
onFocus: {
|
|
761
812
|
type: Function,
|
|
762
813
|
default: void 0
|
|
763
814
|
},
|
|
764
|
-
|
|
815
|
+
onBlur: {
|
|
765
816
|
type: Function,
|
|
766
817
|
default: void 0
|
|
767
818
|
}
|
|
768
819
|
};
|
|
769
820
|
var input = "";
|
|
821
|
+
const formItemInjectionKey = Symbol("dFormItem");
|
|
822
|
+
const dFormItemEvents = {
|
|
823
|
+
blur: "d.form.blur",
|
|
824
|
+
change: "d.form.change",
|
|
825
|
+
input: "d.form.input"
|
|
826
|
+
};
|
|
770
827
|
var DInput = defineComponent({
|
|
771
828
|
name: "DInput",
|
|
772
829
|
directives: {
|
|
@@ -779,8 +836,10 @@ var DInput = defineComponent({
|
|
|
779
836
|
}
|
|
780
837
|
},
|
|
781
838
|
props: inputProps,
|
|
782
|
-
emits: ["update:
|
|
839
|
+
emits: ["update:modelValue", "focus", "blur", "change", "keydown"],
|
|
783
840
|
setup(props, ctx) {
|
|
841
|
+
const formItem = inject(formItemInjectionKey, {});
|
|
842
|
+
const hasFormItem = Object.keys(formItem).length > 0;
|
|
784
843
|
const sizeCls = computed(() => `devui-input-${props.size}`);
|
|
785
844
|
const showPwdIcon = ref(false);
|
|
786
845
|
const inputType = ref("text");
|
|
@@ -797,17 +856,20 @@ var DInput = defineComponent({
|
|
|
797
856
|
}, {
|
|
798
857
|
immediate: true
|
|
799
858
|
});
|
|
800
|
-
watch(() => props.
|
|
859
|
+
watch(() => props.modelValue, (value) => {
|
|
801
860
|
value && value.length > 0 && showPreviewIcon.value ? showPwdIcon.value = true : showPwdIcon.value = false;
|
|
802
861
|
});
|
|
803
862
|
const onInput = ($event) => {
|
|
804
|
-
ctx.emit("update:
|
|
863
|
+
ctx.emit("update:modelValue", $event.target.value);
|
|
864
|
+
hasFormItem && formItem.formItemMitt.emit(dFormItemEvents.input);
|
|
805
865
|
}, onFocus = () => {
|
|
806
866
|
ctx.emit("focus");
|
|
807
867
|
}, onBlur = () => {
|
|
808
868
|
ctx.emit("blur");
|
|
869
|
+
hasFormItem && formItem.formItemMitt.emit(dFormItemEvents.blur);
|
|
809
870
|
}, onChange = ($event) => {
|
|
810
871
|
ctx.emit("change", $event.target.value);
|
|
872
|
+
hasFormItem && formItem.formItemMitt.emit(dFormItemEvents.change);
|
|
811
873
|
}, onKeydown = ($event) => {
|
|
812
874
|
ctx.emit("keydown", $event);
|
|
813
875
|
}, onChangeInputType = () => {
|
|
@@ -828,7 +890,7 @@ var DInput = defineComponent({
|
|
|
828
890
|
},
|
|
829
891
|
render() {
|
|
830
892
|
const {
|
|
831
|
-
|
|
893
|
+
modelValue,
|
|
832
894
|
showPreviewIcon,
|
|
833
895
|
showPwdIcon,
|
|
834
896
|
inputCls,
|
|
@@ -849,7 +911,7 @@ var DInput = defineComponent({
|
|
|
849
911
|
}, [withDirectives(createVNode("input", mergeProps({
|
|
850
912
|
dinput: true
|
|
851
913
|
}, {
|
|
852
|
-
"value":
|
|
914
|
+
"value": modelValue,
|
|
853
915
|
"disabled": disabled,
|
|
854
916
|
"type": inputType,
|
|
855
917
|
"maxlength": maxLength,
|
|
@@ -878,7 +940,7 @@ var search = "";
|
|
|
878
940
|
var DSearch = defineComponent({
|
|
879
941
|
name: "DSearch",
|
|
880
942
|
props: searchProps,
|
|
881
|
-
emits: ["update:modelValue", "
|
|
943
|
+
emits: ["update:modelValue", "onSearch"],
|
|
882
944
|
setup(props, ctx) {
|
|
883
945
|
const rootClasses = getRootClass(props);
|
|
884
946
|
const {
|
|
@@ -906,33 +968,194 @@ var DSearch = defineComponent({
|
|
|
906
968
|
"onClick": onClickHandle
|
|
907
969
|
}, [createVNode(resolveComponent("d-icon"), {
|
|
908
970
|
"name": "search",
|
|
909
|
-
"size": "inherit"
|
|
971
|
+
"size": "inherit",
|
|
972
|
+
"key": "search"
|
|
910
973
|
}, null)]), createVNode(DInput, {
|
|
911
974
|
"size": props.size,
|
|
912
975
|
"disabled": props.disabled,
|
|
913
976
|
"autoFocus": props.autoFocus,
|
|
914
|
-
"
|
|
977
|
+
"modelValue": keywords.value,
|
|
915
978
|
"maxLength": props.maxLength,
|
|
916
979
|
"placeholder": props.placeholder,
|
|
917
980
|
"cssClass": props.cssClass,
|
|
918
981
|
"onKeydown": onInputKeydown,
|
|
919
|
-
"onUpdate:
|
|
982
|
+
"onUpdate:modelValue": onInputUpdate
|
|
920
983
|
}, null), clearIconShow.value && createVNode("div", {
|
|
921
984
|
"class": "devui-search__clear",
|
|
922
985
|
"onClick": onClearHandle
|
|
923
986
|
}, [createVNode(resolveComponent("d-icon"), {
|
|
924
987
|
"name": "close",
|
|
925
|
-
"size": "inherit"
|
|
988
|
+
"size": "inherit",
|
|
989
|
+
"key": "close"
|
|
926
990
|
}, null)]), props.iconPosition === "right" && createVNode("div", {
|
|
927
991
|
"class": "devui-search__icon",
|
|
928
992
|
"onClick": onClickHandle
|
|
929
993
|
}, [createVNode(resolveComponent("d-icon"), {
|
|
930
994
|
"name": "search",
|
|
931
|
-
"size": "inherit"
|
|
995
|
+
"size": "inherit",
|
|
996
|
+
"key": "search"
|
|
932
997
|
}, null)])]);
|
|
933
998
|
};
|
|
934
999
|
}
|
|
935
1000
|
});
|
|
1001
|
+
const tooltipProps = {
|
|
1002
|
+
position: {
|
|
1003
|
+
type: String,
|
|
1004
|
+
default: "top"
|
|
1005
|
+
},
|
|
1006
|
+
showAnimation: {
|
|
1007
|
+
type: Boolean,
|
|
1008
|
+
default: true
|
|
1009
|
+
},
|
|
1010
|
+
content: {
|
|
1011
|
+
type: String
|
|
1012
|
+
},
|
|
1013
|
+
mouseLeaveDelay: {
|
|
1014
|
+
type: String,
|
|
1015
|
+
default: "150"
|
|
1016
|
+
},
|
|
1017
|
+
mouseEnterDelay: {
|
|
1018
|
+
type: String,
|
|
1019
|
+
default: "100"
|
|
1020
|
+
}
|
|
1021
|
+
};
|
|
1022
|
+
const EventListener = {
|
|
1023
|
+
listen: function(target, eventType, callback) {
|
|
1024
|
+
if (target.addEventListener) {
|
|
1025
|
+
target.addEventListener(eventType, callback, false);
|
|
1026
|
+
return {
|
|
1027
|
+
remove() {
|
|
1028
|
+
target.removeEventListener(target, callback, false);
|
|
1029
|
+
}
|
|
1030
|
+
};
|
|
1031
|
+
} else {
|
|
1032
|
+
target.attchEvent(eventType, callback);
|
|
1033
|
+
return {
|
|
1034
|
+
remove() {
|
|
1035
|
+
target.detachEvent(eventType, callback);
|
|
1036
|
+
}
|
|
1037
|
+
};
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
};
|
|
1041
|
+
var tooltip = "";
|
|
1042
|
+
var DTooltip = defineComponent({
|
|
1043
|
+
name: "DTooltip",
|
|
1044
|
+
props: tooltipProps,
|
|
1045
|
+
setup(props, ctx) {
|
|
1046
|
+
const position = reactive({
|
|
1047
|
+
left: 0,
|
|
1048
|
+
top: 0
|
|
1049
|
+
});
|
|
1050
|
+
const show = ref(false);
|
|
1051
|
+
const slotElement = ref(null);
|
|
1052
|
+
const tooltip2 = ref(null);
|
|
1053
|
+
const arrow = ref(null);
|
|
1054
|
+
const tooltipcontent = ref(null);
|
|
1055
|
+
let enterEvent;
|
|
1056
|
+
let leaveEvent;
|
|
1057
|
+
const arrowStyle = (attr, value) => {
|
|
1058
|
+
arrow.value.style[attr] = value;
|
|
1059
|
+
};
|
|
1060
|
+
const delayShowTrue = function(fn, delay = props.mouseEnterDelay) {
|
|
1061
|
+
let start;
|
|
1062
|
+
if (parseInt(delay) >= 0) {
|
|
1063
|
+
return function() {
|
|
1064
|
+
if (start) {
|
|
1065
|
+
clearTimeout(start);
|
|
1066
|
+
}
|
|
1067
|
+
start = setTimeout(fn, parseInt(delay));
|
|
1068
|
+
};
|
|
1069
|
+
} else {
|
|
1070
|
+
console.error("the value of delay is bigger than 0 and the type of delay must be string!");
|
|
1071
|
+
return;
|
|
1072
|
+
}
|
|
1073
|
+
};
|
|
1074
|
+
onMounted(() => {
|
|
1075
|
+
if (!show.value) {
|
|
1076
|
+
tooltip2.value.style.opacity = "0";
|
|
1077
|
+
}
|
|
1078
|
+
enterEvent = EventListener.listen(slotElement.value.children[0], "mouseenter", delayShowTrue(function() {
|
|
1079
|
+
show.value = true;
|
|
1080
|
+
}, props.mouseEnterDelay));
|
|
1081
|
+
leaveEvent = EventListener.listen(slotElement.value.children[0], "mouseleave", function() {
|
|
1082
|
+
if (show.value) {
|
|
1083
|
+
setTimeout(function() {
|
|
1084
|
+
show.value = false;
|
|
1085
|
+
}, props.mouseLeaveDelay);
|
|
1086
|
+
}
|
|
1087
|
+
});
|
|
1088
|
+
});
|
|
1089
|
+
watch(show, function(newValue, oldValue) {
|
|
1090
|
+
if (newValue) {
|
|
1091
|
+
tooltip2.value.style.opacity = "1";
|
|
1092
|
+
tooltip2.value.style.zIndex = "999";
|
|
1093
|
+
arrow.value.style.border = "5px solid transparent";
|
|
1094
|
+
switch (props.position) {
|
|
1095
|
+
case "top":
|
|
1096
|
+
position.left = slotElement.value.children[0].offsetLeft - tooltip2.value.offsetWidth / 2 + slotElement.value.children[0].offsetWidth / 2 - 5;
|
|
1097
|
+
position.top = slotElement.value.children[0].offsetTop - 10 - tooltipcontent.value.offsetHeight;
|
|
1098
|
+
arrowStyle("borderTop", "5px solid rgb(70, 77, 110)");
|
|
1099
|
+
arrow.value.style.top = `${tooltipcontent.value.offsetHeight}px`;
|
|
1100
|
+
arrow.value.style.left = `${tooltipcontent.value.offsetWidth / 2 + 5}px`;
|
|
1101
|
+
break;
|
|
1102
|
+
case "right":
|
|
1103
|
+
position.left = slotElement.value.children[0].offsetLeft + slotElement.value.children[0].offsetWidth;
|
|
1104
|
+
position.top = slotElement.value.children[0].offsetTop + slotElement.value.children[0].offsetHeight / 2 - tooltipcontent.value.offsetHeight / 2;
|
|
1105
|
+
arrowStyle("borderRight", "5px solid rgb(70, 77, 110)");
|
|
1106
|
+
arrow.value.style.top = `${tooltipcontent.value.offsetHeight / 2 - 5}px`;
|
|
1107
|
+
arrow.value.style.left = "-0px";
|
|
1108
|
+
break;
|
|
1109
|
+
case "bottom":
|
|
1110
|
+
position.top = slotElement.value.children[0].offsetHeight + slotElement.value.children[0].offsetTop + 10;
|
|
1111
|
+
position.left = slotElement.value.children[0].offsetLeft + slotElement.value.children[0].offsetWidth / 2 - tooltipcontent.value.offsetWidth / 2 - 5;
|
|
1112
|
+
arrowStyle("borderBottom", "5px solid rgb(70, 77, 110)");
|
|
1113
|
+
arrow.value.style.top = "-10px";
|
|
1114
|
+
arrow.value.style.left = `${tooltipcontent.value.offsetWidth / 2 + 5}px`;
|
|
1115
|
+
break;
|
|
1116
|
+
case "left":
|
|
1117
|
+
position.top = slotElement.value.children[0].offsetTop + slotElement.value.children[0].offsetHeight / 2 - tooltipcontent.value.offsetHeight / 2;
|
|
1118
|
+
position.left = slotElement.value.children[0].offsetLeft - 20 - tooltipcontent.value.offsetWidth;
|
|
1119
|
+
arrowStyle("borderLeft", "5px solid rgb(70, 77, 110)");
|
|
1120
|
+
arrow.value.style.left = `${tooltipcontent.value.offsetWidth + 10}px`;
|
|
1121
|
+
arrow.value.style.top = `${tooltipcontent.value.offsetHeight / 2 - 5}px`;
|
|
1122
|
+
break;
|
|
1123
|
+
default:
|
|
1124
|
+
console.error("The attribute position value is wrong, the value is one of top\u3001right\u3001left\u3001bottom");
|
|
1125
|
+
break;
|
|
1126
|
+
}
|
|
1127
|
+
tooltip2.value.style.top = position.top + "px";
|
|
1128
|
+
tooltip2.value.style.left = position.left + "px";
|
|
1129
|
+
} else {
|
|
1130
|
+
position.top = 0;
|
|
1131
|
+
position.left = 0;
|
|
1132
|
+
tooltip2.value.style.opacity = "0";
|
|
1133
|
+
}
|
|
1134
|
+
});
|
|
1135
|
+
onBeforeUnmount(() => {
|
|
1136
|
+
enterEvent.remove();
|
|
1137
|
+
leaveEvent.remove();
|
|
1138
|
+
});
|
|
1139
|
+
return () => {
|
|
1140
|
+
const defaultSlot = renderSlot(useSlots(), "default");
|
|
1141
|
+
return createVNode("div", {
|
|
1142
|
+
"class": "devui-tooltip"
|
|
1143
|
+
}, [createVNode("div", {
|
|
1144
|
+
"class": "slotElement",
|
|
1145
|
+
"ref": slotElement
|
|
1146
|
+
}, [defaultSlot]), createVNode("div", {
|
|
1147
|
+
"class": "tooltip",
|
|
1148
|
+
"ref": tooltip2
|
|
1149
|
+
}, [createVNode("div", {
|
|
1150
|
+
"class": "arrow",
|
|
1151
|
+
"ref": arrow
|
|
1152
|
+
}, null), createVNode("div", {
|
|
1153
|
+
"class": "tooltipcontent",
|
|
1154
|
+
"ref": tooltipcontent
|
|
1155
|
+
}, [props.content])])]);
|
|
1156
|
+
};
|
|
1157
|
+
}
|
|
1158
|
+
});
|
|
936
1159
|
function _isSlot(s) {
|
|
937
1160
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
938
1161
|
}
|
|
@@ -941,19 +1164,36 @@ var DTransferBase = defineComponent({
|
|
|
941
1164
|
components: {
|
|
942
1165
|
DSearch,
|
|
943
1166
|
DCheckboxGroup,
|
|
944
|
-
DCheckbox
|
|
1167
|
+
DCheckbox,
|
|
1168
|
+
DTooltip
|
|
945
1169
|
},
|
|
946
1170
|
props: transferBaseProps,
|
|
947
1171
|
setup(props, ctx) {
|
|
948
1172
|
const modelValues = computed(() => props.checkedValues);
|
|
949
|
-
const searchQuery = computed(() => props.
|
|
1173
|
+
const searchQuery = computed(() => props.filter);
|
|
950
1174
|
const baseClass = TransferBaseClass(props);
|
|
951
1175
|
const updateSearchQuery = (val) => ctx.emit("changeQuery", val);
|
|
1176
|
+
const renderCheckbox = (props2, key, showTooltip = false, tooltipPosition = "top") => {
|
|
1177
|
+
const checkbox2 = createVNode(DCheckbox, {
|
|
1178
|
+
"class": "devui-transfer-panel-body-list-item",
|
|
1179
|
+
"label": props2.key,
|
|
1180
|
+
"value": props2.value,
|
|
1181
|
+
"disabled": props2.disabled,
|
|
1182
|
+
"key": key
|
|
1183
|
+
}, null);
|
|
1184
|
+
return !showTooltip ? checkbox2 : createVNode(DTooltip, {
|
|
1185
|
+
"position": tooltipPosition,
|
|
1186
|
+
"content": props2.key
|
|
1187
|
+
}, _isSlot(checkbox2) ? checkbox2 : {
|
|
1188
|
+
default: () => [checkbox2]
|
|
1189
|
+
});
|
|
1190
|
+
};
|
|
952
1191
|
return {
|
|
953
1192
|
baseClass,
|
|
954
1193
|
searchQuery,
|
|
955
1194
|
modelValues,
|
|
956
|
-
updateSearchQuery
|
|
1195
|
+
updateSearchQuery,
|
|
1196
|
+
renderCheckbox
|
|
957
1197
|
};
|
|
958
1198
|
},
|
|
959
1199
|
render() {
|
|
@@ -968,7 +1208,11 @@ var DTransferBase = defineComponent({
|
|
|
968
1208
|
updateSearchQuery,
|
|
969
1209
|
search: search2,
|
|
970
1210
|
searchQuery,
|
|
971
|
-
modelValues
|
|
1211
|
+
modelValues,
|
|
1212
|
+
height,
|
|
1213
|
+
showTooltip,
|
|
1214
|
+
tooltipPosition,
|
|
1215
|
+
renderCheckbox
|
|
972
1216
|
} = this;
|
|
973
1217
|
return createVNode("div", {
|
|
974
1218
|
"class": baseClass
|
|
@@ -993,19 +1237,13 @@ var DTransferBase = defineComponent({
|
|
|
993
1237
|
}, null)]), createVNode("div", {
|
|
994
1238
|
"class": "devui-transfer-panel-body-list",
|
|
995
1239
|
"style": {
|
|
996
|
-
height
|
|
1240
|
+
height
|
|
997
1241
|
}
|
|
998
1242
|
}, [sourceOption.length ? createVNode(DCheckboxGroup, {
|
|
999
1243
|
"modelValue": modelValues,
|
|
1000
1244
|
"onChange": (values) => this.$emit("updateCheckeds", values)
|
|
1001
1245
|
}, _isSlot(_slot = sourceOption.map((item, idx) => {
|
|
1002
|
-
return
|
|
1003
|
-
"class": "devui-transfer-panel-body-list-item",
|
|
1004
|
-
"label": item.key,
|
|
1005
|
-
"value": item.value,
|
|
1006
|
-
"disabled": item.disabled,
|
|
1007
|
-
"key": idx
|
|
1008
|
-
}, null);
|
|
1246
|
+
return renderCheckbox(item, idx, showTooltip, tooltipPosition);
|
|
1009
1247
|
})) ? _slot : {
|
|
1010
1248
|
default: () => [_slot]
|
|
1011
1249
|
}) : createVNode("div", {
|
|
@@ -1043,11 +1281,12 @@ var Icon = defineComponent({
|
|
|
1043
1281
|
color,
|
|
1044
1282
|
classPrefix
|
|
1045
1283
|
} = this;
|
|
1046
|
-
return
|
|
1284
|
+
return /^((https?):)?\/\//.test(name) ? createVNode("img", {
|
|
1047
1285
|
"src": name,
|
|
1048
1286
|
"alt": name.split("/")[name.split("/").length - 1],
|
|
1049
1287
|
"style": {
|
|
1050
|
-
width: size
|
|
1288
|
+
width: size,
|
|
1289
|
+
verticalAlign: "text-bottom"
|
|
1051
1290
|
}
|
|
1052
1291
|
}, null) : createVNode("i", {
|
|
1053
1292
|
"class": `${classPrefix} ${classPrefix}-${name}`,
|
|
@@ -1055,18 +1294,214 @@ var Icon = defineComponent({
|
|
|
1055
1294
|
fontSize: size,
|
|
1056
1295
|
color
|
|
1057
1296
|
}
|
|
1058
|
-
}, null)
|
|
1297
|
+
}, null);
|
|
1059
1298
|
}
|
|
1060
1299
|
});
|
|
1061
1300
|
Icon.install = function(app) {
|
|
1062
1301
|
app.component(Icon.name, Icon);
|
|
1063
1302
|
};
|
|
1303
|
+
class View {
|
|
1304
|
+
constructor() {
|
|
1305
|
+
__publicField(this, "top", "50%");
|
|
1306
|
+
__publicField(this, "left", "50%");
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
const componentProps = {
|
|
1310
|
+
message: String,
|
|
1311
|
+
backdrop: Boolean,
|
|
1312
|
+
view: {
|
|
1313
|
+
type: Object,
|
|
1314
|
+
default: () => new View()
|
|
1315
|
+
},
|
|
1316
|
+
zIndex: Number,
|
|
1317
|
+
isFull: {
|
|
1318
|
+
type: Boolean,
|
|
1319
|
+
default: false
|
|
1320
|
+
}
|
|
1321
|
+
};
|
|
1322
|
+
class LoadingProps {
|
|
1323
|
+
constructor() {
|
|
1324
|
+
__publicField(this, "target");
|
|
1325
|
+
__publicField(this, "message");
|
|
1326
|
+
__publicField(this, "loadingTemplateRef");
|
|
1327
|
+
__publicField(this, "backdrop", true);
|
|
1328
|
+
__publicField(this, "positionType", "relative");
|
|
1329
|
+
__publicField(this, "view", new View());
|
|
1330
|
+
__publicField(this, "zIndex");
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
var loading = "";
|
|
1334
|
+
var Loading = defineComponent({
|
|
1335
|
+
name: "DLoading",
|
|
1336
|
+
inheritAttrs: false,
|
|
1337
|
+
props: componentProps,
|
|
1338
|
+
setup(props) {
|
|
1339
|
+
const style = {
|
|
1340
|
+
top: props.view.top,
|
|
1341
|
+
left: props.view.left,
|
|
1342
|
+
zIndex: props.zIndex
|
|
1343
|
+
};
|
|
1344
|
+
if (!props.message) {
|
|
1345
|
+
style.background = "none";
|
|
1346
|
+
}
|
|
1347
|
+
const isShow = ref(false);
|
|
1348
|
+
const open = () => {
|
|
1349
|
+
isShow.value = true;
|
|
1350
|
+
};
|
|
1351
|
+
const close = () => {
|
|
1352
|
+
isShow.value = false;
|
|
1353
|
+
};
|
|
1354
|
+
return {
|
|
1355
|
+
style,
|
|
1356
|
+
isShow,
|
|
1357
|
+
open,
|
|
1358
|
+
close
|
|
1359
|
+
};
|
|
1360
|
+
},
|
|
1361
|
+
render() {
|
|
1362
|
+
var _a;
|
|
1363
|
+
const {
|
|
1364
|
+
isShow,
|
|
1365
|
+
isFull,
|
|
1366
|
+
backdrop,
|
|
1367
|
+
style,
|
|
1368
|
+
message,
|
|
1369
|
+
$slots
|
|
1370
|
+
} = this;
|
|
1371
|
+
return isShow && createVNode("div", {
|
|
1372
|
+
"class": ["devui-loading-contanier", isFull ? "devui-loading--full" : ""]
|
|
1373
|
+
}, [((_a = $slots.default) == null ? void 0 : _a.call($slots)) || createVNode("div", {
|
|
1374
|
+
"class": "devui-loading-wrapper"
|
|
1375
|
+
}, [backdrop ? createVNode("div", {
|
|
1376
|
+
"class": "devui-loading-mask"
|
|
1377
|
+
}, null) : null, createVNode("div", {
|
|
1378
|
+
"style": style,
|
|
1379
|
+
"class": "devui-loading-area"
|
|
1380
|
+
}, [createVNode("div", {
|
|
1381
|
+
"class": "devui-busy-default-spinner"
|
|
1382
|
+
}, [createVNode("div", {
|
|
1383
|
+
"class": "devui-loading-bar1"
|
|
1384
|
+
}, null), createVNode("div", {
|
|
1385
|
+
"class": "devui-loading-bar2"
|
|
1386
|
+
}, null), createVNode("div", {
|
|
1387
|
+
"class": "devui-loading-bar3"
|
|
1388
|
+
}, null), createVNode("div", {
|
|
1389
|
+
"class": "devui-loading-bar4"
|
|
1390
|
+
}, null)]), message ? createVNode("span", {
|
|
1391
|
+
"class": "devui-loading-text"
|
|
1392
|
+
}, [message]) : null])])]);
|
|
1393
|
+
}
|
|
1394
|
+
});
|
|
1395
|
+
const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
|
|
1396
|
+
function createComponent(Component, props, children = null) {
|
|
1397
|
+
const vnode = h(Component, __spreadValues({}, props), children);
|
|
1398
|
+
const container = document.createElement("div");
|
|
1399
|
+
vnode[COMPONENT_CONTAINER_SYMBOL] = container;
|
|
1400
|
+
render(vnode, container);
|
|
1401
|
+
return vnode.component;
|
|
1402
|
+
}
|
|
1403
|
+
function unmountComponent(ComponnetInstance) {
|
|
1404
|
+
render(null, ComponnetInstance == null ? void 0 : ComponnetInstance.vnode[COMPONENT_CONTAINER_SYMBOL]);
|
|
1405
|
+
}
|
|
1406
|
+
const loadingConstructor = defineComponent(Loading);
|
|
1407
|
+
const cacheInstance = new WeakSet();
|
|
1408
|
+
const isEmpty = (val) => {
|
|
1409
|
+
if (!val)
|
|
1410
|
+
return true;
|
|
1411
|
+
if (Array.isArray(val))
|
|
1412
|
+
return val.length === 0;
|
|
1413
|
+
if (val instanceof Set || val instanceof Map)
|
|
1414
|
+
return val.size === 0;
|
|
1415
|
+
if (val instanceof Promise)
|
|
1416
|
+
return false;
|
|
1417
|
+
if (typeof val === "object") {
|
|
1418
|
+
try {
|
|
1419
|
+
return Object.keys(val).length === 0;
|
|
1420
|
+
} catch (e) {
|
|
1421
|
+
return false;
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
return false;
|
|
1425
|
+
};
|
|
1426
|
+
const getType = (vari) => {
|
|
1427
|
+
return Object.prototype.toString.call(vari).slice(8, -1).toLowerCase();
|
|
1428
|
+
};
|
|
1429
|
+
const isPromise = (value) => {
|
|
1430
|
+
const type = getType(value);
|
|
1431
|
+
switch (type) {
|
|
1432
|
+
case "promise":
|
|
1433
|
+
return [value];
|
|
1434
|
+
case "array":
|
|
1435
|
+
if (value.some((val) => getType(val) !== "promise")) {
|
|
1436
|
+
console.error(new TypeError("Binding values should all be of type Promise"));
|
|
1437
|
+
return "error";
|
|
1438
|
+
}
|
|
1439
|
+
return value;
|
|
1440
|
+
default:
|
|
1441
|
+
return false;
|
|
1442
|
+
}
|
|
1443
|
+
};
|
|
1444
|
+
const unmount = (el) => {
|
|
1445
|
+
cacheInstance.delete(el);
|
|
1446
|
+
el.instance.proxy.close();
|
|
1447
|
+
unmountComponent(el.instance);
|
|
1448
|
+
};
|
|
1449
|
+
const toggleLoading = (el, binding) => {
|
|
1450
|
+
if (binding.value) {
|
|
1451
|
+
const vals = isPromise(binding.value);
|
|
1452
|
+
if (vals === "error")
|
|
1453
|
+
return;
|
|
1454
|
+
el.instance.proxy.open();
|
|
1455
|
+
el.appendChild(el.mask);
|
|
1456
|
+
cacheInstance.add(el);
|
|
1457
|
+
if (vals) {
|
|
1458
|
+
Promise.all(vals).catch((err) => {
|
|
1459
|
+
console.error(new Error("Promise handling errors"), err);
|
|
1460
|
+
}).finally(() => {
|
|
1461
|
+
unmount(el);
|
|
1462
|
+
});
|
|
1463
|
+
}
|
|
1464
|
+
} else {
|
|
1465
|
+
unmount(el);
|
|
1466
|
+
}
|
|
1467
|
+
};
|
|
1468
|
+
const removeAttribute = (el) => {
|
|
1469
|
+
el.removeAttribute("zindex");
|
|
1470
|
+
el.removeAttribute("positiontype");
|
|
1471
|
+
el.removeAttribute("backdrop");
|
|
1472
|
+
el.removeAttribute("message");
|
|
1473
|
+
el.removeAttribute("view");
|
|
1474
|
+
el.removeAttribute("loadingtemplateref");
|
|
1475
|
+
};
|
|
1476
|
+
const handleProps = (el, vprops) => {
|
|
1477
|
+
const props = __spreadValues(__spreadValues({}, new LoadingProps()), vprops);
|
|
1478
|
+
const loadingTemplateRef = props.loadingTemplateRef;
|
|
1479
|
+
const loadingInstance = createComponent(loadingConstructor, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
|
|
1480
|
+
el.style.position = props.positionType;
|
|
1481
|
+
el.options = props;
|
|
1482
|
+
el.instance = loadingInstance;
|
|
1483
|
+
el.mask = loadingInstance.proxy.$el;
|
|
1484
|
+
};
|
|
1485
|
+
const loadingDirective = {
|
|
1486
|
+
mounted: function(el, binding, vnode) {
|
|
1487
|
+
handleProps(el, vnode.props);
|
|
1488
|
+
removeAttribute(el);
|
|
1489
|
+
!isEmpty(binding.value) && toggleLoading(el, binding);
|
|
1490
|
+
},
|
|
1491
|
+
updated: function(el, binding, vnode) {
|
|
1492
|
+
if (!isEmpty(binding.value) && cacheInstance.has(el) || isEmpty(binding.value) && !cacheInstance.has(el))
|
|
1493
|
+
return;
|
|
1494
|
+
!cacheInstance.has(el) && handleProps(el, vnode.props);
|
|
1495
|
+
removeAttribute(el);
|
|
1496
|
+
toggleLoading(el, binding);
|
|
1497
|
+
}
|
|
1498
|
+
};
|
|
1064
1499
|
const buttonProps = {
|
|
1065
1500
|
type: {
|
|
1066
1501
|
type: String,
|
|
1067
1502
|
default: "button"
|
|
1068
1503
|
},
|
|
1069
|
-
|
|
1504
|
+
variant: {
|
|
1070
1505
|
type: String,
|
|
1071
1506
|
default: "primary"
|
|
1072
1507
|
},
|
|
@@ -1108,6 +1543,9 @@ const buttonProps = {
|
|
|
1108
1543
|
var button = "";
|
|
1109
1544
|
var DButton = defineComponent({
|
|
1110
1545
|
name: "DButton",
|
|
1546
|
+
directives: {
|
|
1547
|
+
devLoading: loadingDirective
|
|
1548
|
+
},
|
|
1111
1549
|
props: buttonProps,
|
|
1112
1550
|
setup(props, ctx) {
|
|
1113
1551
|
const buttonContent = ref(null);
|
|
@@ -1121,15 +1559,15 @@ var DButton = defineComponent({
|
|
|
1121
1559
|
const hasContent = computed(() => ctx.slots.default);
|
|
1122
1560
|
const btnClass = computed(() => {
|
|
1123
1561
|
const {
|
|
1124
|
-
|
|
1562
|
+
variant,
|
|
1125
1563
|
size,
|
|
1126
1564
|
position,
|
|
1127
1565
|
bordered,
|
|
1128
1566
|
icon
|
|
1129
1567
|
} = props;
|
|
1130
|
-
const origin = `devui-btn devui-btn-${
|
|
1568
|
+
const origin = `devui-btn devui-btn-${variant} devui-btn-${size} devui-btn-${position}`;
|
|
1131
1569
|
const borderedClass = bordered ? "bordered" : "";
|
|
1132
|
-
const btnIcon = !!icon && !hasContent.value &&
|
|
1570
|
+
const btnIcon = !!icon && !hasContent.value && variant !== "primary" ? "d-btn-icon" : "";
|
|
1133
1571
|
const btnIconWrap = !!icon ? "d-btn-icon-wrap" : "";
|
|
1134
1572
|
return `${origin} ${borderedClass} ${btnIcon} ${btnIconWrap}`;
|
|
1135
1573
|
});
|
|
@@ -1155,7 +1593,7 @@ var DButton = defineComponent({
|
|
|
1155
1593
|
} = props;
|
|
1156
1594
|
return createVNode("div", mergeProps({
|
|
1157
1595
|
"class": "devui-btn-host"
|
|
1158
|
-
}, ctx.attrs), [createVNode("button", {
|
|
1596
|
+
}, ctx.attrs), [withDirectives(createVNode("button", {
|
|
1159
1597
|
"class": btnClass.value,
|
|
1160
1598
|
"type": type,
|
|
1161
1599
|
"disabled": disabled,
|
|
@@ -1164,12 +1602,12 @@ var DButton = defineComponent({
|
|
|
1164
1602
|
},
|
|
1165
1603
|
"onClick": onClick
|
|
1166
1604
|
}, [!!icon ? createVNode(Icon, {
|
|
1167
|
-
"name":
|
|
1605
|
+
"name": icon,
|
|
1168
1606
|
"class": iconClass.value
|
|
1169
1607
|
}, null) : null, createVNode("span", {
|
|
1170
1608
|
"class": "button-content",
|
|
1171
1609
|
"ref": buttonContent
|
|
1172
|
-
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])])]);
|
|
1610
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])]), [[resolveDirective("devLoading"), showLoading]])]);
|
|
1173
1611
|
};
|
|
1174
1612
|
}
|
|
1175
1613
|
});
|
|
@@ -1250,30 +1688,52 @@ const transferProps = {
|
|
|
1250
1688
|
},
|
|
1251
1689
|
height: {
|
|
1252
1690
|
type: String,
|
|
1253
|
-
default: "320px"
|
|
1691
|
+
default: () => "320px"
|
|
1254
1692
|
},
|
|
1255
1693
|
isSearch: {
|
|
1256
1694
|
type: Boolean,
|
|
1257
|
-
default: false
|
|
1695
|
+
default: () => false
|
|
1258
1696
|
},
|
|
1259
1697
|
isSourceDroppable: {
|
|
1260
1698
|
type: Boolean,
|
|
1261
|
-
default: false
|
|
1699
|
+
default: () => false
|
|
1262
1700
|
},
|
|
1263
1701
|
isTargetDroppable: {
|
|
1264
1702
|
type: Boolean,
|
|
1265
|
-
default: false
|
|
1703
|
+
default: () => false
|
|
1266
1704
|
},
|
|
1267
1705
|
disabled: {
|
|
1268
1706
|
type: Boolean,
|
|
1269
|
-
default: false
|
|
1707
|
+
default: () => false
|
|
1270
1708
|
},
|
|
1271
|
-
|
|
1709
|
+
showTooltip: {
|
|
1272
1710
|
type: Boolean,
|
|
1273
|
-
default: false
|
|
1711
|
+
default: () => false
|
|
1712
|
+
},
|
|
1713
|
+
tooltipPosition: {
|
|
1714
|
+
type: String,
|
|
1715
|
+
default: () => "top"
|
|
1716
|
+
},
|
|
1717
|
+
beforeTransfer: {
|
|
1718
|
+
type: Function
|
|
1274
1719
|
},
|
|
1275
1720
|
slots: {
|
|
1276
1721
|
type: Object
|
|
1722
|
+
},
|
|
1723
|
+
searching: {
|
|
1724
|
+
type: Function
|
|
1725
|
+
},
|
|
1726
|
+
transferToSource: {
|
|
1727
|
+
type: Function
|
|
1728
|
+
},
|
|
1729
|
+
transferToTarget: {
|
|
1730
|
+
type: Function
|
|
1731
|
+
},
|
|
1732
|
+
transferring: {
|
|
1733
|
+
type: Function
|
|
1734
|
+
},
|
|
1735
|
+
afterTransfer: {
|
|
1736
|
+
type: Function
|
|
1277
1737
|
}
|
|
1278
1738
|
};
|
|
1279
1739
|
const headerSlot = (ctx, name) => {
|
|
@@ -1295,10 +1755,16 @@ var Transfer = defineComponent({
|
|
|
1295
1755
|
},
|
|
1296
1756
|
props: transferProps,
|
|
1297
1757
|
setup(props, ctx) {
|
|
1298
|
-
|
|
1299
|
-
|
|
1758
|
+
let leftOptions = reactive(initState(props, "source"));
|
|
1759
|
+
let rightOptions = reactive(initState(props, "target"));
|
|
1300
1760
|
const origin = ref(null);
|
|
1301
|
-
watch(() =>
|
|
1761
|
+
watch(() => props.sourceOption, () => {
|
|
1762
|
+
leftOptions = reactive(initState(props, "source"));
|
|
1763
|
+
});
|
|
1764
|
+
watch(() => props.targetOption, () => {
|
|
1765
|
+
rightOptions = reactive(initState(props, "target"));
|
|
1766
|
+
});
|
|
1767
|
+
watch(() => leftOptions.keyword, (nVal) => {
|
|
1302
1768
|
searchFilterData(leftOptions);
|
|
1303
1769
|
});
|
|
1304
1770
|
watch(() => leftOptions.checkedValues, (values) => {
|
|
@@ -1307,7 +1773,7 @@ var Transfer = defineComponent({
|
|
|
1307
1773
|
}, {
|
|
1308
1774
|
deep: true
|
|
1309
1775
|
});
|
|
1310
|
-
watch(() => rightOptions.
|
|
1776
|
+
watch(() => rightOptions.keyword, (nVal) => {
|
|
1311
1777
|
searchFilterData(rightOptions);
|
|
1312
1778
|
});
|
|
1313
1779
|
watch(() => rightOptions.checkedValues, (values) => {
|
|
@@ -1323,19 +1789,35 @@ var Transfer = defineComponent({
|
|
|
1323
1789
|
source.allChecked = value.length === source.data.filter((item) => !item.disabled).length ? true : false;
|
|
1324
1790
|
}
|
|
1325
1791
|
};
|
|
1326
|
-
const updateFilterData = (source, target) => {
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1792
|
+
const updateFilterData = async (source, target, direction) => {
|
|
1793
|
+
if (isFunction("beforeTransfer")) {
|
|
1794
|
+
const res = await props.beforeTransfer.call(null, source, target);
|
|
1795
|
+
if (typeof res === "boolean" && res === false) {
|
|
1796
|
+
return;
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
const hasToSource = isFunction("transferToSource");
|
|
1800
|
+
const hasToTarget = isFunction("transferToTarget");
|
|
1801
|
+
const hasTransfering = isFunction("transferring");
|
|
1802
|
+
if (hasToSource || hasToTarget) {
|
|
1803
|
+
direction === "right" && props.transferToSource.call(null, source, target);
|
|
1804
|
+
direction === "left" && props.transferToTarget.call(null, source, target);
|
|
1805
|
+
} else {
|
|
1806
|
+
source.data = source.data.filter((item) => {
|
|
1807
|
+
const hasInclues = source.checkedValues.includes(item.value);
|
|
1808
|
+
hasInclues && target.data.push(item);
|
|
1809
|
+
return !hasInclues;
|
|
1810
|
+
});
|
|
1811
|
+
}
|
|
1812
|
+
if (hasTransfering) {
|
|
1813
|
+
props.transferring.call(null, target);
|
|
1814
|
+
}
|
|
1334
1815
|
source.checkedValues = [];
|
|
1335
1816
|
target.disabled = !target.disabled;
|
|
1336
1817
|
searchFilterData(source, target);
|
|
1337
1818
|
searchFilterData(target, source);
|
|
1338
1819
|
setOrigin("click");
|
|
1820
|
+
isFunction("afterTransfer") && props.afterTransfer.call(null, target);
|
|
1339
1821
|
};
|
|
1340
1822
|
const changeAllSource = (source, value) => {
|
|
1341
1823
|
if (source.filterData.every((item) => item.disabled))
|
|
@@ -1357,7 +1839,7 @@ var Transfer = defineComponent({
|
|
|
1357
1839
|
setOrigin("change");
|
|
1358
1840
|
};
|
|
1359
1841
|
const searchFilterData = (source, target) => {
|
|
1360
|
-
source.filterData = source.data.filter((item) => item.key.indexOf(source.
|
|
1842
|
+
source.filterData = source.data.filter((item) => item.key.indexOf(source.keyword) !== -1);
|
|
1361
1843
|
if (target) {
|
|
1362
1844
|
target.allChecked = false;
|
|
1363
1845
|
}
|
|
@@ -1365,25 +1847,35 @@ var Transfer = defineComponent({
|
|
|
1365
1847
|
const setOrigin = (value) => {
|
|
1366
1848
|
origin.value = value;
|
|
1367
1849
|
};
|
|
1850
|
+
const changeQueryHandle = (source, direction, value) => {
|
|
1851
|
+
if ((props == null ? void 0 : props.searching) && typeof props.searching === "function") {
|
|
1852
|
+
props.searching.call(null, direction, value, source);
|
|
1853
|
+
return;
|
|
1854
|
+
}
|
|
1855
|
+
source.keyword = value;
|
|
1856
|
+
};
|
|
1857
|
+
const isFunction = (type) => {
|
|
1858
|
+
return props[type] && typeof props[type] === "function";
|
|
1859
|
+
};
|
|
1368
1860
|
return () => {
|
|
1369
1861
|
return createVNode("div", {
|
|
1370
1862
|
"class": "devui-transfer"
|
|
1371
1863
|
}, [createVNode(DTransferBase, {
|
|
1372
|
-
"style": {
|
|
1373
|
-
height: props.height
|
|
1374
|
-
},
|
|
1375
1864
|
"sourceOption": leftOptions.filterData,
|
|
1376
1865
|
"title": props.titles[0],
|
|
1377
1866
|
"type": "source",
|
|
1378
1867
|
"search": props.isSearch,
|
|
1379
1868
|
"allChecked": leftOptions.allChecked,
|
|
1380
1869
|
"checkedNum": leftOptions.checkedNum,
|
|
1381
|
-
"
|
|
1870
|
+
"filter": leftOptions.keyword,
|
|
1871
|
+
"height": props.height,
|
|
1382
1872
|
"checkedValues": leftOptions.checkedValues,
|
|
1383
1873
|
"allCount": leftOptions.data.length,
|
|
1874
|
+
"showTooltip": props.showTooltip,
|
|
1875
|
+
"tooltipPosition": props.tooltipPosition,
|
|
1384
1876
|
"onChangeAllSource": (value) => changeAllSource(leftOptions, value),
|
|
1385
1877
|
"onUpdateCheckeds": updateLeftCheckeds,
|
|
1386
|
-
"onChangeQuery": (value) => leftOptions
|
|
1878
|
+
"onChangeQuery": (value) => changeQueryHandle(leftOptions, "left", value)
|
|
1387
1879
|
}, {
|
|
1388
1880
|
header: headerSlot(ctx, "left"),
|
|
1389
1881
|
body: bodySlot(ctx, "left")
|
|
@@ -1392,29 +1884,29 @@ var Transfer = defineComponent({
|
|
|
1392
1884
|
"sourceDisabled": rightOptions.checkedNum > 0 ? false : true,
|
|
1393
1885
|
"targetDisabled": leftOptions.checkedNum > 0 ? false : true,
|
|
1394
1886
|
"onUpdateSourceData": () => {
|
|
1395
|
-
updateFilterData(rightOptions, leftOptions);
|
|
1887
|
+
updateFilterData(rightOptions, leftOptions, "left");
|
|
1396
1888
|
},
|
|
1397
1889
|
"onUpdateTargetData": () => {
|
|
1398
|
-
updateFilterData(leftOptions, rightOptions);
|
|
1890
|
+
updateFilterData(leftOptions, rightOptions, "right");
|
|
1399
1891
|
}
|
|
1400
1892
|
}, {
|
|
1401
1893
|
operation: opeartionSlot(ctx)
|
|
1402
1894
|
}), createVNode(DTransferBase, {
|
|
1403
|
-
"style": {
|
|
1404
|
-
height: props.height
|
|
1405
|
-
},
|
|
1406
1895
|
"sourceOption": rightOptions.filterData,
|
|
1407
1896
|
"title": props.titles[1],
|
|
1408
1897
|
"type": "target",
|
|
1409
1898
|
"search": props.isSearch,
|
|
1410
1899
|
"allChecked": rightOptions.allChecked,
|
|
1411
1900
|
"checkedNum": rightOptions.checkedNum,
|
|
1412
|
-
"
|
|
1901
|
+
"filter": rightOptions.keyword,
|
|
1902
|
+
"height": props.height,
|
|
1413
1903
|
"checkedValues": rightOptions.checkedValues,
|
|
1414
1904
|
"allCount": rightOptions.data.length,
|
|
1905
|
+
"showTooltip": props.showTooltip,
|
|
1906
|
+
"tooltipPosition": props.tooltipPosition,
|
|
1415
1907
|
"onChangeAllSource": (value) => changeAllSource(rightOptions, value),
|
|
1416
1908
|
"onUpdateCheckeds": updateRightCheckeds,
|
|
1417
|
-
"onChangeQuery": (value) => rightOptions
|
|
1909
|
+
"onChangeQuery": (value) => changeQueryHandle(rightOptions, "right", value)
|
|
1418
1910
|
}, {
|
|
1419
1911
|
header: headerSlot(ctx, "right"),
|
|
1420
1912
|
body: bodySlot(ctx, "right")
|