vue-devui 1.6.4 → 1.6.5

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 (77) hide show
  1. package/auto-complete/index.es.js +1 -2
  2. package/auto-complete/index.umd.js +1 -1
  3. package/breadcrumb/index.es.js +2 -15
  4. package/breadcrumb/index.umd.js +1 -1
  5. package/button/index.es.js +1 -2
  6. package/button/index.umd.js +1 -1
  7. package/carousel/index.es.js +36 -213
  8. package/carousel/index.umd.js +1 -1
  9. package/carousel/style.css +1 -1
  10. package/category-search/index.es.js +3 -17
  11. package/category-search/index.umd.js +10 -10
  12. package/collapse/index.es.js +15 -18
  13. package/collapse/index.umd.js +5 -5
  14. package/data-grid/index.es.js +3 -17
  15. package/data-grid/index.umd.js +6 -6
  16. package/date-picker-pro/index.es.js +21 -6
  17. package/date-picker-pro/index.umd.js +12 -12
  18. package/date-picker-pro/style.css +1 -1
  19. package/dropdown/index.es.js +2 -15
  20. package/dropdown/index.umd.js +1 -1
  21. package/editable-select/index.es.js +2 -3
  22. package/editable-select/index.umd.js +2 -2
  23. package/editor-md/index.es.js +32 -18
  24. package/editor-md/index.umd.js +15 -15
  25. package/icon/index.es.js +1 -2
  26. package/icon/index.umd.js +1 -1
  27. package/input/index.es.js +21 -6
  28. package/input/index.umd.js +11 -11
  29. package/input/style.css +1 -1
  30. package/mention/index.es.js +1 -2
  31. package/mention/index.umd.js +1 -1
  32. package/message/index.es.js +1 -2
  33. package/message/index.umd.js +1 -1
  34. package/modal/index.es.js +27 -4
  35. package/modal/index.umd.js +7 -1
  36. package/modal/style.css +1 -1
  37. package/notification/index.es.js +1 -2
  38. package/notification/index.umd.js +2 -2
  39. package/package.json +1 -1
  40. package/pagination/index.es.js +55 -253
  41. package/pagination/index.umd.js +18 -23
  42. package/pagination/style.css +1 -1
  43. package/result/index.es.js +1 -2
  44. package/result/index.umd.js +1 -1
  45. package/search/index.es.js +48 -27
  46. package/search/index.umd.js +18 -14
  47. package/search/style.css +1 -1
  48. package/select/index.es.js +43 -42
  49. package/select/index.umd.js +11 -16
  50. package/select/style.css +1 -1
  51. package/steps/index.es.js +1 -2
  52. package/steps/index.umd.js +1 -1
  53. package/style.css +2 -2
  54. package/table/index.es.js +3 -17
  55. package/table/index.umd.js +6 -6
  56. package/time-picker/index.es.js +21 -6
  57. package/time-picker/index.umd.js +16 -16
  58. package/time-picker/style.css +1 -1
  59. package/time-select/index.es.js +43 -42
  60. package/time-select/index.umd.js +9 -14
  61. package/time-select/style.css +1 -1
  62. package/timeline/index.es.js +1 -2
  63. package/timeline/index.umd.js +1 -1
  64. package/types/carousel/src/components/carousel-icons.d.ts +2 -0
  65. package/types/dropdown/src/use-dropdown.d.ts +1 -1
  66. package/types/editor-md/src/composables/use-editor-md.d.ts +1 -0
  67. package/types/editor-md/src/editor-md-types.d.ts +3 -0
  68. package/types/icon/src/icon-types.d.ts +0 -1
  69. package/types/modal/src/components/modal-icons.d.ts +1 -0
  70. package/types/svg-icons/index.d.ts +3 -0
  71. package/upload/index.es.js +1 -2
  72. package/upload/index.umd.js +2 -2
  73. package/vue-devui.es.js +186 -96
  74. package/vue-devui.umd.js +97 -86
  75. package/types/search/src/components/search-close-icon.d.ts +0 -2
  76. package/types/search/src/components/search-icon.d.ts +0 -2
  77. package/types/select/src/components/select-arrow-icon.d.ts +0 -2
@@ -1,4 +1,4 @@
1
- import { defineComponent, toRefs, computed, createVNode, resolveDynamicComponent, mergeProps, ref, watch, onMounted, onBeforeUnmount, Fragment, Comment } from "vue";
1
+ import { createVNode, defineComponent, toRefs, ref, watch, onMounted, onBeforeUnmount, Fragment, Comment } from "vue";
2
2
  import "clipboard";
3
3
  const carouselProps = {
4
4
  arrowTrigger: {
@@ -38,214 +38,41 @@ const carouselProps = {
38
38
  default: 500
39
39
  }
40
40
  };
41
- const DEFAULT_PREFIX = "icon";
42
- const iconProps = {
43
- name: {
44
- type: String,
45
- default: "",
46
- required: true
47
- },
48
- size: {
49
- type: [Number, String],
50
- default: "inherit"
51
- },
52
- color: {
53
- type: String,
54
- default: "inherit"
55
- },
56
- component: {
57
- type: Object,
58
- default: null
59
- },
60
- classPrefix: {
61
- type: String,
62
- default: DEFAULT_PREFIX
63
- },
64
- operable: {
65
- type: Boolean,
66
- default: false
67
- },
68
- disabled: {
69
- type: Boolean,
70
- default: false
71
- },
72
- rotate: {
73
- type: [Number, String]
74
- }
75
- };
76
- const svgIconProps = {
77
- name: {
78
- type: String,
79
- default: "",
80
- required: true
81
- },
82
- color: {
83
- type: String,
84
- default: "inherit"
85
- },
86
- size: {
87
- type: [Number, String],
88
- default: "inherit"
89
- }
90
- };
91
- function createBem$1(namespace, element, modifier) {
92
- let cls = namespace;
93
- if (element) {
94
- cls += `__${element}`;
95
- }
96
- if (modifier) {
97
- cls += `--${modifier}`;
98
- }
99
- return cls;
100
- }
101
- function useNamespace$1(block, needDot = false) {
102
- const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
103
- const b = () => createBem$1(namespace);
104
- const e = (element) => element ? createBem$1(namespace, element) : "";
105
- const m = (modifier) => modifier ? createBem$1(namespace, "", modifier) : "";
106
- const em = (element, modifier) => element && modifier ? createBem$1(namespace, element, modifier) : "";
107
- return {
108
- b,
109
- e,
110
- m,
111
- em
112
- };
41
+ function CarouselArrowLeft() {
42
+ return createVNode("svg", {
43
+ "width": "18px",
44
+ "height": "18px",
45
+ "viewBox": "0 0 16 16",
46
+ "version": "1.1"
47
+ }, [createVNode("g", {
48
+ "stroke": "none",
49
+ "stroke-width": "1",
50
+ "fill": "none",
51
+ "fill-rule": "evenodd"
52
+ }, [createVNode("polygon", {
53
+ "fill": "#293040",
54
+ "fill-rule": "nonzero",
55
+ "points": "10.7071068 12.2928932 9.29289322 13.7071068 3.58578644 8 9.29289322 2.29289322 10.7071068 3.70710678 6.41421356 8"
56
+ }, null)])]);
113
57
  }
114
- var icon = "";
115
- var svgIcon = defineComponent({
116
- name: "DSvgIcon",
117
- props: svgIconProps,
118
- setup(props) {
119
- const {
120
- name,
121
- color,
122
- size
123
- } = toRefs(props);
124
- const ns = useNamespace$1("svg-icon");
125
- const iconName = computed(() => `#icon-${name.value}`);
126
- const iconSize = computed(() => {
127
- return typeof size.value === "number" ? `${size.value}px` : size.value;
128
- });
129
- const styles = {
130
- width: iconSize.value,
131
- height: iconSize.value
132
- };
133
- return () => {
134
- return createVNode("svg", {
135
- "class": ns.b(),
136
- "style": styles
137
- }, [createVNode("use", {
138
- "xlink:href": iconName.value,
139
- "fill": color.value
140
- }, null)]);
141
- };
142
- }
143
- });
144
- function isUrl(value) {
145
- return /^((http|https):)?\/\//.test(value);
58
+ function CarouselArrowRight() {
59
+ return createVNode("svg", {
60
+ "width": "18px",
61
+ "height": "18px",
62
+ "viewBox": "0 0 16 16",
63
+ "version": "1.1"
64
+ }, [createVNode("g", {
65
+ "stroke": "none",
66
+ "stroke-width": "1",
67
+ "fill": "none",
68
+ "fill-rule": "evenodd"
69
+ }, [createVNode("polygon", {
70
+ "fill": "#293040",
71
+ "fill-rule": "nonzero",
72
+ "transform": "translate(8.146447, 8.000000) scale(-1, 1) translate(-8.146447, -8.000000) ",
73
+ "points": "11.7071068 12.2928932 10.2928932 13.7071068 4.58578644 8 10.2928932 2.29289322 11.7071068 3.70710678 7.41421356 8"
74
+ }, null)])]);
146
75
  }
147
- function useIconDom(props, ctx) {
148
- const {
149
- component,
150
- name,
151
- size,
152
- color,
153
- classPrefix,
154
- rotate
155
- } = toRefs(props);
156
- const ns = useNamespace$1("icon");
157
- const iconSize = computed(() => {
158
- return typeof size.value === "number" ? `${size.value}px` : size.value;
159
- });
160
- const IconComponent = component.value ? resolveDynamicComponent(component.value) : resolveDynamicComponent(svgIcon);
161
- const imgIconDom = () => {
162
- return createVNode("img", mergeProps({
163
- "src": name.value,
164
- "alt": name.value.split("/")[name.value.split("/").length - 1],
165
- "class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
166
- "style": {
167
- width: iconSize.value || "",
168
- transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`,
169
- verticalAlign: "middle"
170
- }
171
- }, ctx.attrs), null);
172
- };
173
- const svgIconDom = () => {
174
- return createVNode(IconComponent, mergeProps({
175
- "name": name.value,
176
- "color": color.value,
177
- "size": iconSize.value,
178
- "class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
179
- "style": {
180
- transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
181
- }
182
- }, ctx.attrs), null);
183
- };
184
- const fontIconDom = () => {
185
- const fontIconClass = /^icon-/.test(name.value) ? name.value : `${classPrefix.value}-${name.value}`;
186
- return createVNode("i", mergeProps({
187
- "class": [classPrefix.value, fontIconClass, (rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
188
- "style": {
189
- fontSize: iconSize.value,
190
- color: color.value,
191
- transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
192
- }
193
- }, ctx.attrs), null);
194
- };
195
- const iconDom = () => {
196
- return component.value ? svgIconDom() : isUrl(name.value) ? imgIconDom() : fontIconDom();
197
- };
198
- return {
199
- iconDom
200
- };
201
- }
202
- var Icon = defineComponent({
203
- name: "DIcon",
204
- props: iconProps,
205
- emits: ["click"],
206
- setup(props, ctx) {
207
- const {
208
- disabled,
209
- operable
210
- } = toRefs(props);
211
- const {
212
- iconDom
213
- } = useIconDom(props, ctx);
214
- const ns = useNamespace$1("icon");
215
- const wrapClassed = computed(() => ({
216
- [ns.e("container")]: true,
217
- [ns.m("disabled")]: disabled.value,
218
- [ns.m("operable")]: operable.value,
219
- [ns.m("no-slots")]: !Object.keys(ctx.slots).length
220
- }));
221
- const onClick = (e) => {
222
- if (disabled.value) {
223
- return;
224
- }
225
- ctx.emit("click", e);
226
- };
227
- return () => {
228
- var _a, _b, _c, _d;
229
- return createVNode("div", {
230
- "class": wrapClassed.value,
231
- "onClick": onClick
232
- }, [(_b = (_a = ctx.slots).prefix) == null ? void 0 : _b.call(_a), iconDom(), (_d = (_c = ctx.slots).suffix) == null ? void 0 : _d.call(_c)]);
233
- };
234
- }
235
- });
236
- var iconGroup = "";
237
- defineComponent({
238
- name: "DIconGroup",
239
- setup(_, ctx) {
240
- const ns = useNamespace$1("icon-group");
241
- return () => {
242
- var _a, _b;
243
- return createVNode("div", {
244
- "class": ns.b()
245
- }, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
246
- };
247
- }
248
- });
249
76
  function createBem(namespace, element, modifier) {
250
77
  let cls = namespace;
251
78
  if (element) {
@@ -428,14 +255,10 @@ var Carousel = defineComponent({
428
255
  }, [createVNode("button", {
429
256
  "class": "arrow-left",
430
257
  "onClick": () => prev()
431
- }, [createVNode(Icon, {
432
- "name": "arrow-left"
433
- }, null)]), createVNode("button", {
258
+ }, [createVNode(CarouselArrowLeft, null, null)]), createVNode("button", {
434
259
  "class": "arrow-right",
435
260
  "onClick": () => next()
436
- }, [createVNode(Icon, {
437
- "name": "arrow-right"
438
- }, null)])]) : null, createVNode("div", {
261
+ }, [createVNode(CarouselArrowRight, null, null)])]) : null, createVNode("div", {
439
262
  "class": ns.e("item-wrapper"),
440
263
  "ref": wrapperRef
441
264
  }, [createVNode("div", {
@@ -1 +1 @@
1
- (function(m,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("clipboard")):typeof define=="function"&&define.amd?define(["exports","vue","clipboard"],e):(m=typeof globalThis!="undefined"?globalThis:m||self,e(m.index={},m.Vue))})(this,function(m,e){"use strict";const G={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},transitionSpeed:{type:Number,default:500}},L={name:{type:String,default:"",required:!0},size:{type:[Number,String],default:"inherit"},color:{type:String,default:"inherit"},component:{type:Object,default:null},classPrefix:{type:String,default:"icon"},operable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},rotate:{type:[Number,String]}},H={name:{type:String,default:"",required:!0},color:{type:String,default:"inherit"},size:{type:[Number,String],default:"inherit"}};function b(l,o,n){let a=l;return o&&(a+=`__${o}`),n&&(a+=`--${n}`),a}function w(l,o=!1){const n=o?`.devui-${l}`:`devui-${l}`;return{b:()=>b(n),e:t=>t?b(n,t):"",m:t=>t?b(n,"",t):"",em:(t,i)=>t&&i?b(n,t,i):""}}var ee="",J=e.defineComponent({name:"DSvgIcon",props:H,setup(l){const{name:o,color:n,size:a}=e.toRefs(l),r=w("svg-icon"),c=e.computed(()=>`#icon-${o.value}`),p=e.computed(()=>typeof a.value=="number"?`${a.value}px`:a.value),t={width:p.value,height:p.value};return()=>e.createVNode("svg",{class:r.b(),style:t},[e.createVNode("use",{"xlink:href":c.value,fill:n.value},null)])}});function K(l){return/^((http|https):)?\/\//.test(l)}function Q(l,o){const{component:n,name:a,size:r,color:c,classPrefix:p,rotate:t}=e.toRefs(l),i=w("icon"),y=e.computed(()=>typeof r.value=="number"?`${r.value}px`:r.value),h=n.value?e.resolveDynamicComponent(n.value):e.resolveDynamicComponent(J),C=()=>e.createVNode("img",e.mergeProps({src:a.value,alt:a.value.split("/")[a.value.split("/").length-1],class:[(t==null?void 0:t.value)==="infinite"&&i.m("spin")],style:{width:y.value||"",transform:`rotate(${t==null?void 0:t.value}deg)`,verticalAlign:"middle"}},o.attrs),null),D=()=>e.createVNode(h,e.mergeProps({name:a.value,color:c.value,size:y.value,class:[(t==null?void 0:t.value)==="infinite"&&i.m("spin")],style:{transform:`rotate(${t==null?void 0:t.value}deg)`}},o.attrs),null),I=()=>{const N=/^icon-/.test(a.value)?a.value:`${p.value}-${a.value}`;return e.createVNode("i",e.mergeProps({class:[p.value,N,(t==null?void 0:t.value)==="infinite"&&i.m("spin")],style:{fontSize:y.value,color:c.value,transform:`rotate(${t==null?void 0:t.value}deg)`}},o.attrs),null)};return{iconDom:()=>n.value?D():K(a.value)?C():I()}}var j=e.defineComponent({name:"DIcon",props:L,emits:["click"],setup(l,o){const{disabled:n,operable:a}=e.toRefs(l),{iconDom:r}=Q(l,o),c=w("icon"),p=e.computed(()=>({[c.e("container")]:!0,[c.m("disabled")]:n.value,[c.m("operable")]:a.value,[c.m("no-slots")]:!Object.keys(o.slots).length})),t=i=>{n.value||o.emit("click",i)};return()=>{var i,y,h,C;return e.createVNode("div",{class:p.value,onClick:t},[(y=(i=o.slots).prefix)==null?void 0:y.call(i),r(),(C=(h=o.slots).suffix)==null?void 0:C.call(h)])}}}),te="";e.defineComponent({name:"DIconGroup",setup(l,o){const n=w("icon-group");return()=>{var a,r;return e.createVNode("div",{class:n.b()},[(r=(a=o.slots).default)==null?void 0:r.call(a)])}}});function $(l,o,n){let a=l;return o&&(a+=`__${o}`),n&&(a+=`--${n}`),a}function A(l,o=!1){const n=o?`.devui-${l}`:`devui-${l}`;return{b:()=>$(n),e:t=>t?$(n,t):"",m:t=>t?$(n,"",t):"",em:(t,i)=>t&&i?$(n,t,i):""}}var ne="",z=e.defineComponent({name:"DCarousel",props:G,emits:["update:activeIndex","activeIndexChange"],setup(l,{emit:o,slots:n,expose:a}){const r=A("carousel"),{height:c,showDots:p,dotPosition:t,arrowTrigger:i,autoplay:y,autoplaySpeed:h,dotTrigger:C,activeIndex:D,transitionSpeed:I}=e.toRefs(l),d=e.ref(0),N=e.ref(!1),v=e.ref(0),V=e.ref(null),f=e.ref(null),P=e.ref(null);e.watch(()=>i,()=>{N.value=i.value==="always"},{immediate:!0}),e.watch(()=>D,()=>{v.value=D.value},{immediate:!0});const T=s=>{f.value&&(f.value.style.left=`${-s*100}%`)},F=s=>{setTimeout(()=>{f.value&&(f.value.style.transition=""),s.style.transform="",T(v.value)},I.value)},k=(s,u)=>{if(V.value){const g=V.value.getBoundingClientRect();s.style.transform=`translateX(${(u?-d.value:d.value)*g.width}px)`}},x=()=>{P.value&&(clearTimeout(P.value),P.value=null)},E=s=>{x(),y.value&&h.value&&(P.value=setTimeout(()=>{s==null||s()},h.value))},S=s=>{if(s===v.value||!V.value||!f.value)return;f.value.style.transition=`left ${I.value}ms ease`;let u=v.value;if(s<0&&v.value===0){u=d.value-1;const g=f.value.children[u];k(g,!0),T(-1),F(g)}else if(s>=d.value&&v.value===d.value-1){u=0;const g=f.value.children[u];k(g,!1),T(d.value),F(g)}else u=s<0?0:s>d.value-1?d.value-1:s,T(u);v.value=u,o("update:activeIndex",u),o("activeIndexChange",u),E(()=>{S(v.value+1)})},q=()=>{S(v.value-1)},R=()=>{S(v.value+1)},U=s=>{i.value==="hover"&&(N.value=s==="enter")},O=(s,u)=>{u===C.value&&S(s)},Y=s=>{d.value=s,E(R)};return e.onMounted(()=>{f.value&&(f.value.style.transition=`left ${I.value}ms ease`,f.value.style.left="0%"),E(R)}),e.onBeforeUnmount(()=>{x()}),a({prev:q,next:R,goto:S}),()=>{var g,X;const s=(X=(g=n.default)==null?void 0:g.call(n))!=null?X:[];let u=s;return u.length===1&&u[0].type===e.Fragment&&(u=(u[0].children||[]).filter(_=>(_==null?void 0:_.type)!==e.Comment)),u.length!==d.value&&Y(u.length),e.createVNode("div",{class:r.b(),style:{height:c.value},onMouseenter:()=>U("enter"),onMouseleave:()=>U("leave")},[i.value!=="never"&&N.value?e.createVNode("div",{class:r.e("arrow")},[e.createVNode("button",{class:"arrow-left",onClick:()=>q()},[e.createVNode(j,{name:"arrow-left"},null)]),e.createVNode("button",{class:"arrow-right",onClick:()=>R()},[e.createVNode(j,{name:"arrow-right"},null)])]):null,e.createVNode("div",{class:r.e("item-wrapper"),ref:V},[e.createVNode("div",{class:r.e("item-container"),style:{width:`${d.value*100}%`},ref:f},[s])]),d.value>0&&p.value?e.createVNode("ul",{class:[r.e("dots"),t.value]},[u.map((_,M)=>e.createVNode("li",{class:{"dot-item":!0,active:v.value===M},onClick:()=>O(M,"click"),onMouseenter:()=>O(M,"hover"),style:{transition:`all ${I.value}ms ease`}},null))]):null])}}}),B=e.defineComponent({name:"DCarouselItem",setup(l,{slots:o}){var r;const n=A("carousel"),a=(r=o.default)==null?void 0:r.call(o);return()=>e.createVNode("div",{class:n.e("item")},[a])}}),W={title:"Carousel \u8D70\u9A6C\u706F",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(l){l.component(z.name,z),l.component(B.name,B)}};m.Carousel=z,m.CarouselItem=B,m.default=W,Object.defineProperty(m,"__esModule",{value:!0}),m[Symbol.toStringTag]="Module"});
1
+ (function(s,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("clipboard")):typeof define=="function"&&define.amd?define(["exports","vue","clipboard"],e):(s=typeof globalThis!="undefined"?globalThis:s||self,e(s.index={},s.Vue))})(this,function(s,e){"use strict";const z={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},transitionSpeed:{type:Number,default:500}};function F(){return e.createVNode("svg",{width:"18px",height:"18px",viewBox:"0 0 16 16",version:"1.1"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("polygon",{fill:"#293040","fill-rule":"nonzero",points:"10.7071068 12.2928932 9.29289322 13.7071068 3.58578644 8 9.29289322 2.29289322 10.7071068 3.70710678 6.41421356 8"},null)])])}function L(){return e.createVNode("svg",{width:"18px",height:"18px",viewBox:"0 0 16 16",version:"1.1"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("polygon",{fill:"#293040","fill-rule":"nonzero",transform:"translate(8.146447, 8.000000) scale(-1, 1) translate(-8.146447, -8.000000) ",points:"11.7071068 12.2928932 10.2928932 13.7071068 4.58578644 8 10.2928932 2.29289322 11.7071068 3.70710678 7.41421356 8"},null)])])}function g(i,r,l){let v=i;return r&&(v+=`__${r}`),l&&(v+=`--${l}`),v}function b(i,r=!1){const l=r?`.devui-${i}`:`devui-${i}`;return{b:()=>g(l),e:c=>c?g(l,c):"",m:c=>c?g(l,"",c):"",em:(c,p)=>c&&p?g(l,c,p):""}}var H="",I=e.defineComponent({name:"DCarousel",props:z,emits:["update:activeIndex","activeIndexChange"],setup(i,{emit:r,slots:l,expose:v}){const f=b("carousel"),{height:B,showDots:M,dotPosition:c,arrowTrigger:p,autoplay:U,autoplaySpeed:P,dotTrigger:X,activeIndex:R,transitionSpeed:m}=e.toRefs(i),n=e.ref(0),T=e.ref(!1),u=e.ref(0),y=e.ref(null),o=e.ref(null),w=e.ref(null);e.watch(()=>p,()=>{T.value=p.value==="always"},{immediate:!0}),e.watch(()=>R,()=>{u.value=R.value},{immediate:!0});const C=t=>{o.value&&(o.value.style.left=`${-t*100}%`)},A=t=>{setTimeout(()=>{o.value&&(o.value.style.transition=""),t.style.transform="",C(u.value)},m.value)},D=(t,a)=>{if(y.value){const d=y.value.getBoundingClientRect();t.style.transform=`translateX(${(a?-n.value:n.value)*d.width}px)`}},_=()=>{w.value&&(clearTimeout(w.value),w.value=null)},x=t=>{_(),U.value&&P.value&&(w.value=setTimeout(()=>{t==null||t()},P.value))},h=t=>{if(t===u.value||!y.value||!o.value)return;o.value.style.transition=`left ${m.value}ms ease`;let a=u.value;if(t<0&&u.value===0){a=n.value-1;const d=o.value.children[a];D(d,!0),C(-1),A(d)}else if(t>=n.value&&u.value===n.value-1){a=0;const d=o.value.children[a];D(d,!1),C(n.value),A(d)}else a=t<0?0:t>n.value-1?n.value-1:t,C(a);u.value=a,r("update:activeIndex",a),r("activeIndexChange",a),x(()=>{h(u.value+1)})},j=()=>{h(u.value-1)},N=()=>{h(u.value+1)},k=t=>{p.value==="hover"&&(T.value=t==="enter")},E=(t,a)=>{a===X.value&&h(t)},G=t=>{n.value=t,x(N)};return e.onMounted(()=>{o.value&&(o.value.style.transition=`left ${m.value}ms ease`,o.value.style.left="0%"),x(N)}),e.onBeforeUnmount(()=>{_()}),v({prev:j,next:N,goto:h}),()=>{var d,q;const t=(q=(d=l.default)==null?void 0:d.call(l))!=null?q:[];let a=t;return a.length===1&&a[0].type===e.Fragment&&(a=(a[0].children||[]).filter(V=>(V==null?void 0:V.type)!==e.Comment)),a.length!==n.value&&G(a.length),e.createVNode("div",{class:f.b(),style:{height:B.value},onMouseenter:()=>k("enter"),onMouseleave:()=>k("leave")},[p.value!=="never"&&T.value?e.createVNode("div",{class:f.e("arrow")},[e.createVNode("button",{class:"arrow-left",onClick:()=>j()},[e.createVNode(F,null,null)]),e.createVNode("button",{class:"arrow-right",onClick:()=>N()},[e.createVNode(L,null,null)])]):null,e.createVNode("div",{class:f.e("item-wrapper"),ref:y},[e.createVNode("div",{class:f.e("item-container"),style:{width:`${n.value*100}%`},ref:o},[t])]),n.value>0&&M.value?e.createVNode("ul",{class:[f.e("dots"),c.value]},[a.map((V,$)=>e.createVNode("li",{class:{"dot-item":!0,active:u.value===$},onClick:()=>E($,"click"),onMouseenter:()=>E($,"hover"),style:{transition:`all ${m.value}ms ease`}},null))]):null])}}}),S=e.defineComponent({name:"DCarouselItem",setup(i,{slots:r}){var f;const l=b("carousel"),v=(f=r.default)==null?void 0:f.call(r);return()=>e.createVNode("div",{class:l.e("item")},[v])}}),O={title:"Carousel \u8D70\u9A6C\u706F",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(i){i.component(I.name,I),i.component(S.name,S)}};s.Carousel=I,s.CarouselItem=S,s.default=O,Object.defineProperty(s,"__esModule",{value:!0}),s[Symbol.toStringTag]="Module"});
@@ -1 +1 @@
1
- .devui-icon__container{display:inline-block;color:var(--devui-icon-fill, #71757f)}.devui-icon__container>*:not(:last-child){vertical-align:middle;margin-right:8px}.devui-icon__container i{vertical-align:middle;transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--no-slots i,.devui-icon--no-slots img{display:block}.devui-icon--disabled{color:var(--devui-disabled-text, #cfd0d3);cursor:not-allowed}.devui-icon--disabled i{color:var(--devui-disabled-text, #cfd0d3)}.devui-icon--operable:not(.devui-icon--disabled){cursor:pointer;transition:color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--operable:not(.devui-icon--disabled) i{cursor:pointer}.devui-icon--operable:hover:not(.devui-icon--disabled){color:var(--devui-icon-fill-hover, #252b3a)}.devui-icon--operable:hover:not(.devui-icon--disabled).devui-icon__container{background-color:var(--devui-icon-background-hover, var(--devui-list-item-hover-bg, #f2f2f3))}.devui-icon--operable:hover:not(.devui-icon--disabled) i{color:var(--devui-icon-fill-hover, #252b3a)}.devui-icon--operable:active:not(.devui-icon--disabled){color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon--operable:active:not(.devui-icon--disabled).devui-icon__container{background-color:var(--devui-icon-background-active, var(--devui-list-item-active-bg, #f2f5fc))}.devui-icon--operable:active:not(.devui-icon--disabled) i{color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon--operable.devui-icon__container{height:32px;line-height:32px;padding:0 8px;margin-left:-8px;border-radius:var(--devui-border-radius, 2px);transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--spin{animation:iconSpin 2.5s linear infinite}.devui-svg-icon{vertical-align:middle}@keyframes iconSpin{0%{transform:rotate(0)}50%{transform:rotate(180deg)}to{transform:rotate(360deg)}}.devui-icon-group{display:inline-flex;align-items:center}.devui-icon-group>.devui-icon__container:not(.devui-icon--operable){padding:8px;margin-left:0}.devui-icon-group>.devui-icon__container:not(.devui-icon--operable):first-child{margin-left:-8px}.devui-icon-group>*:not(:first-child){margin-left:0}.devui-carousel{display:block;position:relative}.devui-carousel .devui-carousel__arrow{position:absolute;width:100%;top:50%}.devui-carousel .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 8px 16px 0) var(--devui-light-shadow, rgba(37, 43, 58, .12));display:inline-flex;align-items:center;justify-content:center;border:0;left:10px}.devui-carousel .devui-carousel__arrow .arrow-left:hover{background:var(--devui-area, #f5f5f5)}.devui-carousel .devui-carousel__arrow .arrow-left svg polygon{fill:var(--devui-text, #252b3a)}.devui-carousel .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 8px 16px 0) var(--devui-light-shadow, rgba(37, 43, 58, .12));display:inline-flex;align-items:center;justify-content:center;border:0;right:10px}.devui-carousel .devui-carousel__arrow .arrow-right:hover{background:var(--devui-area, #f5f5f5)}.devui-carousel .devui-carousel__arrow .arrow-right svg polygon{fill:var(--devui-text, #252b3a)}.devui-carousel .devui-carousel__item-wrapper{position:relative;overflow:hidden;height:100%}.devui-carousel .devui-carousel__item-wrapper .devui-carousel__item-container{display:flex;height:100%;position:relative}.devui-carousel .devui-carousel__item-wrapper .devui-carousel__item-container .devui-carousel__item{flex:1;position:relative;height:100%}.devui-carousel .devui-carousel__dots{position:absolute;display:flex;justify-content:center;width:100%;list-style:none}.devui-carousel .devui-carousel__dots.bottom{bottom:8px}.devui-carousel .devui-carousel__dots.top{top:8px}.devui-carousel .devui-carousel__dots .dot-item{width:6px;height:6px;border-radius:3px;margin-right:8px;background:var(--devui-icon-fill, #71757f)}.devui-carousel .devui-carousel__dots .dot-item:hover{cursor:pointer;background:var(--devui-icon-fill-hover, #252b3a)}.devui-carousel .devui-carousel__dots .dot-item.active{width:24px;background:var(--devui-icon-fill-active, #252b3a);transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-carousel .devui-carousel__arrow .arrow-left,.devui-carousel .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
+ .devui-carousel{display:block;position:relative}.devui-carousel .devui-carousel__arrow{position:absolute;width:100%;top:50%}.devui-carousel .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 8px 16px 0) var(--devui-light-shadow, rgba(37, 43, 58, .12));display:inline-flex;align-items:center;justify-content:center;border:0;left:10px}.devui-carousel .devui-carousel__arrow .arrow-left:hover{background:var(--devui-area, #f5f5f5)}.devui-carousel .devui-carousel__arrow .arrow-left svg polygon{fill:var(--devui-text, #252b3a)}.devui-carousel .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 8px 16px 0) var(--devui-light-shadow, rgba(37, 43, 58, .12));display:inline-flex;align-items:center;justify-content:center;border:0;right:10px}.devui-carousel .devui-carousel__arrow .arrow-right:hover{background:var(--devui-area, #f5f5f5)}.devui-carousel .devui-carousel__arrow .arrow-right svg polygon{fill:var(--devui-text, #252b3a)}.devui-carousel .devui-carousel__item-wrapper{position:relative;overflow:hidden;height:100%}.devui-carousel .devui-carousel__item-wrapper .devui-carousel__item-container{display:flex;height:100%;position:relative}.devui-carousel .devui-carousel__item-wrapper .devui-carousel__item-container .devui-carousel__item{flex:1;position:relative;height:100%}.devui-carousel .devui-carousel__dots{position:absolute;display:flex;justify-content:center;width:100%;list-style:none}.devui-carousel .devui-carousel__dots.bottom{bottom:8px}.devui-carousel .devui-carousel__dots.top{top:8px}.devui-carousel .devui-carousel__dots .dot-item{width:6px;height:6px;border-radius:3px;margin-right:8px;background:var(--devui-icon-fill, #71757f)}.devui-carousel .devui-carousel__dots .dot-item:hover{cursor:pointer;background:var(--devui-icon-fill-hover, #252b3a)}.devui-carousel .devui-carousel__dots .dot-item.active{width:24px;background:var(--devui-icon-fill-active, #252b3a);transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-carousel .devui-carousel__arrow .arrow-left,.devui-carousel .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))}
@@ -255,17 +255,7 @@ const useDropdownEvent = ({ id, isOpen, origin, dropdownRef, props, emit }) => {
255
255
  onInvalidate(() => subscriptions.forEach((v) => v()));
256
256
  });
257
257
  };
258
- function useDropdown(id, visible, isOpen, origin, dropdownRef, popDirection, emit) {
259
- const calcPopDirection = (dropdownEl) => {
260
- const elementHeight = dropdownEl.offsetHeight;
261
- const bottomDistance = window.innerHeight - origin.value.getBoundingClientRect().bottom;
262
- const isBottomEnough = bottomDistance >= elementHeight;
263
- if (!isBottomEnough) {
264
- popDirection.value = "top";
265
- } else {
266
- popDirection.value = "bottom";
267
- }
268
- };
258
+ function useDropdown(id, visible, isOpen, origin, dropdownRef, emit) {
269
259
  watch(visible, (newVal, oldVal) => {
270
260
  if (oldVal === void 0) {
271
261
  return;
@@ -289,9 +279,6 @@ function useDropdown(id, visible, isOpen, origin, dropdownRef, popDirection, emi
289
279
  }
290
280
  }
291
281
  }
292
- if (dropdownEl) {
293
- calcPopDirection(dropdownEl);
294
- }
295
282
  });
296
283
  onMounted(() => {
297
284
  dropdownMap.set(id, { toggleEl: origin.value });
@@ -699,7 +686,7 @@ var Dropdown = defineComponent({
699
686
  props,
700
687
  emit
701
688
  });
702
- useDropdown(id, visible, isOpen, origin, dropdownRef, currentPosition, emit);
689
+ useDropdown(id, visible, isOpen, origin, dropdownRef, emit);
703
690
  const {
704
691
  overlayModelValue,
705
692
  overlayShowValue,
@@ -10625,8 +10612,7 @@ const DEFAULT_PREFIX = "icon";
10625
10612
  const iconProps = {
10626
10613
  name: {
10627
10614
  type: String,
10628
- default: "",
10629
- required: true
10615
+ default: ""
10630
10616
  },
10631
10617
  size: {
10632
10618
  type: [Number, String],