@inntechcorp/it-design 2.2.83 → 2.2.84

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.d.ts CHANGED
@@ -473,6 +473,7 @@ type FormContextType = {
473
473
  register: (item: FormItemProps) => void;
474
474
  unregister: (name: string) => void;
475
475
  hasField: (name: string) => boolean;
476
+ scrollTo: (name: string, options?: ScrollIntoViewOptions | boolean) => boolean;
476
477
  checkFormIsValid: () => boolean;
477
478
  getValues: () => {};
478
479
  getFieldValue: (name: string) => FormValueProps;
@@ -1080,6 +1081,7 @@ type ITDImperativeFuncProps = {
1080
1081
  setDisabled?: (value: boolean) => void;
1081
1082
  forceUpdate?: () => void;
1082
1083
  clear: () => void;
1084
+ scrollIntoView?: (options?: ScrollIntoViewOptions | boolean) => void;
1083
1085
  };
1084
1086
 
1085
1087
  type SingleQueryProps = {
package/dist/index.esm.js CHANGED
@@ -2382,7 +2382,7 @@ import e from"i18next";import{useTranslation as t,initReactI18next as r}from"rea
2382
2382
  margin-top: 10px;
2383
2383
  gap: 5px;
2384
2384
 
2385
- `;const Wc=new RegExp(/^[a-zA-Z0-9.!#$%&'+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/),qc=new RegExp(/^[a-zA-Z0-9_.-]+$/),Xc=new RegExp(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+={};:<>|./?,"'\[\]\\`~\-])[a-zA-Z\d$begin:math:display$$end:math:display$\\`~!@#$%^&*()_+={};:<>|.\/?,"'-]{8,60}$/),Kc=new RegExp(/^[a-z0-9._-]+$/),Jc=new RegExp(/^[a-zA-Z0-9]+$/),Zc=new RegExp(/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/);const Qc=e=>Xc.test(e),eu=e=>Wc.test(e),tu=e=>qc.test(e),ru=(e,t)=>e.length>=t,nu=(e,t)=>e.length<=t,iu=(e,t)=>e===t,ou=(e,t)=>e!==t,au=(e,t)=>e.length===t,lu=e=>Kc.test(e),su=e=>Jc.test(e),du=e=>Zc.test(e),cu=(e,t)=>{if(!Array.isArray(t)||0===t.length)return!0;const r=String(e).trim().toLowerCase();return!t.some(e=>r===String(e).trim().toLowerCase())},uu=e=>function(e){var t,r=0,n=0,i=0;if(11!=e.length)return!1;if(!/^-?\d+$/.test(e))return!1;if(0==Number(e[0]))return!1;if(r=parseInt(e[0])+parseInt(e[2])+parseInt(e[4])+parseInt(e[6])+parseInt(e[8]),t=parseInt(e[1])+parseInt(e[3])+parseInt(e[5])+parseInt(e[7]),r*=7,Math.abs(r-t)%10!=Number(e[9]))return!1;for(i=0;i<10;i++)n+=parseInt(e[i]);return n%10==Number(e[10])}(e),pu=e=>{if(Array.isArray(e)){if(0===e.length)return!1}else{if("object"==typeof e){let t=!0;return Object.keys(e).forEach(r=>{""===e[r]&&(t=!1)}),t}if("string"==typeof e){if(""===e)return!1}else if("boolean"==typeof e&&!1===e)return!1}return!0},fu=m({});fu.displayName="ITDFormContext";const hu=x(({name:e="",label:r="",placeholder:n="",error:i="",rules:o=[],mask:a=null,locked:l=!1,dependency:p="",reset:f=[],query:h="",children:m=null},b)=>{const{t:v}=t("itd"),x=c(null),A=c(""),{register:w,unregister:k,hasField:_,updateField:S,setFieldError:E,getFieldValue:C,getFieldInstance:$,formId:L}=u(fu),[F,N]=s(!1);d(()=>(w({name:e,field:x,valid:D(x.current?.getValue(),!1),query:h,reset:f,error:i}),N(!0),A.current=JSON.stringify(o),()=>{N(!1),k(e)}),[]),d(()=>{const t=JSON.stringify(o);if(F&&x.current&&A.current!==t){const r=()=>{const t=x.current.getValue(),r=o.find(e=>e.hasOwnProperty("required"));if(!r||r.required||""!==t&&null!=t){const r=D(t,!1);_(e)&&S(e,t,!1,r)}else E(e,"",!0),_(e)&&S(e,t,!1,!0)};"development"===process.env.NODE_ENV?requestAnimationFrame(r):r(),A.current=t}},[o,F]),y(b,()=>x.current);const z=(t,r=!0,n=!0)=>{F&&_(e)&&(S(e,t,r,D(t,n)),M())},D=(t,r=!0)=>{const n=function(e,t,r,n){let i=[];return e.forEach(e=>{if(e.hasOwnProperty(U.REQUIRED)&&!pu(t)&&e.required&&i.push(e.message?e.message:n("errors.required")),e.hasOwnProperty(U.TYPE)&&(e.type===G.MIN_LENGTH&&(ru(String(t),Number(e.value))||i.push(e.message?e.message:n("errors.minLength",{length:Number(e.value)}))),e.type===G.MAX_LENGTH&&(nu(String(t),Number(e.value))||i.push(e.message?e.message:n("errors.maxLength",{length:Number(e.value)}))),e.type===G.EXACT_LENGTH&&(au(String(t),Number(e.value))||i.push(e.message?e.message:n("errors.exactLength",{length:Number(e.value)}))),e.type===G.SAME&&(iu(String(t),String(r(String(e.field))))||i.push(e.message?e.message:n("errors.fieldMustBeTheSame",{fields:e.field}))),e.type===G.NOT_SAME&&(ou(String(t),String(r(String(e.field))))||i.push(e.message?e.message:n("errors.fieldMustBeDifferent",{fields:e.field}))),e.type===G.TC_IDENTITY&&(uu(String(t))||i.push(e.message?e.message:n("errors.wrongTCIdentity"))),e.type===G.PASSWORD&&(Qc(String(t))||i.push(e.message?e.message:n("errors.passwordRule"))),e.type===G.EMAIL&&(eu(String(t))||i.push(e.message?e.message:n("errors.invalidEmailAddress"))),e.type===G.USERNAME&&(tu(String(t))||i.push(e.message?e.message:n("errors.usernameRule"))),e.type===G.SITE_USERNAME&&(lu(String(t))||i.push(e.message?e.message:n("errors.siteUsernameRule"))),e.type===G.ADMIN_USERNAME&&(su(String(t))||i.push(e.message?e.message:n("errors.adminUsernameRule"))),e.type===G.URL&&(du(String(t))||i.push(e.message?e.message:n("errors.invalidURL"))),e.type===G.FORBIDDEN_WORDS)){const r=Array.isArray(e.value)?e.value:void 0!==e.value?[e.value]:[];cu(String(t),r)||i.push(e.message?e.message:n("errors.forbiddenWords"))}}),i}(o,t,C,v);return n.length>0?!!(r||""!==t&&null!=t)&&(r&&E(e,n[0],r),!1):(r&&E(e,""),!0)},M=()=>{if(""===p)return;if(""===C(p))return;const e=$(p);e&&e.forceUpdate&&e.forceUpdate()};return(()=>{if(!m)return null;let t=m.props;const i={id:t.id?t.id:L+"_"+e,label:r,placeholder:n,className:t.className?t.className+" itd-form-item":"itd-form-item",onUpdate:z,ref:x};return a&&(i.mask=a),l&&(i.locked=l),g(m,{...t,...i})})()}),gu=x(({name:e="",className:t="",initialValues:r={},useQueryString:i=!1,onUpdate:o,onFinish:a,onFinishFailed:l,onValidated:c,children:p},f)=>{const{updated:h,setInitialValues:g,isFormValid:m,getValues:b,getFields:v,setFieldValueByName:x,resetFields:A}=u(fu),w=me(),{search:k}=z(),_=be(),[S,E]=s([]),[C,$]=s(!1),[L,F]=s([]),[N,D]=s(!1),[M,T]=s(!1);d(()=>{p&&H()},[p]),d(()=>{O(),I()},[N]),d(()=>{N||0!==Object.keys(v()).length&&0!==L.length&&Object.keys(v()).length===L.length&&D(!0)},[v(),L]),d(()=>{I()},[r]),d(()=>{O()},[k]),d(()=>{M&&N&&i&&Object.keys(h).length>0&&V(h)},[h]),d(()=>{c&&m()!==C&&c(m()),$(m())},[m()]);const O=()=>{N&&i&&(j(),M||P())},I=()=>{N&&(i||M||R())},R=()=>{const e=!Object.values(r).some(e=>null!==e&&""!==e);e&&!M&&T(!0),e||M||(g(r,!1),T(!0))},P=()=>{const e=v(),t=!Object.values(e).some(e=>""!==w.get(e.query,""));if(Object.values(e).some(e=>null===e.query||""===e.query)){let t=[];throw Object.keys(e).forEach(r=>{e[r].hasOwnProperty("query")&&null!==e[r].query&&""!==e[r].query||t.push(r)}),new Error(`ITD Form Initial Fields Error: "useQueryString" is activated but "query" value is not passed to whole form elements! Invalid fields are ${t.toString()}`)}if(t&&!M&&T(!0),!t&&!M){let t={};Object.keys(e).forEach(r=>{t[r]=w.get(e[r].query,"")}),g(t,!0,!0),T(!0)}},V=e=>{let t=[],r=[];const n=v();Object.keys(e).forEach(t=>{r.push(e[t])}),Aa(r,S)||(Object.keys(n).forEach(r=>{t.push({type:n[r].query,value:e[r]})}),_.set(t))},j=()=>{let e=[],t=[];const r=v();if(Object.keys(r).forEach(t=>{let n=String(w.get(r[t].query,""));e.push(n)}),Aa(e,S))return;E(e),Object.keys(r).forEach(e=>{t[e]=w.get(r[e].query,"")}),Object.keys(t).forEach(e=>{x(e,t[e],!1,!1)});let n={};Object.keys(t).forEach(e=>{n[e]=t[e]}),o&&o(n)},H=()=>{let e=[];B(p,t=>(t.hasOwnProperty("type")&&t.type===hu&&e.push({[t.props.name]:t}),!0)),F(e)};return y(f,()=>({fieldUpdate(e){console.log("fieldUpdate"),console.log(e)}})),n("form",{id:e,onSubmit:e=>{e&&(e.preventDefault(),e.stopPropagation()),m()?a&&a(b()):l&&l(v())},onReset:e=>{e&&(e.preventDefault(),e.stopPropagation());let t=[];Object.keys(v()).map(e=>{t.push({type:e,value:""})}),_.set(t),A(!0,!1)},autoComplete:"off",className:t,noValidate:!0,children:p})});var mu=f(gu);function bu({name:e="",useQueryString:t=!1,onUpdate:r,onReset:n,onFieldUpdate:i}){const[o,a]=s({}),[l,d]=s(e),[c,u]=s(!1),[p,f]=s({});function h(e){return o.hasOwnProperty(e)&&void 0!==o[e]}function g(){let e={};return Object.keys(o).forEach(t=>{e[t]=x(t)}),e}function m(e,t,r=!0){if(h(e)&&o[e].field.current){if(o[e].valid=!1,o[e].error=t,!o[e].field.current?.hasOwnProperty("setError"))throw new Error(`ITD Reference Error: You must declare the 'setError' function on the field "${e}"`);o[e].field.current?.setError(r?t:"")}}function v(){let e=!0;return Object.keys(o).forEach(t=>{o[t].valid||(e=!1)}),u(e),e}function x(e){if(h(e)){if(o[e].field.current?.hasOwnProperty("getValue"))return o[e].field.current?.getValue();throw new Error(`ITD Reference Error: You must declare the 'getValue' function on the field "${e}"`)}console.error(`ITD Form Error [getFieldValueByName]: There is no field registered with this name: ${e}`)}function y(e,t,r,n){if(h(e)){if(!o[e].field.current?.hasOwnProperty("setValue"))throw new Error(`ITD Reference Error: You must declare the 'setValue' function on the field "${e}"`);{let i=x(e),a=!1;a=Array.isArray(i)&&Array.isArray(t)?Aa(i,t):Array.isArray(i)||Array.isArray(t)?i.toString()===t.toString():i===t,a||o[e].field.current?.setValue(t,r,n)}}else console.error(`ITD Form Error [setFieldValueByName]: There is no field registered with this name: ${e}`)}return{register:function(e){o[e.name]={name:e.name,field:e.field,value:e.field.current?.getValue(),valid:e.valid,query:e.query,reset:e.reset,error:e.error}},unregister:function(e){h(e)?(delete o[e],v()):console.error(`ITD Form Error [unregister]: There is no field registered with this name: ${e}`)},checkFormIsValid:v,hasField:h,getValues:g,getFieldValue:function(e){return h(e)?(t=o[e].value)instanceof Object?JSON.stringify(t):t:"";var t},getFieldValueByName:x,getFieldInstance:function(e){return h(e)?o[e].field.current:null},getFields:function(){let e={};return Object.keys(o).forEach(t=>{e[t]=o[t]}),e},getFieldsInstance:function(){let e={};return Object.keys(o).forEach(t=>{e[t]=o[t].field.current}),e},setName:function(e){d(e)},setInitialValues:function(e,n=!0,i=!1){Object.keys(e).forEach(t=>{y(t,e[t],n,i)});let o={};return Object.keys(e).forEach(t=>{o[t]=e[t]}),n&&(t&&f(o),r&&r(o)),v(),o},setInvalidField:function(e="",t=""){m(e,t),v()},setInvalidFields:function(e=[],t=""){e.forEach(e=>{m(e,t)}),v()},setFieldValue:function(e,t){h(e)?o[e].field.current?.setValue(t,!0,!0):console.error(`ITD Form Error [setFieldValue]: There is no field registered with this name: ${e}`)},setFieldValueByName:y,setFieldError:m,removeFieldError:function(e){if(h(e)){if(o[e].valid=!0,o[e].error="",!o[e].field.current?.hasOwnProperty("setError"))throw new Error(`ITD Reference Error: You must declare the 'setError' function on the field "${e}"`);o[e].field.current?.setError("")}else console.error(`ITD Form Error [removeFieldError]: There is no field registered with this name: ${e}`)},updateField:function(e,n,a,l){if(h(e)){if(o[e].value=n,o[e].valid=l,a){i&&i({name:e,value:n,valid:l}),o[e].reset.length>0&&o[e].reset.forEach(e=>{o[e].value="",o[e].valid=!1,o[e].field.current?.reset(!1)});let a={...g(),[e]:n};o[e].reset.length>0&&o[e].reset.forEach(e=>{a[e]=""}),t&&l&&f(a),r&&r(a)}v()}else console.error(`ITD Form Error [updateField]: There is no field registered with this name: ${e}`)},isFormValid:b(()=>c,[c]),isFieldsValid:function(e){let t=!0;return e.forEach(e=>{o[e].valid||(t=!1)}),t},isFieldValid:function(e){return o[e].valid},resetFields:function(e=!1,t=!1){Object.keys(o).forEach(r=>{if(!o[r].field.current?.hasOwnProperty("reset"))throw new Error(`ITD Reference Error: You must declare the 'reset' function on the field "${r}"`);o[r].field.current?.reset(e,t)}),n&&n()},removeFields:function(){a({})},formId:l,updated:p}}const vu=x(({initialValues:e,children:t,onUpdate:r,onReset:i,onFinish:o,onFinishFailed:a,onFieldUpdate:l,onValidated:s,useQueryString:u,className:p,name:f},h)=>{const g=c(null);d(()=>()=>{g.current=null},[]),g.current=bu({name:f,onUpdate:r,onReset:i,onFieldUpdate:l,useQueryString:u}),y(h,()=>g.current);return n(fu.Provider,{value:g.current,children:n(mu,{initialValues:e,useQueryString:u,onUpdate:r,onFinish:o,onFinishFailed:a,onValidated:s,name:f,className:(()=>{let e="itd-form";return f&&(e+=" "+f),p&&(e+=" "+p),e})(),children:t})})});vu.Item=hu,vu.Group=function({gap:e=15,horizontal:t=!1,className:r,children:i}){return n(Gc,{className:(()=>{let e="itd-form-group";return r&&(e+=" "+r),e})(),$gap:e,$horizontal:t,children:i})},vu.Control=function({position:e="end",className:t,children:r}){return n(Yc,{className:(()=>{let e="itd-form-control";return t&&(e+=" "+t),e})(),$position:e,children:r})},vu.useForm=()=>u(fu),vu.useFormAPI=()=>{const e=u(fu);if(!e)throw new Error("useFormAPI must be used within a FormContext.Provider");return e};const xu=M.div`
2385
+ `;const Wc=new RegExp(/^[a-zA-Z0-9.!#$%&'+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/),qc=new RegExp(/^[a-zA-Z0-9_.-]+$/),Xc=new RegExp(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+={};:<>|./?,"'\[\]\\`~\-])[a-zA-Z\d$begin:math:display$$end:math:display$\\`~!@#$%^&*()_+={};:<>|.\/?,"'-]{8,60}$/),Kc=new RegExp(/^[a-z0-9._-]+$/),Jc=new RegExp(/^[a-zA-Z0-9]+$/),Zc=new RegExp(/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/);const Qc=e=>Xc.test(e),eu=e=>Wc.test(e),tu=e=>qc.test(e),ru=(e,t)=>e.length>=t,nu=(e,t)=>e.length<=t,iu=(e,t)=>e===t,ou=(e,t)=>e!==t,au=(e,t)=>e.length===t,lu=e=>Kc.test(e),su=e=>Jc.test(e),du=e=>Zc.test(e),cu=(e,t)=>{if(!Array.isArray(t)||0===t.length)return!0;const r=String(e).trim().toLowerCase();return!t.some(e=>r===String(e).trim().toLowerCase())},uu=e=>function(e){var t,r=0,n=0,i=0;if(11!=e.length)return!1;if(!/^-?\d+$/.test(e))return!1;if(0==Number(e[0]))return!1;if(r=parseInt(e[0])+parseInt(e[2])+parseInt(e[4])+parseInt(e[6])+parseInt(e[8]),t=parseInt(e[1])+parseInt(e[3])+parseInt(e[5])+parseInt(e[7]),r*=7,Math.abs(r-t)%10!=Number(e[9]))return!1;for(i=0;i<10;i++)n+=parseInt(e[i]);return n%10==Number(e[10])}(e),pu=e=>{if(Array.isArray(e)){if(0===e.length)return!1}else{if("object"==typeof e){let t=!0;return Object.keys(e).forEach(r=>{""===e[r]&&(t=!1)}),t}if("string"==typeof e){if(""===e)return!1}else if("boolean"==typeof e&&!1===e)return!1}return!0},fu=m({});fu.displayName="ITDFormContext";const hu=x(({name:e="",label:r="",placeholder:n="",error:i="",rules:o=[],mask:a=null,locked:l=!1,dependency:p="",reset:f=[],query:h="",children:m=null},b)=>{const{t:v}=t("itd"),x=c(null),A=c(""),{register:w,unregister:k,hasField:_,updateField:S,setFieldError:E,getFieldValue:C,getFieldInstance:$,formId:L}=u(fu),[F,N]=s(!1);d(()=>(w({name:e,field:x,valid:D(x.current?.getValue(),!1),query:h,reset:f,error:i}),N(!0),A.current=JSON.stringify(o),()=>{N(!1),k(e)}),[]),d(()=>{const t=JSON.stringify(o);if(F&&x.current&&A.current!==t){const r=()=>{const t=x.current.getValue(),r=o.find(e=>e.hasOwnProperty("required"));if(!r||r.required||""!==t&&null!=t){const r=D(t,!1);_(e)&&S(e,t,!1,r)}else E(e,"",!0),_(e)&&S(e,t,!1,!0)};"development"===process.env.NODE_ENV?requestAnimationFrame(r):r(),A.current=t}},[o,F]),y(b,()=>x.current);const z=(t,r=!0,n=!0)=>{F&&_(e)&&(S(e,t,r,D(t,n)),M())},D=(t,r=!0)=>{const n=function(e,t,r,n){let i=[];return e.forEach(e=>{if(e.hasOwnProperty(U.REQUIRED)&&!pu(t)&&e.required&&i.push(e.message?e.message:n("errors.required")),e.hasOwnProperty(U.TYPE)&&(e.type===G.MIN_LENGTH&&(ru(String(t),Number(e.value))||i.push(e.message?e.message:n("errors.minLength",{length:Number(e.value)}))),e.type===G.MAX_LENGTH&&(nu(String(t),Number(e.value))||i.push(e.message?e.message:n("errors.maxLength",{length:Number(e.value)}))),e.type===G.EXACT_LENGTH&&(au(String(t),Number(e.value))||i.push(e.message?e.message:n("errors.exactLength",{length:Number(e.value)}))),e.type===G.SAME&&(iu(String(t),String(r(String(e.field))))||i.push(e.message?e.message:n("errors.fieldMustBeTheSame",{fields:e.field}))),e.type===G.NOT_SAME&&(ou(String(t),String(r(String(e.field))))||i.push(e.message?e.message:n("errors.fieldMustBeDifferent",{fields:e.field}))),e.type===G.TC_IDENTITY&&(uu(String(t))||i.push(e.message?e.message:n("errors.wrongTCIdentity"))),e.type===G.PASSWORD&&(Qc(String(t))||i.push(e.message?e.message:n("errors.passwordRule"))),e.type===G.EMAIL&&(eu(String(t))||i.push(e.message?e.message:n("errors.invalidEmailAddress"))),e.type===G.USERNAME&&(tu(String(t))||i.push(e.message?e.message:n("errors.usernameRule"))),e.type===G.SITE_USERNAME&&(lu(String(t))||i.push(e.message?e.message:n("errors.siteUsernameRule"))),e.type===G.ADMIN_USERNAME&&(su(String(t))||i.push(e.message?e.message:n("errors.adminUsernameRule"))),e.type===G.URL&&(du(String(t))||i.push(e.message?e.message:n("errors.invalidURL"))),e.type===G.FORBIDDEN_WORDS)){const r=Array.isArray(e.value)?e.value:void 0!==e.value?[e.value]:[];cu(String(t),r)||i.push(e.message?e.message:n("errors.forbiddenWords"))}}),i}(o,t,C,v);return n.length>0?!!(r||""!==t&&null!=t)&&(r&&E(e,n[0],r),!1):(r&&E(e,""),!0)},M=()=>{if(""===p)return;if(""===C(p))return;const e=$(p);e&&e.forceUpdate&&e.forceUpdate()};return(()=>{if(!m)return null;let t=m.props;const i={id:t.id?t.id:L+"_"+e,label:r,placeholder:n,className:t.className?t.className+" itd-form-item":"itd-form-item",onUpdate:z,ref:x};return a&&(i.mask=a),l&&(i.locked=l),g(m,{...t,...i})})()}),gu=x(({name:e="",className:t="",initialValues:r={},useQueryString:i=!1,onUpdate:o,onFinish:a,onFinishFailed:l,onValidated:c,children:p},f)=>{const{updated:h,setInitialValues:g,isFormValid:m,getValues:b,getFields:v,setFieldValueByName:x,resetFields:A}=u(fu),w=me(),{search:k}=z(),_=be(),[S,E]=s([]),[C,$]=s(!1),[L,F]=s([]),[N,D]=s(!1),[M,T]=s(!1);d(()=>{p&&H()},[p]),d(()=>{O(),I()},[N]),d(()=>{N||0!==Object.keys(v()).length&&0!==L.length&&Object.keys(v()).length===L.length&&D(!0)},[v(),L]),d(()=>{I()},[r]),d(()=>{O()},[k]),d(()=>{M&&N&&i&&Object.keys(h).length>0&&V(h)},[h]),d(()=>{c&&m()!==C&&c(m()),$(m())},[m()]);const O=()=>{N&&i&&(j(),M||P())},I=()=>{N&&(i||M||R())},R=()=>{const e=!Object.values(r).some(e=>null!==e&&""!==e);e&&!M&&T(!0),e||M||(g(r,!1),T(!0))},P=()=>{const e=v(),t=!Object.values(e).some(e=>""!==w.get(e.query,""));if(Object.values(e).some(e=>null===e.query||""===e.query)){let t=[];throw Object.keys(e).forEach(r=>{e[r].hasOwnProperty("query")&&null!==e[r].query&&""!==e[r].query||t.push(r)}),new Error(`ITD Form Initial Fields Error: "useQueryString" is activated but "query" value is not passed to whole form elements! Invalid fields are ${t.toString()}`)}if(t&&!M&&T(!0),!t&&!M){let t={};Object.keys(e).forEach(r=>{t[r]=w.get(e[r].query,"")}),g(t,!0,!0),T(!0)}},V=e=>{let t=[],r=[];const n=v();Object.keys(e).forEach(t=>{r.push(e[t])}),Aa(r,S)||(Object.keys(n).forEach(r=>{t.push({type:n[r].query,value:e[r]})}),_.set(t))},j=()=>{let e=[],t=[];const r=v();if(Object.keys(r).forEach(t=>{let n=String(w.get(r[t].query,""));e.push(n)}),Aa(e,S))return;E(e),Object.keys(r).forEach(e=>{t[e]=w.get(r[e].query,"")}),Object.keys(t).forEach(e=>{x(e,t[e],!1,!1)});let n={};Object.keys(t).forEach(e=>{n[e]=t[e]}),o&&o(n)},H=()=>{let e=[];B(p,t=>(t.hasOwnProperty("type")&&t.type===hu&&e.push({[t.props.name]:t}),!0)),F(e)};return y(f,()=>({fieldUpdate(e){console.log("fieldUpdate"),console.log(e)}})),n("form",{id:e,onSubmit:e=>{e&&(e.preventDefault(),e.stopPropagation()),m()?a&&a(b()):l&&l(v())},onReset:e=>{e&&(e.preventDefault(),e.stopPropagation());let t=[];Object.keys(v()).map(e=>{t.push({type:e,value:""})}),_.set(t),A(!0,!1)},autoComplete:"off",className:t,noValidate:!0,children:p})});var mu=f(gu);function bu({name:e="",useQueryString:t=!1,onUpdate:r,onReset:n,onFieldUpdate:i}){const[o,a]=s({}),[l,d]=s(e),[c,u]=s(!1),[p,f]=s({});function h(e){return o.hasOwnProperty(e)&&void 0!==o[e]}function g(e){return h(e)?o[e].field.current:null}function m(){let e={};return Object.keys(o).forEach(t=>{e[t]=y(t)}),e}function v(e,t,r=!0){if(h(e)&&o[e].field.current){if(o[e].valid=!1,o[e].error=t,!o[e].field.current?.hasOwnProperty("setError"))throw new Error(`ITD Reference Error: You must declare the 'setError' function on the field "${e}"`);o[e].field.current?.setError(r?t:"")}}function x(){let e=!0;return Object.keys(o).forEach(t=>{o[t].valid||(e=!1)}),u(e),e}function y(e){if(h(e)){if(o[e].field.current?.hasOwnProperty("getValue"))return o[e].field.current?.getValue();throw new Error(`ITD Reference Error: You must declare the 'getValue' function on the field "${e}"`)}console.error(`ITD Form Error [getFieldValueByName]: There is no field registered with this name: ${e}`)}function A(e,t,r,n){if(h(e)){if(!o[e].field.current?.hasOwnProperty("setValue"))throw new Error(`ITD Reference Error: You must declare the 'setValue' function on the field "${e}"`);{let i=y(e),a=!1;a=Array.isArray(i)&&Array.isArray(t)?Aa(i,t):Array.isArray(i)||Array.isArray(t)?i.toString()===t.toString():i===t,a||o[e].field.current?.setValue(t,r,n)}}else console.error(`ITD Form Error [setFieldValueByName]: There is no field registered with this name: ${e}`)}return{register:function(e){o[e.name]={name:e.name,field:e.field,value:e.field.current?.getValue(),valid:e.valid,query:e.query,reset:e.reset,error:e.error}},unregister:function(e){h(e)?(delete o[e],x()):console.error(`ITD Form Error [unregister]: There is no field registered with this name: ${e}`)},scrollTo:function(e,t){if(!h(e))return console.error(`ITD Form Error [scrollTo]: There is no field registered with this name: ${e}`),!1;const r=g(e);if(r&&"function"==typeof r.scrollIntoView)return r.scrollIntoView(t),!0;if("undefined"!=typeof document){const r=document.getElementById(`${l}_${e}`);if(r&&"function"==typeof r.scrollIntoView)return r.scrollIntoView(void 0!==t?t:{behavior:"smooth",block:"center",inline:"nearest"}),!0}return!1},checkFormIsValid:x,hasField:h,getValues:m,getFieldValue:function(e){return h(e)?(t=o[e].value)instanceof Object?JSON.stringify(t):t:"";var t},getFieldValueByName:y,getFieldInstance:g,getFields:function(){let e={};return Object.keys(o).forEach(t=>{e[t]=o[t]}),e},getFieldsInstance:function(){let e={};return Object.keys(o).forEach(t=>{e[t]=o[t].field.current}),e},setName:function(e){d(e)},setInitialValues:function(e,n=!0,i=!1){Object.keys(e).forEach(t=>{A(t,e[t],n,i)});let o={};return Object.keys(e).forEach(t=>{o[t]=e[t]}),n&&(t&&f(o),r&&r(o)),x(),o},setInvalidField:function(e="",t=""){v(e,t),x()},setInvalidFields:function(e=[],t=""){e.forEach(e=>{v(e,t)}),x()},setFieldValue:function(e,t){h(e)?o[e].field.current?.setValue(t,!0,!0):console.error(`ITD Form Error [setFieldValue]: There is no field registered with this name: ${e}`)},setFieldValueByName:A,setFieldError:v,removeFieldError:function(e){if(h(e)){if(o[e].valid=!0,o[e].error="",!o[e].field.current?.hasOwnProperty("setError"))throw new Error(`ITD Reference Error: You must declare the 'setError' function on the field "${e}"`);o[e].field.current?.setError("")}else console.error(`ITD Form Error [removeFieldError]: There is no field registered with this name: ${e}`)},updateField:function(e,n,a,l){if(h(e)){if(o[e].value=n,o[e].valid=l,a){i&&i({name:e,value:n,valid:l}),o[e].reset.length>0&&o[e].reset.forEach(e=>{o[e].value="",o[e].valid=!1,o[e].field.current?.reset(!1)});let a={...m(),[e]:n};o[e].reset.length>0&&o[e].reset.forEach(e=>{a[e]=""}),t&&l&&f(a),r&&r(a)}x()}else console.error(`ITD Form Error [updateField]: There is no field registered with this name: ${e}`)},isFormValid:b(()=>c,[c]),isFieldsValid:function(e){let t=!0;return e.forEach(e=>{o[e].valid||(t=!1)}),t},isFieldValid:function(e){return o[e].valid},resetFields:function(e=!1,t=!1){Object.keys(o).forEach(r=>{if(!o[r].field.current?.hasOwnProperty("reset"))throw new Error(`ITD Reference Error: You must declare the 'reset' function on the field "${r}"`);o[r].field.current?.reset(e,t)}),n&&n()},removeFields:function(){a({})},formId:l,updated:p}}const vu=x(({initialValues:e,children:t,onUpdate:r,onReset:i,onFinish:o,onFinishFailed:a,onFieldUpdate:l,onValidated:s,useQueryString:u,className:p,name:f},h)=>{const g=c(null);d(()=>()=>{g.current=null},[]),g.current=bu({name:f,onUpdate:r,onReset:i,onFieldUpdate:l,useQueryString:u}),y(h,()=>g.current);return n(fu.Provider,{value:g.current,children:n(mu,{initialValues:e,useQueryString:u,onUpdate:r,onFinish:o,onFinishFailed:a,onValidated:s,name:f,className:(()=>{let e="itd-form";return f&&(e+=" "+f),p&&(e+=" "+p),e})(),children:t})})});vu.Item=hu,vu.Group=function({gap:e=15,horizontal:t=!1,className:r,children:i}){return n(Gc,{className:(()=>{let e="itd-form-group";return r&&(e+=" "+r),e})(),$gap:e,$horizontal:t,children:i})},vu.Control=function({position:e="end",className:t,children:r}){return n(Yc,{className:(()=>{let e="itd-form-control";return t&&(e+=" "+t),e})(),$position:e,children:r})},vu.useForm=()=>u(fu),vu.useFormAPI=()=>{const e=u(fu);if(!e)throw new Error("useFormAPI must be used within a FormContext.Provider");return e};const xu=M.div`
2386
2386
 
2387
2387
  &.itd-accordion-menu-sub-menu {
2388
2388
 
@@ -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})})(),ae(),i&&le(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(()=>{le(a===Gp.NUMBER?Number(r):String(r),!0,""!==r)},[r]);const ae=()=>{H.current&&C&&H.current&&(H.current?.focus(),Q(!0))},le=(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(""),le(a===Gp.NUMBER?0:"",e,t)},setValue(e,t=!0,r=!0){Y(e),le(e,t,r)},getValue:()=>G,setError(e){X(e)},forceUpdate(){le(G)},clear(){Y("")}}));const se=e=>{const t="string"==typeof e&&L&&e.replace(/\D+/g,"").length<L.replace(/\D+/g,"").length;le(e,!0,!t),T&&T(e)},de=e=>{se(e.value)},ce=e=>{H.current?.focus(),Q(!0),J(!0===qp),!E&&ie&&oe(!1),I&&I(e)},ue=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&&le(i,!0,!1),R?R(e):e.target.blur()},pe=e=>{"Tab"===e.key&&J(!0),13===e.keyCode&&P&&P(e),B&&B(e)},fe=()=>{let e={id:U,placeholder:t,value:G,type:a,spellCheck:"false",autoCorrect:"off",autoCapitalize:"none",className:S?ke():we(),onFocus:ce,onBlur:ue,onKeyDown:pe,disabled:_||x};return x&&(e["data-locked"]=!0),e=E?{...e,autoComplete:"on"}:{...e,autoComplete:"new-password",name:U,onMouseDown:()=>J(!1),readOnly:ie},L?(e={...e,format:L,mask:"_",allowEmptyFormatting:F,onChange:e=>se(e.target.value)},n($p,{...e})):a===Gp.CURRENCY?(e={...e,maxLength:k,type:Gp.TEXT,allowLeadingZeros:N,decimalSeparator:z,thousandSeparator:D,decimalScale:M,getInputRef:H,onValueChange:de,onMouseDown:()=>J(!1),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:()=>J(!1),onChange:e=>{const t=Number(e.target.value.replace(/,/g,"."));t>=A&&-1===w||t>=A&&t<=w?se(t):t<A?se(A):t>w&&se(w)},ref:H},n("input",{...e})):(e={...e,maxLength:k,onChange:e=>se(e.target.value),onMouseDown:()=>J(!1),ref:H},n("input",{...e}))},he=()=>{if(m)return n(Ip,{className:"itd-input-addon-before",children:m})},ge=()=>{if(b)return n(Rp,{className:"itd-input-addon-after",children:b})},me=()=>{if(h)return n(Dp,{className:"itd-input-prefix",children:h})},be=()=>{if(g)return n(Mp,{className:"itd-input-suffix",children:g})},ve=()=>{if(x)return n(Tp,{className:"itd-input-locked",children:"boolean"!=typeof x?x:n(Pp,{className:"itd-svg",width:"18",height:"18"})})},xe=()=>{if(""!==q&&!_)return n(Vp,{className:"itd-error-border"})},ye=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"})]})})}),Ae=()=>{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||ye]})},we=()=>"itd-input-default-input",ke=()=>"itd-input-floating-input",_e=()=>{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:_e(),children:[he(),o(Fp,{$hasPrefix:null!==h,$hasSuffix:null!==g,$hasError:""!==q&&!_,children:[me(),o(Np,{className:"itd-input-middle",children:[fe(),S?n("label",{htmlFor:U,className:"itd-input-floating-label "+Yp+" "+t,"data-content":t,children:n(jp,{children:t})}):null,xe()]}),o(zp,{children:[be(),ve(),Ae()]})]}),ge()]})})()});Xp.displayName="ITD-Input";const Kp=M.div`
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})})(),ae(),i&&le(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(()=>{le(a===Gp.NUMBER?Number(r):String(r),!0,""!==r)},[r]);const ae=()=>{H.current&&C&&H.current&&(H.current?.focus(),Q(!0))},le=(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(""),le(a===Gp.NUMBER?0:"",e,t)},setValue(e,t=!0,r=!0){Y(e),le(e,t,r)},getValue:()=>G,setError(e){X(e)},forceUpdate(){le(G)},clear(){Y("")}}));const se=e=>{const t="string"==typeof e&&L&&e.replace(/\D+/g,"").length<L.replace(/\D+/g,"").length;le(e,!0,!t),T&&T(e)},de=e=>{se(e.value)},ce=e=>{H.current?.focus(),Q(!0),J(!0===qp),!E&&ie&&oe(!1),I&&I(e)},ue=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&&le(i,!0,!1),R?R(e):e.target.blur()},pe=e=>{"Tab"===e.key&&J(!0),13===e.keyCode&&P&&P(e),B&&B(e)},fe=()=>{let e={id:U,placeholder:t,value:G,type:a,spellCheck:"false",autoCorrect:"off",autoCapitalize:"none",className:S?ke():we(),onFocus:ce,onBlur:ue,onKeyDown:pe,disabled:_||x};return x&&(e["data-locked"]=!0),e=E?{...e,autoComplete:"on"}:{...e,autoComplete:"new-password",name:U,onMouseDown:()=>J(!1),readOnly:ie},L?(e={...e,format:L,mask:"_",allowEmptyFormatting:F,onChange:e=>se(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:de,onMouseDown:()=>J(!1),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:()=>J(!1),onChange:e=>{const t=Number(e.target.value.replace(/,/g,"."));t>=A&&-1===w||t>=A&&t<=w?se(t):t<A?se(A):t>w&&se(w)},ref:H},n("input",{...e})):(e={...e,maxLength:k,onChange:e=>se(e.target.value),onMouseDown:()=>J(!1),ref:H},n("input",{...e}))},he=()=>{if(m)return n(Ip,{className:"itd-input-addon-before",children:m})},ge=()=>{if(b)return n(Rp,{className:"itd-input-addon-after",children:b})},me=()=>{if(h)return n(Dp,{className:"itd-input-prefix",children:h})},be=()=>{if(g)return n(Mp,{className:"itd-input-suffix",children:g})},ve=()=>{if(x)return n(Tp,{className:"itd-input-locked",children:"boolean"!=typeof x?x:n(Pp,{className:"itd-svg",width:"18",height:"18"})})},xe=()=>{if(""!==q&&!_)return n(Vp,{className:"itd-error-border"})},ye=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"})]})})}),Ae=()=>{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||ye]})},we=()=>"itd-input-default-input",ke=()=>"itd-input-floating-input",_e=()=>{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:_e(),children:[he(),o(Fp,{$hasPrefix:null!==h,$hasSuffix:null!==g,$hasError:""!==q&&!_,children:[me(),o(Np,{className:"itd-input-middle",children:[fe(),S?n("label",{htmlFor:U,className:"itd-input-floating-label "+Yp+" "+t,"data-content":t,children:n(jp,{children:t})}):null,xe()]}),o(zp,{children:[be(),ve(),Ae()]})]}),ge()]})})()});Xp.displayName="ITD-Input";const Kp=M.div`
3520
3520
 
3521
3521
  border: 1px solid #d9d9d900;
3522
3522
  border-radius: 6px;
@@ -7,4 +7,5 @@ export type ITDImperativeFuncProps = {
7
7
  setDisabled?: (value: boolean) => void;
8
8
  forceUpdate?: () => void;
9
9
  clear: () => void;
10
+ scrollIntoView?: (options?: ScrollIntoViewOptions | boolean) => void;
10
11
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inntechcorp/it-design",
3
- "version": "2.2.83",
3
+ "version": "2.2.84",
4
4
  "description": "All in one Design library for web applications.",
5
5
  "author": "Inn.Tech",
6
6
  "license": "ISC",