@sis-cc/dotstatsuite-visions 7.18.6 → 7.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/AdvancedFilterDialog/AdvancedFilterDialog.js +459 -0
- package/es/AdvancedFilterDialog/index.js +26 -0
- package/es/ExpansionPanel/styles.js +2 -2
- package/es/HierarchicalFilter/HierarchicalFilter.js +142 -0
- package/es/HierarchicalFilter/index.js +26 -0
- package/es/ScopeList/Item.js +6 -2
- package/es/VirtualizedTree/Item.js +187 -0
- package/es/VirtualizedTree/VirtualizedTree.js +341 -0
- package/es/VirtualizedTree/index.js +38 -0
- package/es/index.js +3 -0
- package/lib/AdvancedFilterDialog/AdvancedFilterDialog.js +524 -0
- package/lib/AdvancedFilterDialog/index.js +16 -0
- package/lib/ExpansionPanel/styles.js +2 -2
- package/lib/HierarchicalFilter/HierarchicalFilter.js +169 -0
- package/lib/HierarchicalFilter/index.js +16 -0
- package/lib/ScopeList/Item.js +6 -2
- package/lib/VirtualizedTree/Item.js +223 -0
- package/lib/VirtualizedTree/VirtualizedTree.js +382 -0
- package/lib/VirtualizedTree/index.js +16 -0
- package/lib/index.js +28 -1
- package/package.json +2 -1
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
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; };
|
|
6
|
+
|
|
7
|
+
var _react = require('react');
|
|
8
|
+
|
|
9
|
+
var _react2 = _interopRequireDefault(_react);
|
|
10
|
+
|
|
11
|
+
var _propTypes = require('prop-types');
|
|
12
|
+
|
|
13
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
14
|
+
|
|
15
|
+
var _ramda = require('ramda');
|
|
16
|
+
|
|
17
|
+
var R = _interopRequireWildcard(_ramda);
|
|
18
|
+
|
|
19
|
+
var _Container = require('@material-ui/core/Container');
|
|
20
|
+
|
|
21
|
+
var _Container2 = _interopRequireDefault(_Container);
|
|
22
|
+
|
|
23
|
+
var _PlaylistAddCheck = require('@material-ui/icons/PlaylistAddCheck');
|
|
24
|
+
|
|
25
|
+
var _PlaylistAddCheck2 = _interopRequireDefault(_PlaylistAddCheck);
|
|
26
|
+
|
|
27
|
+
var _ = require('../');
|
|
28
|
+
|
|
29
|
+
var _styles = require('../ScopeList/styles');
|
|
30
|
+
|
|
31
|
+
var _core = require('@material-ui/core');
|
|
32
|
+
|
|
33
|
+
var _utils = require('../utils');
|
|
34
|
+
|
|
35
|
+
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; } }
|
|
36
|
+
|
|
37
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
38
|
+
|
|
39
|
+
var getCounter = function getCounter(items, displayAccessor, tagAccessor) {
|
|
40
|
+
var count = R.pipe(R.filter(R.prop('isSelected')), R.length)(items);
|
|
41
|
+
var total = R.pipe(R.when(R.always(R.is(Function, displayAccessor)), R.filter(displayAccessor)), R.length)(items);
|
|
42
|
+
if (R.is(Function, tagAccessor)) {
|
|
43
|
+
return tagAccessor(count, total);
|
|
44
|
+
}
|
|
45
|
+
return count + '/' + total;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var HierarchicalFilter = function HierarchicalFilter(props) {
|
|
49
|
+
var id = props.id,
|
|
50
|
+
items = props.items,
|
|
51
|
+
changeSelection = props.changeSelection,
|
|
52
|
+
onChangeActivePanel = props.onChangeActivePanel,
|
|
53
|
+
activePanelId = props.activePanelId,
|
|
54
|
+
Tag = props.Tag,
|
|
55
|
+
testId = props.testId,
|
|
56
|
+
accessibility = props.accessibility,
|
|
57
|
+
_props$expansionPanel = props.expansionPanelProps,
|
|
58
|
+
expansionPanelProps = _props$expansionPanel === undefined ? {} : _props$expansionPanel,
|
|
59
|
+
_props$labelRenderer = props.labelRenderer,
|
|
60
|
+
labelRenderer = _props$labelRenderer === undefined ? R.prop('label') : _props$labelRenderer,
|
|
61
|
+
toggleBulk = props.toggleBulk,
|
|
62
|
+
label = props.label,
|
|
63
|
+
labels = props.labels,
|
|
64
|
+
tagAccessor = props.tagAccessor,
|
|
65
|
+
displayAccessor = props.displayAccessor;
|
|
66
|
+
|
|
67
|
+
var _useState = (0, _react.useState)({ term: '' }),
|
|
68
|
+
term = _useState[0].term,
|
|
69
|
+
setSpotlight = _useState[1];
|
|
70
|
+
|
|
71
|
+
var classes = (0, _styles.useStyles)({ accessibility: accessibility });
|
|
72
|
+
var theme = (0, _core.useTheme)();
|
|
73
|
+
var isRtl = (0, _utils.getIsRtl)(theme);
|
|
74
|
+
var Chip = R.isNil(Tag) ? _.Tag : Tag;
|
|
75
|
+
var tagValue = getCounter(items, displayAccessor, tagAccessor);
|
|
76
|
+
var groupedItemsByParentId = R.groupBy(R.propOr('#ROOT', 'parentId'), items);
|
|
77
|
+
var hasSpotligt = R.length(items) >= 8;
|
|
78
|
+
var recurse = R.filter(function (item) {
|
|
79
|
+
var isValidItem = R.isEmpty(term) || R.isNil(term) ? true : R.includes(R.toLower(term), R.toLower(labelRenderer(item)));
|
|
80
|
+
if (isValidItem) {
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
if (R.has(item.id, groupedItemsByParentId)) {
|
|
84
|
+
var filtered = recurse(R.prop(item.id, groupedItemsByParentId));
|
|
85
|
+
if (!R.isEmpty(filtered)) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return false;
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
var filteredItems = R.isEmpty(term) || R.isNil(term) ? items : recurse(items);
|
|
93
|
+
|
|
94
|
+
var onSelect = function onSelect(values) {
|
|
95
|
+
changeSelection(id, values);
|
|
96
|
+
};
|
|
97
|
+
return _react2.default.createElement(
|
|
98
|
+
_.ExpansionPanel,
|
|
99
|
+
_extends({
|
|
100
|
+
isOpen: R.equals(id, activePanelId),
|
|
101
|
+
id: id,
|
|
102
|
+
testId: '' + testId,
|
|
103
|
+
label: labelRenderer({ id: id, label: label }),
|
|
104
|
+
onChangeActivePanel: onChangeActivePanel,
|
|
105
|
+
overflow: true,
|
|
106
|
+
topElementComponent: _react2.default.createElement(
|
|
107
|
+
_react.Fragment,
|
|
108
|
+
null,
|
|
109
|
+
_react2.default.createElement(
|
|
110
|
+
_Container2.default,
|
|
111
|
+
{ disableGutters: true, className: classes.spotlightContainer },
|
|
112
|
+
hasSpotligt && _react2.default.createElement(_.Spotlight, {
|
|
113
|
+
className: { container: classes.middle },
|
|
114
|
+
fullWidth: true,
|
|
115
|
+
hasClearAll: true,
|
|
116
|
+
placeholder: R.prop('placeholder', labels),
|
|
117
|
+
term: term,
|
|
118
|
+
hasCommit: false,
|
|
119
|
+
spotlight: { fields: {} },
|
|
120
|
+
action: setSpotlight
|
|
121
|
+
}),
|
|
122
|
+
R.is(Function, toggleBulk) && _react2.default.createElement(
|
|
123
|
+
_.VerticalButton,
|
|
124
|
+
{
|
|
125
|
+
'aria-label': R.prop('advancedSelection')(labels),
|
|
126
|
+
classes: { root: classes.bulkSelectionIcon },
|
|
127
|
+
onClick: toggleBulk
|
|
128
|
+
},
|
|
129
|
+
_react2.default.createElement(_PlaylistAddCheck2.default, { color: 'primary' })
|
|
130
|
+
)
|
|
131
|
+
)
|
|
132
|
+
),
|
|
133
|
+
tag: _react2.default.createElement(
|
|
134
|
+
Chip,
|
|
135
|
+
{ items: items },
|
|
136
|
+
tagValue
|
|
137
|
+
),
|
|
138
|
+
isBlank: R.isEmpty(items)
|
|
139
|
+
}, expansionPanelProps),
|
|
140
|
+
_react2.default.createElement(_.VirtualizedTree, _extends({}, props, { items: filteredItems, changeSelection: onSelect, isRtl: isRtl }))
|
|
141
|
+
);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
HierarchicalFilter.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
145
|
+
id: _propTypes2.default.string,
|
|
146
|
+
accessibility: _propTypes2.default.bool,
|
|
147
|
+
activePanelId: _propTypes2.default.string,
|
|
148
|
+
changeSelection: _propTypes2.default.func,
|
|
149
|
+
onChangeActivePanel: _propTypes2.default.func,
|
|
150
|
+
disableAccessor: _propTypes2.default.func,
|
|
151
|
+
displayAccessor: _propTypes2.default.func,
|
|
152
|
+
HTMLRenderer: _propTypes2.default.func,
|
|
153
|
+
isRtl: _propTypes2.default.bool,
|
|
154
|
+
items: _propTypes2.default.array,
|
|
155
|
+
label: _propTypes2.default.string,
|
|
156
|
+
labels: _propTypes2.default.shape({
|
|
157
|
+
disableItemLabel: _propTypes2.default.string,
|
|
158
|
+
placeholder: _propTypes2.default.string
|
|
159
|
+
}),
|
|
160
|
+
labelRenderer: _propTypes2.default.func,
|
|
161
|
+
Tag: _propTypes2.default.func,
|
|
162
|
+
testId: _propTypes2.default.string,
|
|
163
|
+
expansionPanelProps: _propTypes2.default.object,
|
|
164
|
+
toggleBulk: _propTypes2.default.func,
|
|
165
|
+
tagAccessor: _propTypes2.default.func
|
|
166
|
+
} : {};
|
|
167
|
+
|
|
168
|
+
exports.default = HierarchicalFilter;
|
|
169
|
+
module.exports = exports['default'];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _HierarchicalFilter = require('./HierarchicalFilter');
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, 'default', {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _interopRequireDefault(_HierarchicalFilter).default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
module.exports = exports['default'];
|
package/lib/ScopeList/Item.js
CHANGED
|
@@ -94,7 +94,9 @@ var Item = function Item(_ref) {
|
|
|
94
94
|
labelRenderer = _ref.labelRenderer,
|
|
95
95
|
HTMLRenderer = _ref.HTMLRenderer,
|
|
96
96
|
hierarchicalId = _ref.hierarchicalId,
|
|
97
|
-
labels = _ref.labels
|
|
97
|
+
labels = _ref.labels,
|
|
98
|
+
_ref$depth = _ref.depth,
|
|
99
|
+
depth = _ref$depth === undefined ? 0 : _ref$depth;
|
|
98
100
|
|
|
99
101
|
var _React$useState = _react2.default.useState(false),
|
|
100
102
|
isTooltipShown = _React$useState[0],
|
|
@@ -128,6 +130,7 @@ var Item = function Item(_ref) {
|
|
|
128
130
|
secondaryTypographyProps: { color: 'inherit' },
|
|
129
131
|
classes: { root: classes.listItem },
|
|
130
132
|
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)),
|
|
133
|
+
style: { marginLeft: depth * 20 + 'px' },
|
|
131
134
|
title: isDisabled ? R.propOr('', 'disableItemLabel')(labels) + ' ' + label : label,
|
|
132
135
|
primary: _react2.default.createElement(
|
|
133
136
|
'div',
|
|
@@ -272,7 +275,8 @@ Item.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
272
275
|
labelRenderer: _propTypes2.default.func,
|
|
273
276
|
HTMLRenderer: _propTypes2.default.func,
|
|
274
277
|
hierarchicalId: _propTypes2.default.string,
|
|
275
|
-
labels: _propTypes2.default.object
|
|
278
|
+
labels: _propTypes2.default.object,
|
|
279
|
+
depth: _propTypes2.default.number
|
|
276
280
|
} : {};
|
|
277
281
|
|
|
278
282
|
exports.default = Item;
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
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; };
|
|
6
|
+
|
|
7
|
+
var _react = require('react');
|
|
8
|
+
|
|
9
|
+
var _react2 = _interopRequireDefault(_react);
|
|
10
|
+
|
|
11
|
+
var _ramda = require('ramda');
|
|
12
|
+
|
|
13
|
+
var R = _interopRequireWildcard(_ramda);
|
|
14
|
+
|
|
15
|
+
var _propTypes = require('prop-types');
|
|
16
|
+
|
|
17
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
18
|
+
|
|
19
|
+
var _ListItem = require('@material-ui/core/ListItem');
|
|
20
|
+
|
|
21
|
+
var _ListItem2 = _interopRequireDefault(_ListItem);
|
|
22
|
+
|
|
23
|
+
var _Typography = require('@material-ui/core/Typography');
|
|
24
|
+
|
|
25
|
+
var _Typography2 = _interopRequireDefault(_Typography);
|
|
26
|
+
|
|
27
|
+
var _ListItemText = require('@material-ui/core/ListItemText');
|
|
28
|
+
|
|
29
|
+
var _ListItemText2 = _interopRequireDefault(_ListItemText);
|
|
30
|
+
|
|
31
|
+
var _IconButton = require('@material-ui/core/IconButton');
|
|
32
|
+
|
|
33
|
+
var _IconButton2 = _interopRequireDefault(_IconButton);
|
|
34
|
+
|
|
35
|
+
var _SvgIcon = require('@material-ui/core/SvgIcon');
|
|
36
|
+
|
|
37
|
+
var _SvgIcon2 = _interopRequireDefault(_SvgIcon);
|
|
38
|
+
|
|
39
|
+
var _classnames = require('classnames');
|
|
40
|
+
|
|
41
|
+
var _classnames2 = _interopRequireDefault(_classnames);
|
|
42
|
+
|
|
43
|
+
var _ = require('../');
|
|
44
|
+
|
|
45
|
+
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; } }
|
|
46
|
+
|
|
47
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
48
|
+
|
|
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
|
+
var Item = function Item(_ref) {
|
|
53
|
+
var _cx, _extends2, _cx2, _cx3, _cx4, _cx5, _cx6;
|
|
54
|
+
|
|
55
|
+
var classes = _ref.classes,
|
|
56
|
+
id = _ref.id,
|
|
57
|
+
label = _ref.label,
|
|
58
|
+
_ref$description = _ref.description,
|
|
59
|
+
description = _ref$description === undefined ? '' : _ref$description,
|
|
60
|
+
isSelected = _ref.isSelected,
|
|
61
|
+
isDisabled = _ref.isDisabled,
|
|
62
|
+
changeList = _ref.changeList,
|
|
63
|
+
ariaLabel = _ref.ariaLabel,
|
|
64
|
+
NavigateIcon = _ref.NavigateIcon,
|
|
65
|
+
hasChild = _ref.hasChild,
|
|
66
|
+
hasChildrenOnLevel = _ref.hasChildrenOnLevel,
|
|
67
|
+
count = _ref.count,
|
|
68
|
+
svgPath = _ref.svgPath,
|
|
69
|
+
testId = _ref.testId,
|
|
70
|
+
style = _ref.style,
|
|
71
|
+
isRtl = _ref.isRtl,
|
|
72
|
+
accessibility = _ref.accessibility,
|
|
73
|
+
index = _ref.index,
|
|
74
|
+
HTMLRenderer = _ref.HTMLRenderer,
|
|
75
|
+
hierarchicalId = _ref.hierarchicalId,
|
|
76
|
+
labels = _ref.labels,
|
|
77
|
+
_ref$depth = _ref.depth,
|
|
78
|
+
depth = _ref$depth === undefined ? 0 : _ref$depth,
|
|
79
|
+
eventsCallbacks = _ref.eventsCallbacks;
|
|
80
|
+
|
|
81
|
+
var _React$useState = _react2.default.useState(false),
|
|
82
|
+
isTooltipShown = _React$useState[0],
|
|
83
|
+
setIsTooltipShown = _React$useState[1];
|
|
84
|
+
|
|
85
|
+
var callbacks = eventsCallbacks(hierarchicalId || id, index);
|
|
86
|
+
var padding = depth * 30 + (depth > 0 && !hasChildrenOnLevel ? 30 : 0) + (!hasChild && hasChildrenOnLevel ? 30 : 0);
|
|
87
|
+
return _react2.default.createElement(
|
|
88
|
+
_ListItem2.default,
|
|
89
|
+
{
|
|
90
|
+
disableGutters: true,
|
|
91
|
+
classes: { disabled: classes.disabled },
|
|
92
|
+
className: (0, _classnames2.default)(classes.listItemContainer, (_cx = {}, _cx[classes.disableSecondaryAction] = R.not(hasChild), _cx)),
|
|
93
|
+
disabled: isDisabled,
|
|
94
|
+
tabIndex: -1,
|
|
95
|
+
style: _extends({}, style, (_extends2 = {
|
|
96
|
+
flexDirection: isRtl ? 'row-reverse' : 'row'
|
|
97
|
+
}, _extends2['' + (isRtl ? 'paddingRight' : 'paddingLeft')] = padding + 'px', _extends2))
|
|
98
|
+
},
|
|
99
|
+
R.and(NavigateIcon, hasChild) && _react2.default.createElement(
|
|
100
|
+
_IconButton2.default,
|
|
101
|
+
{
|
|
102
|
+
disableRipple: true,
|
|
103
|
+
disableFocusRipple: true,
|
|
104
|
+
className: classes.arrow,
|
|
105
|
+
'aria-label': ariaLabel,
|
|
106
|
+
tabIndex: -1,
|
|
107
|
+
size: 'small',
|
|
108
|
+
color: 'inherit',
|
|
109
|
+
onClick: function onClick() {
|
|
110
|
+
return changeList(hierarchicalId || id);
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
_react2.default.createElement(NavigateIcon, null)
|
|
114
|
+
),
|
|
115
|
+
_react2.default.createElement(_ListItemText2.default, _extends({
|
|
116
|
+
tabIndex: 0,
|
|
117
|
+
'aria-label': isDisabled ? R.propOr('', 'disableItemLabel')(labels) + ' ' + label : label,
|
|
118
|
+
'aria-pressed': isSelected,
|
|
119
|
+
'aria-disabled': isDisabled,
|
|
120
|
+
primaryTypographyProps: { noWrap: true, color: 'inherit' },
|
|
121
|
+
secondaryTypographyProps: { color: 'inherit' },
|
|
122
|
+
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)),
|
|
124
|
+
onMouseDown: isDisabled || isTooltipShown ? null : callbacks.onMouseDown,
|
|
125
|
+
onMouseUp: isDisabled || isTooltipShown ? null : callbacks.onMouseUp,
|
|
126
|
+
onMouseEnter: isDisabled || isTooltipShown ? null : callbacks.onMouseEnter
|
|
127
|
+
}, R.pick(['onKeyPress'], callbacks), {
|
|
128
|
+
title: isDisabled ? R.propOr('', 'disableItemLabel')(labels) + ' ' + label : label,
|
|
129
|
+
primary: _react2.default.createElement(
|
|
130
|
+
'div',
|
|
131
|
+
{
|
|
132
|
+
className: (0, _classnames2.default)(classes.labelContainer, (_cx3 = {}, _cx3[classes.rtlLabelContainer] = isRtl, _cx3))
|
|
133
|
+
},
|
|
134
|
+
_react2.default.createElement(
|
|
135
|
+
_SvgIcon2.default,
|
|
136
|
+
{
|
|
137
|
+
color: 'primary',
|
|
138
|
+
className: (0, _classnames2.default)(classes.labelIcon, (_cx4 = {}, _cx4[classes.disabledLabel] = isDisabled, _cx4))
|
|
139
|
+
},
|
|
140
|
+
_react2.default.createElement('path', { d: R.and(isSelected, R.not(isDisabled)) ? checkPath : checkBoxPath })
|
|
141
|
+
),
|
|
142
|
+
svgPath && _react2.default.createElement(
|
|
143
|
+
_SvgIcon2.default,
|
|
144
|
+
{
|
|
145
|
+
color: 'primary',
|
|
146
|
+
className: (0, _classnames2.default)(classes.labelIcon, (_cx5 = {}, _cx5[classes.disabledLabel] = isDisabled, _cx5))
|
|
147
|
+
},
|
|
148
|
+
_react2.default.createElement('path', { d: svgPath })
|
|
149
|
+
),
|
|
150
|
+
_react2.default.createElement(
|
|
151
|
+
_.Tooltip,
|
|
152
|
+
{
|
|
153
|
+
title: R.or(R.isNil(HTMLRenderer), R.isEmpty(description)) ? description : _react2.default.createElement(HTMLRenderer, { html: description, onClick: function onClick(e) {
|
|
154
|
+
return e.stopPropagation();
|
|
155
|
+
} }),
|
|
156
|
+
enterDelay: 400,
|
|
157
|
+
tabIndex: 0,
|
|
158
|
+
'aria-label': description,
|
|
159
|
+
'aria-hidden': false,
|
|
160
|
+
placement: 'top',
|
|
161
|
+
interactive: Boolean(HTMLRenderer),
|
|
162
|
+
onOpen: function onOpen() {
|
|
163
|
+
return setIsTooltipShown(true);
|
|
164
|
+
},
|
|
165
|
+
onClose: function onClose() {
|
|
166
|
+
return setIsTooltipShown(false);
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
_react2.default.createElement(
|
|
170
|
+
_Typography2.default,
|
|
171
|
+
{
|
|
172
|
+
'data-testid': testId + '_value_' + id,
|
|
173
|
+
color: 'inherit',
|
|
174
|
+
variant: 'body2',
|
|
175
|
+
className: (0, _classnames2.default)(classes.label, (_cx6 = {}, _cx6[classes.disabledLabel] = isDisabled, _cx6[classes.tooltipNotice] = !R.isEmpty(description), _cx6))
|
|
176
|
+
},
|
|
177
|
+
label
|
|
178
|
+
)
|
|
179
|
+
),
|
|
180
|
+
R.not(R.isNil(count)) && _react2.default.createElement(
|
|
181
|
+
_Typography2.default,
|
|
182
|
+
{ variant: 'body2', className: classes.count },
|
|
183
|
+
'(',
|
|
184
|
+
count,
|
|
185
|
+
')'
|
|
186
|
+
)
|
|
187
|
+
)
|
|
188
|
+
}))
|
|
189
|
+
);
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
Item.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
193
|
+
classes: _propTypes2.default.object,
|
|
194
|
+
id: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
|
|
195
|
+
label: _propTypes2.default.string,
|
|
196
|
+
description: _propTypes2.default.string,
|
|
197
|
+
parentId: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
|
|
198
|
+
ariaLabel: _propTypes2.default.string,
|
|
199
|
+
NavigateIcon: _propTypes2.default.object,
|
|
200
|
+
isSelected: _propTypes2.default.bool,
|
|
201
|
+
isDisabled: _propTypes2.default.bool,
|
|
202
|
+
hasChild: _propTypes2.default.bool,
|
|
203
|
+
hasChildrenOnLevel: _propTypes2.default.bool,
|
|
204
|
+
isSection: _propTypes2.default.bool,
|
|
205
|
+
changeList: _propTypes2.default.func,
|
|
206
|
+
changeListDescription: _propTypes2.default.string,
|
|
207
|
+
count: _propTypes2.default.number,
|
|
208
|
+
svgPath: _propTypes2.default.string,
|
|
209
|
+
style: _propTypes2.default.object,
|
|
210
|
+
isRtl: _propTypes2.default.bool,
|
|
211
|
+
testId: _propTypes2.default.string,
|
|
212
|
+
accessibility: _propTypes2.default.bool,
|
|
213
|
+
index: _propTypes2.default.number,
|
|
214
|
+
labelRenderer: _propTypes2.default.func,
|
|
215
|
+
HTMLRenderer: _propTypes2.default.func,
|
|
216
|
+
hierarchicalId: _propTypes2.default.string,
|
|
217
|
+
labels: _propTypes2.default.object,
|
|
218
|
+
depth: _propTypes2.default.number,
|
|
219
|
+
eventsCallbacks: _propTypes2.default.func
|
|
220
|
+
} : {};
|
|
221
|
+
|
|
222
|
+
exports.default = Item;
|
|
223
|
+
module.exports = exports['default'];
|