import{n as f,Z as m,L as g}from"./index.8c202964.js";import{r as u,c as b}from"./framework.e8f655c8.js";const k={__name:"FlexBtn",props:{value:{type:[String,Number]},label:{type:String},valueKey:{type:[String,Function],default:"value"},labelKey:{type:[String,Function],default:"label"},placeholderNum:{type:Number,default:8},options:Array,btnWidth:{type:String,default:"126px"},btnHeight:{type:String,default:"40px"},contentHeight:{type:String,default:"auto"}},emits:["input","change"],setup(c,{emit:e}){const n=c;function l(r,i){return m(r)?r(i):i[r]}function a(r){const i=l(n.valueKey,r);e("input",i),i!==n.value&&e("change",i)}return{__sfc:!0,props:n,emits:e,getVal:l,handleItemClick:a}}};var x=function(){var e=this,n=e._self._c,l=e._self._setupProxy;return n("div",{staticClass:"flex-btn-wrap scrollbar-default",style:{height:e.contentHeight}},[e.label?n("p",{staticClass:"label"},[e._v(e._s(e.label))]):e._e(),n("div",{staticClass:"flex-btn flex-wrap"},[e._l(e.options,function(a,r){return n("span",{directives:[{name:"title",rawName:"v-title.overflow",value:l.getVal(e.labelKey,a),expression:"getVal(labelKey, btn)",modifiers:{overflow:!0}}],key:r,staticClass:"btn-item text-ellipsis text-center pointer",class:{active:l.getVal(e.valueKey,a)===e.value},style:{width:e.btnWidth,height:e.btnHeight,lineHeight:e.btnHeight},on:{click:function(i){return l.handleItemClick(a)}}},[e._v(" "+e._s(l.getVal(e.labelKey,a))+" ")])}),e._l(e.placeholderNum,function(a){return n("i",{key:a+"_",staticClass:"placeholder"})})],2)])},C=[],S=f(k,x,C,!1,null,"8c9692dc",null,null);const $=S.exports;const F={name:"SplitLine"};var K=function(){var e=this,n=e._self._c;return n("div",{staticClass:"split-line"})},H=[],w=f(F,K,H,!1,null,"b3e6d734",null,null);const N=w.exports;function A(c){c=c.map(t=>(t.disabled=!1,t));const e=u(!0),n=u(c),l=u([]),a=b(()=>e.value?!1:n.value.some(t=>t.checked));function r(){e.value=n.value.every(t=>t.checked),o()}function i(t){n.value.forEach(s=>s.checked=t),o()}function o(){const[t]=n.value;t.disabled=n.value.every(s=>!s.checked),t.disabled&&(t.checked=!0)}function _(){return g(l.value)?n.value.filter(t=>l.value.includes(t.key)):n.value.filter(t=>t.checked)}function d(){return n.value.filter(t=>t.checked).map(t=>t.key)}function p(t){return _().reduce((s,h)=>{const{key:y}=h;return s[y]=t,s},{})}function v(t){return _().map(s=>({keyword:t,field:s.key,relation:"must",match:"fuzzy"}))}return{refCheckOptions:n,checkAll:e,indeterminate:a,checkItemChange:r,handleCheckAllChange:i,getLenovoSearchParams:p,getLenovoSearchHistoryParams:v,selectFields:l,getCheckedKeys:d}}export{$ as F,N as S,A as u};
