Skip to content

Commit 26ff9c5

Browse files
author
rulishu
committed
Merge branch 'dev' of github.com:uiwjs/react-native-uiw into rls
2 parents 1ccc96a + 0ef5449 commit 26ff9c5

File tree

16 files changed

+20621
-169
lines changed

16 files changed

+20621
-169
lines changed

packages/core/src/ActionSheet/README.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,33 +54,26 @@ export default Demo
5454

5555
### Props
5656

57-
```js
58-
import { StyleProp, ViewStyle } from 'react-native';
59-
import { ModalProps } from '@uiw/react-native';
60-
61-
export interface DividerStyle {
62-
itemDivider?: StyleProp<ViewStyle>,
63-
actionDivider?: StyleProp<ViewStyle>,
64-
}
65-
```
66-
6757
| 参数 | 说明 | 类型 | 默认值 |
6858
|------|------|-----|------|
6959
| onCancel | 点击蒙层是否关闭 | Boolean | `false` |
70-
| dividerStyle | 分割线样式 | DividerStyle | - |
71-
| containerStyle | 取消的容器样式 | StyleProp<ViewStyle> | - |
60+
| dividerStyle | 分割线样式 | DividerStyleProps | - |
61+
| containerStyle | 取消的容器样式 | StyleProp<`ViewStyle`> | - |
7262
| activeOpacity | 动作在被触摸操作激活时以多少不透明度显示 | number | `#f1f1f1` |
7363
| underlayColor | 动作有触摸操作时显示出来的底层的颜色 | string | `#f1f1f1` |
7464
| cancelText | 取消的文本 | `React.ReactNode` | - |
7565
| textStyle | 取消的文本样式 | `StyleProp<TextStyle>` | - |
7666

77-
### ActionSheetItem Props
78-
```js
79-
import { TextStyle, StyleProp, ViewStyle } from 'react-native';
80-
```
67+
### DividerStyleProps
68+
| 参数 | 说明 | 类型 | 默认值 |
69+
|------|------|-----|------|
70+
| itemDivider | - | StyleProp<`ViewStyle`> | `false` |
71+
| actionDivider | - | StyleProp<`ViewStyle`> | - |
8172

73+
### ActionSheetItemProps
8274
| 参数 | 说明 | 类型 | 默认值 |
8375
|------|------|-----|------|
8476
| containerStyle | 容器样式 | `StyleProp<ViewStyle>` | - |
8577
| textStyle | 文本样式 | `StyleProp<ViewStyle>` | - |
8678
| onPress | 点击 ActionSheetItem 触发的事件 | `(event: GestureResponderEvent) => void` | - |
79+

packages/core/src/Avatar/README.md

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,15 @@ export default Demo
2626

2727
```
2828

29-
### props
29+
### Props
3030

3131
继承 [View](https://facebook.github.io/react-native/docs/view#props) 组件。
3232

33-
```ts
34-
import { ViewProps } from 'react-native';
35-
36-
export interface AvatarProps extends ViewProps {
37-
/** React Native `Image` 组件 Props */
38-
imageProps?: ImageProps;
39-
/** 图像源(远程URL或本地文件资源)。 */
40-
src?: string | number;
41-
/**
42-
* 尺寸
43-
* @default 40
44-
*/
45-
size?: number;
46-
/**
47-
* 设置圆角
48-
* @default 3
49-
*/
50-
rounded?: number;
51-
/**
52-
* 指定头像的形状
53-
* @default square
54-
*/
55-
shape?: 'circle' | 'square';
56-
}
57-
```
33+
34+
| 参数 | 说明 | 类型 | 默认值 |
35+
|------|------|-----|------|
36+
| `imageProps` | React Native `Image` 组件 Props | obj | - |
37+
| `src` | 图像源(远程URL或本地文件资源) | `string|number` | - |
38+
| `size` | 尺寸 | number | - |
39+
| `rounded` | 设置圆角 | number | - |
40+
| `shape` |指定头像的形状 | `circle|square` | - |

packages/core/src/Badge/README.md

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,11 @@ export default Demo;
4747

4848
继承 [View](https://facebook.github.io/react-native/docs/view#props) 组件。
4949

50-
```ts
51-
import { ViewProps } from 'react-native';
52-
53-
export interface BadgeProps extends ViewProps {
54-
children?: React.ReactNode;
55-
/** 标记颜色 */
56-
color?: colors.Colors | string;
57-
/** 文本内容 */
58-
text?: string | Element;
59-
/**
60-
* 设置圆角,默认 `12`
61-
*/
62-
rounded?: number;
63-
/** 设置类型 */
64-
type?: 'dot' | 'text';
65-
/** 文本样式 */
66-
textStyles?: StyleProp<TextStyle>;
67-
}
68-
```
50+
| 属性 | 说明 | 类型 | 默认值 |
51+
| --- | --- | --- | --- |
52+
| color | 标记颜色 | `colors.Colors \| string` | - |
53+
| text | 文本内容 | `string \| Element` | - |
54+
| rounded | 设置圆角 | `boolean \| number` | `12` |
55+
| textStyles | 文本样式 | `StyleProp<TextStyle>` | - |
56+
| type | 设置类型 | `'dot' \| 'text'` | - |
57+
| children | 更多内容 | `React.ReactNode` | - |

packages/core/src/Flex/README.md

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -74,39 +74,11 @@ export default Demo
7474
```
7575

7676
### Props
77-
78-
### Flex
79-
80-
```ts
81-
export interface FlexProps extends ViewProps {
82-
/**
83-
* 项目定位方向
84-
* `row`, `column`, `row-reverse`, `column-reverse`
85-
* @default row
86-
*/
87-
direction?: FlexStyle['flexDirection'];
88-
/**
89-
* 子元素在主轴上的对齐方式
90-
* @default start
91-
*/
92-
justify?: 'start' | 'end' | 'center' | 'between' | 'around';
93-
/**
94-
* 子元素在交叉轴上的对齐方式
95-
* @default start
96-
*/
97-
align?: 'start' | 'end' | 'center' | 'stretch' | 'baseline';
98-
/**
99-
* 子元素的换行方式
100-
* @default nowrap
101-
*/
102-
wrap?: 'wrap' | 'nowrap' | 'wrap-reverse';
103-
}
104-
```
105-
106-
### Flex.Item
107-
10877
继承 [View](https://facebook.github.io/react-native/docs/view#props) 组件。
10978

110-
```ts
111-
export interface FlexItemProps extends ViewProps {}
112-
```
79+
| 参数 | 说明 | 类型 | 默认值 |
80+
|------|------|-----|------|
81+
| `direction` | 项目定位方向 | `row` \| `column` \| `row-reverse` \| `column-reverse` | row |
82+
| `justify` | 子元素在主轴上的对齐方式 | `start` \| `end` \| `center` \| `between` \| `around` | start |
83+
| `align` | 子元素在交叉轴上的对齐方式 | `start` \| `end` \| `center` \| `stretch` \| `baseline` | start |
84+
| `wrap` | 子元素的换行方式 | `wrap` \| `nowrap` \| `wrap-reverse` | nowrap |

packages/core/src/Radio/index.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,21 @@ export default class Radio extends Component<RadioProps, RadioState> {
132132
const backgroundColor = disabled ? color : checkedColor;
133133
const borderColor = disabled ? color : bdColor;
134134
return (
135-
<View style={[styles.defalut, style]} {...otherProps}>
136-
<TouchableOpacity disabled={disabled} style={[styles.touch]} onPress={this.handlePress}>
137-
<Animated.View style={[styles.checkBg, { width: circleSize, height: circleSize, borderColor }]}>
138-
<Animated.View style={[styles.check, { width: sizeValue, height: sizeValue, backgroundColor }]} />
135+
<View testID="RNE__Radio__wrap" style={[styles.defalut, style]} {...otherProps}>
136+
<TouchableOpacity
137+
disabled={disabled}
138+
style={[styles.touch]}
139+
onPress={this.handlePress}
140+
testID="RNE__Radio__view"
141+
>
142+
<Animated.View
143+
style={[styles.checkBg, { width: circleSize, height: circleSize, borderColor }]}
144+
testID="RNE__Radio__border"
145+
>
146+
<Animated.View
147+
style={[styles.check, { width: sizeValue, height: sizeValue, backgroundColor }]}
148+
testID="RNE__Radio__box"
149+
/>
139150
</Animated.View>
140151
{this.props.children && (
141152
<MaybeTextOrView

packages/core/src/Rating/README.md

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -97,34 +97,15 @@ export default Demo
9797

9898
### Props
9999

100-
```ts
101-
import { TabsItemIconTypes } from '@uiw/react-native'
102-
103-
export type icoType = [TabsItemIconTypes, TabsItemIconTypes]
104-
export interface RatingProps {
105-
/** 默认选中几个 */
106-
defaultRating?: number;
107-
/** 总数*/
108-
resultRating?: number;
109-
/** icon 大小 */
110-
size?: number;
111-
/** icon 颜色 */
112-
color?: string;
113-
/** actived 激活 unactived 未激活 */
114-
icon?: {
115-
actived?: TabsItemIconTypes,
116-
unactived?: TabsItemIconTypes
117-
};
118-
/**
119-
* void
120-
* @param score type: number 选中几个
121-
*/
122-
onPress?: (score: number) => void;
123-
/** 自定义每项的提示信息 */
124-
tooltips?: string[];
125-
/** 自定义提示信息样式 */
126-
tooltipsStyle?: StyleProp<TextStyle>;
127-
/** 只读模式 */
128-
disabled: boolean
129-
}
130-
```
100+
101+
| 参数 | 说明 | 类型 | 默认值 |
102+
|------|------|-----|------|
103+
| `defaultRating` | 默认选中几个 | number | - |
104+
| `resultRating` | 总数 | number | - |
105+
| `size` | icon 大小 | number | - |
106+
| `color` | icon 颜色 | string | - |
107+
| `icon` | `actived` 激活 `unactived` 未激活 | obj | - |
108+
| `onPress` | 选中事件 | fn | - |
109+
| `tooltips` | 自定义每项的提示信息 | arr | - |
110+
| `resultRating` | 只读模式 | boolean | - |
111+

packages/core/src/SearchBar/README.md

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,25 @@ export default Demo
2626

2727
```
2828

29-
### props
30-
31-
```ts
32-
interface OptionsState {
33-
label: string;
34-
value: string | number;
35-
}
36-
37-
interface SearchBarProps {
38-
/** 搜索框文字变化 */
39-
onChangeText?: (value: string) => void;
40-
/** 数据化配置选项内容,相比 jsx 定义会获得更好的渲染性能 */
41-
options?: Array<OptionsState>;
42-
/** 事件变化回调 */
43-
onChange?: (value: string | null) => void;
44-
/** 获得焦点时回调 */
45-
onFocus?: (e: any | string) => void;
46-
/** 是否把每个选项的 label 包装到 value 中,会把 Select 的 value 类型从 string 变为 { key: string, label: ReactNode } 的格式 */
47-
labelInValue?: Boolean;
48-
/** 是否禁用 */
49-
disabled?: Boolean;
50-
/***/
51-
value?: String;
52-
/** 加载中状态 */
53-
loading?: Boolean;
54-
/** 搜索框默认文本 */
55-
placeholder?: String;
56-
/** 图标 */
57-
extra?: JSX.Element;
58-
/** 是否展示清楚图标 */
59-
showClear?: boolean;
60-
}
61-
```
29+
### Props
30+
31+
| 参数 | 说明 | 类型 | 默认值 |
32+
|------|------|-----|------|
33+
| onChangeText | 搜索框文字变化 | (value: string) => void | - |
34+
| options | 数据化配置选项内容,相比 jsx 定义会获得更好的渲染性能 | Array<`OptionsStateProps`> | - |
35+
| onChange | 事件变化回调 | string | (value: string) => void |
36+
| onFocus | 获得焦点时回调 null = 永不显示 | (e: any) => void | - |
37+
| labelInValue | 是否把每个选项的 label 包装到 value 中,会把 Select 的 value 类型从 string 变为 { key: string, label: ReactNode } 的格式 | Boolean | - |
38+
| disabled | 是否禁用 | Boolean | - |
39+
| value || String | - |
40+
| loading | 加载中状态 | Boolean | - |
41+
| placeholder | 搜索框默认文本 | String | - |
42+
| extra | 图标 | JSX.Element | - |
43+
| showClear | 是否展示清楚图标 | boolean | - |
44+
45+
### OptionsStateProps
46+
47+
| 参数 | 说明 | 类型 | 默认值 |
48+
|------|------|-----|------|
49+
| label || string | - |
50+
| value || `string` \| `number` | - |

packages/core/src/SwipeAction/README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,66 @@ import React,{ useRef } from 'react';
4141
import {SwipeAction} from '@uiw/react-native';
4242
import { View,Text } from 'react-native'
4343

44+
function Demo() {
45+
const ref = useRef()
46+
const right = [
47+
{
48+
text: '查看',
49+
color: 'orange',
50+
x: 250,
51+
},
52+
{
53+
text: '删除',
54+
color: 'red',
55+
x: 250,
56+
},
57+
];
58+
return (
59+
<SwipeAction ref={ref} buttonWidth={60} right={right}>
60+
<View><Text>滑动</Text></View>
61+
</SwipeAction>
62+
);
63+
}
64+
export default Demo;
65+
```
66+
67+
### 禁用
68+
69+
```jsx
70+
import React,{ useRef } from 'react';
71+
import {SwipeAction} from '@uiw/react-native';
72+
import { View,Text } from 'react-native'
73+
74+
function Demo() {
75+
const ref = useRef()
76+
const right = [
77+
{
78+
text: '查看',
79+
color: 'orange',
80+
x: 250,
81+
},
82+
{
83+
text: '删除',
84+
color: 'red',
85+
x: 250,
86+
},
87+
];
88+
return (
89+
<SwipeAction ref={ref} buttonWidth={60} right={right}>
90+
<View><Text>滑动</Text></View>
91+
</SwipeAction>
92+
);
93+
}
94+
export default Demo;
95+
```
96+
97+
### 禁用
98+
99+
```jsx
100+
import React,{ useRef } from 'react';
101+
import {SwipeAction} from '@uiw/react-native';
102+
import { View,Text } from 'react-native'
103+
44104
function Demo() {
45105
const ref = useRef()
46106
const right = [

0 commit comments

Comments
 (0)