@sis-cc/dotstatsuite-visions 10.12.0 → 10.13.0

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-2023
3
+ Copyright © OECD 2019-2024
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
@@ -82,7 +82,7 @@ var CustomChip = function CustomChip(_ref) {
82
82
  className: iconClasses,
83
83
  'aria-label': ariaLabel + ' ' + label,
84
84
  component: 'span',
85
- tabIndex: -1
85
+ tabIndex: 0
86
86
  },
87
87
  React.createElement(Cross, null)
88
88
  ),
@@ -7,6 +7,7 @@ import { makeStyles } from '@material-ui/core/styles';
7
7
  import useMediaQuery from '@material-ui/core/useMediaQuery';
8
8
  import Grid from '@material-ui/core/Grid';
9
9
  import Collapse from '@material-ui/core/Collapse';
10
+ import Typography from '@material-ui/core/Typography';
10
11
  import { ToggleButton } from '../';
11
12
  import Item from './Item';
12
13
  import Paper from './Paper';
@@ -84,31 +85,35 @@ var CollapseButtons = function CollapseButtons(props) {
84
85
  return React.createElement(
85
86
  Grid,
86
87
  _extends({ item: true, xs: 12, sm: 12, md: R.nth(nbColumns)(COLUMNS) }, gridButtonsProps, { key: id }),
87
- React.createElement(ToggleButton, {
88
- textTransform: textTransform,
89
- label: label,
90
- tabindex: R.isNil(toggleId) || R.prop(id)(toggleId) || R.compose(R.not, R.head, R.values)(toggleId) ? 0 : -1,
91
- isOpen: R.prop(id)(toggleId),
92
- toggle: function toggle() {
93
- var _setIsOpen2;
88
+ React.createElement(
89
+ Typography,
90
+ { variant: 'h3' },
91
+ React.createElement(ToggleButton, {
92
+ textTransform: textTransform,
93
+ label: label,
94
+ tabindex: R.isNil(toggleId) || R.prop(id)(toggleId) || R.compose(R.not, R.head, R.values)(toggleId) ? 0 : -1,
95
+ isOpen: R.prop(id)(toggleId),
96
+ toggle: function toggle() {
97
+ var _setIsOpen2;
94
98
 
95
- return setIsOpen((_setIsOpen2 = {}, _setIsOpen2[id] = !R.prop(id)(toggleId), _setIsOpen2));
96
- },
97
- testId: testId + '_' + id,
98
- id: id
99
- }),
100
- isMobileView && React.createElement(
101
- Collapse,
102
- {
103
- 'in': R.prop(id)(toggleId),
104
- timeout: 'auto',
105
- unmountOnExit: true,
106
- className: classes.collapseContainer
107
- },
108
- React.createElement(
109
- Paper,
110
- { elevation: 10, isMobileView: isMobileView },
111
- getValues(id)(values)
99
+ return setIsOpen((_setIsOpen2 = {}, _setIsOpen2[id] = !R.prop(id)(toggleId), _setIsOpen2));
100
+ },
101
+ testId: testId + '_' + id,
102
+ id: id
103
+ }),
104
+ isMobileView && React.createElement(
105
+ Collapse,
106
+ {
107
+ 'in': R.prop(id)(toggleId),
108
+ timeout: 'auto',
109
+ unmountOnExit: true,
110
+ className: classes.collapseContainer
111
+ },
112
+ React.createElement(
113
+ Paper,
114
+ { elevation: 10, isMobileView: isMobileView },
115
+ getValues(id)(values)
116
+ )
112
117
  )
113
118
  )
114
119
  );
@@ -106,9 +106,9 @@ var Item = function Item(_ref) {
106
106
  action(parentId, id);
107
107
  e.stopPropagation();
108
108
  },
109
- tabIndex: 0
109
+ tabIndex: 0,
110
+ style: { display: 'list-item' }
110
111
  },
111
- '\u2022 ',
112
112
  labelAccessor(subtopic, parentId)
113
113
  );
114
114
  })(R.pipe(R.propOr([], 'subtopics'), R.ifElse(R.always(isSecondLevelClikable), R.identity, R.intersperse(' • ')))(item))
@@ -397,7 +397,8 @@ var Dataflow = function Dataflow(_ref2) {
397
397
  IconButton,
398
398
  {
399
399
  'data-testid': 'dataflow-expand-button-test-id',
400
- 'aria-label': 'expand',
400
+ 'aria-label': R.propOr('Show details above', 'expand')(labels),
401
+ 'aria-expanded': isExpanded,
401
402
  onClick: function onClick() {
402
403
  return handleExpand();
403
404
  },
@@ -52,7 +52,8 @@ var CustomExpansionPanel = function CustomExpansionPanel(_ref) {
52
52
  return onChangeActivePanel(id);
53
53
  } : undefined,
54
54
  classes: { root: isNarrow ? classes.panelBorder : classes.panel },
55
- elevation: 0
55
+ elevation: 0,
56
+ 'aria-expanded': isOpen
56
57
  },
57
58
  React.createElement(
58
59
  AccordionSummary,
@@ -110,6 +111,8 @@ var CustomExpansionPanel = function CustomExpansionPanel(_ref) {
110
111
  React.createElement(
111
112
  AccordionDetails,
112
113
  {
114
+ id: id,
115
+ 'aria-label': label,
113
116
  className: cx(classes.details, (_cx5 = {}, _cx5[classes.overflow] = overflow, _cx5[classes.height] = maxHeight, _cx5))
114
117
  },
115
118
  children
@@ -55,6 +55,7 @@ var ToggleButton = function ToggleButton(_ref2) {
55
55
  return React.createElement(
56
56
  Button,
57
57
  {
58
+ 'aria-expanded': isOpen,
58
59
  'aria-label': label,
59
60
  tabIndex: tabindex,
60
61
  'data-testid': testId,
@@ -40,7 +40,8 @@ var Item = function Item(_ref) {
40
40
  labels = _ref.labels,
41
41
  _ref$depth = _ref.depth,
42
42
  depth = _ref$depth === undefined ? 0 : _ref$depth,
43
- eventsListeners = _ref.eventsListeners;
43
+ eventsListeners = _ref.eventsListeners,
44
+ expanded = _ref.expanded;
44
45
 
45
46
  var _React$useState = React.useState(false),
46
47
  isTooltipShown = _React$useState[0],
@@ -66,25 +67,28 @@ var Item = function Item(_ref) {
66
67
  disableFocusRipple: true,
67
68
  className: classes.arrow,
68
69
  'aria-label': ariaLabel,
69
- tabIndex: -1,
70
+ tabIndex: 0,
70
71
  size: 'small',
71
72
  color: 'primary',
72
73
  onClick: function onClick() {
73
74
  return changeList(hierarchicalId || id);
74
- }
75
+ },
76
+ 'aria-expanded': expanded
75
77
  },
76
78
  React.createElement(NavigateIcon, null)
77
79
  ),
78
80
  React.createElement(ListItemText, {
79
81
  'data-testid': 'value_' + id,
80
82
  tabIndex: 0,
83
+ role: 'checkbox',
81
84
  'aria-label': isGreyed ? R.propOr('', 'disableItemLabel')(labels) + ' ' + label : label,
82
- 'aria-pressed': isSelected,
85
+ 'aria-checked': isSelected,
83
86
  'aria-disabled': isDisabled,
84
87
  primaryTypographyProps: { noWrap: true, color: 'inherit' },
85
88
  secondaryTypographyProps: { color: 'inherit' },
86
89
  classes: { root: classes.listItem },
87
90
  className: cx((_cx = {}, _cx[classes.accessibilityItemHover] = accessibility, _cx[classes.listItemSelected] = isSelected, _cx[classes.listItemHover] = !isDisabled, _cx)),
91
+ onKeyDown: isDisabled ? null : eventsListeners.onKeyDown,
88
92
  onClick: isDisabled ? null : eventsListeners.onClick,
89
93
  onMouseDown: isDisabled || isTooltipShown ? null : eventsListeners.onMouseDown,
90
94
  onMouseEnter: isDisabled || isTooltipShown ? null : eventsListeners.onMouseEnter,
@@ -121,7 +125,7 @@ var Item = function Item(_ref) {
121
125
  } }),
122
126
  enterDelay: 400,
123
127
  enterNextDelay: 400,
124
- tabIndex: 0,
128
+ tabIndex: description ? 0 : -1,
125
129
  'aria-label': description,
126
130
  'aria-hidden': false,
127
131
  placement: 'top',
@@ -181,7 +185,8 @@ Item.propTypes = process.env.NODE_ENV !== "production" ? {
181
185
  labels: PropTypes.object,
182
186
  depth: PropTypes.number,
183
187
  eventsListeners: PropTypes.object,
184
- isGreyed: PropTypes.bool
188
+ isGreyed: PropTypes.bool,
189
+ expanded: PropTypes.bool
185
190
  } : {};
186
191
 
187
192
  export default Item;
@@ -201,6 +201,8 @@ var VirtualizedTree = function VirtualizedTree(props) {
201
201
  apply();
202
202
  } else if (e.key === 'Control' && !R.isEmpty(selectIds)) {
203
203
  apply();
204
+ } else if (e.key === 'Enter' && !R.isNil(lastItemId)) {
205
+ apply();
204
206
  }
205
207
  };
206
208
 
@@ -221,6 +223,12 @@ var VirtualizedTree = function VirtualizedTree(props) {
221
223
  multiSelect(id);
222
224
  setLastItemId(id);
223
225
  },
226
+ onKeyDown: function onKeyDown(e) {
227
+ if (e.key === 'Enter') {
228
+ multiSelect(id);
229
+ setLastItemId(id);
230
+ }
231
+ },
224
232
  onClick: function onClick(e) {
225
233
  e.preventDefault();
226
234
  if (e.ctrlKey && !simpleSelectionMode) {
@@ -281,11 +289,14 @@ var VirtualizedTree = function VirtualizedTree(props) {
281
289
  },
282
290
  React.createElement(
283
291
  AutoSizer,
284
- null,
292
+ { role: 'presentation' },
285
293
  function (_ref) {
286
294
  var height = _ref.height,
287
295
  width = _ref.width;
288
296
  return React.createElement(VirtualizedList, {
297
+ role: 'presentation',
298
+ 'aria-readonly': null,
299
+ 'aria-label': 'content',
289
300
  overscan: 10,
290
301
  tabIndex: -1,
291
302
  height: height + 2,
@@ -312,6 +323,7 @@ var VirtualizedTree = function VirtualizedTree(props) {
312
323
  return expand(getHierarchicalId(item));
313
324
  },
314
325
  NavigateIcon: R.has(itemId, expandedIds) ? ExpandLessIcon : ExpandMoreIcon,
326
+ expanded: R.has(itemId, expandedIds),
315
327
  isRtl: isRtl,
316
328
  eventsListeners: itemEventsListeners(getHierarchicalId(item), index),
317
329
  HTMLRenderer: HTMLRenderer,
@@ -320,7 +332,8 @@ var VirtualizedTree = function VirtualizedTree(props) {
320
332
  style: style,
321
333
  accessibility: accessibility,
322
334
  ariaLabel: R.prop('navigateNext')(labels),
323
- theme: theme
335
+ theme: theme,
336
+ role: 'presentation'
324
337
  }));
325
338
  }
326
339
  });
@@ -119,7 +119,7 @@ var CustomChip = function CustomChip(_ref) {
119
119
  className: iconClasses,
120
120
  'aria-label': ariaLabel + ' ' + label,
121
121
  component: 'span',
122
- tabIndex: -1
122
+ tabIndex: 0
123
123
  },
124
124
  _react2.default.createElement(_Cross2.default, null)
125
125
  ),
@@ -31,6 +31,10 @@ var _Collapse = require('@material-ui/core/Collapse');
31
31
 
32
32
  var _Collapse2 = _interopRequireDefault(_Collapse);
33
33
 
34
+ var _Typography = require('@material-ui/core/Typography');
35
+
36
+ var _Typography2 = _interopRequireDefault(_Typography);
37
+
34
38
  var _ = require('../');
35
39
 
36
40
  var _Item = require('./Item');
@@ -118,31 +122,35 @@ var CollapseButtons = function CollapseButtons(props) {
118
122
  return _react2.default.createElement(
119
123
  _Grid2.default,
120
124
  _extends({ item: true, xs: 12, sm: 12, md: R.nth(nbColumns)(COLUMNS) }, gridButtonsProps, { key: id }),
121
- _react2.default.createElement(_.ToggleButton, {
122
- textTransform: textTransform,
123
- label: label,
124
- tabindex: R.isNil(toggleId) || R.prop(id)(toggleId) || R.compose(R.not, R.head, R.values)(toggleId) ? 0 : -1,
125
- isOpen: R.prop(id)(toggleId),
126
- toggle: function toggle() {
127
- var _setIsOpen2;
128
-
129
- return setIsOpen((_setIsOpen2 = {}, _setIsOpen2[id] = !R.prop(id)(toggleId), _setIsOpen2));
130
- },
131
- testId: testId + '_' + id,
132
- id: id
133
- }),
134
- isMobileView && _react2.default.createElement(
135
- _Collapse2.default,
136
- {
137
- 'in': R.prop(id)(toggleId),
138
- timeout: 'auto',
139
- unmountOnExit: true,
140
- className: classes.collapseContainer
141
- },
142
- _react2.default.createElement(
143
- _Paper2.default,
144
- { elevation: 10, isMobileView: isMobileView },
145
- getValues(id)(values)
125
+ _react2.default.createElement(
126
+ _Typography2.default,
127
+ { variant: 'h3' },
128
+ _react2.default.createElement(_.ToggleButton, {
129
+ textTransform: textTransform,
130
+ label: label,
131
+ tabindex: R.isNil(toggleId) || R.prop(id)(toggleId) || R.compose(R.not, R.head, R.values)(toggleId) ? 0 : -1,
132
+ isOpen: R.prop(id)(toggleId),
133
+ toggle: function toggle() {
134
+ var _setIsOpen2;
135
+
136
+ return setIsOpen((_setIsOpen2 = {}, _setIsOpen2[id] = !R.prop(id)(toggleId), _setIsOpen2));
137
+ },
138
+ testId: testId + '_' + id,
139
+ id: id
140
+ }),
141
+ isMobileView && _react2.default.createElement(
142
+ _Collapse2.default,
143
+ {
144
+ 'in': R.prop(id)(toggleId),
145
+ timeout: 'auto',
146
+ unmountOnExit: true,
147
+ className: classes.collapseContainer
148
+ },
149
+ _react2.default.createElement(
150
+ _Paper2.default,
151
+ { elevation: 10, isMobileView: isMobileView },
152
+ getValues(id)(values)
153
+ )
146
154
  )
147
155
  )
148
156
  );
@@ -135,9 +135,9 @@ var Item = function Item(_ref) {
135
135
  action(parentId, id);
136
136
  e.stopPropagation();
137
137
  },
138
- tabIndex: 0
138
+ tabIndex: 0,
139
+ style: { display: 'list-item' }
139
140
  },
140
- '\u2022 ',
141
141
  labelAccessor(subtopic, parentId)
142
142
  );
143
143
  })(R.pipe(R.propOr([], 'subtopics'), R.ifElse(R.always(isSecondLevelClikable), R.identity, R.intersperse(' • ')))(item))
@@ -458,7 +458,8 @@ var Dataflow = function Dataflow(_ref2) {
458
458
  _IconButton2.default,
459
459
  {
460
460
  'data-testid': 'dataflow-expand-button-test-id',
461
- 'aria-label': 'expand',
461
+ 'aria-label': R.propOr('Show details above', 'expand')(labels),
462
+ 'aria-expanded': isExpanded,
462
463
  onClick: function onClick() {
463
464
  return handleExpand();
464
465
  },
@@ -97,7 +97,8 @@ var CustomExpansionPanel = function CustomExpansionPanel(_ref) {
97
97
  return onChangeActivePanel(id);
98
98
  } : undefined,
99
99
  classes: { root: isNarrow ? classes.panelBorder : classes.panel },
100
- elevation: 0
100
+ elevation: 0,
101
+ 'aria-expanded': isOpen
101
102
  },
102
103
  _react2.default.createElement(
103
104
  _AccordionSummary2.default,
@@ -155,6 +156,8 @@ var CustomExpansionPanel = function CustomExpansionPanel(_ref) {
155
156
  _react2.default.createElement(
156
157
  _AccordionDetails2.default,
157
158
  {
159
+ id: id,
160
+ 'aria-label': label,
158
161
  className: (0, _classnames2.default)(classes.details, (_cx5 = {}, _cx5[classes.overflow] = overflow, _cx5[classes.height] = maxHeight, _cx5))
159
162
  },
160
163
  children
@@ -84,6 +84,7 @@ var ToggleButton = function ToggleButton(_ref2) {
84
84
  return _react2.default.createElement(
85
85
  _Button2.default,
86
86
  {
87
+ 'aria-expanded': isOpen,
87
88
  'aria-label': label,
88
89
  tabIndex: tabindex,
89
90
  'data-testid': testId,
@@ -80,7 +80,8 @@ var Item = function Item(_ref) {
80
80
  labels = _ref.labels,
81
81
  _ref$depth = _ref.depth,
82
82
  depth = _ref$depth === undefined ? 0 : _ref$depth,
83
- eventsListeners = _ref.eventsListeners;
83
+ eventsListeners = _ref.eventsListeners,
84
+ expanded = _ref.expanded;
84
85
 
85
86
  var _React$useState = _react2.default.useState(false),
86
87
  isTooltipShown = _React$useState[0],
@@ -106,25 +107,28 @@ var Item = function Item(_ref) {
106
107
  disableFocusRipple: true,
107
108
  className: classes.arrow,
108
109
  'aria-label': ariaLabel,
109
- tabIndex: -1,
110
+ tabIndex: 0,
110
111
  size: 'small',
111
112
  color: 'primary',
112
113
  onClick: function onClick() {
113
114
  return changeList(hierarchicalId || id);
114
- }
115
+ },
116
+ 'aria-expanded': expanded
115
117
  },
116
118
  _react2.default.createElement(NavigateIcon, null)
117
119
  ),
118
120
  _react2.default.createElement(_ListItemText2.default, {
119
121
  'data-testid': 'value_' + id,
120
122
  tabIndex: 0,
123
+ role: 'checkbox',
121
124
  'aria-label': isGreyed ? R.propOr('', 'disableItemLabel')(labels) + ' ' + label : label,
122
- 'aria-pressed': isSelected,
125
+ 'aria-checked': isSelected,
123
126
  'aria-disabled': isDisabled,
124
127
  primaryTypographyProps: { noWrap: true, color: 'inherit' },
125
128
  secondaryTypographyProps: { color: 'inherit' },
126
129
  classes: { root: classes.listItem },
127
130
  className: (0, _classnames2.default)((_cx = {}, _cx[classes.accessibilityItemHover] = accessibility, _cx[classes.listItemSelected] = isSelected, _cx[classes.listItemHover] = !isDisabled, _cx)),
131
+ onKeyDown: isDisabled ? null : eventsListeners.onKeyDown,
128
132
  onClick: isDisabled ? null : eventsListeners.onClick,
129
133
  onMouseDown: isDisabled || isTooltipShown ? null : eventsListeners.onMouseDown,
130
134
  onMouseEnter: isDisabled || isTooltipShown ? null : eventsListeners.onMouseEnter,
@@ -161,7 +165,7 @@ var Item = function Item(_ref) {
161
165
  } }),
162
166
  enterDelay: 400,
163
167
  enterNextDelay: 400,
164
- tabIndex: 0,
168
+ tabIndex: description ? 0 : -1,
165
169
  'aria-label': description,
166
170
  'aria-hidden': false,
167
171
  placement: 'top',
@@ -221,7 +225,8 @@ Item.propTypes = process.env.NODE_ENV !== "production" ? {
221
225
  labels: _propTypes2.default.object,
222
226
  depth: _propTypes2.default.number,
223
227
  eventsListeners: _propTypes2.default.object,
224
- isGreyed: _propTypes2.default.bool
228
+ isGreyed: _propTypes2.default.bool,
229
+ expanded: _propTypes2.default.bool
225
230
  } : {};
226
231
 
227
232
  exports.default = Item;
@@ -240,6 +240,8 @@ var VirtualizedTree = function VirtualizedTree(props) {
240
240
  apply();
241
241
  } else if (e.key === 'Control' && !R.isEmpty(selectIds)) {
242
242
  apply();
243
+ } else if (e.key === 'Enter' && !R.isNil(lastItemId)) {
244
+ apply();
243
245
  }
244
246
  };
245
247
 
@@ -260,6 +262,12 @@ var VirtualizedTree = function VirtualizedTree(props) {
260
262
  multiSelect(id);
261
263
  setLastItemId(id);
262
264
  },
265
+ onKeyDown: function onKeyDown(e) {
266
+ if (e.key === 'Enter') {
267
+ multiSelect(id);
268
+ setLastItemId(id);
269
+ }
270
+ },
263
271
  onClick: function onClick(e) {
264
272
  e.preventDefault();
265
273
  if (e.ctrlKey && !simpleSelectionMode) {
@@ -320,11 +328,14 @@ var VirtualizedTree = function VirtualizedTree(props) {
320
328
  },
321
329
  _react2.default.createElement(
322
330
  _AutoSizer2.default,
323
- null,
331
+ { role: 'presentation' },
324
332
  function (_ref) {
325
333
  var height = _ref.height,
326
334
  width = _ref.width;
327
335
  return _react2.default.createElement(_List2.default, {
336
+ role: 'presentation',
337
+ 'aria-readonly': null,
338
+ 'aria-label': 'content',
328
339
  overscan: 10,
329
340
  tabIndex: -1,
330
341
  height: height + 2,
@@ -351,6 +362,7 @@ var VirtualizedTree = function VirtualizedTree(props) {
351
362
  return expand((0, _utils.getHierarchicalId)(item));
352
363
  },
353
364
  NavigateIcon: R.has(itemId, expandedIds) ? _ExpandLess2.default : _ExpandMore2.default,
365
+ expanded: R.has(itemId, expandedIds),
354
366
  isRtl: isRtl,
355
367
  eventsListeners: itemEventsListeners((0, _utils.getHierarchicalId)(item), index),
356
368
  HTMLRenderer: HTMLRenderer,
@@ -359,7 +371,8 @@ var VirtualizedTree = function VirtualizedTree(props) {
359
371
  style: style,
360
372
  accessibility: accessibility,
361
373
  ariaLabel: R.prop('navigateNext')(labels),
362
- theme: theme
374
+ theme: theme,
375
+ role: 'presentation'
363
376
  }));
364
377
  }
365
378
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-visions",
3
- "version": "10.12.0",
3
+ "version": "10.13.0",
4
4
  "description": "Library of visual components",
5
5
  "author": "OECD",
6
6
  "homepage": "https://visions-qa.siscc.org/#o",