@sis-cc/dotstatsuite-visions 6.6.4 → 7.1.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/DataHeader/DataHeader.js +31 -7
- package/es/InfoIcon/InfoIcon.js +37 -0
- package/es/TableHtml5/TableHtml5.js +20 -3
- package/es/TableHtml5/cell.js +8 -2
- package/es/TableHtml5/flags.js +2 -0
- package/es/TableHtml5/index.js +1 -0
- package/es/TableHtml5/section.js +15 -2
- package/es/TableHtml5/sectionHeader.js +13 -6
- package/es/TableHtml5/sideIcon.js +26 -0
- package/es/TableHtml5/subHeader.js +11 -1
- 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/DataHeader/DataHeader.js +34 -7
- package/lib/InfoIcon/InfoIcon.js +56 -0
- package/lib/TableHtml5/TableHtml5.js +20 -3
- package/lib/TableHtml5/cell.js +11 -2
- package/lib/TableHtml5/flags.js +2 -0
- package/lib/TableHtml5/section.js +17 -1
- package/lib/TableHtml5/sectionHeader.js +16 -6
- package/lib/TableHtml5/sideIcon.js +46 -0
- package/lib/TableHtml5/subHeader.js +14 -1
- 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
package/lib/TableHtml5/cell.js
CHANGED
|
@@ -32,6 +32,10 @@ var _Link = require('@material-ui/core/Link');
|
|
|
32
32
|
|
|
33
33
|
var _Link2 = _interopRequireDefault(_Link);
|
|
34
34
|
|
|
35
|
+
var _sideIcon = require('./sideIcon');
|
|
36
|
+
|
|
37
|
+
var _sideIcon2 = _interopRequireDefault(_sideIcon);
|
|
38
|
+
|
|
35
39
|
var _flags = require('./flags');
|
|
36
40
|
|
|
37
41
|
var _flags2 = _interopRequireDefault(_flags);
|
|
@@ -79,7 +83,9 @@ var Cell = function Cell(_ref) {
|
|
|
79
83
|
cellHandler = _ref.cellHandler,
|
|
80
84
|
activeCellHandler = _ref.activeCellHandler,
|
|
81
85
|
isActive = _ref.isActive,
|
|
82
|
-
isHighlight = _ref.isHighlight
|
|
86
|
+
isHighlight = _ref.isHighlight,
|
|
87
|
+
sideProps = _ref.sideProps,
|
|
88
|
+
sideToggle = _ref.sideToggle;
|
|
83
89
|
|
|
84
90
|
var classes = useStyles();
|
|
85
91
|
var hasFlag = R.not(R.isEmpty(flags));
|
|
@@ -112,6 +118,7 @@ var Cell = function Cell(_ref) {
|
|
|
112
118
|
_react2.default.createElement(
|
|
113
119
|
_Typography2.default,
|
|
114
120
|
{ variant: 'body1', tabIndex: 0, noWrap: hasFlag },
|
|
121
|
+
_react2.default.createElement(_sideIcon2.default, { sideProps: sideProps, sideToggle: sideToggle }),
|
|
115
122
|
hasFlag && _react2.default.createElement(_flags2.default, { flags: flags }),
|
|
116
123
|
uiValue
|
|
117
124
|
)
|
|
@@ -128,7 +135,9 @@ Cell.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
128
135
|
cellHandler: _propTypes2.default.func,
|
|
129
136
|
isActive: _propTypes2.default.bool,
|
|
130
137
|
isHighlight: _propTypes2.default.bool,
|
|
131
|
-
activeCellHandler: _propTypes2.default.func
|
|
138
|
+
activeCellHandler: _propTypes2.default.func,
|
|
139
|
+
sideProps: _propTypes2.default.object,
|
|
140
|
+
sideToggle: _propTypes2.default.func
|
|
132
141
|
} : {};
|
|
133
142
|
|
|
134
143
|
exports.default = Cell;
|
package/lib/TableHtml5/flags.js
CHANGED
|
@@ -52,6 +52,7 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
|
52
52
|
borderColor: 'inherit',
|
|
53
53
|
margin: theme.spacing(0, 0.5),
|
|
54
54
|
whiteSpace: 'nowrap',
|
|
55
|
+
display: 'inline',
|
|
55
56
|
fontWeight: 'bold',
|
|
56
57
|
fontStyle: 'normal',
|
|
57
58
|
textTransform: 'uppercase'
|
|
@@ -114,6 +115,7 @@ var Flags = function Flags(_ref) {
|
|
|
114
115
|
hasUncoded && _react2.default.createElement(
|
|
115
116
|
_react.Fragment,
|
|
116
117
|
null,
|
|
118
|
+
'\xA0',
|
|
117
119
|
_react2.default.createElement(_.Asterisk, { className: classes.svg, style: { fontSize: 11 } }),
|
|
118
120
|
_react2.default.createElement(
|
|
119
121
|
_Typography2.default,
|
|
@@ -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');
|
|
@@ -112,6 +116,8 @@ var Section = function Section(_ref) {
|
|
|
112
116
|
headerHeight = _ref.headerHeight,
|
|
113
117
|
sectionIndex = _ref.sectionIndex,
|
|
114
118
|
nbColumnsByRows = _ref.nbColumnsByRows,
|
|
119
|
+
sideToggle = _ref.sideToggle,
|
|
120
|
+
selectedSideCoord = _ref.selectedSideCoord,
|
|
115
121
|
subHeadCellsWidth = _ref.subHeadCellsWidth;
|
|
116
122
|
|
|
117
123
|
var classes = useStyles();
|
|
@@ -129,7 +135,9 @@ var Section = function Section(_ref) {
|
|
|
129
135
|
section: section,
|
|
130
136
|
currentSection: currentSection,
|
|
131
137
|
xLayoutDataLength: xLayoutDataLength,
|
|
132
|
-
headerHeight: headerHeight
|
|
138
|
+
headerHeight: headerHeight,
|
|
139
|
+
sideToggle: sideToggle,
|
|
140
|
+
selectedSideCoord: selectedSideCoord
|
|
133
141
|
}),
|
|
134
142
|
R.map(function (sectionbody) {
|
|
135
143
|
var _cx2;
|
|
@@ -190,6 +198,11 @@ var Section = function Section(_ref) {
|
|
|
190
198
|
_react2.default.createElement(
|
|
191
199
|
'div',
|
|
192
200
|
{ className: classes.flagContainer },
|
|
201
|
+
_react2.default.createElement(_sideIcon2.default, {
|
|
202
|
+
sideProps: R.prop('sideProps', sectionbody),
|
|
203
|
+
sideToggle: sideToggle,
|
|
204
|
+
selectedSideCoord: selectedSideCoord
|
|
205
|
+
}),
|
|
193
206
|
_react2.default.createElement(_flags2.default, { flags: R.prop('flags', sectionbody) })
|
|
194
207
|
)
|
|
195
208
|
),
|
|
@@ -206,6 +219,7 @@ var Section = function Section(_ref) {
|
|
|
206
219
|
}, R.pathOr({ value: '..' }, [item.key, currentSection, sectionbody.key, 0], cells), {
|
|
207
220
|
headers: rowIds + ' ' + columnIds + ' ' + currentSection,
|
|
208
221
|
cellHandler: cellHandler,
|
|
222
|
+
sideToggle: sideToggle,
|
|
209
223
|
isActive: isActive,
|
|
210
224
|
isHighlight: R.any(R.identity)([R.prop(rowId)(activeCellIds), R.prop(columnIndex)(activeCellIds)]),
|
|
211
225
|
activeCellHandler: R.is(Function)(activeCellHandler) ? function () {
|
|
@@ -233,6 +247,8 @@ Section.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
233
247
|
headerNumberRows: _propTypes2.default.number,
|
|
234
248
|
nbColumnsByRows: _propTypes2.default.array,
|
|
235
249
|
maxColumns: _propTypes2.default.number,
|
|
250
|
+
sideToggle: _propTypes2.default.func,
|
|
251
|
+
selectedSideCoord: _propTypes2.default.object,
|
|
236
252
|
subHeadCellsWidth: _propTypes2.default.arrayOf(_propTypes2.default.number)
|
|
237
253
|
} : {};
|
|
238
254
|
|
|
@@ -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);
|
|
@@ -74,9 +78,6 @@ var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
|
74
78
|
containerTextSection: {
|
|
75
79
|
display: 'flex',
|
|
76
80
|
alignItems: 'center'
|
|
77
|
-
},
|
|
78
|
-
flag: {
|
|
79
|
-
height: 0
|
|
80
81
|
}
|
|
81
82
|
};
|
|
82
83
|
});
|
|
@@ -87,7 +88,9 @@ var SectionHeader = function SectionHeader(_ref) {
|
|
|
87
88
|
section = _ref.section,
|
|
88
89
|
currentSection = _ref.currentSection,
|
|
89
90
|
xLayoutDataLength = _ref.xLayoutDataLength,
|
|
90
|
-
headerHeight = _ref.headerHeight
|
|
91
|
+
headerHeight = _ref.headerHeight,
|
|
92
|
+
sideToggle = _ref.sideToggle,
|
|
93
|
+
selectedSideCoord = _ref.selectedSideCoord;
|
|
91
94
|
|
|
92
95
|
var classes = useStyles();
|
|
93
96
|
if (R.compose(R.anyPass([R.isNil, R.isEmpty]), R.path([0, 'data']))(section)) return null;
|
|
@@ -141,7 +144,12 @@ var SectionHeader = function SectionHeader(_ref) {
|
|
|
141
144
|
),
|
|
142
145
|
_react2.default.createElement(
|
|
143
146
|
'div',
|
|
144
|
-
|
|
147
|
+
null,
|
|
148
|
+
_react2.default.createElement(_sideIcon2.default, {
|
|
149
|
+
sideProps: R.path([0, 'sideProps'], section),
|
|
150
|
+
sideToggle: sideToggle,
|
|
151
|
+
selectedSideCoord: selectedSideCoord
|
|
152
|
+
}),
|
|
145
153
|
_react2.default.createElement(_flags2.default, { flags: R.path([0, 'flags'], section) })
|
|
146
154
|
)
|
|
147
155
|
)
|
|
@@ -154,7 +162,9 @@ SectionHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
154
162
|
section: _propTypes2.default.array,
|
|
155
163
|
currentSection: _propTypes2.default.string,
|
|
156
164
|
xLayoutDataLength: _propTypes2.default.number,
|
|
157
|
-
headerHeight: _propTypes2.default.number
|
|
165
|
+
headerHeight: _propTypes2.default.number,
|
|
166
|
+
sideToggle: _propTypes2.default.func,
|
|
167
|
+
selectedSideCoord: _propTypes2.default.object
|
|
158
168
|
} : {};
|
|
159
169
|
|
|
160
170
|
exports.default = SectionHeader;
|
|
@@ -0,0 +1,46 @@
|
|
|
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 _InfoIcon = require('../InfoIcon/InfoIcon');
|
|
18
|
+
|
|
19
|
+
var _InfoIcon2 = _interopRequireDefault(_InfoIcon);
|
|
20
|
+
|
|
21
|
+
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; } }
|
|
22
|
+
|
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
+
|
|
25
|
+
var SideIcon = function SideIcon(_ref) {
|
|
26
|
+
var sideProps = _ref.sideProps,
|
|
27
|
+
sideToggle = _ref.sideToggle,
|
|
28
|
+
selectedSideCoord = _ref.selectedSideCoord;
|
|
29
|
+
|
|
30
|
+
if (R.isNil(sideProps) || !R.is(Function, sideToggle)) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
var isSelected = R.equals(sideProps.coordinates, selectedSideCoord);
|
|
34
|
+
return _react2.default.createElement(_InfoIcon2.default, { onClick: function onClick() {
|
|
35
|
+
return sideToggle(sideProps);
|
|
36
|
+
}, isSelected: isSelected });
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
SideIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
40
|
+
selectedSideCoord: _propTypes2.default.object,
|
|
41
|
+
sideProps: _propTypes2.default.object,
|
|
42
|
+
sideToggle: _propTypes2.default.func
|
|
43
|
+
} : {};
|
|
44
|
+
|
|
45
|
+
exports.default = SideIcon;
|
|
46
|
+
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 }; }
|
|
@@ -83,7 +87,9 @@ var SubHeader = _react2.default.forwardRef(function (_ref, refs) {
|
|
|
83
87
|
var headerData = _ref.headerData,
|
|
84
88
|
xLayoutData = _ref.xLayoutData,
|
|
85
89
|
activeCellIds = _ref.activeCellIds,
|
|
86
|
-
subHeadCellsWidth = _ref.subHeadCellsWidth
|
|
90
|
+
subHeadCellsWidth = _ref.subHeadCellsWidth,
|
|
91
|
+
sideToggle = _ref.sideToggle,
|
|
92
|
+
selectedSideCoord = _ref.selectedSideCoord;
|
|
87
93
|
|
|
88
94
|
var classes = useStyles();
|
|
89
95
|
var theme = (0, _styles.useTheme)();
|
|
@@ -129,6 +135,11 @@ var SubHeader = _react2.default.forwardRef(function (_ref, refs) {
|
|
|
129
135
|
key: index,
|
|
130
136
|
className: (0, _classnames2.default)(classes.fillerCell, (_cx = {}, _cx[classes.highlight] = R.prop(index)(activeCellIds), _cx))
|
|
131
137
|
},
|
|
138
|
+
_react2.default.createElement(_sideIcon2.default, {
|
|
139
|
+
sideProps: R.prop('sideProps', item),
|
|
140
|
+
sideToggle: sideToggle,
|
|
141
|
+
selectedSideCoord: selectedSideCoord
|
|
142
|
+
}),
|
|
132
143
|
_react2.default.createElement(_flags2.default, { flags: R.prop('flags', item) })
|
|
133
144
|
);
|
|
134
145
|
}, headerData)
|
|
@@ -139,6 +150,8 @@ SubHeader.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
139
150
|
activeCellIds: _propTypes2.default.object,
|
|
140
151
|
headerData: _propTypes2.default.array,
|
|
141
152
|
xLayoutData: _propTypes2.default.array,
|
|
153
|
+
sideToggle: _propTypes2.default.func,
|
|
154
|
+
selectedSideCoord: _propTypes2.default.object,
|
|
142
155
|
subHeadCellsWidth: _propTypes2.default.arrayOf(_propTypes2.default.number)
|
|
143
156
|
} : {};
|
|
144
157
|
|
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.1.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;
|
package/es/Table/index.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Table to display SDMX data.
|
|
3
|
-
*
|
|
4
|
-
* @memberOf VISIONS
|
|
5
|
-
* @name Table
|
|
6
|
-
* @tag component
|
|
7
|
-
* @api public
|
|
8
|
-
* @demoReady
|
|
9
|
-
* @props
|
|
10
|
-
* Table.propTypes = {
|
|
11
|
-
* cells: PropTypes.object,
|
|
12
|
-
* headerData: PropTypes.array,
|
|
13
|
-
* sectionsData: PropTypes.array,
|
|
14
|
-
* cellHandler: PropTypes.func,
|
|
15
|
-
* activeCellHandler: PropTypes.func,
|
|
16
|
-
* activeCellIds: PropTypes.object,
|
|
17
|
-
* };
|
|
18
|
-
* @theme
|
|
19
|
-
* {
|
|
20
|
-
* palette: {
|
|
21
|
-
* primary: {
|
|
22
|
-
* main: // background color header and hover/active cell borders. global override: outerPalette.primaryMain
|
|
23
|
-
* },
|
|
24
|
-
* secondary: {
|
|
25
|
-
* light: // used is tertiary is null
|
|
26
|
-
* dark: // used is tertiary is null
|
|
27
|
-
* },
|
|
28
|
-
* tertiary: {
|
|
29
|
-
* light: // background color row header and row labels,
|
|
30
|
-
* dark: // background color section,
|
|
31
|
-
* },
|
|
32
|
-
* common: {
|
|
33
|
-
* white: // background color cells
|
|
34
|
-
* },
|
|
35
|
-
* grey: {
|
|
36
|
-
* 'A700': // label color section, label row header, cells label color. globale override: outerPalette.textDark
|
|
37
|
-
* 200: // background color between row label and row values
|
|
38
|
-
* },
|
|
39
|
-
* },
|
|
40
|
-
* mixins: {
|
|
41
|
-
* table: {
|
|
42
|
-
* cellHighlight: {
|
|
43
|
-
* backgroundColor: // background color of the cell on click
|
|
44
|
-
* },
|
|
45
|
-
* flag: { // see usecase #7 flags
|
|
46
|
-
* fontFamily: "'PT Sans Narrow', 'Helvetica Neue', Helvetica, Arial, sans-serif",
|
|
47
|
-
* fontSize: 12,
|
|
48
|
-
* color: outerPalette.textLight
|
|
49
|
-
* }
|
|
50
|
-
* }
|
|
51
|
-
* }
|
|
52
|
-
* }
|
|
53
|
-
* @demoReady
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
export { default } from './Table';
|