vue-devui 1.6.4 → 1.6.6
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.
- package/auto-complete/index.es.js +19 -6
- package/auto-complete/index.umd.js +10 -10
- package/auto-complete/style.css +1 -1
- package/breadcrumb/index.es.js +2 -15
- package/breadcrumb/index.umd.js +1 -1
- package/breadcrumb/style.css +1 -1
- package/button/index.es.js +31 -12
- package/button/index.umd.js +10 -10
- package/button/style.css +1 -1
- package/carousel/index.es.js +36 -213
- package/carousel/index.umd.js +1 -1
- package/carousel/style.css +1 -1
- package/category-search/index.es.js +53 -29
- package/category-search/index.umd.js +12 -12
- package/category-search/style.css +1 -1
- package/checkbox/index.es.js +22 -9
- package/checkbox/index.umd.js +8 -8
- package/checkbox/style.css +1 -1
- package/code-review/style.css +1 -1
- package/collapse/index.es.js +15 -18
- package/collapse/index.umd.js +5 -5
- package/data-grid/index.es.js +48 -29
- package/data-grid/index.umd.js +6 -6
- package/data-grid/style.css +1 -1
- package/date-picker-pro/index.es.js +91 -20
- package/date-picker-pro/index.umd.js +16 -16
- package/date-picker-pro/style.css +1 -1
- package/dropdown/index.es.js +2 -15
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +84 -207
- package/editable-select/index.umd.js +20 -16
- package/editable-select/style.css +1 -1
- package/editor-md/index.es.js +32 -18
- package/editor-md/index.umd.js +15 -15
- package/editor-md/style.css +1 -1
- package/form/style.css +1 -1
- package/icon/index.es.js +1 -2
- package/icon/index.umd.js +1 -1
- package/input/index.es.js +27 -7
- package/input/index.umd.js +11 -11
- package/input/style.css +1 -1
- package/input-number/index.es.js +5 -0
- package/input-number/index.umd.js +10 -10
- package/input-number/style.css +1 -1
- package/mention/index.es.js +12 -3
- package/mention/index.umd.js +8 -8
- package/mention/style.css +1 -1
- package/message/index.es.js +1 -2
- package/message/index.umd.js +1 -1
- package/modal/index.es.js +27 -4
- package/modal/index.umd.js +7 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +1 -2
- package/notification/index.umd.js +2 -2
- package/overlay/style.css +1 -1
- package/package.json +1 -1
- package/pagination/index.es.js +83 -263
- package/pagination/index.umd.js +14 -19
- package/pagination/style.css +1 -1
- package/popover/style.css +1 -1
- package/radio/index.es.js +10 -28
- package/radio/index.umd.js +9 -9
- package/radio/style.css +1 -1
- package/result/index.es.js +1 -2
- package/result/index.umd.js +1 -1
- package/search/index.es.js +54 -28
- package/search/index.umd.js +18 -14
- package/search/style.css +1 -1
- package/select/index.es.js +71 -52
- package/select/index.umd.js +18 -23
- package/select/style.css +1 -1
- package/splitter/style.css +1 -1
- package/steps/index.es.js +1 -2
- package/steps/index.umd.js +1 -1
- package/style.css +2 -2
- package/switch/index.es.js +16 -2
- package/switch/index.umd.js +15 -15
- package/switch/style.css +1 -1
- package/table/index.es.js +49 -30
- package/table/index.umd.js +12 -12
- package/table/style.css +1 -1
- package/textarea/index.es.js +6 -1
- package/textarea/index.umd.js +1 -1
- package/textarea/style.css +1 -1
- package/time-picker/index.es.js +66 -14
- package/time-picker/index.umd.js +16 -16
- package/time-picker/style.css +1 -1
- package/time-select/index.es.js +71 -52
- package/time-select/index.umd.js +12 -17
- package/time-select/style.css +1 -1
- package/timeline/index.es.js +1 -2
- package/timeline/index.umd.js +1 -1
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +22 -9
- package/tree/index.umd.js +9 -9
- package/tree/style.css +1 -1
- package/types/auto-complete/src/auto-complete-types.d.ts +4 -0
- package/types/carousel/src/components/carousel-icons.d.ts +2 -0
- package/types/cascader/src/cascader-types.d.ts +4 -0
- package/types/checkbox/src/checkbox-types.d.ts +8 -0
- package/types/date-picker-pro/src/date-picker-pro-types.d.ts +12 -0
- package/types/date-picker-pro/src/range-date-picker-types.d.ts +4 -0
- package/types/dropdown/src/use-dropdown.d.ts +1 -1
- package/types/editable-select/src/editable-select-types.d.ts +4 -0
- package/types/editor-md/src/composables/use-editor-md.d.ts +1 -0
- package/types/editor-md/src/editor-md-types.d.ts +3 -0
- package/types/icon/src/icon-types.d.ts +0 -1
- package/types/input/src/input-types.d.ts +4 -0
- package/types/input-icon/src/input-icon.d.ts +9 -0
- package/types/input-number/src/input-number-types.d.ts +4 -0
- package/types/mention/src/mention-types.d.ts +4 -0
- package/types/mention/src/mention.d.ts +9 -0
- package/types/modal/src/components/modal-icons.d.ts +1 -0
- package/types/radio/src/radio-types.d.ts +8 -0
- package/types/select/src/select-types.d.ts +4 -0
- package/types/svg-icons/index.d.ts +3 -0
- package/types/textarea/src/textarea-types.d.ts +4 -0
- package/types/time-picker/src/components/time-scroll/index.d.ts +9 -0
- package/types/time-picker/src/time-picker-types.d.ts +4 -0
- package/upload/index.es.js +1 -2
- package/upload/index.umd.js +2 -2
- package/vue-devui.es.js +393 -174
- package/vue-devui.umd.js +93 -82
- package/types/search/src/components/search-close-icon.d.ts +0 -2
- package/types/search/src/components/search-icon.d.ts +0 -2
- package/types/select/src/components/select-arrow-icon.d.ts +0 -2
package/carousel/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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(
|
|
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(
|
|
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", {
|
package/carousel/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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"});
|
package/carousel/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-
|
|
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,
|
|
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,
|
|
689
|
+
useDropdown(id, visible, isOpen, origin, dropdownRef, emit);
|
|
703
690
|
const {
|
|
704
691
|
overlayModelValue,
|
|
705
692
|
overlayShowValue,
|
|
@@ -2728,6 +2715,10 @@ const commonProps = {
|
|
|
2728
2715
|
size: {
|
|
2729
2716
|
type: String,
|
|
2730
2717
|
default: "md"
|
|
2718
|
+
},
|
|
2719
|
+
showGlowStyle: {
|
|
2720
|
+
type: Boolean,
|
|
2721
|
+
default: true
|
|
2731
2722
|
}
|
|
2732
2723
|
};
|
|
2733
2724
|
const checkboxProps = __spreadProps(__spreadValues({}, commonProps), {
|
|
@@ -10453,7 +10444,10 @@ var Checkbox = defineComponent({
|
|
|
10453
10444
|
active: mergedChecked.value,
|
|
10454
10445
|
"half-checked": props.halfChecked,
|
|
10455
10446
|
disabled: mergedDisabled.value,
|
|
10456
|
-
unchecked: !mergedChecked.value
|
|
10447
|
+
unchecked: !mergedChecked.value,
|
|
10448
|
+
[ns2.m("glow-style")]: props.showGlowStyle,
|
|
10449
|
+
[ns2.m(`checkbox-${size.value}`)]: border.value,
|
|
10450
|
+
[ns2.m("checkbox-bordered")]: border.value
|
|
10457
10451
|
};
|
|
10458
10452
|
const labelTitle = mergedIsShowTitle.value ? props.title || props.label : "";
|
|
10459
10453
|
const bgImgStyle = mergedColor.value && props.halfChecked || mergedColor.value ? `linear-gradient(${mergedColor.value}, ${mergedColor.value})` : "";
|
|
@@ -10470,7 +10464,7 @@ var Checkbox = defineComponent({
|
|
|
10470
10464
|
[ns2.m("no-animation")]: !mergedShowAnimation.value
|
|
10471
10465
|
};
|
|
10472
10466
|
const labelCls = {
|
|
10473
|
-
[ns2.m(size.value)]:
|
|
10467
|
+
[ns2.m(size.value)]: border.value,
|
|
10474
10468
|
[ns2.m("bordered")]: border.value
|
|
10475
10469
|
};
|
|
10476
10470
|
const stopPropagation = ($event) => $event.stopPropagation();
|
|
@@ -10482,7 +10476,11 @@ var Checkbox = defineComponent({
|
|
|
10482
10476
|
"style": wrapperStyle.value
|
|
10483
10477
|
}, [createVNode("div", {
|
|
10484
10478
|
"class": checkboxCls
|
|
10485
|
-
}, [createVNode("
|
|
10479
|
+
}, [props.showGlowStyle && mergedShowAnimation.value && createVNode("div", {
|
|
10480
|
+
"class": ns2.e("glow-box")
|
|
10481
|
+
}, [createVNode("span", {
|
|
10482
|
+
"class": "glow-bg"
|
|
10483
|
+
}, null)]), createVNode("label", {
|
|
10486
10484
|
"title": labelTitle,
|
|
10487
10485
|
"onClick": handleClick,
|
|
10488
10486
|
"class": labelCls,
|
|
@@ -10504,18 +10502,20 @@ var Checkbox = defineComponent({
|
|
|
10504
10502
|
}, [createVNode("span", {
|
|
10505
10503
|
"class": ns2.e("halfchecked-bg")
|
|
10506
10504
|
}, null), createVNode("svg", {
|
|
10507
|
-
"viewBox": "0 0
|
|
10508
|
-
"
|
|
10509
|
-
"
|
|
10505
|
+
"viewBox": "0 0 14 14",
|
|
10506
|
+
"width": "14",
|
|
10507
|
+
"height": "14",
|
|
10510
10508
|
"class": ns2.e("tick-wrap")
|
|
10511
10509
|
}, [createVNode("g", {
|
|
10512
10510
|
"stroke": "none",
|
|
10513
10511
|
"stroke-width": "1",
|
|
10514
10512
|
"fill": "none",
|
|
10515
10513
|
"fill-rule": "evenodd"
|
|
10516
|
-
}, [createVNode("
|
|
10517
|
-
"
|
|
10518
|
-
"
|
|
10514
|
+
}, [createVNode("path", {
|
|
10515
|
+
"d": "M 2.3 7.0 5.6 9.6 11.4 3.5",
|
|
10516
|
+
"stroke": "#fff",
|
|
10517
|
+
"stroke-width": "1.5",
|
|
10518
|
+
"fill": "none",
|
|
10519
10519
|
"class": polygonCls
|
|
10520
10520
|
}, null)])])]), createVNode("span", {
|
|
10521
10521
|
"class": ns2.e("label-text")
|
|
@@ -10625,8 +10625,7 @@ const DEFAULT_PREFIX = "icon";
|
|
|
10625
10625
|
const iconProps = {
|
|
10626
10626
|
name: {
|
|
10627
10627
|
type: String,
|
|
10628
|
-
default: ""
|
|
10629
|
-
required: true
|
|
10628
|
+
default: ""
|
|
10630
10629
|
},
|
|
10631
10630
|
size: {
|
|
10632
10631
|
type: [Number, String],
|
|
@@ -11102,19 +11101,36 @@ var Button = defineComponent({
|
|
|
11102
11101
|
classes,
|
|
11103
11102
|
iconClass
|
|
11104
11103
|
} = useButton(props, ctx);
|
|
11104
|
+
const isMouseDown = ref(false);
|
|
11105
|
+
const showWave = ref(false);
|
|
11106
|
+
const waveStyle = reactive({
|
|
11107
|
+
top: "0px",
|
|
11108
|
+
left: "0px"
|
|
11109
|
+
});
|
|
11110
|
+
const showClickWave = (e) => {
|
|
11111
|
+
waveStyle.left = e.offsetX + "px";
|
|
11112
|
+
waveStyle.top = e.offsetY + "px";
|
|
11113
|
+
showWave.value = true;
|
|
11114
|
+
setTimeout(() => {
|
|
11115
|
+
showWave.value = false;
|
|
11116
|
+
}, 300);
|
|
11117
|
+
};
|
|
11105
11118
|
const onClick = (e) => {
|
|
11106
11119
|
if (loading2.value) {
|
|
11107
11120
|
return;
|
|
11108
11121
|
}
|
|
11122
|
+
showClickWave(e);
|
|
11109
11123
|
ctx.emit("click", e);
|
|
11110
11124
|
};
|
|
11111
11125
|
return () => {
|
|
11112
11126
|
var _a, _b;
|
|
11113
11127
|
return createVNode("button", {
|
|
11114
|
-
"class": classes.value,
|
|
11128
|
+
"class": [classes.value, isMouseDown.value ? "mousedown" : ""],
|
|
11115
11129
|
"disabled": disabled.value,
|
|
11116
11130
|
"onClick": onClick,
|
|
11117
|
-
"type": nativeType.value
|
|
11131
|
+
"type": nativeType.value,
|
|
11132
|
+
"onMousedown": () => isMouseDown.value = true,
|
|
11133
|
+
"onMouseup": () => isMouseDown.value = false
|
|
11118
11134
|
}, [icon2.value && createVNode(Icon, {
|
|
11119
11135
|
"name": icon2.value,
|
|
11120
11136
|
"size": "var(--devui-font-size, 12px)",
|
|
@@ -11128,7 +11144,10 @@ var Button = defineComponent({
|
|
|
11128
11144
|
"color": "#BBDEFB"
|
|
11129
11145
|
}, null)]), [[vShow, loading2.value]]), createVNode("span", {
|
|
11130
11146
|
"class": "button-content"
|
|
11131
|
-
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])
|
|
11147
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]), showWave.value && createVNode("div", {
|
|
11148
|
+
"class": "water-wave",
|
|
11149
|
+
"style": waveStyle
|
|
11150
|
+
}, null)]);
|
|
11132
11151
|
};
|
|
11133
11152
|
}
|
|
11134
11153
|
});
|
|
@@ -11353,6 +11372,10 @@ const inputNumberProps = {
|
|
|
11353
11372
|
reg: {
|
|
11354
11373
|
type: [RegExp, String],
|
|
11355
11374
|
default: ""
|
|
11375
|
+
},
|
|
11376
|
+
showGlowStyle: {
|
|
11377
|
+
type: Boolean,
|
|
11378
|
+
default: true
|
|
11356
11379
|
}
|
|
11357
11380
|
};
|
|
11358
11381
|
const ns$1 = useNamespace$1("input-number");
|
|
@@ -11407,6 +11430,7 @@ function useRender(props, ctx) {
|
|
|
11407
11430
|
const wrapClass = computed(() => [
|
|
11408
11431
|
{
|
|
11409
11432
|
[ns.b()]: true,
|
|
11433
|
+
[ns.m("glow-style")]: props.showGlowStyle,
|
|
11410
11434
|
[ns.m(inputNumberSize.value)]: true
|
|
11411
11435
|
},
|
|
11412
11436
|
customClass
|