@dhis2/analytics 28.0.3 → 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 (444) 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__/OrgUnitDimension.stories.js +1 -2
  5. package/build/cjs/__demo__/PivotTable.stories.js +166 -224
  6. package/build/cjs/__demo__/ScatterPlotPdfExport.stories.js +1 -2
  7. package/build/cjs/__demo__/SingleValue.stories.js +1 -2
  8. package/build/cjs/__demo__/Toolbar.stories.js +1 -2
  9. package/build/cjs/api/__tests__/dimensions.spec.js +1 -2
  10. package/build/cjs/api/analytics/Analytics.js +8 -9
  11. package/build/cjs/api/analytics/AnalyticsBase.js +58 -77
  12. package/build/cjs/api/analytics/AnalyticsRequest.js +1 -2
  13. package/build/cjs/api/analytics/AnalyticsRequestBase.js +18 -21
  14. package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +19 -38
  15. package/build/cjs/api/analytics/AnalyticsResponseHeader.js +5 -7
  16. package/build/cjs/api/analytics/__tests__/AnalyticsBase.spec.js +9 -12
  17. package/build/cjs/api/analytics/__tests__/AnalyticsRequest.spec.js +8 -2
  18. package/build/cjs/api/analytics/utils.js +11 -17
  19. package/build/cjs/api/dimensions.js +119 -148
  20. package/build/cjs/api/expression.js +39 -60
  21. package/build/cjs/api/organisationUnits.js +23 -35
  22. package/build/cjs/components/AboutAOUnit/AboutAOUnit.js +12 -20
  23. package/build/cjs/components/CachedDataQueryProvider.js +7 -9
  24. package/build/cjs/components/DashboardPluginWrapper/DashboardPluginWrapper.js +18 -22
  25. package/build/cjs/components/DataDimension/Calculation/CalculationModal.js +44 -61
  26. package/build/cjs/components/DataDimension/Calculation/DataElementOption.js +5 -6
  27. package/build/cjs/components/DataDimension/Calculation/DataElementSelector.js +29 -38
  28. package/build/cjs/components/DataDimension/Calculation/DndContext.js +29 -37
  29. package/build/cjs/components/DataDimension/Calculation/DraggingItem.js +5 -6
  30. package/build/cjs/components/DataDimension/Calculation/DropZone.js +4 -5
  31. package/build/cjs/components/DataDimension/Calculation/FormulaField.js +29 -32
  32. package/build/cjs/components/DataDimension/Calculation/FormulaItem.js +14 -16
  33. package/build/cjs/components/DataDimension/Calculation/MathOperatorSelector.js +23 -29
  34. package/build/cjs/components/DataDimension/Calculation/Operator.js +6 -7
  35. package/build/cjs/components/DataDimension/DataDimension.js +20 -32
  36. package/build/cjs/components/DataDimension/Info/CalculationInfo.js +14 -22
  37. package/build/cjs/components/DataDimension/Info/DataElementInfo.js +23 -36
  38. package/build/cjs/components/DataDimension/Info/DataElementOperandInfo.js +30 -44
  39. package/build/cjs/components/DataDimension/Info/DataSetInfo.js +26 -39
  40. package/build/cjs/components/DataDimension/Info/EventDataItemInfo.js +21 -34
  41. package/build/cjs/components/DataDimension/Info/IndicatorInfo.js +21 -32
  42. package/build/cjs/components/DataDimension/Info/InfoPopover.js +6 -7
  43. package/build/cjs/components/DataDimension/Info/InfoTable.js +39 -52
  44. package/build/cjs/components/DataDimension/Info/OptionInfo.js +13 -20
  45. package/build/cjs/components/DataDimension/Info/ProgramIndicatorInfo.js +46 -58
  46. package/build/cjs/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +22 -32
  47. package/build/cjs/components/DataDimension/ItemSelector/DataTypeSelector.js +6 -7
  48. package/build/cjs/components/DataDimension/ItemSelector/DetailSelector.js +5 -6
  49. package/build/cjs/components/DataDimension/ItemSelector/GroupSelector.js +10 -12
  50. package/build/cjs/components/DataDimension/ItemSelector/ItemSelector.js +86 -104
  51. package/build/cjs/components/DataDimension/ItemSelector/MetricSelector.js +5 -6
  52. package/build/cjs/components/DataDimension/SourceEmptyPlaceholder.js +10 -13
  53. package/build/cjs/components/DataDimension/TransferOption.js +35 -39
  54. package/build/cjs/components/DimensionMenu.js +13 -14
  55. package/build/cjs/components/DimensionsPanel/DimensionsPanel.js +8 -9
  56. package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +12 -13
  57. package/build/cjs/components/DimensionsPanel/List/DimensionList.js +9 -10
  58. package/build/cjs/components/DimensionsPanel/List/OptionsButton.js +8 -11
  59. package/build/cjs/components/DimensionsPanel/List/RecommendedIcon.js +10 -13
  60. package/build/cjs/components/DynamicDimension/DynamicDimension.js +9 -13
  61. package/build/cjs/components/DynamicDimension/ItemSelector.js +25 -38
  62. package/build/cjs/components/FileMenu/DeleteDialog.js +11 -16
  63. package/build/cjs/components/FileMenu/FileMenu.js +19 -30
  64. package/build/cjs/components/FileMenu/GetLinkDialog.js +7 -7
  65. package/build/cjs/components/FileMenu/RenameDialog.js +13 -21
  66. package/build/cjs/components/FileMenu/SaveAsDialog.js +13 -21
  67. package/build/cjs/components/FileMenu/__tests__/FileMenu.spec.js +6 -2
  68. package/build/cjs/components/FileMenu/__tests__/GetLinkDialog.spec.js +7 -8
  69. package/build/cjs/components/FileMenu/utils.js +10 -12
  70. package/build/cjs/components/Filter/Filter.js +21 -27
  71. package/build/cjs/components/Interpretations/InterpretationModal/Comment.js +8 -10
  72. package/build/cjs/components/Interpretations/InterpretationModal/CommentAddForm.js +10 -15
  73. package/build/cjs/components/Interpretations/InterpretationModal/CommentDeleteButton.js +10 -15
  74. package/build/cjs/components/Interpretations/InterpretationModal/CommentUpdateForm.js +12 -17
  75. package/build/cjs/components/Interpretations/InterpretationModal/InterpretationModal.js +19 -25
  76. package/build/cjs/components/Interpretations/InterpretationModal/InterpretationThread.js +12 -14
  77. package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationForm.js +12 -17
  78. package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationList.js +10 -11
  79. package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +23 -33
  80. package/build/cjs/components/Interpretations/common/Interpretation/Interpretation.js +13 -15
  81. package/build/cjs/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +7 -11
  82. package/build/cjs/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +5 -7
  83. package/build/cjs/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +15 -23
  84. package/build/cjs/components/Interpretations/common/Interpretation/useLike.js +5 -6
  85. package/build/cjs/components/Interpretations/common/Message/Message.js +6 -7
  86. package/build/cjs/components/Interpretations/common/Message/MessageButtonStrip.js +8 -11
  87. package/build/cjs/components/Interpretations/common/Message/MessageEditorContainer.js +18 -21
  88. package/build/cjs/components/Interpretations/common/Message/MessageIconButton.js +34 -40
  89. package/build/cjs/components/Interpretations/common/Message/MessageInput.js +1 -2
  90. package/build/cjs/components/Interpretations/common/Message/MessageStatsBar.js +8 -11
  91. package/build/cjs/components/LegendKey/LegendKey.js +3 -4
  92. package/build/cjs/components/OfflineTooltip.js +18 -26
  93. package/build/cjs/components/OpenFileDialog/CreatedByFilter.js +20 -26
  94. package/build/cjs/components/OpenFileDialog/CustomSelectOption.js +23 -26
  95. package/build/cjs/components/OpenFileDialog/DateField.js +3 -4
  96. package/build/cjs/components/OpenFileDialog/FileList.js +19 -22
  97. package/build/cjs/components/OpenFileDialog/NameFilter.js +15 -21
  98. package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +36 -45
  99. package/build/cjs/components/OpenFileDialog/PaginationControls.js +22 -28
  100. package/build/cjs/components/OpenFileDialog/VisTypeFilter.js +28 -37
  101. package/build/cjs/components/Options/VisualizationOptions.js +35 -46
  102. package/build/cjs/components/OrgUnitDimension/OrgUnitDimension.js +38 -60
  103. package/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +16 -25
  104. package/build/cjs/components/PeriodDimension/FixedPeriodSelect.js +15 -21
  105. package/build/cjs/components/PeriodDimension/PeriodDimension.js +9 -12
  106. package/build/cjs/components/PeriodDimension/PeriodTransfer.js +49 -63
  107. package/build/cjs/components/PeriodDimension/RelativePeriodFilter.js +24 -30
  108. package/build/cjs/components/PeriodDimension/__tests__/__snapshots__/FixedPeriodSingleSelect.spec.js.snap +0 -1
  109. package/build/cjs/components/PeriodDimension/__tests__/__snapshots__/PeriodDimension.spec.js.snap +0 -1
  110. package/build/cjs/components/PeriodDimension/utils/fixedPeriods.js +6 -7
  111. package/build/cjs/components/PeriodDimension/utils/index.js +1 -5
  112. package/build/cjs/components/PivotTable/PivotTable.js +8 -10
  113. package/build/cjs/components/PivotTable/PivotTableBody.js +20 -29
  114. package/build/cjs/components/PivotTable/PivotTableCell.js +8 -12
  115. package/build/cjs/components/PivotTable/PivotTableClippedAxis.js +14 -17
  116. package/build/cjs/components/PivotTable/PivotTableColumnHeaderCell.js +7 -8
  117. package/build/cjs/components/PivotTable/PivotTableColumnHeaders.js +22 -29
  118. package/build/cjs/components/PivotTable/PivotTableContainer.js +5 -6
  119. package/build/cjs/components/PivotTable/PivotTableDimensionLabelCell.js +4 -5
  120. package/build/cjs/components/PivotTable/PivotTableEmptyCell.js +3 -4
  121. package/build/cjs/components/PivotTable/PivotTableEmptyRow.js +4 -5
  122. package/build/cjs/components/PivotTable/PivotTableEngineContext.js +5 -7
  123. package/build/cjs/components/PivotTable/PivotTableHead.js +13 -16
  124. package/build/cjs/components/PivotTable/PivotTableHeaderCell.js +8 -9
  125. package/build/cjs/components/PivotTable/PivotTableRow.js +20 -27
  126. package/build/cjs/components/PivotTable/PivotTableRowHeaderCell.js +5 -6
  127. package/build/cjs/components/PivotTable/PivotTableSortIcon.js +4 -5
  128. package/build/cjs/components/PivotTable/PivotTableTitleRow.js +19 -24
  129. package/build/cjs/components/PivotTable/PivotTableTitleRows.js +4 -5
  130. package/build/cjs/components/PivotTable/PivotTableValueCell.js +6 -8
  131. package/build/cjs/components/RichText/Editor/Editor.js +70 -85
  132. package/build/cjs/components/RichText/Parser/Parser.js +5 -10
  133. package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuBar.js +20 -24
  134. package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +8 -13
  135. package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuList.js +9 -17
  136. package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +11 -16
  137. package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +4 -5
  138. package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +13 -11
  139. package/build/cjs/components/Toolbar/InterpretationsAndDetailsToggler.js +15 -21
  140. package/build/cjs/components/Toolbar/Toolbar.js +10 -16
  141. package/build/cjs/components/Toolbar/ToolbarSidebar.js +12 -18
  142. package/build/cjs/components/Toolbar/UpdateButton.js +18 -24
  143. package/build/cjs/components/TransferOption.js +14 -15
  144. package/build/cjs/components/TranslationDialog/TranslationModal/LocalesSelect.js +19 -27
  145. package/build/cjs/components/TranslationDialog/TranslationModal/TranslationForm.js +17 -25
  146. package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModal.js +7 -9
  147. package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
  148. package/build/cjs/components/TranslationDialog/TranslationModal/useTranslationsResults.js +3 -4
  149. package/build/cjs/components/UserMention/UserList.js +6 -7
  150. package/build/cjs/components/UserMention/UserMentionWrapper.js +13 -20
  151. package/build/cjs/components/UserMention/useUserSearchResults.js +12 -16
  152. package/build/cjs/components/VisTypeIcon.js +5 -6
  153. package/build/cjs/index.js +38 -39
  154. package/build/cjs/locales/ar_IQ/translations.json +20 -11
  155. package/build/cjs/locales/cs/translations.json +2 -0
  156. package/build/cjs/locales/en/translations.json +1 -0
  157. package/build/cjs/locales/es/translations.json +2 -0
  158. package/build/cjs/locales/fr/translations.json +2 -0
  159. package/build/cjs/locales/id/translations.json +20 -11
  160. package/build/cjs/locales/index.js +62 -62
  161. package/build/cjs/locales/lo/translations.json +2 -0
  162. package/build/cjs/locales/nb/translations.json +2 -0
  163. package/build/cjs/locales/prs/translations.json +2 -0
  164. package/build/cjs/locales/ps/translations.json +2 -0
  165. package/build/cjs/locales/pt/translations.json +2 -0
  166. package/build/cjs/locales/pt_BR/translations.json +2 -0
  167. package/build/cjs/locales/ru/translations.json +2 -0
  168. package/build/cjs/locales/si/translations.json +20 -11
  169. package/build/cjs/locales/sv/translations.json +20 -11
  170. package/build/cjs/locales/tet/translations.json +20 -11
  171. package/build/cjs/locales/tg/translations.json +2 -0
  172. package/build/cjs/locales/uk/translations.json +2 -0
  173. package/build/cjs/locales/ur/translations.json +2 -0
  174. package/build/cjs/locales/uz_UZ_Cyrl/translations.json +2 -0
  175. package/build/cjs/locales/uz_UZ_Latn/translations.json +4 -2
  176. package/build/cjs/locales/vi/translations.json +2 -0
  177. package/build/cjs/locales/zh/translations.json +2 -0
  178. package/build/cjs/locales/zh_CN/translations.json +17 -15
  179. package/build/cjs/modules/__tests__/expressions.spec.js +4 -5
  180. package/build/cjs/modules/__tests__/isNumeric.spec.js +33 -0
  181. package/build/cjs/modules/dimensionListItem.js +4 -5
  182. package/build/cjs/modules/expressions.js +3 -9
  183. package/build/cjs/modules/getPWAInstallationStatus.js +7 -9
  184. package/build/cjs/modules/layout/dimensionCreate.js +1 -3
  185. package/build/cjs/modules/layout/dimensionIsValid.js +3 -4
  186. package/build/cjs/modules/legends.js +5 -6
  187. package/build/cjs/modules/outliers/index.js +5 -6
  188. package/build/cjs/modules/outliers/iqr.js +4 -6
  189. package/build/cjs/modules/outliers/modZScore.js +6 -14
  190. package/build/cjs/modules/outliers/zScore.js +3 -4
  191. package/build/cjs/modules/pivotTable/AdaptiveClippingController.js +12 -16
  192. package/build/cjs/modules/pivotTable/PivotTableEngine.js +48 -59
  193. package/build/cjs/modules/pivotTable/clipAxis.js +7 -8
  194. package/build/cjs/modules/pivotTable/clipPartitionedAxis.js +9 -10
  195. package/build/cjs/modules/pivotTable/getHeaderForDisplay.js +8 -9
  196. package/build/cjs/modules/pivotTable/measureText.js +7 -9
  197. package/build/cjs/modules/pivotTable/useParentSize.js +1 -2
  198. package/build/cjs/modules/pivotTable/useScrollPosition.js +1 -2
  199. package/build/cjs/modules/pivotTable/useTableClipping.js +6 -7
  200. package/build/cjs/modules/relativeItems/index.js +1 -4
  201. package/build/cjs/modules/renderValue.js +1 -2
  202. package/build/cjs/modules/utils.js +11 -2
  203. package/build/cjs/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +3 -8
  204. package/build/cjs/visualizations/config/adapters/dhis_highcharts/axis.js +7 -10
  205. package/build/cjs/visualizations/config/adapters/dhis_highcharts/customAxes.js +2 -5
  206. package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/index.js +7 -8
  207. package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/getSingleValueBackgroundColor.js +1 -2
  208. package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/index.js +6 -7
  209. package/build/cjs/visualizations/config/adapters/dhis_highcharts/getFormatter.js +2 -3
  210. package/build/cjs/visualizations/config/adapters/dhis_highcharts/getSteps.js +2 -3
  211. package/build/cjs/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +3 -4
  212. package/build/cjs/visualizations/config/adapters/dhis_highcharts/index.js +8 -10
  213. package/build/cjs/visualizations/config/adapters/dhis_highcharts/legend.js +6 -7
  214. package/build/cjs/visualizations/config/adapters/dhis_highcharts/legendSet.js +22 -26
  215. package/build/cjs/visualizations/config/adapters/dhis_highcharts/plotOptions.js +8 -9
  216. package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/index.js +18 -20
  217. package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/pie.js +1 -4
  218. package/build/cjs/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +1 -2
  219. package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +1 -3
  220. package/build/cjs/visualizations/config/index.js +11 -12
  221. package/build/cjs/visualizations/config/validators/dhis/index.js +3 -4
  222. package/build/cjs/visualizations/index.js +1 -4
  223. package/build/cjs/visualizations/store/adapters/dhis_highcharts/index.js +7 -8
  224. package/build/cjs/visualizations/store/index.js +15 -17
  225. package/build/cjs/visualizations/store/validators/dhis/index.js +5 -6
  226. package/build/cjs/visualizations/util/getFilterText.js +3 -6
  227. package/build/cjs/visualizations/util/shouldUseContrastColor.js +1 -2
  228. package/build/es/__demo__/PivotTable.stories.js +165 -222
  229. package/build/es/api/__tests__/dimensions.spec.js +1 -2
  230. package/build/es/api/analytics/Analytics.js +8 -9
  231. package/build/es/api/analytics/AnalyticsBase.js +58 -77
  232. package/build/es/api/analytics/AnalyticsRequest.js +1 -2
  233. package/build/es/api/analytics/AnalyticsRequestBase.js +18 -21
  234. package/build/es/api/analytics/AnalyticsRequestPropertiesMixin.js +19 -38
  235. package/build/es/api/analytics/AnalyticsResponseHeader.js +5 -7
  236. package/build/es/api/analytics/__tests__/AnalyticsBase.spec.js +8 -10
  237. package/build/es/api/analytics/__tests__/AnalyticsRequest.spec.js +8 -2
  238. package/build/es/api/analytics/utils.js +11 -17
  239. package/build/es/api/dimensions.js +119 -148
  240. package/build/es/api/expression.js +39 -60
  241. package/build/es/api/organisationUnits.js +23 -35
  242. package/build/es/components/AboutAOUnit/AboutAOUnit.js +11 -18
  243. package/build/es/components/CachedDataQueryProvider.js +6 -7
  244. package/build/es/components/DashboardPluginWrapper/DashboardPluginWrapper.js +17 -20
  245. package/build/es/components/DataDimension/Calculation/CalculationModal.js +43 -59
  246. package/build/es/components/DataDimension/Calculation/DataElementOption.js +5 -6
  247. package/build/es/components/DataDimension/Calculation/DataElementSelector.js +28 -36
  248. package/build/es/components/DataDimension/Calculation/DndContext.js +28 -35
  249. package/build/es/components/DataDimension/Calculation/DraggingItem.js +5 -6
  250. package/build/es/components/DataDimension/Calculation/DropZone.js +4 -5
  251. package/build/es/components/DataDimension/Calculation/FormulaField.js +29 -32
  252. package/build/es/components/DataDimension/Calculation/FormulaItem.js +13 -14
  253. package/build/es/components/DataDimension/Calculation/MathOperatorSelector.js +23 -29
  254. package/build/es/components/DataDimension/Calculation/Operator.js +6 -7
  255. package/build/es/components/DataDimension/DataDimension.js +19 -30
  256. package/build/es/components/DataDimension/Info/CalculationInfo.js +13 -20
  257. package/build/es/components/DataDimension/Info/DataElementInfo.js +23 -36
  258. package/build/es/components/DataDimension/Info/DataElementOperandInfo.js +29 -42
  259. package/build/es/components/DataDimension/Info/DataSetInfo.js +26 -39
  260. package/build/es/components/DataDimension/Info/EventDataItemInfo.js +21 -34
  261. package/build/es/components/DataDimension/Info/IndicatorInfo.js +20 -30
  262. package/build/es/components/DataDimension/Info/InfoPopover.js +6 -7
  263. package/build/es/components/DataDimension/Info/InfoTable.js +39 -52
  264. package/build/es/components/DataDimension/Info/OptionInfo.js +13 -20
  265. package/build/es/components/DataDimension/Info/ProgramIndicatorInfo.js +45 -56
  266. package/build/es/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +21 -30
  267. package/build/es/components/DataDimension/ItemSelector/DataTypeSelector.js +6 -7
  268. package/build/es/components/DataDimension/ItemSelector/DetailSelector.js +5 -6
  269. package/build/es/components/DataDimension/ItemSelector/GroupSelector.js +9 -10
  270. package/build/es/components/DataDimension/ItemSelector/ItemSelector.js +85 -102
  271. package/build/es/components/DataDimension/ItemSelector/MetricSelector.js +5 -6
  272. package/build/es/components/DataDimension/SourceEmptyPlaceholder.js +10 -13
  273. package/build/es/components/DataDimension/TransferOption.js +35 -39
  274. package/build/es/components/DimensionMenu.js +13 -14
  275. package/build/es/components/DimensionsPanel/DimensionsPanel.js +7 -7
  276. package/build/es/components/DimensionsPanel/List/DimensionItem.js +11 -11
  277. package/build/es/components/DimensionsPanel/List/DimensionList.js +8 -8
  278. package/build/es/components/DimensionsPanel/List/OptionsButton.js +8 -11
  279. package/build/es/components/DimensionsPanel/List/RecommendedIcon.js +10 -13
  280. package/build/es/components/DynamicDimension/DynamicDimension.js +9 -13
  281. package/build/es/components/DynamicDimension/ItemSelector.js +24 -36
  282. package/build/es/components/FileMenu/DeleteDialog.js +10 -14
  283. package/build/es/components/FileMenu/FileMenu.js +18 -28
  284. package/build/es/components/FileMenu/GetLinkDialog.js +7 -7
  285. package/build/es/components/FileMenu/RenameDialog.js +12 -19
  286. package/build/es/components/FileMenu/SaveAsDialog.js +12 -19
  287. package/build/es/components/FileMenu/__tests__/FileMenu.spec.js +6 -2
  288. package/build/es/components/FileMenu/__tests__/GetLinkDialog.spec.js +7 -8
  289. package/build/es/components/FileMenu/utils.js +10 -12
  290. package/build/es/components/Filter/Filter.js +21 -27
  291. package/build/es/components/Interpretations/InterpretationModal/Comment.js +7 -8
  292. package/build/es/components/Interpretations/InterpretationModal/CommentAddForm.js +9 -13
  293. package/build/es/components/Interpretations/InterpretationModal/CommentDeleteButton.js +9 -13
  294. package/build/es/components/Interpretations/InterpretationModal/CommentUpdateForm.js +11 -15
  295. package/build/es/components/Interpretations/InterpretationModal/InterpretationModal.js +18 -23
  296. package/build/es/components/Interpretations/InterpretationModal/InterpretationThread.js +11 -12
  297. package/build/es/components/Interpretations/InterpretationsUnit/InterpretationForm.js +11 -15
  298. package/build/es/components/Interpretations/InterpretationsUnit/InterpretationList.js +10 -11
  299. package/build/es/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +22 -31
  300. package/build/es/components/Interpretations/common/Interpretation/Interpretation.js +12 -13
  301. package/build/es/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +7 -11
  302. package/build/es/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +4 -5
  303. package/build/es/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +14 -21
  304. package/build/es/components/Interpretations/common/Interpretation/useLike.js +5 -6
  305. package/build/es/components/Interpretations/common/Message/Message.js +6 -7
  306. package/build/es/components/Interpretations/common/Message/MessageButtonStrip.js +8 -11
  307. package/build/es/components/Interpretations/common/Message/MessageEditorContainer.js +18 -21
  308. package/build/es/components/Interpretations/common/Message/MessageIconButton.js +34 -40
  309. package/build/es/components/Interpretations/common/Message/MessageStatsBar.js +8 -11
  310. package/build/es/components/LegendKey/LegendKey.js +3 -4
  311. package/build/es/components/OfflineTooltip.js +18 -26
  312. package/build/es/components/OpenFileDialog/CreatedByFilter.js +20 -26
  313. package/build/es/components/OpenFileDialog/CustomSelectOption.js +23 -26
  314. package/build/es/components/OpenFileDialog/DateField.js +3 -4
  315. package/build/es/components/OpenFileDialog/FileList.js +19 -22
  316. package/build/es/components/OpenFileDialog/NameFilter.js +15 -21
  317. package/build/es/components/OpenFileDialog/OpenFileDialog.js +35 -43
  318. package/build/es/components/OpenFileDialog/PaginationControls.js +22 -28
  319. package/build/es/components/OpenFileDialog/VisTypeFilter.js +28 -37
  320. package/build/es/components/Options/VisualizationOptions.js +34 -44
  321. package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +37 -58
  322. package/build/es/components/PeriodDimension/FixedPeriodFilter.js +16 -25
  323. package/build/es/components/PeriodDimension/FixedPeriodSelect.js +14 -19
  324. package/build/es/components/PeriodDimension/PeriodDimension.js +9 -12
  325. package/build/es/components/PeriodDimension/PeriodTransfer.js +48 -61
  326. package/build/es/components/PeriodDimension/RelativePeriodFilter.js +24 -30
  327. package/build/es/components/PeriodDimension/__tests__/__snapshots__/FixedPeriodSingleSelect.spec.js.snap +0 -1
  328. package/build/es/components/PeriodDimension/__tests__/__snapshots__/PeriodDimension.spec.js.snap +0 -1
  329. package/build/es/components/PeriodDimension/utils/fixedPeriods.js +6 -7
  330. package/build/es/components/PeriodDimension/utils/index.js +1 -5
  331. package/build/es/components/PivotTable/PivotTable.js +7 -8
  332. package/build/es/components/PivotTable/PivotTableBody.js +20 -29
  333. package/build/es/components/PivotTable/PivotTableCell.js +8 -12
  334. package/build/es/components/PivotTable/PivotTableClippedAxis.js +14 -17
  335. package/build/es/components/PivotTable/PivotTableColumnHeaderCell.js +7 -8
  336. package/build/es/components/PivotTable/PivotTableColumnHeaders.js +22 -29
  337. package/build/es/components/PivotTable/PivotTableContainer.js +5 -6
  338. package/build/es/components/PivotTable/PivotTableDimensionLabelCell.js +4 -5
  339. package/build/es/components/PivotTable/PivotTableEmptyCell.js +3 -4
  340. package/build/es/components/PivotTable/PivotTableEmptyRow.js +4 -5
  341. package/build/es/components/PivotTable/PivotTableEngineContext.js +4 -5
  342. package/build/es/components/PivotTable/PivotTableHead.js +13 -16
  343. package/build/es/components/PivotTable/PivotTableHeaderCell.js +8 -9
  344. package/build/es/components/PivotTable/PivotTableRow.js +20 -27
  345. package/build/es/components/PivotTable/PivotTableRowHeaderCell.js +5 -6
  346. package/build/es/components/PivotTable/PivotTableSortIcon.js +4 -5
  347. package/build/es/components/PivotTable/PivotTableTitleRow.js +18 -22
  348. package/build/es/components/PivotTable/PivotTableTitleRows.js +4 -5
  349. package/build/es/components/PivotTable/PivotTableValueCell.js +5 -6
  350. package/build/es/components/RichText/Editor/Editor.js +69 -83
  351. package/build/es/components/RichText/Parser/Parser.js +4 -8
  352. package/build/es/components/Toolbar/HoverMenuBar/HoverMenuBar.js +20 -23
  353. package/build/es/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +7 -11
  354. package/build/es/components/Toolbar/HoverMenuBar/HoverMenuList.js +8 -15
  355. package/build/es/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +10 -14
  356. package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +4 -5
  357. package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +6 -4
  358. package/build/es/components/Toolbar/InterpretationsAndDetailsToggler.js +15 -21
  359. package/build/es/components/Toolbar/Toolbar.js +10 -16
  360. package/build/es/components/Toolbar/ToolbarSidebar.js +12 -18
  361. package/build/es/components/Toolbar/UpdateButton.js +18 -24
  362. package/build/es/components/TransferOption.js +14 -15
  363. package/build/es/components/TranslationDialog/TranslationModal/LocalesSelect.js +19 -27
  364. package/build/es/components/TranslationDialog/TranslationModal/TranslationForm.js +16 -23
  365. package/build/es/components/TranslationDialog/TranslationModal/TranslationModal.js +6 -7
  366. package/build/es/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
  367. package/build/es/components/TranslationDialog/TranslationModal/useTranslationsResults.js +3 -4
  368. package/build/es/components/UserMention/UserList.js +6 -7
  369. package/build/es/components/UserMention/UserMentionWrapper.js +12 -18
  370. package/build/es/components/UserMention/useUserSearchResults.js +12 -16
  371. package/build/es/components/VisTypeIcon.js +5 -6
  372. package/build/es/locales/ar_IQ/translations.json +20 -11
  373. package/build/es/locales/cs/translations.json +2 -0
  374. package/build/es/locales/en/translations.json +1 -0
  375. package/build/es/locales/es/translations.json +2 -0
  376. package/build/es/locales/fr/translations.json +2 -0
  377. package/build/es/locales/id/translations.json +20 -11
  378. package/build/es/locales/lo/translations.json +2 -0
  379. package/build/es/locales/nb/translations.json +2 -0
  380. package/build/es/locales/prs/translations.json +2 -0
  381. package/build/es/locales/ps/translations.json +2 -0
  382. package/build/es/locales/pt/translations.json +2 -0
  383. package/build/es/locales/pt_BR/translations.json +2 -0
  384. package/build/es/locales/ru/translations.json +2 -0
  385. package/build/es/locales/si/translations.json +20 -11
  386. package/build/es/locales/sv/translations.json +20 -11
  387. package/build/es/locales/tet/translations.json +20 -11
  388. package/build/es/locales/tg/translations.json +2 -0
  389. package/build/es/locales/uk/translations.json +2 -0
  390. package/build/es/locales/ur/translations.json +2 -0
  391. package/build/es/locales/uz_UZ_Cyrl/translations.json +2 -0
  392. package/build/es/locales/uz_UZ_Latn/translations.json +4 -2
  393. package/build/es/locales/vi/translations.json +2 -0
  394. package/build/es/locales/zh/translations.json +2 -0
  395. package/build/es/locales/zh_CN/translations.json +17 -15
  396. package/build/es/modules/__tests__/expressions.spec.js +4 -5
  397. package/build/es/modules/__tests__/isNumeric.spec.js +31 -0
  398. package/build/es/modules/dimensionListItem.js +4 -5
  399. package/build/es/modules/expressions.js +3 -9
  400. package/build/es/modules/getPWAInstallationStatus.js +7 -9
  401. package/build/es/modules/layout/dimensionCreate.js +1 -3
  402. package/build/es/modules/layout/dimensionIsValid.js +3 -4
  403. package/build/es/modules/legends.js +5 -6
  404. package/build/es/modules/outliers/index.js +2 -3
  405. package/build/es/modules/outliers/iqr.js +4 -6
  406. package/build/es/modules/outliers/modZScore.js +6 -14
  407. package/build/es/modules/outliers/zScore.js +3 -4
  408. package/build/es/modules/pivotTable/AdaptiveClippingController.js +12 -16
  409. package/build/es/modules/pivotTable/PivotTableEngine.js +48 -59
  410. package/build/es/modules/pivotTable/clipAxis.js +7 -8
  411. package/build/es/modules/pivotTable/clipPartitionedAxis.js +9 -10
  412. package/build/es/modules/pivotTable/getHeaderForDisplay.js +8 -9
  413. package/build/es/modules/pivotTable/measureText.js +7 -9
  414. package/build/es/modules/pivotTable/useParentSize.js +1 -2
  415. package/build/es/modules/pivotTable/useScrollPosition.js +1 -2
  416. package/build/es/modules/pivotTable/useTableClipping.js +6 -7
  417. package/build/es/modules/relativeItems/index.js +1 -4
  418. package/build/es/modules/renderValue.js +1 -2
  419. package/build/es/modules/utils.js +9 -1
  420. package/build/es/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +3 -8
  421. package/build/es/visualizations/config/adapters/dhis_highcharts/axis.js +2 -5
  422. package/build/es/visualizations/config/adapters/dhis_highcharts/customAxes.js +2 -5
  423. package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/index.js +7 -8
  424. package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/getSingleValueBackgroundColor.js +1 -2
  425. package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/index.js +6 -7
  426. package/build/es/visualizations/config/adapters/dhis_highcharts/getFormatter.js +1 -1
  427. package/build/es/visualizations/config/adapters/dhis_highcharts/getSteps.js +1 -1
  428. package/build/es/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +3 -4
  429. package/build/es/visualizations/config/adapters/dhis_highcharts/index.js +7 -8
  430. package/build/es/visualizations/config/adapters/dhis_highcharts/legend.js +6 -7
  431. package/build/es/visualizations/config/adapters/dhis_highcharts/legendSet.js +22 -26
  432. package/build/es/visualizations/config/adapters/dhis_highcharts/plotOptions.js +8 -9
  433. package/build/es/visualizations/config/adapters/dhis_highcharts/series/index.js +18 -20
  434. package/build/es/visualizations/config/adapters/dhis_highcharts/series/pie.js +1 -4
  435. package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +1 -3
  436. package/build/es/visualizations/config/index.js +11 -12
  437. package/build/es/visualizations/config/validators/dhis/index.js +3 -4
  438. package/build/es/visualizations/index.js +1 -4
  439. package/build/es/visualizations/store/adapters/dhis_highcharts/index.js +7 -8
  440. package/build/es/visualizations/store/index.js +15 -17
  441. package/build/es/visualizations/store/validators/dhis/index.js +5 -6
  442. package/build/es/visualizations/util/getFilterText.js +3 -6
  443. package/build/es/visualizations/util/shouldUseContrastColor.js +1 -2
  444. package/package.json +12 -12
@@ -6,14 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.clipAxis = void 0;
7
7
  var _times = _interopRequireDefault(require("lodash/times"));
8
8
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
- const clipAxis = _ref => {
10
- let {
11
- position,
12
- size,
13
- step,
14
- totalCount,
15
- headerCount
16
- } = _ref;
9
+ const clipAxis = ({
10
+ position,
11
+ size,
12
+ step,
13
+ totalCount,
14
+ headerCount
15
+ }) => {
17
16
  // position: scroll Y position
18
17
  // size: height of table container
19
18
  // step: height of cell in px
@@ -4,16 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.clipPartitionedAxis = void 0;
7
- const clipPartitionedAxis = _ref => {
8
- let {
9
- partitionSize,
10
- partitions,
11
- axisMap,
12
- widthMap,
13
- viewportWidth,
14
- viewportPosition,
15
- totalWidth
16
- } = _ref;
7
+ const clipPartitionedAxis = ({
8
+ partitionSize,
9
+ partitions,
10
+ axisMap,
11
+ widthMap,
12
+ viewportWidth,
13
+ viewportPosition,
14
+ totalWidth
15
+ }) => {
17
16
  const partition = Math.floor(viewportPosition / partitionSize);
18
17
  if (partitions[partition] === undefined) {
19
18
  return {
@@ -12,15 +12,14 @@ const headerStacksAreEqual = (a, b, limit) => {
12
12
  }
13
13
  return true;
14
14
  };
15
- const getHeaderForDisplay = _ref => {
16
- let {
17
- start,
18
- count,
19
- index,
20
- dimensionLevel,
21
- getHeader,
22
- showHierarchy
23
- } = _ref;
15
+ const getHeaderForDisplay = ({
16
+ start,
17
+ count,
18
+ index,
19
+ dimensionLevel,
20
+ getHeader,
21
+ showHierarchy
22
+ }) => {
24
23
  const header = getHeader(index);
25
24
  const showHeader = index === start || !headerStacksAreEqual(header, getHeader(index - 1), dimensionLevel);
26
25
  if (!showHeader) {
@@ -14,19 +14,17 @@ const getContext = fontSize => {
14
14
  ctx.font = `${fontSize}px Roboto, Arial, sans-serif`;
15
15
  return ctx;
16
16
  };
17
- const measureText = function (text) {
18
- let fontSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 11;
17
+ const measureText = (text, fontSize = 11) => {
19
18
  const ctx = getContext(fontSize);
20
19
  const textMetrics = ctx.measureText(text);
21
20
  return textMetrics.width;
22
21
  };
23
- const measureTextWithWrapping = (text, _ref) => {
24
- let {
25
- fontSize = 11,
26
- maxWidth = _pivotTableConstants.CLIPPED_CELL_MAX_SIZE,
27
- justifyBuffer = _pivotTableConstants.WRAPPED_TEXT_JUSTIFY_BUFFER,
28
- lineHeight = _pivotTableConstants.WRAPPED_TEXT_LINE_HEIGHT
29
- } = _ref;
22
+ const measureTextWithWrapping = (text, {
23
+ fontSize = 11,
24
+ maxWidth = _pivotTableConstants.CLIPPED_CELL_MAX_SIZE,
25
+ justifyBuffer = _pivotTableConstants.WRAPPED_TEXT_JUSTIFY_BUFFER,
26
+ lineHeight = _pivotTableConstants.WRAPPED_TEXT_LINE_HEIGHT
27
+ }) => {
30
28
  if (!text) {
31
29
  return {
32
30
  width: 0,
@@ -11,8 +11,7 @@ const initialState = {
11
11
  width: 0,
12
12
  height: 0
13
13
  };
14
- const useParentSize = function (elementRef, renderCounter) {
15
- let initialSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : initialState;
14
+ const useParentSize = (elementRef, renderCounter, initialSize = initialState) => {
16
15
  const [size, setSize] = (0, _react.useState)({
17
16
  width: initialSize.width || 0,
18
17
  height: initialSize.height || 0
@@ -7,8 +7,7 @@ exports.useScrollPosition = void 0;
7
7
  var _debounce = _interopRequireDefault(require("lodash/debounce"));
8
8
  var _react = require("react");
9
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
- const useScrollPosition = function (containerRef) {
11
- let debounceWait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
10
+ const useScrollPosition = (containerRef, debounceWait = 10) => {
12
11
  const [scrollPosition, setScrollPosition] = (0, _react.useState)({
13
12
  x: 0,
14
13
  y: 0
@@ -8,13 +8,12 @@ var _react = require("react");
8
8
  var _clipPartitionedAxis = require("./clipPartitionedAxis.js");
9
9
  var _pivotTableConstants = require("./pivotTableConstants.js");
10
10
  var _useScrollPosition = require("./useScrollPosition.js");
11
- const useTableClipping = _ref => {
12
- let {
13
- containerRef,
14
- width,
15
- height,
16
- engine
17
- } = _ref;
11
+ const useTableClipping = ({
12
+ containerRef,
13
+ width,
14
+ height,
15
+ engine
16
+ }) => {
18
17
  const scrollPosition = (0, _useScrollPosition.useScrollPosition)(containerRef);
19
18
  const lineHeight = engine.fontSize + engine.cellPadding * 2 + 2;
20
19
  const rows = (0, _react.useMemo)(() => {
@@ -7,8 +7,5 @@ exports.hasRelativeItems = void 0;
7
7
  var _relativePeriods = require("../../components/PeriodDimension/utils/relativePeriods.js");
8
8
  var _index = require("../ouIdHelper/index.js");
9
9
  var _predefinedDimensions = require("../predefinedDimensions.js");
10
- const hasRelativeItems = function (dimension) {
11
- let itemIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
12
- return dimension === _predefinedDimensions.DIMENSION_ID_ASSIGNED_CATEGORIES || dimension === _predefinedDimensions.DIMENSION_ID_ORGUNIT && Array.isArray(itemIds) && itemIds.some(id => _index.ouIdHelper.hasLevelPrefix(id) || _index.ouIdHelper.hasGroupPrefix(id) || [_index.USER_ORG_UNIT, _index.USER_ORG_UNIT_CHILDREN, _index.USER_ORG_UNIT_GRANDCHILDREN].includes(id)) || dimension === _predefinedDimensions.DIMENSION_ID_PERIOD && Array.isArray(itemIds) && itemIds.some(id => (0, _relativePeriods.getRelativePeriodIds)().includes(id));
13
- };
10
+ const hasRelativeItems = (dimension, itemIds = []) => dimension === _predefinedDimensions.DIMENSION_ID_ASSIGNED_CATEGORIES || dimension === _predefinedDimensions.DIMENSION_ID_ORGUNIT && Array.isArray(itemIds) && itemIds.some(id => _index.ouIdHelper.hasLevelPrefix(id) || _index.ouIdHelper.hasGroupPrefix(id) || [_index.USER_ORG_UNIT, _index.USER_ORG_UNIT_CHILDREN, _index.USER_ORG_UNIT_GRANDCHILDREN].includes(id)) || dimension === _predefinedDimensions.DIMENSION_ID_PERIOD && Array.isArray(itemIds) && itemIds.some(id => (0, _relativePeriods.getRelativePeriodIds)().includes(id));
14
11
  exports.hasRelativeItems = hasRelativeItems;
@@ -7,8 +7,7 @@ exports.separateDigitGroups = exports.renderValue = void 0;
7
7
  var _pivotTableConstants = require("./pivotTable/pivotTableConstants.js");
8
8
  var _valueTypes = require("./valueTypes.js");
9
9
  const trimTrailingZeros = stringValue => stringValue.replace(/\.?0+$/, '');
10
- const separateDigitGroups = function (stringValue) {
11
- let decimalSeparator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.';
10
+ const separateDigitGroups = (stringValue, decimalSeparator = '.') => {
12
11
  const isNegative = stringValue[0] === '-';
13
12
  const [integer, remainder] = stringValue.replace(/^-/, '').split('.');
14
13
  const groups = [];
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useDidUpdateEffect = exports.useDebounce = void 0;
6
+ exports.useDidUpdateEffect = exports.useDebounce = exports.isNumeric = void 0;
7
7
  var _react = require("react");
8
8
  const useDebounce = (value, delay) => {
9
9
  const [debouncedValue, setDebouncedValue] = (0, _react.useState)(value);
@@ -28,4 +28,13 @@ const useDidUpdateEffect = (fn, inputs) => {
28
28
  }
29
29
  }, inputs);
30
30
  };
31
- exports.useDidUpdateEffect = useDidUpdateEffect;
31
+
32
+ /**
33
+ * Check if a value is numeric
34
+ *
35
+ * @param param Value to be checked
36
+ * @returns {boolean} Returns true when the `param` is a numeric value
37
+ */
38
+ exports.useDidUpdateEffect = useDidUpdateEffect;
39
+ const isNumeric = param => typeof param !== 'symbol' && !isNaN(parseFloat(param)) && isFinite(param);
40
+ exports.isNumeric = isNumeric;
@@ -198,8 +198,7 @@ function gaussianElimination(a, o) {
198
198
  // N * Σ(X^2) - Σ(X)^2
199
199
  //
200
200
  // correlation = N * Σ(XY) - Σ(X) * Σ (Y) / √ ( N * Σ(X^2) - Σ(X) ) * ( N * Σ(Y^2) - Σ(Y)^2 ) ) )
201
- function linear(data) {
202
- let decimalPlaces = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
201
+ function linear(data, decimalPlaces = 2) {
203
202
  const sum = [0, 0, 0, 0, 0],
204
203
  results = [];
205
204
  let N = data.length;
@@ -248,10 +247,7 @@ function linear(data) {
248
247
  }
249
248
 
250
249
  // Code extracted from https://github.com/Tom-Alexander/regression-js/
251
- function polynomial(data) {
252
- let order = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
253
- let extrapolate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
254
- let decimalPlaces = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;
250
+ function polynomial(data, order = 2, extrapolate = 0, decimalPlaces = 2) {
255
251
  const lhs = [],
256
252
  rhs = [],
257
253
  results = [],
@@ -332,8 +328,7 @@ function polynomial(data) {
332
328
  // Based on
333
329
  // - http://commons.apache.org/proper/commons-math/download_math.cgi LoesInterpolator.java
334
330
  // - https://gist.github.com/avibryant/1151823
335
- function loess(data) {
336
- let bandwidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.25;
331
+ function loess(data, bandwidth = 0.25) {
337
332
  const xval = data.map(pair => {
338
333
  return pair[0];
339
334
  });
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getRegressionLine = exports.getMinValue = exports.getMaxValue = exports.getLabels = exports.getGridLineColor = void 0;
7
- var _isNumeric = _interopRequireDefault(require("d2-utilizr/lib/isNumeric"));
8
7
  var _isString = _interopRequireDefault(require("d2-utilizr/lib/isString"));
9
8
  var _objectClean = _interopRequireDefault(require("d2-utilizr/lib/objectClean"));
10
9
  var _fontStyle = require("../../../../modules/fontStyle.js");
10
+ var _utils = require("../../../../modules/utils.js");
11
11
  var _visTypes = require("../../../../modules/visTypes.js");
12
12
  var _getFormatter = _interopRequireDefault(require("./getFormatter.js"));
13
13
  var _getTextAlignOption = require("./getTextAlignOption.js");
@@ -56,10 +56,10 @@ const getLineLabelStyle = (textAlign, fontStyleType, isVertical) => {
56
56
 
57
57
  // outlierLineMin: if there are lines with smaller x or y than the data
58
58
  const getMinValue = (minValue, dataValues, outlierLineMin) => {
59
- if ((0, _isNumeric.default)(minValue)) {
59
+ if ((0, _utils.isNumeric)(minValue)) {
60
60
  return minValue;
61
61
  }
62
- if ((0, _isNumeric.default)(outlierLineMin)) {
62
+ if ((0, _utils.isNumeric)(outlierLineMin)) {
63
63
  return outlierLineMin;
64
64
  }
65
65
  return dataValues !== null && dataValues !== void 0 && dataValues.some(value => value < DEFAULT_MIN_VALUE) ? undefined : DEFAULT_MIN_VALUE;
@@ -68,24 +68,21 @@ const getMinValue = (minValue, dataValues, outlierLineMin) => {
68
68
  // outlierLineMax: if there are lines with larger x or y than the data
69
69
  exports.getMinValue = getMinValue;
70
70
  const getMaxValue = (maxValue, dataValues, outlierLineMax) => {
71
- if ((0, _isNumeric.default)(maxValue)) {
71
+ if ((0, _utils.isNumeric)(maxValue)) {
72
72
  return maxValue;
73
73
  }
74
- if ((0, _isNumeric.default)(outlierLineMax)) {
74
+ if ((0, _utils.isNumeric)(outlierLineMax)) {
75
75
  return outlierLineMax;
76
76
  }
77
77
  return dataValues !== null && dataValues !== void 0 && dataValues.every(value => value < DEFAULT_MIN_VALUE) ? DEFAULT_MIN_VALUE : undefined;
78
78
  };
79
79
  exports.getMaxValue = getMaxValue;
80
- const getRegressionLine = function () {
80
+ const getRegressionLine = (regressionLine = {}, visType, isVertical) => {
81
81
  var _regressionLine$title, _regressionLine$title2;
82
- let regressionLine = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
83
- let visType = arguments.length > 1 ? arguments[1] : undefined;
84
- let isVertical = arguments.length > 2 ? arguments[2] : undefined;
85
82
  const fontStyle = (0, _fontStyle.mergeFontStyleWithDefault)((_regressionLine$title = regressionLine.title) === null || _regressionLine$title === void 0 ? void 0 : _regressionLine$title.fontStyle, _fontStyle.FONT_STYLE_REGRESSION_LINE_LABEL);
86
83
  const plotLineStyle = getPlotLineStyle(fontStyle);
87
84
  const plotLineLabelStyle = getPlotLineLabelStyle(fontStyle);
88
- return (0, _isNumeric.default)(regressionLine.value) ? Object.assign({}, plotLineStyle, (0, _objectClean.default)({
85
+ return (0, _utils.isNumeric)(regressionLine.value) ? Object.assign({}, plotLineStyle, (0, _objectClean.default)({
89
86
  value: regressionLine.value,
90
87
  color: regressionLine.color,
91
88
  width: regressionLine.width,
@@ -21,9 +21,7 @@ function getIdAxisMap(customAxes) {
21
21
  return map;
22
22
  }, {});
23
23
  }
24
- function getFullIdAxisMap() {
25
- let customAxes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
26
- let series = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
24
+ function getFullIdAxisMap(customAxes = [], series = []) {
27
25
  const idAxisMap = getIdAxisMap(customAxes.filter(axisItem => series.find(seriesItem => seriesItem.id === axisItem.dimensionItem)));
28
26
 
29
27
  // adds first axis ids to seriesAxisMap
@@ -42,8 +40,7 @@ function getFullIdAxisMap() {
42
40
  // }
43
41
  function getAxisIdsMap(customAxes, series) {
44
42
  const fullIdAxisMap = getFullIdAxisMap(customAxes, series);
45
- return Object.entries(fullIdAxisMap).reduce((map, _ref) => {
46
- let [id, axis] = _ref;
43
+ return Object.entries(fullIdAxisMap).reduce((map, [id, axis]) => {
47
44
  if (!(axis in map)) {
48
45
  map[axis] = [];
49
46
  }
@@ -7,14 +7,13 @@ exports.default = getCustomSVGOptions;
7
7
  var _visTypes = require("../../../../../modules/visTypes.js");
8
8
  var _index = _interopRequireDefault(require("./singleValue/index.js"));
9
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
- function getCustomSVGOptions(_ref) {
11
- let {
12
- extraConfig,
13
- layout,
14
- extraOptions,
15
- metaData,
16
- series
17
- } = _ref;
10
+ function getCustomSVGOptions({
11
+ extraConfig,
12
+ layout,
13
+ extraOptions,
14
+ metaData,
15
+ series
16
+ }) {
18
17
  const baseOptions = {
19
18
  visualizationType: layout.type
20
19
  };
@@ -6,8 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getSingleValueBackgroundColor = getSingleValueBackgroundColor;
7
7
  var _legends = require("../../../../../../modules/legends.js");
8
8
  var _getSingleValueLegendColor = require("./getSingleValueLegendColor.js");
9
- function getSingleValueBackgroundColor(legendOptions, legendSets, value) {
10
- let defaultColor = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'transparent';
9
+ function getSingleValueBackgroundColor(legendOptions, legendSets, value, defaultColor = 'transparent') {
11
10
  const legendColor = (0, _getSingleValueLegendColor.getSingleValueLegendColor)(legendOptions, legendSets, value);
12
11
  return legendColor && legendOptions.style === _legends.LEGEND_DISPLAY_STYLE_FILL ? legendColor : defaultColor;
13
12
  }
@@ -8,13 +8,12 @@ var _ui = require("@dhis2/ui");
8
8
  var _getSingleValueFormattedValue = require("./getSingleValueFormattedValue.js");
9
9
  var _getSingleValueSubtext = require("./getSingleValueSubtext.js");
10
10
  var _getSingleValueTextColor = require("./getSingleValueTextColor.js");
11
- function getSingleValueCustomSVGOptions(_ref) {
12
- let {
13
- layout,
14
- extraOptions,
15
- metaData,
16
- series
17
- } = _ref;
11
+ function getSingleValueCustomSVGOptions({
12
+ layout,
13
+ extraOptions,
14
+ metaData,
15
+ series
16
+ }) {
18
17
  const {
19
18
  dashboard,
20
19
  icon
@@ -4,11 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = _default;
7
- var _isNumeric = _interopRequireDefault(require("d2-utilizr/lib/isNumeric"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
7
+ var _utils = require("../../../../modules/utils.js");
9
8
  function _default(axis) {
10
9
  const decimals = axis.decimals;
11
- return (0, _isNumeric.default)(decimals) ? {
10
+ return (0, _utils.isNumeric)(decimals) ? {
12
11
  formatter: function () {
13
12
  return this.value.toFixed(decimals);
14
13
  }
@@ -4,9 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = _default;
7
- var _isNumeric = _interopRequireDefault(require("d2-utilizr/lib/isNumeric"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
7
+ var _utils = require("../../../../modules/utils.js");
9
8
  function _default(axis) {
10
9
  const steps = axis.steps;
11
- return (0, _isNumeric.default)(steps) ? steps : undefined;
10
+ return (0, _utils.isNumeric)(steps) ? steps : undefined;
12
11
  }
@@ -21,10 +21,9 @@ function getEmptySeriesIndexes(series) {
21
21
  let seriesValues;
22
22
  series[0].data.forEach((value, index) => {
23
23
  seriesValues = [];
24
- series.forEach(_ref => {
25
- let {
26
- data
27
- } = _ref;
24
+ series.forEach(({
25
+ data
26
+ }) => {
28
27
  // handle undefined values due to empty (or shorter) serie data
29
28
  // preserve 0 as valid value
30
29
  seriesValues.push(data[index] === undefined ? null : data[index]);
@@ -29,8 +29,7 @@ var _index6 = _interopRequireDefault(require("./subtitle/index.js"));
29
29
  var _index7 = _interopRequireDefault(require("./title/index.js"));
30
30
  var _index8 = _interopRequireDefault(require("./xAxis/index.js"));
31
31
  var _index9 = _interopRequireDefault(require("./yAxis/index.js"));
32
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
33
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
32
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
34
33
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
35
34
  const getTransformedLayout = layout => ({
36
35
  ...layout,
@@ -42,15 +41,14 @@ const getTransformedExtraOptions = extraOptions => ({
42
41
  ...extraOptions,
43
42
  multiAxisTheme: extraOptions.multiAxisTheme || _themes.defaultMultiAxisTheme1
44
43
  });
45
- function _default(_ref) {
44
+ function _default({
45
+ store,
46
+ layout,
47
+ el,
48
+ extraConfig,
49
+ extraOptions
50
+ }) {
46
51
  var _layout$legend, _layout$seriesKey, _layout$seriesKey2, _layout$seriesKey2$la, _config$xAxis;
47
- let {
48
- store,
49
- layout,
50
- el,
51
- extraConfig,
52
- extraOptions
53
- } = _ref;
54
52
  const _layout = getTransformedLayout(layout);
55
53
  const _extraOptions = getTransformedExtraOptions(extraOptions);
56
54
  const stacked = (0, _visTypes.isStacked)(_layout.type);
@@ -33,13 +33,12 @@ function getLegend(fontStyle, dashboard, visType) {
33
33
  align: (0, _getTextAlignOption.getTextAlignOption)(fontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_ALIGN], _fontStyle.FONT_STYLE_LEGEND, (0, _visTypes.isVerticalType)(visType))
34
34
  });
35
35
  }
36
- function _default(_ref) {
37
- let {
38
- isHidden,
39
- fontStyle,
40
- visType,
41
- dashboard
42
- } = _ref;
36
+ function _default({
37
+ isHidden,
38
+ fontStyle,
39
+ visType,
40
+ dashboard
41
+ }) {
43
42
  const mergedFontStyle = (0, _fontStyle.mergeFontStyleWithDefault)(fontStyle, _fontStyle.FONT_STYLE_LEGEND);
44
43
  return isHidden || visType === _visTypes.VIS_TYPE_SCATTER ? {
45
44
  enabled: false
@@ -4,37 +4,33 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getLegendSetTooltip = exports.applyLegendSet = void 0;
7
- var _isNumeric = _interopRequireDefault(require("d2-utilizr/lib/isNumeric"));
8
7
  var _index = _interopRequireDefault(require("../../../../locales/index.js"));
9
8
  var _legends = require("../../../../modules/legends.js");
9
+ var _utils = require("../../../../modules/utils.js");
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  const OUT_OF_BOUNDS_COLOR = '#CCCCCC';
12
12
  const getLegend = (value, legendSet) => value && legendSet ? (0, _legends.getLegendByValueFromLegendSet)(legendSet, value) : {};
13
- const applyLegendSet = function () {
14
- let seriesObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
15
- let legendSet = arguments.length > 1 ? arguments[1] : undefined;
16
- return !seriesObj.type ? {
17
- ...seriesObj,
18
- data: seriesObj.data.map(value => {
19
- var _getLegend, _getLegend2, _getLegend3, _getLegend4;
20
- return (0, _isNumeric.default)(value) // Single category pass data as [value1, value2]
21
- ? {
22
- y: value,
23
- color: ((_getLegend = getLegend(value, legendSet)) === null || _getLegend === void 0 ? void 0 : _getLegend.color) || OUT_OF_BOUNDS_COLOR,
24
- legend: ((_getLegend2 = getLegend(value, legendSet)) === null || _getLegend2 === void 0 ? void 0 : _getLegend2.name) || '-',
25
- legendSet: legendSet.name
26
- } : Array.isArray(value) // Dual category pass data as [[position1, value1], [position2, value2]]
27
- ? {
28
- x: value[0],
29
- y: value[1],
30
- color: ((_getLegend3 = getLegend(value[1], legendSet)) === null || _getLegend3 === void 0 ? void 0 : _getLegend3.color) || OUT_OF_BOUNDS_COLOR,
31
- legend: ((_getLegend4 = getLegend(value[1], legendSet)) === null || _getLegend4 === void 0 ? void 0 : _getLegend4.name) || '-',
32
- legendSet: legendSet.name
33
- } : value;
34
- })
35
- } : {
36
- ...seriesObj
37
- };
13
+ const applyLegendSet = (seriesObj = {}, legendSet) => !seriesObj.type ? {
14
+ ...seriesObj,
15
+ data: seriesObj.data.map(value => {
16
+ var _getLegend, _getLegend2, _getLegend3, _getLegend4;
17
+ return (0, _utils.isNumeric)(value) // Single category pass data as [value1, value2]
18
+ ? {
19
+ y: value,
20
+ color: ((_getLegend = getLegend(value, legendSet)) === null || _getLegend === void 0 ? void 0 : _getLegend.color) || OUT_OF_BOUNDS_COLOR,
21
+ legend: ((_getLegend2 = getLegend(value, legendSet)) === null || _getLegend2 === void 0 ? void 0 : _getLegend2.name) || '-',
22
+ legendSet: legendSet.name
23
+ } : Array.isArray(value) // Dual category pass data as [[position1, value1], [position2, value2]]
24
+ ? {
25
+ x: value[0],
26
+ y: value[1],
27
+ color: ((_getLegend3 = getLegend(value[1], legendSet)) === null || _getLegend3 === void 0 ? void 0 : _getLegend3.color) || OUT_OF_BOUNDS_COLOR,
28
+ legend: ((_getLegend4 = getLegend(value[1], legendSet)) === null || _getLegend4 === void 0 ? void 0 : _getLegend4.name) || '-',
29
+ legendSet: legendSet.name
30
+ } : value;
31
+ })
32
+ } : {
33
+ ...seriesObj
38
34
  };
39
35
  exports.applyLegendSet = applyLegendSet;
40
36
  const getLegendSetTooltip = () => ({
@@ -8,15 +8,14 @@ var _index = _interopRequireDefault(require("../../../../locales/index.js"));
8
8
  var _visTypes = require("../../../../modules/visTypes.js");
9
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
10
  const MAX_LABELS = 10;
11
- var _default = _ref => {
12
- let {
13
- visType,
14
- xAxisName,
15
- yAxisName,
16
- showLabels,
17
- tooltipData,
18
- onClick
19
- } = _ref;
11
+ var _default = ({
12
+ visType,
13
+ xAxisName,
14
+ yAxisName,
15
+ showLabels,
16
+ tooltipData,
17
+ onClick
18
+ }) => {
20
19
  const series = {
21
20
  dataLabels: {
22
21
  enabled: showLabels,
@@ -72,16 +72,15 @@ function getIdColorMap(series, layout, extraOptions) {
72
72
  }, {});
73
73
  }
74
74
  }
75
- function getDefault(_ref) {
76
- let {
77
- series,
78
- metaData,
79
- layout,
80
- isStacked,
81
- extraOptions,
82
- legendSets,
83
- displayStrategy
84
- } = _ref;
75
+ function getDefault({
76
+ series,
77
+ metaData,
78
+ layout,
79
+ isStacked,
80
+ extraOptions,
81
+ legendSets,
82
+ displayStrategy
83
+ }) {
85
84
  const fullIdAxisMap = (0, _customAxes.getFullIdAxisMap)(layout.series, series);
86
85
  const idColorMap = getIdColorMap(series, layout, extraOptions);
87
86
  const indexColorPatternMap = getIndexColorPatternMap(series, layout, extraOptions);
@@ -159,17 +158,16 @@ function getDefault(_ref) {
159
158
  }
160
159
  return series;
161
160
  }
162
- function _default(_ref2) {
161
+ function _default({
162
+ series,
163
+ metaData,
164
+ layout,
165
+ isStacked,
166
+ extraOptions,
167
+ legendSets,
168
+ displayStrategy
169
+ }) {
163
170
  var _series;
164
- let {
165
- series,
166
- metaData,
167
- layout,
168
- isStacked,
169
- extraOptions,
170
- legendSets,
171
- displayStrategy
172
- } = _ref2;
173
171
  switch (layout.type) {
174
172
  case _visTypes.VIS_TYPE_SINGLE_VALUE:
175
173
  series = [];
@@ -6,10 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = _default;
7
7
  exports.formatDataLabel = void 0;
8
8
  var _renderValue = require("../../../../../modules/renderValue.js");
9
- const formatDataLabel = function () {
10
- let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
11
- let y = arguments.length > 1 ? arguments[1] : undefined;
12
- let percentage = arguments.length > 2 ? arguments[2] : undefined;
9
+ const formatDataLabel = (name = '', y, percentage) => {
13
10
  const value = (0, _renderValue.separateDigitGroups)(y.toString()).join(' ');
14
11
  return '<span style="font-weight:normal">' + name + '</span><br/>' + value + '<span style="font-weight:normal"> (' + parseFloat(percentage.toFixed(1)) + '%)</span>';
15
12
  };
@@ -11,8 +11,7 @@ var _getFilterText = _interopRequireDefault(require("../../../../util/getFilterT
11
11
  var _getTextAlignOption = require("../getTextAlignOption.js");
12
12
  var _yearOverYear = _interopRequireDefault(require("../title/yearOverYear.js"));
13
13
  var _singleValue = _interopRequireWildcard(require("./singleValue.js"));
14
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
16
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
16
  const DASHBOARD_SUBTITLE = {
18
17
  style: {
@@ -30,10 +30,8 @@ const getLabelOffsetFromTextAlign = textAlign => {
30
30
  return 0;
31
31
  }
32
32
  };
33
- function getPlotLine() {
33
+ function getPlotLine(regressionLine = {}, defaultLabel) {
34
34
  var _regressionLine$title, _regressionLine$title2;
35
- let regressionLine = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
36
- let defaultLabel = arguments.length > 1 ? arguments[1] : undefined;
37
35
  const value = regressionLine.value;
38
36
  if (!(0, _isNumber.default)(value)) {
39
37
  return null;