Skip to content

added type for buttonStyle #910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Loading