@zealicsolutions/web-ui 1.0.34-beta-1 → 1.0.34-beta-2
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{__assign as e,__rest as o}from"../../node_modules/tslib/tslib.es6.js";import{jsxs as t,jsx as i}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import{useEffect as r,useState as n}from"react";import{useFormContext as l,Controller as a}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 d}from"../../contexts/hooks/useOrganismContext.js";import{useStateContext as u}from"../../contexts/hooks/useStateContext.js";import"../../contexts/AccountButtonContext/AccountButtonContext.js";import
|
1
|
+
import{__assign as e,__rest as o}from"../../node_modules/tslib/tslib.es6.js";import{jsxs as t,jsx as i}from"../../node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js";import{useEffect as r,useState as n}from"react";import{useFormContext as l,Controller as a}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 d}from"../../contexts/hooks/useOrganismContext.js";import{useStateContext as u}from"../../contexts/hooks/useStateContext.js";import"../../contexts/AccountButtonContext/AccountButtonContext.js";import s from"../../node_modules/@mui/material/FormHelperText/FormHelperText.js";import m from"../../node_modules/@mui/material/Typography/Typography.js";import p from"../../node_modules/@mui/material/FormControl/FormControl.js";import c from"../../node_modules/@mui/material/TextField/TextField.js";var g=function(t){var r=t.errorMsg,n=t.stepValue,l=t.minValue,a=t.allowNegative,d=t.inputSx,u=t.labelSx,s=o(t,["errorMsg","stepValue","minValue","allowNegative","inputSx","labelSx"]);return i(c,e({},s,{variant:"outlined",type:"number",error:!!r,helperText:r||null,inputProps:{step:n,min:a?void 0:l},slotProps:{input:{sx:e(e({},d),{width:"auto"})},inputLabel:{sx:u}}}))},v=function(o){var c,v=o.isDisplayOnly,f=void 0!==v&&v,x=o.required,h=void 0!==x&&x,C=o.requiredErrorText,b=void 0===C?"This field is required":C,M=o.validationErrorText,F=void 0===M?"Invalid numeric value":M,T=o.text,j=o.placeholderText,S=o.backgroundColor,O=o.borderColor,y=o.textColor,V=void 0===y?"#000":y,w=o.fontSize,B=o.fontFamily,I=o.fontWeight,R=o.allowNegative,N=void 0!==R&&R,_=o.numericPrecision,k=void 0===_?"1":_,D=o.name,L=o.sourceDataModelField,q=o.marginLeft,z=void 0===q?"0":q,W=o.marginTop,A=void 0===W?"0":W,P=o.marginRight,E=void 0===P?"0":P,H=o.marginBottom,$=void 0===H?"0":H,G=o.paddingLeft,J=void 0===G?"0":G,K=o.paddingTop,Q=void 0===K?"0":K,U=o.paddingRight,X=void 0===U?"0":U,Y=o.paddingBottom,Z=void 0===Y?"0":Y,ee=o.configurationItemInfo,oe=l(),te=null==oe?void 0:oe.control,ie=!(!te||!D),re=d().localStateObject,ne=u().stateConfig,le=re||ne;console.log({sourceDataModelField:L,localStateObject:re,stateConfig:ne,DMF:null==le?void 0:le[L]});var ae=L?null===(c=null==le?void 0:le[L])||void 0===c?void 0:c.value:void 0;r((function(){void 0!==ae&&ie&&oe.setValue(D,ae)}),[ae]);var de=n(""),ue=de[0],se=de[1],me=parseFloat(k),pe=N?void 0:0,ce={required:!!h&&b,pattern:{value:N?/^-?\d*(\.\d+)?$/:/^\d*(\.\d+)?$/,message:F}};if(N||(ce.min={value:0,message:"Value cannot be less than zero"}),f){var ge="",ve=(ge=ie?oe.watch(D)||"":ae)?function(e,o,t){if(!e)return"";var i=parseFloat(e);if(isNaN(i))return e;if(!t&&i<0)return"0";if(o){var r=(o.split(".")[1]||"").length;if(r>0)return i.toFixed(r)}return e}(ge,k,N):j||"-";return console.log({displayText:ve,dataModelFieldValue:ae,rawVal:ge,isDisplayOnly:f}),t("div",e({style:{display:"inline-flex",flexDirection:"column",marginLeft:z,marginTop:A,marginRight:E,marginBottom:$}},ee,{children:[T&&i(s,e({sx:{fontSize:w,fontFamily:B,fontWeight:I,color:V,marginBottom:"4px"}},{children:T})),i(m,e({sx:{fontSize:w,fontFamily:B,fontWeight:I,color:V,paddingLeft:J,paddingTop:Q,paddingRight:X,paddingBottom:Z,backgroundColor:S,border:"1px solid ".concat(O||"#ccc"),borderRadius:"4px",minWidth:"60px"}},{children:ve}))]}))}var fe={backgroundColor:S,color:V,fontSize:w,fontFamily:B,fontWeight:I,"& .MuiOutlinedInput-notchedOutline":{borderColor:O||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:O||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:O||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:O||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:O||"inherit"}},xe={color:V,"&.Mui-focused":{color:V}};return i(p,e({required:h,sx:{marginLeft:z,marginTop:A,marginRight:E,marginBottom:$,width:"fit-content"}},ee,ie?{children:i(a,{name:D,rules:ce,control:te,defaultValue:"",render:function(e){var o,t=e.field,r=e.fieldState;return i(g,{errorMsg:null===(o=r.error)||void 0===o?void 0:o.message,label:T,placeholder:j,stepValue:me,minValue:pe,allowNegative:N,inputSx:fe,labelSx:xe,value:t.value||"",onChange:function(e){return t.onChange(e.target.value)}})}})}:{children:i(g,{errorMsg:void 0,label:T,placeholder:j,stepValue:me,minValue:pe,allowNegative:N,inputSx:fe,labelSx:xe,value:ue,onChange:function(e){return se(e.target.value)}})}))};export{v as NumericInputField};
|
2
2
|
//# sourceMappingURL=NumericInputField.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NumericInputField.js","sources":["../../../../../src/molecules/NumericInputField/NumericInputField.tsx"],"sourcesContent":[null],"names":["NumericTextField","_a","errorMsg","stepValue","minValue","allowNegative","inputSx","labelSx","props","__rest","_jsx","MuiTextField","__assign","variant","type","error","helperText","inputProps","step","min","undefined","slotProps","input","sx","width","inputLabel","NumericInputField","_c","isDisplayOnly","_d","required","_e","requiredErrorText","_f","validationErrorText","text","placeholderText","backgroundColor","borderColor","_g","textColor","fontSize","fontFamily","fontWeight","_h","_j","numericPrecision","name","sourceDataModelField","_k","marginLeft","_l","marginTop","_m","marginRight","_o","marginBottom","_p","paddingLeft","_q","paddingTop","_r","paddingRight","_s","paddingBottom","configurationItemInfo","methods","useFormContext","control","isInFormContext","localStateObject","useOrganismContext","stateConfig","useStateContext","stateObject","dataModelFieldValue","_b","value","useEffect","setValue","_t","useState","localValue","setLocalValue","parseFloat","rules","pattern","message","rawVal","displayText","watch","rawValue","precision","num","isNaN","decimals","split","length","toFixed","formatNumericValue","
|
1
|
+
{"version":3,"file":"NumericInputField.js","sources":["../../../../../src/molecules/NumericInputField/NumericInputField.tsx"],"sourcesContent":[null],"names":["NumericTextField","_a","errorMsg","stepValue","minValue","allowNegative","inputSx","labelSx","props","__rest","_jsx","MuiTextField","__assign","variant","type","error","helperText","inputProps","step","min","undefined","slotProps","input","sx","width","inputLabel","NumericInputField","_c","isDisplayOnly","_d","required","_e","requiredErrorText","_f","validationErrorText","text","placeholderText","backgroundColor","borderColor","_g","textColor","fontSize","fontFamily","fontWeight","_h","_j","numericPrecision","name","sourceDataModelField","_k","marginLeft","_l","marginTop","_m","marginRight","_o","marginBottom","_p","paddingLeft","_q","paddingTop","_r","paddingRight","_s","paddingBottom","configurationItemInfo","methods","useFormContext","control","isInFormContext","localStateObject","useOrganismContext","stateConfig","useStateContext","stateObject","console","log","DMF","dataModelFieldValue","_b","value","useEffect","setValue","_t","useState","localValue","setLocalValue","parseFloat","rules","pattern","message","rawVal","displayText","watch","rawValue","precision","num","isNaN","decimals","split","length","toFixed","formatNumericValue","_jsxs","style","display","flexDirection","FormHelperText","color","children","Typography","border","concat","borderRadius","minWidth","FormControl","Controller","defaultValue","render","field","fieldState","label","placeholder","onChange","evt","target"],"mappings":"+iCAoDA,IAAMA,EAAoD,SAACC,GACzD,IAAAC,aACAC,cACAC,aACAC,kBACAC,YACAC,YACGC,EAPsDC,EAAAR,EAAA,CAAA,WAAA,YAAA,WAAA,gBAAA,UAAA,YASzD,OACES,EAACC,EACKC,EAAA,CAAA,EAAAJ,EACJ,CAAAK,QAAQ,WACRC,KAAK,SACLC,QAASb,EACTc,WAAYd,GAAY,KACxBe,WAAY,CACVC,KAAMf,EACNgB,IAAKd,OAAgBe,EAAYhB,GAEnCiB,UAAW,CACTC,MAAO,CACLC,UAASjB,GAAO,CAAEkB,MAAO,UAE3BC,WAAY,CACVF,GAAIhB,MAKd,EAgDamB,EAAsD,SAACzB,SAClE0B,EAAA1B,EAAA2B,cAAAA,OAAgB,IAAAD,GAAKA,EACrBE,EAAgB5B,EAAA6B,SAAhBA,OAAQ,IAAAD,GAAQA,EAChBE,EAA4C9B,EAAA+B,kBAA5CA,OAAiB,IAAAD,EAAG,yBAAwBA,EAC5CE,EAAAhC,EAAAiC,oBAAAA,OAAsB,IAAAD,EAAA,wBAAuBA,EAE7CE,EAAIlC,EAAAkC,KACJC,EAAenC,EAAAmC,gBACfC,EAAepC,EAAAoC,gBACfC,EAAWrC,EAAAqC,YACXC,EAAAtC,EAAAuC,UAAAA,OAAY,IAAAD,EAAA,OAAMA,EAClBE,EAAQxC,EAAAwC,SACRC,EAAUzC,EAAAyC,WACVC,EAAU1C,EAAA0C,WACVC,EAAqB3C,EAAAI,cAArBA,OAAa,IAAAuC,GAAQA,EACrBC,EAAA5C,EAAA6C,iBAAAA,OAAgB,IAAAD,EAAG,IAAGA,EACtBE,EAAI9C,EAAA8C,KACJC,EAAoB/C,EAAA+C,qBAEpBC,EAAAhD,EAAAiD,WAAAA,OAAa,IA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