@hisptz/dhis2-analytics 2.0.0-alpha.0 → 2.0.0-alpha.1

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 (616) hide show
  1. package/dist/components/ChartAnalytics/ChartAnalytics.stories.js +20 -43
  2. package/dist/components/ChartAnalytics/DHIS2Chart.js +17 -43
  3. package/dist/components/ChartAnalytics/DHIS2Chart.js.map +1 -1
  4. package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.js +14 -16
  5. package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.js.map +1 -1
  6. package/dist/components/ChartAnalytics/components/DownloadMenu/constants/menu.js +8 -14
  7. package/dist/components/ChartAnalytics/components/DownloadMenu/index.js +19 -21
  8. package/dist/components/ChartAnalytics/components/DownloadMenu/index.js.map +1 -1
  9. package/dist/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js +0 -1
  10. package/dist/components/ChartAnalytics/hooks/useChart.js +11 -13
  11. package/dist/components/ChartAnalytics/hooks/useChart.js.map +1 -1
  12. package/dist/components/ChartAnalytics/index.js +1 -12
  13. package/dist/components/ChartAnalytics/index.js.map +1 -1
  14. package/dist/components/ChartAnalytics/models/bar.js +3 -6
  15. package/dist/components/ChartAnalytics/models/bar.js.map +1 -1
  16. package/dist/components/ChartAnalytics/models/column.js +6 -9
  17. package/dist/components/ChartAnalytics/models/column.js.map +1 -1
  18. package/dist/components/ChartAnalytics/models/index.js +1 -6
  19. package/dist/components/ChartAnalytics/models/index.js.map +1 -1
  20. package/dist/components/ChartAnalytics/models/line.js +6 -8
  21. package/dist/components/ChartAnalytics/models/line.js.map +1 -1
  22. package/dist/components/ChartAnalytics/models/multi-series.js +26 -15
  23. package/dist/components/ChartAnalytics/models/multi-series.js.map +1 -1
  24. package/dist/components/ChartAnalytics/models/pie.js +8 -8
  25. package/dist/components/ChartAnalytics/models/pie.js.map +1 -1
  26. package/dist/components/ChartAnalytics/services/export.js +7 -20
  27. package/dist/components/ChartAnalytics/services/export.js.map +1 -1
  28. package/dist/components/ChartAnalytics/styles/custom-highchart.css +40 -0
  29. package/dist/components/ChartAnalytics/styles/custom-highchart.css.map +1 -0
  30. package/dist/components/ChartAnalytics/types/props.js +0 -1
  31. package/dist/components/ChartAnalytics/utils/chart.js +24 -31
  32. package/dist/components/ChartAnalytics/utils/chart.js.map +1 -1
  33. package/dist/components/CircularProgressDashboard/CircularProgressIndicator.js +14 -23
  34. package/dist/components/CircularProgressDashboard/CircularProgressIndicator.js.map +1 -1
  35. package/dist/components/CircularProgressDashboard/CircularProgressIndicator.stories.js +3 -10
  36. package/dist/components/CircularProgressDashboard/index.js +2 -19
  37. package/dist/components/CircularProgressDashboard/index.js.map +1 -1
  38. package/dist/components/CircularProgressDashboard/types/props.js +0 -1
  39. package/dist/components/DHIS2PivotTable/DHIS2PivotTable.js +13 -15
  40. package/dist/components/DHIS2PivotTable/DHIS2PivotTable.js.map +1 -1
  41. package/dist/components/DHIS2PivotTable/DHIS2PivotTable.stories.js +5 -14
  42. package/dist/components/DHIS2PivotTable/components/Table/index.js +4 -6
  43. package/dist/components/DHIS2PivotTable/components/TableBody/index.js +30 -36
  44. package/dist/components/DHIS2PivotTable/components/TableBody/index.js.map +1 -1
  45. package/dist/components/DHIS2PivotTable/components/TableHeaders/index.js +27 -33
  46. package/dist/components/DHIS2PivotTable/components/TableHeaders/index.js.map +1 -1
  47. package/dist/components/DHIS2PivotTable/index.js +2 -19
  48. package/dist/components/DHIS2PivotTable/index.js.map +1 -1
  49. package/dist/components/DHIS2PivotTable/interfaces/index.js +0 -1
  50. package/dist/components/DHIS2PivotTable/services/engine.js +10 -18
  51. package/dist/components/DHIS2PivotTable/services/engine.js.map +1 -1
  52. package/dist/components/DHIS2PivotTable/state/engine.js +6 -9
  53. package/dist/components/DHIS2PivotTable/state/engine.js.map +1 -1
  54. package/dist/components/Map/DHIS2Map.js +13 -20
  55. package/dist/components/Map/DHIS2Map.js.map +1 -1
  56. package/dist/components/Map/DHIS2Map.stories.js +3 -17
  57. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js +15 -21
  58. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js.map +1 -1
  59. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +10 -15
  60. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js +16 -18
  61. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js.map +1 -1
  62. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +7 -12
  63. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js +24 -30
  64. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js.map +1 -1
  65. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js +42 -49
  66. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js.map +1 -1
  67. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.js +16 -22
  68. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.js.map +1 -1
  69. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js +26 -32
  70. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js.map +1 -1
  71. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js +10 -16
  72. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js.map +1 -1
  73. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js +21 -27
  74. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js.map +1 -1
  75. package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js +16 -19
  76. package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js.map +1 -1
  77. package/dist/components/Map/components/EarthEngineLayerConfiguration/index.js +2 -19
  78. package/dist/components/Map/components/EarthEngineLayerConfiguration/index.js.map +1 -1
  79. package/dist/components/Map/components/MapArea/index.js +60 -54
  80. package/dist/components/Map/components/MapArea/index.js.map +1 -1
  81. package/dist/components/Map/components/MapArea/interfaces/index.js +0 -1
  82. package/dist/components/Map/components/MapControls/components/CustomControl/index.js +3 -5
  83. package/dist/components/Map/components/MapControls/components/DownloadControl/index.js +8 -14
  84. package/dist/components/Map/components/MapControls/components/FullscreenControl/index.js +7 -9
  85. package/dist/components/Map/components/MapControls/index.js +22 -17
  86. package/dist/components/Map/components/MapControls/index.js.map +1 -1
  87. package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js +3 -5
  88. package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js.map +1 -1
  89. package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.js +21 -31
  90. package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.js.map +1 -1
  91. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +59 -34
  92. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js.map +1 -1
  93. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js +99 -89
  94. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js.map +1 -1
  95. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js +9 -14
  96. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js.map +1 -1
  97. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js +62 -69
  98. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js.map +1 -1
  99. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js +0 -1
  100. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +31466 -0
  101. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js.map +1 -0
  102. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js +43 -43
  103. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js.map +1 -1
  104. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js +34 -31
  105. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js.map +1 -1
  106. package/dist/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js +6 -8
  107. package/dist/components/Map/components/MapLayer/components/LegendArea/index.js +46 -57
  108. package/dist/components/Map/components/MapLayer/components/LegendArea/index.js.map +1 -1
  109. package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js +38 -30
  110. package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js.map +1 -1
  111. package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.js +5 -7
  112. package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.js.map +1 -1
  113. package/dist/components/Map/components/MapLayer/components/PointLayer/index.js +21 -28
  114. package/dist/components/Map/components/MapLayer/components/PointLayer/index.js.map +1 -1
  115. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js +39 -13
  116. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js.map +1 -1
  117. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js +40 -32
  118. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js.map +1 -1
  119. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js +13 -20
  120. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js.map +1 -1
  121. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js +17 -23
  122. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js.map +1 -1
  123. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js +30 -25
  124. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js.map +1 -1
  125. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js +17 -20
  126. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js.map +1 -1
  127. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js +15 -21
  128. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js.map +1 -1
  129. package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js +6 -8
  130. package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js.map +1 -1
  131. package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.js +16 -24
  132. package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.js.map +1 -1
  133. package/dist/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +56 -0
  134. package/dist/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css.map +1 -0
  135. package/dist/components/Map/components/MapLayer/index.js +10 -18
  136. package/dist/components/Map/components/MapLayer/index.js.map +1 -1
  137. package/dist/components/Map/components/MapLayer/interfaces/index.js +7 -4
  138. package/dist/components/Map/components/MapLayer/interfaces/index.js.map +1 -1
  139. package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +59 -63
  140. package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js.map +1 -1
  141. package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.js +30 -36
  142. package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.js.map +1 -1
  143. package/dist/components/Map/components/MapProvider/hooks/index.js +6 -10
  144. package/dist/components/Map/components/MapProvider/hooks/index.js.map +1 -1
  145. package/dist/components/Map/components/MapProvider/index.js +25 -31
  146. package/dist/components/Map/components/MapProvider/index.js.map +1 -1
  147. package/dist/components/Map/components/MapUpdater/index.js +5 -7
  148. package/dist/components/Map/components/MapUpdater/index.js.map +1 -1
  149. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js +15 -21
  150. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js.map +1 -1
  151. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +5 -10
  152. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js +53 -60
  153. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js.map +1 -1
  154. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +7 -12
  155. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js +21 -15
  156. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js.map +1 -1
  157. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.js +1 -4
  158. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js +22 -30
  159. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js.map +1 -1
  160. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js +18 -21
  161. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js.map +1 -1
  162. package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js +23 -30
  163. package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js.map +1 -1
  164. package/dist/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js +16 -22
  165. package/dist/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js +16 -22
  166. package/dist/components/Map/components/ThematicLayerConfiguration/components/RadiusField.js +16 -22
  167. package/dist/components/Map/components/ThematicLayerConfiguration/components/TypeField.js +18 -24
  168. package/dist/components/Map/components/ThematicLayerConfiguration/index.js +3 -26
  169. package/dist/components/Map/components/ThematicLayerConfiguration/index.js.map +1 -1
  170. package/dist/components/Map/components/ThematicLayerConfiguration/types/index.js +0 -1
  171. package/dist/components/Map/constants/colors.js +1 -4
  172. package/dist/components/Map/constants/legendSet.js +1 -3
  173. package/dist/components/Map/hooks/map.js +17 -21
  174. package/dist/components/Map/hooks/map.js.map +1 -1
  175. package/dist/components/Map/index.js +5 -40
  176. package/dist/components/Map/index.js.map +1 -1
  177. package/dist/components/Map/interfaces/index.js +0 -1
  178. package/dist/components/Map/state/index.js +5 -9
  179. package/dist/components/Map/state/index.js.map +1 -1
  180. package/dist/components/Map/utils/colors.js +18 -22
  181. package/dist/components/Map/utils/colors.js.map +1 -1
  182. package/dist/components/Map/utils/helpers.js +3 -11
  183. package/dist/components/Map/utils/map.js +25 -24
  184. package/dist/components/Map/utils/map.js.map +1 -1
  185. package/dist/components/SingleValueContainer/SingleValueContainer.stories.js +3 -11
  186. package/dist/components/SingleValueContainer/SingleValueVisualizer.js +17 -35
  187. package/dist/components/SingleValueContainer/SingleValueVisualizer.js.map +1 -1
  188. package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js +14 -21
  189. package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js.map +1 -1
  190. package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js +7 -13
  191. package/dist/components/SingleValueContainer/index.js +3 -19
  192. package/dist/components/SingleValueContainer/index.js.map +1 -1
  193. package/dist/components/SingleValueContainer/types/props.js +0 -1
  194. package/dist/components/Visualization/components/AnalyticsDataProvider/index.js +50 -26
  195. package/dist/components/Visualization/components/AnalyticsDataProvider/index.js.map +1 -1
  196. package/dist/components/Visualization/components/DimensionsProvider/index.js +13 -18
  197. package/dist/components/Visualization/components/LayoutProvider/index.js +11 -14
  198. package/dist/components/Visualization/components/LayoutProvider/index.js.map +1 -1
  199. package/dist/components/Visualization/components/VisualizationDimensionSelector/index.js +30 -36
  200. package/dist/components/Visualization/components/VisualizationDimensionSelector/index.js.map +1 -1
  201. package/dist/components/Visualization/components/VisualizationProvider/index.js +14 -10
  202. package/dist/components/Visualization/components/VisualizationProvider/index.js.map +1 -1
  203. package/dist/components/Visualization/components/VisualizationSelector/index.js +46 -57
  204. package/dist/components/Visualization/components/VisualizationSelector/index.js.map +1 -1
  205. package/dist/components/Visualization/components/VisualizationTypeProvider/index.js +16 -19
  206. package/dist/components/Visualization/components/VisualizationTypeProvider/index.js.map +1 -1
  207. package/dist/components/Visualization/components/VisualizationTypeSelector/index.js +37 -27
  208. package/dist/components/Visualization/components/VisualizationTypeSelector/index.js.map +1 -1
  209. package/dist/components/Visualization/index.js +27 -33
  210. package/dist/components/Visualization/index.js.map +1 -1
  211. package/dist/index.js +6 -47
  212. package/dist/index.js.map +1 -1
  213. package/dist/types/components/ChartAnalytics/DHIS2Chart.d.ts +4 -4
  214. package/dist/types/components/ChartAnalytics/DHIS2Chart.d.ts.map +1 -1
  215. package/dist/types/components/ChartAnalytics/components/DownloadMenu/components/Menu.d.ts +2 -2
  216. package/dist/types/components/ChartAnalytics/components/DownloadMenu/components/Menu.d.ts.map +1 -1
  217. package/dist/types/components/ChartAnalytics/components/DownloadMenu/index.d.ts +2 -2
  218. package/dist/types/components/ChartAnalytics/components/DownloadMenu/index.d.ts.map +1 -1
  219. package/dist/types/components/ChartAnalytics/hooks/useChart.d.ts +1 -1
  220. package/dist/types/components/ChartAnalytics/hooks/useChart.d.ts.map +1 -1
  221. package/dist/types/components/ChartAnalytics/index.d.ts +1 -1
  222. package/dist/types/components/ChartAnalytics/index.d.ts.map +1 -1
  223. package/dist/types/components/ChartAnalytics/models/bar.d.ts +1 -1
  224. package/dist/types/components/ChartAnalytics/models/bar.d.ts.map +1 -1
  225. package/dist/types/components/ChartAnalytics/models/column.d.ts +1 -1
  226. package/dist/types/components/ChartAnalytics/models/column.d.ts.map +1 -1
  227. package/dist/types/components/ChartAnalytics/models/index.d.ts +1 -1
  228. package/dist/types/components/ChartAnalytics/models/index.d.ts.map +1 -1
  229. package/dist/types/components/ChartAnalytics/models/line.d.ts +1 -1
  230. package/dist/types/components/ChartAnalytics/models/line.d.ts.map +1 -1
  231. package/dist/types/components/ChartAnalytics/models/multi-series.d.ts +1 -1
  232. package/dist/types/components/ChartAnalytics/models/multi-series.d.ts.map +1 -1
  233. package/dist/types/components/ChartAnalytics/models/pie.d.ts +1 -1
  234. package/dist/types/components/ChartAnalytics/models/pie.d.ts.map +1 -1
  235. package/dist/types/components/ChartAnalytics/services/export.d.ts.map +1 -1
  236. package/dist/types/components/ChartAnalytics/utils/chart.d.ts +2 -2
  237. package/dist/types/components/ChartAnalytics/utils/chart.d.ts.map +1 -1
  238. package/dist/types/components/CircularProgressDashboard/CircularProgressIndicator.d.ts +2 -2
  239. package/dist/types/components/CircularProgressDashboard/CircularProgressIndicator.d.ts.map +1 -1
  240. package/dist/types/components/CircularProgressDashboard/index.d.ts +2 -2
  241. package/dist/types/components/CircularProgressDashboard/index.d.ts.map +1 -1
  242. package/dist/types/components/DHIS2PivotTable/DHIS2PivotTable.d.ts +2 -2
  243. package/dist/types/components/DHIS2PivotTable/DHIS2PivotTable.d.ts.map +1 -1
  244. package/dist/types/components/DHIS2PivotTable/components/TableHeaders/index.d.ts +1 -1
  245. package/dist/types/components/DHIS2PivotTable/components/TableHeaders/index.d.ts.map +1 -1
  246. package/dist/types/components/DHIS2PivotTable/index.d.ts +2 -2
  247. package/dist/types/components/DHIS2PivotTable/index.d.ts.map +1 -1
  248. package/dist/types/components/DHIS2PivotTable/services/engine.d.ts +1 -1
  249. package/dist/types/components/DHIS2PivotTable/services/engine.d.ts.map +1 -1
  250. package/dist/types/components/DHIS2PivotTable/state/engine.d.ts +2 -2
  251. package/dist/types/components/DHIS2PivotTable/state/engine.d.ts.map +1 -1
  252. package/dist/types/components/Map/DHIS2Map.d.ts +1 -1
  253. package/dist/types/components/Map/DHIS2Map.d.ts.map +1 -1
  254. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.d.ts +2 -2
  255. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.d.ts.map +1 -1
  256. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.d.ts +1 -1
  257. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.d.ts.map +1 -1
  258. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.d.ts +1 -1
  259. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.d.ts.map +1 -1
  260. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/Name.d.ts +1 -1
  261. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/Name.d.ts.map +1 -1
  262. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.d.ts +1 -1
  263. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.d.ts.map +1 -1
  264. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.d.ts +1 -1
  265. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.d.ts.map +1 -1
  266. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.d.ts +1 -1
  267. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.d.ts.map +1 -1
  268. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/hooks/data.d.ts +1 -1
  269. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/hooks/data.d.ts.map +1 -1
  270. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/index.d.ts +2 -2
  271. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/index.d.ts.map +1 -1
  272. package/dist/types/components/Map/components/MapArea/index.d.ts +1 -1
  273. package/dist/types/components/Map/components/MapArea/index.d.ts.map +1 -1
  274. package/dist/types/components/Map/components/MapControls/index.d.ts +2 -2
  275. package/dist/types/components/Map/components/MapControls/index.d.ts.map +1 -1
  276. package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts +1 -1
  277. package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts.map +1 -1
  278. package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/index.d.ts +2 -2
  279. package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/index.d.ts.map +1 -1
  280. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.d.ts +2 -2
  281. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.d.ts.map +1 -1
  282. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.d.ts +1 -1
  283. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.d.ts.map +1 -1
  284. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.d.ts +2 -2
  285. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.d.ts.map +1 -1
  286. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts +1 -1
  287. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts.map +1 -1
  288. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.d.ts +1 -1
  289. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.d.ts.map +1 -1
  290. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.d.ts +2 -2
  291. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.d.ts.map +1 -1
  292. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.d.ts +2 -2
  293. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.d.ts.map +1 -1
  294. package/dist/types/components/Map/components/MapLayer/components/LegendArea/index.d.ts +3 -3
  295. package/dist/types/components/Map/components/MapLayer/components/LegendArea/index.d.ts.map +1 -1
  296. package/dist/types/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.d.ts.map +1 -1
  297. package/dist/types/components/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts +1 -1
  298. package/dist/types/components/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts.map +1 -1
  299. package/dist/types/components/Map/components/MapLayer/components/PointLayer/index.d.ts +1 -1
  300. package/dist/types/components/Map/components/MapLayer/components/PointLayer/index.d.ts.map +1 -1
  301. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.d.ts +1 -1
  302. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.d.ts.map +1 -1
  303. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.d.ts +2 -2
  304. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.d.ts.map +1 -1
  305. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.d.ts +1 -1
  306. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.d.ts.map +1 -1
  307. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.d.ts +2 -2
  308. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.d.ts.map +1 -1
  309. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.d.ts +1 -1
  310. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.d.ts.map +1 -1
  311. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts +4 -4
  312. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts.map +1 -1
  313. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts +2 -2
  314. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts.map +1 -1
  315. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts +1 -1
  316. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts.map +1 -1
  317. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/index.d.ts +1 -1
  318. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/index.d.ts.map +1 -1
  319. package/dist/types/components/Map/components/MapLayer/index.d.ts +2 -2
  320. package/dist/types/components/Map/components/MapLayer/index.d.ts.map +1 -1
  321. package/dist/types/components/Map/components/MapLayer/interfaces/index.d.ts +4 -4
  322. package/dist/types/components/Map/components/MapLayer/interfaces/index.d.ts.map +1 -1
  323. package/dist/types/components/Map/components/MapProvider/components/MapLayerProvider/index.d.ts +2 -2
  324. package/dist/types/components/Map/components/MapProvider/components/MapLayerProvider/index.d.ts.map +1 -1
  325. package/dist/types/components/Map/components/MapProvider/hooks/index.d.ts +3 -3
  326. package/dist/types/components/Map/components/MapProvider/index.d.ts +2 -2
  327. package/dist/types/components/Map/components/MapProvider/index.d.ts.map +1 -1
  328. package/dist/types/components/Map/components/MapUpdater/index.d.ts +1 -1
  329. package/dist/types/components/Map/components/MapUpdater/index.d.ts.map +1 -1
  330. package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.d.ts +2 -2
  331. package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.d.ts.map +1 -1
  332. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts +1 -1
  333. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts.map +1 -1
  334. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.d.ts +1 -1
  335. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.d.ts.map +1 -1
  336. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.d.ts +1 -1
  337. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.d.ts.map +1 -1
  338. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts +1 -1
  339. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts.map +1 -1
  340. package/dist/types/components/Map/components/ThematicLayerConfiguration/index.d.ts +3 -3
  341. package/dist/types/components/Map/components/ThematicLayerConfiguration/index.d.ts.map +1 -1
  342. package/dist/types/components/Map/hooks/map.d.ts.map +1 -1
  343. package/dist/types/components/Map/index.d.ts +5 -5
  344. package/dist/types/components/Map/index.d.ts.map +1 -1
  345. package/dist/types/components/Map/interfaces/index.d.ts +2 -2
  346. package/dist/types/components/Map/interfaces/index.d.ts.map +1 -1
  347. package/dist/types/components/Map/state/index.d.ts +2 -2
  348. package/dist/types/components/Map/state/index.d.ts.map +1 -1
  349. package/dist/types/components/Map/utils/colors.d.ts +1 -1
  350. package/dist/types/components/Map/utils/colors.d.ts.map +1 -1
  351. package/dist/types/components/Map/utils/map.d.ts.map +1 -1
  352. package/dist/types/components/SingleValueContainer/SingleValueVisualizer.d.ts +3 -3
  353. package/dist/types/components/SingleValueContainer/SingleValueVisualizer.d.ts.map +1 -1
  354. package/dist/types/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.d.ts +1 -1
  355. package/dist/types/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.d.ts.map +1 -1
  356. package/dist/types/components/SingleValueContainer/index.d.ts +3 -2
  357. package/dist/types/components/SingleValueContainer/index.d.ts.map +1 -1
  358. package/dist/types/components/Visualization/components/AnalyticsDataProvider/index.d.ts +1 -1
  359. package/dist/types/components/Visualization/components/AnalyticsDataProvider/index.d.ts.map +1 -1
  360. package/dist/types/components/Visualization/components/LayoutProvider/index.d.ts +2 -2
  361. package/dist/types/components/Visualization/components/LayoutProvider/index.d.ts.map +1 -1
  362. package/dist/types/components/Visualization/components/VisualizationDimensionSelector/index.d.ts +1 -1
  363. package/dist/types/components/Visualization/components/VisualizationDimensionSelector/index.d.ts.map +1 -1
  364. package/dist/types/components/Visualization/components/VisualizationProvider/index.d.ts +4 -4
  365. package/dist/types/components/Visualization/components/VisualizationProvider/index.d.ts.map +1 -1
  366. package/dist/types/components/Visualization/components/VisualizationSelector/index.d.ts +10 -10
  367. package/dist/types/components/Visualization/components/VisualizationSelector/index.d.ts.map +1 -1
  368. package/dist/types/components/Visualization/components/VisualizationTypeProvider/index.d.ts +2 -2
  369. package/dist/types/components/Visualization/components/VisualizationTypeProvider/index.d.ts.map +1 -1
  370. package/dist/types/components/Visualization/components/VisualizationTypeSelector/index.d.ts +1 -1
  371. package/dist/types/components/Visualization/components/VisualizationTypeSelector/index.d.ts.map +1 -1
  372. package/dist/types/components/Visualization/index.d.ts +6 -6
  373. package/dist/types/components/Visualization/index.d.ts.map +1 -1
  374. package/dist/types/index.d.ts +6 -6
  375. package/dist/types/index.d.ts.map +1 -1
  376. package/package.json +5 -4
  377. package/dist/components/ChartAnalytics/ChartAnalytics.stories.mjs +0 -254
  378. package/dist/components/ChartAnalytics/ChartAnalytics.stories.mjs.map +0 -1
  379. package/dist/components/ChartAnalytics/DHIS2Chart.mjs +0 -36
  380. package/dist/components/ChartAnalytics/DHIS2Chart.mjs.map +0 -1
  381. package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.mjs +0 -52
  382. package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.mjs.map +0 -1
  383. package/dist/components/ChartAnalytics/components/DownloadMenu/constants/menu.mjs +0 -42
  384. package/dist/components/ChartAnalytics/components/DownloadMenu/constants/menu.mjs.map +0 -1
  385. package/dist/components/ChartAnalytics/components/DownloadMenu/index.mjs +0 -65
  386. package/dist/components/ChartAnalytics/components/DownloadMenu/index.mjs.map +0 -1
  387. package/dist/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.mjs +0 -3
  388. package/dist/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.mjs.map +0 -1
  389. package/dist/components/ChartAnalytics/hooks/useChart.mjs +0 -43
  390. package/dist/components/ChartAnalytics/hooks/useChart.mjs.map +0 -1
  391. package/dist/components/ChartAnalytics/index.mjs +0 -3
  392. package/dist/components/ChartAnalytics/index.mjs.map +0 -1
  393. package/dist/components/ChartAnalytics/models/bar.mjs +0 -21
  394. package/dist/components/ChartAnalytics/models/bar.mjs.map +0 -1
  395. package/dist/components/ChartAnalytics/models/column.mjs +0 -48
  396. package/dist/components/ChartAnalytics/models/column.mjs.map +0 -1
  397. package/dist/components/ChartAnalytics/models/index.mjs +0 -117
  398. package/dist/components/ChartAnalytics/models/index.mjs.map +0 -1
  399. package/dist/components/ChartAnalytics/models/line.mjs +0 -31
  400. package/dist/components/ChartAnalytics/models/line.mjs.map +0 -1
  401. package/dist/components/ChartAnalytics/models/multi-series.mjs +0 -99
  402. package/dist/components/ChartAnalytics/models/multi-series.mjs.map +0 -1
  403. package/dist/components/ChartAnalytics/models/pie.mjs +0 -51
  404. package/dist/components/ChartAnalytics/models/pie.mjs.map +0 -1
  405. package/dist/components/ChartAnalytics/services/export.mjs +0 -35
  406. package/dist/components/ChartAnalytics/services/export.mjs.map +0 -1
  407. package/dist/components/ChartAnalytics/types/props.mjs +0 -3
  408. package/dist/components/ChartAnalytics/types/props.mjs.map +0 -1
  409. package/dist/components/ChartAnalytics/utils/chart.mjs +0 -130
  410. package/dist/components/ChartAnalytics/utils/chart.mjs.map +0 -1
  411. package/dist/components/CircularProgressDashboard/CircularProgressIndicator.mjs +0 -66
  412. package/dist/components/CircularProgressDashboard/CircularProgressIndicator.mjs.map +0 -1
  413. package/dist/components/CircularProgressDashboard/CircularProgressIndicator.stories.mjs +0 -42
  414. package/dist/components/CircularProgressDashboard/CircularProgressIndicator.stories.mjs.map +0 -1
  415. package/dist/components/CircularProgressDashboard/index.mjs +0 -4
  416. package/dist/components/CircularProgressDashboard/index.mjs.map +0 -1
  417. package/dist/components/CircularProgressDashboard/types/props.mjs +0 -3
  418. package/dist/components/CircularProgressDashboard/types/props.mjs.map +0 -1
  419. package/dist/components/DHIS2PivotTable/DHIS2PivotTable.mjs +0 -26
  420. package/dist/components/DHIS2PivotTable/DHIS2PivotTable.mjs.map +0 -1
  421. package/dist/components/DHIS2PivotTable/DHIS2PivotTable.stories.mjs +0 -30
  422. package/dist/components/DHIS2PivotTable/DHIS2PivotTable.stories.mjs.map +0 -1
  423. package/dist/components/DHIS2PivotTable/components/Table/index.mjs +0 -10
  424. package/dist/components/DHIS2PivotTable/components/Table/index.mjs.map +0 -1
  425. package/dist/components/DHIS2PivotTable/components/TableBody/index.mjs +0 -106
  426. package/dist/components/DHIS2PivotTable/components/TableBody/index.mjs.map +0 -1
  427. package/dist/components/DHIS2PivotTable/components/TableHeaders/index.mjs +0 -94
  428. package/dist/components/DHIS2PivotTable/components/TableHeaders/index.mjs.map +0 -1
  429. package/dist/components/DHIS2PivotTable/index.mjs +0 -4
  430. package/dist/components/DHIS2PivotTable/index.mjs.map +0 -1
  431. package/dist/components/DHIS2PivotTable/interfaces/index.mjs +0 -3
  432. package/dist/components/DHIS2PivotTable/interfaces/index.mjs.map +0 -1
  433. package/dist/components/DHIS2PivotTable/services/engine.mjs +0 -93
  434. package/dist/components/DHIS2PivotTable/services/engine.mjs.map +0 -1
  435. package/dist/components/DHIS2PivotTable/state/engine.mjs +0 -17
  436. package/dist/components/DHIS2PivotTable/state/engine.mjs.map +0 -1
  437. package/dist/components/Map/DHIS2Map.mjs +0 -65
  438. package/dist/components/Map/DHIS2Map.mjs.map +0 -1
  439. package/dist/components/Map/DHIS2Map.stories.mjs +0 -366
  440. package/dist/components/Map/DHIS2Map.stories.mjs.map +0 -1
  441. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.mjs +0 -41
  442. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.mjs.map +0 -1
  443. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.mjs +0 -34
  444. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.mjs.map +0 -1
  445. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.mjs +0 -26
  446. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.mjs.map +0 -1
  447. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.mjs +0 -21
  448. package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.mjs.map +0 -1
  449. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.mjs +0 -67
  450. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.mjs.map +0 -1
  451. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.mjs +0 -134
  452. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.mjs.map +0 -1
  453. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.mjs +0 -44
  454. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.mjs.map +0 -1
  455. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.mjs +0 -67
  456. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.mjs.map +0 -1
  457. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.mjs +0 -24
  458. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.mjs.map +0 -1
  459. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.mjs +0 -67
  460. package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.mjs.map +0 -1
  461. package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.mjs +0 -45
  462. package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.mjs.map +0 -1
  463. package/dist/components/Map/components/EarthEngineLayerConfiguration/index.mjs +0 -4
  464. package/dist/components/Map/components/EarthEngineLayerConfiguration/index.mjs.map +0 -1
  465. package/dist/components/Map/components/MapArea/index.mjs +0 -85
  466. package/dist/components/Map/components/MapArea/index.mjs.map +0 -1
  467. package/dist/components/Map/components/MapArea/interfaces/index.mjs +0 -3
  468. package/dist/components/Map/components/MapArea/interfaces/index.mjs.map +0 -1
  469. package/dist/components/Map/components/MapControls/components/CustomControl/index.mjs +0 -16
  470. package/dist/components/Map/components/MapControls/components/CustomControl/index.mjs.map +0 -1
  471. package/dist/components/Map/components/MapControls/components/DownloadControl/index.mjs +0 -15
  472. package/dist/components/Map/components/MapControls/components/DownloadControl/index.mjs.map +0 -1
  473. package/dist/components/Map/components/MapControls/components/FullscreenControl/index.mjs +0 -13
  474. package/dist/components/Map/components/MapControls/components/FullscreenControl/index.mjs.map +0 -1
  475. package/dist/components/Map/components/MapControls/index.mjs +0 -23
  476. package/dist/components/Map/components/MapControls/index.mjs.map +0 -1
  477. package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.mjs +0 -10
  478. package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.mjs.map +0 -1
  479. package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.mjs +0 -52
  480. package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.mjs.map +0 -1
  481. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.mjs +0 -65
  482. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.mjs.map +0 -1
  483. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.mjs +0 -439
  484. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.mjs.map +0 -1
  485. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.mjs +0 -32
  486. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.mjs.map +0 -1
  487. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.mjs +0 -197
  488. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.mjs.map +0 -1
  489. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.mjs +0 -3
  490. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.mjs.map +0 -1
  491. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.mjs +0 -359
  492. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.mjs.map +0 -1
  493. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.mjs +0 -82
  494. package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.mjs.map +0 -1
  495. package/dist/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.mjs +0 -17
  496. package/dist/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.mjs.map +0 -1
  497. package/dist/components/Map/components/MapLayer/components/LegendArea/index.mjs +0 -179
  498. package/dist/components/Map/components/MapLayer/components/LegendArea/index.mjs.map +0 -1
  499. package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.mjs +0 -78
  500. package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.mjs.map +0 -1
  501. package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.mjs +0 -11
  502. package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.mjs.map +0 -1
  503. package/dist/components/Map/components/MapLayer/components/PointLayer/index.mjs +0 -48
  504. package/dist/components/Map/components/MapLayer/components/PointLayer/index.mjs.map +0 -1
  505. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.mjs +0 -36
  506. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.mjs.map +0 -1
  507. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.mjs +0 -111
  508. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.mjs.map +0 -1
  509. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.mjs +0 -41
  510. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.mjs.map +0 -1
  511. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.mjs +0 -50
  512. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.mjs.map +0 -1
  513. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.mjs +0 -42
  514. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.mjs.map +0 -1
  515. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.mjs +0 -37
  516. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.mjs.map +0 -1
  517. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.mjs +0 -40
  518. package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.mjs.map +0 -1
  519. package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.mjs +0 -12
  520. package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.mjs.map +0 -1
  521. package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.mjs +0 -55
  522. package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.mjs.map +0 -1
  523. package/dist/components/Map/components/MapLayer/index.mjs +0 -32
  524. package/dist/components/Map/components/MapLayer/index.mjs.map +0 -1
  525. package/dist/components/Map/components/MapLayer/interfaces/index.mjs +0 -5
  526. package/dist/components/Map/components/MapLayer/interfaces/index.mjs.map +0 -1
  527. package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.mjs +0 -405
  528. package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.mjs.map +0 -1
  529. package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.mjs +0 -115
  530. package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.mjs.map +0 -1
  531. package/dist/components/Map/components/MapProvider/hooks/index.mjs +0 -16
  532. package/dist/components/Map/components/MapProvider/hooks/index.mjs.map +0 -1
  533. package/dist/components/Map/components/MapProvider/index.mjs +0 -95
  534. package/dist/components/Map/components/MapProvider/index.mjs.map +0 -1
  535. package/dist/components/Map/components/MapUpdater/index.mjs +0 -11
  536. package/dist/components/Map/components/MapUpdater/index.mjs.map +0 -1
  537. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.mjs +0 -41
  538. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.mjs.map +0 -1
  539. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.mjs +0 -24
  540. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.mjs.map +0 -1
  541. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.mjs +0 -174
  542. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.mjs.map +0 -1
  543. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.mjs +0 -21
  544. package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.mjs.map +0 -1
  545. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.mjs +0 -24
  546. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.mjs.map +0 -1
  547. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.mjs +0 -436
  548. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.mjs.map +0 -1
  549. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.mjs +0 -71
  550. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.mjs.map +0 -1
  551. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.mjs +0 -74
  552. package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.mjs.map +0 -1
  553. package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.mjs +0 -57
  554. package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.mjs.map +0 -1
  555. package/dist/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.mjs +0 -44
  556. package/dist/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.mjs.map +0 -1
  557. package/dist/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.mjs +0 -60
  558. package/dist/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.mjs.map +0 -1
  559. package/dist/components/Map/components/ThematicLayerConfiguration/components/RadiusField.mjs +0 -54
  560. package/dist/components/Map/components/ThematicLayerConfiguration/components/RadiusField.mjs.map +0 -1
  561. package/dist/components/Map/components/ThematicLayerConfiguration/components/TypeField.mjs +0 -63
  562. package/dist/components/Map/components/ThematicLayerConfiguration/components/TypeField.mjs.map +0 -1
  563. package/dist/components/Map/components/ThematicLayerConfiguration/index.mjs +0 -5
  564. package/dist/components/Map/components/ThematicLayerConfiguration/index.mjs.map +0 -1
  565. package/dist/components/Map/components/ThematicLayerConfiguration/types/index.mjs +0 -3
  566. package/dist/components/Map/components/ThematicLayerConfiguration/types/index.mjs.map +0 -1
  567. package/dist/components/Map/constants/colors.mjs +0 -436
  568. package/dist/components/Map/constants/colors.mjs.map +0 -1
  569. package/dist/components/Map/constants/legendSet.mjs +0 -23
  570. package/dist/components/Map/constants/legendSet.mjs.map +0 -1
  571. package/dist/components/Map/hooks/map.mjs +0 -44
  572. package/dist/components/Map/hooks/map.mjs.map +0 -1
  573. package/dist/components/Map/index.mjs +0 -7
  574. package/dist/components/Map/index.mjs.map +0 -1
  575. package/dist/components/Map/interfaces/index.mjs +0 -3
  576. package/dist/components/Map/interfaces/index.mjs.map +0 -1
  577. package/dist/components/Map/state/index.mjs +0 -18
  578. package/dist/components/Map/state/index.mjs.map +0 -1
  579. package/dist/components/Map/utils/colors.mjs +0 -77
  580. package/dist/components/Map/utils/colors.mjs.map +0 -1
  581. package/dist/components/Map/utils/helpers.mjs +0 -18
  582. package/dist/components/Map/utils/helpers.mjs.map +0 -1
  583. package/dist/components/Map/utils/map.mjs +0 -127
  584. package/dist/components/Map/utils/map.mjs.map +0 -1
  585. package/dist/components/SingleValueContainer/SingleValueContainer.stories.mjs +0 -145
  586. package/dist/components/SingleValueContainer/SingleValueContainer.stories.mjs.map +0 -1
  587. package/dist/components/SingleValueContainer/SingleValueVisualizer.mjs +0 -44
  588. package/dist/components/SingleValueContainer/SingleValueVisualizer.mjs.map +0 -1
  589. package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.mjs +0 -49
  590. package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.mjs.map +0 -1
  591. package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.mjs +0 -22
  592. package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.mjs.map +0 -1
  593. package/dist/components/SingleValueContainer/index.mjs +0 -4
  594. package/dist/components/SingleValueContainer/index.mjs.map +0 -1
  595. package/dist/components/SingleValueContainer/types/props.mjs +0 -3
  596. package/dist/components/SingleValueContainer/types/props.mjs.map +0 -1
  597. package/dist/components/Visualization/components/AnalyticsDataProvider/index.mjs +0 -67
  598. package/dist/components/Visualization/components/AnalyticsDataProvider/index.mjs.map +0 -1
  599. package/dist/components/Visualization/components/DimensionsProvider/index.mjs +0 -35
  600. package/dist/components/Visualization/components/DimensionsProvider/index.mjs.map +0 -1
  601. package/dist/components/Visualization/components/LayoutProvider/index.mjs +0 -17
  602. package/dist/components/Visualization/components/LayoutProvider/index.mjs.map +0 -1
  603. package/dist/components/Visualization/components/VisualizationDimensionSelector/index.mjs +0 -85
  604. package/dist/components/Visualization/components/VisualizationDimensionSelector/index.mjs.map +0 -1
  605. package/dist/components/Visualization/components/VisualizationProvider/index.mjs +0 -13
  606. package/dist/components/Visualization/components/VisualizationProvider/index.mjs.map +0 -1
  607. package/dist/components/Visualization/components/VisualizationSelector/index.mjs +0 -167
  608. package/dist/components/Visualization/components/VisualizationSelector/index.mjs.map +0 -1
  609. package/dist/components/Visualization/components/VisualizationTypeProvider/index.mjs +0 -23
  610. package/dist/components/Visualization/components/VisualizationTypeProvider/index.mjs.map +0 -1
  611. package/dist/components/Visualization/components/VisualizationTypeSelector/index.mjs +0 -39
  612. package/dist/components/Visualization/components/VisualizationTypeSelector/index.mjs.map +0 -1
  613. package/dist/components/Visualization/index.mjs +0 -113
  614. package/dist/components/Visualization/index.mjs.map +0 -1
  615. package/dist/index.mjs +0 -8
  616. package/dist/index.mjs.map +0 -1
@@ -1,16 +1,10 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var reactHookForm = require('react-hook-form');
5
- var i18n = require('@dhis2/d2-i18n');
6
- var ui = require('@dhis2/ui');
7
-
8
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
-
10
- var i18n__default = /*#__PURE__*/_interopDefault(i18n);
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { useFormContext, Controller } from 'react-hook-form';
3
+ import i18n from '@dhis2/d2-i18n';
4
+ import { SingleSelectField, SingleSelectOption } from '@dhis2/ui';
11
5
 
12
6
  function TypeField() {
13
- const { setValue } = reactHookForm.useFormContext();
7
+ const { setValue } = useFormContext();
14
8
  const resetFields = (type) => {
15
9
  if (type === "bubble") {
16
10
  setValue(`radius`, {
@@ -21,17 +15,17 @@ function TypeField() {
21
15
  setValue(`radius`, void 0);
22
16
  }
23
17
  };
24
- return /* @__PURE__ */ jsxRuntime.jsx(
25
- reactHookForm.Controller,
18
+ return /* @__PURE__ */ jsx(
19
+ Controller,
26
20
  {
27
21
  rules: {
28
- required: i18n__default.default.t("Layer type is required")
22
+ required: i18n.t("Layer type is required")
29
23
  },
30
24
  render: ({ field, fieldState }) => {
31
- return /* @__PURE__ */ jsxRuntime.jsxs(
32
- ui.SingleSelectField,
25
+ return /* @__PURE__ */ jsxs(
26
+ SingleSelectField,
33
27
  {
34
- label: i18n__default.default.t("Layer type"),
28
+ label: i18n.t("Layer type"),
35
29
  required: true,
36
30
  error: Boolean(fieldState.error),
37
31
  validationText: fieldState.error?.message,
@@ -41,18 +35,18 @@ function TypeField() {
41
35
  },
42
36
  selected: field.value,
43
37
  children: [
44
- /* @__PURE__ */ jsxRuntime.jsx(
45
- ui.SingleSelectOption,
38
+ /* @__PURE__ */ jsx(
39
+ SingleSelectOption,
46
40
  {
47
41
  value: "choropleth",
48
- label: i18n__default.default.t("Choropleth")
42
+ label: i18n.t("Choropleth")
49
43
  }
50
44
  ),
51
- /* @__PURE__ */ jsxRuntime.jsx(
52
- ui.SingleSelectOption,
45
+ /* @__PURE__ */ jsx(
46
+ SingleSelectOption,
53
47
  {
54
48
  value: "bubble",
55
- label: i18n__default.default.t("Bubble")
49
+ label: i18n.t("Bubble")
56
50
  }
57
51
  )
58
52
  ]
@@ -64,6 +58,6 @@ function TypeField() {
64
58
  );
65
59
  }
66
60
 
67
- exports.TypeField = TypeField;
61
+ export { TypeField };
68
62
  //# sourceMappingURL=out.js.map
69
63
  //# sourceMappingURL=TypeField.js.map
@@ -1,28 +1,5 @@
1
- 'use strict';
2
-
3
- var ThematicLayerConfigModal = require('./ThematicLayerConfigModal');
4
- var ThematicLayerConfiguration = require('./ThematicLayerConfiguration');
5
- var types = require('./types');
6
-
7
-
8
-
9
- Object.keys(ThematicLayerConfigModal).forEach(function (k) {
10
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
11
- enumerable: true,
12
- get: function () { return ThematicLayerConfigModal[k]; }
13
- });
14
- });
15
- Object.keys(ThematicLayerConfiguration).forEach(function (k) {
16
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
17
- enumerable: true,
18
- get: function () { return ThematicLayerConfiguration[k]; }
19
- });
20
- });
21
- Object.keys(types).forEach(function (k) {
22
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
23
- enumerable: true,
24
- get: function () { return types[k]; }
25
- });
26
- });
1
+ export * from './ThematicLayerConfigModal.js';
2
+ export * from './ThematicLayerConfiguration.js';
3
+ export * from './types/index.js';
27
4
  //# sourceMappingURL=out.js.map
28
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/Map/components/ThematicLayerConfiguration/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc","sourcesContent":["export * from \"./ThematicLayerConfigModal\";\nexport * from \"./ThematicLayerConfiguration\";\nexport * from \"./types\";\n"]}
1
+ {"version":3,"sources":["../../../../../src/components/Map/components/ThematicLayerConfiguration/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc","sourcesContent":["export * from \"./ThematicLayerConfigModal.js\";\nexport * from \"./ThematicLayerConfiguration.js\";\nexport * from \"./types/index.js\";\n"]}
@@ -1,4 +1,3 @@
1
- 'use strict';
2
1
 
3
2
  //# sourceMappingURL=out.js.map
4
3
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,3 @@
1
- 'use strict';
2
-
3
1
  const COLOR_PALETTES = {
4
2
  YlGn: {
5
3
  3: ["#f7fcb9", "#addd8e", "#31a354"],
@@ -433,7 +431,6 @@ const qualitativeColors = [
433
431
  "#e31a1c"
434
432
  ];
435
433
 
436
- exports.COLOR_PALETTES = COLOR_PALETTES;
437
- exports.qualitativeColors = qualitativeColors;
434
+ export { COLOR_PALETTES, qualitativeColors };
438
435
  //# sourceMappingURL=out.js.map
439
436
  //# sourceMappingURL=colors.js.map
@@ -1,5 +1,3 @@
1
- 'use strict';
2
-
3
1
  const defaultLegendSet = {
4
2
  legends: [
5
3
  {
@@ -20,6 +18,6 @@ const defaultLegendSet = {
20
18
  ]
21
19
  };
22
20
 
23
- exports.defaultLegendSet = defaultLegendSet;
21
+ export { defaultLegendSet };
24
22
  //# sourceMappingURL=out.js.map
25
23
  //# sourceMappingURL=legendSet.js.map
@@ -1,25 +1,23 @@
1
- 'use strict';
2
-
3
- var leaflet = require('leaflet');
4
- var react = require('react');
5
- var hooks = require('../components/MapProvider/hooks');
6
- var usehooksTs = require('usehooks-ts');
7
- var lodash = require('lodash');
8
- var reactLeaflet = require('react-leaflet');
1
+ import { geoJSON } from 'leaflet';
2
+ import { useMemo, useEffect } from 'react';
3
+ import { useMapOrganisationUnit } from '../components/MapProvider/hooks/index.js';
4
+ import { useElementSize, useMediaQuery } from 'usehooks-ts';
5
+ import { isEmpty } from 'lodash';
6
+ import { useMap } from 'react-leaflet';
9
7
 
10
8
  function useMapBounds() {
11
- const { orgUnits } = hooks.useMapOrganisationUnit();
12
- const geoJSONObject = react.useMemo(
13
- () => leaflet.geoJSON({
9
+ const { orgUnits } = useMapOrganisationUnit();
10
+ const geoJSONObject = useMemo(
11
+ () => geoJSON({
14
12
  type: "FeatureCollection",
15
13
  features: orgUnits?.map((orgUnit) => orgUnit.geoJSON)
16
14
  }),
17
15
  [orgUnits]
18
16
  );
19
- const center = react.useMemo(() => {
17
+ const center = useMemo(() => {
20
18
  return geoJSONObject.getBounds().getCenter();
21
19
  }, [orgUnits]);
22
- const bounds = react.useMemo(() => {
20
+ const bounds = useMemo(() => {
23
21
  return geoJSONObject.getBounds();
24
22
  }, [orgUnits]);
25
23
  return {
@@ -28,21 +26,19 @@ function useMapBounds() {
28
26
  };
29
27
  }
30
28
  function useCenterMap({ bounds }) {
31
- const map = reactLeaflet.useMap();
32
- const [ref, { width, height }] = usehooksTs.useElementSize();
33
- react.useEffect(() => {
34
- if (!lodash.isEmpty(bounds)) {
29
+ const map = useMap();
30
+ const [ref, { width, height }] = useElementSize();
31
+ useEffect(() => {
32
+ if (!isEmpty(bounds)) {
35
33
  map.fitBounds(bounds);
36
34
  }
37
35
  }, [width, height]);
38
36
  return ref;
39
37
  }
40
38
  function usePrintMedia() {
41
- return usehooksTs.useMediaQuery("@media print");
39
+ return useMediaQuery("@media print");
42
40
  }
43
41
 
44
- exports.useCenterMap = useCenterMap;
45
- exports.useMapBounds = useMapBounds;
46
- exports.usePrintMedia = usePrintMedia;
42
+ export { useCenterMap, useMapBounds, usePrintMedia };
47
43
  //# sourceMappingURL=out.js.map
48
44
  //# sourceMappingURL=map.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Map/hooks/map.ts"],"names":[],"mappings":"AAAA,SAAQ,eAA2B;AACnC,SAAQ,WAAW,eAAc;AACjC,SAAQ,8BAA6B;AACrC,SAAQ,gBAAgB,qBAAoB;AAC5C,SAAQ,eAAc;AACtB,SAAQ,cAAa;AAEd,SAAS,eAAe;AAC7B,QAAM,EAAE,SAAS,IAAI,uBAAuB;AAC5C,QAAM,gBAAgB;AAAA,IACpB,MACE,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,UAAU,UAAU,IAAI,CAAC,YAAY,QAAQ,OAAO;AAAA,IACtD,CAAQ;AAAA,IACV,CAAC,QAAQ;AAAA,EACX;AAEA,QAAM,SAAS,QAAQ,MAAM;AAC3B,WAAO,cAAc,UAAU,EAAE,UAAU;AAAA,EAC7C,GAAG,CAAC,QAAQ,CAAC;AACb,QAAM,SAAc,QAAQ,MAAM;AAChC,WAAO,cAAc,UAAU;AAAA,EACjC,GAAG,CAAC,QAAQ,CAAC;AAEb,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;AAEO,SAAS,aAAa,EAAE,OAAO,GAA8B;AAClE,QAAM,MAAM,OAAO;AACnB,QAAM,CAAC,KAAK,EAAE,OAAO,OAAO,CAAC,IAAI,eAAe;AAEhD,YAAU,MAAM;AACd,QAAI,CAAC,QAAQ,MAAM,GAAG;AACpB,UAAI,UAAU,MAAM;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,OAAO,MAAM,CAAC;AAElB,SAAO;AACT;AAEO,SAAS,gBAAgB;AAC9B,SAAO,cAAc,cAAc;AACrC","sourcesContent":["import {geoJSON, LatLngTuple} from \"leaflet\";\nimport {useEffect, useMemo} from \"react\";\nimport {useMapOrganisationUnit} from \"../components/MapProvider/hooks\";\nimport {useElementSize, useMediaQuery} from \"usehooks-ts\";\nimport {isEmpty} from \"lodash\";\nimport {useMap} from \"react-leaflet\";\n\nexport function useMapBounds() {\n const { orgUnits } = useMapOrganisationUnit();\n const geoJSONObject = useMemo(\n () =>\n geoJSON({\n type: \"FeatureCollection\",\n features: orgUnits?.map((orgUnit) => orgUnit.geoJSON),\n } as any),\n [orgUnits]\n );\n\n const center = useMemo(() => {\n return geoJSONObject.getBounds().getCenter();\n }, [orgUnits]);\n const bounds: any = useMemo(() => {\n return geoJSONObject.getBounds();\n }, [orgUnits]);\n\n return {\n center,\n bounds,\n };\n}\n\nexport function useCenterMap({ bounds }: { bounds: LatLngTuple[] }) {\n const map = useMap();\n const [ref, { width, height }] = useElementSize();\n\n useEffect(() => {\n if (!isEmpty(bounds)) {\n map.fitBounds(bounds);\n }\n }, [width, height]);\n\n return ref;\n}\n\nexport function usePrintMedia() {\n return useMediaQuery(\"@media print\");\n}\n"]}
1
+ {"version":3,"sources":["../../../../src/components/Map/hooks/map.ts"],"names":[],"mappings":"AAAA,SAAS,eAA4B;AACrC,SAAS,WAAW,eAAe;AACnC,SAAS,8BAA8B;AACvC,SAAS,gBAAgB,qBAAqB;AAC9C,SAAS,eAAe;AACxB,SAAS,cAAc;AAEhB,SAAS,eAAe;AAC9B,QAAM,EAAE,SAAS,IAAI,uBAAuB;AAC5C,QAAM,gBAAgB;AAAA,IACrB,MACC,QAAQ;AAAA,MACP,MAAM;AAAA,MACN,UAAU,UAAU,IAAI,CAAC,YAAY,QAAQ,OAAO;AAAA,IACrD,CAAQ;AAAA,IACT,CAAC,QAAQ;AAAA,EACV;AAEA,QAAM,SAAS,QAAQ,MAAM;AAC5B,WAAO,cAAc,UAAU,EAAE,UAAU;AAAA,EAC5C,GAAG,CAAC,QAAQ,CAAC;AACb,QAAM,SAAc,QAAQ,MAAM;AACjC,WAAO,cAAc,UAAU;AAAA,EAChC,GAAG,CAAC,QAAQ,CAAC;AAEb,SAAO;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;AAEO,SAAS,aAAa,EAAE,OAAO,GAA8B;AACnE,QAAM,MAAM,OAAO;AACnB,QAAM,CAAC,KAAK,EAAE,OAAO,OAAO,CAAC,IAAI,eAAe;AAEhD,YAAU,MAAM;AACf,QAAI,CAAC,QAAQ,MAAM,GAAG;AACrB,UAAI,UAAU,MAAM;AAAA,IACrB;AAAA,EACD,GAAG,CAAC,OAAO,MAAM,CAAC;AAElB,SAAO;AACR;AAEO,SAAS,gBAAgB;AAC/B,SAAO,cAAc,cAAc;AACpC","sourcesContent":["import { geoJSON, LatLngTuple } from \"leaflet\";\nimport { useEffect, useMemo } from \"react\";\nimport { useMapOrganisationUnit } from \"../components/MapProvider/hooks/index.js\";\nimport { useElementSize, useMediaQuery } from \"usehooks-ts\";\nimport { isEmpty } from \"lodash\";\nimport { useMap } from \"react-leaflet\";\n\nexport function useMapBounds() {\n\tconst { orgUnits } = useMapOrganisationUnit();\n\tconst geoJSONObject = useMemo(\n\t\t() =>\n\t\t\tgeoJSON({\n\t\t\t\ttype: \"FeatureCollection\",\n\t\t\t\tfeatures: orgUnits?.map((orgUnit) => orgUnit.geoJSON),\n\t\t\t} as any),\n\t\t[orgUnits],\n\t);\n\n\tconst center = useMemo(() => {\n\t\treturn geoJSONObject.getBounds().getCenter();\n\t}, [orgUnits]);\n\tconst bounds: any = useMemo(() => {\n\t\treturn geoJSONObject.getBounds();\n\t}, [orgUnits]);\n\n\treturn {\n\t\tcenter,\n\t\tbounds,\n\t};\n}\n\nexport function useCenterMap({ bounds }: { bounds: LatLngTuple[] }) {\n\tconst map = useMap();\n\tconst [ref, { width, height }] = useElementSize();\n\n\tuseEffect(() => {\n\t\tif (!isEmpty(bounds)) {\n\t\t\tmap.fitBounds(bounds);\n\t\t}\n\t}, [width, height]);\n\n\treturn ref;\n}\n\nexport function usePrintMedia() {\n\treturn useMediaQuery(\"@media print\");\n}\n"]}
@@ -1,42 +1,7 @@
1
- 'use strict';
2
-
3
- var DHIS2Map = require('./DHIS2Map');
4
- var interfaces = require('./interfaces');
5
- var EarthEngineLayerConfiguration = require('./components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration');
6
- var ThematicLayerConfiguration = require('./components/ThematicLayerConfiguration/ThematicLayerConfiguration');
7
- var colors = require('./constants/colors');
8
-
9
-
10
-
11
- Object.keys(DHIS2Map).forEach(function (k) {
12
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
13
- enumerable: true,
14
- get: function () { return DHIS2Map[k]; }
15
- });
16
- });
17
- Object.keys(interfaces).forEach(function (k) {
18
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
19
- enumerable: true,
20
- get: function () { return interfaces[k]; }
21
- });
22
- });
23
- Object.keys(EarthEngineLayerConfiguration).forEach(function (k) {
24
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
25
- enumerable: true,
26
- get: function () { return EarthEngineLayerConfiguration[k]; }
27
- });
28
- });
29
- Object.keys(ThematicLayerConfiguration).forEach(function (k) {
30
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
31
- enumerable: true,
32
- get: function () { return ThematicLayerConfiguration[k]; }
33
- });
34
- });
35
- Object.keys(colors).forEach(function (k) {
36
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
37
- enumerable: true,
38
- get: function () { return colors[k]; }
39
- });
40
- });
1
+ export * from './DHIS2Map.js';
2
+ export * from './interfaces/index.js';
3
+ export * from './components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js';
4
+ export * from './components/ThematicLayerConfiguration/ThematicLayerConfiguration.js';
5
+ export * from './constants/colors.js';
41
6
  //# sourceMappingURL=out.js.map
42
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Map/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","sourcesContent":["export * from \"./DHIS2Map\";\nexport * from \"./interfaces\";\nexport * from \"./components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration\";\nexport * from \"./components/ThematicLayerConfiguration/ThematicLayerConfiguration\";\nexport * from \"./constants/colors\";\n"]}
1
+ {"version":3,"sources":["../../../src/components/Map/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","sourcesContent":["export * from \"./DHIS2Map.js\";\nexport * from \"./interfaces/index.js\";\nexport * from \"./components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js\";\nexport * from \"./components/ThematicLayerConfiguration/ThematicLayerConfiguration.js\";\nexport * from \"./constants/colors.js\";\n"]}
@@ -1,4 +1,3 @@
1
- 'use strict';
2
1
 
3
2
  //# sourceMappingURL=out.js.map
4
3
  //# sourceMappingURL=index.js.map
@@ -1,22 +1,18 @@
1
- 'use strict';
1
+ import { createContext } from 'react';
2
2
 
3
- var react = require('react');
4
-
5
- const MapOrgUnitContext = react.createContext({
3
+ const MapOrgUnitContext = createContext({
6
4
  orgUnitSelection: { orgUnits: [] },
7
5
  orgUnits: []
8
6
  });
9
- const MapPeriodContext = react.createContext({
7
+ const MapPeriodContext = createContext({
10
8
  periods: []
11
9
  });
12
- const MapLayersContext = react.createContext({
10
+ const MapLayersContext = createContext({
13
11
  layers: [],
14
12
  updateLayer: () => {
15
13
  }
16
14
  });
17
15
 
18
- exports.MapLayersContext = MapLayersContext;
19
- exports.MapOrgUnitContext = MapOrgUnitContext;
20
- exports.MapPeriodContext = MapPeriodContext;
16
+ export { MapLayersContext, MapOrgUnitContext, MapPeriodContext };
21
17
  //# sourceMappingURL=out.js.map
22
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Map/state/index.tsx"],"names":[],"mappings":"AAEA,SAAS,qBAAqB;AAIvB,MAAM,oBAAoB,cAG9B;AAAA,EACF,kBAAkB,EAAE,UAAU,CAAC,EAAE;AAAA,EACjC,UAAU,CAAC;AACZ,CAAC;AAEM,MAAM,mBAAmB,cAM9B;AAAA,EACA,SAAS,CAAC;AACZ,CAAC;AAEM,MAAM,mBAAmB,cAG7B;AAAA,EACD,QAAQ,CAAC;AAAA,EACT,aAAa,MAAM;AAAA,EAAC;AACtB,CAAC","sourcesContent":["import type { OrgUnitSelection } from \"@hisptz/dhis2-utils\";\nimport { BasePeriod } from \"@hisptz/dhis2-utils\";\nimport { createContext } from \"react\";\nimport { CustomMapLayer } from \"../components/MapLayer/interfaces\";\nimport { MapOrgUnit } from \"../interfaces\";\n\nexport const MapOrgUnitContext = createContext<{\n\torgUnitSelection: OrgUnitSelection;\n\torgUnits?: MapOrgUnit[];\n}>({\n\torgUnitSelection: { orgUnits: [] },\n\torgUnits: [],\n});\n\nexport const MapPeriodContext = createContext<\n | {\n periods?: BasePeriod[];\n range?: { start: Date; end: Date };\n }\n | undefined\n>({\n periods: [],\n});\n\nexport const MapLayersContext = createContext<{\n layers: CustomMapLayer[];\n updateLayer: (id: string, updatedLayer: CustomMapLayer) => void;\n}>({\n layers: [],\n updateLayer: () => {},\n});\n"]}
1
+ {"version":3,"sources":["../../../../src/components/Map/state/index.tsx"],"names":[],"mappings":"AAEA,SAAS,qBAAqB;AAIvB,MAAM,oBAAoB,cAG9B;AAAA,EACF,kBAAkB,EAAE,UAAU,CAAC,EAAE;AAAA,EACjC,UAAU,CAAC;AACZ,CAAC;AAEM,MAAM,mBAAmB,cAM9B;AAAA,EACD,SAAS,CAAC;AACX,CAAC;AAEM,MAAM,mBAAmB,cAG7B;AAAA,EACF,QAAQ,CAAC;AAAA,EACT,aAAa,MAAM;AAAA,EAAC;AACrB,CAAC","sourcesContent":["import type { OrgUnitSelection } from \"@hisptz/dhis2-utils\";\nimport { BasePeriod } from \"@hisptz/dhis2-utils\";\nimport { createContext } from \"react\";\nimport { CustomMapLayer } from \"../components/MapLayer/interfaces/index.js\";\nimport { MapOrgUnit } from \"../interfaces/index.js\";\n\nexport const MapOrgUnitContext = createContext<{\n\torgUnitSelection: OrgUnitSelection;\n\torgUnits?: MapOrgUnit[];\n}>({\n\torgUnitSelection: { orgUnits: [] },\n\torgUnits: [],\n});\n\nexport const MapPeriodContext = createContext<\n\t| {\n\t\t\tperiods?: BasePeriod[];\n\t\t\trange?: { start: Date; end: Date };\n\t }\n\t| undefined\n>({\n\tperiods: [],\n});\n\nexport const MapLayersContext = createContext<{\n\tlayers: CustomMapLayer[];\n\tupdateLayer: (id: string, updatedLayer: CustomMapLayer) => void;\n}>({\n\tlayers: [],\n\tupdateLayer: () => {},\n});\n"]}
@@ -1,10 +1,8 @@
1
- 'use strict';
1
+ import { hcl } from 'd3-color';
2
+ import { isString } from 'lodash';
3
+ import { COLOR_PALETTES } from '../constants/colors.js';
2
4
 
3
- var d3Color = require('d3-color');
4
- var lodash = require('lodash');
5
- var colors = require('../constants/colors');
6
-
7
- const colorbrewer = colors.COLOR_PALETTES;
5
+ const colorbrewer = COLOR_PALETTES;
8
6
  const getColorPalette = (scale, classes) => {
9
7
  return colorbrewer?.[scale]?.[classes];
10
8
  };
@@ -13,13 +11,18 @@ const getColorClasses = (palette) => {
13
11
  };
14
12
  const getColorScale = (palette) => {
15
13
  const classes = palette.split(",").length;
16
- return colorScales.find((name) => colorbrewer[name][classes]?.join(",") === palette);
14
+ return colorScales.find(
15
+ (name) => colorbrewer[name][classes]?.join(",") === palette
16
+ );
17
17
  };
18
18
  const defaultColorScaleName = "YlOrBr";
19
19
  const defaultClasses = 5;
20
- const defaultColorScale = getColorPalette(defaultColorScaleName, defaultClasses);
20
+ const defaultColorScale = getColorPalette(
21
+ defaultColorScaleName,
22
+ defaultClasses
23
+ );
21
24
  const cssColor = (color) => {
22
- if (!lodash.isString(color)) {
25
+ if (!isString(color)) {
23
26
  return color;
24
27
  } else if (color === "##normal") {
25
28
  return null;
@@ -29,7 +32,10 @@ const cssColor = (color) => {
29
32
  const getUniqueColor = (defaultColors) => {
30
33
  const colors = [...defaultColors];
31
34
  function randomColor() {
32
- const color = "#000000".replace(/0/g, () => (~~(Math.random() * 16)).toString(16));
35
+ const color = "#000000".replace(
36
+ /0/g,
37
+ () => (~~(Math.random() * 16)).toString(16)
38
+ );
33
39
  if (colors.includes(color)) {
34
40
  return randomColor();
35
41
  }
@@ -38,7 +44,7 @@ const getUniqueColor = (defaultColors) => {
38
44
  }
39
45
  return (index) => colors[index] || randomColor();
40
46
  };
41
- const isDarkColor = (color) => d3Color.hcl(color).l < 70;
47
+ const isDarkColor = (color) => hcl(color).l < 70;
42
48
  const getContrastColor = (color) => isDarkColor(color) ? "#fff" : "#000";
43
49
  const colorScales = [
44
50
  "YlOrBr",
@@ -74,16 +80,6 @@ const colorScales = [
74
80
  "Set3"
75
81
  ];
76
82
 
77
- exports.colorScales = colorScales;
78
- exports.cssColor = cssColor;
79
- exports.defaultClasses = defaultClasses;
80
- exports.defaultColorScale = defaultColorScale;
81
- exports.defaultColorScaleName = defaultColorScaleName;
82
- exports.getColorClasses = getColorClasses;
83
- exports.getColorPalette = getColorPalette;
84
- exports.getColorScale = getColorScale;
85
- exports.getContrastColor = getContrastColor;
86
- exports.getUniqueColor = getUniqueColor;
87
- exports.isDarkColor = isDarkColor;
83
+ export { colorScales, cssColor, defaultClasses, defaultColorScale, defaultColorScaleName, getColorClasses, getColorPalette, getColorScale, getContrastColor, getUniqueColor, isDarkColor };
88
84
  //# sourceMappingURL=out.js.map
89
85
  //# sourceMappingURL=colors.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Map/utils/colors.ts"],"names":[],"mappings":"AAAA,SAAS,WAAW;AACpB,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAE/B,MAAM,cAAmC;AAGlC,MAAM,kBAAkB,CAAC,OAAe,YAAoB;AACjE,SAAO,cAAc,KAAK,IAAI,OAAO;AACvC;AAEO,MAAM,kBAAkB,CAAC,YAAoB;AAClD,SAAO,SAAS,MAAM,GAAG,GAAG;AAC9B;AAGO,MAAM,gBAAgB,CAAC,YAAoB;AAChD,QAAM,UAAU,QAAQ,MAAM,GAAG,EAAE;AACnC,SAAO,YAAY,KAAK,CAAC,SAAS,YAAY,IAAI,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,OAAO;AACrF;AAEO,MAAM,wBAAwB;AAC9B,MAAM,iBAAiB;AACvB,MAAM,oBAAoB,gBAAgB,uBAAuB,cAAc;AAG/E,MAAM,WAAW,CAAC,UAAe;AACtC,MAAI,CAAC,SAAS,KAAK,GAAG;AACpB,WAAO;AAAA,EACT,WAAW,UAAU,YAAY;AAE/B,WAAO;AAAA,EACT;AACA,UAAQ,mCAAmC,KAAK,KAAK,IAAI,MAAM,MAAM;AACvE;AAGO,MAAM,iBAAiB,CAAC,kBAAuB;AACpD,QAAM,SAAS,CAAC,GAAG,aAAa;AAEhC,WAAS,cAAsB;AAC7B,UAAM,QAAQ,UAAU,QAAQ,MAAM,OAAO,CAAC,EAAE,KAAK,OAAO,IAAI,KAAK,SAAS,EAAE,CAAC;AAGjF,QAAI,OAAO,SAAS,KAAK,GAAG;AAC1B,aAAO,YAAY;AAAA,IACrB;AAEA,WAAO,KAAK,KAAK;AAEjB,WAAO;AAAA,EACT;AAEA,SAAO,CAAC,UAAkB,OAAO,KAAK,KAAK,YAAY;AACzD;AAGO,MAAM,cAAc,CAAC,UAAkB,IAAI,KAAK,EAAE,IAAI;AAGtD,MAAM,mBAAmB,CAAC,UAAmB,YAAY,KAAK,IAAI,SAAS;AAE3E,MAAM,cAAc;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF","sourcesContent":["import { hcl } from \"d3-color\";\nimport { isString } from \"lodash\";\nimport { COLOR_PALETTES } from \"../constants/colors\";\n\nconst colorbrewer: Record<string, any> = COLOR_PALETTES;\n\n// Returns a color brewer scale for a number of classes\nexport const getColorPalette = (scale: string, classes: number) => {\n return colorbrewer?.[scale]?.[classes];\n};\n\nexport const getColorClasses = (palette: string) => {\n return palette?.split(\",\")?.length;\n};\n\n// Returns color scale name for a palette\nexport const getColorScale = (palette: string) => {\n const classes = palette.split(\",\").length;\n return colorScales.find((name) => colorbrewer[name][classes]?.join(\",\") === palette);\n};\n\nexport const defaultColorScaleName = \"YlOrBr\";\nexport const defaultClasses = 5;\nexport const defaultColorScale = getColorPalette(defaultColorScaleName, defaultClasses);\n\n// Correct colors not adhering to the css standard (add missing #)\nexport const cssColor = (color: any) => {\n if (!isString(color)) {\n return color;\n } else if (color === \"##normal\") {\n // ##normal is used in old map favorites\n return null; // Will apply default color\n }\n return (/(^[0-9A-F]{6}$)|(^[0-9A-F]{3}$)/i.test(color) ? \"#\" : \"\") + color;\n};\n\n// Returns an unique color (first from an array, then random but still unique)\nexport const getUniqueColor = (defaultColors: any) => {\n const colors = [...defaultColors];\n\n function randomColor(): string {\n const color = \"#000000\".replace(/0/g, () => (~~(Math.random() * 16)).toString(16));\n\n // Recursive until color is unique\n if (colors.includes(color)) {\n return randomColor();\n }\n\n colors.push(color);\n\n return color;\n }\n\n return (index: number) => colors[index] || randomColor();\n};\n\n// Returns true if a color is dark\nexport const isDarkColor = (color: string) => hcl(color).l < 70;\n\n// Returns constrasting color\nexport const getContrastColor = (color: string) => (isDarkColor(color) ? \"#fff\" : \"#000\");\nexport type LegendColorScale = typeof colorScales[number];\nexport const colorScales = [\n \"YlOrBr\",\n \"Reds\",\n \"YlGn\",\n \"Greens\",\n \"Blues\",\n \"BuPu\",\n \"RdPu\",\n \"PuRd\",\n \"Greys\",\n \"YlOrBr_reverse\",\n \"Reds_reverse\",\n \"YlGn_reverse\",\n \"Greens_reverse\",\n \"Blues_reverse\",\n \"BuPu_reverse\",\n \"RdPu_reverse\",\n \"PuRd_reverse\",\n \"Greys_reverse\",\n \"PuOr\",\n \"BrBG\",\n \"PRGn\",\n \"PiYG\",\n \"RdBu\",\n \"RdGy\",\n \"RdYlBu\",\n \"Spectral\",\n \"RdYlGn\",\n \"Paired\",\n \"Pastel1\",\n \"Set1\",\n \"Set3\",\n];\n"]}
1
+ {"version":3,"sources":["../../../../src/components/Map/utils/colors.ts"],"names":[],"mappings":"AAAA,SAAS,WAAW;AACpB,SAAS,gBAAgB;AACzB,SAAS,sBAAsB;AAE/B,MAAM,cAAmC;AAGlC,MAAM,kBAAkB,CAAC,OAAe,YAAoB;AAClE,SAAO,cAAc,KAAK,IAAI,OAAO;AACtC;AAEO,MAAM,kBAAkB,CAAC,YAAoB;AACnD,SAAO,SAAS,MAAM,GAAG,GAAG;AAC7B;AAGO,MAAM,gBAAgB,CAAC,YAAoB;AACjD,QAAM,UAAU,QAAQ,MAAM,GAAG,EAAE;AACnC,SAAO,YAAY;AAAA,IAClB,CAAC,SAAS,YAAY,IAAI,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM;AAAA,EACrD;AACD;AAEO,MAAM,wBAAwB;AAC9B,MAAM,iBAAiB;AACvB,MAAM,oBAAoB;AAAA,EAChC;AAAA,EACA;AACD;AAGO,MAAM,WAAW,CAAC,UAAe;AACvC,MAAI,CAAC,SAAS,KAAK,GAAG;AACrB,WAAO;AAAA,EACR,WAAW,UAAU,YAAY;AAEhC,WAAO;AAAA,EACR;AACA,UAAQ,mCAAmC,KAAK,KAAK,IAAI,MAAM,MAAM;AACtE;AAGO,MAAM,iBAAiB,CAAC,kBAAuB;AACrD,QAAM,SAAS,CAAC,GAAG,aAAa;AAEhC,WAAS,cAAsB;AAC9B,UAAM,QAAQ,UAAU;AAAA,MAAQ;AAAA,MAAM,OACpC,CAAC,EAAE,KAAK,OAAO,IAAI,KAAK,SAAS,EAAE;AAAA,IACrC;AAGA,QAAI,OAAO,SAAS,KAAK,GAAG;AAC3B,aAAO,YAAY;AAAA,IACpB;AAEA,WAAO,KAAK,KAAK;AAEjB,WAAO;AAAA,EACR;AAEA,SAAO,CAAC,UAAkB,OAAO,KAAK,KAAK,YAAY;AACxD;AAGO,MAAM,cAAc,CAAC,UAAkB,IAAI,KAAK,EAAE,IAAI;AAGtD,MAAM,mBAAmB,CAAC,UAChC,YAAY,KAAK,IAAI,SAAS;AAExB,MAAM,cAAc;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD","sourcesContent":["import { hcl } from \"d3-color\";\nimport { isString } from \"lodash\";\nimport { COLOR_PALETTES } from \"../constants/colors.js\";\n\nconst colorbrewer: Record<string, any> = COLOR_PALETTES;\n\n// Returns a color brewer scale for a number of classes\nexport const getColorPalette = (scale: string, classes: number) => {\n\treturn colorbrewer?.[scale]?.[classes];\n};\n\nexport const getColorClasses = (palette: string) => {\n\treturn palette?.split(\",\")?.length;\n};\n\n// Returns color scale name for a palette\nexport const getColorScale = (palette: string) => {\n\tconst classes = palette.split(\",\").length;\n\treturn colorScales.find(\n\t\t(name) => colorbrewer[name][classes]?.join(\",\") === palette,\n\t);\n};\n\nexport const defaultColorScaleName = \"YlOrBr\";\nexport const defaultClasses = 5;\nexport const defaultColorScale = getColorPalette(\n\tdefaultColorScaleName,\n\tdefaultClasses,\n);\n\n// Correct colors not adhering to the css standard (add missing #)\nexport const cssColor = (color: any) => {\n\tif (!isString(color)) {\n\t\treturn color;\n\t} else if (color === \"##normal\") {\n\t\t// ##normal is used in old map favorites\n\t\treturn null; // Will apply default color\n\t}\n\treturn (/(^[0-9A-F]{6}$)|(^[0-9A-F]{3}$)/i.test(color) ? \"#\" : \"\") + color;\n};\n\n// Returns an unique color (first from an array, then random but still unique)\nexport const getUniqueColor = (defaultColors: any) => {\n\tconst colors = [...defaultColors];\n\n\tfunction randomColor(): string {\n\t\tconst color = \"#000000\".replace(/0/g, () =>\n\t\t\t(~~(Math.random() * 16)).toString(16),\n\t\t);\n\n\t\t// Recursive until color is unique\n\t\tif (colors.includes(color)) {\n\t\t\treturn randomColor();\n\t\t}\n\n\t\tcolors.push(color);\n\n\t\treturn color;\n\t}\n\n\treturn (index: number) => colors[index] || randomColor();\n};\n\n// Returns true if a color is dark\nexport const isDarkColor = (color: string) => hcl(color).l < 70;\n\n// Returns constrasting color\nexport const getContrastColor = (color: string) =>\n\tisDarkColor(color) ? \"#fff\" : \"#000\";\nexport type LegendColorScale = (typeof colorScales)[number];\nexport const colorScales = [\n\t\"YlOrBr\",\n\t\"Reds\",\n\t\"YlGn\",\n\t\"Greens\",\n\t\"Blues\",\n\t\"BuPu\",\n\t\"RdPu\",\n\t\"PuRd\",\n\t\"Greys\",\n\t\"YlOrBr_reverse\",\n\t\"Reds_reverse\",\n\t\"YlGn_reverse\",\n\t\"Greens_reverse\",\n\t\"Blues_reverse\",\n\t\"BuPu_reverse\",\n\t\"RdPu_reverse\",\n\t\"PuRd_reverse\",\n\t\"Greys_reverse\",\n\t\"PuOr\",\n\t\"BrBG\",\n\t\"PRGn\",\n\t\"PiYG\",\n\t\"RdBu\",\n\t\"RdGy\",\n\t\"RdYlBu\",\n\t\"Spectral\",\n\t\"RdYlGn\",\n\t\"Paired\",\n\t\"Pastel1\",\n\t\"Set1\",\n\t\"Set3\",\n];\n"]}
@@ -1,10 +1,4 @@
1
- 'use strict';
2
-
3
- var L = require('leaflet');
4
-
5
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
-
7
- var L__default = /*#__PURE__*/_interopDefault(L);
1
+ import L from 'leaflet';
8
2
 
9
3
  const getLongestTextLength = (array, key) => array.reduce(
10
4
  (text, curr) => curr[key] && String(curr[key]).length > text.length ? String(curr[key]) : text,
@@ -14,13 +8,11 @@ function getIconUrl(icon, { baseUrl }) {
14
8
  return `${baseUrl}/images/orgunitgroup/${icon ?? "01.png"}`;
15
9
  }
16
10
  function getIcon(url) {
17
- return new L__default.default.Icon({
11
+ return new L.Icon({
18
12
  iconUrl: url
19
13
  });
20
14
  }
21
15
 
22
- exports.getIcon = getIcon;
23
- exports.getIconUrl = getIconUrl;
24
- exports.getLongestTextLength = getLongestTextLength;
16
+ export { getIcon, getIconUrl, getLongestTextLength };
25
17
  //# sourceMappingURL=out.js.map
26
18
  //# sourceMappingURL=helpers.js.map
@@ -1,7 +1,5 @@
1
- 'use strict';
2
-
3
- var lodash = require('lodash');
4
- var colors = require('./colors');
1
+ import { find, filter, isEmpty, forEach, sortBy, isString, compact } from 'lodash';
2
+ import { getColorPalette, defaultClasses, defaultColorScaleName } from './colors.js';
5
3
 
6
4
  function highlightFeature(e, style) {
7
5
  const layer = e.target;
@@ -15,12 +13,15 @@ function getColorFromLegendSet(legends, value) {
15
13
  if (!value) {
16
14
  return "";
17
15
  }
18
- const legend = lodash.find(legends ?? [], (legend2) => legend2?.startValue <= value && legend2?.endValue >= value) ?? {};
16
+ const legend = find(
17
+ legends ?? [],
18
+ (legend2) => legend2?.startValue <= value && legend2?.endValue >= value
19
+ ) ?? {};
19
20
  return legend.color ? legend.color : "transparent";
20
21
  }
21
22
  function getLegendCount(legend, data) {
22
23
  const { startValue, endValue } = legend;
23
- return lodash.filter(data, (d) => d.data >= startValue && d.data <= endValue).length;
24
+ return filter(data, (d) => d.data >= startValue && d.data <= endValue).length;
24
25
  }
25
26
  function getOrgUnitsSelection(orgUnitSelection) {
26
27
  const orgUnits = [];
@@ -33,10 +34,18 @@ function getOrgUnitsSelection(orgUnitSelection) {
33
34
  if (orgUnitSelection.userSubX2Unit) {
34
35
  orgUnits.push("USER_ORGUNIT_GRANDCHILDREN");
35
36
  }
36
- if (!lodash.isEmpty(orgUnitSelection.levels)) {
37
- lodash.forEach(orgUnitSelection.levels, (level) => orgUnits.push(`LEVEL-${level}`));
37
+ if (!isEmpty(orgUnitSelection.levels)) {
38
+ forEach(
39
+ orgUnitSelection.levels,
40
+ (level) => orgUnits.push(`LEVEL-${level}`)
41
+ );
38
42
  }
39
- return [...orgUnits, ...orgUnitSelection?.orgUnits?.map((ou) => `${ou.id}`) ?? []];
43
+ return [
44
+ ...orgUnits,
45
+ ...orgUnitSelection?.orgUnits?.map(
46
+ (ou) => `${ou.id}`
47
+ ) ?? []
48
+ ];
40
49
  }
41
50
  function sanitizeOrgUnits(metaData) {
42
51
  if (metaData) {
@@ -49,7 +58,7 @@ function sanitizeOrgUnits(metaData) {
49
58
  return [];
50
59
  }
51
60
  function toGeoJson(organisationUnits) {
52
- return lodash.sortBy(organisationUnits, "le").map((ou) => {
61
+ return sortBy(organisationUnits, "le").map((ou) => {
53
62
  try {
54
63
  const coord = JSON.parse(ou.co);
55
64
  let gpid = "";
@@ -61,8 +70,8 @@ function toGeoJson(organisationUnits) {
61
70
  type = "MultiPolygon";
62
71
  }
63
72
  }
64
- if (lodash.isString(ou.pg) && ou.pg.length) {
65
- const ids = lodash.compact(ou.pg.split("/"));
73
+ if (isString(ou.pg) && ou.pg.length) {
74
+ const ids = compact(ou.pg.split("/"));
66
75
  if (ids.length >= 2) {
67
76
  gpid = ids[ids.length - 2];
68
77
  }
@@ -104,9 +113,9 @@ function sanitizeDate(startDate) {
104
113
  return startDate;
105
114
  }
106
115
  function generateLegends(maxValue, minValue, { classesCount, colorClass }) {
107
- const count = classesCount ?? colors.defaultClasses;
108
- const color = colorClass ?? colors.defaultColorScaleName;
109
- const colorScale = [...colors.getColorPalette(color, count)].reverse();
116
+ const count = classesCount ?? defaultClasses;
117
+ const color = colorClass ?? defaultColorScaleName;
118
+ const colorScale = [...getColorPalette(color, count)].reverse();
110
119
  const maxLegendValue = 5 * Math.ceil(maxValue / 5);
111
120
  const range = maxLegendValue / count;
112
121
  const values = [];
@@ -124,14 +133,6 @@ function generateLegends(maxValue, minValue, { classesCount, colorClass }) {
124
133
  return values.reverse();
125
134
  }
126
135
 
127
- exports.generateLegends = generateLegends;
128
- exports.getColorFromLegendSet = getColorFromLegendSet;
129
- exports.getLegendCount = getLegendCount;
130
- exports.getOrgUnitsSelection = getOrgUnitsSelection;
131
- exports.highlightFeature = highlightFeature;
132
- exports.resetHighlight = resetHighlight;
133
- exports.sanitizeDate = sanitizeDate;
134
- exports.sanitizeOrgUnits = sanitizeOrgUnits;
135
- exports.toGeoJson = toGeoJson;
136
+ export { generateLegends, getColorFromLegendSet, getLegendCount, getOrgUnitsSelection, highlightFeature, resetHighlight, sanitizeDate, sanitizeOrgUnits, toGeoJson };
136
137
  //# sourceMappingURL=out.js.map
137
138
  //# sourceMappingURL=map.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/Map/utils/map.ts"],"names":["legend"],"mappings":"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","sourcesContent":["import type {Legend, OrganisationUnit, OrgUnitSelection} from \"@hisptz/dhis2-utils\";\nimport {LeafletMouseEvent} from \"leaflet\";\nimport {compact, filter, find, forEach, isEmpty, isString, sortBy} from \"lodash\";\nimport {defaultClasses, defaultColorScaleName, getColorPalette} from \"./colors\";\n\nexport function highlightFeature(e: LeafletMouseEvent, style: any) {\n const layer = e.target;\n layer.setStyle(style);\n // layer.bringToFront();\n}\n\nexport function resetHighlight(e: LeafletMouseEvent, defaultStyle: any) {\n const layer = e.target;\n layer.setStyle(defaultStyle);\n // layer.bringToBack();\n}\n\nexport function getColorFromLegendSet(legends: Legend[], value?: number): string {\n if (!value) {\n return \"\";\n }\n const legend: any = find(legends ?? [], (legend: any) => legend?.startValue <= value && legend?.endValue >= value) ?? {};\n return legend.color ? legend.color : \"transparent\";\n}\n\nexport function getLegendCount(legend: any, data: any) {\n const { startValue, endValue } = legend;\n return filter(data, (d: any) => d.data >= startValue && d.data <= endValue).length;\n}\n\nexport function getOrgUnitsSelection(orgUnitSelection: OrgUnitSelection) {\n const orgUnits = [];\n if (orgUnitSelection.userOrgUnit) {\n orgUnits.push(\"USER_ORGUNIT\");\n }\n\n if (orgUnitSelection.userSubUnit) {\n orgUnits.push(\"USER_ORGUNIT_CHILDREN\");\n }\n\n if (orgUnitSelection.userSubX2Unit) {\n orgUnits.push(\"USER_ORGUNIT_GRANDCHILDREN\");\n }\n if (!isEmpty(orgUnitSelection.levels)) {\n forEach(orgUnitSelection.levels, (level) => orgUnits.push(`LEVEL-${level}`));\n }\n\n return [...orgUnits, ...(orgUnitSelection?.orgUnits?.map((ou: OrganisationUnit) => `${ou.id}`) ?? [])];\n}\n\nexport function sanitizeOrgUnits(metaData: any) {\n if (metaData) {\n return metaData?.dimensions?.ou?.map((ouId: string) => ({\n id: ouId,\n name: metaData?.items[ouId]?.name,\n path: metaData?.ouHierarchy?.[ouId],\n }));\n }\n return [];\n}\n\nexport function toGeoJson(organisationUnits: any) {\n return sortBy(organisationUnits, \"le\").map((ou: any) => {\n try {\n const coord = JSON.parse(ou.co);\n let gpid = \"\";\n let gppg = \"\";\n let type = \"Point\";\n\n if (ou.ty === 2) {\n type = \"Polygon\";\n if (ou.co.substring(0, 4) === \"[[[[\") {\n type = \"MultiPolygon\";\n }\n }\n\n // Grand parent\n if (isString(ou.pg) && ou.pg.length) {\n const ids = compact(ou.pg.split(\"/\"));\n\n // Grand parent id\n if (ids.length >= 2) {\n gpid = ids[ids.length - 2] as string;\n }\n\n // Grand parent parent graph\n if (ids.length > 2) {\n gppg = \"/\" + ids.slice(0, ids.length - 2).join(\"/\");\n }\n }\n\n return {\n type: \"Feature\",\n id: ou.id,\n geometry: {\n type,\n coordinates: coord,\n },\n properties: {\n type,\n id: ou.id,\n name: ou.na,\n hasCoordinatesDown: ou.hcd,\n hasCoordinatesUp: ou.hcu,\n level: ou.le,\n grandParentParentGraph: gppg,\n grandParentId: gpid,\n parentGraph: ou.pg,\n parentId: ou.pi,\n parentName: ou.pn,\n dimensions: ou.dimensions,\n },\n };\n } catch (e) {\n return {};\n }\n });\n}\n\nexport function sanitizeDate(startDate: string): string {\n if (startDate?.split(\"-\")?.[0]?.length < 4) {\n return startDate?.split(\"-\")?.reverse()?.join(\"-\");\n }\n return startDate;\n}\n\nexport function generateLegends(maxValue: number, minValue: number, { classesCount, colorClass }: { classesCount: number; colorClass: string }): Array<Legend> {\n const count: number = classesCount ?? defaultClasses;\n const color = colorClass ?? defaultColorScaleName;\n\n const colorScale = [...getColorPalette(color, count)].reverse();\n\n const maxLegendValue = 5 * Math.ceil(maxValue / 5);\n const range = maxLegendValue / count;\n\n const values = [];\n let legendColorsIterator = colorScale.length - 1;\n for (let i = 0; i < maxLegendValue; i += range) {\n const id = colorScale[legendColorsIterator];\n values.push({\n startValue: Math.floor(i),\n endValue: Math.floor(i + range),\n id,\n color: id,\n });\n legendColorsIterator--;\n }\n\n return values.reverse();\n}\n"]}
1
+ {"version":3,"sources":["../../../../src/components/Map/utils/map.ts"],"names":["legend"],"mappings":"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","sourcesContent":["import type {\n\tLegend,\n\tOrganisationUnit,\n\tOrgUnitSelection,\n} from \"@hisptz/dhis2-utils\";\nimport { LeafletMouseEvent } from \"leaflet\";\nimport {\n\tcompact,\n\tfilter,\n\tfind,\n\tforEach,\n\tisEmpty,\n\tisString,\n\tsortBy,\n} from \"lodash\";\nimport {\n\tdefaultClasses,\n\tdefaultColorScaleName,\n\tgetColorPalette,\n} from \"./colors.js\";\n\nexport function highlightFeature(e: LeafletMouseEvent, style: any) {\n\tconst layer = e.target;\n\tlayer.setStyle(style);\n\t// layer.bringToFront();\n}\n\nexport function resetHighlight(e: LeafletMouseEvent, defaultStyle: any) {\n\tconst layer = e.target;\n\tlayer.setStyle(defaultStyle);\n\t// layer.bringToBack();\n}\n\nexport function getColorFromLegendSet(\n\tlegends: Legend[],\n\tvalue?: number,\n): string {\n\tif (!value) {\n\t\treturn \"\";\n\t}\n\tconst legend: any =\n\t\tfind(\n\t\t\tlegends ?? [],\n\t\t\t(legend: any) =>\n\t\t\t\tlegend?.startValue <= value && legend?.endValue >= value,\n\t\t) ?? {};\n\treturn legend.color ? legend.color : \"transparent\";\n}\n\nexport function getLegendCount(legend: any, data: any) {\n\tconst { startValue, endValue } = legend;\n\treturn filter(data, (d: any) => d.data >= startValue && d.data <= endValue)\n\t\t.length;\n}\n\nexport function getOrgUnitsSelection(orgUnitSelection: OrgUnitSelection) {\n\tconst orgUnits = [];\n\tif (orgUnitSelection.userOrgUnit) {\n\t\torgUnits.push(\"USER_ORGUNIT\");\n\t}\n\n\tif (orgUnitSelection.userSubUnit) {\n\t\torgUnits.push(\"USER_ORGUNIT_CHILDREN\");\n\t}\n\n\tif (orgUnitSelection.userSubX2Unit) {\n\t\torgUnits.push(\"USER_ORGUNIT_GRANDCHILDREN\");\n\t}\n\tif (!isEmpty(orgUnitSelection.levels)) {\n\t\tforEach(orgUnitSelection.levels, (level) =>\n\t\t\torgUnits.push(`LEVEL-${level}`),\n\t\t);\n\t}\n\n\treturn [\n\t\t...orgUnits,\n\t\t...(orgUnitSelection?.orgUnits?.map(\n\t\t\t(ou: OrganisationUnit) => `${ou.id}`,\n\t\t) ?? []),\n\t];\n}\n\nexport function sanitizeOrgUnits(metaData: any) {\n\tif (metaData) {\n\t\treturn metaData?.dimensions?.ou?.map((ouId: string) => ({\n\t\t\tid: ouId,\n\t\t\tname: metaData?.items[ouId]?.name,\n\t\t\tpath: metaData?.ouHierarchy?.[ouId],\n\t\t}));\n\t}\n\treturn [];\n}\n\nexport function toGeoJson(organisationUnits: any) {\n\treturn sortBy(organisationUnits, \"le\").map((ou: any) => {\n\t\ttry {\n\t\t\tconst coord = JSON.parse(ou.co);\n\t\t\tlet gpid = \"\";\n\t\t\tlet gppg = \"\";\n\t\t\tlet type = \"Point\";\n\n\t\t\tif (ou.ty === 2) {\n\t\t\t\ttype = \"Polygon\";\n\t\t\t\tif (ou.co.substring(0, 4) === \"[[[[\") {\n\t\t\t\t\ttype = \"MultiPolygon\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Grand parent\n\t\t\tif (isString(ou.pg) && ou.pg.length) {\n\t\t\t\tconst ids = compact(ou.pg.split(\"/\"));\n\n\t\t\t\t// Grand parent id\n\t\t\t\tif (ids.length >= 2) {\n\t\t\t\t\tgpid = ids[ids.length - 2] as string;\n\t\t\t\t}\n\n\t\t\t\t// Grand parent parent graph\n\t\t\t\tif (ids.length > 2) {\n\t\t\t\t\tgppg = \"/\" + ids.slice(0, ids.length - 2).join(\"/\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttype: \"Feature\",\n\t\t\t\tid: ou.id,\n\t\t\t\tgeometry: {\n\t\t\t\t\ttype,\n\t\t\t\t\tcoordinates: coord,\n\t\t\t\t},\n\t\t\t\tproperties: {\n\t\t\t\t\ttype,\n\t\t\t\t\tid: ou.id,\n\t\t\t\t\tname: ou.na,\n\t\t\t\t\thasCoordinatesDown: ou.hcd,\n\t\t\t\t\thasCoordinatesUp: ou.hcu,\n\t\t\t\t\tlevel: ou.le,\n\t\t\t\t\tgrandParentParentGraph: gppg,\n\t\t\t\t\tgrandParentId: gpid,\n\t\t\t\t\tparentGraph: ou.pg,\n\t\t\t\t\tparentId: ou.pi,\n\t\t\t\t\tparentName: ou.pn,\n\t\t\t\t\tdimensions: ou.dimensions,\n\t\t\t\t},\n\t\t\t};\n\t\t} catch (e) {\n\t\t\treturn {};\n\t\t}\n\t});\n}\n\nexport function sanitizeDate(startDate: string): string {\n\tif (startDate?.split(\"-\")?.[0]?.length < 4) {\n\t\treturn startDate?.split(\"-\")?.reverse()?.join(\"-\");\n\t}\n\treturn startDate;\n}\n\nexport function generateLegends(\n\tmaxValue: number,\n\tminValue: number,\n\t{ classesCount, colorClass }: { classesCount: number; colorClass: string },\n): Array<Legend> {\n\tconst count: number = classesCount ?? defaultClasses;\n\tconst color = colorClass ?? defaultColorScaleName;\n\n\tconst colorScale = [...getColorPalette(color, count)].reverse();\n\n\tconst maxLegendValue = 5 * Math.ceil(maxValue / 5);\n\tconst range = maxLegendValue / count;\n\n\tconst values = [];\n\tlet legendColorsIterator = colorScale.length - 1;\n\tfor (let i = 0; i < maxLegendValue; i += range) {\n\t\tconst id = colorScale[legendColorsIterator];\n\t\tvalues.push({\n\t\t\tstartValue: Math.floor(i),\n\t\t\tendValue: Math.floor(i + range),\n\t\t\tid,\n\t\t\tcolor: id,\n\t\t});\n\t\tlegendColorsIterator--;\n\t}\n\n\treturn values.reverse();\n}\n"]}
@@ -1,12 +1,8 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var SingleValueVisualizer = require('./SingleValueVisualizer');
1
+ import { SingleValueVisualizer } from './SingleValueVisualizer';
6
2
 
7
3
  const meta = {
8
4
  title: "Single Value Visualizer",
9
- component: SingleValueVisualizer.SingleValueVisualizer
5
+ component: SingleValueVisualizer
10
6
  };
11
7
  var SingleValueContainer_stories_default = meta;
12
8
  const Default = {
@@ -144,10 +140,6 @@ SingleValuesWithDecimalPlaces.args = {
144
140
  ]
145
141
  };
146
142
 
147
- exports.AnimatedAllValues = AnimatedAllValues;
148
- exports.AnimatedSingleValue = AnimatedSingleValue;
149
- exports.Default = Default;
150
- exports.SingleValuesWithDecimalPlaces = SingleValuesWithDecimalPlaces;
151
- exports.default = SingleValueContainer_stories_default;
143
+ export { AnimatedAllValues, AnimatedSingleValue, Default, SingleValuesWithDecimalPlaces, SingleValueContainer_stories_default as default };
152
144
  //# sourceMappingURL=out.js.map
153
145
  //# sourceMappingURL=SingleValueContainer.stories.js.map