@@ -22,8 +22,17 @@ export const getInputStepperShapeSizeRestrictions = (): ShapeSizeRestrictions =>
2222const shapeType : ShapeType = 'inputStepper' ;
2323
2424export const InputStepperShape = forwardRef < any , ShapeProps > ( ( props , ref ) => {
25- const { x, y, width, height, id, onSelected, otherProps, ...shapeProps } =
26- props ;
25+ const {
26+ x,
27+ y,
28+ width,
29+ height,
30+ id,
31+ text,
32+ onSelected,
33+ otherProps,
34+ ...shapeProps
35+ } = props ;
2736
2837 const restrictedSize = fitSizeToShapeSizeRestrictions (
2938 InputStepperShapeSizeRestrictions ,
@@ -33,7 +42,7 @@ export const InputStepperShape = forwardRef<any, ShapeProps>((props, ref) => {
3342
3443 const { width : restrictedWidth , height : restrictedHeight } = restrictedSize ;
3544
36- const handleButtonWidth = ( restrictedWidth : number ) : number => {
45+ const getButtonWidth = ( restrictedWidth : number ) : number => {
3746 const buttonWidth = restrictedWidth * 0.3 ;
3847 const minButtonWidth = 30 ;
3948 const maxButtonWidth = 70 ;
@@ -43,7 +52,7 @@ export const InputStepperShape = forwardRef<any, ShapeProps>((props, ref) => {
4352 return buttonWidth ;
4453 } ;
4554
46- const buttonWidth = handleButtonWidth ( restrictedWidth ) ;
55+ const buttonWidth = getButtonWidth ( restrictedWidth ) ;
4756 const buttonHeight = restrictedHeight / 2 ;
4857
4958 const commonGroupProps = useGroupShapeProps (
@@ -60,7 +69,6 @@ export const InputStepperShape = forwardRef<any, ShapeProps>((props, ref) => {
6069
6170 return (
6271 < Group { ...commonGroupProps } { ...shapeProps } >
63- { /* Caja del input */ }
6472 < Rect
6573 x = { 0 }
6674 y = { 0 }
@@ -77,7 +85,7 @@ export const InputStepperShape = forwardRef<any, ShapeProps>((props, ref) => {
7785 width = { restrictedWidth - buttonWidth - 8 }
7886 x = { 0 } // Alinear a la derecha dependiendo de la cantidad de dígitos
7987 y = { restrictedHeight / 2 - 6 } // Centrar verticalmente
80- text = { '0' }
88+ text = { text }
8189 fontFamily = { INPUT_SHAPE . DEFAULT_FONT_FAMILY }
8290 fontSize = { INPUT_SHAPE . DEFAULT_FONT_SIZE + 2 }
8391 fill = { textColor }
0 commit comments