@sis-cc/dotstatsuite-visions 12.46.0 → 12.48.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/AdvancedFilterDialog/AdvancedFilterDialog.js +2 -1
- package/es/CollapseButtons/CollapseButtons.js +53 -93
- package/es/HierarchicalFilter/HierarchicalFilter.js +2 -1
- package/lib/AdvancedFilterDialog/AdvancedFilterDialog.js +2 -1
- package/lib/CollapseButtons/CollapseButtons.js +52 -95
- package/lib/HierarchicalFilter/HierarchicalFilter.js +2 -1
- package/package.json +1 -1
- package/umd/@sis-cc/dotstatsuite-visions.js +93 -131
- package/umd/@sis-cc/dotstatsuite-visions.min.js +12 -12
- package/umd/@sis-cc/dotstatsuite-visions.min.js.map +1 -1
|
@@ -455,7 +455,8 @@ var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
|
|
|
455
455
|
term: spotlight.term,
|
|
456
456
|
hasCommit: false,
|
|
457
457
|
spotlight: { fields: {} },
|
|
458
|
-
action: setSpotlight
|
|
458
|
+
action: setSpotlight,
|
|
459
|
+
labels: labels
|
|
459
460
|
})
|
|
460
461
|
),
|
|
461
462
|
React.createElement(
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
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; };
|
|
2
2
|
|
|
3
|
-
import React, { useState
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
3
|
+
import React, { useState } from 'react';
|
|
5
4
|
import cx from 'classnames';
|
|
6
5
|
import * as R from 'ramda';
|
|
7
6
|
import makeStyles from '@mui/styles/makeStyles';
|
|
@@ -61,30 +60,47 @@ var CollapseButtons = function CollapseButtons(props) {
|
|
|
61
60
|
var classes = useStyles();
|
|
62
61
|
var isMobileView = useMediaQuery(breakpoint);
|
|
63
62
|
|
|
64
|
-
var _useState = useState(),
|
|
63
|
+
var _useState = useState(props.selectedItemId),
|
|
65
64
|
toggleId = _useState[0],
|
|
66
65
|
setIsOpen = _useState[1];
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
67
|
+
var collapseFactory = function collapseFactory(_ref) {
|
|
68
|
+
var action = _ref.action,
|
|
69
|
+
isSecondLevelClikable = _ref.isSecondLevelClikable,
|
|
70
|
+
labelAccessor = _ref.labelAccessor,
|
|
71
|
+
testId = _ref.testId;
|
|
72
|
+
return function (_ref2) {
|
|
73
|
+
var toggleId = _ref2.toggleId,
|
|
74
|
+
id = _ref2.id,
|
|
75
|
+
values = _ref2.values,
|
|
76
|
+
isMobileView = _ref2.isMobileView;
|
|
77
|
+
return React.createElement(
|
|
78
|
+
Collapse,
|
|
79
|
+
{
|
|
80
|
+
'in': toggleId === id,
|
|
81
|
+
timeout: 'auto',
|
|
82
|
+
unmountOnExit: true,
|
|
83
|
+
className: classes.collapseContainer
|
|
84
|
+
},
|
|
85
|
+
React.createElement(
|
|
86
|
+
Paper,
|
|
87
|
+
{ elevation: 10, isMobileView: isMobileView },
|
|
88
|
+
R.map(function (item) {
|
|
89
|
+
return React.createElement(Item, {
|
|
90
|
+
key: R.prop('id')(item),
|
|
91
|
+
testId: testId + '_' + id + '_value_' + R.prop('id')(item),
|
|
92
|
+
parentId: id,
|
|
93
|
+
item: item,
|
|
94
|
+
action: action,
|
|
95
|
+
isSecondLevelClikable: isSecondLevelClikable,
|
|
96
|
+
labelAccessor: labelAccessor
|
|
97
|
+
});
|
|
98
|
+
}, values)
|
|
99
|
+
)
|
|
100
|
+
);
|
|
101
|
+
};
|
|
87
102
|
};
|
|
103
|
+
var collapse = collapseFactory({ action: action, isSecondLevelClikable: isSecondLevelClikable, labelAccessor: labelAccessor, testId: testId });
|
|
88
104
|
|
|
89
105
|
return React.createElement(
|
|
90
106
|
Grid,
|
|
@@ -96,11 +112,11 @@ var CollapseButtons = function CollapseButtons(props) {
|
|
|
96
112
|
className: cx((_cx = {}, _cx[classes.container] = accessibility, _cx)),
|
|
97
113
|
tabIndex: 0
|
|
98
114
|
},
|
|
99
|
-
R.map(function (
|
|
100
|
-
var id =
|
|
101
|
-
label =
|
|
102
|
-
|
|
103
|
-
values =
|
|
115
|
+
R.map(function (_ref3) {
|
|
116
|
+
var id = _ref3.id,
|
|
117
|
+
label = _ref3.label,
|
|
118
|
+
_ref3$values = _ref3.values,
|
|
119
|
+
values = _ref3$values === undefined ? [] : _ref3$values;
|
|
104
120
|
return React.createElement(
|
|
105
121
|
Grid,
|
|
106
122
|
_extends({ item: true, xs: 12, sm: 12, md: R.nth(nbColumns)(COLUMNS) }, gridButtonsProps, { key: id }),
|
|
@@ -110,81 +126,25 @@ var CollapseButtons = function CollapseButtons(props) {
|
|
|
110
126
|
React.createElement(ToggleButton, {
|
|
111
127
|
textTransform: textTransform,
|
|
112
128
|
label: label,
|
|
113
|
-
tabIndex:
|
|
114
|
-
isOpen:
|
|
129
|
+
tabIndex: toggleId ? 1 : 0,
|
|
130
|
+
isOpen: toggleId === id,
|
|
115
131
|
toggle: function toggle() {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return setIsOpen((_setIsOpen2 = {}, _setIsOpen2[id] = !R.prop(id)(toggleId), _setIsOpen2));
|
|
132
|
+
return setIsOpen(id === toggleId ? null : id);
|
|
119
133
|
},
|
|
120
134
|
testId: testId + '_' + id,
|
|
121
135
|
id: id
|
|
122
136
|
}),
|
|
123
|
-
isMobileView &&
|
|
124
|
-
Collapse,
|
|
125
|
-
{
|
|
126
|
-
'in': R.prop(id)(toggleId),
|
|
127
|
-
timeout: 'auto',
|
|
128
|
-
unmountOnExit: true,
|
|
129
|
-
className: classes.collapseContainer
|
|
130
|
-
},
|
|
131
|
-
React.createElement(
|
|
132
|
-
Paper,
|
|
133
|
-
{ elevation: 10, isMobileView: isMobileView },
|
|
134
|
-
getValues(id)(values)
|
|
135
|
-
)
|
|
136
|
-
)
|
|
137
|
+
isMobileView && collapse({ toggleId: toggleId, id: id, values: values, isMobileView: isMobileView })
|
|
137
138
|
)
|
|
138
139
|
);
|
|
139
140
|
})(items),
|
|
140
|
-
!isMobileView && R.map(function (
|
|
141
|
-
var id =
|
|
142
|
-
|
|
143
|
-
values =
|
|
144
|
-
return
|
|
145
|
-
|
|
146
|
-
{
|
|
147
|
-
'in': R.prop(id)(toggleId),
|
|
148
|
-
timeout: 'auto',
|
|
149
|
-
unmountOnExit: true,
|
|
150
|
-
key: id,
|
|
151
|
-
className: classes.collapseContainer
|
|
152
|
-
},
|
|
153
|
-
React.createElement(
|
|
154
|
-
Paper,
|
|
155
|
-
{ elevation: 10 },
|
|
156
|
-
getValues(id)(values)
|
|
157
|
-
)
|
|
158
|
-
);
|
|
159
|
-
})(items)
|
|
141
|
+
!isMobileView && R.map(function (_ref4) {
|
|
142
|
+
var id = _ref4.id,
|
|
143
|
+
_ref4$values = _ref4.values,
|
|
144
|
+
values = _ref4$values === undefined ? [] : _ref4$values;
|
|
145
|
+
return collapse({ toggleId: toggleId, id: id, values: values, isMobileView: isMobileView });
|
|
146
|
+
}, items)
|
|
160
147
|
);
|
|
161
148
|
};
|
|
162
149
|
|
|
163
|
-
CollapseButtons.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
164
|
-
testId: PropTypes.string,
|
|
165
|
-
selectedItemId: PropTypes.string,
|
|
166
|
-
items: PropTypes.arrayOf(PropTypes.shape({
|
|
167
|
-
id: PropTypes.string.isRequired,
|
|
168
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
169
|
-
svgPath: PropTypes.string,
|
|
170
|
-
values: PropTypes.arrayOf(PropTypes.shape({
|
|
171
|
-
id: PropTypes.string.isRequired,
|
|
172
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
173
|
-
subtopics: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape({
|
|
174
|
-
id: PropTypes.string.isRequired,
|
|
175
|
-
label: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
|
|
176
|
-
}), PropTypes.string]))
|
|
177
|
-
}))
|
|
178
|
-
})),
|
|
179
|
-
action: PropTypes.func,
|
|
180
|
-
nbColumns: PropTypes.number,
|
|
181
|
-
isSecondLevelClikable: PropTypes.bool,
|
|
182
|
-
breakpoint: PropTypes.func,
|
|
183
|
-
gridButtonsProps: PropTypes.object,
|
|
184
|
-
justify: PropTypes.string,
|
|
185
|
-
textTransform: PropTypes.string,
|
|
186
|
-
labelAccessor: PropTypes.func,
|
|
187
|
-
accessibility: PropTypes.bool
|
|
188
|
-
} : {};
|
|
189
|
-
|
|
190
150
|
export default CollapseButtons;
|
|
@@ -107,7 +107,8 @@ var HierarchicalFilter = function HierarchicalFilter(props) {
|
|
|
107
107
|
term: spotlight.term,
|
|
108
108
|
hasCommit: false,
|
|
109
109
|
spotlight: { fields: {} },
|
|
110
|
-
action: setSpotlight
|
|
110
|
+
action: setSpotlight,
|
|
111
|
+
labels: labels
|
|
111
112
|
}),
|
|
112
113
|
R.is(Function, toggleBulk) && hasSpotlight && React.createElement(
|
|
113
114
|
Tooltip,
|
|
@@ -529,7 +529,8 @@ var AdvancedFilterDialog = function AdvancedFilterDialog(props) {
|
|
|
529
529
|
term: spotlight.term,
|
|
530
530
|
hasCommit: false,
|
|
531
531
|
spotlight: { fields: {} },
|
|
532
|
-
action: setSpotlight
|
|
532
|
+
action: setSpotlight,
|
|
533
|
+
labels: labels
|
|
533
534
|
})
|
|
534
535
|
),
|
|
535
536
|
_react2.default.createElement(
|
|
@@ -9,10 +9,6 @@ var _react = require('react');
|
|
|
9
9
|
|
|
10
10
|
var _react2 = _interopRequireDefault(_react);
|
|
11
11
|
|
|
12
|
-
var _propTypes = require('prop-types');
|
|
13
|
-
|
|
14
|
-
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
15
|
-
|
|
16
12
|
var _classnames = require('classnames');
|
|
17
13
|
|
|
18
14
|
var _classnames2 = _interopRequireDefault(_classnames);
|
|
@@ -103,30 +99,47 @@ var CollapseButtons = function CollapseButtons(props) {
|
|
|
103
99
|
var classes = useStyles();
|
|
104
100
|
var isMobileView = (0, _useMediaQuery2.default)(breakpoint);
|
|
105
101
|
|
|
106
|
-
var _useState = (0, _react.useState)(),
|
|
102
|
+
var _useState = (0, _react.useState)(props.selectedItemId),
|
|
107
103
|
toggleId = _useState[0],
|
|
108
104
|
setIsOpen = _useState[1];
|
|
109
105
|
|
|
110
|
-
|
|
111
|
-
var
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
106
|
+
var collapseFactory = function collapseFactory(_ref) {
|
|
107
|
+
var action = _ref.action,
|
|
108
|
+
isSecondLevelClikable = _ref.isSecondLevelClikable,
|
|
109
|
+
labelAccessor = _ref.labelAccessor,
|
|
110
|
+
testId = _ref.testId;
|
|
111
|
+
return function (_ref2) {
|
|
112
|
+
var toggleId = _ref2.toggleId,
|
|
113
|
+
id = _ref2.id,
|
|
114
|
+
values = _ref2.values,
|
|
115
|
+
isMobileView = _ref2.isMobileView;
|
|
116
|
+
return _react2.default.createElement(
|
|
117
|
+
_Collapse2.default,
|
|
118
|
+
{
|
|
119
|
+
'in': toggleId === id,
|
|
120
|
+
timeout: 'auto',
|
|
121
|
+
unmountOnExit: true,
|
|
122
|
+
className: classes.collapseContainer
|
|
123
|
+
},
|
|
124
|
+
_react2.default.createElement(
|
|
125
|
+
_Paper2.default,
|
|
126
|
+
{ elevation: 10, isMobileView: isMobileView },
|
|
127
|
+
R.map(function (item) {
|
|
128
|
+
return _react2.default.createElement(_Item2.default, {
|
|
129
|
+
key: R.prop('id')(item),
|
|
130
|
+
testId: testId + '_' + id + '_value_' + R.prop('id')(item),
|
|
131
|
+
parentId: id,
|
|
132
|
+
item: item,
|
|
133
|
+
action: action,
|
|
134
|
+
isSecondLevelClikable: isSecondLevelClikable,
|
|
135
|
+
labelAccessor: labelAccessor
|
|
136
|
+
});
|
|
137
|
+
}, values)
|
|
138
|
+
)
|
|
139
|
+
);
|
|
140
|
+
};
|
|
129
141
|
};
|
|
142
|
+
var collapse = collapseFactory({ action: action, isSecondLevelClikable: isSecondLevelClikable, labelAccessor: labelAccessor, testId: testId });
|
|
130
143
|
|
|
131
144
|
return _react2.default.createElement(
|
|
132
145
|
_Grid2.default,
|
|
@@ -138,11 +151,11 @@ var CollapseButtons = function CollapseButtons(props) {
|
|
|
138
151
|
className: (0, _classnames2.default)((_cx = {}, _cx[classes.container] = accessibility, _cx)),
|
|
139
152
|
tabIndex: 0
|
|
140
153
|
},
|
|
141
|
-
R.map(function (
|
|
142
|
-
var id =
|
|
143
|
-
label =
|
|
144
|
-
|
|
145
|
-
values =
|
|
154
|
+
R.map(function (_ref3) {
|
|
155
|
+
var id = _ref3.id,
|
|
156
|
+
label = _ref3.label,
|
|
157
|
+
_ref3$values = _ref3.values,
|
|
158
|
+
values = _ref3$values === undefined ? [] : _ref3$values;
|
|
146
159
|
return _react2.default.createElement(
|
|
147
160
|
_Grid2.default,
|
|
148
161
|
_extends({ item: true, xs: 12, sm: 12, md: R.nth(nbColumns)(COLUMNS) }, gridButtonsProps, { key: id }),
|
|
@@ -152,81 +165,25 @@ var CollapseButtons = function CollapseButtons(props) {
|
|
|
152
165
|
_react2.default.createElement(_.ToggleButton, {
|
|
153
166
|
textTransform: textTransform,
|
|
154
167
|
label: label,
|
|
155
|
-
tabIndex:
|
|
156
|
-
isOpen:
|
|
168
|
+
tabIndex: toggleId ? 1 : 0,
|
|
169
|
+
isOpen: toggleId === id,
|
|
157
170
|
toggle: function toggle() {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
return setIsOpen((_setIsOpen2 = {}, _setIsOpen2[id] = !R.prop(id)(toggleId), _setIsOpen2));
|
|
171
|
+
return setIsOpen(id === toggleId ? null : id);
|
|
161
172
|
},
|
|
162
173
|
testId: testId + '_' + id,
|
|
163
174
|
id: id
|
|
164
175
|
}),
|
|
165
|
-
isMobileView &&
|
|
166
|
-
_Collapse2.default,
|
|
167
|
-
{
|
|
168
|
-
'in': R.prop(id)(toggleId),
|
|
169
|
-
timeout: 'auto',
|
|
170
|
-
unmountOnExit: true,
|
|
171
|
-
className: classes.collapseContainer
|
|
172
|
-
},
|
|
173
|
-
_react2.default.createElement(
|
|
174
|
-
_Paper2.default,
|
|
175
|
-
{ elevation: 10, isMobileView: isMobileView },
|
|
176
|
-
getValues(id)(values)
|
|
177
|
-
)
|
|
178
|
-
)
|
|
176
|
+
isMobileView && collapse({ toggleId: toggleId, id: id, values: values, isMobileView: isMobileView })
|
|
179
177
|
)
|
|
180
178
|
);
|
|
181
179
|
})(items),
|
|
182
|
-
!isMobileView && R.map(function (
|
|
183
|
-
var id =
|
|
184
|
-
|
|
185
|
-
values =
|
|
186
|
-
return
|
|
187
|
-
|
|
188
|
-
{
|
|
189
|
-
'in': R.prop(id)(toggleId),
|
|
190
|
-
timeout: 'auto',
|
|
191
|
-
unmountOnExit: true,
|
|
192
|
-
key: id,
|
|
193
|
-
className: classes.collapseContainer
|
|
194
|
-
},
|
|
195
|
-
_react2.default.createElement(
|
|
196
|
-
_Paper2.default,
|
|
197
|
-
{ elevation: 10 },
|
|
198
|
-
getValues(id)(values)
|
|
199
|
-
)
|
|
200
|
-
);
|
|
201
|
-
})(items)
|
|
180
|
+
!isMobileView && R.map(function (_ref4) {
|
|
181
|
+
var id = _ref4.id,
|
|
182
|
+
_ref4$values = _ref4.values,
|
|
183
|
+
values = _ref4$values === undefined ? [] : _ref4$values;
|
|
184
|
+
return collapse({ toggleId: toggleId, id: id, values: values, isMobileView: isMobileView });
|
|
185
|
+
}, items)
|
|
202
186
|
);
|
|
203
187
|
};
|
|
204
188
|
|
|
205
|
-
CollapseButtons.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
206
|
-
testId: _propTypes2.default.string,
|
|
207
|
-
selectedItemId: _propTypes2.default.string,
|
|
208
|
-
items: _propTypes2.default.arrayOf(_propTypes2.default.shape({
|
|
209
|
-
id: _propTypes2.default.string.isRequired,
|
|
210
|
-
label: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.element]),
|
|
211
|
-
svgPath: _propTypes2.default.string,
|
|
212
|
-
values: _propTypes2.default.arrayOf(_propTypes2.default.shape({
|
|
213
|
-
id: _propTypes2.default.string.isRequired,
|
|
214
|
-
label: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.element]),
|
|
215
|
-
subtopics: _propTypes2.default.arrayOf(_propTypes2.default.oneOfType([_propTypes2.default.shape({
|
|
216
|
-
id: _propTypes2.default.string.isRequired,
|
|
217
|
-
label: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.element])
|
|
218
|
-
}), _propTypes2.default.string]))
|
|
219
|
-
}))
|
|
220
|
-
})),
|
|
221
|
-
action: _propTypes2.default.func,
|
|
222
|
-
nbColumns: _propTypes2.default.number,
|
|
223
|
-
isSecondLevelClikable: _propTypes2.default.bool,
|
|
224
|
-
breakpoint: _propTypes2.default.func,
|
|
225
|
-
gridButtonsProps: _propTypes2.default.object,
|
|
226
|
-
justify: _propTypes2.default.string,
|
|
227
|
-
textTransform: _propTypes2.default.string,
|
|
228
|
-
labelAccessor: _propTypes2.default.func,
|
|
229
|
-
accessibility: _propTypes2.default.bool
|
|
230
|
-
} : {};
|
|
231
|
-
|
|
232
189
|
exports.default = CollapseButtons;
|
|
@@ -136,7 +136,8 @@ var HierarchicalFilter = function HierarchicalFilter(props) {
|
|
|
136
136
|
term: spotlight.term,
|
|
137
137
|
hasCommit: false,
|
|
138
138
|
spotlight: { fields: {} },
|
|
139
|
-
action: setSpotlight
|
|
139
|
+
action: setSpotlight,
|
|
140
|
+
labels: labels
|
|
140
141
|
}),
|
|
141
142
|
R.is(Function, toggleBulk) && hasSpotlight && _react2.default.createElement(
|
|
142
143
|
_.Tooltip,
|