@dhis2/analytics 28.0.2 → 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 +3 -4
- package/build/cjs/__demo__/Filter.stories.js +1 -2
- package/build/cjs/__demo__/FixedPeriodSelect.stories.js +1 -2
- package/build/cjs/__demo__/OpenFileDialog.stories.js +2 -2
- package/build/cjs/__demo__/OrgUnitDimension.stories.js +3 -4
- package/build/cjs/__demo__/PeriodDimension.stories.js +2 -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 +8 -10
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
- package/build/cjs/components/TranslationDialog/TranslationModal/__tests__/TranslationModal.spec.js +52 -0
- 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__/DataDimension.stories.js +2 -2
- package/build/es/__demo__/OpenFileDialog.stories.js +2 -2
- package/build/es/__demo__/OrgUnitDimension.stories.js +2 -2
- package/build/es/__demo__/PeriodDimension.stories.js +2 -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 +7 -8
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModalActions.js +18 -27
- package/build/es/components/TranslationDialog/TranslationModal/__tests__/TranslationModal.spec.js +49 -0
- 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
|
@@ -5,13 +5,12 @@ import React, { useRef, useState, useEffect } from 'react';
|
|
|
5
5
|
import { PivotTableCell } from './PivotTableCell.js';
|
|
6
6
|
import { usePivotTableEngine } from './PivotTableEngineContext.js';
|
|
7
7
|
import { cell as cellStyle } from './styles/PivotTable.style.js';
|
|
8
|
-
export const PivotTableTitleRow =
|
|
8
|
+
export const PivotTableTitleRow = ({
|
|
9
|
+
title,
|
|
10
|
+
scrollPosition,
|
|
11
|
+
containerWidth
|
|
12
|
+
}) => {
|
|
9
13
|
var _scrollPosition$x;
|
|
10
|
-
let {
|
|
11
|
-
title,
|
|
12
|
-
scrollPosition,
|
|
13
|
-
containerWidth
|
|
14
|
-
} = _ref;
|
|
15
14
|
const containerRef = useRef(null);
|
|
16
15
|
const [scrollWidth, setScrollWidth] = useState(0);
|
|
17
16
|
const [isTitleTruncated, setIsTitleTruncated] = useState(false);
|
|
@@ -54,22 +53,19 @@ export const PivotTableTitleRow = _ref => {
|
|
|
54
53
|
className: `jsx-${cellStyle.__hash}` + " " + "title-cell-content"
|
|
55
54
|
}, isTitleTruncated ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
56
55
|
content: title
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
className: `jsx-${cellStyle.__hash}` + " " + "title-cell-content"
|
|
71
|
-
}, title);
|
|
72
|
-
}) : title)));
|
|
56
|
+
}, ({
|
|
57
|
+
ref: tooltipRef,
|
|
58
|
+
onMouseOver,
|
|
59
|
+
onMouseOut
|
|
60
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
ref: tooltipRef,
|
|
62
|
+
onMouseOver: onMouseOver,
|
|
63
|
+
onMouseOut: onMouseOut,
|
|
64
|
+
style: {
|
|
65
|
+
maxWidth
|
|
66
|
+
},
|
|
67
|
+
className: `jsx-${cellStyle.__hash}` + " " + "title-cell-content"
|
|
68
|
+
}, title)) : title)));
|
|
73
69
|
};
|
|
74
70
|
PivotTableTitleRow.propTypes = {
|
|
75
71
|
containerWidth: PropTypes.number.isRequired,
|
|
@@ -3,12 +3,11 @@ import React from 'react';
|
|
|
3
3
|
import getFilterText from '../../visualizations/util/getFilterText.js';
|
|
4
4
|
import { usePivotTableEngine } from './PivotTableEngineContext.js';
|
|
5
5
|
import { PivotTableTitleRow } from './PivotTableTitleRow.js';
|
|
6
|
-
export const PivotTableTitleRows =
|
|
6
|
+
export const PivotTableTitleRows = ({
|
|
7
|
+
clippingResult,
|
|
8
|
+
width
|
|
9
|
+
}) => {
|
|
7
10
|
var _engine$visualization;
|
|
8
|
-
let {
|
|
9
|
-
clippingResult,
|
|
10
|
-
width
|
|
11
|
-
} = _ref;
|
|
12
11
|
const engine = usePivotTableEngine();
|
|
13
12
|
return /*#__PURE__*/React.createElement(React.Fragment, null, engine.options.title ? /*#__PURE__*/React.createElement(PivotTableTitleRow, {
|
|
14
13
|
title: engine.options.title,
|
|
@@ -7,13 +7,12 @@ import { isNumericValueType, isBooleanValueType } from '../../modules/valueTypes
|
|
|
7
7
|
import { PivotTableCell } from './PivotTableCell.js';
|
|
8
8
|
import { PivotTableEmptyCell } from './PivotTableEmptyCell.js';
|
|
9
9
|
import { usePivotTableEngine } from './PivotTableEngineContext.js';
|
|
10
|
-
export const PivotTableValueCell =
|
|
10
|
+
export const PivotTableValueCell = ({
|
|
11
|
+
row,
|
|
12
|
+
column,
|
|
13
|
+
onToggleContextualMenu
|
|
14
|
+
}) => {
|
|
11
15
|
var _cellContent$titleVal, _cellContent$rendered;
|
|
12
|
-
let {
|
|
13
|
-
row,
|
|
14
|
-
column,
|
|
15
|
-
onToggleContextualMenu
|
|
16
|
-
} = _ref;
|
|
17
16
|
const engine = usePivotTableEngine();
|
|
18
17
|
const cellRef = useRef(undefined);
|
|
19
18
|
const cellContent = engine.get({
|
|
@@ -8,85 +8,76 @@ import { UserMentionWrapper } from '../../UserMention/UserMentionWrapper.js';
|
|
|
8
8
|
import { Parser } from '../Parser/Parser.js';
|
|
9
9
|
import { convertCtrlKey, insertMarkdown, emojis, EMOJI_SMILEY_FACE, EMOJI_SAD_FACE, EMOJI_THUMBS_UP, EMOJI_THUMBS_DOWN, BOLD, ITALIC, LINK, MENTION } from './markdownHandler.js';
|
|
10
10
|
import { mainClasses, toolbarClasses, tooltipAnchorClasses, emojisPopoverClasses } from './styles/Editor.style.js';
|
|
11
|
-
const EmojisPopover =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
id: emojisPopoverClasses.__hash
|
|
36
|
-
}, emojisPopoverClasses));
|
|
37
|
-
};
|
|
11
|
+
const EmojisPopover = ({
|
|
12
|
+
onInsertMarkdown,
|
|
13
|
+
onClose,
|
|
14
|
+
reference
|
|
15
|
+
}) => /*#__PURE__*/React.createElement(Popover, {
|
|
16
|
+
reference: reference,
|
|
17
|
+
onClickOutside: onClose
|
|
18
|
+
}, /*#__PURE__*/React.createElement("ul", {
|
|
19
|
+
className: `jsx-${emojisPopoverClasses.__hash}` + " " + "emojisList"
|
|
20
|
+
}, /*#__PURE__*/React.createElement("li", {
|
|
21
|
+
onClick: () => onInsertMarkdown(EMOJI_SMILEY_FACE),
|
|
22
|
+
className: `jsx-${emojisPopoverClasses.__hash}`
|
|
23
|
+
}, /*#__PURE__*/React.createElement(Parser, null, emojis[EMOJI_SMILEY_FACE])), /*#__PURE__*/React.createElement("li", {
|
|
24
|
+
onClick: () => onInsertMarkdown(EMOJI_SAD_FACE),
|
|
25
|
+
className: `jsx-${emojisPopoverClasses.__hash}`
|
|
26
|
+
}, /*#__PURE__*/React.createElement(Parser, null, emojis[EMOJI_SAD_FACE])), /*#__PURE__*/React.createElement("li", {
|
|
27
|
+
onClick: () => onInsertMarkdown(EMOJI_THUMBS_UP),
|
|
28
|
+
className: `jsx-${emojisPopoverClasses.__hash}`
|
|
29
|
+
}, /*#__PURE__*/React.createElement(Parser, null, emojis[EMOJI_THUMBS_UP])), /*#__PURE__*/React.createElement("li", {
|
|
30
|
+
onClick: () => onInsertMarkdown(EMOJI_THUMBS_DOWN),
|
|
31
|
+
className: `jsx-${emojisPopoverClasses.__hash}`
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Parser, null, emojis[EMOJI_THUMBS_DOWN]))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
33
|
+
id: emojisPopoverClasses.__hash
|
|
34
|
+
}, emojisPopoverClasses));
|
|
38
35
|
EmojisPopover.propTypes = {
|
|
39
36
|
onClose: PropTypes.func.isRequired,
|
|
40
37
|
onInsertMarkdown: PropTypes.func.isRequired,
|
|
41
38
|
reference: PropTypes.object
|
|
42
39
|
};
|
|
43
|
-
const IconButtonWithTooltip =
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}));
|
|
72
|
-
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
73
|
-
id: tooltipAnchorClasses.__hash
|
|
74
|
-
}, tooltipAnchorClasses));
|
|
75
|
-
};
|
|
40
|
+
const IconButtonWithTooltip = ({
|
|
41
|
+
tooltipContent,
|
|
42
|
+
disabled,
|
|
43
|
+
icon,
|
|
44
|
+
onClick
|
|
45
|
+
}) => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
46
|
+
content: tooltipContent,
|
|
47
|
+
placement: "bottom",
|
|
48
|
+
closeDelay: 200
|
|
49
|
+
}, ({
|
|
50
|
+
ref,
|
|
51
|
+
onMouseOver,
|
|
52
|
+
onMouseOut
|
|
53
|
+
}) => /*#__PURE__*/React.createElement("span", {
|
|
54
|
+
ref: ref,
|
|
55
|
+
onMouseOver: onMouseOver,
|
|
56
|
+
onMouseOut: onMouseOut,
|
|
57
|
+
className: `jsx-${tooltipAnchorClasses.__hash}` + " " + "tooltip"
|
|
58
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
59
|
+
secondary: true,
|
|
60
|
+
small: true,
|
|
61
|
+
disabled: disabled,
|
|
62
|
+
icon: icon,
|
|
63
|
+
onClick: onClick,
|
|
64
|
+
"aria-label": tooltipContent
|
|
65
|
+
}))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
66
|
+
id: tooltipAnchorClasses.__hash
|
|
67
|
+
}, tooltipAnchorClasses));
|
|
76
68
|
IconButtonWithTooltip.propTypes = {
|
|
77
69
|
disabled: PropTypes.bool,
|
|
78
70
|
icon: PropTypes.node,
|
|
79
71
|
tooltipContent: PropTypes.string,
|
|
80
72
|
onClick: PropTypes.func
|
|
81
73
|
};
|
|
82
|
-
const Toolbar =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
} = _ref4;
|
|
74
|
+
const Toolbar = ({
|
|
75
|
+
disabled,
|
|
76
|
+
onInsertMarkdown,
|
|
77
|
+
onTogglePreview,
|
|
78
|
+
previewButtonDisabled,
|
|
79
|
+
previewMode
|
|
80
|
+
}) => {
|
|
90
81
|
const emojisButtonRef = useRef();
|
|
91
82
|
const [emojisPopoverIsOpen, setEmojisPopoverIsOpen] = useState(false);
|
|
92
83
|
const iconColor = disabled ? colors.grey600 : colors.grey700;
|
|
@@ -168,17 +159,16 @@ Toolbar.propTypes = {
|
|
|
168
159
|
onTogglePreview: PropTypes.func.isRequired,
|
|
169
160
|
disabled: PropTypes.bool
|
|
170
161
|
};
|
|
171
|
-
export const Editor = /*#__PURE__*/forwardRef((
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
} = _ref5;
|
|
162
|
+
export const Editor = /*#__PURE__*/forwardRef(({
|
|
163
|
+
value,
|
|
164
|
+
disabled,
|
|
165
|
+
inputPlaceholder,
|
|
166
|
+
onChange,
|
|
167
|
+
errorText,
|
|
168
|
+
helpText,
|
|
169
|
+
initialFocus = true,
|
|
170
|
+
resizable = true
|
|
171
|
+
}, externalRef) => {
|
|
182
172
|
const [previewMode, setPreviewMode] = useState(false);
|
|
183
173
|
const internalRef = useRef();
|
|
184
174
|
const textareaRef = externalRef || internalRef;
|
|
@@ -242,10 +232,6 @@ export const Editor = /*#__PURE__*/forwardRef((_ref5, externalRef) => {
|
|
|
242
232
|
}, mainClasses));
|
|
243
233
|
});
|
|
244
234
|
Editor.displayName = 'Editor';
|
|
245
|
-
Editor.defaultProps = {
|
|
246
|
-
initialFocus: true,
|
|
247
|
-
resizable: true
|
|
248
|
-
};
|
|
249
235
|
Editor.propTypes = {
|
|
250
236
|
value: PropTypes.string.isRequired,
|
|
251
237
|
onChange: PropTypes.func.isRequired,
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import { MdParser } from './MdParser.js';
|
|
4
|
-
export const Parser =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} = _ref;
|
|
4
|
+
export const Parser = ({
|
|
5
|
+
children,
|
|
6
|
+
style = null
|
|
7
|
+
}) => {
|
|
9
8
|
const MdParserInstance = useMemo(() => new MdParser(), []);
|
|
10
9
|
return children ? /*#__PURE__*/React.createElement("div", {
|
|
11
10
|
style: {
|
|
@@ -16,9 +15,6 @@ export const Parser = _ref => {
|
|
|
16
15
|
}
|
|
17
16
|
}) : null;
|
|
18
17
|
};
|
|
19
|
-
Parser.defaultProps = {
|
|
20
|
-
style: null
|
|
21
|
-
};
|
|
22
18
|
Parser.propTypes = {
|
|
23
19
|
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
|
|
24
20
|
style: PropTypes.object
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import React, { createContext, useCallback, useContext,
|
|
3
|
+
import React, { createContext, useCallback, useContext, useRef, useState } from 'react';
|
|
4
4
|
const throwErrorIfNotInitialized = () => {
|
|
5
5
|
throw new Error('`HoverMenubarContext` has not been initialised');
|
|
6
6
|
};
|
|
@@ -12,32 +12,42 @@ const HoverMenubarContext = /*#__PURE__*/createContext({
|
|
|
12
12
|
openedDropdownEl: null
|
|
13
13
|
});
|
|
14
14
|
const useHoverMenubarContext = () => useContext(HoverMenubarContext);
|
|
15
|
-
const HoverMenuBar =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} = _ref;
|
|
15
|
+
const HoverMenuBar = ({
|
|
16
|
+
children,
|
|
17
|
+
dataTest = 'dhis2-analytics-hovermenubar'
|
|
18
|
+
}) => {
|
|
20
19
|
const [openedDropdownEl, setOpenedDropdownEl] = useState(null);
|
|
21
|
-
const
|
|
20
|
+
const lastHoveredSubMenuElRef = useRef(null);
|
|
22
21
|
const [isInHoverMode, setIsInHoverMode] = useState(false);
|
|
23
22
|
const closeMenu = useCallback(() => {
|
|
24
23
|
setIsInHoverMode(false);
|
|
25
24
|
setOpenedDropdownEl(null);
|
|
26
25
|
}, []);
|
|
26
|
+
const setLastHoveredSubMenuEl = useCallback(element => {
|
|
27
|
+
lastHoveredSubMenuElRef.current = element;
|
|
28
|
+
}, []);
|
|
27
29
|
const onDocumentClick = useCallback(event => {
|
|
28
|
-
const isClickOnOpenedSubMenuAnchor =
|
|
30
|
+
const isClickOnOpenedSubMenuAnchor = lastHoveredSubMenuElRef.current && (lastHoveredSubMenuElRef.current === event.target || lastHoveredSubMenuElRef.current.contains(event.target));
|
|
29
31
|
if (!isClickOnOpenedSubMenuAnchor) {
|
|
30
32
|
closeMenu();
|
|
31
33
|
}
|
|
32
|
-
}, [closeMenu
|
|
34
|
+
}, [closeMenu]);
|
|
33
35
|
const onDropDownButtonClick = useCallback(event => {
|
|
34
36
|
if (!isInHoverMode) {
|
|
37
|
+
/* Stop event propagation to avoid it from bubling up to the
|
|
38
|
+
* document, which would actually cause the menu to close again
|
|
39
|
+
* immediately */
|
|
40
|
+
event.stopPropagation();
|
|
35
41
|
setIsInHoverMode(true);
|
|
36
42
|
setOpenedDropdownEl(event.currentTarget);
|
|
43
|
+
document.addEventListener('click', onDocumentClick, {
|
|
44
|
+
once: true
|
|
45
|
+
});
|
|
37
46
|
} else {
|
|
47
|
+
document.removeEventListener('click', onDocumentClick);
|
|
38
48
|
closeMenu();
|
|
39
49
|
}
|
|
40
|
-
}, [closeMenu, isInHoverMode]);
|
|
50
|
+
}, [closeMenu, isInHoverMode, onDocumentClick]);
|
|
41
51
|
const onDropDownButtonMouseOver = useCallback(event => {
|
|
42
52
|
if (isInHoverMode) {
|
|
43
53
|
setOpenedDropdownEl(event.currentTarget);
|
|
@@ -57,16 +67,6 @@ const HoverMenuBar = _ref => {
|
|
|
57
67
|
closeMenu();
|
|
58
68
|
}
|
|
59
69
|
}, [closeMenu]);
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
if (isInHoverMode) {
|
|
62
|
-
document.addEventListener('click', onDocumentClick, {
|
|
63
|
-
once: true
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
return () => {
|
|
67
|
-
document.removeEventListener('click', onDocumentClick);
|
|
68
|
-
};
|
|
69
|
-
}, [onDocumentClick, isInHoverMode]);
|
|
70
70
|
return /*#__PURE__*/React.createElement(HoverMenubarContext.Provider, {
|
|
71
71
|
value: {
|
|
72
72
|
onDropDownButtonClick,
|
|
@@ -82,9 +82,6 @@ const HoverMenuBar = _ref => {
|
|
|
82
82
|
id: "3020154784"
|
|
83
83
|
}, [".jsx-3020154784{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}"])));
|
|
84
84
|
};
|
|
85
|
-
HoverMenuBar.defaultProps = {
|
|
86
|
-
dataTest: 'dhis2-analytics-hovermenubar'
|
|
87
|
-
};
|
|
88
85
|
HoverMenuBar.propTypes = {
|
|
89
86
|
children: PropTypes.node.isRequired,
|
|
90
87
|
dataTest: PropTypes.string
|
|
@@ -5,14 +5,13 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import React, { useRef } from 'react';
|
|
6
6
|
import menuButtonStyles from '../MenuButton.styles.js';
|
|
7
7
|
import { useHoverMenubarContext } from './HoverMenuBar.js';
|
|
8
|
-
export const HoverMenuDropdown =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} = _ref;
|
|
8
|
+
export const HoverMenuDropdown = ({
|
|
9
|
+
children,
|
|
10
|
+
className,
|
|
11
|
+
label,
|
|
12
|
+
dataTest = 'dhis2-analytics-hovermenudropdown',
|
|
13
|
+
disabled
|
|
14
|
+
}) => {
|
|
16
15
|
const buttonRef = useRef();
|
|
17
16
|
const {
|
|
18
17
|
onDropDownButtonClick,
|
|
@@ -36,9 +35,6 @@ export const HoverMenuDropdown = _ref => {
|
|
|
36
35
|
reference: buttonRef
|
|
37
36
|
}, children)));
|
|
38
37
|
};
|
|
39
|
-
HoverMenuDropdown.defaultProps = {
|
|
40
|
-
dataTest: 'dhis2-analytics-hovermenudropdown'
|
|
41
|
-
};
|
|
42
38
|
HoverMenuDropdown.propTypes = {
|
|
43
39
|
children: PropTypes.node.isRequired,
|
|
44
40
|
label: PropTypes.node.isRequired,
|
|
@@ -13,15 +13,14 @@ const HoverMenuListContext = /*#__PURE__*/createContext({
|
|
|
13
13
|
dense: false
|
|
14
14
|
});
|
|
15
15
|
const useHoverMenuListContext = () => useContext(HoverMenuListContext);
|
|
16
|
-
const HoverMenuList =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} = _ref;
|
|
16
|
+
const HoverMenuList = ({
|
|
17
|
+
children,
|
|
18
|
+
className,
|
|
19
|
+
dataTest = 'dhis2-analytics-hovermenulist',
|
|
20
|
+
dense = true,
|
|
21
|
+
maxHeight = 'auto',
|
|
22
|
+
maxWidth = '380px'
|
|
23
|
+
}) => {
|
|
25
24
|
const {
|
|
26
25
|
setLastHoveredSubMenuEl
|
|
27
26
|
} = useHoverMenubarContext();
|
|
@@ -51,12 +50,6 @@ const HoverMenuList = _ref => {
|
|
|
51
50
|
dynamic: [colors.white, colors.grey200, elevations.e300, dense ? '128' : '180', maxWidth, maxHeight, spacers.dp4]
|
|
52
51
|
}, [`ul.__jsx-style-dynamic-selector{position:relative;margin:0;padding:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background:${colors.white};border:1px solid ${colors.grey200};border-radius:3px;box-shadow:${elevations.e300};display:inline-block;min-width:${dense ? '128' : '180'}px;max-width:${maxWidth};max-height:${maxHeight};padding:${spacers.dp4} 0;overflow:auto;list-style:none;}`])));
|
|
53
52
|
};
|
|
54
|
-
HoverMenuList.defaultProps = {
|
|
55
|
-
dataTest: 'dhis2-analytics-hovermenulist',
|
|
56
|
-
maxWidth: '380px',
|
|
57
|
-
maxHeight: 'auto',
|
|
58
|
-
dense: true
|
|
59
|
-
};
|
|
60
53
|
HoverMenuList.propTypes = {
|
|
61
54
|
/** Typically `MenuItem`, `MenuDivider`, and `MenuSectionHeader` */
|
|
62
55
|
children: PropTypes.node,
|
|
@@ -5,17 +5,16 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import React, { useRef } from 'react';
|
|
6
6
|
import { HoverMenuList, useHoverMenuListContext } from './HoverMenuList.js';
|
|
7
7
|
import styles from './HoverMenuListItem.styles.js';
|
|
8
|
-
const HoverMenuListItem =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} = _ref;
|
|
8
|
+
const HoverMenuListItem = ({
|
|
9
|
+
onClick,
|
|
10
|
+
children,
|
|
11
|
+
icon,
|
|
12
|
+
className,
|
|
13
|
+
destructive,
|
|
14
|
+
disabled,
|
|
15
|
+
dataTest = 'dhis2-uicore-hovermenulistitem',
|
|
16
|
+
label
|
|
17
|
+
}) => {
|
|
19
18
|
const ref = useRef();
|
|
20
19
|
const {
|
|
21
20
|
onSubmenuAnchorMouseEnter,
|
|
@@ -51,9 +50,6 @@ const HoverMenuListItem = _ref => {
|
|
|
51
50
|
dense: dense
|
|
52
51
|
}, children))));
|
|
53
52
|
};
|
|
54
|
-
HoverMenuListItem.defaultProps = {
|
|
55
|
-
dataTest: 'dhis2-uicore-hovermenulistitem'
|
|
56
|
-
};
|
|
57
53
|
HoverMenuListItem.propTypes = {
|
|
58
54
|
// Nested menu items become submenus
|
|
59
55
|
children: PropTypes.node,
|
|
@@ -102,11 +102,10 @@ describe('<HoverMenuBar/>', () => {
|
|
|
102
102
|
});
|
|
103
103
|
});
|
|
104
104
|
});
|
|
105
|
-
function createFullMenuBarWrapper(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
105
|
+
function createFullMenuBarWrapper({
|
|
106
|
+
menuItemOnClickSpy,
|
|
107
|
+
subMenuItemOnClickSpy
|
|
108
|
+
} = {}) {
|
|
110
109
|
return render(/*#__PURE__*/React.createElement(HoverMenuBar, null, /*#__PURE__*/React.createElement(HoverMenuDropdown, {
|
|
111
110
|
label: "Menu A"
|
|
112
111
|
}, /*#__PURE__*/React.createElement(HoverMenuList, null, /*#__PURE__*/React.createElement(HoverMenuListItem, {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { shallow } from 'enzyme';
|
|
2
4
|
import React from 'react';
|
|
3
5
|
import { HoverMenuList, HoverMenuListItem } from '../index.js';
|
|
4
6
|
describe('<HoverMenuList/>', () => {
|
|
@@ -22,15 +24,15 @@ describe('<HoverMenuList/>', () => {
|
|
|
22
24
|
expect(wrapper.find('ul').prop('data-test')).toBe(dataTest);
|
|
23
25
|
});
|
|
24
26
|
it('accept a `dense` prop', () => {
|
|
25
|
-
|
|
27
|
+
render(/*#__PURE__*/React.createElement(HoverMenuList, {
|
|
26
28
|
dense: true
|
|
27
29
|
}, /*#__PURE__*/React.createElement(HoverMenuListItem, {
|
|
28
30
|
label: "item 1"
|
|
29
31
|
}), /*#__PURE__*/React.createElement(HoverMenuListItem, {
|
|
30
32
|
label: "item 2"
|
|
31
33
|
})));
|
|
32
|
-
expect(
|
|
33
|
-
expect(
|
|
34
|
+
expect(screen.getByText('item 1').closest('li')).toHaveClass('dense');
|
|
35
|
+
expect(screen.getByText('item 2').closest('li')).toHaveClass('dense');
|
|
34
36
|
});
|
|
35
37
|
it('accept a `maxHeight` prop', () => {
|
|
36
38
|
const maxHeight = '100000px';
|
|
@@ -4,27 +4,21 @@ import { IconChevronRight24, IconChevronLeft24 } from '@dhis2/ui';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import menuButtonStyles from './MenuButton.styles.js';
|
|
7
|
-
export const InterpretationsAndDetailsToggler =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
id: "1238484262"
|
|
23
|
-
}, ["button.jsx-1238484262{gap:8px;}"]));
|
|
24
|
-
};
|
|
25
|
-
InterpretationsAndDetailsToggler.defaultProps = {
|
|
26
|
-
dataTest: 'dhis2-analytics-interpretationsanddetailstoggler'
|
|
27
|
-
};
|
|
7
|
+
export const InterpretationsAndDetailsToggler = ({
|
|
8
|
+
onClick,
|
|
9
|
+
dataTest = 'dhis2-analytics-interpretationsanddetailstoggler',
|
|
10
|
+
disabled,
|
|
11
|
+
isShowing
|
|
12
|
+
}) => /*#__PURE__*/React.createElement("button", {
|
|
13
|
+
onClick: onClick,
|
|
14
|
+
disabled: disabled,
|
|
15
|
+
"data-test": dataTest,
|
|
16
|
+
className: "jsx-1238484262 " + `jsx-${menuButtonStyles.__hash}`
|
|
17
|
+
}, isShowing ? /*#__PURE__*/React.createElement(IconChevronRight24, null) : /*#__PURE__*/React.createElement(IconChevronLeft24, null), i18n.t('Interpretations and details'), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
18
|
+
id: menuButtonStyles.__hash
|
|
19
|
+
}, menuButtonStyles), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
20
|
+
id: "1238484262"
|
|
21
|
+
}, ["button.jsx-1238484262{gap:8px;}"]));
|
|
28
22
|
InterpretationsAndDetailsToggler.propTypes = {
|
|
29
23
|
onClick: PropTypes.func.isRequired,
|
|
30
24
|
dataTest: PropTypes.string,
|
|
@@ -2,22 +2,16 @@ import _JSXStyle from "styled-jsx/style";
|
|
|
2
2
|
import { colors } from '@dhis2/ui';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
export const Toolbar =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
dynamic: [colors.grey400, colors.white]
|
|
16
|
-
}, [`div.__jsx-style-dynamic-selector{box-sizing:border-box;min-height:32px;max-height:32px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;border-bottom:1px solid ${colors.grey400};background-color:${colors.white};}`]));
|
|
17
|
-
};
|
|
18
|
-
Toolbar.defaultProps = {
|
|
19
|
-
dataTest: 'dhis2-analytics-toolbar'
|
|
20
|
-
};
|
|
5
|
+
export const Toolbar = ({
|
|
6
|
+
children,
|
|
7
|
+
dataTest = 'dhis2-analytics-toolbar'
|
|
8
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
9
|
+
"data-test": dataTest,
|
|
10
|
+
className: _JSXStyle.dynamic([["2617706539", [colors.grey400, colors.white]]])
|
|
11
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
12
|
+
id: "2617706539",
|
|
13
|
+
dynamic: [colors.grey400, colors.white]
|
|
14
|
+
}, [`div.__jsx-style-dynamic-selector{box-sizing:border-box;min-height:32px;max-height:32px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:stretch;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;border-bottom:1px solid ${colors.grey400};background-color:${colors.white};}`]));
|
|
21
15
|
Toolbar.propTypes = {
|
|
22
16
|
children: PropTypes.node,
|
|
23
17
|
dataTest: PropTypes.string
|