@sis-cc/dotstatsuite-visions 10.5.2 → 10.6.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.
@@ -64,6 +64,7 @@ var Item = function Item(_ref) {
64
64
  description = _ref$description === undefined ? '' : _ref$description,
65
65
  isSelected = _ref.isSelected,
66
66
  isDisabled = _ref.isDisabled,
67
+ isGreyed = _ref.isGreyed,
67
68
  changeList = _ref.changeList,
68
69
  ariaLabel = _ref.ariaLabel,
69
70
  NavigateIcon = _ref.NavigateIcon,
@@ -71,7 +72,6 @@ var Item = function Item(_ref) {
71
72
  hasChildrenOnLevel = _ref.hasChildrenOnLevel,
72
73
  count = _ref.count,
73
74
  svgPath = _ref.svgPath,
74
- testId = _ref.testId,
75
75
  style = _ref.style,
76
76
  isRtl = _ref.isRtl,
77
77
  accessibility = _ref.accessibility,
@@ -117,6 +117,7 @@ var Item = function Item(_ref) {
117
117
  _react2.default.createElement(NavigateIcon, null)
118
118
  ),
119
119
  _react2.default.createElement(_ListItemText2.default, _extends({
120
+ 'data-testid': 'value_' + id,
120
121
  tabIndex: 0,
121
122
  'aria-label': isDisabled ? R.propOr('', 'disableItemLabel')(labels) + ' ' + label : label,
122
123
  'aria-pressed': isSelected,
@@ -143,13 +144,13 @@ var Item = function Item(_ref) {
143
144
  color: 'primary',
144
145
  className: (0, _classnames2.default)(classes.labelIcon, (_cx3 = {}, _cx3[classes.disabledLabel] = isDisabled, _cx3))
145
146
  },
146
- isSelected && R.not(isDisabled) ? _react2.default.createElement(_CheckBoxOutlined2.default, null) : _react2.default.createElement(_CheckBoxOutlineBlankOutlined2.default, null)
147
+ isSelected ? _react2.default.createElement(_CheckBoxOutlined2.default, null) : _react2.default.createElement(_CheckBoxOutlineBlankOutlined2.default, null)
147
148
  ),
148
149
  svgPath && _react2.default.createElement(
149
150
  _SvgIcon2.default,
150
151
  {
151
152
  color: 'primary',
152
- className: (0, _classnames2.default)(classes.labelIcon, (_cx4 = {}, _cx4[classes.disabledLabel] = isDisabled, _cx4))
153
+ className: (0, _classnames2.default)(classes.labelIcon, (_cx4 = {}, _cx4[classes.disabledLabel] = isGreyed || isDisabled, _cx4))
153
154
  },
154
155
  _react2.default.createElement('path', { d: svgPath })
155
156
  ),
@@ -176,10 +177,9 @@ var Item = function Item(_ref) {
176
177
  _react2.default.createElement(
177
178
  _Typography2.default,
178
179
  {
179
- 'data-testid': testId + '_value_' + id,
180
180
  color: 'inherit',
181
181
  variant: 'body2',
182
- className: (0, _classnames2.default)(classes.label, (_cx5 = {}, _cx5[classes.disabledLabel] = isDisabled, _cx5[classes.tooltipNotice] = !R.isEmpty(description), _cx5))
182
+ className: (0, _classnames2.default)(classes.label, (_cx5 = {}, _cx5[classes.disabledLabel] = isGreyed || isDisabled, _cx5[classes.tooltipNotice] = !R.isEmpty(description), _cx5))
183
183
  },
184
184
  label
185
185
  )
@@ -215,7 +215,6 @@ Item.propTypes = process.env.NODE_ENV !== "production" ? {
215
215
  svgPath: _propTypes2.default.string,
216
216
  style: _propTypes2.default.object,
217
217
  isRtl: _propTypes2.default.bool,
218
- testId: _propTypes2.default.string,
219
218
  accessibility: _propTypes2.default.bool,
220
219
  index: _propTypes2.default.number,
221
220
  labelRenderer: _propTypes2.default.func,
@@ -223,7 +222,8 @@ Item.propTypes = process.env.NODE_ENV !== "production" ? {
223
222
  hierarchicalId: _propTypes2.default.string,
224
223
  labels: _propTypes2.default.object,
225
224
  depth: _propTypes2.default.number,
226
- eventsCallbacks: _propTypes2.default.func
225
+ eventsCallbacks: _propTypes2.default.func,
226
+ isGreyed: _propTypes2.default.bool
227
227
  } : {};
228
228
 
229
229
  exports.default = Item;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  exports.__esModule = true;
4
- exports.getDepth = exports.getHasChildrenOnLevel = exports.getDisplayedIds = exports.getHierarchicalId = undefined;
4
+ exports.getHasChildrenOnLevel = exports.getDisplayedIds = undefined;
5
5
 
6
6
  var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
7
7
 
@@ -45,23 +45,23 @@ var _core = require('@material-ui/core');
45
45
 
46
46
  var _styles = require('../ScopeList/styles');
47
47
 
48
- var _utils = require('../utils');
48
+ var _utils = require('./utils');
49
+
50
+ var _utils2 = require('../utils');
49
51
 
50
52
  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; } }
51
53
 
52
54
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
53
55
 
54
- var getSingleItemScope = function getSingleItemScope(item) {
55
- return [item];
56
- };
57
-
58
- var getHierarchicalId = exports.getHierarchicalId = function getHierarchicalId(item) {
59
- return R.prop('hierarchicalId', item) || R.prop('id', item);
56
+ var singleScopeGetter = function singleScopeGetter() {
57
+ return function (item) {
58
+ return [item];
59
+ };
60
60
  };
61
61
 
62
62
  var getDisplayedIds = exports.getDisplayedIds = function getDisplayedIds(items, grouped, expanded) {
63
63
  return R.pipe(R.map(function (item) {
64
- var hierarchicalId = getHierarchicalId(item);
64
+ var hierarchicalId = (0, _utils.getHierarchicalId)(item);
65
65
  if (R.has(hierarchicalId, grouped) && R.has(hierarchicalId, expanded)) {
66
66
  var children = getDisplayedIds(R.prop(hierarchicalId, grouped), grouped, expanded);
67
67
  return R.prepend(hierarchicalId, children);
@@ -72,29 +72,22 @@ var getDisplayedIds = exports.getDisplayedIds = function getDisplayedIds(items,
72
72
 
73
73
  var getHasChildrenOnLevel = exports.getHasChildrenOnLevel = function getHasChildrenOnLevel(groupedItems) {
74
74
  return function (item) {
75
- if (R.has(getHierarchicalId(item), groupedItems)) {
75
+ if (R.has((0, _utils.getHierarchicalId)(item), groupedItems)) {
76
76
  return true;
77
77
  }
78
78
  return R.pipe(R.prop(R.propOr('#ROOT', 'parentId', item)), R.find(function (it) {
79
- return R.has(getHierarchicalId(it), groupedItems);
79
+ return R.has((0, _utils.getHierarchicalId)(it), groupedItems);
80
80
  }), R.complement(R.isNil))(groupedItems);
81
81
  };
82
82
  };
83
83
 
84
- var getDepth = exports.getDepth = function getDepth(indexedItems) {
85
- return function (item) {
86
- if (R.isNil(item.parentId)) {
87
- return 0;
88
- }
89
- var parent = R.prop(item.parentId, indexedItems);
90
- return getDepth(indexedItems)(parent) + 1;
91
- };
92
- };
93
-
94
84
  var VirtualizedTree = function VirtualizedTree(props) {
95
85
  var accessibility = props.accessibility,
96
86
  changeSelection = props.changeSelection,
97
- disableAccessor = props.disableAccessor,
87
+ _props$disableAccesso = props.disableAccessor,
88
+ disableAccessor = _props$disableAccesso === undefined ? R.always(false) : _props$disableAccesso,
89
+ _props$isGreyed = props.isGreyed,
90
+ isGreyed = _props$isGreyed === undefined ? R.always(false) : _props$isGreyed,
98
91
  HTMLRenderer = props.HTMLRenderer,
99
92
  items = props.items,
100
93
  labelRenderer = props.labelRenderer,
@@ -104,8 +97,8 @@ var VirtualizedTree = function VirtualizedTree(props) {
104
97
  collapse = props.collapse,
105
98
  _props$maxTreeHeight = props.maxTreeHeight,
106
99
  maxTreeHeight = _props$maxTreeHeight === undefined ? 250 : _props$maxTreeHeight,
107
- _props$getItemScope = props.getItemScope,
108
- getItemScope = _props$getItemScope === undefined ? getSingleItemScope : _props$getItemScope,
100
+ _props$scopeGetter = props.scopeGetter,
101
+ scopeGetter = _props$scopeGetter === undefined ? singleScopeGetter : _props$scopeGetter,
109
102
  _props$treeHeight = props.treeHeight,
110
103
  treeHeight = _props$treeHeight === undefined ? 0 : _props$treeHeight;
111
104
 
@@ -132,21 +125,41 @@ var VirtualizedTree = function VirtualizedTree(props) {
132
125
  setLastItemId = _useState5[1];
133
126
 
134
127
  var _useMemo = (0, _react.useMemo)(function () {
135
- var indexedItemsById = R.indexBy(getHierarchicalId, items);
136
- var groupedItemsByParentId = R.groupBy(R.propOr('#ROOT', 'parentId'), items);
128
+ var refinedItems = R.map(function (item) {
129
+ return _extends({}, item, {
130
+ isSelected: (0, _utils.isItemSelected)(selectIds)(item),
131
+ isGreyed: R.is(Function, isGreyed) ? isGreyed(item) : false,
132
+ isDisabled: R.is(Function, disableAccessor) ? disableAccessor(item, selectIds) : false
133
+ });
134
+ }, items);
135
+ var indexedItemsById = R.indexBy(_utils.getHierarchicalId, refinedItems);
136
+ var groupedItemsByParentId = R.groupBy(R.propOr('#ROOT', 'parentId'), refinedItems);
137
137
  return { indexedItemsById: indexedItemsById, groupedItemsByParentId: groupedItemsByParentId };
138
- }, [items]),
138
+ }, [items, selectIds]),
139
139
  indexedItemsById = _useMemo.indexedItemsById,
140
140
  groupedItemsByParentId = _useMemo.groupedItemsByParentId;
141
141
 
142
142
  var list = (0, _react.useMemo)(function () {
143
143
  return getDisplayedIds(R.propOr([], '#ROOT', groupedItemsByParentId), groupedItemsByParentId, expandedIds);
144
144
  }, [items, expandedIds]);
145
+
146
+ var getItemScope = scopeGetter({ indexedItemsById: indexedItemsById, groupedItemsByParentId: groupedItemsByParentId });
147
+
148
+ var isItemSelected = (0, _utils.isItemSelected)(selectIds);
149
+
145
150
  var multiSelect = function multiSelect(id) {
146
151
  var item = R.prop(id, indexedItemsById);
147
152
  var ids = R.pipe(getItemScope, R.filter(function (v) {
148
153
  return v.isSelected === item.isSelected;
149
- }), R.map(getHierarchicalId))(item);
154
+ }), function (items) {
155
+ return (0, _utils.getDuplicates)(items, indexedItemsById);
156
+ }, R.map(_utils.getHierarchicalId))(item);
157
+
158
+ if (isItemSelected(item)) {
159
+ var deprecatedIds = (0, _utils.getDeprecatedIds)(ids, { indexedItemsById: indexedItemsById, groupedItemsByParentId: groupedItemsByParentId }, selectIds);
160
+ ids = R.concat(ids, deprecatedIds);
161
+ }
162
+
150
163
  if (R.has(id, selectIds)) {
151
164
  setSelectIds(R.omit(ids, selectIds));
152
165
  } else {
@@ -160,7 +173,7 @@ var VirtualizedTree = function VirtualizedTree(props) {
160
173
  return R.props(ids, indexedItemsById);
161
174
  }, R.map(getItemScope), R.unnest, R.filter(function (v) {
162
175
  return v.isSelected === isSelected;
163
- }), R.map(getHierarchicalId), R.indexBy(R.identity))(list);
176
+ }), R.map(_utils.getHierarchicalId), R.indexBy(R.identity))(list);
164
177
  setShiftIndexes(indexes);
165
178
  setSelectIds(_selectIds);
166
179
  };
@@ -180,7 +193,7 @@ var VirtualizedTree = function VirtualizedTree(props) {
180
193
  }
181
194
  var ids = R.pipe(getItemScope, R.filter(function (v) {
182
195
  return v.isSelected === item.isSelected;
183
- }), R.map(getHierarchicalId), R.indexBy(R.identity))(item);
196
+ }), R.map(_utils.getHierarchicalId), R.indexBy(R.identity))(item);
184
197
  setShiftIndexes(R.append(index, shiftIndexes));
185
198
  setSelectIds(ids);
186
199
  } else if (R.length(shiftIndexes) === 1 && index === R.head(shiftIndexes)) {
@@ -250,12 +263,6 @@ var VirtualizedTree = function VirtualizedTree(props) {
250
263
  apply();
251
264
  }
252
265
  };
253
- var isItemSelected = function isItemSelected(item) {
254
- if (!R.isEmpty(selectIds) && R.has(getHierarchicalId(item), selectIds)) {
255
- return !item.isSelected;
256
- }
257
- return !!item.isSelected;
258
- };
259
266
  var ref = (0, _react.useRef)();
260
267
  var classes = (0, _styles.useStyles)();
261
268
 
@@ -292,7 +299,7 @@ var VirtualizedTree = function VirtualizedTree(props) {
292
299
  if (R.isEmpty(list)) {
293
300
  return null;
294
301
  }
295
- var isRtl = (0, _utils.getIsRtl)(theme);
302
+ var isRtl = (0, _utils2.getIsRtl)(theme);
296
303
  return _react2.default.createElement(
297
304
  _List4.default,
298
305
  {
@@ -323,22 +330,20 @@ var VirtualizedTree = function VirtualizedTree(props) {
323
330
  var itemId = R.nth(index, list);
324
331
  var item = R.prop(itemId, indexedItemsById);
325
332
  return _react2.default.createElement(_Item2.default, _extends({}, item, {
326
- id: getHierarchicalId(item),
333
+ id: (0, _utils.getHierarchicalId)(item),
327
334
  label: labelRenderer(item),
328
- key: getHierarchicalId(item),
329
- depth: getDepth(indexedItemsById)(item),
335
+ key: (0, _utils.getHierarchicalId)(item),
336
+ depth: (0, _utils.getDepth)(indexedItemsById)(item),
330
337
  hasChild: R.has(itemId, groupedItemsByParentId),
331
338
  hasChildrenOnLevel: getHasChildrenOnLevel(groupedItemsByParentId)(item),
332
339
  changeList: R.has(itemId, expandedIds) ? function () {
333
- return collapse(getHierarchicalId(item));
340
+ return collapse((0, _utils.getHierarchicalId)(item));
334
341
  } : function () {
335
- return expand(getHierarchicalId(item));
342
+ return expand((0, _utils.getHierarchicalId)(item));
336
343
  },
337
344
  NavigateIcon: R.has(itemId, expandedIds) ? _ExpandLess2.default : _ExpandMore2.default,
338
345
  isRtl: isRtl,
339
- isDisabled: R.is(Function, disableAccessor) ? disableAccessor(item) : false,
340
346
  eventsCallbacks: eventsCallbacks,
341
- isSelected: isItemSelected(item),
342
347
  HTMLRenderer: HTMLRenderer,
343
348
  classes: classes,
344
349
  labels: labels,
@@ -364,9 +369,7 @@ VirtualizedTree.propTypes = process.env.NODE_ENV !== "production" ? {
364
369
  isRtl: _propTypes2.default.bool,
365
370
  items: _propTypes2.default.array,
366
371
  labels: _propTypes2.default.shape({
367
- disableItemLabel: _propTypes2.default.string,
368
- colapseAll: _propTypes2.default.string,
369
- expandAll: _propTypes2.default.string
372
+ disableItemLabel: _propTypes2.default.string
370
373
  }),
371
374
  labelRenderer: _propTypes2.default.func,
372
375
  withExpandControl: _propTypes2.default.bool,
@@ -374,7 +377,9 @@ VirtualizedTree.propTypes = process.env.NODE_ENV !== "production" ? {
374
377
  expandedIds: _propTypes2.default.object,
375
378
  expand: _propTypes2.default.func,
376
379
  collapse: _propTypes2.default.func,
377
- treeHeight: _propTypes2.default.number
380
+ treeHeight: _propTypes2.default.number,
381
+ isGreyed: _propTypes2.default.func,
382
+ scopeGetter: _propTypes2.default.func
378
383
  } : {};
379
384
 
380
385
  exports.default = VirtualizedTree;
@@ -0,0 +1,159 @@
1
+ 'use strict';
2
+
3
+ exports.__esModule = true;
4
+ exports.getScopeGetters = exports.getHierDisableAccessor = exports.getSingleDisableAccessor = exports.getDeprecatedIds = exports.getDuplicates = exports.getDepth = exports.isItemSelected = exports.getDescendants = exports.getHierarchicalId = undefined;
5
+
6
+ var _ramda = require('ramda');
7
+
8
+ var R = _interopRequireWildcard(_ramda);
9
+
10
+ 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; } }
11
+
12
+ var getHierarchicalId = exports.getHierarchicalId = function getHierarchicalId(item) {
13
+ return R.prop('hierarchicalId', item) || R.prop('id', item);
14
+ };
15
+
16
+ var getDescendants = exports.getDescendants = function getDescendants(id, groupedItems) {
17
+ var reccurse = function reccurse(_id) {
18
+ var children = R.propOr([], _id, groupedItems);
19
+ return R.pipe(R.map(function (item) {
20
+ var __id = getHierarchicalId(item);
21
+ var descendants = reccurse(__id);
22
+ return R.prepend(item, descendants);
23
+ }), R.unnest)(children);
24
+ };
25
+
26
+ return reccurse(id);
27
+ };
28
+
29
+ var isItemSelected = exports.isItemSelected = function isItemSelected(selectIds) {
30
+ return function (item) {
31
+ if (!R.isEmpty(selectIds) && R.has(getHierarchicalId(item), selectIds)) {
32
+ return !item.isSelected;
33
+ }
34
+ return !!item.isSelected;
35
+ };
36
+ };
37
+
38
+ var getDepth = exports.getDepth = function getDepth(indexedItems) {
39
+ return function (item) {
40
+ if (R.isNil(item.parentId)) {
41
+ return 0;
42
+ }
43
+ var parent = R.prop(item.parentId, indexedItems);
44
+ return getDepth(indexedItems)(parent) + 1;
45
+ };
46
+ };
47
+
48
+ var getDuplicates = exports.getDuplicates = function getDuplicates(items, indexedItems) {
49
+ var itemsIds = R.pluck('id', items);
50
+ var grouped = R.pipe(R.values, R.groupBy(R.prop('id')))(indexedItems);
51
+ return R.pipe(R.props(itemsIds), R.unnest)(grouped);
52
+ };
53
+
54
+ var getDeprecatedIds = exports.getDeprecatedIds = function getDeprecatedIds(ids, items, selectedIds) {
55
+ var groupedItemsByParentId = items.groupedItemsByParentId,
56
+ indexedItemsById = items.indexedItemsById;
57
+
58
+ var _ids = ids;
59
+ var reccurse = function reccurse(scopeIds) {
60
+ var scopeItems = R.props(scopeIds, indexedItemsById);
61
+ var grouped = R.groupBy(R.propOr('#ROOT', 'parentId'), scopeItems);
62
+ var refined = R.omit(R.append('#ROOT', _ids), grouped);
63
+
64
+ var deprecatedParents = R.reduce(function (acc, id) {
65
+ var _item = R.prop(id, indexedItemsById);
66
+ if (!isItemSelected(selectedIds)(_item)) {
67
+ return acc;
68
+ }
69
+ var _itemsIds = R.has('hierarchicalId', _item) ? R.pipe(R.values, R.filter(R.propEq('id', _item.id)), R.map(getHierarchicalId))(indexedItemsById) : [id];
70
+
71
+ if (R.propOr(true, 'isEnabled', _item)) {
72
+ return acc;
73
+ }
74
+ var children = R.pipe(R.props(_itemsIds), R.unnest)(groupedItemsByParentId);
75
+ var selectedChild = R.find(function (child) {
76
+ return !R.includes(getHierarchicalId(child), _ids) && isItemSelected(selectedIds)(child);
77
+ }, children);
78
+ if (R.isNil(selectedChild)) {
79
+ return R.concat(acc, _itemsIds);
80
+ }
81
+ return acc;
82
+ }, [], R.keys(refined));
83
+
84
+ if (!R.isEmpty(deprecatedParents)) {
85
+ _ids = R.concat(_ids, deprecatedParents);
86
+ var deprecatedAncestors = reccurse(deprecatedParents);
87
+ return R.concat(deprecatedParents, deprecatedAncestors);
88
+ }
89
+
90
+ return deprecatedParents;
91
+ };
92
+
93
+ return reccurse(ids);
94
+ };
95
+
96
+ var getSingleDisableAccessor = exports.getSingleDisableAccessor = function getSingleDisableAccessor(groupedItems, disableAccessor) {
97
+ // items => total list
98
+ return function (item, selectedIds) {
99
+ if (!isItemSelected(selectedIds)(item) && disableAccessor(item)) {
100
+ var descendants = getDescendants(getHierarchicalId(item), groupedItems);
101
+ var validDescendant = R.find(isItemSelected(selectedIds), descendants);
102
+ return R.isNil(validDescendant);
103
+ }
104
+ return false;
105
+ };
106
+ };
107
+
108
+ var getHierDisableAccessor = exports.getHierDisableAccessor = function getHierDisableAccessor(groupedItems, spotlightedGroupedItems, disableAccessor) {
109
+ var accessor = function accessor(item, selectedIds) {
110
+ if (!isItemSelected(selectedIds)(item) && disableAccessor(item)) {
111
+ var spotlightedDescendants = getDescendants(getHierarchicalId(item), spotlightedGroupedItems);
112
+ var validSpotlightedDescendant = R.find(function (_item) {
113
+ return !accessor(_item, spotlightedGroupedItems);
114
+ }, spotlightedDescendants);
115
+ if (R.isNil(validSpotlightedDescendant)) {
116
+ var descendants = getDescendants(getHierarchicalId(item), groupedItems);
117
+ var validDescendant = R.find(isItemSelected(selectedIds), descendants);
118
+ return R.isNil(validDescendant);
119
+ }
120
+ }
121
+ return false;
122
+ };
123
+ return accessor;
124
+ };
125
+
126
+ var getScopeGetters = exports.getScopeGetters = {
127
+ all: function all(items) {
128
+ return function () {
129
+ return R.reject(R.prop('isDisabled'), R.values(items.indexedItemsById));
130
+ };
131
+ },
132
+ single: function single() {
133
+ return function (item) {
134
+ return [item];
135
+ };
136
+ },
137
+ children: function children(items) {
138
+ return function (item) {
139
+ var childItems = R.propOr([], getHierarchicalId(item), items.groupedItemsByParentId);
140
+ return R.reject(R.prop('isDisabled'), R.prepend(item, childItems));
141
+ };
142
+ },
143
+ branch: function branch(items) {
144
+ return function (item) {
145
+ var descendants = getDescendants(getHierarchicalId(item), items.groupedItemsByParentId);
146
+ var res = R.reject(R.prop('isDisabled'), R.prepend(item, descendants));
147
+ return res;
148
+ };
149
+ },
150
+ level: function level(items) {
151
+ return function (item) {
152
+ var indexed = items.indexedItemsById;
153
+ var depth = getDepth(indexed)(item);
154
+ return R.filter(function (it) {
155
+ return !R.prop('isDisabled', it) && getDepth(indexed)(it) === depth;
156
+ }, R.values(indexed));
157
+ };
158
+ }
159
+ };
@@ -13,7 +13,7 @@ var _ramda = require('ramda');
13
13
 
14
14
  var R = _interopRequireWildcard(_ramda);
15
15
 
16
- var _VirtualizedTree = require('./VirtualizedTree');
16
+ var _utils = require('./utils');
17
17
 
18
18
  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; } }
19
19
 
@@ -37,7 +37,7 @@ var withExpansionTree = function withExpansionTree(Component) {
37
37
  setItemsIds = _useState2[1];
38
38
 
39
39
  (0, _react.useEffect)(function () {
40
- var ids = R.map(_VirtualizedTree.getHierarchicalId, items);
40
+ var ids = R.map(_utils.getHierarchicalId, items);
41
41
  if (!R.isEmpty(R.symmetricDifference(ids, itemsIds))) setItemsIds(ids);
42
42
  }, [items]);
43
43
 
@@ -13,7 +13,7 @@ var _react = require('react');
13
13
 
14
14
  var _react2 = _interopRequireDefault(_react);
15
15
 
16
- var _VirtualizedTree = require('./VirtualizedTree');
16
+ var _utils = require('./utils');
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
 
@@ -35,8 +35,8 @@ var spotlightFilter = exports.spotlightFilter = function spotlightFilter(term) {
35
35
  if (isValidItem) {
36
36
  return true;
37
37
  }
38
- if (R.has((0, _VirtualizedTree.getHierarchicalId)(item), groupedItemsByParentId)) {
39
- var filtered = recurse(R.prop((0, _VirtualizedTree.getHierarchicalId)(item), groupedItemsByParentId));
38
+ if (R.has((0, _utils.getHierarchicalId)(item), groupedItemsByParentId)) {
39
+ var filtered = recurse(R.prop((0, _utils.getHierarchicalId)(item), groupedItemsByParentId));
40
40
  if (!R.isEmpty(filtered)) {
41
41
  return true;
42
42
  }
@@ -70,6 +70,7 @@ var withSpotlight = function withSpotlight(Component) {
70
70
  }, [term, items]);
71
71
 
72
72
  return _react2.default.createElement(Component, _extends({}, rest, {
73
+ allItems: items,
73
74
  items: filteredItems,
74
75
  labelRenderer: labelRenderer,
75
76
  hasSpotlight: R.length(items) >= 8,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-visions",
3
- "version": "10.5.2",
3
+ "version": "10.6.0",
4
4
  "description": "Library of visual components",
5
5
  "author": "OECD",
6
6
  "homepage": "https://visions-qa.siscc.org/#o",