@scvzerng/element-plus-search-vue2 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (function(h,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("lodash-unified"),require("vue"),require("@element-plus/icons-vue"),require("@scvzerng/icons"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","lodash-unified","vue","@element-plus/icons-vue","@scvzerng/icons","@vueuse/core"],d):(h=typeof globalThis<"u"?globalThis:h||self,d(h.ElementPlusSearch={},h.lodashUnified,h.vue,h.iconsVue,h.icons,h.core))})(this,(function(h,d,e,w,L,B){"use strict";const E={class:"tags-scroll-container"},A=["innerHTML"],D=e.defineComponent({name:"SearchTags",__name:"SearchTagsRender",props:{tags:{}},setup(n){const t=e.ref(),r=()=>{t.value.scrollBy({left:-200,behavior:"smooth"})},i=()=>{t.value.scrollBy({left:200,behavior:"smooth"})};return(s,o)=>{const f=e.resolveComponent("el-icon"),c=e.resolveComponent("el-tag");return e.openBlock(),e.createElementBlock("div",E,[e.createVNode(c,{type:"info",class:"scroll-left-bar",onClick:r},{default:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(e.unref(w.ArrowLeft))]),_:1}),o[0]||(o[0]=e.createElementVNode("i",{class:"el-icon-arrow-left"},null,-1))]),_:1}),e.createElementVNode("div",{ref_key:"scrollContainer",ref:t,class:"search-tags"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.tags,p=>(e.openBlock(),e.createBlock(c,{class:"search-tag",onClose:()=>p.clean(),closable:!p.required,type:p.required?"primary":"info",key:p.field},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(p.label),1),o[1]||(o[1]=e.createTextVNode(": ",-1)),e.createElementVNode("span",{innerHTML:p.valueText},null,8,A)]),_:2},1032,["onClose","closable","type"]))),128))],512),e.createVNode(c,{type:"info",class:"scroll-right-bar",onClick:i},{default:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(e.unref(w.ArrowRight))]),_:1})]),_:1})])}}}),V=6;class q{field;label;value;required;index;visible;disabled;span;initValue;enable;tagFilter;render;transform;constructor(t,r){this.field=t.field,this.label=t.label,this.value=t.initValue,this.required=t.required,this.initValue=t.initValue,this.index=r,this.visible=t.visible??!0,this.span=t.span??V,this.render=t.render,this.tagFilter=t.tagFilter,this.transform=t.transform,this.enable=t.enable??!0,this.disabled=t.disabled??!1}clean(){Array.isArray(this.value)?this.value=[]:this.value=void 0}reset(){this.value=this.initValue}isEnable(t){return d.isFunction(this.enable)?this.enable(t.getSearchObject()):this.enable}isDisabled(t){return d.isFunction(this.disabled)?this.disabled(t.getSearchObject()):this.disabled}}class _{field;span;index;visible;constructor(t,r,i,s){this.field=t,this.span=r,this.index=i,this.visible=s}static fromSearchItem(t,r){return new _(t.field,t.span,r??t.index,t.visible)}static formSearchConfig(t,r){return new _(t.field,t.span??V,r??t,t.visible??!0)}static fromString(t){const[r,i,s,o]=t.split("_");return new _(i,Number(s),Number(r),o==="true")}toString(){return`${this.index}_${this.field}_${this.span}_${this.visible}`}merge(t){this.span=t.span,this.index=t.index,this.visible=t.visible}}const N=n=>`searches_layouts_${n}`;class ${id;state;itemLayouts;initialLayouts;constructor(t,r){this.id=t.id,this.initialLayouts=r,this.state=t,this.itemLayouts=d.keyBy(t.items.map(_.fromSearchItem),i=>i.field),this.restoreCachedLayouts()}restoreCachedLayouts(){const t=localStorage.getItem(N(this.id));t&&t.split(",").forEach(r=>{const i=_.fromString(r),s=this.itemLayouts[i.field];s&&s.merge(i)})}sync(t,r){if(t.length!==Object.keys(this.itemLayouts).length)throw new Error("同步布局字段数量不一致");t.forEach((i,s)=>{const o=this.itemLayouts[i];o.index=s,o.visible=r.has(i)})}persistent(){localStorage.setItem(N(this.id),Object.values(this.itemLayouts).map(t=>t.toString()).join(",")),this.state.updateTags()}reset(){this.initialLayouts.forEach(t=>{const r=this.itemLayouts[t.field];r&&r.merge(t)})}}const j=[{isApply(n){return n.contains("el-radio-group")},getText(n){return n.querySelector(".is-active")?.querySelector("input")?.value}},{isApply(n){return n.contains("el-checkbox-group")},getText(n){const t=Array.from(n.querySelectorAll(".el-checkbox__input.is-checked")??[]).map(r=>r.querySelector("input")?.value).filter(r=>r);return t.length===1?t[0]:`${t[0]} 等${t.length}条`}},{isApply(n){return n.contains("el-input")},getText(n,t){return t.value}},{isApply(n){return n.contains("el-input-number")},getText(n,t){return t.value}},{isApply(n){return n.contains("el-select")},getText(n,t){const r=n.querySelectorAll(".el-select__tags-text");return r.length>0?t.value.length>1?`${r[0].textContent} 等${t.value.length}条`:r[0].textContent:n.querySelector(".el-select__placeholder")?.innerHTML}},{isApply(n){return n.contains("el-cascader")},getText(n){return n.querySelector("input")?.value}},{isApply(n){return n.contains("el-switch")},getText(n){return n.querySelector(".is-active").innerHTML}},{isApply(n){return n.contains("el-slider")},getText(n,t){return t.value}},{isApply(n){return n.contains("el-date-editor")},getText(n,t){return t.value?t.value.join(" ~ "):t.value}}];class T{id;field;value;label;valueText;required;item;state;constructor(t,r){this.id=`#${t.id}-${r.field}`,this.state=t,this.field=r.field,this.value=r.value,this.label=r.label,this.item=r,this.required=r.required??!1,this.updateValueText()}static hasValue(t){return d.isNumber(t.value)||d.isBoolean(t.value)?!0:!d.isEmpty(t.value)}updateValueText(){const t=document.querySelector(this.id);if(t.children.length!==1)throw new Error("holder children length is not 1");const r=t.children[0],i=j.find(s=>s.isApply(r.classList));i&&(this.valueText=i.getText(r,this))}async clean(){this.item.clean(),await this.state.doSearch()}}class O{constructor(t,r,i){this.id=t,this.id=t,this.items=r.map((s,o)=>new q(s,o)),this.config=e.reactive(new $(this,r.map((s,o)=>_.formSearchConfig(s,o)))),this.sourceSearchable=r,this.searching=!1,this.searchCallback=i,this.tags=[]}items;config;searching;tags;searchCallback;sourceSearchable;_lastSearchObject={time:0,data:null};updateTags(){this.tags=this.items.filter(t=>t.tagFilter?t.tagFilter(t.value):T.hasValue(t)).map(t=>new T(this,t)).sort((t,r)=>this.config.itemLayouts[t.field].index-this.config.itemLayouts[r.field].index)}getSearchObject(t){const r=Date.now();return this._lastSearchObject.data&&r-this._lastSearchObject.time<50?this._lastSearchObject.data:(this._lastSearchObject={time:r,data:x.from(this.items).toCondition(t)},this._lastSearchObject.data)}async doSearch(){if(!this.searching)try{this.searching=!0,await this.searchCallback(this.getSearchObject()),this.updateTags()}finally{this.searching=!1}}async reset(t){this.items.forEach(r=>r.reset()),t&&await this.doSearch()}setSearchValue(t,r){const i=this.items.find(s=>s.field===t);i&&(i.value=r)}}const R=({search:n,api:t})=>{const r=n.render(n);return r.props||(r.props={}),n.isDisabled(t)&&(r.props.disabled=!0),r},F=()=>{const n=e.shallowRef(),t=e.ref(),r=e.ref([]),i=e.ref(!1),s=e.ref(),o=e.ref([]),f=e.ref(300),c=a=>{n.value=a,r.value=[{label:"全部",id:"all",children:n.value.items.sort((u,m)=>a.config.itemLayouts[u.field].index-a.config.itemLayouts[m.field].index).map(u=>({label:u.label,id:u.field,disabled:!u.isEnable(a)}))}],s.value=d.chain(a.config.itemLayouts).pickBy(u=>u.visible).keys().value()};return{treeRef:t,visible:i,snapshot:r,defaultCheckedKeys:s,drawerWidth:f,updateSnapshot:c,show:a=>{c(a),i.value=!0},save:()=>{n.value.config.sync(r.value[0].children.map(a=>a.id),new Set(t.value.getCheckedKeys())),n.value.config.persistent()},reset:()=>{n.value.config.reset(),c(n.value)},keepSelection:()=>{o.value=t.value.getCheckedKeys()},restoreSelection:()=>{t.value.setCheckedKeys(o.value),o.value=[]},allowDrop:(a,u,m)=>m!=="inner",allowDrag:a=>!a.disabled}},H=e.defineComponent({__name:"SearchSettingsDrawer",setup(n,{expose:t}){const{treeRef:r,visible:i,snapshot:s,drawerWidth:o,defaultCheckedKeys:f,show:c,allowDrop:p,allowDrag:C,keepSelection:S,restoreSelection:k,save:y,reset:l}=F();return t({show:c}),(b,a)=>{const u=e.resolveComponent("el-tree"),m=e.resolveComponent("el-button"),g=e.resolveComponent("el-drawer");return e.openBlock(),e.createBlock(g,{class:"search-setting",size:e.unref(o),title:"搜索项配置",modelValue:e.unref(i),"onUpdate:modelValue":a[0]||(a[0]=v=>e.isRef(i)?i.value=v:null)},{footer:e.withCtx(()=>[e.createVNode(m,{onClick:e.unref(l)},{default:e.withCtx(()=>[...a[1]||(a[1]=[e.createTextVNode("重置",-1)])]),_:1},8,["onClick"]),e.createVNode(m,{type:"primary",onClick:e.unref(y)},{default:e.withCtx(()=>[...a[2]||(a[2]=[e.createTextVNode("保存",-1)])]),_:1},8,["onClick"])]),default:e.withCtx(()=>[e.createVNode(u,{class:"tree","default-expand-all":"","default-checked-keys":e.unref(f),"node-key":"id",ref_key:"treeRef",ref:r,draggable:"","show-checkbox":"",data:e.unref(s),onNodeDragStart:e.unref(S),onNodeDragEnd:e.unref(k),"allow-drop":e.unref(p),"allow-drag":e.unref(C)},null,8,["default-checked-keys","data","onNodeDragStart","onNodeDragEnd","allow-drop","allow-drag"])]),_:1},8,["size","modelValue"])}}}),K=e.defineComponent({__name:"SettingButton",props:{state:{}},setup(n){const t=n,r=e.ref(),i=()=>{r.value.show(t.state)};return(s,o)=>{const f=e.resolveComponent("el-icon"),c=e.resolveComponent("el-button");return e.openBlock(),e.createBlock(c,{class:"icon-button",onClick:i},{default:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(e.unref(L.Setting))]),_:1}),e.createVNode(H,{ref_key:"searchSettingDialogRef",ref:r},null,512)]),_:1})}}}),z={class:"search-bar-container"},M={class:"search-item"},I={class:"search-item-title"},P=["id"],G={class:"search-bottom"},W={class:"actions"},X=e.defineComponent({__name:"SearchBar",props:{searches:{},id:{},onSearch:{},defaultSpan:{default:6},maxRows:{default:2},itemHeight:{default:67},resetAutoSearch:{type:Boolean,default:!0}},emits:["change"],setup(n,{expose:t,emit:r}){const i=n,s=e.reactive(new O(i.id,i.searches,i.onSearch)),o=e.ref(!1),f=e.computed(()=>d.sum(Array.from(Object.values(s.config.itemLayouts)).filter(l=>l.visible).map(l=>l.span))/24>i.maxRows),c=e.ref([]),p=r;B.watchDebounced(()=>s.items,()=>{const y=[...s.items];c.value=y.sort((l,b)=>s.config.itemLayouts[l.field].index-s.config.itemLayouts[b.field].index).filter(l=>s.config.itemLayouts[l.field].visible).filter(l=>l.isEnable(s)),p("change",s.getSearchObject(),s)},{debounce:100,immediate:!0,deep:!0});const C=e.computed(()=>({height:`${i.itemHeight*i.maxRows}px`,overflow:"hidden"})),S=y=>s.config.itemLayouts[y.field];return t({getSearchItems:()=>s.items}),(y,l)=>{const b=e.resolveComponent("el-col"),a=e.resolveComponent("el-row"),u=e.resolveComponent("el-icon"),m=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",z,[e.createVNode(a,{class:e.normalizeClass("search"),style:e.normalizeStyle(f.value&&!o.value?C.value:{}),gutter:16},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,g=>e.withDirectives((e.openBlock(),e.createBlock(b,{span:S(g).span,key:g.field},{default:e.withCtx(()=>[e.createElementVNode("div",M,[e.createElementVNode("div",I,e.toDisplayString(g.label),1),e.createElementVNode("div",{id:`${n.id}-${g.field}`,class:"search-item-content"},[e.createVNode(e.unref(R),{search:g,api:s},null,8,["search","api"])],8,P)])]),_:2},1032,["span"])),[[e.vShow,S(g).visible]])),128))]),_:1},8,["style"]),e.createElementVNode("div",G,[s.tags.length>0?(e.openBlock(),e.createBlock(D,{key:0,tags:s.tags},null,8,["tags"])):e.createCommentVNode("",!0),e.createElementVNode("div",W,[f.value?(e.openBlock(),e.createBlock(m,{key:0,class:"icon-button",onClick:l[0]||(l[0]=g=>o.value=!o.value)},{default:e.withCtx(()=>[e.createVNode(u,null,{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createBlock(e.unref(w.ArrowUp),{key:1})):(e.openBlock(),e.createBlock(e.unref(w.ArrowDown),{key:0}))]),_:1})]),_:1})):e.createCommentVNode("",!0),e.createVNode(K,{state:s},null,8,["state"]),e.createVNode(m,{onClick:l[1]||(l[1]=()=>s.reset(n.resetAutoSearch))},{default:e.withCtx(()=>[...l[3]||(l[3]=[e.createTextVNode("重 置",-1)])]),_:1}),e.createVNode(m,{type:"primary",loading:s.searching,disabled:s.searching,onClick:l[2]||(l[2]=()=>s.doSearch())},{default:e.withCtx(()=>[...l[4]||(l[4]=[e.createTextVNode("搜 索",-1)])]),_:1},8,["loading","disabled"])])])])}}});class x{record;constructor(t){this.record=t}static from(t){const r=t.filter(i=>i.value===void 0?!1:Array.isArray(i.value)?i.value.length>0:!0).reduce((i,s)=>{const o=s.transform?s.transform(s.value):s.value;return{...i,...d.isPlainObject(o)?o:{[s.field]:o}}},{});return new x(r)}transform(t,r){const i=this.record[t],s=r(i);return delete this.record[t],this.record={...this.record,...s},this}toCondition(t){return{...this.record,...t}}}h.SearchBar=X,h.Searches=x,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(u,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("lodash-unified"),require("vue"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","lodash-unified","vue","@vueuse/core"],o):(u=typeof globalThis<"u"?globalThis:u||self,o(u.ElementPlusSearch={},u.lodashUnified,u.vue,u.core))})(this,function(u,o,l,A){"use strict";const F=r=>({model:{value:o.get(r,"value"),callback:e=>{o.set(r,"value",e)}}}),R=l.defineComponent({name:"SearchTags"}),j=l.defineComponent({...R,props:{tags:null},setup(r){const e=r,t=l.ref();return{__sfc:!0,props:e,scrollContainer:t,scrollLeft:()=>{t.value.scrollBy({left:-200,behavior:"smooth"})},scrollRight:()=>{t.value.scrollBy({left:200,behavior:"smooth"})}}}});function C(r,e,t,s,i,a,p,h){var d=typeof r=="function"?r.options:r;return e&&(d.render=e,d.staticRenderFns=t,d._compiled=!0),a&&(d._scopeId="data-v-"+a),{exports:r,options:d}}var q=function(){var e=this,t=e._self._c,s=e._self._setupProxy;return t("div",{staticClass:"tags-scroll-container"},[t("el-tag",{staticClass:"scroll-left-bar",attrs:{size:"medium",type:"info"},on:{click:s.scrollLeft}},[t("i",{staticClass:"el-icon-arrow-left"})]),t("div",{ref:"scrollContainer",staticClass:"search-tags"},e._l(e.tags,function(i){return t("el-tag",{key:i.field,staticClass:"search-tag",attrs:{size:"medium",closable:!i.required,type:i.required?"primary":"info"},on:{close:()=>i.clean()}},[t("span",[e._v(" "+e._s(i.label)+" ")]),e._v(": "),t("span",{domProps:{innerHTML:e._s(i.valueText)}})])}),1),t("el-tag",{staticClass:"scroll-right-bar",attrs:{size:"medium",type:"info"},on:{click:s.scrollRight}},[t("i",{staticClass:"el-icon-arrow-right"})])],1)},k=[],E=C(j,q,k,!1,null,null);const B=E.exports;var N=Object.defineProperty,V=(r,e,t)=>e in r?N(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,c=(r,e,t)=>V(r,typeof e!="symbol"?e+"":e,t);const O=6;class I{constructor(e,t){c(this,"field"),c(this,"label"),c(this,"value"),c(this,"required"),c(this,"index"),c(this,"visible"),c(this,"disabled"),c(this,"span"),c(this,"initValue"),c(this,"enable"),c(this,"tagFilter"),c(this,"render"),c(this,"transform");var s,i,a,p;this.field=e.field,this.label=e.label,this.value=e.initValue,this.required=e.required,this.initValue=e.initValue,this.index=t,this.visible=(s=e.visible)!=null?s:!0,this.span=(i=e.span)!=null?i:O,this.render=e.render,this.tagFilter=e.tagFilter,this.transform=e.transform,this.enable=(a=e.enable)!=null?a:!0,this.disabled=(p=e.disabled)!=null?p:!1}clean(){Array.isArray(this.value)?this.value=[]:this.value=void 0}reset(){this.value=this.initValue}isEnable(e){return o.isFunction(this.enable)?this.enable(e.getSearchObject()):this.enable}isDisabled(e){return o.isFunction(this.disabled)?this.disabled(e.getSearchObject()):this.disabled}}var K=Object.defineProperty,H=(r,e,t)=>e in r?K(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,_=(r,e,t)=>H(r,typeof e!="symbol"?e+"":e,t);class g{constructor(e,t,s,i){_(this,"field"),_(this,"span"),_(this,"index"),_(this,"visible"),this.field=e,this.span=t,this.index=s,this.visible=i}static fromSearchItem(e,t){return new g(e.field,e.span,t??e.index,e.visible)}static formSearchConfig(e,t){var s,i;return new g(e.field,(s=e.span)!=null?s:O,t??e,(i=e.visible)!=null?i:!0)}static fromString(e){const[t,s,i,a]=e.split("_");return new g(s,Number(i),Number(t),a==="true")}toString(){return`${this.index}_${this.field}_${this.span}_${this.visible}`}merge(e){this.span=e.span,this.index=e.index,this.visible=e.visible}}const D=r=>`searches_layouts_${r}`;class M{constructor(e,t){_(this,"id"),_(this,"state"),_(this,"itemLayouts"),_(this,"initialLayouts"),this.id=e.id,this.initialLayouts=t,this.state=e,this.itemLayouts=o.keyBy(e.items.map(g.fromSearchItem),s=>s.field),this.restoreCachedLayouts()}restoreCachedLayouts(){const e=localStorage.getItem(D(this.id));e&&e.split(",").forEach(t=>{const s=g.fromString(t),i=this.itemLayouts[s.field];i&&i.merge(s)})}sync(e,t){if(e.length!==Object.keys(this.itemLayouts).length)throw new Error("同步布局字段数量不一致");e.forEach((s,i)=>{const a=this.itemLayouts[s];a.index=i,a.visible=t.has(s)})}persistent(){localStorage.setItem(D(this.id),Object.values(this.itemLayouts).map(e=>e.toString()).join(",")),this.state.updateTags()}reset(){this.initialLayouts.forEach(e=>{const t=this.itemLayouts[e.field];t&&t.merge(e)})}}var z=Object.defineProperty,W=(r,e,t)=>e in r?z(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,v=(r,e,t)=>W(r,typeof e!="symbol"?e+"":e,t);const G=[{isApply(r){return r.contains("el-radio-group")},getText(r){var e,t;return(t=(e=r.querySelector(".is-active"))==null?void 0:e.querySelector("input"))==null?void 0:t.value}},{isApply(r){return r.contains("el-checkbox-group")},getText(r){var e;const t=Array.from((e=r.querySelectorAll(".el-checkbox__input.is-checked"))!=null?e:[]).map(s=>{var i;return(i=s.querySelector("input"))==null?void 0:i.value}).filter(s=>s);return t.length===1?t[0]:`${t[0]} 等${t.length}条`}},{isApply(r){return r.contains("el-input")},getText(r,e){return e.value}},{isApply(r){return r.contains("el-input-number")},getText(r,e){return e.value}},{isApply(r){return r.contains("el-select")},getText(r,e){var t;const s=r.querySelectorAll(".el-select__tags-text");return s.length>0?e.value.length>1?`${s[0].textContent} 等${e.value.length}条`:s[0].textContent:(t=r.querySelector("input"))==null?void 0:t.value}},{isApply(r){return r.contains("el-cascader")},getText(r){var e;return(e=r.querySelector("input"))==null?void 0:e.value}},{isApply(r){return r.contains("el-switch")},getText(r){return r.querySelector(".is-active").innerHTML}},{isApply(r){return r.contains("el-slider")},getText(r,e){return e.value}},{isApply(r){return r.contains("el-date-editor")},getText(r,e){return e.value?e.value.join(" ~ "):e.value}}];class P{constructor(e,t){v(this,"id"),v(this,"field"),v(this,"value"),v(this,"label"),v(this,"valueText"),v(this,"required"),v(this,"item"),v(this,"state");var s;this.id=`#${e.id}-${t.field}`,this.state=e,this.field=t.field,this.value=t.value,this.label=t.label,this.item=t,this.required=(s=t.required)!=null?s:!1,this.updateValueText()}static hasValue(e){return o.isNumber(e.value)||o.isBoolean(e.value)?!0:!o.isEmpty(e.value)}updateValueText(){const e=document.querySelector(this.id);if(e.children.length!==1)throw new Error("holder children length is not 1");const t=e.children[0],s=G.find(i=>i.isApply(t.classList));s&&(this.valueText=s.getText(t,this))}async clean(){this.item.clean(),await this.state.doSearch()}}var X=Object.defineProperty,J=(r,e,t)=>e in r?X(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,m=(r,e,t)=>J(r,typeof e!="symbol"?e+"":e,t);class Q{constructor(e,t,s){this.id=e,m(this,"items"),m(this,"config"),m(this,"searching"),m(this,"tags"),m(this,"searchCallback"),m(this,"sourceSearchable"),m(this,"_lastSearchObject",{time:0,data:null}),this.id=e,this.items=t.map((i,a)=>new I(i,a)),this.config=new M(this,t.map((i,a)=>g.formSearchConfig(i,a))),this.sourceSearchable=t,this.searching=!1,this.searchCallback=s,this.tags=[]}updateTags(){this.tags=this.items.filter(e=>e.tagFilter?e.tagFilter(e.value):P.hasValue(e)).map(e=>new P(this,e)).sort((e,t)=>this.config.itemLayouts[e.field].index-this.config.itemLayouts[t.field].index)}getSearchObject(e){const t=Date.now();return this._lastSearchObject.data&&t-this._lastSearchObject.time<50?this._lastSearchObject.data:(this._lastSearchObject={time:t,data:$.from(this.items).toCondition(e)},this._lastSearchObject.data)}async doSearch(){if(!this.searching)try{this.searching=!0,await this.searchCallback(this.getSearchObject()),this.updateTags()}finally{this.searching=!1}}async reset(e){this.items.forEach(t=>t.reset()),e&&await this.doSearch()}setSearchValue(e,t){const s=this.items.find(i=>i.field===e);s&&(s.value=t)}}const Y={functional:!0,props:{search:{type:Object,required:!0},api:{type:Object}},render(r,e){const{props:t}=e,s=t.search.render(t.search);return s.componentOptions.propsData||(s.componentOptions.propsData={}),s.componentOptions.propsData.disabled=t.search.isDisabled(t.api),s}},Z=()=>{const r=l.shallowRef(),e=l.ref(),t=l.ref([]),s=l.ref(!1),i=l.ref(),a=l.ref([]),p=l.ref(300),h=n=>{r.value=n,t.value=[{label:"全部",id:"all",children:r.value.items.sort((f,T)=>n.config.itemLayouts[f.field].index-n.config.itemLayouts[T.field].index).map(f=>({label:f.label,id:f.field,disabled:!f.isEnable(n)}))}],i.value=o.chain(n.config.itemLayouts).pickBy(f=>f.visible).keys().value()};return{treeRef:e,visible:s,snapshot:t,defaultCheckedKeys:i,drawerWidth:p,updateSnapshot:h,show:n=>{h(n),s.value=!0},save:()=>{r.value.config.sync(t.value[0].children.map(n=>n.id),new Set(e.value.getCheckedKeys())),r.value.config.persistent()},reset:()=>{r.value.config.reset(),h(r.value)},keepSelection:()=>{a.value=e.value.getCheckedKeys()},restoreSelection:()=>{e.value.setCheckedKeys(a.value),a.value=[]},allowDrop:(n,f,T)=>T!=="inner",allowDrag:n=>!n.disabled}},U=l.defineComponent({__name:"SearchSettingsDrawer",setup(r,{expose:e}){const{treeRef:t,visible:s,snapshot:i,drawerWidth:a,defaultCheckedKeys:p,show:h,allowDrop:d,allowDrag:L,keepSelection:y,restoreSelection:S,save:w,reset:x}=Z();return e({show:h}),{__sfc:!0,treeRef:t,visible:s,snapshot:i,drawerWidth:a,defaultCheckedKeys:p,show:h,allowDrop:d,allowDrag:L,keepSelection:y,restoreSelection:S,save:w,reset:x}}});var ee=function(){var e=this,t=e._self._c,s=e._self._setupProxy;return t("el-drawer",{attrs:{size:s.drawerWidth,title:"搜索项配置",visible:s.visible},on:{"update:visible":function(i){s.visible=i}}},[t("div",{staticClass:"setting-container"},[t("el-tree",{ref:"treeRef",staticClass:"tree",attrs:{"default-expand-all":"","default-checked-keys":s.defaultCheckedKeys,"node-key":"id",draggable:"","show-checkbox":"",data:s.snapshot,"allow-drop":s.allowDrop,"allow-drag":s.allowDrag},on:{"node-drag-start":s.keepSelection,"node-drag-end":s.restoreSelection}}),t("div",{staticClass:"footer"},[t("el-button",{on:{click:s.reset}},[e._v("重置")]),t("el-button",{attrs:{type:"primary"},on:{click:s.save}},[e._v("保存")])],1)],1)])},te=[],se=C(U,ee,te,!1,null,null);const re=se.exports,ie=l.defineComponent({__name:"SettingButton",props:{state:null},setup(r){const e=r,t=l.ref();return{__sfc:!0,props:e,searchSettingDialogRef:t,showSearchLayoutDialog:()=>{t.value.show(e.state)},SearchSettingsDrawer:re}}});var ae=function(){var e=this,t=e._self._c,s=e._self._setupProxy;return t("div",{staticStyle:{"margin-right":"10px"}},[t("el-button",{staticClass:"icon-button",staticStyle:{height:"100%"},on:{click:s.showSearchLayoutDialog}},[t("i",{staticClass:"el-icon-s-tools"})]),t(s.SearchSettingsDrawer,{ref:"searchSettingDialogRef"})],1)},ne=[],le=C(ie,ae,ne,!1,null,"61aa7563");const oe=le.exports,ce=l.defineComponent({__name:"SearchBar",props:{searches:null,id:null,onSearch:{type:Function},defaultSpan:{default:6},maxRows:{default:2},itemHeight:{default:67},resetAutoSearch:{type:Boolean,default:!0}},emits:["change"],setup(r,{expose:e,emit:t}){const s=r,i=l.reactive(new Q(s.id,s.searches,s.onSearch)),a=l.ref(!1),p=l.computed(()=>o.sum(Array.from(Object.values(i.config.itemLayouts)).filter(n=>n.visible).map(n=>n.span))/24>s.maxRows),h=l.ref([]);A.watchDebounced(()=>i.items,()=>{const b=[...i.items];h.value=b.sort((n,f)=>i.config.itemLayouts[n.field].index-i.config.itemLayouts[f.field].index).filter(n=>i.config.itemLayouts[n.field].visible).filter(n=>n.isEnable(i)),t("change",i.getSearchObject(),i)},{debounce:100,immediate:!0,deep:!0});const d=l.computed(()=>({height:`${s.itemHeight*s.maxRows}px`,overflow:"hidden"})),L=b=>i.config.itemLayouts[b.field],y=()=>i.items,S=()=>i.getSearchObject(),w=b=>{i.searching=b},x=()=>{i.updateTags()};return e({getSearchItems:y,getSearchObject:S,updateSearching:w,updateTags:x}),{__sfc:!0,props:s,state:i,expanded:a,isShowSpanIcon:p,sortedItems:h,emits:t,itemHeightStyle:d,getLayout:L,getSearchItems:y,getSearchObject:S,updateSearching:w,updateTags:x,SearchTagsRender:B,SearchItemRender:Y,SettingButton:oe}}});var ue=function(){var e=this,t=e._self._c,s=e._self._setupProxy;return t("div",{staticClass:"search-bar-container"},[t("el-row",{class:"search",style:s.isShowSpanIcon&&!s.expanded?s.itemHeightStyle:{},attrs:{gutter:16}},e._l(s.sortedItems,function(i){return t("el-col",{directives:[{name:"show",rawName:"v-show",value:s.getLayout(i).visible,expression:"getLayout(item).visible"}],key:i.field,attrs:{span:s.getLayout(i).span}},[t("div",{staticClass:"search-item"},[t("div",{staticClass:"search-item-title"},[e._v(e._s(i.label))]),t("div",{staticClass:"search-item-content",attrs:{id:`${e.id}-${i.field}`}},[t(s.SearchItemRender,{attrs:{search:i,api:s.state}})],1)])])}),1),t("div",{staticClass:"search-bottom"},[s.state.tags.length>0?t(s.SearchTagsRender,{attrs:{tags:s.state.tags}}):e._e(),t("div",{staticClass:"actions"},[s.isShowSpanIcon?t("el-button",{staticClass:"icon-button",staticStyle:{"margin-right":"10px"},on:{click:function(i){s.expanded=!s.expanded}}},[t("i",{class:[s.expanded?"el-icon-arrow-up":"el-icon-arrow-down"]})]):e._e(),t(s.SettingButton,{attrs:{state:s.state}}),t("el-button",{attrs:{type:"primary",loading:s.state.searching,disabled:s.state.searching},on:{click:()=>s.state.doSearch()}},[e._v("查 询")]),t("el-button",{on:{click:()=>s.state.reset(e.resetAutoSearch)}},[e._v("重 置")])],1)],1)],1)},he=[],de=C(ce,ue,he,!1,null,null);const fe=de.exports;var pe=Object.defineProperty,_e=(r,e,t)=>e in r?pe(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ve=(r,e,t)=>_e(r,e+"",t);const ge=(r,e,t)=>({refreshCallback:async s=>{const i=e.value.getSearchObject();try{return e.value.updateSearching(!0),await r(i,s)}finally{e.value.updateSearching(!1),e.value.updateTags()}},searchCallback:async()=>{var s;for(const i of t)await((s=i.value)==null?void 0:s.refresh())}});class ${constructor(e){ve(this,"record"),this.record=e}static from(e){const t=e.filter(s=>s.value===void 0?!1:Array.isArray(s.value)?s.value.length>0:!0).reduce((s,i)=>{const a=i.transform?i.transform(i.value):i.value;return{...s,...o.isPlainObject(a)?a:{[i.field]:a}}},{});return new $(t)}transform(e,t){const s=this.record[e],i=t(s);return delete this.record[e],this.record={...this.record,...i},this}toCondition(e){return{...this.record,...e}}}u.SearchBar=fe,u.Searches=$,u.useSearchProxy=ge,u.vModel=F,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ @charset "UTF-8";.tags-scroll-container{display:flex}.tags-scroll-container .pointer{cursor:pointer}.tags-scroll-container .search-tags{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:10px}.tags-scroll-container .search-tags::-webkit-scrollbar{display:none}.tags-scroll-container .scroll-left-bar{cursor:pointer;margin-right:10px}.tags-scroll-container .scroll-right-bar{cursor:pointer;margin-left:10px}.setting-container{display:flex;flex-direction:column;height:100%}.setting-container .tree{flex:1;overflow-y:auto}.setting-container div[aria-disabled=true]{display:none}.setting-container .footer{margin-top:auto;margin-left:auto;padding:10px 15px;display:flex;gap:10px}.setting-container .footer .el-button{width:90px}.search-bar-container{font-size:14px;width:100%;display:flex;flex-direction:column}.search-bar-container .search,.search-bar-container .el-input-number,.search-bar-container .el-select,.search-bar-container .el-date-editor,.search-bar-container .el-cascader{width:100%}.search-bar-container .search-bottom{display:flex}.search-bar-container .search-bottom .tags-scroll-container{flex:1;min-width:0;margin-right:10px}.search-bar-container .search-bottom .actions{display:flex;margin-left:auto}.search-bar-container .search-bottom .actions .el-button{width:90px}.search-bar-container .search-bottom .actions .icon-button{padding:0 8px;width:34px;font-size:larger}.search-bar-container .search-item{margin-bottom:12px}.search-bar-container .search-item-content{margin-top:4px}.search-bar-container .preview{overflow-x:scroll;overflow-y:hidden}.search-bar-container .scroll-tags{display:flex;align-items:center}.search-bar-container .scroll-tags .left{margin-right:10px}.search-bar-container .scroll-tags .right{margin-left:10px}
@@ -9,7 +9,12 @@ type __VLS_Props = {
9
9
  itemHeight?: number;
10
10
  resetAutoSearch?: boolean;
11
11
  };
12
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
12
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
13
+ defaultSpan: number;
14
+ maxRows: number;
15
+ itemHeight: number;
16
+ resetAutoSearch: boolean;
17
+ }>, {
13
18
  getSearchItems: () => {
14
19
  field: string;
15
20
  label: string;
@@ -29,15 +34,37 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
29
34
  isEnable: (state: SearchBarState) => boolean;
30
35
  isDisabled: (state: SearchBarState) => boolean;
31
36
  }[];
37
+ getSearchObject: () => any;
38
+ updateSearching: (searching: boolean) => void;
39
+ updateTags: () => void;
32
40
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
33
41
  change: (...args: any[]) => void;
34
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
35
- onChange?: ((...args: any[]) => any) | undefined;
36
- }>, {
42
+ }, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
37
43
  defaultSpan: number;
38
44
  maxRows: number;
39
45
  itemHeight: number;
40
46
  resetAutoSearch: boolean;
41
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
42
- declare const _default: typeof __VLS_export;
47
+ }>>>, {
48
+ defaultSpan: number;
49
+ maxRows: number;
50
+ itemHeight: number;
51
+ resetAutoSearch: boolean;
52
+ }>;
43
53
  export default _default;
54
+ type __VLS_WithDefaults<P, D> = {
55
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
56
+ default: D[K];
57
+ }> : P[K];
58
+ };
59
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
60
+ type __VLS_TypePropsToOption<T> = {
61
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
62
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
63
+ } : {
64
+ type: import('vue').PropType<T[K]>;
65
+ required: true;
66
+ };
67
+ };
68
+ type __VLS_PrettifyLocal<T> = {
69
+ [K in keyof T]: T[K];
70
+ } & {};
@@ -1,12 +1,11 @@
1
1
  import { SearchItem } from './model/SearchItem';
2
2
  import { SearchConfig } from './model/SearchConfig';
3
3
  import { SearchTag } from './model/SearchTag';
4
- import { Reactive } from 'vue';
5
4
  import { Searchable } from './types/Searchable';
6
5
  export declare class SearchBarState {
7
6
  id: string;
8
7
  items: SearchItem[];
9
- config: Reactive<SearchConfig>;
8
+ config: SearchConfig;
10
9
  searching: boolean;
11
10
  tags: SearchTag[];
12
11
  searchCallback: <T>(params: T) => Promise<void>;
@@ -1,7 +1,22 @@
1
- import type { FunctionalComponent } from 'vue';
2
1
  import type { SearchItem } from './model/SearchItem';
2
+ import { PropType } from 'vue';
3
3
  import { SearchBarState } from './SearchBarState';
4
- export declare const SearchItemRender: FunctionalComponent<{
5
- search: SearchItem;
6
- api: SearchBarState;
7
- }>;
4
+ declare const _default: {
5
+ functional: boolean;
6
+ props: {
7
+ search: {
8
+ type: PropType<SearchItem>;
9
+ required: boolean;
10
+ };
11
+ api: {
12
+ type: PropType<SearchBarState>;
13
+ };
14
+ };
15
+ render(h: any, context: {
16
+ props: {
17
+ search: SearchItem;
18
+ api: SearchBarState;
19
+ };
20
+ }): import("vue").VNode;
21
+ };
22
+ export default _default;
@@ -1,7 +1,20 @@
1
- import type { SearchTag } from './model/SearchTag';
2
1
  type __VLS_Props = {
3
- tags: SearchTag[];
2
+ tags: ({
3
+ required?: boolean;
4
+ valueText?: string;
5
+ label: string;
6
+ field: string;
7
+ clean: () => void;
8
+ } & any)[];
4
9
  };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
- declare const _default: typeof __VLS_export;
10
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
7
11
  export default _default;
12
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
13
+ type __VLS_TypePropsToOption<T> = {
14
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
15
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
16
+ } : {
17
+ type: import('vue').PropType<T[K]>;
18
+ required: true;
19
+ };
20
+ };
@@ -0,0 +1,14 @@
1
+ import { SearchValueLike } from '../types/SearchValueLike';
2
+ /**
3
+ * vue2 翻译jsx片段时在非组件上下文中会生成this.$set 尝试设置属性导致报错 此时使用此方法绕过生成
4
+ *
5
+ * 此函数为变种专用于search组件
6
+ *
7
+ * @param searchValue
8
+ */
9
+ export declare const vModel: (searchValue: SearchValueLike) => {
10
+ model: {
11
+ value: any;
12
+ callback: (newValue: any) => void;
13
+ };
14
+ };
@@ -1,9 +1,33 @@
1
1
  import { TransformCallback } from './types/Searchable';
2
2
  import { SearchValueLike } from './types/SearchValueLike';
3
+ export * from "./helper/vModel";
3
4
  export * from "./types/Searchable";
5
+ import { Ref } from 'vue';
6
+ export * from './types/Searchable';
4
7
  export { default as SearchBar } from './SearchBar.vue';
5
- export type SearchBarInstance = {
8
+ export interface RefreshInstance<SEARCH_OBJECT> {
9
+ refresh: (searchObject?: SEARCH_OBJECT) => void | Promise<void>;
10
+ }
11
+ export declare const useSearchProxy: <C_PARAM, SEARCH_OBJECT, VALUE>(callback: (searchObject: SEARCH_OBJECT, params: C_PARAM) => VALUE, instance: Ref<SearchBarInstance<SEARCH_OBJECT>>, refreshInstance: Ref<RefreshInstance<SEARCH_OBJECT>>[]) => {
12
+ /**
13
+ * 数据刷新回调代理
14
+ *
15
+ * 填充数据拉取接口的搜索参数
16
+ * @param param
17
+ */
18
+ refreshCallback: (param: C_PARAM) => Promise<VALUE>;
19
+ /**
20
+ * 搜索项搜索按钮点击时触发
21
+ *
22
+ * 回调所有的可刷新组件
23
+ */
24
+ searchCallback: () => Promise<void>;
25
+ };
26
+ export type SearchBarInstance<T> = {
6
27
  getSearchItems(): SearchValueLike[];
28
+ getSearchObject(): T;
29
+ updateSearching(searching: boolean): void;
30
+ updateTags(): void;
7
31
  };
8
32
  export declare class Searches {
9
33
  record: Record<string, any>;
@@ -1,5 +1,4 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {
1
+ declare const _default: import("vue").DefineComponent<{}, {
2
2
  show: (api: import("../SearchBarState").SearchBarState) => void;
3
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
4
- declare const _default: typeof __VLS_export;
3
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
5
4
  export default _default;
@@ -3,6 +3,14 @@ import { SearchBarState } from '../SearchBarState';
3
3
  type __VLS_Props = {
4
4
  state: UnwrapNestedRefs<SearchBarState>;
5
5
  };
6
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
- declare const _default: typeof __VLS_export;
6
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
8
7
  export default _default;
8
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
9
+ type __VLS_TypePropsToOption<T> = {
10
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
11
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
12
+ } : {
13
+ type: import('vue').PropType<T[K]>;
14
+ required: true;
15
+ };
16
+ };
@@ -1,24 +1,14 @@
1
1
  import type { SearchBarState } from '../SearchBarState';
2
- import { TreeInstance } from 'element-plus';
3
- type TreeNode = {
4
- label: string;
5
- id: string;
6
- children?: TreeNode[];
7
- };
8
2
  export declare const useSetting: () => {
9
- treeRef: import("vue").Ref<TreeInstance | undefined, TreeInstance | undefined>;
10
- visible: import("vue").Ref<boolean, boolean>;
3
+ treeRef: import("vue").Ref<any>;
4
+ visible: import("vue").Ref<boolean>;
11
5
  snapshot: import("vue").Ref<{
12
6
  label: string;
13
7
  id: string;
14
8
  children?: /*elided*/ any[] | undefined;
15
- }[], TreeNode[] | {
16
- label: string;
17
- id: string;
18
- children?: /*elided*/ any[] | undefined;
19
9
  }[]>;
20
- defaultCheckedKeys: import("vue").Ref<string[] | undefined, string[] | undefined>;
21
- drawerWidth: import("vue").Ref<number, number>;
10
+ defaultCheckedKeys: import("vue").Ref<string[] | undefined>;
11
+ drawerWidth: import("vue").Ref<number>;
22
12
  updateSnapshot: (api: SearchBarState) => void;
23
13
  show: (api: SearchBarState) => void;
24
14
  save: () => void;
@@ -28,4 +18,3 @@ export declare const useSetting: () => {
28
18
  allowDrop: (_: any, __: any, type: string) => boolean;
29
19
  allowDrag: (node: any) => boolean;
30
20
  };
31
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scvzerng/element-plus-search-vue2",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "scripts": {
@@ -17,7 +17,7 @@
17
17
  "require": "./dist/ElementPlusSearch.umd.js"
18
18
  },
19
19
  "./style": {
20
- "default": "./dist/style.css"
20
+ "default": "./dist/element-plus-search.css"
21
21
  }
22
22
 
23
23
  },
@@ -1 +0,0 @@
1
- @charset "UTF-8";.tags-scroll-container{display:flex}.tags-scroll-container .pointer{cursor:pointer}.tags-scroll-container .search-tags{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:10px}.tags-scroll-container .search-tags::-webkit-scrollbar{display:none}.tags-scroll-container .scroll-left-bar{cursor:pointer;margin-right:10px}.tags-scroll-container .scroll-right-bar{cursor:pointer;margin-left:10px}.search-setting .el-drawer__footer{border-top:var(--el-border);padding:10px}.search-setting .el-drawer__footer .el-button{width:90px}.search-setting .el-drawer__header{margin-bottom:unset;border-bottom:var(--el-border);padding:10px}.search-setting div[aria-disabled=true]{display:none}.search-bar-container{font-size:14px}.search-bar-container .search,.search-bar-container,.search-bar-container .el-input-number,.search-bar-container .el-select,.search-bar-container .el-date-editor,.search-bar-container .el-cascader{width:100%}.search-bar-container{display:flex;flex-direction:column}.search-bar-container .search-bottom{display:flex}.search-bar-container .search-bottom .tags-scroll-container{flex:1;min-width:0;margin-right:10px}.search-bar-container .search-bottom .actions .el-button{width:90px}.search-bar-container .search-bottom .actions{display:flex}.search-bar-container .search-bottom .actions .icon-button{padding:0 8px;width:34px;font-size:larger}.search-bar-container .search-bottom .actions{margin-left:auto}.search-bar-container .search-item{margin-bottom:12px}.search-bar-container .search-item-content{margin-top:4px}.search-bar-container .preview{overflow-x:scroll;overflow-y:hidden}.search-bar-container .scroll-tags{display:flex;align-items:center}.search-bar-container .scroll-tags .left{margin-right:10px}.search-bar-container .scroll-tags .right{margin-left:10px}