@sis-cc/dotstatsuite-visions 7.17.10 → 7.17.12

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/es/Chips/Chips.js CHANGED
@@ -21,6 +21,10 @@ var myTooltipRenderer = function myTooltipRenderer(_ref) {
21
21
 
22
22
  export var useStyles = makeStyles(function (theme) {
23
23
  return {
24
+ root: {
25
+ display: 'flex',
26
+ flexWrap: 'wrap'
27
+ },
24
28
  chip: {
25
29
  height: 'unset',
26
30
  borderRadius: 3,
@@ -54,6 +58,11 @@ export var useStyles = makeStyles(function (theme) {
54
58
  margin: theme.spacing(0.5),
55
59
  backgroundColor: theme.palette.grey[700]
56
60
  },
61
+ dividerHz: {
62
+ width: '100%',
63
+ margin: theme.spacing(0.5),
64
+ backgroundColor: theme.palette.grey[700]
65
+ },
57
66
  spaceLabel: {
58
67
  paddingLeft: 0
59
68
  },
@@ -173,16 +182,20 @@ var Chips = function Chips(_ref3) {
173
182
  ariaLabel = _ref3.ariaLabel,
174
183
  _ref3$reducingNbChips = _ref3.reducingNbChips,
175
184
  reducingNbChips = _ref3$reducingNbChips === undefined ? 15 : _ref3$reducingNbChips,
176
- labels = _ref3.labels;
185
+ labels = _ref3.labels,
186
+ _ref3$isVis = _ref3.isVis,
187
+ isVis = _ref3$isVis === undefined ? false : _ref3$isVis;
177
188
 
178
189
  var classes = useStyles();
179
190
  var theme = useTheme();
180
191
  var isRtl = getIsRtl(theme);
181
192
 
182
193
  return React.createElement(
183
- 'div',
184
- { 'data-testid': 'chips-test-id' },
194
+ Grid,
195
+ { container: isVis, 'data-testid': 'chips-test-id' },
185
196
  R.map(function (itemProps) {
197
+ var _cx2;
198
+
186
199
  var parentId = itemProps.id,
187
200
  isNotRemovable = itemProps.isNotRemovable,
188
201
  _itemProps$values = itemProps.values,
@@ -190,10 +203,15 @@ var Chips = function Chips(_ref3) {
190
203
 
191
204
  return React.createElement(
192
205
  Grid,
193
- { container: true, className: classes.root, key: parentId },
206
+ {
207
+ item: isVis,
208
+ container: !isVis,
209
+ key: parentId,
210
+ className: cx((_cx2 = {}, _cx2[classes.root] = isVis, _cx2))
211
+ },
194
212
  React.createElement(
195
213
  Grid,
196
- { item: true, xs: 12 },
214
+ { item: !isVis, style: !isVis ? { width: '100%' } : null },
197
215
  React.createElement(CustomChip, {
198
216
  parentId: parentId,
199
217
  label: labelRenderer(itemProps) + ':',
@@ -230,13 +248,14 @@ var Chips = function Chips(_ref3) {
230
248
  labelClasses: cx(classes.formatLabel)
231
249
  });
232
250
  })(values),
233
- React.createElement(Divider, { className: classes.divider })
234
- )
251
+ !isVis && React.createElement(Divider, { className: classes.dividerHz })
252
+ ),
253
+ isVis && React.createElement(Divider, { className: classes.divider, orientation: 'vertical', flexItem: true })
235
254
  );
236
255
  })(items),
237
256
  R.is(Function)(onDeleteAll) && React.createElement(
238
257
  Grid,
239
- { container: true, className: classes.root },
258
+ { container: true },
240
259
  React.createElement(
241
260
  Grid,
242
261
  { item: true, xs: 12 },
@@ -273,7 +292,8 @@ Chips.propTypes = process.env.NODE_ENV !== "production" ? {
273
292
  reducingNbChips: PropTypes.number,
274
293
  labels: PropTypes.shape({
275
294
  reducingChip: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
276
- })
295
+ }),
296
+ isVis: PropTypes.bool
277
297
  } : {};
278
298
 
279
299
  export default withBlank(function (_ref4) {
package/es/Chips/index.js CHANGED
@@ -30,6 +30,7 @@
30
30
  * labels: PropTypes.shape({
31
31
  * reducingChip: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
32
32
  * }),
33
+ * isVis: PropTypes.bool,
33
34
  * };
34
35
  * @theme
35
36
  * {
@@ -15,7 +15,7 @@ import KeyboardArrowUpIcon from '@material-ui/icons/KeyboardArrowUp';
15
15
  import CircularProgress from '@material-ui/core/CircularProgress';
16
16
  import Grid from '@material-ui/core/Grid';
17
17
  import Collapse, { VARIANT_BOLD } from './Collapse';
18
-
18
+ import cx from 'classnames';
19
19
  var useStyles = makeStyles(function (theme) {
20
20
  return {
21
21
  title: _extends({
@@ -28,6 +28,10 @@ var useStyles = makeStyles(function (theme) {
28
28
  marginLeft: theme.spacing(2),
29
29
  marginRight: theme.spacing(2),
30
30
  marginBottom: theme.spacing(2)
31
+ },
32
+ overflow: {
33
+ whiteSpace: 'pre-wrap',
34
+ overflowWrap: 'break-word'
31
35
  }
32
36
  };
33
37
  });
@@ -133,7 +137,10 @@ var CollapsibleTree = function CollapsibleTree(_ref) {
133
137
  { key: id, level: 0, label: label, isOpen: depthLevel >= 0 },
134
138
  React.createElement(
135
139
  Typography,
136
- { className: classes.spacingValue, variant: 'body2' },
140
+ {
141
+ className: cx(classes.spacingValue, classes.overflow),
142
+ variant: 'body2'
143
+ },
137
144
  getValue(_extends({ value: value, children: children }, handlerProps))
138
145
  ),
139
146
  children && R.map(function (_ref5) {
@@ -154,7 +161,7 @@ var CollapsibleTree = function CollapsibleTree(_ref) {
154
161
  },
155
162
  React.createElement(
156
163
  Typography,
157
- { variant: 'body2' },
164
+ { variant: 'body2', className: classes.overflow },
158
165
  getValue(_extends({ value: value }, handlerProps))
159
166
  )
160
167
  );
@@ -19,7 +19,8 @@ var CustomExpansionPanel = function CustomExpansionPanel(_ref) {
19
19
  onChangeActivePanel = _ref.onChangeActivePanel,
20
20
  label = _ref.label,
21
21
  tag = _ref.tag,
22
- overflow = _ref.overflow,
22
+ _ref$overflow = _ref.overflow,
23
+ overflow = _ref$overflow === undefined ? true : _ref$overflow,
23
24
  children = _ref.children,
24
25
  isOpen = _ref.isOpen,
25
26
  _ref$maxHeight = _ref.maxHeight,
@@ -61,6 +61,10 @@ var myTooltipRenderer = function myTooltipRenderer(_ref) {
61
61
 
62
62
  var useStyles = exports.useStyles = (0, _styles.makeStyles)(function (theme) {
63
63
  return {
64
+ root: {
65
+ display: 'flex',
66
+ flexWrap: 'wrap'
67
+ },
64
68
  chip: {
65
69
  height: 'unset',
66
70
  borderRadius: 3,
@@ -94,6 +98,11 @@ var useStyles = exports.useStyles = (0, _styles.makeStyles)(function (theme) {
94
98
  margin: theme.spacing(0.5),
95
99
  backgroundColor: theme.palette.grey[700]
96
100
  },
101
+ dividerHz: {
102
+ width: '100%',
103
+ margin: theme.spacing(0.5),
104
+ backgroundColor: theme.palette.grey[700]
105
+ },
97
106
  spaceLabel: {
98
107
  paddingLeft: 0
99
108
  },
@@ -213,16 +222,20 @@ var Chips = function Chips(_ref3) {
213
222
  ariaLabel = _ref3.ariaLabel,
214
223
  _ref3$reducingNbChips = _ref3.reducingNbChips,
215
224
  reducingNbChips = _ref3$reducingNbChips === undefined ? 15 : _ref3$reducingNbChips,
216
- labels = _ref3.labels;
225
+ labels = _ref3.labels,
226
+ _ref3$isVis = _ref3.isVis,
227
+ isVis = _ref3$isVis === undefined ? false : _ref3$isVis;
217
228
 
218
229
  var classes = useStyles();
219
230
  var theme = (0, _styles.useTheme)();
220
231
  var isRtl = (0, _utils.getIsRtl)(theme);
221
232
 
222
233
  return _react2.default.createElement(
223
- 'div',
224
- { 'data-testid': 'chips-test-id' },
234
+ _Grid2.default,
235
+ { container: isVis, 'data-testid': 'chips-test-id' },
225
236
  R.map(function (itemProps) {
237
+ var _cx2;
238
+
226
239
  var parentId = itemProps.id,
227
240
  isNotRemovable = itemProps.isNotRemovable,
228
241
  _itemProps$values = itemProps.values,
@@ -230,10 +243,15 @@ var Chips = function Chips(_ref3) {
230
243
 
231
244
  return _react2.default.createElement(
232
245
  _Grid2.default,
233
- { container: true, className: classes.root, key: parentId },
246
+ {
247
+ item: isVis,
248
+ container: !isVis,
249
+ key: parentId,
250
+ className: (0, _classnames2.default)((_cx2 = {}, _cx2[classes.root] = isVis, _cx2))
251
+ },
234
252
  _react2.default.createElement(
235
253
  _Grid2.default,
236
- { item: true, xs: 12 },
254
+ { item: !isVis, style: !isVis ? { width: '100%' } : null },
237
255
  _react2.default.createElement(CustomChip, {
238
256
  parentId: parentId,
239
257
  label: labelRenderer(itemProps) + ':',
@@ -270,13 +288,14 @@ var Chips = function Chips(_ref3) {
270
288
  labelClasses: (0, _classnames2.default)(classes.formatLabel)
271
289
  });
272
290
  })(values),
273
- _react2.default.createElement(_Divider2.default, { className: classes.divider })
274
- )
291
+ !isVis && _react2.default.createElement(_Divider2.default, { className: classes.dividerHz })
292
+ ),
293
+ isVis && _react2.default.createElement(_Divider2.default, { className: classes.divider, orientation: 'vertical', flexItem: true })
275
294
  );
276
295
  })(items),
277
296
  R.is(Function)(onDeleteAll) && _react2.default.createElement(
278
297
  _Grid2.default,
279
- { container: true, className: classes.root },
298
+ { container: true },
280
299
  _react2.default.createElement(
281
300
  _Grid2.default,
282
301
  { item: true, xs: 12 },
@@ -313,7 +332,8 @@ Chips.propTypes = process.env.NODE_ENV !== "production" ? {
313
332
  reducingNbChips: _propTypes2.default.number,
314
333
  labels: _propTypes2.default.shape({
315
334
  reducingChip: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.element])
316
- })
335
+ }),
336
+ isVis: _propTypes2.default.bool
317
337
  } : {};
318
338
 
319
339
  exports.default = (0, _utils.withBlank)(function (_ref4) {
@@ -54,6 +54,10 @@ var _Collapse = require('./Collapse');
54
54
 
55
55
  var _Collapse2 = _interopRequireDefault(_Collapse);
56
56
 
57
+ var _classnames = require('classnames');
58
+
59
+ var _classnames2 = _interopRequireDefault(_classnames);
60
+
57
61
  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; } }
58
62
 
59
63
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -72,6 +76,10 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
72
76
  marginLeft: theme.spacing(2),
73
77
  marginRight: theme.spacing(2),
74
78
  marginBottom: theme.spacing(2)
79
+ },
80
+ overflow: {
81
+ whiteSpace: 'pre-wrap',
82
+ overflowWrap: 'break-word'
75
83
  }
76
84
  };
77
85
  });
@@ -177,7 +185,10 @@ var CollapsibleTree = function CollapsibleTree(_ref) {
177
185
  { key: id, level: 0, label: label, isOpen: depthLevel >= 0 },
178
186
  _react2.default.createElement(
179
187
  _Typography2.default,
180
- { className: classes.spacingValue, variant: 'body2' },
188
+ {
189
+ className: (0, _classnames2.default)(classes.spacingValue, classes.overflow),
190
+ variant: 'body2'
191
+ },
181
192
  getValue(_extends({ value: value, children: children }, handlerProps))
182
193
  ),
183
194
  children && R.map(function (_ref5) {
@@ -198,7 +209,7 @@ var CollapsibleTree = function CollapsibleTree(_ref) {
198
209
  },
199
210
  _react2.default.createElement(
200
211
  _Typography2.default,
201
- { variant: 'body2' },
212
+ { variant: 'body2', className: classes.overflow },
202
213
  getValue(_extends({ value: value }, handlerProps))
203
214
  )
204
215
  );
@@ -58,7 +58,8 @@ var CustomExpansionPanel = function CustomExpansionPanel(_ref) {
58
58
  onChangeActivePanel = _ref.onChangeActivePanel,
59
59
  label = _ref.label,
60
60
  tag = _ref.tag,
61
- overflow = _ref.overflow,
61
+ _ref$overflow = _ref.overflow,
62
+ overflow = _ref$overflow === undefined ? true : _ref$overflow,
62
63
  children = _ref.children,
63
64
  isOpen = _ref.isOpen,
64
65
  _ref$maxHeight = _ref.maxHeight,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-visions",
3
- "version": "7.17.10",
3
+ "version": "7.17.12",
4
4
  "description": "Library of visual components",
5
5
  "author": "OECD",
6
6
  "homepage": "https://visions-qa.siscc.org/#o",