@gem-sdk/components 2.0.0-dev.865 → 2.0.0-dev.866
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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),react=require("react");const ProductPropertyInput=({setting:e,styles:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),core=require("@gem-sdk/core"),react=require("react");const ProductPropertyInput=({setting:e,styles:r})=>{let t=core.useUniqProductID(),{name:o,type:a,valueHidden:l,placeholder:c,required:s,minChar:d,maxChar:n,handleChange:i,validationData:u,label:p}=e??{},{valueBgColor:h,valueTextColor:m,valueTypography:y,valueTypo:x,fullWidth:g,width:C,height:S,borderInput:v,borderRadius:b,hasShadowInput:P,shadowInput:j}=r??{},k=react.useMemo(()=>{switch(a){case"textarea":case"hidden":return"textarea";default:return"input"}},[a]),q=react.useMemo(()=>"hidden"===a,[a]),R=core.makeStyleResponsive("w",core.makeWidth(C,g)),f=core.composeTypographyClassName(x,y),w=core.composeTypographyStyle(x,y),G=`${c}${c&&s&&!p?" *":""}`;return jsxRuntime.jsx(k,{id:`${t}-${o}`,type:"hidden"===a?"textarea":a,value:"hidden"===a?l:void 0,placeholder:G,name:o,readOnly:q,className:core.cls("gemx-border-focus gp-px-4 gp-py-2 gp-outline-none",core.getGlobalColorStateClass("text",m),core.getGlobalColorStateClass("bg",h),f,core.handleConvertClassColor(v)),style:{...R,...core.handleConvertBorderStyle(v),...core.handleConvertBorderWidth(v),...core.handleConvertBorderColor(v),...core.getGlobalColorStateStyle("bg",h),...core.getGlobalColorStateStyle("c",m),...core.getStyleShadowState(j,"box-shadow",P),...core.makeStyleResponsive("h",S),...core.composeRadius(b),...w,...u?.isValid||"hidden"===a?{}:core.makeStyle({bc:"#F44336"})},required:s,minLength:["text","textarea"].includes(a)?d:void 0,maxLength:["text","textarea"].includes(a)?n:void 0,onChange:i})};exports.default=ProductPropertyInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useUniqProductID as t,makeStyleResponsive as r,makeWidth as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useUniqProductID as t,makeStyleResponsive as r,makeWidth as a,composeTypographyClassName as d,composeTypographyStyle as n,cls as o,getGlobalColorStateClass as i,handleConvertClassColor as u,handleConvertBorderStyle as p,handleConvertBorderWidth as c,handleConvertBorderColor as l,getGlobalColorStateStyle as s,getStyleShadowState as x,composeRadius as m,makeStyle as h}from"@gem-sdk/core";import{useMemo as g}from"react";let ProductPropertyInput=({setting:f,styles:y})=>{let b=t(),{name:v,type:P,valueHidden:$,placeholder:w,required:I,minChar:L,maxChar:j,handleChange:k,validationData:q,label:C}=f??{},{valueBgColor:F,valueTextColor:N,valueTypography:O,valueTypo:V,fullWidth:z,width:A,height:B,borderInput:D,borderRadius:E,hasShadowInput:G,shadowInput:H}=y??{},J=g(()=>{switch(P){case"textarea":case"hidden":return"textarea";default:return"input"}},[P]),K=g(()=>"hidden"===P,[P]),M=r("w",a(A,z)),Q=d(V,O),R=n(V,O),S=`${w}${w&&I&&!C?" *":""}`;return e(J,{id:`${b}-${v}`,type:"hidden"===P?"textarea":P,value:"hidden"===P?$:void 0,placeholder:S,name:v,readOnly:K,className:o("gemx-border-focus gp-px-4 gp-py-2 gp-outline-none",i("text",N),i("bg",F),Q,u(D)),style:{...M,...p(D),...c(D),...l(D),...s("bg",F),...s("c",N),...x(H,"box-shadow",G),...r("h",B),...m(E),...R,...q?.isValid||"hidden"===P?{}:h({bc:"#F44336"})},required:I,minLength:["text","textarea"].includes(P)?L:void 0,maxLength:["text","textarea"].includes(P)?j:void 0,onChange:k})};export{ProductPropertyInput as default};
|