first
This commit is contained in:
1
node_modules/vant/es/share-sheet/index.css
generated
vendored
Normal file
1
node_modules/vant/es/share-sheet/index.css
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
.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__description{display:block;margin-top:8px;color:#969799;font-size:12px;line-height:16px}.van-share-sheet__options{position:relative;display:-webkit-box;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-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;align-items:center;cursor:pointer;-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}.van-share-sheet__cancel{display:block;width:100%;padding:0;font-size:16px;line-height:48px;text-align:center;background:#fff;border:none;cursor:pointer}.van-share-sheet__cancel::before{display:block;height:8px;background-color:#f7f8fa;content:' '}.van-share-sheet__cancel:active{background-color:#f2f3f5}
|
170
node_modules/vant/es/share-sheet/index.js
generated
vendored
Normal file
170
node_modules/vant/es/share-sheet/index.js
generated
vendored
Normal file
@ -0,0 +1,170 @@
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
// Utils
|
||||
import { createNamespace } from '../utils'; // Mixins
|
||||
|
||||
import { popupMixinProps } from '../mixins/popup'; // Components
|
||||
|
||||
import Popup from '../popup';
|
||||
var PRESET_ICONS = ['qq', 'link', 'weibo', 'wechat', 'poster', 'qrcode', 'weapp-qrcode', 'wechat-moments'];
|
||||
|
||||
var _createNamespace = createNamespace('share-sheet'),
|
||||
createComponent = _createNamespace[0],
|
||||
bem = _createNamespace[1],
|
||||
t = _createNamespace[2];
|
||||
|
||||
export default createComponent({
|
||||
props: _extends({}, popupMixinProps, {
|
||||
title: String,
|
||||
duration: String,
|
||||
cancelText: String,
|
||||
description: String,
|
||||
getContainer: [String, Function],
|
||||
options: {
|
||||
type: Array,
|
||||
default: function _default() {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
overlay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
closeOnPopstate: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
safeAreaInsetBottom: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
closeOnClickOverlay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
}),
|
||||
methods: {
|
||||
onCancel: function onCancel() {
|
||||
this.toggle(false);
|
||||
this.$emit('cancel');
|
||||
},
|
||||
onSelect: function onSelect(option, index) {
|
||||
this.$emit('select', option, index);
|
||||
},
|
||||
toggle: function toggle(val) {
|
||||
this.$emit('input', val);
|
||||
},
|
||||
getIconURL: function getIconURL(icon) {
|
||||
if (PRESET_ICONS.indexOf(icon) !== -1) {
|
||||
return "https://img01.yzcdn.cn/vant/share-sheet-" + icon + ".png";
|
||||
}
|
||||
|
||||
return icon;
|
||||
},
|
||||
genHeader: function genHeader() {
|
||||
var h = this.$createElement;
|
||||
var title = this.slots('title') || this.title;
|
||||
var description = this.slots('description') || this.description;
|
||||
|
||||
if (!title && !description) {
|
||||
return;
|
||||
}
|
||||
|
||||
return h("div", {
|
||||
"class": bem('header')
|
||||
}, [title && h("h2", {
|
||||
"class": bem('title')
|
||||
}, [title]), description && h("span", {
|
||||
"class": bem('description')
|
||||
}, [description])]);
|
||||
},
|
||||
genOptions: function genOptions(options, showBorder) {
|
||||
var _this = this;
|
||||
|
||||
var h = this.$createElement;
|
||||
return h("div", {
|
||||
"class": bem('options', {
|
||||
border: showBorder
|
||||
})
|
||||
}, [options.map(function (option, index) {
|
||||
return h("div", {
|
||||
"attrs": {
|
||||
"role": "button",
|
||||
"tabindex": "0"
|
||||
},
|
||||
"class": [bem('option'), option.className],
|
||||
"on": {
|
||||
"click": function click() {
|
||||
_this.onSelect(option, index);
|
||||
}
|
||||
}
|
||||
}, [h("img", {
|
||||
"attrs": {
|
||||
"src": _this.getIconURL(option.icon)
|
||||
},
|
||||
"class": bem('icon')
|
||||
}), option.name && h("span", {
|
||||
"class": bem('name')
|
||||
}, [option.name]), option.description && h("span", {
|
||||
"class": bem('option-description')
|
||||
}, [option.description])]);
|
||||
})]);
|
||||
},
|
||||
genRows: function genRows() {
|
||||
var _this2 = this;
|
||||
|
||||
var options = this.options;
|
||||
|
||||
if (Array.isArray(options[0])) {
|
||||
return options.map(function (item, index) {
|
||||
return _this2.genOptions(item, index !== 0);
|
||||
});
|
||||
}
|
||||
|
||||
return this.genOptions(options);
|
||||
},
|
||||
genCancelText: function genCancelText() {
|
||||
var _this$cancelText;
|
||||
|
||||
var h = this.$createElement;
|
||||
var cancelText = (_this$cancelText = this.cancelText) != null ? _this$cancelText : t('cancel');
|
||||
|
||||
if (cancelText) {
|
||||
return h("button", {
|
||||
"attrs": {
|
||||
"type": "button"
|
||||
},
|
||||
"class": bem('cancel'),
|
||||
"on": {
|
||||
"click": this.onCancel
|
||||
}
|
||||
}, [cancelText]);
|
||||
}
|
||||
},
|
||||
onClickOverlay: function onClickOverlay() {
|
||||
this.$emit('click-overlay');
|
||||
}
|
||||
},
|
||||
render: function render() {
|
||||
var h = arguments[0];
|
||||
return h(Popup, {
|
||||
"attrs": {
|
||||
"round": true,
|
||||
"value": this.value,
|
||||
"position": "bottom",
|
||||
"overlay": this.overlay,
|
||||
"duration": this.duration,
|
||||
"lazyRender": this.lazyRender,
|
||||
"lockScroll": this.lockScroll,
|
||||
"getContainer": this.getContainer,
|
||||
"closeOnPopstate": this.closeOnPopstate,
|
||||
"closeOnClickOverlay": this.closeOnClickOverlay,
|
||||
"safeAreaInsetBottom": this.safeAreaInsetBottom
|
||||
},
|
||||
"class": bem(),
|
||||
"on": {
|
||||
"input": this.toggle,
|
||||
"click-overlay": this.onClickOverlay
|
||||
}
|
||||
}, [this.genHeader(), this.genRows(), this.genCancelText()]);
|
||||
}
|
||||
});
|
96
node_modules/vant/es/share-sheet/index.less
generated
vendored
Normal file
96
node_modules/vant/es/share-sheet/index.less
generated
vendored
Normal file
@ -0,0 +1,96 @@
|
||||
@import '../style/var';
|
||||
@import '../style/mixins/hairline';
|
||||
|
||||
.van-share-sheet {
|
||||
&__header {
|
||||
padding: @share-sheet-header-padding;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&__title {
|
||||
margin-top: @padding-xs;
|
||||
color: @share-sheet-title-color;
|
||||
font-weight: normal;
|
||||
font-size: @share-sheet-title-font-size;
|
||||
line-height: @share-sheet-title-line-height;
|
||||
}
|
||||
|
||||
&__description {
|
||||
display: block;
|
||||
margin-top: @padding-xs;
|
||||
color: @share-sheet-description-color;
|
||||
font-size: @share-sheet-description-font-size;
|
||||
line-height: @share-sheet-description-line-height;
|
||||
}
|
||||
|
||||
&__options {
|
||||
position: relative;
|
||||
display: flex;
|
||||
padding: @padding-md 0 @padding-md @padding-xs;
|
||||
overflow-x: auto;
|
||||
overflow-y: visible;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
|
||||
&--border::before {
|
||||
.hairline-top(@cell-border-color, @padding-md);
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
height: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&__option {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
|
||||
&:active {
|
||||
opacity: @active-opacity;
|
||||
}
|
||||
}
|
||||
|
||||
&__icon {
|
||||
width: @share-sheet-icon-size;
|
||||
height: @share-sheet-icon-size;
|
||||
margin: 0 @padding-md;
|
||||
}
|
||||
|
||||
&__name {
|
||||
margin-top: @padding-xs;
|
||||
padding: 0 @padding-base;
|
||||
color: @share-sheet-option-name-color;
|
||||
font-size: @share-sheet-option-name-font-size;
|
||||
}
|
||||
|
||||
&__option-description {
|
||||
padding: 0 @padding-base;
|
||||
color: @share-sheet-option-description-color;
|
||||
font-size: @share-sheet-option-description-font-size;
|
||||
}
|
||||
|
||||
&__cancel {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
font-size: @share-sheet-cancel-button-font-size;
|
||||
line-height: @share-sheet-cancel-button-height;
|
||||
text-align: center;
|
||||
background: @share-sheet-cancel-button-background;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
|
||||
&::before {
|
||||
display: block;
|
||||
height: @padding-xs;
|
||||
background-color: @background-color;
|
||||
content: ' ';
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: @active-color;
|
||||
}
|
||||
}
|
||||
}
|
6
node_modules/vant/es/share-sheet/style/index.js
generated
vendored
Normal file
6
node_modules/vant/es/share-sheet/style/index.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
import '../../style/base.css';
|
||||
import '../../overlay/index.css';
|
||||
import '../../info/index.css';
|
||||
import '../../icon/index.css';
|
||||
import '../../popup/index.css';
|
||||
import '../index.css';
|
6
node_modules/vant/es/share-sheet/style/less.js
generated
vendored
Normal file
6
node_modules/vant/es/share-sheet/style/less.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
import '../../style/base.less';
|
||||
import '../../overlay/index.less';
|
||||
import '../../info/index.less';
|
||||
import '../../icon/index.less';
|
||||
import '../../popup/index.less';
|
||||
import '../index.less';
|
Reference in New Issue
Block a user