@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 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/components/Map/components/MapProvider/components/MapLayerProvider/index.tsx"],"names":["updatedLayers"],"mappings":"AAyIK,cASA,YATA;AAzIL,OAAO,UAAU;AACjB,SAAS,QAAQ,sBAAsB;AAEvC,SAAS,SAAS,MAAM,MAAM,WAAW;AACzC,SAAgB,aAAa,WAAW,gBAAgB;AACxD,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AAUjC,SAAS,wBAAwB,qBAAqB;AACtD;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEA,SAAS,kBAAkB;AAAA,EACjC;AAAA,EACA;AACD,GAGG;AACF,QAAM,SAAS,cAAc;AAC7B,QAAM,UAAU,uBAAuB;AACvC,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAOxC,CAAC,CAAC;AACJ,QAAM,E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aAAa;AAAA,QACtC;AACA,YAAI,aAAa,GAAG;AACnB,iBAAO;AAAA,QACR;AACA,YAAIA,gBAAe,YAAY,YAAY;AAC3C,eAAOA;AAAA,MACR,CAAC;AAAA,IACF;AAAA,IACA,CAAC;AAAA,EACF;AAEA,YAAU,MAAM;AACf,mBAAe,EAAE,MAAM,QAAQ,KAAK;AAAA,EACrC,GAAG,CAAC,QAAQ,OAAO,CAAC;AAEpB,QAAM,sBAAsB,CAC3B,MACA,UACI;AACJ,UAAM,OAAO,MAAM;AAEnB,UAAM,cAAc,KAAK,eAAe,CAAC,UAAe;AACvD,YAAM,iBACL,OAAO,QAAQ,OAAO,UAAU,eAAe,OAAO;AACvD,aAAO,mBAAmB;AAAA,IAC3B,CAAC;AAED,QAAI,aAAa;AAChB,kBAAY,YAAY,IAAI;AAAA,QAC3B,GAAG;AAAA,QACH,SAAS,SAAS;AAAA,MACnB,CAAC;AAAA,IACF;AAAA,EACD;AAEA,MAAI,SAAS;AACZ,WACC,oBAAC,SAAI,OAAO,EAAE,QAAQ,QAAQ,OAAO,OAAO,GAC3C,8BAAC,UACA,8BAAC,kBAAe,OAAK,MAAC,GACvB,GACD;AAAA,EAEF;AACA,MAAI,OAAO;AACV,WACC,oBAAC,SAAI,OAAO,EAAE,QAAQ,QAAQ,OAAO,OAAO,GAC3C,8BAAC,UACA,+BAAC,QACC;AAAA,WAAK,EAAE,OAAO;AAAA,MAAE;AAAA,MAAG,MAAM;AAAA,OAC3B,GACD,GACD;AAAA,EAEF;AACA,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,OAAO,EAAE,QAAQ,eAAe,YAAY;AAAA,MAE3C;AAAA;AAAA,EACF;AAEF","sourcesContent":["import i18n from \"@dhis2/d2-i18n\";\nimport { Center, CircularLoader } from \"@dhis2/ui\";\nimport { LayersControlEvent } from \"leaflet\";\nimport { compact, find, head, set } from \"lodash\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport { useMapEvents } from \"react-leaflet\";\nimport { MapLayersContext } from \"../../../../state\";\nimport { MapLayerConfig } from \"../../../MapArea/interfaces\";\nimport {\n\tCustomBoundaryLayer,\n\tCustomGoogleEngineLayer,\n\tCustomMapLayer,\n\tCustomPointLayer,\n\tCustomThematicLayer,\n\tThematicLayerConfig,\n} from \"../../../MapLayer/interfaces\";\nimport { useMapOrganisationUnit, useMapPeriods } from \"../../hooks\";\nimport {\n\tuseGoogleEngineLayers,\n\tusePointLayer,\n\tuseThematicLayers,\n} from \"./hooks\";\n\nexport function MapLayersProvider({\n\tlayers,\n\tchildren,\n}: {\n\tlayers: MapLayerConfig;\n\tchildren: React.ReactNode;\n}) {\n\tconst period = useMapPeriods();\n\tconst orgUnit = useMapOrganisationUnit();\n\tconst [updatedLayers, setUpdatedLayers] = useState<\n\t\tArray<\n\t\t\t| CustomThematicLayer\n\t\t\t| CustomBoundaryLayer\n\t\t\t| CustomPointLayer\n\t\t\t| CustomGoogleEngineLayer\n\t\t>\n\t>([]);\n\tconst { sanitizeLayers: sanitizeThematicLayers, error } =\n\t\tuseThematicLayers();\n\tconst { sanitizeLayer: sanitizePointLayer } = usePointLayer();\n\tconst { sanitizeLayers: sanitizeEarthEngineLayers } =\n\t\tuseGoogleEngineLayers();\n\tconst [loading, setLoading] = useState(false);\n\n\tuseMapEvents({\n\t\toverlayremove: (event) => {\n\t\t\tsetupLayerListeners(\"remove\", event);\n\t\t},\n\t\toverlayadd: (event) => {\n\t\t\tsetupLayerListeners(\"add\", event);\n\t\t},\n\t});\n\n\tconst sanitizeLayers = async () => {\n\t\tsetLoading(true);\n\t\ttry {\n\t\t\tconst {\n\t\t\t\tboundaryLayers,\n\t\t\t\tthematicLayers,\n\t\t\t\tpointLayers,\n\t\t\t\tearthEngineLayers,\n\t\t\t} = layers;\n\t\t\tconst sanitizedThematicLayers = await sanitizeThematicLayers([\n\t\t\t\t...(thematicLayers ?? []),\n\t\t\t] as ThematicLayerConfig[]);\n\t\t\tconst sanitizedBoundaryLayers = (boundaryLayers ??\n\t\t\t\t[]) as CustomBoundaryLayer[];\n\t\t\tconst sanitizedPointLayer = head(pointLayers ?? [])\n\t\t\t\t? await sanitizePointLayer(\n\t\t\t\t\t\thead(pointLayers) as CustomPointLayer,\n\t\t\t\t\t)\n\t\t\t\t: undefined;\n\t\t\tconst sanitizedEarthEngineLayers = await sanitizeEarthEngineLayers([\n\t\t\t\t...(earthEngineLayers ?? []),\n\t\t\t] as unknown as CustomGoogleEngineLayer[]);\n\t\t\tsetUpdatedLayers(\n\t\t\t\tcompact([\n\t\t\t\t\t...(sanitizedBoundaryLayers ?? []),\n\t\t\t\t\t...(sanitizedThematicLayers ?? []),\n\t\t\t\t\tsanitizedPointLayer,\n\t\t\t\t\t...(sanitizedEarthEngineLayers ?? []),\n\t\t\t\t]),\n\t\t\t);\n\t\t} catch (e: any) {\n\t\t\tconsole.error(`Error sanitizing layers`, e.toString());\n\t\t}\n\t\tsetLoading(false);\n\t};\n\n\tconst updateLayer = useCallback(\n\t\t(id: string, updatedLayer: CustomMapLayer) => {\n\t\t\tsetUpdatedLayers((prevLayers) => {\n\t\t\t\tconst updatedLayers = [...prevLayers];\n\t\t\t\tconst layerIndex = updatedLayers.findIndex(\n\t\t\t\t\t(layer) => layer.id === updatedLayer.id,\n\t\t\t\t);\n\t\t\t\tif (layerIndex < 0) {\n\t\t\t\t\treturn prevLayers;\n\t\t\t\t}\n\t\t\t\tset(updatedLayers, layerIndex, updatedLayer);\n\t\t\t\treturn updatedLayers;\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tuseEffect(() => {\n\t\tsanitizeLayers().catch(console.error);\n\t}, [period, orgUnit]);\n\n\tconst setupLayerListeners = (\n\t\ttype: \"add\" | \"remove\",\n\t\tevent: LayersControlEvent,\n\t) => {\n\t\tconst name = event.name;\n\n\t\tconst layerConfig = find(updatedLayers, (layer: any) => {\n\t\t\tconst nameFromConfig =\n\t\t\t\tlayer?.name ?? layer?.dataItem?.displayname ?? layer?.label;\n\t\t\treturn nameFromConfig === name;\n\t\t});\n\n\t\tif (layerConfig) {\n\t\t\tupdateLayer(layerConfig.id, {\n\t\t\t\t...layerConfig,\n\t\t\t\tenabled: type === \"add\",\n\t\t\t});\n\t\t}\n\t};\n\n\tif (loading) {\n\t\treturn (\n\t\t\t<div style={{ height: \"100%\", width: \"100%\" }}>\n\t\t\t\t<Center>\n\t\t\t\t\t<CircularLoader small />\n\t\t\t\t</Center>\n\t\t\t</div>\n\t\t);\n\t}\n\tif (error) {\n\t\treturn (\n\t\t\t<div style={{ height: \"100%\", width: \"100%\" }}>\n\t\t\t\t<Center>\n\t\t\t\t\t<h4>\n\t\t\t\t\t\t{i18n.t(\"Error\")}: {error.message}\n\t\t\t\t\t</h4>\n\t\t\t\t</Center>\n\t\t\t</div>\n\t\t);\n\t}\n\treturn (\n\t\t<MapLayersContext.Provider\n\t\t\tvalue={{ layers: updatedLayers, updateLayer }}\n\t\t>\n\t\t\t{children}\n\t\t</MapLayersContext.Provider>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["../../../../../../../src/components/Map/components/MapProvider/components/MapLayerProvider/index.tsx"],"names":["updatedLayers"],"mappings":"AAyIK,cASA,YATA;AAzIL,OAAO,UAAU;AACjB,SAAS,QAAQ,sBAAsB;AAEvC,SAAS,SAAS,MAAM,MAAM,WAAW;AACzC,SAAgB,aAAa,WAAW,gBAAgB;AACxD,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AAUjC,SAAS,wBAAwB,qBAAqB;AACtD;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEA,SAAS,kBAAkB;AAAA,EACjC;AAAA,EACA;AACD,GAGG;AACF,QAAM,SAAS,cAAc;AAC7B,QAAM,UAAU,uBAAuB;AACvC,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAOxC,CAAC,CAAC;AACJ,QAAM,EAAE,gBAAgB,wBAAwB,MAAM,IACrD,kBAAkB;AACnB,QAAM,EAAE,eAAe,mBAAmB,IAA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BAAe,YAAY,YAAY;AAC3C,eAAOA;AAAA,MACR,CAAC;AAAA,IACF;AAAA,IACA,CAAC;AAAA,EACF;AAEA,YAAU,MAAM;AACf,mBAAe,EAAE,MAAM,QAAQ,KAAK;AAAA,EACrC,GAAG,CAAC,QAAQ,OAAO,CAAC;AAEpB,QAAM,sBAAsB,CAC3B,MACA,UACI;AACJ,UAAM,OAAO,MAAM;AAEnB,UAAM,cAAc,KAAK,eAAe,CAAC,UAAe;AACvD,YAAM,iBACL,OAAO,QAAQ,OAAO,UAAU,eAAe,OAAO;AACvD,aAAO,mBAAmB;AAAA,IAC3B,CAAC;AAED,QAAI,aAAa;AAChB,kBAAY,YAAY,IAAI;AAAA,QAC3B,GAAG;AAAA,QACH,SAAS,SAAS;AAAA,MACnB,CAAC;AAAA,IACF;AAAA,EACD;AAEA,MAAI,SAAS;AACZ,WACC,oBAAC,SAAI,OAAO,EAAE,QAAQ,QAAQ,OAAO,OAAO,GAC3C,8BAAC,UACA,8BAAC,kBAAe,OAAK,MAAC,GACvB,GACD;AAAA,EAEF;AACA,MAAI,OAAO;AACV,WACC,oBAAC,SAAI,OAAO,EAAE,QAAQ,QAAQ,OAAO,OAAO,GAC3C,8BAAC,UACA,+BAAC,QACC;AAAA,WAAK,EAAE,OAAO;AAAA,MAAE;AAAA,MAAG,MAAM;AAAA,OAC3B,GACD,GACD;AAAA,EAEF;AACA,SACC;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACA,OAAO,EAAE,QAAQ,eAAe,YAAY;AAAA,MAE3C;AAAA;AAAA,EACF;AAEF","sourcesContent":["import i18n from \"@dhis2/d2-i18n\";\nimport { Center, CircularLoader } from \"@dhis2/ui\";\nimport { LayersControlEvent } from \"leaflet\";\nimport { compact, find, head, set } from \"lodash\";\nimport React, { useCallback, useEffect, useState } from \"react\";\nimport { useMapEvents } from \"react-leaflet\";\nimport { MapLayersContext } from \"../../../../state/index.js\";\nimport { MapLayerConfig } from \"../../../MapArea/interfaces/index.js\";\nimport {\n\tCustomBoundaryLayer,\n\tCustomGoogleEngineLayer,\n\tCustomMapLayer,\n\tCustomPointLayer,\n\tCustomThematicLayer,\n\tThematicLayerConfig,\n} from \"../../../MapLayer/interfaces/index.js\";\nimport { useMapOrganisationUnit, useMapPeriods } from \"../../hooks/index.js\";\nimport {\n\tuseGoogleEngineLayers,\n\tusePointLayer,\n\tuseThematicLayers,\n} from \"./hooks/index.js\";\n\nexport function MapLayersProvider({\n\tlayers,\n\tchildren,\n}: {\n\tlayers: MapLayerConfig;\n\tchildren: React.ReactNode;\n}) {\n\tconst period = useMapPeriods();\n\tconst orgUnit = useMapOrganisationUnit();\n\tconst [updatedLayers, setUpdatedLayers] = useState<\n\t\tArray<\n\t\t\t| CustomThematicLayer\n\t\t\t| CustomBoundaryLayer\n\t\t\t| CustomPointLayer\n\t\t\t| CustomGoogleEngineLayer\n\t\t>\n\t>([]);\n\tconst { sanitizeLayers: sanitizeThematicLayers, error } =\n\t\tuseThematicLayers();\n\tconst { sanitizeLayer: sanitizePointLayer } = usePointLayer();\n\tconst { sanitizeLayers: sanitizeEarthEngineLayers } =\n\t\tuseGoogleEngineLayers();\n\tconst [loading, setLoading] = useState(false);\n\n\tuseMapEvents({\n\t\toverlayremove: (event) => {\n\t\t\tsetupLayerListeners(\"remove\", event);\n\t\t},\n\t\toverlayadd: (event) => {\n\t\t\tsetupLayerListeners(\"add\", event);\n\t\t},\n\t});\n\n\tconst sanitizeLayers = async () => {\n\t\tsetLoading(true);\n\t\ttry {\n\t\t\tconst {\n\t\t\t\tboundaryLayers,\n\t\t\t\tthematicLayers,\n\t\t\t\tpointLayers,\n\t\t\t\tearthEngineLayers,\n\t\t\t} = layers;\n\t\t\tconst sanitizedThematicLayers = await sanitizeThematicLayers([\n\t\t\t\t...(thematicLayers ?? []),\n\t\t\t] as ThematicLayerConfig[]);\n\t\t\tconst sanitizedBoundaryLayers = (boundaryLayers ??\n\t\t\t\t[]) as CustomBoundaryLayer[];\n\t\t\tconst sanitizedPointLayer = head(pointLayers ?? [])\n\t\t\t\t? await sanitizePointLayer(\n\t\t\t\t\t\thead(pointLayers) as CustomPointLayer,\n\t\t\t\t\t)\n\t\t\t\t: undefined;\n\t\t\tconst sanitizedEarthEngineLayers = await sanitizeEarthEngineLayers([\n\t\t\t\t...(earthEngineLayers ?? []),\n\t\t\t] as unknown as CustomGoogleEngineLayer[]);\n\t\t\tsetUpdatedLayers(\n\t\t\t\tcompact([\n\t\t\t\t\t...(sanitizedBoundaryLayers ?? []),\n\t\t\t\t\t...(sanitizedThematicLayers ?? []),\n\t\t\t\t\tsanitizedPointLayer,\n\t\t\t\t\t...(sanitizedEarthEngineLayers ?? []),\n\t\t\t\t]),\n\t\t\t);\n\t\t} catch (e: any) {\n\t\t\tconsole.error(`Error sanitizing layers`, e.toString());\n\t\t}\n\t\tsetLoading(false);\n\t};\n\n\tconst updateLayer = useCallback(\n\t\t(id: string, updatedLayer: CustomMapLayer) => {\n\t\t\tsetUpdatedLayers((prevLayers) => {\n\t\t\t\tconst updatedLayers = [...prevLayers];\n\t\t\t\tconst layerIndex = updatedLayers.findIndex(\n\t\t\t\t\t(layer) => layer.id === updatedLayer.id,\n\t\t\t\t);\n\t\t\t\tif (layerIndex < 0) {\n\t\t\t\t\treturn prevLayers;\n\t\t\t\t}\n\t\t\t\tset(updatedLayers, layerIndex, updatedLayer);\n\t\t\t\treturn updatedLayers;\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tuseEffect(() => {\n\t\tsanitizeLayers().catch(console.error);\n\t}, [period, orgUnit]);\n\n\tconst setupLayerListeners = (\n\t\ttype: \"add\" | \"remove\",\n\t\tevent: LayersControlEvent,\n\t) => {\n\t\tconst name = event.name;\n\n\t\tconst layerConfig = find(updatedLayers, (layer: any) => {\n\t\t\tconst nameFromConfig =\n\t\t\t\tlayer?.name ?? layer?.dataItem?.displayname ?? layer?.label;\n\t\t\treturn nameFromConfig === name;\n\t\t});\n\n\t\tif (layerConfig) {\n\t\t\tupdateLayer(layerConfig.id, {\n\t\t\t\t...layerConfig,\n\t\t\t\tenabled: type === \"add\",\n\t\t\t});\n\t\t}\n\t};\n\n\tif (loading) {\n\t\treturn (\n\t\t\t<div style={{ height: \"100%\", width: \"100%\" }}>\n\t\t\t\t<Center>\n\t\t\t\t\t<CircularLoader small />\n\t\t\t\t</Center>\n\t\t\t</div>\n\t\t);\n\t}\n\tif (error) {\n\t\treturn (\n\t\t\t<div style={{ height: \"100%\", width: \"100%\" }}>\n\t\t\t\t<Center>\n\t\t\t\t\t<h4>\n\t\t\t\t\t\t{i18n.t(\"Error\")}: {error.message}\n\t\t\t\t\t</h4>\n\t\t\t\t</Center>\n\t\t\t</div>\n\t\t);\n\t}\n\treturn (\n\t\t<MapLayersContext.Provider\n\t\t\tvalue={{ layers: updatedLayers, updateLayer }}\n\t\t>\n\t\t\t{children}\n\t\t</MapLayersContext.Provider>\n\t);\n}\n"]}
@@ -1,20 +1,16 @@
1
- 'use strict';
2
-
3
- var react = require('react');
4
- var state = require('../../../state');
1
+ import { useContext } from 'react';
2
+ import { MapOrgUnitContext, MapPeriodContext, MapLayersContext } from '../../../state/index.js';
5
3
 
6
4
  function useMapOrganisationUnit() {
7
- return react.useContext(state.MapOrgUnitContext);
5
+ return useContext(MapOrgUnitContext);
8
6
  }
9
7
  function useMapPeriods() {
10
- return react.useContext(state.MapPeriodContext);
8
+ return useContext(MapPeriodContext);
11
9
  }
12
10
  function useMapLayers() {
13
- return react.useContext(state.MapLayersContext);
11
+ return useContext(MapLayersContext);
14
12
  }
15
13
 
16
- exports.useMapLayers = useMapLayers;
17
- exports.useMapOrganisationUnit = useMapOrganisationUnit;
18
- exports.useMapPeriods = useMapPeriods;
14
+ export { useMapLayers, useMapOrganisationUnit, useMapPeriods };
19
15
  //# sourceMappingURL=out.js.map
20
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/components/Map/components/MapProvider/hooks/index.ts"],"names":[],"mappings":"AAAA,SAAS,kBAAkB;AAC3B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEA,SAAS,yBAAyB;AACxC,SAAO,WAAW,iBAAiB;AACpC;AAEO,SAAS,gBAAgB;AAC9B,SAAO,WAAW,gBAAgB;AACpC;AAEO,SAAS,eAAe;AAC7B,SAAO,WAAW,gBAAgB;AACpC","sourcesContent":["import { useContext } from \"react\";\nimport {\n\tMapLayersContext,\n\tMapOrgUnitContext,\n\tMapPeriodContext,\n} from \"../../../state\";\n\nexport function useMapOrganisationUnit() {\n\treturn useContext(MapOrgUnitContext);\n}\n\nexport function useMapPeriods() {\n return useContext(MapPeriodContext);\n}\n\nexport function useMapLayers() {\n return useContext(MapLayersContext);\n}\n"]}
1
+ {"version":3,"sources":["../../../../../../src/components/Map/components/MapProvider/hooks/index.ts"],"names":[],"mappings":"AAAA,SAAS,kBAAkB;AAC3B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAEA,SAAS,yBAAyB;AACxC,SAAO,WAAW,iBAAiB;AACpC;AAEO,SAAS,gBAAgB;AAC/B,SAAO,WAAW,gBAAgB;AACnC;AAEO,SAAS,eAAe;AAC9B,SAAO,WAAW,gBAAgB;AACnC","sourcesContent":["import { useContext } from \"react\";\nimport {\n\tMapLayersContext,\n\tMapOrgUnitContext,\n\tMapPeriodContext,\n} from \"../../../state/index.js\";\n\nexport function useMapOrganisationUnit() {\n\treturn useContext(MapOrgUnitContext);\n}\n\nexport function useMapPeriods() {\n\treturn useContext(MapPeriodContext);\n}\n\nexport function useMapLayers() {\n\treturn useContext(MapLayersContext);\n}\n"]}
@@ -1,18 +1,12 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var appRuntime = require('@dhis2/app-runtime');
5
- var i18n = require('@dhis2/d2-i18n');
6
- var ui = require('@dhis2/ui');
7
- var lodash = require('lodash');
8
- var react = require('react');
9
- var state = require('../../state');
10
- var map = require('../../utils/map');
11
- var dhis2Utils = require('@hisptz/dhis2-utils');
12
-
13
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
14
-
15
- var i18n__default = /*#__PURE__*/_interopDefault(i18n);
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { useDataQuery } from '@dhis2/app-runtime';
3
+ import i18n from '@dhis2/d2-i18n';
4
+ import { Center, CircularLoader } from '@dhis2/ui';
5
+ import { compact, isEmpty } from 'lodash';
6
+ import { useState, useEffect } from 'react';
7
+ import { MapOrgUnitContext, MapPeriodContext } from '../../state/index.js';
8
+ import { getOrgUnitsSelection, sanitizeOrgUnits, toGeoJson } from '../../utils/map.js';
9
+ import { PeriodUtility } from '@hisptz/dhis2-utils';
16
10
 
17
11
  const boundaryQuery = {
18
12
  boundaries: {
@@ -38,20 +32,20 @@ function MapProvider({
38
32
  orgUnitSelection,
39
33
  periodSelection
40
34
  }) {
41
- const [orgUnits, setOrgUnits] = react.useState([]);
42
- const { refetch, loading, error } = appRuntime.useDataQuery(boundaryQuery, {
35
+ const [orgUnits, setOrgUnits] = useState([]);
36
+ const { refetch, loading, error } = useDataQuery(boundaryQuery, {
43
37
  lazy: true
44
38
  });
45
- react.useEffect(() => {
39
+ useEffect(() => {
46
40
  async function getOrgUnits() {
47
- const rawOrgUnitIds = map.getOrgUnitsSelection(orgUnitSelection);
41
+ const rawOrgUnitIds = getOrgUnitsSelection(orgUnitSelection);
48
42
  const data = await refetch({ orgUnitIds: rawOrgUnitIds });
49
43
  const { analytics, boundaries } = data ?? {};
50
- const rawOrgUnits = map.sanitizeOrgUnits(analytics?.metaData);
51
- const geoJSONObjects = map.toGeoJson(
44
+ const rawOrgUnits = sanitizeOrgUnits(analytics?.metaData);
45
+ const geoJSONObjects = toGeoJson(
52
46
  boundaries.filter((bound) => bound.co)
53
47
  );
54
- const orgUnits2 = lodash.compact(
48
+ const orgUnits2 = compact(
55
49
  rawOrgUnits.map((orgUnit) => {
56
50
  const geoJSONObject = geoJSONObjects?.find(
57
51
  (geoJSON) => geoJSON.properties.id === orgUnit.id
@@ -72,21 +66,21 @@ function MapProvider({
72
66
  getOrgUnits().catch((error2) => console.log(error2));
73
67
  }, [orgUnitSelection, refetch]);
74
68
  if (loading) {
75
- return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: "100%", width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Center, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.CircularLoader, { small: true }) }) });
69
+ return /* @__PURE__ */ jsx("div", { style: { height: "100%", width: "100%" }, children: /* @__PURE__ */ jsx(Center, { children: /* @__PURE__ */ jsx(CircularLoader, { small: true }) }) });
76
70
  }
77
71
  if (error) {
78
- return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { height: "100%", width: "100%" }, children: /* @__PURE__ */ jsxRuntime.jsx(ui.Center, { children: /* @__PURE__ */ jsxRuntime.jsxs("h4", { children: [
79
- i18n__default.default.t("Error"),
72
+ return /* @__PURE__ */ jsx("div", { style: { height: "100%", width: "100%" }, children: /* @__PURE__ */ jsx(Center, { children: /* @__PURE__ */ jsxs("h4", { children: [
73
+ i18n.t("Error"),
80
74
  ": ",
81
75
  error.message
82
76
  ] }) }) });
83
77
  }
84
- const periods = lodash.compact(
85
- periodSelection?.periods?.map((pe) => dhis2Utils.PeriodUtility.getPeriodById(pe))
78
+ const periods = compact(
79
+ periodSelection?.periods?.map((pe) => PeriodUtility.getPeriodById(pe))
86
80
  );
87
- if (!lodash.isEmpty(orgUnits)) {
88
- return /* @__PURE__ */ jsxRuntime.jsx(state.MapOrgUnitContext.Provider, { value: { orgUnitSelection, orgUnits }, children: /* @__PURE__ */ jsxRuntime.jsx(
89
- state.MapPeriodContext.Provider,
81
+ if (!isEmpty(orgUnits)) {
82
+ return /* @__PURE__ */ jsx(MapOrgUnitContext.Provider, { value: { orgUnitSelection, orgUnits }, children: /* @__PURE__ */ jsx(
83
+ MapPeriodContext.Provider,
90
84
  {
91
85
  value: { ...periodSelection, periods },
92
86
  children
@@ -96,6 +90,6 @@ function MapProvider({
96
90
  return null;
97
91
  }
98
92
 
99
- exports.MapProvider = MapProvider;
93
+ export { MapProvider };
100
94
  //# sourceMappingURL=out.js.map
101
95
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/Map/components/MapProvider/index.tsx"],"names":["orgUnits","error"],"mappings":"AAgFK,cAUA,YAVA;AAhFL,SAAS,oBAAoB;AAC7B,OAAO,UAAU;AACjB,SAAS,QAAQ,sBAAsB;AACvC,SAAS,SAAS,eAAe;AACjC,SAAgB,WAAW,gBAAgB;AAE3C,SAAS,mBAAmB,wBAAwB;AACpD;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAqB,qBAAqB;AAE1C,MAAM,gBAAgB;AAAA,EACrB,YAAY;AAAA,IACX,UAAU;AAAA,IACV,QAAQ,CAAC,EAAE,WAAW,OAAY;AAAA,MACjC,IAAI,MAAM,YAAY,KAAK,GAAG,CAAC;AAAA,IAChC;AAAA,EACD;AAAA,EACA,WAAW;AAAA,IACV,UAAU;AAAA,IACV,QAAQ,CAAC,EAAE,WAAW,OAAY;AAAA,MACjC,WAAW;AAAA,QACV,MAAM,WAAW,KAAK,GAAG,CAAC;AAAA,QAC1B,OAAM,oBAAI,KAAK,GAAE,YAAY,CAAC;AAAA,MAC/B;AAAA,MACA,UAAU;AAAA,MACV,eAAe;AAAA,IAChB;AAAA,EACD;AACD;AAEO,SAAS,YAAY;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AACD,GAAqB;AACpB,QAAM,CAAC,UAAU,WAAW,IAAI,SAAuB,CAAC,CAAC;AACzD,QAAM,EAAE,SAAS,SAAS,MAAM,IAAI,aAAa,eAAe;AAAA,IAC/D,MAAM;AAAA,EACP,CAAC;AAED,YAAU,MAAM;AACf,mBAAe,cAAc;AAC5B,YAAM,gBAAgB,qBAAqB,gBAAgB;AAC3D,YAAM,OAAO,MAAM,QAAQ,EAAE,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MAAC,iBAAiB;AAAA,MAAjB;AAAA,QACA,OAAO,EAAE,GAAG,iBAAiB,QAAQ;AAAA,QAEpC;AAAA;AAAA,IACF,GACD;AAAA,EAEF;AAEA,SAAO;AACR","sourcesContent":["import { useDataQuery } from \"@dhis2/app-runtime\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport { Center, CircularLoader } from \"@dhis2/ui\";\nimport { compact, isEmpty } from \"lodash\";\nimport React, { useEffect, useState } from \"react\";\nimport { MapOrgUnit, MapProviderProps } from \"../../interfaces\";\nimport { MapOrgUnitContext, MapPeriodContext } from \"../../state\";\nimport {\n\tgetOrgUnitsSelection,\n\tsanitizeOrgUnits,\n\ttoGeoJson,\n} from \"../../utils/map\";\nimport { BasePeriod, PeriodUtility } from \"@hisptz/dhis2-utils\";\n\nconst boundaryQuery = {\n\tboundaries: {\n\t\tresource: \"geoFeatures\",\n\t\tparams: ({ orgUnitIds }: any) => ({\n\t\t\tou: `ou:${orgUnitIds?.join(\";\")}`,\n\t\t}),\n\t},\n\tanalytics: {\n\t\tresource: \"analytics\",\n\t\tparams: ({ orgUnitIds }: any) => ({\n\t\t\tdimension: [\n\t\t\t\t`ou:${orgUnitIds.join(\";\")}`,\n\t\t\t\t`pe:${new Date().getFullYear()}`,\n\t\t\t],\n\t\t\tskipData: true,\n\t\t\thierarchyMeta: true,\n\t\t}),\n\t},\n};\n\nexport function MapProvider({\n\tchildren,\n\torgUnitSelection,\n\tperiodSelection,\n}: MapProviderProps) {\n\tconst [orgUnits, setOrgUnits] = useState<MapOrgUnit[]>([]);\n\tconst { refetch, loading, error } = useDataQuery(boundaryQuery, {\n\t\tlazy: true,\n\t});\n\n\tuseEffect(() => {\n\t\tasync function getOrgUnits() {\n\t\t\tconst rawOrgUnitIds = getOrgUnitsSelection(orgUnitSelection);\n\t\t\tconst data = await refetch({ orgUnitIds: rawOrgUnitIds });\n\t\t\tconst { analytics, boundaries } = (data as any) ?? {};\n\t\t\tconst rawOrgUnits = sanitizeOrgUnits(analytics?.metaData);\n\t\t\tconst geoJSONObjects = toGeoJson(\n\t\t\t\tboundaries.filter((bound: any) => bound.co),\n\t\t\t);\n\t\t\tconst orgUnits: MapOrgUnit[] = compact(\n\t\t\t\trawOrgUnits.map((orgUnit: any) => {\n\t\t\t\t\tconst geoJSONObject: any = geoJSONObjects?.find(\n\t\t\t\t\t\t(geoJSON: any) => geoJSON.properties.id === orgUnit.id,\n\t\t\t\t\t);\n\n\t\t\t\t\tif (!geoJSONObject) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...orgUnit,\n\t\t\t\t\t\tgeoJSON: geoJSONObject,\n\t\t\t\t\t\tbounds: [],\n\t\t\t\t\t\tlevel: geoJSONObject.properties.level,\n\t\t\t\t\t};\n\t\t\t\t}),\n\t\t\t);\n\t\t\tsetOrgUnits(orgUnits);\n\t\t}\n\n\t\tgetOrgUnits().catch((error) => console.log(error));\n\t}, [orgUnitSelection, refetch]);\n\n\tif (loading) {\n\t\treturn (\n\t\t\t<div style={{ height: \"100%\", width: \"100%\" }}>\n\t\t\t\t<Center>\n\t\t\t\t\t<CircularLoader small />\n\t\t\t\t</Center>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif (error) {\n\t\treturn (\n\t\t\t<div style={{ height: \"100%\", width: \"100%\" }}>\n\t\t\t\t<Center>\n\t\t\t\t\t<h4>\n\t\t\t\t\t\t{i18n.t(\"Error\")}: {error.message}\n\t\t\t\t\t</h4>\n\t\t\t\t</Center>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst periods: BasePeriod[] = compact(\n\t\tperiodSelection?.periods?.map((pe) => PeriodUtility.getPeriodById(pe)),\n\t);\n\n\tif (!isEmpty(orgUnits)) {\n\t\treturn (\n\t\t\t<MapOrgUnitContext.Provider value={{ orgUnitSelection, orgUnits }}>\n\t\t\t\t<MapPeriodContext.Provider\n\t\t\t\t\tvalue={{ ...periodSelection, periods }}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</MapPeriodContext.Provider>\n\t\t\t</MapOrgUnitContext.Provider>\n\t\t);\n\t}\n\n\treturn null;\n}\n"]}
1
+ {"version":3,"sources":["../../../../../src/components/Map/components/MapProvider/index.tsx"],"names":["orgUnits","error"],"mappings":"AAgFK,cAUA,YAVA;AAhFL,SAAS,oBAAoB;AAC7B,OAAO,UAAU;AACjB,SAAS,QAAQ,sBAAsB;AACvC,SAAS,SAAS,eAAe;AACjC,SAAgB,WAAW,gBAAgB;AAE3C,SAAS,mBAAmB,wBAAwB;AACpD;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAqB,qBAAqB;AAE1C,MAAM,gBAAgB;AAAA,EACrB,YAAY;AAAA,IACX,UAAU;AAAA,IACV,QAAQ,CAAC,EAAE,WAAW,OAAY;AAAA,MACjC,IAAI,MAAM,YAAY,KAAK,GAAG,CAAC;AAAA,IAChC;AAAA,EACD;AAAA,EACA,WAAW;AAAA,IACV,UAAU;AAAA,IACV,QAAQ,CAAC,EAAE,WAAW,OAAY;AAAA,MACjC,WAAW;AAAA,QACV,MAAM,WAAW,KAAK,GAAG,CAAC;AAAA,QAC1B,OAAM,oBAAI,KAAK,GAAE,YAAY,CAAC;AAAA,MAC/B;AAAA,MACA,UAAU;AAAA,MACV,eAAe;AAAA,IAChB;AAAA,EACD;AACD;AAEO,SAAS,YAAY;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AACD,GAAqB;AACpB,QAAM,CAAC,UAAU,WAAW,IAAI,SAAuB,CAAC,CAAC;AACzD,QAAM,EAAE,SAAS,SAAS,MAAM,IAAI,aAAa,eAAe;AAAA,IAC/D,MAAM;AAAA,EACP,CAAC;AAED,YAAU,MAAM;AACf,mBAAe,cAAc;AAC5B,YAAM,gBAAgB,qBAAqB,gBAAgB;AAC3D,YAAM,OAAO,MAAM,QAAQ,EAAE,YAAY,cAAc,CAAC;AACxD,YAAM,EAAE,WAAW,WAAW,IAAK,QAA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BAAiB,QAAQ;AAAA,QAEpC;AAAA;AAAA,IACF,GACD;AAAA,EAEF;AAEA,SAAO;AACR","sourcesContent":["import { useDataQuery } from \"@dhis2/app-runtime\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport { Center, CircularLoader } from \"@dhis2/ui\";\nimport { compact, isEmpty } from \"lodash\";\nimport React, { useEffect, useState } from \"react\";\nimport { MapOrgUnit, MapProviderProps } from \"../../interfaces/index.js\";\nimport { MapOrgUnitContext, MapPeriodContext } from \"../../state/index.js\";\nimport {\n\tgetOrgUnitsSelection,\n\tsanitizeOrgUnits,\n\ttoGeoJson,\n} from \"../../utils/map.js\";\nimport { BasePeriod, PeriodUtility } from \"@hisptz/dhis2-utils\";\n\nconst boundaryQuery = {\n\tboundaries: {\n\t\tresource: \"geoFeatures\",\n\t\tparams: ({ orgUnitIds }: any) => ({\n\t\t\tou: `ou:${orgUnitIds?.join(\";\")}`,\n\t\t}),\n\t},\n\tanalytics: {\n\t\tresource: \"analytics\",\n\t\tparams: ({ orgUnitIds }: any) => ({\n\t\t\tdimension: [\n\t\t\t\t`ou:${orgUnitIds.join(\";\")}`,\n\t\t\t\t`pe:${new Date().getFullYear()}`,\n\t\t\t],\n\t\t\tskipData: true,\n\t\t\thierarchyMeta: true,\n\t\t}),\n\t},\n};\n\nexport function MapProvider({\n\tchildren,\n\torgUnitSelection,\n\tperiodSelection,\n}: MapProviderProps) {\n\tconst [orgUnits, setOrgUnits] = useState<MapOrgUnit[]>([]);\n\tconst { refetch, loading, error } = useDataQuery(boundaryQuery, {\n\t\tlazy: true,\n\t});\n\n\tuseEffect(() => {\n\t\tasync function getOrgUnits() {\n\t\t\tconst rawOrgUnitIds = getOrgUnitsSelection(orgUnitSelection);\n\t\t\tconst data = await refetch({ orgUnitIds: rawOrgUnitIds });\n\t\t\tconst { analytics, boundaries } = (data as any) ?? {};\n\t\t\tconst rawOrgUnits = sanitizeOrgUnits(analytics?.metaData);\n\t\t\tconst geoJSONObjects = toGeoJson(\n\t\t\t\tboundaries.filter((bound: any) => bound.co),\n\t\t\t);\n\t\t\tconst orgUnits: MapOrgUnit[] = compact(\n\t\t\t\trawOrgUnits.map((orgUnit: any) => {\n\t\t\t\t\tconst geoJSONObject: any = geoJSONObjects?.find(\n\t\t\t\t\t\t(geoJSON: any) => geoJSON.properties.id === orgUnit.id,\n\t\t\t\t\t);\n\n\t\t\t\t\tif (!geoJSONObject) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...orgUnit,\n\t\t\t\t\t\tgeoJSON: geoJSONObject,\n\t\t\t\t\t\tbounds: [],\n\t\t\t\t\t\tlevel: geoJSONObject.properties.level,\n\t\t\t\t\t};\n\t\t\t\t}),\n\t\t\t);\n\t\t\tsetOrgUnits(orgUnits);\n\t\t}\n\n\t\tgetOrgUnits().catch((error) => console.log(error));\n\t}, [orgUnitSelection, refetch]);\n\n\tif (loading) {\n\t\treturn (\n\t\t\t<div style={{ height: \"100%\", width: \"100%\" }}>\n\t\t\t\t<Center>\n\t\t\t\t\t<CircularLoader small />\n\t\t\t\t</Center>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif (error) {\n\t\treturn (\n\t\t\t<div style={{ height: \"100%\", width: \"100%\" }}>\n\t\t\t\t<Center>\n\t\t\t\t\t<h4>\n\t\t\t\t\t\t{i18n.t(\"Error\")}: {error.message}\n\t\t\t\t\t</h4>\n\t\t\t\t</Center>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst periods: BasePeriod[] = compact(\n\t\tperiodSelection?.periods?.map((pe) => PeriodUtility.getPeriodById(pe)),\n\t);\n\n\tif (!isEmpty(orgUnits)) {\n\t\treturn (\n\t\t\t<MapOrgUnitContext.Provider value={{ orgUnitSelection, orgUnits }}>\n\t\t\t\t<MapPeriodContext.Provider\n\t\t\t\t\tvalue={{ ...periodSelection, periods }}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</MapPeriodContext.Provider>\n\t\t\t</MapOrgUnitContext.Provider>\n\t\t);\n\t}\n\n\treturn null;\n}\n"]}
@@ -1,13 +1,11 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var map = require('../../hooks/map');
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useCenterMap } from '../../hooks/map.js';
5
3
 
6
4
  function MapUpdater({ bounds }) {
7
- const ref = map.useCenterMap({ bounds });
8
- return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "100%", height: "100%" }, ref });
5
+ const ref = useCenterMap({ bounds });
6
+ return /* @__PURE__ */ jsx("div", { style: { width: "100%", height: "100%" }, ref });
9
7
  }
10
8
 
11
- module.exports = MapUpdater;
9
+ export { MapUpdater as default };
12
10
  //# sourceMappingURL=out.js.map
13
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/Map/components/MapUpdater/index.tsx"],"names":[],"mappings":"AAMQ;AANR,SAAS,oBAAoB;AAId,SAAR,WAA4B,EAAE,OAAO,GAA8B;AACzE,QAAM,MAAM,aAAa,EAAE,OAAO,CAAC;AACnC,SAAO,oBAAC,SAAI,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAO,GAAG,KAAU;AACjE","sourcesContent":["import { useCenterMap } from \"../../hooks/map\";\nimport React from \"react\";\nimport { LatLngTuple } from \"leaflet\";\n\nexport default function MapUpdater({ bounds }: { bounds: LatLngTuple[] }) {\n\tconst ref = useCenterMap({ bounds });\n\treturn <div style={{ width: \"100%\", height: \"100%\" }} ref={ref}></div>;\n}\n"]}
1
+ {"version":3,"sources":["../../../../../src/components/Map/components/MapUpdater/index.tsx"],"names":[],"mappings":"AAMQ;AANR,SAAS,oBAAoB;AAId,SAAR,WAA4B,EAAE,OAAO,GAA8B;AACzE,QAAM,MAAM,aAAa,EAAE,OAAO,CAAC;AACnC,SAAO,oBAAC,SAAI,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAO,GAAG,KAAU;AACjE","sourcesContent":["import { useCenterMap } from \"../../hooks/map.js\";\nimport React from \"react\";\nimport { LatLngTuple } from \"leaflet\";\n\nexport default function MapUpdater({ bounds }: { bounds: LatLngTuple[] }) {\n\tconst ref = useCenterMap({ bounds });\n\treturn <div style={{ width: \"100%\", height: \"100%\" }} ref={ref}></div>;\n}\n"]}
@@ -1,14 +1,8 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var reactHookForm = require('react-hook-form');
5
- var ui = require('@dhis2/ui');
6
- var i18n = require('@dhis2/d2-i18n');
7
- var ThematicLayerConfiguration = require('./ThematicLayerConfiguration');
8
-
9
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
-
11
- var i18n__default = /*#__PURE__*/_interopDefault(i18n);
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useForm } from 'react-hook-form';
3
+ import { Modal, ModalTitle, ModalContent, ModalActions, ButtonStrip, Button } from '@dhis2/ui';
4
+ import i18n from '@dhis2/d2-i18n';
5
+ import { ThematicLayerConfiguration } from './ThematicLayerConfiguration.js';
12
6
 
13
7
  function ThematicLayerConfigModal({
14
8
  open,
@@ -18,30 +12,30 @@ function ThematicLayerConfigModal({
18
12
  onChange,
19
13
  ...props
20
14
  }) {
21
- const form = reactHookForm.useForm({
15
+ const form = useForm({
22
16
  defaultValues: config
23
17
  });
24
18
  const onSubmitClick = (values) => {
25
19
  onChange(values);
26
20
  onClose();
27
21
  };
28
- return /* @__PURE__ */ jsxRuntime.jsxs(ui.Modal, { ...props, hide: !open, onClose, children: [
29
- /* @__PURE__ */ jsxRuntime.jsx(ui.ModalTitle, { children: i18n__default.default.t("Configure Thematic Layer") }),
30
- /* @__PURE__ */ jsxRuntime.jsx(ui.ModalContent, { children: /* @__PURE__ */ jsxRuntime.jsx(ThematicLayerConfiguration.ThematicLayerConfiguration, { form, exclude }) }),
31
- /* @__PURE__ */ jsxRuntime.jsx(ui.ModalActions, { children: /* @__PURE__ */ jsxRuntime.jsxs(ui.ButtonStrip, { children: [
32
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { onClick: onClose, children: i18n__default.default.t("Cancel") }),
33
- /* @__PURE__ */ jsxRuntime.jsx(
34
- ui.Button,
22
+ return /* @__PURE__ */ jsxs(Modal, { ...props, hide: !open, onClose, children: [
23
+ /* @__PURE__ */ jsx(ModalTitle, { children: i18n.t("Configure Thematic Layer") }),
24
+ /* @__PURE__ */ jsx(ModalContent, { children: /* @__PURE__ */ jsx(ThematicLayerConfiguration, { form, exclude }) }),
25
+ /* @__PURE__ */ jsx(ModalActions, { children: /* @__PURE__ */ jsxs(ButtonStrip, { children: [
26
+ /* @__PURE__ */ jsx(Button, { onClick: onClose, children: i18n.t("Cancel") }),
27
+ /* @__PURE__ */ jsx(
28
+ Button,
35
29
  {
36
30
  primary: true,
37
31
  onClick: () => form.handleSubmit(onSubmitClick)(),
38
- children: i18n__default.default.t("Save")
32
+ children: i18n.t("Save")
39
33
  }
40
34
  )
41
35
  ] }) })
42
36
  ] });
43
37
  }
44
38
 
45
- exports.ThematicLayerConfigModal = ThematicLayerConfigModal;
39
+ export { ThematicLayerConfigModal };
46
40
  //# sourceMappingURL=out.js.map
47
41
  //# sourceMappingURL=ThematicLayerConfigModal.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.tsx"],"names":[],"mappings":"AAkCG,cAKC,YALD;AAjCH,SAAS,eAAe;AAExB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,OAAO,UAAU;AAEjB,SAAS,kCAAkC;AAEpC,SAAS,yBAAyB;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAkC;AACjC,QAAM,OAAO,QAA6B;AAAA,IACzC,eAAe;AAAA,EAChB,CAAC;AAED,QAAM,gBAAgB,CAAC,WAAgC;AACtD,aAAS,MAAM;AACf,YAAQ;AAAA,EACT;AAEA,SACC,qBAAC,SAAO,GAAG,OAAO,MAAM,CAAC,MAAM,SAC9B;AAAA,wBAAC,cAAY,eAAK,EAAE,0BAA0B,GAAE;AAAA,IAChD,oBAAC,gBACA,8BAAC,8BAA2B,MAAY,SAAkB,GAC3D;AAAA,IACA,oBAAC,gBACA,+BAAC,eACA;AAAA,0BAAC,UAAO,SAAS,SAAU,eAAK,EAAE,QAAQ,GAAE;AAAA,MAC5C;AAAA,QAAC;AAAA;AAAA,UACA,SAAO;AAAA,UACP,SAAS,MAAM,KAAK,aAAa,aAAa,EAAE;AAAA,UAE/C,eAAK,EAAE,MAAM;AAAA;AAAA,MACf;AAAA,OACD,GACD;AAAA,KACD;AAEF","sourcesContent":["import { ThematicLayerConfigModalProps } from \"./types\";\nimport { useForm } from \"react-hook-form\";\nimport { ThematicLayerConfig } from \"../MapLayer/interfaces\";\nimport {\n\tButton,\n\tButtonStrip,\n\tModal,\n\tModalActions,\n\tModalContent,\n\tModalTitle,\n} from \"@dhis2/ui\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport React from \"react\";\nimport { ThematicLayerConfiguration } from \"./ThematicLayerConfiguration\";\n\nexport function ThematicLayerConfigModal({\n\topen,\n\texclude,\n\tconfig,\n\tonClose,\n\tonChange,\n\t...props\n}: ThematicLayerConfigModalProps) {\n\tconst form = useForm<ThematicLayerConfig>({\n\t\tdefaultValues: config,\n\t});\n\n\tconst onSubmitClick = (values: ThematicLayerConfig) => {\n\t\tonChange(values);\n\t\tonClose();\n\t};\n\n\treturn (\n\t\t<Modal {...props} hide={!open} onClose={onClose}>\n\t\t\t<ModalTitle>{i18n.t(\"Configure Thematic Layer\")}</ModalTitle>\n\t\t\t<ModalContent>\n\t\t\t\t<ThematicLayerConfiguration form={form} exclude={exclude} />\n\t\t\t</ModalContent>\n\t\t\t<ModalActions>\n\t\t\t\t<ButtonStrip>\n\t\t\t\t\t<Button onClick={onClose}>{i18n.t(\"Cancel\")}</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tprimary\n\t\t\t\t\t\tonClick={() => form.handleSubmit(onSubmitClick)()}\n\t\t\t\t\t>\n\t\t\t\t\t\t{i18n.t(\"Save\")}\n\t\t\t\t\t</Button>\n\t\t\t\t</ButtonStrip>\n\t\t\t</ModalActions>\n\t\t</Modal>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["../../../../../src/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.tsx"],"names":[],"mappings":"AAkCG,cAKC,YALD;AAjCH,SAAS,eAAe;AAExB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,OAAO,UAAU;AAEjB,SAAS,kCAAkC;AAEpC,SAAS,yBAAyB;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAkC;AACjC,QAAM,OAAO,QAA6B;AAAA,IACzC,eAAe;AAAA,EAChB,CAAC;AAED,QAAM,gBAAgB,CAAC,WAAgC;AACtD,aAAS,MAAM;AACf,YAAQ;AAAA,EACT;AAEA,SACC,qBAAC,SAAO,GAAG,OAAO,MAAM,CAAC,MAAM,SAC9B;AAAA,wBAAC,cAAY,eAAK,EAAE,0BAA0B,GAAE;AAAA,IAChD,oBAAC,gBACA,8BAAC,8BAA2B,MAAY,SAAkB,GAC3D;AAAA,IACA,oBAAC,gBACA,+BAAC,eACA;AAAA,0BAAC,UAAO,SAAS,SAAU,eAAK,EAAE,QAAQ,GAAE;AAAA,MAC5C;AAAA,QAAC;AAAA;AAAA,UACA,SAAO;AAAA,UACP,SAAS,MAAM,KAAK,aAAa,aAAa,EAAE;AAAA,UAE/C,eAAK,EAAE,MAAM;AAAA;AAAA,MACf;AAAA,OACD,GACD;AAAA,KACD;AAEF","sourcesContent":["import { ThematicLayerConfigModalProps } from \"./types\";\nimport { useForm } from \"react-hook-form\";\nimport { ThematicLayerConfig } from \"../MapLayer/interfaces/index.js\";\nimport {\n\tButton,\n\tButtonStrip,\n\tModal,\n\tModalActions,\n\tModalContent,\n\tModalTitle,\n} from \"@dhis2/ui\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport React from \"react\";\nimport { ThematicLayerConfiguration } from \"./ThematicLayerConfiguration.js\";\n\nexport function ThematicLayerConfigModal({\n\topen,\n\texclude,\n\tconfig,\n\tonClose,\n\tonChange,\n\t...props\n}: ThematicLayerConfigModalProps) {\n\tconst form = useForm<ThematicLayerConfig>({\n\t\tdefaultValues: config,\n\t});\n\n\tconst onSubmitClick = (values: ThematicLayerConfig) => {\n\t\tonChange(values);\n\t\tonClose();\n\t};\n\n\treturn (\n\t\t<Modal {...props} hide={!open} onClose={onClose}>\n\t\t\t<ModalTitle>{i18n.t(\"Configure Thematic Layer\")}</ModalTitle>\n\t\t\t<ModalContent>\n\t\t\t\t<ThematicLayerConfiguration form={form} exclude={exclude} />\n\t\t\t</ModalContent>\n\t\t\t<ModalActions>\n\t\t\t\t<ButtonStrip>\n\t\t\t\t\t<Button onClick={onClose}>{i18n.t(\"Cancel\")}</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tprimary\n\t\t\t\t\t\tonClick={() => form.handleSubmit(onSubmitClick)()}\n\t\t\t\t\t>\n\t\t\t\t\t\t{i18n.t(\"Save\")}\n\t\t\t\t\t</Button>\n\t\t\t\t</ButtonStrip>\n\t\t\t</ModalActions>\n\t\t</Modal>\n\t);\n}\n"]}
@@ -1,9 +1,5 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var ThematicLayerConfigModal = require('./ThematicLayerConfigModal');
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { ThematicLayerConfigModal } from './ThematicLayerConfigModal';
7
3
 
8
4
  const Default = {};
9
5
  Default.args = {
@@ -14,16 +10,15 @@ Default.args = {
14
10
  };
15
11
  const meta = {
16
12
  title: "DHIS2 Map/Thematic Layer Config Modal",
17
- component: ThematicLayerConfigModal.ThematicLayerConfigModal,
13
+ component: ThematicLayerConfigModal,
18
14
  decorators: [
19
15
  (MapStory) => {
20
- return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "50%", height: "50%" }, children: /* @__PURE__ */ jsxRuntime.jsx(MapStory, {}) });
16
+ return /* @__PURE__ */ jsx("div", { style: { width: "50%", height: "50%" }, children: /* @__PURE__ */ jsx(MapStory, {}) });
21
17
  }
22
18
  ]
23
19
  };
24
20
  var ThematicLayerConfigModal_stories_default = meta;
25
21
 
26
- exports.Default = Default;
27
- exports.default = ThematicLayerConfigModal_stories_default;
22
+ export { Default, ThematicLayerConfigModal_stories_default as default };
28
23
  //# sourceMappingURL=out.js.map
29
24
  //# sourceMappingURL=ThematicLayerConfigModal.stories.js.map
@@ -1,42 +1,35 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var i18n = require('@dhis2/d2-i18n');
5
- var ui = require('@dhis2/ui');
6
- var reactHookForm = require('react-hook-form');
7
- var react = require('react');
8
- var lodash = require('lodash');
9
- var colors = require('../../utils/colors');
10
- var IndicatorSelectorModal = require('./components/IndicatorSelectorModal');
11
- var LegendSetSelector = require('./components/LegendSetSelector');
12
- var CustomLegend = require('./components/CustomLegend');
13
- var RadiusField = require('./components/RadiusField');
14
- var TypeField = require('./components/TypeField');
15
-
16
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
17
-
18
- var i18n__default = /*#__PURE__*/_interopDefault(i18n);
19
- var IndicatorSelectorModal__default = /*#__PURE__*/_interopDefault(IndicatorSelectorModal);
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import i18n from '@dhis2/d2-i18n';
3
+ import { InputField, Button, Field, Radio } from '@dhis2/ui';
4
+ import { useWatch, FormProvider, Controller } from 'react-hook-form';
5
+ import { useState, useMemo } from 'react';
6
+ import { compact } from 'lodash';
7
+ import { defaultClasses, defaultColorScaleName } from '../../utils/colors.js';
8
+ import IndicatorSelectorModal from './components/IndicatorSelectorModal/index.js';
9
+ import { LegendSetSelector } from './components/LegendSetSelector/index.js';
10
+ import { CustomLegend } from './components/CustomLegend/index.js';
11
+ import { RadiusField } from './components/RadiusField.js';
12
+ import { TypeField } from './components/TypeField.js';
20
13
 
21
14
  function ThematicLayerConfiguration({
22
15
  exclude,
23
16
  form
24
17
  }) {
25
- const [type, legendSet, dataItemId] = reactHookForm.useWatch({
18
+ const [type, legendSet, dataItemId] = useWatch({
26
19
  control: form.control,
27
20
  name: ["type", "dataItem.legendSet", "dataItem.id"]
28
21
  });
29
- const [legendType, setLegendType] = react.useState(
22
+ const [legendType, setLegendType] = useState(
30
23
  legendSet ? "legendSet" : "custom"
31
24
  );
32
- const [dataSelectorOpen, setDataSelectorOpen] = react.useState(false);
25
+ const [dataSelectorOpen, setDataSelectorOpen] = useState(false);
33
26
  const onLegendTypeChange = (type2) => ({ value }) => {
34
27
  if (type2 === "custom") {
35
28
  form.setValue("dataItem.legendSet", void 0);
36
- form.setValue("dataItem.legendConfig.scale", colors.defaultClasses);
29
+ form.setValue("dataItem.legendConfig.scale", defaultClasses);
37
30
  form.setValue(
38
31
  "dataItem.legendConfig.colorClass",
39
- colors.defaultColorScaleName
32
+ defaultColorScaleName
40
33
  );
41
34
  } else {
42
35
  form.setValue("dataItem.legendConfig", void 0);
@@ -45,60 +38,60 @@ function ThematicLayerConfiguration({
45
38
  setLegendType(value);
46
39
  }
47
40
  };
48
- const disabled = react.useMemo(
41
+ const disabled = useMemo(
49
42
  () => exclude?.filter((indicator) => indicator !== dataItemId) ?? [],
50
43
  [dataItemId, exclude]
51
44
  );
52
- return /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.FormProvider, { ...form, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "column gap-16", children: [
53
- /* @__PURE__ */ jsxRuntime.jsx(TypeField.TypeField, {}),
54
- /* @__PURE__ */ jsxRuntime.jsx(
55
- reactHookForm.Controller,
45
+ return /* @__PURE__ */ jsx(FormProvider, { ...form, children: /* @__PURE__ */ jsxs("div", { className: "column gap-16", children: [
46
+ /* @__PURE__ */ jsx(TypeField, {}),
47
+ /* @__PURE__ */ jsx(
48
+ Controller,
56
49
  {
57
50
  rules: {
58
51
  validate: {
59
52
  required: (value) => {
60
- return Boolean(value?.id) || i18n__default.default.t("A data item is required");
53
+ return Boolean(value?.id) || i18n.t("A data item is required");
61
54
  }
62
55
  }
63
56
  },
64
- render: ({ field, fieldState }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
65
- /* @__PURE__ */ jsxRuntime.jsxs(
57
+ render: ({ field, fieldState }) => /* @__PURE__ */ jsxs(Fragment, { children: [
58
+ /* @__PURE__ */ jsxs(
66
59
  "div",
67
60
  {
68
61
  style: { alignItems: "flex-end" },
69
62
  className: "row w-100 gap-16 align-end",
70
63
  children: [
71
- /* @__PURE__ */ jsxRuntime.jsx(
64
+ /* @__PURE__ */ jsx(
72
65
  "div",
73
66
  {
74
67
  onClick: () => setDataSelectorOpen(true),
75
68
  style: { flex: 1 },
76
- children: /* @__PURE__ */ jsxRuntime.jsx(
77
- ui.InputField,
69
+ children: /* @__PURE__ */ jsx(
70
+ InputField,
78
71
  {
79
72
  required: true,
80
73
  error: Boolean(fieldState.error),
81
74
  validationText: fieldState.error?.message,
82
75
  disabled: true,
83
76
  inputWidth: "100%",
84
- label: i18n__default.default.t("Data Item"),
77
+ label: i18n.t("Data Item"),
85
78
  value: field.value?.displayName
86
79
  }
87
80
  )
88
81
  }
89
82
  ),
90
- /* @__PURE__ */ jsxRuntime.jsx(
91
- ui.Button,
83
+ /* @__PURE__ */ jsx(
84
+ Button,
92
85
  {
93
86
  onClick: () => setDataSelectorOpen(true),
94
- children: field.value?.id ? i18n__default.default.t("Change") : i18n__default.default.t("Select")
87
+ children: field.value?.id ? i18n.t("Change") : i18n.t("Select")
95
88
  }
96
89
  )
97
90
  ]
98
91
  }
99
92
  ),
100
- dataSelectorOpen && /* @__PURE__ */ jsxRuntime.jsx(
101
- IndicatorSelectorModal__default.default,
93
+ dataSelectorOpen && /* @__PURE__ */ jsx(
94
+ IndicatorSelectorModal,
102
95
  {
103
96
  disabled,
104
97
  onUpdate: (values) => {
@@ -111,7 +104,7 @@ function ThematicLayerConfiguration({
111
104
  },
112
105
  onClose: () => setDataSelectorOpen(false),
113
106
  hide: !dataSelectorOpen,
114
- selected: lodash.compact([
107
+ selected: compact([
115
108
  {
116
109
  id: field.value?.id,
117
110
  displayName: field.value?.displayName
@@ -123,42 +116,42 @@ function ThematicLayerConfiguration({
123
116
  name: "dataItem"
124
117
  }
125
118
  ),
126
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
127
- /* @__PURE__ */ jsxRuntime.jsx(ui.Field, { label: i18n__default.default.t("Legend"), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "column gap-8", children: [
128
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "row gap-16", children: [
129
- /* @__PURE__ */ jsxRuntime.jsx(
130
- ui.Radio,
119
+ /* @__PURE__ */ jsxs("div", { children: [
120
+ /* @__PURE__ */ jsx(Field, { label: i18n.t("Legend"), children: /* @__PURE__ */ jsxs("div", { className: "column gap-8", children: [
121
+ /* @__PURE__ */ jsxs("div", { className: "row gap-16", children: [
122
+ /* @__PURE__ */ jsx(
123
+ Radio,
131
124
  {
132
125
  checked: legendType === "legendSet",
133
- label: i18n__default.default.t("Legend set"),
126
+ label: i18n.t("Legend set"),
134
127
  name: "legendSet",
135
128
  value: "legendSet",
136
129
  onChange: onLegendTypeChange("legendSet")
137
130
  }
138
131
  ),
139
- /* @__PURE__ */ jsxRuntime.jsx(
140
- ui.Radio,
132
+ /* @__PURE__ */ jsx(
133
+ Radio,
141
134
  {
142
135
  checked: legendType === "custom",
143
- label: i18n__default.default.t("Custom legend"),
136
+ label: i18n.t("Custom legend"),
144
137
  name: "custom",
145
138
  value: "custom",
146
139
  onChange: onLegendTypeChange("custom")
147
140
  }
148
141
  )
149
142
  ] }),
150
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
151
- legendType === "legendSet" && /* @__PURE__ */ jsxRuntime.jsx(
152
- reactHookForm.Controller,
143
+ /* @__PURE__ */ jsxs("div", { children: [
144
+ legendType === "legendSet" && /* @__PURE__ */ jsx(
145
+ Controller,
153
146
  {
154
147
  rules: {
155
- required: i18n__default.default.t(
148
+ required: i18n.t(
156
149
  "Legend set is required"
157
150
  )
158
151
  },
159
152
  name: "dataItem.legendSet",
160
- render: ({ field, fieldState }) => /* @__PURE__ */ jsxRuntime.jsx(
161
- LegendSetSelector.LegendSetSelector,
153
+ render: ({ field, fieldState }) => /* @__PURE__ */ jsx(
154
+ LegendSetSelector,
162
155
  {
163
156
  required: true,
164
157
  selected: field.value,
@@ -168,14 +161,14 @@ function ThematicLayerConfiguration({
168
161
  )
169
162
  }
170
163
  ),
171
- legendType === "custom" && /* @__PURE__ */ jsxRuntime.jsx(CustomLegend.CustomLegend, {})
164
+ legendType === "custom" && /* @__PURE__ */ jsx(CustomLegend, {})
172
165
  ] })
173
166
  ] }) }),
174
- type === "bubble" && /* @__PURE__ */ jsxRuntime.jsx(ui.Field, { label: i18n__default.default.t("Radius"), children: /* @__PURE__ */ jsxRuntime.jsx(RadiusField.RadiusField, {}) })
167
+ type === "bubble" && /* @__PURE__ */ jsx(Field, { label: i18n.t("Radius"), children: /* @__PURE__ */ jsx(RadiusField, {}) })
175
168
  ] })
176
169
  ] }) });
177
170
  }
178
171
 
179
- exports.ThematicLayerConfiguration = ThematicLayerConfiguration;
172
+ export { ThematicLayerConfiguration };
180
173
  //# sourceMappingURL=out.js.map
181
174
  //# sourceMappingURL=ThematicLayerConfiguration.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.tsx"],"names":["type"],"mappings":"AAkDI,S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;AAAA,QAED,MAAM;AAAA;AAAA,IACP;AAAA,IACA,qBAAC,SACA;AAAA,0BAAC,SAAM,OAAO,KAAK,EAAE,QAAQ,GAC5B,+BAAC,SAAI,WAAU,gBACd;AAAA,6BAAC,SAAI,WAAU,cACd;AAAA;AAAA,YAAC;AAAA;AAAA,cACA,SAAS,eAAe;AAAA,cACxB,OAAO,KAAK,EAAE,YAAY;AAAA,cAC1B,MAAK;AAAA,cACL,OAAM;AAAA,cACN,UAAU,mBAAmB,WAAW;AAAA;AAAA,UACzC;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACA,SAAS,eAAe;AAAA,cACxB,OAAO,KAAK,EAAE,eAAe;AAAA,cAC7B,MAAK;AAAA,cACL,OAAM;AAAA,cACN,UAAU,mBAAmB,QAAQ;AAAA;AAAA,UACtC;AAAA,WACD;AAAA,QACA,qBAAC,SACC;AAAA,yBAAe,eACf;AAAA,YAAC;AAAA;AAAA,cACA,OAAO;AAAA,gBACN,UAAU,KAAK;AAAA,kBACd;AAAA,gBACD;AAAA,cACD;AAAA,cACA,MAAK;AAAA,cACL,QAAQ,CAAC,EAAE,OAAO,WAAW,MAC5B;AAAA,gBAAC;AAAA;AAAA,kBACA,UAAQ;AAAA,kBACR,UAAU,MAAM;AAAA,kBACf,GAAG;AAAA,kBACH,GAAG;AAAA;AAAA,cACL;AAAA;AAAA,UAEF;AAAA,UAEA,eAAe,YAAY,oBAAC,gBAAa;AAAA,WAC3C;AAAA,SACD,GACD;AAAA,MACC,SAAS,YACT,oBAAC,SAAM,OAAO,KAAK,EAAE,QAAQ,GAC5B,8BAAC,eAAY,GACd;AAAA,OAEF;AAAA,KACD,GACD;AAEF","sourcesContent":["import i18n from \"@dhis2/d2-i18n\";\nimport { Button, Field, InputField, Radio } from \"@dhis2/ui\";\nimport { Controller, FormProvider, useWatch } from \"react-hook-form\";\nimport React, { useMemo, useState } from \"react\";\nimport { compact } from \"lodash\";\nimport { defaultClasses, defaultColorScaleName } from \"../../utils/colors\";\nimport IndicatorSelectorModal from \"./components/IndicatorSelectorModal\";\nimport { LegendSetSelector } from \"./components/LegendSetSelector\";\nimport { CustomLegend } from \"./components/CustomLegend\";\nimport { ThematicLayerConfigurationProps } from \"./types\";\nimport { RadiusField } from \"./components/RadiusField\";\nimport { TypeField } from \"./components/TypeField\";\n\nexport function ThematicLayerConfiguration({\n\texclude,\n\tform,\n}: ThematicLayerConfigurationProps) {\n\tconst [type, legendSet, dataItemId] = useWatch({\n\t\tcontrol: form.control,\n\t\tname: [\"type\", \"dataItem.legendSet\", \"dataItem.id\"],\n\t});\n\tconst [legendType, setLegendType] = useState(\n\t\tlegendSet ? \"legendSet\" : \"custom\",\n\t);\n\tconst [dataSelectorOpen, setDataSelectorOpen] = useState(false);\n\n\tconst onLegendTypeChange =\n\t\t(type: string) =>\n\t\t({ value }: { value?: string }) => {\n\t\t\tif (type === \"custom\") {\n\t\t\t\tform.setValue(\"dataItem.legendSet\", undefined);\n\t\t\t\tform.setValue(\"dataItem.legendConfig.scale\", defaultClasses);\n\t\t\t\tform.setValue(\n\t\t\t\t\t\"dataItem.legendConfig.colorClass\",\n\t\t\t\t\tdefaultColorScaleName,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tform.setValue(\"dataItem.legendConfig\", undefined);\n\t\t\t}\n\t\t\tif (value) {\n\t\t\t\tsetLegendType(value);\n\t\t\t}\n\t\t};\n\tconst disabled = useMemo(\n\t\t() => exclude?.filter((indicator) => indicator !== dataItemId) ?? [],\n\t\t[dataItemId, exclude],\n\t);\n\treturn (\n\t\t<FormProvider {...form}>\n\t\t\t<div className=\"column gap-16\">\n\t\t\t\t<TypeField />\n\t\t\t\t<Controller\n\t\t\t\t\trules={{\n\t\t\t\t\t\tvalidate: {\n\t\t\t\t\t\t\trequired: (value: { id: string; name: string }) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\tBoolean(value?.id) ||\n\t\t\t\t\t\t\t\t\ti18n.t(\"A data item is required\")\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t}}\n\t\t\t\t\trender={({ field, fieldState }) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={{ alignItems: \"flex-end\" }}\n\t\t\t\t\t\t\t\tclassName=\"row w-100 gap-16 align-end\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tonClick={() => setDataSelectorOpen(true)}\n\t\t\t\t\t\t\t\t\tstyle={{ flex: 1 }}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<InputField\n\t\t\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\t\t\terror={Boolean(fieldState.error)}\n\t\t\t\t\t\t\t\t\t\tvalidationText={\n\t\t\t\t\t\t\t\t\t\t\tfieldState.error?.message\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdisabled\n\t\t\t\t\t\t\t\t\t\tinputWidth=\"100%\"\n\t\t\t\t\t\t\t\t\t\tlabel={i18n.t(\"Data Item\")}\n\t\t\t\t\t\t\t\t\t\tvalue={field.value?.displayName}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tonClick={() => setDataSelectorOpen(true)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{field.value?.id\n\t\t\t\t\t\t\t\t\t\t? i18n.t(\"Change\")\n\t\t\t\t\t\t\t\t\t\t: i18n.t(\"Select\")}\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{dataSelectorOpen && (\n\t\t\t\t\t\t\t\t<IndicatorSelectorModal\n\t\t\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\t\t\tonUpdate={(values: any[]) => {\n\t\t\t\t\t\t\t\t\t\tconst [indicator] = values ?? [];\n\t\t\t\t\t\t\t\t\t\tfield.onChange({\n\t\t\t\t\t\t\t\t\t\t\tid: indicator.id,\n\t\t\t\t\t\t\t\t\t\t\tdisplayName: indicator.displayName,\n\t\t\t\t\t\t\t\t\t\t\ttype: \"indicator\",\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tonClose={() => setDataSelectorOpen(false)}\n\t\t\t\t\t\t\t\t\thide={!dataSelectorOpen}\n\t\t\t\t\t\t\t\t\tselected={compact([\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tid: field.value?.id,\n\t\t\t\t\t\t\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t\t\t\t\t\t\tfield.value?.displayName,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t])}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</>\n\t\t\t\t\t)}\n\t\t\t\t\tname={\"dataItem\"}\n\t\t\t\t/>\n\t\t\t\t<div>\n\t\t\t\t\t<Field label={i18n.t(\"Legend\")}>\n\t\t\t\t\t\t<div className=\"column gap-8\">\n\t\t\t\t\t\t\t<div className=\"row gap-16\">\n\t\t\t\t\t\t\t\t<Radio\n\t\t\t\t\t\t\t\t\tchecked={legendType === \"legendSet\"}\n\t\t\t\t\t\t\t\t\tlabel={i18n.t(\"Legend set\")}\n\t\t\t\t\t\t\t\t\tname=\"legendSet\"\n\t\t\t\t\t\t\t\t\tvalue=\"legendSet\"\n\t\t\t\t\t\t\t\t\tonChange={onLegendTypeChange(\"legendSet\")}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<Radio\n\t\t\t\t\t\t\t\t\tchecked={legendType === \"custom\"}\n\t\t\t\t\t\t\t\t\tlabel={i18n.t(\"Custom legend\")}\n\t\t\t\t\t\t\t\t\tname=\"custom\"\n\t\t\t\t\t\t\t\t\tvalue=\"custom\"\n\t\t\t\t\t\t\t\t\tonChange={onLegendTypeChange(\"custom\")}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t{legendType === \"legendSet\" && (\n\t\t\t\t\t\t\t\t\t<Controller\n\t\t\t\t\t\t\t\t\t\trules={{\n\t\t\t\t\t\t\t\t\t\t\trequired: i18n.t(\n\t\t\t\t\t\t\t\t\t\t\t\t\"Legend set is required\",\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tname=\"dataItem.legendSet\"\n\t\t\t\t\t\t\t\t\t\trender={({ field, fieldState }) => (\n\t\t\t\t\t\t\t\t\t\t\t<LegendSetSelector\n\t\t\t\t\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\t\t\t\t\tselected={field.value}\n\t\t\t\t\t\t\t\t\t\t\t\t{...field}\n\t\t\t\t\t\t\t\t\t\t\t\t{...fieldState}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{legendType === \"custom\" && <CustomLegend />}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Field>\n\t\t\t\t\t{type === \"bubble\" && (\n\t\t\t\t\t\t<Field label={i18n.t(\"Radius\")}>\n\t\t\t\t\t\t\t<RadiusField />\n\t\t\t\t\t\t</Field>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</FormProvider>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["../../../../../src/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.tsx"],"names":["type"],"mappings":"AAkDI,SAaE,UAbF,KAcG,YAdH;AAlDJ,OAAO,UA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,IACA,qBAAC,SACA;AAAA,0BAAC,SAAM,OAAO,KAAK,EAAE,QAAQ,GAC5B,+BAAC,SAAI,WAAU,gBACd;AAAA,6BAAC,SAAI,WAAU,cACd;AAAA;AAAA,YAAC;AAAA;AAAA,cACA,SAAS,eAAe;AAAA,cACxB,OAAO,KAAK,EAAE,YAAY;AAAA,cAC1B,MAAK;AAAA,cACL,OAAM;AAAA,cACN,UAAU,mBAAmB,WAAW;AAAA;AAAA,UACzC;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACA,SAAS,eAAe;AAAA,cACxB,OAAO,KAAK,EAAE,eAAe;AAAA,cAC7B,MAAK;AAAA,cACL,OAAM;AAAA,cACN,UAAU,mBAAmB,QAAQ;AAAA;AAAA,UACtC;AAAA,WACD;AAAA,QACA,qBAAC,SACC;AAAA,yBAAe,eACf;AAAA,YAAC;AAAA;AAAA,cACA,OAAO;AAAA,gBACN,UAAU,KAAK;AAAA,kBACd;AAAA,gBACD;AAAA,cACD;AAAA,cACA,MAAK;AAAA,cACL,QAAQ,CAAC,EAAE,OAAO,WAAW,MAC5B;AAAA,gBAAC;AAAA;AAAA,kBACA,UAAQ;AAAA,kBACR,UAAU,MAAM;AAAA,kBACf,GAAG;AAAA,kBACH,GAAG;AAAA;AAAA,cACL;AAAA;AAAA,UAEF;AAAA,UAEA,eAAe,YAAY,oBAAC,gBAAa;AAAA,WAC3C;AAAA,SACD,GACD;AAAA,MACC,SAAS,YACT,oBAAC,SAAM,OAAO,KAAK,EAAE,QAAQ,GAC5B,8BAAC,eAAY,GACd;AAAA,OAEF;AAAA,KACD,GACD;AAEF","sourcesContent":["import i18n from \"@dhis2/d2-i18n\";\nimport { Button, Field, InputField, Radio } from \"@dhis2/ui\";\nimport { Controller, FormProvider, useWatch } from \"react-hook-form\";\nimport React, { useMemo, useState } from \"react\";\nimport { compact } from \"lodash\";\nimport { defaultClasses, defaultColorScaleName } from \"../../utils/colors.js\";\nimport IndicatorSelectorModal from \"./components/IndicatorSelectorModal/index.js\";\nimport { LegendSetSelector } from \"./components/LegendSetSelector/index.js\";\nimport { CustomLegend } from \"./components/CustomLegend/index.js\";\nimport { ThematicLayerConfigurationProps } from \"./types/index.js\";\nimport { RadiusField } from \"./components/RadiusField.js\";\nimport { TypeField } from \"./components/TypeField.js\";\n\nexport function ThematicLayerConfiguration({\n\texclude,\n\tform,\n}: ThematicLayerConfigurationProps) {\n\tconst [type, legendSet, dataItemId] = useWatch({\n\t\tcontrol: form.control,\n\t\tname: [\"type\", \"dataItem.legendSet\", \"dataItem.id\"],\n\t});\n\tconst [legendType, setLegendType] = useState(\n\t\tlegendSet ? \"legendSet\" : \"custom\",\n\t);\n\tconst [dataSelectorOpen, setDataSelectorOpen] = useState(false);\n\n\tconst onLegendTypeChange =\n\t\t(type: string) =>\n\t\t({ value }: { value?: string }) => {\n\t\t\tif (type === \"custom\") {\n\t\t\t\tform.setValue(\"dataItem.legendSet\", undefined);\n\t\t\t\tform.setValue(\"dataItem.legendConfig.scale\", defaultClasses);\n\t\t\t\tform.setValue(\n\t\t\t\t\t\"dataItem.legendConfig.colorClass\",\n\t\t\t\t\tdefaultColorScaleName,\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tform.setValue(\"dataItem.legendConfig\", undefined);\n\t\t\t}\n\t\t\tif (value) {\n\t\t\t\tsetLegendType(value);\n\t\t\t}\n\t\t};\n\tconst disabled = useMemo(\n\t\t() => exclude?.filter((indicator) => indicator !== dataItemId) ?? [],\n\t\t[dataItemId, exclude],\n\t);\n\treturn (\n\t\t<FormProvider {...form}>\n\t\t\t<div className=\"column gap-16\">\n\t\t\t\t<TypeField />\n\t\t\t\t<Controller\n\t\t\t\t\trules={{\n\t\t\t\t\t\tvalidate: {\n\t\t\t\t\t\t\trequired: (value: { id: string; name: string }) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\tBoolean(value?.id) ||\n\t\t\t\t\t\t\t\t\ti18n.t(\"A data item is required\")\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t}}\n\t\t\t\t\trender={({ field, fieldState }) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={{ alignItems: \"flex-end\" }}\n\t\t\t\t\t\t\t\tclassName=\"row w-100 gap-16 align-end\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tonClick={() => setDataSelectorOpen(true)}\n\t\t\t\t\t\t\t\t\tstyle={{ flex: 1 }}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<InputField\n\t\t\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\t\t\terror={Boolean(fieldState.error)}\n\t\t\t\t\t\t\t\t\t\tvalidationText={\n\t\t\t\t\t\t\t\t\t\t\tfieldState.error?.message\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tdisabled\n\t\t\t\t\t\t\t\t\t\tinputWidth=\"100%\"\n\t\t\t\t\t\t\t\t\t\tlabel={i18n.t(\"Data Item\")}\n\t\t\t\t\t\t\t\t\t\tvalue={field.value?.displayName}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tonClick={() => setDataSelectorOpen(true)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{field.value?.id\n\t\t\t\t\t\t\t\t\t\t? i18n.t(\"Change\")\n\t\t\t\t\t\t\t\t\t\t: i18n.t(\"Select\")}\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{dataSelectorOpen && (\n\t\t\t\t\t\t\t\t<IndicatorSelectorModal\n\t\t\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t\t\t\tonUpdate={(values: any[]) => {\n\t\t\t\t\t\t\t\t\t\tconst [indicator] = values ?? [];\n\t\t\t\t\t\t\t\t\t\tfield.onChange({\n\t\t\t\t\t\t\t\t\t\t\tid: indicator.id,\n\t\t\t\t\t\t\t\t\t\t\tdisplayName: indicator.displayName,\n\t\t\t\t\t\t\t\t\t\t\ttype: \"indicator\",\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\tonClose={() => setDataSelectorOpen(false)}\n\t\t\t\t\t\t\t\t\thide={!dataSelectorOpen}\n\t\t\t\t\t\t\t\t\tselected={compact([\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tid: field.value?.id,\n\t\t\t\t\t\t\t\t\t\t\tdisplayName:\n\t\t\t\t\t\t\t\t\t\t\t\tfield.value?.displayName,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t])}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</>\n\t\t\t\t\t)}\n\t\t\t\t\tname={\"dataItem\"}\n\t\t\t\t/>\n\t\t\t\t<div>\n\t\t\t\t\t<Field label={i18n.t(\"Legend\")}>\n\t\t\t\t\t\t<div className=\"column gap-8\">\n\t\t\t\t\t\t\t<div className=\"row gap-16\">\n\t\t\t\t\t\t\t\t<Radio\n\t\t\t\t\t\t\t\t\tchecked={legendType === \"legendSet\"}\n\t\t\t\t\t\t\t\t\tlabel={i18n.t(\"Legend set\")}\n\t\t\t\t\t\t\t\t\tname=\"legendSet\"\n\t\t\t\t\t\t\t\t\tvalue=\"legendSet\"\n\t\t\t\t\t\t\t\t\tonChange={onLegendTypeChange(\"legendSet\")}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<Radio\n\t\t\t\t\t\t\t\t\tchecked={legendType === \"custom\"}\n\t\t\t\t\t\t\t\t\tlabel={i18n.t(\"Custom legend\")}\n\t\t\t\t\t\t\t\t\tname=\"custom\"\n\t\t\t\t\t\t\t\t\tvalue=\"custom\"\n\t\t\t\t\t\t\t\t\tonChange={onLegendTypeChange(\"custom\")}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t{legendType === \"legendSet\" && (\n\t\t\t\t\t\t\t\t\t<Controller\n\t\t\t\t\t\t\t\t\t\trules={{\n\t\t\t\t\t\t\t\t\t\t\trequired: i18n.t(\n\t\t\t\t\t\t\t\t\t\t\t\t\"Legend set is required\",\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tname=\"dataItem.legendSet\"\n\t\t\t\t\t\t\t\t\t\trender={({ field, fieldState }) => (\n\t\t\t\t\t\t\t\t\t\t\t<LegendSetSelector\n\t\t\t\t\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\t\t\t\t\tselected={field.value}\n\t\t\t\t\t\t\t\t\t\t\t\t{...field}\n\t\t\t\t\t\t\t\t\t\t\t\t{...fieldState}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{legendType === \"custom\" && <CustomLegend />}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Field>\n\t\t\t\t\t{type === \"bubble\" && (\n\t\t\t\t\t\t<Field label={i18n.t(\"Radius\")}>\n\t\t\t\t\t\t\t<RadiusField />\n\t\t\t\t\t\t</Field>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</FormProvider>\n\t);\n}\n"]}