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,117 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 标签选项 -->
|
|
3
|
+
<div class="vd-step-item" :class="[
|
|
4
|
+
'vd-step-' + parentProps.direction,
|
|
5
|
+
state ? 'vd-step-' + state : '',
|
|
6
|
+
isActive ? 'vd-step-active' : ''
|
|
7
|
+
]" :style="`color:${isActive ? parentProps.activeColor : parentProps.color};`">
|
|
8
|
+
<!-- 点 -->
|
|
9
|
+
<div v-if="parentProps.direction !== 'basic'" class="vd-step-u-dot"
|
|
10
|
+
:style="`color:${isActive ? parentProps.activeColor : parentProps.color};`">
|
|
11
|
+
<vd-icon v-if="state" :svg="true" :name="iconName"></vd-icon>
|
|
12
|
+
</div>
|
|
13
|
+
<!-- 线 -->
|
|
14
|
+
<div class="vd-step-u-line" :style="`background:${isActive ? parentProps.activeColor : parentProps.color};`"></div>
|
|
15
|
+
<!-- 文本 -->
|
|
16
|
+
<div v-if="parentProps.direction !== 'basic'" class="vd-step-u-text"
|
|
17
|
+
:style="`color:${isActive ? parentProps.activeColor : parentProps.color};`">
|
|
18
|
+
<div class="vd-step-u-text__title" v-if="customTitle">
|
|
19
|
+
<slot name="title"></slot>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="vd-step-u-text__title" v-else>{{ title }}</div>
|
|
22
|
+
<div class="vd-step-u-text__description" v-if="customDescription">
|
|
23
|
+
<slot name="description"></slot>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="vd-step-u-text__description" v-else>{{ description }}</div>
|
|
26
|
+
<slot></slot>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script>
|
|
32
|
+
export default {
|
|
33
|
+
name: 'vd-step-item',
|
|
34
|
+
props: {
|
|
35
|
+
// 索引名称
|
|
36
|
+
name: {
|
|
37
|
+
type: [String, Number],
|
|
38
|
+
required: true
|
|
39
|
+
},
|
|
40
|
+
title: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: '',
|
|
43
|
+
},
|
|
44
|
+
description: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: '',
|
|
47
|
+
},
|
|
48
|
+
state: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: '',
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
data() {
|
|
54
|
+
return {
|
|
55
|
+
isActive: false, // 激活状态
|
|
56
|
+
currentTheme: 'light', // 默认值
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
computed: {
|
|
60
|
+
// 父组件参数
|
|
61
|
+
parentProps() {
|
|
62
|
+
const { $options, _props } = this.$parent
|
|
63
|
+
return $options._componentTag === 'vd-step' ? _props : {}
|
|
64
|
+
},
|
|
65
|
+
customTitle() {
|
|
66
|
+
return !!this.$slots.title
|
|
67
|
+
},
|
|
68
|
+
customDescription() {
|
|
69
|
+
return !!this.$slots.description
|
|
70
|
+
},
|
|
71
|
+
iconName() {
|
|
72
|
+
if (this.state === 'afoot') {
|
|
73
|
+
return this.currentTheme === 'dark' ? 'icon_show_steping1' : 'icon_show_steping'
|
|
74
|
+
} else if (this.state === 'warning') {
|
|
75
|
+
return this.currentTheme === 'dark' ? 'icon_show_stepwrong1' : 'icon_show_stepwrong'
|
|
76
|
+
}
|
|
77
|
+
return ''
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
mounted() {
|
|
81
|
+
const theme = document.querySelector('html').getAttribute('theme')
|
|
82
|
+
this.currentTheme = theme ? theme : this.currentTheme
|
|
83
|
+
this.observeThemeChange()
|
|
84
|
+
},
|
|
85
|
+
watch: {
|
|
86
|
+
// 监听父组件参数
|
|
87
|
+
parentProps: {
|
|
88
|
+
handler() {
|
|
89
|
+
this.isActive = this.parentProps.active.includes(this.name)
|
|
90
|
+
},
|
|
91
|
+
deep: true,
|
|
92
|
+
immediate: true
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
methods: {
|
|
96
|
+
observeThemeChange() {
|
|
97
|
+
const observer = new MutationObserver(mutations => {
|
|
98
|
+
mutations.forEach(mutation => {
|
|
99
|
+
if (mutation.type === 'attributes' && mutation.attributeName === 'theme') {
|
|
100
|
+
const theme = document.querySelector('html').getAttribute('theme')
|
|
101
|
+
this.currentTheme = theme ? theme : this.currentTheme
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
})
|
|
105
|
+
observer.observe(document.querySelector('html'), { attributes: true })
|
|
106
|
+
|
|
107
|
+
this.$once('hook:beforeDestroy', () => {
|
|
108
|
+
observer.disconnect()
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
</script>
|
|
114
|
+
|
|
115
|
+
<style lang="less">
|
|
116
|
+
@import './style.less';
|
|
117
|
+
</style>
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
@prefix: ~"vd-step-item";
|
|
2
|
+
|
|
3
|
+
.@{prefix} {
|
|
4
|
+
position: relative;
|
|
5
|
+
|
|
6
|
+
&.vd-step-horizontal {
|
|
7
|
+
flex: 1;
|
|
8
|
+
width: 100%;
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
padding-block-start: calc((var(--spacing-steps-horizontal-padding_x) + var(--icon-steps-size) + var(--spacing-steps-horizontal_icon-margin_bottom)) * 1px);
|
|
12
|
+
|
|
13
|
+
.vd-step-u-dot {
|
|
14
|
+
position: absolute;
|
|
15
|
+
inset-inline-end: 50%;
|
|
16
|
+
transform: translateX(50%);
|
|
17
|
+
z-index: 2;
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
align-items: center;
|
|
21
|
+
color: inherit;
|
|
22
|
+
width: calc(var(--icon-steps-size) * 1px);
|
|
23
|
+
height: calc(var(--icon-steps-size) * 1px);
|
|
24
|
+
inset-block-start: calc(var(--spacing-steps-horizontal-padding_x) * 1px);
|
|
25
|
+
|
|
26
|
+
.vd-iconfont {
|
|
27
|
+
color: inherit;
|
|
28
|
+
font-size: calc(var(--icon-steps-size) * 1px);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&::before {
|
|
32
|
+
content: "";
|
|
33
|
+
width: calc(var(--icon-steps-size) * 0.5px);
|
|
34
|
+
height: calc(var(--icon-steps-size) * 0.5px);
|
|
35
|
+
border-radius: 999em;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
background-color: var(--bg-color-1);
|
|
38
|
+
border: 2px solid var(--text-color-h3);
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.vd-step-u-line {
|
|
44
|
+
position: absolute;
|
|
45
|
+
inset-block-start: calc((var(--spacing-steps-horizontal-padding_x) + var(--icon-steps-size)/2) * 1px);
|
|
46
|
+
inset-inline-end: 0;
|
|
47
|
+
z-index: 1;
|
|
48
|
+
width: 100%;
|
|
49
|
+
height: calc(var(--height-steps-border-default) * 1px);
|
|
50
|
+
background: linear-gradient(to left,
|
|
51
|
+
transparent 0%,
|
|
52
|
+
transparent 50%,
|
|
53
|
+
var(--color-steps-border-default) 50%,
|
|
54
|
+
var(--color-steps-border-default) 100%);
|
|
55
|
+
background-size: 5px calc(var(--height-steps-border-default) * 1px);
|
|
56
|
+
background-repeat: repeat-x;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.vd-step-u-text {
|
|
60
|
+
min-width: 0;
|
|
61
|
+
word-break: break-word;
|
|
62
|
+
text-align: center;
|
|
63
|
+
// not_started
|
|
64
|
+
color: var(--color-steps-text-not_started);
|
|
65
|
+
font-size: calc(var(--en-multi-f-c-r-fontSize) * 1px);
|
|
66
|
+
font-weight: var(--en-multi-f-c-r-fontWeight);
|
|
67
|
+
line-height: calc(var(--en-multi-f-c-r-lineHeight) * 1px);
|
|
68
|
+
|
|
69
|
+
&__title {
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
display: -webkit-box;
|
|
72
|
+
-webkit-box-orient: vertical;
|
|
73
|
+
-webkit-line-clamp: 2;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&__description {
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
display: -webkit-box;
|
|
79
|
+
-webkit-box-orient: vertical;
|
|
80
|
+
-webkit-line-clamp: 3;
|
|
81
|
+
// description_text
|
|
82
|
+
color: var(--color-steps-description_text);
|
|
83
|
+
font-size: calc(var(--en-multi-f-b-r-fontSize) * 1px);
|
|
84
|
+
font-weight: var(--en-multi-f-b-r-fontWeight);
|
|
85
|
+
line-height: calc(var(--en-multi-f-b-r-lineHeight) * 1px);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&.vd-step-active {
|
|
90
|
+
|
|
91
|
+
.vd-step-u-text {
|
|
92
|
+
color: var(--color-steps-text-complete);
|
|
93
|
+
font-size: calc(var(--en-multi-f-c-r-fontSize) * 1px);
|
|
94
|
+
font-weight: var(--en-multi-f-c-r-fontWeight);
|
|
95
|
+
line-height: calc(var(--en-multi-f-c-r-lineHeight) * 1px);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.vd-step-u-dot {
|
|
99
|
+
&::before {
|
|
100
|
+
border: 2px solid var(--primary-color);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.vd-step-u-line {
|
|
105
|
+
height: calc(var(--height-steps-border-hover) * 1px);
|
|
106
|
+
background: var(--color-steps-border-hover);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&.vd-step-afoot {
|
|
111
|
+
|
|
112
|
+
.vd-step-u-dot::before {
|
|
113
|
+
content: none;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.vd-step-u-text {
|
|
117
|
+
color: var(--color-steps-text-afoot);
|
|
118
|
+
font-size: calc(var(--en-multi-f-c-s-fontSize) * 1px);
|
|
119
|
+
font-weight: var(--en-multi-f-c-s-fontWeight);
|
|
120
|
+
line-height: calc(var(--en-multi-f-c-s-lineHeight) * 1px);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.vd-step-u-line::after {
|
|
124
|
+
content: "";
|
|
125
|
+
position: absolute;
|
|
126
|
+
inset-block-start: 0;
|
|
127
|
+
inset-inline-start: 0;
|
|
128
|
+
width: 50%;
|
|
129
|
+
height: calc(var(--height-steps-border-hover) * 1px);
|
|
130
|
+
background: var(--color-steps-border-hover);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&.vd-step-warning {
|
|
135
|
+
|
|
136
|
+
.vd-step-u-dot::before {
|
|
137
|
+
content: none;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.vd-step-u-text {
|
|
141
|
+
color: var(--color-steps-text-warning);
|
|
142
|
+
font-size: calc(var(--en-multi-f-c-s-fontSize) * 1px);
|
|
143
|
+
font-weight: var(--en-multi-f-c-s-fontWeight);
|
|
144
|
+
line-height: calc(var(--en-multi-f-c-s-lineHeight) * 1px);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.vd-step-u-line::after {
|
|
148
|
+
content: "";
|
|
149
|
+
position: absolute;
|
|
150
|
+
inset-block-start: 0;
|
|
151
|
+
inset-inline-start: 0;
|
|
152
|
+
width: 50%;
|
|
153
|
+
height: calc(var(--height-steps-border-hover) * 1px);
|
|
154
|
+
background: var(--color-steps-border-hover);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// vertical
|
|
160
|
+
&.vd-step-vertical {
|
|
161
|
+
width: 100%;
|
|
162
|
+
padding-inline-start: calc((var(--spacing-steps-vertical-padding_y) + var(--icon-steps-size) + var(--spacing-steps-vertical_icon-margin_right)) * 1px);
|
|
163
|
+
|
|
164
|
+
&:not(:last-child) {
|
|
165
|
+
padding-block-end: calc(var(--spacing-steps-vertical_description_text-margin_bottom) * 1px);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.vd-step-u-dot {
|
|
169
|
+
position: absolute;
|
|
170
|
+
inset-block-start: 0;
|
|
171
|
+
inset-inline-start: calc(var(--spacing-steps-vertical-padding_y) * 1px);
|
|
172
|
+
z-index: 2;
|
|
173
|
+
display: flex;
|
|
174
|
+
justify-content: center;
|
|
175
|
+
align-items: center;
|
|
176
|
+
color: inherit;
|
|
177
|
+
width: calc(var(--icon-steps-size) * 1px);
|
|
178
|
+
height: calc(var(--icon-steps-size) * 1px);
|
|
179
|
+
|
|
180
|
+
.vd-iconfont {
|
|
181
|
+
color: inherit;
|
|
182
|
+
font-size: calc(var(--icon-steps-size) * 1px);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&::before {
|
|
186
|
+
content: "";
|
|
187
|
+
width: calc(var(--icon-steps-size) * 0.5px);
|
|
188
|
+
height: calc(var(--icon-steps-size) * 0.5px);
|
|
189
|
+
border-radius: 999em;
|
|
190
|
+
overflow: hidden;
|
|
191
|
+
background-color: var(--bg-color-1);
|
|
192
|
+
border: 2px solid var(--text-color-h3);
|
|
193
|
+
box-sizing: border-box;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.vd-step-u-line {
|
|
198
|
+
position: absolute;
|
|
199
|
+
z-index: 1;
|
|
200
|
+
inset-block-start: calc((var(--icon-steps-size)/2) * 1px);
|
|
201
|
+
inset-inline-start: calc((var(--spacing-steps-vertical-padding_y) + var(--icon-steps-size)/2) * 1px);
|
|
202
|
+
width: calc(var(--height-steps-border-default) * 1px);
|
|
203
|
+
height: 100%;
|
|
204
|
+
background: linear-gradient(to bottom,
|
|
205
|
+
transparent 0%,
|
|
206
|
+
transparent 50%,
|
|
207
|
+
var(--color-steps-border-default) 50%,
|
|
208
|
+
var(--color-steps-border-default) 100%);
|
|
209
|
+
background-size: 1px 5px;
|
|
210
|
+
background-repeat: repeat-y;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.vd-step-u-text {
|
|
214
|
+
min-width: 0;
|
|
215
|
+
word-break: break-word;
|
|
216
|
+
text-align: start;
|
|
217
|
+
// not_started
|
|
218
|
+
color: var(--color-steps-text-not_started);
|
|
219
|
+
font-size: calc(var(--en-multi-f-c-r-fontSize) * 1px);
|
|
220
|
+
font-weight: var(--en-multi-f-c-r-fontWeight);
|
|
221
|
+
line-height: calc(var(--en-multi-f-c-r-lineHeight) * 1px);
|
|
222
|
+
|
|
223
|
+
&__title {
|
|
224
|
+
overflow: hidden;
|
|
225
|
+
display: -webkit-box;
|
|
226
|
+
-webkit-box-orient: vertical;
|
|
227
|
+
-webkit-line-clamp: 2;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
&__description {
|
|
231
|
+
overflow: hidden;
|
|
232
|
+
display: -webkit-box;
|
|
233
|
+
-webkit-box-orient: vertical;
|
|
234
|
+
-webkit-line-clamp: 3;
|
|
235
|
+
// description_text
|
|
236
|
+
color: var(--color-steps-description_text);
|
|
237
|
+
font-size: calc(var(--en-multi-f-b-r-fontSize) * 1px);
|
|
238
|
+
font-weight: var(--en-multi-f-b-r-fontWeight);
|
|
239
|
+
line-height: calc(var(--en-multi-f-b-r-lineHeight) * 1px);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
&.vd-step-active {
|
|
244
|
+
|
|
245
|
+
.vd-step-u-text {
|
|
246
|
+
color: var(--color-steps-text-complete);
|
|
247
|
+
font-size: calc(var(--en-multi-f-c-r-fontSize) * 1px);
|
|
248
|
+
font-weight: var(--en-multi-f-c-r-fontWeight);
|
|
249
|
+
line-height: calc(var(--en-multi-f-c-r-lineHeight) * 1px);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.vd-step-u-dot {
|
|
253
|
+
&::before {
|
|
254
|
+
border: 2px solid var(--primary-color);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.vd-step-u-line::after {
|
|
259
|
+
content: "";
|
|
260
|
+
position: absolute;
|
|
261
|
+
z-index: 1;
|
|
262
|
+
inset-block-start: 0;
|
|
263
|
+
inset-inline-start: 0;
|
|
264
|
+
height: 100%;
|
|
265
|
+
width: calc(var(--height-steps-border-default) * 1px);
|
|
266
|
+
background: var(--color-steps-border-hover);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// 复杂 css 条件,但:has兼容性不够
|
|
270
|
+
&:not(:has(+ :is(.vd-step-active, .vd-step-afoot, .vd-step-warning))) {
|
|
271
|
+
.vd-step-u-line::after {
|
|
272
|
+
height: 50%;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
&.vd-step-afoot {
|
|
279
|
+
.u-line::after {
|
|
280
|
+
height: 100%;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.vd-step-u-text {
|
|
284
|
+
color: var(--color-steps-text-afoot);
|
|
285
|
+
font-size: calc(var(--en-multi-f-c-s-fontSize) * 1px);
|
|
286
|
+
font-weight: var(--en-multi-f-c-s-fontWeight);
|
|
287
|
+
line-height: calc(var(--en-multi-f-c-s-lineHeight) * 1px);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.vd-step-u-dot::before {
|
|
291
|
+
content: none;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
&+.vd-step-active {
|
|
295
|
+
.vd-step-u-line::after {
|
|
296
|
+
height: 100%;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
&.vd-step-warning {
|
|
302
|
+
.vd-step-u-line::after {
|
|
303
|
+
height: 100%;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.vd-step-u-text {
|
|
307
|
+
color: var(--color-steps-text-warning);
|
|
308
|
+
font-size: calc(var(--en-multi-f-c-s-fontSize) * 1px);
|
|
309
|
+
font-weight: var(--en-multi-f-c-s-fontWeight);
|
|
310
|
+
line-height: calc(var(--en-multi-f-c-s-lineHeight) * 1px);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.vd-step-u-dot::before {
|
|
314
|
+
content: none;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
&+.vd-step-active {
|
|
318
|
+
.vd-step-u-line::after {
|
|
319
|
+
height: 100%;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// basic
|
|
326
|
+
&.vd-step-basic {
|
|
327
|
+
flex: 1;
|
|
328
|
+
width: 100%;
|
|
329
|
+
display: flex;
|
|
330
|
+
justify-content: center;
|
|
331
|
+
padding-top: calc(var(--spacing-steps-basic-padding_top) * 1px);
|
|
332
|
+
padding-bottom: calc(var(--spacing-steps-basic-padding_bottom) * 1px);
|
|
333
|
+
margin-inline-start: calc(var(--spacing-steps-basic-padding_y) * 1px);
|
|
334
|
+
|
|
335
|
+
&:last-child {
|
|
336
|
+
margin-inline-end: calc(var(--spacing-steps-basic-padding_y) * 1px);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.vd-step-u-line {
|
|
340
|
+
width: 100%;
|
|
341
|
+
height: calc(var(--height-steps-basic-default) * 1px);
|
|
342
|
+
border-radius: calc(var(--radius-steps-basic) * 1px);
|
|
343
|
+
background: var(--color-steps-basic-default);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
&.vd-step-active {
|
|
347
|
+
|
|
348
|
+
.vd-step-u-line {
|
|
349
|
+
height: calc(var(--height-steps-basic-hover) * 1px);
|
|
350
|
+
background: var(--color-steps-basic-hover);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
[lang='ar'] {
|
|
358
|
+
.vd-step-horizontal .vd-step-u-dot {
|
|
359
|
+
transform: translateX(-50%);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<h2>默认包含了一些常用样式,可以直接通过 className 的方式使用,样式文件在packages/tokens/style.less里面</h2>
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
<h3>文字省略</h3>
|
|
7
|
+
|
|
8
|
+
<!-- 最多显示一行 -->
|
|
9
|
+
<div class="vd-ellipsis">这是一段最多显示一行的文字,多余的内容会被省略</div>
|
|
10
|
+
|
|
11
|
+
<!-- 最多显示两行 -->
|
|
12
|
+
<div class="vd-multi-ellipsis--l2">
|
|
13
|
+
这是一段最多显示两行的文字,多余的内容会被省略
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<!-- 最多显示三行 -->
|
|
17
|
+
<div class="vd-multi-ellipsis--l3">
|
|
18
|
+
这是一段最多显示三行的文字,多余的内容会被省略
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<h3>1px 边框</h3>
|
|
22
|
+
|
|
23
|
+
<!-- 上边框 -->
|
|
24
|
+
<div class="vd-hairline--top"></div>
|
|
25
|
+
|
|
26
|
+
<!-- 下边框 -->
|
|
27
|
+
<div class="vd-hairline--bottom"></div>
|
|
28
|
+
|
|
29
|
+
<!-- 左边框 -->
|
|
30
|
+
<div class="vd-hairline--left"></div>
|
|
31
|
+
|
|
32
|
+
<!-- 右边框 -->
|
|
33
|
+
<div class="vd-hairline--right"></div>
|
|
34
|
+
|
|
35
|
+
<!-- 上下边框 -->
|
|
36
|
+
<div class="vd-hairline--top-bottom"></div>
|
|
37
|
+
|
|
38
|
+
<!-- 全边框 -->
|
|
39
|
+
<div class="vd-hairline--surround"></div>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<!-- 开关 -->
|
|
3
|
+
<div class="vd-switch" :class="{ 'vd-switch-on': isActived }" :disabled="disabled" @click="handleClick">
|
|
4
|
+
<span class="vd-switch-round"></span>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
name: 'vd-switch',
|
|
10
|
+
props: {
|
|
11
|
+
/**
|
|
12
|
+
* v-model 绑定值
|
|
13
|
+
*/
|
|
14
|
+
value: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false
|
|
17
|
+
},
|
|
18
|
+
/**
|
|
19
|
+
* 异步状态
|
|
20
|
+
*/
|
|
21
|
+
async: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* 禁用状态
|
|
27
|
+
*/
|
|
28
|
+
disabled: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: false
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
data() {
|
|
34
|
+
return {
|
|
35
|
+
/**
|
|
36
|
+
* 激活状态
|
|
37
|
+
*/
|
|
38
|
+
isActived: this.value
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
methods: {
|
|
42
|
+
/**
|
|
43
|
+
* 点击 Switch 开关
|
|
44
|
+
*/
|
|
45
|
+
handleClick() {
|
|
46
|
+
const { disabled, async, isActived } = this
|
|
47
|
+
/**
|
|
48
|
+
* 判断是否被禁用
|
|
49
|
+
*/
|
|
50
|
+
if (!disabled) {
|
|
51
|
+
/**
|
|
52
|
+
* 判断是否异步
|
|
53
|
+
*/
|
|
54
|
+
!async && this.$emit('input', !isActived)
|
|
55
|
+
this.$emit('on-click')
|
|
56
|
+
// element.style.setProperty('--primary-color', 'blue');
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
watch: {
|
|
61
|
+
/**
|
|
62
|
+
* 监听 value 的值
|
|
63
|
+
*/
|
|
64
|
+
value(value) {
|
|
65
|
+
this.isActived = value
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
</script>
|
|
70
|
+
<style lang="less">
|
|
71
|
+
@import './style.less';
|
|
72
|
+
</style>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
@prefix: ~"vd-switch";
|
|
2
|
+
|
|
3
|
+
.@{prefix} {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
position: relative;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
width: calc(var(--width-switch-bg) * 1px);
|
|
8
|
+
height: calc(var(--height-switch-bg) * 1px);
|
|
9
|
+
border-radius: calc(var(--radius-switch-bg) * 1px);
|
|
10
|
+
background: var(--color-switch-off_bg-default);
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
|
|
13
|
+
&-round {
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: calc(var(--height-switch-bg) * -0.5px);
|
|
17
|
+
left: 0;
|
|
18
|
+
transition: transform .3s;
|
|
19
|
+
width: calc(var(--height-switch-button) * 1px);
|
|
20
|
+
height: calc(var(--height-switch-button) * 1px);
|
|
21
|
+
border-radius: calc(var(--radius-switch-button) * 1px);
|
|
22
|
+
border: 1px solid var(--color-switch-off_button_border-default);
|
|
23
|
+
background: var(--color-switch-off_button_bg-default);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&-on {
|
|
27
|
+
border-color: var(--color-switch-on_button_border-default);
|
|
28
|
+
background: var(--color-switch-on_bg-default);
|
|
29
|
+
|
|
30
|
+
.@{prefix}-round {
|
|
31
|
+
transform: translateX(calc(var(--height-switch-button) * 1px));
|
|
32
|
+
background: var(--color-switch-on_button_bg-default);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&[disabled] {
|
|
37
|
+
border-color: var(--color-switch-off_button_border-disable);
|
|
38
|
+
background: var(--color-switch-off_bg-disable);
|
|
39
|
+
|
|
40
|
+
.@{prefix}-round {
|
|
41
|
+
background: var(--color-switch-off_button_bg-disable);
|
|
42
|
+
border-color: var(--color-switch-off_button_border-disable);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// 选中&&禁用
|
|
47
|
+
&-on[disabled] {
|
|
48
|
+
border-color: var(--color-switch-on_button_border-disable);
|
|
49
|
+
background: var(--color-switch-on_bg-disable);
|
|
50
|
+
|
|
51
|
+
.@{prefix}-round {
|
|
52
|
+
background: var(--color-switch-on_button_bg-disable);
|
|
53
|
+
border-color: var(--color-switch-on_button_border-disable);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|