vdesign-ui 0.1.21 → 0.1.23
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/actionbar-cell/index.vue +34 -0
- package/dist/components/actionbar/index.js +8 -0
- package/dist/components/actionbar/index.vue +39 -0
- package/dist/components/actionbar/style.less +48 -0
- package/dist/components/actions-cell/actions/index.js +7 -0
- package/dist/components/actions-cell/actions/index.vue +76 -0
- package/dist/components/actions-cell/actions/style.less +112 -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 +140 -0
- package/dist/components/activityviews/style.less +138 -0
- package/dist/components/badge/index.js +8 -0
- package/dist/components/badge/index.vue +49 -0
- package/dist/components/badge/style.less +66 -0
- package/dist/components/button/index.js +8 -0
- package/dist/components/button/index.vue +89 -0
- package/dist/components/button/style.less +563 -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 +167 -0
- package/dist/components/checkbox/assist.js +34 -0
- package/dist/components/checkbox/checkbox-group/index.js +8 -0
- package/dist/components/checkbox/checkbox-group/index.vue +69 -0
- package/dist/components/checkbox/index.js +8 -0
- package/dist/components/checkbox/index.vue +184 -0
- package/dist/components/checkbox/style.less +291 -0
- package/dist/components/common/state/index.vue +80 -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 +624 -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 +162 -0
- package/dist/components/dialog/overlay-manager.js +18 -0
- package/dist/components/dialog/style.less +132 -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 +210 -0
- package/dist/components/dropdown/style.less +418 -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 +95 -0
- package/dist/components/empty/network-dark.png +0 -0
- package/dist/components/empty/network.png +0 -0
- package/dist/components/empty/nodata-dark.png +0 -0
- package/dist/components/empty/nodata.png +0 -0
- package/dist/components/empty/style.less +60 -0
- package/dist/components/footer/index.js +7 -0
- package/dist/components/footer/index.vue +29 -0
- package/dist/components/footer/style.less +22 -0
- package/dist/components/footnav/footnav-item/index.js +7 -0
- package/dist/components/footnav/footnav-item/index.vue +75 -0
- package/dist/components/footnav/footnav-item/style.less +39 -0
- package/dist/components/footnav/index.js +7 -0
- package/dist/components/footnav/index.vue +97 -0
- package/dist/components/footnav/style.less +23 -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 +163 -0
- package/dist/components/headnav/style.less +245 -0
- package/dist/components/icon/font/iconfont.css +1049 -0
- package/dist/components/icon/font/iconfont.js +2 -0
- package/dist/components/icon/index.js +9 -0
- package/dist/components/icon/index.vue +46 -0
- package/dist/components/icon/style.less +44 -0
- package/dist/components/input/calcTextareaHeight.js +266 -0
- package/dist/components/input/index.js +8 -0
- package/dist/components/input/index.vue +343 -0
- package/dist/components/input/password/index.js +8 -0
- package/dist/components/input/password/index.vue +60 -0
- package/dist/components/input/search/index.js +8 -0
- package/dist/components/input/search/index.vue +66 -0
- package/dist/components/input/stepper/index.js +8 -0
- package/dist/components/input/stepper/index.vue +136 -0
- package/dist/components/input/style.less +497 -0
- package/dist/components/list/index.js +8 -0
- package/dist/components/list/index.vue +159 -0
- package/dist/components/list/style.less +292 -0
- package/dist/components/loading/index.js +7 -0
- package/dist/components/loading/index.vue +53 -0
- package/dist/components/loading/loading.png +0 -0
- package/dist/components/loading/refresh.png +0 -0
- package/dist/components/loading/style.less +48 -0
- package/dist/components/mixins/clickoutside.js +81 -0
- package/dist/components/mixins/dom.js +41 -0
- package/dist/components/mixins/languageMixin.js +38 -0
- package/dist/components/mixins/outlineConfigPlugin.js +40 -0
- package/dist/components/mixins/router-link.js +23 -0
- package/dist/components/mixins/themeMixin.js +29 -0
- package/dist/components/noticebar/index.js +8 -0
- package/dist/components/noticebar/index.vue +247 -0
- package/dist/components/noticebar/style.less +332 -0
- package/dist/components/overlay/index.js +8 -0
- package/dist/components/overlay/index.vue +161 -0
- package/dist/components/overlay/style.less +23 -0
- package/dist/components/pagebreak/index.js +7 -0
- package/dist/components/pagebreak/index.vue +60 -0
- package/dist/components/pagebreak/style.less +43 -0
- package/dist/components/popover/index.js +8 -0
- package/dist/components/popover/index.vue +99 -0
- package/dist/components/popover/style.less +346 -0
- package/dist/components/popover/vue-popover.vue +314 -0
- package/dist/components/radio/assist.js +34 -0
- package/dist/components/radio/index.js +8 -0
- package/dist/components/radio/index.vue +158 -0
- package/dist/components/radio/radio-group/index.vue +70 -0
- package/dist/components/radio/style.css +213 -0
- package/dist/components/radio/style.less +302 -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 +75 -0
- package/dist/components/result/style.less +42 -0
- package/dist/components/result/wait-dark.png +0 -0
- package/dist/components/result/wait.png +0 -0
- package/dist/components/selector/index.js +8 -0
- package/dist/components/selector/index.vue +124 -0
- package/dist/components/selector/style.less +474 -0
- package/dist/components/skeleton/index.js +7 -0
- package/dist/components/skeleton/index.vue +142 -0
- package/dist/components/skeleton/style.less +192 -0
- package/dist/components/slider/draggable.js +49 -0
- package/dist/components/slider/index.js +7 -0
- package/dist/components/slider/index.vue +173 -0
- package/dist/components/slider/style.less +96 -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 +59 -0
- package/dist/components/step-item/index.js +7 -0
- package/dist/components/step-item/index.vue +117 -0
- package/dist/components/step-item/style.less +361 -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/tabs/index.js +8 -0
- package/dist/components/tabs/index.vue +145 -0
- package/dist/components/tabs/style.less +385 -0
- package/dist/components/tabs/tab/index.vue +56 -0
- package/dist/components/tag/index.js +7 -0
- package/dist/components/tag/index.vue +50 -0
- package/dist/components/tag/style.less +211 -0
- package/dist/components/title/index.js +8 -0
- package/dist/components/title/index.vue +92 -0
- package/dist/components/title/style.less +188 -0
- package/dist/components/toast/index.js +80 -0
- package/dist/components/toast/index.vue +44 -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 +103 -0
- package/dist/components/upload/index1.vue +225 -0
- package/dist/components/upload/style.less +156 -0
- package/dist/demo.html +10 -0
- package/dist/img/404-dark.775df5bb.png +0 -0
- package/dist/img/completed-dark.4183a8a8.png +0 -0
- package/dist/img/error-dark.b80857da.png +0 -0
- package/dist/img/network-dark.11a147bb.png +0 -0
- package/dist/img/nodata-dark.b0ea0e39.png +0 -0
- package/dist/img/wait-dark.6aa28731.png +0 -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 +2982 -0
- package/dist/vdesign-ui.common.js +27013 -0
- package/dist/vdesign-ui.css +1 -0
- package/dist/vdesign-ui.umd.js +27023 -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: calc(var(--radius-tag-bg) * 1px);
|
|
7
|
+
padding: 0 calc(var(--spacing-tag-padding_y) * 1px);
|
|
8
|
+
|
|
9
|
+
&--small{
|
|
10
|
+
font-size: calc(var(--en-single-f-b-s-fontSize) * 1px);
|
|
11
|
+
font-weight: var(--en-single-f-b-s-fontWeight);
|
|
12
|
+
height: calc(var(--height-tag-s) * 1px);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&--large{
|
|
16
|
+
font-size: calc(var(--en-single-f-b-r-fontSize) * 1px);
|
|
17
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
18
|
+
height: calc(var(--height-tag-m) * 1px);
|
|
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: calc(var(--en-single-f-b-r-fontSize) * 1px);
|
|
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) * 2px);
|
|
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: calc(var(--en-single-f-b-r-fontSize) * 1px);
|
|
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) * 2px);
|
|
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: calc(var(--en-single-f-b-r-fontSize) * 1px);
|
|
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) * 2px);
|
|
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: calc(var(--en-single-f-b-r-fontSize) * 1px);
|
|
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) * 2px);
|
|
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: calc(var(--en-single-f-b-r-fontSize) * 1px);
|
|
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) * 2px);
|
|
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: calc(var(--en-single-f-b-r-fontSize) * 1px);
|
|
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) * 2px);
|
|
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: calc(var(--en-single-f-b-r-fontSize) * 1px);
|
|
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) * 2px);
|
|
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: calc(var(--en-single-f-b-r-fontSize) * 1px);
|
|
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) * 2px);
|
|
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: calc(var(--en-single-f-b-r-fontSize) * 1px);
|
|
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) * 2px);
|
|
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: calc(var(--en-single-f-b-r-fontSize) * 1px);
|
|
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) * 2px);
|
|
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: calc(var(--en-single-f-b-r-fontSize) * 1px);
|
|
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) * 2px);
|
|
202
|
+
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
&--plain {
|
|
208
|
+
background-color:transparent;
|
|
209
|
+
padding: 0;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
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" :svg="leftSvg" :class="leftIconClasses"></vd-icon>
|
|
6
|
+
<span :class="['vd-title-inner__title', innerTitleClasses]">{{ title }}</span>
|
|
7
|
+
<vd-icon v-if="rightIcon" :name="rightIcon" :svg="rightSvg" :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="ar_icon_nav_back"></vd-icon>
|
|
15
|
+
</slot>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
<script>
|
|
20
|
+
const prefixCls = 'vd-title';
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
name: 'vd-title',
|
|
24
|
+
props: {
|
|
25
|
+
title: String,
|
|
26
|
+
leftIcon: String,
|
|
27
|
+
rightIcon: String,
|
|
28
|
+
arrow: Boolean,
|
|
29
|
+
subText: String,
|
|
30
|
+
guideText: String,
|
|
31
|
+
type: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'primary'
|
|
34
|
+
},
|
|
35
|
+
leftSvg: Boolean,
|
|
36
|
+
rightSvg: Boolean,
|
|
37
|
+
|
|
38
|
+
},
|
|
39
|
+
data() {
|
|
40
|
+
return {
|
|
41
|
+
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
computed: {
|
|
45
|
+
wrapClasses() {
|
|
46
|
+
return {
|
|
47
|
+
[`${prefixCls}-${this.type}`]: this.type,
|
|
48
|
+
[`${prefixCls}-${this.type}-double`]: this.subText,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
},
|
|
52
|
+
leftIconClasses() {
|
|
53
|
+
return {
|
|
54
|
+
[`${prefixCls}-${this.type}__icon--left`]: this.type
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
},
|
|
58
|
+
innerTitleClasses() {
|
|
59
|
+
return {
|
|
60
|
+
[`${prefixCls}-${this.type}__title`]: this.type
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
},
|
|
64
|
+
subTextClasses() {
|
|
65
|
+
return {
|
|
66
|
+
[`${prefixCls}-${this.type}__subtext`]: this.type
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
rightIconClasses() {
|
|
70
|
+
return {
|
|
71
|
+
[`${prefixCls}-${this.type}__icon--right`]: this.type
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
textRightClasses() {
|
|
75
|
+
return {
|
|
76
|
+
[`${prefixCls}-${this.type}__text--right`]: this.type
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
methods: {
|
|
81
|
+
handleClick() {
|
|
82
|
+
if (this.arrow) {
|
|
83
|
+
this.$emit('next');
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<style lang="less">
|
|
91
|
+
@import './style.less';
|
|
92
|
+
</style>
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
|
|
2
|
+
@title-prefix-cls: vd-title;
|
|
3
|
+
|
|
4
|
+
.@{title-prefix-cls} {
|
|
5
|
+
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: space-between;
|
|
9
|
+
padding-inline-start: calc(var(--spacing-title-padding_left) * 1px);
|
|
10
|
+
padding-inline-end: calc(var(--spacing-title-padding_right) * 1px);
|
|
11
|
+
background-color: var(--bg-color-1);
|
|
12
|
+
|
|
13
|
+
// &--left{
|
|
14
|
+
// display: flex;
|
|
15
|
+
// flex-direction: column;
|
|
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: calc(var(--spacing-title-subtitle-margin_top) * 1px);
|
|
34
|
+
color: var(--color-title-text);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&-arrow{
|
|
38
|
+
color:var(--color-title-icon_arrow);
|
|
39
|
+
font-size: calc(var(--icon-title-arrow) * 1px);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&-primary{
|
|
43
|
+
|
|
44
|
+
height: calc(var(--height-title-primary) * 1px);
|
|
45
|
+
|
|
46
|
+
&__icon--left{
|
|
47
|
+
margin-inline-end: calc(var(--spacing-title-primary_icon-margin_y) * 1px);
|
|
48
|
+
font-size: calc(var(--icon-title-primary) * 1px);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&__icon--right{
|
|
52
|
+
margin-inline-start: calc(var(--spacing-title-primary_icon-margin_y) * 1px);
|
|
53
|
+
font-size: calc(var(--icon-title-primary) * 1px);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&__title{
|
|
57
|
+
font-size: calc(var(--en-single-f-f-b-fontSize) * 1px);
|
|
58
|
+
font-weight: var(--en-single-f-f-b-fontWeight);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&__text--right{
|
|
62
|
+
margin-inline-end: calc(var(--spacing-title-text-margin_right) * 1px);
|
|
63
|
+
font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
|
|
64
|
+
font-weight: var(--en-single-f-c-r-fontWeight);
|
|
65
|
+
color: var(--color-title-text);
|
|
66
|
+
}
|
|
67
|
+
&__subtext{
|
|
68
|
+
font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
|
|
69
|
+
font-weight: var(--en-single-f-c-r-fontWeight);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&-secondary {
|
|
74
|
+
|
|
75
|
+
height: calc(var(--height-title-secondary) * 1px);
|
|
76
|
+
|
|
77
|
+
&__icon--left{
|
|
78
|
+
margin-inline-end: calc(var(--spacing-title-secondary_icon-margin_y) * 1px);
|
|
79
|
+
font-size: calc(var(--icon-title-secondary) * 1px);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&__icon--right{
|
|
83
|
+
margin-inline-start: calc(var(--spacing-title-secondary_icon-margin_y) * 1px);
|
|
84
|
+
font-size: calc(var(--icon-title-secondary) * 1px);
|
|
85
|
+
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&__title{
|
|
89
|
+
font-size: calc(var(--en-single-f-e-s-fontSize) * 1px);
|
|
90
|
+
font-weight: var(--en-single-f-e-s-fontWeight);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&__text--right{
|
|
94
|
+
margin-inline-end: calc(var(--spacing-title-text-margin_right) * 1px);
|
|
95
|
+
font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
|
|
96
|
+
font-weight: var(--en-single-f-c-r-fontWeight);
|
|
97
|
+
color: var(--color-title-text);
|
|
98
|
+
}
|
|
99
|
+
&__subtext{
|
|
100
|
+
font-size: calc(var(--en-single-f-b-r-fontSize) * 1px);
|
|
101
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&-tertiary {
|
|
106
|
+
height: calc(var(--height-title-tertiary) * 1px);
|
|
107
|
+
|
|
108
|
+
&__icon--left{
|
|
109
|
+
margin-inline-end: calc(var(--spacing-title-tertiary_icon-margin_y) * 1px);
|
|
110
|
+
font-size: calc(var(--icon-title-tertiary) * 1px);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&__icon--right{
|
|
114
|
+
margin-inline-start: calc(var(--spacing-title-tertiary_icon-margin_y) * 1px);
|
|
115
|
+
font-size: calc(var(--icon-title-tertiary) * 1px);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&__title{
|
|
119
|
+
font-size: calc(var(--en-single-f-d-s-fontSize) * 1px);
|
|
120
|
+
font-weight: var(--en-single-f-d-s-fontWeight);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&__text--right{
|
|
124
|
+
margin-inline-end: calc(var(--spacing-title-text-margin_right) * 1px);
|
|
125
|
+
font-size: calc(var(--en-single-f-b-r-fontSize) * 1px);
|
|
126
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
127
|
+
color: var(--color-title-text);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&__subtext{
|
|
131
|
+
font-size: calc(var(--en-single-f-b-r-fontSize) * 1px);
|
|
132
|
+
font-weight: var(--en-single-f-b-r-fontSize);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&-quaternary {
|
|
137
|
+
height: calc(var(--height-title-quaternary) * 1px);
|
|
138
|
+
|
|
139
|
+
&__icon--left{
|
|
140
|
+
margin-inline-end: calc(var(--spacing-title-quaternary_icon-margin_y) * 1px);
|
|
141
|
+
font-size: calc(var(--icon-title-quaternary) * 1px);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&__icon--right{
|
|
145
|
+
margin-inline-start: calc(var(--spacing-title-quaternary_icon-margin_y) * 1px);
|
|
146
|
+
font-size: calc(var(--icon-title-quaternary) * 1px);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&__title{
|
|
150
|
+
font-size: calc(var(--en-single-f-c-s-fontSize) * 1px);
|
|
151
|
+
font-weight: var(--en-single-f-c-s-fontWeight);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&__text--right{
|
|
155
|
+
margin-inline-end: calc(var(--spacing-title-text-margin_right) * 1px);
|
|
156
|
+
font-size: calc(var(--en-single-f-b-r-fontSize) * 1px);
|
|
157
|
+
font-weight: var(--en-single-f-b-r-fontWeight);
|
|
158
|
+
color: var(--color-title-text);
|
|
159
|
+
}
|
|
160
|
+
&__subtext{
|
|
161
|
+
font-size: calc(var(--en-single-f-a-r-fontSize) * 1px);
|
|
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: calc(var(--en-single-f-c-r-fontSize) * 1px);
|
|
170
|
+
font-weight: var(--en-single-f-c-r-fontWeight);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&-primary-double {
|
|
174
|
+
height: calc(var(--height-title-primary_double) * 1px);
|
|
175
|
+
}
|
|
176
|
+
&-secondary-double {
|
|
177
|
+
height: calc(var(--height-title-secondary_double) * 1px);
|
|
178
|
+
}
|
|
179
|
+
&-tertiary-double {
|
|
180
|
+
height: calc(var(--height-title-tertiary_double) * 1px);
|
|
181
|
+
}
|
|
182
|
+
&-quaternary-double {
|
|
183
|
+
height: calc(var(--height-title-quaternary_double) * 1px);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import VdToast from './index.vue'
|
|
3
|
+
let timer = null
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 使用新类继承 VUE 扩展组件
|
|
7
|
+
*/
|
|
8
|
+
class Toast extends Vue.extend(VdToast) {
|
|
9
|
+
constructor(options) {
|
|
10
|
+
super()
|
|
11
|
+
const type = Object.prototype.toString.call(options)
|
|
12
|
+
/**
|
|
13
|
+
* 赋值虚拟节点
|
|
14
|
+
*/
|
|
15
|
+
this.vm = this.$mount()
|
|
16
|
+
/**
|
|
17
|
+
* 判断 options 类型
|
|
18
|
+
*/
|
|
19
|
+
if (type === '[object String]' || type === '[object Number]') {
|
|
20
|
+
this.message = options
|
|
21
|
+
} else if (type === '[object Object]') {
|
|
22
|
+
/**
|
|
23
|
+
* 循环遍历,设置该类属性
|
|
24
|
+
*/
|
|
25
|
+
Object.keys(options).forEach(elem => {
|
|
26
|
+
this[elem] = options[elem]
|
|
27
|
+
})
|
|
28
|
+
} else {
|
|
29
|
+
/**
|
|
30
|
+
* 抛出错误
|
|
31
|
+
*/
|
|
32
|
+
throw new Error(`${JSON.stringify(options)} is not Number, String or Object`)
|
|
33
|
+
}
|
|
34
|
+
this.init()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 初始化方法
|
|
39
|
+
*/
|
|
40
|
+
init() {
|
|
41
|
+
/**
|
|
42
|
+
* 把虚拟 DOM 插入到真实 DOM 树中
|
|
43
|
+
*/
|
|
44
|
+
document.body.appendChild(this.vm.$el)
|
|
45
|
+
this.start()
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 开始此组件
|
|
50
|
+
*/
|
|
51
|
+
start() {
|
|
52
|
+
clearTimeout(timer)
|
|
53
|
+
/**
|
|
54
|
+
* 在挂载真实 DOM 树后显示过渡效果
|
|
55
|
+
*/
|
|
56
|
+
timer = setTimeout(() => {
|
|
57
|
+
this.isShow = true
|
|
58
|
+
this.end()
|
|
59
|
+
}, 100)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* 结束此组件
|
|
64
|
+
*/
|
|
65
|
+
end() {
|
|
66
|
+
/**
|
|
67
|
+
* 关闭过渡效果之后移除真实 DOM 树节点
|
|
68
|
+
*/
|
|
69
|
+
setTimeout(() => {
|
|
70
|
+
this.isShow = false
|
|
71
|
+
setTimeout(() => {
|
|
72
|
+
document.body.removeChild(this.vm.$el)
|
|
73
|
+
}, 500)
|
|
74
|
+
}, this.duration)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const GetToast = options => new Toast(options)
|
|
79
|
+
|
|
80
|
+
export default GetToast
|
|
@@ -0,0 +1,44 @@
|
|
|
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="`vd-icon-${icon}`"></i>
|
|
6
|
+
<div>{{ message }}</div>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
<script>
|
|
10
|
+
export default {
|
|
11
|
+
name: 'vd-toast',
|
|
12
|
+
data() {
|
|
13
|
+
return {
|
|
14
|
+
message: '', // 提示语
|
|
15
|
+
isShow: false, // 是否显示
|
|
16
|
+
bgColor: '', // 背景颜色
|
|
17
|
+
icon: '', // 图标
|
|
18
|
+
duration: 1500, // 延迟时间
|
|
19
|
+
position: 'middle' // default:middle, value: top, bottom
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
computed: {
|
|
23
|
+
customClass() {
|
|
24
|
+
var classes = [];
|
|
25
|
+
switch (this.position) {
|
|
26
|
+
case 'top':
|
|
27
|
+
classes.push('vd-toast__top');
|
|
28
|
+
break;
|
|
29
|
+
case 'bottom':
|
|
30
|
+
classes.push('vd-toast__bottom');
|
|
31
|
+
break;
|
|
32
|
+
default:
|
|
33
|
+
classes.push('vd-toast__middle');
|
|
34
|
+
}
|
|
35
|
+
classes.push(this.className);
|
|
36
|
+
|
|
37
|
+
return classes.join(' ');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
<style lang="less">
|
|
43
|
+
@import './style.less';
|
|
44
|
+
</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: calc(var(--width-toast-small)* 1px);
|
|
17
|
+
max-width: calc(var(--width-toast-large)* 1px);
|
|
18
|
+
padding: calc(var(--spacing-toast-padding_x) * 1px) calc(var(--spacing-toast-padding_y) * 1px);
|
|
19
|
+
background-color: var(--color-toast-bg);
|
|
20
|
+
border-radius: calc(var(--radius-toast-content) * 1px);
|
|
21
|
+
color: var(--color-toast-text);
|
|
22
|
+
font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
|
|
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: calc(var(--height-toast-small) * 1px);
|
|
31
|
+
|
|
32
|
+
.vd-iconfont {
|
|
33
|
+
font-size: calc(var(--icon-toast-size) * 1px);
|
|
34
|
+
margin-bottom: calc(var(--spacing-toast-icon-margin_bottom) * 1px);
|
|
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
|
+
}
|