vxe-pc-ui 4.20.34 → 4.20.35

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 (367) hide show
  1. package/dist/all.esm.js +45718 -45038
  2. package/dist/all.esm.min.js +3 -3
  3. package/dist/style.css +307 -1
  4. package/dist/style.mini.css +1 -1
  5. package/es/alert/src/alert.js +117 -114
  6. package/es/anchor/src/anchor-link.js +110 -107
  7. package/es/anchor/src/anchor.js +212 -209
  8. package/es/avatar/src/avatar.js +132 -129
  9. package/es/backtop/src/backtop.js +267 -264
  10. package/es/badge/src/badge.js +102 -99
  11. package/es/breadcrumb/src/breadcrumb-item.js +104 -101
  12. package/es/breadcrumb/src/breadcrumb.js +70 -67
  13. package/es/button/src/button-group.js +88 -85
  14. package/es/calendar/src/calendar.js +1371 -1368
  15. package/es/card/src/card.js +235 -232
  16. package/es/carousel/src/carousel-item.js +78 -75
  17. package/es/carousel/src/carousel.js +392 -389
  18. package/es/cascader/src/cascader.js +1667 -1664
  19. package/es/checkbox/src/button.js +198 -195
  20. package/es/checkbox/src/checkbox.js +181 -178
  21. package/es/checkbox/src/group.js +210 -207
  22. package/es/collapse/src/collapse-pane.js +98 -95
  23. package/es/collapse/src/collapse.js +340 -337
  24. package/es/color-picker/src/color-picker.js +1116 -1113
  25. package/es/components.d.ts +1 -0
  26. package/es/components.js +3 -0
  27. package/es/context-menu/src/context-menu.js +601 -598
  28. package/es/countdown/src/countdown.js +224 -221
  29. package/es/date-panel/src/date-panel.js +1905 -1902
  30. package/es/date-picker/src/date-picker.js +1537 -1534
  31. package/es/date-range-picker/src/date-range-picker.js +1412 -1409
  32. package/es/divider/src/divider.js +80 -77
  33. package/es/drawer/src/drawer.js +778 -775
  34. package/es/empty/src/empty.js +100 -97
  35. package/es/form/src/form-group.js +74 -71
  36. package/es/form/src/form-item.js +76 -73
  37. package/es/form/src/form.js +789 -786
  38. package/es/icon/src/icon.js +59 -56
  39. package/es/icon/style.css +1 -1
  40. package/es/icon/style.mini.css +1 -1
  41. package/es/icon-picker/src/icon-picker.js +719 -716
  42. package/es/image/src/group.js +130 -127
  43. package/es/image/src/image.js +243 -240
  44. package/es/image/src/preview.js +627 -624
  45. package/es/index.esm.js +2 -0
  46. package/es/index.js +2 -0
  47. package/es/input/src/input.js +2700 -2697
  48. package/es/layout-aside/src/layout-aside.js +138 -135
  49. package/es/layout-body/src/layout-body.js +145 -142
  50. package/es/layout-container/src/layout-container.js +71 -68
  51. package/es/layout-footer/src/layout-footer.js +60 -57
  52. package/es/layout-header/src/layout-header.js +58 -55
  53. package/es/link/src/link.js +131 -128
  54. package/es/list/src/list.js +2174 -2171
  55. package/es/loading/src/loading.js +141 -138
  56. package/es/mention/src/mention.js +49 -46
  57. package/es/menu/src/menu.js +799 -796
  58. package/es/modal/src/modal.js +1519 -1527
  59. package/es/notice-bar/src/notice-bar.js +168 -165
  60. package/es/number-input/src/number-input.js +1094 -1091
  61. package/es/pager/src/pager.js +767 -764
  62. package/es/password-input/src/password-input.js +431 -428
  63. package/es/print/src/page-break.js +63 -60
  64. package/es/print/src/print.js +303 -300
  65. package/es/pulldown/src/pulldown.js +403 -400
  66. package/es/radio/src/button.js +214 -211
  67. package/es/radio/src/group.js +195 -192
  68. package/es/radio/src/radio.js +194 -191
  69. package/es/rate/src/rate.js +164 -161
  70. package/es/result/src/result.js +116 -113
  71. package/es/row/src/col.js +133 -130
  72. package/es/row/src/row.js +111 -108
  73. package/es/scrollbar/src/scrollbar.js +518 -515
  74. package/es/segmented/src/segmented.js +240 -237
  75. package/es/select/src/optgroup.js +44 -41
  76. package/es/select/src/option.js +39 -36
  77. package/es/select/src/select.js +1914 -1896
  78. package/es/slider/src/slider.js +419 -416
  79. package/es/space/src/space.js +190 -187
  80. package/es/splitter/src/splitter-panel.js +146 -143
  81. package/es/splitter/src/splitter.js +917 -914
  82. package/es/step-item/index.d.ts +76 -0
  83. package/es/step-item/index.js +17 -0
  84. package/es/steps/index.d.ts +288 -34
  85. package/es/steps/src/step-info.d.ts +6 -0
  86. package/es/steps/src/step-info.js +20 -0
  87. package/es/steps/src/step-item.d.ts +14 -0
  88. package/es/steps/src/step-item.js +39 -0
  89. package/es/steps/src/steps.d.ts +68 -8
  90. package/es/steps/src/steps.js +299 -47
  91. package/es/steps/src/util.d.ts +7 -0
  92. package/es/steps/src/util.js +44 -0
  93. package/es/steps/style.css +297 -0
  94. package/es/steps/style.mini.css +1 -0
  95. package/es/style.css +307 -1
  96. package/es/style.mini.css +1 -1
  97. package/es/switch/src/switch.js +228 -225
  98. package/es/table-select/src/table-select.js +865 -862
  99. package/es/table-transfer/src/table-transfer.js +61 -58
  100. package/es/tabs/src/tab-pane.js +102 -99
  101. package/es/tabs/src/tabs.js +936 -933
  102. package/es/tag/src/tag.js +163 -160
  103. package/es/text/src/text.js +232 -229
  104. package/es/text-ellipsis/src/text-ellipsis.js +252 -249
  105. package/es/textarea/src/textarea.js +434 -431
  106. package/es/timeline/src/timeline.js +74 -36
  107. package/es/timeline/src/util.js +7 -4
  108. package/es/tip/src/tip.js +117 -114
  109. package/es/tooltip/src/tooltip.js +552 -549
  110. package/es/tour/src/tour.js +49 -46
  111. package/es/transfer/src/transfer.js +95 -92
  112. package/es/tree/src/tree.js +3379 -3376
  113. package/es/tree-select/src/tree-select.js +969 -966
  114. package/es/ui/index.js +8 -2
  115. package/es/ui/src/log.js +1 -1
  116. package/es/upload/src/upload.js +1791 -1788
  117. package/es/vxe-icon/style.css +1 -1
  118. package/es/vxe-icon/style.mini.css +1 -1
  119. package/es/vxe-steps/style.css +297 -0
  120. package/es/vxe-steps/style.mini.css +1 -0
  121. package/es/watermark/src/watermark.js +158 -155
  122. package/lib/alert/src/alert.js +117 -114
  123. package/lib/anchor/src/anchor-link.js +110 -107
  124. package/lib/anchor/src/anchor.js +212 -209
  125. package/lib/avatar/src/avatar.js +132 -129
  126. package/lib/backtop/src/backtop.js +267 -264
  127. package/lib/badge/src/badge.js +102 -99
  128. package/lib/breadcrumb/src/breadcrumb-item.js +104 -101
  129. package/lib/breadcrumb/src/breadcrumb.js +70 -67
  130. package/lib/button/src/button-group.js +88 -85
  131. package/lib/calendar/src/calendar.js +1371 -1368
  132. package/lib/card/src/card.js +235 -232
  133. package/lib/carousel/src/carousel-item.js +78 -75
  134. package/lib/carousel/src/carousel.js +392 -389
  135. package/lib/cascader/src/cascader.js +1665 -1662
  136. package/lib/checkbox/src/button.js +198 -195
  137. package/lib/checkbox/src/checkbox.js +181 -178
  138. package/lib/checkbox/src/group.js +210 -207
  139. package/lib/collapse/src/collapse-pane.js +98 -95
  140. package/lib/collapse/src/collapse.js +340 -337
  141. package/lib/color-picker/src/color-picker.js +1116 -1113
  142. package/lib/components.js +3 -0
  143. package/lib/context-menu/src/context-menu.js +601 -598
  144. package/lib/countdown/src/countdown.js +224 -221
  145. package/lib/date-panel/src/date-panel.js +1905 -1902
  146. package/lib/date-picker/src/date-picker.js +1537 -1534
  147. package/lib/date-range-picker/src/date-range-picker.js +1412 -1409
  148. package/lib/divider/src/divider.js +80 -77
  149. package/lib/drawer/src/drawer.js +778 -775
  150. package/lib/empty/src/empty.js +100 -97
  151. package/lib/form/src/form-group.js +74 -71
  152. package/lib/form/src/form-item.js +76 -73
  153. package/lib/form/src/form.js +789 -786
  154. package/lib/icon/src/icon.js +59 -56
  155. package/lib/icon/style/style.css +1 -1
  156. package/lib/icon/style/style.mini.css +1 -1
  157. package/lib/icon-picker/src/icon-picker.js +719 -716
  158. package/lib/image/src/group.js +130 -127
  159. package/lib/image/src/image.js +243 -240
  160. package/lib/image/src/preview.js +627 -624
  161. package/lib/index.common.js +2 -0
  162. package/lib/index.js +2 -0
  163. package/lib/index.umd.js +47411 -46732
  164. package/lib/index.umd.min.js +3 -3
  165. package/lib/input/src/input.js +2700 -2697
  166. package/lib/layout-aside/src/layout-aside.js +138 -135
  167. package/lib/layout-body/src/layout-body.js +145 -142
  168. package/lib/layout-container/src/layout-container.js +71 -68
  169. package/lib/layout-footer/src/layout-footer.js +60 -57
  170. package/lib/layout-header/src/layout-header.js +58 -55
  171. package/lib/link/src/link.js +131 -128
  172. package/lib/list/src/list.js +2173 -2170
  173. package/lib/loading/src/loading.js +141 -138
  174. package/lib/mention/src/mention.js +49 -46
  175. package/lib/menu/src/menu.js +799 -796
  176. package/lib/modal/src/modal.js +1519 -1527
  177. package/lib/notice-bar/src/notice-bar.js +168 -165
  178. package/lib/number-input/src/number-input.js +1094 -1091
  179. package/lib/pager/src/pager.js +767 -764
  180. package/lib/password-input/src/password-input.js +431 -428
  181. package/lib/print/src/page-break.js +63 -60
  182. package/lib/print/src/print.js +303 -300
  183. package/lib/pulldown/src/pulldown.js +403 -400
  184. package/lib/radio/src/button.js +214 -211
  185. package/lib/radio/src/group.js +195 -192
  186. package/lib/radio/src/radio.js +194 -191
  187. package/lib/rate/src/rate.js +164 -161
  188. package/lib/result/src/result.js +116 -113
  189. package/lib/row/src/col.js +133 -130
  190. package/lib/row/src/row.js +111 -108
  191. package/lib/scrollbar/src/scrollbar.js +518 -515
  192. package/lib/segmented/src/segmented.js +240 -237
  193. package/lib/select/src/optgroup.js +44 -41
  194. package/lib/select/src/option.js +39 -36
  195. package/lib/select/src/select.js +1915 -1897
  196. package/lib/slider/src/slider.js +419 -416
  197. package/lib/space/src/space.js +190 -187
  198. package/lib/splitter/src/splitter-panel.js +146 -143
  199. package/lib/splitter/src/splitter.js +917 -914
  200. package/lib/step-item/index.js +47 -0
  201. package/lib/steps/src/step-info.js +49 -0
  202. package/lib/steps/src/step-item.js +59 -0
  203. package/lib/steps/src/steps.js +298 -46
  204. package/lib/steps/src/util.js +74 -0
  205. package/lib/steps/style/style.css +297 -0
  206. package/lib/steps/style/style.mini.css +1 -0
  207. package/lib/style.css +307 -1
  208. package/lib/style.mini.css +1 -1
  209. package/lib/switch/src/switch.js +228 -225
  210. package/lib/table-select/src/table-select.js +865 -862
  211. package/lib/table-transfer/src/table-transfer.js +61 -58
  212. package/lib/tabs/src/tab-pane.js +102 -99
  213. package/lib/tabs/src/tabs.js +936 -933
  214. package/lib/tag/src/tag.js +163 -160
  215. package/lib/text/src/text.js +232 -229
  216. package/lib/text-ellipsis/src/text-ellipsis.js +252 -249
  217. package/lib/textarea/src/textarea.js +434 -431
  218. package/lib/timeline/src/timeline.js +74 -36
  219. package/lib/timeline/src/util.js +7 -4
  220. package/lib/tip/src/tip.js +117 -114
  221. package/lib/tooltip/src/tooltip.js +552 -549
  222. package/lib/tour/src/tour.js +49 -46
  223. package/lib/transfer/src/transfer.js +95 -92
  224. package/lib/tree/src/tree.js +3379 -3376
  225. package/lib/tree-select/src/tree-select.js +969 -966
  226. package/lib/ui/index.js +8 -2
  227. package/lib/ui/src/log.js +1 -1
  228. package/lib/upload/src/upload.js +1788 -1785
  229. package/lib/vxe-icon/style/style.css +1 -1
  230. package/lib/vxe-icon/style/style.mini.css +1 -1
  231. package/lib/vxe-steps/style/style.css +297 -0
  232. package/lib/vxe-steps/style/style.mini.css +1 -0
  233. package/lib/watermark/src/watermark.js +158 -155
  234. package/package.json +1 -1
  235. package/packages/alert/src/alert.ts +2 -2
  236. package/packages/anchor/src/anchor-link.ts +2 -2
  237. package/packages/anchor/src/anchor.ts +2 -2
  238. package/packages/avatar/src/avatar.ts +2 -2
  239. package/packages/backtop/src/backtop.ts +2 -2
  240. package/packages/badge/src/badge.ts +2 -2
  241. package/packages/breadcrumb/src/breadcrumb-item.ts +2 -2
  242. package/packages/breadcrumb/src/breadcrumb.ts +2 -2
  243. package/packages/button/src/button-group.ts +2 -2
  244. package/packages/calendar/src/calendar.ts +2 -2
  245. package/packages/card/src/card.ts +2 -2
  246. package/packages/carousel/src/carousel-item.ts +2 -2
  247. package/packages/carousel/src/carousel.ts +2 -2
  248. package/packages/cascader/src/cascader.ts +2 -2
  249. package/packages/checkbox/src/button.ts +3 -15
  250. package/packages/checkbox/src/checkbox.ts +2 -2
  251. package/packages/checkbox/src/group.ts +2 -2
  252. package/packages/collapse/src/collapse-pane.ts +2 -2
  253. package/packages/collapse/src/collapse.ts +2 -2
  254. package/packages/color-picker/src/color-picker.ts +2 -2
  255. package/packages/components.ts +3 -0
  256. package/packages/context-menu/src/context-menu.ts +3 -16
  257. package/packages/countdown/src/countdown.ts +2 -2
  258. package/packages/date-panel/src/date-panel.ts +2 -2
  259. package/packages/date-picker/src/date-picker.ts +2 -2
  260. package/packages/date-range-picker/src/date-range-picker.ts +2 -2
  261. package/packages/divider/src/divider.ts +2 -2
  262. package/packages/drawer/src/drawer.ts +2 -2
  263. package/packages/empty/src/empty.ts +2 -2
  264. package/packages/form/src/form-group.ts +2 -2
  265. package/packages/form/src/form-item.ts +2 -2
  266. package/packages/form/src/form.ts +2 -2
  267. package/packages/icon/src/icon.ts +2 -2
  268. package/packages/icon-picker/src/icon-picker.ts +2 -2
  269. package/packages/image/src/group.ts +2 -2
  270. package/packages/image/src/image.ts +2 -2
  271. package/packages/image/src/preview.ts +3 -16
  272. package/packages/index.ts +2 -2
  273. package/packages/input/src/input.ts +2 -2
  274. package/packages/layout-aside/src/layout-aside.ts +2 -2
  275. package/packages/layout-body/src/layout-body.ts +2 -2
  276. package/packages/layout-container/src/layout-container.ts +3 -14
  277. package/packages/layout-footer/src/layout-footer.ts +2 -2
  278. package/packages/layout-header/src/layout-header.ts +2 -2
  279. package/packages/link/src/link.ts +2 -2
  280. package/packages/list/src/list.ts +2 -2
  281. package/packages/loading/src/loading.ts +2 -2
  282. package/packages/mention/src/mention.ts +2 -2
  283. package/packages/menu/src/menu.ts +2 -2
  284. package/packages/modal/src/modal.ts +5 -20
  285. package/packages/notice-bar/src/notice-bar.ts +2 -2
  286. package/packages/number-input/src/number-input.ts +3 -17
  287. package/packages/pager/src/pager.ts +2 -2
  288. package/packages/password-input/src/password-input.ts +2 -2
  289. package/packages/print/src/page-break.ts +2 -2
  290. package/packages/print/src/print.ts +2 -2
  291. package/packages/pulldown/src/pulldown.ts +2 -2
  292. package/packages/radio/src/button.ts +3 -16
  293. package/packages/radio/src/group.ts +3 -17
  294. package/packages/radio/src/radio.ts +2 -2
  295. package/packages/rate/src/rate.ts +2 -2
  296. package/packages/result/src/result.ts +2 -2
  297. package/packages/row/src/col.ts +2 -2
  298. package/packages/row/src/row.ts +2 -2
  299. package/packages/scrollbar/src/scrollbar.ts +3 -4
  300. package/packages/segmented/src/segmented.ts +2 -2
  301. package/packages/select/src/optgroup.ts +2 -2
  302. package/packages/select/src/option.ts +2 -2
  303. package/packages/select/src/select.ts +33 -19
  304. package/packages/slider/src/slider.ts +2 -2
  305. package/packages/space/src/space.ts +2 -2
  306. package/packages/splitter/src/splitter-panel.ts +2 -2
  307. package/packages/splitter/src/splitter.ts +2 -2
  308. package/packages/step-item/index.ts +16 -0
  309. package/packages/steps/src/step-info.ts +18 -0
  310. package/packages/steps/src/step-item.ts +41 -0
  311. package/packages/steps/src/steps.ts +273 -13
  312. package/packages/steps/src/util.ts +44 -0
  313. package/packages/switch/src/switch.ts +2 -2
  314. package/packages/table-select/src/table-select.ts +2 -2
  315. package/packages/table-transfer/src/table-transfer.ts +3 -15
  316. package/packages/tabs/src/tab-pane.ts +2 -2
  317. package/packages/tabs/src/tabs.ts +2 -2
  318. package/packages/tag/src/tag.ts +2 -2
  319. package/packages/text/src/text.ts +2 -2
  320. package/packages/text-ellipsis/src/text-ellipsis.ts +2 -2
  321. package/packages/textarea/src/textarea.ts +2 -2
  322. package/packages/timeline/src/timeline-info.ts +17 -17
  323. package/packages/timeline/src/timeline.ts +93 -49
  324. package/packages/timeline/src/util.ts +44 -41
  325. package/packages/tip/src/tip.ts +2 -2
  326. package/packages/tooltip/src/tooltip.ts +2 -2
  327. package/packages/tour/src/tour.ts +2 -2
  328. package/packages/transfer/src/transfer.ts +2 -2
  329. package/packages/tree/src/tree.ts +2 -2
  330. package/packages/tree-select/src/tree-select.ts +2 -2
  331. package/packages/ui/index.ts +8 -1
  332. package/packages/upload/src/upload.ts +2 -2
  333. package/packages/watermark/src/watermark.ts +2 -2
  334. package/styles/all.scss +1 -0
  335. package/styles/components/step-item.scss +0 -0
  336. package/styles/components/steps.scss +354 -0
  337. package/styles/theme/base.scss +9 -0
  338. package/types/all.d.ts +3 -0
  339. package/types/components/gantt.d.ts +1 -3
  340. package/types/components/select.d.ts +1 -13
  341. package/types/components/step-item.d.ts +72 -0
  342. package/types/components/steps.d.ts +67 -8
  343. package/types/components/table.d.ts +7 -66
  344. package/types/handles/form-design.d.ts +1 -4
  345. package/types/ui/global-config.d.ts +2 -0
  346. package/types/ui/global-icon.d.ts +7 -0
  347. /package/dist/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  348. /package/dist/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  349. /package/dist/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  350. /package/es/icon/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  351. /package/es/icon/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  352. /package/es/icon/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  353. /package/es/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  354. /package/es/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  355. /package/es/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  356. /package/es/vxe-icon/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  357. /package/es/vxe-icon/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  358. /package/es/vxe-icon/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  359. /package/lib/icon/style/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  360. /package/lib/icon/style/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  361. /package/lib/icon/style/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  362. /package/lib/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  363. /package/lib/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  364. /package/lib/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
  365. /package/lib/vxe-icon/style/{iconfont.1793330162657.ttf → iconfont.1793359478136.ttf} +0 -0
  366. /package/lib/vxe-icon/style/{iconfont.1793330162657.woff → iconfont.1793359478136.woff} +0 -0
  367. /package/lib/vxe-icon/style/{iconfont.1793330162657.woff2 → iconfont.1793359478136.woff2} +0 -0
@@ -6,423 +6,426 @@ import { toCssUnit } from "../../ui/src/dom";
6
6
  import VxeLoadingComponent from "../../loading";
7
7
  import XEUtils from "xe-utils";
8
8
  const { getConfig, getIcon, createEvent, renderEmptyElement } = VxeUI;
9
- var carousel_default = defineVxeComponent({
10
- name: "VxeCarousel",
11
- props: {
12
- modelValue: [String, Number],
13
- options: Array,
14
- loading: Boolean,
15
- height: {
16
- type: [Number, String],
17
- default: () => getConfig().carousel.height
18
- },
19
- width: {
20
- type: [Number, String],
21
- default: () => getConfig().carousel.width
22
- },
23
- autoPlay: {
24
- type: Boolean,
25
- default: () => getConfig().carousel.autoPlay
26
- },
27
- interval: {
28
- type: [Number, String],
29
- default: () => getConfig().carousel.interval
30
- },
31
- loop: {
32
- type: Boolean,
33
- default: () => getConfig().carousel.loop
34
- },
35
- vertical: {
36
- type: Boolean,
37
- default: () => getConfig().carousel.vertical
38
- },
39
- showIndicators: {
40
- type: Boolean,
41
- default: () => getConfig().carousel.showIndicators
42
- }
43
- },
44
- emits: ["update:modelValue", "change"],
45
- setup(props, context) {
46
- const { emit, slots } = context;
47
- const xID = XEUtils.uniqueId();
48
- const refElem = ref();
49
- const refWrapperElem = ref();
50
- const reactData = reactive({
51
- activeName: "",
52
- staticItems: [],
53
- itemWidth: 0,
54
- itemHeight: 0
55
- });
56
- const internalData = {
57
- apTimeout: void 0,
58
- stopFlag: false
59
- };
60
- const refMaps = {
61
- refElem
62
- };
63
- const computeListStyle = computed(() => {
64
- const { vertical, options } = props;
65
- const { activeName, itemWidth, itemHeight, staticItems } = reactData;
66
- const list = (staticItems && staticItems.length ? staticItems : options) || [];
67
- const activeIndex = Math.max(
68
- 0,
69
- XEUtils.findIndexOf(list, (item) => item.name === activeName)
70
- );
71
- const stys = {};
72
- if (vertical) {
73
- stys.transform = `translateY(-${activeIndex * itemHeight}px)`;
74
- } else {
75
- stys.width = `${itemWidth * list.length}px`;
76
- stys.transform = `translateX(-${activeIndex * itemWidth}px)`;
9
+ var carousel_default = (
10
+ /* define-vxe-component start */
11
+ defineVxeComponent({
12
+ name: "VxeCarousel",
13
+ props: {
14
+ modelValue: [String, Number],
15
+ options: Array,
16
+ loading: Boolean,
17
+ height: {
18
+ type: [Number, String],
19
+ default: () => getConfig().carousel.height
20
+ },
21
+ width: {
22
+ type: [Number, String],
23
+ default: () => getConfig().carousel.width
24
+ },
25
+ autoPlay: {
26
+ type: Boolean,
27
+ default: () => getConfig().carousel.autoPlay
28
+ },
29
+ interval: {
30
+ type: [Number, String],
31
+ default: () => getConfig().carousel.interval
32
+ },
33
+ loop: {
34
+ type: Boolean,
35
+ default: () => getConfig().carousel.loop
36
+ },
37
+ vertical: {
38
+ type: Boolean,
39
+ default: () => getConfig().carousel.vertical
40
+ },
41
+ showIndicators: {
42
+ type: Boolean,
43
+ default: () => getConfig().carousel.showIndicators
77
44
  }
78
- return stys;
79
- });
80
- const computeMaps = {};
81
- const $xeCarousel = {
82
- xID,
83
- props,
84
- context,
85
- reactData,
86
- internalData,
87
- getRefMaps: () => refMaps,
88
- getComputeMaps: () => computeMaps
89
- };
90
- const updateStyle = () => {
91
- nextTick(() => {
92
- const wrapperElem = refWrapperElem.value;
93
- if (wrapperElem) {
94
- reactData.itemWidth = wrapperElem.clientWidth;
95
- reactData.itemHeight = wrapperElem.clientHeight;
45
+ },
46
+ emits: ["update:modelValue", "change"],
47
+ setup(props, context) {
48
+ const { emit, slots } = context;
49
+ const xID = XEUtils.uniqueId();
50
+ const refElem = ref();
51
+ const refWrapperElem = ref();
52
+ const reactData = reactive({
53
+ activeName: "",
54
+ staticItems: [],
55
+ itemWidth: 0,
56
+ itemHeight: 0
57
+ });
58
+ const internalData = {
59
+ apTimeout: void 0,
60
+ stopFlag: false
61
+ };
62
+ const refMaps = {
63
+ refElem
64
+ };
65
+ const computeListStyle = computed(() => {
66
+ const { vertical, options } = props;
67
+ const { activeName, itemWidth, itemHeight, staticItems } = reactData;
68
+ const list = (staticItems && staticItems.length ? staticItems : options) || [];
69
+ const activeIndex = Math.max(
70
+ 0,
71
+ XEUtils.findIndexOf(list, (item) => item.name === activeName)
72
+ );
73
+ const stys = {};
74
+ if (vertical) {
75
+ stys.transform = `translateY(-${activeIndex * itemHeight}px)`;
76
+ } else {
77
+ stys.width = `${itemWidth * list.length}px`;
78
+ stys.transform = `translateX(-${activeIndex * itemWidth}px)`;
96
79
  }
80
+ return stys;
97
81
  });
98
- };
99
- const clickItemEvent = (evnt, item) => {
100
- const value = item.name;
101
- reactData.activeName = item.name;
102
- emit("update:modelValue", value);
103
- emit("change", { value }, evnt);
104
- updateStyle();
105
- };
106
- const initDefaultActive = (list) => {
107
- let activeName = null;
108
- if (list && list.length) {
109
- let validVal = false;
110
- activeName = props.modelValue;
111
- list.forEach((item) => {
112
- if (activeName === item.name) {
113
- validVal = true;
82
+ const computeMaps = {};
83
+ const $xeCarousel = {
84
+ xID,
85
+ props,
86
+ context,
87
+ reactData,
88
+ internalData,
89
+ getRefMaps: () => refMaps,
90
+ getComputeMaps: () => computeMaps
91
+ };
92
+ const updateStyle = () => {
93
+ nextTick(() => {
94
+ const wrapperElem = refWrapperElem.value;
95
+ if (wrapperElem) {
96
+ reactData.itemWidth = wrapperElem.clientWidth;
97
+ reactData.itemHeight = wrapperElem.clientHeight;
114
98
  }
115
99
  });
116
- if (!validVal) {
117
- activeName = list[0].name;
118
- emit("update:modelValue", activeName);
119
- }
120
- }
121
- reactData.activeName = activeName;
122
- };
123
- const dispatchEvent = (type, params, evnt) => {
124
- emit(type, createEvent(evnt, { $carousel: $xeCarousel }, params));
125
- };
126
- const handlePrevNext = (isNext) => {
127
- const { options, loop } = props;
128
- const { activeName, staticItems } = reactData;
129
- const list = (staticItems && staticItems.length ? staticItems : options) || [];
130
- const index = Math.max(
131
- 0,
132
- XEUtils.findIndexOf(list, (item) => item.name === activeName)
133
- );
134
- if (index > -1) {
135
- let item = null;
136
- if (isNext) {
137
- if (index < list.length - 1) {
138
- item = list[index + 1];
139
- } else {
140
- if (loop) {
141
- item = list[0];
100
+ };
101
+ const clickItemEvent = (evnt, item) => {
102
+ const value = item.name;
103
+ reactData.activeName = item.name;
104
+ emit("update:modelValue", value);
105
+ emit("change", { value }, evnt);
106
+ updateStyle();
107
+ };
108
+ const initDefaultActive = (list) => {
109
+ let activeName = null;
110
+ if (list && list.length) {
111
+ let validVal = false;
112
+ activeName = props.modelValue;
113
+ list.forEach((item) => {
114
+ if (activeName === item.name) {
115
+ validVal = true;
142
116
  }
117
+ });
118
+ if (!validVal) {
119
+ activeName = list[0].name;
120
+ emit("update:modelValue", activeName);
143
121
  }
144
- } else {
145
- if (index > 0) {
146
- item = list[index - 1];
122
+ }
123
+ reactData.activeName = activeName;
124
+ };
125
+ const dispatchEvent = (type, params, evnt) => {
126
+ emit(type, createEvent(evnt, { $carousel: $xeCarousel }, params));
127
+ };
128
+ const handlePrevNext = (isNext) => {
129
+ const { options, loop } = props;
130
+ const { activeName, staticItems } = reactData;
131
+ const list = (staticItems && staticItems.length ? staticItems : options) || [];
132
+ const index = Math.max(
133
+ 0,
134
+ XEUtils.findIndexOf(list, (item) => item.name === activeName)
135
+ );
136
+ if (index > -1) {
137
+ let item = null;
138
+ if (isNext) {
139
+ if (index < list.length - 1) {
140
+ item = list[index + 1];
141
+ } else {
142
+ if (loop) {
143
+ item = list[0];
144
+ }
145
+ }
147
146
  } else {
148
- if (loop) {
149
- item = list[list.length - 1];
147
+ if (index > 0) {
148
+ item = list[index - 1];
149
+ } else {
150
+ if (loop) {
151
+ item = list[list.length - 1];
152
+ }
150
153
  }
151
154
  }
155
+ if (item) {
156
+ const name = item.name;
157
+ const value = name;
158
+ reactData.activeName = name;
159
+ emit("update:modelValue", value);
160
+ return true;
161
+ }
152
162
  }
153
- if (item) {
154
- const name = item.name;
155
- const value = name;
156
- reactData.activeName = name;
157
- emit("update:modelValue", value);
158
- return true;
163
+ return false;
164
+ };
165
+ const carouselMethods = {
166
+ dispatchEvent,
167
+ prev() {
168
+ if (handlePrevNext(false)) {
169
+ handleAutoPlay();
170
+ }
171
+ return nextTick();
172
+ },
173
+ next() {
174
+ if (handlePrevNext(true)) {
175
+ handleAutoPlay();
176
+ }
177
+ return nextTick();
159
178
  }
160
- }
161
- return false;
162
- };
163
- const carouselMethods = {
164
- dispatchEvent,
165
- prev() {
179
+ };
180
+ const prevEvent = (evnt) => {
166
181
  if (handlePrevNext(false)) {
167
- handleAutoPlay();
182
+ const value = reactData.activeName;
183
+ emit("change", { value }, evnt);
168
184
  }
169
- return nextTick();
170
- },
171
- next() {
185
+ };
186
+ const nextEvent = (evnt) => {
172
187
  if (handlePrevNext(true)) {
173
- handleAutoPlay();
188
+ const value = reactData.activeName;
189
+ emit("change", { value }, evnt);
174
190
  }
175
- return nextTick();
176
- }
177
- };
178
- const prevEvent = (evnt) => {
179
- if (handlePrevNext(false)) {
180
- const value = reactData.activeName;
181
- emit("change", { value }, evnt);
182
- }
183
- };
184
- const nextEvent = (evnt) => {
185
- if (handlePrevNext(true)) {
186
- const value = reactData.activeName;
187
- emit("change", { value }, evnt);
188
- }
189
- };
190
- const stopAutoPlay = () => {
191
- const { apTimeout } = internalData;
192
- internalData.stopFlag = true;
193
- if (apTimeout) {
194
- clearTimeout(apTimeout);
195
- internalData.apTimeout = void 0;
196
- }
197
- };
198
- const handleAutoPlay = () => {
199
- const { autoPlay, interval } = props;
200
- const { stopFlag } = internalData;
201
- stopAutoPlay();
202
- if (autoPlay) {
203
- internalData.stopFlag = false;
204
- internalData.apTimeout = setTimeout(
205
- () => {
206
- if (!stopFlag) {
207
- handlePrevNext(true);
208
- }
209
- },
210
- XEUtils.toNumber(interval) || 300
211
- );
212
- }
213
- };
214
- const mouseenterEvent = () => {
215
- stopAutoPlay();
216
- };
217
- const mouseleaveEvent = () => {
218
- handleAutoPlay();
219
- };
220
- const carouselPrivateMethods = {};
221
- const callSlot = (slotFunc, params) => {
222
- if (slotFunc) {
223
- if (XEUtils.isString(slotFunc)) {
224
- slotFunc = slots[slotFunc] || null;
191
+ };
192
+ const stopAutoPlay = () => {
193
+ const { apTimeout } = internalData;
194
+ internalData.stopFlag = true;
195
+ if (apTimeout) {
196
+ clearTimeout(apTimeout);
197
+ internalData.apTimeout = void 0;
225
198
  }
226
- if (XEUtils.isFunction(slotFunc)) {
227
- return getSlotVNs(slotFunc(params));
199
+ };
200
+ const handleAutoPlay = () => {
201
+ const { autoPlay, interval } = props;
202
+ const { stopFlag } = internalData;
203
+ stopAutoPlay();
204
+ if (autoPlay) {
205
+ internalData.stopFlag = false;
206
+ internalData.apTimeout = setTimeout(
207
+ () => {
208
+ if (!stopFlag) {
209
+ handlePrevNext(true);
210
+ }
211
+ },
212
+ XEUtils.toNumber(interval) || 300
213
+ );
228
214
  }
229
- }
230
- return [];
231
- };
232
- Object.assign($xeCarousel, carouselMethods, carouselPrivateMethods);
233
- const renderItemWrapper = (list) => {
234
- const { height } = props;
235
- const { activeName } = reactData;
236
- const listStyle = computeListStyle.value;
237
- return h(
238
- "div",
239
- {
240
- class: "vxe-carousel--list",
241
- style: listStyle
242
- },
243
- list.map((item) => {
244
- const { name, url, slots: slots2 } = item;
245
- const defaultSlot = slots2 ? slots2.default : null;
246
- return h(
247
- "div",
248
- {
215
+ };
216
+ const mouseenterEvent = () => {
217
+ stopAutoPlay();
218
+ };
219
+ const mouseleaveEvent = () => {
220
+ handleAutoPlay();
221
+ };
222
+ const carouselPrivateMethods = {};
223
+ const callSlot = (slotFunc, params) => {
224
+ if (slotFunc) {
225
+ if (XEUtils.isString(slotFunc)) {
226
+ slotFunc = slots[slotFunc] || null;
227
+ }
228
+ if (XEUtils.isFunction(slotFunc)) {
229
+ return getSlotVNs(slotFunc(params));
230
+ }
231
+ }
232
+ return [];
233
+ };
234
+ Object.assign($xeCarousel, carouselMethods, carouselPrivateMethods);
235
+ const renderItemWrapper = (list) => {
236
+ const { height } = props;
237
+ const { activeName } = reactData;
238
+ const listStyle = computeListStyle.value;
239
+ return h(
240
+ "div",
241
+ {
242
+ class: "vxe-carousel--list",
243
+ style: listStyle
244
+ },
245
+ list.map((item) => {
246
+ const { name, url, slots: slots2 } = item;
247
+ const defaultSlot = slots2 ? slots2.default : null;
248
+ return h(
249
+ "div",
250
+ {
251
+ key: `${name}`,
252
+ class: [
253
+ "vxe-carousel--item-inner",
254
+ {
255
+ "is--active": activeName === name
256
+ }
257
+ ],
258
+ style: height ? {
259
+ height: toCssUnit(height)
260
+ } : null
261
+ },
262
+ defaultSlot ? callSlot(defaultSlot, {}) : [
263
+ h("img", {
264
+ class: "vxe-carousel--item-img",
265
+ src: url
266
+ })
267
+ ]
268
+ );
269
+ })
270
+ );
271
+ };
272
+ const renderIndicators = (list) => {
273
+ const { activeName } = reactData;
274
+ return h(
275
+ "div",
276
+ {
277
+ class: "vxe-carousel--indicators"
278
+ },
279
+ list.map((item) => {
280
+ const { name } = item;
281
+ return h("div", {
249
282
  key: `${name}`,
250
283
  class: [
251
- "vxe-carousel--item-inner",
284
+ "vxe-carousel--indicators-item",
252
285
  {
253
286
  "is--active": activeName === name
254
287
  }
255
288
  ],
256
- style: height ? {
257
- height: toCssUnit(height)
258
- } : null
259
- },
260
- defaultSlot ? callSlot(defaultSlot, {}) : [
261
- h("img", {
262
- class: "vxe-carousel--item-img",
263
- src: url
264
- })
265
- ]
266
- );
267
- })
268
- );
269
- };
270
- const renderIndicators = (list) => {
271
- const { activeName } = reactData;
272
- return h(
273
- "div",
274
- {
275
- class: "vxe-carousel--indicators"
276
- },
277
- list.map((item) => {
278
- const { name } = item;
279
- return h("div", {
280
- key: `${name}`,
281
- class: [
282
- "vxe-carousel--indicators-item",
283
- {
284
- "is--active": activeName === name
289
+ onClick(evnt) {
290
+ clickItemEvent(evnt, item);
285
291
  }
286
- ],
287
- onClick(evnt) {
288
- clickItemEvent(evnt, item);
289
- }
290
- });
291
- })
292
- );
293
- };
294
- const renderVN = () => {
295
- const { loading, height, width, showIndicators, vertical, options } = props;
296
- const { staticItems } = reactData;
297
- const defaultSlot = slots.default;
298
- const list = (staticItems && staticItems.length ? staticItems : options) || [];
299
- return h(
300
- "div",
301
- {
302
- ref: refElem,
303
- class: ["vxe-carousel", `is--${vertical ? "vertical" : "horizontal"}`],
304
- style: width ? {
305
- width: toCssUnit(width)
306
- } : null,
307
- onMouseenter: mouseenterEvent,
308
- onMouseleave: mouseleaveEvent
309
- },
310
- [
311
- h(
312
- "div",
313
- {
314
- class: "vxe-carousel--slots"
315
- },
316
- defaultSlot ? defaultSlot({}) : []
317
- ),
318
- h(
319
- "div",
320
- {
321
- ref: refWrapperElem,
322
- class: "vxe-carousel--item-wrapper",
323
- style: height ? {
324
- height: toCssUnit(height)
325
- } : null
326
- },
327
- [renderItemWrapper(list)]
328
- ),
329
- showIndicators ? renderIndicators(list) : renderEmptyElement($xeCarousel),
330
- h(
331
- "div",
332
- {
333
- class: "vxe-carousel--btn-wrapper"
334
- },
335
- [
336
- h(
337
- "div",
338
- {
339
- class: "vxe-carousel--previous-btn",
340
- onClick: prevEvent
341
- },
342
- [
343
- h("i", {
344
- class: vertical ? getIcon().CAROUSEL_VERTICAL_PREVIOUS : getIcon().CAROUSEL_HORIZONTAL_PREVIOUS
345
- })
346
- ]
347
- ),
348
- h(
349
- "div",
350
- {
351
- class: "vxe-carousel--next-btn",
352
- onClick: nextEvent
353
- },
354
- [
355
- h("i", {
356
- class: vertical ? getIcon().CAROUSEL_VERTICAL_NEXT : getIcon().CAROUSEL_HORIZONTAL_NEXT
357
- })
358
- ]
359
- )
360
- ]
361
- ),
362
- /**
363
- * 加载中
364
- */
365
- h(VxeLoadingComponent, {
366
- class: "vxe-carousel--loading",
367
- modelValue: loading
292
+ });
368
293
  })
369
- ]
294
+ );
295
+ };
296
+ const renderVN = () => {
297
+ const { loading, height, width, showIndicators, vertical, options } = props;
298
+ const { staticItems } = reactData;
299
+ const defaultSlot = slots.default;
300
+ const list = (staticItems && staticItems.length ? staticItems : options) || [];
301
+ return h(
302
+ "div",
303
+ {
304
+ ref: refElem,
305
+ class: ["vxe-carousel", `is--${vertical ? "vertical" : "horizontal"}`],
306
+ style: width ? {
307
+ width: toCssUnit(width)
308
+ } : null,
309
+ onMouseenter: mouseenterEvent,
310
+ onMouseleave: mouseleaveEvent
311
+ },
312
+ [
313
+ h(
314
+ "div",
315
+ {
316
+ class: "vxe-carousel--slots"
317
+ },
318
+ defaultSlot ? defaultSlot({}) : []
319
+ ),
320
+ h(
321
+ "div",
322
+ {
323
+ ref: refWrapperElem,
324
+ class: "vxe-carousel--item-wrapper",
325
+ style: height ? {
326
+ height: toCssUnit(height)
327
+ } : null
328
+ },
329
+ [renderItemWrapper(list)]
330
+ ),
331
+ showIndicators ? renderIndicators(list) : renderEmptyElement($xeCarousel),
332
+ h(
333
+ "div",
334
+ {
335
+ class: "vxe-carousel--btn-wrapper"
336
+ },
337
+ [
338
+ h(
339
+ "div",
340
+ {
341
+ class: "vxe-carousel--previous-btn",
342
+ onClick: prevEvent
343
+ },
344
+ [
345
+ h("i", {
346
+ class: vertical ? getIcon().CAROUSEL_VERTICAL_PREVIOUS : getIcon().CAROUSEL_HORIZONTAL_PREVIOUS
347
+ })
348
+ ]
349
+ ),
350
+ h(
351
+ "div",
352
+ {
353
+ class: "vxe-carousel--next-btn",
354
+ onClick: nextEvent
355
+ },
356
+ [
357
+ h("i", {
358
+ class: vertical ? getIcon().CAROUSEL_VERTICAL_NEXT : getIcon().CAROUSEL_HORIZONTAL_NEXT
359
+ })
360
+ ]
361
+ )
362
+ ]
363
+ ),
364
+ /**
365
+ * 加载中
366
+ */
367
+ h(VxeLoadingComponent, {
368
+ class: "vxe-carousel--loading",
369
+ modelValue: loading
370
+ })
371
+ ]
372
+ );
373
+ };
374
+ const optsFlag = ref(0);
375
+ watch(
376
+ () => props.options ? props.options.length : -1,
377
+ () => {
378
+ optsFlag.value++;
379
+ }
370
380
  );
371
- };
372
- const optsFlag = ref(0);
373
- watch(
374
- () => props.options ? props.options.length : -1,
375
- () => {
376
- optsFlag.value++;
377
- }
378
- );
379
- watch(
380
- () => props.options,
381
- () => {
382
- optsFlag.value++;
383
- }
384
- );
385
- watch(optsFlag, () => {
386
- initDefaultActive(props.options);
387
- });
388
- const stFlag = ref(0);
389
- watch(
390
- () => reactData.staticItems ? reactData.staticItems.length : -1,
391
- () => {
392
- stFlag.value++;
393
- }
394
- );
395
- watch(
396
- () => reactData.staticItems,
397
- () => {
398
- stFlag.value++;
399
- }
400
- );
401
- watch(stFlag, () => {
402
- initDefaultActive(reactData.staticItems);
403
- });
404
- watch(
405
- () => props.autoPlay,
406
- () => {
381
+ watch(
382
+ () => props.options,
383
+ () => {
384
+ optsFlag.value++;
385
+ }
386
+ );
387
+ watch(optsFlag, () => {
388
+ initDefaultActive(props.options);
389
+ });
390
+ const stFlag = ref(0);
391
+ watch(
392
+ () => reactData.staticItems ? reactData.staticItems.length : -1,
393
+ () => {
394
+ stFlag.value++;
395
+ }
396
+ );
397
+ watch(
398
+ () => reactData.staticItems,
399
+ () => {
400
+ stFlag.value++;
401
+ }
402
+ );
403
+ watch(stFlag, () => {
404
+ initDefaultActive(reactData.staticItems);
405
+ });
406
+ watch(
407
+ () => props.autoPlay,
408
+ () => {
409
+ handleAutoPlay();
410
+ }
411
+ );
412
+ initDefaultActive(reactData.staticItems.length ? reactData.staticItems : props.options);
413
+ onMounted(() => {
407
414
  handleAutoPlay();
408
- }
409
- );
410
- initDefaultActive(reactData.staticItems.length ? reactData.staticItems : props.options);
411
- onMounted(() => {
412
- handleAutoPlay();
413
- updateStyle();
414
- });
415
- onUnmounted(() => {
416
- stopAutoPlay();
417
- });
418
- provide("$xeCarousel", $xeCarousel);
419
- $xeCarousel.renderVN = renderVN;
420
- return $xeCarousel;
421
- },
422
- render() {
423
- return this.renderVN();
424
- }
425
- });
415
+ updateStyle();
416
+ });
417
+ onUnmounted(() => {
418
+ stopAutoPlay();
419
+ });
420
+ provide("$xeCarousel", $xeCarousel);
421
+ $xeCarousel.renderVN = renderVN;
422
+ return $xeCarousel;
423
+ },
424
+ render() {
425
+ return this.renderVN();
426
+ }
427
+ })
428
+ );
426
429
  export {
427
430
  carousel_default as default
428
431
  };