@dhis2/analytics 23.8.5 → 23.8.6
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/CHANGELOG.md +9 -0
- package/build/cjs/__demo__/FileMenu.stories.js +4 -2
- package/build/cjs/__demo__/Filter.stories.js +2 -2
- package/build/cjs/__demo__/FixedPeriodSelect.stories.js +2 -2
- package/build/cjs/__demo__/OpenFileDialog.stories.js +4 -2
- package/build/cjs/__demo__/OrgUnitDimension.stories.js +2 -2
- package/build/cjs/__demo__/PivotTable.stories.js +206 -153
- package/build/cjs/api/__tests__/dimensions.spec.js +2 -1
- package/build/cjs/api/analytics/Analytics.js +8 -7
- package/build/cjs/api/analytics/AnalyticsBase.js +58 -43
- package/build/cjs/api/analytics/AnalyticsRequest.js +2 -1
- package/build/cjs/api/analytics/AnalyticsRequestBase.js +22 -17
- package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +38 -19
- package/build/cjs/api/analytics/AnalyticsResponseHeader.js +7 -5
- package/build/cjs/api/analytics/__tests__/AnalyticsRequest.spec.js +2 -1
- package/build/cjs/api/dimensions.js +150 -120
- package/build/cjs/api/organisationUnits.js +36 -24
- package/build/cjs/components/AboutAOUnit/AboutAOUnit.js +19 -12
- package/build/cjs/components/CachedDataQueryProvider.js +8 -7
- package/build/cjs/components/DataDimension/DataDimension.js +8 -6
- package/build/cjs/components/DataDimension/DataTypeSelector.js +6 -5
- package/build/cjs/components/DataDimension/DetailSelector.js +6 -5
- package/build/cjs/components/DataDimension/GroupSelector.js +12 -11
- package/build/cjs/components/DataDimension/ItemSelector.js +87 -73
- package/build/cjs/components/DataDimension/MetricSelector.js +6 -5
- package/build/cjs/components/DimensionMenu.js +14 -13
- package/build/cjs/components/DimensionsPanel/DimensionsPanel.js +4 -4
- package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +4 -4
- package/build/cjs/components/DimensionsPanel/List/DimensionLabel.js +4 -4
- package/build/cjs/components/DimensionsPanel/List/DimensionList.js +4 -4
- package/build/cjs/components/DimensionsPanel/List/OptionsButton.js +10 -7
- package/build/cjs/components/DimensionsPanel/List/RecommendedIcon.js +14 -11
- package/build/cjs/components/DynamicDimension/DynamicDimension.js +9 -8
- package/build/cjs/components/DynamicDimension/ItemSelector.js +58 -44
- package/build/cjs/components/FileMenu/DeleteDialog.js +16 -12
- package/build/cjs/components/FileMenu/FileMenu.js +19 -18
- package/build/cjs/components/FileMenu/GetLinkDialog.js +6 -5
- package/build/cjs/components/FileMenu/RenameDialog.js +38 -25
- package/build/cjs/components/FileMenu/SaveAsDialog.js +21 -14
- package/build/cjs/components/FileMenu/utils.js +1 -1
- package/build/cjs/components/Filter/Filter.js +22 -19
- package/build/cjs/components/LegendKey/LegendKey.js +4 -3
- package/build/cjs/components/OpenFileDialog/CreatedByFilter.js +26 -20
- package/build/cjs/components/OpenFileDialog/CustomSelectOption.js +26 -23
- package/build/cjs/components/OpenFileDialog/DateField.js +4 -3
- package/build/cjs/components/OpenFileDialog/FileList.js +22 -19
- package/build/cjs/components/OpenFileDialog/NameFilter.js +21 -15
- package/build/cjs/components/OpenFileDialog/OpenFileDialog.js +43 -35
- package/build/cjs/components/OpenFileDialog/PaginationControls.js +28 -22
- package/build/cjs/components/OpenFileDialog/VisTypeFilter.js +37 -28
- package/build/cjs/components/OpenFileDialog/utils.js +1 -1
- package/build/cjs/components/Options/VisualizationOptions.js +46 -36
- package/build/cjs/components/Options/styles/VisualizationOptions.style.js +1 -1
- package/build/cjs/components/OrgUnitDimension/OrgUnitDimension.js +50 -34
- package/build/cjs/components/PeriodDimension/FixedPeriodFilter.js +22 -15
- package/build/cjs/components/PeriodDimension/FixedPeriodSelect.js +19 -14
- package/build/cjs/components/PeriodDimension/PeriodDimension.js +8 -6
- package/build/cjs/components/PeriodDimension/PeriodTransfer.js +24 -19
- package/build/cjs/components/PeriodDimension/RelativePeriodFilter.js +30 -24
- package/build/cjs/components/PeriodDimension/utils/fixedPeriods.js +1 -1
- package/build/cjs/components/PeriodDimension/utils/index.js +6 -2
- package/build/cjs/components/PeriodDimension/utils/relativePeriods.js +1 -1
- package/build/cjs/components/PivotTable/PivotTable.js +10 -9
- package/build/cjs/components/PivotTable/PivotTableBody.js +29 -20
- package/build/cjs/components/PivotTable/PivotTableCell.js +9 -8
- package/build/cjs/components/PivotTable/PivotTableClippedAxis.js +17 -14
- package/build/cjs/components/PivotTable/PivotTableColumnHeaderCell.js +8 -7
- package/build/cjs/components/PivotTable/PivotTableColumnHeaders.js +29 -22
- package/build/cjs/components/PivotTable/PivotTableContainer.js +6 -5
- package/build/cjs/components/PivotTable/PivotTableDimensionLabelCell.js +5 -4
- package/build/cjs/components/PivotTable/PivotTableEmptyCell.js +3 -2
- package/build/cjs/components/PivotTable/PivotTableEmptyRow.js +5 -4
- package/build/cjs/components/PivotTable/PivotTableEngineContext.js +7 -6
- package/build/cjs/components/PivotTable/PivotTableHead.js +16 -13
- package/build/cjs/components/PivotTable/PivotTableHeaderCell.js +9 -8
- package/build/cjs/components/PivotTable/PivotTableRow.js +27 -20
- package/build/cjs/components/PivotTable/PivotTableRowHeaderCell.js +6 -5
- package/build/cjs/components/PivotTable/PivotTableSortIcon.js +5 -4
- package/build/cjs/components/PivotTable/PivotTableTitleRow.js +9 -8
- package/build/cjs/components/PivotTable/PivotTableTitleRows.js +5 -4
- package/build/cjs/components/PivotTable/PivotTableValueCell.js +8 -7
- package/build/cjs/components/PivotTable/styles/PivotTable.style.js +1 -1
- package/build/cjs/components/TransferOption.js +15 -13
- package/build/cjs/components/TranslationDialog/TranslationModal/LocalesSelect.js +28 -19
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationForm.js +25 -18
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModal.js +9 -8
- package/build/cjs/components/TranslationDialog/TranslationModal/TranslationModalActions.js +17 -14
- package/build/cjs/components/TranslationDialog/TranslationModal/useTranslationsResults.js +4 -3
- package/build/cjs/components/VisTypeIcon.js +6 -5
- package/build/cjs/index.js +464 -464
- package/build/cjs/locales/en/translations.json +1 -1
- package/build/cjs/locales/nl/translations.json +30 -30
- package/build/cjs/modules/axis.js +1 -1
- package/build/cjs/modules/dataSets.js +1 -1
- package/build/cjs/modules/dataTypes.js +2 -2
- package/build/cjs/modules/dimensionSelectorHelper.js +1 -1
- package/build/cjs/modules/fontStyle.js +1 -1
- package/build/cjs/modules/layout/axis.js +1 -1
- package/build/cjs/modules/layout/dimension.js +1 -1
- package/build/cjs/modules/layout/dimensionCreate.js +3 -1
- package/build/cjs/modules/layout/dimensionIsValid.js +5 -3
- package/build/cjs/modules/layout/item.js +1 -1
- package/build/cjs/modules/layout/testResources.js +1 -1
- package/build/cjs/modules/layoutTypes.js +1 -1
- package/build/cjs/modules/layoutUiRules/index.js +20 -20
- package/build/cjs/modules/layoutUiRules/rules.js +1 -1
- package/build/cjs/modules/layoutUiRules/rulesHelper.js +2 -1
- package/build/cjs/modules/layoutUiRules/rulesUtils.js +1 -1
- package/build/cjs/modules/legends.js +1 -1
- package/build/cjs/modules/outliers/index.js +4 -2
- package/build/cjs/modules/outliers/iqr.js +8 -5
- package/build/cjs/modules/outliers/modZScore.js +15 -7
- package/build/cjs/modules/outliers/zScore.js +5 -4
- package/build/cjs/modules/pivotTable/AdaptiveClippingController.js +17 -12
- package/build/cjs/modules/pivotTable/PivotTableEngine.js +57 -44
- package/build/cjs/modules/pivotTable/clipAxis.js +8 -7
- package/build/cjs/modules/pivotTable/clipPartitionedAxis.js +10 -9
- package/build/cjs/modules/pivotTable/getHeaderForDisplay.js +9 -8
- package/build/cjs/modules/pivotTable/measureText.js +10 -7
- package/build/cjs/modules/pivotTable/pivotTableConstants.js +1 -1
- package/build/cjs/modules/pivotTable/useParentSize.js +2 -1
- package/build/cjs/modules/pivotTable/useScrollPosition.js +2 -1
- package/build/cjs/modules/pivotTable/useTableClipping.js +7 -6
- package/build/cjs/modules/predefinedDimensions.js +2 -2
- package/build/cjs/modules/relativeItems/index.js +4 -1
- package/build/cjs/modules/valueTypes.js +1 -1
- package/build/cjs/modules/visTypes.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_dhis/index.js +7 -6
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +9 -4
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/axis.js +5 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/customAxes.js +9 -5
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +4 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/index.js +11 -9
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legend.js +32 -28
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/legendSet.js +24 -20
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/plotOptions.js +9 -8
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/xAxis/index.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +3 -1
- package/build/cjs/visualizations/config/generators/dhis/singleValue.js +28 -24
- package/build/cjs/visualizations/config/generators/highcharts/index.js +5 -1
- package/build/cjs/visualizations/config/index.js +13 -11
- package/build/cjs/visualizations/config/validators/dhis/index.js +4 -3
- package/build/cjs/visualizations/index.js +6 -2
- package/build/cjs/visualizations/store/adapters/dhis_dhis/index.js +7 -6
- package/build/cjs/visualizations/store/adapters/dhis_highcharts/index.js +8 -7
- package/build/cjs/visualizations/store/index.js +18 -15
- package/build/cjs/visualizations/store/validators/dhis/index.js +7 -5
- package/build/cjs/visualizations/util/colors/colorSets.js +1 -1
- package/build/cjs/visualizations/util/colors/themes.js +1 -1
- package/build/cjs/visualizations/util/getFilterText.js +9 -6
- package/build/es/__demo__/FileMenu.stories.js +4 -2
- package/build/es/__demo__/OpenFileDialog.stories.js +4 -2
- package/build/es/__demo__/PivotTable.stories.js +204 -151
- package/build/es/api/__tests__/dimensions.spec.js +2 -1
- package/build/es/api/analytics/Analytics.js +8 -7
- package/build/es/api/analytics/AnalyticsBase.js +58 -43
- package/build/es/api/analytics/AnalyticsRequest.js +2 -1
- package/build/es/api/analytics/AnalyticsRequestBase.js +22 -17
- package/build/es/api/analytics/AnalyticsRequestPropertiesMixin.js +38 -19
- package/build/es/api/analytics/AnalyticsResponseHeader.js +7 -5
- package/build/es/api/analytics/__tests__/AnalyticsRequest.spec.js +2 -1
- package/build/es/api/dimensions.js +149 -119
- package/build/es/api/organisationUnits.js +35 -23
- package/build/es/components/AboutAOUnit/AboutAOUnit.js +17 -10
- package/build/es/components/CachedDataQueryProvider.js +6 -5
- package/build/es/components/DataDimension/DataDimension.js +8 -6
- package/build/es/components/DataDimension/DataTypeSelector.js +6 -5
- package/build/es/components/DataDimension/DetailSelector.js +6 -5
- package/build/es/components/DataDimension/GroupSelector.js +10 -9
- package/build/es/components/DataDimension/ItemSelector.js +85 -71
- package/build/es/components/DataDimension/MetricSelector.js +6 -5
- package/build/es/components/DimensionMenu.js +14 -13
- package/build/es/components/DimensionsPanel/DimensionsPanel.js +2 -2
- package/build/es/components/DimensionsPanel/List/DimensionItem.js +2 -2
- package/build/es/components/DimensionsPanel/List/DimensionLabel.js +2 -2
- package/build/es/components/DimensionsPanel/List/DimensionList.js +2 -2
- package/build/es/components/DimensionsPanel/List/OptionsButton.js +10 -7
- package/build/es/components/DimensionsPanel/List/RecommendedIcon.js +14 -11
- package/build/es/components/DynamicDimension/DynamicDimension.js +9 -8
- package/build/es/components/DynamicDimension/ItemSelector.js +56 -42
- package/build/es/components/FileMenu/DeleteDialog.js +14 -10
- package/build/es/components/FileMenu/FileMenu.js +17 -16
- package/build/es/components/FileMenu/GetLinkDialog.js +6 -5
- package/build/es/components/FileMenu/RenameDialog.js +36 -23
- package/build/es/components/FileMenu/SaveAsDialog.js +19 -12
- package/build/es/components/Filter/Filter.js +22 -19
- package/build/es/components/LegendKey/LegendKey.js +4 -3
- package/build/es/components/OpenFileDialog/CreatedByFilter.js +26 -20
- package/build/es/components/OpenFileDialog/CustomSelectOption.js +26 -23
- package/build/es/components/OpenFileDialog/DateField.js +4 -3
- package/build/es/components/OpenFileDialog/FileList.js +22 -19
- package/build/es/components/OpenFileDialog/NameFilter.js +21 -15
- package/build/es/components/OpenFileDialog/OpenFileDialog.js +41 -33
- package/build/es/components/OpenFileDialog/PaginationControls.js +28 -22
- package/build/es/components/OpenFileDialog/VisTypeFilter.js +37 -28
- package/build/es/components/Options/VisualizationOptions.js +43 -33
- package/build/es/components/OrgUnitDimension/OrgUnitDimension.js +48 -32
- package/build/es/components/PeriodDimension/FixedPeriodFilter.js +22 -15
- package/build/es/components/PeriodDimension/FixedPeriodSelect.js +17 -12
- package/build/es/components/PeriodDimension/PeriodDimension.js +8 -6
- package/build/es/components/PeriodDimension/PeriodTransfer.js +22 -17
- package/build/es/components/PeriodDimension/RelativePeriodFilter.js +30 -24
- package/build/es/components/PeriodDimension/utils/index.js +5 -1
- package/build/es/components/PivotTable/PivotTable.js +8 -7
- package/build/es/components/PivotTable/PivotTableBody.js +29 -20
- package/build/es/components/PivotTable/PivotTableCell.js +9 -8
- package/build/es/components/PivotTable/PivotTableClippedAxis.js +17 -14
- package/build/es/components/PivotTable/PivotTableColumnHeaderCell.js +8 -7
- package/build/es/components/PivotTable/PivotTableColumnHeaders.js +29 -22
- package/build/es/components/PivotTable/PivotTableContainer.js +6 -5
- package/build/es/components/PivotTable/PivotTableDimensionLabelCell.js +5 -4
- package/build/es/components/PivotTable/PivotTableEmptyCell.js +3 -2
- package/build/es/components/PivotTable/PivotTableEmptyRow.js +5 -4
- package/build/es/components/PivotTable/PivotTableEngineContext.js +5 -4
- package/build/es/components/PivotTable/PivotTableHead.js +16 -13
- package/build/es/components/PivotTable/PivotTableHeaderCell.js +9 -8
- package/build/es/components/PivotTable/PivotTableRow.js +27 -20
- package/build/es/components/PivotTable/PivotTableRowHeaderCell.js +6 -5
- package/build/es/components/PivotTable/PivotTableSortIcon.js +5 -4
- package/build/es/components/PivotTable/PivotTableTitleRow.js +7 -6
- package/build/es/components/PivotTable/PivotTableTitleRows.js +5 -4
- package/build/es/components/PivotTable/PivotTableValueCell.js +6 -5
- package/build/es/components/TransferOption.js +15 -13
- package/build/es/components/TranslationDialog/TranslationModal/LocalesSelect.js +28 -19
- package/build/es/components/TranslationDialog/TranslationModal/TranslationForm.js +23 -16
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModal.js +7 -6
- package/build/es/components/TranslationDialog/TranslationModal/TranslationModalActions.js +17 -14
- package/build/es/components/TranslationDialog/TranslationModal/useTranslationsResults.js +4 -3
- package/build/es/components/VisTypeIcon.js +6 -5
- package/build/es/locales/en/translations.json +1 -1
- package/build/es/locales/nl/translations.json +30 -30
- package/build/es/modules/layout/dimensionCreate.js +3 -1
- package/build/es/modules/layout/dimensionIsValid.js +5 -3
- package/build/es/modules/outliers/index.js +3 -1
- package/build/es/modules/outliers/iqr.js +7 -4
- package/build/es/modules/outliers/modZScore.js +14 -6
- package/build/es/modules/outliers/zScore.js +4 -3
- package/build/es/modules/pivotTable/AdaptiveClippingController.js +17 -12
- package/build/es/modules/pivotTable/PivotTableEngine.js +57 -44
- package/build/es/modules/pivotTable/clipAxis.js +8 -7
- package/build/es/modules/pivotTable/clipPartitionedAxis.js +10 -9
- package/build/es/modules/pivotTable/getHeaderForDisplay.js +9 -8
- package/build/es/modules/pivotTable/measureText.js +10 -7
- package/build/es/modules/pivotTable/useParentSize.js +2 -1
- package/build/es/modules/pivotTable/useScrollPosition.js +2 -1
- package/build/es/modules/pivotTable/useTableClipping.js +7 -6
- package/build/es/modules/predefinedDimensions.js +1 -1
- package/build/es/modules/relativeItems/index.js +4 -1
- package/build/es/visualizations/config/adapters/dhis_dhis/index.js +6 -5
- package/build/es/visualizations/config/adapters/dhis_highcharts/addTrendLines.js +8 -3
- package/build/es/visualizations/config/adapters/dhis_highcharts/axis.js +4 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/customAxes.js +6 -2
- package/build/es/visualizations/config/adapters/dhis_highcharts/getTrimmedConfig.js +4 -3
- package/build/es/visualizations/config/adapters/dhis_highcharts/index.js +9 -7
- package/build/es/visualizations/config/adapters/dhis_highcharts/legend.js +32 -28
- package/build/es/visualizations/config/adapters/dhis_highcharts/legendSet.js +23 -19
- package/build/es/visualizations/config/adapters/dhis_highcharts/plotOptions.js +9 -8
- package/build/es/visualizations/config/adapters/dhis_highcharts/yAxis/gauge.js +3 -1
- package/build/es/visualizations/config/generators/dhis/singleValue.js +28 -24
- package/build/es/visualizations/config/generators/highcharts/index.js +5 -1
- package/build/es/visualizations/config/index.js +13 -11
- package/build/es/visualizations/config/validators/dhis/index.js +4 -3
- package/build/es/visualizations/index.js +5 -1
- package/build/es/visualizations/store/adapters/dhis_dhis/index.js +7 -6
- package/build/es/visualizations/store/adapters/dhis_highcharts/index.js +8 -7
- package/build/es/visualizations/store/index.js +18 -15
- package/build/es/visualizations/store/validators/dhis/index.js +7 -5
- package/build/es/visualizations/util/getFilterText.js +9 -6
- package/package.json +11 -11
|
@@ -4,34 +4,41 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import React, { useState } from 'react';
|
|
5
5
|
import { modalContent, tabSection, tabSectionTitle, tabSectionTitleMargin, tabSectionOption, tabSectionOptionItem, tabSectionOptionToggleable, tabSectionToggleableSubsection, tabSectionOptionComplexInline, tabSectionOptionText, tabBar, tabContent, tabSectionOptionIcon } from './styles/VisualizationOptions.style.js';
|
|
6
6
|
|
|
7
|
-
const VisualizationOptions =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const VisualizationOptions = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
optionsConfig,
|
|
10
|
+
onClose,
|
|
11
|
+
onUpdate
|
|
12
|
+
} = _ref;
|
|
12
13
|
const [activeTabKey, setActiveTabKey] = useState();
|
|
13
14
|
|
|
14
|
-
const generateTabContent = sections => sections.map(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
const generateTabContent = sections => sections.map(_ref2 => {
|
|
16
|
+
let {
|
|
17
|
+
key,
|
|
18
|
+
label,
|
|
19
|
+
content,
|
|
20
|
+
helpText
|
|
21
|
+
} = _ref2;
|
|
22
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
key: key,
|
|
24
|
+
className: tabSection.className
|
|
25
|
+
}, /*#__PURE__*/React.createElement(FieldSet, null, label ? /*#__PURE__*/React.createElement(Legend, null, /*#__PURE__*/React.createElement("span", {
|
|
26
|
+
className: tabSectionTitle.className
|
|
27
|
+
}, label)) : null, content, helpText ? /*#__PURE__*/React.createElement(Legend, null, /*#__PURE__*/React.createElement(Help, null, helpText)) : null));
|
|
28
|
+
});
|
|
25
29
|
|
|
26
|
-
const generateTabs = tabs => tabs.map(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
const generateTabs = tabs => tabs.map(_ref3 => {
|
|
31
|
+
let {
|
|
32
|
+
key,
|
|
33
|
+
label,
|
|
34
|
+
content
|
|
35
|
+
} = _ref3;
|
|
36
|
+
return {
|
|
37
|
+
key,
|
|
38
|
+
label,
|
|
39
|
+
content: generateTabContent(content)
|
|
40
|
+
};
|
|
41
|
+
});
|
|
35
42
|
|
|
36
43
|
const getModalContent = () => {
|
|
37
44
|
const tabs = generateTabs(optionsConfig);
|
|
@@ -45,14 +52,17 @@ const VisualizationOptions = ({
|
|
|
45
52
|
className: tabBar.className
|
|
46
53
|
}, /*#__PURE__*/React.createElement(TabBar, {
|
|
47
54
|
dataTest: 'options-modal-tab-bar'
|
|
48
|
-
}, tabs.map(({
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
}, tabs.map((_ref4, index) => {
|
|
56
|
+
let {
|
|
57
|
+
key,
|
|
58
|
+
label
|
|
59
|
+
} = _ref4;
|
|
60
|
+
return /*#__PURE__*/React.createElement(Tab, {
|
|
61
|
+
key: key,
|
|
62
|
+
onClick: () => setActiveTabKey(key),
|
|
63
|
+
selected: index === activeTabIndex
|
|
64
|
+
}, label);
|
|
65
|
+
})), tabBar.styles), /*#__PURE__*/React.createElement("div", {
|
|
56
66
|
className: tabContent.className
|
|
57
67
|
}, tabs[activeTabIndex].content, tabContent.styles, tabSection.styles, tabSectionTitle.styles, tabSectionTitleMargin.styles, tabSectionOption.styles, tabSectionOptionItem.styles, tabSectionOptionToggleable.styles, tabSectionToggleableSubsection.styles, tabSectionOptionComplexInline.styles, tabSectionOptionText.styles, tabSectionOptionIcon.styles));
|
|
58
68
|
};
|
|
@@ -12,11 +12,12 @@ import { DIMENSION_ID_ORGUNIT } from '../../modules/predefinedDimensions.js';
|
|
|
12
12
|
import styles from './styles/OrgUnitDimension.style.js';
|
|
13
13
|
const DYNAMIC_ORG_UNITS = [USER_ORG_UNIT, USER_ORG_UNIT_CHILDREN, USER_ORG_UNIT_GRANDCHILDREN];
|
|
14
14
|
|
|
15
|
-
const OrgUnitDimension =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const OrgUnitDimension = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
roots,
|
|
18
|
+
selected,
|
|
19
|
+
onSelect
|
|
20
|
+
} = _ref;
|
|
20
21
|
const [ouLevels, setOuLevels] = useState([]);
|
|
21
22
|
const [ouGroups, setOuGroups] = useState([]);
|
|
22
23
|
const dataEngine = useDataEngine();
|
|
@@ -150,35 +151,44 @@ const OrgUnitDimension = ({
|
|
|
150
151
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
151
152
|
label: i18n.t('User organisation unit'),
|
|
152
153
|
checked: selected.some(item => item.id === USER_ORG_UNIT),
|
|
153
|
-
onChange:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
154
|
+
onChange: _ref2 => {
|
|
155
|
+
let {
|
|
156
|
+
checked
|
|
157
|
+
} = _ref2;
|
|
158
|
+
return onSelectItems({
|
|
159
|
+
id: USER_ORG_UNIT,
|
|
160
|
+
checked,
|
|
161
|
+
displayName: i18n.t('User organisation unit')
|
|
162
|
+
});
|
|
163
|
+
},
|
|
160
164
|
dense: true
|
|
161
165
|
}), /*#__PURE__*/React.createElement(Checkbox, {
|
|
162
166
|
label: i18n.t('User sub-units'),
|
|
163
167
|
checked: selected.some(item => item.id === USER_ORG_UNIT_CHILDREN),
|
|
164
|
-
onChange:
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
onChange: _ref3 => {
|
|
169
|
+
let {
|
|
170
|
+
checked
|
|
171
|
+
} = _ref3;
|
|
172
|
+
return onSelectItems({
|
|
173
|
+
id: USER_ORG_UNIT_CHILDREN,
|
|
174
|
+
checked,
|
|
175
|
+
displayName: i18n.t('User sub-units')
|
|
176
|
+
});
|
|
177
|
+
},
|
|
171
178
|
dense: true
|
|
172
179
|
}), /*#__PURE__*/React.createElement(Checkbox, {
|
|
173
180
|
label: i18n.t('User sub-x2-units'),
|
|
174
181
|
checked: selected.some(item => item.id === USER_ORG_UNIT_GRANDCHILDREN),
|
|
175
|
-
onChange:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
+
onChange: _ref4 => {
|
|
183
|
+
let {
|
|
184
|
+
checked
|
|
185
|
+
} = _ref4;
|
|
186
|
+
return onSelectItems({
|
|
187
|
+
id: USER_ORG_UNIT_GRANDCHILDREN,
|
|
188
|
+
checked,
|
|
189
|
+
displayName: i18n.t('User sub-x2-units')
|
|
190
|
+
});
|
|
191
|
+
},
|
|
182
192
|
dense: true
|
|
183
193
|
})), /*#__PURE__*/React.createElement("div", {
|
|
184
194
|
className: "jsx-".concat(styles.__hash) + " " + (cx('orgUnitTreeWrapper', {
|
|
@@ -196,9 +206,12 @@ const OrgUnitDimension = ({
|
|
|
196
206
|
}) || "")
|
|
197
207
|
}, /*#__PURE__*/React.createElement(MultiSelect, {
|
|
198
208
|
selected: ouLevels.length ? selected.filter(item => ouIdHelper.hasLevelPrefix(item.id)).map(item => ouIdHelper.removePrefix(item.id)) : [],
|
|
199
|
-
onChange:
|
|
200
|
-
|
|
201
|
-
|
|
209
|
+
onChange: _ref5 => {
|
|
210
|
+
let {
|
|
211
|
+
selected
|
|
212
|
+
} = _ref5;
|
|
213
|
+
return onLevelChange(selected);
|
|
214
|
+
},
|
|
202
215
|
placeholder: i18n.t('Select a level'),
|
|
203
216
|
loading: !ouLevels.length,
|
|
204
217
|
dense: true,
|
|
@@ -210,9 +223,12 @@ const OrgUnitDimension = ({
|
|
|
210
223
|
dataTest: "org-unit-level-select-option-".concat(level.id)
|
|
211
224
|
}))), /*#__PURE__*/React.createElement(MultiSelect, {
|
|
212
225
|
selected: ouGroups.length ? selected.filter(item => ouIdHelper.hasGroupPrefix(item.id)).map(item => ouIdHelper.removePrefix(item.id)) : [],
|
|
213
|
-
onChange:
|
|
214
|
-
|
|
215
|
-
|
|
226
|
+
onChange: _ref6 => {
|
|
227
|
+
let {
|
|
228
|
+
selected
|
|
229
|
+
} = _ref6;
|
|
230
|
+
return onGroupChange(selected);
|
|
231
|
+
},
|
|
216
232
|
placeholder: i18n.t('Select a group'),
|
|
217
233
|
loading: !ouGroups.length,
|
|
218
234
|
dense: true,
|
|
@@ -7,23 +7,27 @@ import styles from './styles/PeriodFilter.style.js';
|
|
|
7
7
|
import { getFixedPeriodsOptions } from './utils/fixedPeriods.js';
|
|
8
8
|
import { filterPeriodTypesById } from './utils/index.js';
|
|
9
9
|
|
|
10
|
-
const FixedPeriodFilter =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
const FixedPeriodFilter = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
allowedPeriodTypes,
|
|
13
|
+
excludedPeriodTypes,
|
|
14
|
+
currentPeriodType,
|
|
15
|
+
currentYear,
|
|
16
|
+
onSelectPeriodType,
|
|
17
|
+
onSelectYear,
|
|
18
|
+
dataTest
|
|
19
|
+
} = _ref;
|
|
19
20
|
const onlyAllowedTypeIsSelected = Array.isArray(allowedPeriodTypes) && allowedPeriodTypes.length === 1 && allowedPeriodTypes[0] === currentPeriodType;
|
|
20
21
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
21
22
|
className: "jsx-".concat(styles.__hash) + " " + "leftSection"
|
|
22
23
|
}, /*#__PURE__*/React.createElement(SingleSelectField, {
|
|
23
24
|
label: i18n.t('Period type'),
|
|
24
|
-
onChange:
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
onChange: _ref2 => {
|
|
26
|
+
let {
|
|
27
|
+
selected
|
|
28
|
+
} = _ref2;
|
|
29
|
+
return onSelectPeriodType(selected);
|
|
30
|
+
},
|
|
27
31
|
dense: true,
|
|
28
32
|
selected: currentPeriodType,
|
|
29
33
|
disabled: onlyAllowedTypeIsSelected,
|
|
@@ -42,9 +46,12 @@ const FixedPeriodFilter = ({
|
|
|
42
46
|
type: "number",
|
|
43
47
|
placeholder: i18n.t('Select year'),
|
|
44
48
|
value: currentYear,
|
|
45
|
-
onChange:
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
onChange: _ref3 => {
|
|
50
|
+
let {
|
|
51
|
+
value
|
|
52
|
+
} = _ref3;
|
|
53
|
+
return onSelectYear(value);
|
|
54
|
+
},
|
|
48
55
|
dense: true,
|
|
49
56
|
dataTest: "".concat(dataTest, "-year")
|
|
50
57
|
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
@@ -11,8 +11,8 @@ import styles from './styles/FixedPeriodSelect.style.js';
|
|
|
11
11
|
import { parsePeriodCode, getFixedPeriodsOptionsById as getPeriodById, getYearOffsetFromNow } from './utils/fixedPeriods.js';
|
|
12
12
|
|
|
13
13
|
class FixedPeriodSelect extends Component {
|
|
14
|
-
constructor(
|
|
15
|
-
super(...
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
16
|
|
|
17
17
|
_defineProperty(this, "state", {
|
|
18
18
|
periodType: '',
|
|
@@ -36,20 +36,25 @@ class FixedPeriodSelect extends Component {
|
|
|
36
36
|
this.props.onChange();
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
_defineProperty(this, "onSelectPeriod", ({
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
_defineProperty(this, "onSelectPeriod", (_ref, event) => {
|
|
40
|
+
let {
|
|
41
|
+
selected: periodId
|
|
42
|
+
} = _ref;
|
|
43
|
+
const period = this.state.options.find(_ref2 => {
|
|
44
|
+
let {
|
|
45
|
+
id
|
|
46
|
+
} = _ref2;
|
|
47
|
+
return id === periodId;
|
|
48
|
+
});
|
|
45
49
|
this.props.onChange(period, event);
|
|
46
50
|
});
|
|
47
51
|
}
|
|
48
52
|
|
|
49
|
-
static getDerivedStateFromProps({
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
static getDerivedStateFromProps(_ref3) {
|
|
54
|
+
let {
|
|
55
|
+
value,
|
|
56
|
+
allowedPeriodTypes
|
|
57
|
+
} = _ref3;
|
|
53
58
|
const period = parsePeriodCode(value, allowedPeriodTypes);
|
|
54
59
|
|
|
55
60
|
if (!period) {
|
|
@@ -3,12 +3,14 @@ import React from 'react';
|
|
|
3
3
|
import { DIMENSION_ID_PERIOD } from '../../modules/predefinedDimensions.js';
|
|
4
4
|
import PeriodTransfer from './PeriodTransfer.js';
|
|
5
5
|
|
|
6
|
-
const PeriodDimension =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
const PeriodDimension = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
onSelect,
|
|
9
|
+
selectedPeriods,
|
|
10
|
+
rightFooter,
|
|
11
|
+
excludedPeriodTypes
|
|
12
|
+
} = _ref;
|
|
13
|
+
|
|
12
14
|
const selectPeriods = periods => {
|
|
13
15
|
onSelect({
|
|
14
16
|
dimensionId: DIMENSION_ID_PERIOD,
|
|
@@ -17,13 +17,14 @@ import { getFixedPeriodsOptionsById } from './utils/fixedPeriods.js';
|
|
|
17
17
|
import { MONTHLY, QUARTERLY } from './utils/index.js';
|
|
18
18
|
import { getRelativePeriodsOptionsById } from './utils/relativePeriods.js';
|
|
19
19
|
|
|
20
|
-
const PeriodTransfer =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
const PeriodTransfer = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
onSelect,
|
|
23
|
+
dataTest,
|
|
24
|
+
initialSelectedPeriods,
|
|
25
|
+
rightFooter,
|
|
26
|
+
excludedPeriodTypes
|
|
27
|
+
} = _ref;
|
|
27
28
|
const defaultRelativePeriodType = excludedPeriodTypes.includes(MONTHLY) ? getRelativePeriodsOptionsById(QUARTERLY) : getRelativePeriodsOptionsById(MONTHLY);
|
|
28
29
|
const defaultFixedPeriodType = excludedPeriodTypes.includes(MONTHLY) ? getFixedPeriodsOptionsById(QUARTERLY) : getFixedPeriodsOptionsById(MONTHLY);
|
|
29
30
|
const defaultFixedPeriodYear = new Date().getFullYear();
|
|
@@ -111,9 +112,10 @@ const PeriodTransfer = ({
|
|
|
111
112
|
}, styles));
|
|
112
113
|
|
|
113
114
|
return /*#__PURE__*/React.createElement(Transfer, {
|
|
114
|
-
onChange:
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
onChange: _ref2 => {
|
|
116
|
+
let {
|
|
117
|
+
selected
|
|
118
|
+
} = _ref2;
|
|
117
119
|
const formattedItems = selected.map(id => ({
|
|
118
120
|
id,
|
|
119
121
|
name: [...allPeriods, ...selectedPeriods].find(item => item.id === id).name
|
|
@@ -130,13 +132,16 @@ const PeriodTransfer = ({
|
|
|
130
132
|
selectedEmptyComponent: renderEmptySelection(),
|
|
131
133
|
rightHeader: renderRightHeader(),
|
|
132
134
|
rightFooter: rightFooter,
|
|
133
|
-
options: [...allPeriods, ...selectedPeriods].map(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
options: [...allPeriods, ...selectedPeriods].map(_ref3 => {
|
|
136
|
+
let {
|
|
137
|
+
id,
|
|
138
|
+
name
|
|
139
|
+
} = _ref3;
|
|
140
|
+
return {
|
|
141
|
+
label: name,
|
|
142
|
+
value: id
|
|
143
|
+
};
|
|
144
|
+
}),
|
|
140
145
|
renderOption: props => /*#__PURE__*/React.createElement(TransferOption, _extends({}, props, {
|
|
141
146
|
icon: PeriodIcon,
|
|
142
147
|
dataTest: "".concat(dataTest, "-transfer-option")
|
|
@@ -7,30 +7,36 @@ import styles from './styles/PeriodFilter.style.js';
|
|
|
7
7
|
import { filterPeriodTypesById } from './utils/index.js';
|
|
8
8
|
import { getRelativePeriodsOptions } from './utils/relativePeriods.js';
|
|
9
9
|
|
|
10
|
-
const RelativePeriodFilter =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
|
|
10
|
+
const RelativePeriodFilter = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
currentFilter,
|
|
13
|
+
onSelectFilter,
|
|
14
|
+
dataTest,
|
|
15
|
+
excludedPeriodTypes
|
|
16
|
+
} = _ref;
|
|
17
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
18
|
+
className: "jsx-".concat(styles.__hash) + " " + "leftSection"
|
|
19
|
+
}, /*#__PURE__*/React.createElement(SingleSelectField, {
|
|
20
|
+
label: i18n.t('Period type'),
|
|
21
|
+
onChange: _ref2 => {
|
|
22
|
+
let {
|
|
23
|
+
selected
|
|
24
|
+
} = _ref2;
|
|
25
|
+
return onSelectFilter(selected);
|
|
26
|
+
},
|
|
27
|
+
dense: true,
|
|
28
|
+
selected: currentFilter,
|
|
29
|
+
className: "filterElement",
|
|
30
|
+
dataTest: dataTest
|
|
31
|
+
}, filterPeriodTypesById(getRelativePeriodsOptions(), excludedPeriodTypes).map(option => /*#__PURE__*/React.createElement(SingleSelectOption, {
|
|
32
|
+
key: option.id,
|
|
33
|
+
value: option.id,
|
|
34
|
+
label: option.name,
|
|
35
|
+
dataTest: "".concat(dataTest, "-option-").concat(option.id)
|
|
36
|
+
}))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
37
|
+
id: styles.__hash
|
|
38
|
+
}, styles));
|
|
39
|
+
};
|
|
34
40
|
|
|
35
41
|
RelativePeriodFilter.propTypes = {
|
|
36
42
|
currentFilter: PropTypes.string.isRequired,
|
|
@@ -16,4 +16,8 @@ export const FYNOV = 'FYNOV';
|
|
|
16
16
|
export const FYOCT = 'FYOCT';
|
|
17
17
|
export const FYJUL = 'FYJUL';
|
|
18
18
|
export const FYAPR = 'FYAPR';
|
|
19
|
-
export const filterPeriodTypesById = (
|
|
19
|
+
export const filterPeriodTypesById = function () {
|
|
20
|
+
let allPeriodTypes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
21
|
+
let excludedPeriodTypes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
22
|
+
return allPeriodTypes.filter(period => !excludedPeriodTypes.includes(period.id));
|
|
23
|
+
};
|
|
@@ -9,13 +9,14 @@ import { PivotTableContainer } from './PivotTableContainer.js';
|
|
|
9
9
|
import { Provider } from './PivotTableEngineContext.js';
|
|
10
10
|
import { PivotTableHead } from './PivotTableHead.js';
|
|
11
11
|
|
|
12
|
-
const PivotTable =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
const PivotTable = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
visualization,
|
|
15
|
+
data,
|
|
16
|
+
legendSets,
|
|
17
|
+
renderCounter,
|
|
18
|
+
onToggleContextualMenu
|
|
19
|
+
} = _ref;
|
|
19
20
|
const containerRef = useRef(undefined);
|
|
20
21
|
const {
|
|
21
22
|
width,
|
|
@@ -3,26 +3,35 @@ import React from 'react';
|
|
|
3
3
|
import { PivotTableClippedAxis } from './PivotTableClippedAxis.js';
|
|
4
4
|
import { PivotTableEmptyRow } from './PivotTableEmptyRow.js';
|
|
5
5
|
import { PivotTableRow } from './PivotTableRow.js';
|
|
6
|
-
export const PivotTableBody =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
6
|
+
export const PivotTableBody = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
clippingResult,
|
|
9
|
+
onToggleContextualMenu
|
|
10
|
+
} = _ref;
|
|
11
|
+
return /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement(PivotTableClippedAxis, {
|
|
12
|
+
axisClippingResult: clippingResult.rows,
|
|
13
|
+
EmptyComponent: _ref2 => {
|
|
14
|
+
let {
|
|
15
|
+
size
|
|
16
|
+
} = _ref2;
|
|
17
|
+
return /*#__PURE__*/React.createElement(PivotTableEmptyRow, {
|
|
18
|
+
height: size,
|
|
19
|
+
columns: clippingResult.columns.indices
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
ItemComponent: _ref3 => {
|
|
23
|
+
let {
|
|
24
|
+
index
|
|
25
|
+
} = _ref3;
|
|
26
|
+
return /*#__PURE__*/React.createElement(PivotTableRow, {
|
|
27
|
+
key: index,
|
|
28
|
+
clippingResult: clippingResult,
|
|
29
|
+
rowIndex: index,
|
|
30
|
+
onToggleContextualMenu: onToggleContextualMenu
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
34
|
+
};
|
|
26
35
|
PivotTableBody.propTypes = {
|
|
27
36
|
clippingResult: PropTypes.object.isRequired,
|
|
28
37
|
onToggleContextualMenu: PropTypes.func
|
|
@@ -7,14 +7,15 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { usePivotTableEngine } from './PivotTableEngineContext.js';
|
|
9
9
|
import { cell as cellStyle } from './styles/PivotTable.style.js';
|
|
10
|
-
export const PivotTableCell = /*#__PURE__*/React.forwardRef(({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
export const PivotTableCell = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
11
|
+
let {
|
|
12
|
+
classes,
|
|
13
|
+
isHeader,
|
|
14
|
+
children,
|
|
15
|
+
dataTest,
|
|
16
|
+
style = {},
|
|
17
|
+
...props
|
|
18
|
+
} = _ref;
|
|
18
19
|
const engine = usePivotTableEngine();
|
|
19
20
|
style.width = style.minWidth = style.maxWidth = style.width;
|
|
20
21
|
style.height = style.minHeight = style.maxHeight = style.height || engine.fontSize + engine.cellPadding * 2 + 2;
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export const PivotTableClippedAxis =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
export const PivotTableClippedAxis = _ref => {
|
|
4
|
+
let {
|
|
5
|
+
axisClippingResult,
|
|
6
|
+
EmptyComponent,
|
|
7
|
+
ItemComponent
|
|
8
|
+
} = _ref;
|
|
9
|
+
return [axisClippingResult.pre ? /*#__PURE__*/React.createElement(EmptyComponent, {
|
|
10
|
+
key: "pre",
|
|
11
|
+
size: axisClippingResult.pre
|
|
12
|
+
}) : null, axisClippingResult.indices.map(index => /*#__PURE__*/React.createElement(ItemComponent, {
|
|
13
|
+
key: index,
|
|
14
|
+
index: index
|
|
15
|
+
})), axisClippingResult.post ? /*#__PURE__*/React.createElement(EmptyComponent, {
|
|
16
|
+
key: "post",
|
|
17
|
+
size: axisClippingResult.post
|
|
18
|
+
}) : null];
|
|
19
|
+
};
|
|
17
20
|
PivotTableClippedAxis.propTypes = {
|
|
18
21
|
axisClippingResult: PropTypes.object.isRequired,
|
|
19
22
|
EmptyComponent: PropTypes.func,
|
|
@@ -6,15 +6,16 @@ import { usePivotTableEngine } from './PivotTableEngineContext.js';
|
|
|
6
6
|
import { PivotTableHeaderCell } from './PivotTableHeaderCell.js';
|
|
7
7
|
import { PivotTableSortIcon } from './PivotTableSortIcon.js';
|
|
8
8
|
import { cell as cellStyle } from './styles/PivotTable.style.js';
|
|
9
|
-
export const PivotTableColumnHeaderCell =
|
|
10
|
-
clippingResult,
|
|
11
|
-
index,
|
|
12
|
-
level,
|
|
13
|
-
onSortByColumn,
|
|
14
|
-
sortBy
|
|
15
|
-
}) => {
|
|
9
|
+
export const PivotTableColumnHeaderCell = _ref => {
|
|
16
10
|
var _engine$adaptiveClipp;
|
|
17
11
|
|
|
12
|
+
let {
|
|
13
|
+
clippingResult,
|
|
14
|
+
index,
|
|
15
|
+
level,
|
|
16
|
+
onSortByColumn,
|
|
17
|
+
sortBy
|
|
18
|
+
} = _ref;
|
|
18
19
|
const engine = usePivotTableEngine();
|
|
19
20
|
const width = (_engine$adaptiveClipp = engine.adaptiveClippingController.columns.sizes[engine.columnMap[index]]) === null || _engine$adaptiveClipp === void 0 ? void 0 : _engine$adaptiveClipp.size;
|
|
20
21
|
const height = engine.adaptiveClippingController.rows.headerSizes[level];
|