@hiver/connector-agent 4.22.10 → 4.22.11-authCta-beta.0

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.
Files changed (3) hide show
  1. package/index.es.js +281 -279
  2. package/index.umd.js +1 -1
  3. package/package.json +1 -1
package/index.umd.js CHANGED
@@ -2202,7 +2202,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2202
2202
  transform: translate(5px, 0);
2203
2203
  height: 34px;
2204
2204
  width: 34px;
2205
- `,Hw=e=>I.createElement("svg",{width:"8px",height:"8px",viewBox:"8.59 6 7.41 12",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z"})),Ar=({fetchConfig:e,createConfig:t,menuPortalTarget:n,iconData:u,stackIndex:r,isScrollTarget:o,onValidationError:f,inputChangeHandler:i,selectChangeHandler:c,dateChangeHandler:l,tableChangeHandler:D,checkboxChangeHandler:A,attachmentChangeHandler:m,attachmentUploadHandler:b,attachmentToastHandler:C,...p})=>{const{validation:d,helperText:h,id:E,label:F,name:x,type:B,validateOnBlur:S=!0,validateOnChange:v=!0,isRequired:w,labelSpacing:k=1,showGlobalLoader:L=!1,hideHelperText:N=!1,meta:{isExpandable:T=B==="table",isExpanded:M=!0}={}}=p,[j,_]=g.useState(!1),[R,X]=g.useState(""),[z,V]=g.useState(M);g.useEffect(()=>{B!=="table"&&(j||q(p.value,!1))},[j,p.value]);const H=P=>{var Y;P&&!j&&_(!0),(Y=p.onFocus)==null||Y.call(p,P)};function q(P,Y=!0,K){let U="";const De=P==null||P===""||Array.isArray(P)&&P.length===0;if((d!=null&&d.isRequired||w)&&(U=De?nf:"",De&&typeof(d==null?void 0:d.isRequired)=="function")){const oe=d.isRequired(P);oe&&typeof oe=="boolean"?U=nf:oe&&(U=oe)}let de={id:E,name:x,label:F};if(p.type==="date"?de={...de,disableFuture:p.disableFuture,disablePast:p.disablePast}:p.type==="number"?de={...de,min:p.min,max:p.max}:p.type==="text"&&p.multiline&&(de={...de,maxCharacters:p.maxCharacters}),P&&!U&&(d!=null&&d.validate)){const oe=d.validate(P,{...de,...K});typeof oe=="boolean"&&oe===!1?U=LB:typeof oe=="string"&&(U=oe)}Y&&X(U),f==null||f(x,U,Y)}const G=P=>{var Y;j||_(!0),(Y=p.onBlur)==null||Y.call(p,P),j&&S&&q(p.value)},ue=()=>N?null:p.helperText?a.jsx(E2,{children:h}):j&&R?a.jsx(E2,{className:"helper--error",children:R}):null,fe=P=>{P&&!j&&_(!0),i==null||i(P),j&&v&&q(P.target.value)},W=(P,Y)=>{P&&!j&&_(!0),A==null||A(P,Y),j&&v&&q(Y)},te=(P,Y)=>{c==null||c(P,Y),P&&!j&&_(!0),j&&v&&(Array.isArray(P)?q(P):P&&typeof P=="object"&&"value"in P&&q(P.value))},re=(P,Y)=>{l==null||l(x,P,Y),P&&!j&&_(!0),j&&v&&q(P)},ve=P=>{D==null||D(x,P)},se=P=>{m==null||m(x,P),j||_(!0),v&&q(P)},ke=(P,Y)=>{f==null||f(P,Y),X(typeof Y=="string"?Y:"")},ne=P=>{V(Y=>!Y)},Z=P=>{if(L)return a.jsx(s.Skeleton,{variant:"rounded",height:34.69,animation:"wave"});switch(P.type){case"select":return a.jsx(m2,{children:a.jsx(oa,{...P,stackIndex:r,isScrollTarget:o,className:`formField__select ${R&&j?"formField__select--error":""} ${P.className||""}`,classNamePrefix:"hiverFormField",onBlur:G,onChange:te,onFocus:H,menuPortalTarget:n})});case"async-select":return a.jsx(m2,{children:a.jsx(GB,{...P,stackIndex:r,isScrollTarget:o,className:`formField__select ${R&&j?"formField__select--error":""} ${P.className||""}`,classNamePrefix:"hiverFormField",onBlur:G,onChange:te,onFocus:H,loadOptions:e==null?void 0:e.loadOptions,createOption:t==null?void 0:t.createOption,menuPortalTarget:n})});case"date":return a.jsx($B,{...P,label:void 0,onBlur:G,onFocus:H,onChange:re,error:!!(R&&j)});case"table":return a.jsx(to,{...P,value:P.value,onChange:ve,onFocus:H,onValidationError:ke,fetchConfig:e==null?void 0:e.loadOptionsList,createConfig:t==null?void 0:t.createOptionList,stackIndex:r});case"attachment":return a.jsx(Lw,{name:x,value:P.value,meta:P.meta,isRequired:w,onChange:se,upload:b,onToast:C});case"checkbox":return a.jsx(Vd,{...P,checked:!!P.value,onChange:W,onFocus:H,onBlur:G,styleOverrides:{marginTop:"2px"}});default:return a.jsx(jw,{variant:"outlined",fullWidth:!0,id:E,...P,value:P.value,label:void 0,onBlur:G,onChange:fe,onFocus:H,error:!!(R&&j),inputProps:{type:P.type,min:P.min,max:P.max,...P.inputProps}})}};return a.jsxs(Pw,{spacing:k,useFlexGap:!0,...T&&{className:`expandable ${z?"open":"close"}`},children:[a.jsx(s2,{label:F,htmlFor:E,isRequired:!!(d!=null&&d.isRequired)||w,prefixNode:T?a.jsx(_w,{children:a.jsx(Hw,{className:"arrow-icon"})}):null,...T&&{onClick:()=>ne()}}),a.jsxs(Qw,{className:"input-wrapper",children:[a.jsx(s.Tooltip,{title:p.toolTipTitle,arrow:!0,placement:"right-end",disableHoverListener:!0,children:Z(p)}),u!=null&&u.icon?a.jsx(s.Tooltip,{title:u.toolTipText,placement:"bottom",children:a.jsx(Rw,{className:"form--sideIcon",children:u==null?void 0:u.icon})}):null]}),ue()]})},Ww=s.styled(s.Stack)`
2205
+ `,Hw=e=>I.createElement("svg",{width:"8px",height:"8px",viewBox:"8.59 6 7.41 12",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z"})),Ar=({fetchConfig:e,createConfig:t,menuPortalTarget:n,iconData:u,stackIndex:r,isScrollTarget:o,onValidationError:f,inputChangeHandler:i,selectChangeHandler:c,dateChangeHandler:l,tableChangeHandler:D,checkboxChangeHandler:A,attachmentChangeHandler:m,attachmentUploadHandler:b,attachmentToastHandler:C,...p})=>{const{validation:d,helperText:h,id:E,label:F,name:x,type:B,validateOnBlur:S=!0,validateOnChange:v=!0,isRequired:w,labelSpacing:k=1,showGlobalLoader:L=!1,hideHelperText:N=!1,meta:{isExpandable:T=B==="table",isExpanded:M=!0}={}}=p,[j,_]=g.useState(!1),[R,X]=g.useState(""),[z,V]=g.useState(M);g.useEffect(()=>{B!=="table"&&(j||q(p.value,!1))},[j,p.value]),g.useEffect(()=>{B==="table"||!j||q(p.value,v)},[p.value]);const H=P=>{var Y;P&&!j&&_(!0),(Y=p.onFocus)==null||Y.call(p,P)};function q(P,Y=!0,K){let U="";const De=P==null||P===""||Array.isArray(P)&&P.length===0;if((d!=null&&d.isRequired||w)&&(U=De?nf:"",De&&typeof(d==null?void 0:d.isRequired)=="function")){const oe=d.isRequired(P);oe&&typeof oe=="boolean"?U=nf:oe&&(U=oe)}let de={id:E,name:x,label:F};if(p.type==="date"?de={...de,disableFuture:p.disableFuture,disablePast:p.disablePast}:p.type==="number"?de={...de,min:p.min,max:p.max}:p.type==="text"&&p.multiline&&(de={...de,maxCharacters:p.maxCharacters}),P&&!U&&(d!=null&&d.validate)){const oe=d.validate(P,{...de,...K});typeof oe=="boolean"&&oe===!1?U=LB:typeof oe=="string"&&(U=oe)}Y&&X(U),f==null||f(x,U,Y)}const G=P=>{var Y;j||_(!0),(Y=p.onBlur)==null||Y.call(p,P),j&&S&&q(p.value)},ue=()=>N?null:p.helperText?a.jsx(E2,{children:h}):j&&R?a.jsx(E2,{className:"helper--error",children:R}):null,fe=P=>{P&&!j&&_(!0),i==null||i(P),j&&v&&q(P.target.value)},W=(P,Y)=>{P&&!j&&_(!0),A==null||A(P,Y),j&&v&&q(Y)},te=(P,Y)=>{c==null||c(P,Y),P&&!j&&_(!0),j&&v&&(Array.isArray(P)?q(P):P&&typeof P=="object"&&"value"in P&&q(P.value))},re=(P,Y)=>{l==null||l(x,P,Y),P&&!j&&_(!0),j&&v&&q(P)},ve=P=>{D==null||D(x,P)},se=P=>{m==null||m(x,P),j||_(!0),v&&q(P)},ke=(P,Y)=>{f==null||f(P,Y),X(typeof Y=="string"?Y:"")},ne=P=>{V(Y=>!Y)},Z=P=>{if(L)return a.jsx(s.Skeleton,{variant:"rounded",height:34.69,animation:"wave"});switch(P.type){case"select":return a.jsx(m2,{children:a.jsx(oa,{...P,stackIndex:r,isScrollTarget:o,className:`formField__select ${R&&j?"formField__select--error":""} ${P.className||""}`,classNamePrefix:"hiverFormField",onBlur:G,onChange:te,onFocus:H,menuPortalTarget:n})});case"async-select":return a.jsx(m2,{children:a.jsx(GB,{...P,stackIndex:r,isScrollTarget:o,className:`formField__select ${R&&j?"formField__select--error":""} ${P.className||""}`,classNamePrefix:"hiverFormField",onBlur:G,onChange:te,onFocus:H,loadOptions:e==null?void 0:e.loadOptions,createOption:t==null?void 0:t.createOption,menuPortalTarget:n})});case"date":return a.jsx($B,{...P,label:void 0,onBlur:G,onFocus:H,onChange:re,error:!!(R&&j)});case"table":return a.jsx(to,{...P,value:P.value,onChange:ve,onFocus:H,onValidationError:ke,fetchConfig:e==null?void 0:e.loadOptionsList,createConfig:t==null?void 0:t.createOptionList,stackIndex:r});case"attachment":return a.jsx(Lw,{name:x,value:P.value,meta:P.meta,isRequired:w,onChange:se,upload:b,onToast:C});case"checkbox":return a.jsx(Vd,{...P,checked:!!P.value,onChange:W,onFocus:H,onBlur:G,styleOverrides:{marginTop:"2px"}});default:return a.jsx(jw,{variant:"outlined",fullWidth:!0,id:E,...P,value:P.value,label:void 0,onBlur:G,onChange:fe,onFocus:H,error:!!(R&&j),inputProps:{type:P.type,min:P.min,max:P.max,...P.inputProps}})}};return a.jsxs(Pw,{spacing:k,useFlexGap:!0,...T&&{className:`expandable ${z?"open":"close"}`},children:[a.jsx(s2,{label:F,htmlFor:E,isRequired:!!(d!=null&&d.isRequired)||w,prefixNode:T?a.jsx(_w,{children:a.jsx(Hw,{className:"arrow-icon"})}):null,...T&&{onClick:()=>ne()}}),a.jsxs(Qw,{className:"input-wrapper",children:[a.jsx(s.Tooltip,{title:p.toolTipTitle,arrow:!0,placement:"right-end",disableHoverListener:!0,children:Z(p)}),u!=null&&u.icon?a.jsx(s.Tooltip,{title:u.toolTipText,placement:"bottom",children:a.jsx(Rw,{className:"form--sideIcon",children:u==null?void 0:u.icon})}):null]}),ue()]})},Ww=s.styled(s.Stack)`
2206
2206
  & .authform__section-title {
2207
2207
  margin-top: 32px;
2208
2208
  margin-bottom: -12px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiver/connector-agent",
3
- "version": "4.22.10",
3
+ "version": "4.22.11-authCta-beta.0",
4
4
  "main": "index.es.js",
5
5
  "module": "index.es.js",
6
6
  "types": "index.d.ts",