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