@@ -74,6 +74,7 @@ import {
74
74
AnimationConfig ,
75
75
AnimationDelayConfig ,
76
76
AnimationDurationConfig ,
77
+ LineHeightConfig ,
77
78
78
79
79
80
} from "./styleControlConstants" ;
@@ -89,6 +90,9 @@ import { inputFieldComps } from "@lowcoder-ee/constants/compConstants";
89
90
function isSimpleColorConfig ( config : SingleColorConfig ) : config is SimpleColorConfig {
90
91
return config . hasOwnProperty ( "color" ) ;
91
92
}
93
+ function isSimpleLineHeightConfig ( config : SingleColorConfig ) : config is LineHeightConfig {
94
+ return config . hasOwnProperty ( "lineheight" ) ;
95
+ }
92
96
93
97
function isDepColorConfig ( config : SingleColorConfig ) : config is DepColorConfig {
94
98
return config . hasOwnProperty ( "depName" ) || config . hasOwnProperty ( "depTheme" ) ;
@@ -237,6 +241,9 @@ export type StyleConfigType<T extends readonly SingleColorConfig[]> = { [K in Na
237
241
function isEmptyColor ( color : string ) {
238
242
return _ . isEmpty ( color ) ;
239
243
}
244
+ function isEmptyLineHeight ( lineHeight : string ) {
245
+ return _ . isEmpty ( lineHeight ) ;
246
+ }
240
247
241
248
function isEmptyRadius ( radius : string ) {
242
249
return _ . isEmpty ( radius ) ;
@@ -375,6 +382,11 @@ function calcColors<ColorMap extends Record<string, string>>(
375
382
let res : Record < string , string > = { } ;
376
383
colorConfigs . forEach ( ( config ) => {
377
384
const name = config . name ;
385
+ if ( ! isEmptyLineHeight ( props [ name ] ) && isSimpleLineHeightConfig ( config ) ) {
386
+ res [ name ] = props [ name ] ;
387
+ return ;
388
+ }
389
+
378
390
if ( ! isEmptyRadius ( props [ name ] ) && isRadiusConfig ( config ) ) {
379
391
res [ name ] = props [ name ] ;
380
392
return ;
@@ -743,6 +755,11 @@ const StyleContent = styled.div`
743
755
border-radius: 0 0 6px 6px;
744
756
}
745
757
` ;
758
+ const LineHeightPropIcon = styled ( ExpandIcon ) `
759
+ margin: 0 8px 0 -3px;
760
+ padding: 3px;
761
+ color: #888;
762
+ ` ;
746
763
747
764
const MarginIcon = styled ( ExpandIcon ) ` margin: 0 8px 0 2px; color: #888` ;
748
765
const PaddingIcon = styled ( CompressIcon ) ` margin: 0 8px 0 2px; color: #888` ;
@@ -853,7 +870,8 @@ export function styleControl<T extends readonly SingleColorConfig[]>(
853
870
name === 'containerHeaderPadding' ||
854
871
name === 'containerSiderPadding' ||
855
872
name === 'containerFooterPadding' ||
856
- name === 'containerBodyPadding'
873
+ name === 'containerBodyPadding' ||
874
+ name === 'lineHeight'
857
875
) {
858
876
childrenMap [ name ] = StringControl ;
859
877
} else {
@@ -966,7 +984,8 @@ export function styleControl<T extends readonly SingleColorConfig[]>(
966
984
name === 'footerBackgroundImageRepeat' ||
967
985
name === 'footerBackgroundImageSize' ||
968
986
name === 'footerBackgroundImagePosition' ||
969
- name === 'footerBackgroundImageOrigin'
987
+ name === 'footerBackgroundImageOrigin' ||
988
+ name === 'lineHeight'
970
989
) {
971
990
children [ name ] ?. dispatchChangeValueAction ( '' ) ;
972
991
} else {
@@ -1299,6 +1318,14 @@ export function styleControl<T extends readonly SingleColorConfig[]>(
1299
1318
placeholder :
1300
1319
props [ name ] ,
1301
1320
} )
1321
+ : name === 'lineHeight' // Added lineHeight here
1322
+ ? (
1323
+ children [ name ] as InstanceType < typeof StringControl >
1324
+ ) . propertyView ( {
1325
+ label : config . label ,
1326
+ preInputNode : < LineHeightPropIcon title = "Line Height" /> ,
1327
+ placeholder : props [ name ] ,
1328
+ } )
1302
1329
: children [
1303
1330
name
1304
1331
] . propertyView ( {
0 commit comments