first
This commit is contained in:
1
node_modules/vant/es/search/index.css
generated
vendored
Normal file
1
node_modules/vant/es/search/index.css
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
.van-search{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;box-sizing:border-box;padding:10px 12px;background-color:#fff}.van-search__content{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding-left:12px;background-color:#f7f8fa;border-radius:2px}.van-search__content--round{border-radius:999px}.van-search__label{padding:0 5px;color:#323233;font-size:14px;line-height:34px}.van-search .van-cell{-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:5px 8px 5px 0;background-color:transparent}.van-search .van-cell .van-field__left-icon{color:#969799}.van-search--show-action{padding-right:0}.van-search input::-webkit-search-cancel-button,.van-search input::-webkit-search-decoration,.van-search input::-webkit-search-results-button,.van-search input::-webkit-search-results-decoration{display:none}.van-search__action{padding:0 8px;color:#323233;font-size:14px;line-height:34px;cursor:pointer;-webkit-user-select:none;user-select:none}.van-search__action:active{background-color:#f2f3f5}
|
114
node_modules/vant/es/search/index.js
generated
vendored
Normal file
114
node_modules/vant/es/search/index.js
generated
vendored
Normal file
@ -0,0 +1,114 @@
|
||||
import _mergeJSXProps2 from "@vue/babel-helper-vue-jsx-merge-props";
|
||||
import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
// Utils
|
||||
import { createNamespace } from '../utils';
|
||||
import { inherit, emit } from '../utils/functional';
|
||||
import { preventDefault } from '../utils/dom/event'; // Components
|
||||
|
||||
import Field from '../field'; // Types
|
||||
|
||||
var _createNamespace = createNamespace('search'),
|
||||
createComponent = _createNamespace[0],
|
||||
bem = _createNamespace[1],
|
||||
t = _createNamespace[2];
|
||||
|
||||
function Search(h, props, slots, ctx) {
|
||||
function Label() {
|
||||
if (slots.label || props.label) {
|
||||
return h("div", {
|
||||
"class": bem('label')
|
||||
}, [slots.label ? slots.label() : props.label]);
|
||||
}
|
||||
}
|
||||
|
||||
function Action() {
|
||||
if (!props.showAction) {
|
||||
return;
|
||||
}
|
||||
|
||||
function onCancel() {
|
||||
if (slots.action) {
|
||||
return;
|
||||
}
|
||||
|
||||
emit(ctx, 'input', '');
|
||||
emit(ctx, 'cancel');
|
||||
}
|
||||
|
||||
return h("div", {
|
||||
"class": bem('action'),
|
||||
"attrs": {
|
||||
"role": "button",
|
||||
"tabindex": "0"
|
||||
},
|
||||
"on": {
|
||||
"click": onCancel
|
||||
}
|
||||
}, [slots.action ? slots.action() : props.actionText || t('cancel')]);
|
||||
}
|
||||
|
||||
var fieldData = {
|
||||
attrs: ctx.data.attrs,
|
||||
on: _extends({}, ctx.listeners, {
|
||||
keypress: function keypress(event) {
|
||||
// press enter
|
||||
if (event.keyCode === 13) {
|
||||
preventDefault(event);
|
||||
emit(ctx, 'search', props.value);
|
||||
}
|
||||
|
||||
emit(ctx, 'keypress', event);
|
||||
}
|
||||
})
|
||||
};
|
||||
var inheritData = inherit(ctx);
|
||||
inheritData.attrs = undefined;
|
||||
return h("div", _mergeJSXProps2([{
|
||||
"class": bem({
|
||||
'show-action': props.showAction
|
||||
}),
|
||||
"style": {
|
||||
background: props.background
|
||||
}
|
||||
}, inheritData]), [slots.left == null ? void 0 : slots.left(), h("div", {
|
||||
"class": bem('content', props.shape)
|
||||
}, [Label(), h(Field, _mergeJSXProps([{
|
||||
"attrs": {
|
||||
"type": "search",
|
||||
"border": false,
|
||||
"value": props.value,
|
||||
"leftIcon": props.leftIcon,
|
||||
"rightIcon": props.rightIcon,
|
||||
"clearable": props.clearable,
|
||||
"clearTrigger": props.clearTrigger
|
||||
},
|
||||
"scopedSlots": {
|
||||
'left-icon': slots['left-icon'],
|
||||
'right-icon': slots['right-icon']
|
||||
}
|
||||
}, fieldData]))]), Action()]);
|
||||
}
|
||||
|
||||
Search.props = {
|
||||
value: String,
|
||||
label: String,
|
||||
rightIcon: String,
|
||||
actionText: String,
|
||||
background: String,
|
||||
showAction: Boolean,
|
||||
clearTrigger: String,
|
||||
shape: {
|
||||
type: String,
|
||||
default: 'square'
|
||||
},
|
||||
clearable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
leftIcon: {
|
||||
type: String,
|
||||
default: 'search'
|
||||
}
|
||||
};
|
||||
export default createComponent(Search);
|
64
node_modules/vant/es/search/index.less
generated
vendored
Normal file
64
node_modules/vant/es/search/index.less
generated
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
@import '../style/var';
|
||||
|
||||
.van-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
padding: @search-padding;
|
||||
background-color: @search-background-color;
|
||||
|
||||
&__content {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
padding-left: @padding-sm;
|
||||
background-color: @search-content-background-color;
|
||||
border-radius: @border-radius-sm;
|
||||
|
||||
&--round {
|
||||
border-radius: @border-radius-max;
|
||||
}
|
||||
}
|
||||
|
||||
&__label {
|
||||
padding: @search-label-padding;
|
||||
color: @search-label-color;
|
||||
font-size: @search-label-font-size;
|
||||
line-height: @search-input-height;
|
||||
}
|
||||
|
||||
.van-cell {
|
||||
flex: 1;
|
||||
padding: 5px @padding-xs 5px 0;
|
||||
background-color: transparent;
|
||||
|
||||
.van-field__left-icon {
|
||||
color: @search-left-icon-color;
|
||||
}
|
||||
}
|
||||
|
||||
&--show-action {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
input {
|
||||
&::-webkit-search-decoration,
|
||||
&::-webkit-search-cancel-button,
|
||||
&::-webkit-search-results-button,
|
||||
&::-webkit-search-results-decoration {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&__action {
|
||||
padding: @search-action-padding;
|
||||
color: @search-action-text-color;
|
||||
font-size: @search-action-font-size;
|
||||
line-height: @search-input-height;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
|
||||
&:active {
|
||||
background-color: @active-color;
|
||||
}
|
||||
}
|
||||
}
|
6
node_modules/vant/es/search/style/index.js
generated
vendored
Normal file
6
node_modules/vant/es/search/style/index.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
import '../../style/base.css';
|
||||
import '../../info/index.css';
|
||||
import '../../icon/index.css';
|
||||
import '../../cell/index.css';
|
||||
import '../../field/index.css';
|
||||
import '../index.css';
|
6
node_modules/vant/es/search/style/less.js
generated
vendored
Normal file
6
node_modules/vant/es/search/style/less.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
import '../../style/base.less';
|
||||
import '../../info/index.less';
|
||||
import '../../icon/index.less';
|
||||
import '../../cell/index.less';
|
||||
import '../../field/index.less';
|
||||
import '../index.less';
|
Reference in New Issue
Block a user