@@ -30,13 +30,11 @@ import { IForm } from "../formComp/formDataConstants";
3030import { SimpleNameComp } from "../simpleNameComp" ;
3131import {
3232 Button100 ,
33- ButtonCompWrapper ,
3433 ButtonStyleControl ,
3534} from "./videobuttonCompConstants" ;
3635import { RefControl } from "comps/controls/refControl" ;
3736import {
3837 AutoHeightControl ,
39- ImageStyleType ,
4038 heightCalculator ,
4139 widthCalculator ,
4240} from "@lowcoder-ee/index.sdk" ;
@@ -85,14 +83,6 @@ function getStyleIcon(style: any) {
8583 ` ;
8684}
8785
88- // const IconWrapper = styled.div<{ $styled: any }>`
89- // display: flex;
90- // svg {
91- // width: ${styled.width}px !important;
92- // height: ${styled.height}30px !important;
93- // }
94- // `;
95-
9686function getFormOptions ( editorState : EditorState ) {
9787 return editorState
9888 . uiCompInfoList ( )
@@ -186,7 +176,6 @@ function submitForm(editorState: EditorState, formName: string) {
186176
187177let ButtonTmpComp = ( function ( ) {
188178 const childrenMap = {
189- text : withDefault ( StringControl , trans ( "button.button" ) ) ,
190179 iconSize : withDefault ( StringControl , "20px" ) ,
191180 type : dropdownControl ( typeOptions , "" ) ,
192181 autoHeight : withDefault ( AutoHeightControl , "fixed" ) ,
@@ -195,7 +184,6 @@ let ButtonTmpComp = (function () {
195184 loading : BoolCodeControl ,
196185 form : SelectFormControl ,
197186 prefixIcon : IconControl ,
198- suffixIcon : IconControl ,
199187 style : ButtonStyleControl ,
200188 viewRef : RefControl < HTMLElement > ,
201189 } ;
@@ -209,39 +197,23 @@ let ButtonTmpComp = (function () {
209197 useEffect ( ( ) => {
210198 if ( height && width ) {
211199 onResize ( ) ;
212- console . log ( "props" , props , height , width ) ;
213200 }
214201 } , [ height , width ] ) ;
215202
216203 const setStyle = ( height : string , width : string ) => {
217- console . log ( width , height ) ;
218-
219204 const img = imgRef . current ;
220205
221206 const imgDiv = img ?. getElementsByTagName ( "button" ) [ 0 ] ;
222- console . log ( "img 1" , img ) ;
223207 const imgCurrent = img ?. getElementsByTagName ( "button" ) [ 0 ] ;
224- console . log ( "img 2" , imgCurrent ) ;
225208 img ! . style . height = height ;
226209 img ! . style . width = width ;
227210 imgDiv ! . style . height = height ;
228211 imgDiv ! . style . width = width ;
229- // imgCurrent!.style.height = height;
230- // imgCurrent!.style.width = width;
231212 } ;
232213
233214 const onResize = ( ) => {
234215 const img = imgRef . current ;
235- console . log ( "img" , img ) ;
236216 const container = conRef . current ;
237- // console.log("img", container);
238- console . log (
239- "img" ,
240- ! img ?. clientWidth ,
241- ! img ?. clientHeight ,
242- props . autoHeight ,
243- ! width
244- ) ;
245217 if (
246218 ! img ?. clientWidth ||
247219 ! img ?. clientHeight ||
@@ -250,20 +222,12 @@ let ButtonTmpComp = (function () {
250222 ) {
251223 return ;
252224 }
253- // fixme border style bug on safari
254- // if (
255- // (_.divide(container?.clientWidth!, container?.clientHeight!) || 0) >
256- // (_.divide(Number(width), Number(height)) || 0)
257- // ) {
258- // setStyle("100%", "auto");
259- // } else {
260225 console . log (
261226 container ?. clientHeight + "px" ,
262227 container ?. clientWidth + "px"
263228 ) ;
264229
265230 setStyle ( container ?. clientHeight + "px" , container ?. clientWidth + "px" ) ;
266- // }
267231 } ;
268232
269233 return (
@@ -318,7 +282,6 @@ let ButtonTmpComp = (function () {
318282 . setPropertyViewFn ( ( children ) => (
319283 < >
320284 < Section name = { sectionNames . basic } >
321- { children . text . propertyView ( { label : trans ( "text" ) } ) }
322285 { children . autoHeight . getPropertyView ( ) }
323286 </ Section >
324287 < Section name = { sectionNames . interaction } >
@@ -339,9 +302,6 @@ let ButtonTmpComp = (function () {
339302 { children . prefixIcon . propertyView ( {
340303 label : trans ( "button.prefixIcon" ) ,
341304 } ) }
342- { children . suffixIcon . propertyView ( {
343- label : trans ( "button.suffixIcon" ) ,
344- } ) }
345305 { children . iconSize . propertyView ( {
346306 label : trans ( "meeting.iconSize" ) ,
347307 } ) }
@@ -360,7 +320,6 @@ ButtonTmpComp = class extends ButtonTmpComp {
360320 }
361321} ;
362322export const ControlButton = withExposingConfigs ( ButtonTmpComp , [
363- new NameConfig ( "text" , trans ( "button.textDesc" ) ) ,
364323 new NameConfig ( "loading" , trans ( "button.loadingDesc" ) ) ,
365324 ...CommonNameConfig ,
366325] ) ;
0 commit comments