Skip to content

Commit 6a300eb

Browse files
Merge pull request #2109 from iamfaran/feat/theme-style-comps
[Feat]: add select component selected/active styles
2 parents c1ba8f2 + df8fd22 commit 6a300eb

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ const DropdownRenderStyle = styled.div<{ $childrenInputFieldStyle: ChildrenMulti
3232
text-decoration: ${props => props.$childrenInputFieldStyle?.textDecoration};
3333
color: ${props => props.$childrenInputFieldStyle?.text};
3434
}
35+
.ant-cascader-menu-item-active:not(.ant-cascader-menu-item-disabled) {
36+
background-color: ${props => props.$childrenInputFieldStyle?.activeBackground ? `${props.$childrenInputFieldStyle.activeBackground}22` : 'rgb(242, 247, 252)'};
37+
}
3538
`
3639

3740
let CascaderBasicComp = (function () {

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ export const DropdownStyled = styled.div<{ $style: ChildrenMultiSelectStyleType
217217
min-width: 14px;
218218
margin-right: 0;
219219
}
220+
.ant-select-item-option-selected:not(.ant-select-item-option-disabled) {
221+
background-color: ${props => props.$style?.selectBackground ? `${props.$style.selectBackground}` : 'transparent'};
222+
}
223+
.ant-select-item-option-active:not(.ant-select-item-option-disabled) {
224+
background-color: ${props => props.$style?.activeBackground ? `${props.$style.activeBackground}` : 'transparent'};
225+
}
220226
`;
221227

222228
const Wrapper = styled.span`

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,21 @@ export const MultiSelectStyle = [
15551555

15561556
export const ChildrenMultiSelectStyle = [
15571557
...STYLING_FIELDS_SEQUENCE,
1558-
getBackground()
1558+
getBackground(),
1559+
{
1560+
name: "activeBackground",
1561+
label: trans("style.activeBackground"),
1562+
depTheme: "primary",
1563+
depType: DEP_TYPE.SELF,
1564+
transformer: handleLightenColor,
1565+
},
1566+
{
1567+
name: "selectBackground",
1568+
label: trans("style.selectBackground"),
1569+
depTheme: "primary",
1570+
depType: DEP_TYPE.SELF,
1571+
transformer: toSelf,
1572+
}
15591573
] as const;
15601574

15611575
export const TabContainerStyle = [

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ export const en = {
592592
"siderBackgroundImagePosition": "Sider Background Image Position",
593593
"siderBackgroundImageOrigin": "Sider Background Image Origin",
594594
"activeBackground": "Active Background Color",
595+
"selectBackground": "Selected Background Color",
595596
"labelBackground": "Label Background Color",
596597
"gradientBackground": "Gradient Background Color",
597598
"direction": "Direction",

0 commit comments

Comments
 (0)