@sis-cc/dotstatsuite-components 16.1.2 → 16.1.3
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.
|
@@ -17,25 +17,27 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
-
var parseCombinationDefinition = exports.parseCombinationDefinition = function parseCombinationDefinition(
|
|
21
|
-
return
|
|
22
|
-
return R.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
20
|
+
var parseCombinationDefinition = exports.parseCombinationDefinition = function parseCombinationDefinition(locale) {
|
|
21
|
+
return function (title, texts) {
|
|
22
|
+
return R.useWith(function (titles, texts) {
|
|
23
|
+
return R.addIndex(R.map)(function (title, index) {
|
|
24
|
+
var split = R.split(':', title);
|
|
25
|
+
if (R.length(split !== 2)) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var _split = (0, _slicedToArray3.default)(split, 2),
|
|
30
|
+
id = _split[0],
|
|
31
|
+
codes = _split[1];
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
id: id,
|
|
35
|
+
concepts: R.split(',', codes),
|
|
36
|
+
name: R.has(locale, texts) ? R.pipe(R.prop(locale), R.nth(index), R.split(':'), R.last)(texts) : '[' + id + ']'
|
|
37
|
+
};
|
|
38
|
+
}, titles);
|
|
39
|
+
}, [R.split(';'), R.map(R.split(';'))])(title, texts);
|
|
40
|
+
};
|
|
39
41
|
};
|
|
40
42
|
|
|
41
43
|
var getCombinationDefinitions = exports.getCombinationDefinitions = function getCombinationDefinitions(annotations, locale) {
|
|
@@ -48,5 +50,5 @@ var getCombinationDefinitions = exports.getCombinationDefinitions = function get
|
|
|
48
50
|
var title = R.propOr('', 'title', annotation);
|
|
49
51
|
var texts = R.propOr({}, 'texts', annotation);
|
|
50
52
|
|
|
51
|
-
return parseCombinationDefinition(title, texts);
|
|
53
|
+
return parseCombinationDefinition(locale)(title, texts);
|
|
52
54
|
};
|
|
@@ -62,7 +62,7 @@ var prepareData = exports.prepareData = function prepareData(sdmxJson, _ref) {
|
|
|
62
62
|
var concepts = defaultCombinations.concepts,
|
|
63
63
|
names = defaultCombinations.names;
|
|
64
64
|
|
|
65
|
-
combinations = (0, _getCombinationDefinitions.parseCombinationDefinition)(concepts, names);
|
|
65
|
+
combinations = (0, _getCombinationDefinitions.parseCombinationDefinition)(locale)(concepts, names);
|
|
66
66
|
}
|
|
67
67
|
var metadataCoordinates = (0, _getMetadataCoordinates.getMetadataCoordinates)(sdmxJson);
|
|
68
68
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as R from 'ramda';
|
|
2
2
|
|
|
3
|
-
export const parseCombinationDefinition = (title, texts) => R.useWith(
|
|
3
|
+
export const parseCombinationDefinition = (locale) => (title, texts) => R.useWith(
|
|
4
4
|
(titles, texts) =>
|
|
5
5
|
R.addIndex(R.map)((title, index) => {
|
|
6
6
|
const split = R.split(':', title);
|
|
@@ -27,5 +27,5 @@ export const getCombinationDefinitions = (annotations, locale) => {
|
|
|
27
27
|
const title = R.propOr('', 'title', annotation);
|
|
28
28
|
const texts = R.propOr({}, 'texts', annotation);
|
|
29
29
|
|
|
30
|
-
return parseCombinationDefinition(title, texts);
|
|
30
|
+
return parseCombinationDefinition(locale)(title, texts);
|
|
31
31
|
};
|
|
@@ -25,7 +25,7 @@ export const prepareData = (sdmxJson, { customAttributes, locale, hierarchies, d
|
|
|
25
25
|
let combinations = getCombinationDefinitions(annotations, locale);
|
|
26
26
|
if (R.isEmpty(combinations) && !R.isEmpty(defaultCombinations)) {
|
|
27
27
|
const { concepts, names } = defaultCombinations;
|
|
28
|
-
combinations = parseCombinationDefinition(concepts, names);
|
|
28
|
+
combinations = parseCombinationDefinition(locale)(concepts, names);
|
|
29
29
|
}
|
|
30
30
|
const metadataCoordinates = getMetadataCoordinates(sdmxJson);
|
|
31
31
|
|