@dhis2/analytics 26.6.9 → 26.6.10
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/assets/DynamicDimensionIcon.js +12 -38
- package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +49 -33
- 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 +239 -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/es/__demo__/DimensionsPanel.stories.js +1 -0
- package/build/es/assets/DynamicDimensionIcon.js +12 -38
- package/build/es/components/DimensionsPanel/List/DimensionItem.js +50 -34
- 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 +239 -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/package.json +2 -2
|
@@ -3,71 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _ui = require("@dhis2/ui");
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
text: {
|
|
13
|
-
color: _ui.colors.grey900,
|
|
14
|
-
userSelect: 'none',
|
|
15
|
-
wordBreak: 'break-word',
|
|
16
|
-
fontSize: '14px'
|
|
17
|
-
},
|
|
18
|
-
textDeactivated: {
|
|
19
|
-
cursor: 'auto',
|
|
20
|
-
color: _ui.colors.grey500
|
|
21
|
-
},
|
|
22
|
-
item: {
|
|
23
|
-
display: 'flex',
|
|
24
|
-
minHeight: '24px',
|
|
25
|
-
marginTop: 3,
|
|
26
|
-
marginBottom: 3,
|
|
27
|
-
alignItems: 'center',
|
|
28
|
-
borderRadius: '2px'
|
|
29
|
-
},
|
|
30
|
-
clickable: {
|
|
31
|
-
cursor: 'pointer'
|
|
32
|
-
},
|
|
33
|
-
selected: {
|
|
34
|
-
backgroundColor: _ui.theme.secondary100,
|
|
35
|
-
fontWeight: 500
|
|
36
|
-
},
|
|
37
|
-
fixedDimensionIcon: {
|
|
38
|
-
paddingLeft: '6px',
|
|
39
|
-
paddingBottom: '2px'
|
|
40
|
-
},
|
|
41
|
-
dynamicDimensionIcon: {
|
|
42
|
-
paddingLeft: '9px',
|
|
43
|
-
paddingRight: '9px'
|
|
44
|
-
},
|
|
45
|
-
iconWrapper: {
|
|
46
|
-
display: 'flex',
|
|
47
|
-
flexDirection: 'column',
|
|
48
|
-
padding: '3px 8px 0 8px'
|
|
49
|
-
},
|
|
50
|
-
optionsWrapper: {
|
|
51
|
-
position: 'relative',
|
|
52
|
-
left: '5px',
|
|
53
|
-
width: '20px',
|
|
54
|
-
height: '20px'
|
|
55
|
-
},
|
|
56
|
-
optionsButton: {
|
|
57
|
-
display: 'flex',
|
|
58
|
-
alignItems: 'center',
|
|
59
|
-
justifyContent: 'center',
|
|
60
|
-
height: '20px',
|
|
61
|
-
width: '20px',
|
|
62
|
-
padding: 0,
|
|
63
|
-
border: 'none',
|
|
64
|
-
background: 'none',
|
|
65
|
-
outline: 'none',
|
|
66
|
-
cursor: 'pointer'
|
|
67
|
-
},
|
|
68
|
-
label: {
|
|
69
|
-
display: 'flex',
|
|
70
|
-
outline: 'none'
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
exports.styles = styles;
|
|
8
|
+
const _defaultExport = [`.item.jsx-1684920521{color:${_ui.colors.grey900};background-color:transparent;fill:${_ui.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-1684920521:not(.deactivated):not(.dragging):hover{background-color:${_ui.colors.grey100};border-color:${_ui.colors.grey400};}`, ".label.jsx-1684920521{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-1684920521{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-1684920521{font-size:13px;line-height:15px;margin-top:1px;}", ".iconWrapper.jsx-1684920521{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-1684920521{opacity:0.5;cursor:not-allowed;}", `.item.selected.jsx-1684920521{background-color:${_ui.colors.teal100};border:1px solid ${_ui.colors.teal200};color:${_ui.colors.teal900};fill:${_ui.colors.teal800};font-weight:400;}`, ".item.selected.jsx-1684920521:not(.deactivated):hover{background:#cdeae8;border-color:#93c4bf;box-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);}", ".optionsWrapper.jsx-1684920521{width:20px;height:20px;}", `.lockWrapper.jsx-1684920521 svg.jsx-1684920521 path.jsx-1684920521{fill:${_ui.colors.grey800};}`, `.lockWrapper.jsx-1684920521{background:${_ui.colors.grey300};height:20px;padding:0 2px 0 3px;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-1684920521 .lockWrapper.jsx-1684920521{background:#cbe7e5;}", `.item.selected.jsx-1684920521 .lockWrapper.jsx-1684920521 svg.jsx-1684920521 path.jsx-1684920521{fill:${_ui.colors.teal900};}`];
|
|
9
|
+
_defaultExport.__hash = "1684920521";
|
|
10
|
+
var _default = _defaultExport;
|
|
11
|
+
exports.default = _default;
|
|
@@ -8,7 +8,7 @@ var _ui = require("@dhis2/ui");
|
|
|
8
8
|
// Fix for vertical flex scrolling in Firefox/Safari:
|
|
9
9
|
// Wrap the list in a div with position:relative (and flex:1 instead of on the list)
|
|
10
10
|
// On the list, set position:absolute, width:100%, height:100%
|
|
11
|
-
const _defaultExport = [".container.jsx-
|
|
12
|
-
_defaultExport.__hash = "
|
|
11
|
+
const _defaultExport = [".container.jsx-1758681086{position:relative;-webkit-flex:1 1 0%;-ms-flex:1 1 0%;flex:1 1 0%;min-height:30vh;}", `.wrapper.jsx-1758681086{position:absolute;width:100%;height:100%;overflow:auto;margin-top:0;padding:0 ${_ui.spacers.dp8} 0 0;}`, ".list.jsx-1758681086{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-1758681086{text-transform:uppercase;font-size:11px;color:${_ui.colors.grey600};margin:0 0 ${_ui.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-1758681086:not(:last-child){margin-bottom:${_ui.spacers.dp24};}`];
|
|
12
|
+
_defaultExport.__hash = "1758681086";
|
|
13
13
|
var _default = _defaultExport;
|
|
14
14
|
exports.default = _default;
|
|
@@ -7,11 +7,11 @@ exports.styles = void 0;
|
|
|
7
7
|
var _ui = require("@dhis2/ui");
|
|
8
8
|
const styles = {
|
|
9
9
|
recommendedIcon: {
|
|
10
|
-
backgroundColor: _ui.theme.
|
|
11
|
-
height: '
|
|
12
|
-
width: '
|
|
10
|
+
backgroundColor: _ui.theme.secondary400,
|
|
11
|
+
height: '6px',
|
|
12
|
+
width: '6px',
|
|
13
13
|
borderRadius: '4px',
|
|
14
|
-
marginLeft: '
|
|
14
|
+
marginLeft: '6px',
|
|
15
15
|
display: 'inline-block',
|
|
16
16
|
cursor: 'pointer'
|
|
17
17
|
}
|
|
@@ -62,6 +62,7 @@ storiesOf('DimensionsPanel', module).add('locked dimension', () => {
|
|
|
62
62
|
return /*#__PURE__*/React.createElement(DimensionsPanel, {
|
|
63
63
|
dimensions: [...fixedDimensions, ...dynamicDimensions],
|
|
64
64
|
onDimensionClick: onDimensionClick,
|
|
65
|
+
selectedIds: [DIMENSION_ID_DATA],
|
|
65
66
|
lockedDimension: dimension => dimension === DIMENSION_ID_DATA
|
|
66
67
|
});
|
|
67
68
|
});
|
|
@@ -1,47 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
const DynamicDimensionIcon = () => {
|
|
3
3
|
return /*#__PURE__*/React.createElement("svg", {
|
|
4
|
-
width: "16px",
|
|
5
|
-
height: "16px",
|
|
6
|
-
viewBox: "0 0 16 16",
|
|
7
|
-
version: "1.1",
|
|
8
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
9
|
-
}, /*#__PURE__*/React.createElement("g", {
|
|
10
|
-
id: "Exp",
|
|
11
|
-
stroke: "none",
|
|
12
|
-
strokeWidth: "1",
|
|
13
|
-
fill: "none",
|
|
14
|
-
fillRule: "evenodd"
|
|
15
|
-
}, /*#__PURE__*/React.createElement("g", {
|
|
16
|
-
id: "Artboard",
|
|
17
|
-
transform: "translate(-80.000000, -9.000000)"
|
|
18
|
-
}, /*#__PURE__*/React.createElement("g", {
|
|
19
|
-
id: "icon_dimension_new",
|
|
20
|
-
transform: "translate(80.000000, 9.000000)"
|
|
21
|
-
}, /*#__PURE__*/React.createElement("rect", {
|
|
22
|
-
id: "frame",
|
|
23
|
-
x: "0",
|
|
24
|
-
y: "0",
|
|
25
4
|
width: "16",
|
|
26
|
-
height: "16"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
5
|
+
height: "16",
|
|
6
|
+
fill: "none",
|
|
7
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
9
|
+
clipRule: "evenodd",
|
|
10
|
+
d: "m4.832 5.674 2.831-1.11a.913.913 0 0 1 .673 0l2.83 1.11a.548.548 0 0 1 .334.517V9.81a.548.548 0 0 1-.332.517l-2.831 1.11a.92.92 0 0 1-.673 0l-2.83-1.11a.548.548 0 0 1-.334-.517V6.19a.548.548 0 0 1 .332-.517Z",
|
|
11
|
+
stroke: "#212934",
|
|
31
12
|
strokeLinecap: "round",
|
|
32
13
|
strokeLinejoin: "round"
|
|
33
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
34
|
-
d: "M0.33209728,1.1742111 L3.16308174,0.0641666694 C3.37911767,-0.0213888898 3.61963794,-0.0213888898 3.83567387,0.0641666694 L6.66665833,1.1742111 C6.87300668,1.26220739 7.00497003,1.467 6.99984343,1.69127776 L6.99984343,5.30887771 C7.00517859,5.53285411 6.87376309,5.73756106 6.66790272,5.82594437 L3.83691826,6.93629991 C3.62076407,7.02123336 3.38048032,7.02123336 3.16432613,6.93629991 L0.333341668,5.82594437 C0.126993317,5.73794808 -0.00497002591,5.53315547 0.000156574133,5.30887771 L0.000156574133,1.69127776 C-0.00517858533,1.46730136 0.126236906,1.26259441 0.33209728,1.1742111 Z",
|
|
35
|
-
id: "Shape"
|
|
36
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
37
|
-
d: "M3.5,2.72795833 L0.322,1.48195833",
|
|
38
|
-
id: "Shape"
|
|
39
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
40
|
-
d: "M3.5,2.72795833 L6.678,1.48195833",
|
|
41
|
-
id: "Shape"
|
|
42
14
|
}), /*#__PURE__*/React.createElement("path", {
|
|
43
|
-
d: "
|
|
44
|
-
|
|
45
|
-
|
|
15
|
+
d: "M8 7.228 4.822 5.982M8 7.228l3.178-1.246M8 11.281V7.228",
|
|
16
|
+
stroke: "#212934",
|
|
17
|
+
strokeLinecap: "round",
|
|
18
|
+
strokeLinejoin: "round"
|
|
19
|
+
}));
|
|
46
20
|
};
|
|
47
21
|
export default DynamicDimensionIcon;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
1
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
3
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
4
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
4
5
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
5
|
-
import {
|
|
6
|
+
import { CssVariables } from '@dhis2/ui';
|
|
7
|
+
import cx from 'classnames';
|
|
6
8
|
import PropTypes from 'prop-types';
|
|
7
9
|
import React, { Component, createRef } from 'react';
|
|
8
10
|
import DynamicDimensionIcon from '../../../assets/DynamicDimensionIcon.js';
|
|
9
11
|
import { DIMENSION_PROP_NO_ITEMS, getPredefinedDimensionProp } from '../../../modules/predefinedDimensions.js';
|
|
10
12
|
import OptionsButton from './OptionsButton.js';
|
|
11
13
|
import RecommendedIcon from './RecommendedIcon.js';
|
|
12
|
-
import
|
|
14
|
+
import styles from './styles/DimensionItem.style.js';
|
|
13
15
|
class DimensionItem extends Component {
|
|
14
16
|
constructor() {
|
|
15
17
|
super(...arguments);
|
|
@@ -30,23 +32,18 @@ class DimensionItem extends Component {
|
|
|
30
32
|
_defineProperty(this, "getDimensionIcon", () => {
|
|
31
33
|
const Icon = getPredefinedDimensionProp(this.props.id, 'icon');
|
|
32
34
|
return Icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
33
|
-
|
|
35
|
+
className: "fixedDimensionIcon"
|
|
34
36
|
}) : /*#__PURE__*/React.createElement(DynamicDimensionIcon, {
|
|
35
|
-
|
|
37
|
+
className: "dynamic-dimension-icon"
|
|
36
38
|
});
|
|
37
39
|
});
|
|
38
40
|
_defineProperty(this, "getDimensionType", () => {
|
|
39
41
|
const {
|
|
40
42
|
id,
|
|
41
|
-
name
|
|
42
|
-
isDeactivated
|
|
43
|
+
name
|
|
43
44
|
} = this.props;
|
|
44
45
|
return /*#__PURE__*/React.createElement("span", {
|
|
45
|
-
"data-dimensionid": id
|
|
46
|
-
style: {
|
|
47
|
-
...styles.text,
|
|
48
|
-
...(isDeactivated ? styles.textDeactivated : {})
|
|
49
|
-
}
|
|
46
|
+
"data-dimensionid": id
|
|
50
47
|
}, name);
|
|
51
48
|
});
|
|
52
49
|
}
|
|
@@ -60,51 +57,70 @@ class DimensionItem extends Component {
|
|
|
60
57
|
onClick,
|
|
61
58
|
onOptionsClick,
|
|
62
59
|
innerRef,
|
|
63
|
-
style,
|
|
64
60
|
dataTest,
|
|
61
|
+
className,
|
|
65
62
|
...rest
|
|
66
63
|
} = this.props;
|
|
67
64
|
const Icon = this.getDimensionIcon();
|
|
68
65
|
const Label = this.getDimensionType();
|
|
69
|
-
const itemStyle = isSelected && !isDeactivated ? {
|
|
70
|
-
...styles.item,
|
|
71
|
-
...styles.selected
|
|
72
|
-
} : styles.item;
|
|
73
66
|
const optionsRef = /*#__PURE__*/createRef();
|
|
67
|
+
const LockIcon = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
className: `jsx-${styles.__hash}` + " " + "lockWrapper"
|
|
69
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
70
|
+
width: "7",
|
|
71
|
+
height: "9",
|
|
72
|
+
fill: "none",
|
|
73
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
74
|
+
className: `jsx-${styles.__hash}`
|
|
75
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
76
|
+
fillRule: "evenodd",
|
|
77
|
+
clipRule: "evenodd",
|
|
78
|
+
d: "M3.5 1A1.5 1.5 0 0 0 2 2.5V3h3v-.5A1.5 1.5 0 0 0 3.5 1ZM1 2.5V3H0v6h7V3H6v-.5a2.5 2.5 0 0 0-5 0ZM1 8V4h5v4H1Zm3-1V5H3v2h1Z",
|
|
79
|
+
fill: "none",
|
|
80
|
+
className: `jsx-${styles.__hash}`
|
|
81
|
+
}))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
82
|
+
id: styles.__hash
|
|
83
|
+
}, styles));
|
|
74
84
|
const onLabelClick = () => {
|
|
75
85
|
if (!isDeactivated && !getPredefinedDimensionProp(id, DIMENSION_PROP_NO_ITEMS)) {
|
|
76
86
|
onClick(id);
|
|
77
87
|
}
|
|
78
88
|
};
|
|
79
|
-
return /*#__PURE__*/React.createElement(
|
|
89
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CssVariables, {
|
|
90
|
+
colors: true
|
|
91
|
+
}), /*#__PURE__*/React.createElement("li", _extends({
|
|
80
92
|
onMouseOver: this.onMouseOver,
|
|
81
93
|
onMouseLeave: this.onMouseExit,
|
|
82
94
|
ref: innerRef,
|
|
83
|
-
style: Object.assign({}, itemStyle, style, !isDeactivated && styles.clickable),
|
|
84
95
|
"data-test": dataTest,
|
|
85
96
|
onClick: onLabelClick
|
|
86
|
-
}, rest
|
|
87
|
-
className: "
|
|
97
|
+
}, rest, {
|
|
98
|
+
className: `jsx-${styles.__hash}` + " " + (rest && rest.className != null && rest.className || cx('item', {
|
|
99
|
+
deactivated: isDeactivated,
|
|
100
|
+
selected: isSelected && !isDeactivated
|
|
101
|
+
}, className) || "")
|
|
102
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
88
103
|
tabIndex: 0,
|
|
89
|
-
|
|
90
|
-
|
|
104
|
+
"data-test": `${dataTest}-button-${id}`,
|
|
105
|
+
className: `jsx-${styles.__hash}` + " " + "label"
|
|
91
106
|
}, /*#__PURE__*/React.createElement("div", {
|
|
92
|
-
|
|
107
|
+
className: `jsx-${styles.__hash}` + " " + "iconWrapper"
|
|
93
108
|
}, Icon), /*#__PURE__*/React.createElement("div", {
|
|
94
|
-
|
|
95
|
-
},
|
|
109
|
+
className: `jsx-${styles.__hash}` + " " + "labelWrapper"
|
|
110
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
111
|
+
className: `jsx-${styles.__hash}` + " " + "labelText"
|
|
112
|
+
}, Label), /*#__PURE__*/React.createElement(RecommendedIcon, {
|
|
96
113
|
isRecommended: isRecommended,
|
|
97
114
|
dataTest: `${dataTest}-recommended-icon`
|
|
98
|
-
})),
|
|
99
|
-
style: styles.iconWrapper
|
|
100
|
-
}, /*#__PURE__*/React.createElement(IconLock16, null))), onOptionsClick ? /*#__PURE__*/React.createElement("div", {
|
|
101
|
-
style: styles.optionsWrapper,
|
|
115
|
+
}))), onOptionsClick && !isDeactivated && !isLocked ? /*#__PURE__*/React.createElement("div", {
|
|
102
116
|
ref: optionsRef,
|
|
103
|
-
"data-test": `${dataTest}-menu-${id}
|
|
104
|
-
|
|
105
|
-
|
|
117
|
+
"data-test": `${dataTest}-menu-${id}`,
|
|
118
|
+
className: `jsx-${styles.__hash}` + " " + "optionsWrapper"
|
|
119
|
+
}, this.state.mouseOver ? /*#__PURE__*/React.createElement(OptionsButton, {
|
|
106
120
|
onClick: this.onOptionsClick(id, optionsRef)
|
|
107
|
-
}) : null) : null)
|
|
121
|
+
}) : null) : null, isLocked && LockIcon), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
122
|
+
id: styles.__hash
|
|
123
|
+
}, styles));
|
|
108
124
|
}
|
|
109
125
|
}
|
|
110
126
|
DimensionItem.propTypes = {
|
|
@@ -112,12 +128,12 @@ DimensionItem.propTypes = {
|
|
|
112
128
|
isSelected: PropTypes.bool.isRequired,
|
|
113
129
|
// XXX
|
|
114
130
|
name: PropTypes.string.isRequired,
|
|
131
|
+
className: PropTypes.string,
|
|
115
132
|
dataTest: PropTypes.string,
|
|
116
133
|
innerRef: PropTypes.func,
|
|
117
134
|
isDeactivated: PropTypes.bool,
|
|
118
135
|
isLocked: PropTypes.bool,
|
|
119
136
|
isRecommended: PropTypes.bool,
|
|
120
|
-
style: PropTypes.object,
|
|
121
137
|
onClick: PropTypes.func,
|
|
122
138
|
onOptionsClick: PropTypes.func
|
|
123
139
|
};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
1
2
|
import { IconMore16 } from '@dhis2/ui';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import React from 'react';
|
|
4
5
|
const OptionsButton = _ref => {
|
|
5
6
|
let {
|
|
6
|
-
style,
|
|
7
7
|
onClick
|
|
8
8
|
} = _ref;
|
|
9
|
-
return /*#__PURE__*/React.createElement("button", {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}, /*#__PURE__*/React.createElement(IconMore16, null))
|
|
9
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
|
|
10
|
+
onClick: onClick,
|
|
11
|
+
className: "jsx-2728765288"
|
|
12
|
+
}, /*#__PURE__*/React.createElement(IconMore16, null)), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
13
|
+
id: "2728765288"
|
|
14
|
+
}, ["button.jsx-2728765288{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;height:20px;width:20px;padding:0;border:none;background:none;outline:none;cursor:pointer;border-top-right-radius:2px;border-bottom-left-radius:2px;}", "button.jsx-2728765288:hover{background-color:rgba(0,0,0,0.09);}"]));
|
|
13
15
|
};
|
|
14
16
|
OptionsButton.propTypes = {
|
|
15
|
-
style: PropTypes.object,
|
|
16
17
|
onClick: PropTypes.func
|
|
17
18
|
};
|
|
18
19
|
export default OptionsButton;
|
|
@@ -10,8 +10,7 @@ const RecommendedIcon = _ref => {
|
|
|
10
10
|
} = _ref;
|
|
11
11
|
return isRecommended ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
12
12
|
content: i18n.t('Dimension recommended with selected data'),
|
|
13
|
-
placement: "bottom"
|
|
14
|
-
maxWidth: 160
|
|
13
|
+
placement: "bottom"
|
|
15
14
|
}, /*#__PURE__*/React.createElement("div", {
|
|
16
15
|
style: styles.recommendedIcon,
|
|
17
16
|
"data-test": dataTest
|