@dhis2/analytics 29.4.0 → 29.4.1
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/api/analytics/AnalyticsRequest.js +4 -4
- package/build/cjs/components/DataDimension/Calculation/DndContext.js +4 -4
- package/build/cjs/components/DataDimension/Info/DataElementOperandInfo.js +1 -1
- package/build/cjs/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +1 -1
- package/build/cjs/components/DataDimension/ItemSelector/ItemSelector.js +1 -1
- package/build/cjs/components/RichText/Editor/Editor.js +2 -2
- package/build/cjs/locales/index.js +86 -41
- package/build/cjs/modules/legends.js +1 -1
- package/build/cjs/modules/pivotTable/applyLegendSet.js +4 -4
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/events/loadCustomSVG/singleValue/index.js +3 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/index.js +2 -2
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/series/index.js +1 -1
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +3 -3
- package/build/cjs/visualizations/config/adapters/dhis_highcharts/title/index.js +3 -3
- package/build/cjs/visualizations/config/generators/highcharts/index.js +2 -2
- package/build/cjs/visualizations/store/adapters/dhis_highcharts/yearOnYear.js +1 -1
- package/build/es/api/analytics/AnalyticsRequest.js +4 -4
- package/build/es/components/DataDimension/Calculation/DndContext.js +4 -4
- package/build/es/components/DataDimension/Info/DataElementOperandInfo.js +1 -1
- package/build/es/components/DataDimension/ItemOptionsSelector/ItemOptionsSelector.js +1 -1
- package/build/es/components/DataDimension/ItemSelector/ItemSelector.js +1 -1
- package/build/es/components/RichText/Editor/Editor.js +2 -2
- package/build/es/locales/index.js +86 -41
- package/build/es/modules/legends.js +1 -1
- package/build/es/modules/pivotTable/applyLegendSet.js +4 -4
- package/build/es/visualizations/config/adapters/dhis_highcharts/events/loadCustomSVG/singleValue/index.js +3 -3
- package/build/es/visualizations/config/adapters/dhis_highcharts/index.js +2 -2
- package/build/es/visualizations/config/adapters/dhis_highcharts/series/index.js +1 -1
- package/build/es/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +3 -3
- package/build/es/visualizations/config/adapters/dhis_highcharts/title/index.js +3 -3
- package/build/es/visualizations/config/generators/highcharts/index.js +2 -2
- package/build/es/visualizations/store/adapters/dhis_highcharts/yearOnYear.js +1 -1
- package/package.json +2 -2
|
@@ -53,7 +53,7 @@ class AnalyticsRequest extends (0, _AnalyticsRequestDimensionsMixin.default)((0,
|
|
|
53
53
|
const columns = visualization.columns || [];
|
|
54
54
|
const rows = visualization.rows || [];
|
|
55
55
|
columns.concat(rows).forEach(d => {
|
|
56
|
-
var _d$legendSet, _d$programStage, _d$repetition
|
|
56
|
+
var _d$legendSet, _d$programStage, _d$repetition;
|
|
57
57
|
let dimension = d.dimension;
|
|
58
58
|
if ((_d$legendSet = d.legendSet) !== null && _d$legendSet !== void 0 && _d$legendSet.id) {
|
|
59
59
|
dimension += `-${d.legendSet.id}`;
|
|
@@ -62,7 +62,7 @@ class AnalyticsRequest extends (0, _AnalyticsRequestDimensionsMixin.default)((0,
|
|
|
62
62
|
dimension += `:${d.filter}`;
|
|
63
63
|
}
|
|
64
64
|
const programStageId = (_d$programStage = d.programStage) === null || _d$programStage === void 0 ? void 0 : _d$programStage.id;
|
|
65
|
-
if ((_d$repetition = d.repetition) !== null && _d$repetition !== void 0 && (_d$repetition
|
|
65
|
+
if ((_d$repetition = d.repetition) !== null && _d$repetition !== void 0 && (_d$repetition = _d$repetition.indexes) !== null && _d$repetition !== void 0 && _d$repetition.length) {
|
|
66
66
|
d.repetition.indexes.forEach(index => {
|
|
67
67
|
var _d$program;
|
|
68
68
|
request = request.addDimension((0, _utils.formatDimension)({
|
|
@@ -93,13 +93,13 @@ class AnalyticsRequest extends (0, _AnalyticsRequestDimensionsMixin.default)((0,
|
|
|
93
93
|
var _f$items;
|
|
94
94
|
request = request.addDimension(f.dimension, (_f$items = f.items) === null || _f$items === void 0 ? void 0 : _f$items.map(item => item.id));
|
|
95
95
|
} else {
|
|
96
|
-
var _f$programStage, _f$repetition
|
|
96
|
+
var _f$programStage, _f$repetition;
|
|
97
97
|
let filterString = f.dimension;
|
|
98
98
|
if (f.filter) {
|
|
99
99
|
filterString += `:${f.filter}`;
|
|
100
100
|
}
|
|
101
101
|
const programStageId = (_f$programStage = f.programStage) === null || _f$programStage === void 0 ? void 0 : _f$programStage.id;
|
|
102
|
-
if ((_f$repetition = f.repetition) !== null && _f$repetition !== void 0 && (_f$repetition
|
|
102
|
+
if ((_f$repetition = f.repetition) !== null && _f$repetition !== void 0 && (_f$repetition = _f$repetition.indexes) !== null && _f$repetition !== void 0 && _f$repetition.length) {
|
|
103
103
|
f.repetition.indexes.forEach(index => {
|
|
104
104
|
var _f$program;
|
|
105
105
|
request = request.addFilter((0, _utils.formatDimension)({
|
|
@@ -127,8 +127,8 @@ const OuterDndContext = ({
|
|
|
127
127
|
active,
|
|
128
128
|
over
|
|
129
129
|
}) => {
|
|
130
|
-
var _over$data, _over$data$current, _over$data$
|
|
131
|
-
if (!(over !== null && over !== void 0 && over.id) || (over === null || over === void 0
|
|
130
|
+
var _over$data, _over$data$current, _over$data$current2;
|
|
131
|
+
if (!(over !== null && over !== void 0 && over.id) || (over === null || over === void 0 || (_over$data = over.data) === null || _over$data === void 0 || (_over$data = _over$data.current) === null || _over$data === void 0 || (_over$data = _over$data.sortable) === null || _over$data === void 0 ? void 0 : _over$data.containerId) === OPTIONS_PANEL || !active.data.current) {
|
|
132
132
|
// dropped over non-droppable or over options panel
|
|
133
133
|
handleDragCancel();
|
|
134
134
|
return;
|
|
@@ -144,8 +144,8 @@ const OuterDndContext = ({
|
|
|
144
144
|
}
|
|
145
145
|
};
|
|
146
146
|
const destination = {
|
|
147
|
-
containerId: ((_over$data$
|
|
148
|
-
index: (_over$data$
|
|
147
|
+
containerId: ((_over$data$current = over.data.current) === null || _over$data$current === void 0 ? void 0 : _over$data$current.sortable.containerId) || over.id,
|
|
148
|
+
index: (_over$data$current2 = over.data.current) === null || _over$data$current2 === void 0 ? void 0 : _over$data$current2.sortable.index
|
|
149
149
|
};
|
|
150
150
|
onDragEnd({
|
|
151
151
|
item,
|
|
@@ -52,7 +52,7 @@ const DataElementOperandInfo = ({
|
|
|
52
52
|
const dataElementOperand = dataElementOperands.dataElementOperands[0]
|
|
53
53
|
|
|
54
54
|
// copy some common fields from dataElement
|
|
55
|
-
|
|
55
|
+
;
|
|
56
56
|
['code', 'created', 'createdBy', 'displayDescription', 'lastUpdated'].forEach(key => dataElementOperand[key] = dataElementOperand.dataElement[key]);
|
|
57
57
|
|
|
58
58
|
// inject href as it is not returned from the API
|
|
@@ -80,7 +80,7 @@ const ItemOptionsSelector = ({
|
|
|
80
80
|
searchTerm: state.searchTerm
|
|
81
81
|
});
|
|
82
82
|
const newOptions = [];
|
|
83
|
-
(_result$dimensionItem = result.dimensionItems) === null || _result$dimensionItem === void 0
|
|
83
|
+
(_result$dimensionItem = result.dimensionItems) === null || _result$dimensionItem === void 0 || _result$dimensionItem.forEach(item => {
|
|
84
84
|
newOptions.push({
|
|
85
85
|
label: item.name,
|
|
86
86
|
value: item.id,
|
|
@@ -152,7 +152,7 @@ const ItemSelector = ({
|
|
|
152
152
|
searchTerm: state.searchTerm
|
|
153
153
|
});
|
|
154
154
|
const newOptions = [];
|
|
155
|
-
(_result$dimensionItem = result.dimensionItems) === null || _result$dimensionItem === void 0
|
|
155
|
+
(_result$dimensionItem = result.dimensionItems) === null || _result$dimensionItem === void 0 || _result$dimensionItem.forEach(item => {
|
|
156
156
|
if (item.dimensionItemType === _dataSets.REPORTING_RATE) {
|
|
157
157
|
if (state.filter.subGroup && state.filter.subGroup !== _dataTypes.DIMENSION_TYPE_ALL) {
|
|
158
158
|
const metric = _dataSets.DATA_SETS_CONSTANTS.find(item => item.id === state.filter.subGroup);
|
|
@@ -189,13 +189,13 @@ const Editor = exports.Editor = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
189
189
|
(0, _react.useEffect)(() => {
|
|
190
190
|
if (initialFocus) {
|
|
191
191
|
var _textareaRef$current;
|
|
192
|
-
(_textareaRef$current = textareaRef.current) === null || _textareaRef$current === void 0
|
|
192
|
+
(_textareaRef$current = textareaRef.current) === null || _textareaRef$current === void 0 || _textareaRef$current.focus();
|
|
193
193
|
}
|
|
194
194
|
}, [initialFocus, textareaRef]);
|
|
195
195
|
(0, _react.useEffect)(() => {
|
|
196
196
|
if (caretPosRef.current) {
|
|
197
197
|
var _textareaRef$current2;
|
|
198
|
-
(_textareaRef$current2 = textareaRef.current) === null || _textareaRef$current2 === void 0
|
|
198
|
+
(_textareaRef$current2 = textareaRef.current) === null || _textareaRef$current2 === void 0 || _textareaRef$current2.setSelectionRange(caretPosRef.current, caretPosRef.current);
|
|
199
199
|
caretPosRef.current = undefined;
|
|
200
200
|
}
|
|
201
201
|
}, [value, textareaRef]);
|
|
@@ -57,45 +57,90 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
57
57
|
//------------------------------------------------------------------------------
|
|
58
58
|
|
|
59
59
|
const namespace = 'default';
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
_d2I18n.default.
|
|
65
|
-
_d2I18n.default.
|
|
66
|
-
_d2I18n.default.
|
|
67
|
-
_d2I18n.default.
|
|
68
|
-
_d2I18n.default.
|
|
69
|
-
_d2I18n.default.
|
|
70
|
-
_d2I18n.default.
|
|
71
|
-
_d2I18n.default.
|
|
72
|
-
_d2I18n.default.
|
|
73
|
-
_d2I18n.default.
|
|
74
|
-
_d2I18n.default.
|
|
75
|
-
_d2I18n.default.
|
|
76
|
-
_d2I18n.default.
|
|
77
|
-
_d2I18n.default.
|
|
78
|
-
_d2I18n.default.
|
|
79
|
-
_d2I18n.default.
|
|
80
|
-
_d2I18n.default.
|
|
81
|
-
_d2I18n.default.
|
|
82
|
-
_d2I18n.default.
|
|
83
|
-
_d2I18n.default.
|
|
84
|
-
_d2I18n.default.
|
|
85
|
-
_d2I18n.default.
|
|
86
|
-
_d2I18n.default.
|
|
87
|
-
_d2I18n.default.
|
|
88
|
-
_d2I18n.default.
|
|
89
|
-
_d2I18n.default.
|
|
90
|
-
_d2I18n.default.
|
|
91
|
-
_d2I18n.default.
|
|
92
|
-
_d2I18n.default.
|
|
93
|
-
_d2I18n.default.
|
|
94
|
-
_d2I18n.default.
|
|
95
|
-
_d2I18n.default.
|
|
96
|
-
_d2I18n.default.
|
|
97
|
-
_d2I18n.default.
|
|
98
|
-
_d2I18n.default.
|
|
99
|
-
_d2I18n.default.
|
|
100
|
-
_d2I18n.default.
|
|
60
|
+
|
|
61
|
+
// Use 'deep' = true and 'overwrite' = false to add to, but not overwrite,
|
|
62
|
+
// custom translations from the datastore (added by the app adapter)
|
|
63
|
+
|
|
64
|
+
_d2I18n.default.addResourceBundle('ar', namespace, _translations.default, true, false);
|
|
65
|
+
_d2I18n.default.addResourceBundle('ar', namespace, _translations.default, true, false);
|
|
66
|
+
_d2I18n.default.addResourceBundle('ar_EG', namespace, _translations2.default, true, false);
|
|
67
|
+
_d2I18n.default.addResourceBundle('ar-EG', namespace, _translations2.default, true, false);
|
|
68
|
+
_d2I18n.default.addResourceBundle('ar_IQ', namespace, _translations3.default, true, false);
|
|
69
|
+
_d2I18n.default.addResourceBundle('ar-IQ', namespace, _translations3.default, true, false);
|
|
70
|
+
_d2I18n.default.addResourceBundle('bn', namespace, _translations4.default, true, false);
|
|
71
|
+
_d2I18n.default.addResourceBundle('bn', namespace, _translations4.default, true, false);
|
|
72
|
+
_d2I18n.default.addResourceBundle('ckb', namespace, _translations5.default, true, false);
|
|
73
|
+
_d2I18n.default.addResourceBundle('ckb', namespace, _translations5.default, true, false);
|
|
74
|
+
_d2I18n.default.addResourceBundle('cs', namespace, _translations6.default, true, false);
|
|
75
|
+
_d2I18n.default.addResourceBundle('cs', namespace, _translations6.default, true, false);
|
|
76
|
+
_d2I18n.default.addResourceBundle('da', namespace, _translations7.default, true, false);
|
|
77
|
+
_d2I18n.default.addResourceBundle('da', namespace, _translations7.default, true, false);
|
|
78
|
+
_d2I18n.default.addResourceBundle('en', namespace, _translations8.default, true, false);
|
|
79
|
+
_d2I18n.default.addResourceBundle('en', namespace, _translations8.default, true, false);
|
|
80
|
+
_d2I18n.default.addResourceBundle('en_US', namespace, _translations9.default, true, false);
|
|
81
|
+
_d2I18n.default.addResourceBundle('en-US', namespace, _translations9.default, true, false);
|
|
82
|
+
_d2I18n.default.addResourceBundle('es', namespace, _translations0.default, true, false);
|
|
83
|
+
_d2I18n.default.addResourceBundle('es', namespace, _translations0.default, true, false);
|
|
84
|
+
_d2I18n.default.addResourceBundle('es_419', namespace, _translations1.default, true, false);
|
|
85
|
+
_d2I18n.default.addResourceBundle('es-419', namespace, _translations1.default, true, false);
|
|
86
|
+
_d2I18n.default.addResourceBundle('fr', namespace, _translations10.default, true, false);
|
|
87
|
+
_d2I18n.default.addResourceBundle('fr', namespace, _translations10.default, true, false);
|
|
88
|
+
_d2I18n.default.addResourceBundle('hi_IN', namespace, _translations11.default, true, false);
|
|
89
|
+
_d2I18n.default.addResourceBundle('hi-IN', namespace, _translations11.default, true, false);
|
|
90
|
+
_d2I18n.default.addResourceBundle('id', namespace, _translations12.default, true, false);
|
|
91
|
+
_d2I18n.default.addResourceBundle('id', namespace, _translations12.default, true, false);
|
|
92
|
+
_d2I18n.default.addResourceBundle('km', namespace, _translations13.default, true, false);
|
|
93
|
+
_d2I18n.default.addResourceBundle('km', namespace, _translations13.default, true, false);
|
|
94
|
+
_d2I18n.default.addResourceBundle('lo', namespace, _translations14.default, true, false);
|
|
95
|
+
_d2I18n.default.addResourceBundle('lo', namespace, _translations14.default, true, false);
|
|
96
|
+
_d2I18n.default.addResourceBundle('my', namespace, _translations15.default, true, false);
|
|
97
|
+
_d2I18n.default.addResourceBundle('my', namespace, _translations15.default, true, false);
|
|
98
|
+
_d2I18n.default.addResourceBundle('nb', namespace, _translations16.default, true, false);
|
|
99
|
+
_d2I18n.default.addResourceBundle('nb', namespace, _translations16.default, true, false);
|
|
100
|
+
_d2I18n.default.addResourceBundle('ne', namespace, _translations17.default, true, false);
|
|
101
|
+
_d2I18n.default.addResourceBundle('ne', namespace, _translations17.default, true, false);
|
|
102
|
+
_d2I18n.default.addResourceBundle('nl', namespace, _translations18.default, true, false);
|
|
103
|
+
_d2I18n.default.addResourceBundle('nl', namespace, _translations18.default, true, false);
|
|
104
|
+
_d2I18n.default.addResourceBundle('or', namespace, _translations19.default, true, false);
|
|
105
|
+
_d2I18n.default.addResourceBundle('or', namespace, _translations19.default, true, false);
|
|
106
|
+
_d2I18n.default.addResourceBundle('prs', namespace, _translations20.default, true, false);
|
|
107
|
+
_d2I18n.default.addResourceBundle('prs', namespace, _translations20.default, true, false);
|
|
108
|
+
_d2I18n.default.addResourceBundle('ps', namespace, _translations21.default, true, false);
|
|
109
|
+
_d2I18n.default.addResourceBundle('ps', namespace, _translations21.default, true, false);
|
|
110
|
+
_d2I18n.default.addResourceBundle('pt', namespace, _translations22.default, true, false);
|
|
111
|
+
_d2I18n.default.addResourceBundle('pt', namespace, _translations22.default, true, false);
|
|
112
|
+
_d2I18n.default.addResourceBundle('pt_BR', namespace, _translations23.default, true, false);
|
|
113
|
+
_d2I18n.default.addResourceBundle('pt-BR', namespace, _translations23.default, true, false);
|
|
114
|
+
_d2I18n.default.addResourceBundle('ro', namespace, _translations24.default, true, false);
|
|
115
|
+
_d2I18n.default.addResourceBundle('ro', namespace, _translations24.default, true, false);
|
|
116
|
+
_d2I18n.default.addResourceBundle('ru', namespace, _translations25.default, true, false);
|
|
117
|
+
_d2I18n.default.addResourceBundle('ru', namespace, _translations25.default, true, false);
|
|
118
|
+
_d2I18n.default.addResourceBundle('si', namespace, _translations26.default, true, false);
|
|
119
|
+
_d2I18n.default.addResourceBundle('si', namespace, _translations26.default, true, false);
|
|
120
|
+
_d2I18n.default.addResourceBundle('sv', namespace, _translations27.default, true, false);
|
|
121
|
+
_d2I18n.default.addResourceBundle('sv', namespace, _translations27.default, true, false);
|
|
122
|
+
_d2I18n.default.addResourceBundle('tet', namespace, _translations28.default, true, false);
|
|
123
|
+
_d2I18n.default.addResourceBundle('tet', namespace, _translations28.default, true, false);
|
|
124
|
+
_d2I18n.default.addResourceBundle('tg', namespace, _translations29.default, true, false);
|
|
125
|
+
_d2I18n.default.addResourceBundle('tg', namespace, _translations29.default, true, false);
|
|
126
|
+
_d2I18n.default.addResourceBundle('th', namespace, _translations30.default, true, false);
|
|
127
|
+
_d2I18n.default.addResourceBundle('th', namespace, _translations30.default, true, false);
|
|
128
|
+
_d2I18n.default.addResourceBundle('uk', namespace, _translations31.default, true, false);
|
|
129
|
+
_d2I18n.default.addResourceBundle('uk', namespace, _translations31.default, true, false);
|
|
130
|
+
_d2I18n.default.addResourceBundle('ur', namespace, _translations32.default, true, false);
|
|
131
|
+
_d2I18n.default.addResourceBundle('ur', namespace, _translations32.default, true, false);
|
|
132
|
+
_d2I18n.default.addResourceBundle('uz_Cyrl', namespace, _translations33.default, true, false);
|
|
133
|
+
_d2I18n.default.addResourceBundle('uz-Cyrl', namespace, _translations33.default, true, false);
|
|
134
|
+
_d2I18n.default.addResourceBundle('uz_Latn', namespace, _translations34.default, true, false);
|
|
135
|
+
_d2I18n.default.addResourceBundle('uz-Latn', namespace, _translations34.default, true, false);
|
|
136
|
+
_d2I18n.default.addResourceBundle('uz_UZ_Cyrl', namespace, _translations35.default, true, false);
|
|
137
|
+
_d2I18n.default.addResourceBundle('uz-Cyrl-UZ', namespace, _translations35.default, true, false);
|
|
138
|
+
_d2I18n.default.addResourceBundle('uz_UZ_Latn', namespace, _translations36.default, true, false);
|
|
139
|
+
_d2I18n.default.addResourceBundle('uz-Latn-UZ', namespace, _translations36.default, true, false);
|
|
140
|
+
_d2I18n.default.addResourceBundle('vi', namespace, _translations37.default, true, false);
|
|
141
|
+
_d2I18n.default.addResourceBundle('vi', namespace, _translations37.default, true, false);
|
|
142
|
+
_d2I18n.default.addResourceBundle('zh', namespace, _translations38.default, true, false);
|
|
143
|
+
_d2I18n.default.addResourceBundle('zh', namespace, _translations38.default, true, false);
|
|
144
|
+
_d2I18n.default.addResourceBundle('zh_CN', namespace, _translations39.default, true, false);
|
|
145
|
+
_d2I18n.default.addResourceBundle('zh-CN', namespace, _translations39.default, true, false);
|
|
101
146
|
var _default = exports.default = _d2I18n.default;
|
|
@@ -10,7 +10,7 @@ const LEGEND_DISPLAY_STYLE_FILL = exports.LEGEND_DISPLAY_STYLE_FILL = 'FILL';
|
|
|
10
10
|
const LEGEND_DISPLAY_STYLE_TEXT = exports.LEGEND_DISPLAY_STYLE_TEXT = 'TEXT';
|
|
11
11
|
const getLegendByValueFromLegendSet = (legendSet, value) => {
|
|
12
12
|
var _legendSet$legends;
|
|
13
|
-
return Number.isInteger(parseInt(value)) ? legendSet === null || legendSet === void 0
|
|
13
|
+
return Number.isInteger(parseInt(value)) ? legendSet === null || legendSet === void 0 || (_legendSet$legends = legendSet.legends) === null || _legendSet$legends === void 0 ? void 0 : _legendSet$legends.find(legend => value >= legend.startValue && value < legend.endValue // TODO: Confirm inclusive/exclusive bounds
|
|
14
14
|
) : null;
|
|
15
15
|
};
|
|
16
16
|
exports.getLegendByValueFromLegendSet = getLegendByValueFromLegendSet;
|
|
@@ -8,7 +8,7 @@ var _ui = require("@dhis2/ui");
|
|
|
8
8
|
var _legends = require("../legends.js");
|
|
9
9
|
var _isColorBright = require("./isColorBright.js");
|
|
10
10
|
const getLegendSet = (engine, dxDimension) => {
|
|
11
|
-
var _engine$visualization, _engine$visualization2
|
|
11
|
+
var _engine$visualization, _engine$visualization2;
|
|
12
12
|
let legendSetId;
|
|
13
13
|
switch ((_engine$visualization = engine.visualization.legend) === null || _engine$visualization === void 0 ? void 0 : _engine$visualization.strategy) {
|
|
14
14
|
case _legends.LEGEND_DISPLAY_STRATEGY_BY_DATA_ITEM:
|
|
@@ -18,15 +18,15 @@ const getLegendSet = (engine, dxDimension) => {
|
|
|
18
18
|
break;
|
|
19
19
|
case _legends.LEGEND_DISPLAY_STRATEGY_FIXED:
|
|
20
20
|
default:
|
|
21
|
-
legendSetId = (_engine$visualization2 = engine.visualization.legend) === null || _engine$visualization2 === void 0
|
|
21
|
+
legendSetId = (_engine$visualization2 = engine.visualization.legend) === null || _engine$visualization2 === void 0 || (_engine$visualization2 = _engine$visualization2.set) === null || _engine$visualization2 === void 0 ? void 0 : _engine$visualization2.id;
|
|
22
22
|
break;
|
|
23
23
|
}
|
|
24
24
|
return engine.legendSets[legendSetId];
|
|
25
25
|
};
|
|
26
26
|
const buildStyleObject = (legendColor, engine) => {
|
|
27
|
-
var _engine$
|
|
27
|
+
var _engine$visualization3;
|
|
28
28
|
const style = {};
|
|
29
|
-
switch ((_engine$
|
|
29
|
+
switch ((_engine$visualization3 = engine.visualization.legend) === null || _engine$visualization3 === void 0 ? void 0 : _engine$visualization3.style) {
|
|
30
30
|
case _legends.LEGEND_DISPLAY_STYLE_TEXT:
|
|
31
31
|
style.color = legendColor;
|
|
32
32
|
break;
|
|
@@ -34,11 +34,11 @@ function loadSingleValueSVG() {
|
|
|
34
34
|
while (!fitsWithinContainer && dynamicStyles.hasNext()) {
|
|
35
35
|
styles = dynamicStyles.next();
|
|
36
36
|
valueElement.attr(styles.value);
|
|
37
|
-
subTextElement === null || subTextElement === void 0
|
|
37
|
+
subTextElement === null || subTextElement === void 0 || subTextElement.attr(styles.subText);
|
|
38
38
|
fitsWithinContainer = (0, _checkIfFitsWithinContainer.checkIfFitsWithinContainer)(_getAvailableSpace.getAvailableSpace.call(this, styles.spacing.valueTop), valueElement, subTextElement, icon, subText, styles.spacing);
|
|
39
39
|
}
|
|
40
40
|
_positionElements.positionElements.call(this, valueElement, subTextElement, iconElement, styles.spacing);
|
|
41
41
|
valueElement.attr('visibility', 'visible');
|
|
42
|
-
iconElement === null || iconElement === void 0
|
|
43
|
-
subTextElement === null || subTextElement === void 0
|
|
42
|
+
iconElement === null || iconElement === void 0 || iconElement.attr('visibility', 'visible');
|
|
43
|
+
subTextElement === null || subTextElement === void 0 || subTextElement.attr('visibility', 'visible');
|
|
44
44
|
}
|
|
@@ -48,7 +48,7 @@ function _default({
|
|
|
48
48
|
extraConfig,
|
|
49
49
|
extraOptions
|
|
50
50
|
}) {
|
|
51
|
-
var _layout$legend, _layout$seriesKey, _layout$seriesKey2,
|
|
51
|
+
var _layout$legend, _layout$seriesKey, _layout$seriesKey2, _config$xAxis;
|
|
52
52
|
const _layout = getTransformedLayout(layout);
|
|
53
53
|
const _extraOptions = getTransformedExtraOptions(extraOptions);
|
|
54
54
|
const stacked = (0, _visTypes.isStacked)(_layout.type);
|
|
@@ -91,7 +91,7 @@ function _default({
|
|
|
91
91
|
// legend
|
|
92
92
|
legend: (0, _legend.default)({
|
|
93
93
|
isHidden: (_layout$seriesKey = _layout.seriesKey) === null || _layout$seriesKey === void 0 ? void 0 : _layout$seriesKey.hidden,
|
|
94
|
-
fontStyle: (_layout$seriesKey2 = _layout.seriesKey) === null || _layout$seriesKey2 === void 0
|
|
94
|
+
fontStyle: (_layout$seriesKey2 = _layout.seriesKey) === null || _layout$seriesKey2 === void 0 || (_layout$seriesKey2 = _layout$seriesKey2.label) === null || _layout$seriesKey2 === void 0 ? void 0 : _layout$seriesKey2.fontStyle,
|
|
95
95
|
visType: _layout.type,
|
|
96
96
|
dashboard: _extraOptions.dashboard
|
|
97
97
|
}),
|
|
@@ -192,7 +192,7 @@ function _default({
|
|
|
192
192
|
displayStrategy
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
-
(_series = series) === null || _series === void 0
|
|
195
|
+
(_series = series) === null || _series === void 0 || _series.forEach(seriesObj => {
|
|
196
196
|
// animation
|
|
197
197
|
seriesObj.animation = extraOptions.dashboard ? false : {
|
|
198
198
|
duration: getAnimation(extraOptions.animation, DEFAULT_ANIMATION_DURATION)
|
|
@@ -77,9 +77,9 @@ function subtitle(series, layout, metaData, extraOptions) {
|
|
|
77
77
|
switch (layout.type) {
|
|
78
78
|
case _visTypes.VIS_TYPE_SINGLE_VALUE:
|
|
79
79
|
{
|
|
80
|
-
var _defaultFontStyle$FON, _layout$fontStyle
|
|
81
|
-
const defaultColor = _fontStyle.defaultFontStyle === null || _fontStyle.defaultFontStyle === void 0
|
|
82
|
-
const customColor = layout === null || layout === void 0
|
|
80
|
+
var _defaultFontStyle$FON, _layout$fontStyle;
|
|
81
|
+
const defaultColor = _fontStyle.defaultFontStyle === null || _fontStyle.defaultFontStyle === void 0 || (_defaultFontStyle$FON = _fontStyle.defaultFontStyle[_fontStyle.FONT_STYLE_VISUALIZATION_SUBTITLE]) === null || _defaultFontStyle$FON === void 0 ? void 0 : _defaultFontStyle$FON[_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR];
|
|
82
|
+
const customColor = layout === null || layout === void 0 || (_layout$fontStyle = layout.fontStyle) === null || _layout$fontStyle === void 0 || (_layout$fontStyle = _layout$fontStyle[_fontStyle.FONT_STYLE_VISUALIZATION_SUBTITLE]) === null || _layout$fontStyle === void 0 ? void 0 : _layout$fontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR];
|
|
83
83
|
subtitle.style.color = (0, _singleValue.getSingleValueSubtitleColor)(customColor, defaultColor, series[0], legendOptions, legendSets);
|
|
84
84
|
if (dashboard) {
|
|
85
85
|
// Single value subtitle text should be multiline
|
|
@@ -83,9 +83,9 @@ function _default(layout, metaData, extraOptions, series) {
|
|
|
83
83
|
switch (layout.type) {
|
|
84
84
|
case _visTypes.VIS_TYPE_SINGLE_VALUE:
|
|
85
85
|
{
|
|
86
|
-
var _defaultFontStyle$FON, _layout$fontStyle
|
|
87
|
-
const defaultColor = _fontStyle.defaultFontStyle === null || _fontStyle.defaultFontStyle === void 0
|
|
88
|
-
const customColor = layout === null || layout === void 0
|
|
86
|
+
var _defaultFontStyle$FON, _layout$fontStyle;
|
|
87
|
+
const defaultColor = _fontStyle.defaultFontStyle === null || _fontStyle.defaultFontStyle === void 0 || (_defaultFontStyle$FON = _fontStyle.defaultFontStyle[_fontStyle.FONT_STYLE_VISUALIZATION_TITLE]) === null || _defaultFontStyle$FON === void 0 ? void 0 : _defaultFontStyle$FON[_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR];
|
|
88
|
+
const customColor = layout === null || layout === void 0 || (_layout$fontStyle = layout.fontStyle) === null || _layout$fontStyle === void 0 || (_layout$fontStyle = _layout$fontStyle[_fontStyle.FONT_STYLE_VISUALIZATION_TITLE]) === null || _layout$fontStyle === void 0 ? void 0 : _layout$fontStyle[_fontStyle.FONT_STYLE_OPTION_TEXT_COLOR];
|
|
89
89
|
title.style.color = (0, _singleValue.getSingleValueTitleColor)(customColor, defaultColor, series[0], legendOptions, legendSets);
|
|
90
90
|
if (dashboard) {
|
|
91
91
|
// TODO: is this always what we want?
|
|
@@ -40,9 +40,9 @@ _highcharts.default.patterns.forEach((pattern, i) => {
|
|
|
40
40
|
function drawLegendSymbolWrap() {
|
|
41
41
|
const pick = _highcharts.default.pick;
|
|
42
42
|
_highcharts.default.wrap(_highcharts.default.seriesTypes.column.prototype, 'drawLegendSymbol', function (proceed, legend, item) {
|
|
43
|
-
var _this$options$legendS
|
|
43
|
+
var _this$options$legendS;
|
|
44
44
|
const legendItem = item.legendItem;
|
|
45
|
-
if ((_this$options$legendS = this.options.legendSet) !== null && _this$options$legendS !== void 0 && (_this$options$
|
|
45
|
+
if ((_this$options$legendS = this.options.legendSet) !== null && _this$options$legendS !== void 0 && (_this$options$legendS = _this$options$legendS.legends) !== null && _this$options$legendS !== void 0 && _this$options$legendS.length) {
|
|
46
46
|
const ys = legend.baseline - legend.symbolHeight + 1,
|
|
47
47
|
// y start
|
|
48
48
|
x = legend.symbolWidth / 2 > 8 ? legend.symbolWidth / 2 : 8,
|
|
@@ -7,7 +7,7 @@ exports.default = _default;
|
|
|
7
7
|
function _default(acc, series, categories, idValueMap, metaData, extraOptions) {
|
|
8
8
|
var _extraOptions$xAxisLa;
|
|
9
9
|
const seriesData = Array.from({
|
|
10
|
-
length: (extraOptions === null || extraOptions === void 0
|
|
10
|
+
length: (extraOptions === null || extraOptions === void 0 || (_extraOptions$xAxisLa = extraOptions.xAxisLabels) === null || _extraOptions$xAxisLa === void 0 ? void 0 : _extraOptions$xAxisLa.length) || 0
|
|
11
11
|
}, () => null);
|
|
12
12
|
categories[0].forEach(categoryItemId => {
|
|
13
13
|
const position = extraOptions.periodKeyAxisIndexMap[categoryItemId];
|
|
@@ -47,7 +47,7 @@ class AnalyticsRequest extends AnalyticsRequestDimensionsMixin(AnalyticsRequestF
|
|
|
47
47
|
const columns = visualization.columns || [];
|
|
48
48
|
const rows = visualization.rows || [];
|
|
49
49
|
columns.concat(rows).forEach(d => {
|
|
50
|
-
var _d$legendSet, _d$programStage, _d$repetition
|
|
50
|
+
var _d$legendSet, _d$programStage, _d$repetition;
|
|
51
51
|
let dimension = d.dimension;
|
|
52
52
|
if ((_d$legendSet = d.legendSet) !== null && _d$legendSet !== void 0 && _d$legendSet.id) {
|
|
53
53
|
dimension += `-${d.legendSet.id}`;
|
|
@@ -56,7 +56,7 @@ class AnalyticsRequest extends AnalyticsRequestDimensionsMixin(AnalyticsRequestF
|
|
|
56
56
|
dimension += `:${d.filter}`;
|
|
57
57
|
}
|
|
58
58
|
const programStageId = (_d$programStage = d.programStage) === null || _d$programStage === void 0 ? void 0 : _d$programStage.id;
|
|
59
|
-
if ((_d$repetition = d.repetition) !== null && _d$repetition !== void 0 && (_d$repetition
|
|
59
|
+
if ((_d$repetition = d.repetition) !== null && _d$repetition !== void 0 && (_d$repetition = _d$repetition.indexes) !== null && _d$repetition !== void 0 && _d$repetition.length) {
|
|
60
60
|
d.repetition.indexes.forEach(index => {
|
|
61
61
|
var _d$program;
|
|
62
62
|
request = request.addDimension(formatDimension({
|
|
@@ -87,13 +87,13 @@ class AnalyticsRequest extends AnalyticsRequestDimensionsMixin(AnalyticsRequestF
|
|
|
87
87
|
var _f$items;
|
|
88
88
|
request = request.addDimension(f.dimension, (_f$items = f.items) === null || _f$items === void 0 ? void 0 : _f$items.map(item => item.id));
|
|
89
89
|
} else {
|
|
90
|
-
var _f$programStage, _f$repetition
|
|
90
|
+
var _f$programStage, _f$repetition;
|
|
91
91
|
let filterString = f.dimension;
|
|
92
92
|
if (f.filter) {
|
|
93
93
|
filterString += `:${f.filter}`;
|
|
94
94
|
}
|
|
95
95
|
const programStageId = (_f$programStage = f.programStage) === null || _f$programStage === void 0 ? void 0 : _f$programStage.id;
|
|
96
|
-
if ((_f$repetition = f.repetition) !== null && _f$repetition !== void 0 && (_f$repetition
|
|
96
|
+
if ((_f$repetition = f.repetition) !== null && _f$repetition !== void 0 && (_f$repetition = _f$repetition.indexes) !== null && _f$repetition !== void 0 && _f$repetition.length) {
|
|
97
97
|
f.repetition.indexes.forEach(index => {
|
|
98
98
|
var _f$program;
|
|
99
99
|
request = request.addFilter(formatDimension({
|
|
@@ -119,8 +119,8 @@ const OuterDndContext = ({
|
|
|
119
119
|
active,
|
|
120
120
|
over
|
|
121
121
|
}) => {
|
|
122
|
-
var _over$data, _over$data$current, _over$data$
|
|
123
|
-
if (!(over !== null && over !== void 0 && over.id) || (over === null || over === void 0
|
|
122
|
+
var _over$data, _over$data$current, _over$data$current2;
|
|
123
|
+
if (!(over !== null && over !== void 0 && over.id) || (over === null || over === void 0 || (_over$data = over.data) === null || _over$data === void 0 || (_over$data = _over$data.current) === null || _over$data === void 0 || (_over$data = _over$data.sortable) === null || _over$data === void 0 ? void 0 : _over$data.containerId) === OPTIONS_PANEL || !active.data.current) {
|
|
124
124
|
// dropped over non-droppable or over options panel
|
|
125
125
|
handleDragCancel();
|
|
126
126
|
return;
|
|
@@ -136,8 +136,8 @@ const OuterDndContext = ({
|
|
|
136
136
|
}
|
|
137
137
|
};
|
|
138
138
|
const destination = {
|
|
139
|
-
containerId: ((_over$data$
|
|
140
|
-
index: (_over$data$
|
|
139
|
+
containerId: ((_over$data$current = over.data.current) === null || _over$data$current === void 0 ? void 0 : _over$data$current.sortable.containerId) || over.id,
|
|
140
|
+
index: (_over$data$current2 = over.data.current) === null || _over$data$current2 === void 0 ? void 0 : _over$data$current2.sortable.index
|
|
141
141
|
};
|
|
142
142
|
onDragEnd({
|
|
143
143
|
item,
|
|
@@ -44,7 +44,7 @@ export const DataElementOperandInfo = ({
|
|
|
44
44
|
const dataElementOperand = dataElementOperands.dataElementOperands[0]
|
|
45
45
|
|
|
46
46
|
// copy some common fields from dataElement
|
|
47
|
-
|
|
47
|
+
;
|
|
48
48
|
['code', 'created', 'createdBy', 'displayDescription', 'lastUpdated'].forEach(key => dataElementOperand[key] = dataElementOperand.dataElement[key]);
|
|
49
49
|
|
|
50
50
|
// inject href as it is not returned from the API
|
|
@@ -72,7 +72,7 @@ export const ItemOptionsSelector = ({
|
|
|
72
72
|
searchTerm: state.searchTerm
|
|
73
73
|
});
|
|
74
74
|
const newOptions = [];
|
|
75
|
-
(_result$dimensionItem = result.dimensionItems) === null || _result$dimensionItem === void 0
|
|
75
|
+
(_result$dimensionItem = result.dimensionItems) === null || _result$dimensionItem === void 0 || _result$dimensionItem.forEach(item => {
|
|
76
76
|
newOptions.push({
|
|
77
77
|
label: item.name,
|
|
78
78
|
value: item.id,
|
|
@@ -144,7 +144,7 @@ const ItemSelector = ({
|
|
|
144
144
|
searchTerm: state.searchTerm
|
|
145
145
|
});
|
|
146
146
|
const newOptions = [];
|
|
147
|
-
(_result$dimensionItem = result.dimensionItems) === null || _result$dimensionItem === void 0
|
|
147
|
+
(_result$dimensionItem = result.dimensionItems) === null || _result$dimensionItem === void 0 || _result$dimensionItem.forEach(item => {
|
|
148
148
|
if (item.dimensionItemType === REPORTING_RATE) {
|
|
149
149
|
if (state.filter.subGroup && state.filter.subGroup !== DIMENSION_TYPE_ALL) {
|
|
150
150
|
const metric = DATA_SETS_CONSTANTS.find(item => item.id === state.filter.subGroup);
|
|
@@ -181,13 +181,13 @@ export const Editor = /*#__PURE__*/forwardRef(({
|
|
|
181
181
|
useEffect(() => {
|
|
182
182
|
if (initialFocus) {
|
|
183
183
|
var _textareaRef$current;
|
|
184
|
-
(_textareaRef$current = textareaRef.current) === null || _textareaRef$current === void 0
|
|
184
|
+
(_textareaRef$current = textareaRef.current) === null || _textareaRef$current === void 0 || _textareaRef$current.focus();
|
|
185
185
|
}
|
|
186
186
|
}, [initialFocus, textareaRef]);
|
|
187
187
|
useEffect(() => {
|
|
188
188
|
if (caretPosRef.current) {
|
|
189
189
|
var _textareaRef$current2;
|
|
190
|
-
(_textareaRef$current2 = textareaRef.current) === null || _textareaRef$current2 === void 0
|
|
190
|
+
(_textareaRef$current2 = textareaRef.current) === null || _textareaRef$current2 === void 0 || _textareaRef$current2.setSelectionRange(caretPosRef.current, caretPosRef.current);
|
|
191
191
|
caretPosRef.current = undefined;
|
|
192
192
|
}
|
|
193
193
|
}, [value, textareaRef]);
|
|
@@ -49,45 +49,90 @@ import viTranslations from './vi/translations.json';
|
|
|
49
49
|
import zhTranslations from './zh/translations.json';
|
|
50
50
|
import zh_CNTranslations from './zh_CN/translations.json';
|
|
51
51
|
const namespace = 'default';
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
i18n.
|
|
57
|
-
i18n.
|
|
58
|
-
i18n.
|
|
59
|
-
i18n.
|
|
60
|
-
i18n.
|
|
61
|
-
i18n.
|
|
62
|
-
i18n.
|
|
63
|
-
i18n.
|
|
64
|
-
i18n.
|
|
65
|
-
i18n.
|
|
66
|
-
i18n.
|
|
67
|
-
i18n.
|
|
68
|
-
i18n.
|
|
69
|
-
i18n.
|
|
70
|
-
i18n.
|
|
71
|
-
i18n.
|
|
72
|
-
i18n.
|
|
73
|
-
i18n.
|
|
74
|
-
i18n.
|
|
75
|
-
i18n.
|
|
76
|
-
i18n.
|
|
77
|
-
i18n.
|
|
78
|
-
i18n.
|
|
79
|
-
i18n.
|
|
80
|
-
i18n.
|
|
81
|
-
i18n.
|
|
82
|
-
i18n.
|
|
83
|
-
i18n.
|
|
84
|
-
i18n.
|
|
85
|
-
i18n.
|
|
86
|
-
i18n.
|
|
87
|
-
i18n.
|
|
88
|
-
i18n.
|
|
89
|
-
i18n.
|
|
90
|
-
i18n.
|
|
91
|
-
i18n.
|
|
92
|
-
i18n.
|
|
52
|
+
|
|
53
|
+
// Use 'deep' = true and 'overwrite' = false to add to, but not overwrite,
|
|
54
|
+
// custom translations from the datastore (added by the app adapter)
|
|
55
|
+
|
|
56
|
+
i18n.addResourceBundle('ar', namespace, arTranslations, true, false);
|
|
57
|
+
i18n.addResourceBundle('ar', namespace, arTranslations, true, false);
|
|
58
|
+
i18n.addResourceBundle('ar_EG', namespace, ar_EGTranslations, true, false);
|
|
59
|
+
i18n.addResourceBundle('ar-EG', namespace, ar_EGTranslations, true, false);
|
|
60
|
+
i18n.addResourceBundle('ar_IQ', namespace, ar_IQTranslations, true, false);
|
|
61
|
+
i18n.addResourceBundle('ar-IQ', namespace, ar_IQTranslations, true, false);
|
|
62
|
+
i18n.addResourceBundle('bn', namespace, bnTranslations, true, false);
|
|
63
|
+
i18n.addResourceBundle('bn', namespace, bnTranslations, true, false);
|
|
64
|
+
i18n.addResourceBundle('ckb', namespace, ckbTranslations, true, false);
|
|
65
|
+
i18n.addResourceBundle('ckb', namespace, ckbTranslations, true, false);
|
|
66
|
+
i18n.addResourceBundle('cs', namespace, csTranslations, true, false);
|
|
67
|
+
i18n.addResourceBundle('cs', namespace, csTranslations, true, false);
|
|
68
|
+
i18n.addResourceBundle('da', namespace, daTranslations, true, false);
|
|
69
|
+
i18n.addResourceBundle('da', namespace, daTranslations, true, false);
|
|
70
|
+
i18n.addResourceBundle('en', namespace, enTranslations, true, false);
|
|
71
|
+
i18n.addResourceBundle('en', namespace, enTranslations, true, false);
|
|
72
|
+
i18n.addResourceBundle('en_US', namespace, en_USTranslations, true, false);
|
|
73
|
+
i18n.addResourceBundle('en-US', namespace, en_USTranslations, true, false);
|
|
74
|
+
i18n.addResourceBundle('es', namespace, esTranslations, true, false);
|
|
75
|
+
i18n.addResourceBundle('es', namespace, esTranslations, true, false);
|
|
76
|
+
i18n.addResourceBundle('es_419', namespace, es_419Translations, true, false);
|
|
77
|
+
i18n.addResourceBundle('es-419', namespace, es_419Translations, true, false);
|
|
78
|
+
i18n.addResourceBundle('fr', namespace, frTranslations, true, false);
|
|
79
|
+
i18n.addResourceBundle('fr', namespace, frTranslations, true, false);
|
|
80
|
+
i18n.addResourceBundle('hi_IN', namespace, hi_INTranslations, true, false);
|
|
81
|
+
i18n.addResourceBundle('hi-IN', namespace, hi_INTranslations, true, false);
|
|
82
|
+
i18n.addResourceBundle('id', namespace, idTranslations, true, false);
|
|
83
|
+
i18n.addResourceBundle('id', namespace, idTranslations, true, false);
|
|
84
|
+
i18n.addResourceBundle('km', namespace, kmTranslations, true, false);
|
|
85
|
+
i18n.addResourceBundle('km', namespace, kmTranslations, true, false);
|
|
86
|
+
i18n.addResourceBundle('lo', namespace, loTranslations, true, false);
|
|
87
|
+
i18n.addResourceBundle('lo', namespace, loTranslations, true, false);
|
|
88
|
+
i18n.addResourceBundle('my', namespace, myTranslations, true, false);
|
|
89
|
+
i18n.addResourceBundle('my', namespace, myTranslations, true, false);
|
|
90
|
+
i18n.addResourceBundle('nb', namespace, nbTranslations, true, false);
|
|
91
|
+
i18n.addResourceBundle('nb', namespace, nbTranslations, true, false);
|
|
92
|
+
i18n.addResourceBundle('ne', namespace, neTranslations, true, false);
|
|
93
|
+
i18n.addResourceBundle('ne', namespace, neTranslations, true, false);
|
|
94
|
+
i18n.addResourceBundle('nl', namespace, nlTranslations, true, false);
|
|
95
|
+
i18n.addResourceBundle('nl', namespace, nlTranslations, true, false);
|
|
96
|
+
i18n.addResourceBundle('or', namespace, orTranslations, true, false);
|
|
97
|
+
i18n.addResourceBundle('or', namespace, orTranslations, true, false);
|
|
98
|
+
i18n.addResourceBundle('prs', namespace, prsTranslations, true, false);
|
|
99
|
+
i18n.addResourceBundle('prs', namespace, prsTranslations, true, false);
|
|
100
|
+
i18n.addResourceBundle('ps', namespace, psTranslations, true, false);
|
|
101
|
+
i18n.addResourceBundle('ps', namespace, psTranslations, true, false);
|
|
102
|
+
i18n.addResourceBundle('pt', namespace, ptTranslations, true, false);
|
|
103
|
+
i18n.addResourceBundle('pt', namespace, ptTranslations, true, false);
|
|
104
|
+
i18n.addResourceBundle('pt_BR', namespace, pt_BRTranslations, true, false);
|
|
105
|
+
i18n.addResourceBundle('pt-BR', namespace, pt_BRTranslations, true, false);
|
|
106
|
+
i18n.addResourceBundle('ro', namespace, roTranslations, true, false);
|
|
107
|
+
i18n.addResourceBundle('ro', namespace, roTranslations, true, false);
|
|
108
|
+
i18n.addResourceBundle('ru', namespace, ruTranslations, true, false);
|
|
109
|
+
i18n.addResourceBundle('ru', namespace, ruTranslations, true, false);
|
|
110
|
+
i18n.addResourceBundle('si', namespace, siTranslations, true, false);
|
|
111
|
+
i18n.addResourceBundle('si', namespace, siTranslations, true, false);
|
|
112
|
+
i18n.addResourceBundle('sv', namespace, svTranslations, true, false);
|
|
113
|
+
i18n.addResourceBundle('sv', namespace, svTranslations, true, false);
|
|
114
|
+
i18n.addResourceBundle('tet', namespace, tetTranslations, true, false);
|
|
115
|
+
i18n.addResourceBundle('tet', namespace, tetTranslations, true, false);
|
|
116
|
+
i18n.addResourceBundle('tg', namespace, tgTranslations, true, false);
|
|
117
|
+
i18n.addResourceBundle('tg', namespace, tgTranslations, true, false);
|
|
118
|
+
i18n.addResourceBundle('th', namespace, thTranslations, true, false);
|
|
119
|
+
i18n.addResourceBundle('th', namespace, thTranslations, true, false);
|
|
120
|
+
i18n.addResourceBundle('uk', namespace, ukTranslations, true, false);
|
|
121
|
+
i18n.addResourceBundle('uk', namespace, ukTranslations, true, false);
|
|
122
|
+
i18n.addResourceBundle('ur', namespace, urTranslations, true, false);
|
|
123
|
+
i18n.addResourceBundle('ur', namespace, urTranslations, true, false);
|
|
124
|
+
i18n.addResourceBundle('uz_Cyrl', namespace, uz_CyrlTranslations, true, false);
|
|
125
|
+
i18n.addResourceBundle('uz-Cyrl', namespace, uz_CyrlTranslations, true, false);
|
|
126
|
+
i18n.addResourceBundle('uz_Latn', namespace, uz_LatnTranslations, true, false);
|
|
127
|
+
i18n.addResourceBundle('uz-Latn', namespace, uz_LatnTranslations, true, false);
|
|
128
|
+
i18n.addResourceBundle('uz_UZ_Cyrl', namespace, uz_UZ_CyrlTranslations, true, false);
|
|
129
|
+
i18n.addResourceBundle('uz-Cyrl-UZ', namespace, uz_UZ_CyrlTranslations, true, false);
|
|
130
|
+
i18n.addResourceBundle('uz_UZ_Latn', namespace, uz_UZ_LatnTranslations, true, false);
|
|
131
|
+
i18n.addResourceBundle('uz-Latn-UZ', namespace, uz_UZ_LatnTranslations, true, false);
|
|
132
|
+
i18n.addResourceBundle('vi', namespace, viTranslations, true, false);
|
|
133
|
+
i18n.addResourceBundle('vi', namespace, viTranslations, true, false);
|
|
134
|
+
i18n.addResourceBundle('zh', namespace, zhTranslations, true, false);
|
|
135
|
+
i18n.addResourceBundle('zh', namespace, zhTranslations, true, false);
|
|
136
|
+
i18n.addResourceBundle('zh_CN', namespace, zh_CNTranslations, true, false);
|
|
137
|
+
i18n.addResourceBundle('zh-CN', namespace, zh_CNTranslations, true, false);
|
|
93
138
|
export default i18n;
|
|
@@ -4,7 +4,7 @@ export const LEGEND_DISPLAY_STYLE_FILL = 'FILL';
|
|
|
4
4
|
export const LEGEND_DISPLAY_STYLE_TEXT = 'TEXT';
|
|
5
5
|
export const getLegendByValueFromLegendSet = (legendSet, value) => {
|
|
6
6
|
var _legendSet$legends;
|
|
7
|
-
return Number.isInteger(parseInt(value)) ? legendSet === null || legendSet === void 0
|
|
7
|
+
return Number.isInteger(parseInt(value)) ? legendSet === null || legendSet === void 0 || (_legendSet$legends = legendSet.legends) === null || _legendSet$legends === void 0 ? void 0 : _legendSet$legends.find(legend => value >= legend.startValue && value < legend.endValue // TODO: Confirm inclusive/exclusive bounds
|
|
8
8
|
) : null;
|
|
9
9
|
};
|
|
10
10
|
export const getColorByValueFromLegendSet = (legendSet, value) => {
|
|
@@ -2,7 +2,7 @@ import { colors } from '@dhis2/ui';
|
|
|
2
2
|
import { getColorByValueFromLegendSet, LEGEND_DISPLAY_STRATEGY_BY_DATA_ITEM, LEGEND_DISPLAY_STRATEGY_FIXED, LEGEND_DISPLAY_STYLE_TEXT, LEGEND_DISPLAY_STYLE_FILL } from '../legends.js';
|
|
3
3
|
import { isColorBright } from './isColorBright.js';
|
|
4
4
|
const getLegendSet = (engine, dxDimension) => {
|
|
5
|
-
var _engine$visualization, _engine$visualization2
|
|
5
|
+
var _engine$visualization, _engine$visualization2;
|
|
6
6
|
let legendSetId;
|
|
7
7
|
switch ((_engine$visualization = engine.visualization.legend) === null || _engine$visualization === void 0 ? void 0 : _engine$visualization.strategy) {
|
|
8
8
|
case LEGEND_DISPLAY_STRATEGY_BY_DATA_ITEM:
|
|
@@ -12,15 +12,15 @@ const getLegendSet = (engine, dxDimension) => {
|
|
|
12
12
|
break;
|
|
13
13
|
case LEGEND_DISPLAY_STRATEGY_FIXED:
|
|
14
14
|
default:
|
|
15
|
-
legendSetId = (_engine$visualization2 = engine.visualization.legend) === null || _engine$visualization2 === void 0
|
|
15
|
+
legendSetId = (_engine$visualization2 = engine.visualization.legend) === null || _engine$visualization2 === void 0 || (_engine$visualization2 = _engine$visualization2.set) === null || _engine$visualization2 === void 0 ? void 0 : _engine$visualization2.id;
|
|
16
16
|
break;
|
|
17
17
|
}
|
|
18
18
|
return engine.legendSets[legendSetId];
|
|
19
19
|
};
|
|
20
20
|
const buildStyleObject = (legendColor, engine) => {
|
|
21
|
-
var _engine$
|
|
21
|
+
var _engine$visualization3;
|
|
22
22
|
const style = {};
|
|
23
|
-
switch ((_engine$
|
|
23
|
+
switch ((_engine$visualization3 = engine.visualization.legend) === null || _engine$visualization3 === void 0 ? void 0 : _engine$visualization3.style) {
|
|
24
24
|
case LEGEND_DISPLAY_STYLE_TEXT:
|
|
25
25
|
style.color = legendColor;
|
|
26
26
|
break;
|
|
@@ -28,11 +28,11 @@ export default function loadSingleValueSVG() {
|
|
|
28
28
|
while (!fitsWithinContainer && dynamicStyles.hasNext()) {
|
|
29
29
|
styles = dynamicStyles.next();
|
|
30
30
|
valueElement.attr(styles.value);
|
|
31
|
-
subTextElement === null || subTextElement === void 0
|
|
31
|
+
subTextElement === null || subTextElement === void 0 || subTextElement.attr(styles.subText);
|
|
32
32
|
fitsWithinContainer = checkIfFitsWithinContainer(getAvailableSpace.call(this, styles.spacing.valueTop), valueElement, subTextElement, icon, subText, styles.spacing);
|
|
33
33
|
}
|
|
34
34
|
positionElements.call(this, valueElement, subTextElement, iconElement, styles.spacing);
|
|
35
35
|
valueElement.attr('visibility', 'visible');
|
|
36
|
-
iconElement === null || iconElement === void 0
|
|
37
|
-
subTextElement === null || subTextElement === void 0
|
|
36
|
+
iconElement === null || iconElement === void 0 || iconElement.attr('visibility', 'visible');
|
|
37
|
+
subTextElement === null || subTextElement === void 0 || subTextElement.attr('visibility', 'visible');
|
|
38
38
|
}
|
|
@@ -40,7 +40,7 @@ export default function ({
|
|
|
40
40
|
extraConfig,
|
|
41
41
|
extraOptions
|
|
42
42
|
}) {
|
|
43
|
-
var _layout$legend, _layout$seriesKey, _layout$seriesKey2,
|
|
43
|
+
var _layout$legend, _layout$seriesKey, _layout$seriesKey2, _config$xAxis;
|
|
44
44
|
const _layout = getTransformedLayout(layout);
|
|
45
45
|
const _extraOptions = getTransformedExtraOptions(extraOptions);
|
|
46
46
|
const stacked = isStacked(_layout.type);
|
|
@@ -83,7 +83,7 @@ export default function ({
|
|
|
83
83
|
// legend
|
|
84
84
|
legend: getLegend({
|
|
85
85
|
isHidden: (_layout$seriesKey = _layout.seriesKey) === null || _layout$seriesKey === void 0 ? void 0 : _layout$seriesKey.hidden,
|
|
86
|
-
fontStyle: (_layout$seriesKey2 = _layout.seriesKey) === null || _layout$seriesKey2 === void 0
|
|
86
|
+
fontStyle: (_layout$seriesKey2 = _layout.seriesKey) === null || _layout$seriesKey2 === void 0 || (_layout$seriesKey2 = _layout$seriesKey2.label) === null || _layout$seriesKey2 === void 0 ? void 0 : _layout$seriesKey2.fontStyle,
|
|
87
87
|
visType: _layout.type,
|
|
88
88
|
dashboard: _extraOptions.dashboard
|
|
89
89
|
}),
|
|
@@ -185,7 +185,7 @@ export default function ({
|
|
|
185
185
|
displayStrategy
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
|
-
(_series = series) === null || _series === void 0
|
|
188
|
+
(_series = series) === null || _series === void 0 || _series.forEach(seriesObj => {
|
|
189
189
|
// animation
|
|
190
190
|
seriesObj.animation = extraOptions.dashboard ? false : {
|
|
191
191
|
duration: getAnimation(extraOptions.animation, DEFAULT_ANIMATION_DURATION)
|
|
@@ -69,9 +69,9 @@ export default function subtitle(series, layout, metaData, extraOptions) {
|
|
|
69
69
|
switch (layout.type) {
|
|
70
70
|
case VIS_TYPE_SINGLE_VALUE:
|
|
71
71
|
{
|
|
72
|
-
var _defaultFontStyle$FON, _layout$fontStyle
|
|
73
|
-
const defaultColor = defaultFontStyle === null || defaultFontStyle === void 0
|
|
74
|
-
const customColor = layout === null || layout === void 0
|
|
72
|
+
var _defaultFontStyle$FON, _layout$fontStyle;
|
|
73
|
+
const defaultColor = defaultFontStyle === null || defaultFontStyle === void 0 || (_defaultFontStyle$FON = defaultFontStyle[FONT_STYLE_VISUALIZATION_SUBTITLE]) === null || _defaultFontStyle$FON === void 0 ? void 0 : _defaultFontStyle$FON[FONT_STYLE_OPTION_TEXT_COLOR];
|
|
74
|
+
const customColor = layout === null || layout === void 0 || (_layout$fontStyle = layout.fontStyle) === null || _layout$fontStyle === void 0 || (_layout$fontStyle = _layout$fontStyle[FONT_STYLE_VISUALIZATION_SUBTITLE]) === null || _layout$fontStyle === void 0 ? void 0 : _layout$fontStyle[FONT_STYLE_OPTION_TEXT_COLOR];
|
|
75
75
|
subtitle.style.color = getSingleValueSubtitleColor(customColor, defaultColor, series[0], legendOptions, legendSets);
|
|
76
76
|
if (dashboard) {
|
|
77
77
|
// Single value subtitle text should be multiline
|
|
@@ -76,9 +76,9 @@ export default function (layout, metaData, extraOptions, series) {
|
|
|
76
76
|
switch (layout.type) {
|
|
77
77
|
case VIS_TYPE_SINGLE_VALUE:
|
|
78
78
|
{
|
|
79
|
-
var _defaultFontStyle$FON, _layout$fontStyle
|
|
80
|
-
const defaultColor = defaultFontStyle === null || defaultFontStyle === void 0
|
|
81
|
-
const customColor = layout === null || layout === void 0
|
|
79
|
+
var _defaultFontStyle$FON, _layout$fontStyle;
|
|
80
|
+
const defaultColor = defaultFontStyle === null || defaultFontStyle === void 0 || (_defaultFontStyle$FON = defaultFontStyle[FONT_STYLE_VISUALIZATION_TITLE]) === null || _defaultFontStyle$FON === void 0 ? void 0 : _defaultFontStyle$FON[FONT_STYLE_OPTION_TEXT_COLOR];
|
|
81
|
+
const customColor = layout === null || layout === void 0 || (_layout$fontStyle = layout.fontStyle) === null || _layout$fontStyle === void 0 || (_layout$fontStyle = _layout$fontStyle[FONT_STYLE_VISUALIZATION_TITLE]) === null || _layout$fontStyle === void 0 ? void 0 : _layout$fontStyle[FONT_STYLE_OPTION_TEXT_COLOR];
|
|
82
82
|
title.style.color = getSingleValueTitleColor(customColor, defaultColor, series[0], legendOptions, legendSets);
|
|
83
83
|
if (dashboard) {
|
|
84
84
|
// TODO: is this always what we want?
|
|
@@ -34,9 +34,9 @@ H.patterns.forEach((pattern, i) => {
|
|
|
34
34
|
function drawLegendSymbolWrap() {
|
|
35
35
|
const pick = H.pick;
|
|
36
36
|
H.wrap(H.seriesTypes.column.prototype, 'drawLegendSymbol', function (proceed, legend, item) {
|
|
37
|
-
var _this$options$legendS
|
|
37
|
+
var _this$options$legendS;
|
|
38
38
|
const legendItem = item.legendItem;
|
|
39
|
-
if ((_this$options$legendS = this.options.legendSet) !== null && _this$options$legendS !== void 0 && (_this$options$
|
|
39
|
+
if ((_this$options$legendS = this.options.legendSet) !== null && _this$options$legendS !== void 0 && (_this$options$legendS = _this$options$legendS.legends) !== null && _this$options$legendS !== void 0 && _this$options$legendS.length) {
|
|
40
40
|
const ys = legend.baseline - legend.symbolHeight + 1,
|
|
41
41
|
// y start
|
|
42
42
|
x = legend.symbolWidth / 2 > 8 ? legend.symbolWidth / 2 : 8,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default function (acc, series, categories, idValueMap, metaData, extraOptions) {
|
|
2
2
|
var _extraOptions$xAxisLa;
|
|
3
3
|
const seriesData = Array.from({
|
|
4
|
-
length: (extraOptions === null || extraOptions === void 0
|
|
4
|
+
length: (extraOptions === null || extraOptions === void 0 || (_extraOptions$xAxisLa = extraOptions.xAxisLabels) === null || _extraOptions$xAxisLa === void 0 ? void 0 : _extraOptions$xAxisLa.length) || 0
|
|
5
5
|
}, () => null);
|
|
6
6
|
categories[0].forEach(categoryItemId => {
|
|
7
7
|
const position = extraOptions.periodKeyAxisIndexMap[categoryItemId];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhis2/analytics",
|
|
3
|
-
"version": "29.4.
|
|
3
|
+
"version": "29.4.1",
|
|
4
4
|
"main": "./build/cjs/index.js",
|
|
5
5
|
"module": "./build/es/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@dhis2/app-runtime": "^3.14.1",
|
|
34
|
-
"@dhis2/cli-app-scripts": "^12.
|
|
34
|
+
"@dhis2/cli-app-scripts": "^12.11.0",
|
|
35
35
|
"@dhis2/cli-style": "^10.7.9",
|
|
36
36
|
"@dhis2/d2-i18n": "^1.1.0",
|
|
37
37
|
"@dhis2/ui": "^10.12.7",
|