Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a1e23dd

Browse filesBrowse files
authored
Merge branch 'master' into master
2 parents 043303e + 676f671 commit a1e23dd
Copy full SHA for a1e23dd

File tree

Expand file treeCollapse file tree

95 files changed

+590
-454
lines changed
Open diff view settings
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

95 files changed

+590
-454
lines changed
Open diff view settings
Collapse file

‎.flowconfig‎

Copy file name to clipboardExpand all lines: .flowconfig
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ flow
88

99
[options]
1010
esproposal.class_static_fields=enable
11-
unsafe.enable_getters_and_setters=true
Collapse file

‎.travis.yml‎

Copy file name to clipboardExpand all lines: .travis.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22
node_js:
3-
- "6"
3+
- "10"
44

55
env:
66
- TRAVIS_CI=1
Collapse file

‎build/site/index.html‎

Copy file name to clipboardExpand all lines: build/site/index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
88
</head>
99
<body>
10-
<div id="app" />
10+
<div id="app"></div>
1111
</body>
1212
</html>
Collapse file

‎build/site/webpack.config.js‎

Copy file name to clipboard
+32-46Lines changed: 32 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const path = require('path');
22
const webpack = require('webpack');
33
const HtmlWebpackPlugin = require('html-webpack-plugin');
4-
const ExtractTextPlugin = require('extract-text-webpack-plugin');
4+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
55

66
const basePath = path.resolve(__dirname, '../../');
77

@@ -14,8 +14,11 @@ module.exports = {
1414
chunkFilename: '[chunkhash:12].js',
1515
filename: '[chunkhash:12].js'
1616
},
17+
optimization: {
18+
minimize: true
19+
},
1720
plugins: [
18-
new ExtractTextPlugin({
21+
new MiniCssExtractPlugin({
1922
filename: '[chunkhash:12].css'
2023
}),
2124
new HtmlWebpackPlugin({
@@ -24,53 +27,36 @@ module.exports = {
2427
})
2528
].concat(process.env.TRAVIS_CI ? [] : [
2629
new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('production') }),
27-
new webpack.optimize.ModuleConcatenationPlugin(),
28-
new webpack.optimize.UglifyJsPlugin({
29-
mangle: {
30-
keep_fnames: true
31-
},
32-
output: {
33-
comments: false
34-
}
35-
})
30+
new webpack.optimize.ModuleConcatenationPlugin()
3631
]),
3732
resolve: {
3833
extensions: ['.js', '.jsx']
3934
},
4035
module: {
41-
rules: [
42-
{
43-
test: /\.jsx?$/,
44-
loader: 'babel-loader',
45-
include: [
46-
path.join(basePath, 'site'),
47-
path.join(basePath, 'src'),
48-
path.join(basePath, 'libs')
49-
]
50-
},
51-
{
52-
test: /\.css$/,
53-
loader: ExtractTextPlugin.extract({
54-
fallback: 'style-loader',
55-
use: 'css-loader'
56-
})
57-
},
58-
{
59-
test: /\.scss$/,
60-
use: ['style-loader', 'css-loader', 'sass-loader']
61-
},
62-
{
63-
test: /\.(ttf|eot|svg|woff|woff2)(\?.+)?$/,
64-
loader: 'file-loader?name=[hash:12].[ext]'
65-
},
66-
{
67-
test: /\.(jpe?g|png|gif)(\?.+)?$/,
68-
loader: 'url-loader?name=[hash:12].[ext]&limit=25000'
69-
},
70-
{
71-
test: /\.md$/,
72-
loader : 'raw-loader'
73-
}
74-
]
75-
}
36+
rules: [{
37+
test: /\.jsx?$/,
38+
loader: 'babel-loader',
39+
include: [
40+
path.join(basePath, 'site'),
41+
path.join(basePath, 'src'),
42+
path.join(basePath, 'libs')
43+
]
44+
}, {
45+
test: /\.css$/,
46+
use: [MiniCssExtractPlugin.loader, "css-loader"]
47+
}, {
48+
test: /\.scss$/,
49+
use: ['style-loader', 'css-loader', 'sass-loader']
50+
}, {
51+
test: /\.(ttf|eot|svg|woff|woff2)(\?.+)?$/,
52+
loader: 'file-loader?name=[hash:12].[ext]'
53+
}, {
54+
test: /\.(jpe?g|png|gif)(\?.+)?$/,
55+
loader: 'url-loader?name=[hash:12].[ext]&limit=25000'
56+
}, {
57+
test: /\.md$/,
58+
loader: 'raw-loader'
59+
}]
60+
},
61+
mode: 'production'
7662
};
Collapse file

‎flow/modules.js‎

Copy file name to clipboard
+6-19Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
declare module 'popper.js' {
2-
declare var exports: any
2+
declare export default any;
33
}
44

55
declare module 'classnames' {
@@ -9,27 +9,14 @@ declare module 'classnames' {
99
}
1010

1111
declare module 'react-click-outside' {
12-
declare var exports: {
13-
(module: any): any
14-
}
12+
declare module.exports: any;
1513
}
1614

17-
declare module 'throttle-debounce/throttle' {
18-
declare var exports: {
19-
(...args: Array<any>): any
20-
}
21-
}
22-
23-
declare module 'throttle-debounce/debounce' {
24-
declare var exports: {
25-
(...args: Array<any>): any
26-
}
15+
declare module 'throttle-debounce' {
16+
declare var debounce: any;
17+
declare var throttle: any;
2718
}
2819

2920
declare module 'async-validator' {
30-
declare class AsyncValidator {
31-
constructor(options: Object): void;
32-
validate(...args: Array<any>): void;
33-
}
34-
declare var exports: typeof AsyncValidator;
21+
declare export default any;
3522
}
Collapse file

‎libs/animate/index.js‎

Copy file name to clipboard
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Transition from './transition'
2+
3+
export default { Transition }
Collapse file

‎libs/animate/transition.jsx‎

Copy file name to clipboard
+68Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import React, { Component } from 'react';
2+
import { Transition as ReactTransition } from 'react-transition-group';
3+
import { View } from '../';
4+
5+
const noneFun = () => undefined;
6+
7+
class Transition extends Component {
8+
9+
render() {
10+
const {
11+
in: inProp,
12+
onEnter,
13+
onEntering,
14+
onEntered,
15+
onExit,
16+
onExiting,
17+
onExited,
18+
addEndListener,
19+
unmountOnExit,
20+
appear,
21+
duration,
22+
mountOnEnter,
23+
transitionClass
24+
} = this.props;
25+
return (
26+
<ReactTransition
27+
onEnter={() => onEnter()}
28+
onEntering={() => onEntering()}
29+
onEntered={() => onEntered()}
30+
onExit={() => onExit()}
31+
onExiting={() => onExiting()}
32+
onExited={() => onExited()}
33+
addEndListener={() => addEndListener()}
34+
in={inProp}
35+
mountOnEnter={mountOnEnter}
36+
unmountOnExit={unmountOnExit}
37+
appear={appear}
38+
timeout={duration}
39+
>
40+
{
41+
state => (
42+
<View
43+
className={transitionClass[state]}
44+
>
45+
{this.props.children}
46+
</View>
47+
)
48+
}
49+
</ReactTransition>
50+
);
51+
}
52+
}
53+
54+
Transition.defaultProps = {
55+
onEnter: noneFun,
56+
onEntering: noneFun,
57+
onEntered: noneFun,
58+
onExit: noneFun,
59+
onExiting: noneFun,
60+
onExited: noneFun,
61+
addEndListener: noneFun,
62+
mountOnEnter: false,
63+
unmountOnExit: false,
64+
appear: true,
65+
duration: 0
66+
}
67+
68+
export default Transition;
Collapse file

‎libs/collapse/index.jsx‎

Copy file name to clipboardExpand all lines: libs/collapse/index.jsx
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ const ANIMATION_DURATION = 300;
66

77
type Props = {
88
isShow: boolean,
9-
children?: React.Element<any>
9+
children: ?React.DOM
1010
};
1111

12-
export default class CollapseTransition extends Component {
12+
export default class CollapseTransition extends Component<Props, {}> {
1313
props: Props;
1414

1515
selfRef: any;
@@ -28,7 +28,7 @@ export default class CollapseTransition extends Component {
2828
this.leave();
2929
}
3030

31-
componentWillReceiveProps(nextProps: any){
31+
componentWillReceiveProps(nextProps: any) {
3232
if (this.props.isShow !== nextProps.isShow) this.triggerChange(nextProps.isShow);
3333
}
3434

@@ -106,7 +106,7 @@ export default class CollapseTransition extends Component {
106106

107107
afterLeave(): void {
108108
const el = this.selfRef;
109-
if (!el) return ;
109+
if (!el) return;
110110

111111
el.style.display = 'none';
112112
el.style.height = '';
@@ -115,7 +115,7 @@ export default class CollapseTransition extends Component {
115115
el.style.paddingBottom = el.dataset.oldPaddingBottom;
116116
}
117117

118-
render(): React.Element<any> {
118+
render(): React.DOM {
119119
return (
120120
<div
121121
className="collapse-transition"
Collapse file

‎libs/component/index.js‎

Copy file name to clipboardExpand all lines: libs/component/index.js
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ export default class Component extends React.Component {
88
}
99

1010
className(...args) {
11-
return this.classNames.apply(this, args.concat([this.props.className]));
11+
const { className } = this.props;
12+
return this.classNames.apply(this, args.concat([className]));
1213
}
1314

1415
style(args) {
15-
return Object.assign({}, args, this.props.style)
16+
const { style } = this.props;
17+
return Object.assign({}, args, style)
1618
}
1719
}
1820

Collapse file

‎libs/index.js‎

Copy file name to clipboardExpand all lines: libs/index.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ export { default as Transition } from './transition';
88
export { default as Component } from './component';
99
export { default as PropTypes } from './props';
1010
export { default as View } from './view';
11+
export { default as Animate } from './animate';

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.