@sis-cc/dotstatsuite-visions 7.11.3 → 7.12.1

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.
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
+ import cx from 'classnames';
2
3
  import PropTypes from 'prop-types';
3
4
  import { makeStyles } from '@material-ui/core/styles';
4
5
  import Typography from '@material-ui/core/Typography';
5
- import CircularProgress from '@material-ui/core/CircularProgress';
6
6
 
7
7
  var useStyles = makeStyles(function (theme) {
8
8
  return {
@@ -14,27 +14,47 @@ var useStyles = makeStyles(function (theme) {
14
14
  justifyContent: 'center',
15
15
  alignItems: 'center'
16
16
  },
17
- progress: {
18
- margin: theme.spacing(2),
19
- color: function color(_ref) {
20
- var isWarning = _ref.isWarning;
21
- return isWarning ? theme.palette.warning.main : theme.palette.primary.main;
17
+ circularProgress: {
18
+ width: '48px',
19
+ height: ' 48px',
20
+ borderStyle: 'solid',
21
+ borderWidth: '5px',
22
+ borderColor: theme.palette.primary.main,
23
+ borderBottomColor: 'transparent',
24
+ borderRadius: '50%',
25
+ display: 'inline-block',
26
+ boxSizing: 'border-box',
27
+ animation: '$rotate 1s linear infinite',
28
+ margin: theme.spacing(2)
29
+ },
30
+ '@keyframes rotate': {
31
+ '0%': {
32
+ transform: 'rotate(0deg)'
33
+ },
34
+ '100%': {
35
+ transform: 'rotate(360deg)'
22
36
  }
37
+ },
38
+ warning: {
39
+ borderColor: theme.palette.warning.main,
40
+ borderBottomColor: 'transparent'
23
41
  }
24
42
  };
25
43
  });
26
44
 
27
- var Loading = function Loading(_ref2) {
28
- var message = _ref2.message,
29
- _ref2$isWarning = _ref2.isWarning,
30
- isWarning = _ref2$isWarning === undefined ? false : _ref2$isWarning;
45
+ var Loading = function Loading(_ref) {
46
+ var _cx;
47
+
48
+ var message = _ref.message,
49
+ _ref$isWarning = _ref.isWarning,
50
+ isWarning = _ref$isWarning === undefined ? false : _ref$isWarning;
31
51
 
32
- var classes = useStyles({ isWarning: isWarning });
52
+ var classes = useStyles();
33
53
 
34
54
  return React.createElement(
35
55
  'div',
36
56
  { className: classes.root },
37
- React.createElement(CircularProgress, { className: classes.progress }),
57
+ React.createElement('div', { className: cx(classes.circularProgress, (_cx = {}, _cx[classes.warning] = isWarning, _cx)) }),
38
58
  React.createElement(
39
59
  Typography,
40
60
  { variant: 'subtitle1', noWrap: true, align: 'center' },
@@ -95,6 +95,13 @@ var ScopeList = function ScopeList(props) {
95
95
  }, 0);
96
96
  }, [isLoading, items, itemsById, disableAccessor]);
97
97
 
98
+ useEffect(function () {
99
+ var scrollEl = R.path(['children', 0, 'children', 0], ref.current);
100
+ if (scrollEl) {
101
+ setScrollTop(0);
102
+ }
103
+ }, [R.prop('id', R.last(currentItem || []))]);
104
+
98
105
  useEffect(function () {
99
106
  var current = ref.current;
100
107
  var handler = function handler(event) {
@@ -27,7 +27,6 @@ var useStyles = makeStyles(function (theme) {
27
27
  display: 'inline',
28
28
  fontWeight: 'bold',
29
29
  fontStyle: 'normal',
30
- textTransform: 'uppercase',
31
30
  position: 'relative',
32
31
  top: '-4px'
33
32
  }, R.pathOr({}, ['mixins', 'table', 'flag'], theme)),
@@ -6,6 +6,10 @@ var _react = require('react');
6
6
 
7
7
  var _react2 = _interopRequireDefault(_react);
8
8
 
9
+ var _classnames = require('classnames');
10
+
11
+ var _classnames2 = _interopRequireDefault(_classnames);
12
+
9
13
  var _propTypes = require('prop-types');
10
14
 
11
15
  var _propTypes2 = _interopRequireDefault(_propTypes);
@@ -16,10 +20,6 @@ var _Typography = require('@material-ui/core/Typography');
16
20
 
17
21
  var _Typography2 = _interopRequireDefault(_Typography);
18
22
 
19
- var _CircularProgress = require('@material-ui/core/CircularProgress');
20
-
21
- var _CircularProgress2 = _interopRequireDefault(_CircularProgress);
22
-
23
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
24
 
25
25
  var useStyles = (0, _styles.makeStyles)(function (theme) {
@@ -32,27 +32,47 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
32
32
  justifyContent: 'center',
33
33
  alignItems: 'center'
34
34
  },
35
- progress: {
36
- margin: theme.spacing(2),
37
- color: function color(_ref) {
38
- var isWarning = _ref.isWarning;
39
- return isWarning ? theme.palette.warning.main : theme.palette.primary.main;
35
+ circularProgress: {
36
+ width: '48px',
37
+ height: ' 48px',
38
+ borderStyle: 'solid',
39
+ borderWidth: '5px',
40
+ borderColor: theme.palette.primary.main,
41
+ borderBottomColor: 'transparent',
42
+ borderRadius: '50%',
43
+ display: 'inline-block',
44
+ boxSizing: 'border-box',
45
+ animation: '$rotate 1s linear infinite',
46
+ margin: theme.spacing(2)
47
+ },
48
+ '@keyframes rotate': {
49
+ '0%': {
50
+ transform: 'rotate(0deg)'
51
+ },
52
+ '100%': {
53
+ transform: 'rotate(360deg)'
40
54
  }
55
+ },
56
+ warning: {
57
+ borderColor: theme.palette.warning.main,
58
+ borderBottomColor: 'transparent'
41
59
  }
42
60
  };
43
61
  });
44
62
 
45
- var Loading = function Loading(_ref2) {
46
- var message = _ref2.message,
47
- _ref2$isWarning = _ref2.isWarning,
48
- isWarning = _ref2$isWarning === undefined ? false : _ref2$isWarning;
63
+ var Loading = function Loading(_ref) {
64
+ var _cx;
65
+
66
+ var message = _ref.message,
67
+ _ref$isWarning = _ref.isWarning,
68
+ isWarning = _ref$isWarning === undefined ? false : _ref$isWarning;
49
69
 
50
- var classes = useStyles({ isWarning: isWarning });
70
+ var classes = useStyles();
51
71
 
52
72
  return _react2.default.createElement(
53
73
  'div',
54
74
  { className: classes.root },
55
- _react2.default.createElement(_CircularProgress2.default, { className: classes.progress }),
75
+ _react2.default.createElement('div', { className: (0, _classnames2.default)(classes.circularProgress, (_cx = {}, _cx[classes.warning] = isWarning, _cx)) }),
56
76
  _react2.default.createElement(
57
77
  _Typography2.default,
58
78
  { variant: 'subtitle1', noWrap: true, align: 'center' },
@@ -148,6 +148,13 @@ var ScopeList = function ScopeList(props) {
148
148
  }, 0);
149
149
  }, [isLoading, items, itemsById, disableAccessor]);
150
150
 
151
+ (0, _react.useEffect)(function () {
152
+ var scrollEl = R.path(['children', 0, 'children', 0], ref.current);
153
+ if (scrollEl) {
154
+ setScrollTop(0);
155
+ }
156
+ }, [R.prop('id', R.last(currentItem || []))]);
157
+
151
158
  (0, _react.useEffect)(function () {
152
159
  var current = ref.current;
153
160
  var handler = function handler(event) {
@@ -54,7 +54,6 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
54
54
  display: 'inline',
55
55
  fontWeight: 'bold',
56
56
  fontStyle: 'normal',
57
- textTransform: 'uppercase',
58
57
  position: 'relative',
59
58
  top: '-4px'
60
59
  }, R.pathOr({}, ['mixins', 'table', 'flag'], theme)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-visions",
3
- "version": "7.11.3",
3
+ "version": "7.12.1",
4
4
  "description": "Library of visual components",
5
5
  "author": "OECD",
6
6
  "homepage": "https://visions-qa.siscc.org/#o",