@hiver/connector-agent 3.1.11-quickbooksFix-beta.0 → 4.0.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
@@ -12378,7 +12378,7 @@ const kx = D(Up)`
12378
12378
  };
12379
12379
  hs.ROW_ID = Un;
12380
12380
  const Bx = D(ve)`
12381
- box-sizing: border-box;
12381
+ box-sizing: content-box;
12382
12382
  &:not(:has(.${Qr})) {
12383
12383
  transform: translate(0, 5px);
12384
12384
  padding-bottom: 5px;
package/index.umd.js CHANGED
@@ -666,7 +666,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
666
666
  margin: var(--v-margin) var(--h-margin);
667
667
  }
668
668
  `,KI=({onChange:e,onFocus:t,onBlur:n,...r})=>{const o=(s,i)=>{e==null||e(s,i)};return E.jsx(qI,{onChange:o,onFocus:t,onBlur:n,...r})},Cf=({label:e,isRequired:t,prefixNode:n,...r})=>e?E.jsxs(I.Typography,{variant:"h4",component:"label",color:I.theme.palette.gray.gray1,className:"hiver__field--label",...r,children:[n,e,t?E.jsx("span",{className:"required__star",children:"*"}):null]}):null,ex=e=>G.createElement("svg",{width:"8px",height:"8px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...e},G.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"})),If=250,Vn="__id",lo={isExpandable:!0,isExpanded:!0,defaultNumberOfRows:1,fixedRows:!1,cellWidth:If,arithmeticOperation:[]},Fs=({name:e,value:t,data:n={},columns:r=[],validation:o={},meta:{defaultNumberOfRows:s=lo.defaultNumberOfRows,fixedRows:i=lo.fixedRows,cellWidth:a=lo.cellWidth,arithmeticOperation:l=lo.arithmeticOperation}=lo,fetchConfig:c={},createConfig:u={},stackIndex:p,onChange:m=()=>{},onFocus:C,onValidationError:g})=>{const d=t??[],f=(o==null?void 0:o.validations)??{},h=S.useRef(),y=S.useRef({}),[b,x]=S.useState({}),{colsLength:v,colsTemplate:w,colWidth:T}=S.useMemo(()=>{let M=0,V="";for(const B of r){let H=B.cols?Number(B.cols):1;isNaN(H)&&(H=1),M+=H,V+=`${B.cols??H}fr `}return i||(M+=.5,V+="0.5fr"),{colsLength:M,colsTemplate:V.trim(),colWidth:`${isNaN(a)?If:a}px`}},[r,a,i]),{fieldDependency:A,fieldConfigs:_}=S.useMemo(()=>{const M={},V={};for(const B of r){if(!B.valueConfig)continue;V[B.name]=B.valueConfig;const H=B.valueConfig.columnNames;for(const $ of H)M[$]||(M[$]=[]),M[$].push(B.name)}return{fieldDependency:M,fieldConfigs:V}},[r]);S.useEffect(()=>{if(t)return;const M=[];for(let V=0;V<s;V++){const B=Pu();M.push({[Vn]:B})}m(M)},[t,m,s]);const N=()=>{const M=Object.entries(y.current).filter(V=>!!V[1])[0];return(M==null?void 0:M[1])??""},R=()=>{const M={[Vn]:Pu()};m([...d,M])},F=M=>{const V=d.filter(B=>B[Vn]!==M);m(V),x(B=>({...B,[M]:{}}));for(const B in y.current)B.startsWith(`${M}.`)&&delete y.current[B];g==null||g(e,N())},k=(M,{columnNames:V=[],operationType:B})=>{const H=V.map($=>M[$]);return""+Mu(H,B)},Z=(M,V)=>{const B=d.map(H=>M!==H[Vn]?H:{...H,...V});m(B)},X=(M,V)=>{const B=d.map(H=>{if(M!==H[Vn])return H;const $={...H};for(const re of V)delete $[re];return $});m(B)},z=(M,V,B,H)=>{var K;const $=((K=H==null?void 0:H.target)==null?void 0:K.value)??"",re={...B,[V]:$};if(A[V])for(const P of A[V]){const ee=k(re,_[P]);re[P]=ee}Z(M,re)},te=(M,V,B)=>{Z(M,{[V]:B})},Y=(M,V,B,H)=>{if(B&&typeof B=="object"&&"value"in B&&typeof B.value=="string"&&typeof H.name<"u"){const $="prefillValues"in B&&B.prefillValues,re={...V,[H.name]:B.value,...$};for(const K in re)if(A[K])for(const P of A[K]){const ee=k(re,_[P]);re[P]=ee}Z(M,re)}(H==null?void 0:H.action)==="clear"&&H.name&&X(M,[H.name])},U=(M,V,B)=>{Z(M,{[V]:(B==null?void 0:B.toISOString())??""})},ae=(M,V,B,H)=>{H&&x($=>{const re=$[M]??{};return{...$,[M]:{...re,[V]:B}}}),y.current={...y.current,[`${M}.${V}`]:typeof B=="string"?B:""},g==null||g(e,N())},ce=M=>h.current===M;return E.jsxs(HI,{children:[E.jsx(WI,{ref:h,children:E.jsxs(ZI,{gridColumns:w,minWidth:`calc( ${v} * ${T} )`,children:[E.jsx(zI,{children:r.map(({name:M,label:V,isRequired:B})=>E.jsx(_a,{children:E.jsx(Cf,{label:V,isRequired:B})},M))}),d.map(({[Vn]:M,...V})=>E.jsxs(yf,{children:[r.map(({name:B,key:H,...$})=>{var re;return E.jsx(_a,{hasError:!!((re=b==null?void 0:b[M])!=null&&re[B]),children:E.jsx(uo,{name:B,value:V[B],...$,className:br,label:"",hideHelperText:!0,validation:f==null?void 0:f[B],onFocus:C,inputChangeHandler:K=>z(M,B,V,K),checkboxChangeHandler:(...K)=>te(M,B,K[1]),selectChangeHandler:(...K)=>Y(M,V,...K),dateChangeHandler:(K,P)=>U(M,K,P),onValidationError:(...K)=>ae(M,...K),fetchConfig:c==null?void 0:c[B],createConfig:u==null?void 0:u[B],isScrollTarget:ce,...p?{menuPortalTarget:document.body,stackIndex:p}:null})},B??H)}),i?null:E.jsx(_a,{children:E.jsx(I.Stack,{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",children:E.jsx(vf,{onClick:()=>F(M),children:E.jsx(ex,{})})})})]},M))]})}),E.jsxs(XI,{children:[i?null:E.jsxs(YI,{onClick:R,children:[E.jsx(bf,{}),E.jsx(I.Typography,{children:"Add Line"})]}),l.length?E.jsx(JI,{children:l.map(({label:M,columnName:V,operationType:B,prefix:H="",prefixKey:$,suffix:re="",suffixKey:K})=>E.jsxs(QI,{children:[E.jsx(I.Typography,{fontWeight:500,children:M}),E.jsxs(I.Typography,{children:[E.jsxs("span",{children:[n[$]??H," "]}),E.jsx("span",{children:Mu(d.map(P=>P[V]),B)}),E.jsx("span",{children:n[K]??re})]})]},M))}):null]})]})};Fs.ROW_ID=Vn;const tx=I.styled(I.Box)`
669
- box-sizing: border-box;
669
+ box-sizing: content-box;
670
670
  &:not(:has(.${br})) {
671
671
  transform: translate(0, 5px);
672
672
  padding-bottom: 5px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiver/connector-agent",
3
- "version": "3.1.11-quickbooksFix-beta.0",
3
+ "version": "4.0.0",
4
4
  "main": "index.es.js",
5
5
  "module": "index.es.js",
6
6
  "types": "index.d.ts",