@zealicsolutions/web-ui 1.0.140-beta.54 → 1.0.140-beta.56
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/index.js +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/_virtual/index3.js +1 -1
- package/dist/esm/_virtual/index4.js +1 -1
- package/dist/esm/molecules/BasicTextField/BasicTextField.js +1 -1
- package/dist/esm/molecules/BasicTextField/BasicTextField.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/dist/esm/molecules/Select/Select.js +1 -1
- package/dist/esm/molecules/Select/Select.js.map +1 -1
- package/dist/esm/node_modules/@mui/material/esm/Accordion/Accordion.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/Menu/Menu.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/MenuList/MenuList.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/Select/SelectInput.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/SpeedDial/SpeedDial.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/Tabs/Tabs.js +1 -1
- package/dist/esm/node_modules/@mui/material/esm/ToggleButtonGroup/ToggleButtonGroup.js +1 -1
- package/dist/esm/node_modules/@mui/material/node_modules/react-is/index.js +1 -1
- package/dist/esm/node_modules/classnames/index.js +1 -1
- package/dist/esm/node_modules/react-slick/lib/arrows.js +1 -1
- package/dist/esm/node_modules/react-slick/lib/dots.js +1 -1
- package/dist/esm/node_modules/react-slick/lib/inner-slider.js +1 -1
- package/dist/esm/node_modules/react-slick/lib/track.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasicTextField.js","sources":["../../../../../src/molecules/BasicTextField/BasicTextField.tsx"],"sourcesContent":[null],"names":["defaultPattern","text","password","number","email","url","date","time","BasicTextField","required","requiredErrorText","validationErrorText","backgroundColor","textAlign","color","fontSize","fontFamily","fontWeight","inputType","borderColor","masked","copyButton","multiLine","marginLeft","marginTop","marginRight","marginBottom","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","minHeight","maxHeight","minWidth","maxWidth","placeholderText","configurationItemInfo","name","rules","propsRules","sourceDataModelField","isDisplayOnly","sx","props","methods","useFormContext","control","localStateObject","useOrganismContext","containerRuntime","useContainerRuntime","stateConfig","useStateContext","stateObject","scopedValueFromContainer","getDmfValue","undefined","dataModelFieldValue","value","useEffect","setValue","pattern","message","showPassword","setShowPassword","useState","isPasswordField","getType","handleCopy","async","valueToCopy","navigator","clipboard","writeText","err","console","error","getEndAdornment","buttons","push","_jsx","IconButton","onClick","size","Copy","children","EyeOff","Eye","length","InputAdornment","position","style","display","alignItems","gap","inputSx","labelSx","mainSx","flexDirection","valueToDisplay","watch","toString","displayValue","repeat","shouldShowToggle","_jsxs","Box","border","borderRadius","justifyContent","FormHelperText","Typography","flex","overflow","textOverflow","flexShrink","padding","Controller","render","field","onChange","onBlur","ref","fieldState","MuiTextField","type","label","placeholder","multiline","minRows","variant","slotProps","input","endAdornment","inputLabel","inputRef","helperText"],"mappings":"s23GAkBA,MAAMA,EAAkE,CACtEC,KAAM,KACNC,SAAU,KACVC,OAAQ,kBACRC,MAAO,6BACPC,IAAK,mCACLC,KAAM,sBACNC,KAAM,6BA6CKC,EAAgD,EAC3DC,YAAW,EACXC,oBAAoB,yBACpBC,sBAAsB,gBACtBC,kBACAC,YAAY,OACZC,QAAQ,UACRC,WAAW,OACXC,aAAa,UACbC,aAAa,SACbC,YACAC,cACAC,UAAS,EACTC,cAAa,EACbC,aAAY,EACZC,aAAa,IACbC,YAAY,IACZC,cAAc,IACdC,eAAe,IACfC,cAAc,IACdC,aAAa,IACbC,eAAe,IACfC,gBAAgB,IAChBC,QACAC,SACAC,YACAC,YACAC,WACAC,WACAnC,OACAoC,kBACAC,wBACAC,OAAO,cACPC,MAAOC,EACPC,uBACAC,iB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GAA0B,CAC9BrF,kBACAE,QACAC,WACAC,aACAC,gBACIc,GAAS,CAAEA,YACXC,GAAU,CAAEA,aACZG,GAAY,CAAEA,eACdC,GAAY,CAAEA,eACdH,GAAa,CAAEA,gBACfC,GAAa,CAAEA,aACnB,qCAAsC,CAAEf,YAAaA,GAAe,WACpE,2CAA4C,CAAEA,YAAaA,GAAe,WAC1E,iDAAkD,CAAEA,YAAaA,GAAe,WAChF,4BAA6B,CAC3BN,YACAc,cACAC,aACAC,eACAC,kBAIEoE,GAA0B,CAC9BpF,QACA,gBAAiB,CAAEA,UAGfqF,GAAS,CACb5E,aACAC,YACAC,cACAC,kBACIK,GAAS,CAAEA,YACXC,GAAU,CAAEA,aACZG,GAAY,CAAEA,eACdC,GAAY,CAAEA,eACdH,GAAa,CAAEA,gBACfC,GAAa,CAAEA,aACnB4D,QAAS,cACTM,cAAe,SAEf,uBAAwB,CACtBrE,MAAO,QAET,wBAAyB,CACvBlB,YACAc,cACAC,aACAC,eACAC,gBACAf,WACAC,aACAC,aACAH,QACAF,mBAEF,qCAAsC,CACpCO,YAAaA,GAAe,WAE9B,2CAA4C,CAC1CA,YAAaA,GAAe,WAE9B,iDAAkD,CAChDA,YAAaA,GAAe,WAE9B,uBAAwB,CACtBP,mBAEF,uBAAwB,CACtBE,QACAC,WACAC,aACAC,cAEF,mCAAoC,CAClCH,SAEF,4BAA6B,CAC3BA,QACAC,WACAC,aACAC,aACAM,WAAY,GAEd,4BAA6B,CAC3BT,SAEF,wBAAyB,CACvBA,YAGC8B,IAICyD,IADWvD,IAASwD,MAAM/D,IAASoB,IAAuBtB,GAAmB,IACnDkE,WAC1BC,GACJpF,IAAW6C,IAAgBtB,EACvB,IAAI8D,OAAOJ,GAAeX,QAAU,GACpCW,IAAkB,IAExB,GAAI1D,EAAe,CACjB,MAAM+D,
|
|
1
|
+
{"version":3,"file":"BasicTextField.js","sources":["../../../../../src/molecules/BasicTextField/BasicTextField.tsx"],"sourcesContent":[null],"names":["defaultPattern","text","password","number","email","url","date","time","BasicTextField","required","requiredErrorText","validationErrorText","backgroundColor","textAlign","color","fontSize","fontFamily","fontWeight","inputType","borderColor","masked","copyButton","multiLine","marginLeft","marginTop","marginRight","marginBottom","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","minHeight","maxHeight","minWidth","maxWidth","placeholderText","configurationItemInfo","name","rules","propsRules","sourceDataModelField","isDisplayOnly","sx","props","methods","useFormContext","control","localStateObject","useOrganismContext","containerRuntime","useContainerRuntime","stateConfig","useStateContext","stateObject","scopedValueFromContainer","getDmfValue","undefined","dataModelFieldValue","value","useEffect","setValue","pattern","message","showPassword","setShowPassword","useState","isPasswordField","getType","handleCopy","async","valueToCopy","navigator","clipboard","writeText","err","console","error","getEndAdornment","buttons","push","_jsx","IconButton","onClick","size","Copy","children","EyeOff","Eye","length","InputAdornment","position","style","display","alignItems","gap","inputSx","labelSx","mainSx","flexDirection","valueToDisplay","watch","toString","displayValue","repeat","isAutoWidth","shouldShowToggle","_jsxs","Box","border","borderRadius","justifyContent","FormHelperText","Typography","flex","overflow","textOverflow","flexShrink","padding","Controller","render","field","onChange","onBlur","ref","fieldState","MuiTextField","type","label","placeholder","multiline","minRows","variant","slotProps","input","endAdornment","inputLabel","inputRef","helperText"],"mappings":"s23GAkBA,MAAMA,EAAkE,CACtEC,KAAM,KACNC,SAAU,KACVC,OAAQ,kBACRC,MAAO,6BACPC,IAAK,mCACLC,KAAM,sBACNC,KAAM,6BA6CKC,EAAgD,EAC3DC,YAAW,EACXC,oBAAoB,yBACpBC,sBAAsB,gBACtBC,kBACAC,YAAY,OACZC,QAAQ,UACRC,WAAW,OACXC,aAAa,UACbC,aAAa,SACbC,YACAC,cACAC,UAAS,EACTC,cAAa,EACbC,aAAY,EACZC,aAAa,IACbC,YAAY,IACZC,cAAc,IACdC,eAAe,IACfC,cAAc,IACdC,aAAa,IACbC,eAAe,IACfC,gBAAgB,IAChBC,QACAC,SACAC,YACAC,YACAC,WACAC,WACAnC,OACA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,MAAO,CAAEhF,aACT2H,aAAczD,GAAgB,KAEhC0D,WAAY,CAAE7F,GAAIsD,QAEhBrD,MACAP"}
|
|
@@ -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,useCallback as o}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 r}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 i}from"../../../contexts/OrganismContext/useOrganismContext.js";import"../../../contexts/PopupContext/PopupContext.js";import{usePopupContext as a}from"../../../contexts/PopupContext/usePopupContext.js";import"../../../contexts/StateContext/StateContext.js";import{useStateContext as s}from"../../../contexts/StateContext/useStateContext.js";import{useSubmitForm as c}from"../../../contexts/ApiContext/globalQueries/form/useSubmitForm.js";import{getByPath as l,composeRwoParamsV2 as u,encodeObjectToBase64Url as m}from"../../../helpers/rwoContext.js";import{navigateToExternalLink as g,checkIsInternalLink as d,downloadFile as f}from"../../../helpers/utils.js";const p=(p,w={})=>{const{properties:x,moleculeId:y,onClick:v,disabled:h}=p,{onActionStart:_,onActionComplete:k,onActionError:C,onAllActionsComplete:b,stopOnError:S=!0,executeAsync:j=!0}=w,[I,F]=t(!1),[E,R]=t(-1),[A,T]=t([]),[D,L]=t(null),O=e(()=>{const t=x?.action,e=t?.action,o=e||t;return o?Array.isArray(o)?o:o&&"object"==typeof o&&"type"in o?[o]:[]:[]},[x?.action]),{setActivePopup:V,clearActivePopup:P}=a(),M=r()||{},W=i?.()||{},N=n?.()||{},U=s?.()||{},{onInternalNavigation:$,formId:q,routing:K,submitHandler:B,localState:H,localStateObject:Q,organismInfo:z}=W,{submitForm:G}=c()||{},J=o(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");const o=(N&&"function"==typeof N.getDmfValue?N.getDmfValue(e):void 0)??(M&&"function"==typeof M.getValues?l(M.getValues(),e):void 0)??(Q?l(Q,e):void 0)??(U?.stateConfig?l(U.stateConfig,e):void 0),n=o&&"object"==typeof o&&"value"in o?o.value:o;if(!n||"string"!=typeof n)throw new Error("Resolved link is empty");return void g(n)}if(d(t.link)){const e={};t.link?.targetFormId&&(e.organismId=String(t.link?.targetFormId)),t.link?.rwoKey&&(e.rwo=String(t.link?.rwoKey)),$?.({link:t.link.internalLink||"",query:e})}else g(t.link.externalLink||"")},[$]),X=o(async t=>{if(!t.download)throw new Error("Download configuration missing");f(t.download.url,t.download.name)},[]),Y=o(t=>{const e=t?.open_popup,o=e?.organismId;if(!o)throw new Error("Popup configuration missing");V?.({id:o})},[V]),Z=o(async t=>{if(!M?.handleSubmit)throw new Error("Form context not available for submit action");const e=(q??"").toString();if(!e)throw new Error("Form ID missing in OrganismContext for submit action");const o=K?.rwoRecordIdFromUrl;let n;return await M.handleSubmit(async r=>{const i={formId:e,data:r};let a;o&&(i.rwoRecordId=o);try{if(B)a=await B(i);else{if(!G)return;a=await G(i)}}catch(c){const e=t.submit?.onError?.link;if(e&&e.internalLink)if(d(e)){const t={};e?.rwoKey&&(t.rwo=String(e?.rwoKey)),$?.({link:e.internalLink||"",query:t})}else g(e.externalLink||"");throw c}n=a;const s=t?.submit?.onSuccess?.link;if(s&&(s.internalLink||s.externalLink))if(d(s)){const t={};s?.rwoKey&&(t.rwo=String(s?.rwoKey)),$?.({link:s.internalLink||"",query:t})}else g(s.externalLink||"");return M?.reset?.(),a},async t=>{throw new Error("Form validation failed")})(),n},[M,G,$,q,K]),tt=o(async(t,e)=>{const o=nt(t,e);if(!o)throw new Error(`Navigation configuration missing for ${e}`);switch(e){case"navigateToCreateForm":if(o.targetFormId){const t=`?organismId=${o.targetFormId}`;$?.({link:t})}break;case"navigateToEditForm":if(o.targetFormId){const t=K?.rwoRecordIdFromUrl,e=t||(z&&z.id?String(z.id):""),n=e?`?organismId=${o.targetFormId}&rwoRecordId=${e}`:`?organismId=${o.targetFormId}`;$?.({link:n})}break;case"navigateToPrepopulateForm":{const t=o?.link?.internalLink||"",{targetFormId:e}=o||{};if(!e&&!t)break;const n=Array.isArray(o?.fieldMap)?o.fieldMap:[],r=M&&"function"==typeof M.getValues?M.getValues():{},i=[(()=>{const t=N?.itemDataByDmfId||{},e=Object.entries(t).map(([t,e])=>[t,e&&"object"==typeof e&&"value"in e?e.value:e]);return Object.fromEntries(e)})(),r,Q||{},U?.stateConfig||{}],a={};n.filter(t=>t?.source&&t?.destination).forEach(t=>{let e;for(let o=0;o<i.length;o+=1){const n=l(i[o],String(t.source));if(void 0!==n){e=n;break}}void 0!==e&&(a[String(t.destination)]=e)});const s=t||`?organismId=${encodeURIComponent(String(e||""))}`;$?.({link:s,state:{prefill:a,targetFormId:e}})}break;case"navigateToOrganismWithRwoContext":{const t=o?.sourceDataModelFieldId,e=o?.targetOrganismIds;if(!t||!Array.isArray(e)||0===e.length)break;const n=t=>{if(t&&"object"==typeof t){const e=t;if("value"in e&&("string"==typeof e.value||"number"==typeof e.value||"boolean"==typeof e.value))return String(e.value);if("id"in e&&null!=e.id)return String(e.id)}return null!=t?String(t):void 0};let r;if(N&&"function"==typeof N.getDmfValue){const e=N.getDmfValue(t);r=n(e)}if(!r&&M&&"function"==typeof M.getValues){const e=l(M.getValues(),t);r=n(e)}if(!r&&Q){const e=l(Q,t);r=n(e)}if(!r&&U?.stateConfig){const e=l(U.stateConfig,t);r=n(e)}!r&&t&&(r=String(t));const i={};e.forEach(e=>{i[e]||(i[e]={}),r&&(i[e].rwoRecordId=String(r)),t&&(i[e][String(t)]=String(r||""))});const a={};Object.keys(i).length>0&&(a.rwoContext=m(i));const s=new URL(window?.location?.href||"/"),c=new URLSearchParams(s.search||"");Object.entries(a).forEach(([t,e])=>{null!=e&&c.set(t,String(e))}),s.pathname,c.toString(),$?.({link:s.pathname,query:a})}break;case"navigateToPageWithRwoContext":{const t=o?.link,e=!1!==o?.includeRwoRecordId,n=Array.isArray(o?.rwoContextMapping)?o.rwoContextMapping:[];if(!t?.internalLink)break;const r=o?.sourceDataModelFieldId,i=t=>{if(t&&"object"==typeof t){const e=t;if("value"in e&&("string"==typeof e.value||"number"==typeof e.value||"boolean"==typeof e.value))return String(e.value);if("id"in e&&null!=e.id)return String(e.id)}return null!=t?String(t):void 0};let a=K?.rwoRecordIdFromUrl;if(r){if(!a&&N&&"function"==typeof N.getDmfValue){a=i(N.getDmfValue(r))}if(!a&&M&&"function"==typeof M.getValues){a=i(l(M.getValues(),r))}if(!a&&Q){a=i(l(Q,r))}if(!a&&U?.stateConfig){a=i(l(U.stateConfig,r))}a||(a=String(r))}const s={...M&&"function"==typeof M.getValues?M.getValues():{},...Q||{},...U?.stateConfig||{},...(()=>{const t=N?.itemDataByDmfId||{},e=Object.entries(t).map(([t,e])=>[t,e&&"object"==typeof e&&"value"in e?e.value:e]);return Object.fromEntries(e)})()},{query:c}=u({includeRwoRecordId:e,recordId:a,mapping:n,contextSource:s});$?.({link:t.internalLink,query:c})}}},[$,M,H,Q,z,K]),et=o(t=>{M?.reset?.()},[M]),ot=o(t=>{M?.reset?.(),"function"==typeof P?P():"function"==typeof V&&V(null)},[M,P,V]),nt=o((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}},[]),rt=o(async(t,e)=>{_?.(t,e);try{let o;switch(t.type){case"link":await J(t),o="Link executed";break;case"download":await X(t),o="Download executed";break;case"submit":o=await Z(t);break;case"open_popup":Y(t),o="Popup opened";break;case"navigate_to_create_form":await tt(t,"navigateToCreateForm"),o="Navigation executed";break;case"navigate_to_edit_form":await tt(t,"navigateToEditForm"),o="Navigation executed";break;case"navigate_to_prepopulate_form":await tt(t,"navigateToPrepopulateForm"),o="Navigation executed";break;case"navigate_to_organism_with_rwo_context":await tt(t,"navigateToOrganismWithRwoContext"),o="Navigation executed";break;case"navigate_to_page_with_rwo_context":await tt(t,"navigateToPageWithRwoContext"),o="Navigation executed";break;case"reset":et(t),o="Reset executed";break;case"destroy":ot(t),o="Destroy executed";break;default:throw new Error(`Unsupported action type: ${t.type}`)}return k?.(t,e,o),o}catch(o){const n=o instanceof Error?o:new Error(String(o));if(C?.(t,e,n),S)throw n;return null}},[_,k,C,S,J,X,Z,Y,tt,et,ot]),it=o(async()=>{if(0===O.length)return[];F(!0),R(0),T([]),L(null);try{const t=O.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,n=(()=>{if(!t)return O;return[...O.filter(t=>t&&"submit"!==t.type&&!e.has(t.type)&&!o(t.type)),...O.filter(t=>t&&"submit"===t.type),...O.filter(t=>t&&o(t.type)),...O.filter(t=>t&&e.has(t.type))]})(),r=[];for(let i=0;i<n.length;i+=1){R(i);const t=await rt(n[i],i);r.push(t),T([...r])}return b?.(r),r}catch(t){const e=t instanceof Error?t:new Error(String(t));throw L(e),e}finally{F(!1),R(-1)}},[O,rt,b,j,S]),at=o(t=>{h||(v?v(t):O.length>0&&it().catch(()=>{}))},[h,y,v,O,it]);return{executeActions:it,handleAction:at,isExecuting:I,currentActionIndex:E,results:A,error:D}};export{p 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,useCallback as o}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 r}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 i}from"../../../contexts/OrganismContext/useOrganismContext.js";import"../../../contexts/PopupContext/PopupContext.js";import{usePopupContext as a}from"../../../contexts/PopupContext/usePopupContext.js";import"../../../contexts/StateContext/StateContext.js";import{useStateContext as s}from"../../../contexts/StateContext/useStateContext.js";import{useSubmitForm as c}from"../../../contexts/ApiContext/globalQueries/form/useSubmitForm.js";import{getByPath as l,composeRwoParamsV2 as u,encodeObjectToBase64Url as m}from"../../../helpers/rwoContext.js";import{navigateToExternalLink as g,checkIsInternalLink as d,downloadFile as f}from"../../../helpers/utils.js";const p=(p,w={})=>{const{properties:x,moleculeId:y,onClick:v,disabled:h}=p,{onActionStart:_,onActionComplete:k,onActionError:C,onAllActionsComplete:b,stopOnError:S=!0,executeAsync:j=!0}=w,[I,F]=t(!1),[E,R]=t(-1),[A,T]=t([]),[D,L]=t(null),O=e(()=>{const t=x?.action,e=t?.action,o=e||t;return o?Array.isArray(o)?o:o&&"object"==typeof o&&"type"in o?[o]:[]:[]},[x?.action]),{setActivePopup:V,clearActivePopup:P}=a(),M=r()||{},W=i?.()||{},N=n?.()||{},U=s?.()||{},{onInternalNavigation:$,formId:q,routing:K,submitHandler:B,localState:H,localStateObject:Q,organismInfo:z}=W,{submitForm:G}=c()||{},J=o(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");const o=(N&&"function"==typeof N.getDmfValue?N.getDmfValue(e):void 0)??(M&&"function"==typeof M.getValues?l(M.getValues(),e):void 0)??(Q?l(Q,e):void 0)??(U?.stateConfig?l(U.stateConfig,e):void 0),n=o&&"object"==typeof o&&"value"in o?o.value:o;if(!n||"string"!=typeof n)throw new Error("Resolved link is empty");return void g(n)}if(d(t.link)){const e={};t.link?.targetFormId&&(e.organismId=String(t.link?.targetFormId)),t.link?.rwoKey&&(e.rwo=String(t.link?.rwoKey)),$?.({link:t.link.internalLink||"",query:e})}else g(t.link.externalLink||"")},[$]),X=o(async t=>{if(!t.download)throw new Error("Download configuration missing");f(t.download.url,t.download.name)},[]),Y=o(t=>{const e=t?.open_popup,o=e?.organismId;if(!o)throw new Error("Popup configuration missing");V?.({id:o})},[V]),Z=o(async t=>{if(!M?.handleSubmit)throw new Error("Form context not available for submit action");const e=(q??"").toString();if(!e)throw new Error("Form ID missing in OrganismContext for submit action");const o=K?.rwoRecordIdFromUrl;let n;return await M.handleSubmit(async r=>{const i={formId:e,data:r};let a;o&&(i.rwoRecordId=o);try{if(B)a=await B(i);else{if(!G)return;a=await G(i)}}catch(l){const e=t.submit?.onError?.link;if(e&&e.internalLink)if(d(e)){const t={};e?.rwoKey&&(t.rwo=String(e?.rwoKey)),$?.({link:e.internalLink||"",query:t})}else g(e.externalLink||"");throw l}n=a;const s=U?.stateHandler;"function"==typeof s&&e&&s({[e]:{interacted:"completed"}});const c=t?.submit?.onSuccess?.link;if(c&&(c.internalLink||c.externalLink))if(d(c)){const t={};c?.rwoKey&&(t.rwo=String(c?.rwoKey)),$?.({link:c.internalLink||"",query:t})}else g(c.externalLink||"");return M?.reset?.(),a},async t=>{throw new Error("Form validation failed")})(),n},[M,G,$,q,K]),tt=o(async(t,e)=>{const o=nt(t,e);if(!o)throw new Error(`Navigation configuration missing for ${e}`);switch(e){case"navigateToCreateForm":if(o.targetFormId){const t=`?organismId=${o.targetFormId}`;$?.({link:t})}break;case"navigateToEditForm":if(o.targetFormId){const t=K?.rwoRecordIdFromUrl,e=t||(z&&z.id?String(z.id):""),n=e?`?organismId=${o.targetFormId}&rwoRecordId=${e}`:`?organismId=${o.targetFormId}`;$?.({link:n})}break;case"navigateToPrepopulateForm":{const t=o?.link?.internalLink||"",{targetFormId:e}=o||{};if(!e&&!t)break;const n=Array.isArray(o?.fieldMap)?o.fieldMap:[],r=M&&"function"==typeof M.getValues?M.getValues():{},i=[(()=>{const t=N?.itemDataByDmfId||{},e=Object.entries(t).map(([t,e])=>[t,e&&"object"==typeof e&&"value"in e?e.value:e]);return Object.fromEntries(e)})(),r,Q||{},U?.stateConfig||{}],a={};n.filter(t=>t?.source&&t?.destination).forEach(t=>{let e;for(let o=0;o<i.length;o+=1){const n=l(i[o],String(t.source));if(void 0!==n){e=n;break}}void 0!==e&&(a[String(t.destination)]=e)});const s=t||`?organismId=${encodeURIComponent(String(e||""))}`;$?.({link:s,state:{prefill:a,targetFormId:e}})}break;case"navigateToOrganismWithRwoContext":{const t=o?.sourceDataModelFieldId,e=o?.targetOrganismIds;if(!t||!Array.isArray(e)||0===e.length)break;const n=t=>{if(t&&"object"==typeof t){const e=t;if("value"in e&&("string"==typeof e.value||"number"==typeof e.value||"boolean"==typeof e.value))return String(e.value);if("id"in e&&null!=e.id)return String(e.id)}return null!=t?String(t):void 0};let r;if(N&&"function"==typeof N.getDmfValue){const e=N.getDmfValue(t);r=n(e)}if(!r&&M&&"function"==typeof M.getValues){const e=l(M.getValues(),t);r=n(e)}if(!r&&Q){const e=l(Q,t);r=n(e)}if(!r&&U?.stateConfig){const e=l(U.stateConfig,t);r=n(e)}!r&&t&&(r=String(t));const i={};e.forEach(e=>{i[e]||(i[e]={}),r&&(i[e].rwoRecordId=String(r)),t&&(i[e][String(t)]=String(r||""))});const a={};Object.keys(i).length>0&&(a.rwoContext=m(i));const s=new URL(window?.location?.href||"/"),c=new URLSearchParams(s.search||"");Object.entries(a).forEach(([t,e])=>{null!=e&&c.set(t,String(e))}),s.pathname,c.toString(),$?.({link:s.pathname,query:a})}break;case"navigateToPageWithRwoContext":{const t=o?.link,e=!1!==o?.includeRwoRecordId,n=Array.isArray(o?.rwoContextMapping)?o.rwoContextMapping:[];if(!t?.internalLink)break;const r=o?.sourceDataModelFieldId,i=t=>{if(t&&"object"==typeof t){const e=t;if("value"in e&&("string"==typeof e.value||"number"==typeof e.value||"boolean"==typeof e.value))return String(e.value);if("id"in e&&null!=e.id)return String(e.id)}return null!=t?String(t):void 0};let a=K?.rwoRecordIdFromUrl;if(r){if(!a&&N&&"function"==typeof N.getDmfValue){a=i(N.getDmfValue(r))}if(!a&&M&&"function"==typeof M.getValues){a=i(l(M.getValues(),r))}if(!a&&Q){a=i(l(Q,r))}if(!a&&U?.stateConfig){a=i(l(U.stateConfig,r))}a||(a=String(r))}const s={...M&&"function"==typeof M.getValues?M.getValues():{},...Q||{},...U?.stateConfig||{},...(()=>{const t=N?.itemDataByDmfId||{},e=Object.entries(t).map(([t,e])=>[t,e&&"object"==typeof e&&"value"in e?e.value:e]);return Object.fromEntries(e)})()},{query:c}=u({includeRwoRecordId:e,recordId:a,mapping:n,contextSource:s});$?.({link:t.internalLink,query:c})}}},[$,M,H,Q,z,K]),et=o(t=>{M?.reset?.()},[M]),ot=o(t=>{M?.reset?.(),"function"==typeof P?P():"function"==typeof V&&V(null)},[M,P,V]),nt=o((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}},[]),rt=o(async(t,e)=>{_?.(t,e);try{let o;switch(t.type){case"link":await J(t),o="Link executed";break;case"download":await X(t),o="Download executed";break;case"submit":o=await Z(t);break;case"open_popup":Y(t),o="Popup opened";break;case"navigate_to_create_form":await tt(t,"navigateToCreateForm"),o="Navigation executed";break;case"navigate_to_edit_form":await tt(t,"navigateToEditForm"),o="Navigation executed";break;case"navigate_to_prepopulate_form":await tt(t,"navigateToPrepopulateForm"),o="Navigation executed";break;case"navigate_to_organism_with_rwo_context":await tt(t,"navigateToOrganismWithRwoContext"),o="Navigation executed";break;case"navigate_to_page_with_rwo_context":await tt(t,"navigateToPageWithRwoContext"),o="Navigation executed";break;case"reset":et(t),o="Reset executed";break;case"destroy":ot(t),o="Destroy executed";break;default:throw new Error(`Unsupported action type: ${t.type}`)}return k?.(t,e,o),o}catch(o){const n=o instanceof Error?o:new Error(String(o));if(C?.(t,e,n),S)throw n;return null}},[_,k,C,S,J,X,Z,Y,tt,et,ot]),it=o(async()=>{if(0===O.length)return[];F(!0),R(0),T([]),L(null);try{const t=O.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,n=(()=>{if(!t)return O;return[...O.filter(t=>t&&"submit"!==t.type&&!e.has(t.type)&&!o(t.type)),...O.filter(t=>t&&"submit"===t.type),...O.filter(t=>t&&o(t.type)),...O.filter(t=>t&&e.has(t.type))]})(),r=[];for(let i=0;i<n.length;i+=1){R(i);const t=await rt(n[i],i);r.push(t),T([...r])}return b?.(r),r}catch(t){const e=t instanceof Error?t:new Error(String(t));throw L(e),e}finally{F(!1),R(-1)}},[O,rt,b,j,S]),at=o(t=>{h||(v?v(t):O.length>0&&it().catch(()=>{}))},[h,y,v,O,it]);return{executeActions:it,handleAction:at,isExecuting:I,currentActionIndex:E,results:A,error:D}};export{p 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":["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","onInternalNavigation","formId","organismFormId","routing","submitHandler","pageSubmitHandler","localState","localStateObject","organismInfo","submitForm","useSubmitForm","executeLinkAction","useCallback","async","link","Error","type","fieldId","sourceDataModelFieldId","raw","getDmfValue","undefined","getValues","getByPath","stateConfig","value","navigateToExternalLink","checkIsInternalLink","query","targetFormId","organismId","String","rwoKey","rwo","internalLink","externalLink","executeDownloadAction","download","downloadFile","url","name","executePopupAction","openPopup","open_popup","popupId","id","executeSubmitAction","handleSubmit","currentFormId","toString","rwoRecordId","rwoRecordIdFromUrl","submitResult","values","payload","data","result","err","errorLink","submit","onError","successLink","onSuccess","reset","_invalid","executeNavigationAction","navigationType","config","getNavigationConfig","pageRwoId","candidateId","baseInternalLink","mappings","fieldMap","formValues","sourcesInPriority","itemDataByDmfId","entries","Object","map","key","val","fromEntries","prefill","filter","m","source","destination","forEach","resolved","i","length","candidate","composed","encodeURIComponent","state","sourceFieldId","targetOrganismIds","pickId","rec","orgId","keys","rwoContext","encodeObjectToBase64Url","currentUrl","URL","window","location","href","params","URLSearchParams","search","k","v","set","pathname","linkObj","includeRwoRecordId","rwoContextMapping","recordId","contextSource","composeRwoParamsV2","mapping","executeResetAction","executeDestroyAction","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","index","executeActions","containsSubmit","some","a","navigationTypes","Set","isCloser","t","orderedActions","has","executionResults","push","handleAction","event","catch"],"mappings":"4tDA8Ba,MAAAA,EAAkB,CAC7BC,EACAC,EAAkC,MAElC,MAAMC,WAAEA,EAAUC,WAAEA,EAAUC,QAAEA,EAAOC,SAAEA,GAAaL,GAChDM,cACJA,EAAaC,iBACbA,EAAgBC,cAChBA,EAAaC,qBACbA,EAAoBC,YACpBA,GAAc,EAAIC,aAClBA,GAAe,GACbV,GAGGW,EAAaC,GAAkBC,GAAS,IACxCC,EAAoBC,GAAyBF,GAAU,IACvDG,EAASC,GAAcJ,EAAoB,KAC3CK,EAAOC,GAAYN,EAAuB,MAG3CO,EAAUC,EAAQ,KACtB,MAAMC,EAAkBrB,GAAYsB,OAC9BC,EAAeF,GAAiBC,OAChCE,EAAeD,GAAgBF,EAErC,OAAKG,EAGDC,MAAMC,QAAQF,GACTA,EAILA,GAAwC,iBAAjBA,GAA6B,SAAUA,EACzD,CAACA,GAGH,GAZmB,IAazB,CAACxB,GAAYsB,UAGVK,eAAEA,EAAcC,iBAAEA,GAAqBC,IACvCC,EAAOC,KAAqB,GAC5BC,EAAeC,OAA0B,CAAA,EACzCC,EAAoBC,OAA2B,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C,MAAQ0C,EAAM,IAAI1C,MAAMgB,OAAO0B,IAG5D,MAFA7E,EAASD,GAEHA,CACP,CAAS,QACRN,GAAe,GACfG,GAAuB,EACxB,GACA,CAACK,EAAS0J,GAAqBtK,EAAsBE,EAAcD,IAGhEmL,GAAezI,EAClB0I,IACKzL,IAEAD,EACFA,EAAQ0L,GACCzK,EAAQ8G,OAAS,GAC1B8C,KAAiBc,MAAM,UAK3B,CAAC1L,EAAUF,EAAYC,EAASiB,EAAS4J,KAG3C,MAAO,CACLA,kBACAY,gBACAjL,cACAG,qBACAE,UACAE"}
|
|
1
|
+
{"version":3,"file":"useButtonAction.js","sources":["../../../../../../src/molecules/Button/hooks/useButtonAction.ts"],"sourcesContent":[null],"names":["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","onInternalNavigation","formId","organismFormId","routing","submitHandler","pageSubmitHandler","localState","localStateObject","organismInfo","submitForm","useSubmitForm","executeLinkAction","useCallback","async","link","Error","type","fieldId","sourceDataModelFieldId","raw","getDmfValue","undefined","getValues","getByPath","stateConfig","value","navigateToExternalLink","checkIsInternalLink","query","targetFormId","organismId","String","rwoKey","rwo","internalLink","externalLink","executeDownloadAction","download","downloadFile","url","name","executePopupAction","openPopup","open_popup","popupId","id","executeSubmitAction","handleSubmit","currentFormId","toString","rwoRecordId","rwoRecordIdFromUrl","submitResult","values","payload","data","result","err","errorLink","submit","onError","handler","stateHandler","interacted","successLink","onSuccess","reset","_invalid","executeNavigationAction","navigationType","config","getNavigationConfig","pageRwoId","candidateId","baseInternalLink","mappings","fieldMap","formValues","sourcesInPriority","itemDataByDmfId","entries","Object","map","key","val","fromEntries","prefill","filter","m","source","destination","forEach","resolved","i","length","candidate","composed","encodeURIComponent","state","sourceFieldId","targetOrganismIds","pickId","rec","orgId","keys","rwoContext","encodeObjectToBase64Url","currentUrl","URL","window","location","href","params","URLSearchParams","search","k","v","set","pathname","linkObj","includeRwoRecordId","rwoContextMapping","recordId","contextSource","composeRwoParamsV2","mapping","executeResetAction","executeDestroyAction","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","index","executeActions","containsSubmit","some","a","navigationTypes","Set","isCloser","t","orderedActions","has","executionResults","push","handleAction","event","catch"],"mappings":"4tDA8Ba,MAAAA,EAAkB,CAC7BC,EACAC,EAAkC,MAElC,MAAMC,WAAEA,EAAUC,WAAEA,EAAUC,QAAEA,EAAOC,SAAEA,GAAaL,GAChDM,cACJA,EAAaC,iBACbA,EAAgBC,cAChBA,EAAaC,qBACbA,EAAoBC,YACpBA,GAAc,EAAIC,aAClBA,GAAe,GACbV,GAGGW,EAAaC,GAAkBC,GAAS,IACxCC,EAAoBC,GAAyBF,GAAU,IACvDG,EAASC,GAAcJ,EAAoB,KAC3CK,EAAOC,GAAYN,EAAuB,MAG3CO,EAAUC,EAAQ,KACtB,MAAMC,EAAkBrB,GAAYsB,OAC9BC,EAAeF,GAAiBC,OAChCE,EAAeD,GAAgBF,EAErC,OAAKG,EAGDC,MAAMC,QAAQF,GACTA,EAILA,GAAwC,iBAAjBA,GAA6B,SAAUA,EACzD,CAACA,GAGH,GAZmB,IAazB,CAACxB,GAAYsB,UAGVK,eAAEA,EAAcC,iBAAEA,GAAqBC,IACvCC,EAAOC,KAAqB,GAC5BC,EAAeC,OAA0B,CAAA,EACzCC,EAAoBC,OAA2B,CAAA,EAC/CC,EAAYC,OAAuB,CAAA,GACnCC,qBACJA,EACAC,O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,CAAC,MAAO7F,GACP,MAAM9E,EAAQ8E,aAAe1C,MAAQ0C,EAAM,IAAI1C,MAAMgB,OAAO0B,IAG5D,MAFA7E,EAASD,GAEHA,CACP,CAAS,QACRN,GAAe,GACfG,GAAuB,EACxB,GACA,CAACK,EAAS6J,GAAqBzK,EAAsBE,EAAcD,IAGhEsL,GAAe5I,EAClB6I,IACK5L,IAEAD,EACFA,EAAQ6L,GACC5K,EAAQiH,OAAS,GAC1B8C,KAAiBc,MAAM,UAK3B,CAAC7L,EAAUF,EAAYC,EAASiB,EAAS+J,KAG3C,MAAO,CACLA,kBACAY,gBACApL,cACAG,qBACAE,UACAE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as o}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import"../../contexts/AccountButtonContext/AccountButtonContext.js";import i,{useState as r,useRef as n,useEffect as l,useMemo as a}from"react";import"../../contexts/ApiContext/ApiContext.js";import{useContainerRuntime as d}from"../../contexts/ContainerRuntimeContext/ContainerRuntimeContext.js";import"../../contexts/FormStepContext/FormStepContext.js";import{useFormContext as m,Controller as s}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{useLayoutContext as p}from"../../contexts/LayoutContext/useLayoutContext.js";import"../../contexts/MlrRichTextViewerContext/MlrRichTextViewerContext.js";import"../../contexts/OrganismContext/OrganismContext.js";import{useOrganismContext as u}from"../../contexts/OrganismContext/useOrganismContext.js";import"../../contexts/PopupContext/PopupContext.js";import"../../contexts/StateContext/StateContext.js";import{useStateContext as c}from"../../contexts/StateContext/useStateContext.js";import"@tanstack/react-query";import{usePickListOptions as g}from"../../contexts/ApiContext/globalQueries/pickList/usePickListOptions.js";import x from"../../node_modules/@mui/material/esm/FormHelperText/FormHelperText.js";import h from"../../node_modules/@mui/material/esm/Typography/Typography.js";import f from"../../node_modules/@mui/material/esm/InputLabel/InputLabel.js";import b from"../../node_modules/@mui/material/esm/FormControl/FormControl.js";import C from"../../node_modules/@mui/material/esm/OutlinedInput/OutlinedInput.js";import y from"../../node_modules/@mui/material/esm/Select/Select.js";import v from"../../node_modules/@mui/material/esm/Grow/Grow.js";import S from"../../node_modules/@mui/material/esm/Paper/Paper.js";import j from"../../node_modules/@mui/material/esm/MenuList/MenuList.js";import k from"../../node_modules/@mui/material/esm/Popper/Popper.js";import I from"../../node_modules/@mui/material/esm/MenuItem/MenuItem.js";import M from"../../node_modules/@mui/material/esm/CircularProgress/CircularProgress.js";const L=({open:L,text:O,disabled:W,sx:T,placeholderText:w,required:F=!1,requiredErrorText:H="This field is required",validationErrorText:P="Invalid format",isDisplayOnly:z=!1,displayText:R,visible:_=!0,fontSize:B,fontFamily:A,fontWeight:V,textColor:q,textAlign:E,borderColor:$,color:D,backgroundColor:G,marginLeft:Q="0",marginTop:X="0",marginRight:Y="0",marginBottom:J="0",paddingLeft:K="12px",paddingTop:N="14px",paddingRight:U="12px",paddingBottom:Z="14px",width:ee,height:te,minHeight:oe,maxHeight:ie,minWidth:re,maxWidth:ne,configurationItemInfo:le={},name:ae,sourceDataModelField:de,predefinedValue:me,...se})=>{const pe=z?void 0:de,{dataModelFieldOptions:ue,isLoading:ce}=g(pe),ge=m(),xe=ge?.control,he=!!ge&&!!xe&&!!ae,{formState:fe}=ge||{},{localStateObject:be,localState:Ce,setLocalStateValue:ye,isConfigurationMode:ve,selectedConfigurationItemId:Se}=u(),{stateConfig:je}=c(),{isMLR:ke}=p(),Ie=d(),Me=be||je,Le=de?Me?.[de]:void 0,Oe=Le?.value||("string"==typeof Le||"number"==typeof Le?Le:void 0),We=de?Ie?.getDmfValue(de):void 0,Te="string"==typeof We||"number"==typeof We?We:We&&"object"==typeof We?We.value??We.label??We.id:void 0,[we,Fe]=r(""),[He,Pe]=r(!1),[ze,Re]=r(!1),_e=n(null),Be=n(null),Ae=i.useCallback(e=>{Be.current=e,Re(null!==e)},[]),Ve=ve&&Se===le?.["data-configuration-id"];l(()=>{ve&&Pe(!!Ve)},[Ve,ve]);const qe=a(()=>!(Boolean(W)||null!=me&&""!==me)&&(ve?!!Ve&&He:ke?L||!1:void 0),[ve,Ve,He,ke,L,W,me]),Ee=a(()=>null!=me&&""!==me,[me]),$e=a(()=>Boolean(W)||Ee,[W,Ee]);l(()=>{Ee&&null!=me&&(he?ge?.setValue(ae,me):Fe(me))},[Ee,me,he,ge,ae]);const De=a(()=>({required:!!F&&H,validate:()=>!0}),[F,H]),Ge=a(()=>(ue||[]).map(e=>"string"==typeof e?{id:e,label:e}:e),[ue]),Qe=!$e&&(ve&&Ve||ke&&L),Xe=Qe&&ze&&null!==Be.current,Ye=a(()=>{const e=(()=>{switch(E){case"center":return"center";case"right":return"flex-end";case"justify":return"space-between";default:return"flex-start"}})(),t=q||D||"rgba(0, 0, 0, 0.87)",o=q?`${q}50`:"rgba(0, 0, 0, 0.6)",i=q?`${q}30`:"rgba(0, 0, 0, 0.26)";return{typography:{fontSize:B||"1rem",fontFamily:"string"==typeof A?A:"inherit",color:t},menuItem:{fontSize:B||"1rem",fontFamily:"string"==typeof A?A:"inherit",color:t,minHeight:"48px",padding:"6px 16px",transition:"background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms","&:hover":{backgroundColor:"rgba(127, 127, 127, 0.08)"},"&.Mui-selected":{backgroundColor:"rgba(25, 118, 210, 0.12)","&:hover":{backgroundColor:"rgba(25, 118, 210, 0.2)"}},"&.Mui-disabled":{color:i,backgroundColor:"rgba(127, 127, 127, 0.06)"}},inputSx:{fontSize:B,fontFamily:A,fontWeight:V,color:D,minHeight:"56px","& .MuiOutlinedInput-notchedOutline":{borderColor:$||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:$||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:$||"inherit"},"& .MuiSelect-select":{display:"flex",alignItems:"center",justifyContent:e,backgroundColor:G,textAlign:E,boxSizing:"border-box",paddingLeft:K,paddingTop:N,paddingRight:U,paddingBottom:Z,minHeight:"1.4375em",lineHeight:"1.4375em"}},formControlSx:{marginLeft:Q,marginTop:X,marginRight:Y,marginBottom:J,...ee&&{width:ee},...te&&{height:te},...ne&&{maxWidth:ne},...oe&&{minHeight:oe},...ie&&{maxHeight:ie},...re?{minWidth:re}:ee?{}:{minWidth:"240px"},...T},placeholderTypography:{fontSize:B||"1rem",fontFamily:"string"==typeof A?A:"inherit",color:o},placeholderColor:o}},[E,B,A,D,q,V,$,G,K,N,U,Z,Q,X,Y,J,ee,te,ne,re,oe,ie]),Je=()=>t(I,{disabled:!0,value:"",sx:{...Ye.menuItem,backgroundColor:"rgba(0, 0, 0, 0.06) !important","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.06) !important"}},children:t("em",{style:{fontStyle:"italic",...Ye.placeholderTypography},children:w||"Select an option"})});l(()=>{if(!z||!he)return;const e=null!=Te?String(Te):void 0,t=null!=Oe?String(Oe):void 0,o=("string"==typeof R&&""!==R?R:void 0)??e??t;void 0!==o&&ge?.setValue(ae,o)},[z,he,R,Te,Oe,ge,ae]);const Ke=(o,i)=>ce?e(I,{disabled:!0,value:"loading",sx:Ye.menuItem,children:[t(M,{size:20,sx:{mr:1}}),"Loading..."]}):Ge.map(e=>t(I,{value:e.id,selected:o===e.id,onClick:i?()=>i(e.id):void 0,sx:Ye.menuItem,children:e.label},e.id));if(z){const o=("string"==typeof R&&""!==R?R:void 0)??(null!=Te?String(Te):void 0)??(null!=Oe?String(Oe):void 0)??(w||"-");return e("div",{style:{display:"inline-flex",flexDirection:"column",marginTop:X,marginRight:Y,marginBottom:J,marginLeft:Q,...ee&&{width:ee},...te&&{height:te},...oe&&{minHeight:oe},...ie&&{maxHeight:ie},...re&&{minWidth:re},...ne&&{maxWidth:ne}},...le,children:[O&&t("div",{style:{marginBottom:4},children:t(x,{sx:{fontSize:B,fontFamily:A,fontWeight:V,color:q||"#000",marginLeft:0,textAlign:E},children:O})}),t(h,{sx:{fontSize:B,fontFamily:A,fontWeight:V,color:q,textAlign:E,paddingLeft:K,paddingTop:N,paddingRight:U,paddingBottom:Z,backgroundColor:G,border:`1px solid ${$||"#ccc"}`,borderRadius:"4px",minWidth:"120px"},children:o})]})}const Ne={slotProps:{paper:{elevation:3,sx:{borderRadius:"4px",backgroundColor:G||"background.paper",boxShadow:"0px 5px 5px -3px rgba(0,0,0,0.2), 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12)",...Ye.typography,...Xe?{display:"none !important",visibility:"hidden !important",opacity:"0 !important",pointerEvents:"none !important",position:"absolute !important",top:"-9999px !important",left:"-9999px !important",zIndex:"-9999 !important"}:{}}}},MenuListProps:{sx:{padding:"8px 0",...G&&{backgroundColor:G},"& .MuiMenuItem-root":Ye.menuItem}},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},...Xe?{disableScrollLock:!0,disablePortal:!0,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:!0,hideBackdrop:!0}:{}},Ue=(e,t)=>{t?.onChange?t.onChange(e):(Fe(e),de&&ye&&ye(de,{id:e}))},Ze=e=>{if(!e||""===e)return t("em",{style:{color:Ye.placeholderColor,fontStyle:"italic"},children:w||"Select an option"});const o=Ge.find(t=>t.id===e);return o?o.label:e},et=(o,i)=>e(y,{...o||{},...se,...ve?{open:qe}:{},...ke?{open:qe}:{},...Qe?{open:!1,onClose:()=>{},onOpen:()=>{}}:{},error:i,disabled:$e,value:o?.value??we,onChange:e=>{Xe||Ue(e.target.value,o)},labelId:`select-label-${ae}`,input:t(C,{label:O}),displayEmpty:!0,renderValue:Ze,MenuProps:Ne,sx:{...Ye.inputSx,...ee&&{width:ee},...te&&{height:te},...re&&{minWidth:re},...ne&&{maxWidth:ne},...oe&&{minHeight:oe},...ie&&{maxHeight:ie}},inputProps:{"aria-label":O},children:[Je(),Ke()]}),tt=o=>{if(!Xe||$e)return null;const i=o?.value??we;return t(k,{open:!0,anchorEl:Be.current,placement:"bottom-start",disablePortal:!0,transition:!0,sx:{zIndex:1300},children:({TransitionProps:r})=>t(v,{...r,timeout:150,style:{transformOrigin:"top left"},children:t(S,{elevation:3,sx:{borderRadius:"4px",backgroundColor:G||"background.paper",minWidth:Be.current?.offsetWidth||240,width:Be.current?.offsetWidth||240,maxHeight:300,overflowY:"auto",overflowX:"hidden",scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none",width:0,height:0},boxShadow:"rgba(0, 0, 0, 0.2) 0px 5px 5px -3px, rgba(0, 0, 0, 0.14) 0px 8px 10px 1px, rgba(0, 0, 0, 0.12) 0px 3px 14px 2px",...Ye.typography},children:e(j,{sx:{padding:"8px 0",...G&&{backgroundColor:G},"& .MuiMenuItem-root":Ye.menuItem},children:[Je(),Ke(i,e=>Ue(e,o))]})})})})};return _?t("div",{ref:_e,style:{position:"relative",...ee&&{width:ee},...te&&{height:te},...re&&{minWidth:re},...ne&&{maxWidth:ne},...oe&&{minHeight:oe},...ie&&{maxHeight:ie}},...le,onClick:e=>{if(ve&&le&&"onClick"in le){e.stopPropagation();le.onClick()}},children:e(b,{ref:Ae,variant:"outlined",sx:Ye.formControlSx,error:!!fe?.errors?.[ae],disabled:$e,required:F,children:[t(f,{id:`select-label-${ae}`,shrink:!0,sx:{color:q||"rgba(0, 0, 0, 0.6)",fontSize:B,fontFamily:A,fontWeight:V,"&.Mui-focused":{color:q||"rgba(0, 0, 0, 0.6)"}},children:O}),he?t(s,{name:ae,control:xe,rules:De,render:({field:t,fieldState:{error:i}})=>e(o,{children:[et(t,!!i),tt(t)]})}):e(o,{children:[et(void 0,!1),tt(void 0)]}),fe?.errors?.[ae]&&t(x,{error:!0,children:fe?.errors?.[ae]?.message||("required"===fe?.errors?.[ae]?.type?H:P)})]})}):null};export{L as SelectMolecule};
|
|
1
|
+
import{jsxs as t,jsx as e,Fragment as o}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import"../../contexts/AccountButtonContext/AccountButtonContext.js";import i,{useState as r,useRef as n,useEffect as l,useMemo as a}from"react";import"../../contexts/ApiContext/ApiContext.js";import{useContainerRuntime as d}from"../../contexts/ContainerRuntimeContext/ContainerRuntimeContext.js";import"../../contexts/FormStepContext/FormStepContext.js";import{useFormContext as m,Controller as s}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{useLayoutContext as p}from"../../contexts/LayoutContext/useLayoutContext.js";import"../../contexts/MlrRichTextViewerContext/MlrRichTextViewerContext.js";import"../../contexts/OrganismContext/OrganismContext.js";import{useOrganismContext as u}from"../../contexts/OrganismContext/useOrganismContext.js";import"../../contexts/PopupContext/PopupContext.js";import"../../contexts/StateContext/StateContext.js";import{useStateContext as c}from"../../contexts/StateContext/useStateContext.js";import"@tanstack/react-query";import{usePickListOptions as g}from"../../contexts/ApiContext/globalQueries/pickList/usePickListOptions.js";import x from"../../node_modules/@mui/material/esm/FormHelperText/FormHelperText.js";import h from"../../node_modules/@mui/material/esm/Typography/Typography.js";import f from"../../node_modules/@mui/material/esm/InputLabel/InputLabel.js";import b from"../../node_modules/@mui/material/esm/FormControl/FormControl.js";import C from"../../node_modules/@mui/material/esm/OutlinedInput/OutlinedInput.js";import y from"../../node_modules/@mui/material/esm/Select/Select.js";import v from"../../node_modules/@mui/material/esm/Grow/Grow.js";import S from"../../node_modules/@mui/material/esm/Paper/Paper.js";import j from"../../node_modules/@mui/material/esm/MenuList/MenuList.js";import k from"../../node_modules/@mui/material/esm/Popper/Popper.js";import I from"../../node_modules/@mui/material/esm/MenuItem/MenuItem.js";import M from"../../node_modules/@mui/material/esm/CircularProgress/CircularProgress.js";const L=({open:L,text:w,disabled:O,sx:T,placeholderText:W,required:F=!1,requiredErrorText:H="This field is required",validationErrorText:P="Invalid format",isDisplayOnly:z=!1,displayText:R,visible:_=!0,fontSize:B,fontFamily:A,fontWeight:V,textColor:q,textAlign:E,borderColor:$,color:D,backgroundColor:G,marginLeft:Q="0",marginTop:X="0",marginRight:Y="0",marginBottom:J="0",paddingLeft:K="12px",paddingTop:N="14px",paddingRight:U="12px",paddingBottom:Z="14px",width:tt,height:et,minHeight:ot,maxHeight:it,minWidth:rt,maxWidth:nt,configurationItemInfo:lt={},name:at,sourceDataModelField:dt,predefinedValue:mt,...st})=>{const pt=z?void 0:dt,{dataModelFieldOptions:ut,isLoading:ct}=g(pt),gt=m(),xt=gt?.control,ht=!!gt&&!!xt&&!!at,{formState:ft}=gt||{},{localStateObject:bt,localState:Ct,setLocalStateValue:yt,isConfigurationMode:vt,selectedConfigurationItemId:St}=u(),{stateConfig:jt}=c(),{isMLR:kt}=p(),It=d(),Mt=bt||jt,Lt=dt?Mt?.[dt]:void 0,wt=Lt?.value||("string"==typeof Lt||"number"==typeof Lt?Lt:void 0),Ot=dt?It?.getDmfValue(dt):void 0,Tt="string"==typeof Ot||"number"==typeof Ot?Ot:Ot&&"object"==typeof Ot?Ot.value??Ot.label??Ot.id:void 0,[Wt,Ft]=r(""),[Ht,Pt]=r(!1),[zt,Rt]=r(!1),_t=n(null),Bt=n(null),At=i.useCallback(t=>{Bt.current=t,Rt(null!==t)},[]),Vt=vt&&St===lt?.["data-configuration-id"];l(()=>{vt&&Pt(!!Vt)},[Vt,vt]);const qt=a(()=>!(Boolean(O)||null!=mt&&""!==mt)&&(vt?!!Vt&&Ht:kt?L||!1:void 0),[vt,Vt,Ht,kt,L,O,mt]),Et=a(()=>null!=mt&&""!==mt,[mt]),$t=a(()=>Boolean(O)||Et,[O,Et]);l(()=>{Et&&null!=mt&&(ht?gt?.setValue(at,mt):Ft(mt))},[Et,mt,ht,gt,at]);const Dt=a(()=>({required:!!F&&H,validate:()=>!0}),[F,H]),Gt=a(()=>(ut||[]).map(t=>"string"==typeof t?{id:t,label:t}:t),[ut]),Qt=!$t&&(vt&&Vt||kt&&L),Xt=Qt&&zt&&null!==Bt.current,Yt=a(()=>{const t=(()=>{switch(E){case"center":return"center";case"right":return"flex-end";case"justify":return"space-between";default:return"flex-start"}})(),e=q||D||"rgba(0, 0, 0, 0.87)",o=q?`${q}50`:"rgba(0, 0, 0, 0.6)",i=q?`${q}30`:"rgba(0, 0, 0, 0.26)";return{typography:{fontSize:B||"1rem",fontFamily:"string"==typeof A?A:"inherit",color:e},menuItem:{fontSize:B||"1rem",fontFamily:"string"==typeof A?A:"inherit",color:e,minHeight:"48px",padding:"6px 16px",transition:"background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms","&:hover":{backgroundColor:"rgba(127, 127, 127, 0.08)"},"&.Mui-selected":{backgroundColor:"rgba(25, 118, 210, 0.12)","&:hover":{backgroundColor:"rgba(25, 118, 210, 0.2)"}},"&.Mui-disabled":{color:i,backgroundColor:"rgba(127, 127, 127, 0.06)"}},inputSx:{fontSize:B,fontFamily:A,fontWeight:V,color:D,minHeight:"56px","& .MuiOutlinedInput-notchedOutline":{borderColor:$||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:$||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:$||"inherit"},"& .MuiSelect-select":{display:"flex",alignItems:"center",justifyContent:t,backgroundColor:G,textAlign:E,boxSizing:"border-box",paddingLeft:K,paddingTop:N,paddingRight:U,paddingBottom:Z,minHeight:"1.4375em",lineHeight:"1.4375em"}},formControlSx:{marginLeft:Q,marginTop:X,marginRight:Y,marginBottom:J,...tt&&{width:tt},...et&&{height:et},...nt&&{maxWidth:nt},...ot&&{minHeight:ot},...it&&{maxHeight:it},...rt?{minWidth:rt}:tt?{}:{minWidth:"240px"},...T},placeholderTypography:{fontSize:B||"1rem",fontFamily:"string"==typeof A?A:"inherit",color:o},placeholderColor:o}},[E,B,A,D,q,V,$,G,K,N,U,Z,Q,X,Y,J,tt,et,nt,rt,ot,it]),Jt=()=>e(I,{disabled:!0,value:"",sx:{...Yt.menuItem,backgroundColor:"rgba(0, 0, 0, 0.06) !important","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.06) !important"}},children:e("em",{style:{fontStyle:"italic",...Yt.placeholderTypography},children:W||"Select an option"})});l(()=>{if(!z||!ht)return;const t=null!=Tt?String(Tt):void 0,e=null!=wt?String(wt):void 0,o=("string"==typeof R&&""!==R?R:void 0)??t??e;void 0!==o&>?.setValue(at,o)},[z,ht,R,Tt,wt,gt,at]);const Kt=(o,i)=>ct?t(I,{disabled:!0,value:"loading",sx:Yt.menuItem,children:[e(M,{size:20,sx:{mr:1}}),"Loading..."]}):Gt.map(t=>e(I,{value:t.id,selected:o===t.id,onClick:i?()=>i(t.id):void 0,sx:Yt.menuItem,children:t.label},t.id));if(z){const o=!tt||"auto"===tt,i=("string"==typeof R&&""!==R?R:void 0)??(null!=Tt?String(Tt):void 0)??(null!=wt?String(wt):void 0)??(W||"-");return t("div",{style:{display:"inline-flex",flexDirection:"column",marginTop:X,marginRight:Y,marginBottom:J,marginLeft:Q,...tt?{width:tt}:{width:"fit-content"},...et&&{height:et},...ot&&{minHeight:ot},...it&&{maxHeight:it},...rt&&{minWidth:rt},...nt&&{maxWidth:nt}},...lt,children:[w&&e("div",{style:{marginBottom:4},children:e(x,{sx:{fontSize:B,fontFamily:A,fontWeight:V,color:q||"#000",marginLeft:0,textAlign:E},children:w})}),e(h,{sx:{fontSize:B,fontFamily:A,fontWeight:V,color:q,textAlign:E,paddingLeft:K,paddingTop:N,paddingRight:U,paddingBottom:Z,backgroundColor:G,border:`1px solid ${$||"#ccc"}`,borderRadius:"4px",...o?{width:"fit-content"}:{}},children:i})]})}const Nt={slotProps:{paper:{elevation:3,sx:{borderRadius:"4px",backgroundColor:G||"background.paper",boxShadow:"0px 5px 5px -3px rgba(0,0,0,0.2), 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12)",...Yt.typography,...Xt?{display:"none !important",visibility:"hidden !important",opacity:"0 !important",pointerEvents:"none !important",position:"absolute !important",top:"-9999px !important",left:"-9999px !important",zIndex:"-9999 !important"}:{}}}},MenuListProps:{sx:{padding:"8px 0",...G&&{backgroundColor:G},"& .MuiMenuItem-root":Yt.menuItem}},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},...Xt?{disableScrollLock:!0,disablePortal:!0,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:!0,hideBackdrop:!0}:{}},Ut=(t,e)=>{e?.onChange?e.onChange(t):(Ft(t),dt&&yt&&yt(dt,{id:t}))},Zt=t=>{if(!t||""===t)return e("em",{style:{color:Yt.placeholderColor,fontStyle:"italic"},children:W||"Select an option"});const o=Gt.find(e=>e.id===t);return o?o.label:t},te=(o,i)=>t(y,{...o||{},...st,...vt?{open:qt}:{},...kt?{open:qt}:{},...Qt?{open:!1,onClose:()=>{},onOpen:()=>{}}:{},error:i,disabled:$t,value:o?.value??Wt,onChange:t=>{Xt||Ut(t.target.value,o)},labelId:`select-label-${at}`,input:e(C,{label:w}),displayEmpty:!0,renderValue:Zt,MenuProps:Nt,sx:{...Yt.inputSx,...tt&&{width:tt},...et&&{height:et},...rt&&{minWidth:rt},...nt&&{maxWidth:nt},...ot&&{minHeight:ot},...it&&{maxHeight:it}},inputProps:{"aria-label":w},children:[Jt(),Kt()]}),ee=o=>{if(!Xt||$t)return null;const i=o?.value??Wt;return e(k,{open:!0,anchorEl:Bt.current,placement:"bottom-start",disablePortal:!0,transition:!0,sx:{zIndex:1300},children:({TransitionProps:r})=>e(v,{...r,timeout:150,style:{transformOrigin:"top left"},children:e(S,{elevation:3,sx:{borderRadius:"4px",backgroundColor:G||"background.paper",minWidth:Bt.current?.offsetWidth||240,width:Bt.current?.offsetWidth||240,maxHeight:300,overflowY:"auto",overflowX:"hidden",scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none",width:0,height:0},boxShadow:"rgba(0, 0, 0, 0.2) 0px 5px 5px -3px, rgba(0, 0, 0, 0.14) 0px 8px 10px 1px, rgba(0, 0, 0, 0.12) 0px 3px 14px 2px",...Yt.typography},children:t(j,{sx:{padding:"8px 0",...G&&{backgroundColor:G},"& .MuiMenuItem-root":Yt.menuItem},children:[Jt(),Kt(i,t=>Ut(t,o))]})})})})};return _?e("div",{ref:_t,style:{position:"relative",...tt&&{width:tt},...et&&{height:et},...rt&&{minWidth:rt},...nt&&{maxWidth:nt},...ot&&{minHeight:ot},...it&&{maxHeight:it}},...lt,onClick:t=>{if(vt&<&&"onClick"in lt){t.stopPropagation();lt.onClick()}},children:t(b,{ref:At,variant:"outlined",sx:Yt.formControlSx,error:!!ft?.errors?.[at],disabled:$t,required:F,children:[e(f,{id:`select-label-${at}`,shrink:!0,sx:{color:q||"rgba(0, 0, 0, 0.6)",fontSize:B,fontFamily:A,fontWeight:V,"&.Mui-focused":{color:q||"rgba(0, 0, 0, 0.6)"}},children:w}),ht?e(s,{name:at,control:xt,rules:Dt,render:({field:e,fieldState:{error:i}})=>t(o,{children:[te(e,!!i),ee(e)]})}):t(o,{children:[te(void 0,!1),ee(void 0)]}),ft?.errors?.[at]&&e(x,{error:!0,children:ft?.errors?.[at]?.message||("required"===ft?.errors?.[at]?.type?H:P)})]})}):null};export{L as SelectMolecule};
|
|
2
2
|
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../../../src/molecules/Select/Select.tsx"],"sourcesContent":[null],"names":["SelectMolecule","open","text","disabled","sx","placeholderText","required","requiredErrorText","validationErrorText","isDisplayOnly","displayText","visible","fontSize","fontFamily","fontWeight","textColor","textAlign","borderColor","color","backgroundColor","marginLeft","marginTop","marginRight","marginBottom","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","minHeight","maxHeight","minWidth","maxWidth","configurationItemInfo","name","sourceDataModelField","predefinedValue","props","fieldIdForOptions","undefined","dataModelFieldOptions","isLoading","isDataModelFieldOptionsLoading","usePickListOptions","formContext","useFormContext","control","isInFormContext","formState","localStateObject","localState","_localState","setLocalStateValue","isConfigurationMode","selectedConfigurationItemId","useOrganismContext","stateConfig","useStateContext","isMLR","useLayoutContext","containerRuntime","useContainerRuntime","stateObject","dataModelEntry","dataModelFieldDisplayValue","value","containerScopedEntry","getDmfValue","containerDisplayValue","label","id","internalValue","setInternalValue","useState","configModeOpen","setConfigModeOpen","isFormControlMounted","setIsFormControlMounted","selectContainerRef","useRef","formControlRef","formControlRefCallback","React","useCallback","node","current","isSelectedInConfigMode","useEffect","shouldBeOpen","useMemo","Boolean","isPredefined","isDisabled","setValue","rules","validate","normalizedOptions","map","item","shouldUseCustomDropdown","canRenderCustomDropdown","commonStyles","justifyContent","baseTextColor","placeholderColor","disabledColor","typography","menuItem","padding","transition","inputSx","display","alignItems","boxSizing","lineHeight","formControlSx","placeholderTypography","renderPlaceholderItem","_jsx","MenuItem","children","style","fontStyle","containerText","String","stateText","val","renderOptionItems","currentValue","onItemClick","_jsxs","CircularProgress","size","mr","o","selected","onClick","resolvedDisplayText","flexDirection","FormHelperText","Typography","border","borderRadius","menuProps","slotProps","paper","elevation","boxShadow","visibility","opacity","pointerEvents","position","top","left","zIndex","MenuListProps","anchorOrigin","vertical","horizontal","transformOrigin","disableScrollLock","disablePortal","disableAutoFocus","disableRestoreFocus","disableEnforceFocus","hideBackdrop","handleValueChange","field","onChange","renderValue","selectedId","opt","find","renderSelect","hasError","MuiSelect","onClose","onOpen","error","e","target","labelId","input","OutlinedInput","displayEmpty","MenuProps","inputProps","renderCustomDropdown","Popper","anchorEl","placement","TransitionProps","Grow","timeout","Paper","offsetWidth","overflowY","overflowX","scrollbarWidth","msOverflowStyle","MenuList","ref","stopPropagation","FormControl","variant","errors","InputLabel","shrink","Controller","render","fieldState","message","type"],"mappings":"quEA4Ea,MAAAA,EAAgD,EAC3DC,OACAC,OACAC,WACAC,KACAC,kBACAC,YAAW,EACXC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HACC9C,GAAaK,YACjBc,SAEDU,EAACsE,EACC,CAAArM,GAAI,CACFyG,QAAS,WACL1F,GAAmB,CAAEA,mBACzB,sBAAuBmF,GAAaM,UAGrCa,SAAA,CAAAH,KACAU,GAAkBC,EAAe1D,GAAOgG,GAAkBhG,EAAIiG,cAU7E,OAAK7J,EAKH4G,EACE,MAAA,CAAAmF,IAAK3H,GACL2C,MAAO,CACL8B,SAAU,cACN5H,IAAS,CAAEA,aACXC,IAAU,CAAEA,cACZG,IAAY,CAAEA,gBACdC,IAAY,CAAEA,gBACdH,IAAa,CAAEA,iBACfC,IAAa,CAAEA,kBAEjBG,GACJuG,QAAU2C,IACR,GAAI9H,IAAuBpB,IAAyB,YAAaA,GAAuB,CACtFkJ,EAAEuB,kBACsBzK,GACRuG,SACjB,GACFhB,SAEDU,EAACyE,EACC,CAAAF,IAAKxH,GACL2H,QAAQ,WACRzM,GAAIkG,GAAac,cACjB+D,QAASlI,IAAW6J,SAAS3K,IAC7BhC,SAAU0F,GACVvF,SAAUA,EAAQmH,SAAA,CAElBF,EAACwF,GACCxI,GAAI,gBAAgBpC,KACpB6K,QAAQ,EACR5M,GAAI,CACFc,MAAOH,GAAa,qBACpBH,WACAC,aACAC,aACA,gBAAiB,CACfI,MAAOH,GAAa,uBAIvB0G,SAAAvH,IAGF8C,GACCuE,EAAC0F,GACC9K,KAAMA,GACNY,QAASA,GACTgD,MAAOA,GACPmH,OAAQ,EAAG1C,QAAO2C,YAAchC,YAC9BhD,eACG2C,GAAaN,IAASW,GACtBS,GAAqBpB,QAK5BrC,eACG2C,QAAatI,GAAW,GACxBoJ,QAAqBpJ,MAIzBS,IAAW6J,SAAS3K,KACnBoF,EAACqB,GAAeuC,OAAK,EAAA1D,SACjBxE,IAAW6J,SAAS3K,KAA+CiL,UAEnE,aADEnK,IAAW6J,SAAS3K,KAA+CkL,KAEjE9M,EACAC,UAzEP"}
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../../../src/molecules/Select/Select.tsx"],"sourcesContent":[null],"names":["SelectMolecule","open","text","disabled","sx","placeholderText","required","requiredErrorText","validationErrorText","isDisplayOnly","displayText","visible","fontSize","fontFamily","fontWeight","textColor","textAlign","borderColor","color","backgroundColor","marginLeft","marginTop","marginRight","marginBottom","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","minHeight","maxHeight","minWidth","maxWidth","configurationItemInfo","name","sourceDataModelField","predefinedValue","props","fieldIdForOptions","undefined","dataModelFieldOptions","isLoading","isDataModelFieldOptionsLoading","usePickListOptions","formContext","useFormContext","control","isInFormContext","formState","localStateObject","localState","_localState","setLocalStateValue","isConfigurationMode","selectedConfigurationItemId","useOrganismContext","stateConfig","useStateContext","isMLR","useLayoutContext","containerRuntime","useContainerRuntime","stateObject","dataModelEntry","dataModelFieldDisplayValue","value","containerScopedEntry","getDmfValue","containerDisplayValue","label","id","internalValue","setInternalValue","useState","configModeOpen","setConfigModeOpen","isFormControlMounted","setIsFormControlMounted","selectContainerRef","useRef","formControlRef","formControlRefCallback","React","useCallback","node","current","isSelectedInConfigMode","useEffect","shouldBeOpen","useMemo","Boolean","isPredefined","isDisabled","setValue","rules","validate","normalizedOptions","map","item","shouldUseCustomDropdown","canRenderCustomDropdown","commonStyles","justifyContent","baseTextColor","placeholderColor","disabledColor","typography","menuItem","padding","transition","inputSx","display","alignItems","boxSizing","lineHeight","formControlSx","placeholderTypography","renderPlaceholderItem","_jsx","MenuItem","children","style","fontStyle","containerText","String","stateText","val","renderOptionItems","currentValue","onItemClick","_jsxs","CircularProgress","size","mr","o","selected","onClick","isAutoWidth","resolvedDisplayText","flexDirection","FormHelperText","Typography","border","borderRadius","menuProps","slotProps","paper","elevation","boxShadow","visibility","opacity","pointerEvents","position","top","left","zIndex","MenuListProps","anchorOrigin","vertical","horizontal","transformOrigin","disableScrollLock","disablePortal","disableAutoFocus","disableRestoreFocus","disableEnforceFocus","hideBackdrop","handleValueChange","field","onChange","renderValue","selectedId","opt","find","renderSelect","hasError","MuiSelect","onClose","onOpen","error","e","target","labelId","input","OutlinedInput","displayEmpty","MenuProps","inputProps","renderCustomDropdown","Popper","anchorEl","placement","TransitionProps","Grow","timeout","Paper","offsetWidth","overflowY","overflowX","scrollbarWidth","msOverflowStyle","MenuList","ref","stopPropagation","FormControl","variant","errors","InputLabel","shrink","Controller","render","fieldState","message","type"],"mappings":"quEA4Ea,MAAAA,EAAgD,EAC3DC,OACAC,OACAC,WACAC,KACAC,kBACAC,YAAW,EACXC,oBAAoB,yBACpBC,sBAAsB,iBACtBC,iBAAgB,EAChBC,cACAC,WAAU,EACVC,WACAC,aACAC,aACAC,YACAC,YACAC,cACAC,QACAC,kBACAC,aAAa,IACbC,YAAY,IACZC,cAAc,IACdC,eAAe,IACfC,cAAc,OACdC,aAAa,OACbC,eAAe,OACfC,gBAAgB,OAChBC,SACAC,UACAC,aACAC,aACAC,YACAC,YACAC,yBAAwB,GACxBC,QACAC,wBACAC,sBACGC,OAEH,MAAMC,GAAoB9B,OAAgB+B,EAAYJ,IAChDK,sBAAEA,GAAuBC,UAAWC,IACxCC,EAAmBL,IAGfM,GAAcC,IACdC,GAA+BF,IAAaE,QAC5CC,KAAoBH,MAAiBE,MAAaZ,IAClDc,UAAEA,IAAcJ,IAAe,IAG/BK,iBACJA,GACAC,WAAYC,GAAWC,mBACvBA,GAAkBC,oBAClBA,GAAmBC,4BACnBA,IACEC,KACEC,YAAEA,IAAgBC,KAClBC,MAAEA,IAAUC,IACZC,GAAmBC,IAEnBC,GAAcb,IAAoBO,GAClCO,GAAiB5B,GAClB2B,KAA0C3B,SAC3CI,EAKEyB,GACHD,IAAgDE,QACtB,iBAAnBF,IAAyD,iBAAnBA,GAC1CA,QACAxB,GAGA2B,GAAuB/B,GACzByB,IAAkBO,YAAYhC,SAC9BI,EACE6B,GAC4B,iBAAzBF,IAAqE,iBAAzBA,GAC9CA,GACDA,IAAwD,iBAAzBA,GAE7BA,GAA4ED,OAI5EC,GAA2DG,OAI3DH,GAA0CI,QAC5C/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,GACNY,QAASA,GACTgD,MAAOA,GACPoH,OAAQ,EAAG1C,QAAO2C,YAAchC,YAC9BjD,eACG4C,GAAaN,IAASW,GACtBS,GAAqBpB,QAK5BtC,eACG4C,QAAavI,GAAW,GACxBqJ,QAAqBrJ,MAIzBS,IAAW8J,SAAS5K,KACnBoF,EAACsB,GAAeuC,OAAK,EAAA3D,SACjBxE,IAAW8J,SAAS5K,KAA+CkL,UAEnE,aADEpK,IAAW8J,SAAS5K,KAA+CmL,KAEjE/M,EACAC,UAzEP"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{clsx as o}from"../../../../clsx/dist/clsx.mjs.js";import r from"../utils/memoTheme.js";import t from"./AccordionContext.js";import s from"../utils/useSlot.js";import a,{getAccordionUtilityClass as i}from"./accordionClasses.js";import{jsxs as n,jsx as d}from"react/jsx-runtime";import p from"../styles/styled.js";import l from"../Paper/Paper.js";import{useDefaultProps as c}from"../DefaultPropsProvider/DefaultPropsProvider.js";import m from"../Collapse/Collapse.js";import u from"../../../utils/esm/chainPropTypes/chainPropTypes.js";import x from"../../../utils/esm/composeClasses/composeClasses.js";import f from"../../../utils/esm/useControlled/useControlled.js";import{r as b}from"../../../../../_virtual/
|
|
1
|
+
import*as e from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{clsx as o}from"../../../../clsx/dist/clsx.mjs.js";import r from"../utils/memoTheme.js";import t from"./AccordionContext.js";import s from"../utils/useSlot.js";import a,{getAccordionUtilityClass as i}from"./accordionClasses.js";import{jsxs as n,jsx as d}from"react/jsx-runtime";import p from"../styles/styled.js";import l from"../Paper/Paper.js";import{useDefaultProps as c}from"../DefaultPropsProvider/DefaultPropsProvider.js";import m from"../Collapse/Collapse.js";import u from"../../../utils/esm/chainPropTypes/chainPropTypes.js";import x from"../../../utils/esm/composeClasses/composeClasses.js";import f from"../../../utils/esm/useControlled/useControlled.js";import{r as b}from"../../../../../_virtual/index3.js";import{p as h}from"../../../../../_virtual/index5.js";const g=p(l,{name:"MuiAccordion",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:r}=e;return[{[`& .${a.region}`]:o.region},o.root,!r.square&&o.rounded,!r.disableGutters&&o.gutters]}})(r(({theme:e})=>{const o={duration:e.transitions.duration.shortest};return{position:"relative",transition:e.transitions.create(["margin"],o),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(e.vars||e).palette.divider,transition:e.transitions.create(["opacity","background-color"],o)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${a.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${a.disabled}`]:{backgroundColor:(e.vars||e).palette.action.disabledBackground}}}),r(({theme:e})=>({variants:[{props:e=>!e.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(e.vars||e).shape.borderRadius,borderBottomRightRadius:(e.vars||e).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:e=>!e.disableGutters,style:{[`&.${a.expanded}`]:{margin:"16px 0"}}}]}))),y=p("h3",{name:"MuiAccordion",slot:"Heading"})({all:"unset"}),j=e.forwardRef(function(r,a){const p=c({props:r,name:"MuiAccordion"}),{children:l,className:u,defaultExpanded:b=!1,disabled:h=!1,disableGutters:j=!1,expanded:T,onChange:v,square:C=!1,slots:P={},slotProps:R={},TransitionComponent:w,TransitionProps:A,...q}=p,[E,G]=f({controlled:T,default:b,name:"Accordion",state:"expanded"}),N=e.useCallback(e=>{G(!E),v&&v(e,!E)},[E,v,G]),[O,...B]=e.Children.toArray(l),F=e.useMemo(()=>({expanded:E,disabled:h,disableGutters:j,toggle:N}),[E,h,j,N]),M={...p,square:C,disabled:h,disableGutters:j,expanded:E},k=(e=>{const{classes:o,square:r,expanded:t,disabled:s,disableGutters:a}=e;return x({root:["root",!r&&"rounded",t&&"expanded",s&&"disabled",!a&&"gutters"],heading:["heading"],region:["region"]},i,o)})(M),S={slots:{transition:w,...P},slotProps:{transition:A,...R}},[$,_]=s("root",{elementType:g,externalForwardedProps:{...S,...q},className:o(k.root,u),shouldForwardComponentProp:!0,ownerState:M,ref:a,additionalProps:{square:C}}),[D,L]=s("heading",{elementType:y,externalForwardedProps:S,className:k.heading,ownerState:M}),[I,U]=s("transition",{elementType:m,externalForwardedProps:S,ownerState:M});return n($,{..._,children:[d(D,{...L,children:d(t.Provider,{value:F,children:O})}),d(I,{in:E,timeout:"auto",...U,children:d("div",{"aria-labelledby":O.props.id,id:O.props["aria-controls"],role:"region",className:k.region,children:B})})]})});"production"!==process.env.NODE_ENV&&(j.propTypes={children:u(h.exports.node.isRequired,o=>{const r=e.Children.toArray(o.children)[0];return b.exports.isFragment(r)?new Error("MUI: The Accordion doesn't accept a Fragment as a child. Consider providing an array instead."):e.isValidElement(r)?null:new Error("MUI: Expected the first child of Accordion to be a valid element.")}),classes:h.exports.object,className:h.exports.string,defaultExpanded:h.exports.bool,disabled:h.exports.bool,disableGutters:h.exports.bool,expanded:h.exports.bool,onChange:h.exports.func,slotProps:h.exports.shape({heading:h.exports.oneOfType([h.exports.func,h.exports.object]),root:h.exports.oneOfType([h.exports.func,h.exports.object]),transition:h.exports.oneOfType([h.exports.func,h.exports.object])}),slots:h.exports.shape({heading:h.exports.elementType,root:h.exports.elementType,transition:h.exports.elementType}),square:h.exports.bool,sx:h.exports.oneOfType([h.exports.arrayOf(h.exports.oneOfType([h.exports.func,h.exports.object,h.exports.bool])),h.exports.func,h.exports.object]),TransitionComponent:h.exports.elementType,TransitionProps:h.exports.object});var T=j;export{T as default};
|
|
2
2
|
//# sourceMappingURL=Accordion.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as o from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{clsx as e}from"../../../../clsx/dist/clsx.mjs.js";import{useRtl as t}from"../../../system/esm/RtlProvider/index.js";import r from"../styles/rootShouldForwardProp.js";import{getMenuUtilityClass as s}from"./menuClasses.js";import p from"../utils/useSlot.js";import{jsx as n}from"react/jsx-runtime";import a from"../styles/styled.js";import i,{PopoverPaper as l}from"../Popover/Popover.js";import c from"../MenuList/MenuList.js";import{useDefaultProps as u}from"../DefaultPropsProvider/DefaultPropsProvider.js";import m from"../../../utils/esm/useSlotProps/useSlotProps.js";import x from"../../../utils/esm/HTMLElementType/HTMLElementType.js";import d from"../../../utils/esm/composeClasses/composeClasses.js";import{r as f}from"../../../../../_virtual/
|
|
1
|
+
import*as o from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{clsx as e}from"../../../../clsx/dist/clsx.mjs.js";import{useRtl as t}from"../../../system/esm/RtlProvider/index.js";import r from"../styles/rootShouldForwardProp.js";import{getMenuUtilityClass as s}from"./menuClasses.js";import p from"../utils/useSlot.js";import{jsx as n}from"react/jsx-runtime";import a from"../styles/styled.js";import i,{PopoverPaper as l}from"../Popover/Popover.js";import c from"../MenuList/MenuList.js";import{useDefaultProps as u}from"../DefaultPropsProvider/DefaultPropsProvider.js";import m from"../../../utils/esm/useSlotProps/useSlotProps.js";import x from"../../../utils/esm/HTMLElementType/HTMLElementType.js";import d from"../../../utils/esm/composeClasses/composeClasses.js";import{r as f}from"../../../../../_virtual/index3.js";import{p as P}from"../../../../../_virtual/index5.js";const b={vertical:"top",horizontal:"right"},y={vertical:"top",horizontal:"left"},j=a(i,{shouldForwardProp:o=>r(o)||"classes"===o,name:"MuiMenu",slot:"Root"})({}),T=a(l,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),h=a(c,{name:"MuiMenu",slot:"List"})({outline:0}),v=o.forwardRef(function(r,a){const i=u({props:r,name:"MuiMenu"}),{autoFocus:l=!0,children:c,className:x,disableAutoFocusItem:P=!1,MenuListProps:v={},onClose:M,open:F,PaperProps:O={},PopoverClasses:g,transitionDuration:w="auto",TransitionProps:{onEntering:S,...C}={},variant:D="selectedMenu",slots:E={},slotProps:k={},...N}=i,L=t(),I={...i,autoFocus:l,disableAutoFocusItem:P,MenuListProps:v,onEntering:S,PaperProps:O,transitionDuration:w,TransitionProps:C,variant:D},R=(o=>{const{classes:e}=o;return d({root:["root"],paper:["paper"],list:["list"]},s,e)})(I),_=l&&!P&&F,z=o.useRef(null);let A=-1;o.Children.map(c,(e,t)=>{o.isValidElement(e)&&("production"!==process.env.NODE_ENV&&f.exports.isFragment(e)&&console.error(["MUI: The Menu component doesn't accept a Fragment as a child.","Consider providing an array instead."].join("\n")),e.props.disabled||("selectedMenu"===D&&e.props.selected||-1===A)&&(A=t))});const H={slots:E,slotProps:{list:v,transition:C,paper:O,...k}},K=m({elementType:E.root,externalSlotProps:k.root,ownerState:I,className:[R.root,x]}),[V,q]=p("paper",{className:R.paper,elementType:T,externalForwardedProps:H,shouldForwardComponentProp:!0,ownerState:I}),[U,W]=p("list",{className:e(R.list,v.className),elementType:h,shouldForwardComponentProp:!0,externalForwardedProps:H,getSlotProps:o=>({...o,onKeyDown:e=>{(o=>{"Tab"===o.key&&(o.preventDefault(),M&&M(o,"tabKeyDown"))})(e),o.onKeyDown?.(e)}}),ownerState:I}),B="function"==typeof H.slotProps.transition?H.slotProps.transition(I):H.slotProps.transition;return n(j,{onClose:M,anchorOrigin:{vertical:"bottom",horizontal:L?"right":"left"},transformOrigin:L?b:y,slots:{root:E.root,paper:V,backdrop:E.backdrop,...E.transition&&{transition:E.transition}},slotProps:{root:K,paper:q,backdrop:"function"==typeof k.backdrop?k.backdrop(I):k.backdrop,transition:{...B,onEntering:(...o)=>{((o,e)=>{z.current&&z.current.adjustStyleForScrollbar(o,{direction:L?"rtl":"ltr"}),S&&S(o,e)})(...o),B?.onEntering?.(...o)}}},open:F,ref:a,transitionDuration:w,ownerState:I,...N,classes:g,children:n(U,{actions:z,autoFocus:l&&(-1===A||P),autoFocusItem:_,variant:D,...W,children:c})})});"production"!==process.env.NODE_ENV&&(v.propTypes={anchorEl:P.exports.oneOfType([x,P.exports.func]),autoFocus:P.exports.bool,children:P.exports.node,classes:P.exports.object,className:P.exports.string,disableAutoFocusItem:P.exports.bool,MenuListProps:P.exports.object,onClose:P.exports.func,open:P.exports.bool.isRequired,PaperProps:P.exports.object,PopoverClasses:P.exports.object,slotProps:P.exports.shape({backdrop:P.exports.oneOfType([P.exports.func,P.exports.object]),list:P.exports.oneOfType([P.exports.func,P.exports.object]),paper:P.exports.oneOfType([P.exports.func,P.exports.object]),root:P.exports.oneOfType([P.exports.func,P.exports.object]),transition:P.exports.oneOfType([P.exports.func,P.exports.object])}),slots:P.exports.shape({backdrop:P.exports.elementType,list:P.exports.elementType,paper:P.exports.elementType,root:P.exports.elementType,transition:P.exports.elementType}),sx:P.exports.oneOfType([P.exports.arrayOf(P.exports.oneOfType([P.exports.func,P.exports.object,P.exports.bool])),P.exports.func,P.exports.object]),transitionDuration:P.exports.oneOfType([P.exports.oneOf(["auto"]),P.exports.number,P.exports.shape({appear:P.exports.number,enter:P.exports.number,exit:P.exports.number})]),TransitionProps:P.exports.object,variant:P.exports.oneOf(["menu","selectedMenu"])});var M=v;export{T as MenuPaper,M as default};
|
|
2
2
|
//# sourceMappingURL=Menu.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{jsx as t}from"react/jsx-runtime";import r from"../../../utils/esm/getScrollbarSize/getScrollbarSize.js";import n from"../List/List.js";import s from"../../../utils/esm/useEnhancedEffect/useEnhancedEffect.js";import i from"../../../utils/esm/ownerWindow/ownerWindow.js";import o from"../../../utils/esm/useForkRef/useForkRef.js";import{r as l}from"../../../../../_virtual/
|
|
1
|
+
import*as e from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{jsx as t}from"react/jsx-runtime";import r from"../../../utils/esm/getScrollbarSize/getScrollbarSize.js";import n from"../List/List.js";import s from"../../../utils/esm/useEnhancedEffect/useEnhancedEffect.js";import i from"../../../utils/esm/ownerWindow/ownerWindow.js";import o from"../../../utils/esm/useForkRef/useForkRef.js";import{r as l}from"../../../../../_virtual/index3.js";import{p as a}from"../../../../../_virtual/index5.js";import u from"../../../utils/esm/ownerDocument/ownerDocument.js";function c(e,t,r){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:r?null:e.firstChild}function p(e,t,r){return e===t?r?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:r?null:e.lastChild}function d(e,t){if(void 0===t)return!0;let r=e.innerText;return void 0===r&&(r=e.textContent),r=r.trim().toLowerCase(),0!==r.length&&(t.repeating?r[0]===t.keys[0]:r.startsWith(t.keys.join("")))}function m(e,t,r,n,s,i){let o=!1,l=s(e,t,!!t&&r);for(;l;){if(l===e.firstChild){if(o)return!1;o=!0}const t=!n&&(l.disabled||"true"===l.getAttribute("aria-disabled"));if(l.hasAttribute("tabindex")&&d(l,i)&&!t)return l.focus(),!0;l=s(e,l,r)}return!1}const f=e.forwardRef(function(a,f){const{actions:h,autoFocus:g=!1,autoFocusItem:b=!1,children:y,className:v,disabledItemsFocusable:x=!1,disableListWrap:w=!1,onKeyDown:E,variant:j="selectedMenu",...D}=a,k=e.useRef(null),C=e.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});s(()=>{g&&k.current.focus()},[g]),e.useImperativeHandle(h,()=>({adjustStyleForScrollbar:(e,{direction:t})=>{const n=!k.current.style.width;if(e.clientHeight<k.current.clientHeight&&n){const n=`${r(i(e))}px`;k.current.style["rtl"===t?"paddingLeft":"paddingRight"]=n,k.current.style.width=`calc(100% + ${n})`}return k.current}}),[]);const F=o(k,f);let S=-1;e.Children.forEach(y,(t,r)=>{e.isValidElement(t)?("production"!==process.env.NODE_ENV&&l.exports.isFragment(t)&&console.error(["MUI: The Menu component doesn't accept a Fragment as a child.","Consider providing an array instead."].join("\n")),t.props.disabled||("selectedMenu"===j&&t.props.selected||-1===S)&&(S=r),S===r&&(t.props.disabled||t.props.muiSkipListHighlight||t.type.muiSkipListHighlight)&&(S+=1,S>=y.length&&(S=-1))):S===r&&(S+=1,S>=y.length&&(S=-1))});const K=e.Children.map(y,(t,r)=>{if(r===S){const r={};return b&&(r.autoFocus=!0),void 0===t.props.tabIndex&&"selectedMenu"===j&&(r.tabIndex=0),e.cloneElement(t,r)}return t});return t(n,{role:"menu",ref:F,className:v,onKeyDown:e=>{const t=k.current,r=e.key;if(e.ctrlKey||e.metaKey||e.altKey)return void(E&&E(e));const n=u(t).activeElement;if("ArrowDown"===r)e.preventDefault(),m(t,n,w,x,c);else if("ArrowUp"===r)e.preventDefault(),m(t,n,w,x,p);else if("Home"===r)e.preventDefault(),m(t,null,w,x,c);else if("End"===r)e.preventDefault(),m(t,null,w,x,p);else if(1===r.length){const s=C.current,i=r.toLowerCase(),o=performance.now();s.keys.length>0&&(o-s.lastTime>500?(s.keys=[],s.repeating=!0,s.previousKeyMatched=!0):s.repeating&&i!==s.keys[0]&&(s.repeating=!1)),s.lastTime=o,s.keys.push(i);const l=n&&!s.repeating&&d(n,s);s.previousKeyMatched&&(l||m(t,n,!1,x,c,s))?e.preventDefault():s.previousKeyMatched=!1}E&&E(e)},tabIndex:g?0:-1,...D,children:K})});"production"!==process.env.NODE_ENV&&(f.propTypes={autoFocus:a.exports.bool,autoFocusItem:a.exports.bool,children:a.exports.node,className:a.exports.string,disabledItemsFocusable:a.exports.bool,disableListWrap:a.exports.bool,onKeyDown:a.exports.func,variant:a.exports.oneOf(["menu","selectedMenu"])});var h=f;export{h as default};
|
|
2
2
|
//# sourceMappingURL=MenuList.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{clsx as r}from"../../../../clsx/dist/clsx.mjs.js";import o from"../Menu/Menu.js";import{StyledSelectSelect as t,StyledSelectIcon as n}from"../NativeSelect/NativeSelectInput.js";import{isFilled as s}from"../InputBase/utils.js";import l from"../styles/slotShouldForwardProp.js";import a,{getSelectUtilityClasses as i}from"./selectClasses.js";import{jsxs as p,jsx as u}from"react/jsx-runtime";import c from"../styles/styled.js";import d from"../../../utils/esm/formatMuiErrorMessage/formatMuiErrorMessage.js";import m from"../../../utils/esm/useId/useId.js";import f from"../../../utils/esm/refType/refType.js";import v from"../../../utils/esm/composeClasses/composeClasses.js";import b from"../../../utils/esm/capitalize/capitalize.js";import x from"../../../utils/esm/useControlled/useControlled.js";import h from"../../../utils/esm/useForkRef/useForkRef.js";import y from"../../../utils/esm/ownerDocument/ownerDocument.js";import{r as g}from"../../../../../_virtual/
|
|
1
|
+
import*as e from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{clsx as r}from"../../../../clsx/dist/clsx.mjs.js";import o from"../Menu/Menu.js";import{StyledSelectSelect as t,StyledSelectIcon as n}from"../NativeSelect/NativeSelectInput.js";import{isFilled as s}from"../InputBase/utils.js";import l from"../styles/slotShouldForwardProp.js";import a,{getSelectUtilityClasses as i}from"./selectClasses.js";import{jsxs as p,jsx as u}from"react/jsx-runtime";import c from"../styles/styled.js";import d from"../../../utils/esm/formatMuiErrorMessage/formatMuiErrorMessage.js";import m from"../../../utils/esm/useId/useId.js";import f from"../../../utils/esm/refType/refType.js";import v from"../../../utils/esm/composeClasses/composeClasses.js";import b from"../../../utils/esm/capitalize/capitalize.js";import x from"../../../utils/esm/useControlled/useControlled.js";import h from"../../../utils/esm/useForkRef/useForkRef.js";import y from"../../../utils/esm/ownerDocument/ownerDocument.js";import{r as g}from"../../../../../_virtual/index3.js";import{p as j}from"../../../../../_virtual/index5.js";var w;const E=c(t,{name:"MuiSelect",slot:"Select",overridesResolver:(e,r)=>{const{ownerState:o}=e;return[{[`&.${a.select}`]:r.select},{[`&.${a.select}`]:r[o.variant]},{[`&.${a.error}`]:r.error},{[`&.${a.multiple}`]:r.multiple}]}})({[`&.${a.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),S=c(n,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,r)=>{const{ownerState:o}=e;return[r.icon,o.variant&&r[`icon${b(o.variant)}`],o.open&&r.iconOpen]}})({}),I=c("input",{shouldForwardProp:e=>l(e)&&"classes"!==e,name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function C(e,r){return"object"==typeof r&&null!==r?e===r:String(e)===String(r)}function O(e){return null==e||"string"==typeof e&&!e.trim()}const N=e.forwardRef(function(t,n){const{"aria-describedby":l,"aria-label":a,autoFocus:c,autoWidth:f,children:j,className:N,defaultOpen:M,defaultValue:P,disabled:D,displayEmpty:$,error:F=!1,IconComponent:R,inputRef:k,labelId:A,MenuProps:T={},multiple:V,name:U,onBlur:W,onChange:_,onClose:B,onFocus:q,onOpen:z,open:K,readOnly:L,renderValue:H,required:Y,SelectDisplayProps:G={},tabIndex:J,type:Q,value:X,variant:Z="standard",...ee}=t,[re,oe]=x({controlled:X,default:P,name:"Select"}),[te,ne]=x({controlled:K,default:M,name:"Select"}),se=e.useRef(null),le=e.useRef(null),[ae,ie]=e.useState(null),{current:pe}=e.useRef(null!=K),[ue,ce]=e.useState(),de=h(n,k),me=e.useCallback(e=>{le.current=e,e&&ie(e)},[]),fe=ae?.parentNode;e.useImperativeHandle(de,()=>({focus:()=>{le.current.focus()},node:se.current,value:re}),[re]),e.useEffect(()=>{M&&te&&ae&&!pe&&(ce(f?null:fe.clientWidth),le.current.focus())},[ae,f]),e.useEffect(()=>{c&&le.current.focus()},[c]),e.useEffect(()=>{if(!A)return;const e=y(le.current).getElementById(A);if(e){const r=()=>{getSelection().isCollapsed&&le.current.focus()};return e.addEventListener("click",r),()=>{e.removeEventListener("click",r)}}},[A]);const ve=(e,r)=>{e?z&&z(r):B&&B(r),pe||(ce(f?null:fe.clientWidth),ne(e))},be=e.Children.toArray(j),xe=e=>r=>{let o;if(r.currentTarget.hasAttribute("tabindex")){if(V){o=Array.isArray(re)?re.slice():[];const r=re.indexOf(e.props.value);-1===r?o.push(e.props.value):o.splice(r,1)}else o=e.props.value;if(e.props.onClick&&e.props.onClick(r),re!==o&&(oe(o),_)){const t=r.nativeEvent||r,n=new t.constructor(t.type,t);Object.defineProperty(n,"target",{writable:!0,value:{value:o,name:U}}),_(n,e)}V||ve(!1,r)}},he=null!==ae&&te;let ye,ge;delete ee["aria-invalid"];const je=[];let we=!1,Ee=!1;(s({value:re})||$)&&(H?ye=H(re):we=!0);const Se=be.map(r=>{if(!e.isValidElement(r))return null;let o;if("production"!==process.env.NODE_ENV&&g.exports.isFragment(r)&&console.error(["MUI: The Select component doesn't accept a Fragment as a child.","Consider providing an array instead."].join("\n")),V){if(!Array.isArray(re))throw new Error("production"!==process.env.NODE_ENV?"MUI: The `value` prop must be an array when using the `Select` component with `multiple`.":d(2));o=re.some(e=>C(e,r.props.value)),o&&we&&je.push(r.props.children)}else o=C(re,r.props.value),o&&we&&(ge=r.props.children);return o&&(Ee=!0),e.cloneElement(r,{"aria-selected":o?"true":"false",onClick:xe(r),onKeyUp:e=>{" "===e.key&&e.preventDefault(),r.props.onKeyUp&&r.props.onKeyUp(e)},role:"option",selected:o,value:void 0,"data-value":r.props.value})});"production"!==process.env.NODE_ENV&&e.useEffect(()=>{if(!Ee&&!V&&""!==re){const e=be.map(e=>e.props.value);[`MUI: You have provided an out-of-range value \`${re}\` for the select ${U?`(name="${U}") `:""}component.`,"Consider providing a value that matches one of the available options or ''.",`The available values are ${e.filter(e=>null!=e).map(e=>`\`${e}\``).join(", ")||'""'}.`].join("\n")}},[Ee,be,V,U,re]),we&&(ye=V?0===je.length?null:je.reduce((e,r,o)=>(e.push(r),o<je.length-1&&e.push(", "),e),[]):ge);let Ie,Ce=ue;!f&&pe&&ae&&(Ce=fe.clientWidth),Ie=void 0!==J?J:D?null:0;const Oe=G.id||(U?`mui-component-select-${U}`:void 0),Ne={...t,variant:Z,value:re,open:he,error:F},Me=(e=>{const{classes:r,variant:o,disabled:t,multiple:n,open:s,error:l}=e,a={select:["select",o,t&&"disabled",n&&"multiple",l&&"error"],icon:["icon",`icon${b(o)}`,s&&"iconOpen",t&&"disabled"],nativeInput:["nativeInput"]};return v(a,i,r)})(Ne),Pe={...T.PaperProps,...T.slotProps?.paper},De={...T.MenuListProps,...T.slotProps?.list},$e=m();return p(e.Fragment,{children:[u(E,{as:"div",ref:me,tabIndex:Ie,role:"combobox","aria-controls":he?$e:void 0,"aria-disabled":D?"true":void 0,"aria-expanded":he?"true":"false","aria-haspopup":"listbox","aria-label":a,"aria-labelledby":[A,Oe].filter(Boolean).join(" ")||void 0,"aria-describedby":l,"aria-required":Y?"true":void 0,"aria-invalid":F?"true":void 0,onKeyDown:e=>{if(!L){[" ","ArrowUp","ArrowDown","Enter"].includes(e.key)&&(e.preventDefault(),ve(!0,e))}},onMouseDown:D||L?null:e=>{0===e.button&&(e.preventDefault(),le.current.focus(),ve(!0,e))},onBlur:e=>{!he&&W&&(Object.defineProperty(e,"target",{writable:!0,value:{value:re,name:U}}),W(e))},onFocus:q,...G,ownerState:Ne,className:r(G.className,Me.select,N),id:Oe,children:O(ye)?w||(w=u("span",{className:"notranslate","aria-hidden":!0,children:""})):ye}),u(I,{"aria-invalid":F,value:Array.isArray(re)?re.join(","):re,name:U,ref:se,"aria-hidden":!0,onChange:e=>{const r=be.find(r=>r.props.value===e.target.value);void 0!==r&&(oe(r.props.value),_&&_(e,r))},tabIndex:-1,disabled:D,className:Me.nativeInput,autoFocus:c,required:Y,...ee,ownerState:Ne}),u(S,{as:R,className:Me.icon,ownerState:Ne}),u(o,{id:`menu-${U||""}`,anchorEl:fe,open:he,onClose:e=>{ve(!1,e)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...T,slotProps:{...T.slotProps,list:{"aria-labelledby":A,role:"listbox","aria-multiselectable":V?"true":void 0,disableListWrap:!0,id:$e,...De},paper:{...Pe,style:{minWidth:Ce,...null!=Pe?Pe.style:null}}},children:Se})]})});"production"!==process.env.NODE_ENV&&(N.propTypes={"aria-describedby":j.exports.string,"aria-label":j.exports.string,autoFocus:j.exports.bool,autoWidth:j.exports.bool,children:j.exports.node,classes:j.exports.object,className:j.exports.string,defaultOpen:j.exports.bool,defaultValue:j.exports.any,disabled:j.exports.bool,displayEmpty:j.exports.bool,error:j.exports.bool,IconComponent:j.exports.elementType.isRequired,inputRef:f,labelId:j.exports.string,MenuProps:j.exports.object,multiple:j.exports.bool,name:j.exports.string,onBlur:j.exports.func,onChange:j.exports.func,onClose:j.exports.func,onFocus:j.exports.func,onOpen:j.exports.func,open:j.exports.bool,readOnly:j.exports.bool,renderValue:j.exports.func,required:j.exports.bool,SelectDisplayProps:j.exports.object,tabIndex:j.exports.oneOfType([j.exports.number,j.exports.string]),type:j.exports.any,value:j.exports.any,variant:j.exports.oneOf(["standard","outlined","filled"])});var M=N;export{M as default};
|
|
2
2
|
//# sourceMappingURL=SelectInput.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{clsx as o}from"../../../../clsx/dist/clsx.mjs.js";import t from"../styles/useTheme.js";import{jsxs as r,jsx as n}from"react/jsx-runtime";import s from"../styles/styled.js";import i from"../utils/memoTheme.js";import a,{getSpeedDialUtilityClass as p}from"./speedDialClasses.js";import l from"../utils/useSlot.js";import c from"../Fab/Fab.js";import{useDefaultProps as u}from"../DefaultPropsProvider/DefaultPropsProvider.js";import m from"../../../utils/esm/useTimeout/useTimeout.js";import d from"../Zoom/Zoom.js";import f from"../../../utils/esm/composeClasses/composeClasses.js";import x from"../../../utils/esm/clamp/clamp.js";import y from"../../../utils/esm/capitalize/capitalize.js";import v from"../../../utils/esm/useControlled/useControlled.js";import b from"../../../utils/esm/useForkRef/useForkRef.js";import{r as j}from"../../../../../_virtual/
|
|
1
|
+
import*as e from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{clsx as o}from"../../../../clsx/dist/clsx.mjs.js";import t from"../styles/useTheme.js";import{jsxs as r,jsx as n}from"react/jsx-runtime";import s from"../styles/styled.js";import i from"../utils/memoTheme.js";import a,{getSpeedDialUtilityClass as p}from"./speedDialClasses.js";import l from"../utils/useSlot.js";import c from"../Fab/Fab.js";import{useDefaultProps as u}from"../DefaultPropsProvider/DefaultPropsProvider.js";import m from"../../../utils/esm/useTimeout/useTimeout.js";import d from"../Zoom/Zoom.js";import f from"../../../utils/esm/composeClasses/composeClasses.js";import x from"../../../utils/esm/clamp/clamp.js";import y from"../../../utils/esm/capitalize/capitalize.js";import v from"../../../utils/esm/useControlled/useControlled.js";import b from"../../../utils/esm/useForkRef/useForkRef.js";import{r as j}from"../../../../../_virtual/index3.js";import g from"../../../utils/esm/isMuiElement/isMuiElement.js";import{p as D}from"../../../../../_virtual/index5.js";function h(e){return"up"===e||"down"===e?"vertical":"right"===e||"left"===e?"horizontal":void 0}const w=s("div",{name:"MuiSpeedDial",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,o[`direction${y(t.direction)}`]]}})(i(({theme:e})=>({zIndex:(e.vars||e).zIndex.speedDial,display:"flex",alignItems:"center",pointerEvents:"none",variants:[{props:{direction:"up"},style:{flexDirection:"column-reverse",[`& .${a.actions}`]:{flexDirection:"column-reverse",marginBottom:-32,paddingBottom:48}}},{props:{direction:"down"},style:{flexDirection:"column",[`& .${a.actions}`]:{flexDirection:"column",marginTop:-32,paddingTop:48}}},{props:{direction:"left"},style:{flexDirection:"row-reverse",[`& .${a.actions}`]:{flexDirection:"row-reverse",marginRight:-32,paddingRight:48}}},{props:{direction:"right"},style:{flexDirection:"row",[`& .${a.actions}`]:{flexDirection:"row",marginLeft:-32,paddingLeft:48}}}]}))),E=s(c,{name:"MuiSpeedDial",slot:"Fab"})({pointerEvents:"auto"}),T=s("div",{name:"MuiSpeedDial",slot:"Actions",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.actions,!t.open&&o.actionsClosed]}})({display:"flex",pointerEvents:"auto",variants:[{props:({ownerState:e})=>!e.open,style:{transition:"top 0s linear 0.2s",pointerEvents:"none"}}]}),C=e.forwardRef(function(s,i){const a=u({props:s,name:"MuiSpeedDial"}),c=t(),D={enter:c.transitions.duration.enteringScreen,exit:c.transitions.duration.leavingScreen},{ariaLabel:C,FabProps:{ref:P,...S}={},children:F,className:M,direction:O="up",hidden:R=!1,icon:L,onBlur:N,onClose:$,onFocus:k,onKeyDown:I,onMouseEnter:z,onMouseLeave:B,onOpen:K,open:_,openIcon:V,slots:A={},slotProps:Z={},TransitionComponent:q,TransitionProps:U,transitionDuration:G=D,...H}=a,[J,Q]=v({controlled:_,default:!1,name:"SpeedDial",state:"open"}),W={...a,open:J,direction:O},X=(e=>{const{classes:o,open:t,direction:r}=e,n={root:["root",`direction${y(r)}`],fab:["fab"],actions:["actions",!t&&"actionsClosed"]};return f(n,p,o)})(W),Y=m(),ee=e.useRef(0),oe=e.useRef(),te=e.useRef([]);te.current=[te.current[0]];const re=e.useCallback(e=>{te.current[0]=e},[]),ne=b(P,re),se=(e,o)=>t=>{te.current[e+1]=t,o&&o(t)};e.useEffect(()=>{J||(ee.current=0,oe.current=void 0)},[J]);const ie=e=>{"mouseleave"===e.type&&B&&B(e),"blur"===e.type&&N&&N(e),Y.clear(),"blur"===e.type?Y.start(0,()=>{Q(!1),$&&$(e,"blur")}):(Q(!1),$&&$(e,"mouseLeave"))},ae=e=>{"mouseenter"===e.type&&z&&z(e),"focus"===e.type&&k&&k(e),Y.clear(),J||Y.start(0,()=>{if(Q(!0),K){K(e,{focus:"focus",mouseenter:"mouseEnter"}[e.type])}})},pe=C.replace(/^[^a-z]+|[^\w:.-]+/gi,""),le=e.Children.toArray(F).filter(o=>("production"!==process.env.NODE_ENV&&j.exports.isFragment(o)&&console.error(["MUI: The SpeedDial component doesn't accept a Fragment as a child.","Consider providing an array instead."].join("\n")),e.isValidElement(o))),ce=le.map((o,t)=>{const{FabProps:{ref:r,...n}={},tooltipPlacement:s}=o.props,i=s||("vertical"===h(O)?"left":"top");return e.cloneElement(o,{FabProps:{...n,ref:se(t,r)},delay:30*(J?t:le.length-t),open:J,tooltipPlacement:i,id:`${pe}-action-${t}`})}),ue={slots:{transition:q,...A},slotProps:{transition:U,...Z}},[me,de]=l("root",{elementType:w,externalForwardedProps:{...ue,...H},ownerState:W,ref:i,className:o(X.root,M),additionalProps:{role:"presentation"},getSlotProps:e=>({...e,onKeyDown:o=>{e.onKeyDown?.(o),(e=>{I&&I(e);const o=e.key.replace("Arrow","").toLowerCase(),{current:t=o}=oe;if("Escape"===e.key)return Q(!1),te.current[0].focus(),void($&&$(e,"escapeKeyDown"));if(h(o)===h(t)&&void 0!==h(o)){e.preventDefault();const r=o===t?1:-1,n=x(ee.current+r,0,te.current.length-1);te.current[n].focus(),ee.current=n,oe.current=t}})(o)},onBlur:o=>{e.onBlur?.(o),ie(o)},onFocus:o=>{e.onFocus?.(o),ae(o)},onMouseEnter:o=>{e.onMouseEnter?.(o),ae(o)},onMouseLeave:o=>{e.onMouseLeave?.(o),ie(o)}})}),[fe,xe]=l("transition",{elementType:d,externalForwardedProps:ue,ownerState:W});return r(me,{...de,children:[n(fe,{in:!R,timeout:G,unmountOnExit:!0,...xe,children:n(E,{color:"primary","aria-label":C,"aria-haspopup":"true","aria-expanded":J,"aria-controls":`${pe}-actions`,...S,onClick:e=>{S.onClick&&S.onClick(e),Y.clear(),J?(Q(!1),$&&$(e,"toggle")):(Q(!0),K&&K(e,"toggle"))},className:o(X.fab,S.className),ref:ne,ownerState:W,children:e.isValidElement(L)&&g(L,["SpeedDialIcon"])?e.cloneElement(L,{open:J}):L})}),n(T,{id:`${pe}-actions`,role:"menu","aria-orientation":h(O),className:o(X.actions,!J&&X.actionsClosed),ownerState:W,children:ce})]})});"production"!==process.env.NODE_ENV&&(C.propTypes={ariaLabel:D.exports.string.isRequired,children:D.exports.node,classes:D.exports.object,className:D.exports.string,direction:D.exports.oneOf(["down","left","right","up"]),FabProps:D.exports.object,hidden:D.exports.bool,icon:D.exports.node,onBlur:D.exports.func,onClose:D.exports.func,onFocus:D.exports.func,onKeyDown:D.exports.func,onMouseEnter:D.exports.func,onMouseLeave:D.exports.func,onOpen:D.exports.func,open:D.exports.bool,openIcon:D.exports.node,slotProps:D.exports.shape({root:D.exports.oneOfType([D.exports.func,D.exports.object]),transition:D.exports.oneOfType([D.exports.func,D.exports.object])}),slots:D.exports.shape({root:D.exports.elementType,transition:D.exports.elementType}),sx:D.exports.oneOfType([D.exports.arrayOf(D.exports.oneOfType([D.exports.func,D.exports.object,D.exports.bool])),D.exports.func,D.exports.object]),TransitionComponent:D.exports.elementType,transitionDuration:D.exports.oneOfType([D.exports.number,D.exports.shape({appear:D.exports.number,enter:D.exports.number,exit:D.exports.number})]),TransitionProps:D.exports.object});var P=C;export{P as default};
|
|
2
2
|
//# sourceMappingURL=SpeedDial.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{clsx as t}from"../../../../clsx/dist/clsx.mjs.js";import{useRtl as o}from"../../../system/esm/RtlProvider/index.js";import r from"../styles/useTheme.js";import{jsx as l,jsxs as n}from"react/jsx-runtime";import s from"../styles/styled.js";import i from"../utils/memoTheme.js";import a from"../internal/animate.js";import c from"./ScrollbarSize.js";import p,{getTabsUtilityClass as d}from"./tabsClasses.js";import u from"../utils/useSlot.js";import{useDefaultProps as f}from"../DefaultPropsProvider/DefaultPropsProvider.js";import m from"../../../utils/esm/useSlotProps/useSlotProps.js";import b from"../TabScrollButton/TabScrollButton.js";import h from"../../../utils/esm/refType/refType.js";import x from"../../../utils/esm/composeClasses/composeClasses.js";import v from"../../../utils/esm/useEventCallback/useEventCallback.js";import y from"../../../utils/esm/debounce/debounce.js";import S from"../../../utils/esm/ownerWindow/ownerWindow.js";import{r as w}from"../../../../../_virtual/index4.js";import{p as T}from"../../../../../_virtual/index5.js";import B from"../../../utils/esm/ownerDocument/ownerDocument.js";const g=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,j=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,C=(e,t,o)=>{let r=!1,l=o(e,t);for(;l;){if(l===e.firstChild){if(r)return;r=!0}const t=l.disabled||"true"===l.getAttribute("aria-disabled");if(l.hasAttribute("tabindex")&&!t)return void l.focus();l=o(e,l)}},E=s("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[{[`& .${p.scrollButtons}`]:t.scrollButtons},{[`& .${p.scrollButtons}`]:o.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,o.vertical&&t.vertical]}})(i(({theme:e})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${p.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}}}]}))),I=s("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.scroller,o.fixed&&t.fixed,o.hideScrollbar&&t.hideScrollbar,o.scrollableX&&t.scrollableX,o.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),O=s("div",{name:"MuiTabs",slot:"List",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.list,t.flexContainer,o.vertical&&t.flexContainerVertical,o.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.centered,style:{justifyContent:"center"}}]}),M=s("span",{name:"MuiTabs",slot:"Indicator"})(i(({theme:e})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:"100%",width:2,right:0}}]}))),P=s(c)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),N={};let k=!1;const D=e.forwardRef(function(s,i){const c=f({props:s,name:"MuiTabs"}),p=r(),h=o(),{"aria-label":T,"aria-labelledby":D,action:W,centered:F=!1,children:R,className:A,component:L="div",allowScrollButtonsMobile:X=!1,indicatorColor:z="primary",onChange:Y,orientation:H="horizontal",ScrollButtonComponent:V,scrollButtons:_="auto",selectionFollowsFocus:K,slots:$={},slotProps:U={},TabIndicatorProps:q={},TabScrollButtonProps:G={},textColor:J="primary",value:Q,variant:Z="standard",visibleScrollbar:ee=!1,...te}=c,oe="scrollable"===Z,re="vertical"===H,le=re?"scrollTop":"scrollLeft",ne=re?"top":"left",se=re?"bottom":"right",ie=re?"clientHeight":"clientWidth",ae=re?"height":"width",ce={...c,component:L,allowScrollButtonsMobile:X,indicatorColor:z,orientation:H,vertical:re,scrollButtons:_,textColor:J,variant:Z,visibleScrollbar:ee,fixed:!oe,hideScrollbar:oe&&!ee,scrollableX:oe&&!re,scrollableY:oe&&re,centered:F&&!oe,scrollButtonsHideMobile:!X},pe=(e=>{const{vertical:t,fixed:o,hideScrollbar:r,scrollableX:l,scrollableY:n,centered:s,scrollButtonsHideMobile:i,classes:a}=e;return x({root:["root",t&&"vertical"],scroller:["scroller",o&&"fixed",r&&"hideScrollbar",l&&"scrollableX",n&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",s&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",i&&"scrollButtonsHideMobile"],scrollableX:[l&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},d,a)})(ce),de=m({elementType:$.StartScrollButtonIcon,externalSlotProps:U.startScrollButtonIcon,ownerState:ce}),ue=m({elementType:$.EndScrollButtonIcon,externalSlotProps:U.endScrollButtonIcon,ownerState:ce});"production"!==process.env.NODE_ENV&&F&&oe&&console.error('MUI: You can not use the `centered={true}` and `variant="scrollable"` properties at the same time on a `Tabs` component.');const[fe,me]=e.useState(!1),[be,he]=e.useState(N),[xe,ve]=e.useState(!1),[ye,Se]=e.useState(!1),[we,Te]=e.useState(!1),[Be,ge]=e.useState({overflow:"hidden",scrollbarWidth:0}),je=new Map,Ce=e.useRef(null),Ee=e.useRef(null),Ie={slots:$,slotProps:{indicator:q,scrollButton:G,...U}},Oe=()=>{const e=Ce.current;let t,o;if(e){const o=e.getBoundingClientRect();t={clientWidth:e.clientWidth,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollWidth:e.scrollWidth,top:o.top,bottom:o.bottom,left:o.left,right:o.right}}if(e&&!1!==Q){const e=Ee.current.children;if(e.length>0){const r=e[je.get(Q)];"production"!==process.env.NODE_ENV&&(r||console.error(["MUI: The `value` provided to the Tabs component is invalid.",`None of the Tabs' children match with "${Q}".`,je.keys?`You can provide one of the following values: ${Array.from(je.keys()).join(", ")}.`:null].join("\n"))),o=r?r.getBoundingClientRect():null,"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&!k&&o&&0===o.width&&0===o.height&&0!==t.clientWidth&&(t=null,console.error(["MUI: The `value` provided to the Tabs component is invalid.",`The Tab with this \`value\` ("${Q}") is not part of the document layout.`,"Make sure the tab item is present in the document or that it's not `display: none`."].join("\n")),k=!0)}}return{tabsMeta:t,tabMeta:o}},Me=v(()=>{const{tabsMeta:e,tabMeta:t}=Oe();let o,r=0;re?(o="top",t&&e&&(r=t.top-e.top+e.scrollTop)):(o=h?"right":"left",t&&e&&(r=(h?-1:1)*(t[o]-e[o]+e.scrollLeft)));const l={[o]:r,[ae]:t?t[ae]:0};if("number"!=typeof be[o]||"number"!=typeof be[ae])he(l);else{const e=Math.abs(be[o]-l[o]),t=Math.abs(be[ae]-l[ae]);(e>=1||t>=1)&&he(l)}}),Pe=(e,{animation:t=!0}={})=>{t?a(le,Ce.current,e,{duration:p.transitions.duration.standard}):Ce.current[le]=e},Ne=e=>{let t=Ce.current[le];t+=re?e:e*(h?-1:1),Pe(t)},ke=()=>{const e=Ce.current[ie];let t=0;const o=Array.from(Ee.current.children);for(let r=0;r<o.length;r+=1){const l=o[r];if(t+l[ie]>e){0===r&&(t=e);break}t+=l[ie]}return t},De=()=>{Ne(-1*ke())},We=()=>{Ne(ke())},[Fe,{onChange:Re,...Ae}]=u("scrollbar",{className:t(pe.scrollableX,pe.hideScrollbar),elementType:P,shouldForwardComponentProp:!0,externalForwardedProps:Ie,ownerState:ce}),Le=e.useCallback(e=>{Re?.(e),ge({overflow:null,scrollbarWidth:e})},[Re]),[Xe,ze]=u("scrollButtons",{className:t(pe.scrollButtons,G.className),elementType:b,externalForwardedProps:Ie,ownerState:ce,additionalProps:{orientation:H,slots:{StartScrollButtonIcon:$.startScrollButtonIcon||$.StartScrollButtonIcon,EndScrollButtonIcon:$.endScrollButtonIcon||$.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:de,endScrollButtonIcon:ue}}}),Ye=v(e=>{const{tabsMeta:t,tabMeta:o}=Oe();if(o&&t)if(o[ne]<t[ne]){const r=t[le]+(o[ne]-t[ne]);Pe(r,{animation:e})}else if(o[se]>t[se]){const r=t[le]+(o[se]-t[se]);Pe(r,{animation:e})}}),He=v(()=>{oe&&!1!==_&&Te(!we)});e.useEffect(()=>{const e=y(()=>{Ce.current&&Me()});let t;const o=o=>{o.forEach(e=>{e.removedNodes.forEach(e=>{t?.unobserve(e)}),e.addedNodes.forEach(e=>{t?.observe(e)})}),e(),He()},r=S(Ce.current);let l;return r.addEventListener("resize",e),"undefined"!=typeof ResizeObserver&&(t=new ResizeObserver(e),Array.from(Ee.current.children).forEach(e=>{t.observe(e)})),"undefined"!=typeof MutationObserver&&(l=new MutationObserver(o),l.observe(Ee.current,{childList:!0})),()=>{e.clear(),r.removeEventListener("resize",e),l?.disconnect(),t?.disconnect()}},[Me,He]),e.useEffect(()=>{const e=Array.from(Ee.current.children),t=e.length;if("undefined"!=typeof IntersectionObserver&&t>0&&oe&&!1!==_){const o=e[0],r=e[t-1],l={root:Ce.current,threshold:.99},n=new IntersectionObserver(e=>{ve(!e[0].isIntersecting)},l);n.observe(o);const s=new IntersectionObserver(e=>{Se(!e[0].isIntersecting)},l);return s.observe(r),()=>{n.disconnect(),s.disconnect()}}},[oe,_,we,R?.length]),e.useEffect(()=>{me(!0)},[]),e.useEffect(()=>{Me()}),e.useEffect(()=>{Ye(N!==be)},[Ye,be]),e.useImperativeHandle(W,()=>({updateIndicator:Me,updateScrollButtons:He}),[Me,He]);const[Ve,_e]=u("indicator",{className:t(pe.indicator,q.className),elementType:M,externalForwardedProps:Ie,ownerState:ce,additionalProps:{style:be}}),Ke=l(Ve,{..._e});let $e=0;const Ue=e.Children.map(R,t=>{if(!e.isValidElement(t))return null;"production"!==process.env.NODE_ENV&&w.exports.isFragment(t)&&console.error(["MUI: The Tabs component doesn't accept a Fragment as a child.","Consider providing an array instead."].join("\n"));const o=void 0===t.props.value?$e:t.props.value;je.set(o,$e);const r=o===Q;return $e+=1,e.cloneElement(t,{fullWidth:"fullWidth"===Z,indicator:r&&!fe&&Ke,selected:r,selectionFollowsFocus:K,onChange:Y,textColor:J,value:o,...1!==$e||!1!==Q||t.props.tabIndex?{}:{tabIndex:0}})}),qe=(()=>{const e={};e.scrollbarSizeListener=oe?l(Fe,{...Ae,onChange:Le}):null;const t=oe&&("auto"===_&&(xe||ye)||!0===_);return e.scrollButtonStart=t?l(Xe,{direction:h?"right":"left",onClick:De,disabled:!xe,...ze}):null,e.scrollButtonEnd=t?l(Xe,{direction:h?"left":"right",onClick:We,disabled:!ye,...ze}):null,e})(),[Ge,Je]=u("root",{ref:i,className:t(pe.root,A),elementType:E,externalForwardedProps:{...Ie,...te,component:L},ownerState:ce}),[Qe,Ze]=u("scroller",{ref:Ce,className:pe.scroller,elementType:I,externalForwardedProps:Ie,ownerState:ce,additionalProps:{style:{overflow:Be.overflow,[re?"margin"+(h?"Left":"Right"):"marginBottom"]:ee?void 0:-Be.scrollbarWidth}}}),[et,tt]=u("list",{ref:Ee,className:t(pe.list,pe.flexContainer),elementType:O,externalForwardedProps:Ie,ownerState:ce,getSlotProps:e=>({...e,onKeyDown:t=>{(e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey)return;const t=Ee.current,o=B(t).activeElement;if("tab"!==o.getAttribute("role"))return;let r="horizontal"===H?"ArrowLeft":"ArrowUp",l="horizontal"===H?"ArrowRight":"ArrowDown";switch("horizontal"===H&&h&&(r="ArrowRight",l="ArrowLeft"),e.key){case r:e.preventDefault(),C(t,o,j);break;case l:e.preventDefault(),C(t,o,g);break;case"Home":e.preventDefault(),C(t,null,g);break;case"End":e.preventDefault(),C(t,null,j)}})(t),e.onKeyDown?.(t)}})});return n(Ge,{...Je,children:[qe.scrollButtonStart,qe.scrollbarSizeListener,n(Qe,{...Ze,children:[l(et,{"aria-label":T,"aria-labelledby":D,"aria-orientation":"vertical"===H?"vertical":null,role:"tablist",...tt,children:Ue}),fe&&Ke]}),qe.scrollButtonEnd]})});"production"!==process.env.NODE_ENV&&(D.propTypes={action:h,allowScrollButtonsMobile:T.exports.bool,"aria-label":T.exports.string,"aria-labelledby":T.exports.string,centered:T.exports.bool,children:T.exports.node,classes:T.exports.object,className:T.exports.string,component:T.exports.elementType,indicatorColor:T.exports.oneOfType([T.exports.oneOf(["primary","secondary"]),T.exports.string]),onChange:T.exports.func,orientation:T.exports.oneOf(["horizontal","vertical"]),ScrollButtonComponent:T.exports.elementType,scrollButtons:T.exports.oneOf(["auto",!1,!0]),selectionFollowsFocus:T.exports.bool,slotProps:T.exports.shape({endScrollButtonIcon:T.exports.oneOfType([T.exports.func,T.exports.object]),indicator:T.exports.oneOfType([T.exports.func,T.exports.object]),list:T.exports.oneOfType([T.exports.func,T.exports.object]),root:T.exports.oneOfType([T.exports.func,T.exports.object]),scrollbar:T.exports.oneOfType([T.exports.func,T.exports.object]),scrollButtons:T.exports.oneOfType([T.exports.func,T.exports.object]),scroller:T.exports.oneOfType([T.exports.func,T.exports.object]),startScrollButtonIcon:T.exports.oneOfType([T.exports.func,T.exports.object])}),slots:T.exports.shape({endScrollButtonIcon:T.exports.elementType,EndScrollButtonIcon:T.exports.elementType,indicator:T.exports.elementType,list:T.exports.elementType,root:T.exports.elementType,scrollbar:T.exports.elementType,scrollButtons:T.exports.elementType,scroller:T.exports.elementType,startScrollButtonIcon:T.exports.elementType,StartScrollButtonIcon:T.exports.elementType}),sx:T.exports.oneOfType([T.exports.arrayOf(T.exports.oneOfType([T.exports.func,T.exports.object,T.exports.bool])),T.exports.func,T.exports.object]),TabIndicatorProps:T.exports.object,TabScrollButtonProps:T.exports.object,textColor:T.exports.oneOf(["inherit","primary","secondary"]),value:T.exports.any,variant:T.exports.oneOf(["fullWidth","scrollable","standard"]),visibleScrollbar:T.exports.bool});var W=D;export{W as default};
|
|
1
|
+
import*as e from"react";import"../../node_modules/react-is/index.js";import"../../../../prop-types/index.js";import{clsx as t}from"../../../../clsx/dist/clsx.mjs.js";import{useRtl as o}from"../../../system/esm/RtlProvider/index.js";import r from"../styles/useTheme.js";import{jsx as l,jsxs as n}from"react/jsx-runtime";import s from"../styles/styled.js";import i from"../utils/memoTheme.js";import a from"../internal/animate.js";import c from"./ScrollbarSize.js";import p,{getTabsUtilityClass as d}from"./tabsClasses.js";import u from"../utils/useSlot.js";import{useDefaultProps as f}from"../DefaultPropsProvider/DefaultPropsProvider.js";import m from"../../../utils/esm/useSlotProps/useSlotProps.js";import b from"../TabScrollButton/TabScrollButton.js";import h from"../../../utils/esm/refType/refType.js";import x from"../../../utils/esm/composeClasses/composeClasses.js";import v from"../../../utils/esm/useEventCallback/useEventCallback.js";import y from"../../../utils/esm/debounce/debounce.js";import S from"../../../utils/esm/ownerWindow/ownerWindow.js";import{r as w}from"../../../../../_virtual/index3.js";import{p as T}from"../../../../../_virtual/index5.js";import B from"../../../utils/esm/ownerDocument/ownerDocument.js";const g=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,j=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,C=(e,t,o)=>{let r=!1,l=o(e,t);for(;l;){if(l===e.firstChild){if(r)return;r=!0}const t=l.disabled||"true"===l.getAttribute("aria-disabled");if(l.hasAttribute("tabindex")&&!t)return void l.focus();l=o(e,l)}},E=s("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[{[`& .${p.scrollButtons}`]:t.scrollButtons},{[`& .${p.scrollButtons}`]:o.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,o.vertical&&t.vertical]}})(i(({theme:e})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.scrollButtonsHideMobile,style:{[`& .${p.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}}}]}))),I=s("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.scroller,o.fixed&&t.fixed,o.hideScrollbar&&t.hideScrollbar,o.scrollableX&&t.scrollableX,o.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),O=s("div",{name:"MuiTabs",slot:"List",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.list,t.flexContainer,o.vertical&&t.flexContainerVertical,o.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.centered,style:{justifyContent:"center"}}]}),M=s("span",{name:"MuiTabs",slot:"Indicator"})(i(({theme:e})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:e})=>e.vertical,style:{height:"100%",width:2,right:0}}]}))),P=s(c)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),N={};let k=!1;const D=e.forwardRef(function(s,i){const c=f({props:s,name:"MuiTabs"}),p=r(),h=o(),{"aria-label":T,"aria-labelledby":D,action:W,centered:F=!1,children:R,className:A,component:L="div",allowScrollButtonsMobile:X=!1,indicatorColor:z="primary",onChange:Y,orientation:H="horizontal",ScrollButtonComponent:V,scrollButtons:_="auto",selectionFollowsFocus:K,slots:$={},slotProps:U={},TabIndicatorProps:q={},TabScrollButtonProps:G={},textColor:J="primary",value:Q,variant:Z="standard",visibleScrollbar:ee=!1,...te}=c,oe="scrollable"===Z,re="vertical"===H,le=re?"scrollTop":"scrollLeft",ne=re?"top":"left",se=re?"bottom":"right",ie=re?"clientHeight":"clientWidth",ae=re?"height":"width",ce={...c,component:L,allowScrollButtonsMobile:X,indicatorColor:z,orientation:H,vertical:re,scrollButtons:_,textColor:J,variant:Z,visibleScrollbar:ee,fixed:!oe,hideScrollbar:oe&&!ee,scrollableX:oe&&!re,scrollableY:oe&&re,centered:F&&!oe,scrollButtonsHideMobile:!X},pe=(e=>{const{vertical:t,fixed:o,hideScrollbar:r,scrollableX:l,scrollableY:n,centered:s,scrollButtonsHideMobile:i,classes:a}=e;return x({root:["root",t&&"vertical"],scroller:["scroller",o&&"fixed",r&&"hideScrollbar",l&&"scrollableX",n&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",s&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",i&&"scrollButtonsHideMobile"],scrollableX:[l&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},d,a)})(ce),de=m({elementType:$.StartScrollButtonIcon,externalSlotProps:U.startScrollButtonIcon,ownerState:ce}),ue=m({elementType:$.EndScrollButtonIcon,externalSlotProps:U.endScrollButtonIcon,ownerState:ce});"production"!==process.env.NODE_ENV&&F&&oe&&console.error('MUI: You can not use the `centered={true}` and `variant="scrollable"` properties at the same time on a `Tabs` component.');const[fe,me]=e.useState(!1),[be,he]=e.useState(N),[xe,ve]=e.useState(!1),[ye,Se]=e.useState(!1),[we,Te]=e.useState(!1),[Be,ge]=e.useState({overflow:"hidden",scrollbarWidth:0}),je=new Map,Ce=e.useRef(null),Ee=e.useRef(null),Ie={slots:$,slotProps:{indicator:q,scrollButton:G,...U}},Oe=()=>{const e=Ce.current;let t,o;if(e){const o=e.getBoundingClientRect();t={clientWidth:e.clientWidth,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollWidth:e.scrollWidth,top:o.top,bottom:o.bottom,left:o.left,right:o.right}}if(e&&!1!==Q){const e=Ee.current.children;if(e.length>0){const r=e[je.get(Q)];"production"!==process.env.NODE_ENV&&(r||console.error(["MUI: The `value` provided to the Tabs component is invalid.",`None of the Tabs' children match with "${Q}".`,je.keys?`You can provide one of the following values: ${Array.from(je.keys()).join(", ")}.`:null].join("\n"))),o=r?r.getBoundingClientRect():null,"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&!k&&o&&0===o.width&&0===o.height&&0!==t.clientWidth&&(t=null,console.error(["MUI: The `value` provided to the Tabs component is invalid.",`The Tab with this \`value\` ("${Q}") is not part of the document layout.`,"Make sure the tab item is present in the document or that it's not `display: none`."].join("\n")),k=!0)}}return{tabsMeta:t,tabMeta:o}},Me=v(()=>{const{tabsMeta:e,tabMeta:t}=Oe();let o,r=0;re?(o="top",t&&e&&(r=t.top-e.top+e.scrollTop)):(o=h?"right":"left",t&&e&&(r=(h?-1:1)*(t[o]-e[o]+e.scrollLeft)));const l={[o]:r,[ae]:t?t[ae]:0};if("number"!=typeof be[o]||"number"!=typeof be[ae])he(l);else{const e=Math.abs(be[o]-l[o]),t=Math.abs(be[ae]-l[ae]);(e>=1||t>=1)&&he(l)}}),Pe=(e,{animation:t=!0}={})=>{t?a(le,Ce.current,e,{duration:p.transitions.duration.standard}):Ce.current[le]=e},Ne=e=>{let t=Ce.current[le];t+=re?e:e*(h?-1:1),Pe(t)},ke=()=>{const e=Ce.current[ie];let t=0;const o=Array.from(Ee.current.children);for(let r=0;r<o.length;r+=1){const l=o[r];if(t+l[ie]>e){0===r&&(t=e);break}t+=l[ie]}return t},De=()=>{Ne(-1*ke())},We=()=>{Ne(ke())},[Fe,{onChange:Re,...Ae}]=u("scrollbar",{className:t(pe.scrollableX,pe.hideScrollbar),elementType:P,shouldForwardComponentProp:!0,externalForwardedProps:Ie,ownerState:ce}),Le=e.useCallback(e=>{Re?.(e),ge({overflow:null,scrollbarWidth:e})},[Re]),[Xe,ze]=u("scrollButtons",{className:t(pe.scrollButtons,G.className),elementType:b,externalForwardedProps:Ie,ownerState:ce,additionalProps:{orientation:H,slots:{StartScrollButtonIcon:$.startScrollButtonIcon||$.StartScrollButtonIcon,EndScrollButtonIcon:$.endScrollButtonIcon||$.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:de,endScrollButtonIcon:ue}}}),Ye=v(e=>{const{tabsMeta:t,tabMeta:o}=Oe();if(o&&t)if(o[ne]<t[ne]){const r=t[le]+(o[ne]-t[ne]);Pe(r,{animation:e})}else if(o[se]>t[se]){const r=t[le]+(o[se]-t[se]);Pe(r,{animation:e})}}),He=v(()=>{oe&&!1!==_&&Te(!we)});e.useEffect(()=>{const e=y(()=>{Ce.current&&Me()});let t;const o=o=>{o.forEach(e=>{e.removedNodes.forEach(e=>{t?.unobserve(e)}),e.addedNodes.forEach(e=>{t?.observe(e)})}),e(),He()},r=S(Ce.current);let l;return r.addEventListener("resize",e),"undefined"!=typeof ResizeObserver&&(t=new ResizeObserver(e),Array.from(Ee.current.children).forEach(e=>{t.observe(e)})),"undefined"!=typeof MutationObserver&&(l=new MutationObserver(o),l.observe(Ee.current,{childList:!0})),()=>{e.clear(),r.removeEventListener("resize",e),l?.disconnect(),t?.disconnect()}},[Me,He]),e.useEffect(()=>{const e=Array.from(Ee.current.children),t=e.length;if("undefined"!=typeof IntersectionObserver&&t>0&&oe&&!1!==_){const o=e[0],r=e[t-1],l={root:Ce.current,threshold:.99},n=new IntersectionObserver(e=>{ve(!e[0].isIntersecting)},l);n.observe(o);const s=new IntersectionObserver(e=>{Se(!e[0].isIntersecting)},l);return s.observe(r),()=>{n.disconnect(),s.disconnect()}}},[oe,_,we,R?.length]),e.useEffect(()=>{me(!0)},[]),e.useEffect(()=>{Me()}),e.useEffect(()=>{Ye(N!==be)},[Ye,be]),e.useImperativeHandle(W,()=>({updateIndicator:Me,updateScrollButtons:He}),[Me,He]);const[Ve,_e]=u("indicator",{className:t(pe.indicator,q.className),elementType:M,externalForwardedProps:Ie,ownerState:ce,additionalProps:{style:be}}),Ke=l(Ve,{..._e});let $e=0;const Ue=e.Children.map(R,t=>{if(!e.isValidElement(t))return null;"production"!==process.env.NODE_ENV&&w.exports.isFragment(t)&&console.error(["MUI: The Tabs component doesn't accept a Fragment as a child.","Consider providing an array instead."].join("\n"));const o=void 0===t.props.value?$e:t.props.value;je.set(o,$e);const r=o===Q;return $e+=1,e.cloneElement(t,{fullWidth:"fullWidth"===Z,indicator:r&&!fe&&Ke,selected:r,selectionFollowsFocus:K,onChange:Y,textColor:J,value:o,...1!==$e||!1!==Q||t.props.tabIndex?{}:{tabIndex:0}})}),qe=(()=>{const e={};e.scrollbarSizeListener=oe?l(Fe,{...Ae,onChange:Le}):null;const t=oe&&("auto"===_&&(xe||ye)||!0===_);return e.scrollButtonStart=t?l(Xe,{direction:h?"right":"left",onClick:De,disabled:!xe,...ze}):null,e.scrollButtonEnd=t?l(Xe,{direction:h?"left":"right",onClick:We,disabled:!ye,...ze}):null,e})(),[Ge,Je]=u("root",{ref:i,className:t(pe.root,A),elementType:E,externalForwardedProps:{...Ie,...te,component:L},ownerState:ce}),[Qe,Ze]=u("scroller",{ref:Ce,className:pe.scroller,elementType:I,externalForwardedProps:Ie,ownerState:ce,additionalProps:{style:{overflow:Be.overflow,[re?"margin"+(h?"Left":"Right"):"marginBottom"]:ee?void 0:-Be.scrollbarWidth}}}),[et,tt]=u("list",{ref:Ee,className:t(pe.list,pe.flexContainer),elementType:O,externalForwardedProps:Ie,ownerState:ce,getSlotProps:e=>({...e,onKeyDown:t=>{(e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey)return;const t=Ee.current,o=B(t).activeElement;if("tab"!==o.getAttribute("role"))return;let r="horizontal"===H?"ArrowLeft":"ArrowUp",l="horizontal"===H?"ArrowRight":"ArrowDown";switch("horizontal"===H&&h&&(r="ArrowRight",l="ArrowLeft"),e.key){case r:e.preventDefault(),C(t,o,j);break;case l:e.preventDefault(),C(t,o,g);break;case"Home":e.preventDefault(),C(t,null,g);break;case"End":e.preventDefault(),C(t,null,j)}})(t),e.onKeyDown?.(t)}})});return n(Ge,{...Je,children:[qe.scrollButtonStart,qe.scrollbarSizeListener,n(Qe,{...Ze,children:[l(et,{"aria-label":T,"aria-labelledby":D,"aria-orientation":"vertical"===H?"vertical":null,role:"tablist",...tt,children:Ue}),fe&&Ke]}),qe.scrollButtonEnd]})});"production"!==process.env.NODE_ENV&&(D.propTypes={action:h,allowScrollButtonsMobile:T.exports.bool,"aria-label":T.exports.string,"aria-labelledby":T.exports.string,centered:T.exports.bool,children:T.exports.node,classes:T.exports.object,className:T.exports.string,component:T.exports.elementType,indicatorColor:T.exports.oneOfType([T.exports.oneOf(["primary","secondary"]),T.exports.string]),onChange:T.exports.func,orientation:T.exports.oneOf(["horizontal","vertical"]),ScrollButtonComponent:T.exports.elementType,scrollButtons:T.exports.oneOf(["auto",!1,!0]),selectionFollowsFocus:T.exports.bool,slotProps:T.exports.shape({endScrollButtonIcon:T.exports.oneOfType([T.exports.func,T.exports.object]),indicator:T.exports.oneOfType([T.exports.func,T.exports.object]),list:T.exports.oneOfType([T.exports.func,T.exports.object]),root:T.exports.oneOfType([T.exports.func,T.exports.object]),scrollbar:T.exports.oneOfType([T.exports.func,T.exports.object]),scrollButtons:T.exports.oneOfType([T.exports.func,T.exports.object]),scroller:T.exports.oneOfType([T.exports.func,T.exports.object]),startScrollButtonIcon:T.exports.oneOfType([T.exports.func,T.exports.object])}),slots:T.exports.shape({endScrollButtonIcon:T.exports.elementType,EndScrollButtonIcon:T.exports.elementType,indicator:T.exports.elementType,list:T.exports.elementType,root:T.exports.elementType,scrollbar:T.exports.elementType,scrollButtons:T.exports.elementType,scroller:T.exports.elementType,startScrollButtonIcon:T.exports.elementType,StartScrollButtonIcon:T.exports.elementType}),sx:T.exports.oneOfType([T.exports.arrayOf(T.exports.oneOfType([T.exports.func,T.exports.object,T.exports.bool])),T.exports.func,T.exports.object]),TabIndicatorProps:T.exports.object,TabScrollButtonProps:T.exports.object,textColor:T.exports.oneOf(["inherit","primary","secondary"]),value:T.exports.any,variant:T.exports.oneOf(["fullWidth","scrollable","standard"]),visibleScrollbar:T.exports.bool});var W=D;export{W as default};
|
|
2
2
|
//# sourceMappingURL=Tabs.js.map
|