@hiver/connector-admin 4.17.2-attachment-beta.0 → 4.17.2-attachment-beta.1
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/index.es.js +1 -1
- package/index.umd.js +1 -1
- package/package.json +1 -1
package/index.es.js
CHANGED
|
@@ -30444,7 +30444,7 @@ const Z2 = ({
|
|
|
30444
30444
|
const [B, Q] = re({}), [m, y] = re({}), [v, b] = re(!1), x = Se(() => L2(500), []), D = Se(() => {
|
|
30445
30445
|
if (!Array.isArray(r) || !r.length) return [];
|
|
30446
30446
|
const K = /* @__PURE__ */ new Set();
|
|
30447
|
-
return r.filter((ge) => K.has(ge.name) ? !1 : (K.add(ge.name), !0)).sort((ge, Y) => ge.priority - Y.priority);
|
|
30447
|
+
return r.filter((ge) => ge.type === "attachment" || K.has(ge.name) ? !1 : (K.add(ge.name), !0)).sort((ge, Y) => ge.priority - Y.priority);
|
|
30448
30448
|
}, [r]), _ = ({ name: K, value: $ }) => {
|
|
30449
30449
|
y((ge) => {
|
|
30450
30450
|
const Y = { ...ge };
|
package/index.umd.js
CHANGED
|
@@ -1835,7 +1835,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1835
1835
|
display: inline-block;
|
|
1836
1836
|
color: inherit;
|
|
1837
1837
|
}
|
|
1838
|
-
`,Zj={borderRadius:"0 !important",padding:"0 !important",width:"max-content !important",maxWidth:"max-content !important",height:"100% !important",maxHeight:"100% !important",position:"fixed",boxSizing:"border-box !important",top:0,bottom:0,right:0,margin:0};function Uj(e){return e.name??e.rowId}const qm=({open:e,onClose:t,formId:n,fields:r,variables:o,connectorLogo:A,isSaving:s,title:a,isLoading:i=!1,defaultValues:u,customFields:g,checkMandatory:d=!1,className:f,customFieldsInDropdown:B=!0,showInfo:I=!0,fetchOptions:C,onSave:E,onCancel:h,onFieldChange:p})=>{const[Q,y]=m.useState({}),[b,w]=m.useState({}),[v,x]=m.useState(!1),S=m.useMemo(()=>ym(500),[]),L=m.useMemo(()=>{if(!Array.isArray(r)||!r.length)return[];const q=new Set;return r.filter(ie=>q.has(ie.name)?!1:(q.add(ie.name),!0)).sort((ie,J)=>ie.priority-J.priority)},[r]),O=({name:q,value:$})=>{w(ie=>{const J={...ie};return $?J[q]=$:delete J[q],J})};m.useEffect(()=>{u&&e&&y({...u})},[u,e]),m.useEffect(()=>()=>{e||(y({}),w({}))},[e]),m.useEffect(()=>{d&&S(()=>{const $=r.filter(ie=>{var J;return!!((J=ie.validations)!=null&&J.isRequired)}).filter(ie=>!Q[ie.name]);x($.length>0)})},[S,Q,r,d]);const F=()=>{t(),y({})},G=()=>{h==null||h(),y({}),t()},D=()=>{const q={...Q};for(const $ in q){const ie=q[$];(ie===""||ie===null||ie===void 0)&&delete q[$]}E(q)},z=Object.keys(b).length>0||v;return l.jsx(c.Dialog,{className:f,open:e,onClose:F,PaperProps:{sx:Zj},maxWidth:!1,children:i?l.jsx(c.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:"615px"},children:l.jsx(c.CircularProgress,{})}):l.jsxs(Gj,{children:[l.jsxs(Hj,{children:[l.jsxs(c.Stack,{direction:"row",alignItems:"center",gap:2,children:[l.jsx(Rj,{}),l.jsx(c.Stack,{gap:.5,flex:1,minWidth:0,children:l.jsxs(c.Stack,{direction:"row",alignItems:"center",gap:.5,children:[l.jsx(c.Typography,{variant:"h6",fontSize:18,fontWeight:600,color:c.theme.palette.gray.gray1,children:a}),I&&l.jsx(c.Tooltip,{title:"Set default values to have them pre-filled every time you create a task.",placement:"top",slotProps:{tooltip:{sx:{maxWidth:"260px !important"}}},children:l.jsx(c.IconButton,{size:"small","aria-label":"About mapping fields",sx:{padding:"4px"},children:l.jsx(c.icons.InfoOutlined,{sx:{fontSize:18,color:c.theme.palette.gray.gray3}})})})]})})]}),l.jsx(c.Tooltip,{title:"Close",placement:"bottom",children:l.jsx(c.IconButton,{onClick:F,size:"small","aria-label":"Close",children:l.jsx(c.icons.Close,{sx:{fontSize:20}})})})]}),l.jsx(Wj,{children:l.jsxs(zj,{children:[l.jsxs(c.Stack,{direction:"row",padding:"16px 24px",sx:{backgroundColor:c.theme.palette.gray.gray6a,borderBottom:"1px solid #ECEFF6",borderRadius:"8px 8px 0 0"},children:[l.jsx(jj,{src:A,alt:"Connector"}),l.jsx(c.Typography,{variant:"caption",fontSize:14,fontWeight:600,color:c.theme.palette.gray.gray3,flex:1,children:"Field"}),l.jsx(c.Typography,{variant:"caption",fontSize:14,fontWeight:600,color:c.theme.palette.gray.gray3,width:320,children:"Value"})]}),L.map((q,$)=>{var N;const ie=Uj(q),J=Q[ie]??"";return l.jsxs(c.Stack,{direction:"row",alignItems:"center",padding:"24px",gap:2,sx:{borderBottom:$<L.length-1?"1px solid #F6F8FC":void 0,"&:last-child":{borderBottom:"none"}},children:[l.jsx(Xj,{children:l.jsxs(c.Typography,{variant:"body2",fontSize:14,color:c.theme.palette.gray.gray2,children:[q.label,d&&((N=q.validations)!=null&&N.isRequired)?l.jsx(qj,{}):null]})}),l.jsx(Vj,{width:20,height:20}),l.jsx(Jj,{children:l.jsx(Pj,{field:q,formId:String(n),value:J,formValues:Q,variables:o,customFields:g,errors:b,checkMandatory:d,customFieldsInDropdown:B,setError:O,fetchOptions:C,setFormValues:y,onFieldChange:p})})]},ie)})]})}),l.jsxs(Yj,{children:[l.jsx(c.Button,{variant:"contained",onClick:D,sx:{textTransform:"none",padding:"3px 32px !important"},disabled:s||z,children:"Save"}),l.jsx(c.Button,{variant:"outlined",color:"inherit",onClick:G,disabled:s,sx:{textTransform:"none",padding:"3px 12px !important",borderColor:c.theme.palette.gray.gray5},children:"Cancel"})]})]})})};c.styled(c.Box)`
|
|
1838
|
+
`,Zj={borderRadius:"0 !important",padding:"0 !important",width:"max-content !important",maxWidth:"max-content !important",height:"100% !important",maxHeight:"100% !important",position:"fixed",boxSizing:"border-box !important",top:0,bottom:0,right:0,margin:0};function Uj(e){return e.name??e.rowId}const qm=({open:e,onClose:t,formId:n,fields:r,variables:o,connectorLogo:A,isSaving:s,title:a,isLoading:i=!1,defaultValues:u,customFields:g,checkMandatory:d=!1,className:f,customFieldsInDropdown:B=!0,showInfo:I=!0,fetchOptions:C,onSave:E,onCancel:h,onFieldChange:p})=>{const[Q,y]=m.useState({}),[b,w]=m.useState({}),[v,x]=m.useState(!1),S=m.useMemo(()=>ym(500),[]),L=m.useMemo(()=>{if(!Array.isArray(r)||!r.length)return[];const q=new Set;return r.filter(ie=>ie.type==="attachment"||q.has(ie.name)?!1:(q.add(ie.name),!0)).sort((ie,J)=>ie.priority-J.priority)},[r]),O=({name:q,value:$})=>{w(ie=>{const J={...ie};return $?J[q]=$:delete J[q],J})};m.useEffect(()=>{u&&e&&y({...u})},[u,e]),m.useEffect(()=>()=>{e||(y({}),w({}))},[e]),m.useEffect(()=>{d&&S(()=>{const $=r.filter(ie=>{var J;return!!((J=ie.validations)!=null&&J.isRequired)}).filter(ie=>!Q[ie.name]);x($.length>0)})},[S,Q,r,d]);const F=()=>{t(),y({})},G=()=>{h==null||h(),y({}),t()},D=()=>{const q={...Q};for(const $ in q){const ie=q[$];(ie===""||ie===null||ie===void 0)&&delete q[$]}E(q)},z=Object.keys(b).length>0||v;return l.jsx(c.Dialog,{className:f,open:e,onClose:F,PaperProps:{sx:Zj},maxWidth:!1,children:i?l.jsx(c.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:"615px"},children:l.jsx(c.CircularProgress,{})}):l.jsxs(Gj,{children:[l.jsxs(Hj,{children:[l.jsxs(c.Stack,{direction:"row",alignItems:"center",gap:2,children:[l.jsx(Rj,{}),l.jsx(c.Stack,{gap:.5,flex:1,minWidth:0,children:l.jsxs(c.Stack,{direction:"row",alignItems:"center",gap:.5,children:[l.jsx(c.Typography,{variant:"h6",fontSize:18,fontWeight:600,color:c.theme.palette.gray.gray1,children:a}),I&&l.jsx(c.Tooltip,{title:"Set default values to have them pre-filled every time you create a task.",placement:"top",slotProps:{tooltip:{sx:{maxWidth:"260px !important"}}},children:l.jsx(c.IconButton,{size:"small","aria-label":"About mapping fields",sx:{padding:"4px"},children:l.jsx(c.icons.InfoOutlined,{sx:{fontSize:18,color:c.theme.palette.gray.gray3}})})})]})})]}),l.jsx(c.Tooltip,{title:"Close",placement:"bottom",children:l.jsx(c.IconButton,{onClick:F,size:"small","aria-label":"Close",children:l.jsx(c.icons.Close,{sx:{fontSize:20}})})})]}),l.jsx(Wj,{children:l.jsxs(zj,{children:[l.jsxs(c.Stack,{direction:"row",padding:"16px 24px",sx:{backgroundColor:c.theme.palette.gray.gray6a,borderBottom:"1px solid #ECEFF6",borderRadius:"8px 8px 0 0"},children:[l.jsx(jj,{src:A,alt:"Connector"}),l.jsx(c.Typography,{variant:"caption",fontSize:14,fontWeight:600,color:c.theme.palette.gray.gray3,flex:1,children:"Field"}),l.jsx(c.Typography,{variant:"caption",fontSize:14,fontWeight:600,color:c.theme.palette.gray.gray3,width:320,children:"Value"})]}),L.map((q,$)=>{var N;const ie=Uj(q),J=Q[ie]??"";return l.jsxs(c.Stack,{direction:"row",alignItems:"center",padding:"24px",gap:2,sx:{borderBottom:$<L.length-1?"1px solid #F6F8FC":void 0,"&:last-child":{borderBottom:"none"}},children:[l.jsx(Xj,{children:l.jsxs(c.Typography,{variant:"body2",fontSize:14,color:c.theme.palette.gray.gray2,children:[q.label,d&&((N=q.validations)!=null&&N.isRequired)?l.jsx(qj,{}):null]})}),l.jsx(Vj,{width:20,height:20}),l.jsx(Jj,{children:l.jsx(Pj,{field:q,formId:String(n),value:J,formValues:Q,variables:o,customFields:g,errors:b,checkMandatory:d,customFieldsInDropdown:B,setError:O,fetchOptions:C,setFormValues:y,onFieldChange:p})})]},ie)})]})}),l.jsxs(Yj,{children:[l.jsx(c.Button,{variant:"contained",onClick:D,sx:{textTransform:"none",padding:"3px 32px !important"},disabled:s||z,children:"Save"}),l.jsx(c.Button,{variant:"outlined",color:"inherit",onClick:G,disabled:s,sx:{textTransform:"none",padding:"3px 12px !important",borderColor:c.theme.palette.gray.gray5},children:"Cancel"})]})]})})};c.styled(c.Box)`
|
|
1839
1839
|
position: fixed;
|
|
1840
1840
|
inset: 0;
|
|
1841
1841
|
z-index: ${({zIndex:e})=>e};
|