@@ -17,10 +17,10 @@ import { AutoHeightControl } from "comps/controls/autoHeightControl";
17
17
18
18
import { useContext } from "react" ;
19
19
import { EditorContext } from "comps/editorState" ;
20
+ import { useMergeCompStyles } from "@lowcoder-ee/index.sdk" ;
20
21
21
22
type IProps = DividerProps & {
22
23
$style : DividerStyleType ;
23
- dashed : boolean ;
24
24
$animationStyle :AnimationStyleType ;
25
25
} ;
26
26
@@ -56,7 +56,6 @@ const StyledDivider = styled(Divider)<IProps>`
56
56
.ant-divider-inner-text::before,
57
57
.ant-divider-inner-text::after {
58
58
border-block-start: ${ ( props ) => props . $style . borderWidth && props . $style . borderWidth !== "0px" ? props . $style . borderWidth : "1px" }
59
- ${ ( props ) => props . dashed ? "dashed" : "solid" }
60
59
${ ( props ) => props . $style . border } !important;
61
60
border-block-start-color: inherit;
62
61
border-block-end: 0;
@@ -81,11 +80,10 @@ const StyledDivider = styled(Divider)<IProps>`
81
80
82
81
const childrenMap = {
83
82
title : StringControl ,
84
- dashed : BoolControl ,
85
83
align : alignControl ( ) ,
86
84
autoHeight : withDefault ( AutoHeightControl , "fixed" ) ,
87
- style : styleControl ( DividerStyle ) ,
88
- animationStyle : styleControl ( AnimationStyle ) ,
85
+ style : styleControl ( DividerStyle , 'style' ) ,
86
+ animationStyle : styleControl ( AnimationStyle , 'animationStyle' ) ,
89
87
} ;
90
88
91
89
function fixOldStyleData ( oldData : any ) {
@@ -104,12 +102,13 @@ function fixOldStyleData(oldData: any) {
104
102
105
103
106
104
// Compatible with historical style data 2022-8-26
107
- const DividerTempComp = migrateOldData (
108
- new UICompBuilder ( childrenMap , ( props ) => {
105
+ export const DividerComp = migrateOldData (
106
+ new UICompBuilder ( childrenMap , ( props , dispatch ) => {
107
+ useMergeCompStyles ( props as Record < string , any > , dispatch ) ;
108
+
109
109
return (
110
110
< StyledDivider
111
111
orientation = { props . align }
112
- dashed = { props . dashed }
113
112
$style = { props . style }
114
113
$animationStyle = { props . animationStyle }
115
114
>
@@ -138,10 +137,9 @@ const DividerTempComp = migrateOldData(
138
137
label : trans ( "divider.align" ) ,
139
138
radioButton : true ,
140
139
} ) }
141
- { children . autoHeight . getPropertyView ( ) }
140
+ { /* { children.autoHeight.getPropertyView()} */ }
142
141
</ Section >
143
142
< Section name = { sectionNames . style } >
144
- { children . dashed . propertyView ( { label : trans ( "divider.dashed" ) } ) }
145
143
{ children . style . getPropertyView ( ) }
146
144
</ Section >
147
145
< Section name = { sectionNames . animationStyle } hasTooltip = { true } >
@@ -153,7 +151,6 @@ const DividerTempComp = migrateOldData(
153
151
) ;
154
152
} )
155
153
. setExposeStateConfigs ( [
156
- new NameConfig ( "dashed" , trans ( "divider.dashedDesc" ) ) ,
157
154
new NameConfig ( "title" , trans ( "divider.titleDesc" ) ) ,
158
155
new NameConfig ( "align" , trans ( "divider.alignDesc" ) ) ,
159
156
NameConfigHidden ,
@@ -162,8 +159,9 @@ const DividerTempComp = migrateOldData(
162
159
fixOldStyleData
163
160
) ;
164
161
165
- export const DividerComp = class extends DividerTempComp {
166
- override autoHeight ( ) : boolean {
167
- return this . children . autoHeight . getView ( ) ;
168
- }
169
- } ;
162
+ // export const DividerComp
163
+ // = class extends DividerTempComp {
164
+ // override autoHeight(): boolean {
165
+ // return this.children.autoHeight.getView();
166
+ // }
167
+ // };
0 commit comments