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

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 (293) hide show
  1. package/README.md +132 -200
  2. package/auto-complete/index.es.js +150 -110
  3. package/auto-complete/index.umd.js +5 -1
  4. package/auto-complete/style.css +1 -1
  5. package/avatar/index.es.js +77 -81
  6. package/avatar/index.umd.js +1 -1
  7. package/button/index.es.js +23 -15
  8. package/button/index.umd.js +1 -1
  9. package/button/style.css +1 -1
  10. package/card/index.es.js +3 -6
  11. package/card/index.umd.js +1 -1
  12. package/checkbox/index.es.js +5 -11
  13. package/checkbox/index.umd.js +1 -1
  14. package/comment/index.es.js +4 -6
  15. package/comment/index.umd.js +1 -1
  16. package/countdown/index.es.js +3 -6
  17. package/countdown/index.umd.js +1 -1
  18. package/editable-select/index.es.js +120 -167
  19. package/editable-select/index.umd.js +1 -1
  20. package/grid/index.es.js +30 -36
  21. package/grid/index.umd.js +1 -1
  22. package/image-preview/index.es.js +19 -19
  23. package/image-preview/index.umd.js +1 -1
  24. package/input/index.es.js +2 -5
  25. package/input/index.umd.js +1 -1
  26. package/layout/index.es.js +9 -22
  27. package/layout/index.umd.js +1 -1
  28. package/loading/index.es.js +40 -25
  29. package/loading/index.umd.js +1 -1
  30. package/modal/index.es.js +55 -47
  31. package/modal/index.umd.js +1 -1
  32. package/notification/index.es.js +100 -10
  33. package/notification/index.umd.js +1 -1
  34. package/notification/style.css +1 -1
  35. package/nuxt/components/DropdownPropsKey.js +3 -0
  36. package/nuxt/components/LoadingOptions.js +3 -0
  37. package/nuxt/components/autoCompleteProps.js +3 -0
  38. package/nuxt/components/avatarProps.js +3 -0
  39. package/nuxt/components/cardProps.js +3 -0
  40. package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
  41. package/nuxt/components/checkboxGroupProps.js +3 -0
  42. package/nuxt/components/checkboxProps.js +3 -0
  43. package/nuxt/components/colProps.js +3 -0
  44. package/nuxt/components/colPropsBaseClass.js +3 -0
  45. package/nuxt/components/colPropsBaseStyle.js +3 -0
  46. package/nuxt/components/commentProps.js +3 -0
  47. package/nuxt/components/countdownProps.js +3 -0
  48. package/nuxt/components/editableSelectProps.js +3 -0
  49. package/nuxt/components/imagePreviewProps.js +3 -0
  50. package/nuxt/components/inputProps.js +3 -0
  51. package/nuxt/components/loadingProps.js +3 -0
  52. package/nuxt/components/modalProps.js +3 -0
  53. package/nuxt/components/progressProps.js +3 -0
  54. package/nuxt/components/rateProps.js +3 -0
  55. package/nuxt/components/readTipProps.js +3 -0
  56. package/nuxt/components/resultProps.js +3 -0
  57. package/nuxt/components/rowProps.js +3 -0
  58. package/nuxt/components/screenSizes.js +3 -0
  59. package/nuxt/components/skeletonProps.js +3 -0
  60. package/nuxt/components/sliderProps.js +3 -0
  61. package/nuxt/components/splitterProps.js +3 -0
  62. package/nuxt/components/statisticProps.js +3 -0
  63. package/nuxt/components/switchProps.js +3 -0
  64. package/nuxt/components/tagInputProps.js +3 -0
  65. package/nuxt/components/tagProps.js +3 -0
  66. package/nuxt/components/textareaProps.js +3 -0
  67. package/nuxt/components/timeAxisProps.js +3 -0
  68. package/overlay/index.es.js +5 -5
  69. package/overlay/index.umd.js +1 -1
  70. package/package.json +1 -1
  71. package/pagination/index.es.js +14 -13
  72. package/pagination/index.umd.js +1 -1
  73. package/popover/index.es.js +7 -7
  74. package/popover/index.umd.js +12 -12
  75. package/progress/index.es.js +34 -36
  76. package/progress/index.umd.js +3 -3
  77. package/progress/style.css +1 -1
  78. package/radio/index.es.js +8 -2
  79. package/radio/index.umd.js +1 -1
  80. package/radio/style.css +1 -1
  81. package/rate/index.es.js +4 -7
  82. package/rate/index.umd.js +1 -1
  83. package/read-tip/index.es.js +34 -34
  84. package/read-tip/index.umd.js +1 -1
  85. package/read-tip/style.css +1 -1
  86. package/result/index.es.js +2 -5
  87. package/result/index.umd.js +1 -1
  88. package/ripple/index.es.js +43 -42
  89. package/ripple/index.umd.js +1 -1
  90. package/search/index.es.js +11 -11
  91. package/search/index.umd.js +8 -8
  92. package/skeleton/index.es.js +9 -12
  93. package/skeleton/index.umd.js +1 -1
  94. package/slider/index.es.js +59 -62
  95. package/slider/index.umd.js +1 -1
  96. package/splitter/index.es.js +176 -136
  97. package/splitter/index.umd.js +13 -13
  98. package/statistic/index.es.js +7 -18
  99. package/statistic/index.umd.js +1 -1
  100. package/style.css +1 -1
  101. package/switch/index.es.js +4 -7
  102. package/switch/index.umd.js +1 -1
  103. package/switch/style.css +1 -1
  104. package/tag/index.es.js +13 -17
  105. package/tag/index.umd.js +1 -1
  106. package/tag/style.css +1 -1
  107. package/tag-input/index.es.js +3 -6
  108. package/tag-input/index.umd.js +1 -1
  109. package/textarea/index.es.js +2 -5
  110. package/textarea/index.umd.js +1 -1
  111. package/timeline/index.es.js +10 -16
  112. package/timeline/index.umd.js +1 -1
  113. package/upload/index.es.js +160 -67
  114. package/upload/index.umd.js +1 -1
  115. package/upload/style.css +1 -1
  116. package/vue-devui.es.js +12182 -24718
  117. package/vue-devui.umd.js +24 -20
  118. package/accordion/index.d.ts +0 -7
  119. package/accordion/index.es.js +0 -723
  120. package/accordion/index.umd.js +0 -1
  121. package/accordion/package.json +0 -7
  122. package/accordion/style.css +0 -1
  123. package/anchor/index.d.ts +0 -7
  124. package/anchor/index.es.js +0 -263
  125. package/anchor/index.umd.js +0 -1
  126. package/anchor/package.json +0 -7
  127. package/anchor/style.css +0 -1
  128. package/back-top/index.d.ts +0 -7
  129. package/back-top/index.es.js +0 -130
  130. package/back-top/index.umd.js +0 -1
  131. package/back-top/package.json +0 -7
  132. package/back-top/style.css +0 -1
  133. package/breadcrumb/index.d.ts +0 -7
  134. package/breadcrumb/index.es.js +0 -128
  135. package/breadcrumb/index.umd.js +0 -1
  136. package/breadcrumb/package.json +0 -7
  137. package/breadcrumb/style.css +0 -1
  138. package/carousel/index.d.ts +0 -7
  139. package/carousel/index.es.js +0 -314
  140. package/carousel/index.umd.js +0 -1
  141. package/carousel/package.json +0 -7
  142. package/carousel/style.css +0 -1
  143. package/cascader/index.d.ts +0 -7
  144. package/cascader/index.es.js +0 -5971
  145. package/cascader/index.umd.js +0 -27
  146. package/cascader/package.json +0 -7
  147. package/cascader/style.css +0 -1
  148. package/color-picker/index.d.ts +0 -7
  149. package/color-picker/index.es.js +0 -8196
  150. package/color-picker/index.umd.js +0 -27
  151. package/color-picker/package.json +0 -7
  152. package/color-picker/style.css +0 -1
  153. package/date-picker/index.d.ts +0 -7
  154. package/date-picker/index.es.js +0 -1154
  155. package/date-picker/index.umd.js +0 -1
  156. package/date-picker/package.json +0 -7
  157. package/date-picker/style.css +0 -1
  158. package/dragdrop/index.d.ts +0 -7
  159. package/dragdrop/index.es.js +0 -157
  160. package/dragdrop/index.umd.js +0 -1
  161. package/dragdrop/package.json +0 -7
  162. package/drawer/index.d.ts +0 -7
  163. package/drawer/index.es.js +0 -234
  164. package/drawer/index.umd.js +0 -1
  165. package/drawer/package.json +0 -7
  166. package/drawer/style.css +0 -1
  167. package/dropdown/index.d.ts +0 -7
  168. package/dropdown/index.es.js +0 -693
  169. package/dropdown/index.umd.js +0 -1
  170. package/dropdown/package.json +0 -7
  171. package/dropdown/style.css +0 -1
  172. package/form/index.d.ts +0 -7
  173. package/form/index.es.js +0 -7876
  174. package/form/index.umd.js +0 -27
  175. package/form/package.json +0 -7
  176. package/form/style.css +0 -1
  177. package/gantt/index.d.ts +0 -7
  178. package/gantt/index.es.js +0 -523
  179. package/gantt/index.umd.js +0 -1
  180. package/gantt/package.json +0 -7
  181. package/gantt/style.css +0 -1
  182. package/input-icon/index.d.ts +0 -7
  183. package/input-icon/index.es.js +0 -332
  184. package/input-icon/index.umd.js +0 -1
  185. package/input-icon/package.json +0 -7
  186. package/input-icon/style.css +0 -1
  187. package/input-number/index.d.ts +0 -7
  188. package/input-number/index.es.js +0 -229
  189. package/input-number/index.umd.js +0 -1
  190. package/input-number/package.json +0 -7
  191. package/input-number/style.css +0 -1
  192. package/list/index.d.ts +0 -7
  193. package/list/index.es.js +0 -39
  194. package/list/index.umd.js +0 -1
  195. package/list/package.json +0 -7
  196. package/list/style.css +0 -1
  197. package/nav-sprite/index.d.ts +0 -7
  198. package/nav-sprite/index.es.js +0 -68
  199. package/nav-sprite/index.umd.js +0 -1
  200. package/nav-sprite/package.json +0 -7
  201. package/nuxt/components/Accordion.js +0 -3
  202. package/nuxt/components/Anchor.js +0 -3
  203. package/nuxt/components/BackTop.js +0 -3
  204. package/nuxt/components/Breadcrumb.js +0 -3
  205. package/nuxt/components/Carousel.js +0 -3
  206. package/nuxt/components/CarouselItem.js +0 -3
  207. package/nuxt/components/Cascader.js +0 -3
  208. package/nuxt/components/ColorPicker.js +0 -3
  209. package/nuxt/components/Column.js +0 -3
  210. package/nuxt/components/DatePicker.js +0 -3
  211. package/nuxt/components/Drawer.js +0 -3
  212. package/nuxt/components/DrawerService.js +0 -3
  213. package/nuxt/components/Dropdown.js +0 -3
  214. package/nuxt/components/DropdownMenu.js +0 -3
  215. package/nuxt/components/Form.js +0 -3
  216. package/nuxt/components/FormControl.js +0 -3
  217. package/nuxt/components/FormItem.js +0 -3
  218. package/nuxt/components/FormLabel.js +0 -3
  219. package/nuxt/components/FormOperation.js +0 -3
  220. package/nuxt/components/Gantt.js +0 -3
  221. package/nuxt/components/InputIcon.js +0 -3
  222. package/nuxt/components/InputNumber.js +0 -3
  223. package/nuxt/components/List.js +0 -3
  224. package/nuxt/components/ListItem.js +0 -3
  225. package/nuxt/components/NavSprite.js +0 -2
  226. package/nuxt/components/QuadrantDiagram.js +0 -3
  227. package/nuxt/components/Select.js +0 -3
  228. package/nuxt/components/StepsGuide.js +0 -3
  229. package/nuxt/components/StickSlider.js +0 -3
  230. package/nuxt/components/Sticky.js +0 -2
  231. package/nuxt/components/Table.js +0 -3
  232. package/nuxt/components/Tabs.js +0 -3
  233. package/nuxt/components/TimePicker.js +0 -3
  234. package/nuxt/components/Tooltip.js +0 -3
  235. package/nuxt/components/Transfer.js +0 -3
  236. package/nuxt/components/Tree.js +0 -3
  237. package/nuxt/components/TreeSelect.js +0 -3
  238. package/nuxt/components/dropdownMenuProps.js +0 -3
  239. package/nuxt/components/tooltipProps.js +0 -3
  240. package/quadrant-diagram/index.d.ts +0 -7
  241. package/quadrant-diagram/index.es.js +0 -5728
  242. package/quadrant-diagram/index.umd.js +0 -27
  243. package/quadrant-diagram/package.json +0 -7
  244. package/quadrant-diagram/style.css +0 -1
  245. package/select/index.d.ts +0 -7
  246. package/select/index.es.js +0 -706
  247. package/select/index.umd.js +0 -1
  248. package/select/package.json +0 -7
  249. package/select/style.css +0 -1
  250. package/steps-guide/index.d.ts +0 -7
  251. package/steps-guide/index.es.js +0 -242
  252. package/steps-guide/index.umd.js +0 -1
  253. package/steps-guide/package.json +0 -7
  254. package/steps-guide/style.css +0 -1
  255. package/sticky/index.d.ts +0 -7
  256. package/sticky/index.es.js +0 -197
  257. package/sticky/index.umd.js +0 -1
  258. package/sticky/package.json +0 -7
  259. package/table/index.d.ts +0 -7
  260. package/table/index.es.js +0 -2024
  261. package/table/index.umd.js +0 -1
  262. package/table/package.json +0 -7
  263. package/table/style.css +0 -1
  264. package/tabs/index.d.ts +0 -7
  265. package/tabs/index.es.js +0 -194
  266. package/tabs/index.umd.js +0 -1
  267. package/tabs/package.json +0 -7
  268. package/tabs/style.css +0 -1
  269. package/time-picker/index.d.ts +0 -7
  270. package/time-picker/index.es.js +0 -1238
  271. package/time-picker/index.umd.js +0 -1
  272. package/time-picker/package.json +0 -7
  273. package/time-picker/style.css +0 -1
  274. package/tooltip/index.d.ts +0 -7
  275. package/tooltip/index.es.js +0 -5835
  276. package/tooltip/index.umd.js +0 -27
  277. package/tooltip/package.json +0 -7
  278. package/tooltip/style.css +0 -1
  279. package/transfer/index.d.ts +0 -7
  280. package/transfer/index.es.js +0 -7615
  281. package/transfer/index.umd.js +0 -27
  282. package/transfer/package.json +0 -7
  283. package/transfer/style.css +0 -1
  284. package/tree/index.d.ts +0 -7
  285. package/tree/index.es.js +0 -6495
  286. package/tree/index.umd.js +0 -27
  287. package/tree/package.json +0 -7
  288. package/tree/style.css +0 -1
  289. package/tree-select/index.d.ts +0 -7
  290. package/tree-select/index.es.js +0 -627
  291. package/tree-select/index.umd.js +0 -1
  292. package/tree-select/package.json +0 -7
  293. package/tree-select/style.css +0 -1
@@ -1 +0,0 @@
1
- (function(a,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(a=typeof globalThis!="undefined"?globalThis:a||self,e(a.index={},a.Vue))})(this,function(a,e){"use strict";const f={source:{type:Array,default:[]},separatorIcon:{type:String}},p={showMenu:{type:Boolean,default:!1},menuList:{type:Array},isSearch:{type:Boolean,dafault:!1},to:{type:[String,Object],default:""},replace:{type:Boolean,default:!1}};var g="",l=e.defineComponent({name:"DBreadcrumbItem",props:p,setup(r,{slots:t}){const u=e.inject("separatorIcon"),d=r.to?"is-link":"",c=e.ref(null),o=e.getCurrentInstance().appContext.config.globalProperties.$router,n=()=>{!r.to||!o||(r.replace?o.replace(r.to):o.push(r.to))};return e.onMounted(()=>{c.value.addEventListener("click",n)}),e.onBeforeUnmount(()=>{c.value.removeEventListener("click",n)}),()=>{const y=()=>e.createVNode("span",{class:"devui-breadcrumb-separator"},[u]);return e.createVNode("div",{class:"devui-breadcrumb-item"},[e.createVNode("span",{ref:c,class:d},[t==null?void 0:t.default()]),y()])}}});function m(r,t,u="default"){var d,c;return(c=t[u])!=null?c:(d=r[u])==null?void 0:d.call(r)}var B="",i=e.defineComponent({name:"DBreadcrumb",components:{DBreadcrumbItem:l},props:f,setup(r,{slots:t}){var s;const u=(s=m(t,r,"separatorIcon"))!=null?s:"/";e.provide("separatorIcon",u);const d=o=>e.createVNode(e.resolveComponent("d-breadcrumb-item"),{to:`path: ${o.link}`,replace:o.replace},{default:()=>[o.title]}),c=o=>o.map(n=>!n.noNavigation&&n.linkType==="routerLink"?d(n):e.createVNode(e.resolveComponent("d-breadcrumb-item"),null,{default:()=>[!n.noNavigation&&(!n.linkType||n.linkType==="hrefLink")?e.createVNode("a",{href:n.link,target:n.target?n.target:"_self"},[n.title]):null,n.noNavigation?e.createVNode("span",null,[n.title]):null]}));return()=>e.createVNode("div",{class:"devui-breadcrumb"},[r.source&&r.source.length?c(r.source):t==null?void 0:t.default()])}});i.install=function(r){r.component(i.name,i),r.component(l.name,l)};var b={title:"Breadcrumb \u9762\u5305\u5C51",category:"\u5BFC\u822A",status:"50%",install(r){r.use(i)}};a.Breadcrumb=i,a.default=b,Object.defineProperty(a,"__esModule",{value:!0}),a[Symbol.toStringTag]="Module"});
@@ -1,7 +0,0 @@
1
- {
2
- "name": "breadcrumb",
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-breadcrumb-font-style,.devui-breadcrumb-separator,.devui-breadcrumb-item a,.devui-breadcrumb-item{font-size:var(--devui-font-size, 12px);color:var(--devui-aide-text, #8a8e99);line-height:18px}.devui-breadcrumb-item{cursor:auto}.devui-breadcrumb-item a{cursor:pointer}.devui-breadcrumb-item a:hover{color:var(--devui-text, #252b3a);text-decoration:none}.devui-breadcrumb-item a,.devui-breadcrumb-item span{transition:color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-breadcrumb-item .is-link{cursor:pointer}.devui-breadcrumb-item .is-link:hover{color:var(--devui-text, #252b3a);text-decoration:none}.devui-breadcrumb-separator{margin:0 4px}.devui-breadcrumb{display:flex;align-items:center}.devui-breadcrumb .devui-breadcrumb-item:last-child .devui-breadcrumb-separator{display:none}
@@ -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;
@@ -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;