vue-devui 1.0.0-alpha.5 → 1.0.0-beta.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 (344) hide show
  1. package/README.md +31 -36
  2. package/accordion/index.d.ts +7 -0
  3. package/accordion/index.es.js +508 -1
  4. package/accordion/index.umd.js +1 -1
  5. package/accordion/style.css +1 -1
  6. package/alert/index.d.ts +7 -0
  7. package/alert/index.es.js +175 -1
  8. package/alert/index.umd.js +1 -1
  9. package/alert/style.css +1 -1
  10. package/anchor/index.d.ts +7 -0
  11. package/anchor/index.es.js +263 -1
  12. package/anchor/index.umd.js +1 -1
  13. package/avatar/index.d.ts +7 -0
  14. package/avatar/index.es.js +301 -1
  15. package/avatar/index.umd.js +1 -1
  16. package/back-top/index.d.ts +7 -0
  17. package/back-top/index.es.js +128 -0
  18. package/back-top/index.umd.js +1 -0
  19. package/back-top/package.json +7 -0
  20. package/back-top/style.css +1 -0
  21. package/badge/index.d.ts +7 -0
  22. package/badge/index.es.js +95 -1
  23. package/badge/index.umd.js +1 -1
  24. package/breadcrumb/index.d.ts +7 -0
  25. package/breadcrumb/index.es.js +127 -1
  26. package/breadcrumb/index.umd.js +1 -1
  27. package/button/index.d.ts +7 -0
  28. package/button/index.es.js +392 -1
  29. package/button/index.umd.js +1 -1
  30. package/button/style.css +1 -1
  31. package/card/index.d.ts +7 -0
  32. package/card/index.es.js +61 -1
  33. package/card/index.umd.js +1 -1
  34. package/carousel/index.d.ts +7 -0
  35. package/carousel/index.es.js +329 -1
  36. package/carousel/index.umd.js +1 -1
  37. package/cascader/index.d.ts +7 -0
  38. package/cascader/index.es.js +1343 -1
  39. package/cascader/index.umd.js +1 -1
  40. package/cascader/style.css +1 -1
  41. package/checkbox/index.d.ts +7 -0
  42. package/checkbox/index.es.js +377 -1
  43. package/checkbox/index.umd.js +1 -1
  44. package/comment/index.d.ts +7 -0
  45. package/comment/index.es.js +85 -0
  46. package/comment/index.umd.js +1 -0
  47. package/comment/package.json +7 -0
  48. package/comment/style.css +1 -0
  49. package/countdown/index.d.ts +7 -0
  50. package/countdown/index.es.js +176 -0
  51. package/countdown/index.umd.js +1 -0
  52. package/countdown/package.json +7 -0
  53. package/countdown/style.css +1 -0
  54. package/date-picker/index.d.ts +7 -0
  55. package/date-picker/index.es.js +1172 -1
  56. package/date-picker/index.umd.js +1 -1
  57. package/date-picker/style.css +1 -1
  58. package/dragdrop/index.d.ts +7 -0
  59. package/dragdrop/index.es.js +32 -0
  60. package/dragdrop/index.umd.js +1 -0
  61. package/dragdrop/package.json +7 -0
  62. package/drawer/index.d.ts +7 -0
  63. package/drawer/index.es.js +287 -0
  64. package/drawer/index.umd.js +1 -0
  65. package/drawer/package.json +7 -0
  66. package/drawer/style.css +1 -0
  67. package/dropdown/index.d.ts +7 -0
  68. package/dropdown/index.es.js +527 -0
  69. package/dropdown/index.umd.js +1 -0
  70. package/dropdown/package.json +7 -0
  71. package/dropdown/style.css +1 -0
  72. package/editable-select/index.d.ts +7 -0
  73. package/editable-select/index.es.js +5857 -1
  74. package/editable-select/index.umd.js +27 -1
  75. package/editable-select/style.css +1 -1
  76. package/form/index.d.ts +7 -0
  77. package/form/index.es.js +2244 -0
  78. package/form/index.umd.js +1 -0
  79. package/form/package.json +7 -0
  80. package/form/style.css +1 -0
  81. package/fullscreen/index.d.ts +7 -0
  82. package/fullscreen/index.es.js +163 -1
  83. package/fullscreen/index.umd.js +1 -1
  84. package/gantt/index.d.ts +7 -0
  85. package/gantt/index.es.js +535 -0
  86. package/gantt/index.umd.js +1 -0
  87. package/gantt/package.json +7 -0
  88. package/gantt/style.css +1 -0
  89. package/grid/index.d.ts +7 -0
  90. package/grid/index.es.js +269 -0
  91. package/grid/index.umd.js +1 -0
  92. package/grid/package.json +7 -0
  93. package/grid/style.css +1 -0
  94. package/icon/index.d.ts +7 -0
  95. package/icon/index.es.js +75 -1
  96. package/icon/index.umd.js +1 -1
  97. package/image-preview/index.d.ts +7 -0
  98. package/image-preview/index.es.js +480 -1
  99. package/image-preview/index.umd.js +1 -1
  100. package/image-preview/style.css +1 -1
  101. package/index.d.ts +7 -0
  102. package/input/index.d.ts +7 -0
  103. package/input/index.es.js +190 -1
  104. package/input/index.umd.js +1 -1
  105. package/input-icon/index.d.ts +7 -0
  106. package/input-icon/index.es.js +332 -0
  107. package/input-icon/index.umd.js +1 -0
  108. package/input-icon/package.json +7 -0
  109. package/input-icon/style.css +1 -0
  110. package/input-number/index.d.ts +7 -0
  111. package/input-number/index.es.js +240 -1
  112. package/input-number/index.umd.js +1 -1
  113. package/layout/index.d.ts +7 -0
  114. package/layout/index.es.js +100 -0
  115. package/layout/index.umd.js +1 -0
  116. package/layout/package.json +7 -0
  117. package/layout/style.css +1 -0
  118. package/loading/index.d.ts +7 -0
  119. package/loading/index.es.js +256 -1
  120. package/loading/index.umd.js +1 -1
  121. package/modal/index.d.ts +7 -0
  122. package/modal/index.es.js +1225 -1
  123. package/modal/index.umd.js +1 -1
  124. package/modal/style.css +1 -1
  125. package/nav-sprite/index.d.ts +7 -0
  126. package/nav-sprite/index.es.js +742 -0
  127. package/nav-sprite/index.umd.js +1 -0
  128. package/nav-sprite/package.json +7 -0
  129. package/nuxt/components/Accordion.js +3 -0
  130. package/nuxt/components/Alert.js +3 -0
  131. package/nuxt/components/Anchor.js +3 -0
  132. package/nuxt/components/Aside.js +3 -0
  133. package/nuxt/components/Avatar.js +3 -0
  134. package/nuxt/components/BackTop.js +3 -0
  135. package/nuxt/components/Badge.js +3 -0
  136. package/nuxt/components/Breadcrumb.js +3 -0
  137. package/nuxt/components/Button.js +3 -0
  138. package/nuxt/components/Card.js +3 -0
  139. package/nuxt/components/Carousel.js +3 -0
  140. package/nuxt/components/Cascader.js +3 -0
  141. package/nuxt/components/Checkbox.js +3 -0
  142. package/nuxt/components/Col.js +3 -0
  143. package/nuxt/components/Column.js +3 -0
  144. package/nuxt/components/Comment.js +3 -0
  145. package/nuxt/components/Content.js +3 -0
  146. package/nuxt/components/Countdown.js +3 -0
  147. package/nuxt/components/DatePicker.js +3 -0
  148. package/nuxt/components/Drawer.js +3 -0
  149. package/nuxt/components/Dropdown.js +3 -0
  150. package/nuxt/components/EditableSelect.js +3 -0
  151. package/nuxt/components/FixedOverlay.js +3 -0
  152. package/nuxt/components/FlexibleOverlay.js +3 -0
  153. package/nuxt/components/Footer.js +3 -0
  154. package/nuxt/components/Form.js +3 -0
  155. package/nuxt/components/FormControl.js +3 -0
  156. package/nuxt/components/FormItem.js +3 -0
  157. package/nuxt/components/FormLabel.js +3 -0
  158. package/nuxt/components/FormOperation.js +3 -0
  159. package/nuxt/components/Fullscreen.js +3 -0
  160. package/nuxt/components/Gantt.js +3 -0
  161. package/nuxt/components/Header.js +3 -0
  162. package/nuxt/components/Icon.js +2 -0
  163. package/nuxt/components/ImagePreviewService.js +3 -0
  164. package/nuxt/components/Input.js +3 -0
  165. package/nuxt/components/InputIcon.js +3 -0
  166. package/nuxt/components/InputNumber.js +3 -0
  167. package/nuxt/components/Layout.js +3 -0
  168. package/nuxt/components/Loading.js +3 -0
  169. package/nuxt/components/LoadingService.js +3 -0
  170. package/nuxt/components/Modal.js +3 -0
  171. package/nuxt/components/NavSprite.js +2 -0
  172. package/nuxt/components/Pagination.js +3 -0
  173. package/nuxt/components/Panel.js +3 -0
  174. package/nuxt/components/Popover.js +3 -0
  175. package/nuxt/components/Progress.js +3 -0
  176. package/nuxt/components/QuadrantDiagram.js +3 -0
  177. package/nuxt/components/Radio.js +3 -0
  178. package/nuxt/components/RadioGroup.js +3 -0
  179. package/nuxt/components/Rate.js +3 -0
  180. package/nuxt/components/ReadTip.js +3 -0
  181. package/nuxt/components/Result.js +3 -0
  182. package/nuxt/components/Row.js +3 -0
  183. package/nuxt/components/Search.js +3 -0
  184. package/nuxt/components/Select.js +3 -0
  185. package/nuxt/components/Skeleton.js +3 -0
  186. package/nuxt/components/SkeletonItem.js +3 -0
  187. package/nuxt/components/Slider.js +3 -0
  188. package/nuxt/components/Splitter.js +3 -0
  189. package/nuxt/components/Statistic.js +3 -0
  190. package/nuxt/components/Status.js +3 -0
  191. package/nuxt/components/StepsGuide.js +3 -0
  192. package/nuxt/components/StickSlider.js +3 -0
  193. package/nuxt/components/Sticky.js +2 -0
  194. package/nuxt/components/Switch.js +3 -0
  195. package/nuxt/components/Table.js +3 -0
  196. package/nuxt/components/Tabs.js +3 -0
  197. package/nuxt/components/Tag.js +3 -0
  198. package/nuxt/components/TagInput.js +3 -0
  199. package/nuxt/components/Textarea.js +3 -0
  200. package/nuxt/components/TimeAxis.js +3 -0
  201. package/nuxt/components/TimeAxisItem.js +3 -0
  202. package/nuxt/components/TimePicker.js +3 -0
  203. package/nuxt/components/Toast.js +3 -0
  204. package/nuxt/components/ToastService.js +3 -0
  205. package/nuxt/components/Tooltip.js +3 -0
  206. package/nuxt/components/Transfer.js +3 -0
  207. package/nuxt/components/Tree.js +3 -0
  208. package/nuxt/components/TreeSelect.js +3 -0
  209. package/nuxt/components/Upload.js +3 -0
  210. package/nuxt/components/buttonProps.js +3 -0
  211. package/nuxt/index.js +13 -0
  212. package/overlay/index.d.ts +7 -0
  213. package/overlay/index.es.js +368 -1
  214. package/overlay/index.umd.js +1 -1
  215. package/overlay/style.css +1 -1
  216. package/package.json +8 -34
  217. package/pagination/index.d.ts +7 -0
  218. package/pagination/index.es.js +642 -1
  219. package/pagination/index.umd.js +1 -1
  220. package/panel/index.d.ts +7 -0
  221. package/panel/index.es.js +205 -1
  222. package/panel/index.umd.js +1 -1
  223. package/panel/style.css +1 -1
  224. package/popover/index.d.ts +7 -0
  225. package/popover/index.es.js +236 -1
  226. package/popover/index.umd.js +1 -1
  227. package/progress/index.d.ts +7 -0
  228. package/progress/index.es.js +153 -1
  229. package/progress/index.umd.js +3 -1
  230. package/quadrant-diagram/index.d.ts +7 -0
  231. package/quadrant-diagram/index.es.js +489 -1
  232. package/quadrant-diagram/index.umd.js +1 -1
  233. package/radio/index.d.ts +7 -0
  234. package/radio/index.es.js +225 -1
  235. package/radio/index.umd.js +1 -1
  236. package/rate/index.d.ts +7 -0
  237. package/rate/index.es.js +220 -1
  238. package/rate/index.umd.js +1 -1
  239. package/read-tip/index.d.ts +7 -0
  240. package/read-tip/index.es.js +258 -0
  241. package/read-tip/index.umd.js +1 -0
  242. package/read-tip/package.json +7 -0
  243. package/read-tip/style.css +1 -0
  244. package/result/index.d.ts +7 -0
  245. package/result/index.es.js +119 -0
  246. package/result/index.umd.js +1 -0
  247. package/result/package.json +7 -0
  248. package/result/style.css +1 -0
  249. package/ripple/index.d.ts +7 -0
  250. package/ripple/index.es.js +181 -1
  251. package/ripple/index.umd.js +1 -1
  252. package/search/index.d.ts +7 -0
  253. package/search/index.es.js +543 -1
  254. package/search/index.umd.js +1 -1
  255. package/select/index.d.ts +7 -0
  256. package/select/index.es.js +706 -1
  257. package/select/index.umd.js +1 -1
  258. package/skeleton/index.d.ts +7 -0
  259. package/skeleton/index.es.js +297 -1
  260. package/skeleton/index.umd.js +1 -1
  261. package/skeleton/style.css +1 -1
  262. package/slider/index.d.ts +7 -0
  263. package/slider/index.es.js +199 -1
  264. package/slider/index.umd.js +1 -1
  265. package/slider/style.css +1 -1
  266. package/splitter/index.d.ts +7 -0
  267. package/splitter/index.es.js +636 -1
  268. package/splitter/index.umd.js +1 -1
  269. package/statistic/index.d.ts +7 -0
  270. package/statistic/index.es.js +280 -0
  271. package/statistic/index.umd.js +1 -0
  272. package/statistic/package.json +7 -0
  273. package/statistic/style.css +1 -0
  274. package/status/index.d.ts +7 -0
  275. package/status/index.es.js +42 -1
  276. package/status/index.umd.js +1 -1
  277. package/steps-guide/index.d.ts +7 -0
  278. package/steps-guide/index.es.js +239 -1
  279. package/steps-guide/index.umd.js +1 -1
  280. package/steps-guide/style.css +1 -1
  281. package/sticky/index.d.ts +7 -0
  282. package/sticky/index.es.js +197 -1
  283. package/sticky/index.umd.js +1 -1
  284. package/style.css +1 -1
  285. package/switch/index.d.ts +7 -0
  286. package/switch/index.es.js +100 -1
  287. package/switch/index.umd.js +1 -1
  288. package/switch/style.css +1 -1
  289. package/table/index.d.ts +7 -0
  290. package/table/index.es.js +1828 -1
  291. package/table/index.umd.js +1 -1
  292. package/table/style.css +1 -1
  293. package/tabs/index.d.ts +7 -0
  294. package/tabs/index.es.js +195 -1
  295. package/tabs/index.umd.js +1 -1
  296. package/tabs/style.css +1 -1
  297. package/tag/index.d.ts +7 -0
  298. package/tag/index.es.js +131 -0
  299. package/tag/index.umd.js +1 -0
  300. package/tag/package.json +7 -0
  301. package/tag/style.css +1 -0
  302. package/tag-input/index.d.ts +7 -0
  303. package/tag-input/index.es.js +329 -1
  304. package/tag-input/index.umd.js +1 -1
  305. package/textarea/index.d.ts +7 -0
  306. package/textarea/index.es.js +132 -0
  307. package/textarea/index.umd.js +1 -0
  308. package/textarea/package.json +7 -0
  309. package/textarea/style.css +1 -0
  310. package/time-axis/index.d.ts +7 -0
  311. package/time-axis/index.es.js +299 -0
  312. package/time-axis/index.umd.js +1 -0
  313. package/time-axis/package.json +7 -0
  314. package/time-axis/style.css +1 -0
  315. package/time-picker/index.d.ts +7 -0
  316. package/time-picker/index.es.js +1255 -1
  317. package/time-picker/index.umd.js +1 -1
  318. package/time-picker/style.css +1 -1
  319. package/toast/index.d.ts +7 -0
  320. package/toast/index.es.js +2060 -1
  321. package/toast/index.umd.js +1 -1
  322. package/toast/style.css +1 -1
  323. package/tooltip/index.d.ts +7 -0
  324. package/tooltip/index.es.js +171 -1
  325. package/tooltip/index.umd.js +1 -1
  326. package/transfer/index.d.ts +7 -0
  327. package/transfer/index.es.js +1725 -1
  328. package/transfer/index.umd.js +1 -1
  329. package/transfer/style.css +1 -1
  330. package/tree/index.d.ts +7 -0
  331. package/tree/index.es.js +907 -1
  332. package/tree/index.umd.js +1 -1
  333. package/tree/style.css +1 -1
  334. package/tree-select/index.d.ts +7 -0
  335. package/tree-select/index.es.js +528 -0
  336. package/tree-select/index.umd.js +1 -0
  337. package/tree-select/package.json +7 -0
  338. package/tree-select/style.css +1 -0
  339. package/upload/index.d.ts +7 -0
  340. package/upload/index.es.js +2834 -1
  341. package/upload/index.umd.js +1 -1
  342. package/upload/style.css +1 -1
  343. package/vue-devui.es.js +27743 -1
  344. package/vue-devui.umd.js +29 -1
@@ -1 +1,1255 @@
1
- var e=Object.defineProperty,t=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,i=(t,l,a)=>l in t?e(t,l,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[l]=a;"undefined"!=typeof require&&require;import{defineComponent as u,createVNode as o,reactive as n,ref as s,createTextVNode as r,computed as p,mergeProps as m,onMounted as v,watch as c,Fragment as d,onUnmounted as f}from"vue";const h={modelValue:{type:String,default:""},placeholder:{type:String,default:"00:00:00"},disabled:{type:Boolean,default:!1},timePickerWidth:{type:Number,default:210},minTime:{type:String,default:"00:00:00"},maxTime:{type:String,default:"23:59:59"},format:{type:String,default:"hh:mm:ss"},autoOpen:{type:Boolean,default:!1}};var T=u({name:"DIcon",props:{name:{type:String,required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}},setup:e=>((e,u)=>{for(var o in u||(u={}))l.call(u,o)&&i(e,o,u[o]);if(t)for(var o of t(u))a.call(u,o)&&i(e,o,u[o]);return e})({},e),render(){const{name:e,size:t,color:l,classPrefix:a}=this;return o("i",{class:`${a} ${a}-${e}`,style:{fontSize:t,color:l}},null)}});function y(e){const t=n([]);let l=0;l="hour"==e?24:60;for(let a=0;a<l;a++)t.push({time:a<10?"0"+a:a+"",isActive:!1,flag:e,isDisabled:!1});return t}T.install=function(e){e.component(T.name,T)};function g(e,t,l,a,i,u,o,n){const r=s(!1),p=s(!1),m=s(),v=s(),c=s(-100),d=s(-100),f=s(),h=s(""),T=s(!1),y=s(`${e.value}:${t.value}:${l.value}`),g=s(n),b=()=>{"hh:mm:ss"==i?g.value=`${e.value}:${t.value}:${l.value}`:"mm:hh:ss"==i?g.value=`${t.value}:${e.value}:${l.value}`:"hh:mm"==i?g.value=`${e.value}:${t.value}`:"mm:ss"==i&&(g.value=`${t.value}:${l.value}`)};return{isActive:r,showPopup:p,devuiTimePicker:m,timePickerValue:h,inputDom:v,timePopupDom:f,left:c,top:d,showClearIcon:T,firsthandActiveTime:y,vModeValue:g,getPopupPosition:()=>{!function(e,t,l){const a=e.getBoundingClientRect();window.innerHeight-(a.top+20)>a.top+20?(t.value=a.x,l.value=a.top+20+10):(t.value=a.x,l.value=a.top-316)}(m.value,c,d)},setInputValue:b,getTimeValue:a=>{a.stopPropagation(),p.value&&(e.value=f.value.changTimeData().activeHour.value,t.value=f.value.changTimeData().activeMinute.value,l.value=f.value.changTimeData().activeSecond.value,y.value=`${e.value}:${t.value}:${l.value}`,b())},clickVerifyFun:e=>{if(e.stopPropagation(),r.value=!1,p.value=!1,o)return;(e.composedPath&&e.composedPath()||e.path).map((e=>{e==m.value&&("00:00:00"==y.value&&(""==g.value&&(g.value="00:00:00"),g.value>a?y.value=g.value:y.value=a),b(),r.value=!0,p.value=!0)}))},isOutOpen:()=>{if(u){const a=g.value.split(":");e.value=a[0],t.value=a[1],l.value=a[2],y.value=g.value,b(),r.value=!0,p.value=u}},clearAll:i=>{if(i.stopPropagation(),p.value=!1,"00:00:00"!=a){const i=a.split(":");e.value=i[0],t.value=i[1],l.value=i[2]}else e.value="00",t.value="00",l.value="00";y.value=`${e.value}:${t.value}:${l.value}`,b()},chooseTime:a=>{if(a.type)"hh"==a.type.toLowerCase()?e.value=a.time:"mm"==a.type.toLowerCase()?t.value=a.time:"ss"==a.type.toLowerCase()&&(l.value=a.time),y.value=`${e.value}:${t.value}:${l.value}`,b();else{const i=a.time.split(":");e.value=i[0],t.value=i[1],l.value=i[2],y.value=`${e.value}:${t.value}:${l.value}`,b()}}}}var b=u({name:"TTimeList",props:{hourList:{type:Array,default:()=>[]},minuteList:{type:Array,default:()=>[]},secondList:{type:Array,default:()=>[]},format:{type:String,default:"hh:mm:ss"},minTime:{type:String,default:"00:00:00"},maxTime:{type:String,default:"23:59:59"}},setup(e,t){const l=s(),{getNewTime:a,activeTimeFun:i,resetTimeValue:u}=((e,t,l,a,i,u,o)=>{const n=s("00:00:00"),r=s("00"),p=s("00"),m=s("00"),v=(o,v)=>{let d=[],h=s("");if("hour"==o.flag?(d=e,h=r,c(o)):"minute"==o.flag?(d=t,h=p,c(o)):"second"==o.flag&&(d=l,h=m),d.map(((e,t)=>{e.isActive=!1})),d[v].isActive=!0,h.value=d[v].time,n.value=`${r.value}:${p.value}:${m.value}`,n.value<a)n.value=a,f(a);else if("mm:ss"==u&&`${p.value}:${m.value}`>i.slice(3)){const e=a.slice(0,3)+i.slice(3);f(e)}else n.value>i&&(n.value=i,f(i))},c=e=>{let o="00",n="00";const s=a.split(":")[0],m=a.split(":")[1],v=a.split(":")[2],c=i.split(":")[0],f=i.split(":")[1],h=i.split(":")[2];"hour"==e.flag&&(e.time==s?(o=m,d(t,o,n),p.value<m&&d(l,v,n)):e.time==c?(n=f,d(t,o,n),d(l,o,h)):(d(t,o,n),d(l,o,n))),"minute"==e.flag&&"mm:ss"==u?e.time==m?(o=v,d(l,o,n)):e.time==f?(n=h,d(l,o,n)):d(l,o,n):"minute"==e.flag&&(r.value==s&&e.time==m?(o=v,d(l,o,n)):r.value==c&&e.time==f?(n=h,d(l,o,n)):d(l,o,n))},d=(e,t,l)=>{e.map((e=>{"00"!=t&&e.time<t||"00"!=l&&e.time>l?e.isDisabled=!0:e.isDisabled=!1}))},f=i=>{const n=i.split(":"),s=a.split(":");let v=0,c=0,d=0;"hh:mm:ss"==u?(v=parseInt(n[0]),c=parseInt(n[1]),d=parseInt(n[2]),o.value.children[0].scrollTop=30*v,o.value.children[1].scrollTop=30*c,o.value.children[2].scrollTop=30*d,r.value=n[0],p.value=n[1],m.value=n[2],T(e,n[0]),T(t,n[1]),T(l,n[2]),h(e,r.value),h(t,p.value)):"mm:hh:ss"==u?(v=parseInt(n[0]),c=parseInt(n[1]),d=parseInt(n[2]),o.value.children[0].scrollTop=30*c,o.value.children[1].scrollTop=30*v,o.value.children[2].scrollTop=30*d,r.value=n[0],p.value=n[1],m.value=n[2],T(e,n[0]),T(t,n[1]),T(l,n[2]),h(e,r.value),h(t,p.value)):"hh:mm"==u?(v=parseInt(n[0]),c=parseInt(n[1]),o.value.children[0].scrollTop=30*v,o.value.children[1].scrollTop=30*c,r.value=n[0],p.value=n[1],T(e,n[0]),T(t,n[1]),h(e,r.value)):"mm:ss"==u&&(c=parseInt(n[1]),d=parseInt(n[2]),o.value.children[0].scrollTop=30*c,o.value.children[1].scrollTop=30*d,r.value=s[0],p.value=n[1],m.value=n[2],T(t,n[1]),T(l,n[2]),h(t,p.value))},h=(e,t)=>{e.map((e=>{e.time==t&&c(e)}))},T=(e,t)=>{e.map((e=>{e.time==t?e.isActive=!0:e.isActive=!1}))};return{activeTime:n,activeHour:r,activeMinute:p,activeSecond:m,activeTimeFun:(e,t,l)=>{if(t.isDisabled)return!1;v(t,l),e.target.parentElement.scrollTop=30*l},resetTimeValue:f,getNewTime:()=>({activeTime:n,activeHour:r,activeMinute:p,activeSecond:m})}})(e.hourList,e.minuteList,e.secondList,e.minTime,e.maxTime,e.format,l),n=()=>{const t={hh:e.hourList,mm:e.minuteList,ss:e.secondList};return e.format.split(":").map((l=>(t=>{return o("ul",{class:"time-ul",style:{width:e.format.length>6?"33.33%":"50%"}},[r(" "),(l=t,l.map(((e,t)=>o("li",{class:`${e.flag}Id-${t} ${e.isActive?"active-li":""} ${e.isDisabled?"disabled-li":""}`,onClick:l=>{i(l,e,t)}},[e.time]))))]);var l})(t[l])))};return t.expose({restScrooTop:()=>{for(let e=0;e<l.value.children.length;e++)l.value.children[e].scrollTop=0},setOutoTime:e=>{u(e)},getNewTime:a}),()=>o("div",{class:"devui-time-list",ref:l},[n()])}});var $=u({name:"DButton",props:{type:{type:String,default:"button"},btnStyle:{type:String,default:"primary"},size:{type:String,default:"md"},position:{type:String,default:"default"},bordered:{type:Boolean,default:!1},icon:{type:String,default:""},showLoading:{type:Boolean,default:!1},width:{type:String},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},onClick:{type:Function}},setup(e,t){const l=s(null),a=t=>{var l;e.showLoading||null==(l=e.onClick)||l.call(e,t)},i=p((()=>t.slots.default)),u=p((()=>{const{btnStyle:t,size:l,position:a,bordered:u,icon:o}=e;return`${`devui-btn devui-btn-${t} devui-btn-${l} devui-btn-${a}`} ${u?"bordered":""} ${o&&!i.value&&"primary"!==t?"d-btn-icon":""} ${o?"d-btn-icon-wrap":""}`})),n=p((()=>{if(!e.icon)return;const t="devui-icon-fix icon";return i.value?`${t} clear-right-5`:t}));return()=>{var i,s;const{icon:r,type:p,disabled:v,showLoading:c,width:d}=e;return o("div",m({class:"devui-btn-host"},t.attrs),[o("button",{class:u.value,type:p,disabled:v,style:{width:d},onClick:a},[r?o(T,{name:e.icon,class:n.value},null):null,o("span",{class:"button-content",ref:l},[null==(s=(i=t.slots).default)?void 0:s.call(i)])])])}}});$.install=function(e){e.component($.name,$)};var w=u({name:"DTimePopup",components:{TimeList:b,Button:$},props:{showPopup:{type:Boolean,default:!1},popupTop:{type:Number,default:-100},popupLeft:{type:Number,default:-100},popupWidth:{type:Number,default:300},popupFormat:{type:String,default:"hh:mm:ss"},minTime:{type:String,default:"00:00:00"},maxTime:{type:String,default:"23:59:59"},bindData:{type:String,default:"00:00:00"}},emits:["subData"],setup(e,t){const l=s(),a=s(),i=y("hour"),u=y("minute"),n=y("second");v((()=>{((e,t,l,a,i,u)=>{const o=i.split(":")[0],n=i.split(":")[1],s=a.split(":")[0],r=a.split(":")[1],p=a.split(":")[2];e.map(((e,t)=>{(e.time<s||e.time>o)&&(e.isDisabled=!0)})),"mm:ss"==u?t.map(((e,t)=>{(e.time<r||e.time>n)&&(e.isDisabled=!0)})):t.map(((e,t)=>{e.time<r&&(e.isDisabled=!0)})),l.map(((e,t)=>{e.time<p&&(e.isDisabled=!0)}))})(i,u,n,e.minTime,e.maxTime,e.popupFormat)})),c((()=>[e.showPopup,e.bindData]),(([e,t],[l,i])=>{e||t!=i?a.value.setOutoTime(t):a.value.restScrooTop()}));const p=e=>{e.stopPropagation(),t.emit("subData")};return t.expose({changTimeData:()=>a.value.getNewTime()}),()=>{var s,m;return o(d,null,[o("div",{ref:l,class:"devui-time-popup "+(e.showPopup?"devui-show-time-popup":""),style:{width:e.popupWidth+"px",top:e.popupTop+"px",left:e.popupLeft+"px"}},[o(b,{ref:a,hourList:i,minuteList:u,secondList:n,minTime:e.minTime,maxTime:e.maxTime,format:e.popupFormat},null),o("div",{class:"devui-time-popup-btn"},[o("div",{class:"popup-slots"},[null==(m=(s=t.slots).default)?void 0:m.call(s)]),o("div",{onClick:p},[o($,{btnStyle:"common"},{default:()=>[r("确定")]})])])])])}}}),L=u({name:"DTimePicker",components:{TimePopup:w},props:h,emits:["selectedTimeChage","update:modelValue"],setup(e,t){const l=s("00"),a=s("00"),i=s("00"),u=e.format.toLowerCase(),{isActive:n,showPopup:r,devuiTimePicker:p,inputDom:m,left:h,top:y,showClearIcon:b,firsthandActiveTime:$,chooseTime:L,getTimeValue:S,clickVerifyFun:P,isOutOpen:D,clearAll:k,timePopupDom:x,vModeValue:A,getPopupPosition:C}=g(l,a,i,e.minTime,u,e.autoOpen,e.disabled,e.modelValue),I=e=>{n.value=!1,r.value=!1,t.emit("selectedTimeChage",A.value)};return v((()=>{C(),D(),document.addEventListener("click",P),document.addEventListener("click",S),document.addEventListener("scroll",C),window.addEventListener("resize",C)})),f((()=>{document.removeEventListener("click",P),document.removeEventListener("click",S),document.removeEventListener("scroll",C),window.removeEventListener("resize",C)})),c(A,(l=>{t.emit("update:modelValue",A.value),l!=e.minTime?b.value=!0:b.value=!1})),t.expose({clearAll:k,chooseTime:L}),()=>o(d,null,[o("div",{class:`devui-time-picker ${n.value?"time-picker-active":""} ${e.disabled?"picker-disabled":""}`,ref:p},[o(w,{ref:x,showPopup:r.value,popupTop:y.value,popupLeft:h.value,popupWidth:e.timePickerWidth,popupFormat:e.format.toLowerCase(),minTime:e.minTime,maxTime:e.maxTime,bindData:$.value,onSubData:I},{default:()=>{var e,l;return[null==(l=(e=t.slots).customViewTemplate)?void 0:l.call(e)]}}),o("input",{ref:m,type:"text",value:A.value,placeholder:`${e.placeholder}`,disabled:e.disabled,class:"time-input"},null),o("div",{class:"time-input-icon"},[o("div",{onClick:k},[b.value?o(T,{size:"small",name:"close"},null):""]),o("div",null,[o(T,{size:"small",name:"time"},null)])])])])}});L.install=function(e){e.component(L.name,L)};var S={title:"TimePicker 时间选择器",category:"数据录入",status:void 0,install(e){e.use(L)}};export{L as TimePicker,S as default};
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, computed, withDirectives, mergeProps, resolveDirective, h, render, 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
+ vModeValue.value == "" ? vModeValue.value = "00:00:00" : "";
198
+ if (vModeValue.value > minTime) {
199
+ firsthandActiveTime.value = value;
200
+ setInputValue(vModelValueArr[0], vModelValueArr[1], vModelValueArr[2]);
201
+ } else {
202
+ firsthandActiveTime.value = minTime;
203
+ setInputValue(minTimeValueArr[0], minTimeValueArr[1], minTimeValueArr[2]);
204
+ }
205
+ }
206
+ isActive.value = true;
207
+ showPopup.value = true;
208
+ };
209
+ const vModelIsBeyond = () => {
210
+ if (vModeValue.value != "" && vModeValue.value < minTime) {
211
+ vModeValue.value = minTime;
212
+ } else if (vModeValue.value != "" && vModeValue.value > maxTime) {
213
+ vModeValue.value = maxTime;
214
+ }
215
+ const vModelValueArr = vModeValue.value.split(":");
216
+ vModeValue.value && setInputValue(vModelValueArr[0], vModelValueArr[1], vModelValueArr[2]);
217
+ };
218
+ const getTimeValue = (e) => {
219
+ e.stopPropagation();
220
+ if (showPopup.value) {
221
+ hh.value = timePopupDom.value.changTimeData().activeHour.value;
222
+ mm.value = timePopupDom.value.changTimeData().activeMinute.value;
223
+ ss.value = timePopupDom.value.changTimeData().activeSecond.value;
224
+ firsthandActiveTime.value = `${hh.value}:${mm.value}:${ss.value}`;
225
+ setInputValue(hh.value, mm.value, ss.value);
226
+ }
227
+ };
228
+ const setInputValue = (hh2, mm2, ss2) => {
229
+ if (format == "hh:mm:ss") {
230
+ vModeValue.value = `${hh2}:${mm2}:${ss2}`;
231
+ } else if (format == "mm:hh:ss") {
232
+ vModeValue.value = `${mm2}:${hh2}:${ss2}`;
233
+ } else if (format == "hh:mm") {
234
+ vModeValue.value = `${hh2}:${mm2}`;
235
+ } else if (format == "mm:ss") {
236
+ vModeValue.value = `${mm2}:${ss2}`;
237
+ }
238
+ };
239
+ const clearAll = (e) => {
240
+ e.stopPropagation();
241
+ showPopup.value = false;
242
+ if (minTime != "00:00:00") {
243
+ const minTimeArr = minTime.split(":");
244
+ hh.value = minTimeArr[0];
245
+ mm.value = minTimeArr[1];
246
+ ss.value = minTimeArr[2];
247
+ } else {
248
+ hh.value = "00";
249
+ mm.value = "00";
250
+ ss.value = "00";
251
+ }
252
+ firsthandActiveTime.value = `${hh.value}:${mm.value}:${ss.value}`;
253
+ setInputValue(hh.value, mm.value, ss.value);
254
+ };
255
+ const isOutOpen = () => {
256
+ if (autoOpen) {
257
+ const timeArr = vModeValue.value.split(":");
258
+ hh.value = timeArr[0];
259
+ mm.value = timeArr[1];
260
+ ss.value = timeArr[2];
261
+ firsthandActiveTime.value = vModeValue.value;
262
+ setInputValue(hh.value, mm.value, ss.value);
263
+ isActive.value = true;
264
+ showPopup.value = autoOpen;
265
+ }
266
+ };
267
+ const chooseTime = (slotTime) => {
268
+ if (slotTime.type) {
269
+ if (slotTime.type.toLowerCase() == "hh") {
270
+ hh.value = slotTime.time;
271
+ } else if (slotTime.type.toLowerCase() == "mm") {
272
+ mm.value = slotTime.time;
273
+ } else if (slotTime.type.toLowerCase() == "ss") {
274
+ ss.value = slotTime.time;
275
+ }
276
+ firsthandActiveTime.value = `${hh.value}:${mm.value}:${ss.value}`;
277
+ setInputValue(hh.value, mm.value, ss.value);
278
+ } else {
279
+ const timeArr = slotTime.time.split(":");
280
+ hh.value = timeArr[0];
281
+ mm.value = timeArr[1];
282
+ ss.value = timeArr[2];
283
+ firsthandActiveTime.value = `${hh.value}:${mm.value}:${ss.value}`;
284
+ setInputValue(hh.value, mm.value, ss.value);
285
+ }
286
+ };
287
+ return {
288
+ isActive,
289
+ showPopup,
290
+ devuiTimePicker,
291
+ timePickerValue,
292
+ inputDom,
293
+ timePopupDom,
294
+ left,
295
+ top,
296
+ showClearIcon,
297
+ firsthandActiveTime,
298
+ vModeValue,
299
+ getPopupPosition,
300
+ getTimeValue,
301
+ clickVerifyFun,
302
+ isOutOpen,
303
+ vModelIsBeyond,
304
+ clearAll,
305
+ chooseTime
306
+ };
307
+ }
308
+ const usePopupLine = (hourListRef, minuteListRef, secondListRef, minTime, maxTime, format, timeListDom) => {
309
+ const activeTime = ref("00:00:00");
310
+ const activeHour = ref("00");
311
+ const activeMinute = ref("00");
312
+ const activeSecond = ref("00");
313
+ const activeTimeFun = (e, item, index2) => {
314
+ if (item.isDisabled) {
315
+ return false;
316
+ } else {
317
+ setTimeActive(item, index2);
318
+ e.target.parentElement.parentElement.scrollTop = index2 * 32;
319
+ }
320
+ };
321
+ const setTimeActive = (item, index2) => {
322
+ let activeTimeList = [];
323
+ let acitveTimeValue = ref("");
324
+ if (item.flag == "hour") {
325
+ activeTimeList = hourListRef;
326
+ acitveTimeValue = activeHour;
327
+ getItemAstrict(item);
328
+ } else if (item.flag == "minute") {
329
+ activeTimeList = minuteListRef;
330
+ acitveTimeValue = activeMinute;
331
+ getItemAstrict(item);
332
+ } else if (item.flag == "second") {
333
+ activeTimeList = secondListRef;
334
+ acitveTimeValue = activeSecond;
335
+ }
336
+ activeTimeList.map((tiemItem, tiemeIndex) => {
337
+ tiemItem.isActive = index2 === tiemeIndex;
338
+ });
339
+ acitveTimeValue.value = activeTimeList[index2].time;
340
+ activeTime.value = `${activeHour.value}:${activeMinute.value}:${activeSecond.value}`;
341
+ if (activeTime.value < minTime) {
342
+ activeTime.value = minTime;
343
+ resetTimeValue(minTime);
344
+ } else if (format == "mm:ss" && `${activeMinute.value}:${activeSecond.value}` > maxTime.slice(3)) {
345
+ const newMinTime = minTime.slice(0, 3) + maxTime.slice(3);
346
+ resetTimeValue(newMinTime);
347
+ } else if (activeTime.value > maxTime) {
348
+ activeTime.value = maxTime;
349
+ resetTimeValue(maxTime);
350
+ }
351
+ };
352
+ const getItemAstrict = (item) => {
353
+ let min = "00";
354
+ let max = "00";
355
+ const minTimeHour = minTime.split(":")[0];
356
+ const minTimeMinute = minTime.split(":")[1];
357
+ const minTimeSecond = minTime.split(":")[2];
358
+ const maxTimeHour = maxTime.split(":")[0];
359
+ const maxTimeMinute = maxTime.split(":")[1];
360
+ const maxTimeSecond = maxTime.split(":")[2];
361
+ if (item.flag == "hour") {
362
+ if (item.time == minTimeHour) {
363
+ min = minTimeMinute;
364
+ setItemAstrict(minuteListRef, min, max);
365
+ activeMinute.value < minTimeMinute && setItemAstrict(secondListRef, minTimeSecond, max);
366
+ } else if (item.time == maxTimeHour) {
367
+ max = maxTimeMinute;
368
+ setItemAstrict(minuteListRef, min, max);
369
+ setItemAstrict(secondListRef, min, maxTimeSecond);
370
+ } else {
371
+ setItemAstrict(minuteListRef, min, max);
372
+ setItemAstrict(secondListRef, min, max);
373
+ }
374
+ }
375
+ if (item.flag == "minute" && format == "mm:ss") {
376
+ if (item.time == minTimeMinute) {
377
+ min = minTimeSecond;
378
+ setItemAstrict(secondListRef, min, max);
379
+ } else if (item.time == maxTimeMinute) {
380
+ max = maxTimeSecond;
381
+ setItemAstrict(secondListRef, min, max);
382
+ } else {
383
+ setItemAstrict(secondListRef, min, max);
384
+ }
385
+ } else if (item.flag == "minute") {
386
+ if (activeHour.value == minTimeHour && item.time == minTimeMinute) {
387
+ min = minTimeSecond;
388
+ setItemAstrict(secondListRef, min, max);
389
+ } else if (activeHour.value == maxTimeHour && item.time == maxTimeMinute) {
390
+ max = maxTimeSecond;
391
+ setItemAstrict(secondListRef, min, max);
392
+ } else {
393
+ setItemAstrict(secondListRef, min, max);
394
+ }
395
+ }
396
+ };
397
+ const setItemAstrict = (timeArr, min, max) => {
398
+ timeArr.map((itme) => {
399
+ if (min != "00" && itme.time < min) {
400
+ itme.isDisabled = true;
401
+ } else if (max != "00" && itme.time > max) {
402
+ itme.isDisabled = true;
403
+ } else {
404
+ itme.isDisabled = false;
405
+ }
406
+ });
407
+ };
408
+ const resetTimeValue = (time) => {
409
+ const timeValueArr = time.split(":");
410
+ const minTiveArr = minTime.split(":");
411
+ let hh = 0;
412
+ let mm = 0;
413
+ let ss = 0;
414
+ if (format == "hh:mm:ss") {
415
+ hh = parseInt(timeValueArr[0]);
416
+ mm = parseInt(timeValueArr[1]);
417
+ ss = parseInt(timeValueArr[2]);
418
+ timeListDom.value.children[0].lastElementChild.children[0].scrollTop = hh * 32;
419
+ timeListDom.value.children[1].lastElementChild.children[0].scrollTop = mm * 32;
420
+ timeListDom.value.children[2].lastElementChild.children[0].scrollTop = ss * 32;
421
+ activeHour.value = timeValueArr[0];
422
+ activeMinute.value = timeValueArr[1];
423
+ activeSecond.value = timeValueArr[2];
424
+ resetTimeActive(hourListRef, timeValueArr[0]);
425
+ resetTimeActive(minuteListRef, timeValueArr[1]);
426
+ resetTimeActive(secondListRef, timeValueArr[2]);
427
+ resetTimeAstrict(hourListRef, activeHour.value);
428
+ resetTimeAstrict(minuteListRef, activeMinute.value);
429
+ } else if (format == "mm:hh:ss") {
430
+ hh = parseInt(timeValueArr[0]);
431
+ mm = parseInt(timeValueArr[1]);
432
+ ss = parseInt(timeValueArr[2]);
433
+ timeListDom.value.children[0].lastElementChild.children[0].scrollTop = mm * 32;
434
+ timeListDom.value.children[1].lastElementChild.children[0].scrollTop = hh * 32;
435
+ timeListDom.value.children[2].lastElementChild.children[0].scrollTop = ss * 32;
436
+ activeHour.value = timeValueArr[0];
437
+ activeMinute.value = timeValueArr[1];
438
+ activeSecond.value = timeValueArr[2];
439
+ resetTimeActive(hourListRef, timeValueArr[0]);
440
+ resetTimeActive(minuteListRef, timeValueArr[1]);
441
+ resetTimeActive(secondListRef, timeValueArr[2]);
442
+ resetTimeAstrict(hourListRef, activeHour.value);
443
+ resetTimeAstrict(minuteListRef, activeMinute.value);
444
+ } else if (format == "hh:mm") {
445
+ hh = parseInt(timeValueArr[0]);
446
+ mm = parseInt(timeValueArr[1]);
447
+ timeListDom.value.children[0].lastElementChild.children[0].scrollTop = hh * 32;
448
+ timeListDom.value.children[1].lastElementChild.children[0].scrollTop = mm * 32;
449
+ activeHour.value = timeValueArr[0];
450
+ activeMinute.value = timeValueArr[1];
451
+ resetTimeActive(hourListRef, timeValueArr[0]);
452
+ resetTimeActive(minuteListRef, timeValueArr[1]);
453
+ resetTimeAstrict(hourListRef, activeHour.value);
454
+ } else if (format == "mm:ss") {
455
+ mm = parseInt(timeValueArr[1]);
456
+ ss = parseInt(timeValueArr[2]);
457
+ timeListDom.value.children[0].lastElementChild.children[0].scrollTop = mm * 32;
458
+ timeListDom.value.children[1].lastElementChild.children[0].scrollTop = ss * 32;
459
+ activeHour.value = minTiveArr[0];
460
+ activeMinute.value = timeValueArr[1];
461
+ activeSecond.value = timeValueArr[2];
462
+ resetTimeActive(minuteListRef, timeValueArr[1]);
463
+ resetTimeActive(secondListRef, timeValueArr[2]);
464
+ resetTimeAstrict(minuteListRef, activeMinute.value);
465
+ }
466
+ };
467
+ const resetTimeAstrict = (timeArr, time) => {
468
+ timeArr.map((item) => {
469
+ if (item.time == time) {
470
+ getItemAstrict(item);
471
+ }
472
+ });
473
+ };
474
+ const resetTimeActive = (timeArr, itemValue) => {
475
+ timeArr.map((item) => {
476
+ item.isActive = item.time === itemValue;
477
+ });
478
+ };
479
+ const getNewTime = () => {
480
+ return { activeTime, activeHour, activeMinute, activeSecond };
481
+ };
482
+ const resetScrollTop = () => {
483
+ for (let i = 0; i < timeListDom.value.children.length; i++) {
484
+ timeListDom.value.children[i].lastElementChild.children[0].scrollTop = 0;
485
+ }
486
+ };
487
+ return {
488
+ activeTime,
489
+ activeHour,
490
+ activeMinute,
491
+ activeSecond,
492
+ activeTimeFun,
493
+ resetTimeValue,
494
+ getNewTime,
495
+ resetScrollTop
496
+ };
497
+ };
498
+ function useTimeScroll() {
499
+ const scrollBoxDom = ref();
500
+ const scrollContentDom = ref();
501
+ const scrollThumbDom = ref();
502
+ const scrollTrackDom = ref();
503
+ const isDown = ref(false);
504
+ const getScrollHeight = () => {
505
+ const thumbHeight = scrollContentDom.value.clientHeight / scrollContentDom.value.scrollHeight * 100;
506
+ scrollThumbDom.value.style.height = thumbHeight + "%";
507
+ };
508
+ const setVirtualScroll = () => {
509
+ const thumbMoveY = scrollContentDom.value.scrollTop * 100 / scrollContentDom.value.clientHeight;
510
+ scrollThumbDom.value.style.transform = `translateY(${thumbMoveY}%)`;
511
+ };
512
+ const clickTrackFun = (e) => {
513
+ const offset = Math.abs(scrollTrackDom.value.getBoundingClientRect().top - e.clientY);
514
+ const thumbCenter = scrollThumbDom.value.offsetHeight / 2;
515
+ const thumbPosition = (offset - thumbCenter) * 100 / scrollContentDom.value.offsetHeight;
516
+ scrollContentDom.value.scrollTop = thumbPosition * scrollContentDom.value.scrollHeight / 100;
517
+ scrollContentDom.value.style.top = scrollContentDom.value.scrollTop + "px";
518
+ };
519
+ const mouseDownThum = () => {
520
+ isDown.value = true;
521
+ scrollTrackDom.value.style.opacity = 1;
522
+ };
523
+ const mouseOutThum = (e) => {
524
+ isDown.value = false;
525
+ thumbMouseMove(e);
526
+ };
527
+ const thumbMouseMove = (e) => {
528
+ const path = e.composedPath && e.composedPath() || e.path;
529
+ if (path.includes(scrollBoxDom.value) || isDown.value) {
530
+ scrollTrackDom.value.style.opacity = 1;
531
+ } else {
532
+ scrollTrackDom.value.style.opacity = 0;
533
+ }
534
+ if (!isDown.value)
535
+ return;
536
+ clickTrackFun(e);
537
+ };
538
+ const getScrollWidth = () => {
539
+ const ua = navigator.userAgent;
540
+ let marginRight = -20;
541
+ if (ua.indexOf("Chrome") > -1) {
542
+ marginRight = -8;
543
+ } else {
544
+ const outer = document.createElement("div");
545
+ outer.className = "devui-scrollbar-wrap";
546
+ outer.style.width = "100px";
547
+ outer.style.visibility = "hidden";
548
+ outer.style.position = "absolute";
549
+ outer.style.top = "-9999px";
550
+ document.body.appendChild(outer);
551
+ const widthNoScroll = outer.offsetWidth;
552
+ outer.style.overflow = "scroll";
553
+ const inner = document.createElement("div");
554
+ inner.style.width = "100%";
555
+ outer.appendChild(inner);
556
+ const widthWithScroll = inner.offsetWidth;
557
+ outer.parentNode.removeChild(outer);
558
+ marginRight = (widthNoScroll - widthWithScroll + 3) * -1;
559
+ }
560
+ return marginRight;
561
+ };
562
+ return {
563
+ scrollThumbDom,
564
+ scrollTrackDom,
565
+ scrollContentDom,
566
+ scrollBoxDom,
567
+ isDown,
568
+ getScrollHeight,
569
+ setVirtualScroll,
570
+ clickTrackFun,
571
+ mouseDownThum,
572
+ mouseOutThum,
573
+ thumbMouseMove,
574
+ getScrollWidth
575
+ };
576
+ }
577
+ var index$3 = "";
578
+ var TimeScroll = defineComponent({
579
+ name: "DTimeScroll",
580
+ props: timePickerProps,
581
+ setup(props, ctx) {
582
+ const {
583
+ scrollBoxDom,
584
+ scrollThumbDom,
585
+ scrollTrackDom,
586
+ scrollContentDom,
587
+ isDown,
588
+ getScrollHeight,
589
+ setVirtualScroll,
590
+ clickTrackFun,
591
+ mouseDownThum,
592
+ mouseOutThum,
593
+ thumbMouseMove,
594
+ getScrollWidth
595
+ } = useTimeScroll();
596
+ const marginRight = getScrollWidth();
597
+ onMounted(() => {
598
+ getScrollWidth();
599
+ getScrollHeight();
600
+ scrollBoxDom.value.addEventListener("click", setVirtualScroll);
601
+ scrollContentDom.value.addEventListener("scroll", setVirtualScroll);
602
+ scrollThumbDom.value.addEventListener("mousedown", mouseDownThum);
603
+ document.addEventListener("mouseup", mouseOutThum);
604
+ document.addEventListener("mousemove", thumbMouseMove);
605
+ });
606
+ onBeforeUnmount(() => {
607
+ scrollBoxDom.value.removeEventListener("click", setVirtualScroll);
608
+ scrollContentDom.value.removeEventListener("scroll", setVirtualScroll);
609
+ scrollThumbDom.value.removeEventListener("mousedown", mouseDownThum);
610
+ });
611
+ onUnmounted(() => {
612
+ document.removeEventListener("mouseup", mouseOutThum);
613
+ document.removeEventListener("mousemove", thumbMouseMove);
614
+ });
615
+ return () => {
616
+ var _a, _b;
617
+ return createVNode(Fragment, null, [createVNode("div", {
618
+ "ref": scrollBoxDom,
619
+ "class": "devui-scroll-box"
620
+ }, [createVNode("div", {
621
+ "ref": scrollContentDom,
622
+ "class": `box-content ${isDown.value || !props.showAnimation ? "box-content-behavior-auto" : ""}`,
623
+ "style": {
624
+ "margin-right": marginRight + "px"
625
+ }
626
+ }, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]), createVNode("div", {
627
+ "ref": scrollTrackDom,
628
+ "class": "box-sroll",
629
+ "onClick": clickTrackFun
630
+ }, [createVNode("div", {
631
+ "ref": scrollThumbDom,
632
+ "class": "scroll-child"
633
+ }, null)])])]);
634
+ };
635
+ }
636
+ });
637
+ var index$2 = "";
638
+ var TimeList = defineComponent({
639
+ name: "DTimeList",
640
+ components: {
641
+ TimeScroll
642
+ },
643
+ props: {
644
+ hourList: {
645
+ type: Array,
646
+ default: () => []
647
+ },
648
+ minuteList: {
649
+ type: Array,
650
+ default: () => []
651
+ },
652
+ secondList: {
653
+ type: Array,
654
+ default: () => []
655
+ },
656
+ format: {
657
+ type: String,
658
+ default: "hh:mm:ss"
659
+ },
660
+ minTime: {
661
+ type: String,
662
+ default: "00:00:00"
663
+ },
664
+ maxTime: {
665
+ type: String,
666
+ default: "23:59:59"
667
+ }
668
+ },
669
+ setup(props, ctx) {
670
+ const timeListDom = ref();
671
+ const {
672
+ getNewTime,
673
+ activeTimeFun,
674
+ resetTimeValue,
675
+ resetScrollTop
676
+ } = usePopupLine(props.hourList, props.minuteList, props.secondList, props.minTime, props.maxTime, props.format, timeListDom);
677
+ const setOutoTime = (time) => {
678
+ resetTimeValue(time);
679
+ };
680
+ const TimeLi = (timeArr) => {
681
+ return timeArr.map((item, index2) => {
682
+ return createVNode("li", {
683
+ "class": `time-li ${item.flag}Id-${index2} ${item.isActive ? "active-li" : ""} ${item.isDisabled ? "disabled-li" : ""}`,
684
+ "onClick": (e) => {
685
+ activeTimeFun(e, item, index2);
686
+ }
687
+ }, [createVNode("span", null, [item.time])]);
688
+ });
689
+ };
690
+ const TimeUl = (timeList) => {
691
+ return createVNode("div", {
692
+ "class": "time-item",
693
+ "style": {
694
+ "flex": 1
695
+ }
696
+ }, [createVNode(TimeScroll, null, {
697
+ default: () => [createVNode("ul", {
698
+ "class": "time-ul"
699
+ }, [TimeLi(timeList)])]
700
+ })]);
701
+ };
702
+ const formatTimeUl = () => {
703
+ const timeList = {
704
+ "hh": props.hourList,
705
+ "mm": props.minuteList,
706
+ "ss": props.secondList
707
+ };
708
+ const timeFormatArr = props.format.split(":");
709
+ return timeFormatArr.map((timeItme) => {
710
+ return TimeUl(timeList[timeItme]);
711
+ });
712
+ };
713
+ ctx.expose({
714
+ resetScrollTop,
715
+ setOutoTime,
716
+ getNewTime
717
+ });
718
+ return () => {
719
+ return createVNode("div", {
720
+ "class": "devui-time-list",
721
+ "ref": timeListDom
722
+ }, [formatTimeUl()]);
723
+ };
724
+ }
725
+ });
726
+ const buttonProps = {
727
+ type: {
728
+ type: String,
729
+ default: "button"
730
+ },
731
+ btnStyle: {
732
+ type: String,
733
+ default: "primary"
734
+ },
735
+ size: {
736
+ type: String,
737
+ default: "md"
738
+ },
739
+ position: {
740
+ type: String,
741
+ default: "default"
742
+ },
743
+ bordered: {
744
+ type: Boolean,
745
+ default: false
746
+ },
747
+ icon: {
748
+ type: String,
749
+ default: ""
750
+ },
751
+ showLoading: {
752
+ type: Boolean,
753
+ default: false
754
+ },
755
+ width: {
756
+ type: String
757
+ },
758
+ disabled: {
759
+ type: Boolean,
760
+ default: false
761
+ },
762
+ autofocus: {
763
+ type: Boolean,
764
+ default: false
765
+ },
766
+ onClick: {
767
+ type: Function
768
+ }
769
+ };
770
+ var button = "";
771
+ var Button = defineComponent({
772
+ name: "DButton",
773
+ props: buttonProps,
774
+ setup(props, ctx) {
775
+ const buttonContent = ref(null);
776
+ const onClick = (e) => {
777
+ var _a;
778
+ if (props.showLoading) {
779
+ return;
780
+ }
781
+ (_a = props.onClick) == null ? void 0 : _a.call(props, e);
782
+ };
783
+ const hasContent = computed(() => ctx.slots.default);
784
+ const btnClass = computed(() => {
785
+ const {
786
+ btnStyle,
787
+ size,
788
+ position,
789
+ bordered,
790
+ icon
791
+ } = props;
792
+ const origin = `devui-btn devui-btn-${btnStyle} devui-btn-${size} devui-btn-${position}`;
793
+ const borderedClass = bordered ? "bordered" : "";
794
+ const btnIcon = !!icon && !hasContent.value && btnStyle !== "primary" ? "d-btn-icon" : "";
795
+ const btnIconWrap = !!icon ? "d-btn-icon-wrap" : "";
796
+ return `${origin} ${borderedClass} ${btnIcon} ${btnIconWrap}`;
797
+ });
798
+ const iconClass = computed(() => {
799
+ if (!props.icon) {
800
+ return;
801
+ }
802
+ const origin = "devui-icon-fix icon";
803
+ if (hasContent.value) {
804
+ return `${origin} clear-right-5`;
805
+ } else {
806
+ return origin;
807
+ }
808
+ });
809
+ return () => {
810
+ var _a, _b;
811
+ const {
812
+ icon,
813
+ type,
814
+ disabled,
815
+ showLoading,
816
+ width
817
+ } = props;
818
+ return withDirectives(createVNode("div", mergeProps({
819
+ "class": "devui-btn-host"
820
+ }, ctx.attrs), [createVNode("button", {
821
+ "class": btnClass.value,
822
+ "type": type,
823
+ "disabled": disabled,
824
+ "style": {
825
+ width
826
+ },
827
+ "onClick": onClick
828
+ }, [!!icon ? createVNode(Icon, {
829
+ "name": icon,
830
+ "class": iconClass.value
831
+ }, null) : null, createVNode("span", {
832
+ "class": "button-content",
833
+ "ref": buttonContent
834
+ }, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])])]), [[resolveDirective("dLoading"), showLoading]]);
835
+ };
836
+ }
837
+ });
838
+ class View {
839
+ constructor() {
840
+ __publicField(this, "top", "50%");
841
+ __publicField(this, "left", "50%");
842
+ }
843
+ }
844
+ const componentProps = {
845
+ message: String,
846
+ backdrop: Boolean,
847
+ view: {
848
+ type: Object,
849
+ default: () => new View()
850
+ },
851
+ zIndex: Number,
852
+ isFull: {
853
+ type: Boolean,
854
+ default: false
855
+ }
856
+ };
857
+ class LoadingProps {
858
+ constructor() {
859
+ __publicField(this, "target");
860
+ __publicField(this, "message");
861
+ __publicField(this, "loadingTemplateRef");
862
+ __publicField(this, "backdrop", true);
863
+ __publicField(this, "positionType", "relative");
864
+ __publicField(this, "view", new View());
865
+ __publicField(this, "zIndex");
866
+ }
867
+ }
868
+ var loading = "";
869
+ var Loading = defineComponent({
870
+ name: "DLoading",
871
+ inheritAttrs: false,
872
+ props: componentProps,
873
+ setup(props) {
874
+ const style = {
875
+ top: props.view.top,
876
+ left: props.view.left,
877
+ zIndex: props.zIndex
878
+ };
879
+ if (!props.message) {
880
+ style.background = "none";
881
+ }
882
+ const isShow = ref(false);
883
+ const open = () => {
884
+ isShow.value = true;
885
+ };
886
+ const close = () => {
887
+ isShow.value = false;
888
+ };
889
+ return {
890
+ style,
891
+ isShow,
892
+ open,
893
+ close
894
+ };
895
+ },
896
+ render() {
897
+ var _a;
898
+ const {
899
+ isShow,
900
+ isFull,
901
+ backdrop,
902
+ style,
903
+ message,
904
+ $slots
905
+ } = this;
906
+ return isShow && createVNode("div", {
907
+ "class": ["devui-loading-contanier", isFull ? "devui-loading--full" : ""]
908
+ }, [((_a = $slots.default) == null ? void 0 : _a.call($slots)) || createVNode("div", {
909
+ "class": "devui-loading-wrapper"
910
+ }, [backdrop ? createVNode("div", {
911
+ "class": "devui-loading-mask"
912
+ }, null) : null, createVNode("div", {
913
+ "style": style,
914
+ "class": "devui-loading-area"
915
+ }, [createVNode("div", {
916
+ "class": "devui-busy-default-spinner"
917
+ }, [createVNode("div", {
918
+ "class": "devui-loading-bar1"
919
+ }, null), createVNode("div", {
920
+ "class": "devui-loading-bar2"
921
+ }, null), createVNode("div", {
922
+ "class": "devui-loading-bar3"
923
+ }, null), createVNode("div", {
924
+ "class": "devui-loading-bar4"
925
+ }, null)]), message ? createVNode("span", {
926
+ "class": "devui-loading-text"
927
+ }, [message]) : null])])]);
928
+ }
929
+ });
930
+ const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
931
+ function createComponent(Component, props, children = null) {
932
+ const vnode = h(Component, __spreadValues({}, props), children);
933
+ const container = document.createElement("div");
934
+ vnode[COMPONENT_CONTAINER_SYMBOL] = container;
935
+ render(vnode, container);
936
+ return vnode.component;
937
+ }
938
+ function unmountComponent(ComponnetInstance) {
939
+ render(null, ComponnetInstance == null ? void 0 : ComponnetInstance.vnode[COMPONENT_CONTAINER_SYMBOL]);
940
+ }
941
+ const loadingConstructor = defineComponent(Loading);
942
+ const cacheInstance = new WeakSet();
943
+ const isEmpty = (val) => {
944
+ if (!val)
945
+ return true;
946
+ if (Array.isArray(val))
947
+ return val.length === 0;
948
+ if (val instanceof Set || val instanceof Map)
949
+ return val.size === 0;
950
+ if (val instanceof Promise)
951
+ return false;
952
+ if (typeof val === "object") {
953
+ try {
954
+ return Object.keys(val).length === 0;
955
+ } catch (e) {
956
+ return false;
957
+ }
958
+ }
959
+ return false;
960
+ };
961
+ const getType = (vari) => {
962
+ return Object.prototype.toString.call(vari).slice(8, -1).toLowerCase();
963
+ };
964
+ const isPromise = (value) => {
965
+ const type = getType(value);
966
+ switch (type) {
967
+ case "promise":
968
+ return [value];
969
+ case "array":
970
+ if (value.some((val) => getType(val) !== "promise")) {
971
+ console.error(new TypeError("Binding values should all be of type Promise"));
972
+ return "error";
973
+ }
974
+ return value;
975
+ default:
976
+ return false;
977
+ }
978
+ };
979
+ const unmount = (el) => {
980
+ cacheInstance.delete(el);
981
+ el.instance.proxy.close();
982
+ unmountComponent(el.instance);
983
+ };
984
+ const toggleLoading = (el, binding) => {
985
+ if (binding.value) {
986
+ const vals = isPromise(binding.value);
987
+ if (vals === "error")
988
+ return;
989
+ el.instance.proxy.open();
990
+ el.appendChild(el.mask);
991
+ cacheInstance.add(el);
992
+ if (vals) {
993
+ Promise.all(vals).catch((err) => {
994
+ console.error(new Error("Promise handling errors"), err);
995
+ }).finally(() => {
996
+ unmount(el);
997
+ });
998
+ }
999
+ } else {
1000
+ unmount(el);
1001
+ }
1002
+ };
1003
+ const removeAttribute = (el) => {
1004
+ el.removeAttribute("zindex");
1005
+ el.removeAttribute("positiontype");
1006
+ el.removeAttribute("backdrop");
1007
+ el.removeAttribute("message");
1008
+ el.removeAttribute("view");
1009
+ el.removeAttribute("loadingtemplateref");
1010
+ };
1011
+ const handleProps = (el, vprops) => {
1012
+ const props = __spreadValues(__spreadValues({}, new LoadingProps()), vprops);
1013
+ const loadingTemplateRef = props.loadingTemplateRef;
1014
+ const loadingInstance = createComponent(loadingConstructor, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
1015
+ el.style.position = props.positionType;
1016
+ el.options = props;
1017
+ el.instance = loadingInstance;
1018
+ el.mask = loadingInstance.proxy.$el;
1019
+ };
1020
+ const loadingDirective = {
1021
+ mounted: function(el, binding, vnode) {
1022
+ handleProps(el, vnode.props);
1023
+ removeAttribute(el);
1024
+ !isEmpty(binding.value) && toggleLoading(el, binding);
1025
+ },
1026
+ updated: function(el, binding, vnode) {
1027
+ if (!isEmpty(binding.value) && cacheInstance.has(el) || isEmpty(binding.value) && !cacheInstance.has(el))
1028
+ return;
1029
+ !cacheInstance.has(el) && handleProps(el, vnode.props);
1030
+ removeAttribute(el);
1031
+ toggleLoading(el, binding);
1032
+ }
1033
+ };
1034
+ defineComponent(Loading);
1035
+ Button.install = function(app) {
1036
+ app.directive("dLoading", loadingDirective);
1037
+ app.component(Button.name, Button);
1038
+ };
1039
+ var index$1 = "";
1040
+ var TimePopup = defineComponent({
1041
+ name: "DTimePopup",
1042
+ components: {
1043
+ TimeList,
1044
+ Button
1045
+ },
1046
+ props: {
1047
+ showPopup: {
1048
+ type: Boolean,
1049
+ default: false
1050
+ },
1051
+ popupTop: {
1052
+ type: Number,
1053
+ default: -100
1054
+ },
1055
+ popupLeft: {
1056
+ type: Number,
1057
+ default: -100
1058
+ },
1059
+ popupWidth: {
1060
+ type: Number,
1061
+ default: 300
1062
+ },
1063
+ popupFormat: {
1064
+ type: String,
1065
+ default: "hh:mm:ss"
1066
+ },
1067
+ minTime: {
1068
+ type: String,
1069
+ default: "00:00:00"
1070
+ },
1071
+ maxTime: {
1072
+ type: String,
1073
+ default: "23:59:59"
1074
+ },
1075
+ bindData: {
1076
+ type: String,
1077
+ default: "00:00:00"
1078
+ }
1079
+ },
1080
+ emits: ["subData"],
1081
+ setup(props, ctx) {
1082
+ const popupDome = ref();
1083
+ const timeListDom = ref();
1084
+ const hourList = initializeTimeData("hour");
1085
+ const minuteList = initializeTimeData("minute");
1086
+ const secondList = initializeTimeData("second");
1087
+ onMounted(() => {
1088
+ setTimeAstrict(hourList, minuteList, secondList, props.minTime, props.maxTime, props.popupFormat);
1089
+ });
1090
+ watch(() => [props.showPopup, props.bindData], ([showPopup, newTimeVal], [oldShowPopup, oldTimeVal]) => {
1091
+ if (showPopup || newTimeVal != oldTimeVal) {
1092
+ timeListDom.value.setOutoTime(newTimeVal);
1093
+ } else {
1094
+ timeListDom.value.resetScrollTop();
1095
+ }
1096
+ });
1097
+ const changTimeData = () => {
1098
+ return timeListDom.value.getNewTime();
1099
+ };
1100
+ const subDataFun = (e) => {
1101
+ e.stopPropagation();
1102
+ ctx.emit("subData");
1103
+ };
1104
+ ctx.expose({
1105
+ changTimeData
1106
+ });
1107
+ return () => {
1108
+ var _a, _b;
1109
+ return createVNode(Fragment, null, [createVNode("div", {
1110
+ "ref": popupDome,
1111
+ "class": `devui-time-popup ${props.showPopup ? "devui-show-time-popup" : ""}`,
1112
+ "style": {
1113
+ "width": props.popupWidth + "px",
1114
+ "top": props.popupTop + "px",
1115
+ "left": props.popupLeft + "px"
1116
+ }
1117
+ }, [createVNode(TimeList, {
1118
+ "ref": timeListDom,
1119
+ "hourList": hourList,
1120
+ "minuteList": minuteList,
1121
+ "secondList": secondList,
1122
+ "minTime": props.minTime,
1123
+ "maxTime": props.maxTime,
1124
+ "format": props.popupFormat
1125
+ }, null), createVNode("div", {
1126
+ "class": "devui-time-popup-btn"
1127
+ }, [createVNode("div", {
1128
+ "class": "popup-slots"
1129
+ }, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]), createVNode("div", {
1130
+ "onClick": subDataFun
1131
+ }, [createVNode(Button, {
1132
+ "btnStyle": "common"
1133
+ }, {
1134
+ default: () => [createTextVNode("\u786E\u5B9A")]
1135
+ })])])])]);
1136
+ };
1137
+ }
1138
+ });
1139
+ var timePicker = "";
1140
+ var TimePicker = defineComponent({
1141
+ name: "DTimePicker",
1142
+ components: {
1143
+ TimePopup
1144
+ },
1145
+ props: timePickerProps,
1146
+ emits: ["selectedTimeChage", "update:modelValue"],
1147
+ setup(props, ctx) {
1148
+ const activeHour = ref("00");
1149
+ const activeMinute = ref("00");
1150
+ const activeSecond = ref("00");
1151
+ const format = props.format.toLowerCase();
1152
+ const {
1153
+ isActive,
1154
+ showPopup,
1155
+ devuiTimePicker,
1156
+ inputDom,
1157
+ left,
1158
+ top,
1159
+ showClearIcon,
1160
+ firsthandActiveTime,
1161
+ chooseTime,
1162
+ getTimeValue,
1163
+ clickVerifyFun,
1164
+ isOutOpen,
1165
+ vModelIsBeyond,
1166
+ clearAll,
1167
+ timePopupDom,
1168
+ vModeValue,
1169
+ getPopupPosition
1170
+ } = useTimePicker(activeHour, activeMinute, activeSecond, props.minTime, props.maxTime, format, props.autoOpen, props.disabled, props.modelValue);
1171
+ const selectedTimeChage = (e) => {
1172
+ isActive.value = false;
1173
+ showPopup.value = false;
1174
+ ctx.emit("selectedTimeChage", vModeValue.value);
1175
+ };
1176
+ onMounted(() => {
1177
+ getPopupPosition();
1178
+ isOutOpen();
1179
+ vModelIsBeyond();
1180
+ document.addEventListener("click", clickVerifyFun);
1181
+ document.addEventListener("click", getTimeValue);
1182
+ document.addEventListener("scroll", getPopupPosition);
1183
+ window.addEventListener("resize", getPopupPosition);
1184
+ });
1185
+ onUnmounted(() => {
1186
+ document.removeEventListener("click", clickVerifyFun);
1187
+ document.removeEventListener("click", getTimeValue);
1188
+ document.removeEventListener("scroll", getPopupPosition);
1189
+ window.removeEventListener("resize", getPopupPosition);
1190
+ });
1191
+ watch(vModeValue, (newValue) => {
1192
+ ctx.emit("update:modelValue", vModeValue.value);
1193
+ if (newValue != props.minTime && newValue != "00:00") {
1194
+ showClearIcon.value = true;
1195
+ } else {
1196
+ showClearIcon.value = false;
1197
+ }
1198
+ });
1199
+ ctx.expose({
1200
+ clearAll,
1201
+ chooseTime
1202
+ });
1203
+ return () => {
1204
+ return createVNode(Fragment, null, [createVNode("div", {
1205
+ "class": `devui-time-picker ${isActive.value ? "time-picker-active" : ""} ${props.disabled ? "picker-disabled" : ""}`,
1206
+ "ref": devuiTimePicker
1207
+ }, [createVNode(TimePopup, {
1208
+ "ref": timePopupDom,
1209
+ "showPopup": showPopup.value,
1210
+ "popupTop": top.value,
1211
+ "popupLeft": left.value,
1212
+ "popupWidth": props.timePickerWidth,
1213
+ "popupFormat": props.format.toLowerCase(),
1214
+ "minTime": props.minTime,
1215
+ "maxTime": props.maxTime,
1216
+ "bindData": firsthandActiveTime.value,
1217
+ "onSubData": selectedTimeChage
1218
+ }, {
1219
+ default: () => {
1220
+ var _a, _b;
1221
+ return [(_b = (_a = ctx.slots).customViewTemplate) == null ? void 0 : _b.call(_a)];
1222
+ }
1223
+ }), createVNode("input", {
1224
+ "ref": inputDom,
1225
+ "type": "text",
1226
+ "value": vModeValue.value,
1227
+ "placeholder": `${props.placeholder}`,
1228
+ "disabled": props.disabled,
1229
+ "class": "time-input"
1230
+ }, null), createVNode("div", {
1231
+ "class": "time-input-icon"
1232
+ }, [createVNode("div", {
1233
+ "onClick": clearAll
1234
+ }, [showClearIcon.value ? createVNode(Icon, {
1235
+ "size": "small",
1236
+ "name": "close"
1237
+ }, null) : ""]), createVNode("div", null, [createVNode(Icon, {
1238
+ "size": "small",
1239
+ "name": "time"
1240
+ }, null)])])])]);
1241
+ };
1242
+ }
1243
+ });
1244
+ TimePicker.install = function(app) {
1245
+ app.component(TimePicker.name, TimePicker);
1246
+ };
1247
+ var index = {
1248
+ title: "TimePicker \u65F6\u95F4\u9009\u62E9\u5668",
1249
+ category: "\u6570\u636E\u5F55\u5165",
1250
+ status: "90%",
1251
+ install(app) {
1252
+ app.use(TimePicker);
1253
+ }
1254
+ };
1255
+ export { TimePicker, index as default };