@@ -17,10 +17,10 @@ import { AutoHeightControl } from "comps/controls/autoHeightControl";
1717
1818import { useContext } from "react" ;
1919import { EditorContext } from "comps/editorState" ;
20+ import { useMergeCompStyles } from "@lowcoder-ee/index.sdk" ;
2021
2122type IProps = DividerProps & {
2223 $style : DividerStyleType ;
23- dashed : boolean ;
2424 $animationStyle :AnimationStyleType ;
2525} ;
2626
@@ -56,7 +56,6 @@ const StyledDivider = styled(Divider)<IProps>`
5656 .ant-divider-inner-text::before,
5757 .ant-divider-inner-text::after {
5858 border-block-start: ${ ( props ) => props . $style . borderWidth && props . $style . borderWidth !== "0px" ? props . $style . borderWidth : "1px" }
59- ${ ( props ) => props . dashed ? "dashed" : "solid" }
6059 ${ ( props ) => props . $style . border } !important;
6160 border-block-start-color: inherit;
6261 border-block-end: 0;
@@ -81,11 +80,10 @@ const StyledDivider = styled(Divider)<IProps>`
8180
8281const childrenMap = {
8382 title : StringControl ,
84- dashed : BoolControl ,
8583 align : alignControl ( ) ,
8684 autoHeight : withDefault ( AutoHeightControl , "fixed" ) ,
87- style : styleControl ( DividerStyle ) ,
88- animationStyle : styleControl ( AnimationStyle ) ,
85+ style : styleControl ( DividerStyle , 'style' ) ,
86+ animationStyle : styleControl ( AnimationStyle , 'animationStyle' ) ,
8987} ;
9088
9189function fixOldStyleData ( oldData : any ) {
@@ -104,12 +102,13 @@ function fixOldStyleData(oldData: any) {
104102
105103
106104// 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+
109109 return (
110110 < StyledDivider
111111 orientation = { props . align }
112- dashed = { props . dashed }
113112 $style = { props . style }
114113 $animationStyle = { props . animationStyle }
115114 >
@@ -138,10 +137,9 @@ const DividerTempComp = migrateOldData(
138137 label : trans ( "divider.align" ) ,
139138 radioButton : true ,
140139 } ) }
141- { children . autoHeight . getPropertyView ( ) }
140+ { /* { children.autoHeight.getPropertyView()} */ }
142141 </ Section >
143142 < Section name = { sectionNames . style } >
144- { children . dashed . propertyView ( { label : trans ( "divider.dashed" ) } ) }
145143 { children . style . getPropertyView ( ) }
146144 </ Section >
147145 < Section name = { sectionNames . animationStyle } hasTooltip = { true } >
@@ -153,7 +151,6 @@ const DividerTempComp = migrateOldData(
153151 ) ;
154152 } )
155153 . setExposeStateConfigs ( [
156- new NameConfig ( "dashed" , trans ( "divider.dashedDesc" ) ) ,
157154 new NameConfig ( "title" , trans ( "divider.titleDesc" ) ) ,
158155 new NameConfig ( "align" , trans ( "divider.alignDesc" ) ) ,
159156 NameConfigHidden ,
@@ -162,8 +159,9 @@ const DividerTempComp = migrateOldData(
162159 fixOldStyleData
163160) ;
164161
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