@zealicsolutions/web-ui 1.0.140-beta.81 → 1.0.140-beta.83
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/dist/cjs/containers/ReplicatorContainer/ReplicatorFormSetup.d.ts +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/containers/ReplicatorContainer/ReplicatorContainer.js +1 -1
- package/dist/esm/containers/ReplicatorContainer/ReplicatorContainer.js.map +1 -1
- package/dist/esm/containers/ReplicatorContainer/ReplicatorFormSetup.d.ts +1 -1
- package/dist/esm/containers/ReplicatorContainer/ReplicatorFormSetup.js +1 -1
- package/dist/esm/containers/ReplicatorContainer/ReplicatorFormSetup.js.map +1 -1
- package/dist/esm/molecules/Button/hooks/useButtonAction.js +1 -1
- package/dist/esm/molecules/Button/hooks/useButtonAction.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t,Fragment as e}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import{memo as o}from"react";import"../../contexts/AccountButtonContext/AccountButtonContext.js";import"../../contexts/ApiContext/ApiContext.js";import{useContainerRuntime as n}from"../../contexts/ContainerRuntimeContext/ContainerRuntimeContext.js";import{ContainerRuntimeContextProvider as r}from"../../contexts/ContainerRuntimeContext/ContainerRuntimeContextProvider.js";import"../../contexts/FormStepContext/FormStepContext.js";import"../../contexts/LayoutContext/LayoutContext.js";import"../../theme/theme.js";import"../../theme/provider.js";import"../../theme/toastStyles.js";import"../../contexts/MlrRichTextViewerContext/MlrRichTextViewerContext.js";import"../../contexts/OrganismContext/OrganismContext.js";import{useOrganismContext as i}from"../../contexts/OrganismContext/useOrganismContext.js";import"../../contexts/PopupContext/PopupContext.js";import{useReplicatorForm as a}from"../../contexts/ReplicatorFormContext/ReplicatorFormContext.js";import"../../contexts/ReplicatorRegistryContext/ReplicatorRegistryContext.js";import"../../contexts/StateContext/StateContext.js";import"../../contexts/WebpageContext/WebpageContext.js";import{getDataByPath as m}from"../utils/dataPathUtils.js";const s=t=>t&&"object"==typeof t&&"value"in t&&!Array.isArray(t)?t.value:t,d=t=>{const e={};for(const[o,n]of Object.entries(t))e[o]=s(n);return e},c=o(({replicatorFieldId:o,nestedPathSegments:s=[],children:c,renderWrapper:x})=>{const{localStateObject:p,formId:l}=i(),f=n(),u=a();if(Boolean(l&&u)&&u){const{fieldArrayMethods:n}=u,{fields:i}=n;return t(e,{children:i.map((e,n)=>{const i=
|
|
1
|
+
import{jsx as t,Fragment as e}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import{memo as o}from"react";import"../../contexts/AccountButtonContext/AccountButtonContext.js";import"../../contexts/ApiContext/ApiContext.js";import{useContainerRuntime as n}from"../../contexts/ContainerRuntimeContext/ContainerRuntimeContext.js";import{ContainerRuntimeContextProvider as r}from"../../contexts/ContainerRuntimeContext/ContainerRuntimeContextProvider.js";import"../../contexts/FormStepContext/FormStepContext.js";import"../../contexts/LayoutContext/LayoutContext.js";import"../../theme/theme.js";import"../../theme/provider.js";import"../../theme/toastStyles.js";import"../../contexts/MlrRichTextViewerContext/MlrRichTextViewerContext.js";import"../../contexts/OrganismContext/OrganismContext.js";import{useOrganismContext as i}from"../../contexts/OrganismContext/useOrganismContext.js";import"../../contexts/PopupContext/PopupContext.js";import{useReplicatorForm as a}from"../../contexts/ReplicatorFormContext/ReplicatorFormContext.js";import"../../contexts/ReplicatorRegistryContext/ReplicatorRegistryContext.js";import"../../contexts/StateContext/StateContext.js";import"../../contexts/WebpageContext/WebpageContext.js";import{getDataByPath as m}from"../utils/dataPathUtils.js";const s=t=>t&&"object"==typeof t&&"value"in t&&!Array.isArray(t)?t.value:t,d=t=>{const e={};for(const[o,n]of Object.entries(t))e[o]=s(n);return e},c=o(({replicatorFieldId:o,nestedPathSegments:s=[],children:c,renderWrapper:x})=>{const{localStateObject:p,formId:l}=i(),f=n(),u=a();if(Boolean(l&&u)&&u){const{fieldArrayMethods:n}=u,{fields:i}=n;return t(e,{children:i.map((e,n)=>{const i=[...s,{dmfId:o||"default",index:n}],a={containerId:`replicator-${o||"default"}-${n}`,nestedPathSegments:i,itemIndex:n,itemDataByDmfId:e,rawItemDataByDmfId:e},m=x?x(n,c):c;return t("div",{"data-replicator-instance":`${o||"default"}-${n}`,children:t(r,{value:a,children:m})},e.id)})})}const C=p||{},j=f?.itemDataByDmfId?f.itemDataByDmfId:m(C,s),I=o?j?.[o]:j;if(!I||"object"!=typeof I){const e=o?[...s,{dmfId:o}]:s;return t(r,{value:{containerId:`replicator-${o||"default"}`,nestedPathSegments:e,itemDataByDmfId:{}},children:x?x(void 0,c):c})}if(Array.isArray(I))return t(e,{children:I.map((e,n)=>{const i=[...s,{dmfId:o||"default",index:n}],a={containerId:`replicator-${o||"default"}-${n}`,nestedPathSegments:i,itemIndex:n,itemDataByDmfId:d(e),rawItemDataByDmfId:e};return t(r,{value:a,children:x?x(n,c):c},`${o||"default"}-${n}`)})});const h=o?[...s,{dmfId:o}]:s,y={containerId:`replicator-${o||"default"}`,nestedPathSegments:h,itemDataByDmfId:d(I),rawItemDataByDmfId:I};return t(r,{value:y,children:x?x(void 0,c):c})});export{c as ReplicatorContainer};
|
|
2
2
|
//# sourceMappingURL=ReplicatorContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReplicatorContainer.js","sources":["../../../../../src/containers/ReplicatorContainer/ReplicatorContainer.tsx"],"sourcesContent":[null],"names":["unwrapScalarValue","value","Array","isArray","unwrapDmfData","data","unwrapped","key","Object","entries","ReplicatorContainer","memo","replicatorFieldId","nestedPathSegments","children","renderWrapper","localStateObject","formId","useOrganismContext","parentContext","useContainerRuntime","replicatorFormContext","useReplicatorForm","Boolean","fieldArrayMethods","fields","_jsx","_Fragment","map","field","index","newPathSegments","dmfId","contextValue","containerId","itemIndex","itemDataByDmfId","rawItemDataByDmfId","instanceContent","ContainerRuntimeContextProvider","
|
|
1
|
+
{"version":3,"file":"ReplicatorContainer.js","sources":["../../../../../src/containers/ReplicatorContainer/ReplicatorContainer.tsx"],"sourcesContent":[null],"names":["unwrapScalarValue","value","Array","isArray","unwrapDmfData","data","unwrapped","key","Object","entries","ReplicatorContainer","memo","replicatorFieldId","nestedPathSegments","children","renderWrapper","localStateObject","formId","useOrganismContext","parentContext","useContainerRuntime","replicatorFormContext","useReplicatorForm","Boolean","fieldArrayMethods","fields","_jsx","_Fragment","map","field","index","newPathSegments","dmfId","contextValue","containerId","itemIndex","itemDataByDmfId","rawItemDataByDmfId","instanceContent","ContainerRuntimeContextProvider","id","dataRoot","currentScope","getDataByPath","undefined","item"],"mappings":"uyCAYA,MAAMA,EAAqBC,GACrBA,GAA0B,iBAAVA,GAAsB,UAAWA,IAAUC,MAAMC,QAAQF,GAEnEA,EAA6BA,MAGhCA,EAMHG,EAAiBC,IACrB,MAAMC,EAAqC,CAAA,EAE3C,IAAK,MAAOC,EAAKN,KAAUO,OAAOC,QAAQJ,GACxCC,EAAUC,GAAOP,EAAkBC,GAGrC,OAAOK,GAkBII,EAAsBC,EACjC,EAAGC,oBAAmBC,qBAAqB,GAAIC,WAAUC,oBACvD,MAAMC,iBAAEA,EAAgBC,OAAEA,GAAWC,IAC/BC,EAAgBC,IAChBC,EAAwBC,IAQ9B,GALmBC,QAAQN,GAAUI,IAKnBA,EAAuB,CACvC,MAAMG,kBAAEA,GAAsBH,GACxBI,OAAEA,GAAWD,EAEnB,OACEE,EACGC,EAAA,CAAAb,SAAAW,EAAOG,IAAI,CAACC,EAAOC,KAElB,MAAMC,EAAiC,IAClClB,EACH,CAAEmB,MAAOpB,GAAqB,UAAWkB,UAGrCG,EAAe,CACnBC,YAAa,cAActB,GAAqB,aAAakB,IAC7DjB,mBAAoBkB,EACpBI,UAAWL,EAEXM,gBAAiBP,EACjBQ,mBAAoBR,GAIhBS,EAAkBvB,EAAgBA,EAAce,EAAOhB,G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|
|
@@ -5,7 +5,7 @@ export interface ReplicatorFormSetupProps {
|
|
|
5
5
|
replicatorFieldId: string;
|
|
6
6
|
/** Current nested path segments from parent containers */
|
|
7
7
|
nestedPathSegments?: PathSegment[];
|
|
8
|
-
/** Minimum instances allowed */
|
|
8
|
+
/** Minimum instances allowed (defaults to 1 to ensure at least one instance is shown) */
|
|
9
9
|
minInstances?: number;
|
|
10
10
|
/** Maximum instances allowed */
|
|
11
11
|
maxInstances?: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import{useEffect as
|
|
1
|
+
import{jsx as e}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import{useRef as t,useEffect as r}from"react";import{useFormContext as o,useFieldArray as n}from"../../node_modules/react-hook-form/dist/index.esm.mjs.js";import"../../contexts/ReplicatorFormContext/ReplicatorFormContext.js";import{ReplicatorFormContextProvider as i}from"../../contexts/ReplicatorFormContext/ReplicatorFormContextProvider.js";import{useReplicatorRegistry as s}from"../../contexts/ReplicatorRegistryContext/ReplicatorRegistryContext.js";const m=({replicatorFieldId:m,nestedPathSegments:a=[],minInstances:c=1,maxInstances:d,children:l})=>{const{control:p}=o(),f=s(),x=t(!1),u=a.map(e=>void 0!==e.index?`${e.dmfId}.${e.index}`:e.dmfId).filter(Boolean).join(".");const I=u?`${u}.${m}`:m,h=n({control:p,name:I}),{fields:j,append:F}=h;return r(()=>{if(!x.current&&(x.current=!0,0===j.length&&c>0)){Array.from({length:c},()=>({})).forEach(e=>{F(e,{shouldFocus:!1})})}},[]),r(()=>{if(f)return f.register({replicatorFieldId:m,fieldArrayName:I,fieldArrayMethods:h,minInstances:c,maxInstances:d}),()=>{f.unregister(m)}},[f,m,I,h,c,d]),e(i,{replicatorFieldId:m,fieldArrayName:I,fieldArrayMethods:h,minInstances:c,maxInstances:d,children:l})};export{m as ReplicatorFormSetup};
|
|
2
2
|
//# sourceMappingURL=ReplicatorFormSetup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReplicatorFormSetup.js","sources":["../../../../../src/containers/ReplicatorContainer/ReplicatorFormSetup.tsx"],"sourcesContent":[null],"names":["ReplicatorFormSetup","replicatorFieldId","nestedPathSegments","minInstances","maxInstances","children","control","useFormContext","registry","useReplicatorRegistry","currentPath","map","seg","undefined","index","dmfId","filter","Boolean","join","fieldArrayName","fieldArrayMethods","useFieldArray","name","useEffect","register","unregister","_jsx","ReplicatorFormContextProvider"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ReplicatorFormSetup.js","sources":["../../../../../src/containers/ReplicatorContainer/ReplicatorFormSetup.tsx"],"sourcesContent":[null],"names":["ReplicatorFormSetup","replicatorFieldId","nestedPathSegments","minInstances","maxInstances","children","control","useFormContext","registry","useReplicatorRegistry","initializedRef","useRef","currentPath","map","seg","undefined","index","dmfId","filter","Boolean","join","fieldArrayName","fieldArrayMethods","useFieldArray","name","fields","append","useEffect","current","length","Array","from","forEach","instance","shouldFocus","register","unregister","_jsx","ReplicatorFormContextProvider"],"mappings":"+iBAwBA,MAsBaA,EAAuE,EAClFC,oBACAC,qBAAqB,GACrBC,eAAe,EACfC,eACAC,eAEA,MAAMC,QAAEA,GAAYC,IACdC,EAAWC,IACXC,EAAiBC,GAAO,GAKxBC,EAA8BV,EAlCjCW,IAAKC,QACcC,IAAdD,EAAIE,MACC,GAAGF,EAAIG,SAASH,EAAIE,QAEtBF,EAAIG,OAEZC,OAAOC,SACPC,KAAK,KA4BR,MAAMC,EAAiBT,EAAc,GAAGA,KAAeX,IAAsBA,EAEvEqB,EAAoBC,EAAc,CACtCjB,UACAkB,KAAMH,KAGFI,OAAEA,EAAMC,OAAEA,GAAWJ,EAyC3B,OArCAK,EAAU,KAER,IAAIjB,EAAekB,UACnBlB,EAAekB,SAAU,EAGH,IAAlBH,EAAOI,QAAgB1B,EAAe,GAAG,CAElB2B,MAAMC,KAAK,CAAEF,OAAQ1B,GAAgB,MAAS,IAEtD6B,QAASC,IACxBP,EAAOO,EAAU,CAAEC,aAAa,KAMnC,GACA,IAGHP,EAAU,KACR,GAAInB,EASF,OARAA,EAAS2B,SAAS,CAChBlC,oBACAoB,iBACAC,oBACAnB,eACAC,iBAGK,KACLI,EAAS4B,WAAWnC,KAGvB,CAACO,EAAUP,EAAmBoB,EAAgBC,EAAmBnB,EAAcC,IAGhFiC,EAACC,EACC,CAAArC,kBAAmBA,EACnBoB,eAAgBA,EAChBC,kBAAmBA,EACnBnB,aAAcA,EACdC,aAAcA,EAEbC,SAAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../../contexts/AccountButtonContext/AccountButtonContext.js";import"react/jsx-runtime";import"../../../node_modules/@emotion/react/dist/emotion-element-d59e098f.esm.js";import{useState as t,useMemo as e,useContext as o,useCallback as r}from"react";import"../../../node_modules/stylis/dist/umd/stylis.js";import"../../../node_modules/@babel/runtime/helpers/extends.js";import"../../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js";import"../../../contexts/ApiContext/ApiContext.js";import{useContainerRuntime as n}from"../../../contexts/ContainerRuntimeContext/ContainerRuntimeContext.js";import"../../../contexts/FormStepContext/FormStepContext.js";import{useFormContext as i}from"../../../node_modules/react-hook-form/dist/index.esm.mjs.js";import"../../../contexts/LayoutContext/LayoutContext.js";import"../../../theme/theme.js";import"../../../theme/provider.js";import"../../../theme/toastStyles.js";import"../../../contexts/MlrRichTextViewerContext/MlrRichTextViewerContext.js";import"../../../contexts/OrganismContext/OrganismContext.js";import{useOrganismContext as a}from"../../../contexts/OrganismContext/useOrganismContext.js";import"../../../contexts/PopupContext/PopupContext.js";import{usePopupContext as s}from"../../../contexts/PopupContext/usePopupContext.js";import{useReplicatorForm as l}from"../../../contexts/ReplicatorFormContext/ReplicatorFormContext.js";import{useReplicatorRegistry as c}from"../../../contexts/ReplicatorRegistryContext/ReplicatorRegistryContext.js";import"../../../contexts/StateContext/StateContext.js";import{useStateContext as d}from"../../../contexts/StateContext/useStateContext.js";import{WebpageContext as u}from"../../../contexts/WebpageContext/WebpageContext.js";import{useSubmitForm as p}from"../../../contexts/ApiContext/globalQueries/form/useSubmitForm.js";import{getByPath as f,composeRwoParamsV2 as m}from"../../../helpers/rwoContext.js";import{navigateToExternalLink as g,checkIsInternalLink as y,downloadFile as w}from"../../../helpers/utils.js";const x=t=>{if(null!=t){if("object"==typeof t&&null!==t){const e=t;if("id"in e&&("string"==typeof e.id||"number"==typeof e.id||"boolean"==typeof e.id))return String(e.id)}return"string"==typeof t||"number"==typeof t||"boolean"==typeof t?String(t):void 0}},h=t=>{if(null!=t&&"object"==typeof t&&null!==t){const e=t;if("id"in e&&("string"==typeof e.id||"number"==typeof e.id||"boolean"==typeof e.id))return String(e.id);if("value"in e&&("string"==typeof e.value||"number"==typeof e.value||"boolean"==typeof e.value))return String(e.value)}},I=(I,b={})=>{const{properties:v,moleculeId:_,onClick:C,disabled:k}=I,{onActionStart:F,onActionComplete:R,onActionError:j,onAllActionsComplete:A,stopOnError:S=!0,executeAsync:D=!0}=b,[E,T]=t(!1),[P,M]=t(-1),[O,V]=t([]),[L,B]=t(null),$=e(()=>{const t=v?.action,e=t?.action,o=e||t;return o?Array.isArray(o)?o:o&&"object"==typeof o&&"type"in o?[o]:[]:[]},[v?.action]),{setActivePopup:N,clearActivePopup:W}=s(),q=i()||{},K=a?.()||{},U=n?.()||{},H=d?.()||{},J=l(),Q=c(),z=o(u),{onInternalNavigation:G,formId:X,routing:Y,submitHandler:Z,localState:tt,localStateObject:et,organismInfo:ot}=K,{submitForm:rt}=p()||{},nt=r(async t=>{if(!t.link)throw new Error("Link configuration missing");if("data_driven_link"===t.link?.type||"dataDrivenLink"===t.link?.type){const e=t.link?.sourceDataModelFieldId;if(!e)throw new Error("Missing sourceDataModelFieldId for data-driven link");let o;if(U?.rawItemDataByDmfId){const t=U.rawItemDataByDmfId[e];o=h(t)}if(!o&&q&&"function"==typeof q.getValues){const t=f(q.getValues(),e);o=x(t)}if(!o&&et){const t=f(et,e);o=h(t)}if(!o&&H?.stateConfig){const t=f(H.stateConfig,e);o=h(t)}if(!o)throw new Error("Resolved link is empty");return void g(o)}if(y(t.link)){const e={};t.link?.targetFormId&&(e.organismId=String(t.link?.targetFormId)),t.link?.rwoKey&&(e.rwo=String(t.link?.rwoKey)),G?.({link:t.link.internalLink||"",query:e})}else g(t.link.externalLink||"")},[G]),it=r(async t=>{if(!t.download)throw new Error("Download configuration missing");w(t.download.url,t.download.name)},[]),at=r(t=>{const e=t?.open_popup,o=e?.organismId;if(!o)throw new Error("Popup configuration missing");N?.({id:o})},[N]),st=r(async t=>{if(!q?.handleSubmit)throw new Error("Form context not available for submit action");const e=(X??"").toString();if(!e)throw new Error("Form ID missing in OrganismContext for submit action");const o=Y?.rwoRecordIdFromUrl;let r;return await q.handleSubmit(async n=>{const i={formId:e,data:n};let a;o&&(i.rwoRecordId=o);try{if(Z)a=await Z(i);else{if(!rt)return;a=await rt(i)}}catch(c){const e=t.submit?.onError?.link;if(e&&e.internalLink)if(y(e)){const t={};e?.rwoKey&&(t.rwo=String(e?.rwoKey)),G?.({link:e.internalLink||"",query:t})}else g(e.externalLink||"");throw c}r=a;const s=H?.stateHandler;"function"==typeof s&&e&&s({[e]:{interacted:"completed"}});const l=t?.submit?.onSuccess?.link;if(l&&(l.internalLink||l.externalLink))if(y(l)){const t={};l?.rwoKey&&(t.rwo=String(l?.rwoKey)),G?.({link:l.internalLink||"",query:t})}else g(l.externalLink||"");return q?.reset?.(),a},async t=>{throw new Error("Form validation failed")})(),r},[q,rt,G,X,Y]),lt=r(async(t,e)=>{const o=mt(t,e);if(!o)throw new Error(`Navigation configuration missing for ${e}`);switch(e){case"navigateToCreateForm":if(o.targetFormId){const t=`?organismId=${o.targetFormId}`;G?.({link:t})}break;case"navigateToEditForm":if(o.targetFormId){const t=Y?.rwoRecordIdFromUrl,e=t||(ot&&ot.id?String(ot.id):""),r=e?`?organismId=${o.targetFormId}&rwoRecordId=${e}`:`?organismId=${o.targetFormId}`;G?.({link:r})}break;case"navigateToPrepopulateForm":{const t=o?.link?.internalLink||"",{targetFormId:e}=o||{};if(!e&&!t)break;const r=Array.isArray(o?.fieldMap)?o.fieldMap:[],n=q&&"function"==typeof q.getValues?q.getValues():{},i=[(()=>{const t=U?.rawItemDataByDmfId||{},e=Object.entries(t).map(([t,e])=>{let o=e;if(e&&"object"==typeof e&&null!==e){const t=e;!("id"in t)||"string"!=typeof t.id&&"number"!=typeof t.id&&"boolean"!=typeof t.id?!("value"in t)||"string"!=typeof t.value&&"number"!=typeof t.value&&"boolean"!=typeof t.value||(o=t.value):o=t.id}return[t,o]});return Object.fromEntries(e)})(),n,et||{},H?.stateConfig||{}],a={};r.filter(t=>t?.source&&t?.destination).forEach(t=>{let e;for(let o=0;o<i.length;o+=1){const r=f(i[o],String(t.source));if(void 0!==r){e=r;break}}void 0!==e&&(a[String(t.destination)]=e)});const s=t||`?organismId=${encodeURIComponent(String(e||""))}`;G?.({link:s,state:{prefill:a,targetFormId:e}})}break;case"navigateToOrganismWithRwoContext":{const e=o?.sourceDataModelFieldId,r=o?.targetOrganismIds,n=t?.inputParams;if(!Array.isArray(r)||0===r.length)break;const i=q&&"function"==typeof q.getValues?q.getValues():{},a=U?.rawItemDataByDmfId||{},s=(()=>{try{const t=new URLSearchParams(window.location.search).get("rwoContext");return t?JSON.parse(atob(t)):{}}catch{return{}}})(),l={...s},c={};let d=!1;if(n&&n.length>0)n.forEach(t=>{const e=i[t.sourceFieldId]??a[t.sourceFieldId];null!=e&&""!==e&&(c[t.sourceFieldId]="object"==typeof e&&null!==e?e.id??e:e)});else if(e){let t;if(!t&&U?.rawItemDataByDmfId){const o=U.rawItemDataByDmfId[e];t=h(o)}if(!t&&q&&"function"==typeof q.getValues){const o=f(q.getValues(),e);t=x(o)}if(!t&&et){const o=f(et,e);t=h(o)}if(!t&&H?.stateConfig){const o=f(H.stateConfig,e);t=h(o)}!t&&e&&(t=String(e));const o=K?.organismInfo?.pmiObjectId;d=Boolean(o&&t),d?(l[e]=String(t),l.webpageSourceFieldId=e):t&&(c.rwoRecordId=String(t),c[String(e)]=String(t))}d||r.forEach(t=>{l[t]={...s[t]||{},...c}});const u={};if(d||Object.keys(c).length>0){const t=btoa(JSON.stringify(l));u.rwoContext=t}G?.({link:window.location.pathname,query:u})}break;case"navigateToPageWithRwoContext":{const t=o?.link,e=!1!==o?.includeRwoRecordId,r=Array.isArray(o?.rwoContextMapping)?o.rwoContextMapping:[];if(!t?.internalLink)break;const n=o?.sourceDataModelFieldId;let i=Y?.rwoRecordIdFromUrl;if(n){if(!i&&U?.rawItemDataByDmfId){const t=U.rawItemDataByDmfId[n];i=h(t)}if(!i&&q&&"function"==typeof q.getValues){const t=f(q.getValues(),n);i=x(t)}if(!i&&et){const t=f(et,n);i=h(t)}if(!i&&H?.stateConfig){const t=f(H.stateConfig,n);i=h(t)}i||(i=String(n))}const a={...q&&"function"==typeof q.getValues?q.getValues():{},...et||{},...H?.stateConfig||{},...(()=>{const t=U?.rawItemDataByDmfId||{},e=Object.entries(t).map(([t,e])=>{let o=e;if(e&&"object"==typeof e&&null!==e){const t=e;!("id"in t)||"string"!=typeof t.id&&"number"!=typeof t.id&&"boolean"!=typeof t.id?!("value"in t)||"string"!=typeof t.value&&"number"!=typeof t.value&&"boolean"!=typeof t.value||(o=t.value):o=t.id}return[t,o]});return Object.fromEntries(e)})()},{query:s}=m({includeRwoRecordId:e,recordId:i,mapping:r,contextSource:a});G?.({link:t.internalLink,query:s})}}},[G,q,tt,et,ot,Y]),ct=r(t=>{q?.reset?.()},[q]),dt=r(t=>{q?.reset?.(),"function"==typeof W?W():"function"==typeof N&&N(null)},[q,W,N]),ut=r(t=>{const e=t?.add_replicator||{},o=e.targetReplicatorFieldId;let r,n,i,a;if(o&&Q){const t=Q.getReplicator(o);if(!t)return void console.error(`[add_replicator] Replicator "${o}" not found in registry. Make sure the replicator container is rendered and has the correct replicatorFieldId.`);r=o,n=Q.canAdd(o),i=t=>Q.append(o,t),a=t.fieldArrayMethods.fields.length}else{if(!J)return void console.error("[add_replicator] No target replicator available. Either:\n1. Configure targetReplicatorFieldId in the button action, or\n2. Place the button inside a replicator container.");r=J.replicatorFieldId,n=J.canAdd,i=J.fieldArrayMethods.append,a=J.fieldArrayMethods.fields.length}if(n&&(i({}),!1!==e.scrollToNew)){const t=a;setTimeout(()=>{const e=`[data-replicator-instance="${r}-${t}"]`,o=document.querySelector(e);o&&o.scrollIntoView({behavior:"smooth",block:"start"})},100)}},[J,Q]),pt=r(t=>{const e=(t?.delete_replicator||{}).targetReplicatorFieldId;let o,r,n,i,a;if(e&&Q){const t=Q.getReplicator(e);if(!t)return void console.error(`[delete_replicator] Replicator "${e}" not found in registry. Make sure the replicator container is rendered and has the correct replicatorFieldId.`);o=e,r=Q.canRemove(e),n=t=>Q.remove(e,t),i=t.fieldArrayMethods.fields.length}else{if(!J)return void console.error("[delete_replicator] No target replicator available. Either:\n1. Configure targetReplicatorFieldId in the button action, or\n2. Place the button inside a replicator container.");o=J.replicatorFieldId,r=J.canRemove,n=J.fieldArrayMethods.remove,i=J.fieldArrayMethods.fields.length}r&&(a=void 0===U?.itemIndex||e?i-1:U.itemIndex,a<0||a>=i?console.error(`[delete_replicator] Invalid index ${a} (length: ${i})`):n(a))},[J,Q,U]),ft=r(async t=>{if(!z?.openAIChat)return;if(z.isAIAvailable&&!z.isAIAvailable())return;const e=t?.open_ai_chat||t?.openAIChat||{},o=t?.inputParams,r=e?.cortexAgentId,n=q&&"function"==typeof q.getValues?q.getValues():{},i=U?.rawItemDataByDmfId||{},a={};if(o&&o.length>0)o.forEach(t=>{const e=n[t.sourceFieldId]??i[t.sourceFieldId];null!=e&&(a[t.sourceFieldId]="object"==typeof e&&null!==e?e.id??e:e)});else{const t=e?.cortexRwoContext?.sourceDataModelFieldId;if(t){let e;if(!e&&U?.rawItemDataByDmfId){const o=U.rawItemDataByDmfId[t];e=h(o)}if(!e&&q&&"function"==typeof q.getValues){const o=f(q.getValues(),t);e=x(o)}if(!e&&et){const o=f(et,t);e=h(o)}if(!e&&H?.stateConfig){const o=f(H.stateConfig,t);e=h(o)}e&&(a.rwoRecordId=e,a.sourceDataModelFieldId=t)}}const s=Object.keys(a).length>0?{inputParams:a}:void 0;await z.openAIChat({cortexAgentId:r,cortexRwoContext:s})},[z,q,et,U,H]),mt=r((t,e)=>{switch(e){case"navigateToCreateForm":return t.navigateToCreateForm||t.navigate_to_create_form||null;case"navigateToEditForm":return t.navigateToEditForm||t.navigate_to_edit_form||null;case"navigateToPrepopulateForm":return t.navigateToPrepopulateForm||t.navigate_to_prepopulate_form||null;case"navigateToOrganismWithRwoContext":return t.navigateToOrganismWithRwoContext||t.navigate_to_organism_with_rwo_context||null;case"navigateToPageWithRwoContext":return t.navigateToPageWithRwoContext||t.navigate_to_page_with_rwo_context||null;default:return null}},[]),gt=r(async(t,e)=>{F?.(t,e);try{let o;switch(t.type){case"link":await nt(t),o="Link executed";break;case"download":await it(t),o="Download executed";break;case"submit":o=await st(t);break;case"open_popup":at(t),o="Popup opened";break;case"navigate_to_create_form":await lt(t,"navigateToCreateForm"),o="Navigation executed";break;case"navigate_to_edit_form":await lt(t,"navigateToEditForm"),o="Navigation executed";break;case"navigate_to_prepopulate_form":await lt(t,"navigateToPrepopulateForm"),o="Navigation executed";break;case"navigate_to_organism_with_rwo_context":await lt(t,"navigateToOrganismWithRwoContext"),o="Navigation executed";break;case"navigate_to_page_with_rwo_context":await lt(t,"navigateToPageWithRwoContext"),o="Navigation executed";break;case"reset":ct(t),o="Reset executed";break;case"destroy":dt(t),o="Destroy executed";break;case"open_ai_chat":await ft(t),o="AI Chat opened";break;case"add_replicator":ut(t),o="Replicator instance added";break;case"delete_replicator":pt(t),o="Replicator instance deleted";break;default:throw new Error(`Unsupported action type: ${t.type}`)}return R?.(t,e,o),o}catch(o){const r=o instanceof Error?o:new Error(String(o));if(j?.(t,e,r),S)throw r;return null}},[F,R,j,S,nt,it,st,at,lt,ct,dt,ft,ut,pt]),yt=r(async()=>{if(0===$.length)return[];T(!0),M(0),V([]),B(null);try{const t=$.some(t=>"submit"===t?.type),e=new Set(["link","navigate_to_create_form","navigate_to_edit_form","navigate_to_prepopulate_form","navigate_to_organism_with_rwo_context","navigate_to_page_with_rwo_context"]),o=t=>"close"===t||"destroy"===t,r=(()=>{if(!t)return $;return[...$.filter(t=>t&&"submit"!==t.type&&!e.has(t.type)&&!o(t.type)),...$.filter(t=>t&&"submit"===t.type),...$.filter(t=>t&&o(t.type)),...$.filter(t=>t&&e.has(t.type))]})(),n=[];for(let i=0;i<r.length;i+=1){M(i);const t=await gt(r[i],i);n.push(t),V([...n])}return A?.(n),n}catch(t){const e=t instanceof Error?t:new Error(String(t));throw B(e),e}finally{T(!1),M(-1)}},[$,gt,A,D,S]),wt=r(t=>{k||(C?C(t):$.length>0&&yt().catch(()=>{}))},[k,_,C,$,yt]);return{executeActions:yt,handleAction:wt,isExecuting:E,currentActionIndex:P,results:O,error:L}};export{I as useButtonAction};
|
|
1
|
+
import"../../../contexts/AccountButtonContext/AccountButtonContext.js";import"react/jsx-runtime";import"../../../node_modules/@emotion/react/dist/emotion-element-d59e098f.esm.js";import{useState as t,useMemo as e,useContext as o,useCallback as r}from"react";import"../../../node_modules/stylis/dist/umd/stylis.js";import"../../../node_modules/@babel/runtime/helpers/extends.js";import"../../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js";import"../../../contexts/ApiContext/ApiContext.js";import{useContainerRuntime as n}from"../../../contexts/ContainerRuntimeContext/ContainerRuntimeContext.js";import"../../../contexts/FormStepContext/FormStepContext.js";import{useFormContext as i}from"../../../node_modules/react-hook-form/dist/index.esm.mjs.js";import"../../../contexts/LayoutContext/LayoutContext.js";import"../../../theme/theme.js";import"../../../theme/provider.js";import"../../../theme/toastStyles.js";import"../../../contexts/MlrRichTextViewerContext/MlrRichTextViewerContext.js";import"../../../contexts/OrganismContext/OrganismContext.js";import{useOrganismContext as a}from"../../../contexts/OrganismContext/useOrganismContext.js";import"../../../contexts/PopupContext/PopupContext.js";import{usePopupContext as s}from"../../../contexts/PopupContext/usePopupContext.js";import{useReplicatorForm as l}from"../../../contexts/ReplicatorFormContext/ReplicatorFormContext.js";import{useReplicatorRegistry as c}from"../../../contexts/ReplicatorRegistryContext/ReplicatorRegistryContext.js";import"../../../contexts/StateContext/StateContext.js";import{useStateContext as d}from"../../../contexts/StateContext/useStateContext.js";import{WebpageContext as u}from"../../../contexts/WebpageContext/WebpageContext.js";import{useSubmitForm as p}from"../../../contexts/ApiContext/globalQueries/form/useSubmitForm.js";import{getByPath as f,composeRwoParamsV2 as m}from"../../../helpers/rwoContext.js";import{navigateToExternalLink as g,checkIsInternalLink as y,downloadFile as w}from"../../../helpers/utils.js";const x=t=>{if(null!=t){if("object"==typeof t&&null!==t){const e=t;if("id"in e&&("string"==typeof e.id||"number"==typeof e.id||"boolean"==typeof e.id))return String(e.id)}return"string"==typeof t||"number"==typeof t||"boolean"==typeof t?String(t):void 0}},h=t=>{if(null!=t&&"object"==typeof t&&null!==t){const e=t;if("id"in e&&("string"==typeof e.id||"number"==typeof e.id||"boolean"==typeof e.id))return String(e.id);if("value"in e&&("string"==typeof e.value||"number"==typeof e.value||"boolean"==typeof e.value))return String(e.value)}},I=(I,b={})=>{const{properties:v,moleculeId:_,onClick:C,disabled:k}=I,{onActionStart:F,onActionComplete:R,onActionError:j,onAllActionsComplete:A,stopOnError:S=!0,executeAsync:D=!0}=b,[E,T]=t(!1),[P,M]=t(-1),[O,V]=t([]),[L,B]=t(null),$=e(()=>{const t=v?.action,e=t?.action,o=e||t;return o?Array.isArray(o)?o:o&&"object"==typeof o&&"type"in o?[o]:[]:[]},[v?.action]),{setActivePopup:N,clearActivePopup:W}=s(),q=i()||{},K=a?.()||{},U=n?.()||{},H=d?.()||{},J=l(),Q=c(),z=o(u),{onInternalNavigation:G,formId:X,routing:Y,submitHandler:Z,localState:tt,localStateObject:et,organismInfo:ot}=K,{submitForm:rt}=p()||{},nt=r(async t=>{if(!t.link)throw new Error("Link configuration missing");if("data_driven_link"===t.link?.type||"dataDrivenLink"===t.link?.type){const e=t.link?.sourceDataModelFieldId;if(!e)throw new Error("Missing sourceDataModelFieldId for data-driven link");let o;if(U?.rawItemDataByDmfId){const t=U.rawItemDataByDmfId[e];o=h(t)}if(!o&&q&&"function"==typeof q.getValues){const t=f(q.getValues(),e);o=x(t)}if(!o&&et){const t=f(et,e);o=h(t)}if(!o&&H?.stateConfig){const t=f(H.stateConfig,e);o=h(t)}if(!o)throw new Error("Resolved link is empty");return void g(o)}if(y(t.link)){const e={};t.link?.targetFormId&&(e.organismId=String(t.link?.targetFormId)),t.link?.rwoKey&&(e.rwo=String(t.link?.rwoKey)),G?.({link:t.link.internalLink||"",query:e})}else g(t.link.externalLink||"")},[G]),it=r(async t=>{if(!t.download)throw new Error("Download configuration missing");w(t.download.url,t.download.name)},[]),at=r(t=>{const e=t?.open_popup,o=e?.organismId;if(!o)throw new Error("Popup configuration missing");N?.({id:o})},[N]),st=r(async t=>{if(!q?.handleSubmit)throw new Error("Form context not available for submit action");const e=(X??"").toString();if(!e)throw new Error("Form ID missing in OrganismContext for submit action");const o=Y?.rwoRecordIdFromUrl;let r;return await q.handleSubmit(async n=>{const i={formId:e,data:n};let a;o&&(i.rwoRecordId=o);try{if(Z)a=await Z(i);else{if(!rt)return;a=await rt(i)}}catch(c){const e=t.submit?.onError?.link;if(e&&e.internalLink)if(y(e)){const t={};e?.rwoKey&&(t.rwo=String(e?.rwoKey)),G?.({link:e.internalLink||"",query:t})}else g(e.externalLink||"");throw c}r=a;const s=H?.stateHandler;"function"==typeof s&&e&&s({[e]:{interacted:"completed"}});const l=t?.submit?.onSuccess?.link;if(l&&(l.internalLink||l.externalLink))if(y(l)){const t={};l?.rwoKey&&(t.rwo=String(l?.rwoKey)),G?.({link:l.internalLink||"",query:t})}else g(l.externalLink||"");return q?.reset?.(),a},async t=>{throw new Error("Form validation failed")})(),r},[q,rt,G,X,Y]),lt=r(async(t,e)=>{const o=mt(t,e);if(!o)throw new Error(`Navigation configuration missing for ${e}`);switch(e){case"navigateToCreateForm":if(o.targetFormId){const t=`?organismId=${o.targetFormId}`;G?.({link:t})}break;case"navigateToEditForm":if(o.targetFormId){const t=Y?.rwoRecordIdFromUrl,e=t||(ot&&ot.id?String(ot.id):""),r=e?`?organismId=${o.targetFormId}&rwoRecordId=${e}`:`?organismId=${o.targetFormId}`;G?.({link:r})}break;case"navigateToPrepopulateForm":{const t=o?.link?.internalLink||"",{targetFormId:e}=o||{};if(!e&&!t)break;const r=Array.isArray(o?.fieldMap)?o.fieldMap:[],n=q&&"function"==typeof q.getValues?q.getValues():{},i=[(()=>{const t=U?.rawItemDataByDmfId||{},e=Object.entries(t).map(([t,e])=>{let o=e;if(e&&"object"==typeof e&&null!==e){const t=e;!("id"in t)||"string"!=typeof t.id&&"number"!=typeof t.id&&"boolean"!=typeof t.id?!("value"in t)||"string"!=typeof t.value&&"number"!=typeof t.value&&"boolean"!=typeof t.value||(o=t.value):o=t.id}return[t,o]});return Object.fromEntries(e)})(),n,et||{},H?.stateConfig||{}],a={};r.filter(t=>t?.source&&t?.destination).forEach(t=>{let e;for(let o=0;o<i.length;o+=1){const r=f(i[o],String(t.source));if(void 0!==r){e=r;break}}void 0!==e&&(a[String(t.destination)]=e)});const s=t||`?organismId=${encodeURIComponent(String(e||""))}`;G?.({link:s,state:{prefill:a,targetFormId:e}})}break;case"navigateToOrganismWithRwoContext":{const e=o?.sourceDataModelFieldId,r=o?.targetOrganismIds,n=t?.inputParams;if(!Array.isArray(r)||0===r.length)break;const i=q&&"function"==typeof q.getValues?q.getValues():{},a=U?.rawItemDataByDmfId||{},s=(()=>{try{const t=new URLSearchParams(window.location.search).get("rwoContext");return t?JSON.parse(atob(t)):{}}catch{return{}}})(),l={...s},c={};let d=!1;if(n&&n.length>0)n.forEach(t=>{const e=i[t.sourceFieldId]??a[t.sourceFieldId];null!=e&&""!==e&&(c[t.sourceFieldId]="object"==typeof e&&null!==e?e.id??e:e)});else if(e){let t;if(!t&&U?.rawItemDataByDmfId){const o=U.rawItemDataByDmfId[e];t=h(o)}if(!t&&q&&"function"==typeof q.getValues){const o=f(q.getValues(),e);t=x(o)}if(!t&&et){const o=f(et,e);t=h(o)}if(!t&&H?.stateConfig){const o=f(H.stateConfig,e);t=h(o)}!t&&e&&(t=String(e));const o=K?.organismInfo?.pmiObjectId;d=Boolean(o&&t),d?(l[e]=String(t),l.webpageSourceFieldId=e):t&&(c.rwoRecordId=String(t),c[String(e)]=String(t))}d||r.forEach(t=>{l[t]={...s[t]||{},...c}});const u={};if(d||Object.keys(c).length>0){const t=btoa(JSON.stringify(l));u.rwoContext=t}G?.({link:window.location.pathname,query:u})}break;case"navigateToPageWithRwoContext":{const t=o?.link,e=!1!==o?.includeRwoRecordId,r=Array.isArray(o?.rwoContextMapping)?o.rwoContextMapping:[];if(!t?.internalLink)break;const n=o?.sourceDataModelFieldId;let i=Y?.rwoRecordIdFromUrl;if(n){if(!i&&U?.rawItemDataByDmfId){const t=U.rawItemDataByDmfId[n];i=h(t)}if(!i&&q&&"function"==typeof q.getValues){const t=f(q.getValues(),n);i=x(t)}if(!i&&et){const t=f(et,n);i=h(t)}if(!i&&H?.stateConfig){const t=f(H.stateConfig,n);i=h(t)}i||(i=String(n))}const a={...q&&"function"==typeof q.getValues?q.getValues():{},...et||{},...H?.stateConfig||{},...(()=>{const t=U?.rawItemDataByDmfId||{},e=Object.entries(t).map(([t,e])=>{let o=e;if(e&&"object"==typeof e&&null!==e){const t=e;!("id"in t)||"string"!=typeof t.id&&"number"!=typeof t.id&&"boolean"!=typeof t.id?!("value"in t)||"string"!=typeof t.value&&"number"!=typeof t.value&&"boolean"!=typeof t.value||(o=t.value):o=t.id}return[t,o]});return Object.fromEntries(e)})()},{query:s}=m({includeRwoRecordId:e,recordId:i,mapping:r,contextSource:a});G?.({link:t.internalLink,query:s})}}},[G,q,tt,et,ot,Y]),ct=r(t=>{q?.reset?.()},[q]),dt=r(t=>{q?.reset?.(),"function"==typeof W?W():"function"==typeof N&&N(null)},[q,W,N]),ut=r(t=>{const e=t?.add_replicator||{},o=e.targetReplicatorFieldId;let r,n,i,a;if(o&&Q){const t=Q.getReplicator(o);if(!t)return void console.error(`[add_replicator] Replicator "${o}" not found in registry. Make sure the replicator container is rendered and has the correct replicatorFieldId.`);r=o,n=Q.canAdd(o),i=t=>Q.append(o,t),a=t.fieldArrayMethods.fields.length}else{if(!J)return void console.error("[add_replicator] No target replicator available. Either:\n1. Configure targetReplicatorFieldId in the button action, or\n2. Place the button inside a replicator container.");r=J.replicatorFieldId,n=J.canAdd,i=J.fieldArrayMethods.append,a=J.fieldArrayMethods.fields.length}if(n&&(i({}),!1!==e.scrollToNew)){const t=`[data-replicator-instance="${r}-${a}"]`,e=(o=3)=>{requestAnimationFrame(()=>{setTimeout(()=>{const r=document.querySelector(t);r?r.scrollIntoView({behavior:"smooth",block:"nearest"}):o>0&&e(o-1)},50)})};e()}},[J,Q]),pt=r(t=>{const e=(t?.delete_replicator||{}).targetReplicatorFieldId;let o,r,n,i,a;if(e&&Q){const t=Q.getReplicator(e);if(!t)return void console.error(`[delete_replicator] Replicator "${e}" not found in registry. Make sure the replicator container is rendered and has the correct replicatorFieldId.`);o=e,r=Q.canRemove(e),n=t=>Q.remove(e,t),i=t.fieldArrayMethods.fields.length}else{if(!J)return void console.error("[delete_replicator] No target replicator available. Either:\n1. Configure targetReplicatorFieldId in the button action, or\n2. Place the button inside a replicator container.");o=J.replicatorFieldId,r=J.canRemove,n=J.fieldArrayMethods.remove,i=J.fieldArrayMethods.fields.length}r&&(a=void 0===U?.itemIndex||e?i-1:U.itemIndex,a<0||a>=i?console.error(`[delete_replicator] Invalid index ${a} (length: ${i})`):n(a))},[J,Q,U]),ft=r(async t=>{if(!z?.openAIChat)return;if(z.isAIAvailable&&!z.isAIAvailable())return;const e=t?.open_ai_chat||t?.openAIChat||{},o=t?.inputParams,r=e?.cortexAgentId,n=q&&"function"==typeof q.getValues?q.getValues():{},i=U?.rawItemDataByDmfId||{},a={};if(o&&o.length>0)o.forEach(t=>{const e=n[t.sourceFieldId]??i[t.sourceFieldId];null!=e&&(a[t.sourceFieldId]="object"==typeof e&&null!==e?e.id??e:e)});else{const t=e?.cortexRwoContext?.sourceDataModelFieldId;if(t){let e;if(!e&&U?.rawItemDataByDmfId){const o=U.rawItemDataByDmfId[t];e=h(o)}if(!e&&q&&"function"==typeof q.getValues){const o=f(q.getValues(),t);e=x(o)}if(!e&&et){const o=f(et,t);e=h(o)}if(!e&&H?.stateConfig){const o=f(H.stateConfig,t);e=h(o)}e&&(a.rwoRecordId=e,a.sourceDataModelFieldId=t)}}const s=Object.keys(a).length>0?{inputParams:a}:void 0;await z.openAIChat({cortexAgentId:r,cortexRwoContext:s})},[z,q,et,U,H]),mt=r((t,e)=>{switch(e){case"navigateToCreateForm":return t.navigateToCreateForm||t.navigate_to_create_form||null;case"navigateToEditForm":return t.navigateToEditForm||t.navigate_to_edit_form||null;case"navigateToPrepopulateForm":return t.navigateToPrepopulateForm||t.navigate_to_prepopulate_form||null;case"navigateToOrganismWithRwoContext":return t.navigateToOrganismWithRwoContext||t.navigate_to_organism_with_rwo_context||null;case"navigateToPageWithRwoContext":return t.navigateToPageWithRwoContext||t.navigate_to_page_with_rwo_context||null;default:return null}},[]),gt=r(async(t,e)=>{F?.(t,e);try{let o;switch(t.type){case"link":await nt(t),o="Link executed";break;case"download":await it(t),o="Download executed";break;case"submit":o=await st(t);break;case"open_popup":at(t),o="Popup opened";break;case"navigate_to_create_form":await lt(t,"navigateToCreateForm"),o="Navigation executed";break;case"navigate_to_edit_form":await lt(t,"navigateToEditForm"),o="Navigation executed";break;case"navigate_to_prepopulate_form":await lt(t,"navigateToPrepopulateForm"),o="Navigation executed";break;case"navigate_to_organism_with_rwo_context":await lt(t,"navigateToOrganismWithRwoContext"),o="Navigation executed";break;case"navigate_to_page_with_rwo_context":await lt(t,"navigateToPageWithRwoContext"),o="Navigation executed";break;case"reset":ct(t),o="Reset executed";break;case"destroy":dt(t),o="Destroy executed";break;case"open_ai_chat":await ft(t),o="AI Chat opened";break;case"add_replicator":ut(t),o="Replicator instance added";break;case"delete_replicator":pt(t),o="Replicator instance deleted";break;default:throw new Error(`Unsupported action type: ${t.type}`)}return R?.(t,e,o),o}catch(o){const r=o instanceof Error?o:new Error(String(o));if(j?.(t,e,r),S)throw r;return null}},[F,R,j,S,nt,it,st,at,lt,ct,dt,ft,ut,pt]),yt=r(async()=>{if(0===$.length)return[];T(!0),M(0),V([]),B(null);try{const t=$.some(t=>"submit"===t?.type),e=new Set(["link","navigate_to_create_form","navigate_to_edit_form","navigate_to_prepopulate_form","navigate_to_organism_with_rwo_context","navigate_to_page_with_rwo_context"]),o=t=>"close"===t||"destroy"===t,r=(()=>{if(!t)return $;return[...$.filter(t=>t&&"submit"!==t.type&&!e.has(t.type)&&!o(t.type)),...$.filter(t=>t&&"submit"===t.type),...$.filter(t=>t&&o(t.type)),...$.filter(t=>t&&e.has(t.type))]})(),n=[];for(let i=0;i<r.length;i+=1){M(i);const t=await gt(r[i],i);n.push(t),V([...n])}return A?.(n),n}catch(t){const e=t instanceof Error?t:new Error(String(t));throw B(e),e}finally{T(!1),M(-1)}},[$,gt,A,D,S]),wt=r(t=>{k||(C?C(t):$.length>0&&yt().catch(()=>{}))},[k,_,C,$,yt]);return{executeActions:yt,handleAction:wt,isExecuting:E,currentActionIndex:P,results:O,error:L}};export{I as useButtonAction};
|
|
2
2
|
//# sourceMappingURL=useButtonAction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useButtonAction.js","sources":["../../../../../../src/molecules/Button/hooks/useButtonAction.ts"],"sourcesContent":[null],"names":["getValueFromFormContext","data","obj","id","String","getValueFromDisplayStructure","value","useButtonAction","props","options","properties","moleculeId","onClick","disabled","onActionStart","onActionComplete","onActionError","onAllActionsComplete","stopOnError","executeAsync","isExecuting","setIsExecuting","useState","currentActionIndex","setCurrentActionIndex","results","setResults","error","setError","actions","useMemo","actionContainer","action","nestedAction","actionConfig","Array","isArray","setActivePopup","clearActivePopup","usePopupContext","form","useFormContext","organismCtx","useOrganismContext","containerRuntime","useContainerRuntime","stateCtx","useStateContext","replicatorFormContext","useReplicatorForm","replicatorRegistry","useReplicatorRegistry","webpageCtx","useContext","WebpageContext","onInternalNavigation","formId","organismFormId","routing","submitHandler","pageSubmitHandler","localState","localStateObject","organismInfo","submitForm","useSubmitForm","executeLinkAction","useCallback","async","link","Error","type","fieldId","sourceDataModelFieldId","rawItemDataByDmfId","raw","getValues","getByPath","stateConfig","navigateToExternalLink","checkIsInternalLink","query","targetFormId","organismId","rwoKey","rwo","internalLink","externalLink","executeDownloadAction","download","downloadFile","url","name","executePopupAction","openPopup","open_popup","popupId","executeSubmitAction","handleSubmit","currentFormId","toString","rwoRecordId","rwoRecordIdFromUrl","submitResult","values","payload","result","err","errorLink","submit","onError","handler","stateHandler","interacted","successLink","onSuccess","reset","_invalid","executeNavigationAction","navigationType","config","getNavigationConfig","pageRwoId","candidateId","baseInternalLink","mappings","fieldMap","formValues","sourcesInPriority","entries","Object","map","key","val","v","fromEntries","prefill","filter","m","source","destination","forEach","resolved","i","length","candidate","undefined","composed","encodeURIComponent","state","sourceFieldId","targetOrganismIds","inputParams","containerData","existingRwoContext","rwoContextParam","URLSearchParams","window","location","search","get","JSON","parse","atob","newRwoContext","rwoContextValues","useNewStructure","param","fieldValue","currentWebpagePmiObjectId","pmiObjectId","Boolean","webpageSourceFieldId","orgId","keys","encodedContext","btoa","stringify","rwoContext","pathname","linkObj","includeRwoRecordId","rwoContextMapping","recordId","contextSource","composeRwoParamsV2","mapping","executeResetAction","executeDestroyAction","executeAddReplicatorAction","addConfig","add_replicator","targetReplicatorFieldId","targetReplicatorId","canAdd","appendFn","currentLength","entry","getReplicator","console","append","fieldArrayMethods","fields","replicatorFieldId","scrollToNew","newIndex","setTimeout","selector","element","document","querySelector","scrollIntoView","behavior","block","executeDeleteReplicatorAction","delete_replicator","canRemove","removeFn","indexToRemove","index","remove","itemIndex","executeOpenAIChatAction","openAIChat","isAIAvailable","openAIChatConfig","open_ai_chat","cortexAgentIdOverride","cortexAgentId","chatParams","cortexRwoContext","resolvedRwoRecordId","navigateToCreateForm","navigate_to_create_form","navigateToEditForm","navigate_to_edit_form","navigateToPrepopulateForm","navigate_to_prepopulate_form","navigateToOrganismWithRwoContext","navigate_to_organism_with_rwo_context","navigateToPageWithRwoContext","navigate_to_page_with_rwo_context","executeSingleAction","executeActions","containsSubmit","some","a","navigationTypes","Set","isCloser","t","orderedActions","has","executionResults","push","handleAction","event","catch"],"mappings":"y/DA2BA,MAAMA,EAA2BC,IAC/B,GAAIA,QAAJ,CAGA,GAAoB,iBAATA,GAA8B,OAATA,EAAe,CAC7C,MAAMC,EAAMD,EACZ,GACE,OAAQC,IACW,iBAAXA,EAAIC,IAAqC,iBAAXD,EAAIC,IAAqC,kBAAXD,EAAIC,IAExE,OAAOC,OAAOF,EAAIC,GAErB,CACD,MAAoB,iBAATF,GAAqC,iBAATA,GAAqC,kBAATA,EAC1DG,OAAOH,QADhB,CAZyD,GAoBrDI,EAAgCJ,IACpC,GAAIA,SAGgB,iBAATA,GAA8B,OAATA,EAAe,CAC7C,MAAMC,EAAMD,EACZ,GACE,OAAQC,IACW,iBAAXA,EAAIC,IAAqC,iBAAXD,EAAIC,IAAqC,kBAAXD,EAAIC,IAExE,OAAOC,OAAOF,EAAIC,IAEpB,GACE,UAAWD,IACW,iBAAdA,EAAII,OACW,iBAAdJ,EAAII,OACU,kBAAdJ,EAAII,OAEb,OAAOF,OAAOF,EAAII,MAErB,GAYUC,EAAkB,CAC7BC,EACAC,EAAkC,MAElC,MAAMC,WAAEA,EAAUC,WAAEA,EAAUC,QAAEA,EAAOC,SAAEA,GAAaL,GAChDM,cACJA,EAAaC,iBACbA,EAAgBC,cAChBA,EAAaC,qBACbA,EAAoBC,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ts"],"sourcesContent":[null],"names":["getValueFromFormContext","data","obj","id","String","getValueFromDisplayStructure","value","useButtonAction","props","options","properties","moleculeId","onClick","disabled","onActionStart","onActionComplete","onActionError","onAllActionsComplete","stopOnError","executeAsync","isExecuting","setIsExecuting","useState","currentActionIndex","setCurrentActionIndex","results","setResults","error","setError","actions","useMemo","actionContainer","action","nestedAction","actionConfig","Array","isArray","setActivePopup","clearActivePopup","usePopupContext","form","useFormContext","organismCtx","useOrganismContext","containerRuntime","useContainerRuntime","stateCtx","useStateContext","replicatorFormContext","useReplicatorForm","replicatorRegistry","useReplicatorRegistry","webpageCtx","useContext","WebpageContext","onInternalNavigation","formId","organismFormId","routing","submitHandler","pageSubmitHandler","localState","localStateObject","organismInfo","submitForm","useSubmitForm","executeLinkAction","useCallback","async","link","Error","type","fieldId","sourceDataModelFieldId","rawItemDataByDmfId","raw","getValues","getByPath","stateConfig","navigateToExternalLink","checkIsInternalLink","query","targetFormId","organismId","rwoKey","rwo","internalLink","externalLink","executeDownloadAction","download","downloadFile","url","name","executePopupAction","openPopup","open_popup","popupId","executeSubmitAction","handleSubmit","currentFormId","toString","rwoRecordId","rwoRecordIdFromUrl","submitResult","values","payload","result","err","errorLink","submit","onError","handler","stateHandler","interacted","successLink","onSuccess","reset","_invalid","executeNavigationAction","navigationType","config","getNavigationConfig","pageRwoId","candidateId","baseInternalLink","mappings","fieldMap","formValues","sourcesInPriority","entries","Object","map","key","val","v","fromEntries","prefill","filter","m","source","destination","forEach","resolved","i","length","candidate","undefined","composed","encodeURIComponent","state","sourceFieldId","targetOrganismIds","inputParams","containerData","existingRwoContext","rwoContextParam","URLSearchParams","window","location","search","get","JSON","parse","atob","newRwoContext","rwoContextValues","useNewStructure","param","fieldValue","currentWebpagePmiObjectId","pmiObjectId","Boolean","webpageSourceFieldId","orgId","keys","encodedContext","btoa","stringify","rwoContext","pathname","linkObj","includeRwoRecordId","rwoContextMapping","recordId","contextSource","composeRwoParamsV2","mapping","executeResetAction","executeDestroyAction","executeAddReplicatorAction","addConfig","add_replicator","targetReplicatorFieldId","targetReplicatorId","canAdd","appendFn","currentLength","entry","getReplicator","console","append","fieldArrayMethods","fields","replicatorFieldId","scrollToNew","selector","scrollToElement","retries","requestAnimationFrame","setTimeout","element","document","querySelector","scrollIntoView","behavior","block","executeDeleteReplicatorAction","delete_replicator","canRemove","removeFn","indexToRemove","index","remove","itemIndex","executeOpenAIChatAction","openAIChat","isAIAvailable","openAIChatConfig","open_ai_chat","cortexAgentIdOverride","cortexAgentId","chatParams","cortexRwoContext","resolvedRwoRecordId","navigateToCreateForm","navigate_to_create_form","navigateToEditForm","navigate_to_edit_form","navigateToPrepopulateForm","navigate_to_prepopulate_form","navigateToOrganismWithRwoContext","navigate_to_organism_with_rwo_context","navigateToPageWithRwoContext","navigate_to_page_with_rwo_context","executeSingleAction","executeActions","containsSubmit","some","a","navigationTypes","Set","isCloser","t","orderedActions","has","executionResults","push","handleAction","event","catch"],"mappings":"y/DA2BA,MAAMA,EAA2BC,IAC/B,GAAIA,QAAJ,CAGA,GAAoB,iBAATA,GAA8B,OAATA,EAAe,CAC7C,MAAMC,EAAMD,EACZ,GACE,OAAQC,IACW,iBAAXA,EAAIC,IAAqC,iBAAXD,EAAIC,IAAqC,kBAAXD,EAAIC,IAExE,OAAOC,OAAOF,EAAIC,GAErB,CACD,MAAoB,iBAATF,GAAqC,iBAATA,GAAqC,kBAATA,EAC1DG,OAAOH,QADhB,CAZyD,GAoBrDI,EAAgCJ,IACpC,GAAIA,SAGgB,iBAATA,GAA8B,OAATA,EAAe,CAC7C,MAAMC,EAAMD,EACZ,GACE,OAAQC,IACW,iBAAXA,EAAIC,IAAqC,iBAAXD,EAAIC,IAAqC,kBAAXD,EAAIC,IAExE,OAAOC,OAAOF,EAAIC,IAEpB,GACE,UAAWD,IACW,iBAAdA,EAAII,OACW,iBAAdJ,EAAII,OACU,kBAAdJ,EAAII,OAEb,OAAOF,OAAOF,EAAII,MAErB,GAYUC,EAAkB,CAC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