Skip to content

Commit 7c776a9

Browse files
committed
fix(Form): 增加TreeSelect & Picker
1 parent c9c492a commit 7c776a9

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

example/examples/src/routes/Form/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ const FormDemo = () => {
8585
attr: {
8686
showClear: true,
8787
labelInValue: true,
88+
placeholder: '请选择',
8889
},
89-
placeholder: '请输入',
9090
},
9191
{
9292
type: 'stepper',
@@ -153,6 +153,7 @@ const FormDemo = () => {
153153
{label: '4', value: '4'},
154154
],
155155
showClear: true,
156+
placeholder: '请选择',
156157
},
157158
},
158159
{

example/examples/src/routes/SearchBar/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ const SearchBarDemo = (props: ComProps) => {
4040
labelInValue
4141
options={data}
4242
onChange={val => console.log('val', val)}
43-
placeholderColor="#333"
4443
placeholder="请输入"
4544
/>
4645
</SafeAreaView>

packages/core/src/Form/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export default FormDemo
326326
| 参数 | 说明 | 类型 | 默认值 |
327327
|------|------|-----|------|
328328
| `field` | 字段名 | string | - |
329-
| `type` | 字段类型(`input` \| `textArea` \| `slider` \| `rate` \| `radio` \| `search`\| `switch`\| `checkBox`\| `stepper`\| `cardList`) | string | - |
329+
| `type` | 字段类型(`input` \| `textArea` \| `slider` \| `rate` \| `radio` \| `search`\| `switch`\| `checkBox`\| `stepper`\| `picker`\| `treeSelect`\ | `cardList`) | string | - |
330330
| `name` | 标签名 | string | - |
331331
| `validate` | 验证规则 | RulesOption['validate'] | - |
332332
| `options` | 集合 | Array<{ label: string; value: KeyType }> | - |

packages/core/src/SearchBar/index.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,10 @@ function SearchBar({
5959
...searchInputBarProps
6060
}: SearchBarProps) {
6161
const theme = useTheme<Theme>();
62-
6362
const styles = createStyles({
6463
maskBgColor: theme.colors.mask || '#F5F5F5',
6564
bgColor: theme.colors.background || '#F5F5F5',
6665
disabledColor: theme.colors.disabled || '#F5F5F5',
67-
contentColor: theme.colors.background || '#000',
6866
iconColor: theme.colors.primary_text || '#fff',
6967
cancelColor: theme.colors.primary_text || '#7C7D7E',
7068
});
@@ -96,10 +94,14 @@ function SearchBar({
9694
setVisivble(true);
9795
};
9896

97+
const placeholderStyle = placeholderColor ? { color: placeholderColor } : {};
98+
9999
return !visible ? (
100100
<Pressable onPress={showSearchBar}>
101101
<View style={[disabled ? styles.disabled : styles.content, contentStyle]}>
102-
<Text style={[styles.contentTitle, { color: placeholderColor }]}>{textValue ? textValue : placeholder}</Text>
102+
<Text color="text" style={{ fontSize: 16, ...placeholderStyle }}>
103+
{textValue ? textValue : placeholder}
104+
</Text>
103105
{React.isValidElement(extra) ? (
104106
extra
105107
) : curValue && showClear ? (
@@ -178,22 +180,17 @@ export default memo(SearchBar);
178180
type CreStyle = {
179181
bgColor: string;
180182
maskBgColor: string;
181-
contentColor: string;
182183
disabledColor: string;
183184
iconColor: string;
184185
cancelColor: string;
185186
};
186187

187-
function createStyles({ maskBgColor, bgColor, contentColor, disabledColor, iconColor, cancelColor }: CreStyle) {
188+
function createStyles({ maskBgColor, bgColor, disabledColor, iconColor, cancelColor }: CreStyle) {
188189
return StyleSheet.create({
189190
container: {
190191
flex: 1,
191192
backgroundColor: bgColor,
192193
},
193-
contentTitle: {
194-
fontSize: 16,
195-
color: contentColor,
196-
},
197194
icon: {
198195
backgroundColor: iconColor,
199196
paddingLeft: 10,

0 commit comments

Comments
 (0)