Skip to content

Commit 7e3b1a9

Browse files
Merge pull request #1069 from MenamAfzal/add/lineHeight
Add/line-height
2 parents f8f2872 + 3e4fa6f commit 7e3b1a9

File tree

15 files changed

+104
-25
lines changed

15 files changed

+104
-25
lines changed

client/packages/lowcoder-design/src/icons/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ export { ReactComponent as BorderRadiusIcon } from "./remix/rounded-corner.svg";
216216
export { ReactComponent as ShadowIcon } from "./remix/shadow-line.svg";
217217
export { ReactComponent as OpacityIcon } from "./remix/contrast-drop-2-line.svg";
218218
export { ReactComponent as AnimationIcon } from "./remix/loader-line.svg";
219+
export { ReactComponent as LineHeightIcon } from "./remix/line-height.svg";
219220

220221

221222
export { ReactComponent as LeftInfoLine } from "./remix/information-line.svg";

client/packages/lowcoder/src/api/commonSettingApi.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export interface ThemeDetail {
6262
animationDuration?: string;
6363
opacity?: string;
6464
boxShadow?: string;
65+
lineHeight?: string;
6566
boxShadowColor?: string;
6667
animationIterationCount?: string;
6768
components?: Record<string, JSONObject>;
@@ -83,6 +84,7 @@ export function getThemeDetailName(key: keyof ThemeDetail) {
8384
case "padding": return trans("style.padding");
8485
case "gridColumns": return trans("themeDetail.gridColumns");
8586
case "textSize": return trans("style.textSize");
87+
case "lineHeight": return trans("themeDetail.lineHeight");
8688
}
8789
return "";
8890
}
@@ -105,6 +107,7 @@ export function isThemeColorKey(key: string) {
105107
case "padding":
106108
case "gridColumns":
107109
case "textSize":
110+
case "lineHeight":
108111
return true;
109112
}
110113
return false;

client/packages/lowcoder/src/components/ThemeSettingsCompStyles.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
TextStyleIcon,
2626
ImageCompIconSmall,
2727
RotationIcon,
28+
LineHeightIcon
2829
} from "lowcoder-design/src/icons";
2930
import { trans } from "i18n";
3031
import { debounce } from "lodash";
@@ -375,6 +376,10 @@ export default function ThemeSettingsCompStyles(props: CompStyleProps) {
375376
icon = <RotationIcon style={{width: "16px", margin: "5px 0 0 5px", padding: "0px"}}/>;
376377
break;
377378
}
379+
case 'lineHeight': {
380+
icon = <LineHeightIcon style={{width: "16px", margin: "5px 0 0 5px", padding: "0px"}}/>;
381+
break;
382+
}
378383
}
379384
return icon;
380385
}

client/packages/lowcoder/src/comps/comps/buttonComp/buttonCompConstants.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export const Button100 = styled(Button)<{ $buttonStyle?: ButtonStyleType }>`
6565
overflow: hidden;
6666
text-overflow: ellipsis;
6767
}
68+
line-height:${(props) => props.$buttonStyle?.lineHeight};
6869
`;
6970

7071
export const ButtonCompWrapper = styled.div<{ disabled: boolean }>`

client/packages/lowcoder/src/comps/comps/buttonComp/dropdownComp.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const LeftButtonWrapper = styled.div<{ $buttonStyle: DropdownStyleType }>`
6060
${(props) => `font-style: ${props.$buttonStyle.fontStyle};`}
6161
6262
width: 100%;
63+
line-height:${(props) => props.$buttonStyle.lineHeight};
6364
}
6465
6566
`;

client/packages/lowcoder/src/comps/comps/numberInputComp/numberInputComp.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const getStyle = (style: InputLikeStyleType) => {
6060
return css`
6161
border-radius: ${style.radius};
6262
border-width:${style.borderWidth} !important;
63+
line-height: ${style.lineHeight} !important;
6364
// still use antd style when disabled
6465
&:not(.ant-input-number-disabled) {
6566
color: ${style.text};

client/packages/lowcoder/src/comps/comps/selectInputComp/checkboxComp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ let CheckboxBasicComp = (function () {
150150
options: SelectInputOptionControl,
151151
style: styleControl(InputFieldStyle , 'style'),
152152
labelStyle: styleControl(
153-
LabelStyle.filter((style) => ['accent', 'validate'].includes(style.name) === false),
153+
LabelStyle.filter((style) => ['accent', 'validate', 'lineheight'].includes(style.name) === false),
154154
'labelStyle',
155155
),
156156
layout: dropdownControl(RadioLayoutOptions, "horizontal"),

client/packages/lowcoder/src/comps/comps/selectInputComp/selectCompConstants.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ const DropdownStyled = styled.div<{ $style: ChildrenMultiSelectStyleType }>`
204204
font-weight: ${props => props.$style?.textWeight};
205205
text-transform: ${props => props.$style?.textTransform};
206206
color: ${props => props.$style?.text};
207+
line-height: ${props => props.$style?.lineHeight};
207208
}
208209
.option-label{
209210
text-decoration: ${props => props.$style?.textDecoration} !important;

client/packages/lowcoder/src/comps/comps/textComp.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const getStyle = (style: TextStyleType) => {
6464
h6 {
6565
color: ${style.text};
6666
font-weight: ${style.textWeight} !important;
67+
line-height:${style.lineHeight};
6768
}
6869
img,
6970
pre {

client/packages/lowcoder/src/comps/comps/textInputComp/textInputConstants.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ export function getStyle(style: InputLikeStyleType, labelStyle?: LabelStyleType)
252252
text-decoration:${style.textDecoration};
253253
background-color: ${style.background};
254254
border-color: ${style.border};
255+
line-height: ${style.lineHeight};
255256
256257
&:focus,
257258
&.ant-input-affix-wrapper-focused {

0 commit comments

Comments
 (0)