@dhis2/analytics 999.9.9-TE-alpha.1 → 999.9.9-TE-alpha.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.
@@ -23,23 +23,23 @@ const Message = _ref => {
23
23
  fromServerDate
24
24
  } = (0, _appRuntime.useTimeZoneConversion)();
25
25
  return /*#__PURE__*/_react.default.createElement("li", {
26
- className: _style.default.dynamic([["3500389795", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "container"
26
+ className: _style.default.dynamic([["4031345705", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "container"
27
27
  }, /*#__PURE__*/_react.default.createElement("div", {
28
- className: _style.default.dynamic([["3500389795", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "header"
28
+ className: _style.default.dynamic([["4031345705", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "header"
29
29
  }, /*#__PURE__*/_react.default.createElement(_ui.UserAvatar, {
30
30
  name: username,
31
31
  extrasmall: true
32
32
  }), username, /*#__PURE__*/_react.default.createElement("time", {
33
33
  dateTime: created,
34
- className: _style.default.dynamic([["3500389795", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]])
34
+ className: _style.default.dynamic([["4031345705", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]])
35
35
  }, (0, _moment.default)(fromServerDate(created)).format('lll'))), /*#__PURE__*/_react.default.createElement("div", {
36
- className: _style.default.dynamic([["3500389795", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "content"
36
+ className: _style.default.dynamic([["4031345705", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "content"
37
37
  }, /*#__PURE__*/_react.default.createElement(_d2UiRichText.Parser, null, text)), /*#__PURE__*/_react.default.createElement("div", {
38
- className: _style.default.dynamic([["3500389795", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "footer"
38
+ className: _style.default.dynamic([["4031345705", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "footer"
39
39
  }, children), /*#__PURE__*/_react.default.createElement(_style.default, {
40
- id: "3500389795",
40
+ id: "4031345705",
41
41
  dynamic: [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]
42
- }, [`.container.__jsx-style-dynamic-selector{padding:${_ui.spacers.dp8};background-color:${_ui.colors.grey100};border-radius:5px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:${_ui.spacers.dp8};}`, `.header.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:6px;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:13px;line-height:16px;color:${_ui.colors.grey900};}`, `.header.__jsx-style-dynamic-selector time.__jsx-style-dynamic-selector{font-size:12px;color:${_ui.colors.grey600};}`, `.content.__jsx-style-dynamic-selector{font-size:14px;line-height:19px;color:${_ui.colors.grey900};word-break:break-word;}`, ".content.__jsx-style-dynamic-selector p:first-child{margin:0;}", `.footer.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;gap:${_ui.spacers.dp8};}`]));
42
+ }, [`.container.__jsx-style-dynamic-selector{padding:${_ui.spacers.dp8};background-color:${_ui.colors.grey100};border-radius:5px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:${_ui.spacers.dp8};}`, `.header.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:6px;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:13px;line-height:16px;color:${_ui.colors.grey900};}`, `.header.__jsx-style-dynamic-selector time.__jsx-style-dynamic-selector{font-size:12px;color:${_ui.colors.grey600};}`, `.content.__jsx-style-dynamic-selector{font-size:14px;line-height:19px;color:${_ui.colors.grey900};word-break:break-word;white-space:pre-line;}`, ".content.__jsx-style-dynamic-selector p:first-child{margin:0;}", `.footer.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;gap:${_ui.spacers.dp8};}`]));
43
43
  };
44
44
  exports.Message = Message;
45
45
  Message.propTypes = {
@@ -6,5 +6,5 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.axisGetDimensionIds = void 0;
7
7
  var _axis = require("./axis.js");
8
8
  var _dimensionGetId = require("./dimensionGetId.js");
9
- const axisGetDimensionIds = axis => _axis.AXIS.isValid(axis) ? axis.map(dimension => (0, _dimensionGetId.dimensionGetId)(dimension)) : _axis.AXIS.defaultValue;
9
+ const axisGetDimensionIds = (axis, outputType) => _axis.AXIS.isValid(axis) ? axis.map(dimension => (0, _dimensionGetId.dimensionGetId)(dimension, outputType)) : _axis.AXIS.defaultValue;
10
10
  exports.axisGetDimensionIds = axisGetDimensionIds;
@@ -4,9 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.dimensionGetId = void 0;
7
+ var _utils = require("../../api/analytics/utils.js");
7
8
  var _dimension = require("./dimension.js");
8
- const dimensionGetId = dimension => {
9
- var _dimension$DIMENSION_;
10
- return (_dimension$DIMENSION_ = dimension[_dimension.DIMENSION_PROP_PROGRAM_STAGE.name]) !== null && _dimension$DIMENSION_ !== void 0 && _dimension$DIMENSION_.id ? `${dimension[_dimension.DIMENSION_PROP_PROGRAM_STAGE.name].id}.${dimension[_dimension.DIMENSION_PROP_ID.name]}` : dimension[_dimension.DIMENSION_PROP_ID.name];
9
+ const dimensionGetId = (dimension, outputType) => {
10
+ var _dimension$DIMENSION_, _dimension$DIMENSION_2;
11
+ return (0, _utils.formatDimension)({
12
+ dimension: dimension[_dimension.DIMENSION_PROP_ID.name],
13
+ programId: (_dimension$DIMENSION_ = dimension[_dimension.DIMENSION_PROP_PROGRAM.name]) === null || _dimension$DIMENSION_ === void 0 ? void 0 : _dimension$DIMENSION_.id,
14
+ programStageId: (_dimension$DIMENSION_2 = dimension[_dimension.DIMENSION_PROP_PROGRAM_STAGE.name]) === null || _dimension$DIMENSION_2 === void 0 ? void 0 : _dimension$DIMENSION_2.id,
15
+ outputType
16
+ });
11
17
  };
12
18
  exports.dimensionGetId = dimensionGetId;
@@ -11,7 +11,7 @@ const layoutFilterDimensions = (layout, dimensionIds) => {
11
11
  const filteredLayout = Object.assign({}, layout);
12
12
  _axis.DEFAULT_AXIS_IDS.forEach(axisId => {
13
13
  if (_axis.AXIS.isValid(filteredLayout[axisId])) {
14
- filteredLayout[axisId] = filteredLayout[axisId].filter(dimension => !idArray.includes((0, _dimensionGetId.dimensionGetId)(dimension)));
14
+ filteredLayout[axisId] = filteredLayout[axisId].filter(dimension => !idArray.includes((0, _dimensionGetId.dimensionGetId)(dimension, layout.outputType)));
15
15
  }
16
16
  });
17
17
  return filteredLayout;
@@ -8,7 +8,7 @@ var _axis = require("./axis.js");
8
8
  var _axisGetDimensionIds = require("./axisGetDimensionIds.js");
9
9
  const layoutGetAxisIdDimensionIdsObject = layout => _axis.DEFAULT_AXIS_IDS.reduce((obj, axisId) => {
10
10
  if (_axis.AXIS.isValid(layout[axisId])) {
11
- obj[axisId] = (0, _axisGetDimensionIds.axisGetDimensionIds)(layout[axisId]);
11
+ obj[axisId] = (0, _axisGetDimensionIds.axisGetDimensionIds)(layout[axisId], layout.outputType);
12
12
  }
13
13
  return obj;
14
14
  }, {});
@@ -8,7 +8,7 @@ var _dimensionGetId = require("./dimensionGetId.js");
8
8
  var _dimensionGetItemIds = require("./dimensionGetItemIds.js");
9
9
  var _layoutGetAllDimensions = require("./layoutGetAllDimensions.js");
10
10
  const layoutGetDimensionIdItemIdsObject = layout => (0, _layoutGetAllDimensions.layoutGetAllDimensions)(layout).reduce((obj, dimension) => {
11
- obj[(0, _dimensionGetId.dimensionGetId)(dimension)] = (0, _dimensionGetItemIds.dimensionGetItemIds)(dimension);
11
+ obj[(0, _dimensionGetId.dimensionGetId)(dimension, layout.outputType)] = (0, _dimensionGetItemIds.dimensionGetItemIds)(dimension);
12
12
  return obj;
13
13
  }, {});
14
14
  exports.layoutGetDimensionIdItemIdsObject = layoutGetDimensionIdItemIdsObject;
@@ -9,6 +9,6 @@ var _dimensionGetId = require("./dimensionGetId.js");
9
9
  var _layoutGetAllDimensions = require("./layoutGetAllDimensions.js");
10
10
  const layoutHasDynamicDimension = layout => {
11
11
  const fixedIds = Object.keys((0, _predefinedDimensions.getPredefinedDimensions)());
12
- return Boolean((0, _layoutGetAllDimensions.layoutGetAllDimensions)(layout).find(dimension => !fixedIds.includes((0, _dimensionGetId.dimensionGetId)(dimension))));
12
+ return Boolean((0, _layoutGetAllDimensions.layoutGetAllDimensions)(layout).find(dimension => !fixedIds.includes((0, _dimensionGetId.dimensionGetId)(dimension, layout.outputType))));
13
13
  };
14
14
  exports.layoutHasDynamicDimension = layoutHasDynamicDimension;
@@ -16,23 +16,23 @@ const Message = _ref => {
16
16
  fromServerDate
17
17
  } = useTimeZoneConversion();
18
18
  return /*#__PURE__*/React.createElement("li", {
19
- className: _JSXStyle.dynamic([["3500389795", [spacers.dp8, colors.grey100, spacers.dp8, colors.grey900, colors.grey600, colors.grey900, spacers.dp8]]]) + " " + "container"
19
+ className: _JSXStyle.dynamic([["4031345705", [spacers.dp8, colors.grey100, spacers.dp8, colors.grey900, colors.grey600, colors.grey900, spacers.dp8]]]) + " " + "container"
20
20
  }, /*#__PURE__*/React.createElement("div", {
21
- className: _JSXStyle.dynamic([["3500389795", [spacers.dp8, colors.grey100, spacers.dp8, colors.grey900, colors.grey600, colors.grey900, spacers.dp8]]]) + " " + "header"
21
+ className: _JSXStyle.dynamic([["4031345705", [spacers.dp8, colors.grey100, spacers.dp8, colors.grey900, colors.grey600, colors.grey900, spacers.dp8]]]) + " " + "header"
22
22
  }, /*#__PURE__*/React.createElement(UserAvatar, {
23
23
  name: username,
24
24
  extrasmall: true
25
25
  }), username, /*#__PURE__*/React.createElement("time", {
26
26
  dateTime: created,
27
- className: _JSXStyle.dynamic([["3500389795", [spacers.dp8, colors.grey100, spacers.dp8, colors.grey900, colors.grey600, colors.grey900, spacers.dp8]]])
27
+ className: _JSXStyle.dynamic([["4031345705", [spacers.dp8, colors.grey100, spacers.dp8, colors.grey900, colors.grey600, colors.grey900, spacers.dp8]]])
28
28
  }, moment(fromServerDate(created)).format('lll'))), /*#__PURE__*/React.createElement("div", {
29
- className: _JSXStyle.dynamic([["3500389795", [spacers.dp8, colors.grey100, spacers.dp8, colors.grey900, colors.grey600, colors.grey900, spacers.dp8]]]) + " " + "content"
29
+ className: _JSXStyle.dynamic([["4031345705", [spacers.dp8, colors.grey100, spacers.dp8, colors.grey900, colors.grey600, colors.grey900, spacers.dp8]]]) + " " + "content"
30
30
  }, /*#__PURE__*/React.createElement(RichTextParser, null, text)), /*#__PURE__*/React.createElement("div", {
31
- className: _JSXStyle.dynamic([["3500389795", [spacers.dp8, colors.grey100, spacers.dp8, colors.grey900, colors.grey600, colors.grey900, spacers.dp8]]]) + " " + "footer"
31
+ className: _JSXStyle.dynamic([["4031345705", [spacers.dp8, colors.grey100, spacers.dp8, colors.grey900, colors.grey600, colors.grey900, spacers.dp8]]]) + " " + "footer"
32
32
  }, children), /*#__PURE__*/React.createElement(_JSXStyle, {
33
- id: "3500389795",
33
+ id: "4031345705",
34
34
  dynamic: [spacers.dp8, colors.grey100, spacers.dp8, colors.grey900, colors.grey600, colors.grey900, spacers.dp8]
35
- }, [`.container.__jsx-style-dynamic-selector{padding:${spacers.dp8};background-color:${colors.grey100};border-radius:5px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:${spacers.dp8};}`, `.header.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:6px;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:13px;line-height:16px;color:${colors.grey900};}`, `.header.__jsx-style-dynamic-selector time.__jsx-style-dynamic-selector{font-size:12px;color:${colors.grey600};}`, `.content.__jsx-style-dynamic-selector{font-size:14px;line-height:19px;color:${colors.grey900};word-break:break-word;}`, ".content.__jsx-style-dynamic-selector p:first-child{margin:0;}", `.footer.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;gap:${spacers.dp8};}`]));
35
+ }, [`.container.__jsx-style-dynamic-selector{padding:${spacers.dp8};background-color:${colors.grey100};border-radius:5px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:${spacers.dp8};}`, `.header.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:6px;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:13px;line-height:16px;color:${colors.grey900};}`, `.header.__jsx-style-dynamic-selector time.__jsx-style-dynamic-selector{font-size:12px;color:${colors.grey600};}`, `.content.__jsx-style-dynamic-selector{font-size:14px;line-height:19px;color:${colors.grey900};word-break:break-word;white-space:pre-line;}`, ".content.__jsx-style-dynamic-selector p:first-child{margin:0;}", `.footer.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;gap:${spacers.dp8};}`]));
36
36
  };
37
37
  Message.propTypes = {
38
38
  children: PropTypes.node.isRequired,
@@ -1,3 +1,3 @@
1
1
  import { AXIS } from './axis.js';
2
2
  import { dimensionGetId } from './dimensionGetId.js';
3
- export const axisGetDimensionIds = axis => AXIS.isValid(axis) ? axis.map(dimension => dimensionGetId(dimension)) : AXIS.defaultValue;
3
+ export const axisGetDimensionIds = (axis, outputType) => AXIS.isValid(axis) ? axis.map(dimension => dimensionGetId(dimension, outputType)) : AXIS.defaultValue;
@@ -1,5 +1,11 @@
1
- import { DIMENSION_PROP_ID, DIMENSION_PROP_PROGRAM_STAGE } from './dimension.js';
2
- export const dimensionGetId = dimension => {
3
- var _dimension$DIMENSION_;
4
- return (_dimension$DIMENSION_ = dimension[DIMENSION_PROP_PROGRAM_STAGE.name]) !== null && _dimension$DIMENSION_ !== void 0 && _dimension$DIMENSION_.id ? `${dimension[DIMENSION_PROP_PROGRAM_STAGE.name].id}.${dimension[DIMENSION_PROP_ID.name]}` : dimension[DIMENSION_PROP_ID.name];
1
+ import { formatDimension } from '../../api/analytics/utils.js';
2
+ import { DIMENSION_PROP_ID, DIMENSION_PROP_PROGRAM_STAGE, DIMENSION_PROP_PROGRAM } from './dimension.js';
3
+ export const dimensionGetId = (dimension, outputType) => {
4
+ var _dimension$DIMENSION_, _dimension$DIMENSION_2;
5
+ return formatDimension({
6
+ dimension: dimension[DIMENSION_PROP_ID.name],
7
+ programId: (_dimension$DIMENSION_ = dimension[DIMENSION_PROP_PROGRAM.name]) === null || _dimension$DIMENSION_ === void 0 ? void 0 : _dimension$DIMENSION_.id,
8
+ programStageId: (_dimension$DIMENSION_2 = dimension[DIMENSION_PROP_PROGRAM_STAGE.name]) === null || _dimension$DIMENSION_2 === void 0 ? void 0 : _dimension$DIMENSION_2.id,
9
+ outputType
10
+ });
5
11
  };
@@ -5,7 +5,7 @@ export const layoutFilterDimensions = (layout, dimensionIds) => {
5
5
  const filteredLayout = Object.assign({}, layout);
6
6
  DEFAULT_AXIS_IDS.forEach(axisId => {
7
7
  if (AXIS.isValid(filteredLayout[axisId])) {
8
- filteredLayout[axisId] = filteredLayout[axisId].filter(dimension => !idArray.includes(dimensionGetId(dimension)));
8
+ filteredLayout[axisId] = filteredLayout[axisId].filter(dimension => !idArray.includes(dimensionGetId(dimension, layout.outputType)));
9
9
  }
10
10
  });
11
11
  return filteredLayout;
@@ -2,7 +2,7 @@ import { AXIS, DEFAULT_AXIS_IDS } from './axis.js';
2
2
  import { axisGetDimensionIds } from './axisGetDimensionIds.js';
3
3
  export const layoutGetAxisIdDimensionIdsObject = layout => DEFAULT_AXIS_IDS.reduce((obj, axisId) => {
4
4
  if (AXIS.isValid(layout[axisId])) {
5
- obj[axisId] = axisGetDimensionIds(layout[axisId]);
5
+ obj[axisId] = axisGetDimensionIds(layout[axisId], layout.outputType);
6
6
  }
7
7
  return obj;
8
8
  }, {});
@@ -2,6 +2,6 @@ import { dimensionGetId } from './dimensionGetId.js';
2
2
  import { dimensionGetItemIds } from './dimensionGetItemIds.js';
3
3
  import { layoutGetAllDimensions } from './layoutGetAllDimensions.js';
4
4
  export const layoutGetDimensionIdItemIdsObject = layout => layoutGetAllDimensions(layout).reduce((obj, dimension) => {
5
- obj[dimensionGetId(dimension)] = dimensionGetItemIds(dimension);
5
+ obj[dimensionGetId(dimension, layout.outputType)] = dimensionGetItemIds(dimension);
6
6
  return obj;
7
7
  }, {});
@@ -3,5 +3,5 @@ import { dimensionGetId } from './dimensionGetId.js';
3
3
  import { layoutGetAllDimensions } from './layoutGetAllDimensions.js';
4
4
  export const layoutHasDynamicDimension = layout => {
5
5
  const fixedIds = Object.keys(getPredefinedDimensions());
6
- return Boolean(layoutGetAllDimensions(layout).find(dimension => !fixedIds.includes(dimensionGetId(dimension))));
6
+ return Boolean(layoutGetAllDimensions(layout).find(dimension => !fixedIds.includes(dimensionGetId(dimension, layout.outputType))));
7
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhis2/analytics",
3
- "version": "999.9.9-TE-alpha.1",
3
+ "version": "999.9.9-TE-alpha.3",
4
4
  "main": "./build/cjs/index.js",
5
5
  "module": "./build/es/index.js",
6
6
  "exports": {