first
This commit is contained in:
1
node_modules/vant/es/contact-list/index.css
generated
vendored
Normal file
1
node_modules/vant/es/contact-list/index.css
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
.van-contact-list{box-sizing:border-box;height:100%;padding-bottom:80px}.van-contact-list__item{padding:16px}.van-contact-list__item-value{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;padding-right:32px;padding-left:8px}.van-contact-list__item-tag{-webkit-box-flex:0;-webkit-flex:none;flex:none;margin-left:8px;padding-top:0;padding-bottom:0;line-height:1.4em}.van-contact-list__group{box-sizing:border-box;height:100%;overflow-y:scroll;-webkit-overflow-scrolling:touch}.van-contact-list__edit{font-size:16px}.van-contact-list__bottom{position:fixed;right:0;bottom:0;left:0;z-index:999;padding:0 16px;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom);background-color:#fff}.van-contact-list__add{height:40px;margin:5px 0}
|
119
node_modules/vant/es/contact-list/index.js
generated
vendored
Normal file
119
node_modules/vant/es/contact-list/index.js
generated
vendored
Normal file
@ -0,0 +1,119 @@
|
||||
import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
|
||||
// Utils
|
||||
import { createNamespace } from '../utils';
|
||||
import { RED } from '../utils/constant';
|
||||
import { emit, inherit } from '../utils/functional'; // Components
|
||||
|
||||
import Tag from '../tag';
|
||||
import Icon from '../icon';
|
||||
import Cell from '../cell';
|
||||
import Radio from '../radio';
|
||||
import Button from '../button';
|
||||
import RadioGroup from '../radio-group'; // Types
|
||||
|
||||
var _createNamespace = createNamespace('contact-list'),
|
||||
createComponent = _createNamespace[0],
|
||||
bem = _createNamespace[1],
|
||||
t = _createNamespace[2];
|
||||
|
||||
function ContactList(h, props, slots, ctx) {
|
||||
var List = props.list && props.list.map(function (item, index) {
|
||||
function onClick() {
|
||||
emit(ctx, 'input', item.id);
|
||||
emit(ctx, 'select', item, index);
|
||||
}
|
||||
|
||||
function RightIcon() {
|
||||
return h(Radio, {
|
||||
"attrs": {
|
||||
"name": item.id,
|
||||
"iconSize": 16,
|
||||
"checkedColor": RED
|
||||
},
|
||||
"on": {
|
||||
"click": onClick
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function LeftIcon() {
|
||||
return h(Icon, {
|
||||
"attrs": {
|
||||
"name": "edit"
|
||||
},
|
||||
"class": bem('edit'),
|
||||
"on": {
|
||||
"click": function click(event) {
|
||||
event.stopPropagation();
|
||||
emit(ctx, 'edit', item, index);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function Content() {
|
||||
var nodes = [item.name + "\uFF0C" + item.tel];
|
||||
|
||||
if (item.isDefault && props.defaultTagText) {
|
||||
nodes.push(h(Tag, {
|
||||
"attrs": {
|
||||
"type": "danger",
|
||||
"round": true
|
||||
},
|
||||
"class": bem('item-tag')
|
||||
}, [props.defaultTagText]));
|
||||
}
|
||||
|
||||
return nodes;
|
||||
}
|
||||
|
||||
return h(Cell, {
|
||||
"key": item.id,
|
||||
"attrs": {
|
||||
"isLink": true,
|
||||
"center": true,
|
||||
"valueClass": bem('item-value')
|
||||
},
|
||||
"class": bem('item'),
|
||||
"scopedSlots": {
|
||||
icon: LeftIcon,
|
||||
default: Content,
|
||||
'right-icon': RightIcon
|
||||
},
|
||||
"on": {
|
||||
"click": onClick
|
||||
}
|
||||
});
|
||||
});
|
||||
return h("div", _mergeJSXProps([{
|
||||
"class": bem()
|
||||
}, inherit(ctx)]), [h(RadioGroup, {
|
||||
"attrs": {
|
||||
"value": props.value
|
||||
},
|
||||
"class": bem('group')
|
||||
}, [List]), h("div", {
|
||||
"class": bem('bottom')
|
||||
}, [h(Button, {
|
||||
"attrs": {
|
||||
"round": true,
|
||||
"block": true,
|
||||
"type": "danger",
|
||||
"text": props.addText || t('addText')
|
||||
},
|
||||
"class": bem('add'),
|
||||
"on": {
|
||||
"click": function click() {
|
||||
emit(ctx, 'add');
|
||||
}
|
||||
}
|
||||
})])]);
|
||||
}
|
||||
|
||||
ContactList.props = {
|
||||
value: null,
|
||||
list: Array,
|
||||
addText: String,
|
||||
defaultTagText: String
|
||||
};
|
||||
export default createComponent(ContactList);
|
54
node_modules/vant/es/contact-list/index.less
generated
vendored
Normal file
54
node_modules/vant/es/contact-list/index.less
generated
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
@import '../style/var';
|
||||
|
||||
.van-contact-list {
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
padding-bottom: 80px;
|
||||
|
||||
&__item {
|
||||
padding: @contact-list-item-padding;
|
||||
}
|
||||
|
||||
&__item-value {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-right: @padding-xl;
|
||||
padding-left: @padding-xs;
|
||||
}
|
||||
|
||||
&__item-tag {
|
||||
flex: none;
|
||||
margin-left: @padding-xs;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
line-height: 1.4em;
|
||||
}
|
||||
|
||||
&__group {
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
overflow-y: scroll;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
&__edit {
|
||||
font-size: @contact-list-edit-icon-size;
|
||||
}
|
||||
|
||||
&__bottom {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: @contact-list-add-button-z-index;
|
||||
padding: 0 @padding-md;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
background-color: @white;
|
||||
}
|
||||
|
||||
&__add {
|
||||
height: 40px;
|
||||
margin: 5px 0;
|
||||
}
|
||||
}
|
10
node_modules/vant/es/contact-list/style/index.js
generated
vendored
Normal file
10
node_modules/vant/es/contact-list/style/index.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
import '../../style/base.css';
|
||||
import '../../info/index.css';
|
||||
import '../../icon/index.css';
|
||||
import '../../radio/index.css';
|
||||
import '../../tag/index.css';
|
||||
import '../../cell/index.css';
|
||||
import '../../loading/index.css';
|
||||
import '../../button/index.css';
|
||||
import '../../radio-group/index.css';
|
||||
import '../index.css';
|
10
node_modules/vant/es/contact-list/style/less.js
generated
vendored
Normal file
10
node_modules/vant/es/contact-list/style/less.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
import '../../style/base.less';
|
||||
import '../../info/index.less';
|
||||
import '../../icon/index.less';
|
||||
import '../../radio/index.less';
|
||||
import '../../tag/index.less';
|
||||
import '../../cell/index.less';
|
||||
import '../../loading/index.less';
|
||||
import '../../button/index.less';
|
||||
import '../../radio-group/index.less';
|
||||
import '../index.less';
|
Reference in New Issue
Block a user