eslink-ui-plus
Version:
vue3 component library, css framework
126 lines (125 loc) • 10 kB
JavaScript
(function(e,f){typeof exports=="object"&&typeof module!="undefined"?module.exports=f(require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["vue","element-plus"],f):(e=typeof globalThis!="undefined"?globalThis:e||self,e["es-search-wrapper-number"]=f(e.Vue,e.ElementPlus))})(this,function(e,f){"use strict";e.pushScopeId("data-v-2ca3eff0");const g={key:2,class:"button__text"};e.popScopeId();var u=e.defineComponent({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(n,{emit:t}){return e.useCssVars(o=>({"2ca3eff0-fontColor":n.fontColor})),(o,a)=>n.type==="icon"?(e.openBlock(),e.createElementBlock("button",{key:0,class:"button__icon es-cursor--pointer",style:e.normalizeStyle(n.styles),onClick:a[0]||(a[0]=r=>t("click"))},[e.createElementVNode("i",{class:e.normalizeClass(n.icon)},null,2)],4)):(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(["button",[n.type,{plain:n.plain}]]),style:e.normalizeStyle(n.styles),onClick:a[1]||(a[1]=r=>t("click"))},[n.iconBefore===""?e.renderSlot(o.$slots,"before",{key:0}):e.createCommentVNode("v-if",!0),n.iconBefore!==""?(e.openBlock(),e.createElementBlock("i",{key:1,class:e.normalizeClass(["icon",n.iconBefore])},null,2)):e.createCommentVNode("v-if",!0),n.text!==""?(e.openBlock(),e.createElementBlock("span",g,e.toDisplayString(n.text),1)):e.renderSlot(o.$slots,"default",{key:3}),n.iconAfter!==""?(e.openBlock(),e.createElementBlock("i",{key:4,class:e.normalizeClass(["icon",n.iconAfter])},null,2)):e.createCommentVNode("v-if",!0),n.iconAfter===""?e.renderSlot(o.$slots,"after",{key:5}):e.createCommentVNode("v-if",!0)],6))}});function b(n,t){t===void 0&&(t={});var o=t.insertAt;if(!(!n||typeof document=="undefined")){var a=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",o==="top"&&a.firstChild?a.insertBefore(r,a.firstChild):a.appendChild(r),r.styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n))}}var k=`.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);
}`;b(k),u.__scopeId="data-v-2ca3eff0",u.__file="components/button/index.vue",u.install=n=>{n.component("es-button",u)};var c=e.defineComponent({components:{ElInput:f.ElInput},props:{prependText:{type:String,default:""},modelValue:{type:String,default:""},hasSuffix:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const o=e.ref("es-icon-search-line"),a=e.ref(!1),r=e.computed({get(){return n.modelValue},set(A){t("update:modelValue",A)}}),d=()=>{o.value="es-icon-close-line"},i=()=>{o.value="es-icon-search-line"},s=()=>{r.value=""},m=()=>{a.value=!0,d()},h=()=>{d()},x=()=>{a.value||i()},l=()=>{a.value=!1,i()},v=e.computed(()=>r.value===""?"es-icon-search-line":o.value);return{suffixIcon:o,suffixIcon2Clear:d,suffixIcon2Search:i,clearInput:s,suffixIconShow:v,inputModel:r,blur:l,focus:m,mouseout:x,mouseover:h}}});e.pushScopeId("data-v-4da67c3c");const y={class:"es-input"},C={class:"es-input__prepend"};e.popScopeId();function V(n,t,o,a,r,d){const i=e.resolveComponent("el-input");return e.openBlock(),e.createElementBlock("div",y,[e.createVNode(i,e.mergeProps(n.$attrs,{modelValue:n.inputModel,"onUpdate:modelValue":t[3]||(t[3]=s=>n.inputModel=s),onFocus:n.focus,onBlur:n.blur,onMouseover:e.withModifiers(n.mouseover,["self"]),onMouseout:e.withModifiers(n.mouseout,["self"])}),e.createSlots({_:2},[n.prependText!==""?{name:"prepend",fn:e.withCtx(()=>[e.createElementVNode("span",C,e.toDisplayString(n.prependText),1)])}:void 0,n.hasSuffix?void 0:{name:"suffix",fn:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(["el-input__icon",n.suffixIconShow]),onClick:t[0]||(t[0]=(...s)=>n.clearInput&&n.clearInput(...s)),onMouseover:t[1]||(t[1]=(...s)=>n.suffixIcon2Clear&&n.suffixIcon2Clear(...s)),onMouseout:t[2]||(t[2]=(...s)=>n.suffixIcon2Search&&n.suffixIcon2Search(...s))},null,34)])}]),1040,["modelValue","onFocus","onBlur","onMouseover","onMouseout"])])}var _=`.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;
}`;b(_),c.render=V,c.__scopeId="data-v-4da67c3c",c.__file="components/input/index.vue",c.install=n=>{n.component("es-input",c)};var p=e.defineComponent({components:{EsButton:u,EsInput:c},props:{showBtm:{type:Array,default:()=>["delete","close","update"]},modelValue:String,prependText:String,placeholder:String},emits:["done","close","delete","update:modelValue"],setup(n,{slots:t,emit:o}){const a=e.computed({get(){var l;return(l=n.modelValue)!=null?l:""},set(l){l.length&&/^[1-9][0-9]*$/.test(l)?o("update:modelValue",l):o("update:modelValue","")}}),r=e.computed(()=>n.showBtm.length),d=e.computed(()=>{var l;return(l=n.showBtm)==null?void 0:l.includes("delete")}),i=e.computed(()=>{var l;return(l=n.showBtm)==null?void 0:l.includes("close")}),s=e.computed(()=>{var l;return(l=n.showBtm)==null?void 0:l.includes("update")});return{btmVisible:r,deleteVisible:d,closeVisible:i,updateVisible:s,slots:t,update:()=>{o("done")},deleteEvt:()=>{o("delete")},close:()=>{o("close")},numberValue:a}}});e.pushScopeId("data-v-7447c320");const B={class:"es-search-wrapper"},w={key:0,class:"es-search-wrapper__content"},S={key:1,class:"es-search-wrapper__bottom"},E={class:"es-search-wrapper__bottom__left"},I=e.createTextVNode("\u6E05\u7A7A"),$={class:"es-search-wrapper__bottom__right"},N=e.createTextVNode("\u5173\u95ED"),z=e.createTextVNode("\u67E5\u8BE2");e.popScopeId();function T(n,t,o,a,r,d){const i=e.resolveComponent("es-input"),s=e.resolveComponent("es-button");return e.openBlock(),e.createElementBlock("div",B,[e.createVNode(i,{modelValue:n.numberValue,"onUpdate:modelValue":t[0]||(t[0]=m=>n.numberValue=m),modelModifiers:{trim:!0,number:!0},placeholder:n.placeholder,"prepend-text":n.prependText},null,8,["modelValue","placeholder","prepend-text"]),n.slots.content?(e.openBlock(),e.createElementBlock("div",w,[e.renderSlot(n.$slots,"content")])):e.createCommentVNode("v-if",!0),n.btmVisible?(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("div",E,[n.deleteVisible?(e.openBlock(),e.createBlock(s,{key:0,type:"error",onClick:n.deleteEvt},{default:e.withCtx(()=>[I]),_:1},8,["onClick"])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",$,[n.closeVisible?(e.openBlock(),e.createBlock(s,{key:0,plain:!0,onClick:n.close},{default:e.withCtx(()=>[N]),_:1},8,["onClick"])):e.createCommentVNode("v-if",!0),n.updateVisible?(e.openBlock(),e.createBlock(s,{key:1,class:"es-margin-l--base",onClick:n.update},{default:e.withCtx(()=>[z]),_:1},8,["onClick"])):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0)])}var M=`.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;
}`;return b(M),p.render=T,p.__scopeId="data-v-7447c320",p.__file="components/search-wrapper-number/index.vue",p.install=n=>{n.component("es-search-wrapper-number",p)},p});