vue-devui 1.0.0-rc.0 → 1.0.0-rc.11
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 +78 -116
- package/alert/index.es.js +74 -45
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8190 -296
- package/auto-complete/index.umd.js +29 -1
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +153 -146
- package/avatar/index.umd.js +1 -1
- package/avatar/style.css +1 -1
- package/badge/index.es.js +34 -5
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5741 -127
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.es.js +63 -35
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +8068 -255
- package/checkbox/index.umd.js +27 -1
- package/checkbox/style.css +1 -1
- package/{accordion → collapse}/index.d.ts +0 -0
- package/collapse/index.es.js +379 -0
- package/collapse/index.umd.js +1 -0
- package/{anchor → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.es.js +5 -7
- package/countdown/index.umd.js +1 -1
- package/date-picker/index.es.js +8167 -288
- package/date-picker/index.umd.js +27 -1
- package/date-picker/style.css +1 -1
- package/drawer/index.es.js +31 -4
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +297 -181
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +525 -154
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +1048 -1176
- package/form/index.umd.js +16 -16
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +42 -21
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/grid/index.es.js +101 -86
- package/grid/index.umd.js +1 -1
- package/grid/style.css +1 -1
- package/icon/index.es.js +197 -56
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +55 -31
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8074 -144
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +269 -183
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +40 -25
- package/layout/index.umd.js +1 -1
- package/layout/style.css +1 -1
- package/loading/index.es.js +74 -35
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/modal/index.es.js +412 -204
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +307 -57
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/CheckboxGroup.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/DropdownPropsKey.js +3 -0
- package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
- package/nuxt/components/FORM_TOKEN.js +3 -0
- package/nuxt/components/Icon.js +1 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/LoadingOptions.js +3 -0
- package/nuxt/components/Option.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/RadioButton.js +3 -0
- package/nuxt/components/TABLE_TOKEN.js +3 -0
- package/nuxt/components/Tab.js +3 -0
- package/nuxt/components/TimeSelect.js +3 -0
- package/nuxt/components/Timeline.js +3 -0
- package/nuxt/components/TimelineItem.js +3 -0
- package/nuxt/components/alertProps.js +3 -0
- package/nuxt/components/autoCompleteProps.js +3 -0
- package/nuxt/components/avatarProps.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.js +3 -0
- package/nuxt/components/cardProps.js +3 -0
- package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
- package/nuxt/components/checkboxGroupProps.js +3 -0
- package/nuxt/components/checkboxProps.js +3 -0
- package/nuxt/components/colProps.js +3 -0
- package/nuxt/components/colPropsBaseClass.js +3 -0
- package/nuxt/components/colPropsBaseStyle.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/countdownProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/formItemProps.js +3 -0
- package/nuxt/components/formProps.js +3 -0
- package/nuxt/components/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +3 -0
- package/nuxt/components/imagePreviewProps.js +3 -0
- package/nuxt/components/inputProps.js +3 -0
- package/nuxt/components/loadingProps.js +3 -0
- package/nuxt/components/modalProps.js +3 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/progressProps.js +3 -0
- package/nuxt/components/rateProps.js +3 -0
- package/nuxt/components/resultProps.js +3 -0
- package/nuxt/components/rowProps.js +3 -0
- package/nuxt/components/screenSizes.js +3 -0
- package/nuxt/components/searchProps.js +3 -0
- package/nuxt/components/skeletonProps.js +3 -0
- package/nuxt/components/sliderProps.js +3 -0
- package/nuxt/components/splitterProps.js +3 -0
- package/nuxt/components/statisticProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tableProps.js +3 -0
- package/nuxt/components/tabsProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/nuxt/components/textareaProps.js +3 -0
- package/nuxt/components/timeAxisProps.js +3 -0
- package/nuxt/components/treeProps.js +3 -0
- package/overlay/index.es.js +127 -149
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +11 -44
- package/pagination/index.es.js +158 -148
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/index.es.js +45 -32
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +317 -246
- package/popover/index.umd.js +15 -15
- package/popover/style.css +1 -1
- package/progress/index.es.js +110 -56
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/radio/index.es.js +7972 -157
- package/radio/index.umd.js +27 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +77 -55
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.es.js +184 -57
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/ripple/index.es.js +47 -42
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +3653 -1122
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +9170 -596
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +63 -41
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +144 -137
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +469 -349
- package/splitter/index.umd.js +15 -15
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +41 -34
- package/statistic/index.umd.js +1 -1
- package/statistic/style.css +1 -1
- package/status/index.es.js +27 -6
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +7802 -64
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +10459 -1511
- package/table/index.umd.js +27 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +344 -141
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +49 -24
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +7921 -83
- package/textarea/index.umd.js +35 -1
- package/textarea/style.css +1 -1
- package/{anchor → time-select}/index.d.ts +0 -0
- package/{color-picker → time-select}/index.es.js +4171 -2898
- package/time-select/index.umd.js +27 -0
- package/{breadcrumb → time-select}/package.json +1 -1
- package/time-select/style.css +1 -0
- package/{back-top → timeline}/index.d.ts +0 -0
- package/timeline/index.es.js +425 -0
- package/timeline/index.umd.js +1 -0
- package/{back-top → timeline}/package.json +1 -1
- package/timeline/style.css +1 -0
- package/tooltip/index.es.js +308 -236
- package/tooltip/index.umd.js +15 -15
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +5198 -1850
- package/tree/index.umd.js +18 -18
- package/tree/style.css +1 -1
- package/upload/index.es.js +427 -132
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +12064 -15841
- package/vue-devui.umd.js +30 -20
- package/accordion/index.es.js +0 -720
- package/accordion/index.umd.js +0 -1
- package/accordion/package.json +0 -7
- package/accordion/style.css +0 -1
- package/anchor/index.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/back-top/index.es.js +0 -128
- package/back-top/index.umd.js +0 -1
- package/back-top/style.css +0 -1
- package/breadcrumb/index.d.ts +0 -7
- package/breadcrumb/index.es.js +0 -127
- package/breadcrumb/index.umd.js +0 -1
- package/breadcrumb/style.css +0 -1
- package/carousel/index.d.ts +0 -7
- package/carousel/index.es.js +0 -329
- package/carousel/index.umd.js +0 -1
- package/carousel/package.json +0 -7
- package/carousel/style.css +0 -1
- package/cascader/index.d.ts +0 -7
- package/cascader/index.es.js +0 -5963
- package/cascader/index.umd.js +0 -27
- package/cascader/package.json +0 -7
- package/cascader/style.css +0 -1
- package/color-picker/index.d.ts +0 -7
- package/color-picker/index.umd.js +0 -27
- package/color-picker/package.json +0 -7
- package/color-picker/style.css +0 -1
- package/comment/index.d.ts +0 -7
- package/comment/index.es.js +0 -86
- package/comment/index.umd.js +0 -1
- package/comment/package.json +0 -7
- package/comment/style.css +0 -1
- package/dragdrop/index.d.ts +0 -7
- package/dragdrop/index.es.js +0 -157
- package/dragdrop/index.umd.js +0 -1
- package/dragdrop/package.json +0 -7
- package/gantt/index.d.ts +0 -7
- package/gantt/index.es.js +0 -523
- package/gantt/index.umd.js +0 -1
- package/gantt/package.json +0 -7
- package/gantt/style.css +0 -1
- package/input-icon/index.d.ts +0 -7
- package/input-icon/index.es.js +0 -331
- package/input-icon/index.umd.js +0 -1
- package/input-icon/package.json +0 -7
- package/input-icon/style.css +0 -1
- package/list/index.d.ts +0 -7
- package/list/index.es.js +0 -39
- package/list/index.umd.js +0 -1
- package/list/package.json +0 -7
- package/list/style.css +0 -1
- package/nav-sprite/index.d.ts +0 -7
- package/nav-sprite/index.es.js +0 -68
- package/nav-sprite/index.umd.js +0 -1
- package/nav-sprite/package.json +0 -7
- package/nuxt/components/Accordion.js +0 -3
- package/nuxt/components/Anchor.js +0 -3
- package/nuxt/components/BackTop.js +0 -3
- package/nuxt/components/Breadcrumb.js +0 -3
- package/nuxt/components/Carousel.js +0 -3
- package/nuxt/components/CarouselItem.js +0 -3
- package/nuxt/components/Cascader.js +0 -3
- package/nuxt/components/ColorPicker.js +0 -3
- package/nuxt/components/Comment.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/Gantt.js +0 -3
- package/nuxt/components/InputIcon.js +0 -3
- package/nuxt/components/List.js +0 -3
- package/nuxt/components/ListItem.js +0 -3
- package/nuxt/components/NavSprite.js +0 -2
- package/nuxt/components/QuadrantDiagram.js +0 -3
- package/nuxt/components/ReadTip.js +0 -3
- package/nuxt/components/StepsGuide.js +0 -3
- package/nuxt/components/Sticky.js +0 -2
- package/nuxt/components/TagInput.js +0 -3
- package/nuxt/components/TimeAxis.js +0 -3
- package/nuxt/components/TimeAxisItem.js +0 -3
- package/nuxt/components/TimePicker.js +0 -3
- package/nuxt/components/Transfer.js +0 -3
- package/nuxt/components/TreeSelect.js +0 -3
- package/nuxt/components/overlayEmits.js +0 -3
- package/nuxt/components/overlayProps.js +0 -3
- package/quadrant-diagram/index.d.ts +0 -7
- package/quadrant-diagram/index.es.js +0 -5728
- package/quadrant-diagram/index.umd.js +0 -27
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/read-tip/index.d.ts +0 -7
- package/read-tip/index.es.js +0 -258
- package/read-tip/index.umd.js +0 -1
- package/read-tip/package.json +0 -7
- package/read-tip/style.css +0 -1
- package/steps-guide/index.d.ts +0 -7
- package/steps-guide/index.es.js +0 -239
- package/steps-guide/index.umd.js +0 -1
- package/steps-guide/package.json +0 -7
- package/steps-guide/style.css +0 -1
- package/sticky/index.d.ts +0 -7
- package/sticky/index.es.js +0 -197
- package/sticky/index.umd.js +0 -1
- package/sticky/package.json +0 -7
- package/tag-input/index.d.ts +0 -7
- package/tag-input/index.es.js +0 -329
- package/tag-input/index.umd.js +0 -1
- package/tag-input/package.json +0 -7
- package/tag-input/style.css +0 -1
- package/time-axis/index.d.ts +0 -7
- package/time-axis/index.es.js +0 -299
- package/time-axis/index.umd.js +0 -1
- package/time-axis/package.json +0 -7
- package/time-axis/style.css +0 -1
- package/time-picker/index.d.ts +0 -7
- package/time-picker/index.es.js +0 -1237
- package/time-picker/index.umd.js +0 -1
- package/time-picker/package.json +0 -7
- package/time-picker/style.css +0 -1
- package/transfer/index.d.ts +0 -7
- package/transfer/index.es.js +0 -7608
- package/transfer/index.umd.js +0 -27
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
- package/tree-select/index.d.ts +0 -7
- package/tree-select/index.es.js +0 -623
- package/tree-select/index.umd.js +0 -1
- package/tree-select/package.json +0 -7
- package/tree-select/style.css +0 -1
package/time-picker/index.es.js
DELETED
|
@@ -1,1237 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (a, b) => {
|
|
7
|
-
for (var prop in b || (b = {}))
|
|
8
|
-
if (__hasOwnProp.call(b, prop))
|
|
9
|
-
__defNormalProp(a, prop, b[prop]);
|
|
10
|
-
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
-
if (__propIsEnum.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
}
|
|
15
|
-
return a;
|
|
16
|
-
};
|
|
17
|
-
var __publicField = (obj, key, value) => {
|
|
18
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
19
|
-
return value;
|
|
20
|
-
};
|
|
21
|
-
import { defineComponent, createVNode, reactive, ref, onMounted, onBeforeUnmount, onUnmounted, Fragment, h, render, computed, toRefs, withDirectives, resolveDirective, watch, createTextVNode } from "vue";
|
|
22
|
-
const timePickerProps = {
|
|
23
|
-
modelValue: {
|
|
24
|
-
type: String,
|
|
25
|
-
default: ""
|
|
26
|
-
},
|
|
27
|
-
placeholder: {
|
|
28
|
-
type: String,
|
|
29
|
-
default: "00:00:00"
|
|
30
|
-
},
|
|
31
|
-
disabled: {
|
|
32
|
-
type: Boolean,
|
|
33
|
-
default: false
|
|
34
|
-
},
|
|
35
|
-
timePickerWidth: {
|
|
36
|
-
type: Number,
|
|
37
|
-
default: 212
|
|
38
|
-
},
|
|
39
|
-
minTime: {
|
|
40
|
-
type: String,
|
|
41
|
-
default: "00:00:00"
|
|
42
|
-
},
|
|
43
|
-
maxTime: {
|
|
44
|
-
type: String,
|
|
45
|
-
default: "23:59:59"
|
|
46
|
-
},
|
|
47
|
-
format: {
|
|
48
|
-
type: String,
|
|
49
|
-
default: "hh:mm:ss"
|
|
50
|
-
},
|
|
51
|
-
autoOpen: {
|
|
52
|
-
type: Boolean,
|
|
53
|
-
default: false
|
|
54
|
-
},
|
|
55
|
-
showAnimation: {
|
|
56
|
-
type: Boolean,
|
|
57
|
-
default: true
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
var Icon = defineComponent({
|
|
61
|
-
name: "DIcon",
|
|
62
|
-
props: {
|
|
63
|
-
name: {
|
|
64
|
-
type: String,
|
|
65
|
-
required: true
|
|
66
|
-
},
|
|
67
|
-
size: {
|
|
68
|
-
type: String,
|
|
69
|
-
default: "inherit"
|
|
70
|
-
},
|
|
71
|
-
color: {
|
|
72
|
-
type: String,
|
|
73
|
-
default: "inherit"
|
|
74
|
-
},
|
|
75
|
-
classPrefix: {
|
|
76
|
-
type: String,
|
|
77
|
-
default: "icon"
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
setup(props) {
|
|
81
|
-
return __spreadValues({}, props);
|
|
82
|
-
},
|
|
83
|
-
render() {
|
|
84
|
-
const {
|
|
85
|
-
name,
|
|
86
|
-
size,
|
|
87
|
-
color,
|
|
88
|
-
classPrefix
|
|
89
|
-
} = this;
|
|
90
|
-
return /^((https?):)?\/\//.test(name) ? createVNode("img", {
|
|
91
|
-
"src": name,
|
|
92
|
-
"alt": name.split("/")[name.split("/").length - 1],
|
|
93
|
-
"style": {
|
|
94
|
-
width: size,
|
|
95
|
-
verticalAlign: "text-bottom"
|
|
96
|
-
}
|
|
97
|
-
}, null) : createVNode("i", {
|
|
98
|
-
"class": `${classPrefix} ${classPrefix}-${name}`,
|
|
99
|
-
"style": {
|
|
100
|
-
fontSize: size,
|
|
101
|
-
color
|
|
102
|
-
}
|
|
103
|
-
}, null);
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
Icon.install = function(app) {
|
|
107
|
-
app.component(Icon.name, Icon);
|
|
108
|
-
};
|
|
109
|
-
function getPositionFun(el, left, top) {
|
|
110
|
-
const inputDom = el.getBoundingClientRect();
|
|
111
|
-
const button2 = window.innerHeight - (inputDom.top + 20);
|
|
112
|
-
if (button2 > inputDom.top + 20) {
|
|
113
|
-
left.value = inputDom.x;
|
|
114
|
-
top.value = inputDom.top + 20 + 10;
|
|
115
|
-
} else {
|
|
116
|
-
left.value = inputDom.x;
|
|
117
|
-
top.value = inputDom.top - 316;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
function initializeTimeData(type) {
|
|
121
|
-
const timeArr = reactive([]);
|
|
122
|
-
let arrLenght = 0;
|
|
123
|
-
if (type == "hour") {
|
|
124
|
-
arrLenght = 24;
|
|
125
|
-
} else {
|
|
126
|
-
arrLenght = 60;
|
|
127
|
-
}
|
|
128
|
-
for (let i = 0; i < arrLenght; i++) {
|
|
129
|
-
timeArr.push({
|
|
130
|
-
time: i < 10 ? "0" + i : i + "",
|
|
131
|
-
isActive: false,
|
|
132
|
-
flag: type,
|
|
133
|
-
isDisabled: false
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
return timeArr;
|
|
137
|
-
}
|
|
138
|
-
const setTimeAstrict = (hourList, minuteList, secondList, minTime, maxTime, format) => {
|
|
139
|
-
const maxTimeHour = maxTime.split(":")[0];
|
|
140
|
-
const maxTimeMinute = maxTime.split(":")[1];
|
|
141
|
-
const minTimeHour = minTime.split(":")[0];
|
|
142
|
-
const minTimeMinute = minTime.split(":")[1];
|
|
143
|
-
const minTimeSecond = minTime.split(":")[2];
|
|
144
|
-
hourList.map((item, index2) => {
|
|
145
|
-
if (item.time < minTimeHour || item.time > maxTimeHour) {
|
|
146
|
-
item.isDisabled = true;
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
if (format == "mm:ss") {
|
|
150
|
-
minuteList.map((item, index2) => {
|
|
151
|
-
if (item.time < minTimeMinute || item.time > maxTimeMinute) {
|
|
152
|
-
item.isDisabled = true;
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
} else {
|
|
156
|
-
minuteList.map((item, index2) => {
|
|
157
|
-
if (item.time < minTimeMinute) {
|
|
158
|
-
item.isDisabled = true;
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
secondList.map((item, index2) => {
|
|
163
|
-
if (item.time < minTimeSecond) {
|
|
164
|
-
item.isDisabled = true;
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
};
|
|
168
|
-
function useTimePicker(hh, mm, ss, minTime, maxTime, format, autoOpen, disabled, value) {
|
|
169
|
-
const isActive = ref(false);
|
|
170
|
-
const showPopup = ref(false);
|
|
171
|
-
const devuiTimePicker = ref();
|
|
172
|
-
const inputDom = ref();
|
|
173
|
-
const left = ref(-100);
|
|
174
|
-
const top = ref(-100);
|
|
175
|
-
const timePopupDom = ref();
|
|
176
|
-
const timePickerValue = ref("");
|
|
177
|
-
const showClearIcon = ref(false);
|
|
178
|
-
const firsthandActiveTime = ref(`${hh.value}:${mm.value}:${ss.value}`);
|
|
179
|
-
const vModeValue = ref(value);
|
|
180
|
-
const getPopupPosition = () => {
|
|
181
|
-
getPositionFun(devuiTimePicker.value, left, top);
|
|
182
|
-
};
|
|
183
|
-
const clickVerifyFun = (e) => {
|
|
184
|
-
e.stopPropagation();
|
|
185
|
-
isActive.value = false;
|
|
186
|
-
showPopup.value = false;
|
|
187
|
-
if (disabled)
|
|
188
|
-
return;
|
|
189
|
-
const path = e.composedPath && e.composedPath() || e.path;
|
|
190
|
-
const inInputDom = path.includes(devuiTimePicker.value);
|
|
191
|
-
inInputDom && mouseInIputFun();
|
|
192
|
-
};
|
|
193
|
-
const mouseInIputFun = () => {
|
|
194
|
-
if (firsthandActiveTime.value == "00:00:00") {
|
|
195
|
-
const vModelValueArr = value.split(":");
|
|
196
|
-
const minTimeValueArr = minTime.split(":");
|
|
197
|
-
const maxTimeValueArr = maxTime.split(":");
|
|
198
|
-
vModeValue.value == "" ? vModeValue.value = "00:00:00" : "";
|
|
199
|
-
if (value > minTime && value < maxTime) {
|
|
200
|
-
firsthandActiveTime.value = value;
|
|
201
|
-
setInputValue(vModelValueArr[0], vModelValueArr[1], vModelValueArr[2]);
|
|
202
|
-
} else if (value > maxTime) {
|
|
203
|
-
firsthandActiveTime.value = maxTime;
|
|
204
|
-
setInputValue(maxTimeValueArr[0], maxTimeValueArr[1], maxTimeValueArr[2]);
|
|
205
|
-
} else {
|
|
206
|
-
firsthandActiveTime.value = minTime;
|
|
207
|
-
setInputValue(minTimeValueArr[0], minTimeValueArr[1], minTimeValueArr[2]);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
isActive.value = true;
|
|
211
|
-
showPopup.value = true;
|
|
212
|
-
};
|
|
213
|
-
const vModelIsBeyond = () => {
|
|
214
|
-
if (vModeValue.value != "" && vModeValue.value < minTime) {
|
|
215
|
-
vModeValue.value = minTime;
|
|
216
|
-
} else if (vModeValue.value != "" && vModeValue.value > maxTime) {
|
|
217
|
-
vModeValue.value = maxTime;
|
|
218
|
-
}
|
|
219
|
-
const vModelValueArr = vModeValue.value.split(":");
|
|
220
|
-
vModeValue.value && setInputValue(vModelValueArr[0], vModelValueArr[1], vModelValueArr[2]);
|
|
221
|
-
};
|
|
222
|
-
const getTimeValue = (e) => {
|
|
223
|
-
e.stopPropagation();
|
|
224
|
-
if (showPopup.value) {
|
|
225
|
-
hh.value = timePopupDom.value.changTimeData().activeHour.value;
|
|
226
|
-
mm.value = timePopupDom.value.changTimeData().activeMinute.value;
|
|
227
|
-
ss.value = timePopupDom.value.changTimeData().activeSecond.value;
|
|
228
|
-
firsthandActiveTime.value = `${hh.value}:${mm.value}:${ss.value}`;
|
|
229
|
-
setInputValue(hh.value, mm.value, ss.value);
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
const setInputValue = (hh2, mm2, ss2) => {
|
|
233
|
-
if (format == "hh:mm:ss") {
|
|
234
|
-
vModeValue.value = `${hh2}:${mm2}:${ss2}`;
|
|
235
|
-
} else if (format == "mm:hh:ss") {
|
|
236
|
-
vModeValue.value = `${mm2}:${hh2}:${ss2}`;
|
|
237
|
-
} else if (format == "hh:mm") {
|
|
238
|
-
vModeValue.value = `${hh2}:${mm2}`;
|
|
239
|
-
} else if (format == "mm:ss") {
|
|
240
|
-
vModeValue.value = `${mm2}:${ss2}`;
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
const clearAll = (e) => {
|
|
244
|
-
e.stopPropagation();
|
|
245
|
-
showPopup.value = false;
|
|
246
|
-
if (minTime != "00:00:00") {
|
|
247
|
-
const minTimeArr = minTime.split(":");
|
|
248
|
-
hh.value = minTimeArr[0];
|
|
249
|
-
mm.value = minTimeArr[1];
|
|
250
|
-
ss.value = minTimeArr[2];
|
|
251
|
-
} else {
|
|
252
|
-
hh.value = "00";
|
|
253
|
-
mm.value = "00";
|
|
254
|
-
ss.value = "00";
|
|
255
|
-
}
|
|
256
|
-
firsthandActiveTime.value = `${hh.value}:${mm.value}:${ss.value}`;
|
|
257
|
-
setInputValue(hh.value, mm.value, ss.value);
|
|
258
|
-
};
|
|
259
|
-
const isOutOpen = () => {
|
|
260
|
-
if (autoOpen) {
|
|
261
|
-
const timeArr = vModeValue.value.split(":");
|
|
262
|
-
hh.value = timeArr[0];
|
|
263
|
-
mm.value = timeArr[1];
|
|
264
|
-
ss.value = timeArr[2];
|
|
265
|
-
firsthandActiveTime.value = vModeValue.value;
|
|
266
|
-
setInputValue(hh.value, mm.value, ss.value);
|
|
267
|
-
isActive.value = true;
|
|
268
|
-
showPopup.value = autoOpen;
|
|
269
|
-
}
|
|
270
|
-
};
|
|
271
|
-
const chooseTime = (slotTime) => {
|
|
272
|
-
if (slotTime.type) {
|
|
273
|
-
if (slotTime.type.toLowerCase() == "hh") {
|
|
274
|
-
hh.value = slotTime.time;
|
|
275
|
-
} else if (slotTime.type.toLowerCase() == "mm") {
|
|
276
|
-
mm.value = slotTime.time;
|
|
277
|
-
} else if (slotTime.type.toLowerCase() == "ss") {
|
|
278
|
-
ss.value = slotTime.time;
|
|
279
|
-
}
|
|
280
|
-
firsthandActiveTime.value = `${hh.value}:${mm.value}:${ss.value}`;
|
|
281
|
-
setInputValue(hh.value, mm.value, ss.value);
|
|
282
|
-
} else {
|
|
283
|
-
const timeArr = slotTime.time.split(":");
|
|
284
|
-
hh.value = timeArr[0];
|
|
285
|
-
mm.value = timeArr[1];
|
|
286
|
-
ss.value = timeArr[2];
|
|
287
|
-
firsthandActiveTime.value = `${hh.value}:${mm.value}:${ss.value}`;
|
|
288
|
-
setInputValue(hh.value, mm.value, ss.value);
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
return {
|
|
292
|
-
isActive,
|
|
293
|
-
showPopup,
|
|
294
|
-
devuiTimePicker,
|
|
295
|
-
timePickerValue,
|
|
296
|
-
inputDom,
|
|
297
|
-
timePopupDom,
|
|
298
|
-
left,
|
|
299
|
-
top,
|
|
300
|
-
showClearIcon,
|
|
301
|
-
firsthandActiveTime,
|
|
302
|
-
vModeValue,
|
|
303
|
-
getPopupPosition,
|
|
304
|
-
getTimeValue,
|
|
305
|
-
clickVerifyFun,
|
|
306
|
-
isOutOpen,
|
|
307
|
-
vModelIsBeyond,
|
|
308
|
-
clearAll,
|
|
309
|
-
chooseTime
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
const usePopupLine = (hourListRef, minuteListRef, secondListRef, minTime, maxTime, format, timeListDom) => {
|
|
313
|
-
const activeTime = ref("00:00:00");
|
|
314
|
-
const activeHour = ref("00");
|
|
315
|
-
const activeMinute = ref("00");
|
|
316
|
-
const activeSecond = ref("00");
|
|
317
|
-
const activeTimeFun = (e, item, index2) => {
|
|
318
|
-
if (item.isDisabled) {
|
|
319
|
-
return false;
|
|
320
|
-
} else {
|
|
321
|
-
setTimeActive(item, index2);
|
|
322
|
-
e.target.parentElement.parentElement.scrollTop = index2 * 32;
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
const setTimeActive = (item, index2) => {
|
|
326
|
-
let activeTimeList = [];
|
|
327
|
-
let acitveTimeValue = ref("");
|
|
328
|
-
if (item.flag == "hour") {
|
|
329
|
-
activeTimeList = hourListRef;
|
|
330
|
-
acitveTimeValue = activeHour;
|
|
331
|
-
getItemAstrict(item);
|
|
332
|
-
} else if (item.flag == "minute") {
|
|
333
|
-
activeTimeList = minuteListRef;
|
|
334
|
-
acitveTimeValue = activeMinute;
|
|
335
|
-
getItemAstrict(item);
|
|
336
|
-
} else if (item.flag == "second") {
|
|
337
|
-
activeTimeList = secondListRef;
|
|
338
|
-
acitveTimeValue = activeSecond;
|
|
339
|
-
}
|
|
340
|
-
activeTimeList.map((tiemItem, tiemeIndex) => {
|
|
341
|
-
tiemItem.isActive = index2 === tiemeIndex;
|
|
342
|
-
});
|
|
343
|
-
acitveTimeValue.value = activeTimeList[index2].time;
|
|
344
|
-
activeTime.value = `${activeHour.value}:${activeMinute.value}:${activeSecond.value}`;
|
|
345
|
-
if (activeTime.value < minTime) {
|
|
346
|
-
activeTime.value = minTime;
|
|
347
|
-
resetTimeValue(minTime);
|
|
348
|
-
} else if (format == "mm:ss" && `${activeMinute.value}:${activeSecond.value}` > maxTime.slice(3)) {
|
|
349
|
-
const newMinTime = minTime.slice(0, 3) + maxTime.slice(3);
|
|
350
|
-
resetTimeValue(newMinTime);
|
|
351
|
-
} else if (activeTime.value > maxTime) {
|
|
352
|
-
activeTime.value = maxTime;
|
|
353
|
-
resetTimeValue(maxTime);
|
|
354
|
-
}
|
|
355
|
-
};
|
|
356
|
-
const getItemAstrict = (item) => {
|
|
357
|
-
let min = "00";
|
|
358
|
-
let max = "00";
|
|
359
|
-
const minTimeHour = minTime.split(":")[0];
|
|
360
|
-
const minTimeMinute = minTime.split(":")[1];
|
|
361
|
-
const minTimeSecond = minTime.split(":")[2];
|
|
362
|
-
const maxTimeHour = maxTime.split(":")[0];
|
|
363
|
-
const maxTimeMinute = maxTime.split(":")[1];
|
|
364
|
-
const maxTimeSecond = maxTime.split(":")[2];
|
|
365
|
-
if (item.flag == "hour") {
|
|
366
|
-
if (item.time == minTimeHour) {
|
|
367
|
-
min = minTimeMinute;
|
|
368
|
-
setItemAstrict(minuteListRef, min, max);
|
|
369
|
-
activeMinute.value < minTimeMinute && setItemAstrict(secondListRef, minTimeSecond, max);
|
|
370
|
-
} else if (item.time == maxTimeHour) {
|
|
371
|
-
max = maxTimeMinute;
|
|
372
|
-
setItemAstrict(minuteListRef, min, max);
|
|
373
|
-
setItemAstrict(secondListRef, min, maxTimeSecond);
|
|
374
|
-
} else {
|
|
375
|
-
setItemAstrict(minuteListRef, min, max);
|
|
376
|
-
setItemAstrict(secondListRef, min, max);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
if (item.flag == "minute" && format == "mm:ss") {
|
|
380
|
-
if (item.time == minTimeMinute) {
|
|
381
|
-
min = minTimeSecond;
|
|
382
|
-
setItemAstrict(secondListRef, min, max);
|
|
383
|
-
} else if (item.time == maxTimeMinute) {
|
|
384
|
-
max = maxTimeSecond;
|
|
385
|
-
setItemAstrict(secondListRef, min, max);
|
|
386
|
-
} else {
|
|
387
|
-
setItemAstrict(secondListRef, min, max);
|
|
388
|
-
}
|
|
389
|
-
} else if (item.flag == "minute") {
|
|
390
|
-
if (activeHour.value == minTimeHour && item.time == minTimeMinute) {
|
|
391
|
-
min = minTimeSecond;
|
|
392
|
-
setItemAstrict(secondListRef, min, max);
|
|
393
|
-
} else if (activeHour.value == maxTimeHour && item.time == maxTimeMinute) {
|
|
394
|
-
max = maxTimeSecond;
|
|
395
|
-
setItemAstrict(secondListRef, min, max);
|
|
396
|
-
} else {
|
|
397
|
-
setItemAstrict(secondListRef, min, max);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
};
|
|
401
|
-
const setItemAstrict = (timeArr, min, max) => {
|
|
402
|
-
timeArr.map((itme) => {
|
|
403
|
-
if (min != "00" && itme.time < min) {
|
|
404
|
-
itme.isDisabled = true;
|
|
405
|
-
} else if (max != "00" && itme.time > max) {
|
|
406
|
-
itme.isDisabled = true;
|
|
407
|
-
} else {
|
|
408
|
-
itme.isDisabled = false;
|
|
409
|
-
}
|
|
410
|
-
});
|
|
411
|
-
};
|
|
412
|
-
const resetTimeValue = (time) => {
|
|
413
|
-
const timeValueArr = time.split(":");
|
|
414
|
-
const minTiveArr = minTime.split(":");
|
|
415
|
-
let hh = 0;
|
|
416
|
-
let mm = 0;
|
|
417
|
-
let ss = 0;
|
|
418
|
-
if (format == "hh:mm:ss") {
|
|
419
|
-
hh = parseInt(timeValueArr[0]);
|
|
420
|
-
mm = parseInt(timeValueArr[1]);
|
|
421
|
-
ss = parseInt(timeValueArr[2]);
|
|
422
|
-
timeListDom.value.children[0].lastElementChild.children[0].scrollTop = hh * 32;
|
|
423
|
-
timeListDom.value.children[1].lastElementChild.children[0].scrollTop = mm * 32;
|
|
424
|
-
timeListDom.value.children[2].lastElementChild.children[0].scrollTop = ss * 32;
|
|
425
|
-
activeHour.value = timeValueArr[0];
|
|
426
|
-
activeMinute.value = timeValueArr[1];
|
|
427
|
-
activeSecond.value = timeValueArr[2];
|
|
428
|
-
resetTimeActive(hourListRef, timeValueArr[0]);
|
|
429
|
-
resetTimeActive(minuteListRef, timeValueArr[1]);
|
|
430
|
-
resetTimeActive(secondListRef, timeValueArr[2]);
|
|
431
|
-
resetTimeAstrict(hourListRef, activeHour.value);
|
|
432
|
-
resetTimeAstrict(minuteListRef, activeMinute.value);
|
|
433
|
-
} else if (format == "mm:hh:ss") {
|
|
434
|
-
hh = parseInt(timeValueArr[0]);
|
|
435
|
-
mm = parseInt(timeValueArr[1]);
|
|
436
|
-
ss = parseInt(timeValueArr[2]);
|
|
437
|
-
timeListDom.value.children[0].lastElementChild.children[0].scrollTop = mm * 32;
|
|
438
|
-
timeListDom.value.children[1].lastElementChild.children[0].scrollTop = hh * 32;
|
|
439
|
-
timeListDom.value.children[2].lastElementChild.children[0].scrollTop = ss * 32;
|
|
440
|
-
activeHour.value = timeValueArr[0];
|
|
441
|
-
activeMinute.value = timeValueArr[1];
|
|
442
|
-
activeSecond.value = timeValueArr[2];
|
|
443
|
-
resetTimeActive(hourListRef, timeValueArr[0]);
|
|
444
|
-
resetTimeActive(minuteListRef, timeValueArr[1]);
|
|
445
|
-
resetTimeActive(secondListRef, timeValueArr[2]);
|
|
446
|
-
resetTimeAstrict(hourListRef, activeHour.value);
|
|
447
|
-
resetTimeAstrict(minuteListRef, activeMinute.value);
|
|
448
|
-
} else if (format == "hh:mm") {
|
|
449
|
-
hh = parseInt(timeValueArr[0]);
|
|
450
|
-
mm = parseInt(timeValueArr[1]);
|
|
451
|
-
timeListDom.value.children[0].lastElementChild.children[0].scrollTop = hh * 32;
|
|
452
|
-
timeListDom.value.children[1].lastElementChild.children[0].scrollTop = mm * 32;
|
|
453
|
-
activeHour.value = timeValueArr[0];
|
|
454
|
-
activeMinute.value = timeValueArr[1];
|
|
455
|
-
resetTimeActive(hourListRef, timeValueArr[0]);
|
|
456
|
-
resetTimeActive(minuteListRef, timeValueArr[1]);
|
|
457
|
-
resetTimeAstrict(hourListRef, activeHour.value);
|
|
458
|
-
} else if (format == "mm:ss") {
|
|
459
|
-
mm = parseInt(timeValueArr[1]);
|
|
460
|
-
ss = parseInt(timeValueArr[2]);
|
|
461
|
-
timeListDom.value.children[0].lastElementChild.children[0].scrollTop = mm * 32;
|
|
462
|
-
timeListDom.value.children[1].lastElementChild.children[0].scrollTop = ss * 32;
|
|
463
|
-
activeHour.value = minTiveArr[0];
|
|
464
|
-
activeMinute.value = timeValueArr[1];
|
|
465
|
-
activeSecond.value = timeValueArr[2];
|
|
466
|
-
resetTimeActive(minuteListRef, timeValueArr[1]);
|
|
467
|
-
resetTimeActive(secondListRef, timeValueArr[2]);
|
|
468
|
-
resetTimeAstrict(minuteListRef, activeMinute.value);
|
|
469
|
-
}
|
|
470
|
-
};
|
|
471
|
-
const resetTimeAstrict = (timeArr, time) => {
|
|
472
|
-
timeArr.map((item) => {
|
|
473
|
-
if (item.time == time) {
|
|
474
|
-
getItemAstrict(item);
|
|
475
|
-
}
|
|
476
|
-
});
|
|
477
|
-
};
|
|
478
|
-
const resetTimeActive = (timeArr, itemValue) => {
|
|
479
|
-
timeArr.map((item) => {
|
|
480
|
-
item.isActive = item.time === itemValue;
|
|
481
|
-
});
|
|
482
|
-
};
|
|
483
|
-
const getNewTime = () => {
|
|
484
|
-
return { activeTime, activeHour, activeMinute, activeSecond };
|
|
485
|
-
};
|
|
486
|
-
const resetScrollTop = () => {
|
|
487
|
-
for (let i = 0; i < timeListDom.value.children.length; i++) {
|
|
488
|
-
timeListDom.value.children[i].lastElementChild.children[0].scrollTop = 0;
|
|
489
|
-
}
|
|
490
|
-
};
|
|
491
|
-
return {
|
|
492
|
-
activeTime,
|
|
493
|
-
activeHour,
|
|
494
|
-
activeMinute,
|
|
495
|
-
activeSecond,
|
|
496
|
-
activeTimeFun,
|
|
497
|
-
resetTimeValue,
|
|
498
|
-
getNewTime,
|
|
499
|
-
resetScrollTop
|
|
500
|
-
};
|
|
501
|
-
};
|
|
502
|
-
function useTimeScroll() {
|
|
503
|
-
const scrollBoxDom = ref();
|
|
504
|
-
const scrollContentDom = ref();
|
|
505
|
-
const scrollThumbDom = ref();
|
|
506
|
-
const scrollTrackDom = ref();
|
|
507
|
-
const isDown = ref(false);
|
|
508
|
-
const getScrollHeight = () => {
|
|
509
|
-
const thumbHeight = scrollContentDom.value.clientHeight / scrollContentDom.value.scrollHeight * 100;
|
|
510
|
-
scrollThumbDom.value.style.height = thumbHeight + "%";
|
|
511
|
-
};
|
|
512
|
-
const setVirtualScroll = () => {
|
|
513
|
-
const thumbMoveY = scrollContentDom.value.scrollTop * 100 / scrollContentDom.value.clientHeight;
|
|
514
|
-
scrollThumbDom.value.style.transform = `translateY(${thumbMoveY}%)`;
|
|
515
|
-
};
|
|
516
|
-
const clickTrackFun = (e) => {
|
|
517
|
-
const offsetNum = scrollTrackDom.value.getBoundingClientRect().top - e.clientY;
|
|
518
|
-
const offset = Math.abs(offsetNum > 0 ? 0 : offsetNum);
|
|
519
|
-
const thumbCenter = scrollThumbDom.value.offsetHeight / 2;
|
|
520
|
-
const thumbPosition = (offset - thumbCenter) * 100 / scrollContentDom.value.offsetHeight;
|
|
521
|
-
scrollContentDom.value.scrollTop = thumbPosition * scrollContentDom.value.scrollHeight / 100;
|
|
522
|
-
scrollContentDom.value.style.top = scrollContentDom.value.scrollTop + "px";
|
|
523
|
-
};
|
|
524
|
-
const mouseDownThum = () => {
|
|
525
|
-
isDown.value = true;
|
|
526
|
-
scrollTrackDom.value.style.opacity = 1;
|
|
527
|
-
};
|
|
528
|
-
const mouseOutThum = (e) => {
|
|
529
|
-
isDown.value = false;
|
|
530
|
-
thumbMouseMove(e);
|
|
531
|
-
};
|
|
532
|
-
const thumbMouseMove = (e) => {
|
|
533
|
-
const path = e.composedPath && e.composedPath() || e.path;
|
|
534
|
-
if (path.includes(scrollBoxDom.value) || isDown.value) {
|
|
535
|
-
scrollTrackDom.value.style.opacity = 1;
|
|
536
|
-
} else {
|
|
537
|
-
scrollTrackDom.value.style.opacity = 0;
|
|
538
|
-
}
|
|
539
|
-
if (!isDown.value)
|
|
540
|
-
return;
|
|
541
|
-
clickTrackFun(e);
|
|
542
|
-
};
|
|
543
|
-
const getScrollWidth = () => {
|
|
544
|
-
const ua = navigator.userAgent;
|
|
545
|
-
let marginRight = -20;
|
|
546
|
-
if (ua.indexOf("Chrome") > -1) {
|
|
547
|
-
marginRight = -8;
|
|
548
|
-
} else {
|
|
549
|
-
const outer = document.createElement("div");
|
|
550
|
-
outer.className = "devui-scrollbar-wrap";
|
|
551
|
-
outer.style.width = "100px";
|
|
552
|
-
outer.style.visibility = "hidden";
|
|
553
|
-
outer.style.position = "absolute";
|
|
554
|
-
outer.style.top = "-9999px";
|
|
555
|
-
document.body.appendChild(outer);
|
|
556
|
-
const widthNoScroll = outer.offsetWidth;
|
|
557
|
-
outer.style.overflow = "scroll";
|
|
558
|
-
const inner = document.createElement("div");
|
|
559
|
-
inner.style.width = "100%";
|
|
560
|
-
outer.appendChild(inner);
|
|
561
|
-
const widthWithScroll = inner.offsetWidth;
|
|
562
|
-
outer.parentNode.removeChild(outer);
|
|
563
|
-
marginRight = (widthNoScroll - widthWithScroll + 3) * -1;
|
|
564
|
-
}
|
|
565
|
-
return marginRight;
|
|
566
|
-
};
|
|
567
|
-
return {
|
|
568
|
-
scrollThumbDom,
|
|
569
|
-
scrollTrackDom,
|
|
570
|
-
scrollContentDom,
|
|
571
|
-
scrollBoxDom,
|
|
572
|
-
isDown,
|
|
573
|
-
getScrollHeight,
|
|
574
|
-
setVirtualScroll,
|
|
575
|
-
clickTrackFun,
|
|
576
|
-
mouseDownThum,
|
|
577
|
-
mouseOutThum,
|
|
578
|
-
thumbMouseMove,
|
|
579
|
-
getScrollWidth
|
|
580
|
-
};
|
|
581
|
-
}
|
|
582
|
-
var index$3 = "";
|
|
583
|
-
var TimeScroll = defineComponent({
|
|
584
|
-
name: "DTimeScroll",
|
|
585
|
-
props: timePickerProps,
|
|
586
|
-
setup(props, ctx) {
|
|
587
|
-
const {
|
|
588
|
-
scrollBoxDom,
|
|
589
|
-
scrollThumbDom,
|
|
590
|
-
scrollTrackDom,
|
|
591
|
-
scrollContentDom,
|
|
592
|
-
isDown,
|
|
593
|
-
getScrollHeight,
|
|
594
|
-
setVirtualScroll,
|
|
595
|
-
clickTrackFun,
|
|
596
|
-
mouseDownThum,
|
|
597
|
-
mouseOutThum,
|
|
598
|
-
thumbMouseMove,
|
|
599
|
-
getScrollWidth
|
|
600
|
-
} = useTimeScroll();
|
|
601
|
-
const marginRight = getScrollWidth();
|
|
602
|
-
onMounted(() => {
|
|
603
|
-
getScrollWidth();
|
|
604
|
-
getScrollHeight();
|
|
605
|
-
scrollBoxDom.value.addEventListener("click", setVirtualScroll);
|
|
606
|
-
scrollContentDom.value.addEventListener("scroll", setVirtualScroll);
|
|
607
|
-
scrollThumbDom.value.addEventListener("mousedown", mouseDownThum);
|
|
608
|
-
document.addEventListener("mouseup", mouseOutThum);
|
|
609
|
-
document.addEventListener("mousemove", thumbMouseMove);
|
|
610
|
-
});
|
|
611
|
-
onBeforeUnmount(() => {
|
|
612
|
-
scrollBoxDom.value.removeEventListener("click", setVirtualScroll);
|
|
613
|
-
scrollContentDom.value.removeEventListener("scroll", setVirtualScroll);
|
|
614
|
-
scrollThumbDom.value.removeEventListener("mousedown", mouseDownThum);
|
|
615
|
-
});
|
|
616
|
-
onUnmounted(() => {
|
|
617
|
-
document.removeEventListener("mouseup", mouseOutThum);
|
|
618
|
-
document.removeEventListener("mousemove", thumbMouseMove);
|
|
619
|
-
});
|
|
620
|
-
return () => {
|
|
621
|
-
var _a, _b;
|
|
622
|
-
return createVNode(Fragment, null, [createVNode("div", {
|
|
623
|
-
"ref": scrollBoxDom,
|
|
624
|
-
"class": "devui-scroll-box"
|
|
625
|
-
}, [createVNode("div", {
|
|
626
|
-
"ref": scrollContentDom,
|
|
627
|
-
"class": `box-content ${isDown.value || !props.showAnimation ? "box-content-behavior-auto" : ""}`,
|
|
628
|
-
"style": {
|
|
629
|
-
"margin-right": marginRight + "px"
|
|
630
|
-
}
|
|
631
|
-
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]), createVNode("div", {
|
|
632
|
-
"ref": scrollTrackDom,
|
|
633
|
-
"class": "box-sroll",
|
|
634
|
-
"onClick": clickTrackFun
|
|
635
|
-
}, [createVNode("div", {
|
|
636
|
-
"ref": scrollThumbDom,
|
|
637
|
-
"class": "scroll-child"
|
|
638
|
-
}, null)])])]);
|
|
639
|
-
};
|
|
640
|
-
}
|
|
641
|
-
});
|
|
642
|
-
var index$2 = "";
|
|
643
|
-
var TimeList = defineComponent({
|
|
644
|
-
name: "DTimeList",
|
|
645
|
-
components: {
|
|
646
|
-
TimeScroll
|
|
647
|
-
},
|
|
648
|
-
props: {
|
|
649
|
-
hourList: {
|
|
650
|
-
type: Array,
|
|
651
|
-
default: () => []
|
|
652
|
-
},
|
|
653
|
-
minuteList: {
|
|
654
|
-
type: Array,
|
|
655
|
-
default: () => []
|
|
656
|
-
},
|
|
657
|
-
secondList: {
|
|
658
|
-
type: Array,
|
|
659
|
-
default: () => []
|
|
660
|
-
},
|
|
661
|
-
format: {
|
|
662
|
-
type: String,
|
|
663
|
-
default: "hh:mm:ss"
|
|
664
|
-
},
|
|
665
|
-
minTime: {
|
|
666
|
-
type: String,
|
|
667
|
-
default: "00:00:00"
|
|
668
|
-
},
|
|
669
|
-
maxTime: {
|
|
670
|
-
type: String,
|
|
671
|
-
default: "23:59:59"
|
|
672
|
-
}
|
|
673
|
-
},
|
|
674
|
-
setup(props, ctx) {
|
|
675
|
-
const timeListDom = ref();
|
|
676
|
-
const {
|
|
677
|
-
getNewTime,
|
|
678
|
-
activeTimeFun,
|
|
679
|
-
resetTimeValue,
|
|
680
|
-
resetScrollTop
|
|
681
|
-
} = usePopupLine(props.hourList, props.minuteList, props.secondList, props.minTime, props.maxTime, props.format, timeListDom);
|
|
682
|
-
const setOutoTime = (time) => {
|
|
683
|
-
resetTimeValue(time);
|
|
684
|
-
};
|
|
685
|
-
const TimeLi = (timeArr) => {
|
|
686
|
-
return timeArr.map((item, index2) => {
|
|
687
|
-
return createVNode("li", {
|
|
688
|
-
"class": `time-li ${item.flag}Id-${index2} ${item.isActive ? "active-li" : ""} ${item.isDisabled ? "disabled-li" : ""}`,
|
|
689
|
-
"onClick": (e) => {
|
|
690
|
-
activeTimeFun(e, item, index2);
|
|
691
|
-
}
|
|
692
|
-
}, [createVNode("span", null, [item.time])]);
|
|
693
|
-
});
|
|
694
|
-
};
|
|
695
|
-
const TimeUl = (timeList) => {
|
|
696
|
-
return createVNode("div", {
|
|
697
|
-
"class": "time-item",
|
|
698
|
-
"style": {
|
|
699
|
-
"flex": 1
|
|
700
|
-
}
|
|
701
|
-
}, [createVNode(TimeScroll, null, {
|
|
702
|
-
default: () => [createVNode("ul", {
|
|
703
|
-
"class": "time-ul"
|
|
704
|
-
}, [TimeLi(timeList)])]
|
|
705
|
-
})]);
|
|
706
|
-
};
|
|
707
|
-
const formatTimeUl = () => {
|
|
708
|
-
const timeList = {
|
|
709
|
-
"hh": props.hourList,
|
|
710
|
-
"mm": props.minuteList,
|
|
711
|
-
"ss": props.secondList
|
|
712
|
-
};
|
|
713
|
-
const timeFormatArr = props.format.split(":");
|
|
714
|
-
return timeFormatArr.map((timeItme) => {
|
|
715
|
-
return TimeUl(timeList[timeItme]);
|
|
716
|
-
});
|
|
717
|
-
};
|
|
718
|
-
ctx.expose({
|
|
719
|
-
resetScrollTop,
|
|
720
|
-
setOutoTime,
|
|
721
|
-
getNewTime
|
|
722
|
-
});
|
|
723
|
-
return () => {
|
|
724
|
-
return createVNode("div", {
|
|
725
|
-
"class": "devui-time-list",
|
|
726
|
-
"ref": timeListDom
|
|
727
|
-
}, [formatTimeUl()]);
|
|
728
|
-
};
|
|
729
|
-
}
|
|
730
|
-
});
|
|
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
|
-
};
|
|
788
|
-
},
|
|
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: {
|
|
929
|
-
type: String,
|
|
930
|
-
default: "outline"
|
|
931
|
-
},
|
|
932
|
-
size: {
|
|
933
|
-
type: String,
|
|
934
|
-
default: "md"
|
|
935
|
-
},
|
|
936
|
-
color: {
|
|
937
|
-
type: String
|
|
938
|
-
},
|
|
939
|
-
icon: {
|
|
940
|
-
type: String,
|
|
941
|
-
default: ""
|
|
942
|
-
},
|
|
943
|
-
loading: {
|
|
944
|
-
type: Boolean,
|
|
945
|
-
default: false
|
|
946
|
-
},
|
|
947
|
-
disabled: {
|
|
948
|
-
type: Boolean,
|
|
949
|
-
default: false
|
|
950
|
-
}
|
|
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
|
-
}
|
|
981
|
-
var button = "";
|
|
982
|
-
var Button = defineComponent({
|
|
983
|
-
name: "DButton",
|
|
984
|
-
directives: {
|
|
985
|
-
devLoading: loadingDirective
|
|
986
|
-
},
|
|
987
|
-
props: buttonProps,
|
|
988
|
-
emits: ["click"],
|
|
989
|
-
setup(props, ctx) {
|
|
990
|
-
const {
|
|
991
|
-
icon,
|
|
992
|
-
disabled,
|
|
993
|
-
loading: loading2
|
|
994
|
-
} = toRefs(props);
|
|
995
|
-
const {
|
|
996
|
-
classes,
|
|
997
|
-
iconClass
|
|
998
|
-
} = useButton(props, ctx);
|
|
999
|
-
const onClick = (e) => {
|
|
1000
|
-
if (loading2.value) {
|
|
1001
|
-
return;
|
|
1002
|
-
}
|
|
1003
|
-
ctx.emit("click", e);
|
|
1004
|
-
};
|
|
1005
|
-
return () => {
|
|
1006
|
-
var _a, _b;
|
|
1007
|
-
return withDirectives(createVNode("button", {
|
|
1008
|
-
"class": classes.value,
|
|
1009
|
-
"disabled": disabled.value,
|
|
1010
|
-
"onClick": onClick
|
|
1011
|
-
}, [icon.value && createVNode(Icon, {
|
|
1012
|
-
"name": icon.value,
|
|
1013
|
-
"size": "12px",
|
|
1014
|
-
"class": iconClass.value
|
|
1015
|
-
}, null), createVNode("span", {
|
|
1016
|
-
"class": "button-content"
|
|
1017
|
-
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])]), [[resolveDirective("dLoading"), loading2.value]]);
|
|
1018
|
-
};
|
|
1019
|
-
}
|
|
1020
|
-
});
|
|
1021
|
-
var index$1 = "";
|
|
1022
|
-
var TimePopup = defineComponent({
|
|
1023
|
-
name: "DTimePopup",
|
|
1024
|
-
components: {
|
|
1025
|
-
TimeList,
|
|
1026
|
-
Button
|
|
1027
|
-
},
|
|
1028
|
-
props: {
|
|
1029
|
-
showPopup: {
|
|
1030
|
-
type: Boolean,
|
|
1031
|
-
default: false
|
|
1032
|
-
},
|
|
1033
|
-
popupTop: {
|
|
1034
|
-
type: Number,
|
|
1035
|
-
default: -100
|
|
1036
|
-
},
|
|
1037
|
-
popupLeft: {
|
|
1038
|
-
type: Number,
|
|
1039
|
-
default: -100
|
|
1040
|
-
},
|
|
1041
|
-
popupWidth: {
|
|
1042
|
-
type: Number,
|
|
1043
|
-
default: 300
|
|
1044
|
-
},
|
|
1045
|
-
popupFormat: {
|
|
1046
|
-
type: String,
|
|
1047
|
-
default: "hh:mm:ss"
|
|
1048
|
-
},
|
|
1049
|
-
minTime: {
|
|
1050
|
-
type: String,
|
|
1051
|
-
default: "00:00:00"
|
|
1052
|
-
},
|
|
1053
|
-
maxTime: {
|
|
1054
|
-
type: String,
|
|
1055
|
-
default: "23:59:59"
|
|
1056
|
-
},
|
|
1057
|
-
bindData: {
|
|
1058
|
-
type: String,
|
|
1059
|
-
default: "00:00:00"
|
|
1060
|
-
}
|
|
1061
|
-
},
|
|
1062
|
-
emits: ["subData"],
|
|
1063
|
-
setup(props, ctx) {
|
|
1064
|
-
const popupDome = ref();
|
|
1065
|
-
const timeListDom = ref();
|
|
1066
|
-
const hourList = initializeTimeData("hour");
|
|
1067
|
-
const minuteList = initializeTimeData("minute");
|
|
1068
|
-
const secondList = initializeTimeData("second");
|
|
1069
|
-
onMounted(() => {
|
|
1070
|
-
setTimeAstrict(hourList, minuteList, secondList, props.minTime, props.maxTime, props.popupFormat);
|
|
1071
|
-
});
|
|
1072
|
-
watch(() => [props.showPopup, props.bindData], ([showPopup, newTimeVal], [oldShowPopup, oldTimeVal]) => {
|
|
1073
|
-
if (showPopup || newTimeVal != oldTimeVal) {
|
|
1074
|
-
timeListDom.value.setOutoTime(newTimeVal);
|
|
1075
|
-
} else {
|
|
1076
|
-
timeListDom.value.resetScrollTop();
|
|
1077
|
-
}
|
|
1078
|
-
});
|
|
1079
|
-
const changTimeData = () => {
|
|
1080
|
-
return timeListDom.value.getNewTime();
|
|
1081
|
-
};
|
|
1082
|
-
const subDataFun = (e) => {
|
|
1083
|
-
e.stopPropagation();
|
|
1084
|
-
ctx.emit("subData");
|
|
1085
|
-
};
|
|
1086
|
-
ctx.expose({
|
|
1087
|
-
changTimeData
|
|
1088
|
-
});
|
|
1089
|
-
return () => {
|
|
1090
|
-
var _a, _b;
|
|
1091
|
-
return createVNode(Fragment, null, [createVNode("div", {
|
|
1092
|
-
"ref": popupDome,
|
|
1093
|
-
"class": `devui-time-popup ${props.showPopup ? "devui-show-time-popup" : ""}`,
|
|
1094
|
-
"style": {
|
|
1095
|
-
"width": props.popupWidth + "px",
|
|
1096
|
-
"top": props.popupTop + "px",
|
|
1097
|
-
"left": props.popupLeft + "px"
|
|
1098
|
-
}
|
|
1099
|
-
}, [createVNode(TimeList, {
|
|
1100
|
-
"ref": timeListDom,
|
|
1101
|
-
"hourList": hourList,
|
|
1102
|
-
"minuteList": minuteList,
|
|
1103
|
-
"secondList": secondList,
|
|
1104
|
-
"minTime": props.minTime,
|
|
1105
|
-
"maxTime": props.maxTime,
|
|
1106
|
-
"format": props.popupFormat
|
|
1107
|
-
}, null), createVNode("div", {
|
|
1108
|
-
"class": "devui-time-popup-btn"
|
|
1109
|
-
}, [createVNode("div", {
|
|
1110
|
-
"class": "popup-slots"
|
|
1111
|
-
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]), createVNode("div", {
|
|
1112
|
-
"onClick": subDataFun
|
|
1113
|
-
}, [createVNode(Button, {
|
|
1114
|
-
"variant": "common"
|
|
1115
|
-
}, {
|
|
1116
|
-
default: () => [createTextVNode("\u786E\u5B9A")]
|
|
1117
|
-
})])])])]);
|
|
1118
|
-
};
|
|
1119
|
-
}
|
|
1120
|
-
});
|
|
1121
|
-
var timePicker = "";
|
|
1122
|
-
var TimePicker = defineComponent({
|
|
1123
|
-
name: "DTimePicker",
|
|
1124
|
-
components: {
|
|
1125
|
-
TimePopup
|
|
1126
|
-
},
|
|
1127
|
-
props: timePickerProps,
|
|
1128
|
-
emits: ["selectedTimeChage", "update:modelValue"],
|
|
1129
|
-
setup(props, ctx) {
|
|
1130
|
-
const activeHour = ref("00");
|
|
1131
|
-
const activeMinute = ref("00");
|
|
1132
|
-
const activeSecond = ref("00");
|
|
1133
|
-
const format = props.format.toLowerCase();
|
|
1134
|
-
const {
|
|
1135
|
-
isActive,
|
|
1136
|
-
showPopup,
|
|
1137
|
-
devuiTimePicker,
|
|
1138
|
-
inputDom,
|
|
1139
|
-
left,
|
|
1140
|
-
top,
|
|
1141
|
-
showClearIcon,
|
|
1142
|
-
firsthandActiveTime,
|
|
1143
|
-
chooseTime,
|
|
1144
|
-
getTimeValue,
|
|
1145
|
-
clickVerifyFun,
|
|
1146
|
-
isOutOpen,
|
|
1147
|
-
vModelIsBeyond,
|
|
1148
|
-
clearAll,
|
|
1149
|
-
timePopupDom,
|
|
1150
|
-
vModeValue,
|
|
1151
|
-
getPopupPosition
|
|
1152
|
-
} = useTimePicker(activeHour, activeMinute, activeSecond, props.minTime, props.maxTime, format, props.autoOpen, props.disabled, props.modelValue);
|
|
1153
|
-
const selectedTimeChage = (e) => {
|
|
1154
|
-
isActive.value = false;
|
|
1155
|
-
showPopup.value = false;
|
|
1156
|
-
ctx.emit("selectedTimeChage", vModeValue.value);
|
|
1157
|
-
};
|
|
1158
|
-
onMounted(() => {
|
|
1159
|
-
getPopupPosition();
|
|
1160
|
-
isOutOpen();
|
|
1161
|
-
vModelIsBeyond();
|
|
1162
|
-
document.addEventListener("click", clickVerifyFun);
|
|
1163
|
-
document.addEventListener("click", getTimeValue);
|
|
1164
|
-
document.addEventListener("scroll", getPopupPosition);
|
|
1165
|
-
window.addEventListener("resize", getPopupPosition);
|
|
1166
|
-
});
|
|
1167
|
-
onUnmounted(() => {
|
|
1168
|
-
document.removeEventListener("click", clickVerifyFun);
|
|
1169
|
-
document.removeEventListener("click", getTimeValue);
|
|
1170
|
-
document.removeEventListener("scroll", getPopupPosition);
|
|
1171
|
-
window.removeEventListener("resize", getPopupPosition);
|
|
1172
|
-
});
|
|
1173
|
-
watch(vModeValue, (newValue) => {
|
|
1174
|
-
ctx.emit("update:modelValue", vModeValue.value);
|
|
1175
|
-
if (newValue != props.minTime && newValue != "00:00") {
|
|
1176
|
-
showClearIcon.value = true;
|
|
1177
|
-
} else {
|
|
1178
|
-
showClearIcon.value = false;
|
|
1179
|
-
}
|
|
1180
|
-
});
|
|
1181
|
-
ctx.expose({
|
|
1182
|
-
clearAll,
|
|
1183
|
-
chooseTime
|
|
1184
|
-
});
|
|
1185
|
-
return () => {
|
|
1186
|
-
return createVNode(Fragment, null, [createVNode("div", {
|
|
1187
|
-
"class": `devui-time-picker ${isActive.value ? "time-picker-active" : ""} ${props.disabled ? "picker-disabled" : ""}`,
|
|
1188
|
-
"ref": devuiTimePicker
|
|
1189
|
-
}, [createVNode(TimePopup, {
|
|
1190
|
-
"ref": timePopupDom,
|
|
1191
|
-
"showPopup": showPopup.value,
|
|
1192
|
-
"popupTop": top.value,
|
|
1193
|
-
"popupLeft": left.value,
|
|
1194
|
-
"popupWidth": props.timePickerWidth,
|
|
1195
|
-
"popupFormat": props.format.toLowerCase(),
|
|
1196
|
-
"minTime": props.minTime,
|
|
1197
|
-
"maxTime": props.maxTime,
|
|
1198
|
-
"bindData": firsthandActiveTime.value,
|
|
1199
|
-
"onSubData": selectedTimeChage
|
|
1200
|
-
}, {
|
|
1201
|
-
default: () => {
|
|
1202
|
-
var _a, _b;
|
|
1203
|
-
return [(_b = (_a = ctx.slots).customViewTemplate) == null ? void 0 : _b.call(_a)];
|
|
1204
|
-
}
|
|
1205
|
-
}), createVNode("input", {
|
|
1206
|
-
"ref": inputDom,
|
|
1207
|
-
"type": "text",
|
|
1208
|
-
"value": vModeValue.value,
|
|
1209
|
-
"placeholder": `${props.placeholder}`,
|
|
1210
|
-
"disabled": props.disabled,
|
|
1211
|
-
"class": "time-input"
|
|
1212
|
-
}, null), createVNode("div", {
|
|
1213
|
-
"class": "time-input-icon"
|
|
1214
|
-
}, [createVNode("div", {
|
|
1215
|
-
"onClick": clearAll
|
|
1216
|
-
}, [showClearIcon.value ? createVNode(Icon, {
|
|
1217
|
-
"size": "small",
|
|
1218
|
-
"name": "close"
|
|
1219
|
-
}, null) : ""]), createVNode("div", null, [createVNode(Icon, {
|
|
1220
|
-
"size": "small",
|
|
1221
|
-
"name": "time"
|
|
1222
|
-
}, null)])])])]);
|
|
1223
|
-
};
|
|
1224
|
-
}
|
|
1225
|
-
});
|
|
1226
|
-
TimePicker.install = function(app) {
|
|
1227
|
-
app.component(TimePicker.name, TimePicker);
|
|
1228
|
-
};
|
|
1229
|
-
var index = {
|
|
1230
|
-
title: "TimePicker \u65F6\u95F4\u9009\u62E9\u5668",
|
|
1231
|
-
category: "\u6570\u636E\u5F55\u5165",
|
|
1232
|
-
status: "90%",
|
|
1233
|
-
install(app) {
|
|
1234
|
-
app.use(TimePicker);
|
|
1235
|
-
}
|
|
1236
|
-
};
|
|
1237
|
-
export { TimePicker, index as default };
|