UNPKG

eslink-ui-plus

Version:

vue3 component library, css framework

126 lines (125 loc) 8.96 kB
import{pushScopeId as _,popScopeId as k,defineComponent as w,useCssVars as F,openBlock as s,createElementBlock as d,normalizeStyle as E,createElementVNode as m,normalizeClass as v,renderSlot as y,createCommentVNode as u,toDisplayString as M,ref as z,computed as c,resolveComponent as V,createVNode as A,mergeProps as D,withModifiers as T,createSlots as U,withCtx as h,createBlock as C,createTextVNode as S}from"vue";import{ElInput as O}from"element-plus";_("data-v-2ca3eff0");const P={key:2,class:"button__text"};k();var x=w({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:n}){return F(t=>({"2ca3eff0-fontColor":e.fontColor})),(t,o)=>e.type==="icon"?(s(),d("button",{key:0,class:"button__icon es-cursor--pointer",style:E(e.styles),onClick:o[0]||(o[0]=a=>n("click"))},[m("i",{class:v(e.icon)},null,2)],4)):(s(),d("button",{key:1,class:v(["button",[e.type,{plain:e.plain}]]),style:E(e.styles),onClick:o[1]||(o[1]=a=>n("click"))},[e.iconBefore===""?y(t.$slots,"before",{key:0}):u("v-if",!0),e.iconBefore!==""?(s(),d("i",{key:1,class:v(["icon",e.iconBefore])},null,2)):u("v-if",!0),e.text!==""?(s(),d("span",P,M(e.text),1)):y(t.$slots,"default",{key:3}),e.iconAfter!==""?(s(),d("i",{key:4,class:v(["icon",e.iconAfter])},null,2)):u("v-if",!0),e.iconAfter===""?y(t.$slots,"after",{key:5}):u("v-if",!0)],6))}});function $(e,n){n===void 0&&(n={});var t=n.insertAt;if(!(!e||typeof document=="undefined")){var o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t==="top"&&o.firstChild?o.insertBefore(a,o.firstChild):o.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}var q=`.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); }`;$(q),x.__scopeId="data-v-2ca3eff0",x.__file="components/button/index.vue",x.install=e=>{e.component("es-button",x)};var f=w({components:{ElInput:O},props:{prependText:{type:String,default:""},modelValue:{type:String,default:""},hasSuffix:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:n}){const t=z("es-icon-search-line"),o=z(!1),a=c({get(){return e.modelValue},set(j){n("update:modelValue",j)}}),p=()=>{t.value="es-icon-close-line"},i=()=>{t.value="es-icon-search-line"},l=()=>{a.value=""},g=()=>{o.value=!0,p()},B=()=>{p()},I=()=>{o.value||i()},r=()=>{o.value=!1,i()},N=c(()=>a.value===""?"es-icon-search-line":t.value);return{suffixIcon:t,suffixIcon2Clear:p,suffixIcon2Search:i,clearInput:l,suffixIconShow:N,inputModel:a,blur:r,focus:g,mouseout:I,mouseover:B}}});_("data-v-4da67c3c");const G={class:"es-input"},H={class:"es-input__prepend"};k();function J(e,n,t,o,a,p){const i=V("el-input");return s(),d("div",G,[A(i,D(e.$attrs,{modelValue:e.inputModel,"onUpdate:modelValue":n[3]||(n[3]=l=>e.inputModel=l),onFocus:e.focus,onBlur:e.blur,onMouseover:T(e.mouseover,["self"]),onMouseout:T(e.mouseout,["self"])}),U({_:2},[e.prependText!==""?{name:"prepend",fn:h(()=>[m("span",H,M(e.prependText),1)])}:void 0,e.hasSuffix?void 0:{name:"suffix",fn:h(()=>[m("span",{class:v(["el-input__icon",e.suffixIconShow]),onClick:n[0]||(n[0]=(...l)=>e.clearInput&&e.clearInput(...l)),onMouseover:n[1]||(n[1]=(...l)=>e.suffixIcon2Clear&&e.suffixIcon2Clear(...l)),onMouseout:n[2]||(n[2]=(...l)=>e.suffixIcon2Search&&e.suffixIcon2Search(...l))},null,34)])}]),1040,["modelValue","onFocus","onBlur","onMouseover","onMouseout"])])}var K=`.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; }`;$(K),f.render=J,f.__scopeId="data-v-4da67c3c",f.__file="components/input/index.vue",f.install=e=>{e.component("es-input",f)};var b=w({components:{EsButton:x,EsInput:f},props:{showBtm:{type:Array,default:()=>["delete","close","update"]},modelValue:String,prependText:String,placeholder:String},emits:["done","close","delete","update:modelValue"],setup(e,{slots:n,emit:t}){const o=c({get(){var r;return(r=e.modelValue)!=null?r:""},set(r){r.length&&/^[1-9][0-9]*$/.test(r)?t("update:modelValue",r):t("update:modelValue","")}}),a=c(()=>e.showBtm.length),p=c(()=>{var r;return(r=e.showBtm)==null?void 0:r.includes("delete")}),i=c(()=>{var r;return(r=e.showBtm)==null?void 0:r.includes("close")}),l=c(()=>{var r;return(r=e.showBtm)==null?void 0:r.includes("update")});return{btmVisible:a,deleteVisible:p,closeVisible:i,updateVisible:l,slots:n,update:()=>{t("done")},deleteEvt:()=>{t("delete")},close:()=>{t("close")},numberValue:o}}});_("data-v-7447c320");const L={class:"es-search-wrapper"},Q={key:0,class:"es-search-wrapper__content"},R={key:1,class:"es-search-wrapper__bottom"},W={class:"es-search-wrapper__bottom__left"},X=S("\u6E05\u7A7A"),Y={class:"es-search-wrapper__bottom__right"},Z=S("\u5173\u95ED"),ee=S("\u67E5\u8BE2");k();function ne(e,n,t,o,a,p){const i=V("es-input"),l=V("es-button");return s(),d("div",L,[A(i,{modelValue:e.numberValue,"onUpdate:modelValue":n[0]||(n[0]=g=>e.numberValue=g),modelModifiers:{trim:!0,number:!0},placeholder:e.placeholder,"prepend-text":e.prependText},null,8,["modelValue","placeholder","prepend-text"]),e.slots.content?(s(),d("div",Q,[y(e.$slots,"content")])):u("v-if",!0),e.btmVisible?(s(),d("div",R,[m("div",W,[e.deleteVisible?(s(),C(l,{key:0,type:"error",onClick:e.deleteEvt},{default:h(()=>[X]),_:1},8,["onClick"])):u("v-if",!0)]),m("div",Y,[e.closeVisible?(s(),C(l,{key:0,plain:!0,onClick:e.close},{default:h(()=>[Z]),_:1},8,["onClick"])):u("v-if",!0),e.updateVisible?(s(),C(l,{key:1,class:"es-margin-l--base",onClick:e.update},{default:h(()=>[ee]),_:1},8,["onClick"])):u("v-if",!0)])])):u("v-if",!0)])}var te=`.es-search-wrapper[data-v-7447c320] { 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-7447c320] { width: 100%; margin-top: 8px; } .es-search-wrapper__bottom[data-v-7447c320] { height: 36px; margin-top: 8px; display: flex; justify-content: space-between; } .es-search-wrapper__bottom__left[data-v-7447c320] { margin-left: 12px; } .es-search-wrapper__bottom__right[data-v-7447c320] { margin-right: 12px; } [data-v-7447c320] .es-input { width: 100%; min-width: 331px; } [data-v-7447c320] .es-option { box-shadow: unset !important; border-radius: unset !important; } [data-v-7447c320] .es-option__content__item { width: 100%; box-sizing: border-box; }`;$(te),b.render=ne,b.__scopeId="data-v-7447c320",b.__file="components/search-wrapper-number/index.vue",b.install=e=>{e.component("es-search-wrapper-number",b)};export{b as default};