@@ -90,8 +90,11 @@ import { inputFieldComps } from "@lowcoder-ee/constants/compConstants";
9090function isSimpleColorConfig ( config :SingleColorConfig ) :config isSimpleColorConfig {
9191return config . hasOwnProperty ( "color" ) ;
9292}
93- function isSimpleLineHeightConfig ( config :SingleColorConfig ) :config isLineHeightConfig {
94- return config . hasOwnProperty ( "lineheight" ) ;
93+ function isLineHeightConfig ( config :SingleColorConfig ) :config isLineHeightConfig {
94+ return config . hasOwnProperty ( "lineHeight" ) ;
95+ }
96+ function isTextSizeConfig ( config :SingleColorConfig ) :config isTextSizeConfig {
97+ return config . hasOwnProperty ( "textSize" ) ;
9598}
9699
97100function isDepColorConfig ( config :SingleColorConfig ) :config isDepColorConfig {
@@ -161,9 +164,6 @@ function isFooterBackgroundImageOriginConfig(config: SingleColorConfig): config
161164return config . hasOwnProperty ( "footerBackgroundImageOrigin" ) ;
162165}
163166
164- function isTextSizeConfig ( config :SingleColorConfig ) :config isTextSizeConfig {
165- return config . hasOwnProperty ( "textSize" ) ;
166- }
167167
168168function isTextWeightConfig ( config :SingleColorConfig ) :config isTextWeightConfig {
169169return config . hasOwnProperty ( "textWeight" ) ;
@@ -244,7 +244,9 @@ function isEmptyColor(color: string) {
244244function isEmptyLineHeight ( lineHeight :string ) {
245245return _ . isEmpty ( lineHeight ) ;
246246}
247-
247+ function isEmptyTextSize ( textSize :string ) {
248+ return _ . isEmpty ( textSize ) ;
249+ }
248250function isEmptyRadius ( radius :string ) {
249251return _ . isEmpty ( radius ) ;
250252}
@@ -300,9 +302,7 @@ function isEmptyFooterBackgroundImageOriginConfig(footerBackgroundImageOrigin: s
300302return _ . isEmpty ( footerBackgroundImageOrigin ) ;
301303}
302304
303- function isEmptyTextSize ( textSize :string ) {
304- return _ . isEmpty ( textSize ) ;
305- }
305+
306306function isEmptyTextWeight ( textWeight :string ) {
307307return _ . isEmpty ( textWeight ) ;
308308}
@@ -376,17 +376,21 @@ function calcColors<ColorMap extends Record<string, string>>(
376376if ( compType && styleKey && inputFieldComps . includes ( compType ) && styleKey !== 'inputFieldStyle' ) {
377377const style = theme ?. components ?. [ compType ] ?. [ styleKey ] as Record < string , string > ;
378378themeWithDefault [ 'borderWidth' ] = style ?. [ 'borderWidth' ] || '0px' ;
379+ console . log ( "The values are " , themeWithDefault )
379380}
380381
381382// Cover what is not there for the first pass
382383let res :Record < string , string > = { } ;
383384colorConfigs . forEach ( ( config ) => {
384385const name = config . name ;
385- if ( ! isEmptyLineHeight ( props [ name ] ) && isSimpleLineHeightConfig ( config ) ) {
386+ if ( ! isEmptyLineHeight ( props [ name ] ) && isLineHeightConfig ( config ) ) {
387+ res [ name ] = props [ name ] ;
388+ return ;
389+ }
390+ if ( ! isEmptyTextSize ( props [ name ] ) && isTextSizeConfig ( config ) ) {
386391res [ name ] = props [ name ] ;
387392return ;
388393}
389-
390394if ( ! isEmptyRadius ( props [ name ] ) && isRadiusConfig ( config ) ) {
391395res [ name ] = props [ name ] ;
392396return ;
@@ -460,10 +464,7 @@ function calcColors<ColorMap extends Record<string, string>>(
460464res [ name ] = props [ name ] ;
461465return ;
462466}
463- if ( ! isEmptyTextSize ( props [ name ] ) && isTextSizeConfig ( config ) ) {
464- res [ name ] = props [ name ] ;
465- return ;
466- }
467+
467468if ( ! isEmptyTextWeight ( props [ name ] ) && isTextWeightConfig ( config ) ) {
468469res [ name ] = props [ name ] ;
469470return ;
@@ -645,6 +646,12 @@ function calcColors<ColorMap extends Record<string, string>>(
645646if ( isAnimationDurationConfig ( config ) ) {
646647res [ name ] = themeWithDefault [ config . animationDuration ] || '0s' ;
647648}
649+ if ( isLineHeightConfig ( config ) ) {
650+
651+ res [ name ] = themeWithDefault [ config . lineHeight ] || '20px' ;
652+ console . log ( "The 2nd Values are" , themeWithDefault ) ;
653+ console . log ( "The 2nd Values are" , isLineHeightConfig ) ;
654+ }
648655} ) ;
649656// The second pass calculates dep
650657colorConfigs . forEach ( ( config ) => {
@@ -682,6 +689,7 @@ function calcColors<ColorMap extends Record<string, string>>(
682689res [ name ] = themeWithDefault [ config . name ]
683690}
684691} ) ;
692+ console . log ( "The defaults are " , themeWithDefault )
685693return res as ColorMap ;
686694}
687695
@@ -1357,4 +1365,5 @@ export function useStyle<T extends readonly SingleColorConfig[]>(colorConfigs: T
13571365props [ config . name as Names < T > ] = "" ;
13581366} ) ;
13591367return calcColors ( props , colorConfigs , theme ?. theme , bgColor ) ;
1368+
13601369}