@sis-cc/dotstatsuite-visions 7.8.1 → 7.8.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright © OECD 2019-2021
3
+ Copyright © OECD 2019-2022
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -69,9 +69,13 @@ var CollapsibleTree = function CollapsibleTree(_ref) {
69
69
 
70
70
  var getValue = function getValue(_ref2) {
71
71
  var value = _ref2.value,
72
- handlerProps = _objectWithoutProperties(_ref2, ['value']);
72
+ _ref2$children = _ref2.children,
73
+ children = _ref2$children === undefined ? [] : _ref2$children,
74
+ handlerProps = _objectWithoutProperties(_ref2, ['value', 'children']);
73
75
 
74
- if (R.isNil(value) || R.isEmpty(value)) return R.prop('noValue', labels);
76
+ if ((R.isNil(value) || R.isEmpty(value)) && R.isEmpty(children)) {
77
+ return R.prop('noValue', labels);
78
+ }
75
79
  if (R.is(Function, valueHandler)) {
76
80
  return valueHandler(_extends({ value: value }, handlerProps));
77
81
  }
@@ -130,7 +134,7 @@ var CollapsibleTree = function CollapsibleTree(_ref) {
130
134
  React.createElement(
131
135
  Typography,
132
136
  { className: classes.spacingValue, variant: 'body2' },
133
- getValue(_extends({ value: value }, handlerProps))
137
+ getValue(_extends({ value: value, children: children }, handlerProps))
134
138
  ),
135
139
  children && R.map(function (_ref5) {
136
140
  var id = _ref5.id,
@@ -148,7 +148,8 @@ var Dataflow = function Dataflow(_ref2) {
148
148
  categories = _ref2$categories === undefined ? [] : _ref2$categories,
149
149
  children = _ref2.children,
150
150
  _ref2$HTMLRenderer = _ref2.HTMLRenderer,
151
- HTMLRenderer = _ref2$HTMLRenderer === undefined ? BasicHTMLRenderer : _ref2$HTMLRenderer;
151
+ HTMLRenderer = _ref2$HTMLRenderer === undefined ? BasicHTMLRenderer : _ref2$HTMLRenderer,
152
+ id = _ref2.id;
152
153
 
153
154
  var classes = useStyles();
154
155
 
@@ -235,7 +236,7 @@ var Dataflow = function Dataflow(_ref2) {
235
236
  { className: classes.cardContent },
236
237
  R.map(function (_ref3) {
237
238
  var field = _ref3[0],
238
- highlight = _ref3[1];
239
+ fieldHighlights = _ref3[1];
239
240
  return React.createElement(
240
241
  Typography,
241
242
  {
@@ -251,8 +252,9 @@ var Dataflow = function Dataflow(_ref2) {
251
252
  field,
252
253
  ':\xA0'
253
254
  ),
254
- ' ',
255
- React.createElement(HTMLRenderer, { html: highlight })
255
+ R.map(function (fieldHighlight) {
256
+ return React.createElement(HTMLRenderer, { key: id + '-' + field, html: fieldHighlight });
257
+ }, fieldHighlights)
256
258
  );
257
259
  })(highlights),
258
260
  React.createElement(
@@ -356,6 +358,7 @@ var Dataflow = function Dataflow(_ref2) {
356
358
 
357
359
  Dataflow.propTypes = process.env.NODE_ENV !== "production" ? {
358
360
  testId: PropTypes.string,
361
+ id: PropTypes.string,
359
362
  title: PropTypes.string,
360
363
  body: PropTypes.shape({
361
364
  description: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
@@ -10,6 +10,7 @@
10
10
  * @api public
11
11
  * @props
12
12
  * Dataflow.propTypes = {
13
+ * id: PropTypes.string,
13
14
  * testId: PropTypes.string,
14
15
  * title: PropTypes.string,
15
16
  * body: PropTypes.shape({
package/es/Logo/Logo.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import cx from 'classnames';
3
4
  import { makeStyles } from '@material-ui/core/styles';
4
5
 
5
6
  var useStyles = makeStyles(function () {
@@ -13,7 +14,12 @@ var useStyles = makeStyles(function () {
13
14
  maxHeight: function maxHeight(_ref) {
14
15
  var _maxHeight = _ref.maxHeight;
15
16
  return _maxHeight;
16
- }
17
+ },
18
+ imageRendering: 'crisp-edges'
19
+ },
20
+ // https://caniuse.com/mdn-css_properties_image-rendering_crisp-edges
21
+ alternativeBrowserLogo: {
22
+ imageRendering: '-webkit-optimize-contrast'
17
23
  }
18
24
  };
19
25
  });
@@ -28,7 +34,7 @@ var Logo = function Logo(_ref2) {
28
34
  return React.createElement(
29
35
  'div',
30
36
  { className: classes.container },
31
- React.createElement('img', { className: classes.logo, src: logo, alt: 'logo' }),
37
+ React.createElement('img', { className: cx(classes.logo, classes.alternativeBrowserLogo), src: logo, alt: 'logo' }),
32
38
  children
33
39
  );
34
40
  };
@@ -113,9 +113,13 @@ var CollapsibleTree = function CollapsibleTree(_ref) {
113
113
 
114
114
  var getValue = function getValue(_ref2) {
115
115
  var value = _ref2.value,
116
- handlerProps = _objectWithoutProperties(_ref2, ['value']);
116
+ _ref2$children = _ref2.children,
117
+ children = _ref2$children === undefined ? [] : _ref2$children,
118
+ handlerProps = _objectWithoutProperties(_ref2, ['value', 'children']);
117
119
 
118
- if (R.isNil(value) || R.isEmpty(value)) return R.prop('noValue', labels);
120
+ if ((R.isNil(value) || R.isEmpty(value)) && R.isEmpty(children)) {
121
+ return R.prop('noValue', labels);
122
+ }
119
123
  if (R.is(Function, valueHandler)) {
120
124
  return valueHandler(_extends({ value: value }, handlerProps));
121
125
  }
@@ -174,7 +178,7 @@ var CollapsibleTree = function CollapsibleTree(_ref) {
174
178
  _react2.default.createElement(
175
179
  _Typography2.default,
176
180
  { className: classes.spacingValue, variant: 'body2' },
177
- getValue(_extends({ value: value }, handlerProps))
181
+ getValue(_extends({ value: value, children: children }, handlerProps))
178
182
  ),
179
183
  children && R.map(function (_ref5) {
180
184
  var id = _ref5.id,
@@ -202,7 +202,8 @@ var Dataflow = function Dataflow(_ref2) {
202
202
  categories = _ref2$categories === undefined ? [] : _ref2$categories,
203
203
  children = _ref2.children,
204
204
  _ref2$HTMLRenderer = _ref2.HTMLRenderer,
205
- HTMLRenderer = _ref2$HTMLRenderer === undefined ? BasicHTMLRenderer : _ref2$HTMLRenderer;
205
+ HTMLRenderer = _ref2$HTMLRenderer === undefined ? BasicHTMLRenderer : _ref2$HTMLRenderer,
206
+ id = _ref2.id;
206
207
 
207
208
  var classes = useStyles();
208
209
 
@@ -289,7 +290,7 @@ var Dataflow = function Dataflow(_ref2) {
289
290
  { className: classes.cardContent },
290
291
  R.map(function (_ref3) {
291
292
  var field = _ref3[0],
292
- highlight = _ref3[1];
293
+ fieldHighlights = _ref3[1];
293
294
  return _react2.default.createElement(
294
295
  _Typography2.default,
295
296
  {
@@ -305,8 +306,9 @@ var Dataflow = function Dataflow(_ref2) {
305
306
  field,
306
307
  ':\xA0'
307
308
  ),
308
- ' ',
309
- _react2.default.createElement(HTMLRenderer, { html: highlight })
309
+ R.map(function (fieldHighlight) {
310
+ return _react2.default.createElement(HTMLRenderer, { key: id + '-' + field, html: fieldHighlight });
311
+ }, fieldHighlights)
310
312
  );
311
313
  })(highlights),
312
314
  _react2.default.createElement(
@@ -410,6 +412,7 @@ var Dataflow = function Dataflow(_ref2) {
410
412
 
411
413
  Dataflow.propTypes = process.env.NODE_ENV !== "production" ? {
412
414
  testId: _propTypes2.default.string,
415
+ id: _propTypes2.default.string,
413
416
  title: _propTypes2.default.string,
414
417
  body: _propTypes2.default.shape({
415
418
  description: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.element]),
package/lib/Logo/Logo.js CHANGED
@@ -10,6 +10,10 @@ var _propTypes = require('prop-types');
10
10
 
11
11
  var _propTypes2 = _interopRequireDefault(_propTypes);
12
12
 
13
+ var _classnames = require('classnames');
14
+
15
+ var _classnames2 = _interopRequireDefault(_classnames);
16
+
13
17
  var _styles = require('@material-ui/core/styles');
14
18
 
15
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -25,7 +29,12 @@ var useStyles = (0, _styles.makeStyles)(function () {
25
29
  maxHeight: function maxHeight(_ref) {
26
30
  var _maxHeight = _ref.maxHeight;
27
31
  return _maxHeight;
28
- }
32
+ },
33
+ imageRendering: 'crisp-edges'
34
+ },
35
+ // https://caniuse.com/mdn-css_properties_image-rendering_crisp-edges
36
+ alternativeBrowserLogo: {
37
+ imageRendering: '-webkit-optimize-contrast'
29
38
  }
30
39
  };
31
40
  });
@@ -40,7 +49,7 @@ var Logo = function Logo(_ref2) {
40
49
  return _react2.default.createElement(
41
50
  'div',
42
51
  { className: classes.container },
43
- _react2.default.createElement('img', { className: classes.logo, src: logo, alt: 'logo' }),
52
+ _react2.default.createElement('img', { className: (0, _classnames2.default)(classes.logo, classes.alternativeBrowserLogo), src: logo, alt: 'logo' }),
44
53
  children
45
54
  );
46
55
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-visions",
3
- "version": "7.8.1",
3
+ "version": "7.8.4",
4
4
  "description": "Library of visual components",
5
5
  "author": "OECD",
6
6
  "homepage": "https://visions-qa.siscc.org/#o",