jb-number-input
Version:
number input web component
2 lines • 1.45 kB
JavaScript
import e,{forwardRef as r,useEffect as t,useImperativeHandle as n,useRef as o,useState as a}from"react";import"jb-number-input";import{useJBInputAttribute as u,useJBInputEvents as c}from"jb-input/react";let s=r((r,s)=>{let i=o(null),[p,m]=a(0);return n(s,()=>i?i.current:void 0,[i]),t(()=>{m(p+1)},[i.current]),u(i,r),c(i,r),t(()=>{i?.current&&(i.current.minValue=r.minValue)},[r.minValue]),t(()=>{i.current&&(i.current.maxValue=r.maxValue)},[r.maxValue]),t(()=>{i.current&&void 0!==r.acceptNegative&&(i.current.acceptNegative=r.acceptNegative)},[r.acceptNegative]),t(()=>{i.current&&(i.current.decimalPrecision=r.decimalPrecision)},[r.decimalPrecision]),t(()=>{i.current&&"boolean"==typeof r.showControlButton&&(i.current.showControlButton=r.showControlButton)},[r.showControlButton]),t(()=>{i.current&&"boolean"==typeof r.showThousandSeparator&&(i.current.showThousandSeparator=r.showThousandSeparator)},[r.showThousandSeparator]),t(()=>{i.current&&"string"==typeof r.thousandSeparator&&(i.current.thousandSeparator=r.thousandSeparator)},[r.thousandSeparator]),t(()=>{i.current&&"number"==typeof r.step&&(i.current.step=r.step)},[r.step]),t(()=>{i.current&&"boolean"==typeof r.showPersianNumber&&(i.current.showPersianNumber=r.showPersianNumber)},[r.showPersianNumber]),e.createElement("jb-number-input",{ref:i,class:r.className},r.children)});s.displayName="JBNumberInput";export{s as JBNumberInput};
//# sourceMappingURL=JBNumberInput.js.map