@sis-cc/dotstatsuite-visions 8.0.8 → 8.0.9
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/TableHtml5/TableHtml5.js +2 -1
- package/es/TableHtml5/header.js +12 -2
- package/es/TableHtml5/subHeader.js +5 -1
- package/es/TableHtml5/utils.js +10 -9
- package/lib/TableHtml5/TableHtml5.js +3 -1
- package/lib/TableHtml5/header.js +12 -2
- package/lib/TableHtml5/subHeader.js +5 -1
- package/lib/TableHtml5/utils.js +11 -10
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ import Header from './header';
|
|
|
9
9
|
import SubHeader from './subHeader';
|
|
10
10
|
import Section from './section';
|
|
11
11
|
import Cell from './cell';
|
|
12
|
+
import { defaultLabelAccessor } from './utils';
|
|
12
13
|
|
|
13
14
|
/*
|
|
14
15
|
* Accessibility.
|
|
@@ -74,7 +75,7 @@ var TableHtml5 = function TableHtml5(_ref) {
|
|
|
74
75
|
testId = _ref$testId === undefined ? 'vis-table' : _ref$testId,
|
|
75
76
|
HTMLRenderer = _ref.HTMLRenderer,
|
|
76
77
|
_ref$labelAccessor = _ref.labelAccessor,
|
|
77
|
-
labelAccessor = _ref$labelAccessor === undefined ?
|
|
78
|
+
labelAccessor = _ref$labelAccessor === undefined ? defaultLabelAccessor : _ref$labelAccessor;
|
|
78
79
|
|
|
79
80
|
var classes = useStyles();
|
|
80
81
|
|
package/es/TableHtml5/header.js
CHANGED
|
@@ -94,7 +94,12 @@ var Header = function Header(_ref) {
|
|
|
94
94
|
Typography,
|
|
95
95
|
{ variant: 'body1', className: classes.cellLabelHeader },
|
|
96
96
|
R.pipe(R.path([0, 'data', index, 'dimension']), labelAccessor)(headerData),
|
|
97
|
-
React.createElement(Flags, {
|
|
97
|
+
React.createElement(Flags, {
|
|
98
|
+
HTMLRenderer: HTMLRenderer,
|
|
99
|
+
flags: flags,
|
|
100
|
+
isHeader: true,
|
|
101
|
+
labelAccessor: labelAccessor
|
|
102
|
+
})
|
|
98
103
|
)
|
|
99
104
|
)
|
|
100
105
|
),
|
|
@@ -138,7 +143,12 @@ var Header = function Header(_ref) {
|
|
|
138
143
|
variant: 'body1'
|
|
139
144
|
},
|
|
140
145
|
R.prop('label', value),
|
|
141
|
-
React.createElement(Flags, {
|
|
146
|
+
React.createElement(Flags, {
|
|
147
|
+
HTMLRenderer: HTMLRenderer,
|
|
148
|
+
flags: flags,
|
|
149
|
+
isHeader: true,
|
|
150
|
+
labelAccessor: labelAccessor
|
|
151
|
+
})
|
|
142
152
|
)
|
|
143
153
|
)
|
|
144
154
|
);
|
|
@@ -108,7 +108,11 @@ var SubHeader = React.forwardRef(function (_ref, refs) {
|
|
|
108
108
|
className: cx(classes.fillerCell, (_cx = {}, _cx[classes.highlight] = R.prop(index)(activeCellIds), _cx))
|
|
109
109
|
},
|
|
110
110
|
!R.isNil(SideIcon) && React.createElement(SideIcon, { sideProps: R.prop('sideProps', item) }),
|
|
111
|
-
React.createElement(Flags, {
|
|
111
|
+
React.createElement(Flags, {
|
|
112
|
+
flags: R.prop('flags', item),
|
|
113
|
+
labelAccessor: labelAccessor,
|
|
114
|
+
HTMLRenderer: HTMLRenderer
|
|
115
|
+
})
|
|
112
116
|
);
|
|
113
117
|
}, headerData)
|
|
114
118
|
);
|
package/es/TableHtml5/utils.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import * as R from 'ramda';
|
|
2
2
|
|
|
3
|
-
var getLabel = function getLabel(labelAccessor) {
|
|
4
|
-
return function (value) {
|
|
5
|
-
return R.pipe(R.propOr([], 'missingParents'), R.map(labelAccessor), R.append(labelAccessor(value)), R.join(' > '))(value);
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
|
|
9
3
|
export var getValue = function getValue(labelAccessor) {
|
|
10
4
|
return function (item) {
|
|
11
5
|
return R.has('values', item) ? R.reduce(function (acc, val) {
|
|
12
6
|
return {
|
|
7
|
+
label: acc.label,
|
|
13
8
|
id: R.isEmpty(acc.id) ? val.id : acc.id + ', ' + val.id,
|
|
14
|
-
label: R.isEmpty(acc.label) ? getLabel(labelAccessor)(val) : acc.label + ', ' + getLabel(labelAccessor)(val),
|
|
15
9
|
flags: R.concat(acc.flags, val.flags || []),
|
|
16
10
|
parents: R.concat(acc.parents, val.parents || [])
|
|
17
11
|
};
|
|
18
|
-
}, { id: '',
|
|
19
|
-
return R.assoc('label',
|
|
12
|
+
}, { id: '', flags: [], parents: [], label: labelAccessor(item.values) }, item.values) : R.pipe(R.prop('value'), function (val) {
|
|
13
|
+
return R.assoc('label', labelAccessor(val), val);
|
|
20
14
|
})(item);
|
|
21
15
|
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export var defaultLabelAccessor = function defaultLabelAccessor(item) {
|
|
19
|
+
if (R.is(Object, item)) {
|
|
20
|
+
return R.prop('name', item);
|
|
21
|
+
}
|
|
22
|
+
return R.pipe(R.pluck('name'), R.join(', '))(item);
|
|
22
23
|
};
|
|
@@ -39,6 +39,8 @@ var _cell = require('./cell');
|
|
|
39
39
|
|
|
40
40
|
var _cell2 = _interopRequireDefault(_cell);
|
|
41
41
|
|
|
42
|
+
var _utils = require('./utils');
|
|
43
|
+
|
|
42
44
|
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; } }
|
|
43
45
|
|
|
44
46
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -107,7 +109,7 @@ var TableHtml5 = function TableHtml5(_ref) {
|
|
|
107
109
|
testId = _ref$testId === undefined ? 'vis-table' : _ref$testId,
|
|
108
110
|
HTMLRenderer = _ref.HTMLRenderer,
|
|
109
111
|
_ref$labelAccessor = _ref.labelAccessor,
|
|
110
|
-
labelAccessor = _ref$labelAccessor === undefined ?
|
|
112
|
+
labelAccessor = _ref$labelAccessor === undefined ? _utils.defaultLabelAccessor : _ref$labelAccessor;
|
|
111
113
|
|
|
112
114
|
var classes = useStyles();
|
|
113
115
|
|
package/lib/TableHtml5/header.js
CHANGED
|
@@ -128,7 +128,12 @@ var Header = function Header(_ref) {
|
|
|
128
128
|
_Typography2.default,
|
|
129
129
|
{ variant: 'body1', className: classes.cellLabelHeader },
|
|
130
130
|
R.pipe(R.path([0, 'data', index, 'dimension']), labelAccessor)(headerData),
|
|
131
|
-
_react2.default.createElement(_flags2.default, {
|
|
131
|
+
_react2.default.createElement(_flags2.default, {
|
|
132
|
+
HTMLRenderer: HTMLRenderer,
|
|
133
|
+
flags: flags,
|
|
134
|
+
isHeader: true,
|
|
135
|
+
labelAccessor: labelAccessor
|
|
136
|
+
})
|
|
132
137
|
)
|
|
133
138
|
)
|
|
134
139
|
),
|
|
@@ -172,7 +177,12 @@ var Header = function Header(_ref) {
|
|
|
172
177
|
variant: 'body1'
|
|
173
178
|
},
|
|
174
179
|
R.prop('label', value),
|
|
175
|
-
_react2.default.createElement(_flags2.default, {
|
|
180
|
+
_react2.default.createElement(_flags2.default, {
|
|
181
|
+
HTMLRenderer: HTMLRenderer,
|
|
182
|
+
flags: flags,
|
|
183
|
+
isHeader: true,
|
|
184
|
+
labelAccessor: labelAccessor
|
|
185
|
+
})
|
|
176
186
|
)
|
|
177
187
|
)
|
|
178
188
|
);
|
|
@@ -141,7 +141,11 @@ var SubHeader = _react2.default.forwardRef(function (_ref, refs) {
|
|
|
141
141
|
className: (0, _classnames2.default)(classes.fillerCell, (_cx = {}, _cx[classes.highlight] = R.prop(index)(activeCellIds), _cx))
|
|
142
142
|
},
|
|
143
143
|
!R.isNil(SideIcon) && _react2.default.createElement(SideIcon, { sideProps: R.prop('sideProps', item) }),
|
|
144
|
-
_react2.default.createElement(_flags2.default, {
|
|
144
|
+
_react2.default.createElement(_flags2.default, {
|
|
145
|
+
flags: R.prop('flags', item),
|
|
146
|
+
labelAccessor: labelAccessor,
|
|
147
|
+
HTMLRenderer: HTMLRenderer
|
|
148
|
+
})
|
|
145
149
|
);
|
|
146
150
|
}, headerData)
|
|
147
151
|
);
|
package/lib/TableHtml5/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.getValue = undefined;
|
|
4
|
+
exports.defaultLabelAccessor = exports.getValue = undefined;
|
|
5
5
|
|
|
6
6
|
var _ramda = require('ramda');
|
|
7
7
|
|
|
@@ -9,23 +9,24 @@ var R = _interopRequireWildcard(_ramda);
|
|
|
9
9
|
|
|
10
10
|
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; } }
|
|
11
11
|
|
|
12
|
-
var getLabel = function getLabel(labelAccessor) {
|
|
13
|
-
return function (value) {
|
|
14
|
-
return R.pipe(R.propOr([], 'missingParents'), R.map(labelAccessor), R.append(labelAccessor(value)), R.join(' > '))(value);
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
|
|
18
12
|
var getValue = exports.getValue = function getValue(labelAccessor) {
|
|
19
13
|
return function (item) {
|
|
20
14
|
return R.has('values', item) ? R.reduce(function (acc, val) {
|
|
21
15
|
return {
|
|
16
|
+
label: acc.label,
|
|
22
17
|
id: R.isEmpty(acc.id) ? val.id : acc.id + ', ' + val.id,
|
|
23
|
-
label: R.isEmpty(acc.label) ? getLabel(labelAccessor)(val) : acc.label + ', ' + getLabel(labelAccessor)(val),
|
|
24
18
|
flags: R.concat(acc.flags, val.flags || []),
|
|
25
19
|
parents: R.concat(acc.parents, val.parents || [])
|
|
26
20
|
};
|
|
27
|
-
}, { id: '',
|
|
28
|
-
return R.assoc('label',
|
|
21
|
+
}, { id: '', flags: [], parents: [], label: labelAccessor(item.values) }, item.values) : R.pipe(R.prop('value'), function (val) {
|
|
22
|
+
return R.assoc('label', labelAccessor(val), val);
|
|
29
23
|
})(item);
|
|
30
24
|
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
var defaultLabelAccessor = exports.defaultLabelAccessor = function defaultLabelAccessor(item) {
|
|
28
|
+
if (R.is(Object, item)) {
|
|
29
|
+
return R.prop('name', item);
|
|
30
|
+
}
|
|
31
|
+
return R.pipe(R.pluck('name'), R.join(', '))(item);
|
|
31
32
|
};
|