-
Notifications
You must be signed in to change notification settings - Fork 11
/
chunk-EE7SIC6Z.js
1 lines (1 loc) · 11.6 KB
/
chunk-EE7SIC6Z.js
1
import{b as H,c as Q,d as K,e as U}from"./chunk-RKL5WCT5.js";import{a as dt,c as _t}from"./chunk-MGFBB5Y4.js";import{a as B,b as pt,c as lt,d as mt,f as ct}from"./chunk-3LAVY7RV.js";import{Ca as ot,Ea as at,Fa as ut,H as S,fb as st,ha as F,hc as ft}from"./chunk-YWVGY2C2.js";import{$a as R,Ab as T,Ba as b,Bb as V,Ca as z,Db as v,Dc as w,Ec as k,Fc as j,Gc as f,Ha as L,Hd as rt,Ia as Z,Ib as J,Jb as $,Nb as tt,Oa as Y,Pa as u,Pb as s,Pc as nt,Qa as X,Vb as A,Wb as m,Yb as P,_b as D,_c as x,dc as _,ha as q,ic as l,id as g,ja as G,jc as c,jd as E,kc as M,kd as d,ld as W,md as it,oa as h,oc as O,rb as p,rc as C,tc as a,uc as et,vc as N}from"./chunk-GBKJFEQZ.js";import{a as y}from"./chunk-EQDQRRRY.js";var ht=["input"],bt=["inputNumberHost"],zt=[[["","nzInputAddonBefore",""]],[["","nzInputAddonAfter",""]],[["","nzInputPrefix",""]],[["","nzInputSuffix",""]],[["","nzInputNumberUpIcon",""]],[["","nzInputNumberDownIcon",""]]],Nt=["[nzInputAddonBefore]","[nzInputAddonAfter]","[nzInputPrefix]","[nzInputSuffix]","[nzInputNumberUpIcon]","[nzInputNumberDownIcon]"];function gt(e,r){}function Ct(e,r){if(e&1&&s(0,gt,0,0,"ng-template",8),e&2){a();let t=f(4);m("ngTemplateOutlet",t)}}function xt(e,r){}function St(e,r){if(e&1&&s(0,xt,0,0,"ng-template",8),e&2){a();let t=f(8);m("ngTemplateOutlet",t)}}function It(e,r){}function Tt(e,r){if(e&1&&s(0,It,0,0,"ng-template",8),e&2){a();let t=f(12);m("ngTemplateOutlet",t)}}function vt(e,r){e&1&&(l(0,"div",10),N(1),c())}function wt(e,r){}function yt(e,r){if(e&1&&s(0,wt,0,0,"ng-template",8),e&2){a(2);let t=f(6);m("ngTemplateOutlet",t)}}function At(e,r){}function Dt(e,r){if(e&1&&s(0,At,0,0,"ng-template",8),e&2){a(2);let t=f(10);m("ngTemplateOutlet",t)}}function Mt(e,r){e&1&&(l(0,"div",10),N(1,1),c())}function Et(e,r){if(e&1&&(l(0,"div",9),s(1,vt,2,0,"div",10)(2,yt,1,1,null,8)(3,Dt,1,1,null,8)(4,Mt,2,0,"div",10),c()),e&2){let t=a();p(),_(t.addonBefore()?1:-1),p(),_(t.hasAffix()?2:3),p(2),_(t.addonAfter()?4:-1)}}function Ft(e,r){}function Rt(e,r){if(e&1&&(l(0,"div"),s(1,Ft,0,0,"ng-template",8),c()),e&2){let t=a(),n=f(8);D(t.affixWrapperClass()),p(),m("ngTemplateOutlet",n)}}function Vt(e,r){e&1&&(l(0,"span",11),N(1,2),c())}function Pt(e,r){}function Ot(e,r){if(e&1&&M(0,"nz-form-item-feedback-icon",13),e&2){let t=a(3);m("status",t.finalStatus())}}function kt(e,r){if(e&1&&(l(0,"span",12),N(1,3),s(2,Ot,1,1,"nz-form-item-feedback-icon",13),c()),e&2){let t=a(2);p(2),_(t.hasFeedback()&&t.finalStatus()?2:-1)}}function jt(e,r){if(e&1&&s(0,Vt,2,0,"span",11)(1,Pt,0,0,"ng-template",8)(2,kt,3,1,"span",12),e&2){let t=a(),n=f(10);_(t.prefix()?0:-1),p(),m("ngTemplateOutlet",n),p(),_(t.suffix()||t.hasFeedback()?2:-1)}}function Wt(e,r){}function Bt(e,r){if(e&1&&(l(0,"div",null,5),s(2,Wt,0,0,"ng-template",8),c()),e&2){let t=a(),n=f(12);D(t.inputNumberClass()),p(2),m("ngTemplateOutlet",n)}}function Ht(e,r){e&1&&M(0,"nz-icon",20)}function Qt(e,r){e&1&&M(0,"nz-icon",21)}function Kt(e,r){if(e&1){let t=O();l(0,"div",17,7),C("mouseup",function(){b(t);let i=a(2);return z(i.stopAutoStep())})("mouseleave",function(){b(t);let i=a(2);return z(i.stopAutoStep())}),l(2,"span",18),C("mousedown",function(i){b(t);let o=a(2);return z(o.onStepMouseDown(i,!0))}),N(3,4,null,Ht,1,0),c(),l(5,"span",19),C("mousedown",function(i){b(t);let o=a(2);return z(o.onStepMouseDown(i,!1))}),N(6,5,null,Qt,1,0),c()()}if(e&2){let t=a(2);p(2),P("ant-input-number-handler-up-disabled",t.upDisabled()),A("aria-disabled",t.upDisabled()),p(3),P("ant-input-number-handler-down-disabled",t.downDisabled()),A("aria-disabled",t.downDisabled())}}function Ut(e,r){if(e&1){let t=O();s(0,Kt,8,6,"div",14),l(1,"div",15)(2,"input",16,6),C("input",function(){b(t);let i=f(3),o=a();return z(o.displayValue.set(i.value))})("change",function(i){b(t);let o=a();return z(o.onInputChange(i))}),c()()}if(e&2){let t,n=a();_(n.nzControls()?0:-1),p(2),m("value",n.displayValue())("placeholder",(t=n.nzPlaceHolder())!==null&&t!==void 0?t:"")("disabled",n.finalDisabled())("readOnly",n.nzReadOnly()),A("aria-valuemin",n.nzMin())("aria-valuemax",n.nzMax())("id",n.nzId())("step",n.nzStep())}}var qt=(()=>{class e{constructor(){this.nzId=u(null),this.nzSize=u("default"),this.nzPlaceHolder=u(null),this.nzStatus=u(""),this.nzStep=u(1,{transform:E}),this.nzMin=u(Number.MIN_SAFE_INTEGER,{transform:E}),this.nzMax=u(Number.MAX_SAFE_INTEGER,{transform:E}),this.nzPrecision=u(null),this.nzParser=u(n=>{let i=Zt(n),o=this.nzPrecision();return S(o)?i:+i.toFixed(o)}),this.nzFormatter=u(n=>{let i=this.nzPrecision();return S(i)?n.toString():n.toFixed(i)}),this.nzDisabled=u(!1,{transform:g}),this.nzReadOnly=u(!1,{transform:g}),this.nzAutoFocus=u(!1,{transform:g}),this.nzBordered=u(!0,{transform:g}),this.nzKeyboard=u(!0,{transform:g}),this.nzControls=u(!0,{transform:g}),this.nzOnStep=Y(),this.onChange=()=>{},this.onTouched=()=>{},this.isDisabledFirstChange=!0,this.compactSize=h(lt,{optional:!0}),this.inputRef=V.required("input"),this.hostRef=V("inputNumberHost"),this.elementRef=h(X),this.injector=h(L),this.focusMonitor=h(st),this.directionality=h(ut),this.nzFormStatusService=h(dt,{optional:!0}),this.autoStepTimer=null,this.value=T(null),this.displayValue=T(""),this.dir=pt(this.directionality.change,{initialValue:this.directionality.value}),this.focused=T(!1),this.hasFeedback=T(!1),this.finalStatus=W(()=>this.nzStatus()),this.finalDisabled=W(()=>this.nzDisabled()),this.prefix=v(K),this.suffix=v(U),this.addonBefore=v(H),this.addonAfter=v(Q),this.hasAffix=d(()=>!!this.prefix()||!!this.suffix()||this.hasFeedback()),this.hasAddon=d(()=>!!this.addonBefore()||!!this.addonAfter()),this.class=d(()=>this.hasAddon()?this.groupWrapperClass():this.hasAffix()?this.affixWrapperClass():this.inputNumberClass()),this.inputNumberClass=d(()=>y({"ant-input-number":!0,"ant-input-number-lg":this.finalSize()==="large","ant-input-number-sm":this.finalSize()==="small","ant-input-number-disabled":this.finalDisabled(),"ant-input-number-readonly":this.nzReadOnly(),"ant-input-number-borderless":!this.nzBordered(),"ant-input-number-focused":this.focused(),"ant-input-number-rtl":this.dir()==="rtl","ant-input-number-in-form-item":!!this.nzFormStatusService,"ant-input-number-out-of-range":this.value()!==null&&!Yt(this.value(),this.nzMin(),this.nzMax())},F("ant-input-number",this.finalStatus(),this.hasFeedback()))),this.affixWrapperClass=d(()=>y({"ant-input-number-affix-wrapper":!0,"ant-input-number-affix-wrapper-disabled":this.finalDisabled(),"ant-input-number-affix-wrapper-readonly":this.nzReadOnly(),"ant-input-number-affix-wrapper-borderless":!this.nzBordered(),"ant-input-number-affix-wrapper-focused":this.focused(),"ant-input-number-affix-wrapper-rtl":this.dir()==="rtl"},F("ant-input-number-affix-wrapper",this.finalStatus(),this.hasFeedback()))),this.groupWrapperClass=d(()=>y({"ant-input-number-group-wrapper":!0,"ant-input-number-group-wrapper-rtl":this.dir()==="rtl"},F("ant-input-number-group-wrapper",this.finalStatus(),this.hasFeedback()))),this.finalSize=d(()=>this.compactSize?this.compactSize():this.nzSize()),this.upDisabled=d(()=>!S(this.value())&&this.value()>=this.nzMax()),this.downDisabled=d(()=>!S(this.value())&&this.value()<=this.nzMin());let t=h(Z);R(()=>{let n=this.hostRef(),i=n||this.elementRef;this.focusMonitor.monitor(i,!0).pipe(B(t)).subscribe(o=>{this.focused.set(!!o),o||this.onTouched()}),t.onDestroy(()=>{this.focusMonitor.stopMonitoring(i)})}),this.nzFormStatusService?.formStatusChanges.pipe(B()).subscribe(({status:n,hasFeedback:i})=>{this.finalStatus.set(n),this.hasFeedback.set(i)})}ngOnInit(){this.nzAutoFocus()&&R(()=>this.focus(),{injector:this.injector})}writeValue(t){it(()=>this.setValue(t))}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.isDisabledFirstChange||this.finalDisabled.set(t),this.isDisabledFirstChange=!1}focus(){this.inputRef().nativeElement.focus()}blur(){this.inputRef().nativeElement.blur()}step(t,n){if(n&&this.upDisabled()||!n&&this.downDisabled())return;let i=t.shiftKey?this.nzStep()*10:this.nzStep();n||(i=-i);let o=$t(i),I=Math.pow(10,o);this.setValue((Math.round((this.value()||0)*I)+Math.round(i*I))/I,!0),this.nzOnStep.emit({type:n?"up":"down",value:this.value(),offset:this.nzStep()}),this.focus()}setValue(t,n){let i=null;S(t)||(i=this.nzParser()(t.toString()),n&&(Number.isNaN(i)?i=null:i=Jt(i,this.nzMin(),this.nzMax(),this.nzPrecision()))),this.value.set(i),this.displayValue.set(i===null?"":this.nzFormatter()(i)),this.onChange(i)}stopAutoStep(){this.autoStepTimer!==null&&(clearTimeout(this.autoStepTimer),this.autoStepTimer=null)}onStepMouseDown(t,n){t.preventDefault(),this.stopAutoStep(),this.step(t,n);let i=()=>{this.step(t,n),this.autoStepTimer=setTimeout(i,Gt)};this.autoStepTimer=setTimeout(i,Lt)}onKeyDown(t){switch(t.keyCode){case 38:t.preventDefault(),this.nzKeyboard()&&this.step(t,!0);break;case 40:t.preventDefault(),this.nzKeyboard()&&this.step(t,!1);break}}onInputChange(t){let n=t.target;this.setValue(n.value,!0)}static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275cmp=J({type:e,selectors:[["nz-input-number"]],contentQueries:function(n,i,o){n&1&&(w(o,i.prefix,K,5),w(o,i.suffix,U,5),w(o,i.addonBefore,H,5),w(o,i.addonAfter,Q,5)),n&2&&j(4)},viewQuery:function(n,i){n&1&&(k(i.inputRef,ht,5),k(i.hostRef,bt,5)),n&2&&j(2)},hostVars:2,hostBindings:function(n,i){n&1&&C("keydown",function(I){return i.onKeyDown(I)}),n&2&&D(i.class())},inputs:{nzId:[1,"nzId"],nzSize:[1,"nzSize"],nzPlaceHolder:[1,"nzPlaceHolder"],nzStatus:[1,"nzStatus"],nzStep:[1,"nzStep"],nzMin:[1,"nzMin"],nzMax:[1,"nzMax"],nzPrecision:[1,"nzPrecision"],nzParser:[1,"nzParser"],nzFormatter:[1,"nzFormatter"],nzDisabled:[1,"nzDisabled"],nzReadOnly:[1,"nzReadOnly"],nzAutoFocus:[1,"nzAutoFocus"],nzBordered:[1,"nzBordered"],nzKeyboard:[1,"nzKeyboard"],nzControls:[1,"nzControls"]},outputs:{nzOnStep:"nzOnStep"},exportAs:["nzInputNumber"],features:[nt([{provide:ft,useExisting:q(()=>e),multi:!0},{provide:mt,useValue:"input-number"}]),tt([ct])],ngContentSelectors:Nt,decls:13,vars:1,consts:[["inputNumberWithAddonInner",""],["inputNumberWithAffix",""],["inputNumberWithAffixInner",""],["inputNumber",""],["inputNumberInner",""],["inputNumberHost",""],["input",""],["handlers",""],[3,"ngTemplateOutlet"],[1,"ant-input-number-wrapper","ant-input-number-group"],[1,"ant-input-number-group-addon"],[1,"ant-input-number-prefix"],[1,"ant-input-number-suffix"],[3,"status"],[1,"ant-input-number-handler-wrap"],[1,"ant-input-number-input-wrap"],["autocomplete","off","role","spinbutton",1,"ant-input-number-input",3,"input","change","value","placeholder","disabled","readOnly"],[1,"ant-input-number-handler-wrap",3,"mouseup","mouseleave"],["role","button","unselectable","on",1,"ant-input-number-handler","ant-input-number-handler-up",3,"mousedown"],["role","button","unselectable","on",1,"ant-input-number-handler","ant-input-number-handler-down",3,"mousedown"],["nzType","up",1,"ant-input-number-handler-up-inner"],["nzType","down",1,"ant-input-number-handler-down-inner"]],template:function(n,i){n&1&&(et(zt),s(0,Ct,1,1,null,8)(1,St,1,1,null,8)(2,Tt,1,1,null,8)(3,Et,5,3,"ng-template",null,0,x)(5,Rt,2,3,"ng-template",null,1,x)(7,jt,3,3,"ng-template",null,2,x)(9,Bt,3,3,"ng-template",null,3,x)(11,Ut,4,9,"ng-template",null,4,x)),n&2&&_(i.hasAddon()?0:i.hasAffix()?1:2)},dependencies:[at,ot,_t,rt],encapsulation:2,changeDetection:0})}}return e})(),Gt=200,Lt=600;function Zt(e){return+e.trim().replace(/。/g,".")}function Yt(e,r,t){return e>=r&&e<=t}function Xt(e,r,t){return e<r?r:e>t?t:e}function Jt(e,r,t,n){if(n===null)return Xt(e,r,t);let i=+e.toFixed(n),o=Math.pow(10,n);return i<r?Math.ceil(r*o)/o:i>t?Math.floor(t*o)/o:i}function $t(e){return e.toString().split(".")[1]?.length||0}var Ce=(()=>{class e{static{this.\u0275fac=function(n){return new(n||e)}}static{this.\u0275mod=$({type:e})}static{this.\u0275inj=G({imports:[qt]})}}return e})();export{qt as a,Ce as b};