@@ -49,6 +49,7 @@ export const InputShape = forwardRef<any, ShapeProps>((props, ref) => {
4949 borderRadius,
5050 disabled,
5151 isPlaceholder,
52+ isPassword,
5253 } = useShapeProps ( otherProps , INPUT_SHAPE ) ;
5354
5455 const commonGroupProps = useGroupShapeProps (
@@ -58,6 +59,13 @@ export const InputShape = forwardRef<any, ShapeProps>((props, ref) => {
5859 ref
5960 ) ;
6061
62+ const maskPassword = ( text : string ) => {
63+ const maskSymbol = '●' ;
64+ return maskSymbol . repeat ( text . length ) ;
65+ } ;
66+
67+ const finalText = isPassword && ! isPlaceholder ? maskPassword ( text ) : text ;
68+
6169 return (
6270 < Group { ...commonGroupProps } { ...shapeProps } >
6371 < Rect
@@ -75,7 +83,7 @@ export const InputShape = forwardRef<any, ShapeProps>((props, ref) => {
7583 x = { INPUT_SHAPE . DEFAULT_PADDING }
7684 y = { INPUT_SHAPE . DEFAULT_PADDING + 1 }
7785 width = { width - INPUT_SHAPE . DEFAULT_PADDING * 2 }
78- text = { text }
86+ text = { finalText }
7987 fontFamily = { INPUT_SHAPE . DEFAULT_FONT_FAMILY }
8088 fontSize = { INPUT_SHAPE . DEFAULT_FONT_SIZE }
8189 lineHeight = { INPUT_SHAPE . DEFAULT_LINE_HEIGHT }
@@ -93,33 +101,3 @@ export const InputShape = forwardRef<any, ShapeProps>((props, ref) => {
93101 </ Group >
94102 ) ;
95103} ) ;
96-
97- /*
98- <Group {...commonGroupProps} {...shapeProps}>
99- <Rect
100- x={0}
101- y={0}
102- width={restrictedWidth}
103- height={restrictedHeight}
104- cornerRadius={borderRadius}
105- stroke={stroke}
106- dash={strokeStyle}
107- strokeWidth={INPUT_SHAPE.DEFAULT_STROKE_WIDTH}
108- fill={fill}
109- />
110- <Text
111- x={INPUT_SHAPE.DEFAULT_PADDING}
112- y={INPUT_SHAPE.DEFAULT_PADDING + 1}
113- width={width - INPUT_SHAPE.DEFAULT_PADDING * 2}
114- text={text}
115- fontFamily={INPUT_SHAPE.DEFAULT_FONT_FAMILY}
116- fontSize={INPUT_SHAPE.DEFAULT_FONT_SIZE}
117- lineHeight={INPUT_SHAPE.DEFAULT_LINE_HEIGHT}
118- fill={textColor}
119- align="left"
120- ellipsis={true}
121- wrap="none"
122- />
123- </Group>
124-
125- */
0 commit comments