@dhis2/analytics 20.6.3 → 21.0.0-alpha.2

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.
Files changed (214) hide show
  1. package/build/cjs/__demo__/Filter.stories.js +2 -2
  2. package/build/cjs/__demo__/FixedPeriodSelect.stories.js +2 -2
  3. package/build/cjs/__demo__/OpenFileDialog.stories.js +1 -1
  4. package/build/cjs/__demo__/OrgUnitDimension.stories.js +95 -0
  5. package/build/cjs/__demo__/PivotTable.stories.js +2 -2
  6. package/build/cjs/api/analytics/AnalyticsBase.js +1 -1
  7. package/build/cjs/api/analytics/AnalyticsRequest.js +1 -1
  8. package/build/cjs/api/analytics/AnalyticsRequestBase.js +3 -3
  9. package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +7 -7
  10. package/build/cjs/api/analytics/AnalyticsResponse.js +2 -2
  11. package/build/cjs/api/analytics/__tests__/AnalyticsAggregate.spec.js +11 -1
  12. package/build/cjs/api/analytics/__tests__/AnalyticsRequest.spec.js +9 -9
  13. package/build/cjs/api/analytics/__tests__/AnalyticsRequestBase.spec.js +4 -4
  14. package/build/cjs/api/analytics/utils.js +1 -1
  15. package/build/cjs/api/dimensions.js +37 -37
  16. package/build/cjs/api/organisationUnits.js +100 -46
  17. package/build/cjs/components/DataDimension/DataTypesSelector.js +3 -3
  18. package/build/cjs/components/DataDimension/DetailSelector.js +2 -2
  19. package/build/cjs/components/DataDimension/GroupSelector.js +9 -9
  20. package/build/cjs/components/DataDimension/ItemSelector.js +19 -19
  21. package/build/cjs/components/DataDimension/MetricSelector.js +3 -3
  22. package/build/cjs/components/DataDimension/styles/DataTypesSelector.style.js +1 -1
  23. package/build/cjs/components/DataDimension/styles/DetailSelector.style.js +1 -1
  24. package/build/cjs/components/DataDimension/styles/GroupSelector.style.js +1 -1
  25. package/build/cjs/components/DataDimension/styles/MetricSelector.style.js +1 -1
  26. package/build/cjs/components/DimensionMenu.js +10 -10
  27. package/build/cjs/components/DimensionsPanel/DimensionsPanel.js +2 -2
  28. package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +5 -5
  29. package/build/cjs/components/DimensionsPanel/List/DimensionLabel.js +2 -2
  30. package/build/cjs/components/DimensionsPanel/List/DimensionList.js +10 -10
  31. package/build/cjs/components/DimensionsPanel/List/styles/DimensionList.style.js +1 -1
  32. package/build/cjs/components/DimensionsPanel/styles/DimensionsPanel.style.js +1 -1
  33. package/build/cjs/components/DynamicDimension/DynamicDimension.js +4 -4
  34. package/build/cjs/components/DynamicDimension/ItemSelector.js +8 -8
  35. package/build/cjs/components/DynamicDimension/styles/DynamicDimension.style.js +1 -1
  36. package/build/cjs/components/FileMenu/DeleteDialog.js +4 -4
  37. package/build/cjs/components/FileMenu/FileMenu.js +7 -7
  38. package/build/cjs/components/FileMenu/FileMenu.styles.js +1 -1
  39. package/build/cjs/components/FileMenu/GetLinkDialog.js +3 -3
  40. package/build/cjs/components/FileMenu/RenameDialog.js +4 -4
  41. package/build/cjs/components/FileMenu/SaveAsDialog.js +4 -4
  42. package/build/cjs/components/FileMenu/__tests__/DeleteDialog.spec.js +1 -1
  43. package/build/cjs/components/FileMenu/__tests__/RenameDialog.spec.js +1 -1
  44. package/build/cjs/components/FileMenu/__tests__/SaveAsDialog.spec.js +1 -1
  45. package/build/cjs/components/FileMenu/utils.js +3 -3
  46. package/build/cjs/components/Filter/Filter.js +1 -1
  47. package/build/cjs/components/Filter/styles/Filter.style.js +1 -1
  48. package/build/cjs/components/LegendKey/LegendKey.js +9 -9
  49. package/build/cjs/components/LegendKey/styles/LegendKey.style.js +1 -1
  50. package/build/cjs/components/OpenFileDialog/CustomSelectOption.js +2 -2
  51. package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +21 -21
  52. package/build/cjs/components/OpenFileDialog/OpenFileDialog.styles.js +1 -1
  53. package/build/cjs/components/OpenFileDialog/styles/CustomSelectOption.style.js +1 -1
  54. package/build/cjs/components/Options/VisualizationOptions.js +2 -2
  55. package/build/cjs/components/Options/styles/VisualizationOptions.style.js +10 -10
  56. package/build/cjs/components/OrgUnitDimension/OrgUnitDimension.js +168 -203
  57. package/build/cjs/components/OrgUnitDimension/OrgUnitDimensionOld.js +244 -0
  58. package/build/cjs/components/OrgUnitDimension/styles/OrgUnitDimension.style.js +5 -2
  59. package/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +5 -5
  60. package/build/cjs/components/PeriodDimension/FixedPeriodSelect.js +6 -6
  61. package/build/cjs/components/PeriodDimension/PeriodTransfer.js +11 -11
  62. package/build/cjs/components/PeriodDimension/RelativePeriodFilter.js +2 -2
  63. package/build/cjs/components/PeriodDimension/styles/FixedPeriodSelect.style.js +1 -1
  64. package/build/cjs/components/PeriodDimension/styles/PeriodFilter.style.js +1 -1
  65. package/build/cjs/components/PeriodDimension/utils/fixedPeriods.js +49 -49
  66. package/build/cjs/components/PivotTable/PivotTable.js +2 -2
  67. package/build/cjs/components/PivotTable/PivotTableCell.js +3 -3
  68. package/build/cjs/components/PivotTable/PivotTableColumnHeaderCell.js +2 -2
  69. package/build/cjs/components/PivotTable/PivotTableContainer.js +2 -2
  70. package/build/cjs/components/PivotTable/PivotTableEngineContext.js +2 -2
  71. package/build/cjs/components/PivotTable/PivotTableSortIcon.js +2 -2
  72. package/build/cjs/components/PivotTable/PivotTableTitleRow.js +4 -4
  73. package/build/cjs/components/PivotTable/PivotTableValueCell.js +2 -2
  74. package/build/cjs/components/PivotTable/styles/PivotTable.style.js +3 -3
  75. package/build/cjs/components/TransferOption.js +7 -7
  76. package/build/cjs/components/styles/DimensionSelector.style.js +1 -1
  77. package/build/cjs/components/styles/TransferOption.style.js +1 -1
  78. package/build/cjs/index.js +6 -6
  79. package/build/cjs/locales/en/translations.json +5 -0
  80. package/build/cjs/locales/ru/translations.json +1 -1
  81. package/build/cjs/locales/zh/translations.json +7 -7
  82. package/build/cjs/modules/axis.js +1 -1
  83. package/build/cjs/modules/layoutUiRules/rules.js +1 -1
  84. package/build/cjs/modules/ouIdHelper/index.js +9 -3
  85. package/build/cjs/modules/pivotTable/PivotTableEngine.js +3 -3
  86. package/build/cjs/modules/pivotTable/measureText.js +1 -1
  87. package/build/cjs/modules/relativeItems/index.js +1 -1
  88. package/build/cjs/modules/visTypes.js +1 -1
  89. package/build/cjs/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +1 -1
  90. package/build/cjs/visualizations/config/adapters/dhis_highcharts/axis.js +2 -2
  91. package/build/cjs/visualizations/config/adapters/dhis_highcharts/getAxisTitle.js +1 -1
  92. package/build/cjs/visualizations/config/adapters/dhis_highcharts/index.js +2 -2
  93. package/build/cjs/visualizations/config/adapters/dhis_highcharts/legend.js +19 -8
  94. package/build/cjs/visualizations/config/adapters/dhis_highcharts/legendSet.js +1 -1
  95. package/build/cjs/visualizations/config/adapters/dhis_highcharts/plotOptions.js +1 -1
  96. package/build/cjs/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +1 -1
  97. package/build/cjs/visualizations/config/adapters/dhis_highcharts/title/index.js +1 -1
  98. package/build/cjs/visualizations/config/adapters/dhis_highcharts/title/scatter.js +1 -1
  99. package/build/cjs/visualizations/config/adapters/dhis_highcharts/xAxis/index.js +1 -1
  100. package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +3 -3
  101. package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/index.js +2 -2
  102. package/build/cjs/visualizations/config/generators/dhis/singleValue.js +5 -5
  103. package/build/cjs/visualizations/config/index.js +3 -3
  104. package/build/cjs/visualizations/store/adapters/dhis_dhis/index.js +1 -1
  105. package/build/cjs/visualizations/store/adapters/dhis_highcharts/index.js +1 -1
  106. package/build/cjs/visualizations/store/adapters/dhis_highcharts/twoCategory.js +1 -1
  107. package/build/cjs/visualizations/store/index.js +2 -2
  108. package/build/cjs/visualizations/util/axisId.js +1 -1
  109. package/build/cjs/visualizations/util/getFilterText.js +3 -3
  110. package/build/es/__demo__/OpenFileDialog.stories.js +1 -1
  111. package/build/es/__demo__/OrgUnitDimension.stories.js +84 -0
  112. package/build/es/api/analytics/AnalyticsBase.js +1 -1
  113. package/build/es/api/analytics/AnalyticsRequest.js +1 -1
  114. package/build/es/api/analytics/AnalyticsRequestBase.js +3 -3
  115. package/build/es/api/analytics/AnalyticsRequestPropertiesMixin.js +7 -7
  116. package/build/es/api/analytics/AnalyticsResponse.js +2 -2
  117. package/build/es/api/analytics/__tests__/AnalyticsAggregate.spec.js +11 -1
  118. package/build/es/api/analytics/__tests__/AnalyticsRequest.spec.js +9 -9
  119. package/build/es/api/analytics/__tests__/AnalyticsRequestBase.spec.js +4 -4
  120. package/build/es/api/analytics/utils.js +1 -1
  121. package/build/es/api/dimensions.js +39 -39
  122. package/build/es/api/organisationUnits.js +93 -43
  123. package/build/es/components/DataDimension/DataTypesSelector.js +3 -3
  124. package/build/es/components/DataDimension/DetailSelector.js +2 -2
  125. package/build/es/components/DataDimension/GroupSelector.js +7 -7
  126. package/build/es/components/DataDimension/ItemSelector.js +17 -17
  127. package/build/es/components/DataDimension/MetricSelector.js +3 -3
  128. package/build/es/components/DataDimension/styles/DataTypesSelector.style.js +1 -1
  129. package/build/es/components/DataDimension/styles/DetailSelector.style.js +1 -1
  130. package/build/es/components/DataDimension/styles/GroupSelector.style.js +1 -1
  131. package/build/es/components/DataDimension/styles/MetricSelector.style.js +1 -1
  132. package/build/es/components/DimensionMenu.js +10 -10
  133. package/build/es/components/DimensionsPanel/List/DimensionItem.js +3 -3
  134. package/build/es/components/DimensionsPanel/List/DimensionList.js +8 -8
  135. package/build/es/components/DimensionsPanel/List/styles/DimensionList.style.js +1 -1
  136. package/build/es/components/DimensionsPanel/styles/DimensionsPanel.style.js +1 -1
  137. package/build/es/components/DynamicDimension/DynamicDimension.js +4 -4
  138. package/build/es/components/DynamicDimension/ItemSelector.js +6 -6
  139. package/build/es/components/DynamicDimension/styles/DynamicDimension.style.js +1 -1
  140. package/build/es/components/FileMenu/DeleteDialog.js +1 -1
  141. package/build/es/components/FileMenu/FileMenu.js +4 -4
  142. package/build/es/components/FileMenu/FileMenu.styles.js +1 -1
  143. package/build/es/components/FileMenu/GetLinkDialog.js +2 -2
  144. package/build/es/components/FileMenu/RenameDialog.js +1 -1
  145. package/build/es/components/FileMenu/SaveAsDialog.js +1 -1
  146. package/build/es/components/FileMenu/__tests__/DeleteDialog.spec.js +1 -1
  147. package/build/es/components/FileMenu/__tests__/RenameDialog.spec.js +1 -1
  148. package/build/es/components/FileMenu/__tests__/SaveAsDialog.spec.js +1 -1
  149. package/build/es/components/FileMenu/utils.js +3 -3
  150. package/build/es/components/Filter/Filter.js +1 -1
  151. package/build/es/components/Filter/styles/Filter.style.js +1 -1
  152. package/build/es/components/LegendKey/LegendKey.js +9 -9
  153. package/build/es/components/LegendKey/styles/LegendKey.style.js +1 -1
  154. package/build/es/components/OpenFileDialog/CustomSelectOption.js +2 -2
  155. package/build/es/components/OpenFileDialog/OpenFileDialog.js +19 -19
  156. package/build/es/components/OpenFileDialog/OpenFileDialog.styles.js +1 -1
  157. package/build/es/components/OpenFileDialog/styles/CustomSelectOption.style.js +1 -1
  158. package/build/es/components/Options/styles/VisualizationOptions.style.js +10 -10
  159. package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +168 -204
  160. package/build/es/components/OrgUnitDimension/OrgUnitDimensionOld.js +220 -0
  161. package/build/es/components/OrgUnitDimension/styles/OrgUnitDimension.style.js +3 -2
  162. package/build/es/components/PeriodDimension/FixedPeriodFilter.js +5 -5
  163. package/build/es/components/PeriodDimension/FixedPeriodSelect.js +3 -3
  164. package/build/es/components/PeriodDimension/PeriodTransfer.js +9 -9
  165. package/build/es/components/PeriodDimension/RelativePeriodFilter.js +2 -2
  166. package/build/es/components/PeriodDimension/styles/FixedPeriodSelect.style.js +1 -1
  167. package/build/es/components/PeriodDimension/styles/PeriodFilter.style.js +1 -1
  168. package/build/es/components/PeriodDimension/utils/fixedPeriods.js +49 -49
  169. package/build/es/components/PivotTable/PivotTableCell.js +3 -3
  170. package/build/es/components/PivotTable/PivotTableColumnHeaderCell.js +2 -2
  171. package/build/es/components/PivotTable/PivotTableContainer.js +2 -2
  172. package/build/es/components/PivotTable/PivotTableSortIcon.js +2 -2
  173. package/build/es/components/PivotTable/PivotTableTitleRow.js +2 -2
  174. package/build/es/components/PivotTable/styles/PivotTable.style.js +3 -3
  175. package/build/es/components/TransferOption.js +6 -6
  176. package/build/es/components/styles/DimensionSelector.style.js +1 -1
  177. package/build/es/components/styles/TransferOption.style.js +1 -1
  178. package/build/es/index.js +1 -1
  179. package/build/es/locales/en/translations.json +5 -0
  180. package/build/es/locales/ru/translations.json +1 -1
  181. package/build/es/locales/zh/translations.json +7 -7
  182. package/build/es/modules/axis.js +1 -1
  183. package/build/es/modules/layoutUiRules/rules.js +1 -1
  184. package/build/es/modules/ouIdHelper/index.js +5 -2
  185. package/build/es/modules/pivotTable/PivotTableEngine.js +3 -3
  186. package/build/es/modules/pivotTable/measureText.js +1 -1
  187. package/build/es/modules/relativeItems/index.js +2 -2
  188. package/build/es/modules/visTypes.js +1 -1
  189. package/build/es/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +1 -1
  190. package/build/es/visualizations/config/adapters/dhis_highcharts/axis.js +2 -2
  191. package/build/es/visualizations/config/adapters/dhis_highcharts/getAxisTitle.js +1 -1
  192. package/build/es/visualizations/config/adapters/dhis_highcharts/legend.js +19 -8
  193. package/build/es/visualizations/config/adapters/dhis_highcharts/legendSet.js +1 -1
  194. package/build/es/visualizations/config/adapters/dhis_highcharts/plotOptions.js +1 -1
  195. package/build/es/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +1 -1
  196. package/build/es/visualizations/config/adapters/dhis_highcharts/title/index.js +1 -1
  197. package/build/es/visualizations/config/adapters/dhis_highcharts/title/scatter.js +1 -1
  198. package/build/es/visualizations/config/adapters/dhis_highcharts/xAxis/index.js +1 -1
  199. package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +3 -3
  200. package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/index.js +2 -2
  201. package/build/es/visualizations/config/generators/dhis/singleValue.js +5 -5
  202. package/build/es/visualizations/config/index.js +3 -3
  203. package/build/es/visualizations/store/adapters/dhis_dhis/index.js +1 -1
  204. package/build/es/visualizations/store/adapters/dhis_highcharts/index.js +1 -1
  205. package/build/es/visualizations/store/adapters/dhis_highcharts/twoCategory.js +1 -1
  206. package/build/es/visualizations/store/index.js +2 -2
  207. package/build/es/visualizations/util/axisId.js +1 -1
  208. package/build/es/visualizations/util/getFilterText.js +3 -3
  209. package/package.json +2 -1
  210. package/CHANGELOG.md +0 -2742
  211. package/build/cjs/api/organisationUnits-dataEngine.js +0 -119
  212. package/build/cjs/components/OrgUnitDimension/__tests__/OrgUnitDimension.spec.js +0 -96
  213. package/build/es/api/organisationUnits-dataEngine.js +0 -96
  214. package/build/es/components/OrgUnitDimension/__tests__/OrgUnitDimension.spec.js +0 -86
@@ -18,12 +18,12 @@ export const PivotTableCell = /*#__PURE__*/React.forwardRef(({
18
18
  const engine = usePivotTableEngine();
19
19
  style.width = style.minWidth = style.maxWidth = style.width;
20
20
  style.height = style.minHeight = style.maxHeight = style.height || engine.fontSize + engine.cellPadding * 2 + 2;
21
- const className = classnames(classes, "fontsize-".concat(engine.visualization.fontSize), "displaydensity-".concat(engine.visualization.displayDensity));
21
+ const className = classnames(classes, `fontsize-${engine.visualization.fontSize}`, `displaydensity-${engine.visualization.displayDensity}`);
22
22
  return isHeader ? /*#__PURE__*/React.createElement("th", _extends({
23
23
  style: style,
24
24
  "data-test": dataTest
25
25
  }, props, {
26
- className: "jsx-".concat(cellStyle.__hash) + " " + (props && props.className != null && props.className || className || "")
26
+ className: `jsx-${cellStyle.__hash}` + " " + (props && props.className != null && props.className || className || "")
27
27
  }), /*#__PURE__*/React.createElement(_JSXStyle, {
28
28
  id: cellStyle.__hash
29
29
  }, cellStyle), children) : /*#__PURE__*/React.createElement("td", _extends({
@@ -31,7 +31,7 @@ export const PivotTableCell = /*#__PURE__*/React.forwardRef(({
31
31
  style: style,
32
32
  "data-test": dataTest
33
33
  }, props, {
34
- className: "jsx-".concat(cellStyle.__hash) + " " + (props && props.className != null && props.className || className || "")
34
+ className: `jsx-${cellStyle.__hash}` + " " + (props && props.className != null && props.className || className || "")
35
35
  }), /*#__PURE__*/React.createElement(_JSXStyle, {
36
36
  id: cellStyle.__hash
37
37
  }, cellStyle), children);
@@ -52,10 +52,10 @@ export const PivotTableColumnHeaderCell = ({
52
52
  }, /*#__PURE__*/React.createElement(_JSXStyle, {
53
53
  id: cellStyle.__hash
54
54
  }, cellStyle), /*#__PURE__*/React.createElement("div", {
55
- className: "jsx-".concat(cellStyle.__hash) + " " + "column-header-inner"
55
+ className: `jsx-${cellStyle.__hash}` + " " + "column-header-inner"
56
56
  }, /*#__PURE__*/React.createElement("span", {
57
57
  "data-test": "visualization-column-header",
58
- className: "jsx-".concat(cellStyle.__hash) + " " + "column-header-label"
58
+ className: `jsx-${cellStyle.__hash}` + " " + "column-header-label"
59
59
  }, header.label), isSortable ? /*#__PURE__*/React.createElement(PivotTableSortIcon, {
60
60
  index: index,
61
61
  sortBy: sortBy
@@ -17,11 +17,11 @@ export const PivotTableContainer = /*#__PURE__*/React.forwardRef(({
17
17
  },
18
18
  ref: ref,
19
19
  "data-test": "visualization-container",
20
- className: "jsx-".concat(tableStyle.__hash) + " " + "pivot-table-container"
20
+ className: `jsx-${tableStyle.__hash}` + " " + "pivot-table-container"
21
21
  }, /*#__PURE__*/React.createElement(_JSXStyle, {
22
22
  id: tableStyle.__hash
23
23
  }, tableStyle), width === 0 || height === 0 ? null : /*#__PURE__*/React.createElement("table", {
24
- className: "jsx-".concat(tableStyle.__hash) + " " + (classnames({
24
+ className: `jsx-${tableStyle.__hash}` + " " + (classnames({
25
25
  'fixed-headers': engine.options.fixColumnHeaders && engine.options.fixRowHeaders,
26
26
  'fixed-column-headers': engine.options.fixColumnHeaders && !engine.options.fixRowHeaders,
27
27
  'fixed-row-headers': engine.options.fixRowHeaders && !engine.options.fixColumnHeaders
@@ -14,11 +14,11 @@ export const PivotTableSortIcon = ({
14
14
  const engine = usePivotTableEngine();
15
15
  const SortIcon = (sortBy === null || sortBy === void 0 ? void 0 : sortBy.column) === index ? sortBy.order === SORT_ORDER_ASCENDING ? SortIconAscending : SortIconDescending : SortIconIdle;
16
16
  return /*#__PURE__*/React.createElement("span", {
17
- className: "jsx-".concat(sortIconStyle.__hash) + " " + "fontsize-".concat(engine.visualization.fontSize)
17
+ className: `jsx-${sortIconStyle.__hash}` + " " + `fontsize-${engine.visualization.fontSize}`
18
18
  }, /*#__PURE__*/React.createElement(_JSXStyle, {
19
19
  id: sortIconStyle.__hash
20
20
  }, sortIconStyle), /*#__PURE__*/React.createElement(SortIcon, {
21
- className: "jsx-".concat(sortIconStyle.__hash)
21
+ className: `jsx-${sortIconStyle.__hash}`
22
22
  }));
23
23
  };
24
24
  PivotTableSortIcon.propTypes = {
@@ -17,7 +17,7 @@ export const PivotTableTitleRow = ({
17
17
  setPosition(Math.max(0, Math.min(scrollPosition.x, totalWidth - containerWidth)));
18
18
  }, [containerWidth, scrollPosition.x, totalWidth]);
19
19
  return /*#__PURE__*/React.createElement("tr", {
20
- className: "jsx-".concat(cellStyle.__hash)
20
+ className: `jsx-${cellStyle.__hash}`
21
21
  }, /*#__PURE__*/React.createElement(_JSXStyle, {
22
22
  id: cellStyle.__hash
23
23
  }, cellStyle), /*#__PURE__*/React.createElement(PivotTableCell, {
@@ -31,7 +31,7 @@ export const PivotTableTitleRow = ({
31
31
  textAlign: 'center'
32
32
  },
33
33
  "data-test": "visualization-title",
34
- className: "jsx-".concat(cellStyle.__hash)
34
+ className: `jsx-${cellStyle.__hash}`
35
35
  }, title)));
36
36
  };
37
37
  PivotTableTitleRow.propTypes = {
@@ -1,8 +1,8 @@
1
1
  import { colors } from '@dhis2/ui';
2
2
  import { BORDER_COLOR, DISPLAY_DENSITY_PADDING_COMPACT, DISPLAY_DENSITY_PADDING_NORMAL, DISPLAY_DENSITY_PADDING_COMFORTABLE, FONT_SIZE_SMALL, FONT_SIZE_NORMAL, FONT_SIZE_LARGE } from '../../../modules/pivotTable/pivotTableConstants';
3
- export const table = ["div.pivot-table-container{font-family:'Roboto',Arial,sans-serif;overflow:auto;color:".concat(colors.grey900, ";}"), "table{border-spacing:0;white-space:nowrap;box-sizing:border-box;text-align:center;border:1px solid ".concat(BORDER_COLOR, ";border-width:1px 1px 0 0;}"), "table.fixed-headers{border-width:0 0 0 1px;}", "table.fixed-headers tr th,table.fixed-headers tr td{border-width:0 1px 1px 0;}", "table.fixed-column-headers{border-width:0 1px 0 0;}", "table.fixed-column-headers tr th,table.fixed-column-headers tr td{border-width:0 0 1px 1px;}", "table.fixed-headers thead tr:first-of-type th,table.fixed-column-headers thead tr:first-of-type th{border-top:1px solid ".concat(BORDER_COLOR, ";}"), "table.fixed-row-headers{border-width:0 0 1px 1px;}", "table.fixed-row-headers tr th,table.fixed-row-headers tr td{border-width:1px 1px 0 0;}"];
3
+ export const table = [`div.pivot-table-container{font-family:'Roboto',Arial,sans-serif;overflow:auto;color:${colors.grey900};}`, `table{border-spacing:0;white-space:nowrap;box-sizing:border-box;text-align:center;border:1px solid ${BORDER_COLOR};border-width:1px 1px 0 0;}`, "table.fixed-headers{border-width:0 0 0 1px;}", "table.fixed-headers tr th,table.fixed-headers tr td{border-width:0 1px 1px 0;}", "table.fixed-column-headers{border-width:0 1px 0 0;}", "table.fixed-column-headers tr th,table.fixed-column-headers tr td{border-width:0 0 1px 1px;}", `table.fixed-headers thead tr:first-of-type th,table.fixed-column-headers thead tr:first-of-type th{border-top:1px solid ${BORDER_COLOR};}`, "table.fixed-row-headers{border-width:0 0 1px 1px;}", "table.fixed-row-headers tr th,table.fixed-row-headers tr td{border-width:1px 1px 0 0;}"];
4
4
  table.__hash = "712241344";
5
- export const cell = ["td.jsx-1789008308,th.jsx-1789008308{box-sizing:border-box;font-weight:normal;overflow:hidden;text-overflow:ellipsis;border:1px solid ".concat(BORDER_COLOR, ";border-width:0 0 1px 1px;cursor:default;}"), "th.fixed-header.jsx-1789008308{position:-webkit-sticky;position:sticky;z-index:1;top:0;left:0;}", ".fontsize-SMALL.jsx-1789008308{font-size:".concat(FONT_SIZE_SMALL, "px;line-height:").concat(FONT_SIZE_SMALL, "px;}"), ".fontsize-NORMAL.jsx-1789008308{font-size:".concat(FONT_SIZE_NORMAL, "px;line-height:").concat(FONT_SIZE_NORMAL, "px;}"), ".fontsize-LARGE.jsx-1789008308{font-size:".concat(FONT_SIZE_LARGE, "px;line-height:").concat(FONT_SIZE_LARGE, "px;}"), ".displaydensity-COMPACT.jsx-1789008308{padding:".concat(DISPLAY_DENSITY_PADDING_COMPACT, "px;}"), ".displaydensity-NORMAL.jsx-1789008308{padding:".concat(DISPLAY_DENSITY_PADDING_NORMAL, "px;}"), ".displaydensity-COMFORTABLE.jsx-1789008308{padding:".concat(DISPLAY_DENSITY_PADDING_COMFORTABLE, "px;}"), ".column-header.jsx-1789008308{background-color:#dae6f8;}", "div.column-header-inner.jsx-1789008308{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}", ".title.jsx-1789008308{font-weight:bold;background-color:#cddaed;}", ".row-header.jsx-1789008308{background-color:#dae6f8;}", ".row-header-hierarchy.jsx-1789008308{text-align:left;}", ".empty-header.jsx-1789008308{background-color:#cddaed;}", ".total-header.jsx-1789008308{background-color:#bac6d8;}", ".value.jsx-1789008308{background-color:#ffffff;}", ".TEXT.jsx-1789008308{text-align:left;}", ".NUMBER.jsx-1789008308{text-align:right;}", ".clickable.jsx-1789008308{cursor:pointer;}", ".value.jsx-1789008308:hover{background-color:#f3f3f3;}", ".subtotal.jsx-1789008308{background-color:#f4f4f4;}", ".total.jsx-1789008308{background-color:#d8d8d8;}", ".column-header-label.jsx-1789008308{overflow:hidden;text-overflow:ellipsis;}"];
5
+ export const cell = [`td.jsx-1789008308,th.jsx-1789008308{box-sizing:border-box;font-weight:normal;overflow:hidden;text-overflow:ellipsis;border:1px solid ${BORDER_COLOR};border-width:0 0 1px 1px;cursor:default;}`, "th.fixed-header.jsx-1789008308{position:-webkit-sticky;position:sticky;z-index:1;top:0;left:0;}", `.fontsize-SMALL.jsx-1789008308{font-size:${FONT_SIZE_SMALL}px;line-height:${FONT_SIZE_SMALL}px;}`, `.fontsize-NORMAL.jsx-1789008308{font-size:${FONT_SIZE_NORMAL}px;line-height:${FONT_SIZE_NORMAL}px;}`, `.fontsize-LARGE.jsx-1789008308{font-size:${FONT_SIZE_LARGE}px;line-height:${FONT_SIZE_LARGE}px;}`, `.displaydensity-COMPACT.jsx-1789008308{padding:${DISPLAY_DENSITY_PADDING_COMPACT}px;}`, `.displaydensity-NORMAL.jsx-1789008308{padding:${DISPLAY_DENSITY_PADDING_NORMAL}px;}`, `.displaydensity-COMFORTABLE.jsx-1789008308{padding:${DISPLAY_DENSITY_PADDING_COMFORTABLE}px;}`, ".column-header.jsx-1789008308{background-color:#dae6f8;}", "div.column-header-inner.jsx-1789008308{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}", ".title.jsx-1789008308{font-weight:bold;background-color:#cddaed;}", ".row-header.jsx-1789008308{background-color:#dae6f8;}", ".row-header-hierarchy.jsx-1789008308{text-align:left;}", ".empty-header.jsx-1789008308{background-color:#cddaed;}", ".total-header.jsx-1789008308{background-color:#bac6d8;}", ".value.jsx-1789008308{background-color:#ffffff;}", ".TEXT.jsx-1789008308{text-align:left;}", ".NUMBER.jsx-1789008308{text-align:right;}", ".clickable.jsx-1789008308{cursor:pointer;}", ".value.jsx-1789008308:hover{background-color:#f3f3f3;}", ".subtotal.jsx-1789008308{background-color:#f4f4f4;}", ".total.jsx-1789008308{background-color:#d8d8d8;}", ".column-header-label.jsx-1789008308{overflow:hidden;text-overflow:ellipsis;}"];
6
6
  cell.__hash = "1789008308";
7
- export const sortIcon = [".fontsize-SMALL.jsx-2877616992{height:".concat(FONT_SIZE_SMALL, "px;margin-bottom:1px;margin-left:5px;}"), ".fontsize-NORMAL.jsx-2877616992{height:".concat(FONT_SIZE_NORMAL, "px;max-height:11px;margin-bottom:2px;margin-left:6px;}"), ".fontsize-LARGE.jsx-2877616992{height:".concat(FONT_SIZE_LARGE, "px;margin-bottom:2px;margin-left:7px;}")];
7
+ export const sortIcon = [`.fontsize-SMALL.jsx-2877616992{height:${FONT_SIZE_SMALL}px;margin-bottom:1px;margin-left:5px;}`, `.fontsize-NORMAL.jsx-2877616992{height:${FONT_SIZE_NORMAL}px;max-height:11px;margin-bottom:2px;margin-left:6px;}`, `.fontsize-LARGE.jsx-2877616992{height:${FONT_SIZE_LARGE}px;margin-bottom:2px;margin-left:7px;}`];
8
8
  sortIcon.__hash = "2877616992";
@@ -1,7 +1,7 @@
1
1
  import _JSXStyle from "styled-jsx/style";
2
- import propTypes from '@dhis2/prop-types';
3
2
  import { Tooltip } from '@dhis2/ui';
4
3
  import cx from 'classnames';
4
+ import propTypes from 'prop-types';
5
5
  import React from 'react';
6
6
  import styles from './styles/TransferOption.style';
7
7
  export const TransferOption = ({
@@ -32,17 +32,17 @@ export const TransferOption = ({
32
32
  value
33
33
  }, event);
34
34
  },
35
- "data-test": "".concat(dataTest, "-content"),
36
- className: "jsx-".concat(styles.__hash) + " " + (cx('chip', {
35
+ "data-test": `${dataTest}-content`,
36
+ className: `jsx-${styles.__hash}` + " " + (cx('chip', {
37
37
  highlighted,
38
38
  disabled,
39
39
  selected,
40
40
  inactive: active !== undefined && !active
41
41
  }) || "")
42
42
  }, /*#__PURE__*/React.createElement("span", {
43
- className: "jsx-".concat(styles.__hash) + " " + "icon"
43
+ className: `jsx-${styles.__hash}` + " " + "icon"
44
44
  }, icon), /*#__PURE__*/React.createElement("span", {
45
- className: "jsx-".concat(styles.__hash) + " " + "label"
45
+ className: `jsx-${styles.__hash}` + " " + "label"
46
46
  }, label), /*#__PURE__*/React.createElement(_JSXStyle, {
47
47
  id: styles.__hash
48
48
  }, styles));
@@ -52,7 +52,7 @@ export const TransferOption = ({
52
52
  "data-test": dataTest,
53
53
  className: "wrapper"
54
54
  }, tooltipText ? /*#__PURE__*/React.createElement(Tooltip, {
55
- key: "".concat(value),
55
+ key: `${value}`,
56
56
  content: tooltipText,
57
57
  placement: 'top',
58
58
  openDelay: 750,
@@ -1,4 +1,4 @@
1
1
  import { spacers, colors } from '@dhis2/ui';
2
- const _defaultExport = [".filterContainer.jsx-2057111968{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-bottom:".concat(spacers.dp12, ";margin-top:").concat(spacers.dp8, ";}"), ".emptyList.jsx-2057111968{text-align:center;font-size:14px;line-height:16px;margin:".concat(spacers.dp24, " 0 0;color:").concat(colors.grey700, ";}"), ".rightHeader.jsx-2057111968{font-size:14px;font-weight:400;}", ".leftHeader.jsx-2057111968{padding:".concat(spacers.dp12, " ").concat(spacers.dp4, ";}"), ".info-container.jsx-2057111968{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-bottom:".concat(spacers.dp8, ";padding:").concat(spacers.dp8, ";background-color:").concat(colors.grey200, ";border-radius:3px;}"), ".info-text.jsx-2057111968{padding-left:".concat(spacers.dp8, ";color:").concat(colors.grey900, ";font-size:12px;line-height:16px;}")];
2
+ const _defaultExport = [`.filterContainer.jsx-2057111968{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-bottom:${spacers.dp12};margin-top:${spacers.dp8};}`, `.emptyList.jsx-2057111968{text-align:center;font-size:14px;line-height:16px;margin:${spacers.dp24} 0 0;color:${colors.grey700};}`, ".rightHeader.jsx-2057111968{font-size:14px;font-weight:400;}", `.leftHeader.jsx-2057111968{padding:${spacers.dp12} ${spacers.dp4};}`, `.info-container.jsx-2057111968{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-bottom:${spacers.dp8};padding:${spacers.dp8};background-color:${colors.grey200};border-radius:3px;}`, `.info-text.jsx-2057111968{padding-left:${spacers.dp8};color:${colors.grey900};font-size:12px;line-height:16px;}`];
3
3
  _defaultExport.__hash = "2057111968";
4
4
  export default _defaultExport;
@@ -1,4 +1,4 @@
1
1
  import { colors, spacers, theme } from '@dhis2/ui';
2
- const _defaultExport = [".wrapper.jsx-3199850788:last-child{margin-bottom:".concat(spacers.dp4, ";}"), ".chip.jsx-3199850788{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;background:".concat(colors.grey200, ";font-size:14px;line-height:16px;padding:2px ").concat(spacers.dp8, " 2px ").concat(spacers.dp4, ";margin:").concat(spacers.dp4, " ").concat(spacers.dp8, " 0 ").concat(spacers.dp8, ";border-radius:3px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}"), ".chip.jsx-3199850788:hover{background:".concat(colors.grey300, ";}"), ".selected.jsx-3199850788{background:".concat(theme.secondary100, ";color:").concat(theme.secondary900, ";}"), ".selected.jsx-3199850788 .icon path{fill:".concat(theme.secondary700, ";}"), ".selected.jsx-3199850788:hover{background:#c9edeb;}", ".highlighted.jsx-3199850788,.highlighted.jsx-3199850788:hover{background:".concat(theme.secondary800, ";color:").concat(colors.white, ";}"), ".highlighted.jsx-3199850788 .icon path{fill:".concat(colors.white, ";}"), ".disabled.jsx-3199850788{opacity:0.3;cursor:not-allowed;}", ".inactive.jsx-3199850788{opacity:0.3;}", ".icon.jsx-3199850788,.label.jsx-3199850788{line-height:18px;}", ".icon.jsx-3199850788{margin-right:".concat(spacers.dp4, ";display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;vertical-align:text-bottom;padding-top:1px;}"), ".label.jsx-3199850788{font-size:14px;}"];
2
+ const _defaultExport = [`.wrapper.jsx-3199850788:last-child{margin-bottom:${spacers.dp4};}`, `.chip.jsx-3199850788{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;background:${colors.grey200};font-size:14px;line-height:16px;padding:2px ${spacers.dp8} 2px ${spacers.dp4};margin:${spacers.dp4} ${spacers.dp8} 0 ${spacers.dp8};border-radius:3px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}`, `.chip.jsx-3199850788:hover{background:${colors.grey300};}`, `.selected.jsx-3199850788{background:${theme.secondary100};color:${theme.secondary900};}`, `.selected.jsx-3199850788 .icon path{fill:${theme.secondary700};}`, ".selected.jsx-3199850788:hover{background:#c9edeb;}", `.highlighted.jsx-3199850788,.highlighted.jsx-3199850788:hover{background:${theme.secondary800};color:${colors.white};}`, `.highlighted.jsx-3199850788 .icon path{fill:${colors.white};}`, ".disabled.jsx-3199850788{opacity:0.3;cursor:not-allowed;}", ".inactive.jsx-3199850788{opacity:0.3;}", ".icon.jsx-3199850788,.label.jsx-3199850788{line-height:18px;}", `.icon.jsx-3199850788{margin-right:${spacers.dp4};display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;vertical-align:text-bottom;padding-top:1px;}`, ".label.jsx-3199850788{font-size:14px;}"];
3
3
  _defaultExport.__hash = "3199850788";
4
4
  export default _defaultExport;
package/build/es/index.js CHANGED
@@ -16,7 +16,7 @@ export { default as LegendKey } from './components/LegendKey/LegendKey'; // Api
16
16
 
17
17
  export { default as Analytics } from './api/analytics/Analytics';
18
18
  export { apiFetchDimensions, apiFetchRecommendedIds } from './api/dimensions';
19
- export { apiFetchOrganisationUnitLevels, apiFetchOrganisationUnitRoots, apiFetchOrganisationUnit } from './api/organisationUnits-dataEngine'; // Modules: axis
19
+ export { apiFetchOrganisationUnitLevels, apiFetchOrganisationUnitRoots, apiFetchOrganisationUnit } from './api/organisationUnits'; // Modules: axis
20
20
 
21
21
  export { getAxisName, getAxisNameByLayoutType, hasCustomAxes } from './modules/axis'; // Modules: predefined dimensions
22
22
 
@@ -101,6 +101,11 @@
101
101
  "Options": "Options",
102
102
  "Hide": "Hide",
103
103
  "Update": "Update",
104
+ "User organisation unit": "User organisation unit",
105
+ "User sub-units": "User sub-units",
106
+ "User sub-x2-units": "User sub-x2-units",
107
+ "Select a level": "Select a level",
108
+ "Select a group": "Select a group",
104
109
  "Period type": "Period type",
105
110
  "Year": "Year",
106
111
  "Select year": "Select year",
@@ -76,7 +76,7 @@
76
76
  "There was a problem loading items. Try again or contact your system administrator.": "",
77
77
  "No items found. Create a new to get started.": "",
78
78
  "No items found. Try adjusting your search or filter options to find what you're looking for.": "",
79
- "Create new": "",
79
+ "Create new": "Создать новый",
80
80
  "Open a visualization": "",
81
81
  "Loading visualizations": "",
82
82
  "Couldn't load visualizations": "",
@@ -91,13 +91,13 @@
91
91
  "No maps found. Click New map to get started.": "未找到地图。单击新地图开始。",
92
92
  "No maps found. Try adjusting your search or filter options to find what you're looking for.": "未找到地图。尝试调整您的搜索或过滤选项以找到您要查找的内容。",
93
93
  "New map": "新地图",
94
- "Open an event report": "",
95
- "Loading event reports": "",
96
- "Couldn't load event reports": "",
97
- "There was a problem loading event reports. Try again or contact your system administrator.": "",
98
- "No event reports found. Click New event report to get started.": "",
99
- "No event reports found. Try adjusting your search or filter options to find what you're looking for.": "",
100
- "New event report": "",
94
+ "Open an event report": "打开事件报告",
95
+ "Loading event reports": "加载事件报告",
96
+ "Couldn't load event reports": "无法加载事件报告",
97
+ "There was a problem loading event reports. Try again or contact your system administrator.": "加载事件报告时出现问题。重试或联系您的系统管理员。",
98
+ "No event reports found. Click New event report to get started.": "未找到事件报告。单击新建事件报告开始。",
99
+ "No event reports found. Try adjusting your search or filter options to find what you're looking for.": "未找到事件报告。尝试调整您的搜索或过滤选项以找到您要查找的内容。",
100
+ "New event report": "新建事件报告",
101
101
  "Options": "选项",
102
102
  "Hide": "隐藏",
103
103
  "Update": "更新",
@@ -33,7 +33,7 @@ export const getAxisNameByLayoutType = (axisId, layoutType) => {
33
33
  const name = getAxisNamesByLayoutType(layoutType)[axisId];
34
34
 
35
35
  if (!name) {
36
- throw new Error("".concat(axisId, " is not a valid axis id"));
36
+ throw new Error(`${axisId} is not a valid axis id`);
37
37
  }
38
38
 
39
39
  return name;
@@ -101,7 +101,7 @@ const getRulesByVisType = visType => {
101
101
  const rules = visTypeToRules[visType];
102
102
 
103
103
  if (!rules) {
104
- throw new Error("".concat(visType, " is not a known visualization type"));
104
+ throw new Error(`${visType} is not a known visualization type`);
105
105
  }
106
106
 
107
107
  return rules;
@@ -1,5 +1,8 @@
1
1
  const LEVEL_ID_PREFIX = 'LEVEL';
2
2
  const GROUP_ID_PREFIX = 'OU_GROUP';
3
+ export const USER_ORG_UNIT = 'USER_ORGUNIT';
4
+ export const USER_ORG_UNIT_CHILDREN = 'USER_ORGUNIT_CHILDREN';
5
+ export const USER_ORG_UNIT_GRANDCHILDREN = 'USER_ORGUNIT_GRANDCHILDREN';
3
6
 
4
7
  const hasGroupPrefix = id => id.substr(0, GROUP_ID_PREFIX.length) === GROUP_ID_PREFIX;
5
8
 
@@ -12,8 +15,8 @@ const stripGroupPrefix = id => hasGroupPrefix(id) ? id.substr(GROUP_ID_PREFIX.le
12
15
  const removePrefix = id => stripGroupPrefix(stripLevelPrefix(id));
13
16
 
14
17
  export const ouIdHelper = Object.freeze({
15
- addLevelPrefix: id => "".concat(LEVEL_ID_PREFIX, "-").concat(removePrefix(id)),
16
- addGroupPrefix: id => "".concat(GROUP_ID_PREFIX, "-").concat(removePrefix(id)),
18
+ addLevelPrefix: id => `${LEVEL_ID_PREFIX}-${removePrefix(id)}`,
19
+ addGroupPrefix: id => `${GROUP_ID_PREFIX}-${removePrefix(id)}`,
17
20
  removePrefix,
18
21
  hasGroupPrefix,
19
22
  hasLevelPrefix
@@ -354,7 +354,7 @@ export class PivotTableEngine {
354
354
  }
355
355
 
356
356
  if (rowLevel === lastRowLevel && this.dimensionLookup.rows[lastRowLevel] && columnLevel === lastColumnLevel && this.dimensionLookup.columns[lastColumnLevel]) {
357
- return "".concat(this.dimensionLookup.rows[lastRowLevel].meta.name, " / ").concat(this.dimensionLookup.columns[lastColumnLevel].meta.name);
357
+ return `${this.dimensionLookup.rows[lastRowLevel].meta.name} / ${this.dimensionLookup.columns[lastColumnLevel].meta.name}`;
358
358
  }
359
359
 
360
360
  if (lastRowLevel === -1) {
@@ -948,12 +948,12 @@ export class PivotTableEngine {
948
948
 
949
949
  sort(column, order) {
950
950
  if (order !== SORT_ORDER_ASCENDING && order !== SORT_ORDER_DESCENDING) {
951
- console.warn("Invalid sort order ".concat(order));
951
+ console.warn(`Invalid sort order ${order}`);
952
952
  return;
953
953
  }
954
954
 
955
955
  if (!this.isSortable(column)) {
956
- console.warn("Invalid sort column ".concat(column));
956
+ console.warn(`Invalid sort column ${column}`);
957
957
  return;
958
958
  }
959
959
 
@@ -7,7 +7,7 @@ const getContext = fontSize => {
7
7
  }
8
8
 
9
9
  const ctx = canvas.getContext('2d');
10
- ctx.font = "".concat(fontSize, "px Roboto, Arial, sans-serif");
10
+ ctx.font = `${fontSize}px Roboto, Arial, sans-serif`;
11
11
  return ctx;
12
12
  };
13
13
 
@@ -1,4 +1,4 @@
1
1
  import { getRelativePeriodIds } from '../../components/PeriodDimension/utils/relativePeriods';
2
- import { ouIdHelper } from '../ouIdHelper';
2
+ import { ouIdHelper, USER_ORG_UNIT, USER_ORG_UNIT_CHILDREN, USER_ORG_UNIT_GRANDCHILDREN } from '../ouIdHelper';
3
3
  import { DIMENSION_ID_ASSIGNED_CATEGORIES, DIMENSION_ID_ORGUNIT, DIMENSION_ID_PERIOD } from '../predefinedDimensions';
4
- export const hasRelativeItems = (dimension, itemIds = []) => dimension === DIMENSION_ID_ASSIGNED_CATEGORIES || dimension === DIMENSION_ID_ORGUNIT && Array.isArray(itemIds) && itemIds.some(id => ouIdHelper.hasLevelPrefix(id) || ouIdHelper.hasGroupPrefix(id) || ['USER_ORGUNIT', 'USER_ORGUNIT_CHILDREN', 'USER_ORGUNIT_GRAND_CHILDREN'].includes(id)) || dimension === DIMENSION_ID_PERIOD && Array.isArray(itemIds) && itemIds.some(id => getRelativePeriodIds().includes(id));
4
+ export const hasRelativeItems = (dimension, itemIds = []) => dimension === DIMENSION_ID_ASSIGNED_CATEGORIES || dimension === DIMENSION_ID_ORGUNIT && Array.isArray(itemIds) && itemIds.some(id => ouIdHelper.hasLevelPrefix(id) || ouIdHelper.hasGroupPrefix(id) || [USER_ORG_UNIT, USER_ORG_UNIT_CHILDREN, USER_ORG_UNIT_GRANDCHILDREN].includes(id)) || dimension === DIMENSION_ID_PERIOD && Array.isArray(itemIds) && itemIds.some(id => getRelativePeriodIds().includes(id));
@@ -71,7 +71,7 @@ export const getDisplayNameByVisType = visType => {
71
71
  const displayName = visTypeDisplayNames[visType];
72
72
 
73
73
  if (!displayName) {
74
- throw new Error("".concat(visType, " is not a valid visualization type"));
74
+ throw new Error(`${visType} is not a valid visualization type`);
75
75
  }
76
76
 
77
77
  return displayName;
@@ -76,7 +76,7 @@ function getTwoCategoryTrendLines(layout, series, isStacked) {
76
76
  });
77
77
  } else {
78
78
  series.forEach(seriesObj => {
79
- const trendlineSerieId = "trendline-".concat(seriesObj.id);
79
+ const trendlineSerieId = `trendline-${seriesObj.id}`;
80
80
  newSeries.push(seriesObj);
81
81
 
82
82
  if (!seriesObj.custom.isTwoCategoryFakeSerie) {
@@ -18,7 +18,7 @@ const getPlotLineLabelStyle = fontStyle => ({
18
18
  y: -7,
19
19
  style: {
20
20
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
21
- fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
21
+ fontSize: `${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`,
22
22
  fontWeight: fontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal',
23
23
  fontStyle: fontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal'
24
24
  }
@@ -103,7 +103,7 @@ export const getLabels = axis => {
103
103
  return {
104
104
  style: {
105
105
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
106
- fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
106
+ fontSize: `${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`,
107
107
  fontWeight: fontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal',
108
108
  fontStyle: fontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal'
109
109
  },
@@ -8,7 +8,7 @@ const getTitleStyle = (fontStyle, titleType, visType) => fontStyle ? {
8
8
  margin: 15,
9
9
  style: {
10
10
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
11
- fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
11
+ fontSize: `${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`,
12
12
  fontWeight: fontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal',
13
13
  fontStyle: fontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal'
14
14
  }
@@ -20,7 +20,7 @@ function getItemStyle(fontStyle, dashboard) {
20
20
  fontWeight: 'normal'
21
21
  }, dashboard ? DASHBOARD_ITEM_STYLE : {
22
22
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
23
- fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
23
+ fontSize: `${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`,
24
24
  fontWeight: fontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal',
25
25
  fontStyle: fontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal'
26
26
  })
@@ -71,22 +71,33 @@ const formatLabel = ({
71
71
 
72
72
  if ((!seriesId || seriesId.startsWith('trendline')) && seriesType === getType(VIS_TYPE_LINE).type) {
73
73
  // trendline
74
- result.push("<span style=\"height: ".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 6.5, "px; width: ").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px; background-color: ").concat(seriesColor, "; display: inline-block;\"></span>"));
75
- result.push("<span style=\"margin-left: 8px\" class=\"data-test-series-key-item-name\">".concat(seriesName, "</span>"));
74
+ result.push(`<span style="height: ${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 6.5}px; width: ${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px; background-color: ${seriesColor}; display: inline-block;"></span>`);
75
+ result.push(`<span style="margin-left: 8px" class="data-test-series-key-item-name">${seriesName}</span>`);
76
76
  } else if (legendSet !== null && legendSet !== void 0 && (_legendSet$legends = legendSet.legends) !== null && _legendSet$legends !== void 0 && _legendSet$legends.length && isLegendSetType(visType) && seriesType !== getType(VIS_TYPE_LINE).type) {
77
77
  // item with legend set
78
- legendSet.legends.sort((a, b) => a.startValue - b.startValue).forEach((legend, index) => result.push("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" height=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" version=\"1.1\" style=\"margin-right:-5px; z-index: ").concat(legendSet.legends.length - index, "\" class=\"data-test-series-key-item-bullet\">\n <circle cx=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" cy=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" r=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" fill=\"").concat(legend.color, "\"></circle>\n </svg>")));
79
- result.push("<span style=\"margin-left: 8px\" class=\"data-test-series-key-item-name\">".concat(seriesName, "</span>"));
78
+ legendSet.legends.sort((a, b) => a.startValue - b.startValue).forEach((legend, index) => result.push(`<svg xmlns="http://www.w3.org/2000/svg" width="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}" height="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}" version="1.1" style="margin-right:-5px; z-index: ${legendSet.legends.length - index}" class="data-test-series-key-item-bullet">
79
+ <circle cx="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2}" cy="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2}" r="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2}" fill="${legend.color}"></circle>
80
+ </svg>`));
81
+ result.push(`<span style="margin-left: 8px" class="data-test-series-key-item-name">${seriesName}</span>`);
80
82
  } else {
81
83
  // regular item (not a trendline, no applied legend set)
82
84
  if ((seriesColor === null || seriesColor === void 0 ? void 0 : seriesColor.patternIndex) !== undefined) {
83
85
  const pattern = colorSets[COLOR_SET_PATTERNS].patterns[seriesColor.patternIndex];
84
- result.push("<svg xmlns=\"http://www.w3.org/2000/svg\" style=\"height: ".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px; width: ").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px; display: inline-block; margin-right:5px\" class=\"data-test-series-key-item-bullet\">\n <defs>\n <pattern id=\"pattern").concat(seriesColor.patternIndex, "\" patternUnits=\"userSpaceOnUse\" width=\"").concat(pattern.width, "\" height=\"").concat(pattern.height, "\">\n <path stroke=\"").concat(pattern.color, "\" d=\"").concat(pattern.path, "\"/>\n </pattern>\n </defs>\n <circle cx=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" cy=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" r=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" fill=\"url(#pattern").concat(seriesColor.patternIndex, ")\"/>\n </svg>"));
86
+ result.push(`<svg xmlns="http://www.w3.org/2000/svg" style="height: ${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px; width: ${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px; display: inline-block; margin-right:5px" class="data-test-series-key-item-bullet">
87
+ <defs>
88
+ <pattern id="pattern${seriesColor.patternIndex}" patternUnits="userSpaceOnUse" width="${pattern.width}" height="${pattern.height}">
89
+ <path stroke="${pattern.color}" d="${pattern.path}"/>
90
+ </pattern>
91
+ </defs>
92
+ <circle cx="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2}" cy="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2}" r="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2}" fill="url(#pattern${seriesColor.patternIndex})"/>
93
+ </svg>`);
85
94
  } else {
86
- result.push("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" height=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "\" version=\"1.1\" style=\"margin-right:5px\" class=\"data-test-series-key-item-bullet\">\n <circle cx=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" cy=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" r=\"").concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2, "\" fill=\"").concat(seriesColor, "\"></circle>\n </svg>"));
95
+ result.push(`<svg xmlns="http://www.w3.org/2000/svg" width="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}" height="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}" version="1.1" style="margin-right:5px" class="data-test-series-key-item-bullet">
96
+ <circle cx="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2}" cy="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2}" r="${fontStyle[FONT_STYLE_OPTION_FONT_SIZE] / 2}" fill="${seriesColor}"></circle>
97
+ </svg>`);
87
98
  }
88
99
 
89
- result.push("<span class=\"data-test-series-key-item-name\">".concat(seriesName, "</span>"));
100
+ result.push(`<span class="data-test-series-key-item-name">${seriesName}</span>`);
90
101
  }
91
102
 
92
103
  result.push('</div>');
@@ -28,6 +28,6 @@ export const applyLegendSet = (seriesObj = {}, legendSet) => !seriesObj.type ? {
28
28
  };
29
29
  export const getLegendSetTooltip = () => ({
30
30
  pointFormatter: function () {
31
- return "<span style=\"color:".concat(this.color, "\">\u25CF</span> ").concat(this.series.name, ": <b>").concat(this.y, "</b><br>") + (this.legend ? "".concat(this.legendSet, ": <b>").concat(this.legend, "</b>") : "".concat(i18n.t('No legend for this series')));
31
+ return `<span style="color:${this.color}">●</span> ${this.series.name}: <b>${this.y}</b><br>` + (this.legend ? `${this.legendSet}: <b>${this.legend}</b>` : `${i18n.t('No legend for this series')}`);
32
32
  }
33
33
  });
@@ -29,7 +29,7 @@ export default (({
29
29
  }));
30
30
  }
31
31
 
32
- return "".concat(labels.map(label => "<b>".concat(label, "</b><br>")).join('')).concat(yAxisName, ": ").concat(y, "<br>").concat(xAxisName, ": ").concat(x);
32
+ return `${labels.map(label => `<b>${label}</b><br>`).join('')}${yAxisName}: ${y}<br>${xAxisName}: ${x}`;
33
33
  };
34
34
 
35
35
  switch (visType) {
@@ -58,7 +58,7 @@ export default function (series, layout, metaData, dashboard) {
58
58
  style: {
59
59
  // DHIS2-578: dynamically truncate subtitle when it's taking more than 1 line
60
60
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
61
- fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
61
+ fontSize: `${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`,
62
62
  fontWeight: fontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal',
63
63
  fontStyle: fontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal',
64
64
  whiteSpace: 'nowrap',
@@ -61,7 +61,7 @@ export default function (layout, metaData, dashboard) {
61
61
  align: getTextAlignOption(fontStyle[FONT_STYLE_OPTION_TEXT_ALIGN], FONT_STYLE_VISUALIZATION_TITLE, isVerticalType(layout.type)),
62
62
  style: {
63
63
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
64
- fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
64
+ fontSize: `${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`,
65
65
  fontWeight: fontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal',
66
66
  fontStyle: fontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal',
67
67
  whiteSpace: 'nowrap',
@@ -4,6 +4,6 @@ export default function (layout, metaData, dashboard) {
4
4
 
5
5
  if ((_layout$rows = layout.rows) !== null && _layout$rows !== void 0 && _layout$rows.length && (_layout$columns = layout.columns) !== null && _layout$columns !== void 0 && _layout$columns.length && !dashboard) {
6
6
  const columns = getFilterText(layout.columns, metaData).split(', ');
7
- return "".concat(getFilterText(layout.rows, metaData), ": ").concat(columns[0], " - ").concat(columns[1]);
7
+ return `${getFilterText(layout.rows, metaData)}: ${columns[0]} - ${columns[1]}`;
8
8
  }
9
9
  }
@@ -23,7 +23,7 @@ export const getLabels = axis => {
23
23
  return {
24
24
  style: {
25
25
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
26
- fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
26
+ fontSize: `${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`,
27
27
  fontWeight: fontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal',
28
28
  fontStyle: fontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal'
29
29
  },
@@ -47,12 +47,12 @@ function getPlotLine(regressionLine = {}, defaultLabel) {
47
47
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR] || '#000',
48
48
  ...(label && {
49
49
  label: {
50
- text: "".concat(label, ": ").concat(value),
50
+ text: `${label}: ${value}`,
51
51
  verticalAlign,
52
52
  y,
53
53
  style: {
54
54
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
55
- fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
55
+ fontSize: `${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`,
56
56
  fontWeight: fontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal',
57
57
  fontStyle: fontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal'
58
58
  }
@@ -69,7 +69,7 @@ const getLabels = axis => {
69
69
  y: parseInt(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], 10) + 7,
70
70
  style: {
71
71
  color: fontStyle[FONT_STYLE_OPTION_TEXT_COLOR],
72
- fontSize: "".concat(fontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"),
72
+ fontSize: `${fontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`,
73
73
  fontWeight: fontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal',
74
74
  fontStyle: fontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal'
75
75
  }
@@ -52,9 +52,9 @@ function getDefault(layout, series, extraOptions) {
52
52
  var _axis$title;
53
53
 
54
54
  rl.title = { ...rl.title,
55
- text: "".concat(rl.title.text, " - ").concat(((_axis$title = axis.title) === null || _axis$title === void 0 ? void 0 : _axis$title.text) || i18n.t('Axis {{axisId}}', {
55
+ text: `${rl.title.text} - ${((_axis$title = axis.title) === null || _axis$title === void 0 ? void 0 : _axis$title.text) || i18n.t('Axis {{axisId}}', {
56
56
  axisId: axis.index + 1
57
- }))
57
+ })}`
58
58
  };
59
59
  }
60
60
  });
@@ -14,7 +14,7 @@ const generateValueSVG = ({
14
14
  const textSize = 300;
15
15
  const svgValue = document.createElementNS(svgNS, 'svg');
16
16
  svgValue.setAttribute('xmlns', svgNS);
17
- svgValue.setAttribute('viewBox', "0 -".concat(textSize + 50, " ").concat(textSize * 0.75 * formattedValue.length, " ").concat(textSize + 200));
17
+ svgValue.setAttribute('viewBox', `0 -${textSize + 50} ${textSize * 0.75 * formattedValue.length} ${textSize + 200}`);
18
18
 
19
19
  if (y) {
20
20
  svgValue.setAttribute('y', y);
@@ -42,7 +42,7 @@ const generateValueSVG = ({
42
42
  if (subText) {
43
43
  const svgSubText = document.createElementNS(svgNS, 'svg');
44
44
  const subTextSize = 40;
45
- svgSubText.setAttribute('viewBox', "0 -50 ".concat(textSize * 0.75 * formattedValue.length, " ").concat(textSize + 200));
45
+ svgSubText.setAttribute('viewBox', `0 -50 ${textSize * 0.75 * formattedValue.length} ${textSize + 200}`);
46
46
 
47
47
  if (y) {
48
48
  svgSubText.setAttribute('y', y);
@@ -136,7 +136,7 @@ const generateDVItem = (config, {
136
136
  const svgNS = 'http://www.w3.org/2000/svg';
137
137
  const svg = document.createElementNS(svgNS, 'svg');
138
138
  svg.setAttribute('xmlns', svgNS);
139
- svg.setAttribute('viewBox', "0 0 ".concat(width, " ").concat(height));
139
+ svg.setAttribute('viewBox', `0 0 ${width} ${height}`);
140
140
  svg.setAttribute('width', '100%');
141
141
  svg.setAttribute('height', '100%');
142
142
  svg.setAttribute('data-test', 'visualization-container');
@@ -145,7 +145,7 @@ const generateDVItem = (config, {
145
145
  title.setAttribute('x', getXFromTextAlign(titleFontStyle[FONT_STYLE_OPTION_TEXT_ALIGN]));
146
146
  title.setAttribute('y', 28);
147
147
  title.setAttribute('text-anchor', getTextAnchorFromTextAlign(titleFontStyle[FONT_STYLE_OPTION_TEXT_ALIGN]));
148
- title.setAttribute('font-size', "".concat(titleFontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"));
148
+ title.setAttribute('font-size', `${titleFontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`);
149
149
  title.setAttribute('font-weight', titleFontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal');
150
150
  title.setAttribute('font-style', titleFontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal');
151
151
  title.setAttribute('fill', titleFontStyle[FONT_STYLE_OPTION_TEXT_COLOR]);
@@ -162,7 +162,7 @@ const generateDVItem = (config, {
162
162
  subtitle.setAttribute('y', 28);
163
163
  subtitle.setAttribute('dy', 22);
164
164
  subtitle.setAttribute('text-anchor', getTextAnchorFromTextAlign(subtitleFontStyle[FONT_STYLE_OPTION_TEXT_ALIGN]));
165
- subtitle.setAttribute('font-size', "".concat(subtitleFontStyle[FONT_STYLE_OPTION_FONT_SIZE], "px"));
165
+ subtitle.setAttribute('font-size', `${subtitleFontStyle[FONT_STYLE_OPTION_FONT_SIZE]}px`);
166
166
  subtitle.setAttribute('font-weight', subtitleFontStyle[FONT_STYLE_OPTION_BOLD] ? FONT_STYLE_OPTION_BOLD : 'normal');
167
167
  subtitle.setAttribute('font-style', subtitleFontStyle[FONT_STYLE_OPTION_ITALIC] ? FONT_STYLE_OPTION_ITALIC : 'normal');
168
168
  subtitle.setAttribute('fill', subtitleFontStyle[FONT_STYLE_OPTION_TEXT_COLOR]);