@dhis2/analytics 26.3.0-alpha.3 → 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.
Files changed (33) hide show
  1. package/build/cjs/__demo__/DimensionsPanel.stories.js +0 -1
  2. package/build/cjs/assets/DynamicDimensionIcon.js +38 -12
  3. package/build/cjs/components/DimensionsPanel/List/DimensionItem.js +32 -44
  4. package/build/cjs/components/DimensionsPanel/List/OptionsButton.js +6 -7
  5. package/build/cjs/components/DimensionsPanel/List/RecommendedIcon.js +2 -1
  6. package/build/cjs/components/DimensionsPanel/List/__tests__/__snapshots__/DimensionItem.spec.js.snap +361 -238
  7. package/build/cjs/components/DimensionsPanel/List/styles/DimensionItem.style.js +67 -5
  8. package/build/cjs/components/DimensionsPanel/List/styles/DimensionList.style.js +2 -2
  9. package/build/cjs/components/DimensionsPanel/List/styles/RecommendedIcon.style.js +4 -4
  10. package/build/cjs/components/DimensionsPanel/styles/DimensionsPanel.style.js +1 -1
  11. package/build/cjs/components/Interpretations/common/Message/Message.js +7 -7
  12. package/build/cjs/components/Interpretations/common/RichTextEditor/styles/RichTextEditor.style.js +2 -2
  13. package/build/cjs/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +3 -1
  14. package/build/cjs/components/Toolbar/HoverMenuBar/__tests__/HoverMenuDropdown.spec.js +8 -0
  15. package/build/cjs/locales/lo/translations.json +8 -3
  16. package/build/cjs/locales/sv/translations.json +8 -2
  17. package/build/es/__demo__/DimensionsPanel.stories.js +0 -1
  18. package/build/es/assets/DynamicDimensionIcon.js +38 -12
  19. package/build/es/components/DimensionsPanel/List/DimensionItem.js +33 -45
  20. package/build/es/components/DimensionsPanel/List/OptionsButton.js +6 -7
  21. package/build/es/components/DimensionsPanel/List/RecommendedIcon.js +2 -1
  22. package/build/es/components/DimensionsPanel/List/__tests__/__snapshots__/DimensionItem.spec.js.snap +361 -238
  23. package/build/es/components/DimensionsPanel/List/styles/DimensionItem.style.js +66 -4
  24. package/build/es/components/DimensionsPanel/List/styles/DimensionList.style.js +2 -2
  25. package/build/es/components/DimensionsPanel/List/styles/RecommendedIcon.style.js +4 -4
  26. package/build/es/components/DimensionsPanel/styles/DimensionsPanel.style.js +1 -1
  27. package/build/es/components/Interpretations/common/Message/Message.js +7 -7
  28. package/build/es/components/Interpretations/common/RichTextEditor/styles/RichTextEditor.style.js +2 -2
  29. package/build/es/components/Toolbar/HoverMenuBar/HoverMenuDropdown.js +3 -1
  30. package/build/es/components/Toolbar/HoverMenuBar/__tests__/HoverMenuDropdown.spec.js +8 -0
  31. package/build/es/locales/lo/translations.json +8 -3
  32. package/build/es/locales/sv/translations.json +8 -2
  33. package/package.json +1 -1
@@ -3,9 +3,71 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.styles = void 0;
7
7
  var _ui = require("@dhis2/ui");
8
- const _defaultExport = [`.item.jsx-3528757313{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-3528757313:not(.deactivated):not(.dragging):hover{background-color:${_ui.colors.grey100};border-color:${_ui.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:${_ui.colors.teal100};border:1px solid ${_ui.colors.teal200};color:${_ui.colors.teal900};fill:${_ui.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:${_ui.colors.grey800};}`, `.lockWrapper.jsx-3528757313{background:${_ui.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:${_ui.colors.teal900};}`];
9
- _defaultExport.__hash = "3528757313";
10
- var _default = _defaultExport;
11
- exports.default = _default;
8
+ const styles = {
9
+ labelWrapper: {
10
+ padding: '2px 5px 2px 0'
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,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-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:${_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-2040313368:not(:last-child){margin-bottom:${_ui.spacers.dp24};}`];
12
- _defaultExport.__hash = "2040313368";
11
+ const _defaultExport = [".container.jsx-2067921157{position:relative;-webkit-flex:1 1 0%;-ms-flex:1 1 0%;flex:1 1 0%;min-height:30vh;}", ".wrapper.jsx-2067921157{position:absolute;width:100%;height:100%;overflow:auto;margin-top:0;padding:0;}", ".list.jsx-2067921157{margin:0;padding:0;}", `.header.jsx-2067921157{text-transform:uppercase;font-size:11px;color:${_ui.colors.grey700};margin:5px 0;-webkit-letter-spacing:0.3px;-moz-letter-spacing:0.3px;-ms-letter-spacing:0.3px;letter-spacing:0.3px;}`, `.section.jsx-2067921157:not(:last-child){margin-bottom:${_ui.spacers.dp24};}`];
12
+ _defaultExport.__hash = "2067921157";
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.secondary400,
11
- height: '6px',
12
- width: '6px',
10
+ backgroundColor: _ui.theme.secondary300,
11
+ height: '8px',
12
+ width: '8px',
13
13
  borderRadius: '4px',
14
- marginLeft: '6px',
14
+ marginLeft: '5px',
15
15
  display: 'inline-block',
16
16
  cursor: 'pointer'
17
17
  }
@@ -10,7 +10,7 @@ const styles = {
10
10
  height: '100%',
11
11
  display: 'flex',
12
12
  flexDirection: 'column',
13
- backgroundColor: _ui.colors.white,
13
+ backgroundColor: _ui.colors.grey050,
14
14
  padding: '8px',
15
15
  overflow: 'hidden'
16
16
  },
@@ -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([["3500389795", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "container"
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([["3500389795", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "header"
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([["3500389795", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]])
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([["3500389795", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "content"
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([["3500389795", [_ui.spacers.dp8, _ui.colors.grey100, _ui.spacers.dp8, _ui.colors.grey900, _ui.colors.grey600, _ui.colors.grey900, _ui.spacers.dp8]]]) + " " + "footer"
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: "3500389795",
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 = {
@@ -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-2278350860{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-2278350860{font-size:14px;line-height:19px;color:${_ui.colors.grey900};}`, `.textarea.jsx-2278350860{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-2278350860:focus{outline:none;box-shadow:0 0 0 3px ${_ui.theme.focus};}`, `.textarea.jsx-2278350860:disabled{background-color:${_ui.colors.grey100};border-color:${_ui.colors.grey500};color:${_ui.theme.disabled};cursor:not-allowed;}`];
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 = "2278350860";
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: "16",
5
- height: "16",
6
- fill: "none",
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("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",
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: "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
- }));
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;
@@ -1,17 +1,15 @@
1
- import _JSXStyle from "styled-jsx/style";
2
1
  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); }
3
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; }
4
3
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
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); }
6
- import { CssVariables } from '@dhis2/ui';
7
- import cx from 'classnames';
5
+ import { IconLock16 } from '@dhis2/ui';
8
6
  import PropTypes from 'prop-types';
9
7
  import React, { Component, createRef } from 'react';
10
8
  import DynamicDimensionIcon from '../../../assets/DynamicDimensionIcon.js';
11
9
  import { DIMENSION_PROP_NO_ITEMS, getPredefinedDimensionProp } from '../../../modules/predefinedDimensions.js';
12
10
  import OptionsButton from './OptionsButton.js';
13
11
  import RecommendedIcon from './RecommendedIcon.js';
14
- import styles from './styles/DimensionItem.style.js';
12
+ import { styles } from './styles/DimensionItem.style.js';
15
13
  class DimensionItem extends Component {
16
14
  constructor() {
17
15
  super(...arguments);
@@ -32,18 +30,23 @@ class DimensionItem extends Component {
32
30
  _defineProperty(this, "getDimensionIcon", () => {
33
31
  const Icon = getPredefinedDimensionProp(this.props.id, 'icon');
34
32
  return Icon ? /*#__PURE__*/React.createElement(Icon, {
35
- className: "fixedDimensionIcon"
33
+ style: styles.fixedDimensionIcon
36
34
  }) : /*#__PURE__*/React.createElement(DynamicDimensionIcon, {
37
- className: "dynamic-dimension-icon"
35
+ style: styles.dynamicDimensionIcon
38
36
  });
39
37
  });
40
38
  _defineProperty(this, "getDimensionType", () => {
41
39
  const {
42
40
  id,
43
- name
41
+ name,
42
+ isDeactivated
44
43
  } = this.props;
45
44
  return /*#__PURE__*/React.createElement("span", {
46
- "data-dimensionid": id
45
+ "data-dimensionid": id,
46
+ style: {
47
+ ...styles.text,
48
+ ...(isDeactivated ? styles.textDeactivated : {})
49
+ }
47
50
  }, name);
48
51
  });
49
52
  }
@@ -57,66 +60,51 @@ class DimensionItem extends Component {
57
60
  onClick,
58
61
  onOptionsClick,
59
62
  innerRef,
63
+ style,
60
64
  dataTest,
61
- className,
62
65
  ...rest
63
66
  } = this.props;
64
67
  const Icon = this.getDimensionIcon();
65
68
  const Label = this.getDimensionType();
69
+ const itemStyle = isSelected && !isDeactivated ? {
70
+ ...styles.item,
71
+ ...styles.selected
72
+ } : styles.item;
66
73
  const optionsRef = /*#__PURE__*/createRef();
67
- const LockIcon = /*#__PURE__*/React.createElement("svg", {
68
- width: "7",
69
- height: "9",
70
- fill: "none",
71
- xmlns: "http://www.w3.org/2000/svg"
72
- }, /*#__PURE__*/React.createElement("path", {
73
- fillRule: "evenodd",
74
- clipRule: "evenodd",
75
- 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",
76
- fill: "none"
77
- }));
78
74
  const onLabelClick = () => {
79
75
  if (!isDeactivated && !getPredefinedDimensionProp(id, DIMENSION_PROP_NO_ITEMS)) {
80
76
  onClick(id);
81
77
  }
82
78
  };
83
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CssVariables, {
84
- colors: true
85
- }), /*#__PURE__*/React.createElement("li", _extends({
79
+ return /*#__PURE__*/React.createElement("li", _extends({
86
80
  onMouseOver: this.onMouseOver,
87
81
  onMouseLeave: this.onMouseExit,
88
82
  ref: innerRef,
83
+ style: Object.assign({}, itemStyle, style, !isDeactivated && styles.clickable),
89
84
  "data-test": dataTest,
90
85
  onClick: onLabelClick
91
- }, rest, {
92
- className: `jsx-${styles.__hash}` + " " + (rest && rest.className != null && rest.className || cx('item', {
93
- deactivated: isDeactivated,
94
- selected: isSelected && !isDeactivated
95
- }, className) || "")
96
- }), /*#__PURE__*/React.createElement("div", {
86
+ }, rest), /*#__PURE__*/React.createElement("div", {
87
+ className: "label",
97
88
  tabIndex: 0,
98
- "data-test": `${dataTest}-button-${id}`,
99
- className: `jsx-${styles.__hash}` + " " + "label"
89
+ style: styles.label,
90
+ "data-test": `${dataTest}-button-${id}`
100
91
  }, /*#__PURE__*/React.createElement("div", {
101
- className: `jsx-${styles.__hash}` + " " + "iconWrapper"
92
+ style: styles.iconWrapper
102
93
  }, Icon), /*#__PURE__*/React.createElement("div", {
103
- className: `jsx-${styles.__hash}` + " " + "labelWrapper"
104
- }, /*#__PURE__*/React.createElement("span", {
105
- className: `jsx-${styles.__hash}` + " " + "labelText"
106
- }, Label), /*#__PURE__*/React.createElement(RecommendedIcon, {
94
+ style: styles.labelWrapper
95
+ }, Label, /*#__PURE__*/React.createElement(RecommendedIcon, {
107
96
  isRecommended: isRecommended,
108
97
  dataTest: `${dataTest}-recommended-icon`
109
- }))), onOptionsClick ? /*#__PURE__*/React.createElement("div", {
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,
110
102
  ref: optionsRef,
111
- "data-test": `${dataTest}-menu-${id}`,
112
- className: `jsx-${styles.__hash}` + " " + "optionsWrapper"
103
+ "data-test": `${dataTest}-menu-${id}`
113
104
  }, this.state.mouseOver && !isDeactivated && !isLocked ? /*#__PURE__*/React.createElement(OptionsButton, {
105
+ style: styles.optionsButton,
114
106
  onClick: this.onOptionsClick(id, optionsRef)
115
- }) : null) : null, isLocked && /*#__PURE__*/React.createElement("div", {
116
- className: `jsx-${styles.__hash}` + " " + "lockWrapper"
117
- }, LockIcon)), /*#__PURE__*/React.createElement(_JSXStyle, {
118
- id: styles.__hash
119
- }, styles));
107
+ }) : null) : null);
120
108
  }
121
109
  }
122
110
  DimensionItem.propTypes = {
@@ -124,12 +112,12 @@ DimensionItem.propTypes = {
124
112
  isSelected: PropTypes.bool.isRequired,
125
113
  // XXX
126
114
  name: PropTypes.string.isRequired,
127
- className: PropTypes.string,
128
115
  dataTest: PropTypes.string,
129
116
  innerRef: PropTypes.func,
130
117
  isDeactivated: PropTypes.bool,
131
118
  isLocked: PropTypes.bool,
132
119
  isRecommended: PropTypes.bool,
120
+ style: PropTypes.object,
133
121
  onClick: PropTypes.func,
134
122
  onOptionsClick: PropTypes.func
135
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(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);}"]));
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