vue-devui 1.0.0-rc.1 → 1.0.0-rc.12
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/README.md +70 -121
- package/alert/index.es.js +46 -15
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8204 -296
- package/auto-complete/index.umd.js +29 -1
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +153 -146
- package/avatar/index.umd.js +1 -1
- package/avatar/style.css +1 -1
- package/badge/index.es.js +36 -5
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5727 -111
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.es.js +63 -35
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +8068 -255
- package/checkbox/index.umd.js +27 -1
- package/checkbox/style.css +1 -1
- package/{accordion → collapse}/index.d.ts +0 -0
- package/collapse/index.es.js +213 -0
- package/collapse/index.umd.js +1 -0
- package/{anchor → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.es.js +59 -19
- package/countdown/index.umd.js +1 -1
- package/{anchor → date-picker-pro}/index.d.ts +0 -0
- package/date-picker-pro/index.es.js +10856 -0
- package/date-picker-pro/index.umd.js +27 -0
- package/{breadcrumb → date-picker-pro}/package.json +1 -1
- package/date-picker-pro/style.css +1 -0
- package/drawer/index.es.js +31 -4
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +210 -149
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +569 -159
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +1048 -1187
- package/form/index.umd.js +15 -15
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +29 -5
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/grid/index.es.js +101 -86
- package/grid/index.umd.js +1 -1
- package/grid/style.css +1 -1
- package/icon/index.es.js +183 -23
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +53 -30
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8101 -144
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +274 -177
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +40 -25
- package/layout/index.umd.js +1 -1
- package/layout/style.css +1 -1
- package/loading/index.es.js +74 -35
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/modal/index.es.js +375 -171
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +293 -40
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/CheckboxGroup.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.js +3 -0
- package/nuxt/components/DropdownPropsKey.js +3 -0
- package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
- package/nuxt/components/FORM_TOKEN.js +3 -0
- package/nuxt/components/Icon.js +1 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/LoadingOptions.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/OptionGroup.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/Step.js +3 -0
- package/nuxt/components/Steps.js +3 -0
- package/nuxt/components/TABLE_TOKEN.js +3 -0
- package/nuxt/components/Tab.js +3 -0
- package/nuxt/components/TimeSelect.js +3 -0
- package/nuxt/components/autoCompleteProps.js +3 -0
- package/nuxt/components/avatarProps.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.js +3 -0
- package/nuxt/components/cardProps.js +3 -0
- package/nuxt/components/checkboxGroupInjectionKey.js +3 -0
- package/nuxt/components/checkboxGroupProps.js +3 -0
- package/nuxt/components/checkboxProps.js +3 -0
- package/nuxt/components/colProps.js +3 -0
- package/nuxt/components/colPropsBaseClass.js +3 -0
- package/nuxt/components/colPropsBaseStyle.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/countdownProps.js +3 -0
- package/nuxt/components/datePickerProCommonProps.js +3 -0
- package/nuxt/components/datePickerProPanelProps.js +3 -0
- package/nuxt/components/datePickerProProps.js +3 -0
- package/nuxt/components/editableSelectProps.js +3 -0
- package/nuxt/components/formItemProps.js +3 -0
- package/nuxt/components/formProps.js +3 -0
- package/nuxt/components/iconProps.js +1 -0
- package/nuxt/components/imagePreviewProps.js +3 -0
- package/nuxt/components/inputProps.js +3 -0
- package/nuxt/components/loadingProps.js +3 -0
- package/nuxt/components/modalProps.js +3 -0
- package/nuxt/components/progressProps.js +3 -0
- package/nuxt/components/rateProps.js +3 -0
- package/nuxt/components/resultProps.js +3 -0
- package/nuxt/components/rowProps.js +3 -0
- package/nuxt/components/screenSizes.js +3 -0
- package/nuxt/components/skeletonProps.js +3 -0
- package/nuxt/components/sliderProps.js +3 -0
- package/nuxt/components/splitterProps.js +3 -0
- package/nuxt/components/statisticProps.js +3 -0
- package/nuxt/components/stepProps.js +3 -0
- package/nuxt/components/stepsProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/switchProps.js +3 -0
- package/nuxt/components/tableProps.js +3 -0
- package/nuxt/components/tabsProps.js +3 -0
- package/nuxt/components/tagProps.js +3 -0
- package/nuxt/components/textareaProps.js +3 -0
- package/nuxt/components/timeAxisProps.js +3 -0
- package/nuxt/components/timerPickerPanelProps.js +3 -0
- package/nuxt/components/treeProps.js +3 -0
- package/overlay/index.es.js +104 -133
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +4 -2
- package/pagination/index.es.js +171 -141
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +294 -230
- package/popover/index.umd.js +15 -15
- package/popover/style.css +1 -1
- package/progress/index.es.js +110 -56
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/radio/index.es.js +7967 -146
- package/radio/index.umd.js +27 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +77 -55
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.es.js +170 -27
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/ripple/index.es.js +43 -42
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +3660 -1097
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +8998 -487
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +46 -24
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +144 -138
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +468 -340
- package/splitter/index.umd.js +16 -16
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +41 -34
- package/statistic/index.umd.js +1 -1
- package/statistic/style.css +1 -1
- package/status/index.es.js +26 -2
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/{back-top → steps}/index.d.ts +0 -0
- package/steps/index.es.js +385 -0
- package/steps/index.umd.js +1 -0
- package/{gantt → steps}/package.json +1 -1
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.es.js +7802 -64
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +10315 -1147
- package/table/index.umd.js +27 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +345 -142
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +47 -23
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +7921 -83
- package/textarea/index.umd.js +35 -1
- package/textarea/style.css +1 -1
- package/time-picker/index.es.js +8704 -559
- package/time-picker/index.umd.js +27 -1
- package/time-picker/style.css +1 -1
- package/{breadcrumb → time-select}/index.d.ts +0 -0
- package/{color-picker → time-select}/index.es.js +4116 -2914
- package/time-select/index.umd.js +27 -0
- package/{back-top → time-select}/package.json +1 -1
- package/time-select/style.css +1 -0
- package/timeline/index.es.js +177 -37
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +286 -221
- package/tooltip/index.umd.js +15 -15
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +5325 -1855
- package/tree/index.umd.js +18 -18
- package/tree/style.css +1 -1
- package/upload/index.es.js +456 -133
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +14986 -16343
- package/vue-devui.umd.js +30 -20
- package/accordion/index.es.js +0 -723
- package/accordion/index.umd.js +0 -1
- package/accordion/package.json +0 -7
- package/accordion/style.css +0 -1
- package/anchor/index.es.js +0 -263
- package/anchor/index.umd.js +0 -1
- package/anchor/style.css +0 -1
- package/back-top/index.es.js +0 -130
- package/back-top/index.umd.js +0 -1
- package/back-top/style.css +0 -1
- package/breadcrumb/index.es.js +0 -128
- package/breadcrumb/index.umd.js +0 -1
- package/breadcrumb/style.css +0 -1
- package/carousel/index.d.ts +0 -7
- package/carousel/index.es.js +0 -314
- package/carousel/index.umd.js +0 -1
- package/carousel/package.json +0 -7
- package/carousel/style.css +0 -1
- package/cascader/index.d.ts +0 -7
- package/cascader/index.es.js +0 -5971
- package/cascader/index.umd.js +0 -27
- package/cascader/package.json +0 -7
- package/cascader/style.css +0 -1
- package/color-picker/index.d.ts +0 -7
- package/color-picker/index.umd.js +0 -27
- package/color-picker/package.json +0 -7
- package/color-picker/style.css +0 -1
- package/comment/index.d.ts +0 -7
- package/comment/index.es.js +0 -86
- package/comment/index.umd.js +0 -1
- package/comment/package.json +0 -7
- package/comment/style.css +0 -1
- package/date-picker/index.d.ts +0 -7
- package/date-picker/index.es.js +0 -1154
- package/date-picker/index.umd.js +0 -1
- package/date-picker/package.json +0 -7
- package/date-picker/style.css +0 -1
- package/dragdrop/index.d.ts +0 -7
- package/dragdrop/index.es.js +0 -157
- package/dragdrop/index.umd.js +0 -1
- package/dragdrop/package.json +0 -7
- package/gantt/index.d.ts +0 -7
- package/gantt/index.es.js +0 -523
- package/gantt/index.umd.js +0 -1
- package/gantt/style.css +0 -1
- package/input-icon/index.d.ts +0 -7
- package/input-icon/index.es.js +0 -332
- package/input-icon/index.umd.js +0 -1
- package/input-icon/package.json +0 -7
- package/input-icon/style.css +0 -1
- package/list/index.d.ts +0 -7
- package/list/index.es.js +0 -39
- package/list/index.umd.js +0 -1
- package/list/package.json +0 -7
- package/list/style.css +0 -1
- package/nav-sprite/index.d.ts +0 -7
- package/nav-sprite/index.es.js +0 -68
- package/nav-sprite/index.umd.js +0 -1
- package/nav-sprite/package.json +0 -7
- package/nuxt/components/Accordion.js +0 -3
- package/nuxt/components/Anchor.js +0 -3
- package/nuxt/components/BackTop.js +0 -3
- package/nuxt/components/Breadcrumb.js +0 -3
- package/nuxt/components/Carousel.js +0 -3
- package/nuxt/components/CarouselItem.js +0 -3
- package/nuxt/components/Cascader.js +0 -3
- package/nuxt/components/ColorPicker.js +0 -3
- package/nuxt/components/Comment.js +0 -3
- package/nuxt/components/DatePicker.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/Gantt.js +0 -3
- package/nuxt/components/InputIcon.js +0 -3
- package/nuxt/components/List.js +0 -3
- package/nuxt/components/ListItem.js +0 -3
- package/nuxt/components/NavSprite.js +0 -2
- package/nuxt/components/QuadrantDiagram.js +0 -3
- package/nuxt/components/ReadTip.js +0 -3
- package/nuxt/components/StepsGuide.js +0 -3
- package/nuxt/components/StickSlider.js +0 -3
- package/nuxt/components/Sticky.js +0 -2
- package/nuxt/components/TagInput.js +0 -3
- package/nuxt/components/Transfer.js +0 -3
- package/nuxt/components/TreeSelect.js +0 -3
- package/nuxt/components/overlayEmits.js +0 -3
- package/nuxt/components/overlayProps.js +0 -3
- package/quadrant-diagram/index.d.ts +0 -7
- package/quadrant-diagram/index.es.js +0 -5728
- package/quadrant-diagram/index.umd.js +0 -27
- package/quadrant-diagram/package.json +0 -7
- package/quadrant-diagram/style.css +0 -1
- package/read-tip/index.d.ts +0 -7
- package/read-tip/index.es.js +0 -261
- package/read-tip/index.umd.js +0 -1
- package/read-tip/package.json +0 -7
- package/read-tip/style.css +0 -1
- package/steps-guide/index.d.ts +0 -7
- package/steps-guide/index.es.js +0 -242
- package/steps-guide/index.umd.js +0 -1
- package/steps-guide/package.json +0 -7
- package/steps-guide/style.css +0 -1
- package/sticky/index.d.ts +0 -7
- package/sticky/index.es.js +0 -197
- package/sticky/index.umd.js +0 -1
- package/sticky/package.json +0 -7
- package/tag-input/index.d.ts +0 -7
- package/tag-input/index.es.js +0 -331
- package/tag-input/index.umd.js +0 -1
- package/tag-input/package.json +0 -7
- package/tag-input/style.css +0 -1
- package/transfer/index.d.ts +0 -7
- package/transfer/index.es.js +0 -7615
- package/transfer/index.umd.js +0 -27
- package/transfer/package.json +0 -7
- package/transfer/style.css +0 -1
- package/tree-select/index.d.ts +0 -7
- package/tree-select/index.es.js +0 -627
- package/tree-select/index.umd.js +0 -1
- package/tree-select/package.json +0 -7
- package/tree-select/style.css +0 -1
package/carousel/index.es.js
DELETED
|
@@ -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 };
|
package/carousel/index.umd.js
DELETED
|
@@ -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"});
|
package/carousel/package.json
DELETED
package/carousel/style.css
DELETED
|
@@ -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))}
|