@sis-cc/dotstatsuite-visions 6.6.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.
- 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 +46 -30
- package/es/Share/Share.js +64 -41
- package/es/Share/index.js +1 -0
- 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 +67 -48
- package/es/TableHtml5/index.js +1 -0
- package/es/TableHtml5/section.js +121 -83
- package/es/TableHtml5/sectionHeader.js +72 -45
- package/es/TableHtml5/subHeader.js +63 -44
- 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 +78 -49
- 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 +97 -66
- package/lib/TableHtml5/index.js +17 -8
- package/lib/TableHtml5/section.js +163 -108
- package/lib/TableHtml5/sectionHeader.js +102 -64
- package/lib/TableHtml5/subHeader.js +93 -64
- 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/Table/header.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
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';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
3
5
|
import * as R from 'ramda';
|
|
4
6
|
import sizeMe from 'react-sizeme';
|
|
5
7
|
import { makeStyles } from '@material-ui/core/styles';
|
|
6
8
|
import { Cell } from './styles';
|
|
7
9
|
import ItemCell from './itemCell';
|
|
10
|
+
|
|
8
11
|
var useStyles = makeStyles(function (theme) {
|
|
9
12
|
return {
|
|
10
13
|
root: {
|
|
@@ -17,23 +20,17 @@ var useStyles = makeStyles(function (theme) {
|
|
|
17
20
|
}
|
|
18
21
|
};
|
|
19
22
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
monitorWidth: false
|
|
24
|
-
})(Cell);
|
|
23
|
+
|
|
24
|
+
var YVector = sizeMe({ noPlaceholder: true, monitorHeight: true, monitorWidth: false })(Cell);
|
|
25
|
+
|
|
25
26
|
var mergeHeaderCells = R.reduce(function (acc, headerCell) {
|
|
26
27
|
var previousCell = R.last(acc);
|
|
27
28
|
var cellValue = R.prop('key', headerCell);
|
|
28
29
|
var previousCellValue = R.prop('key', previousCell);
|
|
29
|
-
|
|
30
30
|
if (cellValue !== previousCellValue) {
|
|
31
31
|
return R.append(R.assoc('spanCount', 1, headerCell), acc);
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
return R.over(R.lensIndex(-1), R.evolve({
|
|
35
|
-
spanCount: R.add(1)
|
|
36
|
-
}), acc);
|
|
33
|
+
return R.over(R.lensIndex(-1), R.evolve({ spanCount: R.add(1) }), acc);
|
|
37
34
|
}, []);
|
|
38
35
|
|
|
39
36
|
var Header = function Header(_ref) {
|
|
@@ -41,37 +38,54 @@ var Header = function Header(_ref) {
|
|
|
41
38
|
onYVectorSize = _ref.onYVectorSize,
|
|
42
39
|
getYOffset = _ref.getYOffset,
|
|
43
40
|
xColumnCount = _ref.xColumnCount;
|
|
41
|
+
|
|
44
42
|
var classes = useStyles();
|
|
45
43
|
if (R.equals([''], data)) return null;
|
|
46
44
|
var getDimensionFromRow = R.pipe(R.head, R.prop('dimension'));
|
|
47
45
|
var nRows = R.length(data);
|
|
46
|
+
|
|
48
47
|
return R.addIndex(R.map)(function (headerRow, i) {
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
48
|
+
return React.createElement(
|
|
49
|
+
React.Fragment,
|
|
50
|
+
{ key: 'header-row-' + i },
|
|
51
|
+
React.createElement(
|
|
52
|
+
YVector,
|
|
53
|
+
{
|
|
54
|
+
yOffset: getYOffset(i),
|
|
55
|
+
onSize: onYVectorSize(i),
|
|
56
|
+
spanCount: xColumnCount,
|
|
57
|
+
className: classes.root
|
|
58
|
+
},
|
|
59
|
+
React.createElement(ItemCell, _extends({
|
|
60
|
+
justifyContent: 'flex-end',
|
|
61
|
+
fontWeight: 'bold',
|
|
62
|
+
fontStyle: 'italic'
|
|
63
|
+
}, getDimensionFromRow(headerRow)))
|
|
64
|
+
),
|
|
65
|
+
R.pipe(R.when(R.always(i !== nRows - 1), mergeHeaderCells), // don't want merge of cells in the last row
|
|
66
|
+
R.addIndex(R.map)(function (_ref2, j) {
|
|
67
|
+
var value = _ref2.value,
|
|
68
|
+
spanCount = _ref2.spanCount;
|
|
69
|
+
return React.createElement(
|
|
70
|
+
Cell,
|
|
71
|
+
{
|
|
72
|
+
key: 'header-column-' + j,
|
|
73
|
+
yOffset: getYOffset(i),
|
|
74
|
+
spanCount: spanCount,
|
|
75
|
+
className: classes.root
|
|
76
|
+
},
|
|
77
|
+
React.createElement(ItemCell, _extends({ justifyContent: 'center', sticky: spanCount > 1 }, value))
|
|
78
|
+
);
|
|
79
|
+
}))(headerRow)
|
|
80
|
+
);
|
|
74
81
|
})(data);
|
|
75
82
|
};
|
|
76
83
|
|
|
84
|
+
Header.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
85
|
+
data: PropTypes.array.isRequired,
|
|
86
|
+
xColumnCount: PropTypes.number.isRequired,
|
|
87
|
+
onYVectorSize: PropTypes.func.isRequired,
|
|
88
|
+
getYOffset: PropTypes.func.isRequired
|
|
89
|
+
} : {};
|
|
90
|
+
|
|
77
91
|
export default Header;
|
package/es/Table/index.js
CHANGED
package/es/Table/itemCell.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import * as R from 'ramda';
|
|
3
4
|
import ItemTooltip from './tooltip';
|
|
4
5
|
|
|
@@ -11,7 +12,8 @@ var ItemCell = function ItemCell(_ref) {
|
|
|
11
12
|
fontWeight = _ref.fontWeight,
|
|
12
13
|
fontStyle = _ref.fontStyle,
|
|
13
14
|
_ref$sticky = _ref.sticky,
|
|
14
|
-
sticky = _ref$sticky ===
|
|
15
|
+
sticky = _ref$sticky === undefined ? false : _ref$sticky;
|
|
16
|
+
|
|
15
17
|
var style = {
|
|
16
18
|
display: 'flex',
|
|
17
19
|
flexDirection: 'row',
|
|
@@ -25,18 +27,28 @@ var ItemCell = function ItemCell(_ref) {
|
|
|
25
27
|
paddingLeft: R.pipe(R.when(R.isNil, R.always([])), R.length, R.multiply(12))(parents),
|
|
26
28
|
height: '100%'
|
|
27
29
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
style:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
left: 8,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
})));
|
|
30
|
+
|
|
31
|
+
return React.createElement(
|
|
32
|
+
'div',
|
|
33
|
+
{ style: style },
|
|
34
|
+
React.createElement(
|
|
35
|
+
'div',
|
|
36
|
+
{ style: sticky ? { display: 'inline-block', position: 'sticky', left: 8, right: 8 } : {} },
|
|
37
|
+
label,
|
|
38
|
+
React.createElement(ItemTooltip, { flags: flags })
|
|
39
|
+
)
|
|
40
|
+
);
|
|
40
41
|
};
|
|
41
42
|
|
|
43
|
+
ItemCell.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
44
|
+
label: PropTypes.string,
|
|
45
|
+
flags: PropTypes.array,
|
|
46
|
+
parents: PropTypes.array,
|
|
47
|
+
justifyContent: PropTypes.string,
|
|
48
|
+
fontWeight: PropTypes.string,
|
|
49
|
+
fontStyle: PropTypes.string,
|
|
50
|
+
alignItems: PropTypes.string,
|
|
51
|
+
sticky: PropTypes.bool
|
|
52
|
+
} : {};
|
|
53
|
+
|
|
42
54
|
export default React.memo(ItemCell);
|
package/es/Table/row-header.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
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';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
3
5
|
import cx from 'classnames';
|
|
4
6
|
import * as R from 'ramda';
|
|
5
7
|
import { makeStyles } from '@material-ui/core/styles';
|
|
@@ -7,6 +9,7 @@ import sizeMe from 'react-sizeme';
|
|
|
7
9
|
import { Cell } from './styles';
|
|
8
10
|
import ItemCell from './itemCell';
|
|
9
11
|
import { getLight } from '../utils';
|
|
12
|
+
|
|
10
13
|
var useStyles = makeStyles(function (theme) {
|
|
11
14
|
return {
|
|
12
15
|
root: {
|
|
@@ -19,11 +22,8 @@ var useStyles = makeStyles(function (theme) {
|
|
|
19
22
|
highlight: theme.mixins.table.cellHighlight
|
|
20
23
|
};
|
|
21
24
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
monitorHeight: true,
|
|
25
|
-
monitorWidth: false
|
|
26
|
-
})(Cell);
|
|
25
|
+
|
|
26
|
+
var XVector = sizeMe({ noPlaceholder: true, monitorHeight: true, monitorWidth: false })(Cell);
|
|
27
27
|
|
|
28
28
|
var RowHeader = function RowHeader(_ref) {
|
|
29
29
|
var data = _ref.data,
|
|
@@ -32,34 +32,53 @@ var RowHeader = function RowHeader(_ref) {
|
|
|
32
32
|
getYOffset = _ref.getYOffset,
|
|
33
33
|
yOffset = _ref.yOffset,
|
|
34
34
|
activeCellIds = _ref.activeCellIds;
|
|
35
|
+
|
|
35
36
|
var classes = useStyles();
|
|
36
37
|
if (R.isEmpty(data)) return null;
|
|
37
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, R.addIndex(R.map)(function (rowColumn, i) {
|
|
38
|
-
return /*#__PURE__*/React.createElement(XVector, {
|
|
39
|
-
key: "row-column-" + i,
|
|
40
|
-
yOffset: getYOffset(yOffset),
|
|
41
|
-
onSize: onYVectorSize(yOffset),
|
|
42
|
-
className: classes.root
|
|
43
|
-
}, /*#__PURE__*/React.createElement(ItemCell, _extends({
|
|
44
|
-
justifyContent: "flex-start",
|
|
45
|
-
fontWeight: "bold",
|
|
46
|
-
fontStyle: "italic"
|
|
47
|
-
}, R.propOr({}, 'dimension', rowColumn))));
|
|
48
|
-
}, data), /*#__PURE__*/React.createElement(Cell, {
|
|
49
|
-
yOffset: getYOffset(yOffset),
|
|
50
|
-
className: classes.sep
|
|
51
|
-
}), R.addIndex(R.map)(function (header, j) {
|
|
52
|
-
var _cx;
|
|
53
38
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
39
|
+
return React.createElement(
|
|
40
|
+
React.Fragment,
|
|
41
|
+
null,
|
|
42
|
+
R.addIndex(R.map)(function (rowColumn, i) {
|
|
43
|
+
return React.createElement(
|
|
44
|
+
XVector,
|
|
45
|
+
{
|
|
46
|
+
key: 'row-column-' + i,
|
|
47
|
+
yOffset: getYOffset(yOffset),
|
|
48
|
+
onSize: onYVectorSize(yOffset),
|
|
49
|
+
className: classes.root
|
|
50
|
+
},
|
|
51
|
+
React.createElement(ItemCell, _extends({
|
|
52
|
+
justifyContent: 'flex-start',
|
|
53
|
+
fontWeight: 'bold',
|
|
54
|
+
fontStyle: 'italic'
|
|
55
|
+
}, R.propOr({}, 'dimension', rowColumn)))
|
|
56
|
+
);
|
|
57
|
+
}, data),
|
|
58
|
+
React.createElement(Cell, { yOffset: getYOffset(yOffset), className: classes.sep }),
|
|
59
|
+
R.addIndex(R.map)(function (header, j) {
|
|
60
|
+
var _cx;
|
|
61
|
+
|
|
62
|
+
return React.createElement(
|
|
63
|
+
Cell,
|
|
64
|
+
{
|
|
65
|
+
key: 'row-header-' + j,
|
|
66
|
+
yOffset: getYOffset(yOffset),
|
|
67
|
+
className: cx(classes.sep, (_cx = {}, _cx[classes.highlight] = R.prop('col-' + j)(activeCellIds), _cx))
|
|
68
|
+
},
|
|
69
|
+
React.createElement(ItemCell, _extends({ justifyContent: 'center', alignItems: 'end' }, header))
|
|
70
|
+
);
|
|
71
|
+
}, headerData)
|
|
72
|
+
);
|
|
63
73
|
};
|
|
64
74
|
|
|
75
|
+
RowHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
76
|
+
data: PropTypes.array.isRequired,
|
|
77
|
+
headerData: PropTypes.array.isRequired,
|
|
78
|
+
yOffset: PropTypes.number.isRequired,
|
|
79
|
+
onYVectorSize: PropTypes.func.isRequired,
|
|
80
|
+
getYOffset: PropTypes.func.isRequired,
|
|
81
|
+
activeCellIds: PropTypes.object
|
|
82
|
+
} : {};
|
|
83
|
+
|
|
65
84
|
export default RowHeader;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import cx from 'classnames';
|
|
3
4
|
import * as R from 'ramda';
|
|
4
5
|
import Lens from '@material-ui/icons/Lens';
|
|
@@ -7,6 +8,7 @@ import { makeStyles } from '@material-ui/core/styles';
|
|
|
7
8
|
import { Cell } from './styles';
|
|
8
9
|
import ItemTooltip from './tooltip';
|
|
9
10
|
import { getDark } from '../utils';
|
|
11
|
+
|
|
10
12
|
var Dot = withStyles(function (theme) {
|
|
11
13
|
return {
|
|
12
14
|
root: {
|
|
@@ -15,6 +17,7 @@ var Dot = withStyles(function (theme) {
|
|
|
15
17
|
}
|
|
16
18
|
};
|
|
17
19
|
})(Lens);
|
|
20
|
+
|
|
18
21
|
var useStyles = makeStyles(function (theme) {
|
|
19
22
|
return {
|
|
20
23
|
zCell: {
|
|
@@ -50,41 +53,63 @@ var SectionHeader = function SectionHeader(_ref) {
|
|
|
50
53
|
columnCount = _ref.columnCount,
|
|
51
54
|
yOffset = _ref.yOffset,
|
|
52
55
|
isRtl = _ref.isRtl;
|
|
56
|
+
|
|
53
57
|
var classes = useStyles();
|
|
54
58
|
if (R.isEmpty(R.propOr([], 'data', section))) return null;
|
|
55
59
|
var data = R.propOr([], 'data', section);
|
|
56
60
|
var hasFlag = R.find(R.pipe(R.path(['value', 'flags']), R.isEmpty, R.not))(data);
|
|
57
|
-
return
|
|
58
|
-
|
|
59
|
-
yOffset: yOffset,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
} : undefined
|
|
66
|
-
}, R.pipe(R.addIndex(R.map)(function (entry, index) {
|
|
67
|
-
var _cx;
|
|
61
|
+
return React.createElement(
|
|
62
|
+
Cell,
|
|
63
|
+
{ spanCount: columnCount, yOffset: yOffset, className: classes.zCell },
|
|
64
|
+
React.createElement(
|
|
65
|
+
'div',
|
|
66
|
+
{ className: classes.zAtom, style: hasFlag ? { paddingTop: 0 } : undefined },
|
|
67
|
+
R.pipe(R.addIndex(R.map)(function (entry, index) {
|
|
68
|
+
var _cx;
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
70
|
+
return React.createElement(
|
|
71
|
+
React.Fragment,
|
|
72
|
+
{ key: index },
|
|
73
|
+
R.not(R.equals(index, 0)) && React.createElement(
|
|
74
|
+
'span',
|
|
75
|
+
{ className: classes.zQuant },
|
|
76
|
+
React.createElement(Dot, null)
|
|
77
|
+
),
|
|
78
|
+
React.createElement(
|
|
79
|
+
'span',
|
|
80
|
+
{
|
|
81
|
+
className: cx(classes.zQuant, classes.zQuantDimension, (_cx = {}, _cx[classes.zQuantDimensionRtl] = isRtl, _cx))
|
|
82
|
+
},
|
|
83
|
+
R.pathOr('', ['dimension', 'label'], entry),
|
|
84
|
+
':'
|
|
85
|
+
),
|
|
86
|
+
React.createElement(
|
|
87
|
+
'span',
|
|
88
|
+
{ className: classes.zQuant },
|
|
89
|
+
R.pathOr('', ['value', 'label'], entry)
|
|
90
|
+
),
|
|
91
|
+
R.not(R.isEmpty(R.pathOr([], ['value', 'flags'], entry))) && React.createElement(
|
|
92
|
+
React.Fragment,
|
|
93
|
+
null,
|
|
94
|
+
'\xA0'
|
|
95
|
+
),
|
|
96
|
+
React.createElement(ItemTooltip, { flags: R.pathOr([], ['value', 'flags'], entry) })
|
|
97
|
+
);
|
|
98
|
+
}))(data)
|
|
99
|
+
),
|
|
100
|
+
React.createElement(
|
|
101
|
+
'div',
|
|
102
|
+
{ className: classes.zAtom, style: hasFlag ? { paddingTop: 0 } : undefined },
|
|
103
|
+
React.createElement(ItemTooltip, { flags: R.propOr([], 'flags', section) })
|
|
104
|
+
)
|
|
105
|
+
);
|
|
88
106
|
};
|
|
89
107
|
|
|
108
|
+
SectionHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
109
|
+
section: PropTypes.object.isRequired,
|
|
110
|
+
yOffset: PropTypes.number.isRequired,
|
|
111
|
+
columnCount: PropTypes.number.isRequired,
|
|
112
|
+
isRtl: PropTypes.bool
|
|
113
|
+
} : {};
|
|
114
|
+
|
|
90
115
|
export default React.memo(SectionHeader);
|
package/es/Table/section-rows.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
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';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
3
5
|
import cx from 'classnames';
|
|
4
6
|
import * as R from 'ramda';
|
|
5
7
|
import { Cell } from './styles';
|
|
@@ -18,54 +20,75 @@ var SectionRows = function SectionRows(_ref) {
|
|
|
18
20
|
activeCellIds = _ref.activeCellIds,
|
|
19
21
|
activeCellHandler = _ref.activeCellHandler,
|
|
20
22
|
cellValueAccessor = _ref.cellValueAccessor;
|
|
23
|
+
|
|
21
24
|
var classes = useStyles();
|
|
25
|
+
|
|
22
26
|
if (R.lte(yColumnCount, 0)) return null;
|
|
23
27
|
return R.addIndex(R.map)(function (row, i) {
|
|
24
28
|
var _cx2;
|
|
25
29
|
|
|
26
|
-
var key = i +
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}, R.addIndex(R.map)(function (entry, columnIndex) {
|
|
33
|
-
var _cx;
|
|
30
|
+
var key = i + '-' + sectionData.key + '-' + row.key;
|
|
31
|
+
return React.createElement(
|
|
32
|
+
'span',
|
|
33
|
+
{ style: { display: 'contents' }, key: key },
|
|
34
|
+
R.addIndex(R.map)(function (entry, columnIndex) {
|
|
35
|
+
var _cx;
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
37
|
+
return React.createElement(
|
|
38
|
+
Cell,
|
|
39
|
+
{
|
|
40
|
+
key: columnIndex,
|
|
41
|
+
parents: R.pathOr([], ['value', 'parents'], entry),
|
|
42
|
+
className: cx(classes.xCell, classes.xCellDimension, (_cx = {}, _cx[classes.highlight] = R.prop(key)(activeCellIds), _cx))
|
|
43
|
+
},
|
|
44
|
+
React.createElement(ItemCell, _extends({ justifyContent: 'flex-start' }, R.propOr({}, 'value', entry)))
|
|
45
|
+
);
|
|
46
|
+
}, R.propOr([], 'data', row)),
|
|
47
|
+
React.createElement(
|
|
48
|
+
Cell,
|
|
49
|
+
{
|
|
50
|
+
className: cx(classes.sCell, (_cx2 = {}, _cx2[classes.highlight] = R.prop(key)(activeCellIds), _cx2))
|
|
51
|
+
},
|
|
52
|
+
React.createElement(ItemTooltip, { flags: R.propOr([], 'flags', row) })
|
|
53
|
+
),
|
|
54
|
+
R.addIndex(R.map)(function (column, columnIndex) {
|
|
55
|
+
var _cx3;
|
|
48
56
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
var keyCol = 'col-' + columnIndex;
|
|
58
|
+
var intersectionCellId = key + '/' + keyCol;
|
|
59
|
+
var isActive = R.pipe(R.propOr({}, 'intersectionCellId'), R.equals(intersectionCellId))(activeCellIds);
|
|
60
|
+
return React.createElement(
|
|
61
|
+
Cell,
|
|
62
|
+
{
|
|
63
|
+
key: keyCol,
|
|
64
|
+
className: cx(classes.xCell, classes.xCellValue, (_cx3 = {}, _cx3[classes.xCellActive] = isActive, _cx3[classes.highlight] = R.any(R.identity)([R.prop(key)(activeCellIds), R.prop(keyCol)(activeCellIds)]), _cx3)),
|
|
65
|
+
onClick: R.is(Function, activeCellHandler) ? function () {
|
|
66
|
+
var _activeCellHandler;
|
|
57
67
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
return activeCellHandler((_activeCellHandler = {}, _activeCellHandler[key] = R.not(isActive), _activeCellHandler[keyCol] = R.not(isActive), _activeCellHandler.intersectionCellId = isActive ? null : intersectionCellId, _activeCellHandler));
|
|
69
|
+
} : null
|
|
70
|
+
},
|
|
71
|
+
React.createElement(ValueCell, _extends({}, R.pipe(R.pathOr({ value: '..' }, [column.key, sectionData.key, row.key, 0]), cellValueAccessor)(cells), {
|
|
72
|
+
cellHandler: cellHandler
|
|
73
|
+
}))
|
|
74
|
+
);
|
|
75
|
+
}, headerData)
|
|
76
|
+
);
|
|
66
77
|
}, data);
|
|
67
78
|
};
|
|
68
79
|
|
|
80
|
+
SectionRows.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
81
|
+
cells: PropTypes.object.isRequired,
|
|
82
|
+
cellHandler: PropTypes.func,
|
|
83
|
+
cellValueAccessor: PropTypes.func,
|
|
84
|
+
data: PropTypes.array.isRequired,
|
|
85
|
+
headerData: PropTypes.array.isRequired,
|
|
86
|
+
sectionData: PropTypes.object.isRequired,
|
|
87
|
+
yColumnCount: PropTypes.number.isRequired,
|
|
88
|
+
activeCellIds: PropTypes.object,
|
|
89
|
+
activeCellHandler: PropTypes.func
|
|
90
|
+
} : {};
|
|
91
|
+
|
|
69
92
|
SectionRows.defaultProps = {
|
|
70
93
|
cells: {},
|
|
71
94
|
cellValueAccessor: R.identity,
|
|
@@ -74,4 +97,5 @@ SectionRows.defaultProps = {
|
|
|
74
97
|
sectionData: [],
|
|
75
98
|
yColumnCount: 1
|
|
76
99
|
};
|
|
100
|
+
|
|
77
101
|
export default React.memo(SectionRows);
|
package/es/Table/styles.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import glamorous from 'glamorous';
|
|
3
3
|
import * as R from 'ramda';
|
|
4
|
+
|
|
4
5
|
export var cell = {
|
|
5
|
-
outline:
|
|
6
|
+
outline: '1px solid #A4A1A1',
|
|
6
7
|
fontSize: 12,
|
|
7
8
|
fontWeight: 400,
|
|
8
9
|
lineHeight: 1.43,
|
|
9
10
|
padding: '0px 8px',
|
|
10
11
|
zIndex: 1
|
|
11
12
|
};
|
|
13
|
+
|
|
12
14
|
export var Cell = glamorous.div(cell, function (_ref) {
|
|
13
15
|
var spanCount = _ref.spanCount,
|
|
14
16
|
yOffset = _ref.yOffset;
|
|
15
17
|
return {
|
|
16
18
|
'@supports (display: grid)': {
|
|
17
|
-
gridColumn:
|
|
19
|
+
gridColumn: 'span ' + R.defaultTo(1, spanCount)
|
|
18
20
|
},
|
|
19
21
|
'@supports (position: sticky)': {
|
|
20
22
|
position: R.isNil(yOffset) ? null : 'sticky',
|
|
@@ -22,12 +24,14 @@ export var Cell = glamorous.div(cell, function (_ref) {
|
|
|
22
24
|
}
|
|
23
25
|
};
|
|
24
26
|
});
|
|
27
|
+
|
|
25
28
|
Cell.propTypes = {
|
|
26
29
|
className: PropTypes.string,
|
|
27
30
|
spanCount: PropTypes.number,
|
|
28
31
|
yOffset: PropTypes.number,
|
|
29
32
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node])
|
|
30
33
|
};
|
|
34
|
+
|
|
31
35
|
export var Table = glamorous.div({
|
|
32
36
|
display: '-ms-grid',
|
|
33
37
|
'@supports (display: grid)': {
|
|
@@ -38,7 +42,9 @@ export var Table = glamorous.div({
|
|
|
38
42
|
}, function (_ref2) {
|
|
39
43
|
var columnCount = _ref2.columnCount,
|
|
40
44
|
xColumnCount = _ref2.xColumnCount;
|
|
45
|
+
|
|
41
46
|
var gridTemplateColumns = R.pipe(R.times(R.always('auto')), R.update(R.dec(xColumnCount), '30px'), R.join(' '))(columnCount);
|
|
47
|
+
|
|
42
48
|
return {
|
|
43
49
|
gridTemplateColumns: gridTemplateColumns,
|
|
44
50
|
msGridColumns: gridTemplateColumns
|
package/es/Table/tableCell.js
CHANGED
|
@@ -1,19 +1,29 @@
|
|
|
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';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
3
5
|
import cx from 'classnames';
|
|
4
6
|
import ValueCell from './valueCell';
|
|
5
7
|
import useStyles from './useStyles';
|
|
6
8
|
|
|
7
9
|
var TableCell = function TableCell(_ref) {
|
|
8
10
|
var _ref$cell = _ref.cell,
|
|
9
|
-
cell = _ref$cell ===
|
|
11
|
+
cell = _ref$cell === undefined ? {} : _ref$cell,
|
|
10
12
|
cellHandler = _ref.cellHandler;
|
|
13
|
+
|
|
11
14
|
var classes = useStyles();
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
);
|
|
17
21
|
};
|
|
18
22
|
|
|
23
|
+
TableCell.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
24
|
+
cell: PropTypes.object,
|
|
25
|
+
cellHandler: PropTypes.func,
|
|
26
|
+
isRtl: PropTypes.bool
|
|
27
|
+
} : {};
|
|
28
|
+
|
|
19
29
|
export default TableCell;
|