vue-devui 1.0.0-alpha.4 → 1.0.0-beta.10

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 (346) hide show
  1. package/accordion/index.d.ts +7 -0
  2. package/accordion/index.es.js +237 -1
  3. package/accordion/index.umd.js +1 -1
  4. package/accordion/style.css +1 -1
  5. package/alert/index.d.ts +7 -0
  6. package/alert/index.es.js +175 -1
  7. package/alert/index.umd.js +1 -1
  8. package/alert/style.css +1 -1
  9. package/anchor/index.d.ts +7 -0
  10. package/anchor/index.es.js +263 -1
  11. package/anchor/index.umd.js +1 -1
  12. package/avatar/index.d.ts +7 -0
  13. package/avatar/index.es.js +301 -1
  14. package/avatar/index.umd.js +1 -1
  15. package/back-top/index.d.ts +7 -0
  16. package/back-top/index.es.js +128 -0
  17. package/back-top/index.umd.js +1 -0
  18. package/back-top/package.json +7 -0
  19. package/back-top/style.css +1 -0
  20. package/badge/index.d.ts +7 -0
  21. package/badge/index.es.js +95 -1
  22. package/badge/index.umd.js +1 -1
  23. package/breadcrumb/index.d.ts +7 -0
  24. package/breadcrumb/index.es.js +127 -1
  25. package/breadcrumb/index.umd.js +1 -1
  26. package/breadcrumb/style.css +1 -1
  27. package/button/index.d.ts +7 -0
  28. package/button/index.es.js +190 -1
  29. package/button/index.umd.js +1 -1
  30. package/card/index.d.ts +7 -0
  31. package/card/index.es.js +61 -1
  32. package/card/index.umd.js +1 -1
  33. package/carousel/index.d.ts +7 -0
  34. package/carousel/index.es.js +329 -1
  35. package/carousel/index.umd.js +1 -1
  36. package/cascader/index.d.ts +7 -0
  37. package/cascader/index.es.js +1343 -1
  38. package/cascader/index.umd.js +1 -1
  39. package/cascader/style.css +1 -1
  40. package/checkbox/index.d.ts +7 -0
  41. package/checkbox/index.es.js +377 -1
  42. package/checkbox/index.umd.js +1 -1
  43. package/comment/index.d.ts +7 -0
  44. package/comment/index.es.js +85 -0
  45. package/comment/index.umd.js +1 -0
  46. package/comment/package.json +7 -0
  47. package/comment/style.css +1 -0
  48. package/countdown/index.d.ts +7 -0
  49. package/countdown/index.es.js +176 -0
  50. package/countdown/index.umd.js +1 -0
  51. package/countdown/package.json +7 -0
  52. package/countdown/style.css +1 -0
  53. package/date-picker/index.d.ts +7 -0
  54. package/date-picker/index.es.js +1172 -1
  55. package/date-picker/index.umd.js +1 -1
  56. package/date-picker/style.css +1 -1
  57. package/dragdrop/index.d.ts +7 -0
  58. package/dragdrop/index.es.js +32 -0
  59. package/dragdrop/index.umd.js +1 -0
  60. package/dragdrop/package.json +7 -0
  61. package/drawer/index.d.ts +7 -0
  62. package/drawer/index.es.js +288 -0
  63. package/drawer/index.umd.js +1 -0
  64. package/drawer/package.json +7 -0
  65. package/drawer/style.css +1 -0
  66. package/dropdown/index.d.ts +7 -0
  67. package/dropdown/index.es.js +527 -0
  68. package/dropdown/index.umd.js +1 -0
  69. package/dropdown/package.json +7 -0
  70. package/dropdown/style.css +1 -0
  71. package/editable-select/index.d.ts +7 -0
  72. package/editable-select/index.es.js +5793 -1
  73. package/editable-select/index.umd.js +27 -1
  74. package/editable-select/style.css +1 -1
  75. package/form/index.d.ts +7 -0
  76. package/form/index.es.js +2244 -0
  77. package/form/index.umd.js +1 -0
  78. package/form/package.json +7 -0
  79. package/form/style.css +1 -0
  80. package/fullscreen/index.d.ts +7 -0
  81. package/fullscreen/index.es.js +163 -1
  82. package/fullscreen/index.umd.js +1 -1
  83. package/gantt/index.d.ts +7 -0
  84. package/gantt/index.es.js +535 -0
  85. package/gantt/index.umd.js +1 -0
  86. package/gantt/package.json +7 -0
  87. package/gantt/style.css +1 -0
  88. package/grid/index.d.ts +7 -0
  89. package/grid/index.es.js +269 -0
  90. package/grid/index.umd.js +1 -0
  91. package/grid/package.json +7 -0
  92. package/grid/style.css +1 -0
  93. package/icon/index.d.ts +7 -0
  94. package/icon/index.es.js +75 -1
  95. package/icon/index.umd.js +1 -1
  96. package/image-preview/index.d.ts +7 -0
  97. package/image-preview/index.es.js +480 -1
  98. package/image-preview/index.umd.js +1 -1
  99. package/image-preview/style.css +1 -1
  100. package/index.d.ts +7 -0
  101. package/input/index.d.ts +7 -0
  102. package/input/index.es.js +190 -1
  103. package/input/index.umd.js +1 -1
  104. package/input-icon/index.d.ts +7 -0
  105. package/input-icon/index.es.js +332 -0
  106. package/input-icon/index.umd.js +1 -0
  107. package/input-icon/package.json +7 -0
  108. package/input-icon/style.css +1 -0
  109. package/input-number/index.d.ts +7 -0
  110. package/input-number/index.es.js +240 -1
  111. package/input-number/index.umd.js +1 -1
  112. package/input-number/style.css +1 -1
  113. package/layout/index.d.ts +7 -0
  114. package/layout/index.es.js +100 -0
  115. package/layout/index.umd.js +1 -0
  116. package/layout/package.json +7 -0
  117. package/layout/style.css +1 -0
  118. package/loading/index.d.ts +7 -0
  119. package/loading/index.es.js +256 -1
  120. package/loading/index.umd.js +1 -1
  121. package/modal/index.d.ts +7 -0
  122. package/modal/index.es.js +1027 -1
  123. package/modal/index.umd.js +1 -1
  124. package/modal/style.css +1 -1
  125. package/nav-sprite/index.d.ts +7 -0
  126. package/nav-sprite/index.es.js +742 -0
  127. package/nav-sprite/index.umd.js +1 -0
  128. package/nav-sprite/package.json +7 -0
  129. package/nuxt/components/Accordion.js +3 -0
  130. package/nuxt/components/Alert.js +3 -0
  131. package/nuxt/components/Anchor.js +3 -0
  132. package/nuxt/components/Aside.js +3 -0
  133. package/nuxt/components/Avatar.js +3 -0
  134. package/nuxt/components/BackTop.js +3 -0
  135. package/nuxt/components/Badge.js +3 -0
  136. package/nuxt/components/Breadcrumb.js +3 -0
  137. package/nuxt/components/Button.js +3 -0
  138. package/nuxt/components/Card.js +3 -0
  139. package/nuxt/components/Carousel.js +3 -0
  140. package/nuxt/components/Cascader.js +3 -0
  141. package/nuxt/components/Checkbox.js +3 -0
  142. package/nuxt/components/Col.js +3 -0
  143. package/nuxt/components/Column.js +3 -0
  144. package/nuxt/components/Comment.js +3 -0
  145. package/nuxt/components/Content.js +3 -0
  146. package/nuxt/components/Countdown.js +3 -0
  147. package/nuxt/components/DatePicker.js +3 -0
  148. package/nuxt/components/Drawer.js +3 -0
  149. package/nuxt/components/Dropdown.js +3 -0
  150. package/nuxt/components/EditableSelect.js +3 -0
  151. package/nuxt/components/FixedOverlay.js +3 -0
  152. package/nuxt/components/FlexibleOverlay.js +3 -0
  153. package/nuxt/components/Footer.js +3 -0
  154. package/nuxt/components/Form.js +3 -0
  155. package/nuxt/components/FormControl.js +3 -0
  156. package/nuxt/components/FormItem.js +3 -0
  157. package/nuxt/components/FormLabel.js +3 -0
  158. package/nuxt/components/FormOperation.js +3 -0
  159. package/nuxt/components/Fullscreen.js +3 -0
  160. package/nuxt/components/Gantt.js +3 -0
  161. package/nuxt/components/Header.js +3 -0
  162. package/nuxt/components/Icon.js +2 -0
  163. package/nuxt/components/ImagePreviewService.js +3 -0
  164. package/nuxt/components/Input.js +3 -0
  165. package/nuxt/components/InputIcon.js +3 -0
  166. package/nuxt/components/InputNumber.js +3 -0
  167. package/nuxt/components/Layout.js +3 -0
  168. package/nuxt/components/Loading.js +3 -0
  169. package/nuxt/components/LoadingService.js +3 -0
  170. package/nuxt/components/Modal.js +3 -0
  171. package/nuxt/components/MultiUpload.js +3 -0
  172. package/nuxt/components/NavSprite.js +2 -0
  173. package/nuxt/components/Pagination.js +3 -0
  174. package/nuxt/components/Panel.js +3 -0
  175. package/nuxt/components/Popover.js +3 -0
  176. package/nuxt/components/Progress.js +3 -0
  177. package/nuxt/components/QuadrantDiagram.js +3 -0
  178. package/nuxt/components/Radio.js +3 -0
  179. package/nuxt/components/RadioGroup.js +3 -0
  180. package/nuxt/components/Rate.js +3 -0
  181. package/nuxt/components/ReadTip.js +3 -0
  182. package/nuxt/components/Result.js +3 -0
  183. package/nuxt/components/Row.js +3 -0
  184. package/nuxt/components/Search.js +3 -0
  185. package/nuxt/components/Select.js +3 -0
  186. package/nuxt/components/Skeleton.js +3 -0
  187. package/nuxt/components/SkeletonItem.js +3 -0
  188. package/nuxt/components/Slider.js +3 -0
  189. package/nuxt/components/Splitter.js +3 -0
  190. package/nuxt/components/Statistic.js +3 -0
  191. package/nuxt/components/Status.js +3 -0
  192. package/nuxt/components/StepsGuide.js +3 -0
  193. package/nuxt/components/StickSlider.js +3 -0
  194. package/nuxt/components/Sticky.js +2 -0
  195. package/nuxt/components/Switch.js +3 -0
  196. package/nuxt/components/Table.js +3 -0
  197. package/nuxt/components/Tabs.js +3 -0
  198. package/nuxt/components/Tag.js +3 -0
  199. package/nuxt/components/TagInput.js +3 -0
  200. package/nuxt/components/Textarea.js +3 -0
  201. package/nuxt/components/TimeAxis.js +3 -0
  202. package/nuxt/components/TimeAxisItem.js +3 -0
  203. package/nuxt/components/TimePicker.js +3 -0
  204. package/nuxt/components/Toast.js +3 -0
  205. package/nuxt/components/ToastService.js +3 -0
  206. package/nuxt/components/Tooltip.js +3 -0
  207. package/nuxt/components/Transfer.js +3 -0
  208. package/nuxt/components/Tree.js +3 -0
  209. package/nuxt/components/TreeSelect.js +3 -0
  210. package/nuxt/components/Upload.js +3 -0
  211. package/nuxt/components/buttonProps.js +3 -0
  212. package/nuxt/index.js +13 -0
  213. package/overlay/index.d.ts +7 -0
  214. package/overlay/index.es.js +368 -1
  215. package/overlay/index.umd.js +1 -1
  216. package/overlay/style.css +1 -1
  217. package/package.json +8 -33
  218. package/pagination/index.d.ts +7 -0
  219. package/pagination/index.es.js +642 -1
  220. package/pagination/index.umd.js +1 -1
  221. package/panel/index.d.ts +7 -0
  222. package/panel/index.es.js +205 -1
  223. package/panel/index.umd.js +1 -1
  224. package/panel/style.css +1 -1
  225. package/popover/index.d.ts +7 -0
  226. package/popover/index.es.js +236 -1
  227. package/popover/index.umd.js +1 -1
  228. package/popover/style.css +1 -1
  229. package/progress/index.d.ts +7 -0
  230. package/progress/index.es.js +153 -1
  231. package/progress/index.umd.js +3 -1
  232. package/quadrant-diagram/index.d.ts +7 -0
  233. package/quadrant-diagram/index.es.js +489 -1
  234. package/quadrant-diagram/index.umd.js +1 -1
  235. package/radio/index.d.ts +7 -0
  236. package/radio/index.es.js +225 -1
  237. package/radio/index.umd.js +1 -1
  238. package/rate/index.d.ts +7 -0
  239. package/rate/index.es.js +220 -1
  240. package/rate/index.umd.js +1 -1
  241. package/read-tip/index.d.ts +7 -0
  242. package/read-tip/index.es.js +258 -0
  243. package/read-tip/index.umd.js +1 -0
  244. package/read-tip/package.json +7 -0
  245. package/read-tip/style.css +1 -0
  246. package/result/index.d.ts +7 -0
  247. package/result/index.es.js +119 -0
  248. package/result/index.umd.js +1 -0
  249. package/result/package.json +7 -0
  250. package/result/style.css +1 -0
  251. package/ripple/index.d.ts +7 -0
  252. package/ripple/index.es.js +181 -1
  253. package/ripple/index.umd.js +1 -1
  254. package/search/index.d.ts +7 -0
  255. package/search/index.es.js +543 -1
  256. package/search/index.umd.js +1 -1
  257. package/select/index.d.ts +7 -0
  258. package/select/index.es.js +706 -1
  259. package/select/index.umd.js +1 -1
  260. package/skeleton/index.d.ts +7 -0
  261. package/skeleton/index.es.js +297 -1
  262. package/skeleton/index.umd.js +1 -1
  263. package/skeleton/style.css +1 -1
  264. package/slider/index.d.ts +7 -0
  265. package/slider/index.es.js +199 -1
  266. package/slider/index.umd.js +1 -1
  267. package/slider/style.css +1 -1
  268. package/splitter/index.d.ts +7 -0
  269. package/splitter/index.es.js +636 -1
  270. package/splitter/index.umd.js +1 -1
  271. package/statistic/index.d.ts +7 -0
  272. package/statistic/index.es.js +280 -0
  273. package/statistic/index.umd.js +1 -0
  274. package/statistic/package.json +7 -0
  275. package/statistic/style.css +1 -0
  276. package/status/index.d.ts +7 -0
  277. package/status/index.es.js +42 -1
  278. package/status/index.umd.js +1 -1
  279. package/steps-guide/index.d.ts +7 -0
  280. package/steps-guide/index.es.js +239 -1
  281. package/steps-guide/index.umd.js +1 -1
  282. package/steps-guide/style.css +1 -1
  283. package/sticky/index.d.ts +7 -0
  284. package/sticky/index.es.js +197 -1
  285. package/sticky/index.umd.js +1 -1
  286. package/style.css +1 -1
  287. package/switch/index.d.ts +7 -0
  288. package/switch/index.es.js +100 -1
  289. package/switch/index.umd.js +1 -1
  290. package/switch/style.css +1 -1
  291. package/table/index.d.ts +7 -0
  292. package/table/index.es.js +1626 -1
  293. package/table/index.umd.js +1 -1
  294. package/table/style.css +1 -1
  295. package/tabs/index.d.ts +7 -0
  296. package/tabs/index.es.js +195 -1
  297. package/tabs/index.umd.js +1 -1
  298. package/tabs/style.css +1 -1
  299. package/tag/index.d.ts +7 -0
  300. package/tag/index.es.js +131 -0
  301. package/tag/index.umd.js +1 -0
  302. package/tag/package.json +7 -0
  303. package/tag/style.css +1 -0
  304. package/tag-input/index.d.ts +7 -0
  305. package/tag-input/index.es.js +329 -1
  306. package/tag-input/index.umd.js +1 -1
  307. package/textarea/index.d.ts +7 -0
  308. package/textarea/index.es.js +132 -0
  309. package/textarea/index.umd.js +1 -0
  310. package/textarea/package.json +7 -0
  311. package/textarea/style.css +1 -0
  312. package/time-axis/index.d.ts +7 -0
  313. package/time-axis/index.es.js +299 -0
  314. package/time-axis/index.umd.js +1 -0
  315. package/time-axis/package.json +7 -0
  316. package/time-axis/style.css +1 -0
  317. package/time-picker/index.d.ts +7 -0
  318. package/time-picker/index.es.js +1053 -1
  319. package/time-picker/index.umd.js +1 -1
  320. package/time-picker/style.css +1 -1
  321. package/toast/index.d.ts +7 -0
  322. package/toast/index.es.js +2060 -1
  323. package/toast/index.umd.js +1 -1
  324. package/toast/style.css +1 -1
  325. package/tooltip/index.d.ts +7 -0
  326. package/tooltip/index.es.js +171 -1
  327. package/tooltip/index.umd.js +1 -1
  328. package/transfer/index.d.ts +7 -0
  329. package/transfer/index.es.js +1725 -1
  330. package/transfer/index.umd.js +1 -1
  331. package/transfer/style.css +1 -1
  332. package/tree/index.d.ts +7 -0
  333. package/tree/index.es.js +907 -1
  334. package/tree/index.umd.js +1 -1
  335. package/tree/style.css +1 -1
  336. package/tree-select/index.d.ts +7 -0
  337. package/tree-select/index.es.js +528 -0
  338. package/tree-select/index.umd.js +1 -0
  339. package/tree-select/package.json +7 -0
  340. package/tree-select/style.css +1 -0
  341. package/upload/index.d.ts +7 -0
  342. package/upload/index.es.js +3179 -1
  343. package/upload/index.umd.js +1 -1
  344. package/upload/style.css +1 -1
  345. package/vue-devui.es.js +27755 -1
  346. package/vue-devui.umd.js +29 -1
@@ -1 +1,190 @@
1
- var e=Object.defineProperty,t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,r=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o;"undefined"!=typeof require&&require;import{defineComponent as i,createVNode as l,ref as a,computed as u,mergeProps as s}from"vue";var d=i({name:"DIcon",props:{name:{type:String,required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}},setup:e=>((e,i)=>{for(var l in i||(i={}))n.call(i,l)&&r(e,l,i[l]);if(t)for(var l of t(i))o.call(i,l)&&r(e,l,i[l]);return e})({},e),render(){const{name:e,size:t,color:n,classPrefix:o}=this;return l("i",{class:`${o} ${o}-${e}`,style:{fontSize:t,color:n}},null)}});d.install=function(e){e.component(d.name,d)};const c={type:{type:String,default:"button"},btnStyle:{type:String,default:"primary"},size:{type:String,default:"md"},position:{type:String,default:"default"},bordered:{type:Boolean,default:!1},icon:{type:String,default:""},showLoading:{type:Boolean,default:!1},width:{type:String},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},onClick:{type:Function}};var p=i({name:"DButton",props:c,setup(e,t){const n=a(null),o=t=>{var n;e.showLoading||null==(n=e.onClick)||n.call(e,t)},r=u((()=>t.slots.default)),i=u((()=>{const{btnStyle:t,size:n,position:o,bordered:i,icon:l}=e;return`${`devui-btn devui-btn-${t} devui-btn-${n} devui-btn-${o}`} ${i?"bordered":""} ${l&&!r.value&&"primary"!==t?"d-btn-icon":""} ${l?"d-btn-icon-wrap":""}`})),c=u((()=>{if(!e.icon)return;const t="devui-icon-fix icon";return r.value?`${t} clear-right-5`:t}));return()=>{var r,a;const{icon:u,type:p,disabled:f,showLoading:y,width:b}=e;return l("div",s({class:"devui-btn-host"},t.attrs),[l("button",{class:i.value,type:p,disabled:f,style:{width:b},onClick:o},[u?l(d,{name:e.icon,class:c.value},null):null,l("span",{class:"button-content",ref:n},[null==(a=(r=t.slots).default)?void 0:a.call(r)])])])}}});p.install=function(e){e.component(p.name,p)};var f={title:"Button 按钮",category:"通用",install(e){e.use(p)}};export{p as Button,c as buttonProps,f as default};
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ import { defineComponent, createVNode, ref, computed, withDirectives, mergeProps, resolveDirective } from "vue";
18
+ var Icon = defineComponent({
19
+ name: "DIcon",
20
+ props: {
21
+ name: {
22
+ type: String,
23
+ required: true
24
+ },
25
+ size: {
26
+ type: String,
27
+ default: "inherit"
28
+ },
29
+ color: {
30
+ type: String,
31
+ default: "inherit"
32
+ },
33
+ classPrefix: {
34
+ type: String,
35
+ default: "icon"
36
+ }
37
+ },
38
+ setup(props) {
39
+ return __spreadValues({}, props);
40
+ },
41
+ render() {
42
+ const {
43
+ name,
44
+ size,
45
+ color,
46
+ classPrefix
47
+ } = this;
48
+ return /^((https?):)?\/\//.test(name) ? createVNode("img", {
49
+ "src": name,
50
+ "alt": name.split("/")[name.split("/").length - 1],
51
+ "style": {
52
+ width: size,
53
+ verticalAlign: "text-bottom"
54
+ }
55
+ }, null) : createVNode("i", {
56
+ "class": `${classPrefix} ${classPrefix}-${name}`,
57
+ "style": {
58
+ fontSize: size,
59
+ color
60
+ }
61
+ }, null);
62
+ }
63
+ });
64
+ Icon.install = function(app) {
65
+ app.component(Icon.name, Icon);
66
+ };
67
+ const buttonProps = {
68
+ type: {
69
+ type: String,
70
+ default: "button"
71
+ },
72
+ btnStyle: {
73
+ type: String,
74
+ default: "primary"
75
+ },
76
+ size: {
77
+ type: String,
78
+ default: "md"
79
+ },
80
+ position: {
81
+ type: String,
82
+ default: "default"
83
+ },
84
+ bordered: {
85
+ type: Boolean,
86
+ default: false
87
+ },
88
+ icon: {
89
+ type: String,
90
+ default: ""
91
+ },
92
+ showLoading: {
93
+ type: Boolean,
94
+ default: false
95
+ },
96
+ width: {
97
+ type: String
98
+ },
99
+ disabled: {
100
+ type: Boolean,
101
+ default: false
102
+ },
103
+ autofocus: {
104
+ type: Boolean,
105
+ default: false
106
+ },
107
+ onClick: {
108
+ type: Function
109
+ }
110
+ };
111
+ var button = "";
112
+ var Button = defineComponent({
113
+ name: "DButton",
114
+ props: buttonProps,
115
+ setup(props, ctx) {
116
+ const buttonContent = ref(null);
117
+ const onClick = (e) => {
118
+ var _a;
119
+ if (props.showLoading) {
120
+ return;
121
+ }
122
+ (_a = props.onClick) == null ? void 0 : _a.call(props, e);
123
+ };
124
+ const hasContent = computed(() => ctx.slots.default);
125
+ const btnClass = computed(() => {
126
+ const {
127
+ btnStyle,
128
+ size,
129
+ position,
130
+ bordered,
131
+ icon
132
+ } = props;
133
+ const origin = `devui-btn devui-btn-${btnStyle} devui-btn-${size} devui-btn-${position}`;
134
+ const borderedClass = bordered ? "bordered" : "";
135
+ const btnIcon = !!icon && !hasContent.value && btnStyle !== "primary" ? "d-btn-icon" : "";
136
+ const btnIconWrap = !!icon ? "d-btn-icon-wrap" : "";
137
+ return `${origin} ${borderedClass} ${btnIcon} ${btnIconWrap}`;
138
+ });
139
+ const iconClass = computed(() => {
140
+ if (!props.icon) {
141
+ return;
142
+ }
143
+ const origin = "devui-icon-fix icon";
144
+ if (hasContent.value) {
145
+ return `${origin} clear-right-5`;
146
+ } else {
147
+ return origin;
148
+ }
149
+ });
150
+ return () => {
151
+ var _a, _b;
152
+ const {
153
+ icon,
154
+ type,
155
+ disabled,
156
+ showLoading,
157
+ width
158
+ } = props;
159
+ return withDirectives(createVNode("div", mergeProps({
160
+ "class": "devui-btn-host"
161
+ }, ctx.attrs), [createVNode("button", {
162
+ "class": btnClass.value,
163
+ "type": type,
164
+ "disabled": disabled,
165
+ "style": {
166
+ width
167
+ },
168
+ "onClick": onClick
169
+ }, [!!icon ? createVNode(Icon, {
170
+ "name": icon,
171
+ "class": iconClass.value
172
+ }, null) : null, createVNode("span", {
173
+ "class": "button-content",
174
+ "ref": buttonContent
175
+ }, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])])]), [[resolveDirective("dLoading"), showLoading]]);
176
+ };
177
+ }
178
+ });
179
+ Button.install = function(app) {
180
+ app.component(Button.name, Button);
181
+ };
182
+ var index = {
183
+ title: "Button \u6309\u94AE",
184
+ category: "\u901A\u7528",
185
+ status: "100%",
186
+ install(app) {
187
+ app.use(Button);
188
+ }
189
+ };
190
+ export { Button, buttonProps, index as default };
@@ -1 +1 @@
1
- var __defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,o)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,__spreadValues=(e,t)=>{for(var o in t||(t={}))__hasOwnProp.call(t,o)&&__defNormalProp(e,o,t[o]);if(__getOwnPropSymbols)for(var o of __getOwnPropSymbols(t))__propIsEnum.call(t,o)&&__defNormalProp(e,o,t[o]);return e},__require="undefined"!=typeof require?require:e=>{throw new Error('Dynamic require of "'+e+'" is not supported')};!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).index={},e.Vue)}(this,(function(e,t){"use strict";var o=t.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:e=>__spreadValues({},e),render(){const{name:e,size:o,color:n,classPrefix:r}=this;return t.createVNode("i",{class:`${r} ${r}-${e}`,style:{fontSize:o,color:n}},null)}});o.install=function(e){e.component(o.name,o)};const n={type:{type:String,default:"button"},btnStyle:{type:String,default:"primary"},size:{type:String,default:"md"},position:{type:String,default:"default"},bordered:{type:Boolean,default:!1},icon:{type:String,default:""},showLoading:{type:Boolean,default:!1},width:{type:String},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},onClick:{type:Function}};var r=t.defineComponent({name:"DButton",props:n,setup(e,n){const r=t.ref(null),i=t=>{var o;e.showLoading||null==(o=e.onClick)||o.call(e,t)},l=t.computed((()=>n.slots.default)),a=t.computed((()=>{const{btnStyle:t,size:o,position:n,bordered:r,icon:i}=e;return`${`devui-btn devui-btn-${t} devui-btn-${o} devui-btn-${n}`} ${r?"bordered":""} ${i&&!l.value&&"primary"!==t?"d-btn-icon":""} ${i?"d-btn-icon-wrap":""}`})),u=t.computed((()=>{if(!e.icon)return;const t="devui-icon-fix icon";return l.value?`${t} clear-right-5`:t}));return()=>{var l,d;const{icon:s,type:p,disabled:c,showLoading:f,width:y}=e;return t.createVNode("div",t.mergeProps({class:"devui-btn-host"},n.attrs),[t.createVNode("button",{class:a.value,type:p,disabled:c,style:{width:y},onClick:i},[s?t.createVNode(o,{name:e.icon,class:u.value},null):null,t.createVNode("span",{class:"button-content",ref:r},[null==(d=(l=n.slots).default)?void 0:d.call(l)])])])}}});r.install=function(e){e.component(r.name,r)};var i={title:"Button 按钮",category:"通用",install(e){e.use(r)}};e.Button=r,e.buttonProps=n,e.default=i,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"}));
1
+ var B=Object.defineProperty;var m=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var h=(n,t,o)=>t in n?B(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o,S=(n,t)=>{for(var o in t||(t={}))V.call(t,o)&&h(n,o,t[o]);if(m)for(var o of m(t))N.call(t,o)&&h(n,o,t[o]);return n};(function(n,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(n=typeof globalThis!="undefined"?globalThis:n||self,t(n.index={},n.Vue))})(this,function(n,t){"use strict";var o=t.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(e){return S({},e)},render(){const{name:e,size:l,color:f,classPrefix:r}=this;return/^((https?):)?\/\//.test(e)?t.createVNode("img",{src:e,alt:e.split("/")[e.split("/").length-1],style:{width:l,verticalAlign:"text-bottom"}},null):t.createVNode("i",{class:`${r} ${r}-${e}`,style:{fontSize:l,color:f}},null)}});o.install=function(e){e.component(o.name,o)};const y={type:{type:String,default:"button"},btnStyle:{type:String,default:"primary"},size:{type:String,default:"md"},position:{type:String,default:"default"},bordered:{type:Boolean,default:!1},icon:{type:String,default:""},showLoading:{type:Boolean,default:!1},width:{type:String},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},onClick:{type:Function}};var P="",a=t.defineComponent({name:"DButton",props:y,setup(e,l){const f=t.ref(null),r=i=>{var s;e.showLoading||(s=e.onClick)==null||s.call(e,i)},g=t.computed(()=>l.slots.default),$=t.computed(()=>{const{btnStyle:i,size:s,position:p,bordered:b,icon:d}=e,u=`devui-btn devui-btn-${i} devui-btn-${s} devui-btn-${p}`,c=b?"bordered":"",w=!!d&&!g.value&&i!=="primary"?"d-btn-icon":"";return`${u} ${c} ${w} ${d?"d-btn-icon-wrap":""}`}),v=t.computed(()=>{if(!e.icon)return;const i="devui-icon-fix icon";return g.value?`${i} clear-right-5`:i});return()=>{var u,c;const{icon:i,type:s,disabled:p,showLoading:b,width:d}=e;return t.withDirectives(t.createVNode("div",t.mergeProps({class:"devui-btn-host"},l.attrs),[t.createVNode("button",{class:$.value,type:s,disabled:p,style:{width:d},onClick:r},[i?t.createVNode(o,{name:i,class:v.value},null):null,t.createVNode("span",{class:"button-content",ref:f},[(c=(u=l.slots).default)==null?void 0:c.call(u)])])]),[[t.resolveDirective("dLoading"),b]])}}});a.install=function(e){e.component(a.name,a)};var C={title:"Button \u6309\u94AE",category:"\u901A\u7528",status:"100%",install(e){e.use(a)}};n.Button=a,n.buttonProps=y,n.default=C,Object.defineProperty(n,"__esModule",{value:!0}),n[Symbol.toStringTag]="Module"});
@@ -0,0 +1,7 @@
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;
package/card/index.es.js CHANGED
@@ -1 +1,61 @@
1
- import{defineComponent as a,createVNode as l}from"vue";var t=a({name:"DCard",props:{align:{type:String,default:"start"},src:{type:String,default:""}},render(){var a,t,s,i,d,c,r,e,n,o,v,u,h,$;const{align:g,src:m}=this,p={"d-card-actions":!0,"devui-card-actions":!0,[`devui-card-actions-align-${g}`]:"start"!==g};return l("div",{class:"card-container devui-card"},[null==(t=(a=this.$slots).default)?void 0:t.call(a),l("div",{class:"devui-card-header"},[(null==(i=(s=this.$slots).cardAvatar)?void 0:i.call(s))?l("div",{class:"devui-card-avatar"},[null==(c=(d=this.$slots).cardAvatar)?void 0:c.call(d)]):"",l("div",{class:"devui-card-header-title-area"},[l("div",{class:"devui-card-title"},[null==(e=(r=this.$slots).cardTitle)?void 0:e.call(r)]),l("div",{class:"devui-card-subtitle"},[null==(o=(n=this.$slots).cardSubtitle)?void 0:o.call(n)])])]),""!==m?l("img",{src:m,alt:"",class:"devui-card-meta"},null):"",l("div",{class:"devui-card-content"},[null==(u=(v=this.$slots).cardContent)?void 0:u.call(v)]),l("div",{class:p},[this.$slots.cardActions?null==($=(h=this.$slots).cardActions)?void 0:$.call(h):""])])}});t.install=function(a){a.component(t.name,t)};var s={title:"Card 卡片",category:"数据展示",install(a){a.use(t)}};export{t as Card,s as default};
1
+ import { defineComponent, createVNode } from "vue";
2
+ var card = "";
3
+ const cardProps = {
4
+ align: {
5
+ type: String,
6
+ default: "start"
7
+ },
8
+ src: {
9
+ type: String,
10
+ default: ""
11
+ }
12
+ };
13
+ var Card = defineComponent({
14
+ name: "DCard",
15
+ props: cardProps,
16
+ render() {
17
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
18
+ const {
19
+ align,
20
+ src
21
+ } = this;
22
+ const alignCls = {
23
+ "d-card-actions": true,
24
+ "devui-card-actions": true,
25
+ [`devui-card-actions-align-${align}`]: align !== "start"
26
+ };
27
+ return createVNode("div", {
28
+ "class": "card-container devui-card"
29
+ }, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a), createVNode("div", {
30
+ "class": "devui-card-header"
31
+ }, [((_d = (_c = this.$slots).cardAvatar) == null ? void 0 : _d.call(_c)) ? createVNode("div", {
32
+ "class": "devui-card-avatar"
33
+ }, [(_f = (_e = this.$slots).cardAvatar) == null ? void 0 : _f.call(_e)]) : "", createVNode("div", {
34
+ "class": "devui-card-header-title-area"
35
+ }, [createVNode("div", {
36
+ "class": "devui-card-title"
37
+ }, [(_h = (_g = this.$slots).cardTitle) == null ? void 0 : _h.call(_g)]), createVNode("div", {
38
+ "class": "devui-card-subtitle"
39
+ }, [(_j = (_i = this.$slots).cardSubtitle) == null ? void 0 : _j.call(_i)])])]), src !== "" ? createVNode("img", {
40
+ "src": src,
41
+ "alt": "",
42
+ "class": "devui-card-meta"
43
+ }, null) : "", createVNode("div", {
44
+ "class": "devui-card-content"
45
+ }, [(_l = (_k = this.$slots).cardContent) == null ? void 0 : _l.call(_k)]), createVNode("div", {
46
+ "class": alignCls
47
+ }, [this.$slots.cardActions ? (_n = (_m = this.$slots).cardActions) == null ? void 0 : _n.call(_m) : ""])]);
48
+ }
49
+ });
50
+ Card.install = function(app) {
51
+ app.component(Card.name, Card);
52
+ };
53
+ var index = {
54
+ title: "Card \u5361\u7247",
55
+ category: "\u6570\u636E\u5C55\u793A",
56
+ status: "100%",
57
+ install(app) {
58
+ app.use(Card);
59
+ }
60
+ };
61
+ export { Card, index as default };
package/card/index.umd.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).index={},e.Vue)}(this,(function(e,t){"use strict";const a={align:{type:String,default:"start"},src:{type:String,default:""}};var d=t.defineComponent({name:"DCard",props:a,render(){var e,a,d,l,i,s,c,r,o,n,u,v,f,h;const{align:p,src:g}=this,V={"d-card-actions":!0,"devui-card-actions":!0,[`devui-card-actions-align-${p}`]:"start"!==p};return t.createVNode("div",{class:"card-container devui-card"},[null==(a=(e=this.$slots).default)?void 0:a.call(e),t.createVNode("div",{class:"devui-card-header"},[(null==(l=(d=this.$slots).cardAvatar)?void 0:l.call(d))?t.createVNode("div",{class:"devui-card-avatar"},[null==(s=(i=this.$slots).cardAvatar)?void 0:s.call(i)]):"",t.createVNode("div",{class:"devui-card-header-title-area"},[t.createVNode("div",{class:"devui-card-title"},[null==(r=(c=this.$slots).cardTitle)?void 0:r.call(c)]),t.createVNode("div",{class:"devui-card-subtitle"},[null==(n=(o=this.$slots).cardSubtitle)?void 0:n.call(o)])])]),""!==g?t.createVNode("img",{src:g,alt:"",class:"devui-card-meta"},null):"",t.createVNode("div",{class:"devui-card-content"},[null==(v=(u=this.$slots).cardContent)?void 0:v.call(u)]),t.createVNode("div",{class:V},[this.$slots.cardActions?null==(h=(f=this.$slots).cardActions)?void 0:h.call(f):""])])}});d.install=function(e){e.component(d.name,d)};var l={title:"Card 卡片",category:"数据展示",install(e){e.use(d)}};e.Card=d,e.default=l,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"}));
1
+ (function(t,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(t=typeof globalThis!="undefined"?globalThis:t||self,e(t.index={},t.Vue))})(this,function(t,e){"use strict";var y="";const N={align:{type:String,default:"start"},src:{type:String,default:""}};var d=e.defineComponent({name:"DCard",props:N,render(){var i,r,c,n,o,l,u,f,v,h,p,V,g,m;const{align:a,src:s}=this,C={"d-card-actions":!0,"devui-card-actions":!0,[`devui-card-actions-align-${a}`]:a!=="start"};return e.createVNode("div",{class:"card-container devui-card"},[(r=(i=this.$slots).default)==null?void 0:r.call(i),e.createVNode("div",{class:"devui-card-header"},[((n=(c=this.$slots).cardAvatar)==null?void 0:n.call(c))?e.createVNode("div",{class:"devui-card-avatar"},[(l=(o=this.$slots).cardAvatar)==null?void 0:l.call(o)]):"",e.createVNode("div",{class:"devui-card-header-title-area"},[e.createVNode("div",{class:"devui-card-title"},[(f=(u=this.$slots).cardTitle)==null?void 0:f.call(u)]),e.createVNode("div",{class:"devui-card-subtitle"},[(h=(v=this.$slots).cardSubtitle)==null?void 0:h.call(v)])])]),s!==""?e.createVNode("img",{src:s,alt:"",class:"devui-card-meta"},null):"",e.createVNode("div",{class:"devui-card-content"},[(V=(p=this.$slots).cardContent)==null?void 0:V.call(p)]),e.createVNode("div",{class:C},[this.$slots.cardActions?(m=(g=this.$slots).cardActions)==null?void 0:m.call(g):""])])}});d.install=function(a){a.component(d.name,d)};var $={title:"Card \u5361\u7247",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(a){a.use(d)}};t.Card=d,t.default=$,Object.defineProperty(t,"__esModule",{value:!0}),t[Symbol.toStringTag]="Module"});
@@ -0,0 +1,7 @@
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;
@@ -1 +1,329 @@
1
- var e=Object.defineProperty,t=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,r=(t,l,a)=>l in t?e(t,l,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[l]=a;"undefined"!=typeof require&&require;import{defineComponent as n,createVNode as o,ref as u,watch as i,onMounted as s,onBeforeUnmount as v,Fragment as c,Comment as d}from"vue";const p={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 f=n({name:"DIcon",props:{name:{type:String,required:!0},size:{type:String,default:"inherit"},color:{type:String,default:"inherit"},classPrefix:{type:String,default:"icon"}},setup:e=>((e,n)=>{for(var o in n||(n={}))l.call(n,o)&&r(e,o,n[o]);if(t)for(var o of t(n))a.call(n,o)&&r(e,o,n[o]);return e})({},e),render(){const{name:e,size:t,color:l,classPrefix:a}=this;return o("i",{class:`${a} ${a}-${e}`,style:{fontSize:t,color:l}},null)}}),m=n({name:"DCarousel",props:p,emits:["update:activeIndex"],setup(e,{emit:t}){const{arrowTrigger:l,autoplay:a,autoplaySpeed:r,dotTrigger:n,activeIndex:o,activeIndexChange:c}=e,d=u(0),p=u(!1),f=u(0),m=u(null),y=u(null),g=u(null);i((()=>l),(()=>{p.value="always"===l}),{immediate:!0}),i((()=>o),(()=>{f.value=o}),{immediate:!0});const h=e=>{y.value&&(y.value.style.left=100*-e+"%")},w=e=>{setTimeout((()=>{y.value&&(y.value.style.transition=""),e.style.transform="",h(f.value)}),500)},b=(e,t)=>{if(m.value){const l=m.value.getBoundingClientRect();e.style.transform=`translateX(${(t?-d.value:d.value)*l.width}px)`}},x=e=>{if(e===f.value||!m.value||!y.value)return;y.value.style.transition="left 500ms ease";let l=f.value;if(e<0&&0===f.value){l=d.value-1;const e=y.value.children[l];b(e,!0),h(-1),w(e)}else if(e>=d.value&&f.value===d.value-1){l=0;const e=y.value.children[l];b(e,!1),h(d.value),w(e)}else l=e<0?0:e>d.value-1?d.value-1:e,h(l);f.value=l,t("update:activeIndex",l),null==c||c(l),I()},S=()=>{x(f.value+1)},C=()=>{g.value&&(clearTimeout(g.value),g.value=null)},I=()=>{C(),a&&r&&(g.value=setTimeout((()=>{S()}),r))};return s((()=>{y.value&&(y.value.style.transition="left 500ms ease",y.value.style.left="0%"),I()})),v((()=>{C()})),{wrapperRef:m,containerRef:y,showArrow:p,currentIndex:f,itemCount:d,changeItemCount:e=>{d.value=e,I()},goto:x,prev:()=>{x(f.value-1)},next:S,arrowMouseEvent:e=>{"hover"===l&&(p.value="enter"===e)},switchStep:(e,t)=>{t===n&&x(e)}}},render(){var e,t;const{showArrow:l,currentIndex:a,itemCount:r,arrowTrigger:n,height:u,showDots:i,dotPosition:s,prev:v,next:p,arrowMouseEvent:m,switchStep:y,changeItemCount:g,$slots:h}=this,w=null!=(t=null==(e=h.default)?void 0:e.call(h))?t:[];let b=w;return 1===b.length&&b[0].type===c&&(b=(b[0].children||[]).filter((e=>(null==e?void 0:e.type)!==d))),b.length!==r&&g(b.length),o("div",{class:"devui-carousel-container",style:{height:u},onMouseenter:()=>m("enter"),onMouseleave:()=>m("leave")},["never"!==n&&l?o("div",{class:"devui-carousel-arrow"},[o("button",{class:"arrow-left",onClick:()=>v()},[o(f,{name:"arrow-left"},null)]),o("button",{class:"arrow-right",onClick:()=>p()},[o(f,{name:"arrow-right"},null)])]):null,o("div",{class:"devui-carousel-item-wrapper",ref:"wrapperRef"},[o("div",{class:"devui-carousel-item-container",style:{width:100*r+"%"},ref:"containerRef"},[w])]),r>0&&i?o("ul",{class:["devui-carousel-dots",s]},[b.map(((e,t)=>o("li",{class:{"dot-item":!0,active:a===t},onClick:()=>y(t,"click"),onMouseenter:()=>y(t,"hover")},null)))]):null])}}),y=n({name:"DCarouselItem",render(){var e;const{$slots:t}=this,l=null==(e=t.default)?void 0:e.call(t);return o("div",{class:"d-carousel-item "},[l])}});m.install=function(e){e.component(m.name,m)},y.install=function(e){e.component(y.name,y)};var g={title:"Carousel 走马灯",category:"数据展示",install(e){e.use(m),e.use(y)}};export{m as Carousel,g as default};
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ 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 CarouseItem = 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
+ CarouseItem.install = function(app) {
318
+ app.component(CarouseItem.name, CarouseItem);
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(CarouseItem);
327
+ }
328
+ };
329
+ export { Carousel, index as default };