@sis-cc/dotstatsuite-visions 7.20.0 → 7.20.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.
Files changed (29) hide show
  1. package/es/AdvancedFilterDialog/AdvancedFilterDialog.js +78 -28
  2. package/es/AdvancedFilterDialog/images/all-selection.png +0 -0
  3. package/es/AdvancedFilterDialog/images/branch-selection.png +0 -0
  4. package/es/AdvancedFilterDialog/images/children-selection.png +0 -0
  5. package/es/AdvancedFilterDialog/images/level-selection.png +0 -0
  6. package/es/AdvancedFilterDialog/images/single-selection.png +0 -0
  7. package/es/AdvancedFilterDialog/images/small-all-selection.png +0 -0
  8. package/es/AdvancedFilterDialog/images/small-branch-selection.png +0 -0
  9. package/es/AdvancedFilterDialog/images/small-children-selection.png +0 -0
  10. package/es/AdvancedFilterDialog/images/small-level-selection.png +0 -0
  11. package/es/AdvancedFilterDialog/images/small-single-selection.png +0 -0
  12. package/es/HierarchicalFilter/HierarchicalFilter.js +1 -1
  13. package/es/VirtualizedTree/Item.js +14 -14
  14. package/es/VirtualizedTree/VirtualizedTree.js +13 -14
  15. package/lib/AdvancedFilterDialog/AdvancedFilterDialog.js +105 -26
  16. package/lib/AdvancedFilterDialog/images/all-selection.png +0 -0
  17. package/lib/AdvancedFilterDialog/images/branch-selection.png +0 -0
  18. package/lib/AdvancedFilterDialog/images/children-selection.png +0 -0
  19. package/lib/AdvancedFilterDialog/images/level-selection.png +0 -0
  20. package/lib/AdvancedFilterDialog/images/single-selection.png +0 -0
  21. package/lib/AdvancedFilterDialog/images/small-all-selection.png +0 -0
  22. package/lib/AdvancedFilterDialog/images/small-branch-selection.png +0 -0
  23. package/lib/AdvancedFilterDialog/images/small-children-selection.png +0 -0
  24. package/lib/AdvancedFilterDialog/images/small-level-selection.png +0 -0
  25. package/lib/AdvancedFilterDialog/images/small-single-selection.png +0 -0
  26. package/lib/HierarchicalFilter/HierarchicalFilter.js +1 -1
  27. package/lib/VirtualizedTree/Item.js +18 -13
  28. package/lib/VirtualizedTree/VirtualizedTree.js +13 -14
  29. package/package.json +7 -5
@@ -2,11 +2,11 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
2
2
 
3
3
  function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
4
4
 
5
- import React, { useState } from 'react';
5
+ import React, { useState, Fragment } from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import * as R from 'ramda';
8
8
  import cx from 'classnames';
9
- import { getHierarchicalId } from '../VirtualizedTree/VirtualizedTree';
9
+ import { getDepth, getHierarchicalId } from '../VirtualizedTree/VirtualizedTree';
10
10
  import IconButton from '@material-ui/core/Button';
11
11
  import Dialog from '@material-ui/core/Dialog';
12
12
  import DialogTitle from '@material-ui/core/DialogTitle';
@@ -23,6 +23,17 @@ import HintIcon from '@material-ui/icons/EmojiObjects';
23
23
  import Draggable from 'react-draggable';
24
24
  import { Button, Spotlight, VirtualizedTree } from '..';
25
25
  import { makeStyles } from '@material-ui/core/styles';
26
+ import singleImg from './images/single-selection.png';
27
+ import childrenImg from './images/children-selection.png';
28
+ import branchImg from './images/branch-selection.png';
29
+ import levelImg from './images/level-selection.png';
30
+ import allImg from './images/all-selection.png';
31
+
32
+ import singleIcon from './images/small-single-selection.png';
33
+ import childrenIcon from './images/small-children-selection.png';
34
+ import branchIcon from './images/small-branch-selection.png';
35
+ import levelIcon from './images/small-level-selection.png';
36
+ import allIcon from './images/small-all-selection.png';
26
37
 
27
38
  var PaperComponent = function PaperComponent(props) {
28
39
  return React.createElement(
@@ -65,6 +76,10 @@ var useStyles = makeStyles(function (theme) {
65
76
  alignItems: 'flex-start'
66
77
  },
67
78
  spotlight: { width: '45%' },
79
+ selection: {
80
+ display: 'flex',
81
+ alignItems: 'center'
82
+ },
68
83
  narrowSpotlight: { width: '100%' },
69
84
  selectionButton: {
70
85
  marginLeft: 24,
@@ -78,7 +93,7 @@ var useStyles = makeStyles(function (theme) {
78
93
  width: '50%',
79
94
  position: 'absolute',
80
95
  top: 105,
81
- right: 24,
96
+ right: 48,
82
97
  zIndex: 1
83
98
  },
84
99
  narrowSelectionMenu: {
@@ -89,16 +104,28 @@ var useStyles = makeStyles(function (theme) {
89
104
  flexDirection: 'row',
90
105
  flexWrap: 'wrap'
91
106
  },
92
- selectedItem: {
93
- backgroundColor: theme.palette.secondary.main
107
+ selectButton: {
108
+ color: theme.palette.primary.main,
109
+ '&:hover': {
110
+ color: theme.palette.primary.main,
111
+ backgroundColor: theme.palette.action.hover
112
+ }
113
+ },
114
+ selectedButton: {
115
+ backgroundColor: theme.palette.secondary.main,
116
+ '&:hover': {
117
+ backgroundColor: theme.palette.action.selected
118
+ }
94
119
  },
95
120
  selectModeItem: {
96
121
  boxShadow: 'none',
97
122
  display: 'flex',
98
123
  width: 110,
99
124
  height: 200,
125
+ backgroundColor: 'inherit',
126
+ color: 'inherit',
100
127
  flexDirection: 'column',
101
- justifyContent: 'flex-end',
128
+ justifyContent: 'space-between',
102
129
  '& img': {
103
130
  width: 110,
104
131
  height: 140
@@ -114,6 +141,7 @@ var useStyles = makeStyles(function (theme) {
114
141
  });
115
142
 
116
143
  export var getScopeGetters = function getScopeGetters(items, groupedItems, disableAccessor) {
144
+ var indexed = R.indexBy(getHierarchicalId, items);
117
145
  return {
118
146
  all: function all() {
119
147
  return R.reject(disableAccessor, items);
@@ -135,9 +163,10 @@ export var getScopeGetters = function getScopeGetters(items, groupedItems, disab
135
163
  return R.reject(disableAccessor, items);
136
164
  },
137
165
  level: function level(item) {
138
- var parentId = R.propOr('#ROOT', 'parentId', item);
139
- var items = R.prop(parentId, groupedItems);
140
- return R.reject(disableAccessor, items);
166
+ var depth = getDepth(indexed)(item);
167
+ return R.filter(function (it) {
168
+ return !disableAccessor(it) && getDepth(indexed)(it) === depth;
169
+ }, items);
141
170
  }
142
171
  };
143
172
  };
@@ -168,10 +197,12 @@ var SelectionModeMenu = function SelectionModeMenu(_ref) {
168
197
 
169
198
  var value = _ref2.value,
170
199
  label = _ref2.label,
171
- imgSrc = _ref2.imgSrc;
200
+ img = _ref2.img;
172
201
  return React.createElement(
173
202
  Button,
174
- _extends({}, value === selected ? { variant: 'contained', color: 'secondary' } : {}, {
203
+ _extends({
204
+ className: cx(classes.selectButton, (_cx = {}, _cx[classes.selectedButton] = value === selected, _cx))
205
+ }, value === selected ? { variant: 'contained', color: 'secondary' } : {}, {
175
206
  key: value,
176
207
  onClick: function onClick() {
177
208
  return onSelect(value);
@@ -179,16 +210,13 @@ var SelectionModeMenu = function SelectionModeMenu(_ref) {
179
210
  }),
180
211
  React.createElement(
181
212
  Paper,
182
- {
183
- className: cx(classes.selectModeItem, (_cx = {}, _cx[classes.selectedItem] = value === selected, _cx)),
184
- key: value
185
- },
213
+ { className: classes.selectModeItem, key: value },
186
214
  React.createElement(
187
215
  Typography,
188
216
  { variant: 'body2' },
189
217
  label
190
218
  ),
191
- React.createElement('img', { src: imgSrc, alt: value })
219
+ !R.isNil(img) && R.is(String, img) && React.createElement('img', { src: img, alt: value })
192
220
  )
193
221
  );
194
222
  }, options)
@@ -216,6 +244,14 @@ SelectionModeMenu.propTypes = process.env.NODE_ENV !== "production" ? {
216
244
  selected: PropTypes.string
217
245
  } : {};
218
246
 
247
+ var icons = {
248
+ single: singleIcon,
249
+ children: childrenIcon,
250
+ branch: branchIcon,
251
+ level: levelIcon,
252
+ all: allIcon
253
+ };
254
+
219
255
  var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
220
256
  var _cx2;
221
257
 
@@ -228,9 +264,8 @@ var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
228
264
  isOpen = props.isOpen,
229
265
  isNarrow = props.isNarrow,
230
266
  labels = props.labels,
231
- imgs = props.imgs,
232
267
  disableAccessor = props.disableAccessor,
233
- rest = _objectWithoutProperties(props, ['id', 'title', 'items', 'labelRenderer', 'onClose', 'changeSelection', 'isOpen', 'isNarrow', 'labels', 'imgs', 'disableAccessor']);
268
+ rest = _objectWithoutProperties(props, ['id', 'title', 'items', 'labelRenderer', 'onClose', 'changeSelection', 'isOpen', 'isNarrow', 'labels', 'disableAccessor']);
234
269
 
235
270
  var _useState = useState(''),
236
271
  term = _useState[0].term,
@@ -277,20 +312,24 @@ var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
277
312
  var selectionOptions = [{
278
313
  value: 'single',
279
314
  label: R.prop('singleSelection', labels),
280
- imgSrc: R.prop('singleSelection', imgs)
315
+ img: singleImg
281
316
  }, {
282
317
  value: 'children',
283
318
  label: R.prop('childrenSelection', labels),
284
- imgSrc: R.prop('childrenSelection', imgs)
319
+ img: childrenImg
285
320
  }, {
286
321
  value: 'branch',
287
322
  label: R.prop('branchSelection', labels),
288
- imgSrc: R.prop('branchSelection', imgs)
323
+ img: branchImg
289
324
  }, {
290
325
  value: 'level',
291
326
  label: R.prop('levelSelection', labels),
292
- imgSrc: R.prop('levelSelection', imgs)
293
- }, { value: 'all', label: R.prop('allSelection', labels), imgSrc: R.prop('allSelection', imgs) }];
327
+ img: levelImg
328
+ }, {
329
+ value: 'all',
330
+ label: R.prop('allSelection', labels),
331
+ img: allImg
332
+ }];
294
333
 
295
334
  var isDisabled = function isDisabled(item) {
296
335
  return R.is(Function, disableAccessor) ? disableAccessor(item) : false;
@@ -359,7 +398,7 @@ var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
359
398
  ),
360
399
  React.createElement(
361
400
  'div',
362
- null,
401
+ { className: classes.selection },
363
402
  React.createElement(
364
403
  Button,
365
404
  {
@@ -375,7 +414,13 @@ var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
375
414
  R.prop('selectionMode', labels)
376
415
  ),
377
416
  '\xA0',
378
- R.prop(selectionMode + 'Selection', labels)
417
+ R.prop(selectionMode + 'Selection', labels),
418
+ !R.isNil(R.prop(selectionMode, icons)) && R.is(String, R.prop(selectionMode, icons)) && React.createElement(
419
+ Fragment,
420
+ null,
421
+ '\xA0',
422
+ React.createElement('img', { src: R.prop(selectionMode, icons), alt: selectionMode })
423
+ )
379
424
  )
380
425
  ),
381
426
  React.createElement(
@@ -400,7 +445,7 @@ var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
400
445
  items: selectionItems,
401
446
  changeSelection: onChangeSelection,
402
447
  withExpandControl: true,
403
- maxTreeHeight: 500,
448
+ maxTreeHeight: 490,
404
449
  getItemScope: R.prop(selectionMode, scopeGetters)
405
450
  }))
406
451
  )
@@ -411,7 +456,13 @@ var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
411
456
  null,
412
457
  R.is(Function, onClose) && React.createElement(
413
458
  Button,
414
- { onClick: onClose, color: 'primary' },
459
+ {
460
+ onClick: function onClick() {
461
+ onClose();
462
+ setSelection({});
463
+ },
464
+ color: 'primary'
465
+ },
415
466
  R.prop('cancel', labels)
416
467
  ),
417
468
  R.is(Function, changeSelection) && React.createElement(
@@ -435,7 +486,6 @@ AdvancedFilterDialog.propTypes = process.env.NODE_ENV !== "production" ? {
435
486
  changeSelection: PropTypes.func,
436
487
  disableAccessor: PropTypes.func,
437
488
  HTMLRenderer: PropTypes.func,
438
- imgs: PropTypes.object,
439
489
  isRtl: PropTypes.bool,
440
490
  isNarrow: PropTypes.bool,
441
491
  isOpen: PropTypes.bool,
@@ -93,7 +93,7 @@ var HierarchicalFilter = function HierarchicalFilter(props) {
93
93
  spotlight: { fields: {} },
94
94
  action: setSpotlight
95
95
  }),
96
- R.is(Function, toggleBulk) && React.createElement(
96
+ R.is(Function, toggleBulk) && hasSpotligt && React.createElement(
97
97
  VerticalButton,
98
98
  {
99
99
  'aria-label': R.prop('advancedSelection')(labels),
@@ -8,14 +8,14 @@ import Typography from '@material-ui/core/Typography';
8
8
  import ListItemText from '@material-ui/core/ListItemText';
9
9
  import IconButton from '@material-ui/core/IconButton';
10
10
  import SvgIcon from '@material-ui/core/SvgIcon';
11
+ import Icon from '@material-ui/core/SvgIcon';
12
+ import CheckBoxIcon from '@material-ui/icons/CheckBoxOutlineBlankOutlined';
13
+ import CheckedBoxIcon from '@material-ui/icons/CheckBoxOutlined';
11
14
  import cx from 'classnames';
12
15
  import { Tooltip } from '../';
13
16
 
14
- 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
- var checkPath = 'M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z';
16
-
17
17
  var Item = function Item(_ref) {
18
- var _cx, _extends2, _cx2, _cx3, _cx4, _cx5, _cx6;
18
+ var _extends2, _cx, _cx2, _cx3, _cx4, _cx5;
19
19
 
20
20
  var classes = _ref.classes,
21
21
  id = _ref.id,
@@ -54,8 +54,7 @@ var Item = function Item(_ref) {
54
54
  {
55
55
  disableGutters: true,
56
56
  classes: { disabled: classes.disabled },
57
- className: cx(classes.listItemContainer, (_cx = {}, _cx[classes.disableSecondaryAction] = R.not(hasChild), _cx)),
58
- disabled: isDisabled,
57
+ className: cx(classes.listItemContainer, classes.disableSecondaryAction),
59
58
  tabIndex: -1,
60
59
  style: _extends({}, style, (_extends2 = {
61
60
  flexDirection: isRtl ? 'row-reverse' : 'row'
@@ -70,7 +69,7 @@ var Item = function Item(_ref) {
70
69
  'aria-label': ariaLabel,
71
70
  tabIndex: -1,
72
71
  size: 'small',
73
- color: 'inherit',
72
+ color: 'primary',
74
73
  onClick: function onClick() {
75
74
  return changeList(hierarchicalId || id);
76
75
  }
@@ -85,30 +84,31 @@ var Item = function Item(_ref) {
85
84
  primaryTypographyProps: { noWrap: true, color: 'inherit' },
86
85
  secondaryTypographyProps: { color: 'inherit' },
87
86
  classes: { root: classes.listItem },
88
- className: cx((_cx2 = {}, _cx2[classes.accessibilityItemHover] = accessibility, _cx2[classes.listItemSelected] = R.and(isSelected, R.not(isDisabled)), _cx2[classes.listItemHover] = R.not(isDisabled), _cx2)),
87
+ className: cx((_cx = {}, _cx[classes.accessibilityItemHover] = accessibility, _cx[classes.listItemSelected] = R.and(isSelected, R.not(isDisabled)), _cx[classes.listItemHover] = R.not(isDisabled), _cx[classes.disabledLabel] = isDisabled, _cx)),
89
88
  onMouseDown: isDisabled || isTooltipShown ? null : callbacks.onMouseDown,
90
89
  onMouseUp: isDisabled || isTooltipShown ? null : callbacks.onMouseUp,
91
90
  onMouseEnter: isDisabled || isTooltipShown ? null : callbacks.onMouseEnter
92
91
  }, R.pick(['onKeyPress'], callbacks), {
93
92
  title: isDisabled ? R.propOr('', 'disableItemLabel')(labels) + ' ' + label : label,
93
+ style: { opacity: isDisabled ? '0.5' : '1' },
94
94
  primary: React.createElement(
95
95
  'div',
96
96
  {
97
- className: cx(classes.labelContainer, (_cx3 = {}, _cx3[classes.rtlLabelContainer] = isRtl, _cx3))
97
+ className: cx(classes.labelContainer, (_cx2 = {}, _cx2[classes.rtlLabelContainer] = isRtl, _cx2))
98
98
  },
99
99
  React.createElement(
100
- SvgIcon,
100
+ Icon,
101
101
  {
102
102
  color: 'primary',
103
- className: cx(classes.labelIcon, (_cx4 = {}, _cx4[classes.disabledLabel] = isDisabled, _cx4))
103
+ className: cx(classes.labelIcon, (_cx3 = {}, _cx3[classes.disabledLabel] = isDisabled, _cx3))
104
104
  },
105
- React.createElement('path', { d: R.and(isSelected, R.not(isDisabled)) ? checkPath : checkBoxPath })
105
+ isSelected && R.not(isDisabled) ? React.createElement(CheckedBoxIcon, null) : React.createElement(CheckBoxIcon, null)
106
106
  ),
107
107
  svgPath && React.createElement(
108
108
  SvgIcon,
109
109
  {
110
110
  color: 'primary',
111
- className: cx(classes.labelIcon, (_cx5 = {}, _cx5[classes.disabledLabel] = isDisabled, _cx5))
111
+ className: cx(classes.labelIcon, (_cx4 = {}, _cx4[classes.disabledLabel] = isDisabled, _cx4))
112
112
  },
113
113
  React.createElement('path', { d: svgPath })
114
114
  ),
@@ -137,7 +137,7 @@ var Item = function Item(_ref) {
137
137
  'data-testid': testId + '_value_' + id,
138
138
  color: 'inherit',
139
139
  variant: 'body2',
140
- className: cx(classes.label, (_cx6 = {}, _cx6[classes.disabledLabel] = isDisabled, _cx6[classes.tooltipNotice] = !R.isEmpty(description), _cx6))
140
+ className: cx(classes.label, (_cx5 = {}, _cx5[classes.disabledLabel] = isDisabled, _cx5[classes.tooltipNotice] = !R.isEmpty(description), _cx5))
141
141
  },
142
142
  label
143
143
  )
@@ -114,7 +114,9 @@ var VirtualizedTree = function VirtualizedTree(props) {
114
114
  };
115
115
  var shiftSelect = function shiftSelect(index) {
116
116
  if (R.isEmpty(shiftIndexes)) {
117
- var item = R.nth(index, list);
117
+ var item = R.pipe(R.nth(index), function (id) {
118
+ return R.prop(id, indexedItemsById);
119
+ })(list);
118
120
  var ids = R.pipe(getItemScope, R.filter(function (v) {
119
121
  return v.isSelected === item.isSelected;
120
122
  }), R.map(getHierarchicalId), R.indexBy(R.identity))(item);
@@ -154,25 +156,21 @@ var VirtualizedTree = function VirtualizedTree(props) {
154
156
  apply();
155
157
  } : null,
156
158
  onMouseDown: function onMouseDown(e) {
157
- if (e.ctrlKey || e.shiftKey) {
158
- return;
159
+ if (e.ctrlKey) {
160
+ multiSelect(id);
161
+ } else if (e.shiftKey) {
162
+ shiftSelect(index);
163
+ } else {
164
+ multiSelect(id);
165
+ setIsMouseDown(true);
159
166
  }
160
- multiSelect(id);
161
- setIsMouseDown(true);
162
167
  },
163
168
  onMouseEnter: isMouseDown ? function (e) {
164
169
  if (e.ctrlKey || e.shiftKey) {
165
170
  return;
166
171
  }
167
172
  multiSelect(id);
168
- } : null,
169
- onClick: function onClick(e) {
170
- if (e.ctrlKey) {
171
- multiSelect(id);
172
- } else if (e.shiftKey) {
173
- shiftSelect(index);
174
- }
175
- }
173
+ } : null
176
174
  };
177
175
  };
178
176
  var onKeyUp = function onKeyUp(e) {
@@ -296,7 +294,8 @@ var VirtualizedTree = function VirtualizedTree(props) {
296
294
  index: index,
297
295
  style: style,
298
296
  accessibility: accessibility,
299
- ariaLabel: R.prop('navigateNext')(labels)
297
+ ariaLabel: R.prop('navigateNext')(labels),
298
+ theme: theme
300
299
  }));
301
300
  }
302
301
  });
@@ -83,6 +83,46 @@ var _ = require('..');
83
83
 
84
84
  var _styles = require('@material-ui/core/styles');
85
85
 
86
+ var _singleSelection = require('./images/single-selection.png');
87
+
88
+ var _singleSelection2 = _interopRequireDefault(_singleSelection);
89
+
90
+ var _childrenSelection = require('./images/children-selection.png');
91
+
92
+ var _childrenSelection2 = _interopRequireDefault(_childrenSelection);
93
+
94
+ var _branchSelection = require('./images/branch-selection.png');
95
+
96
+ var _branchSelection2 = _interopRequireDefault(_branchSelection);
97
+
98
+ var _levelSelection = require('./images/level-selection.png');
99
+
100
+ var _levelSelection2 = _interopRequireDefault(_levelSelection);
101
+
102
+ var _allSelection = require('./images/all-selection.png');
103
+
104
+ var _allSelection2 = _interopRequireDefault(_allSelection);
105
+
106
+ var _smallSingleSelection = require('./images/small-single-selection.png');
107
+
108
+ var _smallSingleSelection2 = _interopRequireDefault(_smallSingleSelection);
109
+
110
+ var _smallChildrenSelection = require('./images/small-children-selection.png');
111
+
112
+ var _smallChildrenSelection2 = _interopRequireDefault(_smallChildrenSelection);
113
+
114
+ var _smallBranchSelection = require('./images/small-branch-selection.png');
115
+
116
+ var _smallBranchSelection2 = _interopRequireDefault(_smallBranchSelection);
117
+
118
+ var _smallLevelSelection = require('./images/small-level-selection.png');
119
+
120
+ var _smallLevelSelection2 = _interopRequireDefault(_smallLevelSelection);
121
+
122
+ var _smallAllSelection = require('./images/small-all-selection.png');
123
+
124
+ var _smallAllSelection2 = _interopRequireDefault(_smallAllSelection);
125
+
86
126
  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; } }
87
127
 
88
128
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -130,6 +170,10 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
130
170
  alignItems: 'flex-start'
131
171
  },
132
172
  spotlight: { width: '45%' },
173
+ selection: {
174
+ display: 'flex',
175
+ alignItems: 'center'
176
+ },
133
177
  narrowSpotlight: { width: '100%' },
134
178
  selectionButton: {
135
179
  marginLeft: 24,
@@ -143,7 +187,7 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
143
187
  width: '50%',
144
188
  position: 'absolute',
145
189
  top: 105,
146
- right: 24,
190
+ right: 48,
147
191
  zIndex: 1
148
192
  },
149
193
  narrowSelectionMenu: {
@@ -154,16 +198,28 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
154
198
  flexDirection: 'row',
155
199
  flexWrap: 'wrap'
156
200
  },
157
- selectedItem: {
158
- backgroundColor: theme.palette.secondary.main
201
+ selectButton: {
202
+ color: theme.palette.primary.main,
203
+ '&:hover': {
204
+ color: theme.palette.primary.main,
205
+ backgroundColor: theme.palette.action.hover
206
+ }
207
+ },
208
+ selectedButton: {
209
+ backgroundColor: theme.palette.secondary.main,
210
+ '&:hover': {
211
+ backgroundColor: theme.palette.action.selected
212
+ }
159
213
  },
160
214
  selectModeItem: {
161
215
  boxShadow: 'none',
162
216
  display: 'flex',
163
217
  width: 110,
164
218
  height: 200,
219
+ backgroundColor: 'inherit',
220
+ color: 'inherit',
165
221
  flexDirection: 'column',
166
- justifyContent: 'flex-end',
222
+ justifyContent: 'space-between',
167
223
  '& img': {
168
224
  width: 110,
169
225
  height: 140
@@ -179,6 +235,7 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
179
235
  });
180
236
 
181
237
  var getScopeGetters = exports.getScopeGetters = function getScopeGetters(items, groupedItems, disableAccessor) {
238
+ var indexed = R.indexBy(_VirtualizedTree.getHierarchicalId, items);
182
239
  return {
183
240
  all: function all() {
184
241
  return R.reject(disableAccessor, items);
@@ -200,9 +257,10 @@ var getScopeGetters = exports.getScopeGetters = function getScopeGetters(items,
200
257
  return R.reject(disableAccessor, items);
201
258
  },
202
259
  level: function level(item) {
203
- var parentId = R.propOr('#ROOT', 'parentId', item);
204
- var items = R.prop(parentId, groupedItems);
205
- return R.reject(disableAccessor, items);
260
+ var depth = (0, _VirtualizedTree.getDepth)(indexed)(item);
261
+ return R.filter(function (it) {
262
+ return !disableAccessor(it) && (0, _VirtualizedTree.getDepth)(indexed)(it) === depth;
263
+ }, items);
206
264
  }
207
265
  };
208
266
  };
@@ -233,10 +291,12 @@ var SelectionModeMenu = function SelectionModeMenu(_ref) {
233
291
 
234
292
  var value = _ref2.value,
235
293
  label = _ref2.label,
236
- imgSrc = _ref2.imgSrc;
294
+ img = _ref2.img;
237
295
  return _react2.default.createElement(
238
296
  _.Button,
239
- _extends({}, value === selected ? { variant: 'contained', color: 'secondary' } : {}, {
297
+ _extends({
298
+ className: (0, _classnames2.default)(classes.selectButton, (_cx = {}, _cx[classes.selectedButton] = value === selected, _cx))
299
+ }, value === selected ? { variant: 'contained', color: 'secondary' } : {}, {
240
300
  key: value,
241
301
  onClick: function onClick() {
242
302
  return onSelect(value);
@@ -244,16 +304,13 @@ var SelectionModeMenu = function SelectionModeMenu(_ref) {
244
304
  }),
245
305
  _react2.default.createElement(
246
306
  _Paper2.default,
247
- {
248
- className: (0, _classnames2.default)(classes.selectModeItem, (_cx = {}, _cx[classes.selectedItem] = value === selected, _cx)),
249
- key: value
250
- },
307
+ { className: classes.selectModeItem, key: value },
251
308
  _react2.default.createElement(
252
309
  _Typography2.default,
253
310
  { variant: 'body2' },
254
311
  label
255
312
  ),
256
- _react2.default.createElement('img', { src: imgSrc, alt: value })
313
+ !R.isNil(img) && R.is(String, img) && _react2.default.createElement('img', { src: img, alt: value })
257
314
  )
258
315
  );
259
316
  }, options)
@@ -281,6 +338,14 @@ SelectionModeMenu.propTypes = process.env.NODE_ENV !== "production" ? {
281
338
  selected: _propTypes2.default.string
282
339
  } : {};
283
340
 
341
+ var icons = {
342
+ single: _smallSingleSelection2.default,
343
+ children: _smallChildrenSelection2.default,
344
+ branch: _smallBranchSelection2.default,
345
+ level: _smallLevelSelection2.default,
346
+ all: _smallAllSelection2.default
347
+ };
348
+
284
349
  var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
285
350
  var _cx2;
286
351
 
@@ -293,9 +358,8 @@ var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
293
358
  isOpen = props.isOpen,
294
359
  isNarrow = props.isNarrow,
295
360
  labels = props.labels,
296
- imgs = props.imgs,
297
361
  disableAccessor = props.disableAccessor,
298
- rest = _objectWithoutProperties(props, ['id', 'title', 'items', 'labelRenderer', 'onClose', 'changeSelection', 'isOpen', 'isNarrow', 'labels', 'imgs', 'disableAccessor']);
362
+ rest = _objectWithoutProperties(props, ['id', 'title', 'items', 'labelRenderer', 'onClose', 'changeSelection', 'isOpen', 'isNarrow', 'labels', 'disableAccessor']);
299
363
 
300
364
  var _useState = (0, _react.useState)(''),
301
365
  term = _useState[0].term,
@@ -342,20 +406,24 @@ var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
342
406
  var selectionOptions = [{
343
407
  value: 'single',
344
408
  label: R.prop('singleSelection', labels),
345
- imgSrc: R.prop('singleSelection', imgs)
409
+ img: _singleSelection2.default
346
410
  }, {
347
411
  value: 'children',
348
412
  label: R.prop('childrenSelection', labels),
349
- imgSrc: R.prop('childrenSelection', imgs)
413
+ img: _childrenSelection2.default
350
414
  }, {
351
415
  value: 'branch',
352
416
  label: R.prop('branchSelection', labels),
353
- imgSrc: R.prop('branchSelection', imgs)
417
+ img: _branchSelection2.default
354
418
  }, {
355
419
  value: 'level',
356
420
  label: R.prop('levelSelection', labels),
357
- imgSrc: R.prop('levelSelection', imgs)
358
- }, { value: 'all', label: R.prop('allSelection', labels), imgSrc: R.prop('allSelection', imgs) }];
421
+ img: _levelSelection2.default
422
+ }, {
423
+ value: 'all',
424
+ label: R.prop('allSelection', labels),
425
+ img: _allSelection2.default
426
+ }];
359
427
 
360
428
  var isDisabled = function isDisabled(item) {
361
429
  return R.is(Function, disableAccessor) ? disableAccessor(item) : false;
@@ -424,7 +492,7 @@ var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
424
492
  ),
425
493
  _react2.default.createElement(
426
494
  'div',
427
- null,
495
+ { className: classes.selection },
428
496
  _react2.default.createElement(
429
497
  _.Button,
430
498
  {
@@ -440,7 +508,13 @@ var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
440
508
  R.prop('selectionMode', labels)
441
509
  ),
442
510
  '\xA0',
443
- R.prop(selectionMode + 'Selection', labels)
511
+ R.prop(selectionMode + 'Selection', labels),
512
+ !R.isNil(R.prop(selectionMode, icons)) && R.is(String, R.prop(selectionMode, icons)) && _react2.default.createElement(
513
+ _react.Fragment,
514
+ null,
515
+ '\xA0',
516
+ _react2.default.createElement('img', { src: R.prop(selectionMode, icons), alt: selectionMode })
517
+ )
444
518
  )
445
519
  ),
446
520
  _react2.default.createElement(
@@ -465,7 +539,7 @@ var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
465
539
  items: selectionItems,
466
540
  changeSelection: onChangeSelection,
467
541
  withExpandControl: true,
468
- maxTreeHeight: 500,
542
+ maxTreeHeight: 490,
469
543
  getItemScope: R.prop(selectionMode, scopeGetters)
470
544
  }))
471
545
  )
@@ -476,7 +550,13 @@ var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
476
550
  null,
477
551
  R.is(Function, onClose) && _react2.default.createElement(
478
552
  _.Button,
479
- { onClick: onClose, color: 'primary' },
553
+ {
554
+ onClick: function onClick() {
555
+ onClose();
556
+ setSelection({});
557
+ },
558
+ color: 'primary'
559
+ },
480
560
  R.prop('cancel', labels)
481
561
  ),
482
562
  R.is(Function, changeSelection) && _react2.default.createElement(
@@ -500,7 +580,6 @@ AdvancedFilterDialog.propTypes = process.env.NODE_ENV !== "production" ? {
500
580
  changeSelection: _propTypes2.default.func,
501
581
  disableAccessor: _propTypes2.default.func,
502
582
  HTMLRenderer: _propTypes2.default.func,
503
- imgs: _propTypes2.default.object,
504
583
  isRtl: _propTypes2.default.bool,
505
584
  isNarrow: _propTypes2.default.bool,
506
585
  isOpen: _propTypes2.default.bool,
@@ -119,7 +119,7 @@ var HierarchicalFilter = function HierarchicalFilter(props) {
119
119
  spotlight: { fields: {} },
120
120
  action: setSpotlight
121
121
  }),
122
- R.is(Function, toggleBulk) && _react2.default.createElement(
122
+ R.is(Function, toggleBulk) && hasSpotligt && _react2.default.createElement(
123
123
  _.VerticalButton,
124
124
  {
125
125
  'aria-label': R.prop('advancedSelection')(labels),
@@ -36,6 +36,14 @@ var _SvgIcon = require('@material-ui/core/SvgIcon');
36
36
 
37
37
  var _SvgIcon2 = _interopRequireDefault(_SvgIcon);
38
38
 
39
+ var _CheckBoxOutlineBlankOutlined = require('@material-ui/icons/CheckBoxOutlineBlankOutlined');
40
+
41
+ var _CheckBoxOutlineBlankOutlined2 = _interopRequireDefault(_CheckBoxOutlineBlankOutlined);
42
+
43
+ var _CheckBoxOutlined = require('@material-ui/icons/CheckBoxOutlined');
44
+
45
+ var _CheckBoxOutlined2 = _interopRequireDefault(_CheckBoxOutlined);
46
+
39
47
  var _classnames = require('classnames');
40
48
 
41
49
  var _classnames2 = _interopRequireDefault(_classnames);
@@ -46,11 +54,8 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
46
54
 
47
55
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
48
56
 
49
- 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';
50
- var checkPath = 'M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z';
51
-
52
57
  var Item = function Item(_ref) {
53
- var _cx, _extends2, _cx2, _cx3, _cx4, _cx5, _cx6;
58
+ var _extends2, _cx, _cx2, _cx3, _cx4, _cx5;
54
59
 
55
60
  var classes = _ref.classes,
56
61
  id = _ref.id,
@@ -89,8 +94,7 @@ var Item = function Item(_ref) {
89
94
  {
90
95
  disableGutters: true,
91
96
  classes: { disabled: classes.disabled },
92
- className: (0, _classnames2.default)(classes.listItemContainer, (_cx = {}, _cx[classes.disableSecondaryAction] = R.not(hasChild), _cx)),
93
- disabled: isDisabled,
97
+ className: (0, _classnames2.default)(classes.listItemContainer, classes.disableSecondaryAction),
94
98
  tabIndex: -1,
95
99
  style: _extends({}, style, (_extends2 = {
96
100
  flexDirection: isRtl ? 'row-reverse' : 'row'
@@ -105,7 +109,7 @@ var Item = function Item(_ref) {
105
109
  'aria-label': ariaLabel,
106
110
  tabIndex: -1,
107
111
  size: 'small',
108
- color: 'inherit',
112
+ color: 'primary',
109
113
  onClick: function onClick() {
110
114
  return changeList(hierarchicalId || id);
111
115
  }
@@ -120,30 +124,31 @@ var Item = function Item(_ref) {
120
124
  primaryTypographyProps: { noWrap: true, color: 'inherit' },
121
125
  secondaryTypographyProps: { color: 'inherit' },
122
126
  classes: { root: classes.listItem },
123
- className: (0, _classnames2.default)((_cx2 = {}, _cx2[classes.accessibilityItemHover] = accessibility, _cx2[classes.listItemSelected] = R.and(isSelected, R.not(isDisabled)), _cx2[classes.listItemHover] = R.not(isDisabled), _cx2)),
127
+ className: (0, _classnames2.default)((_cx = {}, _cx[classes.accessibilityItemHover] = accessibility, _cx[classes.listItemSelected] = R.and(isSelected, R.not(isDisabled)), _cx[classes.listItemHover] = R.not(isDisabled), _cx[classes.disabledLabel] = isDisabled, _cx)),
124
128
  onMouseDown: isDisabled || isTooltipShown ? null : callbacks.onMouseDown,
125
129
  onMouseUp: isDisabled || isTooltipShown ? null : callbacks.onMouseUp,
126
130
  onMouseEnter: isDisabled || isTooltipShown ? null : callbacks.onMouseEnter
127
131
  }, R.pick(['onKeyPress'], callbacks), {
128
132
  title: isDisabled ? R.propOr('', 'disableItemLabel')(labels) + ' ' + label : label,
133
+ style: { opacity: isDisabled ? '0.5' : '1' },
129
134
  primary: _react2.default.createElement(
130
135
  'div',
131
136
  {
132
- className: (0, _classnames2.default)(classes.labelContainer, (_cx3 = {}, _cx3[classes.rtlLabelContainer] = isRtl, _cx3))
137
+ className: (0, _classnames2.default)(classes.labelContainer, (_cx2 = {}, _cx2[classes.rtlLabelContainer] = isRtl, _cx2))
133
138
  },
134
139
  _react2.default.createElement(
135
140
  _SvgIcon2.default,
136
141
  {
137
142
  color: 'primary',
138
- className: (0, _classnames2.default)(classes.labelIcon, (_cx4 = {}, _cx4[classes.disabledLabel] = isDisabled, _cx4))
143
+ className: (0, _classnames2.default)(classes.labelIcon, (_cx3 = {}, _cx3[classes.disabledLabel] = isDisabled, _cx3))
139
144
  },
140
- _react2.default.createElement('path', { d: R.and(isSelected, R.not(isDisabled)) ? checkPath : checkBoxPath })
145
+ isSelected && R.not(isDisabled) ? _react2.default.createElement(_CheckBoxOutlined2.default, null) : _react2.default.createElement(_CheckBoxOutlineBlankOutlined2.default, null)
141
146
  ),
142
147
  svgPath && _react2.default.createElement(
143
148
  _SvgIcon2.default,
144
149
  {
145
150
  color: 'primary',
146
- className: (0, _classnames2.default)(classes.labelIcon, (_cx5 = {}, _cx5[classes.disabledLabel] = isDisabled, _cx5))
151
+ className: (0, _classnames2.default)(classes.labelIcon, (_cx4 = {}, _cx4[classes.disabledLabel] = isDisabled, _cx4))
147
152
  },
148
153
  _react2.default.createElement('path', { d: svgPath })
149
154
  ),
@@ -172,7 +177,7 @@ var Item = function Item(_ref) {
172
177
  'data-testid': testId + '_value_' + id,
173
178
  color: 'inherit',
174
179
  variant: 'body2',
175
- className: (0, _classnames2.default)(classes.label, (_cx6 = {}, _cx6[classes.disabledLabel] = isDisabled, _cx6[classes.tooltipNotice] = !R.isEmpty(description), _cx6))
180
+ className: (0, _classnames2.default)(classes.label, (_cx5 = {}, _cx5[classes.disabledLabel] = isDisabled, _cx5[classes.tooltipNotice] = !R.isEmpty(description), _cx5))
176
181
  },
177
182
  label
178
183
  )
@@ -155,7 +155,9 @@ var VirtualizedTree = function VirtualizedTree(props) {
155
155
  };
156
156
  var shiftSelect = function shiftSelect(index) {
157
157
  if (R.isEmpty(shiftIndexes)) {
158
- var item = R.nth(index, list);
158
+ var item = R.pipe(R.nth(index), function (id) {
159
+ return R.prop(id, indexedItemsById);
160
+ })(list);
159
161
  var ids = R.pipe(getItemScope, R.filter(function (v) {
160
162
  return v.isSelected === item.isSelected;
161
163
  }), R.map(getHierarchicalId), R.indexBy(R.identity))(item);
@@ -195,25 +197,21 @@ var VirtualizedTree = function VirtualizedTree(props) {
195
197
  apply();
196
198
  } : null,
197
199
  onMouseDown: function onMouseDown(e) {
198
- if (e.ctrlKey || e.shiftKey) {
199
- return;
200
+ if (e.ctrlKey) {
201
+ multiSelect(id);
202
+ } else if (e.shiftKey) {
203
+ shiftSelect(index);
204
+ } else {
205
+ multiSelect(id);
206
+ setIsMouseDown(true);
200
207
  }
201
- multiSelect(id);
202
- setIsMouseDown(true);
203
208
  },
204
209
  onMouseEnter: isMouseDown ? function (e) {
205
210
  if (e.ctrlKey || e.shiftKey) {
206
211
  return;
207
212
  }
208
213
  multiSelect(id);
209
- } : null,
210
- onClick: function onClick(e) {
211
- if (e.ctrlKey) {
212
- multiSelect(id);
213
- } else if (e.shiftKey) {
214
- shiftSelect(index);
215
- }
216
- }
214
+ } : null
217
215
  };
218
216
  };
219
217
  var onKeyUp = function onKeyUp(e) {
@@ -337,7 +335,8 @@ var VirtualizedTree = function VirtualizedTree(props) {
337
335
  index: index,
338
336
  style: style,
339
337
  accessibility: accessibility,
340
- ariaLabel: R.prop('navigateNext')(labels)
338
+ ariaLabel: R.prop('navigateNext')(labels),
339
+ theme: theme
341
340
  }));
342
341
  }
343
342
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-visions",
3
- "version": "7.20.0",
3
+ "version": "7.20.2",
4
4
  "description": "Library of visual components",
5
5
  "author": "OECD",
6
6
  "homepage": "https://visions-qa.siscc.org/#o",
@@ -18,8 +18,8 @@
18
18
  "umd"
19
19
  ],
20
20
  "scripts": {
21
- "build": "nwb build-react-component --no-demo && node scripts/doc && nwb build-demo",
22
- "build:dev": "nwb build-react-component --no-demo",
21
+ "build": "nwb build-react-component --copy-files --no-demo && node scripts/doc && nwb build-demo",
22
+ "build:dev": "nwb build-react-component --copy-files --no-demo",
23
23
  "clean": "nwb clean-module && nwb clean-demo",
24
24
  "prepublishOnly": "npm run build",
25
25
  "start": "nwb serve-react-demo",
@@ -73,6 +73,7 @@
73
73
  "eslint-plugin-react": "^7.18.3",
74
74
  "eslint-plugin-react-hooks": "^2.0.1",
75
75
  "husky": "^2.7.0",
76
+ "identity-obj-proxy": "^3.0.0",
76
77
  "jest": "^24.8.0",
77
78
  "jest-environment-jsdom-fourteen": "0.1.0",
78
79
  "jss-rtl": "^0.2.3",
@@ -113,7 +114,8 @@
113
114
  "modulePaths": [],
114
115
  "moduleNameMapper": {
115
116
  "^react-native$": "react-native-web",
116
- "^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy"
117
+ "^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy",
118
+ "\\.(jpg|jpeg|png)$": "identity-obj-proxy"
117
119
  },
118
120
  "moduleFileExtensions": [
119
121
  "web.js",
@@ -207,4 +209,4 @@
207
209
  "parser": "babylon",
208
210
  "semi": true
209
211
  }
210
- }
212
+ }