@@ -97,7 +97,7 @@ const Input = (props: TaipyInputProps) => {
9797 maxWidth : getCssSize ( props . width ) ,
9898 }
9999 : numberSx ,
100- [ props . width ] ,
100+ [ props . width ]
101101 ) ;
102102
103103 // 0 if value is not a number, 1 means general number, 2 means integer
@@ -128,7 +128,7 @@ const Input = (props: TaipyInputProps) => {
128128 dispatch ( createSendUpdateAction ( updateVarName , value , module , onChange , propagate ) ) ;
129129 } , changeDelay ) ;
130130 } ,
131- [ changeDelay , numberType , dispatch , updateVarName , module , onChange , propagate ] ,
131+ [ changeDelay , numberType , dispatch , updateVarName , module , onChange , propagate ]
132132 ) ;
133133
134134 const handleInput = useCallback (
@@ -144,13 +144,7 @@ const Input = (props: TaipyInputProps) => {
144144 if ( changeDelay === 0 ) {
145145 Promise . resolve ( ) . then ( ( ) => {
146146 dispatch (
147- createSendUpdateAction (
148- updateVarName ,
149- valToNumber ( val , numberType ) ,
150- module ,
151- onChange ,
152- propagate ,
153- ) ,
147+ createSendUpdateAction ( updateVarName , valToNumber ( val , numberType ) , module , onChange , propagate )
154148 ) ;
155149 } ) ;
156150 }
@@ -160,11 +154,11 @@ const Input = (props: TaipyInputProps) => {
160154 delayCall . current = window . setTimeout ( ( ) => {
161155 delayCall . current = - 1 ;
162156 dispatch (
163- createSendUpdateAction ( updateVarName , valToNumber ( val , numberType ) , module , onChange , propagate ) ,
157+ createSendUpdateAction ( updateVarName , valToNumber ( val , numberType ) , module , onChange , propagate )
164158 ) ;
165159 } , changeDelay ) ;
166160 } ,
167- [ changeDelay , numberType , dispatch , updateVarName , module , onChange , propagate ] ,
161+ [ changeDelay , numberType , dispatch , updateVarName , module , onChange , propagate ]
168162 ) ;
169163
170164 const handleBlur = useCallback (
@@ -195,7 +189,7 @@ const Input = (props: TaipyInputProps) => {
195189 } ) ;
196190 evt . preventDefault ( ) ;
197191 } ,
198- [ dispatch , numberType , min , max , updateVarName , module , onChange , propagate , changeDelay , id , onAction ] ,
192+ [ dispatch , numberType , min , max , updateVarName , module , onChange , propagate , changeDelay , id , onAction ]
199193 ) ;
200194
201195 const handleAction = useCallback (
@@ -226,10 +220,10 @@ const Input = (props: TaipyInputProps) => {
226220 const val = multiline
227221 ? evt . currentTarget . querySelector ( "textarea" ) ?. value
228222 : numberType
229- ? numberType === IsInteger
230- ? Math . round ( Number ( evt . currentTarget . querySelector ( "input" ) ?. value ) )
231- : Number ( evt . currentTarget . querySelector ( "input" ) ?. value )
232- : evt . currentTarget . querySelector ( "input" ) ?. value ;
223+ ? numberType === IsInteger
224+ ? Math . round ( Number ( evt . currentTarget . querySelector ( "input" ) ?. value ) )
225+ : Number ( evt . currentTarget . querySelector ( "input" ) ?. value )
226+ : evt . currentTarget . querySelector ( "input" ) ?. value ;
233227
234228 if ( changeDelay > 0 && delayCall . current > 0 ) {
235229 clearTimeout ( delayCall . current ) ;
@@ -259,7 +253,7 @@ const Input = (props: TaipyInputProps) => {
259253 changeDelay ,
260254 onChange ,
261255 propagate ,
262- ] ,
256+ ]
263257 ) ;
264258
265259 const roundBasedOnStep = useMemo ( ( ) => {
@@ -285,7 +279,7 @@ const Input = (props: TaipyInputProps) => {
285279 step || 1 ,
286280 stepMultiplier || 10 ,
287281 event . shiftKey ,
288- increment ,
282+ increment
289283 ) ;
290284
291285 if ( min !== undefined && Number ( newValue ) < min ) {
@@ -302,29 +296,29 @@ const Input = (props: TaipyInputProps) => {
302296 return newValue ;
303297 } ) ;
304298 } ,
305- [ calculateNewValue , step , stepMultiplier , min , max , updateValueWithDelay ] ,
299+ [ calculateNewValue , step , stepMultiplier , min , max , updateValueWithDelay ]
306300 ) ;
307301
308302 const handleUpStepperMouseDown = useCallback (
309303 ( event : React . MouseEvent < HTMLButtonElement > ) => {
310304 handleStepperMouseDown ( event , true ) ;
311305 } ,
312- [ handleStepperMouseDown ] ,
306+ [ handleStepperMouseDown ]
313307 ) ;
314308
315309 const handleDownStepperMouseDown = useCallback (
316310 ( event : React . MouseEvent < HTMLButtonElement > ) => {
317311 handleStepperMouseDown ( event , false ) ;
318312 } ,
319- [ handleStepperMouseDown ] ,
313+ [ handleStepperMouseDown ]
320314 ) ;
321315
322316 // password
323317 const [ showPassword , setShowPassword ] = useState ( false ) ;
324318 const handleClickShowPassword = useCallback ( ( ) => setShowPassword ( ( show ) => ! show ) , [ ] ) ;
325319 const handleMouseDownPassword = useCallback (
326320 ( event : React . MouseEvent < HTMLButtonElement > ) => event . preventDefault ( ) ,
327- [ ] ,
321+ [ ]
328322 ) ;
329323 const inputProps = useMemo (
330324 ( ) =>
@@ -361,22 +355,22 @@ const Input = (props: TaipyInputProps) => {
361355 } ,
362356 }
363357 : type == "password"
364- ? {
365- htmlInput : { autoComplete : "current-password" } ,
366- input : {
367- endAdornment : (
368- < IconButton
369- aria-label = "Toggle password visibility"
370- onClick = { handleClickShowPassword }
371- onMouseDown = { handleMouseDownPassword }
372- edge = "end"
373- >
374- { showPassword ? < VisibilityOff /> : < Visibility /> }
375- </ IconButton >
376- ) ,
377- } ,
378- }
379- : undefined ,
358+ ? {
359+ htmlInput : { autoComplete : "current-password" } ,
360+ input : {
361+ endAdornment : (
362+ < IconButton
363+ aria-label = "Toggle password visibility"
364+ onClick = { handleClickShowPassword }
365+ onMouseDown = { handleMouseDownPassword }
366+ edge = "end"
367+ >
368+ { showPassword ? < VisibilityOff /> : < Visibility /> }
369+ </ IconButton >
370+ ) ,
371+ } ,
372+ }
373+ : undefined ,
380374 [
381375 active ,
382376 type ,
@@ -388,7 +382,7 @@ const Input = (props: TaipyInputProps) => {
388382 handleMouseDownPassword ,
389383 handleUpStepperMouseDown ,
390384 handleDownStepperMouseDown ,
391- ] ,
385+ ]
392386 ) ;
393387
394388 useEffect ( ( ) => {
@@ -398,8 +392,8 @@ const Input = (props: TaipyInputProps) => {
398392 } , [ props . value ] ) ;
399393
400394 return (
401- < >
402- < Tooltip title = { hover || "" } >
395+ < Tooltip title = { hover || "" } >
396+ < >
403397 < TextField
404398 sx = { textSx }
405399 margin = "dense"
@@ -419,9 +413,9 @@ const Input = (props: TaipyInputProps) => {
419413 maxRows = { linesShown }
420414 size = { size }
421415 />
422- </ Tooltip >
423- { props . children }
424- </ >
416+ { props . children }
417+ </ >
418+ </ Tooltip >
425419 ) ;
426420} ;
427421export default Input ;
0 commit comments