@@ -16,6 +16,11 @@ export type SimpleColorConfig = CommonColorConfig & {
16
16
readonly color : string ;
17
17
} ;
18
18
19
+ export type LineHeightConfig = CommonColorConfig & {
20
+ readonly lineHeight : string ; // Define the lineHeight property
21
+ } ;
22
+
23
+
19
24
export type RadiusConfig = CommonColorConfig & {
20
25
readonly radius : string ;
21
26
} ;
@@ -224,7 +229,10 @@ export type SingleColorConfig =
224
229
| OpacityConfig
225
230
| BoxShadowConfig
226
231
| BoxShadowColorConfig
227
- | AnimationIterationCountConfig ;
232
+ | AnimationIterationCountConfig
233
+ | LineHeightConfig
234
+
235
+
228
236
229
237
export const SURFACE_COLOR = "#FFFFFF" ;
230
238
const SECOND_SURFACE_COLOR = "#D7D9E0" ;
@@ -368,6 +376,24 @@ export function handleToCalendarToday(color: string) {
368
376
return "#0000000c" ;
369
377
}
370
378
}
379
+ export function getLineHeightValue ( theme : ThemeDetail , value : string | number ) {
380
+ if ( typeof value === 'number' ) {
381
+ return `${ value } px` ;
382
+ } else if ( value === 'inherit' ) {
383
+ return 'inherit' ;
384
+ } else if ( value === 'initial' ) {
385
+ return 'initial' ;
386
+ } else if ( value === 'unset' ) {
387
+ return 'unset' ;
388
+ } else {
389
+ const lineHeightValue = theme . lineHeight ;
390
+ if ( lineHeightValue ) {
391
+ return lineHeightValue ;
392
+ } else {
393
+ return '1.5' ; // default line height value
394
+ }
395
+ }
396
+ }
371
397
372
398
// return calendar text
373
399
function handleCalendarText (
@@ -516,6 +542,12 @@ const BACKGROUND_IMAGE_ORIGIN = {
516
542
backgroundImageOrigin : "backgroundImageOrigin" ,
517
543
} as const ;
518
544
545
+ const LINE_HEIGHT = {
546
+ name : "lineHeight" ,
547
+ label : trans ( "style.lineHeight" ) ,
548
+ lineHeight : "lineHeight" ,
549
+ } as const ;
550
+
519
551
const MARGIN = {
520
552
name : "margin" ,
521
553
label : trans ( "style.margin" ) ,
@@ -645,6 +677,7 @@ const STYLING_FIELDS_SEQUENCE = [
645
677
RADIUS ,
646
678
BORDER_WIDTH ,
647
679
ROTATION ,
680
+ LINE_HEIGHT
648
681
] ;
649
682
650
683
const STYLING_FIELDS_CONTAINER_SEQUENCE = [
@@ -658,6 +691,7 @@ const STYLING_FIELDS_CONTAINER_SEQUENCE = [
658
691
BOXSHADOW ,
659
692
BOXSHADOWCOLOR ,
660
693
ROTATION ,
694
+ LINE_HEIGHT
661
695
] ;
662
696
663
697
export const AnimationStyle = [
@@ -1116,10 +1150,9 @@ export const LabelStyle = [
1116
1150
export const InputFieldStyle = [
1117
1151
getBackground ( ) ,
1118
1152
getStaticBorder ( ) ,
1119
- ...STYLING_FIELDS_CONTAINER_SEQUENCE . filter (
1120
- ( style ) => [ "border" ] . includes ( style . name ) === false
1153
+ ...STYLING_FIELDS_CONTAINER_SEQUENCE . filter (
1154
+ ( style ) => ! [ "border" , "lineHeight" ] . includes ( style . name )
1121
1155
) ,
1122
- // ...STYLING_FIELDS_CONTAINER_SEQUENCE,
1123
1156
] as const ;
1124
1157
1125
1158
export const SignatureContainerStyle = [
@@ -1291,7 +1324,7 @@ function checkAndUncheck() {
1291
1324
}
1292
1325
1293
1326
export const CheckboxStyle = [
1294
- ...replaceAndMergeMultipleStyles ( STYLING_FIELDS_SEQUENCE . filter ( styles => styles . name !== 'rotation' ) , "text" , [
1327
+ ...replaceAndMergeMultipleStyles ( STYLING_FIELDS_SEQUENCE . filter ( styles => styles . name !== 'rotation' && styles . name !== 'lineHeight' ) , "text" , [
1295
1328
STATIC_TEXT ,
1296
1329
VALIDATE ,
1297
1330
] ) . filter ( ( style ) => style . name !== "border" ) ,
@@ -1309,7 +1342,7 @@ export const CheckboxStyle = [
1309
1342
] as const ;
1310
1343
1311
1344
export const RadioStyle = [
1312
- ...replaceAndMergeMultipleStyles ( STYLING_FIELDS_SEQUENCE . filter ( style => style . name !== 'rotation' ) , "text" , [
1345
+ ...replaceAndMergeMultipleStyles ( STYLING_FIELDS_SEQUENCE . filter ( style => style . name !== 'rotation' && style . name !== 'lineHeight' ) , "text" , [
1313
1346
STATIC_TEXT ,
1314
1347
VALIDATE ,
1315
1348
] ) . filter ( ( style ) => style . name !== "border" && style . name !== "radius" ) ,
@@ -1554,7 +1587,7 @@ export const IframeStyle = [
1554
1587
BORDER_WIDTH ,
1555
1588
MARGIN ,
1556
1589
PADDING ,
1557
- ROTATION
1590
+ ROTATION ,
1558
1591
] as const ;
1559
1592
1560
1593
export const CustomStyle = [
0 commit comments