"use strict";const e=require("../../../../common/vendor.js"),t={name:"wht-select",props:{options:{type:Array,default:()=>[]},value:{type:[String,Number],default:""},placeholder:{type:String,default:"请选择"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},height:{type:Number,default:40},fontSize:{type:Number,default:14},borderColor:{type:String,default:"#dcdfe6"},borderRadius:{type:Number,default:4},backgroundColor:{type:String,default:"#ffffff"},textColor:{type:String,default:"#606266"},placeholderColor:{type:String,default:"#c0c4cc"},activeColor:{type:String,default:"#409eff"},filterable:{type:Boolean,default:!1},searchPlaceholder:{type:String,default:"请输入搜索内容"}},data:()=>({currentValue:"",isOpen:!1,searchQuery:""}),computed:{currentLabel(){const e=this.options.find((e=>e.value===this.currentValue));return e?e.label:""},filteredOptions(){return this.filterable&&this.searchQuery?this.options.filter((e=>e.label.toLowerCase().includes(this.searchQuery.toLowerCase()))):this.options}},watch:{value:{handler(e){this.currentValue=e},immediate:!0}},methods:{togglePicker(){this.disabled||(this.isOpen=!this.isOpen,this.isOpen||(this.searchQuery=""))},selectOption(e,t){e.disabled||(this.currentValue=e.value,this.searchQuery="",this.$emit("input",e.value),this.$emit("change",e),this.isOpen=!1)},clearValue(e){this.currentValue="",this.searchQuery="",this.$emit("input",""),this.$emit("change",null),this.$emit("clear")},onSearch(){this.$emit("search",this.searchQuery)},handleFocus(){this.disabled||(this.isOpen=!0)}}};const r=e._export_sfc(t,[["render",function(t,r,l,a,o,i){return e.e({a:l.filterable},l.filterable?{b:o.currentValue?i.currentLabel:l.placeholder,c:l.fontSize+"px",d:o.currentValue?l.textColor:l.placeholderColor,e:e.o$1((()=>{})),f:e.o$1([e=>o.searchQuery=e.detail.value,(...e)=>i.onSearch&&i.onSearch(...e)]),g:e.o$1(((...e)=>i.handleFocus&&i.handleFocus(...e))),h:o.searchQuery}:{i:e.t(i.currentLabel||l.placeholder),j:l.fontSize+"px",k:o.currentValue?l.textColor:l.placeholderColor},{l:l.clearable&&o.currentValue&&!l.disabled},l.clearable&&o.currentValue&&!l.disabled?{m:e.o$1(((...e)=>i.clearValue&&i.clearValue(...e)))}:{n:l.placeholderColor},{o:o.isOpen?1:"",p:o.currentValue?"":1,q:l.height+"px",r:l.backgroundColor,s:l.borderColor,t:l.borderRadius+"px",v:e.o$1(((...e)=>i.togglePicker&&i.togglePicker(...e))),w:o.isOpen},o.isOpen?e.e({x:e.o$1(((...e)=>i.togglePicker&&i.togglePicker(...e))),y:i.filteredOptions.length>0},i.filteredOptions.length>0?{z:e.f(i.filteredOptions,((t,r,a)=>({a:e.t(t.label),b:t.value,c:t.disabled?1:"",d:o.currentValue===t.value?1:"",e:t.disabled?l.placeholderColor:l.textColor,f:o.currentValue===t.value?l.activeColor+"20":l.backgroundColor,g:e.o$1((e=>i.selectOption(t,r)),t.value)}))),A:l.fontSize+"px"}:{B:l.fontSize+"px",C:l.placeholderColor},{D:l.backgroundColor,E:l.borderRadius+"px"}):{},{F:l.disabled?1:""})}],["__scopeId","data-v-d04a81ad"]]);wx.createComponent(r);
