File tree Expand file tree Collapse file tree 7 files changed +12
-6
lines changed
src/common/components/mock-components
front-low-wireframes-components
paragraph-scribbled-shape Expand file tree Collapse file tree 7 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { useShapeProps } from '../../shapes/use-shape-props.hook';
88import { useGroupShapeProps } from '../mock-components.utils' ;
99
1010const inputShapeRestrictions : ShapeSizeRestrictions = {
11- minWidth : 38 ,
11+ minWidth : INPUT_SHAPE . DEFAULT_MIN_WIDTH ,
1212 minHeight : 38 ,
1313 maxWidth : - 1 ,
1414 maxHeight : 38 ,
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ const DEFAULT_TEXT_ALIGNMENT = 'left';
1919const DEFAULT_DISABLED = false ;
2020const DEFAULT_CORNER_RADIUS_CHIP = 1000 ;
2121const DEFAULT_FONT_SIZE_CHIP = 14 ;
22+ const DEFAULT_MIN_WIDTH = 10 ;
2223
2324export interface DefaultStyleShape {
2425 DEFAULT_CORNER_RADIUS : number ;
@@ -38,6 +39,7 @@ export interface DefaultStyleShape {
3839 DEFAULT_TEXT_DECORATION : string ;
3940 DEFAULT_TEXT_ALIGNMENT : 'left' | 'center' | 'right' ;
4041 DEFAULT_DISABLED : boolean ;
42+ DEFAULT_MIN_WIDTH : number ;
4143}
4244
4345export const BASIC_SHAPE : DefaultStyleShape = {
@@ -58,6 +60,7 @@ export const BASIC_SHAPE: DefaultStyleShape = {
5860 DEFAULT_TEXT_DECORATION ,
5961 DEFAULT_TEXT_ALIGNMENT ,
6062 DEFAULT_DISABLED ,
63+ DEFAULT_MIN_WIDTH ,
6164} ;
6265
6366export const LOW_WIREFRAME_SHAPE = {
@@ -82,6 +85,7 @@ export const INPUT_SHAPE: DefaultStyleShape = {
8285 DEFAULT_TEXT_DECORATION ,
8386 DEFAULT_TEXT_ALIGNMENT ,
8487 DEFAULT_DISABLED ,
88+ DEFAULT_MIN_WIDTH ,
8589} ;
8690
8791//! maybe a function to calc max height base on the text
@@ -103,6 +107,7 @@ export const POSTIT_SHAPE: DefaultStyleShape = {
103107 DEFAULT_TEXT_DECORATION ,
104108 DEFAULT_TEXT_ALIGNMENT ,
105109 DEFAULT_DISABLED ,
110+ DEFAULT_MIN_WIDTH ,
106111} ;
107112
108113interface FontValues {
@@ -160,4 +165,5 @@ export const CHIP_SHAPE: DefaultStyleShape = {
160165 DEFAULT_TEXT_DECORATION ,
161166 DEFAULT_TEXT_ALIGNMENT ,
162167 DEFAULT_DISABLED ,
168+ DEFAULT_MIN_WIDTH ,
163169} ;
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { useShapeProps } from '../../shapes/use-shape-props.hook';
88import { useGroupShapeProps } from '../mock-components.utils' ;
99
1010const textAreaShapeRestrictions : ShapeSizeRestrictions = {
11- minWidth : 70 ,
11+ minWidth : BASIC_SHAPE . DEFAULT_MIN_WIDTH ,
1212 minHeight : 44 ,
1313 maxWidth : - 1 ,
1414 maxHeight : - 1 ,
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import { MIN_LINE_HEIGHT } from './paragraph-scribbled.const';
1010import { calculateParagraphPaths } from './paragraph-scribbled.business' ;
1111
1212const paragraphScribbledShapeRestrictions : ShapeSizeRestrictions = {
13- minWidth : 100 ,
13+ minWidth : BASIC_SHAPE . DEFAULT_MIN_WIDTH ,
1414 minHeight : MIN_LINE_HEIGHT ,
1515 maxWidth : - 1 ,
1616 maxHeight : - 1 ,
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { calculatePath } from './text-scribbled.business';
99import { fitSizeToShapeSizeRestrictions } from '@/common/utils/shapes' ;
1010
1111const textScribbledShapeRestrictions : ShapeSizeRestrictions = {
12- minWidth : 100 ,
12+ minWidth : BASIC_SHAPE . DEFAULT_MIN_WIDTH ,
1313 minHeight : 45 ,
1414 maxWidth : - 1 ,
1515 maxHeight : - 1 ,
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { useShapeProps } from '../../shapes/use-shape-props.hook';
88import { useGroupShapeProps } from '../mock-components.utils' ;
99
1010const paragraphSizeRestrictions : ShapeSizeRestrictions = {
11- minWidth : 20 ,
11+ minWidth : BASIC_SHAPE . DEFAULT_MIN_WIDTH ,
1212 minHeight : 20 ,
1313 maxWidth : - 1 ,
1414 maxHeight : - 1 ,
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { useGroupShapeProps } from '../mock-components.utils';
99import { useResizeOnFontSizeChange } from './front-text-hooks/resize-fontsize-change.hook' ;
1010
1111const smalltextSizeRestrictions : ShapeSizeRestrictions = {
12- minWidth : 40 ,
12+ minWidth : BASIC_SHAPE . DEFAULT_MIN_WIDTH ,
1313 minHeight : 20 ,
1414 maxWidth : - 1 ,
1515 maxHeight : - 1 ,
You can’t perform that action at this time.
0 commit comments