@sis-cc/dotstatsuite-visions 6.7.1 → 7.2.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 +10 -1
- package/es/TableHtml5/TableHtml5.js +4 -4
- package/es/TableHtml5/cell.js +3 -4
- package/es/TableHtml5/index.js +1 -0
- package/es/TableHtml5/section.js +5 -6
- package/es/TableHtml5/sectionHeader.js +8 -9
- package/es/TableHtml5/subHeader.js +3 -4
- package/es/index.js +0 -1
- package/lib/CollapsibleTree/CollapsibleTree.js +1 -1
- package/lib/DataHeader/DataHeader.js +10 -1
- package/lib/TableHtml5/TableHtml5.js +4 -4
- package/lib/TableHtml5/cell.js +3 -7
- package/lib/TableHtml5/section.js +5 -9
- package/lib/TableHtml5/sectionHeader.js +8 -12
- package/lib/TableHtml5/subHeader.js +3 -7
- package/lib/index.js +1 -10
- package/package.json +6 -6
- package/es/Table/Table.js +0 -170
- package/es/Table/header.js +0 -91
- package/es/Table/index.js +0 -56
- package/es/Table/itemCell.js +0 -54
- package/es/Table/row-header.js +0 -84
- package/es/Table/section-header.js +0 -115
- package/es/Table/section-rows.js +0 -101
- package/es/Table/styles.js +0 -52
- package/es/Table/tableCell.js +0 -29
- package/es/Table/tooltip.js +0 -85
- package/es/Table/useStyles.js +0 -34
- package/es/Table/valueCell.js +0 -63
- package/es/TableHtml5/sideIcon.js +0 -44
- package/lib/Table/Table.js +0 -203
- package/lib/Table/header.js +0 -116
- package/lib/Table/index.js +0 -16
- package/lib/Table/itemCell.js +0 -74
- package/lib/Table/row-header.js +0 -113
- package/lib/Table/section-header.js +0 -145
- package/lib/Table/section-rows.js +0 -134
- package/lib/Table/styles.js +0 -69
- package/lib/Table/tableCell.js +0 -50
- package/lib/Table/tooltip.js +0 -104
- package/lib/Table/useStyles.js +0 -41
- package/lib/Table/valueCell.js +0 -86
- package/lib/TableHtml5/sideIcon.js +0 -68
package/es/Table/styles.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import glamorous from 'glamorous';
|
|
3
|
-
import * as R from 'ramda';
|
|
4
|
-
|
|
5
|
-
export var cell = {
|
|
6
|
-
outline: '1px solid #A4A1A1',
|
|
7
|
-
fontSize: 12,
|
|
8
|
-
fontWeight: 400,
|
|
9
|
-
lineHeight: 1.43,
|
|
10
|
-
padding: '0px 8px',
|
|
11
|
-
zIndex: 1
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export var Cell = glamorous.div(cell, function (_ref) {
|
|
15
|
-
var spanCount = _ref.spanCount,
|
|
16
|
-
yOffset = _ref.yOffset;
|
|
17
|
-
return {
|
|
18
|
-
'@supports (display: grid)': {
|
|
19
|
-
gridColumn: 'span ' + R.defaultTo(1, spanCount)
|
|
20
|
-
},
|
|
21
|
-
'@supports (position: sticky)': {
|
|
22
|
-
position: R.isNil(yOffset) ? null : 'sticky',
|
|
23
|
-
top: yOffset
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
Cell.propTypes = {
|
|
29
|
-
className: PropTypes.string,
|
|
30
|
-
spanCount: PropTypes.number,
|
|
31
|
-
yOffset: PropTypes.number,
|
|
32
|
-
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export var Table = glamorous.div({
|
|
36
|
-
display: '-ms-grid',
|
|
37
|
-
'@supports (display: grid)': {
|
|
38
|
-
display: 'grid'
|
|
39
|
-
},
|
|
40
|
-
gridAutoRows: 'auto',
|
|
41
|
-
msGridAutoFlow: 'row'
|
|
42
|
-
}, function (_ref2) {
|
|
43
|
-
var columnCount = _ref2.columnCount,
|
|
44
|
-
xColumnCount = _ref2.xColumnCount;
|
|
45
|
-
|
|
46
|
-
var gridTemplateColumns = R.pipe(R.times(R.always('auto')), R.update(R.dec(xColumnCount), '30px'), R.join(' '))(columnCount);
|
|
47
|
-
|
|
48
|
-
return {
|
|
49
|
-
gridTemplateColumns: gridTemplateColumns,
|
|
50
|
-
msGridColumns: gridTemplateColumns
|
|
51
|
-
};
|
|
52
|
-
});
|
package/es/Table/tableCell.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
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 from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import cx from 'classnames';
|
|
6
|
-
import ValueCell from './valueCell';
|
|
7
|
-
import useStyles from './useStyles';
|
|
8
|
-
|
|
9
|
-
var TableCell = function TableCell(_ref) {
|
|
10
|
-
var _ref$cell = _ref.cell,
|
|
11
|
-
cell = _ref$cell === undefined ? {} : _ref$cell,
|
|
12
|
-
cellHandler = _ref.cellHandler;
|
|
13
|
-
|
|
14
|
-
var classes = useStyles();
|
|
15
|
-
|
|
16
|
-
return React.createElement(
|
|
17
|
-
'div',
|
|
18
|
-
{ className: cx(classes.cell, classes.xCell, classes.xCellValue) },
|
|
19
|
-
React.createElement(ValueCell, _extends({}, cell, { cellHandler: cellHandler }))
|
|
20
|
-
);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
TableCell.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
24
|
-
cell: PropTypes.object,
|
|
25
|
-
cellHandler: PropTypes.func,
|
|
26
|
-
isRtl: PropTypes.bool
|
|
27
|
-
} : {};
|
|
28
|
-
|
|
29
|
-
export default TableCell;
|
package/es/Table/tooltip.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
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 from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
6
|
-
import * as R from 'ramda';
|
|
7
|
-
import { Tooltip, Asterisk } from '../';
|
|
8
|
-
|
|
9
|
-
var useStyles = makeStyles(function (theme) {
|
|
10
|
-
return {
|
|
11
|
-
content: {
|
|
12
|
-
borderRadius: 3,
|
|
13
|
-
boxSizing: 'border-box',
|
|
14
|
-
color: 'white',
|
|
15
|
-
listStyleType: 'none',
|
|
16
|
-
maxWidth: 270,
|
|
17
|
-
padding: 0,
|
|
18
|
-
margin: 0,
|
|
19
|
-
fontSize: 12,
|
|
20
|
-
fontWeight: 400,
|
|
21
|
-
lineHeight: 1.43
|
|
22
|
-
},
|
|
23
|
-
flags: _extends({
|
|
24
|
-
verticalAlign: 'super',
|
|
25
|
-
borderBottom: '1px dotted',
|
|
26
|
-
borderColor: 'inherit',
|
|
27
|
-
margin: theme.spacing(0, 0.5),
|
|
28
|
-
whiteSpace: 'nowrap',
|
|
29
|
-
fontWeight: 'bold',
|
|
30
|
-
fontStyle: 'normal'
|
|
31
|
-
}, R.pathOr({}, ['mixins', 'table', 'flag'], theme)),
|
|
32
|
-
svg: {
|
|
33
|
-
verticalAlign: 'middle'
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
var ItemTooltip = function ItemTooltip(_ref) {
|
|
39
|
-
var flags = _ref.flags;
|
|
40
|
-
|
|
41
|
-
var classes = useStyles();
|
|
42
|
-
if (R.anyPass([R.isNil, R.isEmpty])(flags)) return null;
|
|
43
|
-
var hasUncoded = R.any(R.complement(R.has('code')), flags);
|
|
44
|
-
var codedIcons = R.pipe(R.reduce(function (acc, flag) {
|
|
45
|
-
return R.when(R.always(R.has('code', flag)), R.append(flag.code))(acc);
|
|
46
|
-
}, []), R.join(','))(flags);
|
|
47
|
-
|
|
48
|
-
var content = React.createElement(
|
|
49
|
-
'ul',
|
|
50
|
-
{ className: classes.content },
|
|
51
|
-
R.addIndex(R.map)(function (_ref2, index) {
|
|
52
|
-
var label = _ref2.label;
|
|
53
|
-
return React.createElement(
|
|
54
|
-
'li',
|
|
55
|
-
{ key: index },
|
|
56
|
-
label
|
|
57
|
-
);
|
|
58
|
-
}, flags)
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
return React.createElement(
|
|
62
|
-
Tooltip,
|
|
63
|
-
{ title: content, placement: 'top', enterNextDelay: 100 },
|
|
64
|
-
React.createElement(
|
|
65
|
-
'span',
|
|
66
|
-
{ className: classes.flags },
|
|
67
|
-
R.not(R.isEmpty(codedIcons)) && codedIcons,
|
|
68
|
-
R.and(R.not(R.isEmpty(codedIcons)), hasUncoded) && React.createElement(
|
|
69
|
-
React.Fragment,
|
|
70
|
-
null,
|
|
71
|
-
','
|
|
72
|
-
),
|
|
73
|
-
hasUncoded && React.createElement(Asterisk, { className: classes.svg, style: { fontSize: 11 } })
|
|
74
|
-
)
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
ItemTooltip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
79
|
-
flags: PropTypes.arrayOf(PropTypes.shape({
|
|
80
|
-
code: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
81
|
-
label: PropTypes.string
|
|
82
|
-
}))
|
|
83
|
-
} : {};
|
|
84
|
-
|
|
85
|
-
export default React.memo(ItemTooltip);
|
package/es/Table/useStyles.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
2
|
-
import { getLight } from '../utils';
|
|
3
|
-
import { cell } from './styles';
|
|
4
|
-
|
|
5
|
-
export default makeStyles(function (theme) {
|
|
6
|
-
return {
|
|
7
|
-
cell: cell,
|
|
8
|
-
xCell: {
|
|
9
|
-
color: theme.palette.grey['A700'],
|
|
10
|
-
zIndex: 0,
|
|
11
|
-
backgroundColor: theme.palette.common.white
|
|
12
|
-
},
|
|
13
|
-
xCellDimension: {
|
|
14
|
-
backgroundColor: getLight(theme) || theme.palette.secondary.light,
|
|
15
|
-
display: 'flex'
|
|
16
|
-
},
|
|
17
|
-
xCellValue: {
|
|
18
|
-
'&:hover': {
|
|
19
|
-
boxShadow: 'inset 0 0 0 3px ' + theme.palette.primary.main
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
xCellActive: {
|
|
23
|
-
boxShadow: 'inset 0 0 0 3px ' + theme.palette.primary.main
|
|
24
|
-
},
|
|
25
|
-
sCell: {
|
|
26
|
-
backgroundColor: theme.palette.grey[200],
|
|
27
|
-
display: 'flex',
|
|
28
|
-
justifyContent: 'center',
|
|
29
|
-
alignItems: 'end',
|
|
30
|
-
zIndex: 0
|
|
31
|
-
},
|
|
32
|
-
highlight: theme.mixins.table.cellHighlight
|
|
33
|
-
};
|
|
34
|
-
});
|
package/es/Table/valueCell.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
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 from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import Link from '@material-ui/core/Link';
|
|
6
|
-
import * as R from 'ramda';
|
|
7
|
-
import ItemTooltip from './tooltip';
|
|
8
|
-
|
|
9
|
-
var ValueCell = function ValueCell(_ref) {
|
|
10
|
-
var value = _ref.value,
|
|
11
|
-
flags = _ref.flags,
|
|
12
|
-
_ref$indexedDimValIds = _ref.indexedDimValIds,
|
|
13
|
-
indexedDimValIds = _ref$indexedDimValIds === undefined ? {} : _ref$indexedDimValIds,
|
|
14
|
-
cellHandler = _ref.cellHandler;
|
|
15
|
-
|
|
16
|
-
var style = {
|
|
17
|
-
textAlign: 'right',
|
|
18
|
-
whiteSpace: R.isEmpty(flags) ? undefined : 'nowrap',
|
|
19
|
-
paddingTop: 4,
|
|
20
|
-
paddingBottom: 4
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
var _value = R.pipe(R.split('\n'), R.intersperse(React.createElement('br', null)))(value);
|
|
24
|
-
|
|
25
|
-
var uiValue = R.is(Function, cellHandler) && !R.isEmpty(indexedDimValIds) ? React.createElement(
|
|
26
|
-
Link,
|
|
27
|
-
{
|
|
28
|
-
component: 'button',
|
|
29
|
-
variant: 'body2',
|
|
30
|
-
color: 'inherit',
|
|
31
|
-
underline: 'always',
|
|
32
|
-
style: { fontSize: 12 },
|
|
33
|
-
onClick: function onClick() {
|
|
34
|
-
return cellHandler({ indexedDimValIds: indexedDimValIds });
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
_value
|
|
38
|
-
) : _value;
|
|
39
|
-
|
|
40
|
-
if (R.anyPass([R.isNil, R.isEmpty])(flags)) return React.createElement(
|
|
41
|
-
'div',
|
|
42
|
-
{ style: style },
|
|
43
|
-
' ',
|
|
44
|
-
uiValue
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
return React.createElement(
|
|
48
|
-
'div',
|
|
49
|
-
{ style: _extends({}, style, { paddingTop: 0 }) },
|
|
50
|
-
React.createElement(ItemTooltip, { flags: flags }),
|
|
51
|
-
uiValue
|
|
52
|
-
);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
ValueCell.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
56
|
-
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
57
|
-
flags: PropTypes.array,
|
|
58
|
-
indexedDimValIds: PropTypes.object,
|
|
59
|
-
cellHandler: PropTypes.func,
|
|
60
|
-
isRtl: PropTypes.bool
|
|
61
|
-
} : {};
|
|
62
|
-
|
|
63
|
-
export default React.memo(ValueCell);
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import * as R from 'ramda';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
5
|
-
import InfoIcon from '@material-ui/icons//Info';
|
|
6
|
-
import IconButton from '@material-ui/core/IconButton';
|
|
7
|
-
|
|
8
|
-
var useStyles = makeStyles(function (theme) {
|
|
9
|
-
return {
|
|
10
|
-
icon: {
|
|
11
|
-
color: theme.palette.primary.main,
|
|
12
|
-
padding: 0
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
var SideIcon = function SideIcon(_ref) {
|
|
18
|
-
var sideProps = _ref.sideProps,
|
|
19
|
-
sideToggle = _ref.sideToggle;
|
|
20
|
-
|
|
21
|
-
var classes = useStyles();
|
|
22
|
-
if (R.isNil(sideProps) || !R.is(Function, sideToggle)) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
return React.createElement(
|
|
26
|
-
IconButton,
|
|
27
|
-
{
|
|
28
|
-
size: 'small',
|
|
29
|
-
className: classes.icon,
|
|
30
|
-
onClick: function onClick() {
|
|
31
|
-
return sideToggle(sideProps);
|
|
32
|
-
},
|
|
33
|
-
'data-testid': 'ref-md-info'
|
|
34
|
-
},
|
|
35
|
-
React.createElement(InfoIcon, { fontSize: 'small' })
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
SideIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
40
|
-
sideProps: PropTypes.object,
|
|
41
|
-
sideToggle: PropTypes.func
|
|
42
|
-
} : {};
|
|
43
|
-
|
|
44
|
-
export default SideIcon;
|
package/lib/Table/Table.js
DELETED
|
@@ -1,203 +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 _ramda = require('ramda');
|
|
14
|
-
|
|
15
|
-
var R = _interopRequireWildcard(_ramda);
|
|
16
|
-
|
|
17
|
-
var _header = require('./header');
|
|
18
|
-
|
|
19
|
-
var _header2 = _interopRequireDefault(_header);
|
|
20
|
-
|
|
21
|
-
var _rowHeader = require('./row-header');
|
|
22
|
-
|
|
23
|
-
var _rowHeader2 = _interopRequireDefault(_rowHeader);
|
|
24
|
-
|
|
25
|
-
var _sectionHeader = require('./section-header');
|
|
26
|
-
|
|
27
|
-
var _sectionHeader2 = _interopRequireDefault(_sectionHeader);
|
|
28
|
-
|
|
29
|
-
var _sectionRows = require('./section-rows');
|
|
30
|
-
|
|
31
|
-
var _sectionRows2 = _interopRequireDefault(_sectionRows);
|
|
32
|
-
|
|
33
|
-
var _tableCell = require('./tableCell');
|
|
34
|
-
|
|
35
|
-
var _tableCell2 = _interopRequireDefault(_tableCell);
|
|
36
|
-
|
|
37
|
-
var _styles = require('./styles');
|
|
38
|
-
|
|
39
|
-
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; } }
|
|
40
|
-
|
|
41
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
42
|
-
|
|
43
|
-
var HEADER = 'HEADER';
|
|
44
|
-
var ROW_HEADER = 'ROW_HEADER';
|
|
45
|
-
|
|
46
|
-
var updatedHeights = function updatedHeights(headerYOffsets) {
|
|
47
|
-
return R.pipe(R.length, R.times(R.always(0)), R.addIndex(R.map)(function (zero, index) {
|
|
48
|
-
return R.isNil(R.nth(index)(headerYOffsets)) ? zero : R.nth(index)(headerYOffsets);
|
|
49
|
-
}));
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
var Table = function Table(_ref) {
|
|
53
|
-
var _React$useState2;
|
|
54
|
-
|
|
55
|
-
var _ref$sectionsData = _ref.sectionsData,
|
|
56
|
-
sectionsData = _ref$sectionsData === undefined ? [] : _ref$sectionsData,
|
|
57
|
-
_ref$headerData = _ref.headerData,
|
|
58
|
-
headerData = _ref$headerData === undefined ? [] : _ref$headerData,
|
|
59
|
-
_ref$cells = _ref.cells,
|
|
60
|
-
cells = _ref$cells === undefined ? {} : _ref$cells,
|
|
61
|
-
isRtl = _ref.isRtl,
|
|
62
|
-
cellHandler = _ref.cellHandler,
|
|
63
|
-
cellValueAccessor = _ref.cellValueAccessor,
|
|
64
|
-
activeCellIds = _ref.activeCellIds,
|
|
65
|
-
activeCellHandler = _ref.activeCellHandler;
|
|
66
|
-
|
|
67
|
-
var _React$useState = _react2.default.useState((_React$useState2 = {}, _React$useState2[HEADER] = [0], _React$useState2[ROW_HEADER] = [0], _React$useState2)),
|
|
68
|
-
yOffsets = _React$useState[0],
|
|
69
|
-
setYOffsets = _React$useState[1];
|
|
70
|
-
|
|
71
|
-
var _React$useMemo = _react2.default.useMemo(function () {
|
|
72
|
-
var xLayoutData = R.pathOr([], [0, 1, 0, 'data'], sectionsData);
|
|
73
|
-
var xColumnCount = R.pipe(R.length, R.inc)(xLayoutData);
|
|
74
|
-
var yColumnCount = R.length(headerData);
|
|
75
|
-
var columnCount = R.add(xColumnCount, yColumnCount);
|
|
76
|
-
var yOffsetRowHeader = 0;
|
|
77
|
-
var yOffsetSectionHeader = R.inc(yOffsetRowHeader);
|
|
78
|
-
var msGridRowOffsetFactory = function msGridRowOffsetFactory(sectionIndex) {
|
|
79
|
-
return R.sum([R.inc(yOffsetSectionHeader), sectionIndex, R.pipe(R.take(sectionIndex), R.reduce(R.useWith(R.add, [R.identity, R.pipe(R.last, R.length)]), 0))(sectionsData)]);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
return {
|
|
83
|
-
transposedHeaderData: R.pipe(R.pluck('data'), R.map(R.reduce(function (acc, cell) {
|
|
84
|
-
var previousCell = R.last(acc);
|
|
85
|
-
var previousCellKey = R.prop('key', previousCell);
|
|
86
|
-
var valueId = R.path(['value', 'id'], cell);
|
|
87
|
-
var cellKey = R.isNil(previousCellKey) ? valueId : previousCellKey + '-' + valueId;
|
|
88
|
-
return R.append(R.assoc('key', cellKey, cell), acc);
|
|
89
|
-
}, [])), R.transpose)(headerData),
|
|
90
|
-
xLayoutData: xLayoutData,
|
|
91
|
-
xColumnCount: xColumnCount,
|
|
92
|
-
yColumnCount: yColumnCount,
|
|
93
|
-
columnCount: columnCount,
|
|
94
|
-
yOffsetRowHeader: yOffsetRowHeader,
|
|
95
|
-
yOffsetSectionHeader: yOffsetSectionHeader,
|
|
96
|
-
msGridRowOffsetFactory: msGridRowOffsetFactory
|
|
97
|
-
};
|
|
98
|
-
}, [headerData, sectionsData]),
|
|
99
|
-
transposedHeaderData = _React$useMemo.transposedHeaderData,
|
|
100
|
-
xLayoutData = _React$useMemo.xLayoutData,
|
|
101
|
-
columnCount = _React$useMemo.columnCount,
|
|
102
|
-
xColumnCount = _React$useMemo.xColumnCount,
|
|
103
|
-
yColumnCount = _React$useMemo.yColumnCount,
|
|
104
|
-
yOffsetRowHeader = _React$useMemo.yOffsetRowHeader,
|
|
105
|
-
yOffsetSectionHeader = _React$useMemo.yOffsetSectionHeader,
|
|
106
|
-
msGridRowOffsetFactory = _React$useMemo.msGridRowOffsetFactory;
|
|
107
|
-
|
|
108
|
-
// Hooks before
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
var isSingleObs = R.hasPath(['', '', '', 0], cells);
|
|
112
|
-
if (isSingleObs) return _react2.default.createElement(_tableCell2.default, { cell: R.pathOr({}, ['', '', '', 0], cells), cellHandler: cellHandler });
|
|
113
|
-
|
|
114
|
-
// Utility funcs
|
|
115
|
-
var getYOffset = function getYOffset(index) {
|
|
116
|
-
return R.pipe(R.prop(HEADER), R.slice(0, index), R.sum)(yOffsets);
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
var getSubHeaderOffset = function getSubHeaderOffset(headerData) {
|
|
120
|
-
return function (index) {
|
|
121
|
-
var lengthHeader = R.length(headerData);
|
|
122
|
-
return R.add(R.pipe(R.prop(HEADER), R.slice(0, lengthHeader), R.sum)(yOffsets), R.pipe(R.prop(ROW_HEADER), R.slice(0, index), R.sum)(yOffsets));
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
var onYVectorSize = function onYVectorSize(label, headerData) {
|
|
127
|
-
return function (index) {
|
|
128
|
-
return function (_ref2) {
|
|
129
|
-
var _R$mergeRight;
|
|
130
|
-
|
|
131
|
-
var height = _ref2.height;
|
|
132
|
-
|
|
133
|
-
var newYOffsets = R.equals(label, HEADER) ? updatedHeights(R.prop(HEADER)(yOffsets))(headerData) : R.prop(label)(yOffsets);
|
|
134
|
-
setYOffsets(R.mergeRight(yOffsets, (_R$mergeRight = {}, _R$mergeRight[label] = R.update(index, height)(newYOffsets), _R$mergeRight)));
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
return _react2.default.createElement(
|
|
140
|
-
_styles.Table,
|
|
141
|
-
{ columnCount: columnCount, xColumnCount: xColumnCount },
|
|
142
|
-
_react2.default.createElement(_header2.default, {
|
|
143
|
-
data: transposedHeaderData,
|
|
144
|
-
xColumnCount: xColumnCount,
|
|
145
|
-
onYVectorSize: onYVectorSize(HEADER, transposedHeaderData),
|
|
146
|
-
getYOffset: getYOffset
|
|
147
|
-
}),
|
|
148
|
-
_react2.default.createElement(_rowHeader2.default, {
|
|
149
|
-
data: xLayoutData,
|
|
150
|
-
headerData: headerData,
|
|
151
|
-
onYVectorSize: onYVectorSize(ROW_HEADER),
|
|
152
|
-
getYOffset: getSubHeaderOffset(transposedHeaderData),
|
|
153
|
-
yOffset: yOffsetRowHeader,
|
|
154
|
-
activeCellIds: activeCellIds
|
|
155
|
-
}),
|
|
156
|
-
R.addIndex(R.map)(function (_ref3, sectionIndex) {
|
|
157
|
-
var sectionHeaderData = _ref3[0],
|
|
158
|
-
sectionRowsData = _ref3[1];
|
|
159
|
-
|
|
160
|
-
var msGridRowOffset = msGridRowOffsetFactory(sectionIndex);
|
|
161
|
-
|
|
162
|
-
return _react2.default.createElement(
|
|
163
|
-
_react2.default.Fragment,
|
|
164
|
-
{ key: 'section-' + sectionIndex },
|
|
165
|
-
_react2.default.createElement(_sectionHeader2.default, {
|
|
166
|
-
columnCount: columnCount,
|
|
167
|
-
section: sectionHeaderData,
|
|
168
|
-
yOffset: getSubHeaderOffset(transposedHeaderData)(yOffsetSectionHeader),
|
|
169
|
-
msGridRow: msGridRowOffset,
|
|
170
|
-
isRtl: isRtl
|
|
171
|
-
}),
|
|
172
|
-
_react2.default.createElement(_sectionRows2.default, {
|
|
173
|
-
data: sectionRowsData,
|
|
174
|
-
headerData: headerData,
|
|
175
|
-
cells: cells,
|
|
176
|
-
cellHandler: cellHandler,
|
|
177
|
-
cellValueAccessor: cellValueAccessor,
|
|
178
|
-
activeCellIds: activeCellIds,
|
|
179
|
-
activeCellHandler: activeCellHandler,
|
|
180
|
-
sectionData: sectionHeaderData,
|
|
181
|
-
yColumnCount: yColumnCount,
|
|
182
|
-
xColumnCount: xColumnCount,
|
|
183
|
-
yOffset: yOffsetRowHeader,
|
|
184
|
-
msGridRowOffset: msGridRowOffset
|
|
185
|
-
})
|
|
186
|
-
);
|
|
187
|
-
}, sectionsData)
|
|
188
|
-
);
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
Table.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
192
|
-
headerData: _propTypes2.default.array.isRequired,
|
|
193
|
-
sectionsData: _propTypes2.default.array.isRequired,
|
|
194
|
-
cells: _propTypes2.default.object.isRequired,
|
|
195
|
-
cellHandler: _propTypes2.default.func,
|
|
196
|
-
cellValueAccessor: _propTypes2.default.func,
|
|
197
|
-
activeCellHandler: _propTypes2.default.func,
|
|
198
|
-
activeCellIds: _propTypes2.default.object,
|
|
199
|
-
isRtl: _propTypes2.default.bool
|
|
200
|
-
} : {};
|
|
201
|
-
|
|
202
|
-
exports.default = Table;
|
|
203
|
-
module.exports = exports['default'];
|
package/lib/Table/header.js
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
|
|
5
|
-
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; };
|
|
6
|
-
|
|
7
|
-
var _react = require('react');
|
|
8
|
-
|
|
9
|
-
var _react2 = _interopRequireDefault(_react);
|
|
10
|
-
|
|
11
|
-
var _propTypes = require('prop-types');
|
|
12
|
-
|
|
13
|
-
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
14
|
-
|
|
15
|
-
var _ramda = require('ramda');
|
|
16
|
-
|
|
17
|
-
var R = _interopRequireWildcard(_ramda);
|
|
18
|
-
|
|
19
|
-
var _reactSizeme = require('react-sizeme');
|
|
20
|
-
|
|
21
|
-
var _reactSizeme2 = _interopRequireDefault(_reactSizeme);
|
|
22
|
-
|
|
23
|
-
var _styles = require('@material-ui/core/styles');
|
|
24
|
-
|
|
25
|
-
var _styles2 = require('./styles');
|
|
26
|
-
|
|
27
|
-
var _itemCell = require('./itemCell');
|
|
28
|
-
|
|
29
|
-
var _itemCell2 = _interopRequireDefault(_itemCell);
|
|
30
|
-
|
|
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; } }
|
|
32
|
-
|
|
33
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
34
|
-
|
|
35
|
-
var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
36
|
-
return {
|
|
37
|
-
root: {
|
|
38
|
-
backgroundColor: theme.palette.primary.main,
|
|
39
|
-
color: theme.palette.getContrastText(theme.palette.primary.main),
|
|
40
|
-
'& span': {
|
|
41
|
-
color: theme.palette.getContrastText(theme.palette.primary.main),
|
|
42
|
-
borderColor: theme.palette.getContrastText(theme.palette.primary.main)
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
var YVector = (0, _reactSizeme2.default)({ noPlaceholder: true, monitorHeight: true, monitorWidth: false })(_styles2.Cell);
|
|
49
|
-
|
|
50
|
-
var mergeHeaderCells = R.reduce(function (acc, headerCell) {
|
|
51
|
-
var previousCell = R.last(acc);
|
|
52
|
-
var cellValue = R.prop('key', headerCell);
|
|
53
|
-
var previousCellValue = R.prop('key', previousCell);
|
|
54
|
-
if (cellValue !== previousCellValue) {
|
|
55
|
-
return R.append(R.assoc('spanCount', 1, headerCell), acc);
|
|
56
|
-
}
|
|
57
|
-
return R.over(R.lensIndex(-1), R.evolve({ spanCount: R.add(1) }), acc);
|
|
58
|
-
}, []);
|
|
59
|
-
|
|
60
|
-
var Header = function Header(_ref) {
|
|
61
|
-
var data = _ref.data,
|
|
62
|
-
onYVectorSize = _ref.onYVectorSize,
|
|
63
|
-
getYOffset = _ref.getYOffset,
|
|
64
|
-
xColumnCount = _ref.xColumnCount;
|
|
65
|
-
|
|
66
|
-
var classes = useStyles();
|
|
67
|
-
if (R.equals([''], data)) return null;
|
|
68
|
-
var getDimensionFromRow = R.pipe(R.head, R.prop('dimension'));
|
|
69
|
-
var nRows = R.length(data);
|
|
70
|
-
|
|
71
|
-
return R.addIndex(R.map)(function (headerRow, i) {
|
|
72
|
-
return _react2.default.createElement(
|
|
73
|
-
_react2.default.Fragment,
|
|
74
|
-
{ key: 'header-row-' + i },
|
|
75
|
-
_react2.default.createElement(
|
|
76
|
-
YVector,
|
|
77
|
-
{
|
|
78
|
-
yOffset: getYOffset(i),
|
|
79
|
-
onSize: onYVectorSize(i),
|
|
80
|
-
spanCount: xColumnCount,
|
|
81
|
-
className: classes.root
|
|
82
|
-
},
|
|
83
|
-
_react2.default.createElement(_itemCell2.default, _extends({
|
|
84
|
-
justifyContent: 'flex-end',
|
|
85
|
-
fontWeight: 'bold',
|
|
86
|
-
fontStyle: 'italic'
|
|
87
|
-
}, getDimensionFromRow(headerRow)))
|
|
88
|
-
),
|
|
89
|
-
R.pipe(R.when(R.always(i !== nRows - 1), mergeHeaderCells), // don't want merge of cells in the last row
|
|
90
|
-
R.addIndex(R.map)(function (_ref2, j) {
|
|
91
|
-
var value = _ref2.value,
|
|
92
|
-
spanCount = _ref2.spanCount;
|
|
93
|
-
return _react2.default.createElement(
|
|
94
|
-
_styles2.Cell,
|
|
95
|
-
{
|
|
96
|
-
key: 'header-column-' + j,
|
|
97
|
-
yOffset: getYOffset(i),
|
|
98
|
-
spanCount: spanCount,
|
|
99
|
-
className: classes.root
|
|
100
|
-
},
|
|
101
|
-
_react2.default.createElement(_itemCell2.default, _extends({ justifyContent: 'center', sticky: spanCount > 1 }, value))
|
|
102
|
-
);
|
|
103
|
-
}))(headerRow)
|
|
104
|
-
);
|
|
105
|
-
})(data);
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
Header.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
109
|
-
data: _propTypes2.default.array.isRequired,
|
|
110
|
-
xColumnCount: _propTypes2.default.number.isRequired,
|
|
111
|
-
onYVectorSize: _propTypes2.default.func.isRequired,
|
|
112
|
-
getYOffset: _propTypes2.default.func.isRequired
|
|
113
|
-
} : {};
|
|
114
|
-
|
|
115
|
-
exports.default = Header;
|
|
116
|
-
module.exports = exports['default'];
|
package/lib/Table/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
|
|
5
|
-
var _Table = require('./Table');
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, 'default', {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function get() {
|
|
10
|
-
return _interopRequireDefault(_Table).default;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
module.exports = exports['default'];
|