@inntechcorp/it-design 2.1.1 → 2.1.2
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 +66 -66
- package/dist/index.esm.js +2 -2
- package/dist/utils/GetSizeBySizeSlug.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -4301,7 +4301,7 @@ function Of(e,t){if(yf(e))for(let o=0;o<e.length&&!1!==t(e[o],o,e);o++);else e&&
|
|
|
4301
4301
|
background-color: #f8285a;
|
|
4302
4302
|
}
|
|
4303
4303
|
|
|
4304
|
-
`;var Km=[],Qm=[];function Jm(e,t){if(e&&"undefined"!=typeof document){var o,p=!0===t.prepend?"prepend":"append",b=!0===t.singleTag,n="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(b){var M=Km.indexOf(n);-1===M&&(M=Km.push(n)-1,Qm[M]={}),o=Qm[M]&&Qm[M][p]?Qm[M][p]:Qm[M][p]=r()}else o=r();65279===e.charCodeAt(0)&&(e=e.substring(1)),o.styleSheet?o.styleSheet.cssText+=e:o.appendChild(document.createTextNode(e))}function r(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var o=Object.keys(t.attributes),b=0;b<o.length;b++)e.setAttribute(o[b],t.attributes[o[b]]);var M="prepend"===p?"afterbegin":"beforeend";return n.insertAdjacentElement(M,e),e}}var Zm,eR="itd__floatingLabel__01e577ff";Jm(".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"}(Zm||(Zm={}));const tR=u((({id:t="",placeholder:p="",value:b="",defaultValue:n="",type:M=Zm.TEXT,className:i="",size:a="default",variant:O="default",prefix:s=null,suffix:A=null,addonBefore:d=null,addonAfter:l=null,status:u=null,locked:f=null,minValue:h=0,maxValue:W=1e8,maxLength:g=-1,disabled:m=!1,floating:R=!1,autoComplete:v=!1,keepFocus:L=!1,focusRef:y=null,mask:N=null,allowEmptyFormatting:B=!1,allowLeadingZeros:w=!1,decimalSeparator:x=".",thousandSeparator:X=",",decimalScale:k=2,onChange:S=null,onUpdate:T=null,onFocus:E=null,onBlur:_=null,onPressEnter:C=null,onKeyDown:P=null,children:D=null},I)=>{const F=c(null),[j,$]=r(M===Zm.NUMBER?0:""),[U,V]=r(""),[H,Y]=r(!1),[G,K]=r(!1),[Q,J]=r(!1),[Z,ee]=r(!1),[te,oe]=r(!1),[pe,be]=r(!0),[ne,Me]=r(t);z((()=>(""===t&&Me("itd-input-"+Ha()),ze(),n&&ie(n),document.addEventListener("pointerdown",ce,!1),document.addEventListener("mousedown",(()=>{Y(!0)})),document.addEventListener("mouseup",(()=>{Y(!1)})),()=>{y&&re(!1),document.removeEventListener("pointerdown",ce,!1),document.removeEventListener("mousedown",(()=>{Y(!0)})),document.removeEventListener("mouseup",(()=>{Y(!1)}))})),[]),z((()=>{ie(M===Zm.NUMBER?Number(b):String(b),!0,""!==b)}),[b]);const re=e=>{document[e?"addEventListener":"removeEventListener"]("pointerdown",ce,!1)},ce=e=>{K(!1),y?.current&&ee(y.current.contains(e.target))},ze=()=>{F.current&&L&&F.current&&(F.current?.focus(),J(!0),y&&re(!0))},ie=(e,t=!0,o=!0)=>{$(e),T&&T(e,t,o)};q(I,(()=>({setFocus(){F.current&&(J(!0),F.current.focus()),ee(!0)},reset(e=!0,t=!0){$(n||""),V(""),ie(M===Zm.NUMBER?0:"",e,t)},setValue(e,t=!0,o=!0){$(e),ie(e,t,o)},getValue:()=>j,setError(e){V(e)},forceUpdate(){ie(j)},clear(){$("")}})));const ae=e=>{const t="string"==typeof e&&N&&e.replace(/\D+/g,"").length<N.replace(/\D+/g,"").length;ie(e,!0,!t),S&&S(e)},Oe=e=>{ae(e.value)},se=e=>{F.current?.focus(),H||K(!0),J(!0),!v&&pe&&be(!1),E&&E(e)},Ae=e=>{J(!1),L&&Z&&F.current&&(J(!0),F.current.focus()),N&&"string"==typeof j&&j.replace(/\D+/g,"").length<N.replace(/\D+/g,"").length&&n&&ie(n,!0,!1),_?_(e):e.target.blur()},de=e=>{J(!1),"Tab"===e.key&&K(!1),13===e.keyCode&&C&&C(e),P&&P(e)},le=()=>{let t={id:ne,placeholder:p,value:j,type:M,className:R?Le():ve(),onFocus:se,onBlur:Ae,onKeyDown:de,disabled:m||f};return f&&(t["data-locked"]=!0),t=v?{...t,autoComplete:ne}:{...t},N?(t={...t,format:N,mask:"_",allowEmptyFormatting:B,onChange:e=>ae(e.target.value)},e(km,{...t})):M===Zm.CURRENCY?(t={...t,maxLength:g,type:Zm.TEXT,allowLeadingZeros:w,decimalSeparator:x,thousandSeparator:X,decimalScale:k,getInputRef:F,onValueChange:Oe},e(xm,{...t})):M===Zm.NUMBER?(t={...t,type:Zm.NUMBER,maxLength:g,onChange:e=>{const t=Number(e.target.value.replace(/,/g,"."));t>=h&&t<=W?ae(t):t<h?ae(h):t>W&&ae(W)},ref:F},e("input",{...t})):(t={...t,maxLength:g,onChange:e=>ae(e.target.value),ref:F},e("input",{...t}))},ue=()=>{if(d)return e(Fm,{className:"itd-input-addon-before",children:d})},fe=()=>{if(l)return e(jm,{className:"itd-input-addon-after",children:l})},qe=()=>{if(s)return e(Cm,{className:"itd-input-prefix",children:s})},he=()=>{if(A)return e(Pm,{className:"itd-input-suffix",children:A})},We=()=>{if(f)return e(Dm,{className:"itd-input-locked",children:"boolean"!=typeof f?f:e($m,{className:"itd-svg",width:"18",height:"18"})})},ge=()=>{if(""!==U&&!m)return e(Vm,{className:"itd-error-border"})},me=e("svg",{width:"20px",height:"20px",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:e("g",{id:"Error",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:o("g",{id:"ErrorGroup",fillRule:"nonzero",children:[e("circle",{id:"ErrorBackground",fill:"#F8285A",cx:"10",cy:"10",r:"10"}),e("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"})]})})}),Re=()=>{if(""===U||m)return;return o(Gm,{...{className:"itd-input-failed itd-failed-status",onPointerOver:()=>oe(!0),onPointerOut:()=>oe(!1)},children:[te?e(Um,{className:"itd-input-error-tooltip itd-error-tooltip",children:U}):null,u||me]})},ve=()=>"itd-input-default-input",Le=()=>"itd-input-floating-input",ye=()=>{let e="itd-input itd-input-"+M;return e+=" itd-input-"+Da(a),e+=" itd-input-"+O,N&&(e+=" itd-input-masked"),m&&(e+=" itd-input-disabled"),f&&(e+=" itd-input-locked"),""!==i&&(e+=" "+i),G&&(e+=" keyboard-focus"),Q&&(e+=" focused"),e};return(()=>{if(D)throw new Error("ITD Input Error: Remove the children!");return o(Sm,{className:ye(),children:[ue(),o(Tm,{$hasPrefix:null!==s,$hasSuffix:null!==A,$hasError:""!==U&&!m,children:[qe(),o(Em,{className:"itd-input-middle",children:[le(),R?e("label",{htmlFor:ne,className:"itd-input-floating-label "+eR+" "+p,"data-content":p,children:e(Hm,{children:p})}):null,ge()]}),o(_m,{children:[he(),We(),Re()]})]}),fe()]})})()}));tR.displayName="ITD-Input";const oR=ha.div`
|
|
4304
|
+
`;var Km=[],Qm=[];function Jm(e,t){if(e&&"undefined"!=typeof document){var o,p=!0===t.prepend?"prepend":"append",b=!0===t.singleTag,n="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(b){var M=Km.indexOf(n);-1===M&&(M=Km.push(n)-1,Qm[M]={}),o=Qm[M]&&Qm[M][p]?Qm[M][p]:Qm[M][p]=r()}else o=r();65279===e.charCodeAt(0)&&(e=e.substring(1)),o.styleSheet?o.styleSheet.cssText+=e:o.appendChild(document.createTextNode(e))}function r(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var o=Object.keys(t.attributes),b=0;b<o.length;b++)e.setAttribute(o[b],t.attributes[o[b]]);var M="prepend"===p?"afterbegin":"beforeend";return n.insertAdjacentElement(M,e),e}}var Zm,eR="itd__floatingLabel__01e577ff";Jm(".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"}(Zm||(Zm={}));const tR=u((({id:t="",placeholder:p="",value:b="",defaultValue:n="",type:M=Zm.TEXT,className:i="",size:a="default",variant:O="default",prefix:s=null,suffix:A=null,addonBefore:d=null,addonAfter:l=null,status:u=null,locked:f=null,minValue:h=0,maxValue:W=1e8,maxLength:g=-1,disabled:m=!1,floating:R=!1,autoComplete:v=!1,keepFocus:L=!1,focusRef:y=null,mask:N=null,allowEmptyFormatting:B=!1,allowLeadingZeros:w=!1,decimalSeparator:x=".",thousandSeparator:X=",",decimalScale:k=2,onChange:S=null,onUpdate:T=null,onFocus:E=null,onBlur:_=null,onPressEnter:C=null,onKeyDown:P=null,children:D=null},I)=>{const F=c(null),[j,$]=r(M===Zm.NUMBER?0:""),[U,V]=r(""),[H,Y]=r(!1),[G,K]=r(!1),[Q,J]=r(!1),[Z,ee]=r(!1),[te,oe]=r(!1),[pe,be]=r(!0),[ne,Me]=r(t);z((()=>(""===t&&Me("itd-input-"+Ha()),ze(),n&&ie(n),document.addEventListener("pointerdown",ce,!1),document.addEventListener("mousedown",(()=>{Y(!0)})),document.addEventListener("mouseup",(()=>{Y(!1)})),()=>{y&&re(!1),document.removeEventListener("pointerdown",ce,!1),document.removeEventListener("mousedown",(()=>{Y(!0)})),document.removeEventListener("mouseup",(()=>{Y(!1)}))})),[]),z((()=>{ie(M===Zm.NUMBER?Number(b):String(b),!0,""!==b)}),[b]);const re=e=>{document[e?"addEventListener":"removeEventListener"]("pointerdown",ce,!1)},ce=e=>{K(!1),y?.current&&ee(y.current.contains(e.target))},ze=()=>{F.current&&L&&F.current&&(F.current?.focus(),J(!0),y&&re(!0))},ie=(e,t=!0,o=!0)=>{$(e),T&&T(e,t,o)};q(I,(()=>({setFocus(){F.current&&(J(!0),F.current.focus()),ee(!0)},reset(e=!0,t=!0){$(n||""),V(""),ie(M===Zm.NUMBER?0:"",e,t)},setValue(e,t=!0,o=!0){$(e),ie(e,t,o)},getValue:()=>j,setError(e){V(e)},forceUpdate(){ie(j)},clear(){$("")}})));const ae=e=>{const t="string"==typeof e&&N&&e.replace(/\D+/g,"").length<N.replace(/\D+/g,"").length;ie(e,!0,!t),S&&S(e)},Oe=e=>{ae(e.value)},se=e=>{F.current?.focus(),H||K(!0),J(!0),!v&&pe&&be(!1),E&&E(e)},Ae=e=>{J(!1),L&&Z&&F.current&&(J(!0),F.current.focus()),N&&"string"==typeof j&&j.replace(/\D+/g,"").length<N.replace(/\D+/g,"").length&&n&&ie(n,!0,!1),_?_(e):e.target.blur()},de=e=>{J(!1),"Tab"===e.key&&K(!1),13===e.keyCode&&C&&C(e),P&&P(e)},le=()=>{let t={id:ne,placeholder:p,value:j,type:M,className:R?Le():ve(),onFocus:se,onBlur:Ae,onKeyDown:de,disabled:m||f};return f&&(t["data-locked"]=!0),t=v?{...t,autoComplete:ne}:{...t,autoComplete:"off"},N?(t={...t,format:N,mask:"_",allowEmptyFormatting:B,onChange:e=>ae(e.target.value)},e(km,{...t})):M===Zm.CURRENCY?(t={...t,maxLength:g,type:Zm.TEXT,allowLeadingZeros:w,decimalSeparator:x,thousandSeparator:X,decimalScale:k,getInputRef:F,onValueChange:Oe},e(xm,{...t})):M===Zm.NUMBER?(t={...t,type:Zm.NUMBER,maxLength:g,onChange:e=>{const t=Number(e.target.value.replace(/,/g,"."));t>=h&&t<=W?ae(t):t<h?ae(h):t>W&&ae(W)},ref:F},e("input",{...t})):(t={...t,maxLength:g,onChange:e=>ae(e.target.value),ref:F},e("input",{...t}))},ue=()=>{if(d)return e(Fm,{className:"itd-input-addon-before",children:d})},fe=()=>{if(l)return e(jm,{className:"itd-input-addon-after",children:l})},qe=()=>{if(s)return e(Cm,{className:"itd-input-prefix",children:s})},he=()=>{if(A)return e(Pm,{className:"itd-input-suffix",children:A})},We=()=>{if(f)return e(Dm,{className:"itd-input-locked",children:"boolean"!=typeof f?f:e($m,{className:"itd-svg",width:"18",height:"18"})})},ge=()=>{if(""!==U&&!m)return e(Vm,{className:"itd-error-border"})},me=e("svg",{width:"20px",height:"20px",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:e("g",{id:"Error",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:o("g",{id:"ErrorGroup",fillRule:"nonzero",children:[e("circle",{id:"ErrorBackground",fill:"#F8285A",cx:"10",cy:"10",r:"10"}),e("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"})]})})}),Re=()=>{if(""===U||m)return;return o(Gm,{...{className:"itd-input-failed itd-failed-status",onPointerOver:()=>oe(!0),onPointerOut:()=>oe(!1)},children:[te?e(Um,{className:"itd-input-error-tooltip itd-error-tooltip",children:U}):null,u||me]})},ve=()=>"itd-input-default-input",Le=()=>"itd-input-floating-input",ye=()=>{let e="itd-input itd-input-"+M;return e+=" itd-input-"+Da(a),e+=" itd-input-"+O,N&&(e+=" itd-input-masked"),m&&(e+=" itd-input-disabled"),f&&(e+=" itd-input-locked"),""!==i&&(e+=" "+i),G&&(e+=" keyboard-focus"),Q&&(e+=" focused"),e};return(()=>{if(D)throw new Error("ITD Input Error: Remove the children!");return o(Sm,{className:ye(),children:[ue(),o(Tm,{$hasPrefix:null!==s,$hasSuffix:null!==A,$hasError:""!==U&&!m,children:[qe(),o(Em,{className:"itd-input-middle",children:[le(),R?e("label",{htmlFor:ne,className:"itd-input-floating-label "+eR+" "+p,"data-content":p,children:e(Hm,{children:p})}):null,ge()]}),o(_m,{children:[he(),We(),Re()]})]}),fe()]})})()}));tR.displayName="ITD-Input";const oR=ha.div`
|
|
4305
4305
|
|
|
4306
4306
|
transition: background-color 0.2s ease;
|
|
4307
4307
|
border-radius: 6px;
|
|
@@ -4904,7 +4904,7 @@ function Of(e,t){if(yf(e))for(let o=0;o<e.length&&!1!==t(e[o],o,e);o++);else e&&
|
|
|
4904
4904
|
|
|
4905
4905
|
}
|
|
4906
4906
|
|
|
4907
|
-
`,mR=u((({id:t=
|
|
4907
|
+
`,mR=u((({id:t=Ha(),resultFileName:p=null,action:b="",filePath:n="",binaryName:M="file",showDeleteIcon:i=!1,showPreviewIcon:a=!1,buttonsPosition:O="default",padding:s=10,fluid:A=!0,fileWidth:d="100%",fileHeight:l="auto",maxFileWidth:u="none",maxFileHeight:f="none",containerWidth:h="100%",containerHeight:W="auto",previewFileWidth:g="100%",previewFileHeight:m="100%",previewFilePadding:R="0",requestMethod:v="put",maxFileSize:L=1024,disabled:y=!1,extraFormData:N={},extraQueryString:B={},extraHeader:w={},fileTypes:x=[Ot.JPG,Ot.PNG,Ot.SVG,Ot.PDF],removeAction:X="",removeExtraFormData:k={},removeExtraQueryString:S={},removeExtraHeader:T={},onUpdate:E,onUploadSuccess:_,onUploadFailed:C,onRemoveFileSuccess:P,onRemoveFileFailed:D},I)=>{const F=c(null),{addNotification:j}=tl.useNotifications(),{showModal:$}=uO.useModal(),{fetch:U,cancel:V}=Bc(),{t:H}=it(),[Y,G]=r(!1),[K,Q]=r(!1),[J,Z]=r(".svg, .png, .jpg"),[ee,te]=r(!1),[oe,pe]=r(!1),[be,ne]=r(!1),[Me,re]=r(null),[ce,ze]=r(null),[ie,ae]=r(""),[Oe,se]=r(!1),[Ae,de]=r(!1),[le,ue]=r(null),[fe,qe]=r(!1),[he,We]=r(null);z((()=>()=>{V()}),[]),z((()=>{Q(y)}),[y]),z((()=>{ze(n?n.split("?")[0]:"")}),[n]),z((()=>{null!==ce&&(void 0!==ce?Re():G(!1))}),[ce]),z((()=>{let e=[];x.map((t=>{e.push(Sl(t))})),Z(e.join(", "))}),[x]);const ge=(e,t)=>{j({title:e,description:t,placement:"topRight",autoHide:!0,delay:5e3,type:"error"})},me=(e,t=!0,o=!0)=>{E&&E(e,t,o)};q(I,(()=>({setFocus(){ne(!0)},reset(e=!1,t=!1){ve(),ze(null),ae(""),me("",e,t)},setValue(e,t=!0,o=!0){ze(e),me(e,t,o)},getValue:()=>ce||"",setError(e){ae(e)},forceUpdate(){me(ce||"")},clear(){ze("")}})));const Re=async()=>{let e=!1;ce&&(e=await xl(ce),re(e),e?me(ce):me("",!0,!0),Y||G(!0)),""!==ce||Y||G(!0),""===ce&&Y&&me("",!0,!0)},ve=()=>{We(null),ue(null),qe(!1),re(null)},Le=async()=>{Q(!0),$({content:e("div",{children:H("uploader.areYouSureToDeleteThisFile")}),title:H("uploader.removeFile"),okButtonText:H("uploader.yes"),cancelButtonText:H("uploader.no"),okButtonProps:{variant:"statable",state:"reject"},closeOnClickOutside:!1,showCloseButton:!1,onOk:()=>(X?U({action:X,params:k,queries:S,headers:T,onFetched:e=>{e.data.success?(ve(),me("",!0,!0),P&&P(e.data.data)):D&&D()},onError:()=>{D&&D()}}):(ve(),me("",!0,!0),P&&P()),Q(!1),!0),onCancel:()=>(Q(!1),!0)})},ye=e=>{e.preventDefault(),Ae||pe(!0)},Ne=e=>{e.preventDefault(),Ae||pe(!1)},Be=e=>{e.preventDefault(),Ae||(pe(!1),e.dataTransfer&&0!==e.dataTransfer.files.length?Xe(e.dataTransfer.files[0]):console.log(H("uploader.browserDoesntSupportDND")))},we=e=>{pe(!1);const t=e.target.files[0];Xe(t)},xe=async({path:e,errorMessage:t,errorCode:o})=>{await Tl(1e3),ue(null),de(!1),await Tl(1500),qe(!1),e?_&&_(e):t&&C&&C(t,o||0)},Xe=e=>{if(e&&(e=>!!x.includes(e.type)||(ge(H("uploader.error"),H("uploader.fileFormatError",{fileFormat:J})),!1))(e)&&(e=>!(e.size>1024*L&&(ge(H("uploader.error"),H("uploader.fileSizeError",{fileSize:kl(1024*L)})),1)))(e)){if(p){const t=Sl(e.type);e=new File([e],p+t,{type:t,lastModified:e.lastModified})}(async e=>{if(!e)return;let t=new FormData;t.append(M,e),p&&t.append("name",p),Object.keys(N).forEach((e=>{t.append(e,N[e])})),U({action:b,requestMethod:v,params:t,queries:B,headers:w,onFetched:e=>{e.data.success?(We({message:H("uploader.fileUploadSuccess"),status:"success"}),qe(!0),ze(e.data.data.url),xe({path:e.data.data.url})):(We({message:H("uploader.fileUploadFailed"),status:"error"}),me("",!0,!0),xe({errorMessage:H("uploader.fileUploadFailed")}))},onError:(e,t)=>{We({message:H("uploader.fileUploadFailed"),status:"error"}),me("",!0,!0),xe({errorMessage:e,errorCode:t})},onProgress:e=>{ue({estimated:e.estimated?(Math.round(100*e.estimated)/100).toFixed(2):"0",progress:e.progress?Math.round(100*e.progress):0,bytes:e.bytes?kl(e.bytes):"",total:e.total?kl(e.total):""})}})})(e),de(!0)}},ke=()=>{Q(!0),$({content:e(dR,{className:"itd-upload-preview-content",$width:g,$height:m,$padding:R,children:e(Zu,{src:ce||""})}),showOkButton:!1,showCancelButton:!1,contentPadding:"0px",width:"max-content",onCancel:()=>(Q(!1),!0)})},Se=()=>{if(i&&ce&&!Ae&&Me)return e("span",{className:"delete-icon",children:e(Ya,{variant:"solid",size:"small",type:"button",circle:!0,onClick:Le,disabled:K,icon:e(Wu,{width:16,height:16}),className:"itd-upload-delete-button"})})},Te=()=>{if(a&&ce&&!Ae&&Me)return e("span",{className:"preview-icon",children:e(Ya,{variant:"solid",size:"small",type:"button",circle:!0,onClick:ke,disabled:K,icon:e(gu,{width:16,height:16}),className:"itd-upload-preview-button"})})},Ee=e("svg",{width:"20px",height:"20px",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:e("g",{id:"Error",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:o("g",{id:"ErrorGroup",fillRule:"nonzero",children:[e("circle",{id:"ErrorBackground",fill:"#F8285A",cx:"10",cy:"10",r:"10"}),e("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"})]})})}),_e=()=>{if(""===ie||Ae)return;return o(WR,{...{className:"itd-upload-failed itd-failed-status",onPointerOver:()=>se(!0),onPointerOut:()=>se(!1)},children:[Oe?e(gR,{className:"itd-upload-error-tooltip itd-error-tooltip",children:ie}):null,Ee]})},Ce=()=>{if(Y)return null===Me?e(uu,{width:24,height:24}):!1===Me?e(Ru,{width:40,height:40}):e(Zu,{src:ce||"",width:pu(d),height:pu(l)})},Pe=()=>{let t=(ee||oe)&&!Ae&&!K;return e(uR,{onPointerOver:()=>{!oe&&te(!0)},onPointerOut:()=>{!oe&&te(!1)},onDragOver:ye,onDragLeave:Ne,onDrop:Be,$isHover:t,className:"itd-upload-overlay",children:o(lR,{$isHover:t,className:"itd-upload-overlay-content",children:[e("span",{className:"itd-upload-header",children:H("uploader.header")}),e("span",{className:"itd-upload-hint",children:H("uploader.hint")})]})})};return o(aR,{className:"itd-upload",$fluid:A,children:[e("input",{type:"file",id:t,accept:J,onChange:we,onFocus:()=>ne(!0),onBlur:()=>ne(!1),onClick:()=>{F.current?.blur()},disabled:Ae||K,ref:F}),e(sR,{htmlFor:t,$showFocus:be,className:"itd-upload-label",children:o(OR,{$showBorder:(oe||ee)&&!Ae,$padding:s,$disabled:y,$hasError:""!==ie&&!Ae,$fileWidth:d,$fileHeight:l,$maxFileWidth:u,$maxFileHeight:f,$containerWidth:h,$containerHeight:W,className:"itd-upload-content",children:[Ce(),o(fR,{className:"itd-upload-status",$isActive:Ae,$complete:"success"===he?.status,$error:"error"===he?.status,children:[e(qR,{className:"itd-upload-status-box",$progress:le?le.progress:0,$complete:"success"===he?.status,$error:"error"===he?.status}),e("span",{className:"itd-upload-status-message",children:H(fe||he?String(he?.message):"uploader.fileUploading")}),e("span",le?{className:"itd-upload-status-info",children:H("uploader.info",{total:le.total,estimated:le.estimated})}:{className:"itd-upload-status-calculating",children:H("uploader.calculating")})]}),Pe(),o(AR,{$position:""===ie?O:"default",children:[o(bL,{vertical:!0,gap:"small",className:"itd-upload-icons",children:[Se(),Te()]}),_e()]})]})})]})})),RR=ha(X)`
|
|
4908
4908
|
|
|
4909
4909
|
text-decoration: none;
|
|
4910
4910
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ITDSizeSlug } from "../index";
|
|
2
|
-
export default function GetSizeBySizeSlug(size: ITDSizeSlug): "
|
|
2
|
+
export default function GetSizeBySizeSlug(size: ITDSizeSlug): "large" | "small" | "x-small" | "medium" | "default" | "x-large" | "df";
|