Files
YG_FT/frontend/dist/assets/index-CY01E5yO.js

2 lines
7.2 KiB
JavaScript
Raw Normal View History

2026-07-27 09:12:47 +08:00
import{ak as f,a8 as V,b as fe,aR as be,R as K,d as pe,aW as Ne,a as ve,z as he,D as H,G as Ve,bK as ye,o as N,c as O,K as J,f as i,t as q,n as $,h as S,s as z,w as x,e as w,S as Ee,d7 as ge,E as Q,g as Y,bD as Se,bO as xe,aX as we,aL as Ie,y as Fe,j as h,V as Ae,d8 as ke,W as Z,aU as _,aK as R,C as Pe,J as Ce,U as I,l as De}from"./index-_T_ZwAU8.js";import{U as F,I as A,C as te}from"./raf-BSHx3Xj9.js";import{b as Te,e as Me,c as Be}from"./index-CunlXsH6.js";import{E as Ke}from"./index-DOTsJDGF.js";import{v as ee}from"./index-BcpD6ypP.js";import{u as Oe}from"./index-CaL9AHzU.js";const $e=fe({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.MAX_SAFE_INTEGER},min:{type:Number,default:Number.MIN_SAFE_INTEGER},modelValue:{type:[Number,null]},readonly:Boolean,disabled:{type:Boolean,default:void 0},size:be,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:K([String,Number,null]),validator:a=>a===null||f(a)||["min","max"].includes(a),default:null},name:String,placeholder:String,precision:{type:Number,validator:a=>a>=0&&a===Number.parseInt(`${a}`,10)},validateEvent:{type:Boolean,default:!0},...Oe(["ariaLabel"]),inputmode:{type:K(String),default:void 0},align:{type:K(String),default:"center"},disabledScientific:Boolean,formatter:{type:Function},parser:{type:Function},tabindex:{type:[String,Number],default:0}}),ze={[te]:(a,k)=>k!==a,blur:a=>a instanceof FocusEvent,focus:a=>a instanceof FocusEvent,[A]:a=>f(a)||V(a),[F]:a=>f(a)||V(a)},Re=["aria-label"],Ue=["aria-label"];var Ge=pe({name:"ElInputNumber",__name:"input-number",props:$e,emits:ze,setup(a,{expose:k,emit:ae}){const n=a,o=ae,{t:U}=Ne(),d=ve("input-number"),b=Fe(),l=he({currentValue:n.modelValue,userInput:null}),{formItem:m}=Te(),G=h(()=>f(n.modelValue)&&n.modelValue<=n.min),L=h(()=>f(n.modelValue)&&n.modelValue>=n.max),ne=h(()=>{const e=X(n.step);return I(n.precision)?Math.max(X(n.modelValue),e):(e>n.precision&&R("InputNumber","precision should not be less than the decimal places of step"),n.precision)}),P=h(()=>n.controls&&n.controlsPosition==="right"),W=Me(),v=Be(),C=h(()=>{if(l.userInput!==null)return l.userInput;let e=l.currentValue;if(V(e))return"";if(f(e)){if(Number.isNaN(e))return"";I(n.precision)||(e=e.toFixed(n.precision))}return e}),y=(e,t)=>{if(I(t)&&(t=ne.value),t===0)return Math.round(e);let r=String(e);const u=r.indexOf(".");if(u===-1||!r.replace(".","").split("")[u+t])return e;const c=r.length;return r.charAt(c-1)==="5"&&(r=`${r.slice(0,Math.max(0,c-1))}6`),Number.parseFloat(Number(r).toFixed(t))},X=e=>{if(V(e))return 0;const t=e.toString(),r=t.indexOf(".");let u=0;return r!==-1&&(u=t.length-r-1),u},j=(e,t=1)=>f(e)?e>=Number.MAX_SAFE_INTEGER&&t===1?(R("InputNumber","The value has reached the maximum safe integer limit."),e):e<=Number.MIN_SAFE_INTEGER&&t===-1?(R("InputNumber","The value has reached the minimum safe integer limit."),e):y(e+n.step*t):l.currentValue,re=e=>{const t=Ae(e),r=ke(e);if(n.disabledScientific&&["e","E"].includes(r)){e.preventDefault();return}switch(t){case Z.up:e.preventDefault(),D();break;case Z.down:e.preventDefault(),T();break}},D=()=>{n.readonly||v.value||L.value||(E(j(Number(C.value)||0)),o(A,l.currentValue),B())},T=()=>{n.readonly||v.value||G.value||(E(j(Number(C.value)||0,-1)),o(A,l.currentValue),B())},M=(e,t)=>{const{max:r,min:u,step:c,precision:p,stepStrictly:me,valueOnClear:g}=n;r<u&&Pe("InputNumber","min should not be greater than max.");let s=e?Number.parseFloat(String(e)):Number(e);if(V(e)||Number.isNaN(s))return null;if(e===""){if(g===null)return null;s=Ce(g)?{min:u,max:r}[g]:g}return me&&(s=y(Math.round(y(s/c))*c,p),s!==e&&t&&o("update:modelValue",s)),I(p)||(s=y(s,p)),(s>r||s<u)&&(s=s>r?r:u,t&&o("update:modelValue",s)),s},E=(e,t=!0)=>{var c;const r=l.currentValue,u=M(e);if(!t){o(F,u);return}l.userInput=null,!(r===u&&e)&&(o(F,u),r!==u&&o(te,u,r),n.validateEvent&&((c=m==null?void 0:m.validate)==null||c.call(m,"change").catch(_)),l.currentValue=u)},ue=e=>{l.userInput=e;let t=e===""?null:Number.par