@dhis2/analytics 26.3.0-alpha.1 → 26.3.0-alpha.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/build/cjs/__demo__/DimensionsPanel.stories.js +1 -0
- package/build/cjs/api/analytics/Analytics.js +0 -7
- package/build/cjs/api/analytics/AnalyticsBase.js +6 -24
- package/build/cjs/api/analytics/AnalyticsRequest.js +10 -33
- package/build/cjs/api/analytics/AnalyticsRequestBase.js +1 -3
- package/build/cjs/api/analytics/AnalyticsRequestPropertiesMixin.js +0 -19
- package/build/cjs/api/analytics/utils.js +2 -23
- package/build/cjs/assets/DynamicDimensionIcon.js +12 -38
- package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +44 -32
- package/build/cjs/components/DimensionsPanel/List/OptionsButton.js +7 -6
- package/build/cjs/components/DimensionsPanel/List/RecommendedIcon.js +1 -2
- package/build/cjs/components/DimensionsPanel/List/__tests__/__snapshots__/DimensionItem.spec.js.snap +238 -361
- package/build/cjs/components/DimensionsPanel/List/styles/DimensionItem.style.js +5 -67
- package/build/cjs/components/DimensionsPanel/List/styles/DimensionList.style.js +2 -2
- package/build/cjs/components/DimensionsPanel/List/styles/RecommendedIcon.style.js +4 -4
- package/build/cjs/components/DimensionsPanel/styles/DimensionsPanel.style.js +1 -1
- package/build/cjs/modules/layout/dimension.js +2 -9
- package/build/cjs/modules/layout/dimensionCreate.js +0 -3
- package/build/es/__demo__/DimensionsPanel.stories.js +1 -0
- package/build/es/api/analytics/Analytics.js +0 -7
- package/build/es/api/analytics/AnalyticsBase.js +6 -24
- package/build/es/api/analytics/AnalyticsRequest.js +10 -33
- package/build/es/api/analytics/AnalyticsRequestBase.js +1 -3
- package/build/es/api/analytics/AnalyticsRequestPropertiesMixin.js +0 -19
- package/build/es/api/analytics/utils.js +1 -20
- package/build/es/assets/DynamicDimensionIcon.js +12 -38
- package/build/es/components/DimensionsPanel/List/DimensionItem.js +45 -33
- package/build/es/components/DimensionsPanel/List/OptionsButton.js +7 -6
- package/build/es/components/DimensionsPanel/List/RecommendedIcon.js +1 -2
- package/build/es/components/DimensionsPanel/List/__tests__/__snapshots__/DimensionItem.spec.js.snap +238 -361
- package/build/es/components/DimensionsPanel/List/styles/DimensionItem.style.js +4 -66
- package/build/es/components/DimensionsPanel/List/styles/DimensionList.style.js +2 -2
- package/build/es/components/DimensionsPanel/List/styles/RecommendedIcon.style.js +4 -4
- package/build/es/components/DimensionsPanel/styles/DimensionsPanel.style.js +1 -1
- package/build/es/modules/layout/dimension.js +1 -7
- package/build/es/modules/layout/dimensionCreate.js +1 -4
- package/package.json +1 -1
- package/build/cjs/api/analytics/AnalyticsTrackedEntities.js +0 -31
- package/build/es/api/analytics/AnalyticsTrackedEntities.js +0 -24
|
@@ -1,66 +1,4 @@
|
|
|
1
|
-
import { colors
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
},
|
|
6
|
-
text: {
|
|
7
|
-
color: colors.grey900,
|
|
8
|
-
userSelect: 'none',
|
|
9
|
-
wordBreak: 'break-word',
|
|
10
|
-
fontSize: '14px'
|
|
11
|
-
},
|
|
12
|
-
textDeactivated: {
|
|
13
|
-
cursor: 'auto',
|
|
14
|
-
color: colors.grey500
|
|
15
|
-
},
|
|
16
|
-
item: {
|
|
17
|
-
display: 'flex',
|
|
18
|
-
minHeight: '24px',
|
|
19
|
-
marginTop: 3,
|
|
20
|
-
marginBottom: 3,
|
|
21
|
-
alignItems: 'center',
|
|
22
|
-
borderRadius: '2px'
|
|
23
|
-
},
|
|
24
|
-
clickable: {
|
|
25
|
-
cursor: 'pointer'
|
|
26
|
-
},
|
|
27
|
-
selected: {
|
|
28
|
-
backgroundColor: theme.secondary100,
|
|
29
|
-
fontWeight: 500
|
|
30
|
-
},
|
|
31
|
-
fixedDimensionIcon: {
|
|
32
|
-
paddingLeft: '6px',
|
|
33
|
-
paddingBottom: '2px'
|
|
34
|
-
},
|
|
35
|
-
dynamicDimensionIcon: {
|
|
36
|
-
paddingLeft: '9px',
|
|
37
|
-
paddingRight: '9px'
|
|
38
|
-
},
|
|
39
|
-
iconWrapper: {
|
|
40
|
-
display: 'flex',
|
|
41
|
-
flexDirection: 'column',
|
|
42
|
-
padding: '3px 8px 0 8px'
|
|
43
|
-
},
|
|
44
|
-
optionsWrapper: {
|
|
45
|
-
position: 'relative',
|
|
46
|
-
left: '5px',
|
|
47
|
-
width: '20px',
|
|
48
|
-
height: '20px'
|
|
49
|
-
},
|
|
50
|
-
optionsButton: {
|
|
51
|
-
display: 'flex',
|
|
52
|
-
alignItems: 'center',
|
|
53
|
-
justifyContent: 'center',
|
|
54
|
-
height: '20px',
|
|
55
|
-
width: '20px',
|
|
56
|
-
padding: 0,
|
|
57
|
-
border: 'none',
|
|
58
|
-
background: 'none',
|
|
59
|
-
outline: 'none',
|
|
60
|
-
cursor: 'pointer'
|
|
61
|
-
},
|
|
62
|
-
label: {
|
|
63
|
-
display: 'flex',
|
|
64
|
-
outline: 'none'
|
|
65
|
-
}
|
|
66
|
-
};
|
|
1
|
+
import { colors } from '@dhis2/ui';
|
|
2
|
+
const _defaultExport = [`.item.jsx-3528757313{color:${colors.grey900};background-color:transparent;fill:${colors.grey800};display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;outline:none;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;padding:0 0 0 4px;margin:0;border-radius:2px;cursor:pointer;min-height:22px;border:1px solid transparent;}`, `.item.jsx-3528757313:not(.deactivated):not(.dragging):hover{background-color:${colors.grey100};border-color:${colors.grey400};}`, ".label.jsx-3528757313{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".labelWrapper.jsx-3528757313{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".labelText.jsx-3528757313{font-size:13px;line-height:15px;margin-top:1px;}", ".iconWrapper.jsx-3528757313{width:16px;height:16px;margin:2px 4px 0 0;-webkit-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;}", ".item.deactivated.jsx-3528757313{opacity:0.5;cursor:not-allowed;}", `.item.selected.jsx-3528757313{background-color:${colors.teal100};border:1px solid ${colors.teal200};color:${colors.teal900};fill:${colors.teal800};font-weight:400;}`, ".item.selected.jsx-3528757313:not(.deactivated):hover{background:#cdeae8;border-color:#93c4bf;box-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);}", ".optionsWrapper.jsx-3528757313{width:20px;height:20px;}", `.lockWrapper.jsx-3528757313 svg.jsx-3528757313 path.jsx-3528757313{fill:${colors.grey800};}`, `.lockWrapper.jsx-3528757313{background:${colors.grey300};height:20px;padding:0 1px 0 2px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}`, ".item.selected.jsx-3528757313 .lockWrapper.jsx-3528757313{background:#cbe7e5;}", `.item.selected.jsx-3528757313 .lockWrapper.jsx-3528757313 svg.jsx-3528757313 path.jsx-3528757313{fill:${colors.teal900};}`];
|
|
3
|
+
_defaultExport.__hash = "3528757313";
|
|
4
|
+
export default _defaultExport;
|
|
@@ -2,6 +2,6 @@ import { colors, spacers } from '@dhis2/ui';
|
|
|
2
2
|
// Fix for vertical flex scrolling in Firefox/Safari:
|
|
3
3
|
// Wrap the list in a div with position:relative (and flex:1 instead of on the list)
|
|
4
4
|
// On the list, set position:absolute, width:100%, height:100%
|
|
5
|
-
const _defaultExport = [".container.jsx-
|
|
6
|
-
_defaultExport.__hash = "
|
|
5
|
+
const _defaultExport = [".container.jsx-2040313368{position:relative;-webkit-flex:1 1 0%;-ms-flex:1 1 0%;flex:1 1 0%;min-height:30vh;}", ".wrapper.jsx-2040313368{position:absolute;width:100%;height:100%;overflow:auto;margin-top:0;padding:0;}", ".list.jsx-2040313368{margin:0;padding:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:4px;}", `.header.jsx-2040313368{text-transform:uppercase;font-size:11px;color:${colors.grey600};margin:0 0 ${spacers.dp8} 0;-webkit-letter-spacing:0.3px;-moz-letter-spacing:0.3px;-ms-letter-spacing:0.3px;letter-spacing:0.3px;font-weight:400;}`, `.section.jsx-2040313368:not(:last-child){margin-bottom:${spacers.dp24};}`];
|
|
6
|
+
_defaultExport.__hash = "2040313368";
|
|
7
7
|
export default _defaultExport;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { theme } from '@dhis2/ui';
|
|
2
2
|
export const styles = {
|
|
3
3
|
recommendedIcon: {
|
|
4
|
-
backgroundColor: theme.
|
|
5
|
-
height: '
|
|
6
|
-
width: '
|
|
4
|
+
backgroundColor: theme.secondary400,
|
|
5
|
+
height: '6px',
|
|
6
|
+
width: '6px',
|
|
7
7
|
borderRadius: '4px',
|
|
8
|
-
marginLeft: '
|
|
8
|
+
marginLeft: '6px',
|
|
9
9
|
display: 'inline-block',
|
|
10
10
|
cursor: 'pointer'
|
|
11
11
|
}
|
|
@@ -33,12 +33,6 @@ export const DIMENSION_PROP_LEGEND_SET = {
|
|
|
33
33
|
required: false,
|
|
34
34
|
isValid: prop => isString(prop)
|
|
35
35
|
};
|
|
36
|
-
export const DIMENSION_PROP_PROGRAM = {
|
|
37
|
-
name: 'program',
|
|
38
|
-
defaultValue: {},
|
|
39
|
-
required: false,
|
|
40
|
-
isValid: prop => isObject(prop)
|
|
41
|
-
};
|
|
42
36
|
export const DIMENSION_PROP_PROGRAM_STAGE = {
|
|
43
37
|
name: 'programStage',
|
|
44
38
|
defaultValue: {},
|
|
@@ -51,4 +45,4 @@ export const DIMENSION_PROP_REPETITION = {
|
|
|
51
45
|
required: false,
|
|
52
46
|
isValid: prop => Array.isArray(prop)
|
|
53
47
|
};
|
|
54
|
-
export const DIMENSION_PROPS = [DIMENSION_PROP_ID, DIMENSION_PROP_ITEMS, DIMENSION_PROP_FILTER, DIMENSION_PROP_LEGEND_SET,
|
|
48
|
+
export const DIMENSION_PROPS = [DIMENSION_PROP_ID, DIMENSION_PROP_ITEMS, DIMENSION_PROP_FILTER, DIMENSION_PROP_LEGEND_SET, DIMENSION_PROP_PROGRAM_STAGE, DIMENSION_PROP_REPETITION];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DIMENSION_PROP_ID, DIMENSION_PROP_ITEMS, DIMENSION_PROP_FILTER, DIMENSION_PROP_LEGEND_SET,
|
|
1
|
+
import { DIMENSION_PROP_ID, DIMENSION_PROP_ITEMS, DIMENSION_PROP_FILTER, DIMENSION_PROP_LEGEND_SET, DIMENSION_PROP_PROGRAM_STAGE, DIMENSION_PROP_REPETITION } from './dimension.js';
|
|
2
2
|
export const dimensionCreate = function (dimensionId) {
|
|
3
3
|
let itemIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
4
4
|
let args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
@@ -15,9 +15,6 @@ export const dimensionCreate = function (dimensionId) {
|
|
|
15
15
|
...(args.legendSet && {
|
|
16
16
|
[DIMENSION_PROP_LEGEND_SET.name]: args.legendSet
|
|
17
17
|
}),
|
|
18
|
-
...(args.program && {
|
|
19
|
-
[DIMENSION_PROP_PROGRAM.name]: args.program
|
|
20
|
-
}),
|
|
21
18
|
...(args.programStage && {
|
|
22
19
|
[DIMENSION_PROP_PROGRAM_STAGE.name]: args.programStage
|
|
23
20
|
}),
|
package/package.json
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _AnalyticsBase = _interopRequireDefault(require("./AnalyticsBase.js"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
/**
|
|
10
|
-
* @extends module:analytics.AnalyticsBase
|
|
11
|
-
*
|
|
12
|
-
* @description
|
|
13
|
-
* Analytics tracked entities class used to request analytics tracked entities data from Web API.
|
|
14
|
-
*
|
|
15
|
-
* @memberof module:analytics
|
|
16
|
-
*/
|
|
17
|
-
class AnalyticsTrackedEntities extends _AnalyticsBase.default {
|
|
18
|
-
/**
|
|
19
|
-
* @param {!AnalyticsRequest} req Request object
|
|
20
|
-
*
|
|
21
|
-
* @returns {Promise} Promise that resolves with the analytics query data from the api.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
// TODO: provide working example
|
|
25
|
-
*/
|
|
26
|
-
getQuery(req) {
|
|
27
|
-
return this.fetch(req.withPath('trackedEntities/query'));
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
var _default = AnalyticsTrackedEntities;
|
|
31
|
-
exports.default = _default;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import AnalyticsBase from './AnalyticsBase.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @extends module:analytics.AnalyticsBase
|
|
5
|
-
*
|
|
6
|
-
* @description
|
|
7
|
-
* Analytics tracked entities class used to request analytics tracked entities data from Web API.
|
|
8
|
-
*
|
|
9
|
-
* @memberof module:analytics
|
|
10
|
-
*/
|
|
11
|
-
class AnalyticsTrackedEntities extends AnalyticsBase {
|
|
12
|
-
/**
|
|
13
|
-
* @param {!AnalyticsRequest} req Request object
|
|
14
|
-
*
|
|
15
|
-
* @returns {Promise} Promise that resolves with the analytics query data from the api.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
// TODO: provide working example
|
|
19
|
-
*/
|
|
20
|
-
getQuery(req) {
|
|
21
|
-
return this.fetch(req.withPath('trackedEntities/query'));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export default AnalyticsTrackedEntities;
|