@sis-cc/dotstatsuite-components 14.3.3 → 14.3.4
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/lib/viewer/src/index.js +13 -2
- package/package.json +1 -1
- package/src/viewer/src/index.js +13 -5
package/lib/viewer/src/index.js
CHANGED
|
@@ -38,6 +38,10 @@ 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
|
+
|
|
41
45
|
var _options = require('./chartUtils/options');
|
|
42
46
|
|
|
43
47
|
var _options2 = _interopRequireDefault(_options);
|
|
@@ -100,8 +104,15 @@ var ViewContent = function ViewContent(_ref3) {
|
|
|
100
104
|
errorMessage = _ref3.errorMessage,
|
|
101
105
|
rest = (0, _objectWithoutProperties3.default)(_ref3, ['loading', 'loadingProps', 'noData', 'type', 'width', 'errorMessage']);
|
|
102
106
|
|
|
103
|
-
|
|
104
|
-
if (
|
|
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
|
+
});
|
|
105
116
|
if (errorMessage) return _react2.default.createElement(_dotstatsuiteVisions.NoData, { message: errorMessage });
|
|
106
117
|
|
|
107
118
|
if (type === 'table') {
|
package/package.json
CHANGED
package/src/viewer/src/index.js
CHANGED
|
@@ -3,8 +3,9 @@ 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 {
|
|
6
|
+
import { NoData as IconMessage, TableHtml5 } from '@sis-cc/dotstatsuite-visions';
|
|
7
7
|
import { useTheme, makeStyles } from '@material-ui/core/styles';
|
|
8
|
+
import HourglassEmptyIcon from '@material-ui/icons/HourglassEmpty';
|
|
8
9
|
import getChartOptions from './chartUtils/options';
|
|
9
10
|
import Header from './header';
|
|
10
11
|
import Chart from './chart';
|
|
@@ -34,14 +35,21 @@ const useStyles = makeStyles(() => ({
|
|
|
34
35
|
}));
|
|
35
36
|
|
|
36
37
|
const ViewContent = ({ loading, loadingProps={}, noData = 'No Data', type, width, errorMessage, ...rest }) => {
|
|
37
|
-
|
|
38
|
-
if (
|
|
39
|
-
|
|
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} />;
|
|
40
48
|
|
|
41
49
|
if (type === 'table') {
|
|
42
50
|
const tableProps = R.propOr({}, 'tableProps', rest);
|
|
43
51
|
const hasNoObs = R.pipe(R.prop('cells'), R.anyPass([R.isNil, R.isEmpty]))(tableProps);
|
|
44
|
-
if (hasNoObs) return <
|
|
52
|
+
if (hasNoObs) return <IconMessage message={noData} />;
|
|
45
53
|
|
|
46
54
|
return <TableHtml5 isRtl={R.prop('isRtl', rest)} {...tableProps} />;
|
|
47
55
|
}
|