clxx 2.1.2 → 2.1.4
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.
- package/LICENSE +20 -20
- package/README.md +768 -35
- package/build/Ago/index.d.ts +0 -1
- package/build/Alert/Wrapper.d.ts +0 -1
- package/build/Alert/Wrapper.js +12 -12
- package/build/Alert/index.js +2 -2
- package/build/AutoGrid/index.js +16 -21
- package/build/AutoGrid/style.d.ts +5 -5
- package/build/CarouselNotice/index.d.ts +0 -1
- package/build/CarouselNotice/index.js +6 -6
- package/build/CarouselNotice/style.d.ts +6 -1
- package/build/CarouselNotice/style.js +7 -7
- package/build/Clickable/index.d.ts +5 -5
- package/build/Clickable/index.js +11 -8
- package/build/Container/index.d.ts +2 -2
- package/build/Container/index.js +85 -60
- package/build/Countdowner/index.d.ts +3 -3
- package/build/Countdowner/index.js +18 -11
- package/build/Dialog/Wrapper.d.ts +0 -1
- package/build/Dialog/Wrapper.js +7 -10
- package/build/Dialog/style.d.ts +15 -10
- package/build/Dialog/style.js +88 -88
- package/build/Effect/useInterval.d.ts +1 -1
- package/build/Effect/useInterval.js +1 -1
- package/build/Effect/useUpdate.d.ts +1 -1
- package/build/Effect/useUpdate.js +1 -1
- package/build/Effect/useWindowResize.d.ts +4 -2
- package/build/Effect/useWindowResize.js +28 -11
- package/build/Flex/index.d.ts +0 -1
- package/build/Indicator/index.js +22 -23
- package/build/Indicator/style.d.ts +6 -1
- package/build/Indicator/style.js +7 -7
- package/build/Loading/Wrapper.js +2 -2
- package/build/Loading/style.d.ts +12 -2
- package/build/Loading/style.js +14 -14
- package/build/Overlay/index.d.ts +1 -1
- package/build/Overlay/index.js +41 -37
- package/build/SafeArea/index.d.ts +1 -2
- package/build/SafeArea/index.js +6 -6
- package/build/ScrollView/index.d.ts +1 -1
- package/build/ScrollView/index.js +111 -27
- package/build/Toast/Toast.js +4 -4
- package/build/Toast/style.d.ts +42 -12
- package/build/Toast/style.js +54 -54
- package/build/index.d.ts +3 -0
- package/build/index.js +3 -0
- package/build/utils/Countdown.d.ts +3 -1
- package/build/utils/Countdown.js +5 -2
- package/build/utils/createApp.d.ts +14 -13
- package/build/utils/createApp.js +58 -42
- package/build/utils/cssUtil.d.ts +2 -2
- package/build/utils/cssUtil.js +24 -13
- package/build/utils/defaultScroll.d.ts +0 -1
- package/build/utils/defaultScroll.js +8 -5
- package/build/utils/is.d.ts +23 -4
- package/build/utils/is.js +97 -15
- package/build/utils/jsonp.js +2 -2
- package/build/utils/request.js +12 -2
- package/package.json +15 -12
- package/test/README.md +16 -0
- package/test/eslint.config.js +29 -0
- package/test/index.html +13 -0
- package/test/jsconfig.json +8 -0
- package/test/package.json +27 -0
- package/test/public/vite.svg +1 -0
- package/test/src/ago/index.jsx +30 -0
- package/test/src/alert/index.jsx +111 -0
- package/test/src/autogrid/index.css +0 -0
- package/test/src/autogrid/index.jsx +26 -0
- package/test/src/carouse-notice/index.jsx +59 -0
- package/test/src/clickable/index.css +21 -0
- package/test/src/clickable/index.jsx +39 -0
- package/test/src/countdown/index.jsx +95 -0
- package/test/src/dialog/index.jsx +104 -0
- package/test/src/dialog/index.module.css +5 -0
- package/test/src/image-picker/index.css +0 -0
- package/test/src/image-picker/index.jsx +88 -0
- package/test/src/index/index.jsx +46 -0
- package/test/src/index.css +49 -0
- package/test/src/index.jsx +31 -0
- package/test/src/indicator/index.jsx +25 -0
- package/test/src/loading/index.jsx +36 -0
- package/test/src/overlay/index.jsx +31 -0
- package/test/src/privacy/index.css +13 -0
- package/test/src/privacy/index.jsx +34 -0
- package/test/src/scrollview/index.css +10 -0
- package/test/src/scrollview/index.jsx +52 -0
- package/test/src/toast/index.jsx +86 -0
- package/test/vite.config.js +15 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CarouselNotice } from '@';
|
|
3
|
+
|
|
4
|
+
export default function Index () {
|
|
5
|
+
return (
|
|
6
|
+
<div>
|
|
7
|
+
<p>轮播条目只有一条(不滚动):</p>
|
|
8
|
+
<CarouselNotice
|
|
9
|
+
list={['第一条滚动']}
|
|
10
|
+
style={{ border: '1px solid blue' }}
|
|
11
|
+
itemStyle={{
|
|
12
|
+
color: "blue"
|
|
13
|
+
}}
|
|
14
|
+
/>
|
|
15
|
+
|
|
16
|
+
<p>轮播条目为纯文本:</p>
|
|
17
|
+
<CarouselNotice
|
|
18
|
+
list={['第一条滚动', '第二条滚动测试']}
|
|
19
|
+
style={{ border: '1px solid red' }}
|
|
20
|
+
/>
|
|
21
|
+
|
|
22
|
+
<p>轮播条目为任意React组件:</p>
|
|
23
|
+
<CarouselNotice
|
|
24
|
+
list={[
|
|
25
|
+
<p>
|
|
26
|
+
第一条<span style={{ color: 'pink' }}>粉色</span>滚动
|
|
27
|
+
</p>,
|
|
28
|
+
<p style={{ fontSize: '12px', color: 'red' }}>
|
|
29
|
+
第二条红色文字要小一些
|
|
30
|
+
</p>,
|
|
31
|
+
<p style={{ fontWeight: 'bold' }}>第3条滚动文字加粗</p>,
|
|
32
|
+
<p
|
|
33
|
+
onClick={() => {
|
|
34
|
+
alert('点击了第4条轮播条目');
|
|
35
|
+
}}
|
|
36
|
+
style={{ textDecoration: 'underline' }}
|
|
37
|
+
>
|
|
38
|
+
第4条可点击
|
|
39
|
+
</p>,
|
|
40
|
+
]}
|
|
41
|
+
style={{ background: '#f0f0f0' }}
|
|
42
|
+
/>
|
|
43
|
+
|
|
44
|
+
<p>轮播条目左对齐:</p>
|
|
45
|
+
<CarouselNotice
|
|
46
|
+
justify="start"
|
|
47
|
+
list={['第一条滚动', '第二条滚动测试']}
|
|
48
|
+
style={{ border: '1px solid red' }}
|
|
49
|
+
/>
|
|
50
|
+
|
|
51
|
+
<p>轮播条目右对齐:</p>
|
|
52
|
+
<CarouselNotice
|
|
53
|
+
justify="end"
|
|
54
|
+
list={['第一条滚动', '第二条滚动测试']}
|
|
55
|
+
style={{ border: '1px solid red' }}
|
|
56
|
+
/>
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.Touchable {
|
|
2
|
+
padding: 0.1rem;
|
|
3
|
+
user-select: none;
|
|
4
|
+
.btntest {
|
|
5
|
+
margin-top: 0.5rem;
|
|
6
|
+
background-color: gray;
|
|
7
|
+
padding: 0.1rem;
|
|
8
|
+
> div {
|
|
9
|
+
padding: 0.1rem;
|
|
10
|
+
margin: 0.1rem;
|
|
11
|
+
background-color: #f0f0f0;
|
|
12
|
+
color: red;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.as {
|
|
17
|
+
margin-top: 0.2rem;
|
|
18
|
+
background-color: gray;
|
|
19
|
+
padding: 0.1rem;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Clickable } from '@';
|
|
4
|
+
|
|
5
|
+
export default function Index () {
|
|
6
|
+
return (
|
|
7
|
+
<div className="Touchable">
|
|
8
|
+
<Clickable className="btntest">
|
|
9
|
+
可点击元素
|
|
10
|
+
<Clickable>内嵌可点击元素</Clickable>
|
|
11
|
+
<Clickable bubble={false}>内嵌可点击元素 bubble=false</Clickable>
|
|
12
|
+
<Clickable activeStyle={{ backgroundColor: 'green', color: 'cyan' }}>
|
|
13
|
+
内嵌 activeStyle
|
|
14
|
+
</Clickable>
|
|
15
|
+
<Clickable
|
|
16
|
+
bubble={false}
|
|
17
|
+
activeStyle={{ backgroundColor: 'green', color: 'cyan' }}
|
|
18
|
+
>
|
|
19
|
+
内嵌 activeStyle bubble=false
|
|
20
|
+
</Clickable>
|
|
21
|
+
</Clickable>
|
|
22
|
+
|
|
23
|
+
<Clickable
|
|
24
|
+
className="as"
|
|
25
|
+
activeStyle={{ backgroundColor: 'green', color: 'cyan' }}
|
|
26
|
+
>
|
|
27
|
+
activeStyle
|
|
28
|
+
</Clickable>
|
|
29
|
+
|
|
30
|
+
<Clickable
|
|
31
|
+
disable
|
|
32
|
+
className="as"
|
|
33
|
+
activeStyle={{ backgroundColor: 'green', color: 'cyan' }}
|
|
34
|
+
>
|
|
35
|
+
activeStyle(禁用) disable=true
|
|
36
|
+
</Clickable>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import { Countdown, Countdowner } from "@";
|
|
3
|
+
|
|
4
|
+
export default function Index () {
|
|
5
|
+
const [show1, setShow1] = useState("");
|
|
6
|
+
const [show2, setShow2] = useState("");
|
|
7
|
+
const [show2Closed, setShow2Close] = useState(false);
|
|
8
|
+
const [show3, setShow3] = useState("");
|
|
9
|
+
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const cd1 = new Countdown({
|
|
12
|
+
remain: 1000,
|
|
13
|
+
format: "his",
|
|
14
|
+
onUpdate(result) {
|
|
15
|
+
setShow1(() => `${result.h}时${result.i}分${result.s}秒`);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
cd1.start();
|
|
19
|
+
|
|
20
|
+
const cd2 = new Countdown({
|
|
21
|
+
remain: 10,
|
|
22
|
+
format: "s",
|
|
23
|
+
onUpdate(result) {
|
|
24
|
+
setShow2(() => `${result.s}秒`);
|
|
25
|
+
},
|
|
26
|
+
onEnd() {
|
|
27
|
+
setShow2Close(() => true);
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
cd2.start();
|
|
31
|
+
|
|
32
|
+
const cd3 = new Countdown({
|
|
33
|
+
remain: 259205,
|
|
34
|
+
format: "dhis",
|
|
35
|
+
onUpdate(result) {
|
|
36
|
+
setShow3(() => `${result.d}天${result.h}时${result.i}分${result.s}秒`);
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
cd3.start();
|
|
40
|
+
|
|
41
|
+
return () => {
|
|
42
|
+
cd1.stop();
|
|
43
|
+
cd2.stop();
|
|
44
|
+
cd3.stop();
|
|
45
|
+
};
|
|
46
|
+
}, []);
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div>
|
|
50
|
+
<p>格式:his,总时长:1000秒</p>
|
|
51
|
+
<p style={{ color: "red" }}>{show1}</p>
|
|
52
|
+
<p>格式:s,总时长:10秒</p>
|
|
53
|
+
<p style={{ color: "red" }}>
|
|
54
|
+
{show2Closed ? (
|
|
55
|
+
<span style={{ color: "green" }}> 已触发结束事件</span>
|
|
56
|
+
) : (
|
|
57
|
+
show2
|
|
58
|
+
)}
|
|
59
|
+
</p>
|
|
60
|
+
<p>格式:dhis,总时长:259200秒</p>
|
|
61
|
+
<p style={{ color: "red" }}>{show3}</p>
|
|
62
|
+
<hr />
|
|
63
|
+
<p>下面是来自Countdowner组件的</p>
|
|
64
|
+
<Countdowner remain={100}/>
|
|
65
|
+
<Countdowner
|
|
66
|
+
remain={1234}
|
|
67
|
+
seperator="@"
|
|
68
|
+
seperatorStyle={{
|
|
69
|
+
transform: `rotate(45deg)`
|
|
70
|
+
}}
|
|
71
|
+
renderNumber={(n, key) => {
|
|
72
|
+
if (key === "i") {
|
|
73
|
+
return <strong>{n}</strong>;
|
|
74
|
+
} else {
|
|
75
|
+
return <span>{n}</span>;
|
|
76
|
+
}
|
|
77
|
+
}}
|
|
78
|
+
/>
|
|
79
|
+
<Countdowner
|
|
80
|
+
remain={1234}
|
|
81
|
+
seperator="@"
|
|
82
|
+
renderSeperator={(key)=>{
|
|
83
|
+
return <span style={{border: `1px solid red`}}>{key}</span>
|
|
84
|
+
}}
|
|
85
|
+
/>
|
|
86
|
+
<Countdowner
|
|
87
|
+
remain={10}
|
|
88
|
+
containerStyle={{
|
|
89
|
+
background: "rgba(0,0,0,.2)"
|
|
90
|
+
}}
|
|
91
|
+
onEnd={()=>{console.log("已结束");}}
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { showDialog, RowCenter } from "@";
|
|
3
|
+
import style from "./index.module.css";
|
|
4
|
+
|
|
5
|
+
export default function Index() {
|
|
6
|
+
return (
|
|
7
|
+
<div>
|
|
8
|
+
<p>
|
|
9
|
+
<button
|
|
10
|
+
onClick={async () => {
|
|
11
|
+
const close = await showDialog({
|
|
12
|
+
showMask: false,
|
|
13
|
+
blankClosable: true,
|
|
14
|
+
onHide: () => {
|
|
15
|
+
console.log("closed");
|
|
16
|
+
},
|
|
17
|
+
content: (
|
|
18
|
+
<RowCenter className={style.contentBox}>
|
|
19
|
+
<button
|
|
20
|
+
onClick={() => {
|
|
21
|
+
close();
|
|
22
|
+
}}
|
|
23
|
+
>
|
|
24
|
+
关闭
|
|
25
|
+
</button>
|
|
26
|
+
</RowCenter>
|
|
27
|
+
),
|
|
28
|
+
});
|
|
29
|
+
}}
|
|
30
|
+
>
|
|
31
|
+
普通弹框,没有遮罩,空白可关闭
|
|
32
|
+
</button>
|
|
33
|
+
</p>
|
|
34
|
+
<p>
|
|
35
|
+
<button
|
|
36
|
+
onClick={async () => {
|
|
37
|
+
const close = await showDialog({
|
|
38
|
+
id: "hello",
|
|
39
|
+
className: "world",
|
|
40
|
+
type: "pullUp",
|
|
41
|
+
showMask: false,
|
|
42
|
+
blankClosable: true,
|
|
43
|
+
content: (
|
|
44
|
+
<RowCenter className={style.contentBox}>
|
|
45
|
+
<button onClick={() => close()}>关闭</button>
|
|
46
|
+
</RowCenter>
|
|
47
|
+
),
|
|
48
|
+
});
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
从底部上拉出,没有遮罩,空白可关闭
|
|
52
|
+
</button>
|
|
53
|
+
</p>
|
|
54
|
+
<p>
|
|
55
|
+
<button
|
|
56
|
+
onClick={async () => {
|
|
57
|
+
const close = await showDialog({
|
|
58
|
+
type: "pullDown",
|
|
59
|
+
content: (
|
|
60
|
+
<RowCenter className={style.contentBox}>
|
|
61
|
+
<button onClick={() => close()}>关闭</button>
|
|
62
|
+
</RowCenter>
|
|
63
|
+
),
|
|
64
|
+
});
|
|
65
|
+
}}
|
|
66
|
+
>
|
|
67
|
+
从顶部下拉出,有遮罩,空白不可关闭
|
|
68
|
+
</button>
|
|
69
|
+
</p>
|
|
70
|
+
<p>
|
|
71
|
+
<button
|
|
72
|
+
onClick={async () => {
|
|
73
|
+
const close = await showDialog({
|
|
74
|
+
type: "pullRight",
|
|
75
|
+
content: (
|
|
76
|
+
<RowCenter className={style.contentBox}>
|
|
77
|
+
<button onClick={() => close()}>关闭</button>
|
|
78
|
+
</RowCenter>
|
|
79
|
+
),
|
|
80
|
+
});
|
|
81
|
+
}}
|
|
82
|
+
>
|
|
83
|
+
左侧往右侧拉出,有遮罩,空白不可关闭
|
|
84
|
+
</button>
|
|
85
|
+
</p>
|
|
86
|
+
<p>
|
|
87
|
+
<button
|
|
88
|
+
onClick={async () => {
|
|
89
|
+
const close = await showDialog({
|
|
90
|
+
type: "pullLeft",
|
|
91
|
+
content: (
|
|
92
|
+
<RowCenter className={style.contentBox}>
|
|
93
|
+
<button onClick={() => close()}>关闭</button>
|
|
94
|
+
</RowCenter>
|
|
95
|
+
),
|
|
96
|
+
});
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
右侧往左侧拉出,有遮罩,空白不可关闭
|
|
100
|
+
</button>
|
|
101
|
+
</p>
|
|
102
|
+
</div>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// import "./index.css";
|
|
2
|
+
// import React from "react";
|
|
3
|
+
// import { ImagePicker, SimpleImagePicker, Loading } from "@";
|
|
4
|
+
|
|
5
|
+
// export default function () {
|
|
6
|
+
// return (
|
|
7
|
+
// <div>
|
|
8
|
+
// <p>网格风格的图片选择器(多选)</p>
|
|
9
|
+
// <ImagePicker
|
|
10
|
+
// gutter=".32rem"
|
|
11
|
+
// // renderPickButton={() => {
|
|
12
|
+
// // return <span>Haha</span>;
|
|
13
|
+
// // }}
|
|
14
|
+
// multiple
|
|
15
|
+
// cols={4}
|
|
16
|
+
// // isSquare={false}
|
|
17
|
+
// onHookEachRound={() => {
|
|
18
|
+
// // 显示一个loading
|
|
19
|
+
// let loading = null;
|
|
20
|
+
// const onStartPick = () => {
|
|
21
|
+
// loading = new Loading();
|
|
22
|
+
// };
|
|
23
|
+
// const onEndPick = async () => {
|
|
24
|
+
// await loading?.close();
|
|
25
|
+
// };
|
|
26
|
+
// return { onStartPick, onEndPick };
|
|
27
|
+
// }}
|
|
28
|
+
// onFilesChange={(res) => {
|
|
29
|
+
// console.log(res);
|
|
30
|
+
// }}
|
|
31
|
+
// />
|
|
32
|
+
|
|
33
|
+
// <p>网格风格的自定义选取按钮的图片选择器(多选)</p>
|
|
34
|
+
// <ImagePicker
|
|
35
|
+
// multiple
|
|
36
|
+
// gutter={10}
|
|
37
|
+
// cols={4}
|
|
38
|
+
// maxPick={20}
|
|
39
|
+
// renderPickButton={(disabled) => {
|
|
40
|
+
// console.log(disabled);
|
|
41
|
+
// return <button>选取图片</button>;
|
|
42
|
+
// }}
|
|
43
|
+
// />
|
|
44
|
+
|
|
45
|
+
// <p>普通选择器(多选,结果需要自己处理)</p>
|
|
46
|
+
// <SimpleImagePicker
|
|
47
|
+
// multiple
|
|
48
|
+
// onHookEachRound={() => {
|
|
49
|
+
// // 显示一个loading
|
|
50
|
+
// let loading = null;
|
|
51
|
+
// const onStartPick = () => {
|
|
52
|
+
// loading = new Loading();
|
|
53
|
+
// };
|
|
54
|
+
// const onEndPick = async () => {
|
|
55
|
+
// await loading?.close();
|
|
56
|
+
// };
|
|
57
|
+
// return { onStartPick, onEndPick };
|
|
58
|
+
// }}
|
|
59
|
+
// onFilesChange={(res) => {
|
|
60
|
+
// console.log(res);
|
|
61
|
+
// }}
|
|
62
|
+
// />
|
|
63
|
+
// <p>自定义选取按钮普通选择器(单选,结果需要自己处理)</p>
|
|
64
|
+
// <SimpleImagePicker
|
|
65
|
+
// // multiple
|
|
66
|
+
// renderPickButton={() => {
|
|
67
|
+
// return <button>选取图片</button>;
|
|
68
|
+
// }}
|
|
69
|
+
// onFilesChange={(res) => {
|
|
70
|
+
// console.log(res);
|
|
71
|
+
// }}
|
|
72
|
+
// />
|
|
73
|
+
// <p>限制最大宽度(单选,结果需要自己处理)</p>
|
|
74
|
+
// <SimpleImagePicker
|
|
75
|
+
// // multiple
|
|
76
|
+
// renderPickButton={() => {
|
|
77
|
+
// return <button>选取图片</button>;
|
|
78
|
+
// }}
|
|
79
|
+
// onFilesChange={(res) => {
|
|
80
|
+
// console.log(res);
|
|
81
|
+
// }}
|
|
82
|
+
// loadImageOption={{
|
|
83
|
+
// maxWidth: 10
|
|
84
|
+
// }}
|
|
85
|
+
// />
|
|
86
|
+
// </div>
|
|
87
|
+
// );
|
|
88
|
+
// }
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { React } from "react";
|
|
2
|
+
import { history } from "@";
|
|
3
|
+
|
|
4
|
+
const pageConfig = [
|
|
5
|
+
{ path: "indicator", title: "Indicator菊花转圈指示器", enable: true },
|
|
6
|
+
{ path: "countdown", title: "Countdown倒计时", enable: true },
|
|
7
|
+
{ path: "alert", title: "showAlert弹框功能", enable: true },
|
|
8
|
+
{ path: "dialog", title: "showDialog对话框", enable: true },
|
|
9
|
+
// { path: 'layout', title: '常用布局组件', enable: false },
|
|
10
|
+
{ path: "toast", title: "showToast轻提示", enable: true },
|
|
11
|
+
{ path: "carouse-notice", title: "CarouseNotice轮播公告", enable: true },
|
|
12
|
+
{ path: "loading", title: "showLoading加载", enable: true },
|
|
13
|
+
{ path: "scrollview", title: "ScrollView滚动容器", enable: true },
|
|
14
|
+
{ path: "ago", title: "Ago多久以前", enable: true },
|
|
15
|
+
{ path: "overlay", title: "Overlay通用覆盖层", enable: true },
|
|
16
|
+
{ path: "clickable", title: "Clickable可触摸组件", enable: true },
|
|
17
|
+
// { path: 'privacy', title: 'Privacy去标识化', enable: true },
|
|
18
|
+
{ path: "autogrid", title: "AutoGrid生成自动对齐的表格", enable: true },
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
export default function Index() {
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
<ul className="Home">
|
|
25
|
+
{pageConfig.map((item) => {
|
|
26
|
+
return (
|
|
27
|
+
<li
|
|
28
|
+
className={item.enable ? "item" : "item-disable"}
|
|
29
|
+
key={item.path}
|
|
30
|
+
onClick={() => {
|
|
31
|
+
if (item.enable) {
|
|
32
|
+
history.push(`/${item.path}`);
|
|
33
|
+
}
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
{item.title}
|
|
37
|
+
<svg viewBox="0 0 1024 1024">
|
|
38
|
+
<path d="M347.687 144.188l-52.761 52.238 313.928 316.082-316.568 313.42 52.314 52.673 369.322-365.663z" />
|
|
39
|
+
</svg>
|
|
40
|
+
</li>
|
|
41
|
+
);
|
|
42
|
+
})}
|
|
43
|
+
</ul>
|
|
44
|
+
</>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
|
|
2
|
+
.backHome {
|
|
3
|
+
padding: 0.3rem;
|
|
4
|
+
border-bottom: 1px solid #ccc;
|
|
5
|
+
}
|
|
6
|
+
.Home {
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: 0;
|
|
9
|
+
list-style-type: none;
|
|
10
|
+
.item,
|
|
11
|
+
.item-disable {
|
|
12
|
+
font-size: 0.36rem;
|
|
13
|
+
padding: 0.2rem 0.3rem;
|
|
14
|
+
position: relative;
|
|
15
|
+
border-bottom: 1px solid #f5f5f5;
|
|
16
|
+
svg {
|
|
17
|
+
width: 0.48rem;
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: 50%;
|
|
20
|
+
right: 0.3rem;
|
|
21
|
+
transform: translateY(-50%);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
.item-disable {
|
|
25
|
+
color: #ddd;
|
|
26
|
+
svg {
|
|
27
|
+
path {
|
|
28
|
+
fill: #ddd;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
.item {
|
|
33
|
+
svg {
|
|
34
|
+
path {
|
|
35
|
+
fill: #666;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
&:active {
|
|
39
|
+
color: #007bff;
|
|
40
|
+
opacity: 0.5;
|
|
41
|
+
svg path {
|
|
42
|
+
fill: #007bff;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
.demo {
|
|
48
|
+
padding: 0.3rem;
|
|
49
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import './index.css';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { createApp, history } from '@';
|
|
4
|
+
import Home from './index/index';
|
|
5
|
+
|
|
6
|
+
createApp({
|
|
7
|
+
target: "#root",
|
|
8
|
+
// maxDocWidth: 10000,
|
|
9
|
+
async render(pathname) {
|
|
10
|
+
let page = await import(`./${pathname}/index.jsx`);
|
|
11
|
+
if (pathname === 'index') {
|
|
12
|
+
return <Home />;
|
|
13
|
+
}
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<div className="backHome">
|
|
17
|
+
<button
|
|
18
|
+
onClick={() => {
|
|
19
|
+
history.back();
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
回到首页
|
|
23
|
+
</button>
|
|
24
|
+
</div>
|
|
25
|
+
<div className="demo">
|
|
26
|
+
<page.default />
|
|
27
|
+
</div>
|
|
28
|
+
</>
|
|
29
|
+
);
|
|
30
|
+
},
|
|
31
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Indicator } from "@";
|
|
3
|
+
|
|
4
|
+
export default function Index () {
|
|
5
|
+
return (
|
|
6
|
+
<div>
|
|
7
|
+
<p>常规圆角条</p>
|
|
8
|
+
<Indicator barColor="#000" />
|
|
9
|
+
<p>直角条</p>
|
|
10
|
+
<Indicator barColor="#000" rounded={false} />
|
|
11
|
+
<p>绿色条</p>
|
|
12
|
+
<Indicator barColor="green" />
|
|
13
|
+
<p>转圈速度变慢的绿色条</p>
|
|
14
|
+
<Indicator barColor="green" duration={1000} />
|
|
15
|
+
<p>20条</p>
|
|
16
|
+
<Indicator barColor="#000" barCount={20} />
|
|
17
|
+
<p>条宽度变大</p>
|
|
18
|
+
<Indicator barColor="#000" barWidth={10} />
|
|
19
|
+
<p>条宽度和高度一致</p>
|
|
20
|
+
<Indicator barColor="#000" barHeight={10} barWidth={10} barCount={16} />
|
|
21
|
+
<p>指示器尺寸变小</p>
|
|
22
|
+
<Indicator size=".4rem" barColor="#000" />
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { showLoading, showLoadingAtLeast } from "@";
|
|
3
|
+
|
|
4
|
+
export default function Index () {
|
|
5
|
+
return (
|
|
6
|
+
<div>
|
|
7
|
+
<p>普通加载(5秒后自动关闭)</p>
|
|
8
|
+
<button
|
|
9
|
+
onClick={async () => {
|
|
10
|
+
const close = await showLoading();
|
|
11
|
+
window.setTimeout(close, 5000);
|
|
12
|
+
}}
|
|
13
|
+
>
|
|
14
|
+
显示Loading
|
|
15
|
+
</button>
|
|
16
|
+
<p>普通加载带提示文字(5秒后自动关闭)</p>
|
|
17
|
+
<button
|
|
18
|
+
onClick={async () => {
|
|
19
|
+
const close = await showLoading("数据加载中...");
|
|
20
|
+
window.setTimeout(close, 5000);
|
|
21
|
+
}}
|
|
22
|
+
>
|
|
23
|
+
显示Loading
|
|
24
|
+
</button>
|
|
25
|
+
<p>至少展示2000毫秒</p>
|
|
26
|
+
<button
|
|
27
|
+
onClick={async () => {
|
|
28
|
+
const close = await showLoadingAtLeast(2000);
|
|
29
|
+
await close();
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
显示Loading
|
|
33
|
+
</button>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Overlay } from "@";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
|
|
4
|
+
export default function Index () {
|
|
5
|
+
const [show1, setShow1] = useState(false);
|
|
6
|
+
const [show2, setShow2] = useState(false);
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<p>
|
|
11
|
+
<button onClick={() => setShow1(true)}>Overlay显示在当前位置</button>
|
|
12
|
+
</p>
|
|
13
|
+
<p>
|
|
14
|
+
<button onClick={() => setShow2(true)}>
|
|
15
|
+
Overlay显示在外部(body下方)
|
|
16
|
+
</button>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
{show1 && (
|
|
20
|
+
<Overlay onClick={() => setShow1(false)}>
|
|
21
|
+
<div style={{ color: "#fff" }}>Overlay显示在虚拟DOM中插入的位置</div>
|
|
22
|
+
</Overlay>
|
|
23
|
+
)}
|
|
24
|
+
{show2 && (
|
|
25
|
+
<Overlay outside onClick={() => setShow2(false)}>
|
|
26
|
+
<div style={{ color: "#fff" }}>Overlay显示在最外面,默认body下新创建的DOM中</div>
|
|
27
|
+
</Overlay>
|
|
28
|
+
)}
|
|
29
|
+
</>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// import './index.css';
|
|
2
|
+
// import React from 'react';
|
|
3
|
+
// import { PrivacyContent } from '@';
|
|
4
|
+
|
|
5
|
+
// export default function () {
|
|
6
|
+
// return (
|
|
7
|
+
// <div className="Privacy">
|
|
8
|
+
// <div className="item">
|
|
9
|
+
// <p>
|
|
10
|
+
// 134<strong>56567</strong>657(手机号)
|
|
11
|
+
// <br />
|
|
12
|
+
// <i>包含模式:从第3位到第7位</i>
|
|
13
|
+
// </p>
|
|
14
|
+
// <p>
|
|
15
|
+
// <PrivacyContent start={3} end={7} type="include">
|
|
16
|
+
// 13456567657
|
|
17
|
+
// </PrivacyContent>
|
|
18
|
+
// </p>
|
|
19
|
+
// </div>
|
|
20
|
+
// <div className="item">
|
|
21
|
+
// <p>
|
|
22
|
+
// <strong>42028</strong>1199509164<strong>579</strong>(身份证号)
|
|
23
|
+
// <br />
|
|
24
|
+
// <i>排除模式:排除开头5位和结尾3位</i>
|
|
25
|
+
// </p>
|
|
26
|
+
// <p>
|
|
27
|
+
// <PrivacyContent start={5} end={3} type="exclude">
|
|
28
|
+
// 420281199509164579
|
|
29
|
+
// </PrivacyContent>
|
|
30
|
+
// </p>
|
|
31
|
+
// </div>
|
|
32
|
+
// </div>
|
|
33
|
+
// );
|
|
34
|
+
// }
|