@hisptz/dhis2-analytics 1.0.10 → 1.0.11
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/components/ChartAnalytics/ChartAnalytics.stories.js +1 -1
- package/build/cjs/components/CircularProgressDashboard/CircularProgressIndicator.stories.js +1 -1
- package/build/cjs/components/Map/Map.stories.js +1 -1
- package/build/cjs/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +1 -1
- package/build/cjs/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +1 -1
- package/build/cjs/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +8 -1
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +1 -1
- package/build/cjs/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +1 -1
- package/build/cjs/components/PivotTable/PivotTable.stories.js +277 -0
- package/build/cjs/components/PivotTable/components/AssignedCategoriesIcon/index.js +32 -0
- package/build/cjs/components/PivotTable/components/PivotTable.js +60 -0
- package/build/cjs/components/PivotTable/components/PivotTableBody.js +41 -0
- package/build/cjs/components/PivotTable/components/PivotTableCell.js +40 -0
- package/build/cjs/components/PivotTable/components/PivotTableClippedAxis.js +26 -0
- package/build/cjs/components/PivotTable/components/PivotTableColumnHeaderCell.js +71 -0
- package/build/cjs/components/PivotTable/components/PivotTableColumnHeaders.js +60 -0
- package/build/cjs/components/PivotTable/components/PivotTableContainer.js +33 -0
- package/build/cjs/components/PivotTable/components/PivotTableDimensionLabelCell.js +77 -0
- package/build/cjs/components/PivotTable/components/PivotTableEmptyCell.js +22 -0
- package/build/cjs/components/PivotTable/components/PivotTableEmptyRow.js +33 -0
- package/build/cjs/components/PivotTable/components/PivotTableEngineContext.js +25 -0
- package/build/cjs/components/PivotTable/components/PivotTableHead.js +35 -0
- package/build/cjs/components/PivotTable/components/PivotTableHeaderCell.js +37 -0
- package/build/cjs/components/PivotTable/components/PivotTableRow.js +65 -0
- package/build/cjs/components/PivotTable/components/PivotTableRowHeaderCell.js +49 -0
- package/build/cjs/components/PivotTable/components/PivotTableTitleRow.js +52 -0
- package/build/cjs/components/PivotTable/components/PivotTableTitleRows.js +46 -0
- package/build/cjs/components/PivotTable/components/PivotTableValueCell.js +69 -0
- package/build/cjs/components/PivotTable/constants/dataTypes.js +129 -0
- package/build/cjs/components/PivotTable/constants/pivotTable.js +64 -0
- package/build/cjs/components/PivotTable/constants/predefinedDimensions.js +62 -0
- package/build/cjs/components/PivotTable/constants/valueTypes.js +55 -0
- package/build/cjs/components/PivotTable/data/column-data.json +210 -0
- package/build/cjs/components/PivotTable/hooks/useParentSize.js +41 -0
- package/build/cjs/components/PivotTable/hooks/useScrollPosition.js +38 -0
- package/build/cjs/components/PivotTable/hooks/useSortableColumns.js +34 -0
- package/build/cjs/components/PivotTable/hooks/useTableClipping.js +53 -0
- package/build/cjs/components/PivotTable/index.js +47 -0
- package/build/cjs/components/PivotTable/interfaces/index.js +1 -0
- package/build/cjs/components/PivotTable/services/adaptiveClippingController.js +197 -0
- package/build/cjs/components/PivotTable/services/engine.js +901 -0
- package/build/cjs/components/PivotTable/utils/getOuLevelAndGroupText.js +71 -0
- package/build/cjs/components/PivotTable/utils/index.js +322 -0
- package/build/cjs/components/PivotTable/utils/isColorBright.js +29 -0
- package/build/cjs/components/PivotTable/utils/layout/dimension.js +61 -0
- package/build/cjs/components/PivotTable/utils/layout/dimensionGetId.js +12 -0
- package/build/cjs/components/PivotTable/utils/layout/dimensionGetItems.js +12 -0
- package/build/cjs/components/PivotTable/utils/layout/dimensionIs.js +9 -0
- package/build/cjs/components/PivotTable/utils/layout/dimensionIsEmpty.js +9 -0
- package/build/cjs/components/PivotTable/utils/layout/dimensionIsValid.js +25 -0
- package/build/cjs/components/PivotTable/utils/legend.js +40 -0
- package/build/cjs/components/PivotTable/utils/ouIdHelper/index.js +27 -0
- package/build/cjs/components/SingleValueContainer/SingleValueContainer.stories.js +1 -1
- package/build/cjs/index.js +11 -0
- package/build/cjs/locales/en/translations.json +33 -0
- package/build/es/components/ChartAnalytics/ChartAnalytics.stories.js +1 -1
- package/build/es/components/CircularProgressDashboard/CircularProgressIndicator.stories.js +1 -1
- package/build/es/components/Map/Map.stories.js +1 -1
- package/build/es/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfigModal.stories.js +1 -1
- package/build/es/components/Map/components/EarthEngineLayerConfiguration/EarthEngineLayerConfiguration.stories.js +1 -1
- package/build/es/components/Map/components/MapProvider/components/MapLayerProvider/hooks/index.js +8 -1
- package/build/es/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfigModal.stories.js +1 -1
- package/build/es/components/Map/components/ThematicLayerConfiguration/ThematicLayerConfiguration.stories.js +1 -1
- package/build/es/components/PivotTable/PivotTable.stories.js +268 -0
- package/build/es/components/PivotTable/components/AssignedCategoriesIcon/index.js +24 -0
- package/build/es/components/PivotTable/components/PivotTable.js +51 -0
- package/build/es/components/PivotTable/components/PivotTableBody.js +33 -0
- package/build/es/components/PivotTable/components/PivotTableCell.js +32 -0
- package/build/es/components/PivotTable/components/PivotTableClippedAxis.js +18 -0
- package/build/es/components/PivotTable/components/PivotTableColumnHeaderCell.js +62 -0
- package/build/es/components/PivotTable/components/PivotTableColumnHeaders.js +52 -0
- package/build/es/components/PivotTable/components/PivotTableContainer.js +25 -0
- package/build/es/components/PivotTable/components/PivotTableDimensionLabelCell.js +68 -0
- package/build/es/components/PivotTable/components/PivotTableEmptyCell.js +14 -0
- package/build/es/components/PivotTable/components/PivotTableEmptyRow.js +25 -0
- package/build/es/components/PivotTable/components/PivotTableEngineContext.js +14 -0
- package/build/es/components/PivotTable/components/PivotTableHead.js +27 -0
- package/build/es/components/PivotTable/components/PivotTableHeaderCell.js +29 -0
- package/build/es/components/PivotTable/components/PivotTableRow.js +57 -0
- package/build/es/components/PivotTable/components/PivotTableRowHeaderCell.js +41 -0
- package/build/es/components/PivotTable/components/PivotTableTitleRow.js +42 -0
- package/build/es/components/PivotTable/components/PivotTableTitleRows.js +37 -0
- package/build/es/components/PivotTable/components/PivotTableValueCell.js +60 -0
- package/build/es/components/PivotTable/constants/dataTypes.js +98 -0
- package/build/es/components/PivotTable/constants/pivotTable.js +29 -0
- package/build/es/components/PivotTable/constants/predefinedDimensions.js +44 -0
- package/build/es/components/PivotTable/constants/valueTypes.js +27 -0
- package/build/es/components/PivotTable/data/column-data.json +210 -0
- package/build/es/components/PivotTable/hooks/useParentSize.js +33 -0
- package/build/es/components/PivotTable/hooks/useScrollPosition.js +30 -0
- package/build/es/components/PivotTable/hooks/useSortableColumns.js +27 -0
- package/build/es/components/PivotTable/hooks/useTableClipping.js +46 -0
- package/build/es/components/PivotTable/index.js +26 -0
- package/build/es/components/PivotTable/interfaces/index.js +1 -0
- package/build/es/components/PivotTable/services/adaptiveClippingController.js +191 -0
- package/build/es/components/PivotTable/services/engine.js +894 -0
- package/build/es/components/PivotTable/utils/getOuLevelAndGroupText.js +63 -0
- package/build/es/components/PivotTable/utils/index.js +309 -0
- package/build/es/components/PivotTable/utils/isColorBright.js +22 -0
- package/build/es/components/PivotTable/utils/layout/dimension.js +48 -0
- package/build/es/components/PivotTable/utils/layout/dimensionGetId.js +5 -0
- package/build/es/components/PivotTable/utils/layout/dimensionGetItems.js +5 -0
- package/build/es/components/PivotTable/utils/layout/dimensionIs.js +2 -0
- package/build/es/components/PivotTable/utils/layout/dimensionIsEmpty.js +2 -0
- package/build/es/components/PivotTable/utils/layout/dimensionIsValid.js +18 -0
- package/build/es/components/PivotTable/utils/legend.js +27 -0
- package/build/es/components/PivotTable/utils/ouIdHelper/index.js +17 -0
- package/build/es/components/SingleValueContainer/SingleValueContainer.stories.js +1 -1
- package/build/es/index.js +1 -0
- package/build/es/locales/en/translations.json +33 -0
- package/build/types/components/PivotTable/components/AssignedCategoriesIcon/index.d.ts +3 -0
- package/build/types/components/PivotTable/components/PivotTable.d.ts +12 -0
- package/build/types/components/PivotTable/components/PivotTableBody.d.ts +7 -0
- package/build/types/components/PivotTable/components/PivotTableCell.d.ts +17 -0
- package/build/types/components/PivotTable/components/PivotTableClippedAxis.d.ts +7 -0
- package/build/types/components/PivotTable/components/PivotTableColumnHeaderCell.d.ts +13 -0
- package/build/types/components/PivotTable/components/PivotTableColumnHeaders.d.ts +11 -0
- package/build/types/components/PivotTable/components/PivotTableContainer.d.ts +8 -0
- package/build/types/components/PivotTable/components/PivotTableDimensionLabelCell.d.ts +13 -0
- package/build/types/components/PivotTable/components/PivotTableEmptyCell.d.ts +7 -0
- package/build/types/components/PivotTable/components/PivotTableEmptyRow.d.ts +5 -0
- package/build/types/components/PivotTable/components/PivotTableEngineContext.d.ts +8 -0
- package/build/types/components/PivotTable/components/PivotTableHead.d.ts +21 -0
- package/build/types/components/PivotTable/components/PivotTableHeaderCell.d.ts +22 -0
- package/build/types/components/PivotTable/components/PivotTableRow.d.ts +19 -0
- package/build/types/components/PivotTable/components/PivotTableRowHeaderCell.d.ts +8 -0
- package/build/types/components/PivotTable/components/PivotTableTitleRow.d.ts +21 -0
- package/build/types/components/PivotTable/components/PivotTableTitleRows.d.ts +12 -0
- package/build/types/components/PivotTable/components/PivotTableValueCell.d.ts +8 -0
- package/build/types/components/PivotTable/constants/dataTypes.d.ts +90 -0
- package/build/types/components/PivotTable/constants/pivotTable.d.ts +29 -0
- package/build/types/components/PivotTable/constants/predefinedDimensions.d.ts +80 -0
- package/build/types/components/PivotTable/constants/valueTypes.d.ts +22 -0
- package/build/types/components/PivotTable/hooks/useParentSize.d.ts +8 -0
- package/build/types/components/PivotTable/hooks/useScrollPosition.d.ts +5 -0
- package/build/types/components/PivotTable/hooks/useSortableColumns.d.ts +8 -0
- package/build/types/components/PivotTable/hooks/useTableClipping.d.ts +24 -0
- package/build/types/components/PivotTable/index.d.ts +26 -0
- package/build/types/components/PivotTable/interfaces/index.d.ts +72 -0
- package/build/types/components/PivotTable/services/adaptiveClippingController.d.ts +44 -0
- package/build/types/components/PivotTable/services/engine.d.ts +252 -0
- package/build/types/components/PivotTable/utils/getOuLevelAndGroupText.d.ts +1 -0
- package/build/types/components/PivotTable/utils/index.d.ts +38 -0
- package/build/types/components/PivotTable/utils/isColorBright.d.ts +1 -0
- package/build/types/components/PivotTable/utils/layout/dimension.d.ts +35 -0
- package/build/types/components/PivotTable/utils/layout/dimensionGetId.d.ts +3 -0
- package/build/types/components/PivotTable/utils/layout/dimensionGetItems.d.ts +3 -0
- package/build/types/components/PivotTable/utils/layout/dimensionIs.d.ts +1 -0
- package/build/types/components/PivotTable/utils/layout/dimensionIsEmpty.d.ts +3 -0
- package/build/types/components/PivotTable/utils/layout/dimensionIsValid.d.ts +5 -0
- package/build/types/components/PivotTable/utils/legend.d.ts +11 -0
- package/build/types/components/PivotTable/utils/ouIdHelper/index.d.ts +10 -0
- package/build/types/index.d.ts +1 -0
- package/package.json +6 -3
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface PivotTableContainerProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
height: number;
|
|
5
|
+
width: number;
|
|
6
|
+
tableProps?: Record<string, any>;
|
|
7
|
+
}
|
|
8
|
+
export declare const PivotTableContainer: React.ForwardRefExoticComponent<PivotTableContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
export interface PivotTableDimensionLabelCellProps {
|
|
4
|
+
rowLevel: number;
|
|
5
|
+
columnLevel: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const PivotTableDimensionLabelCell: {
|
|
8
|
+
({ rowLevel, columnLevel }: PivotTableDimensionLabelCellProps): JSX.Element | null;
|
|
9
|
+
propTypes: {
|
|
10
|
+
columnLevel: PropTypes.Validator<number>;
|
|
11
|
+
rowLevel: PropTypes.Validator<number>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface PivotTableEmptyCellProps {
|
|
3
|
+
classes?: any[] | string;
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
export declare const PivotTableEmptyCell: React.ForwardRefExoticComponent<Pick<PivotTableEmptyCellProps, keyof PivotTableEmptyCellProps> & React.RefAttributes<HTMLTableCellElement | null>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PivotTableEngine } from "../services/engine";
|
|
3
|
+
export declare const PivotTableEngineContext: React.Context<PivotTableEngine | null>;
|
|
4
|
+
export declare const Provider: ({ engine, children }: {
|
|
5
|
+
engine: PivotTableEngine;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}) => JSX.Element;
|
|
8
|
+
export declare const usePivotTableEngine: () => PivotTableEngine | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { ClippingResult } from "../interfaces";
|
|
4
|
+
export interface PivotTableHeadProps {
|
|
5
|
+
clippingResult: ClippingResult;
|
|
6
|
+
width: number;
|
|
7
|
+
sortBy: {
|
|
8
|
+
order: number;
|
|
9
|
+
column: number;
|
|
10
|
+
} | null;
|
|
11
|
+
onSortByColumn: (column: number) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const PivotTableHead: {
|
|
14
|
+
({ clippingResult, width, sortBy, onSortByColumn, }: PivotTableHeadProps): JSX.Element;
|
|
15
|
+
propTypes: {
|
|
16
|
+
clippingResult: PropTypes.Validator<object>;
|
|
17
|
+
width: PropTypes.Validator<number>;
|
|
18
|
+
onSortByColumn: PropTypes.Validator<(...args: any[]) => any>;
|
|
19
|
+
sortBy: PropTypes.Requireable<object>;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { AxisClippingResult } from "../interfaces";
|
|
3
|
+
import React from "react";
|
|
4
|
+
export interface PivotTableHeaderCellProps {
|
|
5
|
+
axisClippingResult: AxisClippingResult;
|
|
6
|
+
index: number;
|
|
7
|
+
level: number;
|
|
8
|
+
getHeader: (id: string) => Record<string, any>;
|
|
9
|
+
render: (element: Record<string, any>) => React.ReactElement;
|
|
10
|
+
showHierarchy?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const PivotTableHeaderCell: {
|
|
13
|
+
({ axisClippingResult, index, level, getHeader, render, showHierarchy, }: PivotTableHeaderCellProps): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
14
|
+
propTypes: {
|
|
15
|
+
axisClippingResult: PropTypes.Validator<object>;
|
|
16
|
+
getHeader: PropTypes.Validator<(...args: any[]) => any>;
|
|
17
|
+
index: PropTypes.Validator<number>;
|
|
18
|
+
level: PropTypes.Validator<number>;
|
|
19
|
+
render: PropTypes.Validator<(...args: any[]) => any>;
|
|
20
|
+
showHierarchy: PropTypes.Validator<boolean>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { ClippingResult, ToggleContextualMenuFunction } from "../interfaces";
|
|
4
|
+
export interface PivotTableRowProps {
|
|
5
|
+
clippingResult: ClippingResult;
|
|
6
|
+
rowIndex: number;
|
|
7
|
+
onToggleContextualMenu?: ToggleContextualMenuFunction;
|
|
8
|
+
}
|
|
9
|
+
export declare const PivotTableRow: {
|
|
10
|
+
({ clippingResult, rowIndex, onToggleContextualMenu, }: PivotTableRowProps): JSX.Element | null;
|
|
11
|
+
propTypes: {
|
|
12
|
+
clippingResult: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
13
|
+
columns: PropTypes.Validator<object>;
|
|
14
|
+
rows: PropTypes.Validator<object>;
|
|
15
|
+
}>>>;
|
|
16
|
+
rowIndex: PropTypes.Validator<number>;
|
|
17
|
+
onToggleContextualMenu: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ClippingResult } from "../interfaces";
|
|
3
|
+
export interface PivotTableRowHeaderCellProps {
|
|
4
|
+
clippingResult: ClippingResult;
|
|
5
|
+
rowIndex: number;
|
|
6
|
+
rowLevel: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const PivotTableRowHeaderCell: ({ clippingResult, rowIndex, rowLevel, }: PivotTableRowHeaderCellProps) => JSX.Element | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
export interface PivotTableTitleRowProps {
|
|
4
|
+
containerWidth: number;
|
|
5
|
+
scrollPosition: {
|
|
6
|
+
x: number;
|
|
7
|
+
};
|
|
8
|
+
title: string;
|
|
9
|
+
totalWidth: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const PivotTableTitleRow: {
|
|
12
|
+
({ title, scrollPosition, containerWidth, totalWidth, }: PivotTableTitleRowProps): JSX.Element | null;
|
|
13
|
+
propTypes: {
|
|
14
|
+
containerWidth: PropTypes.Validator<number>;
|
|
15
|
+
scrollPosition: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
16
|
+
x: PropTypes.Validator<number>;
|
|
17
|
+
}>>>;
|
|
18
|
+
title: PropTypes.Validator<string>;
|
|
19
|
+
totalWidth: PropTypes.Validator<number>;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
export declare const PivotTableTitleRows: {
|
|
4
|
+
({ clippingResult, width }: {
|
|
5
|
+
clippingResult: Record<string, any>;
|
|
6
|
+
width: number;
|
|
7
|
+
}): JSX.Element | null;
|
|
8
|
+
propTypes: {
|
|
9
|
+
clippingResult: PropTypes.Validator<object>;
|
|
10
|
+
width: PropTypes.Validator<number>;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ToggleContextualMenuFunction } from "../interfaces";
|
|
3
|
+
export interface PivotTableValueCellProps {
|
|
4
|
+
row: number;
|
|
5
|
+
column: number;
|
|
6
|
+
onToggleContextualMenu?: ToggleContextualMenuFunction;
|
|
7
|
+
}
|
|
8
|
+
export declare const PivotTableValueCell: ({ row, column, onToggleContextualMenu, }: PivotTableValueCellProps) => JSX.Element | null;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export type DataDimensionType = 'INDICATOR' | 'DATA_ELEMENT' | 'DATA_SET' | 'EVENT_DATA_ITEM' | 'PROGRAM_INDICATOR';
|
|
2
|
+
export declare const DIMENSION_TYPE_ALL = "ALL";
|
|
3
|
+
export declare const DIMENSION_TYPE_INDICATOR = "INDICATOR";
|
|
4
|
+
export declare const DIMENSION_TYPE_DATA_ELEMENT = "DATA_ELEMENT";
|
|
5
|
+
export declare const DIMENSION_TYPE_DATA_SET = "DATA_SET";
|
|
6
|
+
export declare const DIMENSION_TYPE_EVENT_DATA_ITEM = "EVENT_DATA_ITEM";
|
|
7
|
+
export declare const DIMENSION_TYPE_PROGRAM_INDICATOR = "PROGRAM_INDICATOR";
|
|
8
|
+
export declare const DIMENSION_TYPE_PROGRAM_DATA_ELEMENT = "PROGRAM_DATA_ELEMENT";
|
|
9
|
+
export declare const DIMENSION_TYPE_PROGRAM_ATTRIBUTE = "PROGRAM_ATTRIBUTE";
|
|
10
|
+
export declare const DIMENSION_TYPE_DATA_ELEMENT_OPERAND = "DATA_ELEMENT_OPERAND";
|
|
11
|
+
export declare const DIMENSION_TYPE_CATEGORY = "CATEGORY";
|
|
12
|
+
export declare const DIMENSION_TYPE_CATEGORY_OPTION_GROUP_SET = "CATEGORY_OPTION_GROUP_SET";
|
|
13
|
+
export declare const DIMENSION_TYPE_DATA_ELEMENT_GROUP_SET = "DATA_ELEMENT_GROUP_SET";
|
|
14
|
+
export declare const DIMENSION_TYPE_DATA = "DATA_X";
|
|
15
|
+
export declare const DIMENSION_TYPE_PERIOD = "PERIOD";
|
|
16
|
+
export declare const DIMENSION_TYPE_ORGANISATION_UNIT = "ORGANISATION_UNIT";
|
|
17
|
+
export declare const DIMENSION_TYPE_ORGANISATION_UNIT_GROUP_SET = "ORGANISATION_UNIT_GROUP_SET";
|
|
18
|
+
export declare const TOTALS = "totals";
|
|
19
|
+
export declare const DETAIL = "detail";
|
|
20
|
+
export declare const SUB_GROUP_DETAIL = "DETAIL";
|
|
21
|
+
export declare const SUB_GROUP_METRIC = "METRIC";
|
|
22
|
+
export declare const dataTypeMap: {
|
|
23
|
+
INDICATOR: {
|
|
24
|
+
id: string;
|
|
25
|
+
getName: () => any;
|
|
26
|
+
getGroupLabel: () => any;
|
|
27
|
+
defaultGroup: {
|
|
28
|
+
id: string;
|
|
29
|
+
getName: () => any;
|
|
30
|
+
};
|
|
31
|
+
getItemName: () => any;
|
|
32
|
+
getGroupEmptyLabel: () => any;
|
|
33
|
+
getGroupLoadingLabel: () => any;
|
|
34
|
+
};
|
|
35
|
+
DATA_ELEMENT: {
|
|
36
|
+
id: string;
|
|
37
|
+
getName: () => any;
|
|
38
|
+
getGroupLabel: () => any;
|
|
39
|
+
defaultGroup: {
|
|
40
|
+
id: string;
|
|
41
|
+
getName: () => any;
|
|
42
|
+
};
|
|
43
|
+
subGroup: string;
|
|
44
|
+
getItemName: () => any;
|
|
45
|
+
getGroupEmptyLabel: () => any;
|
|
46
|
+
getGroupLoadingLabel: () => any;
|
|
47
|
+
};
|
|
48
|
+
DATA_SET: {
|
|
49
|
+
id: string;
|
|
50
|
+
getName: () => any;
|
|
51
|
+
getGroupLabel: () => any;
|
|
52
|
+
defaultGroup: {
|
|
53
|
+
id: string;
|
|
54
|
+
getName: () => any;
|
|
55
|
+
};
|
|
56
|
+
subGroup: string;
|
|
57
|
+
getItemName: () => any;
|
|
58
|
+
getGroupEmptyLabel: () => any;
|
|
59
|
+
getGroupLoadingLabel: () => any;
|
|
60
|
+
};
|
|
61
|
+
EVENT_DATA_ITEM: {
|
|
62
|
+
id: string;
|
|
63
|
+
getName: () => any;
|
|
64
|
+
getGroupLabel: () => any;
|
|
65
|
+
getPlaceholder: () => any;
|
|
66
|
+
defaultGroup: {
|
|
67
|
+
id: string;
|
|
68
|
+
getName: () => any;
|
|
69
|
+
};
|
|
70
|
+
getItemName: () => any;
|
|
71
|
+
getGroupEmptyLabel: () => any;
|
|
72
|
+
getGroupLoadingLabel: () => any;
|
|
73
|
+
};
|
|
74
|
+
PROGRAM_INDICATOR: {
|
|
75
|
+
id: string;
|
|
76
|
+
getName: () => any;
|
|
77
|
+
getGroupLabel: () => any;
|
|
78
|
+
getPlaceholder: () => any;
|
|
79
|
+
defaultGroup: {
|
|
80
|
+
id: string;
|
|
81
|
+
getName: () => any;
|
|
82
|
+
};
|
|
83
|
+
getItemName: () => any;
|
|
84
|
+
getGroupEmptyLabel: () => any;
|
|
85
|
+
getGroupLoadingLabel: () => any;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export declare function defaultGroupId(dataType: DataDimensionType): string;
|
|
89
|
+
export declare function defaultGroupDetail(dataType: DataDimensionType): any;
|
|
90
|
+
export declare const DEFAULT_DATATYPE_ID = "INDICATOR";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const SORT_ORDER_ASCENDING = 1;
|
|
2
|
+
export declare const SORT_ORDER_DESCENDING = -1;
|
|
3
|
+
export declare const CELL_TYPE_VALUE = "value";
|
|
4
|
+
export declare const CELL_TYPE_SUBTOTAL = "subtotal";
|
|
5
|
+
export declare const CELL_TYPE_TOTAL = "total";
|
|
6
|
+
export declare const AGGREGATE_TYPE_SUM = "SUM";
|
|
7
|
+
export declare const AGGREGATE_TYPE_AVERAGE = "AVERAGE";
|
|
8
|
+
export declare const AGGREGATE_TYPE_NA = "N/A";
|
|
9
|
+
export declare const NUMBER_TYPE_VALUE = "VALUE";
|
|
10
|
+
export declare const NUMBER_TYPE_ROW_PERCENTAGE = "ROW_PERCENTAGE";
|
|
11
|
+
export declare const NUMBER_TYPE_COLUMN_PERCENTAGE = "COLUMN_PERCENTAGE";
|
|
12
|
+
export declare const BORDER_COLOR = "#b2b2b2";
|
|
13
|
+
export declare const FONT_SIZE_OPTION_SMALL = "SMALL";
|
|
14
|
+
export declare const FONT_SIZE_SMALL = 10;
|
|
15
|
+
export declare const FONT_SIZE_OPTION_NORMAL = "NORMAL";
|
|
16
|
+
export declare const FONT_SIZE_NORMAL = 11;
|
|
17
|
+
export declare const FONT_SIZE_OPTION_LARGE = "LARGE";
|
|
18
|
+
export declare const FONT_SIZE_LARGE = 13;
|
|
19
|
+
export declare const DISPLAY_DENSITY_OPTION_COMPACT = "COMPACT";
|
|
20
|
+
export declare const DISPLAY_DENSITY_PADDING_COMPACT = 4;
|
|
21
|
+
export declare const DISPLAY_DENSITY_OPTION_NORMAL = "NORMAL";
|
|
22
|
+
export declare const DISPLAY_DENSITY_PADDING_NORMAL = 5;
|
|
23
|
+
export declare const DISPLAY_DENSITY_OPTION_COMFORTABLE = "COMFORTABLE";
|
|
24
|
+
export declare const DISPLAY_DENSITY_PADDING_COMFORTABLE = 7;
|
|
25
|
+
export declare const CLIPPED_CELL_MAX_SIZE = 360;
|
|
26
|
+
export declare const CLIPPED_CELL_MIN_SIZE = 36;
|
|
27
|
+
export declare const WRAPPED_TEXT_JUSTIFY_BUFFER = 25;
|
|
28
|
+
export declare const WRAPPED_TEXT_LINE_HEIGHT = 1;
|
|
29
|
+
export declare const CLIPPED_AXIS_PARTITION_SIZE_PX = 1000;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const DIMENSION_ID_DATA = "dx";
|
|
3
|
+
export declare const DIMENSION_ID_PERIOD = "pe";
|
|
4
|
+
export declare const DIMENSION_ID_ORGUNIT = "ou";
|
|
5
|
+
export declare const DIMENSION_ID_ASSIGNED_CATEGORIES = "co";
|
|
6
|
+
export declare const DIMENSION_PROP_NO_ITEMS = "noItems";
|
|
7
|
+
export declare const getFixedDimensions: () => {
|
|
8
|
+
dx: {
|
|
9
|
+
id: string;
|
|
10
|
+
name: any;
|
|
11
|
+
iconName: string;
|
|
12
|
+
icon: any;
|
|
13
|
+
};
|
|
14
|
+
pe: {
|
|
15
|
+
id: string;
|
|
16
|
+
name: any;
|
|
17
|
+
iconName: string;
|
|
18
|
+
icon: any;
|
|
19
|
+
};
|
|
20
|
+
ou: {
|
|
21
|
+
id: string;
|
|
22
|
+
name: any;
|
|
23
|
+
iconName: string;
|
|
24
|
+
icon: any;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare const getDynamicDimensions: () => {
|
|
28
|
+
co: {
|
|
29
|
+
id: string;
|
|
30
|
+
name: any;
|
|
31
|
+
iconName: string;
|
|
32
|
+
icon: () => JSX.Element;
|
|
33
|
+
noItems: boolean;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export declare const getPredefinedDimensions: () => {
|
|
37
|
+
co: {
|
|
38
|
+
id: string;
|
|
39
|
+
name: any;
|
|
40
|
+
iconName: string;
|
|
41
|
+
icon: () => JSX.Element;
|
|
42
|
+
noItems: boolean;
|
|
43
|
+
};
|
|
44
|
+
dx: {
|
|
45
|
+
id: string;
|
|
46
|
+
name: any;
|
|
47
|
+
iconName: string;
|
|
48
|
+
icon: any;
|
|
49
|
+
};
|
|
50
|
+
pe: {
|
|
51
|
+
id: string;
|
|
52
|
+
name: any;
|
|
53
|
+
iconName: string;
|
|
54
|
+
icon: any;
|
|
55
|
+
};
|
|
56
|
+
ou: {
|
|
57
|
+
id: string;
|
|
58
|
+
name: any;
|
|
59
|
+
iconName: string;
|
|
60
|
+
icon: any;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export declare const filterOutPredefinedDimensions: (dimensionIds: string[]) => string[];
|
|
64
|
+
export declare const getPredefinedDimensionProp: (dimensionId: "ou" | "pe" | "dx", propName: "id" | "name" | "iconName") => any;
|
|
65
|
+
export declare const getDimensionById: (dimensionId: "ou" | "pe" | "dx") => {
|
|
66
|
+
id: string;
|
|
67
|
+
name: any;
|
|
68
|
+
iconName: string;
|
|
69
|
+
icon: any;
|
|
70
|
+
} | {
|
|
71
|
+
id: string;
|
|
72
|
+
name: any;
|
|
73
|
+
iconName: string;
|
|
74
|
+
icon: any;
|
|
75
|
+
} | {
|
|
76
|
+
id: string;
|
|
77
|
+
name: any;
|
|
78
|
+
iconName: string;
|
|
79
|
+
icon: any;
|
|
80
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const VALUE_TYPE_NUMBER = "NUMBER";
|
|
2
|
+
export declare const VALUE_TYPE_UNIT_INTERVAL = "UNIT_INTERVAL";
|
|
3
|
+
export declare const VALUE_TYPE_PERCENTAGE = "PERCENTAGE";
|
|
4
|
+
export declare const VALUE_TYPE_INTEGER = "INTEGER";
|
|
5
|
+
export declare const VALUE_TYPE_INTEGER_POSITIVE = "INTEGER_POSITIVE";
|
|
6
|
+
export declare const VALUE_TYPE_INTEGER_NEGATIVE = "INTEGER_NEGATIVE";
|
|
7
|
+
export declare const VALUE_TYPE_INTEGER_ZERO_OR_POSITIVE = "INTEGER_ZERO_OR_POSITIVE";
|
|
8
|
+
export declare const VALUE_TYPE_TEXT = "TEXT";
|
|
9
|
+
export declare const VALUE_TYPE_LONG_TEXT = "LONG_TEXT";
|
|
10
|
+
export declare const VALUE_TYPE_LETTER = "LETTER";
|
|
11
|
+
export declare const VALUE_TYPE_PHONE_NUMBER = "PHONE_NUMBER";
|
|
12
|
+
export declare const VALUE_TYPE_EMAIL = "EMAIL";
|
|
13
|
+
export declare const VALUE_TYPE_USERNAME = "USERNAME";
|
|
14
|
+
export declare const VALUE_TYPE_URL = "URL";
|
|
15
|
+
export declare const VALUE_TYPE_BOOLEAN = "BOOLEAN";
|
|
16
|
+
export declare const VALUE_TYPE_TRUE_ONLY = "TRUE_ONLY";
|
|
17
|
+
export declare const VALUE_TYPE_DATE = "DATE";
|
|
18
|
+
export declare const VALUE_TYPE_TIME = "TIME";
|
|
19
|
+
export declare const VALUE_TYPE_DATETIME = "DATETIME";
|
|
20
|
+
export declare const VALUE_TYPE_ORGANISATION_UNIT = "ORGANISATION_UNIT";
|
|
21
|
+
export declare const VALUE_TYPE_AGE = "AGE";
|
|
22
|
+
export declare const isNumericValueType: (type: string) => boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
import { PivotTableEngine } from "../services/engine";
|
|
3
|
+
export interface UseTableClippingParams {
|
|
4
|
+
containerRef: ReturnType<typeof useRef<HTMLElement | null>>;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
engine: PivotTableEngine;
|
|
8
|
+
}
|
|
9
|
+
export declare const useTableClipping: ({ containerRef, width, height, engine }: UseTableClippingParams) => {
|
|
10
|
+
rows: {
|
|
11
|
+
indices: number[];
|
|
12
|
+
pre: any;
|
|
13
|
+
post: number;
|
|
14
|
+
};
|
|
15
|
+
columns: {
|
|
16
|
+
indices: number[];
|
|
17
|
+
pre: any;
|
|
18
|
+
post: number;
|
|
19
|
+
};
|
|
20
|
+
scrollPosition: {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Analytics, LegendSet } from "@hisptz/dhis2-utils";
|
|
3
|
+
import { DHIS2Dimension } from "./interfaces";
|
|
4
|
+
export * from "./interfaces";
|
|
5
|
+
export interface CustomPivotTableProps {
|
|
6
|
+
analytics: Analytics;
|
|
7
|
+
config: {
|
|
8
|
+
layout: {
|
|
9
|
+
columns: Array<DHIS2Dimension>;
|
|
10
|
+
rows: Array<DHIS2Dimension>;
|
|
11
|
+
filter?: Array<DHIS2Dimension>;
|
|
12
|
+
};
|
|
13
|
+
options?: {
|
|
14
|
+
legendSets?: LegendSet[];
|
|
15
|
+
hideEmptyColumns?: boolean;
|
|
16
|
+
hideEmptyRows?: boolean;
|
|
17
|
+
showRowTotals?: boolean;
|
|
18
|
+
showColumnTotals?: boolean;
|
|
19
|
+
showRowSubtotals?: boolean;
|
|
20
|
+
showColumnSubtotals?: boolean;
|
|
21
|
+
fixColumnHeaders?: boolean;
|
|
22
|
+
fixRowHeaders?: boolean;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export declare function CustomPivotTable({ analytics, config }: CustomPivotTableProps): JSX.Element;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { AnalyticsItem } from "@hisptz/dhis2-utils";
|
|
2
|
+
export type ToggleContextualMenuFunction = (ref: HTMLTableCellElement | null, params: {
|
|
3
|
+
ouId?: string;
|
|
4
|
+
}) => void;
|
|
5
|
+
export type DHIS2Dimension = "ou" | "pe" | "dx";
|
|
6
|
+
export interface ClippingResult {
|
|
7
|
+
columns: Record<string, any>;
|
|
8
|
+
rows: Record<string, any>;
|
|
9
|
+
}
|
|
10
|
+
export interface AxisClippingResult {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}
|
|
13
|
+
export interface PivotTableVisualization {
|
|
14
|
+
showHierarchy?: boolean;
|
|
15
|
+
rows: {
|
|
16
|
+
dimension: DHIS2Dimension;
|
|
17
|
+
}[];
|
|
18
|
+
filter: {
|
|
19
|
+
dimension: DHIS2Dimension;
|
|
20
|
+
}[];
|
|
21
|
+
columns: {
|
|
22
|
+
dimension: DHIS2Dimension;
|
|
23
|
+
}[];
|
|
24
|
+
colTotals?: number;
|
|
25
|
+
rowTotals?: number;
|
|
26
|
+
colSubTotals?: number;
|
|
27
|
+
rowSubTotals?: number;
|
|
28
|
+
hideEmptyColumns?: boolean;
|
|
29
|
+
hideEmptyRows?: boolean;
|
|
30
|
+
hideTitle?: boolean;
|
|
31
|
+
title?: string;
|
|
32
|
+
hideSubtitle?: boolean;
|
|
33
|
+
subtitle?: string;
|
|
34
|
+
fixColumnHeaders?: boolean;
|
|
35
|
+
fixRowHeaders?: boolean;
|
|
36
|
+
showDimensionLabels?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface DimensionLookupItem {
|
|
39
|
+
dimension: DHIS2Dimension;
|
|
40
|
+
meta: AnalyticsItem;
|
|
41
|
+
count?: number;
|
|
42
|
+
itemIds: string[];
|
|
43
|
+
items: AnalyticsItem[];
|
|
44
|
+
isDxDimension: boolean;
|
|
45
|
+
position: "column" | "row";
|
|
46
|
+
size?: number;
|
|
47
|
+
}
|
|
48
|
+
export interface DimensionLookup {
|
|
49
|
+
rows: Array<DimensionLookupItem & {
|
|
50
|
+
position: "row";
|
|
51
|
+
}>;
|
|
52
|
+
columns: Array<DimensionLookupItem & {
|
|
53
|
+
position: "column";
|
|
54
|
+
}>;
|
|
55
|
+
allByDimension: {
|
|
56
|
+
[key: string]: DimensionLookupItem;
|
|
57
|
+
};
|
|
58
|
+
headerDimensions: DimensionLookupItem[];
|
|
59
|
+
rowHeaders: {}[];
|
|
60
|
+
columnHeaders: {}[];
|
|
61
|
+
dataHeaders: Record<string, number>;
|
|
62
|
+
}
|
|
63
|
+
export interface PivotTableOptions {
|
|
64
|
+
hideEmptyColumns: boolean;
|
|
65
|
+
hideEmptyRows: boolean;
|
|
66
|
+
showRowTotals: boolean;
|
|
67
|
+
showColumnTotals: boolean;
|
|
68
|
+
showRowSubtotals: boolean;
|
|
69
|
+
showColumnSubtotals: boolean;
|
|
70
|
+
fixColumnHeaders: boolean;
|
|
71
|
+
fixRowHeaders: boolean;
|
|
72
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { PivotTableEngine } from "./engine";
|
|
2
|
+
export interface AxisInterface {
|
|
3
|
+
sizes: {
|
|
4
|
+
size: number;
|
|
5
|
+
pre: number;
|
|
6
|
+
}[];
|
|
7
|
+
headerSizes?: any;
|
|
8
|
+
headerSize: any;
|
|
9
|
+
orientation?: "column" | "row";
|
|
10
|
+
totalSize: number;
|
|
11
|
+
partitions: number[];
|
|
12
|
+
}
|
|
13
|
+
export declare class AdaptiveClippingController {
|
|
14
|
+
columns: AxisInterface;
|
|
15
|
+
rows: AxisInterface;
|
|
16
|
+
engine: PivotTableEngine;
|
|
17
|
+
constructor(engine: PivotTableEngine);
|
|
18
|
+
addSize({ row, column }: {
|
|
19
|
+
row: number;
|
|
20
|
+
column: number;
|
|
21
|
+
}, { width, height }: {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
}): void;
|
|
25
|
+
add({ row, column }: {
|
|
26
|
+
row: number;
|
|
27
|
+
column: number;
|
|
28
|
+
}, renderedValue?: string): void;
|
|
29
|
+
measureText(renderedValue?: string, options?: any): {
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
normalizedText?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
normalizedText: string;
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
};
|
|
38
|
+
getCellSize(contentSize: number): number;
|
|
39
|
+
finalizeAxis(axis: AxisInterface): void;
|
|
40
|
+
populateAxisPartitions(axis: AxisInterface): void;
|
|
41
|
+
resetRowPartitions(): void;
|
|
42
|
+
finalize(): void;
|
|
43
|
+
reset(): void;
|
|
44
|
+
}
|