Skip to content

Commit 3358d11

Browse files
committed
work in progress
1 parent 6456c57 commit 3358d11

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

src/common/components/mock-components/front-rich-components/input-stepper.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { INPUT_SHAPE } from '../front-components/shape.const';
1111
// Size restrictions (igual patrón que file-tree)
1212
export const inputStepperShapeRestrictions: ShapeSizeRestrictions = {
1313
minWidth: 80,
14-
minHeight: 24,
14+
minHeight: 32,
1515
maxWidth: -1,
1616
maxHeight: -1,
1717
defaultWidth: 120,
@@ -49,6 +49,18 @@ export const InputWithStepper = forwardRef<any, ShapeProps>((props, ref) => {
4949

5050
const { width: restrictedWidth } = restrictedSize;
5151

52+
const getInputWidth = (restrictedWidth: number): number => {
53+
const inputWidth = restrictedWidth * 0.3;
54+
const minInputWidth = 30;
55+
const maxInputWidth = 70;
56+
57+
if (inputWidth < minInputWidth) return minInputWidth;
58+
if (inputWidth > maxInputWidth) return maxInputWidth;
59+
return inputWidth;
60+
};
61+
62+
const a = getInputWidth(restrictedWidth);
63+
5264
return (
5365
<Group {...commonGroupProps} {...shapeProps}>
5466
{/* Caja del input */}
@@ -68,12 +80,12 @@ export const InputWithStepper = forwardRef<any, ShapeProps>((props, ref) => {
6880
<Text
6981
x={0} // Alinear a la derecha
7082
y={height / 2 - 8} // Centrar verticalmente
71-
width={restrictedWidth}
83+
width={restrictedWidth - a - 8}
7284
text={text}
7385
fontFamily="Arial"
7486
fontSize={16}
7587
fill={textColor}
76-
align="center"
88+
align="right"
7789
wrap="none"
7890
/>
7991

0 commit comments

Comments
 (0)