vue-devui 1.0.0-rc.8 → 1.0.1
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 +188 -149
- package/alert/index.es.js +14 -9
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8392 -418
- package/auto-complete/index.umd.js +29 -5
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +59 -74
- package/avatar/index.umd.js +1 -1
- package/badge/index.es.js +10 -4
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +191 -53
- package/button/index.umd.js +17 -17
- package/button/style.css +1 -1
- package/card/index.es.js +7 -3
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +8050 -241
- package/checkbox/index.umd.js +27 -1
- package/checkbox/style.css +1 -1
- package/{date-picker → collapse}/index.d.ts +0 -0
- package/collapse/index.es.js +213 -0
- package/collapse/index.umd.js +1 -0
- package/{date-picker → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.es.js +56 -13
- package/countdown/index.umd.js +1 -1
- package/date-picker-pro/index.d.ts +7 -0
- package/date-picker-pro/index.es.js +12022 -0
- package/date-picker-pro/index.umd.js +27 -0
- package/date-picker-pro/package.json +7 -0
- package/date-picker-pro/style.css +1 -0
- package/drawer/index.es.js +24 -7
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +190 -165
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +785 -145
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +399 -300
- package/form/index.umd.js +16 -16
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +2 -2
- package/fullscreen/index.umd.js +1 -1
- package/grid/index.es.js +8 -6
- package/grid/index.umd.js +1 -1
- package/icon/index.es.js +185 -23
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +2 -2
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8220 -45
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +279 -204
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +3 -3
- package/layout/index.umd.js +1 -1
- package/loading/index.es.js +53 -53
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/mention/index.d.ts +7 -0
- package/mention/index.es.js +8319 -0
- package/mention/index.umd.js +36 -0
- package/mention/package.json +7 -0
- package/mention/style.css +1 -0
- package/menu/index.d.ts +7 -0
- package/menu/index.es.js +921 -0
- package/menu/index.umd.js +1 -0
- package/menu/package.json +7 -0
- package/menu/style.css +1 -0
- package/message/index.d.ts +7 -0
- package/message/index.es.js +539 -0
- package/message/index.umd.js +1 -0
- package/message/package.json +7 -0
- package/message/style.css +1 -0
- package/modal/index.es.js +451 -173
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +212 -70
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/CheckboxButton.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/Icon.js +1 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/Mention.js +3 -0
- package/nuxt/components/Menu.js +3 -0
- package/nuxt/components/MenuItem.js +3 -0
- package/nuxt/components/Message.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/SubMenu.js +3 -0
- package/nuxt/components/TABLE_TOKEN.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/TimeSelect.js +3 -0
- package/nuxt/components/animationInjectionKey.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.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/iconProps.js +1 -0
- package/nuxt/components/mentionProps.js +3 -0
- package/nuxt/components/messageProps.js +3 -0
- package/nuxt/components/paginationInjectionKey.js +3 -0
- package/nuxt/components/roundInjectionKey.js +3 -0
- package/nuxt/components/skeletonItemProps.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/tableProps.js +3 -0
- package/nuxt/components/timerPickerPanelProps.js +3 -0
- package/nuxt/components/treeNodeProps.js +3 -0
- package/overlay/index.es.js +89 -142
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +8 -4
- package/pagination/index.es.js +10180 -129
- package/pagination/index.umd.js +27 -1
- package/pagination/style.css +1 -1
- package/panel/index.es.js +4 -0
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +262 -229
- package/popover/index.umd.js +15 -15
- package/popover/style.css +1 -1
- package/progress/index.es.js +2 -2
- package/progress/index.umd.js +2 -2
- package/progress/style.css +1 -1
- package/radio/index.es.js +7954 -156
- package/radio/index.umd.js +27 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +16 -8
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.es.js +170 -22
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/search/index.es.js +3829 -1042
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +9202 -495
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +89 -263
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +118 -145
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +454 -233
- package/splitter/index.umd.js +13 -13
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +34 -16
- package/statistic/index.umd.js +1 -1
- package/statistic/style.css +1 -1
- package/status/index.es.js +6 -2
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/steps/index.d.ts +7 -0
- package/steps/index.es.js +387 -0
- package/steps/index.umd.js +1 -0
- package/steps/package.json +7 -0
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.es.js +7787 -62
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +5225 -1726
- package/table/index.umd.js +18 -18
- package/table/style.css +1 -1
- package/tabs/index.es.js +303 -102
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +11 -8
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +7876 -41
- package/textarea/index.umd.js +35 -1
- package/textarea/style.css +1 -1
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +9549 -0
- package/time-picker/index.umd.js +27 -0
- package/time-picker/package.json +7 -0
- package/time-picker/style.css +1 -0
- package/time-select/index.d.ts +7 -0
- package/time-select/index.es.js +9607 -0
- package/time-select/index.umd.js +27 -0
- package/time-select/package.json +7 -0
- package/time-select/style.css +1 -0
- package/timeline/index.es.js +170 -22
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +286 -238
- package/tooltip/index.umd.js +14 -14
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +11342 -793
- package/tree/index.umd.js +27 -1
- package/tree/style.css +1 -1
- package/upload/index.es.js +458 -102
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +20475 -11072
- package/vue-devui.umd.js +31 -24
- package/date-picker/index.es.js +0 -1097
- package/date-picker/index.umd.js +0 -1
- package/date-picker/style.css +0 -1
- package/nuxt/components/DatePicker.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/Loading.js +0 -3
- package/nuxt/components/StickSlider.js +0 -3
- package/nuxt/components/formControlProps.js +0 -3
- package/nuxt/components/overlayEmits.js +0 -3
- package/nuxt/components/overlayProps.js +0 -3
package/timeline/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, toRefs, createVNode, inject, provide, ref, reactive, onMounted, watch, toRef, nextTick, Fragment } from "vue";
|
|
1
|
+
import { defineComponent, toRefs, computed, createVNode, resolveDynamicComponent, mergeProps, inject, provide, ref, reactive, onMounted, watch, toRef, nextTick, Fragment } from "vue";
|
|
2
2
|
const timeAxisProps = {
|
|
3
3
|
direction: {
|
|
4
4
|
type: String,
|
|
@@ -17,6 +17,7 @@ const timeAxisProps = {
|
|
|
17
17
|
default: "left"
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
+
const DEFAULT_PREFIX = "icon";
|
|
20
21
|
const iconProps = {
|
|
21
22
|
name: {
|
|
22
23
|
type: String,
|
|
@@ -24,43 +25,190 @@ const iconProps = {
|
|
|
24
25
|
required: true
|
|
25
26
|
},
|
|
26
27
|
size: {
|
|
27
|
-
type: String,
|
|
28
|
+
type: [Number, String],
|
|
28
29
|
default: "inherit"
|
|
29
30
|
},
|
|
30
31
|
color: {
|
|
31
32
|
type: String,
|
|
32
33
|
default: "inherit"
|
|
33
34
|
},
|
|
35
|
+
component: {
|
|
36
|
+
type: Object,
|
|
37
|
+
default: null
|
|
38
|
+
},
|
|
34
39
|
classPrefix: {
|
|
35
40
|
type: String,
|
|
36
|
-
default:
|
|
41
|
+
default: DEFAULT_PREFIX
|
|
42
|
+
},
|
|
43
|
+
operable: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
disabled: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: false
|
|
50
|
+
},
|
|
51
|
+
rotate: {
|
|
52
|
+
type: [Number, String]
|
|
37
53
|
}
|
|
38
54
|
};
|
|
39
|
-
|
|
40
|
-
name:
|
|
41
|
-
|
|
55
|
+
const svgIconProps = {
|
|
56
|
+
name: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: "",
|
|
59
|
+
required: true
|
|
60
|
+
},
|
|
61
|
+
color: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: "inherit"
|
|
64
|
+
},
|
|
65
|
+
size: {
|
|
66
|
+
type: [Number, String],
|
|
67
|
+
default: "inherit"
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
function createBem(namespace, element, modifier) {
|
|
71
|
+
let cls = namespace;
|
|
72
|
+
if (element) {
|
|
73
|
+
cls += `__${element}`;
|
|
74
|
+
}
|
|
75
|
+
if (modifier) {
|
|
76
|
+
cls += `--${modifier}`;
|
|
77
|
+
}
|
|
78
|
+
return cls;
|
|
79
|
+
}
|
|
80
|
+
function useNamespace(block, needDot = false) {
|
|
81
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
82
|
+
const b = () => createBem(namespace);
|
|
83
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
84
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
85
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
86
|
+
return {
|
|
87
|
+
b,
|
|
88
|
+
e,
|
|
89
|
+
m,
|
|
90
|
+
em
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
var icon = "";
|
|
94
|
+
var svgIcon = defineComponent({
|
|
95
|
+
name: "DSvgIcon",
|
|
96
|
+
props: svgIconProps,
|
|
42
97
|
setup(props) {
|
|
43
98
|
const {
|
|
44
99
|
name,
|
|
45
|
-
size,
|
|
46
100
|
color,
|
|
47
|
-
|
|
101
|
+
size
|
|
48
102
|
} = toRefs(props);
|
|
103
|
+
const ns = useNamespace("svg-icon");
|
|
104
|
+
const iconName = computed(() => `#icon-${name.value}`);
|
|
105
|
+
const iconSize = computed(() => {
|
|
106
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
107
|
+
});
|
|
108
|
+
const styles = {
|
|
109
|
+
width: iconSize.value,
|
|
110
|
+
height: iconSize.value
|
|
111
|
+
};
|
|
49
112
|
return () => {
|
|
50
|
-
return
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
113
|
+
return createVNode("svg", {
|
|
114
|
+
"class": ns.b(),
|
|
115
|
+
"style": styles
|
|
116
|
+
}, [createVNode("use", {
|
|
117
|
+
"xlink:href": iconName.value,
|
|
118
|
+
"fill": color.value
|
|
119
|
+
}, null)]);
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
function isUrl(value) {
|
|
124
|
+
return /^((http|https):)?\/\//.test(value);
|
|
125
|
+
}
|
|
126
|
+
function useIconDom(props, ctx) {
|
|
127
|
+
const {
|
|
128
|
+
component,
|
|
129
|
+
name,
|
|
130
|
+
size,
|
|
131
|
+
color,
|
|
132
|
+
classPrefix,
|
|
133
|
+
rotate
|
|
134
|
+
} = toRefs(props);
|
|
135
|
+
const ns = useNamespace("icon");
|
|
136
|
+
const iconSize = computed(() => {
|
|
137
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
138
|
+
});
|
|
139
|
+
const IconComponent = component.value ? resolveDynamicComponent(component.value) : resolveDynamicComponent(svgIcon);
|
|
140
|
+
const imgIconDom = () => {
|
|
141
|
+
return createVNode("img", mergeProps({
|
|
142
|
+
"src": name.value,
|
|
143
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
144
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
145
|
+
"style": {
|
|
146
|
+
width: iconSize.value || "",
|
|
147
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`,
|
|
148
|
+
verticalAlign: "middle"
|
|
149
|
+
}
|
|
150
|
+
}, ctx.attrs), null);
|
|
151
|
+
};
|
|
152
|
+
const svgIconDom = () => {
|
|
153
|
+
return createVNode(IconComponent, mergeProps({
|
|
154
|
+
"name": name.value,
|
|
155
|
+
"color": color.value,
|
|
156
|
+
"size": iconSize.value,
|
|
157
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
158
|
+
"style": {
|
|
159
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
160
|
+
}
|
|
161
|
+
}, ctx.attrs), null);
|
|
162
|
+
};
|
|
163
|
+
const fontIconDom = () => {
|
|
164
|
+
const fontIconClass = /^icon-/.test(name.value) ? name.value : `${classPrefix.value}-${name.value}`;
|
|
165
|
+
return createVNode("i", mergeProps({
|
|
166
|
+
"class": [classPrefix.value, fontIconClass, (rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
|
|
167
|
+
"style": {
|
|
168
|
+
fontSize: iconSize.value,
|
|
169
|
+
color: color.value,
|
|
170
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
171
|
+
}
|
|
172
|
+
}, ctx.attrs), null);
|
|
173
|
+
};
|
|
174
|
+
const iconDom = () => {
|
|
175
|
+
return component.value ? svgIconDom() : isUrl(name.value) ? imgIconDom() : fontIconDom();
|
|
176
|
+
};
|
|
177
|
+
return {
|
|
178
|
+
iconDom
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
var DIcon = defineComponent({
|
|
182
|
+
name: "DIcon",
|
|
183
|
+
props: iconProps,
|
|
184
|
+
emits: ["click"],
|
|
185
|
+
setup(props, ctx) {
|
|
186
|
+
const {
|
|
187
|
+
disabled,
|
|
188
|
+
operable
|
|
189
|
+
} = toRefs(props);
|
|
190
|
+
const {
|
|
191
|
+
iconDom
|
|
192
|
+
} = useIconDom(props, ctx);
|
|
193
|
+
const ns = useNamespace("icon");
|
|
194
|
+
const wrapClassed = computed(() => ({
|
|
195
|
+
[ns.e("container")]: true,
|
|
196
|
+
[ns.m("disabled")]: disabled.value,
|
|
197
|
+
[ns.m("operable")]: operable.value,
|
|
198
|
+
[ns.m("no-slots")]: !Object.keys(ctx.slots).length
|
|
199
|
+
}));
|
|
200
|
+
const onClick = (e) => {
|
|
201
|
+
if (disabled.value) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
ctx.emit("click", e);
|
|
205
|
+
};
|
|
206
|
+
return () => {
|
|
207
|
+
var _a, _b, _c, _d;
|
|
208
|
+
return createVNode("div", {
|
|
209
|
+
"class": wrapClassed.value,
|
|
210
|
+
"onClick": onClick
|
|
211
|
+
}, [(_b = (_a = ctx.slots).prefix) == null ? void 0 : _b.call(_a), iconDom(), (_d = (_c = ctx.slots).suffix) == null ? void 0 : _d.call(_c)]);
|
|
64
212
|
};
|
|
65
213
|
}
|
|
66
214
|
});
|
package/timeline/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(f,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(f=typeof globalThis!="undefined"?globalThis:f||self,e(f.index={},f.Vue))})(this,function(f,e){"use strict";const b={direction:{type:String,default:"vertical"},center:{type:Boolean,default:!1},mode:{type:String,default:"normal"},timePosition:{type:String,default:"left"}},z={name:{type:String,default:"",required:!0},size:{type:[Number,String],default:"inherit"},color:{type:String,default:"inherit"},component:{type:Object,default:null},classPrefix:{type:String,default:"icon"},operable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},rotate:{type:[Number,String]}},x={name:{type:String,default:"",required:!0},color:{type:String,default:"inherit"},size:{type:[Number,String],default:"inherit"}};function y(n,r,s){let i=n;return r&&(i+=`__${r}`),s&&(i+=`--${s}`),i}function $(n,r=!1){const s=r?`.devui-${n}`:`devui-${n}`;return{b:()=>y(s),e:t=>t?y(s,t):"",m:t=>t?y(s,"",t):"",em:(t,a)=>t&&a?y(s,t,a):""}}var L="",F=e.defineComponent({name:"DSvgIcon",props:x,setup(n){const{name:r,color:s,size:i}=e.toRefs(n),m=$("svg-icon"),o=e.computed(()=>`#icon-${r.value}`),d=e.computed(()=>typeof i.value=="number"?`${i.value}px`:i.value),t={width:d.value,height:d.value};return()=>e.createVNode("svg",{class:m.b(),style:t},[e.createVNode("use",{"xlink:href":o.value,fill:s.value},null)])}});function k(n){return/^((http|https):)?\/\//.test(n)}function q(n,r){const{component:s,name:i,size:m,color:o,classPrefix:d,rotate:t}=e.toRefs(n),a=$("icon"),l=e.computed(()=>typeof m.value=="number"?`${m.value}px`:m.value),u=s.value?e.resolveDynamicComponent(s.value):e.resolveDynamicComponent(F),p=()=>e.createVNode("img",e.mergeProps({src:i.value,alt:i.value.split("/")[i.value.split("/").length-1],class:[(t==null?void 0:t.value)==="infinite"&&a.m("spin")],style:{width:l.value||"",transform:`rotate(${t==null?void 0:t.value}deg)`,verticalAlign:"middle"}},r.attrs),null),h=()=>e.createVNode(u,e.mergeProps({name:i.value,color:o.value,size:l.value,class:[(t==null?void 0:t.value)==="infinite"&&a.m("spin")],style:{transform:`rotate(${t==null?void 0:t.value}deg)`}},r.attrs),null),c=()=>{const S=/^icon-/.test(i.value)?i.value:`${d.value}-${i.value}`;return e.createVNode("i",e.mergeProps({class:[d.value,S,(t==null?void 0:t.value)==="infinite"&&a.m("spin")],style:{fontSize:l.value,color:o.value,transform:`rotate(${t==null?void 0:t.value}deg)`}},r.attrs),null)};return{iconDom:()=>s.value?h():k(i.value)?p():c()}}var E=e.defineComponent({name:"DIcon",props:z,emits:["click"],setup(n,r){const{disabled:s,operable:i}=e.toRefs(n),{iconDom:m}=q(n,r),o=$("icon"),d=e.computed(()=>({[o.e("container")]:!0,[o.m("disabled")]:s.value,[o.m("operable")]:i.value,[o.m("no-slots")]:!Object.keys(r.slots).length})),t=a=>{s.value||r.emit("click",a)};return()=>{var a,l,u,p;return e.createVNode("div",{class:d.value,onClick:t},[(l=(a=r.slots).prefix)==null?void 0:l.call(a),m(),(p=(u=r.slots).suffix)==null?void 0:p.call(u)])}}});const R={time:{type:String},dotColor:{type:String},lineStyle:{type:String,default:"solid"},lineColor:{type:String},position:{type:String},timePosition:{type:String,default:"left"},type:{type:String,default:"primary"}};var g=e.defineComponent({name:"DTimelineItem",components:{DIcon:E},props:R,emits:[],setup(n,r){const s=e.inject("timeAxis"),i="devui-timeline-item",m=()=>{var l,u;return e.createVNode("div",{class:`${i}-time`},[r.slots.time?(u=(l=r.slots).time)==null?void 0:u.call(l):n.time])},o=()=>{var l,u;return e.createVNode("div",{class:`${i}-content`},[(u=(l=r.slots).default)==null?void 0:u.call(l,n)])},d=l=>l.includes(n.position)?o():s.props.direction==="horizontal"||n.timePosition==="left"?m():"",t=l=>l==="primary"?"":e.createVNode("i",{class:`icon-${l==="success"?"right":l}-o`},null),a=()=>{var l,u;return r.slots.dot?e.createVNode("div",{style:{color:n.dotColor},class:`${i}-dot`},[" ",(u=(l=r.slots).dot)==null?void 0:u.call(l)]):e.createVNode("div",{class:`${i}-dot ${i}-type-${n.type}`,style:{borderColor:n.dotColor}},[t(n.type)])};return()=>e.createVNode("div",{class:i},[e.createVNode("div",{class:`${i}-data-left ${i}-data-top`},[d(["top","left"])]),e.createVNode("div",{class:`${i}-axis`},[a(),s.props.direction==="vertical"&&n.timePosition==="bottom"?m():"",e.createVNode("div",{class:`${i}-line ${i}-line-style-${n.lineStyle}`,style:{borderColor:n.lineColor}},[r.slots.extra?e.createVNode("div",{class:`${i}-line-extra`},[r.slots.extra()]):""])]),e.createVNode("div",{class:`${i}-data-right ${i}-data-bottom`},[d(["right","bottom"])])])}}),M="",N=e.defineComponent({name:"DTimeline",components:{TimelineItem:g},props:b,emits:[],setup(n,r){e.provide("timeAxis",{ctx:r,props:n});const s=e.ref(),i=e.reactive({marginLeft:"0px",height:"auto"}),m=()=>{i.height="auto",i.marginLeft="0px",n.direction==="horizontal"&&e.nextTick(()=>{var d;const o=s.value;n.center&&(i.marginLeft=(((d=o==null?void 0:o.firstElementChild)==null?void 0:d.clientWidth)||0)/2+"px"),i.height=Math.max(...Array.from(o==null?void 0:o.querySelectorAll(".devui-timeline-item-data-top")).map(t=>t.clientHeight),...Array.from(o==null?void 0:o.querySelectorAll(".devui-timeline-item-data-bottom")).map(t=>t.clientHeight))*2+Math.max(...Array.from(o==null?void 0:o.querySelectorAll(".devui-timeline-item-axis")).map(t=>t.clientHeight))+"px"})};return e.onMounted(()=>{m()}),e.watch(e.toRef(n,"direction"),()=>{m()}),()=>{const o=(a,l)=>l?e.createVNode(a,{position:l},null):e.createVNode(a,null,null),d=()=>{var u,p,h;const a=(h=(p=(u=r.slots).default)==null?void 0:p.call(u))!=null?h:[];let l;return a.length===1&&a[0].type===e.Fragment?l=a[0].children||[]:l=a,l.map((c,v)=>{var S,V,C,P,I,D,A,T;return v+1===l.length&&!((S=c.props)==null?void 0:S.lineStyle)&&!((V=c.props)==null?void 0:V["line-style"])&&(c=e.createVNode(c,{"line-style":"none"},null)),!((C=c.props)==null?void 0:C.timePosition)&&!((P=c.props)==null?void 0:P["time-position"])&&(c=e.createVNode(c,{"time-position":n.timePosition?n.timePosition:"left"},null)),n.direction==="horizontal"?((I=c.props)==null?void 0:I.position)==="top"||((D=c.props)==null?void 0:D.position)==="bottom"?c:n.mode==="alternative"?o(c,v%2===0?"bottom":"top"):o(c,"bottom"):((A=c.props)==null?void 0:A.position)==="left"||((T=c.props)==null?void 0:T.position)==="right"?c:n.mode==="alternative"?o(c,v%2===0?"left":"right"):o(c,"right")})},t=()=>n.direction==="horizontal"?"horizontal":"vertical";return e.createVNode("div",{class:`devui-timeline devui-timeline-${t()} ${n.center?"devui-timeline-"+t()+"-center":""} `,ref:s,style:i},[d()])}}}),_={title:"Timeline \u65F6\u95F4\u8F74",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(n){n.component(N.name,N),n.component(g.name,g)}};f.Timeline=N,f.TimelineItem=g,f.default=_,f.timeAxisProps=b,Object.defineProperty(f,"__esModule",{value:!0}),f[Symbol.toStringTag]="Module"});
|
package/timeline/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.devui-timeline-vertical{display:flex;flex-direction:column;align-items:center;position:relative}.devui-timeline-vertical .devui-timeline-item{display:flex;flex-direction:row;width:100%}.devui-timeline-vertical .devui-timeline-item-axis{display:flex;flex-direction:column;align-items:center;padding:0 12px}.devui-timeline-vertical .devui-timeline-item-line{position:relative;height:calc(100% - 18px);min-height:20px;border-left-width:2px;border-left-color:var(--devui-dividing-line, #
|
|
1
|
+
.devui-icon__container{display:inline-block;color:var(--devui-icon-fill, #71757f)}.devui-icon__container>*:not(:last-child){vertical-align:middle;margin-right:8px}.devui-icon__container i{vertical-align:middle;transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--no-slots i,.devui-icon--no-slots img{display:block}.devui-icon--disabled{color:var(--devui-disabled-text, #adb0b8);cursor:not-allowed}.devui-icon--disabled i{color:var(--devui-disabled-text, #adb0b8)}.devui-icon--operable:not(.devui-icon--disabled){cursor:pointer;transition:color var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--operable:not(.devui-icon--disabled) i{cursor:pointer}.devui-icon--operable:hover:not(.devui-icon--disabled){color:var(--devui-icon-fill-hover, #252b3a)}.devui-icon--operable:hover:not(.devui-icon--disabled).devui-icon__container{background-color:var(--devui-icon-background-hover, var(--devui-list-item-hover-bg, #f2f2f3))}.devui-icon--operable:hover:not(.devui-icon--disabled) i{color:var(--devui-icon-fill-hover, #252b3a)}.devui-icon--operable:active:not(.devui-icon--disabled){color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon--operable:active:not(.devui-icon--disabled).devui-icon__container{background-color:var(--devui-icon-background-active, var(--devui-list-item-active-bg, #f2f5fc))}.devui-icon--operable:active:not(.devui-icon--disabled) i{color:var(--devui-icon-active-color, var(--devui-icon-fill-active, #252b3a))}.devui-icon--operable.devui-icon__container{height:32px;line-height:32px;padding:0 8px;margin-left:-8px;border-radius:var(--devui-border-radius, 2px);transition:all var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-icon--spin{animation:iconSpin 2.5s linear infinite}.devui-svg-icon{vertical-align:middle}@keyframes iconSpin{0%{transform:rotate(0)}50%{transform:rotate(180deg)}to{transform:rotate(360deg)}}.devui-timeline-vertical{display:flex;flex-direction:column;align-items:center;position:relative}.devui-timeline-vertical .devui-timeline-item{display:flex;flex-direction:row;width:100%}.devui-timeline-vertical .devui-timeline-item-axis{display:flex;flex-direction:column;align-items:center;padding:0 12px}.devui-timeline-vertical .devui-timeline-item-line{position:relative;height:calc(100% - 18px);min-height:20px;border-left-width:2px;border-left-color:var(--devui-dividing-line, #f2f2f3)}.devui-timeline-vertical .devui-timeline-item-line-extra{position:absolute;top:50%;transform:translate(-50%,-50%)}.devui-timeline-vertical .devui-timeline-item-line:first-child{display:none}.devui-timeline-vertical .devui-timeline-item-data-left{text-align:end}.devui-timeline-vertical .devui-timeline-item-data-left,.devui-timeline-vertical .devui-timeline-item-data-right{margin-bottom:24px;margin-top:-2px;flex:1}.devui-timeline-vertical .devui-timeline-item-line-style-dashed{border-left-style:dashed}.devui-timeline-vertical .devui-timeline-item-line-style-solid{border-left-style:solid}.devui-timeline-vertical .devui-timeline-item-line-style-dotted{border-left-style:dotted}.devui-timeline-vertical .devui-timeline-item-line-style-none{border-left-style:none}.devui-timeline-vertical .devui-timeline-item .devui-timeline-middle-zone{position:absolute;top:50%;transform:translate(-50%,-50%)}.devui-timeline-horizontal{display:flex;flex-direction:row;align-items:center;position:relative}.devui-timeline-horizontal-center .devui-timeline-item-data-top,.devui-timeline-horizontal-center .devui-timeline-item-data-bottom{text-align:center;padding:0 6px}.devui-timeline-horizontal-center .devui-timeline-item-data-top>div,.devui-timeline-horizontal-center .devui-timeline-item-data-bottom>div{transform:translate(-50%)}.devui-timeline-horizontal .devui-timeline-item{display:flex;flex-direction:column;height:100%}.devui-timeline-horizontal .devui-timeline-item-axis{display:flex;flex-direction:row;align-items:center;padding:12px 0}.devui-timeline-horizontal .devui-timeline-item-line{position:relative;min-width:60px;width:calc(100% - 18px);border-bottom-width:2px;border-bottom-color:var(--devui-dividing-line, #f2f2f3)}.devui-timeline-horizontal .devui-timeline-item-line-extra{position:absolute;left:50%;transform:translate(-50%,-50%)}.devui-timeline-horizontal .devui-timeline-item:first-child .devui-timeline-item-line:first-child{opacity:0}.devui-timeline-horizontal .devui-timeline-item-data-top,.devui-timeline-horizontal .devui-timeline-item-data-bottom{padding-right:12px;flex:1}.devui-timeline-horizontal .devui-timeline-item-line-style-dashed{border-bottom-style:dashed}.devui-timeline-horizontal .devui-timeline-item-line-style-solid{border-bottom-style:solid}.devui-timeline-horizontal .devui-timeline-item-line-style-dotted{border-bottom-style:dotted}.devui-timeline-horizontal .devui-timeline-item-line-style-none{border-bottom-style:none}.devui-timeline-horizontal .devui-timeline-item .devui-timeline-middle-zone{position:absolute;left:50%;transform:translate(-50%,-50%)}.devui-timeline-item-dot,.devui-timeline-item-dot>svg{width:18px;height:18px;flex-shrink:0}.devui-timeline-item-dot>i{font-size:18px;vertical-align:0}.devui-timeline-item-type-primary{border:2px solid var(--devui-placeholder, #babbc0);border-radius:50%}.devui-timeline-item-type-success i{color:var(--devui-success, #50d4ab)}.devui-timeline-item-type-error i{color:var(--devui-danger, #f66f6a)}.devui-timeline-item-type-warning i{color:var(--devui-warning, #fac20a)}.devui-timeline-item-type-running{line-height:16px;text-align:center;animation:devui-timeline-running 1.5s linear infinite;border:2px solid var(--devui-success, #50d4ab);border-radius:50%}@keyframes devui-timeline-running{0%{transform:rotate(0);color:var(--devui-success, #50d4ab);border-color:var(--devui-success, #50d4ab)}50%{transform:rotate(180deg);color:var(--devui-success, #50d4ab);border-color:var(--devui-success, #50d4ab)}to{transform:rotate(360deg);color:var(--devui-success, #50d4ab);border-color:var(--devui-success, #50d4ab)}}
|