vue-devui 1.0.0-beta.9 → 1.0.0-rc.1
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 +100 -72
- package/accordion/index.es.js +525 -39
- package/accordion/index.umd.js +1 -1
- package/accordion/style.css +1 -1
- package/alert/index.es.js +34 -37
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/{time-axis → auto-complete}/index.d.ts +0 -0
- package/auto-complete/index.es.js +983 -0
- package/auto-complete/index.umd.js +1 -0
- package/auto-complete/package.json +7 -0
- package/auto-complete/style.css +1 -0
- package/back-top/index.es.js +5 -3
- package/back-top/index.umd.js +1 -1
- package/badge/index.es.js +13 -19
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/breadcrumb/index.es.js +2 -1
- package/button/index.es.js +296 -117
- package/button/index.umd.js +1 -1
- package/button/style.css +1 -1
- package/carousel/index.es.js +43 -57
- package/carousel/index.umd.js +1 -1
- package/cascader/index.es.js +5412 -784
- package/cascader/index.umd.js +27 -1
- package/cascader/style.css +1 -1
- package/checkbox/style.css +1 -1
- package/{toast → color-picker}/index.d.ts +0 -0
- package/color-picker/index.es.js +8196 -0
- package/color-picker/index.umd.js +27 -0
- package/color-picker/package.json +7 -0
- package/color-picker/style.css +1 -0
- package/comment/index.es.js +42 -13
- package/comment/index.umd.js +1 -1
- package/comment/style.css +1 -1
- package/countdown/index.es.js +27 -17
- package/countdown/index.umd.js +1 -1
- package/countdown/style.css +1 -1
- package/date-picker/index.es.js +48 -66
- package/date-picker/index.umd.js +1 -1
- package/date-picker/style.css +1 -1
- package/dragdrop/index.es.js +135 -10
- package/dragdrop/index.umd.js +1 -1
- package/drawer/index.es.js +169 -223
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +463 -300
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +293 -5660
- package/editable-select/index.umd.js +1 -27
- package/editable-select/style.css +1 -1
- package/form/index.es.js +6210 -531
- package/form/index.umd.js +27 -1
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +112 -133
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/gantt/index.es.js +6 -18
- package/gantt/index.umd.js +1 -1
- package/gantt/style.css +1 -1
- package/grid/index.es.js +1 -1
- package/grid/style.css +1 -1
- package/icon/index.es.js +39 -56
- package/icon/index.umd.js +1 -1
- package/image-preview/index.es.js +35 -16
- package/image-preview/index.umd.js +1 -1
- package/input/index.es.js +4 -5
- package/input/index.umd.js +1 -1
- package/input/style.css +1 -1
- package/input-icon/index.es.js +42 -41
- package/input-icon/index.umd.js +1 -1
- package/input-icon/style.css +1 -1
- package/input-number/index.es.js +46 -56
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/list/index.d.ts +7 -0
- package/list/index.es.js +39 -0
- package/list/index.umd.js +1 -0
- package/{toast → list}/package.json +1 -1
- package/list/style.css +1 -0
- package/loading/index.es.js +2 -2
- package/modal/index.es.js +304 -765
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/nav-sprite/index.es.js +1 -675
- package/nav-sprite/index.umd.js +1 -1
- package/notification/index.d.ts +7 -0
- package/notification/index.es.js +284 -0
- package/notification/index.umd.js +1 -0
- package/notification/package.json +7 -0
- package/notification/style.css +1 -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/AutoComplete.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/CarouselItem.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/DropdownMenu.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/IFileOptions.js +3 -0
- package/nuxt/components/IUploadOptions.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/List.js +3 -0
- package/nuxt/components/ListItem.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/Notification.js +3 -0
- package/nuxt/components/NotificationService.js +3 -0
- package/nuxt/components/Pagination.js +3 -0
- package/nuxt/components/Panel.js +3 -0
- package/nuxt/components/PanelBody.js +3 -0
- package/nuxt/components/PanelFooter.js +3 -0
- package/nuxt/components/PanelHeader.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/TimePicker.js +3 -0
- package/nuxt/components/Timeline.js +3 -0
- package/nuxt/components/TimelineItem.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/UploadStatus.js +3 -0
- package/nuxt/components/alertProps.js +3 -0
- package/nuxt/components/badgeProps.js +3 -0
- package/nuxt/components/buttonProps.js +3 -0
- package/nuxt/components/dropdownMenuProps.js +3 -0
- package/nuxt/components/fixedOverlayProps.js +3 -0
- package/nuxt/components/flexibleOverlayProps.js +3 -0
- package/nuxt/components/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +2 -0
- package/nuxt/components/notificationProps.js +3 -0
- package/nuxt/components/overlayEmits.js +3 -0
- package/nuxt/components/overlayProps.js +3 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/popoverProps.js +3 -0
- package/nuxt/components/searchProps.js +3 -0
- package/nuxt/components/tooltipProps.js +3 -0
- package/nuxt/components/uploadProps.js +3 -0
- package/nuxt/index.js +13 -0
- package/overlay/index.es.js +156 -205
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +12 -55
- package/pagination/index.es.js +11 -13
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/index.es.js +48 -35
- package/panel/index.umd.js +1 -1
- package/popover/index.es.js +5954 -189
- package/popover/index.umd.js +27 -1
- package/popover/style.css +1 -1
- package/progress/index.es.js +8 -8
- package/progress/index.umd.js +3 -3
- package/quadrant-diagram/index.es.js +5405 -166
- package/quadrant-diagram/index.umd.js +27 -1
- package/radio/index.es.js +8 -14
- package/radio/index.umd.js +1 -1
- package/radio/style.css +1 -1
- package/read-tip/index.es.js +6 -3
- package/read-tip/style.css +1 -1
- package/result/index.es.js +38 -52
- package/result/index.umd.js +1 -1
- package/ripple/index.es.js +10 -6
- package/search/index.es.js +5428 -200
- package/search/index.umd.js +27 -1
- package/search/style.css +1 -1
- package/select/index.es.js +43 -42
- package/select/index.umd.js +1 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +17 -17
- package/skeleton/index.umd.js +1 -1
- package/slider/index.es.js +4 -6
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +5896 -39
- package/splitter/index.umd.js +27 -1
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +19 -32
- package/statistic/index.umd.js +1 -1
- package/statistic/style.css +1 -1
- package/status/index.es.js +1 -4
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/steps-guide/index.es.js +6 -3
- package/sticky/index.umd.js +1 -1
- package/style.css +1 -1
- package/table/index.es.js +753 -358
- package/table/index.umd.js +1 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +3 -4
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +4 -3
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/tag-input/index.es.js +4 -14
- package/tag-input/index.umd.js +1 -1
- package/textarea/style.css +1 -1
- package/{theme → theme/theme.scss} +0 -0
- package/time-picker/index.es.js +309 -123
- package/time-picker/index.umd.js +1 -1
- package/time-picker/style.css +1 -1
- package/timeline/index.d.ts +7 -0
- package/{time-axis → timeline}/index.es.js +65 -77
- package/timeline/index.umd.js +1 -0
- package/{time-axis → timeline}/package.json +1 -1
- package/timeline/style.css +1 -0
- package/tooltip/index.es.js +5805 -141
- package/tooltip/index.umd.js +27 -1
- package/tooltip/style.css +1 -1
- package/transfer/index.es.js +6521 -630
- package/transfer/index.umd.js +27 -1
- package/transfer/style.css +1 -1
- package/tree/index.es.js +5781 -193
- package/tree/index.umd.js +27 -1
- package/tree/style.css +1 -1
- package/tree-select/index.es.js +138 -39
- package/tree-select/index.umd.js +1 -1
- package/tree-select/style.css +1 -1
- package/upload/index.es.js +450 -2669
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +14414 -14096
- package/vue-devui.umd.js +19 -19
- package/time-axis/index.umd.js +0 -1
- package/time-axis/style.css +0 -1
- package/toast/index.es.js +0 -2059
- package/toast/index.umd.js +0 -1
- package/toast/style.css +0 -1
package/time-picker/index.es.js
CHANGED
|
@@ -14,7 +14,11 @@ var __spreadValues = (a, b) => {
|
|
|
14
14
|
}
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
var __publicField = (obj, key, value) => {
|
|
18
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
19
|
+
return value;
|
|
20
|
+
};
|
|
21
|
+
import { defineComponent, toRefs, createVNode, reactive, ref, onMounted, onBeforeUnmount, onUnmounted, Fragment, h, render, computed, withDirectives, resolveDirective, watch, createTextVNode } from "vue";
|
|
18
22
|
const timePickerProps = {
|
|
19
23
|
modelValue: {
|
|
20
24
|
type: String,
|
|
@@ -53,54 +57,53 @@ const timePickerProps = {
|
|
|
53
57
|
default: true
|
|
54
58
|
}
|
|
55
59
|
};
|
|
60
|
+
const iconProps = {
|
|
61
|
+
name: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: "",
|
|
64
|
+
required: true
|
|
65
|
+
},
|
|
66
|
+
size: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: "inherit"
|
|
69
|
+
},
|
|
70
|
+
color: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: "inherit"
|
|
73
|
+
},
|
|
74
|
+
classPrefix: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: "icon"
|
|
77
|
+
}
|
|
78
|
+
};
|
|
56
79
|
var Icon = defineComponent({
|
|
57
80
|
name: "DIcon",
|
|
58
|
-
props:
|
|
59
|
-
name: {
|
|
60
|
-
type: String,
|
|
61
|
-
required: true
|
|
62
|
-
},
|
|
63
|
-
size: {
|
|
64
|
-
type: String,
|
|
65
|
-
default: "inherit"
|
|
66
|
-
},
|
|
67
|
-
color: {
|
|
68
|
-
type: String,
|
|
69
|
-
default: "inherit"
|
|
70
|
-
},
|
|
71
|
-
classPrefix: {
|
|
72
|
-
type: String,
|
|
73
|
-
default: "icon"
|
|
74
|
-
}
|
|
75
|
-
},
|
|
81
|
+
props: iconProps,
|
|
76
82
|
setup(props) {
|
|
77
|
-
return __spreadValues({}, props);
|
|
78
|
-
},
|
|
79
|
-
render() {
|
|
80
83
|
const {
|
|
81
84
|
name,
|
|
82
85
|
size,
|
|
83
86
|
color,
|
|
84
87
|
classPrefix
|
|
85
|
-
} =
|
|
86
|
-
return
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
88
|
+
} = toRefs(props);
|
|
89
|
+
return () => {
|
|
90
|
+
return /^((https?):)?\/\//.test(name.value) ? createVNode("img", {
|
|
91
|
+
"src": name.value,
|
|
92
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
93
|
+
"style": {
|
|
94
|
+
width: size.value,
|
|
95
|
+
verticalAlign: "text-bottom"
|
|
96
|
+
}
|
|
97
|
+
}, null) : createVNode("i", {
|
|
98
|
+
"class": `${classPrefix.value} ${classPrefix.value}-${name.value}`,
|
|
99
|
+
"style": {
|
|
100
|
+
fontSize: size.value,
|
|
101
|
+
color: color.value
|
|
102
|
+
}
|
|
103
|
+
}, null);
|
|
104
|
+
};
|
|
99
105
|
}
|
|
100
106
|
});
|
|
101
|
-
Icon.install = function(app) {
|
|
102
|
-
app.component(Icon.name, Icon);
|
|
103
|
-
};
|
|
104
107
|
function getPositionFun(el, left, top) {
|
|
105
108
|
const inputDom = el.getBoundingClientRect();
|
|
106
109
|
const button2 = window.innerHeight - (inputDom.top + 20);
|
|
@@ -179,8 +182,9 @@ function useTimePicker(hh, mm, ss, minTime, maxTime, format, autoOpen, disabled,
|
|
|
179
182
|
e.stopPropagation();
|
|
180
183
|
isActive.value = false;
|
|
181
184
|
showPopup.value = false;
|
|
182
|
-
if (disabled)
|
|
185
|
+
if (disabled) {
|
|
183
186
|
return;
|
|
187
|
+
}
|
|
184
188
|
const path = e.composedPath && e.composedPath() || e.path;
|
|
185
189
|
const inInputDom = path.includes(devuiTimePicker.value);
|
|
186
190
|
inInputDom && mouseInIputFun();
|
|
@@ -189,10 +193,14 @@ function useTimePicker(hh, mm, ss, minTime, maxTime, format, autoOpen, disabled,
|
|
|
189
193
|
if (firsthandActiveTime.value == "00:00:00") {
|
|
190
194
|
const vModelValueArr = value.split(":");
|
|
191
195
|
const minTimeValueArr = minTime.split(":");
|
|
196
|
+
const maxTimeValueArr = maxTime.split(":");
|
|
192
197
|
vModeValue.value == "" ? vModeValue.value = "00:00:00" : "";
|
|
193
|
-
if (
|
|
198
|
+
if (value > minTime && value < maxTime) {
|
|
194
199
|
firsthandActiveTime.value = value;
|
|
195
200
|
setInputValue(vModelValueArr[0], vModelValueArr[1], vModelValueArr[2]);
|
|
201
|
+
} else if (value > maxTime) {
|
|
202
|
+
firsthandActiveTime.value = maxTime;
|
|
203
|
+
setInputValue(maxTimeValueArr[0], maxTimeValueArr[1], maxTimeValueArr[2]);
|
|
196
204
|
} else {
|
|
197
205
|
firsthandActiveTime.value = minTime;
|
|
198
206
|
setInputValue(minTimeValueArr[0], minTimeValueArr[1], minTimeValueArr[2]);
|
|
@@ -505,7 +513,8 @@ function useTimeScroll() {
|
|
|
505
513
|
scrollThumbDom.value.style.transform = `translateY(${thumbMoveY}%)`;
|
|
506
514
|
};
|
|
507
515
|
const clickTrackFun = (e) => {
|
|
508
|
-
const
|
|
516
|
+
const offsetNum = scrollTrackDom.value.getBoundingClientRect().top - e.clientY;
|
|
517
|
+
const offset = Math.abs(offsetNum > 0 ? 0 : offsetNum);
|
|
509
518
|
const thumbCenter = scrollThumbDom.value.offsetHeight / 2;
|
|
510
519
|
const thumbPosition = (offset - thumbCenter) * 100 / scrollContentDom.value.offsetHeight;
|
|
511
520
|
scrollContentDom.value.scrollTop = thumbPosition * scrollContentDom.value.scrollHeight / 100;
|
|
@@ -526,8 +535,9 @@ function useTimeScroll() {
|
|
|
526
535
|
} else {
|
|
527
536
|
scrollTrackDom.value.style.opacity = 0;
|
|
528
537
|
}
|
|
529
|
-
if (!isDown.value)
|
|
538
|
+
if (!isDown.value) {
|
|
530
539
|
return;
|
|
540
|
+
}
|
|
531
541
|
clickTrackFun(e);
|
|
532
542
|
};
|
|
533
543
|
const getScrollWidth = () => {
|
|
@@ -718,121 +728,297 @@ var TimeList = defineComponent({
|
|
|
718
728
|
};
|
|
719
729
|
}
|
|
720
730
|
});
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
731
|
+
class View {
|
|
732
|
+
constructor() {
|
|
733
|
+
__publicField(this, "top", "50%");
|
|
734
|
+
__publicField(this, "left", "50%");
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
const componentProps = {
|
|
738
|
+
message: String,
|
|
739
|
+
backdrop: Boolean,
|
|
740
|
+
view: {
|
|
741
|
+
type: Object,
|
|
742
|
+
default: () => new View()
|
|
743
|
+
},
|
|
744
|
+
zIndex: Number,
|
|
745
|
+
isFull: {
|
|
746
|
+
type: Boolean,
|
|
747
|
+
default: false
|
|
748
|
+
}
|
|
749
|
+
};
|
|
750
|
+
class LoadingProps {
|
|
751
|
+
constructor() {
|
|
752
|
+
__publicField(this, "target");
|
|
753
|
+
__publicField(this, "message");
|
|
754
|
+
__publicField(this, "loadingTemplateRef");
|
|
755
|
+
__publicField(this, "backdrop", true);
|
|
756
|
+
__publicField(this, "positionType", "relative");
|
|
757
|
+
__publicField(this, "view", new View());
|
|
758
|
+
__publicField(this, "zIndex");
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
var loading = "";
|
|
762
|
+
var Loading = defineComponent({
|
|
763
|
+
name: "DLoading",
|
|
764
|
+
inheritAttrs: false,
|
|
765
|
+
props: componentProps,
|
|
766
|
+
setup(props) {
|
|
767
|
+
const style = {
|
|
768
|
+
top: props.view.top,
|
|
769
|
+
left: props.view.left,
|
|
770
|
+
zIndex: props.zIndex
|
|
771
|
+
};
|
|
772
|
+
if (!props.message) {
|
|
773
|
+
style.background = "none";
|
|
774
|
+
}
|
|
775
|
+
const isShow = ref(false);
|
|
776
|
+
const open = () => {
|
|
777
|
+
isShow.value = true;
|
|
778
|
+
};
|
|
779
|
+
const close = () => {
|
|
780
|
+
isShow.value = false;
|
|
781
|
+
};
|
|
782
|
+
return {
|
|
783
|
+
style,
|
|
784
|
+
isShow,
|
|
785
|
+
open,
|
|
786
|
+
close
|
|
787
|
+
};
|
|
725
788
|
},
|
|
726
|
-
|
|
789
|
+
render() {
|
|
790
|
+
var _a;
|
|
791
|
+
const {
|
|
792
|
+
isShow,
|
|
793
|
+
isFull,
|
|
794
|
+
backdrop,
|
|
795
|
+
style,
|
|
796
|
+
message,
|
|
797
|
+
$slots
|
|
798
|
+
} = this;
|
|
799
|
+
return isShow && createVNode("div", {
|
|
800
|
+
"class": ["devui-loading-contanier", isFull ? "devui-loading--full" : ""]
|
|
801
|
+
}, [((_a = $slots.default) == null ? void 0 : _a.call($slots)) || createVNode("div", {
|
|
802
|
+
"class": "devui-loading-wrapper"
|
|
803
|
+
}, [backdrop ? createVNode("div", {
|
|
804
|
+
"class": "devui-loading-mask"
|
|
805
|
+
}, null) : null, createVNode("div", {
|
|
806
|
+
"style": style,
|
|
807
|
+
"class": "devui-loading-area"
|
|
808
|
+
}, [createVNode("div", {
|
|
809
|
+
"class": "devui-busy-default-spinner"
|
|
810
|
+
}, [createVNode("div", {
|
|
811
|
+
"class": "devui-loading-bar1"
|
|
812
|
+
}, null), createVNode("div", {
|
|
813
|
+
"class": "devui-loading-bar2"
|
|
814
|
+
}, null), createVNode("div", {
|
|
815
|
+
"class": "devui-loading-bar3"
|
|
816
|
+
}, null), createVNode("div", {
|
|
817
|
+
"class": "devui-loading-bar4"
|
|
818
|
+
}, null)]), message ? createVNode("span", {
|
|
819
|
+
"class": "devui-loading-text"
|
|
820
|
+
}, [message]) : null])])]);
|
|
821
|
+
}
|
|
822
|
+
});
|
|
823
|
+
const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
|
|
824
|
+
function createComponent(Component, props, children = null) {
|
|
825
|
+
const vnode = h(Component, __spreadValues({}, props), children);
|
|
826
|
+
const container = document.createElement("div");
|
|
827
|
+
vnode[COMPONENT_CONTAINER_SYMBOL] = container;
|
|
828
|
+
render(vnode, container);
|
|
829
|
+
return vnode.component;
|
|
830
|
+
}
|
|
831
|
+
function unmountComponent(ComponnetInstance) {
|
|
832
|
+
render(null, ComponnetInstance == null ? void 0 : ComponnetInstance.vnode[COMPONENT_CONTAINER_SYMBOL]);
|
|
833
|
+
}
|
|
834
|
+
const loadingConstructor = defineComponent(Loading);
|
|
835
|
+
const cacheInstance = /* @__PURE__ */ new WeakSet();
|
|
836
|
+
const isEmpty = (val) => {
|
|
837
|
+
if (!val)
|
|
838
|
+
return true;
|
|
839
|
+
if (Array.isArray(val))
|
|
840
|
+
return val.length === 0;
|
|
841
|
+
if (val instanceof Set || val instanceof Map)
|
|
842
|
+
return val.size === 0;
|
|
843
|
+
if (val instanceof Promise)
|
|
844
|
+
return false;
|
|
845
|
+
if (typeof val === "object") {
|
|
846
|
+
try {
|
|
847
|
+
return Object.keys(val).length === 0;
|
|
848
|
+
} catch (e) {
|
|
849
|
+
return false;
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
return false;
|
|
853
|
+
};
|
|
854
|
+
const getType = (vari) => {
|
|
855
|
+
return Object.prototype.toString.call(vari).slice(8, -1).toLowerCase();
|
|
856
|
+
};
|
|
857
|
+
const isPromise = (value) => {
|
|
858
|
+
const type = getType(value);
|
|
859
|
+
switch (type) {
|
|
860
|
+
case "promise":
|
|
861
|
+
return [value];
|
|
862
|
+
case "array":
|
|
863
|
+
if (value.some((val) => getType(val) !== "promise")) {
|
|
864
|
+
console.error(new TypeError("Binding values should all be of type Promise"));
|
|
865
|
+
return "error";
|
|
866
|
+
}
|
|
867
|
+
return value;
|
|
868
|
+
default:
|
|
869
|
+
return false;
|
|
870
|
+
}
|
|
871
|
+
};
|
|
872
|
+
const unmount = (el) => {
|
|
873
|
+
cacheInstance.delete(el);
|
|
874
|
+
el.instance.proxy.close();
|
|
875
|
+
unmountComponent(el.instance);
|
|
876
|
+
};
|
|
877
|
+
const toggleLoading = (el, binding) => {
|
|
878
|
+
if (binding.value) {
|
|
879
|
+
const vals = isPromise(binding.value);
|
|
880
|
+
if (vals === "error")
|
|
881
|
+
return;
|
|
882
|
+
el.instance.proxy.open();
|
|
883
|
+
el.appendChild(el.mask);
|
|
884
|
+
cacheInstance.add(el);
|
|
885
|
+
if (vals) {
|
|
886
|
+
Promise.all(vals).catch((err) => {
|
|
887
|
+
console.error(new Error("Promise handling errors"), err);
|
|
888
|
+
}).finally(() => {
|
|
889
|
+
unmount(el);
|
|
890
|
+
});
|
|
891
|
+
}
|
|
892
|
+
} else {
|
|
893
|
+
unmount(el);
|
|
894
|
+
}
|
|
895
|
+
};
|
|
896
|
+
const removeAttribute = (el) => {
|
|
897
|
+
el.removeAttribute("zindex");
|
|
898
|
+
el.removeAttribute("positiontype");
|
|
899
|
+
el.removeAttribute("backdrop");
|
|
900
|
+
el.removeAttribute("message");
|
|
901
|
+
el.removeAttribute("view");
|
|
902
|
+
el.removeAttribute("loadingtemplateref");
|
|
903
|
+
};
|
|
904
|
+
const handleProps = (el, vprops) => {
|
|
905
|
+
const props = __spreadValues(__spreadValues({}, new LoadingProps()), vprops);
|
|
906
|
+
const loadingTemplateRef = props.loadingTemplateRef;
|
|
907
|
+
const loadingInstance = createComponent(loadingConstructor, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
|
|
908
|
+
el.style.position = props.positionType;
|
|
909
|
+
el.options = props;
|
|
910
|
+
el.instance = loadingInstance;
|
|
911
|
+
el.mask = loadingInstance.proxy.$el;
|
|
912
|
+
};
|
|
913
|
+
const loadingDirective = {
|
|
914
|
+
mounted: function(el, binding, vnode) {
|
|
915
|
+
handleProps(el, vnode.props);
|
|
916
|
+
removeAttribute(el);
|
|
917
|
+
!isEmpty(binding.value) && toggleLoading(el, binding);
|
|
918
|
+
},
|
|
919
|
+
updated: function(el, binding, vnode) {
|
|
920
|
+
if (!isEmpty(binding.value) && cacheInstance.has(el) || isEmpty(binding.value) && !cacheInstance.has(el))
|
|
921
|
+
return;
|
|
922
|
+
!cacheInstance.has(el) && handleProps(el, vnode.props);
|
|
923
|
+
removeAttribute(el);
|
|
924
|
+
toggleLoading(el, binding);
|
|
925
|
+
}
|
|
926
|
+
};
|
|
927
|
+
const buttonProps = {
|
|
928
|
+
variant: {
|
|
727
929
|
type: String,
|
|
728
|
-
default: "
|
|
930
|
+
default: "outline"
|
|
729
931
|
},
|
|
730
932
|
size: {
|
|
731
933
|
type: String,
|
|
732
934
|
default: "md"
|
|
733
935
|
},
|
|
734
|
-
|
|
735
|
-
type: String
|
|
736
|
-
default: "default"
|
|
737
|
-
},
|
|
738
|
-
bordered: {
|
|
739
|
-
type: Boolean,
|
|
740
|
-
default: false
|
|
936
|
+
color: {
|
|
937
|
+
type: String
|
|
741
938
|
},
|
|
742
939
|
icon: {
|
|
743
940
|
type: String,
|
|
744
941
|
default: ""
|
|
745
942
|
},
|
|
746
|
-
|
|
943
|
+
loading: {
|
|
747
944
|
type: Boolean,
|
|
748
945
|
default: false
|
|
749
946
|
},
|
|
750
|
-
width: {
|
|
751
|
-
type: String
|
|
752
|
-
},
|
|
753
947
|
disabled: {
|
|
754
948
|
type: Boolean,
|
|
755
949
|
default: false
|
|
756
|
-
},
|
|
757
|
-
autofocus: {
|
|
758
|
-
type: Boolean,
|
|
759
|
-
default: false
|
|
760
|
-
},
|
|
761
|
-
onClick: {
|
|
762
|
-
type: Function
|
|
763
950
|
}
|
|
764
951
|
};
|
|
952
|
+
function useButton(props, ctx) {
|
|
953
|
+
const hasContent = computed(() => ctx.slots.default);
|
|
954
|
+
const colorMap = {
|
|
955
|
+
solid: "primary",
|
|
956
|
+
outline: "secondary",
|
|
957
|
+
text: "secondary"
|
|
958
|
+
};
|
|
959
|
+
const defaultColor = colorMap[props.variant];
|
|
960
|
+
const classes = computed(() => ({
|
|
961
|
+
"devui-btn": true,
|
|
962
|
+
[`devui-btn-${props.variant}`]: true,
|
|
963
|
+
[`devui-btn-${props.variant}-${props.color || defaultColor}`]: true,
|
|
964
|
+
[`devui-btn-${props.size}`]: true,
|
|
965
|
+
"devui-btn-icon-wrap": props.icon,
|
|
966
|
+
"devui-btn-icon": props.icon && !hasContent.value && props.variant !== "solid"
|
|
967
|
+
}));
|
|
968
|
+
const iconClass = computed(() => {
|
|
969
|
+
if (!props.icon) {
|
|
970
|
+
return;
|
|
971
|
+
}
|
|
972
|
+
const origin = "devui-icon-fix icon";
|
|
973
|
+
if (hasContent.value) {
|
|
974
|
+
return `${origin} clear-right-5`;
|
|
975
|
+
} else {
|
|
976
|
+
return origin;
|
|
977
|
+
}
|
|
978
|
+
});
|
|
979
|
+
return { classes, iconClass };
|
|
980
|
+
}
|
|
765
981
|
var button = "";
|
|
766
982
|
var Button = defineComponent({
|
|
767
983
|
name: "DButton",
|
|
984
|
+
directives: {
|
|
985
|
+
devLoading: loadingDirective
|
|
986
|
+
},
|
|
768
987
|
props: buttonProps,
|
|
988
|
+
emits: ["click"],
|
|
769
989
|
setup(props, ctx) {
|
|
770
|
-
const
|
|
990
|
+
const {
|
|
991
|
+
icon,
|
|
992
|
+
disabled,
|
|
993
|
+
loading: loading2
|
|
994
|
+
} = toRefs(props);
|
|
995
|
+
const {
|
|
996
|
+
classes,
|
|
997
|
+
iconClass
|
|
998
|
+
} = useButton(props, ctx);
|
|
771
999
|
const onClick = (e) => {
|
|
772
|
-
|
|
773
|
-
if (props.showLoading) {
|
|
1000
|
+
if (loading2.value) {
|
|
774
1001
|
return;
|
|
775
1002
|
}
|
|
776
|
-
|
|
1003
|
+
ctx.emit("click", e);
|
|
777
1004
|
};
|
|
778
|
-
const hasContent = computed(() => ctx.slots.default);
|
|
779
|
-
const btnClass = computed(() => {
|
|
780
|
-
const {
|
|
781
|
-
btnStyle,
|
|
782
|
-
size,
|
|
783
|
-
position,
|
|
784
|
-
bordered,
|
|
785
|
-
icon
|
|
786
|
-
} = props;
|
|
787
|
-
const origin = `devui-btn devui-btn-${btnStyle} devui-btn-${size} devui-btn-${position}`;
|
|
788
|
-
const borderedClass = bordered ? "bordered" : "";
|
|
789
|
-
const btnIcon = !!icon && !hasContent.value && btnStyle !== "primary" ? "d-btn-icon" : "";
|
|
790
|
-
const btnIconWrap = !!icon ? "d-btn-icon-wrap" : "";
|
|
791
|
-
return `${origin} ${borderedClass} ${btnIcon} ${btnIconWrap}`;
|
|
792
|
-
});
|
|
793
|
-
const iconClass = computed(() => {
|
|
794
|
-
if (!props.icon) {
|
|
795
|
-
return;
|
|
796
|
-
}
|
|
797
|
-
const origin = "devui-icon-fix icon";
|
|
798
|
-
if (hasContent.value) {
|
|
799
|
-
return `${origin} clear-right-5`;
|
|
800
|
-
} else {
|
|
801
|
-
return origin;
|
|
802
|
-
}
|
|
803
|
-
});
|
|
804
1005
|
return () => {
|
|
805
1006
|
var _a, _b;
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
disabled,
|
|
810
|
-
showLoading,
|
|
811
|
-
width
|
|
812
|
-
} = props;
|
|
813
|
-
return createVNode("div", mergeProps({
|
|
814
|
-
"class": "devui-btn-host"
|
|
815
|
-
}, ctx.attrs), [createVNode("button", {
|
|
816
|
-
"class": btnClass.value,
|
|
817
|
-
"type": type,
|
|
818
|
-
"disabled": disabled,
|
|
819
|
-
"style": {
|
|
820
|
-
width
|
|
821
|
-
},
|
|
1007
|
+
return withDirectives(createVNode("button", {
|
|
1008
|
+
"class": classes.value,
|
|
1009
|
+
"disabled": disabled.value,
|
|
822
1010
|
"onClick": onClick
|
|
823
|
-
}, [
|
|
824
|
-
"name":
|
|
1011
|
+
}, [icon.value && createVNode(Icon, {
|
|
1012
|
+
"name": icon.value,
|
|
1013
|
+
"size": "12px",
|
|
1014
|
+
"color": "",
|
|
825
1015
|
"class": iconClass.value
|
|
826
|
-
}, null)
|
|
827
|
-
"class": "button-content"
|
|
828
|
-
|
|
829
|
-
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])])]);
|
|
1016
|
+
}, null), createVNode("span", {
|
|
1017
|
+
"class": "button-content"
|
|
1018
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])]), [[resolveDirective("dLoading"), loading2.value]]);
|
|
830
1019
|
};
|
|
831
1020
|
}
|
|
832
1021
|
});
|
|
833
|
-
Button.install = function(app) {
|
|
834
|
-
app.component(Button.name, Button);
|
|
835
|
-
};
|
|
836
1022
|
var index$1 = "";
|
|
837
1023
|
var TimePopup = defineComponent({
|
|
838
1024
|
name: "DTimePopup",
|
|
@@ -926,7 +1112,7 @@ var TimePopup = defineComponent({
|
|
|
926
1112
|
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]), createVNode("div", {
|
|
927
1113
|
"onClick": subDataFun
|
|
928
1114
|
}, [createVNode(Button, {
|
|
929
|
-
"
|
|
1115
|
+
"variant": "common"
|
|
930
1116
|
}, {
|
|
931
1117
|
default: () => [createTextVNode("\u786E\u5B9A")]
|
|
932
1118
|
})])])])]);
|
package/time-picker/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Z=Object.defineProperty;var U=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable;var Y=(N,t,k)=>t in N?Z(N,t,{enumerable:!0,configurable:!0,writable:!0,value:k}):N[t]=k,j=(N,t)=>{for(var k in t||(t={}))R.call(t,k)&&Y(N,k,t[k]);if(U)for(var k of U(t))ee.call(t,k)&&Y(N,k,t[k]);return N};(function(N,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(N=typeof globalThis!="undefined"?globalThis:N||self,t(N.index={},N.Vue))})(this,function(N,t){"use strict";const k={modelValue:{type:String,default:""},placeholder:{type:String,default:"00:00:00"},disabled:{type:Boolean,default:!1},timePickerWidth:{type:Number,default:212},minTime:{type:String,default:"00:00:00"},maxTime:{type:String,default:"23:59:59"},format:{type:String,default:"hh:mm:ss"},autoOpen:{type:Boolean,default:!1},showAnimation:{type:Boolean,default:!0}};var A=t.defineComponent({name:"DIcon",props:{name:{type:String,required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}},setup(e){return j({},e)},render(){const{name:e,size:l,color:n,classPrefix:o}=this;return/^((https?):)?\/\//.test(e)?t.createVNode("img",{src:e,alt:e.split("/")[e.split("/").length-1],style:{width:l}},null):t.createVNode("i",{class:`${o} ${o}-${e}`,style:{fontSize:l,color:n}},null)}});A.install=function(e){e.component(A.name,A)};function q(e,l,n){const o=e.getBoundingClientRect();window.innerHeight-(o.top+20)>o.top+20?(l.value=o.x,n.value=o.top+20+10):(l.value=o.x,n.value=o.top-316)}function H(e){const l=t.reactive([]);let n=0;e=="hour"?n=24:n=60;for(let o=0;o<n;o++)l.push({time:o<10?"0"+o:o+"",isActive:!1,flag:e,isDisabled:!1});return l}const _=(e,l,n,o,p,T)=>{const g=p.split(":")[0],v=p.split(":")[1],r=o.split(":")[0],u=o.split(":")[1],m=o.split(":")[2];e.map((c,i)=>{(c.time<r||c.time>g)&&(c.isDisabled=!0)}),T=="mm:ss"?l.map((c,i)=>{(c.time<u||c.time>v)&&(c.isDisabled=!0)}):l.map((c,i)=>{c.time<u&&(c.isDisabled=!0)}),n.map((c,i)=>{c.time<m&&(c.isDisabled=!0)})};function G(e,l,n,o,p,T,g,v,r){const u=t.ref(!1),m=t.ref(!1),c=t.ref(),i=t.ref(),y=t.ref(-100),d=t.ref(-100),w=t.ref(),C=t.ref(""),D=t.ref(!1),E=t.ref(`${e.value}:${l.value}:${n.value}`),S=t.ref(r),f=()=>{q(c.value,y,d)},a=h=>{if(h.stopPropagation(),u.value=!1,m.value=!1,v)return;(h.composedPath&&h.composedPath()||h.path).includes(c.value)&&s()},s=()=>{if(E.value=="00:00:00"){const h=r.split(":"),P=o.split(":");S.value==""&&(S.value="00:00:00"),S.value>o?(E.value=r,$(h[0],h[1],h[2])):(E.value=o,$(P[0],P[1],P[2]))}u.value=!0,m.value=!0},V=()=>{S.value!=""&&S.value<o?S.value=o:S.value!=""&&S.value>p&&(S.value=p);const h=S.value.split(":");S.value&&$(h[0],h[1],h[2])},b=h=>{h.stopPropagation(),m.value&&(e.value=w.value.changTimeData().activeHour.value,l.value=w.value.changTimeData().activeMinute.value,n.value=w.value.changTimeData().activeSecond.value,E.value=`${e.value}:${l.value}:${n.value}`,$(e.value,l.value,n.value))},$=(h,P,B)=>{T=="hh:mm:ss"?S.value=`${h}:${P}:${B}`:T=="mm:hh:ss"?S.value=`${P}:${h}:${B}`:T=="hh:mm"?S.value=`${h}:${P}`:T=="mm:ss"&&(S.value=`${P}:${B}`)};return{isActive:u,showPopup:m,devuiTimePicker:c,timePickerValue:C,inputDom:i,timePopupDom:w,left:y,top:d,showClearIcon:D,firsthandActiveTime:E,vModeValue:S,getPopupPosition:f,getTimeValue:b,clickVerifyFun:a,isOutOpen:()=>{if(g){const h=S.value.split(":");e.value=h[0],l.value=h[1],n.value=h[2],E.value=S.value,$(e.value,l.value,n.value),u.value=!0,m.value=g}},vModelIsBeyond:V,clearAll:h=>{if(h.stopPropagation(),m.value=!1,o!="00:00:00"){const P=o.split(":");e.value=P[0],l.value=P[1],n.value=P[2]}else e.value="00",l.value="00",n.value="00";E.value=`${e.value}:${l.value}:${n.value}`,$(e.value,l.value,n.value)},chooseTime:h=>{if(h.type)h.type.toLowerCase()=="hh"?e.value=h.time:h.type.toLowerCase()=="mm"?l.value=h.time:h.type.toLowerCase()=="ss"&&(n.value=h.time),E.value=`${e.value}:${l.value}:${n.value}`,$(e.value,l.value,n.value);else{const P=h.time.split(":");e.value=P[0],l.value=P[1],n.value=P[2],E.value=`${e.value}:${l.value}:${n.value}`,$(e.value,l.value,n.value)}}}}const J=(e,l,n,o,p,T,g)=>{const v=t.ref("00:00:00"),r=t.ref("00"),u=t.ref("00"),m=t.ref("00"),c=(f,a,s)=>{if(a.isDisabled)return!1;i(a,s),f.target.parentElement.parentElement.scrollTop=s*32},i=(f,a)=>{let s=[],V=t.ref("");if(f.flag=="hour"?(s=e,V=r,y(f)):f.flag=="minute"?(s=l,V=u,y(f)):f.flag=="second"&&(s=n,V=m),s.map((b,$)=>{b.isActive=a===$}),V.value=s[a].time,v.value=`${r.value}:${u.value}:${m.value}`,v.value<o)v.value=o,w(o);else if(T=="mm:ss"&&`${u.value}:${m.value}`>p.slice(3)){const b=o.slice(0,3)+p.slice(3);w(b)}else v.value>p&&(v.value=p,w(p))},y=f=>{let a="00",s="00";const V=o.split(":")[0],b=o.split(":")[1],$=o.split(":")[2],L=p.split(":")[0],M=p.split(":")[1],F=p.split(":")[2];f.flag=="hour"&&(f.time==V?(a=b,d(l,a,s),u.value<b&&d(n,$,s)):f.time==L?(s=M,d(l,a,s),d(n,a,F)):(d(l,a,s),d(n,a,s))),f.flag=="minute"&&T=="mm:ss"?f.time==b?(a=$,d(n,a,s)):(f.time==M&&(s=F),d(n,a,s)):f.flag=="minute"&&(r.value==V&&f.time==b?(a=$,d(n,a,s)):(r.value==L&&f.time==M&&(s=F),d(n,a,s)))},d=(f,a,s)=>{f.map(V=>{a!="00"&&V.time<a||s!="00"&&V.time>s?V.isDisabled=!0:V.isDisabled=!1})},w=f=>{const a=f.split(":"),s=o.split(":");let V=0,b=0,$=0;T=="hh:mm:ss"?(V=parseInt(a[0]),b=parseInt(a[1]),$=parseInt(a[2]),g.value.children[0].lastElementChild.children[0].scrollTop=V*32,g.value.children[1].lastElementChild.children[0].scrollTop=b*32,g.value.children[2].lastElementChild.children[0].scrollTop=$*32,r.value=a[0],u.value=a[1],m.value=a[2],D(e,a[0]),D(l,a[1]),D(n,a[2]),C(e,r.value),C(l,u.value)):T=="mm:hh:ss"?(V=parseInt(a[0]),b=parseInt(a[1]),$=parseInt(a[2]),g.value.children[0].lastElementChild.children[0].scrollTop=b*32,g.value.children[1].lastElementChild.children[0].scrollTop=V*32,g.value.children[2].lastElementChild.children[0].scrollTop=$*32,r.value=a[0],u.value=a[1],m.value=a[2],D(e,a[0]),D(l,a[1]),D(n,a[2]),C(e,r.value),C(l,u.value)):T=="hh:mm"?(V=parseInt(a[0]),b=parseInt(a[1]),g.value.children[0].lastElementChild.children[0].scrollTop=V*32,g.value.children[1].lastElementChild.children[0].scrollTop=b*32,r.value=a[0],u.value=a[1],D(e,a[0]),D(l,a[1]),C(e,r.value)):T=="mm:ss"&&(b=parseInt(a[1]),$=parseInt(a[2]),g.value.children[0].lastElementChild.children[0].scrollTop=b*32,g.value.children[1].lastElementChild.children[0].scrollTop=$*32,r.value=s[0],u.value=a[1],m.value=a[2],D(l,a[1]),D(n,a[2]),C(l,u.value))},C=(f,a)=>{f.map(s=>{s.time==a&&y(s)})},D=(f,a)=>{f.map(s=>{s.isActive=s.time===a})};return{activeTime:v,activeHour:r,activeMinute:u,activeSecond:m,activeTimeFun:c,resetTimeValue:w,getNewTime:()=>({activeTime:v,activeHour:r,activeMinute:u,activeSecond:m}),resetScrollTop:()=>{for(let f=0;f<g.value.children.length;f++)g.value.children[f].lastElementChild.children[0].scrollTop=0}}};function K(){const e=t.ref(),l=t.ref(),n=t.ref(),o=t.ref(),p=t.ref(!1),T=()=>{const i=l.value.clientHeight/l.value.scrollHeight*100;n.value.style.height=i+"%"},g=()=>{const i=l.value.scrollTop*100/l.value.clientHeight;n.value.style.transform=`translateY(${i}%)`},v=i=>{const y=Math.abs(o.value.getBoundingClientRect().top-i.clientY),d=n.value.offsetHeight/2,w=(y-d)*100/l.value.offsetHeight;l.value.scrollTop=w*l.value.scrollHeight/100,l.value.style.top=l.value.scrollTop+"px"},r=()=>{p.value=!0,o.value.style.opacity=1},u=i=>{p.value=!1,m(i)},m=i=>{(i.composedPath&&i.composedPath()||i.path).includes(e.value)||p.value?o.value.style.opacity=1:o.value.style.opacity=0,!!p.value&&v(i)};return{scrollThumbDom:n,scrollTrackDom:o,scrollContentDom:l,scrollBoxDom:e,isDown:p,getScrollHeight:T,setVirtualScroll:g,clickTrackFun:v,mouseDownThum:r,mouseOutThum:u,thumbMouseMove:m,getScrollWidth:()=>{const i=navigator.userAgent;let y=-20;if(i.indexOf("Chrome")>-1)y=-8;else{const d=document.createElement("div");d.className="devui-scrollbar-wrap",d.style.width="100px",d.style.visibility="hidden",d.style.position="absolute",d.style.top="-9999px",document.body.appendChild(d);const w=d.offsetWidth;d.style.overflow="scroll";const C=document.createElement("div");C.style.width="100%",d.appendChild(C);const D=C.offsetWidth;d.parentNode.removeChild(d),y=(w-D+3)*-1}return y}}}var te="",O=t.defineComponent({name:"DTimeScroll",props:k,setup(e,l){const{scrollBoxDom:n,scrollThumbDom:o,scrollTrackDom:p,scrollContentDom:T,isDown:g,getScrollHeight:v,setVirtualScroll:r,clickTrackFun:u,mouseDownThum:m,mouseOutThum:c,thumbMouseMove:i,getScrollWidth:y}=K(),d=y();return t.onMounted(()=>{y(),v(),n.value.addEventListener("click",r),T.value.addEventListener("scroll",r),o.value.addEventListener("mousedown",m),document.addEventListener("mouseup",c),document.addEventListener("mousemove",i)}),t.onBeforeUnmount(()=>{n.value.removeEventListener("click",r),T.value.removeEventListener("scroll",r),o.value.removeEventListener("mousedown",m)}),t.onUnmounted(()=>{document.removeEventListener("mouseup",c),document.removeEventListener("mousemove",i)}),()=>{var w,C;return t.createVNode(t.Fragment,null,[t.createVNode("div",{ref:n,class:"devui-scroll-box"},[t.createVNode("div",{ref:T,class:`box-content ${g.value||!e.showAnimation?"box-content-behavior-auto":""}`,style:{"margin-right":d+"px"}},[(C=(w=l.slots).default)==null?void 0:C.call(w)]),t.createVNode("div",{ref:p,class:"box-sroll",onClick:u},[t.createVNode("div",{ref:o,class:"scroll-child"},null)])])])}}}),le="",W=t.defineComponent({name:"DTimeList",components:{TimeScroll:O},props:{hourList:{type:Array,default:()=>[]},minuteList:{type:Array,default:()=>[]},secondList:{type:Array,default:()=>[]},format:{type:String,default:"hh:mm:ss"},minTime:{type:String,default:"00:00:00"},maxTime:{type:String,default:"23:59:59"}},setup(e,l){const n=t.ref(),{getNewTime:o,activeTimeFun:p,resetTimeValue:T,resetScrollTop:g}=J(e.hourList,e.minuteList,e.secondList,e.minTime,e.maxTime,e.format,n),v=c=>{T(c)},r=c=>c.map((i,y)=>t.createVNode("li",{class:`time-li ${i.flag}Id-${y} ${i.isActive?"active-li":""} ${i.isDisabled?"disabled-li":""}`,onClick:d=>{p(d,i,y)}},[t.createVNode("span",null,[i.time])])),u=c=>t.createVNode("div",{class:"time-item",style:{flex:1}},[t.createVNode(O,null,{default:()=>[t.createVNode("ul",{class:"time-ul"},[r(c)])]})]),m=()=>{const c={hh:e.hourList,mm:e.minuteList,ss:e.secondList};return e.format.split(":").map(y=>u(c[y]))};return l.expose({resetScrollTop:g,setOutoTime:v,getNewTime:o}),()=>t.createVNode("div",{class:"devui-time-list",ref:n},[m()])}});const Q={type:{type:String,default:"button"},btnStyle:{type:String,default:"primary"},size:{type:String,default:"md"},position:{type:String,default:"default"},bordered:{type:Boolean,default:!1},icon:{type:String,default:""},showLoading:{type:Boolean,default:!1},width:{type:String},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},onClick:{type:Function}};var ae="",x=t.defineComponent({name:"DButton",props:Q,setup(e,l){const n=t.ref(null),o=v=>{var r;e.showLoading||(r=e.onClick)==null||r.call(e,v)},p=t.computed(()=>l.slots.default),T=t.computed(()=>{const{btnStyle:v,size:r,position:u,bordered:m,icon:c}=e,i=`devui-btn devui-btn-${v} devui-btn-${r} devui-btn-${u}`,y=m?"bordered":"",d=!!c&&!p.value&&v!=="primary"?"d-btn-icon":"";return`${i} ${y} ${d} ${c?"d-btn-icon-wrap":""}`}),g=t.computed(()=>{if(!e.icon)return;const v="devui-icon-fix icon";return p.value?`${v} clear-right-5`:v});return()=>{var i,y;const{icon:v,type:r,disabled:u,showLoading:m,width:c}=e;return t.createVNode("div",t.mergeProps({class:"devui-btn-host"},l.attrs),[t.createVNode("button",{class:T.value,type:r,disabled:u,style:{width:c},onClick:o},[v?t.createVNode(A,{name:e.icon,class:g.value},null):null,t.createVNode("span",{class:"button-content",ref:n},[(y=(i=l.slots).default)==null?void 0:y.call(i)])])])}}});x.install=function(e){e.component(x.name,x)};var ne="",z=t.defineComponent({name:"DTimePopup",components:{TimeList:W,Button:x},props:{showPopup:{type:Boolean,default:!1},popupTop:{type:Number,default:-100},popupLeft:{type:Number,default:-100},popupWidth:{type:Number,default:300},popupFormat:{type:String,default:"hh:mm:ss"},minTime:{type:String,default:"00:00:00"},maxTime:{type:String,default:"23:59:59"},bindData:{type:String,default:"00:00:00"}},emits:["subData"],setup(e,l){const n=t.ref(),o=t.ref(),p=H("hour"),T=H("minute"),g=H("second");t.onMounted(()=>{_(p,T,g,e.minTime,e.maxTime,e.popupFormat)}),t.watch(()=>[e.showPopup,e.bindData],([u,m],[c,i])=>{u||m!=i?o.value.setOutoTime(m):o.value.resetScrollTop()});const v=()=>o.value.getNewTime(),r=u=>{u.stopPropagation(),l.emit("subData")};return l.expose({changTimeData:v}),()=>{var u,m;return t.createVNode(t.Fragment,null,[t.createVNode("div",{ref:n,class:`devui-time-popup ${e.showPopup?"devui-show-time-popup":""}`,style:{width:e.popupWidth+"px",top:e.popupTop+"px",left:e.popupLeft+"px"}},[t.createVNode(W,{ref:o,hourList:p,minuteList:T,secondList:g,minTime:e.minTime,maxTime:e.maxTime,format:e.popupFormat},null),t.createVNode("div",{class:"devui-time-popup-btn"},[t.createVNode("div",{class:"popup-slots"},[(m=(u=l.slots).default)==null?void 0:m.call(u)]),t.createVNode("div",{onClick:r},[t.createVNode(x,{btnStyle:"common"},{default:()=>[t.createTextVNode("\u786E\u5B9A")]})])])])])}}}),oe="",I=t.defineComponent({name:"DTimePicker",components:{TimePopup:z},props:k,emits:["selectedTimeChage","update:modelValue"],setup(e,l){const n=t.ref("00"),o=t.ref("00"),p=t.ref("00"),T=e.format.toLowerCase(),{isActive:g,showPopup:v,devuiTimePicker:r,inputDom:u,left:m,top:c,showClearIcon:i,firsthandActiveTime:y,chooseTime:d,getTimeValue:w,clickVerifyFun:C,isOutOpen:D,vModelIsBeyond:E,clearAll:S,timePopupDom:f,vModeValue:a,getPopupPosition:s}=G(n,o,p,e.minTime,e.maxTime,T,e.autoOpen,e.disabled,e.modelValue),V=b=>{g.value=!1,v.value=!1,l.emit("selectedTimeChage",a.value)};return t.onMounted(()=>{s(),D(),E(),document.addEventListener("click",C),document.addEventListener("click",w),document.addEventListener("scroll",s),window.addEventListener("resize",s)}),t.onUnmounted(()=>{document.removeEventListener("click",C),document.removeEventListener("click",w),document.removeEventListener("scroll",s),window.removeEventListener("resize",s)}),t.watch(a,b=>{l.emit("update:modelValue",a.value),b!=e.minTime&&b!="00:00"?i.value=!0:i.value=!1}),l.expose({clearAll:S,chooseTime:d}),()=>t.createVNode(t.Fragment,null,[t.createVNode("div",{class:`devui-time-picker ${g.value?"time-picker-active":""} ${e.disabled?"picker-disabled":""}`,ref:r},[t.createVNode(z,{ref:f,showPopup:v.value,popupTop:c.value,popupLeft:m.value,popupWidth:e.timePickerWidth,popupFormat:e.format.toLowerCase(),minTime:e.minTime,maxTime:e.maxTime,bindData:y.value,onSubData:V},{default:()=>{var b,$;return[($=(b=l.slots).customViewTemplate)==null?void 0:$.call(b)]}}),t.createVNode("input",{ref:u,type:"text",value:a.value,placeholder:`${e.placeholder}`,disabled:e.disabled,class:"time-input"},null),t.createVNode("div",{class:"time-input-icon"},[t.createVNode("div",{onClick:S},[i.value?t.createVNode(A,{size:"small",name:"close"},null):""]),t.createVNode("div",null,[t.createVNode(A,{size:"small",name:"time"},null)])])])])}});I.install=function(e){e.component(I.name,I)};var X={title:"TimePicker \u65F6\u95F4\u9009\u62E9\u5668",category:"\u6570\u636E\u5F55\u5165",status:"90%",install(e){e.use(I)}};N.TimePicker=I,N.default=X,Object.defineProperty(N,"__esModule",{value:!0}),N[Symbol.toStringTag]="Module"});
|
|
1
|
+
var ye=Object.defineProperty;var ee=Object.getOwnPropertySymbols;var Te=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable;var j=(P,t,A)=>t in P?ye(P,t,{enumerable:!0,configurable:!0,writable:!0,value:A}):P[t]=A,F=(P,t)=>{for(var A in t||(t={}))Te.call(t,A)&&j(P,A,t[A]);if(ee)for(var A of ee(t))be.call(t,A)&&j(P,A,t[A]);return P};var E=(P,t,A)=>(j(P,typeof t!="symbol"?t+"":t,A),A);(function(P,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(P=typeof globalThis!="undefined"?globalThis:P||self,t(P.index={},P.Vue))})(this,function(P,t){"use strict";const A={modelValue:{type:String,default:""},placeholder:{type:String,default:"00:00:00"},disabled:{type:Boolean,default:!1},timePickerWidth:{type:Number,default:212},minTime:{type:String,default:"00:00:00"},maxTime:{type:String,default:"23:59:59"},format:{type:String,default:"hh:mm:ss"},autoOpen:{type:Boolean,default:!1},showAnimation:{type:Boolean,default:!0}},te={name:{type:String,default:"",required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}};var L=t.defineComponent({name:"DIcon",props:te,setup(e){const{name:l,size:a,color:o,classPrefix:i}=t.toRefs(e);return()=>/^((https?):)?\/\//.test(l.value)?t.createVNode("img",{src:l.value,alt:l.value.split("/")[l.value.split("/").length-1],style:{width:a.value,verticalAlign:"text-bottom"}},null):t.createVNode("i",{class:`${i.value} ${i.value}-${l.value}`,style:{fontSize:a.value,color:o.value}},null)}});function le(e,l,a){const o=e.getBoundingClientRect();window.innerHeight-(o.top+20)>o.top+20?(l.value=o.x,a.value=o.top+20+10):(l.value=o.x,a.value=o.top-316)}function z(e){const l=t.reactive([]);let a=0;e=="hour"?a=24:a=60;for(let o=0;o<a;o++)l.push({time:o<10?"0"+o:o+"",isActive:!1,flag:e,isDisabled:!1});return l}const ae=(e,l,a,o,i,m)=>{const d=i.split(":")[0],y=i.split(":")[1],r=o.split(":")[0],c=o.split(":")[1],f=o.split(":")[2];e.map((v,u)=>{(v.time<r||v.time>d)&&(v.isDisabled=!0)}),m=="mm:ss"?l.map((v,u)=>{(v.time<c||v.time>y)&&(v.isDisabled=!0)}):l.map((v,u)=>{v.time<c&&(v.isDisabled=!0)}),a.map((v,u)=>{v.time<f&&(v.isDisabled=!0)})};function oe(e,l,a,o,i,m,d,y,r){const c=t.ref(!1),f=t.ref(!1),v=t.ref(),u=t.ref(),V=t.ref(-100),p=t.ref(-100),C=t.ref(),S=t.ref(""),k=t.ref(!1),D=t.ref(`${e.value}:${l.value}:${a.value}`),N=t.ref(r),h=()=>{le(v.value,V,p)},n=g=>{if(g.stopPropagation(),c.value=!1,f.value=!1,y)return;(g.composedPath&&g.composedPath()||g.path).includes(v.value)&&s()},s=()=>{if(D.value=="00:00:00"){const g=r.split(":"),$=o.split(":"),x=i.split(":");N.value==""&&(N.value="00:00:00"),r>o&&r<i?(D.value=r,b(g[0],g[1],g[2])):r>i?(D.value=i,b(x[0],x[1],x[2])):(D.value=o,b($[0],$[1],$[2]))}c.value=!0,f.value=!0},w=()=>{N.value!=""&&N.value<o?N.value=o:N.value!=""&&N.value>i&&(N.value=i);const g=N.value.split(":");N.value&&b(g[0],g[1],g[2])},T=g=>{g.stopPropagation(),f.value&&(e.value=C.value.changTimeData().activeHour.value,l.value=C.value.changTimeData().activeMinute.value,a.value=C.value.changTimeData().activeSecond.value,D.value=`${e.value}:${l.value}:${a.value}`,b(e.value,l.value,a.value))},b=(g,$,x)=>{m=="hh:mm:ss"?N.value=`${g}:${$}:${x}`:m=="mm:hh:ss"?N.value=`${$}:${g}:${x}`:m=="hh:mm"?N.value=`${g}:${$}`:m=="mm:ss"&&(N.value=`${$}:${x}`)};return{isActive:c,showPopup:f,devuiTimePicker:v,timePickerValue:S,inputDom:u,timePopupDom:C,left:V,top:p,showClearIcon:k,firsthandActiveTime:D,vModeValue:N,getPopupPosition:h,getTimeValue:T,clickVerifyFun:n,isOutOpen:()=>{if(d){const g=N.value.split(":");e.value=g[0],l.value=g[1],a.value=g[2],D.value=N.value,b(e.value,l.value,a.value),c.value=!0,f.value=d}},vModelIsBeyond:w,clearAll:g=>{if(g.stopPropagation(),f.value=!1,o!="00:00:00"){const $=o.split(":");e.value=$[0],l.value=$[1],a.value=$[2]}else e.value="00",l.value="00",a.value="00";D.value=`${e.value}:${l.value}:${a.value}`,b(e.value,l.value,a.value)},chooseTime:g=>{if(g.type)g.type.toLowerCase()=="hh"?e.value=g.time:g.type.toLowerCase()=="mm"?l.value=g.time:g.type.toLowerCase()=="ss"&&(a.value=g.time),D.value=`${e.value}:${l.value}:${a.value}`,b(e.value,l.value,a.value);else{const $=g.time.split(":");e.value=$[0],l.value=$[1],a.value=$[2],D.value=`${e.value}:${l.value}:${a.value}`,b(e.value,l.value,a.value)}}}}const ne=(e,l,a,o,i,m,d)=>{const y=t.ref("00:00:00"),r=t.ref("00"),c=t.ref("00"),f=t.ref("00"),v=(h,n,s)=>{if(n.isDisabled)return!1;u(n,s),h.target.parentElement.parentElement.scrollTop=s*32},u=(h,n)=>{let s=[],w=t.ref("");if(h.flag=="hour"?(s=e,w=r,V(h)):h.flag=="minute"?(s=l,w=c,V(h)):h.flag=="second"&&(s=a,w=f),s.map((T,b)=>{T.isActive=n===b}),w.value=s[n].time,y.value=`${r.value}:${c.value}:${f.value}`,y.value<o)y.value=o,C(o);else if(m=="mm:ss"&&`${c.value}:${f.value}`>i.slice(3)){const T=o.slice(0,3)+i.slice(3);C(T)}else y.value>i&&(y.value=i,C(i))},V=h=>{let n="00",s="00";const w=o.split(":")[0],T=o.split(":")[1],b=o.split(":")[2],W=i.split(":")[0],B=i.split(":")[1],O=i.split(":")[2];h.flag=="hour"&&(h.time==w?(n=T,p(l,n,s),c.value<T&&p(a,b,s)):h.time==W?(s=B,p(l,n,s),p(a,n,O)):(p(l,n,s),p(a,n,s))),h.flag=="minute"&&m=="mm:ss"?h.time==T?(n=b,p(a,n,s)):(h.time==B&&(s=O),p(a,n,s)):h.flag=="minute"&&(r.value==w&&h.time==T?(n=b,p(a,n,s)):(r.value==W&&h.time==B&&(s=O),p(a,n,s)))},p=(h,n,s)=>{h.map(w=>{n!="00"&&w.time<n||s!="00"&&w.time>s?w.isDisabled=!0:w.isDisabled=!1})},C=h=>{const n=h.split(":"),s=o.split(":");let w=0,T=0,b=0;m=="hh:mm:ss"?(w=parseInt(n[0]),T=parseInt(n[1]),b=parseInt(n[2]),d.value.children[0].lastElementChild.children[0].scrollTop=w*32,d.value.children[1].lastElementChild.children[0].scrollTop=T*32,d.value.children[2].lastElementChild.children[0].scrollTop=b*32,r.value=n[0],c.value=n[1],f.value=n[2],k(e,n[0]),k(l,n[1]),k(a,n[2]),S(e,r.value),S(l,c.value)):m=="mm:hh:ss"?(w=parseInt(n[0]),T=parseInt(n[1]),b=parseInt(n[2]),d.value.children[0].lastElementChild.children[0].scrollTop=T*32,d.value.children[1].lastElementChild.children[0].scrollTop=w*32,d.value.children[2].lastElementChild.children[0].scrollTop=b*32,r.value=n[0],c.value=n[1],f.value=n[2],k(e,n[0]),k(l,n[1]),k(a,n[2]),S(e,r.value),S(l,c.value)):m=="hh:mm"?(w=parseInt(n[0]),T=parseInt(n[1]),d.value.children[0].lastElementChild.children[0].scrollTop=w*32,d.value.children[1].lastElementChild.children[0].scrollTop=T*32,r.value=n[0],c.value=n[1],k(e,n[0]),k(l,n[1]),S(e,r.value)):m=="mm:ss"&&(T=parseInt(n[1]),b=parseInt(n[2]),d.value.children[0].lastElementChild.children[0].scrollTop=T*32,d.value.children[1].lastElementChild.children[0].scrollTop=b*32,r.value=s[0],c.value=n[1],f.value=n[2],k(l,n[1]),k(a,n[2]),S(l,c.value))},S=(h,n)=>{h.map(s=>{s.time==n&&V(s)})},k=(h,n)=>{h.map(s=>{s.isActive=s.time===n})};return{activeTime:y,activeHour:r,activeMinute:c,activeSecond:f,activeTimeFun:v,resetTimeValue:C,getNewTime:()=>({activeTime:y,activeHour:r,activeMinute:c,activeSecond:f}),resetScrollTop:()=>{for(let h=0;h<d.value.children.length;h++)d.value.children[h].lastElementChild.children[0].scrollTop=0}}};function ie(){const e=t.ref(),l=t.ref(),a=t.ref(),o=t.ref(),i=t.ref(!1),m=()=>{const u=l.value.clientHeight/l.value.scrollHeight*100;a.value.style.height=u+"%"},d=()=>{const u=l.value.scrollTop*100/l.value.clientHeight;a.value.style.transform=`translateY(${u}%)`},y=u=>{const V=o.value.getBoundingClientRect().top-u.clientY,p=Math.abs(V>0?0:V),C=a.value.offsetHeight/2,S=(p-C)*100/l.value.offsetHeight;l.value.scrollTop=S*l.value.scrollHeight/100,l.value.style.top=l.value.scrollTop+"px"},r=()=>{i.value=!0,o.value.style.opacity=1},c=u=>{i.value=!1,f(u)},f=u=>{(u.composedPath&&u.composedPath()||u.path).includes(e.value)||i.value?o.value.style.opacity=1:o.value.style.opacity=0,!!i.value&&y(u)};return{scrollThumbDom:a,scrollTrackDom:o,scrollContentDom:l,scrollBoxDom:e,isDown:i,getScrollHeight:m,setVirtualScroll:d,clickTrackFun:y,mouseDownThum:r,mouseOutThum:c,thumbMouseMove:f,getScrollWidth:()=>{const u=navigator.userAgent;let V=-20;if(u.indexOf("Chrome")>-1)V=-8;else{const p=document.createElement("div");p.className="devui-scrollbar-wrap",p.style.width="100px",p.style.visibility="hidden",p.style.position="absolute",p.style.top="-9999px",document.body.appendChild(p);const C=p.offsetWidth;p.style.overflow="scroll";const S=document.createElement("div");S.style.width="100%",p.appendChild(S);const k=S.offsetWidth;p.parentNode.removeChild(p),V=(C-k+3)*-1}return V}}}var Ve="",_=t.defineComponent({name:"DTimeScroll",props:A,setup(e,l){const{scrollBoxDom:a,scrollThumbDom:o,scrollTrackDom:i,scrollContentDom:m,isDown:d,getScrollHeight:y,setVirtualScroll:r,clickTrackFun:c,mouseDownThum:f,mouseOutThum:v,thumbMouseMove:u,getScrollWidth:V}=ie(),p=V();return t.onMounted(()=>{V(),y(),a.value.addEventListener("click",r),m.value.addEventListener("scroll",r),o.value.addEventListener("mousedown",f),document.addEventListener("mouseup",v),document.addEventListener("mousemove",u)}),t.onBeforeUnmount(()=>{a.value.removeEventListener("click",r),m.value.removeEventListener("scroll",r),o.value.removeEventListener("mousedown",f)}),t.onUnmounted(()=>{document.removeEventListener("mouseup",v),document.removeEventListener("mousemove",u)}),()=>{var C,S;return t.createVNode(t.Fragment,null,[t.createVNode("div",{ref:a,class:"devui-scroll-box"},[t.createVNode("div",{ref:m,class:`box-content ${d.value||!e.showAnimation?"box-content-behavior-auto":""}`,style:{"margin-right":p+"px"}},[(S=(C=l.slots).default)==null?void 0:S.call(C)]),t.createVNode("div",{ref:i,class:"box-sroll",onClick:c},[t.createVNode("div",{ref:o,class:"scroll-child"},null)])])])}}}),we="",U=t.defineComponent({name:"DTimeList",components:{TimeScroll:_},props:{hourList:{type:Array,default:()=>[]},minuteList:{type:Array,default:()=>[]},secondList:{type:Array,default:()=>[]},format:{type:String,default:"hh:mm:ss"},minTime:{type:String,default:"00:00:00"},maxTime:{type:String,default:"23:59:59"}},setup(e,l){const a=t.ref(),{getNewTime:o,activeTimeFun:i,resetTimeValue:m,resetScrollTop:d}=ne(e.hourList,e.minuteList,e.secondList,e.minTime,e.maxTime,e.format,a),y=v=>{m(v)},r=v=>v.map((u,V)=>t.createVNode("li",{class:`time-li ${u.flag}Id-${V} ${u.isActive?"active-li":""} ${u.isDisabled?"disabled-li":""}`,onClick:p=>{i(p,u,V)}},[t.createVNode("span",null,[u.time])])),c=v=>t.createVNode("div",{class:"time-item",style:{flex:1}},[t.createVNode(_,null,{default:()=>[t.createVNode("ul",{class:"time-ul"},[r(v)])]})]),f=()=>{const v={hh:e.hourList,mm:e.minuteList,ss:e.secondList};return e.format.split(":").map(V=>c(v[V]))};return l.expose({resetScrollTop:d,setOutoTime:y,getNewTime:o}),()=>t.createVNode("div",{class:"devui-time-list",ref:a},[f()])}});class Y{constructor(){E(this,"top","50%");E(this,"left","50%")}}const se={message:String,backdrop:Boolean,view:{type:Object,default:()=>new Y},zIndex:Number,isFull:{type:Boolean,default:!1}};class re{constructor(){E(this,"target");E(this,"message");E(this,"loadingTemplateRef");E(this,"backdrop",!0);E(this,"positionType","relative");E(this,"view",new Y);E(this,"zIndex")}}var Ne="",ce=t.defineComponent({name:"DLoading",inheritAttrs:!1,props:se,setup(e){const l={top:e.view.top,left:e.view.left,zIndex:e.zIndex};e.message||(l.background="none");const a=t.ref(!1);return{style:l,isShow:a,open:()=>{a.value=!0},close:()=>{a.value=!1}}},render(){var d;const{isShow:e,isFull:l,backdrop:a,style:o,message:i,$slots:m}=this;return e&&t.createVNode("div",{class:["devui-loading-contanier",l?"devui-loading--full":""]},[((d=m.default)==null?void 0:d.call(m))||t.createVNode("div",{class:"devui-loading-wrapper"},[a?t.createVNode("div",{class:"devui-loading-mask"},null):null,t.createVNode("div",{style:o,class:"devui-loading-area"},[t.createVNode("div",{class:"devui-busy-default-spinner"},[t.createVNode("div",{class:"devui-loading-bar1"},null),t.createVNode("div",{class:"devui-loading-bar2"},null),t.createVNode("div",{class:"devui-loading-bar3"},null),t.createVNode("div",{class:"devui-loading-bar4"},null)]),i?t.createVNode("span",{class:"devui-loading-text"},[i]):null])])])}});const q=Symbol("dev_component_container");function ue(e,l,a=null){const o=t.h(e,F({},l),a),i=document.createElement("div");return o[q]=i,t.render(o,i),o.component}function de(e){t.render(null,e==null?void 0:e.vnode[q])}const pe=t.defineComponent(ce),M=new WeakSet,H=e=>{if(!e)return!0;if(Array.isArray(e))return e.length===0;if(e instanceof Set||e instanceof Map)return e.size===0;if(e instanceof Promise)return!1;if(typeof e=="object")try{return Object.keys(e).length===0}catch{return!1}return!1},G=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase(),me=e=>{switch(G(e)){case"promise":return[e];case"array":return e.some(a=>G(a)!=="promise")?(console.error(new TypeError("Binding values should all be of type Promise")),"error"):e;default:return!1}},J=e=>{M.delete(e),e.instance.proxy.close(),de(e.instance)},K=(e,l)=>{if(l.value){const a=me(l.value);if(a==="error")return;e.instance.proxy.open(),e.appendChild(e.mask),M.add(e),a&&Promise.all(a).catch(o=>{console.error(new Error("Promise handling errors"),o)}).finally(()=>{J(e)})}else J(e)},Q=e=>{e.removeAttribute("zindex"),e.removeAttribute("positiontype"),e.removeAttribute("backdrop"),e.removeAttribute("message"),e.removeAttribute("view"),e.removeAttribute("loadingtemplateref")},X=(e,l)=>{const a=F(F({},new re),l),o=a.loadingTemplateRef,i=ue(pe,F({},a),o?()=>o:null);e.style.position=a.positionType,e.options=a,e.instance=i,e.mask=i.proxy.$el},ve={mounted:function(e,l,a){X(e,a.props),Q(e),!H(l.value)&&K(e,l)},updated:function(e,l,a){!H(l.value)&&M.has(e)||H(l.value)&&!M.has(e)||(!M.has(e)&&X(e,a.props),Q(e),K(e,l))}},fe={variant:{type:String,default:"outline"},size:{type:String,default:"md"},color:{type:String},icon:{type:String,default:""},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}};function he(e,l){const a=t.computed(()=>l.slots.default),i={solid:"primary",outline:"secondary",text:"secondary"}[e.variant],m=t.computed(()=>({"devui-btn":!0,[`devui-btn-${e.variant}`]:!0,[`devui-btn-${e.variant}-${e.color||i}`]:!0,[`devui-btn-${e.size}`]:!0,"devui-btn-icon-wrap":e.icon,"devui-btn-icon":e.icon&&!a.value&&e.variant!=="solid"})),d=t.computed(()=>{if(!e.icon)return;const y="devui-icon-fix icon";return a.value?`${y} clear-right-5`:y});return{classes:m,iconClass:d}}var Se="",Z=t.defineComponent({name:"DButton",directives:{devLoading:ve},props:fe,emits:["click"],setup(e,l){const{icon:a,disabled:o,loading:i}=t.toRefs(e),{classes:m,iconClass:d}=he(e,l),y=r=>{i.value||l.emit("click",r)};return()=>{var r,c;return t.withDirectives(t.createVNode("button",{class:m.value,disabled:o.value,onClick:y},[a.value&&t.createVNode(L,{name:a.value,size:"12px",color:"",class:d.value},null),t.createVNode("span",{class:"button-content"},[(c=(r=l.slots).default)==null?void 0:c.call(r)])]),[[t.resolveDirective("dLoading"),i.value]])}}}),Pe="",R=t.defineComponent({name:"DTimePopup",components:{TimeList:U,Button:Z},props:{showPopup:{type:Boolean,default:!1},popupTop:{type:Number,default:-100},popupLeft:{type:Number,default:-100},popupWidth:{type:Number,default:300},popupFormat:{type:String,default:"hh:mm:ss"},minTime:{type:String,default:"00:00:00"},maxTime:{type:String,default:"23:59:59"},bindData:{type:String,default:"00:00:00"}},emits:["subData"],setup(e,l){const a=t.ref(),o=t.ref(),i=z("hour"),m=z("minute"),d=z("second");t.onMounted(()=>{ae(i,m,d,e.minTime,e.maxTime,e.popupFormat)}),t.watch(()=>[e.showPopup,e.bindData],([c,f],[v,u])=>{c||f!=u?o.value.setOutoTime(f):o.value.resetScrollTop()});const y=()=>o.value.getNewTime(),r=c=>{c.stopPropagation(),l.emit("subData")};return l.expose({changTimeData:y}),()=>{var c,f;return t.createVNode(t.Fragment,null,[t.createVNode("div",{ref:a,class:`devui-time-popup ${e.showPopup?"devui-show-time-popup":""}`,style:{width:e.popupWidth+"px",top:e.popupTop+"px",left:e.popupLeft+"px"}},[t.createVNode(U,{ref:o,hourList:i,minuteList:m,secondList:d,minTime:e.minTime,maxTime:e.maxTime,format:e.popupFormat},null),t.createVNode("div",{class:"devui-time-popup-btn"},[t.createVNode("div",{class:"popup-slots"},[(f=(c=l.slots).default)==null?void 0:f.call(c)]),t.createVNode("div",{onClick:r},[t.createVNode(Z,{variant:"common"},{default:()=>[t.createTextVNode("\u786E\u5B9A")]})])])])])}}}),Ce="",I=t.defineComponent({name:"DTimePicker",components:{TimePopup:R},props:A,emits:["selectedTimeChage","update:modelValue"],setup(e,l){const a=t.ref("00"),o=t.ref("00"),i=t.ref("00"),m=e.format.toLowerCase(),{isActive:d,showPopup:y,devuiTimePicker:r,inputDom:c,left:f,top:v,showClearIcon:u,firsthandActiveTime:V,chooseTime:p,getTimeValue:C,clickVerifyFun:S,isOutOpen:k,vModelIsBeyond:D,clearAll:N,timePopupDom:h,vModeValue:n,getPopupPosition:s}=oe(a,o,i,e.minTime,e.maxTime,m,e.autoOpen,e.disabled,e.modelValue),w=T=>{d.value=!1,y.value=!1,l.emit("selectedTimeChage",n.value)};return t.onMounted(()=>{s(),k(),D(),document.addEventListener("click",S),document.addEventListener("click",C),document.addEventListener("scroll",s),window.addEventListener("resize",s)}),t.onUnmounted(()=>{document.removeEventListener("click",S),document.removeEventListener("click",C),document.removeEventListener("scroll",s),window.removeEventListener("resize",s)}),t.watch(n,T=>{l.emit("update:modelValue",n.value),T!=e.minTime&&T!="00:00"?u.value=!0:u.value=!1}),l.expose({clearAll:N,chooseTime:p}),()=>t.createVNode(t.Fragment,null,[t.createVNode("div",{class:`devui-time-picker ${d.value?"time-picker-active":""} ${e.disabled?"picker-disabled":""}`,ref:r},[t.createVNode(R,{ref:h,showPopup:y.value,popupTop:v.value,popupLeft:f.value,popupWidth:e.timePickerWidth,popupFormat:e.format.toLowerCase(),minTime:e.minTime,maxTime:e.maxTime,bindData:V.value,onSubData:w},{default:()=>{var T,b;return[(b=(T=l.slots).customViewTemplate)==null?void 0:b.call(T)]}}),t.createVNode("input",{ref:c,type:"text",value:n.value,placeholder:`${e.placeholder}`,disabled:e.disabled,class:"time-input"},null),t.createVNode("div",{class:"time-input-icon"},[t.createVNode("div",{onClick:N},[u.value?t.createVNode(L,{size:"small",name:"close"},null):""]),t.createVNode("div",null,[t.createVNode(L,{size:"small",name:"time"},null)])])])])}});I.install=function(e){e.component(I.name,I)};var ge={title:"TimePicker \u65F6\u95F4\u9009\u62E9\u5668",category:"\u6570\u636E\u5F55\u5165",status:"90%",install(e){e.use(I)}};P.TimePicker=I,P.default=ge,Object.defineProperty(P,"__esModule",{value:!0}),P[Symbol.toStringTag]="Module"});
|