第7项:按路由加载页面并核验登录和开单冷启动预算
This commit is contained in:
1 parent
f30905b236
commit
9367118e04
71 files changed
+1250
-454
No files matched your search
+30
@@ -0,0 +1,30 @@
|
||||
import{n as e}from"./rolldown-runtime-Dl_DZoUm.js";import{$n as t,$t as n,An as r,Bn as i,Dn as a,En as o,Fn as s,Gn as c,In as l,It as u,J as d,Kn as f,Kt as p,Ln as m,Mt as h,Nn as g,On as _,Pn as v,Qn as y,Rn as b,Rt as ee,S as x,Sn as S,St as C,Tt as w,U as T,Un as E,Ut as D,V as te,Vn as ne,Vt as O,Wt as k,Xn as re,Xt as A,Zn as j,_n as M,_t as N,bt as P,cn as F,gt as I,in as L,it as R,jn as z,jt as ie,kn as ae,kt as B,ln as oe,lt as se,nn as ce,on as V,pt as H,qn as U,rt as le,tn as W,tr as ue,un as G,ut as de,wn as K,wt as fe,xt as pe,zt as q}from"./index-D422TGjj.js";var J=e(t()),Y=e(ue()),me=Y.createContext(null),he=(function(){if(typeof Map<`u`)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){t===void 0&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n++){var i=r[n];e.call(t,i[1],i[0])}},t}()})(),ge=typeof window<`u`&&typeof document<`u`&&window.document===document,_e=(function(){return typeof global<`u`&&global.Math===Math?global:typeof self<`u`&&self.Math===Math?self:typeof window<`u`&&window.Math===Math?window:Function(`return this`)()})(),ve=(function(){return typeof requestAnimationFrame==`function`?requestAnimationFrame.bind(_e):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}})(),ye=2;function be(e,t){var n=!1,r=!1,i=0;function a(){n&&(n=!1,e()),r&&s()}function o(){ve(a)}function s(){var e=Date.now();if(n){if(e-i<ye)return;r=!0}else n=!0,r=!1,setTimeout(o,t);i=e}return s}var X=20,xe=[`top`,`right`,`bottom`,`left`,`width`,`height`,`size`,`weight`],Se=typeof MutationObserver<`u`,Ce=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=be(this.refresh.bind(this),X)}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},e.prototype.connect_=function(){ge&&!this.connected_&&(document.addEventListener(`transitionend`,this.onTransitionEnd_),window.addEventListener(`resize`,this.refresh),Se?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener(`DOMSubtreeModified`,this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){ge&&this.connected_&&(document.removeEventListener(`transitionend`,this.onTransitionEnd_),window.removeEventListener(`resize`,this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener(`DOMSubtreeModified`,this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=t===void 0?``:t;xe.some(function(e){return!!~n.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||=new e,this.instance_},e.instance_=null,e}(),Z=(function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e}),Q=(function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||_e}),we=Pe(0,0,0,0);function Te(e){return parseFloat(e)||0}function Ee(e){return[...arguments].slice(1).reduce(function(t,n){return t+Te(e[`border-`+n+`-width`])},0)}function De(e){for(var t=[`top`,`right`,`bottom`,`left`],n={},r=0,i=t;r<i.length;r++){var a=i[r];n[a]=Te(e[`padding-`+a])}return n}function Oe(e){var t=e.getBBox();return Pe(0,0,t.width,t.height)}function ke(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return we;var r=Q(e).getComputedStyle(e),i=De(r),a=i.left+i.right,o=i.top+i.bottom,s=Te(r.width),c=Te(r.height);if(r.boxSizing===`border-box`&&(Math.round(s+a)!==t&&(s-=Ee(r,`left`,`right`)+a),Math.round(c+o)!==n&&(c-=Ee(r,`top`,`bottom`)+o)),!je(e)){var l=Math.round(s+a)-t,u=Math.rouLine truncated
|
||||
& > ${t}-affix-wrapper,
|
||||
& > ${t}-number-affix-wrapper,
|
||||
& > ${n}-picker-range
|
||||
`]:{display:`inline-flex`},"& > *:not(:last-child)":{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderInlineEndWidth:e.lineWidth},[t]:{float:`none`},[`& > ${n}-select > ${n}-select-selector,
|
||||
& > ${n}-select-auto-complete ${t},
|
||||
& > ${n}-cascader-picker ${t},
|
||||
& > ${t}-group-wrapper ${t}`]:{borderInlineEndWidth:e.lineWidth,borderRadius:0,"&:hover, &:focus":{zIndex:1}},[`& > ${n}-select-focused`]:{zIndex:1},[`& > ${n}-select > ${n}-select-arrow`]:{zIndex:1},[`& > *:first-child,
|
||||
& > ${n}-select:first-child > ${n}-select-selector,
|
||||
& > ${n}-select-auto-complete:first-child ${t},
|
||||
& > ${n}-cascader-picker:first-child ${t}`]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius},[`& > *:last-child,
|
||||
& > ${n}-select:last-child > ${n}-select-selector,
|
||||
& > ${n}-cascader-picker:last-child ${t},
|
||||
& > ${n}-cascader-picker-focused:last-child ${t}`]:{borderInlineEndWidth:e.lineWidth,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius},[`& > ${n}-select-auto-complete ${t}`]:{verticalAlign:`top`},[`${t}-group-wrapper + ${t}-group-wrapper`]:{marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),[`${t}-affix-wrapper`]:{borderRadius:0}},[`${t}-group-wrapper:not(:last-child)`]:{[`&${t}-search > ${t}-group`]:{[`& > ${t}-group-addon > ${t}-search-button`]:{borderRadius:0},[`& > ${t}`]:{borderStartStartRadius:e.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:e.borderRadius}}}})}},On=e=>{let{componentCls:t,controlHeightSM:n,lineWidth:r,calc:i}=e,a=i(n).sub(i(r).mul(2)).sub(16).div(2).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},A(e)),En(e)),dn(e)),_n(e)),mn(e)),Sn(e)),{'&[type="color"]':{height:e.controlHeight,[`&${t}-lg`]:{height:e.controlHeightLG},[`&${t}-sm`]:{height:n,paddingTop:a,paddingBottom:a}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{appearance:`none`}})}},kn=e=>{let{componentCls:t}=e;return{[`${t}-clear-icon`]:{margin:0,padding:0,lineHeight:0,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,verticalAlign:-1,cursor:`pointer`,transition:`color ${e.motionDurationSlow}`,border:`none`,outline:`none`,backgroundColor:`transparent`,"&:hover":{color:e.colorIcon},"&:active":{color:e.colorText},"&-hidden":{visibility:`hidden`},"&-has-suffix":{margin:`0 ${K(e.inputAffixPadding)}`}}}},An=e=>{let{componentCls:t,inputAffixPadding:n,colorTextDescription:r,motionDurationSlow:i,colorIcon:a,colorIconHover:o,iconCls:s}=e,c=`${t}-affix-wrapper`,l=`${t}-affix-wrapper-disabled`;return{[c]:Object.assign(Object.assign(Object.assign(Object.assign({},En(e)),{display:`inline-flex`,[`&:not(${t}-disabled):hover`]:{zIndex:1,[`${t}-search-with-button &`]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},[`> input${t}`]:{padding:0},[`> input${t}, > textarea${t}`]:{fontSize:`inherit`,border:`none`,borderRadius:0,outline:`none`,background:`transparent`,color:`inherit`,"&::-ms-reveal":{display:`none`},"&:focus":{boxShadow:`none !important`}},"&::before":{display:`inline-block`,width:0,visibility:`hidden`,content:`"\\a0"`},[t]:{"&-prefix, &-suffix":{display:`flex`,flex:`none`,alignItems:`center`,"> *:not(:last-child)":{marginInlineEnd:e.paddingXS}},"&-show-count-suffix":{color:r,direction:`ltr`},"&-show-count-has-suffix":{marginInlineEnd:e.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}}}),kn(e)),{[`${s}${t}-password-icon`]:{color:a,cursor:`pointer`,transition:`all ${i}`,"&:hover":{color:o}}}),[`${t}-underlined`]:{borderRadius:0},[l]:{[`${s}${t}-password-icon`]:{color:a,cursor:`not-allowed`,"&:hover":{color:a}}}}},jn=e=>{let{componentCls:t,borderRadiusLG:n,borderRadiusSM:r}=e;return{[`${t}-group`]:Object.assign(Object.assign(Object.assign({},A(e)),Dn(e)),{"&-rtl":{direction:`rtl`},"&-wrapper":Object.assign(Object.assign(Object.assign({display:`inline-block`,width:`100%`,textAlign:`start`,verticalAlign:`top`,"&-rtl":{direction:`rtl`},"&-lg":{[`${t}-group-addon`]:{borderRadius:n,fontSize:e.inputFontSizeLG}},"&-sm":{[`${t}-group-addon`]:{borderRadius:r}}},pn(e)),yn(e)),{[`&:not(${t}-compact-first-item):not(${t}-compact-last-item)${t}-compact-item`]:{[`${t}, ${t}-group-addon`]:{borderRadius:0}},[`&:not(${t}-compact-last-item)${t}-compact-first-item`]:{[`${t}, ${t}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${t}-compact-first-item)${t}-compact-last-item`]:{[`${t}, ${t}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&:not(${t}-compact-last-item)${t}-compact-item`]:{[`${t}-affix-wrapper`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${t}-compact-first-item)${t}-compact-item`]:{[`${t}-affix-wrapper`]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},Mn=e=>{let{componentCls:t,antCls:n}=e,r=`${t}-search`;return{[r]:{[t]:{"&:not([disabled]):hover, &:not([disabled]):focus":{[`+ ${t}-group-addon ${r}-button:not(${n}-btn-color-primary):not(${n}-btn-variant-text)`]:{borderInlineStartColor:e.colorPrimaryHover}}},[`${t}-affix-wrapper`]:{height:e.controlHeight,borderRadius:0},[`${t}-lg`]:{lineHeight:e.calc(e.lineHeightLG).sub(2e-4).equal()},[`> ${t}-group`]:{[`> ${t}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${r}-button`]:{marginInlineEnd:-1,borderStartStartRadius:0,borderEndStartRadius:0,boxShadow:`none`},[`${r}-button:not(${n}-btn-color-primary)`]:{color:e.colorTextDescription,"&:not([disabled]):hover":{color:e.colorPrimaryHover},"&:active":{color:e.colorPrimaryActive},[`&${n}-btn-loading::before`]:{inset:0}}}},[`${r}-button`]:{height:e.controlHeight,"&:hover, &:focus":{zIndex:1}},"&-large":{[`${t}-affix-wrapper, ${r}-button`]:{height:e.controlHeightLG}},"&-small":{[`${t}-affix-wrapper, ${r}-button`]:{height:e.controlHeightSM}},"&-rtl":{direction:`rtl`},[`&${t}-cLine truncated
|
||||
> ${t},
|
||||
${t}-affix-wrapper`]:{"&:hover, &:focus, &:active":{zIndex:2}},[`> ${t}-affix-wrapper-focused`]:{zIndex:2}}}}},Nn=e=>{let{componentCls:t}=e;return{[`${t}-out-of-range`]:{[`&, & input, & textarea, ${t}-show-count-suffix, ${t}-data-count`]:{color:e.colorError}}}},Pn=k([`Input`,`Shared`],e=>{let t=W(e,an(e));return[On(t),An(t)]},on,{resetFont:!1}),Fn=k([`Input`,`Component`],e=>{let t=W(e,an(e));return[jn(t),Mn(t),Nn(t),se(t)]},on,{resetFont:!1});function In(e){return!!(e.addonBefore||e.addonAfter)}function Ln(e){return!!(e.prefix||e.suffix||e.allowClear)}function Rn(e,t,n){var r=t.cloneNode(!0),i=Object.create(e,{target:{value:r},currentTarget:{value:r}});return r.value=n,typeof t.selectionStart==`number`&&typeof t.selectionEnd==`number`&&(r.selectionStart=t.selectionStart,r.selectionEnd=t.selectionEnd),r.setSelectionRange=function(){t.setSelectionRange.apply(t,arguments)},i}function zn(e,t,n,r){if(n){var i=t;t.type===`click`?(i=Rn(t,e,``),n(i)):(e.type!==`file`&&r!==void 0&&(i=Rn(t,e,r)),n(i))}}function Bn(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var r=e.value.length;switch(n){case`start`:e.setSelectionRange(0,0);break;case`end`:e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}}var Vn=Y.forwardRef(function(e,t){var n=e.inputElement,r=e.children,i=e.prefixCls,a=e.prefix,o=e.suffix,s=e.addonBefore,c=e.addonAfter,l=e.className,u=e.style,d=e.disabled,p=e.readOnly,m=e.focused,h=e.triggerFocus,g=e.allowClear,_=e.value,v=e.handleReset,b=e.hidden,ee=e.classes,x=e.classNames,S=e.dataAttrs,C=e.styles,w=e.components,T=e.onClear,E=r??n,D=w?.affixWrapper||`span`,te=w?.groupWrapper||`span`,ne=w?.wrapper||`span`,O=w?.groupAddon||`span`,k=(0,Y.useRef)(null),re=function(e){var t;(t=k.current)!=null&&t.contains(e.target)&&h?.()},A=Ln(e),M=(0,Y.cloneElement)(E,{value:_,className:(0,J.default)(E.props?.className,!A&&x?.variant)||null}),N=(0,Y.useRef)(null);if(Y.useImperativeHandle(t,function(){return{nativeElement:N.current||k.current}}),A){var P=null;if(g){var F=!d&&!p&&_,I=`${i}-clear-icon`,L=j(g)===`object`&&g!=null&&g.clearIcon?g.clearIcon:`✖`;P=Y.createElement(`button`,{type:`button`,tabIndex:-1,onClick:function(e){v?.(e),T?.()},onMouseDown:function(e){return e.preventDefault()},className:(0,J.default)(I,U(U({},`${I}-hidden`,!F),`${I}-has-suffix`,!!o))},L)}var R=`${i}-affix-wrapper`,z=(0,J.default)(R,U(U(U(U(U({},`${i}-disabled`,d),`${R}-disabled`,d),`${R}-focused`,m),`${R}-readonly`,p),`${R}-input-with-clear-btn`,o&&g&&_),ee?.affixWrapper,x?.affixWrapper,x?.variant),ie=(o||g)&&Y.createElement(`span`,{className:(0,J.default)(`${i}-suffix`,x?.suffix),style:C?.suffix},P,o);M=Y.createElement(D,y({className:z,style:C?.affixWrapper,onClick:re},S?.affixWrapper,{ref:k}),a&&Y.createElement(`span`,{className:(0,J.default)(`${i}-prefix`,x?.prefix),style:C?.prefix},a),M,ie)}if(In(e)){var ae=`${i}-group`,B=`${ae}-addon`,oe=`${ae}-wrapper`,se=(0,J.default)(`${i}-wrapper`,ae,ee?.wrapper,x?.wrapper),ce=(0,J.default)(oe,U({},`${oe}-disabled`,d),ee?.group,x?.groupWrapper);M=Y.createElement(te,{className:ce,ref:N},Y.createElement(ne,{className:se},s&&Y.createElement(O,{className:B},s),M,c&&Y.createElement(O,{className:B},c)))}return Y.cloneElement(M,{className:(0,J.default)(M.props?.className,l)||null,style:f(f({},M.props?.style),u),hidden:b})}),Hn=[`show`];function Un(e,t){return Y.useMemo(function(){var n={};t&&(n.show=j(t)===`object`&&t.formatter?t.formatter:!!t),n=f(f({},n),e);var r=n,i=r.show,a=o(r,Hn);return f(f({},a),{},{show:!!i,showFormatter:typeof i==`function`?i:void 0,strategy:a.strategy||function(e){return e.length}})},[e,t])}var Wn=[`autoComplete`,`onChange`,`onFocus`,`onBlur`,`onPressEnter`,`onKeyDown`,`onKeyUp`,`prefixCls`,`disabled`,`htmlSize`,`className`,`maxLength`,`suffix`,`showCount`,`count`,`type`,`classes`,`classNames`,`styles`,`onCompositionStart`,`onCompositionEnd`],Gn=(0,Y.forwardRef)(function(e,t){var n=e.autoComplete,i=e.onChange,a=e.onFocus,s=e.onBlur,c=e.onPressEnter,l=e.onKeyDown,u=e.onKeyUp,d=e.prefixCls,p=d===void 0?`rc-input`:d,m=e.disabled,h=e.htmlSize,g=e.className,v=e.maxLength,b=e.suffix,ee=e.showCount,x=e.count,S=e.type,C=S===void 0?`text`:S,w=e.classes,T=e.classNames,E=e.styles,D=e.onCompositionStart,te=e.onCompositionEnd,ne=o(e,Wn),O=(0,Y.useState)(!1),k=_(O,2),re=k[0],A=k[1],j=(0,Y.useRef)(!1),M=(0,Y.useRef)(!1),N=(0,Y.useRef)(null),P=(0,Y.useRef)(null),F=function(e){N.current&&Bn(N.current,e)},I=ce(e.defaultValue,{value:e.value}),L=_(I,2),R=L[0],z=L[1],ie=R==null?``:String(R),ae=(0,Y.useState)(null),B=_(ae,2),oe=B[0],se=B[1],V=Un(x,ee),H=V.max||v,le=V.strategy(ie),W=!!H&&le>H;(0,Y.useImperativeHandle)(t,function(){return{focus:F,blur:function(){var e;(e=N.current)==null||e.blur()},setSelectionRange:function(e,t,n){var r;(r=N.current)==null||r.setSelectionRange(e,t,n)},select:function(){var e;(e=N.current)==null||e.select()},input:N.current,nativeElement:P.current?.nativeElement||N.current}}),(0,Y.useEffect)(function(){M.current&&=!1,A(function(e){return e&&m?!1:e}
Line truncated
|
||||
min-height:0 !important;
|
||||
max-height:none !important;
|
||||
height:0 !important;
|
||||
visibility:hidden !important;
|
||||
overflow:hidden !important;
|
||||
position:absolute !important;
|
||||
z-index:-1000 !important;
|
||||
top:0 !important;
|
||||
right:0 !important;
|
||||
pointer-events: none !important;
|
||||
`,Jn=[`letter-spacing`,`line-height`,`padding-top`,`padding-bottom`,`font-family`,`font-weight`,`font-size`,`font-variant`,`text-rendering`,`text-transform`,`width`,`text-indent`,`padding-left`,`padding-right`,`border-width`,`box-sizing`,`word-break`,`white-space`],Yn={},Xn;function Zn(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=e.getAttribute(`id`)||e.getAttribute(`data-reactid`)||e.getAttribute(`name`);if(t&&Yn[n])return Yn[n];var r=window.getComputedStyle(e),i=r.getPropertyValue(`box-sizing`)||r.getPropertyValue(`-moz-box-sizing`)||r.getPropertyValue(`-webkit-box-sizing`),a=parseFloat(r.getPropertyValue(`padding-bottom`))+parseFloat(r.getPropertyValue(`padding-top`)),o=parseFloat(r.getPropertyValue(`border-bottom-width`))+parseFloat(r.getPropertyValue(`border-top-width`)),s={sizingStyle:Jn.map(function(e){return`${e}:${r.getPropertyValue(e)}`}).join(`;`),paddingSize:a,borderSize:o,boxSizing:i};return t&&n&&(Yn[n]=s),s}function Qn(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Xn||(Xn=document.createElement(`textarea`),Xn.setAttribute(`tab-index`,`-1`),Xn.setAttribute(`aria-hidden`,`true`),Xn.setAttribute(`name`,`hiddenTextarea`),document.body.appendChild(Xn)),e.getAttribute(`wrap`)?Xn.setAttribute(`wrap`,e.getAttribute(`wrap`)):Xn.removeAttribute(`wrap`);var i=Zn(e,t),a=i.paddingSize,o=i.borderSize,s=i.boxSizing,c=i.sizingStyle;Xn.setAttribute(`style`,`${c};${qn}`),Xn.value=e.value||e.placeholder||``;var l=void 0,u=void 0,d,f=Xn.scrollHeight;if(s===`border-box`?f+=o:s===`content-box`&&(f-=a),n!==null||r!==null){Xn.value=` `;var p=Xn.scrollHeight-a;n!==null&&(l=p*n,s===`border-box`&&(l=l+a+o),f=Math.max(l,f)),r!==null&&(u=p*r,s===`border-box`&&(u=u+a+o),d=f>u?``:`hidden`,f=Math.min(u,f))}var m={height:f,overflowY:d,resize:`none`};return l&&(m.minHeight=l),u&&(m.maxHeight=u),m}var $n=[`prefixCls`,`defaultValue`,`value`,`autoSize`,`onResize`,`className`,`style`,`disabled`,`onChange`,`onInternalAutoSize`],er=0,tr=1,nr=2,rr=Y.forwardRef(function(e,t){var n=e,r=n.prefixCls,i=n.defaultValue,a=n.value,s=n.autoSize,c=n.onResize,l=n.className,u=n.style,d=n.disabled,p=n.onChange;n.onInternalAutoSize;var m=o(n,$n),h=ce(i,{value:a,postState:function(e){return e??``}}),g=_(h,2),v=g[0],b=g[1],ee=function(e){b(e.target.value),p?.(e)},x=Y.useRef();Y.useImperativeHandle(t,function(){return{textArea:x.current}});var C=Y.useMemo(function(){return s&&j(s)===`object`?[s.minRows,s.maxRows]:[]},[s]),w=_(C,2),T=w[0],E=w[1],D=!!s,te=Y.useState(nr),ne=_(te,2),O=ne[0],k=ne[1],re=Y.useState(),A=_(re,2),M=A[0],N=A[1],P=function(){k(er)};S(function(){D&&P()},[a,T,E,D]),S(function(){if(O===er)k(tr);else if(O===tr){var e=Qn(x.current,!1,T,E);k(nr),N(e)}},[O]);var F=Y.useRef(),I=function(){ae.cancel(F.current)},L=function(e){O===nr&&(c?.(e),s&&(I(),F.current=ae(function(){P()})))};Y.useEffect(function(){return I},[]);var R=D?M:null,z=f(f({},u),R);return(O===er||O===tr)&&(z.overflowY=`hidden`,z.overflowX=`hidden`),Y.createElement(Xe,{onResize:L,disabled:!(s||c)},Y.createElement(`textarea`,y({},m,{ref:x,style:z,className:(0,J.default)(r,l,U({},`${r}-disabled`,d)),disabled:d,value:v,onChange:ee})))}),ir=[`defaultValue`,`value`,`onFocus`,`onBlur`,`onChange`,`allowClear`,`maxLength`,`onCompositionStart`,`onCompositionEnd`,`suffix`,`prefixCls`,`showCount`,`count`,`className`,`style`,`disabled`,`hidden`,`classNames`,`styles`,`onResize`,`onClear`,`onPressEnter`,`readOnly`,`autoSize`,`onKeyDown`],ar=Y.forwardRef(function(e,t){var n=e.defaultValue,i=e.value,a=e.onFocus,s=e.onBlur,c=e.onChange,l=e.allowClear,u=e.maxLength,d=e.onCompositionStart,p=e.onCompositionEnd,m=e.suffix,h=e.prefixCls,g=h===void 0?`rc-textarea`:h,v=e.showCount,b=e.count,ee=e.className,x=e.style,S=e.disabled,C=e.hidden,w=e.classNames,T=e.styles,E=e.onResize,D=e.onClear,te=e.onPressEnter,ne=e.readOnly,O=e.autoSize,k=e.onKeyDown,re=o(e,ir),A=ce(n,{value:i,defaultValue:n}),j=_(A,2),M=j[0],N=j[1],P=M==null?``:String(M),F=Y.useState(!1),I=_(F,2),L=I[0],R=I[1],z=Y.useRef(!1),ie=Y.useState(null),ae=_(ie,2),B=ae[0],oe=ae[1],se=(0,Y.useRef)(null),V=(0,Y.useRef)(null),H=function(){return V.current?.textArea},le=function(){H().focus()};(0,Y.useImperativeHandle)(t,function(){return{resizableTextArea:V.current,focus:le,blur:function(){H().blur()},nativeElement:se.current?.nativeElement||H()}}),(0,Y.useEffect)(function(){R(function(e){return!S&&e})},[S]);var W=Y.useState(null),ue=_(W,2),G=ue[0],de=ue[1];Y.useEffect(function(){if(G){var e;(e=H()).setSelectionRange.apply(e,r(G))}},[G]);var K=Un(b,v),fe=K.max??u,pe=Number(fe)>0,q=K.strategy(P),me=!!fe&&q>fe,he=function(e,t){var n=t;!z.current&&K.exceedFormatter&&K.max&&K.strategy(t)>K.max&&(n=K.exceedFormatter(t,{max:K.max}),t!==n&&de([H().selectionStart||0,H().selectionEnd||0])),N(n),zn(e.currentTarget,e,c,n)},ge=function(e){z.current=!0,d?.(e)},_e=function(e){z.current=!1,he(e,e.
Line truncated
|
||||
&-allow-clear > ${t},
|
||||
&-affix-wrapper${r}-has-feedback ${t}
|
||||
`]:{paddingInlineEnd:n},[`&-affix-wrapper${t}-affix-wrapper`]:{padding:0,[`> textarea${t}`]:{fontSize:`inherit`,border:`none`,outline:`none`,background:`transparent`,minHeight:e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:`none !important`}},[`${t}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${t}-clear-icon`]:{position:`absolute`,insetInlineEnd:e.paddingInline,insetBlockStart:e.paddingXS},[`${r}-suffix`]:{position:`absolute`,top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:`inline-flex`,alignItems:`center`,margin:`auto`,pointerEvents:`none`}}},[`&-affix-wrapper${t}-affix-wrapper-rtl`]:{[`${t}-suffix`]:{[`${t}-data-count`]:{direction:`ltr`,insetInlineStart:0}}},[`&-affix-wrapper${t}-affix-wrapper-sm`]:{[`${t}-suffix`]:{[`${t}-clear-icon`]:{insetInlineEnd:e.paddingInlineSM}}}}}},sr=k([`Input`,`TextArea`],e=>or(W(e,an(e))),on,{resetFont:!1}),cr=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},lr=(0,Y.forwardRef)((e,t)=>{let{prefixCls:n,bordered:r=!0,size:i,disabled:a,status:o,allowClear:s,classNames:c,rootClassName:l,className:u,style:d,styles:f,variant:p,showCount:m,onMouseDown:h,onResize:g}=e,_=cr(e,[`prefixCls`,`bordered`,`size`,`disabled`,`status`,`allowClear`,`classNames`,`rootClassName`,`className`,`style`,`styles`,`variant`,`showCount`,`onMouseDown`,`onResize`]),{getPrefixCls:v,direction:y,allowClear:b,autoComplete:ee,className:x,style:S,classNames:C,styles:w}=G(`textArea`),E=Y.useContext(V),D=a??E,{status:te,hasFeedback:ne,feedbackIcon:O}=Y.useContext(T),k=At(te,o),re=Y.useRef(null);Y.useImperativeHandle(t,()=>({resizableTextArea:re.current?.resizableTextArea,focus:e=>{Bn(re.current?.resizableTextArea?.textArea,e)},blur:()=>re.current?.blur()}));let A=v(`input`,n),j=B(A),[M,P,F]=Pn(A,l),[L]=sr(A,j),{compactSize:R,compactItemClassnames:z}=I(A,y),ie=N(e=>i??R??e),[ae,oe]=jt(`textArea`,p,r),se=Kn(s??b),[ce,H]=Y.useState(!1),[U,le]=Y.useState(!1),W=e=>{H(!0),h?.(e);let t=()=>{H(!1),document.removeEventListener(`mouseup`,t)};document.addEventListener(`mouseup`,t)},ue=e=>{if(g?.(e),ce&&typeof getComputedStyle==`function`){let e=(re.current?.nativeElement)?.querySelector(`textarea`);e&&getComputedStyle(e).resize===`both`&&le(!0)}};return M(L(Y.createElement(ar,Object.assign({autoComplete:ee},_,{style:Object.assign(Object.assign({},S),d),styles:Object.assign(Object.assign({},w),f),disabled:D,allowClear:se,className:(0,J.default)(F,j,u,l,z,x,U&&`${A}-textarea-affix-wrapper-resize-dirty`),classNames:Object.assign(Object.assign(Object.assign({},c),C),{textarea:(0,J.default)({[`${A}-sm`]:ie===`small`,[`${A}-lg`]:ie===`large`},P,c?.textarea,C.textarea,ce&&`${A}-mouse-active`),variant:(0,J.default)({[`${A}-${ae}`]:oe},kt(A,k)),affixWrapper:(0,J.default)(`${A}-textarea-affix-wrapper`,{[`${A}-affix-wrapper-rtl`]:y===`rtl`,[`${A}-affix-wrapper-sm`]:ie===`small`,[`${A}-affix-wrapper-lg`]:ie===`large`,[`${A}-textarea-show-count`]:m||e.count?.show},P)}),prefixCls:A,suffix:ne&&Y.createElement(`span`,{className:`${A}-textarea-suffix`},O),showCount:m,ref:re,onResize:ue,onMouseDown:W}))))});export{tt as C,Ot as S,Xe as T,Pt as _,Tn as a,At as b,ln as c,an as d,rn as f,Vt as g,Gt as h,En as i,cn as l,Ut as m,Kn as n,Fn as o,Xt as p,Gn as r,Pn as s,lr as t,on as u,Nt as v,et as w,kt as x,jt as y};
|
||||
Reference in new issue
Block a user