@sis-cc/dotstatsuite-visions 6.6.0 → 6.6.4
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/Alert/Alert.js +135 -66
- package/es/Alert/index.js +1 -0
- package/es/ApiQueries/ApiQueries.js +79 -45
- package/es/ApiQueries/Query.js +105 -65
- package/es/ApiQueries/index.js +1 -0
- package/es/AuthDialog/index.js +103 -62
- package/es/Breadcrumbs/Breadcrumbs.js +38 -21
- package/es/Breadcrumbs/index.js +1 -0
- package/es/Button/Button.js +28 -11
- package/es/Button/index.js +1 -0
- package/es/ChartsConfig/Axis.js +76 -72
- package/es/ChartsConfig/ButtonGroup.js +51 -29
- package/es/ChartsConfig/ChartsConfig.js +187 -87
- package/es/ChartsConfig/ContainerTitle.js +36 -15
- package/es/ChartsConfig/Focus.js +48 -37
- package/es/ChartsConfig/Frequency.js +36 -24
- package/es/ChartsConfig/Series.js +43 -28
- package/es/ChartsConfig/Size.js +50 -36
- package/es/ChartsConfig/index.js +1 -0
- package/es/ChartsConfig/styles.js +4 -4
- package/es/ChartsConfig/utils.js +5 -1
- package/es/Chips/Chips.js +154 -99
- package/es/Chips/index.js +1 -0
- package/es/CollapseButtons/CollapseButtons.js +101 -61
- package/es/CollapseButtons/Item.js +70 -45
- package/es/CollapseButtons/Paper.js +21 -7
- package/es/CollapseButtons/index.js +1 -0
- package/es/DataEdit/DataEdit.js +124 -67
- package/es/DataEdit/Input.js +58 -27
- package/es/DataEdit/index.js +1 -0
- package/es/DataFooter/DataFooter.js +115 -68
- package/es/DataFooter/index.js +1 -0
- package/es/DataHeader/DataHeader.js +113 -75
- package/es/DataHeader/Flags.js +21 -8
- package/es/DataHeader/Title.js +15 -2
- package/es/DataHeader/TooltipHeader.js +63 -33
- package/es/DataHeader/index.js +1 -0
- package/es/DataHeader/utils.js +8 -8
- package/es/Dataflow/Dataflow.js +226 -132
- package/es/Dataflow/index.js +1 -0
- package/es/ExpansionPanel/ExpansionPanel.js +79 -42
- package/es/ExpansionPanel/index.js +1 -0
- package/es/ExpansionPanel/styles.js +5 -3
- package/es/Icons/AccessibilityFilled.js +8 -6
- package/es/Icons/AccessibilityOutlined.js +8 -6
- package/es/Icons/AccountFilled.js +8 -6
- package/es/Icons/AccountOutlined.js +8 -6
- package/es/Icons/Api.js +8 -6
- package/es/Icons/Asterisk.js +8 -6
- package/es/Icons/Bar.js +8 -6
- package/es/Icons/CopyContent.js +8 -6
- package/es/Icons/Cross.js +8 -6
- package/es/Icons/HSymbol.js +8 -6
- package/es/Icons/Row.js +8 -6
- package/es/Icons/Scatter.js +8 -6
- package/es/Icons/StackedBar.js +8 -6
- package/es/Icons/StackedRow.js +8 -6
- package/es/Icons/Timeline.js +8 -6
- package/es/Icons/VSymbol.js +8 -6
- package/es/Icons/Warning.js +14 -11
- package/es/Icons/index.js +1 -0
- package/es/Input/Input.js +56 -26
- package/es/Input/index.js +1 -0
- package/es/Input/with-input.js +25 -30
- package/es/InputNumber/InputNumber.js +51 -31
- package/es/InputNumber/index.js +1 -0
- package/es/LabelDivider/LabelDivider.js +18 -7
- package/es/LabelDivider/index.js +1 -0
- package/es/Loading/Loading.js +18 -9
- package/es/Loading/index.js +1 -0
- package/es/Logo/Logo.js +17 -11
- package/es/Logo/index.js +1 -0
- package/es/NoData/NoData.js +25 -17
- package/es/NoData/index.js +1 -0
- package/es/Pagination/Pagination.js +114 -70
- package/es/Pagination/index.js +1 -0
- package/es/PeriodPicker/PeriodPicker.js +124 -101
- package/es/PeriodPicker/constants.js +13 -78
- package/es/PeriodPicker/index.js +1 -0
- package/es/PeriodPicker/lib.js +23 -37
- package/es/PeriodPicker/styles.js +1 -0
- package/es/ScopeList/Header.js +60 -41
- package/es/ScopeList/Item.js +144 -98
- package/es/ScopeList/ScopeList.js +184 -132
- package/es/ScopeList/Selection.js +93 -51
- package/es/ScopeList/index.js +1 -0
- package/es/ScopeList/styles.js +3 -2
- package/es/ScopeList/with-scope-list.js +88 -151
- package/es/Select/Select.js +60 -44
- package/es/Select/index.js +1 -0
- package/es/Share/Form.js +88 -58
- package/es/Share/Mode.js +98 -36
- package/es/Share/Share.js +64 -41
- package/es/Share/index.js +10 -1
- package/es/SisccFooter/SisccFooter.js +36 -29
- package/es/SisccFooter/index.js +1 -0
- package/es/Spotlight/Fields.js +71 -37
- package/es/Spotlight/Spotlight.js +92 -51
- package/es/Spotlight/index.js +1 -0
- package/es/Spotlight/useSpotlight.js +13 -33
- package/es/Spotlight/useStyles.js +4 -2
- package/es/Table/Table.js +71 -50
- package/es/Table/header.js +50 -36
- package/es/Table/index.js +1 -0
- package/es/Table/itemCell.js +25 -13
- package/es/Table/row-header.js +50 -31
- package/es/Table/section-header.js +55 -30
- package/es/Table/section-rows.js +62 -38
- package/es/Table/styles.js +8 -2
- package/es/Table/tableCell.js +17 -7
- package/es/Table/tooltip.js +41 -21
- package/es/Table/useStyles.js +3 -2
- package/es/Table/valueCell.js +41 -26
- package/es/TableFooter/TableFooter.js +70 -42
- package/es/TableFooter/index.js +1 -0
- package/es/TableHeader/TableHeader.js +36 -18
- package/es/TableHeader/index.js +1 -0
- package/es/TableHtml5/TableHtml5.js +72 -60
- package/es/TableHtml5/cell.js +55 -35
- package/es/TableHtml5/flags.js +58 -29
- package/es/TableHtml5/header.js +85 -53
- package/es/TableHtml5/index.js +1 -0
- package/es/TableHtml5/section.js +131 -86
- package/es/TableHtml5/sectionHeader.js +72 -45
- package/es/TableHtml5/subHeader.js +70 -47
- package/es/TableLayout/Box.js +66 -33
- package/es/TableLayout/DnDItem.js +68 -37
- package/es/TableLayout/TableLayout.js +177 -105
- package/es/TableLayout/constants.js +2 -0
- package/es/TableLayout/index.js +1 -0
- package/es/TableLayout/lib.js +3 -1
- package/es/TablePreview/TablePreview.js +176 -99
- package/es/TablePreview/index.js +1 -0
- package/es/TablePreview/lib.js +4 -5
- package/es/TablePreview/styles.js +1 -0
- package/es/Tag/Tag.js +21 -5
- package/es/Tag/index.js +1 -0
- package/es/ToggleButton/ToggleButton.js +29 -17
- package/es/ToggleButton/index.js +1 -0
- package/es/Tooltip/Tooltip.js +32 -20
- package/es/Tooltip/index.js +1 -0
- package/es/VerticalButton/VerticalButton.js +22 -17
- package/es/VerticalButton/index.js +1 -0
- package/es/index.js +4 -2
- package/es/theme.js +14 -22
- package/es/utils.js +14 -16
- package/lib/Alert/Alert.js +168 -87
- package/lib/Alert/index.js +12 -7
- package/lib/ApiQueries/ApiQueries.js +105 -61
- package/lib/ApiQueries/Query.js +132 -85
- package/lib/ApiQueries/index.js +12 -7
- package/lib/AuthDialog/index.js +137 -82
- package/lib/Breadcrumbs/Breadcrumbs.js +68 -39
- package/lib/Breadcrumbs/index.js +12 -7
- package/lib/Button/Button.js +47 -28
- package/lib/Button/index.js +12 -7
- package/lib/ChartsConfig/Axis.js +100 -88
- package/lib/ChartsConfig/ButtonGroup.js +74 -43
- package/lib/ChartsConfig/ChartsConfig.js +236 -113
- package/lib/ChartsConfig/ContainerTitle.js +59 -30
- package/lib/ChartsConfig/Focus.js +71 -53
- package/lib/ChartsConfig/Frequency.js +59 -39
- package/lib/ChartsConfig/Series.js +70 -45
- package/lib/ChartsConfig/Size.js +77 -53
- package/lib/ChartsConfig/index.js +12 -7
- package/lib/ChartsConfig/styles.js +11 -16
- package/lib/ChartsConfig/utils.js +13 -14
- package/lib/Chips/Chips.js +192 -122
- package/lib/Chips/index.js +12 -7
- package/lib/CollapseButtons/CollapseButtons.js +134 -84
- package/lib/CollapseButtons/Item.js +98 -64
- package/lib/CollapseButtons/Paper.js +41 -19
- package/lib/CollapseButtons/index.js +12 -7
- package/lib/DataEdit/DataEdit.js +156 -88
- package/lib/DataEdit/Input.js +82 -42
- package/lib/DataEdit/index.js +12 -7
- package/lib/DataFooter/DataFooter.js +144 -88
- package/lib/DataFooter/index.js +12 -7
- package/lib/DataHeader/DataHeader.js +158 -106
- package/lib/DataHeader/Flags.js +34 -18
- package/lib/DataHeader/Title.js +27 -11
- package/lib/DataHeader/TooltipHeader.js +79 -48
- package/lib/DataHeader/index.js +12 -7
- package/lib/DataHeader/utils.js +10 -16
- package/lib/Dataflow/Dataflow.js +277 -159
- package/lib/Dataflow/index.js +12 -7
- package/lib/ExpansionPanel/ExpansionPanel.js +116 -63
- package/lib/ExpansionPanel/index.js +12 -7
- package/lib/ExpansionPanel/styles.js +12 -15
- package/lib/Icons/AccessibilityFilled.js +17 -15
- package/lib/Icons/AccessibilityOutlined.js +17 -15
- package/lib/Icons/AccountFilled.js +17 -15
- package/lib/Icons/AccountOutlined.js +17 -15
- package/lib/Icons/Api.js +17 -15
- package/lib/Icons/Asterisk.js +17 -15
- package/lib/Icons/Bar.js +17 -15
- package/lib/Icons/CopyContent.js +17 -15
- package/lib/Icons/Cross.js +17 -15
- package/lib/Icons/HSymbol.js +17 -15
- package/lib/Icons/Row.js +17 -15
- package/lib/Icons/Scatter.js +17 -15
- package/lib/Icons/StackedBar.js +17 -15
- package/lib/Icons/StackedRow.js +17 -15
- package/lib/Icons/Timeline.js +17 -15
- package/lib/Icons/VSymbol.js +17 -15
- package/lib/Icons/Warning.js +31 -27
- package/lib/Icons/index.js +152 -68
- package/lib/Input/Input.js +85 -47
- package/lib/Input/index.js +12 -7
- package/lib/Input/with-input.js +35 -38
- package/lib/InputNumber/InputNumber.js +80 -50
- package/lib/InputNumber/index.js +12 -7
- package/lib/LabelDivider/LabelDivider.js +37 -23
- package/lib/LabelDivider/index.js +12 -7
- package/lib/Loading/Loading.js +35 -20
- package/lib/Loading/index.js +12 -7
- package/lib/Logo/Logo.js +28 -20
- package/lib/Logo/index.js +12 -7
- package/lib/NoData/NoData.js +42 -28
- package/lib/NoData/index.js +12 -7
- package/lib/Pagination/Pagination.js +150 -91
- package/lib/Pagination/index.js +12 -7
- package/lib/PeriodPicker/PeriodPicker.js +150 -121
- package/lib/PeriodPicker/constants.js +37 -126
- package/lib/PeriodPicker/index.js +12 -7
- package/lib/PeriodPicker/lib.js +61 -99
- package/lib/PeriodPicker/styles.js +4 -7
- package/lib/ScopeList/Header.js +88 -58
- package/lib/ScopeList/Item.js +177 -116
- package/lib/ScopeList/ScopeList.js +234 -160
- package/lib/ScopeList/Selection.js +131 -70
- package/lib/ScopeList/index.js +12 -7
- package/lib/ScopeList/styles.js +9 -10
- package/lib/ScopeList/with-scope-list.js +108 -199
- package/lib/Select/Select.js +80 -59
- package/lib/Select/index.js +12 -7
- package/lib/Share/Form.js +119 -77
- package/lib/Share/Mode.js +130 -54
- package/lib/Share/Share.js +91 -59
- package/lib/Share/index.js +12 -7
- package/lib/SisccFooter/SisccFooter.js +63 -44
- package/lib/SisccFooter/index.js +12 -7
- package/lib/Spotlight/Fields.js +100 -54
- package/lib/Spotlight/Spotlight.js +136 -75
- package/lib/Spotlight/index.js +12 -7
- package/lib/Spotlight/useSpotlight.js +20 -44
- package/lib/Spotlight/useStyles.js +12 -15
- package/lib/Table/Table.js +102 -69
- package/lib/Table/header.js +70 -51
- package/lib/Table/index.js +12 -7
- package/lib/Table/itemCell.js +41 -25
- package/lib/Table/row-header.js +75 -49
- package/lib/Table/section-header.js +82 -50
- package/lib/Table/section-rows.js +94 -60
- package/lib/Table/styles.js +25 -23
- package/lib/Table/tableCell.js +37 -19
- package/lib/Table/tooltip.js +54 -36
- package/lib/Table/useStyles.js +8 -11
- package/lib/Table/valueCell.js +59 -39
- package/lib/TableFooter/TableFooter.js +93 -57
- package/lib/TableFooter/index.js +12 -7
- package/lib/TableHeader/TableHeader.js +56 -32
- package/lib/TableHeader/index.js +12 -7
- package/lib/TableHtml5/TableHtml5.js +100 -78
- package/lib/TableHtml5/cell.js +84 -52
- package/lib/TableHtml5/flags.js +82 -48
- package/lib/TableHtml5/header.js +115 -70
- package/lib/TableHtml5/index.js +17 -8
- package/lib/TableHtml5/section.js +171 -109
- package/lib/TableHtml5/sectionHeader.js +102 -64
- package/lib/TableHtml5/subHeader.js +98 -65
- package/lib/TableLayout/Box.js +97 -54
- package/lib/TableLayout/DnDItem.js +98 -58
- package/lib/TableLayout/TableLayout.js +232 -140
- package/lib/TableLayout/constants.js +6 -8
- package/lib/TableLayout/index.js +12 -7
- package/lib/TableLayout/lib.js +9 -14
- package/lib/TablePreview/TablePreview.js +205 -118
- package/lib/TablePreview/index.js +12 -7
- package/lib/TablePreview/lib.js +19 -30
- package/lib/TablePreview/styles.js +6 -7
- package/lib/Tag/Tag.js +38 -19
- package/lib/Tag/index.js +12 -7
- package/lib/ToggleButton/ToggleButton.js +55 -33
- package/lib/ToggleButton/index.js +12 -7
- package/lib/Tooltip/Tooltip.js +50 -34
- package/lib/Tooltip/index.js +12 -7
- package/lib/VerticalButton/VerticalButton.js +46 -40
- package/lib/VerticalButton/index.js +12 -7
- package/lib/index.js +304 -137
- package/lib/theme.js +17 -31
- package/lib/utils.js +31 -46
- package/package.json +10 -2
package/es/TableHtml5/section.js
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
2
|
+
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import * as R from 'ramda';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
4
6
|
import cx from 'classnames';
|
|
5
7
|
import Typography from '@material-ui/core/Typography';
|
|
6
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
8
|
+
import { makeStyles, useTheme } from '@material-ui/core/styles';
|
|
7
9
|
import TableBody from '@material-ui/core/TableBody';
|
|
8
10
|
import TableCell from '@material-ui/core/TableCell';
|
|
9
11
|
import TableRow from '@material-ui/core/TableRow';
|
|
10
12
|
import SectionHeader from './sectionHeader';
|
|
11
13
|
import Cell from './cell';
|
|
12
|
-
import { getLight } from '../utils';
|
|
14
|
+
import { getLight, getIsRtl } from '../utils';
|
|
13
15
|
import Flags from './flags';
|
|
16
|
+
|
|
14
17
|
var useStyles = makeStyles(function (theme) {
|
|
15
18
|
return {
|
|
16
19
|
rowTitle: {
|
|
17
20
|
backgroundColor: getLight(theme) || theme.palette.secondary.light,
|
|
18
21
|
border: 'inherit',
|
|
19
|
-
borderBottom:
|
|
20
|
-
borderRight:
|
|
21
|
-
padding: theme.spacing(0.5) +
|
|
22
|
+
borderBottom: '1px solid ' + theme.palette.grey[500],
|
|
23
|
+
borderRight: '1px solid ' + theme.palette.grey[500],
|
|
24
|
+
padding: theme.spacing(0.5) + 'px ' + theme.spacing(1) + 'px',
|
|
22
25
|
color: theme.palette.grey['A700'],
|
|
23
26
|
verticalAlign: 'middle'
|
|
24
27
|
},
|
|
@@ -27,9 +30,10 @@ var useStyles = makeStyles(function (theme) {
|
|
|
27
30
|
backgroundColor: theme.palette.grey[200],
|
|
28
31
|
verticalAlign: 'top',
|
|
29
32
|
border: 'inherit',
|
|
30
|
-
borderBottom:
|
|
31
|
-
borderRight:
|
|
32
|
-
padding: theme.spacing(0.5) +
|
|
33
|
+
borderBottom: '1px solid ' + theme.palette.grey[500],
|
|
34
|
+
borderRight: '1px solid ' + theme.palette.grey[500],
|
|
35
|
+
padding: theme.spacing(0.5) + 'px ' + theme.spacing(1) + 'px',
|
|
36
|
+
position: 'sticky'
|
|
33
37
|
},
|
|
34
38
|
cellContent: {
|
|
35
39
|
display: 'flex',
|
|
@@ -46,7 +50,11 @@ var useStyles = makeStyles(function (theme) {
|
|
|
46
50
|
hierarchySpace: {
|
|
47
51
|
marginBottom: 'auto'
|
|
48
52
|
},
|
|
49
|
-
highlight: theme.mixins.table.cellHighlight
|
|
53
|
+
highlight: theme.mixins.table.cellHighlight,
|
|
54
|
+
stickyHeader: {
|
|
55
|
+
position: 'sticky',
|
|
56
|
+
zIndex: 1
|
|
57
|
+
}
|
|
50
58
|
};
|
|
51
59
|
});
|
|
52
60
|
var mapIndexed = R.addIndex(R.map);
|
|
@@ -63,90 +71,127 @@ var Section = function Section(_ref) {
|
|
|
63
71
|
sectionIndex = _ref.sectionIndex,
|
|
64
72
|
nbColumnsByRows = _ref.nbColumnsByRows,
|
|
65
73
|
subHeadCellsWidth = _ref.subHeadCellsWidth;
|
|
74
|
+
|
|
66
75
|
var classes = useStyles();
|
|
67
76
|
var currentSection = R.path([0, 'key'], section);
|
|
68
77
|
var headerNumberRows = R.length(nbColumnsByRows);
|
|
69
78
|
var maxColumns = R.last(nbColumnsByRows);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
var theme = useTheme();
|
|
80
|
+
var isRtl = getIsRtl(theme);
|
|
81
|
+
|
|
82
|
+
return React.createElement(
|
|
83
|
+
TableBody,
|
|
84
|
+
null,
|
|
85
|
+
React.createElement(SectionHeader, {
|
|
86
|
+
headerData: headerData,
|
|
87
|
+
section: section,
|
|
88
|
+
currentSection: currentSection,
|
|
89
|
+
xLayoutDataLength: xLayoutDataLength,
|
|
90
|
+
headerHeight: headerHeight
|
|
91
|
+
}),
|
|
92
|
+
R.map(function (sectionbody) {
|
|
93
|
+
var _cx2;
|
|
78
94
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
95
|
+
var rowId = sectionbody.key + '_' + sectionIndex;
|
|
96
|
+
var rowIds = R.pipe(R.map(function (index) {
|
|
97
|
+
return sectionbody.key + '_' + sectionIndex + '_' + index;
|
|
98
|
+
}), R.join(' '))(R.times(R.identity, R.length(R.prop('data', sectionbody))));
|
|
99
|
+
return React.createElement(
|
|
100
|
+
TableRow,
|
|
101
|
+
{ key: sectionbody.key },
|
|
102
|
+
mapIndexed(function (cell, index) {
|
|
103
|
+
var _cx;
|
|
87
104
|
|
|
88
|
-
|
|
89
|
-
|
|
105
|
+
var flags = R.path(['value', 'flags'], cell);
|
|
106
|
+
var id = rowId + '_' + index;
|
|
90
107
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
className: cx(classes.rowTitle, (_cx = {}, _cx[classes.topCell] = R.not(R.isEmpty(flags)), _cx[classes.highlight] = R.prop(rowId)(activeCellIds), _cx)),
|
|
98
|
-
id: id,
|
|
99
|
-
headers: "subHeader_" + index + " " + currentSection,
|
|
100
|
-
component: "th",
|
|
101
|
-
style: {
|
|
102
|
-
position: 'sticky',
|
|
103
|
-
left: subHeadCellsWidth[index],
|
|
104
|
-
zIndex: 1
|
|
105
|
-
}
|
|
106
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
107
|
-
className: classes.cellContent
|
|
108
|
-
}, !R.isEmpty(hierarchySpace) && /*#__PURE__*/React.createElement("div", {
|
|
109
|
-
className: classes.hierarchySpace
|
|
110
|
-
}, hierarchySpace), /*#__PURE__*/React.createElement(Typography, {
|
|
111
|
-
variant: "body1",
|
|
112
|
-
tabIndex: 0
|
|
113
|
-
}, R.path(['value', 'label'], cell), /*#__PURE__*/React.createElement(Flags, {
|
|
114
|
-
flags: flags
|
|
115
|
-
}))));
|
|
116
|
-
}, R.prop('data', sectionbody)), /*#__PURE__*/React.createElement(TableCell, {
|
|
117
|
-
className: cx(classes.fillerCell, (_cx2 = {}, _cx2[classes.highlight] = R.prop(rowId)(activeCellIds), _cx2)),
|
|
118
|
-
style: {
|
|
119
|
-
position: 'sticky',
|
|
120
|
-
left: R.last(subHeadCellsWidth)
|
|
121
|
-
}
|
|
122
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
123
|
-
className: classes.flagContainer
|
|
124
|
-
}, /*#__PURE__*/React.createElement(Flags, {
|
|
125
|
-
flags: R.prop('flags', sectionbody)
|
|
126
|
-
}))), mapIndexed(function (item, columnIndex) {
|
|
127
|
-
var columnIds = R.pipe(R.times(R.identity), R.map(function (rowIndex) {
|
|
128
|
-
var columnId = R.divide(columnIndex, R.divide(maxColumns, R.nth(rowIndex, nbColumnsByRows)));
|
|
129
|
-
return Math.floor(columnId || 0) + "_" + rowIndex;
|
|
130
|
-
}), R.join(' '))(headerNumberRows);
|
|
131
|
-
var intersectionCellId = rowId + "/" + columnIndex;
|
|
132
|
-
var isActive = R.pipe(R.propOr({}, 'intersectionCellId'), R.equals(intersectionCellId))(activeCellIds);
|
|
133
|
-
return /*#__PURE__*/React.createElement(Cell, _extends({
|
|
134
|
-
key: intersectionCellId
|
|
135
|
-
}, R.pathOr({
|
|
136
|
-
value: '..'
|
|
137
|
-
}, [item.key, currentSection, sectionbody.key, 0], cells), {
|
|
138
|
-
headers: rowIds + " " + columnIds + " " + currentSection,
|
|
139
|
-
cellHandler: cellHandler,
|
|
140
|
-
isActive: isActive,
|
|
141
|
-
isHighlight: R.any(R.identity)([R.prop(rowId)(activeCellIds), R.prop(columnIndex)(activeCellIds)]),
|
|
142
|
-
activeCellHandler: R.is(Function)(activeCellHandler) ? function () {
|
|
143
|
-
var _activeCellHandler;
|
|
108
|
+
// special space is used for hierarchy U+2007    
|
|
109
|
+
var hierarchySpace = R.pipe(R.pathOr([], ['value', 'parents']), R.when(R.isNil, R.always([])), R.length,
|
|
110
|
+
// eslint-disable-next-line no-irregular-whitespace
|
|
111
|
+
R.times(function () {
|
|
112
|
+
return '· ';
|
|
113
|
+
}))(cell);
|
|
144
114
|
|
|
145
|
-
return
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
115
|
+
return React.createElement(
|
|
116
|
+
TableCell,
|
|
117
|
+
{
|
|
118
|
+
key: id,
|
|
119
|
+
className: cx(classes.rowTitle, classes.stickyHeader, (_cx = {}, _cx[classes.topCell] = R.not(R.isEmpty(flags)), _cx[classes.highlight] = R.prop(rowId)(activeCellIds), _cx)),
|
|
120
|
+
id: id,
|
|
121
|
+
headers: 'subHeader_' + index + ' ' + currentSection,
|
|
122
|
+
component: 'th',
|
|
123
|
+
style: isRtl ? { right: subHeadCellsWidth[index] } : { left: subHeadCellsWidth[index] }
|
|
124
|
+
},
|
|
125
|
+
React.createElement(
|
|
126
|
+
'div',
|
|
127
|
+
{ className: classes.cellContent },
|
|
128
|
+
!R.isEmpty(hierarchySpace) && React.createElement(
|
|
129
|
+
'div',
|
|
130
|
+
{ className: classes.hierarchySpace },
|
|
131
|
+
hierarchySpace
|
|
132
|
+
),
|
|
133
|
+
React.createElement(
|
|
134
|
+
Typography,
|
|
135
|
+
{ variant: 'body1', tabIndex: 0 },
|
|
136
|
+
R.path(['value', 'label'], cell),
|
|
137
|
+
React.createElement(Flags, { flags: flags })
|
|
138
|
+
)
|
|
139
|
+
)
|
|
140
|
+
);
|
|
141
|
+
}, R.prop('data', sectionbody)),
|
|
142
|
+
React.createElement(
|
|
143
|
+
TableCell,
|
|
144
|
+
{
|
|
145
|
+
className: cx(classes.fillerCell, (_cx2 = {}, _cx2[classes.highlight] = R.prop(rowId)(activeCellIds), _cx2)),
|
|
146
|
+
style: isRtl ? { right: R.last(subHeadCellsWidth) } : { left: R.last(subHeadCellsWidth) }
|
|
147
|
+
},
|
|
148
|
+
React.createElement(
|
|
149
|
+
'div',
|
|
150
|
+
{ className: classes.flagContainer },
|
|
151
|
+
React.createElement(Flags, { flags: R.prop('flags', sectionbody) })
|
|
152
|
+
)
|
|
153
|
+
),
|
|
154
|
+
mapIndexed(function (item, columnIndex) {
|
|
155
|
+
var columnIds = R.pipe(R.times(R.identity), R.map(function (rowIndex) {
|
|
156
|
+
var columnId = R.divide(columnIndex, R.divide(maxColumns, R.nth(rowIndex, nbColumnsByRows)));
|
|
157
|
+
return Math.floor(columnId || 0) + '_' + rowIndex;
|
|
158
|
+
}), R.join(' '))(headerNumberRows);
|
|
159
|
+
|
|
160
|
+
var intersectionCellId = rowId + '/' + columnIndex;
|
|
161
|
+
var isActive = R.pipe(R.propOr({}, 'intersectionCellId'), R.equals(intersectionCellId))(activeCellIds);
|
|
162
|
+
return React.createElement(Cell, _extends({
|
|
163
|
+
key: intersectionCellId
|
|
164
|
+
}, R.pathOr({ value: '..' }, [item.key, currentSection, sectionbody.key, 0], cells), {
|
|
165
|
+
headers: rowIds + ' ' + columnIds + ' ' + currentSection,
|
|
166
|
+
cellHandler: cellHandler,
|
|
167
|
+
isActive: isActive,
|
|
168
|
+
isHighlight: R.any(R.identity)([R.prop(rowId)(activeCellIds), R.prop(columnIndex)(activeCellIds)]),
|
|
169
|
+
activeCellHandler: R.is(Function)(activeCellHandler) ? function () {
|
|
170
|
+
var _activeCellHandler;
|
|
171
|
+
|
|
172
|
+
return activeCellHandler((_activeCellHandler = {}, _activeCellHandler[rowId] = R.not(isActive), _activeCellHandler[columnIndex] = R.not(isActive), _activeCellHandler.intersectionCellId = isActive ? null : intersectionCellId, _activeCellHandler));
|
|
173
|
+
} : null
|
|
174
|
+
}));
|
|
175
|
+
}, headerData)
|
|
176
|
+
);
|
|
177
|
+
}, R.nth(1, section))
|
|
178
|
+
);
|
|
150
179
|
};
|
|
151
180
|
|
|
181
|
+
Section.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
182
|
+
cells: PropTypes.object,
|
|
183
|
+
headerData: PropTypes.array,
|
|
184
|
+
section: PropTypes.array,
|
|
185
|
+
xLayoutDataLength: PropTypes.number,
|
|
186
|
+
cellHandler: PropTypes.func,
|
|
187
|
+
activeCellHandler: PropTypes.func,
|
|
188
|
+
activeCellIds: PropTypes.object,
|
|
189
|
+
headerHeight: PropTypes.number,
|
|
190
|
+
sectionIndex: PropTypes.number,
|
|
191
|
+
headerNumberRows: PropTypes.number,
|
|
192
|
+
nbColumnsByRows: PropTypes.array,
|
|
193
|
+
maxColumns: PropTypes.number,
|
|
194
|
+
subHeadCellsWidth: PropTypes.arrayOf(PropTypes.number)
|
|
195
|
+
} : {};
|
|
196
|
+
|
|
152
197
|
export default Section;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
2
|
+
|
|
2
3
|
import React, { Fragment } from 'react';
|
|
3
4
|
import * as R from 'ramda';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
4
6
|
import Typography from '@material-ui/core/Typography';
|
|
5
7
|
import { makeStyles } from '@material-ui/core/styles';
|
|
6
8
|
import Lens from '@material-ui/icons/Lens';
|
|
@@ -8,14 +10,15 @@ import TableCell from '@material-ui/core/TableCell';
|
|
|
8
10
|
import TableRow from '@material-ui/core/TableRow';
|
|
9
11
|
import Flags from './flags';
|
|
10
12
|
import { getDark } from '../utils';
|
|
13
|
+
|
|
11
14
|
var useStyles = makeStyles(function (theme) {
|
|
12
15
|
return {
|
|
13
16
|
section: {
|
|
14
17
|
backgroundColor: getDark(theme) || theme.palette.secondary.dark,
|
|
15
18
|
border: 'inherit',
|
|
16
|
-
borderBottom:
|
|
17
|
-
borderRight:
|
|
18
|
-
padding: theme.spacing(0.5) +
|
|
19
|
+
borderBottom: '1px solid ' + theme.palette.grey[500],
|
|
20
|
+
borderRight: '1px solid ' + theme.palette.grey[500],
|
|
21
|
+
padding: theme.spacing(0.5) + 'px ' + theme.spacing(1) + 'px',
|
|
19
22
|
color: theme.palette.grey['A700'],
|
|
20
23
|
verticalAlign: 'middle'
|
|
21
24
|
},
|
|
@@ -52,49 +55,73 @@ var SectionHeader = function SectionHeader(_ref) {
|
|
|
52
55
|
currentSection = _ref.currentSection,
|
|
53
56
|
xLayoutDataLength = _ref.xLayoutDataLength,
|
|
54
57
|
headerHeight = _ref.headerHeight;
|
|
58
|
+
|
|
55
59
|
var classes = useStyles();
|
|
56
60
|
if (R.compose(R.anyPass([R.isNil, R.isEmpty]), R.path([0, 'data']))(section)) return null;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
61
|
+
|
|
62
|
+
return React.createElement(
|
|
63
|
+
TableRow,
|
|
64
|
+
{
|
|
65
|
+
key: section.key,
|
|
66
|
+
className: classes.stickyHeaderSection,
|
|
67
|
+
style: { top: headerHeight, zIndex: 2 }
|
|
68
|
+
},
|
|
69
|
+
React.createElement(
|
|
70
|
+
TableCell,
|
|
71
|
+
{
|
|
72
|
+
component: 'th',
|
|
73
|
+
className: classes.section,
|
|
74
|
+
colSpan: R.pipe(R.length, R.inc, R.add(xLayoutDataLength))(headerData),
|
|
75
|
+
id: currentSection
|
|
76
|
+
},
|
|
77
|
+
React.createElement(
|
|
78
|
+
Typography,
|
|
79
|
+
{ noWrap: true, variant: 'body1', component: 'div', className: classes.containerSection },
|
|
80
|
+
React.createElement(
|
|
81
|
+
'div',
|
|
82
|
+
null,
|
|
83
|
+
mapIndexed(function (sectionHeader, index) {
|
|
84
|
+
return React.createElement(
|
|
85
|
+
Fragment,
|
|
86
|
+
{ key: index },
|
|
87
|
+
index !== 0 && React.createElement(Lens, { className: classes.lens }),
|
|
88
|
+
React.createElement(
|
|
89
|
+
Typography,
|
|
90
|
+
{
|
|
91
|
+
noWrap: true,
|
|
92
|
+
variant: 'body1',
|
|
93
|
+
component: 'span',
|
|
94
|
+
tabIndex: 0,
|
|
95
|
+
className: classes.label
|
|
96
|
+
},
|
|
97
|
+
R.path(['dimension', 'label'], sectionHeader),
|
|
98
|
+
':'
|
|
99
|
+
),
|
|
100
|
+
React.createElement(
|
|
101
|
+
Typography,
|
|
102
|
+
{ noWrap: true, variant: 'body1', component: 'span', tabIndex: 0 },
|
|
103
|
+
R.path(['value', 'label'], sectionHeader),
|
|
104
|
+
React.createElement(Flags, { flags: R.path(['value', 'flags'], sectionHeader) })
|
|
105
|
+
)
|
|
106
|
+
);
|
|
107
|
+
}, R.path([0, 'data'], section))
|
|
108
|
+
),
|
|
109
|
+
React.createElement(
|
|
110
|
+
'div',
|
|
111
|
+
{ className: classes.flag },
|
|
112
|
+
React.createElement(Flags, { flags: R.path([0, 'flags'], section) })
|
|
113
|
+
)
|
|
114
|
+
)
|
|
115
|
+
)
|
|
116
|
+
);
|
|
98
117
|
};
|
|
99
118
|
|
|
119
|
+
SectionHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
120
|
+
headerData: PropTypes.array,
|
|
121
|
+
section: PropTypes.array,
|
|
122
|
+
currentSection: PropTypes.string,
|
|
123
|
+
xLayoutDataLength: PropTypes.number,
|
|
124
|
+
headerHeight: PropTypes.number
|
|
125
|
+
} : {};
|
|
126
|
+
|
|
100
127
|
export default SectionHeader;
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import * as R from 'ramda';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
3
4
|
import cx from 'classnames';
|
|
4
5
|
import Typography from '@material-ui/core/Typography';
|
|
5
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
6
|
+
import { makeStyles, useTheme } from '@material-ui/core/styles';
|
|
6
7
|
import TableCell from '@material-ui/core/TableCell';
|
|
7
8
|
import TableRow from '@material-ui/core/TableRow';
|
|
8
|
-
import { getLight } from '../utils';
|
|
9
|
+
import { getLight, getIsRtl } from '../utils';
|
|
9
10
|
import Flags from './flags';
|
|
11
|
+
|
|
10
12
|
var useStyles = makeStyles(function (theme) {
|
|
11
13
|
return {
|
|
12
14
|
columnsTitle: {
|
|
13
15
|
backgroundColor: getLight(theme) || theme.palette.secondary.light,
|
|
14
16
|
border: 'inherit',
|
|
15
|
-
borderBottom:
|
|
16
|
-
borderRight:
|
|
17
|
-
padding: theme.spacing(0.5) +
|
|
17
|
+
borderBottom: '1px solid ' + theme.palette.grey[500],
|
|
18
|
+
borderRight: '1px solid ' + theme.palette.grey[500],
|
|
19
|
+
padding: theme.spacing(0.5) + 'px ' + theme.spacing(1) + 'px',
|
|
18
20
|
color: theme.palette.grey['A700'],
|
|
19
|
-
verticalAlign: 'middle'
|
|
21
|
+
verticalAlign: 'middle',
|
|
22
|
+
position: 'sticky',
|
|
23
|
+
zIndex: 1
|
|
20
24
|
},
|
|
21
25
|
fillerCell: {
|
|
22
26
|
backgroundColor: theme.palette.grey[200],
|
|
23
27
|
border: 'inherit',
|
|
24
|
-
borderBottom:
|
|
25
|
-
borderRight:
|
|
26
|
-
padding: theme.spacing(0.5) +
|
|
28
|
+
borderBottom: '1px solid ' + theme.palette.grey[500],
|
|
29
|
+
borderRight: '1px solid ' + theme.palette.grey[500],
|
|
30
|
+
padding: theme.spacing(0.5) + 'px ' + theme.spacing(1) + 'px',
|
|
27
31
|
verticalAlign: 'middle',
|
|
28
32
|
textAlign: 'center',
|
|
29
33
|
color: theme.palette.grey['A700']
|
|
@@ -39,51 +43,70 @@ var useStyles = makeStyles(function (theme) {
|
|
|
39
43
|
highlight: theme.mixins.table.cellHighlight
|
|
40
44
|
};
|
|
41
45
|
});
|
|
46
|
+
|
|
42
47
|
var mapIndexed = R.addIndex(R.map);
|
|
48
|
+
|
|
43
49
|
var SubHeader = React.forwardRef(function (_ref, refs) {
|
|
44
50
|
var headerData = _ref.headerData,
|
|
45
51
|
xLayoutData = _ref.xLayoutData,
|
|
46
52
|
activeCellIds = _ref.activeCellIds,
|
|
47
53
|
subHeadCellsWidth = _ref.subHeadCellsWidth;
|
|
54
|
+
|
|
48
55
|
var classes = useStyles();
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
56
|
+
var theme = useTheme();
|
|
57
|
+
var isRtl = getIsRtl(theme);
|
|
58
|
+
return React.createElement(
|
|
59
|
+
TableRow,
|
|
60
|
+
null,
|
|
61
|
+
mapIndexed(function (rowItem, index) {
|
|
62
|
+
return React.createElement(
|
|
63
|
+
TableCell,
|
|
64
|
+
{
|
|
65
|
+
component: 'th',
|
|
66
|
+
className: classes.columnsTitle,
|
|
67
|
+
key: index,
|
|
68
|
+
id: 'subHeader_' + index,
|
|
69
|
+
style: isRtl ? { right: subHeadCellsWidth[index] } : { left: subHeadCellsWidth[index] },
|
|
70
|
+
ref: function ref(element) {
|
|
71
|
+
return refs.current[index] = element;
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
React.createElement(
|
|
75
|
+
'div',
|
|
76
|
+
{ className: classes.cellContent },
|
|
77
|
+
React.createElement(
|
|
78
|
+
Typography,
|
|
79
|
+
{ variant: 'body1', tabIndex: 0, className: classes.label },
|
|
80
|
+
R.path(['dimension', 'label'], rowItem),
|
|
81
|
+
React.createElement(Flags, { flags: R.path(['dimension', 'flags'], rowItem) })
|
|
82
|
+
)
|
|
83
|
+
)
|
|
84
|
+
);
|
|
85
|
+
}, xLayoutData),
|
|
86
|
+
React.createElement(TableCell, {
|
|
87
|
+
className: classes.fillerCell,
|
|
88
|
+
style: isRtl ? { position: 'sticky', right: R.last(subHeadCellsWidth) } : { position: 'sticky', left: R.last(subHeadCellsWidth) }
|
|
89
|
+
}),
|
|
90
|
+
mapIndexed(function (item, index) {
|
|
91
|
+
var _cx;
|
|
80
92
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
93
|
+
return React.createElement(
|
|
94
|
+
TableCell,
|
|
95
|
+
{
|
|
96
|
+
key: index,
|
|
97
|
+
className: cx(classes.fillerCell, (_cx = {}, _cx[classes.highlight] = R.prop(index)(activeCellIds), _cx))
|
|
98
|
+
},
|
|
99
|
+
React.createElement(Flags, { flags: R.prop('flags', item) })
|
|
100
|
+
);
|
|
101
|
+
}, headerData)
|
|
102
|
+
);
|
|
88
103
|
});
|
|
104
|
+
|
|
105
|
+
SubHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
106
|
+
activeCellIds: PropTypes.object,
|
|
107
|
+
headerData: PropTypes.array,
|
|
108
|
+
xLayoutData: PropTypes.array,
|
|
109
|
+
subHeadCellsWidth: PropTypes.arrayOf(PropTypes.number)
|
|
110
|
+
} : {};
|
|
111
|
+
|
|
89
112
|
export default SubHeader;
|