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.
Files changed (353) hide show
  1. package/README.md +78 -116
  2. package/alert/index.es.js +74 -45
  3. package/alert/index.umd.js +1 -1
  4. package/alert/style.css +1 -1
  5. package/auto-complete/index.es.js +8190 -296
  6. package/auto-complete/index.umd.js +29 -1
  7. package/auto-complete/style.css +1 -1
  8. package/avatar/index.es.js +153 -146
  9. package/avatar/index.umd.js +1 -1
  10. package/avatar/style.css +1 -1
  11. package/badge/index.es.js +34 -5
  12. package/badge/index.umd.js +1 -1
  13. package/badge/style.css +1 -1
  14. package/button/index.es.js +5741 -127
  15. package/button/index.umd.js +27 -1
  16. package/button/style.css +1 -1
  17. package/card/index.es.js +63 -35
  18. package/card/index.umd.js +1 -1
  19. package/card/style.css +1 -1
  20. package/checkbox/index.es.js +8068 -255
  21. package/checkbox/index.umd.js +27 -1
  22. package/checkbox/style.css +1 -1
  23. package/{accordion → collapse}/index.d.ts +0 -0
  24. package/collapse/index.es.js +379 -0
  25. package/collapse/index.umd.js +1 -0
  26. package/{anchor → collapse}/package.json +1 -1
  27. package/collapse/style.css +1 -0
  28. package/countdown/index.es.js +5 -7
  29. package/countdown/index.umd.js +1 -1
  30. package/date-picker/index.es.js +8167 -288
  31. package/date-picker/index.umd.js +27 -1
  32. package/date-picker/style.css +1 -1
  33. package/drawer/index.es.js +31 -4
  34. package/drawer/index.umd.js +1 -1
  35. package/drawer/style.css +1 -1
  36. package/dropdown/index.es.js +297 -181
  37. package/dropdown/index.umd.js +1 -1
  38. package/dropdown/style.css +1 -1
  39. package/editable-select/index.es.js +525 -154
  40. package/editable-select/index.umd.js +1 -1
  41. package/editable-select/style.css +1 -1
  42. package/form/index.es.js +1048 -1176
  43. package/form/index.umd.js +16 -16
  44. package/form/style.css +1 -1
  45. package/fullscreen/index.es.js +42 -21
  46. package/fullscreen/index.umd.js +1 -1
  47. package/fullscreen/style.css +1 -1
  48. package/grid/index.es.js +101 -86
  49. package/grid/index.umd.js +1 -1
  50. package/grid/style.css +1 -1
  51. package/icon/index.es.js +197 -56
  52. package/icon/index.umd.js +1 -1
  53. package/icon/style.css +1 -0
  54. package/image-preview/index.es.js +55 -31
  55. package/image-preview/index.umd.js +1 -1
  56. package/image-preview/style.css +1 -1
  57. package/input/index.es.js +8074 -144
  58. package/input/index.umd.js +27 -1
  59. package/input/style.css +1 -1
  60. package/input-number/index.es.js +269 -183
  61. package/input-number/index.umd.js +1 -1
  62. package/input-number/style.css +1 -1
  63. package/layout/index.es.js +40 -25
  64. package/layout/index.umd.js +1 -1
  65. package/layout/style.css +1 -1
  66. package/loading/index.es.js +74 -35
  67. package/loading/index.umd.js +1 -1
  68. package/loading/style.css +1 -1
  69. package/modal/index.es.js +412 -204
  70. package/modal/index.umd.js +1 -1
  71. package/modal/style.css +1 -1
  72. package/notification/index.es.js +307 -57
  73. package/notification/index.umd.js +1 -1
  74. package/notification/style.css +1 -1
  75. package/nuxt/components/ButtonGroup.js +3 -0
  76. package/nuxt/components/CheckboxButton.js +3 -0
  77. package/nuxt/components/CheckboxGroup.js +3 -0
  78. package/nuxt/components/Collapse.js +3 -0
  79. package/nuxt/components/CollapseItem.js +3 -0
  80. package/nuxt/components/DropdownPropsKey.js +3 -0
  81. package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
  82. package/nuxt/components/FORM_TOKEN.js +3 -0
  83. package/nuxt/components/Icon.js +1 -0
  84. package/nuxt/components/IconGroup.js +3 -0
  85. package/nuxt/components/LABEL_DATA.js +3 -0
  86. package/nuxt/components/LoadingOptions.js +3 -0
  87. package/nuxt/components/Option.js +3 -0
  88. package/nuxt/components/PanelBody.js +3 -0
  89. package/nuxt/components/PanelFooter.js +3 -0
  90. package/nuxt/components/PanelHeader.js +3 -0
  91. package/nuxt/components/RadioButton.js +3 -0
  92. package/nuxt/components/TABLE_TOKEN.js +3 -0
  93. package/nuxt/components/Tab.js +3 -0
  94. package/nuxt/components/TimeSelect.js +3 -0
  95. package/nuxt/components/Timeline.js +3 -0
  96. package/nuxt/components/TimelineItem.js +3 -0
  97. package/nuxt/components/alertProps.js +3 -0
  98. package/nuxt/components/autoCompleteProps.js +3 -0
  99. package/nuxt/components/avatarProps.js +3 -0
  100. package/nuxt/components/buttonGroupInjectionKey.js +3 -0
  101. package/nuxt/components/buttonGroupProps.js +3 -0
  102. package/nuxt/components/cardProps.js +3 -0
  103. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  104. package/nuxt/components/checkboxGroupProps.js +3 -0
  105. package/nuxt/components/checkboxProps.js +3 -0
  106. package/nuxt/components/colProps.js +3 -0
  107. package/nuxt/components/colPropsBaseClass.js +3 -0
  108. package/nuxt/components/colPropsBaseStyle.js +3 -0
  109. package/nuxt/components/collapseItemProps.js +3 -0
  110. package/nuxt/components/collapseProps.js +3 -0
  111. package/nuxt/components/countdownProps.js +3 -0
  112. package/nuxt/components/editableSelectProps.js +3 -0
  113. package/nuxt/components/formItemProps.js +3 -0
  114. package/nuxt/components/formProps.js +3 -0
  115. package/nuxt/components/fullscreenProps.js +3 -0
  116. package/nuxt/components/iconProps.js +3 -0
  117. package/nuxt/components/imagePreviewProps.js +3 -0
  118. package/nuxt/components/inputProps.js +3 -0
  119. package/nuxt/components/loadingProps.js +3 -0
  120. package/nuxt/components/modalProps.js +3 -0
  121. package/nuxt/components/paginationProps.js +3 -0
  122. package/nuxt/components/panelProps.js +3 -0
  123. package/nuxt/components/progressProps.js +3 -0
  124. package/nuxt/components/rateProps.js +3 -0
  125. package/nuxt/components/resultProps.js +3 -0
  126. package/nuxt/components/rowProps.js +3 -0
  127. package/nuxt/components/screenSizes.js +3 -0
  128. package/nuxt/components/searchProps.js +3 -0
  129. package/nuxt/components/skeletonProps.js +3 -0
  130. package/nuxt/components/sliderProps.js +3 -0
  131. package/nuxt/components/splitterProps.js +3 -0
  132. package/nuxt/components/statisticProps.js +3 -0
  133. package/nuxt/components/svgIconProps.js +3 -0
  134. package/nuxt/components/switchProps.js +3 -0
  135. package/nuxt/components/tableProps.js +3 -0
  136. package/nuxt/components/tabsProps.js +3 -0
  137. package/nuxt/components/tagProps.js +3 -0
  138. package/nuxt/components/textareaProps.js +3 -0
  139. package/nuxt/components/timeAxisProps.js +3 -0
  140. package/nuxt/components/treeProps.js +3 -0
  141. package/overlay/index.es.js +127 -149
  142. package/overlay/index.umd.js +1 -1
  143. package/overlay/style.css +1 -1
  144. package/package.json +11 -44
  145. package/pagination/index.es.js +158 -148
  146. package/pagination/index.umd.js +1 -1
  147. package/pagination/style.css +1 -1
  148. package/panel/index.es.js +45 -32
  149. package/panel/index.umd.js +1 -1
  150. package/panel/style.css +1 -1
  151. package/popover/index.es.js +317 -246
  152. package/popover/index.umd.js +15 -15
  153. package/popover/style.css +1 -1
  154. package/progress/index.es.js +110 -56
  155. package/progress/index.umd.js +3 -3
  156. package/progress/style.css +1 -1
  157. package/radio/index.es.js +7972 -157
  158. package/radio/index.umd.js +27 -1
  159. package/radio/style.css +1 -1
  160. package/rate/index.es.js +77 -55
  161. package/rate/index.umd.js +1 -1
  162. package/rate/style.css +1 -1
  163. package/result/index.es.js +184 -57
  164. package/result/index.umd.js +1 -1
  165. package/result/style.css +1 -1
  166. package/ripple/index.es.js +47 -42
  167. package/ripple/index.umd.js +1 -1
  168. package/search/index.es.js +3653 -1122
  169. package/search/index.umd.js +18 -18
  170. package/search/style.css +1 -1
  171. package/select/index.es.js +9170 -596
  172. package/select/index.umd.js +27 -1
  173. package/select/style.css +1 -1
  174. package/skeleton/index.es.js +63 -41
  175. package/skeleton/index.umd.js +1 -1
  176. package/skeleton/style.css +1 -1
  177. package/slider/index.es.js +144 -137
  178. package/slider/index.umd.js +1 -1
  179. package/slider/style.css +1 -1
  180. package/splitter/index.es.js +469 -349
  181. package/splitter/index.umd.js +15 -15
  182. package/splitter/style.css +1 -1
  183. package/statistic/index.es.js +41 -34
  184. package/statistic/index.umd.js +1 -1
  185. package/statistic/style.css +1 -1
  186. package/status/index.es.js +27 -6
  187. package/status/index.umd.js +1 -1
  188. package/status/style.css +1 -1
  189. package/style.css +1 -1
  190. package/switch/index.es.js +7802 -64
  191. package/switch/index.umd.js +27 -1
  192. package/switch/style.css +1 -1
  193. package/table/index.es.js +10459 -1511
  194. package/table/index.umd.js +27 -1
  195. package/table/style.css +1 -1
  196. package/tabs/index.es.js +344 -141
  197. package/tabs/index.umd.js +1 -1
  198. package/tabs/style.css +1 -1
  199. package/tag/index.es.js +49 -24
  200. package/tag/index.umd.js +1 -1
  201. package/tag/style.css +1 -1
  202. package/textarea/index.es.js +7921 -83
  203. package/textarea/index.umd.js +35 -1
  204. package/textarea/style.css +1 -1
  205. package/{anchor → time-select}/index.d.ts +0 -0
  206. package/{color-picker → time-select}/index.es.js +4171 -2898
  207. package/time-select/index.umd.js +27 -0
  208. package/{breadcrumb → time-select}/package.json +1 -1
  209. package/time-select/style.css +1 -0
  210. package/{back-top → timeline}/index.d.ts +0 -0
  211. package/timeline/index.es.js +425 -0
  212. package/timeline/index.umd.js +1 -0
  213. package/{back-top → timeline}/package.json +1 -1
  214. package/timeline/style.css +1 -0
  215. package/tooltip/index.es.js +308 -236
  216. package/tooltip/index.umd.js +15 -15
  217. package/tooltip/style.css +1 -1
  218. package/tree/index.es.js +5198 -1850
  219. package/tree/index.umd.js +18 -18
  220. package/tree/style.css +1 -1
  221. package/upload/index.es.js +427 -132
  222. package/upload/index.umd.js +1 -1
  223. package/upload/style.css +1 -1
  224. package/vue-devui.es.js +12064 -15841
  225. package/vue-devui.umd.js +30 -20
  226. package/accordion/index.es.js +0 -720
  227. package/accordion/index.umd.js +0 -1
  228. package/accordion/package.json +0 -7
  229. package/accordion/style.css +0 -1
  230. package/anchor/index.es.js +0 -263
  231. package/anchor/index.umd.js +0 -1
  232. package/anchor/style.css +0 -1
  233. package/back-top/index.es.js +0 -128
  234. package/back-top/index.umd.js +0 -1
  235. package/back-top/style.css +0 -1
  236. package/breadcrumb/index.d.ts +0 -7
  237. package/breadcrumb/index.es.js +0 -127
  238. package/breadcrumb/index.umd.js +0 -1
  239. package/breadcrumb/style.css +0 -1
  240. package/carousel/index.d.ts +0 -7
  241. package/carousel/index.es.js +0 -329
  242. package/carousel/index.umd.js +0 -1
  243. package/carousel/package.json +0 -7
  244. package/carousel/style.css +0 -1
  245. package/cascader/index.d.ts +0 -7
  246. package/cascader/index.es.js +0 -5963
  247. package/cascader/index.umd.js +0 -27
  248. package/cascader/package.json +0 -7
  249. package/cascader/style.css +0 -1
  250. package/color-picker/index.d.ts +0 -7
  251. package/color-picker/index.umd.js +0 -27
  252. package/color-picker/package.json +0 -7
  253. package/color-picker/style.css +0 -1
  254. package/comment/index.d.ts +0 -7
  255. package/comment/index.es.js +0 -86
  256. package/comment/index.umd.js +0 -1
  257. package/comment/package.json +0 -7
  258. package/comment/style.css +0 -1
  259. package/dragdrop/index.d.ts +0 -7
  260. package/dragdrop/index.es.js +0 -157
  261. package/dragdrop/index.umd.js +0 -1
  262. package/dragdrop/package.json +0 -7
  263. package/gantt/index.d.ts +0 -7
  264. package/gantt/index.es.js +0 -523
  265. package/gantt/index.umd.js +0 -1
  266. package/gantt/package.json +0 -7
  267. package/gantt/style.css +0 -1
  268. package/input-icon/index.d.ts +0 -7
  269. package/input-icon/index.es.js +0 -331
  270. package/input-icon/index.umd.js +0 -1
  271. package/input-icon/package.json +0 -7
  272. package/input-icon/style.css +0 -1
  273. package/list/index.d.ts +0 -7
  274. package/list/index.es.js +0 -39
  275. package/list/index.umd.js +0 -1
  276. package/list/package.json +0 -7
  277. package/list/style.css +0 -1
  278. package/nav-sprite/index.d.ts +0 -7
  279. package/nav-sprite/index.es.js +0 -68
  280. package/nav-sprite/index.umd.js +0 -1
  281. package/nav-sprite/package.json +0 -7
  282. package/nuxt/components/Accordion.js +0 -3
  283. package/nuxt/components/Anchor.js +0 -3
  284. package/nuxt/components/BackTop.js +0 -3
  285. package/nuxt/components/Breadcrumb.js +0 -3
  286. package/nuxt/components/Carousel.js +0 -3
  287. package/nuxt/components/CarouselItem.js +0 -3
  288. package/nuxt/components/Cascader.js +0 -3
  289. package/nuxt/components/ColorPicker.js +0 -3
  290. package/nuxt/components/Comment.js +0 -3
  291. package/nuxt/components/FormControl.js +0 -3
  292. package/nuxt/components/FormLabel.js +0 -3
  293. package/nuxt/components/Gantt.js +0 -3
  294. package/nuxt/components/InputIcon.js +0 -3
  295. package/nuxt/components/List.js +0 -3
  296. package/nuxt/components/ListItem.js +0 -3
  297. package/nuxt/components/NavSprite.js +0 -2
  298. package/nuxt/components/QuadrantDiagram.js +0 -3
  299. package/nuxt/components/ReadTip.js +0 -3
  300. package/nuxt/components/StepsGuide.js +0 -3
  301. package/nuxt/components/Sticky.js +0 -2
  302. package/nuxt/components/TagInput.js +0 -3
  303. package/nuxt/components/TimeAxis.js +0 -3
  304. package/nuxt/components/TimeAxisItem.js +0 -3
  305. package/nuxt/components/TimePicker.js +0 -3
  306. package/nuxt/components/Transfer.js +0 -3
  307. package/nuxt/components/TreeSelect.js +0 -3
  308. package/nuxt/components/overlayEmits.js +0 -3
  309. package/nuxt/components/overlayProps.js +0 -3
  310. package/quadrant-diagram/index.d.ts +0 -7
  311. package/quadrant-diagram/index.es.js +0 -5728
  312. package/quadrant-diagram/index.umd.js +0 -27
  313. package/quadrant-diagram/package.json +0 -7
  314. package/quadrant-diagram/style.css +0 -1
  315. package/read-tip/index.d.ts +0 -7
  316. package/read-tip/index.es.js +0 -258
  317. package/read-tip/index.umd.js +0 -1
  318. package/read-tip/package.json +0 -7
  319. package/read-tip/style.css +0 -1
  320. package/steps-guide/index.d.ts +0 -7
  321. package/steps-guide/index.es.js +0 -239
  322. package/steps-guide/index.umd.js +0 -1
  323. package/steps-guide/package.json +0 -7
  324. package/steps-guide/style.css +0 -1
  325. package/sticky/index.d.ts +0 -7
  326. package/sticky/index.es.js +0 -197
  327. package/sticky/index.umd.js +0 -1
  328. package/sticky/package.json +0 -7
  329. package/tag-input/index.d.ts +0 -7
  330. package/tag-input/index.es.js +0 -329
  331. package/tag-input/index.umd.js +0 -1
  332. package/tag-input/package.json +0 -7
  333. package/tag-input/style.css +0 -1
  334. package/time-axis/index.d.ts +0 -7
  335. package/time-axis/index.es.js +0 -299
  336. package/time-axis/index.umd.js +0 -1
  337. package/time-axis/package.json +0 -7
  338. package/time-axis/style.css +0 -1
  339. package/time-picker/index.d.ts +0 -7
  340. package/time-picker/index.es.js +0 -1237
  341. package/time-picker/index.umd.js +0 -1
  342. package/time-picker/package.json +0 -7
  343. package/time-picker/style.css +0 -1
  344. package/transfer/index.d.ts +0 -7
  345. package/transfer/index.es.js +0 -7608
  346. package/transfer/index.umd.js +0 -27
  347. package/transfer/package.json +0 -7
  348. package/transfer/style.css +0 -1
  349. package/tree-select/index.d.ts +0 -7
  350. package/tree-select/index.es.js +0 -623
  351. package/tree-select/index.umd.js +0 -1
  352. package/tree-select/package.json +0 -7
  353. package/tree-select/style.css +0 -1
@@ -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 };