@sheinoutmobile/shineoutmobile 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @sheinoutmobile/shineoutmobile might be problematic. Click here for more details.
- package/.eslintignore +20 -0
- package/.eslintrc +8 -0
- package/.gitlab-ci.yml +53 -0
- package/.yarnrc +1 -0
- package/CHANGELOG.md +8 -0
- package/README.md +14 -0
- package/build.config.js +6 -0
- package/doc.config.js +16 -0
- package/lib/index.esm.js +5414 -0
- package/lib/index.esm.js.map +1 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -0
- package/package.json +47 -0
- package/src/component/button/button.jsx +83 -0
- package/src/component/button/index.jsx +3 -0
- package/src/component/button/style.less +132 -0
- package/src/component/cell/cell.jsx +71 -0
- package/src/component/cell/index.jsx +3 -0
- package/src/component/cell/style.less +86 -0
- package/src/component/cell-group/cell-group.jsx +26 -0
- package/src/component/cell-group/index.jsx +3 -0
- package/src/component/cell-group/style.less +22 -0
- package/src/component/checkbox/checkbox.jsx +92 -0
- package/src/component/checkbox/index.js +3 -0
- package/src/component/checkbox/kind/checkbox-button.jsx +41 -0
- package/src/component/checkbox/style.less +49 -0
- package/src/component/dialog/dialog.jsx +58 -0
- package/src/component/dialog/index.js +3 -0
- package/src/component/dialog/kind/dialog-alert.jsx +22 -0
- package/src/component/dialog/kind/dialog-confirm.jsx +54 -0
- package/src/component/dialog/style.less +80 -0
- package/src/component/drawer/drawer.jsx +151 -0
- package/src/component/drawer/index.jsx +3 -0
- package/src/component/drawer/js/tools.js +1 -0
- package/src/component/drawer/style.less +17 -0
- package/src/component/field/field.jsx +49 -0
- package/src/component/field/index.js +3 -0
- package/src/component/icon/icon.jsx +55 -0
- package/src/component/icon/index.jsx +19 -0
- package/src/component/icon/style.less +9 -0
- package/src/component/icons/index.js +3 -0
- package/src/component/icons/mrp.js +3 -0
- package/src/component/image-previewer/image-previewer.jsx +54 -0
- package/src/component/image-previewer/index.js +3 -0
- package/src/component/index-sort-list/group.jsx +49 -0
- package/src/component/index-sort-list/index-bar.jsx +34 -0
- package/src/component/index-sort-list/index.js +3 -0
- package/src/component/index-sort-list/js/rules.js +14 -0
- package/src/component/index-sort-list/js/sort-rule.js +41 -0
- package/src/component/index-sort-list/list.jsx +110 -0
- package/src/component/index-sort-list/style.less +109 -0
- package/src/component/input/index.js +3 -0
- package/src/component/input/input.jsx +285 -0
- package/src/component/input/style.less +77 -0
- package/src/component/list-view/index.js +3 -0
- package/src/component/list-view/jsx/empty.jsx +23 -0
- package/src/component/list-view/list-view.jsx +165 -0
- package/src/component/list-view/style.less +79 -0
- package/src/component/loading/index.js +3 -0
- package/src/component/loading/loading.jsx +97 -0
- package/src/component/loading/styles.less +128 -0
- package/src/component/multiple-selector/index.jsx +3 -0
- package/src/component/multiple-selector/item.jsx +23 -0
- package/src/component/multiple-selector/multiple-selector.jsx +116 -0
- package/src/component/multiple-selector/selector.jsx +41 -0
- package/src/component/multiple-selector/style.less +78 -0
- package/src/component/notice-bar/index.jsx +3 -0
- package/src/component/notice-bar/notice-bar.jsx +86 -0
- package/src/component/notice-bar/style.less +72 -0
- package/src/component/notify/index.js +37 -0
- package/src/component/notify/notify.jsx +125 -0
- package/src/component/notify/style.less +48 -0
- package/src/component/picker/drawPicker.jsx +110 -0
- package/src/component/picker/index.js +3 -0
- package/src/component/picker/picker.jsx +380 -0
- package/src/component/picker/pickerItem.jsx +31 -0
- package/src/component/picker/style.less +80 -0
- package/src/component/pull-refresh/index.js +3 -0
- package/src/component/pull-refresh/pull-refresh.jsx +46 -0
- package/src/component/search-bar/index.jsx +3 -0
- package/src/component/search-bar/search-bar.jsx +97 -0
- package/src/component/search-bar/style.less +52 -0
- package/src/component/sign/index.jsx +3 -0
- package/src/component/sign/sign.jsx +33 -0
- package/src/component/sign/style.less +56 -0
- package/src/component/sort-item/index.jsx +3 -0
- package/src/component/sort-item/sort-item.jsx +52 -0
- package/src/component/sort-item/style.less +52 -0
- package/src/component/subscript/index.js +3 -0
- package/src/component/subscript/style.less +63 -0
- package/src/component/subscript/subscript.jsx +77 -0
- package/src/component/tab/index.jsx +6 -0
- package/src/component/tab/nav-child.jsx +63 -0
- package/src/component/tab/panel.jsx +22 -0
- package/src/component/tab/style.less +87 -0
- package/src/component/tab/tab.jsx +195 -0
- package/src/component/tag/index.jsx +3 -0
- package/src/component/tag/style.less +56 -0
- package/src/component/tag/tag.jsx +52 -0
- package/src/component/toast/content.jsx +31 -0
- package/src/component/toast/index.js +3 -0
- package/src/component/toast/style.less +50 -0
- package/src/component/toast/toast.jsx +62 -0
- package/src/component/touchable/index.js +3 -0
- package/src/component/touchable/style.less +33 -0
- package/src/component/touchable/touchable.jsx +43 -0
- package/src/component/uploader/index.jsx +445 -0
- package/src/component/uploader/js/get-image-base64.js +31 -0
- package/src/component/uploader/js/get-image-detail.js +26 -0
- package/src/component/uploader/js/index.js +77 -0
- package/src/component/uploader/js/merge-class-name.js +14 -0
- package/src/component/uploader/js/old-compress-function.js +64 -0
- package/src/component/uploader/js/request.js +62 -0
- package/src/component/uploader/js/tools.js +115 -0
- package/src/component/uploader/jsx/config.jsx +36 -0
- package/src/component/uploader/jsx/img-preview.jsx +41 -0
- package/src/component/uploader/jsx/thumbnails.jsx +27 -0
- package/src/component/uploader/styles/index.less +158 -0
- package/src/index.js +1 -0
- package/src/index.jsx +64 -0
- package/src/styles/color.less +51 -0
- package/src/styles/font.less +14 -0
- package/src/styles/format-theme.less +27 -0
- package/src/styles/index.less +26 -0
- package/src/styles/spacing.less +3 -0
- package/src/styles/var.less +3 -0
- package/src/tools/create-body-container.js +47 -0
- package/src/tools/limit-body-scroll.js +17 -0
- package/src/tools/limit-document-scroll.js +12 -0
- package/src/tools/merge-class-name.js +14 -0
- package/src/tools/object-key-check.js +3 -0
- package/src/tools/pinyin.js +6 -0
- package/src/tools/proptypes.js +51 -0
- package/src/tools/style.less +14 -0
- package/test/cases/case-button01.assert.js +6 -0
- package/test/cases/case-button01.source.jsx +28 -0
- package/test/cases/case-checkbox01.assert.js +6 -0
- package/test/cases/case-checkbox01.source.jsx +20 -0
- package/test/cases/case-dialog01.assert.js +6 -0
- package/test/cases/case-dialog01.source.jsx +45 -0
- package/test/cases/case-drawer01.assert.js +6 -0
- package/test/cases/case-drawer01.source.jsx +85 -0
- package/test/cases/case-icons01.assert.js +6 -0
- package/test/cases/case-icons01.source.jsx +25 -0
- package/test/cases/case-indexSortList01.assert.js +6 -0
- package/test/cases/case-indexSortList01.source.jsx +74 -0
- package/test/cases/case-input01.assert.js +6 -0
- package/test/cases/case-input01.source.jsx +24 -0
- package/test/cases/case-listView01.assert.js +6 -0
- package/test/cases/case-listView01.source.jsx +64 -0
- package/test/cases/case-multiplePicker01.assert.js +6 -0
- package/test/cases/case-multiplePicker01.source.jsx +60 -0
- package/test/cases/case-multipleSelector01.assert.js +6 -0
- package/test/cases/case-multipleSelector01.source.jsx +49 -0
- package/test/cases/case-noticebar01.assert.js +6 -0
- package/test/cases/case-noticebar01.source.jsx +21 -0
- package/test/cases/case-picker01.assert.js +6 -0
- package/test/cases/case-picker01.source.jsx +61 -0
- package/test/cases/case-refresh01.assert.js +6 -0
- package/test/cases/case-refresh01.source.jsx +33 -0
- package/test/cases/case-sign01.assert.js +6 -0
- package/test/cases/case-sign01.source.jsx +21 -0
- package/test/cases/case-subscript01.assert.js +6 -0
- package/test/cases/case-subscript01.source.jsx +30 -0
- package/test/cases/case-tab01.assert.js +6 -0
- package/test/cases/case-tab01.source.jsx +51 -0
- package/test/cases/case-toast01.assert.js +6 -0
- package/test/cases/case-toast01.source.jsx +32 -0
- package/test/cases/case-uploader01.assert.js +6 -0
- package/test/cases/case-uploader01.source.jsx +45 -0
- package/test.config.js +25 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测试用例
|
|
3
|
+
*
|
|
4
|
+
* @title Drawer
|
|
5
|
+
* @desc
|
|
6
|
+
* 抽屉
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { Drawer, Button } from '../../src/index';
|
|
11
|
+
|
|
12
|
+
// doc
|
|
13
|
+
const style = { marginRight: 16 };
|
|
14
|
+
class UseDrawer extends React.Component {
|
|
15
|
+
constructor(props) {
|
|
16
|
+
super(props);
|
|
17
|
+
this.state = {
|
|
18
|
+
bVisible: false,
|
|
19
|
+
rVisible: false,
|
|
20
|
+
frVisible: false,
|
|
21
|
+
fbVisible: false,
|
|
22
|
+
secondVisible: false,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
render() {
|
|
27
|
+
const { bVisible, rVisible, frVisible, fbVisible, secondVisible } = this.state;
|
|
28
|
+
return (
|
|
29
|
+
<div>
|
|
30
|
+
<a onClick={() => this.setState({ bVisible: true })} style={style}>open bottom drawer</a>
|
|
31
|
+
<Drawer
|
|
32
|
+
visible={bVisible}
|
|
33
|
+
onClose={() => this.setState({ bVisible: false })}
|
|
34
|
+
position="bottom"
|
|
35
|
+
height={200}
|
|
36
|
+
>
|
|
37
|
+
来来我是一颗菠菜
|
|
38
|
+
</Drawer>
|
|
39
|
+
<a onClick={() => this.setState({ rVisible: true })} style={style}>open right drawer</a>
|
|
40
|
+
<Drawer
|
|
41
|
+
visible={rVisible}
|
|
42
|
+
onClose={() => this.setState({ rVisible: false })}
|
|
43
|
+
position="right"
|
|
44
|
+
width={300}
|
|
45
|
+
>
|
|
46
|
+
<div style={{ height: 800 }}>来来我是一颗菠菜</div>
|
|
47
|
+
</Drawer>
|
|
48
|
+
<a onClick={() => this.setState({ frVisible: true })} style={style}>open right 80%-width drawer</a>
|
|
49
|
+
<Drawer
|
|
50
|
+
visible={frVisible}
|
|
51
|
+
onClose={() => this.setState({ frVisible: false })}
|
|
52
|
+
position="right"
|
|
53
|
+
width="80%"
|
|
54
|
+
>
|
|
55
|
+
<div style={{ height: '100%' }}>
|
|
56
|
+
<div style={{ height: 'calc(100% + 200px)' }}>
|
|
57
|
+
我这颗菠菜填满整个屏幕的80%哦!
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</Drawer>
|
|
61
|
+
<a onClick={() => this.setState({ fbVisible: true })} style={style}>open bottom 100%-height drawer</a>
|
|
62
|
+
<Drawer
|
|
63
|
+
visible={fbVisible}
|
|
64
|
+
onClose={() => this.setState({ fbVisible: false })}
|
|
65
|
+
position="bottom"
|
|
66
|
+
height="100%"
|
|
67
|
+
>
|
|
68
|
+
我这颗菠菜从下往上填满整个屏幕哦!
|
|
69
|
+
<Button type="danger" onClick={() => this.setState({ fbVisible: false })}>关闭</Button>
|
|
70
|
+
<br/>
|
|
71
|
+
<Button onClick={() => this.setState({ secondVisible: true })}>再来一层</Button>
|
|
72
|
+
</Drawer>
|
|
73
|
+
<Drawer
|
|
74
|
+
visible={secondVisible}
|
|
75
|
+
zIndex={100}
|
|
76
|
+
onClose={() => this.setState({ secondVisible: false })}
|
|
77
|
+
>
|
|
78
|
+
第二层GOGOGO
|
|
79
|
+
</Drawer>
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export default <UseDrawer />
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测试用例
|
|
3
|
+
*
|
|
4
|
+
* @title Icons
|
|
5
|
+
* @desc
|
|
6
|
+
* 没有传任何参数。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React from 'react'
|
|
10
|
+
import { Icons } from '../../src/index';
|
|
11
|
+
|
|
12
|
+
// doc
|
|
13
|
+
const style = { marginRight: 12 };
|
|
14
|
+
export default (
|
|
15
|
+
<div>
|
|
16
|
+
<Icons name="inform" style={style} />
|
|
17
|
+
<Icons name="fail" style={style} />
|
|
18
|
+
<Icons name="success" style={Object.assign({}, style, { color: 'green' })} />
|
|
19
|
+
<Icons name="close" style={style} />
|
|
20
|
+
<Icons name="remark" style={style} />
|
|
21
|
+
<Icons name="photo" style={style} />
|
|
22
|
+
<Icons name="add1" style={style} />
|
|
23
|
+
<Icons name="search" style={Object.assign({}, style, { color: 'blue', fontSize: '18px' })} />
|
|
24
|
+
</div>
|
|
25
|
+
)
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测试用例
|
|
3
|
+
*
|
|
4
|
+
* @title IndexSortList - 索引列表
|
|
5
|
+
* @desc
|
|
6
|
+
* 没有传任何参数。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React from 'react'
|
|
10
|
+
import { IndexSortList } from '../../src/index'
|
|
11
|
+
|
|
12
|
+
// doc
|
|
13
|
+
const data = [
|
|
14
|
+
{
|
|
15
|
+
title: 'A',
|
|
16
|
+
data: [{ label: '阿布', value: 'a1' }, { label: '阿波罗', value: 'a2' }, { label: '奥林匹克', value: 'a3' }],
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
title: 'C',
|
|
20
|
+
data: [{ label: '测量', value: 'c1' }, { label: '瓷器', value: 'c2' }, { label: '搓麻将', value: 'c3' }],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
title: 'F',
|
|
24
|
+
data: [{ label: '方法', value: 'f1' }, { label: '夫妇', value: 'f2' }, { label: '飞飞飞', value: 'f3' }],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
title: 'Z',
|
|
28
|
+
data: [{ label: '折扣', value: 'z1' }, { label: '地面', value: 'z2' }, { label: '这个天', value: 'z3' }],
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
const sortData = [
|
|
33
|
+
{ label: '嗷嗷', value: 'a1' }, { label: '暗暗', value: 'a2' }, { label: '啊啊', value: 'a3' },
|
|
34
|
+
{ label: '天天', value: 'c1' }, { label: '头疼', value: 'c2' }, { label: '太挑剔', value: 'c3' },
|
|
35
|
+
{ label: '这种', value: 'z1' }, { label: '组织', value: 'z2' }, { label: '自治州', value: 'z3' },
|
|
36
|
+
{ label: '订单', value: 'd1' }, { label: '达到', value: 'd2' }, { label: '得到的', value: 'd3' },
|
|
37
|
+
{ label: 'FBA', value: 'f1' }, { label: '$%乱码', value: 'f2' }, { label: '123加工厂', value: 'f3' },
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
const sortData2 = [
|
|
41
|
+
{ label: '111', value: '111' }, { label: '1111', value: '1111' }, { label: '11111', value: '11111' },
|
|
42
|
+
{ label: '222', value: '222' }, { label: '333', value: '333' }, { label: '3333', value: '3333' },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
export default (
|
|
46
|
+
<div>
|
|
47
|
+
<p>第一种用法:按规则传入数据</p>
|
|
48
|
+
<div style={{ height: 200 }}>
|
|
49
|
+
<IndexSortList
|
|
50
|
+
data={data}
|
|
51
|
+
select={(value, label) => console.log(`点击的是:${label},value是${value}`)}
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
<br />
|
|
55
|
+
<p>第二种用法是索引组件会帮你进行排序</p>
|
|
56
|
+
<div style={{ height: 200 }}>
|
|
57
|
+
<IndexSortList
|
|
58
|
+
rule="pinyin"
|
|
59
|
+
data={sortData}
|
|
60
|
+
select={(value, label) => console.log(`点击的是:${label},value是${value}`)}
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
63
|
+
<p>同样是第二种用法,sort传入自定义方法来自定义排序规则</p>
|
|
64
|
+
<div style={{ height: 200 }}>
|
|
65
|
+
<IndexSortList
|
|
66
|
+
empty="木有东西哦~"
|
|
67
|
+
rule={item => item.label[0]} // 自定义排序规则
|
|
68
|
+
data={sortData2}
|
|
69
|
+
select={(value, label) => console.log(`点击的是:${label},value是${value}`)}
|
|
70
|
+
render={(item) => (<div><i>♬</i><text>{item.label}</text></div>)}
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测试用例
|
|
3
|
+
*
|
|
4
|
+
* @title Input
|
|
5
|
+
* @desc
|
|
6
|
+
* 没有传任何参数。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React from 'react'
|
|
10
|
+
import { Button, Input } from '../../src/index'
|
|
11
|
+
|
|
12
|
+
// doc
|
|
13
|
+
export default (
|
|
14
|
+
<div>
|
|
15
|
+
<Input border type="number" placeholder="请输入" style={{ marginBottom: 12 }} />
|
|
16
|
+
<Input
|
|
17
|
+
type="textarea"
|
|
18
|
+
border
|
|
19
|
+
rows={4}
|
|
20
|
+
placeholder="请写明你反馈该厂飞单的情况,能截图活拍照举证效果更好,你的举证是SHEIN推进“制定采购”的有力支持。 如有布料采购不足,请填写实际出料米数。"
|
|
21
|
+
placeholderStyle="light"
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测试用例
|
|
3
|
+
*
|
|
4
|
+
* @title List-View
|
|
5
|
+
* @desc
|
|
6
|
+
* 没有传任何参数。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React from 'react'
|
|
10
|
+
import { Button, ListView } from '../../src/index'
|
|
11
|
+
|
|
12
|
+
// doc
|
|
13
|
+
const getList = () => new Promise((resolve) => {
|
|
14
|
+
setTimeout(() => resolve([1, 2, 3, 4, 5]), 1.5 * 1000);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const style = {
|
|
18
|
+
height: 120,
|
|
19
|
+
border: '1px solid #969799',
|
|
20
|
+
borderRadius: '8px',
|
|
21
|
+
margin: '8px'
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
class List extends React.Component{
|
|
25
|
+
constructor(props) {
|
|
26
|
+
super(props);
|
|
27
|
+
this.state = {
|
|
28
|
+
list: [],
|
|
29
|
+
loading: false,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
const { list, loading } = this.state;
|
|
34
|
+
return (
|
|
35
|
+
<div style={{ height: 200 }}>
|
|
36
|
+
<ListView
|
|
37
|
+
loading={loading}
|
|
38
|
+
onRefresh={() => console.log('下拉刷新')}
|
|
39
|
+
onTouchBottom={() => {
|
|
40
|
+
console.log('触底了喂');
|
|
41
|
+
this.setState({ loading: true });
|
|
42
|
+
getList().then(data => this.setState({ list: [...list, ...data], loading: false }))
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
{
|
|
46
|
+
list.map(l => <div style={style}>我是{l}<br />我是地址<br />我是电话</div>)
|
|
47
|
+
}
|
|
48
|
+
</ListView>
|
|
49
|
+
<Button
|
|
50
|
+
type="primary"
|
|
51
|
+
size="small"
|
|
52
|
+
onClick={() => {
|
|
53
|
+
this.setState({ loading: true });
|
|
54
|
+
getList().then(data => this.setState({ list: [...list, ...data], loading: false }))
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
拿数据
|
|
58
|
+
</Button>
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export default <List />
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测试用例
|
|
3
|
+
*
|
|
4
|
+
* @title MultiplePicker
|
|
5
|
+
* @desc
|
|
6
|
+
* 多重选择器
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { SlideList } from '../../src/index';
|
|
11
|
+
|
|
12
|
+
const { PickerItem } = SlideList;
|
|
13
|
+
|
|
14
|
+
const testData = [
|
|
15
|
+
{ value: 'BJ', label: '北京' },
|
|
16
|
+
{ value: 'SH', label: '上海' },
|
|
17
|
+
{ value: 'GZ', label: '广州' },
|
|
18
|
+
{ value: 'SZ', label: '深圳' },
|
|
19
|
+
{ value: 'HZ', label: '杭州' },
|
|
20
|
+
{ value: 'NJ', label: '南京' },
|
|
21
|
+
{ value: 'WH', label: '武汉' },
|
|
22
|
+
{ value: 'JN', label: '济南' },
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
// doc
|
|
26
|
+
class UseMultiplePicker extends React.Component {
|
|
27
|
+
constructor(props) {
|
|
28
|
+
super(props);
|
|
29
|
+
this.state = {
|
|
30
|
+
pickerValue2: '',
|
|
31
|
+
pickerValue1: '',
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
render() {
|
|
36
|
+
const { pickerValue1, pickerValue2 } = this.state;
|
|
37
|
+
return (
|
|
38
|
+
<div style={{ display: 'flex', height: 200 }}>
|
|
39
|
+
<div style={{ width: 300 }}>
|
|
40
|
+
<SlideList
|
|
41
|
+
value={pickerValue1}
|
|
42
|
+
onValueChange={value => this.setState({ pickerValue1: value })}
|
|
43
|
+
>
|
|
44
|
+
{testData.map(item => (<PickerItem key={item.value} value={item.value}>{item.label}</PickerItem>))}
|
|
45
|
+
</SlideList>
|
|
46
|
+
</div>
|
|
47
|
+
<div style={{ width: 300 }}>
|
|
48
|
+
<SlideList
|
|
49
|
+
value={pickerValue2}
|
|
50
|
+
onValueChange={value => this.setState({ pickerValue2: value })}
|
|
51
|
+
>
|
|
52
|
+
{testData.map(item => (<PickerItem key={item.value} value={item.value}>{item.label}</PickerItem>))}
|
|
53
|
+
</SlideList>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export default <UseMultiplePicker />;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测试用例
|
|
3
|
+
*
|
|
4
|
+
* @title MultipleSelector
|
|
5
|
+
* @desc
|
|
6
|
+
* 批量选择器
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { MultipleSelector } from '../../src/index';
|
|
11
|
+
|
|
12
|
+
// doc
|
|
13
|
+
const option = [
|
|
14
|
+
{ label: '学习小组', name: 'study', data: [{ label: '学习达人', value: 11 }, { label: '学习白痴', value: 12 }] },
|
|
15
|
+
{ label: '兴趣小组', name: 'interesting', data: [{ label: '兴趣达人', value: 21 }] },
|
|
16
|
+
{ label: '工作小组', name: 'work', data: [{ label: '工作达人', value: 31 }, { label: '工作咸鱼', value: 32 }, { label: '红枣枸杞工作者', value: 33 }] },
|
|
17
|
+
{ label: '发狂小组', name: 'crazy', data: [{ label: '废青', value: 41 }] },
|
|
18
|
+
{ label: '扭捏小组', name: 'shy', data: [{ label: '黄花大姑娘', value: 41 }] },
|
|
19
|
+
{ label: '文艺小组', name: 'art', data: [{ label: '秃头艺术家', value: 61 }] },
|
|
20
|
+
{ label: '天使小组', name: 'angel', data: [] },
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
class UseSelector extends React.Component {
|
|
24
|
+
constructor(props) {
|
|
25
|
+
super(props);
|
|
26
|
+
this.state = {
|
|
27
|
+
visible: false,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
render() {
|
|
32
|
+
const { visible } = this.state;
|
|
33
|
+
return (
|
|
34
|
+
<div>
|
|
35
|
+
<a onClick={() => this.setState({ visible: true })}>open bottom selector</a>
|
|
36
|
+
<MultipleSelector
|
|
37
|
+
visible={visible}
|
|
38
|
+
onClose={() => this.setState({ visible: false })}
|
|
39
|
+
onChange={value => console.log(value)}
|
|
40
|
+
option={option}
|
|
41
|
+
title="这是一个标题"
|
|
42
|
+
extraComponent={(<div style={{ lineHeight: '45px', textAlign: 'center' }}>这是一个额外的操作空间哦~</div>)}
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default <UseSelector />
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测试用例
|
|
3
|
+
*
|
|
4
|
+
* @title NoticeBar-滚动公告
|
|
5
|
+
* @desc
|
|
6
|
+
* 没有传任何参数。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { NoticeBar } from '../../src/index';
|
|
11
|
+
|
|
12
|
+
const text = '为什么香港对中国大陆的认同感没那么强, 为什么有那么多香港人迷之自信讨厌中国? .... 香港有多少人知道98年索罗斯财团入侵香港事件的,他们怎么看这件事?';
|
|
13
|
+
const text2 = '香港有多少人知道98年索罗斯财团入侵香港事件的,他们怎么看这件事?';
|
|
14
|
+
|
|
15
|
+
// doc
|
|
16
|
+
export default (
|
|
17
|
+
<div>
|
|
18
|
+
<NoticeBar text={text} icon="next" style={{ marginBottom: 12 }} />
|
|
19
|
+
<NoticeBar text={text2} icon speed={100} style={{ color: '#f44', background: '#e5e5e5' }} />
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测试用例
|
|
3
|
+
*
|
|
4
|
+
* @title Picker
|
|
5
|
+
* @desc
|
|
6
|
+
* 选择器
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { Picker } from '../../src/index';
|
|
11
|
+
|
|
12
|
+
const blankData = [];
|
|
13
|
+
|
|
14
|
+
const testData = [
|
|
15
|
+
{ value: 'BJ', label: '北京' },
|
|
16
|
+
{ value: 'SH', label: '上海' },
|
|
17
|
+
{ value: 'GZ', label: '广州' },
|
|
18
|
+
{ value: 'SZ', label: '深圳' },
|
|
19
|
+
{ value: 'HZ', label: '杭州' },
|
|
20
|
+
{ value: 'NJ', label: '南京' },
|
|
21
|
+
{ value: 'WH', label: '武汉' },
|
|
22
|
+
{ value: 'JN', label: '济南' },
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
// doc
|
|
26
|
+
class UsePicker extends React.Component {
|
|
27
|
+
constructor(props) {
|
|
28
|
+
super(props);
|
|
29
|
+
this.state = {
|
|
30
|
+
bVisible: false,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
this.onPickerConfirm = this.onPickerConfirm.bind(this);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
onPickerConfirm(value) {
|
|
37
|
+
console.log(value);
|
|
38
|
+
this.setState({ bVisible: false });
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
render() {
|
|
42
|
+
const { bVisible } = this.state;
|
|
43
|
+
return (
|
|
44
|
+
<div>
|
|
45
|
+
<a onClick={() => this.setState({ bVisible: true })} style={{ marginRight: 16 }}>open bottom picker</a>
|
|
46
|
+
<Picker
|
|
47
|
+
visible={bVisible}
|
|
48
|
+
onCancel={() => this.setState({ bVisible: false })}
|
|
49
|
+
position="bottom"
|
|
50
|
+
data={bVisible ? testData : blankData}
|
|
51
|
+
height={400}
|
|
52
|
+
title="选择城市"
|
|
53
|
+
defaultValue="12345"
|
|
54
|
+
onConfirm={this.onPickerConfirm}
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export default <UsePicker />;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测试用例
|
|
3
|
+
*
|
|
4
|
+
* @title pull-refresh
|
|
5
|
+
* @desc
|
|
6
|
+
* 包住节点即可
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { PullRefresh } from '../../src/index';
|
|
11
|
+
|
|
12
|
+
// doc
|
|
13
|
+
class Test extends React.Component {
|
|
14
|
+
constructor(props) {
|
|
15
|
+
super(props);
|
|
16
|
+
this.state = {
|
|
17
|
+
count: 0,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
render() {
|
|
22
|
+
const { count } = this.state;
|
|
23
|
+
return (
|
|
24
|
+
<PullRefresh
|
|
25
|
+
refresh={() => this.setState({ count: count + 1 })}
|
|
26
|
+
>
|
|
27
|
+
<div>{`刷了${count}次`}</div>
|
|
28
|
+
</PullRefresh>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default <Test />;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测试用例
|
|
3
|
+
*
|
|
4
|
+
* @title Sign-标签
|
|
5
|
+
* @desc
|
|
6
|
+
* color有7种颜色:'green', 'red', 'blue', 'purple', 'fuchsia', 'yellow'
|
|
7
|
+
* size有default和large
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { Sign } from '../../src/index';
|
|
12
|
+
|
|
13
|
+
const style = { marginRight: 8 };
|
|
14
|
+
// doc
|
|
15
|
+
export default (
|
|
16
|
+
<div>
|
|
17
|
+
<Sign color="blue" text="蓝天" style={style} />
|
|
18
|
+
<Sign color="red" text="紧急" style={style} />
|
|
19
|
+
<Sign plain color="yellow" text="黄?" />
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 测试用例
|
|
3
|
+
*
|
|
4
|
+
* @title Subscript-角标
|
|
5
|
+
* @desc
|
|
6
|
+
* 没有传任何参数。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React from 'react'
|
|
10
|
+
import { Subscript } from '../../src/index'
|
|
11
|
+
|
|
12
|
+
// doc
|
|
13
|
+
const style = {
|
|
14
|
+
position: 'relative',
|
|
15
|
+
width: '120px',
|
|
16
|
+
height: '100px',
|
|
17
|
+
border: '1px solid #d9d9d9',
|
|
18
|
+
borderRadius: '8px',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default (
|
|
22
|
+
<div>
|
|
23
|
+
<div style={style}>
|
|
24
|
+
<Subscript color="red" text="另类" />
|
|
25
|
+
</div>
|
|
26
|
+
<div style={style}>
|
|
27
|
+
<Subscript color="blue" text="正常" />
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
)
|