eslink-ui-plus
Version:
vue3 component library, css framework
171 lines (170 loc) • 27.3 kB
JavaScript
import{pushScopeId as W,popScopeId as X,defineComponent as J,useCssVars as _e,openBlock as w,createElementBlock as C,normalizeStyle as le,createElementVNode as I,normalizeClass as B,renderSlot as N,createCommentVNode as O,toDisplayString as q,ref as ee,computed as A,resolveComponent as F,createVNode as te,mergeProps as ke,withModifiers as ce,createSlots as Se,withCtx as V,normalizeProps as we,guardReactiveProps as Ee,createBlock as z,createTextVNode as ie,reactive as xe,watch as ne,toRefs as Me}from"vue";import{ElInput as Ce,ElPopover as Te,ElCascaderPanel as $e}from"element-plus";const se={labelKey:"label",valueKey:"value",disabledKey:"disabled",childrenKey:"children"},Ae={type:Object,default:()=>se},Oe={type:Boolean,default:!1},ue=(e=[],r=se,s=null,v={},f={})=>{const{valueKey:d,labelKey:i,childrenKey:t}=r;return e.length?(e.forEach(o=>{var c;const l=o[d],k=o[i];o.parent=s,o.path=s?[...s.path,l]:[l],o.labelPath=s?[...s.labelPath,k]:[k],o.leaf=!((c=o==null?void 0:o[t])==null?void 0:c.length),o.leafLabel=o.labelPath.join("/"),o[`_${i}`]=o[i],o[t]=(o==null?void 0:o[t])?ue(o[t],r,o,v,f).source:[],v[l]=o.path,f[l]=o}),{source:e,pathMap:v,valueMap:f}):{source:e,pathMap:v,valueMap:f}};var Ve=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Pe={exports:{}};/*!
* clipboard.js v2.0.8
* https://clipboardjs.com/
*
* Licensed MIT © Zeno Rocha
*/(function(e,r){(function(v,f){e.exports=f()})(Ve,function(){return function(){var s={134:function(d,i,t){t.d(i,{default:function(){return me}});var o=t(279),c=t.n(o),l=t(370),k=t.n(l),_=t(817),x=t.n(_);function y(p){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?y=function(n){return typeof n}:y=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},y(p)}function u(p,a){if(!(p instanceof a))throw new TypeError("Cannot call a class as a function")}function S(p,a){for(var n=0;n<a.length;n++){var h=a[n];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(p,h.key,h)}}function T(p,a,n){return a&&S(p.prototype,a),n&&S(p,n),p}var re=function(){function p(a){u(this,p),this.resolveOptions(a),this.initSelection()}return T(p,[{key:"resolveOptions",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=n.action,this.container=n.container,this.emitter=n.emitter,this.target=n.target,this.text=n.text,this.trigger=n.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"createFakeElement",value:function(){var n=document.documentElement.getAttribute("dir")==="rtl";this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[n?"right":"left"]="-9999px";var h=window.pageYOffset||document.documentElement.scrollTop;return this.fakeElem.style.top="".concat(h,"px"),this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.fakeElem}},{key:"selectFake",value:function(){var n=this,h=this.createFakeElement();this.fakeHandlerCallback=function(){return n.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.container.appendChild(h),this.selectedText=x()(h),this.copyText(),this.removeFake()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=x()(this.target),this.copyText()}},{key:"copyText",value:function(){var n;try{n=document.execCommand(this.action)}catch(h){n=!1}this.handleResult(n)}},{key:"handleResult",value:function(n){this.emitter.emit(n?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"copy";if(this._action=n,this._action!=="copy"&&this._action!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(n){if(n!==void 0)if(n&&y(n)==="object"&&n.nodeType===1){if(this.action==="copy"&&n.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(this.action==="cut"&&(n.hasAttribute("readonly")||n.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`);this._target=n}else throw new Error('Invalid "target" value, use a valid Element')},get:function(){return this._target}}]),p}(),b=re;function m(p){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?m=function(n){return typeof n}:m=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},m(p)}function E(p,a){if(!(p instanceof a))throw new TypeError("Cannot call a class as a function")}function $(p,a){for(var n=0;n<a.length;n++){var h=a[n];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(p,h.key,h)}}function j(p,a,n){return a&&$(p.prototype,a),n&&$(p,n),p}function R(p,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");p.prototype=Object.create(a&&a.prototype,{constructor:{value:p,writable:!0,configurable:!0}}),a&&P(p,a)}function P(p,a){return P=Object.setPrototypeOf||function(h,g){return h.__proto__=g,h},P(p,a)}function L(p){var a=be();return function(){var h=Z(p),g;if(a){var M=Z(this).constructor;g=Reflect.construct(h,arguments,M)}else g=h.apply(this,arguments);return ve(this,g)}}function ve(p,a){return a&&(m(a)==="object"||typeof a=="function")?a:he(p)}function he(p){if(p===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p}function be(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(p){return!1}}function Z(p){return Z=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Z(p)}function ae(p,a){var n="data-clipboard-".concat(p);if(!!a.hasAttribute(n))return a.getAttribute(n)}var ye=function(p){R(n,p);var a=L(n);function n(h,g){var M;return E(this,n),M=a.call(this),M.resolveOptions(g),M.listenClick(h),M}return j(n,[{key:"resolveOptions",value:function(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof g.action=="function"?g.action:this.defaultAction,this.target=typeof g.target=="function"?g.target:this.defaultTarget,this.text=typeof g.text=="function"?g.text:this.defaultText,this.container=m(g.container)==="object"?g.container:document.body}},{key:"listenClick",value:function(g){var M=this;this.listener=k()(g,"click",function(G){return M.onClick(G)})}},{key:"onClick",value:function(g){var M=g.delegateTarget||g.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new b({action:this.action(M),target:this.target(M),text:this.text(M),container:this.container,trigger:M,emitter:this})}},{key:"defaultAction",value:function(g){return ae("action",g)}},{key:"defaultTarget",value:function(g){var M=ae("target",g);if(M)return document.querySelector(M)}},{key:"defaultText",value:function(g){return ae("text",g)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],M=typeof g=="string"?[g]:g,G=!!document.queryCommandSupported;return M.forEach(function(ge){G=G&&!!document.queryCommandSupported(ge)}),G}}]),n}(c()),me=ye},828:function(d){var i=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}function o(c,l){for(;c&&c.nodeType!==i;){if(typeof c.matches=="function"&&c.matches(l))return c;c=c.parentNode}}d.exports=o},438:function(d,i,t){var o=t(828);function c(_,x,y,u,S){var T=k.apply(this,arguments);return _.addEventListener(y,T,S),{destroy:function(){_.removeEventListener(y,T,S)}}}function l(_,x,y,u,S){return typeof _.addEventListener=="function"?c.apply(null,arguments):typeof y=="function"?c.bind(null,document).apply(null,arguments):(typeof _=="string"&&(_=document.querySelectorAll(_)),Array.prototype.map.call(_,function(T){return c(T,x,y,u,S)}))}function k(_,x,y,u){return function(S){S.delegateTarget=o(S.target,x),S.delegateTarget&&u.call(_,S)}}d.exports=l},879:function(d,i){i.node=function(t){return t!==void 0&&t instanceof HTMLElement&&t.nodeType===1},i.nodeList=function(t){var o=Object.prototype.toString.call(t);return t!==void 0&&(o==="[object NodeList]"||o==="[object HTMLCollection]")&&"length"in t&&(t.length===0||i.node(t[0]))},i.string=function(t){return typeof t=="string"||t instanceof String},i.fn=function(t){var o=Object.prototype.toString.call(t);return o==="[object Function]"}},370:function(d,i,t){var o=t(879),c=t(438);function l(y,u,S){if(!y&&!u&&!S)throw new Error("Missing required arguments");if(!o.string(u))throw new TypeError("Second argument must be a String");if(!o.fn(S))throw new TypeError("Third argument must be a Function");if(o.node(y))return k(y,u,S);if(o.nodeList(y))return _(y,u,S);if(o.string(y))return x(y,u,S);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function k(y,u,S){return y.addEventListener(u,S),{destroy:function(){y.removeEventListener(u,S)}}}function _(y,u,S){return Array.prototype.forEach.call(y,function(T){T.addEventListener(u,S)}),{destroy:function(){Array.prototype.forEach.call(y,function(T){T.removeEventListener(u,S)})}}}function x(y,u,S){return c(document.body,y,u,S)}d.exports=l},817:function(d){function i(t){var o;if(t.nodeName==="SELECT")t.focus(),o=t.value;else if(t.nodeName==="INPUT"||t.nodeName==="TEXTAREA"){var c=t.hasAttribute("readonly");c||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),c||t.removeAttribute("readonly"),o=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var l=window.getSelection(),k=document.createRange();k.selectNodeContents(t),l.removeAllRanges(),l.addRange(k),o=l.toString()}return o}d.exports=i},279:function(d){function i(){}i.prototype={on:function(t,o,c){var l=this.e||(this.e={});return(l[t]||(l[t]=[])).push({fn:o,ctx:c}),this},once:function(t,o,c){var l=this;function k(){l.off(t,k),o.apply(c,arguments)}return k._=o,this.on(t,k,c)},emit:function(t){var o=[].slice.call(arguments,1),c=((this.e||(this.e={}))[t]||[]).slice(),l=0,k=c.length;for(l;l<k;l++)c[l].fn.apply(c[l].ctx,o);return this},off:function(t,o){var c=this.e||(this.e={}),l=c[t],k=[];if(l&&o)for(var _=0,x=l.length;_<x;_++)l[_].fn!==o&&l[_].fn._!==o&&k.push(l[_]);return k.length?c[t]=k:delete c[t],this}},d.exports=i,d.exports.TinyEmitter=i}},v={};function f(d){if(v[d])return v[d].exports;var i=v[d]={exports:{}};return s[d](i,i.exports,f),i.exports}return function(){f.n=function(d){var i=d&&d.__esModule?function(){return d.default}:function(){return d};return f.d(i,{a:i}),i}}(),function(){f.d=function(d,i){for(var t in i)f.o(i,t)&&!f.o(d,t)&&Object.defineProperty(d,t,{enumerable:!0,get:i[t]})}}(),function(){f.o=function(d,i){return Object.prototype.hasOwnProperty.call(d,i)}}(),f(134)}().default})})(Pe),W("data-v-2ca3eff0");const Ie={key:2,class:"button__text"};X();var Q=J({props:{styles:{type:Object,default:()=>({})},type:{type:String,default:"default"},text:{type:String,default:""},plain:{type:Boolean,default:!1},iconBefore:{type:String,default:""},iconAfter:{type:String,default:""},fontColor:{type:String,default:""},icon:{type:String,default:""}},emits:["click"],setup(e,{emit:r}){return _e(s=>({"2ca3eff0-fontColor":e.fontColor})),(s,v)=>e.type==="icon"?(w(),C("button",{key:0,class:"button__icon es-cursor--pointer",style:le(e.styles),onClick:v[0]||(v[0]=f=>r("click"))},[I("i",{class:B(e.icon)},null,2)],4)):(w(),C("button",{key:1,class:B(["button",[e.type,{plain:e.plain}]]),style:le(e.styles),onClick:v[1]||(v[1]=f=>r("click"))},[e.iconBefore===""?N(s.$slots,"before",{key:0}):O("v-if",!0),e.iconBefore!==""?(w(),C("i",{key:1,class:B(["icon",e.iconBefore])},null,2)):O("v-if",!0),e.text!==""?(w(),C("span",Ie,q(e.text),1)):N(s.$slots,"default",{key:3}),e.iconAfter!==""?(w(),C("i",{key:4,class:B(["icon",e.iconAfter])},null,2)):O("v-if",!0),e.iconAfter===""?N(s.$slots,"after",{key:5}):O("v-if",!0)],6))}});function D(e,r){r===void 0&&(r={});var s=r.insertAt;if(!(!e||typeof document=="undefined")){var v=document.head||document.getElementsByTagName("head")[0],f=document.createElement("style");f.type="text/css",s==="top"&&v.firstChild?v.insertBefore(f,v.firstChild):v.appendChild(f),f.styleSheet?f.styleSheet.cssText=e:f.appendChild(document.createTextNode(e))}}var Ne=`.button[data-v-2ca3eff0] {
padding: 0 12px;
border-radius: 4px;
cursor: pointer;
box-sizing: border-box;
font-size: 14px;
height: 30px;
line-height: 30px;
--button-font-color: var(--2ca3eff0-fontColor);
}
.button[data-v-2ca3eff0]:disabled {
cursor: not-allowed;
}
.button__icon[data-v-2ca3eff0] {
display: inline-block;
}
.button__text[data-v-2ca3eff0] {
display: inline-block;
height: 21px;
}
.button.error[data-v-2ca3eff0] {
background-color: #ea4444;
color: var(--button-font-color, #ffffff);
}
.button.pure[data-v-2ca3eff0] {
background-color: unset;
color: var(--button-font-color, #e4e5ec);
}
.button.default[data-v-2ca3eff0] {
background: #5075e2;
color: var(--button-font-color, #ffffff);
}
.button.default[data-v-2ca3eff0]:disabled {
background: #5075e290;
}
.button.default.plain[data-v-2ca3eff0] {
border: 1px solid #a7baf1;
background: #ffffff;
color: var(--button-font-color, #3e4051);
box-shadow: 0px 1px 3px rgba(48, 88, 208, 0.1), 0px 2px 1px rgba(48, 88, 208, 0.06), 0px 1px 1px rgba(48, 88, 208, 0.08);
}
.button.error.plain[data-v-2ca3eff0] {
border: 1px solid #a7baf1;
background: #ffffff;
color: var(--button-font-color, #da0000);
}`;D(Ne),Q.__scopeId="data-v-2ca3eff0",Q.__file="components/button/index.vue",Q.install=e=>{e.component("es-button",Q)};var K=J({components:{ElInput:Ce},props:{prependText:{type:String,default:""},modelValue:{type:String,default:""},hasSuffix:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:r}){const s=ee("es-icon-search-line"),v=ee(!1),f=A({get(){return e.modelValue},set(x){r("update:modelValue",x)}}),d=()=>{s.value="es-icon-close-line"},i=()=>{s.value="es-icon-search-line"},t=()=>{f.value=""},o=()=>{v.value=!0,d()},c=()=>{d()},l=()=>{v.value||i()},k=()=>{v.value=!1,i()},_=A(()=>f.value===""?"es-icon-search-line":s.value);return{suffixIcon:s,suffixIcon2Clear:d,suffixIcon2Search:i,clearInput:t,suffixIconShow:_,inputModel:f,blur:k,focus:o,mouseout:l,mouseover:c}}});W("data-v-4da67c3c");const je={class:"es-input"},Le={class:"es-input__prepend"};X();function Be(e,r,s,v,f,d){const i=F("el-input");return w(),C("div",je,[te(i,ke(e.$attrs,{modelValue:e.inputModel,"onUpdate:modelValue":r[3]||(r[3]=t=>e.inputModel=t),onFocus:e.focus,onBlur:e.blur,onMouseover:ce(e.mouseover,["self"]),onMouseout:ce(e.mouseout,["self"])}),Se({_:2},[e.prependText!==""?{name:"prepend",fn:V(()=>[I("span",Le,q(e.prependText),1)])}:void 0,e.hasSuffix?void 0:{name:"suffix",fn:V(()=>[I("span",{class:B(["el-input__icon",e.suffixIconShow]),onClick:r[0]||(r[0]=(...t)=>e.clearInput&&e.clearInput(...t)),onMouseover:r[1]||(r[1]=(...t)=>e.suffixIcon2Clear&&e.suffixIcon2Clear(...t)),onMouseout:r[2]||(r[2]=(...t)=>e.suffixIcon2Search&&e.suffixIcon2Search(...t))},null,34)])}]),1040,["modelValue","onFocus","onBlur","onMouseover","onMouseout"])])}var Fe=`.es-input[data-v-4da67c3c] {
display: inline-block;
}
.es-input__prepend[data-v-4da67c3c] {
color: #9c9eb0;
}
[data-v-4da67c3c] .el-input {
box-sizing: border-box;
padding: 5px 12px 0 12px !important;
line-height: 21px !important;
}
[data-v-4da67c3c] .el-input__inner {
height: 28px !important;
border: 0 !important;
color: #282934 !important;
line-height: 21px;
border-bottom: 1px solid #a7baf1 !important;
border-radius: unset !important;
padding-right: 18px !important;
padding-left: 0px !important;
padding-bottom: 6px;
}
[data-v-4da67c3c] .el-input__suffix {
position: absolute;
right: 12px;
top: 0;
}
[data-v-4da67c3c] .el-input__icon {
line-height: 32px;
}
[data-v-4da67c3c] .el-input-group__prepend {
background-color: unset;
border: 0;
border-bottom: 1px solid #a7baf1 !important;
border-radius: 0;
padding-left: 0;
line-height: 21px;
padding-bottom: 6px;
padding-right: 6px;
}
[data-v-4da67c3c] .el-input__suffix
.el-input__suffix-inner
.el-input__icon.es-icon-close-line {
cursor: pointer;
}`;D(Fe),K.render=Be,K.__scopeId="data-v-4da67c3c",K.__file="components/input/index.vue",K.install=e=>{e.component("es-input",K)};var H=J({components:{EsButton:Q,EsInput:K},props:{showBtm:{type:Array,default:()=>["delete","close","update"]}},emits:["done","close","delete"],setup(e,{slots:r,emit:s}){const v=A(()=>e.showBtm.length),f=A(()=>{var l;return(l=e.showBtm)==null?void 0:l.includes("delete")}),d=A(()=>{var l;return(l=e.showBtm)==null?void 0:l.includes("close")}),i=A(()=>{var l;return(l=e.showBtm)==null?void 0:l.includes("update")});return{btmVisible:v,deleteVisible:f,closeVisible:d,updateVisible:i,slots:r,update:()=>{s("done")},deleteEvt:()=>{s("delete")},close:()=>{s("close")}}}});W("data-v-f553ffa8");const Re={class:"es-search-wrapper"},ze={key:0,class:"es-search-wrapper__content"},De={key:1,class:"es-search-wrapper__bottom"},Ke={class:"es-search-wrapper__bottom__left"},He=ie("\u6E05\u7A7A"),Ue={class:"es-search-wrapper__bottom__right"},Ye=ie("\u5173\u95ED"),Ge=ie("\u67E5\u8BE2");X();function We(e,r,s,v,f,d){const i=F("es-input"),t=F("es-button");return w(),C("div",Re,[te(i,we(Ee(e.$attrs)),null,16),e.slots.content?(w(),C("div",ze,[N(e.$slots,"content")])):O("v-if",!0),e.btmVisible?(w(),C("div",De,[I("div",Ke,[e.deleteVisible?(w(),z(t,{key:0,type:"error",onClick:e.deleteEvt},{default:V(()=>[He]),_:1},8,["onClick"])):O("v-if",!0)]),I("div",Ue,[e.closeVisible?(w(),z(t,{key:0,plain:"",onClick:e.close},{default:V(()=>[Ye]),_:1},8,["onClick"])):O("v-if",!0),e.updateVisible?(w(),z(t,{key:1,class:"es-margin-l--base",onClick:e.update},{default:V(()=>[Ge]),_:1},8,["onClick"])):O("v-if",!0)])])):O("v-if",!0)])}var Xe=`.es-search-wrapper[data-v-f553ffa8] {
display: inline-block;
background: #ffffff;
flex-direction: column;
/* shadow/400 */
box-shadow: 0px 6px 12px -6px rgba(24, 39, 75, 0.12), 0px 8px 24px -4px rgba(24, 39, 75, 0.08);
border-radius: 4px;
}
.es-search-wrapper__content[data-v-f553ffa8] {
width: 100%;
margin-top: 8px;
}
.es-search-wrapper__bottom[data-v-f553ffa8] {
height: 36px;
margin-top: 8px;
display: flex;
justify-content: space-between;
}
.es-search-wrapper__bottom__left[data-v-f553ffa8] {
margin-left: 12px;
}
.es-search-wrapper__bottom__right[data-v-f553ffa8] {
margin-right: 12px;
}
[data-v-f553ffa8] .es-input {
width: 100%;
min-width: 331px;
padding: 0 12px;
}
[data-v-f553ffa8] .el-input-group {
display: flex;
}
[data-v-f553ffa8] .el-input__inner {
flex: 1;
}
[data-v-f553ffa8] .es-option {
box-shadow: unset !important;
border-radius: unset !important;
}
[data-v-f553ffa8] .es-option__content__item {
width: 100%;
box-sizing: border-box;
}`;D(Xe),H.render=We,H.__scopeId="data-v-f553ffa8",H.__file="components/search-wrapper/index.vue",H.install=e=>{e.component("es-search-wrapper",H)};var U=J({components:{ElPopover:Te},props:{styles:{type:Object,default:()=>({})},label:{type:[String,Number],default:""},value:{type:[String,Number],default:""},useSlot:{type:Boolean,default:!0},class:{type:String,default:""},panelClass:{type:String,default:""},popoverClass:{type:String,default:""}},emits:["open","close"],setup(e,{emit:r,slots:s}){const v=ee(!1),f=ee(null);return{panelVisible:v,closePanel:()=>{v.value=!1},slots:s,popoverEl:f,emit:r}}});W("data-v-8823a666");const Je={key:1,class:"es-search-label__container"},Qe={key:0,class:"es-search-label__container__label"},Ze={key:1,class:"es-search-label__container__label"},qe={key:2,class:"es-search-label__container__value"},et={key:3,class:"es-search-label__container__value"},tt=I("div",{class:"es-search-label__container__icon es-icon-arrow-down-s-fill"},null,-1);X();function nt(e,r,s,v,f,d){const i=F("el-popover");return w(),z(i,{ref:"popoverEl",placement:"bottom-start",offset:6,width:"unset","hide-after":0,"popper-class":`el-popover--no-padding ${e.popoverClass}`,visible:e.panelVisible,"onUpdate:visible":r[0]||(r[0]=t=>e.panelVisible=t),onShow:r[1]||(r[1]=t=>e.emit("open")),onHide:r[2]||(r[2]=t=>e.emit("close"))},{reference:V(()=>[I("div",{class:B(["es-search-label",e.class]),style:le(e.styles)},[e.slots.main?N(e.$slots,"main",{key:0}):(w(),C("div",Je,[e.slots.label?(w(),C("div",Qe,[N(e.$slots,"label")])):(w(),C("div",Ze,q(e.label),1)),e.slots.value?(w(),C("div",qe,[N(e.$slots,"value")])):(w(),C("div",et,q(e.value),1)),tt]))],6)]),default:V(()=>[I("div",{class:B(["es-search-label__slot",e.panelClass])},[N(e.$slots,"panel",{closePanel:e.closePanel,popoverEl:e.popoverEl})],2)]),_:3},8,["popper-class","visible"])}var ot=`.es-search-label[data-v-8823a666] {
font-size: 14px;
line-height: 20px;
display: inline-block;
cursor: pointer;
}
.es-search-label__container[data-v-8823a666] {
display: flex;
}
.es-search-label__container__label[data-v-8823a666] {
color: #7a7c90;
}
.es-search-label__container__icon[data-v-8823a666] {
width: 16px;
height: 16px;
margin-left: 4px;
}
.es-search-label__container__icon[data-v-8823a666]::before {
color: #a7baf1;
}`;D(ot);var rt=`.el-popover--no-padding {
padding: 0 !important;
}
.el-popover.el-popper {
min-width: unset !important;
}
.el-popper__arrow {
display: none;
}`;D(rt),U.render=nt,U.__scopeId="data-v-8823a666",U.__file="components/search-label/index.vue",U.install=e=>{e.component("es-search-label",U)};var at=Object.defineProperty,lt=Object.defineProperties,it=Object.getOwnPropertyDescriptors,de=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,ut=Object.prototype.propertyIsEnumerable,fe=(e,r,s)=>r in e?at(e,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[r]=s,oe=(e,r)=>{for(var s in r||(r={}))st.call(r,s)&&fe(e,s,r[s]);if(de)for(var s of de(r))ut.call(r,s)&&fe(e,s,r[s]);return e},pe=(e,r)=>lt(e,it(r)),Y=J({components:{EsSearchWrapper:H,EsSearchLabel:U,ElCascaderPanel:$e},props:{label:[String,Number],modelValue:[String,Number,Array],placeholder:String,prependText:String,checkStrictly:Boolean,defaultValue:{type:String,default:""},labelKey:String,source:Array,multiple:Oe,keyConfig:Ae},emits:["done","close","clear","update:modelValue"],setup(e,{emit:r}){const s=e.multiple,{valueKey:v,labelKey:f,childrenKey:d,disabledKey:i}=oe(oe({},se),e.keyConfig),t=A(()=>({value:v,label:f,children:d,disabled:i,multiple:e.multiple,checkStrictly:e.checkStrictly})),o=A(()=>ue(e.source,{valueKey:v,labelKey:f,childrenKey:d,disabledKey:i})),c=A(()=>{var b;return(b=u.inputModel)==null?void 0:b.length}),l=A(()=>{if(!c.value)return[];const b=Object.values(o.value.valueMap),m=[];return b.filter(E=>{E.leaf&&E.leafLabel.includes(u.inputModel)&&m.push(pe(oe({},E),{[f]:E.leafLabel}))}),m}),k=A(()=>ue(l.value,{valueKey:v,labelKey:f,childrenKey:d,disabledKey:i})),_=b=>t.value.multiple?b==null?void 0:b.map(m=>Array.isArray(m)?m[m.length-1]:m):Array.isArray(b)&&b[b.length-1]||b,x=(b=s?[]:"")=>{var m,E;if(b==="")return"";const $=(e==null?void 0:e.labelKey)||f;return s?Array.isArray(b)&&b.map(j=>o.value.valueMap[j][$]).join("\uFF0C"):(E=(m=o.value.valueMap)==null?void 0:m[b])==null?void 0:E[$]};let y=e.modelValue||s&&[]||"";const u=xe({inputModel:"",sourceModel:o.value.source,selectedModel:y,valueModel:x(y),fliterSelectModel:s&&[]||""});ne(()=>e.source,b=>{u.sourceModel=b||[]},{deep:!0}),ne(c,b=>{var m,E;if(b){const $=_(u.selectedModel);s?u.fliterSelectModel=$.filter(j=>{var R,P;return(P=(R=k==null?void 0:k.value)==null?void 0:R.valueMap)==null?void 0:P[j]}):u.fliterSelectModel=((E=(m=k==null?void 0:k.value)==null?void 0:m.valueMap)==null?void 0:E[$])?$:""}}),ne(()=>e.modelValue,b=>{const m=b;u.selectedModel=m,y=m,u.valueModel=x(m)}),ne(()=>u.fliterSelectModel,(b=[],m=[])=>{if(c.value){const E=_(b),$=_(m),j=_(u.selectedModel);if(s){if(!E.length)return;const R=E.filter(L=>!$.includes(L)),P=$.filter(L=>!E.includes(L));u.selectedModel=j.filter(L=>!P.includes(L)),u.selectedModel=[...u.selectedModel,...R]}else{if(E==="")return;u.selectedModel=E}}});const S=b=>{const m=_(u.selectedModel);u.valueModel=x(m),u.inputModel="",r("update:modelValue",m),r("done",m),b&&b()},T=b=>{u.selectedModel=s&&[]||"",u.fliterSelectModel=s&&[]||"",u.inputModel="";const m=_(u.selectedModel);u.valueModel=x(m),r("update:modelValue",u.selectedModel),r("clear",u.selectedModel),b&&b()},re=b=>{u.inputModel="",u.selectedModel=y,r("close",u.selectedModel),b&&b()};return pe(oe({},Me(u)),{filteringSourceModel:l,propsData:t,done:S,deleteEvt:T,close:re,filtering:c})}});W("data-v-b8c1cd4a");const ct={class:"es-search-cascader"};X();function dt(e,r,s,v,f,d){const i=F("el-cascader-panel"),t=F("es-search-wrapper"),o=F("es-search-label");return w(),C("div",ct,[te(o,{label:e.label,value:e.valueModel||e.defaultValue,onClose:e.close},{panel:V(({closePanel:c})=>[te(t,{placeholder:e.placeholder,prependText:e.prependText,onDone:l=>e.done(c),onDelete:l=>e.deleteEvt(c),onClose:l=>e.close(c),modelValue:e.inputModel,"onUpdate:modelValue":r[2]||(r[2]=l=>e.inputModel=l)},{content:V(()=>[e.filtering?(w(),z(i,{key:1,border:!1,modelValue:e.fliterSelectModel,"onUpdate:modelValue":r[1]||(r[1]=l=>e.fliterSelectModel=l),options:e.filteringSourceModel,props:e.propsData},null,8,["modelValue","options","props"])):(w(),z(i,{key:0,border:!1,modelValue:e.selectedModel,"onUpdate:modelValue":r[0]||(r[0]=l=>e.selectedModel=l),options:e.sourceModel,props:e.propsData},null,8,["modelValue","options","props"]))]),_:2},1032,["placeholder","prependText","onDone","onDelete","onClose","modelValue"])]),_:1},8,["label","value","onClose"])])}var ft=`.es-search-cascader[data-v-b8c1cd4a] .es-input {
width: 100%;
min-width: 200px;
}
.es-search-cascader[data-v-b8c1cd4a] .el-cascader-menu {
flex: 1;
}`;D(ft),Y.render=dt,Y.__scopeId="data-v-b8c1cd4a",Y.__file="components/search-cascader/index.vue",Y.install=e=>{e.component("es-search-cascader",Y)};export{Y as default};