From f556fa7aa07061d9068eeb624d7ced4c51524f03 Mon Sep 17 00:00:00 2001 From: Imtanan Aziz Toor Date: Thu, 22 Feb 2024 13:28:18 +0500 Subject: [PATCH 1/4] nav component issue fixes, component updates in progress --- .../src/comps/comps/buttonComp/linkComp.tsx | 4 +- .../src/comps/comps/navComp/navComp.tsx | 20 +++++--- .../comps/comps/textInputComp/mentionComp.tsx | 12 ++++- .../comps/controls/styleControlConstants.tsx | 50 ++++++++++++------- 4 files changed, 58 insertions(+), 28 deletions(-) diff --git a/client/packages/lowcoder/src/comps/comps/buttonComp/linkComp.tsx b/client/packages/lowcoder/src/comps/comps/buttonComp/linkComp.tsx index 1d41ad334..cbd5b26b2 100644 --- a/client/packages/lowcoder/src/comps/comps/buttonComp/linkComp.tsx +++ b/client/packages/lowcoder/src/comps/comps/buttonComp/linkComp.tsx @@ -33,6 +33,7 @@ const Link = styled(Button) <{ $style: LinkStyleType }>` font-family:${props.$style.fontFamily}; font-weight:${props.$style.textWeight}; border: ${props.$style.borderWidth} solid ${props.$style.border}; + border-radius:${props.$style.radius ? props.$style.radius:'0px'}; background-color: ${props.$style.background}; &:hover { color: ${props.$style.hoverText} !important; @@ -41,7 +42,8 @@ const Link = styled(Button) <{ $style: LinkStyleType }>` color: ${props.$style.activeText} !important; } `} - &.ant-btn { + + &.ant-btn { display: inline-flex; align-items: center; > span { diff --git a/client/packages/lowcoder/src/comps/comps/navComp/navComp.tsx b/client/packages/lowcoder/src/comps/comps/navComp/navComp.tsx index c5eedea6f..44b782b47 100644 --- a/client/packages/lowcoder/src/comps/comps/navComp/navComp.tsx +++ b/client/packages/lowcoder/src/comps/comps/navComp/navComp.tsx @@ -24,18 +24,19 @@ type IProps = { $bgColor: string; $borderColor: string; $borderWidth: string; + $borderRadius: string; }; -const Wrapper = styled("div") >` +const Wrapper = styled("div") >` height: 100%; - border-radius: 2px; + border-radius: ${(props) => props.$borderRadius ? props.$borderRadius : '2px'}; box-sizing: border-box; border: ${(props) => props.$borderWidth ? `${props.$borderWidth}` : '1px'} solid ${(props) => props.$borderColor}; background-color: ${(props) => props.$bgColor}; `; const NavInner = styled("div") >` - margin: 0 -16px; + // margin: 0 -16px; height: 100%; display: flex; justify-content: ${(props) => (props.$justify ? "space-between" : "left")}; @@ -49,17 +50,19 @@ const Item = styled.div<{ $fontStyle: string; $textWeight: string; $textSize: string; + $margin: string; + $padding: string; }>` height: 30px; line-height: 30px; - padding: 0 16px; + padding: ${(props) => props.$padding ? props.$padding : '0 16px'}; color: ${(props) => (props.$active ? props.$activeColor : props.$color)}; font-weight: ${(props) => (props.$textWeight ? props.$textWeight : 500)}; font-family:${(props) => (props.$fontFamily ? props.$fontFamily : 'sans-serif')}; font-style:${(props) => (props.$fontStyle ? props.$fontStyle : 'normal')}; - font-size:${(props) => (props.$textSize ? props.$textSize : '14px')} - - + font-size:${(props) => (props.$textSize ? props.$textSize : '14px')}; + margin:${(props) => props.$margin ? props.$margin : '0px'}; + &:hover { color: ${(props) => props.$activeColor}; cursor: pointer; @@ -157,6 +160,8 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => { $fontStyle={props.style.fontStyle} $textWeight={props.style.textWeight} $textSize={props.style.textSize} + $padding={props.style.padding} + $margin={props.style.margin} onClick={() => onEvent("click")} > {label} @@ -195,6 +200,7 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => { $borderColor={props.style.border} $bgColor={props.style.background} $borderWidth={props.style.borderWidth} + $borderRadius={props.style.borderRadius} > {props.logoUrl && ( diff --git a/client/packages/lowcoder/src/comps/comps/textInputComp/mentionComp.tsx b/client/packages/lowcoder/src/comps/comps/textInputComp/mentionComp.tsx index 28051a067..c760e054b 100644 --- a/client/packages/lowcoder/src/comps/comps/textInputComp/mentionComp.tsx +++ b/client/packages/lowcoder/src/comps/comps/textInputComp/mentionComp.tsx @@ -192,7 +192,17 @@ let MentionTmpComp = (function () { label: value, }))} autoSize={props.autoHeight} - style={{ height: "100%", maxHeight: "100%", resize: "none", padding: props.style.padding, fontStyle: props.style.fontStyle, fontFamily: props.style.fontFamily, borderWidth: props.style.borderWidth, fontWeight: props.style.textWeight }} + style={{ + height: "100%", + maxHeight: "100%", + resize: "none", + padding: props.style.padding, + fontStyle: props.style.fontStyle, + fontFamily: props.style.fontFamily, + borderWidth: props.style.borderWidth, + fontWeight: props.style.textWeight, + fontSize: props.style.textSize + }} readOnly={props.readOnly} /> diff --git a/client/packages/lowcoder/src/comps/controls/styleControlConstants.tsx b/client/packages/lowcoder/src/comps/controls/styleControlConstants.tsx index 9c45f893a..bd895a961 100644 --- a/client/packages/lowcoder/src/comps/controls/styleControlConstants.tsx +++ b/client/packages/lowcoder/src/comps/controls/styleControlConstants.tsx @@ -476,7 +476,8 @@ function replaceAndMergeMultipleStyles(originalArray: any[], styleToReplace: str } export const ButtonStyle = [ - ...getBgBorderRadiusByBg("primary"), + // ...getBgBorderRadiusByBg("primary"), + getBackground('primary'), ...STYLING_FIELDS_SEQUENCE ] as const; @@ -1084,30 +1085,41 @@ export const ProgressStyle = [ depTheme: "canvas", depType: DEP_TYPE.CONTRAST_TEXT, transformer: contrastText, - }]).filter((style)=> ['border','borderWidth'].includes(style.name) === false), + }]).filter((style) => ['border', 'borderWidth'].includes(style.name) === false), TRACK, FILL, SUCCESS, ] as const; export const NavigationStyle = [ - { - name: "text", - label: trans("text"), - depName: "background", - depType: DEP_TYPE.CONTRAST_TEXT, - transformer: contrastText, - }, - ACCENT, - getStaticBackground("#FFFFFF00"), - getStaticBorder("#FFFFFF00"), - MARGIN, - PADDING, - FONT_FAMILY, - FONT_STYLE, - TEXT_WEIGHT, - TEXT_SIZE, - BORDER_WIDTH + ...replaceAndMergeMultipleStyles(STYLING_FIELDS_SEQUENCE, 'text', [ + { + name: "text", + label: trans("text"), + depName: "background", + depType: DEP_TYPE.CONTRAST_TEXT, + transformer: contrastText, + }, + ACCENT, + getStaticBackground("#FFFFFF00") + ]) + // { + // name: "text", + // label: trans("text"), + // depName: "background", + // depType: DEP_TYPE.CONTRAST_TEXT, + // transformer: contrastText, + // }, + // ACCENT, + // getStaticBackground("#FFFFFF00"), + // getStaticBorder("#FFFFFF00"), + // MARGIN, + // PADDING, + // FONT_FAMILY, + // FONT_STYLE, + // TEXT_WEIGHT, + // TEXT_SIZE, + // BORDER_WIDTH ] as const; export const ImageStyle = [getStaticBorder("#00000000"), RADIUS, BORDER_WIDTH, MARGIN, PADDING] as const; From 8a630659ce1838e59d52f69f190e5afbd3c8d31f Mon Sep 17 00:00:00 2001 From: Imtanan Aziz Toor Date: Thu, 22 Feb 2024 13:34:24 +0500 Subject: [PATCH 2/4] Toggle button border Width fixes --- .../lowcoder/src/comps/comps/buttonComp/buttonCompConstants.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/client/packages/lowcoder/src/comps/comps/buttonComp/buttonCompConstants.tsx b/client/packages/lowcoder/src/comps/comps/buttonComp/buttonCompConstants.tsx index 0f60c7a2d..e770014f7 100644 --- a/client/packages/lowcoder/src/comps/comps/buttonComp/buttonCompConstants.tsx +++ b/client/packages/lowcoder/src/comps/comps/buttonComp/buttonCompConstants.tsx @@ -13,6 +13,7 @@ export function getButtonStyle(buttonStyle: ButtonStyleType) { return css` &&& { border-radius: ${buttonStyle.radius}; + border-width:${buttonStyle.borderWidth}; margin: ${buttonStyle.margin}; padding: ${buttonStyle.padding}; &:not(:disabled) { From 7b6dda61d674697061825301a1f3132394dc1986 Mon Sep 17 00:00:00 2001 From: Imtanan Aziz Toor Date: Thu, 22 Feb 2024 15:22:18 +0500 Subject: [PATCH 3/4] FOnt added for testing, circle progress and progress updated --- client/packages/lowcoder/index.html | 4 ++++ .../src/comps/comps/progressCircleComp.tsx | 22 ++++++++++++------- .../lowcoder/src/comps/comps/progressComp.tsx | 1 + .../comps/controls/styleControlConstants.tsx | 3 +++ 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/client/packages/lowcoder/index.html b/client/packages/lowcoder/index.html index c83e225aa..038b31c38 100644 --- a/client/packages/lowcoder/index.html +++ b/client/packages/lowcoder/index.html @@ -7,6 +7,10 @@ + + + +