cloud-business 0.1.102 → 0.1.103
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/{dist/cloud-business.css → cloud-business.css} +2 -1
- package/cloud-business.js +5 -0
- package/cloud-business.min.css +1 -0
- package/cloud-business.min.js +1 -0
- package/package.json +1 -130
- package/.babelrc +0 -22
- package/.idea/cloud-business.iml +0 -8
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/.idea/workspace.xml +0 -698
- package/LICENSE +0 -21
- package/README.md +0 -2
- package/assets.json +0 -132
- package/demos/app.js +0 -86
- package/demos/app.less +0 -13
- package/demos/assets/lib/prism.js +0 -11
- package/demos/assets/lib/prism.less +0 -160
- package/demos/components/code-box/assets/code.svg +0 -1
- package/demos/components/code-box/index.js +0 -106
- package/demos/components/code-box/index.less +0 -204
- package/demos/components/markdown/index.js +0 -105
- package/demos/components/markdown/index.less +0 -937
- package/demos/components/menu/index.js +0 -75
- package/demos/components/menu/index.less +0 -73
- package/demos/index.html +0 -28
- package/demos/index.js +0 -16
- package/dist/cloud-business.js +0 -5
- package/dist/cloud-business.min.css +0 -1
- package/dist/cloud-business.min.js +0 -1
- package/dist/package.json +0 -130
- package/jsconfig.json +0 -13
- package/typings.d.ts +0 -2
|
@@ -1,75 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
);
|