(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-2d0d672f"],{7330:function(t,e,n){"use strict";n.r(e);var a=(n("99af"),n("d3b7"),n("2b0e")).a.extend({name:"SearchBar",components:{"app-icon":function(){return Promise.all([n.e("chunk-0a381f90"),n.e("chunk-7c0e491e")]).then(n.bind(null,"73f7"))}},props:{clearable:{type:Boolean,default:!0},bgColor:{type:String,default:"bg-common-bg"},placeholder:{type:String,default:"请输入.."},value:String,showCancel:{type:Boolean,default:!0},inputClass:String},data:function(){return{length:0,showError:!1}},computed:{getInputClass:function(){return"".concat(this.inputClass||""," ").concat(this.clearable?"pr-9":"pr-4")}},mounted:function(){this.$refs["c-search-input"].focus()},methods:{handleInput:function(t){this.$emit("input",t.target.value)},clear:function(){this.$refs["c-search-input"].focus(),this.$emit("input","")},keyPress:function(t){"enter"===t.key.toLowerCase()&&this.$emit("search")}}}),s=n("2877"),l=Object(s.a)(a,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"py-1.5 flex items-center",class:t.bgColor},[n("div",{staticClass:"input-wrapper flex-1 relative"},[n("app-icon",{attrs:{"icon-name":"search-light","class-name":"w-6 h-6 absolute left-2 top-1/2 transform -translate-y-1/2"}}),n("form",{attrs:{action:"."}},[n("input",{ref:"c-search-input",staticClass:"py-2 rounded-full w-full pl-9",class:t.getInputClass,attrs:{type:"search",placeholder:t.placeholder},domProps:{value:t.value},on:{input:t.handleInput,keypress:t.keyPress}}),n("input",{staticStyle:{display:"none"},attrs:{type:"text"}})]),t.clearable&&t.value&&t.value.length>0?n("div",{staticClass:"clear absolute right-0 top-1/2 transform -translate-y-1/2 px-3.5 py-3.5 flex items-center justify-center",on:{click:t.clear}},[n("app-icon",{attrs:{"icon-name":"close-small","class-name":"w-2.5 h-2.5"}})],1):t._e()],1),t.showCancel?n("div",{staticClass:"right flex-shrink-0 ml-4"},[t._t("action",(function(){return[n("div",{on:{click:function(e){return t.$emit("cancel")}}},[t._v("取消")])]}))],2):t._e()])}),[],!1,null,null,null);e.default=l.exports}}]);
//# sourceMappingURL=chunk-2d0d672f.92979b0f.js.map