@zealicsolutions/web-ui 1.0.41 → 1.0.42-beta-1
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{__rest as e,__assign as t}from"../../node_modules/tslib/tslib.es6.js";import{jsxs as o,jsx as r,Fragment as
|
1
|
+
import{__rest as e,__assign as t}from"../../node_modules/tslib/tslib.es6.js";import{jsxs as o,jsx as r,Fragment as n}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import i,{useEffect as l,useMemo as a,useState as d}from"react";import{useFormContext as u,Controller as m}from"../../node_modules/react-hook-form/dist/index.esm.mjs.js";import"../../contexts/FormStepContext/FormStepContext.js";import"../../contexts/ButtonActionsContext/ButtonActionsContext.js";import"../../contexts/MlrRichTextViewerContext/MlrRichTextViewerContext.js";import{useOrganismContext as c}from"../../contexts/hooks/useOrganismContext.js";import{useStateContext as s}from"../../contexts/hooks/useStateContext.js";import"../../contexts/AccountButtonContext/AccountButtonContext.js";import f from"../../node_modules/@mui/material/FormHelperText/FormHelperText.js";import p from"../../node_modules/@mui/material/Typography/Typography.js";import g from"../../node_modules/@mui/material/InputLabel/InputLabel.js";import x from"../../node_modules/@mui/material/FormControl/FormControl.js";import h from"../../node_modules/@mui/material/MenuItem/MenuItem.js";import v from"../../node_modules/@mui/material/Select/Select.js";var b=function(b){var C,y=b.open,j=b.text,T=b.options,I=b.placeholderText,S=b.required,F=void 0!==S&&S,M=b.requiredErrorText,B=void 0===M?"This field is required":M,O=b.validationErrorText,z=void 0===O?"Invalid format":O,L=b.isDisplayOnly,R=void 0!==L&&L,q=b.fontSize,_=b.fontFamily,A=b.fontWeight,W=b.textColor,k=b.textAlign,P=b.borderColor,w=b.color,D=b.backgroundColor,V=b.marginLeft,E=void 0===V?"0":V,H=b.marginTop,G=void 0===H?"0":H,J=b.marginRight,K=void 0===J?"0":J,N=b.marginBottom,Q=void 0===N?"0":N,U=b.paddingLeft,X=void 0===U?"0":U,Y=b.paddingTop,Z=void 0===Y?"0":Y,$=b.paddingRight,ee=void 0===$?"0":$,te=b.paddingBottom,oe=void 0===te?"0":te,re=b.configurationItemInfo,ne=void 0===re?{}:re,ie=b.name,le=b.sourceDataModelField,ae=e(b,["open","text","options","placeholderText","required","requiredErrorText","validationErrorText","isDisplayOnly","fontSize","fontFamily","fontWeight","textColor","textAlign","borderColor","color","backgroundColor","marginLeft","marginTop","marginRight","marginBottom","paddingLeft","paddingTop","paddingRight","paddingBottom","configurationItemInfo","name","sourceDataModelField"]),de=u(),ue=null==de?void 0:de.control,me=!!de&&!!ue&&!!ie,ce=me?de.formState.errors:{},se=c().localStateObject,fe=s().stateConfig,pe=se||fe,ge=le?null===(C=null==pe?void 0:pe[le])||void 0===C?void 0:C.value:void 0;l((function(){void 0!==ge&&me&&(null==de||de.setValue(ie,ge))}),[ge]);var xe=a((function(){return{required:!!F&&B,validate:function(e){return!0}}}),[F,B,z]),he=d("");he[0];var ve=he[1],be=a((function(){return T?T.map((function(e){return"string"==typeof e?{id:e,value:e}:e})):[]}),[T]);if(R){var Ce="";if(me){var ye=de.watch(ie);Ce=ye||""}else Ce=ge;var je=be.find((function(e){return e.value===Ce})),Te=je?je.value:Ce||I||"-";return o("div",t({style:{display:"inline-flex",flexDirection:"column",marginTop:G,marginRight:K,marginBottom:Q,marginLeft:E}},ne,{children:[j&&r("div",t({style:{marginBottom:4}},{children:r(f,t({sx:{fontSize:q,fontFamily:_,fontWeight:A,color:W||"#000",marginLeft:0}},{children:j}))})),r(p,t({sx:{fontSize:q,fontFamily:_,fontWeight:A,color:W,paddingLeft:X,paddingTop:Z,paddingRight:ee,paddingBottom:oe,backgroundColor:D,border:"1px solid ".concat(P||"#ccc"),borderRadius:"4px",minWidth:"120px"}},{children:Te}))]}))}var Ie={fontSize:q,fontFamily:_,fontWeight:A,color:w,"& .MuiOutlinedInput-notchedOutline":{borderColor:P||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:P||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:P||"inherit"},"& .MuiSelect-select":{display:"flex",alignItems:"center",justifyContent:i.useMemo((function(){switch(k){case"center":return"center";case"right":return"flex-end";case"justify":return"space-between";default:return"flex-start"}}),[k]),backgroundColor:D,textAlign:k,boxSizing:"border-box",paddingLeft:X,paddingTop:Z,paddingRight:ee,paddingBottom:oe}},Se={color:W||"rgba(0, 0, 0, 0.6)",fontSize:q,fontFamily:_,fontWeight:A,textAlign:k,"&.Mui-focused":{color:W||"rgba(0, 0, 0, 0.6)"}},Fe={marginLeft:E,marginTop:G,marginRight:K,marginBottom:Q,minWidth:"200px"},Me={disablePortal:!1,PopoverProps:{container:function(){return document.body},style:{position:"absolute"}},PaperProps:{sx:{zIndex:function(e){return e.zIndex.modal+1}}},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"}},Be=function(e){return o(v,t({},e||{},{open:y,labelId:"select-label-".concat(ie),id:"select-".concat(ie),label:j,MenuProps:Me,renderValue:function(e){if(!e)return I||"";var t=be.find((function(t){return t.value===e}));return t?t.value:e},sx:Ie,onChange:function(t){var o=t.target.value;(null==e?void 0:e.onChange)?e.onChange(o):ve(o)}},ae,{children:[I&&r(h,t({disabled:!0,value:""},{children:I})),be.map((function(e,o){return r(h,t({value:e.value},{children:e.value}),o)}))]}))};if(me){var Oe=ce[ie];return o(x,t({variant:"outlined",sx:Fe,error:!!Oe,required:F},ne,{children:[r(g,t({id:"select-label-".concat(ie),sx:Se},{children:j})),r(m,{name:ie,rules:xe,control:ue,defaultValue:"",render:function(e){var t=e.field,i=e.fieldState;return o(n,{children:[Be(t),!!i.error&&r(f,{children:"required"===i.error.type?B:z})]})}})]}))}return o(x,t({variant:"outlined",sx:Fe,required:F},ne,{children:[r(g,t({id:"select-label-".concat(ie),sx:Se},{children:j})),Be()]}))};export{b 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","_a","open","text","options","placeholderText","_c","required","_d","requiredErrorText","_e","validationErrorText","_f","isDisplayOnly","fontSize","fontFamily","fontWeight","textColor","textAlign","borderColor","color","backgroundColor","_g","marginLeft","_h","marginTop","_j","marginRight","_k","marginBottom","_l","paddingLeft","_m","paddingTop","_o","paddingRight","_p","paddingBottom","_q","configurationItemInfo","name","sourceDataModelField","props","__rest","formContext","useFormContext","control","isInFormContext","errors","formState","localStateObject","useOrganismContext","stateConfig","useStateContext","stateObject","dataModelFieldValue","_b","value","undefined","useEffect","setValue","rules","useMemo","validate","_r","useState","setInternalValue","normalizedOptions","map","item","id","displayValue_1","formValue","watch","matchedOption","find","o","visibleText","_jsxs","__assign","style","display","flexDirection","children","_jsx","FormHelperText","sx","Typography","border","concat","borderRadius","minWidth","inputSx","alignItems","justifyContent","React","boxSizing","labelSx","formControlSx","menuProps","disablePortal","
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../../../src/molecules/Select/Select.tsx"],"sourcesContent":[null],"names":["SelectMolecule","_a","open","text","options","placeholderText","_c","required","_d","requiredErrorText","_e","validationErrorText","_f","isDisplayOnly","fontSize","fontFamily","fontWeight","textColor","textAlign","borderColor","color","backgroundColor","_g","marginLeft","_h","marginTop","_j","marginRight","_k","marginBottom","_l","paddingLeft","_m","paddingTop","_o","paddingRight","_p","paddingBottom","_q","configurationItemInfo","name","sourceDataModelField","props","__rest","formContext","useFormContext","control","isInFormContext","errors","formState","localStateObject","useOrganismContext","stateConfig","useStateContext","stateObject","dataModelFieldValue","_b","value","undefined","useEffect","setValue","rules","useMemo","validate","_r","useState","setInternalValue","normalizedOptions","map","item","id","displayValue_1","formValue","watch","matchedOption","find","o","visibleText","_jsxs","__assign","style","display","flexDirection","children","_jsx","FormHelperText","sx","Typography","border","concat","borderRadius","minWidth","inputSx","alignItems","justifyContent","React","boxSizing","labelSx","formControlSx","menuProps","disablePortal","PopoverProps","container","document","body","position","PaperProps","zIndex","theme","modal","anchorOrigin","vertical","horizontal","transformOrigin","renderSelect","field","MuiSelect","labelId","label","MenuProps","renderValue","selectedValue","selectedOption","onChange","event","target","MenuItem","disabled","option","index","fieldError","FormControl","variant","error","InputLabel","Controller","defaultValue","render","fieldState","_Fragment","type"],"mappings":"qtCA4EO,IAAMA,EAAgD,SAACC,SAC5DC,EAAID,EAAAC,KACJC,EAAIF,EAAAE,KACJC,EAAOH,EAAAG,QACPC,EAAeJ,EAAAI,gBACfC,aAAAC,OAAW,IAAAD,GAAKA,EAChBE,EAA4CP,EAAAQ,kBAA5CA,OAAoB,IAAAD,EAAA,yBAAwBA,EAC5CE,EAAsCT,EAAAU,oBAAtCA,OAAmB,IAAAD,EAAG,iBAAgBA,EACtCE,EAAqBX,EAAAY,cAArBA,OAAa,IAAAD,GAAQA,EAErBE,EAAQb,EAAAa,SACRC,EAAUd,EAAAc,WACVC,eACAC,EAAShB,EAAAgB,UACTC,EAASjB,EAAAiB,UACTC,gBACAC,EAAKnB,EAAAmB,MACLC,EAAepB,EAAAoB,gBACfC,EAAArB,EAAAsB,WAAAA,OAAU,IAAAD,EAAG,IAAGA,EAChBE,EAAAvB,EAAAwB,UAAAA,OAAY,IAAAD,EAAA,IAAGA,EACfE,EAAiBzB,EAAA0B,YAAjBA,OAAW,IAAAD,EAAG,IAAGA,EACjBE,EAAkB3B,EAAA4B,aAAlBA,OAAY,IAAAD,EAAG,IAAGA,EAClBE,EAAiB7B,EAAA8B,YAAjBA,OAAW,IAAAD,EAAG,IAAGA,EACjBE,EAAA/B,EAAAgC,WAAAA,OAAU,IAAAD,EAAG,IAAGA,EAChBE,EAAAjC,EAAAkC,aAAAA,QAAe,IAAAD,EAAA,IAAGA,EAClBE,GAAmBnC,EAAAoC,cAAnBA,QAAa,IAAAD,GAAG,IAAGA,GAEnBE,GAA0BrC,EAAAsC,sB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