@sis-cc/dotstatsuite-visions 7.3.0 → 7.4.2

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.
@@ -93,7 +93,10 @@ var useStyles = makeStyles(function (theme) {
93
93
  padding: 0,
94
94
  marginLeft: 20,
95
95
  maxWidth: 270
96
- }, theme.typography.body1)
96
+ }, theme.typography.body1),
97
+ sideIconContainer: {
98
+ marginLeft: '10px'
99
+ }
97
100
  };
98
101
  });
99
102
 
@@ -137,7 +140,7 @@ var DataHeader = function DataHeader(_ref4) {
137
140
  title.label,
138
141
  !R.isNil(SideIcon) && React.createElement(
139
142
  'span',
140
- { style: { 'margin-left': '10px' } },
143
+ { className: classes.sideIconContainer },
141
144
  React.createElement(SideIcon, { sideProps: sideProps })
142
145
  ),
143
146
  React.createElement(Flags, { classes: classes, content: R.propOr([], 'flags', title) }),
@@ -24,10 +24,13 @@ var Period = function Period(_ref) {
24
24
 
25
25
  var classes = useStyles();
26
26
  var frequencies = getFrequencyOptions(availableFrequencies, labels);
27
+ console.log('frequencies', frequencies);
28
+ if (R.isEmpty(frequencies)) return null;
27
29
  var frequency = getDefaultFrequency({
28
30
  defaultFrequency: defaultFrequency,
29
31
  frequencies: R.pluck('value')(frequencies)
30
32
  });
33
+ console.log('frequency', frequency);
31
34
  var period = R.defaultTo([], _period);
32
35
  var boundaries = R.defaultTo([], _boundaries);
33
36
  var isPeriodDisabled = R.or(R.any(R.isEmpty)([period, boundaries]), periodDisabled);
@@ -114,11 +114,6 @@ export var getAjustedDate = function getAjustedDate(frequency) {
114
114
  };
115
115
 
116
116
  export var isValidNumber = R.both(R.is(Number), R.complement(R.equals(NaN)));
117
- export var getSupportFrequencies = function getSupportFrequencies(availableFrequencies) {
118
- return R.filter(function (freq) {
119
- return R.includes(freq)(supportedFrequenciesKey);
120
- })(availableFrequencies);
121
- };
122
117
  export var getDefaultFrequency = function getDefaultFrequency(_ref4) {
123
118
  var defaultFrequency = _ref4.defaultFrequency,
124
119
  frequencies = _ref4.frequencies;
@@ -128,10 +123,14 @@ export var getDefaultFrequency = function getDefaultFrequency(_ref4) {
128
123
  };
129
124
 
130
125
  export var getFrequencyOptions = function getFrequencyOptions(frequencyoptions, frequencyLabels) {
131
- var availableFrequencies = R.or(R.isEmpty(frequencyoptions), R.isNil(frequencyoptions)) ? [defaultfreq] : getSupportFrequencies(frequencyoptions);
132
- return R.map(function (option) {
133
- return { value: option, label: R.prop(option)(frequencyLabels) };
126
+ var availableFrequencies = R.or(R.isEmpty(frequencyoptions), R.isNil(frequencyoptions)) ? [defaultfreq] : R.filter(function (freq) {
127
+ return R.includes(freq, supportedFrequenciesKey);
128
+ })(frequencyoptions);
129
+ var options = R.map(function (option) {
130
+ return { value: option, label: R.prop(option, frequencyLabels) };
134
131
  })(availableFrequencies);
132
+ if (R.isEmpty(options)) return [{ value: 'A', label: R.propOr('Annual', 'A', frequencyLabels) }];
133
+ return options;
135
134
  };
136
135
 
137
136
  export var getLayout = function getLayout(type, range) {
@@ -10,6 +10,7 @@ import ListItemText from '@material-ui/core/ListItemText';
10
10
  import IconButton from '@material-ui/core/IconButton';
11
11
  import SvgIcon from '@material-ui/core/SvgIcon';
12
12
  import cx from 'classnames';
13
+ import { Tooltip } from '../';
13
14
 
14
15
  var checkBoxPath = 'M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z';
15
16
  var checkPath = 'M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z';
@@ -32,11 +33,13 @@ var Item = function Item(_ref) {
32
33
  var classes = _ref.classes,
33
34
  id = _ref.id,
34
35
  label = _ref.label,
36
+ description = _ref.description,
35
37
  _ref$nodePath = _ref.nodePath,
36
38
  nodePath = _ref$nodePath === undefined ? [] : _ref$nodePath,
37
39
  isSelected = _ref.isSelected,
38
40
  isDisabled = _ref.isDisabled,
39
41
  changeList = _ref.changeList,
42
+ changeListDescription = _ref.changeListDescription,
40
43
  ariaLabel = _ref.ariaLabel,
41
44
  NavigateIcon = _ref.NavigateIcon,
42
45
  changeSelection = _ref.changeSelection,
@@ -101,14 +104,24 @@ var Item = function Item(_ref) {
101
104
  React.createElement('path', { d: svgPath })
102
105
  ),
103
106
  React.createElement(
104
- Typography,
107
+ Tooltip,
105
108
  {
106
- 'data-testid': testId + '_value_' + id,
107
- color: 'inherit',
108
- variant: 'body2',
109
- className: cx(classes.label, (_cx6 = {}, _cx6[classes.disabledLabel] = isDisabled, _cx6))
109
+ title: R.isNil(description) ? '' : description,
110
+ tabIndex: 0,
111
+ 'aria-label': description,
112
+ 'aria-hidden': false,
113
+ placement: 'top'
110
114
  },
111
- label
115
+ React.createElement(
116
+ Typography,
117
+ {
118
+ 'data-testid': testId + '_value_' + id,
119
+ color: 'inherit',
120
+ variant: 'body2',
121
+ className: cx(classes.label, (_cx6 = {}, _cx6[classes.disabledLabel] = isDisabled, _cx6[classes.tooltipNotice] = !R.isNil(description), _cx6))
122
+ },
123
+ label
124
+ )
112
125
  ),
113
126
  R.not(R.isNil(count)) && React.createElement(
114
127
  Typography,
@@ -148,17 +161,28 @@ var Item = function Item(_ref) {
148
161
  }
149
162
  },
150
163
  React.createElement(
151
- IconButton,
164
+ Tooltip,
152
165
  {
153
- disableRipple: true,
154
- disableFocusRipple: true,
155
- className: classes.arrow,
156
- 'aria-label': ariaLabel,
157
- tabIndex: -1,
158
- size: 'small',
159
- color: 'inherit'
166
+ title: changeListDescription || '',
167
+ tabIndex: 0,
168
+ 'aria-label': changeListDescription,
169
+ 'aria-hidden': false,
170
+ placement: 'top',
171
+ variant: 'light'
160
172
  },
161
- React.createElement(NavigateIcon, null)
173
+ React.createElement(
174
+ IconButton,
175
+ {
176
+ disableRipple: true,
177
+ disableFocusRipple: true,
178
+ className: classes.arrow,
179
+ 'aria-label': ariaLabel,
180
+ tabIndex: -1,
181
+ size: 'small',
182
+ color: 'inherit'
183
+ },
184
+ React.createElement(NavigateIcon, null)
185
+ )
162
186
  )
163
187
  )
164
188
  );
@@ -168,6 +192,7 @@ Item.propTypes = process.env.NODE_ENV !== "production" ? {
168
192
  classes: PropTypes.object,
169
193
  id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
170
194
  label: PropTypes.string,
195
+ description: PropTypes.string,
171
196
  parentId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
172
197
  nodePath: PropTypes.array,
173
198
  ariaLabel: PropTypes.string,
@@ -177,6 +202,7 @@ Item.propTypes = process.env.NODE_ENV !== "production" ? {
177
202
  hasChild: PropTypes.bool,
178
203
  isSection: PropTypes.bool,
179
204
  changeList: PropTypes.func,
205
+ changeListDescription: PropTypes.string,
180
206
  changeSelection: PropTypes.func,
181
207
  changeMouseSelection: PropTypes.func,
182
208
  count: PropTypes.number,
@@ -244,6 +244,7 @@ var ScopeList = function ScopeList(props) {
244
244
  classes: classes,
245
245
  isRtl: isRtl,
246
246
  changeList: changeList,
247
+ changeListDescription: labels.childrenNavigateDesc,
247
248
  changeSelection: changeSelection,
248
249
  changeMouseSelection: changeMouseSelection,
249
250
  ariaLabel: R.prop('navigateNext')(labels),
@@ -284,6 +285,7 @@ ScopeList.propTypes = process.env.NODE_ENV !== "production" ? {
284
285
  isBlank: PropTypes.bool,
285
286
  isCurrentListAllSelected: PropTypes.bool,
286
287
  labels: PropTypes.shape({
288
+ childrenNavigateDesc: PropTypes.string,
287
289
  navigateNext: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
288
290
  backHelper: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
289
291
  selection: PropTypes.shape({
@@ -47,6 +47,7 @@
47
47
  * hasPath: PropTypes.bool,
48
48
  * changeSelection: PropTypes.func,
49
49
  * labels: {
50
+ * childrenNavigateDesc: PropTypes.string,
50
51
  * navigateBefore: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
51
52
  * navigateNext: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
52
53
  * backHelper: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
@@ -143,6 +143,9 @@ export var useStyles = makeStyles(function (theme) {
143
143
  },
144
144
  bulkSelectionIcon: {
145
145
  minWidth: 50
146
+ },
147
+ tooltipNotice: {
148
+ textDecoration: 'underline dotted'
146
149
  }
147
150
  };
148
151
  });
package/es/theme.js CHANGED
@@ -287,8 +287,7 @@ export var sisccTheme = function sisccTheme(_ref) {
287
287
  },
288
288
  table: {
289
289
  flag: {
290
- fontFamily: "'PT Sans Narrow', 'Helvetica Neue', Helvetica, Arial, sans-serif",
291
- fontSize: 12,
290
+ fontSize: 10,
292
291
  color: outerPalette.textLight || innerPalette.textLight
293
292
  },
294
293
  dot: {
@@ -133,7 +133,10 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
133
133
  padding: 0,
134
134
  marginLeft: 20,
135
135
  maxWidth: 270
136
- }, theme.typography.body1)
136
+ }, theme.typography.body1),
137
+ sideIconContainer: {
138
+ marginLeft: '10px'
139
+ }
137
140
  };
138
141
  });
139
142
 
@@ -177,7 +180,7 @@ var DataHeader = function DataHeader(_ref4) {
177
180
  title.label,
178
181
  !R.isNil(SideIcon) && _react2.default.createElement(
179
182
  'span',
180
- { style: { 'margin-left': '10px' } },
183
+ { className: classes.sideIconContainer },
181
184
  _react2.default.createElement(SideIcon, { sideProps: sideProps })
182
185
  ),
183
186
  _react2.default.createElement(_Flags2.default, { classes: classes, content: R.propOr([], 'flags', title) }),
@@ -49,10 +49,13 @@ var Period = function Period(_ref) {
49
49
 
50
50
  var classes = (0, _styles2.default)();
51
51
  var frequencies = (0, _lib.getFrequencyOptions)(availableFrequencies, labels);
52
+ console.log('frequencies', frequencies);
53
+ if (R.isEmpty(frequencies)) return null;
52
54
  var frequency = (0, _lib.getDefaultFrequency)({
53
55
  defaultFrequency: defaultFrequency,
54
56
  frequencies: R.pluck('value')(frequencies)
55
57
  });
58
+ console.log('frequency', frequency);
56
59
  var period = R.defaultTo([], _period);
57
60
  var boundaries = R.defaultTo([], _boundaries);
58
61
  var isPeriodDisabled = R.or(R.any(R.isEmpty)([period, boundaries]), periodDisabled);
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  exports.__esModule = true;
4
- exports.numeralFormat = exports.getDateInTheRange = exports.getDate = exports.getPeriodValue = exports.getLayout = exports.getFrequencyOptions = exports.getDefaultFrequency = exports.getSupportFrequencies = exports.isValidNumber = exports.getAjustedDate = exports.getRange = exports.getDestructuringDate = undefined;
4
+ exports.numeralFormat = exports.getDateInTheRange = exports.getDate = exports.getPeriodValue = exports.getLayout = exports.getFrequencyOptions = exports.getDefaultFrequency = exports.isValidNumber = exports.getAjustedDate = exports.getRange = exports.getDestructuringDate = undefined;
5
5
 
6
6
  var _numeralFormat;
7
7
 
@@ -132,11 +132,6 @@ var getAjustedDate = exports.getAjustedDate = function getAjustedDate(frequency)
132
132
  };
133
133
 
134
134
  var isValidNumber = exports.isValidNumber = R.both(R.is(Number), R.complement(R.equals(NaN)));
135
- var getSupportFrequencies = exports.getSupportFrequencies = function getSupportFrequencies(availableFrequencies) {
136
- return R.filter(function (freq) {
137
- return R.includes(freq)(supportedFrequenciesKey);
138
- })(availableFrequencies);
139
- };
140
135
  var getDefaultFrequency = exports.getDefaultFrequency = function getDefaultFrequency(_ref4) {
141
136
  var defaultFrequency = _ref4.defaultFrequency,
142
137
  frequencies = _ref4.frequencies;
@@ -146,10 +141,14 @@ var getDefaultFrequency = exports.getDefaultFrequency = function getDefaultFrequ
146
141
  };
147
142
 
148
143
  var getFrequencyOptions = exports.getFrequencyOptions = function getFrequencyOptions(frequencyoptions, frequencyLabels) {
149
- var availableFrequencies = R.or(R.isEmpty(frequencyoptions), R.isNil(frequencyoptions)) ? [_constants.defaultfreq] : getSupportFrequencies(frequencyoptions);
150
- return R.map(function (option) {
151
- return { value: option, label: R.prop(option)(frequencyLabels) };
144
+ var availableFrequencies = R.or(R.isEmpty(frequencyoptions), R.isNil(frequencyoptions)) ? [_constants.defaultfreq] : R.filter(function (freq) {
145
+ return R.includes(freq, supportedFrequenciesKey);
146
+ })(frequencyoptions);
147
+ var options = R.map(function (option) {
148
+ return { value: option, label: R.prop(option, frequencyLabels) };
152
149
  })(availableFrequencies);
150
+ if (R.isEmpty(options)) return [{ value: 'A', label: R.propOr('Annual', 'A', frequencyLabels) }];
151
+ return options;
153
152
  };
154
153
 
155
154
  var getLayout = exports.getLayout = function getLayout(type, range) {
@@ -44,6 +44,8 @@ var _classnames = require('classnames');
44
44
 
45
45
  var _classnames2 = _interopRequireDefault(_classnames);
46
46
 
47
+ var _ = require('../');
48
+
47
49
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
48
50
 
49
51
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -69,11 +71,13 @@ var Item = function Item(_ref) {
69
71
  var classes = _ref.classes,
70
72
  id = _ref.id,
71
73
  label = _ref.label,
74
+ description = _ref.description,
72
75
  _ref$nodePath = _ref.nodePath,
73
76
  nodePath = _ref$nodePath === undefined ? [] : _ref$nodePath,
74
77
  isSelected = _ref.isSelected,
75
78
  isDisabled = _ref.isDisabled,
76
79
  changeList = _ref.changeList,
80
+ changeListDescription = _ref.changeListDescription,
77
81
  ariaLabel = _ref.ariaLabel,
78
82
  NavigateIcon = _ref.NavigateIcon,
79
83
  changeSelection = _ref.changeSelection,
@@ -138,14 +142,24 @@ var Item = function Item(_ref) {
138
142
  _react2.default.createElement('path', { d: svgPath })
139
143
  ),
140
144
  _react2.default.createElement(
141
- _Typography2.default,
145
+ _.Tooltip,
142
146
  {
143
- 'data-testid': testId + '_value_' + id,
144
- color: 'inherit',
145
- variant: 'body2',
146
- className: (0, _classnames2.default)(classes.label, (_cx6 = {}, _cx6[classes.disabledLabel] = isDisabled, _cx6))
147
+ title: R.isNil(description) ? '' : description,
148
+ tabIndex: 0,
149
+ 'aria-label': description,
150
+ 'aria-hidden': false,
151
+ placement: 'top'
147
152
  },
148
- label
153
+ _react2.default.createElement(
154
+ _Typography2.default,
155
+ {
156
+ 'data-testid': testId + '_value_' + id,
157
+ color: 'inherit',
158
+ variant: 'body2',
159
+ className: (0, _classnames2.default)(classes.label, (_cx6 = {}, _cx6[classes.disabledLabel] = isDisabled, _cx6[classes.tooltipNotice] = !R.isNil(description), _cx6))
160
+ },
161
+ label
162
+ )
149
163
  ),
150
164
  R.not(R.isNil(count)) && _react2.default.createElement(
151
165
  _Typography2.default,
@@ -185,17 +199,28 @@ var Item = function Item(_ref) {
185
199
  }
186
200
  },
187
201
  _react2.default.createElement(
188
- _IconButton2.default,
202
+ _.Tooltip,
189
203
  {
190
- disableRipple: true,
191
- disableFocusRipple: true,
192
- className: classes.arrow,
193
- 'aria-label': ariaLabel,
194
- tabIndex: -1,
195
- size: 'small',
196
- color: 'inherit'
204
+ title: changeListDescription || '',
205
+ tabIndex: 0,
206
+ 'aria-label': changeListDescription,
207
+ 'aria-hidden': false,
208
+ placement: 'top',
209
+ variant: 'light'
197
210
  },
198
- _react2.default.createElement(NavigateIcon, null)
211
+ _react2.default.createElement(
212
+ _IconButton2.default,
213
+ {
214
+ disableRipple: true,
215
+ disableFocusRipple: true,
216
+ className: classes.arrow,
217
+ 'aria-label': ariaLabel,
218
+ tabIndex: -1,
219
+ size: 'small',
220
+ color: 'inherit'
221
+ },
222
+ _react2.default.createElement(NavigateIcon, null)
223
+ )
199
224
  )
200
225
  )
201
226
  );
@@ -205,6 +230,7 @@ Item.propTypes = process.env.NODE_ENV !== "production" ? {
205
230
  classes: _propTypes2.default.object,
206
231
  id: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
207
232
  label: _propTypes2.default.string,
233
+ description: _propTypes2.default.string,
208
234
  parentId: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
209
235
  nodePath: _propTypes2.default.array,
210
236
  ariaLabel: _propTypes2.default.string,
@@ -214,6 +240,7 @@ Item.propTypes = process.env.NODE_ENV !== "production" ? {
214
240
  hasChild: _propTypes2.default.bool,
215
241
  isSection: _propTypes2.default.bool,
216
242
  changeList: _propTypes2.default.func,
243
+ changeListDescription: _propTypes2.default.string,
217
244
  changeSelection: _propTypes2.default.func,
218
245
  changeMouseSelection: _propTypes2.default.func,
219
246
  count: _propTypes2.default.number,
@@ -297,6 +297,7 @@ var ScopeList = function ScopeList(props) {
297
297
  classes: classes,
298
298
  isRtl: isRtl,
299
299
  changeList: changeList,
300
+ changeListDescription: labels.childrenNavigateDesc,
300
301
  changeSelection: changeSelection,
301
302
  changeMouseSelection: changeMouseSelection,
302
303
  ariaLabel: R.prop('navigateNext')(labels),
@@ -337,6 +338,7 @@ ScopeList.propTypes = process.env.NODE_ENV !== "production" ? {
337
338
  isBlank: _propTypes2.default.bool,
338
339
  isCurrentListAllSelected: _propTypes2.default.bool,
339
340
  labels: _propTypes2.default.shape({
341
+ childrenNavigateDesc: _propTypes2.default.string,
340
342
  navigateNext: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.element]),
341
343
  backHelper: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.element]),
342
344
  selection: _propTypes2.default.shape({
@@ -149,6 +149,9 @@ var useStyles = exports.useStyles = (0, _styles.makeStyles)(function (theme) {
149
149
  },
150
150
  bulkSelectionIcon: {
151
151
  minWidth: 50
152
+ },
153
+ tooltipNotice: {
154
+ textDecoration: 'underline dotted'
152
155
  }
153
156
  };
154
157
  });
package/lib/theme.js CHANGED
@@ -290,8 +290,7 @@ var sisccTheme = exports.sisccTheme = function sisccTheme(_ref) {
290
290
  },
291
291
  table: {
292
292
  flag: {
293
- fontFamily: "'PT Sans Narrow', 'Helvetica Neue', Helvetica, Arial, sans-serif",
294
- fontSize: 12,
293
+ fontSize: 10,
295
294
  color: outerPalette.textLight || innerPalette.textLight
296
295
  },
297
296
  dot: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-visions",
3
- "version": "7.3.0",
3
+ "version": "7.4.2",
4
4
  "description": "Library of visual components",
5
5
  "author": "OECD",
6
6
  "homepage": "https://visions-qa.siscc.org/#o",