@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.
- package/dist/components/ChartAnalytics/ChartAnalytics.stories.js +20 -43
- package/dist/components/ChartAnalytics/DHIS2Chart.js +17 -43
- package/dist/components/ChartAnalytics/DHIS2Chart.js.map +1 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.js +14 -16
- package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.js.map +1 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/constants/menu.js +8 -14
- package/dist/components/ChartAnalytics/components/DownloadMenu/index.js +19 -21
- package/dist/components/ChartAnalytics/components/DownloadMenu/index.js.map +1 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.js +0 -1
- package/dist/components/ChartAnalytics/hooks/useChart.js +11 -13
- package/dist/components/ChartAnalytics/hooks/useChart.js.map +1 -1
- package/dist/components/ChartAnalytics/index.js +1 -12
- package/dist/components/ChartAnalytics/index.js.map +1 -1
- package/dist/components/ChartAnalytics/models/bar.js +3 -6
- package/dist/components/ChartAnalytics/models/bar.js.map +1 -1
- package/dist/components/ChartAnalytics/models/column.js +6 -9
- package/dist/components/ChartAnalytics/models/column.js.map +1 -1
- package/dist/components/ChartAnalytics/models/index.js +1 -6
- package/dist/components/ChartAnalytics/models/index.js.map +1 -1
- package/dist/components/ChartAnalytics/models/line.js +6 -8
- package/dist/components/ChartAnalytics/models/line.js.map +1 -1
- package/dist/components/ChartAnalytics/models/multi-series.js +26 -15
- package/dist/components/ChartAnalytics/models/multi-series.js.map +1 -1
- package/dist/components/ChartAnalytics/models/pie.js +8 -8
- package/dist/components/ChartAnalytics/models/pie.js.map +1 -1
- package/dist/components/ChartAnalytics/services/export.js +7 -20
- package/dist/components/ChartAnalytics/services/export.js.map +1 -1
- package/dist/components/ChartAnalytics/styles/custom-highchart.css +40 -0
- package/dist/components/ChartAnalytics/styles/custom-highchart.css.map +1 -0
- package/dist/components/ChartAnalytics/types/props.js +0 -1
- package/dist/components/ChartAnalytics/utils/chart.js +24 -31
- package/dist/components/ChartAnalytics/utils/chart.js.map +1 -1
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.js +14 -23
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.js.map +1 -1
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.stories.js +3 -10
- package/dist/components/CircularProgressDashboard/index.js +2 -19
- package/dist/components/CircularProgressDashboard/index.js.map +1 -1
- package/dist/components/CircularProgressDashboard/types/props.js +0 -1
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.js +13 -15
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.js.map +1 -1
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.stories.js +5 -14
- package/dist/components/DHIS2PivotTable/components/Table/index.js +4 -6
- package/dist/components/DHIS2PivotTable/components/TableBody/index.js +30 -36
- package/dist/components/DHIS2PivotTable/components/TableBody/index.js.map +1 -1
- package/dist/components/DHIS2PivotTable/components/TableHeaders/index.js +27 -33
- package/dist/components/DHIS2PivotTable/components/TableHeaders/index.js.map +1 -1
- package/dist/components/DHIS2PivotTable/index.js +2 -19
- package/dist/components/DHIS2PivotTable/index.js.map +1 -1
- package/dist/components/DHIS2PivotTable/interfaces/index.js +0 -1
- package/dist/components/DHIS2PivotTable/services/engine.js +10 -18
- package/dist/components/DHIS2PivotTable/services/engine.js.map +1 -1
- package/dist/components/DHIS2PivotTable/state/engine.js +6 -9
- package/dist/components/DHIS2PivotTable/state/engine.js.map +1 -1
- package/dist/components/Map/DHIS2Map.js +13 -20
- package/dist/components/Map/DHIS2Map.js.map +1 -1
- package/dist/components/Map/DHIS2Map.stories.js +3 -17
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js +15 -21
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +10 -15
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js +16 -18
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +7 -12
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js +24 -30
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js +42 -49
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.js +16 -22
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js +26 -32
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js +10 -16
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js +21 -27
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js +16 -19
- package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.js.map +1 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/index.js +2 -19
- package/dist/components/Map/components/EarthEngineLayerConfiguration/index.js.map +1 -1
- package/dist/components/Map/components/MapArea/index.js +60 -54
- package/dist/components/Map/components/MapArea/index.js.map +1 -1
- package/dist/components/Map/components/MapArea/interfaces/index.js +0 -1
- package/dist/components/Map/components/MapControls/components/CustomControl/index.js +3 -5
- package/dist/components/Map/components/MapControls/components/DownloadControl/index.js +8 -14
- package/dist/components/Map/components/MapControls/components/FullscreenControl/index.js +7 -9
- package/dist/components/Map/components/MapControls/index.js +22 -17
- package/dist/components/Map/components/MapControls/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js +3 -5
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.js +21 -31
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js +59 -34
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js +99 -89
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js +9 -14
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js +62 -69
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.js +0 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js +31466 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/api.js.map +1 -0
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js +43 -43
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js +34 -31
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.js +6 -8
- package/dist/components/Map/components/MapLayer/components/LegendArea/index.js +46 -57
- package/dist/components/Map/components/MapLayer/components/LegendArea/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js +38 -30
- package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.js +5 -7
- package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/PointLayer/index.js +21 -28
- package/dist/components/Map/components/MapLayer/components/PointLayer/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js +39 -13
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js +40 -32
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js +13 -20
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js +17 -23
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js +30 -25
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js +17 -20
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js +15 -21
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js +6 -8
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.js +16 -24
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css +56 -0
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/styles/legends.css.map +1 -0
- package/dist/components/Map/components/MapLayer/index.js +10 -18
- package/dist/components/Map/components/MapLayer/index.js.map +1 -1
- package/dist/components/Map/components/MapLayer/interfaces/index.js +7 -4
- package/dist/components/Map/components/MapLayer/interfaces/index.js.map +1 -1
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +59 -63
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js.map +1 -1
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.js +30 -36
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.js.map +1 -1
- package/dist/components/Map/components/MapProvider/hooks/index.js +6 -10
- package/dist/components/Map/components/MapProvider/hooks/index.js.map +1 -1
- package/dist/components/Map/components/MapProvider/index.js +25 -31
- package/dist/components/Map/components/MapProvider/index.js.map +1 -1
- package/dist/components/Map/components/MapUpdater/index.js +5 -7
- package/dist/components/Map/components/MapUpdater/index.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js +15 -21
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +5 -10
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js +53 -60
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +7 -12
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js +21 -15
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.js +1 -4
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js +22 -30
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js +18 -21
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js +23 -30
- package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.js +16 -22
- package/dist/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.js +16 -22
- package/dist/components/Map/components/ThematicLayerConfiguration/components/RadiusField.js +16 -22
- package/dist/components/Map/components/ThematicLayerConfiguration/components/TypeField.js +18 -24
- package/dist/components/Map/components/ThematicLayerConfiguration/index.js +3 -26
- package/dist/components/Map/components/ThematicLayerConfiguration/index.js.map +1 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/types/index.js +0 -1
- package/dist/components/Map/constants/colors.js +1 -4
- package/dist/components/Map/constants/legendSet.js +1 -3
- package/dist/components/Map/hooks/map.js +17 -21
- package/dist/components/Map/hooks/map.js.map +1 -1
- package/dist/components/Map/index.js +5 -40
- package/dist/components/Map/index.js.map +1 -1
- package/dist/components/Map/interfaces/index.js +0 -1
- package/dist/components/Map/state/index.js +5 -9
- package/dist/components/Map/state/index.js.map +1 -1
- package/dist/components/Map/utils/colors.js +18 -22
- package/dist/components/Map/utils/colors.js.map +1 -1
- package/dist/components/Map/utils/helpers.js +3 -11
- package/dist/components/Map/utils/map.js +25 -24
- package/dist/components/Map/utils/map.js.map +1 -1
- package/dist/components/SingleValueContainer/SingleValueContainer.stories.js +3 -11
- package/dist/components/SingleValueContainer/SingleValueVisualizer.js +17 -35
- package/dist/components/SingleValueContainer/SingleValueVisualizer.js.map +1 -1
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js +14 -21
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.js.map +1 -1
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.js +7 -13
- package/dist/components/SingleValueContainer/index.js +3 -19
- package/dist/components/SingleValueContainer/index.js.map +1 -1
- package/dist/components/SingleValueContainer/types/props.js +0 -1
- package/dist/components/Visualization/components/AnalyticsDataProvider/index.js +50 -26
- package/dist/components/Visualization/components/AnalyticsDataProvider/index.js.map +1 -1
- package/dist/components/Visualization/components/DimensionsProvider/index.js +13 -18
- package/dist/components/Visualization/components/LayoutProvider/index.js +11 -14
- package/dist/components/Visualization/components/LayoutProvider/index.js.map +1 -1
- package/dist/components/Visualization/components/VisualizationDimensionSelector/index.js +30 -36
- package/dist/components/Visualization/components/VisualizationDimensionSelector/index.js.map +1 -1
- package/dist/components/Visualization/components/VisualizationProvider/index.js +14 -10
- package/dist/components/Visualization/components/VisualizationProvider/index.js.map +1 -1
- package/dist/components/Visualization/components/VisualizationSelector/index.js +46 -57
- package/dist/components/Visualization/components/VisualizationSelector/index.js.map +1 -1
- package/dist/components/Visualization/components/VisualizationTypeProvider/index.js +16 -19
- package/dist/components/Visualization/components/VisualizationTypeProvider/index.js.map +1 -1
- package/dist/components/Visualization/components/VisualizationTypeSelector/index.js +37 -27
- package/dist/components/Visualization/components/VisualizationTypeSelector/index.js.map +1 -1
- package/dist/components/Visualization/index.js +27 -33
- package/dist/components/Visualization/index.js.map +1 -1
- package/dist/index.js +6 -47
- package/dist/index.js.map +1 -1
- package/dist/types/components/ChartAnalytics/DHIS2Chart.d.ts +4 -4
- package/dist/types/components/ChartAnalytics/DHIS2Chart.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/components/DownloadMenu/components/Menu.d.ts +2 -2
- package/dist/types/components/ChartAnalytics/components/DownloadMenu/components/Menu.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/components/DownloadMenu/index.d.ts +2 -2
- package/dist/types/components/ChartAnalytics/components/DownloadMenu/index.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/hooks/useChart.d.ts +1 -1
- package/dist/types/components/ChartAnalytics/hooks/useChart.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/index.d.ts +1 -1
- package/dist/types/components/ChartAnalytics/index.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/models/bar.d.ts +1 -1
- package/dist/types/components/ChartAnalytics/models/bar.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/models/column.d.ts +1 -1
- package/dist/types/components/ChartAnalytics/models/column.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/models/index.d.ts +1 -1
- package/dist/types/components/ChartAnalytics/models/index.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/models/line.d.ts +1 -1
- package/dist/types/components/ChartAnalytics/models/line.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/models/multi-series.d.ts +1 -1
- package/dist/types/components/ChartAnalytics/models/multi-series.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/models/pie.d.ts +1 -1
- package/dist/types/components/ChartAnalytics/models/pie.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/services/export.d.ts.map +1 -1
- package/dist/types/components/ChartAnalytics/utils/chart.d.ts +2 -2
- package/dist/types/components/ChartAnalytics/utils/chart.d.ts.map +1 -1
- package/dist/types/components/CircularProgressDashboard/CircularProgressIndicator.d.ts +2 -2
- package/dist/types/components/CircularProgressDashboard/CircularProgressIndicator.d.ts.map +1 -1
- package/dist/types/components/CircularProgressDashboard/index.d.ts +2 -2
- package/dist/types/components/CircularProgressDashboard/index.d.ts.map +1 -1
- package/dist/types/components/DHIS2PivotTable/DHIS2PivotTable.d.ts +2 -2
- package/dist/types/components/DHIS2PivotTable/DHIS2PivotTable.d.ts.map +1 -1
- package/dist/types/components/DHIS2PivotTable/components/TableHeaders/index.d.ts +1 -1
- package/dist/types/components/DHIS2PivotTable/components/TableHeaders/index.d.ts.map +1 -1
- package/dist/types/components/DHIS2PivotTable/index.d.ts +2 -2
- package/dist/types/components/DHIS2PivotTable/index.d.ts.map +1 -1
- package/dist/types/components/DHIS2PivotTable/services/engine.d.ts +1 -1
- package/dist/types/components/DHIS2PivotTable/services/engine.d.ts.map +1 -1
- package/dist/types/components/DHIS2PivotTable/state/engine.d.ts +2 -2
- package/dist/types/components/DHIS2PivotTable/state/engine.d.ts.map +1 -1
- package/dist/types/components/Map/DHIS2Map.d.ts +1 -1
- package/dist/types/components/Map/DHIS2Map.d.ts.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.d.ts +2 -2
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.d.ts.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.d.ts +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.d.ts.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.d.ts +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.d.ts.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/Name.d.ts +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/Name.d.ts.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.d.ts +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.d.ts.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.d.ts +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.d.ts.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.d.ts +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.d.ts.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/hooks/data.d.ts +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/hooks/data.d.ts.map +1 -1
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/index.d.ts +2 -2
- package/dist/types/components/Map/components/EarthEngineLayerConfiguration/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapArea/index.d.ts +1 -1
- package/dist/types/components/Map/components/MapArea/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapControls/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapControls/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/components/BoundaryLayer/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/LegendArea/index.d.ts +3 -3
- package/dist/types/components/Map/components/MapLayer/components/LegendArea/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/PointLayer/hooks/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/PointLayer/index.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/PointLayer/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts +4 -4
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/index.d.ts +1 -1
- package/dist/types/components/Map/components/MapLayer/components/ThematicLayer/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapLayer/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapLayer/interfaces/index.d.ts +4 -4
- package/dist/types/components/Map/components/MapLayer/interfaces/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapProvider/components/MapLayerProvider/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapProvider/components/MapLayerProvider/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapProvider/hooks/index.d.ts +3 -3
- package/dist/types/components/Map/components/MapProvider/index.d.ts +2 -2
- package/dist/types/components/Map/components/MapProvider/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/MapUpdater/index.d.ts +1 -1
- package/dist/types/components/Map/components/MapUpdater/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.d.ts +2 -2
- package/dist/types/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.d.ts.map +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.d.ts +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.d.ts +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.d.ts.map +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.d.ts.map +1 -1
- package/dist/types/components/Map/components/ThematicLayerConfiguration/index.d.ts +3 -3
- package/dist/types/components/Map/components/ThematicLayerConfiguration/index.d.ts.map +1 -1
- package/dist/types/components/Map/hooks/map.d.ts.map +1 -1
- package/dist/types/components/Map/index.d.ts +5 -5
- package/dist/types/components/Map/index.d.ts.map +1 -1
- package/dist/types/components/Map/interfaces/index.d.ts +2 -2
- package/dist/types/components/Map/interfaces/index.d.ts.map +1 -1
- package/dist/types/components/Map/state/index.d.ts +2 -2
- package/dist/types/components/Map/state/index.d.ts.map +1 -1
- package/dist/types/components/Map/utils/colors.d.ts +1 -1
- package/dist/types/components/Map/utils/colors.d.ts.map +1 -1
- package/dist/types/components/Map/utils/map.d.ts.map +1 -1
- package/dist/types/components/SingleValueContainer/SingleValueVisualizer.d.ts +3 -3
- package/dist/types/components/SingleValueContainer/SingleValueVisualizer.d.ts.map +1 -1
- package/dist/types/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.d.ts +1 -1
- package/dist/types/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.d.ts.map +1 -1
- package/dist/types/components/SingleValueContainer/index.d.ts +3 -2
- package/dist/types/components/SingleValueContainer/index.d.ts.map +1 -1
- package/dist/types/components/Visualization/components/AnalyticsDataProvider/index.d.ts +1 -1
- package/dist/types/components/Visualization/components/AnalyticsDataProvider/index.d.ts.map +1 -1
- package/dist/types/components/Visualization/components/LayoutProvider/index.d.ts +2 -2
- package/dist/types/components/Visualization/components/LayoutProvider/index.d.ts.map +1 -1
- package/dist/types/components/Visualization/components/VisualizationDimensionSelector/index.d.ts +1 -1
- package/dist/types/components/Visualization/components/VisualizationDimensionSelector/index.d.ts.map +1 -1
- package/dist/types/components/Visualization/components/VisualizationProvider/index.d.ts +4 -4
- package/dist/types/components/Visualization/components/VisualizationProvider/index.d.ts.map +1 -1
- package/dist/types/components/Visualization/components/VisualizationSelector/index.d.ts +10 -10
- package/dist/types/components/Visualization/components/VisualizationSelector/index.d.ts.map +1 -1
- package/dist/types/components/Visualization/components/VisualizationTypeProvider/index.d.ts +2 -2
- package/dist/types/components/Visualization/components/VisualizationTypeProvider/index.d.ts.map +1 -1
- package/dist/types/components/Visualization/components/VisualizationTypeSelector/index.d.ts +1 -1
- package/dist/types/components/Visualization/components/VisualizationTypeSelector/index.d.ts.map +1 -1
- package/dist/types/components/Visualization/index.d.ts +6 -6
- package/dist/types/components/Visualization/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +6 -6
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +5 -4
- package/dist/components/ChartAnalytics/ChartAnalytics.stories.mjs +0 -254
- package/dist/components/ChartAnalytics/ChartAnalytics.stories.mjs.map +0 -1
- package/dist/components/ChartAnalytics/DHIS2Chart.mjs +0 -36
- package/dist/components/ChartAnalytics/DHIS2Chart.mjs.map +0 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.mjs +0 -52
- package/dist/components/ChartAnalytics/components/DownloadMenu/components/Menu.mjs.map +0 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/constants/menu.mjs +0 -42
- package/dist/components/ChartAnalytics/components/DownloadMenu/constants/menu.mjs.map +0 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/index.mjs +0 -65
- package/dist/components/ChartAnalytics/components/DownloadMenu/index.mjs.map +0 -1
- package/dist/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.mjs +0 -3
- package/dist/components/ChartAnalytics/components/DownloadMenu/interfaces/menu.mjs.map +0 -1
- package/dist/components/ChartAnalytics/hooks/useChart.mjs +0 -43
- package/dist/components/ChartAnalytics/hooks/useChart.mjs.map +0 -1
- package/dist/components/ChartAnalytics/index.mjs +0 -3
- package/dist/components/ChartAnalytics/index.mjs.map +0 -1
- package/dist/components/ChartAnalytics/models/bar.mjs +0 -21
- package/dist/components/ChartAnalytics/models/bar.mjs.map +0 -1
- package/dist/components/ChartAnalytics/models/column.mjs +0 -48
- package/dist/components/ChartAnalytics/models/column.mjs.map +0 -1
- package/dist/components/ChartAnalytics/models/index.mjs +0 -117
- package/dist/components/ChartAnalytics/models/index.mjs.map +0 -1
- package/dist/components/ChartAnalytics/models/line.mjs +0 -31
- package/dist/components/ChartAnalytics/models/line.mjs.map +0 -1
- package/dist/components/ChartAnalytics/models/multi-series.mjs +0 -99
- package/dist/components/ChartAnalytics/models/multi-series.mjs.map +0 -1
- package/dist/components/ChartAnalytics/models/pie.mjs +0 -51
- package/dist/components/ChartAnalytics/models/pie.mjs.map +0 -1
- package/dist/components/ChartAnalytics/services/export.mjs +0 -35
- package/dist/components/ChartAnalytics/services/export.mjs.map +0 -1
- package/dist/components/ChartAnalytics/types/props.mjs +0 -3
- package/dist/components/ChartAnalytics/types/props.mjs.map +0 -1
- package/dist/components/ChartAnalytics/utils/chart.mjs +0 -130
- package/dist/components/ChartAnalytics/utils/chart.mjs.map +0 -1
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.mjs +0 -66
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.mjs.map +0 -1
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.stories.mjs +0 -42
- package/dist/components/CircularProgressDashboard/CircularProgressIndicator.stories.mjs.map +0 -1
- package/dist/components/CircularProgressDashboard/index.mjs +0 -4
- package/dist/components/CircularProgressDashboard/index.mjs.map +0 -1
- package/dist/components/CircularProgressDashboard/types/props.mjs +0 -3
- package/dist/components/CircularProgressDashboard/types/props.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.mjs +0 -26
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.stories.mjs +0 -30
- package/dist/components/DHIS2PivotTable/DHIS2PivotTable.stories.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/components/Table/index.mjs +0 -10
- package/dist/components/DHIS2PivotTable/components/Table/index.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/components/TableBody/index.mjs +0 -106
- package/dist/components/DHIS2PivotTable/components/TableBody/index.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/components/TableHeaders/index.mjs +0 -94
- package/dist/components/DHIS2PivotTable/components/TableHeaders/index.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/index.mjs +0 -4
- package/dist/components/DHIS2PivotTable/index.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/interfaces/index.mjs +0 -3
- package/dist/components/DHIS2PivotTable/interfaces/index.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/services/engine.mjs +0 -93
- package/dist/components/DHIS2PivotTable/services/engine.mjs.map +0 -1
- package/dist/components/DHIS2PivotTable/state/engine.mjs +0 -17
- package/dist/components/DHIS2PivotTable/state/engine.mjs.map +0 -1
- package/dist/components/Map/DHIS2Map.mjs +0 -65
- package/dist/components/Map/DHIS2Map.mjs.map +0 -1
- package/dist/components/Map/DHIS2Map.stories.mjs +0 -366
- package/dist/components/Map/DHIS2Map.stories.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.mjs +0 -41
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.mjs +0 -34
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.mjs +0 -26
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.mjs +0 -21
- package/dist/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.mjs +0 -67
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/AggregationSelector.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.mjs +0 -134
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.mjs +0 -44
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/Name.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.mjs +0 -67
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.mjs +0 -24
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.mjs +0 -67
- package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.mjs +0 -45
- package/dist/components/Map/components/EarthEngineLayerConfiguration/hooks/data.mjs.map +0 -1
- package/dist/components/Map/components/EarthEngineLayerConfiguration/index.mjs +0 -4
- package/dist/components/Map/components/EarthEngineLayerConfiguration/index.mjs.map +0 -1
- package/dist/components/Map/components/MapArea/index.mjs +0 -85
- package/dist/components/Map/components/MapArea/index.mjs.map +0 -1
- package/dist/components/Map/components/MapArea/interfaces/index.mjs +0 -3
- package/dist/components/Map/components/MapArea/interfaces/index.mjs.map +0 -1
- package/dist/components/Map/components/MapControls/components/CustomControl/index.mjs +0 -16
- package/dist/components/Map/components/MapControls/components/CustomControl/index.mjs.map +0 -1
- package/dist/components/Map/components/MapControls/components/DownloadControl/index.mjs +0 -15
- package/dist/components/Map/components/MapControls/components/DownloadControl/index.mjs.map +0 -1
- package/dist/components/Map/components/MapControls/components/FullscreenControl/index.mjs +0 -13
- package/dist/components/Map/components/MapControls/components/FullscreenControl/index.mjs.map +0 -1
- package/dist/components/Map/components/MapControls/index.mjs +0 -23
- package/dist/components/Map/components/MapControls/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.mjs +0 -10
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/hooks/useBoundaryData.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.mjs +0 -52
- package/dist/components/Map/components/MapLayer/components/BoundaryLayer/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.mjs +0 -65
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/components/EarthEngineLegend.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.mjs +0 -439
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/constants/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.mjs +0 -32
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/hooks/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.mjs +0 -197
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.mjs +0 -3
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/interfaces/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.mjs +0 -359
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/services/engine.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.mjs +0 -82
- package/dist/components/Map/components/MapLayer/components/GoogleEngineLayer/utils/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.mjs +0 -17
- package/dist/components/Map/components/MapLayer/components/LegendArea/components/LegendCardHeader/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/LegendArea/index.mjs +0 -179
- package/dist/components/Map/components/MapLayer/components/LegendArea/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.mjs +0 -78
- package/dist/components/Map/components/MapLayer/components/PointLayer/components/PointLegend/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.mjs +0 -11
- package/dist/components/Map/components/MapLayer/components/PointLayer/hooks/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/PointLayer/index.mjs +0 -48
- package/dist/components/Map/components/MapLayer/components/PointLayer/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.mjs +0 -36
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubble.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.mjs +0 -111
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/components/Bubbles.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.mjs +0 -41
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/components/BubbleLegend/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.mjs +0 -50
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Bubble/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.mjs +0 -42
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/components/ChoroplethLegend.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.mjs +0 -37
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/Choropleth/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.mjs +0 -40
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/components/CustomTooltip/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.mjs +0 -12
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/hooks/config.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.mjs +0 -55
- package/dist/components/Map/components/MapLayer/components/ThematicLayer/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/index.mjs +0 -32
- package/dist/components/Map/components/MapLayer/index.mjs.map +0 -1
- package/dist/components/Map/components/MapLayer/interfaces/index.mjs +0 -5
- package/dist/components/Map/components/MapLayer/interfaces/index.mjs.map +0 -1
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.mjs +0 -405
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.mjs.map +0 -1
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.mjs +0 -115
- package/dist/components/Map/components/MapProvider/components/MapLayerProvider/index.mjs.map +0 -1
- package/dist/components/Map/components/MapProvider/hooks/index.mjs +0 -16
- package/dist/components/Map/components/MapProvider/hooks/index.mjs.map +0 -1
- package/dist/components/Map/components/MapProvider/index.mjs +0 -95
- package/dist/components/Map/components/MapProvider/index.mjs.map +0 -1
- package/dist/components/Map/components/MapUpdater/index.mjs +0 -11
- package/dist/components/Map/components/MapUpdater/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.mjs +0 -41
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.mjs +0 -24
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.mjs +0 -174
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.mjs +0 -21
- package/dist/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.mjs +0 -24
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/components/ColorScale/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.mjs +0 -436
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/constants/colors.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.mjs +0 -71
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.mjs +0 -74
- package/dist/components/Map/components/ThematicLayerConfiguration/components/ColorScaleSelect/utils/colors.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.mjs +0 -57
- package/dist/components/Map/components/ThematicLayerConfiguration/components/CustomLegend/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.mjs +0 -44
- package/dist/components/Map/components/ThematicLayerConfiguration/components/IndicatorSelectorModal/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.mjs +0 -60
- package/dist/components/Map/components/ThematicLayerConfiguration/components/LegendSetSelector/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/RadiusField.mjs +0 -54
- package/dist/components/Map/components/ThematicLayerConfiguration/components/RadiusField.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/components/TypeField.mjs +0 -63
- package/dist/components/Map/components/ThematicLayerConfiguration/components/TypeField.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/index.mjs +0 -5
- package/dist/components/Map/components/ThematicLayerConfiguration/index.mjs.map +0 -1
- package/dist/components/Map/components/ThematicLayerConfiguration/types/index.mjs +0 -3
- package/dist/components/Map/components/ThematicLayerConfiguration/types/index.mjs.map +0 -1
- package/dist/components/Map/constants/colors.mjs +0 -436
- package/dist/components/Map/constants/colors.mjs.map +0 -1
- package/dist/components/Map/constants/legendSet.mjs +0 -23
- package/dist/components/Map/constants/legendSet.mjs.map +0 -1
- package/dist/components/Map/hooks/map.mjs +0 -44
- package/dist/components/Map/hooks/map.mjs.map +0 -1
- package/dist/components/Map/index.mjs +0 -7
- package/dist/components/Map/index.mjs.map +0 -1
- package/dist/components/Map/interfaces/index.mjs +0 -3
- package/dist/components/Map/interfaces/index.mjs.map +0 -1
- package/dist/components/Map/state/index.mjs +0 -18
- package/dist/components/Map/state/index.mjs.map +0 -1
- package/dist/components/Map/utils/colors.mjs +0 -77
- package/dist/components/Map/utils/colors.mjs.map +0 -1
- package/dist/components/Map/utils/helpers.mjs +0 -18
- package/dist/components/Map/utils/helpers.mjs.map +0 -1
- package/dist/components/Map/utils/map.mjs +0 -127
- package/dist/components/Map/utils/map.mjs.map +0 -1
- package/dist/components/SingleValueContainer/SingleValueContainer.stories.mjs +0 -145
- package/dist/components/SingleValueContainer/SingleValueContainer.stories.mjs.map +0 -1
- package/dist/components/SingleValueContainer/SingleValueVisualizer.mjs +0 -44
- package/dist/components/SingleValueContainer/SingleValueVisualizer.mjs.map +0 -1
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.mjs +0 -49
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValueItem.mjs.map +0 -1
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.mjs +0 -22
- package/dist/components/SingleValueContainer/components/SingleValueItem/SingleValuePercentage.mjs.map +0 -1
- package/dist/components/SingleValueContainer/index.mjs +0 -4
- package/dist/components/SingleValueContainer/index.mjs.map +0 -1
- package/dist/components/SingleValueContainer/types/props.mjs +0 -3
- package/dist/components/SingleValueContainer/types/props.mjs.map +0 -1
- package/dist/components/Visualization/components/AnalyticsDataProvider/index.mjs +0 -67
- package/dist/components/Visualization/components/AnalyticsDataProvider/index.mjs.map +0 -1
- package/dist/components/Visualization/components/DimensionsProvider/index.mjs +0 -35
- package/dist/components/Visualization/components/DimensionsProvider/index.mjs.map +0 -1
- package/dist/components/Visualization/components/LayoutProvider/index.mjs +0 -17
- package/dist/components/Visualization/components/LayoutProvider/index.mjs.map +0 -1
- package/dist/components/Visualization/components/VisualizationDimensionSelector/index.mjs +0 -85
- package/dist/components/Visualization/components/VisualizationDimensionSelector/index.mjs.map +0 -1
- package/dist/components/Visualization/components/VisualizationProvider/index.mjs +0 -13
- package/dist/components/Visualization/components/VisualizationProvider/index.mjs.map +0 -1
- package/dist/components/Visualization/components/VisualizationSelector/index.mjs +0 -167
- package/dist/components/Visualization/components/VisualizationSelector/index.mjs.map +0 -1
- package/dist/components/Visualization/components/VisualizationTypeProvider/index.mjs +0 -23
- package/dist/components/Visualization/components/VisualizationTypeProvider/index.mjs.map +0 -1
- package/dist/components/Visualization/components/VisualizationTypeSelector/index.mjs +0 -39
- package/dist/components/Visualization/components/VisualizationTypeSelector/index.mjs.map +0 -1
- package/dist/components/Visualization/index.mjs +0 -113
- package/dist/components/Visualization/index.mjs.map +0 -1
- package/dist/index.mjs +0 -8
- package/dist/index.mjs.map +0 -1
package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js
CHANGED
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var colors = require('../../../utils/colors');
|
|
8
|
-
var ColorScaleSelect = require('../../ThematicLayerConfiguration/components/ColorScaleSelect');
|
|
9
|
-
|
|
10
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
|
|
12
|
-
var i18n__default = /*#__PURE__*/_interopDefault(i18n);
|
|
13
|
-
var ColorScaleSelect__default = /*#__PURE__*/_interopDefault(ColorScaleSelect);
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Controller } from 'react-hook-form';
|
|
3
|
+
import { InputField, SingleSelectField, SingleSelectOption, Field } from '@dhis2/ui';
|
|
4
|
+
import i18n from '@dhis2/d2-i18n';
|
|
5
|
+
import { getColorClasses, getColorScale, defaultClasses, defaultColorScaleName, getColorPalette } from '../../../utils/colors.js';
|
|
6
|
+
import ColorScaleSelect from '../../ThematicLayerConfiguration/components/ColorScaleSelect/index.js';
|
|
14
7
|
|
|
15
8
|
function ColorConfig() {
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", { className: "column gap-16", children: [
|
|
10
|
+
/* @__PURE__ */ jsxs("div", { className: "row gap-8", children: [
|
|
11
|
+
/* @__PURE__ */ jsx(
|
|
12
|
+
Controller,
|
|
20
13
|
{
|
|
21
|
-
render: ({ field, fieldState }) => /* @__PURE__ */
|
|
22
|
-
|
|
14
|
+
render: ({ field, fieldState }) => /* @__PURE__ */ jsx(
|
|
15
|
+
InputField,
|
|
23
16
|
{
|
|
24
17
|
...field,
|
|
25
18
|
error: Boolean(fieldState.error),
|
|
@@ -30,18 +23,18 @@ function ColorConfig() {
|
|
|
30
23
|
return;
|
|
31
24
|
field.onChange(parseInt(value));
|
|
32
25
|
},
|
|
33
|
-
label:
|
|
26
|
+
label: i18n.t("Min"),
|
|
34
27
|
type: "number"
|
|
35
28
|
}
|
|
36
29
|
),
|
|
37
30
|
name: "params.min"
|
|
38
31
|
}
|
|
39
32
|
),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
|
|
33
|
+
/* @__PURE__ */ jsx(
|
|
34
|
+
Controller,
|
|
42
35
|
{
|
|
43
|
-
render: ({ field, fieldState }) => /* @__PURE__ */
|
|
44
|
-
|
|
36
|
+
render: ({ field, fieldState }) => /* @__PURE__ */ jsx(
|
|
37
|
+
InputField,
|
|
45
38
|
{
|
|
46
39
|
...field,
|
|
47
40
|
error: Boolean(fieldState.error),
|
|
@@ -52,40 +45,40 @@ function ColorConfig() {
|
|
|
52
45
|
return;
|
|
53
46
|
field.onChange(parseInt(value));
|
|
54
47
|
},
|
|
55
|
-
label:
|
|
48
|
+
label: i18n.t("Max"),
|
|
56
49
|
type: "number"
|
|
57
50
|
}
|
|
58
51
|
),
|
|
59
52
|
name: "params.max"
|
|
60
53
|
}
|
|
61
54
|
),
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
55
|
+
/* @__PURE__ */ jsx(
|
|
56
|
+
Controller,
|
|
64
57
|
{
|
|
65
58
|
name: "params.palette",
|
|
66
59
|
render: ({ field, fieldState }) => {
|
|
67
60
|
const palette = field.value;
|
|
68
|
-
const scale =
|
|
69
|
-
const colorClass =
|
|
61
|
+
const scale = getColorClasses(palette);
|
|
62
|
+
const colorClass = getColorScale(palette ?? "");
|
|
70
63
|
const onChange = ({
|
|
71
64
|
selected
|
|
72
65
|
}) => {
|
|
73
|
-
const palette2 =
|
|
66
|
+
const palette2 = getColorPalette(
|
|
74
67
|
colorClass,
|
|
75
68
|
parseInt(selected)
|
|
76
69
|
)?.join(",");
|
|
77
70
|
field.onChange(palette2);
|
|
78
71
|
};
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
|
|
72
|
+
return /* @__PURE__ */ jsx(
|
|
73
|
+
SingleSelectField,
|
|
81
74
|
{
|
|
82
75
|
validationText: fieldState.error?.message,
|
|
83
76
|
error: Boolean(fieldState.error),
|
|
84
|
-
selected: scale?.toString() ??
|
|
85
|
-
label:
|
|
77
|
+
selected: scale?.toString() ?? defaultClasses.toString(),
|
|
78
|
+
label: i18n.t("Steps"),
|
|
86
79
|
onChange,
|
|
87
|
-
children: [3, 4, 5, 6, 7, 8, 9].map((value) => /* @__PURE__ */
|
|
88
|
-
|
|
80
|
+
children: [3, 4, 5, 6, 7, 8, 9].map((value) => /* @__PURE__ */ jsx(
|
|
81
|
+
SingleSelectOption,
|
|
89
82
|
{
|
|
90
83
|
label: `${value}`,
|
|
91
84
|
value: value?.toString()
|
|
@@ -98,32 +91,32 @@ function ColorConfig() {
|
|
|
98
91
|
}
|
|
99
92
|
)
|
|
100
93
|
] }),
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
|
|
94
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
95
|
+
Controller,
|
|
103
96
|
{
|
|
104
97
|
name: "params.palette",
|
|
105
98
|
render: ({ field, fieldState }) => {
|
|
106
99
|
const palette = field.value;
|
|
107
|
-
const scale =
|
|
108
|
-
const colorClass =
|
|
100
|
+
const scale = getColorClasses(palette);
|
|
101
|
+
const colorClass = getColorScale(palette ?? "");
|
|
109
102
|
const onChange = (colorClass2) => {
|
|
110
|
-
const palette2 =
|
|
103
|
+
const palette2 = getColorPalette(
|
|
111
104
|
colorClass2,
|
|
112
105
|
scale
|
|
113
106
|
)?.join(",");
|
|
114
107
|
field.onChange(palette2);
|
|
115
108
|
};
|
|
116
|
-
return /* @__PURE__ */
|
|
117
|
-
|
|
109
|
+
return /* @__PURE__ */ jsx(
|
|
110
|
+
Field,
|
|
118
111
|
{
|
|
119
112
|
error: Boolean(fieldState.error),
|
|
120
113
|
validationText: fieldState.error?.message,
|
|
121
|
-
label:
|
|
122
|
-
children: /* @__PURE__ */
|
|
123
|
-
|
|
114
|
+
label: i18n.t("Colors"),
|
|
115
|
+
children: /* @__PURE__ */ jsx(
|
|
116
|
+
ColorScaleSelect,
|
|
124
117
|
{
|
|
125
|
-
count: scale ??
|
|
126
|
-
colorClass: colorClass ??
|
|
118
|
+
count: scale ?? defaultClasses,
|
|
119
|
+
colorClass: colorClass ?? defaultColorScaleName,
|
|
127
120
|
width: 300,
|
|
128
121
|
onChange
|
|
129
122
|
}
|
|
@@ -136,6 +129,6 @@ function ColorConfig() {
|
|
|
136
129
|
] });
|
|
137
130
|
}
|
|
138
131
|
|
|
139
|
-
|
|
132
|
+
export { ColorConfig };
|
|
140
133
|
//# sourceMappingURL=out.js.map
|
|
141
134
|
//# sourceMappingURL=ColorConfig.js.map
|
package/dist/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.tsx"],"names":["palette","colorClass"],"mappings":"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","sourcesContent":["import { Controller } from \"react-hook-form\";\nimport {\n\tField,\n\tInputField,\n\tSingleSelectField,\n\tSingleSelectOption,\n} from \"@dhis2/ui\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport {\n\tdefaultClasses,\n\tdefaultColorScaleName,\n\tgetColorClasses,\n\tgetColorPalette,\n\tgetColorScale,\n} from \"../../../utils/colors\";\nimport ColorScaleSelect from \"../../ThematicLayerConfiguration/components/ColorScaleSelect\";\nimport React from \"react\";\n\nexport function ColorConfig() {\n\treturn (\n\t\t<div className=\"column gap-16\">\n\t\t\t<div className=\"row gap-8\">\n\t\t\t\t<Controller\n\t\t\t\t\trender={({ field, fieldState }) => (\n\t\t\t\t\t\t<InputField\n\t\t\t\t\t\t\t{...field}\n\t\t\t\t\t\t\terror={Boolean(fieldState.error)}\n\t\t\t\t\t\t\tvalidationText={fieldState.error?.message}\n\t\t\t\t\t\t\tvalue={field.value?.toString()}\n\t\t\t\t\t\t\tonChange={({ value }: { value?: string }) => {\n\t\t\t\t\t\t\t\tif (!value) return;\n\t\t\t\t\t\t\t\tfield.onChange(parseInt(value));\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tlabel={i18n.t(\"Min\")}\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tname={\"params.min\"}\n\t\t\t\t/>\n\t\t\t\t<Controller\n\t\t\t\t\trender={({ field, fieldState }) => (\n\t\t\t\t\t\t<InputField\n\t\t\t\t\t\t\t{...field}\n\t\t\t\t\t\t\terror={Boolean(fieldState.error)}\n\t\t\t\t\t\t\tvalidationText={fieldState.error?.message}\n\t\t\t\t\t\t\tvalue={field.value?.toString()}\n\t\t\t\t\t\t\tonChange={({ value }: { value?: string }) => {\n\t\t\t\t\t\t\t\tif (!value) return;\n\t\t\t\t\t\t\t\tfield.onChange(parseInt(value));\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tlabel={i18n.t(\"Max\")}\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tname={\"params.max\"}\n\t\t\t\t/>\n\t\t\t\t<Controller\n\t\t\t\t\tname=\"params.palette\"\n\t\t\t\t\trender={({ field, fieldState }) => {\n\t\t\t\t\t\tconst palette = field.value;\n\t\t\t\t\t\tconst scale = getColorClasses(palette);\n\t\t\t\t\t\tconst colorClass = getColorScale(palette ?? \"\");\n\n\t\t\t\t\t\tconst onChange = ({\n\t\t\t\t\t\t\tselected,\n\t\t\t\t\t\t}: {\n\t\t\t\t\t\t\tselected: string;\n\t\t\t\t\t\t}) => {\n\t\t\t\t\t\t\tconst palette = getColorPalette(\n\t\t\t\t\t\t\t\tcolorClass as string,\n\t\t\t\t\t\t\t\tparseInt(selected),\n\t\t\t\t\t\t\t)?.join(\",\");\n\t\t\t\t\t\t\tfield.onChange(palette);\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<SingleSelectField\n\t\t\t\t\t\t\t\tvalidationText={fieldState.error?.message}\n\t\t\t\t\t\t\t\terror={Boolean(fieldState.error)}\n\t\t\t\t\t\t\t\tselected={\n\t\t\t\t\t\t\t\t\tscale?.toString() ??\n\t\t\t\t\t\t\t\t\tdefaultClasses.toString()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlabel={i18n.t(\"Steps\")}\n\t\t\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{[3, 4, 5, 6, 7, 8, 9].map((value) => (\n\t\t\t\t\t\t\t\t\t<SingleSelectOption\n\t\t\t\t\t\t\t\t\t\tkey={`${value}-classes-option`}\n\t\t\t\t\t\t\t\t\t\tlabel={`${value}`}\n\t\t\t\t\t\t\t\t\t\tvalue={value?.toString()}\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</SingleSelectField>\n\t\t\t\t\t\t);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<Controller\n\t\t\t\t\tname=\"params.palette\"\n\t\t\t\t\trender={({ field, fieldState }) => {\n\t\t\t\t\t\tconst palette = field.value;\n\t\t\t\t\t\tconst scale = getColorClasses(palette);\n\t\t\t\t\t\tconst colorClass = getColorScale(palette ?? \"\");\n\n\t\t\t\t\t\tconst onChange = (colorClass: string) => {\n\t\t\t\t\t\t\tconst palette = getColorPalette(\n\t\t\t\t\t\t\t\tcolorClass,\n\t\t\t\t\t\t\t\tscale,\n\t\t\t\t\t\t\t)?.join(\",\");\n\t\t\t\t\t\t\tfield.onChange(palette);\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Field\n\t\t\t\t\t\t\t\terror={Boolean(fieldState.error)}\n\t\t\t\t\t\t\t\tvalidationText={fieldState.error?.message}\n\t\t\t\t\t\t\t\tlabel={i18n.t(\"Colors\")}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ColorScaleSelect\n\t\t\t\t\t\t\t\t\tcount={scale ?? defaultClasses}\n\t\t\t\t\t\t\t\t\tcolorClass={\n\t\t\t\t\t\t\t\t\t\tcolorClass ?? defaultColorScaleName\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\twidth={300}\n\t\t\t\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Field>\n\t\t\t\t\t\t);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/components/ColorConfig.tsx"],"names":["palette","colorClass"],"mappings":"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","sourcesContent":["import { Controller } from \"react-hook-form\";\nimport {\n\tField,\n\tInputField,\n\tSingleSelectField,\n\tSingleSelectOption,\n} from \"@dhis2/ui\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport {\n\tdefaultClasses,\n\tdefaultColorScaleName,\n\tgetColorClasses,\n\tgetColorPalette,\n\tgetColorScale,\n} from \"../../../utils/colors.js\";\nimport ColorScaleSelect from \"../../ThematicLayerConfiguration/components/ColorScaleSelect/index.js\";\nimport React from \"react\";\n\nexport function ColorConfig() {\n\treturn (\n\t\t<div className=\"column gap-16\">\n\t\t\t<div className=\"row gap-8\">\n\t\t\t\t<Controller\n\t\t\t\t\trender={({ field, fieldState }) => (\n\t\t\t\t\t\t<InputField\n\t\t\t\t\t\t\t{...field}\n\t\t\t\t\t\t\terror={Boolean(fieldState.error)}\n\t\t\t\t\t\t\tvalidationText={fieldState.error?.message}\n\t\t\t\t\t\t\tvalue={field.value?.toString()}\n\t\t\t\t\t\t\tonChange={({ value }: { value?: string }) => {\n\t\t\t\t\t\t\t\tif (!value) return;\n\t\t\t\t\t\t\t\tfield.onChange(parseInt(value));\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tlabel={i18n.t(\"Min\")}\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tname={\"params.min\"}\n\t\t\t\t/>\n\t\t\t\t<Controller\n\t\t\t\t\trender={({ field, fieldState }) => (\n\t\t\t\t\t\t<InputField\n\t\t\t\t\t\t\t{...field}\n\t\t\t\t\t\t\terror={Boolean(fieldState.error)}\n\t\t\t\t\t\t\tvalidationText={fieldState.error?.message}\n\t\t\t\t\t\t\tvalue={field.value?.toString()}\n\t\t\t\t\t\t\tonChange={({ value }: { value?: string }) => {\n\t\t\t\t\t\t\t\tif (!value) return;\n\t\t\t\t\t\t\t\tfield.onChange(parseInt(value));\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tlabel={i18n.t(\"Max\")}\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tname={\"params.max\"}\n\t\t\t\t/>\n\t\t\t\t<Controller\n\t\t\t\t\tname=\"params.palette\"\n\t\t\t\t\trender={({ field, fieldState }) => {\n\t\t\t\t\t\tconst palette = field.value;\n\t\t\t\t\t\tconst scale = getColorClasses(palette);\n\t\t\t\t\t\tconst colorClass = getColorScale(palette ?? \"\");\n\n\t\t\t\t\t\tconst onChange = ({\n\t\t\t\t\t\t\tselected,\n\t\t\t\t\t\t}: {\n\t\t\t\t\t\t\tselected: string;\n\t\t\t\t\t\t}) => {\n\t\t\t\t\t\t\tconst palette = getColorPalette(\n\t\t\t\t\t\t\t\tcolorClass as string,\n\t\t\t\t\t\t\t\tparseInt(selected),\n\t\t\t\t\t\t\t)?.join(\",\");\n\t\t\t\t\t\t\tfield.onChange(palette);\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<SingleSelectField\n\t\t\t\t\t\t\t\tvalidationText={fieldState.error?.message}\n\t\t\t\t\t\t\t\terror={Boolean(fieldState.error)}\n\t\t\t\t\t\t\t\tselected={\n\t\t\t\t\t\t\t\t\tscale?.toString() ??\n\t\t\t\t\t\t\t\t\tdefaultClasses.toString()\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tlabel={i18n.t(\"Steps\")}\n\t\t\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{[3, 4, 5, 6, 7, 8, 9].map((value) => (\n\t\t\t\t\t\t\t\t\t<SingleSelectOption\n\t\t\t\t\t\t\t\t\t\tkey={`${value}-classes-option`}\n\t\t\t\t\t\t\t\t\t\tlabel={`${value}`}\n\t\t\t\t\t\t\t\t\t\tvalue={value?.toString()}\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</SingleSelectField>\n\t\t\t\t\t\t);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<Controller\n\t\t\t\t\tname=\"params.palette\"\n\t\t\t\t\trender={({ field, fieldState }) => {\n\t\t\t\t\t\tconst palette = field.value;\n\t\t\t\t\t\tconst scale = getColorClasses(palette);\n\t\t\t\t\t\tconst colorClass = getColorScale(palette ?? \"\");\n\n\t\t\t\t\t\tconst onChange = (colorClass: string) => {\n\t\t\t\t\t\t\tconst palette = getColorPalette(\n\t\t\t\t\t\t\t\tcolorClass,\n\t\t\t\t\t\t\t\tscale,\n\t\t\t\t\t\t\t)?.join(\",\");\n\t\t\t\t\t\t\tfield.onChange(palette);\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Field\n\t\t\t\t\t\t\t\terror={Boolean(fieldState.error)}\n\t\t\t\t\t\t\t\tvalidationText={fieldState.error?.message}\n\t\t\t\t\t\t\t\tlabel={i18n.t(\"Colors\")}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ColorScaleSelect\n\t\t\t\t\t\t\t\t\tcount={scale ?? defaultClasses}\n\t\t\t\t\t\t\t\t\tcolorClass={\n\t\t\t\t\t\t\t\t\t\tcolorClass ?? defaultColorScaleName\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\twidth={300}\n\t\t\t\t\t\t\t\t\tonChange={onChange}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Field>\n\t\t\t\t\t\t);\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -1,34 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var ui = require('@dhis2/ui');
|
|
8
|
-
var data = require('../hooks/data');
|
|
9
|
-
|
|
10
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
|
|
12
|
-
var i18n__default = /*#__PURE__*/_interopDefault(i18n);
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useFormContext, Controller } from 'react-hook-form';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import i18n from '@dhis2/d2-i18n';
|
|
5
|
+
import { InputField } from '@dhis2/ui';
|
|
6
|
+
import { useType } from '../hooks/data.js';
|
|
13
7
|
|
|
14
8
|
function Name() {
|
|
15
|
-
const config =
|
|
16
|
-
const { setValue } =
|
|
17
|
-
|
|
9
|
+
const config = useType();
|
|
10
|
+
const { setValue } = useFormContext();
|
|
11
|
+
useEffect(() => {
|
|
18
12
|
setValue("name", config?.name);
|
|
19
13
|
setValue("id", config?.id);
|
|
20
14
|
}, [config]);
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
Controller,
|
|
23
17
|
{
|
|
24
18
|
name: "name",
|
|
25
19
|
rules: {
|
|
26
|
-
required:
|
|
20
|
+
required: i18n.t("Name is required")
|
|
27
21
|
},
|
|
28
|
-
render: ({ field, fieldState }) => /* @__PURE__ */
|
|
29
|
-
|
|
22
|
+
render: ({ field, fieldState }) => /* @__PURE__ */ jsx(
|
|
23
|
+
InputField,
|
|
30
24
|
{
|
|
31
|
-
label:
|
|
25
|
+
label: i18n.t("Layer name"),
|
|
32
26
|
type: "text",
|
|
33
27
|
required: true,
|
|
34
28
|
error: Boolean(fieldState.error),
|
|
@@ -45,6 +39,6 @@ function Name() {
|
|
|
45
39
|
);
|
|
46
40
|
}
|
|
47
41
|
|
|
48
|
-
|
|
42
|
+
export { Name };
|
|
49
43
|
//# sourceMappingURL=out.js.map
|
|
50
44
|
//# sourceMappingURL=Name.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/components/Name.tsx"],"names":[],"mappings":"AAqBI;AArBJ,SAAS,YAAY,sBAAsB;AAC3C,SAAgB,iBAAiB;AACjC,OAAO,UAAU;AACjB,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AAEjB,SAAS,OAAO;AACtB,QAAM,SAAS,QAAQ;AACvB,QAAM,EAAE,SAAS,IAAI,eAAe;AACpC,YAAU,MAAM;AACf,aAAS,QAAQ,QAAQ,IAAI;AAC7B,aAAS,MAAM,QAAQ,EAAE;AAAA,EAC1B,GAAG,CAAC,MAAM,CAAC;AAEX,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL,OAAO;AAAA,QACN,UAAU,KAAK,EAAE,kBAAkB;AAAA,MACpC;AAAA,MACA,QAAQ,CAAC,EAAE,OAAO,WAAW,MAC5B;AAAA,QAAC;AAAA;AAAA,UACA,OAAO,KAAK,EAAE,YAAY;AAAA,UAC1B,MAAK;AAAA,UACL,UAAQ;AAAA,UACR,OAAO,QAAQ,WAAW,KAAK;AAAA,UAC/B,gBAAgB,WAAW,OAAO;AAAA,UAClC,UAAU,CAAC,EAAE,MAAM,MAA0B;AAC5C,gBAAI,CAAC;AAAO;AACZ,kBAAM,SAAS,KAAK;AAAA,UACrB;AAAA,UACA,OAAO,MAAM;AAAA;AAAA,MACd;AAAA;AAAA,EAEF;AAEF","sourcesContent":["import { Controller, useFormContext } from \"react-hook-form\";\nimport React, { useEffect } from \"react\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport { InputField } from \"@dhis2/ui\";\nimport { useType } from \"../hooks/data\";\n\nexport function Name() {\n\tconst config = useType();\n\tconst { setValue } = useFormContext();\n\tuseEffect(() => {\n\t\tsetValue(\"name\", config?.name);\n\t\tsetValue(\"id\", config?.id);\n\t}, [config]);\n\n\treturn (\n\t\t<Controller\n\t\t\tname=\"name\"\n\t\t\trules={{\n\t\t\t\trequired: i18n.t(\"Name is required\"),\n\t\t\t}}\n\t\t\trender={({ field, fieldState }) => (\n\t\t\t\t<InputField\n\t\t\t\t\tlabel={i18n.t(\"Layer name\")}\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\trequired\n\t\t\t\t\terror={Boolean(fieldState.error)}\n\t\t\t\t\tvalidationText={fieldState.error?.message}\n\t\t\t\t\tonChange={({ value }: { value?: string }) => {\n\t\t\t\t\t\tif (!value) return;\n\t\t\t\t\t\tfield.onChange(value);\n\t\t\t\t\t}}\n\t\t\t\t\tvalue={field.value}\n\t\t\t\t/>\n\t\t\t)}\n\t\t/>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/components/Name.tsx"],"names":[],"mappings":"AAqBI;AArBJ,SAAS,YAAY,sBAAsB;AAC3C,SAAgB,iBAAiB;AACjC,OAAO,UAAU;AACjB,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AAEjB,SAAS,OAAO;AACtB,QAAM,SAAS,QAAQ;AACvB,QAAM,EAAE,SAAS,IAAI,eAAe;AACpC,YAAU,MAAM;AACf,aAAS,QAAQ,QAAQ,IAAI;AAC7B,aAAS,MAAM,QAAQ,EAAE;AAAA,EAC1B,GAAG,CAAC,MAAM,CAAC;AAEX,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL,OAAO;AAAA,QACN,UAAU,KAAK,EAAE,kBAAkB;AAAA,MACpC;AAAA,MACA,QAAQ,CAAC,EAAE,OAAO,WAAW,MAC5B;AAAA,QAAC;AAAA;AAAA,UACA,OAAO,KAAK,EAAE,YAAY;AAAA,UAC1B,MAAK;AAAA,UACL,UAAQ;AAAA,UACR,OAAO,QAAQ,WAAW,KAAK;AAAA,UAC/B,gBAAgB,WAAW,OAAO;AAAA,UAClC,UAAU,CAAC,EAAE,MAAM,MAA0B;AAC5C,gBAAI,CAAC;AAAO;AACZ,kBAAM,SAAS,KAAK;AAAA,UACrB;AAAA,UACA,OAAO,MAAM;AAAA;AAAA,MACd;AAAA;AAAA,EAEF;AAEF","sourcesContent":["import { Controller, useFormContext } from \"react-hook-form\";\nimport React, { useEffect } from \"react\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport { InputField } from \"@dhis2/ui\";\nimport { useType } from \"../hooks/data.js\";\n\nexport function Name() {\n\tconst config = useType();\n\tconst { setValue } = useFormContext();\n\tuseEffect(() => {\n\t\tsetValue(\"name\", config?.name);\n\t\tsetValue(\"id\", config?.id);\n\t}, [config]);\n\n\treturn (\n\t\t<Controller\n\t\t\tname=\"name\"\n\t\t\trules={{\n\t\t\t\trequired: i18n.t(\"Name is required\"),\n\t\t\t}}\n\t\t\trender={({ field, fieldState }) => (\n\t\t\t\t<InputField\n\t\t\t\t\tlabel={i18n.t(\"Layer name\")}\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\trequired\n\t\t\t\t\terror={Boolean(fieldState.error)}\n\t\t\t\t\tvalidationText={fieldState.error?.message}\n\t\t\t\t\tonChange={({ value }: { value?: string }) => {\n\t\t\t\t\t\tif (!value) return;\n\t\t\t\t\t\tfield.onChange(value);\n\t\t\t\t\t}}\n\t\t\t\t\tvalue={field.value}\n\t\t\t\t/>\n\t\t\t)}\n\t\t/>\n\t);\n}\n"]}
|
package/dist/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.js
CHANGED
|
@@ -1,59 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var i18n = require('@dhis2/d2-i18n');
|
|
9
|
-
var data = require('../hooks/data');
|
|
10
|
-
|
|
11
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
|
|
13
|
-
var i18n__default = /*#__PURE__*/_interopDefault(i18n);
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useFormContext, Controller } from 'react-hook-form';
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { isEmpty, head } from 'lodash';
|
|
5
|
+
import { Center, SingleSelectField, SingleSelectOption, CircularLoader } from '@dhis2/ui';
|
|
6
|
+
import i18n from '@dhis2/d2-i18n';
|
|
7
|
+
import { useType, useDatasetInfo } from '../hooks/data.js';
|
|
14
8
|
|
|
15
9
|
function PeriodSelector() {
|
|
16
|
-
const config =
|
|
17
|
-
const { setValue, getValues } =
|
|
10
|
+
const config = useType();
|
|
11
|
+
const { setValue, getValues } = useFormContext();
|
|
18
12
|
const filters = config?.filters ?? [];
|
|
19
13
|
const hasPeriodFilter = filters.includes("period");
|
|
20
|
-
const { loading, error, periods } =
|
|
14
|
+
const { loading, error, periods } = useDatasetInfo(hasPeriodFilter, config);
|
|
21
15
|
const initialPeriod = getValues("filters.period");
|
|
22
|
-
|
|
23
|
-
if (!
|
|
24
|
-
setValue("filters.period",
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (!isEmpty(periods) && !initialPeriod) {
|
|
18
|
+
setValue("filters.period", head(periods));
|
|
25
19
|
}
|
|
26
20
|
}, [periods]);
|
|
27
21
|
if (!hasPeriodFilter) {
|
|
28
22
|
return null;
|
|
29
23
|
}
|
|
30
24
|
if (error) {
|
|
31
|
-
return /* @__PURE__ */
|
|
25
|
+
return /* @__PURE__ */ jsx("div", { style: { minWidth: "100%", minHeight: 100 }, children: /* @__PURE__ */ jsx(Center, { children: /* @__PURE__ */ jsx("p", { children: error?.message ?? error?.toString() }) }) });
|
|
32
26
|
}
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
-
|
|
27
|
+
return /* @__PURE__ */ jsx(
|
|
28
|
+
Controller,
|
|
35
29
|
{
|
|
36
30
|
name: "filters.period",
|
|
37
31
|
rules: {
|
|
38
|
-
required:
|
|
32
|
+
required: i18n.t("Period is required")
|
|
39
33
|
},
|
|
40
|
-
render: ({ field, fieldState }) => /* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
|
|
34
|
+
render: ({ field, fieldState }) => /* @__PURE__ */ jsxs("div", { style: { gap: 4 }, className: "row align-items-center", children: [
|
|
35
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ jsx(
|
|
36
|
+
SingleSelectField,
|
|
43
37
|
{
|
|
44
|
-
helpText:
|
|
38
|
+
helpText: i18n.t(
|
|
45
39
|
"Available periods are set by the source data"
|
|
46
40
|
),
|
|
47
41
|
loading,
|
|
48
42
|
filterable: true,
|
|
49
|
-
label:
|
|
43
|
+
label: i18n.t("Period"),
|
|
50
44
|
required: true,
|
|
51
45
|
error: Boolean(fieldState.error),
|
|
52
46
|
validationText: fieldState.error?.message,
|
|
53
47
|
onChange: ({ selected }) => field.onChange(parseInt(selected)),
|
|
54
48
|
selected: periods?.includes(field.value) ? field.value?.toString() : void 0,
|
|
55
|
-
children: periods?.map((period) => /* @__PURE__ */
|
|
56
|
-
|
|
49
|
+
children: periods?.map((period) => /* @__PURE__ */ jsx(
|
|
50
|
+
SingleSelectOption,
|
|
57
51
|
{
|
|
58
52
|
value: period.toString(),
|
|
59
53
|
label: period.toString()
|
|
@@ -62,12 +56,12 @@ function PeriodSelector() {
|
|
|
62
56
|
))
|
|
63
57
|
}
|
|
64
58
|
) }),
|
|
65
|
-
loading && /* @__PURE__ */
|
|
59
|
+
loading && /* @__PURE__ */ jsx(CircularLoader, { extrasmall: true })
|
|
66
60
|
] })
|
|
67
61
|
}
|
|
68
62
|
);
|
|
69
63
|
}
|
|
70
64
|
|
|
71
|
-
|
|
65
|
+
export { PeriodSelector };
|
|
72
66
|
//# sourceMappingURL=out.js.map
|
|
73
67
|
//# sourceMappingURL=PeriodSelector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.tsx"],"names":[],"mappings":"AAkCK,cAaD,YAbC;AAlCL,SAAS,YAAY,sBAAsB;AAC3C,SAAgB,iBAAiB;AACjC,SAAS,MAAM,eAAe;AAC9B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,OAAO,UAAU;AACjB,SAAS,gBAAgB,eAAe;AAEjC,SAAS,iBAAiB;AAChC,QAAM,SAAS,QAAQ;AACvB,QAAM,EAAE,UAAU,UAAU,IAAI,eAAe;AAC/C,QAAM,UAAU,QAAQ,WAAW,CAAC;AACpC,QAAM,kBAAkB,QAAQ,SAAS,QAAQ;AACjD,QAAM,EAAE,SAAS,OAAO,QAAQ,IAAI,eAAe,iBAAiB,MAAM;AAC1E,QAAM,gBAAgB,UAAU,gBAAgB;AAEhD,YAAU,MAAM;AACf,QAAI,CAAC,QAAQ,OAAO,KAAK,CAAC,eAAe;AACxC,eAAS,kBAAkB,KAAK,OAAO,CAAC;AAAA,IACzC;AAAA,EACD,GAAG,CAAC,OAAO,CAAC;AAEZ,MAAI,CAAC,iBAAiB;AACrB,WAAO;AAAA,EACR;AAEA,MAAI,OAAO;AACV,WACC,oBAAC,SAAI,OAAO,EAAE,UAAU,QAAQ,WAAW,IAAI,GAC9C,8BAAC,UACA,8BAAC,OAAG,iBAAO,WAAW,OAAO,SAAS,GAAE,GACzC,GACD;AAAA,EAEF;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL,OAAO;AAAA,QACN,UAAU,KAAK,EAAE,oBAAoB;AAAA,MACtC;AAAA,MACA,QAAQ,CAAC,EAAE,OAAO,WAAW,MAC5B,qBAAC,SAAI,OAAO,EAAE,KAAK,EAAE,GAAG,WAAU,0BACjC;AAAA,4BAAC,SAAI,OAAO,EAAE,MAAM,EAAE,GACrB;AAAA,UAAC;AAAA;AAAA,YACA,UAAU,KAAK;AAAA,cACd;AAAA,YACD;AAAA,YACA;AAAA,YACA,YAAU;AAAA,YACV,OAAO,KAAK,EAAE,QAAQ;AAAA,YACtB,UAAQ;AAAA,YACR,OAAO,QAAQ,WAAW,KAAK;AAAA,YAC/B,gBAAgB,WAAW,OAAO;AAAA,YAClC,UAAU,CAAC,EAAE,SAAS,MACrB,MAAM,SAAS,SAAS,QAAQ,CAAC;AAAA,YAElC,UACC,SAAS,SAAS,MAAM,KAAK,IAC1B,MAAM,OAAO,SAAS,IACtB;AAAA,YAGH,mBAAS,IAAI,CAAC,WACd;AAAA,cAAC;AAAA;AAAA,gBAEA,OAAO,OAAO,SAAS;AAAA,gBACvB,OAAO,OAAO,SAAS;AAAA;AAAA,cAFlB,GAAG,MAAM;AAAA,YAGf,CACA;AAAA;AAAA,QACF,GACD;AAAA,QACC,WAAW,oBAAC,kBAAe,YAAU,MAAC;AAAA,SACxC;AAAA;AAAA,EAEF;AAEF","sourcesContent":["import { Controller, useFormContext } from \"react-hook-form\";\nimport React, { useEffect } from \"react\";\nimport { head, isEmpty } from \"lodash\";\nimport {\n\tCenter,\n\tCircularLoader,\n\tSingleSelectField,\n\tSingleSelectOption,\n} from \"@dhis2/ui\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport { useDatasetInfo, useType } from \"../hooks/data\";\n\nexport function PeriodSelector() {\n\tconst config = useType();\n\tconst { setValue, getValues } = useFormContext();\n\tconst filters = config?.filters ?? [];\n\tconst hasPeriodFilter = filters.includes(\"period\");\n\tconst { loading, error, periods } = useDatasetInfo(hasPeriodFilter, config);\n\tconst initialPeriod = getValues(\"filters.period\");\n\n\tuseEffect(() => {\n\t\tif (!isEmpty(periods) && !initialPeriod) {\n\t\t\tsetValue(\"filters.period\", head(periods));\n\t\t}\n\t}, [periods]);\n\n\tif (!hasPeriodFilter) {\n\t\treturn null;\n\t}\n\n\tif (error) {\n\t\treturn (\n\t\t\t<div style={{ minWidth: \"100%\", minHeight: 100 }}>\n\t\t\t\t<Center>\n\t\t\t\t\t<p>{error?.message ?? error?.toString()}</p>\n\t\t\t\t</Center>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Controller\n\t\t\tname=\"filters.period\"\n\t\t\trules={{\n\t\t\t\trequired: i18n.t(\"Period is required\"),\n\t\t\t}}\n\t\t\trender={({ field, fieldState }) => (\n\t\t\t\t<div style={{ gap: 4 }} className=\"row align-items-center\">\n\t\t\t\t\t<div style={{ flex: 1 }}>\n\t\t\t\t\t\t<SingleSelectField\n\t\t\t\t\t\t\thelpText={i18n.t(\n\t\t\t\t\t\t\t\t\"Available periods are set by the source data\",\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tloading={loading}\n\t\t\t\t\t\t\tfilterable\n\t\t\t\t\t\t\tlabel={i18n.t(\"Period\")}\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\terror={Boolean(fieldState.error)}\n\t\t\t\t\t\t\tvalidationText={fieldState.error?.message}\n\t\t\t\t\t\t\tonChange={({ selected }: { selected: string }) =>\n\t\t\t\t\t\t\t\tfield.onChange(parseInt(selected))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tselected={\n\t\t\t\t\t\t\t\tperiods?.includes(field.value)\n\t\t\t\t\t\t\t\t\t? field.value?.toString()\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{periods?.map((period: number) => (\n\t\t\t\t\t\t\t\t<SingleSelectOption\n\t\t\t\t\t\t\t\t\tkey={`${period}-option`}\n\t\t\t\t\t\t\t\t\tvalue={period.toString()}\n\t\t\t\t\t\t\t\t\tlabel={period.toString()}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</SingleSelectField>\n\t\t\t\t\t</div>\n\t\t\t\t\t{loading && <CircularLoader extrasmall />}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t/>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/components/PeriodSelector.tsx"],"names":[],"mappings":"AAkCK,cAaD,YAbC;AAlCL,SAAS,YAAY,sBAAsB;AAC3C,SAAgB,iBAAiB;AACjC,SAAS,MAAM,eAAe;AAC9B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,OAAO,UAAU;AACjB,SAAS,gBAAgB,eAAe;AAEjC,SAAS,iBAAiB;AAChC,QAAM,SAAS,QAAQ;AACvB,QAAM,EAAE,UAAU,UAAU,IAAI,eAAe;AAC/C,QAAM,UAAU,QAAQ,WAAW,CAAC;AACpC,QAAM,kBAAkB,QAAQ,SAAS,QAAQ;AACjD,QAAM,EAAE,SAAS,OAAO,QAAQ,IAAI,eAAe,iBAAiB,MAAM;AAC1E,QAAM,gBAAgB,UAAU,gBAAgB;AAEhD,YAAU,MAAM;AACf,QAAI,CAAC,QAAQ,OAAO,KAAK,CAAC,eAAe;AACxC,eAAS,kBAAkB,KAAK,OAAO,CAAC;AAAA,IACzC;AAAA,EACD,GAAG,CAAC,OAAO,CAAC;AAEZ,MAAI,CAAC,iBAAiB;AACrB,WAAO;AAAA,EACR;AAEA,MAAI,OAAO;AACV,WACC,oBAAC,SAAI,OAAO,EAAE,UAAU,QAAQ,WAAW,IAAI,GAC9C,8BAAC,UACA,8BAAC,OAAG,iBAAO,WAAW,OAAO,SAAS,GAAE,GACzC,GACD;AAAA,EAEF;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL,OAAO;AAAA,QACN,UAAU,KAAK,EAAE,oBAAoB;AAAA,MACtC;AAAA,MACA,QAAQ,CAAC,EAAE,OAAO,WAAW,MAC5B,qBAAC,SAAI,OAAO,EAAE,KAAK,EAAE,GAAG,WAAU,0BACjC;AAAA,4BAAC,SAAI,OAAO,EAAE,MAAM,EAAE,GACrB;AAAA,UAAC;AAAA;AAAA,YACA,UAAU,KAAK;AAAA,cACd;AAAA,YACD;AAAA,YACA;AAAA,YACA,YAAU;AAAA,YACV,OAAO,KAAK,EAAE,QAAQ;AAAA,YACtB,UAAQ;AAAA,YACR,OAAO,QAAQ,WAAW,KAAK;AAAA,YAC/B,gBAAgB,WAAW,OAAO;AAAA,YAClC,UAAU,CAAC,EAAE,SAAS,MACrB,MAAM,SAAS,SAAS,QAAQ,CAAC;AAAA,YAElC,UACC,SAAS,SAAS,MAAM,KAAK,IAC1B,MAAM,OAAO,SAAS,IACtB;AAAA,YAGH,mBAAS,IAAI,CAAC,WACd;AAAA,cAAC;AAAA;AAAA,gBAEA,OAAO,OAAO,SAAS;AAAA,gBACvB,OAAO,OAAO,SAAS;AAAA;AAAA,cAFlB,GAAG,MAAM;AAAA,YAGf,CACA;AAAA;AAAA,QACF,GACD;AAAA,QACC,WAAW,oBAAC,kBAAe,YAAU,MAAC;AAAA,SACxC;AAAA;AAAA,EAEF;AAEF","sourcesContent":["import { Controller, useFormContext } from \"react-hook-form\";\nimport React, { useEffect } from \"react\";\nimport { head, isEmpty } from \"lodash\";\nimport {\n\tCenter,\n\tCircularLoader,\n\tSingleSelectField,\n\tSingleSelectOption,\n} from \"@dhis2/ui\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport { useDatasetInfo, useType } from \"../hooks/data.js\";\n\nexport function PeriodSelector() {\n\tconst config = useType();\n\tconst { setValue, getValues } = useFormContext();\n\tconst filters = config?.filters ?? [];\n\tconst hasPeriodFilter = filters.includes(\"period\");\n\tconst { loading, error, periods } = useDatasetInfo(hasPeriodFilter, config);\n\tconst initialPeriod = getValues(\"filters.period\");\n\n\tuseEffect(() => {\n\t\tif (!isEmpty(periods) && !initialPeriod) {\n\t\t\tsetValue(\"filters.period\", head(periods));\n\t\t}\n\t}, [periods]);\n\n\tif (!hasPeriodFilter) {\n\t\treturn null;\n\t}\n\n\tif (error) {\n\t\treturn (\n\t\t\t<div style={{ minWidth: \"100%\", minHeight: 100 }}>\n\t\t\t\t<Center>\n\t\t\t\t\t<p>{error?.message ?? error?.toString()}</p>\n\t\t\t\t</Center>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Controller\n\t\t\tname=\"filters.period\"\n\t\t\trules={{\n\t\t\t\trequired: i18n.t(\"Period is required\"),\n\t\t\t}}\n\t\t\trender={({ field, fieldState }) => (\n\t\t\t\t<div style={{ gap: 4 }} className=\"row align-items-center\">\n\t\t\t\t\t<div style={{ flex: 1 }}>\n\t\t\t\t\t\t<SingleSelectField\n\t\t\t\t\t\t\thelpText={i18n.t(\n\t\t\t\t\t\t\t\t\"Available periods are set by the source data\",\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tloading={loading}\n\t\t\t\t\t\t\tfilterable\n\t\t\t\t\t\t\tlabel={i18n.t(\"Period\")}\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\terror={Boolean(fieldState.error)}\n\t\t\t\t\t\t\tvalidationText={fieldState.error?.message}\n\t\t\t\t\t\t\tonChange={({ selected }: { selected: string }) =>\n\t\t\t\t\t\t\t\tfield.onChange(parseInt(selected))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tselected={\n\t\t\t\t\t\t\t\tperiods?.includes(field.value)\n\t\t\t\t\t\t\t\t\t? field.value?.toString()\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{periods?.map((period: number) => (\n\t\t\t\t\t\t\t\t<SingleSelectOption\n\t\t\t\t\t\t\t\t\tkey={`${period}-option`}\n\t\t\t\t\t\t\t\t\tvalue={period.toString()}\n\t\t\t\t\t\t\t\t\tlabel={period.toString()}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</SingleSelectField>\n\t\t\t\t\t</div>\n\t\t\t\t\t{loading && <CircularLoader extrasmall />}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t/>\n\t);\n}\n"]}
|
package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js
CHANGED
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var ColorConfig = require('./ColorConfig');
|
|
6
|
-
var data = require('../hooks/data');
|
|
7
|
-
|
|
8
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
|
|
10
|
-
var i18n__default = /*#__PURE__*/_interopDefault(i18n);
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import i18n from '@dhis2/d2-i18n';
|
|
3
|
+
import { ColorConfig } from './ColorConfig.js';
|
|
4
|
+
import { useType } from '../hooks/data.js';
|
|
11
5
|
|
|
12
6
|
function StylesConfig() {
|
|
13
|
-
const config =
|
|
7
|
+
const config = useType();
|
|
14
8
|
const hasParams = Boolean(config?.params);
|
|
15
9
|
if (!hasParams) {
|
|
16
10
|
return null;
|
|
17
11
|
}
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
|
|
12
|
+
return /* @__PURE__ */ jsx("div", { style: { minWidth: 200, minHeight: 100 }, className: "row gap-16", children: /* @__PURE__ */ jsxs("div", { className: "column", children: [
|
|
13
|
+
/* @__PURE__ */ jsxs("p", { children: [
|
|
14
|
+
i18n.t("Unit"),
|
|
21
15
|
": ",
|
|
22
16
|
config?.unit
|
|
23
17
|
] }),
|
|
24
|
-
/* @__PURE__ */
|
|
18
|
+
/* @__PURE__ */ jsx(ColorConfig, {})
|
|
25
19
|
] }) });
|
|
26
20
|
}
|
|
27
21
|
|
|
28
|
-
|
|
22
|
+
export { StylesConfig };
|
|
29
23
|
//# sourceMappingURL=out.js.map
|
|
30
24
|
//# sourceMappingURL=StylesConfig.js.map
|
package/dist/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.tsx"],"names":[],"mappings":"AAgBI,SAGA,KAHA;AAhBJ,OAAO,UAAU;AACjB,SAAS,mBAAmB;AAE5B,SAAS,eAAe;AAEjB,SAAS,eAAe;AAC9B,QAAM,SAAS,QAAQ;AACvB,QAAM,YAAY,QAAQ,QAAQ,MAAM;AAExC,MAAI,CAAC,WAAW;AACf,WAAO;AAAA,EACR;AAEA,SACC,oBAAC,SAAI,OAAO,EAAE,UAAU,KAAK,WAAW,IAAI,GAAG,WAAU,cACxD,+BAAC,SAAI,WAAU,UACd;AAAA,yBAAC,OACC;AAAA,WAAK,EAAE,MAAM;AAAA,MAAE;AAAA,MAAG,QAAQ;AAAA,OAC5B;AAAA,IACA,oBAAC,eAAY;AAAA,KACd,GACD;AAEF","sourcesContent":["import i18n from \"@dhis2/d2-i18n\";\nimport { ColorConfig } from \"./ColorConfig\";\nimport React from \"react\";\nimport { useType } from \"../hooks/data\";\n\nexport function StylesConfig() {\n\tconst config = useType();\n\tconst hasParams = Boolean(config?.params);\n\n\tif (!hasParams) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div style={{ minWidth: 200, minHeight: 100 }} className=\"row gap-16\">\n\t\t\t<div className=\"column\">\n\t\t\t\t<p>\n\t\t\t\t\t{i18n.t(\"Unit\")}: {config?.unit}\n\t\t\t\t</p>\n\t\t\t\t<ColorConfig />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/components/StylesConfig.tsx"],"names":[],"mappings":"AAgBI,SAGA,KAHA;AAhBJ,OAAO,UAAU;AACjB,SAAS,mBAAmB;AAE5B,SAAS,eAAe;AAEjB,SAAS,eAAe;AAC9B,QAAM,SAAS,QAAQ;AACvB,QAAM,YAAY,QAAQ,QAAQ,MAAM;AAExC,MAAI,CAAC,WAAW;AACf,WAAO;AAAA,EACR;AAEA,SACC,oBAAC,SAAI,OAAO,EAAE,UAAU,KAAK,WAAW,IAAI,GAAG,WAAU,cACxD,+BAAC,SAAI,WAAU,UACd;AAAA,yBAAC,OACC;AAAA,WAAK,EAAE,MAAM;AAAA,MAAE;AAAA,MAAG,QAAQ;AAAA,OAC5B;AAAA,IACA,oBAAC,eAAY;AAAA,KACd,GACD;AAEF","sourcesContent":["import i18n from \"@dhis2/d2-i18n\";\nimport { ColorConfig } from \"./ColorConfig.js\";\nimport React from \"react\";\nimport { useType } from \"../hooks/data.js\";\n\nexport function StylesConfig() {\n\tconst config = useType();\n\tconst hasParams = Boolean(config?.params);\n\n\tif (!hasParams) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div style={{ minWidth: 200, minHeight: 100 }} className=\"row gap-16\">\n\t\t\t<div className=\"column\">\n\t\t\t\t<p>\n\t\t\t\t\t{i18n.t(\"Unit\")}: {config?.unit}\n\t\t\t\t</p>\n\t\t\t\t<ColorConfig />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
|
package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js
CHANGED
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var i18n = require('@dhis2/d2-i18n');
|
|
8
|
-
var ui = require('@dhis2/ui');
|
|
9
|
-
|
|
10
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
|
|
12
|
-
var i18n__default = /*#__PURE__*/_interopDefault(i18n);
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { filter, find } from 'lodash';
|
|
3
|
+
import { EARTH_ENGINE_LAYERS, SUPPORTED_EARTH_ENGINE_LAYERS } from '../../MapLayer/components/GoogleEngineLayer/constants/index.js';
|
|
4
|
+
import { useFormContext, Controller } from 'react-hook-form';
|
|
5
|
+
import i18n from '@dhis2/d2-i18n';
|
|
6
|
+
import { SingleSelectField, SingleSelectOption } from '@dhis2/ui';
|
|
13
7
|
|
|
14
8
|
function TypeField({ excluded }) {
|
|
15
|
-
const supportedLayers =
|
|
16
|
-
|
|
17
|
-
({ id }) =>
|
|
9
|
+
const supportedLayers = filter(
|
|
10
|
+
EARTH_ENGINE_LAYERS,
|
|
11
|
+
({ id }) => SUPPORTED_EARTH_ENGINE_LAYERS.includes(id) && !(excluded?.includes(id) ?? false)
|
|
18
12
|
);
|
|
19
|
-
const { setValue } =
|
|
13
|
+
const { setValue } = useFormContext();
|
|
20
14
|
const setConfigDefaults = (selected) => {
|
|
21
|
-
const config =
|
|
15
|
+
const config = find(supportedLayers, ["id", selected]);
|
|
22
16
|
if (!config)
|
|
23
17
|
return;
|
|
24
18
|
if (config?.defaultAggregations) {
|
|
@@ -35,17 +29,17 @@ function TypeField({ excluded }) {
|
|
|
35
29
|
setValue("params", void 0);
|
|
36
30
|
}
|
|
37
31
|
};
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
Controller,
|
|
40
34
|
{
|
|
41
35
|
name: "type",
|
|
42
36
|
rules: {
|
|
43
|
-
required:
|
|
37
|
+
required: i18n.t("Type is required")
|
|
44
38
|
},
|
|
45
|
-
render: ({ field, fieldState }) => /* @__PURE__ */
|
|
46
|
-
|
|
39
|
+
render: ({ field, fieldState }) => /* @__PURE__ */ jsx(
|
|
40
|
+
SingleSelectField,
|
|
47
41
|
{
|
|
48
|
-
label:
|
|
42
|
+
label: i18n.t("Layer type"),
|
|
49
43
|
required: true,
|
|
50
44
|
error: Boolean(fieldState.error),
|
|
51
45
|
validationText: fieldState.error?.message,
|
|
@@ -53,9 +47,9 @@ function TypeField({ excluded }) {
|
|
|
53
47
|
setConfigDefaults(selected);
|
|
54
48
|
field.onChange(selected);
|
|
55
49
|
},
|
|
56
|
-
selected: Boolean(
|
|
57
|
-
children: supportedLayers?.map((layer) => /* @__PURE__ */
|
|
58
|
-
|
|
50
|
+
selected: Boolean(find(supportedLayers, "id", field.value)) ? field.value : void 0,
|
|
51
|
+
children: supportedLayers?.map((layer) => /* @__PURE__ */ jsx(
|
|
52
|
+
SingleSelectOption,
|
|
59
53
|
{
|
|
60
54
|
value: layer.id,
|
|
61
55
|
label: layer.name
|
|
@@ -68,6 +62,6 @@ function TypeField({ excluded }) {
|
|
|
68
62
|
);
|
|
69
63
|
}
|
|
70
64
|
|
|
71
|
-
|
|
65
|
+
export { TypeField };
|
|
72
66
|
//# sourceMappingURL=out.js.map
|
|
73
67
|
//# sourceMappingURL=TypeField.js.map
|
package/dist/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.tsx"],"names":[],"mappings":"AA6DM;AA7DN,SAAS,QAAQ,YAAY;AAC7B;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,SAAS,YAAY,sBAAsB;AAC3C,OAAO,UAAU;AACjB,SAAS,mBAAmB,0BAA0B;AAG/C,SAAS,UAAU,EAAE,SAAS,GAA4B;AAChE,QAAM,kBAAkB;AAAA,IACvB;AAAA,IACA,CAAC,EAAE,GAAG,MACL,8BAA8B,SAAS,EAAE,KACzC,EAAE,UAAU,SAAS,EAAE,KAAK;AAAA,EAC9B;AACA,QAAM,EAAE,SAAS,IAAI,eAAe;AACpC,QAAM,oBAAoB,CAAC,aAAqB;AAC/C,UAAM,SAAS,KAAK,iBAAiB,CAAC,MAAM,QAAQ,CAAC;AACrD,QAAI,CAAC;AAAQ;AAEb,QAAI,QAAQ,qBAAqB;AAChC,eAAS,gBAAgB,QAAQ,mBAAmB;AAAA,IACrD,OAAO;AACN,eAAS,gBAAgB,MAAS;AAAA,IACnC;AAEA,QAAI,QAAQ,QAAQ;AACnB,YAAM,EAAE,KAAK,KAAK,QAAQ,IAAI,OAAO;AACrC,eAAS,cAAc,GAAG;AAC1B,eAAS,cAAc,GAAG;AAC1B,eAAS,kBAAkB,OAAO;AAAA,IACnC,OAAO;AACN,eAAS,UAAU,MAAS;AAAA,IAC7B;AAAA,EACD;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL,OAAO;AAAA,QACN,UAAU,KAAK,EAAE,kBAAkB;AAAA,MACpC;AAAA,MACA,QAAQ,CAAC,EAAE,OAAO,WAAW,MAC5B;AAAA,QAAC;AAAA;AAAA,UACA,OAAO,KAAK,EAAE,YAAY;AAAA,UAC1B,UAAQ;AAAA,UACR,OAAO,QAAQ,WAAW,KAAK;AAAA,UAC/B,gBAAgB,WAAW,OAAO;AAAA,UAClC,UAAU,CAAC,EAAE,SAAS,MAA4B;AACjD,8BAAkB,QAAQ;AAC1B,kBAAM,SAAS,QAAQ;AAAA,UACxB;AAAA,UACA,UACC,QAAQ,KAAK,iBAAiB,MAAM,MAAM,KAAK,CAAC,IAC7C,MAAM,QACN;AAAA,UAGH,2BAAiB,IAAI,CAAC,UACtB;AAAA,YAAC;AAAA;AAAA,cAEA,OAAO,MAAM;AAAA,cACb,OAAO,MAAM;AAAA;AAAA,YAFR,GAAG,MAAM,EAAE;AAAA,UAGjB,CACA;AAAA;AAAA,MACF;AAAA;AAAA,EAEF;AAEF","sourcesContent":["import { filter, find } from \"lodash\";\nimport {\n\tEARTH_ENGINE_LAYERS,\n\tSUPPORTED_EARTH_ENGINE_LAYERS,\n} from \"../../MapLayer/components/GoogleEngineLayer/constants\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport { SingleSelectField, SingleSelectOption } from \"@dhis2/ui\";\nimport React from \"react\";\n\nexport function TypeField({ excluded }: { excluded?: string[] }) {\n\tconst supportedLayers = filter(\n\t\tEARTH_ENGINE_LAYERS,\n\t\t({ id }) =>\n\t\t\tSUPPORTED_EARTH_ENGINE_LAYERS.includes(id) &&\n\t\t\t!(excluded?.includes(id) ?? false),\n\t);\n\tconst { setValue } = useFormContext();\n\tconst setConfigDefaults = (selected: string) => {\n\t\tconst config = find(supportedLayers, [\"id\", selected]);\n\t\tif (!config) return;\n\n\t\tif (config?.defaultAggregations) {\n\t\t\tsetValue(\"aggregations\", config?.defaultAggregations);\n\t\t} else {\n\t\t\tsetValue(\"aggregations\", undefined);\n\t\t}\n\n\t\tif (config?.params) {\n\t\t\tconst { max, min, palette } = config.params;\n\t\t\tsetValue(\"params.max\", max);\n\t\t\tsetValue(\"params.min\", min);\n\t\t\tsetValue(\"params.palette\", palette);\n\t\t} else {\n\t\t\tsetValue(\"params\", undefined);\n\t\t}\n\t};\n\n\treturn (\n\t\t<Controller\n\t\t\tname=\"type\"\n\t\t\trules={{\n\t\t\t\trequired: i18n.t(\"Type is required\"),\n\t\t\t}}\n\t\t\trender={({ field, fieldState }) => (\n\t\t\t\t<SingleSelectField\n\t\t\t\t\tlabel={i18n.t(\"Layer type\")}\n\t\t\t\t\trequired\n\t\t\t\t\terror={Boolean(fieldState.error)}\n\t\t\t\t\tvalidationText={fieldState.error?.message}\n\t\t\t\t\tonChange={({ selected }: { selected: string }) => {\n\t\t\t\t\t\tsetConfigDefaults(selected);\n\t\t\t\t\t\tfield.onChange(selected);\n\t\t\t\t\t}}\n\t\t\t\t\tselected={\n\t\t\t\t\t\tBoolean(find(supportedLayers, \"id\", field.value))\n\t\t\t\t\t\t\t? field.value\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{supportedLayers?.map((layer) => (\n\t\t\t\t\t\t<SingleSelectOption\n\t\t\t\t\t\t\tkey={`${layer.id}-option`}\n\t\t\t\t\t\t\tvalue={layer.id}\n\t\t\t\t\t\t\tlabel={layer.name}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</SingleSelectField>\n\t\t\t)}\n\t\t/>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/components/TypeField.tsx"],"names":[],"mappings":"AA6DM;AA7DN,SAAS,QAAQ,YAAY;AAC7B;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,SAAS,YAAY,sBAAsB;AAC3C,OAAO,UAAU;AACjB,SAAS,mBAAmB,0BAA0B;AAG/C,SAAS,UAAU,EAAE,SAAS,GAA4B;AAChE,QAAM,kBAAkB;AAAA,IACvB;AAAA,IACA,CAAC,EAAE,GAAG,MACL,8BAA8B,SAAS,EAAE,KACzC,EAAE,UAAU,SAAS,EAAE,KAAK;AAAA,EAC9B;AACA,QAAM,EAAE,SAAS,IAAI,eAAe;AACpC,QAAM,oBAAoB,CAAC,aAAqB;AAC/C,UAAM,SAAS,KAAK,iBAAiB,CAAC,MAAM,QAAQ,CAAC;AACrD,QAAI,CAAC;AAAQ;AAEb,QAAI,QAAQ,qBAAqB;AAChC,eAAS,gBAAgB,QAAQ,mBAAmB;AAAA,IACrD,OAAO;AACN,eAAS,gBAAgB,MAAS;AAAA,IACnC;AAEA,QAAI,QAAQ,QAAQ;AACnB,YAAM,EAAE,KAAK,KAAK,QAAQ,IAAI,OAAO;AACrC,eAAS,cAAc,GAAG;AAC1B,eAAS,cAAc,GAAG;AAC1B,eAAS,kBAAkB,OAAO;AAAA,IACnC,OAAO;AACN,eAAS,UAAU,MAAS;AAAA,IAC7B;AAAA,EACD;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL,OAAO;AAAA,QACN,UAAU,KAAK,EAAE,kBAAkB;AAAA,MACpC;AAAA,MACA,QAAQ,CAAC,EAAE,OAAO,WAAW,MAC5B;AAAA,QAAC;AAAA;AAAA,UACA,OAAO,KAAK,EAAE,YAAY;AAAA,UAC1B,UAAQ;AAAA,UACR,OAAO,QAAQ,WAAW,KAAK;AAAA,UAC/B,gBAAgB,WAAW,OAAO;AAAA,UAClC,UAAU,CAAC,EAAE,SAAS,MAA4B;AACjD,8BAAkB,QAAQ;AAC1B,kBAAM,SAAS,QAAQ;AAAA,UACxB;AAAA,UACA,UACC,QAAQ,KAAK,iBAAiB,MAAM,MAAM,KAAK,CAAC,IAC7C,MAAM,QACN;AAAA,UAGH,2BAAiB,IAAI,CAAC,UACtB;AAAA,YAAC;AAAA;AAAA,cAEA,OAAO,MAAM;AAAA,cACb,OAAO,MAAM;AAAA;AAAA,YAFR,GAAG,MAAM,EAAE;AAAA,UAGjB,CACA;AAAA;AAAA,MACF;AAAA;AAAA,EAEF;AAEF","sourcesContent":["import { filter, find } from \"lodash\";\nimport {\n\tEARTH_ENGINE_LAYERS,\n\tSUPPORTED_EARTH_ENGINE_LAYERS,\n} from \"../../MapLayer/components/GoogleEngineLayer/constants/index.js\";\nimport { Controller, useFormContext } from \"react-hook-form\";\nimport i18n from \"@dhis2/d2-i18n\";\nimport { SingleSelectField, SingleSelectOption } from \"@dhis2/ui\";\nimport React from \"react\";\n\nexport function TypeField({ excluded }: { excluded?: string[] }) {\n\tconst supportedLayers = filter(\n\t\tEARTH_ENGINE_LAYERS,\n\t\t({ id }) =>\n\t\t\tSUPPORTED_EARTH_ENGINE_LAYERS.includes(id) &&\n\t\t\t!(excluded?.includes(id) ?? false),\n\t);\n\tconst { setValue } = useFormContext();\n\tconst setConfigDefaults = (selected: string) => {\n\t\tconst config = find(supportedLayers, [\"id\", selected]);\n\t\tif (!config) return;\n\n\t\tif (config?.defaultAggregations) {\n\t\t\tsetValue(\"aggregations\", config?.defaultAggregations);\n\t\t} else {\n\t\t\tsetValue(\"aggregations\", undefined);\n\t\t}\n\n\t\tif (config?.params) {\n\t\t\tconst { max, min, palette } = config.params;\n\t\t\tsetValue(\"params.max\", max);\n\t\t\tsetValue(\"params.min\", min);\n\t\t\tsetValue(\"params.palette\", palette);\n\t\t} else {\n\t\t\tsetValue(\"params\", undefined);\n\t\t}\n\t};\n\n\treturn (\n\t\t<Controller\n\t\t\tname=\"type\"\n\t\t\trules={{\n\t\t\t\trequired: i18n.t(\"Type is required\"),\n\t\t\t}}\n\t\t\trender={({ field, fieldState }) => (\n\t\t\t\t<SingleSelectField\n\t\t\t\t\tlabel={i18n.t(\"Layer type\")}\n\t\t\t\t\trequired\n\t\t\t\t\terror={Boolean(fieldState.error)}\n\t\t\t\t\tvalidationText={fieldState.error?.message}\n\t\t\t\t\tonChange={({ selected }: { selected: string }) => {\n\t\t\t\t\t\tsetConfigDefaults(selected);\n\t\t\t\t\t\tfield.onChange(selected);\n\t\t\t\t\t}}\n\t\t\t\t\tselected={\n\t\t\t\t\t\tBoolean(find(supportedLayers, \"id\", field.value))\n\t\t\t\t\t\t\t? field.value\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{supportedLayers?.map((layer) => (\n\t\t\t\t\t\t<SingleSelectOption\n\t\t\t\t\t\t\tkey={`${layer.id}-option`}\n\t\t\t\t\t\t\tvalue={layer.id}\n\t\t\t\t\t\t\tlabel={layer.name}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</SingleSelectField>\n\t\t\t)}\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var lodash = require('lodash');
|
|
9
|
-
var constants = require('../../MapLayer/components/GoogleEngineLayer/constants');
|
|
1
|
+
import { useGoogleEngineToken } from '../../MapLayer/components/GoogleEngineLayer/hooks/index.js';
|
|
2
|
+
import { EarthEngine } from '../../MapLayer/components/GoogleEngineLayer/services/engine.js';
|
|
3
|
+
import { useQuery } from 'react-query';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { useWatch } from 'react-hook-form';
|
|
6
|
+
import { find } from 'lodash';
|
|
7
|
+
import { EARTH_ENGINE_LAYERS } from '../../MapLayer/components/GoogleEngineLayer/constants/index.js';
|
|
10
8
|
|
|
11
9
|
function useDatasetInfo(shouldRun, config) {
|
|
12
|
-
const { refresh } =
|
|
10
|
+
const { refresh } = useGoogleEngineToken();
|
|
13
11
|
async function getInfo() {
|
|
14
12
|
if (config) {
|
|
15
13
|
const tokenData = await refresh();
|
|
16
|
-
await
|
|
17
|
-
const engine
|
|
14
|
+
await EarthEngine.setToken(tokenData.token, refresh);
|
|
15
|
+
const engine = new EarthEngine({
|
|
18
16
|
options: config
|
|
19
17
|
});
|
|
20
|
-
return engine
|
|
18
|
+
return engine.getPeriod();
|
|
21
19
|
}
|
|
22
20
|
}
|
|
23
|
-
const { data, error, isLoading } =
|
|
24
|
-
const periods =
|
|
21
|
+
const { data, error, isLoading } = useQuery([config], getInfo);
|
|
22
|
+
const periods = useMemo(() => {
|
|
25
23
|
const features = data?.features;
|
|
26
24
|
return features?.map((feature) => {
|
|
27
25
|
return new Date(
|
|
@@ -36,13 +34,12 @@ function useDatasetInfo(shouldRun, config) {
|
|
|
36
34
|
};
|
|
37
35
|
}
|
|
38
36
|
function useType() {
|
|
39
|
-
const type =
|
|
37
|
+
const type = useWatch({
|
|
40
38
|
name: "type"
|
|
41
39
|
});
|
|
42
|
-
return
|
|
40
|
+
return find(EARTH_ENGINE_LAYERS, ["id", type]);
|
|
43
41
|
}
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
exports.useType = useType;
|
|
43
|
+
export { useDatasetInfo, useType };
|
|
47
44
|
//# sourceMappingURL=out.js.map
|
|
48
45
|
//# sourceMappingURL=data.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/hooks/data.ts"],"names":[],"mappings":"AACA,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,SAAS,2BAA2B;AAE7B,SAAS,eACf,WACA,QACC;AACD,QAAM,EAAE,QAAQ,IAAI,qBAAqB;AAEzC,iBAAe,UAAU;AACxB,QAAI,QAAQ;AACX,YAAM,YAAY,MAAM,QAAQ;AAChC,YAAM,YAAY,SAAS,UAAU,OAAO,OAAO;AACnD,YAAM,SAAS,IAAI,YAAY;AAAA,QAC9B,SAAS;AAAA,MACV,CAAC;AACD,aAAO,OAAO,UAAU;AAAA,IACzB;AAAA,EACD;AAEA,QAAM,EAAE,MAAM,OAAO,UAAU,IAAI,SAAS,CAAC,MAAM,GAAG,OAAO;AAE7D,QAAM,UAAU,QAAQ,MAAM;AAC7B,UAAM,WAAY,MAAc;AAChC,WAAO,UAAU,IAAI,CAAC,YAAiB;AACtC,aAAO,IAAI;AAAA,QACV,SAAS,WAAW,mBAAmB;AAAA,MACxC,GAAG,YAAY;AAAA,IAChB,CAAC;AAAA,EACF,GAAG,CAAC,IAAI,CAAC;AAET,SAAO;AAAA,IACN,SAAS;AAAA,IACT;AAAA,IACA;AAAA,EACD;AACD;AAEO,SAAS,UAAU;AACzB,QAAM,OAAO,SAAS;AAAA,IACrB,MAAM;AAAA,EACP,CAAC;AACD,SAAO,KAAK,qBAAqB,CAAC,MAAM,IAAI,CAAC;AAC9C","sourcesContent":["import { EarthEngineOptions } from \"../../MapLayer/components/GoogleEngineLayer/interfaces\";\nimport { useGoogleEngineToken } from \"../../MapLayer/components/GoogleEngineLayer/hooks\";\nimport { EarthEngine } from \"../../MapLayer/components/GoogleEngineLayer/services/engine\";\nimport { useQuery } from \"react-query\";\nimport { useMemo } from \"react\";\nimport { useWatch } from \"react-hook-form\";\nimport { find } from \"lodash\";\nimport { EARTH_ENGINE_LAYERS } from \"../../MapLayer/components/GoogleEngineLayer/constants\";\n\nexport function useDatasetInfo(\n\tshouldRun: boolean,\n\tconfig?: EarthEngineOptions,\n) {\n\tconst { refresh } = useGoogleEngineToken();\n\n\tasync function getInfo() {\n\t\tif (config) {\n\t\t\tconst tokenData = await refresh();\n\t\t\tawait EarthEngine.setToken(tokenData.token, refresh);\n\t\t\tconst engine = new EarthEngine({\n\t\t\t\toptions: config,\n\t\t\t});\n\t\t\treturn engine.getPeriod();\n\t\t}\n\t}\n\n\tconst { data, error, isLoading } = useQuery([config], getInfo);\n\n\tconst periods = useMemo(() => {\n\t\tconst features = (data as any)?.features;\n\t\treturn features?.map((feature: any) => {\n\t\t\treturn new Date(\n\t\t\t\tfeature?.properties[\"system:time_start\"],\n\t\t\t)?.getFullYear();\n\t\t});\n\t}, [data]);\n\n\treturn {\n\t\tloading: isLoading,\n\t\terror: error as any,\n\t\tperiods,\n\t};\n}\n\nexport function useType() {\n\tconst type = useWatch({\n\t\tname: \"type\",\n\t});\n\treturn find(EARTH_ENGINE_LAYERS, [\"id\", type]);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/Map/components/EarthEngineLayerConfiguration/hooks/data.ts"],"names":[],"mappings":"AACA,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,SAAS,2BAA2B;AAE7B,SAAS,eACf,WACA,QACC;AACD,QAAM,EAAE,QAAQ,IAAI,qBAAqB;AAEzC,iBAAe,UAAU;AACxB,QAAI,QAAQ;AACX,YAAM,YAAY,MAAM,QAAQ;AAChC,YAAM,YAAY,SAAS,UAAU,OAAO,OAAO;AACnD,YAAM,SAAS,IAAI,YAAY;AAAA,QAC9B,SAAS;AAAA,MACV,CAAC;AACD,aAAO,OAAO,UAAU;AAAA,IACzB;AAAA,EACD;AAEA,QAAM,EAAE,MAAM,OAAO,UAAU,IAAI,SAAS,CAAC,MAAM,GAAG,OAAO;AAE7D,QAAM,UAAU,QAAQ,MAAM;AAC7B,UAAM,WAAY,MAAc;AAChC,WAAO,UAAU,IAAI,CAAC,YAAiB;AACtC,aAAO,IAAI;AAAA,QACV,SAAS,WAAW,mBAAmB;AAAA,MACxC,GAAG,YAAY;AAAA,IAChB,CAAC;AAAA,EACF,GAAG,CAAC,IAAI,CAAC;AAET,SAAO;AAAA,IACN,SAAS;AAAA,IACT;AAAA,IACA;AAAA,EACD;AACD;AAEO,SAAS,UAAU;AACzB,QAAM,OAAO,SAAS;AAAA,IACrB,MAAM;AAAA,EACP,CAAC;AACD,SAAO,KAAK,qBAAqB,CAAC,MAAM,IAAI,CAAC;AAC9C","sourcesContent":["import { EarthEngineOptions } from \"../../MapLayer/components/GoogleEngineLayer/interfaces/index.js\";\nimport { useGoogleEngineToken } from \"../../MapLayer/components/GoogleEngineLayer/hooks/index.js\";\nimport { EarthEngine } from \"../../MapLayer/components/GoogleEngineLayer/services/engine.js\";\nimport { useQuery } from \"react-query\";\nimport { useMemo } from \"react\";\nimport { useWatch } from \"react-hook-form\";\nimport { find } from \"lodash\";\nimport { EARTH_ENGINE_LAYERS } from \"../../MapLayer/components/GoogleEngineLayer/constants/index.js\";\n\nexport function useDatasetInfo(\n\tshouldRun: boolean,\n\tconfig?: EarthEngineOptions,\n) {\n\tconst { refresh } = useGoogleEngineToken();\n\n\tasync function getInfo() {\n\t\tif (config) {\n\t\t\tconst tokenData = await refresh();\n\t\t\tawait EarthEngine.setToken(tokenData.token, refresh);\n\t\t\tconst engine = new EarthEngine({\n\t\t\t\toptions: config,\n\t\t\t});\n\t\t\treturn engine.getPeriod();\n\t\t}\n\t}\n\n\tconst { data, error, isLoading } = useQuery([config], getInfo);\n\n\tconst periods = useMemo(() => {\n\t\tconst features = (data as any)?.features;\n\t\treturn features?.map((feature: any) => {\n\t\t\treturn new Date(\n\t\t\t\tfeature?.properties[\"system:time_start\"],\n\t\t\t)?.getFullYear();\n\t\t});\n\t}, [data]);\n\n\treturn {\n\t\tloading: isLoading,\n\t\terror: error as any,\n\t\tperiods,\n\t};\n}\n\nexport function useType() {\n\tconst type = useWatch({\n\t\tname: \"type\",\n\t});\n\treturn find(EARTH_ENGINE_LAYERS, [\"id\", type]);\n}\n"]}
|