Skip to content

Commit 5426656

Browse files
author
Yofriadi Yahya
committed
saving
1 parent 48c45a4 commit 5426656

File tree

3 files changed

+14
-49
lines changed

3 files changed

+14
-49
lines changed

lowcoder-comp-stone-parcel-input/src/StoneParcelComp.tsx

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
UICompBuilder,
77
Section,
88
} from "lowcoder-sdk";
9-
import { PlusOutlined } from "@ant-design/icons";
109
import { useResizeDetector } from "react-resize-detector";
1110
import styled from "styled-components";
1211

@@ -69,13 +68,13 @@ export default new UICompBuilder(
6968
};
7069
data: any[] | null | undefined;
7170
autoHeight: boolean;
71+
autoWidth: boolean;
7272
}) => {
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 }]);
7675
let handleChange = (i: number) => {
7776
if (i === parcelValues.length - 1) {
78-
setParcelValues([...parcelValues, { parcel: "", pieces: 0, carat: 0 }]);
77+
setParcelValues([...parcelValues, { ...value }]);
7978
}
8079
};
8180

@@ -99,22 +98,7 @@ export default new UICompBuilder(
9998
});
10099

101100
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}>
118102
{parcelValues.map((el, i) => (
119103
<StoneParcel
120104
key={i}
@@ -123,11 +107,6 @@ export default new UICompBuilder(
123107
onHandleChange={handleChange}
124108
/>
125109
))}
126-
{/* <antd.Button
127-
type="primary"
128-
shape="circle"
129-
icon={<PlusOutlined />}
130-
></antd.Button> */}
131110
</Container>
132111
);
133112
},
@@ -145,20 +124,15 @@ export default new UICompBuilder(
145124
.build();
146125

147126
const Container = styled.div<{ $styles: any }>`
148-
display: flex;
149-
flex-direction: column;
150-
justify-content: center;
151-
align-items: center;
152127
height: 100%;
153128
width: 100%;
154-
padding: 5px;
155129
margin: ${(props) => props.$styles.margin};
156130
padding: ${(props) => props.$styles.padding};
157131
font-size: ${(props) => props.$styles.textSize};
158-
/*background-color: ${(props) => props.$styles.backgroundColor};
132+
background-color: ${(props) => props.$styles.backgroundColor};
159133
border-color: ${(props) => props.$styles.border};
160134
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; */
164138
`;

lowcoder-comp-stone-parcel-input/src/styles.module.css

Lines changed: 0 additions & 9 deletions
This file was deleted.

lowcoder-comp-stone-parcel-input/src/vendors/StoneParcel.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,14 @@ const Row = styled.div`
101101
width: 100%;
102102
flex-grow: 1;
103103
width: 100%;
104-
margin: 7px;
104+
margin: 11px;
105105
height: calc(100% - 4px);
106106
align-items: start;
107107
flex-shrink: 0;
108+
109+
span:nth-child(n + 2) {
110+
display: none;
111+
}
108112
`;
109113

110114
const Wrapper = styled.div`
@@ -121,10 +125,6 @@ const Label = styled.span`
121125
cursor: default;
122126
}
123127
124-
&:nth-child(n + 2) {
125-
display: none;
126-
}
127-
128128
/**
129129
* add this for tooltip
130130
background-image: linear-gradient(to right, #8b8fa3 50%, #fff 0%); */

0 commit comments

Comments
 (0)