| 1 |
import{a as j,g as $,i as b,aH as M,u as N,k as w,z as v,j as t,_ as h,f as A,bG as C}from"./main-294.js";import{F as a}from"./bf-821-385.js";import{E as y}from"./bf-28-232.js";import{S as T}from"./bf-908-241.js";import"./bf-645-110.js";import"./bf-487-72.js";import"./bf-176-80.js";import"./bf-867-113.js";import"./bf-986-242.js";import"./bf-764-245.js";import"./bf-250-243.js";import"./bf-22-244.js";import"./bf-934-246.js";import"./bf-188-247.js";import"./bf-85-248.js";import"./bf-930-249.js";import"./bf-5-86.js";import"./bf-112-250.js";import"./bf-399-251.js";import"./bf-379-106.js";import"./bf-508-252.js";import"./bf-128-253.js";import"./bf-446-382.js";import"./bf-384-383.js";import"./bf-663-270.js";import"./bf-957-268.js";import"./bf-889-272.js";import"./bf-766-384.js";import"./bf-383-274.js";import"./bf-108-386.js";import"./bf-297-387.js";function re(){const{css:n}=j(),{fieldKey:s}=$(),[p,V]=b(M),r=N(w);if(!s)return null;const i=v(p[s]),e=(r==null?void 0:r.err)||{},{minValue:u,maxValue:l}=i.config,d=(m,o)=>{var f,c;i.config[o]=m,o==="minValue"?i.err.minValue.dflt=((f=e==null?void 0:e[i.typ])==null?void 0:f.minValue)||(e==null?void 0:e.minValue)||`Invalid amount. The minimum amount allowed is ${m}.`:o==="maxValue"&&(i.err.maxValue.dflt=((c=e==null?void 0:e[i.typ])==null?void 0:c.maxValue)||(e==null?void 0:e.maxValue)||`Invalid amount. The maximum amount allowed is ${m}.`);const x=A(p,g=>{g[s]=i});V(x),C({event:`${S[o]} '${m}': ${i.lbl||s}`,type:`${o}_changed`,state:{fields:x,fldKey:s}})};return t.jsx(T,{id:"nmbr-stng",title:"Input Amount Range(Min/Max):",className:n(a.fieldSection),isPro:!0,proProperty:"minMaxValue",children:t.jsxs("div",{className:n({mx:5}),children:[t.jsxs("div",{className:n(a.fieldNumber,{py:"0px !important"}),children:[t.jsx("span",{children:h("Minimum amount:")}),t.jsx("input",{"data-testid":"nmbr-stng-min-inp",title:"Minimum amount for this field","aria-label":"Minimum amount for this field",placeholder:"Type minimum amount here...",className:n(a.input,a.w140),type:"number",value:u||"",onChange:m=>d(m.target.value,"minValue")})]}),u&&t.jsx(y,{id:"nmbr-stng-min",type:"minValue",title:"Minimum amount Error Message",tipTitle:`By enabling this feature, user will see the error message when input amount is less than ${u}`}),t.jsxs("div",{className:n(a.fieldNumber,{py:"0px !important"}),children:[t.jsx("span",{children:h("Maximum amount:")}),t.jsx("input",{"data-testid":"nmbr-stng-max-inp",title:"Maximum amount for this field","aria-label":"Maximum amount for this field",placeholder:"Type maximum amount here...",className:n(a.input,a.w140),type:"number",value:l||"",onChange:m=>d(m.target.value,"maxValue")})]}),l&&t.jsx(y,{id:"nmbr-stng-max",type:"maxValue",title:"Max Error Message",tipTitle:`By enabling this feature, user will see the error message when input amount is greater than ${l}`})]})})}const S={minValue:"Minimum Amount Changed to",maxValue:"Maximum Amount Changed to"};export{re as default}; |