@sis-cc/dotstatsuite-components 14.2.5 → 14.3.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.
@@ -58,6 +58,9 @@ var getRowData = function getRowData(indexes, dimension) {
58
58
  var data = _ref.data,
59
59
  missingParents = _ref.missingParents;
60
60
 
61
+ if (R.isNil(_value)) {
62
+ return { data: data, missingParents: {} };
63
+ }
61
64
  var raw = {
62
65
  dimension: R.pick(['id', 'name', '__index'], dimension),
63
66
  value: _value
@@ -146,7 +149,7 @@ var getLayoutData = function getLayoutData(layoutIndexes, layout) {
146
149
  rest = (0, _objectWithoutProperties3.default)(layoutIndexes, ['header', 'sections']);
147
150
 
148
151
  var headerData = R.map(function (i) {
149
- return indexesToLayoutData(layout.header, i);
152
+ return R.pipe(indexesToLayoutData, R.filter(R.prop('value')))(layout.header, i);
150
153
  }, header);
151
154
 
152
155
  var sectionsData = R.map(function (_ref2) {
@@ -154,13 +157,12 @@ var getLayoutData = function getLayoutData(layoutIndexes, layout) {
154
157
  sectionIndexes = _ref3[0],
155
158
  rows = _ref3[1];
156
159
 
157
- var sectionData = indexesToLayoutData(layout.sections, sectionIndexes);
160
+ var sectionData = R.pipe(indexesToLayoutData, R.filter(R.prop('value')))(layout.sections, sectionIndexes);
158
161
 
159
162
  var rowsData = getRowsData(rows, layout.rows);
160
163
 
161
164
  return [sectionData, rowsData];
162
165
  }, sections);
163
-
164
166
  return (0, _extends3.default)({ headerData: headerData, sectionsData: sectionsData }, rest);
165
167
  };
166
168
  exports.getLayoutData = getLayoutData;
@@ -146,15 +146,13 @@ var dataTransformer = exports.dataTransformer = function dataTransformer(dataNew
146
146
 
147
147
  var getDimObservations = R.propOr([], 'observation');
148
148
  var dimObservations = getDimObservations(dimensions);
149
- var timePeriodDimension = (0, _dotstatsuiteSdmxjs.getTimePeriodObservation)(dimObservations);
150
- var timePeriodId = timePeriodDimension.id;
151
149
 
152
150
  var getObservations = function getObservations(locale) {
153
151
  return R.addIndex(R.reduce)(function (acc, observation, obsIndex) {
154
152
  var id = R.prop('id')(observation);
155
153
  var dimAnnotations = (0, _sdmxData.getRelationnalAnnotations)(R.propOr([], 'annotations')(observation))(annotations);
156
154
  var isHidden = R.has(id, hiddenIds) || (0, _sdmxData.getIsHidden)(dimAnnotations);
157
- var isTime = observation.id === timePeriodId;
155
+ var isTime = (0, _dotstatsuiteSdmxjs.isTimePeriodDimension)(observation);
158
156
  var values = getValuesEnhanced(locale, annotations, isTime, id)(R.propOr([], 'values', observation));
159
157
 
160
158
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sis-cc/dotstatsuite-components",
3
3
  "description": "Set components based on React.",
4
- "version": "14.2.5",
4
+ "version": "14.3.0",
5
5
  "main": "lib/index.js",
6
6
  "author": "OECD",
7
7
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  "peerDependencies": {
38
38
  "@material-ui/core": "^4.x",
39
39
  "@sis-cc/dotstatsuite-visions": "^7.x",
40
- "@sis-cc/dotstatsuite-sdmxjs": "^7.x",
40
+ "@sis-cc/dotstatsuite-sdmxjs": "^8.x",
41
41
  "react": "16.x"
42
42
  }
43
43
  }
@@ -37,6 +37,9 @@ const getRowData = (indexes, dimension) => {
37
37
  R.props(indexes),
38
38
  R.reduce(
39
39
  ({ data, missingParents }, _value) => {
40
+ if (R.isNil(_value)) {
41
+ return ({ data, missingParents: {} });
42
+ }
40
43
  const raw = {
41
44
  dimension: R.pick(['id', 'name', '__index'], dimension),
42
45
  value: _value,
@@ -151,11 +154,11 @@ const getRowsData = (rowsIndexes, dimensions) => {
151
154
 
152
155
  export const getLayoutData = (layoutIndexes, layout) => {
153
156
  const { header, sections, ...rest } = layoutIndexes;
154
- const headerData = R.map(i => indexesToLayoutData(layout.header, i), header);
157
+ const headerData = R.map(i => R.pipe(indexesToLayoutData, R.filter(R.prop('value')))(layout.header, i), header);
155
158
 
156
159
  const sectionsData = R.map(
157
160
  ([sectionIndexes, rows]) => {
158
- const sectionData = indexesToLayoutData(layout.sections, sectionIndexes);
161
+ const sectionData = R.pipe(indexesToLayoutData, R.filter(R.prop('value')))(layout.sections, sectionIndexes);
159
162
 
160
163
 
161
164
  const rowsData = getRowsData(rows, layout.rows);
@@ -164,6 +167,5 @@ export const getLayoutData = (layoutIndexes, layout) => {
164
167
  },
165
168
  sections
166
169
  );
167
-
168
170
  return ({ headerData, sectionsData, ...rest });
169
171
  };
@@ -1,6 +1,6 @@
1
1
  import * as R from 'ramda';
2
2
  import dateFns from 'date-fns';
3
- import { getCodeOrder, getRefinedName, getTimePeriodObservation } from '@sis-cc/dotstatsuite-sdmxjs';
3
+ import { getCodeOrder, getRefinedName, isTimePeriodDimension } from '@sis-cc/dotstatsuite-sdmxjs';
4
4
  import {
5
5
  getRelationnalAnnotations, setAnnotationsLayout, getIsHidden } from './sdmx-data';
6
6
  import { getReportedTimePeriodLabel, getReportedTimePeriodNote, getReportedTimePeriod } from './date';
@@ -146,14 +146,12 @@ export const dataTransformer = (dataNew, options = {}) => {
146
146
 
147
147
  const getDimObservations = R.propOr([], 'observation');
148
148
  const dimObservations = getDimObservations(dimensions);
149
- const timePeriodDimension = getTimePeriodObservation(dimObservations);
150
- const timePeriodId = timePeriodDimension.id;
151
149
 
152
150
  const getObservations = locale => R.addIndex(R.reduce)((acc, observation, obsIndex) => {
153
151
  const id = R.prop('id')(observation);
154
152
  const dimAnnotations = getRelationnalAnnotations(R.propOr([],'annotations')(observation))(annotations)
155
153
  const isHidden = R.has(id, hiddenIds) || getIsHidden(dimAnnotations);
156
- const isTime = observation.id === timePeriodId;
154
+ const isTime = isTimePeriodDimension(observation);
157
155
  const values = getValuesEnhanced(locale, annotations, isTime, id)(R.propOr([],'values', observation));
158
156
 
159
157
  return ({