vdesign-ui 0.1.8 → 0.1.10
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 +67 -0
- package/dist/components/actions-cell/actions/style.less +75 -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 +110 -0
- package/dist/components/activityviews/style.less +146 -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 +289 -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 +25 -0
- package/dist/components/dialog/index copy.vue +112 -0
- package/dist/components/dialog/index.js +8 -0
- package/dist/components/dialog/index.vue +111 -0
- package/dist/components/dialog/style.less +122 -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 +402 -0
- package/dist/components/empty/empty-404.png +0 -0
- package/dist/components/empty/empty-img.png +0 -0
- package/dist/components/empty/empty-network.png +0 -0
- package/dist/components/empty/index.js +8 -0
- package/dist/components/empty/index.vue +65 -0
- package/dist/components/empty/style.less +53 -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 +38 -0
- package/dist/components/footnav/index.js +7 -0
- package/dist/components/footnav/index.vue +82 -0
- package/dist/components/footnav/style.less +22 -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 +139 -0
- package/dist/components/headnav/style.less +232 -0
- package/dist/components/icon/font/iconfont.css +817 -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 +338 -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 +64 -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 +482 -0
- package/dist/components/list/index.js +8 -0
- package/dist/components/list/index.vue +159 -0
- package/dist/components/list/style.less +290 -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/noticebar/index.js +8 -0
- package/dist/components/noticebar/index.vue +246 -0
- package/dist/components/noticebar/style.less +309 -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 +349 -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 +159 -0
- package/dist/components/radio/radio-group/index.vue +70 -0
- package/dist/components/radio/style.less +297 -0
- package/dist/components/result/completed.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 +47 -0
- package/dist/components/result/style.less +42 -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 +134 -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 +95 -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 +89 -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 +54 -0
- package/dist/components/tabs/index.js +8 -0
- package/dist/components/tabs/index.vue +185 -0
- package/dist/components/tabs/style.less +383 -0
- package/dist/components/tabs/tab/index.vue +52 -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 +224 -0
- package/dist/components/upload/style.less +156 -0
- package/dist/vdesign-ui.common.js +214 -268
- package/dist/vdesign-ui.css +1 -1
- package/dist/vdesign-ui.umd.js +214 -268
- package/dist/vdesign-ui.umd.min.js +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span class="vd-actionbar-cell" :class="wrapClasses">
|
|
3
|
+
<vd-icon v-if="iconName" :name="iconName"></vd-icon>
|
|
4
|
+
<slot></slot>
|
|
5
|
+
</span>
|
|
6
|
+
</template>
|
|
7
|
+
<script>
|
|
8
|
+
const prefixCls = 'vd-actionbar'
|
|
9
|
+
export default {
|
|
10
|
+
name: 'vd-actionbar-cell',
|
|
11
|
+
props: {
|
|
12
|
+
// 实际使用场景不多,为了设计验收
|
|
13
|
+
iconName: String,
|
|
14
|
+
direction: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: 'center'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
data() {
|
|
20
|
+
return {
|
|
21
|
+
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
computed: {
|
|
25
|
+
wrapClasses() {
|
|
26
|
+
return [
|
|
27
|
+
{
|
|
28
|
+
[`${prefixCls}-cell--${this.direction}`]: this.direction
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
</script>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="vd-actionbar" :class="wrapClasses">
|
|
3
|
+
<div class="vd-actionbar__main">
|
|
4
|
+
<slot></slot>
|
|
5
|
+
</div>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
<script>
|
|
9
|
+
const prefixCls = 'vd-actionbar';
|
|
10
|
+
export default {
|
|
11
|
+
name: 'vd-actionbar',
|
|
12
|
+
props: {
|
|
13
|
+
// 默认左右有间距,但是实际设计稿有的没有间距,
|
|
14
|
+
//block属性预留一个填充,如果使用基础图标按钮组件填充,不太好填充。
|
|
15
|
+
block: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
data() {
|
|
21
|
+
return {
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
computed: {
|
|
26
|
+
wrapClasses() {
|
|
27
|
+
return [
|
|
28
|
+
{
|
|
29
|
+
[`${prefixCls}__block`]: this.block
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<style lang="less">
|
|
38
|
+
@import './style.less';
|
|
39
|
+
</style>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
@actionbar-prefix-cls:vd-actionbar;
|
|
3
|
+
|
|
4
|
+
.@{actionbar-prefix-cls}{
|
|
5
|
+
|
|
6
|
+
display: flex;
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: calc(var(--height-actionbar-content) * 1px);
|
|
9
|
+
background-color: var(--color-actionbar-bg);
|
|
10
|
+
padding-inline-start: calc(var(--spacing-actionbar-padding_y) * 1px);
|
|
11
|
+
padding-inline-end: calc(var(--spacing-actionbar-padding_y) * 1px);
|
|
12
|
+
|
|
13
|
+
&__block{
|
|
14
|
+
padding-inline-start: 0;
|
|
15
|
+
padding-inline-end: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&__main{
|
|
19
|
+
display: flex;
|
|
20
|
+
flex: 1;
|
|
21
|
+
justify-content: space-around;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
.@{actionbar-prefix-cls}-cell {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex: 1;
|
|
31
|
+
align-items: center;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
34
|
+
font-size: calc(var(--en-single-f-d-r-fontSize) * 1px);
|
|
35
|
+
font-weight: var(--en-single-f-d-r-fontWeight);
|
|
36
|
+
|
|
37
|
+
&--left {
|
|
38
|
+
justify-content: left;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&--center {
|
|
42
|
+
justify-content: center;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&--right {
|
|
46
|
+
justify-content: right;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="wrapClasses">
|
|
3
|
+
<span class="vd-actions__text" v-if="text">{{ text }}</span>
|
|
4
|
+
<vd-icon v-if="icon && type === 'list'" class="vd-actions__icon" :name="icon" :svg="iconSvg"></vd-icon>
|
|
5
|
+
<span class="vd-actions__content" :class="contentBg" v-if="icon && type === 'card'">
|
|
6
|
+
<vd-icon class="vd-actions__icon" :name="icon" :svg="iconSvg"></vd-icon>
|
|
7
|
+
</span>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
const prefixCls = 'vd-actions'
|
|
13
|
+
export default {
|
|
14
|
+
name: 'vd-actions',
|
|
15
|
+
props: {
|
|
16
|
+
type: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ""
|
|
19
|
+
},
|
|
20
|
+
colors: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: ""
|
|
23
|
+
|
|
24
|
+
},
|
|
25
|
+
backgrounds: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ""
|
|
28
|
+
|
|
29
|
+
},
|
|
30
|
+
text: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: ""
|
|
33
|
+
},
|
|
34
|
+
icon: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: '',
|
|
37
|
+
},
|
|
38
|
+
iconSvg: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
computed: {
|
|
44
|
+
wrapClasses() {
|
|
45
|
+
return [
|
|
46
|
+
`${prefixCls}`,
|
|
47
|
+
{
|
|
48
|
+
[`${prefixCls}__${this.type}`]: this.type,
|
|
49
|
+
[`${prefixCls}__${this.colors}`]: this.colors,
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
contentBg() {
|
|
54
|
+
return [
|
|
55
|
+
{
|
|
56
|
+
[`${prefixCls}__content--${this.backgrounds}`]: this.backgrounds
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<style lang="less">
|
|
66
|
+
@import './style.less';
|
|
67
|
+
</style>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
@actions-prefix-cls:vd-actions;
|
|
2
|
+
|
|
3
|
+
.@{actions-prefix-cls}{
|
|
4
|
+
height: 100%;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
|
|
9
|
+
&__list{
|
|
10
|
+
width: fit-content;
|
|
11
|
+
min-width: calc(var(--width-actions-form_small) * 1px);
|
|
12
|
+
max-width: calc(var(--width-actions-form_large) * 1px);
|
|
13
|
+
padding: 0 calc(var(--spacing-actions-form-padding_y) * 1px);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&__card{
|
|
17
|
+
padding: 0 calc(var(--spacing-actions-card_item-margin_y) * 1px);
|
|
18
|
+
|
|
19
|
+
.@{actions-prefix-cls}__content{
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
border-radius: 50%;
|
|
24
|
+
width: calc(var(--width-actions-card) * 1px);
|
|
25
|
+
height: calc(var(--width-actions-card) * 1px);
|
|
26
|
+
|
|
27
|
+
&--green{
|
|
28
|
+
background-color: var(--color-actions-bg-green);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&--warning{
|
|
32
|
+
background-color: var(--color-actions-bg-warning);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&--blue{
|
|
36
|
+
background-color: var(--color-actions-bg-blue);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&--gray{
|
|
40
|
+
background-color: var(--color-actions-bg-gray);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.@{actions-prefix-cls}__icon{
|
|
45
|
+
font-size: calc(var(--icon-actions-card) * 1px);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&__text{
|
|
50
|
+
color: var(--color-actions-text);
|
|
51
|
+
font-size: calc(var(--en-single-f-d-s-fontSize) * 1px);
|
|
52
|
+
font-weight: var(--en-single-f-d-s-fontWeight);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&__icon{
|
|
56
|
+
font-size: calc(var(--icon-actions-size) * 1px);
|
|
57
|
+
color: var(--color-actions-text);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&__green{
|
|
61
|
+
background-color: var(--color-actions-bg-green);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&__warning{
|
|
65
|
+
background-color: var(--color-actions-bg-warning);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&__blue{
|
|
69
|
+
background-color: var(--color-actions-bg-blue);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&__gray{
|
|
73
|
+
background-color: var(--color-actions-bg-gray);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="vd-actions-cell">
|
|
3
|
+
<div class="vd-actions-cell__wrapper" :style="{ transform: `translateX(${offset}px)` }"
|
|
4
|
+
@touchstart="handleTouchStart" @touchmove="handleTouchMove" @touchend="handleTouchEnd" @click="handleClick">
|
|
5
|
+
<div class="vd-actions-cell__left" ref="leftButton">
|
|
6
|
+
<slot name="left"></slot>
|
|
7
|
+
</div>
|
|
8
|
+
<slot name="content"></slot>
|
|
9
|
+
<div class="vd-actions-cell__right" ref="rightButton">
|
|
10
|
+
<slot name="right"></slot>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
export default {
|
|
18
|
+
name: 'vd-actions-cell',
|
|
19
|
+
props: {
|
|
20
|
+
},
|
|
21
|
+
data() {
|
|
22
|
+
return {
|
|
23
|
+
offset: 0, // 初始偏移量
|
|
24
|
+
startX: 0, // 按下时的X坐标
|
|
25
|
+
lastX: 0, // 上一次移动的X坐标
|
|
26
|
+
isDragging: false // 是否正在拖动
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
computed: {
|
|
30
|
+
|
|
31
|
+
},
|
|
32
|
+
methods: {
|
|
33
|
+
handleTouchStart(event) {
|
|
34
|
+
this.startX = event.touches[0].pageX;
|
|
35
|
+
this.lastX = this.startX;
|
|
36
|
+
this.isDragging = true;
|
|
37
|
+
},
|
|
38
|
+
handleTouchMove(event) {
|
|
39
|
+
if (!this.isDragging) return;
|
|
40
|
+
|
|
41
|
+
const currentX = event.touches[0].pageX;
|
|
42
|
+
const deltaX = currentX - this.lastX;
|
|
43
|
+
|
|
44
|
+
// // 判断滑动的方向
|
|
45
|
+
// if (deltaX > 0) {
|
|
46
|
+
// // 向右侧滑动
|
|
47
|
+
// // 这里可以执行相应的逻辑
|
|
48
|
+
// this.offset = 0;
|
|
49
|
+
// }
|
|
50
|
+
|
|
51
|
+
// this.lastX = currentX;
|
|
52
|
+
// 计算内容区域的新偏移量
|
|
53
|
+
this.offset += deltaX;
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
// // 限制内容区域的滑动范围在按钮的宽度以内
|
|
57
|
+
// const buttonWidth = this.$refs.rightButton.offsetWidth;
|
|
58
|
+
// const maxOffset = buttonWidth >= 0 ? buttonWidth : 0;
|
|
59
|
+
// this.offset = Math.max(-maxOffset, Math.min(0, this.offset));
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
const rightButtonWidth = this.$refs.rightButton.offsetWidth;
|
|
63
|
+
const leftButtonWidth = this.$refs.leftButton.offsetWidth;
|
|
64
|
+
this.offset = Math.max(-rightButtonWidth, Math.min(leftButtonWidth, this.offset));
|
|
65
|
+
this.startX = currentX;
|
|
66
|
+
},
|
|
67
|
+
handleTouchEnd() {
|
|
68
|
+
this.isDragging = false;
|
|
69
|
+
const rightButtonWidth = this.$refs.rightButton.offsetWidth;
|
|
70
|
+
const leftButtonWidth = this.$refs.leftButton.offsetWidth;
|
|
71
|
+
const thresholdRight = rightButtonWidth / 3;
|
|
72
|
+
const thresholdLeft = leftButtonWidth / 3;
|
|
73
|
+
|
|
74
|
+
if (this.offset < -thresholdRight) {
|
|
75
|
+
// 向左侧滑动超过三分之一,显示右侧按钮
|
|
76
|
+
this.offset = -rightButtonWidth;
|
|
77
|
+
} else if (this.offset > thresholdLeft) {
|
|
78
|
+
// 向右侧滑动超过三分之一,显示左侧按钮
|
|
79
|
+
this.offset = leftButtonWidth;
|
|
80
|
+
} else {
|
|
81
|
+
// 按钮偏移不超过三分之一,按钮回到原位
|
|
82
|
+
this.offset = 0;
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
handleClick() {
|
|
86
|
+
this.offset = 0;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
</script>
|
|
91
|
+
|
|
92
|
+
<style lang="less">
|
|
93
|
+
@import './style.less';
|
|
94
|
+
</style>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
@actions-cell-prefix-cls:vd-actions-cell;
|
|
2
|
+
|
|
3
|
+
.@{actions-cell-prefix-cls}{
|
|
4
|
+
height: 100%;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
position: relative;
|
|
7
|
+
cursor: grab;
|
|
8
|
+
|
|
9
|
+
&__left{
|
|
10
|
+
position: absolute;
|
|
11
|
+
top: 0;
|
|
12
|
+
left: 0;
|
|
13
|
+
height: 100%;
|
|
14
|
+
transform: translate3d(-100%, 0, 0);
|
|
15
|
+
display: flex;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&__right{
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: 0;
|
|
21
|
+
right: 0;
|
|
22
|
+
height: 100%;
|
|
23
|
+
transform: translate3d(100%, 0, 0);
|
|
24
|
+
display: flex;
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
&__wrapper{
|
|
30
|
+
height: 100%;
|
|
31
|
+
-webkit-transition-timing-function: cubic-bezier(0.18, 0.89, 0.32, 1);
|
|
32
|
+
transition-timing-function: cubic-bezier(0.18, 0.89, 0.32, 1);
|
|
33
|
+
-webkit-transition-property: -webkit-transform;
|
|
34
|
+
transition-property: -webkit-transform;
|
|
35
|
+
transition-property: transform;
|
|
36
|
+
transition-property: transform, -webkit-transform;
|
|
37
|
+
transition-duration: 0.6s;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="visible">
|
|
3
|
+
<!-- <vd-overlay :visible="overlay" @close="closeActivity"></vd-overlay> -->
|
|
4
|
+
<div class="vd-overlay" v-if="visible" @click="closeActivity"></div>
|
|
5
|
+
<div class="vd-activityviews">
|
|
6
|
+
<div class="vd-activityviews__header" v-if="withHeader">
|
|
7
|
+
<div class="vd-activityviews__wrapper">
|
|
8
|
+
<vd-icon v-if="backDefault" :name="backDefault"></vd-icon>
|
|
9
|
+
<div v-if="title" class="vd-activityviews__title">{{ title }}</div>
|
|
10
|
+
<slot name="close">
|
|
11
|
+
<vd-icon v-if="closeIcon" class="vd-activityviews__close" name="icon_btn_dialogclose" svg
|
|
12
|
+
@click="onCancel"></vd-icon>
|
|
13
|
+
</slot>
|
|
14
|
+
<slot name="btn">
|
|
15
|
+
<vd-button v-if="closeBtn" class="vd-activityviews__done" type="primary_text" size="large"
|
|
16
|
+
@click="onCancel">{{ closeBtn }}</vd-button>
|
|
17
|
+
</slot>
|
|
18
|
+
</div>
|
|
19
|
+
<p v-if="description" class="vd-activityviews__description">{{ description }}</p>
|
|
20
|
+
</div>
|
|
21
|
+
<div v-if="withBar" class="vd-activityviews__bar"></div>
|
|
22
|
+
<div :class="['vd-activityviews__body', { 'vd-activityviews__body--action': actionSheet }]">
|
|
23
|
+
<div v-if="actionSheet" class="vd-activityviews__action">
|
|
24
|
+
<p v-if="title" class="vd-activityviews__action-title">{{ title }}</p>
|
|
25
|
+
<div class="vd-activityviews__actions">
|
|
26
|
+
<vd-button v-for="(item, index) in actions" block size="large" :type="item.type" :key="index"
|
|
27
|
+
:disabled="item.disabled" @click.stop="onSelect(item)">{{ item.name }}</vd-button>
|
|
28
|
+
</div>
|
|
29
|
+
<div v-if="cancelText" class="vd-activityviews__gap"></div>
|
|
30
|
+
<!-- 类似1 -->
|
|
31
|
+
<div v-if="cancelText" class="vd-activityviews__cancel" @click="onCancel">
|
|
32
|
+
<vd-button block type="tertiary" size="large">{{ cancelText }}</vd-button>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
<slot v-else></slot>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script>
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
name: 'vd-activityviews',
|
|
45
|
+
props: {
|
|
46
|
+
value: Boolean,
|
|
47
|
+
title: String,
|
|
48
|
+
backDefault: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: "icon_nav_back"
|
|
51
|
+
},
|
|
52
|
+
closeIcon: Boolean,
|
|
53
|
+
closeBtn: String,
|
|
54
|
+
description: String,
|
|
55
|
+
withHeader: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: true
|
|
58
|
+
},
|
|
59
|
+
withBar: Boolean,
|
|
60
|
+
actionSheet: Boolean,
|
|
61
|
+
actions: {
|
|
62
|
+
type: Array,
|
|
63
|
+
default() {
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
cancelText: String,
|
|
68
|
+
overlay: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: true
|
|
71
|
+
},
|
|
72
|
+
disabled: Boolean
|
|
73
|
+
},
|
|
74
|
+
data() {
|
|
75
|
+
return {
|
|
76
|
+
visible: this.value
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
computed: {
|
|
80
|
+
|
|
81
|
+
},
|
|
82
|
+
watch: {
|
|
83
|
+
value(newValue) {
|
|
84
|
+
this.visible = newValue;
|
|
85
|
+
},
|
|
86
|
+
visible(newValue) {
|
|
87
|
+
this.$emit('input', newValue);
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
methods: {
|
|
91
|
+
closeActivity() {
|
|
92
|
+
this.visible = false;
|
|
93
|
+
this.$emit('input', false);
|
|
94
|
+
},
|
|
95
|
+
onCancel() {
|
|
96
|
+
this.$emit('input', false);
|
|
97
|
+
this.$emit('cancel');
|
|
98
|
+
},
|
|
99
|
+
onSelect(item) {
|
|
100
|
+
if (!item.disabled) {
|
|
101
|
+
this.$emit('select', item);
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
</script>
|
|
107
|
+
|
|
108
|
+
<style lang="less">
|
|
109
|
+
@import './style.less';
|
|
110
|
+
</style>
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
|
|
2
|
+
@dialog-prefix-cls: vd-activityviews;
|
|
3
|
+
|
|
4
|
+
.@{dialog-prefix-cls}{
|
|
5
|
+
|
|
6
|
+
::-webkit-scrollbar{width:3px;}
|
|
7
|
+
|
|
8
|
+
position: absolute;
|
|
9
|
+
left: 0;
|
|
10
|
+
right: 0;
|
|
11
|
+
bottom: 0;
|
|
12
|
+
z-index: 2011;
|
|
13
|
+
width: 100%;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
max-height: 80%;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
background-color: var(--color-activityviews-bg);
|
|
19
|
+
border-radius: calc(var(--radius-activityviews-title) * 1px) calc(var(--radius-activityviews-title) * 1px) 0 0;
|
|
20
|
+
|
|
21
|
+
&__close{
|
|
22
|
+
font-size: calc(var(--icon-activityviews-close) * 1px);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&__header{
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
|
|
29
|
+
padding-block-start: calc(var(--spacing-activityviews-head-padding_top) * 1px);
|
|
30
|
+
padding-block-end: calc(var(--spacing-activityviews-head-padding_bottom) * 1px);
|
|
31
|
+
padding-inline-start: calc(var(--spacing-activityviews-padding_left) * 1px);
|
|
32
|
+
padding-inline-end: calc(var(--spacing-activityviews-padding_right) * 1px);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&__bar{
|
|
36
|
+
position: relative;
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 16px;
|
|
39
|
+
&::after{
|
|
40
|
+
content: '';
|
|
41
|
+
position: absolute;
|
|
42
|
+
left: 50%;
|
|
43
|
+
top: calc(var(--spacing-activityviews-title-margin_right) * 1px);
|
|
44
|
+
transform: translate(-50%, 0);
|
|
45
|
+
width: calc(var(--width-activityviews-bar) * 1px);
|
|
46
|
+
height: calc(var(--height-activityviews-bar) * 1px);
|
|
47
|
+
border-radius: calc(var(--radius-activityviews-bar) * 1px);
|
|
48
|
+
background-color: var(--color-activityviews-bar);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&__wrapper{
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&__title{
|
|
58
|
+
text-align: center;
|
|
59
|
+
margin-inline-end: auto;
|
|
60
|
+
padding-inline-end: calc(var(--spacing-activityviews-title-margin_right) * 1px);
|
|
61
|
+
font-size: calc(var(--en-single-f-e-s-fontSize) * 1px);
|
|
62
|
+
font-weight: var(--en-single-f-e-s-fontWeight);
|
|
63
|
+
color:var(--color-activityviews-title);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&__description{
|
|
67
|
+
color: var(--color-activityviews-text_describe);
|
|
68
|
+
margin-block-start: calc(var(--spacing-activityviews-describe-margin_top) * 1px);
|
|
69
|
+
font-size: calc(var(--en-single-f-c-r-fontSize) * 1px);
|
|
70
|
+
font-weight: var(--en-single-f-c-r-fontWeight);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&__done{
|
|
74
|
+
height: 24px;
|
|
75
|
+
line-height: 24px;
|
|
76
|
+
padding-right: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&__body{
|
|
80
|
+
background-color: #fff;
|
|
81
|
+
height: 80%;
|
|
82
|
+
overflow-y: auto;
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
&--action{
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&__action{
|
|
91
|
+
padding: 0;
|
|
92
|
+
height: 80%;
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
display: flex;
|
|
95
|
+
-webkit-box-orient: vertical;
|
|
96
|
+
-webkit-box-direction: normal;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
&-title{
|
|
99
|
+
flex-shrink: 0;
|
|
100
|
+
font-size: 14px;
|
|
101
|
+
text-align: center;
|
|
102
|
+
padding-block-start:calc(var(--spacing-activityviews-actionsheet_title-padding_y) * 1px) ;
|
|
103
|
+
padding-block-end:calc(var(--spacing-activityviews-actionsheet_title-padding_y) * 1px) ;
|
|
104
|
+
color: var(--color-activityviews-actionsheet_title);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&__actions{
|
|
110
|
+
flex: 1;
|
|
111
|
+
overflow: auto;
|
|
112
|
+
-webkit-overflow-scrolling: touch;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&__gap{
|
|
116
|
+
display: block;
|
|
117
|
+
height: calc(var(--height-activityviews-actionsheet_divider) * 1px);
|
|
118
|
+
background-color: var(--color-activityviews-actionsheet_divider);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&__cancel{
|
|
122
|
+
flex-shrink: 0;
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
.vd-btn{
|
|
126
|
+
position: relative;
|
|
127
|
+
border: none;
|
|
128
|
+
height: calc(var(--height-activityviews-actionsheet) * 1px);
|
|
129
|
+
border-radius: 0;
|
|
130
|
+
|
|
131
|
+
&::before{
|
|
132
|
+
position: absolute;
|
|
133
|
+
box-sizing: border-box;
|
|
134
|
+
content: ' ';
|
|
135
|
+
pointer-events: none;
|
|
136
|
+
top: -50%;
|
|
137
|
+
right: -50%;
|
|
138
|
+
bottom: -50%;
|
|
139
|
+
left: -50%;
|
|
140
|
+
border: 0 solid var(--divider-color-default-1);
|
|
141
|
+
transform: scale(0.5);
|
|
142
|
+
border-top-width: 1px;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|