@inntechcorp/it-design 2.1.85 → 2.1.87
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
|
@@ -4374,7 +4374,7 @@ function ga(e,b){if(Da(e))for(let o=0;o<e.length&&!1!==b(e[o],o,e);o++);else e&&
|
|
|
4374
4374
|
background-color: #f8285a;
|
|
4375
4375
|
}
|
|
4376
4376
|
|
|
4377
|
-
`;var Au=[],du=[];function lu(e,b){if(e&&"undefined"!=typeof document){var o,M=!0===b.prepend?"prepend":"append",p=!0===b.singleTag,z="string"==typeof b.container?document.querySelector(b.container):document.getElementsByTagName("head")[0];if(p){var t=Au.indexOf(z);-1===t&&(t=Au.push(z)-1,du[t]={}),o=du[t]&&du[t][M]?du[t][M]:du[t][M]=c()}else o=c();65279===e.charCodeAt(0)&&(e=e.substring(1)),o.styleSheet?o.styleSheet.cssText+=e:o.appendChild(document.createTextNode(e))}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),b.attributes)for(var o=Object.keys(b.attributes),p=0;p<o.length;p++)e.setAttribute(o[p],b.attributes[o[p]]);var t="prepend"===M?"afterbegin":"beforeend";return z.insertAdjacentElement(t,e),e}}var qu,uu="itd__floatingLabel__01e577ff";lu(".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{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"}(qu||(qu={}));const fu=M.forwardRef((({id:e="itd-input-"+Gt(),placeholder:b="",value:p="",defaultValue:z="",type:t=qu.TEXT,className:c="",size:n="default",variant:r="default",prefix:O=null,suffix:i=null,addonBefore:a=null,addonAfter:s=null,status:A=null,locked:d=null,minValue:l=0,maxValue:q=-1,maxLength:u=-1,disabled:f=!1,floating:W=!1,autoComplete:h=!1,keepFocus:m=!1,focusRef:R=null,mask:g=null,allowEmptyFormatting:L=!1,allowLeadingZeros:v=!1,decimalSeparator:N=".",thousandSeparator:y=",",decimalScale:x=2,onChange:B=null,onUpdate:w=null,onFocus:X=null,onBlur:S=null,onPressEnter:k=null,onKeyDown:T=null,children:E=null},_)=>{const C=M.useRef(null),[D,P]=M.useState(t===qu.NUMBER?0:""),[j,I]=M.useState(""),[F,$]=M.useState(!1),[V,U]=M.useState(!1),[H,Y]=M.useState(!1),[G,K]=M.useState(!1),[Q,J]=M.useState(!1),[Z,ee]=M.useState(!0);M.useEffect((()=>(Me(),z&&pe(z),document.addEventListener("pointerdown",oe,!1),document.addEventListener("mousedown",(()=>{$(!0)})),document.addEventListener("mouseup",(()=>{$(!1)})),()=>{R&&be(!1),document.removeEventListener("pointerdown",oe,!1),document.removeEventListener("mousedown",(()=>{$(!0)})),document.removeEventListener("mouseup",(()=>{$(!1)}))})),[]),M.useEffect((()=>{pe(t===qu.NUMBER?Number(p):String(p),!0,""!==p)}),[p]);const be=e=>{document[e?"addEventListener":"removeEventListener"]("pointerdown",oe,!1)},oe=e=>{U(!1),R?.current&&K(R.current.contains(e.target))},Me=()=>{C.current&&m&&C.current&&(C.current?.focus(),Y(!0),R&&be(!0))},pe=(e,b=!0,o=!0)=>{P(e),w&&w(e,b,o)};M.useImperativeHandle(_,(()=>({setFocus(){C.current&&(Y(!0),C.current.focus()),K(!0)},reset(e=!0,b=!0){P(z||""),I(""),pe(t===qu.NUMBER?0:"",e,b)},setValue(e,b=!0,o=!0){P(e),pe(e,b,o)},getValue:()=>D,setError(e){I(e)},forceUpdate(){pe(D)},clear(){P("")}})));const ze=e=>{const b="string"==typeof e&&g&&e.replace(/\D+/g,"").length<g.replace(/\D+/g,"").length;pe(e,!0,!b),B&&B(e)},te=e=>{ze(e.value)},ce=e=>{C.current?.focus(),F||U(!0),Y(!0),!h&&Z&&ee(!1),X&&X(e)},ne=e=>{Y(!1),m&&G&&C.current&&(Y(!0),C.current.focus()),g&&"string"==typeof D&&D.replace(/\D+/g,"").length<g.replace(/\D+/g,"").length&&z&&pe(z,!0,!1),S?S(e):e.target.blur()},re=e=>{Y(!1),"Tab"===e.key&&U(!1),13===e.keyCode&&k&&k(e),T&&T(e)},Oe=()=>{let M={id:e,placeholder:b,value:D,type:t,spellCheck
|
|
4377
|
+
`;var Au=[],du=[];function lu(e,b){if(e&&"undefined"!=typeof document){var o,M=!0===b.prepend?"prepend":"append",p=!0===b.singleTag,z="string"==typeof b.container?document.querySelector(b.container):document.getElementsByTagName("head")[0];if(p){var t=Au.indexOf(z);-1===t&&(t=Au.push(z)-1,du[t]={}),o=du[t]&&du[t][M]?du[t][M]:du[t][M]=c()}else o=c();65279===e.charCodeAt(0)&&(e=e.substring(1)),o.styleSheet?o.styleSheet.cssText+=e:o.appendChild(document.createTextNode(e))}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),b.attributes)for(var o=Object.keys(b.attributes),p=0;p<o.length;p++)e.setAttribute(o[p],b.attributes[o[p]]);var t="prepend"===M?"afterbegin":"beforeend";return z.insertAdjacentElement(t,e),e}}var qu,uu="itd__floatingLabel__01e577ff";lu(".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{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"}(qu||(qu={}));const fu=M.forwardRef((({id:e="itd-input-"+Gt(),placeholder:b="",value:p="",defaultValue:z="",type:t=qu.TEXT,className:c="",size:n="default",variant:r="default",prefix:O=null,suffix:i=null,addonBefore:a=null,addonAfter:s=null,status:A=null,locked:d=null,minValue:l=0,maxValue:q=-1,maxLength:u=-1,disabled:f=!1,floating:W=!1,autoComplete:h=!1,keepFocus:m=!1,focusRef:R=null,mask:g=null,allowEmptyFormatting:L=!1,allowLeadingZeros:v=!1,decimalSeparator:N=".",thousandSeparator:y=",",decimalScale:x=2,onChange:B=null,onUpdate:w=null,onFocus:X=null,onBlur:S=null,onPressEnter:k=null,onKeyDown:T=null,children:E=null},_)=>{const C=M.useRef(null),[D,P]=M.useState(t===qu.NUMBER?0:""),[j,I]=M.useState(""),[F,$]=M.useState(!1),[V,U]=M.useState(!1),[H,Y]=M.useState(!1),[G,K]=M.useState(!1),[Q,J]=M.useState(!1),[Z,ee]=M.useState(!0);M.useEffect((()=>(Me(),z&&pe(z),document.addEventListener("pointerdown",oe,!1),document.addEventListener("mousedown",(()=>{$(!0)})),document.addEventListener("mouseup",(()=>{$(!1)})),()=>{R&&be(!1),document.removeEventListener("pointerdown",oe,!1),document.removeEventListener("mousedown",(()=>{$(!0)})),document.removeEventListener("mouseup",(()=>{$(!1)}))})),[]),M.useEffect((()=>{pe(t===qu.NUMBER?Number(p):String(p),!0,""!==p)}),[p]);const be=e=>{document[e?"addEventListener":"removeEventListener"]("pointerdown",oe,!1)},oe=e=>{U(!1),R?.current&&K(R.current.contains(e.target))},Me=()=>{C.current&&m&&C.current&&(C.current?.focus(),Y(!0),R&&be(!0))},pe=(e,b=!0,o=!0)=>{P(e),w&&w(e,b,o)};M.useImperativeHandle(_,(()=>({setFocus(){C.current&&(Y(!0),C.current.focus()),K(!0)},reset(e=!0,b=!0){P(z||""),I(""),pe(t===qu.NUMBER?0:"",e,b)},setValue(e,b=!0,o=!0){P(e),pe(e,b,o)},getValue:()=>D,setError(e){I(e)},forceUpdate(){pe(D)},clear(){P("")}})));const ze=e=>{const b="string"==typeof e&&g&&e.replace(/\D+/g,"").length<g.replace(/\D+/g,"").length;pe(e,!0,!b),B&&B(e)},te=e=>{ze(e.value)},ce=e=>{C.current?.focus(),F||U(!0),Y(!0),!h&&Z&&ee(!1),X&&X(e)},ne=e=>{Y(!1),m&&G&&C.current&&(Y(!0),C.current.focus()),g&&"string"==typeof D&&D.replace(/\D+/g,"").length<g.replace(/\D+/g,"").length&&z&&pe(z,!0,!1),S?S(e):e.target.blur()},re=e=>{Y(!1),"Tab"===e.key&&U(!1),13===e.keyCode&&k&&k(e),T&&T(e)},Oe=()=>{let M={id:e,placeholder:b,value:D,type:t,spellCheck:"false",autocorrect:"off",autocapitalize:"none",className:W?We():fe(),onFocus:ce,onBlur:ne,onKeyDown:re,disabled:f||d};return d&&(M["data-locked"]=!0),M=h?{...M,autoComplete:"on"}:{...M,autoComplete:"off"},g?(M={...M,format:g,mask:"_",allowEmptyFormatting:L,onChange:e=>ze(e.target.value)},o.jsx(Qq,{...M})):t===qu.CURRENCY?(M={...M,maxLength:u,type:qu.TEXT,allowLeadingZeros:v,decimalSeparator:N,thousandSeparator:y,decimalScale:x,getInputRef:C,onValueChange:te,isAllowed:e=>{const{floatValue:b}=e;return b>=l&&(b<=q||-1===q)||void 0===b}},o.jsx(Gq,{...M})):t===qu.NUMBER?(M={...M,type:qu.NUMBER,maxLength:u,onChange:e=>{const b=Number(e.target.value.replace(/,/g,"."));b>=l&&-1===q||b>=l&&b<=q?ze(b):b<l?ze(l):b>q&&ze(q)},ref:C},o.jsx("input",{...M})):(M={...M,maxLength:u,onChange:e=>ze(e.target.value),ref:C},o.jsx("input",{...M}))},ie=()=>{if(a)return o.jsx(tu,{className:"itd-input-addon-before",children:a})},ae=()=>{if(s)return o.jsx(cu,{className:"itd-input-addon-after",children:s})},se=()=>{if(O)return o.jsx(ou,{className:"itd-input-prefix",children:O})},Ae=()=>{if(i)return o.jsx(Mu,{className:"itd-input-suffix",children:i})},de=()=>{if(d)return o.jsx(pu,{className:"itd-input-locked",children:"boolean"!=typeof d?d:o.jsx(nu,{className:"itd-svg",width:"18",height:"18"})})},le=()=>{if(""!==j&&!f)return o.jsx(Ou,{className:"itd-error-border"})},qe=o.jsx("svg",{width:"20px",height:"20px",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("g",{id:"Error",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:o.jsxs("g",{id:"ErrorGroup",fillRule:"nonzero",children:[o.jsx("circle",{id:"ErrorBackground",fill:"#F8285A",cx:"10",cy:"10",r:"10"}),o.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"})]})})}),ue=()=>{if(""===j||f)return;let e={className:"itd-input-failed itd-failed-status",onPointerOver:()=>J(!0),onPointerOut:()=>J(!1)};return o.jsxs(su,{...e,children:[Q?o.jsx(ru,{className:"itd-input-error-tooltip itd-error-tooltip",children:j}):null,A||qe]})},fe=()=>"itd-input-default-input",We=()=>"itd-input-floating-input",he=()=>{let e="itd-input itd-input-"+t;return e+=" itd-input-"+Ft(n),e+=" itd-input-"+r,g&&(e+=" itd-input-masked"),f&&(e+=" itd-input-disabled"),d&&(e+=" itd-input-locked"),""!==c&&(e+=" "+c),V&&(e+=" keyboard-focus"),H&&(e+=" focused"),e};return(()=>{if(E)throw new Error("ITD Input Error: Remove the children!");return o.jsxs(Jq,{className:he(),children:[ie(),o.jsxs(Zq,{$hasPrefix:null!==O,$hasSuffix:null!==i,$hasError:""!==j&&!f,children:[se(),o.jsxs(eu,{className:"itd-input-middle",children:[Oe(),W?o.jsx("label",{htmlFor:e,className:"itd-input-floating-label "+uu+" "+b,"data-content":b,children:o.jsx(iu,{children:b})}):null,le()]}),o.jsxs(bu,{children:[Ae(),de(),ue()]})]}),ae()]})})()}));fu.displayName="ITD-Input";const Wu=Rt.div`
|
|
4378
4378
|
|
|
4379
4379
|
border: 1px solid #d9d9d900;
|
|
4380
4380
|
border-radius: 6px;
|
package/dist/index.esm.js
CHANGED
|
@@ -4374,7 +4374,7 @@ function kA(e,b){if(YA(e))for(let M=0;M<e.length&&!1!==b(e[M],M,e);M++);else e&&
|
|
|
4374
4374
|
background-color: #f8285a;
|
|
4375
4375
|
}
|
|
4376
4376
|
|
|
4377
|
-
`;var gf=[],Lf=[];function vf(e,b){if(e&&"undefined"!=typeof document){var M,o=!0===b.prepend?"prepend":"append",p=!0===b.singleTag,z="string"==typeof b.container?document.querySelector(b.container):document.getElementsByTagName("head")[0];if(p){var t=gf.indexOf(z);-1===t&&(t=gf.push(z)-1,Lf[t]={}),M=Lf[t]&&Lf[t][o]?Lf[t][o]:Lf[t][o]=c()}else M=c();65279===e.charCodeAt(0)&&(e=e.substring(1)),M.styleSheet?M.styleSheet.cssText+=e:M.appendChild(document.createTextNode(e))}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),b.attributes)for(var M=Object.keys(b.attributes),p=0;p<M.length;p++)e.setAttribute(M[p],b.attributes[M[p]]);var t="prepend"===o?"afterbegin":"beforeend";return z.insertAdjacentElement(t,e),e}}var Nf,yf="itd__floatingLabel__01e577ff";vf(".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{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"}(Nf||(Nf={}));const Bf=W((({id:e="itd-input-"+xc(),placeholder:b="",value:M="",defaultValue:p="",type:t=Nf.TEXT,className:c="",size:i="default",variant:a="default",prefix:A=null,suffix:s=null,addonBefore:d=null,addonAfter:l=null,status:q=null,locked:u=null,minValue:f=0,maxValue:W=-1,maxLength:m=-1,disabled:R=!1,floating:g=!1,autoComplete:L=!1,keepFocus:v=!1,focusRef:N=null,mask:y=null,allowEmptyFormatting:B=!1,allowLeadingZeros:x=!1,decimalSeparator:w=".",thousandSeparator:X=",",decimalScale:k=2,onChange:T=null,onUpdate:S=null,onFocus:_=null,onBlur:E=null,onPressEnter:C=null,onKeyDown:D=null,children:P=null},I)=>{const F=r(null),[$,j]=n(t===Nf.NUMBER?0:""),[V,U]=n(""),[H,Y]=n(!1),[G,K]=n(!1),[Q,J]=n(!1),[Z,ee]=n(!1),[be,Me]=n(!1),[oe,pe]=n(!0);O((()=>(ce(),p&&ne(p),document.addEventListener("pointerdown",te,!1),document.addEventListener("mousedown",(()=>{Y(!0)})),document.addEventListener("mouseup",(()=>{Y(!1)})),()=>{N&&ze(!1),document.removeEventListener("pointerdown",te,!1),document.removeEventListener("mousedown",(()=>{Y(!0)})),document.removeEventListener("mouseup",(()=>{Y(!1)}))})),[]),O((()=>{ne(t===Nf.NUMBER?Number(M):String(M),!0,""!==M)}),[M]);const ze=e=>{document[e?"addEventListener":"removeEventListener"]("pointerdown",te,!1)},te=e=>{K(!1),N?.current&&ee(N.current.contains(e.target))},ce=()=>{F.current&&v&&F.current&&(F.current?.focus(),J(!0),N&&ze(!0))},ne=(e,b=!0,M=!0)=>{j(e),S&&S(e,b,M)};h(I,(()=>({setFocus(){F.current&&(J(!0),F.current.focus()),ee(!0)},reset(e=!0,b=!0){j(p||""),U(""),ne(t===Nf.NUMBER?0:"",e,b)},setValue(e,b=!0,M=!0){j(e),ne(e,b,M)},getValue:()=>$,setError(e){U(e)},forceUpdate(){ne($)},clear(){j("")}})));const Oe=e=>{const b="string"==typeof e&&y&&e.replace(/\D+/g,"").length<y.replace(/\D+/g,"").length;ne(e,!0,!b),T&&T(e)},re=e=>{Oe(e.value)},ie=e=>{F.current?.focus(),H||K(!0),J(!0),!L&&oe&&pe(!1),_&&_(e)},ae=e=>{J(!1),v&&Z&&F.current&&(J(!0),F.current.focus()),y&&"string"==typeof $&&$.replace(/\D+/g,"").length<y.replace(/\D+/g,"").length&&p&&ne(p,!0,!1),E?E(e):e.target.blur()},Ae=e=>{J(!1),"Tab"===e.key&&K(!1),13===e.keyCode&&C&&C(e),D&&D(e)},se=()=>{let M={id:e,placeholder:b,value:$,type:t,spellCheck
|
|
4377
|
+
`;var gf=[],Lf=[];function vf(e,b){if(e&&"undefined"!=typeof document){var M,o=!0===b.prepend?"prepend":"append",p=!0===b.singleTag,z="string"==typeof b.container?document.querySelector(b.container):document.getElementsByTagName("head")[0];if(p){var t=gf.indexOf(z);-1===t&&(t=gf.push(z)-1,Lf[t]={}),M=Lf[t]&&Lf[t][o]?Lf[t][o]:Lf[t][o]=c()}else M=c();65279===e.charCodeAt(0)&&(e=e.substring(1)),M.styleSheet?M.styleSheet.cssText+=e:M.appendChild(document.createTextNode(e))}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),b.attributes)for(var M=Object.keys(b.attributes),p=0;p<M.length;p++)e.setAttribute(M[p],b.attributes[M[p]]);var t="prepend"===o?"afterbegin":"beforeend";return z.insertAdjacentElement(t,e),e}}var Nf,yf="itd__floatingLabel__01e577ff";vf(".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{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"}(Nf||(Nf={}));const Bf=W((({id:e="itd-input-"+xc(),placeholder:b="",value:M="",defaultValue:p="",type:t=Nf.TEXT,className:c="",size:i="default",variant:a="default",prefix:A=null,suffix:s=null,addonBefore:d=null,addonAfter:l=null,status:q=null,locked:u=null,minValue:f=0,maxValue:W=-1,maxLength:m=-1,disabled:R=!1,floating:g=!1,autoComplete:L=!1,keepFocus:v=!1,focusRef:N=null,mask:y=null,allowEmptyFormatting:B=!1,allowLeadingZeros:x=!1,decimalSeparator:w=".",thousandSeparator:X=",",decimalScale:k=2,onChange:T=null,onUpdate:S=null,onFocus:_=null,onBlur:E=null,onPressEnter:C=null,onKeyDown:D=null,children:P=null},I)=>{const F=r(null),[$,j]=n(t===Nf.NUMBER?0:""),[V,U]=n(""),[H,Y]=n(!1),[G,K]=n(!1),[Q,J]=n(!1),[Z,ee]=n(!1),[be,Me]=n(!1),[oe,pe]=n(!0);O((()=>(ce(),p&&ne(p),document.addEventListener("pointerdown",te,!1),document.addEventListener("mousedown",(()=>{Y(!0)})),document.addEventListener("mouseup",(()=>{Y(!1)})),()=>{N&&ze(!1),document.removeEventListener("pointerdown",te,!1),document.removeEventListener("mousedown",(()=>{Y(!0)})),document.removeEventListener("mouseup",(()=>{Y(!1)}))})),[]),O((()=>{ne(t===Nf.NUMBER?Number(M):String(M),!0,""!==M)}),[M]);const ze=e=>{document[e?"addEventListener":"removeEventListener"]("pointerdown",te,!1)},te=e=>{K(!1),N?.current&&ee(N.current.contains(e.target))},ce=()=>{F.current&&v&&F.current&&(F.current?.focus(),J(!0),N&&ze(!0))},ne=(e,b=!0,M=!0)=>{j(e),S&&S(e,b,M)};h(I,(()=>({setFocus(){F.current&&(J(!0),F.current.focus()),ee(!0)},reset(e=!0,b=!0){j(p||""),U(""),ne(t===Nf.NUMBER?0:"",e,b)},setValue(e,b=!0,M=!0){j(e),ne(e,b,M)},getValue:()=>$,setError(e){U(e)},forceUpdate(){ne($)},clear(){j("")}})));const Oe=e=>{const b="string"==typeof e&&y&&e.replace(/\D+/g,"").length<y.replace(/\D+/g,"").length;ne(e,!0,!b),T&&T(e)},re=e=>{Oe(e.value)},ie=e=>{F.current?.focus(),H||K(!0),J(!0),!L&&oe&&pe(!1),_&&_(e)},ae=e=>{J(!1),v&&Z&&F.current&&(J(!0),F.current.focus()),y&&"string"==typeof $&&$.replace(/\D+/g,"").length<y.replace(/\D+/g,"").length&&p&&ne(p,!0,!1),E?E(e):e.target.blur()},Ae=e=>{J(!1),"Tab"===e.key&&K(!1),13===e.keyCode&&C&&C(e),D&&D(e)},se=()=>{let M={id:e,placeholder:b,value:$,type:t,spellCheck:"false",autocorrect:"off",autocapitalize:"none",className:g?ge():Re(),onFocus:ie,onBlur:ae,onKeyDown:Ae,disabled:R||u};return u&&(M["data-locked"]=!0),M=L?{...M,autoComplete:"on"}:{...M,autoComplete:"off"},y?(M={...M,format:y,mask:"_",allowEmptyFormatting:B,onChange:e=>Oe(e.target.value)},o(tf,{...M})):t===Nf.CURRENCY?(M={...M,maxLength:m,type:Nf.TEXT,allowLeadingZeros:x,decimalSeparator:w,thousandSeparator:X,decimalScale:k,getInputRef:F,onValueChange:re,isAllowed:e=>{const{floatValue:b}=e;return b>=f&&(b<=W||-1===W)||void 0===b}},o(pf,{...M})):t===Nf.NUMBER?(M={...M,type:Nf.NUMBER,maxLength:m,onChange:e=>{const b=Number(e.target.value.replace(/,/g,"."));b>=f&&-1===W||b>=f&&b<=W?Oe(b):b<f?Oe(f):b>W&&Oe(W)},ref:F},o("input",{...M})):(M={...M,maxLength:m,onChange:e=>Oe(e.target.value),ref:F},o("input",{...M}))},de=()=>{if(d)return o(lf,{className:"itd-input-addon-before",children:d})},le=()=>{if(l)return o(qf,{className:"itd-input-addon-after",children:l})},qe=()=>{if(A)return o(af,{className:"itd-input-prefix",children:A})},ue=()=>{if(s)return o(Af,{className:"itd-input-suffix",children:s})},fe=()=>{if(u)return o(sf,{className:"itd-input-locked",children:"boolean"!=typeof u?u:o(uf,{className:"itd-svg",width:"18",height:"18"})})},We=()=>{if(""!==V&&!R)return o(Wf,{className:"itd-error-border"})},he=o("svg",{width:"20px",height:"20px",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:o("g",{id:"Error",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:z("g",{id:"ErrorGroup",fillRule:"nonzero",children:[o("circle",{id:"ErrorBackground",fill:"#F8285A",cx:"10",cy:"10",r:"10"}),o("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"})]})})}),me=()=>{if(""===V||R)return;return z(Rf,{...{className:"itd-input-failed itd-failed-status",onPointerOver:()=>Me(!0),onPointerOut:()=>Me(!1)},children:[be?o(ff,{className:"itd-input-error-tooltip itd-error-tooltip",children:V}):null,q||he]})},Re=()=>"itd-input-default-input",ge=()=>"itd-input-floating-input",Le=()=>{let e="itd-input itd-input-"+t;return e+=" itd-input-"+gc(i),e+=" itd-input-"+a,y&&(e+=" itd-input-masked"),R&&(e+=" itd-input-disabled"),u&&(e+=" itd-input-locked"),""!==c&&(e+=" "+c),G&&(e+=" keyboard-focus"),Q&&(e+=" focused"),e};return(()=>{if(P)throw new Error("ITD Input Error: Remove the children!");return z(cf,{className:Le(),children:[de(),z(nf,{$hasPrefix:null!==A,$hasSuffix:null!==s,$hasError:""!==V&&!R,children:[qe(),z(Of,{className:"itd-input-middle",children:[se(),g?o("label",{htmlFor:e,className:"itd-input-floating-label "+yf+" "+b,"data-content":b,children:o(hf,{children:b})}):null,We()]}),z(rf,{children:[ue(),fe(),me()]})]}),le()]})})()}));Bf.displayName="ITD-Input";const xf=pc.div`
|
|
4378
4378
|
|
|
4379
4379
|
border: 1px solid #d9d9d900;
|
|
4380
4380
|
border-radius: 6px;
|