Skip to content

Commit 8a648fa

Browse files
xingyuefengSunLxyyaob421123nullptr-zff
authored
feat:添加文档预览、测试用例
* feat:添加文档预览 * doc:预览文档 * chore:修改命令 * fix:调整Layout为ts组件 * test: add ActionBar component test (#399) * test: 添加CheckBox测试 (#400) * fix resolve conflict * fix resolve conflict * fix: 添加Badge和Empty组件测试用例 (#402) Co-authored-by: hy <huyi@163.com> * feat(result): 增加jest测试 (#404) Co-authored-by: shenzhiqing <shenzhiqing@nihaosi.com> * fix:修复文档监听问题 * fix: 优化button rounded * docs: 优化文档预览 * docs: 优化Button文档 * fix:修复eslint问题 * fix:修复文档展示团队 * fix(card): 增加card测试用例,修改组件样式 (#414) * feat(result): 增加jest测试 * test(card): 增加card测试用例 Co-authored-by: shenzhiqing <shenzhiqing@nihaosi.com> * doc:添加本地文档预览步骤说明 * doc:更新快速上手文档 * fix: Card文档修改 * doc: NoticeBar文档修改 * doc(TextArea): 重构多行输入框TextArea文档 (#410) * doc: QuickList文档修改 * doc: TimeLine文档 * feat: 优化文档包引入 * doc: 更新 ios 安装文档 * doc: update changelog * chore: update workflows config. * docs: 优化Icon文档 * doc(Pagination): 重构分页器文档 * doc(Pagination): 重构分页器文档 * doc(Pagination): 删除无效引用 * fix: 发布错误 * fix: 发布错误问题 * fix: 发布错误问题 * feat(progress):新增Progress测试 * feat(imageViewer):新增ImageViewer测试用例 * fix(imageViewer):添加自定义多张图片查看 * feat:(steps)新增测试用例 * fix:(List):优化extra宽度限制 * doc(ActionSheet): 重构动作面板文档 * docs: 修改文档预览 * fix: 修复测试用例报错 * fix: 添加ButtonGroup和Divider组件测试用例 * fix: 添加Ellipsis和ExpandableSection组件测试用例 * fix: 更改Divider分割线和ButtonGroup按钮组文档和添加文档实例 * fix: 更改Input输入框和Calendar日历文档和添加文档实例 * fix: 修改报错 * fix: 修改报错 * doc(SearchInputBar): 重构搜索栏文档 * fix: no-useless-constructor * doc(TransitionImage): 重构过度动画图像组件 * docs: 优化Drawer文档 * docs: 优化MenuDropdown文档 Co-authored-by: SunLxy <1011771396@qq.com> Co-authored-by: yaobin <yaob421123@163.com> Co-authored-by: WmW <zhouzheng0646@qq.com> Co-authored-by: ff <ff@ffdeMac-Pro.local> Co-authored-by: huyi <963132341@qq.com> Co-authored-by: hy <huyi@163.com> Co-authored-by: star-hamster <52915367+star-hamster@users.noreply.github.com> Co-authored-by: shenzhiqing <shenzhiqing@nihaosi.com> Co-authored-by: WX <42308734@qq.com> Co-authored-by: 小弟调调™ <kennyiseeyou@gmail.com> Co-authored-by: jaywcjlove <398188662@qq.com> Co-authored-by: huqiaoli <huqiaoli@jz-sh.cn> Co-authored-by: wangjie0990 <379925517@qq.com>
1 parent c198af8 commit 8a648fa

File tree

92 files changed

+965
-1031
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+965
-1031
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,19 @@ export default class Index extends Component<IndexProps> {
2121
<Card title="基础使用">
2222
<ImageViewer />
2323
</Card>
24-
<Card title="自定义图片">
24+
<Card title="自定义单张图片">
25+
<ImageViewer height={100} width={100} src="https://img11.51tietu.net/pic/2016-071418/20160714181543xyu10ukncwf221991.jpg" />
26+
</Card>
27+
<Card title="自定义多张图片">
2528
<ImageViewer
2629
height={100}
2730
width={100}
28-
src="https://img11.51tietu.net/pic/2016-071418/20160714181543xyu10ukncwf221991.jpg"
31+
defaultIndex={2}
32+
src={[
33+
{url: 'https://wx3.sinaimg.cn/mw690/4718260ely1gt2cg7t5udj23dw1wkhdu.jpg'},
34+
{url: 'https://iknow-pic.cdn.bcebos.com/810a19d8bc3eb135828572d2ab1ea8d3fd1f441d'},
35+
{url: 'https://wx1.sinaimg.cn/mw690/4718260ely1gt2cg5r9zij22yo1o0x6p.jpg'},
36+
]}
2937
/>
3038
</Card>
3139
</Body>

packages/core/src/ActionSheet/README.md

Lines changed: 33 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,36 @@ ActionSheet 动作面板
33

44
该组件提供了一种动作面板, 底部缓缓出现
55

6-
![](https://user-images.githubusercontent.com/57083007/137631382-70df5dd3-0200-4ddb-bd11-3578ee99d032.gif)<!--rehype:style=zoom: 33%;float: right; margin-left: 15px;-->
6+
<!-- ![](https://user-images.githubusercontent.com/57083007/137631382-70df5dd3-0200-4ddb-bd11-3578ee99d032.gif) -->
7+
<!--rehype:style=zoom: 33%;float: right; margin-left: 15px;-->
78

89
### 基础示例
10+
```jsx mdx:preview
11+
import React, { Fragment, useState } from 'react';
12+
import { Button, ActionSheet } from '@uiw/react-native';
13+
import { ActionSheetItem } from '@uiw/react-native/lib/ActionSheet'
914

10-
```jsx
11-
import { Fragment, useState } from 'react';
12-
import { ActionSheet, Button,ActionSheetItem } from '@uiw/react-native';
1315
function Demo() {
1416
const [visible, setVisible] = useState(false)
1517
return (
1618
<Fragment>
1719
<Button onPress={()=>setVisible(true)}>打开 ActionSheet</Button>
18-
<ActionSheet
19-
visible={visible}
20-
>
20+
<ActionSheet visible={visible}>
2121
<ActionSheetItem onPress={()=>console.log('按钮一')}>按钮一</ActionSheetItem>
2222
<ActionSheetItem onPress={()=>console.log('按钮二')}>按钮二</ActionSheetItem>
2323
</ActionSheet>
2424
</Fragment>
2525
);
2626
}
27+
export default Demo
2728
```
2829

29-
### 弹层关闭 && 自定义取消文本
30+
### 自定义按钮文字
31+
```jsx mdx:preview
32+
import React, { Fragment, useState } from 'react';
33+
import { Button, ActionSheet } from '@uiw/react-native';
34+
import { ActionSheetItem } from '@uiw/react-native/lib/ActionSheet'
3035

31-
```jsx
32-
import { Fragment, useState } from 'react';
33-
import { ActionSheet, Button,ActionSheetItem } from '@uiw/react-native';
3436
function Demo() {
3537
const [visible, setVisible] = useState(false)
3638
return (
@@ -39,56 +41,46 @@ function Demo() {
3941
<ActionSheet
4042
visible={visible}
4143
onCancel={true}
42-
cancelText='取消'
44+
cancelText='关闭弹层'
4345
>
4446
<ActionSheetItem onPress={()=>console.log('按钮一')}>按钮一</ActionSheetItem>
4547
<ActionSheetItem onPress={()=>console.log('按钮二')}>按钮二</ActionSheetItem>
4648
</ActionSheet>
4749
</Fragment>
4850
);
4951
}
52+
export default Demo
5053
```
5154

5255
### Props
5356

54-
```ts
57+
```js
5558
import { StyleProp, ViewStyle } from 'react-native';
5659
import { ModalProps } from '@uiw/react-native';
5760

5861
export interface DividerStyle {
5962
itemDivider?: StyleProp<ViewStyle>,
6063
actionDivider?: StyleProp<ViewStyle>,
6164
}
62-
63-
export interface ActionSheetProps extends ModalProps {
64-
/** 点击蒙层是否关闭 */
65-
onCancel?: Boolean;
66-
/** 分割线样式 */
67-
dividerStyle?: DividerStyle;
68-
/** 取消的容器样式 */
69-
containerStyle?: StyleProp<ViewStyle>;
70-
/** 动作在被触摸操作激活时以多少不透明度显示 默认 1 */
71-
activeOpacity?: number;
72-
/** 动作有触摸操作时显示出来的底层的颜色 默认 #f1f1f1 */
73-
underlayColor?: string;
74-
/** 取消的文本样式 */
75-
textStyle?: StyleProp<TextStyle>;
76-
/** 取消的文本 */
77-
cancelText?: React.ReactNode;
78-
}
7965
```
8066

81-
### ActionSheetItem Props
67+
| 参数 | 说明 | 类型 | 默认值 |
68+
|------|------|-----|------|
69+
| onCancel | 点击蒙层是否关闭 | Boolean | `false` |
70+
| dividerStyle | 分割线样式 | DividerStyle | - |
71+
| containerStyle | 取消的容器样式 | StyleProp<ViewStyle> | - |
72+
| activeOpacity | 动作在被触摸操作激活时以多少不透明度显示 | number | `#f1f1f1` |
73+
| underlayColor | 动作有触摸操作时显示出来的底层的颜色 | string | `#f1f1f1` |
74+
| cancelText | 取消的文本 | `React.ReactNode` | - |
75+
| textStyle | 取消的文本样式 | `StyleProp<TextStyle>` | - |
8276

83-
```ts
77+
### ActionSheetItem Props
78+
```js
8479
import { TextStyle, StyleProp, ViewStyle } from 'react-native';
80+
```
8581

86-
export interface ActionSheetItemProps {
87-
/** 容器样式 */
88-
containerStyle?: StyleProp<ViewStyle>;
89-
/** 文本样式 */
90-
textStyle?: StyleProp<TextStyle>;
91-
/** 点击 ActionSheetItem 触发的事件 */
92-
onPress?: ((event: GestureResponderEvent) => void),
93-
}
94-
```
82+
| 参数 | 说明 | 类型 | 默认值 |
83+
|------|------|-----|------|
84+
| containerStyle | 容器样式 | `StyleProp<ViewStyle>` | - |
85+
| textStyle | 文本样式 | `StyleProp<ViewStyle>` | - |
86+
| onPress | 点击 ActionSheetItem 触发的事件 | `(event: GestureResponderEvent) => void` | - |

packages/core/src/ActionSheet/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react';
22
import { View, Dimensions, StyleSheet, TextStyle, StyleProp, ViewStyle } from 'react-native';
33
import Modal, { ModalProps } from '../Modal';
4-
export { default as ActionSheetItem } from './item';
54
import ActionSheetItem from './item';
5+
export { default as ActionSheetItem } from './item';
66

77
let MainWidth = Dimensions.get('window').width;
88

packages/core/src/ButtonGroup/README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ ButtonGroup 按钮组
33

44
用于一组按钮的排版展示。
55

6-
![](https://user-images.githubusercontent.com/57083007/137632086-8441bd1b-e8f9-4c15-828d-ad86310fdb72.png)<!--rehype:style=zoom: 33%;float: right; margin-left: 15px;-->
7-
86
### 基础示例
97

108
<!--DemoStart-->
11-
```jsx
12-
import { Button, ButtonGroup } from '@uiw/react-native';
9+
```jsx mdx:preview
10+
import React,{ Component } from "react"
11+
import {Button,ButtonGroup} from '@uiw/react-native';
1312

1413
class Demo extends Component {
1514
render() {
@@ -23,15 +22,17 @@ class Demo extends Component {
2322
)
2423
}
2524
}
25+
26+
export default Demo
2627
```
27-
<!--End-->
2828

2929
### 设置边框
3030

3131
<!--DemoStart-->
32-
```jsx
32+
```jsx mdx:preview
33+
import React,{ Component } from "react"
3334
import { View } from 'react-native';
34-
import { Button, ButtonGroup } from '@uiw/react-native';
35+
import {Button,ButtonGroup,Spacing} from '@uiw/react-native';
3536

3637
class Demo extends Component {
3738
render() {
@@ -54,15 +55,19 @@ class Demo extends Component {
5455
)
5556
}
5657
}
58+
59+
export default Demo
5760
```
5861
<!--End-->
5962

63+
6064
### 设置按钮组尺寸
6165

6266
<!--DemoStart-->
63-
```jsx
67+
```jsx mdx:preview
68+
import React,{ Component } from "react"
6469
import { View } from 'react-native';
65-
import { Button, ButtonGroup } from '@uiw/react-native';
70+
import {Button,ButtonGroup,Spacing} from '@uiw/react-native';
6671

6772
class Demo extends Component {
6873
render() {
@@ -113,10 +118,11 @@ class Demo extends Component {
113118
)
114119
}
115120
}
121+
122+
export default Demo
116123
```
117124
<!--End-->
118125

119-
120126
### Props
121127

122128
集成继承 `Button` 组件自定义属性,外层包裹继承 [`Flex`] 组件。

packages/core/src/ButtonGroup/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default class ButtonGroup extends Component<ButtonGroupProps> {
8080
childStyle.borderWidth = 0;
8181
}
8282
if (bordered && !gutter) {
83-
if ((idx > 0 && idx < (children as ButtonProps[]).length - 1) || idx === 0) {
83+
if (((idx > 0 && idx < (children as ButtonProps[]).length - 1)) || idx === 0) {
8484
childStyle.borderRightWidth = StyleSheet.hairlineWidth;
8585
}
8686
if (idx > 0 && idx < (children as ButtonProps[]).length) {

0 commit comments

Comments
 (0)