@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/Table/Table.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 Header from './header';
|
|
4
5
|
import RowHeader from './row-header';
|
|
@@ -6,6 +7,7 @@ import SectionHeader from './section-header';
|
|
|
6
7
|
import SectionRows from './section-rows';
|
|
7
8
|
import TableCell from './tableCell';
|
|
8
9
|
import { Table as StyledTable } from './styles';
|
|
10
|
+
|
|
9
11
|
var HEADER = 'HEADER';
|
|
10
12
|
var ROW_HEADER = 'ROW_HEADER';
|
|
11
13
|
|
|
@@ -19,11 +21,11 @@ var Table = function Table(_ref) {
|
|
|
19
21
|
var _React$useState2;
|
|
20
22
|
|
|
21
23
|
var _ref$sectionsData = _ref.sectionsData,
|
|
22
|
-
sectionsData = _ref$sectionsData ===
|
|
24
|
+
sectionsData = _ref$sectionsData === undefined ? [] : _ref$sectionsData,
|
|
23
25
|
_ref$headerData = _ref.headerData,
|
|
24
|
-
headerData = _ref$headerData ===
|
|
26
|
+
headerData = _ref$headerData === undefined ? [] : _ref$headerData,
|
|
25
27
|
_ref$cells = _ref.cells,
|
|
26
|
-
cells = _ref$cells ===
|
|
28
|
+
cells = _ref$cells === undefined ? {} : _ref$cells,
|
|
27
29
|
isRtl = _ref.isRtl,
|
|
28
30
|
cellHandler = _ref.cellHandler,
|
|
29
31
|
cellValueAccessor = _ref.cellValueAccessor,
|
|
@@ -41,7 +43,6 @@ var Table = function Table(_ref) {
|
|
|
41
43
|
var columnCount = R.add(xColumnCount, yColumnCount);
|
|
42
44
|
var yOffsetRowHeader = 0;
|
|
43
45
|
var yOffsetSectionHeader = R.inc(yOffsetRowHeader);
|
|
44
|
-
|
|
45
46
|
var msGridRowOffsetFactory = function msGridRowOffsetFactory(sectionIndex) {
|
|
46
47
|
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)]);
|
|
47
48
|
};
|
|
@@ -51,7 +52,7 @@ var Table = function Table(_ref) {
|
|
|
51
52
|
var previousCell = R.last(acc);
|
|
52
53
|
var previousCellKey = R.prop('key', previousCell);
|
|
53
54
|
var valueId = R.path(['value', 'id'], cell);
|
|
54
|
-
var cellKey = R.isNil(previousCellKey) ? valueId : previousCellKey +
|
|
55
|
+
var cellKey = R.isNil(previousCellKey) ? valueId : previousCellKey + '-' + valueId;
|
|
55
56
|
return R.append(R.assoc('key', cellKey, cell), acc);
|
|
56
57
|
}, [])), R.transpose)(headerData),
|
|
57
58
|
xLayoutData: xLayoutData,
|
|
@@ -70,15 +71,15 @@ var Table = function Table(_ref) {
|
|
|
70
71
|
yColumnCount = _React$useMemo.yColumnCount,
|
|
71
72
|
yOffsetRowHeader = _React$useMemo.yOffsetRowHeader,
|
|
72
73
|
yOffsetSectionHeader = _React$useMemo.yOffsetSectionHeader,
|
|
73
|
-
msGridRowOffsetFactory = _React$useMemo.msGridRowOffsetFactory;
|
|
74
|
+
msGridRowOffsetFactory = _React$useMemo.msGridRowOffsetFactory;
|
|
75
|
+
|
|
76
|
+
// Hooks before
|
|
74
77
|
|
|
75
78
|
|
|
76
79
|
var isSingleObs = R.hasPath(['', '', '', 0], cells);
|
|
77
|
-
if (isSingleObs) return
|
|
78
|
-
cell: R.pathOr({}, ['', '', '', 0], cells),
|
|
79
|
-
cellHandler: cellHandler
|
|
80
|
-
}); // Utility funcs
|
|
80
|
+
if (isSingleObs) return React.createElement(TableCell, { cell: R.pathOr({}, ['', '', '', 0], cells), cellHandler: cellHandler });
|
|
81
81
|
|
|
82
|
+
// Utility funcs
|
|
82
83
|
var getYOffset = function getYOffset(index) {
|
|
83
84
|
return R.pipe(R.prop(HEADER), R.slice(0, index), R.sum)(yOffsets);
|
|
84
85
|
};
|
|
@@ -96,54 +97,74 @@ var Table = function Table(_ref) {
|
|
|
96
97
|
var _R$mergeRight;
|
|
97
98
|
|
|
98
99
|
var height = _ref2.height;
|
|
100
|
+
|
|
99
101
|
var newYOffsets = R.equals(label, HEADER) ? updatedHeights(R.prop(HEADER)(yOffsets))(headerData) : R.prop(label)(yOffsets);
|
|
100
102
|
setYOffsets(R.mergeRight(yOffsets, (_R$mergeRight = {}, _R$mergeRight[label] = R.update(index, height)(newYOffsets), _R$mergeRight)));
|
|
101
103
|
};
|
|
102
104
|
};
|
|
103
105
|
};
|
|
104
106
|
|
|
105
|
-
return
|
|
106
|
-
|
|
107
|
-
xColumnCount: xColumnCount
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
xColumnCount: xColumnCount,
|
|
111
|
-
onYVectorSize: onYVectorSize(HEADER, transposedHeaderData),
|
|
112
|
-
getYOffset: getYOffset
|
|
113
|
-
}), /*#__PURE__*/React.createElement(RowHeader, {
|
|
114
|
-
data: xLayoutData,
|
|
115
|
-
headerData: headerData,
|
|
116
|
-
onYVectorSize: onYVectorSize(ROW_HEADER),
|
|
117
|
-
getYOffset: getSubHeaderOffset(transposedHeaderData),
|
|
118
|
-
yOffset: yOffsetRowHeader,
|
|
119
|
-
activeCellIds: activeCellIds
|
|
120
|
-
}), R.addIndex(R.map)(function (_ref3, sectionIndex) {
|
|
121
|
-
var sectionHeaderData = _ref3[0],
|
|
122
|
-
sectionRowsData = _ref3[1];
|
|
123
|
-
var msGridRowOffset = msGridRowOffsetFactory(sectionIndex);
|
|
124
|
-
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
125
|
-
key: "section-" + sectionIndex
|
|
126
|
-
}, /*#__PURE__*/React.createElement(SectionHeader, {
|
|
127
|
-
columnCount: columnCount,
|
|
128
|
-
section: sectionHeaderData,
|
|
129
|
-
yOffset: getSubHeaderOffset(transposedHeaderData)(yOffsetSectionHeader),
|
|
130
|
-
msGridRow: msGridRowOffset,
|
|
131
|
-
isRtl: isRtl
|
|
132
|
-
}), /*#__PURE__*/React.createElement(SectionRows, {
|
|
133
|
-
data: sectionRowsData,
|
|
134
|
-
headerData: headerData,
|
|
135
|
-
cells: cells,
|
|
136
|
-
cellHandler: cellHandler,
|
|
137
|
-
cellValueAccessor: cellValueAccessor,
|
|
138
|
-
activeCellIds: activeCellIds,
|
|
139
|
-
activeCellHandler: activeCellHandler,
|
|
140
|
-
sectionData: sectionHeaderData,
|
|
141
|
-
yColumnCount: yColumnCount,
|
|
107
|
+
return React.createElement(
|
|
108
|
+
StyledTable,
|
|
109
|
+
{ columnCount: columnCount, xColumnCount: xColumnCount },
|
|
110
|
+
React.createElement(Header, {
|
|
111
|
+
data: transposedHeaderData,
|
|
142
112
|
xColumnCount: xColumnCount,
|
|
113
|
+
onYVectorSize: onYVectorSize(HEADER, transposedHeaderData),
|
|
114
|
+
getYOffset: getYOffset
|
|
115
|
+
}),
|
|
116
|
+
React.createElement(RowHeader, {
|
|
117
|
+
data: xLayoutData,
|
|
118
|
+
headerData: headerData,
|
|
119
|
+
onYVectorSize: onYVectorSize(ROW_HEADER),
|
|
120
|
+
getYOffset: getSubHeaderOffset(transposedHeaderData),
|
|
143
121
|
yOffset: yOffsetRowHeader,
|
|
144
|
-
|
|
145
|
-
})
|
|
146
|
-
|
|
122
|
+
activeCellIds: activeCellIds
|
|
123
|
+
}),
|
|
124
|
+
R.addIndex(R.map)(function (_ref3, sectionIndex) {
|
|
125
|
+
var sectionHeaderData = _ref3[0],
|
|
126
|
+
sectionRowsData = _ref3[1];
|
|
127
|
+
|
|
128
|
+
var msGridRowOffset = msGridRowOffsetFactory(sectionIndex);
|
|
129
|
+
|
|
130
|
+
return React.createElement(
|
|
131
|
+
React.Fragment,
|
|
132
|
+
{ key: 'section-' + sectionIndex },
|
|
133
|
+
React.createElement(SectionHeader, {
|
|
134
|
+
columnCount: columnCount,
|
|
135
|
+
section: sectionHeaderData,
|
|
136
|
+
yOffset: getSubHeaderOffset(transposedHeaderData)(yOffsetSectionHeader),
|
|
137
|
+
msGridRow: msGridRowOffset,
|
|
138
|
+
isRtl: isRtl
|
|
139
|
+
}),
|
|
140
|
+
React.createElement(SectionRows, {
|
|
141
|
+
data: sectionRowsData,
|
|
142
|
+
headerData: headerData,
|
|
143
|
+
cells: cells,
|
|
144
|
+
cellHandler: cellHandler,
|
|
145
|
+
cellValueAccessor: cellValueAccessor,
|
|
146
|
+
activeCellIds: activeCellIds,
|
|
147
|
+
activeCellHandler: activeCellHandler,
|
|
148
|
+
sectionData: sectionHeaderData,
|
|
149
|
+
yColumnCount: yColumnCount,
|
|
150
|
+
xColumnCount: xColumnCount,
|
|
151
|
+
yOffset: yOffsetRowHeader,
|
|
152
|
+
msGridRowOffset: msGridRowOffset
|
|
153
|
+
})
|
|
154
|
+
);
|
|
155
|
+
}, sectionsData)
|
|
156
|
+
);
|
|
147
157
|
};
|
|
148
158
|
|
|
159
|
+
Table.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
160
|
+
headerData: PropTypes.array.isRequired,
|
|
161
|
+
sectionsData: PropTypes.array.isRequired,
|
|
162
|
+
cells: PropTypes.object.isRequired,
|
|
163
|
+
cellHandler: PropTypes.func,
|
|
164
|
+
cellValueAccessor: PropTypes.func,
|
|
165
|
+
activeCellHandler: PropTypes.func,
|
|
166
|
+
activeCellIds: PropTypes.object,
|
|
167
|
+
isRtl: PropTypes.bool
|
|
168
|
+
} : {};
|
|
169
|
+
|
|
149
170
|
export default Table;
|
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);
|