@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.
- package/lib/viewer/src/index.js +2 -13
- package/package.json +1 -1
- package/src/viewer/src/index.js +5 -13
package/lib/viewer/src/index.js
CHANGED
|
@@ -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
|
-
|
|
108
|
-
if (
|
|
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
package/src/viewer/src/index.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
39
|
-
if (
|
|
40
|
-
|
|
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 <
|
|
44
|
+
if (hasNoObs) return <NoData message={noData} />;
|
|
53
45
|
|
|
54
46
|
return <TableHtml5 isRtl={R.prop('isRtl', rest)} {...tableProps} />;
|
|
55
47
|
}
|