@sis-cc/dotstatsuite-visions 6.5.0 → 6.6.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.
@@ -28,9 +28,7 @@ import Button from '../Button';
28
28
  import Checkbox from '@material-ui/core/Checkbox';
29
29
  import CloseIcon from '@material-ui/icons/Close';
30
30
  import Dialog from '@material-ui/core/Dialog';
31
- import MuiDialogTitle from '@material-ui/core/DialogTitle';
32
31
  import IconButton from '@material-ui/core/IconButton';
33
- import Input from '@material-ui/core/Input';
34
32
  import PersonIcon from '@material-ui/icons/Person';
35
33
  import TextField from '@material-ui/core/TextField';
36
34
  import Typography from '@material-ui/core/Typography';
@@ -132,20 +130,38 @@ var AuthDialog = function AuthDialog(_ref) {
132
130
  )
133
131
  ),
134
132
  React.createElement(
135
- 'div',
133
+ 'form',
136
134
  { className: classes.content },
137
- labels.user,
135
+ React.createElement(
136
+ 'label',
137
+ { htmlFor: 'login' },
138
+ labels.user
139
+ ),
138
140
  React.createElement(TextField, {
139
- inputProps: { className: classes.input },
141
+ inputProps: {
142
+ className: classes.input,
143
+ id: 'login',
144
+ autoComplete: 'username',
145
+ name: 'username'
146
+ },
140
147
  value: user,
141
148
  onChange: function onChange(e) {
142
149
  return setUser(e.target.value);
143
150
  },
144
151
  disabled: isAnonymous
145
152
  }),
146
- labels.password,
153
+ React.createElement(
154
+ 'label',
155
+ { htmlFor: 'password' },
156
+ labels.password
157
+ ),
147
158
  React.createElement(TextField, {
148
- inputProps: { className: classes.input },
159
+ inputProps: {
160
+ className: classes.input,
161
+ id: 'password',
162
+ autoComplete: 'current-password',
163
+ name: 'password'
164
+ },
149
165
  value: password,
150
166
  onChange: function onChange(e) {
151
167
  return setPassword(e.target.value);
@@ -38,7 +38,9 @@ var CollapseButtons = function CollapseButtons(props) {
38
38
  breakpoint = _props$breakpoint === undefined ? function (theme) {
39
39
  return theme.breakpoints.down('sm');
40
40
  } : _props$breakpoint,
41
- justify = props.justify;
41
+ justify = props.justify,
42
+ _props$textTransform = props.textTransform,
43
+ textTransform = _props$textTransform === undefined ? 'none' : _props$textTransform;
42
44
 
43
45
 
44
46
  var classes = useStyles();
@@ -80,6 +82,7 @@ var CollapseButtons = function CollapseButtons(props) {
80
82
  Grid,
81
83
  _extends({ item: true, xs: 12, sm: 12, md: R.nth(nbColumns)(COLUMNS) }, gridButtonsProps, { key: id }),
82
84
  React.createElement(ToggleButton, {
85
+ textTransform: textTransform,
83
86
  label: label,
84
87
  tabindex: R.isNil(toggleId) || R.prop(id)(toggleId) || R.compose(R.not, R.head, R.values)(toggleId) ? 0 : -1,
85
88
  isOpen: R.prop(id)(toggleId),
@@ -151,7 +154,8 @@ CollapseButtons.propTypes = process.env.NODE_ENV !== "production" ? {
151
154
  isSecondLevelClikable: PropTypes.bool,
152
155
  breakpoint: PropTypes.func,
153
156
  gridButtonsProps: PropTypes.object,
154
- justify: PropTypes.string
157
+ justify: PropTypes.string,
158
+ textTransform: PropTypes.string
155
159
  } : {};
156
160
 
157
161
  export default CollapseButtons;
@@ -10,6 +10,8 @@
10
10
  * | 'space-around'
11
11
  * | 'space-evenly'
12
12
  *
13
+ * textTransform: 'none' | 'capitalize' | 'uppercase' | 'lowercase'
14
+ *
13
15
  * to manage layout you have three properties
14
16
  * nbColumns: numbers of column you want to have
15
17
  * gridButtonsProps: mainly to manage breakpoints in the differents layout of buttons but you can change all the grid properties. (nbColumns is use with the "sm" breakpoint)
@@ -51,6 +53,7 @@
51
53
  * breakpoint: PropTypes.func,
52
54
  * gridButtonsProps: PropTypes.object,
53
55
  * justify: PropTypes.string,
56
+ * textTransform: PropTypes.string,
54
57
  * };
55
58
  * @theme
56
59
  * // button (See ToggleButton Component)
@@ -27,7 +27,8 @@ var useStyles = makeStyles(function (theme) {
27
27
  },
28
28
  stickyHeader: {
29
29
  position: 'sticky',
30
- top: 0
30
+ top: 0,
31
+ zIndex: 2
31
32
  }
32
33
  };
33
34
  });
@@ -55,6 +56,10 @@ export var getEnhancedValuesHeaderData = function getEnhancedValuesHeaderData(da
55
56
  }, R.times(R.always([]), colLength)))(data);
56
57
  };
57
58
 
59
+ var getCellsWidth = R.addIndex(R.reduce)(function (acc, element, index) {
60
+ return R.append(R.add(acc[index], R.propOr(0, 'offsetWidth', element)), acc);
61
+ }, [0]);
62
+
58
63
  var TableHtml5 = function TableHtml5(_ref) {
59
64
  var cells = _ref.cells,
60
65
  _ref$headerData = _ref.headerData,
@@ -71,10 +76,16 @@ var TableHtml5 = function TableHtml5(_ref) {
71
76
  headerHeight = _useState[0],
72
77
  setHeaderHeight = _useState[1];
73
78
 
79
+ var _useState2 = useState([0]),
80
+ subHeadCellsWidth = _useState2[0],
81
+ setSubHeadCellsWidth = _useState2[1];
82
+
74
83
  var headerRef = useRef(null);
84
+ var subHeadCellsRef = useRef([]);
75
85
 
76
86
  useEffect(function () {
77
87
  setHeaderHeight(R.pathOr(0, ['current', 'clientHeight'], headerRef));
88
+ setSubHeadCellsWidth(getCellsWidth(R.prop('current', subHeadCellsRef)));
78
89
  }, [cells, headerData, sectionsData]);
79
90
 
80
91
  useEffect(function () {
@@ -82,8 +93,9 @@ var TableHtml5 = function TableHtml5(_ref) {
82
93
  var resizeListener = function resizeListener() {
83
94
  clearTimeout(timeoutId);
84
95
  timeoutId = setTimeout(function () {
85
- return setHeaderHeight(R.pathOr(0, ['current', 'clientHeight'], headerRef), 150);
86
- });
96
+ setHeaderHeight(R.pathOr(0, ['current', 'clientHeight'], headerRef));
97
+ setSubHeadCellsWidth(getCellsWidth(R.prop('current', subHeadCellsRef)));
98
+ }, 150);
87
99
  };
88
100
  window.addEventListener('resize', resizeListener);
89
101
  return function () {
@@ -113,7 +125,9 @@ var TableHtml5 = function TableHtml5(_ref) {
113
125
  React.createElement(SubHeader, {
114
126
  headerData: headerData,
115
127
  xLayoutData: xLayoutData,
116
- activeCellIds: activeCellIds
128
+ activeCellIds: activeCellIds,
129
+ ref: subHeadCellsRef,
130
+ subHeadCellsWidth: subHeadCellsWidth
117
131
  })
118
132
  ),
119
133
  mapIndexed(function (section, index) {
@@ -128,7 +142,8 @@ var TableHtml5 = function TableHtml5(_ref) {
128
142
  xLayoutDataLength: xLayoutDataLength,
129
143
  cellHandler: cellHandler,
130
144
  activeCellIds: activeCellIds,
131
- activeCellHandler: activeCellHandler
145
+ activeCellHandler: activeCellHandler,
146
+ subHeadCellsWidth: subHeadCellsWidth
132
147
  });
133
148
  }, sectionsData)
134
149
  );
@@ -74,7 +74,8 @@ var Header = function Header(_ref) {
74
74
  className: cx(classes.tableHeadCell, (_cx = {}, _cx[classes.topCell] = R.not(R.isEmpty(flags)), _cx)),
75
75
  colSpan: R.inc(xLayoutDataLength),
76
76
  id: id,
77
- tabIndex: 0
77
+ tabIndex: 0,
78
+ style: { position: 'sticky', left: 0, zIndex: 1 }
78
79
  },
79
80
  React.createElement(
80
81
  'div',
@@ -26,7 +26,7 @@ var useStyles = makeStyles(function (theme) {
26
26
  verticalAlign: 'middle'
27
27
  },
28
28
  fillerCell: {
29
- width: '30px',
29
+ minWidth: '30px',
30
30
  backgroundColor: theme.palette.grey[200],
31
31
  verticalAlign: 'top',
32
32
  border: 'inherit',
@@ -64,7 +64,8 @@ var Section = function Section(_ref) {
64
64
  activeCellIds = _ref.activeCellIds,
65
65
  headerHeight = _ref.headerHeight,
66
66
  sectionIndex = _ref.sectionIndex,
67
- nbColumnsByRows = _ref.nbColumnsByRows;
67
+ nbColumnsByRows = _ref.nbColumnsByRows,
68
+ subHeadCellsWidth = _ref.subHeadCellsWidth;
68
69
 
69
70
  var classes = useStyles();
70
71
  var currentSection = R.path([0, 'key'], section);
@@ -111,7 +112,8 @@ var Section = function Section(_ref) {
111
112
  className: cx(classes.rowTitle, (_cx = {}, _cx[classes.topCell] = R.not(R.isEmpty(flags)), _cx[classes.highlight] = R.prop(rowId)(activeCellIds), _cx)),
112
113
  id: id,
113
114
  headers: 'subHeader_' + index + ' ' + currentSection,
114
- component: 'th'
115
+ component: 'th',
116
+ style: { position: 'sticky', left: subHeadCellsWidth[index], zIndex: 1 }
115
117
  },
116
118
  React.createElement(
117
119
  'div',
@@ -133,7 +135,8 @@ var Section = function Section(_ref) {
133
135
  React.createElement(
134
136
  TableCell,
135
137
  {
136
- className: cx(classes.fillerCell, (_cx2 = {}, _cx2[classes.highlight] = R.prop(rowId)(activeCellIds), _cx2))
138
+ className: cx(classes.fillerCell, (_cx2 = {}, _cx2[classes.highlight] = R.prop(rowId)(activeCellIds), _cx2)),
139
+ style: { position: 'sticky', left: R.last(subHeadCellsWidth) }
137
140
  },
138
141
  React.createElement(
139
142
  'div',
@@ -180,7 +183,8 @@ Section.propTypes = process.env.NODE_ENV !== "production" ? {
180
183
  sectionIndex: PropTypes.number,
181
184
  headerNumberRows: PropTypes.number,
182
185
  nbColumnsByRows: PropTypes.array,
183
- maxColumns: PropTypes.number
186
+ maxColumns: PropTypes.number,
187
+ subHeadCellsWidth: PropTypes.arrayOf(PropTypes.number)
184
188
  } : {};
185
189
 
186
190
  export default Section;
@@ -64,7 +64,7 @@ var SectionHeader = function SectionHeader(_ref) {
64
64
  {
65
65
  key: section.key,
66
66
  className: classes.stickyHeaderSection,
67
- style: { top: headerHeight + 'px' }
67
+ style: { top: headerHeight, zIndex: 2 }
68
68
  },
69
69
  React.createElement(
70
70
  TableCell,
@@ -44,10 +44,11 @@ var useStyles = makeStyles(function (theme) {
44
44
 
45
45
  var mapIndexed = R.addIndex(R.map);
46
46
 
47
- var SubHeader = function SubHeader(_ref) {
47
+ var SubHeader = React.forwardRef(function (_ref, refs) {
48
48
  var headerData = _ref.headerData,
49
49
  xLayoutData = _ref.xLayoutData,
50
- activeCellIds = _ref.activeCellIds;
50
+ activeCellIds = _ref.activeCellIds,
51
+ subHeadCellsWidth = _ref.subHeadCellsWidth;
51
52
 
52
53
  var classes = useStyles();
53
54
  return React.createElement(
@@ -60,7 +61,11 @@ var SubHeader = function SubHeader(_ref) {
60
61
  component: 'th',
61
62
  className: classes.columnsTitle,
62
63
  key: index,
63
- id: 'subHeader_' + index
64
+ id: 'subHeader_' + index,
65
+ style: { position: 'sticky', left: subHeadCellsWidth[index], zIndex: 1 },
66
+ ref: function ref(element) {
67
+ return refs.current[index] = element;
68
+ }
64
69
  },
65
70
  React.createElement(
66
71
  'div',
@@ -74,7 +79,10 @@ var SubHeader = function SubHeader(_ref) {
74
79
  )
75
80
  );
76
81
  }, xLayoutData),
77
- React.createElement(TableCell, { className: classes.fillerCell }),
82
+ React.createElement(TableCell, {
83
+ className: classes.fillerCell,
84
+ style: { position: 'sticky', left: R.last(subHeadCellsWidth) }
85
+ }),
78
86
  mapIndexed(function (item, index) {
79
87
  var _cx;
80
88
 
@@ -88,12 +96,13 @@ var SubHeader = function SubHeader(_ref) {
88
96
  );
89
97
  }, headerData)
90
98
  );
91
- };
99
+ });
92
100
 
93
101
  SubHeader.propTypes = process.env.NODE_ENV !== "production" ? {
94
102
  activeCellIds: PropTypes.object,
95
103
  headerData: PropTypes.array,
96
- xLayoutData: PropTypes.array
104
+ xLayoutData: PropTypes.array,
105
+ subHeadCellsWidth: PropTypes.arrayOf(PropTypes.number)
97
106
  } : {};
98
107
 
99
108
  export default SubHeader;
@@ -24,7 +24,10 @@ var useStyles = makeStyles(function (theme) {
24
24
  }
25
25
  },
26
26
  label: {
27
- textTransform: 'capitalize',
27
+ textTransform: function textTransform(_ref) {
28
+ var _textTransform = _ref.textTransform;
29
+ return _textTransform;
30
+ },
28
31
  textAlign: 'left',
29
32
  fontSize: '0.9375rem',
30
33
  lineHeight: '1.0'
@@ -36,17 +39,19 @@ var useStyles = makeStyles(function (theme) {
36
39
  };
37
40
  });
38
41
 
39
- var ToggleButton = function ToggleButton(_ref) {
42
+ var ToggleButton = function ToggleButton(_ref2) {
40
43
  var _cx;
41
44
 
42
- var isOpen = _ref.isOpen,
43
- label = _ref.label,
44
- toggle = _ref.toggle,
45
- testId = _ref.testId,
46
- _ref$tabindex = _ref.tabindex,
47
- tabindex = _ref$tabindex === undefined ? 0 : _ref$tabindex;
45
+ var isOpen = _ref2.isOpen,
46
+ label = _ref2.label,
47
+ toggle = _ref2.toggle,
48
+ testId = _ref2.testId,
49
+ _ref2$tabindex = _ref2.tabindex,
50
+ tabindex = _ref2$tabindex === undefined ? 0 : _ref2$tabindex,
51
+ _ref2$textTransform = _ref2.textTransform,
52
+ textTransform = _ref2$textTransform === undefined ? 'capitalize' : _ref2$textTransform;
48
53
 
49
- var classes = useStyles();
54
+ var classes = useStyles({ textTransform: textTransform });
50
55
  return React.createElement(
51
56
  Button,
52
57
  {
@@ -69,7 +74,8 @@ ToggleButton.propTypes = process.env.NODE_ENV !== "production" ? {
69
74
  tabindex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
70
75
  isOpen: PropTypes.bool,
71
76
  label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
72
- toggle: PropTypes.func
77
+ toggle: PropTypes.func,
78
+ textTransform: PropTypes.string
73
79
  } : {};
74
80
 
75
81
  export default ToggleButton;
@@ -1,6 +1,8 @@
1
1
  /**
2
2
  * Button use api of material ui https://material-ui.com/api/button/
3
3
  *
4
+ * textTransform: 'none' | 'capitalize' | 'uppercase' | 'lowercase'
5
+ *
4
6
  * @memberOf VISIONS
5
7
  * @name ToggleButton
6
8
  * @tag component
@@ -12,6 +14,7 @@
12
14
  * isOpen: PropTypes.bool,
13
15
  * label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
14
16
  * toggle: PropTypes.func,
17
+ * textTransform: PropTypes.string,
15
18
  * };
16
19
  *
17
20
  * @theme
@@ -28,18 +28,10 @@ var _Dialog = require('@material-ui/core/Dialog');
28
28
 
29
29
  var _Dialog2 = _interopRequireDefault(_Dialog);
30
30
 
31
- var _DialogTitle = require('@material-ui/core/DialogTitle');
32
-
33
- var _DialogTitle2 = _interopRequireDefault(_DialogTitle);
34
-
35
31
  var _IconButton = require('@material-ui/core/IconButton');
36
32
 
37
33
  var _IconButton2 = _interopRequireDefault(_IconButton);
38
34
 
39
- var _Input = require('@material-ui/core/Input');
40
-
41
- var _Input2 = _interopRequireDefault(_Input);
42
-
43
35
  var _Person = require('@material-ui/icons/Person');
44
36
 
45
37
  var _Person2 = _interopRequireDefault(_Person);
@@ -175,20 +167,38 @@ var AuthDialog = function AuthDialog(_ref) {
175
167
  )
176
168
  ),
177
169
  _react2.default.createElement(
178
- 'div',
170
+ 'form',
179
171
  { className: classes.content },
180
- labels.user,
172
+ _react2.default.createElement(
173
+ 'label',
174
+ { htmlFor: 'login' },
175
+ labels.user
176
+ ),
181
177
  _react2.default.createElement(_TextField2.default, {
182
- inputProps: { className: classes.input },
178
+ inputProps: {
179
+ className: classes.input,
180
+ id: 'login',
181
+ autoComplete: 'username',
182
+ name: 'username'
183
+ },
183
184
  value: user,
184
185
  onChange: function onChange(e) {
185
186
  return setUser(e.target.value);
186
187
  },
187
188
  disabled: isAnonymous
188
189
  }),
189
- labels.password,
190
+ _react2.default.createElement(
191
+ 'label',
192
+ { htmlFor: 'password' },
193
+ labels.password
194
+ ),
190
195
  _react2.default.createElement(_TextField2.default, {
191
- inputProps: { className: classes.input },
196
+ inputProps: {
197
+ className: classes.input,
198
+ id: 'password',
199
+ autoComplete: 'current-password',
200
+ name: 'password'
201
+ },
192
202
  value: password,
193
203
  onChange: function onChange(e) {
194
204
  return setPassword(e.target.value);
@@ -72,7 +72,9 @@ var CollapseButtons = function CollapseButtons(props) {
72
72
  breakpoint = _props$breakpoint === undefined ? function (theme) {
73
73
  return theme.breakpoints.down('sm');
74
74
  } : _props$breakpoint,
75
- justify = props.justify;
75
+ justify = props.justify,
76
+ _props$textTransform = props.textTransform,
77
+ textTransform = _props$textTransform === undefined ? 'none' : _props$textTransform;
76
78
 
77
79
 
78
80
  var classes = useStyles();
@@ -114,6 +116,7 @@ var CollapseButtons = function CollapseButtons(props) {
114
116
  _Grid2.default,
115
117
  _extends({ item: true, xs: 12, sm: 12, md: R.nth(nbColumns)(COLUMNS) }, gridButtonsProps, { key: id }),
116
118
  _react2.default.createElement(_.ToggleButton, {
119
+ textTransform: textTransform,
117
120
  label: label,
118
121
  tabindex: R.isNil(toggleId) || R.prop(id)(toggleId) || R.compose(R.not, R.head, R.values)(toggleId) ? 0 : -1,
119
122
  isOpen: R.prop(id)(toggleId),
@@ -185,7 +188,8 @@ CollapseButtons.propTypes = process.env.NODE_ENV !== "production" ? {
185
188
  isSecondLevelClikable: _propTypes2.default.bool,
186
189
  breakpoint: _propTypes2.default.func,
187
190
  gridButtonsProps: _propTypes2.default.object,
188
- justify: _propTypes2.default.string
191
+ justify: _propTypes2.default.string,
192
+ textTransform: _propTypes2.default.string
189
193
  } : {};
190
194
 
191
195
  exports.default = CollapseButtons;
@@ -60,7 +60,8 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
60
60
  },
61
61
  stickyHeader: {
62
62
  position: 'sticky',
63
- top: 0
63
+ top: 0,
64
+ zIndex: 2
64
65
  }
65
66
  };
66
67
  });
@@ -88,6 +89,10 @@ var getEnhancedValuesHeaderData = exports.getEnhancedValuesHeaderData = function
88
89
  }, R.times(R.always([]), colLength)))(data);
89
90
  };
90
91
 
92
+ var getCellsWidth = R.addIndex(R.reduce)(function (acc, element, index) {
93
+ return R.append(R.add(acc[index], R.propOr(0, 'offsetWidth', element)), acc);
94
+ }, [0]);
95
+
91
96
  var TableHtml5 = function TableHtml5(_ref) {
92
97
  var cells = _ref.cells,
93
98
  _ref$headerData = _ref.headerData,
@@ -104,10 +109,16 @@ var TableHtml5 = function TableHtml5(_ref) {
104
109
  headerHeight = _useState[0],
105
110
  setHeaderHeight = _useState[1];
106
111
 
112
+ var _useState2 = (0, _react.useState)([0]),
113
+ subHeadCellsWidth = _useState2[0],
114
+ setSubHeadCellsWidth = _useState2[1];
115
+
107
116
  var headerRef = (0, _react.useRef)(null);
117
+ var subHeadCellsRef = (0, _react.useRef)([]);
108
118
 
109
119
  (0, _react.useEffect)(function () {
110
120
  setHeaderHeight(R.pathOr(0, ['current', 'clientHeight'], headerRef));
121
+ setSubHeadCellsWidth(getCellsWidth(R.prop('current', subHeadCellsRef)));
111
122
  }, [cells, headerData, sectionsData]);
112
123
 
113
124
  (0, _react.useEffect)(function () {
@@ -115,8 +126,9 @@ var TableHtml5 = function TableHtml5(_ref) {
115
126
  var resizeListener = function resizeListener() {
116
127
  clearTimeout(timeoutId);
117
128
  timeoutId = setTimeout(function () {
118
- return setHeaderHeight(R.pathOr(0, ['current', 'clientHeight'], headerRef), 150);
119
- });
129
+ setHeaderHeight(R.pathOr(0, ['current', 'clientHeight'], headerRef));
130
+ setSubHeadCellsWidth(getCellsWidth(R.prop('current', subHeadCellsRef)));
131
+ }, 150);
120
132
  };
121
133
  window.addEventListener('resize', resizeListener);
122
134
  return function () {
@@ -146,7 +158,9 @@ var TableHtml5 = function TableHtml5(_ref) {
146
158
  _react2.default.createElement(_subHeader2.default, {
147
159
  headerData: headerData,
148
160
  xLayoutData: xLayoutData,
149
- activeCellIds: activeCellIds
161
+ activeCellIds: activeCellIds,
162
+ ref: subHeadCellsRef,
163
+ subHeadCellsWidth: subHeadCellsWidth
150
164
  })
151
165
  ),
152
166
  mapIndexed(function (section, index) {
@@ -161,7 +175,8 @@ var TableHtml5 = function TableHtml5(_ref) {
161
175
  xLayoutDataLength: xLayoutDataLength,
162
176
  cellHandler: cellHandler,
163
177
  activeCellIds: activeCellIds,
164
- activeCellHandler: activeCellHandler
178
+ activeCellHandler: activeCellHandler,
179
+ subHeadCellsWidth: subHeadCellsWidth
165
180
  });
166
181
  }, sectionsData)
167
182
  );
@@ -106,7 +106,8 @@ var Header = function Header(_ref) {
106
106
  className: (0, _classnames2.default)(classes.tableHeadCell, (_cx = {}, _cx[classes.topCell] = R.not(R.isEmpty(flags)), _cx)),
107
107
  colSpan: R.inc(xLayoutDataLength),
108
108
  id: id,
109
- tabIndex: 0
109
+ tabIndex: 0,
110
+ style: { position: 'sticky', left: 0, zIndex: 1 }
110
111
  },
111
112
  _react2.default.createElement(
112
113
  'div',
@@ -68,7 +68,7 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
68
68
  verticalAlign: 'middle'
69
69
  },
70
70
  fillerCell: {
71
- width: '30px',
71
+ minWidth: '30px',
72
72
  backgroundColor: theme.palette.grey[200],
73
73
  verticalAlign: 'top',
74
74
  border: 'inherit',
@@ -106,7 +106,8 @@ var Section = function Section(_ref) {
106
106
  activeCellIds = _ref.activeCellIds,
107
107
  headerHeight = _ref.headerHeight,
108
108
  sectionIndex = _ref.sectionIndex,
109
- nbColumnsByRows = _ref.nbColumnsByRows;
109
+ nbColumnsByRows = _ref.nbColumnsByRows,
110
+ subHeadCellsWidth = _ref.subHeadCellsWidth;
110
111
 
111
112
  var classes = useStyles();
112
113
  var currentSection = R.path([0, 'key'], section);
@@ -153,7 +154,8 @@ var Section = function Section(_ref) {
153
154
  className: (0, _classnames2.default)(classes.rowTitle, (_cx = {}, _cx[classes.topCell] = R.not(R.isEmpty(flags)), _cx[classes.highlight] = R.prop(rowId)(activeCellIds), _cx)),
154
155
  id: id,
155
156
  headers: 'subHeader_' + index + ' ' + currentSection,
156
- component: 'th'
157
+ component: 'th',
158
+ style: { position: 'sticky', left: subHeadCellsWidth[index], zIndex: 1 }
157
159
  },
158
160
  _react2.default.createElement(
159
161
  'div',
@@ -175,7 +177,8 @@ var Section = function Section(_ref) {
175
177
  _react2.default.createElement(
176
178
  _TableCell2.default,
177
179
  {
178
- className: (0, _classnames2.default)(classes.fillerCell, (_cx2 = {}, _cx2[classes.highlight] = R.prop(rowId)(activeCellIds), _cx2))
180
+ className: (0, _classnames2.default)(classes.fillerCell, (_cx2 = {}, _cx2[classes.highlight] = R.prop(rowId)(activeCellIds), _cx2)),
181
+ style: { position: 'sticky', left: R.last(subHeadCellsWidth) }
179
182
  },
180
183
  _react2.default.createElement(
181
184
  'div',
@@ -222,7 +225,8 @@ Section.propTypes = process.env.NODE_ENV !== "production" ? {
222
225
  sectionIndex: _propTypes2.default.number,
223
226
  headerNumberRows: _propTypes2.default.number,
224
227
  nbColumnsByRows: _propTypes2.default.array,
225
- maxColumns: _propTypes2.default.number
228
+ maxColumns: _propTypes2.default.number,
229
+ subHeadCellsWidth: _propTypes2.default.arrayOf(_propTypes2.default.number)
226
230
  } : {};
227
231
 
228
232
  exports.default = Section;
@@ -97,7 +97,7 @@ var SectionHeader = function SectionHeader(_ref) {
97
97
  {
98
98
  key: section.key,
99
99
  className: classes.stickyHeaderSection,
100
- style: { top: headerHeight + 'px' }
100
+ style: { top: headerHeight, zIndex: 2 }
101
101
  },
102
102
  _react2.default.createElement(
103
103
  _TableCell2.default,
@@ -77,10 +77,11 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
77
77
 
78
78
  var mapIndexed = R.addIndex(R.map);
79
79
 
80
- var SubHeader = function SubHeader(_ref) {
80
+ var SubHeader = _react2.default.forwardRef(function (_ref, refs) {
81
81
  var headerData = _ref.headerData,
82
82
  xLayoutData = _ref.xLayoutData,
83
- activeCellIds = _ref.activeCellIds;
83
+ activeCellIds = _ref.activeCellIds,
84
+ subHeadCellsWidth = _ref.subHeadCellsWidth;
84
85
 
85
86
  var classes = useStyles();
86
87
  return _react2.default.createElement(
@@ -93,7 +94,11 @@ var SubHeader = function SubHeader(_ref) {
93
94
  component: 'th',
94
95
  className: classes.columnsTitle,
95
96
  key: index,
96
- id: 'subHeader_' + index
97
+ id: 'subHeader_' + index,
98
+ style: { position: 'sticky', left: subHeadCellsWidth[index], zIndex: 1 },
99
+ ref: function ref(element) {
100
+ return refs.current[index] = element;
101
+ }
97
102
  },
98
103
  _react2.default.createElement(
99
104
  'div',
@@ -107,7 +112,10 @@ var SubHeader = function SubHeader(_ref) {
107
112
  )
108
113
  );
109
114
  }, xLayoutData),
110
- _react2.default.createElement(_TableCell2.default, { className: classes.fillerCell }),
115
+ _react2.default.createElement(_TableCell2.default, {
116
+ className: classes.fillerCell,
117
+ style: { position: 'sticky', left: R.last(subHeadCellsWidth) }
118
+ }),
111
119
  mapIndexed(function (item, index) {
112
120
  var _cx;
113
121
 
@@ -121,12 +129,13 @@ var SubHeader = function SubHeader(_ref) {
121
129
  );
122
130
  }, headerData)
123
131
  );
124
- };
132
+ });
125
133
 
126
134
  SubHeader.propTypes = process.env.NODE_ENV !== "production" ? {
127
135
  activeCellIds: _propTypes2.default.object,
128
136
  headerData: _propTypes2.default.array,
129
- xLayoutData: _propTypes2.default.array
137
+ xLayoutData: _propTypes2.default.array,
138
+ subHeadCellsWidth: _propTypes2.default.arrayOf(_propTypes2.default.number)
130
139
  } : {};
131
140
 
132
141
  exports.default = SubHeader;
@@ -53,7 +53,10 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
53
53
  }
54
54
  },
55
55
  label: {
56
- textTransform: 'capitalize',
56
+ textTransform: function textTransform(_ref) {
57
+ var _textTransform = _ref.textTransform;
58
+ return _textTransform;
59
+ },
57
60
  textAlign: 'left',
58
61
  fontSize: '0.9375rem',
59
62
  lineHeight: '1.0'
@@ -65,17 +68,19 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
65
68
  };
66
69
  });
67
70
 
68
- var ToggleButton = function ToggleButton(_ref) {
71
+ var ToggleButton = function ToggleButton(_ref2) {
69
72
  var _cx;
70
73
 
71
- var isOpen = _ref.isOpen,
72
- label = _ref.label,
73
- toggle = _ref.toggle,
74
- testId = _ref.testId,
75
- _ref$tabindex = _ref.tabindex,
76
- tabindex = _ref$tabindex === undefined ? 0 : _ref$tabindex;
74
+ var isOpen = _ref2.isOpen,
75
+ label = _ref2.label,
76
+ toggle = _ref2.toggle,
77
+ testId = _ref2.testId,
78
+ _ref2$tabindex = _ref2.tabindex,
79
+ tabindex = _ref2$tabindex === undefined ? 0 : _ref2$tabindex,
80
+ _ref2$textTransform = _ref2.textTransform,
81
+ textTransform = _ref2$textTransform === undefined ? 'capitalize' : _ref2$textTransform;
77
82
 
78
- var classes = useStyles();
83
+ var classes = useStyles({ textTransform: textTransform });
79
84
  return _react2.default.createElement(
80
85
  _Button2.default,
81
86
  {
@@ -98,7 +103,8 @@ ToggleButton.propTypes = process.env.NODE_ENV !== "production" ? {
98
103
  tabindex: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]),
99
104
  isOpen: _propTypes2.default.bool,
100
105
  label: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.element]),
101
- toggle: _propTypes2.default.func
106
+ toggle: _propTypes2.default.func,
107
+ textTransform: _propTypes2.default.string
102
108
  } : {};
103
109
 
104
110
  exports.default = ToggleButton;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-visions",
3
- "version": "6.5.0",
3
+ "version": "6.6.1",
4
4
  "description": "Library of visual components",
5
5
  "author": "OECD",
6
6
  "homepage": "https://visions-qa.siscc.org/#o",
@@ -76,7 +76,7 @@
76
76
  "jest-environment-jsdom-fourteen": "0.1.0",
77
77
  "jss-rtl": "^0.2.3",
78
78
  "lint-staged": "^8.2.1",
79
- "nwb": "^0.23.0",
79
+ "nwb": "0.23.0",
80
80
  "prettier": "1.12.1",
81
81
  "pretty-quick": "^1.10.0",
82
82
  "react-a11y": "^1.1.0",