vue-devui 1.0.0-beta.18 → 1.0.0-beta.220801

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 (403) hide show
  1. package/README.md +94 -118
  2. package/alert/index.es.js +74 -45
  3. package/alert/index.umd.js +1 -1
  4. package/alert/style.css +1 -1
  5. package/auto-complete/index.es.js +8349 -426
  6. package/auto-complete/index.umd.js +29 -1
  7. package/auto-complete/style.css +1 -1
  8. package/avatar/index.es.js +153 -146
  9. package/avatar/index.umd.js +1 -1
  10. package/avatar/style.css +1 -1
  11. package/badge/index.es.js +45 -20
  12. package/badge/index.umd.js +1 -1
  13. package/badge/style.css +1 -1
  14. package/button/index.es.js +5743 -127
  15. package/button/index.umd.js +27 -1
  16. package/button/style.css +1 -1
  17. package/card/index.es.js +63 -35
  18. package/card/index.umd.js +1 -1
  19. package/card/style.css +1 -1
  20. package/checkbox/index.es.js +8070 -255
  21. package/checkbox/index.umd.js +27 -1
  22. package/checkbox/style.css +1 -1
  23. package/{accordion → collapse}/index.d.ts +0 -0
  24. package/collapse/index.es.js +213 -0
  25. package/collapse/index.umd.js +1 -0
  26. package/{back-top → collapse}/package.json +1 -1
  27. package/collapse/style.css +1 -0
  28. package/countdown/index.es.js +60 -19
  29. package/countdown/index.umd.js +1 -1
  30. package/{anchor → date-picker-pro}/index.d.ts +0 -0
  31. package/date-picker-pro/index.es.js +12018 -0
  32. package/date-picker-pro/index.umd.js +27 -0
  33. package/date-picker-pro/package.json +7 -0
  34. package/date-picker-pro/style.css +1 -0
  35. package/drawer/index.es.js +184 -5736
  36. package/drawer/index.umd.js +1 -27
  37. package/drawer/style.css +1 -1
  38. package/dropdown/index.es.js +615 -396
  39. package/dropdown/index.umd.js +1 -1
  40. package/dropdown/style.css +1 -1
  41. package/editable-select/index.es.js +786 -195
  42. package/editable-select/index.umd.js +1 -1
  43. package/editable-select/style.css +1 -1
  44. package/form/index.es.js +2360 -2094
  45. package/form/index.umd.js +17 -17
  46. package/form/style.css +1 -1
  47. package/fullscreen/index.es.js +137 -134
  48. package/fullscreen/index.umd.js +1 -1
  49. package/fullscreen/style.css +1 -1
  50. package/grid/index.es.js +101 -86
  51. package/grid/index.umd.js +1 -1
  52. package/grid/style.css +1 -1
  53. package/icon/index.es.js +199 -56
  54. package/icon/index.umd.js +1 -1
  55. package/icon/style.css +1 -0
  56. package/image-preview/index.es.js +55 -31
  57. package/image-preview/index.umd.js +1 -1
  58. package/image-preview/style.css +1 -1
  59. package/input/index.es.js +8254 -144
  60. package/input/index.umd.js +27 -1
  61. package/input/style.css +1 -1
  62. package/input-number/index.es.js +270 -187
  63. package/input-number/index.umd.js +1 -1
  64. package/input-number/style.css +1 -1
  65. package/layout/index.es.js +40 -25
  66. package/layout/index.umd.js +1 -1
  67. package/layout/style.css +1 -1
  68. package/loading/index.es.js +74 -35
  69. package/loading/index.umd.js +1 -1
  70. package/loading/style.css +1 -1
  71. package/{back-top → mention}/index.d.ts +0 -0
  72. package/{color-picker → mention}/index.es.js +2983 -2861
  73. package/mention/index.umd.js +36 -0
  74. package/{anchor → mention}/package.json +1 -1
  75. package/mention/style.css +1 -0
  76. package/{breadcrumb → menu}/index.d.ts +0 -0
  77. package/menu/index.es.js +870 -0
  78. package/menu/index.umd.js +1 -0
  79. package/{toast → menu}/package.json +1 -1
  80. package/menu/style.css +1 -0
  81. package/{carousel → message}/index.d.ts +0 -0
  82. package/message/index.es.js +538 -0
  83. package/message/index.umd.js +1 -0
  84. package/{comment → message}/package.json +1 -1
  85. package/message/style.css +1 -0
  86. package/modal/index.es.js +598 -1025
  87. package/modal/index.umd.js +1 -1
  88. package/modal/style.css +1 -1
  89. package/{cascader → notification}/index.d.ts +0 -0
  90. package/notification/index.es.js +545 -0
  91. package/notification/index.umd.js +1 -0
  92. package/{accordion → notification}/package.json +1 -1
  93. package/notification/style.css +1 -0
  94. package/nuxt/components/ButtonGroup.js +3 -0
  95. package/nuxt/components/CheckboxButton.js +3 -0
  96. package/nuxt/components/CheckboxGroup.js +3 -0
  97. package/nuxt/components/Collapse.js +3 -0
  98. package/nuxt/components/CollapseItem.js +3 -0
  99. package/nuxt/components/DRangeDatePickerPro.js +3 -0
  100. package/nuxt/components/DatePickerPro.js +3 -0
  101. package/nuxt/components/DropdownMenu.js +3 -0
  102. package/nuxt/components/DropdownPropsKey.js +3 -0
  103. package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
  104. package/nuxt/components/FORM_TOKEN.js +3 -0
  105. package/nuxt/components/IFileOptions.js +3 -0
  106. package/nuxt/components/IUploadOptions.js +3 -0
  107. package/nuxt/components/Icon.js +1 -0
  108. package/nuxt/components/IconGroup.js +3 -0
  109. package/nuxt/components/LABEL_DATA.js +3 -0
  110. package/nuxt/components/LoadingOptions.js +3 -0
  111. package/nuxt/components/Mention.js +3 -0
  112. package/nuxt/components/Menu.js +3 -0
  113. package/nuxt/components/MenuItem.js +3 -0
  114. package/nuxt/components/Message.js +3 -0
  115. package/nuxt/components/Notification.js +3 -0
  116. package/nuxt/components/NotificationService.js +3 -0
  117. package/nuxt/components/Option.js +3 -0
  118. package/nuxt/components/OptionGroup.js +3 -0
  119. package/nuxt/components/PanelBody.js +3 -0
  120. package/nuxt/components/PanelFooter.js +3 -0
  121. package/nuxt/components/PanelHeader.js +3 -0
  122. package/nuxt/components/RadioButton.js +3 -0
  123. package/nuxt/components/Step.js +3 -0
  124. package/nuxt/components/Steps.js +3 -0
  125. package/nuxt/components/SubMenu.js +3 -0
  126. package/nuxt/components/TABLE_TOKEN.js +3 -0
  127. package/nuxt/components/Tab.js +3 -0
  128. package/nuxt/components/TimeSelect.js +3 -0
  129. package/nuxt/components/Timeline.js +3 -0
  130. package/nuxt/components/TimelineItem.js +3 -0
  131. package/nuxt/components/UploadStatus.js +3 -0
  132. package/nuxt/components/alertProps.js +3 -0
  133. package/nuxt/components/animationInjectionKey.js +3 -0
  134. package/nuxt/components/autoCompleteProps.js +3 -0
  135. package/nuxt/components/avatarProps.js +3 -0
  136. package/nuxt/components/badgeProps.js +3 -0
  137. package/nuxt/components/buttonGroupInjectionKey.js +3 -0
  138. package/nuxt/components/buttonGroupProps.js +3 -0
  139. package/nuxt/components/cardProps.js +3 -0
  140. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  141. package/nuxt/components/checkboxGroupProps.js +3 -0
  142. package/nuxt/components/checkboxProps.js +3 -0
  143. package/nuxt/components/colProps.js +3 -0
  144. package/nuxt/components/colPropsBaseClass.js +3 -0
  145. package/nuxt/components/colPropsBaseStyle.js +3 -0
  146. package/nuxt/components/collapseItemProps.js +3 -0
  147. package/nuxt/components/collapseProps.js +3 -0
  148. package/nuxt/components/countdownProps.js +3 -0
  149. package/nuxt/components/datePickerProCommonProps.js +3 -0
  150. package/nuxt/components/datePickerProPanelProps.js +3 -0
  151. package/nuxt/components/datePickerProProps.js +3 -0
  152. package/nuxt/components/dropdownMenuProps.js +3 -0
  153. package/nuxt/components/editableSelectProps.js +3 -0
  154. package/nuxt/components/fixedOverlayProps.js +3 -0
  155. package/nuxt/components/flexibleOverlayProps.js +3 -0
  156. package/nuxt/components/formItemProps.js +3 -0
  157. package/nuxt/components/formProps.js +3 -0
  158. package/nuxt/components/fullscreenProps.js +3 -0
  159. package/nuxt/components/iconProps.js +3 -0
  160. package/nuxt/components/imagePreviewProps.js +3 -0
  161. package/nuxt/components/inputProps.js +3 -0
  162. package/nuxt/components/loadingProps.js +3 -0
  163. package/nuxt/components/mentionProps.js +3 -0
  164. package/nuxt/components/messageProps.js +3 -0
  165. package/nuxt/components/modalProps.js +3 -0
  166. package/nuxt/components/notificationProps.js +3 -0
  167. package/nuxt/components/paginationProps.js +3 -0
  168. package/nuxt/components/panelProps.js +3 -0
  169. package/nuxt/components/popoverProps.js +3 -0
  170. package/nuxt/components/progressProps.js +3 -0
  171. package/nuxt/components/rateProps.js +3 -0
  172. package/nuxt/components/resultProps.js +3 -0
  173. package/nuxt/components/roundInjectionKey.js +3 -0
  174. package/nuxt/components/rowProps.js +3 -0
  175. package/nuxt/components/screenSizes.js +3 -0
  176. package/nuxt/components/searchProps.js +3 -0
  177. package/nuxt/components/skeletonItemProps.js +3 -0
  178. package/nuxt/components/skeletonProps.js +3 -0
  179. package/nuxt/components/sliderProps.js +3 -0
  180. package/nuxt/components/splitterProps.js +3 -0
  181. package/nuxt/components/statisticProps.js +3 -0
  182. package/nuxt/components/stepProps.js +3 -0
  183. package/nuxt/components/stepsProps.js +3 -0
  184. package/nuxt/components/svgIconProps.js +3 -0
  185. package/nuxt/components/switchProps.js +3 -0
  186. package/nuxt/components/tableProps.js +3 -0
  187. package/nuxt/components/tabsProps.js +3 -0
  188. package/nuxt/components/tagProps.js +3 -0
  189. package/nuxt/components/textareaProps.js +3 -0
  190. package/nuxt/components/timeAxisProps.js +3 -0
  191. package/nuxt/components/timerPickerPanelProps.js +3 -0
  192. package/nuxt/components/tooltipProps.js +3 -0
  193. package/nuxt/components/treeNodeProps.js +3 -0
  194. package/nuxt/components/treeProps.js +3 -0
  195. package/nuxt/components/uploadProps.js +3 -0
  196. package/overlay/index.es.js +239 -314
  197. package/overlay/index.umd.js +1 -1
  198. package/overlay/style.css +1 -1
  199. package/package.json +44 -87
  200. package/pagination/index.es.js +331 -153
  201. package/pagination/index.umd.js +1 -1
  202. package/pagination/style.css +1 -1
  203. package/panel/index.es.js +45 -32
  204. package/panel/index.umd.js +1 -1
  205. package/panel/style.css +1 -1
  206. package/popover/index.es.js +6034 -215
  207. package/popover/index.umd.js +27 -1
  208. package/popover/style.css +1 -1
  209. package/progress/index.es.js +110 -56
  210. package/progress/index.umd.js +3 -3
  211. package/progress/style.css +1 -1
  212. package/radio/index.es.js +7974 -157
  213. package/radio/index.umd.js +27 -1
  214. package/radio/style.css +1 -1
  215. package/rate/index.es.js +77 -55
  216. package/rate/index.umd.js +1 -1
  217. package/rate/style.css +1 -1
  218. package/result/index.es.js +186 -57
  219. package/result/index.umd.js +1 -1
  220. package/result/style.css +1 -1
  221. package/ripple/index.es.js +47 -42
  222. package/ripple/index.umd.js +1 -1
  223. package/search/index.es.js +3868 -1149
  224. package/search/index.umd.js +18 -18
  225. package/search/style.css +1 -1
  226. package/select/index.es.js +9191 -493
  227. package/select/index.umd.js +27 -1
  228. package/select/style.css +1 -1
  229. package/skeleton/index.es.js +113 -265
  230. package/skeleton/index.umd.js +1 -1
  231. package/skeleton/style.css +1 -1
  232. package/slider/index.es.js +144 -137
  233. package/slider/index.umd.js +1 -1
  234. package/slider/style.css +1 -1
  235. package/splitter/index.es.js +6220 -226
  236. package/splitter/index.umd.js +27 -1
  237. package/splitter/style.css +1 -1
  238. package/statistic/index.es.js +41 -34
  239. package/statistic/index.umd.js +1 -1
  240. package/statistic/style.css +1 -1
  241. package/status/index.es.js +27 -6
  242. package/status/index.umd.js +1 -1
  243. package/status/style.css +1 -1
  244. package/{color-picker → steps}/index.d.ts +0 -0
  245. package/steps/index.es.js +386 -0
  246. package/steps/index.umd.js +1 -0
  247. package/{gantt → steps}/package.json +1 -1
  248. package/steps/style.css +1 -0
  249. package/style.css +1 -1
  250. package/switch/index.es.js +7804 -64
  251. package/switch/index.umd.js +27 -1
  252. package/switch/style.css +1 -1
  253. package/table/index.es.js +11010 -1367
  254. package/table/index.umd.js +27 -1
  255. package/table/style.css +1 -1
  256. package/tabs/index.es.js +356 -144
  257. package/tabs/index.umd.js +1 -1
  258. package/tabs/style.css +1 -1
  259. package/tag/index.es.js +49 -24
  260. package/tag/index.umd.js +1 -1
  261. package/tag/style.css +1 -1
  262. package/textarea/index.es.js +7924 -83
  263. package/textarea/index.umd.js +35 -1
  264. package/textarea/style.css +1 -1
  265. package/time-picker/index.es.js +8914 -602
  266. package/time-picker/index.umd.js +27 -1
  267. package/time-picker/style.css +1 -1
  268. package/{comment → time-select}/index.d.ts +0 -0
  269. package/{transfer → time-select}/index.es.js +4912 -2667
  270. package/time-select/index.umd.js +27 -0
  271. package/{breadcrumb → time-select}/package.json +1 -1
  272. package/time-select/style.css +1 -0
  273. package/{date-picker → timeline}/index.d.ts +0 -0
  274. package/timeline/index.es.js +427 -0
  275. package/timeline/index.umd.js +1 -0
  276. package/{carousel → timeline}/package.json +1 -1
  277. package/timeline/style.css +1 -0
  278. package/tooltip/index.es.js +5871 -96
  279. package/tooltip/index.umd.js +27 -1
  280. package/tooltip/style.css +1 -1
  281. package/tree/index.es.js +7556 -2491
  282. package/tree/index.umd.js +18 -18
  283. package/tree/style.css +1 -1
  284. package/upload/index.es.js +865 -6117
  285. package/upload/index.umd.js +1 -27
  286. package/upload/style.css +1 -1
  287. package/vue-devui.es.js +20283 -18856
  288. package/vue-devui.umd.js +30 -19
  289. package/accordion/index.es.js +0 -508
  290. package/accordion/index.umd.js +0 -1
  291. package/accordion/style.css +0 -1
  292. package/anchor/index.es.js +0 -263
  293. package/anchor/index.umd.js +0 -1
  294. package/anchor/style.css +0 -1
  295. package/back-top/index.es.js +0 -128
  296. package/back-top/index.umd.js +0 -1
  297. package/back-top/style.css +0 -1
  298. package/breadcrumb/index.es.js +0 -127
  299. package/breadcrumb/index.umd.js +0 -1
  300. package/breadcrumb/style.css +0 -1
  301. package/carousel/index.es.js +0 -329
  302. package/carousel/index.umd.js +0 -1
  303. package/carousel/style.css +0 -1
  304. package/cascader/index.es.js +0 -5963
  305. package/cascader/index.umd.js +0 -27
  306. package/cascader/package.json +0 -7
  307. package/cascader/style.css +0 -1
  308. package/color-picker/index.umd.js +0 -27
  309. package/color-picker/package.json +0 -7
  310. package/color-picker/style.css +0 -1
  311. package/comment/index.es.js +0 -86
  312. package/comment/index.umd.js +0 -1
  313. package/comment/style.css +0 -1
  314. package/date-picker/index.es.js +0 -1171
  315. package/date-picker/index.umd.js +0 -1
  316. package/date-picker/package.json +0 -7
  317. package/date-picker/style.css +0 -1
  318. package/dragdrop/index.d.ts +0 -7
  319. package/dragdrop/index.es.js +0 -157
  320. package/dragdrop/index.umd.js +0 -1
  321. package/dragdrop/package.json +0 -7
  322. package/gantt/index.d.ts +0 -7
  323. package/gantt/index.es.js +0 -523
  324. package/gantt/index.umd.js +0 -1
  325. package/gantt/style.css +0 -1
  326. package/input-icon/index.d.ts +0 -7
  327. package/input-icon/index.es.js +0 -331
  328. package/input-icon/index.umd.js +0 -1
  329. package/input-icon/package.json +0 -7
  330. package/input-icon/style.css +0 -1
  331. package/nav-sprite/index.d.ts +0 -7
  332. package/nav-sprite/index.es.js +0 -68
  333. package/nav-sprite/index.umd.js +0 -1
  334. package/nav-sprite/package.json +0 -7
  335. package/nuxt/components/Accordion.js +0 -3
  336. package/nuxt/components/Anchor.js +0 -3
  337. package/nuxt/components/BackTop.js +0 -3
  338. package/nuxt/components/Breadcrumb.js +0 -3
  339. package/nuxt/components/Carousel.js +0 -3
  340. package/nuxt/components/CarouselItem.js +0 -3
  341. package/nuxt/components/Cascader.js +0 -3
  342. package/nuxt/components/ColorPicker.js +0 -3
  343. package/nuxt/components/Comment.js +0 -3
  344. package/nuxt/components/DatePicker.js +0 -3
  345. package/nuxt/components/FormControl.js +0 -3
  346. package/nuxt/components/FormLabel.js +0 -3
  347. package/nuxt/components/Gantt.js +0 -3
  348. package/nuxt/components/InputIcon.js +0 -3
  349. package/nuxt/components/NavSprite.js +0 -2
  350. package/nuxt/components/QuadrantDiagram.js +0 -3
  351. package/nuxt/components/ReadTip.js +0 -3
  352. package/nuxt/components/StepsGuide.js +0 -3
  353. package/nuxt/components/StickSlider.js +0 -3
  354. package/nuxt/components/Sticky.js +0 -2
  355. package/nuxt/components/TagInput.js +0 -3
  356. package/nuxt/components/TimeAxis.js +0 -3
  357. package/nuxt/components/TimeAxisItem.js +0 -3
  358. package/nuxt/components/Toast.js +0 -3
  359. package/nuxt/components/ToastService.js +0 -3
  360. package/nuxt/components/Transfer.js +0 -3
  361. package/nuxt/components/TreeSelect.js +0 -3
  362. package/quadrant-diagram/index.d.ts +0 -7
  363. package/quadrant-diagram/index.es.js +0 -5728
  364. package/quadrant-diagram/index.umd.js +0 -27
  365. package/quadrant-diagram/package.json +0 -7
  366. package/quadrant-diagram/style.css +0 -1
  367. package/read-tip/index.d.ts +0 -7
  368. package/read-tip/index.es.js +0 -258
  369. package/read-tip/index.umd.js +0 -1
  370. package/read-tip/package.json +0 -7
  371. package/read-tip/style.css +0 -1
  372. package/steps-guide/index.d.ts +0 -7
  373. package/steps-guide/index.es.js +0 -239
  374. package/steps-guide/index.umd.js +0 -1
  375. package/steps-guide/package.json +0 -7
  376. package/steps-guide/style.css +0 -1
  377. package/sticky/index.d.ts +0 -7
  378. package/sticky/index.es.js +0 -197
  379. package/sticky/index.umd.js +0 -1
  380. package/sticky/package.json +0 -7
  381. package/tag-input/index.d.ts +0 -7
  382. package/tag-input/index.es.js +0 -329
  383. package/tag-input/index.umd.js +0 -1
  384. package/tag-input/package.json +0 -7
  385. package/tag-input/style.css +0 -1
  386. package/time-axis/index.d.ts +0 -7
  387. package/time-axis/index.es.js +0 -299
  388. package/time-axis/index.umd.js +0 -1
  389. package/time-axis/package.json +0 -7
  390. package/time-axis/style.css +0 -1
  391. package/toast/index.d.ts +0 -7
  392. package/toast/index.es.js +0 -5918
  393. package/toast/index.umd.js +0 -27
  394. package/toast/style.css +0 -1
  395. package/transfer/index.d.ts +0 -7
  396. package/transfer/index.umd.js +0 -27
  397. package/transfer/package.json +0 -7
  398. package/transfer/style.css +0 -1
  399. package/tree-select/index.d.ts +0 -7
  400. package/tree-select/index.es.js +0 -623
  401. package/tree-select/index.umd.js +0 -1
  402. package/tree-select/package.json +0 -7
  403. package/tree-select/style.css +0 -1
@@ -1,329 +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, createVNode, ref, watch, onMounted, onBeforeUnmount, Fragment, Comment } from "vue";
18
- const carouselProps = {
19
- arrowTrigger: {
20
- type: String,
21
- default: "hover"
22
- },
23
- autoplay: {
24
- type: Boolean,
25
- default: false
26
- },
27
- autoplaySpeed: {
28
- type: Number,
29
- default: 3e3
30
- },
31
- height: {
32
- type: String,
33
- default: "100%"
34
- },
35
- showDots: {
36
- type: Boolean,
37
- default: true
38
- },
39
- dotTrigger: {
40
- type: String,
41
- default: "click"
42
- },
43
- dotPosition: {
44
- type: String,
45
- default: "bottom"
46
- },
47
- activeIndex: {
48
- type: Number,
49
- default: 0
50
- },
51
- activeIndexChange: {
52
- type: Function
53
- }
54
- };
55
- var Icon = defineComponent({
56
- name: "DIcon",
57
- props: {
58
- name: {
59
- type: String,
60
- required: true
61
- },
62
- size: {
63
- type: String,
64
- default: "inherit"
65
- },
66
- color: {
67
- type: String,
68
- default: "inherit"
69
- },
70
- classPrefix: {
71
- type: String,
72
- default: "icon"
73
- }
74
- },
75
- setup(props) {
76
- return __spreadValues({}, props);
77
- },
78
- render() {
79
- const {
80
- name,
81
- size,
82
- color,
83
- classPrefix
84
- } = this;
85
- return /^((https?):)?\/\//.test(name) ? createVNode("img", {
86
- "src": name,
87
- "alt": name.split("/")[name.split("/").length - 1],
88
- "style": {
89
- width: size,
90
- verticalAlign: "text-bottom"
91
- }
92
- }, null) : createVNode("i", {
93
- "class": `${classPrefix} ${classPrefix}-${name}`,
94
- "style": {
95
- fontSize: size,
96
- color
97
- }
98
- }, null);
99
- }
100
- });
101
- var carousel = "";
102
- var Carousel = defineComponent({
103
- name: "DCarousel",
104
- props: carouselProps,
105
- emits: ["update:activeIndex"],
106
- setup(props, {
107
- emit
108
- }) {
109
- const {
110
- arrowTrigger,
111
- autoplay,
112
- autoplaySpeed,
113
- dotTrigger,
114
- activeIndex,
115
- activeIndexChange
116
- } = props;
117
- const transitionSpeed = 500;
118
- const itemCount = ref(0);
119
- const showArrow = ref(false);
120
- const currentIndex = ref(0);
121
- const wrapperRef = ref(null);
122
- const containerRef = ref(null);
123
- const scheduledId = ref(null);
124
- watch(() => arrowTrigger, () => {
125
- showArrow.value = arrowTrigger === "always";
126
- }, {
127
- immediate: true
128
- });
129
- watch(() => activeIndex, () => {
130
- currentIndex.value = activeIndex;
131
- }, {
132
- immediate: true
133
- });
134
- const translatePosition = (size) => {
135
- if (containerRef.value)
136
- containerRef.value.style.left = `${-size * 100}%`;
137
- };
138
- const adjustTransition = (targetEl) => {
139
- setTimeout(() => {
140
- if (containerRef.value)
141
- containerRef.value.style.transition = "";
142
- targetEl.style.transform = "";
143
- translatePosition(currentIndex.value);
144
- }, transitionSpeed);
145
- };
146
- const adjustPosition = (targetEl, firstToLast) => {
147
- if (wrapperRef.value) {
148
- const wrapperRect = wrapperRef.value.getBoundingClientRect();
149
- targetEl.style.transform = `translateX(${(firstToLast ? -itemCount.value : itemCount.value) * wrapperRect.width}px)`;
150
- }
151
- };
152
- const goto = (index2) => {
153
- if (index2 === currentIndex.value || !wrapperRef.value || !containerRef.value) {
154
- return;
155
- }
156
- containerRef.value.style.transition = `left ${transitionSpeed}ms ease`;
157
- let latestIndex = currentIndex.value;
158
- if (index2 < 0 && currentIndex.value === 0) {
159
- latestIndex = itemCount.value - 1;
160
- const targetEl = containerRef.value.children[latestIndex];
161
- adjustPosition(targetEl, true);
162
- translatePosition(-1);
163
- adjustTransition(targetEl);
164
- } else if (index2 >= itemCount.value && currentIndex.value === itemCount.value - 1) {
165
- latestIndex = 0;
166
- const targetEl = containerRef.value.children[latestIndex];
167
- adjustPosition(targetEl, false);
168
- translatePosition(itemCount.value);
169
- adjustTransition(targetEl);
170
- } else {
171
- latestIndex = index2 < 0 ? 0 : index2 > itemCount.value - 1 ? itemCount.value - 1 : index2;
172
- translatePosition(latestIndex);
173
- }
174
- currentIndex.value = latestIndex;
175
- emit("update:activeIndex", latestIndex);
176
- activeIndexChange == null ? void 0 : activeIndexChange(latestIndex);
177
- autoScheduleTransition();
178
- };
179
- const prev = () => {
180
- goto(currentIndex.value - 1);
181
- };
182
- const next = () => {
183
- goto(currentIndex.value + 1);
184
- };
185
- const arrowMouseEvent = (type) => {
186
- if (arrowTrigger !== "hover")
187
- return;
188
- showArrow.value = type === "enter";
189
- };
190
- const switchStep = (index2, type) => {
191
- if (type === dotTrigger)
192
- goto(index2);
193
- };
194
- const clearScheduledTransition = () => {
195
- if (scheduledId.value) {
196
- clearTimeout(scheduledId.value);
197
- scheduledId.value = null;
198
- }
199
- };
200
- const autoScheduleTransition = () => {
201
- clearScheduledTransition();
202
- if (autoplay && autoplaySpeed) {
203
- scheduledId.value = setTimeout(() => {
204
- next();
205
- }, autoplaySpeed);
206
- }
207
- };
208
- const changeItemCount = (val) => {
209
- itemCount.value = val;
210
- autoScheduleTransition();
211
- };
212
- onMounted(() => {
213
- if (containerRef.value) {
214
- containerRef.value.style.transition = `left ${transitionSpeed}ms ease`;
215
- containerRef.value.style.left = "0%";
216
- }
217
- autoScheduleTransition();
218
- });
219
- onBeforeUnmount(() => {
220
- clearScheduledTransition();
221
- });
222
- return {
223
- wrapperRef,
224
- containerRef,
225
- showArrow,
226
- currentIndex,
227
- itemCount,
228
- changeItemCount,
229
- goto,
230
- prev,
231
- next,
232
- arrowMouseEvent,
233
- switchStep
234
- };
235
- },
236
- render() {
237
- var _a, _b;
238
- const {
239
- showArrow,
240
- currentIndex,
241
- itemCount,
242
- arrowTrigger,
243
- height,
244
- showDots,
245
- dotPosition,
246
- prev,
247
- next,
248
- arrowMouseEvent,
249
- switchStep,
250
- changeItemCount,
251
- $slots
252
- } = this;
253
- const slot = (_b = (_a = $slots.default) == null ? void 0 : _a.call($slots)) != null ? _b : [];
254
- let children = slot;
255
- if (children.length === 1 && children[0].type === Fragment) {
256
- children = (children[0].children || []).filter((item) => (item == null ? void 0 : item.type) !== Comment);
257
- }
258
- if (children.length !== itemCount) {
259
- changeItemCount(children.length);
260
- }
261
- return createVNode("div", {
262
- "class": "devui-carousel-container",
263
- "style": {
264
- height
265
- },
266
- "onMouseenter": () => arrowMouseEvent("enter"),
267
- "onMouseleave": () => arrowMouseEvent("leave")
268
- }, [arrowTrigger !== "never" && showArrow ? createVNode("div", {
269
- "class": "devui-carousel-arrow"
270
- }, [createVNode("button", {
271
- "class": "arrow-left",
272
- "onClick": () => prev()
273
- }, [createVNode(Icon, {
274
- "name": "arrow-left"
275
- }, null)]), createVNode("button", {
276
- "class": "arrow-right",
277
- "onClick": () => next()
278
- }, [createVNode(Icon, {
279
- "name": "arrow-right"
280
- }, null)])]) : null, createVNode("div", {
281
- "class": "devui-carousel-item-wrapper",
282
- "ref": "wrapperRef"
283
- }, [createVNode("div", {
284
- "class": "devui-carousel-item-container",
285
- "style": {
286
- width: `${itemCount * 100}%`
287
- },
288
- "ref": "containerRef"
289
- }, [slot])]), itemCount > 0 && showDots ? createVNode("ul", {
290
- "class": ["devui-carousel-dots", dotPosition]
291
- }, [children.map((_, index2) => createVNode("li", {
292
- "class": {
293
- "dot-item": true,
294
- active: currentIndex === index2
295
- },
296
- "onClick": () => switchStep(index2, "click"),
297
- "onMouseenter": () => switchStep(index2, "hover")
298
- }, null))]) : null]);
299
- }
300
- });
301
- var CarouselItem = defineComponent({
302
- name: "DCarouselItem",
303
- render() {
304
- var _a;
305
- const {
306
- $slots
307
- } = this;
308
- const children = (_a = $slots.default) == null ? void 0 : _a.call($slots);
309
- return createVNode("div", {
310
- "class": "d-carousel-item "
311
- }, [children]);
312
- }
313
- });
314
- Carousel.install = function(app) {
315
- app.component(Carousel.name, Carousel);
316
- };
317
- CarouselItem.install = function(app) {
318
- app.component(CarouselItem.name, CarouselItem);
319
- };
320
- var index = {
321
- title: "Carousel \u8D70\u9A6C\u706F",
322
- category: "\u6570\u636E\u5C55\u793A",
323
- status: "80%",
324
- install(app) {
325
- app.use(Carousel);
326
- app.use(CarouselItem);
327
- }
328
- };
329
- export { Carousel, CarouselItem, index as default };
@@ -1 +0,0 @@
1
- var F=Object.defineProperty;var R=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var $=(n,e,s)=>e in n?F(n,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[e]=s,k=(n,e)=>{for(var s in e||(e={}))_.call(e,s)&&$(n,s,e[s]);if(R)for(var s of R(e))q.call(e,s)&&$(n,s,e[s]);return n};(function(n,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis!="undefined"?globalThis:n||self,e(n.index={},n.Vue))})(this,function(n,e){"use strict";const s={arrowTrigger:{type:String,default:"hover"},autoplay:{type:Boolean,default:!1},autoplaySpeed:{type:Number,default:3e3},height:{type:String,default:"100%"},showDots:{type:Boolean,default:!0},dotTrigger:{type:String,default:"click"},dotPosition:{type:String,default:"bottom"},activeIndex:{type:Number,default:0},activeIndexChange:{type:Function}};var P=e.defineComponent({name:"DIcon",props:{name:{type:String,required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}},setup(t){return k({},t)},render(){const{name:t,size:d,color:i,classPrefix:g}=this;return/^((https?):)?\/\//.test(t)?e.createVNode("img",{src:t,alt:t.split("/")[t.split("/").length-1],style:{width:d,verticalAlign:"text-bottom"}},null):e.createVNode("i",{class:`${g} ${g}-${t}`,style:{fontSize:d,color:i}},null)}}),O="",w=e.defineComponent({name:"DCarousel",props:s,emits:["update:activeIndex"],setup(t,{emit:d}){const{arrowTrigger:i,autoplay:g,autoplaySpeed:T,dotTrigger:b,activeIndex:V,activeIndexChange:S}=t,I=500,o=e.ref(0),y=e.ref(!1),u=e.ref(0),f=e.ref(null),r=e.ref(null),c=e.ref(null);e.watch(()=>i,()=>{y.value=i==="always"},{immediate:!0}),e.watch(()=>V,()=>{u.value=V},{immediate:!0});const m=a=>{r.value&&(r.value.style.left=`${-a*100}%`)},N=a=>{setTimeout(()=>{r.value&&(r.value.style.transition=""),a.style.transform="",m(u.value)},I)},v=(a,l)=>{if(f.value){const h=f.value.getBoundingClientRect();a.style.transform=`translateX(${(l?-o.value:o.value)*h.width}px)`}},p=a=>{if(a===u.value||!f.value||!r.value)return;r.value.style.transition=`left ${I}ms ease`;let l=u.value;if(a<0&&u.value===0){l=o.value-1;const h=r.value.children[l];v(h,!0),m(-1),N(h)}else if(a>=o.value&&u.value===o.value-1){l=0;const h=r.value.children[l];v(h,!1),m(o.value),N(h)}else l=a<0?0:a>o.value-1?o.value-1:a,m(l);u.value=l,d("update:activeIndex",l),S==null||S(l),M()},E=()=>{p(u.value-1)},x=()=>{p(u.value+1)},j=a=>{i==="hover"&&(y.value=a==="enter")},B=(a,l)=>{l===b&&p(a)},D=()=>{c.value&&(clearTimeout(c.value),c.value=null)},M=()=>{D(),g&&T&&(c.value=setTimeout(()=>{x()},T))},z=a=>{o.value=a,M()};return e.onMounted(()=>{r.value&&(r.value.style.transition=`left ${I}ms ease`,r.value.style.left="0%"),M()}),e.onBeforeUnmount(()=>{D()}),{wrapperRef:f,containerRef:r,showArrow:y,currentIndex:u,itemCount:o,changeItemCount:z,goto:p,prev:E,next:x,arrowMouseEvent:j,switchStep:B}},render(){var m,N;const{showArrow:t,currentIndex:d,itemCount:i,arrowTrigger:g,height:T,showDots:b,dotPosition:V,prev:S,next:I,arrowMouseEvent:o,switchStep:y,changeItemCount:u,$slots:f}=this,r=(N=(m=f.default)==null?void 0:m.call(f))!=null?N:[];let c=r;return c.length===1&&c[0].type===e.Fragment&&(c=(c[0].children||[]).filter(v=>(v==null?void 0:v.type)!==e.Comment)),c.length!==i&&u(c.length),e.createVNode("div",{class:"devui-carousel-container",style:{height:T},onMouseenter:()=>o("enter"),onMouseleave:()=>o("leave")},[g!=="never"&&t?e.createVNode("div",{class:"devui-carousel-arrow"},[e.createVNode("button",{class:"arrow-left",onClick:()=>S()},[e.createVNode(P,{name:"arrow-left"},null)]),e.createVNode("button",{class:"arrow-right",onClick:()=>I()},[e.createVNode(P,{name:"arrow-right"},null)])]):null,e.createVNode("div",{class:"devui-carousel-item-wrapper",ref:"wrapperRef"},[e.createVNode("div",{class:"devui-carousel-item-container",style:{width:`${i*100}%`},ref:"containerRef"},[r])]),i>0&&b?e.createVNode("ul",{class:["devui-carousel-dots",V]},[c.map((v,p)=>e.createVNode("li",{class:{"dot-item":!0,active:d===p},onClick:()=>y(p,"click"),onMouseenter:()=>y(p,"hover")},null))]):null])}}),C=e.defineComponent({name:"DCarouselItem",render(){var i;const{$slots:t}=this,d=(i=t.default)==null?void 0:i.call(t);return e.createVNode("div",{class:"d-carousel-item "},[d])}});w.install=function(t){t.component(w.name,w)},C.install=function(t){t.component(C.name,C)};var A={title:"Carousel \u8D70\u9A6C\u706F",category:"\u6570\u636E\u5C55\u793A",status:"80%",install(t){t.use(w),t.use(C)}};n.Carousel=w,n.CarouselItem=C,n.default=A,Object.defineProperty(n,"__esModule",{value:!0}),n[Symbol.toStringTag]="Module"});
@@ -1 +0,0 @@
1
- .devui-carousel-container{display:block;position:relative}.devui-carousel-container .devui-carousel-arrow{position:absolute;width:100%;top:50%}.devui-carousel-container .devui-carousel-arrow .arrow-left{position:absolute;top:-18px;z-index:2;cursor:pointer;width:36px;height:36px;border-radius:18px;background:var(--devui-highlight-overlay, rgba(255, 255, 255, .8));box-shadow:var(--devui-shadow-length-hover, 0 4px 16px 0) var(--devui-light-shadow, rgba(0, 0, 0, .1));display:inline-flex;align-items:center;justify-content:center;left:10px}.devui-carousel-container .devui-carousel-arrow .arrow-left:hover{background:var(--devui-area, #f8f8f8)}.devui-carousel-container .devui-carousel-arrow .arrow-left svg polygon{fill:var(--devui-text, #252b3a)}.devui-carousel-container .devui-carousel-arrow .arrow-right{position:absolute;top:-18px;z-index:2;cursor:pointer;width:36px;height:36px;border-radius:18px;background:var(--devui-highlight-overlay, rgba(255, 255, 255, .8));box-shadow:var(--devui-shadow-length-hover, 0 4px 16px 0) var(--devui-light-shadow, rgba(0, 0, 0, .1));display:inline-flex;align-items:center;justify-content:center;right:10px}.devui-carousel-container .devui-carousel-arrow .arrow-right:hover{background:var(--devui-area, #f8f8f8)}.devui-carousel-container .devui-carousel-arrow .arrow-right svg polygon{fill:var(--devui-text, #252b3a)}.devui-carousel-container .devui-carousel-item-wrapper{position:relative;overflow:hidden;height:100%}.devui-carousel-container .devui-carousel-item-wrapper .devui-carousel-item-container{display:flex;height:100%;position:relative}.devui-carousel-container .devui-carousel-item-wrapper .devui-carousel-item-container .d-carousel-item{flex:1;position:relative;height:100%}.devui-carousel-container .devui-carousel-dots{position:absolute;display:flex;justify-content:center;width:100%;list-style:none}.devui-carousel-container .devui-carousel-dots.bottom{bottom:8px}.devui-carousel-container .devui-carousel-dots.top{top:8px}.devui-carousel-container .devui-carousel-dots .dot-item{width:6px;height:6px;border-radius:3px;margin-right:8px;background:var(--devui-icon-fill, #d3d5d9)}.devui-carousel-container .devui-carousel-dots .dot-item:hover{cursor:pointer;background:var(--devui-list-item-hover-bg, #f2f5fc)}.devui-carousel-container .devui-carousel-dots .dot-item.active{width:24px;background:var(--devui-list-item-active-bg, #5e7ce0);transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-carousel-container .devui-carousel-arrow .arrow-left,.devui-carousel-container .devui-carousel-arrow .arrow-right{transition:background-color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1))}