vdesign-ui 0.2.6 → 0.2.7
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/dist/components/actionbar/index.js +8 -0
- package/dist/components/actionbar/index.vue +39 -0
- package/dist/components/actionbar/style.less +44 -0
- package/dist/components/actionbar-cell/index.js +7 -0
- package/dist/components/actionbar-cell/index.vue +38 -0
- package/dist/components/actions/index.js +7 -0
- package/dist/components/actions/index.vue +76 -0
- package/dist/components/actions/style.less +109 -0
- package/dist/components/actions-cell/index.js +7 -0
- package/dist/components/actions-cell/index.vue +94 -0
- package/dist/components/actions-cell/style.less +39 -0
- package/dist/components/activityviews/index.js +8 -0
- package/dist/components/activityviews/index.vue +192 -0
- package/dist/components/activityviews/style.less +152 -0
- package/dist/components/badge/index.js +8 -0
- package/dist/components/badge/index.vue +49 -0
- package/dist/components/badge/style.less +54 -0
- package/dist/components/button/index.js +8 -0
- package/dist/components/button/index.vue +93 -0
- package/dist/components/button/style.less +558 -0
- package/dist/components/calendar/end.png +0 -0
- package/dist/components/calendar/index-element.vue +84 -0
- package/dist/components/calendar/index.js +8 -0
- package/dist/components/calendar/index.vue +52 -0
- package/dist/components/calendar/start.png +0 -0
- package/dist/components/calendar/style.less +138 -0
- package/dist/components/checkbox/index.js +8 -0
- package/dist/components/checkbox/index.vue +161 -0
- package/dist/components/checkbox/style.less +289 -0
- package/dist/components/checkbox-group/index.js +7 -0
- package/dist/components/checkbox-group/index.vue +69 -0
- package/dist/components/common/state/index.vue +33 -0
- package/dist/components/common/state/style.less +48 -0
- package/dist/components/data-list/index.js +10 -0
- package/dist/components/data-list/index.vue +19 -0
- package/dist/components/data-list/style.less +623 -0
- package/dist/components/datetime-picker/index.js +8 -0
- package/dist/components/datetime-picker/index.vue +37 -0
- package/dist/components/datetime-picker/style.less +24 -0
- package/dist/components/dialog/index.js +8 -0
- package/dist/components/dialog/index.vue +164 -0
- package/dist/components/dialog/overlay-manager.js +18 -0
- package/dist/components/dialog/style.less +139 -0
- package/dist/components/divider/index.js +8 -0
- package/dist/components/divider/index.vue +54 -0
- package/dist/components/divider/style.less +92 -0
- package/dist/components/dropdown/index.js +8 -0
- package/dist/components/dropdown/index.vue +218 -0
- package/dist/components/dropdown/style.less +432 -0
- package/dist/components/empty/404-dark.png +0 -0
- package/dist/components/empty/404.png +0 -0
- package/dist/components/empty/index.js +8 -0
- package/dist/components/empty/index.vue +138 -0
- package/dist/components/empty/network-dark.png +0 -0
- package/dist/components/empty/network.png +0 -0
- package/dist/components/empty/nocoupons-dark.png +0 -0
- package/dist/components/empty/nocoupons.png +0 -0
- package/dist/components/empty/nodata-dark.png +0 -0
- package/dist/components/empty/nodata.png +0 -0
- package/dist/components/empty/nomargin-dark.png +0 -0
- package/dist/components/empty/nomargin.png +0 -0
- package/dist/components/empty/nonotice-dark.png +0 -0
- package/dist/components/empty/nonotice.png +0 -0
- package/dist/components/empty/noocomments-dark.png +0 -0
- package/dist/components/empty/noocomments.png +0 -0
- package/dist/components/empty/noorders-dark.png +0 -0
- package/dist/components/empty/noorders.png +0 -0
- package/dist/components/empty/noposition-dark.png +0 -0
- package/dist/components/empty/noposition.png +0 -0
- package/dist/components/empty/nosearch-dark.png +0 -0
- package/dist/components/empty/nosearch.png +0 -0
- package/dist/components/empty/style.less +61 -0
- package/dist/components/footer/index.js +7 -0
- package/dist/components/footer/index.vue +33 -0
- package/dist/components/footer/style.less +21 -0
- package/dist/components/footnav/index.js +7 -0
- package/dist/components/footnav/index.vue +93 -0
- package/dist/components/footnav/style.less +23 -0
- package/dist/components/footnav-item/index.js +7 -0
- package/dist/components/footnav-item/index.vue +50 -0
- package/dist/components/footnav-item/style.less +39 -0
- package/dist/components/form/index.js +7 -0
- package/dist/components/form/index.vue +12 -0
- package/dist/components/headnav/index.js +7 -0
- package/dist/components/headnav/index.vue +185 -0
- package/dist/components/headnav/style.less +232 -0
- package/dist/components/icon/font/iconfont.css +163 -0
- package/dist/components/icon/font/iconfont.js +6 -0
- package/dist/components/icon/index.js +9 -0
- package/dist/components/icon/index.vue +96 -0
- package/dist/components/icon/style.less +44 -0
- package/dist/components/input/calcTextareaHeight.js +162 -0
- package/dist/components/input/index.js +8 -0
- package/dist/components/input/index.vue +345 -0
- package/dist/components/input/style.less +471 -0
- package/dist/components/list/index.js +8 -0
- package/dist/components/list/index.vue +152 -0
- package/dist/components/list/style.less +213 -0
- package/dist/components/loading/index.js +7 -0
- package/dist/components/loading/index.vue +68 -0
- package/dist/components/loading/style.less +54 -0
- package/dist/components/mixins/clickoutside.js +81 -0
- package/dist/components/mixins/dom.js +41 -0
- package/dist/components/mixins/languageMixin.js +41 -0
- package/dist/components/mixins/outlineConfigPlugin.js +45 -0
- package/dist/components/mixins/router-link.js +23 -0
- package/dist/components/mixins/themeMixin.js +43 -0
- package/dist/components/noticebar/index.js +8 -0
- package/dist/components/noticebar/index.vue +258 -0
- package/dist/components/noticebar/style.less +328 -0
- package/dist/components/overlay/index.js +8 -0
- package/dist/components/overlay/index.vue +184 -0
- package/dist/components/overlay/style.less +23 -0
- package/dist/components/pagebreak/index.js +7 -0
- package/dist/components/pagebreak/index.vue +67 -0
- package/dist/components/pagebreak/style.less +42 -0
- package/dist/components/password/index.js +8 -0
- package/dist/components/password/index.vue +60 -0
- package/dist/components/popover/index.js +8 -0
- package/dist/components/popover/index.vue +100 -0
- package/dist/components/popover/style.less +346 -0
- package/dist/components/popover/vue-popover.vue +314 -0
- package/dist/components/popup/index.js +7 -0
- package/dist/components/popup/index.vue +243 -0
- package/dist/components/radio/index.js +8 -0
- package/dist/components/radio/index.vue +184 -0
- package/dist/components/radio/style.less +294 -0
- package/dist/components/radio-group/index.js +6 -0
- package/dist/components/radio-group/index.vue +58 -0
- package/dist/components/result/completed-dark.png +0 -0
- package/dist/components/result/completed.png +0 -0
- package/dist/components/result/error-dark.png +0 -0
- package/dist/components/result/error.png +0 -0
- package/dist/components/result/index.js +8 -0
- package/dist/components/result/index.vue +73 -0
- package/dist/components/result/style.less +44 -0
- package/dist/components/result/wait-dark.png +0 -0
- package/dist/components/result/wait.png +0 -0
- package/dist/components/search/index.js +8 -0
- package/dist/components/search/index.vue +66 -0
- package/dist/components/selector/index.js +8 -0
- package/dist/components/selector/index.vue +161 -0
- package/dist/components/selector/style.less +484 -0
- package/dist/components/skeleton/index.js +7 -0
- package/dist/components/skeleton/index.vue +206 -0
- package/dist/components/skeleton/style.less +197 -0
- package/dist/components/slider/draggable.js +49 -0
- package/dist/components/slider/index.js +7 -0
- package/dist/components/slider/index.vue +167 -0
- package/dist/components/slider/style.less +100 -0
- package/dist/components/slider/utils.js +60 -0
- package/dist/components/step/index.js +7 -0
- package/dist/components/step/index.vue +48 -0
- package/dist/components/step/style.less +58 -0
- package/dist/components/step-item/index.js +7 -0
- package/dist/components/step-item/index.vue +126 -0
- package/dist/components/step-item/style.less +362 -0
- package/dist/components/stepper/index.js +8 -0
- package/dist/components/stepper/index.vue +146 -0
- package/dist/components/style/index.vue +42 -0
- package/dist/components/switch/index.js +8 -0
- package/dist/components/switch/index.vue +72 -0
- package/dist/components/switch/style.less +56 -0
- package/dist/components/tab/index.js +7 -0
- package/dist/components/tab/index.vue +53 -0
- package/dist/components/tabs/index.js +8 -0
- package/dist/components/tabs/index.vue +172 -0
- package/dist/components/tabs/style.less +377 -0
- package/dist/components/tag/index.js +7 -0
- package/dist/components/tag/index.vue +64 -0
- package/dist/components/tag/style.less +211 -0
- package/dist/components/title/index.js +8 -0
- package/dist/components/title/index.vue +99 -0
- package/dist/components/title/style.less +188 -0
- package/dist/components/toast/index.js +83 -0
- package/dist/components/toast/index.vue +49 -0
- package/dist/components/toast/style.less +55 -0
- package/dist/components/transition/index.js +8 -0
- package/dist/components/transition/index.vue +13 -0
- package/dist/components/transition/style.less +208 -0
- package/dist/components/upload/index.js +7 -0
- package/dist/components/upload/index.vue +106 -0
- package/dist/components/upload/style.less +147 -0
- package/dist/components/utils/assist.js +34 -0
- package/dist/components/utils/env.js +2 -0
- package/dist/demo.html +10 -0
- package/dist/locale/ar.js +98 -0
- package/dist/locale/en.js +98 -0
- package/dist/locale/zh.js +98 -0
- package/dist/token.css +2990 -0
- package/dist/vdesign-ui.common.js +27076 -0
- package/dist/vdesign-ui.css +1 -0
- package/dist/vdesign-ui.umd.js +27086 -0
- package/dist/vdesign-ui.umd.min.js +32 -0
- package/package.json +1 -1
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
@tag-prefix-cls: vd-tag;
|
|
2
|
+
|
|
3
|
+
.@{tag-prefix-cls}{
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
border-radius: var(--radius-tag-bg);
|
|
7
|
+
padding: 0 var(--spacing-tag-padding_y);
|
|
8
|
+
|
|
9
|
+
&--s {
|
|
10
|
+
font-size: var(--en-single-f-b-s-fontSize);
|
|
11
|
+
font-weight: var(--en-single-f-b-s-fontWeight);
|
|
12
|
+
height: var(--height-tag-s);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&--l {
|
|
16
|
+
font-size: var(--en-single-f-b-r-fontSize);
|
|
17
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
18
|
+
height: var(--height-tag-m);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
&--white{
|
|
24
|
+
color: var(--color-tag-default-text);
|
|
25
|
+
background-color: var(--color-tag-default-bg);
|
|
26
|
+
|
|
27
|
+
&__border{
|
|
28
|
+
background-color:transparent;
|
|
29
|
+
font-size: var(--en-single-f-b-r-fontSize);
|
|
30
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
31
|
+
color: var(--color-tag-default_border-text);
|
|
32
|
+
&::after{
|
|
33
|
+
border-color: var(--color-tag-default-border);
|
|
34
|
+
border-radius: calc(var(--radius-tag-bg) * 2);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&--dark{
|
|
40
|
+
color: var(--color-tag-dark-text);
|
|
41
|
+
background-color: var(--color-tag-dark-bg);
|
|
42
|
+
|
|
43
|
+
&__border{
|
|
44
|
+
background-color:transparent;
|
|
45
|
+
font-size: var(--en-single-f-b-r-fontSize);
|
|
46
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
47
|
+
color: var(--color-tag-dark_border-text);
|
|
48
|
+
&::after{
|
|
49
|
+
border-color: var(--color-tag-dark-border);
|
|
50
|
+
border-radius: calc(var(--radius-tag-bg) * 2);
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&--blue{
|
|
57
|
+
color: var(--color-tag-blue-text);
|
|
58
|
+
background-color: var(--color-tag-blue-bg);
|
|
59
|
+
|
|
60
|
+
&__border{
|
|
61
|
+
background-color:transparent;
|
|
62
|
+
font-size: var(--en-single-f-b-r-fontSize);
|
|
63
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
64
|
+
&::after{
|
|
65
|
+
border-color: var(--color-tag-blue-border);
|
|
66
|
+
border-radius: calc(var(--radius-tag-bg) * 2);
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&--cyan{
|
|
73
|
+
color: var(--color-tag-cyan-text);
|
|
74
|
+
background-color: var(--color-tag-cyan-bg);
|
|
75
|
+
|
|
76
|
+
&__border{
|
|
77
|
+
background-color:transparent;
|
|
78
|
+
font-size: var(--en-single-f-b-r-fontSize);
|
|
79
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
80
|
+
&::after{
|
|
81
|
+
border-color: var(--color-tag-cyan-border);
|
|
82
|
+
border-radius: calc(var(--radius-tag-bg) * 2);
|
|
83
|
+
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
&--green{
|
|
91
|
+
color: var(--color-tag-green-text);
|
|
92
|
+
background-color: var(--color-tag-green-bg);
|
|
93
|
+
|
|
94
|
+
&__border{
|
|
95
|
+
background-color:transparent;
|
|
96
|
+
font-size: var(--en-single-f-b-r-fontSize);
|
|
97
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
98
|
+
&::after{
|
|
99
|
+
border-color: var(--color-tag-green-border);
|
|
100
|
+
border-radius: calc(var(--radius-tag-bg) * 2);
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&--olive{
|
|
108
|
+
color: var(--color-tag-olive-text);
|
|
109
|
+
background-color: var(--color-tag-olive-bg);
|
|
110
|
+
|
|
111
|
+
&__border{
|
|
112
|
+
background-color:transparent;
|
|
113
|
+
font-size: var(--en-single-f-b-r-fontSize);
|
|
114
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
115
|
+
&::after{
|
|
116
|
+
border-color: var(--color-tag-olive-border);
|
|
117
|
+
border-radius: calc(var(--radius-tag-bg) * 2);
|
|
118
|
+
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
&--yellow{
|
|
126
|
+
color: var(--color-tag-yellow-text);
|
|
127
|
+
background-color: var(--color-tag-yellow-bg);
|
|
128
|
+
|
|
129
|
+
&__border{
|
|
130
|
+
background-color:transparent;
|
|
131
|
+
font-size: var(--en-single-f-b-r-fontSize);
|
|
132
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
133
|
+
&::after{
|
|
134
|
+
border-color: var(--color-tag-yellow-border);
|
|
135
|
+
border-radius: calc(var(--radius-tag-bg) * 2);
|
|
136
|
+
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&--orange{
|
|
143
|
+
color: var(--color-tag-orange-text);
|
|
144
|
+
background-color: var(--color-tag-orange-bg);
|
|
145
|
+
|
|
146
|
+
&__border{
|
|
147
|
+
background-color:transparent;
|
|
148
|
+
font-size: var(--en-single-f-b-r-fontSize);
|
|
149
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
150
|
+
&::after{
|
|
151
|
+
border-color: var(--color-tag-orange-border);
|
|
152
|
+
border-radius: calc(var(--radius-tag-bg) * 2);
|
|
153
|
+
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&--red{
|
|
159
|
+
color: var(--color-tag-red-text);
|
|
160
|
+
background-color: var(--color-tag-red-bg);
|
|
161
|
+
|
|
162
|
+
&__border{
|
|
163
|
+
background-color:transparent;
|
|
164
|
+
font-size: var(--en-single-f-b-r-fontSize);
|
|
165
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
166
|
+
&::after{
|
|
167
|
+
border-color: var(--color-tag-red-border);
|
|
168
|
+
border-radius: calc(var(--radius-tag-bg) * 2);
|
|
169
|
+
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&--pink{
|
|
175
|
+
color: var(--color-tag-pink-text);
|
|
176
|
+
background-color: var(--color-tag-pink-bg);
|
|
177
|
+
|
|
178
|
+
&__border{
|
|
179
|
+
background-color:transparent;
|
|
180
|
+
font-size: var(--en-single-f-b-r-fontSize);
|
|
181
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
182
|
+
&::after{
|
|
183
|
+
border-color: var(--color-tag-pink-border);
|
|
184
|
+
border-radius: calc(var(--radius-tag-bg) * 2);
|
|
185
|
+
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
&--purple{
|
|
192
|
+
color: var(--color-tag-purple-text);
|
|
193
|
+
background-color: var(--color-tag-purple-bg);
|
|
194
|
+
|
|
195
|
+
&__border{
|
|
196
|
+
background-color:transparent;
|
|
197
|
+
font-size: var(--en-single-f-b-r-fontSize);
|
|
198
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
199
|
+
&::after{
|
|
200
|
+
border-color: var(--color-tag-purple-border);
|
|
201
|
+
border-radius: calc(var(--radius-tag-bg) * 2);
|
|
202
|
+
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
&--plain {
|
|
208
|
+
background-color:transparent;
|
|
209
|
+
padding: 0;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="['vd-title', wrapClasses]" @click="handleClick">
|
|
3
|
+
<div class="vd-title--left">
|
|
4
|
+
<div class="vd-title-content">
|
|
5
|
+
<vd-icon v-if="leftIcon" :name="leftIcon" :class="leftIconClasses"></vd-icon>
|
|
6
|
+
<span :class="['vd-title-inner__title', innerTitleClasses]">{{ title }}</span>
|
|
7
|
+
<vd-icon v-if="rightIcon" :name="rightIcon" :class="rightIconClasses"></vd-icon>
|
|
8
|
+
</div>
|
|
9
|
+
<p v-if="subText" :class="['vd-title__subtext', subTextClasses]">{{ subText }}</p>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="vd-title--right" v-if="guideText || arrow || $slots.right">
|
|
12
|
+
<slot name="right">
|
|
13
|
+
<span v-if="guideText" :class="textRightClasses">{{ guideText }}</span>
|
|
14
|
+
<vd-icon v-if="arrow" class="vd-title-arrow" name="icon_btn_next"></vd-icon>
|
|
15
|
+
</slot>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
<script>
|
|
20
|
+
import VdIcon from '../icon';
|
|
21
|
+
const prefixCls = 'vd-title';
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
name: 'vd-title',
|
|
25
|
+
components: {
|
|
26
|
+
VdIcon
|
|
27
|
+
},
|
|
28
|
+
props: {
|
|
29
|
+
type: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: 'primary'
|
|
32
|
+
},
|
|
33
|
+
title: String,
|
|
34
|
+
leftIcon: String,
|
|
35
|
+
rightIcon: String,
|
|
36
|
+
arrow: Boolean,
|
|
37
|
+
subText: String,
|
|
38
|
+
guideText: String,
|
|
39
|
+
sticky: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
},
|
|
45
|
+
data() {
|
|
46
|
+
return {
|
|
47
|
+
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
computed: {
|
|
51
|
+
wrapClasses() {
|
|
52
|
+
return {
|
|
53
|
+
[`${prefixCls}-${this.type}`]: this.type,
|
|
54
|
+
[`${prefixCls}-${this.type}-double`]: this.subText,
|
|
55
|
+
[`${prefixCls}--sticky`]: this.sticky
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
},
|
|
59
|
+
leftIconClasses() {
|
|
60
|
+
return {
|
|
61
|
+
[`${prefixCls}-${this.type}__icon--left`]: this.type
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
},
|
|
65
|
+
innerTitleClasses() {
|
|
66
|
+
return {
|
|
67
|
+
[`${prefixCls}-${this.type}__title`]: this.type
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
},
|
|
71
|
+
subTextClasses() {
|
|
72
|
+
return {
|
|
73
|
+
[`${prefixCls}-${this.type}__subtext`]: this.type
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
rightIconClasses() {
|
|
77
|
+
return {
|
|
78
|
+
[`${prefixCls}-${this.type}__icon--right`]: this.type
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
textRightClasses() {
|
|
82
|
+
return {
|
|
83
|
+
[`${prefixCls}-${this.type}__text--right`]: this.type
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
methods: {
|
|
88
|
+
handleClick() {
|
|
89
|
+
if (this.arrow) {
|
|
90
|
+
this.$emit('next');
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<style lang="less">
|
|
98
|
+
@import './style.less';
|
|
99
|
+
</style>
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
|
|
2
|
+
@title-prefix-cls: vd-title;
|
|
3
|
+
|
|
4
|
+
.@{title-prefix-cls} {
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
padding-inline-start: var(--spacing-title-padding_left);
|
|
9
|
+
padding-inline-end: var(--spacing-title-padding_right);
|
|
10
|
+
background-color: var(--bg-color-1);
|
|
11
|
+
|
|
12
|
+
&--sticky {
|
|
13
|
+
position: sticky;
|
|
14
|
+
top: 0;
|
|
15
|
+
z-index: 1000;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&--right {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&-content {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&-inner__title {
|
|
29
|
+
color: var(--color-title-head);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&__subtext {
|
|
33
|
+
margin-block-start: var(--spacing-title-subtitle-margin_top);
|
|
34
|
+
color: var(--color-title-text);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&-arrow {
|
|
38
|
+
color: var(--color-title-icon_arrow);
|
|
39
|
+
font-size: var(--icon-title-arrow);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&-primary {
|
|
43
|
+
height: var(--height-title-primary);
|
|
44
|
+
|
|
45
|
+
&__icon--left {
|
|
46
|
+
margin-inline-end: var(--spacing-title-primary_icon-margin_y);
|
|
47
|
+
font-size: var(--icon-title-primary);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&__icon--right {
|
|
51
|
+
margin-inline-start: var(--spacing-title-primary_icon-margin_y);
|
|
52
|
+
font-size: var(--icon-title-primary);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&__title {
|
|
56
|
+
font-size: var(--en-single-f-f-b-fontSize);
|
|
57
|
+
font-weight: var(--en-single-f-f-b-fontWeight);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&__text--right {
|
|
61
|
+
margin-inline-end: var(--spacing-title-text-margin_right);
|
|
62
|
+
font-size: var(--en-single-f-c-r-fontSize);
|
|
63
|
+
font-weight: var(--en-single-f-c-r-fontWeight);
|
|
64
|
+
color: var(--color-title-text);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&__subtext {
|
|
68
|
+
font-size: var(--en-single-f-c-r-fontSize);
|
|
69
|
+
font-weight: var(--en-single-f-c-r-fontWeight);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&-secondary {
|
|
74
|
+
height: var(--height-title-secondary);
|
|
75
|
+
|
|
76
|
+
&__icon--left {
|
|
77
|
+
margin-inline-end: var(--spacing-title-secondary_icon-margin_y);
|
|
78
|
+
font-size: var(--icon-title-secondary);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&__icon--right {
|
|
82
|
+
margin-inline-start: var(--spacing-title-secondary_icon-margin_y);
|
|
83
|
+
font-size: var(--icon-title-secondary);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&__title {
|
|
87
|
+
font-size: var(--en-single-f-e-s-fontSize);
|
|
88
|
+
font-weight: var(--en-single-f-e-s-fontWeight);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&__text--right {
|
|
92
|
+
margin-inline-end: var(--spacing-title-text-margin_right);
|
|
93
|
+
font-size: var(--en-single-f-c-r-fontSize);
|
|
94
|
+
font-weight: var(--en-single-f-c-r-fontWeight);
|
|
95
|
+
color: var(--color-title-text);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&__subtext {
|
|
99
|
+
font-size: var(--en-single-f-b-r-fontSize);
|
|
100
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&-tertiary {
|
|
105
|
+
height: var(--height-title-tertiary);
|
|
106
|
+
|
|
107
|
+
&__icon--left {
|
|
108
|
+
margin-inline-end: var(--spacing-title-tertiary_icon-margin_y);
|
|
109
|
+
font-size: var(--icon-title-tertiary);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&__icon--right {
|
|
113
|
+
margin-inline-start: var(--spacing-title-tertiary_icon-margin_y);
|
|
114
|
+
font-size: var(--icon-title-tertiary);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&__title {
|
|
118
|
+
font-size: var(--en-single-f-d-s-fontSize);
|
|
119
|
+
font-weight: var(--en-single-f-d-s-fontWeight);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&__text--right {
|
|
123
|
+
margin-inline-end: var(--spacing-title-text-margin_right);
|
|
124
|
+
font-size: var(--en-single-f-b-r-fontSize);
|
|
125
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
126
|
+
color: var(--color-title-text);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&__subtext {
|
|
130
|
+
font-size: var(--en-single-f-b-r-fontSize);
|
|
131
|
+
font-weight: var(--en-single-f-b-r-fontSize);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&-quaternary {
|
|
136
|
+
height: var(--height-title-quaternary);
|
|
137
|
+
|
|
138
|
+
&__icon--left {
|
|
139
|
+
margin-inline-end: var(--spacing-title-quaternary_icon-margin_y);
|
|
140
|
+
font-size: var(--icon-title-quaternary);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&__icon--right {
|
|
144
|
+
margin-inline-start: var(--spacing-title-quaternary_icon-margin_y);
|
|
145
|
+
font-size: var(--icon-title-quaternary);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&__title {
|
|
149
|
+
font-size: var(--en-single-f-c-s-fontSize);
|
|
150
|
+
font-weight: var(--en-single-f-c-s-fontWeight);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&__text--right {
|
|
154
|
+
margin-inline-end: var(--spacing-title-text-margin_right);
|
|
155
|
+
font-size: var(--en-single-f-b-r-fontSize);
|
|
156
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
157
|
+
color: var(--color-title-text);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&__subtext {
|
|
161
|
+
font-size: var(--en-single-f-a-r-fontSize);
|
|
162
|
+
font-weight: var(--en-single-f-a-r-fontSize);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&-label {
|
|
167
|
+
padding-inline-start: 0;
|
|
168
|
+
padding-inline-end: 0;
|
|
169
|
+
font-size: var(--en-single-f-c-r-fontSize);
|
|
170
|
+
font-weight: var(--en-single-f-c-r-fontWeight);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&-primary-double {
|
|
174
|
+
height: var(--height-title-primary_double);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&-secondary-double {
|
|
178
|
+
height: var(--height-title-secondary_double);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&-tertiary-double {
|
|
182
|
+
height: var(--height-title-tertiary_double);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&-quaternary-double {
|
|
186
|
+
height: var(--height-title-quaternary_double);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import Vue from 'vue';
|
|
2
|
+
import ToastComponent from './index.vue';
|
|
3
|
+
import { inBrowser } from '../utils/env';
|
|
4
|
+
|
|
5
|
+
let timer = null;
|
|
6
|
+
let currentToast = null;
|
|
7
|
+
|
|
8
|
+
class VdToast extends Vue.extend(ToastComponent) {
|
|
9
|
+
constructor(options) {
|
|
10
|
+
super();
|
|
11
|
+
|
|
12
|
+
this.vm = this.$mount();
|
|
13
|
+
|
|
14
|
+
// 支持字符串或对象传入
|
|
15
|
+
if (typeof options === 'string' || typeof options === 'number') {
|
|
16
|
+
this.message = options;
|
|
17
|
+
} else if (typeof options === 'object') {
|
|
18
|
+
Object.assign(this, options);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
this.init();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
init() {
|
|
25
|
+
if (inBrowser) {
|
|
26
|
+
document.body.appendChild(this.vm.$el);
|
|
27
|
+
this.start();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
start() {
|
|
32
|
+
clearTimeout(timer);
|
|
33
|
+
timer = setTimeout(() => {
|
|
34
|
+
this.isShow = true;
|
|
35
|
+
|
|
36
|
+
if (this.duration > 0) {
|
|
37
|
+
this.end();
|
|
38
|
+
}
|
|
39
|
+
}, 100);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
end() {
|
|
43
|
+
clearTimeout(timer);
|
|
44
|
+
if (this.duration > 0) {
|
|
45
|
+
timer = setTimeout(() => {
|
|
46
|
+
this.isShow = false;
|
|
47
|
+
setTimeout(() => {
|
|
48
|
+
// 检查元素是否仍在 DOM 中
|
|
49
|
+
if (inBrowser && document.body.contains(this.vm.$el)) {
|
|
50
|
+
document.body.removeChild(this.vm.$el);
|
|
51
|
+
}
|
|
52
|
+
}, 500);
|
|
53
|
+
}, this.duration);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
clear() {
|
|
58
|
+
this.isShow = false;
|
|
59
|
+
clearTimeout(timer);
|
|
60
|
+
// 检查元素是否仍在 DOM 中
|
|
61
|
+
if (inBrowser && document.body.contains(this.vm.$el)) {
|
|
62
|
+
document.body.removeChild(this.vm.$el);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// 创建静态方法以支持直接调用
|
|
68
|
+
const showToast = options => {
|
|
69
|
+
currentToast && currentToast.clear(); // 清除现有的 toast
|
|
70
|
+
currentToast = new VdToast(options); // 创建新的 toast 实例
|
|
71
|
+
return currentToast;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// 添加静态方法,支持手动清除
|
|
75
|
+
showToast.clear = () => {
|
|
76
|
+
currentToast && currentToast.clear();
|
|
77
|
+
currentToast = null;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// 在 Vue 的原型上挂载,方便全局调用
|
|
81
|
+
Vue.prototype.$VdToast = showToast;
|
|
82
|
+
|
|
83
|
+
export default showToast;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 消息提示 -->
|
|
3
|
+
<div :class="['vd-toast', { 'vd-toast-show': isShow }, { 'vd-toast-icon': !!icon }, customClass]"
|
|
4
|
+
:style="`background:${bgColor};`">
|
|
5
|
+
<i v-if="!!icon" class="vd-iconfont" :class="[isImage ? '' : `vd-icon-${icon}`]">
|
|
6
|
+
<img class="vd-img-icon" v-if="isImage" :src="icon" />
|
|
7
|
+
</i>
|
|
8
|
+
<div>{{ message }}</div>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
name: 'vd-toast',
|
|
14
|
+
data() {
|
|
15
|
+
return {
|
|
16
|
+
message: '', // 提示语
|
|
17
|
+
isShow: false, // 是否显示
|
|
18
|
+
bgColor: '', // 背景颜色
|
|
19
|
+
icon: '', // 图标
|
|
20
|
+
duration: 1500, // 延迟时间
|
|
21
|
+
position: 'middle' // default:middle, value: top, bottom
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
computed: {
|
|
25
|
+
isImage() {
|
|
26
|
+
return this.icon.includes('/');
|
|
27
|
+
},
|
|
28
|
+
customClass() {
|
|
29
|
+
var classes = [];
|
|
30
|
+
switch (this.position) {
|
|
31
|
+
case 'top':
|
|
32
|
+
classes.push('vd-toast__top');
|
|
33
|
+
break;
|
|
34
|
+
case 'bottom':
|
|
35
|
+
classes.push('vd-toast__bottom');
|
|
36
|
+
break;
|
|
37
|
+
default:
|
|
38
|
+
classes.push('vd-toast__middle');
|
|
39
|
+
}
|
|
40
|
+
classes.push(this.className);
|
|
41
|
+
|
|
42
|
+
return classes.join(' ');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
<style lang="less">
|
|
48
|
+
@import './style.less';
|
|
49
|
+
</style>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
@prefix: ~"vd-toast";
|
|
2
|
+
|
|
3
|
+
.@{prefix} {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
width: max-content;
|
|
6
|
+
position: fixed;
|
|
7
|
+
top: 50%;
|
|
8
|
+
left: 50%;
|
|
9
|
+
transform: translate(-50%, -50%);
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
text-align: center;
|
|
12
|
+
z-index: 1000;
|
|
13
|
+
transition: opacity .3s linear;
|
|
14
|
+
opacity: 0;
|
|
15
|
+
// token
|
|
16
|
+
min-width: var(--width-toast-small);
|
|
17
|
+
max-width: var(--width-toast-large);
|
|
18
|
+
padding: var(--spacing-toast-padding_x) var(--spacing-toast-padding_y);
|
|
19
|
+
background-color: var(--color-toast-bg);
|
|
20
|
+
border-radius: var(--radius-toast-content);
|
|
21
|
+
color: var(--color-toast-text);
|
|
22
|
+
font-size: var(--en-single-f-c-r-fontSize);
|
|
23
|
+
font-weight: var(--en-single-f-c-r-fontWeight);
|
|
24
|
+
|
|
25
|
+
&.vd-toast-show {
|
|
26
|
+
opacity: 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&-icon {
|
|
30
|
+
min-height: var(--height-toast-small);
|
|
31
|
+
|
|
32
|
+
.vd-iconfont {
|
|
33
|
+
font-size: var(--icon-toast-size);
|
|
34
|
+
margin-bottom: var(--spacing-toast-icon-margin_bottom);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&__top {
|
|
39
|
+
top: 50px;
|
|
40
|
+
left: 50%;
|
|
41
|
+
transform: translate(-50%, 0);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&__middle {
|
|
45
|
+
left: 50%;
|
|
46
|
+
top: 50%;
|
|
47
|
+
transform: translate(-50%, -50%);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&__bottom {
|
|
51
|
+
bottom: 50px;
|
|
52
|
+
left: 50%;
|
|
53
|
+
transform: translate(-50%, 0);
|
|
54
|
+
}
|
|
55
|
+
}
|