From a65755fffcd8fb3a23f80a5cb0a7ed03968f4fc4 Mon Sep 17 00:00:00 2001 From: MenamAfzaal Date: Mon, 27 May 2024 16:30:42 +0500 Subject: [PATCH 1/2] added type for buttonStyle --- .../src/comps/comps/buttonComp/buttonCompConstants.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/packages/lowcoder/src/comps/comps/buttonComp/buttonCompConstants.tsx b/client/packages/lowcoder/src/comps/comps/buttonComp/buttonCompConstants.tsx index 5fb44f7302..c509aeaa9e 100644 --- a/client/packages/lowcoder/src/comps/comps/buttonComp/buttonCompConstants.tsx +++ b/client/packages/lowcoder/src/comps/comps/buttonComp/buttonCompConstants.tsx @@ -7,7 +7,7 @@ import { genActiveColor, genHoverColor } from "lowcoder-design"; import { refMethods } from "comps/generators/withMethodExposing"; import { blurMethod, clickMethod, focusWithOptions } from "comps/utils/methodUtils"; -export function getButtonStyle(buttonStyle: any) { +export function getButtonStyle(buttonStyle: ButtonStyleType) { const hoverColor = genHoverColor(buttonStyle.background); const activeColor = genActiveColor(buttonStyle.background); return css` @@ -52,7 +52,7 @@ export function getButtonStyle(buttonStyle: any) { `; } -export const Button100 = styled(Button)<{ $buttonStyle?: any }>` +export const Button100 = styled(Button)<{ $buttonStyle?: ButtonStyleType }>` ${(props) => props.$buttonStyle && getButtonStyle(props.$buttonStyle)} width: 100%; height: auto; From a52627f7e917ad01f10c5851c8e16d52f5d3b325 Mon Sep 17 00:00:00 2001 From: MenamAfzaal Date: Mon, 27 May 2024 17:41:31 +0500 Subject: [PATCH 2/2] added type for dropdown --- .../lowcoder/src/comps/comps/buttonComp/dropdownComp.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/packages/lowcoder/src/comps/comps/buttonComp/dropdownComp.tsx b/client/packages/lowcoder/src/comps/comps/buttonComp/dropdownComp.tsx index 24dc12ce94..150eec23a7 100644 --- a/client/packages/lowcoder/src/comps/comps/buttonComp/dropdownComp.tsx +++ b/client/packages/lowcoder/src/comps/comps/buttonComp/dropdownComp.tsx @@ -3,7 +3,7 @@ import { default as Dropdown } from "antd/es/dropdown"; import { default as DropdownButton } from "antd/es/dropdown/dropdown-button"; import { BoolControl } from "comps/controls/boolControl"; import { BoolCodeControl, StringControl } from "comps/controls/codeControl"; -import { DropdownStyle } from "comps/controls/styleControlConstants"; +import { DropdownStyle, DropdownStyleType } from "comps/controls/styleControlConstants"; import { withDefault } from "comps/generators"; import { UICompBuilder } from "comps/generators/uiCompBuilder"; import { disabledPropertyView, hiddenPropertyView } from "comps/utils/propertyUtils"; @@ -33,7 +33,7 @@ const StyledDropdownButton = styled(DropdownButton)` } `; -const LeftButtonWrapper = styled.div<{ $buttonStyle: any }>` +const LeftButtonWrapper = styled.div<{ $buttonStyle: DropdownStyleType }>` width: calc(100%); ${(props) => `margin: ${props.$buttonStyle.margin};`} margin-right: 0; @@ -63,7 +63,7 @@ const LeftButtonWrapper = styled.div<{ $buttonStyle: any }>` `; -const RightButtonWrapper = styled.div<{ $buttonStyle: any }>` +const RightButtonWrapper = styled.div<{ $buttonStyle: DropdownStyleType }>` // width: 32px; ${(props) => `margin: ${props.$buttonStyle.margin};`} margin-left: -1px;