first
This commit is contained in:
1
node_modules/vant/es/action-sheet/index.css
generated
vendored
Normal file
1
node_modules/vant/es/action-sheet/index.css
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
.van-action-sheet{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;max-height:80%;overflow:hidden;color:#323233}.van-action-sheet__content{-webkit-box-flex:1;-webkit-flex:1 auto;flex:1 auto;overflow-y:auto;-webkit-overflow-scrolling:touch}.van-action-sheet__cancel,.van-action-sheet__item{display:block;width:100%;padding:14px 16px;font-size:16px;background-color:#fff;border:none;cursor:pointer}.van-action-sheet__cancel:active,.van-action-sheet__item:active{background-color:#f2f3f5}.van-action-sheet__item{line-height:22px}.van-action-sheet__item--disabled,.van-action-sheet__item--loading{color:#c8c9cc}.van-action-sheet__item--disabled:active,.van-action-sheet__item--loading:active{background-color:#fff}.van-action-sheet__item--disabled{cursor:not-allowed}.van-action-sheet__item--loading{cursor:default}.van-action-sheet__cancel{-webkit-flex-shrink:0;flex-shrink:0;box-sizing:border-box;color:#646566}.van-action-sheet__subname{margin-top:8px;color:#969799;font-size:12px;line-height:18px}.van-action-sheet__gap{display:block;height:8px;background-color:#f7f8fa}.van-action-sheet__header{-webkit-flex-shrink:0;flex-shrink:0;font-weight:500;font-size:16px;line-height:48px;text-align:center}.van-action-sheet__description{position:relative;-webkit-flex-shrink:0;flex-shrink:0;padding:20px 16px;color:#969799;font-size:14px;line-height:20px;text-align:center}.van-action-sheet__description::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-action-sheet__loading-icon .van-loading__spinner{width:22px;height:22px}.van-action-sheet__close{position:absolute;top:0;right:0;z-index:1;padding:0 16px;color:#c8c9cc;font-size:22px;line-height:inherit}.van-action-sheet__close:active{color:#969799}
|
180
node_modules/vant/es/action-sheet/index.js
generated
vendored
Normal file
180
node_modules/vant/es/action-sheet/index.js
generated
vendored
Normal file
@ -0,0 +1,180 @@
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
|
||||
import Vue from 'vue'; // Utils
|
||||
|
||||
import { createNamespace } from '../utils';
|
||||
import { emit, inherit } from '../utils/functional'; // Mixins
|
||||
|
||||
import { popupMixinProps } from '../mixins/popup'; // Components
|
||||
|
||||
import Icon from '../icon';
|
||||
import Popup from '../popup';
|
||||
import Loading from '../loading'; // Types
|
||||
|
||||
var _createNamespace = createNamespace('action-sheet'),
|
||||
createComponent = _createNamespace[0],
|
||||
bem = _createNamespace[1];
|
||||
|
||||
function ActionSheet(h, props, slots, ctx) {
|
||||
var title = props.title,
|
||||
cancelText = props.cancelText,
|
||||
closeable = props.closeable;
|
||||
|
||||
function onCancel() {
|
||||
emit(ctx, 'input', false);
|
||||
emit(ctx, 'cancel');
|
||||
}
|
||||
|
||||
function Header() {
|
||||
if (title) {
|
||||
return h("div", {
|
||||
"class": bem('header')
|
||||
}, [title, closeable && h(Icon, {
|
||||
"attrs": {
|
||||
"name": props.closeIcon
|
||||
},
|
||||
"class": bem('close'),
|
||||
"on": {
|
||||
"click": onCancel
|
||||
}
|
||||
})]);
|
||||
}
|
||||
}
|
||||
|
||||
function Option(item, index) {
|
||||
var disabled = item.disabled,
|
||||
loading = item.loading,
|
||||
callback = item.callback;
|
||||
|
||||
function onClickOption(event) {
|
||||
event.stopPropagation();
|
||||
|
||||
if (disabled || loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
callback(item);
|
||||
}
|
||||
|
||||
if (props.closeOnClickAction) {
|
||||
emit(ctx, 'input', false);
|
||||
}
|
||||
|
||||
Vue.nextTick(function () {
|
||||
emit(ctx, 'select', item, index);
|
||||
});
|
||||
}
|
||||
|
||||
function OptionContent() {
|
||||
if (loading) {
|
||||
return h(Loading, {
|
||||
"class": bem('loading-icon')
|
||||
});
|
||||
}
|
||||
|
||||
return [h("span", {
|
||||
"class": bem('name')
|
||||
}, [item.name]), item.subname && h("div", {
|
||||
"class": bem('subname')
|
||||
}, [item.subname])];
|
||||
}
|
||||
|
||||
return h("button", {
|
||||
"attrs": {
|
||||
"type": "button"
|
||||
},
|
||||
"class": [bem('item', {
|
||||
disabled: disabled,
|
||||
loading: loading
|
||||
}), item.className],
|
||||
"style": {
|
||||
color: item.color
|
||||
},
|
||||
"on": {
|
||||
"click": onClickOption
|
||||
}
|
||||
}, [OptionContent()]);
|
||||
}
|
||||
|
||||
function CancelText() {
|
||||
if (cancelText) {
|
||||
return [h("div", {
|
||||
"class": bem('gap')
|
||||
}), h("button", {
|
||||
"attrs": {
|
||||
"type": "button"
|
||||
},
|
||||
"class": bem('cancel'),
|
||||
"on": {
|
||||
"click": onCancel
|
||||
}
|
||||
}, [cancelText])];
|
||||
}
|
||||
}
|
||||
|
||||
function Description() {
|
||||
var description = (slots.description == null ? void 0 : slots.description()) || props.description;
|
||||
|
||||
if (description) {
|
||||
return h("div", {
|
||||
"class": bem('description')
|
||||
}, [description]);
|
||||
}
|
||||
}
|
||||
|
||||
return h(Popup, _mergeJSXProps([{
|
||||
"class": bem(),
|
||||
"attrs": {
|
||||
"position": "bottom",
|
||||
"round": props.round,
|
||||
"value": props.value,
|
||||
"overlay": props.overlay,
|
||||
"duration": props.duration,
|
||||
"lazyRender": props.lazyRender,
|
||||
"lockScroll": props.lockScroll,
|
||||
"getContainer": props.getContainer,
|
||||
"closeOnPopstate": props.closeOnPopstate,
|
||||
"closeOnClickOverlay": props.closeOnClickOverlay,
|
||||
"safeAreaInsetBottom": props.safeAreaInsetBottom
|
||||
}
|
||||
}, inherit(ctx, true)]), [Header(), Description(), h("div", {
|
||||
"class": bem('content')
|
||||
}, [props.actions && props.actions.map(Option), slots.default == null ? void 0 : slots.default()]), CancelText()]);
|
||||
}
|
||||
|
||||
ActionSheet.props = _extends({}, popupMixinProps, {
|
||||
title: String,
|
||||
actions: Array,
|
||||
duration: [Number, String],
|
||||
cancelText: String,
|
||||
description: String,
|
||||
getContainer: [String, Function],
|
||||
closeOnPopstate: Boolean,
|
||||
closeOnClickAction: Boolean,
|
||||
round: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
closeable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
closeIcon: {
|
||||
type: String,
|
||||
default: 'cross'
|
||||
},
|
||||
safeAreaInsetBottom: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
overlay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
closeOnClickOverlay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
});
|
||||
export default createComponent(ActionSheet);
|
113
node_modules/vant/es/action-sheet/index.less
generated
vendored
Normal file
113
node_modules/vant/es/action-sheet/index.less
generated
vendored
Normal file
@ -0,0 +1,113 @@
|
||||
@import '../style/var';
|
||||
@import '../style/mixins/hairline';
|
||||
|
||||
.van-action-sheet {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-height: @action-sheet-max-height;
|
||||
overflow: hidden;
|
||||
color: @action-sheet-item-text-color;
|
||||
|
||||
&__content {
|
||||
flex: 1 auto;
|
||||
overflow-y: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
&__item,
|
||||
&__cancel {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 14px @padding-md;
|
||||
font-size: @action-sheet-item-font-size;
|
||||
background-color: @action-sheet-item-background;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
|
||||
&:active {
|
||||
background-color: @active-color;
|
||||
}
|
||||
}
|
||||
|
||||
&__item {
|
||||
line-height: @action-sheet-item-line-height;
|
||||
|
||||
&--loading,
|
||||
&--disabled {
|
||||
color: @action-sheet-item-disabled-text-color;
|
||||
|
||||
&:active {
|
||||
background-color: @action-sheet-item-background;
|
||||
}
|
||||
}
|
||||
|
||||
&--disabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
&--loading {
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
|
||||
&__cancel {
|
||||
flex-shrink: 0;
|
||||
box-sizing: border-box;
|
||||
color: @action-sheet-cancel-text-color;
|
||||
}
|
||||
|
||||
&__subname {
|
||||
margin-top: @padding-xs;
|
||||
color: @action-sheet-subname-color;
|
||||
font-size: @action-sheet-subname-font-size;
|
||||
line-height: @action-sheet-subname-line-height;
|
||||
}
|
||||
|
||||
&__gap {
|
||||
display: block;
|
||||
height: @action-sheet-cancel-padding-top;
|
||||
background-color: @action-sheet-cancel-padding-color;
|
||||
}
|
||||
|
||||
&__header {
|
||||
flex-shrink: 0;
|
||||
font-weight: @font-weight-bold;
|
||||
font-size: @action-sheet-header-font-size;
|
||||
line-height: @action-sheet-header-height;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&__description {
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
padding: 20px @padding-md;
|
||||
color: @action-sheet-description-color;
|
||||
font-size: @action-sheet-description-font-size;
|
||||
line-height: @action-sheet-description-line-height;
|
||||
text-align: center;
|
||||
|
||||
&::after {
|
||||
.hairline-bottom(@cell-border-color, @padding-md, @padding-md);
|
||||
}
|
||||
}
|
||||
|
||||
&__loading-icon .van-loading__spinner {
|
||||
width: @action-sheet-loading-icon-size;
|
||||
height: @action-sheet-loading-icon-size;
|
||||
}
|
||||
|
||||
&__close {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 1;
|
||||
padding: @action-sheet-close-icon-padding;
|
||||
color: @action-sheet-close-icon-color;
|
||||
font-size: @action-sheet-close-icon-size;
|
||||
line-height: inherit;
|
||||
|
||||
&:active {
|
||||
color: @action-sheet-close-icon-active-color;
|
||||
}
|
||||
}
|
||||
}
|
7
node_modules/vant/es/action-sheet/style/index.js
generated
vendored
Normal file
7
node_modules/vant/es/action-sheet/style/index.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
import '../../style/base.css';
|
||||
import '../../overlay/index.css';
|
||||
import '../../info/index.css';
|
||||
import '../../icon/index.css';
|
||||
import '../../popup/index.css';
|
||||
import '../../loading/index.css';
|
||||
import '../index.css';
|
7
node_modules/vant/es/action-sheet/style/less.js
generated
vendored
Normal file
7
node_modules/vant/es/action-sheet/style/less.js
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
import '../../style/base.less';
|
||||
import '../../overlay/index.less';
|
||||
import '../../info/index.less';
|
||||
import '../../icon/index.less';
|
||||
import '../../popup/index.less';
|
||||
import '../../loading/index.less';
|
||||
import '../index.less';
|
Reference in New Issue
Block a user