Skip to content

Commit 6d8f03e

Browse files
committed
[build] 0.4.7
1 parent 61c95ee commit 6d8f03e

43 files changed

Lines changed: 424 additions & 93 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dist/action-sheet/index.wxss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@import '../common/index.wxss';.van-action-sheet{max-height:90%!important;color:#333}.van-action-sheet__cancel,.van-action-sheet__item{height:50px;font-size:16px;line-height:50px;text-align:center;background-color:#fff}.van-action-sheet__cancel:active,.van-action-sheet__item:active{background-color:#e8e8e8}.van-action-sheet__cancel{height:60px}.van-action-sheet__cancel::before{display:block;content:' ';height:10px;background-color:#f8f8f8}.van-action-sheet__item--disabled{color:#c9c9c9}.van-action-sheet__item--disabled:active{background-color:#fff}.van-action-sheet__subname{margin-left:5px;font-size:12px;color:#666}.van-action-sheet__header{font-size:16px;font-weight:500;line-height:44px;text-align:center}.van-action-sheet__close{position:absolute!important;top:0;right:0;padding:0 15px;font-size:18px!important;line-height:inherit!important;color:#999}
1+
@import '../common/index.wxss';.van-action-sheet{max-height:90%!important;color:#333}.van-action-sheet__cancel,.van-action-sheet__item{height:50px;font-size:16px;line-height:50px;text-align:center;background-color:#fff}.van-action-sheet__cancel:active,.van-action-sheet__item:active{background-color:#e8e8e8}.van-action-sheet__cancel{height:60px}.van-action-sheet__cancel::before{display:block;content:' ';height:10px;background-color:#f8f8f8}.van-action-sheet__item--disabled{color:#c9c9c9}.van-action-sheet__item--disabled:active{background-color:#fff}.van-action-sheet__subname{margin-left:5px;font-size:12px;color:#7d7e80}.van-action-sheet__header{font-size:16px;font-weight:500;line-height:44px;text-align:center}.van-action-sheet__close{position:absolute!important;top:0;right:0;padding:0 15px;font-size:18px!important;line-height:inherit!important;color:#999}

dist/badge/index.wxss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@import '../common/index.wxss';.van-badge{display:block;overflow:hidden;font-size:14px;line-height:1.4;-webkit-user-select:none;user-select:none;color:#666;word-break:break-all;box-sizing:border-box;padding:20px 12px 20px 9px;background-color:#f8f8f8;border-left:3px solid transparent}.van-badge:active{background-color:#e8e8e8}.van-badge::after{border-bottom-width:1px}.van-badge--active{font-weight:700;color:#333;border-color:#f44}.van-badge--active::after{border-right-width:1px}.van-badge--active,.van-badge--active:active{background-color:#fff}.van-badge__info{position:absolute;top:4px;right:2px;color:#fff;font-size:12px;font-weight:500;-webkit-transform:scale(.8);transform:scale(.8);text-align:center;box-sizing:border-box;padding:0 6px;min-width:18px;line-height:18px;border-radius:9px;background-color:#f44}
1+
@import '../common/index.wxss';.van-badge{display:block;overflow:hidden;font-size:14px;line-height:1.4;-webkit-user-select:none;user-select:none;color:#7d7e80;word-break:break-all;box-sizing:border-box;padding:20px 12px 20px 9px;background-color:#f8f8f8;border-left:3px solid transparent}.van-badge:active{background-color:#e8e8e8}.van-badge::after{border-bottom-width:1px}.van-badge--active{font-weight:700;color:#333;border-color:#f44}.van-badge--active::after{border-right-width:1px}.van-badge--active,.van-badge--active:active{background-color:#fff}.van-badge__info{position:absolute;top:4px;right:2px;color:#fff;font-size:12px;font-weight:500;-webkit-transform:scale(.8);transform:scale(.8);text-align:center;box-sizing:border-box;padding:0 6px;min-width:18px;line-height:18px;border-radius:9px;background-color:#f44}

dist/card/index.wxss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@import '../common/index.wxss';.van-card{box-sizing:border-box;position:relative;height:100px;font-size:12px;color:#333;padding:5px 15px 5px 115px;background:#fafafa}.van-card--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-card__thumb{position:absolute;top:5px;left:15px;width:90px;height:90px}.van-card__img{width:100%;height:100%}.van-card,.van-card__content{display:-webkit-flex;display:flex}.van-card__content{width:100%}.van-card__desc,.van-card__title{line-height:20px;word-break:break-all}.van-card__title{max-height:40px}.van-card__desc{max-height:20px;color:#666}.van-card__left{-webkit-flex:1;flex:1;min-width:0}.van-card__right{-webkit-flex:none;flex:none;padding-left:10px;line-height:20px;text-align:right}.van-card__origin-price{color:#666;text-decoration:line-through}.van-card__num{color:#666}.van-card__tag{position:absolute;top:2px;left:0}.van-card__footer{position:absolute;right:15px;bottom:5px}.van-card__footer .van-button{margin-left:5px}
1+
@import '../common/index.wxss';.van-card{box-sizing:border-box;position:relative;height:100px;font-size:12px;color:#333;padding:5px 15px 5px 115px;background:#fafafa}.van-card--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-card__thumb{position:absolute;top:5px;left:15px;width:90px;height:90px}.van-card__img{width:100%;height:100%}.van-card,.van-card__content{display:-webkit-flex;display:flex}.van-card__content{width:100%}.van-card__desc,.van-card__title{line-height:20px;word-break:break-all}.van-card__title{max-height:40px}.van-card__desc{max-height:20px;color:#7d7e80}.van-card__left{-webkit-flex:1;flex:1;min-width:0}.van-card__right{-webkit-flex:none;flex:none;padding-left:10px;line-height:20px;text-align:right}.van-card__origin-price{color:#7d7e80;text-decoration:line-through}.van-card__num{color:#7d7e80}.van-card__tag{position:absolute;top:2px;left:0}.van-card__footer{position:absolute;right:15px;bottom:5px}.van-card__footer .van-button{margin-left:5px}

dist/cell/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { link } from '../mixins/link';
22
import { VantComponent } from '../common/component';
33
VantComponent({
4-
classes: ['title-class', 'label-class', 'value-class'],
4+
classes: ['title-class', 'label-class', 'value-class', 'right-icon-class'],
55
mixins: [link],
66
props: {
77
title: null,
88
value: null,
99
icon: String,
10+
size: String,
1011
label: String,
1112
center: Boolean,
1213
isLink: Boolean,
@@ -27,15 +28,16 @@ VantComponent({
2728
'van-cell--center': data.center,
2829
'van-cell--required': data.required,
2930
'van-cell--borderless': !data.border,
30-
'van-cell--clickable': data.isLink || data.clickable
31+
'van-cell--clickable': data.isLink || data.clickable,
32+
["van-cell--" + data.size]: data.size
3133
});
3234
},
3335
titleStyle: function titleStyle() {
3436
var titleWidth = this.data.titleWidth;
3537
return titleWidth ? "max-width: " + titleWidth + ";min-width: " + titleWidth : '';
3638
},
3739
iconWrapClass: function iconWrapClass() {
38-
var prefix = 'van-cell__right-icon-wrap';
40+
var prefix = 'van-cell__right-icon-wrap right-icon-class';
3941
return this.classNames(prefix, prefix + "--" + this.data.arrowDirection);
4042
}
4143
},

dist/cell/index.wxss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@import '../common/index.wxss';.van-cell{width:100%;display:-webkit-flex;display:flex;padding:10px 15px;box-sizing:border-box;line-height:24px;position:relative;background-color:#fff;color:#333;font-size:14px}.van-cell::after{content:' ';position:absolute;pointer-events:none;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;top:auto;left:15px;right:0;bottom:0;-webkit-transform:scaleY(.5);transform:scaleY(.5);border-bottom:1px solid #eee}.van-cell--borderless::after{display:none}.van-cell-group{background-color:#fff}.van-cell__label{font-size:12px;line-height:1.2;color:#666}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px}.van-cell__left-icon-wrap{margin-right:5px}.van-cell__right-icon-wrap{margin-left:5px}.van-cell__right-icon-wrap--left{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.van-cell__right-icon-wrap--up{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-cell__right-icon-wrap--down{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.van-cell__left-icon{font-size:16px!important;line-height:24px;vertical-align:middle}.van-cell__right-icon{color:#999;font-size:12px!important;line-height:24px}.van-cell--clickable:active{background-color:#e8e8e8}.van-cell--required{overflow:visible}.van-cell--required::before{content:'*';position:absolute;left:7px;font-size:14px;color:#f44}.van-cell--center{-webkit-align-items:center;align-items:center}
1+
@import '../common/index.wxss';.van-cell{width:100%;display:-webkit-flex;display:flex;padding:10px 15px;box-sizing:border-box;line-height:24px;position:relative;background-color:#fff;color:#333;font-size:14px}.van-cell::after{content:' ';position:absolute;pointer-events:none;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;top:auto;left:15px;right:0;bottom:0;-webkit-transform:scaleY(.5);transform:scaleY(.5);border-bottom:1px solid #eee}.van-cell--borderless::after{display:none}.van-cell-group{background-color:#fff}.van-cell__label{font-size:12px;line-height:18px;color:#7d7e80}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px}.van-cell__left-icon-wrap{margin-right:5px;font-size:16px}.van-cell__right-icon-wrap{margin-left:5px;font-size:12px;color:#999}.van-cell__right-icon-wrap--left{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.van-cell__right-icon-wrap--up{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-cell__right-icon-wrap--down{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.van-cell__left-icon{line-height:24px;vertical-align:middle}.van-cell__right-icon{line-height:24px}.van-cell--clickable:active{background-color:#e8e8e8}.van-cell--required{overflow:visible}.van-cell--required::before{content:'*';position:absolute;left:7px;font-size:14px;color:#f44}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-bottom:12px}.van-cell--large .van-cell__title{font-size:16px}

dist/collapse-item/index.js

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import { VantComponent } from '../common/component';
2+
VantComponent({
3+
classes: ['content-class'],
4+
relation: {
5+
name: 'collapse',
6+
type: 'ancestor',
7+
linked: function linked(parent) {
8+
this.parent = parent;
9+
}
10+
},
11+
props: {
12+
name: [String, Number],
13+
icon: String,
14+
label: String,
15+
title: [String, Number],
16+
value: [String, Number],
17+
disabled: Boolean,
18+
border: {
19+
type: Boolean,
20+
value: true
21+
},
22+
isLink: {
23+
type: Boolean,
24+
value: true
25+
}
26+
},
27+
data: {
28+
contentHeight: 0,
29+
expanded: false
30+
},
31+
computed: {
32+
titleClass: function titleClass() {
33+
var _this$data = this.data,
34+
disabled = _this$data.disabled,
35+
expanded = _this$data.expanded;
36+
return this.classNames('van-collapse-item__title', {
37+
'van-collapse-item__title--disabled': disabled,
38+
'van-collapse-item__title--expanded': expanded
39+
});
40+
}
41+
},
42+
methods: {
43+
updateExpanded: function updateExpanded() {
44+
if (!this.parent) {
45+
return null;
46+
}
47+
48+
var _this$parent$data = this.parent.data,
49+
value = _this$parent$data.value,
50+
accordion = _this$parent$data.accordion,
51+
items = _this$parent$data.items;
52+
var name = this.data.name;
53+
var index = items.indexOf(this);
54+
var currentName = name == null ? index : name;
55+
var expanded = accordion ? value === currentName : value.some(function (name) {
56+
return name === currentName;
57+
});
58+
59+
if (expanded !== this.data.expanded) {
60+
this.updateStyle(expanded);
61+
}
62+
63+
this.setData({
64+
expanded: expanded
65+
});
66+
},
67+
updateStyle: function updateStyle(expanded) {
68+
var _this = this;
69+
70+
if (expanded) {
71+
this.getRect('.van-collapse-item__content').then(function (res) {
72+
_this.setData({
73+
contentHeight: res.height ? res.height + 'px' : null
74+
});
75+
});
76+
} else {
77+
this.setData({
78+
contentHeight: 0
79+
});
80+
}
81+
},
82+
onClick: function onClick() {
83+
if (this.data.disabled) {
84+
return;
85+
}
86+
87+
var _this$data2 = this.data,
88+
name = _this$data2.name,
89+
expanded = _this$data2.expanded;
90+
var index = this.parent.data.items.indexOf(this);
91+
var currentName = name == null ? index : name;
92+
this.parent.switch(currentName, !expanded);
93+
}
94+
}
95+
});

dist/collapse-item/index.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"component": true,
3+
"usingComponents": {
4+
"van-cell": "../cell/index"
5+
}
6+
}

dist/collapse-item/index.wxml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<view class="van-collapse-item van-hairline--top custom-class">
2+
<van-cell
3+
title="{{ title }}"
4+
icon="{{ icon }}"
5+
is-link="{{ isLink }}"
6+
value="{{ value }}"
7+
label="{{ label }}"
8+
border="{{ border && expanded }}"
9+
class="{{ titleClass }}"
10+
right-icon-class="van-cell__right-icon"
11+
custom-class="van-cell"
12+
arrow-direction="{{ expanded ? 'up' : 'down' }}"
13+
bind:click="onClick"
14+
>
15+
<slot
16+
name="title"
17+
slot="title"
18+
/>
19+
<slot
20+
name="icon"
21+
slot="icon"
22+
/>
23+
<slot name="value" />
24+
<slot
25+
name="right-icon"
26+
slot="right-icon"
27+
/>
28+
</van-cell>
29+
<view
30+
class="van-collapse-item__wrapper"
31+
style="max-height: {{ contentHeight }};"
32+
>
33+
<view
34+
class="van-collapse-item__content content-class"
35+
>
36+
<slot />
37+
</view>
38+
</view>
39+
</view>

dist/collapse-item/index.wxss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{-webkit-transform:rotate(90deg);transform:rotate(90deg);transition:.3s}.van-collapse-item__title--expanded .van-cell__right-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:#c9c9c9!important}.van-collapse-item__title--disabled:active{background-color:#fff!important}.van-collapse-item__wrapper{overflow:hidden;will-change:max-height;transition:max-height .3s ease-in-out}.van-collapse-item__content{padding:15px;background-color:#fff}

dist/collapse/index.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { VantComponent } from '../common/component';
2+
VantComponent({
3+
relation: {
4+
name: 'collapse-item',
5+
type: 'descendant',
6+
linked: function linked(child) {
7+
this.setData({
8+
items: this.data.items.concat([child])
9+
}, function () {
10+
child.updateExpanded();
11+
});
12+
}
13+
},
14+
props: {
15+
accordion: Boolean,
16+
value: null
17+
},
18+
data: {
19+
items: []
20+
},
21+
watch: {
22+
value: function value() {
23+
this.data.items.forEach(function (child) {
24+
child.updateExpanded();
25+
});
26+
},
27+
accordion: function accordion() {
28+
this.data.items.forEach(function (child) {
29+
child.updateExpanded();
30+
});
31+
}
32+
},
33+
methods: {
34+
switch: function _switch(name, expanded) {
35+
var _this$data = this.data,
36+
accordion = _this$data.accordion,
37+
value = _this$data.value;
38+
39+
if (!accordion) {
40+
name = expanded ? value.concat(name) : value.filter(function (activeName) {
41+
return activeName !== name;
42+
});
43+
} else {
44+
name = expanded ? name : '';
45+
}
46+
47+
this.$emit('change', name);
48+
this.$emit('input', name);
49+
}
50+
}
51+
});

0 commit comments

Comments
 (0)