@sis-cc/dotstatsuite-visions 12.45.0 → 12.47.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/CollapseButtons/CollapseButtons.js +53 -93
- package/es/Logo/Logo.js +5 -2
- package/lib/CollapseButtons/CollapseButtons.js +52 -95
- package/lib/Logo/Logo.js +5 -2
- package/package.json +1 -1
- package/umd/@sis-cc/dotstatsuite-visions.js +94 -131
- package/umd/@sis-cc/dotstatsuite-visions.min.js +12 -12
- package/umd/@sis-cc/dotstatsuite-visions.min.js.map +1 -1
|
@@ -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;
|
package/es/Logo/Logo.js
CHANGED
|
@@ -26,7 +26,9 @@ var Logo = function Logo(_ref) {
|
|
|
26
26
|
alt = _ref$alt === undefined ? 'logo' : _ref$alt,
|
|
27
27
|
_ref$maxHeight = _ref.maxHeight,
|
|
28
28
|
maxHeight = _ref$maxHeight === undefined ? 150 : _ref$maxHeight,
|
|
29
|
-
children = _ref.children
|
|
29
|
+
children = _ref.children,
|
|
30
|
+
_ref$fetchPriority = _ref.fetchPriority,
|
|
31
|
+
fetchPriority = _ref$fetchPriority === undefined ? 'auto' : _ref$fetchPriority;
|
|
30
32
|
|
|
31
33
|
var classes = useStyles();
|
|
32
34
|
return React.createElement(
|
|
@@ -36,7 +38,8 @@ var Logo = function Logo(_ref) {
|
|
|
36
38
|
className: cx(classes.logo, classes.alternativeBrowserLogo),
|
|
37
39
|
style: { maxHeight: maxHeight },
|
|
38
40
|
src: logo,
|
|
39
|
-
alt: alt
|
|
41
|
+
alt: alt,
|
|
42
|
+
fetchPriority: fetchPriority
|
|
40
43
|
}),
|
|
41
44
|
children
|
|
42
45
|
);
|
|
@@ -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;
|
package/lib/Logo/Logo.js
CHANGED
|
@@ -43,7 +43,9 @@ var Logo = function Logo(_ref) {
|
|
|
43
43
|
alt = _ref$alt === undefined ? 'logo' : _ref$alt,
|
|
44
44
|
_ref$maxHeight = _ref.maxHeight,
|
|
45
45
|
maxHeight = _ref$maxHeight === undefined ? 150 : _ref$maxHeight,
|
|
46
|
-
children = _ref.children
|
|
46
|
+
children = _ref.children,
|
|
47
|
+
_ref$fetchPriority = _ref.fetchPriority,
|
|
48
|
+
fetchPriority = _ref$fetchPriority === undefined ? 'auto' : _ref$fetchPriority;
|
|
47
49
|
|
|
48
50
|
var classes = useStyles();
|
|
49
51
|
return _react2.default.createElement(
|
|
@@ -53,7 +55,8 @@ var Logo = function Logo(_ref) {
|
|
|
53
55
|
className: (0, _classnames2.default)(classes.logo, classes.alternativeBrowserLogo),
|
|
54
56
|
style: { maxHeight: maxHeight },
|
|
55
57
|
src: logo,
|
|
56
|
-
alt: alt
|
|
58
|
+
alt: alt,
|
|
59
|
+
fetchPriority: fetchPriority
|
|
57
60
|
}),
|
|
58
61
|
children
|
|
59
62
|
);
|