mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-05 19:41:45 +08:00
build: compile 1.5.0
This commit is contained in:
parent
e5cb33d392
commit
b53c4497bd
5
dist/area/index.js
vendored
5
dist/area/index.js
vendored
@ -1,5 +1,6 @@
|
||||
import { VantComponent } from '../common/component';
|
||||
import { pickerProps } from '../picker/shared';
|
||||
import { requestAnimationFrame } from '../common/utils';
|
||||
const COLUMNSPLACEHOLDERCODE = '000000';
|
||||
VantComponent({
|
||||
classes: ['active-class', 'toolbar-class', 'column-class'],
|
||||
@ -44,9 +45,9 @@ VantComponent({
|
||||
typeToColumnsPlaceholder: {},
|
||||
},
|
||||
mounted() {
|
||||
setTimeout(() => {
|
||||
requestAnimationFrame(() => {
|
||||
this.setValues();
|
||||
}, 0);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getPicker() {
|
||||
|
5
dist/calendar/index.js
vendored
5
dist/calendar/index.js
vendored
@ -11,6 +11,7 @@ import {
|
||||
getDayByOffset,
|
||||
} from './utils';
|
||||
import Toast from '../toast/toast';
|
||||
import { requestAnimationFrame } from '../common/utils';
|
||||
VantComponent({
|
||||
props: {
|
||||
title: {
|
||||
@ -157,7 +158,7 @@ VantComponent({
|
||||
return defaultDate || minDate;
|
||||
},
|
||||
scrollIntoView() {
|
||||
setTimeout(() => {
|
||||
requestAnimationFrame(() => {
|
||||
const {
|
||||
currentDate,
|
||||
type,
|
||||
@ -179,7 +180,7 @@ VantComponent({
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}, 100);
|
||||
});
|
||||
},
|
||||
onOpen() {
|
||||
this.$emit('open');
|
||||
|
2
dist/cell/index.wxss
vendored
2
dist/cell/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-cell{position:relative;display:-webkit-flex;display:flex;box-sizing:border-box;width:100%;padding:10px 16px;padding:var(--cell-vertical-padding,10px) var(--cell-horizontal-padding,16px);font-size:14px;font-size:var(--cell-font-size,14px);line-height:24px;line-height:var(--cell-line-height,24px);color:#323233;color:var(--cell-text-color,#323233);background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:auto;right:16px;bottom:0;left:16px;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-cell--borderless:after{display:none}.van-cell-group{background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell__label{margin-top:3px;margin-top:var(--cell-label-margin-top,3px);font-size:12px;font-size:var(--cell-label-font-size,12px);line-height:18px;line-height:var(--cell-label-line-height,18px);color:#969799;color:var(--cell-label-color,#969799)}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle;color:#969799;color:var(--cell-value-color,#969799)}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px;height:var(--cell-line-height,24px);font-size:16px;font-size:var(--cell-icon-size,16px)}.van-cell__left-icon-wrap{margin-right:5px}.van-cell__right-icon-wrap{margin-left:5px;color:#969799;color:var(--cell-right-icon-color,#969799)}.van-cell__left-icon{vertical-align:middle}.van-cell__left-icon,.van-cell__right-icon{line-height:24px;line-height:var(--cell-line-height,24px)}.van-cell--clickable.van-cell--hover{background-color:#f2f3f5;background-color:var(--cell-active-color,#f2f3f5)}.van-cell--required{overflow:visible}.van-cell--required:before{position:absolute;content:"*";left:8px;left:var(--padding-xs,8px);font-size:14px;font-size:var(--cell-font-size,14px);color:#ee0a24;color:var(--cell-required-color,#ee0a24)}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-top:var(--cell-large-vertical-padding,12px);padding-bottom:12px;padding-bottom:var(--cell-large-vertical-padding,12px)}.van-cell--large .van-cell__title{font-size:16px;font-size:var(--cell-large-title-font-size,16px)}.van-cell--large .van-cell__value{font-size:16px;font-size:var(--cell-large-value-font-size,16px)}.van-cell--large .van-cell__label{font-size:14px;font-size:var(--cell-large-label-font-size,14px)}
|
||||
@import '../common/index.wxss';.van-cell{position:relative;display:-webkit-flex;display:flex;box-sizing:border-box;width:100%;padding:10px 16px;padding:var(--cell-vertical-padding,10px) var(--cell-horizontal-padding,16px);font-size:14px;font-size:var(--cell-font-size,14px);line-height:24px;line-height:var(--cell-line-height,24px);color:#323233;color:var(--cell-text-color,#323233);background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:16px;bottom:0;left:16px;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-cell--borderless:after{display:none}.van-cell-group{background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell__label{margin-top:3px;margin-top:var(--cell-label-margin-top,3px);font-size:12px;font-size:var(--cell-label-font-size,12px);line-height:18px;line-height:var(--cell-label-line-height,18px);color:#969799;color:var(--cell-label-color,#969799)}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle;color:#969799;color:var(--cell-value-color,#969799)}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px;height:var(--cell-line-height,24px);font-size:16px;font-size:var(--cell-icon-size,16px)}.van-cell__left-icon-wrap{margin-right:5px}.van-cell__right-icon-wrap{margin-left:5px;color:#969799;color:var(--cell-right-icon-color,#969799)}.van-cell__left-icon{vertical-align:middle}.van-cell__left-icon,.van-cell__right-icon{line-height:24px;line-height:var(--cell-line-height,24px)}.van-cell--clickable.van-cell--hover{background-color:#f2f3f5;background-color:var(--cell-active-color,#f2f3f5)}.van-cell--required{overflow:visible}.van-cell--required:before{position:absolute;content:"*";left:8px;left:var(--padding-xs,8px);font-size:14px;font-size:var(--cell-font-size,14px);color:#ee0a24;color:var(--cell-required-color,#ee0a24)}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-top:var(--cell-large-vertical-padding,12px);padding-bottom:12px;padding-bottom:var(--cell-large-vertical-padding,12px)}.van-cell--large .van-cell__title{font-size:16px;font-size:var(--cell-large-title-font-size,16px)}.van-cell--large .van-cell__value{font-size:16px;font-size:var(--cell-large-value-font-size,16px)}.van-cell--large .van-cell__label{font-size:14px;font-size:var(--cell-large-label-font-size,14px)}
|
20
dist/collapse-item/index.js
vendored
20
dist/collapse-item/index.js
vendored
@ -61,14 +61,18 @@ VantComponent({
|
||||
.then((height) => {
|
||||
const { animation } = this;
|
||||
if (expanded) {
|
||||
animation
|
||||
.height(height)
|
||||
.top(1)
|
||||
.step({
|
||||
duration: inited ? 300 : 1,
|
||||
})
|
||||
.height('auto')
|
||||
.step();
|
||||
if (height === 0) {
|
||||
animation.height('auto').top(1).step();
|
||||
} else {
|
||||
animation
|
||||
.height(height)
|
||||
.top(1)
|
||||
.step({
|
||||
duration: inited ? 300 : 1,
|
||||
})
|
||||
.height('auto')
|
||||
.step();
|
||||
}
|
||||
this.setData({
|
||||
animation: animation.export(),
|
||||
});
|
||||
|
2
dist/common/index.wxss
vendored
2
dist/common/index.wxss
vendored
@ -1 +1 @@
|
||||
.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #eee;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
|
||||
.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
|
2
dist/common/style/hairline.wxss
vendored
2
dist/common/style/hairline.wxss
vendored
@ -1 +1 @@
|
||||
.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #eee;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
|
||||
.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
|
20
dist/empty/index.wxml
vendored
20
dist/empty/index.wxml
vendored
@ -1,15 +1,21 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
|
||||
<view class=" custom-class van-empty">
|
||||
<view class="custom-class van-empty">
|
||||
<view class="van-empty__image">
|
||||
<image wx:if="{{ imageUrl }}"
|
||||
class="van-empty__image__img"
|
||||
src="{{ imageUrl }}" />
|
||||
<slot name="image"></slot>
|
||||
</view>
|
||||
<p class="van-empty__description">
|
||||
<view class="van-empty__image">
|
||||
<image wx:if="{{ imageUrl }}" class="van-empty__image__img" src="{{ imageUrl }}" />
|
||||
</view>
|
||||
|
||||
<view class="van-empty__description">
|
||||
<slot name="description"></slot>
|
||||
</view>
|
||||
<view class="van-empty__description">
|
||||
{{ description }}
|
||||
</p>
|
||||
</view>
|
||||
|
||||
<view class="van-empty__bottom">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
2
dist/empty/index.wxss
vendored
2
dist/empty/index.wxss
vendored
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-empty{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:32px 0}.van-empty__image{width:160px;height:160px}.van-empty__image__img{width:100%;height:100%}.van-empty__description{margin-top:16px;padding:0 60px;color:#969799;font-size:14px;line-height:20px}.van-empty__bottom{margin-top:24px}
|
||||
@import '../common/index.wxss';.van-empty{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:32px 0}.van-empty__image{width:160px;height:160px}.van-empty__image:empty{display:none}.van-empty__image__img{width:100%;height:100%}.van-empty__image:not(:empty)+.van-empty__image{display:none}.van-empty__description{margin-top:16px;padding:0 60px;color:#969799;font-size:14px;line-height:20px}.van-empty__description:empty,.van-empty__description:not(:empty)+.van-empty__description{display:none}.van-empty__bottom{margin-top:24px}
|
2
dist/icon/index.wxss
vendored
2
dist/icon/index.wxss
vendored
File diff suppressed because one or more lines are too long
5
dist/notice-bar/index.js
vendored
5
dist/notice-bar/index.js
vendored
@ -1,4 +1,5 @@
|
||||
import { VantComponent } from '../common/component';
|
||||
import { requestAnimationFrame } from '../common/utils';
|
||||
VantComponent({
|
||||
props: {
|
||||
text: {
|
||||
@ -99,14 +100,14 @@ VantComponent({
|
||||
.step()
|
||||
.export(),
|
||||
});
|
||||
setTimeout(() => {
|
||||
requestAnimationFrame(() => {
|
||||
this.setData({
|
||||
animationData: this.animation
|
||||
.translateX(-this.contentWidth)
|
||||
.step()
|
||||
.export(),
|
||||
});
|
||||
}, 20);
|
||||
});
|
||||
this.timer = setTimeout(() => {
|
||||
this.scroll();
|
||||
}, this.duration);
|
||||
|
1
dist/share-sheet/index.d.ts
vendored
Normal file
1
dist/share-sheet/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
52
dist/share-sheet/index.js
vendored
Normal file
52
dist/share-sheet/index.js
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
import { VantComponent } from '../common/component';
|
||||
VantComponent({
|
||||
props: {
|
||||
// whether to show popup
|
||||
show: Boolean,
|
||||
// overlay custom style
|
||||
overlayStyle: Object,
|
||||
// z-index
|
||||
zIndex: [Number, String],
|
||||
title: String,
|
||||
cancelText: {
|
||||
type: String,
|
||||
value: '取消',
|
||||
},
|
||||
description: String,
|
||||
options: {
|
||||
type: Array,
|
||||
value: [],
|
||||
},
|
||||
overlay: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
safeAreaInsetBottom: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
closeOnClickOverlay: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
duration: {
|
||||
type: null,
|
||||
value: 300,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onClickOverlay() {
|
||||
this.$emit('click-overlay');
|
||||
},
|
||||
onCancel() {
|
||||
this.onClose();
|
||||
this.$emit('cancel');
|
||||
},
|
||||
onSelect(event) {
|
||||
this.$emit('select', event.detail);
|
||||
},
|
||||
onClose() {
|
||||
this.$emit('close');
|
||||
},
|
||||
},
|
||||
});
|
7
dist/share-sheet/index.json
vendored
Normal file
7
dist/share-sheet/index.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-popup": "../popup/index",
|
||||
"options": "./options"
|
||||
}
|
||||
}
|
46
dist/share-sheet/index.wxml
vendored
Normal file
46
dist/share-sheet/index.wxml
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
<wxs src="./index.wxs" module="computed" />
|
||||
|
||||
<van-popup
|
||||
round
|
||||
class="van-share-sheet"
|
||||
show="{{ show }}"
|
||||
position="bottom"
|
||||
overlay="{{ overlay }}"
|
||||
duration="{{ duration }}"
|
||||
z-index="{{ zIndex }}"
|
||||
overlay-style="{{ overlayStyle }}"
|
||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||
safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
|
||||
bind:close="onClose"
|
||||
bind:click-overlay="onClickOverlay"
|
||||
>
|
||||
<view class="van-share-sheet__header">
|
||||
<view class="van-share-sheet__title">
|
||||
<slot name="title" />
|
||||
</view>
|
||||
<view wx:if="{{ title }}" class="van-share-sheet__title">{{ title }}</view>
|
||||
|
||||
<view class="van-share-sheet__description">
|
||||
<slot name="description" />
|
||||
</view>
|
||||
<view wx:if="{{ description }}" class="van-share-sheet__description">
|
||||
{{ description }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<block wx:if="{{ computed.isMulti(options) }}">
|
||||
<options
|
||||
wx:for="{{ options }}"
|
||||
show-border="{{ index !== 0 }}"
|
||||
wx:key="index"
|
||||
options="{{ item }}"
|
||||
bind:select="onSelect"
|
||||
/>
|
||||
</block>
|
||||
|
||||
<options wx:else options="{{ options }}" bind:select="onSelect" />
|
||||
|
||||
<button type="button" class="van-share-sheet__cancel" bindtap="onCancel">
|
||||
{{ cancelText }}
|
||||
</button>
|
||||
</van-popup>
|
12
dist/share-sheet/index.wxs
vendored
Normal file
12
dist/share-sheet/index.wxs
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
/* eslint-disable */
|
||||
function isMulti(options) {
|
||||
if (options == null || options[0] == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return "Array" === options.constructor && "Array" === options[0].constructor;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
isMulti: isMulti
|
||||
};
|
1
dist/share-sheet/index.wxss
vendored
Normal file
1
dist/share-sheet/index.wxss
vendored
Normal file
@ -0,0 +1 @@
|
||||
@import '../common/index.wxss';.van-share-sheet__header{padding:12px 16px 4px;text-align:center}.van-share-sheet__title{margin-top:8px;color:#323233;font-weight:400;font-size:14px;line-height:20px}.van-share-sheet__title:empty,.van-share-sheet__title:not(:empty)+.van-share-sheet__title{display:none}.van-share-sheet__description{display:block;margin-top:8px;color:#969799;font-size:12px;line-height:16px}.van-share-sheet__description:empty,.van-share-sheet__description:not(:empty)+.van-share-sheet__description{display:none}.van-share-sheet__cancel{display:block;box-sizing:initial;width:100%;height:auto;padding:0;font-size:16px;line-height:48px;text-align:center;background:#fff;border:none}.van-share-sheet__cancel:before{display:block;height:8px;background-color:#f7f8fa;content:" "}.van-share-sheet__cancel:after{display:none}.van-share-sheet__cancel:active{background-color:#f2f3f5}
|
1
dist/share-sheet/options.d.ts
vendored
Normal file
1
dist/share-sheet/options.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
14
dist/share-sheet/options.js
vendored
Normal file
14
dist/share-sheet/options.js
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
import { VantComponent } from '../common/component';
|
||||
VantComponent({
|
||||
props: {
|
||||
options: Array,
|
||||
showBorder: Boolean,
|
||||
},
|
||||
methods: {
|
||||
onSelect(event) {
|
||||
const { index } = event.currentTarget.dataset;
|
||||
const option = this.data.options[index];
|
||||
this.$emit('select', Object.assign(Object.assign({}, option), { index }));
|
||||
},
|
||||
},
|
||||
});
|
3
dist/share-sheet/options.json
vendored
Normal file
3
dist/share-sheet/options.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"component": true
|
||||
}
|
18
dist/share-sheet/options.wxml
vendored
Normal file
18
dist/share-sheet/options.wxml
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
<wxs src="./options.wxs" module="computed" />
|
||||
|
||||
<view class="{{ utils.bem('share-sheet__options', { border: showBorder }) }}">
|
||||
<view
|
||||
wx:for="{{ options }}"
|
||||
wx:key="index"
|
||||
class="van-share-sheet__option"
|
||||
data-index="{{ index }}"
|
||||
bindtap="onSelect"
|
||||
>
|
||||
<image src="{{ computed.getIconURL(item.icon) }}" class="van-share-sheet__icon" />
|
||||
<view wx:if="{{ item.name }}" class="van-share-sheet__name">{{ item.name }}</view>
|
||||
<view wx:if="{{ item.description }}" class="van-share-sheet__option-description">
|
||||
{{ item.description }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
14
dist/share-sheet/options.wxs
vendored
Normal file
14
dist/share-sheet/options.wxs
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
/* eslint-disable */
|
||||
var PRESET_ICONS = ['qq', 'weibo', 'wechat', 'link', 'qrcode', 'poster'];
|
||||
|
||||
function getIconURL(icon) {
|
||||
if (PRESET_ICONS.indexOf(icon) !== -1) {
|
||||
return 'https://img.yzcdn.cn/vant/share-icon-' + icon + '.png';
|
||||
}
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getIconURL: getIconURL,
|
||||
};
|
1
dist/share-sheet/options.wxss
vendored
Normal file
1
dist/share-sheet/options.wxss
vendored
Normal file
@ -0,0 +1 @@
|
||||
@import '../common/index.wxss';.van-share-sheet__options{position:relative;display:-webkit-flex;display:flex;padding:16px 0 16px 8px;overflow-x:auto;overflow-y:visible;-webkit-overflow-scrolling:touch}.van-share-sheet__options--border:before{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;top:0;right:0;left:16px;border-top:1px solid #ebedf0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-share-sheet__options::-webkit-scrollbar{height:0}.van-share-sheet__option{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-user-select:none;user-select:none}.van-share-sheet__option:active{opacity:.7}.van-share-sheet__icon{width:48px;height:48px;margin:0 16px}.van-share-sheet__name{margin-top:8px;padding:0 4px;color:#646566;font-size:12px}.van-share-sheet__option-description{padding:0 4px;color:#c8c9cc;font-size:12px}
|
1
dist/sidebar-item/index.js
vendored
1
dist/sidebar-item/index.js
vendored
@ -8,6 +8,7 @@ VantComponent({
|
||||
},
|
||||
props: {
|
||||
dot: Boolean,
|
||||
badge: null,
|
||||
info: null,
|
||||
title: String,
|
||||
disabled: Boolean,
|
||||
|
5
dist/sidebar-item/index.wxml
vendored
5
dist/sidebar-item/index.wxml
vendored
@ -8,10 +8,9 @@
|
||||
>
|
||||
<view class="van-sidebar-item__text">
|
||||
<van-info
|
||||
wx:if="{{ info !== null || dot }}"
|
||||
wx:if="{{ badge != null || info !== null || dot }}"
|
||||
dot="{{ dot }}"
|
||||
info="{{ info }}"
|
||||
custom-style="right: 4px"
|
||||
info="{{ badge != null ? badge : info }}"
|
||||
/>
|
||||
<view wx:if="{{ title }}">{{ title }}</view>
|
||||
<slot wx:else name="title" />
|
||||
|
2
dist/submit-bar/index.js
vendored
2
dist/submit-bar/index.js
vendored
@ -44,7 +44,7 @@ VantComponent({
|
||||
this.setData({
|
||||
hasPrice: typeof price === 'number',
|
||||
integerStr: priceStrArr && priceStrArr[0],
|
||||
decimalStr: decimalLength && priceStrArr ? `.${priceStrArr[1] || 0}` : '',
|
||||
decimalStr: decimalLength && priceStrArr ? `.${priceStrArr[1]}` : '',
|
||||
});
|
||||
},
|
||||
updateTip() {
|
||||
|
20
dist/tabs/index.js
vendored
20
dist/tabs/index.js
vendored
@ -21,11 +21,15 @@ VantComponent({
|
||||
},
|
||||
},
|
||||
props: {
|
||||
sticky: Boolean,
|
||||
border: Boolean,
|
||||
swipeable: Boolean,
|
||||
titleActiveColor: String,
|
||||
titleInactiveColor: String,
|
||||
color: {
|
||||
type: String,
|
||||
observer: 'setLine',
|
||||
},
|
||||
sticky: Boolean,
|
||||
animated: {
|
||||
type: Boolean,
|
||||
observer() {
|
||||
@ -34,10 +38,9 @@ VantComponent({
|
||||
);
|
||||
},
|
||||
},
|
||||
swipeable: Boolean,
|
||||
lineWidth: {
|
||||
type: [String, Number],
|
||||
value: -1,
|
||||
value: 40,
|
||||
observer: 'setLine',
|
||||
},
|
||||
lineHeight: {
|
||||
@ -45,8 +48,6 @@ VantComponent({
|
||||
value: -1,
|
||||
observer: 'setLine',
|
||||
},
|
||||
titleActiveColor: String,
|
||||
titleInactiveColor: String,
|
||||
active: {
|
||||
type: [String, Number],
|
||||
value: 0,
|
||||
@ -60,10 +61,6 @@ VantComponent({
|
||||
type: String,
|
||||
value: 'line',
|
||||
},
|
||||
border: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
ellipsis: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
@ -210,7 +207,6 @@ VantComponent({
|
||||
if (rect == null) {
|
||||
return;
|
||||
}
|
||||
const width = lineWidth !== -1 ? lineWidth : rect.width / 2;
|
||||
const height =
|
||||
lineHeight !== -1
|
||||
? `height: ${addUnit(lineHeight)}; border-radius: ${addUnit(
|
||||
@ -220,14 +216,14 @@ VantComponent({
|
||||
let left = rects
|
||||
.slice(0, currentIndex)
|
||||
.reduce((prev, curr) => prev + curr.width, 0);
|
||||
left += (rect.width - width) / 2;
|
||||
left += (rect.width - lineWidth) / 2;
|
||||
const transition = skipTransition
|
||||
? ''
|
||||
: `transition-duration: ${duration}s; -webkit-transition-duration: ${duration}s;`;
|
||||
this.setData({
|
||||
lineStyle: `
|
||||
${height}
|
||||
width: ${addUnit(width)};
|
||||
width: ${addUnit(lineWidth)};
|
||||
background-color: ${color};
|
||||
-webkit-transform: translateX(${left}px);
|
||||
transform: translateX(${left}px);
|
||||
|
4
dist/tree-select/index.js
vendored
4
dist/tree-select/index.js
vendored
@ -27,6 +27,10 @@ VantComponent({
|
||||
type: Number,
|
||||
value: Infinity,
|
||||
},
|
||||
selectedIcon: {
|
||||
type: String,
|
||||
value: 'success',
|
||||
},
|
||||
},
|
||||
data: {
|
||||
subItems: [],
|
||||
|
4
dist/tree-select/index.wxml
vendored
4
dist/tree-select/index.wxml
vendored
@ -13,6 +13,8 @@
|
||||
custom-class="main-item-class"
|
||||
active-class="main-active-class"
|
||||
disabled-class="main-disabled-class"
|
||||
badge="{{ item.badge }}"
|
||||
dot="{{ item.dot }}"
|
||||
title="{{ item.text }}"
|
||||
disabled="{{ item.disabled }}"
|
||||
/>
|
||||
@ -30,7 +32,7 @@
|
||||
{{ item.text }}
|
||||
<van-icon
|
||||
wx:if="{{ wxs.isActive(activeId, item.id) }}"
|
||||
name="checked"
|
||||
name="{{ selectedIcon }}"
|
||||
size="16px"
|
||||
class="van-tree-select__selected"
|
||||
/>
|
||||
|
@ -17,6 +17,7 @@ var __assign =
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
var component_1 = require('../common/component');
|
||||
var shared_1 = require('../picker/shared');
|
||||
var utils_1 = require('../common/utils');
|
||||
var COLUMNSPLACEHOLDERCODE = '000000';
|
||||
component_1.VantComponent({
|
||||
classes: ['active-class', 'toolbar-class', 'column-class'],
|
||||
@ -62,9 +63,9 @@ component_1.VantComponent({
|
||||
},
|
||||
mounted: function () {
|
||||
var _this = this;
|
||||
setTimeout(function () {
|
||||
utils_1.requestAnimationFrame(function () {
|
||||
_this.setValues();
|
||||
}, 0);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getPicker: function () {
|
||||
|
@ -18,6 +18,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
||||
var component_1 = require('../common/component');
|
||||
var utils_1 = require('./utils');
|
||||
var toast_1 = __importDefault(require('../toast/toast'));
|
||||
var utils_2 = require('../common/utils');
|
||||
component_1.VantComponent({
|
||||
props: {
|
||||
title: {
|
||||
@ -173,7 +174,7 @@ component_1.VantComponent({
|
||||
},
|
||||
scrollIntoView: function () {
|
||||
var _this = this;
|
||||
setTimeout(function () {
|
||||
utils_2.requestAnimationFrame(function () {
|
||||
var _a = _this.data,
|
||||
currentDate = _a.currentDate,
|
||||
type = _a.type,
|
||||
@ -194,7 +195,7 @@ component_1.VantComponent({
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}, 100);
|
||||
});
|
||||
},
|
||||
onOpen: function () {
|
||||
this.$emit('open');
|
||||
|
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-cell{position:relative;display:-webkit-flex;display:flex;box-sizing:border-box;width:100%;padding:10px 16px;padding:var(--cell-vertical-padding,10px) var(--cell-horizontal-padding,16px);font-size:14px;font-size:var(--cell-font-size,14px);line-height:24px;line-height:var(--cell-line-height,24px);color:#323233;color:var(--cell-text-color,#323233);background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:auto;right:16px;bottom:0;left:16px;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-cell--borderless:after{display:none}.van-cell-group{background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell__label{margin-top:3px;margin-top:var(--cell-label-margin-top,3px);font-size:12px;font-size:var(--cell-label-font-size,12px);line-height:18px;line-height:var(--cell-label-line-height,18px);color:#969799;color:var(--cell-label-color,#969799)}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle;color:#969799;color:var(--cell-value-color,#969799)}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px;height:var(--cell-line-height,24px);font-size:16px;font-size:var(--cell-icon-size,16px)}.van-cell__left-icon-wrap{margin-right:5px}.van-cell__right-icon-wrap{margin-left:5px;color:#969799;color:var(--cell-right-icon-color,#969799)}.van-cell__left-icon{vertical-align:middle}.van-cell__left-icon,.van-cell__right-icon{line-height:24px;line-height:var(--cell-line-height,24px)}.van-cell--clickable.van-cell--hover{background-color:#f2f3f5;background-color:var(--cell-active-color,#f2f3f5)}.van-cell--required{overflow:visible}.van-cell--required:before{position:absolute;content:"*";left:8px;left:var(--padding-xs,8px);font-size:14px;font-size:var(--cell-font-size,14px);color:#ee0a24;color:var(--cell-required-color,#ee0a24)}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-top:var(--cell-large-vertical-padding,12px);padding-bottom:12px;padding-bottom:var(--cell-large-vertical-padding,12px)}.van-cell--large .van-cell__title{font-size:16px;font-size:var(--cell-large-title-font-size,16px)}.van-cell--large .van-cell__value{font-size:16px;font-size:var(--cell-large-value-font-size,16px)}.van-cell--large .van-cell__label{font-size:14px;font-size:var(--cell-large-label-font-size,14px)}
|
||||
@import '../common/index.wxss';.van-cell{position:relative;display:-webkit-flex;display:flex;box-sizing:border-box;width:100%;padding:10px 16px;padding:var(--cell-vertical-padding,10px) var(--cell-horizontal-padding,16px);font-size:14px;font-size:var(--cell-font-size,14px);line-height:24px;line-height:var(--cell-line-height,24px);color:#323233;color:var(--cell-text-color,#323233);background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;right:16px;bottom:0;left:16px;border-bottom:1px solid #ebedf0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-cell--borderless:after{display:none}.van-cell-group{background-color:#fff;background-color:var(--cell-background-color,#fff)}.van-cell__label{margin-top:3px;margin-top:var(--cell-label-margin-top,3px);font-size:12px;font-size:var(--cell-label-font-size,12px);line-height:18px;line-height:var(--cell-label-line-height,18px);color:#969799;color:var(--cell-label-color,#969799)}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle;color:#969799;color:var(--cell-value-color,#969799)}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px;height:var(--cell-line-height,24px);font-size:16px;font-size:var(--cell-icon-size,16px)}.van-cell__left-icon-wrap{margin-right:5px}.van-cell__right-icon-wrap{margin-left:5px;color:#969799;color:var(--cell-right-icon-color,#969799)}.van-cell__left-icon{vertical-align:middle}.van-cell__left-icon,.van-cell__right-icon{line-height:24px;line-height:var(--cell-line-height,24px)}.van-cell--clickable.van-cell--hover{background-color:#f2f3f5;background-color:var(--cell-active-color,#f2f3f5)}.van-cell--required{overflow:visible}.van-cell--required:before{position:absolute;content:"*";left:8px;left:var(--padding-xs,8px);font-size:14px;font-size:var(--cell-font-size,14px);color:#ee0a24;color:var(--cell-required-color,#ee0a24)}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-top:var(--cell-large-vertical-padding,12px);padding-bottom:12px;padding-bottom:var(--cell-large-vertical-padding,12px)}.van-cell--large .van-cell__title{font-size:16px;font-size:var(--cell-large-title-font-size,16px)}.van-cell--large .van-cell__value{font-size:16px;font-size:var(--cell-large-value-font-size,16px)}.van-cell--large .van-cell__label{font-size:14px;font-size:var(--cell-large-label-font-size,14px)}
|
@ -71,14 +71,18 @@ component_1.VantComponent({
|
||||
.then(function (height) {
|
||||
var animation = _this.animation;
|
||||
if (expanded) {
|
||||
animation
|
||||
.height(height)
|
||||
.top(1)
|
||||
.step({
|
||||
duration: inited ? 300 : 1,
|
||||
})
|
||||
.height('auto')
|
||||
.step();
|
||||
if (height === 0) {
|
||||
animation.height('auto').top(1).step();
|
||||
} else {
|
||||
animation
|
||||
.height(height)
|
||||
.top(1)
|
||||
.step({
|
||||
duration: inited ? 300 : 1,
|
||||
})
|
||||
.height('auto')
|
||||
.step();
|
||||
}
|
||||
_this.setData({
|
||||
animation: animation.export(),
|
||||
});
|
||||
|
@ -1 +1 @@
|
||||
.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #eee;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
|
||||
.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
|
@ -1 +1 @@
|
||||
.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #eee;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
|
||||
.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
|
@ -1,15 +1,21 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
|
||||
<view class=" custom-class van-empty">
|
||||
<view class="custom-class van-empty">
|
||||
<view class="van-empty__image">
|
||||
<image wx:if="{{ imageUrl }}"
|
||||
class="van-empty__image__img"
|
||||
src="{{ imageUrl }}" />
|
||||
<slot name="image"></slot>
|
||||
</view>
|
||||
<p class="van-empty__description">
|
||||
<view class="van-empty__image">
|
||||
<image wx:if="{{ imageUrl }}" class="van-empty__image__img" src="{{ imageUrl }}" />
|
||||
</view>
|
||||
|
||||
<view class="van-empty__description">
|
||||
<slot name="description"></slot>
|
||||
</view>
|
||||
<view class="van-empty__description">
|
||||
{{ description }}
|
||||
</p>
|
||||
</view>
|
||||
|
||||
<view class="van-empty__bottom">
|
||||
<slot></slot>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -1 +1 @@
|
||||
@import '../common/index.wxss';.van-empty{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:32px 0}.van-empty__image{width:160px;height:160px}.van-empty__image__img{width:100%;height:100%}.van-empty__description{margin-top:16px;padding:0 60px;color:#969799;font-size:14px;line-height:20px}.van-empty__bottom{margin-top:24px}
|
||||
@import '../common/index.wxss';.van-empty{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:32px 0}.van-empty__image{width:160px;height:160px}.van-empty__image:empty{display:none}.van-empty__image__img{width:100%;height:100%}.van-empty__image:not(:empty)+.van-empty__image{display:none}.van-empty__description{margin-top:16px;padding:0 60px;color:#969799;font-size:14px;line-height:20px}.van-empty__description:empty,.van-empty__description:not(:empty)+.van-empty__description{display:none}.van-empty__bottom{margin-top:24px}
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
var component_1 = require('../common/component');
|
||||
var utils_1 = require('../common/utils');
|
||||
component_1.VantComponent({
|
||||
props: {
|
||||
text: {
|
||||
@ -109,14 +110,14 @@ component_1.VantComponent({
|
||||
.step()
|
||||
.export(),
|
||||
});
|
||||
setTimeout(function () {
|
||||
utils_1.requestAnimationFrame(function () {
|
||||
_this.setData({
|
||||
animationData: _this.animation
|
||||
.translateX(-_this.contentWidth)
|
||||
.step()
|
||||
.export(),
|
||||
});
|
||||
}, 20);
|
||||
});
|
||||
this.timer = setTimeout(function () {
|
||||
_this.scroll();
|
||||
}, this.duration);
|
||||
|
54
lib/share-sheet/index.js
Normal file
54
lib/share-sheet/index.js
Normal file
@ -0,0 +1,54 @@
|
||||
'use strict';
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
var component_1 = require('../common/component');
|
||||
component_1.VantComponent({
|
||||
props: {
|
||||
// whether to show popup
|
||||
show: Boolean,
|
||||
// overlay custom style
|
||||
overlayStyle: Object,
|
||||
// z-index
|
||||
zIndex: [Number, String],
|
||||
title: String,
|
||||
cancelText: {
|
||||
type: String,
|
||||
value: '取消',
|
||||
},
|
||||
description: String,
|
||||
options: {
|
||||
type: Array,
|
||||
value: [],
|
||||
},
|
||||
overlay: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
safeAreaInsetBottom: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
closeOnClickOverlay: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
duration: {
|
||||
type: null,
|
||||
value: 300,
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onClickOverlay: function () {
|
||||
this.$emit('click-overlay');
|
||||
},
|
||||
onCancel: function () {
|
||||
this.onClose();
|
||||
this.$emit('cancel');
|
||||
},
|
||||
onSelect: function (event) {
|
||||
this.$emit('select', event.detail);
|
||||
},
|
||||
onClose: function () {
|
||||
this.$emit('close');
|
||||
},
|
||||
},
|
||||
});
|
7
lib/share-sheet/index.json
Normal file
7
lib/share-sheet/index.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-popup": "../popup/index",
|
||||
"options": "./options"
|
||||
}
|
||||
}
|
46
lib/share-sheet/index.wxml
Normal file
46
lib/share-sheet/index.wxml
Normal file
@ -0,0 +1,46 @@
|
||||
<wxs src="./index.wxs" module="computed" />
|
||||
|
||||
<van-popup
|
||||
round
|
||||
class="van-share-sheet"
|
||||
show="{{ show }}"
|
||||
position="bottom"
|
||||
overlay="{{ overlay }}"
|
||||
duration="{{ duration }}"
|
||||
z-index="{{ zIndex }}"
|
||||
overlay-style="{{ overlayStyle }}"
|
||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||
safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
|
||||
bind:close="onClose"
|
||||
bind:click-overlay="onClickOverlay"
|
||||
>
|
||||
<view class="van-share-sheet__header">
|
||||
<view class="van-share-sheet__title">
|
||||
<slot name="title" />
|
||||
</view>
|
||||
<view wx:if="{{ title }}" class="van-share-sheet__title">{{ title }}</view>
|
||||
|
||||
<view class="van-share-sheet__description">
|
||||
<slot name="description" />
|
||||
</view>
|
||||
<view wx:if="{{ description }}" class="van-share-sheet__description">
|
||||
{{ description }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<block wx:if="{{ computed.isMulti(options) }}">
|
||||
<options
|
||||
wx:for="{{ options }}"
|
||||
show-border="{{ index !== 0 }}"
|
||||
wx:key="index"
|
||||
options="{{ item }}"
|
||||
bind:select="onSelect"
|
||||
/>
|
||||
</block>
|
||||
|
||||
<options wx:else options="{{ options }}" bind:select="onSelect" />
|
||||
|
||||
<button type="button" class="van-share-sheet__cancel" bindtap="onCancel">
|
||||
{{ cancelText }}
|
||||
</button>
|
||||
</van-popup>
|
12
lib/share-sheet/index.wxs
Normal file
12
lib/share-sheet/index.wxs
Normal file
@ -0,0 +1,12 @@
|
||||
/* eslint-disable */
|
||||
function isMulti(options) {
|
||||
if (options == null || options[0] == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return "Array" === options.constructor && "Array" === options[0].constructor;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
isMulti: isMulti
|
||||
};
|
1
lib/share-sheet/index.wxss
Normal file
1
lib/share-sheet/index.wxss
Normal file
@ -0,0 +1 @@
|
||||
@import '../common/index.wxss';.van-share-sheet__header{padding:12px 16px 4px;text-align:center}.van-share-sheet__title{margin-top:8px;color:#323233;font-weight:400;font-size:14px;line-height:20px}.van-share-sheet__title:empty,.van-share-sheet__title:not(:empty)+.van-share-sheet__title{display:none}.van-share-sheet__description{display:block;margin-top:8px;color:#969799;font-size:12px;line-height:16px}.van-share-sheet__description:empty,.van-share-sheet__description:not(:empty)+.van-share-sheet__description{display:none}.van-share-sheet__cancel{display:block;box-sizing:initial;width:100%;height:auto;padding:0;font-size:16px;line-height:48px;text-align:center;background:#fff;border:none}.van-share-sheet__cancel:before{display:block;height:8px;background-color:#f7f8fa;content:" "}.van-share-sheet__cancel:after{display:none}.van-share-sheet__cancel:active{background-color:#f2f3f5}
|
31
lib/share-sheet/options.js
Normal file
31
lib/share-sheet/options.js
Normal file
@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
var __assign =
|
||||
(this && this.__assign) ||
|
||||
function () {
|
||||
__assign =
|
||||
Object.assign ||
|
||||
function (t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s)
|
||||
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
var component_1 = require('../common/component');
|
||||
component_1.VantComponent({
|
||||
props: {
|
||||
options: Array,
|
||||
showBorder: Boolean,
|
||||
},
|
||||
methods: {
|
||||
onSelect: function (event) {
|
||||
var index = event.currentTarget.dataset.index;
|
||||
var option = this.data.options[index];
|
||||
this.$emit('select', __assign(__assign({}, option), { index: index }));
|
||||
},
|
||||
},
|
||||
});
|
3
lib/share-sheet/options.json
Normal file
3
lib/share-sheet/options.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"component": true
|
||||
}
|
18
lib/share-sheet/options.wxml
Normal file
18
lib/share-sheet/options.wxml
Normal file
@ -0,0 +1,18 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
<wxs src="./options.wxs" module="computed" />
|
||||
|
||||
<view class="{{ utils.bem('share-sheet__options', { border: showBorder }) }}">
|
||||
<view
|
||||
wx:for="{{ options }}"
|
||||
wx:key="index"
|
||||
class="van-share-sheet__option"
|
||||
data-index="{{ index }}"
|
||||
bindtap="onSelect"
|
||||
>
|
||||
<image src="{{ computed.getIconURL(item.icon) }}" class="van-share-sheet__icon" />
|
||||
<view wx:if="{{ item.name }}" class="van-share-sheet__name">{{ item.name }}</view>
|
||||
<view wx:if="{{ item.description }}" class="van-share-sheet__option-description">
|
||||
{{ item.description }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
14
lib/share-sheet/options.wxs
Normal file
14
lib/share-sheet/options.wxs
Normal file
@ -0,0 +1,14 @@
|
||||
/* eslint-disable */
|
||||
var PRESET_ICONS = ['qq', 'weibo', 'wechat', 'link', 'qrcode', 'poster'];
|
||||
|
||||
function getIconURL(icon) {
|
||||
if (PRESET_ICONS.indexOf(icon) !== -1) {
|
||||
return 'https://img.yzcdn.cn/vant/share-icon-' + icon + '.png';
|
||||
}
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getIconURL: getIconURL,
|
||||
};
|
1
lib/share-sheet/options.wxss
Normal file
1
lib/share-sheet/options.wxss
Normal file
@ -0,0 +1 @@
|
||||
@import '../common/index.wxss';.van-share-sheet__options{position:relative;display:-webkit-flex;display:flex;padding:16px 0 16px 8px;overflow-x:auto;overflow-y:visible;-webkit-overflow-scrolling:touch}.van-share-sheet__options--border:before{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;top:0;right:0;left:16px;border-top:1px solid #ebedf0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.van-share-sheet__options::-webkit-scrollbar{height:0}.van-share-sheet__option{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center;-webkit-user-select:none;user-select:none}.van-share-sheet__option:active{opacity:.7}.van-share-sheet__icon{width:48px;height:48px;margin:0 16px}.van-share-sheet__name{margin-top:8px;padding:0 4px;color:#646566;font-size:12px}.van-share-sheet__option-description{padding:0 4px;color:#c8c9cc;font-size:12px}
|
@ -10,6 +10,7 @@ component_1.VantComponent({
|
||||
},
|
||||
props: {
|
||||
dot: Boolean,
|
||||
badge: null,
|
||||
info: null,
|
||||
title: String,
|
||||
disabled: Boolean,
|
||||
|
@ -8,10 +8,9 @@
|
||||
>
|
||||
<view class="van-sidebar-item__text">
|
||||
<van-info
|
||||
wx:if="{{ info !== null || dot }}"
|
||||
wx:if="{{ badge != null || info !== null || dot }}"
|
||||
dot="{{ dot }}"
|
||||
info="{{ info }}"
|
||||
custom-style="right: 4px"
|
||||
info="{{ badge != null ? badge : info }}"
|
||||
/>
|
||||
<view wx:if="{{ title }}">{{ title }}</view>
|
||||
<slot wx:else name="title" />
|
||||
|
@ -23,11 +23,15 @@ component_1.VantComponent({
|
||||
},
|
||||
},
|
||||
props: {
|
||||
sticky: Boolean,
|
||||
border: Boolean,
|
||||
swipeable: Boolean,
|
||||
titleActiveColor: String,
|
||||
titleInactiveColor: String,
|
||||
color: {
|
||||
type: String,
|
||||
observer: 'setLine',
|
||||
},
|
||||
sticky: Boolean,
|
||||
animated: {
|
||||
type: Boolean,
|
||||
observer: function () {
|
||||
@ -37,10 +41,9 @@ component_1.VantComponent({
|
||||
});
|
||||
},
|
||||
},
|
||||
swipeable: Boolean,
|
||||
lineWidth: {
|
||||
type: [String, Number],
|
||||
value: -1,
|
||||
value: 40,
|
||||
observer: 'setLine',
|
||||
},
|
||||
lineHeight: {
|
||||
@ -48,8 +51,6 @@ component_1.VantComponent({
|
||||
value: -1,
|
||||
observer: 'setLine',
|
||||
},
|
||||
titleActiveColor: String,
|
||||
titleInactiveColor: String,
|
||||
active: {
|
||||
type: [String, Number],
|
||||
value: 0,
|
||||
@ -63,10 +64,6 @@ component_1.VantComponent({
|
||||
type: String,
|
||||
value: 'line',
|
||||
},
|
||||
border: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
},
|
||||
ellipsis: {
|
||||
type: Boolean,
|
||||
value: true,
|
||||
@ -231,7 +228,6 @@ component_1.VantComponent({
|
||||
if (rect == null) {
|
||||
return;
|
||||
}
|
||||
var width = lineWidth !== -1 ? lineWidth : rect.width / 2;
|
||||
var height =
|
||||
lineHeight !== -1
|
||||
? 'height: ' +
|
||||
@ -243,7 +239,7 @@ component_1.VantComponent({
|
||||
var left = rects.slice(0, currentIndex).reduce(function (prev, curr) {
|
||||
return prev + curr.width;
|
||||
}, 0);
|
||||
left += (rect.width - width) / 2;
|
||||
left += (rect.width - lineWidth) / 2;
|
||||
var transition = skipTransition
|
||||
? ''
|
||||
: 'transition-duration: ' +
|
||||
@ -256,7 +252,7 @@ component_1.VantComponent({
|
||||
'\n ' +
|
||||
height +
|
||||
'\n width: ' +
|
||||
utils_1.addUnit(width) +
|
||||
utils_1.addUnit(lineWidth) +
|
||||
';\n background-color: ' +
|
||||
color +
|
||||
';\n -webkit-transform: translateX(' +
|
||||
|
@ -29,6 +29,10 @@ component_1.VantComponent({
|
||||
type: Number,
|
||||
value: Infinity,
|
||||
},
|
||||
selectedIcon: {
|
||||
type: String,
|
||||
value: 'success',
|
||||
},
|
||||
},
|
||||
data: {
|
||||
subItems: [],
|
||||
|
@ -13,6 +13,8 @@
|
||||
custom-class="main-item-class"
|
||||
active-class="main-active-class"
|
||||
disabled-class="main-disabled-class"
|
||||
badge="{{ item.badge }}"
|
||||
dot="{{ item.dot }}"
|
||||
title="{{ item.text }}"
|
||||
disabled="{{ item.disabled }}"
|
||||
/>
|
||||
@ -30,7 +32,7 @@
|
||||
{{ item.text }}
|
||||
<van-icon
|
||||
wx:if="{{ wxs.isActive(activeId, item.id) }}"
|
||||
name="checked"
|
||||
name="{{ selectedIcon }}"
|
||||
size="16px"
|
||||
class="van-tree-select__selected"
|
||||
/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user