@dhis2-ui/header-bar 10.16.3-alpha.1 → 10.16.4

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 (40) hide show
  1. package/build/cjs/__e2e__/stories/common.js +6 -11
  2. package/build/cjs/__e2e__/stories/with-update-available-notification.js +1 -2
  3. package/build/cjs/apps.js +51 -66
  4. package/build/cjs/debug-info/debug-info-menu-item.js +4 -5
  5. package/build/cjs/debug-info/debug-info-modal.js +3 -4
  6. package/build/cjs/features/the_headerbar_contains_a_profile_menu/the_user_name_and_email_are_displayed.js +2 -4
  7. package/build/cjs/features/the_search_should_escape_regexp_character/the_modules_do_not_contain_items_with_special_chars.js +1 -2
  8. package/build/cjs/header-bar-context.js +6 -8
  9. package/build/cjs/header-bar.js +12 -14
  10. package/build/cjs/header-bar.prod.stories.js +1 -2
  11. package/build/cjs/join-path.js +1 -4
  12. package/build/cjs/locales/index.js +106 -65
  13. package/build/cjs/notification-icon.js +21 -24
  14. package/build/cjs/notifications.js +5 -6
  15. package/build/cjs/online-status.js +3 -4
  16. package/build/cjs/profile-menu/profile-header.js +44 -57
  17. package/build/cjs/profile-menu/profile-menu.js +17 -22
  18. package/build/cjs/profile-menu/update-notification.js +4 -5
  19. package/build/cjs/profile.js +7 -9
  20. package/build/cjs/title.js +9 -12
  21. package/build/es/__e2e__/stories/common.js +5 -9
  22. package/build/es/apps.js +50 -64
  23. package/build/es/debug-info/debug-info-menu-item.js +4 -5
  24. package/build/es/debug-info/debug-info-modal.js +3 -4
  25. package/build/es/features/the_headerbar_contains_a_profile_menu/the_user_name_and_email_are_displayed.js +2 -4
  26. package/build/es/features/the_search_should_escape_regexp_character/the_modules_do_not_contain_items_with_special_chars.js +1 -2
  27. package/build/es/header-bar-context.js +5 -6
  28. package/build/es/header-bar.js +11 -12
  29. package/build/es/join-path.js +1 -4
  30. package/build/es/locales/index.js +78 -37
  31. package/build/es/notification-icon.js +21 -24
  32. package/build/es/notifications.js +5 -6
  33. package/build/es/online-status.js +3 -4
  34. package/build/es/profile-menu/profile-header.js +44 -57
  35. package/build/es/profile-menu/profile-menu.js +16 -20
  36. package/build/es/profile-menu/update-notification.js +4 -5
  37. package/build/es/profile.js +6 -7
  38. package/build/es/title.js +9 -12
  39. package/package.json +15 -15
  40. package/src/locales/index.js +114 -37
@@ -22,30 +22,27 @@ function icon(kind) {
22
22
  });
23
23
  }
24
24
  }
25
- const NotificationIcon = _ref => {
26
- let {
27
- count = 0,
28
- href,
29
- kind,
30
- dataTestId,
31
- title,
32
- 'aria-label': ariaLabel
33
- } = _ref;
34
- return /*#__PURE__*/_react.default.createElement("a", {
35
- dir: "ltr",
36
- href: href,
37
- "data-test": dataTestId,
38
- title: _index.default.t(title),
39
- "aria-label": _index.default.t(ariaLabel),
40
- className: _style.default.dynamic([["995028205", [_uiConstants.spacers.dp12, _uiConstants.spacers.dp12, _uiConstants.theme.secondary500, _uiConstants.colors.white, _uiConstants.spacers.dp4]]]) + " " + (kind || "")
41
- }, icon(kind), count > 0 && /*#__PURE__*/_react.default.createElement("span", {
42
- "data-test": `${dataTestId}-count`,
43
- className: _style.default.dynamic([["995028205", [_uiConstants.spacers.dp12, _uiConstants.spacers.dp12, _uiConstants.theme.secondary500, _uiConstants.colors.white, _uiConstants.spacers.dp4]]])
44
- }, count), /*#__PURE__*/_react.default.createElement(_style.default, {
45
- id: "995028205",
46
- dynamic: [_uiConstants.spacers.dp12, _uiConstants.spacers.dp12, _uiConstants.theme.secondary500, _uiConstants.colors.white, _uiConstants.spacers.dp4]
47
- }, [`a.__jsx-style-dynamic-selector{position:relative;margin:0;cursor:pointer;padding:0 ${_uiConstants.spacers.dp12};height:100%;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;}`, "a.__jsx-style-dynamic-selector:focus{outline:2px solid white;outline-offset:-2px;}", "a.__jsx-style-dynamic-selector:focus.__jsx-style-dynamic-selector:not(:focus-visible){outline:none;}", "a.__jsx-style-dynamic-selector:hover{background:#1a557f;}", "a.__jsx-style-dynamic-selector:active{background:#104067;}", `span.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;z-index:1;position:absolute;top:3px;inset-inline-end:2px;min-width:18px;min-height:18px;border-radius:${_uiConstants.spacers.dp12};box-shadow:0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06);background-color:${_uiConstants.theme.secondary500};color:${_uiConstants.colors.white};font-size:13px;font-weight:600;line-height:15px;text-align:center;cursor:inherit;padding:0 ${_uiConstants.spacers.dp4};}`]));
48
- };
25
+ const NotificationIcon = ({
26
+ count = 0,
27
+ href,
28
+ kind,
29
+ dataTestId,
30
+ title,
31
+ 'aria-label': ariaLabel
32
+ }) => /*#__PURE__*/_react.default.createElement("a", {
33
+ dir: "ltr",
34
+ href: href,
35
+ "data-test": dataTestId,
36
+ title: _index.default.t(title),
37
+ "aria-label": _index.default.t(ariaLabel),
38
+ className: _style.default.dynamic([["995028205", [_uiConstants.spacers.dp12, _uiConstants.spacers.dp12, _uiConstants.theme.secondary500, _uiConstants.colors.white, _uiConstants.spacers.dp4]]]) + " " + (kind || "")
39
+ }, icon(kind), count > 0 && /*#__PURE__*/_react.default.createElement("span", {
40
+ "data-test": `${dataTestId}-count`,
41
+ className: _style.default.dynamic([["995028205", [_uiConstants.spacers.dp12, _uiConstants.spacers.dp12, _uiConstants.theme.secondary500, _uiConstants.colors.white, _uiConstants.spacers.dp4]]])
42
+ }, count), /*#__PURE__*/_react.default.createElement(_style.default, {
43
+ id: "995028205",
44
+ dynamic: [_uiConstants.spacers.dp12, _uiConstants.spacers.dp12, _uiConstants.theme.secondary500, _uiConstants.colors.white, _uiConstants.spacers.dp4]
45
+ }, [`a.__jsx-style-dynamic-selector{position:relative;margin:0;cursor:pointer;padding:0 ${_uiConstants.spacers.dp12};height:100%;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;}`, "a.__jsx-style-dynamic-selector:focus{outline:2px solid white;outline-offset:-2px;}", "a.__jsx-style-dynamic-selector:focus.__jsx-style-dynamic-selector:not(:focus-visible){outline:none;}", "a.__jsx-style-dynamic-selector:hover{background:#1a557f;}", "a.__jsx-style-dynamic-selector:active{background:#104067;}", `span.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;z-index:1;position:absolute;top:3px;inset-inline-end:2px;min-width:18px;min-height:18px;border-radius:${_uiConstants.spacers.dp12};box-shadow:0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06);background-color:${_uiConstants.theme.secondary500};color:${_uiConstants.colors.white};font-size:13px;font-weight:600;line-height:15px;text-align:center;cursor:inherit;padding:0 ${_uiConstants.spacers.dp4};}`]));
49
46
  exports.NotificationIcon = NotificationIcon;
50
47
  NotificationIcon.propTypes = {
51
48
  'aria-label': _propTypes.default.string.isRequired,
@@ -13,12 +13,11 @@ var _index = _interopRequireDefault(require("./locales/index.js"));
13
13
  var _notificationIcon = require("./notification-icon.js");
14
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
15
  const hasAuthority = (userAuthorities, authId) => Array.isArray(userAuthorities) && userAuthorities.some(userAuthId => userAuthId === 'ALL' || userAuthId === authId);
16
- const Notifications = _ref => {
17
- let {
18
- interpretations,
19
- messages,
20
- userAuthorities
21
- } = _ref;
16
+ const Notifications = ({
17
+ interpretations,
18
+ messages,
19
+ userAuthorities
20
+ }) => {
22
21
  const {
23
22
  baseUrl
24
23
  } = (0, _appRuntime.useConfig)();
@@ -13,10 +13,9 @@ var _index = _interopRequireDefault(require("./locales/index.js"));
13
13
  var _onlineStatusStyles = _interopRequireDefault(require("./online-status.styles.js"));
14
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
15
  /** A badge to display online/offline status in the header bar */
16
- function OnlineStatus(_ref) {
17
- let {
18
- dense
19
- } = _ref;
16
+ function OnlineStatus({
17
+ dense
18
+ }) {
20
19
  const {
21
20
  isConnected: online
22
21
  } = (0, _appRuntime.useDhis2ConnectionStatus)();
@@ -12,38 +12,31 @@ var _react = _interopRequireDefault(require("react"));
12
12
  var _joinPath = require("../join-path.js");
13
13
  var _index = _interopRequireDefault(require("../locales/index.js"));
14
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
- const ProfileName = _ref => {
16
- let {
17
- children
18
- } = _ref;
19
- return /*#__PURE__*/_react.default.createElement("div", {
20
- "data-test": "headerbar-profile-username",
21
- className: "jsx-2223023701"
22
- }, children, /*#__PURE__*/_react.default.createElement(_style.default, {
23
- id: "2223023701"
24
- }, ["div.jsx-2223023701{margin-bottom:3px;font-size:16px;line-height:19px;}"]));
25
- };
15
+ const ProfileName = ({
16
+ children
17
+ }) => /*#__PURE__*/_react.default.createElement("div", {
18
+ "data-test": "headerbar-profile-username",
19
+ className: "jsx-2223023701"
20
+ }, children, /*#__PURE__*/_react.default.createElement(_style.default, {
21
+ id: "2223023701"
22
+ }, ["div.jsx-2223023701{margin-bottom:3px;font-size:16px;line-height:19px;}"]));
26
23
  ProfileName.propTypes = {
27
24
  children: _propTypes.default.string
28
25
  };
29
- const ProfileEmail = _ref2 => {
30
- let {
31
- children
32
- } = _ref2;
33
- return /*#__PURE__*/_react.default.createElement("div", {
34
- "data-test": "headerbar-profile-user-email",
35
- className: "jsx-1072768994"
36
- }, children, /*#__PURE__*/_react.default.createElement(_style.default, {
37
- id: "1072768994"
38
- }, ["div.jsx-1072768994{margin-bottom:6px;font-size:14px;line-height:16px;}"]));
39
- };
26
+ const ProfileEmail = ({
27
+ children
28
+ }) => /*#__PURE__*/_react.default.createElement("div", {
29
+ "data-test": "headerbar-profile-user-email",
30
+ className: "jsx-1072768994"
31
+ }, children, /*#__PURE__*/_react.default.createElement(_style.default, {
32
+ id: "1072768994"
33
+ }, ["div.jsx-1072768994{margin-bottom:6px;font-size:14px;line-height:16px;}"]));
40
34
  ProfileEmail.propTypes = {
41
35
  children: _propTypes.default.string
42
36
  };
43
- const ProfileEdit = _ref3 => {
44
- let {
45
- children
46
- } = _ref3;
37
+ const ProfileEdit = ({
38
+ children
39
+ }) => {
47
40
  const {
48
41
  baseUrl
49
42
  } = (0, _appRuntime.useConfig)();
@@ -58,41 +51,35 @@ const ProfileEdit = _ref3 => {
58
51
  ProfileEdit.propTypes = {
59
52
  children: _propTypes.default.string
60
53
  };
61
- const ProfileDetails = _ref4 => {
62
- let {
63
- name,
64
- email
65
- } = _ref4;
66
- return /*#__PURE__*/_react.default.createElement("div", {
67
- className: "jsx-4236878114"
68
- }, /*#__PURE__*/_react.default.createElement(ProfileName, null, name), /*#__PURE__*/_react.default.createElement(ProfileEmail, null, email), /*#__PURE__*/_react.default.createElement(ProfileEdit, null, _index.default.t('Edit profile')), /*#__PURE__*/_react.default.createElement(_style.default, {
69
- id: "4236878114"
70
- }, ["div.jsx-4236878114{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;margin-inline-start:20px;color:#000;font-size:14px;font-weight:400;}"]));
71
- };
54
+ const ProfileDetails = ({
55
+ name,
56
+ email
57
+ }) => /*#__PURE__*/_react.default.createElement("div", {
58
+ className: "jsx-4236878114"
59
+ }, /*#__PURE__*/_react.default.createElement(ProfileName, null, name), /*#__PURE__*/_react.default.createElement(ProfileEmail, null, email), /*#__PURE__*/_react.default.createElement(ProfileEdit, null, _index.default.t('Edit profile')), /*#__PURE__*/_react.default.createElement(_style.default, {
60
+ id: "4236878114"
61
+ }, ["div.jsx-4236878114{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;margin-inline-start:20px;color:#000;font-size:14px;font-weight:400;}"]));
72
62
  ProfileDetails.propTypes = {
73
63
  email: _propTypes.default.string,
74
64
  name: _propTypes.default.string
75
65
  };
76
- const ProfileHeader = _ref5 => {
77
- let {
78
- name,
79
- email,
80
- avatarId
81
- } = _ref5;
82
- return /*#__PURE__*/_react.default.createElement("div", {
83
- className: "jsx-371352323"
84
- }, /*#__PURE__*/_react.default.createElement(_userAvatar.UserAvatar, {
85
- avatarId: avatarId,
86
- name: name,
87
- dataTest: "headerbar-profile-menu-icon",
88
- large: true
89
- }), /*#__PURE__*/_react.default.createElement(ProfileDetails, {
90
- name: name,
91
- email: email
92
- }), /*#__PURE__*/_react.default.createElement(_style.default, {
93
- id: "371352323"
94
- }, ["div.jsx-371352323{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;margin-inline-start:24px;padding-top:20px;}"]));
95
- };
66
+ const ProfileHeader = ({
67
+ name,
68
+ email,
69
+ avatarId
70
+ }) => /*#__PURE__*/_react.default.createElement("div", {
71
+ className: "jsx-371352323"
72
+ }, /*#__PURE__*/_react.default.createElement(_userAvatar.UserAvatar, {
73
+ avatarId: avatarId,
74
+ name: name,
75
+ dataTest: "headerbar-profile-menu-icon",
76
+ large: true
77
+ }), /*#__PURE__*/_react.default.createElement(ProfileDetails, {
78
+ name: name,
79
+ email: email
80
+ }), /*#__PURE__*/_react.default.createElement(_style.default, {
81
+ id: "371352323"
82
+ }, ["div.jsx-371352323{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;margin-inline-start:24px;padding-top:20px;}"]));
96
83
  exports.ProfileHeader = ProfileHeader;
97
84
  ProfileHeader.propTypes = {
98
85
  avatarId: _propTypes.default.string,
@@ -21,23 +21,21 @@ var _joinPath = require("../join-path.js");
21
21
  var _index = _interopRequireDefault(require("../locales/index.js"));
22
22
  var _profileHeader = require("./profile-header.js");
23
23
  var _updateNotification = require("./update-notification.js");
24
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
25
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
26
25
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
27
26
  const LoadingMask = () => /*#__PURE__*/_react.default.createElement(_layer.Layer, {
28
27
  translucent: true,
29
28
  disablePortal: true,
30
29
  dataTest: "headerbar-profile-menu-loading-mask"
31
30
  }, /*#__PURE__*/_react.default.createElement(_center.Center, null, /*#__PURE__*/_react.default.createElement(_loader.CircularLoader, null)));
32
- const ProfileContents = _ref => {
33
- let {
34
- name,
35
- email,
36
- avatarId,
37
- helpUrl,
38
- hideProfileMenu,
39
- showDebugInfoModal
40
- } = _ref;
31
+ const ProfileContents = ({
32
+ name,
33
+ email,
34
+ avatarId,
35
+ helpUrl,
36
+ hideProfileMenu,
37
+ showDebugInfoModal
38
+ }) => {
41
39
  const {
42
40
  baseUrl
43
41
  } = (0, _appRuntime.useConfig)();
@@ -117,17 +115,14 @@ ProfileContents.propTypes = {
117
115
  helpUrl: _propTypes.default.string,
118
116
  name: _propTypes.default.string
119
117
  };
120
- const ProfileMenu = _ref2 => {
121
- let {
122
- ...props
123
- } = _ref2;
124
- return /*#__PURE__*/_react.default.createElement("div", {
125
- "data-test": "headerbar-profile-menu",
126
- className: "jsx-3924623997"
127
- }, /*#__PURE__*/_react.default.createElement(ProfileContents, props), /*#__PURE__*/_react.default.createElement(_style.default, {
128
- id: "3924623997"
129
- }, ["div.jsx-3924623997{z-index:10000;position:absolute;inset-inline-end:4px;width:320px;}"]));
130
- };
118
+ const ProfileMenu = ({
119
+ ...props
120
+ }) => /*#__PURE__*/_react.default.createElement("div", {
121
+ "data-test": "headerbar-profile-menu",
122
+ className: "jsx-3924623997"
123
+ }, /*#__PURE__*/_react.default.createElement(ProfileContents, props), /*#__PURE__*/_react.default.createElement(_style.default, {
124
+ id: "3924623997"
125
+ }, ["div.jsx-3924623997{z-index:10000;position:absolute;inset-inline-end:4px;width:320px;}"]));
131
126
  exports.ProfileMenu = ProfileMenu;
132
127
  ProfileMenu.propTypes = {
133
128
  hideProfileMenu: _propTypes.default.func.isRequired,
@@ -13,10 +13,9 @@ var _react = _interopRequireDefault(require("react"));
13
13
  var _headerBarContext = require("../header-bar-context.js");
14
14
  var _index = _interopRequireDefault(require("../locales/index.js"));
15
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
- function UpdateNotification(_ref) {
17
- let {
18
- hideProfileMenu
19
- } = _ref;
16
+ function UpdateNotification({
17
+ hideProfileMenu
18
+ }) {
20
19
  const {
21
20
  appName
22
21
  } = (0, _appRuntime.useConfig)();
@@ -26,7 +25,7 @@ function UpdateNotification(_ref) {
26
25
  } = (0, _headerBarContext.useHeaderBarContext)();
27
26
  const onClick = () => {
28
27
  hideProfileMenu();
29
- onApplyAvailableUpdate === null || onApplyAvailableUpdate === void 0 ? void 0 : onApplyAvailableUpdate();
28
+ onApplyAvailableUpdate === null || onApplyAvailableUpdate === void 0 || onApplyAvailableUpdate();
30
29
  };
31
30
  const updateNotificationLabel = /*#__PURE__*/_react.default.createElement("div", {
32
31
  className: _style.default.dynamic([["4135170305", [_uiConstants.colors.blue600]]]) + " " + "root"
@@ -12,16 +12,14 @@ var _debugInfoModal = require("./debug-info/debug-info-modal.js");
12
12
  var _index = _interopRequireDefault(require("./locales/index.js"));
13
13
  var _useOnDocClick = require("./profile/use-on-doc-click.js");
14
14
  var _index2 = require("./profile-menu/index.js");
15
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
16
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
17
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
- const Profile = _ref => {
19
- let {
20
- name,
21
- email,
22
- avatarId,
23
- helpUrl
24
- } = _ref;
17
+ const Profile = ({
18
+ name,
19
+ email,
20
+ avatarId,
21
+ helpUrl
22
+ }) => {
25
23
  const [showProfileMenu, setShowProfileMenu] = (0, _react.useState)(false);
26
24
  const [showDebugInfoModal, setShowDebugInfoModal] = (0, _react.useState)(false);
27
25
  const hideProfileMenu = (0, _react.useCallback)(() => setShowProfileMenu(false), [setShowProfileMenu]);
@@ -8,18 +8,15 @@ var _style = _interopRequireDefault(require("styled-jsx/style"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- const Title = _ref => {
12
- let {
13
- app,
14
- instance
15
- } = _ref;
16
- return /*#__PURE__*/_react.default.createElement("div", {
17
- "data-test": "headerbar-title",
18
- className: "jsx-2721515324"
19
- }, app ? `${instance} - ${app}` : `${instance}`, /*#__PURE__*/_react.default.createElement(_style.default, {
20
- id: "2721515324"
21
- }, ["div.jsx-2721515324{overflow:hidden;text-overflow:ellipsis;font-size:14px;font-weight:500;-webkit-letter-spacing:0.01em;-moz-letter-spacing:0.01em;-ms-letter-spacing:0.01em;letter-spacing:0.01em;white-space:nowrap;}"]));
22
- };
11
+ const Title = ({
12
+ app,
13
+ instance
14
+ }) => /*#__PURE__*/_react.default.createElement("div", {
15
+ "data-test": "headerbar-title",
16
+ className: "jsx-2721515324"
17
+ }, app ? `${instance} - ${app}` : `${instance}`, /*#__PURE__*/_react.default.createElement(_style.default, {
18
+ id: "2721515324"
19
+ }, ["div.jsx-2721515324{overflow:hidden;text-overflow:ellipsis;font-size:14px;font-weight:500;-webkit-letter-spacing:0.01em;-moz-letter-spacing:0.01em;-ms-letter-spacing:0.01em;letter-spacing:0.01em;white-space:nowrap;}"]));
23
20
  exports.Title = Title;
24
21
  Title.propTypes = {
25
22
  app: _propTypes.default.string,
@@ -94,8 +94,7 @@ export const dataProviderData = {
94
94
 
95
95
  // Trailing "HeaderBar" because storybook is confusing this with the
96
96
  // helper from the org unit tree's common.js helper with the same name
97
- export const createDecoratorCustomDataProviderHeaderBar = function () {
98
- let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : dataProviderData;
97
+ export const createDecoratorCustomDataProviderHeaderBar = (data = dataProviderData) => {
99
98
  return fn => {
100
99
  window.dataProviderData = data;
101
100
  return /*#__PURE__*/React.createElement(CustomDataProvider, {
@@ -154,10 +153,9 @@ export const providerConfig = {
154
153
  baseUrl: 'https://domain.tld/',
155
154
  apiVersion: ''
156
155
  };
157
- const MockAlert = _ref => {
158
- let {
159
- alert
160
- } = _ref;
156
+ const MockAlert = ({
157
+ alert
158
+ }) => {
161
159
  useEffect(() => {
162
160
  var _alert$options;
163
161
  if ((_alert$options = alert.options) !== null && _alert$options !== void 0 && _alert$options.duration) {
@@ -202,9 +200,7 @@ export const mockOfflineInterface = {
202
200
  subscribeToDhis2ConnectionStatus: () => () => undefined,
203
201
  latestIsConnected: true
204
202
  };
205
- export const createDecoratorProvider = function () {
206
- let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : providerConfig;
207
- let offlineInterface = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : mockOfflineInterface;
203
+ export const createDecoratorProvider = (config = providerConfig, offlineInterface = mockOfflineInterface) => {
208
204
  return fn => /*#__PURE__*/React.createElement(Provider, {
209
205
  config: config,
210
206
  offlineInterface: offlineInterface
package/build/es/apps.js CHANGED
@@ -16,11 +16,10 @@ import i18n from './locales/index.js';
16
16
  function escapeRegExpCharacters(text) {
17
17
  return text.replace(/[/.*+?^${}()|[\]\\]/g, '\\$&');
18
18
  }
19
- function Search(_ref) {
20
- let {
21
- value,
22
- onChange
23
- } = _ref;
19
+ function Search({
20
+ value,
21
+ onChange
22
+ }) {
24
23
  const {
25
24
  baseUrl
26
25
  } = useConfig();
@@ -49,12 +48,11 @@ Search.propTypes = {
49
48
  value: PropTypes.string.isRequired,
50
49
  onChange: PropTypes.func.isRequired
51
50
  };
52
- function Item(_ref2) {
53
- let {
54
- name,
55
- path,
56
- img
57
- } = _ref2;
51
+ function Item({
52
+ name,
53
+ path,
54
+ img
55
+ }) {
58
56
  return /*#__PURE__*/React.createElement("a", {
59
57
  href: path,
60
58
  className: _JSXStyle.dynamic([["1412616027", [theme.primary050]]])
@@ -74,37 +72,32 @@ Item.propTypes = {
74
72
  name: PropTypes.string,
75
73
  path: PropTypes.string
76
74
  };
77
- function List(_ref3) {
78
- let {
79
- apps,
80
- filter
81
- } = _ref3;
75
+ function List({
76
+ apps,
77
+ filter
78
+ }) {
82
79
  return /*#__PURE__*/React.createElement("div", {
83
80
  "data-test": "headerbar-apps-menu-list",
84
81
  className: "jsx-2424821176"
85
- }, apps.filter(_ref4 => {
86
- let {
87
- displayName,
88
- name
89
- } = _ref4;
82
+ }, apps.filter(({
83
+ displayName,
84
+ name
85
+ }) => {
90
86
  const appName = displayName || name;
91
87
  const formattedAppName = appName.toLowerCase();
92
88
  const formattedFilter = escapeRegExpCharacters(filter).toLowerCase();
93
89
  return filter.length > 0 ? formattedAppName.match(formattedFilter) : true;
94
- }).map((_ref5, idx) => {
95
- let {
96
- displayName,
97
- name,
98
- defaultAction,
99
- icon
100
- } = _ref5;
101
- return /*#__PURE__*/React.createElement(Item, {
102
- key: `app-${name}-${idx}`,
103
- name: displayName || name,
104
- path: defaultAction,
105
- img: icon
106
- });
107
- }), /*#__PURE__*/React.createElement(_JSXStyle, {
90
+ }).map(({
91
+ displayName,
92
+ name,
93
+ defaultAction,
94
+ icon
95
+ }, idx) => /*#__PURE__*/React.createElement(Item, {
96
+ key: `app-${name}-${idx}`,
97
+ name: displayName || name,
98
+ path: defaultAction,
99
+ img: icon
100
+ })), /*#__PURE__*/React.createElement(_JSXStyle, {
108
101
  id: "2424821176"
109
102
  }, ["div.jsx-2424821176{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-align-content:flex-start;-ms-flex-line-pack:start;align-content:flex-start;-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;-webkit-box-pack:start;-webkit-justify-content:flex-start;-ms-flex-pack:start;justify-content:flex-start;width:30vw;min-width:300px;max-width:560px;min-height:200px;max-height:465px;margin-block-start:0;margin-block-end:8px;margin-inline:8px;overflow:auto;overflow-x:hidden;}"]));
110
103
  }
@@ -112,43 +105,36 @@ List.propTypes = {
112
105
  apps: PropTypes.array,
113
106
  filter: PropTypes.string
114
107
  };
115
- const AppMenu = _ref6 => {
116
- let {
117
- apps,
118
- filter,
119
- onFilterChange
120
- } = _ref6;
121
- return /*#__PURE__*/React.createElement("div", {
122
- "data-test": "headerbar-apps-menu",
123
- className: "jsx-3826299842"
124
- }, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Search, {
125
- value: filter,
126
- onChange: onFilterChange
127
- }), /*#__PURE__*/React.createElement(List, {
128
- apps: apps,
129
- filter: filter
130
- })), /*#__PURE__*/React.createElement(_JSXStyle, {
131
- id: "3826299842"
132
- }, ["div.jsx-3826299842{z-index:10000;position:absolute;inset-inline-end:-4px;}"]));
133
- };
108
+ const AppMenu = ({
109
+ apps,
110
+ filter,
111
+ onFilterChange
112
+ }) => /*#__PURE__*/React.createElement("div", {
113
+ "data-test": "headerbar-apps-menu",
114
+ className: "jsx-3826299842"
115
+ }, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Search, {
116
+ value: filter,
117
+ onChange: onFilterChange
118
+ }), /*#__PURE__*/React.createElement(List, {
119
+ apps: apps,
120
+ filter: filter
121
+ })), /*#__PURE__*/React.createElement(_JSXStyle, {
122
+ id: "3826299842"
123
+ }, ["div.jsx-3826299842{z-index:10000;position:absolute;inset-inline-end:-4px;}"]));
134
124
  AppMenu.propTypes = {
135
125
  apps: PropTypes.array.isRequired,
136
126
  onFilterChange: PropTypes.func.isRequired,
137
127
  filter: PropTypes.string
138
128
  };
139
- const Apps = _ref7 => {
140
- let {
141
- apps
142
- } = _ref7;
129
+ const Apps = ({
130
+ apps
131
+ }) => {
143
132
  const [show, setShow] = useState(false);
144
133
  const [filter, setFilter] = useState('');
145
134
  const handleVisibilityToggle = useCallback(() => setShow(!show), [show]);
146
- const handleFilterChange = useCallback(_ref8 => {
147
- let {
148
- value
149
- } = _ref8;
150
- return setFilter(value);
151
- }, []);
135
+ const handleFilterChange = useCallback(({
136
+ value
137
+ }) => setFilter(value), []);
152
138
  const containerEl = useRef(null);
153
139
  const onDocClick = useCallback(evt => {
154
140
  if (containerEl.current && !containerEl.current.contains(evt.target)) {
@@ -5,11 +5,10 @@ import PropTypes from 'prop-types';
5
5
  import React from 'react';
6
6
  import i18n from '../locales/index.js';
7
7
  import { useDebugInfo } from './use-debug-info.js';
8
- export const DebugInfoMenuItem = _ref => {
9
- let {
10
- hideProfileMenu,
11
- showDebugInfoModal
12
- } = _ref;
8
+ export const DebugInfoMenuItem = ({
9
+ hideProfileMenu,
10
+ showDebugInfoModal
11
+ }) => {
13
12
  const debugInfo = useDebugInfo();
14
13
  const openDebugModal = () => {
15
14
  hideProfileMenu();
@@ -6,10 +6,9 @@ import React from 'react';
6
6
  import i18n from '../locales/index.js';
7
7
  import { DebugInfoTable } from './debug-info-table.js';
8
8
  import { useFormattedDebugInfo } from './use-debug-info.js';
9
- export function DebugInfoModal(_ref) {
10
- let {
11
- onClose
12
- } = _ref;
9
+ export function DebugInfoModal({
10
+ onClose
11
+ }) {
13
12
  const debugInfo = useFormattedDebugInfo();
14
13
  const {
15
14
  show: showClipboardAlert
@@ -1,7 +1,6 @@
1
1
  import { Then } from '@badeball/cypress-cucumber-preprocessor';
2
2
  Then('contains the user name', () => {
3
- cy.all(() => cy.window(), () => cy.get('[data-test="headerbar-profile-username"]')).then(_ref => {
4
- let [win, $name] = _ref;
3
+ cy.all(() => cy.window(), () => cy.get('[data-test="headerbar-profile-username"]')).then(([win, $name]) => {
5
4
  console.log('win.dataProviderData', win.dataProviderData);
6
5
  const {
7
6
  name
@@ -10,8 +9,7 @@ Then('contains the user name', () => {
10
9
  });
11
10
  });
12
11
  Then('contains the user email', () => {
13
- cy.all(() => cy.window(), () => cy.get('[data-test="headerbar-profile-user-email"]')).then(_ref2 => {
14
- let [win, $email] = _ref2;
12
+ cy.all(() => cy.window(), () => cy.get('[data-test="headerbar-profile-user-email"]')).then(([win, $email]) => {
15
13
  const {
16
14
  email
17
15
  } = win.dataProviderData.me;
@@ -1,8 +1,7 @@
1
1
  import { Given, Then } from '@badeball/cypress-cucumber-preprocessor';
2
2
  Given(/no app name contains a (.*)/, character => {
3
3
  // Needs to be wrapped, otherwise for some reason the wrong char is in the scope
4
- cy.all(() => cy.window(), () => cy.wrap(character)).then(_ref => {
5
- let [win, char] = _ref;
4
+ cy.all(() => cy.window(), () => cy.wrap(character)).then(([win, char]) => {
6
5
  const {
7
6
  dataProviderData
8
7
  } = win;
@@ -4,12 +4,11 @@ const headerBarContext = /*#__PURE__*/createContext({
4
4
  updateAvailable: false,
5
5
  onApplyAvailableUpdate: () => {}
6
6
  });
7
- export const HeaderBarContextProvider = _ref => {
8
- let {
9
- updateAvailable,
10
- onApplyAvailableUpdate,
11
- children
12
- } = _ref;
7
+ export const HeaderBarContextProvider = ({
8
+ updateAvailable,
9
+ onApplyAvailableUpdate,
10
+ children
11
+ }) => {
13
12
  return /*#__PURE__*/React.createElement(headerBarContext.Provider, {
14
13
  value: {
15
14
  updateAvailable,