@dhis2/analytics 26.3.0-dimension-list-alpha.1 → 26.3.0
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 +0 -1
- package/build/cjs/assets/DynamicDimensionIcon.js +38 -12
- package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +29 -37
- package/build/cjs/components/DimensionsPanel/List/OptionsButton.js +6 -7
- package/build/cjs/components/DimensionsPanel/List/RecommendedIcon.js +2 -1
- package/build/cjs/components/DimensionsPanel/List/__tests__/__snapshots__/DimensionItem.spec.js.snap +366 -190
- package/build/cjs/components/DimensionsPanel/List/styles/DimensionItem.style.js +73 -0
- 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/components/Interpretations/common/Message/Message.js +7 -7
- package/build/cjs/components/Interpretations/common/RichTextEditor/styles/RichTextEditor.style.js +2 -2
- package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +3 -1
- package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuDropdown.spec.js +8 -0
- package/build/cjs/locales/lo/translations.json +8 -3
- package/build/cjs/locales/sv/translations.json +8 -2
- package/build/es/__demo__/DimensionsPanel.stories.js +0 -1
- package/build/es/assets/DynamicDimensionIcon.js +38 -12
- package/build/es/components/DimensionsPanel/List/DimensionItem.js +30 -38
- package/build/es/components/DimensionsPanel/List/OptionsButton.js +6 -7
- package/build/es/components/DimensionsPanel/List/RecommendedIcon.js +2 -1
- package/build/es/components/DimensionsPanel/List/__tests__/__snapshots__/DimensionItem.spec.js.snap +366 -190
- package/build/es/components/DimensionsPanel/List/styles/DimensionItem.style.js +66 -0
- 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/components/Interpretations/common/Message/Message.js +7 -7
- package/build/es/components/Interpretations/common/RichTextEditor/styles/RichTextEditor.style.js +2 -2
- package/build/es/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +3 -1
- package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuDropdown.spec.js +8 -0
- package/build/es/locales/lo/translations.json +8 -3
- package/build/es/locales/sv/translations.json +8 -2
- package/package.json +1 -1
- package/build/cjs/components/DimensionsPanel/List/styles/DimensionItem.module.css +0 -83
- package/build/es/components/DimensionsPanel/List/styles/DimensionItem.module.css +0 -83
|
@@ -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.secondary300,
|
|
11
|
+
height: '8px',
|
|
12
|
+
width: '8px',
|
|
13
13
|
borderRadius: '4px',
|
|
14
|
-
marginLeft: '
|
|
14
|
+
marginLeft: '5px',
|
|
15
15
|
display: 'inline-block',
|
|
16
16
|
cursor: 'pointer'
|
|
17
17
|
}
|
|
@@ -23,23 +23,23 @@ const Message = _ref => {
|
|
|
23
23
|
fromServerDate
|
|
24
24
|
} = (0, _appRuntime.useTimeZoneConversion)();
|
|
25
25
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
26
|
-
className: _style.default.dynamic([["
|
|
26
|
+
className: _style.default.dynamic([["4031345705", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "container"
|
|
27
27
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
28
|
-
className: _style.default.dynamic([["
|
|
28
|
+
className: _style.default.dynamic([["4031345705", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "header"
|
|
29
29
|
}, /*#__PURE__*/_react.default.createElement(_ui.UserAvatar, {
|
|
30
30
|
name: username,
|
|
31
31
|
extrasmall: true
|
|
32
32
|
}), username, /*#__PURE__*/_react.default.createElement("time", {
|
|
33
33
|
dateTime: created,
|
|
34
|
-
className: _style.default.dynamic([["
|
|
34
|
+
className: _style.default.dynamic([["4031345705", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]])
|
|
35
35
|
}, (0, _moment.default)(fromServerDate(created)).format('lll'))), /*#__PURE__*/_react.default.createElement("div", {
|
|
36
|
-
className: _style.default.dynamic([["
|
|
36
|
+
className: _style.default.dynamic([["4031345705", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "content"
|
|
37
37
|
}, /*#__PURE__*/_react.default.createElement(_d2UiRichText.Parser, null, text)), /*#__PURE__*/_react.default.createElement("div", {
|
|
38
|
-
className: _style.default.dynamic([["
|
|
38
|
+
className: _style.default.dynamic([["4031345705", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "footer"
|
|
39
39
|
}, children), /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
40
|
-
id: "
|
|
40
|
+
id: "4031345705",
|
|
41
41
|
dynamic: [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]
|
|
42
|
-
}, [`.container.__jsx-style-dynamic-selector{padding:${_ui.spacers.dp8};background-color:${_ui.colors.grey100};border-radius:5px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:${_ui.spacers.dp8};}`, `.header.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:6px;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:13px;line-height:16px;color:${_ui.colors.grey900};}`, `.header.__jsx-style-dynamic-selector time.__jsx-style-dynamic-selector{font-size:12px;color:${_ui.colors.grey600};}`, `.content.__jsx-style-dynamic-selector{font-size:14px;line-height:19px;color:${_ui.colors.grey900};word-break:break-word;}`, ".content.__jsx-style-dynamic-selector p:first-child{margin:0;}", `.footer.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;gap:${_ui.spacers.dp8};}`]));
|
|
42
|
+
}, [`.container.__jsx-style-dynamic-selector{padding:${_ui.spacers.dp8};background-color:${_ui.colors.grey100};border-radius:5px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:${_ui.spacers.dp8};}`, `.header.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:6px;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;font-size:13px;line-height:16px;color:${_ui.colors.grey900};}`, `.header.__jsx-style-dynamic-selector time.__jsx-style-dynamic-selector{font-size:12px;color:${_ui.colors.grey600};}`, `.content.__jsx-style-dynamic-selector{font-size:14px;line-height:19px;color:${_ui.colors.grey900};word-break:break-word;white-space:pre-line;}`, ".content.__jsx-style-dynamic-selector p:first-child{margin:0;}", `.footer.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;gap:${_ui.spacers.dp8};}`]));
|
|
43
43
|
};
|
|
44
44
|
exports.Message = Message;
|
|
45
45
|
Message.propTypes = {
|
package/build/cjs/components/Interpretations/common/RichTextEditor/styles/RichTextEditor.style.js
CHANGED
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.tooltipAnchorClasses = exports.toolbarClasses = exports.mainClasses = exports.emojisPopoverClasses = void 0;
|
|
7
7
|
var _ui = require("@dhis2/ui");
|
|
8
|
-
const mainClasses = [".container.jsx-
|
|
8
|
+
const mainClasses = [".container.jsx-1273817287{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;width:100%;}", `.preview.jsx-1273817287{font-size:14px;line-height:19px;color:${_ui.colors.grey900};}`, `.textarea.jsx-1273817287{width:100%;box-sizing:border-box;padding:${_ui.spacers.dp8} ${_ui.spacers.dp12};color:${_ui.colors.grey900};background-color:${_ui.colors.white};border:1px solid ${_ui.colors.grey500};border-radius:3px;box-shadow:inset 0 0 0 1px rgba(102,113,123,0.15), inset 0 1px 2px 0 rgba(102,113,123,0.1);outline:0;font-size:14px;line-height:${_ui.spacers.dp16};-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;}`, `.textarea.jsx-1273817287:focus{outline:none;box-shadow:0 0 0 3px ${_ui.theme.focus};width:calc(100% - 3px);}`, `.textarea.jsx-1273817287:disabled{background-color:${_ui.colors.grey100};border-color:${_ui.colors.grey500};color:${_ui.theme.disabled};cursor:not-allowed;}`];
|
|
9
9
|
exports.mainClasses = mainClasses;
|
|
10
|
-
mainClasses.__hash = "
|
|
10
|
+
mainClasses.__hash = "1273817287";
|
|
11
11
|
const toolbarClasses = [`.toolbar.jsx-2267496677{background:${_ui.colors.grey050};border-radius:3px;border:1px solid ${_ui.colors.grey300};margin-bottom:${_ui.spacers.dp4};}`, `.actionsWrapper.jsx-2267496677{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:${_ui.spacers.dp4};-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;padding:${_ui.spacers.dp4};}`, `.mainActions.jsx-2267496677{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:${_ui.spacers.dp4};margin-top:${_ui.spacers.dp2};}`, ".sideActions.jsx-2267496677{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}", `.previewWrapper.jsx-2267496677{margin:${_ui.spacers.dp4};text-align:right;}`];
|
|
12
12
|
exports.toolbarClasses = toolbarClasses;
|
|
13
13
|
toolbarClasses.__hash = "2267496677";
|
|
@@ -18,6 +18,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
18
18
|
const HoverMenuDropdown = _ref => {
|
|
19
19
|
let {
|
|
20
20
|
children,
|
|
21
|
+
className,
|
|
21
22
|
label,
|
|
22
23
|
dataTest,
|
|
23
24
|
disabled
|
|
@@ -35,7 +36,7 @@ const HoverMenuDropdown = _ref => {
|
|
|
35
36
|
disabled: disabled,
|
|
36
37
|
onMouseOver: disabled ? undefined : onDropDownButtonMouseOver,
|
|
37
38
|
"data-test": dataTest,
|
|
38
|
-
className: `jsx-${_MenuButtonStyles.default.__hash}` + " " + ((0, _classnames.default)({
|
|
39
|
+
className: `jsx-${_MenuButtonStyles.default.__hash}` + " " + ((0, _classnames.default)(className, {
|
|
39
40
|
isOpen
|
|
40
41
|
}) || "")
|
|
41
42
|
}, label, /*#__PURE__*/_react.default.createElement(_style.default, {
|
|
@@ -52,6 +53,7 @@ HoverMenuDropdown.defaultProps = {
|
|
|
52
53
|
HoverMenuDropdown.propTypes = {
|
|
53
54
|
children: _propTypes.default.node.isRequired,
|
|
54
55
|
label: _propTypes.default.node.isRequired,
|
|
56
|
+
className: _propTypes.default.string,
|
|
55
57
|
dataTest: _propTypes.default.string,
|
|
56
58
|
disabled: _propTypes.default.bool
|
|
57
59
|
};
|
|
@@ -17,4 +17,12 @@ describe('<HoverMenuDropdown/>', () => {
|
|
|
17
17
|
}, "children"));
|
|
18
18
|
expect(wrapper.find('button').prop('data-test')).toBe(dataTest);
|
|
19
19
|
});
|
|
20
|
+
it('accepts a `className` prop', () => {
|
|
21
|
+
const className = 'test';
|
|
22
|
+
const wrapper = (0, _enzyme.shallow)( /*#__PURE__*/_react.default.createElement(_index.HoverMenuDropdown, {
|
|
23
|
+
label: "test dropdown",
|
|
24
|
+
className: className
|
|
25
|
+
}, "children"));
|
|
26
|
+
expect(wrapper.find('button')).toHaveClassName(className);
|
|
27
|
+
});
|
|
20
28
|
});
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"About this line list": "",
|
|
20
20
|
"About this visualization": "",
|
|
21
21
|
"This app could not retrieve required data.": "",
|
|
22
|
-
"Network error": "",
|
|
22
|
+
"Network error": "ຂໍ້ຜິດພາດທາງເຄື່ອຂ່າຍ",
|
|
23
23
|
"Data / Edit calculation": "",
|
|
24
24
|
"Data / New calculation": "",
|
|
25
|
-
"Remove item": "",
|
|
25
|
+
"Remove item": "ລົບລາຍການ",
|
|
26
26
|
"Check formula": "",
|
|
27
27
|
"Calculation name": "",
|
|
28
28
|
"Shown in table headers and chart axes/legends": "",
|
|
@@ -106,6 +106,7 @@
|
|
|
106
106
|
"Edit": "ແກ້ໄຂ",
|
|
107
107
|
"Write a reply": "",
|
|
108
108
|
"Post reply": "",
|
|
109
|
+
"Delete failed": "",
|
|
109
110
|
"Could not update comment": "",
|
|
110
111
|
"Enter comment text": "",
|
|
111
112
|
"Update": "ປັບປຸງ",
|
|
@@ -114,11 +115,14 @@
|
|
|
114
115
|
"The interpretation couldn’t be displayed. Try again or contact your system administrator.": "",
|
|
115
116
|
"Hide interpretation": "",
|
|
116
117
|
"Write an interpretation": "",
|
|
118
|
+
"Other people viewing this interpretation in the future may see more data.": "",
|
|
117
119
|
"Post interpretation": "",
|
|
118
120
|
"Interpretations": "ການແປຂໍ້ມູນ",
|
|
121
|
+
"Reply": "ຕອບກັບ",
|
|
122
|
+
"{{count}} replies": "",
|
|
123
|
+
"View replies": "",
|
|
119
124
|
"Unlike": "ບໍ່ມັກ",
|
|
120
125
|
"Like": "ມັກ",
|
|
121
|
-
"Reply": "ຕອບກັບ",
|
|
122
126
|
"Share": "ເຜີຍແຜ່",
|
|
123
127
|
"See interpretation": "",
|
|
124
128
|
"Manage sharing": "",
|
|
@@ -263,6 +267,7 @@
|
|
|
263
267
|
"Six-months": "6 ເດືອນ",
|
|
264
268
|
"Financial Years": "",
|
|
265
269
|
"Years": "ປີ",
|
|
270
|
+
"Interpretations and details": "",
|
|
266
271
|
"Translating to": "",
|
|
267
272
|
"Choose a locale": "",
|
|
268
273
|
"Base locale reference": "",
|
|
@@ -107,6 +107,7 @@
|
|
|
107
107
|
"Edit": "Redigera",
|
|
108
108
|
"Write a reply": "",
|
|
109
109
|
"Post reply": "",
|
|
110
|
+
"Delete failed": "",
|
|
110
111
|
"Could not update comment": "",
|
|
111
112
|
"Enter comment text": "",
|
|
112
113
|
"Update": "Uppdatera",
|
|
@@ -115,11 +116,15 @@
|
|
|
115
116
|
"The interpretation couldn’t be displayed. Try again or contact your system administrator.": "",
|
|
116
117
|
"Hide interpretation": "",
|
|
117
118
|
"Write an interpretation": "",
|
|
119
|
+
"Other people viewing this interpretation in the future may see more data.": "",
|
|
118
120
|
"Post interpretation": "",
|
|
119
121
|
"Interpretations": "tolkningar",
|
|
122
|
+
"Reply": "Svar",
|
|
123
|
+
"{{count}} replies": "",
|
|
124
|
+
"{{count}} replies_plural": "",
|
|
125
|
+
"View replies": "",
|
|
120
126
|
"Unlike": "",
|
|
121
127
|
"Like": "",
|
|
122
|
-
"Reply": "Svar",
|
|
123
128
|
"Share": "Dela med sig",
|
|
124
129
|
"See interpretation": "",
|
|
125
130
|
"Manage sharing": "",
|
|
@@ -190,7 +195,7 @@
|
|
|
190
195
|
"User sub-x2-units": "Användarunder x2-enheter",
|
|
191
196
|
"Select a level": "",
|
|
192
197
|
"Select a group": "",
|
|
193
|
-
"Deselect all": "",
|
|
198
|
+
"Deselect all": "Avmarkera alla",
|
|
194
199
|
"Period type": "Periodtyp",
|
|
195
200
|
"Year": "År",
|
|
196
201
|
"Select year": "Välj år",
|
|
@@ -267,6 +272,7 @@
|
|
|
267
272
|
"Six-months": "",
|
|
268
273
|
"Financial Years": "",
|
|
269
274
|
"Years": "År",
|
|
275
|
+
"Interpretations and details": "",
|
|
270
276
|
"Translating to": "",
|
|
271
277
|
"Choose a locale": "",
|
|
272
278
|
"Base locale reference": "",
|
|
@@ -62,7 +62,6 @@ 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],
|
|
66
65
|
lockedDimension: dimension => dimension === DIMENSION_ID_DATA
|
|
67
66
|
});
|
|
68
67
|
});
|
|
@@ -1,21 +1,47 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
const DynamicDimensionIcon = () => {
|
|
3
3
|
return /*#__PURE__*/React.createElement("svg", {
|
|
4
|
-
width: "
|
|
5
|
-
height: "
|
|
6
|
-
|
|
4
|
+
width: "16px",
|
|
5
|
+
height: "16px",
|
|
6
|
+
viewBox: "0 0 16 16",
|
|
7
|
+
version: "1.1",
|
|
7
8
|
xmlns: "http://www.w3.org/2000/svg"
|
|
8
|
-
}, /*#__PURE__*/React.createElement("
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
+
width: "16",
|
|
26
|
+
height: "16"
|
|
27
|
+
}), /*#__PURE__*/React.createElement("g", {
|
|
28
|
+
id: "module",
|
|
29
|
+
transform: "translate(4.000000, 4.000000)",
|
|
30
|
+
stroke: "#000000",
|
|
12
31
|
strokeLinecap: "round",
|
|
13
32
|
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"
|
|
14
36
|
}), /*#__PURE__*/React.createElement("path", {
|
|
15
|
-
d: "
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
43
|
+
d: "M3.5,6.78125 L3.5,2.72795833",
|
|
44
|
+
id: "Shape"
|
|
45
|
+
}))))));
|
|
20
46
|
};
|
|
21
47
|
export default DynamicDimensionIcon;
|
|
@@ -2,15 +2,14 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
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
3
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
4
4
|
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 cx from 'classnames';
|
|
5
|
+
import { IconLock16 } from '@dhis2/ui';
|
|
7
6
|
import PropTypes from 'prop-types';
|
|
8
7
|
import React, { Component, createRef } from 'react';
|
|
9
8
|
import DynamicDimensionIcon from '../../../assets/DynamicDimensionIcon.js';
|
|
10
9
|
import { DIMENSION_PROP_NO_ITEMS, getPredefinedDimensionProp } from '../../../modules/predefinedDimensions.js';
|
|
11
10
|
import OptionsButton from './OptionsButton.js';
|
|
12
11
|
import RecommendedIcon from './RecommendedIcon.js';
|
|
13
|
-
import
|
|
12
|
+
import { styles } from './styles/DimensionItem.style.js';
|
|
14
13
|
class DimensionItem extends Component {
|
|
15
14
|
constructor() {
|
|
16
15
|
super(...arguments);
|
|
@@ -31,18 +30,23 @@ class DimensionItem extends Component {
|
|
|
31
30
|
_defineProperty(this, "getDimensionIcon", () => {
|
|
32
31
|
const Icon = getPredefinedDimensionProp(this.props.id, 'icon');
|
|
33
32
|
return Icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
34
|
-
|
|
33
|
+
style: styles.fixedDimensionIcon
|
|
35
34
|
}) : /*#__PURE__*/React.createElement(DynamicDimensionIcon, {
|
|
36
|
-
|
|
35
|
+
style: styles.dynamicDimensionIcon
|
|
37
36
|
});
|
|
38
37
|
});
|
|
39
38
|
_defineProperty(this, "getDimensionType", () => {
|
|
40
39
|
const {
|
|
41
40
|
id,
|
|
42
|
-
name
|
|
41
|
+
name,
|
|
42
|
+
isDeactivated
|
|
43
43
|
} = this.props;
|
|
44
44
|
return /*#__PURE__*/React.createElement("span", {
|
|
45
|
-
"data-dimensionid": id
|
|
45
|
+
"data-dimensionid": id,
|
|
46
|
+
style: {
|
|
47
|
+
...styles.text,
|
|
48
|
+
...(isDeactivated ? styles.textDeactivated : {})
|
|
49
|
+
}
|
|
46
50
|
}, name);
|
|
47
51
|
});
|
|
48
52
|
}
|
|
@@ -56,63 +60,51 @@ class DimensionItem extends Component {
|
|
|
56
60
|
onClick,
|
|
57
61
|
onOptionsClick,
|
|
58
62
|
innerRef,
|
|
63
|
+
style,
|
|
59
64
|
dataTest,
|
|
60
|
-
className,
|
|
61
65
|
...rest
|
|
62
66
|
} = this.props;
|
|
63
67
|
const Icon = this.getDimensionIcon();
|
|
64
68
|
const Label = this.getDimensionType();
|
|
69
|
+
const itemStyle = isSelected && !isDeactivated ? {
|
|
70
|
+
...styles.item,
|
|
71
|
+
...styles.selected
|
|
72
|
+
} : styles.item;
|
|
65
73
|
const optionsRef = /*#__PURE__*/createRef();
|
|
66
|
-
const LockIcon = /*#__PURE__*/React.createElement("svg", {
|
|
67
|
-
width: "7",
|
|
68
|
-
height: "9",
|
|
69
|
-
fill: "none",
|
|
70
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
71
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
72
|
-
fillRule: "evenodd",
|
|
73
|
-
clipRule: "evenodd",
|
|
74
|
-
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",
|
|
75
|
-
fill: "none"
|
|
76
|
-
}));
|
|
77
74
|
const onLabelClick = () => {
|
|
78
75
|
if (!isDeactivated && !getPredefinedDimensionProp(id, DIMENSION_PROP_NO_ITEMS)) {
|
|
79
76
|
onClick(id);
|
|
80
77
|
}
|
|
81
78
|
};
|
|
82
|
-
return /*#__PURE__*/React.createElement(
|
|
83
|
-
colors: true
|
|
84
|
-
}), /*#__PURE__*/React.createElement("li", _extends({
|
|
79
|
+
return /*#__PURE__*/React.createElement("li", _extends({
|
|
85
80
|
onMouseOver: this.onMouseOver,
|
|
86
81
|
onMouseLeave: this.onMouseExit,
|
|
87
82
|
ref: innerRef,
|
|
88
|
-
|
|
89
|
-
[style.deactivated]: isDeactivated,
|
|
90
|
-
[style.selected]: isSelected && !isDeactivated
|
|
91
|
-
}, className),
|
|
83
|
+
style: Object.assign({}, itemStyle, style, !isDeactivated && styles.clickable),
|
|
92
84
|
"data-test": dataTest,
|
|
93
85
|
onClick: onLabelClick
|
|
94
86
|
}, rest), /*#__PURE__*/React.createElement("div", {
|
|
95
|
-
className:
|
|
87
|
+
className: "label",
|
|
96
88
|
tabIndex: 0,
|
|
89
|
+
style: styles.label,
|
|
97
90
|
"data-test": `${dataTest}-button-${id}`
|
|
98
91
|
}, /*#__PURE__*/React.createElement("div", {
|
|
99
|
-
|
|
92
|
+
style: styles.iconWrapper
|
|
100
93
|
}, Icon), /*#__PURE__*/React.createElement("div", {
|
|
101
|
-
|
|
102
|
-
}, /*#__PURE__*/React.createElement(
|
|
103
|
-
className: style.labelText
|
|
104
|
-
}, Label), /*#__PURE__*/React.createElement(RecommendedIcon, {
|
|
94
|
+
style: styles.labelWrapper
|
|
95
|
+
}, Label, /*#__PURE__*/React.createElement(RecommendedIcon, {
|
|
105
96
|
isRecommended: isRecommended,
|
|
106
97
|
dataTest: `${dataTest}-recommended-icon`
|
|
107
|
-
}))
|
|
108
|
-
|
|
98
|
+
})), isLocked && /*#__PURE__*/React.createElement("div", {
|
|
99
|
+
style: styles.iconWrapper
|
|
100
|
+
}, /*#__PURE__*/React.createElement(IconLock16, null))), onOptionsClick ? /*#__PURE__*/React.createElement("div", {
|
|
101
|
+
style: styles.optionsWrapper,
|
|
109
102
|
ref: optionsRef,
|
|
110
103
|
"data-test": `${dataTest}-menu-${id}`
|
|
111
104
|
}, this.state.mouseOver && !isDeactivated && !isLocked ? /*#__PURE__*/React.createElement(OptionsButton, {
|
|
105
|
+
style: styles.optionsButton,
|
|
112
106
|
onClick: this.onOptionsClick(id, optionsRef)
|
|
113
|
-
}) : null) : null
|
|
114
|
-
className: style.lockWrapper
|
|
115
|
-
}, LockIcon)));
|
|
107
|
+
}) : null) : null);
|
|
116
108
|
}
|
|
117
109
|
}
|
|
118
110
|
DimensionItem.propTypes = {
|
|
@@ -120,12 +112,12 @@ DimensionItem.propTypes = {
|
|
|
120
112
|
isSelected: PropTypes.bool.isRequired,
|
|
121
113
|
// XXX
|
|
122
114
|
name: PropTypes.string.isRequired,
|
|
123
|
-
className: PropTypes.string,
|
|
124
115
|
dataTest: PropTypes.string,
|
|
125
116
|
innerRef: PropTypes.func,
|
|
126
117
|
isDeactivated: PropTypes.bool,
|
|
127
118
|
isLocked: PropTypes.bool,
|
|
128
119
|
isRecommended: PropTypes.bool,
|
|
120
|
+
style: PropTypes.object,
|
|
129
121
|
onClick: PropTypes.func,
|
|
130
122
|
onOptionsClick: PropTypes.func
|
|
131
123
|
};
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import _JSXStyle from "styled-jsx/style";
|
|
2
1
|
import { IconMore16 } from '@dhis2/ui';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
const OptionsButton = _ref => {
|
|
6
5
|
let {
|
|
6
|
+
style,
|
|
7
7
|
onClick
|
|
8
8
|
} = _ref;
|
|
9
|
-
return /*#__PURE__*/React.createElement(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}, /*#__PURE__*/React.createElement(IconMore16, null))
|
|
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);}"]));
|
|
9
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
10
|
+
style: style,
|
|
11
|
+
onClick: onClick
|
|
12
|
+
}, /*#__PURE__*/React.createElement(IconMore16, null));
|
|
15
13
|
};
|
|
16
14
|
OptionsButton.propTypes = {
|
|
15
|
+
style: PropTypes.object,
|
|
17
16
|
onClick: PropTypes.func
|
|
18
17
|
};
|
|
19
18
|
export default OptionsButton;
|
|
@@ -10,7 +10,8 @@ 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"
|
|
13
|
+
placement: "bottom",
|
|
14
|
+
maxWidth: 160
|
|
14
15
|
}, /*#__PURE__*/React.createElement("div", {
|
|
15
16
|
style: styles.recommendedIcon,
|
|
16
17
|
"data-test": dataTest
|