@sis-cc/dotstatsuite-visions 10.8.0 → 10.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Chips/CustomChip.js +5 -3
- package/es/Chips/GroupedChips.js +3 -1
- package/es/HierarchicalFilter/HierarchicalFilter.js +7 -3
- package/es/TableHtml5/TableHtml5.js +11 -6
- package/es/TableHtml5/header.js +3 -3
- package/es/TableHtml5/section.js +9 -7
- package/es/VirtualizedTree/Item.js +13 -17
- package/es/VirtualizedTree/VirtualizedTree.js +41 -32
- package/lib/Chips/CustomChip.js +5 -3
- package/lib/Chips/GroupedChips.js +3 -1
- package/lib/HierarchicalFilter/HierarchicalFilter.js +7 -3
- package/lib/TableHtml5/TableHtml5.js +11 -6
- package/lib/TableHtml5/header.js +3 -3
- package/lib/TableHtml5/section.js +9 -7
- package/lib/VirtualizedTree/Item.js +13 -17
- package/lib/VirtualizedTree/VirtualizedTree.js +41 -32
- package/package.json +1 -1
- package/umd/@sis-cc/dotstatsuite-visions.js +127 -107
- package/umd/@sis-cc/dotstatsuite-visions.min.js +3 -3
- package/umd/@sis-cc/dotstatsuite-visions.min.js.map +1 -1
|
@@ -75,19 +75,17 @@ var Item = function Item(_ref) {
|
|
|
75
75
|
style = _ref.style,
|
|
76
76
|
isRtl = _ref.isRtl,
|
|
77
77
|
accessibility = _ref.accessibility,
|
|
78
|
-
index = _ref.index,
|
|
79
78
|
HTMLRenderer = _ref.HTMLRenderer,
|
|
80
79
|
hierarchicalId = _ref.hierarchicalId,
|
|
81
80
|
labels = _ref.labels,
|
|
82
81
|
_ref$depth = _ref.depth,
|
|
83
82
|
depth = _ref$depth === undefined ? 0 : _ref$depth,
|
|
84
|
-
|
|
83
|
+
eventsListeners = _ref.eventsListeners;
|
|
85
84
|
|
|
86
85
|
var _React$useState = _react2.default.useState(false),
|
|
87
86
|
isTooltipShown = _React$useState[0],
|
|
88
87
|
setIsTooltipShown = _React$useState[1];
|
|
89
88
|
|
|
90
|
-
var callbacks = eventsCallbacks(hierarchicalId || id, index);
|
|
91
89
|
var padding = depth * 30 + (depth > 0 && !hasChildrenOnLevel ? 30 : 0) + (!hasChild && hasChildrenOnLevel ? 30 : 0);
|
|
92
90
|
return _react2.default.createElement(
|
|
93
91
|
_ListItem2.default,
|
|
@@ -117,23 +115,21 @@ var Item = function Item(_ref) {
|
|
|
117
115
|
},
|
|
118
116
|
_react2.default.createElement(NavigateIcon, null)
|
|
119
117
|
),
|
|
120
|
-
_react2.default.createElement(_ListItemText2.default,
|
|
118
|
+
_react2.default.createElement(_ListItemText2.default, {
|
|
121
119
|
'data-testid': 'value_' + id,
|
|
122
120
|
tabIndex: 0,
|
|
123
|
-
'aria-label':
|
|
121
|
+
'aria-label': isGreyed ? R.propOr('', 'disableItemLabel')(labels) + ' ' + label : label,
|
|
124
122
|
'aria-pressed': isSelected,
|
|
125
123
|
'aria-disabled': isDisabled,
|
|
126
124
|
primaryTypographyProps: { noWrap: true, color: 'inherit' },
|
|
127
125
|
secondaryTypographyProps: { color: 'inherit' },
|
|
128
126
|
classes: { root: classes.listItem },
|
|
129
|
-
className: (0, _classnames2.default)((_cx = {}, _cx[classes.accessibilityItemHover] = accessibility, _cx[classes.listItemSelected] = isSelected
|
|
130
|
-
onClick: isDisabled ? null :
|
|
131
|
-
onMouseDown: isDisabled || isTooltipShown ? null :
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
title: isDisabled ? R.propOr('', 'disableItemLabel')(labels) + ' ' + label : label,
|
|
136
|
-
style: { opacity: isDisabled ? '0.5' : '1' },
|
|
127
|
+
className: (0, _classnames2.default)((_cx = {}, _cx[classes.accessibilityItemHover] = accessibility, _cx[classes.listItemSelected] = isSelected, _cx[classes.listItemHover] = !isDisabled, _cx)),
|
|
128
|
+
onClick: isDisabled ? null : eventsListeners.onClick,
|
|
129
|
+
onMouseDown: isDisabled || isTooltipShown ? null : eventsListeners.onMouseDown,
|
|
130
|
+
onMouseEnter: isDisabled || isTooltipShown ? null : eventsListeners.onMouseEnter,
|
|
131
|
+
title: isGreyed ? R.propOr('', 'disableItemLabel')(labels) + ' ' + label : label,
|
|
132
|
+
style: { opacity: isDisabled && isGreyed ? '0.5' : '1' },
|
|
137
133
|
primary: _react2.default.createElement(
|
|
138
134
|
'div',
|
|
139
135
|
{
|
|
@@ -144,7 +140,8 @@ var Item = function Item(_ref) {
|
|
|
144
140
|
_SvgIcon2.default,
|
|
145
141
|
{
|
|
146
142
|
color: 'primary',
|
|
147
|
-
className: (0, _classnames2.default)(classes.labelIcon, (_cx3 = {}, _cx3[classes.disabledLabel] = isDisabled, _cx3))
|
|
143
|
+
className: (0, _classnames2.default)(classes.labelIcon, (_cx3 = {}, _cx3[classes.disabledLabel] = isDisabled, _cx3)),
|
|
144
|
+
style: { opacity: isDisabled ? '0.5' : '1' }
|
|
148
145
|
},
|
|
149
146
|
isSelected ? _react2.default.createElement(_CheckBoxOutlined2.default, null) : _react2.default.createElement(_CheckBoxOutlineBlankOutlined2.default, null)
|
|
150
147
|
),
|
|
@@ -194,7 +191,7 @@ var Item = function Item(_ref) {
|
|
|
194
191
|
')'
|
|
195
192
|
)
|
|
196
193
|
)
|
|
197
|
-
})
|
|
194
|
+
})
|
|
198
195
|
);
|
|
199
196
|
};
|
|
200
197
|
|
|
@@ -218,13 +215,12 @@ Item.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
218
215
|
style: _propTypes2.default.object,
|
|
219
216
|
isRtl: _propTypes2.default.bool,
|
|
220
217
|
accessibility: _propTypes2.default.bool,
|
|
221
|
-
index: _propTypes2.default.number,
|
|
222
218
|
labelRenderer: _propTypes2.default.func,
|
|
223
219
|
HTMLRenderer: _propTypes2.default.func,
|
|
224
220
|
hierarchicalId: _propTypes2.default.string,
|
|
225
221
|
labels: _propTypes2.default.object,
|
|
226
222
|
depth: _propTypes2.default.number,
|
|
227
|
-
|
|
223
|
+
eventsListeners: _propTypes2.default.object,
|
|
228
224
|
isGreyed: _propTypes2.default.bool
|
|
229
225
|
} : {};
|
|
230
226
|
|
|
@@ -100,7 +100,9 @@ var VirtualizedTree = function VirtualizedTree(props) {
|
|
|
100
100
|
_props$scopeGetter = props.scopeGetter,
|
|
101
101
|
scopeGetter = _props$scopeGetter === undefined ? singleScopeGetter : _props$scopeGetter,
|
|
102
102
|
_props$treeHeight = props.treeHeight,
|
|
103
|
-
treeHeight = _props$treeHeight === undefined ? 0 : _props$treeHeight
|
|
103
|
+
treeHeight = _props$treeHeight === undefined ? 0 : _props$treeHeight,
|
|
104
|
+
_props$simpleSelectio = props.simpleSelectionMode,
|
|
105
|
+
simpleSelectionMode = _props$simpleSelectio === undefined ? false : _props$simpleSelectio;
|
|
104
106
|
|
|
105
107
|
var theme = (0, _core.useTheme)();
|
|
106
108
|
|
|
@@ -216,56 +218,63 @@ var VirtualizedTree = function VirtualizedTree(props) {
|
|
|
216
218
|
setIsMouseDown(false);
|
|
217
219
|
}
|
|
218
220
|
};
|
|
219
|
-
|
|
221
|
+
|
|
222
|
+
var onMouseUp = function onMouseUp(e) {
|
|
223
|
+
if (!isMouseDown) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
e.preventDefault();
|
|
227
|
+
apply();
|
|
228
|
+
setIsMouseDown(false);
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
var onMouseLeave = function onMouseLeave() {
|
|
232
|
+
if (isMouseDown) {
|
|
233
|
+
apply();
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
var onKeyUp = function onKeyUp(e) {
|
|
238
|
+
e.preventDefault();
|
|
239
|
+
if (e.key === 'Shift' && !R.isEmpty(shiftIndexes)) {
|
|
240
|
+
apply();
|
|
241
|
+
} else if (e.key === 'Control' && !R.isEmpty(selectIds)) {
|
|
242
|
+
apply();
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
var itemEventsListeners = function itemEventsListeners(id, index) {
|
|
220
247
|
return {
|
|
221
|
-
onMouseUp: isMouseDown ? function (e) {
|
|
222
|
-
e.preventDefault();
|
|
223
|
-
apply();
|
|
224
|
-
if (!R.isEmpty(selectIds)) {
|
|
225
|
-
setLastItemId(id);
|
|
226
|
-
}
|
|
227
|
-
setIsMouseDown(false);
|
|
228
|
-
} : null,
|
|
229
248
|
onMouseDown: function onMouseDown(e) {
|
|
230
|
-
e.
|
|
231
|
-
if (e.ctrlKey || e.shiftKey) {
|
|
249
|
+
if (!simpleSelectionMode && (e.ctrlKey || e.shiftKey)) {
|
|
232
250
|
return;
|
|
233
251
|
}
|
|
234
252
|
setIsMouseDown(true);
|
|
235
253
|
multiSelect(id);
|
|
236
254
|
},
|
|
237
|
-
onMouseEnter:
|
|
255
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
238
256
|
e.preventDefault();
|
|
239
|
-
if (e.ctrlKey || e.shiftKey) {
|
|
257
|
+
if (!isMouseDown || simpleSelectionMode || e.ctrlKey || e.shiftKey) {
|
|
240
258
|
return;
|
|
241
259
|
}
|
|
242
260
|
multiSelect(id);
|
|
243
|
-
|
|
261
|
+
setLastItemId(id);
|
|
262
|
+
},
|
|
244
263
|
onClick: function onClick(e) {
|
|
245
264
|
e.preventDefault();
|
|
246
|
-
|
|
247
|
-
if (e.ctrlKey) {
|
|
265
|
+
if (e.ctrlKey && !simpleSelectionMode) {
|
|
248
266
|
multiSelect(id);
|
|
249
|
-
} else if (e.shiftKey) {
|
|
267
|
+
} else if (e.shiftKey && !simpleSelectionMode) {
|
|
250
268
|
shiftSelect(index);
|
|
251
269
|
} else {
|
|
252
270
|
setIsMouseDown(false);
|
|
253
271
|
setLastItemId(id);
|
|
254
272
|
}
|
|
255
273
|
}
|
|
256
|
-
// ondblclick: () => null
|
|
257
274
|
};
|
|
258
275
|
};
|
|
259
|
-
var onKeyUp = function onKeyUp(e) {
|
|
260
|
-
if (e.key === 'Shift' && !R.isEmpty(shiftIndexes)) {
|
|
261
|
-
apply();
|
|
262
|
-
} else if (e.key === 'Control' && !R.isEmpty(selectIds)) {
|
|
263
|
-
apply();
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
276
|
var ref = (0, _react.useRef)();
|
|
267
277
|
var classes = (0, _styles.useStyles)();
|
|
268
|
-
|
|
269
278
|
(0, _react.useEffect)(function () {
|
|
270
279
|
var current = ref.current;
|
|
271
280
|
var handler = function handler(event) {
|
|
@@ -288,7 +297,6 @@ var VirtualizedTree = function VirtualizedTree(props) {
|
|
|
288
297
|
setScrollTop(undefined);
|
|
289
298
|
}
|
|
290
299
|
if (R.isNil(current)) return;
|
|
291
|
-
|
|
292
300
|
current.addEventListener('wheel', handler, { passive: false });
|
|
293
301
|
return function () {
|
|
294
302
|
current.removeEventListener('wheel', handler, { passive: false });
|
|
@@ -306,7 +314,8 @@ var VirtualizedTree = function VirtualizedTree(props) {
|
|
|
306
314
|
disablePadding: true,
|
|
307
315
|
style: { height: maxHeight + 2 },
|
|
308
316
|
onKeyUp: onKeyUp,
|
|
309
|
-
|
|
317
|
+
onMouseUp: onMouseUp,
|
|
318
|
+
onMouseLeave: onMouseLeave,
|
|
310
319
|
ref: ref
|
|
311
320
|
},
|
|
312
321
|
_react2.default.createElement(
|
|
@@ -343,11 +352,10 @@ var VirtualizedTree = function VirtualizedTree(props) {
|
|
|
343
352
|
},
|
|
344
353
|
NavigateIcon: R.has(itemId, expandedIds) ? _ExpandLess2.default : _ExpandMore2.default,
|
|
345
354
|
isRtl: isRtl,
|
|
346
|
-
|
|
355
|
+
eventsListeners: itemEventsListeners((0, _utils.getHierarchicalId)(item), index),
|
|
347
356
|
HTMLRenderer: HTMLRenderer,
|
|
348
357
|
classes: classes,
|
|
349
358
|
labels: labels,
|
|
350
|
-
index: index,
|
|
351
359
|
style: style,
|
|
352
360
|
accessibility: accessibility,
|
|
353
361
|
ariaLabel: R.prop('navigateNext')(labels),
|
|
@@ -379,7 +387,8 @@ VirtualizedTree.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
379
387
|
collapse: _propTypes2.default.func,
|
|
380
388
|
treeHeight: _propTypes2.default.number,
|
|
381
389
|
isGreyed: _propTypes2.default.func,
|
|
382
|
-
scopeGetter: _propTypes2.default.func
|
|
390
|
+
scopeGetter: _propTypes2.default.func,
|
|
391
|
+
simpleSelectionMode: _propTypes2.default.bool
|
|
383
392
|
} : {};
|
|
384
393
|
|
|
385
394
|
exports.default = VirtualizedTree;
|