mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
build: compile 1.7.0
This commit is contained in:
parent
2c0bc9022f
commit
422de09b67
dist
button
checkbox-group
checkbox
col
config-provider
goods-action-button
grid-item
grid
rate
share-sheet
slider
wxs
lib
button
checkbox-group
checkbox
col
config-provider
goods-action-button
grid-item
grid
rate
share-sheet
slider
wxs
8
dist/button/index.js
vendored
8
dist/button/index.js
vendored
@ -49,10 +49,16 @@ VantComponent({
|
||||
methods: {
|
||||
onClick(event) {
|
||||
this.$emit('click', event);
|
||||
const { canIUseGetUserProfile, openType, getUserProfileDesc } = this.data;
|
||||
const {
|
||||
canIUseGetUserProfile,
|
||||
openType,
|
||||
getUserProfileDesc,
|
||||
lang,
|
||||
} = this.data;
|
||||
if (openType === 'getUserInfo' && canIUseGetUserProfile) {
|
||||
wx.getUserProfile({
|
||||
desc: getUserProfileDesc || ' ',
|
||||
lang: lang || 'en',
|
||||
complete: (userProfile) => {
|
||||
this.$emit('getuserinfo', userProfile);
|
||||
},
|
||||
|
7
dist/checkbox-group/index.js
vendored
7
dist/checkbox-group/index.js
vendored
@ -15,16 +15,21 @@ VantComponent({
|
||||
type: Boolean,
|
||||
observer: 'updateChildren',
|
||||
},
|
||||
direction: {
|
||||
type: String,
|
||||
value: 'vertical',
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
updateChildren() {
|
||||
this.children.forEach((child) => this.updateChild(child));
|
||||
},
|
||||
updateChild(child) {
|
||||
const { value, disabled } = this.data;
|
||||
const { value, disabled, direction } = this.data;
|
||||
child.setData({
|
||||
value: value.indexOf(child.data.name) !== -1,
|
||||
parentDisabled: disabled,
|
||||
direction,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
6
dist/checkbox-group/index.wxml
vendored
6
dist/checkbox-group/index.wxml
vendored
@ -1 +1,5 @@
|
||||
<slot />
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
|
||||
<view class="{{ utils.bem('checkbox-group', [{ horizontal: direction === 'horizontal' }]) }}">
|
||||
<slot />
|
||||
</view>
|
||||
|
2
dist/checkbox-group/index.wxss
vendored
2
dist/checkbox-group/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';
|
||||
@import '../common/index.wxss';.van-checkbox-group--horizontal{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap}
|
1
dist/checkbox/index.js
vendored
1
dist/checkbox/index.js
vendored
@ -29,6 +29,7 @@ VantComponent({
|
||||
},
|
||||
data: {
|
||||
parentDisabled: false,
|
||||
direction: 'vertical',
|
||||
},
|
||||
methods: {
|
||||
emitChange(value) {
|
||||
|
2
dist/checkbox/index.wxml
vendored
2
dist/checkbox/index.wxml
vendored
@ -1,7 +1,7 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
<wxs src="./index.wxs" module="computed" />
|
||||
|
||||
<view class="van-checkbox custom-class">
|
||||
<view class="{{ utils.bem('checkbox', [{ horizontal: direction === 'horizontal' }]) }} custom-class">
|
||||
<view
|
||||
wx:if="{{ labelPosition === 'left' }}"
|
||||
class="label-class {{ utils.bem('checkbox__label', [labelPosition, { disabled: disabled || parentDisabled }]) }}"
|
||||
|
2
dist/checkbox/index.wxss
vendored
2
dist/checkbox/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-checkbox{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none}.van-checkbox__icon-wrap,.van-checkbox__label{line-height:20px;line-height:var(--checkbox-size,20px)}.van-checkbox__icon-wrap{-webkit-flex:none;flex:none}.van-checkbox__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:1em;height:1em;color:transparent;text-align:center;transition-property:color,border-color,background-color;font-size:20px;font-size:var(--checkbox-size,20px);border:1px solid #c8c9cc;border:1px solid var(--checkbox-border-color,#c8c9cc);transition-duration:.2s;transition-duration:var(--checkbox-transition-duration,.2s)}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{color:#fff;color:var(--white,#fff);background-color:#1989fa;background-color:var(--checkbox-checked-icon-color,#1989fa);border-color:#1989fa;border-color:var(--checkbox-checked-icon-color,#1989fa)}.van-checkbox__icon--disabled{background-color:#ebedf0;background-color:var(--checkbox-disabled-background-color,#ebedf0);border-color:#c8c9cc;border-color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__icon--disabled.van-checkbox__icon--checked{color:#c8c9cc;color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__label{word-wrap:break-word;margin-left:10px;margin-left:var(--checkbox-label-margin,10px);color:#323233;color:var(--checkbox-label-color,#323233)}.van-checkbox__label--left{float:left;margin:0 10px 0 0;margin:0 var(--checkbox-label-margin,10px) 0 0}.van-checkbox__label--disabled{color:#c8c9cc;color:var(--checkbox-disabled-label-color,#c8c9cc)}.van-checkbox__label:empty{margin:0}
|
||||
@import '../common/index.wxss';.van-checkbox{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none}.van-checkbox--horizontal{margin-right:12px}.van-checkbox__icon-wrap,.van-checkbox__label{line-height:20px;line-height:var(--checkbox-size,20px)}.van-checkbox__icon-wrap{-webkit-flex:none;flex:none}.van-checkbox__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:1em;height:1em;color:transparent;text-align:center;transition-property:color,border-color,background-color;font-size:20px;font-size:var(--checkbox-size,20px);border:1px solid #c8c9cc;border:1px solid var(--checkbox-border-color,#c8c9cc);transition-duration:.2s;transition-duration:var(--checkbox-transition-duration,.2s)}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{color:#fff;color:var(--white,#fff);background-color:#1989fa;background-color:var(--checkbox-checked-icon-color,#1989fa);border-color:#1989fa;border-color:var(--checkbox-checked-icon-color,#1989fa)}.van-checkbox__icon--disabled{background-color:#ebedf0;background-color:var(--checkbox-disabled-background-color,#ebedf0);border-color:#c8c9cc;border-color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__icon--disabled.van-checkbox__icon--checked{color:#c8c9cc;color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__label{word-wrap:break-word;margin-left:10px;margin-left:var(--checkbox-label-margin,10px);color:#323233;color:var(--checkbox-label-color,#323233)}.van-checkbox__label--left{float:left;margin:0 10px 0 0;margin:0 var(--checkbox-label-margin,10px) 0 0}.van-checkbox__label--disabled{color:#c8c9cc;color:var(--checkbox-disabled-label-color,#c8c9cc)}.van-checkbox__label:empty{margin:0}
|
2
dist/col/index.wxss
vendored
2
dist/col/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-col{float:left;box-sizing:border-box}.van-col--1{width:4.16666667%}.van-col--offset-1{margin-left:4.16666667%}.van-col--2{width:8.33333333%}.van-col--offset-2{margin-left:8.33333333%}.van-col--3{width:12.5%}.van-col--offset-3{margin-left:12.5%}.van-col--4{width:16.66666667%}.van-col--offset-4{margin-left:16.66666667%}.van-col--5{width:20.83333333%}.van-col--offset-5{margin-left:20.83333333%}.van-col--6{width:25%}.van-col--offset-6{margin-left:25%}.van-col--7{width:29.16666667%}.van-col--offset-7{margin-left:29.16666667%}.van-col--8{width:33.33333333%}.van-col--offset-8{margin-left:33.33333333%}.van-col--9{width:37.5%}.van-col--offset-9{margin-left:37.5%}.van-col--10{width:41.66666667%}.van-col--offset-10{margin-left:41.66666667%}.van-col--11{width:45.83333333%}.van-col--offset-11{margin-left:45.83333333%}.van-col--12{width:50%}.van-col--offset-12{margin-left:50%}.van-col--13{width:54.16666667%}.van-col--offset-13{margin-left:54.16666667%}.van-col--14{width:58.33333333%}.van-col--offset-14{margin-left:58.33333333%}.van-col--15{width:62.5%}.van-col--offset-15{margin-left:62.5%}.van-col--16{width:66.66666667%}.van-col--offset-16{margin-left:66.66666667%}.van-col--17{width:70.83333333%}.van-col--offset-17{margin-left:70.83333333%}.van-col--18{width:75%}.van-col--offset-18{margin-left:75%}.van-col--19{width:79.16666667%}.van-col--offset-19{margin-left:79.16666667%}.van-col--20{width:83.33333333%}.van-col--offset-20{margin-left:83.33333333%}.van-col--21{width:87.5%}.van-col--offset-21{margin-left:87.5%}.van-col--22{width:91.66666667%}.van-col--offset-22{margin-left:91.66666667%}.van-col--23{width:95.83333333%}.van-col--offset-23{margin-left:95.83333333%}.van-col--24{width:100%}.van-col--offset-24{margin-left:100%}
|
||||
@import '../common/index.wxss';.van-col{float:left;box-sizing:border-box}.van-col--1{width:100%/24}.van-col--offset-1{margin-left:100%/24}.van-col--2{width:200%/24}.van-col--offset-2{margin-left:200%/24}.van-col--3{width:300%/24}.van-col--offset-3{margin-left:300%/24}.van-col--4{width:400%/24}.van-col--offset-4{margin-left:400%/24}.van-col--5{width:500%/24}.van-col--offset-5{margin-left:500%/24}.van-col--6{width:600%/24}.van-col--offset-6{margin-left:600%/24}.van-col--7{width:700%/24}.van-col--offset-7{margin-left:700%/24}.van-col--8{width:800%/24}.van-col--offset-8{margin-left:800%/24}.van-col--9{width:900%/24}.van-col--offset-9{margin-left:900%/24}.van-col--10{width:1000%/24}.van-col--offset-10{margin-left:1000%/24}.van-col--11{width:1100%/24}.van-col--offset-11{margin-left:1100%/24}.van-col--12{width:1200%/24}.van-col--offset-12{margin-left:1200%/24}.van-col--13{width:1300%/24}.van-col--offset-13{margin-left:1300%/24}.van-col--14{width:1400%/24}.van-col--offset-14{margin-left:1400%/24}.van-col--15{width:1500%/24}.van-col--offset-15{margin-left:1500%/24}.van-col--16{width:1600%/24}.van-col--offset-16{margin-left:1600%/24}.van-col--17{width:1700%/24}.van-col--offset-17{margin-left:1700%/24}.van-col--18{width:1800%/24}.van-col--offset-18{margin-left:1800%/24}.van-col--19{width:1900%/24}.van-col--offset-19{margin-left:1900%/24}.van-col--20{width:2000%/24}.van-col--offset-20{margin-left:2000%/24}.van-col--21{width:2100%/24}.van-col--offset-21{margin-left:2100%/24}.van-col--22{width:2200%/24}.van-col--offset-22{margin-left:2200%/24}.van-col--23{width:2300%/24}.van-col--offset-23{margin-left:2300%/24}.van-col--24{width:2400%/24}.van-col--offset-24{margin-left:2400%/24}
|
1
dist/config-provider/index.d.ts
vendored
Normal file
1
dist/config-provider/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
9
dist/config-provider/index.js
vendored
Normal file
9
dist/config-provider/index.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import { VantComponent } from '../common/component';
|
||||
VantComponent({
|
||||
props: {
|
||||
themeVars: {
|
||||
type: Object,
|
||||
value: {},
|
||||
},
|
||||
},
|
||||
});
|
3
dist/config-provider/index.json
vendored
Normal file
3
dist/config-provider/index.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"component": true
|
||||
}
|
5
dist/config-provider/index.wxml
vendored
Normal file
5
dist/config-provider/index.wxml
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
<wxs src="./index.wxs" module="computed" />
|
||||
|
||||
<view class="van-config-provider" style="{{ computed.mapThemeVarsToCSSVars(themeVars) }}">
|
||||
<slot />
|
||||
</view>
|
29
dist/config-provider/index.wxs
vendored
Normal file
29
dist/config-provider/index.wxs
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
var object = require('../wxs/object.wxs');
|
||||
var style = require('../wxs/style.wxs');
|
||||
|
||||
function kebabCase(word) {
|
||||
var newWord = word
|
||||
.replace(getRegExp("[A-Z]", 'g'), function (i) {
|
||||
return '-' + i;
|
||||
})
|
||||
.toLowerCase()
|
||||
.replace(getRegExp("^-"), '');
|
||||
|
||||
return newWord;
|
||||
}
|
||||
|
||||
function mapThemeVarsToCSSVars(themeVars) {
|
||||
var cssVars = {};
|
||||
object.keys(themeVars).forEach(function (key) {
|
||||
var cssVarsKey = '--' + kebabCase(key);
|
||||
cssVars[cssVarsKey] = themeVars[key];
|
||||
});
|
||||
|
||||
return style(cssVars);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
kebabCase: kebabCase,
|
||||
mapThemeVarsToCSSVars: mapThemeVarsToCSSVars,
|
||||
};
|
2
dist/goods-action-button/index.wxss
vendored
2
dist/goods-action-button/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';:host{-webkit-flex:1;flex:1}.van-goods-action-button{--button-warning-background-color:linear-gradient(90deg,#ffd01e,#ff8917);--button-warning-background-color:var(--goods-action-button-warning-color,linear-gradient(90deg,#ffd01e,#ff8917));--button-danger-background-color:linear-gradient(90deg,#ff6034,#ee0a24);--button-danger-background-color:var(--goods-action-button-danger-color,linear-gradient(90deg,#ff6034,#ee0a24));--button-default-height:40px;--button-default-height:var(--goods-action-button-height,40px);--button-line-height:20px;--button-line-height:var(--goods-action-button-line-height,20px);--button-plain-background-color:#fff;--button-plain-background-color:var(--goods-action-button-plain-color,#fff);display:block;--button-border-width:0}.van-goods-action-button--first{margin-left:5px;--button-border-radius:20px 0 0 20px;--button-border-radius:var(--goods-action-button-border-radius,20px) 0 0 var(--goods-action-button-border-radius,20px)}.van-goods-action-button--last{margin-right:5px;--button-border-radius:0 20px 20px 0;--button-border-radius:0 var(--goods-action-button-border-radius,20px) var(--goods-action-button-border-radius,20px) 0}.van-goods-action-button--first.van-goods-action-button--last{--button-border-radius:20px;--button-border-radius:var(--goods-action-button-border-radius,20px)}.van-goods-action-button--plain{--button-border-width:1px}.van-goods-action-button__inner{width:100%;font-weight:500!important;font-weight:var(--font-weight-bold,500)!important}@media (max-width:321px){.van-goods-action-button{font-size:13px}}
|
||||
@import '../common/index.wxss';:host{-webkit-flex:1;flex:1}.van-goods-action-button{--button-warning-background-color:linear-gradient(90deg,#ffd01e,#ff8917);--button-warning-background-color:var(--goods-action-button-warning-color,linear-gradient(90deg,#ffd01e,#ff8917));--button-danger-background-color:linear-gradient(90deg,#ff6034,#ee0a24);--button-danger-background-color:var(--goods-action-button-danger-color,linear-gradient(90deg,#ff6034,#ee0a24));--button-default-height:40px;--button-default-height:var(--goods-action-button-height,40px);--button-line-height:20px;--button-line-height:var(--goods-action-button-line-height,20px);--button-plain-background-color:#fff;--button-plain-background-color:var(--goods-action-button-plain-color,#fff);display:block;--button-border-width:0}.van-goods-action-button--first{margin-left:5px;--button-border-radius:40px/2 0 0 40px/2;--button-border-radius:var(--goods-action-button-border-radius,40px/2) 0 0 var(--goods-action-button-border-radius,40px/2)}.van-goods-action-button--last{margin-right:5px;--button-border-radius:0 40px/2 40px/2 0;--button-border-radius:0 var(--goods-action-button-border-radius,40px/2) var(--goods-action-button-border-radius,40px/2) 0}.van-goods-action-button--first.van-goods-action-button--last{--button-border-radius:40px/2;--button-border-radius:var(--goods-action-button-border-radius,40px/2)}.van-goods-action-button--plain{--button-border-width:1px}.van-goods-action-button__inner{width:100%;font-weight:500!important;font-weight:var(--font-weight-bold,500)!important}@media (max-width:321px){.van-goods-action-button{font-size:13px}}
|
3
dist/grid-item/index.js
vendored
3
dist/grid-item/index.js
vendored
@ -8,6 +8,7 @@ VantComponent({
|
||||
props: {
|
||||
icon: String,
|
||||
iconColor: String,
|
||||
iconPrefix: String,
|
||||
dot: Boolean,
|
||||
info: null,
|
||||
badge: null,
|
||||
@ -34,6 +35,7 @@ VantComponent({
|
||||
clickable,
|
||||
center,
|
||||
direction,
|
||||
reverse,
|
||||
iconSize,
|
||||
} = data;
|
||||
this.setData({
|
||||
@ -43,6 +45,7 @@ VantComponent({
|
||||
gutter,
|
||||
clickable,
|
||||
direction,
|
||||
reverse,
|
||||
iconSize,
|
||||
index: children.indexOf(this),
|
||||
columnNum,
|
||||
|
4
dist/grid-item/index.wxml
vendored
4
dist/grid-item/index.wxml
vendored
@ -7,7 +7,7 @@
|
||||
bindtap="onClick"
|
||||
>
|
||||
<view
|
||||
class="content-class {{ utils.bem('grid-item__content', [direction, { center, square, clickable, surround: border && gutter }]) }} {{ border ? 'van-hairline--surround' : '' }}"
|
||||
class="content-class {{ utils.bem('grid-item__content', [direction, { center, square, reverse, clickable, surround: border && gutter }]) }} {{ border ? 'van-hairline--surround' : '' }}"
|
||||
style="{{ computed.contentStyle({ square, gutter }) }}"
|
||||
>
|
||||
<block wx:if="{{ useSlot }}">
|
||||
@ -15,7 +15,7 @@
|
||||
</block>
|
||||
<block wx:else>
|
||||
<view class="van-grid-item__icon icon-class">
|
||||
<van-icon wx:if="{{ icon }}" name="{{ icon }}" color="{{ iconColor }}" dot="{{ dot }}" info="{{ badge || info }}" size="{{ iconSize }}" />
|
||||
<van-icon wx:if="{{ icon }}" name="{{ icon }}" color="{{ iconColor }}" class-prefix="{{ iconPrefix }}" dot="{{ dot }}" info="{{ badge || info }}" size="{{ iconSize }}" />
|
||||
<slot wx:else name="icon"></slot>
|
||||
</view>
|
||||
<view class="van-grid-item__text text-class">
|
||||
|
2
dist/grid-item/index.wxss
vendored
2
dist/grid-item/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-grid-item{position:relative;float:left;box-sizing:border-box}.van-grid-item--square{height:0}.van-grid-item__content{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;box-sizing:border-box;height:100%;padding:16px 8px;padding:var(--grid-item-content-padding,16px 8px);background-color:#fff;background-color:var(--grid-item-content-background-color,#fff)}.van-grid-item__content:after{z-index:1;border-width:0 1px 1px 0;border-bottom-width:var(--border-width-base,1px);border-right-width:var(--border-width-base,1px);border-top-width:0}.van-grid-item__content--surround:after{border-width:1px;border-width:var(--border-width-base,1px)}.van-grid-item__content--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-grid-item__content--square{position:absolute;top:0;right:0;left:0}.van-grid-item__content--horizontal{-webkit-flex-direction:row;flex-direction:row}.van-grid-item__content--horizontal .van-grid-item__icon+.van-grid-item__text{margin-top:0;margin-left:8px}.van-grid-item__content--clickable:active{background-color:#f2f3f5;background-color:var(--grid-item-content-active-color,#f2f3f5)}.van-grid-item__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;font-size:26px;font-size:var(--grid-item-icon-size,26px);height:26px;height:var(--grid-item-icon-size,26px)}.van-grid-item__text{word-wrap:break-word;color:#646566;color:var(--grid-item-text-color,#646566);font-size:12px;font-size:var(--grid-item-text-font-size,12px)}.van-grid-item__icon+.van-grid-item__text{margin-top:8px}
|
||||
@import '../common/index.wxss';.van-grid-item{position:relative;float:left;box-sizing:border-box}.van-grid-item--square{height:0}.van-grid-item__content{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;box-sizing:border-box;height:100%;padding:16px 8px;padding:var(--grid-item-content-padding,16px 8px);background-color:#fff;background-color:var(--grid-item-content-background-color,#fff)}.van-grid-item__content:after{z-index:1;border-width:0 1px 1px 0;border-bottom-width:var(--border-width-base,1px);border-right-width:var(--border-width-base,1px);border-top-width:0}.van-grid-item__content--surround:after{border-width:1px;border-width:var(--border-width-base,1px)}.van-grid-item__content--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-grid-item__content--square{position:absolute;top:0;right:0;left:0}.van-grid-item__content--horizontal{-webkit-flex-direction:row;flex-direction:row}.van-grid-item__content--horizontal .van-grid-item__text{margin:0 0 0 8px}.van-grid-item__content--reverse{-webkit-flex-direction:column-reverse;flex-direction:column-reverse}.van-grid-item__content--reverse .van-grid-item__text{margin:0 0 8px}.van-grid-item__content--horizontal.van-grid-item__content--reverse{-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.van-grid-item__content--horizontal.van-grid-item__content--reverse .van-grid-item__text{margin:0 8px 0 0}.van-grid-item__content--clickable:active{background-color:#f2f3f5;background-color:var(--grid-item-content-active-color,#f2f3f5)}.van-grid-item__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;font-size:26px;font-size:var(--grid-item-icon-size,26px);height:26px;height:var(--grid-item-icon-size,26px)}.van-grid-item__text{word-wrap:break-word;color:#646566;color:var(--grid-item-text-color,#646566);font-size:12px;font-size:var(--grid-item-text-font-size,12px)}.van-grid-item__icon+.van-grid-item__text{margin-top:8px}
|
5
dist/grid/index.js
vendored
5
dist/grid/index.js
vendored
@ -39,6 +39,11 @@ VantComponent({
|
||||
type: String,
|
||||
observer: 'updateChildren',
|
||||
},
|
||||
reverse: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
observer: 'updateChildren',
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
updateChildren() {
|
||||
|
15
dist/rate/index.js
vendored
15
dist/rate/index.js
vendored
@ -25,18 +25,9 @@ VantComponent({
|
||||
type: String,
|
||||
value: 'star-o',
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
value: '#ffd21e',
|
||||
},
|
||||
voidColor: {
|
||||
type: String,
|
||||
value: '#c7c7c7',
|
||||
},
|
||||
disabledColor: {
|
||||
type: String,
|
||||
value: '#bdbdbd',
|
||||
},
|
||||
color: String,
|
||||
voidColor: String,
|
||||
disabledColor: String,
|
||||
count: {
|
||||
type: Number,
|
||||
value: 5,
|
||||
|
15
dist/rate/index.wxml
vendored
15
dist/rate/index.wxml
vendored
@ -1,19 +1,20 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
<wxs src="../wxs/style.wxs" module="style" />
|
||||
|
||||
<view
|
||||
class="van-rate custom-class"
|
||||
class="{{ utils.bem('rate') }} custom-class"
|
||||
bind:touchmove="onTouchMove"
|
||||
>
|
||||
<view
|
||||
class="van-rate__item"
|
||||
class="{{ utils.bem('rate__item') }}"
|
||||
wx:for="{{ innerCountArray }}"
|
||||
wx:key="index"
|
||||
style="padding-right: {{ index !== count - 1 ? utils.addUnit(gutter) : '' }}"
|
||||
style="{{ style({ paddingRight: index !== count - 1 ? utils.addUnit(gutter) : null }) }}"
|
||||
>
|
||||
<van-icon
|
||||
name="{{ index + 1 <= innerValue ? icon : voidIcon }}"
|
||||
class="van-rate__icon"
|
||||
style="font-size: {{ utils.addUnit(size) }}"
|
||||
class="{{ utils.bem('rate__icon', [{ disabled, full: index + 1 <= innerValue }])}}"
|
||||
style="{{ style({ fontSize: utils.addUnit(size) }) }}"
|
||||
custom-class="icon-class"
|
||||
data-score="{{ index }}"
|
||||
color="{{ disabled ? disabledColor : index + 1 <= innerValue ? color : voidColor }}"
|
||||
@ -23,8 +24,8 @@
|
||||
<van-icon
|
||||
wx:if="{{ allowHalf }}"
|
||||
name="{{ index + 0.5 <= innerValue ? icon : voidIcon }}"
|
||||
class="{{ utils.bem('rate__icon', ['half']) }}"
|
||||
style="font-size: {{ utils.addUnit(size) }}"
|
||||
class="{{ utils.bem('rate__icon', ['half', { disabled, full: index + 0.5 <= innerValue }]) }}"
|
||||
style="{{ style({ fontSize: utils.addUnit(size) }) }}"
|
||||
custom-class="icon-class"
|
||||
data-score="{{ index - 0.5 }}"
|
||||
color="{{ disabled ? disabledColor : index + 0.5 <= innerValue ? color : voidColor }}"
|
||||
|
2
dist/rate/index.wxss
vendored
2
dist/rate/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-rate{display:-webkit-inline-flex;display:inline-flex;-webkit-user-select:none;user-select:none}.van-rate__item{position:relative;padding:0 2px;padding:0 var(--rate-horizontal-padding,2px)}.van-rate__icon{display:block;height:1em;font-size:20px;font-size:var(--rate-icon-size,20px)}.van-rate__icon--half{position:absolute;top:0;width:.5em;overflow:hidden;left:2px;left:var(--rate-horizontal-padding,2px)}
|
||||
@import '../common/index.wxss';.van-rate{display:-webkit-inline-flex;display:inline-flex;-webkit-user-select:none;user-select:none}.van-rate__item{position:relative;padding:0 2px;padding:0 var(--rate-horizontal-padding,2px)}.van-rate__item:not(:last-child){padding-right:4px;padding-right:var(--rate-icon-gutter,4px)}.van-rate__icon{display:block;height:1em;color:#c8c9cc;color:var(--rate-icon-void-color,#c8c9cc);font-size:20px;font-size:var(--rate-icon-size,20px)}.van-rate__icon--half{position:absolute;top:0;width:.5em;overflow:hidden;left:2px;left:var(--rate-horizontal-padding,2px)}.van-rate__icon--full,.van-rate__icon--half{color:#ee0a24;color:var(--rate-icon-full-color,#ee0a24)}.van-rate__icon--disabled{color:#c8c9cc;color:var(--rate-icon-disabled-color,#c8c9cc)}
|
4
dist/share-sheet/options.wxs
vendored
4
dist/share-sheet/options.wxs
vendored
@ -1,9 +1,9 @@
|
||||
/* eslint-disable */
|
||||
var PRESET_ICONS = ['qq', 'weibo', 'wechat', 'link', 'qrcode', 'poster'];
|
||||
var PRESET_ICONS = ['qq', 'link', 'weibo', 'wechat', 'poster', 'qrcode', 'weapp-qrcode', 'wechat-moments'];
|
||||
|
||||
function getIconURL(icon) {
|
||||
if (PRESET_ICONS.indexOf(icon) !== -1) {
|
||||
return 'https://img.yzcdn.cn/vant/share-icon-' + icon + '.png';
|
||||
return 'https://img.yzcdn.cn/vant/share-sheet-' + icon + '.png';
|
||||
}
|
||||
|
||||
return icon;
|
||||
|
5
dist/slider/index.js
vendored
5
dist/slider/index.js
vendored
@ -30,10 +30,7 @@ VantComponent({
|
||||
}
|
||||
},
|
||||
},
|
||||
barHeight: {
|
||||
type: null,
|
||||
value: 2,
|
||||
},
|
||||
barHeight: null,
|
||||
},
|
||||
created() {
|
||||
this.updateValue(this.data.value);
|
||||
|
12
dist/slider/index.wxml
vendored
12
dist/slider/index.wxml
vendored
@ -1,17 +1,17 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
<wxs src="./index.wxs" module="computed" />
|
||||
<wxs src="../wxs/style.wxs" module="style" />
|
||||
|
||||
<view
|
||||
class="custom-class {{ utils.bem('slider', { disabled }) }}"
|
||||
style="{{ inactiveColor ? 'background:' + inactiveColor : '' }}"
|
||||
style="{{ style({ background: inactiveColor, height: utils.addUnit(barHeight) }) }}"
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<view
|
||||
class="van-slider__bar"
|
||||
style="{{ barStyle }};{{ computed.barStyle(barHeight, activeColor) }}"
|
||||
class="{{ utils.bem('slider__bar') }}"
|
||||
style="{{ barStyle }}; {{ style({ backgroundColor: activeColor }) }}"
|
||||
>
|
||||
<view
|
||||
class="van-slider__button-wrapper"
|
||||
class="{{ utils.bem('slider__button-wrapper') }}"
|
||||
bind:touchstart="onTouchStart"
|
||||
catch:touchmove="onTouchMove"
|
||||
bind:touchend="onTouchEnd"
|
||||
@ -23,7 +23,7 @@
|
||||
/>
|
||||
<view
|
||||
wx:else
|
||||
class="van-slider__button"
|
||||
class="{{ utils.bem('slider__button') }}"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
2
dist/slider/index.wxss
vendored
2
dist/slider/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-slider{position:relative;border-radius:999px;border-radius:var(--border-radius-max,999px);background-color:#ebedf0;background-color:var(--slider-inactive-background-color,#ebedf0)}.van-slider:before{position:absolute;right:0;left:0;content:"";top:-8px;top:-var(--padding-xs,8px);bottom:-8px;bottom:-var(--padding-xs,8px)}.van-slider__bar{position:relative;border-radius:inherit;transition:width .2s;transition:width var(--animation-duration-fast,.2s);background-color:#1989fa;background-color:var(--slider-active-background-color,#1989fa)}.van-slider__button{width:24px;height:24px;border-radius:50%;box-shadow:0 1px 2px rgba(0,0,0,.5);background-color:#fff;background-color:var(--slider-button-background-color,#fff)}.van-slider__button-wrapper{position:absolute;top:50%;right:0;-webkit-transform:translate3d(50%,-50%,0);transform:translate3d(50%,-50%,0)}.van-slider--disabled{opacity:.5}
|
||||
@import '../common/index.wxss';.van-slider{position:relative;height:2px;height:var(--slider-bar-height,2px);border-radius:999px;border-radius:var(--border-radius-max,999px);background-color:#ebedf0;background-color:var(--slider-inactive-background-color,#ebedf0)}.van-slider:before{position:absolute;right:0;left:0;content:"";top:-8px;top:-var(--padding-xs,8px);bottom:-8px;bottom:-var(--padding-xs,8px)}.van-slider__bar{position:relative;width:100%;height:100%;background-color:#1989fa;background-color:var(--slider-active-background-color,#1989fa);border-radius:inherit;transition:all .2s;transition:all var(--animation-duration-fast,.2s)}.van-slider__button{width:24px;width:var(--slider-button-width,24px);height:24px;height:var(--slider-button-height,24px);border-radius:50%;border-radius:var(--slider-button-border-radius,50%);box-shadow:0 1px 2px rgba(0,0,0,.5);box-shadow:var(--slider-button-box-shadow,0 1px 2px rgba(0,0,0,.5));background-color:#fff;background-color:var(--slider-button-background-color,#fff)}.van-slider__button-wrapper{position:absolute;top:50%;right:0;-webkit-transform:translate3d(50%,-50%,0);transform:translate3d(50%,-50%,0)}.van-slider--disabled{opacity:.5;opacity:var(--slider-disabled-opacity,.5)}
|
12
dist/wxs/style.wxs
vendored
12
dist/wxs/style.wxs
vendored
@ -2,6 +2,16 @@
|
||||
var object = require('./object.wxs');
|
||||
var array = require('./array.wxs');
|
||||
|
||||
function kebabCase(word) {
|
||||
var newWord = word
|
||||
.replace(getRegExp("[A-Z]", 'g'), function (i) {
|
||||
return '-' + i;
|
||||
})
|
||||
.toLowerCase()
|
||||
|
||||
return newWord;
|
||||
}
|
||||
|
||||
function style(styles) {
|
||||
if (array.isArray(styles)) {
|
||||
return styles
|
||||
@ -21,7 +31,7 @@ function style(styles) {
|
||||
return styles[key] != null && styles[key] !== '';
|
||||
})
|
||||
.map(function (key) {
|
||||
return [key, [styles[key]]].join(':');
|
||||
return [kebabCase(key), [styles[key]]].join(':');
|
||||
})
|
||||
.join(';');
|
||||
}
|
||||
|
@ -55,10 +55,12 @@ component_1.VantComponent({
|
||||
var _a = this.data,
|
||||
canIUseGetUserProfile = _a.canIUseGetUserProfile,
|
||||
openType = _a.openType,
|
||||
getUserProfileDesc = _a.getUserProfileDesc;
|
||||
getUserProfileDesc = _a.getUserProfileDesc,
|
||||
lang = _a.lang;
|
||||
if (openType === 'getUserInfo' && canIUseGetUserProfile) {
|
||||
wx.getUserProfile({
|
||||
desc: getUserProfileDesc || ' ',
|
||||
lang: lang || 'en',
|
||||
complete: function (userProfile) {
|
||||
_this.$emit('getuserinfo', userProfile);
|
||||
},
|
||||
|
@ -17,6 +17,10 @@ component_1.VantComponent({
|
||||
type: Boolean,
|
||||
observer: 'updateChildren',
|
||||
},
|
||||
direction: {
|
||||
type: String,
|
||||
value: 'vertical',
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
updateChildren: function () {
|
||||
@ -28,10 +32,12 @@ component_1.VantComponent({
|
||||
updateChild: function (child) {
|
||||
var _a = this.data,
|
||||
value = _a.value,
|
||||
disabled = _a.disabled;
|
||||
disabled = _a.disabled,
|
||||
direction = _a.direction;
|
||||
child.setData({
|
||||
value: value.indexOf(child.data.name) !== -1,
|
||||
parentDisabled: disabled,
|
||||
direction: direction,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
@ -1 +1,5 @@
|
||||
<slot />
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
|
||||
<view class="{{ utils.bem('checkbox-group', [{ horizontal: direction === 'horizontal' }]) }}">
|
||||
<slot />
|
||||
</view>
|
||||
|
@ -1 +1 @@
|
||||
@import '../common/index.wxss';
|
||||
@import '../common/index.wxss';.van-checkbox-group--horizontal{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap}
|
@ -31,6 +31,7 @@ component_1.VantComponent({
|
||||
},
|
||||
data: {
|
||||
parentDisabled: false,
|
||||
direction: 'vertical',
|
||||
},
|
||||
methods: {
|
||||
emitChange: function (value) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
<wxs src="./index.wxs" module="computed" />
|
||||
|
||||
<view class="van-checkbox custom-class">
|
||||
<view class="{{ utils.bem('checkbox', [{ horizontal: direction === 'horizontal' }]) }} custom-class">
|
||||
<view
|
||||
wx:if="{{ labelPosition === 'left' }}"
|
||||
class="label-class {{ utils.bem('checkbox__label', [labelPosition, { disabled: disabled || parentDisabled }]) }}"
|
||||
|
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-checkbox{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none}.van-checkbox__icon-wrap,.van-checkbox__label{line-height:20px;line-height:var(--checkbox-size,20px)}.van-checkbox__icon-wrap{-webkit-flex:none;flex:none}.van-checkbox__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:1em;height:1em;color:transparent;text-align:center;transition-property:color,border-color,background-color;font-size:20px;font-size:var(--checkbox-size,20px);border:1px solid #c8c9cc;border:1px solid var(--checkbox-border-color,#c8c9cc);transition-duration:.2s;transition-duration:var(--checkbox-transition-duration,.2s)}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{color:#fff;color:var(--white,#fff);background-color:#1989fa;background-color:var(--checkbox-checked-icon-color,#1989fa);border-color:#1989fa;border-color:var(--checkbox-checked-icon-color,#1989fa)}.van-checkbox__icon--disabled{background-color:#ebedf0;background-color:var(--checkbox-disabled-background-color,#ebedf0);border-color:#c8c9cc;border-color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__icon--disabled.van-checkbox__icon--checked{color:#c8c9cc;color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__label{word-wrap:break-word;margin-left:10px;margin-left:var(--checkbox-label-margin,10px);color:#323233;color:var(--checkbox-label-color,#323233)}.van-checkbox__label--left{float:left;margin:0 10px 0 0;margin:0 var(--checkbox-label-margin,10px) 0 0}.van-checkbox__label--disabled{color:#c8c9cc;color:var(--checkbox-disabled-label-color,#c8c9cc)}.van-checkbox__label:empty{margin:0}
|
||||
@import '../common/index.wxss';.van-checkbox{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none}.van-checkbox--horizontal{margin-right:12px}.van-checkbox__icon-wrap,.van-checkbox__label{line-height:20px;line-height:var(--checkbox-size,20px)}.van-checkbox__icon-wrap{-webkit-flex:none;flex:none}.van-checkbox__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:1em;height:1em;color:transparent;text-align:center;transition-property:color,border-color,background-color;font-size:20px;font-size:var(--checkbox-size,20px);border:1px solid #c8c9cc;border:1px solid var(--checkbox-border-color,#c8c9cc);transition-duration:.2s;transition-duration:var(--checkbox-transition-duration,.2s)}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{color:#fff;color:var(--white,#fff);background-color:#1989fa;background-color:var(--checkbox-checked-icon-color,#1989fa);border-color:#1989fa;border-color:var(--checkbox-checked-icon-color,#1989fa)}.van-checkbox__icon--disabled{background-color:#ebedf0;background-color:var(--checkbox-disabled-background-color,#ebedf0);border-color:#c8c9cc;border-color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__icon--disabled.van-checkbox__icon--checked{color:#c8c9cc;color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__label{word-wrap:break-word;margin-left:10px;margin-left:var(--checkbox-label-margin,10px);color:#323233;color:var(--checkbox-label-color,#323233)}.van-checkbox__label--left{float:left;margin:0 10px 0 0;margin:0 var(--checkbox-label-margin,10px) 0 0}.van-checkbox__label--disabled{color:#c8c9cc;color:var(--checkbox-disabled-label-color,#c8c9cc)}.van-checkbox__label:empty{margin:0}
|
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-col{float:left;box-sizing:border-box}.van-col--1{width:4.16666667%}.van-col--offset-1{margin-left:4.16666667%}.van-col--2{width:8.33333333%}.van-col--offset-2{margin-left:8.33333333%}.van-col--3{width:12.5%}.van-col--offset-3{margin-left:12.5%}.van-col--4{width:16.66666667%}.van-col--offset-4{margin-left:16.66666667%}.van-col--5{width:20.83333333%}.van-col--offset-5{margin-left:20.83333333%}.van-col--6{width:25%}.van-col--offset-6{margin-left:25%}.van-col--7{width:29.16666667%}.van-col--offset-7{margin-left:29.16666667%}.van-col--8{width:33.33333333%}.van-col--offset-8{margin-left:33.33333333%}.van-col--9{width:37.5%}.van-col--offset-9{margin-left:37.5%}.van-col--10{width:41.66666667%}.van-col--offset-10{margin-left:41.66666667%}.van-col--11{width:45.83333333%}.van-col--offset-11{margin-left:45.83333333%}.van-col--12{width:50%}.van-col--offset-12{margin-left:50%}.van-col--13{width:54.16666667%}.van-col--offset-13{margin-left:54.16666667%}.van-col--14{width:58.33333333%}.van-col--offset-14{margin-left:58.33333333%}.van-col--15{width:62.5%}.van-col--offset-15{margin-left:62.5%}.van-col--16{width:66.66666667%}.van-col--offset-16{margin-left:66.66666667%}.van-col--17{width:70.83333333%}.van-col--offset-17{margin-left:70.83333333%}.van-col--18{width:75%}.van-col--offset-18{margin-left:75%}.van-col--19{width:79.16666667%}.van-col--offset-19{margin-left:79.16666667%}.van-col--20{width:83.33333333%}.van-col--offset-20{margin-left:83.33333333%}.van-col--21{width:87.5%}.van-col--offset-21{margin-left:87.5%}.van-col--22{width:91.66666667%}.van-col--offset-22{margin-left:91.66666667%}.van-col--23{width:95.83333333%}.van-col--offset-23{margin-left:95.83333333%}.van-col--24{width:100%}.van-col--offset-24{margin-left:100%}
|
||||
@import '../common/index.wxss';.van-col{float:left;box-sizing:border-box}.van-col--1{width:100%/24}.van-col--offset-1{margin-left:100%/24}.van-col--2{width:200%/24}.van-col--offset-2{margin-left:200%/24}.van-col--3{width:300%/24}.van-col--offset-3{margin-left:300%/24}.van-col--4{width:400%/24}.van-col--offset-4{margin-left:400%/24}.van-col--5{width:500%/24}.van-col--offset-5{margin-left:500%/24}.van-col--6{width:600%/24}.van-col--offset-6{margin-left:600%/24}.van-col--7{width:700%/24}.van-col--offset-7{margin-left:700%/24}.van-col--8{width:800%/24}.van-col--offset-8{margin-left:800%/24}.van-col--9{width:900%/24}.van-col--offset-9{margin-left:900%/24}.van-col--10{width:1000%/24}.van-col--offset-10{margin-left:1000%/24}.van-col--11{width:1100%/24}.van-col--offset-11{margin-left:1100%/24}.van-col--12{width:1200%/24}.van-col--offset-12{margin-left:1200%/24}.van-col--13{width:1300%/24}.van-col--offset-13{margin-left:1300%/24}.van-col--14{width:1400%/24}.van-col--offset-14{margin-left:1400%/24}.van-col--15{width:1500%/24}.van-col--offset-15{margin-left:1500%/24}.van-col--16{width:1600%/24}.van-col--offset-16{margin-left:1600%/24}.van-col--17{width:1700%/24}.van-col--offset-17{margin-left:1700%/24}.van-col--18{width:1800%/24}.van-col--offset-18{margin-left:1800%/24}.van-col--19{width:1900%/24}.van-col--offset-19{margin-left:1900%/24}.van-col--20{width:2000%/24}.van-col--offset-20{margin-left:2000%/24}.van-col--21{width:2100%/24}.van-col--offset-21{margin-left:2100%/24}.van-col--22{width:2200%/24}.van-col--offset-22{margin-left:2200%/24}.van-col--23{width:2300%/24}.van-col--offset-23{margin-left:2300%/24}.van-col--24{width:2400%/24}.van-col--offset-24{margin-left:2400%/24}
|
11
lib/config-provider/index.js
Normal file
11
lib/config-provider/index.js
Normal file
@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
var component_1 = require('../common/component');
|
||||
component_1.VantComponent({
|
||||
props: {
|
||||
themeVars: {
|
||||
type: Object,
|
||||
value: {},
|
||||
},
|
||||
},
|
||||
});
|
3
lib/config-provider/index.json
Normal file
3
lib/config-provider/index.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"component": true
|
||||
}
|
5
lib/config-provider/index.wxml
Normal file
5
lib/config-provider/index.wxml
Normal file
@ -0,0 +1,5 @@
|
||||
<wxs src="./index.wxs" module="computed" />
|
||||
|
||||
<view class="van-config-provider" style="{{ computed.mapThemeVarsToCSSVars(themeVars) }}">
|
||||
<slot />
|
||||
</view>
|
29
lib/config-provider/index.wxs
Normal file
29
lib/config-provider/index.wxs
Normal file
@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
var object = require('../wxs/object.wxs');
|
||||
var style = require('../wxs/style.wxs');
|
||||
|
||||
function kebabCase(word) {
|
||||
var newWord = word
|
||||
.replace(getRegExp("[A-Z]", 'g'), function (i) {
|
||||
return '-' + i;
|
||||
})
|
||||
.toLowerCase()
|
||||
.replace(getRegExp("^-"), '');
|
||||
|
||||
return newWord;
|
||||
}
|
||||
|
||||
function mapThemeVarsToCSSVars(themeVars) {
|
||||
var cssVars = {};
|
||||
object.keys(themeVars).forEach(function (key) {
|
||||
var cssVarsKey = '--' + kebabCase(key);
|
||||
cssVars[cssVarsKey] = themeVars[key];
|
||||
});
|
||||
|
||||
return style(cssVars);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
kebabCase: kebabCase,
|
||||
mapThemeVarsToCSSVars: mapThemeVarsToCSSVars,
|
||||
};
|
@ -1 +1 @@
|
||||
@import '../common/index.wxss';:host{-webkit-flex:1;flex:1}.van-goods-action-button{--button-warning-background-color:linear-gradient(90deg,#ffd01e,#ff8917);--button-warning-background-color:var(--goods-action-button-warning-color,linear-gradient(90deg,#ffd01e,#ff8917));--button-danger-background-color:linear-gradient(90deg,#ff6034,#ee0a24);--button-danger-background-color:var(--goods-action-button-danger-color,linear-gradient(90deg,#ff6034,#ee0a24));--button-default-height:40px;--button-default-height:var(--goods-action-button-height,40px);--button-line-height:20px;--button-line-height:var(--goods-action-button-line-height,20px);--button-plain-background-color:#fff;--button-plain-background-color:var(--goods-action-button-plain-color,#fff);display:block;--button-border-width:0}.van-goods-action-button--first{margin-left:5px;--button-border-radius:20px 0 0 20px;--button-border-radius:var(--goods-action-button-border-radius,20px) 0 0 var(--goods-action-button-border-radius,20px)}.van-goods-action-button--last{margin-right:5px;--button-border-radius:0 20px 20px 0;--button-border-radius:0 var(--goods-action-button-border-radius,20px) var(--goods-action-button-border-radius,20px) 0}.van-goods-action-button--first.van-goods-action-button--last{--button-border-radius:20px;--button-border-radius:var(--goods-action-button-border-radius,20px)}.van-goods-action-button--plain{--button-border-width:1px}.van-goods-action-button__inner{width:100%;font-weight:500!important;font-weight:var(--font-weight-bold,500)!important}@media (max-width:321px){.van-goods-action-button{font-size:13px}}
|
||||
@import '../common/index.wxss';:host{-webkit-flex:1;flex:1}.van-goods-action-button{--button-warning-background-color:linear-gradient(90deg,#ffd01e,#ff8917);--button-warning-background-color:var(--goods-action-button-warning-color,linear-gradient(90deg,#ffd01e,#ff8917));--button-danger-background-color:linear-gradient(90deg,#ff6034,#ee0a24);--button-danger-background-color:var(--goods-action-button-danger-color,linear-gradient(90deg,#ff6034,#ee0a24));--button-default-height:40px;--button-default-height:var(--goods-action-button-height,40px);--button-line-height:20px;--button-line-height:var(--goods-action-button-line-height,20px);--button-plain-background-color:#fff;--button-plain-background-color:var(--goods-action-button-plain-color,#fff);display:block;--button-border-width:0}.van-goods-action-button--first{margin-left:5px;--button-border-radius:40px/2 0 0 40px/2;--button-border-radius:var(--goods-action-button-border-radius,40px/2) 0 0 var(--goods-action-button-border-radius,40px/2)}.van-goods-action-button--last{margin-right:5px;--button-border-radius:0 40px/2 40px/2 0;--button-border-radius:0 var(--goods-action-button-border-radius,40px/2) var(--goods-action-button-border-radius,40px/2) 0}.van-goods-action-button--first.van-goods-action-button--last{--button-border-radius:40px/2;--button-border-radius:var(--goods-action-button-border-radius,40px/2)}.van-goods-action-button--plain{--button-border-width:1px}.van-goods-action-button__inner{width:100%;font-weight:500!important;font-weight:var(--font-weight-bold,500)!important}@media (max-width:321px){.van-goods-action-button{font-size:13px}}
|
@ -10,6 +10,7 @@ component_1.VantComponent({
|
||||
props: {
|
||||
icon: String,
|
||||
iconColor: String,
|
||||
iconPrefix: String,
|
||||
dot: Boolean,
|
||||
info: null,
|
||||
badge: null,
|
||||
@ -37,6 +38,7 @@ component_1.VantComponent({
|
||||
clickable = data.clickable,
|
||||
center = data.center,
|
||||
direction = data.direction,
|
||||
reverse = data.reverse,
|
||||
iconSize = data.iconSize;
|
||||
this.setData({
|
||||
center: center,
|
||||
@ -45,6 +47,7 @@ component_1.VantComponent({
|
||||
gutter: gutter,
|
||||
clickable: clickable,
|
||||
direction: direction,
|
||||
reverse: reverse,
|
||||
iconSize: iconSize,
|
||||
index: children.indexOf(this),
|
||||
columnNum: columnNum,
|
||||
|
@ -7,7 +7,7 @@
|
||||
bindtap="onClick"
|
||||
>
|
||||
<view
|
||||
class="content-class {{ utils.bem('grid-item__content', [direction, { center, square, clickable, surround: border && gutter }]) }} {{ border ? 'van-hairline--surround' : '' }}"
|
||||
class="content-class {{ utils.bem('grid-item__content', [direction, { center, square, reverse, clickable, surround: border && gutter }]) }} {{ border ? 'van-hairline--surround' : '' }}"
|
||||
style="{{ computed.contentStyle({ square, gutter }) }}"
|
||||
>
|
||||
<block wx:if="{{ useSlot }}">
|
||||
@ -15,7 +15,7 @@
|
||||
</block>
|
||||
<block wx:else>
|
||||
<view class="van-grid-item__icon icon-class">
|
||||
<van-icon wx:if="{{ icon }}" name="{{ icon }}" color="{{ iconColor }}" dot="{{ dot }}" info="{{ badge || info }}" size="{{ iconSize }}" />
|
||||
<van-icon wx:if="{{ icon }}" name="{{ icon }}" color="{{ iconColor }}" class-prefix="{{ iconPrefix }}" dot="{{ dot }}" info="{{ badge || info }}" size="{{ iconSize }}" />
|
||||
<slot wx:else name="icon"></slot>
|
||||
</view>
|
||||
<view class="van-grid-item__text text-class">
|
||||
|
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-grid-item{position:relative;float:left;box-sizing:border-box}.van-grid-item--square{height:0}.van-grid-item__content{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;box-sizing:border-box;height:100%;padding:16px 8px;padding:var(--grid-item-content-padding,16px 8px);background-color:#fff;background-color:var(--grid-item-content-background-color,#fff)}.van-grid-item__content:after{z-index:1;border-width:0 1px 1px 0;border-bottom-width:var(--border-width-base,1px);border-right-width:var(--border-width-base,1px);border-top-width:0}.van-grid-item__content--surround:after{border-width:1px;border-width:var(--border-width-base,1px)}.van-grid-item__content--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-grid-item__content--square{position:absolute;top:0;right:0;left:0}.van-grid-item__content--horizontal{-webkit-flex-direction:row;flex-direction:row}.van-grid-item__content--horizontal .van-grid-item__icon+.van-grid-item__text{margin-top:0;margin-left:8px}.van-grid-item__content--clickable:active{background-color:#f2f3f5;background-color:var(--grid-item-content-active-color,#f2f3f5)}.van-grid-item__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;font-size:26px;font-size:var(--grid-item-icon-size,26px);height:26px;height:var(--grid-item-icon-size,26px)}.van-grid-item__text{word-wrap:break-word;color:#646566;color:var(--grid-item-text-color,#646566);font-size:12px;font-size:var(--grid-item-text-font-size,12px)}.van-grid-item__icon+.van-grid-item__text{margin-top:8px}
|
||||
@import '../common/index.wxss';.van-grid-item{position:relative;float:left;box-sizing:border-box}.van-grid-item--square{height:0}.van-grid-item__content{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;box-sizing:border-box;height:100%;padding:16px 8px;padding:var(--grid-item-content-padding,16px 8px);background-color:#fff;background-color:var(--grid-item-content-background-color,#fff)}.van-grid-item__content:after{z-index:1;border-width:0 1px 1px 0;border-bottom-width:var(--border-width-base,1px);border-right-width:var(--border-width-base,1px);border-top-width:0}.van-grid-item__content--surround:after{border-width:1px;border-width:var(--border-width-base,1px)}.van-grid-item__content--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-grid-item__content--square{position:absolute;top:0;right:0;left:0}.van-grid-item__content--horizontal{-webkit-flex-direction:row;flex-direction:row}.van-grid-item__content--horizontal .van-grid-item__text{margin:0 0 0 8px}.van-grid-item__content--reverse{-webkit-flex-direction:column-reverse;flex-direction:column-reverse}.van-grid-item__content--reverse .van-grid-item__text{margin:0 0 8px}.van-grid-item__content--horizontal.van-grid-item__content--reverse{-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.van-grid-item__content--horizontal.van-grid-item__content--reverse .van-grid-item__text{margin:0 8px 0 0}.van-grid-item__content--clickable:active{background-color:#f2f3f5;background-color:var(--grid-item-content-active-color,#f2f3f5)}.van-grid-item__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;font-size:26px;font-size:var(--grid-item-icon-size,26px);height:26px;height:var(--grid-item-icon-size,26px)}.van-grid-item__text{word-wrap:break-word;color:#646566;color:var(--grid-item-text-color,#646566);font-size:12px;font-size:var(--grid-item-text-font-size,12px)}.van-grid-item__icon+.van-grid-item__text{margin-top:8px}
|
@ -41,6 +41,11 @@ component_1.VantComponent({
|
||||
type: String,
|
||||
observer: 'updateChildren',
|
||||
},
|
||||
reverse: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
observer: 'updateChildren',
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
updateChildren: function () {
|
||||
|
@ -42,18 +42,9 @@ component_1.VantComponent({
|
||||
type: String,
|
||||
value: 'star-o',
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
value: '#ffd21e',
|
||||
},
|
||||
voidColor: {
|
||||
type: String,
|
||||
value: '#c7c7c7',
|
||||
},
|
||||
disabledColor: {
|
||||
type: String,
|
||||
value: '#bdbdbd',
|
||||
},
|
||||
color: String,
|
||||
voidColor: String,
|
||||
disabledColor: String,
|
||||
count: {
|
||||
type: Number,
|
||||
value: 5,
|
||||
|
@ -1,19 +1,20 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
<wxs src="../wxs/style.wxs" module="style" />
|
||||
|
||||
<view
|
||||
class="van-rate custom-class"
|
||||
class="{{ utils.bem('rate') }} custom-class"
|
||||
bind:touchmove="onTouchMove"
|
||||
>
|
||||
<view
|
||||
class="van-rate__item"
|
||||
class="{{ utils.bem('rate__item') }}"
|
||||
wx:for="{{ innerCountArray }}"
|
||||
wx:key="index"
|
||||
style="padding-right: {{ index !== count - 1 ? utils.addUnit(gutter) : '' }}"
|
||||
style="{{ style({ paddingRight: index !== count - 1 ? utils.addUnit(gutter) : null }) }}"
|
||||
>
|
||||
<van-icon
|
||||
name="{{ index + 1 <= innerValue ? icon : voidIcon }}"
|
||||
class="van-rate__icon"
|
||||
style="font-size: {{ utils.addUnit(size) }}"
|
||||
class="{{ utils.bem('rate__icon', [{ disabled, full: index + 1 <= innerValue }])}}"
|
||||
style="{{ style({ fontSize: utils.addUnit(size) }) }}"
|
||||
custom-class="icon-class"
|
||||
data-score="{{ index }}"
|
||||
color="{{ disabled ? disabledColor : index + 1 <= innerValue ? color : voidColor }}"
|
||||
@ -23,8 +24,8 @@
|
||||
<van-icon
|
||||
wx:if="{{ allowHalf }}"
|
||||
name="{{ index + 0.5 <= innerValue ? icon : voidIcon }}"
|
||||
class="{{ utils.bem('rate__icon', ['half']) }}"
|
||||
style="font-size: {{ utils.addUnit(size) }}"
|
||||
class="{{ utils.bem('rate__icon', ['half', { disabled, full: index + 0.5 <= innerValue }]) }}"
|
||||
style="{{ style({ fontSize: utils.addUnit(size) }) }}"
|
||||
custom-class="icon-class"
|
||||
data-score="{{ index - 0.5 }}"
|
||||
color="{{ disabled ? disabledColor : index + 0.5 <= innerValue ? color : voidColor }}"
|
||||
|
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-rate{display:-webkit-inline-flex;display:inline-flex;-webkit-user-select:none;user-select:none}.van-rate__item{position:relative;padding:0 2px;padding:0 var(--rate-horizontal-padding,2px)}.van-rate__icon{display:block;height:1em;font-size:20px;font-size:var(--rate-icon-size,20px)}.van-rate__icon--half{position:absolute;top:0;width:.5em;overflow:hidden;left:2px;left:var(--rate-horizontal-padding,2px)}
|
||||
@import '../common/index.wxss';.van-rate{display:-webkit-inline-flex;display:inline-flex;-webkit-user-select:none;user-select:none}.van-rate__item{position:relative;padding:0 2px;padding:0 var(--rate-horizontal-padding,2px)}.van-rate__item:not(:last-child){padding-right:4px;padding-right:var(--rate-icon-gutter,4px)}.van-rate__icon{display:block;height:1em;color:#c8c9cc;color:var(--rate-icon-void-color,#c8c9cc);font-size:20px;font-size:var(--rate-icon-size,20px)}.van-rate__icon--half{position:absolute;top:0;width:.5em;overflow:hidden;left:2px;left:var(--rate-horizontal-padding,2px)}.van-rate__icon--full,.van-rate__icon--half{color:#ee0a24;color:var(--rate-icon-full-color,#ee0a24)}.van-rate__icon--disabled{color:#c8c9cc;color:var(--rate-icon-disabled-color,#c8c9cc)}
|
@ -1,9 +1,9 @@
|
||||
/* eslint-disable */
|
||||
var PRESET_ICONS = ['qq', 'weibo', 'wechat', 'link', 'qrcode', 'poster'];
|
||||
var PRESET_ICONS = ['qq', 'link', 'weibo', 'wechat', 'poster', 'qrcode', 'weapp-qrcode', 'wechat-moments'];
|
||||
|
||||
function getIconURL(icon) {
|
||||
if (PRESET_ICONS.indexOf(icon) !== -1) {
|
||||
return 'https://img.yzcdn.cn/vant/share-icon-' + icon + '.png';
|
||||
return 'https://img.yzcdn.cn/vant/share-sheet-' + icon + '.png';
|
||||
}
|
||||
|
||||
return icon;
|
||||
|
@ -32,10 +32,7 @@ component_1.VantComponent({
|
||||
}
|
||||
},
|
||||
},
|
||||
barHeight: {
|
||||
type: null,
|
||||
value: 2,
|
||||
},
|
||||
barHeight: null,
|
||||
},
|
||||
created: function () {
|
||||
this.updateValue(this.data.value);
|
||||
|
@ -1,17 +1,17 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
<wxs src="./index.wxs" module="computed" />
|
||||
<wxs src="../wxs/style.wxs" module="style" />
|
||||
|
||||
<view
|
||||
class="custom-class {{ utils.bem('slider', { disabled }) }}"
|
||||
style="{{ inactiveColor ? 'background:' + inactiveColor : '' }}"
|
||||
style="{{ style({ background: inactiveColor, height: utils.addUnit(barHeight) }) }}"
|
||||
bind:tap="onClick"
|
||||
>
|
||||
<view
|
||||
class="van-slider__bar"
|
||||
style="{{ barStyle }};{{ computed.barStyle(barHeight, activeColor) }}"
|
||||
class="{{ utils.bem('slider__bar') }}"
|
||||
style="{{ barStyle }}; {{ style({ backgroundColor: activeColor }) }}"
|
||||
>
|
||||
<view
|
||||
class="van-slider__button-wrapper"
|
||||
class="{{ utils.bem('slider__button-wrapper') }}"
|
||||
bind:touchstart="onTouchStart"
|
||||
catch:touchmove="onTouchMove"
|
||||
bind:touchend="onTouchEnd"
|
||||
@ -23,7 +23,7 @@
|
||||
/>
|
||||
<view
|
||||
wx:else
|
||||
class="van-slider__button"
|
||||
class="{{ utils.bem('slider__button') }}"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-slider{position:relative;border-radius:999px;border-radius:var(--border-radius-max,999px);background-color:#ebedf0;background-color:var(--slider-inactive-background-color,#ebedf0)}.van-slider:before{position:absolute;right:0;left:0;content:"";top:-8px;top:-var(--padding-xs,8px);bottom:-8px;bottom:-var(--padding-xs,8px)}.van-slider__bar{position:relative;border-radius:inherit;transition:width .2s;transition:width var(--animation-duration-fast,.2s);background-color:#1989fa;background-color:var(--slider-active-background-color,#1989fa)}.van-slider__button{width:24px;height:24px;border-radius:50%;box-shadow:0 1px 2px rgba(0,0,0,.5);background-color:#fff;background-color:var(--slider-button-background-color,#fff)}.van-slider__button-wrapper{position:absolute;top:50%;right:0;-webkit-transform:translate3d(50%,-50%,0);transform:translate3d(50%,-50%,0)}.van-slider--disabled{opacity:.5}
|
||||
@import '../common/index.wxss';.van-slider{position:relative;height:2px;height:var(--slider-bar-height,2px);border-radius:999px;border-radius:var(--border-radius-max,999px);background-color:#ebedf0;background-color:var(--slider-inactive-background-color,#ebedf0)}.van-slider:before{position:absolute;right:0;left:0;content:"";top:-8px;top:-var(--padding-xs,8px);bottom:-8px;bottom:-var(--padding-xs,8px)}.van-slider__bar{position:relative;width:100%;height:100%;background-color:#1989fa;background-color:var(--slider-active-background-color,#1989fa);border-radius:inherit;transition:all .2s;transition:all var(--animation-duration-fast,.2s)}.van-slider__button{width:24px;width:var(--slider-button-width,24px);height:24px;height:var(--slider-button-height,24px);border-radius:50%;border-radius:var(--slider-button-border-radius,50%);box-shadow:0 1px 2px rgba(0,0,0,.5);box-shadow:var(--slider-button-box-shadow,0 1px 2px rgba(0,0,0,.5));background-color:#fff;background-color:var(--slider-button-background-color,#fff)}.van-slider__button-wrapper{position:absolute;top:50%;right:0;-webkit-transform:translate3d(50%,-50%,0);transform:translate3d(50%,-50%,0)}.van-slider--disabled{opacity:.5;opacity:var(--slider-disabled-opacity,.5)}
|
@ -2,6 +2,16 @@
|
||||
var object = require('./object.wxs');
|
||||
var array = require('./array.wxs');
|
||||
|
||||
function kebabCase(word) {
|
||||
var newWord = word
|
||||
.replace(getRegExp("[A-Z]", 'g'), function (i) {
|
||||
return '-' + i;
|
||||
})
|
||||
.toLowerCase()
|
||||
|
||||
return newWord;
|
||||
}
|
||||
|
||||
function style(styles) {
|
||||
if (array.isArray(styles)) {
|
||||
return styles
|
||||
@ -21,7 +31,7 @@ function style(styles) {
|
||||
return styles[key] != null && styles[key] !== '';
|
||||
})
|
||||
.map(function (key) {
|
||||
return [key, [styles[key]]].join(':');
|
||||
return [kebabCase(key), [styles[key]]].join(':');
|
||||
})
|
||||
.join(';');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user