@dhis2/analytics 28.0.3 → 28.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/__demo__/DataDimension.stories.js +1 -2
- package/build/cjs/__demo__/Filter.stories.js +1 -2
- package/build/cjs/__demo__/FixedPeriodSelect.stories.js +1 -2
- package/build/cjs/__demo__/OrgUnitDimension.stories.js +1 -2
- package/build/cjs/__demo__/PivotTable.stories.js +166 -224
- package/build/cjs/__demo__/ScatterPlotPdfExport.stories.js +1 -2
- package/build/cjs/__demo__/SingleValue.stories.js +1 -2
- package/build/cjs/__demo__/Toolbar.stories.js +1 -2
- package/build/cjs/api/__tests__/dimensions.spec.js +1 -2
- package/build/cjs/api/analytics/Analytics.js +8 -9
- package/build/cjs/api/analytics/AnalyticsBase.js +58 -77
- package/build/cjs/api/analytics/AnalyticsRequest.js +1 -2
- package/build/cjs/api/analytics/AnalyticsRequestBase.js +18 -21
- package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +19 -38
- package/build/cjs/api/analytics/AnalyticsResponseHeader.js +5 -7
- package/build/cjs/api/analytics/__tests__/AnalyticsBase.spec.js +9 -12
- package/build/cjs/api/analytics/__tests__/AnalyticsRequest.spec.js +8 -2
- package/build/cjs/api/analytics/utils.js +11 -17
- package/build/cjs/api/dimensions.js +119 -148
- package/build/cjs/api/expression.js +39 -60
- package/build/cjs/api/organisationUnits.js +23 -35
- package/build/cjs/components/AboutAOUnit/AboutAOUnit.js +12 -20
- package/build/cjs/components/CachedDataQueryProvider.js +7 -9
- package/build/cjs/components/DashboardPluginWrapper/DashboardPluginWrapper.js +18 -22
- package/build/cjs/components/DataDimension/Calculation/CalculationModal.js +44 -61
- package/build/cjs/components/DataDimension/Calculation/DataElementOption.js +5 -6
- package/build/cjs/components/DataDimension/Calculation/DataElementSelector.js +29 -38
- package/build/cjs/components/DataDimension/Calculation/DndContext.js +29 -37
- package/build/cjs/components/DataDimension/Calculation/DraggingItem.js +5 -6
- package/build/cjs/components/DataDimension/Calculation/DropZone.js +4 -5
- package/build/cjs/components/DataDimension/Calculation/FormulaField.js +29 -32
- package/build/cjs/components/DataDimension/Calculation/FormulaItem.js +14 -16
- package/build/cjs/components/DataDimension/Calculation/MathOperatorSelector.js +23 -29
- package/build/cjs/components/DataDimension/Calculation/Operator.js +6 -7
- package/build/cjs/components/DataDimension/DataDimension.js +20 -32
- package/build/cjs/components/DataDimension/Info/CalculationInfo.js +14 -22
- package/build/cjs/components/DataDimension/Info/DataElementInfo.js +23 -36
- package/build/cjs/components/DataDimension/Info/DataElementOperandInfo.js +30 -44
- package/build/cjs/components/DataDimension/Info/DataSetInfo.js +26 -39
- package/build/cjs/components/DataDimension/Info/EventDataItemInfo.js +21 -34
- package/build/cjs/components/DataDimension/Info/IndicatorInfo.js +21 -32
- package/build/cjs/components/DataDimension/Info/InfoPopover.js +6 -7
- package/build/cjs/components/DataDimension/Info/InfoTable.js +39 -52
- package/build/cjs/components/DataDimension/Info/OptionInfo.js +13 -20
- package/build/cjs/components/DataDimension/Info/ProgramIndicatorInfo.js +46 -58
- package/build/cjs/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +22 -32
- package/build/cjs/components/DataDimension/ItemSelector/DataTypeSelector.js +6 -7
- package/build/cjs/components/DataDimension/ItemSelector/DetailSelector.js +5 -6
- package/build/cjs/components/DataDimension/ItemSelector/GroupSelector.js +10 -12
- package/build/cjs/components/DataDimension/ItemSelector/ItemSelector.js +86 -104
- package/build/cjs/components/DataDimension/ItemSelector/MetricSelector.js +5 -6
- package/build/cjs/components/DataDimension/SourceEmptyPlaceholder.js +10 -13
- package/build/cjs/components/DataDimension/TransferOption.js +35 -39
- package/build/cjs/components/DimensionMenu.js +13 -14
- package/build/cjs/components/DimensionsPanel/DimensionsPanel.js +8 -9
- package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +12 -13
- package/build/cjs/components/DimensionsPanel/List/DimensionList.js +9 -10
- package/build/cjs/components/DimensionsPanel/List/OptionsButton.js +8 -11
- package/build/cjs/components/DimensionsPanel/List/RecommendedIcon.js +10 -13
- package/build/cjs/components/DynamicDimension/DynamicDimension.js +9 -13
- package/build/cjs/components/DynamicDimension/ItemSelector.js +25 -38
- package/build/cjs/components/FileMenu/DeleteDialog.js +11 -16
- package/build/cjs/components/FileMenu/FileMenu.js +19 -30
- package/build/cjs/components/FileMenu/GetLinkDialog.js +7 -7
- package/build/cjs/components/FileMenu/RenameDialog.js +13 -21
- package/build/cjs/components/FileMenu/SaveAsDialog.js +13 -21
- package/build/cjs/components/FileMenu/__tests__/FileMenu.spec.js +6 -2
- package/build/cjs/components/FileMenu/__tests__/GetLinkDialog.spec.js +7 -8
- package/build/cjs/components/FileMenu/utils.js +10 -12
- package/build/cjs/components/Filter/Filter.js +21 -27
- package/build/cjs/components/Interpretations/InterpretationModal/Comment.js +8 -10
- package/build/cjs/components/Interpretations/InterpretationModal/CommentAddForm.js +10 -15
- package/build/cjs/components/Interpretations/InterpretationModal/CommentDeleteButton.js +10 -15
- package/build/cjs/components/Interpretations/InterpretationModal/CommentUpdateForm.js +12 -17
- package/build/cjs/components/Interpretations/InterpretationModal/InterpretationModal.js +19 -25
- package/build/cjs/components/Interpretations/InterpretationModal/InterpretationThread.js +12 -14
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationForm.js +12 -17
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationList.js +10 -11
- package/build/cjs/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +23 -33
- package/build/cjs/components/Interpretations/common/Interpretation/Interpretation.js +13 -15
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +7 -11
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +5 -7
- package/build/cjs/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +15 -23
- package/build/cjs/components/Interpretations/common/Interpretation/useLike.js +5 -6
- package/build/cjs/components/Interpretations/common/Message/Message.js +6 -7
- package/build/cjs/components/Interpretations/common/Message/MessageButtonStrip.js +8 -11
- package/build/cjs/components/Interpretations/common/Message/MessageEditorContainer.js +18 -21
- package/build/cjs/components/Interpretations/common/Message/MessageIconButton.js +34 -40
- package/build/cjs/components/Interpretations/common/Message/MessageInput.js +1 -2
- package/build/cjs/components/Interpretations/common/Message/MessageStatsBar.js +8 -11
- package/build/cjs/components/LegendKey/LegendKey.js +3 -4
- package/build/cjs/components/OfflineTooltip.js +18 -26
- package/build/cjs/components/OpenFileDialog/CreatedByFilter.js +20 -26
- package/build/cjs/components/OpenFileDialog/CustomSelectOption.js +23 -26
- package/build/cjs/components/OpenFileDialog/DateField.js +3 -4
- package/build/cjs/components/OpenFileDialog/FileList.js +19 -22
- package/build/cjs/components/OpenFileDialog/NameFilter.js +15 -21
- package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +36 -45
- package/build/cjs/components/OpenFileDialog/PaginationControls.js +22 -28
- package/build/cjs/components/OpenFileDialog/VisTypeFilter.js +28 -37
- package/build/cjs/components/Options/VisualizationOptions.js +35 -46
- package/build/cjs/components/OrgUnitDimension/OrgUnitDimension.js +38 -60
- package/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +16 -25
- package/build/cjs/components/PeriodDimension/FixedPeriodSelect.js +15 -21
- package/build/cjs/components/PeriodDimension/PeriodDimension.js +9 -12
- package/build/cjs/components/PeriodDimension/PeriodTransfer.js +49 -63
- package/build/cjs/components/PeriodDimension/RelativePeriodFilter.js +24 -30
- package/build/cjs/components/PeriodDimension/__tests__/__snapshots__/FixedPeriodSingleSelect.spec.js.snap +0 -1
- package/build/cjs/components/PeriodDimension/__tests__/__snapshots__/PeriodDimension.spec.js.snap +0 -1
- package/build/cjs/components/PeriodDimension/utils/fixedPeriods.js +6 -7
- package/build/cjs/components/PeriodDimension/utils/index.js +1 -5
- package/build/cjs/components/PivotTable/PivotTable.js +8 -10
- package/build/cjs/components/PivotTable/PivotTableBody.js +20 -29
- package/build/cjs/components/PivotTable/PivotTableCell.js +8 -12
- package/build/cjs/components/PivotTable/PivotTableClippedAxis.js +14 -17
- package/build/cjs/components/PivotTable/PivotTableColumnHeaderCell.js +7 -8
- package/build/cjs/components/PivotTable/PivotTableColumnHeaders.js +22 -29
- package/build/cjs/components/PivotTable/PivotTableContainer.js +5 -6
- package/build/cjs/components/PivotTable/PivotTableDimensionLabelCell.js +4 -5
- package/build/cjs/components/PivotTable/PivotTableEmptyCell.js +3 -4
- package/build/cjs/components/PivotTable/PivotTableEmptyRow.js +4 -5
- package/build/cjs/components/PivotTable/PivotTableEngineContext.js +5 -7
- package/build/cjs/components/PivotTable/PivotTableHead.js +13 -16
- package/build/cjs/components/PivotTable/PivotTableHeaderCell.js +8 -9
- package/build/cjs/components/PivotTable/PivotTableRow.js +20 -27
- package/build/cjs/components/PivotTable/PivotTableRowHeaderCell.js +5 -6
- package/build/cjs/components/PivotTable/PivotTableSortIcon.js +4 -5
- package/build/cjs/components/PivotTable/PivotTableTitleRow.js +19 -24
- package/build/cjs/components/PivotTable/PivotTableTitleRows.js +4 -5
- package/build/cjs/components/PivotTable/PivotTableValueCell.js +6 -8
- package/build/cjs/components/RichText/Editor/Editor.js +70 -85
- package/build/cjs/components/RichText/Parser/Parser.js +5 -10
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuBar.js +20 -24
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +8 -13
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuList.js +9 -17
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +11 -16
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +4 -5
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +13 -11
- package/build/cjs/components/Toolbar/InterpretationsAndDetailsToggler.js +15 -21
- package/build/cjs/components/Toolbar/Toolbar.js +10 -16
- package/build/cjs/components/Toolbar/ToolbarSidebar.js +12 -18
- package/build/cjs/components/Toolbar/UpdateButton.js +18 -24
- package/build/cjs/components/TransferOption.js +14 -15
- package/build/cjs/components/TranslationDialog/TranslationModal/LocalesSelect.js +19 -27
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationForm.js +17 -25
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModal.js +7 -9
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
- package/build/cjs/components/TranslationDialog/TranslationModal/useTranslationsResults.js +3 -4
- package/build/cjs/components/UserMention/UserList.js +6 -7
- package/build/cjs/components/UserMention/UserMentionWrapper.js +13 -20
- package/build/cjs/components/UserMention/useUserSearchResults.js +12 -16
- package/build/cjs/components/VisTypeIcon.js +5 -6
- package/build/cjs/index.js +38 -39
- package/build/cjs/locales/ar_IQ/translations.json +20 -11
- package/build/cjs/locales/cs/translations.json +2 -0
- package/build/cjs/locales/en/translations.json +1 -0
- package/build/cjs/locales/es/translations.json +2 -0
- package/build/cjs/locales/fr/translations.json +2 -0
- package/build/cjs/locales/id/translations.json +20 -11
- package/build/cjs/locales/index.js +62 -62
- package/build/cjs/locales/lo/translations.json +2 -0
- package/build/cjs/locales/nb/translations.json +2 -0
- package/build/cjs/locales/prs/translations.json +2 -0
- package/build/cjs/locales/ps/translations.json +2 -0
- package/build/cjs/locales/pt/translations.json +2 -0
- package/build/cjs/locales/pt_BR/translations.json +2 -0
- package/build/cjs/locales/ru/translations.json +2 -0
- package/build/cjs/locales/si/translations.json +20 -11
- package/build/cjs/locales/sv/translations.json +20 -11
- package/build/cjs/locales/tet/translations.json +20 -11
- package/build/cjs/locales/tg/translations.json +2 -0
- package/build/cjs/locales/uk/translations.json +2 -0
- package/build/cjs/locales/ur/translations.json +2 -0
- package/build/cjs/locales/uz_UZ_Cyrl/translations.json +2 -0
- package/build/cjs/locales/uz_UZ_Latn/translations.json +4 -2
- package/build/cjs/locales/vi/translations.json +2 -0
- package/build/cjs/locales/zh/translations.json +2 -0
- package/build/cjs/locales/zh_CN/translations.json +17 -15
- package/build/cjs/modules/__tests__/expressions.spec.js +4 -5
- package/build/cjs/modules/__tests__/isNumeric.spec.js +33 -0
- package/build/cjs/modules/dimensionListItem.js +4 -5
- package/build/cjs/modules/expressions.js +3 -9
- package/build/cjs/modules/getPWAInstallationStatus.js +7 -9
- package/build/cjs/modules/layout/dimensionCreate.js +1 -3
- package/build/cjs/modules/layout/dimensionIsValid.js +3 -4
- package/build/cjs/modules/legends.js +5 -6
- package/build/cjs/modules/outliers/index.js +5 -6
- package/build/cjs/modules/outliers/iqr.js +4 -6
- package/build/cjs/modules/outliers/modZScore.js +6 -14
- package/build/cjs/modules/outliers/zScore.js +3 -4
- package/build/cjs/modules/pivotTable/AdaptiveClippingController.js +12 -16
- package/build/cjs/modules/pivotTable/PivotTableEngine.js +48 -59
- package/build/cjs/modules/pivotTable/clipAxis.js +7 -8
- package/build/cjs/modules/pivotTable/clipPartitionedAxis.js +9 -10
- package/build/cjs/modules/pivotTable/getHeaderForDisplay.js +8 -9
- package/build/cjs/modules/pivotTable/measureText.js +7 -9
- package/build/cjs/modules/pivotTable/useParentSize.js +1 -2
- package/build/cjs/modules/pivotTable/useScrollPosition.js +1 -2
- package/build/cjs/modules/pivotTable/useTableClipping.js +6 -7
- package/build/cjs/modules/relativeItems/index.js +1 -4
- package/build/cjs/modules/renderValue.js +1 -2
- package/build/cjs/modules/utils.js +11 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +3 -8
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/axis.js +7 -10
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customAxes.js +2 -5
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/index.js +7 -8
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/getSingleValueBackgroundColor.js +1 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/index.js +6 -7
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getFormatter.js +2 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getSteps.js +2 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +3 -4
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/index.js +8 -10
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legend.js +6 -7
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legendSet.js +22 -26
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/plotOptions.js +8 -9
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/index.js +18 -20
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/pie.js +1 -4
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +1 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +1 -3
- package/build/cjs/visualizations/config/index.js +11 -12
- package/build/cjs/visualizations/config/validators/dhis/index.js +3 -4
- package/build/cjs/visualizations/index.js +1 -4
- package/build/cjs/visualizations/store/adapters/dhis_highcharts/index.js +7 -8
- package/build/cjs/visualizations/store/index.js +15 -17
- package/build/cjs/visualizations/store/validators/dhis/index.js +5 -6
- package/build/cjs/visualizations/util/getFilterText.js +3 -6
- package/build/cjs/visualizations/util/shouldUseContrastColor.js +1 -2
- package/build/es/__demo__/PivotTable.stories.js +165 -222
- package/build/es/api/__tests__/dimensions.spec.js +1 -2
- package/build/es/api/analytics/Analytics.js +8 -9
- package/build/es/api/analytics/AnalyticsBase.js +58 -77
- package/build/es/api/analytics/AnalyticsRequest.js +1 -2
- package/build/es/api/analytics/AnalyticsRequestBase.js +18 -21
- package/build/es/api/analytics/AnalyticsRequestPropertiesMixin.js +19 -38
- package/build/es/api/analytics/AnalyticsResponseHeader.js +5 -7
- package/build/es/api/analytics/__tests__/AnalyticsBase.spec.js +8 -10
- package/build/es/api/analytics/__tests__/AnalyticsRequest.spec.js +8 -2
- package/build/es/api/analytics/utils.js +11 -17
- package/build/es/api/dimensions.js +119 -148
- package/build/es/api/expression.js +39 -60
- package/build/es/api/organisationUnits.js +23 -35
- package/build/es/components/AboutAOUnit/AboutAOUnit.js +11 -18
- package/build/es/components/CachedDataQueryProvider.js +6 -7
- package/build/es/components/DashboardPluginWrapper/DashboardPluginWrapper.js +17 -20
- package/build/es/components/DataDimension/Calculation/CalculationModal.js +43 -59
- package/build/es/components/DataDimension/Calculation/DataElementOption.js +5 -6
- package/build/es/components/DataDimension/Calculation/DataElementSelector.js +28 -36
- package/build/es/components/DataDimension/Calculation/DndContext.js +28 -35
- package/build/es/components/DataDimension/Calculation/DraggingItem.js +5 -6
- package/build/es/components/DataDimension/Calculation/DropZone.js +4 -5
- package/build/es/components/DataDimension/Calculation/FormulaField.js +29 -32
- package/build/es/components/DataDimension/Calculation/FormulaItem.js +13 -14
- package/build/es/components/DataDimension/Calculation/MathOperatorSelector.js +23 -29
- package/build/es/components/DataDimension/Calculation/Operator.js +6 -7
- package/build/es/components/DataDimension/DataDimension.js +19 -30
- package/build/es/components/DataDimension/Info/CalculationInfo.js +13 -20
- package/build/es/components/DataDimension/Info/DataElementInfo.js +23 -36
- package/build/es/components/DataDimension/Info/DataElementOperandInfo.js +29 -42
- package/build/es/components/DataDimension/Info/DataSetInfo.js +26 -39
- package/build/es/components/DataDimension/Info/EventDataItemInfo.js +21 -34
- package/build/es/components/DataDimension/Info/IndicatorInfo.js +20 -30
- package/build/es/components/DataDimension/Info/InfoPopover.js +6 -7
- package/build/es/components/DataDimension/Info/InfoTable.js +39 -52
- package/build/es/components/DataDimension/Info/OptionInfo.js +13 -20
- package/build/es/components/DataDimension/Info/ProgramIndicatorInfo.js +45 -56
- package/build/es/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +21 -30
- package/build/es/components/DataDimension/ItemSelector/DataTypeSelector.js +6 -7
- package/build/es/components/DataDimension/ItemSelector/DetailSelector.js +5 -6
- package/build/es/components/DataDimension/ItemSelector/GroupSelector.js +9 -10
- package/build/es/components/DataDimension/ItemSelector/ItemSelector.js +85 -102
- package/build/es/components/DataDimension/ItemSelector/MetricSelector.js +5 -6
- package/build/es/components/DataDimension/SourceEmptyPlaceholder.js +10 -13
- package/build/es/components/DataDimension/TransferOption.js +35 -39
- package/build/es/components/DimensionMenu.js +13 -14
- package/build/es/components/DimensionsPanel/DimensionsPanel.js +7 -7
- package/build/es/components/DimensionsPanel/List/DimensionItem.js +11 -11
- package/build/es/components/DimensionsPanel/List/DimensionList.js +8 -8
- package/build/es/components/DimensionsPanel/List/OptionsButton.js +8 -11
- package/build/es/components/DimensionsPanel/List/RecommendedIcon.js +10 -13
- package/build/es/components/DynamicDimension/DynamicDimension.js +9 -13
- package/build/es/components/DynamicDimension/ItemSelector.js +24 -36
- package/build/es/components/FileMenu/DeleteDialog.js +10 -14
- package/build/es/components/FileMenu/FileMenu.js +18 -28
- package/build/es/components/FileMenu/GetLinkDialog.js +7 -7
- package/build/es/components/FileMenu/RenameDialog.js +12 -19
- package/build/es/components/FileMenu/SaveAsDialog.js +12 -19
- package/build/es/components/FileMenu/__tests__/FileMenu.spec.js +6 -2
- package/build/es/components/FileMenu/__tests__/GetLinkDialog.spec.js +7 -8
- package/build/es/components/FileMenu/utils.js +10 -12
- package/build/es/components/Filter/Filter.js +21 -27
- package/build/es/components/Interpretations/InterpretationModal/Comment.js +7 -8
- package/build/es/components/Interpretations/InterpretationModal/CommentAddForm.js +9 -13
- package/build/es/components/Interpretations/InterpretationModal/CommentDeleteButton.js +9 -13
- package/build/es/components/Interpretations/InterpretationModal/CommentUpdateForm.js +11 -15
- package/build/es/components/Interpretations/InterpretationModal/InterpretationModal.js +18 -23
- package/build/es/components/Interpretations/InterpretationModal/InterpretationThread.js +11 -12
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationForm.js +11 -15
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationList.js +10 -11
- package/build/es/components/Interpretations/InterpretationsUnit/InterpretationsUnit.js +22 -31
- package/build/es/components/Interpretations/common/Interpretation/Interpretation.js +12 -13
- package/build/es/components/Interpretations/common/Interpretation/InterpretationDeleteButton.js +7 -11
- package/build/es/components/Interpretations/common/Interpretation/InterpretationSharingLink.js +4 -5
- package/build/es/components/Interpretations/common/Interpretation/InterpretationUpdateForm.js +14 -21
- package/build/es/components/Interpretations/common/Interpretation/useLike.js +5 -6
- package/build/es/components/Interpretations/common/Message/Message.js +6 -7
- package/build/es/components/Interpretations/common/Message/MessageButtonStrip.js +8 -11
- package/build/es/components/Interpretations/common/Message/MessageEditorContainer.js +18 -21
- package/build/es/components/Interpretations/common/Message/MessageIconButton.js +34 -40
- package/build/es/components/Interpretations/common/Message/MessageStatsBar.js +8 -11
- package/build/es/components/LegendKey/LegendKey.js +3 -4
- package/build/es/components/OfflineTooltip.js +18 -26
- package/build/es/components/OpenFileDialog/CreatedByFilter.js +20 -26
- package/build/es/components/OpenFileDialog/CustomSelectOption.js +23 -26
- package/build/es/components/OpenFileDialog/DateField.js +3 -4
- package/build/es/components/OpenFileDialog/FileList.js +19 -22
- package/build/es/components/OpenFileDialog/NameFilter.js +15 -21
- package/build/es/components/OpenFileDialog/OpenFileDialog.js +35 -43
- package/build/es/components/OpenFileDialog/PaginationControls.js +22 -28
- package/build/es/components/OpenFileDialog/VisTypeFilter.js +28 -37
- package/build/es/components/Options/VisualizationOptions.js +34 -44
- package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +37 -58
- package/build/es/components/PeriodDimension/FixedPeriodFilter.js +16 -25
- package/build/es/components/PeriodDimension/FixedPeriodSelect.js +14 -19
- package/build/es/components/PeriodDimension/PeriodDimension.js +9 -12
- package/build/es/components/PeriodDimension/PeriodTransfer.js +48 -61
- package/build/es/components/PeriodDimension/RelativePeriodFilter.js +24 -30
- package/build/es/components/PeriodDimension/__tests__/__snapshots__/FixedPeriodSingleSelect.spec.js.snap +0 -1
- package/build/es/components/PeriodDimension/__tests__/__snapshots__/PeriodDimension.spec.js.snap +0 -1
- package/build/es/components/PeriodDimension/utils/fixedPeriods.js +6 -7
- package/build/es/components/PeriodDimension/utils/index.js +1 -5
- package/build/es/components/PivotTable/PivotTable.js +7 -8
- package/build/es/components/PivotTable/PivotTableBody.js +20 -29
- package/build/es/components/PivotTable/PivotTableCell.js +8 -12
- package/build/es/components/PivotTable/PivotTableClippedAxis.js +14 -17
- package/build/es/components/PivotTable/PivotTableColumnHeaderCell.js +7 -8
- package/build/es/components/PivotTable/PivotTableColumnHeaders.js +22 -29
- package/build/es/components/PivotTable/PivotTableContainer.js +5 -6
- package/build/es/components/PivotTable/PivotTableDimensionLabelCell.js +4 -5
- package/build/es/components/PivotTable/PivotTableEmptyCell.js +3 -4
- package/build/es/components/PivotTable/PivotTableEmptyRow.js +4 -5
- package/build/es/components/PivotTable/PivotTableEngineContext.js +4 -5
- package/build/es/components/PivotTable/PivotTableHead.js +13 -16
- package/build/es/components/PivotTable/PivotTableHeaderCell.js +8 -9
- package/build/es/components/PivotTable/PivotTableRow.js +20 -27
- package/build/es/components/PivotTable/PivotTableRowHeaderCell.js +5 -6
- package/build/es/components/PivotTable/PivotTableSortIcon.js +4 -5
- package/build/es/components/PivotTable/PivotTableTitleRow.js +18 -22
- package/build/es/components/PivotTable/PivotTableTitleRows.js +4 -5
- package/build/es/components/PivotTable/PivotTableValueCell.js +5 -6
- package/build/es/components/RichText/Editor/Editor.js +69 -83
- package/build/es/components/RichText/Parser/Parser.js +4 -8
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuBar.js +20 -23
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +7 -11
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuList.js +8 -15
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuListItem.js +10 -14
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuBar.spec.js +4 -5
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuList.spec.js +6 -4
- package/build/es/components/Toolbar/InterpretationsAndDetailsToggler.js +15 -21
- package/build/es/components/Toolbar/Toolbar.js +10 -16
- package/build/es/components/Toolbar/ToolbarSidebar.js +12 -18
- package/build/es/components/Toolbar/UpdateButton.js +18 -24
- package/build/es/components/TransferOption.js +14 -15
- package/build/es/components/TranslationDialog/TranslationModal/LocalesSelect.js +19 -27
- package/build/es/components/TranslationDialog/TranslationModal/TranslationForm.js +16 -23
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModal.js +6 -7
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
- package/build/es/components/TranslationDialog/TranslationModal/useTranslationsResults.js +3 -4
- package/build/es/components/UserMention/UserList.js +6 -7
- package/build/es/components/UserMention/UserMentionWrapper.js +12 -18
- package/build/es/components/UserMention/useUserSearchResults.js +12 -16
- package/build/es/components/VisTypeIcon.js +5 -6
- package/build/es/locales/ar_IQ/translations.json +20 -11
- package/build/es/locales/cs/translations.json +2 -0
- package/build/es/locales/en/translations.json +1 -0
- package/build/es/locales/es/translations.json +2 -0
- package/build/es/locales/fr/translations.json +2 -0
- package/build/es/locales/id/translations.json +20 -11
- package/build/es/locales/lo/translations.json +2 -0
- package/build/es/locales/nb/translations.json +2 -0
- package/build/es/locales/prs/translations.json +2 -0
- package/build/es/locales/ps/translations.json +2 -0
- package/build/es/locales/pt/translations.json +2 -0
- package/build/es/locales/pt_BR/translations.json +2 -0
- package/build/es/locales/ru/translations.json +2 -0
- package/build/es/locales/si/translations.json +20 -11
- package/build/es/locales/sv/translations.json +20 -11
- package/build/es/locales/tet/translations.json +20 -11
- package/build/es/locales/tg/translations.json +2 -0
- package/build/es/locales/uk/translations.json +2 -0
- package/build/es/locales/ur/translations.json +2 -0
- package/build/es/locales/uz_UZ_Cyrl/translations.json +2 -0
- package/build/es/locales/uz_UZ_Latn/translations.json +4 -2
- package/build/es/locales/vi/translations.json +2 -0
- package/build/es/locales/zh/translations.json +2 -0
- package/build/es/locales/zh_CN/translations.json +17 -15
- package/build/es/modules/__tests__/expressions.spec.js +4 -5
- package/build/es/modules/__tests__/isNumeric.spec.js +31 -0
- package/build/es/modules/dimensionListItem.js +4 -5
- package/build/es/modules/expressions.js +3 -9
- package/build/es/modules/getPWAInstallationStatus.js +7 -9
- package/build/es/modules/layout/dimensionCreate.js +1 -3
- package/build/es/modules/layout/dimensionIsValid.js +3 -4
- package/build/es/modules/legends.js +5 -6
- package/build/es/modules/outliers/index.js +2 -3
- package/build/es/modules/outliers/iqr.js +4 -6
- package/build/es/modules/outliers/modZScore.js +6 -14
- package/build/es/modules/outliers/zScore.js +3 -4
- package/build/es/modules/pivotTable/AdaptiveClippingController.js +12 -16
- package/build/es/modules/pivotTable/PivotTableEngine.js +48 -59
- package/build/es/modules/pivotTable/clipAxis.js +7 -8
- package/build/es/modules/pivotTable/clipPartitionedAxis.js +9 -10
- package/build/es/modules/pivotTable/getHeaderForDisplay.js +8 -9
- package/build/es/modules/pivotTable/measureText.js +7 -9
- package/build/es/modules/pivotTable/useParentSize.js +1 -2
- package/build/es/modules/pivotTable/useScrollPosition.js +1 -2
- package/build/es/modules/pivotTable/useTableClipping.js +6 -7
- package/build/es/modules/relativeItems/index.js +1 -4
- package/build/es/modules/renderValue.js +1 -2
- package/build/es/modules/utils.js +9 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +3 -8
- package/build/es/visualizations/config/adapters/dhis_highcharts/axis.js +2 -5
- package/build/es/visualizations/config/adapters/dhis_highcharts/customAxes.js +2 -5
- package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/index.js +7 -8
- package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/getSingleValueBackgroundColor.js +1 -2
- package/build/es/visualizations/config/adapters/dhis_highcharts/customSVGOptions/singleValue/index.js +6 -7
- package/build/es/visualizations/config/adapters/dhis_highcharts/getFormatter.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/getSteps.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +3 -4
- package/build/es/visualizations/config/adapters/dhis_highcharts/index.js +7 -8
- package/build/es/visualizations/config/adapters/dhis_highcharts/legend.js +6 -7
- package/build/es/visualizations/config/adapters/dhis_highcharts/legendSet.js +22 -26
- package/build/es/visualizations/config/adapters/dhis_highcharts/plotOptions.js +8 -9
- package/build/es/visualizations/config/adapters/dhis_highcharts/series/index.js +18 -20
- package/build/es/visualizations/config/adapters/dhis_highcharts/series/pie.js +1 -4
- package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +1 -3
- package/build/es/visualizations/config/index.js +11 -12
- package/build/es/visualizations/config/validators/dhis/index.js +3 -4
- package/build/es/visualizations/index.js +1 -4
- package/build/es/visualizations/store/adapters/dhis_highcharts/index.js +7 -8
- package/build/es/visualizations/store/index.js +15 -17
- package/build/es/visualizations/store/validators/dhis/index.js +5 -6
- package/build/es/visualizations/util/getFilterText.js +3 -6
- package/build/es/visualizations/util/shouldUseContrastColor.js +1 -2
- package/package.json +12 -12
|
@@ -6,23 +6,25 @@ import { getPWAInstallationStatus } from '../../modules/getPWAInstallationStatus
|
|
|
6
6
|
const LoadingMask = () => {
|
|
7
7
|
return /*#__PURE__*/React.createElement(Layer, null, /*#__PURE__*/React.createElement(CenteredContent, null, /*#__PURE__*/React.createElement(CircularLoader, null)));
|
|
8
8
|
};
|
|
9
|
-
const CacheableSectionWrapper =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} = _ref;
|
|
9
|
+
const CacheableSectionWrapper = ({
|
|
10
|
+
id,
|
|
11
|
+
children,
|
|
12
|
+
isParentCached = false
|
|
13
|
+
}) => {
|
|
15
14
|
const {
|
|
16
15
|
startRecording,
|
|
17
16
|
isCached,
|
|
18
17
|
remove
|
|
19
18
|
} = useCacheableSection(id);
|
|
20
19
|
useEffect(() => {
|
|
21
|
-
|
|
20
|
+
const shouldStartRecording = isParentCached && !isCached;
|
|
21
|
+
const shouldRemove = !isParentCached && isCached;
|
|
22
|
+
if (shouldStartRecording) {
|
|
22
23
|
startRecording({
|
|
23
24
|
onError: console.error
|
|
24
25
|
});
|
|
25
|
-
}
|
|
26
|
+
}
|
|
27
|
+
if (shouldRemove) {
|
|
26
28
|
// Synchronize cache state on load or prop update
|
|
27
29
|
// -- a back-up to imperative `removeCachedData`
|
|
28
30
|
remove();
|
|
@@ -38,14 +40,13 @@ CacheableSectionWrapper.propTypes = {
|
|
|
38
40
|
id: PropTypes.string,
|
|
39
41
|
isParentCached: PropTypes.bool
|
|
40
42
|
};
|
|
41
|
-
export const DashboardPluginWrapper =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
} = _ref2;
|
|
43
|
+
export const DashboardPluginWrapper = ({
|
|
44
|
+
onInstallationStatusChange = Function.prototype,
|
|
45
|
+
children,
|
|
46
|
+
cacheId,
|
|
47
|
+
isParentCached = false,
|
|
48
|
+
...props
|
|
49
|
+
}) => {
|
|
49
50
|
const {
|
|
50
51
|
pwaEnabled
|
|
51
52
|
} = useConfig();
|
|
@@ -70,10 +71,6 @@ export const DashboardPluginWrapper = _ref2 => {
|
|
|
70
71
|
elevations: true
|
|
71
72
|
})) : null;
|
|
72
73
|
};
|
|
73
|
-
DashboardPluginWrapper.defaultProps = {
|
|
74
|
-
isParentCached: false,
|
|
75
|
-
onInstallationStatusChange: Function.prototype
|
|
76
|
-
};
|
|
77
74
|
DashboardPluginWrapper.propTypes = {
|
|
78
75
|
cacheId: PropTypes.string,
|
|
79
76
|
children: PropTypes.func,
|
|
@@ -15,14 +15,14 @@ import MathOperatorSelector from './MathOperatorSelector.js';
|
|
|
15
15
|
import styles from './styles/CalculationModal.style.js';
|
|
16
16
|
const FIRST_POSITION = 0;
|
|
17
17
|
const LAST_POSITION = -1;
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
const CALCULATION_PROP_DEFAULT = {};
|
|
19
|
+
const CalculationModal = ({
|
|
20
|
+
calculation = CALCULATION_PROP_DEFAULT,
|
|
21
|
+
onSave,
|
|
22
|
+
onClose,
|
|
23
|
+
onDelete,
|
|
24
|
+
displayNameProp
|
|
25
|
+
}) => {
|
|
26
26
|
const {
|
|
27
27
|
show: showError
|
|
28
28
|
} = useAlert(error => error, {
|
|
@@ -48,29 +48,23 @@ const CalculationModal = _ref => {
|
|
|
48
48
|
const query = {
|
|
49
49
|
dataElements: {
|
|
50
50
|
resource: 'dataElements',
|
|
51
|
-
params:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
paging: false
|
|
59
|
-
};
|
|
60
|
-
}
|
|
51
|
+
params: ({
|
|
52
|
+
ids = []
|
|
53
|
+
}) => ({
|
|
54
|
+
fields: `id,${displayNameProp}~rename(name)`,
|
|
55
|
+
filter: `id:in:[${ids.join(',')}]`,
|
|
56
|
+
paging: false
|
|
57
|
+
})
|
|
61
58
|
},
|
|
62
59
|
dataElementOperands: {
|
|
63
60
|
resource: 'dataElementOperands',
|
|
64
|
-
params:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
paging: false
|
|
72
|
-
};
|
|
73
|
-
}
|
|
61
|
+
params: ({
|
|
62
|
+
ids = []
|
|
63
|
+
}) => ({
|
|
64
|
+
fields: `id,${displayNameProp}~rename(name)`,
|
|
65
|
+
filter: `id:in:[${ids.join(',')}]`,
|
|
66
|
+
paging: false
|
|
67
|
+
})
|
|
74
68
|
}
|
|
75
69
|
};
|
|
76
70
|
const {
|
|
@@ -115,13 +109,12 @@ const CalculationModal = _ref => {
|
|
|
115
109
|
const expressionStatus = validationOutput === null || validationOutput === void 0 ? void 0 : validationOutput.status;
|
|
116
110
|
const selectItem = itemId => setSelectedItemId(prevSelected => prevSelected !== itemId ? itemId : null);
|
|
117
111
|
const isLoading = isCreatingCalculation || isUpdatingCalculation || isDeletingCalculation || isSavingCalculation || isValidating;
|
|
118
|
-
const addItem =
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
} = _ref4;
|
|
112
|
+
const addItem = ({
|
|
113
|
+
label,
|
|
114
|
+
value,
|
|
115
|
+
type,
|
|
116
|
+
destIndex = LAST_POSITION
|
|
117
|
+
}) => {
|
|
125
118
|
if (isLoading) {
|
|
126
119
|
return null;
|
|
127
120
|
}
|
|
@@ -146,11 +139,10 @@ const CalculationModal = _ref => {
|
|
|
146
139
|
setFocusItemId(newItem.id);
|
|
147
140
|
}
|
|
148
141
|
};
|
|
149
|
-
const moveItem =
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
} = _ref5;
|
|
142
|
+
const moveItem = ({
|
|
143
|
+
sourceIndex,
|
|
144
|
+
destIndex
|
|
145
|
+
}) => {
|
|
154
146
|
if (isLoading) {
|
|
155
147
|
return null;
|
|
156
148
|
}
|
|
@@ -160,11 +152,10 @@ const CalculationModal = _ref => {
|
|
|
160
152
|
sourceList.splice(destIndex, 0, moved);
|
|
161
153
|
setExpressionArray(sourceList);
|
|
162
154
|
};
|
|
163
|
-
const setItemValue =
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
} = _ref6;
|
|
155
|
+
const setItemValue = ({
|
|
156
|
+
itemId,
|
|
157
|
+
value
|
|
158
|
+
}) => {
|
|
168
159
|
const updatedItems = expressionArray.map(item => item.id === itemId ? Object.assign({}, item, {
|
|
169
160
|
value
|
|
170
161
|
}) : item);
|
|
@@ -180,11 +171,10 @@ const CalculationModal = _ref => {
|
|
|
180
171
|
setSelectedItemId(null);
|
|
181
172
|
}
|
|
182
173
|
};
|
|
183
|
-
const addOrMoveDraggedItem =
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
} = _ref7;
|
|
174
|
+
const addOrMoveDraggedItem = ({
|
|
175
|
+
item,
|
|
176
|
+
destination
|
|
177
|
+
}) => {
|
|
188
178
|
const destContainerId = destination.containerId;
|
|
189
179
|
let destIndex = FIRST_POSITION;
|
|
190
180
|
if (item.sourceContainerId === OPTIONS_PANEL) {
|
|
@@ -325,12 +315,9 @@ const CalculationModal = _ref => {
|
|
|
325
315
|
}, /*#__PURE__*/React.createElement(InputField, {
|
|
326
316
|
label: i18n.t('Calculation name'),
|
|
327
317
|
helpText: i18n.t('Shown in table headers and chart axes/legends'),
|
|
328
|
-
onChange:
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
} = _ref8;
|
|
332
|
-
return setName(value.substr(0, 50));
|
|
333
|
-
},
|
|
318
|
+
onChange: ({
|
|
319
|
+
value
|
|
320
|
+
}) => setName(value.substr(0, 50)),
|
|
334
321
|
value: name,
|
|
335
322
|
dataTest: "calculation-label",
|
|
336
323
|
dense: true
|
|
@@ -385,7 +372,4 @@ CalculationModal.propTypes = {
|
|
|
385
372
|
name: PropTypes.string
|
|
386
373
|
})
|
|
387
374
|
};
|
|
388
|
-
CalculationModal.defaultProps = {
|
|
389
|
-
calculation: {}
|
|
390
|
-
};
|
|
391
375
|
export default CalculationModal;
|
|
@@ -8,12 +8,11 @@ import { DIMENSION_TYPE_DATA_ELEMENT } from '../../../modules/dataTypes.js';
|
|
|
8
8
|
import { getIcon } from '../../../modules/dimensionListItem.js';
|
|
9
9
|
import { EXPRESSION_TYPE_DATA } from '../../../modules/expressions.js';
|
|
10
10
|
import styles from './styles/DataElementOption.style.js';
|
|
11
|
-
const DataElementOption =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} = _ref;
|
|
11
|
+
const DataElementOption = ({
|
|
12
|
+
label,
|
|
13
|
+
value,
|
|
14
|
+
onDoubleClick
|
|
15
|
+
}) => {
|
|
17
16
|
const data = {
|
|
18
17
|
label,
|
|
19
18
|
value,
|
|
@@ -15,13 +15,12 @@ const getOptions = () => ({
|
|
|
15
15
|
[TOTALS]: i18n.t('Totals only'),
|
|
16
16
|
[DETAIL]: i18n.t('Details only')
|
|
17
17
|
});
|
|
18
|
-
const GroupSelector =
|
|
18
|
+
const GroupSelector = ({
|
|
19
|
+
currentValue,
|
|
20
|
+
onChange,
|
|
21
|
+
displayNameProp
|
|
22
|
+
}) => {
|
|
19
23
|
var _dataTypes$DIMENSION_;
|
|
20
|
-
let {
|
|
21
|
-
currentValue,
|
|
22
|
-
onChange,
|
|
23
|
-
displayNameProp
|
|
24
|
-
} = _ref;
|
|
25
24
|
const dataEngine = useDataEngine();
|
|
26
25
|
const [loading, setLoading] = useState(true);
|
|
27
26
|
const [groups, setGroups] = useState([]);
|
|
@@ -63,11 +62,10 @@ GroupSelector.propTypes = {
|
|
|
63
62
|
displayNameProp: PropTypes.string.isRequired,
|
|
64
63
|
onChange: PropTypes.func.isRequired
|
|
65
64
|
};
|
|
66
|
-
const DisaggregationSelector =
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
} = _ref2;
|
|
65
|
+
const DisaggregationSelector = ({
|
|
66
|
+
currentValue,
|
|
67
|
+
onChange
|
|
68
|
+
}) => {
|
|
71
69
|
const options = getOptions();
|
|
72
70
|
return /*#__PURE__*/React.createElement("div", {
|
|
73
71
|
className: `jsx-${styles.__hash}` + " " + "group-select"
|
|
@@ -89,11 +87,10 @@ DisaggregationSelector.propTypes = {
|
|
|
89
87
|
currentValue: PropTypes.string.isRequired,
|
|
90
88
|
onChange: PropTypes.func.isRequired
|
|
91
89
|
};
|
|
92
|
-
const DataElementSelector =
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
} = _ref3;
|
|
90
|
+
const DataElementSelector = ({
|
|
91
|
+
displayNameProp,
|
|
92
|
+
onDoubleClick
|
|
93
|
+
}) => {
|
|
97
94
|
const dataEngine = useDataEngine();
|
|
98
95
|
const [searchTerm, setSearchTerm] = useState('');
|
|
99
96
|
const [group, setGroup] = useState(DIMENSION_TYPE_ALL);
|
|
@@ -150,10 +147,9 @@ const DataElementSelector = _ref3 => {
|
|
|
150
147
|
searchTermRef.current = newSearchTerm;
|
|
151
148
|
fetchData(true);
|
|
152
149
|
}, 500);
|
|
153
|
-
const onSearchChange =
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
} = _ref4;
|
|
150
|
+
const onSearchChange = ({
|
|
151
|
+
value
|
|
152
|
+
}) => {
|
|
157
153
|
const newSearchTerm = value;
|
|
158
154
|
setSearchTerm(newSearchTerm);
|
|
159
155
|
|
|
@@ -173,10 +169,9 @@ const DataElementSelector = _ref3 => {
|
|
|
173
169
|
pageRef.current = 1;
|
|
174
170
|
fetchData(true);
|
|
175
171
|
};
|
|
176
|
-
const onEndReached =
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
} = _ref5;
|
|
172
|
+
const onEndReached = ({
|
|
173
|
+
isIntersecting
|
|
174
|
+
}) => {
|
|
180
175
|
if (isIntersecting) {
|
|
181
176
|
// if hasNextPage is set it means at least 1 request already happened and there is
|
|
182
177
|
// another page, fetch the next page
|
|
@@ -233,18 +228,15 @@ const DataElementSelector = _ref3 => {
|
|
|
233
228
|
className: `jsx-${styles.__hash}` + " " + (cx('dimension-list-scroller', {
|
|
234
229
|
loading
|
|
235
230
|
}) || "")
|
|
236
|
-
}, Boolean(options.length) && options.map(
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
onDoubleClick: onDoubleClick
|
|
246
|
-
});
|
|
247
|
-
}), !loading && !options.length && /*#__PURE__*/React.createElement("div", {
|
|
231
|
+
}, Boolean(options.length) && options.map(({
|
|
232
|
+
label,
|
|
233
|
+
value
|
|
234
|
+
}) => /*#__PURE__*/React.createElement(DataElementOption, {
|
|
235
|
+
key: value,
|
|
236
|
+
label: label,
|
|
237
|
+
value: value,
|
|
238
|
+
onDoubleClick: onDoubleClick
|
|
239
|
+
})), !loading && !options.length && /*#__PURE__*/React.createElement("div", {
|
|
248
240
|
className: `jsx-${styles.__hash}` + " " + "empty-list"
|
|
249
241
|
}, searchTermRef.current ? i18n.t('No data elements found for "{{- searchTerm}}"', {
|
|
250
242
|
searchTerm: searchTermRef.current
|
|
@@ -23,24 +23,21 @@ const getIntersectionRatio = (entry, target) => {
|
|
|
23
23
|
|
|
24
24
|
return 0;
|
|
25
25
|
};
|
|
26
|
-
const sortCollisionsDesc = (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
} = _ref2;
|
|
26
|
+
const sortCollisionsDesc = ({
|
|
27
|
+
data: {
|
|
28
|
+
value: a
|
|
29
|
+
}
|
|
30
|
+
}, {
|
|
31
|
+
data: {
|
|
32
|
+
value: b
|
|
33
|
+
}
|
|
34
|
+
}) => {
|
|
37
35
|
return b - a;
|
|
38
36
|
};
|
|
39
|
-
const rectIntersectionCustom =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} = _ref3;
|
|
37
|
+
const rectIntersectionCustom = ({
|
|
38
|
+
pointerCoordinates,
|
|
39
|
+
droppableContainers
|
|
40
|
+
}) => {
|
|
44
41
|
// create a rect around the pointerCoords for calculating the intersection
|
|
45
42
|
|
|
46
43
|
const pointerRectWidth = 40;
|
|
@@ -88,22 +85,20 @@ const isInteractiveElement = el => {
|
|
|
88
85
|
class PointerSensor extends DndKitPointerSensor {}
|
|
89
86
|
_defineProperty(PointerSensor, "activators", [{
|
|
90
87
|
eventName: 'onPointerDown',
|
|
91
|
-
handler:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
} = _ref7;
|
|
88
|
+
handler: ({
|
|
89
|
+
nativeEvent: event
|
|
90
|
+
}) => {
|
|
95
91
|
if (!event.isPrimary || event.button !== 0 || isInteractiveElement(event.target)) {
|
|
96
92
|
return false;
|
|
97
93
|
}
|
|
98
94
|
return true;
|
|
99
95
|
}
|
|
100
96
|
}]);
|
|
101
|
-
const OuterDndContext =
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
} = _ref4;
|
|
97
|
+
const OuterDndContext = ({
|
|
98
|
+
children,
|
|
99
|
+
onDragEnd,
|
|
100
|
+
onDragStart
|
|
101
|
+
}) => {
|
|
107
102
|
const [draggingItem, setDraggingItem] = useState(null);
|
|
108
103
|
const sensor = useSensor(PointerSensor, {
|
|
109
104
|
activationConstraint: {
|
|
@@ -111,22 +106,20 @@ const OuterDndContext = _ref4 => {
|
|
|
111
106
|
}
|
|
112
107
|
});
|
|
113
108
|
const sensors = useSensors(sensor);
|
|
114
|
-
const handleDragStart =
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
} = _ref5;
|
|
109
|
+
const handleDragStart = ({
|
|
110
|
+
active
|
|
111
|
+
}) => {
|
|
118
112
|
setDraggingItem(active.data.current);
|
|
119
113
|
onDragStart && onDragStart();
|
|
120
114
|
};
|
|
121
115
|
const handleDragCancel = () => {
|
|
122
116
|
setDraggingItem(null);
|
|
123
117
|
};
|
|
124
|
-
const handleDragEnd =
|
|
118
|
+
const handleDragEnd = ({
|
|
119
|
+
active,
|
|
120
|
+
over
|
|
121
|
+
}) => {
|
|
125
122
|
var _over$data, _over$data$current, _over$data$current$so, _over$data$current2, _over$data$current3;
|
|
126
|
-
let {
|
|
127
|
-
active,
|
|
128
|
-
over
|
|
129
|
-
} = _ref6;
|
|
130
123
|
if (!(over !== null && over !== void 0 && over.id) || (over === null || over === void 0 ? void 0 : (_over$data = over.data) === null || _over$data === void 0 ? void 0 : (_over$data$current = _over$data.current) === null || _over$data$current === void 0 ? void 0 : (_over$data$current$so = _over$data$current.sortable) === null || _over$data$current$so === void 0 ? void 0 : _over$data$current$so.containerId) === OPTIONS_PANEL || !active.data.current) {
|
|
131
124
|
// dropped over non-droppable or over options panel
|
|
132
125
|
handleDragCancel();
|
|
@@ -7,12 +7,11 @@ import { getIcon } from '../../../modules/dimensionListItem.js';
|
|
|
7
7
|
import { EXPRESSION_TYPE_DATA, EXPRESSION_TYPE_NUMBER, EXPRESSION_TYPE_OPERATOR } from '../../../modules/expressions.js';
|
|
8
8
|
import styles from './styles/DraggingItem.style.js';
|
|
9
9
|
import formulaItemStyles from './styles/FormulaItem.style.js';
|
|
10
|
-
const DraggingItem =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} = _ref;
|
|
10
|
+
const DraggingItem = ({
|
|
11
|
+
label,
|
|
12
|
+
type,
|
|
13
|
+
value
|
|
14
|
+
}) => {
|
|
16
15
|
const displayLabel = type === EXPRESSION_TYPE_NUMBER ? value || label : label;
|
|
17
16
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
18
17
|
className: `jsx-${styles.__hash} jsx-${formulaItemStyles.__hash}` + " " + (cx('dragging', 'content', {
|
|
@@ -4,11 +4,10 @@ import cx from 'classnames';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import styles from './styles/DropZone.style.js';
|
|
7
|
-
const DropZone =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} = _ref;
|
|
7
|
+
const DropZone = ({
|
|
8
|
+
firstElementId,
|
|
9
|
+
overLastDropZone
|
|
10
|
+
}) => {
|
|
12
11
|
const {
|
|
13
12
|
isOver,
|
|
14
13
|
setNodeRef,
|
|
@@ -19,16 +19,16 @@ const Placeholder = () => /*#__PURE__*/React.createElement("div", {
|
|
|
19
19
|
}, i18n.t('Drag items here, or double click in the list, to start building a calculation formula')), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
20
20
|
id: styles.__hash
|
|
21
21
|
}, styles));
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
const ITEMS_PROP_DEFAULT = [];
|
|
23
|
+
const FormulaField = ({
|
|
24
|
+
items = ITEMS_PROP_DEFAULT,
|
|
25
|
+
selectedItemId,
|
|
26
|
+
focusItemId,
|
|
27
|
+
onChange,
|
|
28
|
+
onClick,
|
|
29
|
+
onDoubleClick,
|
|
30
|
+
loading
|
|
31
|
+
}) => {
|
|
32
32
|
const {
|
|
33
33
|
over,
|
|
34
34
|
setNodeRef: setLastDropzoneRef
|
|
@@ -53,28 +53,25 @@ const FormulaField = _ref => {
|
|
|
53
53
|
}, /*#__PURE__*/React.createElement(DropZone, {
|
|
54
54
|
firstElementId: itemIds[0],
|
|
55
55
|
overLastDropZone: overLastDropZone
|
|
56
|
-
}), !items.length && /*#__PURE__*/React.createElement(Placeholder, null), Boolean(items.length) && items.map((
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
overLastDropZone: overLastDropZone
|
|
76
|
-
});
|
|
77
|
-
}))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
56
|
+
}), !items.length && /*#__PURE__*/React.createElement(Placeholder, null), Boolean(items.length) && items.map(({
|
|
57
|
+
id,
|
|
58
|
+
label,
|
|
59
|
+
type,
|
|
60
|
+
value
|
|
61
|
+
}, index) => /*#__PURE__*/React.createElement(FormulaItem, {
|
|
62
|
+
key: id,
|
|
63
|
+
id: id,
|
|
64
|
+
label: label,
|
|
65
|
+
type: type,
|
|
66
|
+
value: value,
|
|
67
|
+
hasFocus: focusItemId === id,
|
|
68
|
+
isHighlighted: selectedItemId === id,
|
|
69
|
+
isLast: index === items.length - 1,
|
|
70
|
+
onChange: onChange,
|
|
71
|
+
onClick: onClick,
|
|
72
|
+
onDoubleClick: onDoubleClick,
|
|
73
|
+
overLastDropZone: overLastDropZone
|
|
74
|
+
})))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
78
75
|
id: styles.__hash
|
|
79
76
|
}, styles));
|
|
80
77
|
};
|
|
@@ -15,20 +15,19 @@ const BEFORE = 'BEFORE';
|
|
|
15
15
|
const AFTER = 'AFTER';
|
|
16
16
|
const maxMsBetweenClicks = 300;
|
|
17
17
|
const TAG_INPUT = 'INPUT';
|
|
18
|
-
const FormulaItem =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} = _ref;
|
|
18
|
+
const FormulaItem = ({
|
|
19
|
+
id,
|
|
20
|
+
label,
|
|
21
|
+
value = '',
|
|
22
|
+
type,
|
|
23
|
+
isLast,
|
|
24
|
+
isHighlighted,
|
|
25
|
+
overLastDropZone,
|
|
26
|
+
onChange,
|
|
27
|
+
onClick,
|
|
28
|
+
onDoubleClick,
|
|
29
|
+
hasFocus
|
|
30
|
+
}) => {
|
|
32
31
|
const {
|
|
33
32
|
attributes,
|
|
34
33
|
listeners,
|
|
@@ -5,35 +5,29 @@ import i18n from '../../../locales/index.js';
|
|
|
5
5
|
import { getOperators } from '../../../modules/expressions.js';
|
|
6
6
|
import DraggableOperator from './Operator.js';
|
|
7
7
|
import styles from './styles/MathOperatorSelector.style.js';
|
|
8
|
-
const MathOperatorSelector =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
onDoubleClick: onDoubleClick
|
|
32
|
-
});
|
|
33
|
-
}))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
34
|
-
id: styles.__hash
|
|
35
|
-
}, styles));
|
|
36
|
-
};
|
|
8
|
+
const MathOperatorSelector = ({
|
|
9
|
+
onDoubleClick
|
|
10
|
+
}) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
className: `jsx-${styles.__hash}` + " " + "wrapper"
|
|
12
|
+
}, /*#__PURE__*/React.createElement("h4", {
|
|
13
|
+
className: `jsx-${styles.__hash}` + " " + "sub-header"
|
|
14
|
+
}, i18n.t('Math operators')), /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
"data-test": "operators-list",
|
|
16
|
+
className: `jsx-${styles.__hash}` + " " + "operators"
|
|
17
|
+
}, getOperators().map(({
|
|
18
|
+
label,
|
|
19
|
+
value,
|
|
20
|
+
type
|
|
21
|
+
}, index) => /*#__PURE__*/React.createElement(DraggableOperator, {
|
|
22
|
+
key: `${label}-${index}`,
|
|
23
|
+
label: label,
|
|
24
|
+
value: value,
|
|
25
|
+
type: type,
|
|
26
|
+
index: index,
|
|
27
|
+
onDoubleClick: onDoubleClick
|
|
28
|
+
})))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
29
|
+
id: styles.__hash
|
|
30
|
+
}, styles));
|
|
37
31
|
MathOperatorSelector.propTypes = {
|
|
38
32
|
onDoubleClick: PropTypes.func.isRequired
|
|
39
33
|
};
|
|
@@ -8,13 +8,12 @@ import React from 'react';
|
|
|
8
8
|
import { EXPRESSION_TYPE_NUMBER, EXPRESSION_TYPE_OPERATOR } from '../../../modules/expressions.js';
|
|
9
9
|
import formulaItemStyles from './styles/FormulaItem.style.js';
|
|
10
10
|
import styles from './styles/Operator.style.js';
|
|
11
|
-
const Operator =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = _ref;
|
|
11
|
+
const Operator = ({
|
|
12
|
+
label,
|
|
13
|
+
value,
|
|
14
|
+
type,
|
|
15
|
+
onDoubleClick
|
|
16
|
+
}) => {
|
|
18
17
|
const data = {
|
|
19
18
|
label,
|
|
20
19
|
value,
|