@sis-cc/dotstatsuite-visions 7.1.0 → 7.3.1
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/CollapsibleTree/CollapsibleTree.js +1 -1
- package/es/DataHeader/DataHeader.js +19 -31
- package/es/PeriodPicker/PeriodPicker.js +3 -0
- package/es/PeriodPicker/lib.js +7 -8
- package/es/Select/Select.js +44 -8
- package/es/TableHtml5/TableHtml5.js +4 -8
- package/es/TableHtml5/cell.js +3 -4
- package/es/TableHtml5/section.js +5 -13
- package/es/TableHtml5/sectionHeader.js +9 -13
- package/es/TableHtml5/subHeader.js +3 -10
- package/lib/CollapsibleTree/CollapsibleTree.js +1 -1
- package/lib/DataHeader/DataHeader.js +19 -34
- package/lib/PeriodPicker/PeriodPicker.js +3 -0
- package/lib/PeriodPicker/lib.js +8 -9
- package/lib/Select/Select.js +44 -7
- package/lib/TableHtml5/TableHtml5.js +4 -8
- package/lib/TableHtml5/cell.js +3 -7
- package/lib/TableHtml5/section.js +5 -16
- package/lib/TableHtml5/sectionHeader.js +9 -16
- package/lib/TableHtml5/subHeader.js +3 -13
- package/package.json +2 -1
- package/es/InfoIcon/InfoIcon.js +0 -37
- package/es/TableHtml5/sideIcon.js +0 -26
- package/lib/InfoIcon/InfoIcon.js +0 -56
- package/lib/TableHtml5/sideIcon.js +0 -46
|
@@ -78,7 +78,7 @@ var CollapsibleTree = function CollapsibleTree(_ref) {
|
|
|
78
78
|
{
|
|
79
79
|
'aria-label': buttonAllOpenLabel,
|
|
80
80
|
color: 'primary',
|
|
81
|
-
endIcon: isAllOpen ? React.createElement(
|
|
81
|
+
endIcon: isAllOpen ? React.createElement(KeyboardArrowUpIcon, { color: 'primary' }) : React.createElement(KeyboardArrowDownIcon, { color: 'primary' }),
|
|
82
82
|
onClick: function onClick() {
|
|
83
83
|
return handleCollapse(isAllOpen);
|
|
84
84
|
}
|
|
@@ -15,7 +15,6 @@ import Flags from './Flags';
|
|
|
15
15
|
import TooltipHeader from './TooltipHeader';
|
|
16
16
|
import { getReducedContent } from './utils';
|
|
17
17
|
import { Tooltip, Warning as WarningIcon } from '../';
|
|
18
|
-
import InfoIcon from '../InfoIcon/InfoIcon';
|
|
19
18
|
|
|
20
19
|
var useStyles = makeStyles(function (theme) {
|
|
21
20
|
return {
|
|
@@ -94,37 +93,22 @@ var useStyles = makeStyles(function (theme) {
|
|
|
94
93
|
padding: 0,
|
|
95
94
|
marginLeft: 20,
|
|
96
95
|
maxWidth: 270
|
|
97
|
-
}, theme.typography.body1)
|
|
96
|
+
}, theme.typography.body1),
|
|
97
|
+
sideIconContainer: {
|
|
98
|
+
marginLeft: '10px'
|
|
99
|
+
}
|
|
98
100
|
};
|
|
99
101
|
});
|
|
100
102
|
|
|
101
|
-
var
|
|
102
|
-
var
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return sideToggle(sideProps);
|
|
111
|
-
}, isSelected: isSelected });
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
SideIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
115
|
-
sideProps: PropTypes.object,
|
|
116
|
-
sideToggle: PropTypes.func
|
|
117
|
-
} : {};
|
|
118
|
-
|
|
119
|
-
var DataHeader = function DataHeader(_ref5) {
|
|
120
|
-
var children = _ref5.children,
|
|
121
|
-
title = _ref5.title,
|
|
122
|
-
_ref5$subtitle = _ref5.subtitle,
|
|
123
|
-
subtitle = _ref5$subtitle === undefined ? [] : _ref5$subtitle,
|
|
124
|
-
uprs = _ref5.uprs,
|
|
125
|
-
disclaimer = _ref5.disclaimer,
|
|
126
|
-
sideProps = _ref5.sideProps,
|
|
127
|
-
sideToggle = _ref5.sideToggle;
|
|
103
|
+
var DataHeader = function DataHeader(_ref4) {
|
|
104
|
+
var children = _ref4.children,
|
|
105
|
+
title = _ref4.title,
|
|
106
|
+
_ref4$subtitle = _ref4.subtitle,
|
|
107
|
+
subtitle = _ref4$subtitle === undefined ? [] : _ref4$subtitle,
|
|
108
|
+
uprs = _ref4.uprs,
|
|
109
|
+
disclaimer = _ref4.disclaimer,
|
|
110
|
+
sideProps = _ref4.sideProps,
|
|
111
|
+
SideIcon = _ref4.SideIcon;
|
|
128
112
|
|
|
129
113
|
var target = React.useRef(null);
|
|
130
114
|
|
|
@@ -154,6 +138,11 @@ var DataHeader = function DataHeader(_ref5) {
|
|
|
154
138
|
Typography,
|
|
155
139
|
{ variant: 'h1', className: classes.title },
|
|
156
140
|
title.label,
|
|
141
|
+
!R.isNil(SideIcon) && React.createElement(
|
|
142
|
+
'span',
|
|
143
|
+
{ className: classes.sideIconContainer },
|
|
144
|
+
React.createElement(SideIcon, { sideProps: sideProps })
|
|
145
|
+
),
|
|
157
146
|
React.createElement(Flags, { classes: classes, content: R.propOr([], 'flags', title) }),
|
|
158
147
|
disclaimer && React.createElement(
|
|
159
148
|
Tooltip,
|
|
@@ -207,7 +196,6 @@ var DataHeader = function DataHeader(_ref5) {
|
|
|
207
196
|
React.createElement(
|
|
208
197
|
'div',
|
|
209
198
|
{ className: classes.children },
|
|
210
|
-
React.createElement(SideIcon, { sideProps: sideProps, sideToggle: sideToggle }),
|
|
211
199
|
R.not(R.isEmpty(reducedContent)) && React.createElement(
|
|
212
200
|
TooltipHeader,
|
|
213
201
|
{ classes: classes, content: reducedContent },
|
|
@@ -245,7 +233,7 @@ DataHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
245
233
|
label: PropTypes.string
|
|
246
234
|
}),
|
|
247
235
|
sideProps: PropTypes.object,
|
|
248
|
-
|
|
236
|
+
SideIcon: PropTypes.func,
|
|
249
237
|
disclaimer: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
250
238
|
children: PropTypes.node
|
|
251
239
|
} : {};
|
|
@@ -24,10 +24,13 @@ var Period = function Period(_ref) {
|
|
|
24
24
|
|
|
25
25
|
var classes = useStyles();
|
|
26
26
|
var frequencies = getFrequencyOptions(availableFrequencies, labels);
|
|
27
|
+
console.log('frequencies', frequencies);
|
|
28
|
+
if (R.isEmpty(frequencies)) return null;
|
|
27
29
|
var frequency = getDefaultFrequency({
|
|
28
30
|
defaultFrequency: defaultFrequency,
|
|
29
31
|
frequencies: R.pluck('value')(frequencies)
|
|
30
32
|
});
|
|
33
|
+
console.log('frequency', frequency);
|
|
31
34
|
var period = R.defaultTo([], _period);
|
|
32
35
|
var boundaries = R.defaultTo([], _boundaries);
|
|
33
36
|
var isPeriodDisabled = R.or(R.any(R.isEmpty)([period, boundaries]), periodDisabled);
|
package/es/PeriodPicker/lib.js
CHANGED
|
@@ -114,11 +114,6 @@ export var getAjustedDate = function getAjustedDate(frequency) {
|
|
|
114
114
|
};
|
|
115
115
|
|
|
116
116
|
export var isValidNumber = R.both(R.is(Number), R.complement(R.equals(NaN)));
|
|
117
|
-
export var getSupportFrequencies = function getSupportFrequencies(availableFrequencies) {
|
|
118
|
-
return R.filter(function (freq) {
|
|
119
|
-
return R.includes(freq)(supportedFrequenciesKey);
|
|
120
|
-
})(availableFrequencies);
|
|
121
|
-
};
|
|
122
117
|
export var getDefaultFrequency = function getDefaultFrequency(_ref4) {
|
|
123
118
|
var defaultFrequency = _ref4.defaultFrequency,
|
|
124
119
|
frequencies = _ref4.frequencies;
|
|
@@ -128,10 +123,14 @@ export var getDefaultFrequency = function getDefaultFrequency(_ref4) {
|
|
|
128
123
|
};
|
|
129
124
|
|
|
130
125
|
export var getFrequencyOptions = function getFrequencyOptions(frequencyoptions, frequencyLabels) {
|
|
131
|
-
var availableFrequencies = R.or(R.isEmpty(frequencyoptions), R.isNil(frequencyoptions)) ? [defaultfreq] :
|
|
132
|
-
|
|
133
|
-
|
|
126
|
+
var availableFrequencies = R.or(R.isEmpty(frequencyoptions), R.isNil(frequencyoptions)) ? [defaultfreq] : R.filter(function (freq) {
|
|
127
|
+
return R.includes(freq, supportedFrequenciesKey);
|
|
128
|
+
})(frequencyoptions);
|
|
129
|
+
var options = R.map(function (option) {
|
|
130
|
+
return { value: option, label: R.prop(option, frequencyLabels) };
|
|
134
131
|
})(availableFrequencies);
|
|
132
|
+
if (R.isEmpty(options)) return [{ value: 'A', label: R.propOr('Annual', 'A', frequencyLabels) }];
|
|
133
|
+
return options;
|
|
135
134
|
};
|
|
136
135
|
|
|
137
136
|
export var getLayout = function getLayout(type, range) {
|
package/es/Select/Select.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
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 from 'react';
|
|
3
|
+
import React, { useEffect } from 'react';
|
|
4
4
|
import * as R from 'ramda';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { makeStyles } from '@material-ui/core/styles';
|
|
7
7
|
import TextField from '@material-ui/core/TextField';
|
|
8
8
|
import MenuItem from '@material-ui/core/MenuItem';
|
|
9
|
+
import { Tooltip } from '../';
|
|
9
10
|
|
|
10
11
|
var useStyles = makeStyles(function (theme) {
|
|
11
12
|
return {
|
|
@@ -34,6 +35,15 @@ var Select = function Select(_ref) {
|
|
|
34
35
|
dataTestId = _ref$dataTestId === undefined ? 'select-testid' : _ref$dataTestId;
|
|
35
36
|
|
|
36
37
|
var classes = useStyles();
|
|
38
|
+
var ref = React.useRef(null);
|
|
39
|
+
|
|
40
|
+
var _React$useState = React.useState(false),
|
|
41
|
+
open = _React$useState[0],
|
|
42
|
+
setOpen = _React$useState[1];
|
|
43
|
+
|
|
44
|
+
var _React$useState2 = React.useState(0),
|
|
45
|
+
width = _React$useState2[0],
|
|
46
|
+
setWidth = _React$useState2[1];
|
|
37
47
|
|
|
38
48
|
var handleChange = function handleChange(event) {
|
|
39
49
|
if (R.is(Function)(onChange)) {
|
|
@@ -41,6 +51,12 @@ var Select = function Select(_ref) {
|
|
|
41
51
|
}
|
|
42
52
|
};
|
|
43
53
|
|
|
54
|
+
useEffect(function () {
|
|
55
|
+
if (ref.current && open) {
|
|
56
|
+
setWidth(ref.current.clientWidth);
|
|
57
|
+
}
|
|
58
|
+
}, [ref.current, open]);
|
|
59
|
+
|
|
44
60
|
var getter = function getter(key) {
|
|
45
61
|
return function (accessor) {
|
|
46
62
|
return R.ifElse(R.is(Object), function (item) {
|
|
@@ -49,42 +65,62 @@ var Select = function Select(_ref) {
|
|
|
49
65
|
};
|
|
50
66
|
};
|
|
51
67
|
|
|
68
|
+
var joinByValue = R.innerJoin(function (obj, value) {
|
|
69
|
+
return obj.value === value;
|
|
70
|
+
});
|
|
71
|
+
var labels = R.pluck('label', joinByValue(items, R.is(Array, value) ? value : [value]));
|
|
52
72
|
return React.createElement(
|
|
53
73
|
TextField,
|
|
54
74
|
_extends({
|
|
75
|
+
select: true,
|
|
55
76
|
id: id,
|
|
56
77
|
'data-testid': dataTestId,
|
|
57
78
|
disabled: R.isEmpty(items),
|
|
58
|
-
select: true,
|
|
59
79
|
label: label,
|
|
60
80
|
value: value,
|
|
81
|
+
title: R.join(', ', labels),
|
|
61
82
|
onChange: handleChange,
|
|
62
83
|
variant: 'outlined',
|
|
63
84
|
size: 'small',
|
|
64
85
|
fullWidth: true,
|
|
65
86
|
SelectProps: {
|
|
87
|
+
ref: ref,
|
|
88
|
+
open: open,
|
|
89
|
+
autoWidth: true,
|
|
66
90
|
multiple: isMultiple,
|
|
91
|
+
onOpen: function onOpen() {
|
|
92
|
+
return setOpen(true);
|
|
93
|
+
},
|
|
94
|
+
onClose: function onClose() {
|
|
95
|
+
return setOpen(false);
|
|
96
|
+
},
|
|
67
97
|
classes: { root: classes.root },
|
|
68
98
|
MenuProps: {
|
|
69
99
|
getContentAnchorEl: null,
|
|
70
100
|
anchorOrigin: { vertical: 'bottom', horizontal: 'center' },
|
|
71
101
|
transformOrigin: { vertical: 'top', horizontal: 'center' },
|
|
72
|
-
classes: { paper: classes.paper }
|
|
102
|
+
classes: { paper: classes.paper },
|
|
103
|
+
PaperProps: {
|
|
104
|
+
style: { width: width }
|
|
105
|
+
}
|
|
73
106
|
}
|
|
74
107
|
},
|
|
75
108
|
className: classes.root
|
|
76
109
|
}, textFieldProps),
|
|
77
110
|
R.map(function (item) {
|
|
111
|
+
var value = getter('value')(valueAccessor)(item);
|
|
112
|
+
var label = getter('label')(labelAccessor)(item);
|
|
78
113
|
return React.createElement(
|
|
79
114
|
MenuItem,
|
|
80
115
|
{
|
|
81
|
-
key: optionsKey + '-' +
|
|
82
|
-
|
|
116
|
+
key: optionsKey + '-' + value,
|
|
117
|
+
id: label,
|
|
118
|
+
value: value,
|
|
83
119
|
dense: true,
|
|
84
|
-
|
|
85
|
-
|
|
120
|
+
'aria-label': label,
|
|
121
|
+
title: label
|
|
86
122
|
},
|
|
87
|
-
|
|
123
|
+
label
|
|
88
124
|
);
|
|
89
125
|
})(items)
|
|
90
126
|
);
|
|
@@ -69,8 +69,7 @@ var TableHtml5 = function TableHtml5(_ref) {
|
|
|
69
69
|
cellHandler = _ref.cellHandler,
|
|
70
70
|
activeCellIds = _ref.activeCellIds,
|
|
71
71
|
activeCellHandler = _ref.activeCellHandler,
|
|
72
|
-
|
|
73
|
-
selectedSideCoord = _ref.selectedSideCoord,
|
|
72
|
+
SideIcon = _ref.SideIcon,
|
|
74
73
|
_ref$testId = _ref.testId,
|
|
75
74
|
testId = _ref$testId === undefined ? 'vis-table' : _ref$testId;
|
|
76
75
|
|
|
@@ -136,8 +135,7 @@ var TableHtml5 = function TableHtml5(_ref) {
|
|
|
136
135
|
headerData: headerData,
|
|
137
136
|
xLayoutData: xLayoutData,
|
|
138
137
|
activeCellIds: activeCellIds,
|
|
139
|
-
|
|
140
|
-
selectedSideCoord: selectedSideCoord,
|
|
138
|
+
SideIcon: SideIcon,
|
|
141
139
|
ref: subHeadCellsRef,
|
|
142
140
|
subHeadCellsWidth: subHeadCellsWidth
|
|
143
141
|
})
|
|
@@ -155,8 +153,7 @@ var TableHtml5 = function TableHtml5(_ref) {
|
|
|
155
153
|
cellHandler: cellHandler,
|
|
156
154
|
activeCellIds: activeCellIds,
|
|
157
155
|
activeCellHandler: activeCellHandler,
|
|
158
|
-
|
|
159
|
-
selectedSideCoord: selectedSideCoord,
|
|
156
|
+
SideIcon: SideIcon,
|
|
160
157
|
subHeadCellsWidth: subHeadCellsWidth
|
|
161
158
|
});
|
|
162
159
|
}, sectionsData)
|
|
@@ -170,8 +167,7 @@ TableHtml5.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
170
167
|
cellHandler: PropTypes.func,
|
|
171
168
|
activeCellHandler: PropTypes.func,
|
|
172
169
|
activeCellIds: PropTypes.object,
|
|
173
|
-
|
|
174
|
-
selectedSideCoord: PropTypes.object,
|
|
170
|
+
SideIcon: PropTypes.func,
|
|
175
171
|
testId: PropTypes.string
|
|
176
172
|
} : {};
|
|
177
173
|
|
package/es/TableHtml5/cell.js
CHANGED
|
@@ -6,7 +6,6 @@ import { makeStyles } from '@material-ui/core/styles';
|
|
|
6
6
|
import TableCell from '@material-ui/core/TableCell';
|
|
7
7
|
import Typography from '@material-ui/core/Typography';
|
|
8
8
|
import Link from '@material-ui/core/Link';
|
|
9
|
-
import SideIcon from './sideIcon';
|
|
10
9
|
import Flags from './flags';
|
|
11
10
|
|
|
12
11
|
var useStyles = makeStyles(function (theme) {
|
|
@@ -50,7 +49,7 @@ var Cell = function Cell(_ref) {
|
|
|
50
49
|
isActive = _ref.isActive,
|
|
51
50
|
isHighlight = _ref.isHighlight,
|
|
52
51
|
sideProps = _ref.sideProps,
|
|
53
|
-
|
|
52
|
+
SideIcon = _ref.SideIcon;
|
|
54
53
|
|
|
55
54
|
var classes = useStyles();
|
|
56
55
|
var hasFlag = R.not(R.isEmpty(flags));
|
|
@@ -83,7 +82,7 @@ var Cell = function Cell(_ref) {
|
|
|
83
82
|
React.createElement(
|
|
84
83
|
Typography,
|
|
85
84
|
{ variant: 'body1', tabIndex: 0, noWrap: hasFlag },
|
|
86
|
-
React.createElement(SideIcon, { sideProps: sideProps
|
|
85
|
+
!R.isNil(SideIcon) && React.createElement(SideIcon, { sideProps: sideProps }),
|
|
87
86
|
hasFlag && React.createElement(Flags, { flags: flags }),
|
|
88
87
|
uiValue
|
|
89
88
|
)
|
|
@@ -102,7 +101,7 @@ Cell.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
102
101
|
isHighlight: PropTypes.bool,
|
|
103
102
|
activeCellHandler: PropTypes.func,
|
|
104
103
|
sideProps: PropTypes.object,
|
|
105
|
-
|
|
104
|
+
SideIcon: PropTypes.func
|
|
106
105
|
} : {};
|
|
107
106
|
|
|
108
107
|
export default Cell;
|
package/es/TableHtml5/section.js
CHANGED
|
@@ -11,7 +11,6 @@ import TableCell from '@material-ui/core/TableCell';
|
|
|
11
11
|
import TableRow from '@material-ui/core/TableRow';
|
|
12
12
|
import SectionHeader from './sectionHeader';
|
|
13
13
|
import Cell from './cell';
|
|
14
|
-
import SideIcon from './sideIcon';
|
|
15
14
|
import { getLight, getIsRtl } from '../utils';
|
|
16
15
|
import Flags from './flags';
|
|
17
16
|
|
|
@@ -71,8 +70,7 @@ var Section = function Section(_ref) {
|
|
|
71
70
|
headerHeight = _ref.headerHeight,
|
|
72
71
|
sectionIndex = _ref.sectionIndex,
|
|
73
72
|
nbColumnsByRows = _ref.nbColumnsByRows,
|
|
74
|
-
|
|
75
|
-
selectedSideCoord = _ref.selectedSideCoord,
|
|
73
|
+
SideIcon = _ref.SideIcon,
|
|
76
74
|
subHeadCellsWidth = _ref.subHeadCellsWidth;
|
|
77
75
|
|
|
78
76
|
var classes = useStyles();
|
|
@@ -91,8 +89,7 @@ var Section = function Section(_ref) {
|
|
|
91
89
|
currentSection: currentSection,
|
|
92
90
|
xLayoutDataLength: xLayoutDataLength,
|
|
93
91
|
headerHeight: headerHeight,
|
|
94
|
-
|
|
95
|
-
selectedSideCoord: selectedSideCoord
|
|
92
|
+
SideIcon: SideIcon
|
|
96
93
|
}),
|
|
97
94
|
R.map(function (sectionbody) {
|
|
98
95
|
var _cx2;
|
|
@@ -153,11 +150,7 @@ var Section = function Section(_ref) {
|
|
|
153
150
|
React.createElement(
|
|
154
151
|
'div',
|
|
155
152
|
{ className: classes.flagContainer },
|
|
156
|
-
React.createElement(SideIcon, {
|
|
157
|
-
sideProps: R.prop('sideProps', sectionbody),
|
|
158
|
-
sideToggle: sideToggle,
|
|
159
|
-
selectedSideCoord: selectedSideCoord
|
|
160
|
-
}),
|
|
153
|
+
!R.isNil(SideIcon) && React.createElement(SideIcon, { sideProps: R.prop('sideProps', sectionbody) }),
|
|
161
154
|
React.createElement(Flags, { flags: R.prop('flags', sectionbody) })
|
|
162
155
|
)
|
|
163
156
|
),
|
|
@@ -174,7 +167,7 @@ var Section = function Section(_ref) {
|
|
|
174
167
|
}, R.pathOr({ value: '..' }, [item.key, currentSection, sectionbody.key, 0], cells), {
|
|
175
168
|
headers: rowIds + ' ' + columnIds + ' ' + currentSection,
|
|
176
169
|
cellHandler: cellHandler,
|
|
177
|
-
|
|
170
|
+
SideIcon: SideIcon,
|
|
178
171
|
isActive: isActive,
|
|
179
172
|
isHighlight: R.any(R.identity)([R.prop(rowId)(activeCellIds), R.prop(columnIndex)(activeCellIds)]),
|
|
180
173
|
activeCellHandler: R.is(Function)(activeCellHandler) ? function () {
|
|
@@ -202,8 +195,7 @@ Section.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
202
195
|
headerNumberRows: PropTypes.number,
|
|
203
196
|
nbColumnsByRows: PropTypes.array,
|
|
204
197
|
maxColumns: PropTypes.number,
|
|
205
|
-
|
|
206
|
-
selectedSideCoord: PropTypes.object,
|
|
198
|
+
SideIcon: PropTypes.func,
|
|
207
199
|
subHeadCellsWidth: PropTypes.arrayOf(PropTypes.number)
|
|
208
200
|
} : {};
|
|
209
201
|
|
|
@@ -8,7 +8,6 @@ import { makeStyles } from '@material-ui/core/styles';
|
|
|
8
8
|
import Lens from '@material-ui/icons/Lens';
|
|
9
9
|
import TableCell from '@material-ui/core/TableCell';
|
|
10
10
|
import TableRow from '@material-ui/core/TableRow';
|
|
11
|
-
import SideIcon from './sideIcon';
|
|
12
11
|
import Flags from './flags';
|
|
13
12
|
import { getDark } from '../utils';
|
|
14
13
|
|
|
@@ -33,8 +32,8 @@ var useStyles = makeStyles(function (theme) {
|
|
|
33
32
|
marginRight: theme.spacing(0.5)
|
|
34
33
|
},
|
|
35
34
|
containerSection: {
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
alignItems: 'baseline',
|
|
36
|
+
display: 'flex'
|
|
38
37
|
},
|
|
39
38
|
stickyHeaderSection: {
|
|
40
39
|
position: 'sticky'
|
|
@@ -42,6 +41,9 @@ var useStyles = makeStyles(function (theme) {
|
|
|
42
41
|
containerTextSection: {
|
|
43
42
|
display: 'flex',
|
|
44
43
|
alignItems: 'center'
|
|
44
|
+
},
|
|
45
|
+
flags: {
|
|
46
|
+
paddingLeft: 12
|
|
45
47
|
}
|
|
46
48
|
};
|
|
47
49
|
});
|
|
@@ -53,8 +55,7 @@ var SectionHeader = function SectionHeader(_ref) {
|
|
|
53
55
|
currentSection = _ref.currentSection,
|
|
54
56
|
xLayoutDataLength = _ref.xLayoutDataLength,
|
|
55
57
|
headerHeight = _ref.headerHeight,
|
|
56
|
-
|
|
57
|
-
selectedSideCoord = _ref.selectedSideCoord;
|
|
58
|
+
SideIcon = _ref.SideIcon;
|
|
58
59
|
|
|
59
60
|
var classes = useStyles();
|
|
60
61
|
if (R.compose(R.anyPass([R.isNil, R.isEmpty]), R.path([0, 'data']))(section)) return null;
|
|
@@ -108,12 +109,8 @@ var SectionHeader = function SectionHeader(_ref) {
|
|
|
108
109
|
),
|
|
109
110
|
React.createElement(
|
|
110
111
|
'div',
|
|
111
|
-
|
|
112
|
-
React.createElement(SideIcon, {
|
|
113
|
-
sideProps: R.path([0, 'sideProps'], section),
|
|
114
|
-
sideToggle: sideToggle,
|
|
115
|
-
selectedSideCoord: selectedSideCoord
|
|
116
|
-
}),
|
|
112
|
+
{ className: classes.flags },
|
|
113
|
+
!R.isNil(SideIcon) && React.createElement(SideIcon, { sideProps: R.path([0, 'sideProps'], section) }),
|
|
117
114
|
React.createElement(Flags, { flags: R.path([0, 'flags'], section) })
|
|
118
115
|
)
|
|
119
116
|
)
|
|
@@ -127,8 +124,7 @@ SectionHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
127
124
|
currentSection: PropTypes.string,
|
|
128
125
|
xLayoutDataLength: PropTypes.number,
|
|
129
126
|
headerHeight: PropTypes.number,
|
|
130
|
-
|
|
131
|
-
selectedSideCoord: PropTypes.object
|
|
127
|
+
SideIcon: PropTypes.func
|
|
132
128
|
} : {};
|
|
133
129
|
|
|
134
130
|
export default SectionHeader;
|
|
@@ -8,7 +8,6 @@ import TableCell from '@material-ui/core/TableCell';
|
|
|
8
8
|
import TableRow from '@material-ui/core/TableRow';
|
|
9
9
|
import { getLight, getIsRtl } from '../utils';
|
|
10
10
|
import Flags from './flags';
|
|
11
|
-
import SideIcon from './sideIcon';
|
|
12
11
|
|
|
13
12
|
var useStyles = makeStyles(function (theme) {
|
|
14
13
|
return {
|
|
@@ -52,8 +51,7 @@ var SubHeader = React.forwardRef(function (_ref, refs) {
|
|
|
52
51
|
xLayoutData = _ref.xLayoutData,
|
|
53
52
|
activeCellIds = _ref.activeCellIds,
|
|
54
53
|
subHeadCellsWidth = _ref.subHeadCellsWidth,
|
|
55
|
-
|
|
56
|
-
selectedSideCoord = _ref.selectedSideCoord;
|
|
54
|
+
SideIcon = _ref.SideIcon;
|
|
57
55
|
|
|
58
56
|
var classes = useStyles();
|
|
59
57
|
var theme = useTheme();
|
|
@@ -99,11 +97,7 @@ var SubHeader = React.forwardRef(function (_ref, refs) {
|
|
|
99
97
|
key: index,
|
|
100
98
|
className: cx(classes.fillerCell, (_cx = {}, _cx[classes.highlight] = R.prop(index)(activeCellIds), _cx))
|
|
101
99
|
},
|
|
102
|
-
React.createElement(SideIcon, {
|
|
103
|
-
sideProps: R.prop('sideProps', item),
|
|
104
|
-
sideToggle: sideToggle,
|
|
105
|
-
selectedSideCoord: selectedSideCoord
|
|
106
|
-
}),
|
|
100
|
+
!R.isNil(SideIcon) && React.createElement(SideIcon, { sideProps: R.prop('sideProps', item) }),
|
|
107
101
|
React.createElement(Flags, { flags: R.prop('flags', item) })
|
|
108
102
|
);
|
|
109
103
|
}, headerData)
|
|
@@ -114,8 +108,7 @@ SubHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
114
108
|
activeCellIds: PropTypes.object,
|
|
115
109
|
headerData: PropTypes.array,
|
|
116
110
|
xLayoutData: PropTypes.array,
|
|
117
|
-
|
|
118
|
-
selectedSideCoord: PropTypes.object,
|
|
111
|
+
SideIcon: PropTypes.func,
|
|
119
112
|
subHeadCellsWidth: PropTypes.arrayOf(PropTypes.number)
|
|
120
113
|
} : {};
|
|
121
114
|
|
|
@@ -122,7 +122,7 @@ var CollapsibleTree = function CollapsibleTree(_ref) {
|
|
|
122
122
|
{
|
|
123
123
|
'aria-label': buttonAllOpenLabel,
|
|
124
124
|
color: 'primary',
|
|
125
|
-
endIcon: isAllOpen ? _react2.default.createElement(
|
|
125
|
+
endIcon: isAllOpen ? _react2.default.createElement(_KeyboardArrowUp2.default, { color: 'primary' }) : _react2.default.createElement(_KeyboardArrowDown2.default, { color: 'primary' }),
|
|
126
126
|
onClick: function onClick() {
|
|
127
127
|
return handleCollapse(isAllOpen);
|
|
128
128
|
}
|
|
@@ -52,10 +52,6 @@ var _utils = require('./utils');
|
|
|
52
52
|
|
|
53
53
|
var _ = require('../');
|
|
54
54
|
|
|
55
|
-
var _InfoIcon = require('../InfoIcon/InfoIcon');
|
|
56
|
-
|
|
57
|
-
var _InfoIcon2 = _interopRequireDefault(_InfoIcon);
|
|
58
|
-
|
|
59
55
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
60
56
|
|
|
61
57
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -137,37 +133,22 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
|
137
133
|
padding: 0,
|
|
138
134
|
marginLeft: 20,
|
|
139
135
|
maxWidth: 270
|
|
140
|
-
}, theme.typography.body1)
|
|
136
|
+
}, theme.typography.body1),
|
|
137
|
+
sideIconContainer: {
|
|
138
|
+
marginLeft: '10px'
|
|
139
|
+
}
|
|
141
140
|
};
|
|
142
141
|
});
|
|
143
142
|
|
|
144
|
-
var
|
|
145
|
-
var
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
return sideToggle(sideProps);
|
|
154
|
-
}, isSelected: isSelected });
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
SideIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
158
|
-
sideProps: _propTypes2.default.object,
|
|
159
|
-
sideToggle: _propTypes2.default.func
|
|
160
|
-
} : {};
|
|
161
|
-
|
|
162
|
-
var DataHeader = function DataHeader(_ref5) {
|
|
163
|
-
var children = _ref5.children,
|
|
164
|
-
title = _ref5.title,
|
|
165
|
-
_ref5$subtitle = _ref5.subtitle,
|
|
166
|
-
subtitle = _ref5$subtitle === undefined ? [] : _ref5$subtitle,
|
|
167
|
-
uprs = _ref5.uprs,
|
|
168
|
-
disclaimer = _ref5.disclaimer,
|
|
169
|
-
sideProps = _ref5.sideProps,
|
|
170
|
-
sideToggle = _ref5.sideToggle;
|
|
143
|
+
var DataHeader = function DataHeader(_ref4) {
|
|
144
|
+
var children = _ref4.children,
|
|
145
|
+
title = _ref4.title,
|
|
146
|
+
_ref4$subtitle = _ref4.subtitle,
|
|
147
|
+
subtitle = _ref4$subtitle === undefined ? [] : _ref4$subtitle,
|
|
148
|
+
uprs = _ref4.uprs,
|
|
149
|
+
disclaimer = _ref4.disclaimer,
|
|
150
|
+
sideProps = _ref4.sideProps,
|
|
151
|
+
SideIcon = _ref4.SideIcon;
|
|
171
152
|
|
|
172
153
|
var target = _react2.default.useRef(null);
|
|
173
154
|
|
|
@@ -197,6 +178,11 @@ var DataHeader = function DataHeader(_ref5) {
|
|
|
197
178
|
_Typography2.default,
|
|
198
179
|
{ variant: 'h1', className: classes.title },
|
|
199
180
|
title.label,
|
|
181
|
+
!R.isNil(SideIcon) && _react2.default.createElement(
|
|
182
|
+
'span',
|
|
183
|
+
{ className: classes.sideIconContainer },
|
|
184
|
+
_react2.default.createElement(SideIcon, { sideProps: sideProps })
|
|
185
|
+
),
|
|
200
186
|
_react2.default.createElement(_Flags2.default, { classes: classes, content: R.propOr([], 'flags', title) }),
|
|
201
187
|
disclaimer && _react2.default.createElement(
|
|
202
188
|
_.Tooltip,
|
|
@@ -250,7 +236,6 @@ var DataHeader = function DataHeader(_ref5) {
|
|
|
250
236
|
_react2.default.createElement(
|
|
251
237
|
'div',
|
|
252
238
|
{ className: classes.children },
|
|
253
|
-
_react2.default.createElement(SideIcon, { sideProps: sideProps, sideToggle: sideToggle }),
|
|
254
239
|
R.not(R.isEmpty(reducedContent)) && _react2.default.createElement(
|
|
255
240
|
_TooltipHeader2.default,
|
|
256
241
|
{ classes: classes, content: reducedContent },
|
|
@@ -288,7 +273,7 @@ DataHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
288
273
|
label: _propTypes2.default.string
|
|
289
274
|
}),
|
|
290
275
|
sideProps: _propTypes2.default.object,
|
|
291
|
-
|
|
276
|
+
SideIcon: _propTypes2.default.func,
|
|
292
277
|
disclaimer: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.element]),
|
|
293
278
|
children: _propTypes2.default.node
|
|
294
279
|
} : {};
|
|
@@ -49,10 +49,13 @@ var Period = function Period(_ref) {
|
|
|
49
49
|
|
|
50
50
|
var classes = (0, _styles2.default)();
|
|
51
51
|
var frequencies = (0, _lib.getFrequencyOptions)(availableFrequencies, labels);
|
|
52
|
+
console.log('frequencies', frequencies);
|
|
53
|
+
if (R.isEmpty(frequencies)) return null;
|
|
52
54
|
var frequency = (0, _lib.getDefaultFrequency)({
|
|
53
55
|
defaultFrequency: defaultFrequency,
|
|
54
56
|
frequencies: R.pluck('value')(frequencies)
|
|
55
57
|
});
|
|
58
|
+
console.log('frequency', frequency);
|
|
56
59
|
var period = R.defaultTo([], _period);
|
|
57
60
|
var boundaries = R.defaultTo([], _boundaries);
|
|
58
61
|
var isPeriodDisabled = R.or(R.any(R.isEmpty)([period, boundaries]), periodDisabled);
|
package/lib/PeriodPicker/lib.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.numeralFormat = exports.getDateInTheRange = exports.getDate = exports.getPeriodValue = exports.getLayout = exports.getFrequencyOptions = exports.getDefaultFrequency = exports.
|
|
4
|
+
exports.numeralFormat = exports.getDateInTheRange = exports.getDate = exports.getPeriodValue = exports.getLayout = exports.getFrequencyOptions = exports.getDefaultFrequency = exports.isValidNumber = exports.getAjustedDate = exports.getRange = exports.getDestructuringDate = undefined;
|
|
5
5
|
|
|
6
6
|
var _numeralFormat;
|
|
7
7
|
|
|
@@ -132,11 +132,6 @@ var getAjustedDate = exports.getAjustedDate = function getAjustedDate(frequency)
|
|
|
132
132
|
};
|
|
133
133
|
|
|
134
134
|
var isValidNumber = exports.isValidNumber = R.both(R.is(Number), R.complement(R.equals(NaN)));
|
|
135
|
-
var getSupportFrequencies = exports.getSupportFrequencies = function getSupportFrequencies(availableFrequencies) {
|
|
136
|
-
return R.filter(function (freq) {
|
|
137
|
-
return R.includes(freq)(supportedFrequenciesKey);
|
|
138
|
-
})(availableFrequencies);
|
|
139
|
-
};
|
|
140
135
|
var getDefaultFrequency = exports.getDefaultFrequency = function getDefaultFrequency(_ref4) {
|
|
141
136
|
var defaultFrequency = _ref4.defaultFrequency,
|
|
142
137
|
frequencies = _ref4.frequencies;
|
|
@@ -146,10 +141,14 @@ var getDefaultFrequency = exports.getDefaultFrequency = function getDefaultFrequ
|
|
|
146
141
|
};
|
|
147
142
|
|
|
148
143
|
var getFrequencyOptions = exports.getFrequencyOptions = function getFrequencyOptions(frequencyoptions, frequencyLabels) {
|
|
149
|
-
var availableFrequencies = R.or(R.isEmpty(frequencyoptions), R.isNil(frequencyoptions)) ? [_constants.defaultfreq] :
|
|
150
|
-
|
|
151
|
-
|
|
144
|
+
var availableFrequencies = R.or(R.isEmpty(frequencyoptions), R.isNil(frequencyoptions)) ? [_constants.defaultfreq] : R.filter(function (freq) {
|
|
145
|
+
return R.includes(freq, supportedFrequenciesKey);
|
|
146
|
+
})(frequencyoptions);
|
|
147
|
+
var options = R.map(function (option) {
|
|
148
|
+
return { value: option, label: R.prop(option, frequencyLabels) };
|
|
152
149
|
})(availableFrequencies);
|
|
150
|
+
if (R.isEmpty(options)) return [{ value: 'A', label: R.propOr('Annual', 'A', frequencyLabels) }];
|
|
151
|
+
return options;
|
|
153
152
|
};
|
|
154
153
|
|
|
155
154
|
var getLayout = exports.getLayout = function getLayout(type, range) {
|
package/lib/Select/Select.js
CHANGED
|
@@ -26,6 +26,8 @@ var _MenuItem = require('@material-ui/core/MenuItem');
|
|
|
26
26
|
|
|
27
27
|
var _MenuItem2 = _interopRequireDefault(_MenuItem);
|
|
28
28
|
|
|
29
|
+
var _ = require('../');
|
|
30
|
+
|
|
29
31
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
30
32
|
|
|
31
33
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -57,6 +59,15 @@ var Select = function Select(_ref) {
|
|
|
57
59
|
dataTestId = _ref$dataTestId === undefined ? 'select-testid' : _ref$dataTestId;
|
|
58
60
|
|
|
59
61
|
var classes = useStyles();
|
|
62
|
+
var ref = _react2.default.useRef(null);
|
|
63
|
+
|
|
64
|
+
var _React$useState = _react2.default.useState(false),
|
|
65
|
+
open = _React$useState[0],
|
|
66
|
+
setOpen = _React$useState[1];
|
|
67
|
+
|
|
68
|
+
var _React$useState2 = _react2.default.useState(0),
|
|
69
|
+
width = _React$useState2[0],
|
|
70
|
+
setWidth = _React$useState2[1];
|
|
60
71
|
|
|
61
72
|
var handleChange = function handleChange(event) {
|
|
62
73
|
if (R.is(Function)(onChange)) {
|
|
@@ -64,6 +75,12 @@ var Select = function Select(_ref) {
|
|
|
64
75
|
}
|
|
65
76
|
};
|
|
66
77
|
|
|
78
|
+
(0, _react.useEffect)(function () {
|
|
79
|
+
if (ref.current && open) {
|
|
80
|
+
setWidth(ref.current.clientWidth);
|
|
81
|
+
}
|
|
82
|
+
}, [ref.current, open]);
|
|
83
|
+
|
|
67
84
|
var getter = function getter(key) {
|
|
68
85
|
return function (accessor) {
|
|
69
86
|
return R.ifElse(R.is(Object), function (item) {
|
|
@@ -72,42 +89,62 @@ var Select = function Select(_ref) {
|
|
|
72
89
|
};
|
|
73
90
|
};
|
|
74
91
|
|
|
92
|
+
var joinByValue = R.innerJoin(function (obj, value) {
|
|
93
|
+
return obj.value === value;
|
|
94
|
+
});
|
|
95
|
+
var labels = R.pluck('label', joinByValue(items, R.is(Array, value) ? value : [value]));
|
|
75
96
|
return _react2.default.createElement(
|
|
76
97
|
_TextField2.default,
|
|
77
98
|
_extends({
|
|
99
|
+
select: true,
|
|
78
100
|
id: id,
|
|
79
101
|
'data-testid': dataTestId,
|
|
80
102
|
disabled: R.isEmpty(items),
|
|
81
|
-
select: true,
|
|
82
103
|
label: label,
|
|
83
104
|
value: value,
|
|
105
|
+
title: R.join(', ', labels),
|
|
84
106
|
onChange: handleChange,
|
|
85
107
|
variant: 'outlined',
|
|
86
108
|
size: 'small',
|
|
87
109
|
fullWidth: true,
|
|
88
110
|
SelectProps: {
|
|
111
|
+
ref: ref,
|
|
112
|
+
open: open,
|
|
113
|
+
autoWidth: true,
|
|
89
114
|
multiple: isMultiple,
|
|
115
|
+
onOpen: function onOpen() {
|
|
116
|
+
return setOpen(true);
|
|
117
|
+
},
|
|
118
|
+
onClose: function onClose() {
|
|
119
|
+
return setOpen(false);
|
|
120
|
+
},
|
|
90
121
|
classes: { root: classes.root },
|
|
91
122
|
MenuProps: {
|
|
92
123
|
getContentAnchorEl: null,
|
|
93
124
|
anchorOrigin: { vertical: 'bottom', horizontal: 'center' },
|
|
94
125
|
transformOrigin: { vertical: 'top', horizontal: 'center' },
|
|
95
|
-
classes: { paper: classes.paper }
|
|
126
|
+
classes: { paper: classes.paper },
|
|
127
|
+
PaperProps: {
|
|
128
|
+
style: { width: width }
|
|
129
|
+
}
|
|
96
130
|
}
|
|
97
131
|
},
|
|
98
132
|
className: classes.root
|
|
99
133
|
}, textFieldProps),
|
|
100
134
|
R.map(function (item) {
|
|
135
|
+
var value = getter('value')(valueAccessor)(item);
|
|
136
|
+
var label = getter('label')(labelAccessor)(item);
|
|
101
137
|
return _react2.default.createElement(
|
|
102
138
|
_MenuItem2.default,
|
|
103
139
|
{
|
|
104
|
-
key: optionsKey + '-' +
|
|
105
|
-
|
|
140
|
+
key: optionsKey + '-' + value,
|
|
141
|
+
id: label,
|
|
142
|
+
value: value,
|
|
106
143
|
dense: true,
|
|
107
|
-
|
|
108
|
-
|
|
144
|
+
'aria-label': label,
|
|
145
|
+
title: label
|
|
109
146
|
},
|
|
110
|
-
|
|
147
|
+
label
|
|
111
148
|
);
|
|
112
149
|
})(items)
|
|
113
150
|
);
|
|
@@ -102,8 +102,7 @@ var TableHtml5 = function TableHtml5(_ref) {
|
|
|
102
102
|
cellHandler = _ref.cellHandler,
|
|
103
103
|
activeCellIds = _ref.activeCellIds,
|
|
104
104
|
activeCellHandler = _ref.activeCellHandler,
|
|
105
|
-
|
|
106
|
-
selectedSideCoord = _ref.selectedSideCoord,
|
|
105
|
+
SideIcon = _ref.SideIcon,
|
|
107
106
|
_ref$testId = _ref.testId,
|
|
108
107
|
testId = _ref$testId === undefined ? 'vis-table' : _ref$testId;
|
|
109
108
|
|
|
@@ -169,8 +168,7 @@ var TableHtml5 = function TableHtml5(_ref) {
|
|
|
169
168
|
headerData: headerData,
|
|
170
169
|
xLayoutData: xLayoutData,
|
|
171
170
|
activeCellIds: activeCellIds,
|
|
172
|
-
|
|
173
|
-
selectedSideCoord: selectedSideCoord,
|
|
171
|
+
SideIcon: SideIcon,
|
|
174
172
|
ref: subHeadCellsRef,
|
|
175
173
|
subHeadCellsWidth: subHeadCellsWidth
|
|
176
174
|
})
|
|
@@ -188,8 +186,7 @@ var TableHtml5 = function TableHtml5(_ref) {
|
|
|
188
186
|
cellHandler: cellHandler,
|
|
189
187
|
activeCellIds: activeCellIds,
|
|
190
188
|
activeCellHandler: activeCellHandler,
|
|
191
|
-
|
|
192
|
-
selectedSideCoord: selectedSideCoord,
|
|
189
|
+
SideIcon: SideIcon,
|
|
193
190
|
subHeadCellsWidth: subHeadCellsWidth
|
|
194
191
|
});
|
|
195
192
|
}, sectionsData)
|
|
@@ -203,8 +200,7 @@ TableHtml5.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
203
200
|
cellHandler: _propTypes2.default.func,
|
|
204
201
|
activeCellHandler: _propTypes2.default.func,
|
|
205
202
|
activeCellIds: _propTypes2.default.object,
|
|
206
|
-
|
|
207
|
-
selectedSideCoord: _propTypes2.default.object,
|
|
203
|
+
SideIcon: _propTypes2.default.func,
|
|
208
204
|
testId: _propTypes2.default.string
|
|
209
205
|
} : {};
|
|
210
206
|
|
package/lib/TableHtml5/cell.js
CHANGED
|
@@ -32,10 +32,6 @@ var _Link = require('@material-ui/core/Link');
|
|
|
32
32
|
|
|
33
33
|
var _Link2 = _interopRequireDefault(_Link);
|
|
34
34
|
|
|
35
|
-
var _sideIcon = require('./sideIcon');
|
|
36
|
-
|
|
37
|
-
var _sideIcon2 = _interopRequireDefault(_sideIcon);
|
|
38
|
-
|
|
39
35
|
var _flags = require('./flags');
|
|
40
36
|
|
|
41
37
|
var _flags2 = _interopRequireDefault(_flags);
|
|
@@ -85,7 +81,7 @@ var Cell = function Cell(_ref) {
|
|
|
85
81
|
isActive = _ref.isActive,
|
|
86
82
|
isHighlight = _ref.isHighlight,
|
|
87
83
|
sideProps = _ref.sideProps,
|
|
88
|
-
|
|
84
|
+
SideIcon = _ref.SideIcon;
|
|
89
85
|
|
|
90
86
|
var classes = useStyles();
|
|
91
87
|
var hasFlag = R.not(R.isEmpty(flags));
|
|
@@ -118,7 +114,7 @@ var Cell = function Cell(_ref) {
|
|
|
118
114
|
_react2.default.createElement(
|
|
119
115
|
_Typography2.default,
|
|
120
116
|
{ variant: 'body1', tabIndex: 0, noWrap: hasFlag },
|
|
121
|
-
_react2.default.createElement(
|
|
117
|
+
!R.isNil(SideIcon) && _react2.default.createElement(SideIcon, { sideProps: sideProps }),
|
|
122
118
|
hasFlag && _react2.default.createElement(_flags2.default, { flags: flags }),
|
|
123
119
|
uiValue
|
|
124
120
|
)
|
|
@@ -137,7 +133,7 @@ Cell.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
137
133
|
isHighlight: _propTypes2.default.bool,
|
|
138
134
|
activeCellHandler: _propTypes2.default.func,
|
|
139
135
|
sideProps: _propTypes2.default.object,
|
|
140
|
-
|
|
136
|
+
SideIcon: _propTypes2.default.func
|
|
141
137
|
} : {};
|
|
142
138
|
|
|
143
139
|
exports.default = Cell;
|
|
@@ -46,10 +46,6 @@ var _cell = require('./cell');
|
|
|
46
46
|
|
|
47
47
|
var _cell2 = _interopRequireDefault(_cell);
|
|
48
48
|
|
|
49
|
-
var _sideIcon = require('./sideIcon');
|
|
50
|
-
|
|
51
|
-
var _sideIcon2 = _interopRequireDefault(_sideIcon);
|
|
52
|
-
|
|
53
49
|
var _utils = require('../utils');
|
|
54
50
|
|
|
55
51
|
var _flags = require('./flags');
|
|
@@ -116,8 +112,7 @@ var Section = function Section(_ref) {
|
|
|
116
112
|
headerHeight = _ref.headerHeight,
|
|
117
113
|
sectionIndex = _ref.sectionIndex,
|
|
118
114
|
nbColumnsByRows = _ref.nbColumnsByRows,
|
|
119
|
-
|
|
120
|
-
selectedSideCoord = _ref.selectedSideCoord,
|
|
115
|
+
SideIcon = _ref.SideIcon,
|
|
121
116
|
subHeadCellsWidth = _ref.subHeadCellsWidth;
|
|
122
117
|
|
|
123
118
|
var classes = useStyles();
|
|
@@ -136,8 +131,7 @@ var Section = function Section(_ref) {
|
|
|
136
131
|
currentSection: currentSection,
|
|
137
132
|
xLayoutDataLength: xLayoutDataLength,
|
|
138
133
|
headerHeight: headerHeight,
|
|
139
|
-
|
|
140
|
-
selectedSideCoord: selectedSideCoord
|
|
134
|
+
SideIcon: SideIcon
|
|
141
135
|
}),
|
|
142
136
|
R.map(function (sectionbody) {
|
|
143
137
|
var _cx2;
|
|
@@ -198,11 +192,7 @@ var Section = function Section(_ref) {
|
|
|
198
192
|
_react2.default.createElement(
|
|
199
193
|
'div',
|
|
200
194
|
{ className: classes.flagContainer },
|
|
201
|
-
_react2.default.createElement(
|
|
202
|
-
sideProps: R.prop('sideProps', sectionbody),
|
|
203
|
-
sideToggle: sideToggle,
|
|
204
|
-
selectedSideCoord: selectedSideCoord
|
|
205
|
-
}),
|
|
195
|
+
!R.isNil(SideIcon) && _react2.default.createElement(SideIcon, { sideProps: R.prop('sideProps', sectionbody) }),
|
|
206
196
|
_react2.default.createElement(_flags2.default, { flags: R.prop('flags', sectionbody) })
|
|
207
197
|
)
|
|
208
198
|
),
|
|
@@ -219,7 +209,7 @@ var Section = function Section(_ref) {
|
|
|
219
209
|
}, R.pathOr({ value: '..' }, [item.key, currentSection, sectionbody.key, 0], cells), {
|
|
220
210
|
headers: rowIds + ' ' + columnIds + ' ' + currentSection,
|
|
221
211
|
cellHandler: cellHandler,
|
|
222
|
-
|
|
212
|
+
SideIcon: SideIcon,
|
|
223
213
|
isActive: isActive,
|
|
224
214
|
isHighlight: R.any(R.identity)([R.prop(rowId)(activeCellIds), R.prop(columnIndex)(activeCellIds)]),
|
|
225
215
|
activeCellHandler: R.is(Function)(activeCellHandler) ? function () {
|
|
@@ -247,8 +237,7 @@ Section.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
247
237
|
headerNumberRows: _propTypes2.default.number,
|
|
248
238
|
nbColumnsByRows: _propTypes2.default.array,
|
|
249
239
|
maxColumns: _propTypes2.default.number,
|
|
250
|
-
|
|
251
|
-
selectedSideCoord: _propTypes2.default.object,
|
|
240
|
+
SideIcon: _propTypes2.default.func,
|
|
252
241
|
subHeadCellsWidth: _propTypes2.default.arrayOf(_propTypes2.default.number)
|
|
253
242
|
} : {};
|
|
254
243
|
|
|
@@ -34,10 +34,6 @@ var _TableRow = require('@material-ui/core/TableRow');
|
|
|
34
34
|
|
|
35
35
|
var _TableRow2 = _interopRequireDefault(_TableRow);
|
|
36
36
|
|
|
37
|
-
var _sideIcon = require('./sideIcon');
|
|
38
|
-
|
|
39
|
-
var _sideIcon2 = _interopRequireDefault(_sideIcon);
|
|
40
|
-
|
|
41
37
|
var _flags = require('./flags');
|
|
42
38
|
|
|
43
39
|
var _flags2 = _interopRequireDefault(_flags);
|
|
@@ -69,8 +65,8 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
|
69
65
|
marginRight: theme.spacing(0.5)
|
|
70
66
|
},
|
|
71
67
|
containerSection: {
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
alignItems: 'baseline',
|
|
69
|
+
display: 'flex'
|
|
74
70
|
},
|
|
75
71
|
stickyHeaderSection: {
|
|
76
72
|
position: 'sticky'
|
|
@@ -78,6 +74,9 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
|
78
74
|
containerTextSection: {
|
|
79
75
|
display: 'flex',
|
|
80
76
|
alignItems: 'center'
|
|
77
|
+
},
|
|
78
|
+
flags: {
|
|
79
|
+
paddingLeft: 12
|
|
81
80
|
}
|
|
82
81
|
};
|
|
83
82
|
});
|
|
@@ -89,8 +88,7 @@ var SectionHeader = function SectionHeader(_ref) {
|
|
|
89
88
|
currentSection = _ref.currentSection,
|
|
90
89
|
xLayoutDataLength = _ref.xLayoutDataLength,
|
|
91
90
|
headerHeight = _ref.headerHeight,
|
|
92
|
-
|
|
93
|
-
selectedSideCoord = _ref.selectedSideCoord;
|
|
91
|
+
SideIcon = _ref.SideIcon;
|
|
94
92
|
|
|
95
93
|
var classes = useStyles();
|
|
96
94
|
if (R.compose(R.anyPass([R.isNil, R.isEmpty]), R.path([0, 'data']))(section)) return null;
|
|
@@ -144,12 +142,8 @@ var SectionHeader = function SectionHeader(_ref) {
|
|
|
144
142
|
),
|
|
145
143
|
_react2.default.createElement(
|
|
146
144
|
'div',
|
|
147
|
-
|
|
148
|
-
_react2.default.createElement(
|
|
149
|
-
sideProps: R.path([0, 'sideProps'], section),
|
|
150
|
-
sideToggle: sideToggle,
|
|
151
|
-
selectedSideCoord: selectedSideCoord
|
|
152
|
-
}),
|
|
145
|
+
{ className: classes.flags },
|
|
146
|
+
!R.isNil(SideIcon) && _react2.default.createElement(SideIcon, { sideProps: R.path([0, 'sideProps'], section) }),
|
|
153
147
|
_react2.default.createElement(_flags2.default, { flags: R.path([0, 'flags'], section) })
|
|
154
148
|
)
|
|
155
149
|
)
|
|
@@ -163,8 +157,7 @@ SectionHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
163
157
|
currentSection: _propTypes2.default.string,
|
|
164
158
|
xLayoutDataLength: _propTypes2.default.number,
|
|
165
159
|
headerHeight: _propTypes2.default.number,
|
|
166
|
-
|
|
167
|
-
selectedSideCoord: _propTypes2.default.object
|
|
160
|
+
SideIcon: _propTypes2.default.func
|
|
168
161
|
} : {};
|
|
169
162
|
|
|
170
163
|
exports.default = SectionHeader;
|
|
@@ -38,10 +38,6 @@ var _flags = require('./flags');
|
|
|
38
38
|
|
|
39
39
|
var _flags2 = _interopRequireDefault(_flags);
|
|
40
40
|
|
|
41
|
-
var _sideIcon = require('./sideIcon');
|
|
42
|
-
|
|
43
|
-
var _sideIcon2 = _interopRequireDefault(_sideIcon);
|
|
44
|
-
|
|
45
41
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
46
42
|
|
|
47
43
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -88,8 +84,7 @@ var SubHeader = _react2.default.forwardRef(function (_ref, refs) {
|
|
|
88
84
|
xLayoutData = _ref.xLayoutData,
|
|
89
85
|
activeCellIds = _ref.activeCellIds,
|
|
90
86
|
subHeadCellsWidth = _ref.subHeadCellsWidth,
|
|
91
|
-
|
|
92
|
-
selectedSideCoord = _ref.selectedSideCoord;
|
|
87
|
+
SideIcon = _ref.SideIcon;
|
|
93
88
|
|
|
94
89
|
var classes = useStyles();
|
|
95
90
|
var theme = (0, _styles.useTheme)();
|
|
@@ -135,11 +130,7 @@ var SubHeader = _react2.default.forwardRef(function (_ref, refs) {
|
|
|
135
130
|
key: index,
|
|
136
131
|
className: (0, _classnames2.default)(classes.fillerCell, (_cx = {}, _cx[classes.highlight] = R.prop(index)(activeCellIds), _cx))
|
|
137
132
|
},
|
|
138
|
-
_react2.default.createElement(
|
|
139
|
-
sideProps: R.prop('sideProps', item),
|
|
140
|
-
sideToggle: sideToggle,
|
|
141
|
-
selectedSideCoord: selectedSideCoord
|
|
142
|
-
}),
|
|
133
|
+
!R.isNil(SideIcon) && _react2.default.createElement(SideIcon, { sideProps: R.prop('sideProps', item) }),
|
|
143
134
|
_react2.default.createElement(_flags2.default, { flags: R.prop('flags', item) })
|
|
144
135
|
);
|
|
145
136
|
}, headerData)
|
|
@@ -150,8 +141,7 @@ SubHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
150
141
|
activeCellIds: _propTypes2.default.object,
|
|
151
142
|
headerData: _propTypes2.default.array,
|
|
152
143
|
xLayoutData: _propTypes2.default.array,
|
|
153
|
-
|
|
154
|
-
selectedSideCoord: _propTypes2.default.object,
|
|
144
|
+
SideIcon: _propTypes2.default.func,
|
|
155
145
|
subHeadCellsWidth: _propTypes2.default.arrayOf(_propTypes2.default.number)
|
|
156
146
|
} : {};
|
|
157
147
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sis-cc/dotstatsuite-visions",
|
|
3
|
-
"version": "7.1
|
|
3
|
+
"version": "7.3.1",
|
|
4
4
|
"description": "Library of visual components",
|
|
5
5
|
"author": "OECD",
|
|
6
6
|
"homepage": "https://visions-qa.siscc.org/#o",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build": "nwb build-react-component --no-demo && node scripts/doc && nwb build-demo",
|
|
22
|
+
"build:dev": "nwb build-react-component --no-demo",
|
|
22
23
|
"clean": "nwb clean-module && nwb clean-demo",
|
|
23
24
|
"prepublishOnly": "npm run build",
|
|
24
25
|
"start": "nwb serve-react-demo",
|
package/es/InfoIcon/InfoIcon.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
4
|
-
import MuiInfoIcon from '@material-ui/icons//Info';
|
|
5
|
-
import IconButton from '@material-ui/core/IconButton';
|
|
6
|
-
|
|
7
|
-
var useStyles = makeStyles(function (theme) {
|
|
8
|
-
return {
|
|
9
|
-
icon: {
|
|
10
|
-
color: function color(_ref) {
|
|
11
|
-
var isSelected = _ref.isSelected;
|
|
12
|
-
return isSelected ? theme.palette.highlight.hl1 : theme.palette.primary.main;
|
|
13
|
-
},
|
|
14
|
-
padding: 0
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
var InfoIcon = function InfoIcon(_ref2) {
|
|
20
|
-
var onClick = _ref2.onClick,
|
|
21
|
-
_ref2$isSelected = _ref2.isSelected,
|
|
22
|
-
isSelected = _ref2$isSelected === undefined ? false : _ref2$isSelected;
|
|
23
|
-
|
|
24
|
-
var classes = useStyles({ isSelected: isSelected });
|
|
25
|
-
return React.createElement(
|
|
26
|
-
IconButton,
|
|
27
|
-
{ size: 'small', className: classes.icon, onClick: onClick, 'data-testid': 'ref-md-info' },
|
|
28
|
-
React.createElement(MuiInfoIcon, { fontSize: 'small' })
|
|
29
|
-
);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
InfoIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
33
|
-
onClick: PropTypes.func.isRequired,
|
|
34
|
-
isSelected: PropTypes.bool
|
|
35
|
-
} : {};
|
|
36
|
-
|
|
37
|
-
export default InfoIcon;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import * as R from 'ramda';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import InfoIcon from '../InfoIcon/InfoIcon';
|
|
5
|
-
|
|
6
|
-
var SideIcon = function SideIcon(_ref) {
|
|
7
|
-
var sideProps = _ref.sideProps,
|
|
8
|
-
sideToggle = _ref.sideToggle,
|
|
9
|
-
selectedSideCoord = _ref.selectedSideCoord;
|
|
10
|
-
|
|
11
|
-
if (R.isNil(sideProps) || !R.is(Function, sideToggle)) {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
var isSelected = R.equals(sideProps.coordinates, selectedSideCoord);
|
|
15
|
-
return React.createElement(InfoIcon, { onClick: function onClick() {
|
|
16
|
-
return sideToggle(sideProps);
|
|
17
|
-
}, isSelected: isSelected });
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
SideIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
21
|
-
selectedSideCoord: PropTypes.object,
|
|
22
|
-
sideProps: PropTypes.object,
|
|
23
|
-
sideToggle: PropTypes.func
|
|
24
|
-
} : {};
|
|
25
|
-
|
|
26
|
-
export default SideIcon;
|
package/lib/InfoIcon/InfoIcon.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
|
|
5
|
-
var _react = require('react');
|
|
6
|
-
|
|
7
|
-
var _react2 = _interopRequireDefault(_react);
|
|
8
|
-
|
|
9
|
-
var _propTypes = require('prop-types');
|
|
10
|
-
|
|
11
|
-
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
12
|
-
|
|
13
|
-
var _styles = require('@material-ui/core/styles');
|
|
14
|
-
|
|
15
|
-
var _Info = require('@material-ui/icons//Info');
|
|
16
|
-
|
|
17
|
-
var _Info2 = _interopRequireDefault(_Info);
|
|
18
|
-
|
|
19
|
-
var _IconButton = require('@material-ui/core/IconButton');
|
|
20
|
-
|
|
21
|
-
var _IconButton2 = _interopRequireDefault(_IconButton);
|
|
22
|
-
|
|
23
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
-
|
|
25
|
-
var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
26
|
-
return {
|
|
27
|
-
icon: {
|
|
28
|
-
color: function color(_ref) {
|
|
29
|
-
var isSelected = _ref.isSelected;
|
|
30
|
-
return isSelected ? theme.palette.highlight.hl1 : theme.palette.primary.main;
|
|
31
|
-
},
|
|
32
|
-
padding: 0
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
var InfoIcon = function InfoIcon(_ref2) {
|
|
38
|
-
var onClick = _ref2.onClick,
|
|
39
|
-
_ref2$isSelected = _ref2.isSelected,
|
|
40
|
-
isSelected = _ref2$isSelected === undefined ? false : _ref2$isSelected;
|
|
41
|
-
|
|
42
|
-
var classes = useStyles({ isSelected: isSelected });
|
|
43
|
-
return _react2.default.createElement(
|
|
44
|
-
_IconButton2.default,
|
|
45
|
-
{ size: 'small', className: classes.icon, onClick: onClick, 'data-testid': 'ref-md-info' },
|
|
46
|
-
_react2.default.createElement(_Info2.default, { fontSize: 'small' })
|
|
47
|
-
);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
InfoIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
51
|
-
onClick: _propTypes2.default.func.isRequired,
|
|
52
|
-
isSelected: _propTypes2.default.bool
|
|
53
|
-
} : {};
|
|
54
|
-
|
|
55
|
-
exports.default = InfoIcon;
|
|
56
|
-
module.exports = exports['default'];
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
|
|
5
|
-
var _react = require('react');
|
|
6
|
-
|
|
7
|
-
var _react2 = _interopRequireDefault(_react);
|
|
8
|
-
|
|
9
|
-
var _ramda = require('ramda');
|
|
10
|
-
|
|
11
|
-
var R = _interopRequireWildcard(_ramda);
|
|
12
|
-
|
|
13
|
-
var _propTypes = require('prop-types');
|
|
14
|
-
|
|
15
|
-
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
16
|
-
|
|
17
|
-
var _InfoIcon = require('../InfoIcon/InfoIcon');
|
|
18
|
-
|
|
19
|
-
var _InfoIcon2 = _interopRequireDefault(_InfoIcon);
|
|
20
|
-
|
|
21
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
22
|
-
|
|
23
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
-
|
|
25
|
-
var SideIcon = function SideIcon(_ref) {
|
|
26
|
-
var sideProps = _ref.sideProps,
|
|
27
|
-
sideToggle = _ref.sideToggle,
|
|
28
|
-
selectedSideCoord = _ref.selectedSideCoord;
|
|
29
|
-
|
|
30
|
-
if (R.isNil(sideProps) || !R.is(Function, sideToggle)) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
var isSelected = R.equals(sideProps.coordinates, selectedSideCoord);
|
|
34
|
-
return _react2.default.createElement(_InfoIcon2.default, { onClick: function onClick() {
|
|
35
|
-
return sideToggle(sideProps);
|
|
36
|
-
}, isSelected: isSelected });
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
SideIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
40
|
-
selectedSideCoord: _propTypes2.default.object,
|
|
41
|
-
sideProps: _propTypes2.default.object,
|
|
42
|
-
sideToggle: _propTypes2.default.func
|
|
43
|
-
} : {};
|
|
44
|
-
|
|
45
|
-
exports.default = SideIcon;
|
|
46
|
-
module.exports = exports['default'];
|