@hiver/connector-admin 4.1.0 → 4.1.1-quickbooksHotfix-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.
package/index.es.js CHANGED
@@ -27483,7 +27483,7 @@ const Wk = {
27483
27483
  };
27484
27484
  Z0.ROW_ID = fo;
27485
27485
  const Jk = T(pe)`
27486
- box-sizing: content-box;
27486
+ box-sizing: border-box;
27487
27487
  &:not(:has(.${$i})) {
27488
27488
  transform: translate(0, 5px);
27489
27489
  padding-bottom: 5px;
package/index.umd.js CHANGED
@@ -1110,7 +1110,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1110
1110
  margin: var(--v-margin) var(--h-margin);
1111
1111
  }
1112
1112
  `,YP=({onChange:e,onFocus:t,onBlur:n,...r})=>{const A=(o,s)=>{e==null||e(o,s)};return u.jsx(zP,{onChange:A,onFocus:t,onBlur:n,...r})},JP="/v1/api"+"/templates/metadata",XP={GET:"GET",POST:"POST",DELETE:"DELETE",PATCH:"PATCH",PUT:"PUT"},UP=async e=>{const t=new URLSearchParams,{inboxIds:n,channelType:r,conversationId:A,fetchAuthenticatedConnectors:o}=e||{};return n==null||n.forEach(i=>{t.append("inbox_ids",i)}),[["channel_type",r],["conversation_id",A],["fetch_authenticated_connectors",o==null?void 0:o.toString()]].forEach(([i,a])=>{a!==void 0&&t.append(i,a)}),At({url:`${JP}?${t.toString()}`,method:XP.GET})};var Xd=(e=>(e.ADD="ADD",e.MULTIPLY="MULTIPLY",e))(Xd||{});const qP={[Xd.ADD]:(e,t)=>e+t,[Xd.MULTIPLY]:(e,t)=>e*t},ZP=e=>e,um=()=>{if("crypto"in window&&"randomUUID"in window.crypto)return window.crypto.randomUUID();const e=Date.now().toString(16),t=Math.random().toString(16).substring(2,8);return`${e}-${t}`},gm=(e,t)=>{let n;const r=qP[t]??ZP;for(const A of e){const o=Number(A);isNaN(o)||(n=n===void 0?o:r(n,o))}return(n??0).toFixed(2)},dm=({label:e,isRequired:t,prefixNode:n,...r})=>e?u.jsxs(g.Typography,{variant:"h4",component:"label",color:g.theme.palette.gray.gray1,className:"hiver__field--label",...r,children:[n,e,t?u.jsx("span",{className:"required__star",children:"*"}):null]}):null,KP=e=>_.createElement("svg",{width:"8px",height:"8px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5-1-1h-5l-1 1H5v2h14V4z"})),Cm=250,po="__id",Ra={isExpandable:!0,isExpanded:!0,defaultNumberOfRows:1,fixedRows:!1,cellWidth:Cm,arithmeticOperation:[]},Em=({name:e,value:t,data:n={},columns:r=[],validation:A={},meta:{defaultNumberOfRows:o=Ra.defaultNumberOfRows,fixedRows:s=Ra.fixedRows,cellWidth:i=Ra.cellWidth,arithmeticOperation:a=Ra.arithmeticOperation}=Ra,fetchConfig:l={},createConfig:c={},stackIndex:d,onChange:I=()=>{},onFocus:Q,onValidationError:f})=>{const C=t??[],E=(A==null?void 0:A.validations)??{},B=y.useRef(),p=y.useRef({}),[h,m]=y.useState({}),{colsLength:v,colsTemplate:x,colWidth:w}=y.useMemo(()=>{let D=0,O="";for(const k of r){let X=k.cols?Number(k.cols):1;isNaN(X)&&(X=1),D+=X,O+=`${k.cols??X}fr `}return s||(D+=.5,O+="0.5fr"),{colsLength:D,colsTemplate:O.trim(),colWidth:`${isNaN(i)?Cm:i}px`}},[r,i,s]),{fieldDependency:b,fieldConfigs:T}=y.useMemo(()=>{const D={},O={};for(const k of r){if(!k.valueConfig)continue;O[k.name]=k.valueConfig;const X=k.valueConfig.columnNames;for(const q of X)D[q]||(D[q]=[]),D[q].push(k.name)}return{fieldDependency:D,fieldConfigs:O}},[r]);y.useEffect(()=>{if(t)return;const D=[];for(let O=0;O<o;O++){const k=um();D.push({[po]:k})}I(D)},[t,I,o]);const j=()=>{const D=Object.entries(p.current).filter(O=>!!O[1])[0];return(D==null?void 0:D[1])??""},F=()=>{const D={[po]:um()};I([...C,D])},V=D=>{const O=C.filter(k=>k[po]!==D);I(O),m(k=>({...k,[D]:{}}));for(const k in p.current)k.startsWith(`${D}.`)&&delete p.current[k];f==null||f(e,j())},J=(D,{columnNames:O=[],operationType:k})=>{const X=O.map(q=>D[q]);return""+gm(X,k)},M=(D,O)=>{const k=C.map(X=>D!==X[po]?X:{...X,...O});I(k)},se=(D,O)=>{const k=C.map(X=>{if(D!==X[po])return X;const q={...X};for(const te of O)delete q[te];return q});I(k)},ue=(D,O,k,X)=>{var ce;const q=((ce=X==null?void 0:X.target)==null?void 0:ce.value)??"",te={...k,[O]:q};if(b[O])for(const ne of b[O]){const ie=J(te,T[ne]);te[ne]=ie}M(D,te)},he=(D,O,k)=>{M(D,{[O]:k})},me=(D,O,k,X)=>{if(k&&typeof k=="object"&&"value"in k&&typeof k.value=="string"&&typeof X.name<"u"){const q="prefillValues"in k&&k.prefillValues,te={...O,[X.name]:k.value,...q};for(const ce in te)if(b[ce])for(const ne of b[ce]){const ie=J(te,T[ne]);te[ne]=ie}M(D,te)}(X==null?void 0:X.action)==="clear"&&X.name&&se(D,[X.name])},oe=(D,O,k)=>{M(D,{[O]:(k==null?void 0:k.toISOString())??""})},H=(D,O,k,X)=>{X&&m(q=>{const te=q[D]??{};return{...q,[D]:{...te,[O]:k}}}),p.current={...p.current,[`${D}.${O}`]:typeof k=="string"?k:""},f==null||f(e,j())},G=D=>B.current===D;return u.jsxs(NP,{children:[u.jsx(kP,{ref:B,children:u.jsxs(FP,{gridColumns:x,minWidth:`calc( ${v} * ${w} )`,children:[u.jsx(MP,{children:r.map(({name:D,label:O,isRequired:k})=>u.jsx(Jd,{children:u.jsx(dm,{label:O,isRequired:k})},D))}),C.map(({[po]:D,...O})=>u.jsxs(lm,{children:[r.map(({name:k,key:X,...q})=>{var te;return u.jsx(Jd,{hasError:!!((te=h==null?void 0:h[D])!=null&&te[k]),children:u.jsx(Bm,{name:k,value:O[k],...q,className:gs,label:"",hideHelperText:!0,validation:E==null?void 0:E[k],onFocus:Q,inputChangeHandler:ce=>ue(D,k,O,ce),checkboxChangeHandler:(...ce)=>he(D,k,ce[1]),selectChangeHandler:(...ce)=>me(D,O,...ce),dateChangeHandler:(ce,ne)=>oe(D,ce,ne),onValidationError:(...ce)=>H(D,...ce),fetchConfig:l==null?void 0:l[k],createConfig:c==null?void 0:c[k],isScrollTarget:G,...d?{menuPortalTarget:document.body,stackIndex:d}:null})},k??X)}),s?null:u.jsx(Jd,{children:u.jsx(g.Stack,{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",children:u.jsx(cm,{onClick:()=>V(D),children:u.jsx(KP,{})})})})]},D))]})}),u.jsxs(PP,{children:[s?null:u.jsxs(jP,{onClick:F,children:[u.jsx(im,{}),u.jsx(g.Typography,{children:"Add Line"})]}),a.length?u.jsx(GP,{children:a.map(({label:D,columnName:O,operationType:k,prefix:X="",prefixKey:q,suffix:te="",suffixKey:ce})=>u.jsxs(VP,{children:[u.jsx(g.Typography,{fontWeight:500,children:D}),u.jsxs(g.Typography,{children:[u.jsxs("span",{children:[n[q]??X," "]}),u.jsx("span",{children:gm(C.map(ne=>ne[O]),k)}),u.jsx("span",{children:n[ce]??te})]})]},D))}):null]})]})};Em.ROW_ID=po;const $P=g.styled(g.Box)`
1113
- box-sizing: content-box;
1113
+ box-sizing: border-box;
1114
1114
  &:not(:has(.${gs})) {
1115
1115
  transform: translate(0, 5px);
1116
1116
  padding-bottom: 5px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiver/connector-admin",
3
- "version": "4.1.0",
3
+ "version": "4.1.1-quickbooksHotfix-beta.0",
4
4
  "main": "index.es.js",
5
5
  "module": "index.es.js",
6
6
  "types": "index.d.ts",