vdesign-ui 0.1.20 → 0.1.21
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/package.json +1 -1
- package/dist/components/actionbar/actionbar-cell/index.vue +0 -34
- package/dist/components/actionbar/index.js +0 -8
- package/dist/components/actionbar/index.vue +0 -39
- package/dist/components/actionbar/style.less +0 -48
- package/dist/components/actions-cell/actions/index.js +0 -7
- package/dist/components/actions-cell/actions/index.vue +0 -76
- package/dist/components/actions-cell/actions/style.less +0 -112
- package/dist/components/actions-cell/index.js +0 -7
- package/dist/components/actions-cell/index.vue +0 -94
- package/dist/components/actions-cell/style.less +0 -39
- package/dist/components/activityviews/index.js +0 -8
- package/dist/components/activityviews/index.vue +0 -140
- package/dist/components/activityviews/style.less +0 -138
- package/dist/components/badge/index.js +0 -8
- package/dist/components/badge/index.vue +0 -49
- package/dist/components/badge/style.less +0 -66
- package/dist/components/button/index.js +0 -8
- package/dist/components/button/index.vue +0 -89
- package/dist/components/button/style.less +0 -563
- package/dist/components/calendar/end.png +0 -0
- package/dist/components/calendar/index-element.vue +0 -84
- package/dist/components/calendar/index.js +0 -8
- package/dist/components/calendar/index.vue +0 -52
- package/dist/components/calendar/start.png +0 -0
- package/dist/components/calendar/style.less +0 -167
- package/dist/components/checkbox/assist.js +0 -34
- package/dist/components/checkbox/checkbox-group/index.js +0 -8
- package/dist/components/checkbox/checkbox-group/index.vue +0 -69
- package/dist/components/checkbox/index.js +0 -8
- package/dist/components/checkbox/index.vue +0 -184
- package/dist/components/checkbox/style.less +0 -291
- package/dist/components/common/state/index.vue +0 -80
- package/dist/components/data-list/index.js +0 -10
- package/dist/components/data-list/index.vue +0 -19
- package/dist/components/data-list/style.less +0 -624
- package/dist/components/datetime-picker/index.js +0 -8
- package/dist/components/datetime-picker/index.vue +0 -37
- package/dist/components/datetime-picker/style.less +0 -24
- package/dist/components/dialog/index.js +0 -8
- package/dist/components/dialog/index.vue +0 -162
- package/dist/components/dialog/overlay-manager.js +0 -18
- package/dist/components/dialog/style.less +0 -132
- package/dist/components/divider/index.js +0 -8
- package/dist/components/divider/index.vue +0 -54
- package/dist/components/divider/style.less +0 -92
- package/dist/components/dropdown/index.js +0 -8
- package/dist/components/dropdown/index.vue +0 -210
- package/dist/components/dropdown/style.less +0 -418
- package/dist/components/empty/404-dark.png +0 -0
- package/dist/components/empty/404.png +0 -0
- package/dist/components/empty/index.js +0 -8
- package/dist/components/empty/index.vue +0 -95
- 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 +0 -60
- package/dist/components/footer/index.js +0 -7
- package/dist/components/footer/index.vue +0 -29
- package/dist/components/footer/style.less +0 -22
- package/dist/components/footnav/footnav-item/index.js +0 -7
- package/dist/components/footnav/footnav-item/index.vue +0 -75
- package/dist/components/footnav/footnav-item/style.less +0 -39
- package/dist/components/footnav/index.js +0 -7
- package/dist/components/footnav/index.vue +0 -97
- package/dist/components/footnav/style.less +0 -23
- package/dist/components/form/index.js +0 -7
- package/dist/components/form/index.vue +0 -12
- package/dist/components/headnav/index.js +0 -7
- package/dist/components/headnav/index.vue +0 -163
- package/dist/components/headnav/style.less +0 -245
- package/dist/components/icon/font/iconfont.css +0 -1050
- package/dist/components/icon/font/iconfont.js +0 -2
- package/dist/components/icon/index.js +0 -9
- package/dist/components/icon/index.vue +0 -46
- package/dist/components/icon/style.less +0 -44
- package/dist/components/input/calcTextareaHeight.js +0 -266
- package/dist/components/input/index.js +0 -8
- package/dist/components/input/index.vue +0 -343
- package/dist/components/input/password/index.js +0 -8
- package/dist/components/input/password/index.vue +0 -60
- package/dist/components/input/search/index.js +0 -8
- package/dist/components/input/search/index.vue +0 -66
- package/dist/components/input/stepper/index.js +0 -8
- package/dist/components/input/stepper/index.vue +0 -136
- package/dist/components/input/style.less +0 -497
- package/dist/components/list/index.js +0 -8
- package/dist/components/list/index.vue +0 -159
- package/dist/components/list/style.less +0 -292
- package/dist/components/loading/index.js +0 -7
- package/dist/components/loading/index.vue +0 -53
- package/dist/components/loading/loading.png +0 -0
- package/dist/components/loading/refresh.png +0 -0
- package/dist/components/loading/style.less +0 -48
- package/dist/components/mixins/clickoutside.js +0 -81
- package/dist/components/mixins/dom.js +0 -41
- package/dist/components/mixins/languageMixin.js +0 -38
- package/dist/components/mixins/outlineConfigPlugin.js +0 -40
- package/dist/components/mixins/router-link.js +0 -23
- package/dist/components/mixins/themeMixin.js +0 -29
- package/dist/components/noticebar/index.js +0 -8
- package/dist/components/noticebar/index.vue +0 -247
- package/dist/components/noticebar/style.less +0 -332
- package/dist/components/overlay/index.js +0 -8
- package/dist/components/overlay/index.vue +0 -161
- package/dist/components/overlay/style.less +0 -23
- package/dist/components/pagebreak/index.js +0 -7
- package/dist/components/pagebreak/index.vue +0 -60
- package/dist/components/pagebreak/style.less +0 -43
- package/dist/components/popover/index.js +0 -8
- package/dist/components/popover/index.vue +0 -99
- package/dist/components/popover/style.less +0 -346
- package/dist/components/popover/vue-popover.vue +0 -314
- package/dist/components/radio/assist.js +0 -34
- package/dist/components/radio/index.js +0 -8
- package/dist/components/radio/index.vue +0 -159
- package/dist/components/radio/radio-group/index.vue +0 -70
- package/dist/components/radio/style.less +0 -297
- 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 +0 -8
- package/dist/components/result/index.vue +0 -75
- package/dist/components/result/style.less +0 -42
- package/dist/components/result/wait-dark.png +0 -0
- package/dist/components/result/wait.png +0 -0
- package/dist/components/selector/index.js +0 -8
- package/dist/components/selector/index.vue +0 -124
- package/dist/components/selector/style.less +0 -474
- package/dist/components/skeleton/index.js +0 -7
- package/dist/components/skeleton/index.vue +0 -142
- package/dist/components/skeleton/style.less +0 -192
- package/dist/components/slider/draggable.js +0 -49
- package/dist/components/slider/index.js +0 -7
- package/dist/components/slider/index.vue +0 -173
- package/dist/components/slider/style.less +0 -96
- package/dist/components/slider/utils.js +0 -60
- package/dist/components/step/index.js +0 -7
- package/dist/components/step/index.vue +0 -48
- package/dist/components/step/style.less +0 -59
- package/dist/components/step-item/index.js +0 -7
- package/dist/components/step-item/index.vue +0 -117
- package/dist/components/step-item/style.less +0 -361
- package/dist/components/style/index.vue +0 -42
- package/dist/components/switch/index.js +0 -8
- package/dist/components/switch/index.vue +0 -72
- package/dist/components/switch/style.less +0 -56
- package/dist/components/tabs/index.js +0 -8
- package/dist/components/tabs/index.vue +0 -145
- package/dist/components/tabs/style.less +0 -385
- package/dist/components/tabs/tab/index.vue +0 -56
- package/dist/components/tag/index.js +0 -7
- package/dist/components/tag/index.vue +0 -50
- package/dist/components/tag/style.less +0 -211
- package/dist/components/title/index.js +0 -8
- package/dist/components/title/index.vue +0 -92
- package/dist/components/title/style.less +0 -188
- package/dist/components/toast/index.js +0 -80
- package/dist/components/toast/index.vue +0 -44
- package/dist/components/toast/style.less +0 -55
- package/dist/components/transition/index.js +0 -8
- package/dist/components/transition/index.vue +0 -13
- package/dist/components/transition/style.less +0 -208
- package/dist/components/upload/index.js +0 -7
- package/dist/components/upload/index.vue +0 -224
- package/dist/components/upload/style.less +0 -156
- package/dist/demo.html +0 -10
- 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 +0 -98
- package/dist/locale/en.js +0 -98
- package/dist/locale/zh.js +0 -98
- package/dist/token.css +0 -2982
- package/dist/vdesign-ui.common.js +0 -27204
- package/dist/vdesign-ui.css +0 -1
- package/dist/vdesign-ui.umd.js +0 -27214
- package/dist/vdesign-ui.umd.min.js +0 -32
package/package.json
CHANGED
|
@@ -1,34 +0,0 @@
|
|
|
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>
|
|
@@ -1,39 +0,0 @@
|
|
|
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>
|
|
@@ -1,48 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="wrapClasses">
|
|
3
|
-
<span class="vd-actions__text" :class="textClasses" v-if="text">{{ text }}</span>
|
|
4
|
-
<vd-icon v-if="icon && type === 'list'" class="vd-actions__icon" :class="iconClasses" :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" :class="iconClasses" :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
|
-
},
|
|
19
|
-
colors: {
|
|
20
|
-
type: String,
|
|
21
|
-
},
|
|
22
|
-
backgrounds: {
|
|
23
|
-
type: String,
|
|
24
|
-
},
|
|
25
|
-
text: {
|
|
26
|
-
type: String,
|
|
27
|
-
},
|
|
28
|
-
icon: {
|
|
29
|
-
type: String,
|
|
30
|
-
},
|
|
31
|
-
iconSvg: {
|
|
32
|
-
type: Boolean,
|
|
33
|
-
default: false,
|
|
34
|
-
},
|
|
35
|
-
disabled:Boolean,
|
|
36
|
-
},
|
|
37
|
-
computed: {
|
|
38
|
-
wrapClasses() {
|
|
39
|
-
return [
|
|
40
|
-
`${prefixCls}`,
|
|
41
|
-
{
|
|
42
|
-
[`${prefixCls}__${this.type}`]: this.type,
|
|
43
|
-
[`${prefixCls}__${this.colors}`]: this.colors,
|
|
44
|
-
[`${prefixCls}__${this.colors}--disabled`]: this.disabled && (this.type ==='list'),
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
},
|
|
48
|
-
contentBg() {
|
|
49
|
-
return [
|
|
50
|
-
{
|
|
51
|
-
[`${prefixCls}__content--${this.backgrounds}`]: this.backgrounds,
|
|
52
|
-
[`${prefixCls}__content--${this.backgrounds}--disabled`]: this.disabled,
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
|
-
},
|
|
56
|
-
textClasses(){
|
|
57
|
-
return [
|
|
58
|
-
{
|
|
59
|
-
[`${prefixCls}__text--disabled`]: this.disabled
|
|
60
|
-
}
|
|
61
|
-
]
|
|
62
|
-
},
|
|
63
|
-
iconClasses(){
|
|
64
|
-
return [
|
|
65
|
-
{
|
|
66
|
-
[`${prefixCls}__icon--disabled`]: this.disabled
|
|
67
|
-
}
|
|
68
|
-
]
|
|
69
|
-
},
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
</script>
|
|
73
|
-
|
|
74
|
-
<style lang="less">
|
|
75
|
-
@import './style.less';
|
|
76
|
-
</style>
|
|
@@ -1,112 +0,0 @@
|
|
|
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
|
-
&--disabled{
|
|
30
|
-
background-color: var(--color-actions-bg-green-disable);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&--warning{
|
|
35
|
-
background-color: var(--color-actions-bg-warning);
|
|
36
|
-
&--disabled{
|
|
37
|
-
background-color: var(--color-actions-bg-warning-disable);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&--blue{
|
|
42
|
-
background-color: var(--color-actions-bg-blue);
|
|
43
|
-
&--disabled{
|
|
44
|
-
background-color: var(--color-actions-bg-blue-disable);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&--gray{
|
|
49
|
-
background-color: var(--color-actions-bg-gray);
|
|
50
|
-
&--disabled{
|
|
51
|
-
background-color: var(--color-actions-bg-gray-disable);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.@{actions-prefix-cls}__icon{
|
|
59
|
-
color: var(--color-actions-text);
|
|
60
|
-
font-size: calc(var(--icon-actions-card) * 1px);
|
|
61
|
-
&--disabled{
|
|
62
|
-
color: var(--color-actions-text-disable);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
&__text{
|
|
68
|
-
color: var(--color-actions-text);
|
|
69
|
-
font-size: calc(var(--en-single-f-d-s-fontSize) * 1px);
|
|
70
|
-
font-weight: var(--en-single-f-d-s-fontWeight);
|
|
71
|
-
&--disabled{
|
|
72
|
-
color: var(--color-actions-text-disable);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
&__icon{
|
|
77
|
-
font-size: calc(var(--icon-actions-size) * 1px);
|
|
78
|
-
color: var(--color-actions-text);
|
|
79
|
-
&--disabled{
|
|
80
|
-
color: var(--color-actions-text-disable);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
&__green{
|
|
85
|
-
background-color: var(--color-actions-bg-green);
|
|
86
|
-
&--disabled{
|
|
87
|
-
background-color: var(--color-actions-bg-green-disable);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
&__warning{
|
|
92
|
-
background-color: var(--color-actions-bg-warning);
|
|
93
|
-
&--disabled{
|
|
94
|
-
background-color: var(--color-actions-bg-warning-disable);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
&__blue{
|
|
99
|
-
background-color: var(--color-actions-bg-blue);
|
|
100
|
-
&--disabled{
|
|
101
|
-
background-color: var(--color-actions-bg-blue-disable);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
&__gray{
|
|
106
|
-
background-color: var(--color-actions-bg-gray);
|
|
107
|
-
&--disabled{
|
|
108
|
-
background-color: var(--color-actions-bg-gray-disable);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
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>
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<transition name="vd-activityviews-fade">
|
|
4
|
-
<div class="vd-overlay" v-if="overlay && visible" @click="handleOverlayClick"></div>
|
|
5
|
-
</transition>
|
|
6
|
-
<transition name="vd-activityviews-slide-up">
|
|
7
|
-
<div class="vd-activityviews" v-if="visible">
|
|
8
|
-
<div class="vd-activityviews__header" v-if="withHeader">
|
|
9
|
-
<div class="vd-activityviews__wrapper">
|
|
10
|
-
<vd-icon v-if="backDefault" name="icon_nav_back"></vd-icon>
|
|
11
|
-
<div v-if="title" class="vd-activityviews__title">{{ title }}</div>
|
|
12
|
-
<slot name="close">
|
|
13
|
-
<vd-icon v-if="closeIcon" class="vd-activityviews__close" :name="currentCloseIcon" svg
|
|
14
|
-
@click="onCancel"></vd-icon>
|
|
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 vd-hairline--bottom">{{ 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" :class="{ 'vd-hairline--bottom': index !== actions.length - 1 }"
|
|
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
|
-
<div v-if="cancelText" class="vd-activityviews__cancel" @click="onCancel">
|
|
31
|
-
<vd-button block type="tertiary" size="large">{{ cancelText }}</vd-button>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
<slot v-else></slot>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
</transition>
|
|
38
|
-
</div>
|
|
39
|
-
</template>
|
|
40
|
-
|
|
41
|
-
<script>
|
|
42
|
-
import { themeMixin } from '@p/components/mixins/themeMixin';
|
|
43
|
-
|
|
44
|
-
export default {
|
|
45
|
-
name: 'vd-activityviews',
|
|
46
|
-
mixins: [themeMixin], // 引入混入
|
|
47
|
-
props: {
|
|
48
|
-
value: Boolean,
|
|
49
|
-
title: String,
|
|
50
|
-
backDefault:Boolean,
|
|
51
|
-
closeIcon: Boolean,
|
|
52
|
-
closeBtn: String,
|
|
53
|
-
description: String,
|
|
54
|
-
withHeader: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: true
|
|
57
|
-
},
|
|
58
|
-
withBar: Boolean,
|
|
59
|
-
actionSheet: Boolean,
|
|
60
|
-
actions: {
|
|
61
|
-
type: Array,
|
|
62
|
-
default() {
|
|
63
|
-
return [];
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
cancelText: String,
|
|
67
|
-
overlay: {
|
|
68
|
-
type: Boolean,
|
|
69
|
-
default: true
|
|
70
|
-
},
|
|
71
|
-
disabled: Boolean,
|
|
72
|
-
closeOnOverlay:{
|
|
73
|
-
type: Boolean,
|
|
74
|
-
default: true
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
data() {
|
|
78
|
-
return {
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
computed: {
|
|
82
|
-
visible(){
|
|
83
|
-
return this.value
|
|
84
|
-
},
|
|
85
|
-
currentCloseIcon() {
|
|
86
|
-
return this.isDarkTheme ? 'icon_btn_dialogclose_dark' : 'icon_btn_dialogclose';
|
|
87
|
-
},
|
|
88
|
-
isDarkTheme() {
|
|
89
|
-
return this.theme === 'dark';
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
watch: {
|
|
93
|
-
},
|
|
94
|
-
methods: {
|
|
95
|
-
closeActivity() {
|
|
96
|
-
this.$emit('input', false);
|
|
97
|
-
},
|
|
98
|
-
onCancel() {
|
|
99
|
-
this.closeActivity();
|
|
100
|
-
this.$emit('cancel');
|
|
101
|
-
},
|
|
102
|
-
onSelect(item) {
|
|
103
|
-
if (!item.disabled) {
|
|
104
|
-
this.$emit('select', item);
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
handleOverlayClick() {
|
|
108
|
-
if (this.closeOnOverlay) {
|
|
109
|
-
this.closeActivity();
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
mounted() {
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
</script>
|
|
118
|
-
|
|
119
|
-
<style lang="less">
|
|
120
|
-
@import './style.less';
|
|
121
|
-
|
|
122
|
-
.vd-activityviews-fade-enter-active,
|
|
123
|
-
.vd-activityviews-fade-leave-active {
|
|
124
|
-
transition: opacity 0.3s;
|
|
125
|
-
}
|
|
126
|
-
.vd-activityviews-fade-enter,
|
|
127
|
-
.vd-activityviews-fade-leave-to {
|
|
128
|
-
opacity: 0;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.vd-activityviews-slide-up-enter-active,
|
|
132
|
-
.vd-activityviews-slide-up-leave-active {
|
|
133
|
-
transition: transform 0.3s;
|
|
134
|
-
}
|
|
135
|
-
.vd-activityviews-slide-up-enter,
|
|
136
|
-
.vd-activityviews-slide-up-leave-to {
|
|
137
|
-
transform: translateY(100%);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
</style>
|