st-comp 0.0.143 → 0.0.144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/ChartLayout.js +2 -2
- package/es/ConfigProvider.cjs +1 -1
- package/es/ConfigProvider.js +28 -11
- package/es/Dialog.cjs +1 -1
- package/es/Dialog.js +22 -24
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +28 -27
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +14 -14
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +24 -25
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +12 -12
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +16 -16
- package/es/Table.cjs +1 -1
- package/es/Table.js +16 -16
- package/es/User.cjs +1 -1
- package/es/User.js +510 -382
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +37 -36
- package/es/VirtualTable.js +10 -10
- package/es/_initCloneObject-14b53c6f.js +81 -0
- package/es/_initCloneObject-441db749.cjs +1 -0
- package/es/{base-3ecbc734.js → base-437d17f3.js} +25 -25
- package/es/{castArray-7d3fc921.js → castArray-4251bbe4.js} +1 -1
- package/es/{config-provider-83904b4d.js → config-provider-55482a43.js} +3 -3
- package/es/{debounce-7344b088.js → debounce-ac30be50.js} +14 -14
- package/es/{dropdown-7da44c8f.js → dropdown-634b5e27.js} +4 -4
- package/es/{dropdown-9a974876.cjs → dropdown-d7c59a21.cjs} +1 -1
- package/es/{el-button-24f79286.js → el-button-e1665717.js} +3 -3
- package/es/el-checkbox-group-492b95cc.cjs +1 -0
- package/es/el-checkbox-group-e8fece80.js +67 -0
- package/es/{el-empty-79c5f7a8.js → el-empty-bacc6613.js} +1 -1
- package/es/el-form-item-5bdffd07.cjs +12 -0
- package/es/el-form-item-af1855f0.js +1262 -0
- package/es/{el-input-6c6f5bda.cjs → el-input-23e2bac3.cjs} +1 -1
- package/es/{el-input-ee7db655.js → el-input-4961b99f.js} +71 -71
- package/es/{el-input-number-0524d787.cjs → el-input-number-40a81eb5.cjs} +1 -1
- package/es/{el-input-number-63c21037.js → el-input-number-610fc8ba.js} +24 -24
- package/es/{el-menu-item-dc904a35.cjs → el-menu-item-78b858f2.cjs} +1 -1
- package/es/{el-menu-item-0d92e7dc.js → el-menu-item-7d04c11a.js} +7 -7
- package/es/{el-message-71aa42ca.js → el-message-c3b3ac96.js} +16 -16
- package/es/{el-message-562e923d.cjs → el-message-d4df8136.cjs} +1 -1
- package/es/{el-overlay-6056c89a.js → el-overlay-12dd9b35.js} +140 -137
- package/es/el-overlay-bc0790a2.cjs +1 -0
- package/es/{el-popover-c8b2456c.js → el-popover-0aa071f2.js} +4 -4
- package/es/{el-popover-8735b1fa.cjs → el-popover-8a77e015.cjs} +1 -1
- package/es/el-popper-50100766.js +2262 -0
- package/es/el-popper-746070ba.cjs +1 -0
- package/es/{el-scrollbar-66f3bb72.js → el-scrollbar-562d0595.js} +11 -11
- package/es/{el-select-5fb7d469.js → el-select-9381b156.js} +55 -55
- package/es/el-select-b162dffc.cjs +1 -0
- package/es/{el-table-column-560db3aa.js → el-table-column-55bffba5.js} +1049 -1124
- package/es/el-table-column-6d761fce.cjs +14 -0
- package/es/el-tag-985d9aff.js +279 -0
- package/es/el-tag-c51a6490.cjs +1 -0
- package/es/{index-68ee64fa.js → index-09e01b1d.js} +7 -7
- package/es/{index-fa07a823.js → index-0cb48e01.js} +81 -78
- package/es/index-39ec9741.js +112 -0
- package/es/index-3bf8d597.cjs +1 -0
- package/es/index-a387515d.cjs +1 -0
- package/es/index-a902a0d9.js +59 -0
- package/es/index-deb8de52.cjs +1 -0
- package/es/{raf-377cf8f5.js → raf-b128c7b7.js} +1 -1
- package/es/{scroll-1efa8148.js → scroll-387fcfdb.js} +1 -1
- package/es/style.css +1 -1
- package/es/{use-form-common-props-9c0363ac.js → use-form-common-props-f377e500.js} +30 -30
- package/es/{vnode-cfcdab70.js → vnode-7dfd4ed5.js} +1 -1
- package/es/{zh-cn-4a476dc8.js → zh-cn-eb9c2820.js} +2 -2
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +141 -141
- package/lib/{index-a992391a.js → index-e7a32fed.js} +12131 -11996
- package/lib/{python-58a62aaf.js → python-ae8d98bd.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/ConfigProvider/index.vue +28 -0
- package/packages/User/index.vue +87 -1
- package/es/el-form-item-7d32befa.cjs +0 -12
- package/es/el-form-item-afc3dcf2.js +0 -1324
- package/es/el-overlay-891dcc40.cjs +0 -1
- package/es/el-popper-d3eef7ed.js +0 -2093
- package/es/el-popper-f62316cd.cjs +0 -1
- package/es/el-select-928f8c19.cjs +0 -1
- package/es/el-table-column-dd8b62aa.cjs +0 -14
- package/es/el-tag-3b03d13e.cjs +0 -1
- package/es/el-tag-6a31c968.js +0 -450
- package/es/event-09e37cc8.js +0 -6
- package/es/event-61f49698.cjs +0 -1
- package/es/index-80a2b137.cjs +0 -1
- package/es/index-a1ecf26c.js +0 -167
- package/es/index-e1e83173.cjs +0 -1
- package/es/refs-46cf8186.js +0 -9
- package/es/refs-d00b710b.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),ge=require("./el-scrollbar-d1c3e7f7.cjs"),f=require("./use-form-common-props-1b84d8f4.cjs"),s=require("./base-ec05f348.cjs"),be=require("./typescript-b63f8e83.cjs"),Ce=require("./el-popper-f62316cd.cjs"),O=require("./event-61f49698.cjs"),te=require("./index-80a2b137.cjs"),ne=()=>s.isClient&&/firefox/i.test(window.navigator.userAgent);let h;const xe={height:"0",visibility:"hidden",overflow:ne()?"":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},we=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function Ee(n){const p=window.getComputedStyle(n),u=p.getPropertyValue("box-sizing"),o=Number.parseFloat(p.getPropertyValue("padding-bottom"))+Number.parseFloat(p.getPropertyValue("padding-top")),i=Number.parseFloat(p.getPropertyValue("border-bottom-width"))+Number.parseFloat(p.getPropertyValue("border-top-width"));return{contextStyle:we.map(l=>[l,p.getPropertyValue(l)]),paddingSize:o,borderSize:i,boxSizing:u}}function oe(n,p=1,u){var o;h||(h=document.createElement("textarea"),document.body.appendChild(h));const{paddingSize:i,borderSize:c,boxSizing:l,contextStyle:y}=Ee(n);y.forEach(([v,S])=>h==null?void 0:h.style.setProperty(v,S)),Object.entries(xe).forEach(([v,S])=>h==null?void 0:h.style.setProperty(v,S,"important")),h.value=n.value||n.placeholder||"";let d=h.scrollHeight;const b={};l==="border-box"?d=d+c:l==="content-box"&&(d=d-i),h.value="";const m=h.scrollHeight-i;if(s.isNumber(p)){let v=m*p;l==="border-box"&&(v=v+i+c),d=Math.max(v,d),b.minHeight=`${v}px`}if(s.isNumber(u)){let v=m*u;l==="border-box"&&(v=v+i+c),d=Math.min(v,d)}return b.height=`${d}px`,(o=h.parentNode)==null||o.removeChild(h),h=void 0,b}const ke=s.buildProps({id:{type:String,default:void 0},size:f.useSizeProp,disabled:Boolean,modelValue:{type:s.definePropType([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:s.definePropType([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:f.iconPropType},prefixIcon:{type:f.iconPropType},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:s.definePropType([Object,Array,String]),default:()=>be.mutable({})},autofocus:Boolean,rows:{type:Number,default:2},...Ce.useAriaProps(["ariaLabel"])}),Se={[O.UPDATE_MODEL_EVENT]:n=>s.isString(n),input:n=>s.isString(n),change:n=>s.isString(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,mouseleave:n=>n instanceof MouseEvent,mouseenter:n=>n instanceof MouseEvent,keydown:n=>n instanceof Event,compositionstart:n=>n instanceof CompositionEvent,compositionupdate:n=>n instanceof CompositionEvent,compositionend:n=>n instanceof CompositionEvent},Ie=["class","style"],Be=/^on[A-Z]/,Ne=(n={})=>{const{excludeListeners:p=!1,excludeKeys:u}=n,o=e.computed(()=>((u==null?void 0:u.value)||[]).concat(Ie)),i=e.getCurrentInstance();return i?e.computed(()=>{var c;return s.fromPairs(Object.entries((c=i.proxy)==null?void 0:c.$attrs).filter(([l])=>!o.value.includes(l)&&!(p&&Be.test(l))))}):(s.debugWarn("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),e.computed(()=>({})))};function ze(n){let p;function u(){if(n.value==null)return;const{selectionStart:i,selectionEnd:c,value:l}=n.value;if(i==null||c==null)return;const y=l.slice(0,Math.max(0,i)),d=l.slice(Math.max(0,c));p={selectionStart:i,selectionEnd:c,value:l,beforeTxt:y,afterTxt:d}}function o(){if(n.value==null||p==null)return;const{value:i}=n.value,{beforeTxt:c,afterTxt:l,selectionStart:y}=p;if(c==null||l==null||y==null)return;let d=i.length;if(i.endsWith(l))d=i.length-l.length;else if(i.startsWith(c))d=c.length;else{const b=c[y-1],m=i.indexOf(b,y-1);m!==-1&&(d=m+1)}n.value.setSelectionRange(d,d)}return[u,o]}const Ve=e.defineComponent({name:"ElInput",inheritAttrs:!1}),Pe=e.defineComponent({...Ve,props:ke,emits:Se,setup(n,{expose:p,emit:u}){const o=n,i=e.useAttrs(),c=Ne(),l=e.useSlots(),y=e.computed(()=>[o.type==="textarea"?A.b():r.b(),r.m(S.value),r.is("disabled",x.value),r.is("exceed",ue.value),{[r.b("group")]:l.prepend||l.append,[r.m("prefix")]:l.prefix||o.prefixIcon,[r.m("suffix")]:l.suffix||o.suffixIcon||o.clearable||o.showPassword,[r.bm("suffix","password-clear")]:F.value&&R.value,[r.b("hidden")]:o.type==="hidden"},i.class]),d=e.computed(()=>[r.e("wrapper"),r.is("focus",T.value)]),{form:b,formItem:m}=f.useFormItem(),{inputId:v}=f.useFormItemInputId(o,{formItemContext:m}),S=f.useFormSize(),x=f.useFormDisabled(),r=s.useNamespace("input"),A=s.useNamespace("textarea"),z=e.shallowRef(),g=e.shallowRef(),D=e.ref(!1),V=e.ref(!1),H=e.ref(),P=e.shallowRef(o.inputStyle),w=e.computed(()=>z.value||g.value),{wrapperRef:re,isFocused:T,handleFocus:ae,handleBlur:le}=te.useFocusController(w,{beforeFocus(){return x.value},afterBlur(){var t;o.validateEvent&&((t=m==null?void 0:m.validate)==null||t.call(m,"blur").catch(a=>s.debugWarn(a)))}}),$=e.computed(()=>{var t;return(t=b==null?void 0:b.statusIcon)!=null?t:!1}),I=e.computed(()=>(m==null?void 0:m.validateState)||""),W=e.computed(()=>I.value&&f.ValidateComponentsMap[I.value]),se=e.computed(()=>V.value?f.view_default:f.hide_default),ie=e.computed(()=>[i.style]),q=e.computed(()=>[o.inputStyle,P.value,{resize:o.resize}]),C=e.computed(()=>s.isNil(o.modelValue)?"":String(o.modelValue)),F=e.computed(()=>o.clearable&&!x.value&&!o.readonly&&!!C.value&&(T.value||D.value)),R=e.computed(()=>o.showPassword&&!x.value&&!!C.value&&(!!C.value||T.value)),E=e.computed(()=>o.showWordLimit&&!!o.maxlength&&(o.type==="text"||o.type==="textarea")&&!x.value&&!o.readonly&&!o.showPassword),L=e.computed(()=>C.value.length),ue=e.computed(()=>!!E.value&&L.value>Number(o.maxlength)),ce=e.computed(()=>!!l.suffix||!!o.suffixIcon||F.value||o.showPassword||E.value||!!I.value&&$.value),[K,j]=ze(z);ge.useResizeObserver(g,t=>{if(de(),!E.value||o.resize!=="both")return;const a=t[0],{width:k}=a.contentRect;H.value={right:`calc(100% - ${k+15+6}px)`}});const B=()=>{const{type:t,autosize:a}=o;if(!(!s.isClient||t!=="textarea"||!g.value))if(a){const k=s.isObject(a)?a.minRows:void 0,Q=s.isObject(a)?a.maxRows:void 0,ee=oe(g.value,k,Q);P.value={overflowY:"hidden",...ee},e.nextTick(()=>{g.value.offsetHeight,P.value=ee})}else P.value={minHeight:oe(g.value).minHeight}},de=(t=>{let a=!1;return()=>{var k;if(a||!o.autosize)return;((k=g.value)==null?void 0:k.offsetParent)===null||(t(),a=!0)}})(B),N=()=>{const t=w.value,a=o.formatter?o.formatter(C.value):C.value;!t||t.value===a||(t.value=a)},M=async t=>{K();let{value:a}=t.target;if(o.formatter&&(a=o.parser?o.parser(a):a),!Y.value){if(a===C.value){N();return}u(O.UPDATE_MODEL_EVENT,a),u("input",a),await e.nextTick(),N(),j()}},U=t=>{u("change",t.target.value)},{isComposing:Y,handleCompositionStart:_,handleCompositionUpdate:X,handleCompositionEnd:Z}=te.useComposition({emit:u,afterComposition:M}),pe=()=>{K(),V.value=!V.value,setTimeout(j)},fe=()=>{var t;return(t=w.value)==null?void 0:t.focus()},me=()=>{var t;return(t=w.value)==null?void 0:t.blur()},ve=t=>{D.value=!1,u("mouseleave",t)},he=t=>{D.value=!0,u("mouseenter",t)},G=t=>{u("keydown",t)},ye=()=>{var t;(t=w.value)==null||t.select()},J=()=>{u(O.UPDATE_MODEL_EVENT,""),u("change",""),u("clear"),u("input","")};return e.watch(()=>o.modelValue,()=>{var t;e.nextTick(()=>B()),o.validateEvent&&((t=m==null?void 0:m.validate)==null||t.call(m,"change").catch(a=>s.debugWarn(a)))}),e.watch(C,()=>N()),e.watch(()=>o.type,async()=>{await e.nextTick(),N(),B()}),e.onMounted(()=>{!o.formatter&&o.parser&&s.debugWarn("ElInput","If you set the parser, you also need to set the formatter."),N(),e.nextTick(B)}),p({input:z,textarea:g,ref:w,textareaStyle:q,autosize:e.toRef(o,"autosize"),isComposing:Y,focus:fe,blur:me,select:ye,clear:J,resizeTextarea:B}),(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(y),{[e.unref(r).bm("group","append")]:t.$slots.append,[e.unref(r).bm("group","prepend")]:t.$slots.prepend}]),style:e.normalizeStyle(e.unref(ie)),onMouseenter:he,onMouseleave:ve},[e.createCommentVNode(" input "),t.type!=="textarea"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createCommentVNode(" prepend slot "),t.$slots.prepend?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(r).be("group","prepend"))},[e.renderSlot(t.$slots,"prepend")],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{ref_key:"wrapperRef",ref:re,class:e.normalizeClass(e.unref(d))},[e.createCommentVNode(" prefix slot "),t.$slots.prefix||t.prefixIcon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(r).e("prefix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r).e("prefix-inner"))},[e.renderSlot(t.$slots,"prefix"),t.prefixIcon?(e.openBlock(),e.createBlock(e.unref(f.ElIcon),{key:0,class:e.normalizeClass(e.unref(r).e("icon"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.prefixIcon)))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0)],2)],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(v),ref_key:"input",ref:z,class:e.unref(r).e("inner")},e.unref(c),{minlength:t.minlength,maxlength:t.maxlength,type:t.showPassword?V.value?"text":"password":t.type,disabled:e.unref(x),readonly:t.readonly,autocomplete:t.autocomplete,tabindex:t.tabindex,"aria-label":t.ariaLabel,placeholder:t.placeholder,style:t.inputStyle,form:t.form,autofocus:t.autofocus,role:t.containerRole,onCompositionstart:e.unref(_),onCompositionupdate:e.unref(X),onCompositionend:e.unref(Z),onInput:M,onChange:U,onKeydown:G}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","onCompositionstart","onCompositionupdate","onCompositionend"]),e.createCommentVNode(" suffix slot "),e.unref(ce)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(r).e("suffix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r).e("suffix-inner"))},[!e.unref(F)||!e.unref(R)||!e.unref(E)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(t.$slots,"suffix"),t.suffixIcon?(e.openBlock(),e.createBlock(e.unref(f.ElIcon),{key:0,class:e.normalizeClass(e.unref(r).e("icon"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.suffixIcon)))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0)],64)):e.createCommentVNode("v-if",!0),e.unref(F)?(e.openBlock(),e.createBlock(e.unref(f.ElIcon),{key:1,class:e.normalizeClass([e.unref(r).e("icon"),e.unref(r).e("clear")]),onMousedown:e.withModifiers(e.unref(s.NOOP),["prevent"]),onClick:J},{default:e.withCtx(()=>[e.createVNode(e.unref(f.circle_close_default))]),_:1},8,["class","onMousedown"])):e.createCommentVNode("v-if",!0),e.unref(R)?(e.openBlock(),e.createBlock(e.unref(f.ElIcon),{key:2,class:e.normalizeClass([e.unref(r).e("icon"),e.unref(r).e("password")]),onClick:pe},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(se))))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0),e.unref(E)?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(e.unref(r).e("count"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r).e("count-inner"))},e.toDisplayString(e.unref(L))+" / "+e.toDisplayString(t.maxlength),3)],2)):e.createCommentVNode("v-if",!0),e.unref(I)&&e.unref(W)&&e.unref($)?(e.openBlock(),e.createBlock(e.unref(f.ElIcon),{key:4,class:e.normalizeClass([e.unref(r).e("icon"),e.unref(r).e("validateIcon"),e.unref(r).is("loading",e.unref(I)==="validating")])},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(W))))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0)],2)],2)):e.createCommentVNode("v-if",!0)],2),e.createCommentVNode(" append slot "),t.$slots.append?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(r).be("group","append"))},[e.renderSlot(t.$slots,"append")],2)):e.createCommentVNode("v-if",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createCommentVNode(" textarea "),e.createElementVNode("textarea",e.mergeProps({id:e.unref(v),ref_key:"textarea",ref:g,class:[e.unref(A).e("inner"),e.unref(r).is("focus",e.unref(T))]},e.unref(c),{minlength:t.minlength,maxlength:t.maxlength,tabindex:t.tabindex,disabled:e.unref(x),readonly:t.readonly,autocomplete:t.autocomplete,style:e.unref(q),"aria-label":t.ariaLabel,placeholder:t.placeholder,form:t.form,autofocus:t.autofocus,rows:t.rows,role:t.containerRole,onCompositionstart:e.unref(_),onCompositionupdate:e.unref(X),onCompositionend:e.unref(Z),onInput:M,onFocus:e.unref(ae),onBlur:e.unref(le),onChange:U,onKeydown:G}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),e.unref(E)?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(H.value),class:e.normalizeClass(e.unref(r).e("count"))},e.toDisplayString(e.unref(L))+" / "+e.toDisplayString(t.maxlength),7)):e.createCommentVNode("v-if",!0)],64))],38))}});var Te=s._export_sfc(Pe,[["__file","input.vue"]]);const Fe=s.withInstall(Te);exports.ElInput=Fe;exports.isFirefox=ne;
|
|
1
|
+
"use strict";const e=require("vue"),ge=require("./el-scrollbar-d1c3e7f7.cjs"),f=require("./use-form-common-props-1b84d8f4.cjs"),s=require("./base-ec05f348.cjs"),be=require("./typescript-b63f8e83.cjs"),Ce=require("./el-popper-746070ba.cjs"),O=require("./index-3bf8d597.cjs"),te=require("./index-deb8de52.cjs"),ne=()=>s.isClient&&/firefox/i.test(window.navigator.userAgent);let h;const xe={height:"0",visibility:"hidden",overflow:ne()?"":"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},we=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function Ee(n){const p=window.getComputedStyle(n),u=p.getPropertyValue("box-sizing"),o=Number.parseFloat(p.getPropertyValue("padding-bottom"))+Number.parseFloat(p.getPropertyValue("padding-top")),i=Number.parseFloat(p.getPropertyValue("border-bottom-width"))+Number.parseFloat(p.getPropertyValue("border-top-width"));return{contextStyle:we.map(l=>[l,p.getPropertyValue(l)]),paddingSize:o,borderSize:i,boxSizing:u}}function oe(n,p=1,u){var o;h||(h=document.createElement("textarea"),document.body.appendChild(h));const{paddingSize:i,borderSize:c,boxSizing:l,contextStyle:y}=Ee(n);y.forEach(([v,S])=>h==null?void 0:h.style.setProperty(v,S)),Object.entries(xe).forEach(([v,S])=>h==null?void 0:h.style.setProperty(v,S,"important")),h.value=n.value||n.placeholder||"";let d=h.scrollHeight;const b={};l==="border-box"?d=d+c:l==="content-box"&&(d=d-i),h.value="";const m=h.scrollHeight-i;if(s.isNumber(p)){let v=m*p;l==="border-box"&&(v=v+i+c),d=Math.max(v,d),b.minHeight=`${v}px`}if(s.isNumber(u)){let v=m*u;l==="border-box"&&(v=v+i+c),d=Math.min(v,d)}return b.height=`${d}px`,(o=h.parentNode)==null||o.removeChild(h),h=void 0,b}const ke=s.buildProps({id:{type:String,default:void 0},size:f.useSizeProp,disabled:Boolean,modelValue:{type:s.definePropType([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:s.definePropType([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:f.iconPropType},prefixIcon:{type:f.iconPropType},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:s.definePropType([Object,Array,String]),default:()=>be.mutable({})},autofocus:Boolean,rows:{type:Number,default:2},...Ce.useAriaProps(["ariaLabel"])}),Se={[O.UPDATE_MODEL_EVENT]:n=>s.isString(n),input:n=>s.isString(n),change:n=>s.isString(n),focus:n=>n instanceof FocusEvent,blur:n=>n instanceof FocusEvent,clear:()=>!0,mouseleave:n=>n instanceof MouseEvent,mouseenter:n=>n instanceof MouseEvent,keydown:n=>n instanceof Event,compositionstart:n=>n instanceof CompositionEvent,compositionupdate:n=>n instanceof CompositionEvent,compositionend:n=>n instanceof CompositionEvent},Ie=["class","style"],Be=/^on[A-Z]/,Ne=(n={})=>{const{excludeListeners:p=!1,excludeKeys:u}=n,o=e.computed(()=>((u==null?void 0:u.value)||[]).concat(Ie)),i=e.getCurrentInstance();return i?e.computed(()=>{var c;return s.fromPairs(Object.entries((c=i.proxy)==null?void 0:c.$attrs).filter(([l])=>!o.value.includes(l)&&!(p&&Be.test(l))))}):(s.debugWarn("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),e.computed(()=>({})))};function ze(n){let p;function u(){if(n.value==null)return;const{selectionStart:i,selectionEnd:c,value:l}=n.value;if(i==null||c==null)return;const y=l.slice(0,Math.max(0,i)),d=l.slice(Math.max(0,c));p={selectionStart:i,selectionEnd:c,value:l,beforeTxt:y,afterTxt:d}}function o(){if(n.value==null||p==null)return;const{value:i}=n.value,{beforeTxt:c,afterTxt:l,selectionStart:y}=p;if(c==null||l==null||y==null)return;let d=i.length;if(i.endsWith(l))d=i.length-l.length;else if(i.startsWith(c))d=c.length;else{const b=c[y-1],m=i.indexOf(b,y-1);m!==-1&&(d=m+1)}n.value.setSelectionRange(d,d)}return[u,o]}const Ve=e.defineComponent({name:"ElInput",inheritAttrs:!1}),Pe=e.defineComponent({...Ve,props:ke,emits:Se,setup(n,{expose:p,emit:u}){const o=n,i=e.useAttrs(),c=Ne(),l=e.useSlots(),y=e.computed(()=>[o.type==="textarea"?$.b():r.b(),r.m(S.value),r.is("disabled",x.value),r.is("exceed",ue.value),{[r.b("group")]:l.prepend||l.append,[r.m("prefix")]:l.prefix||o.prefixIcon,[r.m("suffix")]:l.suffix||o.suffixIcon||o.clearable||o.showPassword,[r.bm("suffix","password-clear")]:F.value&&R.value,[r.b("hidden")]:o.type==="hidden"},i.class]),d=e.computed(()=>[r.e("wrapper"),r.is("focus",T.value)]),{form:b,formItem:m}=f.useFormItem(),{inputId:v}=f.useFormItemInputId(o,{formItemContext:m}),S=f.useFormSize(),x=f.useFormDisabled(),r=s.useNamespace("input"),$=s.useNamespace("textarea"),z=e.shallowRef(),g=e.shallowRef(),D=e.ref(!1),V=e.ref(!1),A=e.ref(),P=e.shallowRef(o.inputStyle),w=e.computed(()=>z.value||g.value),{wrapperRef:re,isFocused:T,handleFocus:ae,handleBlur:le}=te.useFocusController(w,{beforeFocus(){return x.value},afterBlur(){var t;o.validateEvent&&((t=m==null?void 0:m.validate)==null||t.call(m,"blur").catch(a=>s.debugWarn(a)))}}),H=e.computed(()=>{var t;return(t=b==null?void 0:b.statusIcon)!=null?t:!1}),I=e.computed(()=>(m==null?void 0:m.validateState)||""),W=e.computed(()=>I.value&&f.ValidateComponentsMap[I.value]),se=e.computed(()=>V.value?f.view_default:f.hide_default),ie=e.computed(()=>[i.style]),q=e.computed(()=>[o.inputStyle,P.value,{resize:o.resize}]),C=e.computed(()=>s.isNil(o.modelValue)?"":String(o.modelValue)),F=e.computed(()=>o.clearable&&!x.value&&!o.readonly&&!!C.value&&(T.value||D.value)),R=e.computed(()=>o.showPassword&&!x.value&&!!C.value&&(!!C.value||T.value)),E=e.computed(()=>o.showWordLimit&&!!o.maxlength&&(o.type==="text"||o.type==="textarea")&&!x.value&&!o.readonly&&!o.showPassword),L=e.computed(()=>C.value.length),ue=e.computed(()=>!!E.value&&L.value>Number(o.maxlength)),ce=e.computed(()=>!!l.suffix||!!o.suffixIcon||F.value||o.showPassword||E.value||!!I.value&&H.value),[K,j]=ze(z);ge.useResizeObserver(g,t=>{if(de(),!E.value||o.resize!=="both")return;const a=t[0],{width:k}=a.contentRect;A.value={right:`calc(100% - ${k+15+6}px)`}});const B=()=>{const{type:t,autosize:a}=o;if(!(!s.isClient||t!=="textarea"||!g.value))if(a){const k=s.isObject(a)?a.minRows:void 0,Q=s.isObject(a)?a.maxRows:void 0,ee=oe(g.value,k,Q);P.value={overflowY:"hidden",...ee},e.nextTick(()=>{g.value.offsetHeight,P.value=ee})}else P.value={minHeight:oe(g.value).minHeight}},de=(t=>{let a=!1;return()=>{var k;if(a||!o.autosize)return;((k=g.value)==null?void 0:k.offsetParent)===null||(t(),a=!0)}})(B),N=()=>{const t=w.value,a=o.formatter?o.formatter(C.value):C.value;!t||t.value===a||(t.value=a)},M=async t=>{K();let{value:a}=t.target;if(o.formatter&&(a=o.parser?o.parser(a):a),!Y.value){if(a===C.value){N();return}u(O.UPDATE_MODEL_EVENT,a),u("input",a),await e.nextTick(),N(),j()}},U=t=>{u("change",t.target.value)},{isComposing:Y,handleCompositionStart:_,handleCompositionUpdate:X,handleCompositionEnd:Z}=te.useComposition({emit:u,afterComposition:M}),pe=()=>{K(),V.value=!V.value,setTimeout(j)},fe=()=>{var t;return(t=w.value)==null?void 0:t.focus()},me=()=>{var t;return(t=w.value)==null?void 0:t.blur()},ve=t=>{D.value=!1,u("mouseleave",t)},he=t=>{D.value=!0,u("mouseenter",t)},G=t=>{u("keydown",t)},ye=()=>{var t;(t=w.value)==null||t.select()},J=()=>{u(O.UPDATE_MODEL_EVENT,""),u("change",""),u("clear"),u("input","")};return e.watch(()=>o.modelValue,()=>{var t;e.nextTick(()=>B()),o.validateEvent&&((t=m==null?void 0:m.validate)==null||t.call(m,"change").catch(a=>s.debugWarn(a)))}),e.watch(C,()=>N()),e.watch(()=>o.type,async()=>{await e.nextTick(),N(),B()}),e.onMounted(()=>{!o.formatter&&o.parser&&s.debugWarn("ElInput","If you set the parser, you also need to set the formatter."),N(),e.nextTick(B)}),p({input:z,textarea:g,ref:w,textareaStyle:q,autosize:e.toRef(o,"autosize"),isComposing:Y,focus:fe,blur:me,select:ye,clear:J,resizeTextarea:B}),(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(y),{[e.unref(r).bm("group","append")]:t.$slots.append,[e.unref(r).bm("group","prepend")]:t.$slots.prepend}]),style:e.normalizeStyle(e.unref(ie)),onMouseenter:he,onMouseleave:ve},[e.createCommentVNode(" input "),t.type!=="textarea"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createCommentVNode(" prepend slot "),t.$slots.prepend?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(r).be("group","prepend"))},[e.renderSlot(t.$slots,"prepend")],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{ref_key:"wrapperRef",ref:re,class:e.normalizeClass(e.unref(d))},[e.createCommentVNode(" prefix slot "),t.$slots.prefix||t.prefixIcon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(r).e("prefix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r).e("prefix-inner"))},[e.renderSlot(t.$slots,"prefix"),t.prefixIcon?(e.openBlock(),e.createBlock(e.unref(f.ElIcon),{key:0,class:e.normalizeClass(e.unref(r).e("icon"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.prefixIcon)))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0)],2)],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("input",e.mergeProps({id:e.unref(v),ref_key:"input",ref:z,class:e.unref(r).e("inner")},e.unref(c),{minlength:t.minlength,maxlength:t.maxlength,type:t.showPassword?V.value?"text":"password":t.type,disabled:e.unref(x),readonly:t.readonly,autocomplete:t.autocomplete,tabindex:t.tabindex,"aria-label":t.ariaLabel,placeholder:t.placeholder,style:t.inputStyle,form:t.form,autofocus:t.autofocus,role:t.containerRole,onCompositionstart:e.unref(_),onCompositionupdate:e.unref(X),onCompositionend:e.unref(Z),onInput:M,onChange:U,onKeydown:G}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","role","onCompositionstart","onCompositionupdate","onCompositionend"]),e.createCommentVNode(" suffix slot "),e.unref(ce)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(r).e("suffix"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r).e("suffix-inner"))},[!e.unref(F)||!e.unref(R)||!e.unref(E)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.renderSlot(t.$slots,"suffix"),t.suffixIcon?(e.openBlock(),e.createBlock(e.unref(f.ElIcon),{key:0,class:e.normalizeClass(e.unref(r).e("icon"))},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.suffixIcon)))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0)],64)):e.createCommentVNode("v-if",!0),e.unref(F)?(e.openBlock(),e.createBlock(e.unref(f.ElIcon),{key:1,class:e.normalizeClass([e.unref(r).e("icon"),e.unref(r).e("clear")]),onMousedown:e.withModifiers(e.unref(s.NOOP),["prevent"]),onClick:J},{default:e.withCtx(()=>[e.createVNode(e.unref(f.circle_close_default))]),_:1},8,["class","onMousedown"])):e.createCommentVNode("v-if",!0),e.unref(R)?(e.openBlock(),e.createBlock(e.unref(f.ElIcon),{key:2,class:e.normalizeClass([e.unref(r).e("icon"),e.unref(r).e("password")]),onClick:pe},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(se))))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0),e.unref(E)?(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(e.unref(r).e("count"))},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r).e("count-inner"))},e.toDisplayString(e.unref(L))+" / "+e.toDisplayString(t.maxlength),3)],2)):e.createCommentVNode("v-if",!0),e.unref(I)&&e.unref(W)&&e.unref(H)?(e.openBlock(),e.createBlock(e.unref(f.ElIcon),{key:4,class:e.normalizeClass([e.unref(r).e("icon"),e.unref(r).e("validateIcon"),e.unref(r).is("loading",e.unref(I)==="validating")])},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(W))))]),_:1},8,["class"])):e.createCommentVNode("v-if",!0)],2)],2)):e.createCommentVNode("v-if",!0)],2),e.createCommentVNode(" append slot "),t.$slots.append?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(r).be("group","append"))},[e.renderSlot(t.$slots,"append")],2)):e.createCommentVNode("v-if",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createCommentVNode(" textarea "),e.createElementVNode("textarea",e.mergeProps({id:e.unref(v),ref_key:"textarea",ref:g,class:[e.unref($).e("inner"),e.unref(r).is("focus",e.unref(T))]},e.unref(c),{minlength:t.minlength,maxlength:t.maxlength,tabindex:t.tabindex,disabled:e.unref(x),readonly:t.readonly,autocomplete:t.autocomplete,style:e.unref(q),"aria-label":t.ariaLabel,placeholder:t.placeholder,form:t.form,autofocus:t.autofocus,rows:t.rows,role:t.containerRole,onCompositionstart:e.unref(_),onCompositionupdate:e.unref(X),onCompositionend:e.unref(Z),onInput:M,onFocus:e.unref(ae),onBlur:e.unref(le),onChange:U,onKeydown:G}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","role","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),e.unref(E)?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(A.value),class:e.normalizeClass(e.unref(r).e("count"))},e.toDisplayString(e.unref(L))+" / "+e.toDisplayString(t.maxlength),7)):e.createCommentVNode("v-if",!0)],64))],38))}});var Te=s._export_sfc(Pe,[["__file","input.vue"]]);const Fe=s.withInstall(Te);exports.ElInput=Fe;exports.isFirefox=ne;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { computed as p, getCurrentInstance as je, defineComponent as ze, useAttrs as Ke, useSlots as We, shallowRef as
|
|
2
|
-
import { a as
|
|
3
|
-
import { u as
|
|
4
|
-
import { j as Pe, a as Se, b as st, d as ee, i as te, f as U,
|
|
1
|
+
import { computed as p, getCurrentInstance as je, defineComponent as ze, useAttrs as Ke, useSlots as We, shallowRef as _, ref as G, watch as J, nextTick as M, onMounted as Ue, toRef as Ye, openBlock as c, createElementBlock as b, normalizeClass as m, unref as t, normalizeStyle as be, createCommentVNode as f, Fragment as Q, renderSlot as j, createElementVNode as F, createBlock as S, withCtx as R, resolveDynamicComponent as K, mergeProps as xe, withModifiers as Xe, createVNode as qe, toDisplayString as W } from "vue";
|
|
2
|
+
import { a as Ze } from "./el-scrollbar-562d0595.js";
|
|
3
|
+
import { u as _e, j as we, d as Ge, e as Je, a as Qe, b as et, V as tt, L as ot, M as nt, E as B, A as at } from "./use-form-common-props-f377e500.js";
|
|
4
|
+
import { j as Pe, a as Se, b as st, d as ee, i as te, f as U, W as lt, u as Ce, q as rt, U as it, _ as ut, g as Ie, w as dt } from "./base-437d17f3.js";
|
|
5
5
|
import { m as ct } from "./typescript-7ae59c4c.js";
|
|
6
|
-
import { u as pt } from "./el-popper-
|
|
7
|
-
import { U as oe } from "./
|
|
8
|
-
import {
|
|
6
|
+
import { u as pt } from "./el-popper-50100766.js";
|
|
7
|
+
import { U as oe } from "./index-0cb48e01.js";
|
|
8
|
+
import { a as ft, u as vt } from "./index-a902a0d9.js";
|
|
9
9
|
const mt = () => Pe && /firefox/i.test(window.navigator.userAgent);
|
|
10
10
|
let g;
|
|
11
11
|
const ht = {
|
|
@@ -44,7 +44,7 @@ function Ee(n, v = 1, i) {
|
|
|
44
44
|
var o;
|
|
45
45
|
g || (g = document.createElement("textarea"), document.body.appendChild(g));
|
|
46
46
|
const { paddingSize: r, borderSize: u, boxSizing: l, contextStyle: x } = gt(n);
|
|
47
|
-
x.forEach(([y,
|
|
47
|
+
x.forEach(([y, N]) => g == null ? void 0 : g.style.setProperty(y, N)), Object.entries(ht).forEach(([y, N]) => g == null ? void 0 : g.style.setProperty(y, N, "important")), g.value = n.value || n.placeholder || "";
|
|
48
48
|
let d = g.scrollHeight;
|
|
49
49
|
const C = {};
|
|
50
50
|
l === "border-box" ? d = d + u : l === "content-box" && (d = d - r), g.value = "";
|
|
@@ -64,7 +64,7 @@ const bt = st({
|
|
|
64
64
|
type: String,
|
|
65
65
|
default: void 0
|
|
66
66
|
},
|
|
67
|
-
size:
|
|
67
|
+
size: _e,
|
|
68
68
|
disabled: Boolean,
|
|
69
69
|
modelValue: {
|
|
70
70
|
type: ee([
|
|
@@ -206,9 +206,9 @@ const Et = ze({
|
|
|
206
206
|
setup(n, { expose: v, emit: i }) {
|
|
207
207
|
const o = n, r = Ke(), u = Ct(), l = We(), x = p(() => [
|
|
208
208
|
o.type === "textarea" ? ne.b() : a.b(),
|
|
209
|
-
a.m(
|
|
209
|
+
a.m(N.value),
|
|
210
210
|
a.is("disabled", E.value),
|
|
211
|
-
a.is("exceed",
|
|
211
|
+
a.is("exceed", Le.value),
|
|
212
212
|
{
|
|
213
213
|
[a.b("group")]: l.prepend || l.append,
|
|
214
214
|
[a.m("prefix")]: l.prefix || o.prefixIcon,
|
|
@@ -219,10 +219,10 @@ const Et = ze({
|
|
|
219
219
|
r.class
|
|
220
220
|
]), d = p(() => [
|
|
221
221
|
a.e("wrapper"),
|
|
222
|
-
a.is("focus",
|
|
223
|
-
]), { form: C, formItem: h } =
|
|
222
|
+
a.is("focus", H.value)
|
|
223
|
+
]), { form: C, formItem: h } = Ge(), { inputId: y } = Je(o, {
|
|
224
224
|
formItemContext: h
|
|
225
|
-
}),
|
|
225
|
+
}), N = Qe(), E = et(), a = Ce("input"), ne = Ce("textarea"), O = _(), w = _(), Y = G(!1), $ = G(!1), ae = G(), A = _(o.inputStyle), z = p(() => O.value || w.value), { wrapperRef: ke, isFocused: H, handleFocus: Fe, handleBlur: Ne } = ft(z, {
|
|
226
226
|
beforeFocus() {
|
|
227
227
|
return E.value;
|
|
228
228
|
},
|
|
@@ -233,56 +233,56 @@ const Et = ze({
|
|
|
233
233
|
}), se = p(() => {
|
|
234
234
|
var e;
|
|
235
235
|
return (e = C == null ? void 0 : C.statusIcon) != null ? e : !1;
|
|
236
|
-
}), V = p(() => (h == null ? void 0 : h.validateState) || ""), le = p(() => V.value && tt[V.value]), Ve = p(() =>
|
|
236
|
+
}), V = p(() => (h == null ? void 0 : h.validateState) || ""), le = p(() => V.value && tt[V.value]), Ve = p(() => $.value ? ot : nt), Te = p(() => [
|
|
237
237
|
r.style
|
|
238
238
|
]), re = p(() => [
|
|
239
239
|
o.inputStyle,
|
|
240
|
-
|
|
240
|
+
A.value,
|
|
241
241
|
{ resize: o.resize }
|
|
242
|
-
]), I = p(() => rt(o.modelValue) ? "" : String(o.modelValue)), D = p(() => o.clearable && !E.value && !o.readonly && !!I.value && (
|
|
243
|
-
|
|
244
|
-
if (
|
|
242
|
+
]), I = p(() => rt(o.modelValue) ? "" : String(o.modelValue)), D = p(() => o.clearable && !E.value && !o.readonly && !!I.value && (H.value || Y.value)), X = p(() => o.showPassword && !E.value && !!I.value && (!!I.value || H.value)), P = p(() => o.showWordLimit && !!o.maxlength && (o.type === "text" || o.type === "textarea") && !E.value && !o.readonly && !o.showPassword), q = p(() => I.value.length), Le = p(() => !!P.value && q.value > Number(o.maxlength)), Me = p(() => !!l.suffix || !!o.suffixIcon || D.value || o.showPassword || P.value || !!V.value && se.value), [ie, ue] = It(O);
|
|
243
|
+
Ze(w, (e) => {
|
|
244
|
+
if (Re(), !P.value || o.resize !== "both")
|
|
245
245
|
return;
|
|
246
|
-
const s = e[0], { width:
|
|
246
|
+
const s = e[0], { width: k } = s.contentRect;
|
|
247
247
|
ae.value = {
|
|
248
|
-
right: `calc(100% - ${
|
|
248
|
+
right: `calc(100% - ${k + 15 + 6}px)`
|
|
249
249
|
};
|
|
250
250
|
});
|
|
251
251
|
const T = () => {
|
|
252
252
|
const { type: e, autosize: s } = o;
|
|
253
253
|
if (!(!Pe || e !== "textarea" || !w.value))
|
|
254
254
|
if (s) {
|
|
255
|
-
const
|
|
256
|
-
|
|
255
|
+
const k = Ie(s) ? s.minRows : void 0, ye = Ie(s) ? s.maxRows : void 0, ge = Ee(w.value, k, ye);
|
|
256
|
+
A.value = {
|
|
257
257
|
overflowY: "hidden",
|
|
258
258
|
...ge
|
|
259
|
-
},
|
|
260
|
-
w.value.offsetHeight,
|
|
259
|
+
}, M(() => {
|
|
260
|
+
w.value.offsetHeight, A.value = ge;
|
|
261
261
|
});
|
|
262
262
|
} else
|
|
263
|
-
|
|
263
|
+
A.value = {
|
|
264
264
|
minHeight: Ee(w.value).minHeight
|
|
265
265
|
};
|
|
266
|
-
},
|
|
266
|
+
}, Re = ((e) => {
|
|
267
267
|
let s = !1;
|
|
268
268
|
return () => {
|
|
269
|
-
var
|
|
269
|
+
var k;
|
|
270
270
|
if (s || !o.autosize)
|
|
271
271
|
return;
|
|
272
|
-
((
|
|
272
|
+
((k = w.value) == null ? void 0 : k.offsetParent) === null || (e(), s = !0);
|
|
273
273
|
};
|
|
274
|
-
})(T),
|
|
274
|
+
})(T), L = () => {
|
|
275
275
|
const e = z.value, s = o.formatter ? o.formatter(I.value) : I.value;
|
|
276
276
|
!e || e.value === s || (e.value = s);
|
|
277
|
-
},
|
|
277
|
+
}, Z = async (e) => {
|
|
278
278
|
ie();
|
|
279
279
|
let { value: s } = e.target;
|
|
280
280
|
if (o.formatter && (s = o.parser ? o.parser(s) : s), !ce.value) {
|
|
281
281
|
if (s === I.value) {
|
|
282
|
-
|
|
282
|
+
L();
|
|
283
283
|
return;
|
|
284
284
|
}
|
|
285
|
-
i(oe, s), i("input", s), await
|
|
285
|
+
i(oe, s), i("input", s), await M(), L(), ue();
|
|
286
286
|
}
|
|
287
287
|
}, de = (e) => {
|
|
288
288
|
i("change", e.target.value);
|
|
@@ -291,17 +291,17 @@ const Et = ze({
|
|
|
291
291
|
handleCompositionStart: pe,
|
|
292
292
|
handleCompositionUpdate: fe,
|
|
293
293
|
handleCompositionEnd: ve
|
|
294
|
-
} = vt({ emit: i, afterComposition:
|
|
295
|
-
ie(),
|
|
296
|
-
},
|
|
294
|
+
} = vt({ emit: i, afterComposition: Z }), Be = () => {
|
|
295
|
+
ie(), $.value = !$.value, setTimeout(ue);
|
|
296
|
+
}, Oe = () => {
|
|
297
297
|
var e;
|
|
298
298
|
return (e = z.value) == null ? void 0 : e.focus();
|
|
299
|
-
},
|
|
299
|
+
}, $e = () => {
|
|
300
300
|
var e;
|
|
301
301
|
return (e = z.value) == null ? void 0 : e.blur();
|
|
302
|
-
}, $e = (e) => {
|
|
303
|
-
Y.value = !1, i("mouseleave", e);
|
|
304
302
|
}, Ae = (e) => {
|
|
303
|
+
Y.value = !1, i("mouseleave", e);
|
|
304
|
+
}, He = (e) => {
|
|
305
305
|
Y.value = !0, i("mouseenter", e);
|
|
306
306
|
}, me = (e) => {
|
|
307
307
|
i("keydown", e);
|
|
@@ -311,22 +311,22 @@ const Et = ze({
|
|
|
311
311
|
}, he = () => {
|
|
312
312
|
i(oe, ""), i("change", ""), i("clear"), i("input", "");
|
|
313
313
|
};
|
|
314
|
-
return
|
|
314
|
+
return J(() => o.modelValue, () => {
|
|
315
315
|
var e;
|
|
316
|
-
|
|
317
|
-
}),
|
|
318
|
-
await
|
|
316
|
+
M(() => T()), o.validateEvent && ((e = h == null ? void 0 : h.validate) == null || e.call(h, "change").catch((s) => U(s)));
|
|
317
|
+
}), J(I, () => L()), J(() => o.type, async () => {
|
|
318
|
+
await M(), L(), T();
|
|
319
319
|
}), Ue(() => {
|
|
320
|
-
!o.formatter && o.parser && U("ElInput", "If you set the parser, you also need to set the formatter."),
|
|
320
|
+
!o.formatter && o.parser && U("ElInput", "If you set the parser, you also need to set the formatter."), L(), M(T);
|
|
321
321
|
}), v({
|
|
322
|
-
input:
|
|
322
|
+
input: O,
|
|
323
323
|
textarea: w,
|
|
324
324
|
ref: z,
|
|
325
325
|
textareaStyle: re,
|
|
326
326
|
autosize: Ye(o, "autosize"),
|
|
327
327
|
isComposing: ce,
|
|
328
|
-
focus:
|
|
329
|
-
blur:
|
|
328
|
+
focus: Oe,
|
|
329
|
+
blur: $e,
|
|
330
330
|
select: De,
|
|
331
331
|
clear: he,
|
|
332
332
|
resizeTextarea: T
|
|
@@ -339,8 +339,8 @@ const Et = ze({
|
|
|
339
339
|
}
|
|
340
340
|
]),
|
|
341
341
|
style: be(t(Te)),
|
|
342
|
-
onMouseenter:
|
|
343
|
-
onMouseleave:
|
|
342
|
+
onMouseenter: He,
|
|
343
|
+
onMouseleave: Ae
|
|
344
344
|
}, [
|
|
345
345
|
f(" input "),
|
|
346
346
|
e.type !== "textarea" ? (c(), b(Q, { key: 0 }, [
|
|
@@ -351,9 +351,9 @@ const Et = ze({
|
|
|
351
351
|
}, [
|
|
352
352
|
j(e.$slots, "prepend")
|
|
353
353
|
], 2)) : f("v-if", !0),
|
|
354
|
-
|
|
354
|
+
F("div", {
|
|
355
355
|
ref_key: "wrapperRef",
|
|
356
|
-
ref:
|
|
356
|
+
ref: ke,
|
|
357
357
|
class: m(t(d))
|
|
358
358
|
}, [
|
|
359
359
|
f(" prefix slot "),
|
|
@@ -361,7 +361,7 @@ const Et = ze({
|
|
|
361
361
|
key: 0,
|
|
362
362
|
class: m(t(a).e("prefix"))
|
|
363
363
|
}, [
|
|
364
|
-
|
|
364
|
+
F("span", {
|
|
365
365
|
class: m(t(a).e("prefix-inner"))
|
|
366
366
|
}, [
|
|
367
367
|
j(e.$slots, "prefix"),
|
|
@@ -369,22 +369,22 @@ const Et = ze({
|
|
|
369
369
|
key: 0,
|
|
370
370
|
class: m(t(a).e("icon"))
|
|
371
371
|
}, {
|
|
372
|
-
default:
|
|
372
|
+
default: R(() => [
|
|
373
373
|
(c(), S(K(e.prefixIcon)))
|
|
374
374
|
]),
|
|
375
375
|
_: 1
|
|
376
376
|
}, 8, ["class"])) : f("v-if", !0)
|
|
377
377
|
], 2)
|
|
378
378
|
], 2)) : f("v-if", !0),
|
|
379
|
-
|
|
379
|
+
F("input", xe({
|
|
380
380
|
id: t(y),
|
|
381
381
|
ref_key: "input",
|
|
382
|
-
ref:
|
|
382
|
+
ref: O,
|
|
383
383
|
class: t(a).e("inner")
|
|
384
384
|
}, t(u), {
|
|
385
385
|
minlength: e.minlength,
|
|
386
386
|
maxlength: e.maxlength,
|
|
387
|
-
type: e.showPassword ?
|
|
387
|
+
type: e.showPassword ? $.value ? "text" : "password" : e.type,
|
|
388
388
|
disabled: t(E),
|
|
389
389
|
readonly: e.readonly,
|
|
390
390
|
autocomplete: e.autocomplete,
|
|
@@ -398,16 +398,16 @@ const Et = ze({
|
|
|
398
398
|
onCompositionstart: t(pe),
|
|
399
399
|
onCompositionupdate: t(fe),
|
|
400
400
|
onCompositionend: t(ve),
|
|
401
|
-
onInput:
|
|
401
|
+
onInput: Z,
|
|
402
402
|
onChange: de,
|
|
403
403
|
onKeydown: me
|
|
404
404
|
}), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "role", "onCompositionstart", "onCompositionupdate", "onCompositionend"]),
|
|
405
405
|
f(" suffix slot "),
|
|
406
|
-
t(
|
|
406
|
+
t(Me) ? (c(), b("span", {
|
|
407
407
|
key: 1,
|
|
408
408
|
class: m(t(a).e("suffix"))
|
|
409
409
|
}, [
|
|
410
|
-
|
|
410
|
+
F("span", {
|
|
411
411
|
class: m(t(a).e("suffix-inner"))
|
|
412
412
|
}, [
|
|
413
413
|
!t(D) || !t(X) || !t(P) ? (c(), b(Q, { key: 0 }, [
|
|
@@ -416,7 +416,7 @@ const Et = ze({
|
|
|
416
416
|
key: 0,
|
|
417
417
|
class: m(t(a).e("icon"))
|
|
418
418
|
}, {
|
|
419
|
-
default:
|
|
419
|
+
default: R(() => [
|
|
420
420
|
(c(), S(K(e.suffixIcon)))
|
|
421
421
|
]),
|
|
422
422
|
_: 1
|
|
@@ -428,7 +428,7 @@ const Et = ze({
|
|
|
428
428
|
onMousedown: Xe(t(it), ["prevent"]),
|
|
429
429
|
onClick: he
|
|
430
430
|
}, {
|
|
431
|
-
default:
|
|
431
|
+
default: R(() => [
|
|
432
432
|
qe(t(at))
|
|
433
433
|
]),
|
|
434
434
|
_: 1
|
|
@@ -438,7 +438,7 @@ const Et = ze({
|
|
|
438
438
|
class: m([t(a).e("icon"), t(a).e("password")]),
|
|
439
439
|
onClick: Be
|
|
440
440
|
}, {
|
|
441
|
-
default:
|
|
441
|
+
default: R(() => [
|
|
442
442
|
(c(), S(K(t(Ve))))
|
|
443
443
|
]),
|
|
444
444
|
_: 1
|
|
@@ -447,7 +447,7 @@ const Et = ze({
|
|
|
447
447
|
key: 3,
|
|
448
448
|
class: m(t(a).e("count"))
|
|
449
449
|
}, [
|
|
450
|
-
|
|
450
|
+
F("span", {
|
|
451
451
|
class: m(t(a).e("count-inner"))
|
|
452
452
|
}, W(t(q)) + " / " + W(e.maxlength), 3)
|
|
453
453
|
], 2)) : f("v-if", !0),
|
|
@@ -459,7 +459,7 @@ const Et = ze({
|
|
|
459
459
|
t(a).is("loading", t(V) === "validating")
|
|
460
460
|
])
|
|
461
461
|
}, {
|
|
462
|
-
default:
|
|
462
|
+
default: R(() => [
|
|
463
463
|
(c(), S(K(t(le))))
|
|
464
464
|
]),
|
|
465
465
|
_: 1
|
|
@@ -476,11 +476,11 @@ const Et = ze({
|
|
|
476
476
|
], 2)) : f("v-if", !0)
|
|
477
477
|
], 64)) : (c(), b(Q, { key: 1 }, [
|
|
478
478
|
f(" textarea "),
|
|
479
|
-
|
|
479
|
+
F("textarea", xe({
|
|
480
480
|
id: t(y),
|
|
481
481
|
ref_key: "textarea",
|
|
482
482
|
ref: w,
|
|
483
|
-
class: [t(ne).e("inner"), t(a).is("focus", t(
|
|
483
|
+
class: [t(ne).e("inner"), t(a).is("focus", t(H))]
|
|
484
484
|
}, t(u), {
|
|
485
485
|
minlength: e.minlength,
|
|
486
486
|
maxlength: e.maxlength,
|
|
@@ -498,9 +498,9 @@ const Et = ze({
|
|
|
498
498
|
onCompositionstart: t(pe),
|
|
499
499
|
onCompositionupdate: t(fe),
|
|
500
500
|
onCompositionend: t(ve),
|
|
501
|
-
onInput:
|
|
502
|
-
onFocus: t(
|
|
503
|
-
onBlur: t(
|
|
501
|
+
onInput: Z,
|
|
502
|
+
onFocus: t(Fe),
|
|
503
|
+
onBlur: t(Ne),
|
|
504
504
|
onChange: de,
|
|
505
505
|
onKeydown: me
|
|
506
506
|
}), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "role", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]),
|
|
@@ -514,8 +514,8 @@ const Et = ze({
|
|
|
514
514
|
}
|
|
515
515
|
});
|
|
516
516
|
var Pt = /* @__PURE__ */ ut(zt, [["__file", "input.vue"]]);
|
|
517
|
-
const
|
|
517
|
+
const Ot = dt(Pt);
|
|
518
518
|
export {
|
|
519
|
-
|
|
519
|
+
Ot as E,
|
|
520
520
|
mt as i
|
|
521
521
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),
|
|
1
|
+
"use strict";const e=require("vue"),x=require("./el-input-23e2bac3.cjs"),N=require("./use-form-common-props-1b84d8f4.cjs"),u=require("./base-ec05f348.cjs"),G=require("./el-popper-746070ba.cjs"),p=require("./index-3bf8d597.cjs"),Y=100,H=600,U={beforeMount(o,E){const c=E.value,{interval:l=Y,delay:h=H}=u.isFunction(c)?{}:c;let d,m;const i=()=>u.isFunction(c)?c():c.handler(),v=()=>{m&&(clearTimeout(m),m=void 0),d&&(clearInterval(d),d=void 0)};o.addEventListener("mousedown",I=>{I.button===0&&(v(),i(),document.addEventListener("mouseup",()=>v(),{once:!0}),m=setTimeout(()=>{d=setInterval(()=>{i()},l)},h))})}},j=u.buildProps({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:N.useSizeProp,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:o=>o===null||u.isNumber(o)||["min","max"].includes(o),default:null},name:String,placeholder:String,precision:{type:Number,validator:o=>o>=0&&o===Number.parseInt(`${o}`,10)},validateEvent:{type:Boolean,default:!0},...G.useAriaProps(["ariaLabel"])}),J={[p.CHANGE_EVENT]:(o,E)=>E!==o,blur:o=>o instanceof FocusEvent,focus:o=>o instanceof FocusEvent,[p.INPUT_EVENT]:o=>u.isNumber(o)||u.isNil(o),[p.UPDATE_MODEL_EVENT]:o=>u.isNumber(o)||u.isNil(o)},Q=e.defineComponent({name:"ElInputNumber"}),X=e.defineComponent({...Q,props:j,emits:J,setup(o,{expose:E,emit:c}){const l=o,{t:h}=u.useLocale(),d=u.useNamespace("input-number"),m=e.ref(),i=e.reactive({currentValue:l.modelValue,userInput:null}),{formItem:v}=N.useFormItem(),I=e.computed(()=>u.isNumber(l.modelValue)&&l.modelValue<=l.min),D=e.computed(()=>u.isNumber(l.modelValue)&&l.modelValue>=l.max),L=e.computed(()=>{const n=C(l.step);return u.isUndefined(l.precision)?Math.max(C(l.modelValue),n):(n>l.precision&&u.debugWarn("InputNumber","precision should not be less than the decimal places of step"),l.precision)}),T=e.computed(()=>l.controls&&l.controlsPosition==="right"),B=N.useFormSize(),V=N.useFormDisabled(),g=e.computed(()=>{if(i.userInput!==null)return i.userInput;let n=i.currentValue;if(u.isNil(n))return"";if(u.isNumber(n)){if(Number.isNaN(n))return"";u.isUndefined(l.precision)||(n=n.toFixed(l.precision))}return n}),P=(n,t)=>{if(u.isUndefined(t)&&(t=L.value),t===0)return Math.round(n);let r=String(n);const a=r.indexOf(".");if(a===-1||!r.replace(".","").split("")[a+t])return n;const w=r.length;return r.charAt(w-1)==="5"&&(r=`${r.slice(0,Math.max(0,w-1))}6`),Number.parseFloat(Number(r).toFixed(t))},C=n=>{if(u.isNil(n))return 0;const t=n.toString(),r=t.indexOf(".");let a=0;return r!==-1&&(a=t.length-r-1),a},F=(n,t=1)=>u.isNumber(n)?P(n+l.step*t):i.currentValue,A=()=>{if(l.readonly||V.value||D.value)return;const n=Number(g.value)||0,t=F(n);y(t),c(p.INPUT_EVENT,i.currentValue),k()},S=()=>{if(l.readonly||V.value||I.value)return;const n=Number(g.value)||0,t=F(n,-1);y(t),c(p.INPUT_EVENT,i.currentValue),k()},M=(n,t)=>{const{max:r,min:a,step:s,precision:b,stepStrictly:w,valueOnClear:_}=l;r<a&&u.throwError("InputNumber","min should not be greater than max.");let f=Number(n);if(u.isNil(n)||Number.isNaN(f))return null;if(n===""){if(_===null)return null;f=u.isString(_)?{min:a,max:r}[_]:_}return w&&(f=P(Math.round(f/s)*s,b),f!==n&&t&&c(p.UPDATE_MODEL_EVENT,f)),u.isUndefined(b)||(f=P(f,b)),(f>r||f<a)&&(f=f>r?r:a,t&&c(p.UPDATE_MODEL_EVENT,f)),f},y=(n,t=!0)=>{var r;const a=i.currentValue,s=M(n);if(!t){c(p.UPDATE_MODEL_EVENT,s);return}a===s&&n||(i.userInput=null,c(p.UPDATE_MODEL_EVENT,s),a!==s&&c(p.CHANGE_EVENT,s,a),l.validateEvent&&((r=v==null?void 0:v.validate)==null||r.call(v,"change").catch(b=>u.debugWarn(b))),i.currentValue=s)},O=n=>{i.userInput=n;const t=n===""?null:Number(n);c(p.INPUT_EVENT,t),y(t,!1)},K=n=>{const t=n!==""?Number(n):"";(u.isNumber(t)&&!Number.isNaN(t)||n==="")&&y(t),k(),i.userInput=null},z=()=>{var n,t;(t=(n=m.value)==null?void 0:n.focus)==null||t.call(n)},$=()=>{var n,t;(t=(n=m.value)==null?void 0:n.blur)==null||t.call(n)},q=n=>{c("focus",n)},R=n=>{var t,r;i.userInput=null,x.isFirefox()&&i.currentValue===null&&((t=m.value)!=null&&t.input)&&(m.value.input.value=""),c("blur",n),l.validateEvent&&((r=v==null?void 0:v.validate)==null||r.call(v,"blur").catch(a=>u.debugWarn(a)))},k=()=>{i.currentValue!==l.modelValue&&(i.currentValue=l.modelValue)},W=n=>{document.activeElement===n.target&&n.preventDefault()};return e.watch(()=>l.modelValue,(n,t)=>{const r=M(n,!0);i.userInput===null&&r!==t&&(i.currentValue=r)},{immediate:!0}),e.onMounted(()=>{var n;const{min:t,max:r,modelValue:a}=l,s=(n=m.value)==null?void 0:n.input;if(s.setAttribute("role","spinbutton"),Number.isFinite(r)?s.setAttribute("aria-valuemax",String(r)):s.removeAttribute("aria-valuemax"),Number.isFinite(t)?s.setAttribute("aria-valuemin",String(t)):s.removeAttribute("aria-valuemin"),s.setAttribute("aria-valuenow",i.currentValue||i.currentValue===0?String(i.currentValue):""),s.setAttribute("aria-disabled",String(V.value)),!u.isNumber(a)&&a!=null){let b=Number(a);Number.isNaN(b)&&(b=null),c(p.UPDATE_MODEL_EVENT,b)}s.addEventListener("wheel",W,{passive:!1})}),e.onUpdated(()=>{var n,t;const r=(n=m.value)==null?void 0:n.input;r==null||r.setAttribute("aria-valuenow",`${(t=i.currentValue)!=null?t:""}`)}),E({focus:z,blur:$}),(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([e.unref(d).b(),e.unref(d).m(e.unref(B)),e.unref(d).is("disabled",e.unref(V)),e.unref(d).is("without-controls",!n.controls),e.unref(d).is("controls-right",e.unref(T))]),onDragstart:e.withModifiers(()=>{},["prevent"])},[n.controls?e.withDirectives((e.openBlock(),e.createElementBlock("span",{key:0,role:"button","aria-label":e.unref(h)("el.inputNumber.decrease"),class:e.normalizeClass([e.unref(d).e("decrease"),e.unref(d).is("disabled",e.unref(I))]),onKeydown:e.withKeys(S,["enter"])},[e.renderSlot(n.$slots,"decrease-icon",{},()=>[e.createVNode(e.unref(N.ElIcon),null,{default:e.withCtx(()=>[e.unref(T)?(e.openBlock(),e.createBlock(e.unref(N.arrow_down_default),{key:0})):(e.openBlock(),e.createBlock(e.unref(N.minus_default),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[e.unref(U),S]]):e.createCommentVNode("v-if",!0),n.controls?e.withDirectives((e.openBlock(),e.createElementBlock("span",{key:1,role:"button","aria-label":e.unref(h)("el.inputNumber.increase"),class:e.normalizeClass([e.unref(d).e("increase"),e.unref(d).is("disabled",e.unref(D))]),onKeydown:e.withKeys(A,["enter"])},[e.renderSlot(n.$slots,"increase-icon",{},()=>[e.createVNode(e.unref(N.ElIcon),null,{default:e.withCtx(()=>[e.unref(T)?(e.openBlock(),e.createBlock(e.unref(N.arrow_up_default),{key:0})):(e.openBlock(),e.createBlock(e.unref(N.plus_default),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[e.unref(U),A]]):e.createCommentVNode("v-if",!0),e.createVNode(e.unref(x.ElInput),{id:n.id,ref_key:"input",ref:m,type:"number",step:n.step,"model-value":e.unref(g),placeholder:n.placeholder,readonly:n.readonly,disabled:e.unref(V),size:e.unref(B),max:n.max,min:n.min,name:n.name,"aria-label":n.ariaLabel,"validate-event":!1,onKeydown:[e.withKeys(e.withModifiers(A,["prevent"]),["up"]),e.withKeys(e.withModifiers(S,["prevent"]),["down"])],onBlur:R,onFocus:q,onInput:O,onChange:K},e.createSlots({_:2},[n.$slots.prefix?{name:"prefix",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"prefix")])}:void 0,n.$slots.suffix?{name:"suffix",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"suffix")])}:void 0]),1032,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","onKeydown"])],42,["onDragstart"]))}});var Z=u._export_sfc(X,[["__file","input-number.vue"]]);const ee=u.withInstall(Z);exports.ElInputNumber=ee;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent as ee, ref as ce, reactive as de, computed as I, watch as me, onMounted as pe, onUpdated as fe, openBlock as v, createElementBlock as z, normalizeClass as K, unref as r, withModifiers as O, withDirectives as j, withKeys as A, renderSlot as P, createVNode as R, withCtx as F, createBlock as T, createCommentVNode as J, createSlots as be } from "vue";
|
|
2
|
-
import { E as ve, i as Ne } from "./el-input-
|
|
3
|
-
import { u as Ve, d as he, a as Ie, b as
|
|
4
|
-
import { h as X, b as Se, a as b, q as
|
|
5
|
-
import { u as ke } from "./el-popper-
|
|
6
|
-
import { C as ne, I as C, U as N } from "./
|
|
7
|
-
const
|
|
2
|
+
import { E as ve, i as Ne } from "./el-input-4961b99f.js";
|
|
3
|
+
import { u as Ve, d as he, a as Ie, b as ye, E as Q, g as Ee, x as ge, y as we, v as _e } from "./use-form-common-props-f377e500.js";
|
|
4
|
+
import { h as X, b as Se, a as b, q as y, x as Ae, u as Pe, l as x, f as U, _ as Fe, t as Te, i as xe, w as Ce } from "./base-437d17f3.js";
|
|
5
|
+
import { u as ke } from "./el-popper-50100766.js";
|
|
6
|
+
import { C as ne, I as C, U as N } from "./index-0cb48e01.js";
|
|
7
|
+
const De = 100, Be = 600, Z = {
|
|
8
8
|
beforeMount(u, V) {
|
|
9
|
-
const i = V.value, { interval: a =
|
|
9
|
+
const i = V.value, { interval: a = De, delay: E = Be } = X(i) ? {} : i;
|
|
10
10
|
let c, m;
|
|
11
11
|
const l = () => X(i) ? i() : i.handler(), f = () => {
|
|
12
12
|
m && (clearTimeout(m), m = void 0), c && (clearInterval(c), c = void 0);
|
|
@@ -18,7 +18,7 @@ const Be = 100, De = 600, Z = {
|
|
|
18
18
|
c = setInterval(() => {
|
|
19
19
|
l();
|
|
20
20
|
}, a);
|
|
21
|
-
},
|
|
21
|
+
}, E));
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
}, Le = Se({
|
|
@@ -72,8 +72,8 @@ const Be = 100, De = 600, Z = {
|
|
|
72
72
|
[ne]: (u, V) => V !== u,
|
|
73
73
|
blur: (u) => u instanceof FocusEvent,
|
|
74
74
|
focus: (u) => u instanceof FocusEvent,
|
|
75
|
-
[C]: (u) => b(u) ||
|
|
76
|
-
[N]: (u) => b(u) ||
|
|
75
|
+
[C]: (u) => b(u) || y(u),
|
|
76
|
+
[N]: (u) => b(u) || y(u)
|
|
77
77
|
}, $e = ee({
|
|
78
78
|
name: "ElInputNumber"
|
|
79
79
|
}), ze = /* @__PURE__ */ ee({
|
|
@@ -81,17 +81,17 @@ const Be = 100, De = 600, Z = {
|
|
|
81
81
|
props: Le,
|
|
82
82
|
emits: Me,
|
|
83
83
|
setup(u, { expose: V, emit: i }) {
|
|
84
|
-
const a = u, { t:
|
|
84
|
+
const a = u, { t: E } = Ae(), c = Pe("input-number"), m = ce(), l = de({
|
|
85
85
|
currentValue: a.modelValue,
|
|
86
86
|
userInput: null
|
|
87
87
|
}), { formItem: f } = he(), g = I(() => b(a.modelValue) && a.modelValue <= a.min), Y = I(() => b(a.modelValue) && a.modelValue >= a.max), te = I(() => {
|
|
88
88
|
const e = W(a.step);
|
|
89
89
|
return x(a.precision) ? Math.max(W(a.modelValue), e) : (e > a.precision && U("InputNumber", "precision should not be less than the decimal places of step"), a.precision);
|
|
90
|
-
}), k = I(() => a.controls && a.controlsPosition === "right"), G = Ie(), h =
|
|
90
|
+
}), k = I(() => a.controls && a.controlsPosition === "right"), G = Ie(), h = ye(), D = I(() => {
|
|
91
91
|
if (l.userInput !== null)
|
|
92
92
|
return l.userInput;
|
|
93
93
|
let e = l.currentValue;
|
|
94
|
-
if (
|
|
94
|
+
if (y(e))
|
|
95
95
|
return "";
|
|
96
96
|
if (b(e)) {
|
|
97
97
|
if (Number.isNaN(e))
|
|
@@ -99,7 +99,7 @@ const Be = 100, De = 600, Z = {
|
|
|
99
99
|
x(a.precision) || (e = e.toFixed(a.precision));
|
|
100
100
|
}
|
|
101
101
|
return e;
|
|
102
|
-
}),
|
|
102
|
+
}), B = (e, n) => {
|
|
103
103
|
if (x(n) && (n = te.value), n === 0)
|
|
104
104
|
return Math.round(e);
|
|
105
105
|
let t = String(e);
|
|
@@ -109,33 +109,33 @@ const Be = 100, De = 600, Z = {
|
|
|
109
109
|
const _ = t.length;
|
|
110
110
|
return t.charAt(_ - 1) === "5" && (t = `${t.slice(0, Math.max(0, _ - 1))}6`), Number.parseFloat(Number(t).toFixed(n));
|
|
111
111
|
}, W = (e) => {
|
|
112
|
-
if (
|
|
112
|
+
if (y(e))
|
|
113
113
|
return 0;
|
|
114
114
|
const n = e.toString(), t = n.indexOf(".");
|
|
115
115
|
let o = 0;
|
|
116
116
|
return t !== -1 && (o = n.length - t - 1), o;
|
|
117
|
-
}, q = (e, n = 1) => b(e) ?
|
|
117
|
+
}, q = (e, n = 1) => b(e) ? B(e + a.step * n) : l.currentValue, L = () => {
|
|
118
118
|
if (a.readonly || h.value || Y.value)
|
|
119
119
|
return;
|
|
120
|
-
const e = Number(
|
|
120
|
+
const e = Number(D.value) || 0, n = q(e);
|
|
121
121
|
w(n), i(C, l.currentValue), $();
|
|
122
122
|
}, M = () => {
|
|
123
123
|
if (a.readonly || h.value || g.value)
|
|
124
124
|
return;
|
|
125
|
-
const e = Number(
|
|
125
|
+
const e = Number(D.value) || 0, n = q(e, -1);
|
|
126
126
|
w(n), i(C, l.currentValue), $();
|
|
127
127
|
}, H = (e, n) => {
|
|
128
128
|
const { max: t, min: o, step: s, precision: p, stepStrictly: _, valueOnClear: S } = a;
|
|
129
129
|
t < o && Te("InputNumber", "min should not be greater than max.");
|
|
130
130
|
let d = Number(e);
|
|
131
|
-
if (
|
|
131
|
+
if (y(e) || Number.isNaN(d))
|
|
132
132
|
return null;
|
|
133
133
|
if (e === "") {
|
|
134
134
|
if (S === null)
|
|
135
135
|
return null;
|
|
136
136
|
d = xe(S) ? { min: o, max: t }[S] : S;
|
|
137
137
|
}
|
|
138
|
-
return _ && (d =
|
|
138
|
+
return _ && (d = B(Math.round(d / s) * s, p), d !== e && n && i(N, d)), x(p) || (d = B(d, p)), (d > t || d < o) && (d = d > t ? t : o, n && i(N, d)), d;
|
|
139
139
|
}, w = (e, n = !0) => {
|
|
140
140
|
var t;
|
|
141
141
|
const o = l.currentValue, s = H(e);
|
|
@@ -199,14 +199,14 @@ const Be = 100, De = 600, Z = {
|
|
|
199
199
|
e.controls ? j((v(), z("span", {
|
|
200
200
|
key: 0,
|
|
201
201
|
role: "button",
|
|
202
|
-
"aria-label": r(
|
|
202
|
+
"aria-label": r(E)("el.inputNumber.decrease"),
|
|
203
203
|
class: K([r(c).e("decrease"), r(c).is("disabled", r(g))]),
|
|
204
204
|
onKeydown: A(M, ["enter"])
|
|
205
205
|
}, [
|
|
206
206
|
P(e.$slots, "decrease-icon", {}, () => [
|
|
207
207
|
R(r(Q), null, {
|
|
208
208
|
default: F(() => [
|
|
209
|
-
r(k) ? (v(), T(r(
|
|
209
|
+
r(k) ? (v(), T(r(Ee), { key: 0 })) : (v(), T(r(ge), { key: 1 }))
|
|
210
210
|
]),
|
|
211
211
|
_: 1
|
|
212
212
|
})
|
|
@@ -217,7 +217,7 @@ const Be = 100, De = 600, Z = {
|
|
|
217
217
|
e.controls ? j((v(), z("span", {
|
|
218
218
|
key: 1,
|
|
219
219
|
role: "button",
|
|
220
|
-
"aria-label": r(
|
|
220
|
+
"aria-label": r(E)("el.inputNumber.increase"),
|
|
221
221
|
class: K([r(c).e("increase"), r(c).is("disabled", r(Y))]),
|
|
222
222
|
onKeydown: A(L, ["enter"])
|
|
223
223
|
}, [
|
|
@@ -238,7 +238,7 @@ const Be = 100, De = 600, Z = {
|
|
|
238
238
|
ref: m,
|
|
239
239
|
type: "number",
|
|
240
240
|
step: e.step,
|
|
241
|
-
"model-value": r(
|
|
241
|
+
"model-value": r(D),
|
|
242
242
|
placeholder: e.placeholder,
|
|
243
243
|
readonly: e.readonly,
|
|
244
244
|
disabled: r(h),
|