@inntechcorp/it-design 2.2.85 → 2.2.86
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/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3516,7 +3516,7 @@
|
|
|
3516
3516
|
background-color: #f8285a;
|
|
3517
3517
|
}
|
|
3518
3518
|
|
|
3519
|
-
`;var Du,Mu="itd__floatingLabel__01e577ff";Ad(".itd__defaultInput__01e577ff{height:100%}.itd__floatingInput__01e577ff{caret-color:rgba(0,0,0,.851);color:rgba(0,0,0,.851);font-size:13px}.itd__floatingInput__01e577ff::placeholder{color:#0000}.itd__floatingInput__01e577ff:disabled :not(.itd__floatingInput__01e577ff[data-locked=true]),.itd__floatingInput__01e577ff:disabled:not(.itd__floatingInput__01e577ff[data-locked=true]){opacity:.5}.itd__floatingLabel__01e577ff{display:block;font-size:16px;font-weight:500;max-height:0;pointer-events:none;position:relative}.itd__floatingLabel__01e577ff:before{-webkit-backface-visibility:hidden;backface-visibility:hidden;color:#0009;content:attr(data-content);display:inline-block;filter:blur(0);position:relative;transform-origin:left top;transition:transform .2s ease-out}.itd__floatingInput__01e577ff:placeholder-shown+.itd__floatingLabel__01e577ff:before{font-smooth:always;-webkit-font-smoothing:antialiased;transform:translate3d(0,-32px,0) scale3d(.8,.8,1)}.itd__floatingInput__01e577ff:focus+.itd__floatingLabel__01e577ff:before,.itd__floatingLabel__01e577ff:before{transform:translate3d(0,-40px,0) scale3d(.8,.8,1)}.itd__floatingInput__01e577ff:focus+.itd__floatingLabel__01e577ff:before{color:#0009}.itd__floatingInputinput__01e577ff:-webkit-autofill,.itd__floatingInputinput__01e577ff:-webkit-autofill:focus,.itd__floatingInputinput__01e577ff:-webkit-autofill:hover{-webkit-text-fill-color:#3496fa!important;-webkit-box-shadow:inset 0 0 0 30px #151d3d!important}",{}),function(e){e.TEXT="text",e.NUMBER="number",e.CURRENCY="currency",e.PASSWORD="password"}(Du||(Du={}));let Tu=!1,Ou=!1;const Iu=n.forwardRef(({id:e,placeholder:t="",value:o="",defaultValue:i="",type:a=Du.TEXT,className:s="",size:l=exports.ComponentSizes.DEFAULT,variant:d="default",prefix:c=null,suffix:u=null,addonBefore:p=null,addonAfter:f=null,status:h=null,locked:g=null,minValue:m=0,maxValue:b=-1,maxLength:x=-1,disabled:v=!1,floating:y=!1,autoComplete:A=!1,keepFocus:w=!1,focusRef:k=null,mask:S=null,allowEmptyFormatting:_=!1,allowLeadingZeros:E=!1,decimalSeparator:C=".",thousandSeparator:F=",",decimalScale:j=2,onChange:$=null,onUpdate:z=null,onFocus:L=null,onBlur:N=null,onPressEnter:D=null,onKeyDown:M=null,children:T=null},O)=>{const I=n.useRef(null),R=n.useMemo(()=>e||"itd-input-"+pe(),[e]),[P,V]=n.useState(a===Du.NUMBER?0:""),[B,H]=n.useState(""),[U,G]=n.useState(!1),[Y,W]=n.useState(!1),[q,X]=n.useState(!1),[K,J]=n.useState(!1),[Z,Q]=n.useState(!0);n.useEffect(()=>{(()=>{if(Tu)return;Tu=!0,document.addEventListener("keydown",e=>{e&&"Tab"===e.key&&(Ou=!0)});const e=()=>{Ou=!1};document.addEventListener("mousedown",e,{passive:!0}),document.addEventListener("pointerdown",e,{passive:!0}),document.addEventListener("touchstart",e,{passive:!0})})(),
|
|
3519
|
+
`;var Du,Mu="itd__floatingLabel__01e577ff";Ad(".itd__defaultInput__01e577ff{height:100%}.itd__floatingInput__01e577ff{caret-color:rgba(0,0,0,.851);color:rgba(0,0,0,.851);font-size:13px}.itd__floatingInput__01e577ff::placeholder{color:#0000}.itd__floatingInput__01e577ff:disabled :not(.itd__floatingInput__01e577ff[data-locked=true]),.itd__floatingInput__01e577ff:disabled:not(.itd__floatingInput__01e577ff[data-locked=true]){opacity:.5}.itd__floatingLabel__01e577ff{display:block;font-size:16px;font-weight:500;max-height:0;pointer-events:none;position:relative}.itd__floatingLabel__01e577ff:before{-webkit-backface-visibility:hidden;backface-visibility:hidden;color:#0009;content:attr(data-content);display:inline-block;filter:blur(0);position:relative;transform-origin:left top;transition:transform .2s ease-out}.itd__floatingInput__01e577ff:placeholder-shown+.itd__floatingLabel__01e577ff:before{font-smooth:always;-webkit-font-smoothing:antialiased;transform:translate3d(0,-32px,0) scale3d(.8,.8,1)}.itd__floatingInput__01e577ff:focus+.itd__floatingLabel__01e577ff:before,.itd__floatingLabel__01e577ff:before{transform:translate3d(0,-40px,0) scale3d(.8,.8,1)}.itd__floatingInput__01e577ff:focus+.itd__floatingLabel__01e577ff:before{color:#0009}.itd__floatingInputinput__01e577ff:-webkit-autofill,.itd__floatingInputinput__01e577ff:-webkit-autofill:focus,.itd__floatingInputinput__01e577ff:-webkit-autofill:hover{-webkit-text-fill-color:#3496fa!important;-webkit-box-shadow:inset 0 0 0 30px #151d3d!important}",{}),function(e){e.TEXT="text",e.NUMBER="number",e.CURRENCY="currency",e.PASSWORD="password"}(Du||(Du={}));let Tu=!1,Ou=!1;const Iu=n.forwardRef(({id:e,placeholder:t="",value:o="",defaultValue:i="",type:a=Du.TEXT,className:s="",size:l=exports.ComponentSizes.DEFAULT,variant:d="default",prefix:c=null,suffix:u=null,addonBefore:p=null,addonAfter:f=null,status:h=null,locked:g=null,minValue:m=0,maxValue:b=-1,maxLength:x=-1,disabled:v=!1,floating:y=!1,autoComplete:A=!1,keepFocus:w=!1,focusRef:k=null,mask:S=null,allowEmptyFormatting:_=!1,allowLeadingZeros:E=!1,decimalSeparator:C=".",thousandSeparator:F=",",decimalScale:j=2,onChange:$=null,onUpdate:z=null,onFocus:L=null,onBlur:N=null,onPressEnter:D=null,onKeyDown:M=null,children:T=null},O)=>{const I=n.useRef(null),R=n.useMemo(()=>e||"itd-input-"+pe(),[e]),[P,V]=n.useState(a===Du.NUMBER?0:""),[B,H]=n.useState(""),[U,G]=n.useState(!1),[Y,W]=n.useState(!1),[q,X]=n.useState(!1),[K,J]=n.useState(!1),[Z,Q]=n.useState(!0),ee=()=>{!A&&Z&&Q(!1)},te=()=>{G(!1),ee()};n.useEffect(()=>{(()=>{if(Tu)return;Tu=!0,document.addEventListener("keydown",e=>{e&&"Tab"===e.key&&(Ou=!0)});const e=()=>{Ou=!1};document.addEventListener("mousedown",e,{passive:!0}),document.addEventListener("pointerdown",e,{passive:!0}),document.addEventListener("touchstart",e,{passive:!0})})(),re(),i&&ne(i)},[]),n.useEffect(()=>{if(!Y)return;const e=e=>{I.current&&!I.current.contains(e.target)&&(G(!1),W(!1),w&&k?.current&&X(k.current.contains(e.target)))},t=e=>{I.current&&I.current.contains(e.target)&&G(!1)};return document.addEventListener("mousedown",e),I.current?.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",e),I.current?.removeEventListener("mousedown",t)}},[Y,w,k]),n.useEffect(()=>{ne(a===Du.NUMBER?Number(o):String(o),!0,""!==o)},[o]);const re=()=>{I.current&&w&&I.current&&(I.current?.focus(),W(!0))},ne=(e,t=!0,r=!0)=>{V(e),z&&z(e,t,r)};n.useImperativeHandle(O,()=>({setFocus(){I.current&&(W(!0),I.current.focus()),X(!0)},reset(e=!0,t=!0){V(i||""),H(""),ne(a===Du.NUMBER?0:"",e,t)},setValue(e,t=!0,r=!0){V(e),ne(e,t,r)},getValue:()=>P,setError(e){H(e)},forceUpdate(){ne(P)},clear(){V("")},scrollIntoView(e){I.current?.scrollIntoView(e)}}));const oe=e=>{const t="string"==typeof e&&S&&e.replace(/\D+/g,"").length<S.replace(/\D+/g,"").length;ne(e,!0,!t),$&&$(e)},ie=e=>{oe(e.value)},ae=e=>{I.current?.focus(),W(!0),G(!0===Ou),!A&&Z&&Q(!1),L&&L(e)},se=e=>{W(!1),G(!1),A||Q(!0),w&&q&&I.current&&(W(!0),I.current.focus()),S&&"string"==typeof P&&P.replace(/\D+/g,"").length<S.replace(/\D+/g,"").length&&i&&ne(i,!0,!1),N?N(e):e.target.blur()},le=e=>{"Tab"===e.key&&G(!0),13===e.keyCode&&D&&D(e),M&&M(e)},de=()=>{let e={id:R,placeholder:t,value:P,type:a,spellCheck:"false",autoCorrect:"off",autoCapitalize:"none",className:y?Ae():ye(),onFocus:ae,onBlur:se,onKeyDown:le,disabled:v||g};return g&&(e["data-locked"]=!0),e=A?{...e,autoComplete:"on"}:{...e,autoComplete:"new-password",name:R,onMouseDown:te,onPointerDown:ee,onTouchStart:ee,readOnly:Z},S?(e={...e,format:S,mask:"_",allowEmptyFormatting:_,onChange:e=>oe(e.target.value)},r.jsx(bu,{...e,getInputRef:I})):a===Du.CURRENCY?(e={...e,maxLength:x,type:Du.TEXT,allowLeadingZeros:E,decimalSeparator:C,thousandSeparator:F,decimalScale:j,getInputRef:I,onValueChange:ie,onMouseDown:te,isAllowed:e=>{const{floatValue:t}=e;return t>=m&&(t<=b||-1===b)||void 0===t}},r.jsx(gu,{...e})):a===Du.NUMBER?(e={...e,type:Du.NUMBER,maxLength:x,onMouseDown:te,onChange:e=>{const t=Number(e.target.value.replace(/,/g,"."));t>=m&&-1===b||t>=m&&t<=b?oe(t):t<m?oe(m):t>b&&oe(b)},ref:I},r.jsx("input",{...e})):(e={...e,maxLength:x,onChange:e=>oe(e.target.value),onMouseDown:te,ref:I},r.jsx("input",{...e}))},ce=()=>{if(p)return r.jsx(Eu,{className:"itd-input-addon-before",children:p})},ue=()=>{if(f)return r.jsx(Cu,{className:"itd-input-addon-after",children:f})},fe=()=>{if(c)return r.jsx(wu,{className:"itd-input-prefix",children:c})},ge=()=>{if(u)return r.jsx(ku,{className:"itd-input-suffix",children:u})},me=()=>{if(g)return r.jsx(Su,{className:"itd-input-locked",children:"boolean"!=typeof g?g:r.jsx(Fu,{className:"itd-svg",width:"18",height:"18"})})},be=()=>{if(""!==B&&!v)return r.jsx($u,{className:"itd-error-border"})},xe=r.jsx("svg",{width:"20px",height:"20px",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:r.jsx("g",{id:"Error",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:r.jsxs("g",{id:"ErrorGroup",fillRule:"nonzero",children:[r.jsx("circle",{id:"ErrorBackground",fill:"#F8285A",cx:"10",cy:"10",r:"10"}),r.jsx("path",{d:"M10.0355339,8.6213203 L12.863961,5.79289322 C13.2544853,5.40236893 13.8876503,5.40236893 14.2781746,5.79289322 C14.6686989,6.18341751 14.6686989,6.81658249 14.2781746,7.20710678 L11.4497475,10.0355339 \n L14.2781746,12.863961 C14.6686989,13.2544853 14.6686989,13.8876503 14.2781746,14.2781746 C13.8876503,14.6686989 13.2544853,14.6686989 12.863961,14.2781746 L10.0355339,11.4497475 L7.20710678,14.2781746\n C6.81658249,14.6686989 6.18341751,14.6686989 5.79289322,14.2781746 C5.40236893,13.8876503 5.40236893,13.2544853 5.79289322,12.863961 L8.6213203,10.0355339 L5.79289322,7.20710678 C5.40236893,6.81658249\n 5.40236893,6.18341751 5.79289322,5.79289322 C6.18341751,5.40236893 6.81658249,5.40236893 7.20710678,5.79289322 L10.0355339,8.6213203 Z",id:"ErrorIcon",fill:"#FFFFFF"})]})})}),ve=()=>{if(""===B||v)return;let e={className:"itd-input-failed itd-failed-status",onPointerOver:()=>J(!0),onPointerOut:()=>J(!1)};return r.jsxs(Nu,{...e,children:[K?r.jsx(ju,{className:"itd-input-error-tooltip itd-error-tooltip",children:B}):null,h||xe]})},ye=()=>"itd-input-default-input",Ae=()=>"itd-input-floating-input",we=()=>{let e="itd-input itd-input-"+a;return e+=" itd-input-"+he(l),e+=" itd-input-"+d,S&&(e+=" itd-input-masked"),v&&(e+=" itd-input-disabled"),g&&(e+=" itd-input-locked"),""!==s&&(e+=" "+s),Y&&U&&(e+=" keyboard-focus"),Y&&(e+=" focused"),e};return(()=>{if(T)throw new Error("ITD Input Error: Remove the children!");return r.jsxs(xu,{className:we(),children:[ce(),r.jsxs(vu,{$hasPrefix:null!==c,$hasSuffix:null!==u,$hasError:""!==B&&!v,children:[fe(),r.jsxs(yu,{className:"itd-input-middle",children:[de(),y?r.jsx("label",{htmlFor:R,className:"itd-input-floating-label "+Mu+" "+t,"data-content":t,children:r.jsx(zu,{children:t})}):null,be()]}),r.jsxs(Au,{children:[ge(),me(),ve()]})]}),ue()]})})()});Iu.displayName="ITD-Input";const Ru=l.div`
|
|
3520
3520
|
|
|
3521
3521
|
border: 1px solid #d9d9d900;
|
|
3522
3522
|
border-radius: 6px;
|
package/dist/index.esm.js
CHANGED
|
@@ -3516,7 +3516,7 @@ import e from"i18next";import{useTranslation as t,initReactI18next as r}from"rea
|
|
|
3516
3516
|
background-color: #f8285a;
|
|
3517
3517
|
}
|
|
3518
3518
|
|
|
3519
|
-
`;var Gp,Yp="itd__floatingLabel__01e577ff";zc(".itd__defaultInput__01e577ff{height:100%}.itd__floatingInput__01e577ff{caret-color:rgba(0,0,0,.851);color:rgba(0,0,0,.851);font-size:13px}.itd__floatingInput__01e577ff::placeholder{color:#0000}.itd__floatingInput__01e577ff:disabled :not(.itd__floatingInput__01e577ff[data-locked=true]),.itd__floatingInput__01e577ff:disabled:not(.itd__floatingInput__01e577ff[data-locked=true]){opacity:.5}.itd__floatingLabel__01e577ff{display:block;font-size:16px;font-weight:500;max-height:0;pointer-events:none;position:relative}.itd__floatingLabel__01e577ff:before{-webkit-backface-visibility:hidden;backface-visibility:hidden;color:#0009;content:attr(data-content);display:inline-block;filter:blur(0);position:relative;transform-origin:left top;transition:transform .2s ease-out}.itd__floatingInput__01e577ff:placeholder-shown+.itd__floatingLabel__01e577ff:before{font-smooth:always;-webkit-font-smoothing:antialiased;transform:translate3d(0,-32px,0) scale3d(.8,.8,1)}.itd__floatingInput__01e577ff:focus+.itd__floatingLabel__01e577ff:before,.itd__floatingLabel__01e577ff:before{transform:translate3d(0,-40px,0) scale3d(.8,.8,1)}.itd__floatingInput__01e577ff:focus+.itd__floatingLabel__01e577ff:before{color:#0009}.itd__floatingInputinput__01e577ff:-webkit-autofill,.itd__floatingInputinput__01e577ff:-webkit-autofill:focus,.itd__floatingInputinput__01e577ff:-webkit-autofill:hover{-webkit-text-fill-color:#3496fa!important;-webkit-box-shadow:inset 0 0 0 30px #151d3d!important}",{}),function(e){e.TEXT="text",e.NUMBER="number",e.CURRENCY="currency",e.PASSWORD="password"}(Gp||(Gp={}));let Wp=!1,qp=!1;const Xp=x(({id:e,placeholder:t="",value:r="",defaultValue:i="",type:a=Gp.TEXT,className:l="",size:u=W.DEFAULT,variant:f="default",prefix:h=null,suffix:g=null,addonBefore:m=null,addonAfter:b=null,status:v=null,locked:x=null,minValue:A=0,maxValue:w=-1,maxLength:k=-1,disabled:_=!1,floating:S=!1,autoComplete:E=!1,keepFocus:C=!1,focusRef:$=null,mask:L=null,allowEmptyFormatting:F=!1,allowLeadingZeros:N=!1,decimalSeparator:z=".",thousandSeparator:D=",",decimalScale:M=2,onChange:T=null,onUpdate:O=null,onFocus:I=null,onBlur:R=null,onPressEnter:P=null,onKeyDown:B=null,children:V=null},j)=>{const H=c(null),U=p(()=>e||"itd-input-"+qe(),[e]),[G,Y]=s(a===Gp.NUMBER?0:""),[q,X]=s(""),[K,J]=s(!1),[Z,Q]=s(!1),[ee,te]=s(!1),[re,ne]=s(!1),[ie,oe]=s(!0);d(()=>{(()=>{if(Wp)return;Wp=!0,document.addEventListener("keydown",e=>{e&&"Tab"===e.key&&(qp=!0)});const e=()=>{qp=!1};document.addEventListener("mousedown",e,{passive:!0}),document.addEventListener("pointerdown",e,{passive:!0}),document.addEventListener("touchstart",e,{passive:!0})})(),
|
|
3519
|
+
`;var Gp,Yp="itd__floatingLabel__01e577ff";zc(".itd__defaultInput__01e577ff{height:100%}.itd__floatingInput__01e577ff{caret-color:rgba(0,0,0,.851);color:rgba(0,0,0,.851);font-size:13px}.itd__floatingInput__01e577ff::placeholder{color:#0000}.itd__floatingInput__01e577ff:disabled :not(.itd__floatingInput__01e577ff[data-locked=true]),.itd__floatingInput__01e577ff:disabled:not(.itd__floatingInput__01e577ff[data-locked=true]){opacity:.5}.itd__floatingLabel__01e577ff{display:block;font-size:16px;font-weight:500;max-height:0;pointer-events:none;position:relative}.itd__floatingLabel__01e577ff:before{-webkit-backface-visibility:hidden;backface-visibility:hidden;color:#0009;content:attr(data-content);display:inline-block;filter:blur(0);position:relative;transform-origin:left top;transition:transform .2s ease-out}.itd__floatingInput__01e577ff:placeholder-shown+.itd__floatingLabel__01e577ff:before{font-smooth:always;-webkit-font-smoothing:antialiased;transform:translate3d(0,-32px,0) scale3d(.8,.8,1)}.itd__floatingInput__01e577ff:focus+.itd__floatingLabel__01e577ff:before,.itd__floatingLabel__01e577ff:before{transform:translate3d(0,-40px,0) scale3d(.8,.8,1)}.itd__floatingInput__01e577ff:focus+.itd__floatingLabel__01e577ff:before{color:#0009}.itd__floatingInputinput__01e577ff:-webkit-autofill,.itd__floatingInputinput__01e577ff:-webkit-autofill:focus,.itd__floatingInputinput__01e577ff:-webkit-autofill:hover{-webkit-text-fill-color:#3496fa!important;-webkit-box-shadow:inset 0 0 0 30px #151d3d!important}",{}),function(e){e.TEXT="text",e.NUMBER="number",e.CURRENCY="currency",e.PASSWORD="password"}(Gp||(Gp={}));let Wp=!1,qp=!1;const Xp=x(({id:e,placeholder:t="",value:r="",defaultValue:i="",type:a=Gp.TEXT,className:l="",size:u=W.DEFAULT,variant:f="default",prefix:h=null,suffix:g=null,addonBefore:m=null,addonAfter:b=null,status:v=null,locked:x=null,minValue:A=0,maxValue:w=-1,maxLength:k=-1,disabled:_=!1,floating:S=!1,autoComplete:E=!1,keepFocus:C=!1,focusRef:$=null,mask:L=null,allowEmptyFormatting:F=!1,allowLeadingZeros:N=!1,decimalSeparator:z=".",thousandSeparator:D=",",decimalScale:M=2,onChange:T=null,onUpdate:O=null,onFocus:I=null,onBlur:R=null,onPressEnter:P=null,onKeyDown:B=null,children:V=null},j)=>{const H=c(null),U=p(()=>e||"itd-input-"+qe(),[e]),[G,Y]=s(a===Gp.NUMBER?0:""),[q,X]=s(""),[K,J]=s(!1),[Z,Q]=s(!1),[ee,te]=s(!1),[re,ne]=s(!1),[ie,oe]=s(!0),ae=()=>{!E&&ie&&oe(!1)},le=()=>{J(!1),ae()};d(()=>{(()=>{if(Wp)return;Wp=!0,document.addEventListener("keydown",e=>{e&&"Tab"===e.key&&(qp=!0)});const e=()=>{qp=!1};document.addEventListener("mousedown",e,{passive:!0}),document.addEventListener("pointerdown",e,{passive:!0}),document.addEventListener("touchstart",e,{passive:!0})})(),se(),i&&de(i)},[]),d(()=>{if(!Z)return;const e=e=>{H.current&&!H.current.contains(e.target)&&(J(!1),Q(!1),C&&$?.current&&te($.current.contains(e.target)))},t=e=>{H.current&&H.current.contains(e.target)&&J(!1)};return document.addEventListener("mousedown",e),H.current?.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",e),H.current?.removeEventListener("mousedown",t)}},[Z,C,$]),d(()=>{de(a===Gp.NUMBER?Number(r):String(r),!0,""!==r)},[r]);const se=()=>{H.current&&C&&H.current&&(H.current?.focus(),Q(!0))},de=(e,t=!0,r=!0)=>{Y(e),O&&O(e,t,r)};y(j,()=>({setFocus(){H.current&&(Q(!0),H.current.focus()),te(!0)},reset(e=!0,t=!0){Y(i||""),X(""),de(a===Gp.NUMBER?0:"",e,t)},setValue(e,t=!0,r=!0){Y(e),de(e,t,r)},getValue:()=>G,setError(e){X(e)},forceUpdate(){de(G)},clear(){Y("")},scrollIntoView(e){H.current?.scrollIntoView(e)}}));const ce=e=>{const t="string"==typeof e&&L&&e.replace(/\D+/g,"").length<L.replace(/\D+/g,"").length;de(e,!0,!t),T&&T(e)},ue=e=>{ce(e.value)},pe=e=>{H.current?.focus(),Q(!0),J(!0===qp),!E&&ie&&oe(!1),I&&I(e)},fe=e=>{Q(!1),J(!1),E||oe(!0),C&&ee&&H.current&&(Q(!0),H.current.focus()),L&&"string"==typeof G&&G.replace(/\D+/g,"").length<L.replace(/\D+/g,"").length&&i&&de(i,!0,!1),R?R(e):e.target.blur()},he=e=>{"Tab"===e.key&&J(!0),13===e.keyCode&&P&&P(e),B&&B(e)},ge=()=>{let e={id:U,placeholder:t,value:G,type:a,spellCheck:"false",autoCorrect:"off",autoCapitalize:"none",className:S?Se():_e(),onFocus:pe,onBlur:fe,onKeyDown:he,disabled:_||x};return x&&(e["data-locked"]=!0),e=E?{...e,autoComplete:"on"}:{...e,autoComplete:"new-password",name:U,onMouseDown:le,onPointerDown:ae,onTouchStart:ae,readOnly:ie},L?(e={...e,format:L,mask:"_",allowEmptyFormatting:F,onChange:e=>ce(e.target.value)},n($p,{...e,getInputRef:H})):a===Gp.CURRENCY?(e={...e,maxLength:k,type:Gp.TEXT,allowLeadingZeros:N,decimalSeparator:z,thousandSeparator:D,decimalScale:M,getInputRef:H,onValueChange:ue,onMouseDown:le,isAllowed:e=>{const{floatValue:t}=e;return t>=A&&(t<=w||-1===w)||void 0===t}},n(Ep,{...e})):a===Gp.NUMBER?(e={...e,type:Gp.NUMBER,maxLength:k,onMouseDown:le,onChange:e=>{const t=Number(e.target.value.replace(/,/g,"."));t>=A&&-1===w||t>=A&&t<=w?ce(t):t<A?ce(A):t>w&&ce(w)},ref:H},n("input",{...e})):(e={...e,maxLength:k,onChange:e=>ce(e.target.value),onMouseDown:le,ref:H},n("input",{...e}))},me=()=>{if(m)return n(Ip,{className:"itd-input-addon-before",children:m})},be=()=>{if(b)return n(Rp,{className:"itd-input-addon-after",children:b})},ve=()=>{if(h)return n(Dp,{className:"itd-input-prefix",children:h})},xe=()=>{if(g)return n(Mp,{className:"itd-input-suffix",children:g})},ye=()=>{if(x)return n(Tp,{className:"itd-input-locked",children:"boolean"!=typeof x?x:n(Pp,{className:"itd-svg",width:"18",height:"18"})})},Ae=()=>{if(""!==q&&!_)return n(Vp,{className:"itd-error-border"})},we=n("svg",{width:"20px",height:"20px",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:n("g",{id:"Error",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:o("g",{id:"ErrorGroup",fillRule:"nonzero",children:[n("circle",{id:"ErrorBackground",fill:"#F8285A",cx:"10",cy:"10",r:"10"}),n("path",{d:"M10.0355339,8.6213203 L12.863961,5.79289322 C13.2544853,5.40236893 13.8876503,5.40236893 14.2781746,5.79289322 C14.6686989,6.18341751 14.6686989,6.81658249 14.2781746,7.20710678 L11.4497475,10.0355339 \n L14.2781746,12.863961 C14.6686989,13.2544853 14.6686989,13.8876503 14.2781746,14.2781746 C13.8876503,14.6686989 13.2544853,14.6686989 12.863961,14.2781746 L10.0355339,11.4497475 L7.20710678,14.2781746\n C6.81658249,14.6686989 6.18341751,14.6686989 5.79289322,14.2781746 C5.40236893,13.8876503 5.40236893,13.2544853 5.79289322,12.863961 L8.6213203,10.0355339 L5.79289322,7.20710678 C5.40236893,6.81658249\n 5.40236893,6.18341751 5.79289322,5.79289322 C6.18341751,5.40236893 6.81658249,5.40236893 7.20710678,5.79289322 L10.0355339,8.6213203 Z",id:"ErrorIcon",fill:"#FFFFFF"})]})})}),ke=()=>{if(""===q||_)return;return o(Up,{...{className:"itd-input-failed itd-failed-status",onPointerOver:()=>ne(!0),onPointerOut:()=>ne(!1)},children:[re?n(Bp,{className:"itd-input-error-tooltip itd-error-tooltip",children:q}):null,v||we]})},_e=()=>"itd-input-default-input",Se=()=>"itd-input-floating-input",Ee=()=>{let e="itd-input itd-input-"+a;return e+=" itd-input-"+Ke(u),e+=" itd-input-"+f,L&&(e+=" itd-input-masked"),_&&(e+=" itd-input-disabled"),x&&(e+=" itd-input-locked"),""!==l&&(e+=" "+l),Z&&K&&(e+=" keyboard-focus"),Z&&(e+=" focused"),e};return(()=>{if(V)throw new Error("ITD Input Error: Remove the children!");return o(Lp,{className:Ee(),children:[me(),o(Fp,{$hasPrefix:null!==h,$hasSuffix:null!==g,$hasError:""!==q&&!_,children:[ve(),o(Np,{className:"itd-input-middle",children:[ge(),S?n("label",{htmlFor:U,className:"itd-input-floating-label "+Yp+" "+t,"data-content":t,children:n(jp,{children:t})}):null,Ae()]}),o(zp,{children:[xe(),ye(),ke()]})]}),be()]})})()});Xp.displayName="ITD-Input";const Kp=M.div`
|
|
3520
3520
|
|
|
3521
3521
|
border: 1px solid #d9d9d900;
|
|
3522
3522
|
border-radius: 6px;
|