@hisptz/dhis2-analytics 2.0.8 → 2.0.10

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 (227) hide show
  1. package/dist/components/DHIS2PivotTable/components/TableHeaders/index.js +2 -1
  2. package/dist/components/DHIS2PivotTable/components/TableHeaders/index.js.map +1 -1
  3. package/dist/esm/components/DHIS2PivotTable/components/TableHeaders/index.js +2 -1
  4. package/dist/esm/components/DHIS2PivotTable/components/TableHeaders/index.js.map +1 -1
  5. package/dist/types/components/ChartAnalytics/DHIS2Chart.d.ts +26 -0
  6. package/dist/types/components/ChartAnalytics/DHIS2Chart.d.ts.map +1 -0
  7. package/dist/types/components/ChartAnalytics/components/DownloadMenu/components/Menu.d.ts +8 -0
  8. package/dist/types/components/ChartAnalytics/components/DownloadMenu/components/Menu.d.ts.map +1 -0
  9. package/dist/types/components/ChartAnalytics/components/DownloadMenu/constants/menu.d.ts +8 -0
  10. package/dist/types/components/ChartAnalytics/components/DownloadMenu/constants/menu.d.ts.map +1 -0
  11. package/dist/types/components/ChartAnalytics/components/DownloadMenu/index.d.ts +9 -0
  12. package/dist/types/components/ChartAnalytics/components/DownloadMenu/index.d.ts.map +1 -0
  13. package/dist/types/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.d.ts +2 -0
  14. package/dist/types/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.d.ts.map +1 -0
  15. package/dist/types/components/ChartAnalytics/hooks/useChart.d.ts +12 -0
  16. package/dist/types/components/ChartAnalytics/hooks/useChart.d.ts.map +1 -0
  17. package/dist/types/components/ChartAnalytics/index.d.ts +2 -0
  18. package/dist/types/components/ChartAnalytics/index.d.ts.map +1 -0
  19. package/dist/types/components/ChartAnalytics/models/bar.d.ts +9 -0
  20. package/dist/types/components/ChartAnalytics/models/bar.d.ts.map +1 -0
  21. package/dist/types/components/ChartAnalytics/models/column.d.ts +13 -0
  22. package/dist/types/components/ChartAnalytics/models/column.d.ts.map +1 -0
  23. package/dist/types/components/ChartAnalytics/models/index.d.ts +19 -0
  24. package/dist/types/components/ChartAnalytics/models/index.d.ts.map +1 -0
  25. package/dist/types/components/ChartAnalytics/models/line.d.ts +9 -0
  26. package/dist/types/components/ChartAnalytics/models/line.d.ts.map +1 -0
  27. package/dist/types/components/ChartAnalytics/models/multi-series.d.ts +10 -0
  28. package/dist/types/components/ChartAnalytics/models/multi-series.d.ts.map +1 -0
  29. package/dist/types/components/ChartAnalytics/models/pie.d.ts +9 -0
  30. package/dist/types/components/ChartAnalytics/models/pie.d.ts.map +1 -0
  31. package/dist/types/components/ChartAnalytics/services/export.d.ts +9 -0
  32. package/dist/types/components/ChartAnalytics/services/export.d.ts.map +1 -0
  33. package/dist/types/components/ChartAnalytics/types/props.d.ts +47 -0
  34. package/dist/types/components/ChartAnalytics/types/props.d.ts.map +1 -0
  35. package/dist/types/components/ChartAnalytics/utils/chart.d.ts +16 -0
  36. package/dist/types/components/ChartAnalytics/utils/chart.d.ts.map +1 -0
  37. package/dist/types/components/CircularProgressDashboard/CircularProgressIndicator.d.ts +6 -0
  38. package/dist/types/components/CircularProgressDashboard/CircularProgressIndicator.d.ts.map +1 -0
  39. package/dist/types/components/CircularProgressDashboard/index.d.ts +3 -0
  40. package/dist/types/components/CircularProgressDashboard/index.d.ts.map +1 -0
  41. package/dist/types/components/CircularProgressDashboard/types/props.d.ts +18 -0
  42. package/dist/types/components/CircularProgressDashboard/types/props.d.ts.map +1 -0
  43. package/dist/types/components/DHIS2PivotTable/DHIS2PivotTable.d.ts +23 -0
  44. package/dist/types/components/DHIS2PivotTable/DHIS2PivotTable.d.ts.map +1 -0
  45. package/dist/types/components/DHIS2PivotTable/components/Table/index.d.ts +10 -0
  46. package/dist/types/components/DHIS2PivotTable/components/Table/index.d.ts.map +1 -0
  47. package/dist/types/components/DHIS2PivotTable/components/TableBody/index.d.ts +2 -0
  48. package/dist/types/components/DHIS2PivotTable/components/TableBody/index.d.ts.map +1 -0
  49. package/dist/types/components/DHIS2PivotTable/components/TableHeaders/index.d.ts +2 -0
  50. package/dist/types/components/DHIS2PivotTable/components/TableHeaders/index.d.ts.map +1 -0
  51. package/dist/types/components/DHIS2PivotTable/index.d.ts +3 -0
  52. package/dist/types/components/DHIS2PivotTable/index.d.ts.map +1 -0
  53. package/dist/types/components/DHIS2PivotTable/interfaces/index.d.ts +2 -0
  54. package/dist/types/components/DHIS2PivotTable/interfaces/index.d.ts.map +1 -0
  55. package/dist/types/components/DHIS2PivotTable/services/engine.d.ts +63 -0
  56. package/dist/types/components/DHIS2PivotTable/services/engine.d.ts.map +1 -0
  57. package/dist/types/components/DHIS2PivotTable/state/engine.d.ts +8 -0
  58. package/dist/types/components/DHIS2PivotTable/state/engine.d.ts.map +1 -0
  59. package/dist/types/components/Map/DHIS2Map.d.ts +9 -0
  60. package/dist/types/components/Map/DHIS2Map.d.ts.map +1 -0
  61. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.d.ts +10 -0
  62. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.d.ts.map +1 -0
  63. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.d.ts +9 -0
  64. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.d.ts.map +1 -0
  65. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.d.ts +2 -0
  66. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.d.ts.map +1 -0
  67. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.d.ts +2 -0
  68. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.d.ts.map +1 -0
  69. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/Name.d.ts +2 -0
  70. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/Name.d.ts.map +1 -0
  71. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.d.ts +2 -0
  72. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.d.ts.map +1 -0
  73. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.d.ts +2 -0
  74. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.d.ts.map +1 -0
  75. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.d.ts +4 -0
  76. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.d.ts.map +1 -0
  77. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/hooks/data.d.ts +8 -0
  78. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/hooks/data.d.ts.map +1 -0
  79. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/index.d.ts +3 -0
  80. package/dist/types/components/Map/components/EarthEngineLayerConfiguration/index.d.ts.map +1 -0
  81. package/dist/types/components/Map/components/MapArea/index.d.ts +6 -0
  82. package/dist/types/components/Map/components/MapArea/index.d.ts.map +1 -0
  83. package/dist/types/components/Map/components/MapArea/interfaces/index.d.ts +31 -0
  84. package/dist/types/components/Map/components/MapArea/interfaces/index.d.ts.map +1 -0
  85. package/dist/types/components/Map/components/MapControls/components/CustomControl/index.d.ts +8 -0
  86. package/dist/types/components/Map/components/MapControls/components/CustomControl/index.d.ts.map +1 -0
  87. package/dist/types/components/Map/components/MapControls/components/DownloadControl/index.d.ts +8 -0
  88. package/dist/types/components/Map/components/MapControls/components/DownloadControl/index.d.ts.map +1 -0
  89. package/dist/types/components/Map/components/MapControls/components/FullscreenControl/index.d.ts +6 -0
  90. package/dist/types/components/Map/components/MapControls/components/FullscreenControl/index.d.ts.map +1 -0
  91. package/dist/types/components/Map/components/MapControls/index.d.ts +6 -0
  92. package/dist/types/components/Map/components/MapControls/index.d.ts.map +1 -0
  93. package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts +2 -0
  94. package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts.map +1 -0
  95. package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/index.d.ts +15 -0
  96. package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/index.d.ts.map +1 -0
  97. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.d.ts +18 -0
  98. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.d.ts.map +1 -0
  99. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.d.ts +5 -0
  100. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.d.ts.map +1 -0
  101. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.d.ts +10 -0
  102. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.d.ts.map +1 -0
  103. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts +4 -0
  104. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts.map +1 -0
  105. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.d.ts +59 -0
  106. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.d.ts.map +1 -0
  107. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.d.ts +56 -0
  108. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.d.ts.map +1 -0
  109. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.d.ts +21 -0
  110. package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.d.ts.map +1 -0
  111. package/dist/types/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.d.ts +6 -0
  112. package/dist/types/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.d.ts.map +1 -0
  113. package/dist/types/components/Map/components/MapLayer/components/LegendArea/index.d.ts +9 -0
  114. package/dist/types/components/Map/components/MapLayer/components/LegendArea/index.d.ts.map +1 -0
  115. package/dist/types/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.d.ts +4 -0
  116. package/dist/types/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.d.ts.map +1 -0
  117. package/dist/types/components/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts +3 -0
  118. package/dist/types/components/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts.map +1 -0
  119. package/dist/types/components/Map/components/MapLayer/components/PointLayer/index.d.ts +2 -0
  120. package/dist/types/components/Map/components/MapLayer/components/PointLayer/index.d.ts.map +1 -0
  121. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.d.ts +13 -0
  122. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.d.ts.map +1 -0
  123. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.d.ts +11 -0
  124. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.d.ts.map +1 -0
  125. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.d.ts +17 -0
  126. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.d.ts.map +1 -0
  127. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.d.ts +22 -0
  128. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.d.ts.map +1 -0
  129. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.d.ts +22 -0
  130. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.d.ts.map +1 -0
  131. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts +17 -0
  132. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts.map +1 -0
  133. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts +5 -0
  134. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts.map +1 -0
  135. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts +3 -0
  136. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts.map +1 -0
  137. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/index.d.ts +5 -0
  138. package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/index.d.ts.map +1 -0
  139. package/dist/types/components/Map/components/MapLayer/index.d.ts +6 -0
  140. package/dist/types/components/Map/components/MapLayer/index.d.ts.map +1 -0
  141. package/dist/types/components/Map/components/MapLayer/interfaces/index.d.ts +136 -0
  142. package/dist/types/components/Map/components/MapLayer/interfaces/index.d.ts.map +1 -0
  143. package/dist/types/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.d.ts +10 -0
  144. package/dist/types/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.d.ts.map +1 -0
  145. package/dist/types/components/Map/components/MapProvider/components/MapLayerProvider/index.d.ts +7 -0
  146. package/dist/types/components/Map/components/MapProvider/components/MapLayerProvider/index.d.ts.map +1 -0
  147. package/dist/types/components/Map/components/MapProvider/hooks/index.d.ts +16 -0
  148. package/dist/types/components/Map/components/MapProvider/hooks/index.d.ts.map +1 -0
  149. package/dist/types/components/Map/components/MapProvider/index.d.ts +3 -0
  150. package/dist/types/components/Map/components/MapProvider/index.d.ts.map +1 -0
  151. package/dist/types/components/Map/components/MapUpdater/index.d.ts +5 -0
  152. package/dist/types/components/Map/components/MapUpdater/index.d.ts.map +1 -0
  153. package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.d.ts +3 -0
  154. package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.d.ts.map +1 -0
  155. package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.d.ts +3 -0
  156. package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.d.ts.map +1 -0
  157. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts +8 -0
  158. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts.map +1 -0
  159. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.d.ts +420 -0
  160. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.d.ts.map +1 -0
  161. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.d.ts +9 -0
  162. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.d.ts.map +1 -0
  163. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.d.ts +12 -0
  164. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.d.ts.map +1 -0
  165. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts +2 -0
  166. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts.map +1 -0
  167. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.d.ts +8 -0
  168. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.d.ts.map +1 -0
  169. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.d.ts +9 -0
  170. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.d.ts.map +1 -0
  171. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/RadiusField.d.ts +2 -0
  172. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/RadiusField.d.ts.map +1 -0
  173. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/TypeField.d.ts +2 -0
  174. package/dist/types/components/Map/components/ThematicLayerConfiguration/components/TypeField.d.ts.map +1 -0
  175. package/dist/types/components/Map/components/ThematicLayerConfiguration/index.d.ts +4 -0
  176. package/dist/types/components/Map/components/ThematicLayerConfiguration/index.d.ts.map +1 -0
  177. package/dist/types/components/Map/components/ThematicLayerConfiguration/types/index.d.ts +15 -0
  178. package/dist/types/components/Map/components/ThematicLayerConfiguration/types/index.d.ts.map +1 -0
  179. package/dist/types/components/Map/constants/colors.d.ts +422 -0
  180. package/dist/types/components/Map/constants/colors.d.ts.map +1 -0
  181. package/dist/types/components/Map/constants/legendSet.d.ts +8 -0
  182. package/dist/types/components/Map/constants/legendSet.d.ts.map +1 -0
  183. package/dist/types/components/Map/hooks/map.d.ts +10 -0
  184. package/dist/types/components/Map/hooks/map.d.ts.map +1 -0
  185. package/dist/types/components/Map/index.d.ts +6 -0
  186. package/dist/types/components/Map/index.d.ts.map +1 -0
  187. package/dist/types/components/Map/interfaces/index.d.ts +76 -0
  188. package/dist/types/components/Map/interfaces/index.d.ts.map +1 -0
  189. package/dist/types/components/Map/state/index.d.ts +21 -0
  190. package/dist/types/components/Map/state/index.d.ts.map +1 -0
  191. package/dist/types/components/Map/utils/colors.d.ts +13 -0
  192. package/dist/types/components/Map/utils/colors.d.ts.map +1 -0
  193. package/dist/types/components/Map/utils/helpers.d.ts +7 -0
  194. package/dist/types/components/Map/utils/helpers.d.ts.map +1 -0
  195. package/dist/types/components/Map/utils/map.d.ts +41 -0
  196. package/dist/types/components/Map/utils/map.d.ts.map +1 -0
  197. package/dist/types/components/SingleValueContainer/SingleValueVisualizer.d.ts +11 -0
  198. package/dist/types/components/SingleValueContainer/SingleValueVisualizer.d.ts.map +1 -0
  199. package/dist/types/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.d.ts +10 -0
  200. package/dist/types/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.d.ts.map +1 -0
  201. package/dist/types/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.d.ts +3 -0
  202. package/dist/types/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.d.ts.map +1 -0
  203. package/dist/types/components/SingleValueContainer/index.d.ts +5 -0
  204. package/dist/types/components/SingleValueContainer/index.d.ts.map +1 -0
  205. package/dist/types/components/SingleValueContainer/types/props.d.ts +18 -0
  206. package/dist/types/components/SingleValueContainer/types/props.d.ts.map +1 -0
  207. package/dist/types/components/Visualization/components/AnalyticsDataProvider/index.d.ts +11 -0
  208. package/dist/types/components/Visualization/components/AnalyticsDataProvider/index.d.ts.map +1 -0
  209. package/dist/types/components/Visualization/components/DimensionsProvider/index.d.ts +16 -0
  210. package/dist/types/components/Visualization/components/DimensionsProvider/index.d.ts.map +1 -0
  211. package/dist/types/components/Visualization/components/LayoutProvider/index.d.ts +15 -0
  212. package/dist/types/components/Visualization/components/LayoutProvider/index.d.ts.map +1 -0
  213. package/dist/types/components/Visualization/components/VisualizationDimensionSelector/index.d.ts +5 -0
  214. package/dist/types/components/Visualization/components/VisualizationDimensionSelector/index.d.ts.map +1 -0
  215. package/dist/types/components/Visualization/components/VisualizationProvider/index.d.ts +14 -0
  216. package/dist/types/components/Visualization/components/VisualizationProvider/index.d.ts.map +1 -0
  217. package/dist/types/components/Visualization/components/VisualizationSelector/index.d.ts +23 -0
  218. package/dist/types/components/Visualization/components/VisualizationSelector/index.d.ts.map +1 -0
  219. package/dist/types/components/Visualization/components/VisualizationTypeProvider/index.d.ts +15 -0
  220. package/dist/types/components/Visualization/components/VisualizationTypeProvider/index.d.ts.map +1 -0
  221. package/dist/types/components/Visualization/components/VisualizationTypeSelector/index.d.ts +2 -0
  222. package/dist/types/components/Visualization/components/VisualizationTypeSelector/index.d.ts.map +1 -0
  223. package/dist/types/components/Visualization/index.d.ts +23 -0
  224. package/dist/types/components/Visualization/index.d.ts.map +1 -0
  225. package/dist/types/index.d.ts +7 -0
  226. package/dist/types/index.d.ts.map +1 -0
  227. package/package.json +4 -4
@@ -79,7 +79,8 @@ function ColumnRenderer({
79
79
  columns,
80
80
  rowHeaders,
81
81
  prevHeight: height,
82
- fixColumnHeaders
82
+ fixColumnHeaders,
83
+ engine
83
84
  }
84
85
  }
85
86
  ) : null
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/DHIS2PivotTable/components/TableHeaders/index.tsx"],"names":["column"],"mappings":"AA2CE,mBAGG,KAQF,YAXD;AA1CF,SAAS,iCAAiC;AAC1C,SAAS,uBAAuB,cAAc,iBAAiB;AAC/D,SAAS,SAAS,OAAO,aAAa;AAEtC,OAAO,aAAa;AACpB,SAAS,sBAAsB;AAE/B,SAAS,eAAe;AAAA,EACvB;AAAA,EACA;AAAA,EACA,QAAQ,EAAE,kBAAkB,YAAY,aAAa,GAAG,SAAS,OAAO;AACzE,GAU8B;AAC7B,QAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,IAAI,eAAe;AAErD,MAAI,CAAC,QAAQ;AACZ,WAAO;AAAA,EACR;AACA,QAAM,UAAU,MAAM,SAAS,QAAQ,CAAC,EAAE,OAAO,CAAC,KAAKA,YAAW;AACjE,WAAO,OAAOA,QAAO,OAAO,UAAU;AAAA,EACvC,GAAG,CAAC;AAEJ,QAAM,gBAAgB,CAAC,QAAQ,QAAQ,QAAQ,CAAC,CAAC;AACjD,QAAM,aAAa,QAAQ,QAAQ,CAAC;AAEpC,QAAM,uBAAuB,MAAM,SAAS,GAAG,KAAK,EAAE;AAAA,IACrD,CAAC,KAAKA,YAAW;AAChB,aAAO,OAAOA,QAAO,OAAO,UAAU;AAAA,IACvC;AAAA,IACA;AAAA,EACD;AAEA,SACC,iCACE;AAAA,YAAQ,aACR,oBAAC,gBACA;AAAA,MAAC;AAAA;AAAA,QACA,OAAM;AAAA,QACN,SAAS,OAAO,UAAU,SAAS;AAAA,QAElC,iBAAO,SAAS;AAAA;AAAA,IAClB,GACD;AAAA,IAED,qBAAC,gBAC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\"react\";\nimport { useCustomPivotTableEngine } from \"../../state/engine.js\";\nimport { DataTableColumnHeader, DataTableRow, TableHead } from \"@dhis2/ui\";\nimport { isEmpty, slice, times } from \"lodash\";\nimport { DHIS2PivotTableEngine, Header } from \"../../services/engine.js\";\nimport classes from \"./TableHeaders.module.css\";\nimport { useElementSize } from \"usehooks-ts\";\n\nfunction ColumnRenderer({\n\tcolumn,\n\tindex,\n\tconfig: { fixColumnHeaders, rowHeaders, prevHeight = 0, columns, engine },\n}: {\n\tcolumn: Header;\n\tindex: number;\n\tconfig: {\n\t\tcolumns: Header[];\n\t\trowHeaders?: Header[];\n\t\tprevHeight?: number;\n\t\tfixColumnHeaders?: boolean;\n\t\tengine: DHIS2PivotTableEngine;\n\t};\n}): React.ReactElement | null {\n\tconst [columnHeaderRef, { height }] = useElementSize();\n\n\tif (!column) {\n\t\treturn null;\n\t}\n\tconst colSpan = slice(columns, index + 1).reduce((acc, column) => {\n\t\treturn acc * (column.items?.length ?? 1);\n\t}, 1);\n\n\tconst hasSubColumns = !isEmpty(columns[index + 1]);\n\tconst nextColumn = columns[index + 1];\n\n\tconst multiplicationFactor = slice(columns, 0, index).reduce(\n\t\t(acc, column) => {\n\t\t\treturn acc * (column.items?.length ?? 1);\n\t\t},\n\t\t1,\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{engine?.showTitle && (\n\t\t\t\t<DataTableRow>\n\t\t\t\t\t<DataTableColumnHeader\n\t\t\t\t\t\talign=\"center\"\n\t\t\t\t\t\tcolSpan={engine.titleSpan.toString()}\n\t\t\t\t\t>\n\t\t\t\t\t\t{engine.title ?? \"\"}\n\t\t\t\t\t</DataTableColumnHeader>\n\t\t\t\t</DataTableRow>\n\t\t\t)}\n\t\t\t<DataTableRow>\n\t\t\t\t{index === 0 &&\n\t\t\t\t\trowHeaders?.map((header) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<DataTableColumnHeader\n\t\t\t\t\t\t\t\tfixed={fixColumnHeaders}\n\t\t\t\t\t\t\t\t/*\n // @ts-ignore */\n\t\t\t\t\t\t\t\ttop={\"0\"}\n\t\t\t\t\t\t\t\tclassName={classes[\"table-header\"]}\n\t\t\t\t\t\t\t\trowSpan={columns.length.toString()}\n\t\t\t\t\t\t\t\tkey={`${header.dimension}-header-column`}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{header.label ?? \"\"}\n\t\t\t\t\t\t\t</DataTableColumnHeader>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t{times(multiplicationFactor, (colNo) => {\n\t\t\t\t\treturn column.items?.map((item) => (\n\t\t\t\t\t\t<DataTableColumnHeader\n\t\t\t\t\t\t\tfixed={fixColumnHeaders}\n\t\t\t\t\t\t\t/*\n // @ts-ignore */\n\t\t\t\t\t\t\ttop={`${prevHeight.toString()}px`}\n\t\t\t\t\t\t\tref={index === 0 ? columnHeaderRef : undefined}\n\t\t\t\t\t\t\tclassName={classes[\"table-header\"]}\n\t\t\t\t\t\t\talign=\"center\"\n\t\t\t\t\t\t\tcolSpan={colSpan.toString()}\n\t\t\t\t\t\t\tkey={`${colNo}-${item.name}-column-header`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{item.name as unknown as string}\n\t\t\t\t\t\t</DataTableColumnHeader>\n\t\t\t\t\t));\n\t\t\t\t})}\n\t\t\t</DataTableRow>\n\t\t\t{hasSubColumns ? (\n\t\t\t\t<ColumnRenderer\n\t\t\t\t\tcolumn={nextColumn}\n\t\t\t\t\tindex={index + 1}\n\t\t\t\t\tconfig={{\n\t\t\t\t\t\tcolumns,\n\t\t\t\t\t\trowHeaders,\n\t\t\t\t\t\tprevHeight: height,\n\t\t\t\t\t\tfixColumnHeaders,\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t</>\n\t);\n}\n\nexport function TableHeaders() {\n\tconst engine = useCustomPivotTableEngine();\n\tconst columns = engine?.columnHeaders;\n\tconst rowHeaders = engine?.rowHeaders;\n\tconst fixColumnHeaders = engine?.fixColumnHeaders;\n\n\tif (!columns || isEmpty(columns)) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<TableHead>\n\t\t\t<ColumnRenderer\n\t\t\t\tcolumn={columns[0]}\n\t\t\t\tindex={0}\n\t\t\t\tconfig={{ engine, rowHeaders, columns, fixColumnHeaders }}\n\t\t\t/>\n\t\t</TableHead>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["../../../../../src/components/DHIS2PivotTable/components/TableHeaders/index.tsx"],"names":["column"],"mappings":"AA2CE,mBAGG,KAQF,YAXD;AA1CF,SAAS,iCAAiC;AAC1C,SAAS,uBAAuB,cAAc,iBAAiB;AAC/D,SAAS,SAAS,OAAO,aAAa;AAEtC,OAAO,aAAa;AACpB,SAAS,sBAAsB;AAE/B,SAAS,eAAe;AAAA,EACvB;AAAA,EACA;AAAA,EACA,QAAQ,EAAE,kBAAkB,YAAY,aAAa,GAAG,SAAS,OAAO;AACzE,GAU8B;AAC7B,QAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,IAAI,eAAe;AAErD,MAAI,CAAC,QAAQ;AACZ,WAAO;AAAA,EACR;AACA,QAAM,UAAU,MAAM,SAAS,QAAQ,CAAC,EAAE,OAAO,CAAC,KAAKA,YAAW;AACjE,WAAO,OAAOA,QAAO,OAAO,UAAU;AAAA,EACvC,GAAG,CAAC;AAEJ,QAAM,gBAAgB,CAAC,QAAQ,QAAQ,QAAQ,CAAC,CAAC;AACjD,QAAM,aAAa,QAAQ,QAAQ,CAAC;AAEpC,QAAM,uBAAuB,MAAM,SAAS,GAAG,KAAK,EAAE;AAAA,IACrD,CAAC,KAAKA,YAAW;AAChB,aAAO,OAAOA,QAAO,OAAO,UAAU;AAAA,IACvC;AAAA,IACA;AAAA,EACD;AAEA,SACC,iCACE;AAAA,YAAQ,aACR,oBAAC,gBACA;AAAA,MAAC;AAAA;AAAA,QACA,OAAM;AAAA,QACN,SAAS,OAAO,UAAU,SAAS;AAAA,QAElC,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AAQ,YAAY,SAAS,iBAAiB;AAAA;AAAA,EACzD,GACD;AAEF","sourcesContent":["import React from \"react\";\nimport { useCustomPivotTableEngine } from \"../../state/engine.js\";\nimport { DataTableColumnHeader, DataTableRow, TableHead } from \"@dhis2/ui\";\nimport { isEmpty, slice, times } from \"lodash\";\nimport { DHIS2PivotTableEngine, Header } from \"../../services/engine.js\";\nimport classes from \"./TableHeaders.module.css\";\nimport { useElementSize } from \"usehooks-ts\";\n\nfunction ColumnRenderer({\n\tcolumn,\n\tindex,\n\tconfig: { fixColumnHeaders, rowHeaders, prevHeight = 0, columns, engine },\n}: {\n\tcolumn: Header;\n\tindex: number;\n\tconfig: {\n\t\tcolumns: Header[];\n\t\trowHeaders?: Header[];\n\t\tprevHeight?: number;\n\t\tfixColumnHeaders?: boolean;\n\t\tengine: DHIS2PivotTableEngine;\n\t};\n}): React.ReactElement | null {\n\tconst [columnHeaderRef, { height }] = useElementSize();\n\n\tif (!column) {\n\t\treturn null;\n\t}\n\tconst colSpan = slice(columns, index + 1).reduce((acc, column) => {\n\t\treturn acc * (column.items?.length ?? 1);\n\t}, 1);\n\n\tconst hasSubColumns = !isEmpty(columns[index + 1]);\n\tconst nextColumn = columns[index + 1];\n\n\tconst multiplicationFactor = slice(columns, 0, index).reduce(\n\t\t(acc, column) => {\n\t\t\treturn acc * (column.items?.length ?? 1);\n\t\t},\n\t\t1,\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{engine?.showTitle && (\n\t\t\t\t<DataTableRow>\n\t\t\t\t\t<DataTableColumnHeader\n\t\t\t\t\t\talign=\"center\"\n\t\t\t\t\t\tcolSpan={engine.titleSpan.toString()}\n\t\t\t\t\t>\n\t\t\t\t\t\t{engine.title ?? \"\"}\n\t\t\t\t\t</DataTableColumnHeader>\n\t\t\t\t</DataTableRow>\n\t\t\t)}\n\t\t\t<DataTableRow>\n\t\t\t\t{index === 0 &&\n\t\t\t\t\trowHeaders?.map((header) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<DataTableColumnHeader\n\t\t\t\t\t\t\t\tfixed={fixColumnHeaders}\n\t\t\t\t\t\t\t\t/*\n // @ts-ignore */\n\t\t\t\t\t\t\t\ttop={\"0\"}\n\t\t\t\t\t\t\t\tclassName={classes[\"table-header\"]}\n\t\t\t\t\t\t\t\trowSpan={columns.length.toString()}\n\t\t\t\t\t\t\t\tkey={`${header.dimension}-header-column`}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{header.label ?? \"\"}\n\t\t\t\t\t\t\t</DataTableColumnHeader>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t{times(multiplicationFactor, (colNo) => {\n\t\t\t\t\treturn column.items?.map((item) => (\n\t\t\t\t\t\t<DataTableColumnHeader\n\t\t\t\t\t\t\tfixed={fixColumnHeaders}\n\t\t\t\t\t\t\t/*\n // @ts-ignore */\n\t\t\t\t\t\t\ttop={`${prevHeight.toString()}px`}\n\t\t\t\t\t\t\tref={index === 0 ? columnHeaderRef : undefined}\n\t\t\t\t\t\t\tclassName={classes[\"table-header\"]}\n\t\t\t\t\t\t\talign=\"center\"\n\t\t\t\t\t\t\tcolSpan={colSpan.toString()}\n\t\t\t\t\t\t\tkey={`${colNo}-${item.name}-column-header`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{item.name as unknown as string}\n\t\t\t\t\t\t</DataTableColumnHeader>\n\t\t\t\t\t));\n\t\t\t\t})}\n\t\t\t</DataTableRow>\n\t\t\t{hasSubColumns ? (\n\t\t\t\t<ColumnRenderer\n\t\t\t\t\tcolumn={nextColumn}\n\t\t\t\t\tindex={index + 1}\n\t\t\t\t\tconfig={{\n\t\t\t\t\t\tcolumns,\n\t\t\t\t\t\trowHeaders,\n\t\t\t\t\t\tprevHeight: height,\n\t\t\t\t\t\tfixColumnHeaders,\n\t\t\t\t\t\tengine,\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t</>\n\t);\n}\n\nexport function TableHeaders() {\n\tconst engine = useCustomPivotTableEngine();\n\tconst columns = engine?.columnHeaders;\n\tconst rowHeaders = engine?.rowHeaders;\n\tconst fixColumnHeaders = engine?.fixColumnHeaders;\n\n\tif (!columns || isEmpty(columns)) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<TableHead>\n\t\t\t<ColumnRenderer\n\t\t\t\tcolumn={columns[0]}\n\t\t\t\tindex={0}\n\t\t\t\tconfig={{ engine, rowHeaders, columns, fixColumnHeaders }}\n\t\t\t/>\n\t\t</TableHead>\n\t);\n}\n"]}
@@ -73,7 +73,8 @@ function ColumnRenderer({
73
73
  columns,
74
74
  rowHeaders,
75
75
  prevHeight: height,
76
- fixColumnHeaders
76
+ fixColumnHeaders,
77
+ engine
77
78
  }
78
79
  }
79
80
  ) : null
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/components/DHIS2PivotTable/components/TableHeaders/index.tsx"],"names":["column"],"mappings":"AA2CE,mBAGG,KAQF,YAXD;AA1CF,SAAS,iCAAiC;AAC1C,SAAS,uBAAuB,cAAc,iBAAiB;AAC/D,SAAS,SAAS,OAAO,aAAa;AAEtC,OAAO,aAAa;AACpB,SAAS,sBAAsB;AAE/B,SAAS,eAAe;AAAA,EACvB;AAAA,EACA;AAAA,EACA,QAAQ,EAAE,kBAAkB,YAAY,aAAa,GAAG,SAAS,OAAO;AACzE,GAU8B;AAC7B,QAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,IAAI,eAAe;AAErD,MAAI,CAAC,QAAQ;AACZ,WAAO;AAAA,EACR;AACA,QAAM,UAAU,MAAM,SAAS,QAAQ,CAAC,EAAE,OAAO,CAAC,KAAKA,YAAW;AACjE,WAAO,OAAOA,QAAO,OAAO,UAAU;AAAA,EACvC,GAAG,CAAC;AAEJ,QAAM,gBAAgB,CAAC,QAAQ,QAAQ,QAAQ,CAAC,CAAC;AACjD,QAAM,aAAa,QAAQ,QAAQ,CAAC;AAEpC,QAAM,uBAAuB,MAAM,SAAS,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;AACxB,QAAM,aAAa,QAAQ;AAC3B,QAAM,mBAAmB,QAAQ;AAEjC,MAAI,CAAC,WAAW,QAAQ,OAAO,GAAG;AACjC,WAAO;AAAA,EACR;AAEA,SACC,oBAAC,aACA;AAAA,IAAC;AAAA;AAAA,MACA,QAAQ,QAAQ,CAAC;AAAA,MACjB,OAAO;AAAA,MACP,QAAQ,EAAE,QAAQ,YAAY,SAAS,iBAAiB;AAAA;AAAA,EACzD,GACD;AAEF","sourcesContent":["import React from \"react\";\nimport { useCustomPivotTableEngine } from \"../../state/engine.js\";\nimport { DataTableColumnHeader, DataTableRow, TableHead } from \"@dhis2/ui\";\nimport { isEmpty, slice, times } from \"lodash\";\nimport { DHIS2PivotTableEngine, Header } from \"../../services/engine.js\";\nimport classes from \"./TableHeaders.module.css\";\nimport { useElementSize } from \"usehooks-ts\";\n\nfunction ColumnRenderer({\n\tcolumn,\n\tindex,\n\tconfig: { fixColumnHeaders, rowHeaders, prevHeight = 0, columns, engine },\n}: {\n\tcolumn: Header;\n\tindex: number;\n\tconfig: {\n\t\tcolumns: Header[];\n\t\trowHeaders?: Header[];\n\t\tprevHeight?: number;\n\t\tfixColumnHeaders?: boolean;\n\t\tengine: DHIS2PivotTableEngine;\n\t};\n}): React.ReactElement | null {\n\tconst [columnHeaderRef, { height }] = useElementSize();\n\n\tif (!column) {\n\t\treturn null;\n\t}\n\tconst colSpan = slice(columns, index + 1).reduce((acc, column) => {\n\t\treturn acc * (column.items?.length ?? 1);\n\t}, 1);\n\n\tconst hasSubColumns = !isEmpty(columns[index + 1]);\n\tconst nextColumn = columns[index + 1];\n\n\tconst multiplicationFactor = slice(columns, 0, index).reduce(\n\t\t(acc, column) => {\n\t\t\treturn acc * (column.items?.length ?? 1);\n\t\t},\n\t\t1,\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{engine?.showTitle && (\n\t\t\t\t<DataTableRow>\n\t\t\t\t\t<DataTableColumnHeader\n\t\t\t\t\t\talign=\"center\"\n\t\t\t\t\t\tcolSpan={engine.titleSpan.toString()}\n\t\t\t\t\t>\n\t\t\t\t\t\t{engine.title ?? \"\"}\n\t\t\t\t\t</DataTableColumnHeader>\n\t\t\t\t</DataTableRow>\n\t\t\t)}\n\t\t\t<DataTableRow>\n\t\t\t\t{index === 0 &&\n\t\t\t\t\trowHeaders?.map((header) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<DataTableColumnHeader\n\t\t\t\t\t\t\t\tfixed={fixColumnHeaders}\n\t\t\t\t\t\t\t\t/*\n // @ts-ignore */\n\t\t\t\t\t\t\t\ttop={\"0\"}\n\t\t\t\t\t\t\t\tclassName={classes[\"table-header\"]}\n\t\t\t\t\t\t\t\trowSpan={columns.length.toString()}\n\t\t\t\t\t\t\t\tkey={`${header.dimension}-header-column`}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{header.label ?? \"\"}\n\t\t\t\t\t\t\t</DataTableColumnHeader>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t{times(multiplicationFactor, (colNo) => {\n\t\t\t\t\treturn column.items?.map((item) => (\n\t\t\t\t\t\t<DataTableColumnHeader\n\t\t\t\t\t\t\tfixed={fixColumnHeaders}\n\t\t\t\t\t\t\t/*\n // @ts-ignore */\n\t\t\t\t\t\t\ttop={`${prevHeight.toString()}px`}\n\t\t\t\t\t\t\tref={index === 0 ? columnHeaderRef : undefined}\n\t\t\t\t\t\t\tclassName={classes[\"table-header\"]}\n\t\t\t\t\t\t\talign=\"center\"\n\t\t\t\t\t\t\tcolSpan={colSpan.toString()}\n\t\t\t\t\t\t\tkey={`${colNo}-${item.name}-column-header`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{item.name as unknown as string}\n\t\t\t\t\t\t</DataTableColumnHeader>\n\t\t\t\t\t));\n\t\t\t\t})}\n\t\t\t</DataTableRow>\n\t\t\t{hasSubColumns ? (\n\t\t\t\t<ColumnRenderer\n\t\t\t\t\tcolumn={nextColumn}\n\t\t\t\t\tindex={index + 1}\n\t\t\t\t\tconfig={{\n\t\t\t\t\t\tcolumns,\n\t\t\t\t\t\trowHeaders,\n\t\t\t\t\t\tprevHeight: height,\n\t\t\t\t\t\tfixColumnHeaders,\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t</>\n\t);\n}\n\nexport function TableHeaders() {\n\tconst engine = useCustomPivotTableEngine();\n\tconst columns = engine?.columnHeaders;\n\tconst rowHeaders = engine?.rowHeaders;\n\tconst fixColumnHeaders = engine?.fixColumnHeaders;\n\n\tif (!columns || isEmpty(columns)) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<TableHead>\n\t\t\t<ColumnRenderer\n\t\t\t\tcolumn={columns[0]}\n\t\t\t\tindex={0}\n\t\t\t\tconfig={{ engine, rowHeaders, columns, fixColumnHeaders }}\n\t\t\t/>\n\t\t</TableHead>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["../../../../../../src/components/DHIS2PivotTable/components/TableHeaders/index.tsx"],"names":["column"],"mappings":"AA2CE,mBAGG,KAQF,YAXD;AA1CF,SAAS,iCAAiC;AAC1C,SAAS,uBAAuB,cAAc,iBAAiB;AAC/D,SAAS,SAAS,OAAO,aAAa;AAEtC,OAAO,aAAa;AACpB,SAAS,sBAAsB;AAE/B,SAAS,eAAe;AAAA,EACvB;AAAA,EACA;AAAA,EACA,QAAQ,EAAE,kBAAkB,YAAY,aAAa,GAAG,SAAS,OAAO;AACzE,GAU8B;AAC7B,QAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,IAAI,eAAe;AAErD,MAAI,CAAC,QAAQ;AACZ,WAAO;AAAA,EACR;AACA,QAAM,UAAU,MAAM,SAAS,QAAQ,CAAC,EAAE,OAAO,CAAC,KAAKA,YAAW;AACjE,WAAO,OAAOA,QAAO,OAAO,UAAU;AAAA,EACvC,GAAG,CAAC;AAEJ,QAAM,gBAAgB,CAAC,QAAQ,QAAQ,QAAQ,CAAC,CAAC;AACjD,QAAM,a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;AAEO,SAAS,eAAe;AAC9B,QAAM,SAAS,0BAA0B;AACzC,QAAM,UAAU,QAAQ;AACxB,QAAM,aAAa,QAAQ;AAC3B,QAAM,mBAAmB,QAAQ;AAEjC,MAAI,CAAC,WAAW,QAAQ,OAAO,GAAG;AACjC,WAAO;AAAA,EACR;AAEA,SACC,oBAAC,aACA;AAAA,IAAC;AAAA;AAAA,MACA,QAAQ,QAAQ,CAAC;AAAA,MACjB,OAAO;AAAA,MACP,QAAQ,EAAE,QAAQ,YAAY,SAAS,iBAAiB;AAAA;AAAA,EACzD,GACD;AAEF","sourcesContent":["import React from \"react\";\nimport { useCustomPivotTableEngine } from \"../../state/engine.js\";\nimport { DataTableColumnHeader, DataTableRow, TableHead } from \"@dhis2/ui\";\nimport { isEmpty, slice, times } from \"lodash\";\nimport { DHIS2PivotTableEngine, Header } from \"../../services/engine.js\";\nimport classes from \"./TableHeaders.module.css\";\nimport { useElementSize } from \"usehooks-ts\";\n\nfunction ColumnRenderer({\n\tcolumn,\n\tindex,\n\tconfig: { fixColumnHeaders, rowHeaders, prevHeight = 0, columns, engine },\n}: {\n\tcolumn: Header;\n\tindex: number;\n\tconfig: {\n\t\tcolumns: Header[];\n\t\trowHeaders?: Header[];\n\t\tprevHeight?: number;\n\t\tfixColumnHeaders?: boolean;\n\t\tengine: DHIS2PivotTableEngine;\n\t};\n}): React.ReactElement | null {\n\tconst [columnHeaderRef, { height }] = useElementSize();\n\n\tif (!column) {\n\t\treturn null;\n\t}\n\tconst colSpan = slice(columns, index + 1).reduce((acc, column) => {\n\t\treturn acc * (column.items?.length ?? 1);\n\t}, 1);\n\n\tconst hasSubColumns = !isEmpty(columns[index + 1]);\n\tconst nextColumn = columns[index + 1];\n\n\tconst multiplicationFactor = slice(columns, 0, index).reduce(\n\t\t(acc, column) => {\n\t\t\treturn acc * (column.items?.length ?? 1);\n\t\t},\n\t\t1,\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{engine?.showTitle && (\n\t\t\t\t<DataTableRow>\n\t\t\t\t\t<DataTableColumnHeader\n\t\t\t\t\t\talign=\"center\"\n\t\t\t\t\t\tcolSpan={engine.titleSpan.toString()}\n\t\t\t\t\t>\n\t\t\t\t\t\t{engine.title ?? \"\"}\n\t\t\t\t\t</DataTableColumnHeader>\n\t\t\t\t</DataTableRow>\n\t\t\t)}\n\t\t\t<DataTableRow>\n\t\t\t\t{index === 0 &&\n\t\t\t\t\trowHeaders?.map((header) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<DataTableColumnHeader\n\t\t\t\t\t\t\t\tfixed={fixColumnHeaders}\n\t\t\t\t\t\t\t\t/*\n // @ts-ignore */\n\t\t\t\t\t\t\t\ttop={\"0\"}\n\t\t\t\t\t\t\t\tclassName={classes[\"table-header\"]}\n\t\t\t\t\t\t\t\trowSpan={columns.length.toString()}\n\t\t\t\t\t\t\t\tkey={`${header.dimension}-header-column`}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{header.label ?? \"\"}\n\t\t\t\t\t\t\t</DataTableColumnHeader>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t{times(multiplicationFactor, (colNo) => {\n\t\t\t\t\treturn column.items?.map((item) => (\n\t\t\t\t\t\t<DataTableColumnHeader\n\t\t\t\t\t\t\tfixed={fixColumnHeaders}\n\t\t\t\t\t\t\t/*\n // @ts-ignore */\n\t\t\t\t\t\t\ttop={`${prevHeight.toString()}px`}\n\t\t\t\t\t\t\tref={index === 0 ? columnHeaderRef : undefined}\n\t\t\t\t\t\t\tclassName={classes[\"table-header\"]}\n\t\t\t\t\t\t\talign=\"center\"\n\t\t\t\t\t\t\tcolSpan={colSpan.toString()}\n\t\t\t\t\t\t\tkey={`${colNo}-${item.name}-column-header`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{item.name as unknown as string}\n\t\t\t\t\t\t</DataTableColumnHeader>\n\t\t\t\t\t));\n\t\t\t\t})}\n\t\t\t</DataTableRow>\n\t\t\t{hasSubColumns ? (\n\t\t\t\t<ColumnRenderer\n\t\t\t\t\tcolumn={nextColumn}\n\t\t\t\t\tindex={index + 1}\n\t\t\t\t\tconfig={{\n\t\t\t\t\t\tcolumns,\n\t\t\t\t\t\trowHeaders,\n\t\t\t\t\t\tprevHeight: height,\n\t\t\t\t\t\tfixColumnHeaders,\n\t\t\t\t\t\tengine,\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t</>\n\t);\n}\n\nexport function TableHeaders() {\n\tconst engine = useCustomPivotTableEngine();\n\tconst columns = engine?.columnHeaders;\n\tconst rowHeaders = engine?.rowHeaders;\n\tconst fixColumnHeaders = engine?.fixColumnHeaders;\n\n\tif (!columns || isEmpty(columns)) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<TableHead>\n\t\t\t<ColumnRenderer\n\t\t\t\tcolumn={columns[0]}\n\t\t\t\tindex={0}\n\t\t\t\tconfig={{ engine, rowHeaders, columns, fixColumnHeaders }}\n\t\t\t/>\n\t\t</TableHead>\n\t);\n}\n"]}
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ import "./styles/custom-highchart.css";
3
+ import { ChartAnalyticsProps } from "./types/props.js";
4
+ export * from "./services/export.js";
5
+ export * from "./types/props.js";
6
+ export * from "./components/DownloadMenu/index.js";
7
+ /**
8
+ * The `DHIS2Chart` component allows you to render a chart visualization from DHIS2 analytics data.
9
+ * It accepts the DHIS2 analytics payload as well as configuration on how to visualize the data.
10
+ *
11
+ * @component
12
+ *
13
+ * @param {ChartAnalyticsProps} props
14
+ * @param {Analytics} [props.analytics] - Analytics data from DHIS2
15
+ * @param {ChartConfig} [props.config] - Visualization configuration. See stories for more information
16
+ * @param {Record<string, any>} [props.containerProps] - Props that will be passed to the chart container
17
+ * @param {forwardRef} forwardRef - A function that creates a higher order component that forwards the ref through the component tree.
18
+ *
19
+ * @returns {React.ForwardRefExoticComponent<ChartAnalyticsProps>} - The DHIS2 chart component with forward ref support.
20
+ */
21
+ export declare const DHIS2Chart: React.ForwardRefExoticComponent<ChartAnalyticsProps>;
22
+ /**
23
+ * @deprecated since `v2`. Use `DHIS2Chart` instead
24
+ * */
25
+ export declare const ChartAnalytics: React.ForwardRefExoticComponent<ChartAnalyticsProps>;
26
+ //# sourceMappingURL=DHIS2Chart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DHIS2Chart.d.ts","sourceRoot":"","sources":["../../../../src/components/ChartAnalytics/DHIS2Chart.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,+BAA+B,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oCAAoC,CAAC;AAyBnD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,yBAAyB,CAAC,mBAAmB,CAG1E,CAAC;AAEH;;KAEK;AACL,eAAO,MAAM,cAAc,sDAAa,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { ChartExportMenuItem } from "../interfaces/menu.js";
2
+ export declare function ChartMenu({ menuRef, onClick, onClose, exclude, }: {
3
+ menuRef: HTMLDivElement;
4
+ onClick: (action: string) => void;
5
+ onClose: () => void;
6
+ exclude?: ChartExportMenuItem[];
7
+ }): import("react/jsx-runtime.js").JSX.Element;
8
+ //# sourceMappingURL=Menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/ChartAnalytics/components/DownloadMenu/components/Menu.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,wBAAgB,SAAS,CAAC,EACzB,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAY,GACZ,EAAE;IACF,OAAO,EAAE,cAAc,CAAC;IACxB,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAChC,8CA+CA"}
@@ -0,0 +1,8 @@
1
+ export declare const chartMenuSections: {
2
+ name: string;
3
+ menuItems: {
4
+ name: string;
5
+ label: any;
6
+ }[];
7
+ }[];
8
+ //# sourceMappingURL=menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/ChartAnalytics/components/DownloadMenu/constants/menu.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB;;;;;;GAmC7B,CAAC"}
@@ -0,0 +1,9 @@
1
+ import HighchartsReact from "highcharts-react-official";
2
+ import React from "react";
3
+ import { ChartExportMenuItem } from "./interfaces/menu.js";
4
+ export declare function ChartDownloadMenu({ chartRef, exclude, icon, }: {
5
+ chartRef: HighchartsReact.RefObject | null;
6
+ exclude?: ChartExportMenuItem[];
7
+ icon?: React.ReactNode;
8
+ }): import("react/jsx-runtime.js").JSX.Element;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ChartAnalytics/components/DownloadMenu/index.tsx"],"names":[],"mappings":"AACA,OAAO,eAAe,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAA2B,MAAM,OAAO,CAAC;AAShD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,wBAAgB,iBAAiB,CAAC,EACjC,QAAQ,EACR,OAAO,EACP,IAAI,GACJ,EAAE;IACF,QAAQ,EAAE,eAAe,CAAC,SAAS,GAAG,IAAI,CAAC;IAC3C,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAChC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACvB,8CAwDA"}
@@ -0,0 +1,2 @@
1
+ export type ChartExportMenuItem = "png" | "jpeg" | "svg" | "csv" | "pdf" | "table" | "full-screen";
2
+ //# sourceMappingURL=menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,aAAa,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { Analytics } from "@hisptz/dhis2-utils";
2
+ import HighCharts from "highcharts";
3
+ import { ChartConfig, ChartType } from "../types/props.js";
4
+ export declare function useChart({ id, analytics, config, }: {
5
+ id: string;
6
+ analytics: Analytics;
7
+ config: ChartConfig;
8
+ }): {
9
+ chart?: HighCharts.Options;
10
+ changeChartType: (type: ChartType) => void;
11
+ };
12
+ //# sourceMappingURL=useChart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useChart.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChartAnalytics/hooks/useChart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,UAAU,MAAM,YAAY,CAAC;AAGpC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG3D,wBAAgB,QAAQ,CAAC,EACxB,EAAE,EACF,SAAS,EACT,MAAM,GACN,EAAE;IACF,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,WAAW,CAAC;CACpB,GAAG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC;IAC3B,eAAe,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CAC3C,CAkCA"}
@@ -0,0 +1,2 @@
1
+ export * from "./DHIS2Chart.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ChartAnalytics/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { PlotOptions } from "highcharts";
2
+ import { DHIS2ColumnChart } from "./column.js";
3
+ export declare class DHIS2BarChart extends DHIS2ColumnChart {
4
+ getHighchartsType(): string;
5
+ }
6
+ export declare class DHIS2StackedBarChart extends DHIS2BarChart {
7
+ getPlotOptions(): PlotOptions;
8
+ }
9
+ //# sourceMappingURL=bar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bar.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChartAnalytics/models/bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,qBAAa,aAAc,SAAQ,gBAAgB;IAClD,iBAAiB,IAAI,MAAM;CAG3B;AAED,qBAAa,oBAAqB,SAAQ,aAAa;IACtD,cAAc,IAAI,WAAW;CAQ7B"}
@@ -0,0 +1,13 @@
1
+ import { PlotOptions, SeriesOptionsType, XAxisOptions } from "highcharts";
2
+ import { DHIS2Chart } from "./index.js";
3
+ export declare class DHIS2ColumnChart extends DHIS2Chart {
4
+ getCategories(): any[] | undefined;
5
+ getHighchartsType(): string;
6
+ getPlotOptions(): PlotOptions;
7
+ getSeries(): SeriesOptionsType[];
8
+ getXAxis(): XAxisOptions | undefined;
9
+ }
10
+ export declare class DHIS2StackedColumnChart extends DHIS2ColumnChart {
11
+ getPlotOptions(): PlotOptions;
12
+ }
13
+ //# sourceMappingURL=column.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"column.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChartAnalytics/models/column.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,qBAAa,gBAAiB,SAAQ,UAAU;IAC/C,aAAa,IAAI,GAAG,EAAE,GAAG,SAAS;IAIlC,iBAAiB,IAAI,MAAM;IAI3B,cAAc,IAAI,WAAW;IAU7B,SAAS,IAAI,iBAAiB,EAAE;IAIhC,QAAQ,IAAI,YAAY,GAAG,SAAS;CAWpC;AAED,qBAAa,uBAAwB,SAAQ,gBAAgB;IAC5D,cAAc,IAAI,WAAW;CAQ7B"}
@@ -0,0 +1,19 @@
1
+ import type { Analytics } from "@hisptz/dhis2-utils";
2
+ import HighCharts from "highcharts";
3
+ import { ChartConfig } from "../types/props.js";
4
+ export declare abstract class DHIS2Chart {
5
+ id: string;
6
+ analytics: Analytics;
7
+ config: ChartConfig;
8
+ constructor(id: string, analytics: Analytics, config: ChartConfig);
9
+ abstract getHighchartsType(): string;
10
+ getChartConfig(): HighCharts.ChartOptions & any;
11
+ getOptions(): HighCharts.Options;
12
+ abstract getSeries(): HighCharts.SeriesOptionsType[];
13
+ abstract getPlotOptions(): HighCharts.PlotOptions;
14
+ abstract getXAxis(): HighCharts.XAxisOptions | undefined;
15
+ getYAxis(): HighCharts.YAxisOptions[];
16
+ getExporting(): HighCharts.ExportingOptions;
17
+ private getFilterLabel;
18
+ }
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChartAnalytics/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,8BAAsB,UAAU;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,WAAW,CAAC;gBAER,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW;IAMjE,QAAQ,CAAC,iBAAiB,IAAI,MAAM;IAEpC,cAAc,IAAI,UAAU,CAAC,YAAY,GAAG,GAAG;IAU/C,UAAU,IAAI,UAAU,CAAC,OAAO;IAsDhC,QAAQ,CAAC,SAAS,IAAI,UAAU,CAAC,iBAAiB,EAAE;IAEpD,QAAQ,CAAC,cAAc,IAAI,UAAU,CAAC,WAAW;IAEjD,QAAQ,CAAC,QAAQ,IAAI,UAAU,CAAC,YAAY,GAAG,SAAS;IAExD,QAAQ,IAAI,UAAU,CAAC,YAAY,EAAE;IAuCrC,YAAY,IAAI,UAAU,CAAC,gBAAgB;IAa3C,OAAO,CAAC,cAAc;CAYtB"}
@@ -0,0 +1,9 @@
1
+ import { PlotOptions, SeriesOptionsType, XAxisOptions } from "highcharts";
2
+ import { DHIS2Chart } from "./index.js";
3
+ export declare class DHIS2LineChart extends DHIS2Chart {
4
+ getHighchartsType(): string;
5
+ getPlotOptions(): PlotOptions;
6
+ getSeries(): SeriesOptionsType[];
7
+ getXAxis(): XAxisOptions | undefined;
8
+ }
9
+ //# sourceMappingURL=line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChartAnalytics/models/line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,qBAAa,cAAe,SAAQ,UAAU;IAC7C,iBAAiB,IAAI,MAAM;IAI3B,cAAc,IAAI,WAAW;IAM7B,SAAS,IAAI,iBAAiB,EAAE;IAIhC,QAAQ,IAAI,YAAY,GAAG,SAAS;CAWpC"}
@@ -0,0 +1,10 @@
1
+ import { PlotOptions, SeriesOptionsType, XAxisOptions, YAxisOptions } from "highcharts";
2
+ import { DHIS2Chart } from "./index.js";
3
+ export declare class DHIS2MultiSeriesChart extends DHIS2Chart {
4
+ getHighchartsType(): string;
5
+ getPlotOptions(): PlotOptions;
6
+ getSeries(): SeriesOptionsType[];
7
+ getXAxis(): XAxisOptions | undefined;
8
+ getYAxis(): YAxisOptions[];
9
+ }
10
+ //# sourceMappingURL=multi-series.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-series.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChartAnalytics/models/multi-series.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,qBAAa,qBAAsB,SAAQ,UAAU;IACpD,iBAAiB,IAAI,MAAM;IAI3B,cAAc,IAAI,WAAW;IAO7B,SAAS,IAAI,iBAAiB,EAAE;IAwEhC,QAAQ,IAAI,YAAY,GAAG,SAAS;IAYpC,QAAQ,IAAI,YAAY,EAAE;CAiC1B"}
@@ -0,0 +1,9 @@
1
+ import { PlotOptions, SeriesOptionsType, XAxisOptions } from "highcharts";
2
+ import { DHIS2Chart } from "./index.js";
3
+ export declare class DHIS2PieChart extends DHIS2Chart {
4
+ getHighchartsType(): string;
5
+ getPlotOptions(): PlotOptions;
6
+ getSeries(): SeriesOptionsType[];
7
+ getXAxis(): XAxisOptions | undefined;
8
+ }
9
+ //# sourceMappingURL=pie.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pie.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChartAnalytics/models/pie.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1E,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,qBAAa,aAAc,SAAQ,UAAU;IAC5C,iBAAiB,IAAI,MAAM;IAI3B,cAAc,IAAI,WAAW;IAa7B,SAAS,IAAI,iBAAiB,EAAE;IAwChC,QAAQ,IAAI,YAAY,GAAG,SAAS;CAGpC"}
@@ -0,0 +1,9 @@
1
+ import Highcharts from "highcharts";
2
+ import HighchartsReact from "highcharts-react-official";
3
+ export declare function setupHighchartsModules(highcharts: typeof Highcharts): void;
4
+ export declare function onFullScreenView(chartRef: HighchartsReact.RefObject, options?: Highcharts.Options): void;
5
+ export declare function onPDFDownload(chartRef: HighchartsReact.RefObject, options?: Highcharts.Options): void;
6
+ export declare function onCSVDownload(chartRef: HighchartsReact.RefObject, options?: Highcharts.Options): void;
7
+ export declare const onImageDownload: (chartRef: HighchartsReact.RefObject, type: "png" | "svg+xml" | "jpeg", options?: Highcharts.Options) => void;
8
+ export declare const onViewAsTable: (chartRef: HighchartsReact.RefObject, show: boolean) => void;
9
+ //# sourceMappingURL=export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChartAnalytics/services/export.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAKxD,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,OAAO,UAAU,QAInE;AAED,wBAAgB,gBAAgB,CAC/B,QAAQ,EAAE,eAAe,CAAC,SAAS,EACnC,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,QAG5B;AAED,wBAAgB,aAAa,CAC5B,QAAQ,EAAE,eAAe,CAAC,SAAS,EACnC,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,QAG5B;AAED,wBAAgB,aAAa,CAC5B,QAAQ,EAAE,eAAe,CAAC,SAAS,EACnC,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,QAG5B;AAED,eAAO,MAAM,eAAe,aACjB,gBAAgB,SAAS,QAC7B,KAAK,GAAG,SAAS,GAAG,MAAM,YACtB,WAAW,OAAO,SAG5B,CAAC;AAEF,eAAO,MAAM,aAAa,aACf,gBAAgB,SAAS,QAC7B,OAAO,SAUb,CAAC"}
@@ -0,0 +1,47 @@
1
+ import type { Analytics } from "@hisptz/dhis2-utils";
2
+ import HighCharts, { DashStyleValue, YAxisOptions, YAxisPlotLinesLabelOptions } from "highcharts";
3
+ import HighchartsReact from "highcharts-react-official";
4
+ export type ChartType = "column" | "pie" | "stacked-column" | "line" | "multi-series" | "bar" | "stacked-bar";
5
+ export interface MultiSeriesConfig {
6
+ series?: Array<{
7
+ id: string;
8
+ as: "column" | "line";
9
+ cumulative?: boolean;
10
+ yAxis?: number;
11
+ }>;
12
+ yAxes?: Array<YAxisOptions>;
13
+ target?: TargetConfig;
14
+ }
15
+ export interface TargetConfig {
16
+ id: string;
17
+ value: number;
18
+ label?: YAxisPlotLinesLabelOptions;
19
+ styles: {
20
+ color?: string;
21
+ width?: number;
22
+ dashStyle?: DashStyleValue;
23
+ zIndex?: number;
24
+ };
25
+ }
26
+ export type ChartConfig = {
27
+ layout: {
28
+ series: Array<string>;
29
+ category: Array<string>;
30
+ filter: Array<string>;
31
+ };
32
+ type?: ChartType;
33
+ height?: number;
34
+ colors?: Array<string>;
35
+ showFilterAsTitle?: boolean;
36
+ name?: string;
37
+ allowChartTypeChange?: boolean;
38
+ highChartOverrides?: Partial<HighCharts.Options> | ((config: HighCharts.Options) => Partial<HighCharts.Options>);
39
+ multiSeries?: MultiSeriesConfig;
40
+ };
41
+ export type ChartAnalyticsProps = {
42
+ analytics: Analytics;
43
+ config: ChartConfig;
44
+ setRef?: (ref: HighchartsReact.RefObject) => void;
45
+ containerProps?: Record<string, any>;
46
+ };
47
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChartAnalytics/types/props.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD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AC,EAAE,MAAM,CAAC;IACd,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAChB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,GAC3B,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,KAAK,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;IACjE,WAAW,CAAC,EAAE,iBAAiB,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,CAAC,SAAS,KAAK,IAAI,CAAC;IAClD,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACrC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { Analytics, AnalyticsHeader } from "@hisptz/dhis2-utils";
2
+ import { DHIS2Chart } from "../models/index.js";
3
+ import { ChartConfig, ChartType } from "../types/props.js";
4
+ export declare function getDimensionHeaderIndex(headers: AnalyticsHeader[], name: string): number;
5
+ export declare function getPointSeries(analytics: Analytics, config: ChartConfig, highchartsType: string): any;
6
+ export declare function getColumnSeries(analytics: Analytics, header: AnalyticsHeader, config: ChartConfig, highchartsType: string): any;
7
+ export declare function getAllCategories(analytics: Analytics, config: ChartConfig): string[];
8
+ export declare function updateLayout(config: ChartConfig, { type }: {
9
+ type: ChartType;
10
+ }): {
11
+ series: string[];
12
+ category: string[];
13
+ filter: string[];
14
+ };
15
+ export declare function getChartInstance(id: string, analytics: Analytics, config: ChartConfig): DHIS2Chart;
16
+ //# sourceMappingURL=chart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../../../src/components/ChartAnalytics/utils/chart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,SAAS,EACT,eAAe,EAEf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKhD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG3D,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,eAAe,EAAE,EAC1B,IAAI,EAAE,MAAM,GACV,MAAM,CAER;AAED,wBAAgB,cAAc,CAC7B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,WAAW,EACnB,cAAc,EAAE,MAAM,OAetB;AAED,wBAAgB,eAAe,CAC9B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,WAAW,EACnB,cAAc,EAAE,MAAM,GACpB,GAAG,CAgDL;AAeD,wBAAgB,gBAAgB,CAC/B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,WAAW,GACjB,MAAM,EAAE,CAgBV;AAED,wBAAgB,YAAY,CAC3B,MAAM,EAAE,WAAW,EACnB,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE;;;;EA0B7B;AAED,wBAAgB,gBAAgB,CAC/B,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,WAAW,GACjB,UAAU,CAmBZ"}
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import { CircularDashboardProps } from "./types/props.js";
3
+ export * from "./types/props.js";
4
+ export declare function CircularProgressVisualizer({ numerator, size, denominator, value, textStyle, strokeStyle, }: CircularDashboardProps): React.ReactElement;
5
+ export declare const CircularProgressDashboard: typeof CircularProgressVisualizer;
6
+ //# sourceMappingURL=CircularProgressIndicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CircularProgressIndicator.d.ts","sourceRoot":"","sources":["../../../../src/components/CircularProgressDashboard/CircularProgressIndicator.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,cAAc,kBAAkB,CAAC;AAEjC,wBAAgB,0BAA0B,CAAC,EAC1C,SAAS,EACT,IAAI,EACJ,WAAW,EACX,KAAK,EACL,SAAS,EACT,WAAW,GACX,EAAE,sBAAsB,GAAG,KAAK,CAAC,YAAY,CA8C7C;AAED,eAAO,MAAM,yBAAyB,mCAA6B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./CircularProgressIndicator.js";
2
+ export * from "./types/props.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/CircularProgressDashboard/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,18 @@
1
+ export type CircularDashboardProps = {
2
+ strokeStyle?: {
3
+ width?: number | string;
4
+ color?: string;
5
+ [key: string]: any;
6
+ };
7
+ textStyle?: {
8
+ color?: string;
9
+ fontSize?: number | string;
10
+ fontWeight?: number | string;
11
+ [key: string]: any;
12
+ };
13
+ value?: number;
14
+ numerator?: number;
15
+ denominator?: number;
16
+ size: string | number;
17
+ };
18
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../../src/components/CircularProgressDashboard/types/props.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,CAAC,EAAE;QACZ,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,SAAS,CAAC,EAAE;QACV,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAC3B,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { Analytics, LegendSet } from "@hisptz/dhis2-utils";
2
+ import { type EngineConfig } from "./services/engine.js";
3
+ import { DataTableProps } from "@dhis2/ui";
4
+ export interface DHIS2PivotTableOptions {
5
+ legendSets?: LegendSet[];
6
+ hideEmptyColumns?: boolean;
7
+ hideEmptyRows?: boolean;
8
+ showRowTotals?: boolean;
9
+ showColumnTotals?: boolean;
10
+ showRowSubtotals?: boolean;
11
+ showColumnSubtotals?: boolean;
12
+ fixColumnHeaders?: boolean;
13
+ fixRowHeaders?: boolean;
14
+ showFilterAsTitle?: boolean;
15
+ }
16
+ export interface DHIS2PivotTableProps {
17
+ analytics: Analytics;
18
+ tableProps?: DataTableProps;
19
+ setRef?: (ref: HTMLTableElement) => void;
20
+ config: EngineConfig;
21
+ }
22
+ export declare function DHIS2PivotTable({ analytics, config, tableProps, setRef, }: DHIS2PivotTableProps): import("react/jsx-runtime.js").JSX.Element;
23
+ //# sourceMappingURL=DHIS2PivotTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DHIS2PivotTable.d.ts","sourceRoot":"","sources":["../../../../src/components/DHIS2PivotTable/DHIS2PivotTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAyB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAMhF,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,WAAW,sBAAsB;IACtC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACpC,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACzC,MAAM,EAAE,YAAY,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,EAC/B,SAAS,EACT,MAAM,EACN,UAAU,EACV,MAAM,GACN,EAAE,oBAAoB,8CActB"}
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { DataTableProps } from "@dhis2/ui";
3
+ export type PivotTableLayoutProps = DataTableProps;
4
+ export interface PivotTableProps {
5
+ children: React.ReactNode;
6
+ tableProps?: DataTableProps;
7
+ setRef?: (ref: HTMLTableElement) => void;
8
+ }
9
+ export declare function PivotTable({ tableProps, children, setRef }: PivotTableProps): import("react/jsx-runtime").JSX.Element;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/DHIS2PivotTable/components/Table/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAa,cAAc,EAAE,MAAM,WAAW,CAAC;AAEtD,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAEnD,MAAM,WAAW,eAAe;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACzC;AAED,wBAAgB,UAAU,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,eAAe,2CAU3E"}
@@ -0,0 +1,2 @@
1
+ export declare function CustomPivotTableBody(): import("react/jsx-runtime").JSX.Element | null;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/DHIS2PivotTable/components/TableBody/index.tsx"],"names":[],"mappings":"AAqHA,wBAAgB,oBAAoB,mDAmBnC"}
@@ -0,0 +1,2 @@
1
+ export declare function TableHeaders(): import("react/jsx-runtime.js").JSX.Element | null;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/DHIS2PivotTable/components/TableHeaders/index.tsx"],"names":[],"mappings":"AA0GA,wBAAgB,YAAY,sDAmB3B"}
@@ -0,0 +1,3 @@
1
+ export * from "./DHIS2PivotTable.js";
2
+ export * from "./interfaces/index.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/DHIS2PivotTable/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export type DHIS2Dimension = "ou" | "pe" | "dx" | "co" | string;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/DHIS2PivotTable/interfaces/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { Analytics, AnalyticsItem, LegendSet } from "@hisptz/dhis2-utils";
2
+ import { DHIS2Dimension } from "../interfaces/index.js";
3
+ export interface EngineConfig {
4
+ layout: {
5
+ columns: {
6
+ dimension: DHIS2Dimension;
7
+ label?: string;
8
+ }[];
9
+ rows: {
10
+ dimension: DHIS2Dimension;
11
+ label?: string;
12
+ }[];
13
+ filter?: {
14
+ dimension: DHIS2Dimension;
15
+ label?: string;
16
+ }[];
17
+ };
18
+ options?: {
19
+ legendSets?: LegendSet[];
20
+ hideEmptyColumns?: boolean;
21
+ hideEmptyRows?: boolean;
22
+ showRowTotals?: boolean;
23
+ showColumnTotals?: boolean;
24
+ showRowSubtotals?: boolean;
25
+ showColumnSubtotals?: boolean;
26
+ showFilterAsTitle?: boolean;
27
+ fixColumnHeaders?: boolean;
28
+ fixRowHeaders?: boolean;
29
+ [key: string]: any;
30
+ };
31
+ }
32
+ export interface Header {
33
+ dimension: DHIS2Dimension;
34
+ label?: string;
35
+ items?: AnalyticsItem[];
36
+ }
37
+ export declare class DHIS2PivotTableEngine {
38
+ analyticsData: Analytics;
39
+ valueIndex: number;
40
+ config: EngineConfig;
41
+ rowHeaders?: Header[];
42
+ columnHeaders?: Header[];
43
+ columnMap?: {
44
+ [key: string]: any;
45
+ }[];
46
+ constructor({ analytics, config, }: {
47
+ analytics: Analytics;
48
+ config: EngineConfig;
49
+ });
50
+ get title(): string;
51
+ get titleSpan(): number;
52
+ get showTitle(): boolean | undefined;
53
+ get fixColumnHeaders(): boolean;
54
+ get fixRowHeaders(): boolean;
55
+ getDimensionItems(dimension: DHIS2Dimension): string[];
56
+ getItem(id: string): AnalyticsItem | undefined;
57
+ getValue(mapper: {
58
+ [key: string]: any;
59
+ }): number | undefined;
60
+ getHeaders(): void;
61
+ getColumnMap(): void;
62
+ }
63
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","source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E,MAAM,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAEzB,SAAS,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,EAAE,CAAC;gBAEzB,EACX,SAAS,EACT,MAAM,GACN,EAAE;QACF,SAAS,EAAE,SAAS,CAAC;QACrB,MAAM,EAAE,YAAY,CAAC;KACrB;IAWD,IAAI,KAAK,WAeR;IAED,IAAI,SAAS,WASZ;IAED,IAAI,SAAS,wBAEZ;IAED,IAAI,gBAAgB,YAEnB;IAED,IAAI,aAAa,YAEhB;IAED,iBAAiB,CAAC,SAAS,EAAE,cAAc;IAI3C,OAAO,CAAC,EAAE,EAAE,MAAM;IAIlB,QAAQ,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE;IAUvC,UAAU;IAuBV,YAAY;CAyBZ"}
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from "react";
2
+ import { DHIS2PivotTableEngine } from "../services/engine.js";
3
+ export declare function useCustomPivotTableEngine(): DHIS2PivotTableEngine | null;
4
+ export declare function DHIS2PivotTableEngineProvider({ children, engine, }: {
5
+ children: ReactNode;
6
+ engine: DHIS2PivotTableEngine;
7
+ }): import("react/jsx-runtime.js").JSX.Element;
8
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../../../src/components/DHIS2PivotTable/state/engine.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAiB,SAAS,EAAc,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAK9D,wBAAgB,yBAAyB,iCAExC;AAED,wBAAgB,6BAA6B,CAAC,EAC7C,QAAQ,EACR,MAAM,GACN,EAAE;IACF,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,qBAAqB,CAAC;CAC9B,8CAMA"}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { MapProps } from "./interfaces";
3
+ import "leaflet/dist/leaflet.css";
4
+ export declare const DHIS2Map: React.FC<MapProps>;
5
+ /**
6
+ * @deprecated since `v2`. Use `DHIS2Map` instead
7
+ * */
8
+ export declare const Map: React.FC<MapProps>;
9
+ //# sourceMappingURL=DHIS2Map.d.ts.map