@iapps/ng-dhis2-ui 1.0.1 → 1.0.3
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/esm2022/index.mjs +4 -1
- package/esm2022/lib/modules/button/button.component.mjs +2 -2
- package/esm2022/lib/modules/header-bar/header-bar.component.mjs +7 -8
- package/esm2022/lib/modules/organisation-unit-selector/components/OrgUnitDimension.mjs +212 -0
- package/esm2022/lib/modules/organisation-unit-selector/components/index.mjs +6 -0
- package/esm2022/lib/modules/organisation-unit-selector/components/styles/OrgUnitDimension.style.mjs +83 -0
- package/esm2022/lib/modules/organisation-unit-selector/components/utils/index.mjs +6 -0
- package/esm2022/lib/modules/organisation-unit-selector/components/utils/ouIdHelper/index.mjs +18 -0
- package/esm2022/lib/modules/organisation-unit-selector/components/utils/ouLevelUtils/index.mjs +27 -0
- package/esm2022/lib/modules/organisation-unit-selector/index.mjs +6 -0
- package/esm2022/lib/modules/organisation-unit-selector/models/index.mjs +5 -0
- package/esm2022/lib/modules/organisation-unit-selector/models/organisation-unit-config.model.mjs +16 -0
- package/esm2022/lib/modules/organisation-unit-selector/organisation-unit-selector.component.mjs +78 -0
- package/esm2022/lib/modules/organisation-unit-selector/organisation-unit-selector.module.mjs +19 -0
- package/esm2022/lib/modules/period-selector/components/FixedPeriodFilter.mjs +44 -0
- package/esm2022/lib/modules/period-selector/components/PeriodDimension.mjs +41 -0
- package/esm2022/lib/modules/period-selector/components/PeriodTransfer.mjs +110 -0
- package/esm2022/lib/modules/period-selector/components/RelativePeriodFilter.mjs +28 -0
- package/esm2022/lib/modules/period-selector/components/utils/fixedPeriods.mjs +308 -0
- package/esm2022/lib/modules/period-selector/components/utils/index.mjs +5 -0
- package/esm2022/lib/modules/period-selector/components/utils/periodTypes.mjs +23 -0
- package/esm2022/lib/modules/period-selector/components/utils/relativePeriods.mjs +139 -0
- package/esm2022/lib/modules/period-selector/index.mjs +6 -0
- package/esm2022/lib/modules/period-selector/period-selector.component.mjs +66 -0
- package/esm2022/lib/modules/period-selector/period-selector.module.mjs +19 -0
- package/esm2022/lib/modules/react-wrapper/index.mjs +6 -0
- package/esm2022/lib/modules/react-wrapper/react-wrapper.component.mjs +53 -0
- package/esm2022/lib/modules/react-wrapper/react-wrapper.module.mjs +18 -0
- package/esm2022/lib/shared/assets/AssignedCategoriesIcon.mjs +12 -0
- package/esm2022/lib/shared/assets/DimensionItemIcons/PeriodIcon.mjs +4 -0
- package/esm2022/lib/shared/components/TransferOption.mjs +130 -0
- package/esm2022/lib/shared/components/index.mjs +2 -3
- package/esm2022/lib/shared/index.mjs +7 -0
- package/esm2022/lib/shared/styles/DimensionSelector.style.mjs +39 -0
- package/esm2022/lib/shared/styles/index.mjs +5 -0
- package/esm2022/lib/shared/utils/axis.mjs +25 -0
- package/esm2022/lib/shared/utils/axisGetDimension.mjs +5 -0
- package/esm2022/lib/shared/utils/axisHasDimension.mjs +3 -0
- package/esm2022/lib/shared/utils/dimension.mjs +52 -0
- package/esm2022/lib/shared/utils/dimensionGetItems.mjs +6 -0
- package/esm2022/lib/shared/utils/dimensionIs.mjs +3 -0
- package/esm2022/lib/shared/utils/dimensionIsEmpty.mjs +5 -0
- package/esm2022/lib/shared/utils/dimensionIsValid.mjs +16 -0
- package/esm2022/lib/shared/utils/dimensionSelectorHelper.mjs +4 -0
- package/esm2022/lib/shared/utils/index.mjs +15 -0
- package/esm2022/lib/shared/utils/layoutGetAllAxes.mjs +7 -0
- package/esm2022/lib/shared/utils/layoutGetAllDimensions.mjs +6 -0
- package/esm2022/lib/shared/utils/layoutGetDimension.mjs +4 -0
- package/esm2022/lib/shared/utils/layoutReplaceDimension.mjs +17 -0
- package/esm2022/lib/shared/utils/list.mjs +15 -0
- package/esm2022/lib/shared/utils/predefinedDimensions.mjs +45 -0
- package/fesm2022/iapps-ng-dhis2-ui.mjs +1652 -77
- package/fesm2022/iapps-ng-dhis2-ui.mjs.map +1 -1
- package/index.d.ts +3 -0
- package/lib/modules/button/button.component.d.ts +1 -1
- package/lib/modules/header-bar/header-bar.component.d.ts +1 -4
- package/lib/modules/organisation-unit-selector/components/OrgUnitDimension.d.ts +26 -0
- package/lib/modules/organisation-unit-selector/components/index.d.ts +2 -0
- package/lib/modules/organisation-unit-selector/components/styles/OrgUnitDimension.style.d.ts +1 -0
- package/lib/modules/organisation-unit-selector/components/utils/index.d.ts +2 -0
- package/lib/modules/organisation-unit-selector/components/utils/ouIdHelper/index.d.ts +10 -0
- package/lib/modules/organisation-unit-selector/components/utils/ouLevelUtils/index.d.ts +1 -0
- package/lib/modules/organisation-unit-selector/index.d.ts +2 -0
- package/lib/modules/organisation-unit-selector/models/index.d.ts +1 -0
- package/lib/modules/organisation-unit-selector/models/organisation-unit-config.model.d.ts +12 -0
- package/lib/modules/organisation-unit-selector/organisation-unit-selector.component.d.ts +26 -0
- package/lib/modules/organisation-unit-selector/organisation-unit-selector.module.d.ts +9 -0
- package/lib/modules/period-selector/components/FixedPeriodFilter.d.ts +18 -0
- package/lib/modules/period-selector/components/PeriodDimension.d.ts +15 -0
- package/lib/modules/period-selector/components/PeriodTransfer.d.ts +28 -0
- package/lib/modules/period-selector/components/RelativePeriodFilter.d.ts +11 -0
- package/lib/modules/period-selector/components/utils/fixedPeriods.d.ts +17 -0
- package/lib/modules/period-selector/components/utils/index.d.ts +4 -0
- package/lib/modules/period-selector/components/utils/periodTypes.d.ts +19 -0
- package/lib/modules/period-selector/components/utils/relativePeriods.d.ts +17 -0
- package/lib/modules/period-selector/index.d.ts +2 -0
- package/lib/modules/period-selector/period-selector.component.d.ts +21 -0
- package/lib/modules/period-selector/period-selector.module.d.ts +9 -0
- package/lib/modules/react-wrapper/index.d.ts +2 -0
- package/lib/modules/react-wrapper/react-wrapper.module.d.ts +8 -0
- package/lib/shared/assets/AssignedCategoriesIcon.d.ts +2 -0
- package/lib/shared/assets/DimensionItemIcons/PeriodIcon.d.ts +3 -0
- package/lib/shared/components/TransferOption.d.ts +19 -0
- package/lib/shared/components/index.d.ts +1 -2
- package/lib/shared/index.d.ts +3 -0
- package/lib/shared/styles/DimensionSelector.style.d.ts +2 -0
- package/lib/shared/styles/index.d.ts +1 -0
- package/lib/shared/utils/axis.d.ts +11 -0
- package/lib/shared/utils/axisGetDimension.d.ts +1 -0
- package/lib/shared/utils/axisHasDimension.d.ts +1 -0
- package/lib/shared/utils/dimension.d.ts +45 -0
- package/lib/shared/utils/dimensionGetItems.d.ts +1 -0
- package/lib/shared/utils/dimensionIs.d.ts +1 -0
- package/lib/shared/utils/dimensionIsEmpty.d.ts +1 -0
- package/lib/shared/utils/dimensionIsValid.d.ts +1 -0
- package/lib/shared/utils/dimensionSelectorHelper.d.ts +3 -0
- package/lib/shared/utils/index.d.ts +11 -0
- package/lib/shared/utils/layoutGetAllAxes.d.ts +1 -0
- package/lib/shared/utils/layoutGetAllDimensions.d.ts +1 -0
- package/lib/shared/utils/layoutGetDimension.d.ts +1 -0
- package/lib/shared/utils/layoutReplaceDimension.d.ts +1 -0
- package/lib/shared/utils/list.d.ts +1 -0
- package/lib/shared/utils/predefinedDimensions.d.ts +65 -0
- package/package.json +1 -1
- package/esm2022/lib/shared/components/react-component-wrapper/react-wrapper.component.mjs +0 -53
- /package/lib/{shared/components/react-component-wrapper → modules/react-wrapper}/react-wrapper.component.d.ts +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IconClock16, IconDimensionData16, IconDimensionOrgUnit16, } from '@dhis2/ui';
|
|
2
|
+
import i18n from '@dhis2/d2-i18n';
|
|
3
|
+
import { AssignedCategoriesIcon } from '../assets/AssignedCategoriesIcon';
|
|
4
|
+
export const DIMENSION_ID_DATA = 'dx';
|
|
5
|
+
export const DIMENSION_ID_PERIOD = 'pe';
|
|
6
|
+
export const DIMENSION_ID_ORGUNIT = 'ou';
|
|
7
|
+
export const DIMENSION_ID_ASSIGNED_CATEGORIES = 'co';
|
|
8
|
+
export const DIMENSION_PROP_NO_ITEMS = 'noItems';
|
|
9
|
+
export const getFixedDimensions = () => ({
|
|
10
|
+
[DIMENSION_ID_DATA]: {
|
|
11
|
+
id: DIMENSION_ID_DATA,
|
|
12
|
+
name: i18n.t('Data'),
|
|
13
|
+
iconName: 'DataIcon',
|
|
14
|
+
icon: IconDimensionData16,
|
|
15
|
+
},
|
|
16
|
+
[DIMENSION_ID_PERIOD]: {
|
|
17
|
+
id: DIMENSION_ID_PERIOD,
|
|
18
|
+
name: i18n.t('Period'),
|
|
19
|
+
iconName: 'PeriodIcon',
|
|
20
|
+
icon: IconClock16,
|
|
21
|
+
},
|
|
22
|
+
[DIMENSION_ID_ORGUNIT]: {
|
|
23
|
+
id: DIMENSION_ID_ORGUNIT,
|
|
24
|
+
name: i18n.t('Organisation unit'),
|
|
25
|
+
iconName: 'OrgUnitIcon',
|
|
26
|
+
icon: IconDimensionOrgUnit16,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
export const getDynamicDimensions = () => ({
|
|
30
|
+
[DIMENSION_ID_ASSIGNED_CATEGORIES]: {
|
|
31
|
+
id: DIMENSION_ID_ASSIGNED_CATEGORIES,
|
|
32
|
+
name: i18n.t('Assigned Categories'),
|
|
33
|
+
iconName: 'AssignedCategoriesIcon',
|
|
34
|
+
icon: AssignedCategoriesIcon,
|
|
35
|
+
[DIMENSION_PROP_NO_ITEMS]: true,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
export const getPredefinedDimensions = () => ({
|
|
39
|
+
...getFixedDimensions(),
|
|
40
|
+
...getDynamicDimensions(),
|
|
41
|
+
});
|
|
42
|
+
export const filterOutPredefinedDimensions = (dimensionIds) => dimensionIds.filter((dimensionId) => !Object.keys(getPredefinedDimensions()).includes(dimensionId));
|
|
43
|
+
export const getPredefinedDimensionProp = (dimensionId, propName) => (getPredefinedDimensions()[dimensionId] || {})[propName];
|
|
44
|
+
export const getDimensionById = (dimensionId) => getPredefinedDimensions()[dimensionId];
|
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW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