Skip to content

Commit 8e2776f

Browse files
committed
fix:pull master
2 parents 4dcd2fb + 0c14bdf commit 8e2776f

File tree

14 files changed

+835
-333
lines changed

14 files changed

+835
-333
lines changed

packages/core/src/Avatar/README.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,28 @@ function Demo() {
2626

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

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

packages/core/src/Avatar/index.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,24 @@ const styles = StyleSheet.create({
1515
const defaultImage = require('./assets/user.png');
1616

1717
export interface AvatarProps extends ViewProps {
18+
/** React Native `Image` 组件 Props */
1819
imageProps?: ImageProps;
20+
/** 图像源(远程URL或本地文件资源)。 */
1921
src?: string | number;
22+
/**
23+
* 尺寸
24+
* @default 40
25+
*/
2026
size?: number;
27+
/**
28+
* 设置圆角
29+
* @default 3
30+
*/
2131
rounded?: number;
32+
/**
33+
* 指定头像的形状
34+
* @default square
35+
*/
2236
shape?: 'circle' | 'square';
2337
}
2438

packages/core/src/Badge/README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,26 @@ function Demo() {
1717
}
1818
```
1919

20-
## props
20+
## Props
2121

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

24-
| 参数 | 说明 | 类型 | 默认值 |
25-
|------|------|-----|------|
26-
| `text` | 文本内容 | String | - |
27-
| `color` | 标记颜色 | String | - |
28-
| `rounded` | 设置圆角 | Number | `5` |
29-
| `textStyles` | 文本样式 | String | - |
24+
```ts
25+
import { ViewProps } from 'react-native';
26+
27+
export interface BadgeProps extends ViewProps {
28+
children?: React.ReactNode;
29+
/** 标记颜色 */
30+
color?: colors.Colors | string;
31+
/** 文本内容 */
32+
text?: string | Element;
33+
/**
34+
* 设置圆角,默认 `12`
35+
*/
36+
rounded?: number;
37+
/** 设置类型 */
38+
type?: 'dot' | 'text';
39+
/** 文本样式 */
40+
textStyles?: StyleProp<TextStyle>;
41+
}
42+
```

packages/core/src/Badge/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,17 @@ const styles = StyleSheet.create({
2626

2727
export interface BadgeProps extends ViewProps {
2828
children?: React.ReactNode;
29+
/** 标记颜色 */
2930
color?: colors.Colors | string;
31+
/** 文本内容 */
3032
text?: string | Element;
3133
/**
3234
* 设置圆角,默认 `12`
3335
*/
3436
rounded?: number;
37+
/** 设置类型 */
3538
type?: 'dot' | 'text';
39+
/** 文本样式 */
3640
textStyles?: StyleProp<TextStyle>;
3741
}
3842

packages/core/src/Empty/README.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,27 @@ class Demo extends Component {
129129

130130
## Props
131131

132-
| 参数 | 说明 | 类型 | 默认值 |
133-
|------|------|-----|------|
134-
| `label` | 设置提示文本 | String | `暂无数据` |
135-
| `children` | 不光提示文本,还有更多内容,`label` 将不起作用 | ReactNode | - |
136-
| `labelStyle` | 设置提示文本样式 | TextProps['style'] | - |
137-
| `size` | 图标大小 | Number | `64` |
138-
| `xml` | 传递 SVG xml 字符串,自定义图标,设为 `null` 将不展示图标。 | String | - |
132+
```ts
133+
export interface EmptyProps extends FlexProps {
134+
/**
135+
* 设置提示文本
136+
*/
137+
label?: string;
138+
/**
139+
* 设置提示音样式
140+
*/
141+
labelStyle?: TextProps['style'];
142+
/**
143+
* 设置 图标尺寸
144+
*/
145+
size?: number;
146+
/**
147+
* 传递 SVG xml 字符串,自定义图标,设为 `null` 将不展示图标。
148+
*/
149+
xml?: string;
150+
/**
151+
* 不光提示文本,还有更多内容,`label` 将不起作用
152+
*/
153+
children?: React.ReactNode;
154+
}
155+
```

packages/core/src/Empty/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const iconStr = `
1717

1818
export interface EmptyProps extends FlexProps {
1919
/**
20-
* 设置提示语
20+
* 设置提示文本
2121
*/
2222
label?: string;
2323
/**
@@ -29,11 +29,11 @@ export interface EmptyProps extends FlexProps {
2929
*/
3030
size?: number;
3131
/**
32-
* 替换默认的图标 这里是 SVG string
32+
* 传递 SVG xml 字符串,自定义图标,设为 `null` 将不展示图标。
3333
*/
3434
xml?: string;
3535
/**
36-
* 空提示更多内容
36+
* 不光提示文本,还有更多内容,`label` 将不起作用
3737
*/
3838
children?: React.ReactNode;
3939
}

packages/core/src/Flex/README.md

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,36 @@ function Demo() {
6868

6969
### Flex
7070

71-
| 参数 | 说明 | 类型 | 默认值 |
72-
| --- | --- | --- | --- |
73-
| `direction` | 项目定位方向 | `row`, `column`, `row-reverse`, `column-reverse` | `row` |
74-
| `wrap` | 子元素的换行方式 | `wrap`, `nowrap`, `wrap-reverse`, `nowrap` |
75-
| `justify` | 子元素在主轴上的对齐方式 | `start`, `end`, `center`, `between`, `around` | `start` |
76-
| `align` | 子元素在交叉轴上的对齐方式 | `start`, `end`, `center`, `stretch`, `baseline` | `start` |
71+
```ts
72+
export interface FlexProps extends ViewProps {
73+
/**
74+
* 项目定位方向
75+
* `row`, `column`, `row-reverse`, `column-reverse`
76+
* @default row
77+
*/
78+
direction?: FlexStyle['flexDirection'];
79+
/**
80+
* 子元素在主轴上的对齐方式
81+
* @default start
82+
*/
83+
justify?: 'start' | 'end' | 'center' | 'between' | 'around';
84+
/**
85+
* 子元素在交叉轴上的对齐方式
86+
* @default start
87+
*/
88+
align?: 'start' | 'end' | 'center' | 'stretch' | 'baseline';
89+
/**
90+
* 子元素的换行方式
91+
* @default nowrap
92+
*/
93+
wrap?: 'wrap' | 'nowrap' | 'wrap-reverse';
94+
}
95+
```
7796

7897
### Flex.Item
7998

80-
继承 [View](https://facebook.github.io/react-native/docs/view#props) 组件。
99+
继承 [View](https://facebook.github.io/react-native/docs/view#props) 组件。
100+
101+
```ts
102+
export interface FlexItemProps extends ViewProps {}
103+
```

packages/core/src/Flex/index.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,26 @@ import { View, ViewProps, FlexStyle } from 'react-native';
33
import FlexItem from './FlexItem';
44

55
export interface FlexProps extends ViewProps {
6+
/**
7+
* 项目定位方向
8+
* `row`, `column`, `row-reverse`, `column-reverse`
9+
* @default row
10+
*/
611
direction?: FlexStyle['flexDirection'];
12+
/**
13+
* 子元素在主轴上的对齐方式
14+
* @default start
15+
*/
716
justify?: 'start' | 'end' | 'center' | 'between' | 'around';
17+
/**
18+
* 子元素在交叉轴上的对齐方式
19+
* @default start
20+
*/
821
align?: 'start' | 'end' | 'center' | 'stretch' | 'baseline';
22+
/**
23+
* 子元素的换行方式
24+
* @default nowrap
25+
*/
926
wrap?: 'wrap' | 'nowrap' | 'wrap-reverse';
1027
}
1128

packages/core/src/Grid/README.md

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,32 @@ function Demo() {
5959

6060
## Props
6161

62-
| 参数 | 说明 | 类型 | 默认值 |
63-
|------|------|-----|------|
64-
| `data` | 传入的菜单数据,`icon` 可以是 `ReactNode` 或者 `uri` | Array<{icon?: React.ReactNode; text?: React.ReactNode;}> | `[]` |
65-
| `columns` | 列数 | Number | `4` |
66-
| `hasLine` | 是否有间隔线 | boolean | `true` |
67-
| `itemStyle` | 单元格样式 | ViewStyle | - |
68-
| `iconStyle` | 图片样式,可设置图片/图标尺寸 | ImageStyle & TextStyle & ViewStyle | - |
69-
| `textStyle` | 单元格文本样式 | TextStyle & ViewStyle | - |
70-
| `renderItem` | 自定义单元格 | (data, index, rowNum): void | - |
71-
| `onPress` | 点击宫格回调函数 | (data, index, rowNum): void | - |
62+
```ts
63+
export interface GridProps extends ViewProps {
64+
/**
65+
* 传入的菜单数据,`icon` 可以是 `ReactNode` 或者 `uri`
66+
* @default []
67+
*/
68+
data?: ItemData[];
69+
/**
70+
* 列数
71+
* @default 4
72+
*/
73+
columns?: number;
74+
/**
75+
* 是否有间隔线
76+
* @default true
77+
*/
78+
hasLine?: boolean;
79+
/** 单元格样式 */
80+
itemStyle?: StyleProp<ViewStyle>;
81+
/** 单元格文本样式 */
82+
textStyle?: StyleProp<TextStyle & ViewStyle>;
83+
/** 图片样式,可设置图片/图标尺寸 */
84+
iconStyle?: StyleProp<ImageStyle & TextStyle & ViewStyle>;
85+
/** 自定义单元格 */
86+
renderItem?: (data: ItemData, index: number, row: number) => React.ReactNode;
87+
/** 点击宫格回调函数 */
88+
onPress?: (data: ItemData, index: number, row: number, event: GestureResponderEvent) => void;
89+
}
90+
```

packages/core/src/Grid/index.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,30 @@ interface ItemData {
4444
}
4545

4646
export interface GridProps extends ViewProps {
47+
/**
48+
* 传入的菜单数据,`icon` 可以是 `ReactNode` 或者 `uri`
49+
* @default []
50+
*/
4751
data?: ItemData[];
52+
/**
53+
* 列数
54+
* @default 4
55+
*/
4856
columns?: number;
57+
/**
58+
* 是否有间隔线
59+
* @default true
60+
*/
4961
hasLine?: boolean;
62+
/** 单元格样式 */
5063
itemStyle?: StyleProp<ViewStyle>;
64+
/** 单元格文本样式 */
5165
textStyle?: StyleProp<TextStyle & ViewStyle>;
66+
/** 图片样式,可设置图片/图标尺寸 */
5267
iconStyle?: StyleProp<ImageStyle & TextStyle & ViewStyle>;
68+
/** 自定义单元格 */
5369
renderItem?: (data: ItemData, index: number, row: number) => React.ReactNode;
70+
/** 点击宫格回调函数 */
5471
onPress?: (data: ItemData, index: number, row: number, event: GestureResponderEvent) => void;
5572
}
5673

packages/core/src/Modal/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,11 @@ export default class ButtonGroupView extends Component {
4848

4949
## Props
5050

51-
继承原生 Modal 属性 [`ModalProps`](https://facebook.github.io/react-native/docs/modal.html#props)
51+
继承原生 Modal 属性 [`ModalProps`](https://facebook.github.io/react-native/docs/modal.html#props)
52+
53+
```ts
54+
export interface ModalProps extends MaskLayerProps {
55+
placement?: 'top' | 'right' | 'bottom' | 'left';
56+
onClosed?: () => void;
57+
}
58+
```

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@rematch/core": "2.0.1",
1717
"@rematch/loading": "2.0.1",
1818
"@uiw/react-code-preview": "1.11.13",
19-
"@uiw/react-markdown-preview": "3.1.3",
19+
"@uiw/react-markdown-preview": "3.2.0",
2020
"@uiw/react-native": "^2.6.0",
2121
"@uiw/react-native-template": "2.0.1",
2222
"@uiw/reset.css": "1.0.5",

website/src/component/Footer/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const data = [
2424
title: 'React Native AMap Geolocation'
2525
},
2626
{
27-
href : 'https://gitee.com/uiw/react-native-uiw',
27+
href : 'https://uiw.gitee.io/react-native-uiw/',
2828
title: '国内镜像站点 🇨🇳'
2929
},
3030
]

0 commit comments

Comments
 (0)