@sis-cc/dotstatsuite-visions 12.32.0 → 12.34.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 +24 -4
- package/es/CollapseButtons/Item.js +7 -0
- package/es/DynamicDrawer/DynamicDrawer.js +52 -39
- package/es/Logo/Logo.js +1 -1
- package/es/Spotlight/Spotlight.js +0 -1
- package/es/theme.js +9 -9
- package/lib/CollapseButtons/CollapseButtons.js +27 -4
- package/lib/CollapseButtons/Item.js +7 -0
- package/lib/DynamicDrawer/DynamicDrawer.js +52 -39
- package/lib/Logo/Logo.js +1 -1
- package/lib/Spotlight/Spotlight.js +0 -1
- package/lib/theme.js +9 -9
- package/package.json +1 -1
- package/umd/@sis-cc/dotstatsuite-visions.js +2490 -2180
- package/umd/@sis-cc/dotstatsuite-visions.min.js +22 -22
- package/umd/@sis-cc/dotstatsuite-visions.min.js.map +1 -1
|
@@ -2,6 +2,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
|
|
|
2
2
|
|
|
3
3
|
import React, { useState, useEffect } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
+
import cx from 'classnames';
|
|
5
6
|
import * as R from 'ramda';
|
|
6
7
|
import makeStyles from '@mui/styles/makeStyles';
|
|
7
8
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
@@ -15,15 +16,25 @@ import Paper from './Paper';
|
|
|
15
16
|
export var MAX_COLUMNS = 12;
|
|
16
17
|
export var COLUMNS = [12, 12, 6, 4, 3, 3, 2, 2, 2, 2, 2, 2, 1];
|
|
17
18
|
|
|
18
|
-
var useStyles = makeStyles(function () {
|
|
19
|
+
var useStyles = makeStyles(function (theme) {
|
|
19
20
|
return {
|
|
20
21
|
collapseContainer: {
|
|
21
22
|
width: '100%'
|
|
23
|
+
},
|
|
24
|
+
container: {
|
|
25
|
+
'&:focus': {
|
|
26
|
+
outlineColor: theme.palette.highlight.hl1,
|
|
27
|
+
outlineWidth: 2,
|
|
28
|
+
outlineStyle: 'auto',
|
|
29
|
+
paddingBottom: 16
|
|
30
|
+
}
|
|
22
31
|
}
|
|
23
32
|
};
|
|
24
33
|
});
|
|
25
34
|
|
|
26
35
|
var CollapseButtons = function CollapseButtons(props) {
|
|
36
|
+
var _cx;
|
|
37
|
+
|
|
27
38
|
var _props$items = props.items,
|
|
28
39
|
items = _props$items === undefined ? [] : _props$items,
|
|
29
40
|
_props$action = props.action,
|
|
@@ -43,7 +54,8 @@ var CollapseButtons = function CollapseButtons(props) {
|
|
|
43
54
|
_props$textTransform = props.textTransform,
|
|
44
55
|
textTransform = _props$textTransform === undefined ? 'none' : _props$textTransform,
|
|
45
56
|
_props$labelAccessor = props.labelAccessor,
|
|
46
|
-
labelAccessor = _props$labelAccessor === undefined ? R.prop('label') : _props$labelAccessor
|
|
57
|
+
labelAccessor = _props$labelAccessor === undefined ? R.prop('label') : _props$labelAccessor,
|
|
58
|
+
accessibility = props.accessibility;
|
|
47
59
|
|
|
48
60
|
|
|
49
61
|
var classes = useStyles();
|
|
@@ -76,7 +88,14 @@ var CollapseButtons = function CollapseButtons(props) {
|
|
|
76
88
|
|
|
77
89
|
return React.createElement(
|
|
78
90
|
Grid,
|
|
79
|
-
{
|
|
91
|
+
{
|
|
92
|
+
container: true,
|
|
93
|
+
spacing: 2,
|
|
94
|
+
'data-testid': testId,
|
|
95
|
+
justifyContent: justify,
|
|
96
|
+
className: cx((_cx = {}, _cx[classes.container] = accessibility, _cx)),
|
|
97
|
+
tabIndex: 0
|
|
98
|
+
},
|
|
80
99
|
R.map(function (_ref) {
|
|
81
100
|
var id = _ref.id,
|
|
82
101
|
label = _ref.label,
|
|
@@ -164,7 +183,8 @@ CollapseButtons.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
164
183
|
gridButtonsProps: PropTypes.object,
|
|
165
184
|
justify: PropTypes.string,
|
|
166
185
|
textTransform: PropTypes.string,
|
|
167
|
-
labelAccessor: PropTypes.func
|
|
186
|
+
labelAccessor: PropTypes.func,
|
|
187
|
+
accessibility: PropTypes.bool
|
|
168
188
|
} : {};
|
|
169
189
|
|
|
170
190
|
export default CollapseButtons;
|
|
@@ -106,6 +106,13 @@ var Item = function Item(_ref) {
|
|
|
106
106
|
action(parentId, id);
|
|
107
107
|
e.stopPropagation();
|
|
108
108
|
},
|
|
109
|
+
onKeyDown: function onKeyDown(e) {
|
|
110
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
111
|
+
if (R.not(R.is(Function)(action))) return;
|
|
112
|
+
action(parentId, id);
|
|
113
|
+
e.stopPropagation();
|
|
114
|
+
}
|
|
115
|
+
},
|
|
109
116
|
tabIndex: 0,
|
|
110
117
|
underline: 'none',
|
|
111
118
|
style: { display: 'list-item' }
|
|
@@ -49,6 +49,21 @@ var useStyles = makeStyles(function (theme) {
|
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
});
|
|
52
|
+
var getCounter = function getCounter(items, tagAccessor) {
|
|
53
|
+
var selectedItemsIds = R.reduce(function (acc, item) {
|
|
54
|
+
if (R.prop('isSelected', item)) {
|
|
55
|
+
return R.append(item.id, acc);
|
|
56
|
+
}
|
|
57
|
+
return acc;
|
|
58
|
+
}, [], items);
|
|
59
|
+
var itemsIds = R.pluck('id', items);
|
|
60
|
+
var count = R.pipe(R.uniq, R.length)(selectedItemsIds);
|
|
61
|
+
var total = R.pipe(R.uniq, R.length)(itemsIds);
|
|
62
|
+
if (R.is(Function, tagAccessor)) {
|
|
63
|
+
return tagAccessor(count, total);
|
|
64
|
+
}
|
|
65
|
+
return count + '/' + total;
|
|
66
|
+
};
|
|
52
67
|
|
|
53
68
|
var TabPanel = function TabPanel(props) {
|
|
54
69
|
var children = props.children,
|
|
@@ -61,18 +76,19 @@ var TabPanel = function TabPanel(props) {
|
|
|
61
76
|
setOpen = props.setOpen,
|
|
62
77
|
labelRenderer = props.labelRenderer,
|
|
63
78
|
_props$styles = props.styles,
|
|
64
|
-
styles = _props$styles === undefined ? {} : _props$styles
|
|
79
|
+
styles = _props$styles === undefined ? {} : _props$styles,
|
|
80
|
+
other = _objectWithoutProperties(props, ['children', 'open', 'item', 'classes', 'labels', 'onClose', 'isNarrow', 'setOpen', 'labelRenderer', 'styles']);
|
|
65
81
|
|
|
66
82
|
return React.createElement(
|
|
67
83
|
'div',
|
|
68
|
-
{
|
|
84
|
+
_extends({
|
|
69
85
|
role: 'tabpanel',
|
|
70
86
|
hidden: !open,
|
|
71
87
|
id: 'vertical-tabpanel-' + item.index,
|
|
72
88
|
'aria-labelledby': 'vertical-tab-' + item.index,
|
|
73
89
|
className: isNarrow ? classes.tabPanelNarrow : classes.tabPanel,
|
|
74
90
|
style: styles
|
|
75
|
-
},
|
|
91
|
+
}, other),
|
|
76
92
|
open && React.createElement(
|
|
77
93
|
Box,
|
|
78
94
|
{ sx: { p: 3 } },
|
|
@@ -152,13 +168,21 @@ TabPanel.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
152
168
|
styles: PropTypes.object
|
|
153
169
|
} : {};
|
|
154
170
|
|
|
155
|
-
var PaperComponent = function
|
|
171
|
+
var PaperComponent = React.forwardRef(function (_ref, ref) {
|
|
156
172
|
var _cx;
|
|
157
173
|
|
|
174
|
+
var label = _ref.label,
|
|
175
|
+
selected = _ref.selected,
|
|
176
|
+
item = _ref.item,
|
|
177
|
+
tagAccessor = _ref.tagAccessor,
|
|
178
|
+
tagValueLabel = _ref.tagValueLabel,
|
|
179
|
+
rest = _objectWithoutProperties(_ref, ['label', 'selected', 'item', 'tagAccessor', 'tagValueLabel']);
|
|
180
|
+
|
|
181
|
+
var Chip = R.isNil(item.tag) ? InternalTag : item.tag;
|
|
158
182
|
var classes = useStyles();
|
|
159
183
|
return React.createElement(
|
|
160
184
|
Paper,
|
|
161
|
-
|
|
185
|
+
_extends({}, rest, { ref: ref }),
|
|
162
186
|
React.createElement(
|
|
163
187
|
Box,
|
|
164
188
|
{ sx: { display: 'flex', justifyContent: 'space-between', width: '100%' } },
|
|
@@ -167,19 +191,25 @@ var PaperComponent = function PaperComponent(props) {
|
|
|
167
191
|
{
|
|
168
192
|
noWrap: true,
|
|
169
193
|
variant: 'body2',
|
|
170
|
-
title:
|
|
171
|
-
className: cx(classes.label, (_cx = {}, _cx[classes.labelSelected] =
|
|
194
|
+
title: label,
|
|
195
|
+
className: cx(classes.label, (_cx = {}, _cx[classes.labelSelected] = selected, _cx))
|
|
172
196
|
},
|
|
173
|
-
|
|
197
|
+
label
|
|
174
198
|
),
|
|
175
|
-
|
|
199
|
+
R.isNil(item.tag) ? React.createElement(
|
|
200
|
+
Chip,
|
|
201
|
+
{ items: item.values, tagValueLabel: tagValueLabel },
|
|
202
|
+
getCounter(item.values, tagAccessor)
|
|
203
|
+
) : item.tag
|
|
176
204
|
)
|
|
177
205
|
);
|
|
178
|
-
};
|
|
206
|
+
});
|
|
179
207
|
PaperComponent.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
180
208
|
label: PropTypes.string,
|
|
181
|
-
|
|
182
|
-
|
|
209
|
+
selected: PropTypes.bool,
|
|
210
|
+
item: PropTypes.object,
|
|
211
|
+
tagAccessor: PropTypes.func,
|
|
212
|
+
tagValueLabel: PropTypes.func
|
|
183
213
|
} : {};
|
|
184
214
|
|
|
185
215
|
var DynamicDrawer = function DynamicDrawer(props) {
|
|
@@ -201,22 +231,6 @@ var DynamicDrawer = function DynamicDrawer(props) {
|
|
|
201
231
|
allSelection = _useState4[0],
|
|
202
232
|
setAllSelection = _useState4[1];
|
|
203
233
|
|
|
204
|
-
var getCounter = function getCounter(items, tagAccessor) {
|
|
205
|
-
var selectedItemsIds = R.reduce(function (acc, item) {
|
|
206
|
-
if (R.prop('isSelected', item)) {
|
|
207
|
-
return R.append(item.id, acc);
|
|
208
|
-
}
|
|
209
|
-
return acc;
|
|
210
|
-
}, [], items);
|
|
211
|
-
var itemsIds = R.pluck('id', items);
|
|
212
|
-
var count = R.pipe(R.uniq, R.length)(selectedItemsIds);
|
|
213
|
-
var total = R.pipe(R.uniq, R.length)(itemsIds);
|
|
214
|
-
if (R.is(Function, tagAccessor)) {
|
|
215
|
-
return tagAccessor(count, total);
|
|
216
|
-
}
|
|
217
|
-
return count + '/' + total;
|
|
218
|
-
};
|
|
219
|
-
|
|
220
234
|
var list = props.list,
|
|
221
235
|
labelRenderer = props.labelRenderer,
|
|
222
236
|
onClick = props.onClick,
|
|
@@ -328,24 +342,23 @@ var DynamicDrawer = function DynamicDrawer(props) {
|
|
|
328
342
|
R.map(function (item) {
|
|
329
343
|
var _cx2;
|
|
330
344
|
|
|
331
|
-
var Chip = R.isNil(item.tag) ? InternalTag : item.tag;
|
|
332
345
|
var tagValueLabel = R.isNil(item.tag) && getCounter(item.values, tagAriaLabel);
|
|
333
346
|
|
|
334
347
|
return React.createElement(Tab, {
|
|
335
348
|
key: item.id,
|
|
336
349
|
id: filter.id,
|
|
337
350
|
'data-testid': item.id + '-tab',
|
|
338
|
-
component: function
|
|
339
|
-
return PaperComponent
|
|
351
|
+
component: React.forwardRef(function TabPaper(tabProps, ref) {
|
|
352
|
+
return React.createElement(PaperComponent, _extends({
|
|
353
|
+
ref: ref
|
|
354
|
+
}, tabProps, {
|
|
340
355
|
label: labelRenderer(item),
|
|
341
356
|
selected: selectedId === item.id,
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
}, props));
|
|
348
|
-
},
|
|
357
|
+
item: item,
|
|
358
|
+
tagAccessor: tagAccessor,
|
|
359
|
+
tagValueLabel: tagValueLabel
|
|
360
|
+
}));
|
|
361
|
+
}),
|
|
349
362
|
label: labelRenderer(item),
|
|
350
363
|
'aria-label': labelRenderer(item),
|
|
351
364
|
value: item,
|
|
@@ -430,7 +443,7 @@ DynamicDrawer.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
430
443
|
tagAriaLabel: PropTypes.func,
|
|
431
444
|
handleChangePanel: PropTypes.func,
|
|
432
445
|
onClosePanel: PropTypes.func,
|
|
433
|
-
displayChildren: PropTypes.
|
|
446
|
+
displayChildren: PropTypes.bool,
|
|
434
447
|
labels: PropTypes.shape({
|
|
435
448
|
placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
|
|
436
449
|
disableItemLabel: PropTypes.string,
|
package/es/Logo/Logo.js
CHANGED
|
@@ -31,7 +31,7 @@ var Logo = function Logo(_ref) {
|
|
|
31
31
|
var classes = useStyles();
|
|
32
32
|
return React.createElement(
|
|
33
33
|
'span',
|
|
34
|
-
{ className: classes.container, role: '
|
|
34
|
+
{ className: classes.container, role: 'presentation' },
|
|
35
35
|
React.createElement('img', {
|
|
36
36
|
className: cx(classes.logo, classes.alternativeBrowserLogo),
|
|
37
37
|
style: { maxHeight: maxHeight },
|
|
@@ -102,7 +102,6 @@ var Spotlight = function Spotlight(_ref) {
|
|
|
102
102
|
R.gt(size(R.prop('fields', spotlight)), 1) ? React.createElement(
|
|
103
103
|
Fragment,
|
|
104
104
|
null,
|
|
105
|
-
React.createElement(Divider, { className: classes.divider, 'aria-hidden': 'true' }),
|
|
106
105
|
React.createElement(Field, {
|
|
107
106
|
spotlight: spotlight,
|
|
108
107
|
onChangeField: onChangeField,
|
package/es/theme.js
CHANGED
|
@@ -55,9 +55,9 @@ export var sisccTheme = function sisccTheme(_ref) {
|
|
|
55
55
|
},
|
|
56
56
|
styleOverrides: {
|
|
57
57
|
root: _extends({
|
|
58
|
-
'&:focus': {
|
|
59
|
-
outline: 'none'
|
|
60
|
-
}
|
|
58
|
+
'&:focus': _extends({
|
|
59
|
+
outline: !isA11y && 'none'
|
|
60
|
+
}, isA11y && focus)
|
|
61
61
|
}, buttonBaseFocus)
|
|
62
62
|
}
|
|
63
63
|
},
|
|
@@ -103,9 +103,9 @@ export var sisccTheme = function sisccTheme(_ref) {
|
|
|
103
103
|
styleOverrides: {
|
|
104
104
|
root: {
|
|
105
105
|
textTransform: 'none',
|
|
106
|
-
'&:focus': {
|
|
107
|
-
outline: 'none'
|
|
108
|
-
}
|
|
106
|
+
'&:focus': _extends({
|
|
107
|
+
outline: !isA11y && 'none'
|
|
108
|
+
}, isA11y && focus)
|
|
109
109
|
},
|
|
110
110
|
textPrimary: {
|
|
111
111
|
'&:hover': {
|
|
@@ -142,14 +142,14 @@ export var sisccTheme = function sisccTheme(_ref) {
|
|
|
142
142
|
MuiOutlinedInput: {
|
|
143
143
|
styleOverrides: {
|
|
144
144
|
root: {
|
|
145
|
-
'&.Mui-
|
|
145
|
+
'&.Mui-focusVisible': isA11y && focus
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
},
|
|
149
149
|
MuiTypography: {
|
|
150
150
|
styleOverrides: {
|
|
151
151
|
root: {
|
|
152
|
-
'
|
|
152
|
+
'&:focus': isA11y && focus
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
},
|
|
@@ -164,7 +164,7 @@ export var sisccTheme = function sisccTheme(_ref) {
|
|
|
164
164
|
color: outerPalette.primaryLight || innerPalette.primaryLight,
|
|
165
165
|
textDecoration: 'underline'
|
|
166
166
|
},
|
|
167
|
-
'
|
|
167
|
+
'&:focus': isA11y && focus
|
|
168
168
|
},
|
|
169
169
|
button: {
|
|
170
170
|
'&:focus': isA11y && focus
|
|
@@ -13,6 +13,10 @@ var _propTypes = require('prop-types');
|
|
|
13
13
|
|
|
14
14
|
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
15
15
|
|
|
16
|
+
var _classnames = require('classnames');
|
|
17
|
+
|
|
18
|
+
var _classnames2 = _interopRequireDefault(_classnames);
|
|
19
|
+
|
|
16
20
|
var _ramda = require('ramda');
|
|
17
21
|
|
|
18
22
|
var R = _interopRequireWildcard(_ramda);
|
|
@@ -54,15 +58,25 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
54
58
|
var MAX_COLUMNS = exports.MAX_COLUMNS = 12;
|
|
55
59
|
var COLUMNS = exports.COLUMNS = [12, 12, 6, 4, 3, 3, 2, 2, 2, 2, 2, 2, 1];
|
|
56
60
|
|
|
57
|
-
var useStyles = (0, _makeStyles2.default)(function () {
|
|
61
|
+
var useStyles = (0, _makeStyles2.default)(function (theme) {
|
|
58
62
|
return {
|
|
59
63
|
collapseContainer: {
|
|
60
64
|
width: '100%'
|
|
65
|
+
},
|
|
66
|
+
container: {
|
|
67
|
+
'&:focus': {
|
|
68
|
+
outlineColor: theme.palette.highlight.hl1,
|
|
69
|
+
outlineWidth: 2,
|
|
70
|
+
outlineStyle: 'auto',
|
|
71
|
+
paddingBottom: 16
|
|
72
|
+
}
|
|
61
73
|
}
|
|
62
74
|
};
|
|
63
75
|
});
|
|
64
76
|
|
|
65
77
|
var CollapseButtons = function CollapseButtons(props) {
|
|
78
|
+
var _cx;
|
|
79
|
+
|
|
66
80
|
var _props$items = props.items,
|
|
67
81
|
items = _props$items === undefined ? [] : _props$items,
|
|
68
82
|
_props$action = props.action,
|
|
@@ -82,7 +96,8 @@ var CollapseButtons = function CollapseButtons(props) {
|
|
|
82
96
|
_props$textTransform = props.textTransform,
|
|
83
97
|
textTransform = _props$textTransform === undefined ? 'none' : _props$textTransform,
|
|
84
98
|
_props$labelAccessor = props.labelAccessor,
|
|
85
|
-
labelAccessor = _props$labelAccessor === undefined ? R.prop('label') : _props$labelAccessor
|
|
99
|
+
labelAccessor = _props$labelAccessor === undefined ? R.prop('label') : _props$labelAccessor,
|
|
100
|
+
accessibility = props.accessibility;
|
|
86
101
|
|
|
87
102
|
|
|
88
103
|
var classes = useStyles();
|
|
@@ -115,7 +130,14 @@ var CollapseButtons = function CollapseButtons(props) {
|
|
|
115
130
|
|
|
116
131
|
return _react2.default.createElement(
|
|
117
132
|
_Grid2.default,
|
|
118
|
-
{
|
|
133
|
+
{
|
|
134
|
+
container: true,
|
|
135
|
+
spacing: 2,
|
|
136
|
+
'data-testid': testId,
|
|
137
|
+
justifyContent: justify,
|
|
138
|
+
className: (0, _classnames2.default)((_cx = {}, _cx[classes.container] = accessibility, _cx)),
|
|
139
|
+
tabIndex: 0
|
|
140
|
+
},
|
|
119
141
|
R.map(function (_ref) {
|
|
120
142
|
var id = _ref.id,
|
|
121
143
|
label = _ref.label,
|
|
@@ -203,7 +225,8 @@ CollapseButtons.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
203
225
|
gridButtonsProps: _propTypes2.default.object,
|
|
204
226
|
justify: _propTypes2.default.string,
|
|
205
227
|
textTransform: _propTypes2.default.string,
|
|
206
|
-
labelAccessor: _propTypes2.default.func
|
|
228
|
+
labelAccessor: _propTypes2.default.func,
|
|
229
|
+
accessibility: _propTypes2.default.bool
|
|
207
230
|
} : {};
|
|
208
231
|
|
|
209
232
|
exports.default = CollapseButtons;
|
|
@@ -137,6 +137,13 @@ var Item = function Item(_ref) {
|
|
|
137
137
|
action(parentId, id);
|
|
138
138
|
e.stopPropagation();
|
|
139
139
|
},
|
|
140
|
+
onKeyDown: function onKeyDown(e) {
|
|
141
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
142
|
+
if (R.not(R.is(Function)(action))) return;
|
|
143
|
+
action(parentId, id);
|
|
144
|
+
e.stopPropagation();
|
|
145
|
+
}
|
|
146
|
+
},
|
|
140
147
|
tabIndex: 0,
|
|
141
148
|
underline: 'none',
|
|
142
149
|
style: { display: 'list-item' }
|
|
@@ -99,6 +99,21 @@ var useStyles = (0, _makeStyles2.default)(function (theme) {
|
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
});
|
|
102
|
+
var getCounter = function getCounter(items, tagAccessor) {
|
|
103
|
+
var selectedItemsIds = R.reduce(function (acc, item) {
|
|
104
|
+
if (R.prop('isSelected', item)) {
|
|
105
|
+
return R.append(item.id, acc);
|
|
106
|
+
}
|
|
107
|
+
return acc;
|
|
108
|
+
}, [], items);
|
|
109
|
+
var itemsIds = R.pluck('id', items);
|
|
110
|
+
var count = R.pipe(R.uniq, R.length)(selectedItemsIds);
|
|
111
|
+
var total = R.pipe(R.uniq, R.length)(itemsIds);
|
|
112
|
+
if (R.is(Function, tagAccessor)) {
|
|
113
|
+
return tagAccessor(count, total);
|
|
114
|
+
}
|
|
115
|
+
return count + '/' + total;
|
|
116
|
+
};
|
|
102
117
|
|
|
103
118
|
var TabPanel = function TabPanel(props) {
|
|
104
119
|
var children = props.children,
|
|
@@ -111,18 +126,19 @@ var TabPanel = function TabPanel(props) {
|
|
|
111
126
|
setOpen = props.setOpen,
|
|
112
127
|
labelRenderer = props.labelRenderer,
|
|
113
128
|
_props$styles = props.styles,
|
|
114
|
-
styles = _props$styles === undefined ? {} : _props$styles
|
|
129
|
+
styles = _props$styles === undefined ? {} : _props$styles,
|
|
130
|
+
other = _objectWithoutProperties(props, ['children', 'open', 'item', 'classes', 'labels', 'onClose', 'isNarrow', 'setOpen', 'labelRenderer', 'styles']);
|
|
115
131
|
|
|
116
132
|
return _react2.default.createElement(
|
|
117
133
|
'div',
|
|
118
|
-
{
|
|
134
|
+
_extends({
|
|
119
135
|
role: 'tabpanel',
|
|
120
136
|
hidden: !open,
|
|
121
137
|
id: 'vertical-tabpanel-' + item.index,
|
|
122
138
|
'aria-labelledby': 'vertical-tab-' + item.index,
|
|
123
139
|
className: isNarrow ? classes.tabPanelNarrow : classes.tabPanel,
|
|
124
140
|
style: styles
|
|
125
|
-
},
|
|
141
|
+
}, other),
|
|
126
142
|
open && _react2.default.createElement(
|
|
127
143
|
_Box2.default,
|
|
128
144
|
{ sx: { p: 3 } },
|
|
@@ -202,13 +218,21 @@ TabPanel.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
202
218
|
styles: _propTypes2.default.object
|
|
203
219
|
} : {};
|
|
204
220
|
|
|
205
|
-
var PaperComponent = function
|
|
221
|
+
var PaperComponent = _react2.default.forwardRef(function (_ref, ref) {
|
|
206
222
|
var _cx;
|
|
207
223
|
|
|
224
|
+
var label = _ref.label,
|
|
225
|
+
selected = _ref.selected,
|
|
226
|
+
item = _ref.item,
|
|
227
|
+
tagAccessor = _ref.tagAccessor,
|
|
228
|
+
tagValueLabel = _ref.tagValueLabel,
|
|
229
|
+
rest = _objectWithoutProperties(_ref, ['label', 'selected', 'item', 'tagAccessor', 'tagValueLabel']);
|
|
230
|
+
|
|
231
|
+
var Chip = R.isNil(item.tag) ? _.Tag : item.tag;
|
|
208
232
|
var classes = useStyles();
|
|
209
233
|
return _react2.default.createElement(
|
|
210
234
|
_Paper2.default,
|
|
211
|
-
|
|
235
|
+
_extends({}, rest, { ref: ref }),
|
|
212
236
|
_react2.default.createElement(
|
|
213
237
|
_Box2.default,
|
|
214
238
|
{ sx: { display: 'flex', justifyContent: 'space-between', width: '100%' } },
|
|
@@ -217,19 +241,25 @@ var PaperComponent = function PaperComponent(props) {
|
|
|
217
241
|
{
|
|
218
242
|
noWrap: true,
|
|
219
243
|
variant: 'body2',
|
|
220
|
-
title:
|
|
221
|
-
className: (0, _classnames2.default)(classes.label, (_cx = {}, _cx[classes.labelSelected] =
|
|
244
|
+
title: label,
|
|
245
|
+
className: (0, _classnames2.default)(classes.label, (_cx = {}, _cx[classes.labelSelected] = selected, _cx))
|
|
222
246
|
},
|
|
223
|
-
|
|
247
|
+
label
|
|
224
248
|
),
|
|
225
|
-
|
|
249
|
+
R.isNil(item.tag) ? _react2.default.createElement(
|
|
250
|
+
Chip,
|
|
251
|
+
{ items: item.values, tagValueLabel: tagValueLabel },
|
|
252
|
+
getCounter(item.values, tagAccessor)
|
|
253
|
+
) : item.tag
|
|
226
254
|
)
|
|
227
255
|
);
|
|
228
|
-
};
|
|
256
|
+
});
|
|
229
257
|
PaperComponent.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
230
258
|
label: _propTypes2.default.string,
|
|
231
|
-
|
|
232
|
-
|
|
259
|
+
selected: _propTypes2.default.bool,
|
|
260
|
+
item: _propTypes2.default.object,
|
|
261
|
+
tagAccessor: _propTypes2.default.func,
|
|
262
|
+
tagValueLabel: _propTypes2.default.func
|
|
233
263
|
} : {};
|
|
234
264
|
|
|
235
265
|
var DynamicDrawer = function DynamicDrawer(props) {
|
|
@@ -251,22 +281,6 @@ var DynamicDrawer = function DynamicDrawer(props) {
|
|
|
251
281
|
allSelection = _useState4[0],
|
|
252
282
|
setAllSelection = _useState4[1];
|
|
253
283
|
|
|
254
|
-
var getCounter = function getCounter(items, tagAccessor) {
|
|
255
|
-
var selectedItemsIds = R.reduce(function (acc, item) {
|
|
256
|
-
if (R.prop('isSelected', item)) {
|
|
257
|
-
return R.append(item.id, acc);
|
|
258
|
-
}
|
|
259
|
-
return acc;
|
|
260
|
-
}, [], items);
|
|
261
|
-
var itemsIds = R.pluck('id', items);
|
|
262
|
-
var count = R.pipe(R.uniq, R.length)(selectedItemsIds);
|
|
263
|
-
var total = R.pipe(R.uniq, R.length)(itemsIds);
|
|
264
|
-
if (R.is(Function, tagAccessor)) {
|
|
265
|
-
return tagAccessor(count, total);
|
|
266
|
-
}
|
|
267
|
-
return count + '/' + total;
|
|
268
|
-
};
|
|
269
|
-
|
|
270
284
|
var list = props.list,
|
|
271
285
|
labelRenderer = props.labelRenderer,
|
|
272
286
|
onClick = props.onClick,
|
|
@@ -378,24 +392,23 @@ var DynamicDrawer = function DynamicDrawer(props) {
|
|
|
378
392
|
R.map(function (item) {
|
|
379
393
|
var _cx2;
|
|
380
394
|
|
|
381
|
-
var Chip = R.isNil(item.tag) ? _.Tag : item.tag;
|
|
382
395
|
var tagValueLabel = R.isNil(item.tag) && getCounter(item.values, tagAriaLabel);
|
|
383
396
|
|
|
384
397
|
return _react2.default.createElement(_Tab2.default, {
|
|
385
398
|
key: item.id,
|
|
386
399
|
id: filter.id,
|
|
387
400
|
'data-testid': item.id + '-tab',
|
|
388
|
-
component: function
|
|
389
|
-
return PaperComponent
|
|
401
|
+
component: _react2.default.forwardRef(function TabPaper(tabProps, ref) {
|
|
402
|
+
return _react2.default.createElement(PaperComponent, _extends({
|
|
403
|
+
ref: ref
|
|
404
|
+
}, tabProps, {
|
|
390
405
|
label: labelRenderer(item),
|
|
391
406
|
selected: selectedId === item.id,
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
}, props));
|
|
398
|
-
},
|
|
407
|
+
item: item,
|
|
408
|
+
tagAccessor: tagAccessor,
|
|
409
|
+
tagValueLabel: tagValueLabel
|
|
410
|
+
}));
|
|
411
|
+
}),
|
|
399
412
|
label: labelRenderer(item),
|
|
400
413
|
'aria-label': labelRenderer(item),
|
|
401
414
|
value: item,
|
|
@@ -480,7 +493,7 @@ DynamicDrawer.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
480
493
|
tagAriaLabel: _propTypes2.default.func,
|
|
481
494
|
handleChangePanel: _propTypes2.default.func,
|
|
482
495
|
onClosePanel: _propTypes2.default.func,
|
|
483
|
-
displayChildren: _propTypes2.default.
|
|
496
|
+
displayChildren: _propTypes2.default.bool,
|
|
484
497
|
labels: _propTypes2.default.shape({
|
|
485
498
|
placeholder: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]),
|
|
486
499
|
disableItemLabel: _propTypes2.default.string,
|
package/lib/Logo/Logo.js
CHANGED
|
@@ -48,7 +48,7 @@ var Logo = function Logo(_ref) {
|
|
|
48
48
|
var classes = useStyles();
|
|
49
49
|
return _react2.default.createElement(
|
|
50
50
|
'span',
|
|
51
|
-
{ className: classes.container, role: '
|
|
51
|
+
{ className: classes.container, role: 'presentation' },
|
|
52
52
|
_react2.default.createElement('img', {
|
|
53
53
|
className: (0, _classnames2.default)(classes.logo, classes.alternativeBrowserLogo),
|
|
54
54
|
style: { maxHeight: maxHeight },
|
|
@@ -149,7 +149,6 @@ var Spotlight = function Spotlight(_ref) {
|
|
|
149
149
|
R.gt(size(R.prop('fields', spotlight)), 1) ? _react2.default.createElement(
|
|
150
150
|
_react.Fragment,
|
|
151
151
|
null,
|
|
152
|
-
_react2.default.createElement(_Divider2.default, { className: classes.divider, 'aria-hidden': 'true' }),
|
|
153
152
|
_react2.default.createElement(_Fields.Field, {
|
|
154
153
|
spotlight: spotlight,
|
|
155
154
|
onChangeField: onChangeField,
|
package/lib/theme.js
CHANGED
|
@@ -59,9 +59,9 @@ var sisccTheme = exports.sisccTheme = function sisccTheme(_ref) {
|
|
|
59
59
|
},
|
|
60
60
|
styleOverrides: {
|
|
61
61
|
root: _extends({
|
|
62
|
-
'&:focus': {
|
|
63
|
-
outline: 'none'
|
|
64
|
-
}
|
|
62
|
+
'&:focus': _extends({
|
|
63
|
+
outline: !isA11y && 'none'
|
|
64
|
+
}, isA11y && focus)
|
|
65
65
|
}, buttonBaseFocus)
|
|
66
66
|
}
|
|
67
67
|
},
|
|
@@ -107,9 +107,9 @@ var sisccTheme = exports.sisccTheme = function sisccTheme(_ref) {
|
|
|
107
107
|
styleOverrides: {
|
|
108
108
|
root: {
|
|
109
109
|
textTransform: 'none',
|
|
110
|
-
'&:focus': {
|
|
111
|
-
outline: 'none'
|
|
112
|
-
}
|
|
110
|
+
'&:focus': _extends({
|
|
111
|
+
outline: !isA11y && 'none'
|
|
112
|
+
}, isA11y && focus)
|
|
113
113
|
},
|
|
114
114
|
textPrimary: {
|
|
115
115
|
'&:hover': {
|
|
@@ -146,14 +146,14 @@ var sisccTheme = exports.sisccTheme = function sisccTheme(_ref) {
|
|
|
146
146
|
MuiOutlinedInput: {
|
|
147
147
|
styleOverrides: {
|
|
148
148
|
root: {
|
|
149
|
-
'&.Mui-
|
|
149
|
+
'&.Mui-focusVisible': isA11y && focus
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
153
|
MuiTypography: {
|
|
154
154
|
styleOverrides: {
|
|
155
155
|
root: {
|
|
156
|
-
'
|
|
156
|
+
'&:focus': isA11y && focus
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
},
|
|
@@ -168,7 +168,7 @@ var sisccTheme = exports.sisccTheme = function sisccTheme(_ref) {
|
|
|
168
168
|
color: outerPalette.primaryLight || innerPalette.primaryLight,
|
|
169
169
|
textDecoration: 'underline'
|
|
170
170
|
},
|
|
171
|
-
'
|
|
171
|
+
'&:focus': isA11y && focus
|
|
172
172
|
},
|
|
173
173
|
button: {
|
|
174
174
|
'&:focus': isA11y && focus
|