@@ -3,7 +3,7 @@ import { BoolControl } from "comps/controls/boolControl";
3
3
import { stringExposingStateControl } from "comps/controls/codeStateControl" ;
4
4
import { dropdownControl } from "comps/controls/dropdownControl" ;
5
5
import { styleControl } from "comps/controls/styleControl" ;
6
- import { FloatButtonStyle , FloatButtonStyleType } from "comps/controls/styleControlConstants" ;
6
+ import { BadgeStyle , BadgeStyleType , FloatButtonStyle , FloatButtonStyleType } from "comps/controls/styleControlConstants" ;
7
7
import { UICompBuilder } from "comps/generators/uiCompBuilder" ;
8
8
import { NameConfig , NameConfigHidden , withExposingConfigs } from "comps/generators/withExposing" ;
9
9
import { Section , sectionNames } from "lowcoder-design" ;
@@ -17,7 +17,7 @@ import styled from "styled-components";
17
17
import { ButtonEventHandlerControl } from "comps/controls/eventHandlerControl" ;
18
18
import { manualOptionsControl } from "comps/controls/optionsControl" ;
19
19
20
- const Wrapper = styled . div < { $style : FloatButtonStyleType } > `
20
+ const Wrapper = styled . div < { $badgeStyle : BadgeStyleType , $ style : FloatButtonStyleType } > `
21
21
width: 0px;
22
22
height: 0px;
23
23
overflow: hidden;
@@ -29,6 +29,12 @@ const Wrapper = styled.div<{ $style: FloatButtonStyleType }>`
29
29
right: 0px;
30
30
inset-block-end: -8px;
31
31
}
32
+ .ant-float-btn-primary .ant-float-btn-body {
33
+ background-color: ${ ( props ) => props . $style . background } ;
34
+ border: ${ ( props ) => props . $style . border } ;
35
+ border-style: ${ ( props ) => props . $style . borderStyle } ;
36
+ border-width: ${ ( props ) => props . $style . borderWidth } ;
37
+ }
32
38
`
33
39
34
40
const buttonShapeOption = [
@@ -70,6 +76,7 @@ const childrenMap = {
70
76
includeMargin : BoolControl . DEFAULT_TRUE ,
71
77
image : StringControl ,
72
78
icon : withDefault ( IconControl , '/icon:antd/questioncircleoutlined' ) ,
79
+ badgeStyle : styleControl ( BadgeStyle ) ,
73
80
style : styleControl ( FloatButtonStyle ) ,
74
81
buttons : manualOptionsControl ( buttonGroupOption , {
75
82
initOptions : [
@@ -92,20 +99,20 @@ const FloatButtonView = (props: RecordConstructorToView<typeof childrenMap>) =>
92
99
onClick = { ( ) => button . onEvent ( "click" ) }
93
100
tooltip = { button ?. label }
94
101
description = { button ?. description }
95
- badge = { { count : button ?. badge , color : props . style . badgeColor , dot : props ?. dot } }
102
+ badge = { { count : button ?. badge , color : props . badgeStyle . badgeColor , dot : props ?. dot } }
96
103
type = { onlyOne ? props . buttonTheme : 'default' }
97
104
shape = { props . shape }
98
105
/> )
99
106
: ''
100
107
}
101
108
return (
102
- < Wrapper $style = { props . style } >
109
+ < Wrapper $badgeStyle = { props . badgeStyle } $ style= { props . style } >
103
110
{ props . buttons . length === 1 ? ( renderButton ( props . buttons [ 0 ] , true ) ) :
104
111
( < FloatButton . Group
105
112
trigger = "hover"
106
113
icon = { props . icon }
107
114
shape = { props . shape }
108
- badge = { { count : props . buttons . reduce ( ( sum , i ) => sum + ( i . buttonType === 'custom' && ! i . hidden ? i . badge : 0 ) , 0 ) , color : props . style . badgeColor , dot : props . dot } }
115
+ badge = { { count : props . buttons . reduce ( ( sum , i ) => sum + ( i . buttonType === 'custom' && ! i . hidden ? i . badge : 0 ) , 0 ) , color : props . badgeStyle . badgeColor , dot : props . dot } }
109
116
type = { props . buttonTheme }
110
117
>
111
118
{ props . buttons . map ( ( button : any ) => renderButton ( button ) ) }
@@ -129,6 +136,7 @@ let FloatButtonBasicComp = (function () {
129
136
< Section name = { sectionNames . layout } >
130
137
{ hiddenPropertyView ( children ) }
131
138
</ Section >
139
+ < Section name = { sectionNames . badgeStyle } > { children . badgeStyle . getPropertyView ( ) } </ Section >
132
140
< Section name = { sectionNames . style } > { children . style . getPropertyView ( ) } </ Section >
133
141
</ >
134
142
) )
0 commit comments