vue-devui 1.0.0-beta.2 → 1.0.0-beta.220808

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 (455) hide show
  1. package/README.md +163 -172
  2. package/alert/index.d.ts +7 -0
  3. package/alert/index.es.js +79 -51
  4. package/alert/index.umd.js +1 -1
  5. package/alert/style.css +1 -1
  6. package/auto-complete/index.d.ts +7 -0
  7. package/auto-complete/index.es.js +9053 -0
  8. package/auto-complete/index.umd.js +40 -0
  9. package/auto-complete/package.json +7 -0
  10. package/auto-complete/style.css +1 -0
  11. package/avatar/index.d.ts +7 -0
  12. package/avatar/index.es.js +154 -147
  13. package/avatar/index.umd.js +1 -1
  14. package/avatar/style.css +1 -1
  15. package/badge/index.d.ts +7 -0
  16. package/badge/index.es.js +46 -21
  17. package/badge/index.umd.js +1 -1
  18. package/badge/style.css +1 -1
  19. package/button/index.d.ts +7 -0
  20. package/button/index.es.js +5921 -146
  21. package/button/index.umd.js +27 -1
  22. package/button/style.css +1 -1
  23. package/card/index.d.ts +7 -0
  24. package/card/index.es.js +64 -36
  25. package/card/index.umd.js +1 -1
  26. package/card/style.css +1 -1
  27. package/checkbox/index.d.ts +7 -0
  28. package/checkbox/index.es.js +8122 -255
  29. package/checkbox/index.umd.js +38 -1
  30. package/checkbox/style.css +1 -1
  31. package/collapse/index.d.ts +7 -0
  32. package/collapse/index.es.js +195 -0
  33. package/collapse/index.umd.js +1 -0
  34. package/{cascader → collapse}/package.json +1 -1
  35. package/collapse/style.css +1 -0
  36. package/countdown/index.d.ts +7 -0
  37. package/countdown/index.es.js +217 -0
  38. package/countdown/index.umd.js +1 -0
  39. package/{accordion → countdown}/package.json +1 -1
  40. package/countdown/style.css +1 -0
  41. package/date-picker-pro/index.d.ts +7 -0
  42. package/date-picker-pro/index.es.js +12035 -0
  43. package/date-picker-pro/index.umd.js +38 -0
  44. package/date-picker-pro/package.json +7 -0
  45. package/date-picker-pro/style.css +1 -0
  46. package/drawer/index.d.ts +7 -0
  47. package/drawer/index.es.js +205 -154
  48. package/drawer/index.umd.js +1 -1
  49. package/drawer/style.css +1 -1
  50. package/dropdown/index.d.ts +7 -0
  51. package/dropdown/index.es.js +736 -0
  52. package/dropdown/index.umd.js +1 -0
  53. package/{carousel → dropdown}/package.json +1 -1
  54. package/dropdown/style.css +1 -0
  55. package/editable-select/index.d.ts +7 -0
  56. package/editable-select/index.es.js +908 -461
  57. package/editable-select/index.umd.js +1 -1
  58. package/editable-select/style.css +1 -1
  59. package/form/index.d.ts +7 -0
  60. package/form/index.es.js +2439 -1995
  61. package/form/index.umd.js +29 -18
  62. package/form/style.css +1 -1
  63. package/fullscreen/index.d.ts +7 -0
  64. package/fullscreen/index.es.js +138 -125
  65. package/fullscreen/index.umd.js +1 -1
  66. package/fullscreen/style.css +1 -1
  67. package/grid/index.d.ts +7 -0
  68. package/grid/index.es.js +271 -0
  69. package/grid/index.umd.js +1 -0
  70. package/{toast → grid}/package.json +1 -1
  71. package/grid/style.css +1 -0
  72. package/icon/index.d.ts +7 -0
  73. package/icon/index.es.js +200 -56
  74. package/icon/index.umd.js +1 -1
  75. package/icon/style.css +1 -0
  76. package/image-preview/index.d.ts +7 -0
  77. package/image-preview/index.es.js +154 -62
  78. package/image-preview/index.umd.js +1 -1
  79. package/image-preview/style.css +1 -1
  80. package/index.d.ts +7 -0
  81. package/input/index.d.ts +7 -0
  82. package/input/index.es.js +8269 -145
  83. package/input/index.umd.js +38 -1
  84. package/input/style.css +1 -1
  85. package/input-number/index.d.ts +7 -0
  86. package/input-number/index.es.js +260 -191
  87. package/input-number/index.umd.js +1 -1
  88. package/input-number/style.css +1 -1
  89. package/layout/index.d.ts +7 -0
  90. package/layout/index.es.js +41 -26
  91. package/layout/index.umd.js +1 -1
  92. package/layout/style.css +1 -1
  93. package/loading/index.d.ts +7 -0
  94. package/loading/index.es.js +89 -73
  95. package/loading/index.umd.js +1 -1
  96. package/loading/style.css +1 -1
  97. package/mention/index.d.ts +7 -0
  98. package/mention/index.es.js +8326 -0
  99. package/mention/index.umd.js +47 -0
  100. package/mention/package.json +7 -0
  101. package/mention/style.css +1 -0
  102. package/menu/index.d.ts +7 -0
  103. package/menu/index.es.js +891 -0
  104. package/menu/index.umd.js +1 -0
  105. package/{anchor → menu}/package.json +1 -1
  106. package/menu/style.css +1 -0
  107. package/message/index.d.ts +7 -0
  108. package/message/index.es.js +533 -0
  109. package/message/index.umd.js +1 -0
  110. package/message/package.json +7 -0
  111. package/message/style.css +1 -0
  112. package/modal/index.d.ts +7 -0
  113. package/modal/index.es.js +611 -877
  114. package/modal/index.umd.js +1 -1
  115. package/modal/style.css +1 -1
  116. package/notification/index.d.ts +7 -0
  117. package/notification/index.es.js +528 -0
  118. package/notification/index.umd.js +1 -0
  119. package/notification/package.json +7 -0
  120. package/notification/style.css +1 -0
  121. package/nuxt/components/Alert.js +3 -0
  122. package/nuxt/components/Aside.js +3 -0
  123. package/nuxt/components/AutoComplete.js +3 -0
  124. package/nuxt/components/Avatar.js +3 -0
  125. package/nuxt/components/Badge.js +3 -0
  126. package/nuxt/components/Button.js +3 -0
  127. package/nuxt/components/ButtonGroup.js +3 -0
  128. package/nuxt/components/Card.js +3 -0
  129. package/nuxt/components/Checkbox.js +3 -0
  130. package/nuxt/components/CheckboxButton.js +3 -0
  131. package/nuxt/components/CheckboxGroup.js +3 -0
  132. package/nuxt/components/Col.js +3 -0
  133. package/nuxt/components/Collapse.js +3 -0
  134. package/nuxt/components/CollapseItem.js +3 -0
  135. package/nuxt/components/Column.js +3 -0
  136. package/nuxt/components/Content.js +3 -0
  137. package/nuxt/components/Countdown.js +3 -0
  138. package/nuxt/components/DRangeDatePickerPro.js +3 -0
  139. package/nuxt/components/DatePickerPro.js +3 -0
  140. package/nuxt/components/Drawer.js +3 -0
  141. package/nuxt/components/DrawerService.js +3 -0
  142. package/nuxt/components/Dropdown.js +3 -0
  143. package/nuxt/components/DropdownMenu.js +3 -0
  144. package/nuxt/components/DropdownPropsKey.js +3 -0
  145. package/nuxt/components/EditableSelect.js +3 -0
  146. package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
  147. package/nuxt/components/FORM_TOKEN.js +3 -0
  148. package/nuxt/components/FixedOverlay.js +3 -0
  149. package/nuxt/components/FlexibleOverlay.js +3 -0
  150. package/nuxt/components/Footer.js +3 -0
  151. package/nuxt/components/Form.js +3 -0
  152. package/nuxt/components/FormItem.js +3 -0
  153. package/nuxt/components/FormOperation.js +3 -0
  154. package/nuxt/components/Fullscreen.js +3 -0
  155. package/nuxt/components/Header.js +3 -0
  156. package/nuxt/components/IFileOptions.js +3 -0
  157. package/nuxt/components/IUploadOptions.js +3 -0
  158. package/nuxt/components/Icon.js +3 -0
  159. package/nuxt/components/IconGroup.js +3 -0
  160. package/nuxt/components/ImagePreviewService.js +3 -0
  161. package/nuxt/components/Input.js +3 -0
  162. package/nuxt/components/InputNumber.js +3 -0
  163. package/nuxt/components/LABEL_DATA.js +3 -0
  164. package/nuxt/components/Layout.js +3 -0
  165. package/nuxt/components/Loading.js +3 -0
  166. package/nuxt/components/LoadingOptions.js +3 -0
  167. package/nuxt/components/LoadingService.js +3 -0
  168. package/nuxt/components/Mention.js +3 -0
  169. package/nuxt/components/Menu.js +3 -0
  170. package/nuxt/components/MenuItem.js +3 -0
  171. package/nuxt/components/Message.js +3 -0
  172. package/nuxt/components/Modal.js +3 -0
  173. package/nuxt/components/Notification.js +3 -0
  174. package/nuxt/components/NotificationService.js +3 -0
  175. package/nuxt/components/Option.js +3 -0
  176. package/nuxt/components/OptionGroup.js +3 -0
  177. package/nuxt/components/Pagination.js +3 -0
  178. package/nuxt/components/Panel.js +3 -0
  179. package/nuxt/components/PanelBody.js +3 -0
  180. package/nuxt/components/PanelFooter.js +3 -0
  181. package/nuxt/components/PanelHeader.js +3 -0
  182. package/nuxt/components/Popover.js +3 -0
  183. package/nuxt/components/Progress.js +3 -0
  184. package/nuxt/components/Radio.js +3 -0
  185. package/nuxt/components/RadioButton.js +3 -0
  186. package/nuxt/components/RadioGroup.js +3 -0
  187. package/nuxt/components/Rate.js +3 -0
  188. package/nuxt/components/Result.js +3 -0
  189. package/nuxt/components/Row.js +3 -0
  190. package/nuxt/components/Search.js +3 -0
  191. package/nuxt/components/Select.js +3 -0
  192. package/nuxt/components/Skeleton.js +3 -0
  193. package/nuxt/components/SkeletonItem.js +3 -0
  194. package/nuxt/components/Slider.js +3 -0
  195. package/nuxt/components/Splitter.js +3 -0
  196. package/nuxt/components/Statistic.js +3 -0
  197. package/nuxt/components/Status.js +3 -0
  198. package/nuxt/components/Step.js +3 -0
  199. package/nuxt/components/Steps.js +3 -0
  200. package/nuxt/components/SubMenu.js +3 -0
  201. package/nuxt/components/Switch.js +3 -0
  202. package/nuxt/components/TABLE_TOKEN.js +3 -0
  203. package/nuxt/components/Tab.js +3 -0
  204. package/nuxt/components/Table.js +3 -0
  205. package/nuxt/components/Tabs.js +3 -0
  206. package/nuxt/components/Tag.js +3 -0
  207. package/nuxt/components/Textarea.js +3 -0
  208. package/nuxt/components/TimePicker.js +3 -0
  209. package/nuxt/components/TimeSelect.js +3 -0
  210. package/nuxt/components/Timeline.js +3 -0
  211. package/nuxt/components/TimelineItem.js +3 -0
  212. package/nuxt/components/Tooltip.js +3 -0
  213. package/nuxt/components/Tree.js +3 -0
  214. package/nuxt/components/Upload.js +3 -0
  215. package/nuxt/components/UploadStatus.js +3 -0
  216. package/nuxt/components/alertProps.js +3 -0
  217. package/nuxt/components/animationInjectionKey.js +3 -0
  218. package/nuxt/components/autoCompleteProps.js +3 -0
  219. package/nuxt/components/avatarProps.js +3 -0
  220. package/nuxt/components/badgeProps.js +3 -0
  221. package/nuxt/components/buttonGroupInjectionKey.js +3 -0
  222. package/nuxt/components/buttonGroupProps.js +3 -0
  223. package/nuxt/components/buttonProps.js +3 -0
  224. package/nuxt/components/cardProps.js +3 -0
  225. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  226. package/nuxt/components/checkboxGroupProps.js +3 -0
  227. package/nuxt/components/checkboxProps.js +3 -0
  228. package/nuxt/components/colProps.js +3 -0
  229. package/nuxt/components/colPropsBaseClass.js +3 -0
  230. package/nuxt/components/colPropsBaseStyle.js +3 -0
  231. package/nuxt/components/collapseItemProps.js +3 -0
  232. package/nuxt/components/collapseProps.js +3 -0
  233. package/nuxt/components/countdownProps.js +3 -0
  234. package/nuxt/components/datePickerProCommonProps.js +3 -0
  235. package/nuxt/components/datePickerProPanelProps.js +3 -0
  236. package/nuxt/components/datePickerProProps.js +3 -0
  237. package/nuxt/components/dropdownMenuProps.js +3 -0
  238. package/nuxt/components/editableSelectProps.js +3 -0
  239. package/nuxt/components/fixedOverlayProps.js +3 -0
  240. package/nuxt/components/flexibleOverlayProps.js +3 -0
  241. package/nuxt/components/formItemProps.js +3 -0
  242. package/nuxt/components/formProps.js +3 -0
  243. package/nuxt/components/fullscreenProps.js +3 -0
  244. package/nuxt/components/iconProps.js +3 -0
  245. package/nuxt/components/imagePreviewProps.js +3 -0
  246. package/nuxt/components/inputProps.js +3 -0
  247. package/nuxt/components/loadingProps.js +3 -0
  248. package/nuxt/components/mentionProps.js +3 -0
  249. package/nuxt/components/messageProps.js +3 -0
  250. package/nuxt/components/modalProps.js +3 -0
  251. package/nuxt/components/notificationProps.js +3 -0
  252. package/nuxt/components/paginationProps.js +3 -0
  253. package/nuxt/components/panelProps.js +3 -0
  254. package/nuxt/components/popoverProps.js +3 -0
  255. package/nuxt/components/progressProps.js +3 -0
  256. package/nuxt/components/rateProps.js +3 -0
  257. package/nuxt/components/resultProps.js +3 -0
  258. package/nuxt/components/roundInjectionKey.js +3 -0
  259. package/nuxt/components/rowProps.js +3 -0
  260. package/nuxt/components/screenSizes.js +3 -0
  261. package/nuxt/components/searchProps.js +3 -0
  262. package/nuxt/components/skeletonItemProps.js +3 -0
  263. package/nuxt/components/skeletonProps.js +3 -0
  264. package/nuxt/components/sliderProps.js +3 -0
  265. package/nuxt/components/splitterProps.js +3 -0
  266. package/nuxt/components/statisticProps.js +3 -0
  267. package/nuxt/components/stepProps.js +3 -0
  268. package/nuxt/components/stepsProps.js +3 -0
  269. package/nuxt/components/svgIconProps.js +3 -0
  270. package/nuxt/components/switchProps.js +3 -0
  271. package/nuxt/components/tableProps.js +3 -0
  272. package/nuxt/components/tabsProps.js +3 -0
  273. package/nuxt/components/tagProps.js +3 -0
  274. package/nuxt/components/textareaProps.js +3 -0
  275. package/nuxt/components/timeAxisProps.js +3 -0
  276. package/nuxt/components/timerPickerPanelProps.js +3 -0
  277. package/nuxt/components/tooltipProps.js +3 -0
  278. package/nuxt/components/treeNodeProps.js +3 -0
  279. package/nuxt/components/treeProps.js +3 -0
  280. package/nuxt/components/uploadProps.js +3 -0
  281. package/nuxt/index.js +13 -0
  282. package/overlay/index.d.ts +7 -0
  283. package/overlay/index.es.js +245 -303
  284. package/overlay/index.umd.js +1 -1
  285. package/overlay/style.css +1 -1
  286. package/package.json +16 -84
  287. package/pagination/index.d.ts +7 -0
  288. package/pagination/index.es.js +333 -155
  289. package/pagination/index.umd.js +1 -1
  290. package/pagination/style.css +1 -1
  291. package/panel/index.d.ts +7 -0
  292. package/panel/index.es.js +48 -35
  293. package/panel/index.umd.js +1 -1
  294. package/panel/style.css +1 -1
  295. package/popover/index.d.ts +7 -0
  296. package/popover/index.es.js +6035 -204
  297. package/popover/index.umd.js +27 -1
  298. package/popover/style.css +1 -1
  299. package/progress/index.d.ts +7 -0
  300. package/progress/index.es.js +111 -57
  301. package/progress/index.umd.js +3 -3
  302. package/progress/style.css +1 -1
  303. package/radio/index.d.ts +7 -0
  304. package/radio/index.es.js +8015 -182
  305. package/radio/index.umd.js +38 -1
  306. package/radio/style.css +1 -1
  307. package/rate/index.d.ts +7 -0
  308. package/rate/index.es.js +78 -56
  309. package/rate/index.umd.js +1 -1
  310. package/rate/style.css +1 -1
  311. package/result/index.d.ts +7 -0
  312. package/result/index.es.js +248 -0
  313. package/result/index.umd.js +1 -0
  314. package/{sticky → result}/package.json +1 -1
  315. package/result/style.css +1 -0
  316. package/ripple/index.d.ts +7 -0
  317. package/ripple/index.es.js +56 -61
  318. package/ripple/index.umd.js +1 -1
  319. package/search/index.d.ts +7 -0
  320. package/search/index.es.js +8381 -406
  321. package/search/index.umd.js +38 -1
  322. package/search/style.css +1 -1
  323. package/select/index.d.ts +7 -0
  324. package/select/index.es.js +9331 -576
  325. package/select/index.umd.js +38 -1
  326. package/select/style.css +1 -1
  327. package/skeleton/index.d.ts +7 -0
  328. package/skeleton/index.es.js +115 -145
  329. package/skeleton/index.umd.js +1 -1
  330. package/skeleton/style.css +1 -1
  331. package/slider/index.d.ts +7 -0
  332. package/slider/index.es.js +148 -142
  333. package/slider/index.umd.js +1 -1
  334. package/slider/style.css +1 -1
  335. package/splitter/index.d.ts +7 -0
  336. package/splitter/index.es.js +6308 -181
  337. package/splitter/index.umd.js +27 -1
  338. package/splitter/style.css +1 -1
  339. package/statistic/index.d.ts +7 -0
  340. package/statistic/index.es.js +253 -0
  341. package/statistic/index.umd.js +1 -0
  342. package/statistic/package.json +7 -0
  343. package/statistic/style.css +1 -0
  344. package/status/index.d.ts +7 -0
  345. package/status/index.es.js +29 -8
  346. package/status/index.umd.js +1 -1
  347. package/status/style.css +1 -1
  348. package/steps/index.d.ts +7 -0
  349. package/steps/index.es.js +386 -0
  350. package/steps/index.umd.js +1 -0
  351. package/steps/package.json +7 -0
  352. package/steps/style.css +1 -0
  353. package/style.css +1 -1
  354. package/switch/index.d.ts +7 -0
  355. package/switch/index.es.js +7819 -65
  356. package/switch/index.umd.js +38 -1
  357. package/switch/style.css +1 -1
  358. package/table/index.d.ts +7 -0
  359. package/table/index.es.js +11435 -204
  360. package/table/index.umd.js +38 -1
  361. package/table/style.css +1 -1
  362. package/tabs/index.d.ts +7 -0
  363. package/tabs/index.es.js +356 -143
  364. package/tabs/index.umd.js +1 -1
  365. package/tabs/style.css +1 -1
  366. package/tag/index.d.ts +7 -0
  367. package/tag/index.es.js +156 -0
  368. package/tag/index.umd.js +1 -0
  369. package/tag/package.json +7 -0
  370. package/tag/style.css +1 -0
  371. package/textarea/index.d.ts +7 -0
  372. package/textarea/index.es.js +7989 -0
  373. package/textarea/index.umd.js +46 -0
  374. package/textarea/package.json +7 -0
  375. package/textarea/style.css +1 -0
  376. package/{theme → theme/theme.scss} +0 -0
  377. package/time-picker/index.d.ts +7 -0
  378. package/time-picker/index.es.js +9126 -597
  379. package/time-picker/index.umd.js +38 -1
  380. package/time-picker/style.css +1 -1
  381. package/time-select/index.d.ts +7 -0
  382. package/time-select/index.es.js +9606 -0
  383. package/time-select/index.umd.js +38 -0
  384. package/{breadcrumb → time-select}/package.json +1 -1
  385. package/time-select/style.css +1 -0
  386. package/timeline/index.d.ts +7 -0
  387. package/timeline/index.es.js +427 -0
  388. package/timeline/index.umd.js +1 -0
  389. package/timeline/package.json +7 -0
  390. package/timeline/style.css +1 -0
  391. package/tooltip/index.d.ts +7 -0
  392. package/tooltip/index.es.js +5870 -141
  393. package/tooltip/index.umd.js +27 -1
  394. package/tooltip/style.css +1 -1
  395. package/tree/index.d.ts +7 -0
  396. package/tree/index.es.js +11504 -692
  397. package/tree/index.umd.js +38 -1
  398. package/tree/style.css +1 -1
  399. package/upload/index.d.ts +7 -0
  400. package/upload/index.es.js +968 -2748
  401. package/upload/index.umd.js +1 -1
  402. package/upload/style.css +1 -1
  403. package/vue-devui.es.js +22816 -16568
  404. package/vue-devui.umd.js +42 -20
  405. package/accordion/index.es.js +0 -190
  406. package/accordion/index.umd.js +0 -1
  407. package/accordion/style.css +0 -1
  408. package/anchor/index.es.js +0 -263
  409. package/anchor/index.umd.js +0 -1
  410. package/anchor/style.css +0 -1
  411. package/breadcrumb/index.es.js +0 -127
  412. package/breadcrumb/index.umd.js +0 -1
  413. package/breadcrumb/style.css +0 -1
  414. package/carousel/index.es.js +0 -328
  415. package/carousel/index.umd.js +0 -1
  416. package/carousel/style.css +0 -1
  417. package/cascader/index.es.js +0 -187
  418. package/cascader/index.umd.js +0 -1
  419. package/cascader/style.css +0 -1
  420. package/date-picker/index.es.js +0 -1171
  421. package/date-picker/index.umd.js +0 -1
  422. package/date-picker/package.json +0 -7
  423. package/date-picker/style.css +0 -1
  424. package/nav-sprite/index.es.js +0 -742
  425. package/nav-sprite/index.umd.js +0 -1
  426. package/nav-sprite/package.json +0 -7
  427. package/quadrant-diagram/index.es.js +0 -489
  428. package/quadrant-diagram/index.umd.js +0 -1
  429. package/quadrant-diagram/package.json +0 -7
  430. package/quadrant-diagram/style.css +0 -1
  431. package/steps-guide/index.es.js +0 -211
  432. package/steps-guide/index.umd.js +0 -1
  433. package/steps-guide/package.json +0 -7
  434. package/steps-guide/style.css +0 -1
  435. package/sticky/index.es.js +0 -197
  436. package/sticky/index.umd.js +0 -1
  437. package/tag-input/index.es.js +0 -341
  438. package/tag-input/index.umd.js +0 -1
  439. package/tag-input/package.json +0 -7
  440. package/tag-input/style.css +0 -1
  441. package/time-axis/index.es.js +0 -79
  442. package/time-axis/index.umd.js +0 -1
  443. package/time-axis/package.json +0 -7
  444. package/time-axis/style.css +0 -1
  445. package/toast/index.es.js +0 -2059
  446. package/toast/index.umd.js +0 -1
  447. package/toast/style.css +0 -1
  448. package/transfer/index.es.js +0 -1446
  449. package/transfer/index.umd.js +0 -1
  450. package/transfer/package.json +0 -7
  451. package/transfer/style.css +0 -1
  452. package/tree-select/index.es.js +0 -203
  453. package/tree-select/index.umd.js +0 -1
  454. package/tree-select/package.json +0 -7
  455. package/tree-select/style.css +0 -1
@@ -1,1171 +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
- import { defineComponent, inject, computed, ref, watch, createVNode, withDirectives, mergeProps, resolveDirective, resolveComponent, Fragment, createTextVNode, reactive, onMounted, onUnmounted } from "vue";
18
- const getDateTime = (d) => {
19
- const year = d.getFullYear();
20
- const month = d.getMonth() + 1;
21
- const date = d.getDate();
22
- const day = d.getDay();
23
- const hour = d.getHours();
24
- const minute = d.getMinutes();
25
- const second = d.getSeconds();
26
- const ms = d.getMilliseconds();
27
- return [year, month, date, day, hour, minute, second, ms];
28
- };
29
- const fixStart = (n, m, max = 2, ch = "0") => {
30
- return (n + "").padStart(Math.min(m.length, max), ch);
31
- };
32
- const formatDate = (fmt, d) => {
33
- const usage = getDateTime(d);
34
- let res = fmt;
35
- res = res.replace(/y+/g, (m) => {
36
- const year = usage[0] + "";
37
- if (m.length === 2) {
38
- return year.substring(2);
39
- }
40
- return year;
41
- });
42
- res = res.replace(/M+/g, (m) => fixStart(usage[1], m));
43
- res = res.replace(/d+/g, (m) => fixStart(usage[2], m));
44
- res = res.replace(/h+/g, (m) => fixStart(usage[4], m));
45
- res = res.replace(/m+/g, (m) => fixStart(usage[5], m));
46
- res = res.replace(/s+/g, (m) => fixStart(usage[6], m));
47
- return res;
48
- };
49
- const formatRange$1 = (fmt, a, b, conn = "-") => {
50
- const ab = [a, b];
51
- if (a.getTime() > b.getTime()) {
52
- ab.reverse();
53
- }
54
- return `${formatDate(fmt, ab[0])} ${conn} ${formatDate(fmt, ab[1])}`;
55
- };
56
- const isIn = (a, b) => {
57
- if (!b) {
58
- return false;
59
- }
60
- while (a) {
61
- if (a === b) {
62
- return true;
63
- }
64
- a = a.parentNode;
65
- }
66
- return false;
67
- };
68
- const invokeFunction = (fn, ...args) => {
69
- if (typeof fn === "function") {
70
- fn(...args);
71
- }
72
- };
73
- const getHumanDate = (d) => {
74
- const year = d.getFullYear();
75
- const month = d.getMonth() + 1;
76
- const date = d.getDate();
77
- const day = d.getDay();
78
- const hour = d.getHours();
79
- const minute = d.getMinutes();
80
- const second = d.getSeconds();
81
- const ms = d.getMilliseconds();
82
- return {
83
- year,
84
- y: year,
85
- month,
86
- M: month,
87
- date,
88
- d: date,
89
- day,
90
- hour,
91
- H: hour,
92
- h: hour,
93
- minute,
94
- m: minute,
95
- second,
96
- s: second,
97
- ms
98
- };
99
- };
100
- const getMonthDays = (year, month) => {
101
- const first = new Date(year, month - 1, 1);
102
- const last = new Date(year, month, 0);
103
- const dates = [];
104
- let day = first.getDay();
105
- while (day > 0) {
106
- day -= 1;
107
- dates.push({ date: new Date(year, month - 1, -day), current: -1 });
108
- }
109
- day = last.getDate() - first.getDate();
110
- for (let i = 0; i <= day; i++) {
111
- const date = new Date(first);
112
- date.setDate(i + 1);
113
- dates.push({ date, current: 0 });
114
- }
115
- day = last.getDay();
116
- let tail = last;
117
- for (let i = day; i < 6; i++) {
118
- tail = new Date(year, month, i - day + 1);
119
- dates.push({ date: tail, current: 1 });
120
- }
121
- if (dates.length < 42) {
122
- day = tail.getDate();
123
- for (let i = 1; i <= 7; i++) {
124
- tail = new Date(year, month, day + i);
125
- dates.push({ date: tail, current: 1 });
126
- }
127
- }
128
- return dates;
129
- };
130
- const getMonthWeeklyDays = (date = new Date()) => {
131
- if (!(date instanceof Date)) {
132
- date = new Date();
133
- }
134
- const { year, month } = getHumanDate(date);
135
- const days = getMonthDays(year, month);
136
- const dayRows = [];
137
- while (days.length > 0) {
138
- dayRows.push(days.splice(0, 7));
139
- }
140
- return dayRows;
141
- };
142
- const WEEK_DAYS = ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
143
- const invokeCallback = (cb, ...args) => {
144
- typeof cb === "function" && cb(...args);
145
- };
146
- const subDateMonth = (a, b) => {
147
- const am = a.getFullYear() * 12 + a.getMonth();
148
- const bm = b.getFullYear() * 12 + b.getMonth();
149
- return am - bm;
150
- };
151
- const ONE_DAY = 1e3 * 60 * 60 * 24;
152
- const subDateDay = (a, b) => {
153
- const ad = new Date(a.getFullYear(), a.getMonth(), a.getDate()).getTime();
154
- const bd = new Date(b.getFullYear(), b.getMonth(), b.getDate()).getTime();
155
- return (ad - bd) / ONE_DAY;
156
- };
157
- const compareDate = (small, big, mode, min) => {
158
- if (!small || !big) {
159
- return true;
160
- }
161
- if (mode === "year") {
162
- return big.getFullYear() - small.getFullYear() > min;
163
- } else {
164
- return subDateMonth(big, small) > min;
165
- }
166
- };
167
- const parseDate = (str) => {
168
- if (!str || typeof str !== "string") {
169
- return null;
170
- }
171
- const [dateStr = "", timeStr = ""] = str.split(/([ ]|T)+/);
172
- if (!dateStr) {
173
- return null;
174
- }
175
- const [y, m, d] = dateStr.split(/[^\d]+/);
176
- const year = _parseInt(y), month = _parseInt(m), date = _parseInt(d) || 1;
177
- if (!year || !month) {
178
- return null;
179
- }
180
- const time = parseTime(timeStr);
181
- return new Date(year, month - 1, date, ...time);
182
- };
183
- const _parseInt = (str, dftVal) => {
184
- if (!str || typeof str !== "string") {
185
- return dftVal;
186
- }
187
- const n = parseInt(str);
188
- if (isNaN(n)) {
189
- return dftVal;
190
- }
191
- return n;
192
- };
193
- const parseTime = (str) => {
194
- const [h, m, s, ms] = str.split(/[\:\.]+/);
195
- return [_parseInt(h, 0), _parseInt(m, 0), _parseInt(s, 0), _parseInt(ms, 0)];
196
- };
197
- const compareDateSort = (d1, d2, type = "d") => {
198
- const t1 = dateCounter(d1, type), t2 = dateCounter(d2, type);
199
- return t1 < t2 ? -1 : t1 > t2 ? 1 : 0;
200
- };
201
- const dateCounter = (date, type) => {
202
- switch (type) {
203
- case "y":
204
- return date.getFullYear();
205
- case "m":
206
- return date.getFullYear() * 12 + date.getMonth();
207
- }
208
- return date.getTime() / ONE_DAY >> 0;
209
- };
210
- const betweenDate = (date, left, right) => {
211
- if (left instanceof Date && compareDateSort(left, date, "d") > 0) {
212
- return false;
213
- }
214
- if (right instanceof Date && compareDateSort(date, right, "d") > 0) {
215
- return false;
216
- }
217
- return true;
218
- };
219
- const inputProps = {
220
- placeholder: {
221
- type: String,
222
- default: void 0
223
- },
224
- disabled: {
225
- type: Boolean,
226
- default: false
227
- },
228
- autoFocus: {
229
- type: Boolean,
230
- default: false
231
- },
232
- maxLength: {
233
- type: Number,
234
- default: Number.MAX_SAFE_INTEGER
235
- },
236
- cssClass: {
237
- type: String,
238
- default: ""
239
- },
240
- error: {
241
- type: Boolean,
242
- default: false
243
- },
244
- size: {
245
- type: String,
246
- default: ""
247
- },
248
- showPassword: {
249
- type: Boolean,
250
- default: false
251
- },
252
- value: {
253
- type: String,
254
- default: ""
255
- },
256
- "onUpdate:value": {
257
- type: Function,
258
- default: void 0
259
- },
260
- "onChange": {
261
- type: Function,
262
- default: void 0
263
- },
264
- "onKeydown": {
265
- type: Function,
266
- default: void 0
267
- },
268
- "onFocus": {
269
- type: Function,
270
- default: void 0
271
- },
272
- "onBlur": {
273
- type: Function,
274
- default: void 0
275
- }
276
- };
277
- var input = "";
278
- const formItemInjectionKey = Symbol("dFormItem");
279
- const dFormItemEvents = {
280
- blur: "d.form.blur",
281
- change: "d.form.change",
282
- input: "d.form.input"
283
- };
284
- var Input = defineComponent({
285
- name: "DInput",
286
- directives: {
287
- focus: {
288
- mounted: function(el, binding) {
289
- if (binding.value) {
290
- el.focus();
291
- }
292
- }
293
- }
294
- },
295
- props: inputProps,
296
- emits: ["update:value", "focus", "blur", "change", "keydown"],
297
- setup(props, ctx) {
298
- const formItem = inject(formItemInjectionKey, {});
299
- const sizeCls = computed(() => `devui-input-${props.size}`);
300
- const showPwdIcon = ref(false);
301
- const inputType = ref("text");
302
- const inputCls = computed(() => {
303
- return {
304
- error: props.error,
305
- [props.cssClass]: true,
306
- [sizeCls.value]: props.size !== ""
307
- };
308
- });
309
- const showPreviewIcon = computed(() => inputType.value === "password");
310
- watch(() => props.showPassword, (flg) => {
311
- inputType.value = flg ? "password" : "text";
312
- }, {
313
- immediate: true
314
- });
315
- watch(() => props.value, (value) => {
316
- value && value.length > 0 && showPreviewIcon.value ? showPwdIcon.value = true : showPwdIcon.value = false;
317
- });
318
- const onInput = ($event) => {
319
- ctx.emit("update:value", $event.target.value);
320
- formItem.formItemMitt.emit(dFormItemEvents.input);
321
- }, onFocus = () => {
322
- ctx.emit("focus");
323
- }, onBlur = () => {
324
- ctx.emit("blur");
325
- formItem.formItemMitt.emit(dFormItemEvents.blur);
326
- }, onChange = ($event) => {
327
- ctx.emit("change", $event.target.value);
328
- formItem.formItemMitt.emit(dFormItemEvents.change);
329
- }, onKeydown = ($event) => {
330
- ctx.emit("keydown", $event);
331
- }, onChangeInputType = () => {
332
- inputType.value = inputType.value === "password" ? "text" : "password";
333
- };
334
- return {
335
- inputCls,
336
- inputType,
337
- showPreviewIcon,
338
- showPwdIcon,
339
- onInput,
340
- onFocus,
341
- onBlur,
342
- onChange,
343
- onKeydown,
344
- onChangeInputType
345
- };
346
- },
347
- render() {
348
- const {
349
- value,
350
- showPreviewIcon,
351
- showPwdIcon,
352
- inputCls,
353
- inputType,
354
- maxLength,
355
- autoFocus,
356
- placeholder,
357
- disabled,
358
- onInput,
359
- onFocus,
360
- onBlur,
361
- onChange,
362
- onKeydown,
363
- onChangeInputType
364
- } = this;
365
- return createVNode("div", {
366
- "class": "devui-input__wrap"
367
- }, [withDirectives(createVNode("input", mergeProps({
368
- dinput: true
369
- }, {
370
- "value": value,
371
- "disabled": disabled,
372
- "type": inputType,
373
- "maxlength": maxLength,
374
- "placeholder": placeholder,
375
- "class": inputCls,
376
- "onInput": onInput,
377
- "onFocus": onFocus,
378
- "onBlur": onBlur,
379
- "onChange": onChange,
380
- "onKeydown": onKeydown
381
- }), null), [[resolveDirective("focus"), autoFocus]]), showPwdIcon && createVNode("div", {
382
- "class": "devui-input__preview",
383
- "onClick": onChangeInputType
384
- }, [showPreviewIcon ? createVNode(resolveComponent("d-icon"), {
385
- "name": "preview",
386
- "size": "12px",
387
- "key": 1
388
- }, null) : createVNode(resolveComponent("d-icon"), {
389
- "name": "preview-forbidden",
390
- "size": "12px",
391
- "key": 2
392
- }, null)])]);
393
- }
394
- });
395
- Input.install = function(app) {
396
- app.component(Input.name, Input);
397
- };
398
- var Icon = defineComponent({
399
- name: "DIcon",
400
- props: {
401
- name: {
402
- type: String,
403
- required: true
404
- },
405
- size: {
406
- type: String,
407
- default: "inherit"
408
- },
409
- color: {
410
- type: String,
411
- default: "inherit"
412
- },
413
- classPrefix: {
414
- type: String,
415
- default: "icon"
416
- }
417
- },
418
- setup(props) {
419
- return __spreadValues({}, props);
420
- },
421
- render() {
422
- const {
423
- name,
424
- size,
425
- color,
426
- classPrefix
427
- } = this;
428
- return createVNode(Fragment, null, [/^((https?):)?\/\//.test(name) ? createVNode("img", {
429
- "src": name,
430
- "alt": name.split("/")[name.split("/").length - 1],
431
- "style": {
432
- width: size
433
- }
434
- }, null) : createVNode("i", {
435
- "class": `${classPrefix} ${classPrefix}-${name}`,
436
- "style": {
437
- fontSize: size,
438
- color
439
- }
440
- }, null)]);
441
- }
442
- });
443
- Icon.install = function(app) {
444
- app.component(Icon.name, Icon);
445
- };
446
- const handleCalendarSwitchState = (state, index2, pos, date) => {
447
- switch (index2) {
448
- case 0:
449
- const preYear = new Date(date);
450
- preYear.setFullYear(preYear.getFullYear() - 1);
451
- pos === 0 ? state.current = preYear : state.next = preYear;
452
- break;
453
- case 1:
454
- const preMonth = new Date(date);
455
- preMonth.setMonth(preMonth.getMonth() - 1);
456
- pos === 0 ? state.current = preMonth : state.next = preMonth;
457
- break;
458
- case 2:
459
- const nextMonth = new Date(date);
460
- nextMonth.setMonth(nextMonth.getMonth() + 1);
461
- pos === 0 ? state.current = nextMonth : state.next = nextMonth;
462
- break;
463
- case 3:
464
- const nextYear = new Date(date);
465
- nextYear.setFullYear(nextYear.getFullYear() + 1);
466
- pos === 0 ? state.current = nextYear : state.next = nextYear;
467
- break;
468
- }
469
- };
470
- const formatValue = (state, props) => {
471
- const { format = "y/MM/dd", range, rangeSpliter = "-" } = props || {};
472
- if (range) {
473
- if (!state.start) {
474
- return "";
475
- } else if (!state.end) {
476
- return formatDate(format, state.start);
477
- }
478
- if (state.end < state.start) {
479
- const end = state.end;
480
- state.end = state.start;
481
- state.start = end;
482
- }
483
- return formatRange$1(format, state.start, state.end, rangeSpliter);
484
- } else {
485
- if (!state.start) {
486
- return "";
487
- }
488
- return formatDate(format, state.start);
489
- }
490
- };
491
- const formatPlaceholder = (props) => {
492
- if (!props)
493
- return "";
494
- const format = props.format || `y/MM/dd`;
495
- const sp = props.rangeSpliter || "-";
496
- return props.range ? `${format} ${sp} ${format}` : format;
497
- };
498
- const getDateKey = (date) => {
499
- return date.toDateString();
500
- };
501
- const cellClassName = (props, day, base = "cell") => {
502
- if (!betweenDate(day.date, props.dateMin, props.dateMax)) {
503
- return `${base} disabled`;
504
- } else if (day.current !== 0) {
505
- return `${base} not-current`;
506
- }
507
- const key = getDateKey(day.date);
508
- if (props.type === "range") {
509
- if (props.dateStart) {
510
- if (getDateKey(props.dateStart) === key) {
511
- return `${base} selected`;
512
- }
513
- if (props.dateEnd && getDateKey(props.dateEnd) === key) {
514
- return `${base} selected`;
515
- }
516
- const innerEnd = props.dateEnd || props.dateHover;
517
- if (innerEnd) {
518
- const range = innerEnd > props.dateStart ? [props.dateStart, innerEnd] : [innerEnd, props.dateStart];
519
- if (day.date > range[0] && day.date < range[1]) {
520
- return `${base} innerday`;
521
- }
522
- }
523
- }
524
- return base;
525
- } else {
526
- return props.dateStart && getDateKey(props.dateStart) === key ? `${base} selected` : base;
527
- }
528
- };
529
- const trigEvent = (props, day) => {
530
- if (!betweenDate(day.date, props.dateMin, props.dateMax)) {
531
- return;
532
- }
533
- if (props.type === "range") {
534
- if (!props.dateStart) {
535
- invokeCallback(props.onSelectStart, day.date);
536
- } else if (!props.dateEnd) {
537
- if (subDateDay(props.dateStart, day.date) !== 0) {
538
- invokeCallback(props.onSelectEnd, day.date);
539
- typeof props.onChange === "function" && props.onChange(props.type, props);
540
- }
541
- } else {
542
- invokeCallback(props.onReset, day.date);
543
- }
544
- } else {
545
- invokeCallback(props.onSelected, day.date);
546
- typeof props.onChange === "function" && props.onChange(props.type, props);
547
- }
548
- };
549
- const handleDateEnter = (props, day) => {
550
- if (day.current !== 0) {
551
- return;
552
- }
553
- const { dateMin, dateMax } = props;
554
- if (dateMin && subDateDay(day.date, dateMin) < 0) {
555
- return;
556
- }
557
- if (dateMax && subDateDay(dateMax, day.date) < 0) {
558
- return;
559
- }
560
- if (props.type === "range") {
561
- const key = getDateKey(day.date);
562
- if (!props.dateStart || getDateKey(props.dateStart) === key || props.dateEnd) {
563
- return;
564
- }
565
- invokeCallback(props.onSelecting, day.date);
566
- }
567
- };
568
- const Year = (props) => {
569
- const {
570
- color = "#585d6b",
571
- rotate = 0
572
- } = props;
573
- return createVNode("svg", {
574
- "style": {
575
- transform: `rotate(${rotate}deg)`
576
- },
577
- "width": "10px",
578
- "height": "10px",
579
- "viewBox": "0 0 10 10",
580
- "version": "1.1",
581
- "xmlns": "http://www.w3.org/2000/svg"
582
- }, [createVNode("g", {
583
- "fill": color,
584
- "transform": "translate(-1.000000, -1.000000)"
585
- }, [createVNode("path", {
586
- "d": "M11,1.83333333 L11,10.1666667 L7,7.38833333 L7,10.1666667 L1,6 L7,1.83333333 L7,4.61033333 L11,1.83333333 Z"
587
- }, null)])]);
588
- };
589
- const Month = (props) => {
590
- const {
591
- color = "#585d6b",
592
- rotate = 0
593
- } = props;
594
- return createVNode("svg", {
595
- "style": {
596
- transform: `rotate(${rotate}deg)`
597
- },
598
- "width": "6px",
599
- "height": "10px",
600
- "viewBox": "0 0 6 10",
601
- "version": "1.1",
602
- "xmlns": "http://www.w3.org/2000/svg"
603
- }, [createVNode("g", {
604
- "fill": color,
605
- "transform": "translate(-3.000000, -1.000000)"
606
- }, [createVNode("polygon", {
607
- "points": "6 3 10.1666667 9 1.83333333 9"
608
- }, null)])]);
609
- };
610
- var index$6 = "";
611
- const Item = (props) => {
612
- const {
613
- button: Btn,
614
- disabled = false,
615
- rotate = 0,
616
- date,
617
- pos,
618
- cb
619
- } = props;
620
- const color = disabled ? "#cfd0d3" : "#585d6b";
621
- const className = `${disabled ? "disabled" : ""}`;
622
- const handleClick = disabled ? void 0 : () => invokeCallback(props.cb, date, pos);
623
- return createVNode("a", {
624
- "class": className,
625
- "onClick": handleClick
626
- }, [createVNode(Btn, {
627
- "color": color,
628
- "rotate": rotate
629
- }, null)]);
630
- };
631
- const Title = (props) => {
632
- const {
633
- date
634
- } = props;
635
- return createVNode("a", {
636
- "class": "title"
637
- }, [`${date.getFullYear()}\u5E74${(date.getMonth() + 1 + "").padStart(2, "0")}\u6708`]);
638
- };
639
- const CalendarToolbar = (props) => {
640
- const {
641
- type,
642
- current,
643
- compare,
644
- pos,
645
- dateMax,
646
- dateMin,
647
- onPreviousYear,
648
- onPreviousMonth,
649
- onNextMonth,
650
- onNextYear
651
- } = props;
652
- const dis = [false, false, false, false];
653
- if (type === "range") {
654
- if (pos === 1) {
655
- dis[0] = !compareDate(compare, current, "year", 1);
656
- dis[1] = !compareDate(compare, current, "month", 1);
657
- dis[2] = !compareDate(current, dateMax, "month", 0);
658
- dis[3] = !compareDate(current, dateMax, "year", 0);
659
- } else {
660
- dis[0] = !compareDate(dateMin, current, "year", 0);
661
- dis[1] = !compareDate(dateMin, current, "month", 0);
662
- dis[2] = !compareDate(current, compare, "month", 1);
663
- dis[3] = !compareDate(current, compare, "year", 1);
664
- }
665
- } else {
666
- dis[0] = !compareDate(dateMin, current, "year", 0);
667
- dis[1] = !compareDate(dateMin, current, "month", 0);
668
- dis[2] = !compareDate(current, dateMax, "month", 0);
669
- dis[3] = !compareDate(current, dateMax, "year", 0);
670
- }
671
- return createVNode("div", {
672
- "class": "devui-calendar-toolbar"
673
- }, [createVNode(Item, {
674
- "disabled": dis[0],
675
- "date": current,
676
- "pos": pos,
677
- "button": Year,
678
- "cb": onPreviousYear
679
- }, null), createVNode(Item, {
680
- "disabled": dis[1],
681
- "date": current,
682
- "pos": pos,
683
- "button": Month,
684
- "rotate": -90,
685
- "cb": onPreviousMonth
686
- }, null), createVNode(Title, {
687
- "date": current
688
- }, null), createVNode(Item, {
689
- "disabled": dis[2],
690
- "date": current,
691
- "pos": pos,
692
- "button": Month,
693
- "rotate": 90,
694
- "cb": onNextMonth
695
- }, null), createVNode(Item, {
696
- "disabled": dis[3],
697
- "date": current,
698
- "pos": pos,
699
- "button": Year,
700
- "rotate": 180,
701
- "cb": onNextYear
702
- }, null)]);
703
- };
704
- const TodayDefault = (props) => {
705
- const {
706
- onSelected = () => 0,
707
- disabled = false
708
- } = props;
709
- return createVNode("div", {
710
- "class": `today-container ${disabled ? "disabled" : ""}`
711
- }, [createVNode("button", {
712
- "class": "today-button",
713
- "disabled": disabled,
714
- "onClick": disabled ? void 0 : () => onSelected(new Date())
715
- }, [createTextVNode("\u4ECA\u5929")])]);
716
- };
717
- var index$5 = "";
718
- const CalendarDatePanel = (props) => {
719
- const today = new Date();
720
- return createVNode("div", {
721
- "class": "devui-calendar-panel"
722
- }, [createVNode(CalendarToolbar, {
723
- "current": props.current,
724
- "compare": props.compare,
725
- "pos": props.pos,
726
- "type": props.type,
727
- "showTime": props.showTime,
728
- "onPreviousYear": props.onPreviousYear,
729
- "onPreviousMonth": props.onPreviousMonth,
730
- "onNextMonth": props.onNextMonth,
731
- "onNextYear": props.onNextYear,
732
- "dateMax": props.dateMax,
733
- "dateMin": props.dateMin
734
- }, null), createVNode("ol", {
735
- "class": "head row"
736
- }, [WEEK_DAYS.map((day) => createVNode("li", {
737
- "class": "cell"
738
- }, [day]))]), createVNode("ul", {
739
- "class": "body"
740
- }, [getMonthWeeklyDays(props.current).map((row) => createVNode("li", {
741
- "class": "row"
742
- }, [row.map((day) => {
743
- return createVNode("span", {
744
- "class": cellClassName(props, day),
745
- "onClick": () => trigEvent(props, day),
746
- "onMouseenter": () => handleDateEnter(props, day)
747
- }, [day.date.getDate()]);
748
- })]))]), props.type !== "range" ? createVNode(TodayDefault, {
749
- "disabled": !betweenDate(today, props.dateMin, props.dateMax),
750
- "onSelected": (today2) => {
751
- typeof props.onToday === "function" && props.onToday(today2, 0);
752
- }
753
- }, null) : null]);
754
- };
755
- var index$4 = "";
756
- const VerticalSlider = defineComponent({
757
- props: {
758
- size: {
759
- type: Number,
760
- default: 26
761
- },
762
- items: {
763
- type: Array
764
- },
765
- selectedIndex: {
766
- type: Number
767
- },
768
- className: {
769
- type: String
770
- },
771
- itemClassNormal: {
772
- type: String
773
- },
774
- itemClassSelected: {
775
- type: String
776
- },
777
- onChange: {
778
- type: Function
779
- }
780
- },
781
- setup(props) {
782
- const {
783
- items = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
784
- selectedIndex = 0,
785
- size = 26,
786
- className = "",
787
- itemClassNormal = "",
788
- itemClassSelected = "selected",
789
- onChange
790
- } = props || {};
791
- let max_y = 0, min_y = 0;
792
- const container = ref();
793
- const movbar = ref();
794
- let pos_start = null;
795
- let pos_cache = null;
796
- const state = reactive({
797
- selectedIndex,
798
- barOpacity: 0,
799
- x: 0,
800
- y: 0,
801
- transition: "none"
802
- });
803
- const handleMouseDown = (e) => {
804
- e.stopPropagation();
805
- e.preventDefault();
806
- pos_start = [e.clientX, e.clientY];
807
- state.transition = "none";
808
- };
809
- const handleMouseMove = (e) => {
810
- e.stopPropagation();
811
- e.preventDefault();
812
- if (!pos_start || !pos_cache) {
813
- return;
814
- }
815
- state.x = pos_cache[0] + e.clientX - pos_start[0];
816
- state.y = Math.min(max_y, Math.max(min_y, pos_cache[1] + e.clientY - pos_start[1]));
817
- state.selectedIndex = (max_y - state.y + size / 2) / size >> 0;
818
- };
819
- const handleMouseUp = (e) => {
820
- e.stopPropagation();
821
- e.preventDefault();
822
- pos_start = null;
823
- state.y = max_y - state.selectedIndex * size;
824
- state.transition = "transform 0.1s";
825
- pos_cache[0] = state.x;
826
- pos_cache[1] = state.y;
827
- if (typeof onChange === "function") {
828
- const idx = state.selectedIndex;
829
- const val = items[idx];
830
- onChange(val, idx);
831
- }
832
- };
833
- onMounted(() => {
834
- const {
835
- height: ch
836
- } = container.value.getBoundingClientRect();
837
- const {
838
- height: mh
839
- } = movbar.value.getBoundingClientRect();
840
- max_y = (ch - size) / 2;
841
- min_y = (ch + size) / 2 - mh;
842
- pos_cache = [0, max_y - state.selectedIndex * size];
843
- state.x = pos_cache[0];
844
- state.y = pos_cache[1];
845
- state.barOpacity = 1;
846
- state.transition = "transform 0.1s";
847
- });
848
- return () => {
849
- return createVNode("div", {
850
- "ref": container,
851
- "class": `devui-vertical-slider ${className}`
852
- }, [createVNode("div", {
853
- "ref": movbar,
854
- "class": "movable-bar",
855
- "style": {
856
- opacity: state.barOpacity,
857
- transform: `translateY(${state.y}px)`,
858
- transition: state.transition
859
- }
860
- }, [items.map((c, i) => {
861
- const className2 = i === state.selectedIndex ? itemClassSelected : itemClassNormal;
862
- return createVNode("span", {
863
- "class": `slider-item ${className2}`,
864
- "style": {
865
- height: `${size}px`,
866
- lineHeight: `${size}px`
867
- }
868
- }, [c]);
869
- })]), createVNode("div", {
870
- "class": "slider-mask",
871
- "onMousedown": handleMouseDown,
872
- "onMousemove": handleMouseMove,
873
- "onMouseup": handleMouseUp,
874
- "onMouseout": handleMouseUp
875
- }, null)]);
876
- };
877
- }
878
- });
879
- var index$3 = "";
880
- const TimePicker = defineComponent({
881
- props: {
882
- time: {
883
- type: Date
884
- }
885
- },
886
- setup(props) {
887
- const {
888
- time = new Date()
889
- } = props || {};
890
- const state = reactive({
891
- hour: time.getHours(),
892
- minute: time.getMinutes(),
893
- second: time.getSeconds()
894
- });
895
- const hours = Array(24).fill(0).map((_, i) => `${i}`.padStart(2, "0"));
896
- const minutes = Array(60).fill(0).map((_, i) => `${i}`.padStart(2, "0"));
897
- return () => {
898
- return createVNode("div", {
899
- "class": "devui-calendar-timepicker"
900
- }, [createVNode("div", {
901
- "class": "head"
902
- }, [createVNode("div", {
903
- "class": "chars"
904
- }, [createVNode("span", null, [state.hour.toString().padStart(2, "0"), createTextVNode(":"), state.minute.toString().padStart(2, "0"), createTextVNode(":"), state.second.toString().padStart(2, "0")])])]), createVNode("div", {
905
- "class": "select"
906
- }, [createVNode(VerticalSlider, {
907
- "items": hours,
908
- "selectedIndex": state.hour,
909
- "onChange": (_, idx) => state.hour = idx
910
- }, null), createVNode(VerticalSlider, {
911
- "items": minutes,
912
- "selectedIndex": state.minute,
913
- "onChange": (_, idx) => state.minute = idx
914
- }, null), createVNode(VerticalSlider, {
915
- "items": minutes,
916
- "selectedIndex": state.second,
917
- "onChange": (_, idx) => state.second = idx
918
- }, null)])]);
919
- };
920
- }
921
- });
922
- var index$2 = "";
923
- const Calendar = (props) => {
924
- const {
925
- showTime = false
926
- } = props;
927
- let {
928
- current
929
- } = props;
930
- if (!(current instanceof Date)) {
931
- current = new Date();
932
- }
933
- if (props.type === "range") {
934
- let {
935
- next
936
- } = props;
937
- if (!(next instanceof Date)) {
938
- next = new Date(current.getFullYear(), current.getMonth() + 1, 1);
939
- }
940
- return createVNode("div", {
941
- "class": "devui-calendar-container"
942
- }, [createVNode(CalendarDatePanel, mergeProps(props, {
943
- "pos": 0,
944
- "current": current,
945
- "compare": next
946
- }), null), showTime ? createVNode(TimePicker, {
947
- "time": current
948
- }, null) : null, createVNode(CalendarDatePanel, mergeProps(props, {
949
- "pos": 1,
950
- "current": next,
951
- "compare": current
952
- }), null), showTime ? createVNode(TimePicker, {
953
- "time": next
954
- }, null) : null]);
955
- } else {
956
- return createVNode("div", {
957
- "class": "devui-calendar-container"
958
- }, [createVNode(CalendarDatePanel, mergeProps(props, {
959
- "pos": 0,
960
- "current": current
961
- }), null), showTime ? createVNode(TimePicker, {
962
- "time": current
963
- }, null) : null]);
964
- }
965
- };
966
- var datePicker = "";
967
- const formatRange = (state) => {
968
- const [start, end] = [state.start, state.end].sort((a, b) => a.getTime() - b.getTime());
969
- state.start = start;
970
- state.end = end;
971
- if (compareDateSort(start, end, "m") !== 0) {
972
- state.current = start;
973
- state.next = end;
974
- } else {
975
- if (compareDateSort(start, state.current) < 0) {
976
- state.current = start;
977
- }
978
- if (compareDateSort(state.next, end) < 0) {
979
- state.next = end;
980
- }
981
- }
982
- };
983
- var DatePicker = defineComponent({
984
- name: "DDatepicker",
985
- props: {
986
- selectedDateChange: {
987
- type: Function
988
- },
989
- autoClose: {
990
- type: Boolean,
991
- default: false
992
- },
993
- range: {
994
- type: Boolean,
995
- default: false
996
- },
997
- showTime: {
998
- type: Boolean,
999
- default: false
1000
- },
1001
- format: {
1002
- type: String,
1003
- default: "y/MM/dd"
1004
- },
1005
- rangeSpliter: {
1006
- type: String,
1007
- default: "-"
1008
- },
1009
- attachInputDom: {
1010
- type: String
1011
- },
1012
- dateMin: {
1013
- type: String
1014
- },
1015
- dateMax: {
1016
- type: String
1017
- }
1018
- },
1019
- setup(props, ctx) {
1020
- const panel = ref(null);
1021
- const input2 = ref(null);
1022
- const current = parseDate(props.dateMin) || new Date();
1023
- const next = new Date(current.getFullYear(), current.getMonth() + 1, 1);
1024
- const state = reactive({
1025
- show: false,
1026
- value: "",
1027
- placeholder: formatPlaceholder(props),
1028
- current,
1029
- next
1030
- });
1031
- state.value = formatValue(state, props);
1032
- state.placeholder = formatPlaceholder(props);
1033
- const documentClick = (e) => {
1034
- e.stopPropagation();
1035
- if (isIn(e.target, panel.value) || isIn(e.target, input2.value)) {
1036
- return;
1037
- }
1038
- state.show = false;
1039
- };
1040
- onMounted(() => {
1041
- document.addEventListener("click", documentClick);
1042
- });
1043
- onUnmounted(() => {
1044
- document.removeEventListener("click", documentClick);
1045
- });
1046
- return () => {
1047
- return createVNode("div", {
1048
- "class": "devui-datepicker-container"
1049
- }, [createVNode("div", {
1050
- "class": "input-container",
1051
- "ref": input2
1052
- }, [createVNode(Input, {
1053
- "ref": input2,
1054
- "class": "datepicker-input",
1055
- "value": state.value,
1056
- "placeholder": state.placeholder,
1057
- "onFocus": () => state.show = true
1058
- }, null), createVNode(Icon, {
1059
- "size": "small",
1060
- "name": "calendar",
1061
- "class": "datepicker-input-icon"
1062
- }, null)]), createVNode("div", {
1063
- "class": "devui-datepicker-panel",
1064
- "ref": panel
1065
- }, [state.show ? createVNode(Calendar, {
1066
- "type": props.range ? "range" : "select",
1067
- "showTime": props.showTime,
1068
- "current": state.current,
1069
- "next": state.next,
1070
- "dateMin": parseDate(props.dateMin),
1071
- "dateMax": parseDate(props.dateMax),
1072
- "dateStart": state.start,
1073
- "dateEnd": state.end,
1074
- "dateHover": state.hover,
1075
- "onReset": (date) => {
1076
- state.end = state.hover = void 0;
1077
- state.start = date;
1078
- },
1079
- "onChange": (type, config) => {
1080
- state.value = formatValue(state, props);
1081
- state.placeholder = formatPlaceholder(props);
1082
- invokeFunction(props.selectedDateChange, state.value);
1083
- if (props.autoClose) {
1084
- state.show = false;
1085
- }
1086
- },
1087
- "onToday": (date) => {
1088
- state.current = date;
1089
- state.start = date;
1090
- state.value = formatValue(state, props);
1091
- state.placeholder = formatPlaceholder(props);
1092
- invokeFunction(props.selectedDateChange, state.value);
1093
- if (props.autoClose) {
1094
- state.show = false;
1095
- }
1096
- },
1097
- "onSelected": (date) => {
1098
- state.start = date;
1099
- if (compareDateSort(state.current, date) !== 0) {
1100
- state.current = date;
1101
- }
1102
- },
1103
- "onSelectStart": (date) => state.start = date,
1104
- "onSelectEnd": (date) => {
1105
- state.end = date;
1106
- formatRange(state);
1107
- },
1108
- "onSelecting": (date) => state.hover = date,
1109
- "onPreviousYear": (date, pos) => handleCalendarSwitchState(state, 0, pos, date),
1110
- "onPreviousMonth": (date, pos) => handleCalendarSwitchState(state, 1, pos, date),
1111
- "onNextMonth": (date, pos) => handleCalendarSwitchState(state, 2, pos, date),
1112
- "onNextYear": (date, pos) => handleCalendarSwitchState(state, 3, pos, date)
1113
- }, null) : null])]);
1114
- };
1115
- }
1116
- });
1117
- var index$1 = "";
1118
- const StickSlider = defineComponent({
1119
- name: "DStickSlider",
1120
- props: {},
1121
- setup(props) {
1122
- const state = reactive({
1123
- showButtons: false,
1124
- selectedIndex: 0
1125
- });
1126
- const reset = () => {
1127
- state.showButtons = false;
1128
- };
1129
- const handleMainButtonMouseDown = (e) => {
1130
- e.stopPropagation();
1131
- state.showButtons = true;
1132
- };
1133
- const handleMainButtonMouseUp = (e) => {
1134
- e.stopPropagation();
1135
- reset();
1136
- };
1137
- return () => {
1138
- return createVNode("div", {
1139
- "class": "devui-stick-slider",
1140
- "onMousedown": handleMainButtonMouseDown,
1141
- "onMouseup": handleMainButtonMouseUp,
1142
- "onMouseleave": handleMainButtonMouseUp
1143
- }, [createVNode("div", {
1144
- "class": "sub-buttons",
1145
- "style": {
1146
- display: state.showButtons ? "" : "none"
1147
- }
1148
- }, [Array(16).fill(null).map((_, i) => {
1149
- return createVNode("div", {
1150
- "class": `button ${i === state.selectedIndex ? "selected" : ""}`,
1151
- "onMouseenter": () => state.selectedIndex = i
1152
- }, [i]);
1153
- })]), createVNode("div", {
1154
- "class": "main-button"
1155
- }, null)]);
1156
- };
1157
- }
1158
- });
1159
- DatePicker.install = function(app) {
1160
- app.component(DatePicker.name, DatePicker);
1161
- app.component(StickSlider.name, StickSlider);
1162
- };
1163
- var index = {
1164
- title: "DatePicker \u65E5\u671F\u9009\u62E9\u5668",
1165
- category: "\u6570\u636E\u5F55\u5165",
1166
- status: "50%",
1167
- install(app) {
1168
- app.use(DatePicker);
1169
- }
1170
- };
1171
- export { DatePicker, StickSlider, index as default };