@eliseubatista99/react-scaffold-core 1.1.16 → 1.1.17
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.
|
@@ -4,5 +4,5 @@ export declare const useInputFieldHelper: (props: InputFieldProps) => {
|
|
|
4
4
|
handleOnBlur: (event: React.FocusEvent<HTMLInputElement, Element>) => void;
|
|
5
5
|
handleOnFocus: (event: React.FocusEvent<HTMLInputElement, Element>) => void;
|
|
6
6
|
onValueChanged: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
-
handleOnClick: (
|
|
7
|
+
handleOnClick: () => void;
|
|
8
8
|
};
|
package/dist/index.cjs.js
CHANGED
|
@@ -138,7 +138,7 @@ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}
|
|
|
138
138
|
> * {
|
|
139
139
|
pointer-events: none;
|
|
140
140
|
}
|
|
141
|
-
`,Jo=e=>{const{children:t,styles:r,childrenStyles:i,submitButton:a}=e,{ref:s,handleFormSubmission:c,submitForm:u,handleFormChange:l}=Go(e);return X.jsxs("form",{ref:s,onSubmit:c,onChange:l,style:{width:"100%",display:"flex",flexDirection:"column",gap:"8px",flex:1,...r},children:[X.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:"8px",flex:1,...i},children:t}),X.jsx(Ko,{onClick:u,styles:{...a.styles},children:a.content})]})},Zo=({src:e,alt:t="",onClick:r,styles:i})=>X.jsx("img",{src:e,alt:t,style:{overflow:"hidden",position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",objectFit:"cover",...i},onClick:()=>{r?.()}}),Qo=e=>({handleOnBlur:s=>{e.onBlur?.()},handleOnFocus:s=>{e.onFocus?.()},onValueChanged:s=>{e.onChange?.(s.currentTarget.value)},handleOnClick:
|
|
141
|
+
`,Jo=e=>{const{children:t,styles:r,childrenStyles:i,submitButton:a}=e,{ref:s,handleFormSubmission:c,submitForm:u,handleFormChange:l}=Go(e);return X.jsxs("form",{ref:s,onSubmit:c,onChange:l,style:{width:"100%",display:"flex",flexDirection:"column",gap:"8px",flex:1,...r},children:[X.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:"8px",flex:1,...i},children:t}),X.jsx(Ko,{onClick:u,styles:{...a.styles},children:a.content})]})},Zo=({src:e,alt:t="",onClick:r,styles:i})=>X.jsx("img",{src:e,alt:t,style:{overflow:"hidden",position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",objectFit:"cover",...i},onClick:()=>{r?.()}}),Qo=e=>({handleOnBlur:s=>{e.onBlur?.()},handleOnFocus:s=>{e.onFocus?.()},onValueChanged:s=>{e.onChange?.(s.currentTarget.value)},handleOnClick:()=>{e.onClick?.()}}),es=Pe.div`
|
|
142
142
|
display: flex;
|
|
143
143
|
flex-direction: column;
|
|
144
144
|
font-family: inherit;
|
|
@@ -156,7 +156,7 @@ Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}
|
|
|
156
156
|
input:-webkit-autofill {
|
|
157
157
|
background-color: #00000000;
|
|
158
158
|
}
|
|
159
|
-
`,On=e=>{const{onValueChanged:t,handleOnBlur:r,handleOnFocus:i,handleOnClick:a}=Qo(e),{name:s,label:c,leftIcon:u,rightIcon:l,bottomMessage:h,placeHolder:g,autoComplete:y="off",value:E,initialValue:M,type:k="text",maxLength:p,inputStyles:R,containerStyles:S,styles:A,step:W,pattern:F,onInput:m}=e;return X.jsxs(es,{style:{width:"100%",maxWidth:"357px",gap:"8px",...A},children:[c,X.jsxs("div",{style:{display:"flex",flexDirection:"row",width:"100%",height:"47px",margin:"8px auto 0 auto",border:"2px solid #000000",borderRadius:"5px",padding:"5px 15px",color:"#000000",fontFamily:"inherit",fontStyle:"normal",fontWeight:400,fontSize:"16px",lineHeight:"24px",outline:"none",alignItems:"center",gap:"10px",...S},children:[u,X.jsx("input",{name:s,type:k,autoComplete:y,step:W,maxLength:p,placeholder:g,value:E,defaultValue:M,onChange:t,onFocus:i,onBlur:r,
|
|
159
|
+
`,On=e=>{const{onValueChanged:t,handleOnBlur:r,handleOnFocus:i,handleOnClick:a}=Qo(e),{name:s,label:c,leftIcon:u,rightIcon:l,bottomMessage:h,placeHolder:g,autoComplete:y="off",value:E,initialValue:M,type:k="text",maxLength:p,inputStyles:R,containerStyles:S,styles:A,step:W,pattern:F,onInput:m}=e;return X.jsxs(es,{style:{width:"100%",maxWidth:"357px",gap:"8px",...A},children:[c,X.jsxs("div",{onClick:()=>a(),style:{display:"flex",flexDirection:"row",width:"100%",height:"47px",margin:"8px auto 0 auto",border:"2px solid #000000",borderRadius:"5px",padding:"5px 15px",color:"#000000",fontFamily:"inherit",fontStyle:"normal",fontWeight:400,fontSize:"16px",lineHeight:"24px",outline:"none",alignItems:"center",gap:"10px",...S},children:[u,X.jsx("input",{name:s,type:k,autoComplete:y,step:W,maxLength:p,placeholder:g,value:E,defaultValue:M,onChange:t,onFocus:i,onBlur:r,onInput:m,pattern:F,style:{flex:1,border:"none",color:"inherit",fontFamily:"inherit",fontStyle:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",outline:"inherit",background:"none",...R}}),l]}),h]})},ts=({id:e,styles:t,children:r})=>{const{isItemVisible:i}=et();return X.jsx(X.Fragment,{children:i(e)&&X.jsx("div",{style:{width:"100%",minHeight:"100%",left:0,top:0,position:"fixed",zIndex:1e3,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...t},children:r})})},rs=({id:e,children:t,backgroundStyles:r,contentStyles:i,onClickOutsideModal:a})=>{const{isItemVisible:s}=et();return X.jsx(X.Fragment,{children:s(e)&&X.jsx("div",{style:{width:"100%",height:"100%",minHeight:"100vh",background:"#00000068",position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e3,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...r},onClick:()=>{a?.()},children:X.jsx("div",{style:{width:"90%",maxWidth:"375px",height:"fit-content",minHeight:"80px",maxHeight:"50%",background:"#ffffff",borderRadius:"16px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",zIndex:1001,position:"relative",padding:"24px",...i},onClick:c=>{c.stopPropagation()},children:t})})})},ns=e=>{const t=U.useRef(""),r=U.useCallback(u=>(e.allowNegatives?(u=u.replace(/-/g,(l,h)=>h===0?"-":""),u.indexOf("-")>0&&(u=u.replace(/-/g,""),u="-"+u)):u=u.replace(/-/g,""),u),[e]),i=U.useCallback(u=>{if(e.allowDecimals){u.startsWith(".")&&(u="0"+u),u.length===2&&u[0]==="-"&&u[1]==="."&&(u="-");const l=u.indexOf(".");l!==-1&&(u=u.slice(0,l+1)+u.slice(l+1).replace(/\./g,""));const[h,...g]=u.split("."),[y,...E]=t.current.split(".");let M=g.join(""),k=E.join("");e.decimalScale!==void 0&&(M.length>e.decimalScale?M=k:M=M.slice(0,e.decimalScale)),u=M||u.endsWith(".")?`${h}.${M}`:h}else u=u.replace(/\./g,"");return u},[e]),a=U.useCallback(u=>{const l=Number(u);var h=e.max;return h===void 0&&(h=e.maxLength?Number("9".repeat(e.maxLength)):void 0),!isNaN(l)&&(e.min!==void 0&&l<e.min||h!==void 0&&l>h)?t.current??u:u},[e]),s=U.useCallback(u=>{const l=u.target,h=l.selectionStart??0,g=l.selectionEnd??0;let y=l.value;y=y.replace(/[^0-9\.\-]/g,""),y=r(y),y=i(y),y=a(y);const E=y.length-l.value.length;l.value=y,l.setSelectionRange(h+E,g+E),t.current=y},[r,i,a]);return{props:U.useCallback(()=>({...e,type:"text",pattern:"^-?[0-9]*.?[0-9]*$",onInput:s}),[e,s])()}},is=({allowNegatives:e=!0,allowDecimals:t=!0,decimalScale:r=2,...i})=>{const{props:a}=ns({allowNegatives:e,allowDecimals:t,decimalScale:r,...i});return X.jsx(On,{type:"text",...a})},as=e=>{const t=U.useRef(null),r=U.useRef(null),[i,a]=U.useState(24),[s,c]=U.useState(24),u=U.useCallback(()=>{t.current&&a(t.current.clientHeight)},[t,t.current]),l=U.useCallback(()=>{r.current&&c(r.current.clientHeight)},[r,r.current]),h=U.useCallback(()=>{let g=0;return e.header?.visibility==="always"&&(g=g+(i||0)),e.footer?.visibility==="always"&&(g=g+(s||0)),g},[r,r.current]);return U.useEffect(()=>{u()},[u,t,t.current]),U.useEffect(()=>{l()},[l,r,r.current]),{header:{...e.header,visible:e.header!==void 0,height:e.header?.visibility==="fixed"?0:i,ref:t},footer:{...e.footer,visible:e.footer!==void 0,height:e.footer?.visibility==="fixed"?0:s,ref:r},page:{extraHeight:h()}}},os=Pe.div`
|
|
160
160
|
min-height: 100%;
|
|
161
161
|
max-height: 100%;
|
|
162
162
|
width: 100%;
|
package/dist/index.es.js
CHANGED
|
@@ -6363,7 +6363,7 @@ const Sn = q.createContext({
|
|
|
6363
6363
|
onValueChanged: (s) => {
|
|
6364
6364
|
e.onChange?.(s.currentTarget.value);
|
|
6365
6365
|
},
|
|
6366
|
-
handleOnClick: (
|
|
6366
|
+
handleOnClick: () => {
|
|
6367
6367
|
e.onClick?.();
|
|
6368
6368
|
}
|
|
6369
6369
|
}), Yo = Ee.div`
|
|
@@ -6418,6 +6418,7 @@ const Sn = q.createContext({
|
|
|
6418
6418
|
/* @__PURE__ */ X.jsxs(
|
|
6419
6419
|
"div",
|
|
6420
6420
|
{
|
|
6421
|
+
onClick: () => a(),
|
|
6421
6422
|
style: {
|
|
6422
6423
|
display: "flex",
|
|
6423
6424
|
flexDirection: "row",
|
|
@@ -6454,7 +6455,6 @@ const Sn = q.createContext({
|
|
|
6454
6455
|
onChange: t,
|
|
6455
6456
|
onFocus: i,
|
|
6456
6457
|
onBlur: r,
|
|
6457
|
-
onClick: a,
|
|
6458
6458
|
onInput: m,
|
|
6459
6459
|
pattern: F,
|
|
6460
6460
|
style: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eliseubatista99/react-scaffold-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.17",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A library which provides basic components, hooks, helpers and providers to easily build a React application and avoid repeating the usual code.",
|
|
6
6
|
"main": "dist/index.cjs.js",
|