Skip to content

Commit dde48f1

Browse files
author
Marc-André Rivet
committed
Merge remote-tracking branch 'origin/dev' + build artifacts
2 parents e56ec43 + 107bcc0 commit dde48f1

29 files changed

+39762
-31593
lines changed

@plotly/dash-test-components/babel.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@ const presets = [
33
'@babel/preset-react'
44
];
55

6-
module.exports = { presets };
6+
const plugins = [
7+
'@babel/plugin-syntax-dynamic-import'
8+
];
9+
10+
module.exports = { presets, plugins };

@plotly/dash-test-components/package-lock.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

@plotly/dash-test-components/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@
2222
"devDependencies": {
2323
"@babel/cli": "^7.4.0",
2424
"@babel/core": "^7.4.0",
25+
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
2526
"@babel/preset-env": "^7.4.1",
2627
"@babel/preset-react": "^7.0.0",
28+
"@plotly/dash-component-plugins": "^1.2.0",
29+
"@plotly/webpack-dash-dynamic-import": "^1.1.5",
2730
"babel-loader": "^8.0.5",
2831
"npm-run-all": "^4.1.5",
2932
"react": "16.13.0",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import PropTypes from 'prop-types';
2+
import React, { Suspense } from 'react';
3+
import { asyncDecorator } from '@plotly/dash-component-plugins';
4+
import asyncComponentLoader from './../fragments/AsyncComponentLoader';
5+
6+
const AsyncComponent = props => (<Suspense fallback={null}>
7+
<RealAsyncComponent {...props} />
8+
</Suspense>);
9+
10+
const RealAsyncComponent = asyncDecorator(AsyncComponent, asyncComponentLoader);
11+
12+
AsyncComponent.propTypes = {
13+
id: PropTypes.string,
14+
value: PropTypes.string
15+
};
16+
17+
AsyncComponent.defaultProps = {};
18+
19+
export default AsyncComponent;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import PropTypes from 'prop-types';
2+
import React, { Fragment } from 'react';
3+
4+
const CollapseComponent = props => (<Fragment>
5+
{display ? props.children : null}
6+
</Fragment>);
7+
8+
CollapseComponent.propTypes = {
9+
children: PropTypes.node,
10+
display: PropTypes.bool,
11+
id: PropTypes.string
12+
};
13+
14+
CollapseComponent.defaultProps = {
15+
display: false
16+
};
17+
18+
export default CollapseComponent;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import PropTypes from 'prop-types';
2+
import React from 'react';
3+
4+
const DelayedEventComponent = ({ id, n_clicks, setProps }) => (<button
5+
id={id}
6+
onClick={() => setTimeout(() => setProps({ n_clicks: n_clicks + 1 }), 20)}
7+
/>);
8+
9+
DelayedEventComponent.propTypes = {
10+
id: PropTypes.string,
11+
n_clicks: PropTypes.number
12+
};
13+
14+
DelayedEventComponent.defaultProps = {
15+
n_clicks: 0
16+
};
17+
18+
export default DelayedEventComponent;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import PropTypes from 'prop-types';
2+
import React, { Fragment } from 'react';
3+
4+
const FragmentComponent = props => (<Fragment>
5+
{props.children}
6+
</Fragment>);
7+
8+
FragmentComponent.propTypes = {
9+
children: PropTypes.node,
10+
id: PropTypes.string
11+
};
12+
13+
FragmentComponent.defaultProps = {};
14+
15+
export default FragmentComponent;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import PropTypes from 'prop-types';
2+
import React, { Fragment } from 'react';
3+
4+
const WidthComponent = props => (<Fragment>
5+
{props.width}
6+
</Fragment>);
7+
8+
WidthComponent.propTypes = {
9+
id: PropTypes.string,
10+
width: PropTypes.number
11+
};
12+
13+
WidthComponent.defaultProps = {
14+
width: 0
15+
};
16+
17+
export default WidthComponent;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import PropTypes from 'prop-types';
2+
import React, { Fragment } from 'react';
3+
import { asyncDecorator } from '@plotly/dash-component-plugins';
4+
5+
/**
6+
* MyComponent description
7+
*/
8+
const AsyncComponent = ({ value }) => (<Fragment>
9+
{value}
10+
</Fragment>);
11+
12+
AsyncComponent.propTypes = {
13+
id: PropTypes.string,
14+
value: PropTypes.string
15+
};
16+
17+
AsyncComponent.defaultProps = {};
18+
19+
export default AsyncComponent;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default () => import('./AsyncComponent');

0 commit comments

Comments
 (0)