@sis-cc/dotstatsuite-components 14.3.5 → 14.3.6

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.
@@ -38,10 +38,6 @@ var _dotstatsuiteVisions = require('@sis-cc/dotstatsuite-visions');
38
38
 
39
39
  var _styles = require('@material-ui/core/styles');
40
40
 
41
- var _HourglassEmpty = require('@material-ui/icons/HourglassEmpty');
42
-
43
- var _HourglassEmpty2 = _interopRequireDefault(_HourglassEmpty);
44
-
45
41
  var _options = require('./chartUtils/options');
46
42
 
47
43
  var _options2 = _interopRequireDefault(_options);
@@ -104,15 +100,8 @@ var ViewContent = function ViewContent(_ref3) {
104
100
  errorMessage = _ref3.errorMessage,
105
101
  rest = (0, _objectWithoutProperties3.default)(_ref3, ['loading', 'loadingProps', 'noData', 'type', 'width', 'errorMessage']);
106
102
 
107
- var theme = (0, _styles.useTheme)();
108
- if (loading) return _react2.default.createElement(_dotstatsuiteVisions.NoData, {
109
- message: loading,
110
- icon: _react2.default.createElement(_HourglassEmpty2.default, { style: { fontSize: 50, color: loadingProps.isWarning ? theme.palette.warning.main : theme.palette.primary.main } })
111
- });
112
- if (!width) return _react2.default.createElement(_dotstatsuiteVisions.NoData, {
113
- message: loading,
114
- icon: _react2.default.createElement(_HourglassEmpty2.default, { style: { fontSize: 50, color: loadingProps.isWarning ? theme.palette.warning.main : theme.palette.primary.main } })
115
- });
103
+ if (loading) return _react2.default.createElement(_dotstatsuiteVisions.Loading, (0, _extends3.default)({ message: loading }, loadingProps));
104
+ if (!width) return _react2.default.createElement(_dotstatsuiteVisions.Loading, (0, _extends3.default)({ message: loading }, loadingProps));
116
105
  if (errorMessage) return _react2.default.createElement(_dotstatsuiteVisions.NoData, { message: errorMessage });
117
106
 
118
107
  if (type === 'table') {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-components",
3
3
  "description": "Set components based on React.",
4
- "version": "14.3.5",
4
+ "version": "14.3.6",
5
5
  "main": "lib/index.js",
6
6
  "author": "OECD",
7
7
  "license": "MIT",
@@ -3,9 +3,8 @@ import * as R from 'ramda';
3
3
  import cx from 'classnames';
4
4
  import { compose, withState, withProps } from 'recompose';
5
5
  import sizeMe from 'react-sizeme';
6
- import { NoData as IconMessage, TableHtml5 } from '@sis-cc/dotstatsuite-visions';
6
+ import { Loading, NoData, TableHtml5 } from '@sis-cc/dotstatsuite-visions';
7
7
  import { useTheme, makeStyles } from '@material-ui/core/styles';
8
- import HourglassEmptyIcon from '@material-ui/icons/HourglassEmpty';
9
8
  import getChartOptions from './chartUtils/options';
10
9
  import Header from './header';
11
10
  import Chart from './chart';
@@ -35,21 +34,14 @@ const useStyles = makeStyles(() => ({
35
34
  }));
36
35
 
37
36
  const ViewContent = ({ loading, loadingProps={}, noData = 'No Data', type, width, errorMessage, ...rest }) => {
38
- const theme = useTheme();
39
- if (loading) return <IconMessage
40
- message={loading}
41
- icon={<HourglassEmptyIcon style={{ fontSize: 50, color: loadingProps.isWarning ? theme.palette.warning.main : theme.palette.primary.main }} />}
42
- />;
43
- if (!width) return <IconMessage
44
- message={loading}
45
- icon={<HourglassEmptyIcon style={{ fontSize: 50, color: loadingProps.isWarning ? theme.palette.warning.main : theme.palette.primary.main }} />}
46
- />;
47
- if (errorMessage) return <IconMessage message={errorMessage} />;
37
+ if (loading) return <Loading message={loading} {...loadingProps} />;
38
+ if (!width) return <Loading message={loading} {...loadingProps} />;
39
+ if (errorMessage) return <NoData message={errorMessage} />;
48
40
 
49
41
  if (type === 'table') {
50
42
  const tableProps = R.propOr({}, 'tableProps', rest);
51
43
  const hasNoObs = R.pipe(R.prop('cells'), R.anyPass([R.isNil, R.isEmpty]))(tableProps);
52
- if (hasNoObs) return <IconMessage message={noData} />;
44
+ if (hasNoObs) return <NoData message={noData} />;
53
45
 
54
46
  return <TableHtml5 isRtl={R.prop('isRtl', rest)} {...tableProps} />;
55
47
  }