@dhis2/analytics 28.0.3 → 28.0.5

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 (496) hide show
  1. package/build/cjs/__demo__/DataDimension.stories.js +1 -2
  2. package/build/cjs/__demo__/Filter.stories.js +1 -2
  3. package/build/cjs/__demo__/FixedPeriodSelect.stories.js +1 -2
  4. package/build/cjs/__demo__/OpenFileDialog.stories.js +19 -1
  5. package/build/cjs/__demo__/OrgUnitDimension.stories.js +1 -2
  6. package/build/cjs/__demo__/PivotTable.stories.js +166 -224
  7. package/build/cjs/__demo__/ScatterPlotPdfExport.stories.js +1 -2
  8. package/build/cjs/__demo__/SingleValue.stories.js +1 -2
  9. package/build/cjs/__demo__/Toolbar.stories.js +1 -2
  10. package/build/cjs/api/__tests__/dimensions.spec.js +1 -2
  11. package/build/cjs/api/analytics/Analytics.js +8 -9
  12. package/build/cjs/api/analytics/AnalyticsBase.js +58 -77
  13. package/build/cjs/api/analytics/AnalyticsRequest.js +1 -2
  14. package/build/cjs/api/analytics/AnalyticsRequestBase.js +18 -21
  15. package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +19 -38
  16. package/build/cjs/api/analytics/AnalyticsResponseHeader.js +5 -7
  17. package/build/cjs/api/analytics/__tests__/AnalyticsBase.spec.js +9 -12
  18. package/build/cjs/api/analytics/__tests__/AnalyticsRequest.spec.js +8 -2
  19. package/build/cjs/api/analytics/utils.js +11 -17
  20. package/build/cjs/api/dimensions.js +119 -148
  21. package/build/cjs/api/expression.js +39 -60
  22. package/build/cjs/api/organisationUnits.js +23 -35
  23. package/build/cjs/components/AboutAOUnit/AboutAOUnit.js +12 -20
  24. package/build/cjs/components/CachedDataQueryProvider.js +7 -9
  25. package/build/cjs/components/DashboardPluginWrapper/DashboardPluginWrapper.js +18 -22
  26. package/build/cjs/components/DataDimension/Calculation/CalculationModal.js +44 -61
  27. package/build/cjs/components/DataDimension/Calculation/DataElementOption.js +5 -6
  28. package/build/cjs/components/DataDimension/Calculation/DataElementSelector.js +29 -38
  29. package/build/cjs/components/DataDimension/Calculation/DndContext.js +29 -37
  30. package/build/cjs/components/DataDimension/Calculation/DraggingItem.js +5 -6
  31. package/build/cjs/components/DataDimension/Calculation/DropZone.js +4 -5
  32. package/build/cjs/components/DataDimension/Calculation/FormulaField.js +29 -32
  33. package/build/cjs/components/DataDimension/Calculation/FormulaItem.js +14 -16
  34. package/build/cjs/components/DataDimension/Calculation/MathOperatorSelector.js +23 -29
  35. package/build/cjs/components/DataDimension/Calculation/Operator.js +6 -7
  36. package/build/cjs/components/DataDimension/DataDimension.js +20 -32
  37. package/build/cjs/components/DataDimension/Info/CalculationInfo.js +14 -22
  38. package/build/cjs/components/DataDimension/Info/DataElementInfo.js +23 -36
  39. package/build/cjs/components/DataDimension/Info/DataElementOperandInfo.js +30 -44
  40. package/build/cjs/components/DataDimension/Info/DataSetInfo.js +26 -39
  41. package/build/cjs/components/DataDimension/Info/EventDataItemInfo.js +21 -34
  42. package/build/cjs/components/DataDimension/Info/IndicatorInfo.js +21 -32
  43. package/build/cjs/components/DataDimension/Info/InfoPopover.js +6 -7
  44. package/build/cjs/components/DataDimension/Info/InfoTable.js +39 -52
  45. package/build/cjs/components/DataDimension/Info/OptionInfo.js +13 -20
  46. package/build/cjs/components/DataDimension/Info/ProgramIndicatorInfo.js +46 -58
  47. package/build/cjs/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +22 -32
  48. package/build/cjs/components/DataDimension/ItemSelector/DataTypeSelector.js +6 -7
  49. package/build/cjs/components/DataDimension/ItemSelector/DetailSelector.js +5 -6
  50. package/build/cjs/components/DataDimension/ItemSelector/GroupSelector.js +10 -12
  51. package/build/cjs/components/DataDimension/ItemSelector/ItemSelector.js +86 -104
  52. package/build/cjs/components/DataDimension/ItemSelector/MetricSelector.js +5 -6
  53. package/build/cjs/components/DataDimension/SourceEmptyPlaceholder.js +10 -13
  54. package/build/cjs/components/DataDimension/TransferOption.js +35 -39
  55. package/build/cjs/components/DimensionMenu.js +13 -14
  56. package/build/cjs/components/DimensionsPanel/DimensionsPanel.js +8 -9
  57. package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +12 -13
  58. package/build/cjs/components/DimensionsPanel/List/DimensionList.js +12 -11
  59. package/build/cjs/components/DimensionsPanel/List/OptionsButton.js +8 -11
  60. package/build/cjs/components/DimensionsPanel/List/RecommendedIcon.js +10 -13
  61. package/build/cjs/components/DimensionsPanel/List/__tests__/DimensionItem.spec.js +48 -41
  62. package/build/cjs/components/DimensionsPanel/List/__tests__/__snapshots__/DimensionItem.spec.js.snap +110 -114
  63. package/build/cjs/components/DimensionsPanel/__tests__/DimensionsPanel.spec.js +36 -33
  64. package/build/cjs/components/DynamicDimension/DynamicDimension.js +9 -13
  65. package/build/cjs/components/DynamicDimension/ItemSelector.js +25 -38
  66. package/build/cjs/components/FileMenu/DeleteDialog.js +11 -16
  67. package/build/cjs/components/FileMenu/FileMenu.js +19 -30
  68. package/build/cjs/components/FileMenu/GetLinkDialog.js +7 -7
  69. package/build/cjs/components/FileMenu/RenameDialog.js +13 -21
  70. package/build/cjs/components/FileMenu/SaveAsDialog.js +13 -21
  71. package/build/cjs/components/FileMenu/__tests__/DeleteDialog.spec.js +24 -27
  72. package/build/cjs/components/FileMenu/__tests__/FileMenu.spec.js +55 -31
  73. package/build/cjs/components/FileMenu/__tests__/GetLinkDialog.spec.js +35 -39
  74. package/build/cjs/components/FileMenu/__tests__/RenameDialog.spec.js +17 -11
  75. package/build/cjs/components/FileMenu/__tests__/SaveAsDialog.spec.js +44 -37
  76. package/build/cjs/components/FileMenu/utils.js +10 -12
  77. package/build/cjs/components/Filter/Filter.js +21 -27
  78. package/build/cjs/components/Filter/__tests__/Filter.spec.js +29 -34
  79. package/build/cjs/components/Interpretations/InterpretationModal/Comment.js +8 -10
  80. package/build/cjs/components/Interpretations/InterpretationModal/CommentAddForm.js +10 -15
  81. package/build/cjs/components/Interpretations/InterpretationModal/CommentDeleteButton.js +10 -15
  82. package/build/cjs/components/Interpretations/InterpretationModal/CommentUpdateForm.js +12 -17
  83. package/build/cjs/components/Interpretations/InterpretationModal/InterpretationModal.js +19 -25
  84. package/build/cjs/components/Interpretations/InterpretationModal/InterpretationThread.js +12 -14
  85. package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationForm.js +12 -17
  86. package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationList.js +10 -11
  87. package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +23 -33
  88. package/build/cjs/components/Interpretations/common/Interpretation/Interpretation.js +13 -15
  89. package/build/cjs/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +7 -11
  90. package/build/cjs/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +5 -7
  91. package/build/cjs/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +15 -23
  92. package/build/cjs/components/Interpretations/common/Interpretation/useLike.js +5 -6
  93. package/build/cjs/components/Interpretations/common/Message/Message.js +6 -7
  94. package/build/cjs/components/Interpretations/common/Message/MessageButtonStrip.js +8 -11
  95. package/build/cjs/components/Interpretations/common/Message/MessageEditorContainer.js +18 -21
  96. package/build/cjs/components/Interpretations/common/Message/MessageIconButton.js +34 -40
  97. package/build/cjs/components/Interpretations/common/Message/MessageInput.js +1 -2
  98. package/build/cjs/components/Interpretations/common/Message/MessageStatsBar.js +8 -11
  99. package/build/cjs/components/LegendKey/LegendKey.js +3 -4
  100. package/build/cjs/components/OfflineTooltip.js +18 -26
  101. package/build/cjs/components/OpenFileDialog/CreatedByFilter.js +28 -26
  102. package/build/cjs/components/OpenFileDialog/CustomSelectOption.js +23 -26
  103. package/build/cjs/components/OpenFileDialog/DateField.js +3 -4
  104. package/build/cjs/components/OpenFileDialog/FileList.js +19 -22
  105. package/build/cjs/components/OpenFileDialog/NameFilter.js +15 -21
  106. package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +50 -79
  107. package/build/cjs/components/OpenFileDialog/PaginationControls.js +22 -28
  108. package/build/cjs/components/OpenFileDialog/VisTypeFilter.js +65 -36
  109. package/build/cjs/components/OpenFileDialog/__tests__/OpenFileDialog.spec.js +51 -0
  110. package/build/cjs/components/Options/VisualizationOptions.js +35 -46
  111. package/build/cjs/components/OrgUnitDimension/OrgUnitDimension.js +38 -60
  112. package/build/cjs/components/OrgUnitDimension/__tests__/OrgUnitDimension.spec.js +78 -44
  113. package/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +17 -25
  114. package/build/cjs/components/PeriodDimension/FixedPeriodSelect.js +15 -21
  115. package/build/cjs/components/PeriodDimension/PeriodDimension.js +9 -12
  116. package/build/cjs/components/PeriodDimension/PeriodTransfer.js +49 -63
  117. package/build/cjs/components/PeriodDimension/RelativePeriodFilter.js +25 -30
  118. package/build/cjs/components/PeriodDimension/__tests__/FixedPeriodSingleSelect.spec.js +14 -21
  119. package/build/cjs/components/PeriodDimension/__tests__/PeriodDimension.spec.js +27 -23
  120. package/build/cjs/components/PeriodDimension/utils/fixedPeriods.js +6 -7
  121. package/build/cjs/components/PeriodDimension/utils/index.js +1 -5
  122. package/build/cjs/components/PivotTable/PivotTable.js +8 -10
  123. package/build/cjs/components/PivotTable/PivotTableBody.js +20 -29
  124. package/build/cjs/components/PivotTable/PivotTableCell.js +8 -12
  125. package/build/cjs/components/PivotTable/PivotTableClippedAxis.js +14 -17
  126. package/build/cjs/components/PivotTable/PivotTableColumnHeaderCell.js +7 -8
  127. package/build/cjs/components/PivotTable/PivotTableColumnHeaders.js +22 -29
  128. package/build/cjs/components/PivotTable/PivotTableContainer.js +5 -6
  129. package/build/cjs/components/PivotTable/PivotTableDimensionLabelCell.js +4 -5
  130. package/build/cjs/components/PivotTable/PivotTableEmptyCell.js +3 -4
  131. package/build/cjs/components/PivotTable/PivotTableEmptyRow.js +4 -5
  132. package/build/cjs/components/PivotTable/PivotTableEngineContext.js +5 -7
  133. package/build/cjs/components/PivotTable/PivotTableHead.js +13 -16
  134. package/build/cjs/components/PivotTable/PivotTableHeaderCell.js +8 -9
  135. package/build/cjs/components/PivotTable/PivotTableRow.js +20 -27
  136. package/build/cjs/components/PivotTable/PivotTableRowHeaderCell.js +5 -6
  137. package/build/cjs/components/PivotTable/PivotTableSortIcon.js +4 -5
  138. package/build/cjs/components/PivotTable/PivotTableTitleRow.js +19 -24
  139. package/build/cjs/components/PivotTable/PivotTableTitleRows.js +4 -5
  140. package/build/cjs/components/PivotTable/PivotTableValueCell.js +6 -8
  141. package/build/cjs/components/RichText/Editor/Editor.js +70 -85
  142. package/build/cjs/components/RichText/Editor/__tests__/Editor.spec.js +6 -7
  143. package/build/cjs/components/RichText/Parser/Parser.js +5 -10
  144. package/build/cjs/components/RichText/Parser/__tests__/MdParser.spec.js +1 -1
  145. package/build/cjs/components/RichText/Parser/__tests__/Parser.spec.js +22 -23
  146. package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuBar.js +20 -24
  147. package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +8 -13
  148. package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuList.js +9 -17
  149. package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +11 -16
  150. package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +56 -47
  151. package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuDropdown.spec.js +8 -8
  152. package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +30 -23
  153. package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuListItem.spec.js +23 -17
  154. package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/__snapshots__/HoverMenuList.spec.js.snap +63 -0
  155. package/build/cjs/components/Toolbar/InterpretationsAndDetailsToggler.js +17 -21
  156. package/build/cjs/components/Toolbar/Toolbar.js +10 -16
  157. package/build/cjs/components/Toolbar/ToolbarSidebar.js +12 -18
  158. package/build/cjs/components/Toolbar/UpdateButton.js +18 -24
  159. package/build/cjs/components/Toolbar/__tests__/InterpretationsAndDetailsToggler.spec.js +19 -18
  160. package/build/cjs/components/Toolbar/__tests__/Toolbar.spec.js +8 -8
  161. package/build/cjs/components/Toolbar/__tests__/ToolbarSidebar.spec.js +14 -11
  162. package/build/cjs/components/Toolbar/__tests__/UpdateButton.spec.js +16 -14
  163. package/build/cjs/components/TransferOption.js +14 -15
  164. package/build/cjs/components/TranslationDialog/TranslationModal/LocalesSelect.js +19 -27
  165. package/build/cjs/components/TranslationDialog/TranslationModal/TranslationForm.js +17 -25
  166. package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModal.js +9 -10
  167. package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
  168. package/build/cjs/components/TranslationDialog/TranslationModal/__tests__/TranslationModal.spec.js +25 -16
  169. package/build/cjs/components/TranslationDialog/TranslationModal/useTranslationsResults.js +3 -4
  170. package/build/cjs/components/UserMention/UserList.js +6 -7
  171. package/build/cjs/components/UserMention/UserMentionWrapper.js +13 -20
  172. package/build/cjs/components/UserMention/useUserSearchResults.js +12 -16
  173. package/build/cjs/components/VisTypeIcon.js +5 -6
  174. package/build/cjs/index.js +38 -39
  175. package/build/cjs/locales/ar_IQ/translations.json +20 -11
  176. package/build/cjs/locales/cs/translations.json +2 -0
  177. package/build/cjs/locales/en/translations.json +1 -0
  178. package/build/cjs/locales/es/translations.json +2 -0
  179. package/build/cjs/locales/fr/translations.json +2 -0
  180. package/build/cjs/locales/id/translations.json +20 -11
  181. package/build/cjs/locales/index.js +62 -62
  182. package/build/cjs/locales/lo/translations.json +2 -0
  183. package/build/cjs/locales/nb/translations.json +2 -0
  184. package/build/cjs/locales/prs/translations.json +2 -0
  185. package/build/cjs/locales/ps/translations.json +2 -0
  186. package/build/cjs/locales/pt/translations.json +2 -0
  187. package/build/cjs/locales/pt_BR/translations.json +2 -0
  188. package/build/cjs/locales/ru/translations.json +2 -0
  189. package/build/cjs/locales/si/translations.json +20 -11
  190. package/build/cjs/locales/sv/translations.json +20 -11
  191. package/build/cjs/locales/tet/translations.json +20 -11
  192. package/build/cjs/locales/tg/translations.json +2 -0
  193. package/build/cjs/locales/uk/translations.json +2 -0
  194. package/build/cjs/locales/ur/translations.json +2 -0
  195. package/build/cjs/locales/uz_UZ_Cyrl/translations.json +2 -0
  196. package/build/cjs/locales/uz_UZ_Latn/translations.json +4 -2
  197. package/build/cjs/locales/vi/translations.json +2 -0
  198. package/build/cjs/locales/zh/translations.json +2 -0
  199. package/build/cjs/locales/zh_CN/translations.json +17 -15
  200. package/build/cjs/modules/__tests__/expressions.spec.js +4 -5
  201. package/build/cjs/modules/__tests__/isNumeric.spec.js +33 -0
  202. package/build/cjs/modules/dimensionListItem.js +4 -5
  203. package/build/cjs/modules/expressions.js +3 -9
  204. package/build/cjs/modules/getPWAInstallationStatus.js +7 -9
  205. package/build/cjs/modules/layout/dimensionCreate.js +1 -3
  206. package/build/cjs/modules/layout/dimensionIsValid.js +3 -4
  207. package/build/cjs/modules/legends.js +5 -6
  208. package/build/cjs/modules/outliers/index.js +5 -6
  209. package/build/cjs/modules/outliers/iqr.js +4 -6
  210. package/build/cjs/modules/outliers/modZScore.js +6 -14
  211. package/build/cjs/modules/outliers/zScore.js +3 -4
  212. package/build/cjs/modules/pivotTable/AdaptiveClippingController.js +12 -16
  213. package/build/cjs/modules/pivotTable/PivotTableEngine.js +48 -59
  214. package/build/cjs/modules/pivotTable/clipAxis.js +7 -8
  215. package/build/cjs/modules/pivotTable/clipPartitionedAxis.js +9 -10
  216. package/build/cjs/modules/pivotTable/getHeaderForDisplay.js +8 -9
  217. package/build/cjs/modules/pivotTable/measureText.js +7 -9
  218. package/build/cjs/modules/pivotTable/useParentSize.js +1 -2
  219. package/build/cjs/modules/pivotTable/useScrollPosition.js +1 -2
  220. package/build/cjs/modules/pivotTable/useTableClipping.js +6 -7
  221. package/build/cjs/modules/relativeItems/index.js +1 -4
  222. package/build/cjs/modules/renderValue.js +1 -2
  223. package/build/cjs/modules/utils.js +11 -2
  224. package/build/cjs/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +3 -8
  225. package/build/cjs/visualizations/config/adapters/dhis_highcharts/axis.js +7 -10
  226. package/build/cjs/visualizations/config/adapters/dhis_highcharts/customAxes.js +2 -5
  227. package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/index.js +7 -8
  228. package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/getSingleValueBackgroundColor.js +1 -2
  229. package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/index.js +6 -7
  230. package/build/cjs/visualizations/config/adapters/dhis_highcharts/getFormatter.js +2 -3
  231. package/build/cjs/visualizations/config/adapters/dhis_highcharts/getSteps.js +2 -3
  232. package/build/cjs/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +3 -4
  233. package/build/cjs/visualizations/config/adapters/dhis_highcharts/index.js +8 -10
  234. package/build/cjs/visualizations/config/adapters/dhis_highcharts/legend.js +6 -7
  235. package/build/cjs/visualizations/config/adapters/dhis_highcharts/legendSet.js +22 -26
  236. package/build/cjs/visualizations/config/adapters/dhis_highcharts/plotOptions.js +8 -9
  237. package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/index.js +18 -20
  238. package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/pie.js +1 -4
  239. package/build/cjs/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +1 -2
  240. package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +1 -3
  241. package/build/cjs/visualizations/config/index.js +11 -12
  242. package/build/cjs/visualizations/config/validators/dhis/index.js +3 -4
  243. package/build/cjs/visualizations/index.js +1 -4
  244. package/build/cjs/visualizations/store/adapters/dhis_highcharts/index.js +7 -8
  245. package/build/cjs/visualizations/store/index.js +15 -17
  246. package/build/cjs/visualizations/store/validators/dhis/index.js +5 -6
  247. package/build/cjs/visualizations/util/getFilterText.js +3 -6
  248. package/build/cjs/visualizations/util/shouldUseContrastColor.js +1 -2
  249. package/build/es/__demo__/OpenFileDialog.stories.js +17 -0
  250. package/build/es/__demo__/PivotTable.stories.js +165 -222
  251. package/build/es/api/__tests__/dimensions.spec.js +1 -2
  252. package/build/es/api/analytics/Analytics.js +8 -9
  253. package/build/es/api/analytics/AnalyticsBase.js +58 -77
  254. package/build/es/api/analytics/AnalyticsRequest.js +1 -2
  255. package/build/es/api/analytics/AnalyticsRequestBase.js +18 -21
  256. package/build/es/api/analytics/AnalyticsRequestPropertiesMixin.js +19 -38
  257. package/build/es/api/analytics/AnalyticsResponseHeader.js +5 -7
  258. package/build/es/api/analytics/__tests__/AnalyticsBase.spec.js +8 -10
  259. package/build/es/api/analytics/__tests__/AnalyticsRequest.spec.js +8 -2
  260. package/build/es/api/analytics/utils.js +11 -17
  261. package/build/es/api/dimensions.js +119 -148
  262. package/build/es/api/expression.js +39 -60
  263. package/build/es/api/organisationUnits.js +23 -35
  264. package/build/es/components/AboutAOUnit/AboutAOUnit.js +11 -18
  265. package/build/es/components/CachedDataQueryProvider.js +6 -7
  266. package/build/es/components/DashboardPluginWrapper/DashboardPluginWrapper.js +17 -20
  267. package/build/es/components/DataDimension/Calculation/CalculationModal.js +43 -59
  268. package/build/es/components/DataDimension/Calculation/DataElementOption.js +5 -6
  269. package/build/es/components/DataDimension/Calculation/DataElementSelector.js +28 -36
  270. package/build/es/components/DataDimension/Calculation/DndContext.js +28 -35
  271. package/build/es/components/DataDimension/Calculation/DraggingItem.js +5 -6
  272. package/build/es/components/DataDimension/Calculation/DropZone.js +4 -5
  273. package/build/es/components/DataDimension/Calculation/FormulaField.js +29 -32
  274. package/build/es/components/DataDimension/Calculation/FormulaItem.js +13 -14
  275. package/build/es/components/DataDimension/Calculation/MathOperatorSelector.js +23 -29
  276. package/build/es/components/DataDimension/Calculation/Operator.js +6 -7
  277. package/build/es/components/DataDimension/DataDimension.js +19 -30
  278. package/build/es/components/DataDimension/Info/CalculationInfo.js +13 -20
  279. package/build/es/components/DataDimension/Info/DataElementInfo.js +23 -36
  280. package/build/es/components/DataDimension/Info/DataElementOperandInfo.js +29 -42
  281. package/build/es/components/DataDimension/Info/DataSetInfo.js +26 -39
  282. package/build/es/components/DataDimension/Info/EventDataItemInfo.js +21 -34
  283. package/build/es/components/DataDimension/Info/IndicatorInfo.js +20 -30
  284. package/build/es/components/DataDimension/Info/InfoPopover.js +6 -7
  285. package/build/es/components/DataDimension/Info/InfoTable.js +39 -52
  286. package/build/es/components/DataDimension/Info/OptionInfo.js +13 -20
  287. package/build/es/components/DataDimension/Info/ProgramIndicatorInfo.js +45 -56
  288. package/build/es/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +21 -30
  289. package/build/es/components/DataDimension/ItemSelector/DataTypeSelector.js +6 -7
  290. package/build/es/components/DataDimension/ItemSelector/DetailSelector.js +5 -6
  291. package/build/es/components/DataDimension/ItemSelector/GroupSelector.js +9 -10
  292. package/build/es/components/DataDimension/ItemSelector/ItemSelector.js +85 -102
  293. package/build/es/components/DataDimension/ItemSelector/MetricSelector.js +5 -6
  294. package/build/es/components/DataDimension/SourceEmptyPlaceholder.js +10 -13
  295. package/build/es/components/DataDimension/TransferOption.js +35 -39
  296. package/build/es/components/DimensionMenu.js +13 -14
  297. package/build/es/components/DimensionsPanel/DimensionsPanel.js +7 -7
  298. package/build/es/components/DimensionsPanel/List/DimensionItem.js +11 -11
  299. package/build/es/components/DimensionsPanel/List/DimensionList.js +11 -9
  300. package/build/es/components/DimensionsPanel/List/OptionsButton.js +8 -11
  301. package/build/es/components/DimensionsPanel/List/RecommendedIcon.js +10 -13
  302. package/build/es/components/DimensionsPanel/List/__tests__/DimensionItem.spec.js +47 -40
  303. package/build/es/components/DimensionsPanel/List/__tests__/__snapshots__/DimensionItem.spec.js.snap +110 -114
  304. package/build/es/components/DimensionsPanel/__tests__/DimensionsPanel.spec.js +35 -32
  305. package/build/es/components/DynamicDimension/DynamicDimension.js +9 -13
  306. package/build/es/components/DynamicDimension/ItemSelector.js +24 -36
  307. package/build/es/components/FileMenu/DeleteDialog.js +10 -14
  308. package/build/es/components/FileMenu/FileMenu.js +18 -28
  309. package/build/es/components/FileMenu/GetLinkDialog.js +7 -7
  310. package/build/es/components/FileMenu/RenameDialog.js +12 -19
  311. package/build/es/components/FileMenu/SaveAsDialog.js +12 -19
  312. package/build/es/components/FileMenu/__tests__/DeleteDialog.spec.js +23 -26
  313. package/build/es/components/FileMenu/__tests__/FileMenu.spec.js +56 -32
  314. package/build/es/components/FileMenu/__tests__/GetLinkDialog.spec.js +34 -38
  315. package/build/es/components/FileMenu/__tests__/RenameDialog.spec.js +18 -12
  316. package/build/es/components/FileMenu/__tests__/SaveAsDialog.spec.js +43 -36
  317. package/build/es/components/FileMenu/utils.js +10 -12
  318. package/build/es/components/Filter/Filter.js +21 -27
  319. package/build/es/components/Filter/__tests__/Filter.spec.js +28 -33
  320. package/build/es/components/Interpretations/InterpretationModal/Comment.js +7 -8
  321. package/build/es/components/Interpretations/InterpretationModal/CommentAddForm.js +9 -13
  322. package/build/es/components/Interpretations/InterpretationModal/CommentDeleteButton.js +9 -13
  323. package/build/es/components/Interpretations/InterpretationModal/CommentUpdateForm.js +11 -15
  324. package/build/es/components/Interpretations/InterpretationModal/InterpretationModal.js +18 -23
  325. package/build/es/components/Interpretations/InterpretationModal/InterpretationThread.js +11 -12
  326. package/build/es/components/Interpretations/InterpretationsUnit/InterpretationForm.js +11 -15
  327. package/build/es/components/Interpretations/InterpretationsUnit/InterpretationList.js +10 -11
  328. package/build/es/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +22 -31
  329. package/build/es/components/Interpretations/common/Interpretation/Interpretation.js +12 -13
  330. package/build/es/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +7 -11
  331. package/build/es/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +4 -5
  332. package/build/es/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +14 -21
  333. package/build/es/components/Interpretations/common/Interpretation/useLike.js +5 -6
  334. package/build/es/components/Interpretations/common/Message/Message.js +6 -7
  335. package/build/es/components/Interpretations/common/Message/MessageButtonStrip.js +8 -11
  336. package/build/es/components/Interpretations/common/Message/MessageEditorContainer.js +18 -21
  337. package/build/es/components/Interpretations/common/Message/MessageIconButton.js +34 -40
  338. package/build/es/components/Interpretations/common/Message/MessageStatsBar.js +8 -11
  339. package/build/es/components/LegendKey/LegendKey.js +3 -4
  340. package/build/es/components/OfflineTooltip.js +18 -26
  341. package/build/es/components/OpenFileDialog/CreatedByFilter.js +26 -25
  342. package/build/es/components/OpenFileDialog/CustomSelectOption.js +23 -26
  343. package/build/es/components/OpenFileDialog/DateField.js +3 -4
  344. package/build/es/components/OpenFileDialog/FileList.js +19 -22
  345. package/build/es/components/OpenFileDialog/NameFilter.js +15 -21
  346. package/build/es/components/OpenFileDialog/OpenFileDialog.js +49 -78
  347. package/build/es/components/OpenFileDialog/PaginationControls.js +22 -28
  348. package/build/es/components/OpenFileDialog/VisTypeFilter.js +64 -36
  349. package/build/es/components/OpenFileDialog/__tests__/OpenFileDialog.spec.js +49 -0
  350. package/build/es/components/Options/VisualizationOptions.js +34 -44
  351. package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +37 -58
  352. package/build/es/components/OrgUnitDimension/__tests__/OrgUnitDimension.spec.js +77 -43
  353. package/build/es/components/PeriodDimension/FixedPeriodFilter.js +17 -25
  354. package/build/es/components/PeriodDimension/FixedPeriodSelect.js +14 -19
  355. package/build/es/components/PeriodDimension/PeriodDimension.js +9 -12
  356. package/build/es/components/PeriodDimension/PeriodTransfer.js +48 -61
  357. package/build/es/components/PeriodDimension/RelativePeriodFilter.js +25 -30
  358. package/build/es/components/PeriodDimension/__tests__/FixedPeriodSingleSelect.spec.js +13 -20
  359. package/build/es/components/PeriodDimension/__tests__/PeriodDimension.spec.js +26 -22
  360. package/build/es/components/PeriodDimension/utils/fixedPeriods.js +6 -7
  361. package/build/es/components/PeriodDimension/utils/index.js +1 -5
  362. package/build/es/components/PivotTable/PivotTable.js +7 -8
  363. package/build/es/components/PivotTable/PivotTableBody.js +20 -29
  364. package/build/es/components/PivotTable/PivotTableCell.js +8 -12
  365. package/build/es/components/PivotTable/PivotTableClippedAxis.js +14 -17
  366. package/build/es/components/PivotTable/PivotTableColumnHeaderCell.js +7 -8
  367. package/build/es/components/PivotTable/PivotTableColumnHeaders.js +22 -29
  368. package/build/es/components/PivotTable/PivotTableContainer.js +5 -6
  369. package/build/es/components/PivotTable/PivotTableDimensionLabelCell.js +4 -5
  370. package/build/es/components/PivotTable/PivotTableEmptyCell.js +3 -4
  371. package/build/es/components/PivotTable/PivotTableEmptyRow.js +4 -5
  372. package/build/es/components/PivotTable/PivotTableEngineContext.js +4 -5
  373. package/build/es/components/PivotTable/PivotTableHead.js +13 -16
  374. package/build/es/components/PivotTable/PivotTableHeaderCell.js +8 -9
  375. package/build/es/components/PivotTable/PivotTableRow.js +20 -27
  376. package/build/es/components/PivotTable/PivotTableRowHeaderCell.js +5 -6
  377. package/build/es/components/PivotTable/PivotTableSortIcon.js +4 -5
  378. package/build/es/components/PivotTable/PivotTableTitleRow.js +18 -22
  379. package/build/es/components/PivotTable/PivotTableTitleRows.js +4 -5
  380. package/build/es/components/PivotTable/PivotTableValueCell.js +5 -6
  381. package/build/es/components/RichText/Editor/Editor.js +69 -83
  382. package/build/es/components/RichText/Editor/__tests__/Editor.spec.js +7 -8
  383. package/build/es/components/RichText/Parser/Parser.js +4 -8
  384. package/build/es/components/RichText/Parser/__tests__/MdParser.spec.js +1 -1
  385. package/build/es/components/RichText/Parser/__tests__/Parser.spec.js +21 -22
  386. package/build/es/components/Toolbar/HoverMenuBar/HoverMenuBar.js +20 -23
  387. package/build/es/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +7 -11
  388. package/build/es/components/Toolbar/HoverMenuBar/HoverMenuList.js +8 -15
  389. package/build/es/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +10 -14
  390. package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +57 -48
  391. package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuDropdown.spec.js +7 -7
  392. package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +27 -20
  393. package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuListItem.spec.js +21 -15
  394. package/build/es/components/Toolbar/HoverMenuBar/__tests__/__snapshots__/HoverMenuList.spec.js.snap +63 -0
  395. package/build/es/components/Toolbar/InterpretationsAndDetailsToggler.js +17 -21
  396. package/build/es/components/Toolbar/Toolbar.js +10 -16
  397. package/build/es/components/Toolbar/ToolbarSidebar.js +12 -18
  398. package/build/es/components/Toolbar/UpdateButton.js +18 -24
  399. package/build/es/components/Toolbar/__tests__/InterpretationsAndDetailsToggler.spec.js +18 -17
  400. package/build/es/components/Toolbar/__tests__/Toolbar.spec.js +7 -7
  401. package/build/es/components/Toolbar/__tests__/ToolbarSidebar.spec.js +13 -10
  402. package/build/es/components/Toolbar/__tests__/UpdateButton.spec.js +15 -13
  403. package/build/es/components/TransferOption.js +14 -15
  404. package/build/es/components/TranslationDialog/TranslationModal/LocalesSelect.js +19 -27
  405. package/build/es/components/TranslationDialog/TranslationModal/TranslationForm.js +16 -23
  406. package/build/es/components/TranslationDialog/TranslationModal/TranslationModal.js +8 -8
  407. package/build/es/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
  408. package/build/es/components/TranslationDialog/TranslationModal/__tests__/TranslationModal.spec.js +24 -15
  409. package/build/es/components/TranslationDialog/TranslationModal/useTranslationsResults.js +3 -4
  410. package/build/es/components/UserMention/UserList.js +6 -7
  411. package/build/es/components/UserMention/UserMentionWrapper.js +12 -18
  412. package/build/es/components/UserMention/useUserSearchResults.js +12 -16
  413. package/build/es/components/VisTypeIcon.js +5 -6
  414. package/build/es/locales/ar_IQ/translations.json +20 -11
  415. package/build/es/locales/cs/translations.json +2 -0
  416. package/build/es/locales/en/translations.json +1 -0
  417. package/build/es/locales/es/translations.json +2 -0
  418. package/build/es/locales/fr/translations.json +2 -0
  419. package/build/es/locales/id/translations.json +20 -11
  420. package/build/es/locales/lo/translations.json +2 -0
  421. package/build/es/locales/nb/translations.json +2 -0
  422. package/build/es/locales/prs/translations.json +2 -0
  423. package/build/es/locales/ps/translations.json +2 -0
  424. package/build/es/locales/pt/translations.json +2 -0
  425. package/build/es/locales/pt_BR/translations.json +2 -0
  426. package/build/es/locales/ru/translations.json +2 -0
  427. package/build/es/locales/si/translations.json +20 -11
  428. package/build/es/locales/sv/translations.json +20 -11
  429. package/build/es/locales/tet/translations.json +20 -11
  430. package/build/es/locales/tg/translations.json +2 -0
  431. package/build/es/locales/uk/translations.json +2 -0
  432. package/build/es/locales/ur/translations.json +2 -0
  433. package/build/es/locales/uz_UZ_Cyrl/translations.json +2 -0
  434. package/build/es/locales/uz_UZ_Latn/translations.json +4 -2
  435. package/build/es/locales/vi/translations.json +2 -0
  436. package/build/es/locales/zh/translations.json +2 -0
  437. package/build/es/locales/zh_CN/translations.json +17 -15
  438. package/build/es/modules/__tests__/expressions.spec.js +4 -5
  439. package/build/es/modules/__tests__/isNumeric.spec.js +31 -0
  440. package/build/es/modules/dimensionListItem.js +4 -5
  441. package/build/es/modules/expressions.js +3 -9
  442. package/build/es/modules/getPWAInstallationStatus.js +7 -9
  443. package/build/es/modules/layout/dimensionCreate.js +1 -3
  444. package/build/es/modules/layout/dimensionIsValid.js +3 -4
  445. package/build/es/modules/legends.js +5 -6
  446. package/build/es/modules/outliers/index.js +2 -3
  447. package/build/es/modules/outliers/iqr.js +4 -6
  448. package/build/es/modules/outliers/modZScore.js +6 -14
  449. package/build/es/modules/outliers/zScore.js +3 -4
  450. package/build/es/modules/pivotTable/AdaptiveClippingController.js +12 -16
  451. package/build/es/modules/pivotTable/PivotTableEngine.js +48 -59
  452. package/build/es/modules/pivotTable/clipAxis.js +7 -8
  453. package/build/es/modules/pivotTable/clipPartitionedAxis.js +9 -10
  454. package/build/es/modules/pivotTable/getHeaderForDisplay.js +8 -9
  455. package/build/es/modules/pivotTable/measureText.js +7 -9
  456. package/build/es/modules/pivotTable/useParentSize.js +1 -2
  457. package/build/es/modules/pivotTable/useScrollPosition.js +1 -2
  458. package/build/es/modules/pivotTable/useTableClipping.js +6 -7
  459. package/build/es/modules/relativeItems/index.js +1 -4
  460. package/build/es/modules/renderValue.js +1 -2
  461. package/build/es/modules/utils.js +9 -1
  462. package/build/es/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +3 -8
  463. package/build/es/visualizations/config/adapters/dhis_highcharts/axis.js +2 -5
  464. package/build/es/visualizations/config/adapters/dhis_highcharts/customAxes.js +2 -5
  465. package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/index.js +7 -8
  466. package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/getSingleValueBackgroundColor.js +1 -2
  467. package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/index.js +6 -7
  468. package/build/es/visualizations/config/adapters/dhis_highcharts/getFormatter.js +1 -1
  469. package/build/es/visualizations/config/adapters/dhis_highcharts/getSteps.js +1 -1
  470. package/build/es/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +3 -4
  471. package/build/es/visualizations/config/adapters/dhis_highcharts/index.js +7 -8
  472. package/build/es/visualizations/config/adapters/dhis_highcharts/legend.js +6 -7
  473. package/build/es/visualizations/config/adapters/dhis_highcharts/legendSet.js +22 -26
  474. package/build/es/visualizations/config/adapters/dhis_highcharts/plotOptions.js +8 -9
  475. package/build/es/visualizations/config/adapters/dhis_highcharts/series/index.js +18 -20
  476. package/build/es/visualizations/config/adapters/dhis_highcharts/series/pie.js +1 -4
  477. package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +1 -3
  478. package/build/es/visualizations/config/index.js +11 -12
  479. package/build/es/visualizations/config/validators/dhis/index.js +3 -4
  480. package/build/es/visualizations/index.js +1 -4
  481. package/build/es/visualizations/store/adapters/dhis_highcharts/index.js +7 -8
  482. package/build/es/visualizations/store/index.js +15 -17
  483. package/build/es/visualizations/store/validators/dhis/index.js +5 -6
  484. package/build/es/visualizations/util/getFilterText.js +3 -6
  485. package/build/es/visualizations/util/shouldUseContrastColor.js +1 -2
  486. package/package.json +13 -15
  487. package/build/cjs/components/OrgUnitDimension/__tests__/__snapshots__/OrgUnitDimension.spec.js.snap +0 -89
  488. package/build/cjs/components/PeriodDimension/__tests__/PeriodSelector.spec.js +0 -29
  489. package/build/cjs/components/PeriodDimension/__tests__/__snapshots__/FixedPeriodSingleSelect.spec.js.snap +0 -93
  490. package/build/cjs/components/PeriodDimension/__tests__/__snapshots__/PeriodDimension.spec.js.snap +0 -17
  491. package/build/cjs/components/PeriodDimension/__tests__/__snapshots__/PeriodSelector.spec.js.snap +0 -89
  492. package/build/es/components/OrgUnitDimension/__tests__/__snapshots__/OrgUnitDimension.spec.js.snap +0 -89
  493. package/build/es/components/PeriodDimension/__tests__/PeriodSelector.spec.js +0 -26
  494. package/build/es/components/PeriodDimension/__tests__/__snapshots__/FixedPeriodSingleSelect.spec.js.snap +0 -93
  495. package/build/es/components/PeriodDimension/__tests__/__snapshots__/PeriodDimension.spec.js.snap +0 -17
  496. package/build/es/components/PeriodDimension/__tests__/__snapshots__/PeriodSelector.spec.js.snap +0 -89
@@ -108,11 +108,10 @@ const buildDimensionLookup = (visualization, metadata, headers) => {
108
108
  dataHeaders
109
109
  };
110
110
  };
111
- const lookup = (dataRow, dimensionLookup, _ref) => {
112
- let {
113
- doColumnSubtotals,
114
- doRowSubtotals
115
- } = _ref;
111
+ const lookup = (dataRow, dimensionLookup, {
112
+ doColumnSubtotals,
113
+ doRowSubtotals
114
+ }) => {
116
115
  let row = 0;
117
116
  for (const headerIndex of dimensionLookup.rowHeaders) {
118
117
  const idx = dimensionLookup.headerDimensions[headerIndex].itemIds.indexOf(dataRow[headerIndex]);
@@ -142,15 +141,14 @@ const lookup = (dataRow, dimensionLookup, _ref) => {
142
141
  row
143
142
  };
144
143
  };
145
- const applyTotalAggregationType = (_ref2, overrideTotalAggregationType) => {
146
- let {
147
- totalAggregationType,
148
- value,
149
- numerator,
150
- denominator,
151
- multiplier,
152
- divisor
153
- } = _ref2;
144
+ const applyTotalAggregationType = ({
145
+ totalAggregationType,
146
+ value,
147
+ numerator,
148
+ denominator,
149
+ multiplier,
150
+ divisor
151
+ }, overrideTotalAggregationType) => {
154
152
  switch (overrideTotalAggregationType || totalAggregationType) {
155
153
  case AGGREGATE_TYPE_NA:
156
154
  return VALUE_NA;
@@ -209,12 +207,11 @@ export class PivotTableEngine {
209
207
  this.rowDepth = this.dimensionLookup.rows.length || (this.visualization.showDimensionLabels ? 1 : 0);
210
208
  this.buildMatrix();
211
209
  }
212
- getRaw(_ref3) {
210
+ getRaw({
211
+ row,
212
+ column
213
+ }) {
213
214
  var _headers$find, _headers$find2;
214
- let {
215
- row,
216
- column
217
- } = _ref3;
218
215
  const cellType = this.getRawCellType({
219
216
  row,
220
217
  column
@@ -300,18 +297,16 @@ export class PivotTableEngine {
300
297
  }
301
298
  return rawCell;
302
299
  }
303
- getCumulative(_ref4) {
304
- let {
305
- row,
306
- column
307
- } = _ref4;
300
+ getCumulative({
301
+ row,
302
+ column
303
+ }) {
308
304
  return this.accumulators.rows[row][column];
309
305
  }
310
- get(_ref5) {
311
- let {
312
- row,
313
- column
314
- } = _ref5;
306
+ get({
307
+ row,
308
+ column
309
+ }) {
315
310
  const mappedRow = this.rowMap[row],
316
311
  mappedColumn = this.columnMap[column];
317
312
  if (!mappedRow && mappedRow !== 0 || !mappedColumn && mappedColumn !== 0) {
@@ -322,11 +317,10 @@ export class PivotTableEngine {
322
317
  column: mappedColumn
323
318
  });
324
319
  }
325
- getRawCellType(_ref6) {
326
- let {
327
- row,
328
- column
329
- } = _ref6;
320
+ getRawCellType({
321
+ row,
322
+ column
323
+ }) {
330
324
  const isRowTotal = this.doRowTotals && column === this.dataWidth - 1;
331
325
  const isColumnTotal = this.doColumnTotals && row === this.dataHeight - 1;
332
326
  if (isRowTotal || isColumnTotal) {
@@ -339,11 +333,10 @@ export class PivotTableEngine {
339
333
  }
340
334
  return CELL_TYPE_VALUE;
341
335
  }
342
- getCellType(_ref7) {
343
- let {
344
- row,
345
- column
346
- } = _ref7;
336
+ getCellType({
337
+ row,
338
+ column
339
+ }) {
347
340
  row = this.rowMap[row];
348
341
  column = this.columnMap[column];
349
342
  return this.getRawCellType({
@@ -373,21 +366,19 @@ export class PivotTableEngine {
373
366
  return i18n.t(this.dimensionLookup.rows[rowLevel].meta.name);
374
367
  }
375
368
  }
376
- getCellDxDimension(_ref8) {
377
- let {
378
- row,
379
- column
380
- } = _ref8;
369
+ getCellDxDimension({
370
+ row,
371
+ column
372
+ }) {
381
373
  return this.getRawCellDxDimension({
382
374
  row: this.rowMap[row],
383
375
  column: this.columnMap[column]
384
376
  });
385
377
  }
386
- getRawCellDxDimension(_ref9) {
387
- let {
388
- row,
389
- column
390
- } = _ref9;
378
+ getRawCellDxDimension({
379
+ row,
380
+ column
381
+ }) {
391
382
  if (!this.data[row]) {
392
383
  return undefined;
393
384
  }
@@ -484,12 +475,11 @@ export class PivotTableEngine {
484
475
  getRowHeader(row) {
485
476
  return this.getRawRowHeader(this.rowMap[row]);
486
477
  }
487
- getDependantTotalCells(_ref10) {
478
+ getDependantTotalCells({
479
+ row,
480
+ column
481
+ }) {
488
482
  var _this$dimensionLookup, _this$dimensionLookup2;
489
- let {
490
- row,
491
- column
492
- } = _ref10;
493
483
  const rowSubtotalSize = ((_this$dimensionLookup = this.dimensionLookup.columns[0]) === null || _this$dimensionLookup === void 0 ? void 0 : _this$dimensionLookup.size) + 1;
494
484
  const rowSubtotal = rowSubtotalSize && this.doRowSubtotals && {
495
485
  row,
@@ -687,11 +677,10 @@ export class PivotTableEngine {
687
677
  // (numberType option default is VALUE)
688
678
  return visualization.numberType && visualization.numberType !== NUMBER_TYPE_VALUE && AGGREGATE_TYPE_SUM;
689
679
  }
690
- finalizeTotal(_ref11) {
691
- let {
692
- row,
693
- column
694
- } = _ref11;
680
+ finalizeTotal({
681
+ row,
682
+ column
683
+ }) {
695
684
  if (!this.data[row]) {
696
685
  return;
697
686
  }
@@ -1,12 +1,11 @@
1
1
  import times from 'lodash/times';
2
- export const clipAxis = _ref => {
3
- let {
4
- position,
5
- size,
6
- step,
7
- totalCount,
8
- headerCount
9
- } = _ref;
2
+ export const clipAxis = ({
3
+ position,
4
+ size,
5
+ step,
6
+ totalCount,
7
+ headerCount
8
+ }) => {
10
9
  // position: scroll Y position
11
10
  // size: height of table container
12
11
  // step: height of cell in px
@@ -1,13 +1,12 @@
1
- export const clipPartitionedAxis = _ref => {
2
- let {
3
- partitionSize,
4
- partitions,
5
- axisMap,
6
- widthMap,
7
- viewportWidth,
8
- viewportPosition,
9
- totalWidth
10
- } = _ref;
1
+ export const clipPartitionedAxis = ({
2
+ partitionSize,
3
+ partitions,
4
+ axisMap,
5
+ widthMap,
6
+ viewportWidth,
7
+ viewportPosition,
8
+ totalWidth
9
+ }) => {
11
10
  const partition = Math.floor(viewportPosition / partitionSize);
12
11
  if (partitions[partition] === undefined) {
13
12
  return {
@@ -6,15 +6,14 @@ const headerStacksAreEqual = (a, b, limit) => {
6
6
  }
7
7
  return true;
8
8
  };
9
- export const getHeaderForDisplay = _ref => {
10
- let {
11
- start,
12
- count,
13
- index,
14
- dimensionLevel,
15
- getHeader,
16
- showHierarchy
17
- } = _ref;
9
+ export const getHeaderForDisplay = ({
10
+ start,
11
+ count,
12
+ index,
13
+ dimensionLevel,
14
+ getHeader,
15
+ showHierarchy
16
+ }) => {
18
17
  const header = getHeader(index);
19
18
  const showHeader = index === start || !headerStacksAreEqual(header, getHeader(index - 1), dimensionLevel);
20
19
  if (!showHeader) {
@@ -8,19 +8,17 @@ const getContext = fontSize => {
8
8
  ctx.font = `${fontSize}px Roboto, Arial, sans-serif`;
9
9
  return ctx;
10
10
  };
11
- const measureText = function (text) {
12
- let fontSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 11;
11
+ const measureText = (text, fontSize = 11) => {
13
12
  const ctx = getContext(fontSize);
14
13
  const textMetrics = ctx.measureText(text);
15
14
  return textMetrics.width;
16
15
  };
17
- export const measureTextWithWrapping = (text, _ref) => {
18
- let {
19
- fontSize = 11,
20
- maxWidth = CLIPPED_CELL_MAX_SIZE,
21
- justifyBuffer = WRAPPED_TEXT_JUSTIFY_BUFFER,
22
- lineHeight = WRAPPED_TEXT_LINE_HEIGHT
23
- } = _ref;
16
+ export const measureTextWithWrapping = (text, {
17
+ fontSize = 11,
18
+ maxWidth = CLIPPED_CELL_MAX_SIZE,
19
+ justifyBuffer = WRAPPED_TEXT_JUSTIFY_BUFFER,
20
+ lineHeight = WRAPPED_TEXT_LINE_HEIGHT
21
+ }) => {
24
22
  if (!text) {
25
23
  return {
26
24
  width: 0,
@@ -4,8 +4,7 @@ const initialState = {
4
4
  width: 0,
5
5
  height: 0
6
6
  };
7
- export const useParentSize = function (elementRef, renderCounter) {
8
- let initialSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : initialState;
7
+ export const useParentSize = (elementRef, renderCounter, initialSize = initialState) => {
9
8
  const [size, setSize] = useState({
10
9
  width: initialSize.width || 0,
11
10
  height: initialSize.height || 0
@@ -1,7 +1,6 @@
1
1
  import debounce from 'lodash/debounce';
2
2
  import { useState, useCallback, useEffect } from 'react';
3
- export const useScrollPosition = function (containerRef) {
4
- let debounceWait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
3
+ export const useScrollPosition = (containerRef, debounceWait = 10) => {
5
4
  const [scrollPosition, setScrollPosition] = useState({
6
5
  x: 0,
7
6
  y: 0
@@ -2,13 +2,12 @@ import { useMemo } from 'react';
2
2
  import { clipPartitionedAxis } from './clipPartitionedAxis.js';
3
3
  import { CLIPPED_AXIS_PARTITION_SIZE_PX } from './pivotTableConstants.js';
4
4
  import { useScrollPosition } from './useScrollPosition.js';
5
- export const useTableClipping = _ref => {
6
- let {
7
- containerRef,
8
- width,
9
- height,
10
- engine
11
- } = _ref;
5
+ export const useTableClipping = ({
6
+ containerRef,
7
+ width,
8
+ height,
9
+ engine
10
+ }) => {
12
11
  const scrollPosition = useScrollPosition(containerRef);
13
12
  const lineHeight = engine.fontSize + engine.cellPadding * 2 + 2;
14
13
  const rows = useMemo(() => {
@@ -1,7 +1,4 @@
1
1
  import { getRelativePeriodIds } from '../../components/PeriodDimension/utils/relativePeriods.js';
2
2
  import { ouIdHelper, USER_ORG_UNIT, USER_ORG_UNIT_CHILDREN, USER_ORG_UNIT_GRANDCHILDREN } from '../ouIdHelper/index.js';
3
3
  import { DIMENSION_ID_ASSIGNED_CATEGORIES, DIMENSION_ID_ORGUNIT, DIMENSION_ID_PERIOD } from '../predefinedDimensions.js';
4
- export const hasRelativeItems = function (dimension) {
5
- let itemIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
6
- return 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));
7
- };
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));
@@ -1,8 +1,7 @@
1
1
  import { NUMBER_TYPE_ROW_PERCENTAGE, NUMBER_TYPE_COLUMN_PERCENTAGE } from './pivotTable/pivotTableConstants.js';
2
2
  import { isNumericValueType, isBooleanValueType } from './valueTypes.js';
3
3
  const trimTrailingZeros = stringValue => stringValue.replace(/\.?0+$/, '');
4
- export const separateDigitGroups = function (stringValue) {
5
- let decimalSeparator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.';
4
+ export const separateDigitGroups = (stringValue, decimalSeparator = '.') => {
6
5
  const isNegative = stringValue[0] === '-';
7
6
  const [integer, remainder] = stringValue.replace(/^-/, '').split('.');
8
7
  const groups = [];
@@ -20,4 +20,12 @@ export const useDidUpdateEffect = (fn, inputs) => {
20
20
  didMountRef.current = true;
21
21
  }
22
22
  }, inputs);
23
- };
23
+ };
24
+
25
+ /**
26
+ * Check if a value is numeric
27
+ *
28
+ * @param param Value to be checked
29
+ * @returns {boolean} Returns true when the `param` is a numeric value
30
+ */
31
+ export const isNumeric = param => typeof param !== 'symbol' && !isNaN(parseFloat(param)) && isFinite(param);
@@ -188,8 +188,7 @@ function gaussianElimination(a, o) {
188
188
  // N * Σ(X^2) - Σ(X)^2
189
189
  //
190
190
  // correlation = N * Σ(XY) - Σ(X) * Σ (Y) / √ ( N * Σ(X^2) - Σ(X) ) * ( N * Σ(Y^2) - Σ(Y)^2 ) ) )
191
- export function linear(data) {
192
- let decimalPlaces = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
191
+ export function linear(data, decimalPlaces = 2) {
193
192
  const sum = [0, 0, 0, 0, 0],
194
193
  results = [];
195
194
  let N = data.length;
@@ -238,10 +237,7 @@ export function linear(data) {
238
237
  }
239
238
 
240
239
  // Code extracted from https://github.com/Tom-Alexander/regression-js/
241
- function polynomial(data) {
242
- let order = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
243
- let extrapolate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
244
- let decimalPlaces = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;
240
+ function polynomial(data, order = 2, extrapolate = 0, decimalPlaces = 2) {
245
241
  const lhs = [],
246
242
  rhs = [],
247
243
  results = [],
@@ -322,8 +318,7 @@ function polynomial(data) {
322
318
  // Based on
323
319
  // - http://commons.apache.org/proper/commons-math/download_math.cgi LoesInterpolator.java
324
320
  // - https://gist.github.com/avibryant/1151823
325
- function loess(data) {
326
- let bandwidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.25;
321
+ function loess(data, bandwidth = 0.25) {
327
322
  const xval = data.map(pair => {
328
323
  return pair[0];
329
324
  });
@@ -1,7 +1,7 @@
1
- import isNumeric from 'd2-utilizr/lib/isNumeric';
2
1
  import isString from 'd2-utilizr/lib/isString';
3
2
  import objectClean from 'd2-utilizr/lib/objectClean';
4
3
  import { FONT_STYLE_AXIS_LABELS, FONT_STYLE_REGRESSION_LINE_LABEL, FONT_STYLE_OPTION_TEXT_COLOR, FONT_STYLE_OPTION_FONT_SIZE, FONT_STYLE_OPTION_BOLD, FONT_STYLE_OPTION_ITALIC, FONT_STYLE_OPTION_TEXT_ALIGN, TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, TEXT_ALIGN_RIGHT, mergeFontStyleWithDefault } from '../../../../modules/fontStyle.js';
4
+ import { isNumeric } from '../../../../modules/utils.js';
5
5
  import { isVerticalType } from '../../../../modules/visTypes.js';
6
6
  import getFormatter from './getFormatter.js';
7
7
  import { getTextAlignOption } from './getTextAlignOption.js';
@@ -68,11 +68,8 @@ export const getMaxValue = (maxValue, dataValues, outlierLineMax) => {
68
68
  }
69
69
  return dataValues !== null && dataValues !== void 0 && dataValues.every(value => value < DEFAULT_MIN_VALUE) ? DEFAULT_MIN_VALUE : undefined;
70
70
  };
71
- export const getRegressionLine = function () {
71
+ export const getRegressionLine = (regressionLine = {}, visType, isVertical) => {
72
72
  var _regressionLine$title, _regressionLine$title2;
73
- let regressionLine = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
74
- let visType = arguments.length > 1 ? arguments[1] : undefined;
75
- let isVertical = arguments.length > 2 ? arguments[2] : undefined;
76
73
  const fontStyle = mergeFontStyleWithDefault((_regressionLine$title = regressionLine.title) === null || _regressionLine$title === void 0 ? void 0 : _regressionLine$title.fontStyle, FONT_STYLE_REGRESSION_LINE_LABEL);
77
74
  const plotLineStyle = getPlotLineStyle(fontStyle);
78
75
  const plotLineLabelStyle = getPlotLineLabelStyle(fontStyle);
@@ -12,9 +12,7 @@ export function getIdAxisMap(customAxes) {
12
12
  return map;
13
13
  }, {});
14
14
  }
15
- export function getFullIdAxisMap() {
16
- let customAxes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
17
- let series = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
15
+ export function getFullIdAxisMap(customAxes = [], series = []) {
18
16
  const idAxisMap = getIdAxisMap(customAxes.filter(axisItem => series.find(seriesItem => seriesItem.id === axisItem.dimensionItem)));
19
17
 
20
18
  // adds first axis ids to seriesAxisMap
@@ -33,8 +31,7 @@ export function getFullIdAxisMap() {
33
31
  // }
34
32
  export function getAxisIdsMap(customAxes, series) {
35
33
  const fullIdAxisMap = getFullIdAxisMap(customAxes, series);
36
- return Object.entries(fullIdAxisMap).reduce((map, _ref) => {
37
- let [id, axis] = _ref;
34
+ return Object.entries(fullIdAxisMap).reduce((map, [id, axis]) => {
38
35
  if (!(axis in map)) {
39
36
  map[axis] = [];
40
37
  }
@@ -1,13 +1,12 @@
1
1
  import { VIS_TYPE_SINGLE_VALUE } from '../../../../../modules/visTypes.js';
2
2
  import getSingleValueCustomSVGOptions from './singleValue/index.js';
3
- export default function getCustomSVGOptions(_ref) {
4
- let {
5
- extraConfig,
6
- layout,
7
- extraOptions,
8
- metaData,
9
- series
10
- } = _ref;
3
+ export default function getCustomSVGOptions({
4
+ extraConfig,
5
+ layout,
6
+ extraOptions,
7
+ metaData,
8
+ series
9
+ }) {
11
10
  const baseOptions = {
12
11
  visualizationType: layout.type
13
12
  };
@@ -1,7 +1,6 @@
1
1
  import { LEGEND_DISPLAY_STYLE_FILL } from '../../../../../../modules/legends.js';
2
2
  import { getSingleValueLegendColor } from './getSingleValueLegendColor.js';
3
- export function getSingleValueBackgroundColor(legendOptions, legendSets, value) {
4
- let defaultColor = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'transparent';
3
+ export function getSingleValueBackgroundColor(legendOptions, legendSets, value, defaultColor = 'transparent') {
5
4
  const legendColor = getSingleValueLegendColor(legendOptions, legendSets, value);
6
5
  return legendColor && legendOptions.style === LEGEND_DISPLAY_STYLE_FILL ? legendColor : defaultColor;
7
6
  }
@@ -2,13 +2,12 @@ import { colors } from '@dhis2/ui';
2
2
  import { getSingleValueFormattedValue } from './getSingleValueFormattedValue.js';
3
3
  import { getSingleValueSubtext } from './getSingleValueSubtext.js';
4
4
  import { getSingleValueTextColor } from './getSingleValueTextColor.js';
5
- export default function getSingleValueCustomSVGOptions(_ref) {
6
- let {
7
- layout,
8
- extraOptions,
9
- metaData,
10
- series
11
- } = _ref;
5
+ export default function getSingleValueCustomSVGOptions({
6
+ layout,
7
+ extraOptions,
8
+ metaData,
9
+ series
10
+ }) {
12
11
  const {
13
12
  dashboard,
14
13
  icon
@@ -1,4 +1,4 @@
1
- import isNumeric from 'd2-utilizr/lib/isNumeric';
1
+ import { isNumeric } from '../../../../modules/utils.js';
2
2
  export default function (axis) {
3
3
  const decimals = axis.decimals;
4
4
  return isNumeric(decimals) ? {
@@ -1,4 +1,4 @@
1
- import isNumeric from 'd2-utilizr/lib/isNumeric';
1
+ import { isNumeric } from '../../../../modules/utils.js';
2
2
  export default function (axis) {
3
3
  const steps = axis.steps;
4
4
  return isNumeric(steps) ? steps : undefined;
@@ -14,10 +14,9 @@ function getEmptySeriesIndexes(series) {
14
14
  let seriesValues;
15
15
  series[0].data.forEach((value, index) => {
16
16
  seriesValues = [];
17
- series.forEach(_ref => {
18
- let {
19
- data
20
- } = _ref;
17
+ series.forEach(({
18
+ data
19
+ }) => {
21
20
  // handle undefined values due to empty (or shorter) serie data
22
21
  // preserve 0 as valid value
23
22
  seriesValues.push(data[index] === undefined ? null : data[index]);
@@ -33,15 +33,14 @@ const getTransformedExtraOptions = extraOptions => ({
33
33
  ...extraOptions,
34
34
  multiAxisTheme: extraOptions.multiAxisTheme || defaultMultiAxisTheme1
35
35
  });
36
- export default function (_ref) {
36
+ export default function ({
37
+ store,
38
+ layout,
39
+ el,
40
+ extraConfig,
41
+ extraOptions
42
+ }) {
37
43
  var _layout$legend, _layout$seriesKey, _layout$seriesKey2, _layout$seriesKey2$la, _config$xAxis;
38
- let {
39
- store,
40
- layout,
41
- el,
42
- extraConfig,
43
- extraOptions
44
- } = _ref;
45
44
  const _layout = getTransformedLayout(layout);
46
45
  const _extraOptions = getTransformedExtraOptions(extraOptions);
47
46
  const stacked = isStacked(_layout.type);
@@ -27,13 +27,12 @@ function getLegend(fontStyle, dashboard, visType) {
27
27
  align: getTextAlignOption(fontStyle[FONT_STYLE_OPTION_TEXT_ALIGN], FONT_STYLE_LEGEND, isVerticalType(visType))
28
28
  });
29
29
  }
30
- export default function (_ref) {
31
- let {
32
- isHidden,
33
- fontStyle,
34
- visType,
35
- dashboard
36
- } = _ref;
30
+ export default function ({
31
+ isHidden,
32
+ fontStyle,
33
+ visType,
34
+ dashboard
35
+ }) {
37
36
  const mergedFontStyle = mergeFontStyleWithDefault(fontStyle, FONT_STYLE_LEGEND);
38
37
  return isHidden || visType === VIS_TYPE_SCATTER ? {
39
38
  enabled: false
@@ -1,33 +1,29 @@
1
- import isNumeric from 'd2-utilizr/lib/isNumeric';
2
1
  import i18n from '../../../../locales/index.js';
3
2
  import { getLegendByValueFromLegendSet } from '../../../../modules/legends.js';
3
+ import { isNumeric } from '../../../../modules/utils.js';
4
4
  const OUT_OF_BOUNDS_COLOR = '#CCCCCC';
5
5
  const getLegend = (value, legendSet) => value && legendSet ? getLegendByValueFromLegendSet(legendSet, value) : {};
6
- export const applyLegendSet = function () {
7
- let seriesObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8
- let legendSet = arguments.length > 1 ? arguments[1] : undefined;
9
- return !seriesObj.type ? {
10
- ...seriesObj,
11
- data: seriesObj.data.map(value => {
12
- var _getLegend, _getLegend2, _getLegend3, _getLegend4;
13
- return isNumeric(value) // Single category pass data as [value1, value2]
14
- ? {
15
- y: value,
16
- color: ((_getLegend = getLegend(value, legendSet)) === null || _getLegend === void 0 ? void 0 : _getLegend.color) || OUT_OF_BOUNDS_COLOR,
17
- legend: ((_getLegend2 = getLegend(value, legendSet)) === null || _getLegend2 === void 0 ? void 0 : _getLegend2.name) || '-',
18
- legendSet: legendSet.name
19
- } : Array.isArray(value) // Dual category pass data as [[position1, value1], [position2, value2]]
20
- ? {
21
- x: value[0],
22
- y: value[1],
23
- color: ((_getLegend3 = getLegend(value[1], legendSet)) === null || _getLegend3 === void 0 ? void 0 : _getLegend3.color) || OUT_OF_BOUNDS_COLOR,
24
- legend: ((_getLegend4 = getLegend(value[1], legendSet)) === null || _getLegend4 === void 0 ? void 0 : _getLegend4.name) || '-',
25
- legendSet: legendSet.name
26
- } : value;
27
- })
28
- } : {
29
- ...seriesObj
30
- };
6
+ export const applyLegendSet = (seriesObj = {}, legendSet) => !seriesObj.type ? {
7
+ ...seriesObj,
8
+ data: seriesObj.data.map(value => {
9
+ var _getLegend, _getLegend2, _getLegend3, _getLegend4;
10
+ return isNumeric(value) // Single category pass data as [value1, value2]
11
+ ? {
12
+ y: value,
13
+ color: ((_getLegend = getLegend(value, legendSet)) === null || _getLegend === void 0 ? void 0 : _getLegend.color) || OUT_OF_BOUNDS_COLOR,
14
+ legend: ((_getLegend2 = getLegend(value, legendSet)) === null || _getLegend2 === void 0 ? void 0 : _getLegend2.name) || '-',
15
+ legendSet: legendSet.name
16
+ } : Array.isArray(value) // Dual category pass data as [[position1, value1], [position2, value2]]
17
+ ? {
18
+ x: value[0],
19
+ y: value[1],
20
+ color: ((_getLegend3 = getLegend(value[1], legendSet)) === null || _getLegend3 === void 0 ? void 0 : _getLegend3.color) || OUT_OF_BOUNDS_COLOR,
21
+ legend: ((_getLegend4 = getLegend(value[1], legendSet)) === null || _getLegend4 === void 0 ? void 0 : _getLegend4.name) || '-',
22
+ legendSet: legendSet.name
23
+ } : value;
24
+ })
25
+ } : {
26
+ ...seriesObj
31
27
  };
32
28
  export const getLegendSetTooltip = () => ({
33
29
  pointFormatter: function () {
@@ -1,15 +1,14 @@
1
1
  import i18n from '../../../../locales/index.js';
2
2
  import { VIS_TYPE_COLUMN, VIS_TYPE_SCATTER, VIS_TYPE_STACKED_COLUMN, VIS_TYPE_BAR, VIS_TYPE_STACKED_BAR } from '../../../../modules/visTypes.js';
3
3
  const MAX_LABELS = 10;
4
- export default _ref => {
5
- let {
6
- visType,
7
- xAxisName,
8
- yAxisName,
9
- showLabels,
10
- tooltipData,
11
- onClick
12
- } = _ref;
4
+ export default ({
5
+ visType,
6
+ xAxisName,
7
+ yAxisName,
8
+ showLabels,
9
+ tooltipData,
10
+ onClick
11
+ }) => {
13
12
  const series = {
14
13
  dataLabels: {
15
14
  enabled: showLabels,