eslink-ui-plus
Version:
vue3 component library, css framework
195 lines (194 loc) • 18 kB
JavaScript
(function(e,m){typeof exports=="object"&&typeof module!="undefined"?module.exports=m(require("vue"),require("element-plus")):typeof define=="function"&&define.amd?define(["vue","element-plus"],m):(e=typeof globalThis!="undefined"?globalThis:e||self,e["es-search-input-number"]=m(e.Vue,e.ElementPlus))})(this,function(e,m){"use strict";var b=e.defineComponent({components:{ElPopover:m.ElPopover},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(n,{emit:t,slots:o}){const a=e.ref(!1),l=e.ref(null);return{panelVisible:a,closePanel:()=>{a.value=!1},slots:o,popoverEl:l,emit:t}}});e.pushScopeId("data-v-8823a666");const y={key:1,class:"es-search-label__container"},x={key:0,class:"es-search-label__container__label"},C={key:1,class:"es-search-label__container__label"},w={key:2,class:"es-search-label__container__value"},B={key:3,class:"es-search-label__container__value"},$=e.createElementVNode("div",{class:"es-search-label__container__icon es-icon-arrow-down-s-fill"},null,-1);e.popScopeId();function S(n,t,o,a,l,c){const i=e.resolveComponent("el-popover");return e.openBlock(),e.createBlock(i,{ref:"popoverEl",placement:"bottom-start",offset:6,width:"unset","hide-after":0,"popper-class":`el-popover--no-padding ${n.popoverClass}`,visible:n.panelVisible,"onUpdate:visible":t[0]||(t[0]=r=>n.panelVisible=r),onShow:t[1]||(t[1]=r=>n.emit("open")),onHide:t[2]||(t[2]=r=>n.emit("close"))},{reference:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["es-search-label",n.class]),style:e.normalizeStyle(n.styles)},[n.slots.main?e.renderSlot(n.$slots,"main",{key:0}):(e.openBlock(),e.createElementBlock("div",y,[n.slots.label?(e.openBlock(),e.createElementBlock("div",x,[e.renderSlot(n.$slots,"label")])):(e.openBlock(),e.createElementBlock("div",C,e.toDisplayString(n.label),1)),n.slots.value?(e.openBlock(),e.createElementBlock("div",w,[e.renderSlot(n.$slots,"value")])):(e.openBlock(),e.createElementBlock("div",B,e.toDisplayString(n.value),1)),$]))],6)]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["es-search-label__slot",n.panelClass])},[e.renderSlot(n.$slots,"panel",{closePanel:n.closePanel,popoverEl:n.popoverEl})],2)]),_:3},8,["popper-class","visible"])}function h(n,t){t===void 0&&(t={});var o=t.insertAt;if(!(!n||typeof document=="undefined")){var a=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css",o==="top"&&a.firstChild?a.insertBefore(l,a.firstChild):a.appendChild(l),l.styleSheet?l.styleSheet.cssText=n:l.appendChild(document.createTextNode(n))}}var E=`.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;
}`;h(E);var v=`.el-popover--no-padding {
padding: 0 !important;
}
.el-popover.el-popper {
min-width: unset !important;
}
.el-popper__arrow {
display: none;
}`;h(v),b.render=S,b.__scopeId="data-v-8823a666",b.__file="components/search-label/index.vue",b.install=n=>{n.component("es-search-label",b)},e.pushScopeId("data-v-2ca3eff0");const N={key:2,class:"button__text"};e.popScopeId();var _=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]=l=>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]=l=>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",N,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))}}),I=`.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);
}`;h(I),_.__scopeId="data-v-2ca3eff0",_.__file="components/button/index.vue",_.install=n=>{n.component("es-button",_)};var u=e.defineComponent({components:{ElInput:m.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),l=e.computed({get(){return n.modelValue},set(le){t("update:modelValue",le)}}),c=()=>{o.value="es-icon-close-line"},i=()=>{o.value="es-icon-search-line"},r=()=>{l.value=""},s=()=>{a.value=!0,c()},f=()=>{c()},p=()=>{a.value||i()},d=()=>{a.value=!1,i()},ae=e.computed(()=>l.value===""?"es-icon-search-line":o.value);return{suffixIcon:o,suffixIcon2Clear:c,suffixIcon2Search:i,clearInput:r,suffixIconShow:ae,inputModel:l,blur:d,focus:s,mouseout:p,mouseover:f}}});e.pushScopeId("data-v-4da67c3c");const z={class:"es-input"},T={class:"es-input__prepend"};e.popScopeId();function A(n,t,o,a,l,c){const i=e.resolveComponent("el-input");return e.openBlock(),e.createElementBlock("div",z,[e.createVNode(i,e.mergeProps(n.$attrs,{modelValue:n.inputModel,"onUpdate:modelValue":t[3]||(t[3]=r=>n.inputModel=r),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",T,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]=(...r)=>n.clearInput&&n.clearInput(...r)),onMouseover:t[1]||(t[1]=(...r)=>n.suffixIcon2Clear&&n.suffixIcon2Clear(...r)),onMouseout:t[2]||(t[2]=(...r)=>n.suffixIcon2Search&&n.suffixIcon2Search(...r))},null,34)])}]),1040,["modelValue","onFocus","onBlur","onMouseover","onMouseout"])])}var M=`.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;
}`;h(M),u.render=A,u.__scopeId="data-v-4da67c3c",u.__file="components/input/index.vue",u.install=n=>{n.component("es-input",u)};var k=e.defineComponent({components:{EsButton:_,EsInput:u},props:{showBtm:{type:Array,default:()=>["delete","close","update"]}},emits:["done","close","delete"],setup(n,{slots:t,emit:o}){const a=e.computed(()=>n.showBtm.length),l=e.computed(()=>{var p;return(p=n.showBtm)==null?void 0:p.includes("delete")}),c=e.computed(()=>{var p;return(p=n.showBtm)==null?void 0:p.includes("close")}),i=e.computed(()=>{var p;return(p=n.showBtm)==null?void 0:p.includes("update")});return{btmVisible:a,deleteVisible:l,closeVisible:c,updateVisible:i,slots:t,update:()=>{o("done")},deleteEvt:()=>{o("delete")},close:()=>{o("close")}}}});e.pushScopeId("data-v-f553ffa8");const D={class:"es-search-wrapper"},L={key:0,class:"es-search-wrapper__content"},F={key:1,class:"es-search-wrapper__bottom"},j={class:"es-search-wrapper__bottom__left"},P=e.createTextVNode("\u6E05\u7A7A"),U={class:"es-search-wrapper__bottom__right"},q=e.createTextVNode("\u5173\u95ED"),O=e.createTextVNode("\u67E5\u8BE2");e.popScopeId();function W(n,t,o,a,l,c){const i=e.resolveComponent("es-input"),r=e.resolveComponent("es-button");return e.openBlock(),e.createElementBlock("div",D,[e.createVNode(i,e.normalizeProps(e.guardReactiveProps(n.$attrs)),null,16),n.slots.content?(e.openBlock(),e.createElementBlock("div",L,[e.renderSlot(n.$slots,"content")])):e.createCommentVNode("v-if",!0),n.btmVisible?(e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("div",j,[n.deleteVisible?(e.openBlock(),e.createBlock(r,{key:0,type:"error",onClick:n.deleteEvt},{default:e.withCtx(()=>[P]),_:1},8,["onClick"])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",U,[n.closeVisible?(e.openBlock(),e.createBlock(r,{key:0,plain:"",onClick:n.close},{default:e.withCtx(()=>[q]),_:1},8,["onClick"])):e.createCommentVNode("v-if",!0),n.updateVisible?(e.openBlock(),e.createBlock(r,{key:1,class:"es-margin-l--base",onClick:n.update},{default:e.withCtx(()=>[O]),_:1},8,["onClick"])):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0)])}var H=`.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;
}`;h(H),k.render=W,k.__scopeId="data-v-f553ffa8",k.__file="components/search-wrapper/index.vue",k.install=n=>{n.component("es-search-wrapper",k)};var g=e.defineComponent({components:{EsButton:_,EsInput:u},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 d;return(d=n.modelValue)!=null?d:""},set(d){d.length&&/^[1-9][0-9]*$/.test(d)?o("update:modelValue",d):o("update:modelValue","")}}),l=e.computed(()=>n.showBtm.length),c=e.computed(()=>{var d;return(d=n.showBtm)==null?void 0:d.includes("delete")}),i=e.computed(()=>{var d;return(d=n.showBtm)==null?void 0:d.includes("close")}),r=e.computed(()=>{var d;return(d=n.showBtm)==null?void 0:d.includes("update")});return{btmVisible:l,deleteVisible:c,closeVisible:i,updateVisible:r,slots:t,update:()=>{o("done")},deleteEvt:()=>{o("delete")},close:()=>{o("close")},numberValue:a}}});e.pushScopeId("data-v-7447c320");const R={class:"es-search-wrapper"},G={key:0,class:"es-search-wrapper__content"},J={key:1,class:"es-search-wrapper__bottom"},K={class:"es-search-wrapper__bottom__left"},Q=e.createTextVNode("\u6E05\u7A7A"),X={class:"es-search-wrapper__bottom__right"},Y=e.createTextVNode("\u5173\u95ED"),Z=e.createTextVNode("\u67E5\u8BE2");e.popScopeId();function ee(n,t,o,a,l,c){const i=e.resolveComponent("es-input"),r=e.resolveComponent("es-button");return e.openBlock(),e.createElementBlock("div",R,[e.createVNode(i,{modelValue:n.numberValue,"onUpdate:modelValue":t[0]||(t[0]=s=>n.numberValue=s),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",G,[e.renderSlot(n.$slots,"content")])):e.createCommentVNode("v-if",!0),n.btmVisible?(e.openBlock(),e.createElementBlock("div",J,[e.createElementVNode("div",K,[n.deleteVisible?(e.openBlock(),e.createBlock(r,{key:0,type:"error",onClick:n.deleteEvt},{default:e.withCtx(()=>[Q]),_:1},8,["onClick"])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",X,[n.closeVisible?(e.openBlock(),e.createBlock(r,{key:0,plain:!0,onClick:n.close},{default:e.withCtx(()=>[Y]),_:1},8,["onClick"])):e.createCommentVNode("v-if",!0),n.updateVisible?(e.openBlock(),e.createBlock(r,{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 ne=`.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;
}`;h(ne),g.render=ee,g.__scopeId="data-v-7447c320",g.__file="components/search-wrapper-number/index.vue",g.install=n=>{n.component("es-search-wrapper-number",g)};var V=e.defineComponent({components:{EsSearchLabel:b,EsSearchWrapper:k,EsSearchWrapperNumber:g},props:{label:[String,Number],modelValue:[String,Number],placeholder:String,prependText:String,defaultValue:{type:[String,Number],default:null},defaultLabel:{type:String,default:"\u5168\u90E8"},labelFormat:[Function]},emits:["update:modelValue","done","clear","close"],setup(n,{emit:t}){const o=e.ref(""),a=e.ref(""),l=()=>{Number(o.value)===n.defaultValue||o.value===""?a.value=String(n.defaultLabel):a.value=(n==null?void 0:n.labelFormat)?n==null?void 0:n.labelFormat(o.value):o.value},c=s=>{o.value===""?(a.value=n.defaultLabel,t("update:modelValue",n.defaultValue),t("done",n.defaultValue)):(l(),t("update:modelValue",o.value),t("done",o.value),s&&s())};return e.watch(()=>n.modelValue,s=>{Number(s)===n.defaultValue?(o.value="",a.value=n.defaultLabel):(o.value=String(s),l())},{immediate:!0}),{value:o,clearInput:s=>{o.value="",a.value=n.defaultLabel,t("update:modelValue",n.defaultValue),t("clear",n.defaultValue),s&&s()},valueLabel:a,done:c,close:s=>{o.value=String(n.modelValue),Number(o.value)===n.defaultValue?(o.value="",a.value=n.defaultLabel,t("close",n.defaultValue)):(l(),t("close",o.value)),s&&s()}}}});const te={class:"es-search-input-number"};function oe(n,t,o,a,l,c){const i=e.resolveComponent("es-search-wrapper-number"),r=e.resolveComponent("es-search-label");return e.openBlock(),e.createElementBlock("div",te,[e.createVNode(r,{label:n.label,value:n.valueLabel},{panel:e.withCtx(({closePanel:s})=>[e.createVNode(i,{modelValue:n.value,"onUpdate:modelValue":t[0]||(t[0]=f=>n.value=f),placeholder:n.placeholder,prependText:n.prependText,onDone:f=>n.done(s),onDelete:f=>n.clearInput(s),onClose:f=>n.close(s)},null,8,["modelValue","placeholder","prependText","onDone","onDelete","onClose"])]),_:1},8,["label","value"])])}return V.render=oe,V.__file="components/search-input-number/index.vue",V.install=n=>{n.component("es-search-input-number",V)},V});