6
6
UICompBuilder ,
7
7
Section ,
8
8
} from "lowcoder-sdk" ;
9
- import { PlusOutlined } from "@ant-design/icons" ;
10
9
import { useResizeDetector } from "react-resize-detector" ;
11
10
import styled from "styled-components" ;
12
11
@@ -69,13 +68,13 @@ export default new UICompBuilder(
69
68
} ;
70
69
data : any [ ] | null | undefined ;
71
70
autoHeight : boolean ;
71
+ autoWidth : boolean ;
72
72
} ) => {
73
- const [ parcelValues , setParcelValues ] = useState ( [
74
- { parcel : "" , pieces : 0 , carat : 0 } ,
75
- ] ) ;
73
+ const value = { parcel : "" , pieces : 0 , carat : 0 } ;
74
+ const [ parcelValues , setParcelValues ] = useState ( [ { ...value } ] ) ;
76
75
let handleChange = ( i : number ) => {
77
76
if ( i === parcelValues . length - 1 ) {
78
- setParcelValues ( [ ...parcelValues , { parcel : "" , pieces : 0 , carat : 0 } ] ) ;
77
+ setParcelValues ( [ ...parcelValues , { ... value } ] ) ;
79
78
}
80
79
} ;
81
80
@@ -99,22 +98,7 @@ export default new UICompBuilder(
99
98
} ) ;
100
99
101
100
return (
102
- /* <div
103
- className={styles.wrapper}
104
- style={{
105
- height: "100%",
106
- width: "100%",
107
- backgroundColor: `${props.styles.backgroundColor}`,
108
- borderColor: `${props.styles.border}`,
109
- borderRadius: `${props.styles.radius}`,
110
- borderWidth: `${props.styles.borderWidth}`,
111
- margin: `${props.styles.margin}`,
112
- padding: `${props.styles.padding}`,
113
- fontSize: `${props.styles.textSize}`,
114
- }}
115
- ref={conRef}
116
- > */
117
- < Container $styles = { props . styles } >
101
+ < Container ref = { conRef } $styles = { props . styles } >
118
102
{ parcelValues . map ( ( el , i ) => (
119
103
< StoneParcel
120
104
key = { i }
@@ -123,11 +107,6 @@ export default new UICompBuilder(
123
107
onHandleChange = { handleChange }
124
108
/>
125
109
) ) }
126
- { /* <antd.Button
127
- type="primary"
128
- shape="circle"
129
- icon={<PlusOutlined />}
130
- ></antd.Button> */ }
131
110
</ Container >
132
111
) ;
133
112
} ,
@@ -145,20 +124,15 @@ export default new UICompBuilder(
145
124
. build ( ) ;
146
125
147
126
const Container = styled . div < { $styles : any } > `
148
- display: flex;
149
- flex-direction: column;
150
- justify-content: center;
151
- align-items: center;
152
127
height: 100%;
153
128
width: 100%;
154
- padding: 5px;
155
129
margin: ${ ( props ) => props . $styles . margin } ;
156
130
padding: ${ ( props ) => props . $styles . padding } ;
157
131
font-size: ${ ( props ) => props . $styles . textSize } ;
158
- /* background-color: ${ ( props ) => props . $styles . backgroundColor } ;
132
+ background-color: ${ ( props ) => props . $styles . backgroundColor } ;
159
133
border-color: ${ ( props ) => props . $styles . border } ;
160
134
border-radius: ${ ( props ) => props . $styles . radius } ;
161
- border-width: ${ ( props ) => props . $styles . borderWidth } ;*/
162
- border: 1px solid #ddd;
163
- background-color: white;
135
+ border-width: ${ ( props ) => props . $styles . borderWidth } ;
136
+ /* border: 1px solid #ddd;
137
+ background-color: white; */
164
138
` ;
0 commit comments