go-xcel-interpret 1.3.1 → 1.3.2
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.
|
@@ -830,4 +830,4 @@ the last node, the show column modification can be applied.`);const{crossHiddenC
|
|
|
830
830
|
height: 100%;
|
|
831
831
|
display: flex;
|
|
832
832
|
flex-direction: column;
|
|
833
|
-
`,ome=({clientId:t,templateId:e,onData:r,options:n})=>{const{lastMessage:i}=kB(Gj(_k.applyActions,n),{queryParams:{Authorization:`Bearer ${t}`,"X-ws-identifier":e}});return ie.useEffect(()=>{r==null||r(i==null?void 0:i.data)},[i==null?void 0:i.data]),he.jsx(he.Fragment,{})};function sme({token:t,identity:e,apiBaseUrl:r,protocol:n,waitKeyboard:i=1500,config:o,activeOptions:s,textLoading:a,updateMode:l="single",saveAuto:u=!0,overlay:c=!1,onTabs:h}){var re;ad.API_GO_XCEL_HOST=`${r}`;const[d,f]=ie.useState(!0),[g,w]=ie.useState(!1),v=ie.useRef([]),[b,p]=ie.useState(),{tabs:_,activeKey:O,setActiveKey:T,addTab:M,removeTab:I,updateTab:X,setTabs:z}=zj(),H=K=>{let Q=K;if(l==="single"){const oe=v.current;if(oe.length===0)return[];const le=new Set(oe.map(m=>m.item)),j=[];K.forEach(m=>{const C=[];m.items.forEach(y=>{if(y.type!=="form"&&y.type!=="table")return;const P=y.items.filter(x=>le.has(x));P.length>0&&C.push({...y,items:P})}),C.length>0&&j.push({...m,items:C})}),Q=j}return Q},Y=async K=>{const Q=H(K);if(l==="single")if(Q.length>0)v.current=[];else return;Q.length>0&&ce(Q)},[ee]=jj(Y,i),ce=async K=>{w(!0),ad.applyAction(t,{template__uuid:`${b==null?void 0:b.uuid}`,actions:K}).catch(Q=>{console.error(Q)}).finally(()=>{w(!1)})},J=(K,Q)=>{z(K==null?void 0:K.map((oe,le)=>({...oe,items:oe.items.map((j,m)=>({...j,items:j.items.map((C,y)=>{var P,x,N,B;return{...C,value:(C==null?void 0:C.value)??((B=(N=(x=(P=Q==null?void 0:Q[le])==null?void 0:P.items)==null?void 0:x[m])==null?void 0:N.items[y])==null?void 0:B.value)??void 0}})}))})))},Z=async()=>{f(!0),ad.readTemplateIdentity(t,e).then(K=>{p(K);const{configuration:Q}=(K==null?void 0:K.template_configuration)??{},oe=K.values;Q&&J(Q,oe)}).catch(K=>{console.error(K)}).finally(()=>{f(!1)})};return ie.useEffect(()=>{Z()},[]),he.jsxs(ime,{children:[he.jsx(qj,{primary:(re=o==null?void 0:o.theme)==null?void 0:re.primaryColor}),b&&he.jsx(ome,{options:{apiBaseUrl:`${r}`,protocol:n},onData:K=>{if(K){const Q=JSON.parse(K);J(Q.notification)}},clientId:t,templateId:b.uuid}),d?he.jsx(rme,{children:he.jsx(Qj,{text:a,theme:o==null?void 0:o.theme})}):he.jsxs("div",{style:{position:"relative"},children:[g&&c&&he.jsx(nme,{}),he.jsx(tme,{activeOptions:s,config:o,activeKey:O,setActiveKey:K=>T(K),addTab:M,removeTab:I,updateTab:(K,Q,oe)=>{const le=X(K,Q);oe&&v.current.push({sheetIndex:K,item:oe})
|
|
833
|
+
`,ome=({clientId:t,templateId:e,onData:r,options:n})=>{const{lastMessage:i}=kB(Gj(_k.applyActions,n),{queryParams:{Authorization:`Bearer ${t}`,"X-ws-identifier":e}});return ie.useEffect(()=>{r==null||r(i==null?void 0:i.data)},[i==null?void 0:i.data]),he.jsx(he.Fragment,{})};function sme({token:t,identity:e,apiBaseUrl:r,protocol:n,waitKeyboard:i=1500,config:o,activeOptions:s,textLoading:a,updateMode:l="single",saveAuto:u=!0,overlay:c=!1,onTabs:h}){var re;ad.API_GO_XCEL_HOST=`${r}`;const[d,f]=ie.useState(!0),[g,w]=ie.useState(!1),v=ie.useRef([]),[b,p]=ie.useState(),{tabs:_,activeKey:O,setActiveKey:T,addTab:M,removeTab:I,updateTab:X,setTabs:z}=zj(),H=K=>{let Q=K;if(l==="single"){const oe=v.current;if(oe.length===0)return[];const le=new Set(oe.map(m=>m.item)),j=[];K.forEach(m=>{const C=[];m.items.forEach(y=>{if(y.type!=="form"&&y.type!=="table")return;const P=y.items.filter(x=>le.has(x));P.length>0&&C.push({...y,items:P})}),C.length>0&&j.push({...m,items:C})}),Q=j}return Q},Y=async K=>{const Q=H(K);if(l==="single")if(Q.length>0)v.current=[];else return;Q.length>0&&ce(Q)},[ee]=jj(Y,i),ce=async K=>{w(!0),ad.applyAction(t,{template__uuid:`${b==null?void 0:b.uuid}`,actions:K}).catch(Q=>{console.error(Q)}).finally(()=>{w(!1)})},J=(K,Q)=>{z(K==null?void 0:K.map((oe,le)=>({...oe,items:oe.items.map((j,m)=>({...j,items:j.items.map((C,y)=>{var P,x,N,B;return{...C,value:(C==null?void 0:C.value)??((B=(N=(x=(P=Q==null?void 0:Q[le])==null?void 0:P.items)==null?void 0:x[m])==null?void 0:N.items[y])==null?void 0:B.value)??void 0}})}))})))},Z=async()=>{f(!0),ad.readTemplateIdentity(t,e).then(K=>{p(K);const{configuration:Q}=(K==null?void 0:K.template_configuration)??{},oe=K.values;Q&&J(Q,oe)}).catch(K=>{console.error(K)}).finally(()=>{f(!1)})};return ie.useEffect(()=>{Z()},[]),ie.useEffect(()=>{!d&&!u&&(()=>{h&&h(_,Y)})()},[d,u]),he.jsxs(ime,{children:[he.jsx(qj,{primary:(re=o==null?void 0:o.theme)==null?void 0:re.primaryColor}),b&&he.jsx(ome,{options:{apiBaseUrl:`${r}`,protocol:n},onData:K=>{if(K){const Q=JSON.parse(K);J(Q.notification)}},clientId:t,templateId:b.uuid}),d?he.jsx(rme,{children:he.jsx(Qj,{text:a,theme:o==null?void 0:o.theme})}):he.jsxs("div",{style:{position:"relative"},children:[g&&c&&he.jsx(nme,{}),he.jsx(tme,{activeOptions:s,config:o,activeKey:O,setActiveKey:K=>T(K),addTab:M,removeTab:I,updateTab:(K,Q,oe)=>{const le=X(K,Q);if(oe&&v.current.push({sheetIndex:K,item:oe}),h){const j=H(le);h(j,Y)}u&&ee(le)},tabs:_},_.length)]})]})}function ame(t){return he.jsx(sme,{...t})}exports.GoXcelInterpret=ame;
|