django-vue3-admin-web/node_modules/e-icon-picker/components/eInput/index.umd.js
2025-10-20 21:21:14 +08:00

7 lines
7.6 KiB
JavaScript

/**
* e-icon-picker v2.1.1
* (c) 2019 - 2022 cnovel.club
* @license MIT
*/
(function(c,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(c=typeof globalThis<"u"?globalThis:c||self,t(c.eInput={},c.Vue))})(this,function(c,t){"use strict";var h;const u=typeof window<"u";u&&((h=window==null?void 0:window.navigator)!=null&&h.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function p(e){return/^(https?:|data:|\/\/?)/.test(e)}(function(){return u&&document&&document.addEventListener?(e,n,o)=>{e&&n&&o&&e.addEventListener(n,o,!1)}:(e,n,o)=>{e&&n&&o&&e.attachEvent("on"+n,o)}})(),function(){return u&&document&&document.removeEventListener?function(e,n,o){e&&n&&e.removeEventListener(n,o,!1)}:function(e,n,o){e&&n&&e.detachEvent("on"+n,o)}}(),u&&function(e,n,o){!e.composedPath&&o&&(e.composedPath=function(){if(this.path)return this.path;let s=this.target;for(this.path=[];s.parentNode!==null;)this.path.push(s),s=s.parentNode;return this.path.push(n,o),this.path}),String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(s,i){return i=!i||i<0?0:+i,this.substring(i,i+s.length)===s}})}(Event.prototype,document,window);const E="update:modelValue",g="change",N="input",V="clear",B="focus",I="blur",b="mouseleave",w="mouseenter",C="click",v=t.defineComponent({name:"e-icon",props:{iconName:{type:String,required:!0},className:{type:String,default:""}},emits:[C],setup(e,n){return{click:(s,i)=>{i&&i.preventDefault(),n.emit(C,s)}}},computed:{fontClass(){return this.iconName&&this.iconName.trim().length>2&&!p(this.iconName)&&!this.iconName.startsWith("#")&&!this.iconName.startsWith("component ")},svg(){return this.iconName&&this.iconName.trim().length>2&&!p(this.iconName)&&this.iconName.startsWith("#")},isComponent(){return this.iconName&&this.iconName.trim().length>2&&!p(this.iconName)&&this.iconName.startsWith("component ")},component(){return this.iconName.replace("component ","")},isExternal(){return p(this.iconName)},svgClass(){return this.className?"icon "+this.className:"icon"},styleExternalIcon(){return{"background-image":`url(${this.iconName})`,"background-repeat":"no-repeat","background-size":"100% 100%","-moz-background-size":"100% 100%"}}}}),q="",y=(e,n)=>{const o=e.__vccOpts||e;for(const[s,i]of n)o[s]=i;return o},M=["xlink:href"];function S(e,n,o,s,i,d){return e.fontClass?(t.openBlock(),t.createElementBlock("i",{key:0,class:t.normalizeClass(["e-icon",[e.iconName,e.className]]),onClick:n[0]||(n[0]=r=>e.click(e.iconName,r))},null,2)):e.svg?(t.openBlock(),t.createElementBlock("svg",{key:1,class:t.normalizeClass([e.svgClass,"e-icon e-icon-svg"]),"aria-hidden":"true",onClick:n[1]||(n[1]=r=>e.click(e.iconName,r))},[t.createElementVNode("use",{"xlink:href":e.iconName},null,8,M)],2)):e.isComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.component),{key:2,class:"e-icon icon e-icon-svg",onClick:n[2]||(n[2]=r=>e.click(e.iconName,r))})):e.isExternal?(t.openBlock(),t.createElementBlock("div",{key:3,style:t.normalizeStyle(e.styleExternalIcon),class:t.normalizeClass([e.className,"e-icon icon external-icon"]),onClick:n[3]||(n[3]=r=>e.click(e.iconName,r))},null,6)):t.createCommentVNode("",!0)}const L=y(v,[["render",S],["__scopeId","data-v-8e177972"]]),T=t.defineComponent({name:"e-input",components:{eIcon:L},props:{prefixIcon:{type:String,default:"eiconfont e-icon-bi"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},placeholder:{type:String,default:""},style:{type:Object,default:{}},clearable:{type:Boolean,default:!0},modelValue:{type:String,default:""},size:{type:String,default:"default",required:!1}},setup(e,{emit:n}){const o=t.reactive({prefixIcon:e.prefixIcon,focused:!1,hovering:!1}),s=t.shallowRef(),i=t.computed(()=>s.value),d=t.computed(()=>e.modelValue?String(e.modelValue):""),r=l=>{let{value:k}=l.target;n(E,k),n(N,k),m()},a=l=>{o.focused=!0,n(B,l)},W=l=>{o.focused=!1,n(I,l)},F=l=>{n(g,l.target.value)},j=t.computed(()=>e.clearable&&!e.disabled&&!e.readonly&&!!d.value&&(o.focused||o.hovering)),D=l=>{o.hovering=!1,n(b,l)},R=l=>{o.hovering=!0,n(w,l)},m=()=>{const l=i.value;!l||l.value===d.value||(l.value=d.value)};return t.watch(d,()=>m()),t.onMounted(async()=>{m()}),{state:o,handleInput:r,handleFocus:a,handleBlur:W,handleChange:F,showClear:j,handleMouseLeave:D,handleMouseEnter:R,input:s,clear:()=>{n(E,""),n(g,""),n(V),n(N,"")}}}}),G="",z={class:"prefix-icon"},$=["disabled","readonly","placeholder"],O={t:"1657525825723",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},P=["fill"];function A(e,n,o,s,i,d){const r=t.resolveComponent("e-icon");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["e-input",`e-input--${e.size}`]),onMouseenter:n[5]||(n[5]=(...a)=>e.handleMouseEnter&&e.handleMouseEnter(...a)),onMouseleave:n[6]||(n[6]=(...a)=>e.handleMouseLeave&&e.handleMouseLeave(...a))},[t.createElementVNode("div",z,[t.renderSlot(e.$slots,"prepend",{icon:e.state.prefixIcon},()=>[t.createVNode(r,{"icon-name":e.state.prefixIcon,class:"e-icon"},null,8,["icon-name"])],!0)]),t.createElementVNode("input",{type:"text",ref:"input",class:t.normalizeClass(["e-input-inner",e.disabled?"is-disabled":""]),disabled:e.disabled,readonly:e.readonly,placeholder:e.placeholder,style:t.normalizeStyle(e.style),onInput:n[0]||(n[0]=(...a)=>e.handleInput&&e.handleInput(...a)),onFocus:n[1]||(n[1]=(...a)=>e.handleFocus&&e.handleFocus(...a)),onBlur:n[2]||(n[2]=(...a)=>e.handleBlur&&e.handleBlur(...a)),onChange:n[3]||(n[3]=(...a)=>e.handleChange&&e.handleChange(...a))},null,46,$),e.showClear?(t.openBlock(),t.createElementBlock("div",{key:0,class:"suffix-icon",onClick:n[4]||(n[4]=t.withModifiers((...a)=>e.clear&&e.clear(...a),["stop"]))},[(t.openBlock(),t.createElementBlock("svg",O,[t.createTextVNode(' p-id="1823" width="200" height="200"> '),t.createElementVNode("path",{d:"M466.986667 512L376.021333 421.973333a33.450667 33.450667 0 0 1-8.96-22.997333 30.72 30.72 0 0 1 9.514667-22.485333 30.72 30.72 0 0 1 22.485333-9.514667c8.661333 0 16.341333 2.986667 22.997334 8.96l90.026666 91.050667 90.026667-91.008c9.301333-8.661333 19.797333-11.349333 31.445333-8.021334a30.890667 30.890667 0 0 1 22.528 22.485334c3.328 11.690667 0.682667 22.186667-8.021333 31.530666L557.013333 512l91.008 89.984c8.661333 9.344 11.349333 19.84 8.021334 31.488a30.890667 30.890667 0 0 1-22.485334 22.485333c-11.690667 3.370667-22.186667 0.682667-31.530666-7.978666L512 556.970667l-89.984 91.008a33.450667 33.450667 0 0 1-23.04 8.96 30.72 30.72 0 0 1-22.485333-9.472 30.72 30.72 0 0 1-9.472-22.485334c0-8.704 2.986667-16.341333 8.96-23.04L466.986667 512zM512 896c108.672-2.688 199.168-40.192 271.488-112.512C855.808 711.168 893.312 620.672 896 512c-2.688-108.672-40.192-199.168-112.512-271.488C711.168 168.192 620.672 130.688 512 128c-108.672 2.688-199.168 40.192-271.488 112.512C168.192 312.874667 130.688 403.370667 128 512c2.688 108.672 40.192 199.168 112.512 271.488C312.874667 855.808 403.370667 893.312 512 896z m0 64c-126.677333-3.328-232.192-47.146667-316.501333-131.498667C111.146667 744.192 67.328 638.72 64 512c3.328-126.677333 47.146667-232.192 131.498667-316.501333C279.808 111.146667 385.28 67.328 512 64c126.677333 3.328 232.192 47.146667 316.501333 131.498667C912.853333 279.808 956.672 385.28 960 512c-3.328 126.677333-47.146667 232.192-131.498667 316.501333C744.192 912.853333 638.72 956.672 512 960z","p-id":"1824",fill:e.state.focused?"#606266":"#C0C4CC"},null,8,P)]))])):t.createCommentVNode("",!0)],34)}const f=y(T,[["render",A],["__scopeId","data-v-d2b0f76c"]]),U={install(e){e.component(f.name,f)}};c.default=U,c.eInput=f,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});