@zealicsolutions/web-ui 1.0.140-beta.102 → 1.0.140-beta.104
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 a}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 m}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 c from"../../node_modules/@mui/material/esm/InputLabel/InputLabel.js";import x from"../../node_modules/@mui/material/esm/Select/Select.js";import u from"../../node_modules/@mui/material/esm/MenuItem/MenuItem.js";import g from"../../node_modules/@mui/material/esm/CircularProgress/CircularProgress.js";import h from"../../node_modules/@mui/material/esm/FormControl/FormControl.js";const f=({open:f,text:C,disabled:j,sx:v,placeholderText:b,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:k,textColor:I,textAlign:B,borderColor:A,color:H,backgroundColor:O,marginLeft:w="0",marginTop:M="0",marginRight:V="0",marginBottom:z="0",paddingLeft:P,paddingTop:q,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:at,isLoading:mt}=s(rt),lt=nt&&nt.length>0?nt:at,st=o(()=>(lt||[]).map(t=>"string"==typeof t?{id:t,label:t}:t),[lt]),dt=a(),pt=!!dt?.control&&!!X,[ct,xt]=i(""),{localStateObject:ut,setLocalStateValue:gt,isConfigurationMode:ht,selectedConfigurationItemId:ft}=m(),{stateConfig:Ct}=l(),jt=r(),vt=ut||Ct,bt=Y?vt?.[Y]:void 0,yt=bt?.value||("string"==typeof bt||"number"==typeof bt?bt:void 0),St=Y?jt?.getDmfValue(Y):void 0,Lt="string"==typeof St||"number"==typeof St?St:St&&"object"==typeof St?St.value??St.label??St.id:void 0,_t=null!=Z&&""!==Z,Rt=Boolean(j)||_t;if(n(()=>{_t&&null!=Z&&(pt?dt?.setValue(X,Z):xt(Z))},[_t,Z,pt,dt,X]),!T)return null;if(_){const o=R??(null!=Lt?String(Lt):void 0)??(null!=yt?String(yt):void 0)??(b||"-");return t("div",{style:{display:"inline-flex",flexDirection:"column",marginTop:M,marginRight:V,marginBottom:z,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:k,color:I||"#000",marginLeft:0,marginBottom:"4px",textAlign:B},children:C}),e(p,{sx:{fontSize:F,fontFamily:W,fontWeight:k,color:I,textAlign:B,paddingLeft:P,paddingTop:q,paddingRight:D,paddingBottom:$,backgroundColor:O,border:`1px solid ${A||"#ccc"}`,borderRadius:"4px"},children:o})]})}const Tt={marginLeft:w,marginTop:M,marginRight:V,marginBottom:z,...E&&{width:E},...Q&&{height:Q},...N&&{maxWidth:N},...G&&{minHeight:G},...J&&{maxHeight:J},...K?{minWidth:K}:E?{}:{minWidth:"240px"},...v},Ft=pt?dt.watch(X)||"":ct,Wt=pt?dt.formState?.errors?.[X]:void 0;return e("div",{style:{position:"relative"},...U,onClick:t=>{ht&&U&&"onClick"in U&&(t.stopPropagation(),t.preventDefault(),U.onClick())},children:t(h,{variant:ot,size:tt,sx:Tt,disabled:Rt,required:y,error:!!Wt,children:[!et&&e(c,{id:`${X}-label`,shrink:!!it||void 0,children:C}),e(x,{value:Ft,onChange:t=>{var e;ht||(e=t.target.value,xt(e),pt&&dt.setValue(X,e),Y&>&>(Y,{id:e}))},...ht&&{open:!1},labelId:et?void 0:`${X}-label`,label:et?void 0:C,disabled:Rt,native:it,children:it?[e("option",{value:"",children:b||"Select an option"},"__placeholder__"),...mt?[e("option",{disabled:!0,children:"Loading..."},"__loading__")]:st.map(t=>e("option",{value:t.id,children:t.label},t.id))]:mt?t(u,{disabled:!0,children:[e(g,{size:20,sx:{mr:1}}),"Loading..."]}):st.map(t=>e(u,{value:t.id,children:t.label},t.id))}),Wt&&e(d,{error:!0,children:Wt?.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","isConfigurationMode","selectedConfigurationItemId","useOrganismContext","stateConfig","useStateContext","
|
|
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","isConfigurationMode","selectedConfigurationItemId","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","position","onClick","e","stopPropagation","preventDefault","FormControl","size","error","InputLabel","shrink","MuiSelect","onChange","newValue","target","labelId","opt","MenuItem","CircularProgress","mr","message"],"mappings":"28DAsEa,MAAAA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