cloud-business 0.1.98 → 0.1.99
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/.babelrc +22 -0
- package/.idea/cloud-business.iml +8 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/workspace.xml +698 -0
- package/LICENSE +21 -0
- package/README.md +2 -0
- package/assets.json +132 -0
- package/demos/app.js +86 -0
- package/demos/app.less +13 -0
- package/demos/assets/lib/prism.js +11 -0
- package/demos/assets/lib/prism.less +160 -0
- package/demos/components/code-box/assets/code.svg +1 -0
- package/demos/components/code-box/index.js +106 -0
- package/demos/components/code-box/index.less +204 -0
- package/demos/components/markdown/index.js +105 -0
- package/demos/components/markdown/index.less +937 -0
- package/demos/components/menu/index.js +75 -0
- package/demos/components/menu/index.less +73 -0
- package/demos/index.html +28 -0
- package/demos/index.js +16 -0
- package/{cloud-business.css → dist/cloud-business.css} +1 -2
- package/dist/cloud-business.esm.js +1 -0
- package/dist/cloud-business.js +5 -0
- package/dist/cloud-business.min.css +1 -0
- package/dist/cloud-business.min.js +1 -0
- package/dist/package.json +130 -0
- package/jsconfig.json +13 -0
- package/package.json +130 -1
- package/typings.d.ts +2 -0
- package/cloud-business.js +0 -5
- package/cloud-business.min.css +0 -1
- package/cloud-business.min.js +0 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import React, { useState, useEffect } from 'react';
|
|
3
|
+
import mixClass from 'classnames';
|
|
4
|
+
import classes from './index.less';
|
|
5
|
+
|
|
6
|
+
const getHash = (href = window.location.href) => {
|
|
7
|
+
return decodeURIComponent(href.split('#').pop());
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function MenuCategory({ title, children }) {
|
|
11
|
+
return (
|
|
12
|
+
<dl className={classes.menuCategory}>
|
|
13
|
+
<dt>{title}</dt>
|
|
14
|
+
<dd>{children}</dd>
|
|
15
|
+
</dl>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function MenuItem({ path, title, subtitle, activeKey, ...props }) {
|
|
20
|
+
const className = mixClass(classes.item, {
|
|
21
|
+
[classes.active]: activeKey === path
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<a className={className} href={`#${path}`} {...props}>
|
|
26
|
+
<span>{title}</span>
|
|
27
|
+
<span className={classes.subtitle}>{subtitle}</span>
|
|
28
|
+
</a>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default function Menu({ dataSource }) {
|
|
33
|
+
|
|
34
|
+
const [activeKey, setActiveKey] = useState(getHash());
|
|
35
|
+
const onChangeActiveKey = ({ target }) => setActiveKey(getHash(target.href));
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
setActiveKey(getHash());
|
|
39
|
+
}, []);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div className={classes.menu}>
|
|
43
|
+
{
|
|
44
|
+
dataSource.map(({title, subtitle, path, subMenu = []}, key) => {
|
|
45
|
+
if (!subMenu.length) {
|
|
46
|
+
return (
|
|
47
|
+
<MenuItem
|
|
48
|
+
key={key}
|
|
49
|
+
path={path}
|
|
50
|
+
title={title}
|
|
51
|
+
subtitle={subtitle}
|
|
52
|
+
activeKey={activeKey}
|
|
53
|
+
onClick={onChangeActiveKey} />
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<MenuCategory key={key} title={title} subMenu={subMenu}>
|
|
59
|
+
{
|
|
60
|
+
subMenu.map((props, subKey) => (
|
|
61
|
+
<MenuItem
|
|
62
|
+
{...props}
|
|
63
|
+
key={subKey}
|
|
64
|
+
activeKey={activeKey}
|
|
65
|
+
onClick={onChangeActiveKey} />
|
|
66
|
+
))
|
|
67
|
+
}
|
|
68
|
+
</MenuCategory>
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.menu {
|
|
2
|
+
margin-top: 20px;
|
|
3
|
+
width: 240px;
|
|
4
|
+
overflow: auto;
|
|
5
|
+
|
|
6
|
+
.menu-category {
|
|
7
|
+
margin: 0 0 1px 0;
|
|
8
|
+
|
|
9
|
+
&:first-child {
|
|
10
|
+
dt {
|
|
11
|
+
margin-top: 0;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
dt {
|
|
16
|
+
margin: 10px 0 0;
|
|
17
|
+
padding: 0;
|
|
18
|
+
font-size: 16px;
|
|
19
|
+
color: #333;
|
|
20
|
+
line-height: 40px;
|
|
21
|
+
height: 40px;
|
|
22
|
+
position: relative;
|
|
23
|
+
transition: .15s ease-out;
|
|
24
|
+
font-weight: 700;
|
|
25
|
+
user-select: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
dd {
|
|
29
|
+
margin-left: 0;
|
|
30
|
+
transition: .8s;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.hidden {
|
|
34
|
+
height: 0;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
opacity: 0;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.item {
|
|
41
|
+
@height: 40px;
|
|
42
|
+
|
|
43
|
+
display: block;
|
|
44
|
+
height: @height;
|
|
45
|
+
color: #444;
|
|
46
|
+
line-height: @height;
|
|
47
|
+
font-size: 14px;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
text-decoration: none;
|
|
50
|
+
white-space: nowrap;
|
|
51
|
+
text-overflow: ellipsis;
|
|
52
|
+
font-weight: 400;
|
|
53
|
+
transition: .3s;
|
|
54
|
+
|
|
55
|
+
> * {
|
|
56
|
+
pointer-events: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&:hover {
|
|
60
|
+
color: #1890ff;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&.active {
|
|
64
|
+
color: #1890ff;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.subtitle {
|
|
68
|
+
margin-left: 8px;
|
|
69
|
+
color: currentColor;
|
|
70
|
+
opacity: .5;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
package/demos/index.html
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
7
|
+
<!-- <link rel="stylesheet" href="https://cloud-cdn.shuyun.com/cloud-react/0.0.89/cloud-react.css"> -->
|
|
8
|
+
<title>demos</title>
|
|
9
|
+
<style>
|
|
10
|
+
html,
|
|
11
|
+
body,
|
|
12
|
+
#root {
|
|
13
|
+
height: 100vh;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
body {
|
|
17
|
+
margin: 0;
|
|
18
|
+
font-size: 14px;
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
21
|
+
<!-- <script src="https://cloud-cdn.shuyun.com/react/16.13.1/umd/react.production.min.js"></script>
|
|
22
|
+
<script src="https://cloud-cdn.shuyun.com/react-dom/16.13.1/umd/react-dom.production.min.js"></script>
|
|
23
|
+
<script src="https://cloud-cdn.shuyun.com/cloud-react/0.0.89/cloud-react.js"></script> -->
|
|
24
|
+
</head>
|
|
25
|
+
<body>
|
|
26
|
+
<main id="root"></main>
|
|
27
|
+
</body>
|
|
28
|
+
</html>
|
package/demos/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
import { HashRouter as Router } from 'react-router-dom';
|
|
4
|
+
import 'cloud-react/cloud-react.css';
|
|
5
|
+
|
|
6
|
+
import App from './app';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
const rootElement = document.getElementById('root');
|
|
10
|
+
|
|
11
|
+
ReactDOM.render(
|
|
12
|
+
<Router>
|
|
13
|
+
<App />
|
|
14
|
+
</Router>,
|
|
15
|
+
rootElement
|
|
16
|
+
);
|
|
@@ -5066,8 +5066,7 @@ input::-webkit-search-cancel-button {
|
|
|
5066
5066
|
}
|
|
5067
5067
|
.newCloud-pagination ul {
|
|
5068
5068
|
display: flex;
|
|
5069
|
-
-
|
|
5070
|
-
padding-inline-start: 0;
|
|
5069
|
+
padding-inline-start: 0;
|
|
5071
5070
|
}
|
|
5072
5071
|
.newCloud-pagination ul li {
|
|
5073
5072
|
min-width: 32px;
|