vue-devui 1.0.0-rc.1 → 1.0.0-rc.12

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 (352) hide show
  1. package/README.md +70 -121
  2. package/alert/index.es.js +46 -15
  3. package/alert/index.umd.js +1 -1
  4. package/alert/style.css +1 -1
  5. package/auto-complete/index.es.js +8204 -296
  6. package/auto-complete/index.umd.js +29 -1
  7. package/auto-complete/style.css +1 -1
  8. package/avatar/index.es.js +153 -146
  9. package/avatar/index.umd.js +1 -1
  10. package/avatar/style.css +1 -1
  11. package/badge/index.es.js +36 -5
  12. package/badge/index.umd.js +1 -1
  13. package/badge/style.css +1 -1
  14. package/button/index.es.js +5727 -111
  15. package/button/index.umd.js +27 -1
  16. package/button/style.css +1 -1
  17. package/card/index.es.js +63 -35
  18. package/card/index.umd.js +1 -1
  19. package/card/style.css +1 -1
  20. package/checkbox/index.es.js +8068 -255
  21. package/checkbox/index.umd.js +27 -1
  22. package/checkbox/style.css +1 -1
  23. package/{accordion → collapse}/index.d.ts +0 -0
  24. package/collapse/index.es.js +213 -0
  25. package/collapse/index.umd.js +1 -0
  26. package/{anchor → collapse}/package.json +1 -1
  27. package/collapse/style.css +1 -0
  28. package/countdown/index.es.js +59 -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 +10856 -0
  32. package/date-picker-pro/index.umd.js +27 -0
  33. package/{breadcrumb → date-picker-pro}/package.json +1 -1
  34. package/date-picker-pro/style.css +1 -0
  35. package/drawer/index.es.js +31 -4
  36. package/drawer/index.umd.js +1 -1
  37. package/drawer/style.css +1 -1
  38. package/dropdown/index.es.js +210 -149
  39. package/dropdown/index.umd.js +1 -1
  40. package/dropdown/style.css +1 -1
  41. package/editable-select/index.es.js +569 -159
  42. package/editable-select/index.umd.js +1 -1
  43. package/editable-select/style.css +1 -1
  44. package/form/index.es.js +1048 -1187
  45. package/form/index.umd.js +15 -15
  46. package/form/style.css +1 -1
  47. package/fullscreen/index.es.js +29 -5
  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 +183 -23
  54. package/icon/index.umd.js +1 -1
  55. package/icon/style.css +1 -0
  56. package/image-preview/index.es.js +53 -30
  57. package/image-preview/index.umd.js +1 -1
  58. package/image-preview/style.css +1 -1
  59. package/input/index.es.js +8101 -144
  60. package/input/index.umd.js +27 -1
  61. package/input/style.css +1 -1
  62. package/input-number/index.es.js +274 -177
  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/modal/index.es.js +375 -171
  72. package/modal/index.umd.js +1 -1
  73. package/modal/style.css +1 -1
  74. package/notification/index.es.js +293 -40
  75. package/notification/index.umd.js +1 -1
  76. package/notification/style.css +1 -1
  77. package/nuxt/components/ButtonGroup.js +3 -0
  78. package/nuxt/components/CheckboxButton.js +3 -0
  79. package/nuxt/components/CheckboxGroup.js +3 -0
  80. package/nuxt/components/Collapse.js +3 -0
  81. package/nuxt/components/CollapseItem.js +3 -0
  82. package/nuxt/components/DRangeDatePickerPro.js +3 -0
  83. package/nuxt/components/DatePickerPro.js +3 -0
  84. package/nuxt/components/DropdownPropsKey.js +3 -0
  85. package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
  86. package/nuxt/components/FORM_TOKEN.js +3 -0
  87. package/nuxt/components/Icon.js +1 -0
  88. package/nuxt/components/IconGroup.js +3 -0
  89. package/nuxt/components/LABEL_DATA.js +3 -0
  90. package/nuxt/components/LoadingOptions.js +3 -0
  91. package/nuxt/components/Option.js +3 -0
  92. package/nuxt/components/OptionGroup.js +3 -0
  93. package/nuxt/components/RadioButton.js +3 -0
  94. package/nuxt/components/Step.js +3 -0
  95. package/nuxt/components/Steps.js +3 -0
  96. package/nuxt/components/TABLE_TOKEN.js +3 -0
  97. package/nuxt/components/Tab.js +3 -0
  98. package/nuxt/components/TimeSelect.js +3 -0
  99. package/nuxt/components/autoCompleteProps.js +3 -0
  100. package/nuxt/components/avatarProps.js +3 -0
  101. package/nuxt/components/buttonGroupInjectionKey.js +3 -0
  102. package/nuxt/components/buttonGroupProps.js +3 -0
  103. package/nuxt/components/cardProps.js +3 -0
  104. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  105. package/nuxt/components/checkboxGroupProps.js +3 -0
  106. package/nuxt/components/checkboxProps.js +3 -0
  107. package/nuxt/components/colProps.js +3 -0
  108. package/nuxt/components/colPropsBaseClass.js +3 -0
  109. package/nuxt/components/colPropsBaseStyle.js +3 -0
  110. package/nuxt/components/collapseItemProps.js +3 -0
  111. package/nuxt/components/collapseProps.js +3 -0
  112. package/nuxt/components/countdownProps.js +3 -0
  113. package/nuxt/components/datePickerProCommonProps.js +3 -0
  114. package/nuxt/components/datePickerProPanelProps.js +3 -0
  115. package/nuxt/components/datePickerProProps.js +3 -0
  116. package/nuxt/components/editableSelectProps.js +3 -0
  117. package/nuxt/components/formItemProps.js +3 -0
  118. package/nuxt/components/formProps.js +3 -0
  119. package/nuxt/components/iconProps.js +1 -0
  120. package/nuxt/components/imagePreviewProps.js +3 -0
  121. package/nuxt/components/inputProps.js +3 -0
  122. package/nuxt/components/loadingProps.js +3 -0
  123. package/nuxt/components/modalProps.js +3 -0
  124. package/nuxt/components/progressProps.js +3 -0
  125. package/nuxt/components/rateProps.js +3 -0
  126. package/nuxt/components/resultProps.js +3 -0
  127. package/nuxt/components/rowProps.js +3 -0
  128. package/nuxt/components/screenSizes.js +3 -0
  129. package/nuxt/components/skeletonProps.js +3 -0
  130. package/nuxt/components/sliderProps.js +3 -0
  131. package/nuxt/components/splitterProps.js +3 -0
  132. package/nuxt/components/statisticProps.js +3 -0
  133. package/nuxt/components/stepProps.js +3 -0
  134. package/nuxt/components/stepsProps.js +3 -0
  135. package/nuxt/components/svgIconProps.js +3 -0
  136. package/nuxt/components/switchProps.js +3 -0
  137. package/nuxt/components/tableProps.js +3 -0
  138. package/nuxt/components/tabsProps.js +3 -0
  139. package/nuxt/components/tagProps.js +3 -0
  140. package/nuxt/components/textareaProps.js +3 -0
  141. package/nuxt/components/timeAxisProps.js +3 -0
  142. package/nuxt/components/timerPickerPanelProps.js +3 -0
  143. package/nuxt/components/treeProps.js +3 -0
  144. package/overlay/index.es.js +104 -133
  145. package/overlay/index.umd.js +1 -1
  146. package/overlay/style.css +1 -1
  147. package/package.json +4 -2
  148. package/pagination/index.es.js +171 -141
  149. package/pagination/index.umd.js +1 -1
  150. package/pagination/style.css +1 -1
  151. package/panel/style.css +1 -1
  152. package/popover/index.es.js +294 -230
  153. package/popover/index.umd.js +15 -15
  154. package/popover/style.css +1 -1
  155. package/progress/index.es.js +110 -56
  156. package/progress/index.umd.js +3 -3
  157. package/progress/style.css +1 -1
  158. package/radio/index.es.js +7967 -146
  159. package/radio/index.umd.js +27 -1
  160. package/radio/style.css +1 -1
  161. package/rate/index.es.js +77 -55
  162. package/rate/index.umd.js +1 -1
  163. package/rate/style.css +1 -1
  164. package/result/index.es.js +170 -27
  165. package/result/index.umd.js +1 -1
  166. package/result/style.css +1 -1
  167. package/ripple/index.es.js +43 -42
  168. package/ripple/index.umd.js +1 -1
  169. package/search/index.es.js +3660 -1097
  170. package/search/index.umd.js +18 -18
  171. package/search/style.css +1 -1
  172. package/select/index.es.js +8998 -487
  173. package/select/index.umd.js +27 -1
  174. package/select/style.css +1 -1
  175. package/skeleton/index.es.js +46 -24
  176. package/skeleton/index.umd.js +1 -1
  177. package/skeleton/style.css +1 -1
  178. package/slider/index.es.js +144 -138
  179. package/slider/index.umd.js +1 -1
  180. package/slider/style.css +1 -1
  181. package/splitter/index.es.js +468 -340
  182. package/splitter/index.umd.js +16 -16
  183. package/splitter/style.css +1 -1
  184. package/statistic/index.es.js +41 -34
  185. package/statistic/index.umd.js +1 -1
  186. package/statistic/style.css +1 -1
  187. package/status/index.es.js +26 -2
  188. package/status/index.umd.js +1 -1
  189. package/status/style.css +1 -1
  190. package/{back-top → steps}/index.d.ts +0 -0
  191. package/steps/index.es.js +385 -0
  192. package/steps/index.umd.js +1 -0
  193. package/{gantt → steps}/package.json +1 -1
  194. package/steps/style.css +1 -0
  195. package/style.css +1 -1
  196. package/switch/index.es.js +7802 -64
  197. package/switch/index.umd.js +27 -1
  198. package/switch/style.css +1 -1
  199. package/table/index.es.js +10315 -1147
  200. package/table/index.umd.js +27 -1
  201. package/table/style.css +1 -1
  202. package/tabs/index.es.js +345 -142
  203. package/tabs/index.umd.js +1 -1
  204. package/tabs/style.css +1 -1
  205. package/tag/index.es.js +47 -23
  206. package/tag/index.umd.js +1 -1
  207. package/tag/style.css +1 -1
  208. package/textarea/index.es.js +7921 -83
  209. package/textarea/index.umd.js +35 -1
  210. package/textarea/style.css +1 -1
  211. package/time-picker/index.es.js +8704 -559
  212. package/time-picker/index.umd.js +27 -1
  213. package/time-picker/style.css +1 -1
  214. package/{breadcrumb → time-select}/index.d.ts +0 -0
  215. package/{color-picker → time-select}/index.es.js +4116 -2914
  216. package/time-select/index.umd.js +27 -0
  217. package/{back-top → time-select}/package.json +1 -1
  218. package/time-select/style.css +1 -0
  219. package/timeline/index.es.js +177 -37
  220. package/timeline/index.umd.js +1 -1
  221. package/timeline/style.css +1 -1
  222. package/tooltip/index.es.js +286 -221
  223. package/tooltip/index.umd.js +15 -15
  224. package/tooltip/style.css +1 -1
  225. package/tree/index.es.js +5325 -1855
  226. package/tree/index.umd.js +18 -18
  227. package/tree/style.css +1 -1
  228. package/upload/index.es.js +456 -133
  229. package/upload/index.umd.js +1 -1
  230. package/upload/style.css +1 -1
  231. package/vue-devui.es.js +14986 -16343
  232. package/vue-devui.umd.js +30 -20
  233. package/accordion/index.es.js +0 -723
  234. package/accordion/index.umd.js +0 -1
  235. package/accordion/package.json +0 -7
  236. package/accordion/style.css +0 -1
  237. package/anchor/index.es.js +0 -263
  238. package/anchor/index.umd.js +0 -1
  239. package/anchor/style.css +0 -1
  240. package/back-top/index.es.js +0 -130
  241. package/back-top/index.umd.js +0 -1
  242. package/back-top/style.css +0 -1
  243. package/breadcrumb/index.es.js +0 -128
  244. package/breadcrumb/index.umd.js +0 -1
  245. package/breadcrumb/style.css +0 -1
  246. package/carousel/index.d.ts +0 -7
  247. package/carousel/index.es.js +0 -314
  248. package/carousel/index.umd.js +0 -1
  249. package/carousel/package.json +0 -7
  250. package/carousel/style.css +0 -1
  251. package/cascader/index.d.ts +0 -7
  252. package/cascader/index.es.js +0 -5971
  253. package/cascader/index.umd.js +0 -27
  254. package/cascader/package.json +0 -7
  255. package/cascader/style.css +0 -1
  256. package/color-picker/index.d.ts +0 -7
  257. package/color-picker/index.umd.js +0 -27
  258. package/color-picker/package.json +0 -7
  259. package/color-picker/style.css +0 -1
  260. package/comment/index.d.ts +0 -7
  261. package/comment/index.es.js +0 -86
  262. package/comment/index.umd.js +0 -1
  263. package/comment/package.json +0 -7
  264. package/comment/style.css +0 -1
  265. package/date-picker/index.d.ts +0 -7
  266. package/date-picker/index.es.js +0 -1154
  267. package/date-picker/index.umd.js +0 -1
  268. package/date-picker/package.json +0 -7
  269. package/date-picker/style.css +0 -1
  270. package/dragdrop/index.d.ts +0 -7
  271. package/dragdrop/index.es.js +0 -157
  272. package/dragdrop/index.umd.js +0 -1
  273. package/dragdrop/package.json +0 -7
  274. package/gantt/index.d.ts +0 -7
  275. package/gantt/index.es.js +0 -523
  276. package/gantt/index.umd.js +0 -1
  277. package/gantt/style.css +0 -1
  278. package/input-icon/index.d.ts +0 -7
  279. package/input-icon/index.es.js +0 -332
  280. package/input-icon/index.umd.js +0 -1
  281. package/input-icon/package.json +0 -7
  282. package/input-icon/style.css +0 -1
  283. package/list/index.d.ts +0 -7
  284. package/list/index.es.js +0 -39
  285. package/list/index.umd.js +0 -1
  286. package/list/package.json +0 -7
  287. package/list/style.css +0 -1
  288. package/nav-sprite/index.d.ts +0 -7
  289. package/nav-sprite/index.es.js +0 -68
  290. package/nav-sprite/index.umd.js +0 -1
  291. package/nav-sprite/package.json +0 -7
  292. package/nuxt/components/Accordion.js +0 -3
  293. package/nuxt/components/Anchor.js +0 -3
  294. package/nuxt/components/BackTop.js +0 -3
  295. package/nuxt/components/Breadcrumb.js +0 -3
  296. package/nuxt/components/Carousel.js +0 -3
  297. package/nuxt/components/CarouselItem.js +0 -3
  298. package/nuxt/components/Cascader.js +0 -3
  299. package/nuxt/components/ColorPicker.js +0 -3
  300. package/nuxt/components/Comment.js +0 -3
  301. package/nuxt/components/DatePicker.js +0 -3
  302. package/nuxt/components/FormControl.js +0 -3
  303. package/nuxt/components/FormLabel.js +0 -3
  304. package/nuxt/components/Gantt.js +0 -3
  305. package/nuxt/components/InputIcon.js +0 -3
  306. package/nuxt/components/List.js +0 -3
  307. package/nuxt/components/ListItem.js +0 -3
  308. package/nuxt/components/NavSprite.js +0 -2
  309. package/nuxt/components/QuadrantDiagram.js +0 -3
  310. package/nuxt/components/ReadTip.js +0 -3
  311. package/nuxt/components/StepsGuide.js +0 -3
  312. package/nuxt/components/StickSlider.js +0 -3
  313. package/nuxt/components/Sticky.js +0 -2
  314. package/nuxt/components/TagInput.js +0 -3
  315. package/nuxt/components/Transfer.js +0 -3
  316. package/nuxt/components/TreeSelect.js +0 -3
  317. package/nuxt/components/overlayEmits.js +0 -3
  318. package/nuxt/components/overlayProps.js +0 -3
  319. package/quadrant-diagram/index.d.ts +0 -7
  320. package/quadrant-diagram/index.es.js +0 -5728
  321. package/quadrant-diagram/index.umd.js +0 -27
  322. package/quadrant-diagram/package.json +0 -7
  323. package/quadrant-diagram/style.css +0 -1
  324. package/read-tip/index.d.ts +0 -7
  325. package/read-tip/index.es.js +0 -261
  326. package/read-tip/index.umd.js +0 -1
  327. package/read-tip/package.json +0 -7
  328. package/read-tip/style.css +0 -1
  329. package/steps-guide/index.d.ts +0 -7
  330. package/steps-guide/index.es.js +0 -242
  331. package/steps-guide/index.umd.js +0 -1
  332. package/steps-guide/package.json +0 -7
  333. package/steps-guide/style.css +0 -1
  334. package/sticky/index.d.ts +0 -7
  335. package/sticky/index.es.js +0 -197
  336. package/sticky/index.umd.js +0 -1
  337. package/sticky/package.json +0 -7
  338. package/tag-input/index.d.ts +0 -7
  339. package/tag-input/index.es.js +0 -331
  340. package/tag-input/index.umd.js +0 -1
  341. package/tag-input/package.json +0 -7
  342. package/tag-input/style.css +0 -1
  343. package/transfer/index.d.ts +0 -7
  344. package/transfer/index.es.js +0 -7615
  345. package/transfer/index.umd.js +0 -27
  346. package/transfer/package.json +0 -7
  347. package/transfer/style.css +0 -1
  348. package/tree-select/index.d.ts +0 -7
  349. package/tree-select/index.es.js +0 -627
  350. package/tree-select/index.umd.js +0 -1
  351. package/tree-select/package.json +0 -7
  352. package/tree-select/style.css +0 -1
@@ -1,314 +0,0 @@
1
- import { defineComponent, toRefs, createVNode, ref, watch, onMounted, onBeforeUnmount, Fragment, Comment } from "vue";
2
- const carouselProps = {
3
- arrowTrigger: {
4
- type: String,
5
- default: "hover"
6
- },
7
- autoplay: {
8
- type: Boolean,
9
- default: false
10
- },
11
- autoplaySpeed: {
12
- type: Number,
13
- default: 3e3
14
- },
15
- height: {
16
- type: String,
17
- default: "100%"
18
- },
19
- showDots: {
20
- type: Boolean,
21
- default: true
22
- },
23
- dotTrigger: {
24
- type: String,
25
- default: "click"
26
- },
27
- dotPosition: {
28
- type: String,
29
- default: "bottom"
30
- },
31
- activeIndex: {
32
- type: Number,
33
- default: 0
34
- },
35
- activeIndexChange: {
36
- type: Function
37
- }
38
- };
39
- const iconProps = {
40
- name: {
41
- type: String,
42
- default: "",
43
- required: true
44
- },
45
- size: {
46
- type: String,
47
- default: "inherit"
48
- },
49
- color: {
50
- type: String,
51
- default: "inherit"
52
- },
53
- classPrefix: {
54
- type: String,
55
- default: "icon"
56
- }
57
- };
58
- var Icon = defineComponent({
59
- name: "DIcon",
60
- props: iconProps,
61
- setup(props) {
62
- const {
63
- name,
64
- size,
65
- color,
66
- classPrefix
67
- } = toRefs(props);
68
- return () => {
69
- return /^((https?):)?\/\//.test(name.value) ? createVNode("img", {
70
- "src": name.value,
71
- "alt": name.value.split("/")[name.value.split("/").length - 1],
72
- "style": {
73
- width: size.value,
74
- verticalAlign: "text-bottom"
75
- }
76
- }, null) : createVNode("i", {
77
- "class": `${classPrefix.value} ${classPrefix.value}-${name.value}`,
78
- "style": {
79
- fontSize: size.value,
80
- color: color.value
81
- }
82
- }, null);
83
- };
84
- }
85
- });
86
- var carousel = "";
87
- var Carousel = defineComponent({
88
- name: "DCarousel",
89
- props: carouselProps,
90
- emits: ["update:activeIndex"],
91
- setup(props, {
92
- emit
93
- }) {
94
- const {
95
- arrowTrigger,
96
- autoplay,
97
- autoplaySpeed,
98
- dotTrigger,
99
- activeIndex,
100
- activeIndexChange
101
- } = props;
102
- const transitionSpeed = 500;
103
- const itemCount = ref(0);
104
- const showArrow = ref(false);
105
- const currentIndex = ref(0);
106
- const wrapperRef = ref(null);
107
- const containerRef = ref(null);
108
- const scheduledId = ref(null);
109
- watch(() => arrowTrigger, () => {
110
- showArrow.value = arrowTrigger === "always";
111
- }, {
112
- immediate: true
113
- });
114
- watch(() => activeIndex, () => {
115
- currentIndex.value = activeIndex;
116
- }, {
117
- immediate: true
118
- });
119
- const translatePosition = (size) => {
120
- if (containerRef.value)
121
- containerRef.value.style.left = `${-size * 100}%`;
122
- };
123
- const adjustTransition = (targetEl) => {
124
- setTimeout(() => {
125
- if (containerRef.value)
126
- containerRef.value.style.transition = "";
127
- targetEl.style.transform = "";
128
- translatePosition(currentIndex.value);
129
- }, transitionSpeed);
130
- };
131
- const adjustPosition = (targetEl, firstToLast) => {
132
- if (wrapperRef.value) {
133
- const wrapperRect = wrapperRef.value.getBoundingClientRect();
134
- targetEl.style.transform = `translateX(${(firstToLast ? -itemCount.value : itemCount.value) * wrapperRect.width}px)`;
135
- }
136
- };
137
- const goto = (index2) => {
138
- if (index2 === currentIndex.value || !wrapperRef.value || !containerRef.value) {
139
- return;
140
- }
141
- containerRef.value.style.transition = `left ${transitionSpeed}ms ease`;
142
- let latestIndex = currentIndex.value;
143
- if (index2 < 0 && currentIndex.value === 0) {
144
- latestIndex = itemCount.value - 1;
145
- const targetEl = containerRef.value.children[latestIndex];
146
- adjustPosition(targetEl, true);
147
- translatePosition(-1);
148
- adjustTransition(targetEl);
149
- } else if (index2 >= itemCount.value && currentIndex.value === itemCount.value - 1) {
150
- latestIndex = 0;
151
- const targetEl = containerRef.value.children[latestIndex];
152
- adjustPosition(targetEl, false);
153
- translatePosition(itemCount.value);
154
- adjustTransition(targetEl);
155
- } else {
156
- latestIndex = index2 < 0 ? 0 : index2 > itemCount.value - 1 ? itemCount.value - 1 : index2;
157
- translatePosition(latestIndex);
158
- }
159
- currentIndex.value = latestIndex;
160
- emit("update:activeIndex", latestIndex);
161
- activeIndexChange == null ? void 0 : activeIndexChange(latestIndex);
162
- autoScheduleTransition();
163
- };
164
- const prev = () => {
165
- goto(currentIndex.value - 1);
166
- };
167
- const next = () => {
168
- goto(currentIndex.value + 1);
169
- };
170
- const arrowMouseEvent = (type) => {
171
- if (arrowTrigger !== "hover")
172
- return;
173
- showArrow.value = type === "enter";
174
- };
175
- const switchStep = (index2, type) => {
176
- if (type === dotTrigger)
177
- goto(index2);
178
- };
179
- const clearScheduledTransition = () => {
180
- if (scheduledId.value) {
181
- clearTimeout(scheduledId.value);
182
- scheduledId.value = null;
183
- }
184
- };
185
- const autoScheduleTransition = () => {
186
- clearScheduledTransition();
187
- if (autoplay && autoplaySpeed) {
188
- scheduledId.value = setTimeout(() => {
189
- next();
190
- }, autoplaySpeed);
191
- }
192
- };
193
- const changeItemCount = (val) => {
194
- itemCount.value = val;
195
- autoScheduleTransition();
196
- };
197
- onMounted(() => {
198
- if (containerRef.value) {
199
- containerRef.value.style.transition = `left ${transitionSpeed}ms ease`;
200
- containerRef.value.style.left = "0%";
201
- }
202
- autoScheduleTransition();
203
- });
204
- onBeforeUnmount(() => {
205
- clearScheduledTransition();
206
- });
207
- return {
208
- wrapperRef,
209
- containerRef,
210
- showArrow,
211
- currentIndex,
212
- itemCount,
213
- changeItemCount,
214
- goto,
215
- prev,
216
- next,
217
- arrowMouseEvent,
218
- switchStep
219
- };
220
- },
221
- render() {
222
- var _a, _b;
223
- const {
224
- showArrow,
225
- currentIndex,
226
- itemCount,
227
- arrowTrigger,
228
- height,
229
- showDots,
230
- dotPosition,
231
- prev,
232
- next,
233
- arrowMouseEvent,
234
- switchStep,
235
- changeItemCount,
236
- $slots
237
- } = this;
238
- const slot = (_b = (_a = $slots.default) == null ? void 0 : _a.call($slots)) != null ? _b : [];
239
- let children = slot;
240
- if (children.length === 1 && children[0].type === Fragment) {
241
- children = (children[0].children || []).filter((item) => (item == null ? void 0 : item.type) !== Comment);
242
- }
243
- if (children.length !== itemCount) {
244
- changeItemCount(children.length);
245
- }
246
- return createVNode("div", {
247
- "class": "devui-carousel-container",
248
- "style": {
249
- height
250
- },
251
- "onMouseenter": () => arrowMouseEvent("enter"),
252
- "onMouseleave": () => arrowMouseEvent("leave")
253
- }, [arrowTrigger !== "never" && showArrow ? createVNode("div", {
254
- "class": "devui-carousel-arrow"
255
- }, [createVNode("button", {
256
- "class": "arrow-left",
257
- "onClick": () => prev()
258
- }, [createVNode(Icon, {
259
- "name": "arrow-left"
260
- }, null)]), createVNode("button", {
261
- "class": "arrow-right",
262
- "onClick": () => next()
263
- }, [createVNode(Icon, {
264
- "name": "arrow-right"
265
- }, null)])]) : null, createVNode("div", {
266
- "class": "devui-carousel-item-wrapper",
267
- "ref": "wrapperRef"
268
- }, [createVNode("div", {
269
- "class": "devui-carousel-item-container",
270
- "style": {
271
- width: `${itemCount * 100}%`
272
- },
273
- "ref": "containerRef"
274
- }, [slot])]), itemCount > 0 && showDots ? createVNode("ul", {
275
- "class": ["devui-carousel-dots", dotPosition]
276
- }, [children.map((_, index2) => createVNode("li", {
277
- "class": {
278
- "dot-item": true,
279
- active: currentIndex === index2
280
- },
281
- "onClick": () => switchStep(index2, "click"),
282
- "onMouseenter": () => switchStep(index2, "hover")
283
- }, null))]) : null]);
284
- }
285
- });
286
- var CarouselItem = defineComponent({
287
- name: "DCarouselItem",
288
- render() {
289
- var _a;
290
- const {
291
- $slots
292
- } = this;
293
- const children = (_a = $slots.default) == null ? void 0 : _a.call($slots);
294
- return createVNode("div", {
295
- "class": "d-carousel-item "
296
- }, [children]);
297
- }
298
- });
299
- Carousel.install = function(app) {
300
- app.component(Carousel.name, Carousel);
301
- };
302
- CarouselItem.install = function(app) {
303
- app.component(CarouselItem.name, CarouselItem);
304
- };
305
- var index = {
306
- title: "Carousel \u8D70\u9A6C\u706F",
307
- category: "\u6570\u636E\u5C55\u793A",
308
- status: "80%",
309
- install(app) {
310
- app.use(Carousel);
311
- app.use(CarouselItem);
312
- }
313
- };
314
- export { Carousel, CarouselItem, index as default };
@@ -1 +0,0 @@
1
- (function(c,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(c=typeof globalThis!="undefined"?globalThis:c||self,e(c.index={},c.Vue))})(this,function(c,e){"use strict";const R={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}},D={name:{type:String,default:"",required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}};var b=e.defineComponent({name:"DIcon",props:D,setup(a){const{name:i,size:n,color:C,classPrefix:p}=e.toRefs(a);return()=>/^((https?):)?\/\//.test(i.value)?e.createVNode("img",{src:i.value,alt:i.value.split("/")[i.value.split("/").length-1],style:{width:n.value,verticalAlign:"text-bottom"}},null):e.createVNode("i",{class:`${p.value} ${p.value}-${i.value}`,style:{fontSize:n.value,color:C.value}},null)}}),B="",y=e.defineComponent({name:"DCarousel",props:R,emits:["update:activeIndex"],setup(a,{emit:i}){const{arrowTrigger:n,autoplay:C,autoplaySpeed:p,dotTrigger:V,activeIndex:T,activeIndexChange:S}=a,I=500,o=e.ref(0),g=e.ref(!1),s=e.ref(0),d=e.ref(null),l=e.ref(null),u=e.ref(null);e.watch(()=>n,()=>{g.value=n==="always"},{immediate:!0}),e.watch(()=>T,()=>{s.value=T},{immediate:!0});const v=t=>{l.value&&(l.value.style.left=`${-t*100}%`)},N=t=>{setTimeout(()=>{l.value&&(l.value.style.transition=""),t.style.transform="",v(s.value)},I)},m=(t,r)=>{if(d.value){const h=d.value.getBoundingClientRect();t.style.transform=`translateX(${(r?-o.value:o.value)*h.width}px)`}},f=t=>{if(t===s.value||!d.value||!l.value)return;l.value.style.transition=`left ${I}ms ease`;let r=s.value;if(t<0&&s.value===0){r=o.value-1;const h=l.value.children[r];m(h,!0),v(-1),N(h)}else if(t>=o.value&&s.value===o.value-1){r=0;const h=l.value.children[r];m(h,!1),v(o.value),N(h)}else r=t<0?0:t>o.value-1?o.value-1:t,v(r);s.value=r,i("update:activeIndex",r),S==null||S(r),P()},k=()=>{f(s.value-1)},M=()=>{f(s.value+1)},A=t=>{n==="hover"&&(g.value=t==="enter")},E=(t,r)=>{r===V&&f(t)},x=()=>{u.value&&(clearTimeout(u.value),u.value=null)},P=()=>{x(),C&&p&&(u.value=setTimeout(()=>{M()},p))},j=t=>{o.value=t,P()};return e.onMounted(()=>{l.value&&(l.value.style.transition=`left ${I}ms ease`,l.value.style.left="0%"),P()}),e.onBeforeUnmount(()=>{x()}),{wrapperRef:d,containerRef:l,showArrow:g,currentIndex:s,itemCount:o,changeItemCount:j,goto:f,prev:k,next:M,arrowMouseEvent:A,switchStep:E}},render(){var v,N;const{showArrow:a,currentIndex:i,itemCount:n,arrowTrigger:C,height:p,showDots:V,dotPosition:T,prev:S,next:I,arrowMouseEvent:o,switchStep:g,changeItemCount:s,$slots:d}=this,l=(N=(v=d.default)==null?void 0:v.call(d))!=null?N:[];let u=l;return u.length===1&&u[0].type===e.Fragment&&(u=(u[0].children||[]).filter(m=>(m==null?void 0:m.type)!==e.Comment)),u.length!==n&&s(u.length),e.createVNode("div",{class:"devui-carousel-container",style:{height:p},onMouseenter:()=>o("enter"),onMouseleave:()=>o("leave")},[C!=="never"&&a?e.createVNode("div",{class:"devui-carousel-arrow"},[e.createVNode("button",{class:"arrow-left",onClick:()=>S()},[e.createVNode(b,{name:"arrow-left"},null)]),e.createVNode("button",{class:"arrow-right",onClick:()=>I()},[e.createVNode(b,{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:`${n*100}%`},ref:"containerRef"},[l])]),n>0&&V?e.createVNode("ul",{class:["devui-carousel-dots",T]},[u.map((m,f)=>e.createVNode("li",{class:{"dot-item":!0,active:i===f},onClick:()=>g(f,"click"),onMouseenter:()=>g(f,"hover")},null))]):null])}}),w=e.defineComponent({name:"DCarouselItem",render(){var n;const{$slots:a}=this,i=(n=a.default)==null?void 0:n.call(a);return e.createVNode("div",{class:"d-carousel-item "},[i])}});y.install=function(a){a.component(y.name,y)},w.install=function(a){a.component(w.name,w)};var $={title:"Carousel \u8D70\u9A6C\u706F",category:"\u6570\u636E\u5C55\u793A",status:"80%",install(a){a.use(y),a.use(w)}};c.Carousel=y,c.CarouselItem=w,c.default=$,Object.defineProperty(c,"__esModule",{value:!0}),c[Symbol.toStringTag]="Module"});
@@ -1,7 +0,0 @@
1
- {
2
- "name": "carousel",
3
- "version": "0.0.0",
4
- "main": "index.umd.js",
5
- "module": "index.es.js",
6
- "style": "style.css"
7
- }
@@ -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))}
@@ -1,7 +0,0 @@
1
- import { App } from 'vue';
2
- declare function install(app: App): void
3
- declare const _default: {
4
- install: typeof install;
5
- version: string;
6
- };
7
- export default _default;