@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
package/es/Chips/CustomChip.js
CHANGED
|
@@ -31,14 +31,15 @@ var CustomChip = function CustomChip(_ref) {
|
|
|
31
31
|
_ref$testId = _ref.testId,
|
|
32
32
|
testId = _ref$testId === undefined ? 'deleteChip-test-id' : _ref$testId,
|
|
33
33
|
_ref$labelRenderer = _ref.labelRenderer,
|
|
34
|
-
labelRenderer = _ref$labelRenderer === undefined ? R.prop('label') : _ref$labelRenderer
|
|
34
|
+
labelRenderer = _ref$labelRenderer === undefined ? R.prop('label') : _ref$labelRenderer,
|
|
35
|
+
deprecated = _ref.deprecated;
|
|
35
36
|
|
|
36
37
|
var theme = useTheme();
|
|
37
38
|
var isRtl = getIsRtl(theme);
|
|
38
39
|
var classes = useStyles();
|
|
39
40
|
var mapIndexed = R.addIndex(R.map);
|
|
40
41
|
var onChange = R.is(Function)(onDelete) ? function () {
|
|
41
|
-
return onDelete(parentId, R.isNil(id) ? [] : [
|
|
42
|
+
return onDelete(parentId, R.isNil(id) ? [] : R.append(id, deprecated || []));
|
|
42
43
|
} : null;
|
|
43
44
|
var hasTooltip = shownTooltip(items);
|
|
44
45
|
var hasMultiLinedTooltip = showMultiLinedTooltip(items);
|
|
@@ -105,7 +106,8 @@ CustomChip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
105
106
|
labelClasses: PropTypes.string,
|
|
106
107
|
ariaLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
107
108
|
items: PropTypes.array,
|
|
108
|
-
labelRenderer: PropTypes.func
|
|
109
|
+
labelRenderer: PropTypes.func,
|
|
110
|
+
deprecated: PropTypes.array
|
|
109
111
|
} : {};
|
|
110
112
|
|
|
111
113
|
export default CustomChip;
|
package/es/Chips/GroupedChips.js
CHANGED
|
@@ -55,10 +55,12 @@ var GroupedChips = function GroupedChips(_ref) {
|
|
|
55
55
|
}) : R.map(function (items) {
|
|
56
56
|
var lastItem = R.last(items);
|
|
57
57
|
var id = lastItem.id,
|
|
58
|
-
isNotRemovable = lastItem.isNotRemovable
|
|
58
|
+
isNotRemovable = lastItem.isNotRemovable,
|
|
59
|
+
deprecated = lastItem.deprecated;
|
|
59
60
|
|
|
60
61
|
|
|
61
62
|
return React.createElement(CustomChip, {
|
|
63
|
+
deprecated: deprecated,
|
|
62
64
|
key: id,
|
|
63
65
|
id: id,
|
|
64
66
|
items: R.pipe(R.length, R.gte(2)) ? items : null,
|
|
@@ -47,14 +47,17 @@ var HierarchicalFilter = function HierarchicalFilter(props) {
|
|
|
47
47
|
hasSpotlight = props.hasSpotlight,
|
|
48
48
|
_props$disableAccesso = props.disableAccessor,
|
|
49
49
|
disableAccessor = _props$disableAccesso === undefined ? R.always(false) : _props$disableAccesso,
|
|
50
|
-
allItems = props.allItems
|
|
50
|
+
allItems = props.allItems,
|
|
51
|
+
_props$simpleSelectio = props.simpleSelectionMode,
|
|
52
|
+
simpleSelectionMode = _props$simpleSelectio === undefined ? false : _props$simpleSelectio;
|
|
51
53
|
|
|
52
54
|
var classes = useStyles({ accessibility: accessibility });
|
|
53
55
|
var theme = useTheme();
|
|
54
56
|
var isRtl = getIsRtl(theme);
|
|
55
57
|
var Chip = R.isNil(Tag) ? InternalTag : Tag;
|
|
56
58
|
var _allGroupedItems = R.groupBy(R.propOr('#ROOT', 'parentId'), allItems);
|
|
57
|
-
var _disableAccessor = getEvolvedDisableAccessor(_allGroupedItems, disableAccessor, R.always(false));
|
|
59
|
+
var _disableAccessor = simpleSelectionMode ? disableAccessor : getEvolvedDisableAccessor(_allGroupedItems, disableAccessor, R.always(false));
|
|
60
|
+
|
|
58
61
|
var tagValue = getCounter(items, _disableAccessor, tagAccessor);
|
|
59
62
|
var isDisabled = function isDisabled(item) {
|
|
60
63
|
return R.is(Function, disableAccessor) ? disableAccessor(item) : false;
|
|
@@ -153,7 +156,8 @@ HierarchicalFilter.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
153
156
|
spotlight: PropTypes.object,
|
|
154
157
|
setSpotlight: PropTypes.func,
|
|
155
158
|
hasSpotlight: PropTypes.bool,
|
|
156
|
-
allItems: PropTypes.array
|
|
159
|
+
allItems: PropTypes.array,
|
|
160
|
+
simpleSelectionMode: PropTypes.bool
|
|
157
161
|
} : {};
|
|
158
162
|
|
|
159
163
|
export default withSpotlight(withExpansionTree(HierarchicalFilter));
|
|
@@ -38,12 +38,13 @@ var useStyles = makeStyles(function (theme) {
|
|
|
38
38
|
var mapIndexed = R.addIndex(R.map);
|
|
39
39
|
|
|
40
40
|
export var getEnhancedValuesHeaderData = function getEnhancedValuesHeaderData(data) {
|
|
41
|
-
var colLength = R.pipe(R.
|
|
41
|
+
var colLength = R.pipe(R.last, R.propOr([], 'data'), R.length)(data);
|
|
42
42
|
return R.pipe(R.pluck('data'),
|
|
43
43
|
// mix merge and transpose for performance
|
|
44
44
|
R.reduce(function (acc, cells) {
|
|
45
|
-
R.addIndex(R.forEach)(function (
|
|
46
|
-
var
|
|
45
|
+
R.addIndex(R.forEach)(function (_, rowIndex) {
|
|
46
|
+
var cell = R.nth(rowIndex, cells) || {};
|
|
47
|
+
var cellId = R.has('values', cell) ? R.pipe(R.prop('values'), R.pluck('id'), R.join(','))(cell) : R.pathOr('missing' + rowIndex, ['value', 'id'], cell);
|
|
47
48
|
var topCell = rowIndex > 0 ? R.pipe(R.nth(rowIndex - 1), R.last)(acc) : null;
|
|
48
49
|
var cellKey = R.isNil(topCell) ? cellId : topCell.key + '-' + cellId;
|
|
49
50
|
|
|
@@ -51,9 +52,13 @@ export var getEnhancedValuesHeaderData = function getEnhancedValuesHeaderData(da
|
|
|
51
52
|
if (R.prop('key', leftCell) === cellKey && rowIndex !== colLength - 1) {
|
|
52
53
|
acc = R.over(R.lensIndex(rowIndex), R.over(R.lensIndex(-1), R.evolve({ spanCount: R.add(1) })))(acc);
|
|
53
54
|
} else {
|
|
54
|
-
acc = R.over(R.lensIndex(rowIndex), R.append(_extends({}, R.pick(['value', 'values'], cell), {
|
|
55
|
+
acc = R.over(R.lensIndex(rowIndex), R.append(_extends({}, R.pick(['value', 'values'], cell), {
|
|
56
|
+
key: cellKey,
|
|
57
|
+
spanCount: 1,
|
|
58
|
+
isEmpty: R.isEmpty(cell)
|
|
59
|
+
})))(acc);
|
|
55
60
|
}
|
|
56
|
-
})(
|
|
61
|
+
})(acc);
|
|
57
62
|
return acc;
|
|
58
63
|
}, R.times(R.always([]), colLength)))(data);
|
|
59
64
|
};
|
|
@@ -118,7 +123,7 @@ var TableHtml5 = function TableHtml5(_ref) {
|
|
|
118
123
|
};
|
|
119
124
|
}, []);
|
|
120
125
|
|
|
121
|
-
var xLayoutData = R.pathOr([], [0, 1,
|
|
126
|
+
var xLayoutData = R.pathOr([], [0, 1, -1, 'data'], sectionsData);
|
|
122
127
|
var xLayoutDataLength = R.length(xLayoutData);
|
|
123
128
|
|
|
124
129
|
var _useMemo = useMemo(function () {
|
package/es/TableHtml5/header.js
CHANGED
|
@@ -93,7 +93,7 @@ var Header = function Header(_ref) {
|
|
|
93
93
|
React.createElement(
|
|
94
94
|
Typography,
|
|
95
95
|
{ variant: 'body1', className: classes.cellLabelHeader },
|
|
96
|
-
R.pipe(R.path([
|
|
96
|
+
R.pipe(R.path([-1, 'data', index, 'dimension']), labelAccessor)(headerData),
|
|
97
97
|
React.createElement(Flags, {
|
|
98
98
|
HTMLRenderer: HTMLRenderer,
|
|
99
99
|
flags: flags,
|
|
@@ -106,7 +106,7 @@ var Header = function Header(_ref) {
|
|
|
106
106
|
mapIndexed(function (headerItem, idx) {
|
|
107
107
|
var _cx;
|
|
108
108
|
|
|
109
|
-
var value = getValue(labelAccessor)(headerItem);
|
|
109
|
+
var value = headerItem.isEmpty ? { label: '' } : getValue(labelAccessor)(headerItem);
|
|
110
110
|
var flags = R.propOr([], 'flags', value);
|
|
111
111
|
var hierarchySpace = R.pipe(R.propOr([], 'parents'), R.length, R.times(function () {
|
|
112
112
|
return '·';
|
|
@@ -154,7 +154,7 @@ var Header = function Header(_ref) {
|
|
|
154
154
|
);
|
|
155
155
|
}, R.nth(index, valuesHeaderData))
|
|
156
156
|
);
|
|
157
|
-
}, R.compose(R.length, R.pathOr([], [
|
|
157
|
+
}, R.compose(R.length, R.pathOr([], [-1, 'data']))(headerData));
|
|
158
158
|
};
|
|
159
159
|
|
|
160
160
|
Header.propTypes = process.env.NODE_ENV !== "production" ? {
|
package/es/TableHtml5/section.js
CHANGED
|
@@ -105,7 +105,7 @@ var Section = function Section(_ref) {
|
|
|
105
105
|
HTMLRenderer: HTMLRenderer,
|
|
106
106
|
labelAccessor: labelAccessor
|
|
107
107
|
}),
|
|
108
|
-
|
|
108
|
+
mapIndexed(function (sectionbody, rowIndex) {
|
|
109
109
|
var _cx2;
|
|
110
110
|
|
|
111
111
|
var rowId = sectionbody.key + '_' + sectionIndex + '_' + rowIndex;
|
|
@@ -115,11 +115,12 @@ var Section = function Section(_ref) {
|
|
|
115
115
|
return React.createElement(
|
|
116
116
|
TableRow,
|
|
117
117
|
{ key: rowId },
|
|
118
|
-
|
|
118
|
+
R.times(function (index) {
|
|
119
119
|
var _cx;
|
|
120
120
|
|
|
121
|
-
var
|
|
122
|
-
var
|
|
121
|
+
var cell = R.path(['data', index], sectionbody);
|
|
122
|
+
var value = R.isNil(cell) ? { label: '' } : getValue(labelAccessor)(cell);
|
|
123
|
+
var flags = R.propOr([], 'flags', value);
|
|
123
124
|
var id = rowIndex + '_' + rowId + '_' + index;
|
|
124
125
|
|
|
125
126
|
// special space is used for hierarchy U+2007    
|
|
@@ -133,7 +134,7 @@ var Section = function Section(_ref) {
|
|
|
133
134
|
TableCell,
|
|
134
135
|
{
|
|
135
136
|
key: id,
|
|
136
|
-
className: cx(classes.rowTitle, classes.stickyHeader, (_cx = {}, _cx[classes.highlight] = R.prop(rowId)(activeCellIds), _cx[classes.timePeriodCells] = R.is(Function, isNoWrap) && isNoWrap(R.
|
|
137
|
+
className: cx(classes.rowTitle, classes.stickyHeader, (_cx = {}, _cx[classes.highlight] = R.prop(rowId)(activeCellIds), _cx[classes.timePeriodCells] = R.is(Function, isNoWrap) && isNoWrap(R.propOr({}, 'dimension', cell)), _cx)),
|
|
137
138
|
id: id,
|
|
138
139
|
headers: 'subHeader_' + index + ' ' + currentSection,
|
|
139
140
|
component: 'th',
|
|
@@ -159,7 +160,7 @@ var Section = function Section(_ref) {
|
|
|
159
160
|
)
|
|
160
161
|
)
|
|
161
162
|
);
|
|
162
|
-
}, R.prop('data', sectionbody)),
|
|
163
|
+
}, xLayoutDataLength /*R.prop('data', sectionbody)*/),
|
|
163
164
|
React.createElement(
|
|
164
165
|
TableCell,
|
|
165
166
|
{
|
|
@@ -185,8 +186,9 @@ var Section = function Section(_ref) {
|
|
|
185
186
|
|
|
186
187
|
var intersectionCellId = rowId + '/' + columnIndex;
|
|
187
188
|
var isActive = R.pipe(R.propOr({}, 'intersectionCellId'), R.equals(intersectionCellId))(activeCellIds);
|
|
189
|
+
var missingValLabel = item.isEmpty || sectionbody.isEmpty ? '' : '..';
|
|
188
190
|
return React.createElement(Cell, _extends({}, R.pipe(R.pathOr({ value: null }, [item.key, currentSection, sectionbody.key, 0]), R.over(R.lensProp('value'), function (val) {
|
|
189
|
-
return R.isNil(val) ?
|
|
191
|
+
return R.isNil(val) ? missingValLabel : cellValueAccessor(val);
|
|
190
192
|
}))(cells), {
|
|
191
193
|
key: intersectionCellId,
|
|
192
194
|
headers: rowIds + ' ' + columnIds + ' ' + currentSection,
|
|
@@ -35,19 +35,17 @@ var Item = function Item(_ref) {
|
|
|
35
35
|
style = _ref.style,
|
|
36
36
|
isRtl = _ref.isRtl,
|
|
37
37
|
accessibility = _ref.accessibility,
|
|
38
|
-
index = _ref.index,
|
|
39
38
|
HTMLRenderer = _ref.HTMLRenderer,
|
|
40
39
|
hierarchicalId = _ref.hierarchicalId,
|
|
41
40
|
labels = _ref.labels,
|
|
42
41
|
_ref$depth = _ref.depth,
|
|
43
42
|
depth = _ref$depth === undefined ? 0 : _ref$depth,
|
|
44
|
-
|
|
43
|
+
eventsListeners = _ref.eventsListeners;
|
|
45
44
|
|
|
46
45
|
var _React$useState = React.useState(false),
|
|
47
46
|
isTooltipShown = _React$useState[0],
|
|
48
47
|
setIsTooltipShown = _React$useState[1];
|
|
49
48
|
|
|
50
|
-
var callbacks = eventsCallbacks(hierarchicalId || id, index);
|
|
51
49
|
var padding = depth * 30 + (depth > 0 && !hasChildrenOnLevel ? 30 : 0) + (!hasChild && hasChildrenOnLevel ? 30 : 0);
|
|
52
50
|
return React.createElement(
|
|
53
51
|
ListItem,
|
|
@@ -77,23 +75,21 @@ var Item = function Item(_ref) {
|
|
|
77
75
|
},
|
|
78
76
|
React.createElement(NavigateIcon, null)
|
|
79
77
|
),
|
|
80
|
-
React.createElement(ListItemText,
|
|
78
|
+
React.createElement(ListItemText, {
|
|
81
79
|
'data-testid': 'value_' + id,
|
|
82
80
|
tabIndex: 0,
|
|
83
|
-
'aria-label':
|
|
81
|
+
'aria-label': isGreyed ? R.propOr('', 'disableItemLabel')(labels) + ' ' + label : label,
|
|
84
82
|
'aria-pressed': isSelected,
|
|
85
83
|
'aria-disabled': isDisabled,
|
|
86
84
|
primaryTypographyProps: { noWrap: true, color: 'inherit' },
|
|
87
85
|
secondaryTypographyProps: { color: 'inherit' },
|
|
88
86
|
classes: { root: classes.listItem },
|
|
89
|
-
className: cx((_cx = {}, _cx[classes.accessibilityItemHover] = accessibility, _cx[classes.listItemSelected] = isSelected
|
|
90
|
-
onClick: isDisabled ? null :
|
|
91
|
-
onMouseDown: isDisabled || isTooltipShown ? null :
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
title: isDisabled ? R.propOr('', 'disableItemLabel')(labels) + ' ' + label : label,
|
|
96
|
-
style: { opacity: isDisabled ? '0.5' : '1' },
|
|
87
|
+
className: cx((_cx = {}, _cx[classes.accessibilityItemHover] = accessibility, _cx[classes.listItemSelected] = isSelected, _cx[classes.listItemHover] = !isDisabled, _cx)),
|
|
88
|
+
onClick: isDisabled ? null : eventsListeners.onClick,
|
|
89
|
+
onMouseDown: isDisabled || isTooltipShown ? null : eventsListeners.onMouseDown,
|
|
90
|
+
onMouseEnter: isDisabled || isTooltipShown ? null : eventsListeners.onMouseEnter,
|
|
91
|
+
title: isGreyed ? R.propOr('', 'disableItemLabel')(labels) + ' ' + label : label,
|
|
92
|
+
style: { opacity: isDisabled && isGreyed ? '0.5' : '1' },
|
|
97
93
|
primary: React.createElement(
|
|
98
94
|
'div',
|
|
99
95
|
{
|
|
@@ -104,7 +100,8 @@ var Item = function Item(_ref) {
|
|
|
104
100
|
Icon,
|
|
105
101
|
{
|
|
106
102
|
color: 'primary',
|
|
107
|
-
className: cx(classes.labelIcon, (_cx3 = {}, _cx3[classes.disabledLabel] = isDisabled, _cx3))
|
|
103
|
+
className: cx(classes.labelIcon, (_cx3 = {}, _cx3[classes.disabledLabel] = isDisabled, _cx3)),
|
|
104
|
+
style: { opacity: isDisabled ? '0.5' : '1' }
|
|
108
105
|
},
|
|
109
106
|
isSelected ? React.createElement(CheckedBoxIcon, null) : React.createElement(CheckBoxIcon, null)
|
|
110
107
|
),
|
|
@@ -154,7 +151,7 @@ var Item = function Item(_ref) {
|
|
|
154
151
|
')'
|
|
155
152
|
)
|
|
156
153
|
)
|
|
157
|
-
})
|
|
154
|
+
})
|
|
158
155
|
);
|
|
159
156
|
};
|
|
160
157
|
|
|
@@ -178,13 +175,12 @@ Item.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
178
175
|
style: PropTypes.object,
|
|
179
176
|
isRtl: PropTypes.bool,
|
|
180
177
|
accessibility: PropTypes.bool,
|
|
181
|
-
index: PropTypes.number,
|
|
182
178
|
labelRenderer: PropTypes.func,
|
|
183
179
|
HTMLRenderer: PropTypes.func,
|
|
184
180
|
hierarchicalId: PropTypes.string,
|
|
185
181
|
labels: PropTypes.object,
|
|
186
182
|
depth: PropTypes.number,
|
|
187
|
-
|
|
183
|
+
eventsListeners: PropTypes.object,
|
|
188
184
|
isGreyed: PropTypes.bool
|
|
189
185
|
} : {};
|
|
190
186
|
|
|
@@ -61,7 +61,9 @@ var VirtualizedTree = function VirtualizedTree(props) {
|
|
|
61
61
|
_props$scopeGetter = props.scopeGetter,
|
|
62
62
|
scopeGetter = _props$scopeGetter === undefined ? singleScopeGetter : _props$scopeGetter,
|
|
63
63
|
_props$treeHeight = props.treeHeight,
|
|
64
|
-
treeHeight = _props$treeHeight === undefined ? 0 : _props$treeHeight
|
|
64
|
+
treeHeight = _props$treeHeight === undefined ? 0 : _props$treeHeight,
|
|
65
|
+
_props$simpleSelectio = props.simpleSelectionMode,
|
|
66
|
+
simpleSelectionMode = _props$simpleSelectio === undefined ? false : _props$simpleSelectio;
|
|
65
67
|
|
|
66
68
|
var theme = useTheme();
|
|
67
69
|
|
|
@@ -177,56 +179,63 @@ var VirtualizedTree = function VirtualizedTree(props) {
|
|
|
177
179
|
setIsMouseDown(false);
|
|
178
180
|
}
|
|
179
181
|
};
|
|
180
|
-
|
|
182
|
+
|
|
183
|
+
var onMouseUp = function onMouseUp(e) {
|
|
184
|
+
if (!isMouseDown) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
e.preventDefault();
|
|
188
|
+
apply();
|
|
189
|
+
setIsMouseDown(false);
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
var onMouseLeave = function onMouseLeave() {
|
|
193
|
+
if (isMouseDown) {
|
|
194
|
+
apply();
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
var onKeyUp = function onKeyUp(e) {
|
|
199
|
+
e.preventDefault();
|
|
200
|
+
if (e.key === 'Shift' && !R.isEmpty(shiftIndexes)) {
|
|
201
|
+
apply();
|
|
202
|
+
} else if (e.key === 'Control' && !R.isEmpty(selectIds)) {
|
|
203
|
+
apply();
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
var itemEventsListeners = function itemEventsListeners(id, index) {
|
|
181
208
|
return {
|
|
182
|
-
onMouseUp: isMouseDown ? function (e) {
|
|
183
|
-
e.preventDefault();
|
|
184
|
-
apply();
|
|
185
|
-
if (!R.isEmpty(selectIds)) {
|
|
186
|
-
setLastItemId(id);
|
|
187
|
-
}
|
|
188
|
-
setIsMouseDown(false);
|
|
189
|
-
} : null,
|
|
190
209
|
onMouseDown: function onMouseDown(e) {
|
|
191
|
-
e.
|
|
192
|
-
if (e.ctrlKey || e.shiftKey) {
|
|
210
|
+
if (!simpleSelectionMode && (e.ctrlKey || e.shiftKey)) {
|
|
193
211
|
return;
|
|
194
212
|
}
|
|
195
213
|
setIsMouseDown(true);
|
|
196
214
|
multiSelect(id);
|
|
197
215
|
},
|
|
198
|
-
onMouseEnter:
|
|
216
|
+
onMouseEnter: function onMouseEnter(e) {
|
|
199
217
|
e.preventDefault();
|
|
200
|
-
if (e.ctrlKey || e.shiftKey) {
|
|
218
|
+
if (!isMouseDown || simpleSelectionMode || e.ctrlKey || e.shiftKey) {
|
|
201
219
|
return;
|
|
202
220
|
}
|
|
203
221
|
multiSelect(id);
|
|
204
|
-
|
|
222
|
+
setLastItemId(id);
|
|
223
|
+
},
|
|
205
224
|
onClick: function onClick(e) {
|
|
206
225
|
e.preventDefault();
|
|
207
|
-
|
|
208
|
-
if (e.ctrlKey) {
|
|
226
|
+
if (e.ctrlKey && !simpleSelectionMode) {
|
|
209
227
|
multiSelect(id);
|
|
210
|
-
} else if (e.shiftKey) {
|
|
228
|
+
} else if (e.shiftKey && !simpleSelectionMode) {
|
|
211
229
|
shiftSelect(index);
|
|
212
230
|
} else {
|
|
213
231
|
setIsMouseDown(false);
|
|
214
232
|
setLastItemId(id);
|
|
215
233
|
}
|
|
216
234
|
}
|
|
217
|
-
// ondblclick: () => null
|
|
218
235
|
};
|
|
219
236
|
};
|
|
220
|
-
var onKeyUp = function onKeyUp(e) {
|
|
221
|
-
if (e.key === 'Shift' && !R.isEmpty(shiftIndexes)) {
|
|
222
|
-
apply();
|
|
223
|
-
} else if (e.key === 'Control' && !R.isEmpty(selectIds)) {
|
|
224
|
-
apply();
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
237
|
var ref = useRef();
|
|
228
238
|
var classes = useStyles();
|
|
229
|
-
|
|
230
239
|
useEffect(function () {
|
|
231
240
|
var current = ref.current;
|
|
232
241
|
var handler = function handler(event) {
|
|
@@ -249,7 +258,6 @@ var VirtualizedTree = function VirtualizedTree(props) {
|
|
|
249
258
|
setScrollTop(undefined);
|
|
250
259
|
}
|
|
251
260
|
if (R.isNil(current)) return;
|
|
252
|
-
|
|
253
261
|
current.addEventListener('wheel', handler, { passive: false });
|
|
254
262
|
return function () {
|
|
255
263
|
current.removeEventListener('wheel', handler, { passive: false });
|
|
@@ -267,7 +275,8 @@ var VirtualizedTree = function VirtualizedTree(props) {
|
|
|
267
275
|
disablePadding: true,
|
|
268
276
|
style: { height: maxHeight + 2 },
|
|
269
277
|
onKeyUp: onKeyUp,
|
|
270
|
-
|
|
278
|
+
onMouseUp: onMouseUp,
|
|
279
|
+
onMouseLeave: onMouseLeave,
|
|
271
280
|
ref: ref
|
|
272
281
|
},
|
|
273
282
|
React.createElement(
|
|
@@ -304,11 +313,10 @@ var VirtualizedTree = function VirtualizedTree(props) {
|
|
|
304
313
|
},
|
|
305
314
|
NavigateIcon: R.has(itemId, expandedIds) ? ExpandLessIcon : ExpandMoreIcon,
|
|
306
315
|
isRtl: isRtl,
|
|
307
|
-
|
|
316
|
+
eventsListeners: itemEventsListeners(getHierarchicalId(item), index),
|
|
308
317
|
HTMLRenderer: HTMLRenderer,
|
|
309
318
|
classes: classes,
|
|
310
319
|
labels: labels,
|
|
311
|
-
index: index,
|
|
312
320
|
style: style,
|
|
313
321
|
accessibility: accessibility,
|
|
314
322
|
ariaLabel: R.prop('navigateNext')(labels),
|
|
@@ -340,7 +348,8 @@ VirtualizedTree.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
340
348
|
collapse: PropTypes.func,
|
|
341
349
|
treeHeight: PropTypes.number,
|
|
342
350
|
isGreyed: PropTypes.func,
|
|
343
|
-
scopeGetter: PropTypes.func
|
|
351
|
+
scopeGetter: PropTypes.func,
|
|
352
|
+
simpleSelectionMode: PropTypes.bool
|
|
344
353
|
} : {};
|
|
345
354
|
|
|
346
355
|
export default VirtualizedTree;
|
package/lib/Chips/CustomChip.js
CHANGED
|
@@ -68,14 +68,15 @@ var CustomChip = function CustomChip(_ref) {
|
|
|
68
68
|
_ref$testId = _ref.testId,
|
|
69
69
|
testId = _ref$testId === undefined ? 'deleteChip-test-id' : _ref$testId,
|
|
70
70
|
_ref$labelRenderer = _ref.labelRenderer,
|
|
71
|
-
labelRenderer = _ref$labelRenderer === undefined ? R.prop('label') : _ref$labelRenderer
|
|
71
|
+
labelRenderer = _ref$labelRenderer === undefined ? R.prop('label') : _ref$labelRenderer,
|
|
72
|
+
deprecated = _ref.deprecated;
|
|
72
73
|
|
|
73
74
|
var theme = (0, _styles.useTheme)();
|
|
74
75
|
var isRtl = (0, _utils.getIsRtl)(theme);
|
|
75
76
|
var classes = useStyles();
|
|
76
77
|
var mapIndexed = R.addIndex(R.map);
|
|
77
78
|
var onChange = R.is(Function)(onDelete) ? function () {
|
|
78
|
-
return onDelete(parentId, R.isNil(id) ? [] : [
|
|
79
|
+
return onDelete(parentId, R.isNil(id) ? [] : R.append(id, deprecated || []));
|
|
79
80
|
} : null;
|
|
80
81
|
var hasTooltip = (0, _utils2.shownTooltip)(items);
|
|
81
82
|
var hasMultiLinedTooltip = (0, _utils2.showMultiLinedTooltip)(items);
|
|
@@ -142,7 +143,8 @@ CustomChip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
142
143
|
labelClasses: _propTypes2.default.string,
|
|
143
144
|
ariaLabel: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.element]),
|
|
144
145
|
items: _propTypes2.default.array,
|
|
145
|
-
labelRenderer: _propTypes2.default.func
|
|
146
|
+
labelRenderer: _propTypes2.default.func,
|
|
147
|
+
deprecated: _propTypes2.default.array
|
|
146
148
|
} : {};
|
|
147
149
|
|
|
148
150
|
exports.default = CustomChip;
|
|
@@ -83,10 +83,12 @@ var GroupedChips = function GroupedChips(_ref) {
|
|
|
83
83
|
}) : R.map(function (items) {
|
|
84
84
|
var lastItem = R.last(items);
|
|
85
85
|
var id = lastItem.id,
|
|
86
|
-
isNotRemovable = lastItem.isNotRemovable
|
|
86
|
+
isNotRemovable = lastItem.isNotRemovable,
|
|
87
|
+
deprecated = lastItem.deprecated;
|
|
87
88
|
|
|
88
89
|
|
|
89
90
|
return _react2.default.createElement(_CustomChip2.default, {
|
|
91
|
+
deprecated: deprecated,
|
|
90
92
|
key: id,
|
|
91
93
|
id: id,
|
|
92
94
|
items: R.pipe(R.length, R.gte(2)) ? items : null,
|
|
@@ -76,14 +76,17 @@ var HierarchicalFilter = function HierarchicalFilter(props) {
|
|
|
76
76
|
hasSpotlight = props.hasSpotlight,
|
|
77
77
|
_props$disableAccesso = props.disableAccessor,
|
|
78
78
|
disableAccessor = _props$disableAccesso === undefined ? R.always(false) : _props$disableAccesso,
|
|
79
|
-
allItems = props.allItems
|
|
79
|
+
allItems = props.allItems,
|
|
80
|
+
_props$simpleSelectio = props.simpleSelectionMode,
|
|
81
|
+
simpleSelectionMode = _props$simpleSelectio === undefined ? false : _props$simpleSelectio;
|
|
80
82
|
|
|
81
83
|
var classes = (0, _styles.useStyles)({ accessibility: accessibility });
|
|
82
84
|
var theme = (0, _core.useTheme)();
|
|
83
85
|
var isRtl = (0, _utils2.getIsRtl)(theme);
|
|
84
86
|
var Chip = R.isNil(Tag) ? _.Tag : Tag;
|
|
85
87
|
var _allGroupedItems = R.groupBy(R.propOr('#ROOT', 'parentId'), allItems);
|
|
86
|
-
var _disableAccessor = (0, _utils.getEvolvedDisableAccessor)(_allGroupedItems, disableAccessor, R.always(false));
|
|
88
|
+
var _disableAccessor = simpleSelectionMode ? disableAccessor : (0, _utils.getEvolvedDisableAccessor)(_allGroupedItems, disableAccessor, R.always(false));
|
|
89
|
+
|
|
87
90
|
var tagValue = getCounter(items, _disableAccessor, tagAccessor);
|
|
88
91
|
var isDisabled = function isDisabled(item) {
|
|
89
92
|
return R.is(Function, disableAccessor) ? disableAccessor(item) : false;
|
|
@@ -182,7 +185,8 @@ HierarchicalFilter.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
182
185
|
spotlight: _propTypes2.default.object,
|
|
183
186
|
setSpotlight: _propTypes2.default.func,
|
|
184
187
|
hasSpotlight: _propTypes2.default.bool,
|
|
185
|
-
allItems: _propTypes2.default.array
|
|
188
|
+
allItems: _propTypes2.default.array,
|
|
189
|
+
simpleSelectionMode: _propTypes2.default.bool
|
|
186
190
|
} : {};
|
|
187
191
|
|
|
188
192
|
exports.default = (0, _withSpotlight.withSpotlight)((0, _withExpansionTree.withExpansionTree)(HierarchicalFilter));
|
|
@@ -72,12 +72,13 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
|
72
72
|
var mapIndexed = R.addIndex(R.map);
|
|
73
73
|
|
|
74
74
|
var getEnhancedValuesHeaderData = exports.getEnhancedValuesHeaderData = function getEnhancedValuesHeaderData(data) {
|
|
75
|
-
var colLength = R.pipe(R.
|
|
75
|
+
var colLength = R.pipe(R.last, R.propOr([], 'data'), R.length)(data);
|
|
76
76
|
return R.pipe(R.pluck('data'),
|
|
77
77
|
// mix merge and transpose for performance
|
|
78
78
|
R.reduce(function (acc, cells) {
|
|
79
|
-
R.addIndex(R.forEach)(function (
|
|
80
|
-
var
|
|
79
|
+
R.addIndex(R.forEach)(function (_, rowIndex) {
|
|
80
|
+
var cell = R.nth(rowIndex, cells) || {};
|
|
81
|
+
var cellId = R.has('values', cell) ? R.pipe(R.prop('values'), R.pluck('id'), R.join(','))(cell) : R.pathOr('missing' + rowIndex, ['value', 'id'], cell);
|
|
81
82
|
var topCell = rowIndex > 0 ? R.pipe(R.nth(rowIndex - 1), R.last)(acc) : null;
|
|
82
83
|
var cellKey = R.isNil(topCell) ? cellId : topCell.key + '-' + cellId;
|
|
83
84
|
|
|
@@ -85,9 +86,13 @@ var getEnhancedValuesHeaderData = exports.getEnhancedValuesHeaderData = function
|
|
|
85
86
|
if (R.prop('key', leftCell) === cellKey && rowIndex !== colLength - 1) {
|
|
86
87
|
acc = R.over(R.lensIndex(rowIndex), R.over(R.lensIndex(-1), R.evolve({ spanCount: R.add(1) })))(acc);
|
|
87
88
|
} else {
|
|
88
|
-
acc = R.over(R.lensIndex(rowIndex), R.append(_extends({}, R.pick(['value', 'values'], cell), {
|
|
89
|
+
acc = R.over(R.lensIndex(rowIndex), R.append(_extends({}, R.pick(['value', 'values'], cell), {
|
|
90
|
+
key: cellKey,
|
|
91
|
+
spanCount: 1,
|
|
92
|
+
isEmpty: R.isEmpty(cell)
|
|
93
|
+
})))(acc);
|
|
89
94
|
}
|
|
90
|
-
})(
|
|
95
|
+
})(acc);
|
|
91
96
|
return acc;
|
|
92
97
|
}, R.times(R.always([]), colLength)))(data);
|
|
93
98
|
};
|
|
@@ -152,7 +157,7 @@ var TableHtml5 = function TableHtml5(_ref) {
|
|
|
152
157
|
};
|
|
153
158
|
}, []);
|
|
154
159
|
|
|
155
|
-
var xLayoutData = R.pathOr([], [0, 1,
|
|
160
|
+
var xLayoutData = R.pathOr([], [0, 1, -1, 'data'], sectionsData);
|
|
156
161
|
var xLayoutDataLength = R.length(xLayoutData);
|
|
157
162
|
|
|
158
163
|
var _useMemo = (0, _react.useMemo)(function () {
|
package/lib/TableHtml5/header.js
CHANGED
|
@@ -127,7 +127,7 @@ var Header = function Header(_ref) {
|
|
|
127
127
|
_react2.default.createElement(
|
|
128
128
|
_Typography2.default,
|
|
129
129
|
{ variant: 'body1', className: classes.cellLabelHeader },
|
|
130
|
-
R.pipe(R.path([
|
|
130
|
+
R.pipe(R.path([-1, 'data', index, 'dimension']), labelAccessor)(headerData),
|
|
131
131
|
_react2.default.createElement(_flags2.default, {
|
|
132
132
|
HTMLRenderer: HTMLRenderer,
|
|
133
133
|
flags: flags,
|
|
@@ -140,7 +140,7 @@ var Header = function Header(_ref) {
|
|
|
140
140
|
mapIndexed(function (headerItem, idx) {
|
|
141
141
|
var _cx;
|
|
142
142
|
|
|
143
|
-
var value = (0, _utils2.getValue)(labelAccessor)(headerItem);
|
|
143
|
+
var value = headerItem.isEmpty ? { label: '' } : (0, _utils2.getValue)(labelAccessor)(headerItem);
|
|
144
144
|
var flags = R.propOr([], 'flags', value);
|
|
145
145
|
var hierarchySpace = R.pipe(R.propOr([], 'parents'), R.length, R.times(function () {
|
|
146
146
|
return '·';
|
|
@@ -188,7 +188,7 @@ var Header = function Header(_ref) {
|
|
|
188
188
|
);
|
|
189
189
|
}, R.nth(index, valuesHeaderData))
|
|
190
190
|
);
|
|
191
|
-
}, R.compose(R.length, R.pathOr([], [
|
|
191
|
+
}, R.compose(R.length, R.pathOr([], [-1, 'data']))(headerData));
|
|
192
192
|
};
|
|
193
193
|
|
|
194
194
|
Header.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -147,7 +147,7 @@ var Section = function Section(_ref) {
|
|
|
147
147
|
HTMLRenderer: HTMLRenderer,
|
|
148
148
|
labelAccessor: labelAccessor
|
|
149
149
|
}),
|
|
150
|
-
|
|
150
|
+
mapIndexed(function (sectionbody, rowIndex) {
|
|
151
151
|
var _cx2;
|
|
152
152
|
|
|
153
153
|
var rowId = sectionbody.key + '_' + sectionIndex + '_' + rowIndex;
|
|
@@ -157,11 +157,12 @@ var Section = function Section(_ref) {
|
|
|
157
157
|
return _react2.default.createElement(
|
|
158
158
|
_TableRow2.default,
|
|
159
159
|
{ key: rowId },
|
|
160
|
-
|
|
160
|
+
R.times(function (index) {
|
|
161
161
|
var _cx;
|
|
162
162
|
|
|
163
|
-
var
|
|
164
|
-
var
|
|
163
|
+
var cell = R.path(['data', index], sectionbody);
|
|
164
|
+
var value = R.isNil(cell) ? { label: '' } : (0, _utils2.getValue)(labelAccessor)(cell);
|
|
165
|
+
var flags = R.propOr([], 'flags', value);
|
|
165
166
|
var id = rowIndex + '_' + rowId + '_' + index;
|
|
166
167
|
|
|
167
168
|
// special space is used for hierarchy U+2007    
|
|
@@ -175,7 +176,7 @@ var Section = function Section(_ref) {
|
|
|
175
176
|
_TableCell2.default,
|
|
176
177
|
{
|
|
177
178
|
key: id,
|
|
178
|
-
className: (0, _classnames2.default)(classes.rowTitle, classes.stickyHeader, (_cx = {}, _cx[classes.highlight] = R.prop(rowId)(activeCellIds), _cx[classes.timePeriodCells] = R.is(Function, isNoWrap) && isNoWrap(R.
|
|
179
|
+
className: (0, _classnames2.default)(classes.rowTitle, classes.stickyHeader, (_cx = {}, _cx[classes.highlight] = R.prop(rowId)(activeCellIds), _cx[classes.timePeriodCells] = R.is(Function, isNoWrap) && isNoWrap(R.propOr({}, 'dimension', cell)), _cx)),
|
|
179
180
|
id: id,
|
|
180
181
|
headers: 'subHeader_' + index + ' ' + currentSection,
|
|
181
182
|
component: 'th',
|
|
@@ -201,7 +202,7 @@ var Section = function Section(_ref) {
|
|
|
201
202
|
)
|
|
202
203
|
)
|
|
203
204
|
);
|
|
204
|
-
}, R.prop('data', sectionbody)),
|
|
205
|
+
}, xLayoutDataLength /*R.prop('data', sectionbody)*/),
|
|
205
206
|
_react2.default.createElement(
|
|
206
207
|
_TableCell2.default,
|
|
207
208
|
{
|
|
@@ -227,8 +228,9 @@ var Section = function Section(_ref) {
|
|
|
227
228
|
|
|
228
229
|
var intersectionCellId = rowId + '/' + columnIndex;
|
|
229
230
|
var isActive = R.pipe(R.propOr({}, 'intersectionCellId'), R.equals(intersectionCellId))(activeCellIds);
|
|
231
|
+
var missingValLabel = item.isEmpty || sectionbody.isEmpty ? '' : '..';
|
|
230
232
|
return _react2.default.createElement(_cell2.default, _extends({}, R.pipe(R.pathOr({ value: null }, [item.key, currentSection, sectionbody.key, 0]), R.over(R.lensProp('value'), function (val) {
|
|
231
|
-
return R.isNil(val) ?
|
|
233
|
+
return R.isNil(val) ? missingValLabel : cellValueAccessor(val);
|
|
232
234
|
}))(cells), {
|
|
233
235
|
key: intersectionCellId,
|
|
234
236
|
headers: rowIds + ' ' + columnIds + ' ' + currentSection,
|