@sis-cc/dotstatsuite-visions 12.31.0 → 12.33.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.
@@ -48,7 +48,7 @@ var MyButton = React.forwardRef(function (_ref, ref) {
48
48
  className: cx(className, R.prop(alternative + 'Root')(classes), (_cx = {}, _cx[R.prop(alternative + 'Selected')(classes)] = selected, _cx)),
49
49
  'aria-pressed': selected,
50
50
  ref: ref
51
- }, props),
51
+ }, R.omit(['indicator', 'textColor', 'selectionFollowsFocus'], props)),
52
52
  props.children
53
53
  );
54
54
  });
@@ -91,7 +91,7 @@ var CollapseButtons = function CollapseButtons(props) {
91
91
  React.createElement(ToggleButton, {
92
92
  textTransform: textTransform,
93
93
  label: label,
94
- tabindex: R.isNil(toggleId) || R.prop(id)(toggleId) || R.compose(R.not, R.head, R.values)(toggleId) ? 0 : -1,
94
+ tabIndex: R.isNil(toggleId) || R.prop(id)(toggleId) || R.compose(R.not, R.head, R.values)(toggleId) ? 0 : -1,
95
95
  isOpen: R.prop(id)(toggleId),
96
96
  toggle: function toggle() {
97
97
  var _setIsOpen2;
@@ -161,7 +161,7 @@ var DataHeader = function DataHeader(_ref2) {
161
161
  className: classes.title,
162
162
  style: { fontSize: fontSizeTitle },
163
163
  'data-testid': 'data-header-title',
164
- tabindex: '-1',
164
+ tabIndex: '-1',
165
165
  'aria-label': title.label
166
166
  },
167
167
  title.label,
@@ -376,7 +376,7 @@ var AdvancedSelection = function AdvancedSelection(props) {
376
376
  return onChangeSelection(selection, ids, filter);
377
377
  },
378
378
  withExpandControl: true,
379
- treeHeight: isNarrow ? 0 : '450px',
379
+ treeHeight: isNarrow ? 0 : 450,
380
380
  scopeGetter: scopeGetter,
381
381
  expandedIds: expandedIds
382
382
  }))
@@ -49,6 +49,21 @@ var useStyles = makeStyles(function (theme) {
49
49
  }
50
50
  };
51
51
  });
52
+ var getCounter = function getCounter(items, tagAccessor) {
53
+ var selectedItemsIds = R.reduce(function (acc, item) {
54
+ if (R.prop('isSelected', item)) {
55
+ return R.append(item.id, acc);
56
+ }
57
+ return acc;
58
+ }, [], items);
59
+ var itemsIds = R.pluck('id', items);
60
+ var count = R.pipe(R.uniq, R.length)(selectedItemsIds);
61
+ var total = R.pipe(R.uniq, R.length)(itemsIds);
62
+ if (R.is(Function, tagAccessor)) {
63
+ return tagAccessor(count, total);
64
+ }
65
+ return count + '/' + total;
66
+ };
52
67
 
53
68
  var TabPanel = function TabPanel(props) {
54
69
  var children = props.children,
@@ -153,13 +168,21 @@ TabPanel.propTypes = process.env.NODE_ENV !== "production" ? {
153
168
  styles: PropTypes.object
154
169
  } : {};
155
170
 
156
- var PaperComponent = function PaperComponent(props) {
171
+ var PaperComponent = React.forwardRef(function (_ref, ref) {
157
172
  var _cx;
158
173
 
174
+ var label = _ref.label,
175
+ selected = _ref.selected,
176
+ item = _ref.item,
177
+ tagAccessor = _ref.tagAccessor,
178
+ tagValueLabel = _ref.tagValueLabel,
179
+ rest = _objectWithoutProperties(_ref, ['label', 'selected', 'item', 'tagAccessor', 'tagValueLabel']);
180
+
181
+ var Chip = R.isNil(item.tag) ? InternalTag : item.tag;
159
182
  var classes = useStyles();
160
183
  return React.createElement(
161
184
  Paper,
162
- props,
185
+ _extends({}, rest, { ref: ref }),
163
186
  React.createElement(
164
187
  Box,
165
188
  { sx: { display: 'flex', justifyContent: 'space-between', width: '100%' } },
@@ -168,19 +191,25 @@ var PaperComponent = function PaperComponent(props) {
168
191
  {
169
192
  noWrap: true,
170
193
  variant: 'body2',
171
- title: props.label,
172
- className: cx(classes.label, (_cx = {}, _cx[classes.labelSelected] = props.selected, _cx))
194
+ title: label,
195
+ className: cx(classes.label, (_cx = {}, _cx[classes.labelSelected] = selected, _cx))
173
196
  },
174
- props.label
197
+ label
175
198
  ),
176
- props.tag
199
+ R.isNil(item.tag) ? React.createElement(
200
+ Chip,
201
+ { items: item.values, tagValueLabel: tagValueLabel },
202
+ getCounter(item.values, tagAccessor)
203
+ ) : item.tag
177
204
  )
178
205
  );
179
- };
206
+ });
180
207
  PaperComponent.propTypes = process.env.NODE_ENV !== "production" ? {
181
208
  label: PropTypes.string,
182
- tag: PropTypes.elementType,
183
- selected: PropTypes.bool
209
+ selected: PropTypes.bool,
210
+ item: PropTypes.object,
211
+ tagAccessor: PropTypes.func,
212
+ tagValueLabel: PropTypes.func
184
213
  } : {};
185
214
 
186
215
  var DynamicDrawer = function DynamicDrawer(props) {
@@ -202,22 +231,6 @@ var DynamicDrawer = function DynamicDrawer(props) {
202
231
  allSelection = _useState4[0],
203
232
  setAllSelection = _useState4[1];
204
233
 
205
- var getCounter = function getCounter(items, tagAccessor) {
206
- var selectedItemsIds = R.reduce(function (acc, item) {
207
- if (R.prop('isSelected', item)) {
208
- return R.append(item.id, acc);
209
- }
210
- return acc;
211
- }, [], items);
212
- var itemsIds = R.pluck('id', items);
213
- var count = R.pipe(R.uniq, R.length)(selectedItemsIds);
214
- var total = R.pipe(R.uniq, R.length)(itemsIds);
215
- if (R.is(Function, tagAccessor)) {
216
- return tagAccessor(count, total);
217
- }
218
- return count + '/' + total;
219
- };
220
-
221
234
  var list = props.list,
222
235
  labelRenderer = props.labelRenderer,
223
236
  onClick = props.onClick,
@@ -312,7 +325,6 @@ var DynamicDrawer = function DynamicDrawer(props) {
312
325
  variant: 'scrollable',
313
326
  TabIndicatorProps: { style: { transition: 'none' } },
314
327
  scrollButtons: false,
315
- disableScrollButtons: true,
316
328
  value: false,
317
329
  onChange: handleChange,
318
330
  'aria-label': 'filters',
@@ -330,24 +342,23 @@ var DynamicDrawer = function DynamicDrawer(props) {
330
342
  R.map(function (item) {
331
343
  var _cx2;
332
344
 
333
- var Chip = R.isNil(item.tag) ? InternalTag : item.tag;
334
345
  var tagValueLabel = R.isNil(item.tag) && getCounter(item.values, tagAriaLabel);
335
346
 
336
347
  return React.createElement(Tab, {
337
348
  key: item.id,
338
349
  id: filter.id,
339
350
  'data-testid': item.id + '-tab',
340
- component: function component(props) {
341
- return PaperComponent(_extends({
351
+ component: React.forwardRef(function TabPaper(tabProps, ref) {
352
+ return React.createElement(PaperComponent, _extends({
353
+ ref: ref
354
+ }, tabProps, {
342
355
  label: labelRenderer(item),
343
356
  selected: selectedId === item.id,
344
- tag: R.isNil(item.tag) ? React.createElement(
345
- Chip,
346
- { items: item.values, tagValueLabel: tagValueLabel },
347
- getCounter(item.values, tagAccessor)
348
- ) : item.tag
349
- }, props));
350
- },
357
+ item: item,
358
+ tagAccessor: tagAccessor,
359
+ tagValueLabel: tagValueLabel
360
+ }));
361
+ }),
351
362
  label: labelRenderer(item),
352
363
  'aria-label': labelRenderer(item),
353
364
  value: item,
@@ -365,7 +376,7 @@ var DynamicDrawer = function DynamicDrawer(props) {
365
376
  open && !isNarrow && React.createElement(
366
377
  Button,
367
378
  {
368
- sx: { float: 'bottom', margin: '10px' },
379
+ style: { float: 'bottom', margin: '10px' },
369
380
  'aria-label': R.prop('apply', labels),
370
381
  id: 'apply_button',
371
382
  variant: 'contained',
@@ -376,7 +387,7 @@ var DynamicDrawer = function DynamicDrawer(props) {
376
387
  isNotHiddenButton && React.createElement(
377
388
  Button,
378
389
  {
379
- sx: { float: 'bottom', margin: '10px' },
390
+ style: { float: 'bottom', margin: '10px' },
380
391
  'aria-label': R.prop('apply', labels),
381
392
  id: 'apply_button',
382
393
  variant: 'contained',
@@ -432,7 +443,7 @@ DynamicDrawer.propTypes = process.env.NODE_ENV !== "production" ? {
432
443
  tagAriaLabel: PropTypes.func,
433
444
  handleChangePanel: PropTypes.func,
434
445
  onClosePanel: PropTypes.func,
435
- displayChildren: PropTypes.func,
446
+ displayChildren: PropTypes.bool,
436
447
  labels: PropTypes.shape({
437
448
  placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
438
449
  disableItemLabel: PropTypes.string,
@@ -102,7 +102,7 @@ var Spotlight = function Spotlight(_ref) {
102
102
  R.gt(size(R.prop('fields', spotlight)), 1) ? React.createElement(
103
103
  Fragment,
104
104
  null,
105
- React.createElement(Divider, { className: classes.divider }),
105
+ React.createElement(Divider, { className: classes.divider, 'aria-hidden': 'true' }),
106
106
  React.createElement(Field, {
107
107
  spotlight: spotlight,
108
108
  onChangeField: onChangeField,
@@ -114,7 +114,7 @@ var Spotlight = function Spotlight(_ref) {
114
114
  hasCommit ? React.createElement(
115
115
  Fragment,
116
116
  null,
117
- React.createElement(Divider, { className: classes.divider }),
117
+ React.createElement(Divider, { className: classes.divider, 'aria-hidden': 'true' }),
118
118
  React.createElement(
119
119
  IconButton,
120
120
  {
@@ -73,7 +73,7 @@ var MyButton = _react2.default.forwardRef(function (_ref, ref) {
73
73
  className: (0, _classnames2.default)(className, R.prop(alternative + 'Root')(classes), (_cx = {}, _cx[R.prop(alternative + 'Selected')(classes)] = selected, _cx)),
74
74
  'aria-pressed': selected,
75
75
  ref: ref
76
- }, props),
76
+ }, R.omit(['indicator', 'textColor', 'selectionFollowsFocus'], props)),
77
77
  props.children
78
78
  );
79
79
  });
@@ -130,7 +130,7 @@ var CollapseButtons = function CollapseButtons(props) {
130
130
  _react2.default.createElement(_.ToggleButton, {
131
131
  textTransform: textTransform,
132
132
  label: label,
133
- tabindex: R.isNil(toggleId) || R.prop(id)(toggleId) || R.compose(R.not, R.head, R.values)(toggleId) ? 0 : -1,
133
+ tabIndex: R.isNil(toggleId) || R.prop(id)(toggleId) || R.compose(R.not, R.head, R.values)(toggleId) ? 0 : -1,
134
134
  isOpen: R.prop(id)(toggleId),
135
135
  toggle: function toggle() {
136
136
  var _setIsOpen2;
@@ -204,7 +204,7 @@ var DataHeader = function DataHeader(_ref2) {
204
204
  className: classes.title,
205
205
  style: { fontSize: fontSizeTitle },
206
206
  'data-testid': 'data-header-title',
207
- tabindex: '-1',
207
+ tabIndex: '-1',
208
208
  'aria-label': title.label
209
209
  },
210
210
  title.label,
@@ -435,7 +435,7 @@ var AdvancedSelection = function AdvancedSelection(props) {
435
435
  return onChangeSelection(selection, ids, filter);
436
436
  },
437
437
  withExpandControl: true,
438
- treeHeight: isNarrow ? 0 : '450px',
438
+ treeHeight: isNarrow ? 0 : 450,
439
439
  scopeGetter: scopeGetter,
440
440
  expandedIds: expandedIds
441
441
  }))
@@ -99,6 +99,21 @@ var useStyles = (0, _makeStyles2.default)(function (theme) {
99
99
  }
100
100
  };
101
101
  });
102
+ var getCounter = function getCounter(items, tagAccessor) {
103
+ var selectedItemsIds = R.reduce(function (acc, item) {
104
+ if (R.prop('isSelected', item)) {
105
+ return R.append(item.id, acc);
106
+ }
107
+ return acc;
108
+ }, [], items);
109
+ var itemsIds = R.pluck('id', items);
110
+ var count = R.pipe(R.uniq, R.length)(selectedItemsIds);
111
+ var total = R.pipe(R.uniq, R.length)(itemsIds);
112
+ if (R.is(Function, tagAccessor)) {
113
+ return tagAccessor(count, total);
114
+ }
115
+ return count + '/' + total;
116
+ };
102
117
 
103
118
  var TabPanel = function TabPanel(props) {
104
119
  var children = props.children,
@@ -203,13 +218,21 @@ TabPanel.propTypes = process.env.NODE_ENV !== "production" ? {
203
218
  styles: _propTypes2.default.object
204
219
  } : {};
205
220
 
206
- var PaperComponent = function PaperComponent(props) {
221
+ var PaperComponent = _react2.default.forwardRef(function (_ref, ref) {
207
222
  var _cx;
208
223
 
224
+ var label = _ref.label,
225
+ selected = _ref.selected,
226
+ item = _ref.item,
227
+ tagAccessor = _ref.tagAccessor,
228
+ tagValueLabel = _ref.tagValueLabel,
229
+ rest = _objectWithoutProperties(_ref, ['label', 'selected', 'item', 'tagAccessor', 'tagValueLabel']);
230
+
231
+ var Chip = R.isNil(item.tag) ? _.Tag : item.tag;
209
232
  var classes = useStyles();
210
233
  return _react2.default.createElement(
211
234
  _Paper2.default,
212
- props,
235
+ _extends({}, rest, { ref: ref }),
213
236
  _react2.default.createElement(
214
237
  _Box2.default,
215
238
  { sx: { display: 'flex', justifyContent: 'space-between', width: '100%' } },
@@ -218,19 +241,25 @@ var PaperComponent = function PaperComponent(props) {
218
241
  {
219
242
  noWrap: true,
220
243
  variant: 'body2',
221
- title: props.label,
222
- className: (0, _classnames2.default)(classes.label, (_cx = {}, _cx[classes.labelSelected] = props.selected, _cx))
244
+ title: label,
245
+ className: (0, _classnames2.default)(classes.label, (_cx = {}, _cx[classes.labelSelected] = selected, _cx))
223
246
  },
224
- props.label
247
+ label
225
248
  ),
226
- props.tag
249
+ R.isNil(item.tag) ? _react2.default.createElement(
250
+ Chip,
251
+ { items: item.values, tagValueLabel: tagValueLabel },
252
+ getCounter(item.values, tagAccessor)
253
+ ) : item.tag
227
254
  )
228
255
  );
229
- };
256
+ });
230
257
  PaperComponent.propTypes = process.env.NODE_ENV !== "production" ? {
231
258
  label: _propTypes2.default.string,
232
- tag: _propTypes2.default.elementType,
233
- selected: _propTypes2.default.bool
259
+ selected: _propTypes2.default.bool,
260
+ item: _propTypes2.default.object,
261
+ tagAccessor: _propTypes2.default.func,
262
+ tagValueLabel: _propTypes2.default.func
234
263
  } : {};
235
264
 
236
265
  var DynamicDrawer = function DynamicDrawer(props) {
@@ -252,22 +281,6 @@ var DynamicDrawer = function DynamicDrawer(props) {
252
281
  allSelection = _useState4[0],
253
282
  setAllSelection = _useState4[1];
254
283
 
255
- var getCounter = function getCounter(items, tagAccessor) {
256
- var selectedItemsIds = R.reduce(function (acc, item) {
257
- if (R.prop('isSelected', item)) {
258
- return R.append(item.id, acc);
259
- }
260
- return acc;
261
- }, [], items);
262
- var itemsIds = R.pluck('id', items);
263
- var count = R.pipe(R.uniq, R.length)(selectedItemsIds);
264
- var total = R.pipe(R.uniq, R.length)(itemsIds);
265
- if (R.is(Function, tagAccessor)) {
266
- return tagAccessor(count, total);
267
- }
268
- return count + '/' + total;
269
- };
270
-
271
284
  var list = props.list,
272
285
  labelRenderer = props.labelRenderer,
273
286
  onClick = props.onClick,
@@ -362,7 +375,6 @@ var DynamicDrawer = function DynamicDrawer(props) {
362
375
  variant: 'scrollable',
363
376
  TabIndicatorProps: { style: { transition: 'none' } },
364
377
  scrollButtons: false,
365
- disableScrollButtons: true,
366
378
  value: false,
367
379
  onChange: handleChange,
368
380
  'aria-label': 'filters',
@@ -380,24 +392,23 @@ var DynamicDrawer = function DynamicDrawer(props) {
380
392
  R.map(function (item) {
381
393
  var _cx2;
382
394
 
383
- var Chip = R.isNil(item.tag) ? _.Tag : item.tag;
384
395
  var tagValueLabel = R.isNil(item.tag) && getCounter(item.values, tagAriaLabel);
385
396
 
386
397
  return _react2.default.createElement(_Tab2.default, {
387
398
  key: item.id,
388
399
  id: filter.id,
389
400
  'data-testid': item.id + '-tab',
390
- component: function component(props) {
391
- return PaperComponent(_extends({
401
+ component: _react2.default.forwardRef(function TabPaper(tabProps, ref) {
402
+ return _react2.default.createElement(PaperComponent, _extends({
403
+ ref: ref
404
+ }, tabProps, {
392
405
  label: labelRenderer(item),
393
406
  selected: selectedId === item.id,
394
- tag: R.isNil(item.tag) ? _react2.default.createElement(
395
- Chip,
396
- { items: item.values, tagValueLabel: tagValueLabel },
397
- getCounter(item.values, tagAccessor)
398
- ) : item.tag
399
- }, props));
400
- },
407
+ item: item,
408
+ tagAccessor: tagAccessor,
409
+ tagValueLabel: tagValueLabel
410
+ }));
411
+ }),
401
412
  label: labelRenderer(item),
402
413
  'aria-label': labelRenderer(item),
403
414
  value: item,
@@ -415,7 +426,7 @@ var DynamicDrawer = function DynamicDrawer(props) {
415
426
  open && !isNarrow && _react2.default.createElement(
416
427
  _.Button,
417
428
  {
418
- sx: { float: 'bottom', margin: '10px' },
429
+ style: { float: 'bottom', margin: '10px' },
419
430
  'aria-label': R.prop('apply', labels),
420
431
  id: 'apply_button',
421
432
  variant: 'contained',
@@ -426,7 +437,7 @@ var DynamicDrawer = function DynamicDrawer(props) {
426
437
  isNotHiddenButton && _react2.default.createElement(
427
438
  _.Button,
428
439
  {
429
- sx: { float: 'bottom', margin: '10px' },
440
+ style: { float: 'bottom', margin: '10px' },
430
441
  'aria-label': R.prop('apply', labels),
431
442
  id: 'apply_button',
432
443
  variant: 'contained',
@@ -482,7 +493,7 @@ DynamicDrawer.propTypes = process.env.NODE_ENV !== "production" ? {
482
493
  tagAriaLabel: _propTypes2.default.func,
483
494
  handleChangePanel: _propTypes2.default.func,
484
495
  onClosePanel: _propTypes2.default.func,
485
- displayChildren: _propTypes2.default.func,
496
+ displayChildren: _propTypes2.default.bool,
486
497
  labels: _propTypes2.default.shape({
487
498
  placeholder: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),
488
499
  disableItemLabel: _propTypes2.default.string,
@@ -149,7 +149,7 @@ var Spotlight = function Spotlight(_ref) {
149
149
  R.gt(size(R.prop('fields', spotlight)), 1) ? _react2.default.createElement(
150
150
  _react.Fragment,
151
151
  null,
152
- _react2.default.createElement(_Divider2.default, { className: classes.divider }),
152
+ _react2.default.createElement(_Divider2.default, { className: classes.divider, 'aria-hidden': 'true' }),
153
153
  _react2.default.createElement(_Fields.Field, {
154
154
  spotlight: spotlight,
155
155
  onChangeField: onChangeField,
@@ -161,7 +161,7 @@ var Spotlight = function Spotlight(_ref) {
161
161
  hasCommit ? _react2.default.createElement(
162
162
  _react.Fragment,
163
163
  null,
164
- _react2.default.createElement(_Divider2.default, { className: classes.divider }),
164
+ _react2.default.createElement(_Divider2.default, { className: classes.divider, 'aria-hidden': 'true' }),
165
165
  _react2.default.createElement(
166
166
  _IconButton2.default,
167
167
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-visions",
3
- "version": "12.31.0",
3
+ "version": "12.33.0",
4
4
  "description": "Library of visual components",
5
5
  "author": "OECD",
6
6
  "homepage": "https://visions-qa.siscc.org/#o",