@sis-cc/dotstatsuite-visions 6.6.3 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/AuthDialog/index.js +3 -2
- package/es/CollapsibleTree/Collapse.js +97 -0
- package/es/CollapsibleTree/CollapsibleTree.js +171 -0
- package/es/CollapsibleTree/index.js +44 -0
- package/es/DataEdit/Input.js +1 -1
- package/es/TableHtml5/TableHtml5.js +16 -3
- package/es/TableHtml5/cell.js +8 -2
- package/es/TableHtml5/flags.js +2 -0
- package/es/TableHtml5/header.js +2 -2
- package/es/TableHtml5/section.js +22 -18
- package/es/TableHtml5/sectionHeader.js +6 -2
- package/es/TableHtml5/sideIcon.js +44 -0
- package/es/TableHtml5/subHeader.js +14 -15
- package/es/index.js +1 -1
- package/es/theme.js +13 -0
- package/lib/AuthDialog/index.js +6 -5
- package/lib/CollapsibleTree/Collapse.js +126 -0
- package/lib/CollapsibleTree/CollapsibleTree.js +216 -0
- package/lib/{Table → CollapsibleTree}/index.js +2 -2
- package/lib/DataEdit/Input.js +1 -1
- package/lib/TableHtml5/TableHtml5.js +16 -3
- package/lib/TableHtml5/cell.js +11 -2
- package/lib/TableHtml5/flags.js +2 -0
- package/lib/TableHtml5/header.js +2 -2
- package/lib/TableHtml5/section.js +22 -15
- package/lib/TableHtml5/sectionHeader.js +9 -2
- package/lib/TableHtml5/sideIcon.js +68 -0
- package/lib/TableHtml5/subHeader.js +15 -13
- package/lib/index.js +10 -10
- package/lib/theme.js +13 -0
- package/package.json +6 -7
- package/es/Table/Table.js +0 -170
- package/es/Table/header.js +0 -91
- package/es/Table/index.js +0 -56
- package/es/Table/itemCell.js +0 -54
- package/es/Table/row-header.js +0 -84
- package/es/Table/section-header.js +0 -115
- package/es/Table/section-rows.js +0 -101
- package/es/Table/styles.js +0 -52
- package/es/Table/tableCell.js +0 -29
- package/es/Table/tooltip.js +0 -85
- package/es/Table/useStyles.js +0 -34
- package/es/Table/valueCell.js +0 -63
- package/lib/Table/Table.js +0 -203
- package/lib/Table/header.js +0 -116
- package/lib/Table/itemCell.js +0 -74
- package/lib/Table/row-header.js +0 -113
- package/lib/Table/section-header.js +0 -145
- package/lib/Table/section-rows.js +0 -134
- package/lib/Table/styles.js +0 -69
- package/lib/Table/tableCell.js +0 -50
- package/lib/Table/tooltip.js +0 -104
- package/lib/Table/useStyles.js +0 -41
- package/lib/Table/valueCell.js +0 -86
|
@@ -46,6 +46,10 @@ var _cell = require('./cell');
|
|
|
46
46
|
|
|
47
47
|
var _cell2 = _interopRequireDefault(_cell);
|
|
48
48
|
|
|
49
|
+
var _sideIcon = require('./sideIcon');
|
|
50
|
+
|
|
51
|
+
var _sideIcon2 = _interopRequireDefault(_sideIcon);
|
|
52
|
+
|
|
49
53
|
var _utils = require('../utils');
|
|
50
54
|
|
|
51
55
|
var _flags = require('./flags');
|
|
@@ -74,7 +78,8 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
|
74
78
|
border: 'inherit',
|
|
75
79
|
borderBottom: '1px solid ' + theme.palette.grey[500],
|
|
76
80
|
borderRight: '1px solid ' + theme.palette.grey[500],
|
|
77
|
-
padding: theme.spacing(0.5) + 'px ' + theme.spacing(1) + 'px'
|
|
81
|
+
padding: theme.spacing(0.5) + 'px ' + theme.spacing(1) + 'px',
|
|
82
|
+
position: 'sticky'
|
|
78
83
|
},
|
|
79
84
|
cellContent: {
|
|
80
85
|
display: 'flex',
|
|
@@ -91,7 +96,11 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
|
91
96
|
hierarchySpace: {
|
|
92
97
|
marginBottom: 'auto'
|
|
93
98
|
},
|
|
94
|
-
highlight: theme.mixins.table.cellHighlight
|
|
99
|
+
highlight: theme.mixins.table.cellHighlight,
|
|
100
|
+
stickyHeader: {
|
|
101
|
+
position: 'sticky',
|
|
102
|
+
zIndex: 1
|
|
103
|
+
}
|
|
95
104
|
};
|
|
96
105
|
});
|
|
97
106
|
var mapIndexed = R.addIndex(R.map);
|
|
@@ -107,12 +116,15 @@ var Section = function Section(_ref) {
|
|
|
107
116
|
headerHeight = _ref.headerHeight,
|
|
108
117
|
sectionIndex = _ref.sectionIndex,
|
|
109
118
|
nbColumnsByRows = _ref.nbColumnsByRows,
|
|
119
|
+
sideToggle = _ref.sideToggle,
|
|
110
120
|
subHeadCellsWidth = _ref.subHeadCellsWidth;
|
|
111
121
|
|
|
112
122
|
var classes = useStyles();
|
|
113
123
|
var currentSection = R.path([0, 'key'], section);
|
|
114
124
|
var headerNumberRows = R.length(nbColumnsByRows);
|
|
115
125
|
var maxColumns = R.last(nbColumnsByRows);
|
|
126
|
+
var theme = (0, _styles.useTheme)();
|
|
127
|
+
var isRtl = (0, _utils.getIsRtl)(theme);
|
|
116
128
|
|
|
117
129
|
return _react2.default.createElement(
|
|
118
130
|
_TableBody2.default,
|
|
@@ -122,7 +134,8 @@ var Section = function Section(_ref) {
|
|
|
122
134
|
section: section,
|
|
123
135
|
currentSection: currentSection,
|
|
124
136
|
xLayoutDataLength: xLayoutDataLength,
|
|
125
|
-
headerHeight: headerHeight
|
|
137
|
+
headerHeight: headerHeight,
|
|
138
|
+
sideToggle: sideToggle
|
|
126
139
|
}),
|
|
127
140
|
R.map(function (sectionbody) {
|
|
128
141
|
var _cx2;
|
|
@@ -151,16 +164,11 @@ var Section = function Section(_ref) {
|
|
|
151
164
|
_TableCell2.default,
|
|
152
165
|
{
|
|
153
166
|
key: id,
|
|
154
|
-
className: (0, _classnames2.default)(classes.rowTitle, (_cx = {}, _cx[classes.topCell] = R.not(R.isEmpty(flags)), _cx[classes.highlight] = R.prop(rowId)(activeCellIds), _cx)),
|
|
167
|
+
className: (0, _classnames2.default)(classes.rowTitle, classes.stickyHeader, (_cx = {}, _cx[classes.topCell] = R.not(R.isEmpty(flags)), _cx[classes.highlight] = R.prop(rowId)(activeCellIds), _cx)),
|
|
155
168
|
id: id,
|
|
156
169
|
headers: 'subHeader_' + index + ' ' + currentSection,
|
|
157
170
|
component: 'th',
|
|
158
|
-
style: {
|
|
159
|
-
position: 'sticky',
|
|
160
|
-
left: subHeadCellsWidth[index],
|
|
161
|
-
right: subHeadCellsWidth[index],
|
|
162
|
-
zIndex: 1
|
|
163
|
-
}
|
|
171
|
+
style: isRtl ? { right: subHeadCellsWidth[index] } : { left: subHeadCellsWidth[index] }
|
|
164
172
|
},
|
|
165
173
|
_react2.default.createElement(
|
|
166
174
|
'div',
|
|
@@ -183,15 +191,12 @@ var Section = function Section(_ref) {
|
|
|
183
191
|
_TableCell2.default,
|
|
184
192
|
{
|
|
185
193
|
className: (0, _classnames2.default)(classes.fillerCell, (_cx2 = {}, _cx2[classes.highlight] = R.prop(rowId)(activeCellIds), _cx2)),
|
|
186
|
-
style: {
|
|
187
|
-
position: 'sticky',
|
|
188
|
-
left: R.last(subHeadCellsWidth),
|
|
189
|
-
right: R.last(subHeadCellsWidth)
|
|
190
|
-
}
|
|
194
|
+
style: isRtl ? { right: R.last(subHeadCellsWidth) } : { left: R.last(subHeadCellsWidth) }
|
|
191
195
|
},
|
|
192
196
|
_react2.default.createElement(
|
|
193
197
|
'div',
|
|
194
198
|
{ className: classes.flagContainer },
|
|
199
|
+
_react2.default.createElement(_sideIcon2.default, { sideProps: R.prop('sideProps', sectionbody), sideToggle: sideToggle }),
|
|
195
200
|
_react2.default.createElement(_flags2.default, { flags: R.prop('flags', sectionbody) })
|
|
196
201
|
)
|
|
197
202
|
),
|
|
@@ -208,6 +213,7 @@ var Section = function Section(_ref) {
|
|
|
208
213
|
}, R.pathOr({ value: '..' }, [item.key, currentSection, sectionbody.key, 0], cells), {
|
|
209
214
|
headers: rowIds + ' ' + columnIds + ' ' + currentSection,
|
|
210
215
|
cellHandler: cellHandler,
|
|
216
|
+
sideToggle: sideToggle,
|
|
211
217
|
isActive: isActive,
|
|
212
218
|
isHighlight: R.any(R.identity)([R.prop(rowId)(activeCellIds), R.prop(columnIndex)(activeCellIds)]),
|
|
213
219
|
activeCellHandler: R.is(Function)(activeCellHandler) ? function () {
|
|
@@ -235,6 +241,7 @@ Section.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
235
241
|
headerNumberRows: _propTypes2.default.number,
|
|
236
242
|
nbColumnsByRows: _propTypes2.default.array,
|
|
237
243
|
maxColumns: _propTypes2.default.number,
|
|
244
|
+
sideToggle: _propTypes2.default.func,
|
|
238
245
|
subHeadCellsWidth: _propTypes2.default.arrayOf(_propTypes2.default.number)
|
|
239
246
|
} : {};
|
|
240
247
|
|
|
@@ -34,6 +34,10 @@ var _TableRow = require('@material-ui/core/TableRow');
|
|
|
34
34
|
|
|
35
35
|
var _TableRow2 = _interopRequireDefault(_TableRow);
|
|
36
36
|
|
|
37
|
+
var _sideIcon = require('./sideIcon');
|
|
38
|
+
|
|
39
|
+
var _sideIcon2 = _interopRequireDefault(_sideIcon);
|
|
40
|
+
|
|
37
41
|
var _flags = require('./flags');
|
|
38
42
|
|
|
39
43
|
var _flags2 = _interopRequireDefault(_flags);
|
|
@@ -87,7 +91,8 @@ var SectionHeader = function SectionHeader(_ref) {
|
|
|
87
91
|
section = _ref.section,
|
|
88
92
|
currentSection = _ref.currentSection,
|
|
89
93
|
xLayoutDataLength = _ref.xLayoutDataLength,
|
|
90
|
-
headerHeight = _ref.headerHeight
|
|
94
|
+
headerHeight = _ref.headerHeight,
|
|
95
|
+
sideToggle = _ref.sideToggle;
|
|
91
96
|
|
|
92
97
|
var classes = useStyles();
|
|
93
98
|
if (R.compose(R.anyPass([R.isNil, R.isEmpty]), R.path([0, 'data']))(section)) return null;
|
|
@@ -142,6 +147,7 @@ var SectionHeader = function SectionHeader(_ref) {
|
|
|
142
147
|
_react2.default.createElement(
|
|
143
148
|
'div',
|
|
144
149
|
{ className: classes.flag },
|
|
150
|
+
_react2.default.createElement(_sideIcon2.default, { sideProps: R.path([0, 'sideProps'], section), sideToggle: sideToggle }),
|
|
145
151
|
_react2.default.createElement(_flags2.default, { flags: R.path([0, 'flags'], section) })
|
|
146
152
|
)
|
|
147
153
|
)
|
|
@@ -154,7 +160,8 @@ SectionHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
154
160
|
section: _propTypes2.default.array,
|
|
155
161
|
currentSection: _propTypes2.default.string,
|
|
156
162
|
xLayoutDataLength: _propTypes2.default.number,
|
|
157
|
-
headerHeight: _propTypes2.default.number
|
|
163
|
+
headerHeight: _propTypes2.default.number,
|
|
164
|
+
sideToggle: _propTypes2.default.func
|
|
158
165
|
} : {};
|
|
159
166
|
|
|
160
167
|
exports.default = SectionHeader;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _react = require('react');
|
|
6
|
+
|
|
7
|
+
var _react2 = _interopRequireDefault(_react);
|
|
8
|
+
|
|
9
|
+
var _ramda = require('ramda');
|
|
10
|
+
|
|
11
|
+
var R = _interopRequireWildcard(_ramda);
|
|
12
|
+
|
|
13
|
+
var _propTypes = require('prop-types');
|
|
14
|
+
|
|
15
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
16
|
+
|
|
17
|
+
var _styles = require('@material-ui/core/styles');
|
|
18
|
+
|
|
19
|
+
var _Info = require('@material-ui/icons//Info');
|
|
20
|
+
|
|
21
|
+
var _Info2 = _interopRequireDefault(_Info);
|
|
22
|
+
|
|
23
|
+
var _IconButton = require('@material-ui/core/IconButton');
|
|
24
|
+
|
|
25
|
+
var _IconButton2 = _interopRequireDefault(_IconButton);
|
|
26
|
+
|
|
27
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
28
|
+
|
|
29
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
|
+
|
|
31
|
+
var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
32
|
+
return {
|
|
33
|
+
icon: {
|
|
34
|
+
color: theme.palette.primary.main,
|
|
35
|
+
padding: 0
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
var SideIcon = function SideIcon(_ref) {
|
|
41
|
+
var sideProps = _ref.sideProps,
|
|
42
|
+
sideToggle = _ref.sideToggle;
|
|
43
|
+
|
|
44
|
+
var classes = useStyles();
|
|
45
|
+
if (R.isNil(sideProps) || !R.is(Function, sideToggle)) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return _react2.default.createElement(
|
|
49
|
+
_IconButton2.default,
|
|
50
|
+
{
|
|
51
|
+
size: 'small',
|
|
52
|
+
className: classes.icon,
|
|
53
|
+
onClick: function onClick() {
|
|
54
|
+
return sideToggle(sideProps);
|
|
55
|
+
},
|
|
56
|
+
'data-testid': 'ref-md-info'
|
|
57
|
+
},
|
|
58
|
+
_react2.default.createElement(_Info2.default, { fontSize: 'small' })
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
SideIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
63
|
+
sideProps: _propTypes2.default.object,
|
|
64
|
+
sideToggle: _propTypes2.default.func
|
|
65
|
+
} : {};
|
|
66
|
+
|
|
67
|
+
exports.default = SideIcon;
|
|
68
|
+
module.exports = exports['default'];
|
|
@@ -38,6 +38,10 @@ var _flags = require('./flags');
|
|
|
38
38
|
|
|
39
39
|
var _flags2 = _interopRequireDefault(_flags);
|
|
40
40
|
|
|
41
|
+
var _sideIcon = require('./sideIcon');
|
|
42
|
+
|
|
43
|
+
var _sideIcon2 = _interopRequireDefault(_sideIcon);
|
|
44
|
+
|
|
41
45
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
42
46
|
|
|
43
47
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -51,7 +55,9 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
|
51
55
|
borderRight: '1px solid ' + theme.palette.grey[500],
|
|
52
56
|
padding: theme.spacing(0.5) + 'px ' + theme.spacing(1) + 'px',
|
|
53
57
|
color: theme.palette.grey['A700'],
|
|
54
|
-
verticalAlign: 'middle'
|
|
58
|
+
verticalAlign: 'middle',
|
|
59
|
+
position: 'sticky',
|
|
60
|
+
zIndex: 1
|
|
55
61
|
},
|
|
56
62
|
fillerCell: {
|
|
57
63
|
backgroundColor: theme.palette.grey[200],
|
|
@@ -81,9 +87,12 @@ var SubHeader = _react2.default.forwardRef(function (_ref, refs) {
|
|
|
81
87
|
var headerData = _ref.headerData,
|
|
82
88
|
xLayoutData = _ref.xLayoutData,
|
|
83
89
|
activeCellIds = _ref.activeCellIds,
|
|
84
|
-
subHeadCellsWidth = _ref.subHeadCellsWidth
|
|
90
|
+
subHeadCellsWidth = _ref.subHeadCellsWidth,
|
|
91
|
+
sideToggle = _ref.sideToggle;
|
|
85
92
|
|
|
86
93
|
var classes = useStyles();
|
|
94
|
+
var theme = (0, _styles.useTheme)();
|
|
95
|
+
var isRtl = (0, _utils.getIsRtl)(theme);
|
|
87
96
|
return _react2.default.createElement(
|
|
88
97
|
_TableRow2.default,
|
|
89
98
|
null,
|
|
@@ -95,12 +104,7 @@ var SubHeader = _react2.default.forwardRef(function (_ref, refs) {
|
|
|
95
104
|
className: classes.columnsTitle,
|
|
96
105
|
key: index,
|
|
97
106
|
id: 'subHeader_' + index,
|
|
98
|
-
style: {
|
|
99
|
-
position: 'sticky',
|
|
100
|
-
left: subHeadCellsWidth[index],
|
|
101
|
-
right: subHeadCellsWidth[index],
|
|
102
|
-
zIndex: 1
|
|
103
|
-
},
|
|
107
|
+
style: isRtl ? { right: subHeadCellsWidth[index] } : { left: subHeadCellsWidth[index] },
|
|
104
108
|
ref: function ref(element) {
|
|
105
109
|
return refs.current[index] = element;
|
|
106
110
|
}
|
|
@@ -119,11 +123,7 @@ var SubHeader = _react2.default.forwardRef(function (_ref, refs) {
|
|
|
119
123
|
}, xLayoutData),
|
|
120
124
|
_react2.default.createElement(_TableCell2.default, {
|
|
121
125
|
className: classes.fillerCell,
|
|
122
|
-
style: {
|
|
123
|
-
position: 'sticky',
|
|
124
|
-
left: R.last(subHeadCellsWidth),
|
|
125
|
-
right: R.last(subHeadCellsWidth)
|
|
126
|
-
}
|
|
126
|
+
style: isRtl ? { position: 'sticky', right: R.last(subHeadCellsWidth) } : { position: 'sticky', left: R.last(subHeadCellsWidth) }
|
|
127
127
|
}),
|
|
128
128
|
mapIndexed(function (item, index) {
|
|
129
129
|
var _cx;
|
|
@@ -134,6 +134,7 @@ var SubHeader = _react2.default.forwardRef(function (_ref, refs) {
|
|
|
134
134
|
key: index,
|
|
135
135
|
className: (0, _classnames2.default)(classes.fillerCell, (_cx = {}, _cx[classes.highlight] = R.prop(index)(activeCellIds), _cx))
|
|
136
136
|
},
|
|
137
|
+
_react2.default.createElement(_sideIcon2.default, { sideProps: R.prop('sideProps', item), sideToggle: sideToggle }),
|
|
137
138
|
_react2.default.createElement(_flags2.default, { flags: R.prop('flags', item) })
|
|
138
139
|
);
|
|
139
140
|
}, headerData)
|
|
@@ -144,6 +145,7 @@ SubHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
144
145
|
activeCellIds: _propTypes2.default.object,
|
|
145
146
|
headerData: _propTypes2.default.array,
|
|
146
147
|
xLayoutData: _propTypes2.default.array,
|
|
148
|
+
sideToggle: _propTypes2.default.func,
|
|
147
149
|
subHeadCellsWidth: _propTypes2.default.arrayOf(_propTypes2.default.number)
|
|
148
150
|
} : {};
|
|
149
151
|
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.T4_BREAKPOINTS = exports.innerPalette = exports.sisccTheme = exports.AuthDialog = exports.VerticalButton = exports.Tooltip = exports.ToggleButton = exports.Tag = exports.TablePreview = exports.TableLayout = exports.Cell = exports.TableHtml5 = exports.TableHeader = exports.TableFooter = exports.
|
|
4
|
+
exports.T4_BREAKPOINTS = exports.innerPalette = exports.sisccTheme = exports.AuthDialog = exports.VerticalButton = exports.Tooltip = exports.ToggleButton = exports.Tag = exports.TablePreview = exports.TableLayout = exports.Cell = exports.TableHtml5 = exports.TableHeader = exports.TableFooter = exports.Spotlight = exports.SisccFooter = exports.Share = exports.Select = exports.ScopeList = exports.reduceChildren = exports.spotlightScopeListEngine = exports.PeriodPicker = exports.Pagination = exports.NoData = exports.Logo = exports.Loading = exports.LabelDivider = exports.InputNumber = exports.Input = exports.ExpansionPanel = exports.DataFooter = exports.DataHeader = exports.Dataflow = exports.DataEdit = exports.CollapsibleTree = exports.CollapseButtons = exports.Chips = exports.ChartsConfig = exports.Button = exports.Breadcrumbs = exports.ApiQueries = exports.Alert = undefined;
|
|
5
5
|
|
|
6
6
|
var _Alert = require('./Alert');
|
|
7
7
|
|
|
@@ -66,6 +66,15 @@ Object.defineProperty(exports, 'CollapseButtons', {
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
+
var _CollapsibleTree = require('./CollapsibleTree');
|
|
70
|
+
|
|
71
|
+
Object.defineProperty(exports, 'CollapsibleTree', {
|
|
72
|
+
enumerable: true,
|
|
73
|
+
get: function get() {
|
|
74
|
+
return _interopRequireDefault(_CollapsibleTree).default;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
69
78
|
var _DataEdit = require('./DataEdit');
|
|
70
79
|
|
|
71
80
|
Object.defineProperty(exports, 'DataEdit', {
|
|
@@ -255,15 +264,6 @@ Object.defineProperty(exports, 'Spotlight', {
|
|
|
255
264
|
}
|
|
256
265
|
});
|
|
257
266
|
|
|
258
|
-
var _Table = require('./Table');
|
|
259
|
-
|
|
260
|
-
Object.defineProperty(exports, 'Table', {
|
|
261
|
-
enumerable: true,
|
|
262
|
-
get: function get() {
|
|
263
|
-
return _interopRequireDefault(_Table).default;
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
|
|
267
267
|
var _TableFooter = require('./TableFooter');
|
|
268
268
|
|
|
269
269
|
Object.defineProperty(exports, 'TableFooter', {
|
package/lib/theme.js
CHANGED
|
@@ -218,6 +218,19 @@ var sisccTheme = exports.sisccTheme = function sisccTheme(_ref) {
|
|
|
218
218
|
fontFamily: "'Roboto Slab', serif"
|
|
219
219
|
}
|
|
220
220
|
},
|
|
221
|
+
collapsibleTree: {
|
|
222
|
+
title: {
|
|
223
|
+
fontSize: 17,
|
|
224
|
+
fontFamily: "'PT Sans Narrow', 'Helvetica Neue', Helvetica, Arial, sans-serif",
|
|
225
|
+
color: outerPalette.textLight || innerPalette.textLight
|
|
226
|
+
},
|
|
227
|
+
buttonSublevel: {
|
|
228
|
+
color: outerPalette.textLight || innerPalette.textLight,
|
|
229
|
+
fontSize: 14,
|
|
230
|
+
fontWeight: 700,
|
|
231
|
+
fontFamily: "'PT Sans Narrow', 'Helvetica Neue', Helvetica, Arial, sans-serif"
|
|
232
|
+
}
|
|
233
|
+
},
|
|
221
234
|
dataEdit: {
|
|
222
235
|
root: {
|
|
223
236
|
fontWeight: 400,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sis-cc/dotstatsuite-visions",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Library of visual components",
|
|
5
5
|
"author": "OECD",
|
|
6
6
|
"homepage": "https://visions-qa.siscc.org/#o",
|
|
@@ -35,17 +35,13 @@
|
|
|
35
35
|
"@react-hook/size": "^2.1.1",
|
|
36
36
|
"classnames": "^2.2.6",
|
|
37
37
|
"date-fns": "^1.30.1",
|
|
38
|
-
"glamor": "^2.20.40",
|
|
39
|
-
"glamorous": "^5.0.0",
|
|
40
38
|
"numeral": "^2.0.6",
|
|
41
39
|
"prop-types": "^15.7.2",
|
|
42
|
-
"ramda": "^0.
|
|
40
|
+
"ramda": "^0.27.0",
|
|
43
41
|
"react": "^16.13.0",
|
|
44
42
|
"react-beautiful-dnd": "^13.0.0",
|
|
45
43
|
"react-dom": "^16.8.6",
|
|
46
44
|
"react-router-dom": "^5.0.1",
|
|
47
|
-
"react-select": "^2.0.0",
|
|
48
|
-
"react-sizeme": "^2.6.12",
|
|
49
45
|
"react-virtualized": "^9.21.2",
|
|
50
46
|
"recompose": "^0.30.0"
|
|
51
47
|
},
|
|
@@ -82,7 +78,10 @@
|
|
|
82
78
|
"react-a11y": "^1.1.0",
|
|
83
79
|
"react-helmet": "^5.2.1",
|
|
84
80
|
"react-scrollable-anchor": "^0.6.1",
|
|
85
|
-
"react-syntax-highlighter": "^10.2.1"
|
|
81
|
+
"react-syntax-highlighter": "^10.2.1",
|
|
82
|
+
"webpack": "^5.68.0",
|
|
83
|
+
"webpack-cli": "^4.9.2",
|
|
84
|
+
"webpack-dev-server": "^4.7.4"
|
|
86
85
|
},
|
|
87
86
|
"jest": {
|
|
88
87
|
"verbose": true,
|
package/es/Table/Table.js
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import * as R from 'ramda';
|
|
4
|
-
import Header from './header';
|
|
5
|
-
import RowHeader from './row-header';
|
|
6
|
-
import SectionHeader from './section-header';
|
|
7
|
-
import SectionRows from './section-rows';
|
|
8
|
-
import TableCell from './tableCell';
|
|
9
|
-
import { Table as StyledTable } from './styles';
|
|
10
|
-
|
|
11
|
-
var HEADER = 'HEADER';
|
|
12
|
-
var ROW_HEADER = 'ROW_HEADER';
|
|
13
|
-
|
|
14
|
-
var updatedHeights = function updatedHeights(headerYOffsets) {
|
|
15
|
-
return R.pipe(R.length, R.times(R.always(0)), R.addIndex(R.map)(function (zero, index) {
|
|
16
|
-
return R.isNil(R.nth(index)(headerYOffsets)) ? zero : R.nth(index)(headerYOffsets);
|
|
17
|
-
}));
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
var Table = function Table(_ref) {
|
|
21
|
-
var _React$useState2;
|
|
22
|
-
|
|
23
|
-
var _ref$sectionsData = _ref.sectionsData,
|
|
24
|
-
sectionsData = _ref$sectionsData === undefined ? [] : _ref$sectionsData,
|
|
25
|
-
_ref$headerData = _ref.headerData,
|
|
26
|
-
headerData = _ref$headerData === undefined ? [] : _ref$headerData,
|
|
27
|
-
_ref$cells = _ref.cells,
|
|
28
|
-
cells = _ref$cells === undefined ? {} : _ref$cells,
|
|
29
|
-
isRtl = _ref.isRtl,
|
|
30
|
-
cellHandler = _ref.cellHandler,
|
|
31
|
-
cellValueAccessor = _ref.cellValueAccessor,
|
|
32
|
-
activeCellIds = _ref.activeCellIds,
|
|
33
|
-
activeCellHandler = _ref.activeCellHandler;
|
|
34
|
-
|
|
35
|
-
var _React$useState = React.useState((_React$useState2 = {}, _React$useState2[HEADER] = [0], _React$useState2[ROW_HEADER] = [0], _React$useState2)),
|
|
36
|
-
yOffsets = _React$useState[0],
|
|
37
|
-
setYOffsets = _React$useState[1];
|
|
38
|
-
|
|
39
|
-
var _React$useMemo = React.useMemo(function () {
|
|
40
|
-
var xLayoutData = R.pathOr([], [0, 1, 0, 'data'], sectionsData);
|
|
41
|
-
var xColumnCount = R.pipe(R.length, R.inc)(xLayoutData);
|
|
42
|
-
var yColumnCount = R.length(headerData);
|
|
43
|
-
var columnCount = R.add(xColumnCount, yColumnCount);
|
|
44
|
-
var yOffsetRowHeader = 0;
|
|
45
|
-
var yOffsetSectionHeader = R.inc(yOffsetRowHeader);
|
|
46
|
-
var msGridRowOffsetFactory = function msGridRowOffsetFactory(sectionIndex) {
|
|
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)]);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
return {
|
|
51
|
-
transposedHeaderData: R.pipe(R.pluck('data'), R.map(R.reduce(function (acc, cell) {
|
|
52
|
-
var previousCell = R.last(acc);
|
|
53
|
-
var previousCellKey = R.prop('key', previousCell);
|
|
54
|
-
var valueId = R.path(['value', 'id'], cell);
|
|
55
|
-
var cellKey = R.isNil(previousCellKey) ? valueId : previousCellKey + '-' + valueId;
|
|
56
|
-
return R.append(R.assoc('key', cellKey, cell), acc);
|
|
57
|
-
}, [])), R.transpose)(headerData),
|
|
58
|
-
xLayoutData: xLayoutData,
|
|
59
|
-
xColumnCount: xColumnCount,
|
|
60
|
-
yColumnCount: yColumnCount,
|
|
61
|
-
columnCount: columnCount,
|
|
62
|
-
yOffsetRowHeader: yOffsetRowHeader,
|
|
63
|
-
yOffsetSectionHeader: yOffsetSectionHeader,
|
|
64
|
-
msGridRowOffsetFactory: msGridRowOffsetFactory
|
|
65
|
-
};
|
|
66
|
-
}, [headerData, sectionsData]),
|
|
67
|
-
transposedHeaderData = _React$useMemo.transposedHeaderData,
|
|
68
|
-
xLayoutData = _React$useMemo.xLayoutData,
|
|
69
|
-
columnCount = _React$useMemo.columnCount,
|
|
70
|
-
xColumnCount = _React$useMemo.xColumnCount,
|
|
71
|
-
yColumnCount = _React$useMemo.yColumnCount,
|
|
72
|
-
yOffsetRowHeader = _React$useMemo.yOffsetRowHeader,
|
|
73
|
-
yOffsetSectionHeader = _React$useMemo.yOffsetSectionHeader,
|
|
74
|
-
msGridRowOffsetFactory = _React$useMemo.msGridRowOffsetFactory;
|
|
75
|
-
|
|
76
|
-
// Hooks before
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var isSingleObs = R.hasPath(['', '', '', 0], cells);
|
|
80
|
-
if (isSingleObs) return React.createElement(TableCell, { cell: R.pathOr({}, ['', '', '', 0], cells), cellHandler: cellHandler });
|
|
81
|
-
|
|
82
|
-
// Utility funcs
|
|
83
|
-
var getYOffset = function getYOffset(index) {
|
|
84
|
-
return R.pipe(R.prop(HEADER), R.slice(0, index), R.sum)(yOffsets);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
var getSubHeaderOffset = function getSubHeaderOffset(headerData) {
|
|
88
|
-
return function (index) {
|
|
89
|
-
var lengthHeader = R.length(headerData);
|
|
90
|
-
return R.add(R.pipe(R.prop(HEADER), R.slice(0, lengthHeader), R.sum)(yOffsets), R.pipe(R.prop(ROW_HEADER), R.slice(0, index), R.sum)(yOffsets));
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
var onYVectorSize = function onYVectorSize(label, headerData) {
|
|
95
|
-
return function (index) {
|
|
96
|
-
return function (_ref2) {
|
|
97
|
-
var _R$mergeRight;
|
|
98
|
-
|
|
99
|
-
var height = _ref2.height;
|
|
100
|
-
|
|
101
|
-
var newYOffsets = R.equals(label, HEADER) ? updatedHeights(R.prop(HEADER)(yOffsets))(headerData) : R.prop(label)(yOffsets);
|
|
102
|
-
setYOffsets(R.mergeRight(yOffsets, (_R$mergeRight = {}, _R$mergeRight[label] = R.update(index, height)(newYOffsets), _R$mergeRight)));
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
return React.createElement(
|
|
108
|
-
StyledTable,
|
|
109
|
-
{ columnCount: columnCount, xColumnCount: xColumnCount },
|
|
110
|
-
React.createElement(Header, {
|
|
111
|
-
data: transposedHeaderData,
|
|
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),
|
|
121
|
-
yOffset: yOffsetRowHeader,
|
|
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
|
-
);
|
|
157
|
-
};
|
|
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
|
-
|
|
170
|
-
export default Table;
|
package/es/Table/header.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import * as R from 'ramda';
|
|
6
|
-
import sizeMe from 'react-sizeme';
|
|
7
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
8
|
-
import { Cell } from './styles';
|
|
9
|
-
import ItemCell from './itemCell';
|
|
10
|
-
|
|
11
|
-
var useStyles = makeStyles(function (theme) {
|
|
12
|
-
return {
|
|
13
|
-
root: {
|
|
14
|
-
backgroundColor: theme.palette.primary.main,
|
|
15
|
-
color: theme.palette.getContrastText(theme.palette.primary.main),
|
|
16
|
-
'& span': {
|
|
17
|
-
color: theme.palette.getContrastText(theme.palette.primary.main),
|
|
18
|
-
borderColor: theme.palette.getContrastText(theme.palette.primary.main)
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
var YVector = sizeMe({ noPlaceholder: true, monitorHeight: true, monitorWidth: false })(Cell);
|
|
25
|
-
|
|
26
|
-
var mergeHeaderCells = R.reduce(function (acc, headerCell) {
|
|
27
|
-
var previousCell = R.last(acc);
|
|
28
|
-
var cellValue = R.prop('key', headerCell);
|
|
29
|
-
var previousCellValue = R.prop('key', previousCell);
|
|
30
|
-
if (cellValue !== previousCellValue) {
|
|
31
|
-
return R.append(R.assoc('spanCount', 1, headerCell), acc);
|
|
32
|
-
}
|
|
33
|
-
return R.over(R.lensIndex(-1), R.evolve({ spanCount: R.add(1) }), acc);
|
|
34
|
-
}, []);
|
|
35
|
-
|
|
36
|
-
var Header = function Header(_ref) {
|
|
37
|
-
var data = _ref.data,
|
|
38
|
-
onYVectorSize = _ref.onYVectorSize,
|
|
39
|
-
getYOffset = _ref.getYOffset,
|
|
40
|
-
xColumnCount = _ref.xColumnCount;
|
|
41
|
-
|
|
42
|
-
var classes = useStyles();
|
|
43
|
-
if (R.equals([''], data)) return null;
|
|
44
|
-
var getDimensionFromRow = R.pipe(R.head, R.prop('dimension'));
|
|
45
|
-
var nRows = R.length(data);
|
|
46
|
-
|
|
47
|
-
return R.addIndex(R.map)(function (headerRow, i) {
|
|
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
|
-
);
|
|
81
|
-
})(data);
|
|
82
|
-
};
|
|
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
|
-
|
|
91
|
-
export default Header;
|