@sis-cc/dotstatsuite-visions 7.1.0 → 7.2.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/DataHeader/DataHeader.js +15 -30
- 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/DataHeader/DataHeader.js +15 -33
- 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
|
@@ -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 {
|
|
@@ -98,33 +97,15 @@ var useStyles = makeStyles(function (theme) {
|
|
|
98
97
|
};
|
|
99
98
|
});
|
|
100
99
|
|
|
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;
|
|
100
|
+
var DataHeader = function DataHeader(_ref4) {
|
|
101
|
+
var children = _ref4.children,
|
|
102
|
+
title = _ref4.title,
|
|
103
|
+
_ref4$subtitle = _ref4.subtitle,
|
|
104
|
+
subtitle = _ref4$subtitle === undefined ? [] : _ref4$subtitle,
|
|
105
|
+
uprs = _ref4.uprs,
|
|
106
|
+
disclaimer = _ref4.disclaimer,
|
|
107
|
+
sideProps = _ref4.sideProps,
|
|
108
|
+
SideIcon = _ref4.SideIcon;
|
|
128
109
|
|
|
129
110
|
var target = React.useRef(null);
|
|
130
111
|
|
|
@@ -154,6 +135,11 @@ var DataHeader = function DataHeader(_ref5) {
|
|
|
154
135
|
Typography,
|
|
155
136
|
{ variant: 'h1', className: classes.title },
|
|
156
137
|
title.label,
|
|
138
|
+
!R.isNil(SideIcon) && React.createElement(
|
|
139
|
+
'span',
|
|
140
|
+
{ style: { 'margin-left': '10px' } },
|
|
141
|
+
React.createElement(SideIcon, { sideProps: sideProps })
|
|
142
|
+
),
|
|
157
143
|
React.createElement(Flags, { classes: classes, content: R.propOr([], 'flags', title) }),
|
|
158
144
|
disclaimer && React.createElement(
|
|
159
145
|
Tooltip,
|
|
@@ -207,7 +193,6 @@ var DataHeader = function DataHeader(_ref5) {
|
|
|
207
193
|
React.createElement(
|
|
208
194
|
'div',
|
|
209
195
|
{ className: classes.children },
|
|
210
|
-
React.createElement(SideIcon, { sideProps: sideProps, sideToggle: sideToggle }),
|
|
211
196
|
R.not(R.isEmpty(reducedContent)) && React.createElement(
|
|
212
197
|
TooltipHeader,
|
|
213
198
|
{ classes: classes, content: reducedContent },
|
|
@@ -245,7 +230,7 @@ DataHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
245
230
|
label: PropTypes.string
|
|
246
231
|
}),
|
|
247
232
|
sideProps: PropTypes.object,
|
|
248
|
-
|
|
233
|
+
SideIcon: PropTypes.func,
|
|
249
234
|
disclaimer: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
250
235
|
children: PropTypes.node
|
|
251
236
|
} : {};
|
|
@@ -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
|
|
|
@@ -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 }; }
|
|
@@ -141,33 +137,15 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
|
141
137
|
};
|
|
142
138
|
});
|
|
143
139
|
|
|
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;
|
|
140
|
+
var DataHeader = function DataHeader(_ref4) {
|
|
141
|
+
var children = _ref4.children,
|
|
142
|
+
title = _ref4.title,
|
|
143
|
+
_ref4$subtitle = _ref4.subtitle,
|
|
144
|
+
subtitle = _ref4$subtitle === undefined ? [] : _ref4$subtitle,
|
|
145
|
+
uprs = _ref4.uprs,
|
|
146
|
+
disclaimer = _ref4.disclaimer,
|
|
147
|
+
sideProps = _ref4.sideProps,
|
|
148
|
+
SideIcon = _ref4.SideIcon;
|
|
171
149
|
|
|
172
150
|
var target = _react2.default.useRef(null);
|
|
173
151
|
|
|
@@ -197,6 +175,11 @@ var DataHeader = function DataHeader(_ref5) {
|
|
|
197
175
|
_Typography2.default,
|
|
198
176
|
{ variant: 'h1', className: classes.title },
|
|
199
177
|
title.label,
|
|
178
|
+
!R.isNil(SideIcon) && _react2.default.createElement(
|
|
179
|
+
'span',
|
|
180
|
+
{ style: { 'margin-left': '10px' } },
|
|
181
|
+
_react2.default.createElement(SideIcon, { sideProps: sideProps })
|
|
182
|
+
),
|
|
200
183
|
_react2.default.createElement(_Flags2.default, { classes: classes, content: R.propOr([], 'flags', title) }),
|
|
201
184
|
disclaimer && _react2.default.createElement(
|
|
202
185
|
_.Tooltip,
|
|
@@ -250,7 +233,6 @@ var DataHeader = function DataHeader(_ref5) {
|
|
|
250
233
|
_react2.default.createElement(
|
|
251
234
|
'div',
|
|
252
235
|
{ className: classes.children },
|
|
253
|
-
_react2.default.createElement(SideIcon, { sideProps: sideProps, sideToggle: sideToggle }),
|
|
254
236
|
R.not(R.isEmpty(reducedContent)) && _react2.default.createElement(
|
|
255
237
|
_TooltipHeader2.default,
|
|
256
238
|
{ classes: classes, content: reducedContent },
|
|
@@ -288,7 +270,7 @@ DataHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
288
270
|
label: _propTypes2.default.string
|
|
289
271
|
}),
|
|
290
272
|
sideProps: _propTypes2.default.object,
|
|
291
|
-
|
|
273
|
+
SideIcon: _propTypes2.default.func,
|
|
292
274
|
disclaimer: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.element]),
|
|
293
275
|
children: _propTypes2.default.node
|
|
294
276
|
} : {};
|
|
@@ -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.
|
|
3
|
+
"version": "7.2.0",
|
|
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'];
|