@dhis2/analytics 28.0.2 → 28.0.4

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 (452) hide show
  1. package/build/cjs/__demo__/DataDimension.stories.js +3 -4
  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 +2 -2
  5. package/build/cjs/__demo__/OrgUnitDimension.stories.js +3 -4
  6. package/build/cjs/__demo__/PeriodDimension.stories.js +2 -2
  7. package/build/cjs/__demo__/PivotTable.stories.js +166 -224
  8. package/build/cjs/__demo__/ScatterPlotPdfExport.stories.js +1 -2
  9. package/build/cjs/__demo__/SingleValue.stories.js +1 -2
  10. package/build/cjs/__demo__/Toolbar.stories.js +1 -2
  11. package/build/cjs/api/__tests__/dimensions.spec.js +1 -2
  12. package/build/cjs/api/analytics/Analytics.js +8 -9
  13. package/build/cjs/api/analytics/AnalyticsBase.js +58 -77
  14. package/build/cjs/api/analytics/AnalyticsRequest.js +1 -2
  15. package/build/cjs/api/analytics/AnalyticsRequestBase.js +18 -21
  16. package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +19 -38
  17. package/build/cjs/api/analytics/AnalyticsResponseHeader.js +5 -7
  18. package/build/cjs/api/analytics/__tests__/AnalyticsBase.spec.js +9 -12
  19. package/build/cjs/api/analytics/__tests__/AnalyticsRequest.spec.js +8 -2
  20. package/build/cjs/api/analytics/utils.js +11 -17
  21. package/build/cjs/api/dimensions.js +119 -148
  22. package/build/cjs/api/expression.js +39 -60
  23. package/build/cjs/api/organisationUnits.js +23 -35
  24. package/build/cjs/components/AboutAOUnit/AboutAOUnit.js +12 -20
  25. package/build/cjs/components/CachedDataQueryProvider.js +7 -9
  26. package/build/cjs/components/DashboardPluginWrapper/DashboardPluginWrapper.js +18 -22
  27. package/build/cjs/components/DataDimension/Calculation/CalculationModal.js +44 -61
  28. package/build/cjs/components/DataDimension/Calculation/DataElementOption.js +5 -6
  29. package/build/cjs/components/DataDimension/Calculation/DataElementSelector.js +29 -38
  30. package/build/cjs/components/DataDimension/Calculation/DndContext.js +29 -37
  31. package/build/cjs/components/DataDimension/Calculation/DraggingItem.js +5 -6
  32. package/build/cjs/components/DataDimension/Calculation/DropZone.js +4 -5
  33. package/build/cjs/components/DataDimension/Calculation/FormulaField.js +29 -32
  34. package/build/cjs/components/DataDimension/Calculation/FormulaItem.js +14 -16
  35. package/build/cjs/components/DataDimension/Calculation/MathOperatorSelector.js +23 -29
  36. package/build/cjs/components/DataDimension/Calculation/Operator.js +6 -7
  37. package/build/cjs/components/DataDimension/DataDimension.js +20 -32
  38. package/build/cjs/components/DataDimension/Info/CalculationInfo.js +14 -22
  39. package/build/cjs/components/DataDimension/Info/DataElementInfo.js +23 -36
  40. package/build/cjs/components/DataDimension/Info/DataElementOperandInfo.js +30 -44
  41. package/build/cjs/components/DataDimension/Info/DataSetInfo.js +26 -39
  42. package/build/cjs/components/DataDimension/Info/EventDataItemInfo.js +21 -34
  43. package/build/cjs/components/DataDimension/Info/IndicatorInfo.js +21 -32
  44. package/build/cjs/components/DataDimension/Info/InfoPopover.js +6 -7
  45. package/build/cjs/components/DataDimension/Info/InfoTable.js +39 -52
  46. package/build/cjs/components/DataDimension/Info/OptionInfo.js +13 -20
  47. package/build/cjs/components/DataDimension/Info/ProgramIndicatorInfo.js +46 -58
  48. package/build/cjs/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +22 -32
  49. package/build/cjs/components/DataDimension/ItemSelector/DataTypeSelector.js +6 -7
  50. package/build/cjs/components/DataDimension/ItemSelector/DetailSelector.js +5 -6
  51. package/build/cjs/components/DataDimension/ItemSelector/GroupSelector.js +10 -12
  52. package/build/cjs/components/DataDimension/ItemSelector/ItemSelector.js +86 -104
  53. package/build/cjs/components/DataDimension/ItemSelector/MetricSelector.js +5 -6
  54. package/build/cjs/components/DataDimension/SourceEmptyPlaceholder.js +10 -13
  55. package/build/cjs/components/DataDimension/TransferOption.js +35 -39
  56. package/build/cjs/components/DimensionMenu.js +13 -14
  57. package/build/cjs/components/DimensionsPanel/DimensionsPanel.js +8 -9
  58. package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +12 -13
  59. package/build/cjs/components/DimensionsPanel/List/DimensionList.js +9 -10
  60. package/build/cjs/components/DimensionsPanel/List/OptionsButton.js +8 -11
  61. package/build/cjs/components/DimensionsPanel/List/RecommendedIcon.js +10 -13
  62. package/build/cjs/components/DynamicDimension/DynamicDimension.js +9 -13
  63. package/build/cjs/components/DynamicDimension/ItemSelector.js +25 -38
  64. package/build/cjs/components/FileMenu/DeleteDialog.js +11 -16
  65. package/build/cjs/components/FileMenu/FileMenu.js +19 -30
  66. package/build/cjs/components/FileMenu/GetLinkDialog.js +7 -7
  67. package/build/cjs/components/FileMenu/RenameDialog.js +13 -21
  68. package/build/cjs/components/FileMenu/SaveAsDialog.js +13 -21
  69. package/build/cjs/components/FileMenu/__tests__/FileMenu.spec.js +6 -2
  70. package/build/cjs/components/FileMenu/__tests__/GetLinkDialog.spec.js +7 -8
  71. package/build/cjs/components/FileMenu/utils.js +10 -12
  72. package/build/cjs/components/Filter/Filter.js +21 -27
  73. package/build/cjs/components/Interpretations/InterpretationModal/Comment.js +8 -10
  74. package/build/cjs/components/Interpretations/InterpretationModal/CommentAddForm.js +10 -15
  75. package/build/cjs/components/Interpretations/InterpretationModal/CommentDeleteButton.js +10 -15
  76. package/build/cjs/components/Interpretations/InterpretationModal/CommentUpdateForm.js +12 -17
  77. package/build/cjs/components/Interpretations/InterpretationModal/InterpretationModal.js +19 -25
  78. package/build/cjs/components/Interpretations/InterpretationModal/InterpretationThread.js +12 -14
  79. package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationForm.js +12 -17
  80. package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationList.js +10 -11
  81. package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +23 -33
  82. package/build/cjs/components/Interpretations/common/Interpretation/Interpretation.js +13 -15
  83. package/build/cjs/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +7 -11
  84. package/build/cjs/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +5 -7
  85. package/build/cjs/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +15 -23
  86. package/build/cjs/components/Interpretations/common/Interpretation/useLike.js +5 -6
  87. package/build/cjs/components/Interpretations/common/Message/Message.js +6 -7
  88. package/build/cjs/components/Interpretations/common/Message/MessageButtonStrip.js +8 -11
  89. package/build/cjs/components/Interpretations/common/Message/MessageEditorContainer.js +18 -21
  90. package/build/cjs/components/Interpretations/common/Message/MessageIconButton.js +34 -40
  91. package/build/cjs/components/Interpretations/common/Message/MessageInput.js +1 -2
  92. package/build/cjs/components/Interpretations/common/Message/MessageStatsBar.js +8 -11
  93. package/build/cjs/components/LegendKey/LegendKey.js +3 -4
  94. package/build/cjs/components/OfflineTooltip.js +18 -26
  95. package/build/cjs/components/OpenFileDialog/CreatedByFilter.js +20 -26
  96. package/build/cjs/components/OpenFileDialog/CustomSelectOption.js +23 -26
  97. package/build/cjs/components/OpenFileDialog/DateField.js +3 -4
  98. package/build/cjs/components/OpenFileDialog/FileList.js +19 -22
  99. package/build/cjs/components/OpenFileDialog/NameFilter.js +15 -21
  100. package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +36 -45
  101. package/build/cjs/components/OpenFileDialog/PaginationControls.js +22 -28
  102. package/build/cjs/components/OpenFileDialog/VisTypeFilter.js +28 -37
  103. package/build/cjs/components/Options/VisualizationOptions.js +35 -46
  104. package/build/cjs/components/OrgUnitDimension/OrgUnitDimension.js +38 -60
  105. package/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +16 -25
  106. package/build/cjs/components/PeriodDimension/FixedPeriodSelect.js +15 -21
  107. package/build/cjs/components/PeriodDimension/PeriodDimension.js +9 -12
  108. package/build/cjs/components/PeriodDimension/PeriodTransfer.js +49 -63
  109. package/build/cjs/components/PeriodDimension/RelativePeriodFilter.js +24 -30
  110. package/build/cjs/components/PeriodDimension/__tests__/__snapshots__/FixedPeriodSingleSelect.spec.js.snap +0 -1
  111. package/build/cjs/components/PeriodDimension/__tests__/__snapshots__/PeriodDimension.spec.js.snap +0 -1
  112. package/build/cjs/components/PeriodDimension/utils/fixedPeriods.js +6 -7
  113. package/build/cjs/components/PeriodDimension/utils/index.js +1 -5
  114. package/build/cjs/components/PivotTable/PivotTable.js +8 -10
  115. package/build/cjs/components/PivotTable/PivotTableBody.js +20 -29
  116. package/build/cjs/components/PivotTable/PivotTableCell.js +8 -12
  117. package/build/cjs/components/PivotTable/PivotTableClippedAxis.js +14 -17
  118. package/build/cjs/components/PivotTable/PivotTableColumnHeaderCell.js +7 -8
  119. package/build/cjs/components/PivotTable/PivotTableColumnHeaders.js +22 -29
  120. package/build/cjs/components/PivotTable/PivotTableContainer.js +5 -6
  121. package/build/cjs/components/PivotTable/PivotTableDimensionLabelCell.js +4 -5
  122. package/build/cjs/components/PivotTable/PivotTableEmptyCell.js +3 -4
  123. package/build/cjs/components/PivotTable/PivotTableEmptyRow.js +4 -5
  124. package/build/cjs/components/PivotTable/PivotTableEngineContext.js +5 -7
  125. package/build/cjs/components/PivotTable/PivotTableHead.js +13 -16
  126. package/build/cjs/components/PivotTable/PivotTableHeaderCell.js +8 -9
  127. package/build/cjs/components/PivotTable/PivotTableRow.js +20 -27
  128. package/build/cjs/components/PivotTable/PivotTableRowHeaderCell.js +5 -6
  129. package/build/cjs/components/PivotTable/PivotTableSortIcon.js +4 -5
  130. package/build/cjs/components/PivotTable/PivotTableTitleRow.js +19 -24
  131. package/build/cjs/components/PivotTable/PivotTableTitleRows.js +4 -5
  132. package/build/cjs/components/PivotTable/PivotTableValueCell.js +6 -8
  133. package/build/cjs/components/RichText/Editor/Editor.js +70 -85
  134. package/build/cjs/components/RichText/Parser/Parser.js +5 -10
  135. package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuBar.js +20 -24
  136. package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +8 -13
  137. package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuList.js +9 -17
  138. package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +11 -16
  139. package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +4 -5
  140. package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +13 -11
  141. package/build/cjs/components/Toolbar/InterpretationsAndDetailsToggler.js +15 -21
  142. package/build/cjs/components/Toolbar/Toolbar.js +10 -16
  143. package/build/cjs/components/Toolbar/ToolbarSidebar.js +12 -18
  144. package/build/cjs/components/Toolbar/UpdateButton.js +18 -24
  145. package/build/cjs/components/TransferOption.js +14 -15
  146. package/build/cjs/components/TranslationDialog/TranslationModal/LocalesSelect.js +19 -27
  147. package/build/cjs/components/TranslationDialog/TranslationModal/TranslationForm.js +17 -25
  148. package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModal.js +8 -10
  149. package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
  150. package/build/cjs/components/TranslationDialog/TranslationModal/__tests__/TranslationModal.spec.js +52 -0
  151. package/build/cjs/components/TranslationDialog/TranslationModal/useTranslationsResults.js +3 -4
  152. package/build/cjs/components/UserMention/UserList.js +6 -7
  153. package/build/cjs/components/UserMention/UserMentionWrapper.js +13 -20
  154. package/build/cjs/components/UserMention/useUserSearchResults.js +12 -16
  155. package/build/cjs/components/VisTypeIcon.js +5 -6
  156. package/build/cjs/index.js +38 -39
  157. package/build/cjs/locales/ar_IQ/translations.json +20 -11
  158. package/build/cjs/locales/cs/translations.json +2 -0
  159. package/build/cjs/locales/en/translations.json +1 -0
  160. package/build/cjs/locales/es/translations.json +2 -0
  161. package/build/cjs/locales/fr/translations.json +2 -0
  162. package/build/cjs/locales/id/translations.json +20 -11
  163. package/build/cjs/locales/index.js +62 -62
  164. package/build/cjs/locales/lo/translations.json +2 -0
  165. package/build/cjs/locales/nb/translations.json +2 -0
  166. package/build/cjs/locales/prs/translations.json +2 -0
  167. package/build/cjs/locales/ps/translations.json +2 -0
  168. package/build/cjs/locales/pt/translations.json +2 -0
  169. package/build/cjs/locales/pt_BR/translations.json +2 -0
  170. package/build/cjs/locales/ru/translations.json +2 -0
  171. package/build/cjs/locales/si/translations.json +20 -11
  172. package/build/cjs/locales/sv/translations.json +20 -11
  173. package/build/cjs/locales/tet/translations.json +20 -11
  174. package/build/cjs/locales/tg/translations.json +2 -0
  175. package/build/cjs/locales/uk/translations.json +2 -0
  176. package/build/cjs/locales/ur/translations.json +2 -0
  177. package/build/cjs/locales/uz_UZ_Cyrl/translations.json +2 -0
  178. package/build/cjs/locales/uz_UZ_Latn/translations.json +4 -2
  179. package/build/cjs/locales/vi/translations.json +2 -0
  180. package/build/cjs/locales/zh/translations.json +2 -0
  181. package/build/cjs/locales/zh_CN/translations.json +17 -15
  182. package/build/cjs/modules/__tests__/expressions.spec.js +4 -5
  183. package/build/cjs/modules/__tests__/isNumeric.spec.js +33 -0
  184. package/build/cjs/modules/dimensionListItem.js +4 -5
  185. package/build/cjs/modules/expressions.js +3 -9
  186. package/build/cjs/modules/getPWAInstallationStatus.js +7 -9
  187. package/build/cjs/modules/layout/dimensionCreate.js +1 -3
  188. package/build/cjs/modules/layout/dimensionIsValid.js +3 -4
  189. package/build/cjs/modules/legends.js +5 -6
  190. package/build/cjs/modules/outliers/index.js +5 -6
  191. package/build/cjs/modules/outliers/iqr.js +4 -6
  192. package/build/cjs/modules/outliers/modZScore.js +6 -14
  193. package/build/cjs/modules/outliers/zScore.js +3 -4
  194. package/build/cjs/modules/pivotTable/AdaptiveClippingController.js +12 -16
  195. package/build/cjs/modules/pivotTable/PivotTableEngine.js +48 -59
  196. package/build/cjs/modules/pivotTable/clipAxis.js +7 -8
  197. package/build/cjs/modules/pivotTable/clipPartitionedAxis.js +9 -10
  198. package/build/cjs/modules/pivotTable/getHeaderForDisplay.js +8 -9
  199. package/build/cjs/modules/pivotTable/measureText.js +7 -9
  200. package/build/cjs/modules/pivotTable/useParentSize.js +1 -2
  201. package/build/cjs/modules/pivotTable/useScrollPosition.js +1 -2
  202. package/build/cjs/modules/pivotTable/useTableClipping.js +6 -7
  203. package/build/cjs/modules/relativeItems/index.js +1 -4
  204. package/build/cjs/modules/renderValue.js +1 -2
  205. package/build/cjs/modules/utils.js +11 -2
  206. package/build/cjs/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +3 -8
  207. package/build/cjs/visualizations/config/adapters/dhis_highcharts/axis.js +7 -10
  208. package/build/cjs/visualizations/config/adapters/dhis_highcharts/customAxes.js +2 -5
  209. package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/index.js +7 -8
  210. package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/getSingleValueBackgroundColor.js +1 -2
  211. package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/index.js +6 -7
  212. package/build/cjs/visualizations/config/adapters/dhis_highcharts/getFormatter.js +2 -3
  213. package/build/cjs/visualizations/config/adapters/dhis_highcharts/getSteps.js +2 -3
  214. package/build/cjs/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +3 -4
  215. package/build/cjs/visualizations/config/adapters/dhis_highcharts/index.js +8 -10
  216. package/build/cjs/visualizations/config/adapters/dhis_highcharts/legend.js +6 -7
  217. package/build/cjs/visualizations/config/adapters/dhis_highcharts/legendSet.js +22 -26
  218. package/build/cjs/visualizations/config/adapters/dhis_highcharts/plotOptions.js +8 -9
  219. package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/index.js +18 -20
  220. package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/pie.js +1 -4
  221. package/build/cjs/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +1 -2
  222. package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +1 -3
  223. package/build/cjs/visualizations/config/index.js +11 -12
  224. package/build/cjs/visualizations/config/validators/dhis/index.js +3 -4
  225. package/build/cjs/visualizations/index.js +1 -4
  226. package/build/cjs/visualizations/store/adapters/dhis_highcharts/index.js +7 -8
  227. package/build/cjs/visualizations/store/index.js +15 -17
  228. package/build/cjs/visualizations/store/validators/dhis/index.js +5 -6
  229. package/build/cjs/visualizations/util/getFilterText.js +3 -6
  230. package/build/cjs/visualizations/util/shouldUseContrastColor.js +1 -2
  231. package/build/es/__demo__/DataDimension.stories.js +2 -2
  232. package/build/es/__demo__/OpenFileDialog.stories.js +2 -2
  233. package/build/es/__demo__/OrgUnitDimension.stories.js +2 -2
  234. package/build/es/__demo__/PeriodDimension.stories.js +2 -2
  235. package/build/es/__demo__/PivotTable.stories.js +165 -222
  236. package/build/es/api/__tests__/dimensions.spec.js +1 -2
  237. package/build/es/api/analytics/Analytics.js +8 -9
  238. package/build/es/api/analytics/AnalyticsBase.js +58 -77
  239. package/build/es/api/analytics/AnalyticsRequest.js +1 -2
  240. package/build/es/api/analytics/AnalyticsRequestBase.js +18 -21
  241. package/build/es/api/analytics/AnalyticsRequestPropertiesMixin.js +19 -38
  242. package/build/es/api/analytics/AnalyticsResponseHeader.js +5 -7
  243. package/build/es/api/analytics/__tests__/AnalyticsBase.spec.js +8 -10
  244. package/build/es/api/analytics/__tests__/AnalyticsRequest.spec.js +8 -2
  245. package/build/es/api/analytics/utils.js +11 -17
  246. package/build/es/api/dimensions.js +119 -148
  247. package/build/es/api/expression.js +39 -60
  248. package/build/es/api/organisationUnits.js +23 -35
  249. package/build/es/components/AboutAOUnit/AboutAOUnit.js +11 -18
  250. package/build/es/components/CachedDataQueryProvider.js +6 -7
  251. package/build/es/components/DashboardPluginWrapper/DashboardPluginWrapper.js +17 -20
  252. package/build/es/components/DataDimension/Calculation/CalculationModal.js +43 -59
  253. package/build/es/components/DataDimension/Calculation/DataElementOption.js +5 -6
  254. package/build/es/components/DataDimension/Calculation/DataElementSelector.js +28 -36
  255. package/build/es/components/DataDimension/Calculation/DndContext.js +28 -35
  256. package/build/es/components/DataDimension/Calculation/DraggingItem.js +5 -6
  257. package/build/es/components/DataDimension/Calculation/DropZone.js +4 -5
  258. package/build/es/components/DataDimension/Calculation/FormulaField.js +29 -32
  259. package/build/es/components/DataDimension/Calculation/FormulaItem.js +13 -14
  260. package/build/es/components/DataDimension/Calculation/MathOperatorSelector.js +23 -29
  261. package/build/es/components/DataDimension/Calculation/Operator.js +6 -7
  262. package/build/es/components/DataDimension/DataDimension.js +19 -30
  263. package/build/es/components/DataDimension/Info/CalculationInfo.js +13 -20
  264. package/build/es/components/DataDimension/Info/DataElementInfo.js +23 -36
  265. package/build/es/components/DataDimension/Info/DataElementOperandInfo.js +29 -42
  266. package/build/es/components/DataDimension/Info/DataSetInfo.js +26 -39
  267. package/build/es/components/DataDimension/Info/EventDataItemInfo.js +21 -34
  268. package/build/es/components/DataDimension/Info/IndicatorInfo.js +20 -30
  269. package/build/es/components/DataDimension/Info/InfoPopover.js +6 -7
  270. package/build/es/components/DataDimension/Info/InfoTable.js +39 -52
  271. package/build/es/components/DataDimension/Info/OptionInfo.js +13 -20
  272. package/build/es/components/DataDimension/Info/ProgramIndicatorInfo.js +45 -56
  273. package/build/es/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +21 -30
  274. package/build/es/components/DataDimension/ItemSelector/DataTypeSelector.js +6 -7
  275. package/build/es/components/DataDimension/ItemSelector/DetailSelector.js +5 -6
  276. package/build/es/components/DataDimension/ItemSelector/GroupSelector.js +9 -10
  277. package/build/es/components/DataDimension/ItemSelector/ItemSelector.js +85 -102
  278. package/build/es/components/DataDimension/ItemSelector/MetricSelector.js +5 -6
  279. package/build/es/components/DataDimension/SourceEmptyPlaceholder.js +10 -13
  280. package/build/es/components/DataDimension/TransferOption.js +35 -39
  281. package/build/es/components/DimensionMenu.js +13 -14
  282. package/build/es/components/DimensionsPanel/DimensionsPanel.js +7 -7
  283. package/build/es/components/DimensionsPanel/List/DimensionItem.js +11 -11
  284. package/build/es/components/DimensionsPanel/List/DimensionList.js +8 -8
  285. package/build/es/components/DimensionsPanel/List/OptionsButton.js +8 -11
  286. package/build/es/components/DimensionsPanel/List/RecommendedIcon.js +10 -13
  287. package/build/es/components/DynamicDimension/DynamicDimension.js +9 -13
  288. package/build/es/components/DynamicDimension/ItemSelector.js +24 -36
  289. package/build/es/components/FileMenu/DeleteDialog.js +10 -14
  290. package/build/es/components/FileMenu/FileMenu.js +18 -28
  291. package/build/es/components/FileMenu/GetLinkDialog.js +7 -7
  292. package/build/es/components/FileMenu/RenameDialog.js +12 -19
  293. package/build/es/components/FileMenu/SaveAsDialog.js +12 -19
  294. package/build/es/components/FileMenu/__tests__/FileMenu.spec.js +6 -2
  295. package/build/es/components/FileMenu/__tests__/GetLinkDialog.spec.js +7 -8
  296. package/build/es/components/FileMenu/utils.js +10 -12
  297. package/build/es/components/Filter/Filter.js +21 -27
  298. package/build/es/components/Interpretations/InterpretationModal/Comment.js +7 -8
  299. package/build/es/components/Interpretations/InterpretationModal/CommentAddForm.js +9 -13
  300. package/build/es/components/Interpretations/InterpretationModal/CommentDeleteButton.js +9 -13
  301. package/build/es/components/Interpretations/InterpretationModal/CommentUpdateForm.js +11 -15
  302. package/build/es/components/Interpretations/InterpretationModal/InterpretationModal.js +18 -23
  303. package/build/es/components/Interpretations/InterpretationModal/InterpretationThread.js +11 -12
  304. package/build/es/components/Interpretations/InterpretationsUnit/InterpretationForm.js +11 -15
  305. package/build/es/components/Interpretations/InterpretationsUnit/InterpretationList.js +10 -11
  306. package/build/es/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +22 -31
  307. package/build/es/components/Interpretations/common/Interpretation/Interpretation.js +12 -13
  308. package/build/es/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +7 -11
  309. package/build/es/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +4 -5
  310. package/build/es/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +14 -21
  311. package/build/es/components/Interpretations/common/Interpretation/useLike.js +5 -6
  312. package/build/es/components/Interpretations/common/Message/Message.js +6 -7
  313. package/build/es/components/Interpretations/common/Message/MessageButtonStrip.js +8 -11
  314. package/build/es/components/Interpretations/common/Message/MessageEditorContainer.js +18 -21
  315. package/build/es/components/Interpretations/common/Message/MessageIconButton.js +34 -40
  316. package/build/es/components/Interpretations/common/Message/MessageStatsBar.js +8 -11
  317. package/build/es/components/LegendKey/LegendKey.js +3 -4
  318. package/build/es/components/OfflineTooltip.js +18 -26
  319. package/build/es/components/OpenFileDialog/CreatedByFilter.js +20 -26
  320. package/build/es/components/OpenFileDialog/CustomSelectOption.js +23 -26
  321. package/build/es/components/OpenFileDialog/DateField.js +3 -4
  322. package/build/es/components/OpenFileDialog/FileList.js +19 -22
  323. package/build/es/components/OpenFileDialog/NameFilter.js +15 -21
  324. package/build/es/components/OpenFileDialog/OpenFileDialog.js +35 -43
  325. package/build/es/components/OpenFileDialog/PaginationControls.js +22 -28
  326. package/build/es/components/OpenFileDialog/VisTypeFilter.js +28 -37
  327. package/build/es/components/Options/VisualizationOptions.js +34 -44
  328. package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +37 -58
  329. package/build/es/components/PeriodDimension/FixedPeriodFilter.js +16 -25
  330. package/build/es/components/PeriodDimension/FixedPeriodSelect.js +14 -19
  331. package/build/es/components/PeriodDimension/PeriodDimension.js +9 -12
  332. package/build/es/components/PeriodDimension/PeriodTransfer.js +48 -61
  333. package/build/es/components/PeriodDimension/RelativePeriodFilter.js +24 -30
  334. package/build/es/components/PeriodDimension/__tests__/__snapshots__/FixedPeriodSingleSelect.spec.js.snap +0 -1
  335. package/build/es/components/PeriodDimension/__tests__/__snapshots__/PeriodDimension.spec.js.snap +0 -1
  336. package/build/es/components/PeriodDimension/utils/fixedPeriods.js +6 -7
  337. package/build/es/components/PeriodDimension/utils/index.js +1 -5
  338. package/build/es/components/PivotTable/PivotTable.js +7 -8
  339. package/build/es/components/PivotTable/PivotTableBody.js +20 -29
  340. package/build/es/components/PivotTable/PivotTableCell.js +8 -12
  341. package/build/es/components/PivotTable/PivotTableClippedAxis.js +14 -17
  342. package/build/es/components/PivotTable/PivotTableColumnHeaderCell.js +7 -8
  343. package/build/es/components/PivotTable/PivotTableColumnHeaders.js +22 -29
  344. package/build/es/components/PivotTable/PivotTableContainer.js +5 -6
  345. package/build/es/components/PivotTable/PivotTableDimensionLabelCell.js +4 -5
  346. package/build/es/components/PivotTable/PivotTableEmptyCell.js +3 -4
  347. package/build/es/components/PivotTable/PivotTableEmptyRow.js +4 -5
  348. package/build/es/components/PivotTable/PivotTableEngineContext.js +4 -5
  349. package/build/es/components/PivotTable/PivotTableHead.js +13 -16
  350. package/build/es/components/PivotTable/PivotTableHeaderCell.js +8 -9
  351. package/build/es/components/PivotTable/PivotTableRow.js +20 -27
  352. package/build/es/components/PivotTable/PivotTableRowHeaderCell.js +5 -6
  353. package/build/es/components/PivotTable/PivotTableSortIcon.js +4 -5
  354. package/build/es/components/PivotTable/PivotTableTitleRow.js +18 -22
  355. package/build/es/components/PivotTable/PivotTableTitleRows.js +4 -5
  356. package/build/es/components/PivotTable/PivotTableValueCell.js +5 -6
  357. package/build/es/components/RichText/Editor/Editor.js +69 -83
  358. package/build/es/components/RichText/Parser/Parser.js +4 -8
  359. package/build/es/components/Toolbar/HoverMenuBar/HoverMenuBar.js +20 -23
  360. package/build/es/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +7 -11
  361. package/build/es/components/Toolbar/HoverMenuBar/HoverMenuList.js +8 -15
  362. package/build/es/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +10 -14
  363. package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +4 -5
  364. package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +6 -4
  365. package/build/es/components/Toolbar/InterpretationsAndDetailsToggler.js +15 -21
  366. package/build/es/components/Toolbar/Toolbar.js +10 -16
  367. package/build/es/components/Toolbar/ToolbarSidebar.js +12 -18
  368. package/build/es/components/Toolbar/UpdateButton.js +18 -24
  369. package/build/es/components/TransferOption.js +14 -15
  370. package/build/es/components/TranslationDialog/TranslationModal/LocalesSelect.js +19 -27
  371. package/build/es/components/TranslationDialog/TranslationModal/TranslationForm.js +16 -23
  372. package/build/es/components/TranslationDialog/TranslationModal/TranslationModal.js +7 -8
  373. package/build/es/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
  374. package/build/es/components/TranslationDialog/TranslationModal/__tests__/TranslationModal.spec.js +49 -0
  375. package/build/es/components/TranslationDialog/TranslationModal/useTranslationsResults.js +3 -4
  376. package/build/es/components/UserMention/UserList.js +6 -7
  377. package/build/es/components/UserMention/UserMentionWrapper.js +12 -18
  378. package/build/es/components/UserMention/useUserSearchResults.js +12 -16
  379. package/build/es/components/VisTypeIcon.js +5 -6
  380. package/build/es/locales/ar_IQ/translations.json +20 -11
  381. package/build/es/locales/cs/translations.json +2 -0
  382. package/build/es/locales/en/translations.json +1 -0
  383. package/build/es/locales/es/translations.json +2 -0
  384. package/build/es/locales/fr/translations.json +2 -0
  385. package/build/es/locales/id/translations.json +20 -11
  386. package/build/es/locales/lo/translations.json +2 -0
  387. package/build/es/locales/nb/translations.json +2 -0
  388. package/build/es/locales/prs/translations.json +2 -0
  389. package/build/es/locales/ps/translations.json +2 -0
  390. package/build/es/locales/pt/translations.json +2 -0
  391. package/build/es/locales/pt_BR/translations.json +2 -0
  392. package/build/es/locales/ru/translations.json +2 -0
  393. package/build/es/locales/si/translations.json +20 -11
  394. package/build/es/locales/sv/translations.json +20 -11
  395. package/build/es/locales/tet/translations.json +20 -11
  396. package/build/es/locales/tg/translations.json +2 -0
  397. package/build/es/locales/uk/translations.json +2 -0
  398. package/build/es/locales/ur/translations.json +2 -0
  399. package/build/es/locales/uz_UZ_Cyrl/translations.json +2 -0
  400. package/build/es/locales/uz_UZ_Latn/translations.json +4 -2
  401. package/build/es/locales/vi/translations.json +2 -0
  402. package/build/es/locales/zh/translations.json +2 -0
  403. package/build/es/locales/zh_CN/translations.json +17 -15
  404. package/build/es/modules/__tests__/expressions.spec.js +4 -5
  405. package/build/es/modules/__tests__/isNumeric.spec.js +31 -0
  406. package/build/es/modules/dimensionListItem.js +4 -5
  407. package/build/es/modules/expressions.js +3 -9
  408. package/build/es/modules/getPWAInstallationStatus.js +7 -9
  409. package/build/es/modules/layout/dimensionCreate.js +1 -3
  410. package/build/es/modules/layout/dimensionIsValid.js +3 -4
  411. package/build/es/modules/legends.js +5 -6
  412. package/build/es/modules/outliers/index.js +2 -3
  413. package/build/es/modules/outliers/iqr.js +4 -6
  414. package/build/es/modules/outliers/modZScore.js +6 -14
  415. package/build/es/modules/outliers/zScore.js +3 -4
  416. package/build/es/modules/pivotTable/AdaptiveClippingController.js +12 -16
  417. package/build/es/modules/pivotTable/PivotTableEngine.js +48 -59
  418. package/build/es/modules/pivotTable/clipAxis.js +7 -8
  419. package/build/es/modules/pivotTable/clipPartitionedAxis.js +9 -10
  420. package/build/es/modules/pivotTable/getHeaderForDisplay.js +8 -9
  421. package/build/es/modules/pivotTable/measureText.js +7 -9
  422. package/build/es/modules/pivotTable/useParentSize.js +1 -2
  423. package/build/es/modules/pivotTable/useScrollPosition.js +1 -2
  424. package/build/es/modules/pivotTable/useTableClipping.js +6 -7
  425. package/build/es/modules/relativeItems/index.js +1 -4
  426. package/build/es/modules/renderValue.js +1 -2
  427. package/build/es/modules/utils.js +9 -1
  428. package/build/es/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +3 -8
  429. package/build/es/visualizations/config/adapters/dhis_highcharts/axis.js +2 -5
  430. package/build/es/visualizations/config/adapters/dhis_highcharts/customAxes.js +2 -5
  431. package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/index.js +7 -8
  432. package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/getSingleValueBackgroundColor.js +1 -2
  433. package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/index.js +6 -7
  434. package/build/es/visualizations/config/adapters/dhis_highcharts/getFormatter.js +1 -1
  435. package/build/es/visualizations/config/adapters/dhis_highcharts/getSteps.js +1 -1
  436. package/build/es/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +3 -4
  437. package/build/es/visualizations/config/adapters/dhis_highcharts/index.js +7 -8
  438. package/build/es/visualizations/config/adapters/dhis_highcharts/legend.js +6 -7
  439. package/build/es/visualizations/config/adapters/dhis_highcharts/legendSet.js +22 -26
  440. package/build/es/visualizations/config/adapters/dhis_highcharts/plotOptions.js +8 -9
  441. package/build/es/visualizations/config/adapters/dhis_highcharts/series/index.js +18 -20
  442. package/build/es/visualizations/config/adapters/dhis_highcharts/series/pie.js +1 -4
  443. package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +1 -3
  444. package/build/es/visualizations/config/index.js +11 -12
  445. package/build/es/visualizations/config/validators/dhis/index.js +3 -4
  446. package/build/es/visualizations/index.js +1 -4
  447. package/build/es/visualizations/store/adapters/dhis_highcharts/index.js +7 -8
  448. package/build/es/visualizations/store/index.js +15 -17
  449. package/build/es/visualizations/store/validators/dhis/index.js +5 -6
  450. package/build/es/visualizations/util/getFilterText.js +3 -6
  451. package/build/es/visualizations/util/shouldUseContrastColor.js +1 -2
  452. package/package.json +12 -12
@@ -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,
@@ -65,16 +65,15 @@ function getIdColorMap(series, layout, extraOptions) {
65
65
  }, {});
66
66
  }
67
67
  }
68
- function getDefault(_ref) {
69
- let {
70
- series,
71
- metaData,
72
- layout,
73
- isStacked,
74
- extraOptions,
75
- legendSets,
76
- displayStrategy
77
- } = _ref;
68
+ function getDefault({
69
+ series,
70
+ metaData,
71
+ layout,
72
+ isStacked,
73
+ extraOptions,
74
+ legendSets,
75
+ displayStrategy
76
+ }) {
78
77
  const fullIdAxisMap = getFullIdAxisMap(layout.series, series);
79
78
  const idColorMap = getIdColorMap(series, layout, extraOptions);
80
79
  const indexColorPatternMap = getIndexColorPatternMap(series, layout, extraOptions);
@@ -152,17 +151,16 @@ function getDefault(_ref) {
152
151
  }
153
152
  return series;
154
153
  }
155
- export default function (_ref2) {
154
+ export default function ({
155
+ series,
156
+ metaData,
157
+ layout,
158
+ isStacked,
159
+ extraOptions,
160
+ legendSets,
161
+ displayStrategy
162
+ }) {
156
163
  var _series;
157
- let {
158
- series,
159
- metaData,
160
- layout,
161
- isStacked,
162
- extraOptions,
163
- legendSets,
164
- displayStrategy
165
- } = _ref2;
166
164
  switch (layout.type) {
167
165
  case VIS_TYPE_SINGLE_VALUE:
168
166
  series = [];
@@ -1,8 +1,5 @@
1
1
  import { separateDigitGroups } from '../../../../../modules/renderValue.js';
2
- export const formatDataLabel = function () {
3
- let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
4
- let y = arguments.length > 1 ? arguments[1] : undefined;
5
- let percentage = arguments.length > 2 ? arguments[2] : undefined;
2
+ export const formatDataLabel = (name = '', y, percentage) => {
6
3
  const value = separateDigitGroups(y.toString()).join(' ');
7
4
  return '<span style="font-weight:normal">' + name + '</span><br/>' + value + '<span style="font-weight:normal"> (' + parseFloat(percentage.toFixed(1)) + '%)</span>';
8
5
  };
@@ -23,10 +23,8 @@ const getLabelOffsetFromTextAlign = textAlign => {
23
23
  return 0;
24
24
  }
25
25
  };
26
- function getPlotLine() {
26
+ function getPlotLine(regressionLine = {}, defaultLabel) {
27
27
  var _regressionLine$title, _regressionLine$title2;
28
- let regressionLine = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
29
- let defaultLabel = arguments.length > 1 ? arguments[1] : undefined;
30
28
  const value = regressionLine.value;
31
29
  if (!isNumber(value)) {
32
30
  return null;
@@ -3,18 +3,17 @@ import { theme1 } from '../util/colors/index.js';
3
3
  import adapters from './adapters/index.js';
4
4
  import generators from './generators/index.js';
5
5
  import validators from './validators/index.js';
6
- export default function (_ref) {
7
- let {
8
- store,
9
- layout,
10
- el,
11
- inputFormat = 'dhis',
12
- outputFormat = 'highcharts',
13
- extraLayout,
14
- extraOptions,
15
- onError,
16
- onWarning
17
- } = _ref;
6
+ export default function ({
7
+ store,
8
+ layout,
9
+ el,
10
+ inputFormat = 'dhis',
11
+ outputFormat = 'highcharts',
12
+ extraLayout,
13
+ extraOptions,
14
+ onError,
15
+ onWarning
16
+ }) {
18
17
  const _validator = validators[inputFormat] || validators.noValidation;
19
18
  const _adapter = adapters[inputFormat + '_' + outputFormat];
20
19
  const _generator = generators[outputFormat];
@@ -1,6 +1,5 @@
1
- export default function (_ref) {
2
- let {
3
- layout
4
- } = _ref;
1
+ export default function ({
2
+ layout
3
+ }) {
5
4
  return layout;
6
5
  }
@@ -7,10 +7,7 @@ const defaultError = error => {
7
7
  const defaultWarning = warning => {
8
8
  console.log(warning);
9
9
  };
10
- function createVisualization(data, layout, el, extraOptions) {
11
- let error = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : defaultError;
12
- let warning = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : defaultWarning;
13
- let outputFormat = arguments.length > 6 ? arguments[6] : undefined;
10
+ function createVisualization(data, layout, el, extraOptions, error = defaultError, warning = defaultWarning, outputFormat) {
14
11
  const _data = isArray(data) ? data : [data];
15
12
  const store = new Store({
16
13
  data: _data,
@@ -77,14 +77,13 @@ function getSeriesFunction(type, categoryIds) {
77
77
  return getDefault;
78
78
  }
79
79
  }
80
- export default function (_ref) {
81
- let {
82
- type,
83
- data,
84
- seriesId,
85
- categoryIds,
86
- extraOptions
87
- } = _ref;
80
+ export default function ({
81
+ type,
82
+ data,
83
+ seriesId,
84
+ categoryIds,
85
+ extraOptions
86
+ }) {
88
87
  categoryIds = categoryIds || [];
89
88
  const seriesFunction = getSeriesFunction(type, categoryIds);
90
89
  return data.reduce((acc, res) => {
@@ -1,15 +1,14 @@
1
1
  import adapters from './adapters/index.js';
2
2
  import validators from './validators/index.js';
3
- export default function (_ref) {
4
- let {
5
- data,
6
- inputFormat = 'dhis',
7
- outputFormat = 'highcharts',
8
- seriesId: initialSeriesId,
9
- categoryId: initialCategoryId,
10
- error,
11
- warning
12
- } = _ref;
3
+ export default function ({
4
+ data,
5
+ inputFormat = 'dhis',
6
+ outputFormat = 'highcharts',
7
+ seriesId: initialSeriesId,
8
+ categoryId: initialCategoryId,
9
+ error,
10
+ warning
11
+ }) {
13
12
  const _validator = validators[inputFormat] || validators.noValidation;
14
13
  const _adapter = adapters[inputFormat + '_' + outputFormat];
15
14
  if (_validator === validators.noValidation) {
@@ -19,13 +18,12 @@ export default function (_ref) {
19
18
  error(`Data tranformation from "${inputFormat}" to "${outputFormat}" is not supported`);
20
19
  }
21
20
  this.data = data;
22
- this.generateData = _ref2 => {
23
- let {
24
- type,
25
- seriesId = initialSeriesId,
26
- categoryIds = [initialCategoryId],
27
- extraOptions = {}
28
- } = _ref2;
21
+ this.generateData = ({
22
+ type,
23
+ seriesId = initialSeriesId,
24
+ categoryIds = [initialCategoryId],
25
+ extraOptions = {}
26
+ }) => {
29
27
  return _adapter({
30
28
  type,
31
29
  data: data.map(d => _validator({
@@ -29,12 +29,11 @@ function validateRow(row, headersLength, error) {
29
29
  }
30
30
  row.forEach(rowValue => validateRowValue(rowValue, error));
31
31
  }
32
- export default function (_ref) {
33
- let {
34
- data,
35
- error,
36
- warning
37
- } = _ref;
32
+ export default function ({
33
+ data,
34
+ error,
35
+ warning
36
+ }) {
38
37
  if (!isObject(data)) {
39
38
  error(getMessage('Data is not an object'));
40
39
  }