@zealicsolutions/web-ui 1.0.140-beta.102 → 1.0.140-beta.103
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e
|
|
1
|
+
import{jsxs as t,jsx as e}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import"../../contexts/AccountButtonContext/AccountButtonContext.js";import{useMemo as o,useState as i,useEffect as n}from"react";import"../../contexts/ApiContext/ApiContext.js";import{useContainerRuntime as r}from"../../contexts/ContainerRuntimeContext/ContainerRuntimeContext.js";import"../../contexts/FormStepContext/FormStepContext.js";import{useFormContext as m}from"../../node_modules/react-hook-form/dist/index.esm.mjs.js";import"../../contexts/LayoutContext/LayoutContext.js";import"../../theme/theme.js";import"../../theme/provider.js";import"../../theme/toastStyles.js";import"../../contexts/MlrRichTextViewerContext/MlrRichTextViewerContext.js";import"../../contexts/OrganismContext/OrganismContext.js";import{useOrganismContext as a}from"../../contexts/OrganismContext/useOrganismContext.js";import"../../contexts/PopupContext/PopupContext.js";import"../../contexts/ReplicatorFormContext/ReplicatorFormContext.js";import"../../contexts/ReplicatorRegistryContext/ReplicatorRegistryContext.js";import"../../contexts/StateContext/StateContext.js";import{useStateContext as l}from"../../contexts/StateContext/useStateContext.js";import"../../contexts/WebpageContext/WebpageContext.js";import"@tanstack/react-query";import{usePickListOptions as s}from"../../contexts/ApiContext/globalQueries/pickList/usePickListOptions.js";import d from"../../node_modules/@mui/material/esm/FormHelperText/FormHelperText.js";import p from"../../node_modules/@mui/material/esm/Typography/Typography.js";import x from"../../node_modules/@mui/material/esm/InputLabel/InputLabel.js";import c from"../../node_modules/@mui/material/esm/MenuItem/MenuItem.js";import u from"../../node_modules/@mui/material/esm/CircularProgress/CircularProgress.js";import g from"../../node_modules/@mui/material/esm/Select/Select.js";import h from"../../node_modules/@mui/material/esm/FormControl/FormControl.js";const f=({open:f,text:C,disabled:j,sx:b,placeholderText:v,required:y=!1,requiredErrorText:S="This field is required",validationErrorText:L="Invalid format",isDisplayOnly:_=!1,displayText:R,visible:T=!0,fontSize:F,fontFamily:W,fontWeight:B,textColor:A,textAlign:H,borderColor:I,color:O,backgroundColor:k,marginLeft:w="0",marginTop:V="0",marginRight:z="0",marginBottom:M="0",paddingLeft:q,paddingTop:P,paddingRight:D,paddingBottom:$,width:E,height:Q,minHeight:G,maxHeight:J,minWidth:K,maxWidth:N,configurationItemInfo:U={},name:X,sourceDataModelField:Y,predefinedValue:Z,inputSize:tt="medium",hideLabel:et=!1,variant:ot="outlined",native:it=!1,options:nt})=>{const rt=_?void 0:Y,{dataModelFieldOptions:mt,isLoading:at}=s(rt),lt=nt&&nt.length>0?nt:mt,st=o(()=>(lt||[]).map(t=>"string"==typeof t?{id:t,label:t}:t),[lt]),dt=m(),pt=!!dt?.control&&!!X,[xt,ct]=i(""),{localStateObject:ut,setLocalStateValue:gt}=a(),{stateConfig:ht}=l(),ft=r(),Ct=ut||ht,jt=Y?Ct?.[Y]:void 0,bt=jt?.value||("string"==typeof jt||"number"==typeof jt?jt:void 0),vt=Y?ft?.getDmfValue(Y):void 0,yt="string"==typeof vt||"number"==typeof vt?vt:vt&&"object"==typeof vt?vt.value??vt.label??vt.id:void 0,St=null!=Z&&""!==Z,Lt=Boolean(j)||St;if(n(()=>{St&&null!=Z&&(pt?dt?.setValue(X,Z):ct(Z))},[St,Z,pt,dt,X]),!T)return null;if(_){const o=R??(null!=yt?String(yt):void 0)??(null!=bt?String(bt):void 0)??(v||"-");return t("div",{style:{display:"inline-flex",flexDirection:"column",marginTop:V,marginRight:z,marginBottom:M,marginLeft:w,...E?{width:E}:{width:"fit-content"},...Q&&{height:Q},...G&&{minHeight:G},...J&&{maxHeight:J},...K&&{minWidth:K},...N&&{maxWidth:N}},...U,children:[C&&e(d,{sx:{fontSize:F,fontFamily:W,fontWeight:B,color:A||"#000",marginLeft:0,marginBottom:"4px",textAlign:H},children:C}),e(p,{sx:{fontSize:F,fontFamily:W,fontWeight:B,color:A,textAlign:H,paddingLeft:q,paddingTop:P,paddingRight:D,paddingBottom:$,backgroundColor:k,border:`1px solid ${I||"#ccc"}`,borderRadius:"4px"},children:o})]})}const _t={marginLeft:w,marginTop:V,marginRight:z,marginBottom:M,...E&&{width:E},...Q&&{height:Q},...N&&{maxWidth:N},...G&&{minHeight:G},...J&&{maxHeight:J},...K?{minWidth:K}:E?{}:{minWidth:"240px"},...b},Rt=pt?dt.watch(X)||"":xt,Tt=pt?dt.formState?.errors?.[X]:void 0;return t(h,{variant:ot,size:tt,sx:_t,disabled:Lt,required:y,error:!!Tt,children:[!et&&e(x,{id:`${X}-label`,shrink:!!it||void 0,children:C}),e(g,{value:Rt,onChange:t=>{var e;e=t.target.value,ct(e),pt&&dt.setValue(X,e),Y&>&>(Y,{id:e})},labelId:et?void 0:`${X}-label`,label:et?void 0:C,disabled:Lt,native:it,children:it?[e("option",{value:"",children:v||"Select an option"},"__placeholder__"),...at?[e("option",{disabled:!0,children:"Loading..."},"__loading__")]:st.map(t=>e("option",{value:t.id,children:t.label},t.id))]:at?t(c,{disabled:!0,children:[e(u,{size:20,sx:{mr:1}}),"Loading..."]}):st.map(t=>e(c,{value:t.id,children:t.label},t.id))}),Tt&&e(d,{error:!0,children:Tt?.message||S})]})};export{f 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","inputSize","hideLabel","variant","native","options","fieldIdForOptions","undefined","dataModelFieldOptions","isLoading","isOptionsLoading","usePickListOptions","effectiveOptions","length","normalizedOptions","useMemo","map","item","id","label","formContext","useFormContext","isInFormContext","control","localValue","setLocalValue","useState","localStateObject","setLocalStateValue","
|
|
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","inputSize","hideLabel","variant","native","options","fieldIdForOptions","undefined","dataModelFieldOptions","isLoading","isOptionsLoading","usePickListOptions","effectiveOptions","length","normalizedOptions","useMemo","map","item","id","label","formContext","useFormContext","isInFormContext","control","localValue","setLocalValue","useState","localStateObject","setLocalStateValue","useOrganismContext","stateConfig","useStateContext","containerRuntime","useContainerRuntime","stateObject","dataModelEntry","dataModelFieldDisplayValue","value","containerScopedEntry","getDmfValue","containerDisplayValue","isPredefined","isDisabled","Boolean","useEffect","setValue","resolvedDisplayText","String","_jsxs","style","display","flexDirection","_jsx","FormHelperText","children","Typography","border","borderRadius","formControlSx","currentValue","watch","formError","formState","errors","FormControl","size","error","InputLabel","shrink","MuiSelect","onChange","e","newValue","target","labelId","opt","MenuItem","CircularProgress","mr","message"],"mappings":"28DAsEa,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,cACAC,aACAC,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