Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4c8dd4e

Browse files
committed
Push for debug
1 parent0cf5abd commit4c8dd4e

File tree

2 files changed

+25
-22
lines changed

2 files changed

+25
-22
lines changed

‎client/packages/lowcoder/src/comps/controls/styleControl.tsx‎

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,11 @@ import { inputFieldComps } from "@lowcoder-ee/constants/compConstants";
9090
functionisSimpleColorConfig(config:SingleColorConfig):config isSimpleColorConfig{
9191
returnconfig.hasOwnProperty("color");
9292
}
93-
functionisSimpleLineHeightConfig(config:SingleColorConfig):config isLineHeightConfig{
94-
returnconfig.hasOwnProperty("lineheight");
93+
functionisLineHeightConfig(config:SingleColorConfig):config isLineHeightConfig{
94+
returnconfig.hasOwnProperty("lineHeight");
95+
}
96+
functionisTextSizeConfig(config:SingleColorConfig):config isTextSizeConfig{
97+
returnconfig.hasOwnProperty("textSize");
9598
}
9699

97100
functionisDepColorConfig(config:SingleColorConfig):config isDepColorConfig{
@@ -161,9 +164,6 @@ function isFooterBackgroundImageOriginConfig(config: SingleColorConfig): config
161164
returnconfig.hasOwnProperty("footerBackgroundImageOrigin");
162165
}
163166

164-
functionisTextSizeConfig(config:SingleColorConfig):config isTextSizeConfig{
165-
returnconfig.hasOwnProperty("textSize");
166-
}
167167

168168
functionisTextWeightConfig(config:SingleColorConfig):config isTextWeightConfig{
169169
returnconfig.hasOwnProperty("textWeight");
@@ -244,7 +244,9 @@ function isEmptyColor(color: string) {
244244
functionisEmptyLineHeight(lineHeight:string){
245245
return_.isEmpty(lineHeight);
246246
}
247-
247+
functionisEmptyTextSize(textSize:string){
248+
return_.isEmpty(textSize);
249+
}
248250
functionisEmptyRadius(radius:string){
249251
return_.isEmpty(radius);
250252
}
@@ -300,9 +302,7 @@ function isEmptyFooterBackgroundImageOriginConfig(footerBackgroundImageOrigin: s
300302
return_.isEmpty(footerBackgroundImageOrigin);
301303
}
302304

303-
functionisEmptyTextSize(textSize:string){
304-
return_.isEmpty(textSize);
305-
}
305+
306306
functionisEmptyTextWeight(textWeight:string){
307307
return_.isEmpty(textWeight);
308308
}
@@ -376,17 +376,21 @@ function calcColors<ColorMap extends Record<string, string>>(
376376
if(compType&&styleKey&&inputFieldComps.includes(compType)&&styleKey!=='inputFieldStyle'){
377377
conststyle=theme?.components?.[compType]?.[styleKey]asRecord<string,string>;
378378
themeWithDefault['borderWidth']=style?.['borderWidth']||'0px';
379+
console.log("The values are ",themeWithDefault)
379380
}
380381

381382
// Cover what is not there for the first pass
382383
letres:Record<string,string>={};
383384
colorConfigs.forEach((config)=>{
384385
constname=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)){
386391
res[name]=props[name];
387392
return;
388393
}
389-
390394
if(!isEmptyRadius(props[name])&&isRadiusConfig(config)){
391395
res[name]=props[name];
392396
return;
@@ -460,10 +464,7 @@ function calcColors<ColorMap extends Record<string, string>>(
460464
res[name]=props[name];
461465
return;
462466
}
463-
if(!isEmptyTextSize(props[name])&&isTextSizeConfig(config)){
464-
res[name]=props[name];
465-
return;
466-
}
467+
467468
if(!isEmptyTextWeight(props[name])&&isTextWeightConfig(config)){
468469
res[name]=props[name];
469470
return;
@@ -645,6 +646,12 @@ function calcColors<ColorMap extends Record<string, string>>(
645646
if(isAnimationDurationConfig(config)){
646647
res[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
650657
colorConfigs.forEach((config)=>{
@@ -682,6 +689,7 @@ function calcColors<ColorMap extends Record<string, string>>(
682689
res[name]=themeWithDefault[config.name]
683690
}
684691
});
692+
console.log("The defaults are ",themeWithDefault)
685693
returnresasColorMap;
686694
}
687695

@@ -1357,4 +1365,5 @@ export function useStyle<T extends readonly SingleColorConfig[]>(colorConfigs: T
13571365
props[config.nameasNames<T>]="";
13581366
});
13591367
returncalcColors(props,colorConfigs,theme?.theme,bgColor);
1368+
13601369
}

‎client/packages/lowcoder/src/comps/controls/styleControlConstants.tsx‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -379,18 +379,12 @@ export function handleToCalendarToday(color: string) {
379379
exportfunctiongetLineHeightValue(theme:ThemeDetail,value:string|number){
380380
if(typeofvalue==='number'){
381381
return`${value}px`;
382-
}elseif(value==='inherit'){
383-
return'inherit';
384-
}elseif(value==='initial'){
385-
return'initial';
386-
}elseif(value==='unset'){
387-
return'unset';
388382
}else{
389383
constlineHeightValue=theme.lineHeight;
390384
if(lineHeightValue){
391385
returnlineHeightValue;
392386
}else{
393-
return'1.5';// default line height value
387+
returnvalue;// default line height value
394388
}
395389
}
396390
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp