first
This commit is contained in:
1
node_modules/vant/es/dropdown-menu/index.css
generated
vendored
Normal file
1
node_modules/vant/es/dropdown-menu/index.css
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
.van-dropdown-menu{-webkit-user-select:none;user-select:none}.van-dropdown-menu__bar{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;height:48px;background-color:#fff;box-shadow:0 2px 12px rgba(100,101,102,.12)}.van-dropdown-menu__bar--opened{z-index:11}.van-dropdown-menu__item{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-flex:1;-webkit-flex:1;flex:1;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;min-width:0;cursor:pointer}.van-dropdown-menu__item:active{opacity:.7}.van-dropdown-menu__item--disabled:active{opacity:1}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:#969799}.van-dropdown-menu__title{position:relative;box-sizing:border-box;max-width:100%;padding:0 8px;color:#323233;font-size:15px;line-height:22px}.van-dropdown-menu__title::after{position:absolute;top:50%;right:-4px;margin-top:-5px;border:3px solid;border-color:transparent transparent #dcdee0 #dcdee0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);opacity:.8;content:''}.van-dropdown-menu__title--active{color:#ee0a24}.van-dropdown-menu__title--active::after{border-color:transparent transparent currentColor currentColor}.van-dropdown-menu__title--down::after{margin-top:-1px;-webkit-transform:rotate(135deg);transform:rotate(135deg)}
|
132
node_modules/vant/es/dropdown-menu/index.js
generated
vendored
Normal file
132
node_modules/vant/es/dropdown-menu/index.js
generated
vendored
Normal file
@ -0,0 +1,132 @@
|
||||
// Utils
|
||||
import { createNamespace, isDef } from '../utils';
|
||||
import { getScroller } from '../utils/dom/scroll'; // Mixins
|
||||
|
||||
import { ParentMixin } from '../mixins/relation';
|
||||
import { ClickOutsideMixin } from '../mixins/click-outside';
|
||||
|
||||
var _createNamespace = createNamespace('dropdown-menu'),
|
||||
createComponent = _createNamespace[0],
|
||||
bem = _createNamespace[1];
|
||||
|
||||
export default createComponent({
|
||||
mixins: [ParentMixin('vanDropdownMenu'), ClickOutsideMixin({
|
||||
event: 'click',
|
||||
method: 'onClickOutside'
|
||||
})],
|
||||
props: {
|
||||
zIndex: [Number, String],
|
||||
activeColor: String,
|
||||
overlay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
duration: {
|
||||
type: [Number, String],
|
||||
default: 0.2
|
||||
},
|
||||
direction: {
|
||||
type: String,
|
||||
default: 'down'
|
||||
},
|
||||
closeOnClickOverlay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data: function data() {
|
||||
return {
|
||||
offset: 0
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
scroller: function scroller() {
|
||||
return getScroller(this.$el);
|
||||
},
|
||||
opened: function opened() {
|
||||
return this.children.some(function (item) {
|
||||
return item.showWrapper;
|
||||
});
|
||||
},
|
||||
barStyle: function barStyle() {
|
||||
if (this.opened && isDef(this.zIndex)) {
|
||||
return {
|
||||
zIndex: 1 + this.zIndex
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
updateOffset: function updateOffset() {
|
||||
if (!this.$refs.bar) {
|
||||
return;
|
||||
}
|
||||
|
||||
var rect = this.$refs.bar.getBoundingClientRect();
|
||||
|
||||
if (this.direction === 'down') {
|
||||
this.offset = rect.bottom;
|
||||
} else {
|
||||
this.offset = window.innerHeight - rect.top;
|
||||
}
|
||||
},
|
||||
toggleItem: function toggleItem(active) {
|
||||
this.children.forEach(function (item, index) {
|
||||
if (index === active) {
|
||||
item.toggle();
|
||||
} else if (item.showPopup) {
|
||||
item.toggle(false, {
|
||||
immediate: true
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
onClickOutside: function onClickOutside() {
|
||||
this.children.forEach(function (item) {
|
||||
item.toggle(false);
|
||||
});
|
||||
}
|
||||
},
|
||||
render: function render() {
|
||||
var _this = this;
|
||||
|
||||
var h = arguments[0];
|
||||
var Titles = this.children.map(function (item, index) {
|
||||
return h("div", {
|
||||
"attrs": {
|
||||
"role": "button",
|
||||
"tabindex": item.disabled ? -1 : 0
|
||||
},
|
||||
"class": bem('item', {
|
||||
disabled: item.disabled
|
||||
}),
|
||||
"on": {
|
||||
"click": function click() {
|
||||
if (!item.disabled) {
|
||||
_this.toggleItem(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [h("span", {
|
||||
"class": [bem('title', {
|
||||
active: item.showPopup,
|
||||
down: item.showPopup === (_this.direction === 'down')
|
||||
}), item.titleClass],
|
||||
"style": {
|
||||
color: item.showPopup ? _this.activeColor : ''
|
||||
}
|
||||
}, [h("div", {
|
||||
"class": "van-ellipsis"
|
||||
}, [item.slots('title') || item.displayTitle])])]);
|
||||
});
|
||||
return h("div", {
|
||||
"class": bem()
|
||||
}, [h("div", {
|
||||
"ref": "bar",
|
||||
"style": this.barStyle,
|
||||
"class": bem('bar', {
|
||||
opened: this.opened
|
||||
})
|
||||
}, [Titles]), this.slots('default')]);
|
||||
}
|
||||
});
|
77
node_modules/vant/es/dropdown-menu/index.less
generated
vendored
Normal file
77
node_modules/vant/es/dropdown-menu/index.less
generated
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
@import '../style/var';
|
||||
|
||||
.van-dropdown-menu {
|
||||
user-select: none;
|
||||
|
||||
&__bar {
|
||||
position: relative;
|
||||
display: flex;
|
||||
height: @dropdown-menu-height;
|
||||
background-color: @dropdown-menu-background-color;
|
||||
box-shadow: @dropdown-menu-box-shadow;
|
||||
|
||||
&--opened {
|
||||
z-index: @dropdown-item-z-index + 1;
|
||||
}
|
||||
}
|
||||
|
||||
&__item {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 0; // hack for flex ellipsis
|
||||
cursor: pointer;
|
||||
|
||||
&:active {
|
||||
opacity: @active-opacity;
|
||||
}
|
||||
|
||||
&--disabled {
|
||||
&:active {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.van-dropdown-menu__title {
|
||||
color: @dropdown-menu-title-disabled-text-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__title {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
max-width: 100%;
|
||||
padding: @dropdown-menu-title-padding;
|
||||
color: @dropdown-menu-title-text-color;
|
||||
font-size: @dropdown-menu-title-font-size;
|
||||
line-height: @dropdown-menu-title-line-height;
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: -4px;
|
||||
margin-top: -5px;
|
||||
border: 3px solid;
|
||||
border-color: transparent transparent @gray-4 @gray-4;
|
||||
transform: rotate(-45deg);
|
||||
opacity: 0.8;
|
||||
content: '';
|
||||
}
|
||||
|
||||
&--active {
|
||||
color: @dropdown-menu-title-active-text-color;
|
||||
|
||||
&::after {
|
||||
border-color: transparent transparent currentColor currentColor;
|
||||
}
|
||||
}
|
||||
|
||||
&--down {
|
||||
&::after {
|
||||
margin-top: -1px;
|
||||
transform: rotate(135deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
2
node_modules/vant/es/dropdown-menu/style/index.js
generated
vendored
Normal file
2
node_modules/vant/es/dropdown-menu/style/index.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
import '../../style/base.css';
|
||||
import '../index.css';
|
2
node_modules/vant/es/dropdown-menu/style/less.js
generated
vendored
Normal file
2
node_modules/vant/es/dropdown-menu/style/less.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
import '../../style/base.less';
|
||||
import '../index.less';
|
Reference in New Issue
Block a user