@sis-cc/dotstatsuite-visions 6.6.1 → 6.7.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.
@@ -19,12 +19,12 @@
19
19
  * onClose: PropTypes.func.isRequired,
20
20
  * onSubmit: PropTypes.func.isRequired
21
21
  * };
22
+ * @demoReady
22
23
  */
23
24
 
24
25
  import React, { useState } from 'react';
25
26
  import PropTypes from 'prop-types';
26
27
  import { isEmpty } from 'ramda';
27
- 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';
@@ -33,8 +33,9 @@ import PersonIcon from '@material-ui/icons/Person';
33
33
  import TextField from '@material-ui/core/TextField';
34
34
  import Typography from '@material-ui/core/Typography';
35
35
  import { makeStyles } from '@material-ui/core/styles';
36
+ import Button from '../Button';
36
37
 
37
- var useStyles = makeStyles(function (theme) {
38
+ var useStyles = makeStyles(function () {
38
39
  return {
39
40
  header: {
40
41
  color: 'grey',
@@ -0,0 +1,97 @@
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
+
3
+ import React, { useEffect } from 'react';
4
+ import PropTypes from 'prop-types';
5
+ import cx from 'classnames';
6
+ import { pathOr } from 'ramda';
7
+ import { makeStyles, useTheme } from '@material-ui/core/styles';
8
+ import Collapse from '@material-ui/core/Collapse';
9
+ import Button from '@material-ui/core/Button';
10
+ import KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown';
11
+ import KeyboardArrowUpIcon from '@material-ui/icons/KeyboardArrowUp';
12
+
13
+ var VARIANT_ICON = 'icon';
14
+ export var VARIANT_BOLD = 'bold';
15
+
16
+ var useStyles = makeStyles(function (theme) {
17
+ var _ref;
18
+
19
+ return _ref = {
20
+ buttonExpand: {
21
+ display: 'flex',
22
+ justifyContent: 'space-between'
23
+ }
24
+ }, _ref['button' + VARIANT_ICON] = {
25
+ color: theme.palette.primary.main,
26
+ backgroundColor: 'rgba(24, 32, 38, 0.04)',
27
+ margin: theme.spacing(1, 0)
28
+ }, _ref['button' + VARIANT_BOLD] = _extends({
29
+ marginBottom: theme.spacing(1),
30
+ padding: theme.spacing(0.5, 0, 1, 0),
31
+ '&:hover': {
32
+ backgroundColor: 'unset'
33
+ }
34
+ }, pathOr({}, ['mixins', 'collapsibleTree', 'buttonSublevel'], theme)), _ref['collapsibleContainer' + VARIANT_BOLD] = {
35
+ borderTop: '2px solid black',
36
+ marginTop: theme.spacing(2),
37
+ marginBottom: theme.spacing(2)
38
+ }, _ref;
39
+ });
40
+
41
+ var CollapseComponent = function CollapseComponent(_ref2) {
42
+ var label = _ref2.label,
43
+ isOpen = _ref2.isOpen,
44
+ children = _ref2.children,
45
+ _ref2$variant = _ref2.variant,
46
+ variant = _ref2$variant === undefined ? VARIANT_ICON : _ref2$variant,
47
+ level = _ref2.level;
48
+
49
+ var classes = useStyles();
50
+ var theme = useTheme();
51
+
52
+ var _React$useState = React.useState(isOpen),
53
+ open = _React$useState[0],
54
+ setOpen = _React$useState[1];
55
+
56
+ useEffect(function () {
57
+ return setOpen(isOpen);
58
+ }, [isOpen]);
59
+
60
+ return React.createElement(
61
+ 'div',
62
+ {
63
+ className: cx(classes['collapsibleContainer' + variant]),
64
+ style: {
65
+ marginRight: theme.spacing(level * 2),
66
+ marginLeft: theme.spacing(level * 2)
67
+ }
68
+ },
69
+ React.createElement(
70
+ Button,
71
+ {
72
+ className: cx(classes.buttonExpand, classes['button' + variant]),
73
+ onClick: function onClick() {
74
+ return setOpen(!open);
75
+ },
76
+ fullWidth: true
77
+ },
78
+ label,
79
+ open ? React.createElement(KeyboardArrowUpIcon, { color: 'primary' }) : React.createElement(KeyboardArrowDownIcon, { color: 'primary' })
80
+ ),
81
+ React.createElement(
82
+ Collapse,
83
+ { 'in': open, timeout: 'auto' },
84
+ children
85
+ )
86
+ );
87
+ };
88
+
89
+ CollapseComponent.propTypes = process.env.NODE_ENV !== "production" ? {
90
+ label: PropTypes.string,
91
+ isOpen: PropTypes.bool,
92
+ children: PropTypes.node,
93
+ variant: PropTypes.oneOf([VARIANT_ICON, VARIANT_BOLD]),
94
+ level: PropTypes.number
95
+ } : {};
96
+
97
+ export default CollapseComponent;
@@ -0,0 +1,171 @@
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
+
3
+ import React, { useState, Fragment, useEffect } from 'react';
4
+ import * as R from 'ramda';
5
+ import PropTypes from 'prop-types';
6
+ import Container from '@material-ui/core/Container';
7
+ import { makeStyles } from '@material-ui/core/styles';
8
+ import Typography from '@material-ui/core/Typography';
9
+ import Divider from '@material-ui/core/Divider';
10
+ import Button from '@material-ui/core/Button';
11
+ import KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown';
12
+ import KeyboardArrowUpIcon from '@material-ui/icons/KeyboardArrowUp';
13
+ import CircularProgress from '@material-ui/core/CircularProgress';
14
+ import Grid from '@material-ui/core/Grid';
15
+ import Collapse, { VARIANT_BOLD } from './Collapse';
16
+
17
+ var useStyles = makeStyles(function (theme) {
18
+ return {
19
+ title: _extends({
20
+ fontWeight: 'bold'
21
+ }, R.pathOr({}, ['mixins', 'collapsibleTree', 'title'], theme)),
22
+ divider: {
23
+ marginBottom: theme.spacing(2)
24
+ },
25
+ spacingValue: {
26
+ marginLeft: theme.spacing(2),
27
+ marginRight: theme.spacing(2),
28
+ marginBottom: theme.spacing(2)
29
+ }
30
+ };
31
+ });
32
+
33
+ var CollapsibleTree = function CollapsibleTree(_ref) {
34
+ var _ref$data = _ref.data,
35
+ data = _ref$data === undefined ? [] : _ref$data,
36
+ _ref$defaultDepthLeve = _ref.defaultDepthLevel,
37
+ defaultDepthLevel = _ref$defaultDepthLeve === undefined ? 1 : _ref$defaultDepthLeve,
38
+ isLoading = _ref.isLoading,
39
+ children = _ref.children,
40
+ labels = _ref.labels,
41
+ _ref$testId = _ref.testId,
42
+ testId = _ref$testId === undefined ? 'collapsible-tree' : _ref$testId;
43
+
44
+ var classes = useStyles();
45
+
46
+ var _useState = useState(defaultDepthLevel),
47
+ depthLevel = _useState[0],
48
+ setDepthLevel = _useState[1];
49
+
50
+ useEffect(function () {
51
+ return setDepthLevel(defaultDepthLevel);
52
+ }, [defaultDepthLevel]);
53
+
54
+ if (isLoading) {
55
+ return React.createElement(
56
+ Grid,
57
+ { container: true, item: true, justifyContent: 'center' },
58
+ React.createElement(CircularProgress, null)
59
+ );
60
+ }
61
+
62
+ var handleCollapse = function handleCollapse(isAllOpen) {
63
+ if (isAllOpen) return setDepthLevel(undefined);
64
+ return setDepthLevel(defaultDepthLevel);
65
+ };
66
+
67
+ var isAllOpen = depthLevel >= defaultDepthLevel;
68
+ var buttonAllOpenLabel = isAllOpen ? R.prop('collapseAll', labels) : R.prop('expandAll', labels);
69
+
70
+ return React.createElement(
71
+ Fragment,
72
+ null,
73
+ React.createElement(
74
+ Container,
75
+ { disableGutters: true, 'data-testid': testId },
76
+ React.createElement(
77
+ Button,
78
+ {
79
+ 'aria-label': buttonAllOpenLabel,
80
+ color: 'primary',
81
+ endIcon: isAllOpen ? React.createElement(KeyboardArrowDownIcon, { color: 'primary' }) : React.createElement(KeyboardArrowUpIcon, { color: 'primary' }),
82
+ onClick: function onClick() {
83
+ return handleCollapse(isAllOpen);
84
+ }
85
+ },
86
+ buttonAllOpenLabel
87
+ ),
88
+ children
89
+ ),
90
+ R.map(function (_ref2) {
91
+ var id = _ref2.id,
92
+ label = _ref2.label,
93
+ _ref2$children = _ref2.children,
94
+ children = _ref2$children === undefined ? [] : _ref2$children;
95
+
96
+ return React.createElement(
97
+ Fragment,
98
+ { key: id },
99
+ React.createElement(Divider, { className: classes.divider }),
100
+ React.createElement(
101
+ Typography,
102
+ { variant: 'h5', className: classes.title },
103
+ label
104
+ ),
105
+ R.map(function (_ref3) {
106
+ var id = _ref3.id,
107
+ label = _ref3.label,
108
+ children = _ref3.children,
109
+ value = _ref3.value;
110
+
111
+ return React.createElement(
112
+ Collapse,
113
+ { key: id, level: 0, label: label, isOpen: depthLevel >= 0 },
114
+ value && React.createElement(
115
+ Typography,
116
+ { className: classes.spacingValue, variant: 'body2' },
117
+ value
118
+ ),
119
+ children && R.map(function (_ref4) {
120
+ var id = _ref4.id,
121
+ label = _ref4.label,
122
+ value = _ref4.value;
123
+
124
+ return React.createElement(
125
+ Collapse,
126
+ {
127
+ key: id,
128
+ level: 1,
129
+ variant: VARIANT_BOLD,
130
+ label: label,
131
+ isOpen: depthLevel >= 1
132
+ },
133
+ React.createElement(
134
+ Typography,
135
+ { variant: 'body2' },
136
+ value
137
+ )
138
+ );
139
+ }, children)
140
+ );
141
+ }, children)
142
+ );
143
+ }, data)
144
+ );
145
+ };
146
+
147
+ CollapsibleTree.propTypes = process.env.NODE_ENV !== "production" ? {
148
+ data: PropTypes.arrayOf(PropTypes.shape({
149
+ id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
150
+ label: PropTypes.string,
151
+ children: PropTypes.arrayOf(PropTypes.shape({
152
+ id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
153
+ label: PropTypes.string,
154
+ children: PropTypes.arrayOf(PropTypes.shape({
155
+ id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
156
+ label: PropTypes.string,
157
+ value: PropTypes.string
158
+ }))
159
+ }))
160
+ })),
161
+ defaultDepthLevel: PropTypes.number,
162
+ isLoading: PropTypes.bool,
163
+ children: PropTypes.node,
164
+ labels: PropTypes.shape({
165
+ collapseAll: PropTypes.string,
166
+ expandAll: PropTypes.string
167
+ }),
168
+ testId: PropTypes.string
169
+ } : {};
170
+
171
+ export default CollapsibleTree;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * CollapsibleTree is a component that show you a tree structure with a button to expand/collapse each node.
3
+ * defaultDepthLevel is the maximum level that will be open by "collapse all" button value could be 0|1. set to 1 by default.
4
+ *
5
+ * @memberOf VISIONS
6
+ * @name CollapsibleTree
7
+ * @tag component
8
+ * @api public
9
+ * @props
10
+ * CollapsibleTree.propTypes = {
11
+ * data: PropTypes.arrayOf(PropTypes.shape({
12
+ * id: PropTypes.string.isRequired,
13
+ * label: PropTypes.string,
14
+ * children: PropTypes.arrayOf(PropTypes.shape({
15
+ * id: PropTypes.string.isRequired,
16
+ * label: PropTypes.string,
17
+ * children: PropTypes.arrayOf(PropTypes.shape({
18
+ * id: PropTypes.string.isRequired,
19
+ * label: PropTypes.string,
20
+ * value: PropTypes.string,
21
+ * })),
22
+ * }))
23
+ * })),
24
+ * defaultDepthLevel: PropTypes.number,
25
+ * testId: PropTypes.string,
26
+ *};
27
+ * @theme
28
+ * {
29
+ * palette: {
30
+ * primary: {
31
+ * main: // color label button
32
+ * },
33
+ * }
34
+ * mixins: {
35
+ * CollapsibleTree: {
36
+ * title: {
37
+ * // font, color, of titles
38
+ * },
39
+ * }
40
+ * @demoReady
41
+ *
42
+ */
43
+
44
+ export { default } from './CollapsibleTree';
@@ -12,7 +12,7 @@ import IconButton from '@material-ui/core/IconButton';
12
12
  import Done from '@material-ui/icons/Done';
13
13
  import RotateLeftIcon from '@material-ui/icons/RotateLeft';
14
14
 
15
- var useStyles = makeStyles(function (theme) {
15
+ var useStyles = makeStyles(function () {
16
16
  return {
17
17
  visibility: {
18
18
  visibility: 'hidden'
package/es/Share/Mode.js CHANGED
@@ -4,12 +4,13 @@ import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import * as R from 'ramda';
6
6
  import Card from '@material-ui/core/Card';
7
- import { makeStyles } from '@material-ui/core/styles';
7
+ import { makeStyles, useTheme } from '@material-ui/core/styles';
8
8
  import CardContent from '@material-ui/core/CardContent';
9
9
  import Typography from '@material-ui/core/Typography';
10
10
  import RadioGroup from '@material-ui/core/RadioGroup';
11
11
  import FormControlLabel from '@material-ui/core/FormControlLabel';
12
12
  import Radio from '@material-ui/core/Radio';
13
+ import { Tooltip, Warning as WarningIcon } from '../';
13
14
 
14
15
  var useStyles = makeStyles(function (theme) {
15
16
  return {
@@ -28,16 +29,54 @@ var useStyles = makeStyles(function (theme) {
28
29
  padding: theme.spacing(1, 0)
29
30
  }
30
31
  },
31
- label: theme.typography.body2
32
+ label: theme.typography.body2,
33
+ warning: _extends({
34
+ marginLeft: theme.spacing(0.5),
35
+ width: 'unset',
36
+ fontSize: 'inherit',
37
+ height: '1.3em'
38
+ }, R.pathOr({}, ['mixins', 'share', 'warning'], theme))
32
39
  };
33
40
  });
34
41
 
35
- var Mode = function Mode(_ref) {
36
- var changeMode = _ref.changeMode,
37
- mode = _ref.mode,
38
- _ref$modes = _ref.modes,
39
- modes = _ref$modes === undefined ? [] : _ref$modes,
40
- title = _ref.title;
42
+ var Warning = function Warning(_ref) {
43
+ var title = _ref.title;
44
+
45
+ var classes = useStyles();
46
+ var theme = useTheme();
47
+ var warningColor = R.path(['palette', 'highlight', 'hl1'], theme) || theme.palette.primary.dark;
48
+ var warningTextColor = theme.palette.getContrastText(warningColor);
49
+ return React.createElement(
50
+ Tooltip,
51
+ {
52
+ className: classes.warning,
53
+ title: title,
54
+ tabIndex: 0,
55
+ variant: 'warning',
56
+ 'aria-hidden': false,
57
+ placement: 'bottom',
58
+ PopperProps: {
59
+ modifiers: {
60
+ flip: {
61
+ behavior: ['bottom', 'top', 'left', 'right']
62
+ }
63
+ }
64
+ }
65
+ },
66
+ React.createElement(WarningIcon, { pathBackgroundColor: warningColor, pathColor: warningTextColor })
67
+ );
68
+ };
69
+
70
+ Warning.propTypes = process.env.NODE_ENV !== "production" ? {
71
+ title: PropTypes.string
72
+ } : {};
73
+
74
+ var Mode = function Mode(_ref2) {
75
+ var changeMode = _ref2.changeMode,
76
+ mode = _ref2.mode,
77
+ _ref2$modes = _ref2.modes,
78
+ modes = _ref2$modes === undefined ? [] : _ref2$modes,
79
+ title = _ref2.title;
41
80
 
42
81
  var classes = useStyles();
43
82
  return React.createElement(
@@ -56,14 +95,20 @@ var Mode = function Mode(_ref) {
56
95
  { onChange: function onChange(e) {
57
96
  return changeMode(e.target.value);
58
97
  }, value: mode },
59
- R.map(function (_ref2) {
60
- var label = _ref2.label,
61
- value = _ref2.value;
98
+ R.map(function (_ref3) {
99
+ var label = _ref3.label,
100
+ value = _ref3.value,
101
+ warningMessage = _ref3.warningMessage;
62
102
  return React.createElement(FormControlLabel, {
63
103
  classes: { label: classes.label },
64
104
  key: value,
65
105
  control: React.createElement(Radio, { variant: 'outlined', color: 'primary' }),
66
- label: label,
106
+ label: React.createElement(
107
+ 'span',
108
+ null,
109
+ label,
110
+ warningMessage && React.createElement(Warning, { title: warningMessage })
111
+ ),
67
112
  value: value
68
113
  });
69
114
  })(modes)
@@ -77,7 +122,8 @@ Mode.propTypes = process.env.NODE_ENV !== "production" ? {
77
122
  mode: PropTypes.string,
78
123
  modes: PropTypes.arrayOf(PropTypes.shape({
79
124
  label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
80
- value: PropTypes.string
125
+ value: PropTypes.string,
126
+ warningMessage: PropTypes.string
81
127
  })),
82
128
  title: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
83
129
  } : {};
package/es/Share/index.js CHANGED
@@ -16,7 +16,13 @@
16
16
  * isSharing: PropTypes.bool,
17
17
  * mail: PropTypes.string,
18
18
  * mode: PropTypes.string,
19
- * modes: PropTypes.array,
19
+ * modes: PropTypes.arrayOf(
20
+ * PropTypes.shape({
21
+ * label: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
22
+ * value: PropTypes.string,
23
+ * warningMessage: PropTypes.string,
24
+ * }),
25
+ * ),
20
26
  * labels: PropTypes.shape({
21
27
  * title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
22
28
  * disclaimer: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
@@ -48,9 +54,11 @@
48
54
  * mixins: {
49
55
  * share: {
50
56
  * tile: // font, color...
57
+ * warning: // font, color, height...
51
58
  * }
52
59
  * }
53
60
  * }
61
+ * @demoReady
54
62
  */
55
63
 
56
64
  export { default } from './Share';
@@ -68,7 +68,10 @@ var TableHtml5 = function TableHtml5(_ref) {
68
68
  sectionsData = _ref$sectionsData === undefined ? [] : _ref$sectionsData,
69
69
  cellHandler = _ref.cellHandler,
70
70
  activeCellIds = _ref.activeCellIds,
71
- activeCellHandler = _ref.activeCellHandler;
71
+ activeCellHandler = _ref.activeCellHandler,
72
+ sideToggle = _ref.sideToggle,
73
+ _ref$testId = _ref.testId,
74
+ testId = _ref$testId === undefined ? 'vis-table' : _ref$testId;
72
75
 
73
76
  var classes = useStyles();
74
77
 
@@ -110,22 +113,29 @@ var TableHtml5 = function TableHtml5(_ref) {
110
113
  var xLayoutDataLength = R.length(xLayoutData);
111
114
  var valuesHeaderData = getEnhancedValuesHeaderData(headerData);
112
115
  var nbColumnsByRows = R.map(R.length)(valuesHeaderData);
113
-
114
116
  return React.createElement(
115
117
  Table,
116
- { className: classes.table, 'aria-label': 'table', size: 'small', style: { padding: '0px 0px' } },
118
+ {
119
+ className: classes.table,
120
+ 'aria-label': 'table',
121
+ size: 'small',
122
+ style: { padding: '0px 0px' },
123
+ 'data-testid': testId
124
+ },
117
125
  React.createElement(
118
126
  'thead',
119
127
  { ref: headerRef, className: classes.stickyHeader },
120
128
  React.createElement(Header, {
121
129
  headerData: headerData,
122
130
  valuesHeaderData: valuesHeaderData,
123
- xLayoutDataLength: xLayoutDataLength
131
+ xLayoutDataLength: xLayoutDataLength,
132
+ subHeadCellsWidth: subHeadCellsWidth
124
133
  }),
125
134
  React.createElement(SubHeader, {
126
135
  headerData: headerData,
127
136
  xLayoutData: xLayoutData,
128
137
  activeCellIds: activeCellIds,
138
+ sideToggle: sideToggle,
129
139
  ref: subHeadCellsRef,
130
140
  subHeadCellsWidth: subHeadCellsWidth
131
141
  })
@@ -143,6 +153,7 @@ var TableHtml5 = function TableHtml5(_ref) {
143
153
  cellHandler: cellHandler,
144
154
  activeCellIds: activeCellIds,
145
155
  activeCellHandler: activeCellHandler,
156
+ sideToggle: sideToggle,
146
157
  subHeadCellsWidth: subHeadCellsWidth
147
158
  });
148
159
  }, sectionsData)
@@ -155,7 +166,9 @@ TableHtml5.propTypes = process.env.NODE_ENV !== "production" ? {
155
166
  sectionsData: PropTypes.array,
156
167
  cellHandler: PropTypes.func,
157
168
  activeCellHandler: PropTypes.func,
158
- activeCellIds: PropTypes.object
169
+ activeCellIds: PropTypes.object,
170
+ sideToggle: PropTypes.func,
171
+ testId: PropTypes.string
159
172
  } : {};
160
173
 
161
174
  export default TableHtml5;
@@ -6,6 +6,7 @@ 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';
9
10
  import Flags from './flags';
10
11
 
11
12
  var useStyles = makeStyles(function (theme) {
@@ -47,7 +48,9 @@ var Cell = function Cell(_ref) {
47
48
  cellHandler = _ref.cellHandler,
48
49
  activeCellHandler = _ref.activeCellHandler,
49
50
  isActive = _ref.isActive,
50
- isHighlight = _ref.isHighlight;
51
+ isHighlight = _ref.isHighlight,
52
+ sideProps = _ref.sideProps,
53
+ sideToggle = _ref.sideToggle;
51
54
 
52
55
  var classes = useStyles();
53
56
  var hasFlag = R.not(R.isEmpty(flags));
@@ -80,6 +83,7 @@ var Cell = function Cell(_ref) {
80
83
  React.createElement(
81
84
  Typography,
82
85
  { variant: 'body1', tabIndex: 0, noWrap: hasFlag },
86
+ React.createElement(SideIcon, { sideProps: sideProps, sideToggle: sideToggle }),
83
87
  hasFlag && React.createElement(Flags, { flags: flags }),
84
88
  uiValue
85
89
  )
@@ -96,7 +100,9 @@ Cell.propTypes = process.env.NODE_ENV !== "production" ? {
96
100
  cellHandler: PropTypes.func,
97
101
  isActive: PropTypes.bool,
98
102
  isHighlight: PropTypes.bool,
99
- activeCellHandler: PropTypes.func
103
+ activeCellHandler: PropTypes.func,
104
+ sideProps: PropTypes.object,
105
+ sideToggle: PropTypes.func
100
106
  } : {};
101
107
 
102
108
  export default Cell;
@@ -3,10 +3,11 @@ import * as R from 'ramda';
3
3
  import PropTypes from 'prop-types';
4
4
  import cx from 'classnames';
5
5
  import Typography from '@material-ui/core/Typography';
6
- import { makeStyles } from '@material-ui/core/styles';
6
+ import { makeStyles, useTheme } from '@material-ui/core/styles';
7
7
  import TableCell from '@material-ui/core/TableCell';
8
8
  import TableRow from '@material-ui/core/TableRow';
9
9
  import Flags from './flags';
10
+ import { getIsRtl } from '../utils';
10
11
 
11
12
  var useStyles = makeStyles(function (theme) {
12
13
  return {
@@ -40,9 +41,7 @@ var useStyles = makeStyles(function (theme) {
40
41
  paddingTop: 0
41
42
  },
42
43
  stickyLabel: {
43
- position: 'sticky',
44
- left: theme.spacing(1),
45
- right: theme.spacing(1)
44
+ position: 'sticky'
46
45
  }
47
46
  };
48
47
  });
@@ -53,9 +52,15 @@ var mapIndexed = R.addIndex(R.map);
53
52
  var Header = function Header(_ref) {
54
53
  var headerData = _ref.headerData,
55
54
  valuesHeaderData = _ref.valuesHeaderData,
56
- xLayoutDataLength = _ref.xLayoutDataLength;
55
+ xLayoutDataLength = _ref.xLayoutDataLength,
56
+ subHeadCellsWidth = _ref.subHeadCellsWidth;
57
57
 
58
58
  var classes = useStyles();
59
+ var theme = useTheme();
60
+ var isRtl = getIsRtl(theme);
61
+
62
+ var stickyLabelPosition = R.last(subHeadCellsWidth) + 30 + theme.spacing(1);
63
+
59
64
  if (R.compose(R.anyPass([R.isNil, R.isEmpty]), R.path([0, 'data']))(headerData)) return null;
60
65
  return timesIndexed(function (index) {
61
66
  var _cx;
@@ -75,7 +80,7 @@ var Header = function Header(_ref) {
75
80
  colSpan: R.inc(xLayoutDataLength),
76
81
  id: id,
77
82
  tabIndex: 0,
78
- style: { position: 'sticky', left: 0, zIndex: 1 }
83
+ style: isRtl ? { position: 'sticky', zIndex: 1, right: 0 } : { position: 'sticky', zIndex: 1, left: 0 }
79
84
  },
80
85
  React.createElement(
81
86
  'div',
@@ -108,7 +113,14 @@ var Header = function Header(_ref) {
108
113
  { className: classes.cellContentCenter },
109
114
  React.createElement(
110
115
  Typography,
111
- { className: classes.stickyLabel, variant: 'body1' },
116
+ {
117
+ className: classes.stickyLabel,
118
+ style: {
119
+ left: isRtl ? theme.spacing(1) : stickyLabelPosition,
120
+ right: isRtl ? stickyLabelPosition : theme.spacing(1)
121
+ },
122
+ variant: 'body1'
123
+ },
112
124
  R.prop('label', headerItem),
113
125
  React.createElement(Flags, { flags: flags, isHeader: true })
114
126
  )
@@ -122,7 +134,8 @@ var Header = function Header(_ref) {
122
134
  Header.propTypes = process.env.NODE_ENV !== "production" ? {
123
135
  headerData: PropTypes.array,
124
136
  valuesHeaderData: PropTypes.array,
125
- xLayoutDataLength: PropTypes.number
137
+ xLayoutDataLength: PropTypes.number,
138
+ subHeadCellsWidth: PropTypes.array
126
139
  } : {};
127
140
 
128
141
  export default Header;